var F_=Object.defineProperty;var U_=(r,t,i)=>t in r?F_(r,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[t]=i;var $_=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var jn=(r,t,i)=>U_(r,typeof t!="symbol"?t+"":t,i);var g1=$_((_1,zg)=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const c of s)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(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(s){if(s.ep)return;s.ep=!0;const c=i(s);fetch(s.href,c)}})();var as=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ho(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Uc={exports:{}},Po={},$c={exports:{}},xe={};/** * @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 sh;function z_(){if(sh)return xe;sh=1;var r=Symbol.for("react.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),S=Symbol.iterator;function E(I){return I===null||typeof I!="object"?null:(I=S&&I[S]||I["@@iterator"],typeof I=="function"?I:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,L={};function B(I,J,me){this.props=I,this.context=J,this.refs=L,this.updater=me||M}B.prototype.isReactComponent={},B.prototype.setState=function(I,J){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,J,"setState")},B.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function W(){}W.prototype=B.prototype;function te(I,J,me){this.props=I,this.context=J,this.refs=L,this.updater=me||M}var Y=te.prototype=new W;Y.constructor=te,D(Y,B.prototype),Y.isPureReactComponent=!0;var j=Array.isArray,P=Object.prototype.hasOwnProperty,T={current:null},x={key:!0,ref:!0,__self:!0,__source:!0};function R(I,J,me){var he,d={},g=null,y=null;if(J!=null)for(he in J.ref!==void 0&&(y=J.ref),J.key!==void 0&&(g=""+J.key),J)P.call(J,he)&&!x.hasOwnProperty(he)&&(d[he]=J[he]);var C=arguments.length-2;if(C===1)d.children=me;else if(1>>1,J=Z[I];if(0>>1;Is(d,Q))gs(y,d)?(Z[I]=y,Z[g]=Q,I=g):(Z[I]=d,Z[he]=Q,I=he);else if(gs(y,Q))Z[I]=y,Z[g]=Q,I=g;else break e}}return ie}function s(Z,ie){var Q=Z.sortIndex-ie.sortIndex;return Q!==0?Q:Z.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var p=Date,h=p.now();r.unstable_now=function(){return p.now()-h}}var f=[],_=[],v=1,S=null,E=3,M=!1,D=!1,L=!1,B=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Y(Z){for(var ie=i(_);ie!==null;){if(ie.callback===null)a(_);else if(ie.startTime<=Z)a(_),ie.sortIndex=ie.expirationTime,t(f,ie);else break;ie=i(_)}}function j(Z){if(L=!1,Y(Z),!D)if(i(f)!==null)D=!0,Oe(P);else{var ie=i(_);ie!==null&&ve(j,ie.startTime-Z)}}function P(Z,ie){D=!1,L&&(L=!1,W(R),R=-1),M=!0;var Q=E;try{for(Y(ie),S=i(f);S!==null&&(!(S.expirationTime>ie)||Z&&!ae());){var I=S.callback;if(typeof I=="function"){S.callback=null,E=S.priorityLevel;var J=I(S.expirationTime<=ie);ie=r.unstable_now(),typeof J=="function"?S.callback=J:S===i(f)&&a(f),Y(ie)}else a(f);S=i(f)}if(S!==null)var me=!0;else{var he=i(_);he!==null&&ve(j,he.startTime-ie),me=!1}return me}finally{S=null,E=Q,M=!1}}var T=!1,x=null,R=-1,q=5,z=-1;function ae(){return!(r.unstable_now()-zZ||125I?(Z.sortIndex=Q,t(_,Z),i(f)===null&&Z===i(_)&&(L?(W(R),R=-1):L=!0,ve(j,Q-I))):(Z.sortIndex=J,t(f,Z),D||M||(D=!0,Oe(P))),Z},r.unstable_shouldYield=ae,r.unstable_wrapCallback=function(Z){var ie=E;return function(){var Q=E;E=ie;try{return Z.apply(this,arguments)}finally{E=Q}}}}(qc)),qc}var fh;function J_(){return fh||(fh=1,Vc.exports=W_()),Vc.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 ph;function G_(){if(ph)return jt;ph=1;var r=Zu(),t=J_();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=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]*$/,v={},S={};function E(e){return f.call(S,e)?!0:f.call(v,e)?!1:_.test(e)?S[e]=!0:(v[e]=!0,!1)}function M(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function D(e,n,o,l){if(n===null||typeof n>"u"||M(e,n,o,l))return!0;if(l)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function L(e,n,o,l,u,m,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=u,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=m,this.removeEmptyString=w}var B={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){B[e]=new L(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];B[n]=new L(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){B[e]=new L(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){B[e]=new L(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){B[e]=new L(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){B[e]=new L(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){B[e]=new L(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){B[e]=new L(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){B[e]=new L(e,5,!1,e.toLowerCase(),null,!1,!1)});var W=/[\-:]([a-z])/g;function te(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 n=e.replace(W,te);B[n]=new L(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(W,te);B[n]=new L(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(W,te);B[n]=new L(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){B[e]=new L(e,1,!1,e.toLowerCase(),null,!1,!1)}),B.xlinkHref=new L("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){B[e]=new L(e,1,!1,e.toLowerCase(),null,!0,!0)});function Y(e,n,o,l){var u=B.hasOwnProperty(n)?B[n]:null;(u!==null?u.type!==0:l||!(2b||u[w]!==m[b]){var O=` `+u[w].replace(" at new "," at ");return e.displayName&&O.includes("")&&(O=O.replace("",e.displayName)),O}while(1<=w&&0<=b);break}}}finally{me=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?J(e):""}function d(e){switch(e.tag){case 5:return J(e.type);case 16:return J("Lazy");case 13:return J("Suspense");case 19:return J("SuspenseList");case 0:case 2:case 15:return e=he(e.type,!1),e;case 11:return e=he(e.type.render,!1),e;case 1:return e=he(e.type,!0),e;default:return""}}function g(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 x:return"Fragment";case T:return"Portal";case q:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case de:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ae:return(e.displayName||"Context")+".Consumer";case z:return(e._context.displayName||"Context")+".Provider";case re:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Se:return n=e.displayName||null,n!==null?n:g(e.type)||"Memo";case Oe:n=e._payload,e=e._init;try{return g(e(n))}catch{}}return null}function y(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return g(n);case 8:return n===R?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}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 n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function V(e){var n=k(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,m=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(w){l=""+w,m.call(this,w)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function oe(e){e._valueTracker||(e._valueTracker=V(e))}function fe(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=k(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function Me(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 tt(e,n){var o=n.checked;return Q({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Je(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=C(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function qt(e,n){n=n.checked,n!=null&&Y(e,"checked",n,!1)}function Wt(e,n){qt(e,n);var o=C(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?zn(e,n.type,o):n.hasOwnProperty("defaultValue")&&zn(e,n.type,C(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Jt(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function zn(e,n,o){(n!=="number"||Me(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Ze=Array.isArray;function _t(e,n,o,l){if(e=e.options,n){n={};for(var u=0;u"+n.valueOf().toString()+"",n=Xo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Vi(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var qi={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},Vg=["Webkit","ms","Moz","O"];Object.keys(qi).forEach(function(e){Vg.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),qi[n]=qi[e]})});function wd(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||qi.hasOwnProperty(e)&&qi[e]?(""+n).trim():n+"px"}function kd(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,u=wd(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,u):e[o]=u}}var qg=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 Xs(e,n){if(n){if(qg[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function Zs(e,n){if(e.indexOf("-")===-1)return typeof n.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 el=null;function tl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nl=null,Zr=null,ei=null;function bd(e){if(e=po(e)){if(typeof nl!="function")throw Error(i(280));var n=e.stateNode;n&&(n=wa(n),nl(e.stateNode,e.type,n))}}function Cd(e){Zr?ei?ei.push(e):ei=[e]:Zr=e}function Ed(){if(Zr){var e=Zr,n=ei;if(ei=Zr=null,bd(e),n)for(e=0;e>>=0,e===0?32:31-(ty(e)/ny|0)|0}var ra=64,ia=4194304;function Hi(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 oa(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,u=e.suspendedLanes,m=e.pingedLanes,w=o&268435455;if(w!==0){var b=w&~u;b!==0?l=Hi(b):(m&=w,m!==0&&(l=Hi(m)))}else w=o&~u,w!==0?l=Hi(w):m!==0&&(l=Hi(m));if(l===0)return 0;if(n!==0&&n!==l&&!(n&u)&&(u=l&-l,m=n&-n,u>=m||u===16&&(m&4194240)!==0))return n;if(l&4&&(l|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0o;o++)n.push(e);return n}function Yi(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-nn(n),e[n]=o}function ay(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0=ro),Zd=" ",ef=!1;function tf(e,n){switch(e){case"keyup":return Iy.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ri=!1;function Ry(e,n){switch(e){case"compositionend":return nf(n);case"keypress":return n.which!==32?null:(ef=!0,Zd);case"textInput":return e=n.data,e===Zd&&ef?null:e;default:return null}}function Ny(e,n){if(ri)return e==="compositionend"||!Sl&&tf(e,n)?(e=Gd(),ua=hl=Hn=null,ri=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=uf(o)}}function ff(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ff(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function pf(){for(var e=window,n=Me();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Me(e.document)}return n}function bl(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function Jy(e){var n=pf(),o=e.focusedElem,l=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ff(o.ownerDocument.documentElement,o)){if(l!==null&&bl(o)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var u=o.textContent.length,m=Math.min(l.start,u);l=l.end===void 0?m:Math.min(l.end,u),!e.extend&&m>l&&(u=l,l=m,m=u),u=df(o,m);var w=df(o,l);u&&w&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(u.node,u.offset),e.removeAllRanges(),m>l?(e.addRange(n),e.extend(w.node,w.offset)):(n.setEnd(w.node,w.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,ii=null,Cl=null,so=null,El=!1;function hf(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;El||ii==null||ii!==Me(l)||(l=ii,"selectionStart"in l&&bl(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),so&&ao(so,l)||(so=l,l=ya(Cl,"onSelect"),0ci||(e.current=Nl[ci],Nl[ci]=null,ci--)}function qe(e,n){ci++,Nl[ci]=e.current,e.current=n}var Xn={},St=Kn(Xn),xt=Kn(!1),br=Xn;function ui(e,n){var o=e.type.contextTypes;if(!o)return Xn;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var u={},m;for(m in o)u[m]=n[m];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=u),u}function Lt(e){return e=e.childContextTypes,e!=null}function ka(){He(xt),He(St)}function Of(e,n,o){if(St.current!==Xn)throw Error(i(168));qe(St,n),qe(xt,o)}function xf(e,n,o){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var u in l)if(!(u in n))throw Error(i(108,y(e)||"Unknown",u));return Q({},o,l)}function ba(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xn,br=St.current,qe(St,e),qe(xt,xt.current),!0}function Lf(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=xf(e,n,br),l.__reactInternalMemoizedMergedChildContext=e,He(xt),He(St),qe(St,e)):He(xt),qe(xt,o)}var Pn=null,Ca=!1,Bl=!1;function Af(e){Pn===null?Pn=[e]:Pn.push(e)}function i_(e){Ca=!0,Af(e)}function Zn(){if(!Bl&&Pn!==null){Bl=!0;var e=0,n=Be;try{var o=Pn;for(Be=1;e>=w,u-=w,On=1<<32-nn(n)+u|o<we?(ht=ye,ye=null):ht=ye.sibling;var Ie=K(N,ye,F[we],ne);if(Ie===null){ye===null&&(ye=ht);break}e&&ye&&Ie.alternate===null&&n(N,ye),A=m(Ie,A,we),ge===null?pe=Ie:ge.sibling=Ie,ge=Ie,ye=ht}if(we===F.length)return o(N,ye),Ye&&Er(N,we),pe;if(ye===null){for(;wewe?(ht=ye,ye=null):ht=ye.sibling;var lr=K(N,ye,Ie.value,ne);if(lr===null){ye===null&&(ye=ht);break}e&&ye&&lr.alternate===null&&n(N,ye),A=m(lr,A,we),ge===null?pe=lr:ge.sibling=lr,ge=lr,ye=ht}if(Ie.done)return o(N,ye),Ye&&Er(N,we),pe;if(ye===null){for(;!Ie.done;we++,Ie=F.next())Ie=ee(N,Ie.value,ne),Ie!==null&&(A=m(Ie,A,we),ge===null?pe=Ie:ge.sibling=Ie,ge=Ie);return Ye&&Er(N,we),pe}for(ye=l(N,ye);!Ie.done;we++,Ie=F.next())Ie=se(ye,N,we,Ie.value,ne),Ie!==null&&(e&&Ie.alternate!==null&&ye.delete(Ie.key===null?we:Ie.key),A=m(Ie,A,we),ge===null?pe=Ie:ge.sibling=Ie,ge=Ie);return e&&ye.forEach(function(B_){return n(N,B_)}),Ye&&Er(N,we),pe}function rt(N,A,F,ne){if(typeof F=="object"&&F!==null&&F.type===x&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case P:e:{for(var pe=F.key,ge=A;ge!==null;){if(ge.key===pe){if(pe=F.type,pe===x){if(ge.tag===7){o(N,ge.sibling),A=u(ge,F.props.children),A.return=N,N=A;break e}}else if(ge.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===Oe&&Bf(pe)===ge.type){o(N,ge.sibling),A=u(ge,F.props),A.ref=ho(N,ge,F),A.return=N,N=A;break e}o(N,ge);break}else n(N,ge);ge=ge.sibling}F.type===x?(A=Dr(F.props.children,N.mode,ne,F.key),A.return=N,N=A):(ne=Xa(F.type,F.key,F.props,null,N.mode,ne),ne.ref=ho(N,A,F),ne.return=N,N=ne)}return w(N);case T:e:{for(ge=F.key;A!==null;){if(A.key===ge)if(A.tag===4&&A.stateNode.containerInfo===F.containerInfo&&A.stateNode.implementation===F.implementation){o(N,A.sibling),A=u(A,F.children||[]),A.return=N,N=A;break e}else{o(N,A);break}else n(N,A);A=A.sibling}A=jc(F,N.mode,ne),A.return=N,N=A}return w(N);case Oe:return ge=F._init,rt(N,A,ge(F._payload),ne)}if(Ze(F))return ce(N,A,F,ne);if(ie(F))return ue(N,A,F,ne);Pa(N,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,A!==null&&A.tag===6?(o(N,A.sibling),A=u(A,F),A.return=N,N=A):(o(N,A),A=Ic(F,N.mode,ne),A.return=N,N=A),w(N)):o(N,A)}return rt}var hi=Ff(!0),Uf=Ff(!1),Oa=Kn(null),xa=null,mi=null,ql=null;function Wl(){ql=mi=xa=null}function Jl(e){var n=Oa.current;He(Oa),e._currentValue=n}function Gl(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function vi(e,n){xa=e,ql=mi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(At=!0),e.firstContext=null)}function Yt(e){var n=e._currentValue;if(ql!==e)if(e={context:e,memoizedValue:n,next:null},mi===null){if(xa===null)throw Error(i(308));mi=e,xa.dependencies={lanes:0,firstContext:e}}else mi=mi.next=e;return n}var Tr=null;function Hl(e){Tr===null?Tr=[e]:Tr.push(e)}function $f(e,n,o,l){var u=n.interleaved;return u===null?(o.next=o,Hl(n)):(o.next=u.next,u.next=o),n.interleaved=o,Ln(e,l)}function Ln(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var er=!1;function Yl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function An(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function tr(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,De&2){var u=l.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),l.pending=n,Ln(e,o)}return u=l.interleaved,u===null?(n.next=n,Hl(l)):(n.next=u.next,u.next=n),l.interleaved=n,Ln(e,o)}function La(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,cl(e,o)}}function Vf(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var u=null,m=null;if(o=o.firstBaseUpdate,o!==null){do{var w={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};m===null?u=m=w:m=m.next=w,o=o.next}while(o!==null);m===null?u=m=n:m=m.next=n}else u=m=n;o={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:m,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function Aa(e,n,o,l){var u=e.updateQueue;er=!1;var m=u.firstBaseUpdate,w=u.lastBaseUpdate,b=u.shared.pending;if(b!==null){u.shared.pending=null;var O=b,$=O.next;O.next=null,w===null?m=$:w.next=$,w=O;var X=e.alternate;X!==null&&(X=X.updateQueue,b=X.lastBaseUpdate,b!==w&&(b===null?X.firstBaseUpdate=$:b.next=$,X.lastBaseUpdate=O))}if(m!==null){var ee=u.baseState;w=0,X=$=O=null,b=m;do{var K=b.lane,se=b.eventTime;if((l&K)===K){X!==null&&(X=X.next={eventTime:se,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var ce=e,ue=b;switch(K=n,se=o,ue.tag){case 1:if(ce=ue.payload,typeof ce=="function"){ee=ce.call(se,ee,K);break e}ee=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ue.payload,K=typeof ce=="function"?ce.call(se,ee,K):ce,K==null)break e;ee=Q({},ee,K);break e;case 2:er=!0}}b.callback!==null&&b.lane!==0&&(e.flags|=64,K=u.effects,K===null?u.effects=[b]:K.push(b))}else se={eventTime:se,lane:K,tag:b.tag,payload:b.payload,callback:b.callback,next:null},X===null?($=X=se,O=ee):X=X.next=se,w|=K;if(b=b.next,b===null){if(b=u.shared.pending,b===null)break;K=b,b=K.next,K.next=null,u.lastBaseUpdate=K,u.shared.pending=null}}while(!0);if(X===null&&(O=ee),u.baseState=O,u.firstBaseUpdate=$,u.lastBaseUpdate=X,n=u.shared.interleaved,n!==null){u=n;do w|=u.lane,u=u.next;while(u!==n)}else m===null&&(u.shared.lanes=0);Or|=w,e.lanes=w,e.memoizedState=ee}}function qf(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;no?o:4,e(!0);var l=ec.transition;ec.transition={};try{e(!1),n()}finally{Be=o,ec.transition=l}}function cp(){return Qt().memoizedState}function l_(e,n,o){var l=or(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},up(e))dp(n,o);else if(o=$f(e,n,o,l),o!==null){var u=Mt();cn(o,e,l,u),fp(o,n,l)}}function c_(e,n,o){var l=or(e),u={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(up(e))dp(n,u);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var w=n.lastRenderedState,b=m(w,o);if(u.hasEagerState=!0,u.eagerState=b,rn(b,w)){var O=n.interleaved;O===null?(u.next=u,Hl(n)):(u.next=O.next,O.next=u),n.interleaved=u;return}}catch{}finally{}o=$f(e,n,u,l),o!==null&&(u=Mt(),cn(o,e,l,u),fp(o,n,l))}}function up(e){var n=e.alternate;return e===Xe||n!==null&&n===Xe}function dp(e,n){yo=ja=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function fp(e,n,o){if(o&4194240){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,cl(e,o)}}var Ba={readContext:Yt,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useInsertionEffect:wt,useLayoutEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useMutableSource:wt,useSyncExternalStore:wt,useId:wt,unstable_isNewReconciler:!1},u_={readContext:Yt,useCallback:function(e,n){return kn().memoizedState=[e,n===void 0?null:n],e},useContext:Yt,useEffect:tp,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,Ra(4194308,4,ip.bind(null,n,e),o)},useLayoutEffect:function(e,n){return Ra(4194308,4,e,n)},useInsertionEffect:function(e,n){return Ra(4,2,e,n)},useMemo:function(e,n){var o=kn();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=kn();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=l_.bind(null,Xe,e),[l.memoizedState,e]},useRef:function(e){var n=kn();return e={current:e},n.memoizedState=e},useState:Zf,useDebugValue:sc,useDeferredValue:function(e){return kn().memoizedState=e},useTransition:function(){var e=Zf(!1),n=e[0];return e=s_.bind(null,e[1]),kn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=Xe,u=kn();if(Ye){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),pt===null)throw Error(i(349));Pr&30||Hf(l,n,o)}u.memoizedState=o;var m={value:o,getSnapshot:n};return u.queue=m,tp(Qf.bind(null,l,m,e),[e]),l.flags|=2048,wo(9,Yf.bind(null,l,m,o,n),void 0,null),o},useId:function(){var e=kn(),n=pt.identifierPrefix;if(Ye){var o=xn,l=On;o=(l&~(1<<32-nn(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=_o++,0<\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=w.createElement(o,{is:l.is}):(e=w.createElement(o),o==="select"&&(w=e,l.multiple?w.multiple=!0:l.size&&(w.size=l.size))):e=w.createElementNS(e,o),e[Sn]=n,e[fo]=l,Ap(e,n,!1,!1),n.stateNode=e;e:{switch(w=Zs(o,l),o){case"dialog":Ge("cancel",e),Ge("close",e),u=l;break;case"iframe":case"object":case"embed":Ge("load",e),u=l;break;case"video":case"audio":for(u=0;uwi&&(n.flags|=128,l=!0,ko(m,!1),n.lanes=4194304)}else{if(!l)if(e=Da(w),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ko(m,!0),m.tail===null&&m.tailMode==="hidden"&&!w.alternate&&!Ye)return kt(n),null}else 2*nt()-m.renderingStartTime>wi&&o!==1073741824&&(n.flags|=128,l=!0,ko(m,!1),n.lanes=4194304);m.isBackwards?(w.sibling=n.child,n.child=w):(o=m.last,o!==null?o.sibling=w:n.child=w,m.last=w)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=nt(),n.sibling=null,o=Ke.current,qe(Ke,l?o&1|2:o&1),n):(kt(n),null);case 22:case 23:return Lc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&n.mode&1?$t&1073741824&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function y_(e,n){switch(Ul(n),n.tag){case 1:return Lt(n.type)&&ka(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gi(),He(xt),He(St),Zl(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return Kl(n),null;case 13:if(He(Ke),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));pi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return He(Ke),null;case 4:return gi(),null;case 10:return Jl(n.type._context),null;case 22:case 23:return Lc(),null;case 24:return null;default:return null}}var za=!1,bt=!1,__=typeof WeakSet=="function"?WeakSet:Set,le=null;function _i(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){et(e,n,l)}else o.current=null}function _c(e,n,o){try{o()}catch(l){et(e,n,l)}}var jp=!1;function S_(e,n){if(Ll=la,e=pf(),bl(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var u=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{o.nodeType,m.nodeType}catch{o=null;break e}var w=0,b=-1,O=-1,$=0,X=0,ee=e,K=null;t:for(;;){for(var se;ee!==o||u!==0&&ee.nodeType!==3||(b=w+u),ee!==m||l!==0&&ee.nodeType!==3||(O=w+l),ee.nodeType===3&&(w+=ee.nodeValue.length),(se=ee.firstChild)!==null;)K=ee,ee=se;for(;;){if(ee===e)break t;if(K===o&&++$===u&&(b=w),K===m&&++X===l&&(O=w),(se=ee.nextSibling)!==null)break;ee=K,K=ee.parentNode}ee=se}o=b===-1||O===-1?null:{start:b,end:O}}else o=null}o=o||{start:0,end:0}}else o=null;for(Al={focusedElem:e,selectionRange:o},la=!1,le=n;le!==null;)if(n=le,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,le=e;else for(;le!==null;){n=le;try{var ce=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ce!==null){var ue=ce.memoizedProps,rt=ce.memoizedState,N=n.stateNode,A=N.getSnapshotBeforeUpdate(n.elementType===n.type?ue:an(n.type,ue),rt);N.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var F=n.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(ne){et(n,n.return,ne)}if(e=n.sibling,e!==null){e.return=n.return,le=e;break}le=n.return}return ce=jp,jp=!1,ce}function bo(e,n,o){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var u=l=l.next;do{if((u.tag&e)===e){var m=u.destroy;u.destroy=void 0,m!==void 0&&_c(n,o,m)}u=u.next}while(u!==l)}}function Va(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var l=o.create;o.destroy=l()}o=o.next}while(o!==n)}}function Sc(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function Rp(e){var n=e.alternate;n!==null&&(e.alternate=null,Rp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Sn],delete n[fo],delete n[Rl],delete n[n_],delete n[r_])),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 Np(e){return e.tag===5||e.tag===3||e.tag===4}function Bp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Np(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 wc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Sa));else if(l!==4&&(e=e.child,e!==null))for(wc(e,n,o),e=e.sibling;e!==null;)wc(e,n,o),e=e.sibling}function kc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(kc(e,n,o),e=e.sibling;e!==null;)kc(e,n,o),e=e.sibling}var mt=null,sn=!1;function nr(e,n,o){for(o=o.child;o!==null;)Fp(e,n,o),o=o.sibling}function Fp(e,n,o){if(_n&&typeof _n.onCommitFiberUnmount=="function")try{_n.onCommitFiberUnmount(na,o)}catch{}switch(o.tag){case 5:bt||_i(o,n);case 6:var l=mt,u=sn;mt=null,nr(e,n,o),mt=l,sn=u,mt!==null&&(sn?(e=mt,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):mt.removeChild(o.stateNode));break;case 18:mt!==null&&(sn?(e=mt,o=o.stateNode,e.nodeType===8?jl(e.parentNode,o):e.nodeType===1&&jl(e,o),eo(e)):jl(mt,o.stateNode));break;case 4:l=mt,u=sn,mt=o.stateNode.containerInfo,sn=!0,nr(e,n,o),mt=l,sn=u;break;case 0:case 11:case 14:case 15:if(!bt&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){u=l=l.next;do{var m=u,w=m.destroy;m=m.tag,w!==void 0&&(m&2||m&4)&&_c(o,n,w),u=u.next}while(u!==l)}nr(e,n,o);break;case 1:if(!bt&&(_i(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(b){et(o,n,b)}nr(e,n,o);break;case 21:nr(e,n,o);break;case 22:o.mode&1?(bt=(l=bt)||o.memoizedState!==null,nr(e,n,o),bt=l):nr(e,n,o);break;default:nr(e,n,o)}}function Up(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new __),n.forEach(function(l){var u=O_.bind(null,e,l);o.has(l)||(o.add(l),l.then(u,u))})}}function ln(e,n){var o=n.deletions;if(o!==null)for(var l=0;lu&&(u=w),l&=~m}if(l=u,l=nt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*k_(l/1960))-l,10e?16:e,ir===null)var l=!1;else{if(e=ir,ir=null,Ha=0,De&6)throw Error(i(331));var u=De;for(De|=4,le=e.current;le!==null;){var m=le,w=m.child;if(le.flags&16){var b=m.deletions;if(b!==null){for(var O=0;Ont()-Ec?Lr(e,0):Cc|=o),It(e,n)}function Zp(e,n){n===0&&(e.mode&1?(n=ia,ia<<=1,!(ia&130023424)&&(ia=4194304)):n=1);var o=Mt();e=Ln(e,n),e!==null&&(Yi(e,n,o),It(e,o))}function P_(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Zp(e,o)}function O_(e,n){var o=0;switch(e.tag){case 13:var l=e.stateNode,u=e.memoizedState;u!==null&&(o=u.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(n),Zp(e,o)}var eh;eh=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||xt.current)At=!0;else{if(!(e.lanes&o)&&!(n.flags&128))return At=!1,v_(e,n,o);At=!!(e.flags&131072)}else At=!1,Ye&&n.flags&1048576&&Df(n,Ta,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;$a(e,n),e=n.pendingProps;var u=ui(n,St.current);vi(n,o),u=nc(null,n,l,e,u,o);var m=rc();return n.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Lt(l)?(m=!0,ba(n)):m=!1,n.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Yl(n),u.updater=Fa,n.stateNode=u,u._reactInternals=n,cc(n,l,e,o),n=pc(null,n,l,!0,m,o)):(n.tag=0,Ye&&m&&Fl(n),Tt(null,n,u,o),n=n.child),n;case 16:l=n.elementType;e:{switch($a(e,n),e=n.pendingProps,u=l._init,l=u(l._payload),n.type=l,u=n.tag=L_(l),e=an(l,e),u){case 0:n=fc(null,n,l,e,o);break e;case 1:n=Tp(null,n,l,e,o);break e;case 11:n=wp(null,n,l,e,o);break e;case 14:n=kp(null,n,l,an(l.type,e),o);break e}throw Error(i(306,l,""))}return n;case 0:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:an(l,u),fc(e,n,l,u,o);case 1:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:an(l,u),Tp(e,n,l,u,o);case 3:e:{if(Mp(n),e===null)throw Error(i(387));l=n.pendingProps,m=n.memoizedState,u=m.element,zf(e,n),Aa(n,l,null,o);var w=n.memoizedState;if(l=w.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){u=yi(Error(i(423)),n),n=Pp(e,n,l,o,u);break e}else if(l!==u){u=yi(Error(i(424)),n),n=Pp(e,n,l,o,u);break e}else for(Ut=Qn(n.stateNode.containerInfo.firstChild),Ft=n,Ye=!0,on=null,o=Uf(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(pi(),l===u){n=Dn(e,n,o);break e}Tt(e,n,l,o)}n=n.child}return n;case 5:return Wf(n),e===null&&zl(n),l=n.type,u=n.pendingProps,m=e!==null?e.memoizedProps:null,w=u.children,Dl(l,u)?w=null:m!==null&&Dl(l,m)&&(n.flags|=32),Ep(e,n),Tt(e,n,w,o),n.child;case 6:return e===null&&zl(n),null;case 13:return Op(e,n,o);case 4:return Ql(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=hi(n,null,l,o):Tt(e,n,l,o),n.child;case 11:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:an(l,u),wp(e,n,l,u,o);case 7:return Tt(e,n,n.pendingProps,o),n.child;case 8:return Tt(e,n,n.pendingProps.children,o),n.child;case 12:return Tt(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,u=n.pendingProps,m=n.memoizedProps,w=u.value,qe(Oa,l._currentValue),l._currentValue=w,m!==null)if(rn(m.value,w)){if(m.children===u.children&&!xt.current){n=Dn(e,n,o);break e}}else for(m=n.child,m!==null&&(m.return=n);m!==null;){var b=m.dependencies;if(b!==null){w=m.child;for(var O=b.firstContext;O!==null;){if(O.context===l){if(m.tag===1){O=An(-1,o&-o),O.tag=2;var $=m.updateQueue;if($!==null){$=$.shared;var X=$.pending;X===null?O.next=O:(O.next=X.next,X.next=O),$.pending=O}}m.lanes|=o,O=m.alternate,O!==null&&(O.lanes|=o),Gl(m.return,o,n),b.lanes|=o;break}O=O.next}}else if(m.tag===10)w=m.type===n.type?null:m.child;else if(m.tag===18){if(w=m.return,w===null)throw Error(i(341));w.lanes|=o,b=w.alternate,b!==null&&(b.lanes|=o),Gl(w,o,n),w=m.sibling}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===n){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}Tt(e,n,u.children,o),n=n.child}return n;case 9:return u=n.type,l=n.pendingProps.children,vi(n,o),u=Yt(u),l=l(u),n.flags|=1,Tt(e,n,l,o),n.child;case 14:return l=n.type,u=an(l,n.pendingProps),u=an(l.type,u),kp(e,n,l,u,o);case 15:return bp(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:an(l,u),$a(e,n),n.tag=1,Lt(l)?(e=!0,ba(n)):e=!1,vi(n,o),hp(n,l,u),cc(n,l,u,o),pc(null,n,l,!0,e,o);case 19:return Lp(e,n,o);case 22:return Cp(e,n,o)}throw Error(i(156,n.tag))};function th(e,n){return Dd(e,n)}function x_(e,n,o,l){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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,n,o,l){return new x_(e,n,o,l)}function Dc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function L_(e){if(typeof e=="function")return Dc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===re)return 11;if(e===Se)return 14}return 2}function sr(e,n){var o=e.alternate;return o===null?(o=Xt(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,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,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Xa(e,n,o,l,u,m){var w=2;if(l=e,typeof e=="function")Dc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case x:return Dr(o.children,u,m,n);case R:w=8,u|=8;break;case q:return e=Xt(12,o,n,u|2),e.elementType=q,e.lanes=m,e;case G:return e=Xt(13,o,n,u),e.elementType=G,e.lanes=m,e;case de:return e=Xt(19,o,n,u),e.elementType=de,e.lanes=m,e;case ve:return Za(o,u,m,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case z:w=10;break e;case ae:w=9;break e;case re:w=11;break e;case Se:w=14;break e;case Oe:w=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=Xt(w,o,n,u),n.elementType=e,n.type=l,n.lanes=m,n}function Dr(e,n,o,l){return e=Xt(7,e,l,n),e.lanes=o,e}function Za(e,n,o,l){return e=Xt(22,e,l,n),e.elementType=ve,e.lanes=o,e.stateNode={isHidden:!1},e}function Ic(e,n,o){return e=Xt(6,e,null,n),e.lanes=o,e}function jc(e,n,o){return n=Xt(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function A_(e,n,o,l,u){this.tag=n,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=ll(0),this.expirationTimes=ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ll(0),this.identifierPrefix=l,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function Rc(e,n,o,l,u,m,w,b,O){return e=new A_(e,n,o,b,O),n===1?(n=1,m===!0&&(n|=8)):n=0,m=Xt(3,null,null,n),e.current=m,m.stateNode=e,m.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yl(m),e}function D_(e,n,o){var l=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}return r(),zc.exports=G_(),zc.exports}var mh;function Y_(){if(mh)return ss;mh=1;var r=H_();return ss.createRoot=r.createRoot,ss.hydrateRoot=r.hydrateRoot,ss}var Q_=Y_();const K_=Ho(Q_);function vh(r,t){if(r==null)return{};var i,a,s=function(p,h){if(p==null)return{};var f,_,v={},S=Object.keys(p);for(_=0;_=0||(v[f]=p[f]);return v}(r,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(r,i)&&(s[i]=r[i])}return s}function vn(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function Ue(r){return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(r)}function pv(r){var t=function(i,a){if(Ue(i)!=="object"||i===null)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var c=s.call(i,a||"default");if(Ue(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(r,"string");return Ue(t)==="symbol"?t:String(t)}function gh(r,t){for(var i=0;ir.length)&&(t=r.length);for(var i=0,a=new Array(t);i0&&p.length>s&&!p.warned){p.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+p.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=r,f.type=t,f.count=p.length,h=f,console&&console.warn&&console.warn(h)}return r}function Z_(){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 Ch(r,t,i){var a={fired:!1,wrapFn:void 0,target:r,type:t,listener:i},s=Z_.bind(a);return s.listener=i,a.wrapFn=s,s}function Eh(r,t,i){var a=r._events;if(a===void 0)return[];var s=a[t];return s===void 0?[]:typeof s=="function"?i?[s.listener||s]:[s]:i?function(c){for(var p=new Array(c.length),h=0;h0&&(c=t[0]),c instanceof Error)throw c;var p=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw p.context=c,p}var h=s[r];if(h===void 0)return!1;if(typeof h=="function")Sh(h,this,t);else{var f=h.length,_=vv(h,f);for(i=0;i=0;c--)if(i[c]===t||i[c].listener===t){p=i[c].listener,s=c;break}if(s<0)return this;s===0?i.shift():function(h,f){for(;f+1=0;a--)this.removeListener(r,t[a]);return this},Fe.prototype.listeners=function(r){return Eh(this,r,!0)},Fe.prototype.rawListeners=function(r){return Eh(this,r,!1)},Fe.listenerCount=function(r,t){return typeof r.listenerCount=="function"?r.listenerCount(t):Th.call(r,t)},Fe.prototype.listenerCount=Th,Fe.prototype.eventNames=function(){return this._eventsCount>0?hv(this._events):[]};var Ph=Object.prototype.hasOwnProperty;function Oh(r,t,i){for(i of r.keys())if(Nt(i,t))return i}function Nt(r,t){var i,a,s;if(r===t)return!0;if(r&&t&&(i=r.constructor)===t.constructor){if(i===Date)return r.getTime()===t.getTime();if(i===RegExp)return r.toString()===t.toString();if(i===Array){if((a=r.length)===t.length)for(;a--&&Nt(r[a],t[a]););return a===-1}if(i===Set){if(r.size!==t.size)return!1;for(a of r)if((s=a)&&typeof s=="object"&&!(s=Oh(t,s))||!t.has(s))return!1;return!0}if(i===Map){if(r.size!==t.size)return!1;for(a of r)if((s=a[0])&&typeof s=="object"&&!(s=Oh(t,s))||!Nt(a[1],t.get(s)))return!1;return!0}if(i===ArrayBuffer)r=new Uint8Array(r),t=new Uint8Array(t);else if(i===DataView){if((a=r.byteLength)===t.byteLength)for(;a--&&r.getInt8(a)===t.getInt8(a););return a===-1}if(ArrayBuffer.isView(r)){if((a=r.byteLength)===t.byteLength)for(;a--&&r[a]===t[a];);return a===-1}if(!i||typeof r=="object"){for(i in a=0,r)if(Ph.call(r,i)&&++a&&!Ph.call(t,i)||!(i in t)||!Nt(r[i],t[i]))return!1;return Object.keys(t).length===a}}return r!=r&&t!=t}const e0={"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"},gv={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"},it={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},Pt={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"},dr={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class H{static getFirstMatch(t,i){const a=i.match(t);return a&&a.length>0&&a[1]||""}static getSecondMatch(t,i){const a=i.match(t);return a&&a.length>1&&a[2]||""}static matchAndReturnConst(t,i,a){if(t.test(i))return a}static getWindowsVersionName(t){switch(t){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(t){const i=t.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(t){const i=t.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(t){return t.split(".").length}static compareVersions(t,i,a=!1){const s=H.getVersionPrecision(t),c=H.getVersionPrecision(i);let p=Math.max(s,c),h=0;const f=H.map([t,i],_=>{const v=p-H.getVersionPrecision(_),S=_+new Array(v+1).join(".0");return H.map(S.split("."),E=>new Array(20-E.length).join("0")+E).reverse()});for(a&&(h=p-Math.min(s,c)),p-=1;p>=h;){if(f[0][p]>f[1][p])return 1;if(f[0][p]===f[1][p]){if(p===h)return 0;p-=1}else if(f[0][p]{a[h]=p[h]})}return t}static getBrowserAlias(t){return e0[t]}static getBrowserTypeByAlias(t){return gv[t]||""}}const $e=/version\/(\d+(\.?_?\d+)+)/i,t0=[{test:[/googlebot/i],describe(r){const t={name:"Googlebot"},i=H.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/opera/i],describe(r){const t={name:"Opera"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/opr\/|opios/i],describe(r){const t={name:"Opera"},i=H.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/SamsungBrowser/i],describe(r){const t={name:"Samsung Internet for Android"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/Whale/i],describe(r){const t={name:"NAVER Whale Browser"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/MZBrowser/i],describe(r){const t={name:"MZ Browser"},i=H.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/focus/i],describe(r){const t={name:"Focus"},i=H.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/swing/i],describe(r){const t={name:"Swing"},i=H.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/coast/i],describe(r){const t={name:"Opera Coast"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(r){const t={name:"Opera Touch"},i=H.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/yabrowser/i],describe(r){const t={name:"Yandex Browser"},i=H.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/ucbrowser/i],describe(r){const t={name:"UC Browser"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/Maxthon|mxios/i],describe(r){const t={name:"Maxthon"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/epiphany/i],describe(r){const t={name:"Epiphany"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/puffin/i],describe(r){const t={name:"Puffin"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/sleipnir/i],describe(r){const t={name:"Sleipnir"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/k-meleon/i],describe(r){const t={name:"K-Meleon"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/micromessenger/i],describe(r){const t={name:"WeChat"},i=H.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/qqbrowser/i],describe(r){const t={name:/qqbrowserlite/i.test(r)?"QQ Browser Lite":"QQ Browser"},i=H.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/msie|trident/i],describe(r){const t={name:"Internet Explorer"},i=H.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/\sedg\//i],describe(r){const t={name:"Microsoft Edge"},i=H.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/edg([ea]|ios)/i],describe(r){const t={name:"Microsoft Edge"},i=H.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/vivaldi/i],describe(r){const t={name:"Vivaldi"},i=H.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/seamonkey/i],describe(r){const t={name:"SeaMonkey"},i=H.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/sailfish/i],describe(r){const t={name:"Sailfish"},i=H.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,r);return i&&(t.version=i),t}},{test:[/silk/i],describe(r){const t={name:"Amazon Silk"},i=H.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/phantom/i],describe(r){const t={name:"PhantomJS"},i=H.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/slimerjs/i],describe(r){const t={name:"SlimerJS"},i=H.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const t={name:"BlackBerry"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/(web|hpw)[o0]s/i],describe(r){const t={name:"WebOS Browser"},i=H.getFirstMatch($e,r)||H.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/bada/i],describe(r){const t={name:"Bada"},i=H.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/tizen/i],describe(r){const t={name:"Tizen"},i=H.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/qupzilla/i],describe(r){const t={name:"QupZilla"},i=H.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/firefox|iceweasel|fxios/i],describe(r){const t={name:"Firefox"},i=H.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/electron/i],describe(r){const t={name:"Electron"},i=H.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/MiuiBrowser/i],describe(r){const t={name:"Miui"},i=H.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/chromium/i],describe(r){const t={name:"Chromium"},i=H.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,r)||H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/chrome|crios|crmo/i],describe(r){const t={name:"Chrome"},i=H.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/GSA/i],describe(r){const t={name:"Google Search"},i=H.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test(r){const t=!r.test(/like android/i),i=r.test(/android/i);return t&&i},describe(r){const t={name:"Android Browser"},i=H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/playstation 4/i],describe(r){const t={name:"PlayStation 4"},i=H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/safari|applewebkit/i],describe(r){const t={name:"Safari"},i=H.getFirstMatch($e,r);return i&&(t.version=i),t}},{test:[/.*/i],describe(r){const t=r.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:H.getFirstMatch(t,r),version:H.getSecondMatch(t,r)}}}];var n0=[{test:[/Roku\/DVP/],describe(r){const t=H.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,r);return{name:Pt.Roku,version:t}}},{test:[/windows phone/i],describe(r){const t=H.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,r);return{name:Pt.WindowsPhone,version:t}}},{test:[/windows /i],describe(r){const t=H.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,r),i=H.getWindowsVersionName(t);return{name:Pt.Windows,version:t,versionName:i}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(r){const t={name:Pt.iOS},i=H.getSecondMatch(/(Version\/)(\d[\d.]+)/,r);return i&&(t.version=i),t}},{test:[/macintosh/i],describe(r){const t=H.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,r).replace(/[_\s]/g,"."),i=H.getMacOSVersionName(t),a={name:Pt.MacOS,version:t};return i&&(a.versionName=i),a}},{test:[/(ipod|iphone|ipad)/i],describe(r){const t=H.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,r).replace(/[_\s]/g,".");return{name:Pt.iOS,version:t}}},{test(r){const t=!r.test(/like android/i),i=r.test(/android/i);return t&&i},describe(r){const t=H.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,r),i=H.getAndroidVersionName(t),a={name:Pt.Android,version:t};return i&&(a.versionName=i),a}},{test:[/(web|hpw)[o0]s/i],describe(r){const t=H.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,r),i={name:Pt.WebOS};return t&&t.length&&(i.version=t),i}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const t=H.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,r)||H.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,r)||H.getFirstMatch(/\bbb(\d+)/i,r);return{name:Pt.BlackBerry,version:t}}},{test:[/bada/i],describe(r){const t=H.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,r);return{name:Pt.Bada,version:t}}},{test:[/tizen/i],describe(r){const t=H.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,r);return{name:Pt.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:Pt.Linux})},{test:[/CrOS/],describe:()=>({name:Pt.ChromeOS})},{test:[/PlayStation 4/],describe(r){const t=H.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,r);return{name:Pt.PlayStation4,version:t}}}],r0=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(r){const t=H.getFirstMatch(/(can-l01)/i,r)&&"Nova",i={type:it.mobile,vendor:"Huawei"};return t&&(i.model=t),i}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:it.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:it.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:it.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:it.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:it.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:it.tablet})},{test(r){const t=r.test(/ipod|iphone/i),i=r.test(/like (ipod|iphone)/i);return t&&!i},describe(r){const t=H.getFirstMatch(/(ipod|iphone)/i,r);return{type:it.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:it.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:it.mobile})},{test:r=>r.getBrowserName(!0)==="blackberry",describe:()=>({type:it.mobile,vendor:"BlackBerry"})},{test:r=>r.getBrowserName(!0)==="bada",describe:()=>({type:it.mobile})},{test:r=>r.getBrowserName()==="windows phone",describe:()=>({type:it.mobile,vendor:"Microsoft"})},{test(r){const t=Number(String(r.getOSVersion()).split(".")[0]);return r.getOSName(!0)==="android"&&t>=3},describe:()=>({type:it.tablet})},{test:r=>r.getOSName(!0)==="android",describe:()=>({type:it.mobile})},{test:r=>r.getOSName(!0)==="macos",describe:()=>({type:it.desktop,vendor:"Apple"})},{test:r=>r.getOSName(!0)==="windows",describe:()=>({type:it.desktop})},{test:r=>r.getOSName(!0)==="linux",describe:()=>({type:it.desktop})},{test:r=>r.getOSName(!0)==="playstation 4",describe:()=>({type:it.tv})},{test:r=>r.getOSName(!0)==="roku",describe:()=>({type:it.tv})}],i0=[{test:r=>r.getBrowserName(!0)==="microsoft edge",describe(r){if(/\sedg\//i.test(r))return{name:dr.Blink};const t=H.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,r);return{name:dr.EdgeHTML,version:t}}},{test:[/trident/i],describe(r){const t={name:dr.Trident},i=H.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:r=>r.test(/presto/i),describe(r){const t={name:dr.Presto},i=H.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test(r){const t=r.test(/gecko/i),i=r.test(/like gecko/i);return t&&!i},describe(r){const t={name:dr.Gecko},i=H.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:dr.Blink})},{test:[/(apple)?webkit/i],describe(r){const t={name:dr.WebKit},i=H.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,r);return i&&(t.version=i),t}}];class xh{constructor(t,i=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},i!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=H.find(t0,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 t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?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 t=H.find(n0,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 t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:i}=this.getOS();return t?String(i).toLowerCase()||"":i||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:i}=this.getPlatform();return t?String(i).toLowerCase()||"":i||""}parsePlatform(){this.parsedResult.platform={};const t=H.find(r0,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 t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=H.find(i0,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 t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return H.assign({},this.parsedResult)}satisfies(t){const i={};let a=0;const s={};let c=0;if(Object.keys(t).forEach(p=>{const h=t[p];typeof h=="string"?(s[p]=h,c+=1):typeof h=="object"&&(i[p]=h,a+=1)}),a>0){const p=Object.keys(i),h=H.find(p,_=>this.isOS(_));if(h){const _=this.satisfies(i[h]);if(_!==void 0)return _}const f=H.find(p,_=>this.isPlatform(_));if(f){const _=this.satisfies(i[f]);if(_!==void 0)return _}}if(c>0){const p=Object.keys(s),h=H.find(p,f=>this.isBrowser(f,!0));if(h!==void 0)return this.compareVersion(s[h])}}isBrowser(t,i=!1){const a=this.getBrowserName().toLowerCase();let s=t.toLowerCase();const c=H.getBrowserTypeByAlias(s);return i&&c&&(s=c.toLowerCase()),s===a}compareVersion(t){let i=[0],a=t,s=!1;const c=this.getBrowserVersion();if(typeof c=="string")return t[0]===">"||t[0]==="<"?(a=t.substr(1),t[1]==="="?(s=!0,a=t.substr(2)):i=[],t[0]===">"?i.push(1):i.push(-1)):t[0]==="="?a=t.substr(1):t[0]==="~"&&(s=!0,a=t.substr(1)),i.indexOf(H.compareVersions(c,a,s))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,i=!1){return this.isBrowser(t,i)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.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 o0{static getParser(t,i=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new xh(t,i)}static parse(t){return new xh(t).getResult()}static get BROWSER_MAP(){return gv}static get ENGINE_MAP(){return dr}static get OS_MAP(){return Pt}static get PLATFORMS_MAP(){return it}}function Gs(){return Date.now()+Math.random().toString()}function Oo(){throw new Error("Method must be implemented in subclass")}function yv(r,t){return t!=null&&t.proxyUrl?t.proxyUrl+(t.proxyUrl.slice(-1)==="/"?"":"/")+r.substring(8):r}function Ls(r){return r!=null&&r.callObjectBundleUrlOverride?r.callObjectBundleUrlOverride:yv("https://c.daily.co/call-machine/versioned/".concat("0.72.2","/static/call-machine-object-bundle.js"),r)}function zo(r){try{new URL(r)}catch{return!1}return!0}const _v=Object.prototype.toString;function Sv(r){switch(_v.call(r)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Wr(r,Error)}}function $i(r,t){return _v.call(r)===`[object ${t}]`}function ed(r){return $i(r,"ErrorEvent")}function Lh(r){return $i(r,"DOMError")}function qr(r){return $i(r,"String")}function wv(r){return r===null||typeof r!="object"&&typeof r!="function"}function Ni(r){return $i(r,"Object")}function As(r){return typeof Event<"u"&&Wr(r,Event)}function td(r){return!!(r&&r.then&&typeof r.then=="function")}function Wr(r,t){try{return r instanceof t}catch{return!1}}function Li(r,t=0){return typeof r!="string"||t===0||r.length<=t?r:`${r.slice(0,t)}...`}function Ah(r,t){if(!Array.isArray(r))return"";const i=[];for(let a=0;aa0(r,a,i))}function s0(r,t,i=250,a,s,c,p){if(!(c.exception&&c.exception.values&&p&&Wr(p.originalException,Error)))return;const h=c.exception.values.length>0?c.exception.values[c.exception.values.length-1]:void 0;var f,_;h&&(c.exception.values=(f=Su(r,t,s,p.originalException,a,c.exception.values,h,0),_=i,f.map(v=>(v.value&&(v.value=Li(v.value,_)),v))))}function Su(r,t,i,a,s,c,p,h){if(c.length>=i+1)return c;let f=[...c];if(Wr(a[s],Error)){Dh(p,h);const _=r(t,a[s]),v=f.length;Ih(_,s,v,h),f=Su(r,t,i,a[s],s,[_,...f],_,v)}return Array.isArray(a.errors)&&a.errors.forEach((_,v)=>{if(Wr(_,Error)){Dh(p,h);const S=r(t,_),E=f.length;Ih(S,`errors[${v}]`,E,h),f=Su(r,t,i,_,s,[S,...f],S,E)}}),f}function Dh(r,t){r.mechanism=r.mechanism||{type:"generic",handled:!0},r.mechanism={...r.mechanism,is_exception_group:!0,exception_id:t}}function Ih(r,t,i,a){r.mechanism=r.mechanism||{type:"generic",handled:!0},r.mechanism={...r.mechanism,type:"chained",source:t,exception_id:i,parent_id:a}}function cs(r){return r&&r.Math==Math?r:void 0}const en=typeof globalThis=="object"&&cs(globalThis)||typeof window=="object"&&cs(window)||typeof self=="object"&&cs(self)||typeof global=="object"&&cs(global)||function(){return this}()||{};function Yo(){return en}function nd(r,t,i){const a=i||en,s=a.__SENTRY__=a.__SENTRY__||{};return s[r]||(s[r]=t())}const l0=Yo(),c0=80;function wu(r,t={}){try{let i=r;const a=5,s=[];let c=0,p=0;const h=" > ",f=h.length;let _;const v=Array.isArray(t)?t:t.keyAttrs,S=!Array.isArray(t)&&t.maxStringLength||c0;for(;i&&c++1&&p+s.length*f+_.length>=S));)s.push(_),p+=_.length,i=i.parentNode;return s.reverse().join(h)}catch{return""}}function u0(r,t){const i=r,a=[];let s,c,p,h,f;if(!i||!i.tagName)return"";a.push(i.tagName.toLowerCase());const _=t&&t.length?t.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}`),s=i.className,s&&qr(s))for(c=s.split(/\s+/),f=0;f{const s=t[a]&&t[a].__sentry_original__;a in t&&s&&(i[a]=t[a],t[a]=s)});try{return r()}finally{Object.keys(i).forEach(a=>{t[a]=i[a]})}}function jh(){let r=!1;const t={enable:()=>{r=!0},disable:()=>{r=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Ds.forEach(i=>{t[i]=(...a)=>{r&&kv(()=>{en.console[i](`Sentry Logger [${i}]:`,...a)})}}):Ds.forEach(i=>{t[i]=()=>{}}),t}let Te;Te=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?nd("logger",jh):jh();const d0=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Is(r,t=!1){const{host:i,path:a,pass:s,port:c,projectId:p,protocol:h,publicKey:f}=r;return`${h}://${f}${t&&s?`:${s}`:""}@${i}${c?`:${c}`:""}/${a&&`${a}/`}${p}`}function Rh(r){return{protocol:r.protocol,publicKey:r.publicKey||"",pass:r.pass||"",host:r.host,port:r.port||"",path:r.path||"",projectId:r.projectId}}function f0(r){const t=typeof r=="string"?function(i){const a=d0.exec(i);if(!a)return void console.error(`Invalid Sentry Dsn: ${i}`);const[s,c,p="",h,f="",_]=a.slice(1);let v="",S=_;const E=S.split("/");if(E.length>1&&(v=E.slice(0,-1).join("/"),S=E.pop()),S){const M=S.match(/^\d+/);M&&(S=M[0])}return Rh({host:h,pass:p,path:v,projectId:S,port:f,protocol:s,publicKey:c})}(r):Rh(r);if(t&&function(i){if(typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__)return!0;const{port:a,projectId:s,protocol:c}=i;return!(["protocol","publicKey","host","projectId"].find(p=>!i[p]&&(Te.error(`Invalid Sentry Dsn: ${p} missing`),!0))||(s.match(/^\d+$/)?function(p){return p==="http"||p==="https"}(c)?a&&isNaN(parseInt(a,10))&&(Te.error(`Invalid Sentry Dsn: Invalid port ${a}`),1):(Te.error(`Invalid Sentry Dsn: Invalid protocol ${c}`),1):(Te.error(`Invalid Sentry Dsn: Invalid projectId ${s}`),1)))}(t))return t}class fn extends Error{constructor(t,i="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=i}}function yt(r,t,i){if(!(t in r))return;const a=r[t],s=i(a);if(typeof s=="function")try{bv(s,a)}catch{}r[t]=s}function rd(r,t,i){Object.defineProperty(r,t,{value:i,writable:!0,configurable:!0})}function bv(r,t){const i=t.prototype||{};r.prototype=t.prototype=i,rd(r,"__sentry_original__",t)}function id(r){return r.__sentry_original__}function Cv(r){if(Sv(r))return{message:r.message,name:r.name,stack:r.stack,...Bh(r)};if(As(r)){const t={type:r.type,target:Nh(r.target),currentTarget:Nh(r.currentTarget),...Bh(r)};return typeof CustomEvent<"u"&&Wr(r,CustomEvent)&&(t.detail=r.detail),t}return r}function Nh(r){try{return t=r,typeof Element<"u"&&Wr(t,Element)?wu(r):Object.prototype.toString.call(r)}catch{return""}var t}function Bh(r){if(typeof r=="object"&&r!==null){const t={};for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t}return{}}function Hs(r){return ku(r,new Map)}function ku(r,t){if(Ni(r)){const i=t.get(r);if(i!==void 0)return i;const a={};t.set(r,a);for(const s of Object.keys(r))r[s]!==void 0&&(a[s]=ku(r[s],t));return a}if(Array.isArray(r)){const i=t.get(r);if(i!==void 0)return i;const a=[];return t.set(r,a),r.forEach(s=>{a.push(ku(s,t))}),a}return r}const Fh="";function yr(r){try{return r&&typeof r=="function"&&r.name||Fh}catch{return Fh}}const Wc=Yo();function bu(r){return r&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(r.toString())}function p0(){if(!function(){if(!("fetch"in Wc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(bu(Wc.fetch))return!0;let r=!1;const t=Wc.document;if(t&&typeof t.createElement=="function")try{const i=t.createElement("iframe");i.hidden=!0,t.head.appendChild(i),i.contentWindow&&i.contentWindow.fetch&&(r=bu(i.contentWindow.fetch)),t.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return r}const us=Yo(),Qe=Yo(),Do="__sentry_xhr_v2__",Bo={},Uh={};function h0(r){if(!Uh[r])switch(Uh[r]=!0,r){case"console":(function(){"console"in Qe&&Ds.forEach(function(t){t in Qe.console&&yt(Qe.console,t,function(i){return function(...a){un("console",{args:a,level:t}),i&&i.apply(Qe.console,a)}})})})();break;case"dom":(function(){if(!("document"in Qe))return;const t=un.bind(null,"dom"),i=zh(t,!0);Qe.document.addEventListener("click",i,!1),Qe.document.addEventListener("keypress",i,!1),["EventTarget","Node"].forEach(a=>{const s=Qe[a]&&Qe[a].prototype;s&&s.hasOwnProperty&&s.hasOwnProperty("addEventListener")&&(yt(s,"addEventListener",function(c){return function(p,h,f){if(p==="click"||p=="keypress")try{const _=this,v=_.__sentry_instrumentation_handlers__=_.__sentry_instrumentation_handlers__||{},S=v[p]=v[p]||{refCount:0};if(!S.handler){const E=zh(t);S.handler=E,c.call(this,p,E,f)}S.refCount++}catch{}return c.call(this,p,h,f)}}),yt(s,"removeEventListener",function(c){return function(p,h,f){if(p==="click"||p=="keypress")try{const _=this,v=_.__sentry_instrumentation_handlers__||{},S=v[p];S&&(S.refCount--,S.refCount<=0&&(c.call(this,p,S.handler,f),S.handler=void 0,delete v[p]),Object.keys(v).length===0&&delete _.__sentry_instrumentation_handlers__)}catch{}return c.call(this,p,h,f)}}))})})();break;case"xhr":(function(){if(!("XMLHttpRequest"in Qe))return;const t=XMLHttpRequest.prototype;yt(t,"open",function(i){return function(...a){const s=a[1],c=this[Do]={method:qr(a[0])?a[0].toUpperCase():a[0],url:a[1],request_headers:{}};qr(s)&&c.method==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const p=()=>{const h=this[Do];if(h&&this.readyState===4){try{h.status_code=this.status}catch{}un("xhr",{args:a,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?yt(this,"onreadystatechange",function(h){return function(...f){return p(),h.apply(this,f)}}):this.addEventListener("readystatechange",p),yt(this,"setRequestHeader",function(h){return function(...f){const[_,v]=f,S=this[Do];return S&&(S.request_headers[_.toLowerCase()]=v),h.apply(this,f)}}),i.apply(this,a)}}),yt(t,"send",function(i){return function(...a){const s=this[Do];return s&&a[0]!==void 0&&(s.body=a[0]),un("xhr",{args:a,startTimestamp:Date.now(),xhr:this}),i.apply(this,a)}})})();break;case"fetch":(function(){p0()&&yt(Qe,"fetch",function(t){return function(...i){const{method:a,url:s}=function(p){if(p.length===0)return{method:"GET",url:""};if(p.length===2){const[f,_]=p;return{url:$h(f),method:Cu(_,"method")?String(_.method).toUpperCase():"GET"}}const h=p[0];return{url:$h(h),method:Cu(h,"method")?String(h.method).toUpperCase():"GET"}}(i),c={args:i,fetchData:{method:a,url:s},startTimestamp:Date.now()};return un("fetch",{...c}),t.apply(Qe,i).then(p=>(un("fetch",{...c,endTimestamp:Date.now(),response:p}),p),p=>{throw un("fetch",{...c,endTimestamp:Date.now(),error:p}),p})}})})();break;case"history":(function(){if(!function(){const a=us.chrome,s=a&&a.app&&a.app.runtime,c="history"in us&&!!us.history.pushState&&!!us.history.replaceState;return!s&&c}())return;const t=Qe.onpopstate;function i(a){return function(...s){const c=s.length>2?s[2]:void 0;if(c){const p=ds,h=String(c);ds=h,un("history",{from:p,to:h})}return a.apply(this,s)}}Qe.onpopstate=function(...a){const s=Qe.location.href,c=ds;if(ds=s,un("history",{from:c,to:s}),t)try{return t.apply(this,a)}catch{}},yt(Qe.history,"pushState",i),yt(Qe.history,"replaceState",i)})();break;case"error":ps=Qe.onerror,Qe.onerror=function(t,i,a,s,c){return un("error",{column:s,error:c,line:a,msg:t,url:i}),!(!ps||ps.__SENTRY_LOADER__)&&ps.apply(this,arguments)},Qe.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":hs=Qe.onunhandledrejection,Qe.onunhandledrejection=function(t){return un("unhandledrejection",t),!(hs&&!hs.__SENTRY_LOADER__)||hs.apply(this,arguments)},Qe.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn("unknown instrumentation type:",r))}}function Fr(r,t){Bo[r]=Bo[r]||[],Bo[r].push(t),h0(r)}function un(r,t){if(r&&Bo[r])for(const i of Bo[r]||[])try{i(t)}catch(a){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.error(`Error while triggering instrumentation handler. Type: ${r} Name: ${yr(i)} Error:`,a)}}function Cu(r,t){return!!r&&typeof r=="object"&&!!r[t]}function $h(r){return typeof r=="string"?r:r?Cu(r,"url")?r.url:r.toString?r.toString():"":""}let ds;const m0=1e3;let fs,Jc;function zh(r,t=!1){return i=>{if(!i||Jc===i||function(s){if(s.type!=="keypress")return!1;try{const c=s.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;(fs===void 0||function(s,c){if(!s||s.type!==c.type)return!0;try{if(s.target!==c.target)return!0}catch{}return!1}(Jc,i))&&(r({event:i,name:a,global:t}),Jc=i),clearTimeout(fs),fs=Qe.setTimeout(()=>{fs=void 0},m0)}}let ps=null,hs=null;function vr(){const r=en,t=r.crypto||r.msCrypto;if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");const i=t&&t.getRandomValues?()=>t.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return("10000000100040008000"+1e11).replace(/[018]/g,a=>(a^(15&i())>>a/4).toString(16))}function Ev(r){return r.exception&&r.exception.values?r.exception.values[0]:void 0}function fr(r){const{message:t,event_id:i}=r;if(t)return t;const a=Ev(r);return a?a.type&&a.value?`${a.type}: ${a.value}`:a.type||a.value||i||"":i||""}function Eu(r,t,i){const a=r.exception=r.exception||{},s=a.values=a.values||[],c=s[0]=s[0]||{};c.value||(c.value=t||""),c.type||(c.type="Error")}function Vo(r,t){const i=Ev(r);if(!i)return;const a=i.mechanism;if(i.mechanism={type:"generic",handled:!0,...a,...t},t&&"data"in t){const s={...a&&a.data,...t.data};i.mechanism.data=s}}function Vh(r){if(r&&r.__sentry_captured__)return!0;try{rd(r,"__sentry_captured__",!0)}catch{}return!1}function pr(r,t=100,i=1/0){try{return Tu("",r,t,i)}catch(a){return{ERROR:`**non-serializable** (${a})`}}}function Tv(r,t=3,i=102400){const a=pr(r,t);return s=a,function(c){return~-encodeURI(c).split(/%..|./).length}(JSON.stringify(s))>i?Tv(r,t-1,i):a;var s}function Tu(r,t,i=1/0,a=1/0,s=function(){const c=typeof WeakSet=="function",p=c?new WeakSet:[];return[function(h){if(c)return!!p.has(h)||(p.add(h),!1);for(let f=0;f=a){S[D]="[MaxProperties ~]";break}const L=M[D];S[D]=Tu(D,L,_-1,a,s),E++}return p(t),S}var Nn;function Jr(r){return new Rt(t=>{t(r)})}function js(r){return new Rt((t,i)=>{i(r)})}(function(r){r[r.PENDING=0]="PENDING",r[r.RESOLVED=1]="RESOLVED",r[r.REJECTED=2]="REJECTED"})(Nn||(Nn={}));class Rt{__init(){this._state=Nn.PENDING}__init2(){this._handlers=[]}constructor(t){Rt.prototype.__init.call(this),Rt.prototype.__init2.call(this),Rt.prototype.__init3.call(this),Rt.prototype.__init4.call(this),Rt.prototype.__init5.call(this),Rt.prototype.__init6.call(this);try{t(this._resolve,this._reject)}catch(i){this._reject(i)}}then(t,i){return new Rt((a,s)=>{this._handlers.push([!1,c=>{if(t)try{a(t(c))}catch(p){s(p)}else a(c)},c=>{if(i)try{a(i(c))}catch(p){s(p)}else s(c)}]),this._executeHandlers()})}catch(t){return this.then(i=>i,t)}finally(t){return new Rt((i,a)=>{let s,c;return this.then(p=>{c=!1,s=p,t&&t()},p=>{c=!0,s=p,t&&t()}).then(()=>{c?a(s):i(s)})})}__init3(){this._resolve=t=>{this._setResult(Nn.RESOLVED,t)}}__init4(){this._reject=t=>{this._setResult(Nn.REJECTED,t)}}__init5(){this._setResult=(t,i)=>{this._state===Nn.PENDING&&(td(i)?i.then(this._resolve,this._reject):(this._state=t,this._value=i,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===Nn.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach(i=>{i[0]||(this._state===Nn.RESOLVED&&i[1](this._value),this._state===Nn.REJECTED&&i[2](this._value),i[0]=!0)})}}}function v0(r){const t=[];function i(a){return t.splice(t.indexOf(a),1)[0]}return{$:t,add:function(a){if(!(r===void 0||t.lengthi(s)).then(null,()=>i(s).then(null,()=>{})),s},drain:function(a){return new Rt((s,c)=>{let p=t.length;if(!p)return s(!0);const h=setTimeout(()=>{a&&a>0&&s(!1)},a);t.forEach(f=>{Jr(f).then(()=>{--p||(clearTimeout(h),s(!0))},c)})})}}}function Gc(r){if(!r)return{};const t=r.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const i=t[6]||"",a=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:i,hash:a,relative:t[5]+i+a}}const g0=["fatal","error","warning","log","info","debug"],Mv=Yo(),Mu={nowSeconds:()=>Date.now()/1e3},Hc=typeof __SENTRY_BROWSER_BUNDLE__<"u"&&__SENTRY_BROWSER_BUNDLE__||Object.prototype.toString.call(typeof process<"u"?process:0)!=="[object process]"?function(){const{performance:r}=Mv;if(!(!r||!r.now))return{now:()=>r.now(),timeOrigin:Date.now()-r.now()}}():function(){try{return(r=zg,t="perf_hooks",r.require(t)).performance}catch{return}var r,t}(),qh=Hc===void 0?Mu:{nowSeconds:()=>(Hc.timeOrigin+Hc.now())/1e3},Ys=Mu.nowSeconds.bind(Mu),Pv=qh.nowSeconds.bind(qh);function qo(r,t=[]){return[r,t]}function y0(r,t){const[i,a]=r;return[i,[...a,t]]}function Wh(r,t){const i=r[1];for(const a of i)if(t(a,a[0].type))return!0;return!1}function Pu(r,t){return(t||new TextEncoder).encode(r)}function _0(r,t){const[i,a]=r;let s=JSON.stringify(i);function c(p){typeof s=="string"?s=typeof p=="string"?s+p:[Pu(s,t),p]:s.push(typeof p=="string"?Pu(p,t):p)}for(const p of a){const[h,f]=p;if(c(` ${JSON.stringify(h)} `),typeof f=="string"||f instanceof Uint8Array)c(f);else{let _;try{_=JSON.stringify(f)}catch{_=JSON.stringify(pr(f))}c(_)}}return typeof s=="string"?s:function(p){const h=p.reduce((v,S)=>v+S.length,0),f=new Uint8Array(h);let _=0;for(const v of p)f.set(v,_),_+=v.length;return f}(s)}function S0(r,t){const i=typeof r.data=="string"?Pu(r.data,t):r.data;return[Hs({type:"attachment",length:i.length,filename:r.filename,content_type:r.contentType,attachment_type:r.attachmentType}),i]}(()=>{const{performance:r}=Mv;if(!r||!r.now)return;const t=36e5,i=r.now(),a=Date.now(),s=r.timeOrigin?Math.abs(r.timeOrigin+i-a):t,c=sfunction(a){return Hs({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,t={}){if(t.user&&(!r.ipAddress&&t.user.ip_address&&(r.ipAddress=t.user.ip_address),r.did||t.did||(r.did=t.user.id||t.user.email||t.user.username)),r.timestamp=t.timestamp||Pv(),t.ignoreDuration&&(r.ignoreDuration=t.ignoreDuration),t.sid&&(r.sid=t.sid.length===32?t.sid:vr()),t.init!==void 0&&(r.init=t.init),!r.did&&t.did&&(r.did=`${t.did}`),typeof t.started=="number"&&(r.started=t.started),r.ignoreDuration)r.duration=void 0;else if(typeof t.duration=="number")r.duration=t.duration;else{const i=r.timestamp-r.started;r.duration=i>=0?i:0}t.release&&(r.release=t.release),t.environment&&(r.environment=t.environment),!r.ipAddress&&t.ipAddress&&(r.ipAddress=t.ipAddress),!r.userAgent&&t.userAgent&&(r.userAgent=t.userAgent),typeof t.errors=="number"&&(r.errors=t.errors),t.status&&(r.status=t.status)}class zr{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Gh()}static clone(t){const i=new zr;return t&&(i._breadcrumbs=[...t._breadcrumbs],i._tags={...t._tags},i._extra={...t._extra},i._contexts={...t._contexts},i._user=t._user,i._level=t._level,i._span=t._span,i._session=t._session,i._transactionName=t._transactionName,i._fingerprint=t._fingerprint,i._eventProcessors=[...t._eventProcessors],i._requestSession=t._requestSession,i._attachments=[...t._attachments],i._sdkProcessingMetadata={...t._sdkProcessingMetadata},i._propagationContext={...t._propagationContext}),i}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{},this._session&&Bi(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,i){return this._tags={...this._tags,[t]:i},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,i){return this._extra={...this._extra,[t]:i},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,i){return i===null?delete this._contexts[t]:this._contexts[t]=i,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const t=this.getSpan();return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if(typeof t=="function"){const i=t(this);return i instanceof zr?i:this}return t instanceof zr?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession),t._propagationContext&&(this._propagationContext=t._propagationContext)):Ni(t)&&(this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.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=Gh(),this}addBreadcrumb(t,i){const a=typeof i=="number"?i:100;if(a<=0)return this;const s={timestamp:Ys(),...t};return this._breadcrumbs=[...this._breadcrumbs,s].slice(-a),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(t,i={}){if(this._extra&&Object.keys(this._extra).length&&(t.extra={...this._extra,...t.extra}),this._tags&&Object.keys(this._tags).length&&(t.tags={...this._tags,...t.tags}),this._user&&Object.keys(this._user).length&&(t.user={...this._user,...t.user}),this._contexts&&Object.keys(this._contexts).length&&(t.contexts={...this._contexts,...t.contexts}),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts={trace:this._span.getTraceContext(),...t.contexts};const a=this._span.transaction;if(a){t.sdkProcessingMetadata={dynamicSamplingContext:a.getDynamicSamplingContext(),...t.sdkProcessingMetadata};const s=a.name;s&&(t.tags={transaction:s,...t.tags})}}return this._applyFingerprint(t),t.breadcrumbs=[...t.breadcrumbs||[],...this._breadcrumbs],t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},this._notifyEventProcessors([...xv(),...this._eventProcessors],t,i)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(t,i,a,s=0){return new Rt((c,p)=>{const h=t[s];if(i===null||typeof h!="function")c(i);else{const f=h({...i},a);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.id&&f===null&&Te.log(`Event processor "${h.id}" dropped event`),td(f)?f.then(_=>this._notifyEventProcessors(t,_,a,s+1).then(c)).then(null,p):this._notifyEventProcessors(t,f,a,s+1).then(c).then(null,p)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}_applyFingerprint(t){var i;t.fingerprint=t.fingerprint?(i=t.fingerprint,Array.isArray(i)?i:[i]):[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}}function xv(){return nd("globalEventProcessors",()=>[])}function Lv(r){xv().push(r)}function Gh(){return{traceId:vr(),spanId:vr().substring(16),sampled:!1}}const Av=4,E0=100;class ad{constructor(t,i=new zr,a=Av){this._version=a,this._stack=[{scope:i}],t&&this.bindClient(t)}isOlderThan(t){return this._version{c.captureException(t,{originalException:t,syntheticException:s,...i,event_id:a},p)}),a}captureMessage(t,i,a){const s=this._lastEventId=a&&a.event_id?a.event_id:vr(),c=new Error(t);return this._withClient((p,h)=>{p.captureMessage(t,i,{originalException:t,syntheticException:c,...a,event_id:s},h)}),s}captureEvent(t,i){const a=i&&i.event_id?i.event_id:vr();return t.type||(this._lastEventId=a),this._withClient((s,c)=>{s.captureEvent(t,{...i,event_id:a},c)}),a}lastEventId(){return this._lastEventId}addBreadcrumb(t,i){const{scope:a,client:s}=this.getStackTop();if(!s)return;const{beforeBreadcrumb:c=null,maxBreadcrumbs:p=E0}=s.getOptions&&s.getOptions()||{};if(p<=0)return;const h={timestamp:Ys(),...t},f=c?kv(()=>c(h,i)):h;f!==null&&(s.emit&&s.emit("beforeAddBreadcrumb",f,i),a.addBreadcrumb(f,p))}setUser(t){this.getScope().setUser(t)}setTags(t){this.getScope().setTags(t)}setExtras(t){this.getScope().setExtras(t)}setTag(t,i){this.getScope().setTag(t,i)}setExtra(t,i){this.getScope().setExtra(t,i)}setContext(t,i){this.getScope().setContext(t,i)}configureScope(t){const{scope:i,client:a}=this.getStackTop();a&&t(i)}run(t){const i=Hh(this);try{t(this)}finally{Hh(i)}}getIntegration(t){const i=this.getClient();if(!i)return null;try{return i.getIntegration(t)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,i){const a=this._callExtensionMethod("startTransaction",t,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(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){const t=this.getStackTop().scope,i=t.getSession();i&&function(a,s){let c={};a.status==="ok"&&(c={status:"exited"}),Bi(a,c)}(i),this._sendSessionUpdate(),t.setSession()}startSession(t){const{scope:i,client:a}=this.getStackTop(),{release:s,environment:c=od}=a&&a.getOptions()||{},{userAgent:p}=en.navigator||{},h=C0({release:s,environment:c,user:i.getUser(),...p&&{userAgent:p},...t}),f=i.getSession&&i.getSession();return f&&f.status==="ok"&&Bi(f,{status:"exited"}),this.endSession(),i.setSession(h),h}shouldSendDefaultPii(){const t=this.getClient(),i=t&&t.getOptions();return!!(i&&i.sendDefaultPii)}_sendSessionUpdate(){const{scope:t,client:i}=this.getStackTop(),a=t.getSession();a&&i&&i.captureSession&&i.captureSession(a)}_withClient(t){const{scope:i,client:a}=this.getStackTop();a&&t(a,i)}_callExtensionMethod(t,...i){const a=Rs().__SENTRY__;if(a&&a.extensions&&typeof a.extensions[t]=="function")return a.extensions[t].apply(this,i);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function Rs(){return en.__SENTRY__=en.__SENTRY__||{extensions:{},hub:void 0},en}function Hh(r){const t=Rs(),i=Ou(t);return Dv(t,r),i}function Vt(){const r=Rs();if(r.__SENTRY__&&r.__SENTRY__.acs){const t=r.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(t=Rs()){i=t,i&&i.__SENTRY__&&i.__SENTRY__.hub&&!Ou(t).isOlderThan(Av)||Dv(t,new ad);var i;return Ou(t)}(r)}function Ou(r){return nd("hub",()=>new ad,r)}function Dv(r,t){return r?((r.__SENTRY__=r.__SENTRY__||{}).hub=t,!0):!1}const T0="7";function M0(r,t){return i={sentry_key:r.publicKey,sentry_version:T0,...t&&{sentry_client:`${t.name}/${t.version}`}},Object.keys(i).map(a=>`${encodeURIComponent(a)}=${encodeURIComponent(i[a])}`).join("&");var i}function P0(r,t,i,a){const s=Ov(i),c=r.type&&r.type!=="replay_event"?r.type:"event";(function(h,f){f&&(h.sdk=h.sdk||{},h.sdk.name=h.sdk.name||f.name,h.sdk.version=h.sdk.version||f.version,h.sdk.integrations=[...h.sdk.integrations||[],...f.integrations||[]],h.sdk.packages=[...h.sdk.packages||[],...f.packages||[]])})(r,i&&i.sdk);const p=function(h,f,_,v){const S=h.sdkProcessingMetadata&&h.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:h.event_id,sent_at:new Date().toISOString(),...f&&{sdk:f},...!!_&&{dsn:Is(v)},...S&&{trace:Hs({...S})}}}(r,s,a,t);return delete r.sdkProcessingMetadata,qo(p,[[{type:c},r]])}const Yh=[];function Qh(r,t){t[r.name]=r,Yh.indexOf(r.name)===-1&&(r.setupOnce(Lv,Vt),Yh.push(r.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.log(`Integration installed: ${r.name}`))}function O0(r,t,i,a){const{normalizeDepth:s=3,normalizeMaxBreadth:c=1e3}=r,p={...t,event_id:t.event_id||i.event_id||vr(),timestamp:t.timestamp||Ys()},h=i.integrations||r.integrations.map(v=>v.name);(function(v,S){const{environment:E,release:M,dist:D,maxValueLength:L=250}=S;"environment"in v||(v.environment="environment"in S?E:od),v.release===void 0&&M!==void 0&&(v.release=M),v.dist===void 0&&D!==void 0&&(v.dist=D),v.message&&(v.message=Li(v.message,L));const B=v.exception&&v.exception.values&&v.exception.values[0];B&&B.value&&(B.value=Li(B.value,L));const W=v.request;W&&W.url&&(W.url=Li(W.url,L))})(p,r),function(v,S){S.length>0&&(v.sdk=v.sdk||{},v.sdk.integrations=[...v.sdk.integrations||[],...S])}(p,h),t.type===void 0&&function(v,S){const E=en._sentryDebugIds;if(!E)return;let M;const D=Kh.get(S);D?M=D:(M=new Map,Kh.set(S,M));const L=Object.keys(E).reduce((B,W)=>{let te;const Y=M.get(W);Y?te=Y:(te=S(W),M.set(W,te));for(let j=te.length-1;j>=0;j--){const P=te[j];if(P.filename){B[P.filename]=E[W];break}}return B},{});try{v.exception.values.forEach(B=>{B.stacktrace.frames.forEach(W=>{W.filename&&(W.debug_id=L[W.filename])})})}catch{}}(p,r.stackParser);let f=a;i.captureContext&&(f=zr.clone(f).update(i.captureContext));let _=Jr(p);if(f){if(f.getAttachments){const v=[...i.attachments||[],...f.getAttachments()];v.length&&(i.attachments=v)}_=f.applyToEvent(p,i)}return _.then(v=>(v&&function(S){const E={};try{S.exception.values.forEach(D=>{D.stacktrace.frames.forEach(L=>{L.debug_id&&(L.abs_path?E[L.abs_path]=L.debug_id:L.filename&&(E[L.filename]=L.debug_id),delete L.debug_id)})})}catch{}if(Object.keys(E).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(E).forEach(D=>{M.push({type:"sourcemap",code_file:D,debug_id:E[D]})})}(v),typeof s=="number"&&s>0?function(S,E,M){if(!S)return null;const D={...S,...S.breadcrumbs&&{breadcrumbs:S.breadcrumbs.map(L=>({...L,...L.data&&{data:pr(L.data,E,M)}}))},...S.user&&{user:pr(S.user,E,M)},...S.contexts&&{contexts:pr(S.contexts,E,M)},...S.extra&&{extra:pr(S.extra,E,M)}};return S.contexts&&S.contexts.trace&&D.contexts&&(D.contexts.trace=S.contexts.trace,S.contexts.trace.data&&(D.contexts.trace.data=pr(S.contexts.trace.data,E,M))),S.spans&&(D.spans=S.spans.map(L=>(L.data&&(L.data=pr(L.data,E,M)),L))),D}(v,s,c):v))}const Kh=new WeakMap,Xh="Not capturing exception because it's already been captured.";class Ur{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(t){if(Ur.prototype.__init.call(this),Ur.prototype.__init2.call(this),Ur.prototype.__init3.call(this),Ur.prototype.__init4.call(this),Ur.prototype.__init5.call(this),this._options=t,t.dsn?this._dsn=f0(t.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn("No DSN provided, client will not do anything."),this._dsn){const i=function(a,s={}){const c=typeof s=="string"?s:s.tunnel,p=typeof s!="string"&&s._metadata?s._metadata.sdk:void 0;return c||`${function(h){return`${function(f){const _=f.protocol?`${f.protocol}:`:"",v=f.port?`:${f.port}`:"";return`${_}//${f.host}${v}${f.path?`/${f.path}`:""}/api/`}(h)}${h.projectId}/envelope/`}(a)}?${M0(a,p)}`}(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:i})}}captureException(t,i,a){if(Vh(t))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.log(Xh));let s=i&&i.event_id;return this._process(this.eventFromException(t,i).then(c=>this._captureEvent(c,i,a)).then(c=>{s=c})),s}captureMessage(t,i,a,s){let c=a&&a.event_id;const p=wv(t)?this.eventFromMessage(String(t),i,a):this.eventFromException(t,a);return this._process(p.then(h=>this._captureEvent(h,a,s)).then(h=>{c=h})),c}captureEvent(t,i,a){if(i&&i.originalException&&Vh(i.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.log(Xh));let s=i&&i.event_id;return this._process(this._captureEvent(t,i,a).then(c=>{s=c})),s}captureSession(t){this._isEnabled()?typeof t.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),Bi(t,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.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(t){const i=this._transport;return i?this._isClientDoneProcessing(t).then(a=>i.flush(t).then(s=>a&&s)):Jr(!0)}close(t){return this.flush(t).then(i=>(this.getOptions().enabled=!1,i))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(t){const i={};return t.forEach(a=>{a&&Qh(a,i)}),i}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){Qh(t,this._integrations)}sendEvent(t,i={}){if(this._dsn){let a=P0(t,this._dsn,this._options._metadata,this._options.tunnel);for(const c of i.attachments||[])a=y0(a,S0(c,this._options.transportOptions&&this._options.transportOptions.textEncoder));const s=this._sendEnvelope(a);s&&s.then(c=>this.emit("afterSendEvent",t,c),null)}}sendSession(t){if(this._dsn){const i=function(a,s,c,p){const h=Ov(c);return qo({sent_at:new Date().toISOString(),...h&&{sdk:h},...!!p&&{dsn:Is(s)}},["aggregates"in a?[{type:"sessions"},a]:[{type:"session"},a.toJSON()]])}(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(i)}}recordDroppedEvent(t,i,a){if(this._options.sendClientReports){const s=`${t}:${i}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.log(`Adding outcome: "${s}"`),this._outcomes[s]=this._outcomes[s]+1||1}}on(t,i){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(i)}emit(t,...i){this._hooks[t]&&this._hooks[t].forEach(a=>a(...i))}_updateSessionFromEvent(t,i){let a=!1,s=!1;const c=i.exception&&i.exception.values;if(c){s=!0;for(const h of c){const f=h.mechanism;if(f&&f.handled===!1){a=!0;break}}}const p=t.status==="ok";(p&&t.errors===0||p&&a)&&(Bi(t,{...a&&{status:"crashed"},errors:t.errors||Number(s||a)}),this.captureSession(t))}_isClientDoneProcessing(t){return new Rt(i=>{let a=0;const s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),i(!0)):(a+=1,t&&a>=t&&(clearInterval(s),i(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(t,i,a){const s=this.getOptions(),c=Object.keys(this._integrations);return!i.integrations&&c.length>0&&(i.integrations=c),O0(s,t,i,a).then(p=>{if(p===null)return p;const{propagationContext:h}=p.sdkProcessingMetadata||{};if(!(p.contexts&&p.contexts.trace)&&h){const{traceId:f,spanId:_,parentSpanId:v,dsc:S}=h;p.contexts={trace:{trace_id:f,span_id:_,parent_span_id:v},...p.contexts};const E=S||function(M,D,L){const B=D.getOptions(),{publicKey:W}=D.getDsn()||{},{segment:te}=L&&L.getUser()||{},Y=Hs({environment:B.environment||od,release:B.release,user_segment:te,public_key:W,trace_id:M});return D.emit&&D.emit("createDsc",Y),Y}(f,this,a);p.sdkProcessingMetadata={dynamicSamplingContext:E,...p.sdkProcessingMetadata}}return p})}_captureEvent(t,i={},a){return this._processEvent(t,i,a).then(s=>s.event_id,s=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const c=s;c.logLevel==="log"?Te.log(c.message):Te.warn(c)}})}_processEvent(t,i,a){const s=this.getOptions(),{sampleRate:c}=s;if(!this._isEnabled())return js(new fn("SDK not enabled, will not capture event.","log"));const p=em(t),h=Zh(t),f=t.type||"error",_=`before send for type \`${f}\``;if(h&&typeof c=="number"&&Math.random()>c)return this.recordDroppedEvent("sample_rate","error",t),js(new fn(`Discarding event because it's not included in the random sample (sampling rate = ${c})`,"log"));const v=f==="replay_event"?"replay":f;return this._prepareEvent(t,i,a).then(S=>{if(S===null)throw this.recordDroppedEvent("event_processor",v,t),new fn("An event processor returned `null`, will not send event.","log");if(i.data&&i.data.__sentry__===!0)return S;const E=function(M,D,L){const{beforeSend:B,beforeSendTransaction:W}=M;return Zh(D)&&B?B(D,L):em(D)&&W?W(D,L):D}(s,S,i);return function(M,D){const L=`${D} must return \`null\` or a valid event.`;if(td(M))return M.then(B=>{if(!Ni(B)&&B!==null)throw new fn(L);return B},B=>{throw new fn(`${D} rejected with ${B}`)});if(!Ni(M)&&M!==null)throw new fn(L);return M}(E,_)}).then(S=>{if(S===null)throw this.recordDroppedEvent("before_send",v,t),new fn(`${_} returned \`null\`, will not send event.`,"log");const E=a&&a.getSession();!p&&E&&this._updateSessionFromEvent(E,S);const M=S.transaction_info;if(p&&M&&S.transaction!==t.transaction){const D="custom";S.transaction_info={...M,source:D}}return this.sendEvent(S,i),S}).then(null,S=>{throw S instanceof fn?S:(this.captureException(S,{data:{__sentry__:!0},originalException:S}),new fn(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${S}`))})}_process(t){this._numProcessing++,t.then(i=>(this._numProcessing--,i),i=>(this._numProcessing--,i))}_sendEnvelope(t){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",t),this._transport.send(t).then(null,i=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.error("Error while sending event:",i)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.error("Transport disabled")}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.keys(t).map(i=>{const[a,s]=i.split(":");return{reason:a,category:s,quantity:t[i]}})}}function Zh(r){return r.type===void 0}function em(r){return r.type==="transaction"}const x0=30;function L0(r,t,i=v0(r.bufferSize||x0)){let a={};function s(c){const p=[];if(Wh(c,(_,v)=>{const S=Jh(v);if(function(E,M,D=Date.now()){return function(L,B){return L[B]||L.all||0}(E,M)>D}(a,S)){const E=tm(_,v);r.recordDroppedEvent("ratelimit_backoff",S,E)}else p.push(_)}),p.length===0)return Jr();const h=qo(c[0],p),f=_=>{Wh(h,(v,S)=>{const E=tm(v,S);r.recordDroppedEvent(_,Jh(S),E)})};return i.add(()=>t({body:_0(h,r.textEncoder)}).then(_=>(_.statusCode!==void 0&&(_.statusCode<200||_.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Sentry responded with status code ${_.statusCode} to sent event.`),a=b0(a,_),_),_=>{throw f("network_error"),_})).then(_=>_,_=>{if(_ instanceof fn)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.error("Skipped sending event because buffer is full."),f("queue_overflow"),Jr();throw _})}return s.__sentry__baseTransport__=!0,{send:s,flush:c=>i.drain(c)}}function tm(r,t){if(t==="event"||t==="transaction")return Array.isArray(r)?r[1]:void 0}const nm="7.60.1";let rm;class Wo{constructor(){Wo.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Wo.id}setupOnce(){rm=Function.prototype.toString;try{Function.prototype.toString=function(...t){const i=id(this)||this;return rm.apply(i,t)}}catch{}}}Wo.__initStatic();const A0=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],D0=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class Ai{static __initStatic(){this.id="InboundFilters"}__init(){this.name=Ai.id}constructor(t={}){this._options=t,Ai.prototype.__init.call(this)}setupOnce(t,i){const a=s=>{const c=i();if(c){const p=c.getIntegration(Ai);if(p){const h=c.getClient(),f=h?h.getOptions():{},_=function(v={},S={}){return{allowUrls:[...v.allowUrls||[],...S.allowUrls||[]],denyUrls:[...v.denyUrls||[],...S.denyUrls||[]],ignoreErrors:[...v.ignoreErrors||[],...S.ignoreErrors||[],...v.disableErrorDefaults?[]:A0],ignoreTransactions:[...v.ignoreTransactions||[],...S.ignoreTransactions||[],...v.disableTransactionDefaults?[]:D0],ignoreInternal:v.ignoreInternal===void 0||v.ignoreInternal}}(p._options,f);return function(v,S){return S.ignoreInternal&&function(E){try{return E.exception.values[0].type==="SentryError"}catch{}return!1}(v)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Event dropped due to being internal Sentry Error. Event: ${fr(v)}`),!0):function(E,M){return E.type||!M||!M.length?!1:function(D){if(D.message)return[D.message];if(D.exception){const{values:L}=D.exception;try{const{type:B="",value:W=""}=L&&L[L.length-1]||{};return[`${W}`,`${B}: ${W}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.error(`Cannot extract message for event ${fr(D)}`),[]}}return[]}(E).some(D=>ls(D,M))}(v,S.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${fr(v)}`),!0):function(E,M){if(E.type!=="transaction"||!M||!M.length)return!1;const D=E.transaction;return!!D&&ls(D,M)}(v,S.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${fr(v)}`),!0):function(E,M){if(!M||!M.length)return!1;const D=ms(E);return!!D&&ls(D,M)}(v,S.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${fr(v)}. Url: ${ms(v)}`),!0):function(E,M){if(!M||!M.length)return!0;const D=ms(E);return!D||ls(D,M)}(v,S.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${fr(v)}. Url: ${ms(v)}`),!0)}(s,_)?null:s}}return s};a.id=this.name,t(a)}}function ms(r){try{let t;try{t=r.exception.values[0].stacktrace.frames}catch{}return t?function(i=[]){for(let a=i.length-1;a>=0;a--){const s=i[a];if(s&&s.filename!==""&&s.filename!=="[native code]")return s.filename||null}return null}(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.error(`Cannot extract url for event ${fr(r)}`),null}}Ai.__initStatic();var I0=Object.freeze({__proto__:null,FunctionToString:Wo,InboundFilters:Ai});const We=en;let xu=0;function Iv(){return xu>0}function Fi(r,t={},i){if(typeof r!="function")return r;try{const s=r.__sentry_wrapped__;if(s)return s;if(id(r))return r}catch{return r}const a=function(){const s=Array.prototype.slice.call(arguments);try{i&&typeof i=="function"&&i.apply(this,arguments);const p=s.map(h=>Fi(h,t));return r.apply(this,p)}catch(p){throw xu++,setTimeout(()=>{xu--}),c=h=>{var f,_;h.addEventProcessor(v=>(t.mechanism&&(Eu(v,void 0),Vo(v,t.mechanism)),v.extra={...v.extra,arguments:s},v)),f=p,Vt().captureException(f,{captureContext:_})},Vt().withScope(c),p}var c};try{for(const s in r)Object.prototype.hasOwnProperty.call(r,s)&&(a[s]=r[s])}catch{}bv(a,r),rd(r,"__sentry_wrapped__",a);try{Object.getOwnPropertyDescriptor(a,"name").configurable&&Object.defineProperty(a,"name",{get:()=>r.name})}catch{}return a}function jv(r,t){const i=sd(r,t),a={type:t&&t.name,value:R0(t)};return i.length&&(a.stacktrace={frames:i}),a.type===void 0&&a.value===""&&(a.value="Unrecoverable error caught"),a}function Yc(r,t){return{exception:{values:[jv(r,t)]}}}function sd(r,t){const i=t.stacktrace||t.stack||"",a=function(s){if(s){if(typeof s.framesToPop=="number")return s.framesToPop;if(j0.test(s.message))return 1}return 0}(t);try{return r(i,a)}catch{}return[]}const j0=/Minified React error #\d+;/i;function R0(r){const t=r&&r.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function ld(r,t,i,a,s){let c;if(ed(t)&&t.error)return Yc(r,t.error);if(Lh(t)||$i(t,"DOMException")){const p=t;if("stack"in t)c=Yc(r,t);else{const h=p.name||(Lh(p)?"DOMError":"DOMException"),f=p.message?`${h}: ${p.message}`:h;c=Lu(r,f,i,a),Eu(c,f)}return"code"in p&&(c.tags={...c.tags,"DOMException.code":`${p.code}`}),c}return Sv(t)?Yc(r,t):Ni(t)||As(t)?(c=function(p,h,f,_){const v=Vt().getClient(),S=v&&v.getOptions().normalizeDepth,E={exception:{values:[{type:As(h)?h.constructor.name:_?"UnhandledRejection":"Error",value:N0(h,{isUnhandledRejection:_})}]},extra:{__serialized__:Tv(h,S)}};if(f){const M=sd(p,f);M.length&&(E.exception.values[0].stacktrace={frames:M})}return E}(r,t,i,s),Vo(c,{synthetic:!0}),c):(c=Lu(r,t,i,a),Eu(c,`${t}`),Vo(c,{synthetic:!0}),c)}function Lu(r,t,i,a){const s={message:t};if(a&&i){const c=sd(r,i);c.length&&(s.exception={values:[{value:t,stacktrace:{frames:c}}]})}return s}function N0(r,{isUnhandledRejection:t}){const i=function(s,c=40){const p=Object.keys(Cv(s));if(p.sort(),!p.length)return"[object has no keys]";if(p[0].length>=c)return Li(p[0],c);for(let h=p.length;h>0;h--){const f=p.slice(0,h).join(", ");if(!(f.length>c))return h===p.length?f:Li(f,c)}return""}(r),a=t?"promise rejection":"exception";return ed(r)?`Event \`ErrorEvent\` captured as ${a} with message \`${r.message}\``:As(r)?`Event \`${function(s){try{const c=Object.getPrototypeOf(s);return c?c.constructor.name:void 0}catch{}}(r)}\` (type=${r.type}) captured as ${a}`:`Object captured as ${a} with keys: ${i}`}const im=1024,Rv="Breadcrumbs";class Jo{static __initStatic(){this.id=Rv}__init(){this.name=Jo.id}constructor(t){Jo.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t}}setupOnce(){this.options.console&&Fr("console",B0),this.options.dom&&Fr("dom",function(t){function i(a){let s,c=typeof t=="object"?t.serializeAttribute:void 0,p=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;p&&p>im&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${p} was configured. Sentry will use 1024 instead.`),p=im),typeof c=="string"&&(c=[c]);try{const h=a.event;s=function(f){return!!f&&!!f.target}(h)?wu(h.target,{keyAttrs:c,maxStringLength:p}):wu(h,{keyAttrs:c,maxStringLength:p})}catch{s=""}s.length!==0&&Vt().addBreadcrumb({category:`ui.${a.name}`,message:s},{event:a.event,name:a.name,global:a.global})}return i}(this.options.dom)),this.options.xhr&&Fr("xhr",F0),this.options.fetch&&Fr("fetch",U0),this.options.history&&Fr("history",$0)}addSentryBreadcrumb(t){this.options.sentry&&Vt().addBreadcrumb({category:"sentry."+(t.type==="transaction"?"transaction":"event"),event_id:t.event_id,level:t.level,message:fr(t)},{event:t})}}function B0(r){for(let a=0;a{We.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,i){return function(a,s,c,p){const h=ld(a,s,c&&c.syntheticException||void 0,p);return Vo(h),h.level="error",c&&c.event_id&&(h.event_id=c.event_id),Jr(h)}(this._options.stackParser,t,i,this._options.attachStacktrace)}eventFromMessage(t,i="info",a){return function(s,c,p="info",h,f){const _=Lu(s,c,h&&h.syntheticException||void 0,f);return _.level=p,h&&h.event_id&&(_.event_id=h.event_id),Jr(_)}(this._options.stackParser,t,i,a,this._options.attachStacktrace)}sendEvent(t,i){const a=this.getIntegrationById(Rv);a&&a.addSentryBreadcrumb&&a.addSentryBreadcrumb(t),super.sendEvent(t,i)}captureUserFeedback(t){if(!this._isEnabled())return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn("SDK not enabled, will not capture user feedback."));const i=function(a,{metadata:s,tunnel:c,dsn:p}){const h={event_id:a.event_id,sent_at:new Date().toISOString(),...s&&s.sdk&&{sdk:{name:s.sdk.name,version:s.sdk.version}},...!!c&&!!p&&{dsn:Is(p)}};return qo(h,[function(_){return[{type:"user_report"},_]}(a)])}(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(i)}_prepareEvent(t,i,a){return t.platform=t.platform||"javascript",super._prepareEvent(t,i,a)}_flushOutcomes(){const t=this._clearOutcomes();if(t.length===0)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.log("No outcomes to send"));if(!this._dsn)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.log("No dsn provided, will not send outcomes"));(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.log("Sending outcomes:",t);const i=(a=t,qo((s=this._options.tunnel&&Is(this._dsn))?{dsn:s}:{},[[{type:"client_report"},{timestamp:c||Ys(),discarded_events:a}]]));var a,s,c;this._sendEnvelope(i)}}let xo;function V0(r,t=function(){if(xo)return xo;if(bu(We.fetch))return xo=We.fetch.bind(We);const i=We.document;let a=We.fetch;if(i&&typeof i.createElement=="function")try{const s=i.createElement("iframe");s.hidden=!0,i.head.appendChild(s);const c=s.contentWindow;c&&c.fetch&&(a=c.fetch),i.head.removeChild(s)}catch(s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",s)}return xo=a.bind(We)}()){let i=0,a=0;return L0(r,function(s){const c=s.body.length;i+=c,a++;const p={body:s.body,method:"POST",referrerPolicy:"origin",headers:r.headers,keepalive:i<=6e4&&a<15,...r.fetchOptions};try{return t(r.url,p).then(h=>(i-=c,a--,{statusCode:h.status,headers:{"x-sentry-rate-limits":h.headers.get("X-Sentry-Rate-Limits"),"retry-after":h.headers.get("Retry-After")}}))}catch(h){return xo=void 0,i-=c,a--,js(h)}})}class gr{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=gr.id}__init2(){this._installFunc={onerror:q0,onunhandledrejection:W0}}constructor(t){gr.prototype.__init.call(this),gr.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...t}}setupOnce(){Error.stackTraceLimit=50;const t=this._options;for(const a in t){const s=this._installFunc[a];s&&t[a]&&(i=a,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.log(`Global Handler attached: ${i}`),s(),this._installFunc[a]=void 0)}var i}}function q0(){Fr("error",r=>{const[t,i,a]=Bv();if(!t.getIntegration(gr))return;const{msg:s,url:c,line:p,column:h,error:f}=r;if(Iv()||f&&f.__sentry_own_request__)return;const _=f===void 0&&qr(s)?function(v,S,E,M){const D=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let L=ed(v)?v.message:v,B="Error";const W=L.match(D);return W&&(B=W[1],L=W[2]),om({exception:{values:[{type:B,value:L}]}},S,E,M)}(s,c,p,h):om(ld(i,f||s,void 0,a,!1),c,p,h);_.level="error",Nv(t,f,_,"onerror")})}function W0(){Fr("unhandledrejection",r=>{const[t,i,a]=Bv();if(!t.getIntegration(gr))return;let s=r;try{"reason"in r?s=r.reason:"detail"in r&&"reason"in r.detail&&(s=r.detail.reason)}catch{}if(Iv()||s&&s.__sentry_own_request__)return!0;const c=wv(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:ld(i,s,void 0,a,!0);c.level="error",Nv(t,s,c,"onunhandledrejection")})}function om(r,t,i,a){const s=r.exception=r.exception||{},c=s.values=s.values||[],p=c[0]=c[0]||{},h=p.stacktrace=p.stacktrace||{},f=h.frames=h.frames||[],_=isNaN(parseInt(a,10))?void 0:a,v=isNaN(parseInt(i,10))?void 0:i,S=qr(t)&&t.length>0?t:function(){try{return l0.document.location.href}catch{return""}}();return f.length===0&&f.push({colno:_,filename:S,function:"?",in_app:!0,lineno:v}),r}function Nv(r,t,i,a){Vo(i,{handled:!1,type:a}),r.captureEvent(i,{originalException:t})}function Bv(){const r=Vt(),t=r.getClient(),i=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[r,i.stackParser,i.attachStacktrace]}gr.__initStatic();const J0=["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 Go{static __initStatic(){this.id="TryCatch"}__init(){this.name=Go.id}constructor(t){Go.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t}}setupOnce(){this._options.setTimeout&&yt(We,"setTimeout",am),this._options.setInterval&&yt(We,"setInterval",am),this._options.requestAnimationFrame&&yt(We,"requestAnimationFrame",G0),this._options.XMLHttpRequest&&"XMLHttpRequest"in We&&yt(XMLHttpRequest.prototype,"send",H0);const t=this._options.eventTarget;t&&(Array.isArray(t)?t:J0).forEach(Y0)}}function am(r){return function(...t){const i=t[0];return t[0]=Fi(i,{mechanism:{data:{function:yr(r)},handled:!0,type:"instrument"}}),r.apply(this,t)}}function G0(r){return function(t){return r.apply(this,[Fi(t,{mechanism:{data:{function:"requestAnimationFrame",handler:yr(r)},handled:!0,type:"instrument"}})])}}function H0(r){return function(...t){const i=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(a=>{a in i&&typeof i[a]=="function"&&yt(i,a,function(s){const c={mechanism:{data:{function:a,handler:yr(s)},handled:!0,type:"instrument"}},p=id(s);return p&&(c.mechanism.data.handler=yr(p)),Fi(s,c)})}),r.apply(this,t)}}function Y0(r){const t=We,i=t[r]&&t[r].prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(yt(i,"addEventListener",function(a){return function(s,c,p){try{typeof c.handleEvent=="function"&&(c.handleEvent=Fi(c.handleEvent,{mechanism:{data:{function:"handleEvent",handler:yr(c),target:r},handled:!0,type:"instrument"}}))}catch{}return a.apply(this,[s,Fi(c,{mechanism:{data:{function:"addEventListener",handler:yr(c),target:r},handled:!0,type:"instrument"}}),p])}}),yt(i,"removeEventListener",function(a){return function(s,c,p){const h=c;try{const f=h&&h.__sentry_wrapped__;f&&a.call(this,s,f,p)}catch{}return a.call(this,s,h,p)}}))}Go.__initStatic();class Di{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=Di.id}constructor(t={}){Di.prototype.__init.call(this),this._key=t.key||"cause",this._limit=t.limit||5}setupOnce(t,i){t((a,s)=>{const c=i(),p=c.getClient(),h=c.getIntegration(Di);if(!p||!h)return a;const f=p.getOptions();return s0(jv,f.stackParser,f.maxValueLength,h._key,h._limit,a,s),a})}}Di.__initStatic();class Ii{constructor(){Ii.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=Ii.id}setupOnce(){Lv(t=>{if(Vt().getIntegration(Ii)){if(!We.navigator&&!We.location&&!We.document)return t;const i=t.request&&t.request.url||We.location&&We.location.href,{referrer:a}=We.document||{},{userAgent:s}=We.navigator||{},c={...t.request&&t.request.headers,...a&&{Referer:a},...s&&{"User-Agent":s}},p={...t.request,...i&&{url:i},headers:c};return{...t,request:p}}return t})}}Ii.__initStatic();class ji{constructor(){ji.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=ji.id}setupOnce(t,i){const a=s=>{if(s.type)return s;const c=i().getIntegration(ji);if(c){try{if(function(p,h){return h?!!(function(f,_){const v=f.message,S=_.message;return!(!v&&!S||v&&!S||!v&&S||v!==S||!lm(f,_)||!sm(f,_))}(p,h)||function(f,_){const v=cm(_),S=cm(f);return!(!v||!S||v.type!==S.type||v.value!==S.value||!lm(f,_)||!sm(f,_))}(p,h)):!1}(s,c._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Te.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return c._previousEvent=s}return c._previousEvent=s}return s};a.id=this.name,t(a)}}function sm(r,t){let i=um(r),a=um(t);if(!i&&!a)return!0;if(i&&!a||!i&&a||a.length!==i.length)return!1;for(let s=0;s=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(t.major===13&&t.minor===0&&t.point===0);case"Firefox":return t.major>=67}return!0}(Gr(),Ns())||Re())}function Em(){if(Re()||!document)return!1;var r=document.createElement("iframe");return!!r.requestFullscreen||!!r.webkitRequestFullscreen}var ZS=function(){try{var r=document.createElement("canvas"),t=r.getContext("webgl2")!=null;return r.remove(),t}catch{return!1}}();function zv(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!Re()&&!!ZS&&(r?function(){return Mm()?!1:["Chrome","Firefox"].includes(Gr())}():function(){if(Mm())return!1;var t=Gr();if(t==="Safari"){var i=ud();if(i.major<15||i.major===15&&i.minor<4)return!1}return t==="Chrome"?cd().major>=77:t==="Firefox"?dd().major>=97:["Chrome","Firefox","Safari"].includes(t)}())}function Vv(){if(Re()||qv()||typeof AudioWorkletNode>"u")return!1;switch(Gr()){case"Chrome":case"Firefox":return!0;case"Safari":return Ns().major>=17}return!1}function Tm(){return $v()&&!function(){var r,t=Gr();if(!tn())return!0;switch(t){case"Chrome":return(r=cd()).major&&r.major>0&&r.major<75;case"Firefox":return(r=dd()).major<91;case"Safari":return(r=ud()).major<13||r.major===13&&r.minor<1;default:return!0}}()}function qv(){return tn().match(/Linux; Android/)}function Mm(){var r,t,i=tn(),a=i.match(/Mac/)&&(!Re()&&typeof window<"u"&&(r=window)!==null&&r!==void 0&&(t=r.navigator)!==null&&t!==void 0&&t.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(i.match(/Mobi/)||i.match(/Android/)||a)||!!tn().match(/DailyAnd\//)||void 0}function Gr(){if(typeof window<"u"){var r=tn();return Wv()?"Safari":r.indexOf("Edge")>-1?"Edge":r.match(/Chrome\//)?"Chrome":r.indexOf("Safari")>-1||Jv()?"Safari":r.indexOf("Firefox")>-1?"Firefox":r.indexOf("MSIE")>-1||r.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function Ns(){switch(Gr()){case"Chrome":return cd();case"Safari":return ud();case"Firefox":return dd();case"Edge":return function(){var r=0,t=0;if(typeof window<"u"){var i=tn().match(/Edge\/(\d+).(\d+)/);if(i)try{r=parseInt(i[1]),t=parseInt(i[2])}catch{}}return{major:r,minor:t}}()}}function cd(){var r=0,t=0,i=0,a=0,s=!1;if(typeof window<"u"){var c=tn(),p=c.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(p)try{r=parseInt(p[1]),t=parseInt(p[2]),i=parseInt(p[3]),a=parseInt(p[4]),s=c.indexOf("OPR/")>-1}catch{}}return{major:r,minor:t,build:i,patch:a,opera:s}}function Wv(){return!!tn().match(/iPad|iPhone|iPod/i)&&$v()}function Jv(){return tn().indexOf("AppleWebKit/605.1.15")>-1}function ud(){var r=0,t=0,i=0;if(typeof window<"u"){var a=tn().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(a)try{r=parseInt(a[1]),t=parseInt(a[2]),i=parseInt(a[4])}catch{}else(Wv()||Jv())&&(r=14,t=0,i=3)}return{major:r,minor:t,point:i}}function dd(){var r=0,t=0;if(typeof window<"u"){var i=tn().match(/Firefox\/(\d+).(\d+)/);if(i)try{r=parseInt(i[1]),t=parseInt(i[2])}catch{}}return{major:r,minor:t}}var Gv=function(){function r(){vn(this,r)}return gn(r,[{key:"addListenerForMessagesFromCallMachine",value:function(t,i,a){Oo()}},{key:"addListenerForMessagesFromDailyJs",value:function(t,i,a){Oo()}},{key:"sendMessageToCallMachine",value:function(t,i,a,s){Oo()}},{key:"sendMessageToDailyJs",value:function(t,i){Oo()}},{key:"removeListener",value:function(t){Oo()}}]),r}();function Pm(r,t){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),i.push.apply(i,a)}return i}function eu(r){for(var t=1;t"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=mn(r);if(t){var s=mn(this).constructor;i=Reflect.construct(a,arguments,s)}else i=a.apply(this,arguments);return Js(this,i)}}var tw=function(r){Ws(i,Gv);var t=ew(i);function i(){var a;return vn(this,i),(a=t.call(this))._wrappedListeners={},a._messageCallbacks={},a}return gn(i,[{key:"addListenerForMessagesFromCallMachine",value:function(a,s,c){var p=this,h=function(f){if(f.data&&f.data.what==="iframe-call-message"&&(!f.data.callClientId||f.data.callClientId===s)&&(!f.data.from||f.data.from!=="module")){var _=eu({},f.data);if(delete _.from,_.callbackStamp&&p._messageCallbacks[_.callbackStamp]){var v=_.callbackStamp;p._messageCallbacks[v].call(c,_),delete p._messageCallbacks[v]}delete _.what,delete _.callbackStamp,a.call(c,_)}};this._wrappedListeners[a]=h,window.addEventListener("message",h)}},{key:"addListenerForMessagesFromDailyJs",value:function(a,s,c){var p=function(h){var f;if(!(!h.data||h.data.what!==Xc||!h.data.action||h.data.from&&h.data.from!=="module"||h.data.callClientId&&s&&h.data.callClientId!==s||h!=null&&(f=h.data)!==null&&f!==void 0&&f.callFrameId)){var _=h.data;a.call(c,_)}};this._wrappedListeners[a]=p,window.addEventListener("message",p)}},{key:"sendMessageToCallMachine",value:function(a,s,c,p){if(!c)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var h=eu({},a);if(h.what=Xc,h.from="module",h.callClientId=c,s){var f=Gs();this._messageCallbacks[f]=s,h.callbackStamp=f}var _=p?p.contentWindow:window,v=this._callMachineTargetOrigin(p);v&&_.postMessage(h,v)}},{key:"sendMessageToDailyJs",value:function(a,s){a.what=Xc,a.callClientId=s,a.from="embedded",window.postMessage(a,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(a){var s=this._wrappedListeners[a];s&&(window.removeEventListener("message",s),delete this._wrappedListeners[a])}},{key:"forwardPackagedMessageToCallMachine",value:function(a,s,c){var p=eu({},a);p.callClientId=c;var h=s?s.contentWindow:window,f=this._callMachineTargetOrigin(s);f&&h.postMessage(p,f)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(a,s){var c=function(p){if(p.data&&p.data.what==="iframe-call-message"&&(!p.data.callClientId||p.data.callClientId===s)&&(!p.data.from||p.data.from!=="module")){var h=p.data;a(h)}};return this._wrappedListeners[a]=c,window.addEventListener("message",c),a}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(a){var s=this._wrappedListeners[a];s&&(window.removeEventListener("message",s),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 Om(r,t){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),i.push.apply(i,a)}return i}function nw(r){var t=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=mn(r);if(t){var s=mn(this).constructor;i=Reflect.construct(a,arguments,s)}else i=a.apply(this,arguments);return Js(this,i)}}var rw=function(r){Ws(i,Gv);var t=nw(i);function i(){var a;return vn(this,i),a=t.call(this),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new Un.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new Un.EventEmitter,a._wrappedListeners={},a._messageCallbacks={},a}return gn(i,[{key:"addListenerForMessagesFromCallMachine",value:function(a,s,c){this._addListener(a,global.callMachineToDailyJsEmitter,s,c,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(a,s,c){this._addListener(a,global.dailyJsToCallMachineEmitter,s,c,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(a,s,c){this._sendMessage(a,global.dailyJsToCallMachineEmitter,c,s,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(a,s){this._sendMessage(a,global.callMachineToDailyJsEmitter,s,null,"sending message to daily-js")}},{key:"removeListener",value:function(a){var s=this._wrappedListeners[a];s&&(global.callMachineToDailyJsEmitter.removeListener("message",s),global.dailyJsToCallMachineEmitter.removeListener("message",s),delete this._wrappedListeners[a])}},{key:"_addListener",value:function(a,s,c,p,h){var f=this,_=function(v){if(v.callClientId===c){if(v.callbackStamp&&f._messageCallbacks[v.callbackStamp]){var S=v.callbackStamp;f._messageCallbacks[S].call(p,v),delete f._messageCallbacks[S]}a.call(p,v)}};this._wrappedListeners[a]=_,s.addListener("message",_)}},{key:"_sendMessage",value:function(a,s,c,p,h){var f=function(v){for(var S=1;S0&&arguments[0]!==void 0?arguments[0]:{},i=t.data,a=t.mergeStrategy,s=a===void 0?Iu:a;vn(this,r),r._validateMergeStrategy(s),r._validateData(i,s),this.mergeStrategy=s,this.data=i}return gn(r,[{key:"isNoOp",value:function(){return r.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(t,i){return Object.keys(t).length===0&&i===ju}},{key:"_validateMergeStrategy",value:function(t){if(!xm.includes(t))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(xm,"]"))}},{key:"_validateData",value:function(t,i){if(!function(h){if(h==null||Ue(h)!=="object")return!1;var f=Object.getPrototypeOf(h);return f==null||f===Object.prototype}(t))throw Error("Meeting session data must be a plain (map-like) object");var a;try{if(a=JSON.stringify(t),i===Iu){var s=JSON.parse(a);Nt(s,t)||console.warn("The meeting session data provided will be modified when serialized.",s,t)}else if(i===ju){for(var c in t)if(Object.hasOwnProperty.call(t,c)&&t[c]!==void 0){var p=JSON.parse(JSON.stringify(t[c]));Nt(t[c],p)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",p,t[c])}}}catch(h){throw Error("Meeting session data must be serializable to JSON: ".concat(h))}if(a.length>Sm)throw Error("Meeting session data is too large (".concat(a.length," characters). Maximum size suppported is ").concat(Sm,"."))}}]),r}();function Ru(r,t,i){return Ru=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,s,c){var p=[null];p.push.apply(p,s);var h=new(Function.bind.apply(a,p));return c&&$o(h,c.prototype),h},Ru.apply(null,arguments)}function Nu(r){var t=typeof Map=="function"?new Map:void 0;return Nu=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(t!==void 0){if(t.has(i))return t.get(i);t.set(i,s)}function s(){return Ru(i,arguments,mn(this).constructor)}return s.prototype=Object.create(i.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),$o(s,i)},Nu(r)}function ow(r){var t=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=mn(r);if(t){var s=mn(this).constructor;i=Reflect.construct(a,arguments,s)}else i=a.apply(this,arguments);return Js(this,i)}}function Lm(r){var t,i=(t=window._daily)===null||t===void 0?void 0:t.pendings;if(i){var a=i.indexOf(r);a!==-1&&i.splice(a,1)}}var aw=function(){function r(t){vn(this,r),this._currentLoad=null,this._callClientId=t}return gn(r,[{key:"load",value:function(){var t,i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=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 s(!0);t=this._callClientId,window._daily.pendings.push(t),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new sw(a,function(){s(!1)},function(p,h){h||Lm(i._callClientId),c(p,h)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),Lm(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),r}(),sw=function(){function r(){var t=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;vn(this,r),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=t,this._successCallback=i,this._failureCallback=a}return gn(r,[{key:"start",value:function(){var t=this;this._currentAttempt||(this._currentAttempt=new Am(this._dailyConfig,this._successCallback,function i(a){t._currentAttempt.cancelled||(t._attemptsRemaining--,t._failureCallback(a,t._attemptsRemaining>0),t._attemptsRemaining<=0||setTimeout(function(){t._currentAttempt.cancelled||(t._currentAttempt=new Am(t._dailyConfig,t._successCallback,i),t._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}(),tu=function(r){Ws(i,Nu(Error));var t=ow(i);function i(){return vn(this,i),t.apply(this,arguments)}return gn(i)}(),Bs=2e4,Am=function(){function r(i,a,s){vn(this,r),this._loadAttemptImpl=Re()||!i.avoidEval?new lw(i,a,s):new cw(i,a,s)}var t;return gn(r,[{key:"start",value:(t=ke(function*(){return this._loadAttemptImpl.start()}),function(){return t.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]),r}(),lw=function(){function r(c,p,h){vn(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=h}var t,i,a,s;return gn(r,[{key:"start",value:(s=ke(function*(){var c=Ls(this._dailyConfig);!(yield this._tryLoadFromIOSCache(c))&&this._loadFromNetwork(c)}),function(){return s.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(a=ke(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=ke(function*(c){var p=this;this._networkTimeout=setTimeout(function(){p._networkTimedOut=!0,p._failureCallback({msg:"Timed out (>".concat(Bs," ms) when loading call object bundle ").concat(c),type:"timeout"})},Bs);try{var h=this._refetchHeaders?{headers:this._refetchHeaders}:{},f=yield fetch(c,h);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new tu;var _=yield this._getBundleCodeFromResponse(c,f);if(this.cancelled)throw new tu;Function('"use strict";'+_)(),this._iosCache&&this._iosCache.set(c,_,f.headers),this.succeeded=!0,this._successCallback()}catch(v){if(clearTimeout(this._networkTimeout),v instanceof tu||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(c,": ").concat(v),type:v.message})}}),function(c){return i.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(t=ke(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 t.apply(this,arguments)})}]),r}(),cw=function(){function r(t,i,a){vn(this,r),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=t,this._successCallback=i,this._failureCallback=a,this._attemptId=Gs(),this._networkTimeout=null,this._scriptElement=null}return gn(r,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var t=Ls(this._dailyConfig);(typeof document>"u"?"undefined":Ue(document))==="object"?this._startLoading(t):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(t){var i=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){i._stopLoading(),i._failureCallback({msg:"Timed out (>".concat(Bs," ms) when loading call object bundle ").concat(t),type:"timeout"})},Bs);var a=document.getElementsByTagName("head")[0],s=document.createElement("script");this._scriptElement=s,s.onload=function(){i._stopLoading(),i.succeeded=!0,i._successCallback()},s.onerror=function(c){i._stopLoading(),i._failureCallback({msg:"Failed to load call object bundle ".concat(c.target.src),type:c.message})},s.src=t,a.appendChild(s)}},{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}(),_s=function(r,t,i){return dw(r.local,t,i)===!0},uw=function(r,t,i){return r.local.streams&&r.local.streams[t]&&r.local.streams[t].stream&&r.local.streams[t].stream["get".concat(i==="video"?"Video":"Audio","Tracks")]()[0]},Oi=function(r,t,i,a){var s=fw(r,t,i,a);return s&&s.pendingTrack},dw=function(r,t,i){if(!r)return!1;var a=function(c){switch(c){case"avatar":return!0;case"staged":return c;default:return!!c}},s=r.public.subscribedTracks;return s&&s[t]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(i)===-1&&s[t].custom?[!0,"staged"].includes(s[t].custom)?a(s[t].custom):a(s[t].custom[i]):a(s[t][i]):!s||a(s.ALL)},fw=function(r,t,i,a){var s=Object.values(r.streams||{}).filter(function(c){return c.participantId===t&&c.type===i&&c.pendingTrack&&c.pendingTrack.kind===a}).sort(function(c,p){return new Date(p.starttime)-new Date(c.starttime)});return s&&s[0]},pw=function(r,t){var i=r.local.public.customTracks;if(i&&i[t])return i[t].track};function Dm(r,t){for(var i=t.getState(),a=0,s=["cam","screen"];a=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(f){throw f},f:s}}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,h=!1;return{s:function(){i=i.call(r)},n:function(){var f=i.next();return p=f.done,f},e:function(f){h=!0,c=f},f:function(){try{p||i.return==null||i.return()}finally{if(h)throw c}}}}function Rm(r,t){(t==null||t>r.length)&&(t=r.length);for(var i=0,a=new Array(t);i=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(f){throw f},f:s}}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,h=!1;return{s:function(){i=i.call(r)},n:function(){var f=i.next();return p=f.done,f},e:function(f){h=!0,c=f},f:function(){try{p||i.return==null||i.return()}finally{if(h)throw c}}}}function Nm(r,t){(t==null||t>r.length)&&(t=r.length);for(var i=0,a=new Array(t);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=mn(r);if(t){var s=mn(this).constructor;i=Reflect.construct(a,arguments,s)}else i=a.apply(this,arguments);return Js(this,i)}}function Fm(r,t){var i=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function(f,_){if(f){if(typeof f=="string")return Um(f,_);var v=Object.prototype.toString.call(f).slice(8,-1);if(v==="Object"&&f.constructor&&(v=f.constructor.name),v==="Map"||v==="Set")return Array.from(f);if(v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v))return Um(f,_)}}(r))||t){i&&(r=i);var a=0,s=function(){};return{s,n:function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(f){throw f},f:s}}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,h=!1;return{s:function(){i=i.call(r)},n:function(){var f=i.next();return p=f.done,f},e:function(f){h=!0,c=f},f:function(){try{p||i.return==null||i.return()}finally{if(h)throw c}}}}function Um(r,t){(t==null||t>r.length)&&(t=r.length);for(var i=0,a=new Array(t);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 t){if(!Number.isInteger(t.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(t.minTilesPerPage,".")),!1;if(t.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in t&&t.minTilesPerPage>t.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 Kv(r,{allowAllParticipantsKey:!1})},help:eg({allowAllParticipantsKey:!1})},sendSettings:{validate:function(r,t){return!!function(i,a){try{return a.validateUpdateSendSettings(i),!0}catch(s){return console.error("Failed to validate send settings",s),!1}}(r,t)&&(t._preloadCache.sendSettings=r,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(r,t){var i;return!!Xv(r)&&(t._preloadCache.inputSettings||(t._preloadCache.inputSettings={}),Zv(r,(i=t.properties)===null||i===void 0?void 0:i.dailyConfig),r.audio&&(t._preloadCache.inputSettings.audio=r.audio),r.video&&(t._preloadCache.inputSettings.video=r.video),!0)},help:Fu()},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},Ss={styles:{validate:function(r){for(var t in r)if(t!=="cam"&&t!=="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,t){if(t._preloadCache.subscribeToTracksAutomatically)return!1;var i=[!0,!1,"staged"];if(i.includes(r)||!Re()&&r==="avatar")return!0;var a=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function s(c){var p=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var h in c)if(h==="custom"){if(!i.includes(c[h])&&!s(c[h],!0))return!1}else{var f=!p&&!a.includes(h),_=!i.includes(c[h]);if(f||_)return!1}return!0}(r)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(Re()?"":" | '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 t=0,i=Object.entries(r);t1&&arguments[1]!==void 0?arguments[1]:{};if(vn(this,he),Fn(Rn(y=me.call(this)),"startListeningForDeviceChanges",function(){yw(y.handleDeviceChange)}),Fn(Rn(y),"stopListeningForDeviceChanges",function(){_w(y.handleDeviceChange)}),Fn(Rn(y),"handleDeviceChange",function(oe){oe=oe.map(function(fe){return JSON.parse(JSON.stringify(fe))}),y.emitDailyJSEvent({action:"available-devices-updated",availableDevices:oe})}),Fn(Rn(y),"handleNativeAppStateChange",function(){var oe=ke(function*(fe){if(fe==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield y.destroy());var Me=fe==="active";y.disableReactNativeAutoDeviceManagement("video")||(Me?y.camUnmutedBeforeLosingNativeActiveState&&y.setLocalVideo(!0):(y.camUnmutedBeforeLosingNativeActiveState=y.localVideo(),y.camUnmutedBeforeLosingNativeActiveState&&y.setLocalVideo(!1)))});return function(fe){return oe.apply(this,arguments)}}()),Fn(Rn(y),"handleNativeAudioFocusChange",function(oe){y.disableReactNativeAutoDeviceManagement("audio")||(y._hasNativeAudioFocus=oe,y.toggleParticipantAudioBasedOnNativeAudioFocus(),y._hasNativeAudioFocus?y.micUnmutedBeforeLosingNativeAudioFocus&&y.setLocalAudio(!0):(y.micUnmutedBeforeLosingNativeAudioFocus=y.localAudio(),y.setLocalAudio(!1)))}),Fn(Rn(y),"handleNativeSystemScreenCaptureStop",function(){y.stopScreenShare()}),y.strictMode=k.strictMode===void 0||k.strictMode,y.allowMultipleCallInstances=(g=k.allowMultipleCallInstances)!==null&&g!==void 0&&g,Object.keys(jr).length&&(y._logDuplicateInstanceAttempt(),!y.allowMultipleCallInstances)){if(y.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:{}}),y.callClientId=Gs(),C=Rn(y),jr[C.callClientId]=C,window._daily.instances[y.callClientId]={},y._sharedTracks={},window._daily.instances[y.callClientId].tracks=y._sharedTracks,k.dailyJsVersion=he.version(),y._iframe=d,y._callObjectMode=k.layout==="none"&&!y._iframe,y._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},k.showLocalVideo!==void 0?y._callObjectMode?console.error("showLocalVideo is not available in call object mode"):y._showLocalVideo=!!k.showLocalVideo:y._showLocalVideo=!0,k.showParticipantsBar!==void 0?y._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):y._showParticipantsBar=!!k.showParticipantsBar:y._showParticipantsBar=!0,k.customIntegrations!==void 0?y._callObjectMode?console.error("customIntegrations is not available in call object mode"):y._customIntegrations=k.customIntegrations:y._customIntegrations={},k.customTrayButtons!==void 0?y._callObjectMode?console.error("customTrayButtons is not available in call object mode"):y._customTrayButtons=k.customTrayButtons:y._customTrayButtons={},k.activeSpeakerMode!==void 0?y._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):y._activeSpeakerMode=!!k.activeSpeakerMode:y._activeSpeakerMode=!1,k.receiveSettings?y._callObjectMode?y._receiveSettings=k.receiveSettings:console.error("receiveSettings is only available in call object mode"):y._receiveSettings={},y.validateProperties(k),y.properties=be({},k),y._preloadCache.inputSettings||(y._preloadCache.inputSettings={}),k.inputSettings&&k.inputSettings.audio&&(y._preloadCache.inputSettings.audio=k.inputSettings.audio),k.inputSettings&&k.inputSettings.video&&(y._preloadCache.inputSettings.video=k.inputSettings.video),y._callObjectLoader=y._callObjectMode?new aw(y.callClientId):null,y._callState=fm,y._isPreparingToJoin=!1,y._accessState={access:Qc},y._meetingSessionSummary={},y._finalSummaryOfPrevSession={},y._meetingSessionState=ou(zm,y._callObjectMode),y._nativeInCallAudioMode=$m,y._participants={},y._isScreenSharing=!1,y._participantCounts=Vm,y._rmpPlayerState={},y._waitingParticipants={},y._network={threshold:"good",quality:100},y._activeSpeaker={},y._localAudioLevel=0,y._isLocalAudioLevelObserverRunning=!1,y._remoteParticipantsAudioLevel={},y._isRemoteParticipantsAudioLevelObserverRunning=!1,y._maxAppMessageSize=Kc,y._messageChannel=Re()?new rw:new tw,y._iframe&&(y._iframe.requestFullscreen?y._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===y._iframe?(y.emitDailyJSEvent({action:vs}),y.sendMessageToCallMachine({action:vs})):(y.emitDailyJSEvent({action:gs}),y.sendMessageToCallMachine({action:gs}))}):y._iframe.webkitRequestFullscreen&&y._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===y._iframe?(y.emitDailyJSEvent({action:vs}),y.sendMessageToCallMachine({action:vs})):(y.emitDailyJSEvent({action:gs}),y.sendMessageToCallMachine({action:gs}))})),Re()){var V=y.nativeUtils();V.addAudioFocusChangeListener&&V.removeAudioFocusChangeListener&&V.addAppStateChangeListener&&V.removeAppStateChangeListener&&V.addSystemScreenCaptureStopListener&&V.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),y._hasNativeAudioFocus=!0,V.addAudioFocusChangeListener(y.handleNativeAudioFocusChange),V.addAppStateChangeListener(y.handleNativeAppStateChange),V.addSystemScreenCaptureStopListener(y.handleNativeSystemScreenCaptureStop)}return y._callObjectMode&&y.startListeningForDeviceChanges(),y._messageChannel.addListenerForMessagesFromCallMachine(y.handleMessageFromCallMachine,y.callClientId,Rn(y)),y}return gn(he,[{key:"destroy",value:(J=ke(function*(){var d,g;try{yield this.leave()}catch{}var y=this._iframe;if(y){var C=y.parentElement;C&&C.removeChild(y)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),Re()){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 jr[this.callClientId],!((d=window)===null||d===void 0||(g=d._daily)===null||g===void 0)&&g.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return J.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(d){var g=d.bodyClass,y=d.cssFile,C=d.cssText;return Le(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(y),bodyClass:g,cssText:C}),this}},{key:"iframe",value:function(){return Le(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return dn(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return dn(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(d,g){for(var y in g){if(!Ss[y])throw new Error("unrecognized updateParticipant property ".concat(y));if(Ss[y].validate&&!Ss[y].validate(g[y],this,this._participants[d]))throw new Error(Ss[y].help)}}},{key:"updateParticipant",value:function(d,g){return this._participants.local&&this._participants.local.session_id===d&&(d="local"),d&&g&&(this.validateParticipantProperties(d,g),this.sendMessageToCallMachine({action:"update-participant",id:d,properties:g})),this}},{key:"updateParticipants",value:function(d){var g=this._participants.local&&this._participants.local.session_id;for(var y in d)y===g&&(y="local"),y&&d[y]&&this.validateParticipantProperties(y,d[y]);return this.sendMessageToCallMachine({action:"update-participants",participants:d}),this}},{key:"updateWaitingParticipant",value:(I=ke(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(dn(this._callObjectMode,"updateWaitingParticipant()"),ze(this._callState,"updateWaitingParticipant()"),typeof g!="string"||Ue(y)!=="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:g,updates:y},function(V){V.error&&k(V.error),V.id||k(new Error("unknown error in updateWaitingParticipant()")),C({id:V.id})})})}),function(){return I.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(Q=ke(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dn(this._callObjectMode,"updateWaitingParticipants()"),ze(this._callState,"updateWaitingParticipants()"),Ue(g)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(y,C){d.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:g},function(k){k.error&&C(k.error),k.ids||C(new Error("unknown error in updateWaitingParticipants()")),y({ids:k.ids})})})}),function(){return Q.apply(this,arguments)})},{key:"requestAccess",value:(ie=ke(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},y=g.access,C=y===void 0?{level:K0}:y,k=g.name,V=k===void 0?"":k;return dn(this._callObjectMode,"requestAccess()"),ze(this._callState,"requestAccess()"),new Promise(function(oe,fe){d.sendMessageToCallMachine({action:"daily-method-request-access",access:C,name:V},function(Me){Me.error&&fe(Me.error),Me.access||fe(new Error("unknown error in requestAccess()")),oe({access:Me.access,granted:Me.granted})})})}),function(){return ie.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 g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in g&&(Re()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),g={}):d&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),g={})),this.sendMessageToCallMachine({action:"local-audio",state:d,options:g}),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=ke(function*(d){var g=this,y=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,C=y!==void 0&&y;if(dn(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(Ue(d)){case"string":return new Promise(function(k){g.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:d,showInheritedValues:C},function(V){k(V.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:(ve=ke(function*(d){var g=this;if(dn(this._callObjectMode,"updateReceiveSettings()"),!Kv(d,{allowAllParticipantsKey:!0}))throw new Error(eg({allowAllParticipantsKey:!0}));return ze(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(y){g.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:d},function(C){y({receiveSettings:C.receiveSettings})})})}),function(d){return ve.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(d){var g,y,C,k,V,oe,fe,Me;if(d){var tt={},Je=((g=d.audio)===null||g===void 0||(y=g.processor)===null||y===void 0?void 0:y.type)==="none"&&((C=d.audio)===null||C===void 0||(k=C.processor)===null||k===void 0?void 0:k._isDefaultWhenNone);if(d.audio&&!Je){var qt=be({},d.audio.processor);delete qt._isDefaultWhenNone,tt.audio=be(be({},d.audio),{},{processor:qt})}var Wt=((V=d.video)===null||V===void 0||(oe=V.processor)===null||oe===void 0?void 0:oe.type)==="none"&&((fe=d.video)===null||fe===void 0||(Me=fe.processor)===null||Me===void 0?void 0:Me._isDefaultWhenNone);if(d.video&&!Wt){var Jt=be({},d.video.processor);delete Jt._isDefaultWhenNone,tt.video=be(be({},d.video),{},{processor:Jt})}return tt}}},{key:"getInputSettings",value:function(){var d=this;return Le(),new Promise(function(g){g(d._getInputSettings())})}},{key:"_getInputSettings",value:function(){var d,g,y,C,k,V,oe,fe,Me={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(d=((y=this._inputSettings)===null||y===void 0?void 0:y.video)||Me,g=((C=this._inputSettings)===null||C===void 0?void 0:C.audio)||Me):(d=((k=this._preloadCache)===null||k===void 0||(V=k.inputSettings)===null||V===void 0?void 0:V.video)||Me,g=((oe=this._preloadCache)===null||oe===void 0||(fe=oe.inputSettings)===null||fe===void 0?void 0:fe.audio)||Me);var tt={audio:g,video:d};return this._prepInputSettingsToPresentToUser(tt)}},{key:"updateInputSettings",value:(Oe=ke(function*(d){var g=this;return Le(),Xv(d)?(d&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),Zv(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(y,C){g.sendMessageToCallMachine({action:"update-input-settings",inputSettings:d},function(k){k.error?C(k.error):y({inputSettings:g._prepInputSettingsToPresentToUser(k.inputSettings)})})}):this._getInputSettings()):(console.error(Fu()),Promise.reject(Fu()))}),function(d){return Oe.apply(this,arguments)})},{key:"setBandwidth",value:function(d){var g=d.kbs,y=d.trackConstraints;if(Le(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:g,trackConstraints:y}),this}},{key:"getDailyLang",value:function(){var d=this;if(Le(),this._callMachineInitialized)return new Promise(function(g){d.sendMessageToCallMachine({action:"get-daily-lang"},function(y){delete y.action,delete y.callbackStamp,g(y)})})}},{key:"setDailyLang",value:function(d){return Le(),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[Ir,cr].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Se=ke(function*(){var d=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),ze(this._callState,"getMeetingSession()"),new Promise(function(g){d.sendMessageToCallMachine({action:"get-meeting-session"},function(y){delete y.action,delete y.callbackStamp,g(y)})})}),function(){return Se.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return ze(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";dn(this._callObjectMode,"setMeetingSessionData()"),ze(this._callState,"setMeetingSessionData");try{(function(y,C){new iw({data:y,mergeStrategy:C})})(d,g)}catch(y){throw console.error(y),y}try{this.sendMessageToCallMachine({action:"set-session-data",data:d,mergeStrategy:g})}catch(y){throw new Error("Error setting meeting session data: ".concat(y))}}},{key:"setUserName",value:function(d,g){var y=this;return this.properties.userName=d,new Promise(function(C){y.sendMessageToCallMachine({action:"set-user-name",name:d??"",thisMeetingOnly:Re()||!!g&&!!g.thisMeetingOnly},function(k){delete k.action,delete k.callbackStamp,C(k)})})}},{key:"setUserData",value:(de=ke(function*(d){var g=this;try{Qv(d)}catch(y){throw console.error(y),y}if(this.properties.userData=d,this._callMachineInitialized)return new Promise(function(y){try{g.sendMessageToCallMachine({action:"set-user-data",userData:d},function(C){delete C.action,delete C.callbackStamp,y(C)})}catch(C){throw new Error("Error setting user data: ".concat(C))}})}),function(d){return de.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 g=this;if(typeof AudioWorkletNode>"u"&&!Re())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(d),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(y,C){g.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:d},function(k){g._isLocalAudioLevelObserverRunning=!k.error,k.error?C({error:k.error}):y()})});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 g=this;if(this.validateAudioLevelInterval(d),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(y,C){g.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:d},function(k){g._isRemoteParticipantsAudioLevelObserverRunning=!k.error,k.error?C({error:k.error}):y()})});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:(G=ke(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dn(this._callObjectMode,"startCamera()"),ru(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(g)}catch(y){return Promise.reject(y)}else{if(this._didPreAuth){if(g.url&&g.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(g.token&&g.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(g),this.properties=be(be({},this.properties),g)}return new Promise(function(y){d.sendMessageToCallMachine({action:"start-camera",properties:bi(d.properties,d.callClientId),preloadCache:bi(d._preloadCache,d.callClientId)},function(C){delete C.action,delete C.callbackStamp,y(C)})})}),function(){return G.apply(this,arguments)})},{key:"validateCustomTrack",value:function(d,g,y){if(y&&y.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(g&&g!=="music"&&g!=="speech"&&!(g instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(y&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(y))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,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return Le(),ze(this._callState,"startCustomTrack()"),this.validateCustomTrack(g.track,g.mode,g.trackName),new Promise(function(y,C){d._sharedTracks.customTrack=g.track,g.track=Io,d.sendMessageToCallMachine({action:"start-custom-track",properties:g},function(k){k.error?C({error:k.error}):y(k.mediaTag)})})}},{key:"stopCustomTrack",value:function(d){var g=this;return Le(),ze(this._callState,"stopCustomTrack()"),new Promise(function(y){g.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:d},function(C){y(C.mediaTag)})})}},{key:"setCamera",value:function(d){var g=this;return Lo(),ws(this._callMachineInitialized,"setCamera()"),new Promise(function(y){g.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:d},function(C){y({device:C.device})})})}},{key:"setAudioDevice",value:(re=ke(function*(d){return Lo(),this.nativeUtils().setAudioDevice(d),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(d){return re.apply(this,arguments)})},{key:"cycleCamera",value:function(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(y){d.sendMessageToCallMachine({action:"cycle-camera",properties:g},function(C){y({device:C.device})})})}},{key:"cycleMic",value:function(){var d=this;return Le(),new Promise(function(g){d.sendMessageToCallMachine({action:"cycle-mic"},function(y){g({device:y.device})})})}},{key:"getCameraFacingMode",value:function(){var d=this;return Lo(),new Promise(function(g){d.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(y){g(y.facingMode)})})}},{key:"setInputDevicesAsync",value:(ae=ke(function*(d){var g=this,y=d.audioDeviceId,C=d.videoDeviceId,k=d.audioSource,V=d.videoSource;return Le(),k!==void 0&&(y=k),V!==void 0&&(C=V),y&&(this._preloadCache.audioDeviceId=y,this._sharedTracks.audioDeviceId=y),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}}:(y instanceof MediaStreamTrack&&(y=Io),C instanceof MediaStreamTrack&&(C=Io),new Promise(function(oe){g.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:y,videoDeviceId:C},function(fe){delete fe.action,delete fe.callbackStamp,fe.returnPreloadCache?oe({camera:{deviceId:g._preloadCache.videoDeviceId},mic:{deviceId:g._preloadCache.audioDeviceId},speaker:{deviceId:g._preloadCache.outputDeviceId}}):oe(fe)})}))}),function(d){return ae.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(z=ke(function*(d){var g=this,y=d.outputDeviceId;return Le(),y&&(this._preloadCache.outputDeviceId=y),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(C){g.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:y},function(k){delete k.action,delete k.callbackStamp,k.returnPreloadCache?C({camera:{deviceId:g._preloadCache.videoDeviceId},mic:{deviceId:g._preloadCache.audioDeviceId},speaker:{deviceId:g._preloadCache.outputDeviceId}}):C(k)})})}),function(d){return z.apply(this,arguments)})},{key:"getInputDevices",value:(q=ke(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(g){d.sendMessageToCallMachine({action:"get-input-devices"},function(y){delete y.action,delete y.callbackStamp,y.returnPreloadCache?g({camera:{deviceId:d._preloadCache.videoDeviceId},mic:{deviceId:d._preloadCache.audioDeviceId},speaker:{deviceId:d._preloadCache.outputDeviceId}}):g(y)})})}),function(){return q.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return Lo(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(d){if(Lo(),[$m,Ew].includes(d)){if(d!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=d,!this.disableReactNativeAutoDeviceManagement("audio")&&Ms(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",d)}},{key:"preAuth",value:(R=ke(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dn(this._callObjectMode,"preAuth()"),ru(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(g)),!g.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(g),this.properties=be(be({},this.properties),g),new Promise(function(y,C){d.sendMessageToCallMachine({action:"daily-method-preauth",properties:bi(d.properties,d.callClientId),preloadCache:bi(d._preloadCache,d.callClientId)},function(k){return k.error?C(k.error):k.access?(d._didPreAuth=!0,void y({access:k.access})):C(new Error("unknown error in preAuth()"))})})}),function(){return R.apply(this,arguments)})},{key:"load",value:(x=ke(function*(d){var g=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(d&&(this.validateProperties(d),this.properties=be(be({},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(pm),this.emitDailyJSEvent({action:rS}),this._callObjectMode?new Promise(function(y,C){g._callObjectLoader.cancel();var k=Date.now();g._callObjectLoader.load(g.properties.dailyConfig,function(V){g._bundleLoadTime=V?"no-op":Date.now()-k,g._updateCallState(hm),V&&g.emitDailyJSEvent({action:mm}),y()},function(V,oe){if(g.emitDailyJSEvent({action:iS}),!oe){g._updateCallState(cr),g.resetMeetingDependentVars();var fe={action:_m,errorMsg:V.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:V,bundleUrl:Ls(g.properties.dailyConfig)}}};g._maybeSendToSentry(fe),g.emitDailyJSEvent(fe),C(V.msg)}})}):(this._iframe.src=yv(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(y,C){g._loadedCallback=function(k){g._callState!==cr?(g._updateCallState(hm),(g.properties.cssFile||g.properties.cssText)&&g.loadCss(g.properties),y()):C(k)}}))}}),function(d){return x.apply(this,arguments)})},{key:"join",value:(T=ke(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var y=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(g)}catch(C){return this.updateIsPreparingToJoin(!1),Promise.reject(C)}}else{if(y=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(g.url&&g.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(g.token&&g.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(g.url&&!this._callObjectMode&&g.url&&g.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(g.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(g),this.properties=be(be({},this.properties),g)}return g.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!g.showLocalVideo),g.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!g.showParticipantsBar),this._callState===Pi||this._callState===Au?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Au,!1),this.emitDailyJSEvent({action:sS}),this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),g.inputSettings&&g.inputSettings.audio&&(this._preloadCache.inputSettings.audio=g.inputSettings.audio),g.inputSettings&&g.inputSettings.video&&(this._preloadCache.inputSettings.video=g.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:bi(this.properties,this.callClientId),preloadCache:bi(this._preloadCache,this.callClientId)}),new Promise(function(C,k){d._joinedCallback=function(V,oe){if(d._callState!==cr){if(d._updateCallState(Pi),V)for(var fe in V){if(d._callObjectMode){var Me=d._callMachine().store;Dm(V[fe],Me),Im(V[fe],Me),jm(V[fe],d._participants[fe],Me)}d._participants[fe]=be({},V[fe]),d.toggleParticipantAudioBasedOnNativeAudioFocus()}y&&d.loadCss(d.properties),C(V)}else k(oe)}}))}),function(){return T.apply(this,arguments)})},{key:"leave",value:(P=ke(function*(){var d=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(g){d._callState===Ir||d._callState===cr?g():d._callObjectLoader&&!d._callObjectLoader.loaded?(d._callObjectLoader.cancel(),d._updateCallState(Ir),d.resetMeetingDependentVars(),d.emitDailyJSEvent({action:Ir}),g()):(d._resolveLeave=g,d.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return P.apply(this,arguments)})},{key:"startScreenShare",value:(j=ke(function*(){var d=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ws(this._callMachineInitialized,"startScreenShare()"),g.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",g.screenVideoSendSettings),g.mediaStream&&(this._sharedTracks.screenMediaStream=g.mediaStream,g.mediaStream=Io),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var y=this.nativeUtils();if(yield y.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:ym,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});y.setSystemScreenCaptureStartCallback(function(){y.setSystemScreenCaptureStartCallback(null),d.sendMessageToCallMachine({action:wm,captureOptions:g})}),y.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:wm,captureOptions:g})}),function(){return j.apply(this,arguments)})},{key:"stopScreenShare",value:function(){ws(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(be({action:"local-recording-start"},d))}},{key:"updateRecording",value:function(d){var g=d.layout,y=g===void 0?{preset:"default"}:g,C=d.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:y,instanceId:C})}},{key:"stopRecording",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(be({action:"local-recording-stop"},d))}},{key:"startLiveStreaming",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(be({action:"daily-method-start-live-streaming"},d))}},{key:"updateLiveStreaming",value:function(d){var g=d.layout,y=g===void 0?{preset:"default"}:g,C=d.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:y,instanceId:C})}},{key:"addLiveStreamingEndpoints",value:function(d){var g=d.endpoints,y=d.instanceId;this.sendMessageToCallMachine({action:km,endpointsOp:QS,endpoints:g,instanceId:y})}},{key:"removeLiveStreamingEndpoints",value:function(d){var g=d.endpoints,y=d.instanceId;this.sendMessageToCallMachine({action:km,endpointsOp:KS,endpoints:g,instanceId:y})}},{key:"stopLiveStreaming",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(be({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."),qv()&&d.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,y=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(!Hm(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){g.sendMessageToCallMachine(be({action:"dialout-start"},d),function(V){V.error?k(V.error):C(V)})})}),function(d){return B.apply(this,arguments)})},{key:"stopDialOut",value:function(d){var g=this;return ze(this._callState,"stopDialOut()"),new Promise(function(y,C){g.sendMessageToCallMachine(be({action:"dialout-stop"},d),function(k){k.error?C(k.error):y(k)})})}},{key:"sipCallTransfer",value:(L=ke(function*(d){var g=this;if(ze(this._callState,"sipCallTransfer()"),!d)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return d.useSipRefer=!1,Jm(d,"sipCallTransfer"),new Promise(function(y,C){g.sendMessageToCallMachine(be({action:Cm},d),function(k){k.error?C(k.error):y(k)})})}),function(d){return L.apply(this,arguments)})},{key:"sipRefer",value:(D=ke(function*(d){var g=this;if(ze(this._callState,"sipRefer()"),!d)throw new Error("sessionId and toEndPoint are mandatory parameter");return d.useSipRefer=!0,Jm(d,"sipRefer"),new Promise(function(y,C){g.sendMessageToCallMachine(be({action:Cm},d),function(k){k.error?C(k.error):y(k)})})}),function(d){return D.apply(this,arguments)})},{key:"sendDTMF",value:(M=ke(function*(d){var g=this;return ze(this._callState,"sendDTMF()"),function(y){var C=y.sessionId,k=y.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 V=/[^0-9A-D*#]/g,oe=k.match(V);if(oe&&oe[0])throw new Error("".concat(oe[0]," is not valid DTMF tone"))}(d),new Promise(function(y,C){g.sendMessageToCallMachine(be({action:"send-dtmf"},d),function(k){k.error?C(k.error):y(k)})})}),function(d){return M.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var d=this;return this._callState!==Pi?{stats:{latest:{}}}:new Promise(function(g){d.sendMessageToCallMachine({action:"get-calc-stats"},function(y){g(be({stats:y.stats},d._network))})})}},{key:"testWebsocketConnectivity",value:(E=ke(function*(){var d=this;if(iu(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(g){return Promise.reject(g)}return new Promise(function(g,y){d.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(C){C.error?y(C.error):g(C.results)})})}),function(){return E.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(d){return d?d instanceof MediaStreamTrack?!!ww(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=ke(function*(){var d=this;Le(),dn(this._callObjectMode,"testCallQuality()"),ws(this._callMachineInitialized,"testCallQuality()",null,!0),ru(this._callState,this._isPreparingToJoin,"testCallQuality()");var g=this._testCallAlreadyInProgress,y=function(k){g||(d._testCallInProgress=k)};if(y(!0),this.needsLoad())try{var C=this._callState;yield this.load(),this._callState=C}catch(k){return y(!1),Promise.reject(k)}return new Promise(function(k){d.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:d.properties.dailyJsVersion},function(V){var oe=V.results,fe=oe.result,Me=vh(oe,kw);if(fe==="failed"){var tt,Je=be({},Me);(tt=Me.error)!==null&&tt!==void 0&&tt.details?(Me.error.details=JSON.parse(Me.error.details),Je.error=be(be({},Je.error),{},{details:be({},Je.error.details)}),Je.error.details.duringTest="testCallQuality"):(Je.error=Je.error?be({},Je.error):{},Je.error.details={duringTest:"testCallQuality"}),d._maybeSendToSentry(Je)}y(!1),k(be({result:fe},Me))})})}),function(){return S.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(v=ke(function*(d){var g;Re()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),g=yield this.testPeerToPeerCallQuality(d)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),g=yield this.testCallQuality());var y={result:g.result,secondsElapsed:g.secondsElapsed};return g.data&&(y.data={maxRTT:g.data.maxRoundTripTime,packetLoss:g.data.avgRecvPacketLoss}),y}),function(d){return v.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(_=ke(function*(d){var g=this;if(iu(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(k){return Promise.reject(k)}var y=d.videoTrack,C=d.duration;if(!this._validateVideoTrackForNetworkTests(y))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=y,new Promise(function(k,V){g.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:C},function(oe){oe.error?V(oe.error):k(oe.results)})})}),function(d){return _.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){Re()?(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:(f=ke(function*(d){var g=this;if(iu(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(y){return Promise.reject(y)}if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=d,new Promise(function(y,C){g.sendMessageToCallMachine({action:"test-network-connectivity"},function(k){k.error?C(k.error):y(k.results)})})}),function(d){return f.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(g){d._callState===Pi?d.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(y){g(y.cpuStats)}):g({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(d){var g;if(!(((g=Object.keys(d))===null||g===void 0?void 0:g.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(nu))}},{key:"_validateVideoSendSettings",value:function(d,g){var y=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(y.join());if(typeof g=="string"){if(!y.includes(g))throw new Error(C)}else{if(Ue(g)!=="object")throw new Error(C);if(!g.maxQuality&&!g.encodings&&g.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(g.maxQuality&&["low","medium","high"].indexOf(g.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(g.encodings){var k=!1;switch(Object.keys(g.encodings).length){case 1:k=!g.encodings.low;break;case 2:k=!g.encodings.low||!g.encodings.medium;break;case 3:k=!g.encodings.low||!g.encodings.medium||!g.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.");g.encodings.low&&this._validateEncodingLayerHasValidProperties(g.encodings.low),g.encodings.medium&&this._validateEncodingLayerHasValidProperties(g.encodings.medium),g.encodings.high&&this._validateEncodingLayerHasValidProperties(g.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(d){var g=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(y){var C=Vr(y,2),k=C[0],V=C[1];g._validateVideoSendSettings(k,V)})}},{key:"updateSendSettings",value:function(d){var g=this;return this.validateUpdateSendSettings(d),this.needsLoad()?(this._preloadCache.sendSettings=d,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(y,C){g.sendMessageToCallMachine({action:"update-send-settings",sendSettings:d},function(k){k.error?C(k.error):y(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 Le(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(d){return Le(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:d}),this}},{key:"activeSpeakerMode",value:function(){return Le(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(d){return ze(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:(h=ke(function*(){var d=this;if(this._callObjectMode){var g=yield navigator.mediaDevices.enumerateDevices();return Gr()==="Firefox"&&Ns().major>115&&Ns().major<123&&(g=g.filter(function(y){return y.kind!=="audiooutput"})),{devices:g.map(function(y){var C=JSON.parse(JSON.stringify(y));if(!Re()&&y.kind==="videoinput"&&y.getCapabilities){var k,V=y.getCapabilities();C.facing=(V==null||(k=V.facingMode)===null||k===void 0?void 0:k.length)>=1?V.facingMode[0]:void 0}return C})}}return new Promise(function(y){d.sendMessageToCallMachine({action:"enumerate-devices"},function(C){y({devices:C.devices})})})}),function(){return h.apply(this,arguments)})},{key:"sendAppMessage",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(ze(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:g}),this}},{key:"addFakeParticipant",value:function(d){return Le(),ze(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(be({action:"add-fake-participant"},d)),this}},{key:"setShowNamesMode",value:function(d){return zt(this._callObjectMode,"setShowNamesMode()"),Le(),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 zt(this._callObjectMode,"setShowLocalVideo()"),Le(),ze(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 zt(this._callObjectMode,"showLocalVideo()"),Le(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var d=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return zt(this._callObjectMode,"setShowParticipantsBar()"),Le(),ze(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 zt(this._callObjectMode,"showParticipantsBar()"),Le(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return Le(),zt(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(d){return Le(),zt(this._callObjectMode,"setCustomIntegrations()"),ze(this._callState,"setCustomIntegrations()"),rg(d)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:d}),this._customIntegrations=d,this):this}},{key:"startCustomIntegrations",value:function(d){var g=this;if(Le(),zt(this._callObjectMode,"startCustomIntegrations()"),ze(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 y=typeof d=="string"?[d]:d,C=y.filter(function(k){return!(k in g._customIntegrations)});return C.length?(console.error(`Can't find custom integration(s): "`.concat(C.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:y}),this)}},{key:"stopCustomIntegrations",value:function(d){var g=this;if(Le(),zt(this._callObjectMode,"stopCustomIntegrations()"),ze(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 y=typeof d=="string"?[d]:d,C=y.filter(function(k){return!(k in g._customIntegrations)});return C.length?(console.error(`Can't find custom integration(s): "`.concat(C.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:y}),this)}},{key:"customTrayButtons",value:function(){return zt(this._callObjectMode,"customTrayButtons()"),Le(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(d){return zt(this._callObjectMode,"updateCustomTrayButtons()"),Le(),ze(this._callState,"updateCustomTrayButtons()"),ng(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(Fs))),this)}},{key:"theme",value:function(){return zt(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(d){var g=this;return zt(this._callObjectMode,"setTheme()"),new Promise(function(y,C){try{g.validateProperties({theme:d}),g.properties.theme=be({},d),g.sendMessageToCallMachine({action:"set-theme",theme:g.properties.theme});try{g.emitDailyJSEvent({action:nS,theme:g.properties.theme})}catch(k){console.log("could not emit 'theme-updated'",k)}y(g.properties.theme)}catch(k){C(k)}})}},{key:"requestFullscreen",value:(p=ke(function*(){if(Le(),this._iframe&&!document.fullscreenElement&&Em())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(){Le(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(c=ke(function*(){var d=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(g){d.sendMessageToCallMachine({action:"get-sidebar-view"},function(y){g(y.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:(s=ke(function*(){var d=this,g=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,y=g===void 0||g;return this._accessState.access===Qc||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(C){d.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:y},function(k){delete k.action,delete k.callbackStamp,C(k)})})}),function(){return s.apply(this,arguments)})},{key:"geo",value:(a=ke(function*(){try{var d=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield d.json()).geo}}catch(g){return console.error("geo lookup failed",g),{current:""}}}),function(){return a.apply(this,arguments)})},{key:"setNetworkTopology",value:(i=ke(function*(d){var g=this;return Le(),ze(this._callState,"setNetworkTopology()"),new Promise(function(y,C){g.sendMessageToCallMachine({action:"set-network-topology",opts:d},function(k){k.error?C({error:k.error}):y({workerId:k.workerId})})})}),function(d){return i.apply(this,arguments)})},{key:"getNetworkTopology",value:(t=ke(function*(){var d=this;return new Promise(function(g,y){d.needsLoad()&&g({topology:"none"}),d.sendMessageToCallMachine({action:"get-network-topology"},function(C){C.error?y({error:C.error}):g({topology:C.topology})})})}),function(){return t.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(d){if(Le(),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,g){return Un.prototype.on.call(this,d,g)}},{key:"once",value:function(d,g){return Un.prototype.once.call(this,d,g)}},{key:"off",value:function(d,g){return Un.prototype.off.call(this,d,g)}},{key:"validateProperties",value:function(d){for(var g in d){if(!Rr[g])throw new Error("unrecognized property '".concat(g,"'"));if(Rr[g].validate&&!Rr[g].validate(d[g],this))throw new Error("property '".concat(g,"': ").concat(Rr[g].help))}}},{key:"assembleMeetingUrl",value:function(){var d,g,y=be(be({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(d=this.properties.dailyConfig)!==null&&d!==void 0&&d.proxyUrl?encodeURIComponent((g=this.properties.dailyConfig)===null||g===void 0?void 0:g.proxyUrl):void 0}),C=y.url.match(/\?/)?"&":"?";return y.url+C+Object.keys(Rr).filter(function(k){return Rr[k].queryString&&y[k]!==void 0}).map(function(k){return"".concat(Rr[k].queryString,"=").concat(y[k])}).join("&")}},{key:"needsLoad",value:function(){return[fm,pm,Ir,cr].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(d,g){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(d,g,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 eS:this.sendMessageToCallMachine(be({action:tS},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var g={action:ys,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:Ls(this.properties.dailyConfig)}};this.sendMessageToCallMachine(g),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case mm:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(d);break;case lS:var y,C=be({},d);delete C.internal,this._maxAppMessageSize=((y=d.internal)===null||y===void 0?void 0:y._maxAppMessageSize)||Kc,this._joinedCallback&&(this._joinedCallback(d.participants),this._joinedCallback=null),this.emitDailyJSEvent(C);break;case uS:case dS:if(this._callState===Ir)return;if(d.participant&&d.participant.session_id){var k=d.participant.local?"local":d.participant.session_id;if(this._callObjectMode){var V=this._callMachine().store;Dm(d.participant,V),Im(d.participant,V),jm(d.participant,this._participants[k],V)}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(Ko){console.error("track events error",Ko)}this.compareEqualForParticipantUpdateEvent(d.participant,this._participants[k])||(this._participants[k]=be({},d.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(d))}break;case fS:if(d.participant&&d.participant.session_id){var oe=this._participants[d.participant.session_id];oe&&this.maybeParticipantTracksStopped(oe,null),delete this._participants[d.participant.session_id],this.emitDailyJSEvent(d)}break;case pS:Nt(this._participantCounts,d.participantCounts)||(this._participantCounts=d.participantCounts,this.emitDailyJSEvent(d));break;case hS:var fe={access:d.access};d.awaitingAccess&&(fe.awaitingAccess=d.awaitingAccess),Nt(this._accessState,fe)||(this._accessState=fe,this.emitDailyJSEvent(d));break;case mS:if(d.meetingSession){this._meetingSessionSummary=d.meetingSession,this.emitDailyJSEvent(d);var Me=be(be({},d),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(Me)}break;case _m:var tt;this._iframe&&!d.preserveIframe&&(this._iframe.src=""),this._updateCallState(cr),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(d.errorMsg),this._loadedCallback=null),d.preserveIframe;var Je=vh(d,bw);Je!=null&&(tt=Je.error)!==null&&tt!==void 0&&tt.details&&(Je.error.details=JSON.parse(Je.error.details)),this._maybeSendToSentry(d),this._joinedCallback&&(this._joinedCallback(null,Je),this._joinedCallback=null),this.emitDailyJSEvent(Je);break;case cS:this._callState!==cr&&this._updateCallState(Ir),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(d);break;case"selected-devices-updated":d.devices&&this.emitDailyJSEvent(d);break;case FS:var qt=d.threshold,Wt=d.quality;qt===this._network.threshold&&Wt===this._network.quality||(this._network.quality=Wt,this._network.threshold=qt,this.emitDailyJSEvent(d));break;case $S:d&&d.cpuLoadState&&this.emitDailyJSEvent(d);break;case zS:d&&d.faceCounts!==void 0&&this.emitDailyJSEvent(d);break;case NS:var Jt=d.activeSpeaker;this._activeSpeaker.peerId!==Jt.peerId&&(this._activeSpeaker.peerId=Jt.peerId,this.emitDailyJSEvent({action:d.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var zn=d.show;this._showLocalVideo=zn,this.emitDailyJSEvent({action:d.action,show:zn});break;case BS:var Ze=d.enabled;this._activeSpeakerMode!==Ze&&(this._activeSpeakerMode=Ze,this.emitDailyJSEvent({action:d.action,enabled:this._activeSpeakerMode}));break;case gS:case yS:case _S:this._waitingParticipants=d.allWaitingParticipants,this.emitDailyJSEvent({action:d.action,participant:d.participant});break;case HS:Nt(this._receiveSettings,d.receiveSettings)||(this._receiveSettings=d.receiveSettings,this.emitDailyJSEvent({action:d.action,receiveSettings:d.receiveSettings}));break;case YS:if(!Nt(this._inputSettings,d.inputSettings)){var _t=this._getInputSettings();this._inputSettings=d.inputSettings,this._preloadCache.inputSettings={},Nt(_t,this._getInputSettings())||this.emitDailyJSEvent({action:d.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":Nt(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 LS:var yn=d.session_id;this._rmpPlayerState[yn]=d.playerState,this.emitDailyJSEvent(d);break;case DS:delete this._rmpPlayerState[d.session_id],this.emitDailyJSEvent(d);break;case AS:var Vn=d.session_id,Sr=this._rmpPlayerState[Vn];Sr&&this.compareEqualForRMPUpdateEvent(Sr,d.remoteMediaPlayerState)||(this._rmpPlayerState[Vn]=d.remoteMediaPlayerState,this.emitDailyJSEvent(d));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(d);break;case vS:var Xr=this._meetingSessionState.topology!==(d.meetingSessionState&&d.meetingSessionState.topology);this._meetingSessionState=ou(d.meetingSessionState,this._callObjectMode),(this._callObjectMode||Xr)&&this.emitDailyJSEvent(d);break;case IS:this._isScreenSharing=!0,this.emitDailyJSEvent(d);break;case jS:case RS:this._isScreenSharing=!1,this.emitDailyJSEvent(d);break;case vm:case gm:case ES:case TS:case MS:case kS:case bS:case CS:case oS:case aS:case OS:case xS:case"test-completed":case US:case PS:case VS:case qS:case WS:case JS:case ym:case GS: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,g){var y="record";d&&(g.local||g[y]!==!1||d[y]===g[y]||this.emitDailyJSEvent({action:gm}))}},{key:"maybeEventRecordingStarted",value:function(d,g){var y="record";d&&(g.local||g[y]!==!0||d[y]===g[y]||this.emitDailyJSEvent({action:vm}))}},{key:"maybeEventTrackStopped",value:function(d,g,y,C){d&&(d.readyState!=="ended"&&g&&d.id===g.id||this.emitDailyJSEvent({action:wS,track:d,participant:y,type:C}))}},{key:"maybeEventTrackStarted",value:function(d,g,y,C){g&&(d&&d.readyState!=="ended"&&g.id===d.id||this.emitDailyJSEvent({action:SS,track:g,participant:y,type:C}))}},{key:"maybeParticipantTracksStopped",value:function(d,g){if(d)for(var y in d.tracks)this.maybeEventTrackStopped(d.tracks[y].track,g&&g.tracks[y]?g.tracks[y].track:null,g,y)}},{key:"maybeParticipantTracksStarted",value:function(d,g){if(g)for(var y in g.tracks)this.maybeEventTrackStarted(d&&d.tracks[y]?d.tracks[y].track:null,g.tracks[y].track,g,y)}},{key:"compareEqualForRMPUpdateEvent",value:function(d,g){var y,C;return d.state===g.state&&((y=d.settings)===null||y===void 0?void 0:y.volume)===((C=g.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(g){console.log("could not emit",d,g)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(d,g){return!!Nt(d,g)&&(!d.videoTrack||!g.videoTrack||d.videoTrack.id===g.videoTrack.id&&d.videoTrack.muted===g.videoTrack.muted&&d.videoTrack.enabled===g.videoTrack.enabled)&&(!d.audioTrack||!g.audioTrack||d.audioTrack.id===g.audioTrack.id&&d.audioTrack.muted===g.audioTrack.muted&&d.audioTrack.enabled===g.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return Re()?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 g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(d!==this._callState||g!==this._isPreparingToJoin){var y=this._callState,C=this._isPreparingToJoin;this._callState=d,this._isPreparingToJoin=g;var k=Ms(y,C),V=Ms(this._callState,this._isPreparingToJoin);k!==V&&(this.updateKeepDeviceAwake(V),this.updateDeviceAudioMode(V),this.updateShowAndroidOngoingMeetingNotification(V),this.updateNoOpRecordingEnsuringBackgroundContinuity(V))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=Vm,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Qc},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=ou(zm,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=Kc,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(d){Re()&&this.nativeUtils().setKeepDeviceAwake(d,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(d){if(Re()&&!this.disableReactNativeAutoDeviceManagement("audio")){var g=d?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(g)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(d){if(Re()&&this.nativeUtils().setShowOngoingMeetingNotification){var g,y,C,k;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var V=this.properties.reactNativeConfig.androidInCallNotification;g=V.title,y=V.subtitle,C=V.iconName,k=V.disableForCustomOverride}k&&(d=!1),this.nativeUtils().setShowOngoingMeetingNotification(d,g,y,C,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(d){Re()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(d)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var d,g;if(Re()){var y=(d=this._callMachine())===null||d===void 0||(g=d.store)===null||g===void 0?void 0:g.getState();for(var C in y==null?void 0:y.streams){var k=y.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 g=document.createElement("a");return g.href=d,g.href}}},{key:"sayHello",value:function(){var d="hello, world.";return console.log(d),d}},{key:"_logUseAfterDestroy",value:function(){var d=Object.values(jr)[0];if(this.needsLoad())if(d&&!d.needsLoad()){var g={action:ys,level:"error",code:this.strictMode?9995:9997};d.sendMessageToCallMachine(g)}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 y={action:ys,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(y,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var d=0,g=Object.values(jr);d0&&arguments[0]!==void 0?arguments[0]:{};return d.layout="none",new he(null,d)}},{key:"wrap",value:function(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Le(),!d||!d.contentWindow||typeof d.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return g.layout||(g.customLayout?g.layout="custom-v1":g.layout="browser"),new he(d,g)}},{key:"createFrame",value:function(d,g){var y,C;Le(),d&&g?(y=d,C=g):d&&d.append?(y=d,C={}):(y=document.body,C=d||{});var k=C.iframeStyle;k||(k=y===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 V=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?V.allow="microphone, camera":V.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",V.style.visibility="hidden",y.appendChild(V),V.style.visibility=null,Object.keys(k).forEach(function(oe){return V.style[oe]=k[oe]}),C.layout||(C.customLayout?C.layout="custom-v1":C.layout="browser");try{return new he(V,C)}catch(oe){throw y.removeChild(V),oe}}},{key:"createTransparentFrame",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Le();var g=document.createElement("iframe");return g.allow="microphone; camera; autoplay",g.style.cssText=` position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: 0; pointer-events: none; `,document.body.appendChild(g),d.layout||(d.layout="custom-v1"),he.wrap(g,d)}},{key:"getCallInstance",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return d?jr[d]:Object.values(jr)[0]}}]),he}();function bi(r,t){var i={};for(var a in r)if(r[a]instanceof MediaStreamTrack)i[a]=Io;else if(a==="dailyConfig"){if(r[a].modifyLocalSdpHook){var s=window._daily.instances[t].customCallbacks||{};s.modifyLocalSdpHook=r[a].modifyLocalSdpHook,window._daily.instances[t].customCallbacks=s,delete r[a].modifyLocalSdpHook}if(r[a].modifyRemoteSdpHook){var c=window._daily.instances[t].customCallbacks||{};c.modifyRemoteSdpHook=r[a].modifyRemoteSdpHook,window._daily.instances[t].customCallbacks=c,delete r[a].modifyRemoteSdpHook}i[a]=r[a]}else i[a]=r[a];return i}function ze(r){var t=arguments.length>2?arguments[2]:void 0;if(r!==Pi){var i="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw t&&(i+=" ".concat(t)),console.error(i),new Error(i)}}function Ms(r,t){return[Au,Pi].includes(r)||t}function ru(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",a=arguments.length>3?arguments[3]:void 0;if(Ms(r,t)){var s="".concat(i," not supported after joining a meeting.");throw a&&(s+=" ".concat(a)),console.error(s),new Error(s)}}function ws(r){var t=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(t,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 iu(r){if(r){var t="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(t),new Error(t)}}function dn(r){if(!r){var t="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(t),new Error(t)}}function zt(r){if(r){var t="".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(t),new Error(t)}}function Le(){if(Re())throw new Error("This daily-js method is not currently supported in React Native")}function Lo(){if(!Re())throw new Error("This daily-js method is only supported in React Native")}function Qv(r){if(r===void 0)return!0;var t;if(typeof r=="string")t=r;else try{t=JSON.stringify(r),Nt(JSON.parse(t),r)||console.warn("The userData provided will be modified when serialized.")}catch(i){throw Error("userData must be serializable to JSON: ".concat(i))}if(t.length>4096)throw Error("userData is too large (".concat(t.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function Kv(r,t){for(var i=t.allowAllParticipantsKey,a=function(S){var E=["local"];return i||E.push("*"),S&&!E.includes(S)},s=function(S){return!!(S.layer===void 0||Number.isInteger(S.layer)&&S.layer>=0||S.layer==="inherit")},c=function(S){return!!S&&!(S.video&&!s(S.video))&&!(S.screenVideo&&!s(S.screenVideo))},p=0,h=Object.entries(r);p1||f[0]!=="strength"?(console.error(_),!1):!(typeof h.strength!="number"||h.strength<=0||h.strength>1||isNaN(h.strength))||(console.error("".concat(_,"; expected: {0 < strength <= 1}, got: ").concat(h.strength)),!1);case Ts.BGIMAGE:return!(h.source!==void 0&&!function(v){if(v.source==="default")return v.type="default",!0;if(v.source instanceof ArrayBuffer)return!0;if(zo(v.source))return v.type="url",!!function(M){var D=new URL(M),L=D.pathname;if(D.protocol==="data:")try{var B=L.substring(L.indexOf(":")+1,L.indexOf(";")).split("/")[1];return Zc.includes(B)}catch(te){return console.error("failed to deduce blob content type",te),!1}var W=L.split(".").at(-1).toLowerCase().trim();return Zc.includes(W)}(v.source)||(console.error("invalid image type; supported types: [".concat(Zc.join(", "),"]")),!1);return S=v.source,E=Number(S),isNaN(E)||!Number.isInteger(E)||E<=0||E>bm?(console.error("invalid image selection; must be an int, > 0, <= ".concat(bm)),!1):(v.type="daily-preselect",!0);var S,E}(h));default:return!0}}(s.type,s.config))?!1:(Object.keys(s).filter(function(p){return!c.includes(p)}).forEach(function(p){console.warn("invalid key inputSettings -> video -> processor : ".concat(p)),delete s[p]}),!0)}(r.video.processor)))&&!(r.audio&&(Ue(r.audio)!=="object"||(i=r.audio.processor,a=["type"],!i||Ue(i)!=="object"||(Object.keys(i).filter(function(s){return!a.includes(s)}).forEach(function(s){console.warn("invalid key inputSettings -> audio -> processor : ".concat(s)),delete i[s]}),t=i.type,typeof t!="string"||!Object.values(Uv).includes(t)&&(console.error("inputSettings audio processor type invalid"),1)))));var t,i,a}function Zv(r,t){var i,a=[];r.video&&!zv((i=t==null?void 0:t.useLegacyVideoProcessor)!==null&&i!==void 0&&i)&&(delete r.video,a.push("video")),r.audio&&!Vv()&&(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 Fu(){var r=Object.values(Ts).join(" | "),t=Object.values(Uv).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(r," ], config?: {} } }, audio?: { processor: {type: [ ").concat(t," ] } } }")}function eg(r){var t=r.allowAllParticipantsKey;return"receiveSettings must be of the form { [ | ".concat(X0).concat(t?' | "'.concat(Z0,'"'):"","]: ")+'{ [video: [{ layer: [ | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [ | "inherit"] } | "inherit"]] }}}'}function tg(){return"customIntegrations should be an object of type ".concat(JSON.stringify(Bu),".")}function ng(r){if(r&&Ue(r)!=="object"||Array.isArray(r))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(Fs),".")),!1;if(r)for(var t=0,i=Object.entries(r);t2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function Hm(r,t,i){return!(typeof r!="number"||ri)}function ou(r,t){return r&&!t&&delete r.data,r}class Tw{log(t,i,...a){const s=this.formatMessage(i);switch(t){case"info":console.info(s,...a);break;case"warn":console.warn(s,...a);break;case"error":console.error(s,...a);break;default:console.log(s,...a);break}}info(t,...i){this.log("info",t,...i)}warn(t,...i){this.log("warn",t,...i)}error(t,...i){this.log("error",t,...i)}formatMessage(t){return typeof t=="string"?t:JSON.stringify(t)}}const Ct=new Tw,Mw="https://hackathon-test.fly.dev";class Pw{constructor(t){jn(this,"apiUrl");this.apiUrl=t}async fetchWithOptionalAuth(t,i={},a){const s={...i.headers};a&&(s.Authorization=`Bearer ${a}`);const c=await fetch(t,{...i,headers:s});if(console.log("[ApiClient] Response:",c),!c.ok)throw new Error(`HTTP error! status: ${c.status} ${c.statusText}`);return c.json()}async connectToAi(){const t=this.apiUrl+"/get_daily_url_token";try{const i=await this.fetchWithOptionalAuth(t,{method:"GET",headers:{"Content-Type":"application/json"}}),a=i.daily_url,s=i.daily_token;return Ct.info("Response from connect to ai:",i),{daily_url:a,daily_token:s}}catch(i){throw Ct.error("Failed to connect to ai:",i),i}}async connectToAiPool(t,i){const a=this.apiUrl+"/connect";return await this.fetchWithOptionalAuth(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({daily_room_url:t,daily_token:i})})}}const Ym=new Pw(Mw),Bn=class Bn{constructor(t={}){jn(this,"dailyCall",null);jn(this,"state","idle");jn(this,"dailyUrl");jn(this,"dailyToken");jn(this,"localJoined",!1);jn(this,"aiJoined",!1);this.callbacks=t,Bn.activeInstance&&Bn.activeInstance.disconnect(),Bn.activeInstance=this}static cleanup(){Bn.activeInstance&&(Bn.activeInstance.disconnect(),Bn.activeInstance=null)}async init(){throw new Error("Not implemented")}async connect(){this.setState("connecting");try{const t=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),i=await Ym.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=jo.createCallObject({url:this.dailyUrl,token:this.dailyToken,audioSource:t.getAudioTracks()[0],subscribeToTracksAutomatically:!0}),this.setupDailyEvents(this.dailyCall),await this.dailyCall.join(),await this.dailyCall.setLocalAudio(!0);const a=this.dailyCall.participants(),s=Object.keys(a).length;console.log("[TransportClient] participantCount:",s),s<=1?(Ct.info("[TransportClient] No other participants found, connecting AI"),await Ym.connectToAiPool(this.dailyUrl,this.dailyToken)):Ct.info("[TransportClient] Other participants found, skipping AI connection")}catch(t){throw Ct.error("[TransportClient] connect failed:",t),this.setState("error",t.message),t}}startScreenShare(){if(this.dailyCall)try{this.dailyCall.startScreenShare(),Ct.info("[TransportClient] Screen share started successfully")}catch(t){if(t instanceof Error&&t.name==="NotAllowedError")Ct.info("[TransportClient] User denied screen share permission");else throw t}}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(t){Ct.error("[TransportClient] error on disconnect:",t)}}sendAppMessage(t){if(!this.dailyCall){Ct.warn("[TransportClient] can't send message - dailyCall null");return}const i=JSON.stringify(t);this.dailyCall.sendAppMessage(i)}maybeSetConnectedState(){this.localJoined&&this.aiJoined&&(this.setState("connected"),Ct.info("[TransportClient] AI is connected!"))}setupDailyEvents(t){t.on("joined-meeting",()=>{Ct.info("[TransportClient] local user joined meeting"),this.localJoined=!0,this.maybeSetConnectedState()}),t.on("participant-joined",i=>{var s,c;const a=i.participant;Ct.info("[TransportClient] participant joined:",a,a.user_name),console.log("[TransportClient] participants:",t.participants()),a.local||this.isAiParticipant(a)&&(Ct.info("[TransportClient] recognized AI participant joined:",a.user_name),this.aiJoined=!0,this.maybeSetConnectedState()),(c=(s=this.callbacks).onParticipantJoined)==null||c.call(s,a)}),t.on("participant-left",i=>{var s,c;const a=i.participant;Ct.info("[TransportClient] participant left:",a,a.user_name),this.isAiParticipant(a)&&(this.aiJoined=!1),(c=(s=this.callbacks).onParticipantLeft)==null||c.call(s,a)}),t.on("track-started",i=>{var c,p,h,f,_,v;const{participant:a,track:s}=i;a&&s&&(console.log("[TransportClient] track-started",a,s.kind,"is local:",a.local),s.kind==="audio"?(p=(c=this.callbacks).onAudioTrackStarted)==null||p.call(c,a,s):s.kind==="video"&&((f=(h=this.callbacks).onVideoTrackStarted)==null||f.call(h,a,s)),(v=(_=this.callbacks).onTrackStarted)==null||v.call(_,a,s))}),t.on("track-stopped",i=>{var c,p,h,f,_,v;const{participant:a,track:s}=i;a&&s&&(console.log("[TransportClient] track-stopped",a,s.kind,"is local:",a.local),s.kind==="audio"?(p=(c=this.callbacks).onAudioTrackStopped)==null||p.call(c,a,s):s.kind==="video"&&((f=(h=this.callbacks).onVideoTrackStopped)==null||f.call(h,a,s)),(v=(_=this.callbacks).onTrackStopped)==null||v.call(_,a,s))}),t.on("app-message",i=>{var c,p;const{data:a,fromId:s}=i;(p=(c=this.callbacks).onCustomMessage)==null||p.call(c,a,s)}),t.on("error",i=>{Ct.error("[TransportClient] daily error:",i.errorMsg),this.setState("error",i.errorMsg)}),t.on("local-screen-share-started",i=>{Ct.info("[TransportClient] Screen share started:",i)})}isAiParticipant(t){return t.user_name}setState(t,i){var a,s;this.state=t,(s=(a=this.callbacks).onStateChange)==null||s.call(a,t,i)}getState(){return this.state}};jn(Bn,"activeInstance",null);let Uu=Bn;const Zt={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let Ow=0;function Ee(r,t){const i=`atom${++Ow}`,a={toString(){return(Zt?"production":void 0)!=="production"&&this.debugLabel?i+":"+this.debugLabel:i}};return typeof r=="function"?a.read=r:(a.init=r,a.read=xw,a.write=Lw),t&&(a.write=t),a}function xw(r){return r(this)}function Lw(r,t,i){return t(this,typeof i=="function"?i(r(this)):i)}const Qm=(r,t)=>r.unstable_is?r.unstable_is(t):t===r,au=r=>"init"in r,su=r=>!!r.write,Us=new WeakMap,$u=r=>{var t;return zu(r)&&!((t=Us.get(r))!=null&&t[1])},Aw=(r,t)=>{const i=Us.get(r);if(i)i[1]=!0,i[0].forEach(a=>a(t));else if((Zt?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},Dw=r=>{if(Us.has(r))return;const t=[new Set,!1];Us.set(r,t);const i=()=>{t[1]=!0};r.then(i,i),r.onCancel=a=>{t[0].add(a)}},zu=r=>typeof(r==null?void 0:r.then)=="function",Km=r=>"v"in r||"e"in r,ks=r=>{if("e"in r)throw r.e;if((Zt?"production":void 0)!=="production"&&!("v"in r))throw new Error("[Bug] atom state is not initialized");return r.v},og=(r,t,i)=>{i.p.has(r)||(i.p.add(r),t.then(()=>{i.p.delete(r)},()=>{i.p.delete(r)}))},Xm=(r,t,i,a,s)=>{var c;if((Zt?"production":void 0)!=="production"&&a===t)throw new Error("[Bug] atom cannot depend on itself");i.d.set(a,s.n),$u(i.v)&&og(t,i.v,s),(c=s.m)==null||c.t.add(t),r&&Iw(r,a,t)},Ci=()=>[new Map,new Map,new Set],lu=(r,t,i)=>{r[0].has(t)||r[0].set(t,new Set),r[1].set(t,i)},Iw=(r,t,i)=>{const a=r[0].get(t);a&&a.add(i)},jw=(r,t)=>r[0].get(t),Zm=(r,t)=>{r[2].add(t)},ur=r=>{let t,i=!1;const a=s=>{try{s()}catch(c){i||(t=c,i=!0)}};for(;r[1].size||r[2].size;){r[0].clear();const s=new Set(r[1].values());r[1].clear();const c=new Set(r[2]);r[2].clear(),s.forEach(p=>{var h;return(h=p.m)==null?void 0:h.l.forEach(a)}),c.forEach(a)}if(i)throw t},ag=(...[r,t,i,a])=>{let s;(Zt?"production":void 0)!=="production"&&(s=new Set);const c=(Y,j,P)=>{const T="v"in j,x=j.v,R=$u(j.v)?j.v:null;if(zu(P)){Dw(P);for(const q of j.d.keys())og(Y,P,r(q));j.v=P,delete j.e}else j.v=P,delete j.e;(!T||!Object.is(x,j.v))&&(++j.n,R&&Aw(R,P))},p=(Y,j,P)=>{var T;const x=r(j);if(Km(x)&&(x.m&&!(P!=null&&P.has(j))||Array.from(x.d).every(([G,de])=>p(Y,G,P).n===de)))return x;x.d.clear();let R=!0;const q=G=>{if(Qm(j,G)){const Se=r(G);if(!Km(Se))if(au(G))c(G,Se,G.init);else throw new Error("no atom init");return ks(Se)}const de=p(Y,G,P);try{return ks(de)}finally{if(R)Xm(Y,j,x,G,de);else{const Se=Ci();Xm(Se,j,x,G,de),M(Se,j,x),ur(Se)}}};let z,ae;const re={get signal(){return z||(z=new AbortController),z.signal},get setSelf(){return(Zt?"production":void 0)!=="production"&&!su(j)&&console.warn("setSelf function cannot be used with read-only atom"),!ae&&su(j)&&(ae=(...G)=>{if((Zt?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)return E(j,...G)}),ae}};try{const G=t(j,q,re);if(c(j,x,G),zu(G)){(T=G.onCancel)==null||T.call(G,()=>z==null?void 0:z.abort());const de=()=>{if(x.m){const Se=Ci();M(Se,j,x),ur(Se)}};G.then(de,de)}return x}catch(G){return delete x.v,x.e=G,++x.n,x}finally{R=!1}},h=Y=>ks(p(void 0,Y)),f=(Y,j,P)=>{var T,x;const R=new Map;for(const q of((T=P.m)==null?void 0:T.t)||[])R.set(q,r(q));for(const q of P.p)R.set(q,r(q));return(x=jw(Y,j))==null||x.forEach(q=>{R.set(q,r(q))}),R};function _(Y,j,P){const T=[],x=new Set,R=new Set,q=[[j,P]];for(;q.length>0;){const[z,ae]=q[q.length-1];if(R.has(z)){q.pop();continue}if(x.has(z)){T.push([z,ae,ae.n]),R.add(z),q.pop();continue}x.add(z);for(const[re,G]of f(Y,z,ae))z!==re&&!x.has(re)&&q.push([re,G])}return[T,R]}const v=(Y,j,P)=>{const[T,x]=_(Y,j,P),R=new Set([j]);for(let q=T.length-1;q>=0;--q){const[z,ae,re]=T[q];let G=!1;for(const de of ae.d.keys())if(de!==z&&R.has(de)){G=!0;break}G&&(p(Y,z,x),M(Y,z,ae),re!==ae.n&&(lu(Y,z,ae),R.add(z))),x.delete(z)}},S=(Y,j,...P)=>{let T=!0;const x=q=>ks(p(Y,q)),R=(q,...z)=>{const ae=r(q);try{if(Qm(j,q)){if(!au(q))throw new Error("atom not writable");const re=ae.n,G=z[0];c(q,ae,G),M(Y,q,ae),re!==ae.n&&(lu(Y,q,ae),v(Y,q,ae));return}else return S(Y,q,...z)}finally{T||ur(Y)}};try{return i(j,x,R,...P)}finally{T=!1}},E=(Y,...j)=>{const P=Ci();try{return S(P,Y,...j)}finally{ur(P)}},M=(Y,j,P)=>{if(P.m&&!$u(P.v)){for(const T of P.d.keys())P.m.d.has(T)||(D(Y,T,r(T)).t.add(j),P.m.d.add(T));for(const T of P.m.d||[])if(!P.d.has(T)){P.m.d.delete(T);const x=L(Y,T,r(T));x==null||x.t.delete(j)}}},D=(Y,j,P)=>{if(!P.m){p(Y,j);for(const T of P.d.keys())D(Y,T,r(T)).t.add(j);if(P.m={l:new Set,d:new Set(P.d.keys()),t:new Set},(Zt?"production":void 0)!=="production"&&s.add(j),su(j)){const T=P.m;let x;const R=(q,z)=>{let ae=!0;x=(...re)=>{try{return S(q,j,...re)}finally{ae||ur(q)}};try{return z()}finally{ae=!1}};Zm(Y,()=>{const q=R(Y,()=>a(j,(...z)=>x(...z)));q&&(T.u=z=>R(z,q))})}}return P.m},L=(Y,j,P)=>{if(P.m&&!P.m.l.size&&!Array.from(P.m.t).some(T=>{var x;return(x=r(T).m)==null?void 0:x.d.has(j)})){const T=P.m.u;T&&Zm(Y,()=>T(Y)),delete P.m,(Zt?"production":void 0)!=="production"&&s.delete(j);for(const x of P.d.keys()){const R=L(Y,x,r(x));R==null||R.t.delete(j)}return}return P.m},te={get:h,set:E,sub:(Y,j)=>{const P=Ci(),T=r(Y),R=D(P,Y,T).l;return R.add(j),ur(P),()=>{R.delete(j);const q=Ci();L(q,Y,T),ur(q)}},unstable_derive:Y=>ag(...Y(r,t,i,a))};return(Zt?"production":void 0)!=="production"&&Object.assign(te,{dev4_get_internal_weak_map:()=>({get:j=>{const P=r(j);if(P.n!==0)return P}}),dev4_get_mounted_atoms:()=>s,dev4_restore_atoms:j=>{const P=Ci();for(const[T,x]of j)if(au(T)){const R=r(T),q=R.n;c(T,R,x),M(P,T,R),q!==R.n&&(lu(P,T,R),v(P,T,R))}ur(P)}}),te},sg=()=>{const r=new WeakMap;return ag(i=>{if((Zt?"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 s;return(s=i.onMount)==null?void 0:s.call(i,...a)})};let Ao;const Rw=()=>(Ao||(Ao=sg(),(Zt?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Ao),globalThis.__JOTAI_DEFAULT_STORE__!==Ao&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Ao),Nw={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Qo(r,t){let i=null;const a=new Map,s=new Set,c=h=>{let f;if(t===void 0)f=a.get(h);else for(const[v,S]of a)if(t(v,h)){f=S;break}if(f!==void 0)if(i!=null&&i(f[1],h))c.remove(h);else return f[0];const _=r(h);return a.set(h,[_,Date.now()]),p("CREATE",h,_),_};function p(h,f,_){for(const v of s)v({type:h,param:f,atom:_})}return c.unstable_listen=h=>(s.add(h),()=>{s.delete(h)}),c.getParams=()=>a.keys(),c.remove=h=>{if(t===void 0){if(!a.has(h))return;const[f]=a.get(h);a.delete(h),p("REMOVE",h,f)}else for(const[f,[_]]of a)if(t(f,h)){a.delete(f),p("REMOVE",f,_);break}},c.setShouldRemove=h=>{if(i=h,!!i)for(const[f,[_,v]]of a)i(v,f)&&(a.delete(f),p("REMOVE",f,_))},c}const Bw=r=>typeof(r==null?void 0:r.then)=="function";function Fw(r=()=>{try{return window.localStorage}catch(i){(Nw?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(i);return}},t){var i;let a,s;const c={getItem:(f,_)=>{var v,S;const E=D=>{if(D=D||"",a!==D){try{s=JSON.parse(D,t==null?void 0:t.reviver)}catch{return _}a=D}return s},M=(S=(v=r())==null?void 0:v.getItem(f))!=null?S:null;return Bw(M)?M.then(E):E(M)},setItem:(f,_)=>{var v;return(v=r())==null?void 0:v.setItem(f,JSON.stringify(_,void 0))},removeItem:f=>{var _;return(_=r())==null?void 0:_.removeItem(f)}},p=f=>(_,v,S)=>f(_,E=>{let M;try{M=JSON.parse(E||"")}catch{M=S}v(M)});let h;try{h=(i=r())==null?void 0:i.subscribe}catch{}return!h&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(h=(f,_)=>{if(!(r()instanceof window.Storage))return()=>{};const v=S=>{S.storageArea===r()&&S.key===f&&_(S.newValue)};return window.addEventListener("storage",v),()=>{window.removeEventListener("storage",v)}}),h&&(c.subscribe=p(h)),c}Fw();const lg={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},cg=U.createContext(void 0),ug=r=>{const t=U.useContext(cg);return(r==null?void 0:r.store)||t||Rw()},Uw=({children:r,store:t})=>{const i=U.useRef();return!t&&!i.current&&(i.current=sg()),U.createElement(cg.Provider,{value:t||i.current},r)},Vu=r=>typeof(r==null?void 0:r.then)=="function",dg=r=>{r.status="pending",r.then(t=>{r.status="fulfilled",r.value=t},t=>{r.status="rejected",r.reason=t})},$w=Ae.use||(r=>{if(r.status==="pending")throw r;if(r.status==="fulfilled")return r.value;throw r.status==="rejected"?r.reason:(dg(r),r)}),cu=new WeakMap,ev=r=>{let t=cu.get(r);return t||(t=new Promise((i,a)=>{let s=r;const c=f=>_=>{s===f&&i(_)},p=f=>_=>{s===f&&a(_)},h=f=>{"onCancel"in f&&typeof f.onCancel=="function"&&f.onCancel(_=>{if((lg?"production":void 0)!=="production"&&_===f)throw new Error("[Bug] p is not updated even after cancelation");Vu(_)?(cu.set(_,t),s=_,_.then(c(_),p(_)),h(_)):i(_)})};r.then(c(r),p(r)),h(r)}),cu.set(r,t)),t};function $n(r,t){const i=ug(t),[[a,s,c],p]=U.useReducer(_=>{const v=i.get(r);return Object.is(_[0],v)&&_[1]===i&&_[2]===r?_:[v,i,r]},void 0,()=>[i.get(r),i,r]);let h=a;(s!==i||c!==r)&&(p(),h=i.get(r));const f=t==null?void 0:t.delay;if(U.useEffect(()=>{const _=i.sub(r,()=>{if(typeof f=="number"){const v=i.get(r);Vu(v)&&dg(ev(v)),setTimeout(p,f);return}p()});return p(),_},[i,r,f]),U.useDebugValue(h),Vu(h)){const _=ev(h);return $w(_)}return h}function fg(r,t){const i=ug(t);return U.useCallback((...s)=>{if((lg?"production":void 0)!=="production"&&!("write"in r))throw new Error("not writable atom");return i.set(r,...s)},[i,r])}function zw(r,t){return[$n(r,t),fg(r,t)]}function Pe(r,t){const i=U.useMemo(()=>Ee(null,(a,s,...c)=>r(a,s,...c)),[r]);return fg(i,t)}var uu,tv;function Vw(){if(tv)return uu;tv=1;var r="Expected a function",t=NaN,i="[object Symbol]",a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,p=/^0o[0-7]+$/i,h=parseInt,f=typeof as=="object"&&as&&as.Object===Object&&as,_=typeof self=="object"&&self&&self.Object===Object&&self,v=f||_||Function("return this")(),S=Object.prototype,E=S.toString,M=Math.max,D=Math.min,L=function(){return v.Date.now()};function B(T,x,R){var q,z,ae,re,G,de,Se=0,Oe=!1,ve=!1,Z=!0;if(typeof T!="function")throw new TypeError(r);x=P(x)||0,te(R)&&(Oe=!!R.leading,ve="maxWait"in R,ae=ve?M(P(R.maxWait)||0,x):ae,Z="trailing"in R?!!R.trailing:Z);function ie(C){var k=q,V=z;return q=z=void 0,Se=C,re=T.apply(V,k),re}function Q(C){return Se=C,G=setTimeout(me,x),Oe?ie(C):re}function I(C){var k=C-de,V=C-Se,oe=x-k;return ve?D(oe,ae-V):oe}function J(C){var k=C-de,V=C-Se;return de===void 0||k>=x||k<0||ve&&V>=ae}function me(){var C=L();if(J(C))return he(C);G=setTimeout(me,I(C))}function he(C){return G=void 0,Z&&q?ie(C):(q=z=void 0,re)}function d(){G!==void 0&&clearTimeout(G),Se=0,q=de=z=G=void 0}function g(){return G===void 0?re:he(L())}function y(){var C=L(),k=J(C);if(q=arguments,z=this,de=C,k){if(G===void 0)return Q(de);if(ve)return G=setTimeout(me,x),ie(de)}return G===void 0&&(G=setTimeout(me,x)),re}return y.cancel=d,y.flush=g,y}function W(T,x,R){var q=!0,z=!0;if(typeof T!="function")throw new TypeError(r);return te(R)&&(q="leading"in R?!!R.leading:q,z="trailing"in R?!!R.trailing:z),B(T,x,{leading:q,maxWait:x,trailing:z})}function te(T){var x=typeof T;return!!T&&(x=="object"||x=="function")}function Y(T){return!!T&&typeof T=="object"}function j(T){return typeof T=="symbol"||Y(T)&&E.call(T)==i}function P(T){if(typeof T=="number")return T;if(j(T))return t;if(te(T)){var x=typeof T.valueOf=="function"?T.valueOf():T;T=te(x)?x+"":x}if(typeof T!="string")return T===0?T:+T;T=T.replace(a,"");var R=c.test(T);return R||p.test(T)?h(T.slice(2),R?2:8):s.test(T)?t:+T}return uu=W,uu}var qw=Vw();const Ww=Ho(qw);function nv(r,t,i,a,s,c,p){try{var h=r[c](p),f=h.value}catch(_){i(_);return}h.done?t(f):Promise.resolve(f).then(a,s)}function Ui(r){return function(){var t=this,i=arguments;return new Promise(function(a,s){var c=r.apply(t,i);function p(f){nv(c,a,s,p,h,"next",f)}function h(f){nv(c,a,s,p,h,"throw",f)}p(void 0)})}}function ot(){return ot=Object.assign?Object.assign.bind():function(r){for(var t=1;t=0)&&(i[s]=r[s]);return i}function Jw(r,t){if(r){if(typeof r=="string")return rv(r,t);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 rv(r,t)}}function rv(r,t){(t==null||t>r.length)&&(t=r.length);for(var i=0,a=new Array(t);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 hg=U.createContext(null),Hr=function(){var t=U.useContext(hg);return U.useDebugValue(t),t},pd=U.createContext({on:function(){},off:function(){}}),Gw=-1,qu=function(){return Gw--},Hw=1,Wu=function(){return Hw++},Ce=function(t,i,a){a===void 0&&(a=!1);var s=U.useContext(pd),c=s.off,p=s.on,h=U.useState(!1),f=h[0],_=h[1],v=U.useRef(0),S=U.useMemo(function(){return a?qu():Wu()},[a]);U.useEffect(function(){if(!(!t||f)){if(v.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 '`+t+"' event is NOT registered.",i),_(!0);return}v.current++;var E=setTimeout(function(){v.current=0},50);return p(t,i,S),function(){clearTimeout(E),c(t,S)}}},[i,t,S,f,c,p]),U.useDebugValue({event:t,eventId:S,isBlocked:f,callback:i})};function pn(r,t){if(r===t)return!0;if(Array.isArray(r)&&Array.isArray(t)){if(r.length!==t.length)return!1;for(var i=0;iv)return 1;if(_=0)return re[Oe]=R,[].concat(re);var ve=z.filter(function(Q){return re.includes(Q.session_id)&&Q.session_id!==B}).sort(function(Q,I){var J,me,he=(J=T(Et(Q.session_id,"last_active")))!=null?J:new Date("1970-01-01"),d=(me=T(Et(I.session_id,"last_active")))!=null?me:new Date("1970-01-01");return he>d?1:he"u"||typeof((S=navigator)==null||(E=S.mediaDevices)==null?void 0:E.enumerateDevices)>"u"){f(ut,"not-supported"),f(dt,"not-supported");return}if(a)try{var M=yield a.enumerateDevices(),D=M.devices,L=D.filter(function(R){return R.kind==="videoinput"&&R.deviceId!==""}),B=D.filter(function(R){return R.kind==="audioinput"&&R.deviceId!==""}),W=D.filter(function(R){return R.kind==="audiooutput"&&R.deviceId!==""}),te=yield a.getInputDevices(),Y=te.camera,j=te.mic,P=te.speaker,T=function(q,z,ae){var re,G;return{device:z,selected:"deviceId"in q&&z.deviceId===q.deviceId,state:(re=(G=ae.find(function(de){return de.device.deviceId===z.deviceId}))==null?void 0:G.state)!=null?re:"granted"}},x=function(q,z){return q.device.deviceId==="default"?-1:z.device.deviceId==="default"?1:q.device.labelz.device.label?1:0};f(Os,function(R){return L.filter(Boolean).map(function(q){return T(Y,q,R)}).sort(x)}),f(xs,function(R){return B.filter(Boolean).map(function(q){return T(j,q,R)}).sort(x)}),f(Tg,function(R){return W.filter(Boolean).map(function(q){return T(P,q,R)}).sort(x)})}catch{f(ut,"not-supported"),f(dt,"not-supported")}});return function(h,f){return p.apply(this,arguments)}}(),[a])),c=Pe(U.useCallback(function(){var p=Ui(function*(h,f){var _,v,S,E,M,D,L,B,W,te,Y,j,P,T;if(a){var x=h(ut),R=h(dt),q=a.participants();if(q.local){var z=q.local.tracks,ae="prompt",re="prompt";if(navigator.permissions)try{var G=yield navigator.permissions.query({name:"camera"});ae=G.state;var de=yield navigator.permissions.query({name:"microphone"});re=de.state}catch{}var Se=ae==="prompt"&&["idle","pending"].includes(x)&&z.video.state==="interrupted"&&!z.video.persistentTrack,Oe=["idle","pending"].includes(x)&&!z.video.persistentTrack&&!!((_=z.video.off)!=null&&_.byUser),ve=re==="prompt"&&["idle","pending"].includes(R)&&z.audio.state==="interrupted"&&!z.audio.persistentTrack,Z=["idle","pending"].includes(R)&&!z.audio.persistentTrack&&!!((v=z.audio.off)!=null&&v.byUser);(S=z.audio)!=null&&(E=S.blocked)!=null&&E.byDeviceInUse?(f(dt,"in-use"),f(xs,function(ie){return ie.map(function(Q){return Q.selected?ot({},Q,{state:"in-use"}):Q})})):(M=z.audio)!=null&&(D=M.blocked)!=null&&D.byDeviceMissing?f(dt,"not-found"):(L=z.audio)!=null&&(B=L.blocked)!=null&&B.byPermissions||re==="denied"?f(dt,"blocked"):ve?f(dt,"pending"):Z?f(dt,"idle"):(f(dt,"granted"),f(xs,function(ie){return ie.map(function(Q){return Q.selected?ot({},Q,{state:"granted"}):Q})})),(W=z.video)!=null&&(te=W.blocked)!=null&&te.byDeviceInUse?(f(ut,"in-use"),f(Os,function(ie){return ie.map(function(Q){return Q.selected?ot({},Q,{state:"in-use"}):Q})})):(Y=z.video)!=null&&(j=Y.blocked)!=null&&j.byDeviceMissing?f(ut,"not-found"):(P=z.video)!=null&&(T=P.blocked)!=null&&T.byPermissions||ae==="denied"?f(ut,"blocked"):Se?f(ut,"pending"):Oe?f(ut,"idle"):(f(ut,"granted"),f(Os,function(ie){return ie.map(function(Q){return Q.selected?ot({},Q,{state:"granted"}):Q})})),s()}}});return function(h,f){return p.apply(this,arguments)}}(),[a,s]));return Ce("participant-updated",U.useCallback(function(p){p.participant.local&&c()},[c])),Ce("available-devices-updated",s),Ce("selected-devices-updated",s),Ce("camera-error",Pe(U.useCallback(function(p,h,f){var _,v,S,E,M,D,L;switch(h(Mg,f.error),(_=f.error)==null?void 0:_.type){case"cam-in-use":h(ut,"in-use");break;case"mic-in-use":h(dt,"in-use");break;case"cam-mic-in-use":h(ut,"in-use"),h(dt,"in-use");break;case"not-found":(v=f.error)!=null&&v.missingMedia.includes("video")&&h(ut,"not-found"),(S=f.error)!=null&&S.missingMedia.includes("audio")&&h(dt,"not-found");break;case"permissions":(E=f.error)!=null&&E.blockedMedia.includes("video")&&h(ut,"blocked"),(M=f.error)!=null&&M.blockedMedia.includes("audio")&&h(dt,"blocked");break;case"constraints":((D=f.error)==null?void 0:D.reason)==="invalid"?(h(ut,"constraints-invalid"),h(dt,"constraints-invalid")):((L=f.error)==null?void 0:L.reason)==="none-specified"&&(h(ut,"constraints-none-specified"),h(dt,"constraints-none-specified"));break;case"undefined-mediadevices":h(ut,"undefined-mediadevices"),h(dt,"undefined-mediadevices");break;case"unknown":default:h(ut,"unknown"),h(dt,"unknown");break}},[]))),Ce("started-camera",Pe(U.useCallback(function(p,h){h(ut,"granted"),h(dt,"granted"),c()},[c]))),Ae.createElement(sk.Provider,{value:{refreshDevices:s}},i)},Ro=Ee({errorMsg:void 0,isLiveStreaming:!1,layout:void 0});Ro.debugLabel=Ne("live-streaming");var ck=function(t){var i=t.children;return Ce("live-streaming-started",Pe(U.useCallback(function(a,s,c){s(Ro,{isLiveStreaming:!0,layout:c==null?void 0:c.layout})},[]))),Ce("live-streaming-stopped",Pe(U.useCallback(function(a,s){s(Ro,function(c){return ot({},c,{isLiveStreaming:!1,layout:void 0})})},[]))),Ce("live-streaming-error",Pe(U.useCallback(function(a,s,c){s(Ro,function(p){return ot({},p,{errorMsg:c.errorMsg})})},[]))),Ce("left-meeting",Pe(U.useCallback(function(a,s){s(Ro,{errorMsg:void 0,isLiveStreaming:!1,layout:void 0})},[]))),Ae.createElement(Ae.Fragment,null,i)},qs=Ee("new");qs.debugLabel=Ne("meeting-state");var Gu=Ee(null);Gu.debugLabel=Ne("meeting-error");var Hu=Ee(null);Hu.debugLabel=Ne("non-fatal-error");var No=Ee({data:void 0,topology:"none"});No.debugLabel=Ne("meeting-session-data");var uk=function(t){var i=t.children,a=Hr(),s=Pe(U.useCallback(function(p,h){if(a){var f=a.meetingState();return h(qs,f),f}},[a]));Ce("loading",s),Ce("loaded",s),Ce("joining-meeting",s),Ce("joined-meeting",s),Ce("left-meeting",s),Ce("error",Pe(U.useCallback(function(p,h,f){h(Gu,f),s()},[s]))),Ce("nonfatal-error",Pe(U.useCallback(function(p,h,f){h(Hu,f)},[])));var c=Pe(U.useCallback(function(p,h){a&&h(No,a.meetingSessionState())},[a]));return Ce("joined-meeting",c),Ce("meeting-session-state-updated",Pe(U.useCallback(function(p,h,f){h(No,f.meetingSessionState)},[]))),Ce("left-meeting",Pe(U.useCallback(function(p,h){h(No,{data:void 0,topology:"none"})},[]))),Ce("call-instance-destroyed",Pe(U.useCallback(function(p,h){h(qs,"new"),h(Gu,null),h(Hu,null),h(No,{data:void 0,topology:"none"})},[]))),Ae.createElement(Ae.Fragment,null,i)},Ti=Ee("none");Ti.debugLabel=Ne("topology");var Yu=Ee(100);Yu.debugLabel=Ne("network-quality");var Qu=Ee("good");Qu.debugLabel=Ne("network-threshold");var dk=function(t){var i=t.children,a=Hr(),s=$n(Ti),c=Pe(U.useCallback(function(){var p=Ui(function*(h,f){if(a){var _=yield a.getNetworkTopology();!_||(_==null?void 0:_.topology)==="none"||f(Ti,_.topology)}});return function(h,f){return p.apply(this,arguments)}}(),[a]));return Ce("joined-meeting",c),Ce("network-connection",Pe(U.useCallback(function(p,h,f){switch(f.event){case"connected":f.type==="peer-to-peer"&&h(Ti,"peer"),f.type==="sfu"&&h(Ti,"sfu");break}},[]))),Ce("network-quality-change",Pe(U.useCallback(function(p,h,f){h(Yu,function(_){return _!==f.quality?f.quality:_}),h(Qu,function(_){return _!==f.threshold?f.threshold:_})},[]))),Ce("left-meeting",Pe(U.useCallback(function(p,h){h(Ti,"none"),h(Yu,100),h(Qu,"good")},[]))),U.useEffect(function(){!a||s!=="none"||c()},[a,c,s]),Ae.createElement(Ae.Fragment,null,i)},Br=Ee({isLocalParticipantRecorded:!1,isRecording:!1});Br.debugLabel=Ne("recording-state");var fk=function(t){var i=t.children,a=Qs(),s=kg({filter:"record"}),c=Pe(U.useCallback(function(p,h,f,_){var v=p(Br),S={isLocalParticipantRecorded:v.isLocalParticipantRecorded,isRecording:v.isRecording,local:v.local,type:v.type},E={isLocalParticipantRecorded:(S==null?void 0:S.type)==="local"||!(S!=null&&S.type)?f:S.isLocalParticipantRecorded,isRecording:(S==null?void 0:S.type)==="local"||!(S!=null&&S.type)?f:S.isRecording,local:((S==null?void 0:S.type)==="local"||!(S!=null&&S.type))&&f?_:S==null?void 0:S.local,type:f?"local":v==null?void 0:v.type};pn(S,E)||h(Br,ot({},S,E))},[]));return U.useEffect(function(){var p=s.length>0,h=s.includes(a||"local");c(p,h)},[a,c,s]),Ce("recording-started",Pe(U.useCallback(function(p,h,f){var _=!0;switch(f.type){case"cloud-beta":case"cloud":{var v;a&&((v=f.layout)==null?void 0:v.preset)==="single-participant"&&f.layout.session_id!==a&&(_=!1);break}}h(Br,{error:!1,isLocalParticipantRecorded:_,isRecording:!0,layout:f==null?void 0:f.layout,local:f==null?void 0:f.local,recordingId:f==null?void 0:f.recordingId,recordingStartedDate:new Date,startedBy:f==null?void 0:f.startedBy,type:f==null?void 0:f.type})},[a]))),Ce("recording-stopped",Pe(U.useCallback(function(p,h){h(Br,function(f){return ot({},f,{isLocalParticipantRecorded:!1,isRecording:!1})})},[]))),Ce("recording-error",Pe(U.useCallback(function(p,h){h(Br,function(f){return ot({},f,{error:!0,isLocalParticipantRecorded:!1,isRecording:!1})})},[]))),Ce("left-meeting",Pe(U.useCallback(function(p,h){h(Br,{isLocalParticipantRecorded:!1,isRecording:!1})},[]))),Ae.createElement(Ae.Fragment,null,i)},pk=function(){var t=$n(qs);return U.useDebugValue(t),t},Ku=Ee(null);Ku.debugLabel=Ne("room-state");var hk=function(t){var i=t.children,a=Hr(),s=pk(),c=Pe(U.useCallback(function(){var p=Ui(function*(h,f){if(!(!a||s==="left-meeting")){var _=yield a.room();return _&&"id"in _&&f(Ku,_),_}});return function(h,f){return p.apply(this,arguments)}}(),[a,s]));return Ce("access-state-updated",c),Ce("left-meeting",Pe(U.useCallback(function(p,h){return function(){h(Ku,null)}},[]))),Ae.createElement(Ae.Fragment,null,i)},Mi=Ee({isTranscribing:!1,model:"general",language:"en",transcriptions:[]});Mi.debugLabel=Ne("transcription-state");var mk=function(t){var i=t.children;return Ce("transcription-started",Pe(U.useCallback(function(a,s,c){s(Mi,{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})},[]))),Ce("transcription-stopped",Pe(U.useCallback(function(a,s,c){s(Mi,function(p){return ot({},p,{updatedBy:c.updatedBy,isTranscribing:!1})})},[]))),Ce("transcription-error",Pe(U.useCallback(function(a,s){s(Mi,function(c){return ot({},c,{error:!0,isTranscribing:!1})})},[]))),Ce("left-meeting",Pe(U.useCallback(function(a,s){s(Mi,function(c){return ot({},c,{isTranscribing:!1})})},[]))),Ce("app-message",Pe(U.useCallback(function(a,s,c){(c==null?void 0:c.fromId)==="transcription"&&s(Mi,function(p){return ot({},p,{isTranscribing:!0,transcriptions:[].concat(p.transcriptions,[c.data])})})},[]))),Ae.createElement(Ae.Fragment,null,i)},Pg={},Og=function(){return!0},vk={options:Pg,shouldCreateInstance:Og},gk=function(t,i){var a=i===void 0?vk:i,s=a.parentElRef,c=a.options,p=c===void 0?Pg:c,h=a.shouldCreateInstance,f=h===void 0?Og:h,_=U.useState(null),v=_[0],S=_[1],E=U.useRef();return U.useEffect(function(){if(!f())return;function M(W){return D.apply(this,arguments)}function D(){return D=Ui(function*(W){yield W.destroy()}),D.apply(this,arguments)}var L=function(){setTimeout(function(){return S(null)},0)},B=jo.getCallInstance();if(!v&&B&&!B.isDestroyed()){B.once("call-instance-destroyed",L),S(B);return}if(v){pn(E.current,p)||M(v);return}if(!B||B.isDestroyed()){switch(t){case"callFrame":B=s!=null&&s.current?jo.createFrame(s.current,ot({},p)):jo.createFrame(ot({},p));break;case"callObject":B=jo.createCallObject(ot({},p));break}E.current=p}S(B),B.once("call-instance-destroyed",L)},[v,p,s,f,t]),v},yk=function(t){return gk("callObject",t)},_k=["children","jotaiStore"],Sk=function(t){var i=t.children,a=t.jotaiStore,s=fd(t,_k),c=U.useRef({}),p=U.useCallback(function(D){var L,B;if("action"in D)for(var W=D.action,te=Array.from((L=(B=c.current)==null?void 0:B[W])!=null?L:[]),Y=te.filter(function(z){var ae=z[0];return ae<0}),j=te.filter(function(z){var ae=z[0];return ae>0}),P=[].concat(Y,j),T=pg(P),x;!(x=T()).done;){var R=x.value,q=R[1];q(D)}},[]),h=U.useCallback(function(D){D&&Object.keys(c.current).forEach(function(L){D.off(L,p),D.isDestroyed()||D.on(L,p)})},[p]),f="callObject"in s?s.callObject:null,_=U.useMemo(function(){return"callObject"in s?{}:s},[s]),v=yk({options:_,shouldCreateInstance:U.useCallback(function(){return!("callObject"in s)},[s])}),S=f??v;U.useEffect(function(){S&&h(S)},[S,h]);var E=U.useCallback(function(D,L,B){var W;if(c.current[D]||(c.current[D]=new Map,S&&(S.off(D,p),S.isDestroyed()||S.on(D,p))),!((W=c.current[D])!=null&&W.has(B))){var te;(te=c.current[D])==null||te.set(B,L)}},[S,p]),M=U.useCallback(function(D,L){var B,W;(B=c.current[D])==null||B.delete(L),((W=c.current[D])==null?void 0:W.size)===0&&(S==null||S.off(D,p),delete c.current[D])},[S,p]);return Ae.createElement(Uw,{store:a},Ae.createElement(hg.Provider,{value:S},Ae.createElement(pd.Provider,{value:{on:E,off:M}},Ae.createElement(hk,null,Ae.createElement(uk,null,Ae.createElement(dk,null,Ae.createElement(Zw,null,Ae.createElement(fk,null,Ae.createElement(ck,null,Ae.createElement(mk,null,Ae.createElement(lk,null,i)))))))))))},wk=Ee({state:"low",reason:"none"});wk.debugLabel=Ne("cpu-load");var kk=Ee(null);kk.debugLabel=Ne("input-settings");var bk=Ee({hidden:0,present:0});bk.debugLabel=Ne("participant-counts");var Ck=Ee(null);Ck.debugLabel=Ne("send-settings");const xg=U.createContext(null),Ek=({children:r})=>{var D;const t=U.useRef(null),[i,a]=U.useState("idle"),[s,c]=U.useState([]),[p,h]=U.useState([]),f=U.useRef(null),_=U.useRef(new Map),v=async()=>{if(i==="connecting"||i==="connected"){console.log("[TransportProvider] Already connecting or connected");return}const L=new Uu({onStateChange:(B,W)=>{console.log("[TransportProvider] onStateChange =>",B,W),a(B)},onParticipantJoined:B=>{console.log("[TransportProvider] participant joined:",B),h(W=>[...W,{username:B.user_name,id:B.session_id}])},onParticipantLeft:B=>{console.log("[TransportProvider] participant left:",B),h(W=>W.filter(te=>te.id!==B.session_id))},onCustomMessage:(B,W)=>{console.log("[TransportProvider] onCustomMessage =>",B,W),c(te=>[...te,{from:W??"unknown",data:B,time:Date.now()}])}});t.current=L;try{await L.connect()}catch(B){console.error("[TransportProvider] connectToAi error:",B)}},S=async()=>{var L,B;console.log("[TransportProvider] Disconnecting AI transport"),(L=t.current)!=null&&L.dailyCall&&(await t.current.dailyCall.leave(),await t.current.dailyCall.destroy()),(B=t.current)==null||B.disconnect(),t.current=null,a("disconnected"),c([]),h([]),_.current.forEach(W=>W.disconnect()),_.current.clear(),f.current&&(f.current.close(),f.current=null)},E=L=>{if(!t.current){console.warn("[TransportProvider] transportRef is null, cannot send");return}console.log("[TransportProvider] sendMessage =>",L),t.current.sendAppMessage(L)},M=async()=>{if(!t.current){console.warn("[TransportProvider] transportRef is null, cannot start screen share");return}await t.current.startScreenShare()};return U.useEffect(()=>()=>{var L,B;console.log("[TransportProvider] unmount => disconnecting AI"),(L=t.current)!=null&&L.dailyCall&&(t.current.dailyCall.leave(),t.current.dailyCall.destroy()),(B=t.current)==null||B.disconnect(),t.current=null,a("disconnected"),_.current.forEach(W=>W.disconnect()),_.current.clear(),f.current&&(f.current.close(),f.current=null)},[]),Ve.jsxs(Sk,{callObject:((D=t.current)==null?void 0:D.dailyCall)||null,children:[Ve.jsx(Eg,{}),Ve.jsx(xg.Provider,{value:{connectToAi:v,disconnectAi:S,sendMessage:E,aiState:i,messages:s,startScreenShare:M,participants:p},children:r})]})},Lg=()=>{const r=U.useContext(xg);if(!r)throw new Error("useTransport must be used within a TransportProvider");return r};function Tk(){const{connectToAi:r,disconnectAi:t,aiState:i}=Lg(),a=["connected","ready"].includes(i),s=async()=>{try{a?await t():await r()}catch(c){console.error("Connection error:",c)}};return Ve.jsx("div",{className:"controls",children:Ve.jsx("button",{className:a?"disconnect-btn":"connect-btn",onClick:s,disabled:["connecting","disconnecting"].includes(i),children:a?"Disconnect":"Connect"})})}var hu,iv;function Ag(){if(iv)return hu;iv=1;var r=Object.prototype.toString;hu=function(S){if(S===void 0)return"undefined";if(S===null)return"null";var E=typeof S;if(E==="boolean")return"boolean";if(E==="string")return"string";if(E==="number")return"number";if(E==="symbol")return"symbol";if(E==="function")return p(S)?"generatorfunction":"function";if(i(S))return"array";if(_(S))return"buffer";if(f(S))return"arguments";if(s(S))return"date";if(a(S))return"error";if(c(S))return"regexp";switch(t(S)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(h(S))return"generator";switch(E=r.call(S),E){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return E.slice(8,-1).toLowerCase().replace(/\s/g,"")};function t(v){return typeof v.constructor=="function"?v.constructor.name:null}function i(v){return Array.isArray?Array.isArray(v):v instanceof Array}function a(v){return v instanceof Error||typeof v.message=="string"&&v.constructor&&typeof v.constructor.stackTraceLimit=="number"}function s(v){return v instanceof Date?!0:typeof v.toDateString=="function"&&typeof v.getDate=="function"&&typeof v.setDate=="function"}function c(v){return v instanceof RegExp?!0:typeof v.flags=="string"&&typeof v.ignoreCase=="boolean"&&typeof v.multiline=="boolean"&&typeof v.global=="boolean"}function p(v,S){return t(v)==="GeneratorFunction"}function h(v){return typeof v.throw=="function"&&typeof v.return=="function"&&typeof v.next=="function"}function f(v){try{if(typeof v.length=="number"&&typeof v.callee=="function")return!0}catch(S){if(S.message.indexOf("callee")!==-1)return!0}return!1}function _(v){return v.constructor&&typeof v.constructor.isBuffer=="function"?v.constructor.isBuffer(v):!1}return hu}/*! * shallow-clone * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. */var mu,ov;function Mk(){if(ov)return mu;ov=1;const r=Symbol.prototype.valueOf,t=Ag();function i(f,_){switch(t(f)){case"array":return f.slice();case"object":return Object.assign({},f);case"date":return new f.constructor(Number(f));case"map":return new Map(f);case"set":return new Set(f);case"buffer":return p(f);case"symbol":return h(f);case"arraybuffer":return s(f);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return c(f);case"regexp":return a(f);case"error":return Object.create(f);default:return f}}function a(f){const _=f.flags!==void 0?f.flags:/\w+$/.exec(f)||void 0,v=new f.constructor(f.source,_);return v.lastIndex=f.lastIndex,v}function s(f){const _=new f.constructor(f.byteLength);return new Uint8Array(_).set(new Uint8Array(f)),_}function c(f,_){return new f.constructor(f.buffer,f.byteOffset,f.length)}function p(f){const _=f.length,v=Buffer.allocUnsafe?Buffer.allocUnsafe(_):Buffer.from(_);return f.copy(v),v}function h(f){return r?Object(r.call(f)):{}}return mu=i,mu}/*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */var vu,av;function Pk(){return av||(av=1,vu=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1}),vu}/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */var gu,sv;function Ok(){if(sv)return gu;sv=1;var r=Pk();function t(i){return r(i)===!0&&Object.prototype.toString.call(i)==="[object Object]"}return gu=function(a){var s,c;return!(t(a)===!1||(s=a.constructor,typeof s!="function")||(c=s.prototype,t(c)===!1)||c.hasOwnProperty("isPrototypeOf")===!1)},gu}var yu,lv;function xk(){if(lv)return yu;lv=1;const r=Mk(),t=Ag(),i=Ok();function a(p,h){switch(t(p)){case"object":return s(p,h);case"array":return c(p,h);default:return r(p)}}function s(p,h){if(typeof h=="function")return h(p);if(h||i(p)){const f=new p.constructor;for(let _ in p)f[_]=a(p[_],h);return f}return p}function c(p,h){const f=new p.constructor(p.length);for(let _=0;_0&&(z=T[0]),z instanceof Error)throw z;var ae=new Error("Unhandled error."+(z?" ("+z.message+")":""));throw ae.context=z,ae}var re=q[P];if(re===void 0)return!1;if(typeof re=="function")t(re,this,T);else for(var G=re.length,de=D(re,G),x=0;x0&&z.length>R&&!z.warned){z.warned=!0;var ae=new Error("Possible EventEmitter memory leak detected. "+z.length+" "+String(P)+" listeners added. Use emitter.setMaxListeners() to increase limit");ae.name="MaxListenersExceededWarning",ae.emitter=j,ae.type=P,ae.count=z.length,a(ae)}return j}c.prototype.addListener=function(P,T){return _(this,P,T,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(P,T){return _(this,P,T,!0)};function v(){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 S(j,P,T){var x={fired:!1,wrapFn:void 0,target:j,type:P,listener:T},R=v.bind(x);return R.listener=T,x.wrapFn=R,R}c.prototype.once=function(P,T){return h(T),this.on(P,S(this,P,T)),this},c.prototype.prependOnceListener=function(P,T){return h(T),this.prependListener(P,S(this,P,T)),this},c.prototype.removeListener=function(P,T){var x,R,q,z,ae;if(h(T),R=this._events,R===void 0)return this;if(x=R[P],x===void 0)return this;if(x===T||x.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete R[P],R.removeListener&&this.emit("removeListener",P,x.listener||T));else if(typeof x!="function"){for(q=-1,z=x.length-1;z>=0;z--)if(x[z]===T||x[z].listener===T){ae=x[z].listener,q=z;break}if(q<0)return this;q===0?x.shift():L(x,q),x.length===1&&(R[P]=x[0]),R.removeListener!==void 0&&this.emit("removeListener",P,ae||T)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(P){var T,x,R;if(x=this._events,x===void 0)return this;if(x.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):x[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete x[P]),this;if(arguments.length===0){var q=Object.keys(x),z;for(R=0;R=0;R--)this.removeListener(P,T[R]);return this};function E(j,P,T){var x=j._events;if(x===void 0)return[];var R=x[P];return R===void 0?[]:typeof R=="function"?T?[R.listener||R]:[R]:T?B(R):D(R,R.length)}c.prototype.listeners=function(P){return E(this,P,!0)},c.prototype.rawListeners=function(P){return E(this,P,!1)},c.listenerCount=function(j,P){return typeof j.listenerCount=="function"?j.listenerCount(P):M.call(j,P)},c.prototype.listenerCount=M;function M(j){var P=this._events;if(P!==void 0){var T=P[j];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function D(j,P){for(var T=new Array(P),x=0;xDg);async function Dg(r,t,i,a){try{console.debug("[RTVI] Fetch action",r,t);const s=new Headers({...Object.fromEntries((i.headers??new Headers).entries())});s.has("Content-Type")||s.set("Content-Type","application/json"),s.set("Cache-Control","no-cache"),s.set("Connection","keep-alive");const c=await fetch(r,{method:"POST",headers:s,body:JSON.stringify({...i.requestData,actions:[t]})}),p=c.headers.get("content-type");if(!c.ok){const h=await c.text();throw new hn(`Failed to resolve action: ${h}`,c.status)}if(c.body&&(p!=null&&p.includes("text/event-stream"))){const h=c.body.pipeThrough(new TextDecoderStream).getReader();let f="";for(;;){const{value:_,done:v}=await h.read();if(v)break;f+=_;let S=f.indexOf(` `);for(;S!==-1;){const E=f.slice(0,S);f=f.slice(S+2);const M=E.split(` `);let D="";for(const L of M){const B=L.indexOf(":");B!==-1&&(D+=L.slice(B+1).trim())}try{const L=atob(D),B=JSON.parse(L);a(B)}catch(L){throw console.error("[RTVI] Failed to parse JSON:",L),L}S=f.indexOf(` `)}}}else{const h=await c.json();a(h)}}catch(s){throw console.error("[RTVI] Error during fetch:",s),s}}var zk={};at(zk,"RTVIClient",()=>_r);var Ig={};Ig=JSON.parse('{"name":"realtime-ai","version":"0.2.1","license":"BSD-2-Clause","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","source":"src/index.ts","repository":{"type":"git","url":"git+https://github.com/rtvi-ai/rtvi-client-web.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"jest --silent && parcel build --no-cache","dev":"parcel watch","lint":"eslint src/ --report-unused-disable-directives --max-warnings 0","test":"jest"},"jest":{"preset":"ts-jest","testEnvironment":"node"},"devDependencies":{"@jest/globals":"^29.7.0","@types/clone-deep":"^4.0.4","@types/jest":"^29.5.12","@types/uuid":"^10.0.0","@typescript-eslint/eslint-plugin":"^7.16.0","@typescript-eslint/parser":"^7.16.0","eslint":"9.11.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1","jest":"^29.7.0","ts-jest":"^29.2.5"},"dependencies":{"@types/events":"^3.0.3","clone-deep":"^4.0.1","events":"^3.3.0","typed-emitter":"^2.1.0","uuid":"^10.0.0"}}');var Yr={};at(Yr,"RTVIError",()=>hn);at(Yr,"ConnectionTimeoutError",()=>jg);at(Yr,"StartBotError",()=>Xu);at(Yr,"TransportStartError",()=>Vk);at(Yr,"BotNotReadyError",()=>mr);at(Yr,"ConfigUpdateError",()=>qk);at(Yr,"VoiceError",()=>Wk);class hn extends Error{constructor(t,i){super(t),this.status=i}}class jg extends hn{constructor(t){super(t??"Bot did not enter ready state within the specified timeout period.")}}class Xu extends hn{constructor(t,i){super(t??"Failed to connect / invalid auth bundle from base url",i??500),this.error="invalid-request-error"}}class Vk extends hn{constructor(t){super(t??"Unable to connect to transport")}}class mr extends hn{constructor(t){super(t??"Attempt to call action on transport when not in 'ready' state.")}}class qk extends hn{constructor(t){super(t??"Unable to update configuration"),this.status=400}}class Wk extends hn{}function zi(r,t,i){const a=i.value;return i.value=function(...s){if(this.state==="ready")return a.apply(this,s);throw new mr(`Attempt to call ${t.toString()} when transport not in ready state. Await connect() first.`)},i}function Jk(...r){return r=["ready",...r],function(t,i,a){const s=a.get;return a.get=function(){if(r.includes(this.state))return s==null?void 0:s.apply(this);throw new mr(`Attempt to call ${i.toString()} when transport not in ${r}. Await connect() first.`)},a}}var Gk={};at(Gk,"RTVIEvent",()=>_e);var _e;(function(r){r.MessageError="messageError",r.Error="error",r.Connected="connected",r.Disconnected="disconnected",r.TransportStateChanged="transportStateChanged",r.Config="config",r.ConfigDescribe="configDescribe",r.ActionsAvailable="actionsAvailable",r.ParticipantConnected="participantConnected",r.ParticipantLeft="participantLeft",r.TrackStarted="trackStarted",r.TrackedStopped="trackStopped",r.AvailableCamsUpdated="availableCamsUpdated",r.AvailableMicsUpdated="availableMicsUpdated",r.CamUpdated="camUpdated",r.MicUpdated="micUpdated",r.BotConnected="botConnected",r.BotReady="botReady",r.BotDisconnected="botDisconnected",r.BotStartedSpeaking="botStartedSpeaking",r.BotStoppedSpeaking="botStoppedSpeaking",r.RemoteAudioLevel="remoteAudioLevel",r.UserStartedSpeaking="userStartedSpeaking",r.UserStoppedSpeaking="userStoppedSpeaking",r.LocalAudioLevel="localAudioLevel",r.Metrics="metrics",r.UserTranscript="userTranscript",r.BotTranscript="botTranscript",r.BotLlmText="botLlmText",r.BotLlmStarted="botLlmStarted",r.BotLlmStopped="botLlmStopped",r.BotTtsText="botTtsText",r.BotTtsStarted="botTtsStarted",r.BotTtsStopped="botTtsStopped",r.LLMFunctionCall="llmFunctionCall",r.LLMFunctionCallStart="llmFunctionCallStart",r.LLMJsonCompletion="llmJsonCompletion",r.StorageItemStored="storageItemStored",r.BotText="botText"})(_e||(_e={}));var Hk={};at(Hk,"RTVIClientHelper",()=>yd);class yd{constructor(t){this._options=t}set client(t){this._client=t}set service(t){this._service=t}}var Qr={};at(Qr,"RTVI_MESSAGE_LABEL",()=>Rg);at(Qr,"RTVIMessageType",()=>je);at(Qr,"RTVIMessage",()=>Ot);at(Qr,"RTVI_ACTION_TYPE",()=>Ng);at(Qr,"RTVIActionRequest",()=>Bg);at(Qr,"MessageDispatcher",()=>Fg);at(Qr,"VoiceMessage",()=>Yk);const Rg="rtvi-ai";var je;(function(r){r.CLIENT_READY="client-ready",r.UPDATE_CONFIG="update-config",r.GET_CONFIG="get-config",r.DESCRIBE_CONFIG="describe-config",r.DESCRIBE_ACTIONS="describe-actions",r.BOT_READY="bot-ready",r.ERROR="error",r.ERROR_RESPONSE="error-response",r.CONFIG="config",r.CONFIG_AVAILABLE="config-available",r.CONFIG_ERROR="config-error",r.ACTIONS_AVAILABLE="actions-available",r.ACTION_RESPONSE="action-response",r.METRICS="metrics",r.USER_TRANSCRIPTION="user-transcription",r.BOT_TRANSCRIPTION="bot-transcription",r.USER_STARTED_SPEAKING="user-started-speaking",r.USER_STOPPED_SPEAKING="user-stopped-speaking",r.BOT_STARTED_SPEAKING="bot-started-speaking",r.BOT_STOPPED_SPEAKING="bot-stopped-speaking",r.USER_LLM_TEXT="user-llm-text",r.BOT_LLM_TEXT="bot-llm-text",r.BOT_LLM_STARTED="bot-llm-started",r.BOT_LLM_STOPPED="bot-llm-stopped",r.BOT_TTS_TEXT="bot-tts-text",r.BOT_TTS_STARTED="bot-tts-started",r.BOT_TTS_STOPPED="bot-tts-stopped",r.STORAGE_ITEM_STORED="storage-item-stored"})(je||(je={}));class Ot{constructor(t,i,a){this.label=Rg,this.type=t,this.data=i,this.id=a||Fk().slice(0,8)}static clientReady(){return new Ot(je.CLIENT_READY,{})}static updateConfig(t,i=!1){return new Ot(je.UPDATE_CONFIG,{config:t,interrupt:i})}static describeConfig(){return new Ot(je.DESCRIBE_CONFIG,{})}static getBotConfig(){return new Ot(je.GET_CONFIG,{})}static describeActions(){return new Ot(je.DESCRIBE_ACTIONS,{})}}const Ng="action";class Bg extends Ot{constructor(t){super(Ng,t)}}class Fg{constructor(t){this._queue=new Array,this._gcTime=1e4,this._queue=[],this._client=t}dispatch(t){const i=new Promise((a,s)=>{this._queue.push({message:t,timestamp:Date.now(),resolve:a,reject:s})});return console.debug("[MessageDispatcher] dispatch",t),this._client.sendMessage(t),this._gc(),i}async dispatchAction(t,i){const a=new Promise((s,c)=>{this._queue.push({message:t,timestamp:Date.now(),resolve:s,reject:c})});if(console.debug("[MessageDispatcher] action",t),this._client.connected)this._client.sendMessage(t);else{const s=this._client.constructUrl("action");try{await Dg(s,t,this._client.params,c=>{i(c)})}catch{i(new Ot(je.ERROR_RESPONSE,`Action endpoint '${s}' returned an error response`,t.id))}}return this._gc(),a}_resolveReject(t,i=!0){const a=this._queue.find(s=>s.message.id===t.id);return a&&(i?(console.debug("[MessageDispatcher] Resolve",t),a.resolve((t.type===je.ACTION_RESPONSE,t))):(console.debug("[MessageDispatcher] Reject",t),a.reject(t)),this._queue=this._queue.filter(s=>s.message.id!==t.id),console.debug("[MessageDispatcher] Queue",this._queue)),t}resolve(t){return this._resolveReject(t,!0)}reject(t){return this._resolveReject(t,!1)}_gc(){this._queue=this._queue.filter(t=>Date.now()-t.timestamp=0;h--)(p=r[h])&&(c=(s<3?p(c):s>3?p(t,i,c):p(t,i))||c);return s>3&&c&&Object.defineProperty(t,i,c),c};const Qk={connect:"/connect",action:"/action"};class Kk extends Ik{}class _r extends Kk{constructor(t){super(),this.params={...t.params,endpoints:{...Qk,...t.params.endpoints??{}}},this._helpers={},this._transport=t.transport;const i={...t.callbacks,onMessageError:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onMessageError)==null||c.call(s,a),this.emit(_e.MessageError,a)},onError:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onError)==null||c.call(s,a),this.emit(_e.Error,a)},onConnected:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onConnected)==null||s.call(a),this.emit(_e.Connected)},onDisconnected:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onDisconnected)==null||s.call(a),this.emit(_e.Disconnected)},onTransportStateChanged:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onTransportStateChanged)==null||c.call(s,a),this.emit(_e.TransportStateChanged,a)},onConfig:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onConfig)==null||c.call(s,a),this.emit(_e.Config,a)},onConfigDescribe:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onConfigDescribe)==null||c.call(s,a),this.emit(_e.ConfigDescribe,a)},onActionsAvailable:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onActionsAvailable)==null||c.call(s,a),this.emit(_e.ActionsAvailable,a)},onParticipantJoined:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onParticipantJoined)==null||c.call(s,a),this.emit(_e.ParticipantConnected,a)},onParticipantLeft:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onParticipantLeft)==null||c.call(s,a),this.emit(_e.ParticipantLeft,a)},onTrackStarted:(a,s)=>{var c,p;(p=(c=t==null?void 0:t.callbacks)==null?void 0:c.onTrackStarted)==null||p.call(c,a,s),this.emit(_e.TrackStarted,a,s)},onTrackStopped:(a,s)=>{var c,p;(p=(c=t==null?void 0:t.callbacks)==null?void 0:c.onTrackStopped)==null||p.call(c,a,s),this.emit(_e.TrackedStopped,a,s)},onAvailableCamsUpdated:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onAvailableCamsUpdated)==null||c.call(s,a),this.emit(_e.AvailableCamsUpdated,a)},onAvailableMicsUpdated:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onAvailableMicsUpdated)==null||c.call(s,a),this.emit(_e.AvailableMicsUpdated,a)},onCamUpdated:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onCamUpdated)==null||c.call(s,a),this.emit(_e.CamUpdated,a)},onMicUpdated:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onMicUpdated)==null||c.call(s,a),this.emit(_e.MicUpdated,a)},onBotConnected:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onBotConnected)==null||c.call(s,a),this.emit(_e.BotConnected,a)},onBotReady:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onBotReady)==null||c.call(s,a),this.emit(_e.BotReady,a)},onBotDisconnected:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onBotDisconnected)==null||c.call(s,a),this.emit(_e.BotDisconnected,a)},onBotStartedSpeaking:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onBotStartedSpeaking)==null||s.call(a),this.emit(_e.BotStartedSpeaking)},onBotStoppedSpeaking:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onBotStoppedSpeaking)==null||s.call(a),this.emit(_e.BotStoppedSpeaking)},onRemoteAudioLevel:(a,s)=>{var c,p;(p=(c=t==null?void 0:t.callbacks)==null?void 0:c.onRemoteAudioLevel)==null||p.call(c,a,s),this.emit(_e.RemoteAudioLevel,a,s)},onUserStartedSpeaking:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onUserStartedSpeaking)==null||s.call(a),this.emit(_e.UserStartedSpeaking)},onUserStoppedSpeaking:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onUserStoppedSpeaking)==null||s.call(a),this.emit(_e.UserStoppedSpeaking)},onLocalAudioLevel:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onLocalAudioLevel)==null||c.call(s,a),this.emit(_e.LocalAudioLevel,a)},onUserTranscript:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onUserTranscript)==null||c.call(s,a),this.emit(_e.UserTranscript,a)},onBotTranscript:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onBotTranscript)==null||c.call(s,a),this.emit(_e.BotTranscript,a)},onBotLlmText:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onBotLlmText)==null||c.call(s,a),this.emit(_e.BotLlmText,a)},onBotLlmStarted:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onBotLlmStarted)==null||s.call(a),this.emit(_e.BotLlmStarted)},onBotLlmStopped:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onBotLlmStopped)==null||s.call(a),this.emit(_e.BotLlmStopped)},onBotTtsText:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onBotTtsText)==null||c.call(s,a),this.emit(_e.BotTtsText,a)},onBotTtsStarted:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onBotTtsStarted)==null||s.call(a),this.emit(_e.BotTtsStarted)},onBotTtsStopped:()=>{var a,s;(s=(a=t==null?void 0:t.callbacks)==null?void 0:a.onBotTtsStopped)==null||s.call(a),this.emit(_e.BotTtsStopped)},onStorageItemStored:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onStorageItemStored)==null||c.call(s,a),this.emit(_e.StorageItemStored,a)},onBotText:a=>{var s,c;(c=(s=t==null?void 0:t.callbacks)==null?void 0:s.onBotText)==null||c.call(s,a),this.emit(_e.BotText,a)}};this._options={...t,callbacks:i,enableMic:t.enableMic??!0,enableCam:t.enableCam??!1},this._initialize(),console.debug("[RTVI Client] Initialized",this.version)}constructUrl(t){var a;if(!this.params.baseUrl)throw new hn("Base URL not set. Please set rtviClient.params.baseUrl");return this.params.baseUrl.replace(/\/+$/,"")+(((a=this.params.endpoints)==null?void 0:a[t])??"")}async initDevices(){console.debug("[RTVI Client] Initializing devices..."),await this._transport.initDevices()}async connect(){if(["authenticating","connecting","connected","ready"].includes(this._transport.state))throw new hn("Voice client has already been started. Please call disconnect() before starting again.");return this._abortController=new AbortController,new Promise((t,i)=>{(async()=>{var p,h;this._startResolve=t,this._transport.state==="disconnected"&&await this._transport.initDevices(),this._transport.state="authenticating",this._options.timeout&&(this._handshakeTimeout=setTimeout(async()=>{var f;(f=this._abortController)==null||f.abort(),await this.disconnect(),this._transport.state="error",i(new jg)},this._options.timeout));let a;const s=this._options.customConnectHandler,c=this.constructUrl("connect");this.params={...this.params,requestData:{...this.params.requestData,rtvi_client_version:this.version}},console.debug("[RTVI Client] Connecting...",c),console.debug("[RTVI Client] Start params",this.params);try{s?a=await s(this.params,this._handshakeTimeout,this._abortController):a=await fetch(c,{method:"POST",mode:"cors",headers:new Headers({"Content-Type":"application/json",...Object.fromEntries((this.params.headers??new Headers).entries())}),body:JSON.stringify({services:this._options.services,config:this.params.config??this._options.config,...this._options.customBodyParams,...this.params.requestData}),signal:(p=this._abortController)==null?void 0:p.signal}).then(f=>(clearTimeout(this._handshakeTimeout),f.ok?f.json():Promise.reject(f)))}catch(f){if(clearTimeout(this._handshakeTimeout),(h=this._abortController)!=null&&h.signal.aborted)return;if(this._transport.state="error",f instanceof Response){const _=await f.json();i(new Xu(_.info??_.detail??f.statusText,f.status))}else i(new Xu);return}console.debug("[RTVI Client] Auth bundle received",a);try{await this._transport.connect(a,this._abortController)}catch(f){clearTimeout(this._handshakeTimeout),i(f);return}await this._transport.sendReadyMessage()})()})}async disconnect(){this._abortController&&this._abortController.abort(),clearTimeout(this._handshakeTimeout),await this._transport.disconnect(),this._initialize()}_initialize(){this._transport=this._options.transport,this._transport.initialize(this._options,this.handleMessage.bind(this)),this._messageDispatcher=new Fg(this)}get connected(){return["connected","ready"].includes(this._transport.state)}get state(){return this._transport.state}get version(){return Uk(Ig).version}async getAllMics(){return await this._transport.getAllMics()}async getAllCams(){return await this._transport.getAllCams()}get selectedMic(){return this._transport.selectedMic}get selectedCam(){return this._transport.selectedCam}updateMic(t){this._transport.updateMic(t)}updateCam(t){this._transport.updateCam(t)}enableMic(t){this._transport.enableMic(t)}get isMicEnabled(){return this._transport.isMicEnabled}enableCam(t){this._transport.enableCam(t)}get isCamEnabled(){return this._transport.isCamEnabled}tracks(){return this._transport.tracks()}async getConfig(){return(await this._messageDispatcher.dispatch(Ot.getBotConfig())).data.config}async updateConfig(t,i=!1){return console.debug("[RTVI Client] Updating config",t),this._messageDispatcher.dispatch(Ot.updateConfig(t,i))}async describeConfig(){return this._messageDispatcher.dispatch(Ot.describeConfig())}async getServiceOptionsFromConfig(t,i){if(!i&&this.state!=="ready")throw new mr("getServiceOptionsFromConfig called without config array before bot is ready");return Promise.resolve().then(async()=>{if(!t){console.debug("Target service name is required");return}const s=(i??await this.getConfig()).find(c=>c.service===t);if(!s){console.debug("No service with name "+t+" not found in config");return}return s})}async getServiceOptionValueFromConfig(t,i,a){const s=await this.getServiceOptionsFromConfig(t,a);if(!s){console.debug("Service with name "+t+" not found in config");return}const c=s.options.find(p=>p.name===i);return c?c.value:void 0}_updateOrAddOption(t,i){const a=t.findIndex(s=>s.name===i.name);return a!==-1?t.map((s,c)=>c===a?{...s,value:i.value}:s):[...t,{name:i.name,value:i.value}]}async setServiceOptionInConfig(t,i,a){const s=cv(a??await this.getConfig());if(!await this.getServiceOptionsFromConfig(t,s))return console.debug("Service with name '"+t+"' not found in config"),s;const p=Array.isArray(i)?i:[i];for(const h of p){const f=s.find(v=>v.service===t),_=f?this._updateOrAddOption(f.options,h):[{name:h.name,value:h.value}];f?f.options=_:s.push({service:t,options:_})}return s}async setConfigOptions(t,i){let a=cv(i??await this.getConfig());for(const s of t)a=await this.setServiceOptionInConfig(s.service,s.options,a)||a;return a}async action(t){return this._messageDispatcher.dispatchAction(new Bg(t),this.handleMessage.bind(this))}async describeActions(){return this._messageDispatcher.dispatch(Ot.describeActions())}get transportExpiry(){return this._transport.expiry}sendMessage(t){this._transport.sendMessage(t)}handleMessage(t){var i,a,s,c,p,h,f,_,v,S,E,M,D,L,B,W,te,Y,j,P,T,x,R,q,z,ae,re,G,de,Se,Oe,ve,Z,ie,Q,I,J,me,he,d,g,y,C,k,V;switch(console.debug("[RTVI Message]",t),t.type){case je.BOT_READY:clearTimeout(this._handshakeTimeout),(i=this._startResolve)==null||i.call(this,t.data),(s=(a=this._options.callbacks)==null?void 0:a.onBotReady)==null||s.call(a,t.data);break;case je.CONFIG_AVAILABLE:this._messageDispatcher.resolve(t),(p=(c=this._options.callbacks)==null?void 0:c.onConfigDescribe)==null||p.call(c,t.data);break;case je.CONFIG:{const oe=this._messageDispatcher.resolve(t);(f=(h=this._options.callbacks)==null?void 0:h.onConfig)==null||f.call(h,oe.data.config);break}case je.ACTIONS_AVAILABLE:this._messageDispatcher.resolve(t),(v=(_=this._options.callbacks)==null?void 0:_.onActionsAvailable)==null||v.call(_,t.data);break;case je.ACTION_RESPONSE:this._messageDispatcher.resolve(t);break;case je.ERROR_RESPONSE:{const oe=this._messageDispatcher.reject(t);(E=(S=this._options.callbacks)==null?void 0:S.onMessageError)==null||E.call(S,oe);break}case je.ERROR:(D=(M=this._options.callbacks)==null?void 0:M.onError)==null||D.call(M,t);break;case je.USER_STARTED_SPEAKING:(B=(L=this._options.callbacks)==null?void 0:L.onUserStartedSpeaking)==null||B.call(L);break;case je.USER_STOPPED_SPEAKING:(te=(W=this._options.callbacks)==null?void 0:W.onUserStoppedSpeaking)==null||te.call(W);break;case je.BOT_STARTED_SPEAKING:(j=(Y=this._options.callbacks)==null?void 0:Y.onBotStartedSpeaking)==null||j.call(Y);break;case je.BOT_STOPPED_SPEAKING:(T=(P=this._options.callbacks)==null?void 0:P.onBotStoppedSpeaking)==null||T.call(P);break;case je.USER_TRANSCRIPTION:{const oe=t.data;(R=(x=this._options.callbacks)==null?void 0:x.onUserTranscript)==null||R.call(x,oe);break}case je.BOT_TRANSCRIPTION:(z=(q=this._options.callbacks)==null?void 0:q.onBotTranscript)==null||z.call(q,t.data);break;case je.BOT_LLM_TEXT:(re=(ae=this._options.callbacks)==null?void 0:ae.onBotLlmText)==null||re.call(ae,t.data),(de=(G=this._options.callbacks)==null?void 0:G.onBotText)==null||de.call(G,t.data);break;case je.BOT_LLM_STARTED:(Oe=(Se=this._options.callbacks)==null?void 0:Se.onBotLlmStarted)==null||Oe.call(Se);break;case je.BOT_LLM_STOPPED:(Z=(ve=this._options.callbacks)==null?void 0:ve.onBotLlmStopped)==null||Z.call(ve);break;case je.BOT_TTS_TEXT:(Q=(ie=this._options.callbacks)==null?void 0:ie.onBotTtsText)==null||Q.call(ie,t.data);break;case je.BOT_TTS_STARTED:(J=(I=this._options.callbacks)==null?void 0:I.onBotTtsStarted)==null||J.call(I);break;case je.BOT_TTS_STOPPED:(he=(me=this._options.callbacks)==null?void 0:me.onBotTtsStopped)==null||he.call(me);break;case je.METRICS:this.emit(_e.Metrics,t.data),(g=(d=this._options.callbacks)==null?void 0:d.onMetrics)==null||g.call(d,t.data);break;case je.STORAGE_ITEM_STORED:(C=(y=this._options.callbacks)==null?void 0:y.onStorageItemStored)==null||C.call(y,t.data);break;default:{let oe=!1;for(const fe of Object.values(this._helpers))fe.getMessageTypes().includes(t.type)&&(oe=!0,fe.handleMessage(t));oe||(V=(k=this._options.callbacks)==null?void 0:k.onGenericMessage)==null||V.call(k,t.data)}}}registerHelper(t,i){if(this._helpers[t])throw new Error(`Helper with name '${t}' already registered`);if(!(i instanceof yd))throw new Error("Helper must be an instance of RTVIClientHelper");return i.service=t,i.client=this,this._helpers[t]=i,this._helpers[t]}getHelper(t){const i=this._helpers[t];if(!i){console.debug(`Helper targeting service '${t}' not found`);return}return i}unregisterHelper(t){this._helpers[t]&&delete this._helpers[t]}async start(){return this.connect()}async getBotConfig(){return console.warn("VoiceClient.getBotConfig is deprecated. Use getConfig instead."),this.getConfig()}get config(){return console.warn("VoiceClient.config is deprecated. Use getConfig instead."),this._options.config}get services(){return console.warn("VoiceClient.services is deprecated."),this._options.services}set services(t){if(console.warn("VoiceClient.services is deprecated."),!["authenticating","connecting","connected","ready"].includes(this._transport.state))this._options.services=t;else throw new hn("Cannot set services while transport is connected")}}Kr([zi],_r.prototype,"getConfig",null);Kr([zi],_r.prototype,"updateConfig",null);Kr([zi],_r.prototype,"describeConfig",null);Kr([zi],_r.prototype,"describeActions",null);Kr([Jk("connected","ready")],_r.prototype,"transportExpiry",null);Kr([zi],_r.prototype,"sendMessage",null);Kr([zi],_r.prototype,"getBotConfig",null);var Ug={};at(Ug,"LLMMessageType",()=>hr);at(Ug,"LLMHelper",()=>Xk);var hr;(function(r){r.LLM_FUNCTION_CALL="llm-function-call",r.LLM_FUNCTION_CALL_START="llm-function-call-start",r.LLM_FUNCTION_CALL_RESULT="llm-function-call-result",r.LLM_JSON_COMPLETION="llm-json-completion"})(hr||(hr={}));class Xk extends yd{constructor(t){super(t),this._functionCallCallback=null}getMessageTypes(){return Object.values(hr)}async getContext(){if(this._client.state!=="ready")throw new mr("getContext called while transport not in ready state");return(await this._client.action({service:this._service,action:"get_context"})).data.result}async setContext(t,i=!1){if(this._client.state!=="ready")throw new mr("setContext called while transport not in ready state");return!!(await this._client.action({service:this._service,action:"set_context",arguments:[{name:"messages",value:t.messages},{name:"interrupt",value:i}]})).data.result}async appendToMessages(t,i=!1){if(this._client.state!=="ready")throw new mr("setContext called while transport not in ready state");return!!(await this._client.action({service:this._service,action:"append_to_messages",arguments:[{name:"messages",value:[t]},{name:"run_immediately",value:i}]})).data.result}async run(t=!1){if(this._client.state==="ready")return this._client.action({service:this._service,action:"run",arguments:[{name:"interrupt",value:t}]})}handleFunctionCall(t){this._functionCallCallback=t}handleMessage(t){var i,a,s,c,p,h;switch(t.type){case hr.LLM_JSON_COMPLETION:(a=(i=this._options.callbacks)==null?void 0:i.onLLMJsonCompletion)==null||a.call(i,t.data),this._client.emit(_e.LLMJsonCompletion,t.data);break;case hr.LLM_FUNCTION_CALL:{const f=t.data;if((c=(s=this._options.callbacks)==null?void 0:s.onLLMFunctionCall)==null||c.call(s,t.data),this._client.emit(_e.LLMFunctionCall,t.data),this._functionCallCallback){const _={functionName:f.function_name,arguments:f.args};if(this._client.state==="ready")this._functionCallCallback(_).then(v=>{this._client.sendMessage(new Ot(hr.LLM_FUNCTION_CALL_RESULT,{function_name:f.function_name,tool_call_id:f.tool_call_id,arguments:f.args,result:v}))});else throw new mr("Attempted to send a function call result from bot while transport not in ready state")}break}case hr.LLM_FUNCTION_CALL_START:{const f=t.data;(h=(p=this._options.callbacks)==null?void 0:p.onLLMFunctionCallStart)==null||h.call(p,f.function_name),this._client.emit(_e.LLMFunctionCallStart,f.function_name);break}}}}var Zk={};at(Zk,"Transport",()=>e1);class e1{constructor(){this._state="disconnected",this._expiry=void 0}get expiry(){return this._expiry}}const t1=U.createContext({}),_d=()=>{const{client:r}=U.useContext(t1);return r},Cn=(r,t)=>{const i=_d();U.useEffect(()=>{if(i)return i.on(r,t),()=>{i.off(r,t)}},[r,t,i])},n1=Ee(null),r1=Ee(null),i1=Ee(null),o1=Ee(null),fv=Qo(({local:r,trackType:t})=>r?t==="audio"?n1:r1:t==="audio"?i1:o1),$g=(r,t)=>{const i=_d(),a=$n(fv({local:t==="local",trackType:r})),s=Pe(U.useCallback((c,p,h,f,_)=>{const v=fv({local:_,trackType:f}),S=c(v);(S==null?void 0:S.id)!==h.id&&p(v,h)},[t,a,r]));return Cn(_e.TrackStarted,U.useCallback((c,p)=>{s(c,c.kind,!!(p!=null&&p.local))},[])),U.useEffect(()=>{var h;if(!i)return;const c=i.tracks(),p=(h=c==null?void 0:c[t])==null?void 0:h[r];p&&s(p,r,t==="local")},[t,r,s,i]),a};function a1(...r){return U.useCallback(t=>{for(let i=0;i{const te=E.play();te!==void 0&&te.then(()=>{E.controls=!1}).catch(Y=>{E.controls=!0,console.warn("Failed to play video",Y)})},D=()=>{E.paused&&M()},L=()=>{E.style.transform="scale(1)"},B=()=>{E.style.transform="",setTimeout(()=>{E.paused&&M()},100)},W=()=>{document.visibilityState!=="hidden"&&E.paused&&M()};return E.addEventListener("canplay",D),E.addEventListener("enterpictureinpicture",L),E.addEventListener("leavepictureinpicture",B),document.addEventListener("visibilitychange",W),()=>{E.removeEventListener("canplay",D),E.removeEventListener("enterpictureinpicture",L),E.removeEventListener("leavepictureinpicture",B),document.removeEventListener("visibilitychange",W)}},[]),U.useEffect(function(){const E=_.current;if(!(!E||!f))return E.srcObject=new MediaStream([f]),E.load(),()=>{E.srcObject=null,E.load()}},[f,f==null?void 0:f.id]),U.useEffect(function(){const E=_.current;if(!s||!E)return;let M;function D(){M&&cancelAnimationFrame(M),M=requestAnimationFrame(()=>{const L=_.current;if(!L||document.hidden)return;const B=L.videoWidth,W=L.videoHeight;B&&W&&(s==null||s({aspectRatio:B/W,height:W,width:B}))})}return D(),E.addEventListener("loadedmetadata",D),E.addEventListener("resize",D),()=>{M&&cancelAnimationFrame(M),E.removeEventListener("loadedmetadata",D),E.removeEventListener("resize",D)}},[s]),Ve.jsx("video",{autoPlay:!0,muted:!0,playsInline:!0,ref:v,style:{objectFit:i,transform:a?"scale(-1, 1)":"",...c},...p})});l1.displayName="RTVIClientVideo";const c1=Ae.memo(({backgroundColor:r="transparent",barColor:t="black",barWidth:i=30,barGap:a=12,barMaxHeight:s=120,participantType:c})=>{const p=U.useRef(null),h=$g("audio",c);return U.useEffect(()=>{if(!p.current)return;const f=5*i+4*a,_=s,v=p.current,S=2,E=()=>{v.width=f*S,v.height=_*S,v.style.width=`${f}px`,v.style.height=`${_}px`,M.lineCap="round",M.scale(S,S)},M=v.getContext("2d");if(E(),!h)return;const D=new AudioContext,L=D.createMediaStreamSource(new MediaStream([h])),B=D.createAnalyser();B.fftSize=1024,L.connect(B);const W=new Uint8Array(B.frequencyBinCount);M.lineCap="round";const te=[{startFreq:85,endFreq:255,smoothValue:0},{startFreq:255,endFreq:500,smoothValue:0},{startFreq:500,endFreq:2e3,smoothValue:0},{startFreq:2e3,endFreq:4e3,smoothValue:0},{startFreq:4e3,endFreq:8e3,smoothValue:0}],Y=T=>{const x=D.sampleRate/2;return Math.round(T/x*(B.frequencyBinCount-1))};function j(){B.getByteFrequencyData(W),M.clearRect(0,0,v.width/S,v.height/S),M.fillStyle=r,M.fillRect(0,0,v.width/S,v.height/S);let T=!1;const x=te.length*i+(te.length-1)*a,R=(v.width/S-x)/2,q=i/2;te.forEach((z,ae)=>{const re=Y(z.startFreq),G=Y(z.endFreq),de=W.slice(re,G),Se=de.reduce((I,J)=>I+J,0)/de.length,Oe=.2;Se<1?z.smoothValue=Math.max(z.smoothValue-Oe*5,0):(z.smoothValue=z.smoothValue+(Se-z.smoothValue)*Oe,T=!0);const ve=R+ae*(i+a),Z=Math.min(z.smoothValue/255*s,s),ie=Math.max(v.height/S/2-Z/2,q),Q=Math.min(v.height/S/2+Z/2,v.height/S-q);z.smoothValue>0?(M.beginPath(),M.moveTo(ve+i/2,ie),M.lineTo(ve+i/2,Q),M.lineWidth=i,M.strokeStyle=t,M.stroke()):(M.beginPath(),M.arc(ve+i/2,v.height/S/2,q,0,2*Math.PI),M.fillStyle=t,M.fill(),M.closePath())}),T||P(q,t),requestAnimationFrame(j)}function P(T,x){const R=te.length*i+(te.length-1)*a,q=(v.width/S-R)/2,z=v.height/S/2;te.forEach((ae,re)=>{const G=q+re*(i+a);M.beginPath(),M.arc(G+i/2,z,T,0,2*Math.PI),M.fillStyle=x,M.fill(),M.closePath()})}return j(),window.addEventListener("resize",E),()=>{D.close(),window.removeEventListener("resize",E)}},[r,t,a,s,i,h]),Ve.jsx("canvas",{ref:p,style:{display:"block",width:"100%",height:"100%"}})});c1.displayName="VoiceVisualizer";Ee([]);Ee([]);Ee({});Ee({});const u1=Ee("disconnected"),d1=()=>{const[r,t]=zw(u1);return Cn(_e.TransportStateChanged,t),r};function f1(){const r=d1();return Ve.jsxs("div",{className:"status",children:["Status: ",Ve.jsx("span",{children:r})]})}function p1(){const r=U.useRef(null),t=_d(),i=U.useCallback(a=>{if(!r.current)return;const s=document.createElement("div");s.textContent=`${new Date().toISOString()} - ${a}`,a.startsWith("User: ")?s.style.color="#2196F3":a.startsWith("Bot: ")&&(s.style.color="#4CAF50"),r.current.appendChild(s),r.current.scrollTop=r.current.scrollHeight},[]);return Cn(_e.TransportStateChanged,U.useCallback(a=>{i(`Transport state changed: ${a}`)},[i])),Cn(_e.BotConnected,U.useCallback(a=>{i(`Bot connected: ${JSON.stringify(a)}`)},[i])),Cn(_e.BotDisconnected,U.useCallback(a=>{i(`Bot disconnected: ${JSON.stringify(a)}`)},[i])),Cn(_e.TrackStarted,U.useCallback((a,s)=>{i(`Track started: ${a.kind} from ${(s==null?void 0:s.name)||"unknown"}`)},[i])),Cn(_e.TrackedStopped,U.useCallback((a,s)=>{i(`Track stopped: ${a.kind} from ${(s==null?void 0:s.name)||"unknown"}`)},[i])),Cn(_e.BotReady,U.useCallback(()=>{var s,c;if(i("Bot ready"),!t)return;const a=t.tracks();i(`Available tracks: ${JSON.stringify({local:{audio:!!a.local.audio,video:!!a.local.video},bot:{audio:!!((s=a.bot)!=null&&s.audio),video:!!((c=a.bot)!=null&&c.video)}})}`)},[t,i])),Cn(_e.UserTranscript,U.useCallback(a=>{a.final&&i(`User: ${a.text}`)},[i])),Cn(_e.BotTranscript,U.useCallback(a=>{i(`Bot: ${a.text}`)},[i])),Ve.jsxs("div",{className:"debug-panel",children:[Ve.jsx("h3",{children:"Debug Info"}),Ve.jsx("div",{ref:r,className:"debug-log"})]})}function h1(){const{participants:r}=Lg();console.log("transportParticipants",r);const t=r.length>0?[...r,{id:"local",username:"You (Local)"}]:[{id:"unknown",username:"Waiting for participants..."}];return Ve.jsxs("div",{className:"participants-container",children:[Ve.jsx("h3",{children:"Connected Participants"}),Ve.jsx("div",{className:"participants-grid",children:t.map(i=>Ve.jsx("div",{className:"participant-box",children:Ve.jsx("span",{children:i.username})},i.id))})]})}function m1(){return Ve.jsxs("div",{className:"app",children:[Ve.jsxs("div",{className:"status-bar",children:[Ve.jsx(f1,{}),Ve.jsx(Tk,{}),Ve.jsx(h1,{})]}),Ve.jsx(p1,{})]})}function v1(){return Ve.jsx(Ek,{children:Ve.jsx(m1,{})})}K_.createRoot(document.getElementById("root")).render(Ve.jsx(Ae.StrictMode,{children:Ve.jsx(v1,{})}))});export default g1();