@cliniq360/eigi-chat 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/eigi-chat.js CHANGED
@@ -1,4 +1,4 @@
1
- var EigiChatInternal=function(e){"use strict";var t=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&s(e,n,t[n]);if(i)for(var n of i(t))o.call(t,n)&&s(e,n,t[n]);return e},c=(e,t)=>n(e,r(t)),u=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&i)for(var r of i(e))t.indexOf(r)<0&&o.call(e,r)&&(n[r]=e[r]);return n},d=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(Qn){i(Qn)}},o=e=>{try{s(n.throw(e))}catch(Qn){i(Qn)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p,h,m={exports:{}},g={};var v,y,b=(h||(h=1,m.exports=function(){if(p)return g;p=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==n.key&&(i=""+n.key),"key"in n)for(var a in r={},n)"key"!==a&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:i,ref:void 0!==n?n:null,props:r}}return g.Fragment=t,g.jsx=n,g.jsxs=n,g}()),m.exports),w={exports:{}},k={};function S(){if(v)return k;v=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,m={};function g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var w=b.prototype=new y;w.constructor=b,h(w,g.prototype),w.isPureReactComponent=!0;var S=Array.isArray;function _(){}var x={H:null,A:null,T:null,S:null},C=Object.prototype.hasOwnProperty;function E(t,n,r){var i=r.ref;return{$$typeof:e,type:t,key:n,ref:void 0!==i?i:null,props:r}}function T(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var M=/\/+/g;function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function A(n,r,i,a,o){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,c,d=!1;if(null===n)d=!0;else switch(s){case"bigint":case"string":case"number":d=!0;break;case"object":switch(n.$$typeof){case e:case t:d=!0;break;case u:return A((d=n._init)(n._payload),r,i,a,o)}}if(d)return o=o(n),d=""===a?"."+P(n,0):a,S(o)?(i="",null!=d&&(i=d.replace(M,"$&/")+"/"),A(o,r,i,"",function(e){return e})):null!=o&&(T(o)&&(l=o,c=i+(null==o.key||n&&n.key===o.key?"":(""+o.key).replace(M,"$&/")+"/")+d,o=E(l.type,c,l.props)),r.push(o)),1;d=0;var p,h=""===a?".":a+":";if(S(n))for(var m=0;m<n.length;m++)d+=A(a=n[m],r,i,s=h+P(a,m),o);else if("function"==typeof(m=null===(p=n)||"object"!=typeof p?null:"function"==typeof(p=f&&p[f]||p["@@iterator"])?p:null))for(n=m.call(n),m=0;!(a=n.next()).done;)d+=A(a=a.value,r,i,s=h+P(a,m++),o);else if("object"===s){if("function"==typeof n.then)return A(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(_,_):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),r,i,a,o);throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return d}function O(e,t,n){if(null==e)return e;var r=[],i=0;return A(e,r,"","",function(e){return t.call(n,e,i++)}),r}function N(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var L="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},j={map:O,forEach:function(e,t,n){O(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};return k.Activity=d,k.Children=j,k.Component=g,k.Fragment=n,k.Profiler=i,k.PureComponent=b,k.StrictMode=r,k.Suspense=l,k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,k.__COMPILER_RUNTIME={__proto__:null,c:function(e){return x.H.useMemoCache(e)}},k.cache=function(e){return function(){return e.apply(null,arguments)}},k.cacheSignal=function(){return null},k.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=h({},e.props),i=e.key;if(null!=t)for(a in void 0!==t.key&&(i=""+t.key),t)!C.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(r[a]=t[a]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},k.createContext=function(e){return(e={$$typeof:o,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:a,_context:e},e},k.createElement=function(e,t,n){var r,i={},a=null;if(null!=t)for(r in void 0!==t.key&&(a=""+t.key),t)C.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(i[r]=t[r]);var o=arguments.length-2;if(1===o)i.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps)void 0===i[r]&&(i[r]=o[r]);return E(e,a,i)},k.createRef=function(){return{current:null}},k.forwardRef=function(e){return{$$typeof:s,render:e}},k.isValidElement=T,k.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:N}},k.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},k.startTransition=function(e){var t=x.T,n={};x.T=n;try{var r=e(),i=x.S;null!==i&&i(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(_,L)}catch(a){L(a)}finally{null!==t&&null!==n.types&&(t.types=n.types),x.T=t}},k.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},k.use=function(e){return x.H.use(e)},k.useActionState=function(e,t,n){return x.H.useActionState(e,t,n)},k.useCallback=function(e,t){return x.H.useCallback(e,t)},k.useContext=function(e){return x.H.useContext(e)},k.useDebugValue=function(){},k.useDeferredValue=function(e,t){return x.H.useDeferredValue(e,t)},k.useEffect=function(e,t){return x.H.useEffect(e,t)},k.useEffectEvent=function(e){return x.H.useEffectEvent(e)},k.useId=function(){return x.H.useId()},k.useImperativeHandle=function(e,t,n){return x.H.useImperativeHandle(e,t,n)},k.useInsertionEffect=function(e,t){return x.H.useInsertionEffect(e,t)},k.useLayoutEffect=function(e,t){return x.H.useLayoutEffect(e,t)},k.useMemo=function(e,t){return x.H.useMemo(e,t)},k.useOptimistic=function(e,t){return x.H.useOptimistic(e,t)},k.useReducer=function(e,t,n){return x.H.useReducer(e,t,n)},k.useRef=function(e){return x.H.useRef(e)},k.useState=function(e){return x.H.useState(e)},k.useSyncExternalStore=function(e,t,n){return x.H.useSyncExternalStore(e,t,n)},k.useTransition=function(){return x.H.useTransition()},k.version="19.2.3",k}function _(){return y||(y=1,w.exports=S()),w.exports}var x=_();const C=f(x);var E,T,M={exports:{}},P={},A={exports:{}},O={};function N(){return T||(T=1,A.exports=(E||(E=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<i(a,t)))break e;e[r]=t,e[n]=a,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>i(l,n))c<a&&0>i(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<a&&0>i(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(l,i)}i=n(c)}}function k(e){if(m=!1,w(e),!h)if(null!==n(l))h=!0,_||(_=!0,S());else{var t=n(c);null!==t&&O(k,t.startTime-e)}}var S,_=!1,x=-1,C=5,E=-1;function T(){return!(!g&&e.unstable_now()-E<C)}function M(){if(g=!1,_){var t=e.unstable_now();E=t;var i=!0;try{e:{h=!1,m&&(m=!1,y(x),x=-1),p=!0;var a=f;try{t:{for(w(t),d=n(l);null!==d&&!(d.expirationTime>t&&T());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,w(t),i=!0;break t}d===n(l)&&r(l),w(t)}else r(l);d=n(l)}if(null!==d)i=!0;else{var u=n(c);null!==u&&O(k,u.startTime-t),i=!1}}break e}finally{d=null,f=a,p=!1}i=void 0}}finally{i?S():_=!1}}}if("function"==typeof b)S=function(){b(M)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,A=P.port2;P.port1.onmessage=M,S=function(){A.postMessage(null)}}else S=function(){v(M,0)};function O(t,n){x=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(r.sortIndex=a,t(c,r),null===n(l)&&r===n(c)&&(m?(y(x),x=-1):m=!0,O(k,a-o))):(r.sortIndex=s,t(l,r),h||p||(h=!0,_||(_=!0,S()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(O)),O)),A.exports}var L,j,I,R,F={exports:{}},D={};function B(){if(L)return D;L=1;var e=_();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return D.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,D.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:i,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,n,null,r)},D.flushSync=function(e){var t=a.T,n=r.p;try{if(a.T=null,r.p=2,e)return e()}finally{a.T=t,r.p=n,r.d.f()}},D.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,r.d.C(e,t))},D.prefetchDNS=function(e){"string"==typeof e&&r.d.D(e)},D.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,i=o(n,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?r.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:i,integrity:a,fetchPriority:s}):"script"===n&&r.d.X(e,{crossOrigin:i,integrity:a,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},D.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=o(t.as,t.crossOrigin);r.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&r.d.M(e)},D.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,i=o(n,t.crossOrigin);r.d.L(e,n,{crossOrigin:i,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},D.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=o(t.as,t.crossOrigin);r.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else r.d.m(e)},D.requestFormReset=function(e){r.d.r(e)},D.unstable_batchedUpdates=function(e,t){return e(t)},D.useFormState=function(e,t,n){return a.H.useFormState(e,t,n)},D.useFormStatus=function(){return a.H.useHostTransitionStatus()},D.version="19.2.3",D}function z(){if(j)return F.exports;return j=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),F.exports=B(),F.exports}
1
+ var EigiChatInternal=function(e){"use strict";var t=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&s(e,n,t[n]);if(i)for(var n of i(t))o.call(t,n)&&s(e,n,t[n]);return e},c=(e,t)=>n(e,r(t)),u=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&i)for(var r of i(e))t.indexOf(r)<0&&o.call(e,r)&&(n[r]=e[r]);return n},d=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(Hn){i(Hn)}},o=e=>{try{s(n.throw(e))}catch(Hn){i(Hn)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p,h,m={exports:{}},g={};var v,y,b=(h||(h=1,m.exports=function(){if(p)return g;p=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==n.key&&(i=""+n.key),"key"in n)for(var a in r={},n)"key"!==a&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:i,ref:void 0!==n?n:null,props:r}}return g.Fragment=t,g.jsx=n,g.jsxs=n,g}()),m.exports),w={exports:{}},k={};function S(){if(v)return k;v=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,m={};function g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var w=b.prototype=new y;w.constructor=b,h(w,g.prototype),w.isPureReactComponent=!0;var S=Array.isArray;function _(){}var x={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function C(t,n,r){var i=r.ref;return{$$typeof:e,type:t,key:n,ref:void 0!==i?i:null,props:r}}function T(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var M=/\/+/g;function P(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function A(n,r,i,a,o){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,c,d=!1;if(null===n)d=!0;else switch(s){case"bigint":case"string":case"number":d=!0;break;case"object":switch(n.$$typeof){case e:case t:d=!0;break;case u:return A((d=n._init)(n._payload),r,i,a,o)}}if(d)return o=o(n),d=""===a?"."+P(n,0):a,S(o)?(i="",null!=d&&(i=d.replace(M,"$&/")+"/"),A(o,r,i,"",function(e){return e})):null!=o&&(T(o)&&(l=o,c=i+(null==o.key||n&&n.key===o.key?"":(""+o.key).replace(M,"$&/")+"/")+d,o=C(l.type,c,l.props)),r.push(o)),1;d=0;var p,h=""===a?".":a+":";if(S(n))for(var m=0;m<n.length;m++)d+=A(a=n[m],r,i,s=h+P(a,m),o);else if("function"==typeof(m=null===(p=n)||"object"!=typeof p?null:"function"==typeof(p=f&&p[f]||p["@@iterator"])?p:null))for(n=m.call(n),m=0;!(a=n.next()).done;)d+=A(a=a.value,r,i,s=h+P(a,m++),o);else if("object"===s){if("function"==typeof n.then)return A(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(_,_):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),r,i,a,o);throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return d}function O(e,t,n){if(null==e)return e;var r=[],i=0;return A(e,r,"","",function(e){return t.call(n,e,i++)}),r}function N(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var L="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},j={map:O,forEach:function(e,t,n){O(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};return k.Activity=d,k.Children=j,k.Component=g,k.Fragment=n,k.Profiler=i,k.PureComponent=b,k.StrictMode=r,k.Suspense=l,k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,k.__COMPILER_RUNTIME={__proto__:null,c:function(e){return x.H.useMemoCache(e)}},k.cache=function(e){return function(){return e.apply(null,arguments)}},k.cacheSignal=function(){return null},k.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=h({},e.props),i=e.key;if(null!=t)for(a in void 0!==t.key&&(i=""+t.key),t)!E.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(r[a]=t[a]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return C(e.type,i,r)},k.createContext=function(e){return(e={$$typeof:o,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:a,_context:e},e},k.createElement=function(e,t,n){var r,i={},a=null;if(null!=t)for(r in void 0!==t.key&&(a=""+t.key),t)E.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(i[r]=t[r]);var o=arguments.length-2;if(1===o)i.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps)void 0===i[r]&&(i[r]=o[r]);return C(e,a,i)},k.createRef=function(){return{current:null}},k.forwardRef=function(e){return{$$typeof:s,render:e}},k.isValidElement=T,k.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:N}},k.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},k.startTransition=function(e){var t=x.T,n={};x.T=n;try{var r=e(),i=x.S;null!==i&&i(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(_,L)}catch(a){L(a)}finally{null!==t&&null!==n.types&&(t.types=n.types),x.T=t}},k.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},k.use=function(e){return x.H.use(e)},k.useActionState=function(e,t,n){return x.H.useActionState(e,t,n)},k.useCallback=function(e,t){return x.H.useCallback(e,t)},k.useContext=function(e){return x.H.useContext(e)},k.useDebugValue=function(){},k.useDeferredValue=function(e,t){return x.H.useDeferredValue(e,t)},k.useEffect=function(e,t){return x.H.useEffect(e,t)},k.useEffectEvent=function(e){return x.H.useEffectEvent(e)},k.useId=function(){return x.H.useId()},k.useImperativeHandle=function(e,t,n){return x.H.useImperativeHandle(e,t,n)},k.useInsertionEffect=function(e,t){return x.H.useInsertionEffect(e,t)},k.useLayoutEffect=function(e,t){return x.H.useLayoutEffect(e,t)},k.useMemo=function(e,t){return x.H.useMemo(e,t)},k.useOptimistic=function(e,t){return x.H.useOptimistic(e,t)},k.useReducer=function(e,t,n){return x.H.useReducer(e,t,n)},k.useRef=function(e){return x.H.useRef(e)},k.useState=function(e){return x.H.useState(e)},k.useSyncExternalStore=function(e,t,n){return x.H.useSyncExternalStore(e,t,n)},k.useTransition=function(){return x.H.useTransition()},k.version="19.2.3",k}function _(){return y||(y=1,w.exports=S()),w.exports}var x=_();const E=f(x);var C,T,M={exports:{}},P={},A={exports:{}},O={};function N(){return T||(T=1,A.exports=(C||(C=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<i(a,t)))break e;e[r]=t,e[n]=a,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>i(l,n))c<a&&0>i(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<a&&0>i(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,g=!1,v="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(l,i)}i=n(c)}}function k(e){if(m=!1,w(e),!h)if(null!==n(l))h=!0,_||(_=!0,S());else{var t=n(c);null!==t&&O(k,t.startTime-e)}}var S,_=!1,x=-1,E=5,C=-1;function T(){return!(!g&&e.unstable_now()-C<E)}function M(){if(g=!1,_){var t=e.unstable_now();C=t;var i=!0;try{e:{h=!1,m&&(m=!1,y(x),x=-1),p=!0;var a=f;try{t:{for(w(t),d=n(l);null!==d&&!(d.expirationTime>t&&T());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,w(t),i=!0;break t}d===n(l)&&r(l),w(t)}else r(l);d=n(l)}if(null!==d)i=!0;else{var u=n(c);null!==u&&O(k,u.startTime-t),i=!1}}break e}finally{d=null,f=a,p=!1}i=void 0}}finally{i?S():_=!1}}}if("function"==typeof b)S=function(){b(M)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,A=P.port2;P.port1.onmessage=M,S=function(){A.postMessage(null)}}else S=function(){v(M,0)};function O(t,n){x=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(r.sortIndex=a,t(c,r),null===n(l)&&r===n(c)&&(m?(y(x),x=-1):m=!0,O(k,a-o))):(r.sortIndex=s,t(l,r),h||p||(h=!0,_||(_=!0,S()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(O)),O)),A.exports}var L,j,I,R,F={exports:{}},D={};function B(){if(L)return D;L=1;var e=_();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return D.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,D.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:i,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,n,null,r)},D.flushSync=function(e){var t=a.T,n=r.p;try{if(a.T=null,r.p=2,e)return e()}finally{a.T=t,r.p=n,r.d.f()}},D.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,r.d.C(e,t))},D.prefetchDNS=function(e){"string"==typeof e&&r.d.D(e)},D.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,i=o(n,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?r.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:i,integrity:a,fetchPriority:s}):"script"===n&&r.d.X(e,{crossOrigin:i,integrity:a,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},D.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=o(t.as,t.crossOrigin);r.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&r.d.M(e)},D.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,i=o(n,t.crossOrigin);r.d.L(e,n,{crossOrigin:i,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},D.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=o(t.as,t.crossOrigin);r.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else r.d.m(e)},D.requestFormReset=function(e){r.d.r(e)},D.unstable_batchedUpdates=function(e,t){return e(t)},D.useFormState=function(e,t,n){return a.H.useFormState(e,t,n)},D.useFormStatus=function(){return a.H.useHostTransitionStatus()},D.version="19.2.3",D}function z(){if(j)return F.exports;return j=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),F.exports=B(),F.exports}
2
2
  /**
3
3
  * @license React
4
4
  * react-dom-client.production.js
@@ -7,42 +7,42 @@ var EigiChatInternal=function(e){"use strict";var t=Object.defineProperty,n=Obje
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */function U(){if(I)return P;I=1;var e=N(),t=_(),n=z();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function a(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function o(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function s(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function l(e){if(a(e)!==e)throw Error(r(188))}function c(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=c(e)))return t;e=e.sibling}return null}var u=Object.assign,d=Symbol.for("react.element"),f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),E=Symbol.for("react.memo_cache_sentinel"),T=Symbol.iterator;function M(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=T&&e[T]||e["@@iterator"])?e:null}var A=Symbol.for("react.client.reference");function O(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===A?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case h:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList";case C:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case p:return"Portal";case y:return e.displayName||"Context";case v:return(e._context.displayName||"Context")+".Consumer";case b:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case S:return null!==(t=e.displayName||null)?t:O(e.type)||"Memo";case x:t=e._payload,e=e._init;try{return O(e(t))}catch(n){}}return null}var L=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},D=[],B=-1;function U(e){return{current:e}}function V(e){0>B||(e.current=D[B],D[B]=null,B--)}function $(e,t){B++,D[B]=e.current,e.current=t}var W,q,H=U(null),J=U(null),G=U(null),Q=U(null);function Y(e,t){switch($(G,t),$(J,e),$(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=kd(t=wd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(H),$(H,e)}function K(){V(H),V(J),V(G)}function X(e){null!==e.memoizedState&&$(Q,e);var t=H.current,n=kd(t,e.type);t!==n&&($(J,e),$(H,n))}function Z(e){J.current===e&&(V(H),V(J)),Q.current===e&&(V(Q),hf._currentValue=F)}function ee(e){if(void 0===W)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);W=t&&t[1]||"",q=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+W+e+q}var te=!1;function ne(e,t){if(!e||te)return"";te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(i){var r=i}Reflect.construct(e,[],n)}else{try{n.call()}catch(a){r=a}e.call(n.prototype)}}else{try{throw Error()}catch(o){r=o}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(s){if(s&&r&&"string"==typeof s.stack)return[s.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var l=o.split("\n"),c=s.split("\n");for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===c.length)for(r=l.length-1,i=c.length-1;1<=r&&0<=i&&l[r]!==c[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==c[i]){if(1!==r||1!==i)do{if(r--,0>--i||l[r]!==c[i]){var u="\n"+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=r&&0<=i);break}}}finally{te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ee(n):""}function re(e,t){switch(e.tag){case 26:case 27:case 5:return ee(e.type);case 16:return ee("Lazy");case 13:return e.child!==t&&null!==t?ee("Suspense Fallback"):ee("Suspense");case 19:return ee("SuspenseList");case 0:case 15:return ne(e.type,!1);case 11:return ne(e.type.render,!1);case 1:return ne(e.type,!0);case 31:return ee("Activity");default:return""}}function ie(e){try{var t="",n=null;do{t+=re(e,n),n=e,e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}var ae=Object.prototype.hasOwnProperty,oe=e.unstable_scheduleCallback,se=e.unstable_cancelCallback,le=e.unstable_shouldYield,ce=e.unstable_requestPaint,ue=e.unstable_now,de=e.unstable_getCurrentPriorityLevel,fe=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,he=e.unstable_NormalPriority,me=e.unstable_LowPriority,ge=e.unstable_IdlePriority,ve=e.log,ye=e.unstable_setDisableYieldValue,be=null,we=null;function ke(e){if("function"==typeof ve&&ye(e),we&&"function"==typeof we.setStrictMode)try{we.setStrictMode(be,e)}catch(t){}}var Se=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(_e(e)/xe|0)|0},_e=Math.log,xe=Math.LN2;var Ce=256,Ee=262144,Te=4194304;function Me(e){var t=42&e;if(0!==t)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pe(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=134217727&r;return 0!==s?0!==(r=s&~a)?i=Me(r):0!==(o&=s)?i=Me(o):n||0!==(n=s&~e)&&(i=Me(n)):0!==(s=r&~a)?i=Me(s):0!==o?i=Me(o):n||0!==(n=r&~e)&&(i=Me(n)),0===i?0:0!==t&&t!==i&&0===(t&a)&&((a=i&-i)>=(n=t&-t)||32===a&&4194048&n)?t:i}function Ae(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Oe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;default:return-1}}function Ne(){var e=Te;return!(62914560&(Te<<=1))&&(Te=4194304),e}function Le(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function je(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ie(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Se(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Re(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Se(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Fe(e,t){var n=t&-t;return 0!==((n=42&n?1:De(n))&(e.suspendedLanes|t))?0:n}function De(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Be(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function ze(){var e=R.p;return 0!==e?e:void 0===(e=window.event)?32:Af(e.type)}function Ue(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var Ve=Math.random().toString(36).slice(2),$e="__reactFiber$"+Ve,We="__reactProps$"+Ve,qe="__reactContainer$"+Ve,He="__reactEvents$"+Ve,Je="__reactListeners$"+Ve,Ge="__reactHandles$"+Ve,Qe="__reactResources$"+Ve,Ye="__reactMarker$"+Ve;function Ke(e){delete e[$e],delete e[We],delete e[He],delete e[Je],delete e[Ge]}function Xe(e){var t=e[$e];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qe]||n[$e]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Bd(e);null!==e;){if(n=e[$e])return n;e=Bd(e)}return t}n=(e=n).parentNode}return null}function Ze(e){if(e=e[$e]||e[qe]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function et(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(r(33))}function tt(e){var t=e[Qe];return t||(t=e[Qe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Ye]=!0}var rt=new Set,it={};function at(e,t){ot(e,t),ot(e+"Capture",t)}function ot(e,t){for(it[e]=t,e=0;e<t.length;e++)rt.add(t[e])}var st=RegExp("^[: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]*$"),lt={},ct={};function ut(e,t,n){if(i=t,ae.call(ct,i)||!ae.call(lt,i)&&(st.test(i)?ct[i]=!0:(lt[i]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var i}function dt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function ft(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function pt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ht(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function mt(e){if(!e._valueTracker){var t=ht(e)?"checked":"value";e._valueTracker=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function gt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ht(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function vt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(dr){return e.body}}var yt=/[\n"\\]/g;function bt(e){return e.replace(yt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function wt(e,t,n,r,i,a,o,s){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+pt(t)):e.value!==""+pt(t)&&(e.value=""+pt(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?St(e,o,pt(t)):null!=n?St(e,o,pt(n)):null!=r&&e.removeAttribute("value"),null==i&&null!=a&&(e.defaultChecked=!!a),null!=i&&(e.checked=i&&"function"!=typeof i&&"symbol"!=typeof i),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+pt(s):e.removeAttribute("name")}function kt(e,t,n,r,i,a,o,s){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(("submit"===a||"reset"===a)&&null==t)return void mt(e);n=null!=n?""+pt(n):"",t=null!=t?""+pt(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:i)&&"symbol"!=typeof r&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o),mt(e)}function St(e,t,n){"number"===t&&vt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function _t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+pt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function xt(e,t,n){null==t||((t=""+pt(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+pt(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function Ct(e,t,n,i){if(null==t){if(null!=i){if(null!=n)throw Error(r(92));if(L(i)){if(1<i.length)throw Error(r(93));i=i[0]}n=i}null==n&&(n=""),t=n}n=pt(t),e.defaultValue=n,(i=e.textContent)===n&&""!==i&&null!==i&&(e.value=i),mt(e)}function Et(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Tt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Mt(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||Tt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Pt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(r(62));if(e=e.style,null!=n){for(var i in n)!n.hasOwnProperty(i)||null!=t&&t.hasOwnProperty(i)||(0===i.indexOf("--")?e.setProperty(i,""):"float"===i?e.cssFloat="":e[i]="");for(var a in t)i=t[a],t.hasOwnProperty(a)&&n[a]!==i&&Mt(e,a,i)}else for(var o in t)t.hasOwnProperty(o)&&Mt(e,o,t[o])}function At(e){if(-1===e.indexOf("-"))return!1;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 Ot=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Nt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lt(e){return Nt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function jt(){}var It=null;function Rt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ft=null,Dt=null;function Bt(e){var t=Ze(e);if(t&&(e=t.stateNode)){var n=e[We]||null;e:switch(e=t.stateNode,t.type){case"input":if(wt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+bt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=i[We]||null;if(!a)throw Error(r(90));wt(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)(i=n[t]).form===e.form&&gt(i)}break e;case"textarea":xt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&_t(e,!!n.multiple,t,!1)}}}var zt=!1;function Ut(e,t,n){if(zt)return e(t,n);zt=!0;try{return e(t)}finally{if(zt=!1,(null!==Ft||null!==Dt)&&(nu(),Ft&&(t=Ft,e=Dt,Dt=Ft=null,Bt(t),e)))for(t=0;t<e.length;t++)Bt(e[t])}}function Vt(e,t){var n=e.stateNode;if(null===n)return null;var i=n[We]||null;if(null===i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}var $t=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Wt=!1;if($t)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Wt=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch(dr){Wt=!1}var Ht=null,Jt=null,Gt=null;function Qt(){if(Gt)return Gt;var e,t,n=Jt,r=n.length,i="value"in Ht?Ht.value:Ht.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return Gt=i.slice(e,1<t?1-t:void 0)}function Yt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Kt(){return!0}function Xt(){return!1}function Zt(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Kt:Xt,this.isPropagationStopped=Xt,this}return u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Kt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Kt)},persist:function(){},isPersistent:Kt}),t}var en,tn,nn,rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},an=Zt(rn),on=u({},rn,{view:0,detail:0}),sn=Zt(on),ln=u({},on,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nn&&(nn&&"mousemove"===e.type?(en=e.screenX-nn.screenX,tn=e.screenY-nn.screenY):tn=en=0,nn=e),en)},movementY:function(e){return"movementY"in e?e.movementY:tn}}),cn=Zt(ln),un=Zt(u({},ln,{dataTransfer:0})),dn=Zt(u({},on,{relatedTarget:0})),fn=Zt(u({},rn,{animationName:0,elapsedTime:0,pseudoElement:0})),pn=Zt(u({},rn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),hn=Zt(u({},rn,{data:0})),mn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=vn[e])&&!!t[e]}function bn(){return yn}var wn=Zt(u({},on,{key:function(e){if(e.key){var t=mn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Yt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?gn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bn,charCode:function(e){return"keypress"===e.type?Yt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Yt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),kn=Zt(u({},ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Sn=Zt(u({},on,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bn})),_n=Zt(u({},rn,{propertyName:0,elapsedTime:0,pseudoElement:0})),xn=Zt(u({},ln,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Cn=Zt(u({},rn,{newState:0,oldState:0})),En=[9,13,27,32],Tn=$t&&"CompositionEvent"in window,Mn=null;$t&&"documentMode"in document&&(Mn=document.documentMode);var Pn=$t&&"TextEvent"in window&&!Mn,An=$t&&(!Tn||Mn&&8<Mn&&11>=Mn),On=String.fromCharCode(32),Nn=!1;function Ln(e,t){switch(e){case"keyup":return-1!==En.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var In=!1;var Rn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Rn[e.type]:"textarea"===t}function Dn(e,t,n,r){Ft?Dt?Dt.push(r):Dt=[r]:Ft=r,0<(t=od(t,"onChange")).length&&(n=new an("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bn=null,zn=null;function Un(e){Xu(e,0)}function Vn(e){if(gt(et(e)))return e}function $n(e,t){if("change"===e)return t}var Wn=!1;if($t){var qn;if($t){var Hn="oninput"in document;if(!Hn){var Jn=document.createElement("div");Jn.setAttribute("oninput","return;"),Hn="function"==typeof Jn.oninput}qn=Hn}else qn=!1;Wn=qn&&(!document.documentMode||9<document.documentMode)}function Gn(){Bn&&(Bn.detachEvent("onpropertychange",Qn),zn=Bn=null)}function Qn(e){if("value"===e.propertyName&&Vn(zn)){var t=[];Dn(t,zn,e,Rt(e)),Ut(Un,t)}}function Yn(e,t,n){"focusin"===e?(Gn(),zn=n,(Bn=t).attachEvent("onpropertychange",Qn)):"focusout"===e&&Gn()}function Kn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Vn(zn)}function Xn(e,t){if("click"===e)return Vn(t)}function Zn(e,t){if("input"===e||"change"===e)return Vn(t)}var er="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function tr(e,t){if(er(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ae.call(t,i)||!er(e[i],t[i]))return!1}return!0}function nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rr(e,t){var n,r=nr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nr(r)}}function ir(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ir(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ar(e){for(var t=vt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=vt((e=t.contentWindow).document)}return t}function or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sr=$t&&"documentMode"in document&&11>=document.documentMode,lr=null,cr=null,ur=null,fr=!1;function pr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;fr||null==lr||lr!==vt(r)||("selectionStart"in(r=lr)&&or(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ur&&tr(ur,r)||(ur=r,0<(r=od(cr,"onSelect")).length&&(t=new an("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=lr)))}function hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mr={animationend:hr("Animation","AnimationEnd"),animationiteration:hr("Animation","AnimationIteration"),animationstart:hr("Animation","AnimationStart"),transitionrun:hr("Transition","TransitionRun"),transitionstart:hr("Transition","TransitionStart"),transitioncancel:hr("Transition","TransitionCancel"),transitionend:hr("Transition","TransitionEnd")},gr={},vr={};function yr(e){if(gr[e])return gr[e];if(!mr[e])return e;var t,n=mr[e];for(t in n)if(n.hasOwnProperty(t)&&t in vr)return gr[e]=n[t];return e}$t&&(vr=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);var br=yr("animationend"),wr=yr("animationiteration"),kr=yr("animationstart"),Sr=yr("transitionrun"),_r=yr("transitionstart"),xr=yr("transitioncancel"),Cr=yr("transitionend"),Er=new Map,Tr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mr(e,t){Er.set(e,t),at(t,[e])}Tr.push("scrollEnd");var Pr="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Ar=[],Or=0,Nr=0;function Lr(){for(var e=Or,t=Nr=Or=0;t<e;){var n=Ar[t];Ar[t++]=null;var r=Ar[t];Ar[t++]=null;var i=Ar[t];Ar[t++]=null;var a=Ar[t];if(Ar[t++]=null,null!==r&&null!==i){var o=r.pending;null===o?i.next=i:(i.next=o.next,o.next=i),r.pending=i}0!==a&&Fr(n,i,a)}}function jr(e,t,n,r){Ar[Or++]=e,Ar[Or++]=t,Ar[Or++]=n,Ar[Or++]=r,Nr|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Ir(e,t,n,r){return jr(e,t,n,r),Dr(e)}function Rr(e,t){return jr(e,null,null,t),Dr(e)}function Fr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var i=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(r=a.alternate)&&(r.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(i=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,i&&null!==t&&(i=31-Se(n),null===(r=(e=a.hiddenUpdates)[i])?e[i]=[t]:r.push(t),t.lane=536870912|n),a):null}function Dr(e){if(50<Jc)throw Jc=0,Gc=null,Error(r(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Br={};function zr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(e,t,n,r){return new zr(e,t,n,r)}function Vr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function $r(e,t){var n=e.alternate;return null===n?((n=Ur(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Wr(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function qr(e,t,n,i,a,o){var s=0;if(i=e,"function"==typeof e)Vr(e)&&(s=1);else if("string"==typeof e)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,H.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case C:return(e=Ur(31,n,t,a)).elementType=C,e.lanes=o,e;case h:return Hr(n.children,a,o,t);case m:s=8,a|=24;break;case g:return(e=Ur(12,n,t,2|a)).elementType=g,e.lanes=o,e;case w:return(e=Ur(13,n,t,a)).elementType=w,e.lanes=o,e;case k:return(e=Ur(19,n,t,a)).elementType=k,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case y:s=10;break e;case v:s=9;break e;case b:s=11;break e;case S:s=14;break e;case x:s=16,i=null;break e}s=29,n=Error(r(130,null===e?"null":typeof e,"")),i=null}return(t=Ur(s,n,t,a)).elementType=e,t.type=i,t.lanes=o,t}function Hr(e,t,n,r){return(e=Ur(7,e,r,t)).lanes=n,e}function Jr(e,t,n){return(e=Ur(6,e,null,t)).lanes=n,e}function Gr(e){var t=Ur(18,null,null,0);return t.stateNode=e,t}function Qr(e,t,n){return(t=Ur(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yr=new WeakMap;function Kr(e,t){if("object"==typeof e&&null!==e){var n=Yr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:ie(t)},Yr.set(e,t),t)}return{value:e,source:t,stack:ie(t)}}var Xr=[],Zr=0,ei=null,ti=0,ni=[],ri=0,ii=null,ai=1,oi="";function si(e,t){Xr[Zr++]=ti,Xr[Zr++]=ei,ei=e,ti=t}function li(e,t,n){ni[ri++]=ai,ni[ri++]=oi,ni[ri++]=ii,ii=e;var r=ai;e=oi;var i=32-Se(r)-1;r&=~(1<<i),n+=1;var a=32-Se(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ai=1<<32-Se(t)+i|n<<i|r,oi=a+e}else ai=1<<a|n<<i|r,oi=e}function ci(e){null!==e.return&&(si(e,1),li(e,1,0))}function ui(e){for(;e===ei;)ei=Xr[--Zr],Xr[Zr]=null,ti=Xr[--Zr],Xr[Zr]=null;for(;e===ii;)ii=ni[--ri],ni[ri]=null,oi=ni[--ri],ni[ri]=null,ai=ni[--ri],ni[ri]=null}function di(e,t){ni[ri++]=ai,ni[ri++]=oi,ni[ri++]=ii,ai=t.id,oi=t.overflow,ii=e}var fi=null,pi=null,hi=!1,mi=null,gi=!1,vi=Error(r(519));function yi(e){throw xi(Kr(Error(r(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),vi}function bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[$e]=e,t[We]=r,n){case"dialog":Zu("cancel",t),Zu("close",t);break;case"iframe":case"object":case"embed":Zu("load",t);break;case"video":case"audio":for(n=0;n<Yu.length;n++)Zu(Yu[n],t);break;case"source":Zu("error",t);break;case"img":case"image":case"link":Zu("error",t),Zu("load",t);break;case"details":Zu("toggle",t);break;case"input":Zu("invalid",t),kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Zu("invalid",t);break;case"textarea":Zu("invalid",t),Ct(t,r.value,r.defaultValue,r.children)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||fd(t.textContent,n)?(null!=r.popover&&(Zu("beforetoggle",t),Zu("toggle",t)),null!=r.onScroll&&Zu("scroll",t),null!=r.onScrollEnd&&Zu("scrollend",t),null!=r.onClick&&(t.onclick=jt),t=!0):t=!1,t||yi(e,!0)}function wi(e){for(fi=e.return;fi;)switch(fi.tag){case 5:case 31:case 13:return void(gi=!1);case 27:case 3:return void(gi=!0);default:fi=fi.return}}function ki(e){if(e!==fi)return!1;if(!hi)return wi(e),hi=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Sd(e.type,e.memoizedProps)),t=!t),t&&pi&&yi(e),wi(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));pi=Dd(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));pi=Dd(e)}else 27===n?(n=pi,Pd(e.type)?(e=Fd,Fd=null,pi=e):pi=n):pi=fi?Rd(e.stateNode.nextSibling):null;return!0}function Si(){pi=fi=null,hi=!1}function _i(){var e=mi;return null!==e&&(null===Lc?Lc=e:Lc.push.apply(Lc,e),mi=null),e}function xi(e){null===mi?mi=[e]:mi.push(e)}var Ci=U(null),Ei=null,Ti=null;function Mi(e,t,n){$(Ci,t._currentValue),t._currentValue=n}function Pi(e){e._currentValue=Ci.current,V(Ci)}function Ai(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Oi(e,t,n,i){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var o=a.dependencies;if(null!==o){var s=a.child;o=o.firstContext;e:for(;null!==o;){var l=o;o=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Ai(o.return,n,e),i||(s=null);break e}o=l.next}}else if(18===a.tag){if(null===(s=a.return))throw Error(r(341));s.lanes|=n,null!==(o=s.alternate)&&(o.lanes|=n),Ai(s,n,e),s=null}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===e){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}}function Ni(e,t,n,i){e=null;for(var a=t,o=!1;null!==a;){if(!o)if(524288&a.flags)o=!0;else if(262144&a.flags)break;if(10===a.tag){var s=a.alternate;if(null===s)throw Error(r(387));if(null!==(s=s.memoizedProps)){var l=a.type;er(a.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(a===Q.current){if(null===(s=a.alternate))throw Error(r(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(hf):e=[hf])}a=a.return}null!==e&&Oi(t,e,n,i),t.flags|=262144}function Li(e){for(e=e.firstContext;null!==e;){if(!er(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ji(e){Ei=e,Ti=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Ii(e){return Fi(Ei,e)}function Ri(e,t){return null===Ei&&ji(e),Fi(e,t)}function Fi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===Ti){if(null===e)throw Error(r(308));Ti=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ti=Ti.next=t;return n}var Di="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Bi=e.unstable_scheduleCallback,zi=e.unstable_NormalPriority,Ui={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vi(){return{controller:new Di,data:new Map,refCount:0}}function $i(e){e.refCount--,0===e.refCount&&Bi(zi,function(){e.controller.abort()})}var Wi=null,qi=0,Hi=0,Ji=null;function Gi(){if(0===--qi&&null!==Wi){null!==Ji&&(Ji.status="fulfilled");var e=Wi;Wi=null,Hi=0,Ji=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Qi=j.S;j.S=function(e,t){Rc=ue(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Wi){var n=Wi=[];qi=0,Hi=qu(),Ji={status:"pending",value:void 0,then:function(e){n.push(e)}}}qi++,t.then(Gi,Gi)}(0,t),null!==Qi&&Qi(e,t)};var Yi=U(null);function Ki(){var e=Yi.current;return null!==e?e:vc.pooledCache}function Xi(e,t){$(Yi,null===t?Yi.current:t.pool)}function Zi(){var e=Ki();return null===e?null:{parent:Ui._currentValue,pool:e}}var ea=Error(r(460)),ta=Error(r(474)),na=Error(r(542)),ra={then:function(){}};function ia(e){return"fulfilled"===(e=e.status)||"rejected"===e}function aa(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(jt,jt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw ca(e=t.reason),e;default:if("string"==typeof t.status)t.then(jt,jt);else{if(null!==(e=vc)&&100<e.shellSuspendCounter)throw Error(r(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw ca(e=t.reason),e}throw sa=t,ea}}function oa(e){try{return(0,e._init)(e._payload)}catch(t){if(null!==t&&"object"==typeof t&&"function"==typeof t.then)throw sa=t,ea;throw t}}var sa=null;function la(){if(null===sa)throw Error(r(459));var e=sa;return sa=null,e}function ca(e){if(e===ea||e===na)throw Error(r(483))}var ua=null,da=0;function fa(e){var t=da;return da+=1,null===ua&&(ua=[]),aa(ua,e,t)}function pa(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function ha(e,t){if(t.$$typeof===d)throw Error(r(525));throw e=Object.prototype.toString.call(t),Error(r(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ma(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function a(e,t){return(e=$r(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Jr(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,r){var i=n.type;return i===h?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===x&&oa(i)===t.type)?(pa(t=a(t,n.props),n),t.return=e,t):(pa(t=qr(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qr(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=Hr(n,e.mode,r,i)).return=e,t):((t=a(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Jr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case f:return pa(n=qr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case p:return(t=Qr(t,e.mode,n)).return=e,t;case x:return m(e,t=oa(t),n)}if(L(t)||M(t))return(t=Hr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return m(e,fa(t),n);if(t.$$typeof===y)return m(e,Ri(e,t),n);ha(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case f:return n.key===i?c(e,t,n,r):null;case p:return n.key===i?u(e,t,n,r):null;case x:return g(e,t,n=oa(n),r)}if(L(n)||M(n))return null!==i?null:d(e,t,n,r,null);if("function"==typeof n.then)return g(e,t,fa(n),r);if(n.$$typeof===y)return g(e,t,Ri(e,n),r);ha(e,n)}return null}function v(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case f:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case p:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case x:return v(e,t,n,r=oa(r),i)}if(L(r)||M(r))return d(t,e=e.get(n)||null,r,i,null);if("function"==typeof r.then)return v(e,t,n,fa(r),i);if(r.$$typeof===y)return v(e,t,n,Ri(t,r),i);ha(t,r)}return null}function b(l,c,u,d){if("object"==typeof u&&null!==u&&u.type===h&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case f:e:{for(var w=u.key;null!==c;){if(c.key===w){if((w=u.type)===h){if(7===c.tag){n(l,c.sibling),(d=a(c,u.props.children)).return=l,l=d;break e}}else if(c.elementType===w||"object"==typeof w&&null!==w&&w.$$typeof===x&&oa(w)===c.type){n(l,c.sibling),pa(d=a(c,u.props),u),d.return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}u.type===h?((d=Hr(u.props.children,l.mode,d,u.key)).return=l,l=d):(pa(d=qr(u.type,u.key,u.props,null,l.mode,d),u),d.return=l,l=d)}return s(l);case p:e:{for(w=u.key;null!==c;){if(c.key===w){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(d=a(c,u.children||[])).return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}(d=Qr(u,l.mode,d)).return=l,l=d}return s(l);case x:return b(l,c,u=oa(u),d)}if(L(u))return function(r,a,s,l){for(var c=null,u=null,d=a,f=a=0,p=null;null!==d&&f<s.length;f++){d.index>f?(p=d,d=null):p=d.sibling;var h=g(r,d,s[f],l);if(null===h){null===d&&(d=p);break}e&&d&&null===h.alternate&&t(r,d),a=o(h,a,f),null===u?c=h:u.sibling=h,u=h,d=p}if(f===s.length)return n(r,d),hi&&si(r,f),c;if(null===d){for(;f<s.length;f++)null!==(d=m(r,s[f],l))&&(a=o(d,a,f),null===u?c=d:u.sibling=d,u=d);return hi&&si(r,f),c}for(d=i(d);f<s.length;f++)null!==(p=v(d,r,f,s[f],l))&&(e&&null!==p.alternate&&d.delete(null===p.key?f:p.key),a=o(p,a,f),null===u?c=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return t(r,e)}),hi&&si(r,f),c}(l,c,u,d);if(M(u)){if("function"!=typeof(w=M(u)))throw Error(r(150));return function(a,s,l,c){if(null==l)throw Error(r(151));for(var u=null,d=null,f=s,p=s=0,h=null,y=l.next();null!==f&&!y.done;p++,y=l.next()){f.index>p?(h=f,f=null):h=f.sibling;var b=g(a,f,y.value,c);if(null===b){null===f&&(f=h);break}e&&f&&null===b.alternate&&t(a,f),s=o(b,s,p),null===d?u=b:d.sibling=b,d=b,f=h}if(y.done)return n(a,f),hi&&si(a,p),u;if(null===f){for(;!y.done;p++,y=l.next())null!==(y=m(a,y.value,c))&&(s=o(y,s,p),null===d?u=y:d.sibling=y,d=y);return hi&&si(a,p),u}for(f=i(f);!y.done;p++,y=l.next())null!==(y=v(f,a,p,y.value,c))&&(e&&null!==y.alternate&&f.delete(null===y.key?p:y.key),s=o(y,s,p),null===d?u=y:d.sibling=y,d=y);return e&&f.forEach(function(e){return t(a,e)}),hi&&si(a,p),u}(l,c,u=w.call(u),d)}if("function"==typeof u.then)return b(l,c,fa(u),d);if(u.$$typeof===y)return b(l,c,Ri(l,u),d);ha(l,u)}return"string"==typeof u&&""!==u||"number"==typeof u||"bigint"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(d=a(c,u)).return=l,l=d):(n(l,c),(d=Jr(u,l.mode,d)).return=l,l=d),s(l)):n(l,c)}return function(e,t,n,r){try{da=0;var i=b(e,t,n,r);return ua=null,i}catch(o){if(o===ea||o===na)throw o;var a=Ur(29,o,null,e.mode);return a.lanes=r,a.return=e,a}}}var ga=ma(!0),va=ma(!1),ya=!1;function ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&gc){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Dr(e),Fr(e,null,n),t}return jr(e,r,t,n),Dr(e)}function _a(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Re(e,n)}}function xa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ca=!1;function Ea(){if(Ca){if(null!==Ji)throw Ji}}function Ta(e,t,n,r){Ca=!1;var i=e.updateQueue;ya=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===o?a=c:o.next=c,o=l;var d=e.alternate;null!==d&&((s=(d=d.updateQueue).lastBaseUpdate)!==o&&(null===s?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(null!==a){var f=i.baseState;for(o=0,d=c=l=null,s=a;;){var p=-536870913&s.lane,h=p!==s.lane;if(h?(bc&p)===p:(r&p)===p){0!==p&&p===Hi&&(Ca=!0),null!==d&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var m=e,g=s;p=t;var v=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){f=m.call(v,f,p);break e}f=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(p="function"==typeof(m=g.payload)?m.call(v,f,p):m))break e;f=u({},f,p);break e;case 2:ya=!0}}null!==(p=s.callback)&&(e.flags|=64,h&&(e.flags|=8192),null===(h=i.callbacks)?i.callbacks=[p]:h.push(p))}else h={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(c=d=h,l=f):d=d.next=h,o|=p;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(h=s).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}null===d&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,null===a&&(i.shared.lanes=0),Tc|=o,e.lanes=o,e.memoizedState=f}}function Ma(e,t){if("function"!=typeof e)throw Error(r(191,e));e.call(t)}function Pa(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)Ma(n[e],t)}var Aa=U(null),Oa=U(0);function Na(e,t){$(Oa,e=Cc),$(Aa,t),Cc=e|t.baseLanes}function La(){$(Oa,Cc),$(Aa,Aa.current)}function ja(){Cc=Oa.current,V(Aa),V(Oa)}var Ia=U(null),Ra=null;function Fa(e){var t=e.alternate;$(Va,1&Va.current),$(Ia,e),null===Ra&&(null===t||null!==Aa.current||null!==t.memoizedState)&&(Ra=e)}function Da(e){$(Va,Va.current),$(Ia,e),null===Ra&&(Ra=e)}function Ba(e){22===e.tag?($(Va,Va.current),$(Ia,e),null===Ra&&(Ra=e)):za()}function za(){$(Va,Va.current),$(Ia,Ia.current)}function Ua(e){V(Ia),Ra===e&&(Ra=null),V(Va)}var Va=U(0);function $a(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||jd(n)||Id(n)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(128&t.flags)return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wa=0,qa=null,Ha=null,Ja=null,Ga=!1,Qa=!1,Ya=!1,Ka=0,Xa=0,Za=null,eo=0;function to(){throw Error(r(321))}function no(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!er(e[n],t[n]))return!1;return!0}function ro(e,t,n,r,i,a){return Wa=a,qa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=null===e||null===e.memoizedState?bs:ws,Ya=!1,a=n(r,i),Ya=!1,Qa&&(a=ao(t,n,r,i)),io(e),a}function io(e){j.H=ys;var t=null!==Ha&&null!==Ha.next;if(Wa=0,Ja=Ha=qa=null,Ga=!1,Xa=0,Za=null,t)throw Error(r(300));null===e||Rs||null!==(e=e.dependencies)&&Li(e)&&(Rs=!0)}function ao(e,t,n,i){qa=e;var a=0;do{if(Qa&&(Za=null),Xa=0,Qa=!1,25<=a)throw Error(r(301));if(a+=1,Ja=Ha=null,null!=e.updateQueue){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,null!=o.memoCache&&(o.memoCache.index=0)}j.H=ks,o=t(n,i)}while(Qa);return o}function oo(){var e=j.H,t=e.useState()[0];return t="function"==typeof t.then?po(t):t,e=e.useState()[0],(null!==Ha?Ha.memoizedState:null)!==e&&(qa.flags|=1024),t}function so(){var e=0!==Ka;return Ka=0,e}function lo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function co(e){if(Ga){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Ga=!1}Wa=0,Ja=Ha=qa=null,Qa=!1,Xa=Ka=0,Za=null}function uo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ja?qa.memoizedState=Ja=e:Ja=Ja.next=e,Ja}function fo(){if(null===Ha){var e=qa.alternate;e=null!==e?e.memoizedState:null}else e=Ha.next;var t=null===Ja?qa.memoizedState:Ja.next;if(null!==t)Ja=t,Ha=e;else{if(null===e){if(null===qa.alternate)throw Error(r(467));throw Error(r(310))}e={memoizedState:(Ha=e).memoizedState,baseState:Ha.baseState,baseQueue:Ha.baseQueue,queue:Ha.queue,next:null},null===Ja?qa.memoizedState=Ja=e:Ja=Ja.next=e}return Ja}function po(e){var t=Xa;return Xa+=1,null===Za&&(Za=[]),e=aa(Za,e,t),t=qa,null===(null===Ja?t.memoizedState:Ja.next)&&(t=t.alternate,j.H=null===t||null===t.memoizedState?bs:ws),e}function ho(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return po(e);if(e.$$typeof===y)return Ii(e)}throw Error(r(438,String(e)))}function mo(e){var t=null,n=qa.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=qa.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=E;return t.index++,n}function go(e,t){return"function"==typeof t?t(e):t}function vo(e){return yo(fo(),Ha,e)}function yo(e,t,n){var i=e.queue;if(null===i)throw Error(r(311));i.lastRenderedReducer=n;var a=e.baseQueue,o=i.pending;if(null!==o){if(null!==a){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,i.pending=null}if(o=e.baseState,null===a)e.memoizedState=o;else{var l=s=null,c=null,u=t=a.next,d=!1;do{var f=-536870913&u.lane;if(f!==u.lane?(bc&f)===f:(Wa&f)===f){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Hi&&(d=!0);else{if((Wa&p)===p){u=u.next,p===Hi&&(d=!0);continue}f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=f,s=o):c=c.next=f,qa.lanes|=p,Tc|=p}f=u.action,Ya&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=p,s=o):c=c.next=p,qa.lanes|=f,Tc|=f;u=u.next}while(null!==u&&u!==t);if(null===c?s=o:c.next=l,!er(o,e.memoizedState)&&(Rs=!0,d&&null!==(n=Ji)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=c,i.lastRenderedState=o}return null===a&&(i.lanes=0),[e.memoizedState,i.dispatch]}function bo(e){var t=fo(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var s=a=a.next;do{o=e(o,s.action),s=s.next}while(s!==a);er(o,t.memoizedState)||(Rs=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function wo(e,t,n){var i=qa,a=fo(),o=hi;if(o){if(void 0===n)throw Error(r(407));n=n()}else n=t();var s=!er((Ha||a).memoizedState,n);if(s&&(a.memoizedState=n,Rs=!0),a=a.queue,qo(_o.bind(null,i,a,e),[e]),a.getSnapshot!==t||s||null!==Ja&&1&Ja.memoizedState.tag){if(i.flags|=2048,zo(9,{destroy:void 0},So.bind(null,i,a,n,t),null),null===vc)throw Error(r(349));o||127&Wa||ko(i,t,n)}return n}function ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=qa.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function So(e,t,n,r){t.value=n,t.getSnapshot=r,xo(t)&&Co(e)}function _o(e,t,n){return n(function(){xo(t)&&Co(e)})}function xo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!er(e,n)}catch(r){return!0}}function Co(e){var t=Rr(e,2);null!==t&&Kc(t,e,2)}function Eo(e){var t=uo();if("function"==typeof e){var n=e;if(e=n(),Ya){ke(!0);try{n()}finally{ke(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:e},t}function To(e,t,n,r){return e.baseState=n,yo(e,Ha,"function"==typeof r?r:go)}function Mo(e,t,n,i,a){if(ms(e))throw Error(r(485));if(null!==(e=t.action)){var o={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};null!==j.T?n(!0):o.isTransition=!1,i(o),null===(n=t.pending)?(o.next=t.pending=o,Po(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Po(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),l=j.S;null!==l&&l(o,s),Ao(e,t,s)}catch(c){No(e,t,c)}finally{null!==a&&null!==o.types&&(a.types=o.types),j.T=a}}else try{Ao(e,t,a=n(i,r))}catch(u){No(e,t,u)}}function Ao(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){Oo(e,t,n)},function(n){return No(e,t,n)}):Oo(e,t,n)}function Oo(e,t,n){t.status="fulfilled",t.value=n,Lo(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,Po(e,n)))}function No(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,Lo(t),t=t.next}while(t!==r)}e.action=null}function Lo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function jo(e,t){return t}function Io(e,t){if(hi){var n=vc.formState;if(null!==n){e:{var r=qa;if(hi){if(pi){t:{for(var i=pi,a=gi;8!==i.nodeType;){if(!a){i=null;break t}if(null===(i=Rd(i.nextSibling))){i=null;break t}}i="F!"===(a=i.data)||"F"===a?i:null}if(i){pi=Rd(i.nextSibling),r="F!"===i.data;break e}}yi(r)}r=!1}r&&(t=n[0])}}return(n=uo()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:t},n.queue=r,n=fs.bind(null,qa,r),r.dispatch=n,r=Eo(!1),a=hs.bind(null,qa,!1,r.queue),i={state:t,dispatch:null,action:e,pending:null},(r=uo()).queue=i,n=Mo.bind(null,qa,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ro(e){return Fo(fo(),Ha,e)}function Fo(e,t,n){if(t=yo(e,t,jo)[0],e=vo(go)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var r=po(t)}catch(o){if(o===ea)throw na;throw o}else r=t;var i=(t=fo()).queue,a=i.dispatch;return n!==t.memoizedState&&(qa.flags|=2048,zo(9,{destroy:void 0},Do.bind(null,i,n),null)),[r,a,e]}function Do(e,t){e.action=t}function Bo(e){var t=fo(),n=Ha;if(null!==n)return Fo(t,n,e);fo(),t=t.memoizedState;var r=(n=fo()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function zo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=qa.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Uo(){return fo().memoizedState}function Vo(e,t,n,r){var i=uo();qa.flags|=e,i.memoizedState=zo(1|t,{destroy:void 0},n,void 0===r?null:r)}function $o(e,t,n,r){var i=fo();r=void 0===r?null:r;var a=i.memoizedState.inst;null!==Ha&&null!==r&&no(r,Ha.memoizedState.deps)?i.memoizedState=zo(t,a,n,r):(qa.flags|=e,i.memoizedState=zo(1|t,a,n,r))}function Wo(e,t){Vo(8390656,8,e,t)}function qo(e,t){$o(2048,8,e,t)}function Ho(e){var t=fo().memoizedState;return function(e){qa.flags|=4;var t=qa.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&gc)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Jo(e,t){return $o(4,2,e,t)}function Go(e,t){return $o(4,4,e,t)}function Qo(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Yo(e,t,n){n=null!=n?n.concat([e]):null,$o(4,4,Qo.bind(null,t,e),n)}function Ko(){}function Xo(e,t){var n=fo();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&no(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zo(e,t){var n=fo();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&no(t,r[1]))return r[0];if(r=e(),Ya){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r}function es(e,t,n){return void 0===n||1073741824&Wa&&!(261930&bc)?e.memoizedState=t:(e.memoizedState=n,e=Yc(),qa.lanes|=e,Tc|=e,n)}function ts(e,t,n,r){return er(n,t)?n:null!==Aa.current?(e=es(e,n,r),er(e,t)||(Rs=!0),e):42&Wa&&(!(1073741824&Wa)||261930&bc)?(e=Yc(),qa.lanes|=e,Tc|=e,t):(Rs=!0,e.memoizedState=n)}function ns(e,t,n,r,i){var a=R.p;R.p=0!==a&&8>a?a:8;var o,s,l,c=j.T,u={};j.T=u,hs(e,!1,t,n);try{var d=i(),f=j.S;if(null!==f&&f(u,d),null!==d&&"object"==typeof d&&"function"==typeof d.then)ps(e,t,(o=r,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},d.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<s.length;e++)(0,s[e])(o)},function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)}),l),Qc());else ps(e,t,r,Qc())}catch(p){ps(e,t,{then:function(){},status:"rejected",reason:p},Qc())}finally{R.p=a,null!==c&&null!==u.types&&(c.types=u.types),j.T=c}}function rs(){}function is(e,t,n,i){if(5!==e.tag)throw Error(r(476));var a=as(e).queue;ns(e,a,t,F,null===n?rs:function(){return os(e),n(i)})}function as(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:F},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function os(e){var t=as(e);null===t.next&&(t=e.alternate.memoizedState),ps(e,t.next.queue,{},Qc())}function ss(){return Ii(hf)}function ls(){return fo().memoizedState}function cs(){return fo().memoizedState}function us(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Qc(),r=Sa(t,e=ka(n),n);return null!==r&&(Kc(r,t,n),_a(r,t,n)),t={cache:Vi()},void(e.payload=t)}t=t.return}}function ds(e,t,n){var r=Qc();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e)?gs(t,n):null!==(n=Ir(e,t,n,r))&&(Kc(n,e,r),vs(n,t,r))}function fs(e,t,n){ps(e,t,n,Qc())}function ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))gs(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,er(s,o))return jr(e,t,i,0),null===vc&&Lr(),!1}catch(l){}if(null!==(n=Ir(e,t,i,r)))return Kc(n,e,r),vs(n,t,r),!0}return!1}function hs(e,t,n,i){if(i={lane:2,revertLane:qu(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ms(e)){if(t)throw Error(r(479))}else null!==(t=Ir(e,n,i,2))&&Kc(t,e,2)}function ms(e){var t=e.alternate;return e===qa||null!==t&&t===qa}function gs(e,t){Qa=Ga=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vs(e,t,n){if(4194048&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Re(e,n)}}var ys={readContext:Ii,use:ho,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useLayoutEffect:to,useInsertionEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useSyncExternalStore:to,useId:to,useHostTransitionStatus:to,useFormState:to,useActionState:to,useOptimistic:to,useMemoCache:to,useCacheRefresh:to};ys.useEffectEvent=to;var bs={readContext:Ii,use:ho,useCallback:function(e,t){return uo().memoizedState=[e,void 0===t?null:t],e},useContext:Ii,useEffect:Wo,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,Vo(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vo(4194308,4,e,t)},useInsertionEffect:function(e,t){Vo(4,2,e,t)},useMemo:function(e,t){var n=uo();t=void 0===t?null:t;var r=e();if(Ya){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=uo();if(void 0!==n){var i=n(t);if(Ya){ke(!0);try{n(t)}finally{ke(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ds.bind(null,qa,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},uo().memoizedState=e},useState:function(e){var t=(e=Eo(e)).queue,n=fs.bind(null,qa,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ko,useDeferredValue:function(e,t){return es(uo(),e,t)},useTransition:function(){var e=Eo(!1);return e=ns.bind(null,qa,e.queue,!0,!1),uo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=qa,a=uo();if(hi){if(void 0===n)throw Error(r(407));n=n()}else{if(n=t(),null===vc)throw Error(r(349));127&bc||ko(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Wo(_o.bind(null,i,o,e),[e]),i.flags|=2048,zo(9,{destroy:void 0},So.bind(null,i,o,n,t),null),n},useId:function(){var e=uo(),t=vc.identifierPrefix;if(hi){var n=oi;t="_"+t+"R_"+(n=(ai&~(1<<32-Se(ai)-1)).toString(32)+n),0<(n=Ka++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=eo++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ss,useFormState:Io,useActionState:Io,useOptimistic:function(e){var t=uo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=hs.bind(null,qa,!0,n),n.dispatch=t,[e,t]},useMemoCache:mo,useCacheRefresh:function(){return uo().memoizedState=us.bind(null,qa)},useEffectEvent:function(e){var t=uo(),n={impl:e};return t.memoizedState=n,function(){if(2&gc)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},ws={readContext:Ii,use:ho,useCallback:Xo,useContext:Ii,useEffect:qo,useImperativeHandle:Yo,useInsertionEffect:Jo,useLayoutEffect:Go,useMemo:Zo,useReducer:vo,useRef:Uo,useState:function(){return vo(go)},useDebugValue:Ko,useDeferredValue:function(e,t){return ts(fo(),Ha.memoizedState,e,t)},useTransition:function(){var e=vo(go)[0],t=fo().memoizedState;return["boolean"==typeof e?e:po(e),t]},useSyncExternalStore:wo,useId:ls,useHostTransitionStatus:ss,useFormState:Ro,useActionState:Ro,useOptimistic:function(e,t){return To(fo(),0,e,t)},useMemoCache:mo,useCacheRefresh:cs};ws.useEffectEvent=Ho;var ks={readContext:Ii,use:ho,useCallback:Xo,useContext:Ii,useEffect:qo,useImperativeHandle:Yo,useInsertionEffect:Jo,useLayoutEffect:Go,useMemo:Zo,useReducer:bo,useRef:Uo,useState:function(){return bo(go)},useDebugValue:Ko,useDeferredValue:function(e,t){var n=fo();return null===Ha?es(n,e,t):ts(n,Ha.memoizedState,e,t)},useTransition:function(){var e=bo(go)[0],t=fo().memoizedState;return["boolean"==typeof e?e:po(e),t]},useSyncExternalStore:wo,useId:ls,useHostTransitionStatus:ss,useFormState:Bo,useActionState:Bo,useOptimistic:function(e,t){var n=fo();return null!==Ha?To(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mo,useCacheRefresh:cs};function Ss(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:u({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}ks.useEffectEvent=Ho;var _s={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qc(),i=ka(r);i.payload=t,null!=n&&(i.callback=n),null!==(t=Sa(e,i,r))&&(Kc(t,e,r),_a(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qc(),i=ka(r);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=Sa(e,i,r))&&(Kc(t,e,r),_a(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qc(),r=ka(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=Sa(e,r,n))&&(Kc(t,e,n),_a(t,e,n))}};function xs(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!tr(n,r)||!tr(i,a))}function Cs(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_s.enqueueReplaceState(t,t.state,null)}function Es(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=u({},n)),e)void 0===n[i]&&(n[i]=e[i]);return n}function Ts(e){Pr(e)}function Ms(e){console.error(e)}function Ps(e){Pr(e)}function As(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Os(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Ns(e,t,n){return(n=ka(n)).tag=3,n.payload={element:null},n.callback=function(){As(e,t)},n}function Ls(e){return(e=ka(e)).tag=3,e}function js(e,t,n,r){var i=n.type.getDerivedStateFromError;if("function"==typeof i){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Os(t,n,r)}}var o=n.stateNode;null!==o&&"function"==typeof o.componentDidCatch&&(e.callback=function(){Os(t,n,r),"function"!=typeof i&&(null===Bc?Bc=new Set([this]):Bc.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var Is=Error(r(461)),Rs=!1;function Fs(e,t,n,r){t.child=null===e?va(t,null,n,r):ga(t,e.child,n,r)}function Ds(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var o={};for(var s in r)"ref"!==s&&(o[s]=r[s])}else o=r;return ji(t),r=ro(e,t,n,o,a,i),s=so(),null===e||Rs?(hi&&s&&ci(t),t.flags|=1,Fs(e,t,r,i),t.child):(lo(e,t,i),sl(e,t,i))}function Bs(e,t,n,r,i){if(null===e){var a=n.type;return"function"!=typeof a||Vr(a)||void 0!==a.defaultProps||null!==n.compare?((e=qr(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,zs(e,t,a,r,i))}if(a=e.child,!ll(e,i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:tr)(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,(e=$r(a,r)).ref=t.ref,e.return=t,t.child=e}function zs(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(tr(a,r)&&e.ref===t.ref){if(Rs=!1,t.pendingProps=r=a,!ll(e,i))return t.lanes=e.lanes,sl(e,t,i);131072&e.flags&&(Rs=!0)}}return Js(e,t,n,r,i)}function Us(e,t,n,r){var i=r.children,a=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(128&t.flags){if(a=null!==a?a.baseLanes|n:n,null!==e){for(r=t.child=e.child,i=0;null!==r;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return $s(e,t,a,n,r)}if(!(536870912&n))return r=t.lanes=536870912,$s(e,t,null!==a?a.baseLanes|n:n,n,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Xi(0,null!==a?a.cachePool:null),null!==a?Na(t,a):La(),Ba(t)}else null!==a?(Xi(0,a.cachePool),Na(t,a),za(),t.memoizedState=null):(null!==e&&Xi(0,null),La(),za());return Fs(e,t,i,n),t.child}function Vs(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $s(e,t,n,r,i){var a=Ki();return a=null===a?null:{parent:Ui._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},null!==e&&Xi(0,null),La(),Ba(t),null!==e&&Ni(e,t,r,!0),t.childLanes=i,null}function Ws(e,t){return(t=nl({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function qs(e,t,n){return ga(t,e.child,null,n),(e=Ws(t,t.pendingProps)).flags|=2,Ua(t),t.memoizedState=null,e}function Hs(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(r(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Js(e,t,n,r,i){return ji(t),n=ro(e,t,n,r,void 0,i),r=so(),null===e||Rs?(hi&&r&&ci(t),t.flags|=1,Fs(e,t,n,i),t.child):(lo(e,t,i),sl(e,t,i))}function Gs(e,t,n,r,i,a){return ji(t),t.updateQueue=null,n=ao(t,r,n,i),io(e),r=so(),null===e||Rs?(hi&&r&&ci(t),t.flags|=1,Fs(e,t,n,a),t.child):(lo(e,t,a),sl(e,t,a))}function Qs(e,t,n,r,i){if(ji(t),null===t.stateNode){var a=Br,o=n.contextType;"object"==typeof o&&null!==o&&(a=Ii(o)),a=new n(r,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=_s,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=r,a.state=t.memoizedState,a.refs={},ba(t),o=n.contextType,a.context="object"==typeof o&&null!==o?Ii(o):Br,a.state=t.memoizedState,"function"==typeof(o=n.getDerivedStateFromProps)&&(Ss(t,n,o,r),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(o=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&_s.enqueueReplaceState(a,a.state,null),Ta(t,r,a,i),Ea(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){a=t.stateNode;var s=t.memoizedProps,l=Es(n,s);a.props=l;var c=a.context,u=n.contextType;o=Br,"object"==typeof u&&null!==u&&(o=Ii(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof a.getSnapshotBeforeUpdate,s=t.pendingProps!==s,u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s||c!==o)&&Cs(t,a,r,o),ya=!1;var f=t.memoizedState;a.state=f,Ta(t,r,a,i),Ea(),c=t.memoizedState,s||f!==c||ya?("function"==typeof d&&(Ss(t,n,d,r),c=t.memoizedState),(l=ya||xs(t,n,l,r,f,c,o))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=o,r=l):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,wa(e,t),u=Es(n,o=t.memoizedProps),a.props=u,d=t.pendingProps,f=a.context,c=n.contextType,l=Br,"object"==typeof c&&null!==c&&(l=Ii(c)),(c="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==d||f!==l)&&Cs(t,a,r,l),ya=!1,f=t.memoizedState,a.state=f,Ta(t,r,a,i),Ea();var p=t.memoizedState;o!==d||f!==p||ya||null!==e&&null!==e.dependencies&&Li(e.dependencies)?("function"==typeof s&&(Ss(t,n,s,r),p=t.memoizedState),(u=ya||xs(t,n,u,r,f,p,l)||null!==e&&null!==e.dependencies&&Li(e.dependencies))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hs(e,t),r=!!(128&t.flags),a||r?(a=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&r?(t.child=ga(t,e.child,null,i),t.child=ga(t,null,n,i)):Fs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Ys(e,t,n,r){return Si(),t.flags|=256,Fs(e,t,n,r),t.child}var Ks={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xs(e){return{baseLanes:e,cachePool:Zi()}}function Zs(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=Ac),e}function el(e,t,n){var i,a=t.pendingProps,o=!1,s=!!(128&t.flags);if((i=s)||(i=(null===e||null!==e.memoizedState)&&!!(2&Va.current)),i&&(o=!0,t.flags&=-129),i=!!(32&t.flags),t.flags&=-33,null===e){if(hi){if(o?Fa(t):za(),(e=pi)?null!==(e=null!==(e=Ld(e,gi))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ii?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},(n=Gr(e)).return=t,t.child=n,fi=t,pi=null):e=null,null===e)throw yi(t);return Id(e)?t.lanes=32:t.lanes=536870912,null}var l=a.children;return a=a.fallback,o?(za(),l=nl({mode:"hidden",children:l},o=t.mode),a=Hr(a,o,n,null),l.return=t,a.return=t,l.sibling=a,t.child=l,(a=t.child).memoizedState=Xs(n),a.childLanes=Zs(e,i,n),t.memoizedState=Ks,Vs(null,a)):(Fa(t),tl(t,l))}var c=e.memoizedState;if(null!==c&&null!==(l=c.dehydrated)){if(s)256&t.flags?(Fa(t),t.flags&=-257,t=rl(e,t,n)):null!==t.memoizedState?(za(),t.child=e.child,t.flags|=128,t=null):(za(),l=a.fallback,o=t.mode,a=nl({mode:"visible",children:a.children},o),(l=Hr(l,o,n,null)).flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,ga(t,e.child,null,n),(a=t.child).memoizedState=Xs(n),a.childLanes=Zs(e,i,n),t.memoizedState=Ks,t=Vs(null,a));else if(Fa(t),Id(l)){if(i=l.nextSibling&&l.nextSibling.dataset)var u=i.dgst;i=u,(a=Error(r(419))).stack="",a.digest=i,xi({value:a,source:null,stack:null}),t=rl(e,t,n)}else if(Rs||Ni(e,t,n,!1),i=0!==(n&e.childLanes),Rs||i){if(null!==(i=vc)&&(0!==(a=Fe(i,n))&&a!==c.retryLane))throw c.retryLane=a,Rr(e,a),Kc(i,e,a),Is;jd(l)||cu(),t=rl(e,t,n)}else jd(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,pi=Rd(l.nextSibling),fi=t,hi=!0,mi=null,gi=!1,null!==e&&di(t,e),(t=tl(t,a.children)).flags|=4096);return t}return o?(za(),l=a.fallback,o=t.mode,u=(c=e.child).sibling,(a=$r(c,{mode:"hidden",children:a.children})).subtreeFlags=65011712&c.subtreeFlags,null!==u?l=$r(u,l):(l=Hr(l,o,n,null)).flags|=2,l.return=t,a.return=t,a.sibling=l,t.child=a,Vs(null,a),a=t.child,null===(l=e.child.memoizedState)?l=Xs(n):(null!==(o=l.cachePool)?(c=Ui._currentValue,o=o.parent!==c?{parent:c,pool:c}:o):o=Zi(),l={baseLanes:l.baseLanes|n,cachePool:o}),a.memoizedState=l,a.childLanes=Zs(e,i,n),t.memoizedState=Ks,Vs(e.child,a)):(Fa(t),e=(n=e.child).sibling,(n=$r(n,{mode:"visible",children:a.children})).return=t,n.sibling=null,null!==e&&(null===(i=t.deletions)?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return(t=nl({mode:"visible",children:t},e.mode)).return=e,e.child=t}function nl(e,t){return(e=Ur(22,e,null,t)).lanes=0,e}function rl(e,t,n){return ga(t,e.child,null,n),(e=tl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function il(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ai(e.return,t,n)}function al(e,t,n,r,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Va.current,s=!!(2&o);if(s?(o=1&o|2,t.flags|=128):o&=1,$(Va,o),Fs(e,t,r,n),r=hi?ti:0,!s&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&il(e,n,t);else if(19===e.tag)il(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===$a(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===$a(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case"together":al(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function sl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Tc|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(Ni(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=$r(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=$r(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ll(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Li(e))}function cl(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Rs=!0;else{if(!(ll(e,n)||128&t.flags))return Rs=!1,function(e,t,n){switch(t.tag){case 3:Y(t,t.stateNode.containerInfo),Mi(0,Ui,e.memoizedState.cache),Si();break;case 27:case 5:X(t);break;case 4:Y(t,t.stateNode.containerInfo);break;case 10:Mi(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Da(t),null;break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(Fa(t),t.flags|=128,null):0!==(n&t.child.childLanes)?el(e,t,n):(Fa(t),null!==(e=sl(e,t,n))?e.sibling:null);Fa(t);break;case 19:var i=!!(128&e.flags);if((r=0!==(n&t.childLanes))||(Ni(e,t,n,!1),r=0!==(n&t.childLanes)),i){if(r)return ol(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),$(Va,Va.current),r)break;return null;case 22:return t.lanes=0,Us(e,t,n,t.pendingProps);case 24:Mi(0,Ui,e.memoizedState.cache)}return sl(e,t,n)}(e,t,n);Rs=!!(131072&e.flags)}else Rs=!1,hi&&1048576&t.flags&&li(t,ti,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=oa(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var a=e.$$typeof;if(a===b){t.tag=11,t=Ds(null,t,e,i,n);break e}if(a===S){t.tag=14,t=Bs(null,t,e,i,n);break e}}throw t=O(e)||e,Error(r(306,t,""))}Vr(e)?(i=Es(e,i),t.tag=1,t=Qs(null,t,e,i,n)):(t.tag=0,t=Js(null,t,e,i,n))}return t;case 0:return Js(e,t,t.type,t.pendingProps,n);case 1:return Qs(e,t,i=t.type,a=Es(i,t.pendingProps),n);case 3:e:{if(Y(t,t.stateNode.containerInfo),null===e)throw Error(r(387));i=t.pendingProps;var o=t.memoizedState;a=o.element,wa(e,t),Ta(t,i,null,n);var s=t.memoizedState;if(i=s.cache,Mi(0,Ui,i),i!==o.cache&&Oi(t,[Ui],n,!0),Ea(),i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Ys(e,t,i,n);break e}if(i!==a){xi(a=Kr(Error(r(424)),t)),t=Ys(e,t,i,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(pi=Rd(e.firstChild),fi=t,hi=!0,mi=null,gi=!0,n=va(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Si(),i===a){t=sl(e,t,n);break e}Fs(e,t,i,n)}t=t.child}return t;case 26:return Hs(e,t),null===e?(n=Gd(t.type,null,t.pendingProps,null))?t.memoizedState=n:hi||(n=t.type,e=t.pendingProps,(i=bd(G.current).createElement(n))[$e]=t,i[We]=e,md(i,n,e),nt(i),t.stateNode=i):t.memoizedState=Gd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),null===e&&hi&&(i=t.stateNode=zd(t.type,t.pendingProps,G.current),fi=t,gi=!0,a=pi,Pd(t.type)?(Fd=a,pi=Rd(i.firstChild)):pi=a),Fs(e,t,t.pendingProps.children,n),Hs(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&hi&&((a=i=pi)&&(null!==(i=function(e,t,n,r){for(;1===e.nodeType;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Ye])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(null==i.href||""===i.href?null:i.href)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin)||e.getAttribute("title")!==(null==i.title?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==i.src?null:i.src)||e.getAttribute("type")!==(null==i.type?null:i.type)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==i.name?null:""+i.name;if("hidden"===i.type&&e.getAttribute("name")===a)return e}if(null===(e=Rd(e.nextSibling)))break}return null}(i,t.type,t.pendingProps,gi))?(t.stateNode=i,fi=t,pi=Rd(i.firstChild),gi=!1,a=!0):a=!1),a||yi(t)),X(t),a=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,i=o.children,Sd(a,o)?i=null:null!==s&&Sd(a,s)&&(t.flags|=32),null!==t.memoizedState&&(a=ro(e,t,oo,null,null,n),hf._currentValue=a),Hs(e,t),Fs(e,t,i,n),t.child;case 6:return null===e&&hi&&((e=n=pi)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=Rd(e.nextSibling)))return null}return e}(n,t.pendingProps,gi))?(t.stateNode=n,fi=t,pi=null,e=!0):e=!1),e||yi(t)),null;case 13:return el(e,t,n);case 4:return Y(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=ga(t,null,i,n):Fs(e,t,i,n),t.child;case 11:return Ds(e,t,t.type,t.pendingProps,n);case 7:return Fs(e,t,t.pendingProps,n),t.child;case 8:case 12:return Fs(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Mi(0,t.type,i.value),Fs(e,t,i.children,n),t.child;case 9:return a=t.type._context,i=t.pendingProps.children,ji(t),i=i(a=Ii(a)),t.flags|=1,Fs(e,t,i,n),t.child;case 14:return Bs(e,t,t.type,t.pendingProps,n);case 15:return zs(e,t,t.type,t.pendingProps,n);case 19:return ol(e,t,n);case 31:return function(e,t,n){var i=t.pendingProps,a=!!(128&t.flags);if(t.flags&=-129,null===e){if(hi){if("hidden"===i.mode)return e=Ws(t,i),t.lanes=536870912,Vs(null,e);if(Da(t),(e=pi)?null!==(e=null!==(e=Ld(e,gi))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ii?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},(n=Gr(e)).return=t,t.child=n,fi=t,pi=null):e=null,null===e)throw yi(t);return t.lanes=536870912,null}return Ws(t,i)}var o=e.memoizedState;if(null!==o){var s=o.dehydrated;if(Da(t),a)if(256&t.flags)t.flags&=-257,t=qs(e,t,n);else{if(null===t.memoizedState)throw Error(r(558));t.child=e.child,t.flags|=128,t=null}else if(Rs||Ni(e,t,n,!1),a=0!==(n&e.childLanes),Rs||a){if(null!==(i=vc)&&0!==(s=Fe(i,n))&&s!==o.retryLane)throw o.retryLane=s,Rr(e,s),Kc(i,e,s),Is;cu(),t=qs(e,t,n)}else e=o.treeContext,pi=Rd(s.nextSibling),fi=t,hi=!0,mi=null,gi=!1,null!==e&&di(t,e),(t=Ws(t,i)).flags|=4096;return t}return(e=$r(e.child,{mode:i.mode,children:i.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return Us(e,t,n,t.pendingProps);case 24:return ji(t),i=Ii(Ui),null===e?(null===(a=Ki())&&(a=vc,o=Vi(),a.pooledCache=o,o.refCount++,null!==o&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:i,cache:a},ba(t),Mi(0,Ui,a)):(0!==(e.lanes&n)&&(wa(e,t),Ta(t,null,null,n),Ea()),a=e.memoizedState,o=t.memoizedState,a.parent!==i?(a={parent:i,cache:i},t.memoizedState=a,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=a),Mi(0,Ui,i)):(i=o.cache,Mi(0,Ui,i),i!==a.cache&&Oi(t,[Ui],n,!0))),Fs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){if((t=!!(32&e.mode))&&(t=!1),t){if(e.flags|=16777216,(335544128&i)===i)if(e.stateNode.complete)e.flags|=8192;else{if(!ou())throw sa=ra,ta;e.flags|=8192}}else e.flags&=-16777217}function fl(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!lf(t)){if(!ou())throw sa=ra,ta;e.flags|=8192}}function pl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Ne():536870912,e.lanes|=t,Oc|=t)}function hl(e,t){if(!hi)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ml(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=65011712&i.subtreeFlags,r|=65011712&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gl(e,t,n){var i=t.pendingProps;switch(ui(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return ml(t),null;case 3:return n=t.stateNode,i=null,null!==e&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Pi(Ui),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ki(t)?ul(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,_i())),ml(t),null;case 26:var a=t.type,o=t.memoizedState;return null===e?(ul(t),null!==o?(ml(t),fl(t,o)):(ml(t),dl(t,a,0,0,n))):o?o!==e.memoizedState?(ul(t),ml(t),fl(t,o)):(ml(t),t.flags&=-16777217):((e=e.memoizedProps)!==i&&ul(t),ml(t),dl(t,a,0,0,n)),null;case 27:if(Z(t),n=G.current,a=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if(!i){if(null===t.stateNode)throw Error(r(166));return ml(t),null}e=H.current,ki(t)?bi(t):(e=zd(a,i,n),t.stateNode=e,ul(t))}return ml(t),null;case 5:if(Z(t),a=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if(!i){if(null===t.stateNode)throw Error(r(166));return ml(t),null}if(o=H.current,ki(t))bi(t);else{var s=bd(G.current);switch(o){case 1:o=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:o=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":o=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":o=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":(o=s.createElement("div")).innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o="string"==typeof i.is?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o="string"==typeof i.is?s.createElement(a,{is:i.is}):s.createElement(a)}}o[$e]=t,o[We]=i;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)o.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;e:switch(md(o,a,i),a){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ul(t)}}return ml(t),dl(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if("string"!=typeof i&&null===t.stateNode)throw Error(r(166));if(e=G.current,ki(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,null!==(a=fi))switch(a.tag){case 27:case 5:i=a.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==i&&!0===i.suppressHydrationWarning||fd(e.nodeValue,n)))||yi(t,!0)}else(e=bd(e).createTextNode(i))[$e]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(i=ki(t),null!==n){if(null===e){if(!i)throw Error(r(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(r(557));e[$e]=t}else Si(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=_i(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ua(t),t):(Ua(t),null);if(128&t.flags)throw Error(r(558))}return ml(t),null;case 13:if(i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(a=ki(t),null!==i&&null!==i.dehydrated){if(null===e){if(!a)throw Error(r(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(r(317));a[$e]=t}else Si(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ml(t),a=!1}else a=_i(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return 256&t.flags?(Ua(t),t):(Ua(t),null)}return Ua(t),128&t.flags?(t.lanes=n,t):(n=null!==i,e=null!==e&&null!==e.memoizedState,n&&(a=null,null!==(i=t.child).alternate&&null!==i.alternate.memoizedState&&null!==i.alternate.memoizedState.cachePool&&(a=i.alternate.memoizedState.cachePool.pool),o=null,null!==i.memoizedState&&null!==i.memoizedState.cachePool&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),pl(t,t.updateQueue),ml(t),null);case 4:return K(),null===e&&nd(t.stateNode.containerInfo),ml(t),null;case 10:return Pi(t.type),ml(t),null;case 19:if(V(Va),null===(i=t.memoizedState))return ml(t),null;if(a=!!(128&t.flags),null===(o=i.rendering))if(a)hl(i,!1);else{if(0!==Ec||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=$a(e))){for(t.flags|=128,hl(i,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Wr(n,e),n=n.sibling;return $(Va,1&Va.current|2),hi&&si(t,i.treeForkCount),t.child}e=e.sibling}null!==i.tail&&ue()>Fc&&(t.flags|=128,a=!0,hl(i,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=$a(o))){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),hl(i,!0),null===i.tail&&"hidden"===i.tailMode&&!o.alternate&&!hi)return ml(t),null}else 2*ue()-i.renderingStartTime>Fc&&536870912!==n&&(t.flags|=128,a=!0,hl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=i.last)?e.sibling=o:t.child=o,i.last=o)}return null!==i.tail?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ue(),e.sibling=null,n=Va.current,$(Va,a?1&n|2:1&n),hi&&si(t,i.treeForkCount),e):(ml(t),null);case 22:case 23:return Ua(t),ja(),i=null!==t.memoizedState,null!==e?null!==e.memoizedState!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?!!(536870912&n)&&!(128&t.flags)&&(ml(t),6&t.subtreeFlags&&(t.flags|=8192)):ml(t),null!==(n=t.updateQueue)&&pl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),i=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),null!==e&&V(Yi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Pi(Ui),ml(t),null;case 25:case 30:return null}throw Error(r(156,t.tag))}function vl(e,t){switch(ui(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Pi(Ui),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return Z(t),null;case 31:if(null!==t.memoizedState){if(Ua(t),null===t.alternate)throw Error(r(340));Si()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ua(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(r(340));Si()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return V(Va),null;case 4:return K(),null;case 10:return Pi(t.type),null;case 22:case 23:return Ua(t),ja(),null!==e&&V(Yi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Pi(Ui),null;default:return null}}function yl(e,t){switch(ui(t),t.tag){case 3:Pi(Ui),K();break;case 26:case 27:case 5:Z(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ua(t);break;case 13:Ua(t);break;case 19:V(Va);break;case 10:Pi(t.type);break;case 22:case 23:Ua(t),ja(),null!==e&&V(Yi);break;case 24:Pi(Ui)}}function bl(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(s){Eu(t,t.return,s)}}function wl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(void 0!==s){o.destroy=void 0,i=t;var l=n,c=s;try{c()}catch(u){Eu(i,l,u)}}}r=r.next}while(r!==a)}}catch(u){Eu(t,t.return,u)}}function kl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Pa(t,n)}catch(r){Eu(e,e.return,r)}}}function Sl(e,t,n){n.props=Es(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Eu(e,t,r)}}function _l(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(i){Eu(e,t,i)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(i){Eu(e,t,i)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(a){Eu(e,t,a)}else n.current=null}function Cl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){Eu(e,e.return,i)}}function El(e,t,n){try{var i=e.stateNode;!function(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,o=null,s=null,l=null,c=null,u=null,d=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&null!=f)switch(h){case"checked":case"value":break;case"defaultValue":c=f;default:i.hasOwnProperty(h)||pd(e,t,h,null,i,f)}}for(var p in i){var h=i[p];if(f=n[p],i.hasOwnProperty(p)&&(null!=h||null!=f))switch(p){case"type":o=h;break;case"name":a=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":s=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(r(137,t));break;default:h!==f&&pd(e,t,p,h,i,f)}}return void wt(e,s,l,c,u,d,o,a);case"select":for(o in h=s=l=p=null,n)if(c=n[o],n.hasOwnProperty(o)&&null!=c)switch(o){case"value":break;case"multiple":h=c;default:i.hasOwnProperty(o)||pd(e,t,o,null,i,c)}for(a in i)if(o=i[a],c=n[a],i.hasOwnProperty(a)&&(null!=o||null!=c))switch(a){case"value":p=o;break;case"defaultValue":l=o;break;case"multiple":s=o;default:o!==c&&pd(e,t,a,o,i,c)}return t=l,n=s,i=h,void(null!=p?_t(e,!!n,p,!1):!!i!=!!n&&(null!=t?_t(e,!!n,t,!0):_t(e,!!n,n?[]:"",!1)));case"textarea":for(l in h=p=null,n)if(a=n[l],n.hasOwnProperty(l)&&null!=a&&!i.hasOwnProperty(l))switch(l){case"value":case"children":break;default:pd(e,t,l,null,i,a)}for(s in i)if(a=i[s],o=n[s],i.hasOwnProperty(s)&&(null!=a||null!=o))switch(s){case"value":p=a;break;case"defaultValue":h=a;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=a)throw Error(r(91));break;default:a!==o&&pd(e,t,s,a,i,o)}return void xt(e,p,h);case"option":for(var m in n)if(p=n[m],n.hasOwnProperty(m)&&null!=p&&!i.hasOwnProperty(m))if("selected"===m)e.selected=!1;else pd(e,t,m,null,i,p);for(c in i)if(p=i[c],h=n[c],i.hasOwnProperty(c)&&p!==h&&(null!=p||null!=h))if("selected"===c)e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p;else pd(e,t,c,p,i,h);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)p=n[g],n.hasOwnProperty(g)&&null!=p&&!i.hasOwnProperty(g)&&pd(e,t,g,null,i,p);for(u in i)if(p=i[u],h=n[u],i.hasOwnProperty(u)&&p!==h&&(null!=p||null!=h))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(r(137,t));break;default:pd(e,t,u,p,i,h)}return;default:if(At(t)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&void 0!==p&&!i.hasOwnProperty(v)&&hd(e,t,v,void 0,i,p);for(d in i)p=i[d],h=n[d],!i.hasOwnProperty(d)||p===h||void 0===p&&void 0===h||hd(e,t,d,p,i,h);return}}for(var y in n)p=n[y],n.hasOwnProperty(y)&&null!=p&&!i.hasOwnProperty(y)&&pd(e,t,y,null,i,p);for(f in i)p=i[f],h=n[f],!i.hasOwnProperty(f)||p===h||null==p&&null==h||pd(e,t,f,p,i,h)}(i,e.type,n,t),i[We]=t}catch(a){Eu(e,e.return,a)}}function Tl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Pd(e.type)||4===e.tag}function Ml(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Tl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Pd(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Pl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=jt));else if(4!==r&&(27===r&&Pd(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(Pl(e,t,n),e=e.sibling;null!==e;)Pl(e,t,n),e=e.sibling}function Al(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&Pd(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Al(e,t,n),e=e.sibling;null!==e;)Al(e,t,n),e=e.sibling}function Ol(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);md(t,r,n),t[$e]=e,t[We]=n}catch(a){Eu(e,e.return,a)}}var Nl=!1,Ll=!1,jl=!1,Il="function"==typeof WeakSet?WeakSet:Set,Rl=null;function Fl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Kl(e,n),4&r&&bl(5,n);break;case 1:if(Kl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(o){Eu(n,n.return,o)}else{var i=Es(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Eu(n,n.return,s)}}64&r&&kl(n),512&r&&_l(n,n.return);break;case 3:if(Kl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{Pa(e,t)}catch(o){Eu(n,n.return,o)}}break;case 27:null===t&&4&r&&Ol(n);case 26:case 5:Kl(e,n),null===t&&4&r&&Cl(n),512&r&&_l(n,n.return);break;case 12:Kl(e,n);break;case 31:Kl(e,n),4&r&&$l(e,n);break;case 13:Kl(e,n),4&r&&Wl(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Au.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||Nl)){t=null!==t&&null!==t.memoizedState||Ll,i=Nl;var a=Ll;Nl=r,(Ll=t)&&!a?Zl(e,n,!!(8772&n.subtreeFlags)):Kl(e,n),Nl=i,Ll=a}break;case 30:break;default:Kl(e,n)}}function Dl(e){var t=e.alternate;null!==t&&(e.alternate=null,Dl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ke(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Bl=null,zl=!1;function Ul(e,t,n){for(n=n.child;null!==n;)Vl(e,t,n),n=n.sibling}function Vl(e,t,n){if(we&&"function"==typeof we.onCommitFiberUnmount)try{we.onCommitFiberUnmount(be,n)}catch(a){}switch(n.tag){case 26:Ll||xl(n,t),Ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Ll||xl(n,t);var r=Bl,i=zl;Pd(n.type)&&(Bl=n.stateNode,zl=!1),Ul(e,t,n),Ud(n.stateNode),Bl=r,zl=i;break;case 5:Ll||xl(n,t);case 6:if(r=Bl,i=zl,Bl=null,Ul(e,t,n),zl=i,null!==(Bl=r))if(zl)try{(9===Bl.nodeType?Bl.body:"HTML"===Bl.nodeName?Bl.ownerDocument.body:Bl).removeChild(n.stateNode)}catch(o){Eu(n,t,o)}else try{Bl.removeChild(n.stateNode)}catch(o){Eu(n,t,o)}break;case 18:null!==Bl&&(zl?(Ad(9===(e=Bl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Gf(e)):Ad(Bl,n.stateNode));break;case 4:r=Bl,i=zl,Bl=n.stateNode.containerInfo,zl=!0,Ul(e,t,n),Bl=r,zl=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),Ll||wl(4,n,t),Ul(e,t,n);break;case 1:Ll||(xl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&Sl(n,t,r)),Ul(e,t,n);break;case 21:Ul(e,t,n);break;case 22:Ll=(r=Ll)||null!==n.memoizedState,Ul(e,t,n),Ll=r;break;default:Ul(e,t,n)}}function $l(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{Gf(e)}catch(n){Eu(t,t.return,n)}}}function Wl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Gf(e)}catch(n){Eu(t,t.return,n)}}function ql(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Il),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Il),t;default:throw Error(r(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ou.bind(null,e,t);t.then(r,r)}})}function Hl(e,t){var n=t.deletions;if(null!==n)for(var i=0;i<n.length;i++){var a=n[i],o=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 27:if(Pd(l.type)){Bl=l.stateNode,zl=!1;break e}break;case 5:Bl=l.stateNode,zl=!1;break e;case 3:case 4:Bl=l.stateNode.containerInfo,zl=!0;break e}l=l.return}if(null===Bl)throw Error(r(160));Vl(o,s,a),Bl=null,zl=!1,null!==(o=a.alternate)&&(o.return=null),a.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Gl(t,e),t=t.sibling}var Jl=null;function Gl(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Hl(t,e),Ql(e),4&i&&(wl(3,e,e.return),bl(3,e),wl(5,e,e.return));break;case 1:Hl(t,e),Ql(e),512&i&&(Ll||null===n||xl(n,n.return)),64&i&&Nl&&(null!==(e=e.updateQueue)&&(null!==(i=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?i:n.concat(i))));break;case 26:var a=Jl;if(Hl(t,e),Ql(e),512&i&&(Ll||null===n||xl(n,n.return)),4&i){var o=null!==n?n.memoizedState:null;if(i=e.memoizedState,null===n)if(null===i)if(null===e.stateNode){e:{i=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(i){case"title":(!(o=a.getElementsByTagName("title")[0])||o[Ye]||o[$e]||"http://www.w3.org/2000/svg"===o.namespaceURI||o.hasAttribute("itemprop"))&&(o=a.createElement(i),a.head.insertBefore(o,a.querySelector("head > title"))),md(o,i,n),o[$e]=e,nt(o),i=o;break e;case"link":var s=of("link","href",a).get(i+(n.href||""));if(s)for(var l=0;l<s.length;l++)if((o=s[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&o.getAttribute("rel")===(null==n.rel?null:n.rel)&&o.getAttribute("title")===(null==n.title?null:n.title)&&o.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){s.splice(l,1);break t}md(o=a.createElement(i),i,n),a.head.appendChild(o);break;case"meta":if(s=of("meta","content",a).get(i+(n.content||"")))for(l=0;l<s.length;l++)if((o=s[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&o.getAttribute("name")===(null==n.name?null:n.name)&&o.getAttribute("property")===(null==n.property?null:n.property)&&o.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&o.getAttribute("charset")===(null==n.charSet?null:n.charSet)){s.splice(l,1);break t}md(o=a.createElement(i),i,n),a.head.appendChild(o);break;default:throw Error(r(468,i))}o[$e]=e,nt(o),i=o}e.stateNode=i}else sf(a,e.type,e.stateNode);else e.stateNode=ef(a,i,e.memoizedProps);else o!==i?(null===o?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):o.count--,null===i?sf(a,e.type,e.stateNode):ef(a,i,e.memoizedProps)):null===i&&null!==e.stateNode&&El(e,e.memoizedProps,n.memoizedProps)}break;case 27:Hl(t,e),Ql(e),512&i&&(Ll||null===n||xl(n,n.return)),null!==n&&4&i&&El(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Hl(t,e),Ql(e),512&i&&(Ll||null===n||xl(n,n.return)),32&e.flags){a=e.stateNode;try{Et(a,"")}catch(m){Eu(e,e.return,m)}}4&i&&null!=e.stateNode&&El(e,a=e.memoizedProps,null!==n?n.memoizedProps:a),1024&i&&(jl=!0);break;case 6:if(Hl(t,e),Ql(e),4&i){if(null===e.stateNode)throw Error(r(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(m){Eu(e,e.return,m)}}break;case 3:if(af=null,a=Jl,Jl=Wd(t.containerInfo),Hl(t,e),Jl=a,Ql(e),4&i&&null!==n&&n.memoizedState.isDehydrated)try{Gf(t.containerInfo)}catch(m){Eu(e,e.return,m)}jl&&(jl=!1,Yl(e));break;case 4:i=Jl,Jl=Wd(e.stateNode.containerInfo),Hl(t,e),Ql(e),Jl=i;break;case 12:default:Hl(t,e),Ql(e);break;case 31:case 19:Hl(t,e),Ql(e),4&i&&(null!==(i=e.updateQueue)&&(e.updateQueue=null,ql(e,i)));break;case 13:Hl(t,e),Ql(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(Ic=ue()),4&i&&(null!==(i=e.updateQueue)&&(e.updateQueue=null,ql(e,i)));break;case 22:a=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=Nl,d=Ll;if(Nl=u||a,Ll=d||c,Hl(t,e),Ll=d,Nl=u,Ql(e),8192&i)e:for(t=e.stateNode,t._visibility=a?-2&t._visibility:1|t._visibility,a&&(null===n||c||Nl||Ll||Xl(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(o=c.stateNode,a)"function"==typeof(s=o.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,p=null!=f&&f.hasOwnProperty("display")?f.display:null;l.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(m){Eu(c,c.return,m)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(m){Eu(c,c.return,m)}}}else if(18===t.tag){if(null===n){c=t;try{var h=c.stateNode;a?Od(h,!0):Od(c.stateNode,!1)}catch(m){Eu(c,c.return,m)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&i&&(null!==(i=e.updateQueue)&&(null!==(n=i.retryQueue)&&(i.retryQueue=null,ql(e,n))));case 30:case 21:}}function Ql(e){var t=e.flags;if(2&t){try{for(var n,i=e.return;null!==i;){if(Tl(i)){n=i;break}i=i.return}if(null==n)throw Error(r(160));switch(n.tag){case 27:var a=n.stateNode;Al(e,Ml(e),a);break;case 5:var o=n.stateNode;32&n.flags&&(Et(o,""),n.flags&=-33),Al(e,Ml(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Pl(e,Ml(e),s);break;default:throw Error(r(161))}}catch(l){Eu(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Yl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Yl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Kl(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Fl(e,t.alternate,t),t=t.sibling}function Xl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:wl(4,t,t.return),Xl(t);break;case 1:xl(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&Sl(t,t.return,n),Xl(t);break;case 27:Ud(t.stateNode);case 26:case 5:xl(t,t.return),Xl(t);break;case 22:null===t.memoizedState&&Xl(t);break;default:Xl(t)}e=e.sibling}}function Zl(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Zl(i,a,n),bl(4,a);break;case 1:if(Zl(i,a,n),"function"==typeof(i=(r=a).stateNode).componentDidMount)try{i.componentDidMount()}catch(c){Eu(r,r.return,c)}if(null!==(i=(r=a).updateQueue)){var s=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(null!==l)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Ma(l[i],s)}catch(c){Eu(r,r.return,c)}}n&&64&o&&kl(a),_l(a,a.return);break;case 27:Ol(a);case 26:case 5:Zl(i,a,n),n&&null===r&&4&o&&Cl(a),_l(a,a.return);break;case 12:Zl(i,a,n);break;case 31:Zl(i,a,n),n&&4&o&&$l(i,a);break;case 13:Zl(i,a,n),n&&4&o&&Wl(i,a);break;case 22:null===a.memoizedState&&Zl(i,a,n),_l(a,a.return);break;case 30:break;default:Zl(i,a,n)}t=t.sibling}}function ec(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&$i(n))}function tc(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&$i(e))}function nc(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)rc(e,t,n,r),t=t.sibling}function rc(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:nc(e,t,n,r),2048&i&&bl(9,t);break;case 1:case 31:case 13:default:nc(e,t,n,r);break;case 3:nc(e,t,n,r),2048&i&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&$i(e)));break;case 12:if(2048&i){nc(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;"function"==typeof s&&s(o,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Eu(t,t.return,l)}}else nc(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,null!==t.memoizedState?2&a._visibility?nc(e,t,n,r):ac(e,t):2&a._visibility?nc(e,t,n,r):(a._visibility|=2,ic(e,t,n,r,!!(10256&t.subtreeFlags)||!1)),2048&i&&ec(o,t);break;case 24:nc(e,t,n,r),2048&i&&tc(t.alternate,t)}}function ic(e,t,n,r,i){for(i=i&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var a=e,o=t,s=n,l=r,c=o.flags;switch(o.tag){case 0:case 11:case 15:ic(a,o,s,l,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;null!==o.memoizedState?2&u._visibility?ic(a,o,s,l,i):ac(a,o):(u._visibility|=2,ic(a,o,s,l,i)),i&&2048&c&&ec(o.alternate,o);break;case 24:ic(a,o,s,l,i),i&&2048&c&&tc(o.alternate,o);break;default:ic(a,o,s,l,i)}t=t.sibling}}function ac(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:ac(n,r),2048&i&&ec(r.alternate,r);break;case 24:ac(n,r),2048&i&&tc(r.alternate,r);break;default:ac(n,r)}t=t.sibling}}var oc=8192;function sc(e,t,n){if(e.subtreeFlags&oc)for(e=e.child;null!==e;)lc(e,t,n),e=e.sibling}function lc(e,t,n){switch(e.tag){case 26:sc(e,t,n),e.flags&oc&&null!==e.memoizedState&&function(e,t,n,r){if(!("stylesheet"!==n.type||"string"==typeof r.media&&!1===matchMedia(r.media).matches||4&n.state.loading)){if(null===n.instance){var i=Qd(r.href),a=t.querySelector(Yd(i));if(a)return null!==(t=a._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=uf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,void nt(a);a=t.ownerDocument||t,r=Kd(r),(i=Vd.get(i))&&nf(r,i),nt(a=a.createElement("link"));var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),md(a,"link",r),n.instance=a}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=uf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,Jl,e.memoizedState,e.memoizedProps);break;case 5:default:sc(e,t,n);break;case 3:case 4:var r=Jl;Jl=Wd(e.stateNode.containerInfo),sc(e,t,n),Jl=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=oc,oc=16777216,sc(e,t,n),oc=r):sc(e,t,n))}}function cc(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function uc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Rl=r,pc(r,e)}cc(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)dc(e),e=e.sibling}function dc(e){switch(e.tag){case 0:case 11:case 15:uc(e),2048&e.flags&&wl(9,e,e.return);break;case 3:case 12:default:uc(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,fc(e)):uc(e)}}function fc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Rl=r,pc(r,e)}cc(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:wl(8,t,t.return),fc(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,fc(t));break;default:fc(t)}e=e.sibling}}function pc(e,t){for(;null!==Rl;){var n=Rl;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:$i(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,Rl=r;else e:for(n=e;null!==Rl;){var i=(r=Rl).sibling,a=r.return;if(Dl(r),r===n){Rl=null;break e}if(null!==i){i.return=a,Rl=i;break e}Rl=a}}}var hc={getCacheForType:function(e){var t=Ii(Ui),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ii(Ui).controller.signal}},mc="function"==typeof WeakMap?WeakMap:Map,gc=0,vc=null,yc=null,bc=0,wc=0,kc=null,Sc=!1,_c=!1,xc=!1,Cc=0,Ec=0,Tc=0,Mc=0,Pc=0,Ac=0,Oc=0,Nc=null,Lc=null,jc=!1,Ic=0,Rc=0,Fc=1/0,Dc=null,Bc=null,zc=0,Uc=null,Vc=null,$c=0,Wc=0,qc=null,Hc=null,Jc=0,Gc=null;function Qc(){return 2&gc&&0!==bc?bc&-bc:null!==j.T?qu():ze()}function Yc(){if(0===Ac)if(536870912&bc&&!hi)Ac=536870912;else{var e=Ee;!(3932160&(Ee<<=1))&&(Ee=262144),Ac=e}return null!==(e=Ia.current)&&(e.flags|=32),Ac}function Kc(e,t,n){(e!==vc||2!==wc&&9!==wc)&&null===e.cancelPendingCommit||(iu(e,0),tu(e,bc,Ac,!1)),je(e,n),2&gc&&e===vc||(e===vc&&(!(2&gc)&&(Mc|=n),4===Ec&&tu(e,bc,Ac,!1)),Du(e))}function Xc(e,t,n){if(6&gc)throw Error(r(327));for(var i=!n&&!(127&t)&&0===(t&e.expiredLanes)||Ae(e,t),a=i?function(e,t){var n=gc;gc|=2;var i=su(),a=lu();vc!==e||bc!==t?(Dc=null,Fc=ue()+500,iu(e,t)):_c=Ae(e,t);e:for(;;)try{if(0!==wc&&null!==yc){t=yc;var o=kc;t:switch(wc){case 1:wc=0,kc=null,mu(e,t,o,1);break;case 2:case 9:if(ia(o)){wc=0,kc=null,hu(t);break}t=function(){2!==wc&&9!==wc||vc!==e||(wc=7),Du(e)},o.then(t,t);break e;case 3:wc=7;break e;case 4:wc=5;break e;case 7:ia(o)?(wc=0,kc=null,hu(t)):(wc=0,kc=null,mu(e,t,o,7));break;case 5:var s=null;switch(yc.tag){case 26:s=yc.memoizedState;case 5:case 27:var l=yc;if(s?lf(s):l.stateNode.complete){wc=0,kc=null;var c=l.sibling;if(null!==c)yc=c;else{var u=l.return;null!==u?(yc=u,gu(u)):yc=null}break t}}wc=0,kc=null,mu(e,t,o,5);break;case 6:wc=0,kc=null,mu(e,t,o,6);break;case 8:ru(),Ec=6;break e;default:throw Error(r(462))}}fu();break}catch(d){au(e,d)}return Ti=Ei=null,j.H=i,j.A=a,gc=n,null!==yc?0:(vc=null,bc=0,Lr(),Ec)}(e,t):uu(e,t,!0),o=i;;){if(0===a){_c&&!i&&tu(e,t,0,!1);break}if(n=e.current.alternate,!o||eu(n)){if(2===a){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;a=Nc;var c=l.current.memoizedState.isDehydrated;if(c&&(iu(l,s).flags|=256),2!==(s=uu(l,s,!1))){if(xc&&!c){l.errorRecoveryDisabledLanes|=o,Mc|=o,a=4;break e}o=Lc,Lc=a,null!==o&&(null===Lc?Lc=o:Lc.push.apply(Lc,o))}a=s}if(o=!1,2!==a)continue}}if(1===a){iu(e,0),tu(e,t,0,!0);break}e:{switch(i=e,o=a){case 0:case 1:throw Error(r(345));case 4:if((4194048&t)!==t)break;case 6:tu(i,t,Ac,!Sc);break e;case 2:Lc=null;break;case 3:case 5:break;default:throw Error(r(329))}if((62914560&t)===t&&10<(a=Ic+300-ue())){if(tu(i,t,Ac,!Sc),0!==Pe(i,0,!0))break e;$c=t,i.timeoutHandle=xd(Zc.bind(null,i,n,Lc,Dc,jc,t,Ac,Mc,Oc,Sc,o,"Throttled",-0,0),a)}else Zc(i,n,Lc,Dc,jc,t,Ac,Mc,Oc,Sc,o,null,-0,0)}break}a=uu(e,t,!1),o=!1}Du(e)}function Zc(e,t,n,r,i,a,o,s,l,c,u,d,f,p){if(e.timeoutHandle=-1,8192&(d=t.subtreeFlags)||!(16785408&~d)){lc(t,a,d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jt});var h=(62914560&a)===a?Ic-ue():(4194048&a)===a?Rc-ue():0;if(null!==(h=function(e,t){return e.stylesheets&&0===e.count&&ff(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ff(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&0===cf&&(cf=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&gd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&gd(d)&&(o+=u*((l=l.responseEnd)<s?1:(s-c)/(l-c)))}if(--r,t+=8*(a+o)/(i.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var i=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&ff(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>cf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(d,h)))return $c=a,e.cancelPendingCommit=h(yu.bind(null,e,t,a,n,r,i,o,s,l,u,d,null,f,p)),void tu(e,a,o,!c)}yu(e,t,a,n,r,i,o,s,l)}function eu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!er(a(),i))return!1}catch(o){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function tu(e,t,n,r){t&=~Pc,t&=~Mc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Se(i),o=1<<a;r[a]=-1,i&=~o}0!==n&&Ie(e,n,t)}function nu(){return!!(6&gc)||(Bu(0),!1)}function ru(){if(null!==yc){if(0===wc)var e=yc.return;else Ti=Ei=null,co(e=yc),ua=null,da=0,e=yc;for(;null!==e;)yl(e.alternate,e),e=e.return;yc=null}}function iu(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,Cd(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),$c=0,ru(),vc=e,yc=n=$r(e.current,null),bc=t,wc=0,kc=null,Sc=!1,_c=Ae(e,t),xc=!1,Oc=Ac=Pc=Mc=Tc=Ec=0,Lc=Nc=null,jc=!1,8&t&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var i=31-Se(r),a=1<<i;t|=e[i],r&=~a}return Cc=t,Lr(),n}function au(e,t){qa=null,j.H=ys,t===ea||t===na?(t=la(),wc=3):t===ta?(t=la(),wc=4):wc=t===Is?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,kc=t,null===yc&&(Ec=1,As(e,Kr(t,e.current)))}function ou(){var e=Ia.current;return null===e||((4194048&bc)===bc?null===Ra:!!((62914560&bc)===bc||536870912&bc)&&e===Ra)}function su(){var e=j.H;return j.H=ys,null===e?ys:e}function lu(){var e=j.A;return j.A=hc,e}function cu(){Ec=4,Sc||(4194048&bc)!==bc&&null!==Ia.current||(_c=!0),!(134217727&Tc)&&!(134217727&Mc)||null===vc||tu(vc,bc,Ac,!1)}function uu(e,t,n){var r=gc;gc|=2;var i=su(),a=lu();vc===e&&bc===t||(Dc=null,iu(e,t)),t=!1;var o=Ec;e:for(;;)try{if(0!==wc&&null!==yc){var s=yc,l=kc;switch(wc){case 8:ru(),o=6;break e;case 3:case 2:case 9:case 6:null===Ia.current&&(t=!0);var c=wc;if(wc=0,kc=null,mu(e,s,l,c),n&&_c){o=0;break e}break;default:c=wc,wc=0,kc=null,mu(e,s,l,c)}}du(),o=Ec;break}catch(u){au(e,u)}return t&&e.shellSuspendCounter++,Ti=Ei=null,gc=r,j.H=i,j.A=a,null===yc&&(vc=null,bc=0,Lr()),o}function du(){for(;null!==yc;)pu(yc)}function fu(){for(;null!==yc&&!le();)pu(yc)}function pu(e){var t=cl(e.alternate,e,Cc);e.memoizedProps=e.pendingProps,null===t?gu(e):yc=t}function hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gs(n,t,t.pendingProps,t.type,void 0,bc);break;case 11:t=Gs(n,t,t.pendingProps,t.type.render,t.ref,bc);break;case 5:co(t);default:yl(n,t),t=cl(n,t=yc=Wr(t,Cc),Cc)}e.memoizedProps=e.pendingProps,null===t?gu(e):yc=t}function mu(e,t,n,i){Ti=Ei=null,co(t),ua=null,da=0;var a=t.return;try{if(function(e,t,n,i,a){if(n.flags|=32768,null!==i&&"object"==typeof i&&"function"==typeof i.then){if(null!==(t=n.alternate)&&Ni(t,n,a,!0),null!==(n=Ia.current)){switch(n.tag){case 31:case 13:return null===Ra?cu():null===n.alternate&&0===Ec&&(Ec=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===ra?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([i]):t.add(i),Tu(e,i,a)),!1;case 22:return n.flags|=65536,i===ra?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([i]):n.add(i),Tu(e,i,a)),!1}throw Error(r(435,n.tag))}return Tu(e,i,a),cu(),!1}if(hi)return null!==(t=Ia.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==vi&&xi(Kr(e=Error(r(422),{cause:i}),n))):(i!==vi&&xi(Kr(t=Error(r(423),{cause:i}),n)),(e=e.current.alternate).flags|=65536,a&=-a,e.lanes|=a,i=Kr(i,n),xa(e,a=Ns(e.stateNode,i,a)),4!==Ec&&(Ec=2)),!1;var o=Error(r(520),{cause:i});if(o=Kr(o,n),null===Nc?Nc=[o]:Nc.push(o),4!==Ec&&(Ec=2),null===t)return!0;i=Kr(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,xa(n,e=Ns(n.stateNode,i,e)),!1;case 1:if(t=n.type,o=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===o||"function"!=typeof o.componentDidCatch||null!==Bc&&Bc.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,js(a=Ls(a),e,n,i),xa(n,a),!1}n=n.return}while(null!==n);return!1}(e,a,t,n,bc))return Ec=1,As(e,Kr(n,e.current)),void(yc=null)}catch(o){if(null!==a)throw yc=a,o;return Ec=1,As(e,Kr(n,e.current)),void(yc=null)}32768&t.flags?(hi||1===i?e=!0:_c||536870912&bc?e=!1:(Sc=e=!0,(2===i||9===i||3===i||6===i)&&(null!==(i=Ia.current)&&13===i.tag&&(i.flags|=16384))),vu(t,e)):gu(t)}function gu(e){var t=e;do{if(32768&t.flags)return void vu(t,Sc);e=t.return;var n=gl(t.alternate,t,Cc);if(null!==n)return void(yc=n);if(null!==(t=t.sibling))return void(yc=t);yc=t=e}while(null!==t);0===Ec&&(Ec=5)}function vu(e,t){do{var n=vl(e.alternate,e);if(null!==n)return n.flags&=32767,void(yc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(yc=e);yc=e=n}while(null!==e);Ec=6,yc=null}function yu(e,t,n,i,a,o,s,l,c){e.cancelPendingCommit=null;do{_u()}while(0!==zc);if(6&gc)throw Error(r(327));if(null!==t){if(t===e.current)throw Error(r(177));if(o=t.lanes|t.childLanes,function(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Se(n),d=1<<u;s[u]=0,l[u]=-1;var f=c[u];if(null!==f)for(c[u]=null,u=0;u<f.length;u++){var p=f[u];null!==p&&(p.lane&=-536870913)}n&=~d}0!==r&&Ie(e,r,0),0!==a&&0===i&&0!==e.tag&&(e.suspendedLanes|=a&~(o&~t))}(e,n,o|=Nr,s,l,c),e===vc&&(yc=vc=null,bc=0),Vc=t,Uc=e,$c=n,Wc=o,qc=a,Hc=i,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,oe(he,function(){return xu(),null})):(e.callbackNode=null,e.callbackPriority=0),i=!!(13878&t.flags),13878&t.subtreeFlags||i){i=j.T,j.T=null,a=R.p,R.p=2,s=gc,gc|=4;try{!function(e,t){if(e=e.containerInfo,vd=_f,or(e=ar(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(i&&0!==i.rangeCount){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch(g){n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||0!==a&&3!==f.nodeType||(l=s+a),f!==o||0!==i&&3!==f.nodeType||(c=s+i),3===f.nodeType&&(s+=f.nodeValue.length),null!==(h=f.firstChild);)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===a&&(l=s),p===o&&++d===i&&(c=s),null!==(h=f.nextSibling))break;p=(f=p).parentNode}f=h}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(yd={focusedElem:e,selectionRange:n},_f=!1,Rl=t;null!==Rl;)if(e=(t=Rl).child,1028&t.subtreeFlags&&null!==e)e.return=t,Rl=e;else for(;null!==Rl;){switch(o=(t=Rl).alternate,e=t.flags,t.tag){case 0:if(4&e&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(a=e[n]).ref.impl=a.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==o){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,i=n.stateNode;try{var m=Es(n.type,a);e=i.getSnapshotBeforeUpdate(m,o),i.__reactInternalSnapshotBeforeUpdate=e}catch(v){Eu(n,n.return,v)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))Nd(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nd(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(r(163))}if(null!==(e=t.sibling)){e.return=t.return,Rl=e;break}Rl=t.return}}(e,t)}finally{gc=s,R.p=a,j.T=i}}zc=1,bu(),wu(),ku()}}function bu(){if(1===zc){zc=0;var e=Uc,t=Vc,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=j.T,j.T=null;var r=R.p;R.p=2;var i=gc;gc|=4;try{Gl(t,e);var a=yd,o=ar(e.containerInfo),s=a.focusedElem,l=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&ir(s.ownerDocument.documentElement,s)){if(null!==l&&or(s)){var c=l.start,u=l.end;if(void 0===u&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),h=s.textContent.length,m=Math.min(l.start,h),g=void 0===l.end?m:Math.min(l.end,h);!p.extend&&m>g&&(o=g,g=m,m=o);var v=rr(s,m),y=rr(s,g);if(v&&y&&(1!==p.rangeCount||p.anchorNode!==v.node||p.anchorOffset!==v.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var b=d.createRange();b.setStart(v.node,v.offset),p.removeAllRanges(),m>g?(p.addRange(b),p.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),p.addRange(b))}}}}for(d=[],p=s;p=p.parentNode;)1===p.nodeType&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<d.length;s++){var w=d[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}_f=!!vd,yd=vd=null}finally{gc=i,R.p=r,j.T=n}}e.current=t,zc=2}}function wu(){if(2===zc){zc=0;var e=Uc,t=Vc,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=j.T,j.T=null;var r=R.p;R.p=2;var i=gc;gc|=4;try{Fl(e,t.alternate,t)}finally{gc=i,R.p=r,j.T=n}}zc=3}}function ku(){if(4===zc||3===zc){zc=0,ce();var e=Uc,t=Vc,n=$c,r=Hc;10256&t.subtreeFlags||10256&t.flags?zc=5:(zc=0,Vc=Uc=null,Su(e,e.pendingLanes));var i=e.pendingLanes;if(0===i&&(Bc=null),Be(n),t=t.stateNode,we&&"function"==typeof we.onCommitFiberRoot)try{we.onCommitFiberRoot(be,t,void 0,!(128&~t.current.flags))}catch(l){}if(null!==r){t=j.T,i=R.p,R.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,R.p=i}}3&$c&&_u(),Du(e),i=e.pendingLanes,261930&n&&42&i?e===Gc?Jc++:(Jc=0,Gc=e):Jc=0,Bu(0)}}function Su(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,$i(t)))}function _u(){return bu(),wu(),ku(),xu()}function xu(){if(5!==zc)return!1;var e=Uc,t=Wc;Wc=0;var n=Be($c),i=j.T,a=R.p;try{R.p=32>n?32:n,j.T=null,n=qc,qc=null;var o=Uc,s=$c;if(zc=0,Vc=Uc=null,$c=0,6&gc)throw Error(r(331));var l=gc;if(gc|=4,dc(o.current),rc(o,o.current,s,n),gc=l,Bu(0,!1),we&&"function"==typeof we.onPostCommitFiberRoot)try{we.onPostCommitFiberRoot(be,o)}catch(c){}return!0}finally{R.p=a,j.T=i,Su(e,t)}}function Cu(e,t,n){t=Kr(n,t),null!==(e=Sa(e,t=Ns(e.stateNode,t,2),2))&&(je(e,2),Du(e))}function Eu(e,t,n){if(3===e.tag)Cu(e,e,n);else for(;null!==t;){if(3===t.tag){Cu(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Bc||!Bc.has(r))){e=Kr(n,e),null!==(r=Sa(t,n=Ls(2),2))&&(js(n,r,t,e),je(r,2),Du(r));break}}t=t.return}}function Tu(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new mc;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(xc=!0,i.add(n),e=Mu.bind(null,e,t,n),t.then(e,e))}function Mu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,vc===e&&(bc&n)===n&&(4===Ec||3===Ec&&(62914560&bc)===bc&&300>ue()-Ic?!(2&gc)&&iu(e,0):Pc|=n,Oc===bc&&(Oc=0)),Du(e)}function Pu(e,t){0===t&&(t=Ne()),null!==(e=Rr(e,t))&&(je(e,t),Du(e))}function Au(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Pu(e,n)}function Ou(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}null!==i&&i.delete(t),Pu(e,n)}var Nu=null,Lu=null,ju=!1,Iu=!1,Ru=!1,Fu=0;function Du(e){e!==Lu&&null===e.next&&(null===Lu?Nu=Lu=e:Lu=Lu.next=e),Iu=!0,ju||(ju=!0,Td(function(){6&gc?oe(fe,zu):Uu()}))}function Bu(e,t){if(!Ru&&Iu){Ru=!0;do{for(var n=!1,r=Nu;null!==r;){if(0!==e){var i=r.pendingLanes;if(0===i)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Se(42|e)+1)-1,a=201326741&(a&=i&~(o&~s))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,Wu(r,a))}else a=bc,!(3&(a=Pe(r,r===vc?a:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Ae(r,a)||(n=!0,Wu(r,a));r=r.next}}while(n);Ru=!1}}function zu(){Uu()}function Uu(){Iu=ju=!1;var e=0;0!==Fu&&function(){var e=window.event;if(e&&"popstate"===e.type)return e!==_d&&(_d=e,!0);return _d=null,!1}()&&(e=Fu);for(var t=ue(),n=null,r=Nu;null!==r;){var i=r.next,a=Vu(r,t);0===a?(r.next=null,null===n?Nu=i:n.next=i,null===i&&(Lu=n)):(n=r,(0!==e||3&a)&&(Iu=!0)),r=i}0!==zc&&5!==zc||Bu(e),0!==Fu&&(Fu=0)}function Vu(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var o=31-Se(a),s=1<<o,l=i[o];-1===l?0!==(s&n)&&0===(s&r)||(i[o]=Oe(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}if(n=bc,n=Pe(e,e===(t=vc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===wc||9===wc)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&se(r),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||Ae(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&se(r),Be(n)){case 2:case 8:n=pe;break;case 32:default:n=he;break;case 268435456:n=ge}return r=$u.bind(null,e),n=oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&se(r),e.callbackPriority=2,e.callbackNode=null,2}function $u(e,t){if(0!==zc&&5!==zc)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_u()&&e.callbackNode!==n)return null;var r=bc;return 0===(r=Pe(e,e===vc?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Xc(e,r,t),Vu(e,ue()),null!=e.callbackNode&&e.callbackNode===n?$u.bind(null,e):null)}function Wu(e,t){if(_u())return null;Xc(e,t,!0)}function qu(){if(0===Fu){var e=Hi;0===e&&(e=Ce,!(261888&(Ce<<=1))&&(Ce=256)),Fu=e}return Fu}function Hu(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Lt(""+e)}function Ju(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Gu=0;Gu<Tr.length;Gu++){var Qu=Tr[Gu];Mr(Qu.toLowerCase(),"on"+(Qu[0].toUpperCase()+Qu.slice(1)))}Mr(br,"onAnimationEnd"),Mr(wr,"onAnimationIteration"),Mr(kr,"onAnimationStart"),Mr("dblclick","onDoubleClick"),Mr("focusin","onFocus"),Mr("focusout","onBlur"),Mr(Sr,"onTransitionRun"),Mr(_r,"onTransitionStart"),Mr(xr,"onTransitionCancel"),Mr(Cr,"onTransitionEnd"),ot("onMouseEnter",["mouseout","mouseover"]),ot("onMouseLeave",["mouseout","mouseover"]),ot("onPointerEnter",["pointerout","pointerover"]),ot("onPointerLeave",["pointerout","pointerover"]),at("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),at("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),at("onBeforeInput",["compositionend","keypress","textInput","paste"]),at("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ku=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yu));function Xu(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(u){Pr(u)}i.currentTarget=null,a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(u){Pr(u)}i.currentTarget=null,a=l}}}}function Zu(e,t){var n=t[He];void 0===n&&(n=t[He]=new Set);var r=e+"__bubble";n.has(r)||(rd(t,e,2,!1),n.add(r))}function ed(e,t,n){var r=0;t&&(r|=4),rd(n,e,r,t)}var td="_reactListening"+Math.random().toString(36).slice(2);function nd(e){if(!e[td]){e[td]=!0,rt.forEach(function(t){"selectionchange"!==t&&(Ku.has(t)||ed(t,!1,e),ed(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[td]||(t[td]=!0,ed("selectionchange",!1,t))}}function rd(e,t,n,r){switch(Af(t)){case 2:var i=xf;break;case 8:i=Cf;break;default:i=Ef}n=i.bind(null,t,n,e),i=void 0,!Wt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function id(e,t,n,r,i){var o=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var l=r.stateNode.containerInfo;if(l===i)break;if(4===s)for(s=r.return;null!==s;){var c=s.tag;if((3===c||4===c)&&s.stateNode.containerInfo===i)return;s=s.return}for(;null!==l;){if(null===(s=Xe(l)))return;if(5===(c=s.tag)||6===c||26===c||27===c){r=o=s;continue e}l=l.parentNode}}r=r.return}Ut(function(){var r=o,i=Rt(n),s=[];e:{var l=Er.get(e);if(void 0!==l){var c=an,u=e;switch(e){case"keypress":if(0===Yt(n))break e;case"keydown":case"keyup":c=wn;break;case"focusin":u="focus",c=dn;break;case"focusout":u="blur",c=dn;break;case"beforeblur":case"afterblur":c=dn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=cn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=un;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=Sn;break;case br:case wr:case kr:c=fn;break;case Cr:c=_n;break;case"scroll":case"scrollend":c=sn;break;case"wheel":c=xn;break;case"copy":case"cut":case"paste":c=pn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=kn;break;case"toggle":case"beforetoggle":c=Cn}var d=!!(4&t),f=!d&&("scroll"===e||"scrollend"===e),p=d?null!==l?l+"Capture":null:l;d=[];for(var h,m=r;null!==m;){var g=m;if(h=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===h||null===p||null!=(g=Vt(m,p))&&d.push(ad(m,g,h)),f)break;m=m.return}0<d.length&&(l=new c(l,u,null,n,i),s.push({event:l,listeners:d}))}}if(!(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===It||!(u=n.relatedTarget||n.fromElement)||!Xe(u)&&!u[qe])&&(c||l)&&(l=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?Xe(u):null)&&(f=a(u),d=u.tag,u!==f||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=r),c!==u)){if(d=cn,g="onMouseLeave",p="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(d=kn,g="onPointerLeave",p="onPointerEnter",m="pointer"),f=null==c?l:et(c),h=null==u?l:et(u),(l=new d(g,m+"leave",c,n,i)).target=f,l.relatedTarget=h,g=null,Xe(i)===r&&((d=new d(p,m+"enter",u,n,i)).target=h,d.relatedTarget=f,g=d),f=g,c&&u)e:{for(d=sd,m=u,h=0,g=p=c;g;g=d(g))h++;g=0;for(var v=m;v;v=d(v))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||null!==m&&p===m.alternate){d=p;break e}p=d(p),m=d(m)}d=null}else d=null;null!==c&&ld(s,l,c,d,!1),null!==u&&null!==f&&ld(s,f,u,d,!0)}if("select"===(c=(l=r?et(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var y=$n;else if(Fn(l))if(Wn)y=Zn;else{y=Kn;var b=Yn}else!(c=l.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?r&&At(r.elementType)&&(y=$n):y=Xn;switch(y&&(y=y(e,r))?Dn(s,y,n,i):(b&&b(e,l,r),"focusout"===e&&r&&"number"===l.type&&null!=r.memoizedProps.value&&St(l,"number",l.value)),b=r?et(r):window,e){case"focusin":(Fn(b)||"true"===b.contentEditable)&&(lr=b,cr=r,ur=null);break;case"focusout":ur=cr=lr=null;break;case"mousedown":fr=!0;break;case"contextmenu":case"mouseup":case"dragend":fr=!1,pr(s,n,i);break;case"selectionchange":if(sr)break;case"keydown":case"keyup":pr(s,n,i)}var w;if(Tn)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else In?Ln(e,n)&&(k="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(k="onCompositionStart");k&&(An&&"ko"!==n.locale&&(In||"onCompositionStart"!==k?"onCompositionEnd"===k&&In&&(w=Qt()):(Jt="value"in(Ht=i)?Ht.value:Ht.textContent,In=!0)),0<(b=od(r,k)).length&&(k=new hn(k,e,null,n,i),s.push({event:k,listeners:b}),w?k.data=w:null!==(w=jn(n))&&(k.data=w))),(w=Pn?function(e,t){switch(e){case"compositionend":return jn(t);case"keypress":return 32!==t.which?null:(Nn=!0,On);case"textInput":return(e=t.data)===On&&Nn?null:e;default:return null}}(e,n):function(e,t){if(In)return"compositionend"===e||!Tn&&Ln(e,t)?(e=Qt(),Gt=Jt=Ht=null,In=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return An&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(k=od(r,"onBeforeInput")).length&&(b=new hn("onBeforeInput","beforeinput",null,n,i),s.push({event:b,listeners:k}),b.data=w)),function(e,t,n,r,i){if("submit"===t&&n&&n.stateNode===i){var a=Hu((i[We]||null).action),o=r.submitter;o&&null!==(t=(t=o[We]||null)?Hu(t.formAction):o.getAttribute("formAction"))&&(a=t,o=null);var s=new an("action","action",null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==Fu){var e=o?Ju(i,o):new FormData(i);is(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else"function"==typeof a&&(s.preventDefault(),e=o?Ju(i,o):new FormData(i),is(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}(s,e,r,n,i)}Xu(s,t)})}function ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function od(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;if(5!==(i=i.tag)&&26!==i&&27!==i||null===a||(null!=(i=Vt(e,n))&&r.unshift(ad(e,i,a)),null!=(i=Vt(e,t))&&r.push(ad(e,i,a))),3===e.tag)return r;e=e.return}return[]}function sd(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function ld(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===r)break;5!==s&&26!==s&&27!==s||null===c||(l=c,i?null!=(c=Vt(n,a))&&o.unshift(ad(n,c,l)):i||null!=(c=Vt(n,a))&&o.push(ad(n,c,l))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var cd=/\r\n?/g,ud=/\u0000|\uFFFD/g;function dd(e){return("string"==typeof e?e:""+e).replace(cd,"\n").replace(ud,"")}function fd(e,t){return t=dd(t),dd(e)===t}function pd(e,t,n,i,a,o){switch(n){case"children":"string"==typeof i?"body"===t||"textarea"===t&&""===i||Et(e,i):("number"==typeof i||"bigint"==typeof i)&&"body"!==t&&Et(e,""+i);break;case"className":dt(e,"class",i);break;case"tabIndex":dt(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":dt(e,n,i);break;case"style":Pt(e,i,o);break;case"data":if("object"!==t){dt(e,"data",i);break}case"src":case"href":if(""===i&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==i||"function"==typeof i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Lt(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if("function"==typeof i){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof o&&("formAction"===n?("input"!==t&&pd(e,t,"name",a.name,a,null),pd(e,t,"formEncType",a.formEncType,a,null),pd(e,t,"formMethod",a.formMethod,a,null),pd(e,t,"formTarget",a.formTarget,a,null)):(pd(e,t,"encType",a.encType,a,null),pd(e,t,"method",a.method,a,null),pd(e,t,"target",a.target,a,null))),null==i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Lt(""+i),e.setAttribute(n,i);break;case"onClick":null!=i&&(e.onclick=jt);break;case"onScroll":null!=i&&Zu("scroll",e);break;case"onScrollEnd":null!=i&&Zu("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(r(61));if(null!=(n=i.__html)){if(null!=a.children)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"muted":e.muted=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==i||"function"==typeof i||"boolean"==typeof i||"symbol"==typeof i){e.removeAttribute("xlink:href");break}n=Lt(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===i?e.setAttribute(n,""):!1!==i&&null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":null==i||"function"==typeof i||"symbol"==typeof i||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":Zu("beforetoggle",e),Zu("toggle",e),ut(e,"popover",i);break;case"xlinkActuate":ft(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ft(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ft(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ft(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ft(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ft(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ft(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ft(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ft(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ut(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&ut(e,n=Ot.get(n)||n,i)}}function hd(e,t,n,i,a,o){switch(n){case"style":Pt(e,i,o);break;case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(r(61));if(null!=(n=i.__html)){if(null!=a.children)throw Error(r(60));e.innerHTML=n}}break;case"children":"string"==typeof i?Et(e,i):("number"==typeof i||"bigint"==typeof i)&&Et(e,""+i);break;case"onScroll":null!=i&&Zu("scroll",e);break;case"onScrollEnd":null!=i&&Zu("scrollend",e);break;case"onClick":null!=i&&(e.onclick=jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:it.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),"function"==typeof(o=null!=(o=e[We]||null)?o[n]:null)&&e.removeEventListener(t,o,a),"function"!=typeof i)?n in e?e[n]=i:!0===i?e.setAttribute(n,""):ut(e,n,i):("function"!=typeof o&&null!==o&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,a)))}}function md(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Zu("error",e),Zu("load",e);var i,a=!1,o=!1;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(null!=s)switch(i){case"src":a=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:pd(e,t,i,s,n,null)}}return o&&pd(e,t,"srcSet",n.srcSet,n,null),void(a&&pd(e,t,"src",n.src,n,null));case"input":Zu("invalid",e);var l=i=s=o=null,c=null,u=null;for(a in n)if(n.hasOwnProperty(a)){var d=n[a];if(null!=d)switch(a){case"name":o=d;break;case"type":s=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":i=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(r(137,t));break;default:pd(e,t,a,d,n,null)}}return void kt(e,i,l,c,u,s,o,!1);case"select":for(o in Zu("invalid",e),a=s=i=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":i=l;break;case"defaultValue":s=l;break;case"multiple":a=l;default:pd(e,t,o,l,n,null)}return t=i,n=s,e.multiple=!!a,void(null!=t?_t(e,!!a,t,!1):null!=n&&_t(e,!!a,n,!0));case"textarea":for(s in Zu("invalid",e),i=o=a=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":a=l;break;case"defaultValue":o=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(r(91));break;default:pd(e,t,s,l,n,null)}return void Ct(e,a,o,i);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(a=n[c]))if("selected"===c)e.selected=a&&"function"!=typeof a&&"symbol"!=typeof a;else pd(e,t,c,a,n,null);return;case"dialog":Zu("beforetoggle",e),Zu("toggle",e),Zu("cancel",e),Zu("close",e);break;case"iframe":case"object":Zu("load",e);break;case"video":case"audio":for(a=0;a<Yu.length;a++)Zu(Yu[a],e);break;case"image":Zu("error",e),Zu("load",e);break;case"details":Zu("toggle",e);break;case"embed":case"source":case"link":Zu("error",e),Zu("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(a=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:pd(e,t,u,a,n,null)}return;default:if(At(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(a=n[d])&&hd(e,t,d,a,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(a=n[l])&&pd(e,t,l,a,n,null))}function gd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var vd=null,yd=null;function bd(e){return 9===e.nodeType?e:e.ownerDocument}function wd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function kd(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function Sd(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var _d=null;var xd="function"==typeof setTimeout?setTimeout:void 0,Cd="function"==typeof clearTimeout?clearTimeout:void 0,Ed="function"==typeof Promise?Promise:void 0,Td="function"==typeof queueMicrotask?queueMicrotask:void 0!==Ed?function(e){return Ed.resolve(null).then(e).catch(Md)}:xd;function Md(e){setTimeout(function(){throw e})}function Pd(e){return"head"===e}function Ad(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)||"/&"===n){if(0===r)return e.removeChild(i),void Gf(t);r--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)r++;else if("html"===n)Ud(e.ownerDocument.documentElement);else if("head"===n){Ud(n=e.ownerDocument.head);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ye]||"SCRIPT"===s||"STYLE"===s||"LINK"===s&&"stylesheet"===a.rel.toLowerCase()||n.removeChild(a),a=o}}else"body"===n&&Ud(e.ownerDocument.body);n=i}while(n);Gf(t)}function Od(e,t){var n=e;e=0;do{var r=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=r}while(n)}function Nd(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nd(n),Ke(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Ld(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Rd(e.nextSibling)))return null}return e}function jd(e){return"$?"===e.data||"$~"===e.data}function Id(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Rd(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var Fd=null;function Dd(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return Rd(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Bd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function zd(e,t,n){switch(t=bd(n),e){case"html":if(!(e=t.documentElement))throw Error(r(452));return e;case"head":if(!(e=t.head))throw Error(r(453));return e;case"body":if(!(e=t.body))throw Error(r(454));return e;default:throw Error(r(451))}}function Ud(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ke(e)}var Vd=new Map,$d=new Set;function Wd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var qd=R.d;R.d={f:function(){var e=qd.f(),t=nu();return e||t},r:function(e){var t=Ze(e);null!==t&&5===t.tag&&"form"===t.type?os(t):qd.r(e)},D:function(e){qd.D(e),Jd("dns-prefetch",e,null)},C:function(e,t){qd.C(e,t),Jd("preconnect",e,t)},L:function(e,t,n){qd.L(e,t,n);var r=Hd;if(r&&e&&t){var i='link[rel="preload"][as="'+bt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(i+='[imagesrcset="'+bt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(i+='[imagesizes="'+bt(n.imageSizes)+'"]')):i+='[href="'+bt(e)+'"]';var a=i;switch(t){case"style":a=Qd(e);break;case"script":a=Xd(e)}Vd.has(a)||(e=u({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Vd.set(a,e),null!==r.querySelector(i)||"style"===t&&r.querySelector(Yd(a))||"script"===t&&r.querySelector(Zd(a))||(md(t=r.createElement("link"),"link",e),nt(t),r.head.appendChild(t)))}},m:function(e,t){qd.m(e,t);var n=Hd;if(n&&e){var r=t&&"string"==typeof t.as?t.as:"script",i='link[rel="modulepreload"][as="'+bt(r)+'"][href="'+bt(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Xd(e)}if(!Vd.has(a)&&(e=u({rel:"modulepreload",href:e},t),Vd.set(a,e),null===n.querySelector(i))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Zd(a)))return}md(r=n.createElement("link"),"link",e),nt(r),n.head.appendChild(r)}}},X:function(e,t){qd.X(e,t);var n=Hd;if(n&&e){var r=tt(n).hoistableScripts,i=Xd(e),a=r.get(i);a||((a=n.querySelector(Zd(i)))||(e=u({src:e,async:!0},t),(t=Vd.get(i))&&rf(e,t),nt(a=n.createElement("script")),md(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}},S:function(e,t,n){qd.S(e,t,n);var r=Hd;if(r&&e){var i=tt(r).hoistableStyles,a=Qd(e);t=t||"default";var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Yd(a)))s.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Vd.get(a))&&nf(e,n);var l=o=r.createElement("link");nt(l),md(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,tf(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:s},i.set(a,o)}}},M:function(e,t){qd.M(e,t);var n=Hd;if(n&&e){var r=tt(n).hoistableScripts,i=Xd(e),a=r.get(i);a||((a=n.querySelector(Zd(i)))||(e=u({src:e,async:!0,type:"module"},t),(t=Vd.get(i))&&rf(e,t),nt(a=n.createElement("script")),md(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}};var Hd="undefined"==typeof document?null:document;function Jd(e,t,n){var r=Hd;if(r&&"string"==typeof t&&t){var i=bt(t);i='link[rel="'+e+'"][href="'+i+'"]',"string"==typeof n&&(i+='[crossorigin="'+n+'"]'),$d.has(i)||($d.add(i),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(i)&&(md(t=r.createElement("link"),"link",e),nt(t),r.head.appendChild(t)))}}function Gd(e,t,n,i){var a,o,s,l,c=(c=G.current)?Wd(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Qd(n.href),(i=(n=tt(c).hoistableStyles).get(t))||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Qd(n.href);var u=tt(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(Yd(e)))&&!u._p&&(d.instance=u,d.state.loading=5),Vd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Vd.set(e,n),u||(a=c,o=e,s=n,l=d.state,a.querySelector('link[rel="preload"][as="style"]['+o+"]")?l.loading=1:(o=a.createElement("link"),l.preload=o,o.addEventListener("load",function(){return l.loading|=1}),o.addEventListener("error",function(){return l.loading|=2}),md(o,"link",s),nt(o),a.head.appendChild(o))))),t&&null===i)throw Error(r(528,""));return d}if(t&&null!==i)throw Error(r(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=Xd(n),(i=(n=tt(c).hoistableScripts).get(t))||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Qd(e){return'href="'+bt(e)+'"'}function Yd(e){return'link[rel="stylesheet"]['+e+"]"}function Kd(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function Xd(e){return'[src="'+bt(e)+'"]'}function Zd(e){return"script[async]"+e}function ef(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+bt(n.href)+'"]');if(i)return t.instance=i,nt(i),i;var a=u({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return nt(i=(e.ownerDocument||e).createElement("style")),md(i,"style",a),tf(i,n.precedence,e),t.instance=i;case"stylesheet":a=Qd(n.href);var o=e.querySelector(Yd(a));if(o)return t.state.loading|=4,t.instance=o,nt(o),o;i=Kd(n),(a=Vd.get(a))&&nf(i,a),nt(o=(e.ownerDocument||e).createElement("link"));var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),md(o,"link",i),t.state.loading|=4,tf(o,n.precedence,e),t.instance=o;case"script":return o=Xd(n.src),(a=e.querySelector(Zd(o)))?(t.instance=a,nt(a),a):(i=n,(a=Vd.get(o))&&rf(i=u({},n),a),nt(a=(e=e.ownerDocument||e).createElement("script")),md(a,"link",i),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(r(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(i=t.instance,t.state.loading|=4,tf(i,n.precedence,e));return t.instance}function tf(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function nf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function rf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var af=null;function of(e,t,n){if(null===af){var r=new Map,i=af=new Map;i.set(n,r)}else(r=(i=af).get(n))||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ye]||a[$e]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(t)||"";o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function sf(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function lf(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var cf=0;function uf(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ff(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var df=null;function ff(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,df=new Map,t.forEach(pf,e),df=null,uf.call(e))}function pf(e,t){if(!(4&t.state.loading)){var n=df.get(e);if(n)var r=n.get(null);else{n=new Map,df.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}o=(i=t.instance).getAttribute("data-precedence"),(a=n.get(o)||r)===r&&n.set(null,i),n.set(o,i),this.count++,r=uf.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(i,e.firstChild),t.state.loading|=4}}var hf={$$typeof:y,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function mf(e,t,n,r,i,a,o,s,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Le(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Le(0),this.hiddenUpdates=Le(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function gf(e,t,n,r,i,a,o,s,l,c,u,d){return e=new mf(e,t,n,o,l,c,u,d,s),t=1,!0===a&&(t|=24),a=Ur(3,null,null,t),e.current=a,a.stateNode=e,(t=Vi()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ba(a),e}function vf(e){return e?e=Br:Br}function yf(e,t,n,r,i,a){i=vf(i),null===r.context?r.context=i:r.pendingContext=i,(r=ka(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=Sa(e,r,t))&&(Kc(n,0,t),_a(n,e,t))}function bf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function wf(e,t){bf(e,t),(e=e.alternate)&&bf(e,t)}function kf(e){if(13===e.tag||31===e.tag){var t=Rr(e,67108864);null!==t&&Kc(t,0,67108864),wf(e,67108864)}}function Sf(e){if(13===e.tag||31===e.tag){var t=Qc(),n=Rr(e,t=De(t));null!==n&&Kc(n,0,t),wf(e,t)}}var _f=!0;function xf(e,t,n,r){var i=j.T;j.T=null;var a=R.p;try{R.p=2,Ef(e,t,n,r)}finally{R.p=a,j.T=i}}function Cf(e,t,n,r){var i=j.T;j.T=null;var a=R.p;try{R.p=8,Ef(e,t,n,r)}finally{R.p=a,j.T=i}}function Ef(e,t,n,r){if(_f){var i=Tf(r);if(null===i)id(e,t,r,Mf,n),Bf(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Nf=zf(Nf,e,t,n,r,i),!0;case"dragenter":return Lf=zf(Lf,e,t,n,r,i),!0;case"mouseover":return jf=zf(jf,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return If.set(a,zf(If.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Rf.set(a,zf(Rf.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Bf(e,r),4&t&&-1<Df.indexOf(e)){for(;null!==i;){var a=Ze(i);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=Me(a.pendingLanes);if(0!==o){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-Se(o);s.entanglements[1]|=l,o&=~l}Du(a),!(6&gc)&&(Fc=ue()+500,Bu(0))}}break;case 31:case 13:null!==(s=Rr(a,2))&&Kc(s,0,2),nu(),wf(a,2)}if(null===(a=Tf(r))&&id(e,t,r,Mf,n),a===i)break;i=a}null!==i&&r.stopPropagation()}else id(e,t,r,null,n)}}function Tf(e){return Pf(e=Rt(e))}var Mf=null;function Pf(e){if(Mf=null,null!==(e=Xe(e))){var t=a(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=o(t)))return e;e=null}else if(31===n){if(null!==(e=s(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Mf=e,null}function Af(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(de()){case fe:return 2;case pe:return 8;case he:case me:return 32;case ge:return 268435456;default:return 32}default:return 32}}var Of=!1,Nf=null,Lf=null,jf=null,If=new Map,Rf=new Map,Ff=[],Df="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Bf(e,t){switch(e){case"focusin":case"focusout":Nf=null;break;case"dragenter":case"dragleave":Lf=null;break;case"mouseover":case"mouseout":jf=null;break;case"pointerover":case"pointerout":If.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rf.delete(t.pointerId)}}function zf(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=Ze(t))&&kf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Uf(e){var t=Xe(e.target);if(null!==t){var n=a(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=o(n)))return e.blockedOn=t,void Ue(e.priority,function(){Sf(n)})}else if(31===t){if(null!==(t=s(n)))return e.blockedOn=t,void Ue(e.priority,function(){Sf(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Vf(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tf(e.nativeEvent);if(null!==n)return null!==(t=Ze(n))&&kf(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);It=r,n.target.dispatchEvent(r),It=null,t.shift()}return!0}function $f(e,t,n){Vf(e)&&n.delete(t)}function Wf(){Of=!1,null!==Nf&&Vf(Nf)&&(Nf=null),null!==Lf&&Vf(Lf)&&(Lf=null),null!==jf&&Vf(jf)&&(jf=null),If.forEach($f),Rf.forEach($f)}function qf(t,n){t.blockedOn===n&&(t.blockedOn=null,Of||(Of=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Wf)))}var Hf=null;function Jf(t){Hf!==t&&(Hf=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hf===t&&(Hf=null);for(var e=0;e<t.length;e+=3){var n=t[e],r=t[e+1],i=t[e+2];if("function"!=typeof r){if(null===Pf(r||n))continue;break}var a=Ze(n);null!==a&&(t.splice(e,3),e-=3,is(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gf(e){function t(t){return qf(t,e)}null!==Nf&&qf(Nf,e),null!==Lf&&qf(Lf,e),null!==jf&&qf(jf,e),If.forEach(t),Rf.forEach(t);for(var n=0;n<Ff.length;n++){var r=Ff[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ff.length&&null===(n=Ff[0]).blockedOn;)Uf(n),null===n.blockedOn&&Ff.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[We]||null;if("function"==typeof a)o||Jf(n);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[We]||null)s=o.formAction;else if(null!==Pf(i))continue}else s=o.action;"function"==typeof s?n[r+1]=s:(n.splice(r,3),r-=3),Jf(n)}}}function Qf(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==i&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),null!==i&&(i(),i=null)}}}function Yf(e){this._internalRoot=e}function Kf(e){this._internalRoot=e}Kf.prototype.render=Yf.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(r(409));yf(t.current,Qc(),e,t,null,null)},Kf.prototype.unmount=Yf.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;yf(e.current,2,null,e,null,null),nu(),t[qe]=null}},Kf.prototype.unstable_scheduleHydration=function(e){if(e){var t=ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ff.length&&0!==t&&t<Ff[n].priority;n++);Ff.splice(n,0,e),0===n&&Uf(e)}};var Xf=t.version;if("19.2.3"!==Xf)throw Error(r(527,Xf,"19.2.3"));R.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw e=Object.keys(e).join(","),Error(r(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=a(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,i=t;;){var o=n.return;if(null===o)break;var s=o.alternate;if(null===s){if(null!==(i=o.return)){n=i;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return l(o),e;if(s===i)return l(o),t;s=s.sibling}throw Error(r(188))}if(n.return!==i.return)n=o,i=s;else{for(var c=!1,u=o.child;u;){if(u===n){c=!0,n=o,i=s;break}if(u===i){c=!0,i=o,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,i=o;break}if(u===i){c=!0,i=s,n=o;break}u=u.sibling}if(!c)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?c(e):null)?null:e.stateNode};var Zf={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ep=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ep.isDisabled&&ep.supportsFiber)try{be=ep.inject(Zf),we=ep}catch(tp){}}return P.createRoot=function(e,t){if(!i(e))throw Error(r(299));var n=!1,a="",o=Ts,s=Ms,l=Ps;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(a=t.identifierPrefix),void 0!==t.onUncaughtError&&(o=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError)),t=gf(e,1,!1,null,0,n,a,null,o,s,l,Qf),e[qe]=t.current,nd(e),new Yf(t)},P.hydrateRoot=function(e,t,n){if(!i(e))throw Error(r(299));var a=!1,o="",s=Ts,l=Ms,c=Ps,u=null;return null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onUncaughtError&&(s=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.formState&&(u=n.formState)),(t=gf(e,1,!0,t,0,a,o,u,s,l,c,Qf)).context=vf(null),n=t.current,(o=ka(a=De(a=Qc()))).callback=null,Sa(n,o,a),n=a,t.current.lanes=n,je(t,n),Du(t),e[qe]=t.current,nd(e),new Kf(t)},P.version="19.2.3",P}var V=(R||(R=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),M.exports=U()),M.exports);const $=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},W=e=>e;const q=e=>{const t=(e=>e?$(e):$)(e),n=e=>function(e,t=W){const n=C.useSyncExternalStore(e.subscribe,C.useCallback(()=>t(e.getState()),[e,t]),C.useCallback(()=>t(e.getInitialState()),[e,t]));return C.useDebugValue(n),n}(t,e);return Object.assign(n,t),n},H=(J=(e,t)=>({isOpen:!1,currentScreen:"welcome",agentId:null,agentConfig:null,configLoading:!1,configError:null,dynamicVariables:{},pendingScreen:null,chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:"",pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,isUserSpeaking:!1,remoteAudioStream:null,openDialog:()=>e({isOpen:!0,currentScreen:"welcome"}),closeDialog:()=>{const{pipecatClient:n,connectionState:r}=t();n&&"disconnected"!==r&&n.disconnect().catch(()=>{}),e({isOpen:!1,currentScreen:"welcome",dynamicVariables:{},pendingScreen:null,pipecatClient:null,connectionState:"disconnected",isBotReady:!1,remoteAudioStream:null})},toggleDialog:()=>{const{isOpen:e,openDialog:n,closeDialog:r}=t();e?r():n()},setScreen:t=>e({currentScreen:t}),openChat:()=>e({isOpen:!0,currentScreen:"chat"}),openTalk:()=>e({isOpen:!0,currentScreen:"talk"}),setAgentId:t=>e({agentId:t}),setAgentConfig:t=>e({agentConfig:t,configLoading:!1,configError:null}),setConfigLoading:t=>e({configLoading:t}),setConfigError:t=>e({configError:t,configLoading:!1}),setDynamicVariables:t=>e({dynamicVariables:t}),setPendingScreen:t=>e({pendingScreen:t}),clearDynamicVariables:()=>e({dynamicVariables:{},pendingScreen:null}),setChatSession:t=>e({chatSession:t,isChatInitialized:!0}),addMessage:t=>e(e=>({messages:[...e.messages,l({id:Date.now()+Math.random(),timestamp:new Date},t)]})),setStreaming:(t,n="")=>e({isStreaming:t,streamingContent:n}),clearMessages:()=>e({messages:[],isChatInitialized:!1,chatSession:null}),setPipecatClient:t=>e({pipecatClient:t}),setConnectionState:t=>e({connectionState:t}),setIsBotReady:t=>e({isBotReady:t}),setIsMicEnabled:t=>e({isMicEnabled:t}),setIsUserSpeaking:t=>e({isUserSpeaking:t}),setRemoteAudioStream:t=>e({remoteAudioStream:t}),resetChat:()=>e({chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:""}),resetVoice:()=>e({pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,isUserSpeaking:!1,remoteAudioStream:null}),resetAll:()=>e({isOpen:!1,currentScreen:"welcome",chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:"",pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,isUserSpeaking:!1,remoteAudioStream:null}),getAgentName:()=>{const{agentConfig:e}=t();return(null==e?void 0:e.agent_name)||"AI Assistant"},getAvatarUrl:()=>{const{agentConfig:e}=t();if(!(null==e?void 0:e.MediaFiles)||!Array.isArray(e.MediaFiles))return null;const n=e.MediaFiles.find(e=>"avatar"===e.fileType);return(null==n?void 0:n.mediaUrl)||null},getPromptToken:()=>{const{agentConfig:e}=t();return(null==e?void 0:e.prompt_access_token)||null},getTheme:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_theme)||{}},getTncConfig:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_tnc_config)||{}},getInterfaceConfig:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_interface)||{}}}),J?q(J):q);var J;const G=(...e)=>{console.log("[EigiChat]",...e)},Q=(...e)=>{console.error("[EigiChat Error]",...e)},Y=(...e)=>{console.warn("[EigiChat Warning]",...e)},K="http://localhost:4000";function X(e){return d(this,arguments,function*(e,t={}){const n=`${K}/${e}`,r=l({headers:l({"Content-Type":"application/json"},t.headers)},t);try{G(`📡 API Request: ${t.method||"GET"} ${e}`);const i=yield fetch(n,r);if(!i.ok){const e=yield i.json().catch(()=>({}));throw new Error(e.detail||e.message||`HTTP ${i.status}`)}return yield i.json()}catch(i){throw Q(`API request failed: ${e}`,i),i}})}function Z(e){return d(this,null,function*(){G("🔍 Fetching agent config for:",e);const t=yield X(`v1/widgets/agents/${e}`);return G("✅ Agent config fetched:",t.agent_name),t})}function ee(e,t=!0){if(!e||0===Object.keys(e).length)return"";const n=Object.entries(e).filter(([e,t])=>null!=t&&""!==t).map(([e,t])=>`${function(e){return`--widget-${e.replace(/_/g,"-")}`}(e)}: ${function(e,t=""){if("boolean"==typeof e)return e?"1":"0";const n=["opacity","weight","font_weight","z_index","line_height"].some(e=>t.toLowerCase().includes(e));return"number"!=typeof e||n?String(e):`${e}px`}(t,e)}`).join(";\n ");if(!n)return"";return`${t?":host, *":":root"} {\n ${n};\n}`}function te(e){if(!e||"string"!=typeof e)return null;3===(e=e.replace(/^#/,"")).length&&(e=e.split("").map(e=>e+e).join(""));const t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r);let o,s,l=(i+a)/2;if(i===a)o=s=0;else{const e=i-a;switch(s=l>.5?e/(2-i-a):e/(i+a),i){case t:o=((n-r)/e+(n<r?6:0))/6;break;case n:o=((r-t)/e+2)/6;break;case r:o=((t-n)/e+4)/6}}return o=Math.round(360*o),s=Math.round(100*s),l=Math.round(100*l),`${o} ${s}% ${l}%`}const ne=x.memo(function({theme:e,widgetElement:t}){return x.useEffect(()=>{if(!e||0===Object.keys(e).length)return void G("[Style] No theme provided, skipping injection");const n=void 0!==(null==t?void 0:t.shadow),r=function(e,t=!0){if(!e)return"";const n={"--background":te(e.background),"--foreground":te(e.text_primary),"--primary":te(e.primary_color),"--primary-foreground":te(e.primary_foreground),"--secondary":te(e.secondary_color),"--secondary-foreground":te(e.secondary_foreground),"--accent":te(e.accent_color),"--accent-foreground":te(e.accent_foreground),"--muted":te(e.background_muted||e.background_secondary),"--muted-foreground":te(e.text_muted),"--border":te(e.border),"--input":te(e.input_border||e.border),"--ring":te(e.border_focus||e.primary_color),"--destructive":te(e.status_error||"#ef4444"),"--destructive-foreground":"0 0% 100%","--card":te(e.background),"--card-foreground":te(e.text_primary),"--popover":te(e.background_secondary||e.background),"--popover-foreground":te(e.text_primary),"--radius":e.border_radius||"0.75rem"},r=Object.entries(n).filter(([e,t])=>null!=t).map(([e,t])=>`${e}: ${t}`).join(";\n ");return r?`${t?":host, *":":root"} {\n ${r};\n}`:""}(e,n),i=[r,ee(e,n)].filter(Boolean).join("\n\n");if(i)if(G("[Style] Injecting theme CSS, Shadow DOM:",n),n&&(null==t?void 0:t.injectThemeCSS))t.injectThemeCSS(i),G("[Style] ✅ Theme CSS injected via custom element method");else if(null==t?void 0:t.injectThemeCSS)t.injectThemeCSS(i),G("[Style] Theme CSS injected via mock element");else{const e="eigi-chat-theme";let t=document.getElementById(e);t||(t=document.createElement("style"),t.id=e,document.head.appendChild(t)),t.textContent=i,G("[Style] Theme CSS injected into document head (fallback)")}else G("[Style] No CSS generated from theme")},[e,t]),null});function re(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=re(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ie(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=re(e))&&(r&&(r+=" "),r+=t);return r}const ae=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,oe=ie,se=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),le="-",ce=[],ue=e=>{const t=pe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return fe(e);const n=e.split(le),r=""===n[0]&&n.length>1?1:0;return de(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],i=n[e];return t?i?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(i,t):t:i||ce}return n[e]||ce}}},de=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=de(e,t+1,i);if(n)return n}const a=n.validators;if(null===a)return;const o=0===t?e.join(le):e.slice(t).join(le),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(o))return e.classGroupId}},fe=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),pe=e=>{const{theme:t,classGroups:n}=e;return he(n,t)},he=(e,t)=>{const n=se();for(const r in e){const i=e[r];me(i,n,r,t)}return n},me=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const i=e[a];ge(i,t,n,r)}},ge=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?be(e,t,n,r):ye(e,t,n,r):ve(e,t,n)},ve=(e,t,n)=>{(""===e?t:we(t,e)).classGroupId=n},ye=(e,t,n,r)=>{ke(e)?me(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},be=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[e,a]=i[o];me(a,we(t,e),n,r)}},we=(e,t)=>{let n=e;const r=t.split(le),i=r.length;for(let a=0;a<i;a++){const e=r[a];let t=n.nextPart.get(e);t||(t=se(),n.nextPart.set(e,t)),n=t}return n},ke=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Se=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}},_e=[],xe=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ce=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,i=0,a=0;const o=e.length;for(let u=0;u<o;u++){const o=e[u];if(0===r&&0===i){if(":"===o){t.push(e.slice(a,u)),a=u+1;continue}if("/"===o){n=u;continue}}"["===o?r++:"]"===o?r--:"("===o?i++:")"===o&&i--}const s=0===t.length?e:e.slice(a);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return xe(t,c,l,n&&n>a?n-a:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):xe(_e,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Ee=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let i=0;i<e.length;i++){const a=e[i],o="["===a[0],s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Te=/\s+/,Me=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Me(e[r]))&&(n&&(n+=" "),n+=t);return n},Pe=(e,...t)=>{let n,r,i,a;const o=e=>{const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Te);let l="";for(let c=s.length-1;c>=0;c-=1){const e=s[c],{isExternal:t,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(e);if(t){l=e+(l.length>0?" "+l:l);continue}let h=!!p,m=r(h?f.substring(0,p):f);if(!m){if(!h){l=e+(l.length>0?" "+l:l);continue}if(m=r(f),!m){l=e+(l.length>0?" "+l:l);continue}h=!1}const g=0===u.length?"":1===u.length?u[0]:a(u).join(":"),v=d?g+"!":g,y=v+m;if(o.indexOf(y)>-1)continue;o.push(y);const b=i(m,h);for(let n=0;n<b.length;++n){const e=b[n];o.push(v+e)}l=e+(l.length>0?" "+l:l)}return l})(e,n);return i(e,a),a};return a=s=>{const c=t.reduce((e,t)=>t(e),e());return n=(e=>l({cache:Se(e.cacheSize),parseClassName:Ce(e),sortModifiers:Ee(e)},ue(e)))(c),r=n.cache.get,i=n.cache.set,a=o,o(s)},(...e)=>a(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=Me(t))&&(i&&(i+=" "),i+=n);return i})(...e))},Ae=[],Oe=e=>{const t=t=>t[e]||Ae;return t.isThemeGetter=!0,t},Ne=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Le=/^\((?:(\w[\w-]*):)?(.+)\)$/i,je=/^\d+\/\d+$/,Ie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Re=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,De=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Be=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ze=e=>je.test(e),Ue=e=>!!e&&!Number.isNaN(Number(e)),Ve=e=>!!e&&Number.isInteger(Number(e)),$e=e=>e.endsWith("%")&&Ue(e.slice(0,-1)),We=e=>Ie.test(e),qe=()=>!0,He=e=>Re.test(e)&&!Fe.test(e),Je=()=>!1,Ge=e=>De.test(e),Qe=e=>Be.test(e),Ye=e=>!Xe(e)&&!it(e),Ke=e=>dt(e,mt,Je),Xe=e=>Ne.test(e),Ze=e=>dt(e,gt,He),et=e=>dt(e,vt,Ue),tt=e=>dt(e,pt,Je),nt=e=>dt(e,ht,Qe),rt=e=>dt(e,bt,Ge),it=e=>Le.test(e),at=e=>ft(e,gt),ot=e=>ft(e,yt),st=e=>ft(e,pt),lt=e=>ft(e,mt),ct=e=>ft(e,ht),ut=e=>ft(e,bt,!0),dt=(e,t,n)=>{const r=Ne.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ft=(e,t,n=!1)=>{const r=Le.exec(e);return!!r&&(r[1]?t(r[1]):n)},pt=e=>"position"===e||"percentage"===e,ht=e=>"image"===e||"url"===e,mt=e=>"length"===e||"size"===e||"bg-size"===e,gt=e=>"length"===e,vt=e=>"number"===e,yt=e=>"family-name"===e,bt=e=>"shadow"===e,wt=Pe(()=>{const e=Oe("color"),t=Oe("font"),n=Oe("text"),r=Oe("font-weight"),i=Oe("tracking"),a=Oe("leading"),o=Oe("breakpoint"),s=Oe("container"),l=Oe("spacing"),c=Oe("radius"),u=Oe("shadow"),d=Oe("inset-shadow"),f=Oe("text-shadow"),p=Oe("drop-shadow"),h=Oe("blur"),m=Oe("perspective"),g=Oe("aspect"),v=Oe("ease"),y=Oe("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",it,Xe],w=()=>[it,Xe,l],k=()=>[ze,"full","auto",...w()],S=()=>[Ve,"none","subgrid",it,Xe],_=()=>["auto",{span:["full",Ve,it,Xe]},Ve,it,Xe],x=()=>[Ve,"auto",it,Xe],C=()=>["auto","min","max","fr",it,Xe],E=()=>["auto",...w()],T=()=>[ze,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,it,Xe],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",st,tt,{position:[it,Xe]}],A=()=>["auto","cover","contain",lt,Ke,{size:[it,Xe]}],O=()=>[$e,at,Ze],N=()=>["","none","full",c,it,Xe],L=()=>["",Ue,at,Ze],j=()=>[Ue,$e,st,tt],I=()=>["","none",h,it,Xe],R=()=>["none",Ue,it,Xe],F=()=>["none",Ue,it,Xe],D=()=>[Ue,it,Xe],B=()=>[ze,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[We],breakpoint:[We],color:[qe],container:[We],"drop-shadow":[We],ease:["in","out","in-out"],font:[Ye],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[We],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[We],shadow:[We],spacing:["px",Ue],text:[We],"text-shadow":[We],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ze,Xe,it,g]}],container:["container"],columns:[{columns:[Ue,Xe,it,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Ve,"auto",it,Xe]}],basis:[{basis:[ze,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ue,ze,"auto","initial","none",Xe]}],grow:[{grow:["",Ue,it,Xe]}],shrink:[{shrink:["",Ue,it,Xe]}],order:[{order:[Ve,"first","last","none",it,Xe]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":x()}],"col-end":[{"col-end":x()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":x()}],"row-end":[{"row-end":x()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],w:[{w:[s,"screen",...T()]}],"min-w":[{"min-w":[s,"screen","none",...T()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",n,at,Ze]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,it,et]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$e,Xe]}],"font-family":[{font:[ot,Xe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,it,Xe]}],"line-clamp":[{"line-clamp":[Ue,"none",it,et]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",it,Xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",it,Xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ue,"from-font","auto",it,Ze]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Ue,"auto",it,Xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",it,Xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",it,Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ve,it,Xe],radial:["",it,Xe],conic:[Ve,it,Xe]},ct,nt]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ue,it,Xe]}],"outline-w":[{outline:["",Ue,at,Ze]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,ut,rt]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,ut,rt]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Ue,Ze]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,ut,rt]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Ue,it,Xe]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ue]}],"mask-image-linear-from-pos":[{"mask-linear-from":j()}],"mask-image-linear-to-pos":[{"mask-linear-to":j()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":j()}],"mask-image-t-to-pos":[{"mask-t-to":j()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":j()}],"mask-image-r-to-pos":[{"mask-r-to":j()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":j()}],"mask-image-b-to-pos":[{"mask-b-to":j()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":j()}],"mask-image-l-to-pos":[{"mask-l-to":j()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":j()}],"mask-image-x-to-pos":[{"mask-x-to":j()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":j()}],"mask-image-y-to-pos":[{"mask-y-to":j()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[it,Xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":j()}],"mask-image-radial-to-pos":[{"mask-radial-to":j()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Ue]}],"mask-image-conic-from-pos":[{"mask-conic-from":j()}],"mask-image-conic-to-pos":[{"mask-conic-to":j()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",it,Xe]}],filter:[{filter:["","none",it,Xe]}],blur:[{blur:I()}],brightness:[{brightness:[Ue,it,Xe]}],contrast:[{contrast:[Ue,it,Xe]}],"drop-shadow":[{"drop-shadow":["","none",p,ut,rt]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Ue,it,Xe]}],"hue-rotate":[{"hue-rotate":[Ue,it,Xe]}],invert:[{invert:["",Ue,it,Xe]}],saturate:[{saturate:[Ue,it,Xe]}],sepia:[{sepia:["",Ue,it,Xe]}],"backdrop-filter":[{"backdrop-filter":["","none",it,Xe]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[Ue,it,Xe]}],"backdrop-contrast":[{"backdrop-contrast":[Ue,it,Xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ue,it,Xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ue,it,Xe]}],"backdrop-invert":[{"backdrop-invert":["",Ue,it,Xe]}],"backdrop-opacity":[{"backdrop-opacity":[Ue,it,Xe]}],"backdrop-saturate":[{"backdrop-saturate":[Ue,it,Xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ue,it,Xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",it,Xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ue,"initial",it,Xe]}],ease:[{ease:["linear","initial",v,it,Xe]}],delay:[{delay:[Ue,it,Xe]}],animate:[{animate:["none",y,it,Xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,it,Xe]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:R()}],"rotate-x":[{"rotate-x":R()}],"rotate-y":[{"rotate-y":R()}],"rotate-z":[{"rotate-z":R()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:D()}],"skew-x":[{"skew-x":D()}],"skew-y":[{"skew-y":D()}],transform:[{transform:[it,Xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",it,Xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",it,Xe]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Ue,at,Ze,et]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function kt(...e){return wt(ie(e))}const St=(_t="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",xt={variants:{variant:{default:"text-white shadow-sm hover:opacity-90",secondary:"shadow-sm hover:opacity-90",destructive:"text-white shadow-sm hover:opacity-90",outline:"border bg-transparent shadow-sm hover:opacity-80",ghost:"hover:opacity-80",link:"underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-12 rounded-md px-8 text-base",xl:"h-14 rounded-lg px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-8 w-8","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if(null==(null==xt?void 0:xt.variants))return oe(_t,null==e?void 0:e.class,null==e?void 0:e.className);const{variants:n,defaultVariants:r}=xt,i=Object.keys(n).map(t=>{const i=null==e?void 0:e[t],a=null==r?void 0:r[t];if(null===i)return null;const o=ae(i)||ae(a);return n[t][o]}),a=e&&Object.entries(e).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),o=null==xt||null===(t=xt.compoundVariants)||void 0===t?void 0:t.reduce((e,t)=>{let n=t,{class:i,className:o}=n,s=u(n,["class","className"]);return Object.entries(s).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes(l(l({},r),a)[t]):l(l({},r),a)[t]===n})?[...e,i,o]:e},[]);return oe(_t,i,o,null==e?void 0:e.class,null==e?void 0:e.className)});var _t,xt;const Ct=x.forwardRef((e,t)=>{var n=e,{className:r,variant:i,size:a,style:o}=n,s=u(n,["className","variant","size","style"]);return b.jsx("button",l({className:kt(St({variant:i,size:a,className:r})),ref:t,style:l(c(l({},(()=>{switch(i){case"default":return{backgroundColor:"var(--widget-button-primary-bg, #3B82F6)",color:"var(--widget-button-primary-text, #FFFFFF)"};case"secondary":return{backgroundColor:"var(--widget-button-secondary-bg, #F3F4F6)",color:"var(--widget-button-secondary-text, #374151)"};case"destructive":return{backgroundColor:"var(--widget-button-destructive-bg, #DC2626)",color:"var(--widget-button-destructive-text, #FFFFFF)"};case"outline":return{borderColor:"var(--widget-border, #E5E7EB)",color:"var(--widget-text-primary, #111827)"};case"ghost":return{color:"var(--widget-text-primary, #111827)"};default:return{}}})()),{borderRadius:"var(--widget-border-radius-small, 8px)",fontFamily:"var(--widget-font-family, inherit)"}),o)},s))});Ct.displayName="Button";const Et=x.forwardRef((e,t)=>{var n=e,{className:r,src:i,alt:a,fallback:o,size:s="md"}=n,d=u(n,["className","src","alt","fallback","size"]);const[f,p]=x.useState(!1),h={sm:"h-10 w-10 text-sm",md:"h-16 w-16 text-lg",lg:"h-24 w-24 text-2xl",xl:"h-32 w-32 text-3xl","2xl":"h-40 w-40 text-4xl"};return b.jsx("div",c(l({ref:t,className:kt("relative flex shrink-0 overflow-hidden rounded-full",h[s]||h.md,r),style:{backgroundColor:"var(--widget-background-secondary, #F3F4F6)"}},d),{children:i&&!f?b.jsx("img",{src:i,alt:a||"Avatar",onError:()=>{p(!0)},className:"aspect-square h-full w-full object-cover"}):b.jsx("span",{className:"flex h-full w-full items-center justify-center font-semibold",style:{color:"var(--widget-text-secondary, #6B7280)"},children:o||(a?a.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"AI")})}))});Et.displayName="Avatar";x.forwardRef((e,t)=>{var n=e,{status:r="idle"}=n,i=u(n,["status"]);const a={idle:{ring:"ring-2 ring-offset-2",ringColor:"var(--widget-border, #E5E7EB)"},connecting:{ring:"ring-4 ring-offset-2 animate-pulse",ringColor:"var(--widget-status-connecting, #F59E0B)"},listening:{ring:"ring-4 ring-offset-2",ringColor:"var(--widget-status-success, #10B981)"},speaking:{ring:"ring-4 ring-offset-4 animate-pulse",ringColor:"var(--widget-primary-color, #3B82F6)"},error:{ring:"ring-4 ring-offset-2",ringColor:"var(--widget-status-error, #DC2626)"}},o=a[r]||a.idle;return b.jsx("div",{className:kt(o.ring),style:{"--tw-ring-color":o.ringColor,"--tw-ring-offset-color":"var(--widget-background, #FFFFFF)",borderRadius:"9999px"},children:b.jsx(Et,l({ref:t},i))})}).displayName="AvatarWithStatus";
10
+ */function U(){if(I)return P;I=1;var e=N(),t=_(),n=z();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function a(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function o(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function s(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function l(e){if(a(e)!==e)throw Error(r(188))}function c(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=c(e)))return t;e=e.sibling}return null}var u=Object.assign,d=Symbol.for("react.element"),f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),C=Symbol.for("react.memo_cache_sentinel"),T=Symbol.iterator;function M(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=T&&e[T]||e["@@iterator"])?e:null}var A=Symbol.for("react.client.reference");function O(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===A?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case h:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList";case E:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case p:return"Portal";case y:return e.displayName||"Context";case v:return(e._context.displayName||"Context")+".Consumer";case b:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case S:return null!==(t=e.displayName||null)?t:O(e.type)||"Memo";case x:t=e._payload,e=e._init;try{return O(e(t))}catch(n){}}return null}var L=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},D=[],B=-1;function U(e){return{current:e}}function V(e){0>B||(e.current=D[B],D[B]=null,B--)}function $(e,t){B++,D[B]=e.current,e.current=t}var W,q,H=U(null),J=U(null),Q=U(null),G=U(null);function Y(e,t){switch($(Q,t),$(J,e),$(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=kd(t=wd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(H),$(H,e)}function K(){V(H),V(J),V(Q)}function X(e){null!==e.memoizedState&&$(G,e);var t=H.current,n=kd(t,e.type);t!==n&&($(J,e),$(H,n))}function Z(e){J.current===e&&(V(H),V(J)),G.current===e&&(V(G),hf._currentValue=F)}function ee(e){if(void 0===W)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);W=t&&t[1]||"",q=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+W+e+q}var te=!1;function ne(e,t){if(!e||te)return"";te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(i){var r=i}Reflect.construct(e,[],n)}else{try{n.call()}catch(a){r=a}e.call(n.prototype)}}else{try{throw Error()}catch(o){r=o}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(s){if(s&&r&&"string"==typeof s.stack)return[s.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var l=o.split("\n"),c=s.split("\n");for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===c.length)for(r=l.length-1,i=c.length-1;1<=r&&0<=i&&l[r]!==c[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==c[i]){if(1!==r||1!==i)do{if(r--,0>--i||l[r]!==c[i]){var u="\n"+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=r&&0<=i);break}}}finally{te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ee(n):""}function re(e,t){switch(e.tag){case 26:case 27:case 5:return ee(e.type);case 16:return ee("Lazy");case 13:return e.child!==t&&null!==t?ee("Suspense Fallback"):ee("Suspense");case 19:return ee("SuspenseList");case 0:case 15:return ne(e.type,!1);case 11:return ne(e.type.render,!1);case 1:return ne(e.type,!0);case 31:return ee("Activity");default:return""}}function ie(e){try{var t="",n=null;do{t+=re(e,n),n=e,e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}var ae=Object.prototype.hasOwnProperty,oe=e.unstable_scheduleCallback,se=e.unstable_cancelCallback,le=e.unstable_shouldYield,ce=e.unstable_requestPaint,ue=e.unstable_now,de=e.unstable_getCurrentPriorityLevel,fe=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,he=e.unstable_NormalPriority,me=e.unstable_LowPriority,ge=e.unstable_IdlePriority,ve=e.log,ye=e.unstable_setDisableYieldValue,be=null,we=null;function ke(e){if("function"==typeof ve&&ye(e),we&&"function"==typeof we.setStrictMode)try{we.setStrictMode(be,e)}catch(t){}}var Se=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(_e(e)/xe|0)|0},_e=Math.log,xe=Math.LN2;var Ee=256,Ce=262144,Te=4194304;function Me(e){var t=42&e;if(0!==t)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pe(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=134217727&r;return 0!==s?0!==(r=s&~a)?i=Me(r):0!==(o&=s)?i=Me(o):n||0!==(n=s&~e)&&(i=Me(n)):0!==(s=r&~a)?i=Me(s):0!==o?i=Me(o):n||0!==(n=r&~e)&&(i=Me(n)),0===i?0:0!==t&&t!==i&&0===(t&a)&&((a=i&-i)>=(n=t&-t)||32===a&&4194048&n)?t:i}function Ae(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Oe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;default:return-1}}function Ne(){var e=Te;return!(62914560&(Te<<=1))&&(Te=4194304),e}function Le(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function je(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ie(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Se(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|261930&n}function Re(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Se(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Fe(e,t){var n=t&-t;return 0!==((n=42&n?1:De(n))&(e.suspendedLanes|t))?0:n}function De(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Be(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function ze(){var e=R.p;return 0!==e?e:void 0===(e=window.event)?32:Af(e.type)}function Ue(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var Ve=Math.random().toString(36).slice(2),$e="__reactFiber$"+Ve,We="__reactProps$"+Ve,qe="__reactContainer$"+Ve,He="__reactEvents$"+Ve,Je="__reactListeners$"+Ve,Qe="__reactHandles$"+Ve,Ge="__reactResources$"+Ve,Ye="__reactMarker$"+Ve;function Ke(e){delete e[$e],delete e[We],delete e[He],delete e[Je],delete e[Qe]}function Xe(e){var t=e[$e];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qe]||n[$e]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Bd(e);null!==e;){if(n=e[$e])return n;e=Bd(e)}return t}n=(e=n).parentNode}return null}function Ze(e){if(e=e[$e]||e[qe]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function et(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(r(33))}function tt(e){var t=e[Ge];return t||(t=e[Ge]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Ye]=!0}var rt=new Set,it={};function at(e,t){ot(e,t),ot(e+"Capture",t)}function ot(e,t){for(it[e]=t,e=0;e<t.length;e++)rt.add(t[e])}var st=RegExp("^[: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]*$"),lt={},ct={};function ut(e,t,n){if(i=t,ae.call(ct,i)||!ae.call(lt,i)&&(st.test(i)?ct[i]=!0:(lt[i]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var i}function dt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function ft(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function pt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ht(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function mt(e){if(!e._valueTracker){var t=ht(e)?"checked":"value";e._valueTracker=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function gt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ht(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function vt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(lr){return e.body}}var yt=/[\n"\\]/g;function bt(e){return e.replace(yt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function wt(e,t,n,r,i,a,o,s){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+pt(t)):e.value!==""+pt(t)&&(e.value=""+pt(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?St(e,o,pt(t)):null!=n?St(e,o,pt(n)):null!=r&&e.removeAttribute("value"),null==i&&null!=a&&(e.defaultChecked=!!a),null!=i&&(e.checked=i&&"function"!=typeof i&&"symbol"!=typeof i),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+pt(s):e.removeAttribute("name")}function kt(e,t,n,r,i,a,o,s){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(("submit"===a||"reset"===a)&&null==t)return void mt(e);n=null!=n?""+pt(n):"",t=null!=t?""+pt(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:i)&&"symbol"!=typeof r&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o),mt(e)}function St(e,t,n){"number"===t&&vt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function _t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+pt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function xt(e,t,n){null==t||((t=""+pt(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+pt(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function Et(e,t,n,i){if(null==t){if(null!=i){if(null!=n)throw Error(r(92));if(L(i)){if(1<i.length)throw Error(r(93));i=i[0]}n=i}null==n&&(n=""),t=n}n=pt(t),e.defaultValue=n,(i=e.textContent)===n&&""!==i&&null!==i&&(e.value=i),mt(e)}function Ct(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Tt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Mt(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||Tt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Pt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(r(62));if(e=e.style,null!=n){for(var i in n)!n.hasOwnProperty(i)||null!=t&&t.hasOwnProperty(i)||(0===i.indexOf("--")?e.setProperty(i,""):"float"===i?e.cssFloat="":e[i]="");for(var a in t)i=t[a],t.hasOwnProperty(a)&&n[a]!==i&&Mt(e,a,i)}else for(var o in t)t.hasOwnProperty(o)&&Mt(e,o,t[o])}function At(e){if(-1===e.indexOf("-"))return!1;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 Ot=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Nt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lt(e){return Nt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function jt(){}var It=null;function Rt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ft=null,Dt=null;function Bt(e){var t=Ze(e);if(t&&(e=t.stateNode)){var n=e[We]||null;e:switch(e=t.stateNode,t.type){case"input":if(wt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+bt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=i[We]||null;if(!a)throw Error(r(90));wt(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)(i=n[t]).form===e.form&&gt(i)}break e;case"textarea":xt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&_t(e,!!n.multiple,t,!1)}}}var zt=!1;function Ut(e,t,n){if(zt)return e(t,n);zt=!0;try{return e(t)}finally{if(zt=!1,(null!==Ft||null!==Dt)&&(nu(),Ft&&(t=Ft,e=Dt,Dt=Ft=null,Bt(t),e)))for(t=0;t<e.length;t++)Bt(e[t])}}function Vt(e,t){var n=e.stateNode;if(null===n)return null;var i=n[We]||null;if(null===i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}var $t=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Wt=!1;if($t)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Wt=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch(lr){Wt=!1}var Ht=null,Jt=null,Qt=null;function Gt(){if(Qt)return Qt;var e,t,n=Jt,r=n.length,i="value"in Ht?Ht.value:Ht.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return Qt=i.slice(e,1<t?1-t:void 0)}function Yt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Kt(){return!0}function Xt(){return!1}function Zt(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Kt:Xt,this.isPropagationStopped=Xt,this}return u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Kt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Kt)},persist:function(){},isPersistent:Kt}),t}var en,tn,nn,rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},an=Zt(rn),on=u({},rn,{view:0,detail:0}),sn=Zt(on),ln=u({},on,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nn&&(nn&&"mousemove"===e.type?(en=e.screenX-nn.screenX,tn=e.screenY-nn.screenY):tn=en=0,nn=e),en)},movementY:function(e){return"movementY"in e?e.movementY:tn}}),cn=Zt(ln),un=Zt(u({},ln,{dataTransfer:0})),dn=Zt(u({},on,{relatedTarget:0})),fn=Zt(u({},rn,{animationName:0,elapsedTime:0,pseudoElement:0})),pn=Zt(u({},rn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),hn=Zt(u({},rn,{data:0})),mn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=vn[e])&&!!t[e]}function bn(){return yn}var wn=Zt(u({},on,{key:function(e){if(e.key){var t=mn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Yt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?gn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bn,charCode:function(e){return"keypress"===e.type?Yt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Yt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),kn=Zt(u({},ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Sn=Zt(u({},on,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bn})),_n=Zt(u({},rn,{propertyName:0,elapsedTime:0,pseudoElement:0})),xn=Zt(u({},ln,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),En=Zt(u({},rn,{newState:0,oldState:0})),Cn=[9,13,27,32],Tn=$t&&"CompositionEvent"in window,Mn=null;$t&&"documentMode"in document&&(Mn=document.documentMode);var Pn=$t&&"TextEvent"in window&&!Mn,An=$t&&(!Tn||Mn&&8<Mn&&11>=Mn),On=String.fromCharCode(32),Nn=!1;function Ln(e,t){switch(e){case"keyup":return-1!==Cn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var In=!1;var Rn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Rn[e.type]:"textarea"===t}function Dn(e,t,n,r){Ft?Dt?Dt.push(r):Dt=[r]:Ft=r,0<(t=od(t,"onChange")).length&&(n=new an("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bn=null,zn=null;function Un(e){Xu(e,0)}function Vn(e){if(gt(et(e)))return e}function $n(e,t){if("change"===e)return t}var Wn=!1;if($t){var qn;if($t){var Hn="oninput"in document;if(!Hn){var Jn=document.createElement("div");Jn.setAttribute("oninput","return;"),Hn="function"==typeof Jn.oninput}qn=Hn}else qn=!1;Wn=qn&&(!document.documentMode||9<document.documentMode)}function Qn(){Bn&&(Bn.detachEvent("onpropertychange",Gn),zn=Bn=null)}function Gn(e){if("value"===e.propertyName&&Vn(zn)){var t=[];Dn(t,zn,e,Rt(e)),Ut(Un,t)}}function Yn(e,t,n){"focusin"===e?(Qn(),zn=n,(Bn=t).attachEvent("onpropertychange",Gn)):"focusout"===e&&Qn()}function Kn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Vn(zn)}function Xn(e,t){if("click"===e)return Vn(t)}function Zn(e,t){if("input"===e||"change"===e)return Vn(t)}var er="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function tr(e,t){if(er(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ae.call(t,i)||!er(e[i],t[i]))return!1}return!0}function nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rr(e,t){var n,r=nr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nr(r)}}function ir(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ir(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ar(e){for(var t=vt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=vt((e=t.contentWindow).document)}return t}function or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sr=$t&&"documentMode"in document&&11>=document.documentMode,cr=null,ur=null,dr=null,fr=!1;function pr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;fr||null==cr||cr!==vt(r)||("selectionStart"in(r=cr)&&or(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},dr&&tr(dr,r)||(dr=r,0<(r=od(ur,"onSelect")).length&&(t=new an("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=cr)))}function hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mr={animationend:hr("Animation","AnimationEnd"),animationiteration:hr("Animation","AnimationIteration"),animationstart:hr("Animation","AnimationStart"),transitionrun:hr("Transition","TransitionRun"),transitionstart:hr("Transition","TransitionStart"),transitioncancel:hr("Transition","TransitionCancel"),transitionend:hr("Transition","TransitionEnd")},gr={},vr={};function yr(e){if(gr[e])return gr[e];if(!mr[e])return e;var t,n=mr[e];for(t in n)if(n.hasOwnProperty(t)&&t in vr)return gr[e]=n[t];return e}$t&&(vr=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);var br=yr("animationend"),wr=yr("animationiteration"),kr=yr("animationstart"),Sr=yr("transitionrun"),_r=yr("transitionstart"),xr=yr("transitioncancel"),Er=yr("transitionend"),Cr=new Map,Tr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mr(e,t){Cr.set(e,t),at(t,[e])}Tr.push("scrollEnd");var Pr="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Ar=[],Or=0,Nr=0;function Lr(){for(var e=Or,t=Nr=Or=0;t<e;){var n=Ar[t];Ar[t++]=null;var r=Ar[t];Ar[t++]=null;var i=Ar[t];Ar[t++]=null;var a=Ar[t];if(Ar[t++]=null,null!==r&&null!==i){var o=r.pending;null===o?i.next=i:(i.next=o.next,o.next=i),r.pending=i}0!==a&&Fr(n,i,a)}}function jr(e,t,n,r){Ar[Or++]=e,Ar[Or++]=t,Ar[Or++]=n,Ar[Or++]=r,Nr|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Ir(e,t,n,r){return jr(e,t,n,r),Dr(e)}function Rr(e,t){return jr(e,null,null,t),Dr(e)}function Fr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var i=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(r=a.alternate)&&(r.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(i=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,i&&null!==t&&(i=31-Se(n),null===(r=(e=a.hiddenUpdates)[i])?e[i]=[t]:r.push(t),t.lane=536870912|n),a):null}function Dr(e){if(50<Jc)throw Jc=0,Qc=null,Error(r(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Br={};function zr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(e,t,n,r){return new zr(e,t,n,r)}function Vr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function $r(e,t){var n=e.alternate;return null===n?((n=Ur(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Wr(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function qr(e,t,n,i,a,o){var s=0;if(i=e,"function"==typeof e)Vr(e)&&(s=1);else if("string"==typeof e)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,H.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case E:return(e=Ur(31,n,t,a)).elementType=E,e.lanes=o,e;case h:return Hr(n.children,a,o,t);case m:s=8,a|=24;break;case g:return(e=Ur(12,n,t,2|a)).elementType=g,e.lanes=o,e;case w:return(e=Ur(13,n,t,a)).elementType=w,e.lanes=o,e;case k:return(e=Ur(19,n,t,a)).elementType=k,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case y:s=10;break e;case v:s=9;break e;case b:s=11;break e;case S:s=14;break e;case x:s=16,i=null;break e}s=29,n=Error(r(130,null===e?"null":typeof e,"")),i=null}return(t=Ur(s,n,t,a)).elementType=e,t.type=i,t.lanes=o,t}function Hr(e,t,n,r){return(e=Ur(7,e,r,t)).lanes=n,e}function Jr(e,t,n){return(e=Ur(6,e,null,t)).lanes=n,e}function Qr(e){var t=Ur(18,null,null,0);return t.stateNode=e,t}function Gr(e,t,n){return(t=Ur(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yr=new WeakMap;function Kr(e,t){if("object"==typeof e&&null!==e){var n=Yr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:ie(t)},Yr.set(e,t),t)}return{value:e,source:t,stack:ie(t)}}var Xr=[],Zr=0,ei=null,ti=0,ni=[],ri=0,ii=null,ai=1,oi="";function si(e,t){Xr[Zr++]=ti,Xr[Zr++]=ei,ei=e,ti=t}function li(e,t,n){ni[ri++]=ai,ni[ri++]=oi,ni[ri++]=ii,ii=e;var r=ai;e=oi;var i=32-Se(r)-1;r&=~(1<<i),n+=1;var a=32-Se(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ai=1<<32-Se(t)+i|n<<i|r,oi=a+e}else ai=1<<a|n<<i|r,oi=e}function ci(e){null!==e.return&&(si(e,1),li(e,1,0))}function ui(e){for(;e===ei;)ei=Xr[--Zr],Xr[Zr]=null,ti=Xr[--Zr],Xr[Zr]=null;for(;e===ii;)ii=ni[--ri],ni[ri]=null,oi=ni[--ri],ni[ri]=null,ai=ni[--ri],ni[ri]=null}function di(e,t){ni[ri++]=ai,ni[ri++]=oi,ni[ri++]=ii,ai=t.id,oi=t.overflow,ii=e}var fi=null,pi=null,hi=!1,mi=null,gi=!1,vi=Error(r(519));function yi(e){throw xi(Kr(Error(r(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),vi}function bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[$e]=e,t[We]=r,n){case"dialog":Zu("cancel",t),Zu("close",t);break;case"iframe":case"object":case"embed":Zu("load",t);break;case"video":case"audio":for(n=0;n<Yu.length;n++)Zu(Yu[n],t);break;case"source":Zu("error",t);break;case"img":case"image":case"link":Zu("error",t),Zu("load",t);break;case"details":Zu("toggle",t);break;case"input":Zu("invalid",t),kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Zu("invalid",t);break;case"textarea":Zu("invalid",t),Et(t,r.value,r.defaultValue,r.children)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||fd(t.textContent,n)?(null!=r.popover&&(Zu("beforetoggle",t),Zu("toggle",t)),null!=r.onScroll&&Zu("scroll",t),null!=r.onScrollEnd&&Zu("scrollend",t),null!=r.onClick&&(t.onclick=jt),t=!0):t=!1,t||yi(e,!0)}function wi(e){for(fi=e.return;fi;)switch(fi.tag){case 5:case 31:case 13:return void(gi=!1);case 27:case 3:return void(gi=!0);default:fi=fi.return}}function ki(e){if(e!==fi)return!1;if(!hi)return wi(e),hi=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Sd(e.type,e.memoizedProps)),t=!t),t&&pi&&yi(e),wi(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));pi=Dd(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));pi=Dd(e)}else 27===n?(n=pi,Pd(e.type)?(e=Fd,Fd=null,pi=e):pi=n):pi=fi?Rd(e.stateNode.nextSibling):null;return!0}function Si(){pi=fi=null,hi=!1}function _i(){var e=mi;return null!==e&&(null===Lc?Lc=e:Lc.push.apply(Lc,e),mi=null),e}function xi(e){null===mi?mi=[e]:mi.push(e)}var Ei=U(null),Ci=null,Ti=null;function Mi(e,t,n){$(Ei,t._currentValue),t._currentValue=n}function Pi(e){e._currentValue=Ei.current,V(Ei)}function Ai(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Oi(e,t,n,i){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var o=a.dependencies;if(null!==o){var s=a.child;o=o.firstContext;e:for(;null!==o;){var l=o;o=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Ai(o.return,n,e),i||(s=null);break e}o=l.next}}else if(18===a.tag){if(null===(s=a.return))throw Error(r(341));s.lanes|=n,null!==(o=s.alternate)&&(o.lanes|=n),Ai(s,n,e),s=null}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===e){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}}function Ni(e,t,n,i){e=null;for(var a=t,o=!1;null!==a;){if(!o)if(524288&a.flags)o=!0;else if(262144&a.flags)break;if(10===a.tag){var s=a.alternate;if(null===s)throw Error(r(387));if(null!==(s=s.memoizedProps)){var l=a.type;er(a.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(a===G.current){if(null===(s=a.alternate))throw Error(r(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(hf):e=[hf])}a=a.return}null!==e&&Oi(t,e,n,i),t.flags|=262144}function Li(e){for(e=e.firstContext;null!==e;){if(!er(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ji(e){Ci=e,Ti=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Ii(e){return Fi(Ci,e)}function Ri(e,t){return null===Ci&&ji(e),Fi(e,t)}function Fi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===Ti){if(null===e)throw Error(r(308));Ti=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ti=Ti.next=t;return n}var Di="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Bi=e.unstable_scheduleCallback,zi=e.unstable_NormalPriority,Ui={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vi(){return{controller:new Di,data:new Map,refCount:0}}function $i(e){e.refCount--,0===e.refCount&&Bi(zi,function(){e.controller.abort()})}var Wi=null,qi=0,Hi=0,Ji=null;function Qi(){if(0===--qi&&null!==Wi){null!==Ji&&(Ji.status="fulfilled");var e=Wi;Wi=null,Hi=0,Ji=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Gi=j.S;j.S=function(e,t){Rc=ue(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Wi){var n=Wi=[];qi=0,Hi=qu(),Ji={status:"pending",value:void 0,then:function(e){n.push(e)}}}qi++,t.then(Qi,Qi)}(0,t),null!==Gi&&Gi(e,t)};var Yi=U(null);function Ki(){var e=Yi.current;return null!==e?e:vc.pooledCache}function Xi(e,t){$(Yi,null===t?Yi.current:t.pool)}function Zi(){var e=Ki();return null===e?null:{parent:Ui._currentValue,pool:e}}var ea=Error(r(460)),ta=Error(r(474)),na=Error(r(542)),ra={then:function(){}};function ia(e){return"fulfilled"===(e=e.status)||"rejected"===e}function aa(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(jt,jt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw ca(e=t.reason),e;default:if("string"==typeof t.status)t.then(jt,jt);else{if(null!==(e=vc)&&100<e.shellSuspendCounter)throw Error(r(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw ca(e=t.reason),e}throw sa=t,ea}}function oa(e){try{return(0,e._init)(e._payload)}catch(t){if(null!==t&&"object"==typeof t&&"function"==typeof t.then)throw sa=t,ea;throw t}}var sa=null;function la(){if(null===sa)throw Error(r(459));var e=sa;return sa=null,e}function ca(e){if(e===ea||e===na)throw Error(r(483))}var ua=null,da=0;function fa(e){var t=da;return da+=1,null===ua&&(ua=[]),aa(ua,e,t)}function pa(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function ha(e,t){if(t.$$typeof===d)throw Error(r(525));throw e=Object.prototype.toString.call(t),Error(r(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ma(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function a(e,t){return(e=$r(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Jr(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,r){var i=n.type;return i===h?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===x&&oa(i)===t.type)?(pa(t=a(t,n.props),n),t.return=e,t):(pa(t=qr(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Gr(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=Hr(n,e.mode,r,i)).return=e,t):((t=a(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Jr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case f:return pa(n=qr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case p:return(t=Gr(t,e.mode,n)).return=e,t;case x:return m(e,t=oa(t),n)}if(L(t)||M(t))return(t=Hr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return m(e,fa(t),n);if(t.$$typeof===y)return m(e,Ri(e,t),n);ha(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case f:return n.key===i?c(e,t,n,r):null;case p:return n.key===i?u(e,t,n,r):null;case x:return g(e,t,n=oa(n),r)}if(L(n)||M(n))return null!==i?null:d(e,t,n,r,null);if("function"==typeof n.then)return g(e,t,fa(n),r);if(n.$$typeof===y)return g(e,t,Ri(e,n),r);ha(e,n)}return null}function v(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case f:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case p:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case x:return v(e,t,n,r=oa(r),i)}if(L(r)||M(r))return d(t,e=e.get(n)||null,r,i,null);if("function"==typeof r.then)return v(e,t,n,fa(r),i);if(r.$$typeof===y)return v(e,t,n,Ri(t,r),i);ha(t,r)}return null}function b(l,c,u,d){if("object"==typeof u&&null!==u&&u.type===h&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case f:e:{for(var w=u.key;null!==c;){if(c.key===w){if((w=u.type)===h){if(7===c.tag){n(l,c.sibling),(d=a(c,u.props.children)).return=l,l=d;break e}}else if(c.elementType===w||"object"==typeof w&&null!==w&&w.$$typeof===x&&oa(w)===c.type){n(l,c.sibling),pa(d=a(c,u.props),u),d.return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}u.type===h?((d=Hr(u.props.children,l.mode,d,u.key)).return=l,l=d):(pa(d=qr(u.type,u.key,u.props,null,l.mode,d),u),d.return=l,l=d)}return s(l);case p:e:{for(w=u.key;null!==c;){if(c.key===w){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(d=a(c,u.children||[])).return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}(d=Gr(u,l.mode,d)).return=l,l=d}return s(l);case x:return b(l,c,u=oa(u),d)}if(L(u))return function(r,a,s,l){for(var c=null,u=null,d=a,f=a=0,p=null;null!==d&&f<s.length;f++){d.index>f?(p=d,d=null):p=d.sibling;var h=g(r,d,s[f],l);if(null===h){null===d&&(d=p);break}e&&d&&null===h.alternate&&t(r,d),a=o(h,a,f),null===u?c=h:u.sibling=h,u=h,d=p}if(f===s.length)return n(r,d),hi&&si(r,f),c;if(null===d){for(;f<s.length;f++)null!==(d=m(r,s[f],l))&&(a=o(d,a,f),null===u?c=d:u.sibling=d,u=d);return hi&&si(r,f),c}for(d=i(d);f<s.length;f++)null!==(p=v(d,r,f,s[f],l))&&(e&&null!==p.alternate&&d.delete(null===p.key?f:p.key),a=o(p,a,f),null===u?c=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return t(r,e)}),hi&&si(r,f),c}(l,c,u,d);if(M(u)){if("function"!=typeof(w=M(u)))throw Error(r(150));return function(a,s,l,c){if(null==l)throw Error(r(151));for(var u=null,d=null,f=s,p=s=0,h=null,y=l.next();null!==f&&!y.done;p++,y=l.next()){f.index>p?(h=f,f=null):h=f.sibling;var b=g(a,f,y.value,c);if(null===b){null===f&&(f=h);break}e&&f&&null===b.alternate&&t(a,f),s=o(b,s,p),null===d?u=b:d.sibling=b,d=b,f=h}if(y.done)return n(a,f),hi&&si(a,p),u;if(null===f){for(;!y.done;p++,y=l.next())null!==(y=m(a,y.value,c))&&(s=o(y,s,p),null===d?u=y:d.sibling=y,d=y);return hi&&si(a,p),u}for(f=i(f);!y.done;p++,y=l.next())null!==(y=v(f,a,p,y.value,c))&&(e&&null!==y.alternate&&f.delete(null===y.key?p:y.key),s=o(y,s,p),null===d?u=y:d.sibling=y,d=y);return e&&f.forEach(function(e){return t(a,e)}),hi&&si(a,p),u}(l,c,u=w.call(u),d)}if("function"==typeof u.then)return b(l,c,fa(u),d);if(u.$$typeof===y)return b(l,c,Ri(l,u),d);ha(l,u)}return"string"==typeof u&&""!==u||"number"==typeof u||"bigint"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(d=a(c,u)).return=l,l=d):(n(l,c),(d=Jr(u,l.mode,d)).return=l,l=d),s(l)):n(l,c)}return function(e,t,n,r){try{da=0;var i=b(e,t,n,r);return ua=null,i}catch(o){if(o===ea||o===na)throw o;var a=Ur(29,o,null,e.mode);return a.lanes=r,a.return=e,a}}}var ga=ma(!0),va=ma(!1),ya=!1;function ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&gc){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Dr(e),Fr(e,null,n),t}return jr(e,r,t,n),Dr(e)}function _a(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Re(e,n)}}function xa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ea=!1;function Ca(){if(Ea){if(null!==Ji)throw Ji}}function Ta(e,t,n,r){Ea=!1;var i=e.updateQueue;ya=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===o?a=c:o.next=c,o=l;var d=e.alternate;null!==d&&((s=(d=d.updateQueue).lastBaseUpdate)!==o&&(null===s?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(null!==a){var f=i.baseState;for(o=0,d=c=l=null,s=a;;){var p=-536870913&s.lane,h=p!==s.lane;if(h?(bc&p)===p:(r&p)===p){0!==p&&p===Hi&&(Ea=!0),null!==d&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var m=e,g=s;p=t;var v=n;switch(g.tag){case 1:if("function"==typeof(m=g.payload)){f=m.call(v,f,p);break e}f=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(p="function"==typeof(m=g.payload)?m.call(v,f,p):m))break e;f=u({},f,p);break e;case 2:ya=!0}}null!==(p=s.callback)&&(e.flags|=64,h&&(e.flags|=8192),null===(h=i.callbacks)?i.callbacks=[p]:h.push(p))}else h={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(c=d=h,l=f):d=d.next=h,o|=p;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(h=s).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}null===d&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,null===a&&(i.shared.lanes=0),Tc|=o,e.lanes=o,e.memoizedState=f}}function Ma(e,t){if("function"!=typeof e)throw Error(r(191,e));e.call(t)}function Pa(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)Ma(n[e],t)}var Aa=U(null),Oa=U(0);function Na(e,t){$(Oa,e=Ec),$(Aa,t),Ec=e|t.baseLanes}function La(){$(Oa,Ec),$(Aa,Aa.current)}function ja(){Ec=Oa.current,V(Aa),V(Oa)}var Ia=U(null),Ra=null;function Fa(e){var t=e.alternate;$(Va,1&Va.current),$(Ia,e),null===Ra&&(null===t||null!==Aa.current||null!==t.memoizedState)&&(Ra=e)}function Da(e){$(Va,Va.current),$(Ia,e),null===Ra&&(Ra=e)}function Ba(e){22===e.tag?($(Va,Va.current),$(Ia,e),null===Ra&&(Ra=e)):za()}function za(){$(Va,Va.current),$(Ia,Ia.current)}function Ua(e){V(Ia),Ra===e&&(Ra=null),V(Va)}var Va=U(0);function $a(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||jd(n)||Id(n)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(128&t.flags)return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wa=0,qa=null,Ha=null,Ja=null,Qa=!1,Ga=!1,Ya=!1,Ka=0,Xa=0,Za=null,eo=0;function to(){throw Error(r(321))}function no(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!er(e[n],t[n]))return!1;return!0}function ro(e,t,n,r,i,a){return Wa=a,qa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=null===e||null===e.memoizedState?bs:ws,Ya=!1,a=n(r,i),Ya=!1,Ga&&(a=ao(t,n,r,i)),io(e),a}function io(e){j.H=ys;var t=null!==Ha&&null!==Ha.next;if(Wa=0,Ja=Ha=qa=null,Qa=!1,Xa=0,Za=null,t)throw Error(r(300));null===e||Rs||null!==(e=e.dependencies)&&Li(e)&&(Rs=!0)}function ao(e,t,n,i){qa=e;var a=0;do{if(Ga&&(Za=null),Xa=0,Ga=!1,25<=a)throw Error(r(301));if(a+=1,Ja=Ha=null,null!=e.updateQueue){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,null!=o.memoCache&&(o.memoCache.index=0)}j.H=ks,o=t(n,i)}while(Ga);return o}function oo(){var e=j.H,t=e.useState()[0];return t="function"==typeof t.then?po(t):t,e=e.useState()[0],(null!==Ha?Ha.memoizedState:null)!==e&&(qa.flags|=1024),t}function so(){var e=0!==Ka;return Ka=0,e}function lo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function co(e){if(Qa){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Qa=!1}Wa=0,Ja=Ha=qa=null,Ga=!1,Xa=Ka=0,Za=null}function uo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ja?qa.memoizedState=Ja=e:Ja=Ja.next=e,Ja}function fo(){if(null===Ha){var e=qa.alternate;e=null!==e?e.memoizedState:null}else e=Ha.next;var t=null===Ja?qa.memoizedState:Ja.next;if(null!==t)Ja=t,Ha=e;else{if(null===e){if(null===qa.alternate)throw Error(r(467));throw Error(r(310))}e={memoizedState:(Ha=e).memoizedState,baseState:Ha.baseState,baseQueue:Ha.baseQueue,queue:Ha.queue,next:null},null===Ja?qa.memoizedState=Ja=e:Ja=Ja.next=e}return Ja}function po(e){var t=Xa;return Xa+=1,null===Za&&(Za=[]),e=aa(Za,e,t),t=qa,null===(null===Ja?t.memoizedState:Ja.next)&&(t=t.alternate,j.H=null===t||null===t.memoizedState?bs:ws),e}function ho(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return po(e);if(e.$$typeof===y)return Ii(e)}throw Error(r(438,String(e)))}function mo(e){var t=null,n=qa.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=qa.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=C;return t.index++,n}function go(e,t){return"function"==typeof t?t(e):t}function vo(e){return yo(fo(),Ha,e)}function yo(e,t,n){var i=e.queue;if(null===i)throw Error(r(311));i.lastRenderedReducer=n;var a=e.baseQueue,o=i.pending;if(null!==o){if(null!==a){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,i.pending=null}if(o=e.baseState,null===a)e.memoizedState=o;else{var l=s=null,c=null,u=t=a.next,d=!1;do{var f=-536870913&u.lane;if(f!==u.lane?(bc&f)===f:(Wa&f)===f){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Hi&&(d=!0);else{if((Wa&p)===p){u=u.next,p===Hi&&(d=!0);continue}f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=f,s=o):c=c.next=f,qa.lanes|=p,Tc|=p}f=u.action,Ya&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=p,s=o):c=c.next=p,qa.lanes|=f,Tc|=f;u=u.next}while(null!==u&&u!==t);if(null===c?s=o:c.next=l,!er(o,e.memoizedState)&&(Rs=!0,d&&null!==(n=Ji)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=c,i.lastRenderedState=o}return null===a&&(i.lanes=0),[e.memoizedState,i.dispatch]}function bo(e){var t=fo(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(null!==a){n.pending=null;var s=a=a.next;do{o=e(o,s.action),s=s.next}while(s!==a);er(o,t.memoizedState)||(Rs=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function wo(e,t,n){var i=qa,a=fo(),o=hi;if(o){if(void 0===n)throw Error(r(407));n=n()}else n=t();var s=!er((Ha||a).memoizedState,n);if(s&&(a.memoizedState=n,Rs=!0),a=a.queue,qo(_o.bind(null,i,a,e),[e]),a.getSnapshot!==t||s||null!==Ja&&1&Ja.memoizedState.tag){if(i.flags|=2048,zo(9,{destroy:void 0},So.bind(null,i,a,n,t),null),null===vc)throw Error(r(349));o||127&Wa||ko(i,t,n)}return n}function ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=qa.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function So(e,t,n,r){t.value=n,t.getSnapshot=r,xo(t)&&Eo(e)}function _o(e,t,n){return n(function(){xo(t)&&Eo(e)})}function xo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!er(e,n)}catch(r){return!0}}function Eo(e){var t=Rr(e,2);null!==t&&Kc(t,e,2)}function Co(e){var t=uo();if("function"==typeof e){var n=e;if(e=n(),Ya){ke(!0);try{n()}finally{ke(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:e},t}function To(e,t,n,r){return e.baseState=n,yo(e,Ha,"function"==typeof r?r:go)}function Mo(e,t,n,i,a){if(ms(e))throw Error(r(485));if(null!==(e=t.action)){var o={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};null!==j.T?n(!0):o.isTransition=!1,i(o),null===(n=t.pending)?(o.next=t.pending=o,Po(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Po(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),l=j.S;null!==l&&l(o,s),Ao(e,t,s)}catch(c){No(e,t,c)}finally{null!==a&&null!==o.types&&(a.types=o.types),j.T=a}}else try{Ao(e,t,a=n(i,r))}catch(u){No(e,t,u)}}function Ao(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){Oo(e,t,n)},function(n){return No(e,t,n)}):Oo(e,t,n)}function Oo(e,t,n){t.status="fulfilled",t.value=n,Lo(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,Po(e,n)))}function No(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,Lo(t),t=t.next}while(t!==r)}e.action=null}function Lo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function jo(e,t){return t}function Io(e,t){if(hi){var n=vc.formState;if(null!==n){e:{var r=qa;if(hi){if(pi){t:{for(var i=pi,a=gi;8!==i.nodeType;){if(!a){i=null;break t}if(null===(i=Rd(i.nextSibling))){i=null;break t}}i="F!"===(a=i.data)||"F"===a?i:null}if(i){pi=Rd(i.nextSibling),r="F!"===i.data;break e}}yi(r)}r=!1}r&&(t=n[0])}}return(n=uo()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:t},n.queue=r,n=fs.bind(null,qa,r),r.dispatch=n,r=Co(!1),a=hs.bind(null,qa,!1,r.queue),i={state:t,dispatch:null,action:e,pending:null},(r=uo()).queue=i,n=Mo.bind(null,qa,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ro(e){return Fo(fo(),Ha,e)}function Fo(e,t,n){if(t=yo(e,t,jo)[0],e=vo(go)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var r=po(t)}catch(o){if(o===ea)throw na;throw o}else r=t;var i=(t=fo()).queue,a=i.dispatch;return n!==t.memoizedState&&(qa.flags|=2048,zo(9,{destroy:void 0},Do.bind(null,i,n),null)),[r,a,e]}function Do(e,t){e.action=t}function Bo(e){var t=fo(),n=Ha;if(null!==n)return Fo(t,n,e);fo(),t=t.memoizedState;var r=(n=fo()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function zo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=qa.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Uo(){return fo().memoizedState}function Vo(e,t,n,r){var i=uo();qa.flags|=e,i.memoizedState=zo(1|t,{destroy:void 0},n,void 0===r?null:r)}function $o(e,t,n,r){var i=fo();r=void 0===r?null:r;var a=i.memoizedState.inst;null!==Ha&&null!==r&&no(r,Ha.memoizedState.deps)?i.memoizedState=zo(t,a,n,r):(qa.flags|=e,i.memoizedState=zo(1|t,a,n,r))}function Wo(e,t){Vo(8390656,8,e,t)}function qo(e,t){$o(2048,8,e,t)}function Ho(e){var t=fo().memoizedState;return function(e){qa.flags|=4;var t=qa.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&gc)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Jo(e,t){return $o(4,2,e,t)}function Qo(e,t){return $o(4,4,e,t)}function Go(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Yo(e,t,n){n=null!=n?n.concat([e]):null,$o(4,4,Go.bind(null,t,e),n)}function Ko(){}function Xo(e,t){var n=fo();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&no(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zo(e,t){var n=fo();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&no(t,r[1]))return r[0];if(r=e(),Ya){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r}function es(e,t,n){return void 0===n||1073741824&Wa&&!(261930&bc)?e.memoizedState=t:(e.memoizedState=n,e=Yc(),qa.lanes|=e,Tc|=e,n)}function ts(e,t,n,r){return er(n,t)?n:null!==Aa.current?(e=es(e,n,r),er(e,t)||(Rs=!0),e):42&Wa&&(!(1073741824&Wa)||261930&bc)?(e=Yc(),qa.lanes|=e,Tc|=e,t):(Rs=!0,e.memoizedState=n)}function ns(e,t,n,r,i){var a=R.p;R.p=0!==a&&8>a?a:8;var o,s,l,c=j.T,u={};j.T=u,hs(e,!1,t,n);try{var d=i(),f=j.S;if(null!==f&&f(u,d),null!==d&&"object"==typeof d&&"function"==typeof d.then)ps(e,t,(o=r,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},d.then(function(){l.status="fulfilled",l.value=o;for(var e=0;e<s.length;e++)(0,s[e])(o)},function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)}),l),Gc());else ps(e,t,r,Gc())}catch(p){ps(e,t,{then:function(){},status:"rejected",reason:p},Gc())}finally{R.p=a,null!==c&&null!==u.types&&(c.types=u.types),j.T=c}}function rs(){}function is(e,t,n,i){if(5!==e.tag)throw Error(r(476));var a=as(e).queue;ns(e,a,t,F,null===n?rs:function(){return os(e),n(i)})}function as(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:F},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function os(e){var t=as(e);null===t.next&&(t=e.alternate.memoizedState),ps(e,t.next.queue,{},Gc())}function ss(){return Ii(hf)}function ls(){return fo().memoizedState}function cs(){return fo().memoizedState}function us(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Gc(),r=Sa(t,e=ka(n),n);return null!==r&&(Kc(r,t,n),_a(r,t,n)),t={cache:Vi()},void(e.payload=t)}t=t.return}}function ds(e,t,n){var r=Gc();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e)?gs(t,n):null!==(n=Ir(e,t,n,r))&&(Kc(n,e,r),vs(n,t,r))}function fs(e,t,n){ps(e,t,n,Gc())}function ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))gs(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,er(s,o))return jr(e,t,i,0),null===vc&&Lr(),!1}catch(l){}if(null!==(n=Ir(e,t,i,r)))return Kc(n,e,r),vs(n,t,r),!0}return!1}function hs(e,t,n,i){if(i={lane:2,revertLane:qu(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ms(e)){if(t)throw Error(r(479))}else null!==(t=Ir(e,n,i,2))&&Kc(t,e,2)}function ms(e){var t=e.alternate;return e===qa||null!==t&&t===qa}function gs(e,t){Ga=Qa=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vs(e,t,n){if(4194048&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Re(e,n)}}var ys={readContext:Ii,use:ho,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useLayoutEffect:to,useInsertionEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useSyncExternalStore:to,useId:to,useHostTransitionStatus:to,useFormState:to,useActionState:to,useOptimistic:to,useMemoCache:to,useCacheRefresh:to};ys.useEffectEvent=to;var bs={readContext:Ii,use:ho,useCallback:function(e,t){return uo().memoizedState=[e,void 0===t?null:t],e},useContext:Ii,useEffect:Wo,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,Vo(4194308,4,Go.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vo(4194308,4,e,t)},useInsertionEffect:function(e,t){Vo(4,2,e,t)},useMemo:function(e,t){var n=uo();t=void 0===t?null:t;var r=e();if(Ya){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=uo();if(void 0!==n){var i=n(t);if(Ya){ke(!0);try{n(t)}finally{ke(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ds.bind(null,qa,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},uo().memoizedState=e},useState:function(e){var t=(e=Co(e)).queue,n=fs.bind(null,qa,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ko,useDeferredValue:function(e,t){return es(uo(),e,t)},useTransition:function(){var e=Co(!1);return e=ns.bind(null,qa,e.queue,!0,!1),uo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=qa,a=uo();if(hi){if(void 0===n)throw Error(r(407));n=n()}else{if(n=t(),null===vc)throw Error(r(349));127&bc||ko(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Wo(_o.bind(null,i,o,e),[e]),i.flags|=2048,zo(9,{destroy:void 0},So.bind(null,i,o,n,t),null),n},useId:function(){var e=uo(),t=vc.identifierPrefix;if(hi){var n=oi;t="_"+t+"R_"+(n=(ai&~(1<<32-Se(ai)-1)).toString(32)+n),0<(n=Ka++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=eo++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ss,useFormState:Io,useActionState:Io,useOptimistic:function(e){var t=uo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=hs.bind(null,qa,!0,n),n.dispatch=t,[e,t]},useMemoCache:mo,useCacheRefresh:function(){return uo().memoizedState=us.bind(null,qa)},useEffectEvent:function(e){var t=uo(),n={impl:e};return t.memoizedState=n,function(){if(2&gc)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},ws={readContext:Ii,use:ho,useCallback:Xo,useContext:Ii,useEffect:qo,useImperativeHandle:Yo,useInsertionEffect:Jo,useLayoutEffect:Qo,useMemo:Zo,useReducer:vo,useRef:Uo,useState:function(){return vo(go)},useDebugValue:Ko,useDeferredValue:function(e,t){return ts(fo(),Ha.memoizedState,e,t)},useTransition:function(){var e=vo(go)[0],t=fo().memoizedState;return["boolean"==typeof e?e:po(e),t]},useSyncExternalStore:wo,useId:ls,useHostTransitionStatus:ss,useFormState:Ro,useActionState:Ro,useOptimistic:function(e,t){return To(fo(),0,e,t)},useMemoCache:mo,useCacheRefresh:cs};ws.useEffectEvent=Ho;var ks={readContext:Ii,use:ho,useCallback:Xo,useContext:Ii,useEffect:qo,useImperativeHandle:Yo,useInsertionEffect:Jo,useLayoutEffect:Qo,useMemo:Zo,useReducer:bo,useRef:Uo,useState:function(){return bo(go)},useDebugValue:Ko,useDeferredValue:function(e,t){var n=fo();return null===Ha?es(n,e,t):ts(n,Ha.memoizedState,e,t)},useTransition:function(){var e=bo(go)[0],t=fo().memoizedState;return["boolean"==typeof e?e:po(e),t]},useSyncExternalStore:wo,useId:ls,useHostTransitionStatus:ss,useFormState:Bo,useActionState:Bo,useOptimistic:function(e,t){var n=fo();return null!==Ha?To(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mo,useCacheRefresh:cs};function Ss(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:u({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}ks.useEffectEvent=Ho;var _s={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Gc(),i=ka(r);i.payload=t,null!=n&&(i.callback=n),null!==(t=Sa(e,i,r))&&(Kc(t,e,r),_a(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Gc(),i=ka(r);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=Sa(e,i,r))&&(Kc(t,e,r),_a(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Gc(),r=ka(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=Sa(e,r,n))&&(Kc(t,e,n),_a(t,e,n))}};function xs(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!tr(n,r)||!tr(i,a))}function Es(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_s.enqueueReplaceState(t,t.state,null)}function Cs(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=u({},n)),e)void 0===n[i]&&(n[i]=e[i]);return n}function Ts(e){Pr(e)}function Ms(e){console.error(e)}function Ps(e){Pr(e)}function As(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Os(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Ns(e,t,n){return(n=ka(n)).tag=3,n.payload={element:null},n.callback=function(){As(e,t)},n}function Ls(e){return(e=ka(e)).tag=3,e}function js(e,t,n,r){var i=n.type.getDerivedStateFromError;if("function"==typeof i){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Os(t,n,r)}}var o=n.stateNode;null!==o&&"function"==typeof o.componentDidCatch&&(e.callback=function(){Os(t,n,r),"function"!=typeof i&&(null===Bc?Bc=new Set([this]):Bc.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var Is=Error(r(461)),Rs=!1;function Fs(e,t,n,r){t.child=null===e?va(t,null,n,r):ga(t,e.child,n,r)}function Ds(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var o={};for(var s in r)"ref"!==s&&(o[s]=r[s])}else o=r;return ji(t),r=ro(e,t,n,o,a,i),s=so(),null===e||Rs?(hi&&s&&ci(t),t.flags|=1,Fs(e,t,r,i),t.child):(lo(e,t,i),sl(e,t,i))}function Bs(e,t,n,r,i){if(null===e){var a=n.type;return"function"!=typeof a||Vr(a)||void 0!==a.defaultProps||null!==n.compare?((e=qr(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,zs(e,t,a,r,i))}if(a=e.child,!ll(e,i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:tr)(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,(e=$r(a,r)).ref=t.ref,e.return=t,t.child=e}function zs(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(tr(a,r)&&e.ref===t.ref){if(Rs=!1,t.pendingProps=r=a,!ll(e,i))return t.lanes=e.lanes,sl(e,t,i);131072&e.flags&&(Rs=!0)}}return Js(e,t,n,r,i)}function Us(e,t,n,r){var i=r.children,a=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(128&t.flags){if(a=null!==a?a.baseLanes|n:n,null!==e){for(r=t.child=e.child,i=0;null!==r;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return $s(e,t,a,n,r)}if(!(536870912&n))return r=t.lanes=536870912,$s(e,t,null!==a?a.baseLanes|n:n,n,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Xi(0,null!==a?a.cachePool:null),null!==a?Na(t,a):La(),Ba(t)}else null!==a?(Xi(0,a.cachePool),Na(t,a),za(),t.memoizedState=null):(null!==e&&Xi(0,null),La(),za());return Fs(e,t,i,n),t.child}function Vs(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $s(e,t,n,r,i){var a=Ki();return a=null===a?null:{parent:Ui._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},null!==e&&Xi(0,null),La(),Ba(t),null!==e&&Ni(e,t,r,!0),t.childLanes=i,null}function Ws(e,t){return(t=nl({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function qs(e,t,n){return ga(t,e.child,null,n),(e=Ws(t,t.pendingProps)).flags|=2,Ua(t),t.memoizedState=null,e}function Hs(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(r(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Js(e,t,n,r,i){return ji(t),n=ro(e,t,n,r,void 0,i),r=so(),null===e||Rs?(hi&&r&&ci(t),t.flags|=1,Fs(e,t,n,i),t.child):(lo(e,t,i),sl(e,t,i))}function Qs(e,t,n,r,i,a){return ji(t),t.updateQueue=null,n=ao(t,r,n,i),io(e),r=so(),null===e||Rs?(hi&&r&&ci(t),t.flags|=1,Fs(e,t,n,a),t.child):(lo(e,t,a),sl(e,t,a))}function Gs(e,t,n,r,i){if(ji(t),null===t.stateNode){var a=Br,o=n.contextType;"object"==typeof o&&null!==o&&(a=Ii(o)),a=new n(r,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=_s,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=r,a.state=t.memoizedState,a.refs={},ba(t),o=n.contextType,a.context="object"==typeof o&&null!==o?Ii(o):Br,a.state=t.memoizedState,"function"==typeof(o=n.getDerivedStateFromProps)&&(Ss(t,n,o,r),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(o=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&_s.enqueueReplaceState(a,a.state,null),Ta(t,r,a,i),Ca(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){a=t.stateNode;var s=t.memoizedProps,l=Cs(n,s);a.props=l;var c=a.context,u=n.contextType;o=Br,"object"==typeof u&&null!==u&&(o=Ii(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof a.getSnapshotBeforeUpdate,s=t.pendingProps!==s,u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s||c!==o)&&Es(t,a,r,o),ya=!1;var f=t.memoizedState;a.state=f,Ta(t,r,a,i),Ca(),c=t.memoizedState,s||f!==c||ya?("function"==typeof d&&(Ss(t,n,d,r),c=t.memoizedState),(l=ya||xs(t,n,l,r,f,c,o))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=o,r=l):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,wa(e,t),u=Cs(n,o=t.memoizedProps),a.props=u,d=t.pendingProps,f=a.context,c=n.contextType,l=Br,"object"==typeof c&&null!==c&&(l=Ii(c)),(c="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==d||f!==l)&&Es(t,a,r,l),ya=!1,f=t.memoizedState,a.state=f,Ta(t,r,a,i),Ca();var p=t.memoizedState;o!==d||f!==p||ya||null!==e&&null!==e.dependencies&&Li(e.dependencies)?("function"==typeof s&&(Ss(t,n,s,r),p=t.memoizedState),(u=ya||xs(t,n,u,r,f,p,l)||null!==e&&null!==e.dependencies&&Li(e.dependencies))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hs(e,t),r=!!(128&t.flags),a||r?(a=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&r?(t.child=ga(t,e.child,null,i),t.child=ga(t,null,n,i)):Fs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Ys(e,t,n,r){return Si(),t.flags|=256,Fs(e,t,n,r),t.child}var Ks={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xs(e){return{baseLanes:e,cachePool:Zi()}}function Zs(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=Ac),e}function el(e,t,n){var i,a=t.pendingProps,o=!1,s=!!(128&t.flags);if((i=s)||(i=(null===e||null!==e.memoizedState)&&!!(2&Va.current)),i&&(o=!0,t.flags&=-129),i=!!(32&t.flags),t.flags&=-33,null===e){if(hi){if(o?Fa(t):za(),(e=pi)?null!==(e=null!==(e=Ld(e,gi))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ii?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},(n=Qr(e)).return=t,t.child=n,fi=t,pi=null):e=null,null===e)throw yi(t);return Id(e)?t.lanes=32:t.lanes=536870912,null}var l=a.children;return a=a.fallback,o?(za(),l=nl({mode:"hidden",children:l},o=t.mode),a=Hr(a,o,n,null),l.return=t,a.return=t,l.sibling=a,t.child=l,(a=t.child).memoizedState=Xs(n),a.childLanes=Zs(e,i,n),t.memoizedState=Ks,Vs(null,a)):(Fa(t),tl(t,l))}var c=e.memoizedState;if(null!==c&&null!==(l=c.dehydrated)){if(s)256&t.flags?(Fa(t),t.flags&=-257,t=rl(e,t,n)):null!==t.memoizedState?(za(),t.child=e.child,t.flags|=128,t=null):(za(),l=a.fallback,o=t.mode,a=nl({mode:"visible",children:a.children},o),(l=Hr(l,o,n,null)).flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,ga(t,e.child,null,n),(a=t.child).memoizedState=Xs(n),a.childLanes=Zs(e,i,n),t.memoizedState=Ks,t=Vs(null,a));else if(Fa(t),Id(l)){if(i=l.nextSibling&&l.nextSibling.dataset)var u=i.dgst;i=u,(a=Error(r(419))).stack="",a.digest=i,xi({value:a,source:null,stack:null}),t=rl(e,t,n)}else if(Rs||Ni(e,t,n,!1),i=0!==(n&e.childLanes),Rs||i){if(null!==(i=vc)&&(0!==(a=Fe(i,n))&&a!==c.retryLane))throw c.retryLane=a,Rr(e,a),Kc(i,e,a),Is;jd(l)||cu(),t=rl(e,t,n)}else jd(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,pi=Rd(l.nextSibling),fi=t,hi=!0,mi=null,gi=!1,null!==e&&di(t,e),(t=tl(t,a.children)).flags|=4096);return t}return o?(za(),l=a.fallback,o=t.mode,u=(c=e.child).sibling,(a=$r(c,{mode:"hidden",children:a.children})).subtreeFlags=65011712&c.subtreeFlags,null!==u?l=$r(u,l):(l=Hr(l,o,n,null)).flags|=2,l.return=t,a.return=t,a.sibling=l,t.child=a,Vs(null,a),a=t.child,null===(l=e.child.memoizedState)?l=Xs(n):(null!==(o=l.cachePool)?(c=Ui._currentValue,o=o.parent!==c?{parent:c,pool:c}:o):o=Zi(),l={baseLanes:l.baseLanes|n,cachePool:o}),a.memoizedState=l,a.childLanes=Zs(e,i,n),t.memoizedState=Ks,Vs(e.child,a)):(Fa(t),e=(n=e.child).sibling,(n=$r(n,{mode:"visible",children:a.children})).return=t,n.sibling=null,null!==e&&(null===(i=t.deletions)?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return(t=nl({mode:"visible",children:t},e.mode)).return=e,e.child=t}function nl(e,t){return(e=Ur(22,e,null,t)).lanes=0,e}function rl(e,t,n){return ga(t,e.child,null,n),(e=tl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function il(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ai(e.return,t,n)}function al(e,t,n,r,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Va.current,s=!!(2&o);if(s?(o=1&o|2,t.flags|=128):o&=1,$(Va,o),Fs(e,t,r,n),r=hi?ti:0,!s&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&il(e,n,t);else if(19===e.tag)il(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===$a(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===$a(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case"together":al(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function sl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Tc|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(Ni(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=$r(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=$r(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function ll(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Li(e))}function cl(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Rs=!0;else{if(!(ll(e,n)||128&t.flags))return Rs=!1,function(e,t,n){switch(t.tag){case 3:Y(t,t.stateNode.containerInfo),Mi(0,Ui,e.memoizedState.cache),Si();break;case 27:case 5:X(t);break;case 4:Y(t,t.stateNode.containerInfo);break;case 10:Mi(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Da(t),null;break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(Fa(t),t.flags|=128,null):0!==(n&t.child.childLanes)?el(e,t,n):(Fa(t),null!==(e=sl(e,t,n))?e.sibling:null);Fa(t);break;case 19:var i=!!(128&e.flags);if((r=0!==(n&t.childLanes))||(Ni(e,t,n,!1),r=0!==(n&t.childLanes)),i){if(r)return ol(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),$(Va,Va.current),r)break;return null;case 22:return t.lanes=0,Us(e,t,n,t.pendingProps);case 24:Mi(0,Ui,e.memoizedState.cache)}return sl(e,t,n)}(e,t,n);Rs=!!(131072&e.flags)}else Rs=!1,hi&&1048576&t.flags&&li(t,ti,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=oa(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var a=e.$$typeof;if(a===b){t.tag=11,t=Ds(null,t,e,i,n);break e}if(a===S){t.tag=14,t=Bs(null,t,e,i,n);break e}}throw t=O(e)||e,Error(r(306,t,""))}Vr(e)?(i=Cs(e,i),t.tag=1,t=Gs(null,t,e,i,n)):(t.tag=0,t=Js(null,t,e,i,n))}return t;case 0:return Js(e,t,t.type,t.pendingProps,n);case 1:return Gs(e,t,i=t.type,a=Cs(i,t.pendingProps),n);case 3:e:{if(Y(t,t.stateNode.containerInfo),null===e)throw Error(r(387));i=t.pendingProps;var o=t.memoizedState;a=o.element,wa(e,t),Ta(t,i,null,n);var s=t.memoizedState;if(i=s.cache,Mi(0,Ui,i),i!==o.cache&&Oi(t,[Ui],n,!0),Ca(),i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Ys(e,t,i,n);break e}if(i!==a){xi(a=Kr(Error(r(424)),t)),t=Ys(e,t,i,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(pi=Rd(e.firstChild),fi=t,hi=!0,mi=null,gi=!0,n=va(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Si(),i===a){t=sl(e,t,n);break e}Fs(e,t,i,n)}t=t.child}return t;case 26:return Hs(e,t),null===e?(n=Qd(t.type,null,t.pendingProps,null))?t.memoizedState=n:hi||(n=t.type,e=t.pendingProps,(i=bd(Q.current).createElement(n))[$e]=t,i[We]=e,md(i,n,e),nt(i),t.stateNode=i):t.memoizedState=Qd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),null===e&&hi&&(i=t.stateNode=zd(t.type,t.pendingProps,Q.current),fi=t,gi=!0,a=pi,Pd(t.type)?(Fd=a,pi=Rd(i.firstChild)):pi=a),Fs(e,t,t.pendingProps.children,n),Hs(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&hi&&((a=i=pi)&&(null!==(i=function(e,t,n,r){for(;1===e.nodeType;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Ye])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(null==i.href||""===i.href?null:i.href)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin)||e.getAttribute("title")!==(null==i.title?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==i.src?null:i.src)||e.getAttribute("type")!==(null==i.type?null:i.type)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==i.name?null:""+i.name;if("hidden"===i.type&&e.getAttribute("name")===a)return e}if(null===(e=Rd(e.nextSibling)))break}return null}(i,t.type,t.pendingProps,gi))?(t.stateNode=i,fi=t,pi=Rd(i.firstChild),gi=!1,a=!0):a=!1),a||yi(t)),X(t),a=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,i=o.children,Sd(a,o)?i=null:null!==s&&Sd(a,s)&&(t.flags|=32),null!==t.memoizedState&&(a=ro(e,t,oo,null,null,n),hf._currentValue=a),Hs(e,t),Fs(e,t,i,n),t.child;case 6:return null===e&&hi&&((e=n=pi)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=Rd(e.nextSibling)))return null}return e}(n,t.pendingProps,gi))?(t.stateNode=n,fi=t,pi=null,e=!0):e=!1),e||yi(t)),null;case 13:return el(e,t,n);case 4:return Y(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=ga(t,null,i,n):Fs(e,t,i,n),t.child;case 11:return Ds(e,t,t.type,t.pendingProps,n);case 7:return Fs(e,t,t.pendingProps,n),t.child;case 8:case 12:return Fs(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Mi(0,t.type,i.value),Fs(e,t,i.children,n),t.child;case 9:return a=t.type._context,i=t.pendingProps.children,ji(t),i=i(a=Ii(a)),t.flags|=1,Fs(e,t,i,n),t.child;case 14:return Bs(e,t,t.type,t.pendingProps,n);case 15:return zs(e,t,t.type,t.pendingProps,n);case 19:return ol(e,t,n);case 31:return function(e,t,n){var i=t.pendingProps,a=!!(128&t.flags);if(t.flags&=-129,null===e){if(hi){if("hidden"===i.mode)return e=Ws(t,i),t.lanes=536870912,Vs(null,e);if(Da(t),(e=pi)?null!==(e=null!==(e=Ld(e,gi))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==ii?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},(n=Qr(e)).return=t,t.child=n,fi=t,pi=null):e=null,null===e)throw yi(t);return t.lanes=536870912,null}return Ws(t,i)}var o=e.memoizedState;if(null!==o){var s=o.dehydrated;if(Da(t),a)if(256&t.flags)t.flags&=-257,t=qs(e,t,n);else{if(null===t.memoizedState)throw Error(r(558));t.child=e.child,t.flags|=128,t=null}else if(Rs||Ni(e,t,n,!1),a=0!==(n&e.childLanes),Rs||a){if(null!==(i=vc)&&0!==(s=Fe(i,n))&&s!==o.retryLane)throw o.retryLane=s,Rr(e,s),Kc(i,e,s),Is;cu(),t=qs(e,t,n)}else e=o.treeContext,pi=Rd(s.nextSibling),fi=t,hi=!0,mi=null,gi=!1,null!==e&&di(t,e),(t=Ws(t,i)).flags|=4096;return t}return(e=$r(e.child,{mode:i.mode,children:i.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return Us(e,t,n,t.pendingProps);case 24:return ji(t),i=Ii(Ui),null===e?(null===(a=Ki())&&(a=vc,o=Vi(),a.pooledCache=o,o.refCount++,null!==o&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:i,cache:a},ba(t),Mi(0,Ui,a)):(0!==(e.lanes&n)&&(wa(e,t),Ta(t,null,null,n),Ca()),a=e.memoizedState,o=t.memoizedState,a.parent!==i?(a={parent:i,cache:i},t.memoizedState=a,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=a),Mi(0,Ui,i)):(i=o.cache,Mi(0,Ui,i),i!==a.cache&&Oi(t,[Ui],n,!0))),Fs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){if((t=!!(32&e.mode))&&(t=!1),t){if(e.flags|=16777216,(335544128&i)===i)if(e.stateNode.complete)e.flags|=8192;else{if(!ou())throw sa=ra,ta;e.flags|=8192}}else e.flags&=-16777217}function fl(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!lf(t)){if(!ou())throw sa=ra,ta;e.flags|=8192}}function pl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Ne():536870912,e.lanes|=t,Oc|=t)}function hl(e,t){if(!hi)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ml(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=65011712&i.subtreeFlags,r|=65011712&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gl(e,t,n){var i=t.pendingProps;switch(ui(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return ml(t),null;case 3:return n=t.stateNode,i=null,null!==e&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Pi(Ui),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ki(t)?ul(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,_i())),ml(t),null;case 26:var a=t.type,o=t.memoizedState;return null===e?(ul(t),null!==o?(ml(t),fl(t,o)):(ml(t),dl(t,a,0,0,n))):o?o!==e.memoizedState?(ul(t),ml(t),fl(t,o)):(ml(t),t.flags&=-16777217):((e=e.memoizedProps)!==i&&ul(t),ml(t),dl(t,a,0,0,n)),null;case 27:if(Z(t),n=Q.current,a=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if(!i){if(null===t.stateNode)throw Error(r(166));return ml(t),null}e=H.current,ki(t)?bi(t):(e=zd(a,i,n),t.stateNode=e,ul(t))}return ml(t),null;case 5:if(Z(t),a=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if(!i){if(null===t.stateNode)throw Error(r(166));return ml(t),null}if(o=H.current,ki(t))bi(t);else{var s=bd(Q.current);switch(o){case 1:o=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:o=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":o=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":o=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":(o=s.createElement("div")).innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o="string"==typeof i.is?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o="string"==typeof i.is?s.createElement(a,{is:i.is}):s.createElement(a)}}o[$e]=t,o[We]=i;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)o.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;e:switch(md(o,a,i),a){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ul(t)}}return ml(t),dl(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==i&&ul(t);else{if("string"!=typeof i&&null===t.stateNode)throw Error(r(166));if(e=Q.current,ki(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,null!==(a=fi))switch(a.tag){case 27:case 5:i=a.memoizedProps}e[$e]=t,(e=!!(e.nodeValue===n||null!==i&&!0===i.suppressHydrationWarning||fd(e.nodeValue,n)))||yi(t,!0)}else(e=bd(e).createTextNode(i))[$e]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(i=ki(t),null!==n){if(null===e){if(!i)throw Error(r(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(r(557));e[$e]=t}else Si(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=_i(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Ua(t),t):(Ua(t),null);if(128&t.flags)throw Error(r(558))}return ml(t),null;case 13:if(i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(a=ki(t),null!==i&&null!==i.dehydrated){if(null===e){if(!a)throw Error(r(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(r(317));a[$e]=t}else Si(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ml(t),a=!1}else a=_i(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return 256&t.flags?(Ua(t),t):(Ua(t),null)}return Ua(t),128&t.flags?(t.lanes=n,t):(n=null!==i,e=null!==e&&null!==e.memoizedState,n&&(a=null,null!==(i=t.child).alternate&&null!==i.alternate.memoizedState&&null!==i.alternate.memoizedState.cachePool&&(a=i.alternate.memoizedState.cachePool.pool),o=null,null!==i.memoizedState&&null!==i.memoizedState.cachePool&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),pl(t,t.updateQueue),ml(t),null);case 4:return K(),null===e&&nd(t.stateNode.containerInfo),ml(t),null;case 10:return Pi(t.type),ml(t),null;case 19:if(V(Va),null===(i=t.memoizedState))return ml(t),null;if(a=!!(128&t.flags),null===(o=i.rendering))if(a)hl(i,!1);else{if(0!==Cc||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=$a(e))){for(t.flags|=128,hl(i,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Wr(n,e),n=n.sibling;return $(Va,1&Va.current|2),hi&&si(t,i.treeForkCount),t.child}e=e.sibling}null!==i.tail&&ue()>Fc&&(t.flags|=128,a=!0,hl(i,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=$a(o))){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),hl(i,!0),null===i.tail&&"hidden"===i.tailMode&&!o.alternate&&!hi)return ml(t),null}else 2*ue()-i.renderingStartTime>Fc&&536870912!==n&&(t.flags|=128,a=!0,hl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=i.last)?e.sibling=o:t.child=o,i.last=o)}return null!==i.tail?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ue(),e.sibling=null,n=Va.current,$(Va,a?1&n|2:1&n),hi&&si(t,i.treeForkCount),e):(ml(t),null);case 22:case 23:return Ua(t),ja(),i=null!==t.memoizedState,null!==e?null!==e.memoizedState!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?!!(536870912&n)&&!(128&t.flags)&&(ml(t),6&t.subtreeFlags&&(t.flags|=8192)):ml(t),null!==(n=t.updateQueue)&&pl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),i=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),null!==e&&V(Yi),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Pi(Ui),ml(t),null;case 25:case 30:return null}throw Error(r(156,t.tag))}function vl(e,t){switch(ui(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Pi(Ui),K(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return Z(t),null;case 31:if(null!==t.memoizedState){if(Ua(t),null===t.alternate)throw Error(r(340));Si()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Ua(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(r(340));Si()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return V(Va),null;case 4:return K(),null;case 10:return Pi(t.type),null;case 22:case 23:return Ua(t),ja(),null!==e&&V(Yi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Pi(Ui),null;default:return null}}function yl(e,t){switch(ui(t),t.tag){case 3:Pi(Ui),K();break;case 26:case 27:case 5:Z(t);break;case 4:K();break;case 31:null!==t.memoizedState&&Ua(t);break;case 13:Ua(t);break;case 19:V(Va);break;case 10:Pi(t.type);break;case 22:case 23:Ua(t),ja(),null!==e&&V(Yi);break;case 24:Pi(Ui)}}function bl(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(s){Cu(t,t.return,s)}}function wl(e,t,n){try{var r=t.updateQueue,i=null!==r?r.lastEffect:null;if(null!==i){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(void 0!==s){o.destroy=void 0,i=t;var l=n,c=s;try{c()}catch(u){Cu(i,l,u)}}}r=r.next}while(r!==a)}}catch(u){Cu(t,t.return,u)}}function kl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Pa(t,n)}catch(r){Cu(e,e.return,r)}}}function Sl(e,t,n){n.props=Cs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Cu(e,t,r)}}function _l(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(i){Cu(e,t,i)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(i){Cu(e,t,i)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(a){Cu(e,t,a)}else n.current=null}function El(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){Cu(e,e.return,i)}}function Cl(e,t,n){try{var i=e.stateNode;!function(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,o=null,s=null,l=null,c=null,u=null,d=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&null!=f)switch(h){case"checked":case"value":break;case"defaultValue":c=f;default:i.hasOwnProperty(h)||pd(e,t,h,null,i,f)}}for(var p in i){var h=i[p];if(f=n[p],i.hasOwnProperty(p)&&(null!=h||null!=f))switch(p){case"type":o=h;break;case"name":a=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":s=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(r(137,t));break;default:h!==f&&pd(e,t,p,h,i,f)}}return void wt(e,s,l,c,u,d,o,a);case"select":for(o in h=s=l=p=null,n)if(c=n[o],n.hasOwnProperty(o)&&null!=c)switch(o){case"value":break;case"multiple":h=c;default:i.hasOwnProperty(o)||pd(e,t,o,null,i,c)}for(a in i)if(o=i[a],c=n[a],i.hasOwnProperty(a)&&(null!=o||null!=c))switch(a){case"value":p=o;break;case"defaultValue":l=o;break;case"multiple":s=o;default:o!==c&&pd(e,t,a,o,i,c)}return t=l,n=s,i=h,void(null!=p?_t(e,!!n,p,!1):!!i!=!!n&&(null!=t?_t(e,!!n,t,!0):_t(e,!!n,n?[]:"",!1)));case"textarea":for(l in h=p=null,n)if(a=n[l],n.hasOwnProperty(l)&&null!=a&&!i.hasOwnProperty(l))switch(l){case"value":case"children":break;default:pd(e,t,l,null,i,a)}for(s in i)if(a=i[s],o=n[s],i.hasOwnProperty(s)&&(null!=a||null!=o))switch(s){case"value":p=a;break;case"defaultValue":h=a;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=a)throw Error(r(91));break;default:a!==o&&pd(e,t,s,a,i,o)}return void xt(e,p,h);case"option":for(var m in n)if(p=n[m],n.hasOwnProperty(m)&&null!=p&&!i.hasOwnProperty(m))if("selected"===m)e.selected=!1;else pd(e,t,m,null,i,p);for(c in i)if(p=i[c],h=n[c],i.hasOwnProperty(c)&&p!==h&&(null!=p||null!=h))if("selected"===c)e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p;else pd(e,t,c,p,i,h);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)p=n[g],n.hasOwnProperty(g)&&null!=p&&!i.hasOwnProperty(g)&&pd(e,t,g,null,i,p);for(u in i)if(p=i[u],h=n[u],i.hasOwnProperty(u)&&p!==h&&(null!=p||null!=h))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(r(137,t));break;default:pd(e,t,u,p,i,h)}return;default:if(At(t)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&void 0!==p&&!i.hasOwnProperty(v)&&hd(e,t,v,void 0,i,p);for(d in i)p=i[d],h=n[d],!i.hasOwnProperty(d)||p===h||void 0===p&&void 0===h||hd(e,t,d,p,i,h);return}}for(var y in n)p=n[y],n.hasOwnProperty(y)&&null!=p&&!i.hasOwnProperty(y)&&pd(e,t,y,null,i,p);for(f in i)p=i[f],h=n[f],!i.hasOwnProperty(f)||p===h||null==p&&null==h||pd(e,t,f,p,i,h)}(i,e.type,n,t),i[We]=t}catch(a){Cu(e,e.return,a)}}function Tl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Pd(e.type)||4===e.tag}function Ml(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Tl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Pd(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Pl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=jt));else if(4!==r&&(27===r&&Pd(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(Pl(e,t,n),e=e.sibling;null!==e;)Pl(e,t,n),e=e.sibling}function Al(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&Pd(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(Al(e,t,n),e=e.sibling;null!==e;)Al(e,t,n),e=e.sibling}function Ol(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);md(t,r,n),t[$e]=e,t[We]=n}catch(a){Cu(e,e.return,a)}}var Nl=!1,Ll=!1,jl=!1,Il="function"==typeof WeakSet?WeakSet:Set,Rl=null;function Fl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Kl(e,n),4&r&&bl(5,n);break;case 1:if(Kl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(o){Cu(n,n.return,o)}else{var i=Cs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Cu(n,n.return,s)}}64&r&&kl(n),512&r&&_l(n,n.return);break;case 3:if(Kl(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{Pa(e,t)}catch(o){Cu(n,n.return,o)}}break;case 27:null===t&&4&r&&Ol(n);case 26:case 5:Kl(e,n),null===t&&4&r&&El(n),512&r&&_l(n,n.return);break;case 12:Kl(e,n);break;case 31:Kl(e,n),4&r&&$l(e,n);break;case 13:Kl(e,n),4&r&&Wl(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=Au.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||Nl)){t=null!==t&&null!==t.memoizedState||Ll,i=Nl;var a=Ll;Nl=r,(Ll=t)&&!a?Zl(e,n,!!(8772&n.subtreeFlags)):Kl(e,n),Nl=i,Ll=a}break;case 30:break;default:Kl(e,n)}}function Dl(e){var t=e.alternate;null!==t&&(e.alternate=null,Dl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ke(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Bl=null,zl=!1;function Ul(e,t,n){for(n=n.child;null!==n;)Vl(e,t,n),n=n.sibling}function Vl(e,t,n){if(we&&"function"==typeof we.onCommitFiberUnmount)try{we.onCommitFiberUnmount(be,n)}catch(a){}switch(n.tag){case 26:Ll||xl(n,t),Ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Ll||xl(n,t);var r=Bl,i=zl;Pd(n.type)&&(Bl=n.stateNode,zl=!1),Ul(e,t,n),Ud(n.stateNode),Bl=r,zl=i;break;case 5:Ll||xl(n,t);case 6:if(r=Bl,i=zl,Bl=null,Ul(e,t,n),zl=i,null!==(Bl=r))if(zl)try{(9===Bl.nodeType?Bl.body:"HTML"===Bl.nodeName?Bl.ownerDocument.body:Bl).removeChild(n.stateNode)}catch(o){Cu(n,t,o)}else try{Bl.removeChild(n.stateNode)}catch(o){Cu(n,t,o)}break;case 18:null!==Bl&&(zl?(Ad(9===(e=Bl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Qf(e)):Ad(Bl,n.stateNode));break;case 4:r=Bl,i=zl,Bl=n.stateNode.containerInfo,zl=!0,Ul(e,t,n),Bl=r,zl=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),Ll||wl(4,n,t),Ul(e,t,n);break;case 1:Ll||(xl(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&Sl(n,t,r)),Ul(e,t,n);break;case 21:Ul(e,t,n);break;case 22:Ll=(r=Ll)||null!==n.memoizedState,Ul(e,t,n),Ll=r;break;default:Ul(e,t,n)}}function $l(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{Qf(e)}catch(n){Cu(t,t.return,n)}}}function Wl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Qf(e)}catch(n){Cu(t,t.return,n)}}function ql(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Il),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Il),t;default:throw Error(r(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ou.bind(null,e,t);t.then(r,r)}})}function Hl(e,t){var n=t.deletions;if(null!==n)for(var i=0;i<n.length;i++){var a=n[i],o=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 27:if(Pd(l.type)){Bl=l.stateNode,zl=!1;break e}break;case 5:Bl=l.stateNode,zl=!1;break e;case 3:case 4:Bl=l.stateNode.containerInfo,zl=!0;break e}l=l.return}if(null===Bl)throw Error(r(160));Vl(o,s,a),Bl=null,zl=!1,null!==(o=a.alternate)&&(o.return=null),a.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Ql(t,e),t=t.sibling}var Jl=null;function Ql(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Hl(t,e),Gl(e),4&i&&(wl(3,e,e.return),bl(3,e),wl(5,e,e.return));break;case 1:Hl(t,e),Gl(e),512&i&&(Ll||null===n||xl(n,n.return)),64&i&&Nl&&(null!==(e=e.updateQueue)&&(null!==(i=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?i:n.concat(i))));break;case 26:var a=Jl;if(Hl(t,e),Gl(e),512&i&&(Ll||null===n||xl(n,n.return)),4&i){var o=null!==n?n.memoizedState:null;if(i=e.memoizedState,null===n)if(null===i)if(null===e.stateNode){e:{i=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(i){case"title":(!(o=a.getElementsByTagName("title")[0])||o[Ye]||o[$e]||"http://www.w3.org/2000/svg"===o.namespaceURI||o.hasAttribute("itemprop"))&&(o=a.createElement(i),a.head.insertBefore(o,a.querySelector("head > title"))),md(o,i,n),o[$e]=e,nt(o),i=o;break e;case"link":var s=of("link","href",a).get(i+(n.href||""));if(s)for(var l=0;l<s.length;l++)if((o=s[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&o.getAttribute("rel")===(null==n.rel?null:n.rel)&&o.getAttribute("title")===(null==n.title?null:n.title)&&o.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){s.splice(l,1);break t}md(o=a.createElement(i),i,n),a.head.appendChild(o);break;case"meta":if(s=of("meta","content",a).get(i+(n.content||"")))for(l=0;l<s.length;l++)if((o=s[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&o.getAttribute("name")===(null==n.name?null:n.name)&&o.getAttribute("property")===(null==n.property?null:n.property)&&o.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&o.getAttribute("charset")===(null==n.charSet?null:n.charSet)){s.splice(l,1);break t}md(o=a.createElement(i),i,n),a.head.appendChild(o);break;default:throw Error(r(468,i))}o[$e]=e,nt(o),i=o}e.stateNode=i}else sf(a,e.type,e.stateNode);else e.stateNode=ef(a,i,e.memoizedProps);else o!==i?(null===o?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):o.count--,null===i?sf(a,e.type,e.stateNode):ef(a,i,e.memoizedProps)):null===i&&null!==e.stateNode&&Cl(e,e.memoizedProps,n.memoizedProps)}break;case 27:Hl(t,e),Gl(e),512&i&&(Ll||null===n||xl(n,n.return)),null!==n&&4&i&&Cl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Hl(t,e),Gl(e),512&i&&(Ll||null===n||xl(n,n.return)),32&e.flags){a=e.stateNode;try{Ct(a,"")}catch(m){Cu(e,e.return,m)}}4&i&&null!=e.stateNode&&Cl(e,a=e.memoizedProps,null!==n?n.memoizedProps:a),1024&i&&(jl=!0);break;case 6:if(Hl(t,e),Gl(e),4&i){if(null===e.stateNode)throw Error(r(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(m){Cu(e,e.return,m)}}break;case 3:if(af=null,a=Jl,Jl=Wd(t.containerInfo),Hl(t,e),Jl=a,Gl(e),4&i&&null!==n&&n.memoizedState.isDehydrated)try{Qf(t.containerInfo)}catch(m){Cu(e,e.return,m)}jl&&(jl=!1,Yl(e));break;case 4:i=Jl,Jl=Wd(e.stateNode.containerInfo),Hl(t,e),Gl(e),Jl=i;break;case 12:default:Hl(t,e),Gl(e);break;case 31:case 19:Hl(t,e),Gl(e),4&i&&(null!==(i=e.updateQueue)&&(e.updateQueue=null,ql(e,i)));break;case 13:Hl(t,e),Gl(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(Ic=ue()),4&i&&(null!==(i=e.updateQueue)&&(e.updateQueue=null,ql(e,i)));break;case 22:a=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=Nl,d=Ll;if(Nl=u||a,Ll=d||c,Hl(t,e),Ll=d,Nl=u,Gl(e),8192&i)e:for(t=e.stateNode,t._visibility=a?-2&t._visibility:1|t._visibility,a&&(null===n||c||Nl||Ll||Xl(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(o=c.stateNode,a)"function"==typeof(s=o.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,p=null!=f&&f.hasOwnProperty("display")?f.display:null;l.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(m){Cu(c,c.return,m)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(m){Cu(c,c.return,m)}}}else if(18===t.tag){if(null===n){c=t;try{var h=c.stateNode;a?Od(h,!0):Od(c.stateNode,!1)}catch(m){Cu(c,c.return,m)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&i&&(null!==(i=e.updateQueue)&&(null!==(n=i.retryQueue)&&(i.retryQueue=null,ql(e,n))));case 30:case 21:}}function Gl(e){var t=e.flags;if(2&t){try{for(var n,i=e.return;null!==i;){if(Tl(i)){n=i;break}i=i.return}if(null==n)throw Error(r(160));switch(n.tag){case 27:var a=n.stateNode;Al(e,Ml(e),a);break;case 5:var o=n.stateNode;32&n.flags&&(Ct(o,""),n.flags&=-33),Al(e,Ml(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Pl(e,Ml(e),s);break;default:throw Error(r(161))}}catch(l){Cu(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Yl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Yl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Kl(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Fl(e,t.alternate,t),t=t.sibling}function Xl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:wl(4,t,t.return),Xl(t);break;case 1:xl(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&Sl(t,t.return,n),Xl(t);break;case 27:Ud(t.stateNode);case 26:case 5:xl(t,t.return),Xl(t);break;case 22:null===t.memoizedState&&Xl(t);break;default:Xl(t)}e=e.sibling}}function Zl(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Zl(i,a,n),bl(4,a);break;case 1:if(Zl(i,a,n),"function"==typeof(i=(r=a).stateNode).componentDidMount)try{i.componentDidMount()}catch(c){Cu(r,r.return,c)}if(null!==(i=(r=a).updateQueue)){var s=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(null!==l)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Ma(l[i],s)}catch(c){Cu(r,r.return,c)}}n&&64&o&&kl(a),_l(a,a.return);break;case 27:Ol(a);case 26:case 5:Zl(i,a,n),n&&null===r&&4&o&&El(a),_l(a,a.return);break;case 12:Zl(i,a,n);break;case 31:Zl(i,a,n),n&&4&o&&$l(i,a);break;case 13:Zl(i,a,n),n&&4&o&&Wl(i,a);break;case 22:null===a.memoizedState&&Zl(i,a,n),_l(a,a.return);break;case 30:break;default:Zl(i,a,n)}t=t.sibling}}function ec(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&$i(n))}function tc(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&$i(e))}function nc(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)rc(e,t,n,r),t=t.sibling}function rc(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:nc(e,t,n,r),2048&i&&bl(9,t);break;case 1:case 31:case 13:default:nc(e,t,n,r);break;case 3:nc(e,t,n,r),2048&i&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&$i(e)));break;case 12:if(2048&i){nc(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;"function"==typeof s&&s(o,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){Cu(t,t.return,l)}}else nc(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,null!==t.memoizedState?2&a._visibility?nc(e,t,n,r):ac(e,t):2&a._visibility?nc(e,t,n,r):(a._visibility|=2,ic(e,t,n,r,!!(10256&t.subtreeFlags)||!1)),2048&i&&ec(o,t);break;case 24:nc(e,t,n,r),2048&i&&tc(t.alternate,t)}}function ic(e,t,n,r,i){for(i=i&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var a=e,o=t,s=n,l=r,c=o.flags;switch(o.tag){case 0:case 11:case 15:ic(a,o,s,l,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;null!==o.memoizedState?2&u._visibility?ic(a,o,s,l,i):ac(a,o):(u._visibility|=2,ic(a,o,s,l,i)),i&&2048&c&&ec(o.alternate,o);break;case 24:ic(a,o,s,l,i),i&&2048&c&&tc(o.alternate,o);break;default:ic(a,o,s,l,i)}t=t.sibling}}function ac(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:ac(n,r),2048&i&&ec(r.alternate,r);break;case 24:ac(n,r),2048&i&&tc(r.alternate,r);break;default:ac(n,r)}t=t.sibling}}var oc=8192;function sc(e,t,n){if(e.subtreeFlags&oc)for(e=e.child;null!==e;)lc(e,t,n),e=e.sibling}function lc(e,t,n){switch(e.tag){case 26:sc(e,t,n),e.flags&oc&&null!==e.memoizedState&&function(e,t,n,r){if(!("stylesheet"!==n.type||"string"==typeof r.media&&!1===matchMedia(r.media).matches||4&n.state.loading)){if(null===n.instance){var i=Gd(r.href),a=t.querySelector(Yd(i));if(a)return null!==(t=a._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=uf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,void nt(a);a=t.ownerDocument||t,r=Kd(r),(i=Vd.get(i))&&nf(r,i),nt(a=a.createElement("link"));var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),md(a,"link",r),n.instance=a}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=uf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,Jl,e.memoizedState,e.memoizedProps);break;case 5:default:sc(e,t,n);break;case 3:case 4:var r=Jl;Jl=Wd(e.stateNode.containerInfo),sc(e,t,n),Jl=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=oc,oc=16777216,sc(e,t,n),oc=r):sc(e,t,n))}}function cc(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function uc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Rl=r,pc(r,e)}cc(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)dc(e),e=e.sibling}function dc(e){switch(e.tag){case 0:case 11:case 15:uc(e),2048&e.flags&&wl(9,e,e.return);break;case 3:case 12:default:uc(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,fc(e)):uc(e)}}function fc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];Rl=r,pc(r,e)}cc(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:wl(8,t,t.return),fc(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,fc(t));break;default:fc(t)}e=e.sibling}}function pc(e,t){for(;null!==Rl;){var n=Rl;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:$i(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,Rl=r;else e:for(n=e;null!==Rl;){var i=(r=Rl).sibling,a=r.return;if(Dl(r),r===n){Rl=null;break e}if(null!==i){i.return=a,Rl=i;break e}Rl=a}}}var hc={getCacheForType:function(e){var t=Ii(Ui),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ii(Ui).controller.signal}},mc="function"==typeof WeakMap?WeakMap:Map,gc=0,vc=null,yc=null,bc=0,wc=0,kc=null,Sc=!1,_c=!1,xc=!1,Ec=0,Cc=0,Tc=0,Mc=0,Pc=0,Ac=0,Oc=0,Nc=null,Lc=null,jc=!1,Ic=0,Rc=0,Fc=1/0,Dc=null,Bc=null,zc=0,Uc=null,Vc=null,$c=0,Wc=0,qc=null,Hc=null,Jc=0,Qc=null;function Gc(){return 2&gc&&0!==bc?bc&-bc:null!==j.T?qu():ze()}function Yc(){if(0===Ac)if(536870912&bc&&!hi)Ac=536870912;else{var e=Ce;!(3932160&(Ce<<=1))&&(Ce=262144),Ac=e}return null!==(e=Ia.current)&&(e.flags|=32),Ac}function Kc(e,t,n){(e!==vc||2!==wc&&9!==wc)&&null===e.cancelPendingCommit||(iu(e,0),tu(e,bc,Ac,!1)),je(e,n),2&gc&&e===vc||(e===vc&&(!(2&gc)&&(Mc|=n),4===Cc&&tu(e,bc,Ac,!1)),Du(e))}function Xc(e,t,n){if(6&gc)throw Error(r(327));for(var i=!n&&!(127&t)&&0===(t&e.expiredLanes)||Ae(e,t),a=i?function(e,t){var n=gc;gc|=2;var i=su(),a=lu();vc!==e||bc!==t?(Dc=null,Fc=ue()+500,iu(e,t)):_c=Ae(e,t);e:for(;;)try{if(0!==wc&&null!==yc){t=yc;var o=kc;t:switch(wc){case 1:wc=0,kc=null,mu(e,t,o,1);break;case 2:case 9:if(ia(o)){wc=0,kc=null,hu(t);break}t=function(){2!==wc&&9!==wc||vc!==e||(wc=7),Du(e)},o.then(t,t);break e;case 3:wc=7;break e;case 4:wc=5;break e;case 7:ia(o)?(wc=0,kc=null,hu(t)):(wc=0,kc=null,mu(e,t,o,7));break;case 5:var s=null;switch(yc.tag){case 26:s=yc.memoizedState;case 5:case 27:var l=yc;if(s?lf(s):l.stateNode.complete){wc=0,kc=null;var c=l.sibling;if(null!==c)yc=c;else{var u=l.return;null!==u?(yc=u,gu(u)):yc=null}break t}}wc=0,kc=null,mu(e,t,o,5);break;case 6:wc=0,kc=null,mu(e,t,o,6);break;case 8:ru(),Cc=6;break e;default:throw Error(r(462))}}fu();break}catch(d){au(e,d)}return Ti=Ci=null,j.H=i,j.A=a,gc=n,null!==yc?0:(vc=null,bc=0,Lr(),Cc)}(e,t):uu(e,t,!0),o=i;;){if(0===a){_c&&!i&&tu(e,t,0,!1);break}if(n=e.current.alternate,!o||eu(n)){if(2===a){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;a=Nc;var c=l.current.memoizedState.isDehydrated;if(c&&(iu(l,s).flags|=256),2!==(s=uu(l,s,!1))){if(xc&&!c){l.errorRecoveryDisabledLanes|=o,Mc|=o,a=4;break e}o=Lc,Lc=a,null!==o&&(null===Lc?Lc=o:Lc.push.apply(Lc,o))}a=s}if(o=!1,2!==a)continue}}if(1===a){iu(e,0),tu(e,t,0,!0);break}e:{switch(i=e,o=a){case 0:case 1:throw Error(r(345));case 4:if((4194048&t)!==t)break;case 6:tu(i,t,Ac,!Sc);break e;case 2:Lc=null;break;case 3:case 5:break;default:throw Error(r(329))}if((62914560&t)===t&&10<(a=Ic+300-ue())){if(tu(i,t,Ac,!Sc),0!==Pe(i,0,!0))break e;$c=t,i.timeoutHandle=xd(Zc.bind(null,i,n,Lc,Dc,jc,t,Ac,Mc,Oc,Sc,o,"Throttled",-0,0),a)}else Zc(i,n,Lc,Dc,jc,t,Ac,Mc,Oc,Sc,o,null,-0,0)}break}a=uu(e,t,!1),o=!1}Du(e)}function Zc(e,t,n,r,i,a,o,s,l,c,u,d,f,p){if(e.timeoutHandle=-1,8192&(d=t.subtreeFlags)||!(16785408&~d)){lc(t,a,d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jt});var h=(62914560&a)===a?Ic-ue():(4194048&a)===a?Rc-ue():0;if(null!==(h=function(e,t){return e.stylesheets&&0===e.count&&ff(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ff(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&0===cf&&(cf=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&gd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>s)break;var u=l.transferSize,d=l.initiatorType;u&&gd(d)&&(o+=u*((l=l.responseEnd)<s?1:(s-c)/(l-c)))}if(--r,t+=8*(a+o)/(i.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var i=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&ff(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>cf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}(d,h)))return $c=a,e.cancelPendingCommit=h(yu.bind(null,e,t,a,n,r,i,o,s,l,u,d,null,f,p)),void tu(e,a,o,!c)}yu(e,t,a,n,r,i,o,s,l)}function eu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!er(a(),i))return!1}catch(o){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function tu(e,t,n,r){t&=~Pc,t&=~Mc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Se(i),o=1<<a;r[a]=-1,i&=~o}0!==n&&Ie(e,n,t)}function nu(){return!!(6&gc)||(Bu(0),!1)}function ru(){if(null!==yc){if(0===wc)var e=yc.return;else Ti=Ci=null,co(e=yc),ua=null,da=0,e=yc;for(;null!==e;)yl(e.alternate,e),e=e.return;yc=null}}function iu(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,Ed(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),$c=0,ru(),vc=e,yc=n=$r(e.current,null),bc=t,wc=0,kc=null,Sc=!1,_c=Ae(e,t),xc=!1,Oc=Ac=Pc=Mc=Tc=Cc=0,Lc=Nc=null,jc=!1,8&t&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var i=31-Se(r),a=1<<i;t|=e[i],r&=~a}return Ec=t,Lr(),n}function au(e,t){qa=null,j.H=ys,t===ea||t===na?(t=la(),wc=3):t===ta?(t=la(),wc=4):wc=t===Is?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,kc=t,null===yc&&(Cc=1,As(e,Kr(t,e.current)))}function ou(){var e=Ia.current;return null===e||((4194048&bc)===bc?null===Ra:!!((62914560&bc)===bc||536870912&bc)&&e===Ra)}function su(){var e=j.H;return j.H=ys,null===e?ys:e}function lu(){var e=j.A;return j.A=hc,e}function cu(){Cc=4,Sc||(4194048&bc)!==bc&&null!==Ia.current||(_c=!0),!(134217727&Tc)&&!(134217727&Mc)||null===vc||tu(vc,bc,Ac,!1)}function uu(e,t,n){var r=gc;gc|=2;var i=su(),a=lu();vc===e&&bc===t||(Dc=null,iu(e,t)),t=!1;var o=Cc;e:for(;;)try{if(0!==wc&&null!==yc){var s=yc,l=kc;switch(wc){case 8:ru(),o=6;break e;case 3:case 2:case 9:case 6:null===Ia.current&&(t=!0);var c=wc;if(wc=0,kc=null,mu(e,s,l,c),n&&_c){o=0;break e}break;default:c=wc,wc=0,kc=null,mu(e,s,l,c)}}du(),o=Cc;break}catch(u){au(e,u)}return t&&e.shellSuspendCounter++,Ti=Ci=null,gc=r,j.H=i,j.A=a,null===yc&&(vc=null,bc=0,Lr()),o}function du(){for(;null!==yc;)pu(yc)}function fu(){for(;null!==yc&&!le();)pu(yc)}function pu(e){var t=cl(e.alternate,e,Ec);e.memoizedProps=e.pendingProps,null===t?gu(e):yc=t}function hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qs(n,t,t.pendingProps,t.type,void 0,bc);break;case 11:t=Qs(n,t,t.pendingProps,t.type.render,t.ref,bc);break;case 5:co(t);default:yl(n,t),t=cl(n,t=yc=Wr(t,Ec),Ec)}e.memoizedProps=e.pendingProps,null===t?gu(e):yc=t}function mu(e,t,n,i){Ti=Ci=null,co(t),ua=null,da=0;var a=t.return;try{if(function(e,t,n,i,a){if(n.flags|=32768,null!==i&&"object"==typeof i&&"function"==typeof i.then){if(null!==(t=n.alternate)&&Ni(t,n,a,!0),null!==(n=Ia.current)){switch(n.tag){case 31:case 13:return null===Ra?cu():null===n.alternate&&0===Cc&&(Cc=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===ra?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([i]):t.add(i),Tu(e,i,a)),!1;case 22:return n.flags|=65536,i===ra?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([i]):n.add(i),Tu(e,i,a)),!1}throw Error(r(435,n.tag))}return Tu(e,i,a),cu(),!1}if(hi)return null!==(t=Ia.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==vi&&xi(Kr(e=Error(r(422),{cause:i}),n))):(i!==vi&&xi(Kr(t=Error(r(423),{cause:i}),n)),(e=e.current.alternate).flags|=65536,a&=-a,e.lanes|=a,i=Kr(i,n),xa(e,a=Ns(e.stateNode,i,a)),4!==Cc&&(Cc=2)),!1;var o=Error(r(520),{cause:i});if(o=Kr(o,n),null===Nc?Nc=[o]:Nc.push(o),4!==Cc&&(Cc=2),null===t)return!0;i=Kr(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,xa(n,e=Ns(n.stateNode,i,e)),!1;case 1:if(t=n.type,o=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===o||"function"!=typeof o.componentDidCatch||null!==Bc&&Bc.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,js(a=Ls(a),e,n,i),xa(n,a),!1}n=n.return}while(null!==n);return!1}(e,a,t,n,bc))return Cc=1,As(e,Kr(n,e.current)),void(yc=null)}catch(o){if(null!==a)throw yc=a,o;return Cc=1,As(e,Kr(n,e.current)),void(yc=null)}32768&t.flags?(hi||1===i?e=!0:_c||536870912&bc?e=!1:(Sc=e=!0,(2===i||9===i||3===i||6===i)&&(null!==(i=Ia.current)&&13===i.tag&&(i.flags|=16384))),vu(t,e)):gu(t)}function gu(e){var t=e;do{if(32768&t.flags)return void vu(t,Sc);e=t.return;var n=gl(t.alternate,t,Ec);if(null!==n)return void(yc=n);if(null!==(t=t.sibling))return void(yc=t);yc=t=e}while(null!==t);0===Cc&&(Cc=5)}function vu(e,t){do{var n=vl(e.alternate,e);if(null!==n)return n.flags&=32767,void(yc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(yc=e);yc=e=n}while(null!==e);Cc=6,yc=null}function yu(e,t,n,i,a,o,s,l,c){e.cancelPendingCommit=null;do{_u()}while(0!==zc);if(6&gc)throw Error(r(327));if(null!==t){if(t===e.current)throw Error(r(177));if(o=t.lanes|t.childLanes,function(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Se(n),d=1<<u;s[u]=0,l[u]=-1;var f=c[u];if(null!==f)for(c[u]=null,u=0;u<f.length;u++){var p=f[u];null!==p&&(p.lane&=-536870913)}n&=~d}0!==r&&Ie(e,r,0),0!==a&&0===i&&0!==e.tag&&(e.suspendedLanes|=a&~(o&~t))}(e,n,o|=Nr,s,l,c),e===vc&&(yc=vc=null,bc=0),Vc=t,Uc=e,$c=n,Wc=o,qc=a,Hc=i,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,oe(he,function(){return xu(),null})):(e.callbackNode=null,e.callbackPriority=0),i=!!(13878&t.flags),13878&t.subtreeFlags||i){i=j.T,j.T=null,a=R.p,R.p=2,s=gc,gc|=4;try{!function(e,t){if(e=e.containerInfo,vd=_f,or(e=ar(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(i&&0!==i.rangeCount){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch(g){n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||0!==a&&3!==f.nodeType||(l=s+a),f!==o||0!==i&&3!==f.nodeType||(c=s+i),3===f.nodeType&&(s+=f.nodeValue.length),null!==(h=f.firstChild);)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===a&&(l=s),p===o&&++d===i&&(c=s),null!==(h=f.nextSibling))break;p=(f=p).parentNode}f=h}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(yd={focusedElem:e,selectionRange:n},_f=!1,Rl=t;null!==Rl;)if(e=(t=Rl).child,1028&t.subtreeFlags&&null!==e)e.return=t,Rl=e;else for(;null!==Rl;){switch(o=(t=Rl).alternate,e=t.flags,t.tag){case 0:if(4&e&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(a=e[n]).ref.impl=a.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==o){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,i=n.stateNode;try{var m=Cs(n.type,a);e=i.getSnapshotBeforeUpdate(m,o),i.__reactInternalSnapshotBeforeUpdate=e}catch(v){Cu(n,n.return,v)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))Nd(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nd(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(r(163))}if(null!==(e=t.sibling)){e.return=t.return,Rl=e;break}Rl=t.return}}(e,t)}finally{gc=s,R.p=a,j.T=i}}zc=1,bu(),wu(),ku()}}function bu(){if(1===zc){zc=0;var e=Uc,t=Vc,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=j.T,j.T=null;var r=R.p;R.p=2;var i=gc;gc|=4;try{Ql(t,e);var a=yd,o=ar(e.containerInfo),s=a.focusedElem,l=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&ir(s.ownerDocument.documentElement,s)){if(null!==l&&or(s)){var c=l.start,u=l.end;if(void 0===u&&(u=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),h=s.textContent.length,m=Math.min(l.start,h),g=void 0===l.end?m:Math.min(l.end,h);!p.extend&&m>g&&(o=g,g=m,m=o);var v=rr(s,m),y=rr(s,g);if(v&&y&&(1!==p.rangeCount||p.anchorNode!==v.node||p.anchorOffset!==v.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var b=d.createRange();b.setStart(v.node,v.offset),p.removeAllRanges(),m>g?(p.addRange(b),p.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),p.addRange(b))}}}}for(d=[],p=s;p=p.parentNode;)1===p.nodeType&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<d.length;s++){var w=d[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}_f=!!vd,yd=vd=null}finally{gc=i,R.p=r,j.T=n}}e.current=t,zc=2}}function wu(){if(2===zc){zc=0;var e=Uc,t=Vc,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=j.T,j.T=null;var r=R.p;R.p=2;var i=gc;gc|=4;try{Fl(e,t.alternate,t)}finally{gc=i,R.p=r,j.T=n}}zc=3}}function ku(){if(4===zc||3===zc){zc=0,ce();var e=Uc,t=Vc,n=$c,r=Hc;10256&t.subtreeFlags||10256&t.flags?zc=5:(zc=0,Vc=Uc=null,Su(e,e.pendingLanes));var i=e.pendingLanes;if(0===i&&(Bc=null),Be(n),t=t.stateNode,we&&"function"==typeof we.onCommitFiberRoot)try{we.onCommitFiberRoot(be,t,void 0,!(128&~t.current.flags))}catch(l){}if(null!==r){t=j.T,i=R.p,R.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,R.p=i}}3&$c&&_u(),Du(e),i=e.pendingLanes,261930&n&&42&i?e===Qc?Jc++:(Jc=0,Qc=e):Jc=0,Bu(0)}}function Su(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,$i(t)))}function _u(){return bu(),wu(),ku(),xu()}function xu(){if(5!==zc)return!1;var e=Uc,t=Wc;Wc=0;var n=Be($c),i=j.T,a=R.p;try{R.p=32>n?32:n,j.T=null,n=qc,qc=null;var o=Uc,s=$c;if(zc=0,Vc=Uc=null,$c=0,6&gc)throw Error(r(331));var l=gc;if(gc|=4,dc(o.current),rc(o,o.current,s,n),gc=l,Bu(0,!1),we&&"function"==typeof we.onPostCommitFiberRoot)try{we.onPostCommitFiberRoot(be,o)}catch(c){}return!0}finally{R.p=a,j.T=i,Su(e,t)}}function Eu(e,t,n){t=Kr(n,t),null!==(e=Sa(e,t=Ns(e.stateNode,t,2),2))&&(je(e,2),Du(e))}function Cu(e,t,n){if(3===e.tag)Eu(e,e,n);else for(;null!==t;){if(3===t.tag){Eu(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Bc||!Bc.has(r))){e=Kr(n,e),null!==(r=Sa(t,n=Ls(2),2))&&(js(n,r,t,e),je(r,2),Du(r));break}}t=t.return}}function Tu(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new mc;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(xc=!0,i.add(n),e=Mu.bind(null,e,t,n),t.then(e,e))}function Mu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,vc===e&&(bc&n)===n&&(4===Cc||3===Cc&&(62914560&bc)===bc&&300>ue()-Ic?!(2&gc)&&iu(e,0):Pc|=n,Oc===bc&&(Oc=0)),Du(e)}function Pu(e,t){0===t&&(t=Ne()),null!==(e=Rr(e,t))&&(je(e,t),Du(e))}function Au(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Pu(e,n)}function Ou(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}null!==i&&i.delete(t),Pu(e,n)}var Nu=null,Lu=null,ju=!1,Iu=!1,Ru=!1,Fu=0;function Du(e){e!==Lu&&null===e.next&&(null===Lu?Nu=Lu=e:Lu=Lu.next=e),Iu=!0,ju||(ju=!0,Td(function(){6&gc?oe(fe,zu):Uu()}))}function Bu(e,t){if(!Ru&&Iu){Ru=!0;do{for(var n=!1,r=Nu;null!==r;){if(0!==e){var i=r.pendingLanes;if(0===i)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Se(42|e)+1)-1,a=201326741&(a&=i&~(o&~s))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,Wu(r,a))}else a=bc,!(3&(a=Pe(r,r===vc?a:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||Ae(r,a)||(n=!0,Wu(r,a));r=r.next}}while(n);Ru=!1}}function zu(){Uu()}function Uu(){Iu=ju=!1;var e=0;0!==Fu&&function(){var e=window.event;if(e&&"popstate"===e.type)return e!==_d&&(_d=e,!0);return _d=null,!1}()&&(e=Fu);for(var t=ue(),n=null,r=Nu;null!==r;){var i=r.next,a=Vu(r,t);0===a?(r.next=null,null===n?Nu=i:n.next=i,null===i&&(Lu=n)):(n=r,(0!==e||3&a)&&(Iu=!0)),r=i}0!==zc&&5!==zc||Bu(e),0!==Fu&&(Fu=0)}function Vu(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var o=31-Se(a),s=1<<o,l=i[o];-1===l?0!==(s&n)&&0===(s&r)||(i[o]=Oe(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}if(n=bc,n=Pe(e,e===(t=vc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===wc||9===wc)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&se(r),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||Ae(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&se(r),Be(n)){case 2:case 8:n=pe;break;case 32:default:n=he;break;case 268435456:n=ge}return r=$u.bind(null,e),n=oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&se(r),e.callbackPriority=2,e.callbackNode=null,2}function $u(e,t){if(0!==zc&&5!==zc)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_u()&&e.callbackNode!==n)return null;var r=bc;return 0===(r=Pe(e,e===vc?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Xc(e,r,t),Vu(e,ue()),null!=e.callbackNode&&e.callbackNode===n?$u.bind(null,e):null)}function Wu(e,t){if(_u())return null;Xc(e,t,!0)}function qu(){if(0===Fu){var e=Hi;0===e&&(e=Ee,!(261888&(Ee<<=1))&&(Ee=256)),Fu=e}return Fu}function Hu(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Lt(""+e)}function Ju(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Qu=0;Qu<Tr.length;Qu++){var Gu=Tr[Qu];Mr(Gu.toLowerCase(),"on"+(Gu[0].toUpperCase()+Gu.slice(1)))}Mr(br,"onAnimationEnd"),Mr(wr,"onAnimationIteration"),Mr(kr,"onAnimationStart"),Mr("dblclick","onDoubleClick"),Mr("focusin","onFocus"),Mr("focusout","onBlur"),Mr(Sr,"onTransitionRun"),Mr(_r,"onTransitionStart"),Mr(xr,"onTransitionCancel"),Mr(Er,"onTransitionEnd"),ot("onMouseEnter",["mouseout","mouseover"]),ot("onMouseLeave",["mouseout","mouseover"]),ot("onPointerEnter",["pointerout","pointerover"]),ot("onPointerLeave",["pointerout","pointerover"]),at("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),at("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),at("onBeforeInput",["compositionend","keypress","textInput","paste"]),at("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ku=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yu));function Xu(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(u){Pr(u)}i.currentTarget=null,a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(u){Pr(u)}i.currentTarget=null,a=l}}}}function Zu(e,t){var n=t[He];void 0===n&&(n=t[He]=new Set);var r=e+"__bubble";n.has(r)||(rd(t,e,2,!1),n.add(r))}function ed(e,t,n){var r=0;t&&(r|=4),rd(n,e,r,t)}var td="_reactListening"+Math.random().toString(36).slice(2);function nd(e){if(!e[td]){e[td]=!0,rt.forEach(function(t){"selectionchange"!==t&&(Ku.has(t)||ed(t,!1,e),ed(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[td]||(t[td]=!0,ed("selectionchange",!1,t))}}function rd(e,t,n,r){switch(Af(t)){case 2:var i=xf;break;case 8:i=Ef;break;default:i=Cf}n=i.bind(null,t,n,e),i=void 0,!Wt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function id(e,t,n,r,i){var o=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var s=r.tag;if(3===s||4===s){var l=r.stateNode.containerInfo;if(l===i)break;if(4===s)for(s=r.return;null!==s;){var c=s.tag;if((3===c||4===c)&&s.stateNode.containerInfo===i)return;s=s.return}for(;null!==l;){if(null===(s=Xe(l)))return;if(5===(c=s.tag)||6===c||26===c||27===c){r=o=s;continue e}l=l.parentNode}}r=r.return}Ut(function(){var r=o,i=Rt(n),s=[];e:{var l=Cr.get(e);if(void 0!==l){var c=an,u=e;switch(e){case"keypress":if(0===Yt(n))break e;case"keydown":case"keyup":c=wn;break;case"focusin":u="focus",c=dn;break;case"focusout":u="blur",c=dn;break;case"beforeblur":case"afterblur":c=dn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=cn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=un;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=Sn;break;case br:case wr:case kr:c=fn;break;case Er:c=_n;break;case"scroll":case"scrollend":c=sn;break;case"wheel":c=xn;break;case"copy":case"cut":case"paste":c=pn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=kn;break;case"toggle":case"beforetoggle":c=En}var d=!!(4&t),f=!d&&("scroll"===e||"scrollend"===e),p=d?null!==l?l+"Capture":null:l;d=[];for(var h,m=r;null!==m;){var g=m;if(h=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===h||null===p||null!=(g=Vt(m,p))&&d.push(ad(m,g,h)),f)break;m=m.return}0<d.length&&(l=new c(l,u,null,n,i),s.push({event:l,listeners:d}))}}if(!(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===It||!(u=n.relatedTarget||n.fromElement)||!Xe(u)&&!u[qe])&&(c||l)&&(l=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?Xe(u):null)&&(f=a(u),d=u.tag,u!==f||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=r),c!==u)){if(d=cn,g="onMouseLeave",p="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(d=kn,g="onPointerLeave",p="onPointerEnter",m="pointer"),f=null==c?l:et(c),h=null==u?l:et(u),(l=new d(g,m+"leave",c,n,i)).target=f,l.relatedTarget=h,g=null,Xe(i)===r&&((d=new d(p,m+"enter",u,n,i)).target=h,d.relatedTarget=f,g=d),f=g,c&&u)e:{for(d=sd,m=u,h=0,g=p=c;g;g=d(g))h++;g=0;for(var v=m;v;v=d(v))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||null!==m&&p===m.alternate){d=p;break e}p=d(p),m=d(m)}d=null}else d=null;null!==c&&ld(s,l,c,d,!1),null!==u&&null!==f&&ld(s,f,u,d,!0)}if("select"===(c=(l=r?et(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var y=$n;else if(Fn(l))if(Wn)y=Zn;else{y=Kn;var b=Yn}else!(c=l.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?r&&At(r.elementType)&&(y=$n):y=Xn;switch(y&&(y=y(e,r))?Dn(s,y,n,i):(b&&b(e,l,r),"focusout"===e&&r&&"number"===l.type&&null!=r.memoizedProps.value&&St(l,"number",l.value)),b=r?et(r):window,e){case"focusin":(Fn(b)||"true"===b.contentEditable)&&(cr=b,ur=r,dr=null);break;case"focusout":dr=ur=cr=null;break;case"mousedown":fr=!0;break;case"contextmenu":case"mouseup":case"dragend":fr=!1,pr(s,n,i);break;case"selectionchange":if(sr)break;case"keydown":case"keyup":pr(s,n,i)}var w;if(Tn)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else In?Ln(e,n)&&(k="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(k="onCompositionStart");k&&(An&&"ko"!==n.locale&&(In||"onCompositionStart"!==k?"onCompositionEnd"===k&&In&&(w=Gt()):(Jt="value"in(Ht=i)?Ht.value:Ht.textContent,In=!0)),0<(b=od(r,k)).length&&(k=new hn(k,e,null,n,i),s.push({event:k,listeners:b}),w?k.data=w:null!==(w=jn(n))&&(k.data=w))),(w=Pn?function(e,t){switch(e){case"compositionend":return jn(t);case"keypress":return 32!==t.which?null:(Nn=!0,On);case"textInput":return(e=t.data)===On&&Nn?null:e;default:return null}}(e,n):function(e,t){if(In)return"compositionend"===e||!Tn&&Ln(e,t)?(e=Gt(),Qt=Jt=Ht=null,In=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return An&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(k=od(r,"onBeforeInput")).length&&(b=new hn("onBeforeInput","beforeinput",null,n,i),s.push({event:b,listeners:k}),b.data=w)),function(e,t,n,r,i){if("submit"===t&&n&&n.stateNode===i){var a=Hu((i[We]||null).action),o=r.submitter;o&&null!==(t=(t=o[We]||null)?Hu(t.formAction):o.getAttribute("formAction"))&&(a=t,o=null);var s=new an("action","action",null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==Fu){var e=o?Ju(i,o):new FormData(i);is(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else"function"==typeof a&&(s.preventDefault(),e=o?Ju(i,o):new FormData(i),is(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}(s,e,r,n,i)}Xu(s,t)})}function ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function od(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;if(5!==(i=i.tag)&&26!==i&&27!==i||null===a||(null!=(i=Vt(e,n))&&r.unshift(ad(e,i,a)),null!=(i=Vt(e,t))&&r.push(ad(e,i,a))),3===e.tag)return r;e=e.return}return[]}function sd(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function ld(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===r)break;5!==s&&26!==s&&27!==s||null===c||(l=c,i?null!=(c=Vt(n,a))&&o.unshift(ad(n,c,l)):i||null!=(c=Vt(n,a))&&o.push(ad(n,c,l))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var cd=/\r\n?/g,ud=/\u0000|\uFFFD/g;function dd(e){return("string"==typeof e?e:""+e).replace(cd,"\n").replace(ud,"")}function fd(e,t){return t=dd(t),dd(e)===t}function pd(e,t,n,i,a,o){switch(n){case"children":"string"==typeof i?"body"===t||"textarea"===t&&""===i||Ct(e,i):("number"==typeof i||"bigint"==typeof i)&&"body"!==t&&Ct(e,""+i);break;case"className":dt(e,"class",i);break;case"tabIndex":dt(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":dt(e,n,i);break;case"style":Pt(e,i,o);break;case"data":if("object"!==t){dt(e,"data",i);break}case"src":case"href":if(""===i&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==i||"function"==typeof i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Lt(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if("function"==typeof i){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof o&&("formAction"===n?("input"!==t&&pd(e,t,"name",a.name,a,null),pd(e,t,"formEncType",a.formEncType,a,null),pd(e,t,"formMethod",a.formMethod,a,null),pd(e,t,"formTarget",a.formTarget,a,null)):(pd(e,t,"encType",a.encType,a,null),pd(e,t,"method",a.method,a,null),pd(e,t,"target",a.target,a,null))),null==i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Lt(""+i),e.setAttribute(n,i);break;case"onClick":null!=i&&(e.onclick=jt);break;case"onScroll":null!=i&&Zu("scroll",e);break;case"onScrollEnd":null!=i&&Zu("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(r(61));if(null!=(n=i.__html)){if(null!=a.children)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"muted":e.muted=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==i||"function"==typeof i||"boolean"==typeof i||"symbol"==typeof i){e.removeAttribute("xlink:href");break}n=Lt(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===i?e.setAttribute(n,""):!1!==i&&null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":null==i||"function"==typeof i||"symbol"==typeof i||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":Zu("beforetoggle",e),Zu("toggle",e),ut(e,"popover",i);break;case"xlinkActuate":ft(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ft(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ft(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ft(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ft(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ft(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ft(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ft(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ft(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ut(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&ut(e,n=Ot.get(n)||n,i)}}function hd(e,t,n,i,a,o){switch(n){case"style":Pt(e,i,o);break;case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(r(61));if(null!=(n=i.__html)){if(null!=a.children)throw Error(r(60));e.innerHTML=n}}break;case"children":"string"==typeof i?Ct(e,i):("number"==typeof i||"bigint"==typeof i)&&Ct(e,""+i);break;case"onScroll":null!=i&&Zu("scroll",e);break;case"onScrollEnd":null!=i&&Zu("scrollend",e);break;case"onClick":null!=i&&(e.onclick=jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:it.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),"function"==typeof(o=null!=(o=e[We]||null)?o[n]:null)&&e.removeEventListener(t,o,a),"function"!=typeof i)?n in e?e[n]=i:!0===i?e.setAttribute(n,""):ut(e,n,i):("function"!=typeof o&&null!==o&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,a)))}}function md(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Zu("error",e),Zu("load",e);var i,a=!1,o=!1;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(null!=s)switch(i){case"src":a=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:pd(e,t,i,s,n,null)}}return o&&pd(e,t,"srcSet",n.srcSet,n,null),void(a&&pd(e,t,"src",n.src,n,null));case"input":Zu("invalid",e);var l=i=s=o=null,c=null,u=null;for(a in n)if(n.hasOwnProperty(a)){var d=n[a];if(null!=d)switch(a){case"name":o=d;break;case"type":s=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":i=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(r(137,t));break;default:pd(e,t,a,d,n,null)}}return void kt(e,i,l,c,u,s,o,!1);case"select":for(o in Zu("invalid",e),a=s=i=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":i=l;break;case"defaultValue":s=l;break;case"multiple":a=l;default:pd(e,t,o,l,n,null)}return t=i,n=s,e.multiple=!!a,void(null!=t?_t(e,!!a,t,!1):null!=n&&_t(e,!!a,n,!0));case"textarea":for(s in Zu("invalid",e),i=o=a=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":a=l;break;case"defaultValue":o=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(r(91));break;default:pd(e,t,s,l,n,null)}return void Et(e,a,o,i);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(a=n[c]))if("selected"===c)e.selected=a&&"function"!=typeof a&&"symbol"!=typeof a;else pd(e,t,c,a,n,null);return;case"dialog":Zu("beforetoggle",e),Zu("toggle",e),Zu("cancel",e),Zu("close",e);break;case"iframe":case"object":Zu("load",e);break;case"video":case"audio":for(a=0;a<Yu.length;a++)Zu(Yu[a],e);break;case"image":Zu("error",e),Zu("load",e);break;case"details":Zu("toggle",e);break;case"embed":case"source":case"link":Zu("error",e),Zu("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(a=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:pd(e,t,u,a,n,null)}return;default:if(At(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(a=n[d])&&hd(e,t,d,a,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(a=n[l])&&pd(e,t,l,a,n,null))}function gd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var vd=null,yd=null;function bd(e){return 9===e.nodeType?e:e.ownerDocument}function wd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function kd(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function Sd(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var _d=null;var xd="function"==typeof setTimeout?setTimeout:void 0,Ed="function"==typeof clearTimeout?clearTimeout:void 0,Cd="function"==typeof Promise?Promise:void 0,Td="function"==typeof queueMicrotask?queueMicrotask:void 0!==Cd?function(e){return Cd.resolve(null).then(e).catch(Md)}:xd;function Md(e){setTimeout(function(){throw e})}function Pd(e){return"head"===e}function Ad(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)||"/&"===n){if(0===r)return e.removeChild(i),void Qf(t);r--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)r++;else if("html"===n)Ud(e.ownerDocument.documentElement);else if("head"===n){Ud(n=e.ownerDocument.head);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ye]||"SCRIPT"===s||"STYLE"===s||"LINK"===s&&"stylesheet"===a.rel.toLowerCase()||n.removeChild(a),a=o}}else"body"===n&&Ud(e.ownerDocument.body);n=i}while(n);Qf(t)}function Od(e,t){var n=e;e=0;do{var r=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=r}while(n)}function Nd(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Nd(n),Ke(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Ld(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Rd(e.nextSibling)))return null}return e}function jd(e){return"$?"===e.data||"$~"===e.data}function Id(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Rd(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var Fd=null;function Dd(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return Rd(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Bd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function zd(e,t,n){switch(t=bd(n),e){case"html":if(!(e=t.documentElement))throw Error(r(452));return e;case"head":if(!(e=t.head))throw Error(r(453));return e;case"body":if(!(e=t.body))throw Error(r(454));return e;default:throw Error(r(451))}}function Ud(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ke(e)}var Vd=new Map,$d=new Set;function Wd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var qd=R.d;R.d={f:function(){var e=qd.f(),t=nu();return e||t},r:function(e){var t=Ze(e);null!==t&&5===t.tag&&"form"===t.type?os(t):qd.r(e)},D:function(e){qd.D(e),Jd("dns-prefetch",e,null)},C:function(e,t){qd.C(e,t),Jd("preconnect",e,t)},L:function(e,t,n){qd.L(e,t,n);var r=Hd;if(r&&e&&t){var i='link[rel="preload"][as="'+bt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(i+='[imagesrcset="'+bt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(i+='[imagesizes="'+bt(n.imageSizes)+'"]')):i+='[href="'+bt(e)+'"]';var a=i;switch(t){case"style":a=Gd(e);break;case"script":a=Xd(e)}Vd.has(a)||(e=u({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Vd.set(a,e),null!==r.querySelector(i)||"style"===t&&r.querySelector(Yd(a))||"script"===t&&r.querySelector(Zd(a))||(md(t=r.createElement("link"),"link",e),nt(t),r.head.appendChild(t)))}},m:function(e,t){qd.m(e,t);var n=Hd;if(n&&e){var r=t&&"string"==typeof t.as?t.as:"script",i='link[rel="modulepreload"][as="'+bt(r)+'"][href="'+bt(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Xd(e)}if(!Vd.has(a)&&(e=u({rel:"modulepreload",href:e},t),Vd.set(a,e),null===n.querySelector(i))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Zd(a)))return}md(r=n.createElement("link"),"link",e),nt(r),n.head.appendChild(r)}}},X:function(e,t){qd.X(e,t);var n=Hd;if(n&&e){var r=tt(n).hoistableScripts,i=Xd(e),a=r.get(i);a||((a=n.querySelector(Zd(i)))||(e=u({src:e,async:!0},t),(t=Vd.get(i))&&rf(e,t),nt(a=n.createElement("script")),md(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}},S:function(e,t,n){qd.S(e,t,n);var r=Hd;if(r&&e){var i=tt(r).hoistableStyles,a=Gd(e);t=t||"default";var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Yd(a)))s.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Vd.get(a))&&nf(e,n);var l=o=r.createElement("link");nt(l),md(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,tf(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:s},i.set(a,o)}}},M:function(e,t){qd.M(e,t);var n=Hd;if(n&&e){var r=tt(n).hoistableScripts,i=Xd(e),a=r.get(i);a||((a=n.querySelector(Zd(i)))||(e=u({src:e,async:!0,type:"module"},t),(t=Vd.get(i))&&rf(e,t),nt(a=n.createElement("script")),md(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}};var Hd="undefined"==typeof document?null:document;function Jd(e,t,n){var r=Hd;if(r&&"string"==typeof t&&t){var i=bt(t);i='link[rel="'+e+'"][href="'+i+'"]',"string"==typeof n&&(i+='[crossorigin="'+n+'"]'),$d.has(i)||($d.add(i),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(i)&&(md(t=r.createElement("link"),"link",e),nt(t),r.head.appendChild(t)))}}function Qd(e,t,n,i){var a,o,s,l,c=(c=Q.current)?Wd(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Gd(n.href),(i=(n=tt(c).hoistableStyles).get(t))||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Gd(n.href);var u=tt(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(Yd(e)))&&!u._p&&(d.instance=u,d.state.loading=5),Vd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Vd.set(e,n),u||(a=c,o=e,s=n,l=d.state,a.querySelector('link[rel="preload"][as="style"]['+o+"]")?l.loading=1:(o=a.createElement("link"),l.preload=o,o.addEventListener("load",function(){return l.loading|=1}),o.addEventListener("error",function(){return l.loading|=2}),md(o,"link",s),nt(o),a.head.appendChild(o))))),t&&null===i)throw Error(r(528,""));return d}if(t&&null!==i)throw Error(r(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=Xd(n),(i=(n=tt(c).hoistableScripts).get(t))||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Gd(e){return'href="'+bt(e)+'"'}function Yd(e){return'link[rel="stylesheet"]['+e+"]"}function Kd(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function Xd(e){return'[src="'+bt(e)+'"]'}function Zd(e){return"script[async]"+e}function ef(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+bt(n.href)+'"]');if(i)return t.instance=i,nt(i),i;var a=u({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return nt(i=(e.ownerDocument||e).createElement("style")),md(i,"style",a),tf(i,n.precedence,e),t.instance=i;case"stylesheet":a=Gd(n.href);var o=e.querySelector(Yd(a));if(o)return t.state.loading|=4,t.instance=o,nt(o),o;i=Kd(n),(a=Vd.get(a))&&nf(i,a),nt(o=(e.ownerDocument||e).createElement("link"));var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),md(o,"link",i),t.state.loading|=4,tf(o,n.precedence,e),t.instance=o;case"script":return o=Xd(n.src),(a=e.querySelector(Zd(o)))?(t.instance=a,nt(a),a):(i=n,(a=Vd.get(o))&&rf(i=u({},n),a),nt(a=(e=e.ownerDocument||e).createElement("script")),md(a,"link",i),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(r(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(i=t.instance,t.state.loading|=4,tf(i,n.precedence,e));return t.instance}function tf(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function nf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function rf(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var af=null;function of(e,t,n){if(null===af){var r=new Map,i=af=new Map;i.set(n,r)}else(r=(i=af).get(n))||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ye]||a[$e]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(t)||"";o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function sf(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function lf(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var cf=0;function uf(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ff(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var df=null;function ff(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,df=new Map,t.forEach(pf,e),df=null,uf.call(e))}function pf(e,t){if(!(4&t.state.loading)){var n=df.get(e);if(n)var r=n.get(null);else{n=new Map,df.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}o=(i=t.instance).getAttribute("data-precedence"),(a=n.get(o)||r)===r&&n.set(null,i),n.set(o,i),this.count++,r=uf.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(i,e.firstChild),t.state.loading|=4}}var hf={$$typeof:y,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function mf(e,t,n,r,i,a,o,s,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Le(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Le(0),this.hiddenUpdates=Le(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function gf(e,t,n,r,i,a,o,s,l,c,u,d){return e=new mf(e,t,n,o,l,c,u,d,s),t=1,!0===a&&(t|=24),a=Ur(3,null,null,t),e.current=a,a.stateNode=e,(t=Vi()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ba(a),e}function vf(e){return e?e=Br:Br}function yf(e,t,n,r,i,a){i=vf(i),null===r.context?r.context=i:r.pendingContext=i,(r=ka(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=Sa(e,r,t))&&(Kc(n,0,t),_a(n,e,t))}function bf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function wf(e,t){bf(e,t),(e=e.alternate)&&bf(e,t)}function kf(e){if(13===e.tag||31===e.tag){var t=Rr(e,67108864);null!==t&&Kc(t,0,67108864),wf(e,67108864)}}function Sf(e){if(13===e.tag||31===e.tag){var t=Gc(),n=Rr(e,t=De(t));null!==n&&Kc(n,0,t),wf(e,t)}}var _f=!0;function xf(e,t,n,r){var i=j.T;j.T=null;var a=R.p;try{R.p=2,Cf(e,t,n,r)}finally{R.p=a,j.T=i}}function Ef(e,t,n,r){var i=j.T;j.T=null;var a=R.p;try{R.p=8,Cf(e,t,n,r)}finally{R.p=a,j.T=i}}function Cf(e,t,n,r){if(_f){var i=Tf(r);if(null===i)id(e,t,r,Mf,n),Bf(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Nf=zf(Nf,e,t,n,r,i),!0;case"dragenter":return Lf=zf(Lf,e,t,n,r,i),!0;case"mouseover":return jf=zf(jf,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return If.set(a,zf(If.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Rf.set(a,zf(Rf.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Bf(e,r),4&t&&-1<Df.indexOf(e)){for(;null!==i;){var a=Ze(i);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=Me(a.pendingLanes);if(0!==o){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-Se(o);s.entanglements[1]|=l,o&=~l}Du(a),!(6&gc)&&(Fc=ue()+500,Bu(0))}}break;case 31:case 13:null!==(s=Rr(a,2))&&Kc(s,0,2),nu(),wf(a,2)}if(null===(a=Tf(r))&&id(e,t,r,Mf,n),a===i)break;i=a}null!==i&&r.stopPropagation()}else id(e,t,r,null,n)}}function Tf(e){return Pf(e=Rt(e))}var Mf=null;function Pf(e){if(Mf=null,null!==(e=Xe(e))){var t=a(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=o(t)))return e;e=null}else if(31===n){if(null!==(e=s(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Mf=e,null}function Af(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(de()){case fe:return 2;case pe:return 8;case he:case me:return 32;case ge:return 268435456;default:return 32}default:return 32}}var Of=!1,Nf=null,Lf=null,jf=null,If=new Map,Rf=new Map,Ff=[],Df="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Bf(e,t){switch(e){case"focusin":case"focusout":Nf=null;break;case"dragenter":case"dragleave":Lf=null;break;case"mouseover":case"mouseout":jf=null;break;case"pointerover":case"pointerout":If.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rf.delete(t.pointerId)}}function zf(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=Ze(t))&&kf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Uf(e){var t=Xe(e.target);if(null!==t){var n=a(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=o(n)))return e.blockedOn=t,void Ue(e.priority,function(){Sf(n)})}else if(31===t){if(null!==(t=s(n)))return e.blockedOn=t,void Ue(e.priority,function(){Sf(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Vf(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tf(e.nativeEvent);if(null!==n)return null!==(t=Ze(n))&&kf(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);It=r,n.target.dispatchEvent(r),It=null,t.shift()}return!0}function $f(e,t,n){Vf(e)&&n.delete(t)}function Wf(){Of=!1,null!==Nf&&Vf(Nf)&&(Nf=null),null!==Lf&&Vf(Lf)&&(Lf=null),null!==jf&&Vf(jf)&&(jf=null),If.forEach($f),Rf.forEach($f)}function qf(t,n){t.blockedOn===n&&(t.blockedOn=null,Of||(Of=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Wf)))}var Hf=null;function Jf(t){Hf!==t&&(Hf=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hf===t&&(Hf=null);for(var e=0;e<t.length;e+=3){var n=t[e],r=t[e+1],i=t[e+2];if("function"!=typeof r){if(null===Pf(r||n))continue;break}var a=Ze(n);null!==a&&(t.splice(e,3),e-=3,is(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Qf(e){function t(t){return qf(t,e)}null!==Nf&&qf(Nf,e),null!==Lf&&qf(Lf,e),null!==jf&&qf(jf,e),If.forEach(t),Rf.forEach(t);for(var n=0;n<Ff.length;n++){var r=Ff[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ff.length&&null===(n=Ff[0]).blockedOn;)Uf(n),null===n.blockedOn&&Ff.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[We]||null;if("function"==typeof a)o||Jf(n);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[We]||null)s=o.formAction;else if(null!==Pf(i))continue}else s=o.action;"function"==typeof s?n[r+1]=s:(n.splice(r,3),r-=3),Jf(n)}}}function Gf(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==i&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),null!==i&&(i(),i=null)}}}function Yf(e){this._internalRoot=e}function Kf(e){this._internalRoot=e}Kf.prototype.render=Yf.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(r(409));yf(t.current,Gc(),e,t,null,null)},Kf.prototype.unmount=Yf.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;yf(e.current,2,null,e,null,null),nu(),t[qe]=null}},Kf.prototype.unstable_scheduleHydration=function(e){if(e){var t=ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ff.length&&0!==t&&t<Ff[n].priority;n++);Ff.splice(n,0,e),0===n&&Uf(e)}};var Xf=t.version;if("19.2.3"!==Xf)throw Error(r(527,Xf,"19.2.3"));R.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw e=Object.keys(e).join(","),Error(r(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=a(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,i=t;;){var o=n.return;if(null===o)break;var s=o.alternate;if(null===s){if(null!==(i=o.return)){n=i;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return l(o),e;if(s===i)return l(o),t;s=s.sibling}throw Error(r(188))}if(n.return!==i.return)n=o,i=s;else{for(var c=!1,u=o.child;u;){if(u===n){c=!0,n=o,i=s;break}if(u===i){c=!0,i=o,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,i=o;break}if(u===i){c=!0,i=s,n=o;break}u=u.sibling}if(!c)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?c(e):null)?null:e.stateNode};var Zf={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ep=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ep.isDisabled&&ep.supportsFiber)try{be=ep.inject(Zf),we=ep}catch(tp){}}return P.createRoot=function(e,t){if(!i(e))throw Error(r(299));var n=!1,a="",o=Ts,s=Ms,l=Ps;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(a=t.identifierPrefix),void 0!==t.onUncaughtError&&(o=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError)),t=gf(e,1,!1,null,0,n,a,null,o,s,l,Gf),e[qe]=t.current,nd(e),new Yf(t)},P.hydrateRoot=function(e,t,n){if(!i(e))throw Error(r(299));var a=!1,o="",s=Ts,l=Ms,c=Ps,u=null;return null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onUncaughtError&&(s=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.formState&&(u=n.formState)),(t=gf(e,1,!0,t,0,a,o,u,s,l,c,Gf)).context=vf(null),n=t.current,(o=ka(a=De(a=Gc()))).callback=null,Sa(n,o,a),n=a,t.current.lanes=n,je(t,n),Du(t),e[qe]=t.current,nd(e),new Kf(t)},P.version="19.2.3",P}var V=(R||(R=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),M.exports=U()),M.exports);const $=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},W=e=>e;const q=e=>{const t=(e=>e?$(e):$)(e),n=e=>function(e,t=W){const n=E.useSyncExternalStore(e.subscribe,E.useCallback(()=>t(e.getState()),[e,t]),E.useCallback(()=>t(e.getInitialState()),[e,t]));return E.useDebugValue(n),n}(t,e);return Object.assign(n,t),n},H=(J=(e,t)=>({isOpen:!1,currentScreen:"welcome",agentId:null,agentConfig:null,configLoading:!1,configError:null,dynamicVariables:{},pendingScreen:null,chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:"",pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,isUserSpeaking:!1,remoteAudioStream:null,openDialog:()=>e({isOpen:!0,currentScreen:"welcome"}),closeDialog:()=>{const{pipecatClient:n,connectionState:r}=t();n&&"disconnected"!==r&&n.disconnect().catch(()=>{}),e({isOpen:!1,currentScreen:"welcome",dynamicVariables:{},pendingScreen:null,pipecatClient:null,connectionState:"disconnected",isBotReady:!1,remoteAudioStream:null})},toggleDialog:()=>{const{isOpen:e,openDialog:n,closeDialog:r}=t();e?r():n()},setScreen:t=>e({currentScreen:t}),openChat:()=>e({isOpen:!0,currentScreen:"chat"}),openTalk:()=>e({isOpen:!0,currentScreen:"talk"}),setAgentId:t=>e({agentId:t}),setAgentConfig:t=>e({agentConfig:t,configLoading:!1,configError:null}),setConfigLoading:t=>e({configLoading:t}),setConfigError:t=>e({configError:t,configLoading:!1}),setDynamicVariables:t=>e({dynamicVariables:t}),setPendingScreen:t=>e({pendingScreen:t}),clearDynamicVariables:()=>e({dynamicVariables:{},pendingScreen:null}),setChatSession:t=>e({chatSession:t,isChatInitialized:!0}),addMessage:t=>e(e=>({messages:[...e.messages,l({id:Date.now()+Math.random(),timestamp:new Date},t)]})),setStreaming:(t,n="")=>e({isStreaming:t,streamingContent:n}),clearMessages:()=>e({messages:[],isChatInitialized:!1,chatSession:null}),setPipecatClient:t=>e({pipecatClient:t}),setConnectionState:t=>e({connectionState:t}),setIsBotReady:t=>e({isBotReady:t}),setIsMicEnabled:t=>e({isMicEnabled:t}),setIsUserSpeaking:t=>e({isUserSpeaking:t}),setRemoteAudioStream:t=>e({remoteAudioStream:t}),resetChat:()=>e({chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:""}),resetVoice:()=>e({pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,isUserSpeaking:!1,remoteAudioStream:null}),resetAll:()=>e({isOpen:!1,currentScreen:"welcome",chatSession:null,messages:[],isChatInitialized:!1,isStreaming:!1,streamingContent:"",pipecatClient:null,connectionState:"disconnected",isBotReady:!1,isMicEnabled:!0,isUserSpeaking:!1,remoteAudioStream:null}),getAgentName:()=>{const{agentConfig:e}=t();return(null==e?void 0:e.agent_name)||"AI Assistant"},getAvatarUrl:()=>{const{agentConfig:e}=t();if(!(null==e?void 0:e.MediaFiles)||!Array.isArray(e.MediaFiles))return null;const n=e.MediaFiles.find(e=>"avatar"===e.fileType);return(null==n?void 0:n.mediaUrl)||null},getPromptToken:()=>{const{agentConfig:e}=t();return(null==e?void 0:e.prompt_access_token)||null},getTheme:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_theme)||{}},getTncConfig:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_tnc_config)||{}},getInterfaceConfig:()=>{var e;const{agentConfig:n}=t();return(null==(e=null==n?void 0:n.widget_config)?void 0:e.widget_interface)||{}}}),J?q(J):q);var J;const Q="https://prod.eigi.ai";function G(e){return d(this,arguments,function*(e,t={}){const n=`${Q}/${e}`,r=l({headers:l({"Content-Type":"application/json"},t.headers)},t);try{t.method;const e=yield fetch(n,r);if(!e.ok){const t=yield e.json().catch(()=>({}));throw new Error(t.detail||t.message||`HTTP ${e.status}`)}return yield e.json()}catch(i){throw i}})}function Y(e){return d(this,null,function*(){const t=yield G(`v1/widgets/agents/${e}`);return t.agent_name,t})}function K(e,t=!0){if(!e||0===Object.keys(e).length)return"";const n=Object.entries(e).filter(([e,t])=>null!=t&&""!==t).map(([e,t])=>`${function(e){return`--widget-${e.replace(/_/g,"-")}`}(e)}: ${function(e,t=""){if("boolean"==typeof e)return e?"1":"0";const n=["opacity","weight","font_weight","z_index","line_height"].some(e=>t.toLowerCase().includes(e));return"number"!=typeof e||n?String(e):`${e}px`}(t,e)}`).join(";\n ");if(!n)return"";return`${t?":host, *":":root"} {\n ${n};\n}`}function X(e){if(!e||"string"!=typeof e)return null;3===(e=e.replace(/^#/,"")).length&&(e=e.split("").map(e=>e+e).join(""));const t=parseInt(e.substring(0,2),16)/255,n=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r);let o,s,l=(i+a)/2;if(i===a)o=s=0;else{const e=i-a;switch(s=l>.5?e/(2-i-a):e/(i+a),i){case t:o=((n-r)/e+(n<r?6:0))/6;break;case n:o=((r-t)/e+2)/6;break;case r:o=((t-n)/e+4)/6}}return o=Math.round(360*o),s=Math.round(100*s),l=Math.round(100*l),`${o} ${s}% ${l}%`}const Z=x.memo(function({theme:e,widgetElement:t}){return x.useEffect(()=>{if(!e||0===Object.keys(e).length)return;const n=void 0!==(null==t?void 0:t.shadow),r=function(e,t=!0){if(!e)return"";const n={"--background":X(e.background),"--foreground":X(e.text_primary),"--primary":X(e.primary_color),"--primary-foreground":X(e.primary_foreground),"--secondary":X(e.secondary_color),"--secondary-foreground":X(e.secondary_foreground),"--accent":X(e.accent_color),"--accent-foreground":X(e.accent_foreground),"--muted":X(e.background_muted||e.background_secondary),"--muted-foreground":X(e.text_muted),"--border":X(e.border),"--input":X(e.input_border||e.border),"--ring":X(e.border_focus||e.primary_color),"--destructive":X(e.status_error||"#ef4444"),"--destructive-foreground":"0 0% 100%","--card":X(e.background),"--card-foreground":X(e.text_primary),"--popover":X(e.background_secondary||e.background),"--popover-foreground":X(e.text_primary),"--radius":e.border_radius||"0.75rem"},r=Object.entries(n).filter(([e,t])=>null!=t).map(([e,t])=>`${e}: ${t}`).join(";\n ");return r?`${t?":host, *":":root"} {\n ${r};\n}`:""}(e,n),i=[r,K(e,n)].filter(Boolean).join("\n\n");if(i)if(n&&(null==t?void 0:t.injectThemeCSS))t.injectThemeCSS(i);else if(null==t?void 0:t.injectThemeCSS)t.injectThemeCSS(i);else{const e="eigi-chat-theme";let t=document.getElementById(e);t||(t=document.createElement("style"),t.id=e,document.head.appendChild(t)),t.textContent=i}},[e,t]),null});function ee(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ee(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function te(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ee(e))&&(r&&(r+=" "),r+=t);return r}const ne=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,re=te,ie=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ae="-",oe=[],se=e=>{const t=ue(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return ce(e);const n=e.split(ae),r=""===n[0]&&n.length>1?1:0;return le(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],i=n[e];return t?i?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(i,t):t:i||oe}return n[e]||oe}}},le=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=le(e,t+1,i);if(n)return n}const a=n.validators;if(null===a)return;const o=0===t?e.join(ae):e.slice(t).join(ae),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(o))return e.classGroupId}},ce=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),ue=e=>{const{theme:t,classGroups:n}=e;return de(n,t)},de=(e,t)=>{const n=ie();for(const r in e){const i=e[r];fe(i,n,r,t)}return n},fe=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const i=e[a];pe(i,t,n,r)}},pe=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?ge(e,t,n,r):me(e,t,n,r):he(e,t,n)},he=(e,t,n)=>{(""===e?t:ve(t,e)).classGroupId=n},me=(e,t,n,r)=>{ye(e)?fe(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},ge=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[e,a]=i[o];fe(a,ve(t,e),n,r)}},ve=(e,t)=>{let n=e;const r=t.split(ae),i=r.length;for(let a=0;a<i;a++){const e=r[a];let t=n.nextPart.get(e);t||(t=ie(),n.nextPart.set(e,t)),n=t}return n},ye=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,be=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}},we=[],ke=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Se=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,i=0,a=0;const o=e.length;for(let u=0;u<o;u++){const o=e[u];if(0===r&&0===i){if(":"===o){t.push(e.slice(a,u)),a=u+1;continue}if("/"===o){n=u;continue}}"["===o?r++:"]"===o?r--:"("===o?i++:")"===o&&i--}const s=0===t.length?e:e.slice(a);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return ke(t,c,l,n&&n>a?n-a:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ke(we,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},_e=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let i=0;i<e.length;i++){const a=e[i],o="["===a[0],s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},xe=/\s+/,Ee=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ee(e[r]))&&(n&&(n+=" "),n+=t);return n},Ce=(e,...t)=>{let n,r,i,a;const o=e=>{const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(xe);let l="";for(let c=s.length-1;c>=0;c-=1){const e=s[c],{isExternal:t,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(e);if(t){l=e+(l.length>0?" "+l:l);continue}let h=!!p,m=r(h?f.substring(0,p):f);if(!m){if(!h){l=e+(l.length>0?" "+l:l);continue}if(m=r(f),!m){l=e+(l.length>0?" "+l:l);continue}h=!1}const g=0===u.length?"":1===u.length?u[0]:a(u).join(":"),v=d?g+"!":g,y=v+m;if(o.indexOf(y)>-1)continue;o.push(y);const b=i(m,h);for(let n=0;n<b.length;++n){const e=b[n];o.push(v+e)}l=e+(l.length>0?" "+l:l)}return l})(e,n);return i(e,a),a};return a=s=>{const c=t.reduce((e,t)=>t(e),e());return n=(e=>l({cache:be(e.cacheSize),parseClassName:Se(e),sortModifiers:_e(e)},se(e)))(c),r=n.cache.get,i=n.cache.set,a=o,o(s)},(...e)=>a(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=Ee(t))&&(i&&(i+=" "),i+=n);return i})(...e))},Te=[],Me=e=>{const t=t=>t[e]||Te;return t.isThemeGetter=!0,t},Pe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ae=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Oe=/^\d+\/\d+$/,Ne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Le=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,je=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Re=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fe=e=>Oe.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),Be=e=>!!e&&Number.isInteger(Number(e)),ze=e=>e.endsWith("%")&&De(e.slice(0,-1)),Ue=e=>Ne.test(e),Ve=()=>!0,$e=e=>Le.test(e)&&!je.test(e),We=()=>!1,qe=e=>Ie.test(e),He=e=>Re.test(e),Je=e=>!Ge(e)&&!tt(e),Qe=e=>lt(e,ft,We),Ge=e=>Pe.test(e),Ye=e=>lt(e,pt,$e),Ke=e=>lt(e,ht,De),Xe=e=>lt(e,ut,We),Ze=e=>lt(e,dt,He),et=e=>lt(e,gt,qe),tt=e=>Ae.test(e),nt=e=>ct(e,pt),rt=e=>ct(e,mt),it=e=>ct(e,ut),at=e=>ct(e,ft),ot=e=>ct(e,dt),st=e=>ct(e,gt,!0),lt=(e,t,n)=>{const r=Pe.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ct=(e,t,n=!1)=>{const r=Ae.exec(e);return!!r&&(r[1]?t(r[1]):n)},ut=e=>"position"===e||"percentage"===e,dt=e=>"image"===e||"url"===e,ft=e=>"length"===e||"size"===e||"bg-size"===e,pt=e=>"length"===e,ht=e=>"number"===e,mt=e=>"family-name"===e,gt=e=>"shadow"===e,vt=Ce(()=>{const e=Me("color"),t=Me("font"),n=Me("text"),r=Me("font-weight"),i=Me("tracking"),a=Me("leading"),o=Me("breakpoint"),s=Me("container"),l=Me("spacing"),c=Me("radius"),u=Me("shadow"),d=Me("inset-shadow"),f=Me("text-shadow"),p=Me("drop-shadow"),h=Me("blur"),m=Me("perspective"),g=Me("aspect"),v=Me("ease"),y=Me("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",tt,Ge],w=()=>[tt,Ge,l],k=()=>[Fe,"full","auto",...w()],S=()=>[Be,"none","subgrid",tt,Ge],_=()=>["auto",{span:["full",Be,tt,Ge]},Be,tt,Ge],x=()=>[Be,"auto",tt,Ge],E=()=>["auto","min","max","fr",tt,Ge],C=()=>["auto",...w()],T=()=>[Fe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,tt,Ge],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",it,Xe,{position:[tt,Ge]}],A=()=>["auto","cover","contain",at,Qe,{size:[tt,Ge]}],O=()=>[ze,nt,Ye],N=()=>["","none","full",c,tt,Ge],L=()=>["",De,nt,Ye],j=()=>[De,ze,it,Xe],I=()=>["","none",h,tt,Ge],R=()=>["none",De,tt,Ge],F=()=>["none",De,tt,Ge],D=()=>[De,tt,Ge],B=()=>[Fe,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ue],breakpoint:[Ue],color:[Ve],container:[Ue],"drop-shadow":[Ue],ease:["in","out","in-out"],font:[Je],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ue],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ue],shadow:[Ue],spacing:["px",De],text:[Ue],"text-shadow":[Ue],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fe,Ge,tt,g]}],container:["container"],columns:[{columns:[De,Ge,tt,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Be,"auto",tt,Ge]}],basis:[{basis:[Fe,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Fe,"auto","initial","none",Ge]}],grow:[{grow:["",De,tt,Ge]}],shrink:[{shrink:["",De,tt,Ge]}],order:[{order:[Be,"first","last","none",tt,Ge]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":x()}],"col-end":[{"col-end":x()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":x()}],"row-end":[{"row-end":x()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],w:[{w:[s,"screen",...T()]}],"min-w":[{"min-w":[s,"screen","none",...T()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",n,nt,Ye]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tt,Ke]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ze,Ge]}],"font-family":[{font:[rt,Ge,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,tt,Ge]}],"line-clamp":[{"line-clamp":[De,"none",tt,Ke]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",tt,Ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tt,Ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",tt,Ye]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[De,"auto",tt,Ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt,Ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tt,Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Be,tt,Ge],radial:["",tt,Ge],conic:[Be,tt,Ge]},ot,Ze]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[De,tt,Ge]}],"outline-w":[{outline:["",De,nt,Ye]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,st,et]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,st,et]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[De,Ye]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,st,et]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[De,tt,Ge]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":j()}],"mask-image-linear-to-pos":[{"mask-linear-to":j()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":j()}],"mask-image-t-to-pos":[{"mask-t-to":j()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":j()}],"mask-image-r-to-pos":[{"mask-r-to":j()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":j()}],"mask-image-b-to-pos":[{"mask-b-to":j()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":j()}],"mask-image-l-to-pos":[{"mask-l-to":j()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":j()}],"mask-image-x-to-pos":[{"mask-x-to":j()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":j()}],"mask-image-y-to-pos":[{"mask-y-to":j()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[tt,Ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":j()}],"mask-image-radial-to-pos":[{"mask-radial-to":j()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":j()}],"mask-image-conic-to-pos":[{"mask-conic-to":j()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tt,Ge]}],filter:[{filter:["","none",tt,Ge]}],blur:[{blur:I()}],brightness:[{brightness:[De,tt,Ge]}],contrast:[{contrast:[De,tt,Ge]}],"drop-shadow":[{"drop-shadow":["","none",p,st,et]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",De,tt,Ge]}],"hue-rotate":[{"hue-rotate":[De,tt,Ge]}],invert:[{invert:["",De,tt,Ge]}],saturate:[{saturate:[De,tt,Ge]}],sepia:[{sepia:["",De,tt,Ge]}],"backdrop-filter":[{"backdrop-filter":["","none",tt,Ge]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[De,tt,Ge]}],"backdrop-contrast":[{"backdrop-contrast":[De,tt,Ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,tt,Ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,tt,Ge]}],"backdrop-invert":[{"backdrop-invert":["",De,tt,Ge]}],"backdrop-opacity":[{"backdrop-opacity":[De,tt,Ge]}],"backdrop-saturate":[{"backdrop-saturate":[De,tt,Ge]}],"backdrop-sepia":[{"backdrop-sepia":["",De,tt,Ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tt,Ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",tt,Ge]}],ease:[{ease:["linear","initial",v,tt,Ge]}],delay:[{delay:[De,tt,Ge]}],animate:[{animate:["none",y,tt,Ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,tt,Ge]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:R()}],"rotate-x":[{"rotate-x":R()}],"rotate-y":[{"rotate-y":R()}],"rotate-z":[{"rotate-z":R()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:D()}],"skew-x":[{"skew-x":D()}],"skew-y":[{"skew-y":D()}],transform:[{transform:[tt,Ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tt,Ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tt,Ge]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[De,nt,Ye,Ke]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function yt(...e){return vt(te(e))}const bt=(wt="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",kt={variants:{variant:{default:"text-white shadow-sm hover:opacity-90",secondary:"shadow-sm hover:opacity-90",destructive:"text-white shadow-sm hover:opacity-90",outline:"border bg-transparent shadow-sm hover:opacity-80",ghost:"hover:opacity-80",link:"underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-12 rounded-md px-8 text-base",xl:"h-14 rounded-lg px-10 text-lg",icon:"h-10 w-10","icon-sm":"h-8 w-8","icon-lg":"h-12 w-12"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if(null==(null==kt?void 0:kt.variants))return re(wt,null==e?void 0:e.class,null==e?void 0:e.className);const{variants:n,defaultVariants:r}=kt,i=Object.keys(n).map(t=>{const i=null==e?void 0:e[t],a=null==r?void 0:r[t];if(null===i)return null;const o=ne(i)||ne(a);return n[t][o]}),a=e&&Object.entries(e).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),o=null==kt||null===(t=kt.compoundVariants)||void 0===t?void 0:t.reduce((e,t)=>{let n=t,{class:i,className:o}=n,s=u(n,["class","className"]);return Object.entries(s).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes(l(l({},r),a)[t]):l(l({},r),a)[t]===n})?[...e,i,o]:e},[]);return re(wt,i,o,null==e?void 0:e.class,null==e?void 0:e.className)});var wt,kt;const St=x.forwardRef((e,t)=>{var n=e,{className:r,variant:i,size:a,style:o}=n,s=u(n,["className","variant","size","style"]);return b.jsx("button",l({className:yt(bt({variant:i,size:a,className:r})),ref:t,style:l(c(l({},(()=>{switch(i){case"default":return{backgroundColor:"var(--widget-button-primary-bg, #3B82F6)",color:"var(--widget-button-primary-text, #FFFFFF)"};case"secondary":return{backgroundColor:"var(--widget-button-secondary-bg, #F3F4F6)",color:"var(--widget-button-secondary-text, #374151)"};case"destructive":return{backgroundColor:"var(--widget-button-destructive-bg, #DC2626)",color:"var(--widget-button-destructive-text, #FFFFFF)"};case"outline":return{borderColor:"var(--widget-border, #E5E7EB)",color:"var(--widget-text-primary, #111827)"};case"ghost":return{color:"var(--widget-text-primary, #111827)"};default:return{}}})()),{borderRadius:"var(--widget-border-radius-small, 8px)",fontFamily:"var(--widget-font-family, inherit)"}),o)},s))});St.displayName="Button";const _t=x.forwardRef((e,t)=>{var n=e,{className:r,src:i,alt:a,fallback:o,size:s="md"}=n,d=u(n,["className","src","alt","fallback","size"]);const[f,p]=x.useState(!1),h={sm:"h-10 w-10 text-sm",md:"h-16 w-16 text-lg",lg:"h-24 w-24 text-2xl",xl:"h-32 w-32 text-3xl","2xl":"h-40 w-40 text-4xl"};return b.jsx("div",c(l({ref:t,className:yt("relative flex shrink-0 overflow-hidden rounded-full",h[s]||h.md,r),style:{backgroundColor:"var(--widget-background-secondary, #F3F4F6)"}},d),{children:i&&!f?b.jsx("img",{src:i,alt:a||"Avatar",onError:()=>{p(!0)},className:"aspect-square h-full w-full object-cover"}):b.jsx("span",{className:"flex h-full w-full items-center justify-center font-semibold",style:{color:"var(--widget-text-secondary, #6B7280)"},children:o||(a?a.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"AI")})}))});_t.displayName="Avatar";x.forwardRef((e,t)=>{var n=e,{status:r="idle"}=n,i=u(n,["status"]);const a={idle:{ring:"ring-2 ring-offset-2",ringColor:"var(--widget-border, #E5E7EB)"},connecting:{ring:"ring-4 ring-offset-2 animate-pulse",ringColor:"var(--widget-status-connecting, #F59E0B)"},listening:{ring:"ring-4 ring-offset-2",ringColor:"var(--widget-status-success, #10B981)"},speaking:{ring:"ring-4 ring-offset-4 animate-pulse",ringColor:"var(--widget-primary-color, #3B82F6)"},error:{ring:"ring-4 ring-offset-2",ringColor:"var(--widget-status-error, #DC2626)"}},o=a[r]||a.idle;return b.jsx("div",{className:yt(o.ring),style:{"--tw-ring-color":o.ringColor,"--tw-ring-offset-color":"var(--widget-background, #FFFFFF)",borderRadius:"9999px"},children:b.jsx(_t,l({ref:t},i))})}).displayName="AvatarWithStatus";
11
11
  /**
12
12
  * @license lucide-react v0.553.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
16
  */
17
- const Tt=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Mt=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();
17
+ const xt=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Et=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();
18
18
  /**
19
19
  * @license lucide-react v0.553.0 - ISC
20
20
  *
21
21
  * This source code is licensed under the ISC license.
22
22
  * See the LICENSE file in the root directory of this source tree.
23
23
  */
24
- var Pt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
24
+ var Ct={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
25
25
  /**
26
26
  * @license lucide-react v0.553.0 - ISC
27
27
  *
28
28
  * This source code is licensed under the ISC license.
29
29
  * See the LICENSE file in the root directory of this source tree.
30
- */const At=x.forwardRef((e,t)=>{var n=e,{color:r="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:d,iconNode:f}=n,p=u(n,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return x.createElement("svg",l(l(c(l({ref:t},Pt),{width:i,height:i,stroke:r,strokeWidth:o?24*Number(a)/Number(i):a,className:Mt("lucide",s)}),!d&&!(e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(p)&&{"aria-hidden":"true"}),p),[...f.map(([e,t])=>x.createElement(e,t)),...Array.isArray(d)?d:[d]])}),Ot=(e,t)=>{const n=x.forwardRef((n,r)=>{var i,a=n,{className:o}=a,s=u(a,["className"]);return x.createElement(At,l({ref:r,iconNode:t,className:Mt(`lucide-${i=Tt(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o)},s))});return n.displayName=Tt(e),n},Nt=Ot("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Lt=Ot("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),jt=Ot("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),It=Ot("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),Rt=Ot("mic-off",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]),Ft=Ot("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),Dt=Ot("phone-off",[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]),Bt=Ot("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),zt=Ot("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);
30
+ */const Tt=x.forwardRef((e,t)=>{var n=e,{color:r="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:d,iconNode:f}=n,p=u(n,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return x.createElement("svg",l(l(c(l({ref:t},Ct),{width:i,height:i,stroke:r,strokeWidth:o?24*Number(a)/Number(i):a,className:Et("lucide",s)}),!d&&!(e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(p)&&{"aria-hidden":"true"}),p),[...f.map(([e,t])=>x.createElement(e,t)),...Array.isArray(d)?d:[d]])}),Mt=(e,t)=>{const n=x.forwardRef((n,r)=>{var i,a=n,{className:o}=a,s=u(a,["className"]);return x.createElement(Tt,l({ref:r,iconNode:t,className:Et(`lucide-${i=xt(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o)},s))});return n.displayName=xt(e),n},Pt=Mt("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),At=Mt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Ot=Mt("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Nt=Mt("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),Lt=Mt("mic-off",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]),jt=Mt("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),It=Mt("phone-off",[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]),Rt=Mt("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),Ft=Mt("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);
31
31
  /**
32
32
  * @license lucide-react v0.553.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */function Ut({agentName:e,avatarUrl:t,tncEnabled:n,tncContent:r,onTalk:i,onChat:a,onClose:o,className:s}){const[l,c]=x.useState(!n||!r),[u,d]=x.useState(n&&r),f=x.useRef(null),p=x.useCallback(e=>{const t=e.target;t.scrollHeight-t.scrollTop<=t.clientHeight+20&&(c(!0),d(!1))},[]),h=x.useCallback(e=>{e&&(f.current=e,setTimeout(()=>{e.scrollHeight>e.clientHeight||(c(!0),d(!1))},100))},[]);return b.jsxs("div",{className:kt("flex flex-col h-full w-full animate-fade-in relative min-h-0",s),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsx("button",{onClick:o,className:"absolute top-4 right-4 p-2 rounded-full hover:opacity-80 transition-opacity z-10",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(zt,{className:"h-6 w-6"})}),b.jsx("div",{ref:h,onScroll:p,className:"flex-1 min-h-0 overflow-y-auto",children:b.jsxs("div",{className:"flex flex-col items-center px-6 py-8 pt-14",children:[b.jsx(Et,{src:t,alt:e,size:"2xl",className:"mb-6 shadow-lg"}),b.jsx("h1",{className:"text-2xl font-semibold mb-2 text-center",style:{color:"var(--widget-text-primary, #111827)"},children:"Welcome!"}),b.jsxs("p",{className:"text-lg mb-6 text-center",style:{color:"var(--widget-text-secondary, #6B7280)"},children:["I'm ",b.jsx("span",{className:"font-medium",children:e})]}),n&&r&&b.jsx("div",{className:"w-full max-w-md mb-6 p-4 rounded-lg",style:{backgroundColor:"var(--widget-background-secondary, #F9FAFB)",border:"1px solid var(--widget-border, #E5E7EB)"},children:b.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",style:{color:"var(--widget-text-secondary, #6B7280)"},children:r})}),n&&b.jsx("p",{className:"text-xs mb-8 text-center max-w-sm",style:{color:"var(--widget-text-muted, #9CA3AF)"},children:"By continuing, you agree to the terms above."})]})}),u&&b.jsxs("div",{className:"flex flex-col items-center py-2 pointer-events-none",style:{background:"linear-gradient(transparent, var(--widget-background, #FFFFFF) 30%)"},children:[b.jsx(Lt,{className:"h-5 w-5 animate-bounce",style:{color:"var(--widget-primary-color, #3B82F6)"}}),b.jsx("span",{className:"text-xs",style:{color:"var(--widget-primary-color, #3B82F6)"},children:"Scroll to continue"})]}),b.jsx("div",{className:"p-6 pb-safe shrink-0",style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",paddingBottom:"max(1.5rem, env(safe-area-inset-bottom, 0px))"},children:b.jsxs("div",{className:"flex gap-4 max-w-md mx-auto",children:[b.jsxs(Ct,{onClick:i,variant:"default",size:"xl",className:"flex-1",disabled:!l,children:[b.jsx(Ft,{className:"h-5 w-5"}),"Talk"]}),b.jsxs(Ct,{onClick:a,variant:"secondary",size:"xl",className:"flex-1",disabled:!l,children:[b.jsx(It,{className:"h-5 w-5"}),"Chat"]})]})})]})}function Vt(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function $t(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Vt(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Vt(e[t],null)}}}}function Wt(...e){return x.useCallback($t(...e),e)}function qt(e){const t=Ht(e),n=x.forwardRef((e,n)=>{const r=e,{children:i}=r,a=u(r,["children"]),o=x.Children.toArray(i),s=o.find(Gt);if(s){const e=s.props.children,r=o.map(t=>t===s?x.Children.count(e)>1?x.Children.only(null):x.isValidElement(e)?e.props.children:null:t);return b.jsx(t,c(l({},a),{ref:n,children:x.isValidElement(e)?x.cloneElement(e,void 0,r):null}))}return b.jsx(t,c(l({},a),{ref:n,children:i}))});return n.displayName=`${e}.Slot`,n}function Ht(e){const t=x.forwardRef((e,t)=>{const n=e,{children:r}=n,i=u(n,["children"]);if(x.isValidElement(r)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,i=r&&"isReactWarning"in r&&r.isReactWarning;if(i)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i)return e.props.ref;return e.props.ref||e.ref}(r),n=function(e,t){const n=l({},t);for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{const t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]=l(l({},i),a):"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return l(l({},e),n)}(i,r.props);return r.type!==x.Fragment&&(n.ref=t?$t(t,e):e),x.cloneElement(r,n)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}z();var Jt=Symbol("radix.slottable");function Gt(e){return x.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Jt}var Qt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=qt(`Primitive.${t}`),r=x.forwardRef((e,r)=>{const i=e,{asChild:a}=i,o=u(i,["asChild"]),s=a?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),b.jsx(s,c(l({},o),{ref:r}))});return r.displayName=`Primitive.${t}`,c(l({},e),{[t]:r})},{}),Yt=(null==globalThis?void 0:globalThis.document)?x.useLayoutEffect:()=>{};var Kt=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[s,l]=function(e,t){return x.useReducer((e,n)=>{const r=t[e][n];return null!=r?r:e},e)}(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const e=Xt(r.current);a.current="mounted"===s?e:"none"},[s]),Yt(()=>{const t=r.current,n=i.current;if(n!==e){const r=a.current,o=Xt(t);if(e)l("MOUNT");else if("none"===o||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,l]),Yt(()=>{var e;if(t){let n;const o=null!=(e=t.ownerDocument.defaultView)?e:window,s=e=>{const a=Xt(r.current).includes(CSS.escape(e.animationName));if(e.target===t&&a&&(l("ANIMATION_END"),!i.current)){const e=t.style.animationFillMode;t.style.animationFillMode="forwards",n=o.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=e)})}},c=e=>{e.target===t&&(a.current=Xt(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{o.clearTimeout(n),t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:x.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),i="function"==typeof n?n({present:r.isPresent}):x.Children.only(n),a=Wt(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,i=r&&"isReactWarning"in r&&r.isReactWarning;if(i)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof n||r.isPresent?x.cloneElement(i,{ref:a}):null};function Xt(e){return(null==e?void 0:e.animationName)||"none"}function Zt(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>{const i=n(e)[`__scope${r}`];return l(l({},t),i)},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function en(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}Kt.displayName="Presence";var tn=x.createContext(void 0);function nn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}var rn="ScrollArea",[an]=function(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>x.createContext(e));return function(n){const r=(null==n?void 0:n[e])||t;return x.useMemo(()=>({[`__scope${e}`]:c(l({},n),{[e]:r})}),[n,r])}};return r.scopeName=e,[function(t,r){const i=x.createContext(r),a=n.length;n=[...n,r];const o=t=>{var n;const r=t,{scope:o,children:s}=r,l=u(r,["scope","children"]),c=(null==(n=null==o?void 0:o[e])?void 0:n[a])||i,d=x.useMemo(()=>l,Object.values(l));return b.jsx(c.Provider,{value:d,children:s})};return o.displayName=t+"Provider",[o,function(n,o){var s;const l=(null==(s=null==o?void 0:o[e])?void 0:s[a])||i,c=x.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Zt(r,...t)]}(rn),[on,sn]=an(rn),ln=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,type:i="hover",dir:a,scrollHideDelay:o=600}=n,s=u(n,["__scopeScrollArea","type","dir","scrollHideDelay"]),[d,f]=x.useState(null),[p,h]=x.useState(null),[m,g]=x.useState(null),[v,y]=x.useState(null),[w,k]=x.useState(null),[S,_]=x.useState(0),[C,E]=x.useState(0),[T,M]=x.useState(!1),[P,A]=x.useState(!1),O=Wt(t,e=>f(e)),N=function(e){const t=x.useContext(tn);return e||t||"ltr"}(a);return b.jsx(on,{scope:r,type:i,dir:N,scrollHideDelay:o,scrollArea:d,viewport:p,onViewportChange:h,content:m,onContentChange:g,scrollbarX:v,onScrollbarXChange:y,scrollbarXEnabled:T,onScrollbarXEnabledChange:M,scrollbarY:w,onScrollbarYChange:k,scrollbarYEnabled:P,onScrollbarYEnabledChange:A,onCornerWidthChange:_,onCornerHeightChange:E,children:b.jsx(Qt.div,c(l({dir:N},s),{ref:O,style:l({position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":C+"px"},e.style)}))})});ln.displayName=rn;var cn="ScrollAreaViewport",un=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,children:i,nonce:a}=n,o=u(n,["__scopeScrollArea","children","nonce"]),s=sn(cn,r),d=Wt(t,x.useRef(null),s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),b.jsx(Qt.div,c(l({"data-radix-scroll-area-viewport":""},o),{ref:d,style:l({overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden"},e.style),children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:i})}))]})});un.displayName=cn;var dn="ScrollAreaScrollbar",fn=x.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=sn(dn,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=a,d="horizontal"===e.orientation;return x.useEffect(()=>(d?o(!0):s(!0),()=>{d?o(!1):s(!1)}),[d,o,s]),"hover"===a.type?b.jsx(pn,c(l({},i),{ref:t,forceMount:r})):"scroll"===a.type?b.jsx(hn,c(l({},i),{ref:t,forceMount:r})):"auto"===a.type?b.jsx(mn,c(l({},i),{ref:t,forceMount:r})):"always"===a.type?b.jsx(gn,c(l({},i),{ref:t})):null});fn.displayName=dn;var pn=x.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=sn(dn,e.__scopeScrollArea),[o,s]=x.useState(!1);return x.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),s(!0)},r=()=>{t=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[a.scrollArea,a.scrollHideDelay]),b.jsx(Kt,{present:r||o,children:b.jsx(mn,c(l({"data-state":o?"visible":"hidden"},i),{ref:t}))})}),hn=x.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=sn(dn,e.__scopeScrollArea),o="horizontal"===e.orientation,s=In(()=>f("SCROLL_END"),100),[d,f]=(p="hidden",h={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},x.useReducer((e,t)=>{const n=h[e][t];return null!=n?n:e},p));var p,h;return x.useEffect(()=>{if("idle"===d){const e=window.setTimeout(()=>f("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[d,a.scrollHideDelay,f]),x.useEffect(()=>{const e=a.viewport,t=o?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(f("SCROLL"),s()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[a.viewport,o,f,s]),b.jsx(Kt,{present:r||"hidden"!==d,children:b.jsx(gn,c(l({"data-state":"hidden"===d?"hidden":"visible"},i),{ref:t,onPointerEnter:nn(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:nn(e.onPointerLeave,()=>f("POINTER_LEAVE"))}))})}),mn=x.forwardRef((e,t)=>{const n=sn(dn,e.__scopeScrollArea),r=e,{forceMount:i}=r,a=u(r,["forceMount"]),[o,s]=x.useState(!1),d="horizontal"===e.orientation,f=In(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;s(d?e:t)}},10);return Rn(n.viewport,f),Rn(n.content,f),b.jsx(Kt,{present:i||o,children:b.jsx(gn,c(l({"data-state":o?"visible":"hidden"},a),{ref:t}))})}),gn=x.forwardRef((e,t)=>{const n=e,{orientation:r="vertical"}=n,i=u(n,["orientation"]),a=sn(dn,e.__scopeScrollArea),o=x.useRef(null),s=x.useRef(0),[d,f]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=Pn(d.viewport,d.content),h=c(l({},i),{sizes:d,onSizesChange:f,hasThumb:Boolean(p>0&&p<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:e=>s.current=e});function m(e,t){return function(e,t,n,r="ltr"){const i=An(n),a=i/2,o=t||a,s=i-o,l=n.scrollbar.paddingStart+o,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d="ltr"===r?[0,u]:[-1*u,0];return Nn([l,c],d)(e)}(e,s.current,d,t)}return"horizontal"===r?b.jsx(vn,c(l({},h),{ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=On(a.viewport.scrollLeft,d,a.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=m(e,a.dir))}})):"vertical"===r?b.jsx(yn,c(l({},h),{ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=On(a.viewport.scrollTop,d);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=m(e))}})):null}),vn=x.forwardRef((e,t)=>{const n=e,{sizes:r,onSizesChange:i}=n,a=u(n,["sizes","onSizesChange"]),o=sn(dn,e.__scopeScrollArea),[s,d]=x.useState(),f=x.useRef(null),p=Wt(t,f,o.onScrollbarXChange);return x.useEffect(()=>{f.current&&d(getComputedStyle(f.current))},[f]),b.jsx(kn,c(l({"data-orientation":"horizontal"},a),{ref:p,sizes:r,style:l({bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":An(r)+"px"},e.style),onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Ln(r,n)&&t.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&i({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Mn(s.paddingLeft),paddingEnd:Mn(s.paddingRight)}})}}))}),yn=x.forwardRef((e,t)=>{const n=e,{sizes:r,onSizesChange:i}=n,a=u(n,["sizes","onSizesChange"]),o=sn(dn,e.__scopeScrollArea),[s,d]=x.useState(),f=x.useRef(null),p=Wt(t,f,o.onScrollbarYChange);return x.useEffect(()=>{f.current&&d(getComputedStyle(f.current))},[f]),b.jsx(kn,c(l({"data-orientation":"vertical"},a),{ref:p,sizes:r,style:l({top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":An(r)+"px"},e.style),onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Ln(r,n)&&t.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&i({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Mn(s.paddingTop),paddingEnd:Mn(s.paddingBottom)}})}}))}),[bn,wn]=an(dn),kn=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,sizes:i,hasThumb:a,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:d,onThumbPositionChange:f,onDragScroll:p,onWheelScroll:h,onResize:m}=n,g=u(n,["__scopeScrollArea","sizes","hasThumb","onThumbChange","onThumbPointerUp","onThumbPointerDown","onThumbPositionChange","onDragScroll","onWheelScroll","onResize"]),v=sn(dn,r),[y,w]=x.useState(null),k=Wt(t,e=>w(e)),S=x.useRef(null),_=x.useRef(""),C=v.viewport,E=i.content-i.viewport,T=en(h),M=en(f),P=In(m,10);function A(e){if(S.current){const t=e.clientX-S.current.left,n=e.clientY-S.current.top;p({x:t,y:n})}}return x.useEffect(()=>{const e=e=>{const t=e.target;(null==y?void 0:y.contains(t))&&T(e,E)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[C,y,E,T]),x.useEffect(M,[i,M]),Rn(y,P),Rn(v.content,P),b.jsx(bn,{scope:r,scrollbar:y,hasThumb:a,onThumbChange:en(o),onThumbPointerUp:en(s),onThumbPositionChange:M,onThumbPointerDown:en(d),children:b.jsx(Qt.div,c(l({},g),{ref:k,style:l({position:"absolute"},g.style),onPointerDown:nn(e.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),S.current=y.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),A(e)}}),onPointerMove:nn(e.onPointerMove,A),onPointerUp:nn(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=_.current,v.viewport&&(v.viewport.style.scrollBehavior=""),S.current=null})}))})}),Sn="ScrollAreaThumb",_n=x.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=wn(Sn,e.__scopeScrollArea);return b.jsx(Kt,{present:r||a.hasThumb,children:b.jsx(xn,l({ref:t},i))})}),xn=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,style:i}=n,a=u(n,["__scopeScrollArea","style"]),o=sn(Sn,r),s=wn(Sn,r),{onThumbPositionChange:d}=s,f=Wt(t,e=>s.onThumbChange(e)),p=x.useRef(void 0),h=In(()=>{p.current&&(p.current(),p.current=void 0)},100);return x.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(h(),!p.current){const t=jn(e,d);p.current=t,d()}};return d(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,h,d]),b.jsx(Qt.div,c(l({"data-state":s.hasThumb?"visible":"hidden"},a),{ref:f,style:l({width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)"},i),onPointerDownCapture:nn(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;s.onThumbPointerDown({x:n,y:r})}),onPointerUp:nn(e.onPointerUp,s.onThumbPointerUp)}))});_n.displayName=Sn;var Cn="ScrollAreaCorner",En=x.forwardRef((e,t)=>{const n=sn(Cn,e.__scopeScrollArea),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?b.jsx(Tn,c(l({},e),{ref:t})):null});En.displayName=Cn;var Tn=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r}=n,i=u(n,["__scopeScrollArea"]),a=sn(Cn,r),[o,s]=x.useState(0),[d,f]=x.useState(0),p=Boolean(o&&d);return Rn(a.scrollbarX,()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),f(t)}),Rn(a.scrollbarY,()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),s(t)}),p?b.jsx(Qt.div,c(l({},i),{ref:t,style:l({width:o,height:d,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0},e.style)})):null});function Mn(e){return e?parseInt(e,10):0}function Pn(e,t){const n=e/t;return isNaN(n)?0:n}function An(e){const t=Pn(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function On(e,t,n="ltr"){const r=An(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,l=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,"ltr"===n?[0,o]:[-1*o,0]);return Nn([0,o],[0,s])(l)}function Nn(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Ln(e,t){return e>0&&e<t}var jn=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function In(e,t){const n=en(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Rn(e,t){const n=en(t);Yt(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Fn=ln,Dn=un,Bn=En;const zn=x.forwardRef((e,t)=>{var n=e,{className:r,children:i}=n,a=u(n,["className","children"]);return b.jsxs(Fn,c(l({ref:t,className:kt("relative overflow-hidden",r)},a),{children:[b.jsx(Dn,{className:"h-full w-full rounded-[inherit]",children:i}),b.jsx(Un,{}),b.jsx(Bn,{})]}))});zn.displayName=Fn.displayName;const Un=x.forwardRef((e,t)=>{var n=e,{className:r,orientation:i="vertical"}=n,a=u(n,["className","orientation"]);return b.jsx(fn,c(l({ref:t,orientation:i,className:kt("flex touch-none select-none transition-colors","vertical"===i&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===i&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",r)},a),{children:b.jsx(_n,{className:"relative flex-1 rounded-full",style:{backgroundColor:"var(--widget-border, #E5E7EB)"}})}))});function Vn({messages:e,streamingContent:t,isStreaming:n,className:r}){const i=x.useRef(null);return x.useEffect(()=>{var e;null==(e=i.current)||e.scrollIntoView({behavior:"smooth"})},[e,t]),b.jsx(zn,{className:kt("flex-1 px-4",r),children:b.jsxs("div",{className:"py-4 space-y-4",children:[e.map(e=>b.jsx($n,{message:e},e.id)),n&&t&&b.jsx($n,{message:{type:"assistant",text:t,isStreaming:!0}}),b.jsx("div",{ref:i})]})})}function $n({message:e}){const t="user"===e.type;e.type;const n="system"===e.type;return"separator"===e.type?b.jsx("div",{className:"flex items-center justify-center py-2",children:b.jsx("div",{className:"px-3 py-1 rounded-full text-xs",style:{backgroundColor:"var(--widget-system-message-bg, #F3F4F6)",color:"var(--widget-system-message-text, #6B7280)"},children:e.text})}):n?b.jsx("div",{className:"flex justify-center",children:b.jsx("div",{className:"max-w-[85%] px-4 py-2 rounded-lg text-sm",style:{backgroundColor:"var(--widget-system-message-bg, #FEF3C7)",color:"var(--widget-system-message-text, #92400E)"},children:e.text})}):b.jsx("div",{className:kt("flex",t?"justify-end":"justify-start"),children:b.jsxs("div",{className:kt("max-w-[85%] px-4 py-3 rounded-2xl text-sm leading-relaxed",t?"rounded-br-md":"rounded-bl-md",e.isTranscript&&"italic opacity-80"),style:{backgroundColor:t?"var(--widget-user-message-bg, #3B82F6)":"var(--widget-bot-message-bg, #F3F4F6)",color:t?"var(--widget-user-message-text, #FFFFFF)":"var(--widget-bot-message-text, #111827)"},children:[e.text,e.isStreaming&&b.jsx("span",{className:"inline-block w-2 h-4 ml-1 animate-pulse bg-current opacity-50"})]})})}function Wn({onSend:e,disabled:t,placeholder:n="Type a message...",className:r}){const[i,a]=x.useState(""),o=x.useRef(null),s=n=>{var r;n.preventDefault(),i.trim()&&!t&&(e(i.trim()),a(""),null==(r=o.current)||r.focus())};return b.jsxs("form",{onSubmit:s,className:kt("flex items-center gap-2 p-4 pb-safe",r),style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",backgroundColor:"var(--widget-background, #FFFFFF)"},children:[b.jsx("input",{ref:o,type:"text",value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),s(e))},placeholder:n,disabled:t,className:"flex-1 h-11 px-4 rounded-full outline-none transition-all",style:{backgroundColor:"var(--widget-input-bg, #F9FAFB)",color:"var(--widget-input-text, #111827)",border:"1px solid var(--widget-input-border, #E5E7EB)",fontFamily:"var(--widget-font-family, inherit)",fontSize:"var(--widget-font-size-base, 14px)"}}),b.jsx(Ct,{type:"submit",variant:"default",size:"icon",disabled:!i.trim()||t,className:"shrink-0 rounded-full h-11 w-11",children:b.jsx(Bt,{className:"h-5 w-5"})})]})}function qn(e,t,n={}){const{chatSession:r,messages:i,isChatInitialized:a,isStreaming:o,streamingContent:s,setChatSession:u,addMessage:f,setStreaming:p}=H(),h=x.useRef(null),m=x.useRef(null),g=x.useRef(!1),v=x.useCallback(()=>d(null,null,function*(){if(!g.current&&!a&&e&&t){g.current=!0;try{G("🔍 Initializing chat session for agent:",e);const n=yield function(e,t){return d(this,null,function*(){G("🔍 Initializing chat session for agent:",e);const n=yield X(`v1/widgets/chat/sessions?agent_id=${e}`,{method:"POST",headers:{"X-Prompt-Token":t}});return G("✅ Chat session initialized:",n.session_id),n})}(e,t);G("✅ Chat session initialized:",n),u(n),m.current=n.session_id,n.first_message&&f({type:"assistant",text:n.first_message,isTranscript:!1})}catch(n){Q("❌ Failed to initialize chat:",n),f({type:"system",text:`Error: ${n.message}`})}}else G("⏭️ Chat already initialized or initializing, skipping")}),[e,t,a,u,f]),y=x.useCallback(i=>d(null,null,function*(){if(i.trim()&&!o){f({type:"user",text:i,isTranscript:!1});try{h.current=new AbortController,p(!0,""),G("📤 Sending message:",{agentId:e,sessionId:m.current,message:i.substring(0,50)+"..."});const a=yield function(e,t,n,r,i){return d(this,null,function*(){const a=`${K}/v1/widgets/chat/messages`;G("📤 Sending chat message:",n.substring(0,50)+"...");const o=yield fetch(a,{method:"POST",headers:{"Content-Type":"application/json","X-Prompt-Token":i},body:JSON.stringify({agent_id:e,session_id:t,message:n,metadata:r})});if(!o.ok){const e=yield o.text();throw new Error(`Server error (${o.status}): ${e||"Unknown error"}`)}return{response:o,sessionId:o.headers.get("X-Session-ID")}})}(e,m.current||(null==r?void 0:r.session_id),i,c(l({},n),{agent_id:e}),t);a.sessionId&&(m.current=a.sessionId);const o=a.response.body.getReader(),s=new TextDecoder;let u="";try{for(;;){const{done:e,value:t}=yield o.read();if(e)break;u+=s.decode(t,{stream:!0}),p(!0,u)}}finally{o.releaseLock()}u.trim()&&f({type:"assistant",text:u,isTranscript:!1}),p(!1,""),G("✅ Message sent successfully")}catch(a){"AbortError"!==a.name&&(Q("❌ Failed to send message:",a),f({type:"system",text:`Error: ${a.message}`})),p(!1,"")}}}),[e,t,r,n,o,f,p]),b=x.useCallback(()=>{h.current&&(h.current.abort(),p(!1,""))},[p]);return{messages:i,isStreaming:o,streamingContent:s,isInitialized:a,initializeChat:v,sendMessage:y,cancelStream:b}}function Hn({agentId:e,agentName:t,promptToken:n,metadata:r,onClose:i,onSwitchToTalk:a,className:o}){const{messages:s,isStreaming:l,streamingContent:c,isInitialized:u,initializeChat:d,sendMessage:f}=qn(e,n,r);return x.useEffect(()=>{!u&&n&&d()},[u,n,d]),b.jsxs("div",{className:kt("flex flex-col h-full w-full animate-fade-in",o),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{backgroundColor:"var(--widget-header-bg, #F9FAFB)",borderBottom:"1px solid var(--widget-header-border, #E5E7EB)"},children:[b.jsx("button",{onClick:i,className:"p-2 rounded-full hover:opacity-80 transition-opacity",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(zt,{className:"h-5 w-5"})}),b.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--widget-header-text, #111827)"},children:t}),b.jsx(Ct,{onClick:a,variant:"ghost",size:"icon-sm",className:"rounded-full",title:"Switch to voice",children:b.jsx(Ft,{className:"h-5 w-5",style:{color:"var(--widget-icon-active, #3B82F6)"}})})]}),b.jsx(Vn,{messages:s,streamingContent:c,isStreaming:l,className:"flex-1"}),b.jsx(Wn,{onSend:f,disabled:l,placeholder:"Type a message..."})]})}Un.displayName=fn.displayName;const Jn={sm:48,md:80,lg:120,xl:160,"2xl":200},Gn=x.forwardRef((e,t)=>{var n=e,{children:r,loading:i=!0,size:a="lg",strokeWidth:o=4,gap:s=8,trackColor:d,spinnerColor:f,duration:p=1.5,className:h}=n,m=u(n,["children","loading","size","strokeWidth","gap","trackColor","spinnerColor","duration","className"]);const g="string"==typeof a?Jn[a]||120:a,v=(g-o)/2,y=2*Math.PI*v,w=g/2,k=g-2*s-2*o,S=x.useId(),_=`\n @keyframes loader-spin-${S.replace(/:/g,"")} {\n 0% {\n transform: rotate(-90deg);\n }\n 100% {\n transform: rotate(270deg);\n }\n }\n \n @keyframes loader-dash-${S.replace(/:/g,"")} {\n 0% {\n stroke-dashoffset: ${y};\n }\n 50% {\n stroke-dashoffset: ${.25*y};\n }\n 100% {\n stroke-dashoffset: ${y};\n }\n }\n `;return b.jsxs("div",c(l({ref:t,className:kt("relative inline-flex items-center justify-center",h),style:{width:g,height:g}},m),{children:[i&&b.jsx("style",{children:_}),i&&b.jsxs("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",viewBox:`0 0 ${g} ${g}`,"aria-hidden":"true",children:[b.jsx("circle",{cx:w,cy:w,r:v,fill:"none",stroke:d||"var(--widget-border, #E5E7EB)",strokeWidth:o}),b.jsx("circle",{cx:w,cy:w,r:v,fill:"none",stroke:f||"var(--widget-primary-color, #3B82F6)",strokeWidth:o,strokeLinecap:"round",strokeDasharray:y,strokeDashoffset:.25*y,style:{transformOrigin:"center",animation:`loader-spin-${S.replace(/:/g,"")} ${p}s linear infinite, loader-dash-${S.replace(/:/g,"")} ${1.33*p}s ease-in-out infinite`}})]}),b.jsx("div",{className:"relative z-10 flex items-center justify-center overflow-hidden rounded-full",style:{width:k,height:k},children:r})]}))});Gn.displayName="Loader";x.forwardRef((e,t)=>{var n=e,{size:r="md",strokeWidth:i=3,color:a,trackColor:o,duration:s=1,className:d}=n,f=u(n,["size","strokeWidth","color","trackColor","duration","className"]);const p="string"==typeof r?{xs:16,sm:20,md:24,lg:32,xl:40}[r]||24:r,h=(p-i)/2,m=2*Math.PI*h,g=p/2,v=x.useId(),y=`\n @keyframes simple-spin-${v.replace(/:/g,"")} {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n `;return b.jsxs("span",c(l({ref:t,className:kt("inline-flex items-center justify-center",d),role:"status","aria-label":"Loading"},f),{children:[b.jsx("style",{children:y}),b.jsxs("svg",{width:p,height:p,viewBox:`0 0 ${p} ${p}`,fill:"none",style:{animation:`simple-spin-${v.replace(/:/g,"")} ${s}s linear infinite`},children:[o&&b.jsx("circle",{cx:g,cy:g,r:h,stroke:o,strokeWidth:i,fill:"none",opacity:.25}),b.jsx("circle",{cx:g,cy:g,r:h,stroke:a||"var(--widget-primary-color, #3B82F6)",strokeWidth:i,strokeLinecap:"round",fill:"none",strokeDasharray:m,strokeDashoffset:.75*m})]}),b.jsx("span",{className:"sr-only",children:"Loading..."})]}))}).displayName="SpinnerLoader";function Qn(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kn(e){return(Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xn(e){var t=function(e){if("object"!=Kn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Kn(t)?t:t+""}function Zn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xn(r.key),r)}}function er(e,t,n){return t&&Zn(e.prototype,t),n&&Zn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tr(e,t){if(t&&("object"==Kn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function nr(e){return(nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rr(e,t){return(rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ir(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rr(e,t)}function ar(e,t,n){return(t=Xn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function or(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function sr(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){or(a,r,i,o,s,"next",e)}function s(e){or(a,r,i,o,s,"throw",e)}o(void 0)})}}function lr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return lr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}x.forwardRef((e,t)=>{var n=e,{dotSize:r=8,gap:i=6,color:a,duration:o=1.4,className:s}=n,d=u(n,["dotSize","gap","color","duration","className"]);const f=x.useId(),p=`\n @keyframes dots-bounce-${f.replace(/:/g,"")} {\n 0%, 80%, 100% {\n transform: scale(0.6);\n opacity: 0.5;\n }\n 40% {\n transform: scale(1);\n opacity: 1;\n }\n }\n `;return b.jsxs("span",c(l({ref:t,className:kt("inline-flex items-center",s),style:{gap:i},role:"status","aria-label":"Loading"},d),{children:[b.jsx("style",{children:p}),[0,1,2].map(e=>b.jsx("span",{style:{width:r,height:r,borderRadius:"50%",backgroundColor:a||"var(--widget-primary-color, #3B82F6)",animation:`dots-bounce-${f.replace(/:/g,"")} ${o}s ease-in-out infinite`,animationDelay:e*(o/3)+"s"}},e)),b.jsx("span",{className:"sr-only",children:"Loading..."})]}))}).displayName="DotsLoader";var ur,dr,fr={exports:{}},pr=function(){if(ur)return fr.exports;ur=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}fr.exports=i,fr.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}var o,s;h(e,t,a,{once:!0}),"error"!==t&&(s=i,"function"==typeof(o=e).on&&h(o,"error",s,{once:!0}))})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,a,l,c;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),l=a[t]),void 0===l)l=a[t]=n,++e._eventsCount;else if("function"==typeof l?l=a[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),(i=s(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,c=u,console&&console.warn&&console.warn(c)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return o(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},fr.exports}(),hr=(dr=pr)&&dr.__esModule&&Object.prototype.hasOwnProperty.call(dr,"default")?dr.default:dr,mr=Object.prototype.hasOwnProperty;function gr(e,t,n){for(n of e.keys())if(vr(n,t))return n}function vr(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&vr(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((i=r)&&"object"==typeof i&&!(i=gr(t,i)))return!1;if(!t.has(i))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((i=r[0])&&"object"==typeof i&&!(i=gr(t,i)))return!1;if(!vr(r[1],t.get(i)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(mr.call(e,n)&&++r&&!mr.call(t,n))return!1;if(!(n in t)||!vr(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}const yr={"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"},br={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"},wr={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},kr={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"},Sr={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class _r{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=_r.getVersionPrecision(e),i=_r.getVersionPrecision(t);let a=Math.max(r,i),o=0;const s=_r.map([e,t],e=>{const t=a-_r.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return _r.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(o=a-Math.min(r,i)),a-=1;a>=o;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===o)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;r+=1){const e=t[r];"object"==typeof e&&null!==e&&Object.keys(e).forEach(t=>{n[t]=e[t]})}return e}static getBrowserAlias(e){return yr[e]}static getBrowserTypeByAlias(e){return br[e]||""}}const xr=/version\/(\d+(\.?_?\d+)+)/i,Cr=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=_r.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=_r.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=_r.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=_r.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=_r.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=_r.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=_r.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=_r.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=_r.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=_r.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=_r.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=_r.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=_r.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=_r.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=_r.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=_r.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=_r.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=_r.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=_r.getFirstMatch(xr,e)||_r.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=_r.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=_r.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=_r.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=_r.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=_r.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=_r.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=_r.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=_r.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=_r.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=_r.getFirstMatch(xr,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:_r.getFirstMatch(t,e),version:_r.getSecondMatch(t,e)}}}];var Er=[{test:[/Roku\/DVP/],describe(e){const t=_r.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:kr.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=_r.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:kr.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=_r.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=_r.getWindowsVersionName(t);return{name:kr.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:kr.iOS},n=_r.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=_r.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=_r.getMacOSVersionName(t),r={name:kr.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=_r.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:kr.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=_r.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=_r.getAndroidVersionName(t),r={name:kr.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=_r.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:kr.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=_r.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||_r.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||_r.getFirstMatch(/\bbb(\d+)/i,e);return{name:kr.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=_r.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:kr.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=_r.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:kr.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:kr.Linux})},{test:[/CrOS/],describe:()=>({name:kr.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=_r.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:kr.PlayStation4,version:t}}}],Tr=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=_r.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:wr.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:wr.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:wr.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:wr.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:wr.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:wr.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:wr.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=_r.getFirstMatch(/(ipod|iphone)/i,e);return{type:wr.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:wr.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:wr.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:wr.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:wr.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:wr.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:wr.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:wr.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:wr.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:wr.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:wr.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:wr.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:wr.tv})}],Mr=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Sr.Blink};const t=_r.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Sr.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Sr.Trident},n=_r.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Sr.Presto},n=_r.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:Sr.Gecko},n=_r.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Sr.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Sr.WebKit},n=_r.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class Pr{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=_r.find(Cr,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=_r.find(Er,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=_r.find(Tr,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=_r.find(Mr,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return _r.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach(a=>{const o=e[a];"string"==typeof o?(r[a]=o,i+=1):"object"==typeof o&&(t[a]=o,n+=1)}),n>0){const e=Object.keys(t),n=_r.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=_r.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=_r.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const i=_r.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(_r.compareVersions(i,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
36
+ */function Dt({agentName:e,avatarUrl:t,tncEnabled:n,tncContent:r,onTalk:i,onChat:a,onClose:o,className:s}){const[l,c]=x.useState(!n||!r),[u,d]=x.useState(n&&r),f=x.useRef(null),p=x.useCallback(e=>{const t=e.target;t.scrollHeight-t.scrollTop<=t.clientHeight+20&&(c(!0),d(!1))},[]),h=x.useCallback(e=>{e&&(f.current=e,setTimeout(()=>{e.scrollHeight>e.clientHeight||(c(!0),d(!1))},100))},[]);return b.jsxs("div",{className:yt("flex flex-col h-full w-full animate-fade-in relative min-h-0",s),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsx("button",{onClick:o,className:"absolute top-4 right-4 p-2 rounded-full hover:opacity-80 transition-opacity z-10",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(Ft,{className:"h-6 w-6"})}),b.jsx("div",{ref:h,onScroll:p,className:"flex-1 min-h-0 overflow-y-auto",children:b.jsxs("div",{className:"flex flex-col items-center px-6 py-8 pt-14",children:[b.jsx(_t,{src:t,alt:e,size:"2xl",className:"mb-6 shadow-lg"}),b.jsx("h1",{className:"text-2xl font-semibold mb-2 text-center",style:{color:"var(--widget-text-primary, #111827)"},children:"Welcome!"}),b.jsxs("p",{className:"text-lg mb-6 text-center",style:{color:"var(--widget-text-secondary, #6B7280)"},children:["I'm ",b.jsx("span",{className:"font-medium",children:e})]}),n&&r&&b.jsx("div",{className:"w-full max-w-md mb-6 p-4 rounded-lg",style:{backgroundColor:"var(--widget-background-secondary, #F9FAFB)",border:"1px solid var(--widget-border, #E5E7EB)"},children:b.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",style:{color:"var(--widget-text-secondary, #6B7280)"},children:r})}),n&&b.jsx("p",{className:"text-xs mb-8 text-center max-w-sm",style:{color:"var(--widget-text-muted, #9CA3AF)"},children:"By continuing, you agree to the terms above."})]})}),u&&b.jsxs("div",{className:"flex flex-col items-center py-2 pointer-events-none",style:{background:"linear-gradient(transparent, var(--widget-background, #FFFFFF) 30%)"},children:[b.jsx(At,{className:"h-5 w-5 animate-bounce",style:{color:"var(--widget-primary-color, #3B82F6)"}}),b.jsx("span",{className:"text-xs",style:{color:"var(--widget-primary-color, #3B82F6)"},children:"Scroll to continue"})]}),b.jsx("div",{className:"p-6 pb-safe shrink-0",style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",paddingBottom:"max(1.5rem, env(safe-area-inset-bottom, 0px))"},children:b.jsxs("div",{className:"flex gap-4 max-w-md mx-auto",children:[b.jsxs(St,{onClick:i,variant:"default",size:"xl",className:"flex-1",disabled:!l,children:[b.jsx(jt,{className:"h-5 w-5"}),"Talk"]}),b.jsxs(St,{onClick:a,variant:"secondary",size:"xl",className:"flex-1",disabled:!l,children:[b.jsx(Nt,{className:"h-5 w-5"}),"Chat"]})]})})]})}function Bt(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function zt(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Bt(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Bt(e[t],null)}}}}function Ut(...e){return x.useCallback(zt(...e),e)}function Vt(e){const t=$t(e),n=x.forwardRef((e,n)=>{const r=e,{children:i}=r,a=u(r,["children"]),o=x.Children.toArray(i),s=o.find(qt);if(s){const e=s.props.children,r=o.map(t=>t===s?x.Children.count(e)>1?x.Children.only(null):x.isValidElement(e)?e.props.children:null:t);return b.jsx(t,c(l({},a),{ref:n,children:x.isValidElement(e)?x.cloneElement(e,void 0,r):null}))}return b.jsx(t,c(l({},a),{ref:n,children:i}))});return n.displayName=`${e}.Slot`,n}function $t(e){const t=x.forwardRef((e,t)=>{const n=e,{children:r}=n,i=u(n,["children"]);if(x.isValidElement(r)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,i=r&&"isReactWarning"in r&&r.isReactWarning;if(i)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i)return e.props.ref;return e.props.ref||e.ref}(r),n=function(e,t){const n=l({},t);for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{const t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]=l(l({},i),a):"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return l(l({},e),n)}(i,r.props);return r.type!==x.Fragment&&(n.ref=t?zt(t,e):e),x.cloneElement(r,n)}return x.Children.count(r)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}z();var Wt=Symbol("radix.slottable");function qt(e){return x.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Wt}var Ht=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Vt(`Primitive.${t}`),r=x.forwardRef((e,r)=>{const i=e,{asChild:a}=i,o=u(i,["asChild"]),s=a?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),b.jsx(s,c(l({},o),{ref:r}))});return r.displayName=`Primitive.${t}`,c(l({},e),{[t]:r})},{}),Jt=(null==globalThis?void 0:globalThis.document)?x.useLayoutEffect:()=>{};var Qt=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[s,l]=function(e,t){return x.useReducer((e,n)=>{const r=t[e][n];return null!=r?r:e},e)}(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const e=Gt(r.current);a.current="mounted"===s?e:"none"},[s]),Jt(()=>{const t=r.current,n=i.current;if(n!==e){const r=a.current,o=Gt(t);if(e)l("MOUNT");else if("none"===o||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,l]),Jt(()=>{var e;if(t){let n;const o=null!=(e=t.ownerDocument.defaultView)?e:window,s=e=>{const a=Gt(r.current).includes(CSS.escape(e.animationName));if(e.target===t&&a&&(l("ANIMATION_END"),!i.current)){const e=t.style.animationFillMode;t.style.animationFillMode="forwards",n=o.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=e)})}},c=e=>{e.target===t&&(a.current=Gt(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{o.clearTimeout(n),t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:x.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),i="function"==typeof n?n({present:r.isPresent}):x.Children.only(n),a=Ut(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,i=r&&"isReactWarning"in r&&r.isReactWarning;if(i)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof n||r.isPresent?x.cloneElement(i,{ref:a}):null};function Gt(e){return(null==e?void 0:e.animationName)||"none"}function Yt(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>{const i=n(e)[`__scope${r}`];return l(l({},t),i)},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Kt(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}Qt.displayName="Presence";var Xt=x.createContext(void 0);function Zt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}var en="ScrollArea",[tn]=function(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>x.createContext(e));return function(n){const r=(null==n?void 0:n[e])||t;return x.useMemo(()=>({[`__scope${e}`]:c(l({},n),{[e]:r})}),[n,r])}};return r.scopeName=e,[function(t,r){const i=x.createContext(r),a=n.length;n=[...n,r];const o=t=>{var n;const r=t,{scope:o,children:s}=r,l=u(r,["scope","children"]),c=(null==(n=null==o?void 0:o[e])?void 0:n[a])||i,d=x.useMemo(()=>l,Object.values(l));return b.jsx(c.Provider,{value:d,children:s})};return o.displayName=t+"Provider",[o,function(n,o){var s;const l=(null==(s=null==o?void 0:o[e])?void 0:s[a])||i,c=x.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Yt(r,...t)]}(en),[nn,rn]=tn(en),an=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,type:i="hover",dir:a,scrollHideDelay:o=600}=n,s=u(n,["__scopeScrollArea","type","dir","scrollHideDelay"]),[d,f]=x.useState(null),[p,h]=x.useState(null),[m,g]=x.useState(null),[v,y]=x.useState(null),[w,k]=x.useState(null),[S,_]=x.useState(0),[E,C]=x.useState(0),[T,M]=x.useState(!1),[P,A]=x.useState(!1),O=Ut(t,e=>f(e)),N=function(e){const t=x.useContext(Xt);return e||t||"ltr"}(a);return b.jsx(nn,{scope:r,type:i,dir:N,scrollHideDelay:o,scrollArea:d,viewport:p,onViewportChange:h,content:m,onContentChange:g,scrollbarX:v,onScrollbarXChange:y,scrollbarXEnabled:T,onScrollbarXEnabledChange:M,scrollbarY:w,onScrollbarYChange:k,scrollbarYEnabled:P,onScrollbarYEnabledChange:A,onCornerWidthChange:_,onCornerHeightChange:C,children:b.jsx(Ht.div,c(l({dir:N},s),{ref:O,style:l({position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":E+"px"},e.style)}))})});an.displayName=en;var on="ScrollAreaViewport",sn=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,children:i,nonce:a}=n,o=u(n,["__scopeScrollArea","children","nonce"]),s=rn(on,r),d=Ut(t,x.useRef(null),s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),b.jsx(Ht.div,c(l({"data-radix-scroll-area-viewport":""},o),{ref:d,style:l({overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden"},e.style),children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:i})}))]})});sn.displayName=on;var ln="ScrollAreaScrollbar",cn=x.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=rn(ln,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=a,d="horizontal"===e.orientation;return x.useEffect(()=>(d?o(!0):s(!0),()=>{d?o(!1):s(!1)}),[d,o,s]),"hover"===a.type?b.jsx(un,c(l({},i),{ref:t,forceMount:r})):"scroll"===a.type?b.jsx(dn,c(l({},i),{ref:t,forceMount:r})):"auto"===a.type?b.jsx(fn,c(l({},i),{ref:t,forceMount:r})):"always"===a.type?b.jsx(pn,c(l({},i),{ref:t})):null});cn.displayName=ln;var un=x.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=rn(ln,e.__scopeScrollArea),[o,s]=x.useState(!1);return x.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),s(!0)},r=()=>{t=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[a.scrollArea,a.scrollHideDelay]),b.jsx(Qt,{present:r||o,children:b.jsx(fn,c(l({"data-state":o?"visible":"hidden"},i),{ref:t}))})}),dn=x.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=rn(ln,e.__scopeScrollArea),o="horizontal"===e.orientation,s=Nn(()=>f("SCROLL_END"),100),[d,f]=(p="hidden",h={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},x.useReducer((e,t)=>{const n=h[e][t];return null!=n?n:e},p));var p,h;return x.useEffect(()=>{if("idle"===d){const e=window.setTimeout(()=>f("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[d,a.scrollHideDelay,f]),x.useEffect(()=>{const e=a.viewport,t=o?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(f("SCROLL"),s()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[a.viewport,o,f,s]),b.jsx(Qt,{present:r||"hidden"!==d,children:b.jsx(pn,c(l({"data-state":"hidden"===d?"hidden":"visible"},i),{ref:t,onPointerEnter:Zt(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Zt(e.onPointerLeave,()=>f("POINTER_LEAVE"))}))})}),fn=x.forwardRef((e,t)=>{const n=rn(ln,e.__scopeScrollArea),r=e,{forceMount:i}=r,a=u(r,["forceMount"]),[o,s]=x.useState(!1),d="horizontal"===e.orientation,f=Nn(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;s(d?e:t)}},10);return Ln(n.viewport,f),Ln(n.content,f),b.jsx(Qt,{present:i||o,children:b.jsx(pn,c(l({"data-state":o?"visible":"hidden"},a),{ref:t}))})}),pn=x.forwardRef((e,t)=>{const n=e,{orientation:r="vertical"}=n,i=u(n,["orientation"]),a=rn(ln,e.__scopeScrollArea),o=x.useRef(null),s=x.useRef(0),[d,f]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=Cn(d.viewport,d.content),h=c(l({},i),{sizes:d,onSizesChange:f,hasThumb:Boolean(p>0&&p<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:e=>s.current=e});function m(e,t){return function(e,t,n,r="ltr"){const i=Tn(n),a=i/2,o=t||a,s=i-o,l=n.scrollbar.paddingStart+o,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d="ltr"===r?[0,u]:[-1*u,0];return Pn([l,c],d)(e)}(e,s.current,d,t)}return"horizontal"===r?b.jsx(hn,c(l({},h),{ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=Mn(a.viewport.scrollLeft,d,a.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=m(e,a.dir))}})):"vertical"===r?b.jsx(mn,c(l({},h),{ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const e=Mn(a.viewport.scrollTop,d);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=m(e))}})):null}),hn=x.forwardRef((e,t)=>{const n=e,{sizes:r,onSizesChange:i}=n,a=u(n,["sizes","onSizesChange"]),o=rn(ln,e.__scopeScrollArea),[s,d]=x.useState(),f=x.useRef(null),p=Ut(t,f,o.onScrollbarXChange);return x.useEffect(()=>{f.current&&d(getComputedStyle(f.current))},[f]),b.jsx(yn,c(l({"data-orientation":"horizontal"},a),{ref:p,sizes:r,style:l({bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Tn(r)+"px"},e.style),onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),An(r,n)&&t.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&i({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:En(s.paddingLeft),paddingEnd:En(s.paddingRight)}})}}))}),mn=x.forwardRef((e,t)=>{const n=e,{sizes:r,onSizesChange:i}=n,a=u(n,["sizes","onSizesChange"]),o=rn(ln,e.__scopeScrollArea),[s,d]=x.useState(),f=x.useRef(null),p=Ut(t,f,o.onScrollbarYChange);return x.useEffect(()=>{f.current&&d(getComputedStyle(f.current))},[f]),b.jsx(yn,c(l({"data-orientation":"vertical"},a),{ref:p,sizes:r,style:l({top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Tn(r)+"px"},e.style),onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){const r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),An(r,n)&&t.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&i({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:En(s.paddingTop),paddingEnd:En(s.paddingBottom)}})}}))}),[gn,vn]=tn(ln),yn=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,sizes:i,hasThumb:a,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:d,onThumbPositionChange:f,onDragScroll:p,onWheelScroll:h,onResize:m}=n,g=u(n,["__scopeScrollArea","sizes","hasThumb","onThumbChange","onThumbPointerUp","onThumbPointerDown","onThumbPositionChange","onDragScroll","onWheelScroll","onResize"]),v=rn(ln,r),[y,w]=x.useState(null),k=Ut(t,e=>w(e)),S=x.useRef(null),_=x.useRef(""),E=v.viewport,C=i.content-i.viewport,T=Kt(h),M=Kt(f),P=Nn(m,10);function A(e){if(S.current){const t=e.clientX-S.current.left,n=e.clientY-S.current.top;p({x:t,y:n})}}return x.useEffect(()=>{const e=e=>{const t=e.target;(null==y?void 0:y.contains(t))&&T(e,C)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[E,y,C,T]),x.useEffect(M,[i,M]),Ln(y,P),Ln(v.content,P),b.jsx(gn,{scope:r,scrollbar:y,hasThumb:a,onThumbChange:Kt(o),onThumbPointerUp:Kt(s),onThumbPositionChange:M,onThumbPointerDown:Kt(d),children:b.jsx(Ht.div,c(l({},g),{ref:k,style:l({position:"absolute"},g.style),onPointerDown:Zt(e.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),S.current=y.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),A(e)}}),onPointerMove:Zt(e.onPointerMove,A),onPointerUp:Zt(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=_.current,v.viewport&&(v.viewport.style.scrollBehavior=""),S.current=null})}))})}),bn="ScrollAreaThumb",wn=x.forwardRef((e,t)=>{const n=e,{forceMount:r}=n,i=u(n,["forceMount"]),a=vn(bn,e.__scopeScrollArea);return b.jsx(Qt,{present:r||a.hasThumb,children:b.jsx(kn,l({ref:t},i))})}),kn=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r,style:i}=n,a=u(n,["__scopeScrollArea","style"]),o=rn(bn,r),s=vn(bn,r),{onThumbPositionChange:d}=s,f=Ut(t,e=>s.onThumbChange(e)),p=x.useRef(void 0),h=Nn(()=>{p.current&&(p.current(),p.current=void 0)},100);return x.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(h(),!p.current){const t=On(e,d);p.current=t,d()}};return d(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,h,d]),b.jsx(Ht.div,c(l({"data-state":s.hasThumb?"visible":"hidden"},a),{ref:f,style:l({width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)"},i),onPointerDownCapture:Zt(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;s.onThumbPointerDown({x:n,y:r})}),onPointerUp:Zt(e.onPointerUp,s.onThumbPointerUp)}))});wn.displayName=bn;var Sn="ScrollAreaCorner",_n=x.forwardRef((e,t)=>{const n=rn(Sn,e.__scopeScrollArea),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?b.jsx(xn,c(l({},e),{ref:t})):null});_n.displayName=Sn;var xn=x.forwardRef((e,t)=>{const n=e,{__scopeScrollArea:r}=n,i=u(n,["__scopeScrollArea"]),a=rn(Sn,r),[o,s]=x.useState(0),[d,f]=x.useState(0),p=Boolean(o&&d);return Ln(a.scrollbarX,()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),f(t)}),Ln(a.scrollbarY,()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),s(t)}),p?b.jsx(Ht.div,c(l({},i),{ref:t,style:l({width:o,height:d,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0},e.style)})):null});function En(e){return e?parseInt(e,10):0}function Cn(e,t){const n=e/t;return isNaN(n)?0:n}function Tn(e){const t=Cn(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Mn(e,t,n="ltr"){const r=Tn(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,l=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,"ltr"===n?[0,o]:[-1*o,0]);return Pn([0,o],[0,s])(l)}function Pn(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function An(e,t){return e>0&&e<t}var On=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Nn(e,t){const n=Kt(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ln(e,t){const n=Kt(t);Jt(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var jn=an,In=sn,Rn=_n;const Fn=x.forwardRef((e,t)=>{var n=e,{className:r,children:i}=n,a=u(n,["className","children"]);return b.jsxs(jn,c(l({ref:t,className:yt("relative overflow-hidden",r)},a),{children:[b.jsx(In,{className:"h-full w-full rounded-[inherit]",children:i}),b.jsx(Dn,{}),b.jsx(Rn,{})]}))});Fn.displayName=jn.displayName;const Dn=x.forwardRef((e,t)=>{var n=e,{className:r,orientation:i="vertical"}=n,a=u(n,["className","orientation"]);return b.jsx(cn,c(l({ref:t,orientation:i,className:yt("flex touch-none select-none transition-colors","vertical"===i&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===i&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",r)},a),{children:b.jsx(wn,{className:"relative flex-1 rounded-full",style:{backgroundColor:"var(--widget-border, #E5E7EB)"}})}))});function Bn({messages:e,streamingContent:t,isStreaming:n,className:r}){const i=x.useRef(null);return x.useEffect(()=>{var e;null==(e=i.current)||e.scrollIntoView({behavior:"smooth"})},[e,t]),b.jsx(Fn,{className:yt("flex-1 px-4",r),children:b.jsxs("div",{className:"py-4 space-y-4",children:[e.map(e=>b.jsx(zn,{message:e},e.id)),n&&t&&b.jsx(zn,{message:{type:"assistant",text:t,isStreaming:!0}}),b.jsx("div",{ref:i})]})})}function zn({message:e}){const t="user"===e.type;e.type;const n="system"===e.type;return"separator"===e.type?b.jsx("div",{className:"flex items-center justify-center py-2",children:b.jsx("div",{className:"px-3 py-1 rounded-full text-xs",style:{backgroundColor:"var(--widget-system-message-bg, #F3F4F6)",color:"var(--widget-system-message-text, #6B7280)"},children:e.text})}):n?b.jsx("div",{className:"flex justify-center",children:b.jsx("div",{className:"max-w-[85%] px-4 py-2 rounded-lg text-sm",style:{backgroundColor:"var(--widget-system-message-bg, #FEF3C7)",color:"var(--widget-system-message-text, #92400E)"},children:e.text})}):b.jsx("div",{className:yt("flex",t?"justify-end":"justify-start"),children:b.jsxs("div",{className:yt("max-w-[85%] px-4 py-3 rounded-2xl text-sm leading-relaxed",t?"rounded-br-md":"rounded-bl-md",e.isTranscript&&"italic opacity-80"),style:{backgroundColor:t?"var(--widget-user-message-bg, #3B82F6)":"var(--widget-bot-message-bg, #F3F4F6)",color:t?"var(--widget-user-message-text, #FFFFFF)":"var(--widget-bot-message-text, #111827)"},children:[e.text,e.isStreaming&&b.jsx("span",{className:"inline-block w-2 h-4 ml-1 animate-pulse bg-current opacity-50"})]})})}function Un({onSend:e,disabled:t,placeholder:n="Type a message...",className:r}){const[i,a]=x.useState(""),o=x.useRef(null),s=n=>{var r;n.preventDefault(),i.trim()&&!t&&(e(i.trim()),a(""),null==(r=o.current)||r.focus())};return b.jsxs("form",{onSubmit:s,className:yt("flex items-center gap-2 p-4 pb-safe",r),style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",backgroundColor:"var(--widget-background, #FFFFFF)"},children:[b.jsx("input",{ref:o,type:"text",value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),s(e))},placeholder:n,disabled:t,className:"flex-1 h-11 px-4 rounded-full outline-none transition-all",style:{backgroundColor:"var(--widget-input-bg, #F9FAFB)",color:"var(--widget-input-text, #111827)",border:"1px solid var(--widget-input-border, #E5E7EB)",fontFamily:"var(--widget-font-family, inherit)",fontSize:"var(--widget-font-size-base, 14px)"}}),b.jsx(St,{type:"submit",variant:"default",size:"icon",disabled:!i.trim()||t,className:"shrink-0 rounded-full h-11 w-11",children:b.jsx(Rt,{className:"h-5 w-5"})})]})}function Vn(e,t,n={}){const{chatSession:r,messages:i,isChatInitialized:a,isStreaming:o,streamingContent:s,setChatSession:u,addMessage:f,setStreaming:p}=H(),h=x.useRef(null),m=x.useRef(null),g=x.useRef(!1),v=x.useCallback(()=>d(null,null,function*(){if(!g.current&&!a&&e&&t){g.current=!0;try{const n=yield function(e,t){return d(this,null,function*(){const n=yield G(`v1/widgets/chat/sessions?agent_id=${e}`,{method:"POST",headers:{"X-Prompt-Token":t}});return n.session_id,n})}(e,t);u(n),m.current=n.session_id,n.first_message&&f({type:"assistant",text:n.first_message,isTranscript:!1})}catch(n){f({type:"system",text:`Error: ${n.message}`})}}}),[e,t,a,u,f]),y=x.useCallback(i=>d(null,null,function*(){if(i.trim()&&!o){f({type:"user",text:i,isTranscript:!1});try{h.current=new AbortController,p(!0,""),m.current,i.substring(0,50);const a=yield function(e,t,n,r,i){return d(this,null,function*(){const a=`${Q}/v1/widgets/chat/messages`;n.substring(0,50);const o=yield fetch(a,{method:"POST",headers:{"Content-Type":"application/json","X-Prompt-Token":i},body:JSON.stringify({agent_id:e,session_id:t,message:n,metadata:r})});if(!o.ok){const e=yield o.text();throw new Error(`Server error (${o.status}): ${e||"Unknown error"}`)}return{response:o,sessionId:o.headers.get("X-Session-ID")}})}(e,m.current||(null==r?void 0:r.session_id),i,c(l({},n),{agent_id:e}),t);a.sessionId&&(m.current=a.sessionId);const o=a.response.body.getReader(),s=new TextDecoder;let u="";try{for(;;){const{done:e,value:t}=yield o.read();if(e)break;u+=s.decode(t,{stream:!0}),p(!0,u)}}finally{o.releaseLock()}u.trim()&&f({type:"assistant",text:u,isTranscript:!1}),p(!1,"")}catch(a){"AbortError"!==a.name&&f({type:"system",text:`Error: ${a.message}`}),p(!1,"")}}}),[e,t,r,n,o,f,p]),b=x.useCallback(()=>{h.current&&(h.current.abort(),p(!1,""))},[p]);return{messages:i,isStreaming:o,streamingContent:s,isInitialized:a,initializeChat:v,sendMessage:y,cancelStream:b}}function $n({agentId:e,agentName:t,promptToken:n,metadata:r,onClose:i,onSwitchToTalk:a,className:o}){const{messages:s,isStreaming:l,streamingContent:c,isInitialized:u,initializeChat:d,sendMessage:f}=Vn(e,n,r);return x.useEffect(()=>{!u&&n&&d()},[u,n,d]),b.jsxs("div",{className:yt("flex flex-col h-full w-full animate-fade-in",o),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{backgroundColor:"var(--widget-header-bg, #F9FAFB)",borderBottom:"1px solid var(--widget-header-border, #E5E7EB)"},children:[b.jsx("button",{onClick:i,className:"p-2 rounded-full hover:opacity-80 transition-opacity",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(Ft,{className:"h-5 w-5"})}),b.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--widget-header-text, #111827)"},children:t}),b.jsx(St,{onClick:a,variant:"ghost",size:"icon-sm",className:"rounded-full",title:"Switch to voice",children:b.jsx(jt,{className:"h-5 w-5",style:{color:"var(--widget-icon-active, #3B82F6)"}})})]}),b.jsx(Bn,{messages:s,streamingContent:c,isStreaming:l,className:"flex-1"}),b.jsx(Un,{onSend:f,disabled:l,placeholder:"Type a message..."})]})}Dn.displayName=cn.displayName;const Wn={sm:48,md:80,lg:120,xl:160,"2xl":200},qn=x.forwardRef((e,t)=>{var n=e,{children:r,loading:i=!0,size:a="lg",strokeWidth:o=4,gap:s=8,trackColor:d,spinnerColor:f,duration:p=1.5,className:h}=n,m=u(n,["children","loading","size","strokeWidth","gap","trackColor","spinnerColor","duration","className"]);const g="string"==typeof a?Wn[a]||120:a,v=(g-o)/2,y=2*Math.PI*v,w=g/2,k=g-2*s-2*o,S=x.useId(),_=`\n @keyframes loader-spin-${S.replace(/:/g,"")} {\n 0% {\n transform: rotate(-90deg);\n }\n 100% {\n transform: rotate(270deg);\n }\n }\n \n @keyframes loader-dash-${S.replace(/:/g,"")} {\n 0% {\n stroke-dashoffset: ${y};\n }\n 50% {\n stroke-dashoffset: ${.25*y};\n }\n 100% {\n stroke-dashoffset: ${y};\n }\n }\n `;return b.jsxs("div",c(l({ref:t,className:yt("relative inline-flex items-center justify-center",h),style:{width:g,height:g}},m),{children:[i&&b.jsx("style",{children:_}),i&&b.jsxs("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",viewBox:`0 0 ${g} ${g}`,"aria-hidden":"true",children:[b.jsx("circle",{cx:w,cy:w,r:v,fill:"none",stroke:d||"var(--widget-border, #E5E7EB)",strokeWidth:o}),b.jsx("circle",{cx:w,cy:w,r:v,fill:"none",stroke:f||"var(--widget-primary-color, #3B82F6)",strokeWidth:o,strokeLinecap:"round",strokeDasharray:y,strokeDashoffset:.25*y,style:{transformOrigin:"center",animation:`loader-spin-${S.replace(/:/g,"")} ${p}s linear infinite, loader-dash-${S.replace(/:/g,"")} ${1.33*p}s ease-in-out infinite`}})]}),b.jsx("div",{className:"relative z-10 flex items-center justify-center overflow-hidden rounded-full",style:{width:k,height:k},children:r})]}))});qn.displayName="Loader";x.forwardRef((e,t)=>{var n=e,{size:r="md",strokeWidth:i=3,color:a,trackColor:o,duration:s=1,className:d}=n,f=u(n,["size","strokeWidth","color","trackColor","duration","className"]);const p="string"==typeof r?{xs:16,sm:20,md:24,lg:32,xl:40}[r]||24:r,h=(p-i)/2,m=2*Math.PI*h,g=p/2,v=x.useId(),y=`\n @keyframes simple-spin-${v.replace(/:/g,"")} {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n `;return b.jsxs("span",c(l({ref:t,className:yt("inline-flex items-center justify-center",d),role:"status","aria-label":"Loading"},f),{children:[b.jsx("style",{children:y}),b.jsxs("svg",{width:p,height:p,viewBox:`0 0 ${p} ${p}`,fill:"none",style:{animation:`simple-spin-${v.replace(/:/g,"")} ${s}s linear infinite`},children:[o&&b.jsx("circle",{cx:g,cy:g,r:h,stroke:o,strokeWidth:i,fill:"none",opacity:.25}),b.jsx("circle",{cx:g,cy:g,r:h,stroke:a||"var(--widget-primary-color, #3B82F6)",strokeWidth:i,strokeLinecap:"round",fill:"none",strokeDasharray:m,strokeDashoffset:.75*m})]}),b.jsx("span",{className:"sr-only",children:"Loading..."})]}))}).displayName="SpinnerLoader";function Hn(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qn(e){return(Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gn(e){var t=function(e){if("object"!=Qn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qn(t)?t:t+""}function Yn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gn(r.key),r)}}function Kn(e,t,n){return t&&Yn(e.prototype,t),n&&Yn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xn(e,t){if(t&&("object"==Qn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Zn(e){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function er(e,t){return(er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function tr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&er(e,t)}function nr(e,t,n){return(t=Gn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rr(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function ir(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){rr(a,r,i,o,s,"next",e)}function s(e){rr(a,r,i,o,s,"throw",e)}o(void 0)})}}function ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function or(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ar(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ar(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}x.forwardRef((e,t)=>{var n=e,{dotSize:r=8,gap:i=6,color:a,duration:o=1.4,className:s}=n,d=u(n,["dotSize","gap","color","duration","className"]);const f=x.useId(),p=`\n @keyframes dots-bounce-${f.replace(/:/g,"")} {\n 0%, 80%, 100% {\n transform: scale(0.6);\n opacity: 0.5;\n }\n 40% {\n transform: scale(1);\n opacity: 1;\n }\n }\n `;return b.jsxs("span",c(l({ref:t,className:yt("inline-flex items-center",s),style:{gap:i},role:"status","aria-label":"Loading"},d),{children:[b.jsx("style",{children:p}),[0,1,2].map(e=>b.jsx("span",{style:{width:r,height:r,borderRadius:"50%",backgroundColor:a||"var(--widget-primary-color, #3B82F6)",animation:`dots-bounce-${f.replace(/:/g,"")} ${o}s ease-in-out infinite`,animationDelay:e*(o/3)+"s"}},e)),b.jsx("span",{className:"sr-only",children:"Loading..."})]}))}).displayName="DotsLoader";var sr,lr,cr={exports:{}},ur=function(){if(sr)return cr.exports;sr=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}cr.exports=i,cr.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}var o,s;h(e,t,a,{once:!0}),"error"!==t&&(s=i,"function"==typeof(o=e).on&&h(o,"error",s,{once:!0}))})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,a,l,c;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),l=a[t]),void 0===l)l=a[t]=n,++e._eventsCount;else if("function"==typeof l?l=a[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),(i=s(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,c=u,console&&console.warn&&console.warn(c)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return o(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},cr.exports}(),dr=(lr=ur)&&lr.__esModule&&Object.prototype.hasOwnProperty.call(lr,"default")?lr.default:lr,fr=Object.prototype.hasOwnProperty;function pr(e,t,n){for(n of e.keys())if(hr(n,t))return n}function hr(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&hr(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((i=r)&&"object"==typeof i&&!(i=pr(t,i)))return!1;if(!t.has(i))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((i=r[0])&&"object"==typeof i&&!(i=pr(t,i)))return!1;if(!hr(r[1],t.get(i)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(fr.call(e,n)&&++r&&!fr.call(t,n))return!1;if(!(n in t)||!hr(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}const mr={"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"},gr={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"},vr={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},yr={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"},br={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class wr{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=wr.getVersionPrecision(e),i=wr.getVersionPrecision(t);let a=Math.max(r,i),o=0;const s=wr.map([e,t],e=>{const t=a-wr.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return wr.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(o=a-Math.min(r,i)),a-=1;a>=o;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===o)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;r+=1){const e=t[r];"object"==typeof e&&null!==e&&Object.keys(e).forEach(t=>{n[t]=e[t]})}return e}static getBrowserAlias(e){return mr[e]}static getBrowserTypeByAlias(e){return gr[e]||""}}const kr=/version\/(\d+(\.?_?\d+)+)/i,Sr=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=wr.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=wr.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=wr.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=wr.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=wr.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=wr.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=wr.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=wr.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=wr.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=wr.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=wr.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=wr.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=wr.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=wr.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=wr.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=wr.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=wr.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=wr.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=wr.getFirstMatch(kr,e)||wr.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=wr.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=wr.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=wr.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=wr.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=wr.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=wr.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=wr.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=wr.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=wr.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=wr.getFirstMatch(kr,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:wr.getFirstMatch(t,e),version:wr.getSecondMatch(t,e)}}}];var _r=[{test:[/Roku\/DVP/],describe(e){const t=wr.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:yr.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=wr.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:yr.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=wr.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=wr.getWindowsVersionName(t);return{name:yr.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:yr.iOS},n=wr.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=wr.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=wr.getMacOSVersionName(t),r={name:yr.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=wr.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:yr.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=wr.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=wr.getAndroidVersionName(t),r={name:yr.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=wr.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:yr.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=wr.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||wr.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||wr.getFirstMatch(/\bbb(\d+)/i,e);return{name:yr.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=wr.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:yr.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=wr.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:yr.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:yr.Linux})},{test:[/CrOS/],describe:()=>({name:yr.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=wr.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:yr.PlayStation4,version:t}}}],xr=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=wr.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:vr.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:vr.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:vr.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:vr.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:vr.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:vr.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:vr.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=wr.getFirstMatch(/(ipod|iphone)/i,e);return{type:vr.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:vr.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:vr.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:vr.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:vr.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:vr.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:vr.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:vr.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:vr.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:vr.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:vr.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:vr.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:vr.tv})}],Er=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:br.Blink};const t=wr.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:br.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:br.Trident},n=wr.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:br.Presto},n=wr.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:br.Gecko},n=wr.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:br.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:br.WebKit},n=wr.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class Cr{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=wr.find(Sr,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=wr.find(_r,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=wr.find(xr,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=wr.find(Er,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return wr.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach(a=>{const o=e[a];"string"==typeof o?(r[a]=o,i+=1):"object"==typeof o&&(t[a]=o,n+=1)}),n>0){const e=Object.keys(t),n=wr.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=wr.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=wr.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const i=wr.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(wr.compareVersions(i,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
37
37
  /*!
38
38
  * Bowser - a browser detector
39
39
  * https://github.com/lancedikson/bowser
40
40
  * MIT License | (c) Dustin Diaz 2012-2015
41
41
  * MIT License | (c) Denis Demchenko 2015-2019
42
- */class Ar{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Pr(e,t)}static parse(e){return new Pr(e).getResult()}static get BROWSER_MAP(){return br}static get ENGINE_MAP(){return Sr}static get OS_MAP(){return kr}static get PLATFORMS_MAP(){return wr}}function Or(){return Date.now()+Math.random().toString()}function Nr(){throw new Error("Method must be implemented in subclass")}function Lr(e,t){return null!=t&&t.proxyUrl?t.proxyUrl+("/"===t.proxyUrl.slice(-1)?"":"/")+e.substring(8):e}function jr(e){return null!=e&&e.callObjectBundleUrlOverride?e.callObjectBundleUrlOverride:Lr("https://c.daily.co/call-machine/versioned/".concat("0.84.0","/static/call-machine-object-bundle.js"),e)}function Ir(e){try{new URL(e)}catch(t){return!1}return!0}const Rr="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Fr="8.55.0",Dr=globalThis;function Br(e,t,n){const r=Dr,i=r.__SENTRY__=r.__SENTRY__||{},a=i[Fr]=i[Fr]||{};return a[e]||(a[e]=t())}const zr="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ur=["debug","info","warn","error","log","assert","trace"],Vr={};function $r(e){if(!("console"in Dr))return e();const t=Dr.console,n={},r=Object.keys(Vr);r.forEach(e=>{const r=Vr[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}const Wr=Br("logger",function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return zr?Ur.forEach(n=>{t[n]=(...t)=>{e&&$r(()=>{Dr.console[n](`Sentry Logger [${n}]:`,...t)})}}):Ur.forEach(e=>{t[e]=()=>{}}),t}),qr="?",Hr=/\(error: (.*)\)/,Jr=/captureMessage|captureException/;function Gr(e){return e[e.length-1]||{}}const Qr="<anonymous>";function Yr(e){try{return e&&"function"==typeof e&&e.name||Qr}catch(t){return Qr}}function Kr(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch(n){return}}}const Xr={},Zr={};function ei(e,t){Xr[e]=Xr[e]||[],Xr[e].push(t)}function ti(e,t){if(!Zr[e]){Zr[e]=!0;try{t()}catch(n){zr&&Wr.error(`Error while instrumenting ${e}`,n)}}}function ni(e,t){const n=e&&Xr[e];if(n)for(const i of n)try{i(t)}catch(r){zr&&Wr.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Yr(i)}\nError:`,r)}}let ri=null;function ii(){ri=Dr.onerror,Dr.onerror=function(e,t,n,r,i){return ni("error",{column:r,error:i,line:n,msg:e,url:t}),!!ri&&ri.apply(this,arguments)},Dr.onerror.__SENTRY_INSTRUMENTED__=!0}let ai=null;function oi(){ai=Dr.onunhandledrejection,Dr.onunhandledrejection=function(e){return ni("unhandledrejection",e),!ai||ai.apply(this,arguments)},Dr.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function si(){return li(Dr),Dr}function li(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Fr,t[Fr]=t[Fr]||{}}const ci=Object.prototype.toString;function ui(e){switch(ci.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return wi(e,Error)}}function di(e,t){return ci.call(e)===`[object ${t}]`}function fi(e){return di(e,"ErrorEvent")}function pi(e){return di(e,"DOMError")}function hi(e){return di(e,"String")}function mi(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function gi(e){return null===e||mi(e)||"object"!=typeof e&&"function"!=typeof e}function vi(e){return di(e,"Object")}function yi(e){return"undefined"!=typeof Event&&wi(e,Event)}function bi(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function wi(e,t){try{return e instanceof t}catch(n){return!1}}function ki(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}const Si=Dr;function _i(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,i=[];let a=0,o=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&a++<r&&(c=xi(n,u),!("html"===c||a>1&&o+i.length*l+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(s)}catch(n){return"<unknown>"}}function xi(e,t){const n=e,r=[];if(!n||!n.tagName)return"";if(Si.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const i=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i&&i.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&hi(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}const a=["aria-label","type","name","title","alt"];for(const o of a){const e=n.getAttribute(o);e&&r.push(`[${o}="${e}"]`)}return r.join("")}function Ci(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function Ei(e,t){if(!Array.isArray(e))return"";const n=[];for(let i=0;i<e.length;i++){const t=e[i];try{ki(t)?n.push("[VueViewModel]"):n.push(String(t))}catch(r){n.push("[value cannot be serialized]")}}return n.join(t)}function Ti(e,t=[],n=!1){return t.some(t=>function(e,t,n=!1){return!!hi(e)&&(di(t,"RegExp")?t.test(e):!!hi(t)&&(n?e===t:e.includes(t)))}(e,t,n))}function Mi(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"==typeof i&&Ai(i,r);try{e[t]=i}catch(a){zr&&Wr.log(`Failed to replace method "${t}" in object`,e)}}function Pi(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){zr&&Wr.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Ai(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Pi(e,"__sentry_original__",t)}catch(n){}}function Oi(e){return e.__sentry_original__}function Ni(e){if(ui(e))return l({message:e.message,name:e.name,stack:e.stack},ji(e));if(yi(e)){const t=l({type:e.type,target:Li(e.target),currentTarget:Li(e.currentTarget)},ji(e));return"undefined"!=typeof CustomEvent&&wi(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Li(e){try{return"undefined"!=typeof Element&&wi(e,Element)?_i(e):Object.prototype.toString.call(e)}catch(t){return"<unknown>"}}function ji(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ii(e){return Ri(e,new Map)}function Ri(e,t){if(function(e){if(!vi(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(t){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const i of Object.getOwnPropertyNames(e))void 0!==e[i]&&(r[i]=Ri(e[i],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach(e=>{r.push(Ri(e,t))}),r}return e}function Fi(){return Date.now()/1e3}const Di=function(){const{performance:e}=Dr;if(!e||!e.now)return Fi;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function Bi(){const e=Dr,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(r){}return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function zi(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Ui(e){const{message:t,event_id:n}=e;if(t)return t;const r=zi(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Vi(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function $i(e,t){const n=zi(e);if(!n)return;const r=n.mechanism;if(n.mechanism=l(l({type:"generic",handled:!0},r),t),t&&"data"in t){const e=l(l({},r&&r.data),t.data);n.mechanism.data=e}}function Wi(e){if(function(e){try{return e.__sentry_captured__}catch(t){}}(e))return!0;try{Pi(e,"__sentry_captured__",!0)}catch(t){}return!1}var qi;function Hi(e){return new Gi(t=>{t(e)})}function Ji(e){return new Gi((t,n)=>{n(e)})}(()=>{const{performance:e}=Dr;e&&e.now&&(e.now(),e.timing&&e.timing.navigationStart)})(),function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(qi||(qi={}));class Gi{constructor(e){Gi.prototype.__init.call(this),Gi.prototype.__init2.call(this),Gi.prototype.__init3.call(this),Gi.prototype.__init4.call(this),this._state=qi.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new Gi((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(i){r(i)}else n(t)},e=>{if(t)try{n(t(e))}catch(i){r(i)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Gi((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{i?n(r):t(r)})})}__init(){this._resolve=e=>{this._setResult(qi.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(qi.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===qi.PENDING&&(bi(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===qi.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===qi.RESOLVED&&e[1](this._value),this._state===qi.REJECTED&&e[2](this._value),e[0]=!0)})}}}function Qi(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Di(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Bi()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Yi(){return Bi()}function Ki(){return Bi().substring(16)}function Xi(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const r=l({},e);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Xi(r[i],t[i],n-1));return r}const Zi="_sentrySpan";function ea(e,t){t?Pi(e,Zi,t):delete e[Zi]}function ta(e){return e[Zi]}class na{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Yi(),spanId:Ki()}}clone(){const e=new na;return e._breadcrumbs=[...this._breadcrumbs],e._tags=l({},this._tags),e._extra=l({},this._extra),e._contexts=l({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata=l({},this._sdkProcessingMetadata),e._propagationContext=l({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,ea(e,ta(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Qi(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=l(l({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=c(l({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=l(l({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=c(l({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,r]=t instanceof ra?[t.getScopeData(),t.getRequestSession()]:vi(t)?[e,e.requestSession]:[],{tags:i,extra:a,user:o,contexts:s,level:c,fingerprint:u=[],propagationContext:d}=n||{};return this._tags=l(l({},this._tags),i),this._extra=l(l({},this._extra),a),this._contexts=l(l({},this._contexts),s),o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,ea(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Yi()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r=l({timestamp:Fi()},e);return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ta(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Xi(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=l({spanId:Ki()},e),this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:Bi();if(!this._client)return Wr.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,c(l({originalException:e,syntheticException:r},t),{event_id:n}),this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Bi();if(!this._client)return Wr.warn("No client configured on scope - will not capture message!"),r;const i=new Error(e);return this._client.captureMessage(e,t,c(l({originalException:e,syntheticException:i},n),{event_id:r}),this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Bi();return this._client?(this._client.captureEvent(e,c(l({},t),{event_id:n}),this),n):(Wr.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const ra=na;class ia{constructor(e,t){let n,r;n=e||new ra,r=t||new ra,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(r){throw this._popScope(),r}return bi(n)?n.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}}function aa(){const e=li(si());return e.stack=e.stack||new ia(Br("defaultCurrentScope",()=>new ra),Br("defaultIsolationScope",()=>new ra))}function oa(e){return aa().withScope(e)}function sa(e,t){const n=aa();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function la(e){return aa().withScope(()=>e(aa().getIsolationScope()))}function ca(e){const t=li(e);return t.acs?t.acs:{withIsolationScope:la,withScope:oa,withSetScope:sa,withSetIsolationScope:(e,t)=>la(t),getCurrentScope:()=>aa().getScope(),getIsolationScope:()=>aa().getIsolationScope()}}function ua(){return ca(si()).getCurrentScope()}function da(){return ca(si()).getIsolationScope()}function fa(){return ua().getClient()}function pa(e){const t=e.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:i}=t;return Ii({trace_id:n,span_id:r,parent_span_id:i})}function ha(e){const t=e._sentryMetrics;if(!t)return;const n={};for(const[,[r,i]]of t)(n[r]||(n[r]=[])).push(Ii(i));return n}const ma=/^sentry-/;function ga(e){return e.split(",").map(e=>e.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}let va=!1;function ya(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext();return Ii({parent_span_id:r?t:ka(e).parent_span_id,span_id:r?Ki():t,trace_id:n})}function ba(e){return"number"==typeof e?wa(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?wa(e.getTime()):Di()}function wa(e){return e>9999999999?e/1e3:e}function ka(e){if("function"==typeof e.getSpanJSON)return e.getSpanJSON();try{const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:i,name:a,endTime:o,parentSpanId:s,status:l}=e;return Ii({span_id:t,trace_id:n,data:r,description:a,parent_span_id:s,start_timestamp:ba(i),timestamp:ba(o)||void 0,status:Sa(l),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:ha(e)})}return{span_id:t,trace_id:n}}catch(t){return{}}}function Sa(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"unknown_error"}function _a(e){return e._sentryRootSpan||e}function xa(){va||($r(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),va=!0)}const Ca="production";function Ea(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i=Ii({environment:n.environment||Ca,release:n.release,public_key:r,trace_id:e});return t.emit("createDsc",i),i}function Ta(e){const t=fa();if(!t)return{};const n=_a(e),r=n._frozenDsc;if(r)return r;const i=n.spanContext().traceState,a=i&&i.get("sentry.dsc"),o=a&&function(e){const t=function(e){if(e&&(hi(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{const n=ga(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):ga(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>(t.match(ma)&&(e[t.slice(7)]=n),e),{});return Object.keys(n).length>0?n:void 0}(a);if(o)return o;const s=Ea(e.spanContext().traceId,t),l=ka(n),c=l.data||{},u=c["sentry.sample_rate"];null!=u&&(s.sample_rate=`${u}`);const d=c["sentry.source"],f=l.description;return"url"!==d&&f&&(s.transaction=f),function(){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=fa(),t=e&&e.getOptions();return!!t&&(t.enableTracing||"tracesSampleRate"in t||"tracesSampler"in t)}()&&(s.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n))),t.emit("createDsc",s,n),s}const Ma=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Pa(e,t=!1){const{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${r?`${r}/`:r}${o}`}function Aa(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Oa(e,t=100,n=1/0){try{return La("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Na(e,t=3,n=102400){const r=Oa(e,t);return a=r,i=JSON.stringify(a),~-encodeURI(i).split(/%..|./).length>n?Na(e,t-1,n):r;var i,a}function La(e,t,n=1/0,r=1/0,i=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[a,o]=i;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const s=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof global&&t===global)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(ki(t))return"[VueViewModel]";if(vi(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${Yr(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}var n}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===l)return s.replace("object ","");if(a(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return La("",c.toJSON(),l-1,r,i)}catch(p){}const u=Array.isArray(t)?[]:{};let d=0;const f=Ni(t);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(d>=r){u[h]="[MaxProperties ~]";break}const e=f[h];u[h]=La(h,e,l-1,r,i),d++}return o(t),u}function ja(e,t=[]){return[e,t]}function Ia(e,t){const[n,r]=e;return[n,[...r,t]]}function Ra(e,t){const n=e[1];for(const r of n)if(t(r,r[0].type))return!0;return!1}function Fa(e){return Dr.__SENTRY__&&Dr.__SENTRY__.encodePolyfill?Dr.__SENTRY__.encodePolyfill(e):(new TextEncoder).encode(e)}function Da(e){const[t,n]=e;let r=JSON.stringify(t);function i(e){"string"==typeof r?r="string"==typeof e?r+e:[Fa(r),e]:r.push("string"==typeof e?Fa(e):e)}for(const o of n){const[e,t]=o;if(i(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)i(t);else{let e;try{e=JSON.stringify(t)}catch(a){e=JSON.stringify(Oa(t))}i(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(r)}function Ba(e){const t="string"==typeof e.data?Fa(e.data):e.data;return[Ii({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}const za={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function Ua(e){return za[e]}function Va(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function $a(e,t,n,r=0){return new Gi((i,a)=>{const o=e[r];if(null===t||"function"!=typeof o)i(t);else{const s=o(l({},t),n);Rr&&o.id&&null===s&&Wr.log(`Event processor "${o.id}" dropped event`),bi(s)?s.then(t=>$a(e,t,n,r+1).then(i)).then(null,a):$a(e,s,n,r+1).then(i).then(null,a)}})}let Wa,qa,Ha;function Ja(e,t){const{extra:n,tags:r,user:i,contexts:a,level:o,sdkProcessingMetadata:s,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:h,span:m}=t;Ga(e,"extra",n),Ga(e,"tags",r),Ga(e,"user",i),Ga(e,"contexts",a),e.sdkProcessingMetadata=Xi(e.sdkProcessingMetadata,s,2),o&&(e.level=o),h&&(e.transactionName=h),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext=l(l({},e.propagationContext),p)}function Ga(e,t,n){e[t]=Xi(e[t],n,1)}function Qa(e,t,n,r,i,a){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,u=c(l({},t),{event_id:t.event_id||n.event_id||Bi(),timestamp:t.timestamp||Fi()}),d=n.integrations||e.integrations.map(e=>e.name);var f,p;!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:a=250}=t;e.environment=e.environment||n||Ca,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i),e.message&&(e.message=Ci(e.message,a));const o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=Ci(o.value,a));const s=e.request;s&&s.url&&(s.url=Ci(s.url,a))}(u,e),f=u,(p=d).length>0&&(f.sdk=f.sdk||{},f.sdk.integrations=[...f.sdk.integrations||[],...p]),i&&i.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=Dr._sentryDebugIds;if(!t)return{};const n=Object.keys(t);return Ha&&n.length===qa||(qa=n.length,Ha=n.reduce((n,r)=>{Wa||(Wa={});const i=Wa[r];if(i)n[i[0]]=i[1];else{const i=e(r);for(let e=i.length-1;e>=0;e--){const a=i[e],o=a&&a.filename,s=t[r];if(o&&s){n[o]=s,Wa[r]=[o,s];break}}}return n},{})),Ha}(t);try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{n&&e.filename&&(e.debug_id=n[e.filename])})})}catch(r){}}(u,e.stackParser);const h=function(e,t){if(!t)return e;const n=e?e.clone():new ra;return n.update(t),n}(r,n.captureContext);n.mechanism&&$i(u,n.mechanism);const m=i?i.getEventProcessors():[],g=Br("globalScope",()=>new ra).getScopeData();a&&Ja(g,a.getScopeData()),h&&Ja(g,h.getScopeData());const v=[...n.attachments||[],...g.attachments];return v.length&&(n.attachments=v),function(e,t){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;var o,s;!function(e,t){const{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t,c=Ii(n);c&&Object.keys(c).length&&(e.extra=l(l({},c),e.extra));const u=Ii(r);u&&Object.keys(u).length&&(e.tags=l(l({},u),e.tags));const d=Ii(i);d&&Object.keys(d).length&&(e.user=l(l({},d),e.user));const f=Ii(a);f&&Object.keys(f).length&&(e.contexts=l(l({},f),e.contexts)),o&&(e.level=o),s&&"transaction"!==e.type&&(e.transaction=s)}(e,t),r&&function(e,t){e.contexts=l({trace:ya(t)},e.contexts),e.sdkProcessingMetadata=l({dynamicSamplingContext:Ta(t)},e.sdkProcessingMetadata);const n=ka(_a(t)).description;n&&!e.transaction&&"transaction"===e.type&&(e.transaction=n)}(e,r),s=n,(o=e).fingerprint=o.fingerprint?Array.isArray(o.fingerprint)?o.fingerprint:[o.fingerprint]:[],s&&(o.fingerprint=o.fingerprint.concat(s)),o.fingerprint&&!o.fingerprint.length&&delete o.fingerprint,function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,i),function(e,t){e.sdkProcessingMetadata=l(l({},e.sdkProcessingMetadata),t)}(e,a)}(u,g),$a([...m,...g.eventProcessors],u,n).then(e=>(e&&function(e){const t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch(r){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r=l(l(l(l(l({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>l(l({},e),e.data&&{data:Oa(e.data,t,n)}))}),e.user&&{user:Oa(e.user,t,n)}),e.contexts&&{contexts:Oa(e.contexts,t,n)}),e.extra&&{extra:Oa(e.extra,t,n)});return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Oa(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>l(l({},e),e.data&&{data:Oa(e.data,t,n)}))),e.contexts&&e.contexts.flags&&r.contexts&&(r.contexts.flags=Oa(e.contexts.flags,3,n)),r}(e,o,s):e))}function Ya(e,t){return ua().captureEvent(e,t)}function Ka(e){const t=fa(),n=da(),r=ua(),{release:i,environment:a=Ca}=t&&t.getOptions()||{},{userAgent:o}=Dr.navigator||{},s=function(e){const t=Di(),n={sid:Bi(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>{return Ii({sid:`${(e=n).sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}});var e}};return e&&Qi(n,e),n}(l(l({release:i,environment:a,user:r.getUser()||n.getUser()},o&&{userAgent:o}),e)),c=n.getSession();return c&&"ok"===c.status&&Qi(c,{status:"exited"}),Xa(),n.setSession(s),r.setSession(s),s}function Xa(){const e=da(),t=ua(),n=t.getSession()||e.getSession();n&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),Qi(e,t)}(n),Za(),e.setSession(),t.setSession()}function Za(){const e=da(),t=ua(),n=fa(),r=t.getSession()||e.getSession();r&&n&&n.captureSession(r)}function eo(e=!1){e?Xa():Za()}const to=[];function no(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function ro(e,t,n){if(n[t.name])Rr&&Wr.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===to.indexOf(t.name)&&"function"==typeof t.setupOnce&&(t.setupOnce(),to.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}Rr&&Wr.log(`Integration installed: ${t.name}`)}}class io extends Error{constructor(e,t="warn"){super(e),this.message=e,this.logLevel=t}}const ao="Not capturing exception because it's already been captured.";class oo{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=Ma.exec(e);if(!t)return void $r(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});const[n,r,i="",a="",o="",s=""]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return Aa({host:a,pass:i,path:l,projectId:c,port:o,protocol:n,publicKey:r})}(e):Aa(e);if(t&&function(e){if(!zr)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(Wr.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(Wr.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(Wr.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(Wr.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):Rr&&Wr.warn("No DSN provided, client will not send events."),this._dsn){const t=function(e,t,n){return t||`${r=e,`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(r)}${r.projectId}/envelope/`}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`;var r}(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(c(l({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}const t=["enableTracing","tracesSampleRate","tracesSampler"].find(t=>t in e&&null==e[t]);t&&$r(()=>{console.warn(`[Sentry] Deprecation warning: \`${t}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,t,n){const r=Bi();if(Wi(e))return Rr&&Wr.log(ao),r;const i=l({event_id:r},t);return this._process(this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n))),i.event_id}captureMessage(e,t,n,r){const i=l({event_id:Bi()},n),a=mi(e)?e:String(e),o=gi(e)?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(o.then(e=>this._captureEvent(e,i,r))),i.event_id}captureEvent(e,t,n){const r=Bi();if(t&&t.originalException&&Wi(t.originalException))return Rr&&Wr.log(ao),r;const i=l({event_id:r},t),a=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,i,a||n)),i.event_id}captureSession(e){"string"!=typeof e.release?Rr&&Wr.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Qi(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.emit("flush"),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):Hi(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.emit("close"),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];ro(this,e,this._integrations),t||no(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const i=Va(n),a=e.type&&"replay_event"!==e.type?e.type:"event";var o,s;o=e,(s=n&&n.sdk)&&(o.sdk=o.sdk||{},o.sdk.name=o.sdk.name||s.name,o.sdk.version=o.sdk.version||s.version,o.sdk.integrations=[...o.sdk.integrations||[],...s.integrations||[]],o.sdk.packages=[...o.sdk.packages||[],...s.packages||[]]);const c=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return l(l(l({event_id:e.event_id,sent_at:(new Date).toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:Pa(r)}),i&&{trace:Ii(l({},i))})}(e,i,r,t);return delete e.sdkProcessingMetadata,ja(c,[[{type:a},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])n=Ia(n,Ba(i));const r=this.sendEnvelope(n);r&&r.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){const t=function(e,t,n,r){const i=Va(n);return ja(l(l({sent_at:(new Date).toISOString()},i&&{sdk:i}),!!r&&t&&{dsn:Pa(t)}),["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const r="number"==typeof n?n:1,i=`${e}:${t}`;Rr&&Wr.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(e,t){const n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{const e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,e=>(Rr&&Wr.error("Error while sending envelope:",e),e)):(Rr&&Wr.error("Transport disabled"),Hi({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t&&ro(e,t,n)}),n}(this,e),no(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const a="ok"===e.status;(a&&0===e.errors||a&&n)&&(Qi(e,c(l({},n&&{status:"crashed"}),{errors:e.errors||Number(r||n)})),this.captureSession(e))}_isClientDoneProcessing(e){return new Gi(t=>{let n=0;const r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n=ua(),r=da()){const i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a.length>0&&(t.integrations=a),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Qa(i,e,t,n,this,r).then(e=>{if(null===e)return e;e.contexts=l({trace:pa(n)},e.contexts);const t=function(e,t){const n=t.getPropagationContext();return n.dsc||Ea(n.traceId,e)}(this,n);return e.sdkProcessingMetadata=l({dynamicSamplingContext:t},e.sdkProcessingMetadata),e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{Rr&&(e instanceof io&&"log"===e.logLevel?Wr.log(e.message):Wr.warn(e))})}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r,a=lo(e),o=so(e),s=e.type||"error",u=`before send for type \`${s}\``,d=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;if(!("number"!=typeof t||isNaN(t)||t<0||t>1))return t;Rr&&Wr.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`)}(i);if(o&&"number"==typeof d&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error",e),Ji(new io(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const f="replay_event"===s?"replay":s,p=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,p).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",f,e),new io("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(bi(e))return e.then(e=>{if(!vi(e)&&null!==e)throw new io(n);return e},e=>{throw new io(`${t} rejected with ${e}`)});if(!vi(e)&&null!==e)throw new io(n);return e}(function(e,t,n,r){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o}=t;if(so(n)&&i)return i(n,r);if(lo(n)){if(n.spans&&o){const t=[];for(const r of n.spans){const n=o(r);n?t.push(n):(xa(),e.recordDroppedEvent("before_send","span"))}n.spans=t}if(a){if(n.spans){const e=n.spans.length;n.sdkProcessingMetadata=c(l({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:e})}return a(n,r)}}return n}(this,r,n,t),u)}).then(r=>{if(null===r){if(this.recordDroppedEvent("before_send",f,e),a){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw new io(`${u} returned \`null\`, will not send event.`,"log")}const i=n&&n.getSession();if(!a&&i&&this._updateSessionFromEvent(i,r),a){const e=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const o=r.transaction_info;if(a&&o&&r.transaction!==e.transaction){const e="custom";r.transaction_info=c(l({},o),{source:e})}return this.sendEvent(r,t),r}).then(null,e=>{if(e instanceof io)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new io(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){Rr&&Wr.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(Rr&&Wr.log("No outcomes to send"));if(!this._dsn)return void(Rr&&Wr.log("No dsn provided, will not send outcomes"));Rr&&Wr.log("Sending outcomes:",e);const t=(n=e,ja((r=this._options.tunnel&&Pa(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:Fi(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function so(e){return void 0===e.type}function lo(e){return"transaction"===e.type}function co(e,t,n=function(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return Ji(new io("Not adding Promise because buffer limit was reached."));const i=r();return-1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new Gi((n,r)=>{let i=t.length;if(!i)return n(!0);const a=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{Hi(e).then(()=>{--i||(clearTimeout(a),n(!0))},r)})})}}}(e.bufferSize||64)){let r={};return{send:function(i){const a=[];if(Ra(i,(t,n)=>{const i=Ua(n);if(function(e,t,n=Date.now()){return((r=e)[t]||r.all||0)>n;var r}(r,i)){const r=uo(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else a.push(t)}),0===a.length)return Hi({});const o=ja(i[0],a),s=t=>{Ra(o,(n,r)=>{const i=uo(n,r);e.recordDroppedEvent(t,Ua(r),i)})};return n.add(()=>t({body:Da(o)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Rr&&Wr.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){const i=l({},e),a=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(a)for(const s of a.trim().split(",")){const[e,t,,,n]=s.split(":",5),a=parseInt(e,10),o=1e3*(isNaN(a)?60:a);if(t)for(const s of t.split(";"))"metric_bucket"===s&&n&&!n.split(";").includes("custom")||(i[s]=r+o);else i.all=r+o}else o?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):429===t&&(i.all=r+6e4);return i}(r,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof io)return Rr&&Wr.error("Skipped sending event because buffer is full."),s("queue_overflow"),Hi({});throw e})},flush:e=>n.drain(e)}}function uo(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const fo=100;function po(e,t){const n=fa(),r=da();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=fo}=n.getOptions();if(a<=0)return;const o=l({timestamp:Fi()},e),s=i?$r(()=>i(o,t)):o;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),r.addBreadcrumb(s,a))}let ho;const mo=new WeakMap,go=()=>({name:"FunctionToString",setupOnce(){ho=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Oi(this),n=mo.has(fa())&&void 0!==t?t:this;return ho.apply(n,e)}}catch(dr){}},setup(e){mo.set(e,!0)}}),vo=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/],yo=(e={})=>({name:"InboundFilters",processEvent(t,n,r){const i=r.getOptions(),a=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:vo],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,i);return o=t,((s=a).ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(t){}return!1}(o)?(Rr&&Wr.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Ui(o)}`),1):(l=o,c=s.ignoreErrors,!l.type&&c&&c.length&&function(e){const t=[];let n;e.message&&t.push(e.message);try{n=e.exception.values[e.exception.values.length-1]}catch(r){}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),t}(l).some(e=>Ti(e,c))?(Rr&&Wr.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Ui(o)}`),1):function(e){return!(e.type||!e.exception||!e.exception.values||0===e.exception.values.length||e.message||e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(o)?(Rr&&Wr.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${Ui(o)}`),1):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&Ti(n,t)}(o,s.ignoreTransactions)?(Rr&&Wr.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Ui(o)}`),1):function(e,t){if(!t||!t.length)return!1;const n=bo(e);return!!n&&Ti(n,t)}(o,s.denyUrls)?(Rr&&Wr.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Ui(o)}.\nUrl: ${bo(o)}`),1):!function(e,t){if(!t||!t.length)return!0;const n=bo(e);return!n||Ti(n,t)}(o,s.allowUrls)&&(Rr&&Wr.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Ui(o)}.\nUrl: ${bo(o)}`),1)))?null:t;var o,s,l,c}});function bo(e){try{let n;try{n=e.exception.values[0].stacktrace.frames}catch(t){}return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(n){return Rr&&Wr.error(`Cannot extract url for event ${Ui(e)}`),null}}function wo(e,t,n=250,r,i,a,o){if(!(a.exception&&a.exception.values&&o&&wi(o.originalException,Error)))return;const s=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;var l,c;s&&(a.exception.values=(l=ko(e,t,i,o.originalException,r,a.exception.values,s,0),c=n,l.map(e=>(e.value&&(e.value=Ci(e.value,c)),e))))}function ko(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let l=[...a];if(wi(r[i],Error)){So(o,s);const a=e(t,r[i]),c=l.length;_o(a,i,c,s),l=ko(e,t,n,r[i],i,[a,...l],a,c)}return Array.isArray(r.errors)&&r.errors.forEach((r,a)=>{if(wi(r,Error)){So(o,s);const c=e(t,r),u=l.length;_o(c,`errors[${a}]`,u,s),l=ko(e,t,n,r,i,[c,...l],c,u)}}),l}function So(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=c(l(l({},e.mechanism),"AggregateError"===e.type&&{is_exception_group:!0}),{exception_id:t})}function _o(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=c(l({},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function xo(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Co(){"console"in Dr&&Ur.forEach(function(e){e in Dr.console&&Mi(Dr.console,e,function(t){return Vr[e]=t,function(...t){ni("console",{args:t,level:e});const n=Vr[e];n&&n.apply(Dr.console,t)}})})}function Eo(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const To=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(n=t,(r=e)&&(function(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Po(e,t)||!Mo(e,t))}(n,r)||function(e,t){const n=Ao(t),r=Ao(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&Po(e,t)&&Mo(e,t))}(n,r)))return Rr&&Wr.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}var n,r;return e=t}}};function Mo(e,t){let n=Kr(e),r=Kr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const e=r[i],t=n[i];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function Po(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(i){return!1}}function Ao(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Oo(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const No=Dr;function Lo(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function jo(e,t){const n="fetch";ei(n,e),ti(n,()=>function(e,t=!1){t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in No))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}())return!1;if(Lo(No.fetch))return!0;let t=!1;const n=No.document;if(n&&"function"==typeof n.createElement)try{const e=n.createElement("iframe");e.hidden=!0,n.head.appendChild(e),e.contentWindow&&e.contentWindow.fetch&&(t=Lo(e.contentWindow.fetch)),n.head.removeChild(e)}catch(e){zr&&Wr.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}()||Mi(Dr,"fetch",function(t){return function(...n){const r=new Error,{method:i,url:a}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:Ro(t),method:Io(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Ro(t),method:Io(t,"method")?String(t.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:1e3*Di(),virtualError:r};return e||ni("fetch",l({},o)),t.apply(Dr,n).then(t=>d(null,null,function*(){return e?e(t):ni("fetch",c(l({},o),{endTimestamp:1e3*Di(),response:t})),t}),e=>{throw ni("fetch",c(l({},o),{endTimestamp:1e3*Di(),error:e})),ui(e)&&void 0===e.stack&&(e.stack=r.stack,Pi(e,"framesToPop",1)),e})}})}(void 0,t))}function Io(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Ro(e){return"string"==typeof e?e:e?Io(e,"url")?e.url:e.toString?e.toString():"":""}const Fo=Dr,Do=Dr;let Bo=0;function zo(){return Bo>0}function Uo(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(Oi(e))return e}catch(r){return e}const n=function(...n){try{const r=n.map(e=>Uo(e,t));return e.apply(this,r)}catch(r){throw Bo++,setTimeout(()=>{Bo--}),function(...e){const t=ca(si());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(e=>{var i;e.addEventProcessor(e=>(t.mechanism&&(Vi(e,void 0),$i(e,t.mechanism)),e.extra=c(l({},e.extra),{arguments:n}),e)),i=r,ua().captureException(i,void 0)}),r}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch(i){}Ai(n,e),Pi(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch(i){}return n}const Vo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function $o(e,t){const n=qo(e,t),r={type:Go(t),value:Qo(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Wo(e,t){return{exception:{values:[$o(e,t)]}}}function qo(e,t){const n=t.stacktrace||t.stack||"",r=(a=t)&&Ho.test(a.message)?1:0,i=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);var a;try{return e(n,r,i)}catch(a){}return[]}const Ho=/Minified React error #\d+;/i;function Jo(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Go(e){const t=e&&e.name;return!t&&Jo(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Qo(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:Jo(e)&&Array.isArray(e.message)&&2==e.message.length?e.message[1]:t:"No error message"}function Yo(e,t,n,r,i){let a;if(fi(t)&&t.error)return Wo(e,t.error);if(pi(t)||di(t,"DOMException")){const i=t;if("stack"in t)a=Wo(e,t);else{const t=i.name||(pi(i)?"DOMError":"DOMException"),o=i.message?`${t}: ${i.message}`:t;a=Ko(e,o,n,r),Vi(a,o)}return"code"in i&&(a.tags=c(l({},a.tags),{"DOMException.code":`${i.code}`})),a}return ui(t)?Wo(e,t):vi(t)||yi(t)?(a=function(e,t,n,r){const i=fa(),a=i&&i.getOptions().normalizeDepth,o=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}(t),s={__serialized__:Na(t,a)};if(o)return{exception:{values:[$o(e,o)]},extra:s};const l={exception:{values:[{type:yi(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Xo(t,{isUnhandledRejection:r})}]},extra:s};if(n){const t=qo(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}(e,t,n,i),$i(a,{synthetic:!0}),a):(a=Ko(e,t,n,r),Vi(a,`${t}`),$i(a,{synthetic:!0}),a)}function Ko(e,t,n,r){const i={};if(r&&n){const r=qo(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),$i(i,{synthetic:!0})}if(mi(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Xo(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(Ni(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return Ci(r,t);for(let i=n.length;i>0;i--){const e=n.slice(0,i).join(", ");if(!(e.length>t))return i===n.length?e:Ci(e,t)}return""}(e),r=t?"promise rejection":"exception";return fi(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:yi(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(t){}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}class Zo extends oo{constructor(e){const t=l({parentSpanIsAlwaysRootSpan:!0},e);!function(e,t,n=[t],r="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:Fr})),version:Fr}),e._metadata=i}(t,"browser",["browser"],Do.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&Do.document&&Do.document.addEventListener("visibilitychange",()=>{"hidden"===Do.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){const i=Yo(e,t,n&&n.syntheticException||void 0,r);return $i(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Hi(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const a=Ko(e,t,r&&r.syntheticException||void 0,i);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Hi(a)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Vo&&Wr.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){return ja(l(l({event_id:e.event_id,sent_at:(new Date).toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!n&&!!r&&{dsn:Pa(r)}),[function(e){return[{type:"user_report"},e]}(e)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}}const es="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,ts=Dr;let ns,rs,is,as;function os(){if(!ts.document)return;const e=ni.bind(null,"dom"),t=ss(e,!0);ts.document.addEventListener("click",t,!1),ts.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=ts[t],r=n&&n.prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Mi(r,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){const r=ss(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch(a){}return t.call(this,n,r,i)}}),Mi(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch(i){}return e.call(this,t,n,r)}}))})}function ss(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(t){return null}}(n);if(i=n.type,a=r,"keypress"===i&&(!a||!a.tagName||"INPUT"!==a.tagName&&"TEXTAREA"!==a.tagName&&!a.isContentEditable))return;var i,a;Pi(n,"_sentryCaptured",!0),r&&!r._sentryId&&Pi(r,"_sentryId",Bi());const o="keypress"===n.type?"input":n.type;(function(e){if(e.type!==rs)return!1;try{if(!e.target||e.target._sentryId!==is)return!1}catch(t){}return!0})(n)||(e({event:n,name:o,global:t}),rs=n.type,is=r?r._sentryId:void 0),clearTimeout(ns),ns=ts.setTimeout(()=>{is=void 0,rs=void 0},1e3)}}function ls(e){const t="history";ei(t,e),ti(t,cs)}function cs(){if(!function(){const e=Fo.chrome,t=e&&e.app&&e.app.runtime,n="history"in Fo&&!!Fo.history.pushState&&!!Fo.history.replaceState;return!t&&n}())return;const e=ts.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=as,t=String(n);as=t,ni("history",{from:e,to:t})}return e.apply(this,t)}}ts.onpopstate=function(...t){const n=ts.location.href,r=as;if(as=n,ni("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(i){}},Mi(ts.history,"pushState",t),Mi(ts.history,"replaceState",t)}const us={};function ds(e){us[e]=void 0}const fs="__sentry_xhr_v3__";function ps(){if(!ts.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,i=1e3*Di(),a=hi(n[0])?n[0].toUpperCase():void 0,o=function(e){if(hi(e))return e;try{return e.toString()}catch(t){}}(n[1]);if(!a||!o)return e.apply(t,n);t[fs]={method:a,url:o,request_headers:{}},"POST"===a&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const s=()=>{const e=t[fs];if(e&&4===t.readyState){try{e.status_code=t.status}catch(n){}ni("xhr",{endTimestamp:1e3*Di(),startTimestamp:i,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(s(),e.apply(t,n))}):t.addEventListener("readystatechange",s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,i]=n,a=t[fs];return a&&hi(r)&&hi(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[fs];return r?(void 0!==n[0]&&(r.body=n[0]),ni("xhr",{startTimestamp:1e3*Di(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function hs(e,t=function(e){const t=us[e];if(t)return t;let n=ts[e];if(Lo(n))return us[e]=n.bind(ts);const r=ts.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const i=t.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(t)}catch(i){es&&Wr.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n?us[e]=n.bind(ts):n}("fetch")){let n=0,r=0;return co(e,function(i){const a=i.body.length;n+=a,r++;const o=l({body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);if(!t)return ds("fetch"),Ji("No fetch implementation available");try{return t(e.url,o).then(e=>(n-=a,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(s){return ds("fetch"),n-=a,r--,Ji(s)}})}function ms(e,t,n,r){const i={filename:e,function:"<anonymous>"===t?qr:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const gs=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vs=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ys=/\((\S*)(?::(\d+))(?::(\d+))\)/,bs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ws=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ks=function(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const i=[],a=e.split("\n");for(let o=n;o<a.length;o++){const e=a[o];if(e.length>1024)continue;const n=Hr.test(e)?e.replace(Hr,"$1"):e;if(!n.match(/\S*Error: /)){for(const e of t){const t=e(n);if(t){i.push(t);break}}if(i.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Gr(t).function||"")&&t.pop(),t.reverse(),Jr.test(Gr(t).function||"")&&(t.pop(),Jr.test(Gr(t).function||"")&&t.pop()),t.slice(0,50).map(e=>c(l({},e),{filename:e.filename||Gr(t).filename,function:e.function||qr}))}(i.slice(r))}}([30,e=>{const t=gs.exec(e);if(t){const[,e,n,r]=t;return ms(e,qr,+n,+r)}const n=vs.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=ys.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=Ss(n[1]||qr,n[2]);return ms(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=bs.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ws.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||qr;return[n,e]=Ss(n,e),ms(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),Ss=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:qr,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},_s=(e={})=>{const t=l({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";ei(t,e),ti(t,Co)}(function(e){return function(t){if(fa()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:Eo(t.level),message:Ei(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${Ei(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}po(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(fa()!==e)return;let r,i,a="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>1024&&(Vo&&Wr.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof a&&(a=[a]);try{const e=n.event,t=(s=e)&&s.target?e.target:e;r=_i(t,{keyAttrs:a,maxStringLength:o}),i=function(e){if(!Si.HTMLElement)return null;let t=e;for(let n=0;n<5;n++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}(t)}catch(c){r="<unknown>"}var s;if(0===r.length)return;const l={category:`ui.${n.name}`,message:r};i&&(l.data={"ui.component_name":i}),po(l,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),ei("dom",n),ti("dom",os)),t.xhr&&(ei("xhr",function(e){return function(t){if(fa()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[fs];if(!n||!r||!i)return;const{method:a,url:o,status_code:s,body:l}=i,c={method:a,url:o,status_code:s},u={xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r};po({category:"xhr",data:c,type:"http",level:Oo(s)},u)}}(e)),ti("xhr",ps)),t.fetch&&jo(function(e){return function(t){if(fa()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error)po({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:n,endTimestamp:r});else{const e=t.response,i=c(l({},t.fetchData),{status_code:e&&e.status}),a={input:t.args,response:e,startTimestamp:n,endTimestamp:r};po({category:"fetch",data:i,type:"http",level:Oo(i.status_code)},a)}}}(e)),t.history&&ls(function(e){return function(t){if(fa()!==e)return;let n=t.from,r=t.to;const i=xo(Do.location.href);let a=n?xo(n):void 0;const o=xo(r);a&&a.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),po({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){fa()===e&&po({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Ui(t)},{event:t})}}(e))}}},xs=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Cs=(e={})=>{const t=l({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e);return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Mi(Do,"setTimeout",Es),t.setInterval&&Mi(Do,"setInterval",Es),t.requestAnimationFrame&&Mi(Do,"requestAnimationFrame",Ts),t.XMLHttpRequest&&"XMLHttpRequest"in Do&&Mi(XMLHttpRequest.prototype,"send",Ms);const e=t.eventTarget;e&&(Array.isArray(e)?e:xs).forEach(Ps)}}};function Es(e){return function(...t){const n=t[0];return t[0]=Uo(n,{mechanism:{data:{function:Yr(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Ts(e){return function(t){return e.apply(this,[Uo(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Yr(e)},handled:!1,type:"instrument"}})])}}function Ms(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Mi(n,e,function(t){const n={mechanism:{data:{function:e,handler:Yr(t)},handled:!1,type:"instrument"}},r=Oi(t);return r&&(n.mechanism.data.handler=Yr(r)),Uo(t,n)})}),e.apply(this,t)}}function Ps(e){const t=Do[e],n=t&&t.prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Mi(n,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Uo(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Yr(r),target:e},handled:!1,type:"instrument"}}))}catch(a){}return t.apply(this,[n,Uo(r,{mechanism:{data:{function:"addEventListener",handler:Yr(r),target:e},handled:!1,type:"instrument"}}),i])}}),Mi(n,"removeEventListener",function(e){return function(t,n,r){try{const i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(i){}return e.call(this,t,n,r)}}))}const As=(e={})=>{const t=l({onerror:!0,onunhandledrejection:!0},e);return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){var n;t.onerror&&(n=e,function(){const e="error";ei(e,e=>{const{stackParser:t,attachStacktrace:r}=Ns();if(fa()!==n||zo())return;const{msg:i,url:a,line:o,column:s,error:l}=e,c=function(e,t,n,r){const i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},l=s.frames=s.frames||[],c=r,u=n,d=hi(t)&&t.length>0?t:function(){try{return Si.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:qr,in_app:!0,lineno:u}),e}(Yo(t,l||i,void 0,r,!1),a,o,s);c.level="error",Ya(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}),ti(e,ii)}(),Os("onerror")),t.onunhandledrejection&&(function(e){!function(){const t="unhandledrejection";ei(t,t=>{const{stackParser:n,attachStacktrace:r}=Ns();if(fa()!==e||zo())return;const i=function(e){if(gi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(t){}return e}(t),a=gi(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Yo(n,i,void 0,r,!0);a.level="error",Ya(a,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})}),ti(t,oi)}()}(e),Os("onunhandledrejection"))}}};function Os(e){Vo&&Wr.log(`Global Handler attached: ${e}`)}function Ns(){const e=fa();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Ls=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,i){const a=i.getOptions();wo($o,a.stackParser,a.maxValueLength,n,t,e,r)}}};var js="new",Is="loading",Rs="loaded",Fs="joining-meeting",Ds="joined-meeting",Bs="left-meeting",zs="error",Us="unknown",Vs="no-room",$s="end-of-life",Ws="connection-error",qs="loaded",Hs="recording-started",Js="recording-stopped",Gs="fullscreen",Qs="exited-fullscreen",Ys="input-settings-updated",Ks="nonfatal-error",Xs="error",Zs=4096,el=102400,tl="iframe-call-message",nl="local-screen-start",rl="daily-method-update-live-streaming-endpoints",il="transmit-log",al="daily-custom-track",ol={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},sl={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},ll={PLAY:"play",PAUSE:"pause"},cl=["jpg","png","jpeg"],ul="sip-call-transfer";function dl(){return!fl()&&"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function fl(){return"undefined"!=typeof navigator&&navigator.product&&"ReactNative"===navigator.product}function pl(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function hl(){if(fl())return!1;if(!document)return!1;var e=document.createElement("iframe");return!!e.requestFullscreen||!!e.webkitRequestFullscreen}var ml="none",gl=function(){try{var e,t=document.createElement("canvas"),n=!1;(e=t.getContext("webgl2",{failIfMajorPerformanceCaveat:!0}))||(n=!0,e=t.getContext("webgl2"));var r=null!=e;return t.remove(),r?n?"software":"hardware":ml}catch(i){return ml}}();function vl(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!fl()&&gl!==ml&&(e?!kl()&&["Chrome","Firefox"].includes(Sl()):function(){if(kl())return!1;var e=Sl();if("Safari"===e){var t=Tl();if(t.major<15||15===t.major&&t.minor<4)return!1}return"Chrome"===e?xl().major>=77:"Firefox"===e?Ml().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}function yl(){if(fl())return!1;if(wl())return!1;if("undefined"==typeof AudioWorkletNode)return!1;switch(Sl()){case"Chrome":case"Firefox":return!0;case"Safari":var e=_l();return e.major>17||17===e.major&&e.minor>=4}return!1}function bl(){return pl()&&"undefined"!=typeof MediaStreamTrack&&!function(){var e,t=Sl();if(!dl())return!0;switch(t){case"Chrome":return(e=xl()).major&&e.major>0&&e.major<75;case"Firefox":return(e=Ml()).major<91;case"Safari":return(e=Tl()).major<13||13===e.major&&e.minor<1;default:return!0}}()}function wl(){return dl().match(/Linux; Android/)}function kl(){var e,t=dl(),n=t.match(/Mac/)&&(!fl()&&"undefined"!=typeof window&&null!==(e=window)&&void 0!==e&&null!==(e=e.navigator)&&void 0!==e&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(t.match(/Mobi/)||t.match(/Android/)||n)||!!dl().match(/DailyAnd\//)||void 0}function Sl(){if("undefined"!=typeof window){var e=dl();return Cl()?"Safari":e.indexOf("Edge")>-1?"Edge":e.match(/Chrome\//)?"Chrome":e.indexOf("Safari")>-1||El()?"Safari":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("MSIE")>-1||e.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function _l(){switch(Sl()){case"Chrome":return xl();case"Safari":return Tl();case"Firefox":return Ml();case"Edge":return function(){var e=0,t=0;if("undefined"!=typeof window){var n=dl().match(/Edge\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(r){}}return{major:e,minor:t}}()}}function xl(){var e=0,t=0,n=0,r=0,i=!1;if("undefined"!=typeof window){var a=dl(),o=a.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(o)try{e=parseInt(o[1]),t=parseInt(o[2]),n=parseInt(o[3]),r=parseInt(o[4]),i=a.indexOf("OPR/")>-1}catch(s){}}return{major:e,minor:t,build:n,patch:r,opera:i}}function Cl(){return!!dl().match(/iPad|iPhone|iPod/i)&&pl()}function El(){return dl().indexOf("AppleWebKit/605.1.15")>-1}function Tl(){var e=0,t=0,n=0;if("undefined"!=typeof window){var r=dl().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[4])}catch(i){}else(Cl()||El())&&(e=14,t=0,n=3)}return{major:e,minor:t,point:n}}function Ml(){var e=0,t=0;if("undefined"!=typeof window){var n=dl().match(/Firefox\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(r){}}return{major:e,minor:t}}var Pl=er(function e(){Yn(this,e)},[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){Nr()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){Nr()}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){Nr()}},{key:"sendMessageToDailyJs",value:function(e,t){Nr()}},{key:"removeListener",value:function(e){Nr()}}]);function Al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Al(Object(n),!0).forEach(function(t){ar(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Al(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Nl=function(){return!!e})()}var Ll=function(){function e(){var t,n,r;return Yn(this,e),n=this,r=nr(r=e),(t=tr(n,Nl()?Reflect.construct(r,[],nr(n).constructor):r.apply(n,undefined)))._wrappedListeners={},t._messageCallbacks={},t}return ir(e,Pl),er(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){var r=this,i=function(i){if(i.data&&"iframe-call-message"===i.data.what&&(!i.data.callClientId||i.data.callClientId===t)&&(!i.data.from||"module"!==i.data.from)){var a=Ol({},i.data);if(delete a.from,a.callbackStamp&&r._messageCallbacks[a.callbackStamp]){var o=a.callbackStamp;r._messageCallbacks[o].call(n,a),delete r._messageCallbacks[o]}delete a.what,delete a.callbackStamp,e.call(n,a)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){var r=function(r){var i;if(!(!r.data||r.data.what!==tl||!r.data.action||r.data.from&&"module"!==r.data.from||r.data.callClientId&&t&&r.data.callClientId!==t||null!=r&&null!==(i=r.data)&&void 0!==i&&i.callFrameId)){var a=r.data;e.call(n,a)}};this._wrappedListeners[e]=r,window.addEventListener("message",r)}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){if(!n)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var i=Ol({},e);if(i.what=tl,i.from="module",i.callClientId=n,t){var a=Or();this._messageCallbacks[a]=t,i.callbackStamp=a}var o=r?r.contentWindow:window,s=this._callMachineTargetOrigin(r);s&&o.postMessage(i,s)}},{key:"sendMessageToDailyJs",value:function(e,t){e.what=tl,e.callClientId=t,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,t,n){var r=Ol({},e);r.callClientId=n;var i=t?t.contentWindow:window,a=this._callMachineTargetOrigin(t);a&&i.postMessage(r,a)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,t){var n=function(n){if(n.data&&"iframe-call-message"===n.data.what&&(!n.data.callClientId||n.data.callClientId===t)&&(!n.data.from||"module"!==n.data.from)){var r=n.data;e(r)}};return this._wrappedListeners[e]=n,window.addEventListener("message",n),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return"file:"===window.location.protocol?"*":window.location.origin}}])}();function jl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Il(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Il=function(){return!!e})()}var Rl=function(){function e(){var t,n,r;return Yn(this,e),n=this,r=nr(r=e),t=tr(n,Il()?Reflect.construct(r,[],nr(n).constructor):r.apply(n,undefined)),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new pr.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new pr.EventEmitter,t._wrappedListeners={},t._messageCallbacks={},t}return ir(e,Pl),er(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){this._addListener(e,global.callMachineToDailyJsEmitter,t,n,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){this._addListener(e,global.dailyJsToCallMachineEmitter,t,n,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,t,n){this._sendMessage(e,global.dailyJsToCallMachineEmitter,n,t,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(e,t){this._sendMessage(e,global.callMachineToDailyJsEmitter,t,null,"sending message to daily-js")}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(global.callMachineToDailyJsEmitter.removeListener("message",t),global.dailyJsToCallMachineEmitter.removeListener("message",t),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,t,n,r,i){var a=this,o=function(t){if(t.callClientId===n){if(t.callbackStamp&&a._messageCallbacks[t.callbackStamp]){var i=t.callbackStamp;a._messageCallbacks[i].call(r,t),delete a._messageCallbacks[i]}e.call(r,t)}};this._wrappedListeners[e]=o,t.addListener("message",o)}},{key:"_sendMessage",value:function(e,t,n,r,i){var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jl(Object(n),!0).forEach(function(t){ar(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);if(a.callClientId=n,r){var o=Or();this._messageCallbacks[o]=r,a.callbackStamp=o}t.emit("message",a)}}])}(),Fl="replace",Dl="shallow-merge",Bl=[Fl,Dl],zl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data,r=t.mergeStrategy,i=void 0===r?Fl:r;Yn(this,e),e._validateMergeStrategy(i),e._validateData(n,i),this.mergeStrategy=i,this.data=n}return er(e,[{key:"isNoOp",value:function(){return e.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,t){return 0===Object.keys(e).length&&t===Dl}},{key:"_validateMergeStrategy",value:function(e){if(!Bl.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(Bl,"]"))}},{key:"_validateData",value:function(e,t){if(!function(e){if(null==e||"object"!==Kn(e))return!1;var t=Object.getPrototypeOf(e);return null==t||t===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var n;try{if(n=JSON.stringify(e),t===Fl){var r=JSON.parse(n);vr(r,e)||console.warn("The meeting session data provided will be modified when serialized.",r,e)}else if(t===Dl)for(var i in e)if(Object.hasOwnProperty.call(e,i)&&void 0!==e[i]){var a=JSON.parse(JSON.stringify(e[i]));vr(e[i],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[i])}}catch(o){throw Error("Meeting session data must be serializable to JSON: ".concat(o))}if(n.length>el)throw Error("Meeting session data is too large (".concat(n.length," characters). Maximum size suppported is ").concat(el,"."))}}])}();function Ul(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ul=function(){return!!e})()}function Vl(e){var t="function"==typeof Map?new Map:void 0;return Vl=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Ul())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&rr(i,n.prototype),i}(e,arguments,nr(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rr(n,e)},Vl(e)}function $l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($l=function(){return!!e})()}function Wl(e){var t,n=null===(t=window._daily)||void 0===t?void 0:t.pendings;if(n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}var ql=er(function e(t){Yn(this,e),this._currentLoad=null,this._callClientId=t},[{key:"load",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void r(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new Hl(n,function(){r(!1)},function(e,n){n||Wl(t._callClientId),i(e,n)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),Wl(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),Hl=er(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;Yn(this,e),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r},[{key:"start",value:function(){var e=this;if(!this._currentAttempt){var t=function(n){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(n,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new Ql(e._dailyConfig,e._successCallback,t),e._currentAttempt.start())},3e3))};this._currentAttempt=new Ql(this._dailyConfig,this._successCallback,t),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}}]),Jl=function(){function e(){return Yn(this,e),t=this,r=arguments,n=nr(n=e),tr(t,$l()?Reflect.construct(n,r||[],nr(t).constructor):n.apply(t,r));var t,n,r}return ir(e,Vl(Error)),er(e)}(),Gl=2e4,Ql=function(){return er(function e(t,n,r){Yn(this,e),this._loadAttemptImpl=fl()||!t.avoidEval?new Yl(t,n,r):new Kl(t,n,r)},[{key:"start",value:(e=sr(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]);var e}(),Yl=function(){return er(function e(t,n,r){Yn(this,e),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache="undefined"!=typeof iOSCallObjectBundleCache&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r},[{key:"start",value:(r=sr(function*(){var e=jr(this._dailyConfig);!(yield this._tryLoadFromIOSCache(e))&&this._loadFromNetwork(e)}),function(){return r.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(n=sr(function*(e){if(!this._iosCache)return!1;try{var t=yield this._iosCache.get(e);return!!this.cancelled||!!t&&(t.code?(Function('"use strict";'+t.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=t.refetchHeaders,!1))}catch(n){return!1}}),function(e){return n.apply(this,arguments)})},{key:"_loadFromNetwork",value:(t=sr(function*(e){var t=this;this._networkTimeout=setTimeout(function(){t._networkTimedOut=!0,t._failureCallback({msg:"Timed out (>".concat(Gl," ms) when loading call object bundle ").concat(e),type:"timeout"})},Gl);try{var n=this._refetchHeaders?{headers:this._refetchHeaders}:{},r=yield fetch(e,n);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Jl;var i=yield this._getBundleCodeFromResponse(e,r);if(this.cancelled)throw new Jl;Function('"use strict";'+i)(),this._iosCache&&this._iosCache.set(e,i,r.headers),this.succeeded=!0,this._successCallback()}catch(a){if(clearTimeout(this._networkTimeout),a instanceof Jl||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(e,": ").concat(a),type:a.message})}}),function(e){return t.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=sr(function*(e,t){if(t.ok)return yield t.text();if(this._iosCache&&304===t.status)return(yield this._iosCache.renew(e,t.headers)).code;throw new Error("Received ".concat(t.status," response"))}),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}(),Kl=er(function e(t,n,r){Yn(this,e),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r,this._attemptId=Or(),this._networkTimeout=null,this._scriptElement=null},[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=jr(this._dailyConfig);"object"===("undefined"==typeof document?"undefined":Kn(document))?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var t=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){t._stopLoading(),t._failureCallback({msg:"Timed out (>".concat(Gl," ms) when loading call object bundle ").concat(e),type:"timeout"})},Gl);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){t._stopLoading(),t.succeeded=!0,t._successCallback()},r.onerror=function(e){t._stopLoading(),t._failureCallback({msg:"Failed to load call object bundle ".concat(e.target.src),type:e.message})},r.src=e,n.appendChild(r)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}]),Xl=function(e,t,n){return!0===tc(e.local,t,n)},Zl=function(e,t,n){return e.local.streams&&e.local.streams[t]&&e.local.streams[t].stream&&e.local.streams[t].stream["get".concat("video"===n?"Video":"Audio","Tracks")]()[0]},ec=function(e,t,n,r){var i=nc(e,t,n,r);return i&&i.pendingTrack},tc=function(e,t,n){if(!e)return!1;var r=function(e){switch(e){case"avatar":return!0;case"staged":return e;default:return!!e}},i=e.public.subscribedTracks;return i&&i[t]?-1===["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)&&i[t].custom?[!0,"staged"].includes(i[t].custom)?r(i[t].custom):r(i[t].custom[n]):r(i[t][n]):!i||r(i.ALL)},nc=function(e,t,n,r){var i=Object.values(e.streams||{}).filter(function(e){return e.participantId===t&&e.type===n&&e.pendingTrack&&e.pendingTrack.kind===r}).sort(function(e,t){return new Date(t.starttime)-new Date(e.starttime)});return i&&i[0]},rc=function(e,t){var n=e.local.public.customTracks;if(n&&n[t])return n[t].track};function ic(e,t){for(var n=t.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var a=i[r],o=0,s=["video","audio"];o<s.length;o++){var l=s[o],c="cam"===a?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),u=e.tracks[c];if(u){var d=e.local?Zl(n,a,l):ec(n,e.session_id,a,l);"playable"===u.state&&(u.track=d),u.persistentTrack=d}}}function ac(e,t){try{var n=t.getState();for(var r in e.tracks)if(!oc(r)){var i=e.tracks[r].kind;if(i){var a=e.tracks[r];if(a){var o=e.local?rc(n,r):ec(n,e.session_id,r,i);"playable"===a.state&&(e.tracks[r].track=o),a.persistentTrack=o}}else console.error("unknown type for custom track")}}catch(s){console.error(s)}}function oc(e){return["video","audio","screenVideo","screenAudio"].includes(e)}function sc(e,t,n){var r=n.getState();if(e.local){if(e.audio)try{e.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],e.audioTrack||(e.audio=!1)}catch(u){}if(e.video)try{e.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],e.videoTrack||(e.video=!1)}catch(u){}if(e.screen)try{e.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],e.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(u){}}else{var i=!0;try{var a=r.participants[e.session_id];a&&a.public&&a.public.rtcType&&"peer-to-peer"===a.public.rtcType.impl&&a.private&&!["connected","completed"].includes(a.private.peeringState)&&(i=!1)}catch(u){console.error(u)}if(!i)return e.audio=!1,e.audioTrack=!1,e.video=!1,e.videoTrack=!1,e.screen=!1,void(e.screenTrack=!1);try{if(r.streams,e.audio&&Xl(r,e.session_id,"cam-audio")){var o=ec(r,e.session_id,"cam","audio");o&&(t&&t.audioTrack&&t.audioTrack.id===o.id?e.audioTrack=o:o.muted||(e.audioTrack=o)),e.audioTrack||(e.audio=!1)}if(e.video&&Xl(r,e.session_id,"cam-video")){var s=ec(r,e.session_id,"cam","video");s&&(t&&t.videoTrack&&t.videoTrack.id===s.id?e.videoTrack=s:s.muted||(e.videoTrack=s)),e.videoTrack||(e.video=!1)}if(e.screen&&Xl(r,e.session_id,"screen-audio")){var l=ec(r,e.session_id,"screen","audio");l&&(t&&t.screenAudioTrack&&t.screenAudioTrack.id===l.id?e.screenAudioTrack=l:l.muted||(e.screenAudioTrack=l))}if(e.screen&&Xl(r,e.session_id,"screen-video")){var c=ec(r,e.session_id,"screen","video");c&&(t&&t.screenVideoTrack&&t.screenVideoTrack.id===c.id?e.screenVideoTrack=c:c.muted||(e.screenVideoTrack=c))}e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(u){console.error("unexpected error matching up tracks",u)}}}function lc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var cc=new Map,uc=null;function dc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var fc=new Map,pc=null;function hc(e){var t;mc()?(t=e,cc.has(t)||(cc.set(t,{}),navigator.mediaDevices.enumerateDevices().then(function(e){var n;cc.has(t)&&(cc.get(t).lastDevicesString=JSON.stringify(e),uc||(n=sr(function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return lc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lc(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(cc.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==cc.get(r).lastDevicesString&&(cc.get(r).lastDevicesString=i,r(t))}}catch(a){n.e(a)}finally{n.f()}}),uc=function(){return n.apply(this,arguments)},navigator.mediaDevices.addEventListener("devicechange",uc)))}).catch(function(){}))):function(e){fc.has(e)||(fc.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(t){fc.has(e)&&(fc.get(e).lastDevicesString=JSON.stringify(t),pc||(pc=setInterval(sr(function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return dc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dc(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(fc.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==fc.get(r).lastDevicesString&&(fc.get(r).lastDevicesString=i,r(t))}}catch(a){n.e(a)}finally{n.f()}}),3e3)))}))}(e)}function mc(){var e;return fl()||void 0!==(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.ondevicechange)}var gc=new Set;function vc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vc(Object(n),!0).forEach(function(t){ar(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var bc=Object.freeze({VIDEO:"video",AUDIO:"audio",SCREEN_VIDEO:"screenVideo",SCREEN_AUDIO:"screenAudio",CUSTOM_VIDEO:"customVideo",CUSTOM_AUDIO:"customAudio"}),wc=Object.freeze({PARTICIPANTS:"participants",STREAMING:"streaming",TRANSCRIPTION:"transcription"}),kc=Object.values(bc),Sc=["v","a","sv","sa","cv","ca"];Object.freeze(kc.reduce(function(e,t,n){return e[t]=Sc[n],e},{})),Object.freeze(Sc.reduce(function(e,t,n){return e[t]=kc[n],e},{}));var _c=[bc.VIDEO,bc.AUDIO,bc.SCREEN_VIDEO,bc.SCREEN_AUDIO],xc=Object.values(wc),Cc=["p","s","t"];Object.freeze(xc.reduce(function(e,t,n){return e[t]=Cc[n],e},{})),Object.freeze(Cc.reduce(function(e,t,n){return e[t]=xc[n],e},{}));var Ec=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.base,r=t.byUserId,i=t.byParticipantId;Yn(this,e),this.base=n,this.byUserId=r,this.byParticipantId=i}return er(e,[{key:"clone",value:function(){var t=new e;if(this.base instanceof Tc?t.base=this.base.clone():t.base=this.base,void 0!==this.byUserId)for(var n in t.byUserId={},this.byUserId){var r=this.byUserId[n];t.byUserId[n]=r instanceof Tc?r.clone():r}if(void 0!==this.byParticipantId)for(var i in t.byParticipantId={},this.byParticipantId){var a=this.byParticipantId[i];t.byParticipantId[i]=a instanceof Tc?a.clone():a}return t}},{key:"toJSONObject",value:function(){var e={};if("boolean"==typeof this.base?e.base=this.base:this.base instanceof Tc&&(e.base=this.base.toJSONObject()),void 0!==this.byUserId)for(var t in e.byUserId={},this.byUserId){var n=this.byUserId[t];e.byUserId[t]=n instanceof Tc?n.toJSONObject():n}if(void 0!==this.byParticipantId)for(var r in e.byParticipantId={},this.byParticipantId){var i=this.byParticipantId[r];e.byParticipantId[r]=i instanceof Tc?i.toJSONObject():i}return e}},{key:"toMinifiedJSONObject",value:function(){var e={};if(void 0!==this.base&&("boolean"==typeof this.base?e.b=this.base:e.b=this.base.toMinifiedJSONObject()),void 0!==this.byUserId)for(var t in e.u={},this.byUserId){var n=this.byUserId[t];e.u[t]="boolean"==typeof n?n:n.toMinifiedJSONObject()}if(void 0!==this.byParticipantId)for(var r in e.p={},this.byParticipantId){var i=this.byParticipantId[r];e.p[r]="boolean"==typeof i?i:i.toMinifiedJSONObject()}return e}},{key:"normalize",value:function(){return this.base instanceof Tc&&(this.base=this.base.normalize()),this.byUserId&&(this.byUserId=Object.fromEntries(Object.entries(this.byUserId).map(function(e){var t=cr(e,2),n=t[0],r=t[1];return[n,r instanceof Tc?r.normalize():r]}))),this.byParticipantId&&(this.byParticipantId=Object.fromEntries(Object.entries(this.byParticipantId).map(function(e){var t=cr(e,2),n=t[0],r=t[1];return[n,r instanceof Tc?r.normalize():r]}))),this}}],[{key:"fromJSONObject",value:function(t){var n,r,i;if(void 0!==t.base&&(n="boolean"==typeof t.base?t.base:Tc.fromJSONObject(t.base)),void 0!==t.byUserId)for(var a in r={},t.byUserId){var o=t.byUserId[a];r[a]="boolean"==typeof o?o:Tc.fromJSONObject(o)}if(void 0!==t.byParticipantId)for(var s in i={},t.byParticipantId){var l=t.byParticipantId[s];i[s]="boolean"==typeof l?l:Tc.fromJSONObject(l)}return new e({base:n,byUserId:r,byParticipantId:i})}},{key:"fromMinifiedJSONObject",value:function(t){var n,r,i;if(void 0!==t.b&&(n="boolean"==typeof t.b?t.b:Tc.fromMinifiedJSONObject(t.b)),void 0!==t.u)for(var a in r={},t.u){var o=t.u[a];r[a]="boolean"==typeof o?o:Tc.fromMinifiedJSONObject(o)}if(void 0!==t.p)for(var s in i={},t.p){var l=t.p[s];i[s]="boolean"==typeof l?l:Tc.fromMinifiedJSONObject(l)}return new e({base:n,byUserId:r,byParticipantId:i})}},{key:"validateJSONObject",value:function(e){if("object"!==Kn(e))return[!1,"canReceive must be an object"];for(var t=["base","byUserId","byParticipantId"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!t.includes(i))return[!1,"canReceive can only contain keys (".concat(t.join(", "),")")];if("base"===i){var a=cr(Tc.validateJSONObject(e.base,!0),2),o=a[0],s=a[1];if(!o)return[!1,s]}else{if("object"!==Kn(e[i]))return[!1,"invalid (non-object) value for field '".concat(i,"' in canReceive")];for(var l=0,c=Object.values(e[i]);l<c.length;l++){var u=c[l],d=cr(Tc.validateJSONObject(u),2),f=d[0],p=d[1];if(!f)return[!1,p]}}}return[!0]}}])}(),Tc=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.video,r=t.audio,i=t.screenVideo,a=t.screenAudio,o=t.customVideo,s=t.customAudio;Yn(this,e),this.video=n,this.audio=r,this.screenVideo=i,this.screenAudio=a,this.customVideo=o,this.customAudio=s}return er(e,[{key:"clone",value:function(){var t=new e;return void 0!==this.video&&(t.video=this.video),void 0!==this.audio&&(t.audio=this.audio),void 0!==this.screenVideo&&(t.screenVideo=this.screenVideo),void 0!==this.screenAudio&&(t.screenAudio=this.screenAudio),void 0!==this.customVideo&&(t.customVideo=yc({},this.customVideo)),void 0!==this.customAudio&&(t.customAudio=yc({},this.customAudio)),t}},{key:"toJSONObject",value:function(){var e={};return void 0!==this.video&&(e.video=this.video),void 0!==this.audio&&(e.audio=this.audio),void 0!==this.screenVideo&&(e.screenVideo=this.screenVideo),void 0!==this.screenAudio&&(e.screenAudio=this.screenAudio),void 0!==this.customVideo&&(e.customVideo=yc({},this.customVideo)),void 0!==this.customAudio&&(e.customAudio=yc({},this.customAudio)),e}},{key:"toMinifiedJSONObject",value:function(){var e={};return void 0!==this.video&&(e.v=this.video),void 0!==this.audio&&(e.a=this.audio),void 0!==this.screenVideo&&(e.sv=this.screenVideo),void 0!==this.screenAudio&&(e.sa=this.screenAudio),void 0!==this.customVideo&&(e.cv=yc({},this.customVideo)),void 0!==this.customAudio&&(e.ca=yc({},this.customAudio)),e}},{key:"normalize",value:function(){function e(e,t){return e&&1===Object.keys(e).length&&e["*"]===t}return!(!0!==this.video||!0!==this.audio||!0!==this.screenVideo||!0!==this.screenAudio||!e(this.customVideo,!0)||!e(this.customAudio,!0))||(!1!==this.video||!1!==this.audio||!1!==this.screenVideo||!1!==this.screenAudio||!e(this.customVideo,!1)||!e(this.customAudio,!1))&&this}}],[{key:"fromBoolean",value:function(t){return new e({video:t,audio:t,screenVideo:t,screenAudio:t,customVideo:{"*":t},customAudio:{"*":t}})}},{key:"fromJSONObject",value:function(t){return new e({video:t.video,audio:t.audio,screenVideo:t.screenVideo,screenAudio:t.screenAudio,customVideo:void 0!==t.customVideo?yc({},t.customVideo):void 0,customAudio:void 0!==t.customAudio?yc({},t.customAudio):void 0})}},{key:"fromMinifiedJSONObject",value:function(t){return new e({video:t.v,audio:t.a,screenVideo:t.sv,screenAudio:t.sa,customVideo:t.cv,customAudio:t.ca})}},{key:"validateJSONObject",value:function(e,t){if("boolean"==typeof e)return[!0];if("object"!==Kn(e))return[!1,"invalid (non-object, non-boolean) value in canReceive"];for(var n=Object.keys(e),r=0,i=n;r<i.length;r++){var a=i[r];if(!kc.includes(a))return[!1,"invalid media type '".concat(a,"' in canReceive")];if(_c.includes(a)){if("boolean"!=typeof e[a])return[!1,"invalid (non-boolean) value for media type '".concat(a,"' in canReceive")]}else{if("object"!==Kn(e[a]))return[!1,"invalid (non-object) value for media type '".concat(a,"' in canReceive")];for(var o=0,s=Object.values(e[a]);o<s.length;o++)if("boolean"!=typeof s[o])return[!1,"invalid (non-boolean) value for entry within '".concat(a,"' in canReceive")];if(t&&void 0===e[a]["*"])return[!1,'canReceive "base" permission must specify "*" as an entry within \''.concat(a,"'")]}}return t&&n.length!==kc.length?[!1,'canReceive "base" permission must specify all media types: '.concat(kc.join(", ")," (or be set to a boolean shorthand)")]:[!0]}}])}(),Mc=["result"],Pc=["preserveIframe"];function Ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ac(Object(n),!0).forEach(function(t){ar(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ac(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Nc=function(){return!!e})()}function Lc(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jc(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function jc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ic={},Rc="video",Fc="voice",Dc=fl()?{data:{}}:{data:{},topology:"none"},Bc={present:0,hidden:0},zc={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Uc=Object.keys(zc),Vc=["state","volume","simulcastEncodings"],$c={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},Wc={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string",visualState:"'default' | 'sidebar-open' | 'active'"}},qc={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},Hc={customIntegrations:{validate:vu,help:mu()},customTrayButtons:{validate:gu,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(Wc))},url:{validate:function(e){return"string"==typeof e},help:"url should be a string"},baseUrl:{validate:function(e){return"string"==typeof e},help:"baseUrl should be a string"},token:{validate:function(e){return"string"==typeof e},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(e,t){try{return t.validateDailyConfig(e),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(e){return yu(e,$c)},help:"reactNativeConfig should look like ".concat(JSON.stringify($c),", all fields optional")},lang:{validate:function(e){return["da","de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(e)},help:"language not supported. Options are: da, de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(e){try{return ou(e),!0}catch(t){return console.error(t),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,allowLocalVideo:!0,allowLocalAudio:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(e,t){if("boolean"==typeof e)return t._preloadCache.allowLocalVideo=e,!0;var n;if(e instanceof MediaStreamTrack)t._sharedTracks.videoTrack=e,n={customTrack:al};else{if(delete t._sharedTracks.videoTrack,"string"!=typeof e)return console.error("videoSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:e}}return t._updatePreloadCacheInputSettings({video:{settings:n}},!1),!0}},audioSource:{validate:function(e,t){if("boolean"==typeof e)return t._preloadCache.allowLocalAudio=e,!0;var n;if(e instanceof MediaStreamTrack)t._sharedTracks.audioTrack=e,n={customTrack:al};else{if(delete t._sharedTracks.audioTrack,"string"!=typeof e)return console.error("audioSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:e}}return t._updatePreloadCacheInputSettings({audio:{settings:n}},!1),!0}},subscribeToTracksAutomatically:{validate:function(e,t){return t._preloadCache.subscribeToTracksAutomatically=e,!0}},theme:{validate:function(e){var t=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!t.includes(i))return console.error('unsupported color "'.concat(i,'". Valid colors: ').concat(t.join(", "))),!1;if(!e[i].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(i,' theme color should be provided in valid hex color format. Received: "').concat(e[i],'"')),!1}return!0};return"object"===Kn(e)&&("light"in e&&"dark"in e||"colors"in e)?"light"in e&&"dark"in e?"colors"in e.light?"colors"in e.dark?n(e.light.colors)&&n(e.dark.colors):(console.error('Dark theme is missing "colors" property.',e),!1):(console.error('Light theme is missing "colors" property.',e),!1):n(e.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',e),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(e){if("grid"in e){var t=e.grid;if("maxTilesPerPage"in t){if(!Number.isInteger(t.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(t.maxTilesPerPage,".")),!1;if(t.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in 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(e){return su(e,{allowAllParticipantsKey:!1})},help:hu({allowAllParticipantsKey:!1})},sendSettings:{validate:function(e,t){return!!function(e,t){try{return t.validateUpdateSendSettings(e),!0}catch(n){return console.error("Failed to validate send settings",n),!1}}(e,t)&&(t._preloadCache.sendSettings=e,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(e,t){var n;return!!lu(e)&&(t._inputSettings||(t._inputSettings={}),cu(e,null===(n=t.properties)||void 0===n?void 0:n.dailyConfig,t._sharedTracks),t._updatePreloadCacheInputSettings(e,!0),!0)},help:pu()},layout:{validate:function(e){return"custom-v1"===e||"browser"===e||"none"===e},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},Jc={styles:{validate:function(e){for(var t in e)if("cam"!==t&&"screen"!==t)return!1;if(e.cam)for(var n in e.cam)if("div"!==n&&"video"!==n)return!1;if(e.screen)for(var r in e.screen)if("div"!==r&&"video"!==r)return!1;return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(e,t){if(t._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(e)||!fl()&&"avatar"===e)return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"],i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var a in e)if("custom"===a){if(!n.includes(e[a])&&!i(e[a],!0))return!1}else{var o=!t&&!r.includes(a),s=!n.includes(e[a]);if(o||s)return!1}return!0};return i(e)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(fl()?"":" | '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(e){return!1===e},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=cr(n[t],2),i=r[0],a=r[1];switch(i){case"hasPresence":if("boolean"!=typeof a)return!1;break;case"canSend":if(a instanceof Set||a instanceof Array||Array.isArray(a)){var o,s=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=Lc(a);try{for(l.s();!(o=l.n()).done;){var c=o.value;if(!s.includes(c))return!1}}catch(v){l.e(v)}finally{l.f()}}else if("boolean"!=typeof a)return!1;(a instanceof Array||Array.isArray(a))&&(e.canSend=new Set(a));break;case"canReceive":var u=cr(Ec.validateJSONObject(a),2),d=u[0],f=u[1];if(!d)return console.error(f),!1;break;case"canAdmin":if(a instanceof Set||a instanceof Array||Array.isArray(a)){var p,h=["participants","streaming","transcription"],m=Lc(a);try{for(m.s();!(p=m.n()).done;){var g=p.value;if(!h.includes(g))return!1}}catch(v){m.e(v)}finally{m.f()}}else if("boolean"!=typeof a)return!1;(a instanceof Array||Array.isArray(a))&&(e.canAdmin=new Set(a));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, canReceive, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canReceive must be an object specifying base, byUserId, and/or byParticipantId fields (see documentation for more details). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var e=sr(function*(e){return new Promise(function(t,n){var r=[];e.forEach(function(i){return Promise.resolve(i).then(function(e){t(e)}).catch(function(t){r.push(t),r.length===e.length&&n(r)})})})});return function(t){return e.apply(this,arguments)}}());var Gc=function(){function e(t){var n,r,i,a,o,s,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Yn(this,e),i=this,a=nr(a=e),ar(r=tr(i,Nc()?Reflect.construct(a,[],nr(i).constructor):a.apply(i,undefined)),"startListeningForDeviceChanges",function(){hc(r.handleDeviceChange)}),ar(r,"stopListeningForDeviceChanges",function(){!function(e){var t;mc()?(t=e,cc.has(t)&&(cc.delete(t),0===cc.size&&uc&&(navigator.mediaDevices.removeEventListener("devicechange",uc),uc=null))):function(e){fc.has(e)&&(fc.delete(e),0===fc.size&&pc&&(clearInterval(pc),pc=null))}(e)}(r.handleDeviceChange)}),ar(r,"handleDeviceChange",function(e){e=e.map(function(e){return JSON.parse(JSON.stringify(e))}),r.emitDailyJSEvent({action:"available-devices-updated",availableDevices:e})}),ar(r,"handleNativeAppStateChange",(s=sr(function*(e){if("destroyed"===e)return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield r.destroy());var t="active"===e;r.disableReactNativeAutoDeviceManagement("video")||(t?r.camUnmutedBeforeLosingNativeActiveState&&r.setLocalVideo(!0):(r.camUnmutedBeforeLosingNativeActiveState=r.localVideo(),r.camUnmutedBeforeLosingNativeActiveState&&r.setLocalVideo(!1)))}),function(e){return s.apply(this,arguments)})),ar(r,"handleNativeAudioFocusChange",function(e){r.disableReactNativeAutoDeviceManagement("audio")||(r._hasNativeAudioFocus=e,r.toggleParticipantAudioBasedOnNativeAudioFocus(),r._hasNativeAudioFocus?r.micUnmutedBeforeLosingNativeAudioFocus&&r.setLocalAudio(!0):(r.micUnmutedBeforeLosingNativeAudioFocus=r.localAudio(),r.setLocalAudio(!1)))}),ar(r,"handleNativeSystemScreenCaptureStop",function(){r.stopScreenShare()}),!bl()&&!fl())throw new Error("WebRTC not supported or suppressed");if(r.strictMode=void 0===l.strictMode||l.strictMode,r.allowMultipleCallInstances=null!==(n=l.allowMultipleCallInstances)&&void 0!==n&&n,Object.keys(Ic).length&&(r._logDuplicateInstanceAttempt(),!r.allowMultipleCallInstances)){if(r.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:{}}),r.callClientId=Or(),Ic[(o=r).callClientId]=o,window._daily.instances[r.callClientId]={},r._sharedTracks={},window._daily.instances[r.callClientId].tracks=r._sharedTracks,l.dailyJsVersion=e.version(),r._iframe=t,r._callObjectMode="none"===l.layout&&!r._iframe,r._preloadCache={subscribeToTracksAutomatically:!0,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},void 0!==l.showLocalVideo?r._callObjectMode?console.error("showLocalVideo is not available in call object mode"):r._showLocalVideo=!!l.showLocalVideo:r._showLocalVideo=!0,void 0!==l.showParticipantsBar?r._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):r._showParticipantsBar=!!l.showParticipantsBar:r._showParticipantsBar=!0,void 0!==l.customIntegrations?r._callObjectMode?console.error("customIntegrations is not available in call object mode"):r._customIntegrations=l.customIntegrations:r._customIntegrations={},void 0!==l.customTrayButtons?r._callObjectMode?console.error("customTrayButtons is not available in call object mode"):r._customTrayButtons=l.customTrayButtons:r._customTrayButtons={},void 0!==l.activeSpeakerMode?r._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):r._activeSpeakerMode=!!l.activeSpeakerMode:r._activeSpeakerMode=!1,l.receiveSettings?r._callObjectMode?r._receiveSettings=l.receiveSettings:console.error("receiveSettings is only available in call object mode"):r._receiveSettings={},r.validateProperties(l),r.properties=Oc({},l),r._inputSettings||(r._inputSettings={}),r._callObjectLoader=r._callObjectMode?new ql(r.callClientId):null,r._callState=js,r._isPreparingToJoin=!1,r._accessState={access:Us},r._meetingSessionSummary={},r._finalSummaryOfPrevSession={},r._meetingSessionState=Su(Dc,r._callObjectMode),r._nativeInCallAudioMode=Rc,r._participants={},r._isScreenSharing=!1,r._participantCounts=Bc,r._rmpPlayerState={},r._waitingParticipants={},r._network={threshold:"good",quality:100,networkState:"unknown",stats:{}},r._activeSpeaker={},r._localAudioLevel=0,r._isLocalAudioLevelObserverRunning=!1,r._remoteParticipantsAudioLevel={},r._isRemoteParticipantsAudioLevelObserverRunning=!1,r._maxAppMessageSize=Zs,r._messageChannel=fl()?new Rl:new Ll,r._iframe&&(r._iframe.requestFullscreen?r._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===r._iframe?(r.emitDailyJSEvent({action:Gs}),r.sendMessageToCallMachine({action:Gs})):(r.emitDailyJSEvent({action:Qs}),r.sendMessageToCallMachine({action:Qs}))}):r._iframe.webkitRequestFullscreen&&r._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===r._iframe?(r.emitDailyJSEvent({action:Gs}),r.sendMessageToCallMachine({action:Gs})):(r.emitDailyJSEvent({action:Qs}),r.sendMessageToCallMachine({action:Qs}))})),fl()){var c=r.nativeUtils();c.addAudioFocusChangeListener&&c.removeAudioFocusChangeListener&&c.addAppStateChangeListener&&c.removeAppStateChangeListener&&c.addSystemScreenCaptureStopListener&&c.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),r._hasNativeAudioFocus=!0,c.addAudioFocusChangeListener(r.handleNativeAudioFocusChange),c.addAppStateChangeListener(r.handleNativeAppStateChange),c.addSystemScreenCaptureStopListener(r.handleNativeSystemScreenCaptureStop)}return r._callObjectMode&&r.startListeningForDeviceChanges(),r._messageChannel.addListenerForMessagesFromCallMachine(r.handleMessageFromCallMachine,r.callClientId,r),r}return ir(e,hr),er(e,[{key:"destroy",value:(z=sr(function*(){var e;try{yield this.leave()}catch(i){}var t=this._iframe;if(t){var n=t.parentElement;n&&n.removeChild(t)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),fl()){var r=this.nativeUtils();r.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),r.removeAppStateChangeListener(this.handleNativeAppStateChange),r.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Ic[this.callClientId],(null===(e=window)||void 0===e||null===(e=e._daily)||void 0===e?void 0:e.instances)&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return z.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(e){var t=e.bodyClass,n=e.cssFile,r=e.cssText;return iu(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(n),bodyClass:t,cssText:r}),this}},{key:"iframe",value:function(){return iu(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return nu(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return nu(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(e,t){for(var n in t){if(!Jc[n])throw new Error("unrecognized updateParticipant property ".concat(n));if(Jc[n].validate&&!Jc[n].validate(t[n],this,this._participants[e]))throw new Error(Jc[n].help)}}},{key:"updateParticipant",value:function(e,t){return this._participants.local&&this._participants.local.session_id===e&&(e="local"),e&&t&&(this.validateParticipantProperties(e,t),this.sendMessageToCallMachine({action:"update-participant",id:e,properties:t})),this}},{key:"updateParticipants",value:function(e){var t=this._participants.local&&this._participants.local.session_id;for(var n in e)n===t&&(n="local"),n&&e[n]&&this.validateParticipantProperties(n,e[n]);return this.sendMessageToCallMachine({action:"update-participants",participants:e}),this}},{key:"updateWaitingParticipant",value:(B=sr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(nu(this._callObjectMode,"updateWaitingParticipant()"),Kc(this._callState,"updateWaitingParticipant()"),"string"!=typeof t||"object"!==Kn(n))throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(r,i){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:t,updates:n},function(e){e.error&&i(e.error),e.id||i(new Error("unknown error in updateWaitingParticipant()")),r({id:e.id})})})}),function(){return B.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(D=sr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(nu(this._callObjectMode,"updateWaitingParticipants()"),Kc(this._callState,"updateWaitingParticipants()"),"object"!==Kn(t))throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(n,r){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:t},function(e){e.error&&r(e.error),e.ids||r(new Error("unknown error in updateWaitingParticipants()")),n({ids:e.ids})})})}),function(){return D.apply(this,arguments)})},{key:"requestAccess",value:(F=sr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.access,r=void 0===n?{level:"full"}:n,i=t.name,a=void 0===i?"":i;return nu(this._callObjectMode,"requestAccess()"),Kc(this._callState,"requestAccess()"),new Promise(function(t,n){e.sendMessageToCallMachine({action:"daily-method-request-access",access:r,name:a},function(e){e.error&&n(e.error),e.access||n(new Error("unknown error in requestAccess()")),t({access:e.access,granted:e.granted})})})}),function(){return F.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(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"forceDiscardTrack"in t&&(fl()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),t={}):e&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),t={})),this.sendMessageToCallMachine({action:"local-audio",state:e,options:t}),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(e){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:e}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(e){return this.sendMessageToCallMachine({action:"local-video",state:e}),this}},{key:"_setAllowLocalAudio",value:function(e){if(this._preloadCache.allowLocalAudio=e,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-audio",state:e}),this}},{key:"_setAllowLocalVideo",value:function(e){if(this._preloadCache.allowLocalVideo=e,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-video",state:e}),this}},{key:"getReceiveSettings",value:(R=sr(function*(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).showInheritedValues,r=void 0!==n&&n;if(nu(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(Kn(e)){case"string":return new Promise(function(n){t.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:e,showInheritedValues:r},function(e){n(e.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(e){return R.apply(this,arguments)})},{key:"updateReceiveSettings",value:(I=sr(function*(e){var t=this;if(nu(this._callObjectMode,"updateReceiveSettings()"),!su(e,{allowAllParticipantsKey:!0}))throw new Error(hu({allowAllParticipantsKey:!0}));return Kc(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(n){t.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:e},function(e){n({receiveSettings:e.receiveSettings})})})}),function(e){return I.apply(this,arguments)})},{key:"_prepInputSettingsForSharing",value:function(e,t){if(e){var n={};if(e.audio){var r,i,a;e.audio.settings&&(!Object.keys(e.audio.settings).length&&t||(n.audio={settings:Oc({},e.audio.settings)})),t&&null!==(r=n.audio)&&void 0!==r&&null!==(r=r.settings)&&void 0!==r&&r.customTrack&&(n.audio.settings={customTrack:this._sharedTracks.audioTrack});var o="none"===(null===(i=e.audio.processor)||void 0===i?void 0:i.type)&&(null===(a=e.audio.processor)||void 0===a?void 0:a._isDefaultWhenNone);if(e.audio.processor&&!o){var s=Oc({},e.audio.processor);delete s._isDefaultWhenNone,n.audio=Oc(Oc({},n.audio),{},{processor:s})}}if(e.video){var l,c,u;e.video.settings&&(!Object.keys(e.video.settings).length&&t||(n.video={settings:Oc({},e.video.settings)})),t&&null!==(l=n.video)&&void 0!==l&&null!==(l=l.settings)&&void 0!==l&&l.customTrack&&(n.video.settings={customTrack:this._sharedTracks.videoTrack});var d="none"===(null===(c=e.video.processor)||void 0===c?void 0:c.type)&&(null===(u=e.video.processor)||void 0===u?void 0:u._isDefaultWhenNone);if(e.video.processor&&!d){var f=Oc({},e.video.processor);delete f._isDefaultWhenNone,n.video=Oc(Oc({},n.video),{},{processor:f})}}return n}}},{key:"getInputSettings",value:function(){var e=this;return iu(),new Promise(function(t){t(e._getInputSettings())})}},{key:"_getInputSettings",value:function(){var e,t,n,r,i,a,o={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(e=(null===(n=this._inputSettings)||void 0===n?void 0:n.video)||o,t=(null===(r=this._inputSettings)||void 0===r?void 0:r.audio)||o):(e=(null===(i=this._preloadCache)||void 0===i||null===(i=i.inputSettings)||void 0===i?void 0:i.video)||o,t=(null===(a=this._preloadCache)||void 0===a||null===(a=a.inputSettings)||void 0===a?void 0:a.audio)||o);var s={audio:t,video:e};return this._prepInputSettingsForSharing(s,!0)}},{key:"_updatePreloadCacheInputSettings",value:function(e,t){var n,r,i,a,o,s,l=this._inputSettings||{},c={};e.video?(c.video={},e.video.settings?(c.video.settings={},t||e.video.settings.customTrack||null===(i=l.video)||void 0===i||!i.settings?c.video.settings=e.video.settings:c.video.settings=Oc(Oc({},l.video.settings),e.video.settings),Object.keys(c.video.settings).length||delete c.video.settings):null!==(n=l.video)&&void 0!==n&&n.settings&&(c.video.settings=l.video.settings),e.video.processor?c.video.processor=e.video.processor:null!==(r=l.video)&&void 0!==r&&r.processor&&(c.video.processor=l.video.processor)):l.video&&(c.video=l.video);e.audio?(c.audio={},e.audio.settings?(c.audio.settings={},t||e.audio.settings.customTrack||null===(s=l.audio)||void 0===s||!s.settings?c.audio.settings=e.audio.settings:c.audio.settings=Oc(Oc({},l.audio.settings),e.audio.settings),Object.keys(c.audio.settings).length||delete c.audio.settings):null!==(a=l.audio)&&void 0!==a&&a.settings&&(c.audio.settings=l.audio.settings),e.audio.processor?c.audio.processor=e.audio.processor:null!==(o=l.audio)&&void 0!==o&&o.processor&&(c.audio.processor=l.audio.processor)):l.audio&&(c.audio=l.audio);this._maybeUpdateInputSettings(c)}},{key:"_devicesFromInputSettings",value:function(e){var t,n,r=(null==e||null===(t=e.video)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.deviceId)||null,i=(null==e||null===(n=e.audio)||void 0===n||null===(n=n.settings)||void 0===n?void 0:n.deviceId)||null,a=this._preloadCache.outputDeviceId||null;return{camera:r?{deviceId:r}:{},mic:i?{deviceId:i}:{},speaker:a?{deviceId:a}:{}}}},{key:"updateInputSettings",value:(j=sr(function*(e){var t=this;return iu(),lu(e)?e.video||e.audio?(cu(e,this.properties.dailyConfig,this._sharedTracks),this._callObjectMode&&!this._callMachineInitialized?(this._updatePreloadCacheInputSettings(e,!0),this._getInputSettings()):new Promise(function(n,r){t.sendMessageToCallMachine({action:"update-input-settings",inputSettings:e},function(i){if(i.error)r(i.error);else{if(i.returnPreloadCache)return t._updatePreloadCacheInputSettings(e,!0),void n(t._getInputSettings());t._maybeUpdateInputSettings(i.inputSettings),n(t._prepInputSettingsForSharing(i.inputSettings,!0))}})})):this._getInputSettings():(console.error(pu()),Promise.reject(pu()))}),function(e){return j.apply(this,arguments)})},{key:"setBandwidth",value:function(e){var t=e.kbs,n=e.trackConstraints;if(iu(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:t,trackConstraints:n}),this}},{key:"getDailyLang",value:function(){var e=this;if(iu(),this._callMachineInitialized)return new Promise(function(t){e.sendMessageToCallMachine({action:"get-daily-lang"},function(e){delete e.action,delete e.callbackStamp,t(e)})})}},{key:"setDailyLang",value:function(e){return iu(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:e}),this}},{key:"setProxyUrl",value:function(e){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:e}),this}},{key:"setIceConfig",value:function(e){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:e}),this}},{key:"meetingSessionSummary",value:function(){return[Bs,zs].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(L=sr(function*(){var e=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),Kc(this._callState,"getMeetingSession()"),new Promise(function(t){e.sendMessageToCallMachine({action:"get-meeting-session"},function(e){delete e.action,delete e.callbackStamp,t(e)})})}),function(){return L.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return Kc(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"replace";nu(this._callObjectMode,"setMeetingSessionData()"),Kc(this._callState,"setMeetingSessionData");try{new zl({data:t=e,mergeStrategy:n})}catch(t){throw console.error(t),t}try{this.sendMessageToCallMachine({action:"set-session-data",data:e,mergeStrategy:n})}catch(t){throw new Error("Error setting meeting session data: ".concat(t))}}},{key:"setUserName",value:function(e,t){var n=this;return this.properties.userName=e,new Promise(function(r){n.sendMessageToCallMachine({action:"set-user-name",name:null!=e?e:"",thisMeetingOnly:fl()||!!t&&!!t.thisMeetingOnly},function(e){delete e.action,delete e.callbackStamp,r(e)})})}},{key:"setUserData",value:(N=sr(function*(e){var t=this;try{ou(e)}catch(n){throw console.error(n),n}if(this.properties.userData=e,this._callMachineInitialized)return new Promise(function(r){try{t.sendMessageToCallMachine({action:"set-user-data",userData:e},function(e){delete e.action,delete e.callbackStamp,r(e)})}catch(n){throw new Error("Error setting user data: ".concat(n))}})}),function(e){return N.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(e){if(e&&(e<100||"number"!=typeof e))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(e){var t=this;if("undefined"==typeof AudioWorkletNode&&!fl())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(e),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(n,r){t.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:e},function(e){t._isLocalAudioLevelObserverRunning=!e.error,e.error?r({error:e.error}):n()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:e}}},{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(e){var t=this;if(this.validateAudioLevelInterval(e),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(n,r){t.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:e},function(e){t._isRemoteParticipantsAudioLevelObserverRunning=!e.error,e.error?r({error:e.error}):n()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:e}}},{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:(O=sr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(nu(this._callObjectMode,"startCamera()"),Zc(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(t)}catch(n){return Promise.reject(n)}else{if(this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(t),this.properties=Oc(Oc({},this.properties),t)}return new Promise(function(t){e._preloadCache.inputSettings=e._prepInputSettingsForSharing(e._inputSettings,!1),e.sendMessageToCallMachine({action:"start-camera",properties:Yc(e.properties,e.callClientId),preloadCache:Yc(e._preloadCache,e.callClientId)},function(e){t({camera:e.camera,mic:e.mic,speaker:e.speaker})})})}),function(){return O.apply(this,arguments)})},{key:"validateCustomTrack",value:function(e,t,n){if(n&&n.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(t&&"music"!==t&&"speech"!==t&&!(t instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(n&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(n))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(!(e instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{track:track,mode:mode,trackName:trackName,ignoreAudioLevel:ignoreAudioLevel};return iu(),Kc(this._callState,"startCustomTrack()"),this.validateCustomTrack(t.track,t.mode,t.trackName),new Promise(function(n,r){e._sharedTracks.customTrack=t.track,t.track=al,e.sendMessageToCallMachine({action:"start-custom-track",properties:t},function(e){e.error?r({error:e.error}):n(e.mediaTag)})})}},{key:"stopCustomTrack",value:function(e){var t=this;return iu(),Kc(this._callState,"stopCustomTrack()"),new Promise(function(n){t.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:e},function(e){n(e.mediaTag)})})}},{key:"setCamera",value:function(e){var t=this;return au(),eu(this._callMachineInitialized,"setCamera()"),new Promise(function(n){t.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:e},function(e){n({device:e.device})})})}},{key:"setAudioDevice",value:(A=sr(function*(e){return au(),this.nativeUtils().setAudioDevice(e),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(e){return A.apply(this,arguments)})},{key:"cycleCamera",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(n){e.sendMessageToCallMachine({action:"cycle-camera",properties:t},function(e){n({device:e.device})})})}},{key:"cycleMic",value:function(){var e=this;return iu(),new Promise(function(t){e.sendMessageToCallMachine({action:"cycle-mic"},function(e){t({device:e.device})})})}},{key:"getCameraFacingMode",value:function(){var e=this;return au(),new Promise(function(t){e.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(e){t(e.facingMode)})})}},{key:"setInputDevicesAsync",value:(P=sr(function*(e){var t=this,n=e.audioDeviceId,r=e.videoDeviceId,i=e.audioSource,a=e.videoSource;if(iu(),void 0!==i&&(n=i),void 0!==a&&(r=a),"boolean"==typeof n&&(this._setAllowLocalAudio(n),n=void 0),"boolean"==typeof r&&(this._setAllowLocalVideo(r),r=void 0),!n&&!r)return yield this.getInputDevices();var o={};return n&&(n instanceof MediaStreamTrack?(this._sharedTracks.audioTrack=n,n=al,o.audio={settings:{customTrack:n}}):(delete this._sharedTracks.audioTrack,o.audio={settings:{deviceId:n}})),r&&(r instanceof MediaStreamTrack?(this._sharedTracks.videoTrack=r,r=al,o.video={settings:{customTrack:r}}):(delete this._sharedTracks.videoTrack,o.video={settings:{deviceId:r}})),this._callObjectMode&&this.needsLoad()?(this._updatePreloadCacheInputSettings(o,!1),this._devicesFromInputSettings(this._inputSettings)):new Promise(function(e){t.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:n,videoDeviceId:r},function(n){if(delete n.action,delete n.callbackStamp,n.returnPreloadCache)return t._updatePreloadCacheInputSettings(o,!1),void e(t._devicesFromInputSettings(t._inputSettings));e(n)})})}),function(e){return P.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(M=sr(function*(e){var t=this,n=e.outputDeviceId;if(iu(),!n||"string"!=typeof n)throw new Error("outputDeviceId must be provided and must be a valid device id");return this._preloadCache.outputDeviceId=n,this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(e,r){t.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:n},function(n){if(delete n.action,delete n.callbackStamp,n.error){var i=new Error(n.error.message);return i.type=n.error.type,void r(i)}n.returnPreloadCache?e(t._devicesFromInputSettings(t._inputSettings)):e(n)})})}),function(e){return M.apply(this,arguments)})},{key:"getInputDevices",value:(T=sr(function*(){var e=this;return this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(t){e.sendMessageToCallMachine({action:"get-input-devices"},function(n){n.returnPreloadCache?t(e._devicesFromInputSettings(e._inputSettings)):t({camera:n.camera,mic:n.mic,speaker:n.speaker})})})}),function(){return T.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return au(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(e){if(au(),[Rc,Fc].includes(e)){if(e!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=e,!this.disableReactNativeAutoDeviceManagement("audio")&&Xc(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",e)}},{key:"preAuth",value:(E=sr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(nu(this._callObjectMode,"preAuth()"),Zc(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(t)),!t.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(t),this.properties=Oc(Oc({},this.properties),t),new Promise(function(t,n){e._preloadCache.inputSettings=e._prepInputSettingsForSharing(e._inputSettings,!1),e.sendMessageToCallMachine({action:"daily-method-preauth",properties:Yc(e.properties,e.callClientId),preloadCache:Yc(e._preloadCache,e.callClientId)},function(r){return r.error?n(r.error):r.access?(e._didPreAuth=!0,void t({access:r.access})):n(new Error("unknown error in preAuth()"))})})}),function(){return E.apply(this,arguments)})},{key:"load",value:(C=sr(function*(e){var t=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(e&&(this.validateProperties(e),this.properties=Oc(Oc({},this.properties),e)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(Is),this.emitDailyJSEvent({action:"loading"}),this._callObjectMode?new Promise(function(e,n){t._callObjectLoader.cancel();var r=Date.now();t._callObjectLoader.load(t.properties.dailyConfig,function(n){t._bundleLoadTime=n?"no-op":Date.now()-r,t._updateCallState(Rs),n&&t.emitDailyJSEvent({action:qs}),e()},function(e,r){if(t.emitDailyJSEvent({action:"load-attempt-failed"}),!r){t._updateCallState(zs),t.resetMeetingDependentVars();var i={action:Xs,errorMsg:e.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:e,bundleUrl:jr(t.properties.dailyConfig)}}};t._maybeSendToSentry(i),t.emitDailyJSEvent(i),n(e.msg)}})}):(this._iframe.src=Lr(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(e,n){t._loadedCallback=function(r){t._callState!==zs?(t._updateCallState(Rs),(t.properties.cssFile||t.properties.cssText)&&t.loadCss(t.properties),e()):n(r)}}))}}),function(e){return C.apply(this,arguments)})},{key:"join",value:(x=sr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var n=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(t)}catch(r){return this.updateIsPreparingToJoin(!1),Promise.reject(r)}}else{if(n=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(t.url&&!this._callObjectMode&&t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(t.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(t),this.properties=Oc(Oc({},this.properties),t)}return void 0!==t.showLocalVideo&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!t.showLocalVideo),void 0!==t.showParticipantsBar&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!t.showParticipantsBar),this._callState===Ds||this._callState===Fs?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Fs,!1),this.emitDailyJSEvent({action:"joining-meeting"}),this._preloadCache.inputSettings=this._prepInputSettingsForSharing(this._inputSettings||{},!1),this.sendMessageToCallMachine({action:"join-meeting",properties:Yc(this.properties,this.callClientId),preloadCache:Yc(this._preloadCache,this.callClientId)}),new Promise(function(t,r){e._joinedCallback=function(i,a){if(e._callState!==zs){if(e._updateCallState(Ds),i)for(var o in i){if(e._callObjectMode){var s=e._callMachine().store;ic(i[o],s),ac(i[o],s),sc(i[o],e._participants[o],s)}e._participants[o]=Oc({},i[o]),e.toggleParticipantAudioBasedOnNativeAudioFocus()}n&&e.loadCss(e.properties),t(i)}else r(a)}}))}),function(){return x.apply(this,arguments)})},{key:"leave",value:(_=sr(function*(){var e=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(t){e._callState===Bs||e._callState===zs?t():e._callObjectLoader&&!e._callObjectLoader.loaded?(e._callObjectLoader.cancel(),e._updateCallState(Bs),e.resetMeetingDependentVars(),e.emitDailyJSEvent({action:Bs}),t()):(e._resolveLeave=t,e.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return _.apply(this,arguments)})},{key:"startScreenShare",value:(S=sr(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(eu(this._callMachineInitialized,"startScreenShare()"),t.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",t.screenVideoSendSettings),t.mediaStream&&(this._sharedTracks.screenMediaStream=t.mediaStream,t.mediaStream=al),"undefined"!=typeof DailyNativeUtils&&void 0!==DailyNativeUtils.isIOS&&DailyNativeUtils.isIOS){var n=this.nativeUtils();if(yield n.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Ks,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});n.setSystemScreenCaptureStartCallback(function(){n.setSystemScreenCaptureStartCallback(null),e.sendMessageToCallMachine({action:nl,captureOptions:t})}),n.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:nl,captureOptions:t})}),function(){return S.apply(this,arguments)})},{key:"stopScreenShare",value:function(){eu(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type;if(t&&"cloud"!==t&&"raw-tracks"!==t&&"local"!==t)throw new Error("invalid type: ".concat(t,", allowed values 'cloud', 'raw-tracks', or 'local'"));this.sendMessageToCallMachine(Oc({action:"local-recording-start"},e))}},{key:"updateRecording",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:n,instanceId:r})}},{key:"stopRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Oc({action:"local-recording-stop"},e))}},{key:"startLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Oc({action:"daily-method-start-live-streaming"},e))}},{key:"updateLiveStreaming",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:n,instanceId:r})}},{key:"addLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:rl,endpointsOp:"add-endpoints",endpoints:t,instanceId:n})}},{key:"removeLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:rl,endpointsOp:"remove-endpoints",endpoints:t,instanceId:n})}},{key:"stopLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Oc({action:"daily-method-stop-live-streaming"},e))}},{key:"validateDailyConfig",value:function(e){e.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(e.camSimulcastEncodings)),e.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),wl()&&e.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(!(e instanceof Array||Array.isArray(e)))throw new Error("encodings must be an Array");if(!ku(e.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var r=0;r<e.length;r++){var i=e[r];for(var a in this._validateEncodingLayerHasValidProperties(i),i)if(Uc.includes(a)){if("number"!=typeof i[a])throw new Error("".concat(a," must be a number"));if(t){var o=t[a],s=o.min,l=o.max;if(!ku(i[a],s,l))throw new Error("".concat(a," value not in range. valid range: ").concat(s," to ").concat(l))}}else if(!["active","scalabilityMode"].includes(a))throw new Error("Invalid key ".concat(a,", valid keys are:")+Object.values(Uc));if(n&&!i.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(k=sr(function*(e){var t=this,n=e.url,r=e.settings,i=void 0===r?{state:ll.PLAY}:r;try{!function(e){if("string"!=typeof e)throw new Error('url parameter must be "string" type')}(n),wu(i),function(e){for(var t in e)if(!Vc.includes(t))throw new Error("Invalid key ".concat(t,", valid keys are: ").concat(Vc));e.simulcastEncodings&&this.validateSimulcastEncodings(e.simulcastEncodings,zc,!0)}(i)}catch(a){throw console.error("invalid argument Error: ".concat(a)),console.error('startRemoteMediaPlayer arguments must be of the form:\n { url: "playback url",\n settings?:\n {state: "play"|"pause", simulcastEncodings?: [{}] } }'),a}return new Promise(function(e,r){t.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:n,settings:i},function(t){t.error?r({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})})})}),function(e){return k.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(w=sr(function*(e){var t=this;if("string"!=typeof e)throw new Error(" remotePlayerID must be of type string");return new Promise(function(n,r){t.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:e},function(e){e.error?r({error:e.error,errorMsg:e.errorMsg}):n()})})}),function(e){return w.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(b=sr(function*(e){var t=this,n=e.session_id,r=e.settings;try{wu(r)}catch(i){throw console.error("invalid argument Error: ".concat(i)),console.error('updateRemoteMediaPlayer arguments must be of the form:\n session_id: "participant session",\n { settings?: {state: "play"|"pause"} }'),i}return new Promise(function(e,i){t.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:n,settings:r},function(t){t.error?i({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})})})}),function(e){return b.apply(this,arguments)})},{key:"startTranscription",value:function(e){Kc(this._callState,"startTranscription()"),this.sendMessageToCallMachine(Oc({action:"daily-method-start-transcription"},e))}},{key:"updateTranscription",value:function(e){if(Kc(this._callState,"updateTranscription()"),!e)throw new Error("updateTranscription Error: options is mandatory");if("object"!==Kn(e))throw new Error("updateTranscription Error: options must be object type");if(e.participants&&!Array.isArray(e.participants))throw new Error("updateTranscription Error: participants must be an array");this.sendMessageToCallMachine(Oc({action:"daily-method-update-transcription"},e))}},{key:"stopTranscription",value:function(e){if(Kc(this._callState,"stopTranscription()"),e&&"object"!==Kn(e))throw new Error("stopTranscription Error: options must be object type");if(e&&!e.instanceId)throw new Error('"instanceId" not provided');this.sendMessageToCallMachine(Oc({action:"daily-method-stop-transcription"},e))}},{key:"startDialOut",value:(y=sr(function*(e){var t=this;Kc(this._callState,"startDialOut()");var n=function(e){if(e){if(!Array.isArray(e))throw new Error("Error starting dial out: audio codec must be an array");if(e.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");e.forEach(function(e){if("string"!=typeof e)throw new Error("Error starting dial out: audio codec must be a string");if("OPUS"!==e&&"PCMU"!==e&&"PCMA"!==e&&"G722"!==e)throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!e.sipUri&&!e.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(e.sipUri&&e.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(e.sipUri){if("string"!=typeof e.sipUri)throw new Error("Error starting dial out: sipUri must be a string");if(!e.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(e.video&&"boolean"!=typeof e.video)throw new Error("Error starting dial out: video must be a boolean value");!function(e){if(e&&(n(e.audio),e.video)){if(!Array.isArray(e.video))throw new Error("Error starting dial out: video codec must be an array");if(e.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");e.video.forEach(function(e){if("string"!=typeof e)throw new Error("Error starting dial out: video codec must be a string");if("H264"!==e&&"VP8"!==e)throw new Error("Error starting dial out: video codec must be H264 or VP8")})}}(e.codecs)}if(e.phoneNumber){if("string"!=typeof e.phoneNumber)throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(e.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");e.codecs&&n(e.codecs.audio)}if(e.callerId){if("string"!=typeof e.callerId)throw new Error("Error starting dial out: callerId must be a string");if(e.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(e.displayName){if("string"!=typeof e.displayName)throw new Error("Error starting dial out: displayName must be a string");if(e.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}if(e.userId){if("string"!=typeof e.userId)throw new Error("Error starting dial out: userId must be a string");if(e.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}if(Qc(e),e.permissions&&e.permissions.canReceive){var r=cr(Ec.validateJSONObject(e.permissions.canReceive),2),i=r[0],a=r[1];if(!i)throw new Error(a)}return new Promise(function(n,r){t.sendMessageToCallMachine(Oc({action:"dialout-start"},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return y.apply(this,arguments)})},{key:"stopDialOut",value:function(e){var t=this;return Kc(this._callState,"stopDialOut()"),new Promise(function(n,r){t.sendMessageToCallMachine(Oc({action:"dialout-stop"},e),function(e){e.error?r(e.error):n(e)})})}},{key:"sipCallTransfer",value:(v=sr(function*(e){var t=this;if(Kc(this._callState,"sipCallTransfer()"),!e)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return e.useSipRefer=!1,bu(e,"sipCallTransfer"),Qc(e),new Promise(function(n,r){t.sendMessageToCallMachine(Oc({action:ul},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return v.apply(this,arguments)})},{key:"sipRefer",value:(g=sr(function*(e){var t=this;if(Kc(this._callState,"sipRefer()"),!e)throw new Error("sessionId and toEndPoint are mandatory parameter");return e.useSipRefer=!0,bu(e,"sipRefer"),new Promise(function(n,r){t.sendMessageToCallMachine(Oc({action:ul},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return g.apply(this,arguments)})},{key:"sendDTMF",value:(m=sr(function*(e){var t=this;return Kc(this._callState,"sendDTMF()"),function(e){var t=e.sessionId,n=e.tones;if(!t||!n)throw new Error("sessionId and tones are mandatory parameter");if("string"!=typeof t||"string"!=typeof n)throw new Error("sessionId and tones should be of string type");if(n.length>20)throw new Error("tones string must be upto 20 characters");var r=n.match(/[^0-9A-D*#]/g);if(r&&r[0])throw new Error("".concat(r[0]," is not valid DTMF tone"))}(e),new Promise(function(n,r){t.sendMessageToCallMachine(Oc({action:"send-dtmf"},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return m.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var e=this;return this._callState!==Ds?Promise.resolve(Oc({stats:{latest:{}}},this._network)):new Promise(function(t){e.sendMessageToCallMachine({action:"get-calc-stats"},function(n){t(Oc(Oc({},e._network),{},{stats:n.stats}))})})}},{key:"testWebsocketConnectivity",value:(h=sr(function*(){var e=this;if(tu(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(t){return Promise.reject(t)}return new Promise(function(t,n){e.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(e){e.error?n(e.error):t(e.results)})})}),function(){return h.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(e){return e?e instanceof MediaStreamTrack?!!function(e){return e&&"live"===e.readyState&&!((t=e).muted&&!gc.has(t.id));var t}(e)||(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:(p=sr(function*(){var e=this;iu(),nu(this._callObjectMode,"testCallQuality()"),eu(this._callMachineInitialized,"testCallQuality()",null,!0),Zc(this._callState,this._isPreparingToJoin,"testCallQuality()");var t=this._testCallAlreadyInProgress,n=function(n){t||(e._testCallInProgress=n)};if(n(!0),this.needsLoad())try{var r=this._callState;yield this.load(),this._callState=r}catch(dr){return n(!1),Promise.reject(dr)}return new Promise(function(t){e.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:e.properties.dailyJsVersion},function(r){var i=r.results,a=i.result,o=Qn(i,Mc);if("failed"===a){var s,l=Oc({},o);null!==(s=o.error)&&void 0!==s&&s.details?(o.error.details=JSON.parse(o.error.details),l.error=Oc(Oc({},l.error),{},{details:Oc({},l.error.details)}),l.error.details.duringTest="testCallQuality"):(l.error=l.error?Oc({},l.error):{},l.error.details={duringTest:"testCallQuality"}),e._maybeSendToSentry(l)}n(!1),t(Oc({result:a},o))})})}),function(){return p.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(f=sr(function*(e){var t;fl()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),t=yield this.testPeerToPeerCallQuality(e)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),t=yield this.testCallQuality());var n={result:t.result,secondsElapsed:t.secondsElapsed};return t.data&&(n.data={maxRTT:t.data.maxRoundTripTime,packetLoss:t.data.avgRecvPacketLoss}),n}),function(e){return f.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(d=sr(function*(e){var t=this;if(tu(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(i){return Promise.reject(i)}var n=e.videoTrack,r=e.duration;if(!this._validateVideoTrackForNetworkTests(n))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=n,new Promise(function(e,n){t.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:r},function(t){t.error?n(t.error):e(t.results)})})}),function(e){return d.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){fl()?(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:(u=sr(function*(e){var t=this;if(tu(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(n){return Promise.reject(n)}if(!this._validateVideoTrackForNetworkTests(e))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=e,new Promise(function(e,n){t.sendMessageToCallMachine({action:"test-network-connectivity"},function(t){t.error?n(t.error):e(t.results)})})}),function(e){return u.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var e=this;return new Promise(function(t){e._callState===Ds?e.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(e){t(e.cpuStats)}):t({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(e){var t;if(!((null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Uc))}},{key:"_validateVideoSendSettings",value:function(e,t){var n="screenVideo"===e?["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"],r="Video send settings should be either an object or one of the supported presets: ".concat(n.join());if("string"==typeof t){if(!n.includes(t))throw new Error(r)}else{if("object"!==Kn(t))throw new Error(r);if(!t.maxQuality&&!t.encodings&&void 0===t.allowAdaptiveLayers)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(t.maxQuality&&-1===["low","medium","high"].indexOf(t.maxQuality))throw new Error("maxQuality must be either low, medium or high");if(t.encodings){var i=!1;switch(Object.keys(t.encodings).length){case 1:i=!t.encodings.low;break;case 2:i=!t.encodings.low||!t.encodings.medium;break;case 3:i=!t.encodings.low||!t.encodings.medium||!t.encodings.high;break;default:i=!0}if(i)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");t.encodings.low&&this._validateEncodingLayerHasValidProperties(t.encodings.low),t.encodings.medium&&this._validateEncodingLayerHasValidProperties(t.encodings.medium),t.encodings.high&&this._validateEncodingLayerHasValidProperties(t.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(e){var t=this;if(!e||0===Object.keys(e).length)throw new Error("Send settings must contain at least information for one track!");Object.entries(e).forEach(function(e){var n=cr(e,2),r=n[0],i=n[1];t._validateVideoSendSettings(r,i)})}},{key:"updateSendSettings",value:function(e){var t=this;return this.validateUpdateSendSettings(e),this.needsLoad()?(this._preloadCache.sendSettings=e,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(n,r){t.sendMessageToCallMachine({action:"update-send-settings",sendSettings:e},function(e){e.error?r(e.error):n(e.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 iu(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(e){return iu(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:e}),this}},{key:"activeSpeakerMode",value:function(){return iu(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(e){return Kc(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=e,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:e}),this}},{key:"enumerateDevices",value:(s=sr(function*(){var e=this;if(this._callObjectMode){var t=yield navigator.mediaDevices.enumerateDevices();return"Firefox"===Sl()&&_l().major>115&&_l().major<123&&(t=t.filter(function(e){return"audiooutput"!==e.kind})),{devices:t.map(function(e){var t=JSON.parse(JSON.stringify(e));if(!fl()&&"videoinput"===e.kind&&e.getCapabilities){var n,r=e.getCapabilities();t.facing=(null==r||null===(n=r.facingMode)||void 0===n?void 0:n.length)>=1?r.facingMode[0]:void 0}return t})}}return new Promise(function(t){e.sendMessageToCallMachine({action:"enumerate-devices"},function(e){t({devices:e.devices})})})}),function(){return s.apply(this,arguments)})},{key:"sendAppMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*";if(Kc(this._callState,"sendAppMessage()"),JSON.stringify(e).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:e,to:t}),this}},{key:"addFakeParticipant",value:function(e){return iu(),Kc(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(Oc({action:"add-fake-participant"},e)),this}},{key:"setShowNamesMode",value:function(e){return ru(this._callObjectMode,"setShowNamesMode()"),iu(),e&&"always"!==e&&"never"!==e?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:e}),this)}},{key:"setShowLocalVideo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return ru(this._callObjectMode,"setShowLocalVideo()"),iu(),Kc(this._callState,"setShowLocalVideo()"),"boolean"!=typeof e?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:e}),this._showLocalVideo=e,this)}},{key:"showLocalVideo",value:function(){return ru(this._callObjectMode,"showLocalVideo()"),iu(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return ru(this._callObjectMode,"setShowParticipantsBar()"),iu(),Kc(this._callState,"setShowParticipantsBar()"),"boolean"!=typeof e?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:e}),this._showParticipantsBar=e,this)}},{key:"showParticipantsBar",value:function(){return ru(this._callObjectMode,"showParticipantsBar()"),iu(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return iu(),ru(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(e){return iu(),ru(this._callObjectMode,"setCustomIntegrations()"),Kc(this._callState,"setCustomIntegrations()"),vu(e)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:e}),this._customIntegrations=e,this):this}},{key:"startCustomIntegrations",value:function(e){var t=this;if(iu(),ru(this._callObjectMode,"startCustomIntegrations()"),Kc(this._callState,"startCustomIntegrations()"),Array.isArray(e)&&e.some(function(e){return"string"!=typeof e})||!Array.isArray(e)&&"string"!=typeof e)return console.error("startCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter(function(e){return!(e in t._customIntegrations)});return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:n}),this)}},{key:"stopCustomIntegrations",value:function(e){var t=this;if(iu(),ru(this._callObjectMode,"stopCustomIntegrations()"),Kc(this._callState,"stopCustomIntegrations()"),Array.isArray(e)&&e.some(function(e){return"string"!=typeof e})||!Array.isArray(e)&&"string"!=typeof e)return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter(function(e){return!(e in t._customIntegrations)});return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:n}),this)}},{key:"customTrayButtons",value:function(){return ru(this._callObjectMode,"customTrayButtons()"),iu(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(e){return ru(this._callObjectMode,"updateCustomTrayButtons()"),iu(),Kc(this._callState,"updateCustomTrayButtons()"),gu(e)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:e}),this._customTrayButtons=e,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(Wc))),this)}},{key:"theme",value:function(){return ru(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(e){var t=this;return ru(this._callObjectMode,"setTheme()"),new Promise(function(n,r){try{t.validateProperties({theme:e}),t.properties.theme=Oc({},e),t.sendMessageToCallMachine({action:"set-theme",theme:t.properties.theme});try{t.emitDailyJSEvent({action:"theme-updated",theme:t.properties.theme})}catch(i){console.log("could not emit 'theme-updated'",i)}n(t.properties.theme)}catch(i){r(i)}})}},{key:"requestFullscreen",value:(o=sr(function*(){if(iu(),this._iframe&&!document.fullscreenElement&&hl())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(dr){console.log("could not make video call fullscreen",dr)}}),function(){return o.apply(this,arguments)})},{key:"exitFullscreen",value:function(){iu(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(a=sr(function*(){var e=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(t){e.sendMessageToCallMachine({action:"get-sidebar-view"},function(e){t(e.view)})})}),function(){return a.apply(this,arguments)})},{key:"setSidebarView",value:function(e){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:e}),this)}},{key:"room",value:(i=sr(function*(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeRoomConfigDefaults,n=void 0===t||t;return this._accessState.access===Us||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(t){e.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:n},function(e){delete e.action,delete e.callbackStamp,t(e)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=sr(function*(){try{var e=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield e.json()).geo}}catch(t){return console.error("geo lookup failed",t),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=sr(function*(e){var t=this;return iu(),Kc(this._callState,"setNetworkTopology()"),new Promise(function(n,r){t.sendMessageToCallMachine({action:"set-network-topology",opts:e},function(e){e.error?r({error:e.error}):n({workerId:e.workerId})})})}),function(e){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(t=sr(function*(){var e=this;return new Promise(function(t,n){e.needsLoad()&&t({topology:"none"}),e.sendMessageToCallMachine({action:"get-network-topology"},function(e){e.error?n({error:e.error}):t({topology:e.topology})})})}),function(){return t.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(e){if(iu(),"number"!=typeof e&&!0!==e&&!1!==e)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(e));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:e})}},{key:"on",value:function(e,t){return hr.prototype.on.call(this,e,t)}},{key:"once",value:function(e,t){return hr.prototype.once.call(this,e,t)}},{key:"off",value:function(e,t){return hr.prototype.off.call(this,e,t)}},{key:"validateProperties",value:function(e){var t,n;if(null!=e&&null!==(t=e.dailyConfig)&&void 0!==t&&t.userMediaAudioConstraints){var r,i;fl()||console.warn("userMediaAudioConstraints is deprecated. You can override constraints with inputSettings.audio.settings, found in DailyCallOptions.");var a=e.inputSettings||{};a.audio=(null===(r=e.inputSettings)||void 0===r?void 0:r.audio)||{},a.audio.settings=(null===(i=e.inputSettings)||void 0===i||null===(i=i.audio)||void 0===i?void 0:i.settings)||{},a.audio.settings=Oc(Oc({},a.audio.settings),e.dailyConfig.userMediaAudioConstraints),e.inputSettings=a,delete e.dailyConfig.userMediaAudioConstraints}if(null!=e&&null!==(n=e.dailyConfig)&&void 0!==n&&n.userMediaVideoConstraints){var o,s;fl()||console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");var l=e.inputSettings||{};l.video=(null===(o=e.inputSettings)||void 0===o?void 0:o.video)||{},l.video.settings=(null===(s=e.inputSettings)||void 0===s||null===(s=s.video)||void 0===s?void 0:s.settings)||{},l.video.settings=Oc(Oc({},l.video.settings),e.dailyConfig.userMediaVideoConstraints),e.inputSettings=l,delete e.dailyConfig.userMediaVideoConstraints}for(var c in e)if(Hc[c]){if(Hc[c].validate&&!Hc[c].validate(e[c],this))throw new Error("property '".concat(c,"': ").concat(Hc[c].help))}else console.warn("Ignoring unrecognized property '".concat(c,"'")),delete e[c]}},{key:"assembleMeetingUrl",value:function(){var e,t,n=Oc(Oc({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:null!==(e=this.properties.dailyConfig)&&void 0!==e&&e.proxyUrl?encodeURIComponent(null===(t=this.properties.dailyConfig)||void 0===t?void 0:t.proxyUrl):void 0}),r=n.url.match(/\?/)?"&":"?";return n.url+r+Object.keys(Hc).filter(function(e){return Hc[e].queryString&&void 0!==n[e]}).map(function(e){return"".concat(Hc[e].queryString,"=").concat(n[e])}).join("&")}},{key:"needsLoad",value:function(){return[js,Is,Bs,zs].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(e,t){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(e,t,this.callClientId,this._iframe)}},{key:"forwardPackagedMessageToCallMachine",value:function(e){this._messageChannel.forwardPackagedMessageToCallMachine(e,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(e,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(e)}},{key:"handleMessageFromCallMachine",value:function(e){switch(e.action){case"iframe-ready-for-launch-config":this.sendMessageToCallMachine(Oc({action:"iframe-launch-config"},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var t={action:il,level:"log",code:1011,stats:{event:"bundle load",time:"no-op"===this._bundleLoadTime?0:this._bundleLoadTime,preLoaded:"no-op"===this._bundleLoadTime,url:jr(this.properties.dailyConfig)}};this.sendMessageToCallMachine(t),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case qs:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(e);break;case"joined-meeting":var n,r=Oc({},e);delete r.internal,this._maxAppMessageSize=(null===(n=e.internal)||void 0===n?void 0:n._maxAppMessageSize)||Zs,this._joinedCallback&&(this._joinedCallback(e.participants),this._joinedCallback=null),this.emitDailyJSEvent(r);break;case"participant-joined":case"participant-updated":if(this._callState===Bs)return;if(e.participant&&e.participant.session_id){var i=e.participant.local?"local":e.participant.session_id;if(this._callObjectMode){var a=this._callMachine().store;ic(e.participant,a),ac(e.participant,a),sc(e.participant,this._participants[i],a)}try{this.maybeParticipantTracksStopped(this._participants[i],e.participant),this.maybeParticipantTracksStarted(this._participants[i],e.participant),this.maybeEventRecordingStopped(this._participants[i],e.participant),this.maybeEventRecordingStarted(this._participants[i],e.participant)}catch(dr){console.error("track events error",dr)}this.compareEqualForParticipantUpdateEvent(e.participant,this._participants[i])||(this._participants[i]=Oc({},e.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(e))}break;case"participant-left":if(e.participant&&e.participant.session_id){var o=this._participants[e.participant.session_id];o&&this.maybeParticipantTracksStopped(o,null),delete this._participants[e.participant.session_id],this.emitDailyJSEvent(e)}break;case"participant-counts-updated":vr(this._participantCounts,e.participantCounts)||(this._participantCounts=e.participantCounts,this.emitDailyJSEvent(e));break;case"access-state-updated":var s={access:e.access};e.awaitingAccess&&(s.awaitingAccess=e.awaitingAccess),vr(this._accessState,s)||(this._accessState=s,this.emitDailyJSEvent(e));break;case"meeting-session-summary-updated":if(e.meetingSession){this._meetingSessionSummary=e.meetingSession,this.emitDailyJSEvent(e);var l=Oc(Oc({},e),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(l)}break;case Xs:var c;this._iframe&&!e.preserveIframe&&(this._iframe.src=""),this._updateCallState(zs),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(e.errorMsg),this._loadedCallback=null),e.preserveIframe;var u=Qn(e,Pc);null!=u&&null!==(c=u.error)&&void 0!==c&&c.details&&(u.error.details=JSON.parse(u.error.details)),this._maybeSendToSentry(e),this._joinedCallback&&(this._joinedCallback(null,u),this._joinedCallback=null),this.emitDailyJSEvent(u);break;case"left-meeting":this._callState!==zs&&this._updateCallState(Bs),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(e);break;case"selected-devices-updated":e.devices&&this.emitDailyJSEvent(e);break;case"network-quality-change":var d=e.state,f=e.threshold,p=e.quality,h=d.state,m=d.reasons;h===this._network.networkState&&vr(m,this._network.networkStateReasons)&&f===this._network.threshold&&p===this._network.quality||(this._network.networkState=h,this._network.networkStateReasons=m,this._network.quality=p,this._network.threshold=f,e.networkState=h,m.length&&(e.networkStateReasons=m),delete e.state,this.emitDailyJSEvent(e));break;case"cpu-load-change":e&&e.cpuLoadState&&this.emitDailyJSEvent(e);break;case"face-counts-updated":e&&void 0!==e.faceCounts&&this.emitDailyJSEvent(e);break;case"active-speaker-change":var g=e.activeSpeaker;this._activeSpeaker.peerId!==g.peerId&&(this._activeSpeaker.peerId=g.peerId,this.emitDailyJSEvent({action:e.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var v=e.show;this._showLocalVideo=v,this.emitDailyJSEvent({action:e.action,show:v});break;case"active-speaker-mode-change":var y=e.enabled;this._activeSpeakerMode!==y&&(this._activeSpeakerMode=y,this.emitDailyJSEvent({action:e.action,enabled:this._activeSpeakerMode}));break;case"waiting-participant-added":case"waiting-participant-updated":case"waiting-participant-removed":this._waitingParticipants=e.allWaitingParticipants,this.emitDailyJSEvent({action:e.action,participant:e.participant});break;case"receive-settings-updated":vr(this._receiveSettings,e.receiveSettings)||(this._receiveSettings=e.receiveSettings,this.emitDailyJSEvent({action:e.action,receiveSettings:e.receiveSettings}));break;case Ys:this._maybeUpdateInputSettings(e.inputSettings);break;case"send-settings-updated":vr(this._sendSettings,e.sendSettings)||(this._sendSettings=e.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:e.action,sendSettings:e.sendSettings}));break;case"local-audio-level":this._localAudioLevel=e.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(e);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=e.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(e);break;case"remote-media-player-started":var b=e.session_id;this._rmpPlayerState[b]=e.playerState,this.emitDailyJSEvent(e);break;case"remote-media-player-stopped":delete this._rmpPlayerState[e.session_id],this.emitDailyJSEvent(e);break;case"remote-media-player-updated":var w=e.session_id,k=this._rmpPlayerState[w];k&&this.compareEqualForRMPUpdateEvent(k,e.remoteMediaPlayerState)||(this._rmpPlayerState[w]=e.remoteMediaPlayerState,this.emitDailyJSEvent(e));break;case"custom-button-click":case"sidebar-view-changed":case"pip-started":case"pip-stopped":this.emitDailyJSEvent(e);break;case"meeting-session-state-updated":var S=this._meetingSessionState.topology!==(e.meetingSessionState&&e.meetingSessionState.topology);this._meetingSessionState=Su(e.meetingSessionState,this._callObjectMode),(this._callObjectMode||S)&&this.emitDailyJSEvent(e);break;case"local-screen-share-started":this._isScreenSharing=!0,this.emitDailyJSEvent(e);break;case"local-screen-share-stopped":case"local-screen-share-canceled":this._isScreenSharing=!1,this.emitDailyJSEvent(e);break;case Hs:case Js:case"recording-stats":case"recording-error":case"recording-upload-completed":case"transcription-started":case"transcription-stopped":case"transcription-error":case"started-camera":case"camera-error":case"app-message":case"transcription-message":case"test-completed":case"network-connection":case"recording-data":case"live-streaming-started":case"live-streaming-updated":case"live-streaming-stopped":case"live-streaming-error":case Ks:case"lang-updated":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(e);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(e,t){var n="record";e&&(t.local||!1!==t[n]||e[n]===t[n]||this.emitDailyJSEvent({action:Js}))}},{key:"maybeEventRecordingStarted",value:function(e,t){var n="record";e&&(t.local||!0!==t[n]||e[n]===t[n]||this.emitDailyJSEvent({action:Hs}))}},{key:"_trackStatePlayable",value:function(e){return!(!e||"playable"!==e.state)}},{key:"_trackChanged",value:function(e,t){return!((null==e?void 0:e.id)===(null==t?void 0:t.id))}},{key:"maybeEventTrackStopped",value:function(e,t,n){var r,i,a=null!==(r=null==t?void 0:t.tracks[e])&&void 0!==r?r:null,o=null!==(i=null==n?void 0:n.tracks[e])&&void 0!==i?i:null,s=null==a?void 0:a.track;if(s){var l=this._trackStatePlayable(a),c=this._trackStatePlayable(o),u=this._trackChanged(s,null==o?void 0:o.track);l&&(c&&!u||this.emitDailyJSEvent({action:"track-stopped",track:s,participant:null!=n?n:t,type:e}))}}},{key:"maybeEventTrackStarted",value:function(e,t,n){var r,i,a=null!==(r=null==t?void 0:t.tracks[e])&&void 0!==r?r:null,o=null!==(i=null==n?void 0:n.tracks[e])&&void 0!==i?i:null,s=null==o?void 0:o.track;if(s){var l=this._trackStatePlayable(a),c=this._trackStatePlayable(o),u=this._trackChanged(null==a?void 0:a.track,s);c&&(l&&!u||this.emitDailyJSEvent({action:"track-started",track:s,participant:n,type:e}))}}},{key:"maybeParticipantTracksStopped",value:function(e,t){if(e)for(var n in e.tracks)this.maybeEventTrackStopped(n,e,t)}},{key:"maybeParticipantTracksStarted",value:function(e,t){if(t)for(var n in t.tracks)this.maybeEventTrackStarted(n,e,t)}},{key:"compareEqualForRMPUpdateEvent",value:function(e,t){var n,r;return e.state===t.state&&(null===(n=e.settings)||void 0===n?void 0:n.volume)===(null===(r=t.settings)||void 0===r?void 0:r.volume)}},{key:"emitDailyJSEvent",value:function(e){try{e.callClientId=this.callClientId,this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(e,t){return!(!vr(e,t)||e.videoTrack&&t.videoTrack&&(e.videoTrack.id!==t.videoTrack.id||e.videoTrack.muted!==t.videoTrack.muted||e.videoTrack.enabled!==t.videoTrack.enabled)||e.audioTrack&&t.audioTrack&&(e.audioTrack.id!==t.audioTrack.id||e.audioTrack.muted!==t.audioTrack.muted||e.audioTrack.enabled!==t.audioTrack.enabled))}},{key:"nativeUtils",value:function(){return fl()?"undefined"==typeof DailyNativeUtils?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(e){this._updateCallState(this._callState,e)}},{key:"_updateCallState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._isPreparingToJoin;if(e!==this._callState||t!==this._isPreparingToJoin){var n=this._callState,r=this._isPreparingToJoin;this._callState=e,this._isPreparingToJoin=t;var i=this._callState===Ds;this.updateShowAndroidOngoingMeetingNotification(i);var a=Xc(n,r),o=Xc(this._callState,this._isPreparingToJoin);a!==o&&(this.updateKeepDeviceAwake(o),this.updateDeviceAudioMode(o),this.updateNoOpRecordingEnsuringBackgroundContinuity(o))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=Bc,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Us},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=Su(Dc,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=Zs,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(e){fl()&&this.nativeUtils().setKeepDeviceAwake(e,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(e){if(fl()&&!this.disableReactNativeAutoDeviceManagement("audio")){var t=e?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(t)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(e){if(fl()&&this.nativeUtils().setShowOngoingMeetingNotification){var t,n,r,i;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var a=this.properties.reactNativeConfig.androidInCallNotification;t=a.title,n=a.subtitle,r=a.iconName,i=a.disableForCustomOverride}i&&(e=!1),this.nativeUtils().setShowOngoingMeetingNotification(e,t,n,r,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(e){fl()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(e)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var e;if(fl()){var t=null===(e=this._callMachine())||void 0===e||null===(e=e.store)||void 0===e?void 0:e.getState();for(var n in null==t?void 0:t.streams){var r=t.streams[n];r&&r.pendingTrack&&"audio"===r.pendingTrack.kind&&(r.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(e){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[e]}},{key:"absoluteUrl",value:function(e){if(void 0!==e){var t=document.createElement("a");return t.href=e,t.href}}},{key:"sayHello",value:function(){var e="hello, world.";return console.log(e),e}},{key:"_logUseAfterDestroy",value:function(){var e=Object.values(Ic)[0];if(this.needsLoad())if(e&&!e.needsLoad()){var t={action:il,level:"error",code:this.strictMode?9995:9997};e.sendMessageToCallMachine(t)}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 n={action:il,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(n,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var e=0,t=Object.values(Ic);e<t.length;e++){var n=t[e];n._callMachineInitialized?(n.sendMessageToCallMachine({action:il,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),n._delayDuplicateInstanceLog=!1):n._delayDuplicateInstanceLog=!0}}},{key:"_maybeSendToSentry",value:function(t){var n,r,i,a;if(null!==(n=t.error)&&void 0!==n&&n.type){if(![Ws,$s,Vs].includes(t.error.type))return;if(t.error.type===Vs&&t.error.msg.includes("deleted"))return}var o=null!==(r=this.properties)&&void 0!==r&&r.url?new URL(this.properties.url):void 0,s="production";o&&o.host.includes(".staging.daily")&&(s="staging");var u,d,f,p,h,m=function(){const e=[yo(),go(),Cs(),_s(),As(),Ls(),To(),{name:"HttpContext",preprocessEvent(e){if(!Do.navigator&&!Do.location&&!Do.document)return;const t=e.request&&e.request.url||Do.location&&Do.location.href,{referrer:n}=Do.document||{},{userAgent:r}=Do.navigator||{},i=l(l(l({},e.request&&e.request.headers),n&&{Referer:n}),r&&{"User-Agent":r}),a=c(l(l({},e.request),t&&{url:t}),{headers:i});e.request=a}}];return!1!=={}.autoSessionTracking&&e.push({name:"BrowserSession",setupOnce(){void 0!==Do.document?(Ka({ignoreDuration:!0}),eo(),ls(({from:e,to:t})=>{void 0!==e&&e!==t&&(Ka({ignoreDuration:!0}),eo())})):Vo&&Wr.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),e}().filter(function(e){return!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(e.name)}),g=new Zo({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:hs,stackParser:ks,integrations:m,environment:s}),v=new ra;if(v.setClient(g),g.init(),this.session_id&&v.setExtra("sessionId",this.session_id),this.properties){var y=Oc({},this.properties);y.userName=y.userName?"[Filtered]":void 0,y.userData=y.userData?"[Filtered]":void 0,y.token=y.token?"[Filtered]":void 0,v.setExtra("properties",y)}if(o){var b=o.searchParams.get("domain");if(!b){var w=o.host.match(/(.*?)\./);b=w&&w[1]||""}b&&v.setTag("domain",b)}t.error&&(v.setTag("fatalErrorType",t.error.type),v.setExtra("errorDetails",t.error.details),(null===(u=t.error.details)||void 0===u?void 0:u.uri)&&v.setTag("serverAddress",t.error.details.uri),(null===(d=t.error.details)||void 0===d?void 0:d.workerGroup)&&v.setTag("workerGroup",t.error.details.workerGroup),(null===(f=t.error.details)||void 0===f?void 0:f.geoGroup)&&v.setTag("geoGroup",t.error.details.geoGroup),(null===(p=t.error.details)||void 0===p?void 0:p.on)&&v.setTag("connectionAttempt",t.error.details.on),null!==(h=t.error.details)&&void 0!==h&&h.bundleUrl&&(v.setTag("bundleUrl",t.error.details.bundleUrl),v.setTag("bundleError",t.error.details.sourceError.type))),v.setTags({callMode:this._callObjectMode?fl()?"reactNative":null!==(i=this.properties)&&void 0!==i&&null!==(i=i.dailyConfig)&&void 0!==i&&null!==(i=i.callMode)&&void 0!==i&&i.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:e.version()});var k=(null===(a=t.error)||void 0===a?void 0:a.msg)||t.errorMsg;v.captureException(new Error(k))}},{key:"_callMachine",value:function(){var e;return null===(e=window._daily)||void 0===e||null===(e=e.instances)||void 0===e||null===(e=e[this.callClientId])||void 0===e?void 0:e.callMachine}},{key:"_maybeUpdateInputSettings",value:function(e){if(!vr(this._inputSettings,e)){var t=this._getInputSettings();this._inputSettings=e;var n=this._getInputSettings();vr(t,n)||this.emitDailyJSEvent({action:Ys,inputSettings:n})}}}],[{key:"supportedBrowser",value:function(){if(fl())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var e=Ar.getParser(dl());return{supported:!!bl(),mobile:"mobile"===e.getPlatformType(),name:e.getBrowserName(),version:e.getBrowserVersion(),supportsFullscreen:!!hl(),supportsScreenShare:!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&(function(e,t){if(!e||!t)return!0;switch(e){case"Chrome":return t.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(13===t.major&&0===t.minor&&0===t.point);case"Firefox":return t.major>=67}return!0}(Sl(),_l())||fl())),supportsSfu:!!bl(),supportsVideoProcessing:vl(),supportsAudioProcessing:yl()}}},{key:"version",value:function(){return"0.84.0"}},{key:"createCallObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.layout="none",new e(null,t)}},{key:"wrap",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(iu(),!t||!t.contentWindow||"string"!=typeof t.src)throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return n.layout||(n.customLayout?n.layout="custom-v1":n.layout="browser"),new e(t,n)}},{key:"createFrame",value:function(t,n){var r,i;iu(),t&&n?(r=t,i=n):t&&t.append?(r=t,i={}):(r=document.body,i=t||{});var a=i.iframeStyle;a||(a=r===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 o=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?o.allow="microphone, camera":o.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",o.style.visibility="hidden",r.appendChild(o),o.style.visibility=null,Object.keys(a).forEach(function(e){return o.style[e]=a[e]}),i.layout||(i.customLayout?i.layout="custom-v1":i.layout="browser");try{return new e(o,i)}catch(s){throw r.removeChild(o),s}}},{key:"createTransparentFrame",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};iu();var n=document.createElement("iframe");return n.allow="microphone; camera; autoplay",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 0;\n pointer-events: none;\n ",document.body.appendChild(n),t.layout||(t.layout="custom-v1"),e.wrap(n,t)}},{key:"getCallInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e?Ic[e]:Object.values(Ic)[0]}}]);var t,n,r,i,a,o,s,u,d,f,p,h,m,g,v,y,b,w,k,S,_,x,C,E,T,M,P,A,O,N,L,j,I,R,F,D,B,z}();function Qc(e){if(e.extension){if("string"!=typeof e.extension)throw new Error("Error starting dial out: extension must be a string");if(e.extension.length>20)throw new Error("Error starting dial out: extension length must be less than or equal to 20")}if(e.waitBeforeExtensionDialSec){if("number"!=typeof e.waitBeforeExtensionDialSec)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be a number");if(e.waitBeforeExtensionDialSec>60)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be less than or equal to 60");if(!e.extension)throw new Error("Error starting dial out: waitBeforeExtensionDialSec requires a phoneNumber and extension")}}function Yc(e,t){var n={};for(var r in e)if(e[r]instanceof MediaStreamTrack)console.warn("MediaStreamTrack found in props or cache.",r),n[r]=al;else if("dailyConfig"===r){if(e[r].modifyLocalSdpHook){var i=window._daily.instances[t].customCallbacks||{};i.modifyLocalSdpHook=e[r].modifyLocalSdpHook,window._daily.instances[t].customCallbacks=i,delete e[r].modifyLocalSdpHook}if(e[r].modifyRemoteSdpHook){var a=window._daily.instances[t].customCallbacks||{};a.modifyRemoteSdpHook=e[r].modifyRemoteSdpHook,window._daily.instances[t].customCallbacks=a,delete e[r].modifyRemoteSdpHook}n[r]=e[r]}else n[r]=e[r];return n}function Kc(e){var t=arguments.length>2?arguments[2]:void 0;if(e!==Ds){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," only supported after join.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Xc(e,t){return[Fs,Ds].includes(e)||t}function Zc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Xc(e,t)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function eu(e){var t=arguments.length>2?arguments[2]:void 0;if(!e){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method",arguments.length>3&&void 0!==arguments[3]&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function tu(e){if(e){var t="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&void 0!==arguments[1]?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 nu(e){if(!e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(t),new Error(t)}}function ru(e){if(e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(t),new Error(t)}}function iu(){if(fl())throw new Error("This daily-js method is not currently supported in React Native")}function au(){if(!fl())throw new Error("This daily-js method is only supported in React Native")}function ou(e){if(void 0===e)return!0;var t;if("string"==typeof e)t=e;else try{t=JSON.stringify(e),vr(JSON.parse(t),e)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(t.length>4096)throw Error("userData is too large (".concat(t.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function su(e,t){for(var n=t.allowAllParticipantsKey,r=function(e){var t=["local"];return n||t.push("*"),e&&!t.includes(e)},i=function(e){return!!(void 0===e.layer||Number.isInteger(e.layer)&&e.layer>=0||"inherit"===e.layer)},a=function(e){return!(!e||e.video&&!i(e.video)||e.screenVideo&&!i(e.screenVideo))},o=0,s=Object.entries(e);o<s.length;o++){var l=cr(s[o],2),c=l[0],u=l[1];if(!r(c)||!a(u))return!1}return!0}function lu(e){if("object"!==Kn(e))return!1;for(var t=0,n=Object.entries(e);t<n.length;t++){var r=cr(n[t],2),i=r[0],a=r[1];switch(i){case"video":if("object"!==Kn(a))return!1;for(var o=0,s=Object.entries(a);o<s.length;o++){var l=cr(s[o],2),c=l[0],u=l[1];switch(c){case"processor":if(!du(u))return!1;break;case"settings":if(!fu(u))return!1;break;default:return!1}}break;case"audio":if("object"!==Kn(a))return!1;for(var d=0,f=Object.entries(a);d<f.length;d++){var p=cr(f[d],2),h=p[0],m=p[1];switch(h){case"processor":if(!uu(m))return!1;break;case"settings":if(!fu(m))return!1;break;default:return!1}}break;default:return!1}}return!0}function cu(e,t,n){var r,i=[];e.video&&e.video.processor&&(vl(null!==(r=null==t?void 0:t.useLegacyVideoProcessor)&&void 0!==r&&r)||(e.video.settings?delete e.video.processor:delete e.video,i.push("video"))),e.audio&&e.audio.processor&&(yl()||(e.audio.settings?delete e.audio.processor:delete e.audio,i.push("audio"))),i.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(i.join(", "))),e.audio&&e.audio.settings&&(e.audio.settings.customTrack?(n.audioTrack=e.audio.settings.customTrack,e.audio.settings={customTrack:al}):delete n.audioTrack),e.video&&e.video.settings&&(e.video.settings.customTrack?(n.videoTrack=e.video.settings.customTrack,e.video.settings={customTrack:al}):delete n.videoTrack)}function uu(e){if(fl())return console.warn("Video processing is not yet supported in React Native"),!1;var t,n=["type"];return!(!e||"object"!==Kn(e)||(Object.keys(e).filter(function(e){return!n.includes(e)}).forEach(function(t){console.warn("invalid key inputSettings -> audio -> processor : ".concat(t)),delete e[t]}),t=e.type,"string"!=typeof t||!Object.values(sl).includes(t)&&(console.error("inputSettings audio processor type invalid"),1)))}function du(e){if(fl())return console.warn("Video processing is not yet supported in React Native"),!1;var t,n=["type","config"];if(!e)return!1;if("object"!==Kn(e))return!1;if("string"!=typeof(t=e.type)||!Object.values(ol).includes(t)&&(console.error("inputSettings video processor type invalid"),1))return!1;if(e.config){if("object"!==Kn(e.config))return!1;if(!function(e,t){var n=Object.keys(t);if(0===n.length)return!0;var r,i,a,o="invalid object in inputSettings -> video -> processor -> config";switch(e){case ol.BGBLUR:return n.length>1||"strength"!==n[0]?(console.error(o),!1):!("number"!=typeof t.strength||t.strength<=0||t.strength>1||isNaN(t.strength))||(console.error("".concat(o,"; expected: {0 < strength <= 1}, got: ").concat(t.strength)),!1);case ol.BGIMAGE:return!(void 0!==t.source&&(r=t,!("default"===r.source?(r.type="default",1):r.source instanceof ArrayBuffer||(Ir(r.source)?(r.type="url",function(e){var t=new URL(e),n=t.pathname;if("data:"===t.protocol)try{var r=n.substring(n.indexOf(":")+1,n.indexOf(";")).split("/")[1];return cl.includes(r)}catch(a){return console.error("failed to deduce blob content type",a),!1}var i=n.split(".").at(-1).toLowerCase().trim();return cl.includes(i)}(r.source)||(console.error("invalid image type; supported types: [".concat(cl.join(", "),"]")),0)):(i=r.source,a=Number(i),isNaN(a)||!Number.isInteger(a)||a<=0||a>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),0):(r.type="daily-preselect",1))))));default:return!0}}(e.type,e.config))return!1}return Object.keys(e).filter(function(e){return!n.includes(e)}).forEach(function(t){console.warn("invalid key inputSettings -> video -> processor : ".concat(t)),delete e[t]}),!0}function fu(e){return"object"===Kn(e)&&(!e.customTrack||e.customTrack instanceof MediaStreamTrack)}function pu(){var e=Object.values(ol).join(" | "),t=Object.values(sl).join(" | ");return"inputSettings must be of the form: { video?: { processor?: { type: [ ".concat(e," ], config?: {} } }, audio?: { processor: {type: [ ").concat(t," ] } } }")}function hu(e){var t=e.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat("base").concat(t?' | "'.concat("*",'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function mu(){return"customIntegrations should be an object of type ".concat(JSON.stringify(qc),".")}function gu(e){if(e&&"object"!==Kn(e)||Array.isArray(e))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(Wc),".")),!1;if(e)for(var t=0,n=Object.entries(e);t<n.length;t++)for(var r=cr(n[t],1)[0],i=0,a=Object.entries(e[r]);i<a.length;i++){var o=cr(a[i],2),s=o[0],l=o[1],c=Wc.id[s];if(!c)return console.error("customTrayButton does not support key ".concat(s)),!1;switch(s){case"iconPath":case"iconPathDarkMode":if(!Ir(l))return console.error("customTrayButton ".concat(s," should be a url.")),!1;break;case"visualState":if(!["default","sidebar-open","active"].includes(l))return console.error("customTrayButton ".concat(s," should be ").concat(c,". Got: ").concat(l)),!1;break;default:if(Kn(l)!==c)return console.error("customTrayButton ".concat(s," should be a ").concat(c,".")),!1}}return!0}function vu(e){if(!e||e&&"object"!==Kn(e)||Array.isArray(e))return console.error(mu()),!1;for(var t=function(e){return"".concat(e," should be ").concat(qc.id[e])},n=function(e,t){return console.error("customIntegration ".concat(e,": ").concat(t))},r=0,i=Object.entries(e);r<i.length;r++){var a=cr(i[r],1)[0];if(!("label"in e[a]))return n(a,"label is required"),!1;if(!("location"in e[a]))return n(a,"location is required"),!1;if(!("src"in e[a])&&!("srcdoc"in e[a]))return n(a,"src or srcdoc is required"),!1;for(var o=0,s=Object.entries(e[a]);o<s.length;o++){var l=cr(s[o],2),c=l[0],u=l[1];switch(c){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if("string"!=typeof u)return n(a,t(c)),!1;break;case"iconURL":if(!Ir(u))return n(a,"".concat(c," should be a url")),!1;break;case"src":if("srcdoc"in e[a])return n(a,"cannot have both src and srcdoc"),!1;if(!Ir(u))return n(a,'src "'.concat(u,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in e[a])return n(a,"cannot have both src and srcdoc"),!1;if("string"!=typeof u)return n(a,t(c)),!1;break;case"location":if(!["main","sidebar"].includes(u))return n(a,t(c)),!1;break;case"controlledBy":if("*"!==u&&"owners"!==u&&(!Array.isArray(u)||u.some(function(e){return"string"!=typeof e})))return n(a,t(c)),!1;break;case"shared":if((!Array.isArray(u)||u.some(function(e){return"string"!=typeof e}))&&"owners"!==u&&"boolean"!=typeof u)return n(a,t(c)),!1;break;default:if(!qc.id[c])return console.error("customIntegration does not support key ".concat(c)),!1}}}return!0}function yu(e,t){if(void 0===t)return!1;switch(Kn(t)){case"string":return Kn(e)===t;case"object":if("object"!==Kn(e))return!1;for(var n in e)if(!yu(e[n],t[n]))return!1;return!0;default:return!1}}function bu(e,t){var n=e.sessionId,r=e.toEndPoint,i=e.callerId,a=e.useSipRefer;if(!n||!r)throw new Error("".concat(t,"() requires a sessionId and toEndPoint"));if("string"!=typeof n||"string"!=typeof r)throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(a&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'));if(i&&"string"!=typeof i)throw new Error("callerId must be of type string");if(i&&!r.startsWith("+"))throw new Error("callerId is only valid when transferring to a PSTN number")}function wu(e){if("object"!==Kn(e))throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(e.state&&!Object.values(ll).includes(e.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(ll));if(e.volume){if("number"!=typeof e.volume)throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(e.volume<0||e.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function ku(e,t,n){return!("number"!=typeof e||e<t||e>n)}function Su(e,t){return e&&!t&&delete e.data,e}var _u,xu={exports:{}};var Cu=function(){if(_u)return xu.exports;_u=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}xu.exports=i,xu.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}h(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&h(e,"error",t,n)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,a,l,c;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),l=a[t]),void 0===l)l=a[t]=n,++e._eventsCount;else if("function"==typeof l?l=a[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),(i=s(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,c=u,console&&console.warn&&console.warn(c)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return o(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},xu.exports}();const Eu=f(Cu);for(var Tu,Mu=[],Pu=0;Pu<256;++Pu)Mu.push((Pu+256).toString(16).slice(1));var Au=new Uint8Array(16);function Ou(){if(!Tu&&!(Tu="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tu(Au)}const Nu={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Lu(e,t,n){if(Nu.randomUUID&&!t&&!e)return Nu.randomUUID();var r=(e=e||{}).random||(e.rng||Ou)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return function(e,t=0){return(Mu[e[t+0]]+Mu[e[t+1]]+Mu[e[t+2]]+Mu[e[t+3]]+"-"+Mu[e[t+4]]+Mu[e[t+5]]+"-"+Mu[e[t+6]]+Mu[e[t+7]]+"-"+Mu[e[t+8]]+Mu[e[t+9]]+"-"+Mu[e[t+10]]+Mu[e[t+11]]+Mu[e[t+12]]+Mu[e[t+13]]+Mu[e[t+14]]+Mu[e[t+15]]).toLowerCase()}(r)}const ju={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},Iu={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},Ru={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},Fu={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},Du={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"};class Bu{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);t.push(0);const n=t[0],r=t[1];if(10===n)switch(r){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}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=Bu.getVersionPrecision(e),i=Bu.getVersionPrecision(t);let a=Math.max(r,i),o=0;const s=Bu.map([e,t],e=>{const t=a-Bu.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return Bu.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(o=a-Math.min(r,i)),a-=1;a>=o;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===o)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;r+=1){const e=t[r];if("object"==typeof e&&null!==e){Object.keys(e).forEach(t=>{n[t]=e[t]})}}return e}static getBrowserAlias(e){return ju[e]}static getBrowserTypeByAlias(e){return Iu[e]||""}}const zu=/version\/(\d+(\.?_?\d+)+)/i,Uu=[{test:[/gptbot/i],describe(e){const t={name:"GPTBot"},n=Bu.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe(e){const t={name:"ChatGPT-User"},n=Bu.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe(e){const t={name:"OAI-SearchBot"},n=Bu.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(e){const t={name:"ClaudeBot"},n=Bu.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe(e){const t={name:"Omgilibot"},n=Bu.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe(e){const t={name:"Diffbot"},n=Bu.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe(e){const t={name:"PerplexityBot"},n=Bu.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe(e){const t={name:"Perplexity-User"},n=Bu.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe(e){const t={name:"YouBot"},n=Bu.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe(e){const t={name:"Meta-WebIndexer"},n=Bu.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe(e){const t={name:"Meta-ExternalAds"},n=Bu.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe(e){const t={name:"Meta-ExternalAgent"},n=Bu.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe(e){const t={name:"Meta-ExternalFetcher"},n=Bu.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=Bu.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe(e){const t={name:"AmazonBot"},n=Bu.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe(e){const t={name:"BingCrawler"},n=Bu.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe(e){const t={name:"BaiduSpider"},n=Bu.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe(e){const t={name:"DuckDuckBot"},n=Bu.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe(e){const t={name:"InternetArchiveCrawler"},n=Bu.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:()=>({name:"FacebookExternalHit"})},{test:[/yahoo!?[\s/]*slurp/i],describe:()=>({name:"YahooSlurp"})},{test:[/yandexbot/i,/yandexmobilebot/i],describe:()=>({name:"YandexBot"})},{test:[/pingdom/i],describe:()=>({name:"PingdomBot"})},{test:[/opera/i],describe(e){const t={name:"Opera"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=Bu.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe(e){const t={name:"Pale Moon"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=Bu.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=Bu.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=Bu.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=Bu.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=Bu.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=Bu.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=Bu.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=Bu.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=Bu.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=Bu.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=Bu.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=Bu.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=Bu.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=Bu.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=Bu.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=Bu.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=Bu.getFirstMatch(zu,e)||Bu.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=Bu.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=Bu.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=Bu.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/librewolf/i],describe(e){const t={name:"LibreWolf"},n=Bu.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=Bu.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=Bu.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe(e){const t={name:"Sogou Browser"},n=Bu.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),r=Bu.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),i=Bu.getFirstMatch(/se ([\d.]+)x/i,e),a=n||r||i;return a&&(t.version=a),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=Bu.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=Bu.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=Bu.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=Bu.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=Bu.getFirstMatch(zu,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:Bu.getFirstMatch(t,e),version:Bu.getSecondMatch(t,e)}}}],Vu=[{test:[/Roku\/DVP/],describe(e){const t=Bu.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Fu.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=Bu.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Fu.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=Bu.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=Bu.getWindowsVersionName(t);return{name:Fu.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Fu.iOS},n=Bu.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=Bu.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=Bu.getMacOSVersionName(t),r={name:Fu.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=Bu.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Fu.iOS,version:t}}},{test:[/OpenHarmony/i],describe(e){const t=Bu.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:Fu.HarmonyOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=Bu.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=Bu.getAndroidVersionName(t),r={name:Fu.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=Bu.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:Fu.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=Bu.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||Bu.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||Bu.getFirstMatch(/\bbb(\d+)/i,e);return{name:Fu.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=Bu.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Fu.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=Bu.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Fu.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:Fu.Linux})},{test:[/CrOS/],describe:()=>({name:Fu.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=Bu.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:Fu.PlayStation4,version:t}}}],$u=[{test:[/googlebot/i],describe:()=>({type:Ru.bot,vendor:"Google"})},{test:[/amazonbot/i],describe:()=>({type:Ru.bot,vendor:"Amazon"})},{test:[/gptbot/i],describe:()=>({type:Ru.bot,vendor:"OpenAI"})},{test:[/chatgpt-user/i],describe:()=>({type:Ru.bot,vendor:"OpenAI"})},{test:[/oai-searchbot/i],describe:()=>({type:Ru.bot,vendor:"OpenAI"})},{test:[/baiduspider/i],describe:()=>({type:Ru.bot,vendor:"Baidu"})},{test:[/bingbot/i],describe:()=>({type:Ru.bot,vendor:"Bing"})},{test:[/duckduckbot/i],describe:()=>({type:Ru.bot,vendor:"DuckDuckGo"})},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:()=>({type:Ru.bot,vendor:"Anthropic"})},{test:[/omgilibot/i,/webzio-extended/i],describe:()=>({type:Ru.bot,vendor:"Webz.io"})},{test:[/diffbot/i],describe:()=>({type:Ru.bot,vendor:"Diffbot"})},{test:[/perplexitybot/i],describe:()=>({type:Ru.bot,vendor:"Perplexity AI"})},{test:[/perplexity-user/i],describe:()=>({type:Ru.bot,vendor:"Perplexity AI"})},{test:[/youbot/i],describe:()=>({type:Ru.bot,vendor:"You.com"})},{test:[/ia_archiver/i],describe:()=>({type:Ru.bot,vendor:"Internet Archive"})},{test:[/meta-webindexer/i],describe:()=>({type:Ru.bot,vendor:"Meta"})},{test:[/meta-externalads/i],describe:()=>({type:Ru.bot,vendor:"Meta"})},{test:[/meta-externalagent/i],describe:()=>({type:Ru.bot,vendor:"Meta"})},{test:[/meta-externalfetcher/i],describe:()=>({type:Ru.bot,vendor:"Meta"})},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:()=>({type:Ru.bot,vendor:"Meta"})},{test:[/yahoo/i],describe:()=>({type:Ru.bot,vendor:"Yahoo"})},{test:[/yandexbot/i,/yandexmobilebot/i],describe:()=>({type:Ru.bot,vendor:"Yandex"})},{test:[/pingdom/i],describe:()=>({type:Ru.bot,vendor:"Pingdom"})},{test:[/huawei/i],describe(e){const t=Bu.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Ru.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Ru.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Ru.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Ru.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Ru.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Ru.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Ru.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=Bu.getFirstMatch(/(ipod|iphone)/i,e);return{type:Ru.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Ru.mobile,vendor:"Nexus"})},{test:[/Nokia/i],describe(e){const t=Bu.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:Ru.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:()=>({type:Ru.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Ru.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Ru.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Ru.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Ru.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Ru.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Ru.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Ru.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Ru.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Ru.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Ru.tv})}],Wu=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Du.Blink};const t=Bu.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Du.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Du.Trident},n=Bu.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Du.Presto},n=Bu.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:Du.Gecko},n=Bu.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Du.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Du.WebKit},n=Bu.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class qu{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=Bu.find(Uu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=Bu.find(Vu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=Bu.find($u,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=Bu.find(Wu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Bu.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach(a=>{const o=e[a];"string"==typeof o?(r[a]=o,i+=1):"object"==typeof o&&(t[a]=o,n+=1)}),n>0){const e=Object.keys(t),n=Bu.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=Bu.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=Bu.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const i=Bu.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(Bu.compareVersions(i,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
42
+ */class Tr{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Cr(e,t)}static parse(e){return new Cr(e).getResult()}static get BROWSER_MAP(){return gr}static get ENGINE_MAP(){return br}static get OS_MAP(){return yr}static get PLATFORMS_MAP(){return vr}}function Mr(){return Date.now()+Math.random().toString()}function Pr(){throw new Error("Method must be implemented in subclass")}function Ar(e,t){return null!=t&&t.proxyUrl?t.proxyUrl+("/"===t.proxyUrl.slice(-1)?"":"/")+e.substring(8):e}function Or(e){return null!=e&&e.callObjectBundleUrlOverride?e.callObjectBundleUrlOverride:Ar("https://c.daily.co/call-machine/versioned/".concat("0.84.0","/static/call-machine-object-bundle.js"),e)}function Nr(e){try{new URL(e)}catch(t){return!1}return!0}const Lr="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,jr="8.55.0",Ir=globalThis;function Rr(e,t,n){const r=Ir,i=r.__SENTRY__=r.__SENTRY__||{},a=i[jr]=i[jr]||{};return a[e]||(a[e]=t())}const Fr="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Dr=["debug","info","warn","error","log","assert","trace"],Br={};function zr(e){if(!("console"in Ir))return e();const t=Ir.console,n={},r=Object.keys(Br);r.forEach(e=>{const r=Br[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}const Ur=Rr("logger",function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Fr?Dr.forEach(n=>{t[n]=(...t)=>{e&&zr(()=>{Ir.console[n](`Sentry Logger [${n}]:`,...t)})}}):Dr.forEach(e=>{t[e]=()=>{}}),t}),Vr="?",$r=/\(error: (.*)\)/,Wr=/captureMessage|captureException/;function qr(e){return e[e.length-1]||{}}const Hr="<anonymous>";function Jr(e){try{return e&&"function"==typeof e&&e.name||Hr}catch(t){return Hr}}function Qr(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch(n){return}}}const Gr={},Yr={};function Kr(e,t){Gr[e]=Gr[e]||[],Gr[e].push(t)}function Xr(e,t){if(!Yr[e]){Yr[e]=!0;try{t()}catch(n){Fr&&Ur.error(`Error while instrumenting ${e}`,n)}}}function Zr(e,t){const n=e&&Gr[e];if(n)for(const i of n)try{i(t)}catch(r){Fr&&Ur.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Jr(i)}\nError:`,r)}}let ei=null;function ti(){ei=Ir.onerror,Ir.onerror=function(e,t,n,r,i){return Zr("error",{column:r,error:i,line:n,msg:e,url:t}),!!ei&&ei.apply(this,arguments)},Ir.onerror.__SENTRY_INSTRUMENTED__=!0}let ni=null;function ri(){ni=Ir.onunhandledrejection,Ir.onunhandledrejection=function(e){return Zr("unhandledrejection",e),!ni||ni.apply(this,arguments)},Ir.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function ii(){return ai(Ir),Ir}function ai(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||jr,t[jr]=t[jr]||{}}const oi=Object.prototype.toString;function si(e){switch(oi.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return vi(e,Error)}}function li(e,t){return oi.call(e)===`[object ${t}]`}function ci(e){return li(e,"ErrorEvent")}function ui(e){return li(e,"DOMError")}function di(e){return li(e,"String")}function fi(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function pi(e){return null===e||fi(e)||"object"!=typeof e&&"function"!=typeof e}function hi(e){return li(e,"Object")}function mi(e){return"undefined"!=typeof Event&&vi(e,Event)}function gi(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function vi(e,t){try{return e instanceof t}catch(n){return!1}}function yi(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}const bi=Ir;function wi(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,i=[];let a=0,o=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&a++<r&&(c=ki(n,u),!("html"===c||a>1&&o+i.length*l+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(s)}catch(n){return"<unknown>"}}function ki(e,t){const n=e,r=[];if(!n||!n.tagName)return"";if(bi.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const i=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i&&i.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&di(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}const a=["aria-label","type","name","title","alt"];for(const o of a){const e=n.getAttribute(o);e&&r.push(`[${o}="${e}"]`)}return r.join("")}function Si(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function _i(e,t){if(!Array.isArray(e))return"";const n=[];for(let i=0;i<e.length;i++){const t=e[i];try{yi(t)?n.push("[VueViewModel]"):n.push(String(t))}catch(r){n.push("[value cannot be serialized]")}}return n.join(t)}function xi(e,t=[],n=!1){return t.some(t=>function(e,t,n=!1){return!!di(e)&&(li(t,"RegExp")?t.test(e):!!di(t)&&(n?e===t:e.includes(t)))}(e,t,n))}function Ei(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"==typeof i&&Ti(i,r);try{e[t]=i}catch(a){Fr&&Ur.log(`Failed to replace method "${t}" in object`,e)}}function Ci(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){Fr&&Ur.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Ti(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Ci(e,"__sentry_original__",t)}catch(n){}}function Mi(e){return e.__sentry_original__}function Pi(e){if(si(e))return l({message:e.message,name:e.name,stack:e.stack},Oi(e));if(mi(e)){const t=l({type:e.type,target:Ai(e.target),currentTarget:Ai(e.currentTarget)},Oi(e));return"undefined"!=typeof CustomEvent&&vi(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Ai(e){try{return"undefined"!=typeof Element&&vi(e,Element)?wi(e):Object.prototype.toString.call(e)}catch(t){return"<unknown>"}}function Oi(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ni(e){return Li(e,new Map)}function Li(e,t){if(function(e){if(!hi(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(t){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const i of Object.getOwnPropertyNames(e))void 0!==e[i]&&(r[i]=Li(e[i],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach(e=>{r.push(Li(e,t))}),r}return e}function ji(){return Date.now()/1e3}const Ii=function(){const{performance:e}=Ir;if(!e||!e.now)return ji;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function Ri(){const e=Ir,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(r){}return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function Fi(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Di(e){const{message:t,event_id:n}=e;if(t)return t;const r=Fi(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Bi(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function zi(e,t){const n=Fi(e);if(!n)return;const r=n.mechanism;if(n.mechanism=l(l({type:"generic",handled:!0},r),t),t&&"data"in t){const e=l(l({},r&&r.data),t.data);n.mechanism.data=e}}function Ui(e){if(function(e){try{return e.__sentry_captured__}catch(t){}}(e))return!0;try{Ci(e,"__sentry_captured__",!0)}catch(t){}return!1}var Vi;function $i(e){return new qi(t=>{t(e)})}function Wi(e){return new qi((t,n)=>{n(e)})}(()=>{const{performance:e}=Ir;e&&e.now&&(e.now(),e.timing&&e.timing.navigationStart)})(),function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(Vi||(Vi={}));class qi{constructor(e){qi.prototype.__init.call(this),qi.prototype.__init2.call(this),qi.prototype.__init3.call(this),qi.prototype.__init4.call(this),this._state=Vi.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new qi((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(i){r(i)}else n(t)},e=>{if(t)try{n(t(e))}catch(i){r(i)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new qi((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{i?n(r):t(r)})})}__init(){this._resolve=e=>{this._setResult(Vi.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Vi.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===Vi.PENDING&&(gi(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===Vi.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===Vi.RESOLVED&&e[1](this._value),this._state===Vi.REJECTED&&e[2](this._value),e[0]=!0)})}}}function Hi(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Ii(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Ri()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Ji(){return Ri()}function Qi(){return Ri().substring(16)}function Gi(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const r=l({},e);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Gi(r[i],t[i],n-1));return r}const Yi="_sentrySpan";function Ki(e,t){t?Ci(e,Yi,t):delete e[Yi]}function Xi(e){return e[Yi]}class Zi{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ji(),spanId:Qi()}}clone(){const e=new Zi;return e._breadcrumbs=[...this._breadcrumbs],e._tags=l({},this._tags),e._extra=l({},this._extra),e._contexts=l({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata=l({},this._sdkProcessingMetadata),e._propagationContext=l({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,Ki(e,Xi(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Hi(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=l(l({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=c(l({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=l(l({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=c(l({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,r]=t instanceof ea?[t.getScopeData(),t.getRequestSession()]:hi(t)?[e,e.requestSession]:[],{tags:i,extra:a,user:o,contexts:s,level:c,fingerprint:u=[],propagationContext:d}=n||{};return this._tags=l(l({},this._tags),i),this._extra=l(l({},this._extra),a),this._contexts=l(l({},this._contexts),s),o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Ki(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ji()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r=l({timestamp:ji()},e);return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Xi(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Gi(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=l({spanId:Qi()},e),this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:Ri();if(!this._client)return Ur.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,c(l({originalException:e,syntheticException:r},t),{event_id:n}),this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Ri();if(!this._client)return Ur.warn("No client configured on scope - will not capture message!"),r;const i=new Error(e);return this._client.captureMessage(e,t,c(l({originalException:e,syntheticException:i},n),{event_id:r}),this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Ri();return this._client?(this._client.captureEvent(e,c(l({},t),{event_id:n}),this),n):(Ur.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const ea=Zi;class ta{constructor(e,t){let n,r;n=e||new ea,r=t||new ea,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(r){throw this._popScope(),r}return gi(n)?n.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}}function na(){const e=ai(ii());return e.stack=e.stack||new ta(Rr("defaultCurrentScope",()=>new ea),Rr("defaultIsolationScope",()=>new ea))}function ra(e){return na().withScope(e)}function ia(e,t){const n=na();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function aa(e){return na().withScope(()=>e(na().getIsolationScope()))}function oa(e){const t=ai(e);return t.acs?t.acs:{withIsolationScope:aa,withScope:ra,withSetScope:ia,withSetIsolationScope:(e,t)=>aa(t),getCurrentScope:()=>na().getScope(),getIsolationScope:()=>na().getIsolationScope()}}function sa(){return oa(ii()).getCurrentScope()}function la(){return oa(ii()).getIsolationScope()}function ca(){return sa().getClient()}function ua(e){const t=e.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:i}=t;return Ni({trace_id:n,span_id:r,parent_span_id:i})}function da(e){const t=e._sentryMetrics;if(!t)return;const n={};for(const[,[r,i]]of t)(n[r]||(n[r]=[])).push(Ni(i));return n}const fa=/^sentry-/;function pa(e){return e.split(",").map(e=>e.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}let ha=!1;function ma(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext();return Ni({parent_span_id:r?t:ya(e).parent_span_id,span_id:r?Qi():t,trace_id:n})}function ga(e){return"number"==typeof e?va(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?va(e.getTime()):Ii()}function va(e){return e>9999999999?e/1e3:e}function ya(e){if("function"==typeof e.getSpanJSON)return e.getSpanJSON();try{const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:i,name:a,endTime:o,parentSpanId:s,status:l}=e;return Ni({span_id:t,trace_id:n,data:r,description:a,parent_span_id:s,start_timestamp:ga(i),timestamp:ga(o)||void 0,status:ba(l),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:da(e)})}return{span_id:t,trace_id:n}}catch(t){return{}}}function ba(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"unknown_error"}function wa(e){return e._sentryRootSpan||e}function ka(){ha||(zr(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),ha=!0)}const Sa="production";function _a(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i=Ni({environment:n.environment||Sa,release:n.release,public_key:r,trace_id:e});return t.emit("createDsc",i),i}function xa(e){const t=ca();if(!t)return{};const n=wa(e),r=n._frozenDsc;if(r)return r;const i=n.spanContext().traceState,a=i&&i.get("sentry.dsc"),o=a&&function(e){const t=function(e){if(e&&(di(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{const n=pa(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):pa(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>(t.match(fa)&&(e[t.slice(7)]=n),e),{});return Object.keys(n).length>0?n:void 0}(a);if(o)return o;const s=_a(e.spanContext().traceId,t),l=ya(n),c=l.data||{},u=c["sentry.sample_rate"];null!=u&&(s.sample_rate=`${u}`);const d=c["sentry.source"],f=l.description;return"url"!==d&&f&&(s.transaction=f),function(){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=ca(),t=e&&e.getOptions();return!!t&&(t.enableTracing||"tracesSampleRate"in t||"tracesSampler"in t)}()&&(s.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n))),t.emit("createDsc",s,n),s}const Ea=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Ca(e,t=!1){const{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${r?`${r}/`:r}${o}`}function Ta(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Ma(e,t=100,n=1/0){try{return Aa("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Pa(e,t=3,n=102400){const r=Ma(e,t);return a=r,i=JSON.stringify(a),~-encodeURI(i).split(/%..|./).length>n?Pa(e,t-1,n):r;var i,a}function Aa(e,t,n=1/0,r=1/0,i=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[a,o]=i;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const s=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof global&&t===global)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(yi(t))return"[VueViewModel]";if(hi(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${Jr(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}var n}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===l)return s.replace("object ","");if(a(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return Aa("",c.toJSON(),l-1,r,i)}catch(p){}const u=Array.isArray(t)?[]:{};let d=0;const f=Pi(t);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(d>=r){u[h]="[MaxProperties ~]";break}const e=f[h];u[h]=Aa(h,e,l-1,r,i),d++}return o(t),u}function Oa(e,t=[]){return[e,t]}function Na(e,t){const[n,r]=e;return[n,[...r,t]]}function La(e,t){const n=e[1];for(const r of n)if(t(r,r[0].type))return!0;return!1}function ja(e){return Ir.__SENTRY__&&Ir.__SENTRY__.encodePolyfill?Ir.__SENTRY__.encodePolyfill(e):(new TextEncoder).encode(e)}function Ia(e){const[t,n]=e;let r=JSON.stringify(t);function i(e){"string"==typeof r?r="string"==typeof e?r+e:[ja(r),e]:r.push("string"==typeof e?ja(e):e)}for(const o of n){const[e,t]=o;if(i(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)i(t);else{let e;try{e=JSON.stringify(t)}catch(a){e=JSON.stringify(Ma(t))}i(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(r)}function Ra(e){const t="string"==typeof e.data?ja(e.data):e.data;return[Ni({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}const Fa={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function Da(e){return Fa[e]}function Ba(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function za(e,t,n,r=0){return new qi((i,a)=>{const o=e[r];if(null===t||"function"!=typeof o)i(t);else{const s=o(l({},t),n);Lr&&o.id&&null===s&&Ur.log(`Event processor "${o.id}" dropped event`),gi(s)?s.then(t=>za(e,t,n,r+1).then(i)).then(null,a):za(e,s,n,r+1).then(i).then(null,a)}})}let Ua,Va,$a;function Wa(e,t){const{extra:n,tags:r,user:i,contexts:a,level:o,sdkProcessingMetadata:s,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:h,span:m}=t;qa(e,"extra",n),qa(e,"tags",r),qa(e,"user",i),qa(e,"contexts",a),e.sdkProcessingMetadata=Gi(e.sdkProcessingMetadata,s,2),o&&(e.level=o),h&&(e.transactionName=h),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext=l(l({},e.propagationContext),p)}function qa(e,t,n){e[t]=Gi(e[t],n,1)}function Ha(e,t,n,r,i,a){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,u=c(l({},t),{event_id:t.event_id||n.event_id||Ri(),timestamp:t.timestamp||ji()}),d=n.integrations||e.integrations.map(e=>e.name);var f,p;!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:a=250}=t;e.environment=e.environment||n||Sa,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i),e.message&&(e.message=Si(e.message,a));const o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=Si(o.value,a));const s=e.request;s&&s.url&&(s.url=Si(s.url,a))}(u,e),f=u,(p=d).length>0&&(f.sdk=f.sdk||{},f.sdk.integrations=[...f.sdk.integrations||[],...p]),i&&i.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=Ir._sentryDebugIds;if(!t)return{};const n=Object.keys(t);return $a&&n.length===Va||(Va=n.length,$a=n.reduce((n,r)=>{Ua||(Ua={});const i=Ua[r];if(i)n[i[0]]=i[1];else{const i=e(r);for(let e=i.length-1;e>=0;e--){const a=i[e],o=a&&a.filename,s=t[r];if(o&&s){n[o]=s,Ua[r]=[o,s];break}}}return n},{})),$a}(t);try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{n&&e.filename&&(e.debug_id=n[e.filename])})})}catch(r){}}(u,e.stackParser);const h=function(e,t){if(!t)return e;const n=e?e.clone():new ea;return n.update(t),n}(r,n.captureContext);n.mechanism&&zi(u,n.mechanism);const m=i?i.getEventProcessors():[],g=Rr("globalScope",()=>new ea).getScopeData();a&&Wa(g,a.getScopeData()),h&&Wa(g,h.getScopeData());const v=[...n.attachments||[],...g.attachments];return v.length&&(n.attachments=v),function(e,t){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;var o,s;!function(e,t){const{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t,c=Ni(n);c&&Object.keys(c).length&&(e.extra=l(l({},c),e.extra));const u=Ni(r);u&&Object.keys(u).length&&(e.tags=l(l({},u),e.tags));const d=Ni(i);d&&Object.keys(d).length&&(e.user=l(l({},d),e.user));const f=Ni(a);f&&Object.keys(f).length&&(e.contexts=l(l({},f),e.contexts)),o&&(e.level=o),s&&"transaction"!==e.type&&(e.transaction=s)}(e,t),r&&function(e,t){e.contexts=l({trace:ma(t)},e.contexts),e.sdkProcessingMetadata=l({dynamicSamplingContext:xa(t)},e.sdkProcessingMetadata);const n=ya(wa(t)).description;n&&!e.transaction&&"transaction"===e.type&&(e.transaction=n)}(e,r),s=n,(o=e).fingerprint=o.fingerprint?Array.isArray(o.fingerprint)?o.fingerprint:[o.fingerprint]:[],s&&(o.fingerprint=o.fingerprint.concat(s)),o.fingerprint&&!o.fingerprint.length&&delete o.fingerprint,function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,i),function(e,t){e.sdkProcessingMetadata=l(l({},e.sdkProcessingMetadata),t)}(e,a)}(u,g),za([...m,...g.eventProcessors],u,n).then(e=>(e&&function(e){const t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch(r){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r=l(l(l(l(l({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>l(l({},e),e.data&&{data:Ma(e.data,t,n)}))}),e.user&&{user:Ma(e.user,t,n)}),e.contexts&&{contexts:Ma(e.contexts,t,n)}),e.extra&&{extra:Ma(e.extra,t,n)});return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ma(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>l(l({},e),e.data&&{data:Ma(e.data,t,n)}))),e.contexts&&e.contexts.flags&&r.contexts&&(r.contexts.flags=Ma(e.contexts.flags,3,n)),r}(e,o,s):e))}function Ja(e,t){return sa().captureEvent(e,t)}function Qa(e){const t=ca(),n=la(),r=sa(),{release:i,environment:a=Sa}=t&&t.getOptions()||{},{userAgent:o}=Ir.navigator||{},s=function(e){const t=Ii(),n={sid:Ri(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>{return Ni({sid:`${(e=n).sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}});var e}};return e&&Hi(n,e),n}(l(l({release:i,environment:a,user:r.getUser()||n.getUser()},o&&{userAgent:o}),e)),c=n.getSession();return c&&"ok"===c.status&&Hi(c,{status:"exited"}),Ga(),n.setSession(s),r.setSession(s),s}function Ga(){const e=la(),t=sa(),n=t.getSession()||e.getSession();n&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),Hi(e,t)}(n),Ya(),e.setSession(),t.setSession()}function Ya(){const e=la(),t=sa(),n=ca(),r=t.getSession()||e.getSession();r&&n&&n.captureSession(r)}function Ka(e=!1){e?Ga():Ya()}const Xa=[];function Za(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function eo(e,t,n){if(n[t.name])Lr&&Ur.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===Xa.indexOf(t.name)&&"function"==typeof t.setupOnce&&(t.setupOnce(),Xa.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}Lr&&Ur.log(`Integration installed: ${t.name}`)}}class to extends Error{constructor(e,t="warn"){super(e),this.message=e,this.logLevel=t}}const no="Not capturing exception because it's already been captured.";class ro{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=Ea.exec(e);if(!t)return void zr(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});const[n,r,i="",a="",o="",s=""]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return Ta({host:a,pass:i,path:l,projectId:c,port:o,protocol:n,publicKey:r})}(e):Ta(e);if(t&&function(e){if(!Fr)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(Ur.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(Ur.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(Ur.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(Ur.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):Lr&&Ur.warn("No DSN provided, client will not send events."),this._dsn){const t=function(e,t,n){return t||`${r=e,`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(r)}${r.projectId}/envelope/`}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`;var r}(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(c(l({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}const t=["enableTracing","tracesSampleRate","tracesSampler"].find(t=>t in e&&null==e[t]);t&&zr(()=>{console.warn(`[Sentry] Deprecation warning: \`${t}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,t,n){const r=Ri();if(Ui(e))return Lr&&Ur.log(no),r;const i=l({event_id:r},t);return this._process(this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n))),i.event_id}captureMessage(e,t,n,r){const i=l({event_id:Ri()},n),a=fi(e)?e:String(e),o=pi(e)?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(o.then(e=>this._captureEvent(e,i,r))),i.event_id}captureEvent(e,t,n){const r=Ri();if(t&&t.originalException&&Ui(t.originalException))return Lr&&Ur.log(no),r;const i=l({event_id:r},t),a=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,i,a||n)),i.event_id}captureSession(e){"string"!=typeof e.release?Lr&&Ur.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Hi(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.emit("flush"),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):$i(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.emit("close"),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];eo(this,e,this._integrations),t||Za(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const i=Ba(n),a=e.type&&"replay_event"!==e.type?e.type:"event";var o,s;o=e,(s=n&&n.sdk)&&(o.sdk=o.sdk||{},o.sdk.name=o.sdk.name||s.name,o.sdk.version=o.sdk.version||s.version,o.sdk.integrations=[...o.sdk.integrations||[],...s.integrations||[]],o.sdk.packages=[...o.sdk.packages||[],...s.packages||[]]);const c=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return l(l(l({event_id:e.event_id,sent_at:(new Date).toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:Ca(r)}),i&&{trace:Ni(l({},i))})}(e,i,r,t);return delete e.sdkProcessingMetadata,Oa(c,[[{type:a},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])n=Na(n,Ra(i));const r=this.sendEnvelope(n);r&&r.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){const t=function(e,t,n,r){const i=Ba(n);return Oa(l(l({sent_at:(new Date).toISOString()},i&&{sdk:i}),!!r&&t&&{dsn:Ca(t)}),["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const r="number"==typeof n?n:1,i=`${e}:${t}`;Lr&&Ur.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(e,t){const n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{const e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,e=>(Lr&&Ur.error("Error while sending envelope:",e),e)):(Lr&&Ur.error("Transport disabled"),$i({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t&&eo(e,t,n)}),n}(this,e),Za(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const a="ok"===e.status;(a&&0===e.errors||a&&n)&&(Hi(e,c(l({},n&&{status:"crashed"}),{errors:e.errors||Number(r||n)})),this.captureSession(e))}_isClientDoneProcessing(e){return new qi(t=>{let n=0;const r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n=sa(),r=la()){const i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a.length>0&&(t.integrations=a),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Ha(i,e,t,n,this,r).then(e=>{if(null===e)return e;e.contexts=l({trace:ua(n)},e.contexts);const t=function(e,t){const n=t.getPropagationContext();return n.dsc||_a(n.traceId,e)}(this,n);return e.sdkProcessingMetadata=l({dynamicSamplingContext:t},e.sdkProcessingMetadata),e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{Lr&&(e instanceof to&&"log"===e.logLevel?Ur.log(e.message):Ur.warn(e))})}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r,a=ao(e),o=io(e),s=e.type||"error",u=`before send for type \`${s}\``,d=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;if(!("number"!=typeof t||isNaN(t)||t<0||t>1))return t;Lr&&Ur.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`)}(i);if(o&&"number"==typeof d&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error",e),Wi(new to(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const f="replay_event"===s?"replay":s,p=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,p).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",f,e),new to("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(gi(e))return e.then(e=>{if(!hi(e)&&null!==e)throw new to(n);return e},e=>{throw new to(`${t} rejected with ${e}`)});if(!hi(e)&&null!==e)throw new to(n);return e}(function(e,t,n,r){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o}=t;if(io(n)&&i)return i(n,r);if(ao(n)){if(n.spans&&o){const t=[];for(const r of n.spans){const n=o(r);n?t.push(n):(ka(),e.recordDroppedEvent("before_send","span"))}n.spans=t}if(a){if(n.spans){const e=n.spans.length;n.sdkProcessingMetadata=c(l({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:e})}return a(n,r)}}return n}(this,r,n,t),u)}).then(r=>{if(null===r){if(this.recordDroppedEvent("before_send",f,e),a){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw new to(`${u} returned \`null\`, will not send event.`,"log")}const i=n&&n.getSession();if(!a&&i&&this._updateSessionFromEvent(i,r),a){const e=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const o=r.transaction_info;if(a&&o&&r.transaction!==e.transaction){const e="custom";r.transaction_info=c(l({},o),{source:e})}return this.sendEvent(r,t),r}).then(null,e=>{if(e instanceof to)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new to(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){Lr&&Ur.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(Lr&&Ur.log("No outcomes to send"));if(!this._dsn)return void(Lr&&Ur.log("No dsn provided, will not send outcomes"));Lr&&Ur.log("Sending outcomes:",e);const t=(n=e,Oa((r=this._options.tunnel&&Ca(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:ji(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function io(e){return void 0===e.type}function ao(e){return"transaction"===e.type}function oo(e,t,n=function(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return Wi(new to("Not adding Promise because buffer limit was reached."));const i=r();return-1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new qi((n,r)=>{let i=t.length;if(!i)return n(!0);const a=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{$i(e).then(()=>{--i||(clearTimeout(a),n(!0))},r)})})}}}(e.bufferSize||64)){let r={};return{send:function(i){const a=[];if(La(i,(t,n)=>{const i=Da(n);if(function(e,t,n=Date.now()){return((r=e)[t]||r.all||0)>n;var r}(r,i)){const r=so(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else a.push(t)}),0===a.length)return $i({});const o=Oa(i[0],a),s=t=>{La(o,(n,r)=>{const i=so(n,r);e.recordDroppedEvent(t,Da(r),i)})};return n.add(()=>t({body:Ia(o)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Lr&&Ur.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){const i=l({},e),a=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(a)for(const s of a.trim().split(",")){const[e,t,,,n]=s.split(":",5),a=parseInt(e,10),o=1e3*(isNaN(a)?60:a);if(t)for(const s of t.split(";"))"metric_bucket"===s&&n&&!n.split(";").includes("custom")||(i[s]=r+o);else i.all=r+o}else o?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):429===t&&(i.all=r+6e4);return i}(r,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof to)return Lr&&Ur.error("Skipped sending event because buffer is full."),s("queue_overflow"),$i({});throw e})},flush:e=>n.drain(e)}}function so(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}const lo=100;function co(e,t){const n=ca(),r=la();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=lo}=n.getOptions();if(a<=0)return;const o=l({timestamp:ji()},e),s=i?zr(()=>i(o,t)):o;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),r.addBreadcrumb(s,a))}let uo;const fo=new WeakMap,po=()=>({name:"FunctionToString",setupOnce(){uo=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Mi(this),n=fo.has(ca())&&void 0!==t?t:this;return uo.apply(n,e)}}catch(lr){}},setup(e){fo.set(e,!0)}}),ho=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/],mo=(e={})=>({name:"InboundFilters",processEvent(t,n,r){const i=r.getOptions(),a=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:ho],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,i);return o=t,((s=a).ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(t){}return!1}(o)?(Lr&&Ur.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Di(o)}`),1):(l=o,c=s.ignoreErrors,!l.type&&c&&c.length&&function(e){const t=[];let n;e.message&&t.push(e.message);try{n=e.exception.values[e.exception.values.length-1]}catch(r){}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),t}(l).some(e=>xi(e,c))?(Lr&&Ur.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Di(o)}`),1):function(e){return!(e.type||!e.exception||!e.exception.values||0===e.exception.values.length||e.message||e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(o)?(Lr&&Ur.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${Di(o)}`),1):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&xi(n,t)}(o,s.ignoreTransactions)?(Lr&&Ur.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Di(o)}`),1):function(e,t){if(!t||!t.length)return!1;const n=go(e);return!!n&&xi(n,t)}(o,s.denyUrls)?(Lr&&Ur.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Di(o)}.\nUrl: ${go(o)}`),1):!function(e,t){if(!t||!t.length)return!0;const n=go(e);return!n||xi(n,t)}(o,s.allowUrls)&&(Lr&&Ur.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Di(o)}.\nUrl: ${go(o)}`),1)))?null:t;var o,s,l,c}});function go(e){try{let n;try{n=e.exception.values[0].stacktrace.frames}catch(t){}return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(n){return Lr&&Ur.error(`Cannot extract url for event ${Di(e)}`),null}}function vo(e,t,n=250,r,i,a,o){if(!(a.exception&&a.exception.values&&o&&vi(o.originalException,Error)))return;const s=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;var l,c;s&&(a.exception.values=(l=yo(e,t,i,o.originalException,r,a.exception.values,s,0),c=n,l.map(e=>(e.value&&(e.value=Si(e.value,c)),e))))}function yo(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let l=[...a];if(vi(r[i],Error)){bo(o,s);const a=e(t,r[i]),c=l.length;wo(a,i,c,s),l=yo(e,t,n,r[i],i,[a,...l],a,c)}return Array.isArray(r.errors)&&r.errors.forEach((r,a)=>{if(vi(r,Error)){bo(o,s);const c=e(t,r),u=l.length;wo(c,`errors[${a}]`,u,s),l=yo(e,t,n,r,i,[c,...l],c,u)}}),l}function bo(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=c(l(l({},e.mechanism),"AggregateError"===e.type&&{is_exception_group:!0}),{exception_id:t})}function wo(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=c(l({},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function ko(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function So(){"console"in Ir&&Dr.forEach(function(e){e in Ir.console&&Ei(Ir.console,e,function(t){return Br[e]=t,function(...t){Zr("console",{args:t,level:e});const n=Br[e];n&&n.apply(Ir.console,t)}})})}function _o(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const xo=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(n=t,(r=e)&&(function(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Co(e,t)||!Eo(e,t))}(n,r)||function(e,t){const n=To(t),r=To(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&Co(e,t)&&Eo(e,t))}(n,r)))return Lr&&Ur.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}var n,r;return e=t}}};function Eo(e,t){let n=Qr(e),r=Qr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const e=r[i],t=n[i];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function Co(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(i){return!1}}function To(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Mo(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const Po=Ir;function Ao(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Oo(e,t){const n="fetch";Kr(n,e),Xr(n,()=>function(e,t=!1){t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in Po))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}())return!1;if(Ao(Po.fetch))return!0;let t=!1;const n=Po.document;if(n&&"function"==typeof n.createElement)try{const e=n.createElement("iframe");e.hidden=!0,n.head.appendChild(e),e.contentWindow&&e.contentWindow.fetch&&(t=Ao(e.contentWindow.fetch)),n.head.removeChild(e)}catch(e){Fr&&Ur.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}()||Ei(Ir,"fetch",function(t){return function(...n){const r=new Error,{method:i,url:a}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:Lo(t),method:No(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Lo(t),method:No(t,"method")?String(t.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:1e3*Ii(),virtualError:r};return e||Zr("fetch",l({},o)),t.apply(Ir,n).then(t=>d(null,null,function*(){return e?e(t):Zr("fetch",c(l({},o),{endTimestamp:1e3*Ii(),response:t})),t}),e=>{throw Zr("fetch",c(l({},o),{endTimestamp:1e3*Ii(),error:e})),si(e)&&void 0===e.stack&&(e.stack=r.stack,Ci(e,"framesToPop",1)),e})}})}(void 0,t))}function No(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Lo(e){return"string"==typeof e?e:e?No(e,"url")?e.url:e.toString?e.toString():"":""}const jo=Ir,Io=Ir;let Ro=0;function Fo(){return Ro>0}function Do(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(Mi(e))return e}catch(r){return e}const n=function(...n){try{const r=n.map(e=>Do(e,t));return e.apply(this,r)}catch(r){throw Ro++,setTimeout(()=>{Ro--}),function(...e){const t=oa(ii());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(e=>{var i;e.addEventProcessor(e=>(t.mechanism&&(Bi(e,void 0),zi(e,t.mechanism)),e.extra=c(l({},e.extra),{arguments:n}),e)),i=r,sa().captureException(i,void 0)}),r}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch(i){}Ti(n,e),Ci(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch(i){}return n}const Bo="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function zo(e,t){const n=Vo(e,t),r={type:qo(t),value:Ho(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Uo(e,t){return{exception:{values:[zo(e,t)]}}}function Vo(e,t){const n=t.stacktrace||t.stack||"",r=(a=t)&&$o.test(a.message)?1:0,i=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);var a;try{return e(n,r,i)}catch(a){}return[]}const $o=/Minified React error #\d+;/i;function Wo(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function qo(e){const t=e&&e.name;return!t&&Wo(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Ho(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:Wo(e)&&Array.isArray(e.message)&&2==e.message.length?e.message[1]:t:"No error message"}function Jo(e,t,n,r,i){let a;if(ci(t)&&t.error)return Uo(e,t.error);if(ui(t)||li(t,"DOMException")){const i=t;if("stack"in t)a=Uo(e,t);else{const t=i.name||(ui(i)?"DOMError":"DOMException"),o=i.message?`${t}: ${i.message}`:t;a=Qo(e,o,n,r),Bi(a,o)}return"code"in i&&(a.tags=c(l({},a.tags),{"DOMException.code":`${i.code}`})),a}return si(t)?Uo(e,t):hi(t)||mi(t)?(a=function(e,t,n,r){const i=ca(),a=i&&i.getOptions().normalizeDepth,o=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}(t),s={__serialized__:Pa(t,a)};if(o)return{exception:{values:[zo(e,o)]},extra:s};const l={exception:{values:[{type:mi(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Go(t,{isUnhandledRejection:r})}]},extra:s};if(n){const t=Vo(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}(e,t,n,i),zi(a,{synthetic:!0}),a):(a=Qo(e,t,n,r),Bi(a,`${t}`),zi(a,{synthetic:!0}),a)}function Qo(e,t,n,r){const i={};if(r&&n){const r=Vo(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),zi(i,{synthetic:!0})}if(fi(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Go(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(Pi(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return Si(r,t);for(let i=n.length;i>0;i--){const e=n.slice(0,i).join(", ");if(!(e.length>t))return i===n.length?e:Si(e,t)}return""}(e),r=t?"promise rejection":"exception";return ci(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:mi(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(t){}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}class Yo extends ro{constructor(e){const t=l({parentSpanIsAlwaysRootSpan:!0},e);!function(e,t,n=[t],r="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:jr})),version:jr}),e._metadata=i}(t,"browser",["browser"],Io.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&Io.document&&Io.document.addEventListener("visibilitychange",()=>{"hidden"===Io.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){const i=Jo(e,t,n&&n.syntheticException||void 0,r);return zi(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),$i(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const a=Qo(e,t,r&&r.syntheticException||void 0,i);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),$i(a)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Bo&&Ur.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){return Oa(l(l({event_id:e.event_id,sent_at:(new Date).toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!n&&!!r&&{dsn:Ca(r)}),[function(e){return[{type:"user_report"},e]}(e)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}}const Ko="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Xo=Ir;let Zo,es,ts,ns;function rs(){if(!Xo.document)return;const e=Zr.bind(null,"dom"),t=is(e,!0);Xo.document.addEventListener("click",t,!1),Xo.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=Xo[t],r=n&&n.prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Ei(r,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){const r=is(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch(a){}return t.call(this,n,r,i)}}),Ei(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch(i){}return e.call(this,t,n,r)}}))})}function is(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(t){return null}}(n);if(i=n.type,a=r,"keypress"===i&&(!a||!a.tagName||"INPUT"!==a.tagName&&"TEXTAREA"!==a.tagName&&!a.isContentEditable))return;var i,a;Ci(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ci(r,"_sentryId",Ri());const o="keypress"===n.type?"input":n.type;(function(e){if(e.type!==es)return!1;try{if(!e.target||e.target._sentryId!==ts)return!1}catch(t){}return!0})(n)||(e({event:n,name:o,global:t}),es=n.type,ts=r?r._sentryId:void 0),clearTimeout(Zo),Zo=Xo.setTimeout(()=>{ts=void 0,es=void 0},1e3)}}function as(e){const t="history";Kr(t,e),Xr(t,os)}function os(){if(!function(){const e=jo.chrome,t=e&&e.app&&e.app.runtime,n="history"in jo&&!!jo.history.pushState&&!!jo.history.replaceState;return!t&&n}())return;const e=Xo.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=ns,t=String(n);ns=t,Zr("history",{from:e,to:t})}return e.apply(this,t)}}Xo.onpopstate=function(...t){const n=Xo.location.href,r=ns;if(ns=n,Zr("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(i){}},Ei(Xo.history,"pushState",t),Ei(Xo.history,"replaceState",t)}const ss={};function ls(e){ss[e]=void 0}const cs="__sentry_xhr_v3__";function us(){if(!Xo.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,i=1e3*Ii(),a=di(n[0])?n[0].toUpperCase():void 0,o=function(e){if(di(e))return e;try{return e.toString()}catch(t){}}(n[1]);if(!a||!o)return e.apply(t,n);t[cs]={method:a,url:o,request_headers:{}},"POST"===a&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const s=()=>{const e=t[cs];if(e&&4===t.readyState){try{e.status_code=t.status}catch(n){}Zr("xhr",{endTimestamp:1e3*Ii(),startTimestamp:i,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(s(),e.apply(t,n))}):t.addEventListener("readystatechange",s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,i]=n,a=t[cs];return a&&di(r)&&di(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[cs];return r?(void 0!==n[0]&&(r.body=n[0]),Zr("xhr",{startTimestamp:1e3*Ii(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function ds(e,t=function(e){const t=ss[e];if(t)return t;let n=Xo[e];if(Ao(n))return ss[e]=n.bind(Xo);const r=Xo.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const i=t.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(t)}catch(i){Ko&&Ur.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n?ss[e]=n.bind(Xo):n}("fetch")){let n=0,r=0;return oo(e,function(i){const a=i.body.length;n+=a,r++;const o=l({body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);if(!t)return ls("fetch"),Wi("No fetch implementation available");try{return t(e.url,o).then(e=>(n-=a,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(s){return ls("fetch"),n-=a,r--,Wi(s)}})}function fs(e,t,n,r){const i={filename:e,function:"<anonymous>"===t?Vr:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const ps=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,hs=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ms=/\((\S*)(?::(\d+))(?::(\d+))\)/,gs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,vs=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ys=function(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const i=[],a=e.split("\n");for(let o=n;o<a.length;o++){const e=a[o];if(e.length>1024)continue;const n=$r.test(e)?e.replace($r,"$1"):e;if(!n.match(/\S*Error: /)){for(const e of t){const t=e(n);if(t){i.push(t);break}}if(i.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(qr(t).function||"")&&t.pop(),t.reverse(),Wr.test(qr(t).function||"")&&(t.pop(),Wr.test(qr(t).function||"")&&t.pop()),t.slice(0,50).map(e=>c(l({},e),{filename:e.filename||qr(t).filename,function:e.function||Vr}))}(i.slice(r))}}([30,e=>{const t=ps.exec(e);if(t){const[,e,n,r]=t;return fs(e,Vr,+n,+r)}const n=hs.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=ms.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=bs(n[1]||Vr,n[2]);return fs(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=gs.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=vs.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Vr;return[n,e]=bs(n,e),fs(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),bs=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Vr,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},ws=(e={})=>{const t=l({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";Kr(t,e),Xr(t,So)}(function(e){return function(t){if(ca()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:_o(t.level),message:_i(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${_i(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}co(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(ca()!==e)return;let r,i,a="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>1024&&(Bo&&Ur.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof a&&(a=[a]);try{const e=n.event,t=(s=e)&&s.target?e.target:e;r=wi(t,{keyAttrs:a,maxStringLength:o}),i=function(e){if(!bi.HTMLElement)return null;let t=e;for(let n=0;n<5;n++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}(t)}catch(c){r="<unknown>"}var s;if(0===r.length)return;const l={category:`ui.${n.name}`,message:r};i&&(l.data={"ui.component_name":i}),co(l,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),Kr("dom",n),Xr("dom",rs)),t.xhr&&(Kr("xhr",function(e){return function(t){if(ca()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[cs];if(!n||!r||!i)return;const{method:a,url:o,status_code:s,body:l}=i,c={method:a,url:o,status_code:s},u={xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r};co({category:"xhr",data:c,type:"http",level:Mo(s)},u)}}(e)),Xr("xhr",us)),t.fetch&&Oo(function(e){return function(t){if(ca()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error)co({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:n,endTimestamp:r});else{const e=t.response,i=c(l({},t.fetchData),{status_code:e&&e.status}),a={input:t.args,response:e,startTimestamp:n,endTimestamp:r};co({category:"fetch",data:i,type:"http",level:Mo(i.status_code)},a)}}}(e)),t.history&&as(function(e){return function(t){if(ca()!==e)return;let n=t.from,r=t.to;const i=ko(Io.location.href);let a=n?ko(n):void 0;const o=ko(r);a&&a.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),co({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){ca()===e&&co({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Di(t)},{event:t})}}(e))}}},ks=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Ss=(e={})=>{const t=l({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e);return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ei(Io,"setTimeout",_s),t.setInterval&&Ei(Io,"setInterval",_s),t.requestAnimationFrame&&Ei(Io,"requestAnimationFrame",xs),t.XMLHttpRequest&&"XMLHttpRequest"in Io&&Ei(XMLHttpRequest.prototype,"send",Es);const e=t.eventTarget;e&&(Array.isArray(e)?e:ks).forEach(Cs)}}};function _s(e){return function(...t){const n=t[0];return t[0]=Do(n,{mechanism:{data:{function:Jr(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function xs(e){return function(t){return e.apply(this,[Do(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Jr(e)},handled:!1,type:"instrument"}})])}}function Es(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ei(n,e,function(t){const n={mechanism:{data:{function:e,handler:Jr(t)},handled:!1,type:"instrument"}},r=Mi(t);return r&&(n.mechanism.data.handler=Jr(r)),Do(t,n)})}),e.apply(this,t)}}function Cs(e){const t=Io[e],n=t&&t.prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ei(n,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Do(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Jr(r),target:e},handled:!1,type:"instrument"}}))}catch(a){}return t.apply(this,[n,Do(r,{mechanism:{data:{function:"addEventListener",handler:Jr(r),target:e},handled:!1,type:"instrument"}}),i])}}),Ei(n,"removeEventListener",function(e){return function(t,n,r){try{const i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(i){}return e.call(this,t,n,r)}}))}const Ts=(e={})=>{const t=l({onerror:!0,onunhandledrejection:!0},e);return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){var n;t.onerror&&(n=e,function(){const e="error";Kr(e,e=>{const{stackParser:t,attachStacktrace:r}=Ps();if(ca()!==n||Fo())return;const{msg:i,url:a,line:o,column:s,error:l}=e,c=function(e,t,n,r){const i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},l=s.frames=s.frames||[],c=r,u=n,d=di(t)&&t.length>0?t:function(){try{return bi.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:Vr,in_app:!0,lineno:u}),e}(Jo(t,l||i,void 0,r,!1),a,o,s);c.level="error",Ja(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}),Xr(e,ti)}(),Ms("onerror")),t.onunhandledrejection&&(function(e){!function(){const t="unhandledrejection";Kr(t,t=>{const{stackParser:n,attachStacktrace:r}=Ps();if(ca()!==e||Fo())return;const i=function(e){if(pi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(t){}return e}(t),a=pi(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Jo(n,i,void 0,r,!0);a.level="error",Ja(a,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})}),Xr(t,ri)}()}(e),Ms("onunhandledrejection"))}}};function Ms(e){Bo&&Ur.log(`Global Handler attached: ${e}`)}function Ps(){const e=ca();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const As=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,i){const a=i.getOptions();vo(zo,a.stackParser,a.maxValueLength,n,t,e,r)}}};var Os="new",Ns="loading",Ls="loaded",js="joining-meeting",Is="joined-meeting",Rs="left-meeting",Fs="error",Ds="unknown",Bs="no-room",zs="end-of-life",Us="connection-error",Vs="loaded",$s="recording-started",Ws="recording-stopped",qs="fullscreen",Hs="exited-fullscreen",Js="input-settings-updated",Qs="nonfatal-error",Gs="error",Ys=4096,Ks=102400,Xs="iframe-call-message",Zs="local-screen-start",el="daily-method-update-live-streaming-endpoints",tl="transmit-log",nl="daily-custom-track",rl={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},il={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},al={PLAY:"play",PAUSE:"pause"},ol=["jpg","png","jpeg"],sl="sip-call-transfer";function ll(){return!cl()&&"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function cl(){return"undefined"!=typeof navigator&&navigator.product&&"ReactNative"===navigator.product}function ul(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function dl(){if(cl())return!1;if(!document)return!1;var e=document.createElement("iframe");return!!e.requestFullscreen||!!e.webkitRequestFullscreen}var fl="none",pl=function(){try{var e,t=document.createElement("canvas"),n=!1;(e=t.getContext("webgl2",{failIfMajorPerformanceCaveat:!0}))||(n=!0,e=t.getContext("webgl2"));var r=null!=e;return t.remove(),r?n?"software":"hardware":fl}catch(i){return fl}}();function hl(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!cl()&&pl!==fl&&(e?!yl()&&["Chrome","Firefox"].includes(bl()):function(){if(yl())return!1;var e=bl();if("Safari"===e){var t=xl();if(t.major<15||15===t.major&&t.minor<4)return!1}return"Chrome"===e?kl().major>=77:"Firefox"===e?El().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}function ml(){if(cl())return!1;if(vl())return!1;if("undefined"==typeof AudioWorkletNode)return!1;switch(bl()){case"Chrome":case"Firefox":return!0;case"Safari":var e=wl();return e.major>17||17===e.major&&e.minor>=4}return!1}function gl(){return ul()&&"undefined"!=typeof MediaStreamTrack&&!function(){var e,t=bl();if(!ll())return!0;switch(t){case"Chrome":return(e=kl()).major&&e.major>0&&e.major<75;case"Firefox":return(e=El()).major<91;case"Safari":return(e=xl()).major<13||13===e.major&&e.minor<1;default:return!0}}()}function vl(){return ll().match(/Linux; Android/)}function yl(){var e,t=ll(),n=t.match(/Mac/)&&(!cl()&&"undefined"!=typeof window&&null!==(e=window)&&void 0!==e&&null!==(e=e.navigator)&&void 0!==e&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(t.match(/Mobi/)||t.match(/Android/)||n)||!!ll().match(/DailyAnd\//)||void 0}function bl(){if("undefined"!=typeof window){var e=ll();return Sl()?"Safari":e.indexOf("Edge")>-1?"Edge":e.match(/Chrome\//)?"Chrome":e.indexOf("Safari")>-1||_l()?"Safari":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("MSIE")>-1||e.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function wl(){switch(bl()){case"Chrome":return kl();case"Safari":return xl();case"Firefox":return El();case"Edge":return function(){var e=0,t=0;if("undefined"!=typeof window){var n=ll().match(/Edge\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(r){}}return{major:e,minor:t}}()}}function kl(){var e=0,t=0,n=0,r=0,i=!1;if("undefined"!=typeof window){var a=ll(),o=a.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(o)try{e=parseInt(o[1]),t=parseInt(o[2]),n=parseInt(o[3]),r=parseInt(o[4]),i=a.indexOf("OPR/")>-1}catch(s){}}return{major:e,minor:t,build:n,patch:r,opera:i}}function Sl(){return!!ll().match(/iPad|iPhone|iPod/i)&&ul()}function _l(){return ll().indexOf("AppleWebKit/605.1.15")>-1}function xl(){var e=0,t=0,n=0;if("undefined"!=typeof window){var r=ll().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{e=parseInt(r[1]),t=parseInt(r[2]),n=parseInt(r[4])}catch(i){}else(Sl()||_l())&&(e=14,t=0,n=3)}return{major:e,minor:t,point:n}}function El(){var e=0,t=0;if("undefined"!=typeof window){var n=ll().match(/Firefox\/(\d+).(\d+)/);if(n)try{e=parseInt(n[1]),t=parseInt(n[2])}catch(r){}}return{major:e,minor:t}}var Cl=Kn(function e(){Jn(this,e)},[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){Pr()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){Pr()}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){Pr()}},{key:"sendMessageToDailyJs",value:function(e,t){Pr()}},{key:"removeListener",value:function(e){Pr()}}]);function Tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ml(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tl(Object(n),!0).forEach(function(t){nr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pl=function(){return!!e})()}var Al=function(){function e(){var t,n,r;return Jn(this,e),n=this,r=Zn(r=e),(t=Xn(n,Pl()?Reflect.construct(r,[],Zn(n).constructor):r.apply(n,undefined)))._wrappedListeners={},t._messageCallbacks={},t}return tr(e,Cl),Kn(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){var r=this,i=function(i){if(i.data&&"iframe-call-message"===i.data.what&&(!i.data.callClientId||i.data.callClientId===t)&&(!i.data.from||"module"!==i.data.from)){var a=Ml({},i.data);if(delete a.from,a.callbackStamp&&r._messageCallbacks[a.callbackStamp]){var o=a.callbackStamp;r._messageCallbacks[o].call(n,a),delete r._messageCallbacks[o]}delete a.what,delete a.callbackStamp,e.call(n,a)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){var r=function(r){var i;if(!(!r.data||r.data.what!==Xs||!r.data.action||r.data.from&&"module"!==r.data.from||r.data.callClientId&&t&&r.data.callClientId!==t||null!=r&&null!==(i=r.data)&&void 0!==i&&i.callFrameId)){var a=r.data;e.call(n,a)}};this._wrappedListeners[e]=r,window.addEventListener("message",r)}},{key:"sendMessageToCallMachine",value:function(e,t,n,r){if(!n)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var i=Ml({},e);if(i.what=Xs,i.from="module",i.callClientId=n,t){var a=Mr();this._messageCallbacks[a]=t,i.callbackStamp=a}var o=r?r.contentWindow:window,s=this._callMachineTargetOrigin(r);s&&o.postMessage(i,s)}},{key:"sendMessageToDailyJs",value:function(e,t){e.what=Xs,e.callClientId=t,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,t,n){var r=Ml({},e);r.callClientId=n;var i=t?t.contentWindow:window,a=this._callMachineTargetOrigin(t);a&&i.postMessage(r,a)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,t){var n=function(n){if(n.data&&"iframe-call-message"===n.data.what&&(!n.data.callClientId||n.data.callClientId===t)&&(!n.data.from||"module"!==n.data.from)){var r=n.data;e(r)}};return this._wrappedListeners[e]=n,window.addEventListener("message",n),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var t=this._wrappedListeners[e];t&&(window.removeEventListener("message",t),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return"file:"===window.location.protocol?"*":window.location.origin}}])}();function Ol(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Nl=function(){return!!e})()}var Ll=function(){function e(){var t,n,r;return Jn(this,e),n=this,r=Zn(r=e),t=Xn(n,Nl()?Reflect.construct(r,[],Zn(n).constructor):r.apply(n,undefined)),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new ur.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new ur.EventEmitter,t._wrappedListeners={},t._messageCallbacks={},t}return tr(e,Cl),Kn(e,[{key:"addListenerForMessagesFromCallMachine",value:function(e,t,n){this._addListener(e,global.callMachineToDailyJsEmitter,t,n,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,t,n){this._addListener(e,global.dailyJsToCallMachineEmitter,t,n,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,t,n){this._sendMessage(e,global.dailyJsToCallMachineEmitter,n,t,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(e,t){this._sendMessage(e,global.callMachineToDailyJsEmitter,t,null,"sending message to daily-js")}},{key:"removeListener",value:function(e){var t=this._wrappedListeners[e];t&&(global.callMachineToDailyJsEmitter.removeListener("message",t),global.dailyJsToCallMachineEmitter.removeListener("message",t),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,t,n,r,i){var a=this,o=function(t){if(t.callClientId===n){if(t.callbackStamp&&a._messageCallbacks[t.callbackStamp]){var i=t.callbackStamp;a._messageCallbacks[i].call(r,t),delete a._messageCallbacks[i]}e.call(r,t)}};this._wrappedListeners[e]=o,t.addListener("message",o)}},{key:"_sendMessage",value:function(e,t,n,r,i){var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ol(Object(n),!0).forEach(function(t){nr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ol(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);if(a.callClientId=n,r){var o=Mr();this._messageCallbacks[o]=r,a.callbackStamp=o}t.emit("message",a)}}])}(),jl="replace",Il="shallow-merge",Rl=[jl,Il],Fl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.data,r=t.mergeStrategy,i=void 0===r?jl:r;Jn(this,e),e._validateMergeStrategy(i),e._validateData(n,i),this.mergeStrategy=i,this.data=n}return Kn(e,[{key:"isNoOp",value:function(){return e.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,t){return 0===Object.keys(e).length&&t===Il}},{key:"_validateMergeStrategy",value:function(e){if(!Rl.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(Rl,"]"))}},{key:"_validateData",value:function(e,t){if(!function(e){if(null==e||"object"!==Qn(e))return!1;var t=Object.getPrototypeOf(e);return null==t||t===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var n;try{if(n=JSON.stringify(e),t===jl){var r=JSON.parse(n);hr(r,e)||console.warn("The meeting session data provided will be modified when serialized.",r,e)}else if(t===Il)for(var i in e)if(Object.hasOwnProperty.call(e,i)&&void 0!==e[i]){var a=JSON.parse(JSON.stringify(e[i]));hr(e[i],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[i])}}catch(o){throw Error("Meeting session data must be serializable to JSON: ".concat(o))}if(n.length>Ks)throw Error("Meeting session data is too large (".concat(n.length," characters). Maximum size suppported is ").concat(Ks,"."))}}])}();function Dl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Dl=function(){return!!e})()}function Bl(e){var t="function"==typeof Map?new Map:void 0;return Bl=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Dl())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&er(i,n.prototype),i}(e,arguments,Zn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),er(n,e)},Bl(e)}function zl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zl=function(){return!!e})()}function Ul(e){var t,n=null===(t=window._daily)||void 0===t?void 0:t.pendings;if(n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}var Vl=Kn(function e(t){Jn(this,e),this._currentLoad=null,this._callClientId=t},[{key:"load",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void r(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new $l(n,function(){r(!1)},function(e,n){n||Ul(t._callClientId),i(e,n)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),Ul(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),$l=Kn(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;Jn(this,e),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r},[{key:"start",value:function(){var e=this;if(!this._currentAttempt){var t=function(n){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(n,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new Hl(e._dailyConfig,e._successCallback,t),e._currentAttempt.start())},3e3))};this._currentAttempt=new Hl(this._dailyConfig,this._successCallback,t),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}}]),Wl=function(){function e(){return Jn(this,e),t=this,r=arguments,n=Zn(n=e),Xn(t,zl()?Reflect.construct(n,r||[],Zn(t).constructor):n.apply(t,r));var t,n,r}return tr(e,Bl(Error)),Kn(e)}(),ql=2e4,Hl=function(){return Kn(function e(t,n,r){Jn(this,e),this._loadAttemptImpl=cl()||!t.avoidEval?new Jl(t,n,r):new Ql(t,n,r)},[{key:"start",value:(e=ir(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]);var e}(),Jl=function(){return Kn(function e(t,n,r){Jn(this,e),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache="undefined"!=typeof iOSCallObjectBundleCache&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r},[{key:"start",value:(r=ir(function*(){var e=Or(this._dailyConfig);!(yield this._tryLoadFromIOSCache(e))&&this._loadFromNetwork(e)}),function(){return r.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(n=ir(function*(e){if(!this._iosCache)return!1;try{var t=yield this._iosCache.get(e);return!!this.cancelled||!!t&&(t.code?(Function('"use strict";'+t.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=t.refetchHeaders,!1))}catch(n){return!1}}),function(e){return n.apply(this,arguments)})},{key:"_loadFromNetwork",value:(t=ir(function*(e){var t=this;this._networkTimeout=setTimeout(function(){t._networkTimedOut=!0,t._failureCallback({msg:"Timed out (>".concat(ql," ms) when loading call object bundle ").concat(e),type:"timeout"})},ql);try{var n=this._refetchHeaders?{headers:this._refetchHeaders}:{},r=yield fetch(e,n);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Wl;var i=yield this._getBundleCodeFromResponse(e,r);if(this.cancelled)throw new Wl;Function('"use strict";'+i)(),this._iosCache&&this._iosCache.set(e,i,r.headers),this.succeeded=!0,this._successCallback()}catch(a){if(clearTimeout(this._networkTimeout),a instanceof Wl||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(e,": ").concat(a),type:a.message})}}),function(e){return t.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=ir(function*(e,t){if(t.ok)return yield t.text();if(this._iosCache&&304===t.status)return(yield this._iosCache.renew(e,t.headers)).code;throw new Error("Received ".concat(t.status," response"))}),function(t,n){return e.apply(this,arguments)})}]);var e,t,n,r}(),Ql=Kn(function e(t,n,r){Jn(this,e),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=t,this._successCallback=n,this._failureCallback=r,this._attemptId=Mr(),this._networkTimeout=null,this._scriptElement=null},[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=Or(this._dailyConfig);"object"===("undefined"==typeof document?"undefined":Qn(document))?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var t=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){t._stopLoading(),t._failureCallback({msg:"Timed out (>".concat(ql," ms) when loading call object bundle ").concat(e),type:"timeout"})},ql);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){t._stopLoading(),t.succeeded=!0,t._successCallback()},r.onerror=function(e){t._stopLoading(),t._failureCallback({msg:"Failed to load call object bundle ".concat(e.target.src),type:e.message})},r.src=e,n.appendChild(r)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}]),Gl=function(e,t,n){return!0===Xl(e.local,t,n)},Yl=function(e,t,n){return e.local.streams&&e.local.streams[t]&&e.local.streams[t].stream&&e.local.streams[t].stream["get".concat("video"===n?"Video":"Audio","Tracks")]()[0]},Kl=function(e,t,n,r){var i=Zl(e,t,n,r);return i&&i.pendingTrack},Xl=function(e,t,n){if(!e)return!1;var r=function(e){switch(e){case"avatar":return!0;case"staged":return e;default:return!!e}},i=e.public.subscribedTracks;return i&&i[t]?-1===["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)&&i[t].custom?[!0,"staged"].includes(i[t].custom)?r(i[t].custom):r(i[t].custom[n]):r(i[t][n]):!i||r(i.ALL)},Zl=function(e,t,n,r){var i=Object.values(e.streams||{}).filter(function(e){return e.participantId===t&&e.type===n&&e.pendingTrack&&e.pendingTrack.kind===r}).sort(function(e,t){return new Date(t.starttime)-new Date(e.starttime)});return i&&i[0]},ec=function(e,t){var n=e.local.public.customTracks;if(n&&n[t])return n[t].track};function tc(e,t){for(var n=t.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var a=i[r],o=0,s=["video","audio"];o<s.length;o++){var l=s[o],c="cam"===a?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),u=e.tracks[c];if(u){var d=e.local?Yl(n,a,l):Kl(n,e.session_id,a,l);"playable"===u.state&&(u.track=d),u.persistentTrack=d}}}function nc(e,t){try{var n=t.getState();for(var r in e.tracks)if(!rc(r)){var i=e.tracks[r].kind;if(i){var a=e.tracks[r];if(a){var o=e.local?ec(n,r):Kl(n,e.session_id,r,i);"playable"===a.state&&(e.tracks[r].track=o),a.persistentTrack=o}}else console.error("unknown type for custom track")}}catch(s){console.error(s)}}function rc(e){return["video","audio","screenVideo","screenAudio"].includes(e)}function ic(e,t,n){var r=n.getState();if(e.local){if(e.audio)try{e.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],e.audioTrack||(e.audio=!1)}catch(u){}if(e.video)try{e.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],e.videoTrack||(e.video=!1)}catch(u){}if(e.screen)try{e.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],e.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(u){}}else{var i=!0;try{var a=r.participants[e.session_id];a&&a.public&&a.public.rtcType&&"peer-to-peer"===a.public.rtcType.impl&&a.private&&!["connected","completed"].includes(a.private.peeringState)&&(i=!1)}catch(u){console.error(u)}if(!i)return e.audio=!1,e.audioTrack=!1,e.video=!1,e.videoTrack=!1,e.screen=!1,void(e.screenTrack=!1);try{if(r.streams,e.audio&&Gl(r,e.session_id,"cam-audio")){var o=Kl(r,e.session_id,"cam","audio");o&&(t&&t.audioTrack&&t.audioTrack.id===o.id?e.audioTrack=o:o.muted||(e.audioTrack=o)),e.audioTrack||(e.audio=!1)}if(e.video&&Gl(r,e.session_id,"cam-video")){var s=Kl(r,e.session_id,"cam","video");s&&(t&&t.videoTrack&&t.videoTrack.id===s.id?e.videoTrack=s:s.muted||(e.videoTrack=s)),e.videoTrack||(e.video=!1)}if(e.screen&&Gl(r,e.session_id,"screen-audio")){var l=Kl(r,e.session_id,"screen","audio");l&&(t&&t.screenAudioTrack&&t.screenAudioTrack.id===l.id?e.screenAudioTrack=l:l.muted||(e.screenAudioTrack=l))}if(e.screen&&Gl(r,e.session_id,"screen-video")){var c=Kl(r,e.session_id,"screen","video");c&&(t&&t.screenVideoTrack&&t.screenVideoTrack.id===c.id?e.screenVideoTrack=c:c.muted||(e.screenVideoTrack=c))}e.screenVideoTrack||e.screenAudioTrack||(e.screen=!1)}catch(u){console.error("unexpected error matching up tracks",u)}}}function ac(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var oc=new Map,sc=null;function lc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var cc=new Map,uc=null;function dc(e){var t;fc()?(t=e,oc.has(t)||(oc.set(t,{}),navigator.mediaDevices.enumerateDevices().then(function(e){var n;oc.has(t)&&(oc.get(t).lastDevicesString=JSON.stringify(e),sc||(n=ir(function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ac(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ac(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(oc.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==oc.get(r).lastDevicesString&&(oc.get(r).lastDevicesString=i,r(t))}}catch(a){n.e(a)}finally{n.f()}}),sc=function(){return n.apply(this,arguments)},navigator.mediaDevices.addEventListener("devicechange",sc)))}).catch(function(){}))):function(e){cc.has(e)||(cc.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(t){cc.has(e)&&(cc.get(e).lastDevicesString=JSON.stringify(t),uc||(uc=setInterval(ir(function*(){var e,t=yield navigator.mediaDevices.enumerateDevices(),n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return lc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lc(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(cc.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=JSON.stringify(t);i!==cc.get(r).lastDevicesString&&(cc.get(r).lastDevicesString=i,r(t))}}catch(a){n.e(a)}finally{n.f()}}),3e3)))}))}(e)}function fc(){var e;return cl()||void 0!==(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.ondevicechange)}var pc=new Set;function hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(n),!0).forEach(function(t){nr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gc=Object.freeze({VIDEO:"video",AUDIO:"audio",SCREEN_VIDEO:"screenVideo",SCREEN_AUDIO:"screenAudio",CUSTOM_VIDEO:"customVideo",CUSTOM_AUDIO:"customAudio"}),vc=Object.freeze({PARTICIPANTS:"participants",STREAMING:"streaming",TRANSCRIPTION:"transcription"}),yc=Object.values(gc),bc=["v","a","sv","sa","cv","ca"];Object.freeze(yc.reduce(function(e,t,n){return e[t]=bc[n],e},{})),Object.freeze(bc.reduce(function(e,t,n){return e[t]=yc[n],e},{}));var wc=[gc.VIDEO,gc.AUDIO,gc.SCREEN_VIDEO,gc.SCREEN_AUDIO],kc=Object.values(vc),Sc=["p","s","t"];Object.freeze(kc.reduce(function(e,t,n){return e[t]=Sc[n],e},{})),Object.freeze(Sc.reduce(function(e,t,n){return e[t]=kc[n],e},{}));var _c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.base,r=t.byUserId,i=t.byParticipantId;Jn(this,e),this.base=n,this.byUserId=r,this.byParticipantId=i}return Kn(e,[{key:"clone",value:function(){var t=new e;if(this.base instanceof xc?t.base=this.base.clone():t.base=this.base,void 0!==this.byUserId)for(var n in t.byUserId={},this.byUserId){var r=this.byUserId[n];t.byUserId[n]=r instanceof xc?r.clone():r}if(void 0!==this.byParticipantId)for(var i in t.byParticipantId={},this.byParticipantId){var a=this.byParticipantId[i];t.byParticipantId[i]=a instanceof xc?a.clone():a}return t}},{key:"toJSONObject",value:function(){var e={};if("boolean"==typeof this.base?e.base=this.base:this.base instanceof xc&&(e.base=this.base.toJSONObject()),void 0!==this.byUserId)for(var t in e.byUserId={},this.byUserId){var n=this.byUserId[t];e.byUserId[t]=n instanceof xc?n.toJSONObject():n}if(void 0!==this.byParticipantId)for(var r in e.byParticipantId={},this.byParticipantId){var i=this.byParticipantId[r];e.byParticipantId[r]=i instanceof xc?i.toJSONObject():i}return e}},{key:"toMinifiedJSONObject",value:function(){var e={};if(void 0!==this.base&&("boolean"==typeof this.base?e.b=this.base:e.b=this.base.toMinifiedJSONObject()),void 0!==this.byUserId)for(var t in e.u={},this.byUserId){var n=this.byUserId[t];e.u[t]="boolean"==typeof n?n:n.toMinifiedJSONObject()}if(void 0!==this.byParticipantId)for(var r in e.p={},this.byParticipantId){var i=this.byParticipantId[r];e.p[r]="boolean"==typeof i?i:i.toMinifiedJSONObject()}return e}},{key:"normalize",value:function(){return this.base instanceof xc&&(this.base=this.base.normalize()),this.byUserId&&(this.byUserId=Object.fromEntries(Object.entries(this.byUserId).map(function(e){var t=or(e,2),n=t[0],r=t[1];return[n,r instanceof xc?r.normalize():r]}))),this.byParticipantId&&(this.byParticipantId=Object.fromEntries(Object.entries(this.byParticipantId).map(function(e){var t=or(e,2),n=t[0],r=t[1];return[n,r instanceof xc?r.normalize():r]}))),this}}],[{key:"fromJSONObject",value:function(t){var n,r,i;if(void 0!==t.base&&(n="boolean"==typeof t.base?t.base:xc.fromJSONObject(t.base)),void 0!==t.byUserId)for(var a in r={},t.byUserId){var o=t.byUserId[a];r[a]="boolean"==typeof o?o:xc.fromJSONObject(o)}if(void 0!==t.byParticipantId)for(var s in i={},t.byParticipantId){var l=t.byParticipantId[s];i[s]="boolean"==typeof l?l:xc.fromJSONObject(l)}return new e({base:n,byUserId:r,byParticipantId:i})}},{key:"fromMinifiedJSONObject",value:function(t){var n,r,i;if(void 0!==t.b&&(n="boolean"==typeof t.b?t.b:xc.fromMinifiedJSONObject(t.b)),void 0!==t.u)for(var a in r={},t.u){var o=t.u[a];r[a]="boolean"==typeof o?o:xc.fromMinifiedJSONObject(o)}if(void 0!==t.p)for(var s in i={},t.p){var l=t.p[s];i[s]="boolean"==typeof l?l:xc.fromMinifiedJSONObject(l)}return new e({base:n,byUserId:r,byParticipantId:i})}},{key:"validateJSONObject",value:function(e){if("object"!==Qn(e))return[!1,"canReceive must be an object"];for(var t=["base","byUserId","byParticipantId"],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!t.includes(i))return[!1,"canReceive can only contain keys (".concat(t.join(", "),")")];if("base"===i){var a=or(xc.validateJSONObject(e.base,!0),2),o=a[0],s=a[1];if(!o)return[!1,s]}else{if("object"!==Qn(e[i]))return[!1,"invalid (non-object) value for field '".concat(i,"' in canReceive")];for(var l=0,c=Object.values(e[i]);l<c.length;l++){var u=c[l],d=or(xc.validateJSONObject(u),2),f=d[0],p=d[1];if(!f)return[!1,p]}}}return[!0]}}])}(),xc=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.video,r=t.audio,i=t.screenVideo,a=t.screenAudio,o=t.customVideo,s=t.customAudio;Jn(this,e),this.video=n,this.audio=r,this.screenVideo=i,this.screenAudio=a,this.customVideo=o,this.customAudio=s}return Kn(e,[{key:"clone",value:function(){var t=new e;return void 0!==this.video&&(t.video=this.video),void 0!==this.audio&&(t.audio=this.audio),void 0!==this.screenVideo&&(t.screenVideo=this.screenVideo),void 0!==this.screenAudio&&(t.screenAudio=this.screenAudio),void 0!==this.customVideo&&(t.customVideo=mc({},this.customVideo)),void 0!==this.customAudio&&(t.customAudio=mc({},this.customAudio)),t}},{key:"toJSONObject",value:function(){var e={};return void 0!==this.video&&(e.video=this.video),void 0!==this.audio&&(e.audio=this.audio),void 0!==this.screenVideo&&(e.screenVideo=this.screenVideo),void 0!==this.screenAudio&&(e.screenAudio=this.screenAudio),void 0!==this.customVideo&&(e.customVideo=mc({},this.customVideo)),void 0!==this.customAudio&&(e.customAudio=mc({},this.customAudio)),e}},{key:"toMinifiedJSONObject",value:function(){var e={};return void 0!==this.video&&(e.v=this.video),void 0!==this.audio&&(e.a=this.audio),void 0!==this.screenVideo&&(e.sv=this.screenVideo),void 0!==this.screenAudio&&(e.sa=this.screenAudio),void 0!==this.customVideo&&(e.cv=mc({},this.customVideo)),void 0!==this.customAudio&&(e.ca=mc({},this.customAudio)),e}},{key:"normalize",value:function(){function e(e,t){return e&&1===Object.keys(e).length&&e["*"]===t}return!(!0!==this.video||!0!==this.audio||!0!==this.screenVideo||!0!==this.screenAudio||!e(this.customVideo,!0)||!e(this.customAudio,!0))||(!1!==this.video||!1!==this.audio||!1!==this.screenVideo||!1!==this.screenAudio||!e(this.customVideo,!1)||!e(this.customAudio,!1))&&this}}],[{key:"fromBoolean",value:function(t){return new e({video:t,audio:t,screenVideo:t,screenAudio:t,customVideo:{"*":t},customAudio:{"*":t}})}},{key:"fromJSONObject",value:function(t){return new e({video:t.video,audio:t.audio,screenVideo:t.screenVideo,screenAudio:t.screenAudio,customVideo:void 0!==t.customVideo?mc({},t.customVideo):void 0,customAudio:void 0!==t.customAudio?mc({},t.customAudio):void 0})}},{key:"fromMinifiedJSONObject",value:function(t){return new e({video:t.v,audio:t.a,screenVideo:t.sv,screenAudio:t.sa,customVideo:t.cv,customAudio:t.ca})}},{key:"validateJSONObject",value:function(e,t){if("boolean"==typeof e)return[!0];if("object"!==Qn(e))return[!1,"invalid (non-object, non-boolean) value in canReceive"];for(var n=Object.keys(e),r=0,i=n;r<i.length;r++){var a=i[r];if(!yc.includes(a))return[!1,"invalid media type '".concat(a,"' in canReceive")];if(wc.includes(a)){if("boolean"!=typeof e[a])return[!1,"invalid (non-boolean) value for media type '".concat(a,"' in canReceive")]}else{if("object"!==Qn(e[a]))return[!1,"invalid (non-object) value for media type '".concat(a,"' in canReceive")];for(var o=0,s=Object.values(e[a]);o<s.length;o++)if("boolean"!=typeof s[o])return[!1,"invalid (non-boolean) value for entry within '".concat(a,"' in canReceive")];if(t&&void 0===e[a]["*"])return[!1,'canReceive "base" permission must specify "*" as an entry within \''.concat(a,"'")]}}return t&&n.length!==yc.length?[!1,'canReceive "base" permission must specify all media types: '.concat(yc.join(", ")," (or be set to a boolean shorthand)")]:[!0]}}])}(),Ec=["result"],Cc=["preserveIframe"];function Tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tc(Object(n),!0).forEach(function(t){nr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pc=function(){return!!e})()}function Ac(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Oc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oc(e,t):void 0}}(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Oc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Nc={},Lc="video",jc="voice",Ic=cl()?{data:{}}:{data:{},topology:"none"},Rc={present:0,hidden:0},Fc={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Dc=Object.keys(Fc),Bc=["state","volume","simulcastEncodings"],zc={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},Uc={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string",visualState:"'default' | 'sidebar-open' | 'active'"}},Vc={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},$c={customIntegrations:{validate:hu,help:fu()},customTrayButtons:{validate:pu,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(Uc))},url:{validate:function(e){return"string"==typeof e},help:"url should be a string"},baseUrl:{validate:function(e){return"string"==typeof e},help:"baseUrl should be a string"},token:{validate:function(e){return"string"==typeof e},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(e,t){try{return t.validateDailyConfig(e),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(e){return mu(e,zc)},help:"reactNativeConfig should look like ".concat(JSON.stringify(zc),", all fields optional")},lang:{validate:function(e){return["da","de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(e)},help:"language not supported. Options are: da, de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(e){try{return ru(e),!0}catch(t){return console.error(t),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,allowLocalVideo:!0,allowLocalAudio:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(e,t){if("boolean"==typeof e)return t._preloadCache.allowLocalVideo=e,!0;var n;if(e instanceof MediaStreamTrack)t._sharedTracks.videoTrack=e,n={customTrack:nl};else{if(delete t._sharedTracks.videoTrack,"string"!=typeof e)return console.error("videoSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:e}}return t._updatePreloadCacheInputSettings({video:{settings:n}},!1),!0}},audioSource:{validate:function(e,t){if("boolean"==typeof e)return t._preloadCache.allowLocalAudio=e,!0;var n;if(e instanceof MediaStreamTrack)t._sharedTracks.audioTrack=e,n={customTrack:nl};else{if(delete t._sharedTracks.audioTrack,"string"!=typeof e)return console.error("audioSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:e}}return t._updatePreloadCacheInputSettings({audio:{settings:n}},!1),!0}},subscribeToTracksAutomatically:{validate:function(e,t){return t._preloadCache.subscribeToTracksAutomatically=e,!0}},theme:{validate:function(e){var t=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!t.includes(i))return console.error('unsupported color "'.concat(i,'". Valid colors: ').concat(t.join(", "))),!1;if(!e[i].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(i,' theme color should be provided in valid hex color format. Received: "').concat(e[i],'"')),!1}return!0};return"object"===Qn(e)&&("light"in e&&"dark"in e||"colors"in e)?"light"in e&&"dark"in e?"colors"in e.light?"colors"in e.dark?n(e.light.colors)&&n(e.dark.colors):(console.error('Dark theme is missing "colors" property.',e),!1):(console.error('Light theme is missing "colors" property.',e),!1):n(e.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',e),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(e){if("grid"in e){var t=e.grid;if("maxTilesPerPage"in t){if(!Number.isInteger(t.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(t.maxTilesPerPage,".")),!1;if(t.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in 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(e){return iu(e,{allowAllParticipantsKey:!1})},help:du({allowAllParticipantsKey:!1})},sendSettings:{validate:function(e,t){return!!function(e,t){try{return t.validateUpdateSendSettings(e),!0}catch(n){return console.error("Failed to validate send settings",n),!1}}(e,t)&&(t._preloadCache.sendSettings=e,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(e,t){var n;return!!au(e)&&(t._inputSettings||(t._inputSettings={}),ou(e,null===(n=t.properties)||void 0===n?void 0:n.dailyConfig,t._sharedTracks),t._updatePreloadCacheInputSettings(e,!0),!0)},help:uu()},layout:{validate:function(e){return"custom-v1"===e||"browser"===e||"none"===e},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},Wc={styles:{validate:function(e){for(var t in e)if("cam"!==t&&"screen"!==t)return!1;if(e.cam)for(var n in e.cam)if("div"!==n&&"video"!==n)return!1;if(e.screen)for(var r in e.screen)if("div"!==r&&"video"!==r)return!1;return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(e,t){if(t._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(e)||!cl()&&"avatar"===e)return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"],i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var a in e)if("custom"===a){if(!n.includes(e[a])&&!i(e[a],!0))return!1}else{var o=!t&&!r.includes(a),s=!n.includes(e[a]);if(o||s)return!1}return!0};return i(e)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(cl()?"":" | '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(e){return!1===e},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=or(n[t],2),i=r[0],a=r[1];switch(i){case"hasPresence":if("boolean"!=typeof a)return!1;break;case"canSend":if(a instanceof Set||a instanceof Array||Array.isArray(a)){var o,s=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=Ac(a);try{for(l.s();!(o=l.n()).done;){var c=o.value;if(!s.includes(c))return!1}}catch(v){l.e(v)}finally{l.f()}}else if("boolean"!=typeof a)return!1;(a instanceof Array||Array.isArray(a))&&(e.canSend=new Set(a));break;case"canReceive":var u=or(_c.validateJSONObject(a),2),d=u[0],f=u[1];if(!d)return console.error(f),!1;break;case"canAdmin":if(a instanceof Set||a instanceof Array||Array.isArray(a)){var p,h=["participants","streaming","transcription"],m=Ac(a);try{for(m.s();!(p=m.n()).done;){var g=p.value;if(!h.includes(g))return!1}}catch(v){m.e(v)}finally{m.f()}}else if("boolean"!=typeof a)return!1;(a instanceof Array||Array.isArray(a))&&(e.canAdmin=new Set(a));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, canReceive, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canReceive must be an object specifying base, byUserId, and/or byParticipantId fields (see documentation for more details). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var e=ir(function*(e){return new Promise(function(t,n){var r=[];e.forEach(function(i){return Promise.resolve(i).then(function(e){t(e)}).catch(function(t){r.push(t),r.length===e.length&&n(r)})})})});return function(t){return e.apply(this,arguments)}}());var qc=function(){function e(t){var n,r,i,a,o,s,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Jn(this,e),i=this,a=Zn(a=e),nr(r=Xn(i,Pc()?Reflect.construct(a,[],Zn(i).constructor):a.apply(i,undefined)),"startListeningForDeviceChanges",function(){dc(r.handleDeviceChange)}),nr(r,"stopListeningForDeviceChanges",function(){!function(e){var t;fc()?(t=e,oc.has(t)&&(oc.delete(t),0===oc.size&&sc&&(navigator.mediaDevices.removeEventListener("devicechange",sc),sc=null))):function(e){cc.has(e)&&(cc.delete(e),0===cc.size&&uc&&(clearInterval(uc),uc=null))}(e)}(r.handleDeviceChange)}),nr(r,"handleDeviceChange",function(e){e=e.map(function(e){return JSON.parse(JSON.stringify(e))}),r.emitDailyJSEvent({action:"available-devices-updated",availableDevices:e})}),nr(r,"handleNativeAppStateChange",(s=ir(function*(e){if("destroyed"===e)return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield r.destroy());var t="active"===e;r.disableReactNativeAutoDeviceManagement("video")||(t?r.camUnmutedBeforeLosingNativeActiveState&&r.setLocalVideo(!0):(r.camUnmutedBeforeLosingNativeActiveState=r.localVideo(),r.camUnmutedBeforeLosingNativeActiveState&&r.setLocalVideo(!1)))}),function(e){return s.apply(this,arguments)})),nr(r,"handleNativeAudioFocusChange",function(e){r.disableReactNativeAutoDeviceManagement("audio")||(r._hasNativeAudioFocus=e,r.toggleParticipantAudioBasedOnNativeAudioFocus(),r._hasNativeAudioFocus?r.micUnmutedBeforeLosingNativeAudioFocus&&r.setLocalAudio(!0):(r.micUnmutedBeforeLosingNativeAudioFocus=r.localAudio(),r.setLocalAudio(!1)))}),nr(r,"handleNativeSystemScreenCaptureStop",function(){r.stopScreenShare()}),!gl()&&!cl())throw new Error("WebRTC not supported or suppressed");if(r.strictMode=void 0===l.strictMode||l.strictMode,r.allowMultipleCallInstances=null!==(n=l.allowMultipleCallInstances)&&void 0!==n&&n,Object.keys(Nc).length&&(r._logDuplicateInstanceAttempt(),!r.allowMultipleCallInstances)){if(r.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:{}}),r.callClientId=Mr(),Nc[(o=r).callClientId]=o,window._daily.instances[r.callClientId]={},r._sharedTracks={},window._daily.instances[r.callClientId].tracks=r._sharedTracks,l.dailyJsVersion=e.version(),r._iframe=t,r._callObjectMode="none"===l.layout&&!r._iframe,r._preloadCache={subscribeToTracksAutomatically:!0,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},void 0!==l.showLocalVideo?r._callObjectMode?console.error("showLocalVideo is not available in call object mode"):r._showLocalVideo=!!l.showLocalVideo:r._showLocalVideo=!0,void 0!==l.showParticipantsBar?r._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):r._showParticipantsBar=!!l.showParticipantsBar:r._showParticipantsBar=!0,void 0!==l.customIntegrations?r._callObjectMode?console.error("customIntegrations is not available in call object mode"):r._customIntegrations=l.customIntegrations:r._customIntegrations={},void 0!==l.customTrayButtons?r._callObjectMode?console.error("customTrayButtons is not available in call object mode"):r._customTrayButtons=l.customTrayButtons:r._customTrayButtons={},void 0!==l.activeSpeakerMode?r._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):r._activeSpeakerMode=!!l.activeSpeakerMode:r._activeSpeakerMode=!1,l.receiveSettings?r._callObjectMode?r._receiveSettings=l.receiveSettings:console.error("receiveSettings is only available in call object mode"):r._receiveSettings={},r.validateProperties(l),r.properties=Mc({},l),r._inputSettings||(r._inputSettings={}),r._callObjectLoader=r._callObjectMode?new Vl(r.callClientId):null,r._callState=Os,r._isPreparingToJoin=!1,r._accessState={access:Ds},r._meetingSessionSummary={},r._finalSummaryOfPrevSession={},r._meetingSessionState=bu(Ic,r._callObjectMode),r._nativeInCallAudioMode=Lc,r._participants={},r._isScreenSharing=!1,r._participantCounts=Rc,r._rmpPlayerState={},r._waitingParticipants={},r._network={threshold:"good",quality:100,networkState:"unknown",stats:{}},r._activeSpeaker={},r._localAudioLevel=0,r._isLocalAudioLevelObserverRunning=!1,r._remoteParticipantsAudioLevel={},r._isRemoteParticipantsAudioLevelObserverRunning=!1,r._maxAppMessageSize=Ys,r._messageChannel=cl()?new Ll:new Al,r._iframe&&(r._iframe.requestFullscreen?r._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===r._iframe?(r.emitDailyJSEvent({action:qs}),r.sendMessageToCallMachine({action:qs})):(r.emitDailyJSEvent({action:Hs}),r.sendMessageToCallMachine({action:Hs}))}):r._iframe.webkitRequestFullscreen&&r._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===r._iframe?(r.emitDailyJSEvent({action:qs}),r.sendMessageToCallMachine({action:qs})):(r.emitDailyJSEvent({action:Hs}),r.sendMessageToCallMachine({action:Hs}))})),cl()){var c=r.nativeUtils();c.addAudioFocusChangeListener&&c.removeAudioFocusChangeListener&&c.addAppStateChangeListener&&c.removeAppStateChangeListener&&c.addSystemScreenCaptureStopListener&&c.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),r._hasNativeAudioFocus=!0,c.addAudioFocusChangeListener(r.handleNativeAudioFocusChange),c.addAppStateChangeListener(r.handleNativeAppStateChange),c.addSystemScreenCaptureStopListener(r.handleNativeSystemScreenCaptureStop)}return r._callObjectMode&&r.startListeningForDeviceChanges(),r._messageChannel.addListenerForMessagesFromCallMachine(r.handleMessageFromCallMachine,r.callClientId,r),r}return tr(e,dr),Kn(e,[{key:"destroy",value:(z=ir(function*(){var e;try{yield this.leave()}catch(i){}var t=this._iframe;if(t){var n=t.parentElement;n&&n.removeChild(t)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),cl()){var r=this.nativeUtils();r.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),r.removeAppStateChangeListener(this.handleNativeAppStateChange),r.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Nc[this.callClientId],(null===(e=window)||void 0===e||null===(e=e._daily)||void 0===e?void 0:e.instances)&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return z.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(e){var t=e.bodyClass,n=e.cssFile,r=e.cssText;return tu(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(n),bodyClass:t,cssText:r}),this}},{key:"iframe",value:function(){return tu(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return Zc(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return Zc(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(e,t){for(var n in t){if(!Wc[n])throw new Error("unrecognized updateParticipant property ".concat(n));if(Wc[n].validate&&!Wc[n].validate(t[n],this,this._participants[e]))throw new Error(Wc[n].help)}}},{key:"updateParticipant",value:function(e,t){return this._participants.local&&this._participants.local.session_id===e&&(e="local"),e&&t&&(this.validateParticipantProperties(e,t),this.sendMessageToCallMachine({action:"update-participant",id:e,properties:t})),this}},{key:"updateParticipants",value:function(e){var t=this._participants.local&&this._participants.local.session_id;for(var n in e)n===t&&(n="local"),n&&e[n]&&this.validateParticipantProperties(n,e[n]);return this.sendMessageToCallMachine({action:"update-participants",participants:e}),this}},{key:"updateWaitingParticipant",value:(B=ir(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Zc(this._callObjectMode,"updateWaitingParticipant()"),Qc(this._callState,"updateWaitingParticipant()"),"string"!=typeof t||"object"!==Qn(n))throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(r,i){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:t,updates:n},function(e){e.error&&i(e.error),e.id||i(new Error("unknown error in updateWaitingParticipant()")),r({id:e.id})})})}),function(){return B.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(D=ir(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Zc(this._callObjectMode,"updateWaitingParticipants()"),Qc(this._callState,"updateWaitingParticipants()"),"object"!==Qn(t))throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(n,r){e.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:t},function(e){e.error&&r(e.error),e.ids||r(new Error("unknown error in updateWaitingParticipants()")),n({ids:e.ids})})})}),function(){return D.apply(this,arguments)})},{key:"requestAccess",value:(F=ir(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.access,r=void 0===n?{level:"full"}:n,i=t.name,a=void 0===i?"":i;return Zc(this._callObjectMode,"requestAccess()"),Qc(this._callState,"requestAccess()"),new Promise(function(t,n){e.sendMessageToCallMachine({action:"daily-method-request-access",access:r,name:a},function(e){e.error&&n(e.error),e.access||n(new Error("unknown error in requestAccess()")),t({access:e.access,granted:e.granted})})})}),function(){return F.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(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"forceDiscardTrack"in t&&(cl()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),t={}):e&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),t={})),this.sendMessageToCallMachine({action:"local-audio",state:e,options:t}),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(e){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:e}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(e){return this.sendMessageToCallMachine({action:"local-video",state:e}),this}},{key:"_setAllowLocalAudio",value:function(e){if(this._preloadCache.allowLocalAudio=e,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-audio",state:e}),this}},{key:"_setAllowLocalVideo",value:function(e){if(this._preloadCache.allowLocalVideo=e,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-video",state:e}),this}},{key:"getReceiveSettings",value:(R=ir(function*(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).showInheritedValues,r=void 0!==n&&n;if(Zc(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(Qn(e)){case"string":return new Promise(function(n){t.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:e,showInheritedValues:r},function(e){n(e.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(e){return R.apply(this,arguments)})},{key:"updateReceiveSettings",value:(I=ir(function*(e){var t=this;if(Zc(this._callObjectMode,"updateReceiveSettings()"),!iu(e,{allowAllParticipantsKey:!0}))throw new Error(du({allowAllParticipantsKey:!0}));return Qc(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(n){t.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:e},function(e){n({receiveSettings:e.receiveSettings})})})}),function(e){return I.apply(this,arguments)})},{key:"_prepInputSettingsForSharing",value:function(e,t){if(e){var n={};if(e.audio){var r,i,a;e.audio.settings&&(!Object.keys(e.audio.settings).length&&t||(n.audio={settings:Mc({},e.audio.settings)})),t&&null!==(r=n.audio)&&void 0!==r&&null!==(r=r.settings)&&void 0!==r&&r.customTrack&&(n.audio.settings={customTrack:this._sharedTracks.audioTrack});var o="none"===(null===(i=e.audio.processor)||void 0===i?void 0:i.type)&&(null===(a=e.audio.processor)||void 0===a?void 0:a._isDefaultWhenNone);if(e.audio.processor&&!o){var s=Mc({},e.audio.processor);delete s._isDefaultWhenNone,n.audio=Mc(Mc({},n.audio),{},{processor:s})}}if(e.video){var l,c,u;e.video.settings&&(!Object.keys(e.video.settings).length&&t||(n.video={settings:Mc({},e.video.settings)})),t&&null!==(l=n.video)&&void 0!==l&&null!==(l=l.settings)&&void 0!==l&&l.customTrack&&(n.video.settings={customTrack:this._sharedTracks.videoTrack});var d="none"===(null===(c=e.video.processor)||void 0===c?void 0:c.type)&&(null===(u=e.video.processor)||void 0===u?void 0:u._isDefaultWhenNone);if(e.video.processor&&!d){var f=Mc({},e.video.processor);delete f._isDefaultWhenNone,n.video=Mc(Mc({},n.video),{},{processor:f})}}return n}}},{key:"getInputSettings",value:function(){var e=this;return tu(),new Promise(function(t){t(e._getInputSettings())})}},{key:"_getInputSettings",value:function(){var e,t,n,r,i,a,o={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(e=(null===(n=this._inputSettings)||void 0===n?void 0:n.video)||o,t=(null===(r=this._inputSettings)||void 0===r?void 0:r.audio)||o):(e=(null===(i=this._preloadCache)||void 0===i||null===(i=i.inputSettings)||void 0===i?void 0:i.video)||o,t=(null===(a=this._preloadCache)||void 0===a||null===(a=a.inputSettings)||void 0===a?void 0:a.audio)||o);var s={audio:t,video:e};return this._prepInputSettingsForSharing(s,!0)}},{key:"_updatePreloadCacheInputSettings",value:function(e,t){var n,r,i,a,o,s,l=this._inputSettings||{},c={};e.video?(c.video={},e.video.settings?(c.video.settings={},t||e.video.settings.customTrack||null===(i=l.video)||void 0===i||!i.settings?c.video.settings=e.video.settings:c.video.settings=Mc(Mc({},l.video.settings),e.video.settings),Object.keys(c.video.settings).length||delete c.video.settings):null!==(n=l.video)&&void 0!==n&&n.settings&&(c.video.settings=l.video.settings),e.video.processor?c.video.processor=e.video.processor:null!==(r=l.video)&&void 0!==r&&r.processor&&(c.video.processor=l.video.processor)):l.video&&(c.video=l.video);e.audio?(c.audio={},e.audio.settings?(c.audio.settings={},t||e.audio.settings.customTrack||null===(s=l.audio)||void 0===s||!s.settings?c.audio.settings=e.audio.settings:c.audio.settings=Mc(Mc({},l.audio.settings),e.audio.settings),Object.keys(c.audio.settings).length||delete c.audio.settings):null!==(a=l.audio)&&void 0!==a&&a.settings&&(c.audio.settings=l.audio.settings),e.audio.processor?c.audio.processor=e.audio.processor:null!==(o=l.audio)&&void 0!==o&&o.processor&&(c.audio.processor=l.audio.processor)):l.audio&&(c.audio=l.audio);this._maybeUpdateInputSettings(c)}},{key:"_devicesFromInputSettings",value:function(e){var t,n,r=(null==e||null===(t=e.video)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.deviceId)||null,i=(null==e||null===(n=e.audio)||void 0===n||null===(n=n.settings)||void 0===n?void 0:n.deviceId)||null,a=this._preloadCache.outputDeviceId||null;return{camera:r?{deviceId:r}:{},mic:i?{deviceId:i}:{},speaker:a?{deviceId:a}:{}}}},{key:"updateInputSettings",value:(j=ir(function*(e){var t=this;return tu(),au(e)?e.video||e.audio?(ou(e,this.properties.dailyConfig,this._sharedTracks),this._callObjectMode&&!this._callMachineInitialized?(this._updatePreloadCacheInputSettings(e,!0),this._getInputSettings()):new Promise(function(n,r){t.sendMessageToCallMachine({action:"update-input-settings",inputSettings:e},function(i){if(i.error)r(i.error);else{if(i.returnPreloadCache)return t._updatePreloadCacheInputSettings(e,!0),void n(t._getInputSettings());t._maybeUpdateInputSettings(i.inputSettings),n(t._prepInputSettingsForSharing(i.inputSettings,!0))}})})):this._getInputSettings():(console.error(uu()),Promise.reject(uu()))}),function(e){return j.apply(this,arguments)})},{key:"setBandwidth",value:function(e){var t=e.kbs,n=e.trackConstraints;if(tu(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:t,trackConstraints:n}),this}},{key:"getDailyLang",value:function(){var e=this;if(tu(),this._callMachineInitialized)return new Promise(function(t){e.sendMessageToCallMachine({action:"get-daily-lang"},function(e){delete e.action,delete e.callbackStamp,t(e)})})}},{key:"setDailyLang",value:function(e){return tu(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:e}),this}},{key:"setProxyUrl",value:function(e){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:e}),this}},{key:"setIceConfig",value:function(e){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:e}),this}},{key:"meetingSessionSummary",value:function(){return[Rs,Fs].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(L=ir(function*(){var e=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),Qc(this._callState,"getMeetingSession()"),new Promise(function(t){e.sendMessageToCallMachine({action:"get-meeting-session"},function(e){delete e.action,delete e.callbackStamp,t(e)})})}),function(){return L.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return Qc(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"replace";Zc(this._callObjectMode,"setMeetingSessionData()"),Qc(this._callState,"setMeetingSessionData");try{new Fl({data:t=e,mergeStrategy:n})}catch(t){throw console.error(t),t}try{this.sendMessageToCallMachine({action:"set-session-data",data:e,mergeStrategy:n})}catch(t){throw new Error("Error setting meeting session data: ".concat(t))}}},{key:"setUserName",value:function(e,t){var n=this;return this.properties.userName=e,new Promise(function(r){n.sendMessageToCallMachine({action:"set-user-name",name:null!=e?e:"",thisMeetingOnly:cl()||!!t&&!!t.thisMeetingOnly},function(e){delete e.action,delete e.callbackStamp,r(e)})})}},{key:"setUserData",value:(N=ir(function*(e){var t=this;try{ru(e)}catch(n){throw console.error(n),n}if(this.properties.userData=e,this._callMachineInitialized)return new Promise(function(r){try{t.sendMessageToCallMachine({action:"set-user-data",userData:e},function(e){delete e.action,delete e.callbackStamp,r(e)})}catch(n){throw new Error("Error setting user data: ".concat(n))}})}),function(e){return N.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(e){if(e&&(e<100||"number"!=typeof e))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(e){var t=this;if("undefined"==typeof AudioWorkletNode&&!cl())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(e),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(n,r){t.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:e},function(e){t._isLocalAudioLevelObserverRunning=!e.error,e.error?r({error:e.error}):n()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:e}}},{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(e){var t=this;if(this.validateAudioLevelInterval(e),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(n,r){t.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:e},function(e){t._isRemoteParticipantsAudioLevelObserverRunning=!e.error,e.error?r({error:e.error}):n()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:e}}},{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:(O=ir(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Zc(this._callObjectMode,"startCamera()"),Yc(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(t)}catch(n){return Promise.reject(n)}else{if(this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(t),this.properties=Mc(Mc({},this.properties),t)}return new Promise(function(t){e._preloadCache.inputSettings=e._prepInputSettingsForSharing(e._inputSettings,!1),e.sendMessageToCallMachine({action:"start-camera",properties:Jc(e.properties,e.callClientId),preloadCache:Jc(e._preloadCache,e.callClientId)},function(e){t({camera:e.camera,mic:e.mic,speaker:e.speaker})})})}),function(){return O.apply(this,arguments)})},{key:"validateCustomTrack",value:function(e,t,n){if(n&&n.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(t&&"music"!==t&&"speech"!==t&&!(t instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(n&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(n))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(!(e instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{track:track,mode:mode,trackName:trackName,ignoreAudioLevel:ignoreAudioLevel};return tu(),Qc(this._callState,"startCustomTrack()"),this.validateCustomTrack(t.track,t.mode,t.trackName),new Promise(function(n,r){e._sharedTracks.customTrack=t.track,t.track=nl,e.sendMessageToCallMachine({action:"start-custom-track",properties:t},function(e){e.error?r({error:e.error}):n(e.mediaTag)})})}},{key:"stopCustomTrack",value:function(e){var t=this;return tu(),Qc(this._callState,"stopCustomTrack()"),new Promise(function(n){t.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:e},function(e){n(e.mediaTag)})})}},{key:"setCamera",value:function(e){var t=this;return nu(),Kc(this._callMachineInitialized,"setCamera()"),new Promise(function(n){t.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:e},function(e){n({device:e.device})})})}},{key:"setAudioDevice",value:(A=ir(function*(e){return nu(),this.nativeUtils().setAudioDevice(e),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(e){return A.apply(this,arguments)})},{key:"cycleCamera",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(n){e.sendMessageToCallMachine({action:"cycle-camera",properties:t},function(e){n({device:e.device})})})}},{key:"cycleMic",value:function(){var e=this;return tu(),new Promise(function(t){e.sendMessageToCallMachine({action:"cycle-mic"},function(e){t({device:e.device})})})}},{key:"getCameraFacingMode",value:function(){var e=this;return nu(),new Promise(function(t){e.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(e){t(e.facingMode)})})}},{key:"setInputDevicesAsync",value:(P=ir(function*(e){var t=this,n=e.audioDeviceId,r=e.videoDeviceId,i=e.audioSource,a=e.videoSource;if(tu(),void 0!==i&&(n=i),void 0!==a&&(r=a),"boolean"==typeof n&&(this._setAllowLocalAudio(n),n=void 0),"boolean"==typeof r&&(this._setAllowLocalVideo(r),r=void 0),!n&&!r)return yield this.getInputDevices();var o={};return n&&(n instanceof MediaStreamTrack?(this._sharedTracks.audioTrack=n,n=nl,o.audio={settings:{customTrack:n}}):(delete this._sharedTracks.audioTrack,o.audio={settings:{deviceId:n}})),r&&(r instanceof MediaStreamTrack?(this._sharedTracks.videoTrack=r,r=nl,o.video={settings:{customTrack:r}}):(delete this._sharedTracks.videoTrack,o.video={settings:{deviceId:r}})),this._callObjectMode&&this.needsLoad()?(this._updatePreloadCacheInputSettings(o,!1),this._devicesFromInputSettings(this._inputSettings)):new Promise(function(e){t.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:n,videoDeviceId:r},function(n){if(delete n.action,delete n.callbackStamp,n.returnPreloadCache)return t._updatePreloadCacheInputSettings(o,!1),void e(t._devicesFromInputSettings(t._inputSettings));e(n)})})}),function(e){return P.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(M=ir(function*(e){var t=this,n=e.outputDeviceId;if(tu(),!n||"string"!=typeof n)throw new Error("outputDeviceId must be provided and must be a valid device id");return this._preloadCache.outputDeviceId=n,this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(e,r){t.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:n},function(n){if(delete n.action,delete n.callbackStamp,n.error){var i=new Error(n.error.message);return i.type=n.error.type,void r(i)}n.returnPreloadCache?e(t._devicesFromInputSettings(t._inputSettings)):e(n)})})}),function(e){return M.apply(this,arguments)})},{key:"getInputDevices",value:(T=ir(function*(){var e=this;return this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(t){e.sendMessageToCallMachine({action:"get-input-devices"},function(n){n.returnPreloadCache?t(e._devicesFromInputSettings(e._inputSettings)):t({camera:n.camera,mic:n.mic,speaker:n.speaker})})})}),function(){return T.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return nu(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(e){if(nu(),[Lc,jc].includes(e)){if(e!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=e,!this.disableReactNativeAutoDeviceManagement("audio")&&Gc(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",e)}},{key:"preAuth",value:(C=ir(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Zc(this._callObjectMode,"preAuth()"),Yc(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(t)),!t.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(t),this.properties=Mc(Mc({},this.properties),t),new Promise(function(t,n){e._preloadCache.inputSettings=e._prepInputSettingsForSharing(e._inputSettings,!1),e.sendMessageToCallMachine({action:"daily-method-preauth",properties:Jc(e.properties,e.callClientId),preloadCache:Jc(e._preloadCache,e.callClientId)},function(r){return r.error?n(r.error):r.access?(e._didPreAuth=!0,void t({access:r.access})):n(new Error("unknown error in preAuth()"))})})}),function(){return C.apply(this,arguments)})},{key:"load",value:(E=ir(function*(e){var t=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(e&&(this.validateProperties(e),this.properties=Mc(Mc({},this.properties),e)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(Ns),this.emitDailyJSEvent({action:"loading"}),this._callObjectMode?new Promise(function(e,n){t._callObjectLoader.cancel();var r=Date.now();t._callObjectLoader.load(t.properties.dailyConfig,function(n){t._bundleLoadTime=n?"no-op":Date.now()-r,t._updateCallState(Ls),n&&t.emitDailyJSEvent({action:Vs}),e()},function(e,r){if(t.emitDailyJSEvent({action:"load-attempt-failed"}),!r){t._updateCallState(Fs),t.resetMeetingDependentVars();var i={action:Gs,errorMsg:e.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:e,bundleUrl:Or(t.properties.dailyConfig)}}};t._maybeSendToSentry(i),t.emitDailyJSEvent(i),n(e.msg)}})}):(this._iframe.src=Ar(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(e,n){t._loadedCallback=function(r){t._callState!==Fs?(t._updateCallState(Ls),(t.properties.cssFile||t.properties.cssText)&&t.loadCss(t.properties),e()):n(r)}}))}}),function(e){return E.apply(this,arguments)})},{key:"join",value:(x=ir(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var n=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(t)}catch(r){return this.updateIsPreparingToJoin(!1),Promise.reject(r)}}else{if(n=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(t.token&&t.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(t.url&&!this._callObjectMode&&t.url&&t.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(t.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(t),this.properties=Mc(Mc({},this.properties),t)}return void 0!==t.showLocalVideo&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!t.showLocalVideo),void 0!==t.showParticipantsBar&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!t.showParticipantsBar),this._callState===Is||this._callState===js?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(js,!1),this.emitDailyJSEvent({action:"joining-meeting"}),this._preloadCache.inputSettings=this._prepInputSettingsForSharing(this._inputSettings||{},!1),this.sendMessageToCallMachine({action:"join-meeting",properties:Jc(this.properties,this.callClientId),preloadCache:Jc(this._preloadCache,this.callClientId)}),new Promise(function(t,r){e._joinedCallback=function(i,a){if(e._callState!==Fs){if(e._updateCallState(Is),i)for(var o in i){if(e._callObjectMode){var s=e._callMachine().store;tc(i[o],s),nc(i[o],s),ic(i[o],e._participants[o],s)}e._participants[o]=Mc({},i[o]),e.toggleParticipantAudioBasedOnNativeAudioFocus()}n&&e.loadCss(e.properties),t(i)}else r(a)}}))}),function(){return x.apply(this,arguments)})},{key:"leave",value:(_=ir(function*(){var e=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(t){e._callState===Rs||e._callState===Fs?t():e._callObjectLoader&&!e._callObjectLoader.loaded?(e._callObjectLoader.cancel(),e._updateCallState(Rs),e.resetMeetingDependentVars(),e.emitDailyJSEvent({action:Rs}),t()):(e._resolveLeave=t,e.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return _.apply(this,arguments)})},{key:"startScreenShare",value:(S=ir(function*(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Kc(this._callMachineInitialized,"startScreenShare()"),t.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",t.screenVideoSendSettings),t.mediaStream&&(this._sharedTracks.screenMediaStream=t.mediaStream,t.mediaStream=nl),"undefined"!=typeof DailyNativeUtils&&void 0!==DailyNativeUtils.isIOS&&DailyNativeUtils.isIOS){var n=this.nativeUtils();if(yield n.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Qs,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});n.setSystemScreenCaptureStartCallback(function(){n.setSystemScreenCaptureStartCallback(null),e.sendMessageToCallMachine({action:Zs,captureOptions:t})}),n.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Zs,captureOptions:t})}),function(){return S.apply(this,arguments)})},{key:"stopScreenShare",value:function(){Kc(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type;if(t&&"cloud"!==t&&"raw-tracks"!==t&&"local"!==t)throw new Error("invalid type: ".concat(t,", allowed values 'cloud', 'raw-tracks', or 'local'"));this.sendMessageToCallMachine(Mc({action:"local-recording-start"},e))}},{key:"updateRecording",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:n,instanceId:r})}},{key:"stopRecording",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Mc({action:"local-recording-stop"},e))}},{key:"startLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Mc({action:"daily-method-start-live-streaming"},e))}},{key:"updateLiveStreaming",value:function(e){var t=e.layout,n=void 0===t?{preset:"default"}:t,r=e.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:n,instanceId:r})}},{key:"addLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:el,endpointsOp:"add-endpoints",endpoints:t,instanceId:n})}},{key:"removeLiveStreamingEndpoints",value:function(e){var t=e.endpoints,n=e.instanceId;this.sendMessageToCallMachine({action:el,endpointsOp:"remove-endpoints",endpoints:t,instanceId:n})}},{key:"stopLiveStreaming",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendMessageToCallMachine(Mc({action:"daily-method-stop-live-streaming"},e))}},{key:"validateDailyConfig",value:function(e){e.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(e.camSimulcastEncodings)),e.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),vl()&&e.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(!(e instanceof Array||Array.isArray(e)))throw new Error("encodings must be an Array");if(!yu(e.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var r=0;r<e.length;r++){var i=e[r];for(var a in this._validateEncodingLayerHasValidProperties(i),i)if(Dc.includes(a)){if("number"!=typeof i[a])throw new Error("".concat(a," must be a number"));if(t){var o=t[a],s=o.min,l=o.max;if(!yu(i[a],s,l))throw new Error("".concat(a," value not in range. valid range: ").concat(s," to ").concat(l))}}else if(!["active","scalabilityMode"].includes(a))throw new Error("Invalid key ".concat(a,", valid keys are:")+Object.values(Dc));if(n&&!i.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(k=ir(function*(e){var t=this,n=e.url,r=e.settings,i=void 0===r?{state:al.PLAY}:r;try{!function(e){if("string"!=typeof e)throw new Error('url parameter must be "string" type')}(n),vu(i),function(e){for(var t in e)if(!Bc.includes(t))throw new Error("Invalid key ".concat(t,", valid keys are: ").concat(Bc));e.simulcastEncodings&&this.validateSimulcastEncodings(e.simulcastEncodings,Fc,!0)}(i)}catch(a){throw console.error("invalid argument Error: ".concat(a)),console.error('startRemoteMediaPlayer arguments must be of the form:\n { url: "playback url",\n settings?:\n {state: "play"|"pause", simulcastEncodings?: [{}] } }'),a}return new Promise(function(e,r){t.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:n,settings:i},function(t){t.error?r({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})})})}),function(e){return k.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(w=ir(function*(e){var t=this;if("string"!=typeof e)throw new Error(" remotePlayerID must be of type string");return new Promise(function(n,r){t.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:e},function(e){e.error?r({error:e.error,errorMsg:e.errorMsg}):n()})})}),function(e){return w.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(b=ir(function*(e){var t=this,n=e.session_id,r=e.settings;try{vu(r)}catch(i){throw console.error("invalid argument Error: ".concat(i)),console.error('updateRemoteMediaPlayer arguments must be of the form:\n session_id: "participant session",\n { settings?: {state: "play"|"pause"} }'),i}return new Promise(function(e,i){t.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:n,settings:r},function(t){t.error?i({error:t.error,errorMsg:t.errorMsg}):e({session_id:t.session_id,remoteMediaPlayerState:{state:t.state,settings:t.settings}})})})}),function(e){return b.apply(this,arguments)})},{key:"startTranscription",value:function(e){Qc(this._callState,"startTranscription()"),this.sendMessageToCallMachine(Mc({action:"daily-method-start-transcription"},e))}},{key:"updateTranscription",value:function(e){if(Qc(this._callState,"updateTranscription()"),!e)throw new Error("updateTranscription Error: options is mandatory");if("object"!==Qn(e))throw new Error("updateTranscription Error: options must be object type");if(e.participants&&!Array.isArray(e.participants))throw new Error("updateTranscription Error: participants must be an array");this.sendMessageToCallMachine(Mc({action:"daily-method-update-transcription"},e))}},{key:"stopTranscription",value:function(e){if(Qc(this._callState,"stopTranscription()"),e&&"object"!==Qn(e))throw new Error("stopTranscription Error: options must be object type");if(e&&!e.instanceId)throw new Error('"instanceId" not provided');this.sendMessageToCallMachine(Mc({action:"daily-method-stop-transcription"},e))}},{key:"startDialOut",value:(y=ir(function*(e){var t=this;Qc(this._callState,"startDialOut()");var n=function(e){if(e){if(!Array.isArray(e))throw new Error("Error starting dial out: audio codec must be an array");if(e.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");e.forEach(function(e){if("string"!=typeof e)throw new Error("Error starting dial out: audio codec must be a string");if("OPUS"!==e&&"PCMU"!==e&&"PCMA"!==e&&"G722"!==e)throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!e.sipUri&&!e.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(e.sipUri&&e.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(e.sipUri){if("string"!=typeof e.sipUri)throw new Error("Error starting dial out: sipUri must be a string");if(!e.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(e.video&&"boolean"!=typeof e.video)throw new Error("Error starting dial out: video must be a boolean value");!function(e){if(e&&(n(e.audio),e.video)){if(!Array.isArray(e.video))throw new Error("Error starting dial out: video codec must be an array");if(e.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");e.video.forEach(function(e){if("string"!=typeof e)throw new Error("Error starting dial out: video codec must be a string");if("H264"!==e&&"VP8"!==e)throw new Error("Error starting dial out: video codec must be H264 or VP8")})}}(e.codecs)}if(e.phoneNumber){if("string"!=typeof e.phoneNumber)throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(e.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");e.codecs&&n(e.codecs.audio)}if(e.callerId){if("string"!=typeof e.callerId)throw new Error("Error starting dial out: callerId must be a string");if(e.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(e.displayName){if("string"!=typeof e.displayName)throw new Error("Error starting dial out: displayName must be a string");if(e.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}if(e.userId){if("string"!=typeof e.userId)throw new Error("Error starting dial out: userId must be a string");if(e.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}if(Hc(e),e.permissions&&e.permissions.canReceive){var r=or(_c.validateJSONObject(e.permissions.canReceive),2),i=r[0],a=r[1];if(!i)throw new Error(a)}return new Promise(function(n,r){t.sendMessageToCallMachine(Mc({action:"dialout-start"},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return y.apply(this,arguments)})},{key:"stopDialOut",value:function(e){var t=this;return Qc(this._callState,"stopDialOut()"),new Promise(function(n,r){t.sendMessageToCallMachine(Mc({action:"dialout-stop"},e),function(e){e.error?r(e.error):n(e)})})}},{key:"sipCallTransfer",value:(v=ir(function*(e){var t=this;if(Qc(this._callState,"sipCallTransfer()"),!e)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return e.useSipRefer=!1,gu(e,"sipCallTransfer"),Hc(e),new Promise(function(n,r){t.sendMessageToCallMachine(Mc({action:sl},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return v.apply(this,arguments)})},{key:"sipRefer",value:(g=ir(function*(e){var t=this;if(Qc(this._callState,"sipRefer()"),!e)throw new Error("sessionId and toEndPoint are mandatory parameter");return e.useSipRefer=!0,gu(e,"sipRefer"),new Promise(function(n,r){t.sendMessageToCallMachine(Mc({action:sl},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return g.apply(this,arguments)})},{key:"sendDTMF",value:(m=ir(function*(e){var t=this;return Qc(this._callState,"sendDTMF()"),function(e){var t=e.sessionId,n=e.tones;if(!t||!n)throw new Error("sessionId and tones are mandatory parameter");if("string"!=typeof t||"string"!=typeof n)throw new Error("sessionId and tones should be of string type");if(n.length>20)throw new Error("tones string must be upto 20 characters");var r=n.match(/[^0-9A-D*#]/g);if(r&&r[0])throw new Error("".concat(r[0]," is not valid DTMF tone"))}(e),new Promise(function(n,r){t.sendMessageToCallMachine(Mc({action:"send-dtmf"},e),function(e){e.error?r(e.error):n(e)})})}),function(e){return m.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var e=this;return this._callState!==Is?Promise.resolve(Mc({stats:{latest:{}}},this._network)):new Promise(function(t){e.sendMessageToCallMachine({action:"get-calc-stats"},function(n){t(Mc(Mc({},e._network),{},{stats:n.stats}))})})}},{key:"testWebsocketConnectivity",value:(h=ir(function*(){var e=this;if(Xc(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(t){return Promise.reject(t)}return new Promise(function(t,n){e.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(e){e.error?n(e.error):t(e.results)})})}),function(){return h.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(e){return e?e instanceof MediaStreamTrack?!!function(e){return e&&"live"===e.readyState&&!((t=e).muted&&!pc.has(t.id));var t}(e)||(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:(p=ir(function*(){var e=this;tu(),Zc(this._callObjectMode,"testCallQuality()"),Kc(this._callMachineInitialized,"testCallQuality()",null,!0),Yc(this._callState,this._isPreparingToJoin,"testCallQuality()");var t=this._testCallAlreadyInProgress,n=function(n){t||(e._testCallInProgress=n)};if(n(!0),this.needsLoad())try{var r=this._callState;yield this.load(),this._callState=r}catch(lr){return n(!1),Promise.reject(lr)}return new Promise(function(t){e.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:e.properties.dailyJsVersion},function(r){var i=r.results,a=i.result,o=Hn(i,Ec);if("failed"===a){var s,l=Mc({},o);null!==(s=o.error)&&void 0!==s&&s.details?(o.error.details=JSON.parse(o.error.details),l.error=Mc(Mc({},l.error),{},{details:Mc({},l.error.details)}),l.error.details.duringTest="testCallQuality"):(l.error=l.error?Mc({},l.error):{},l.error.details={duringTest:"testCallQuality"}),e._maybeSendToSentry(l)}n(!1),t(Mc({result:a},o))})})}),function(){return p.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(f=ir(function*(e){var t;cl()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),t=yield this.testPeerToPeerCallQuality(e)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),t=yield this.testCallQuality());var n={result:t.result,secondsElapsed:t.secondsElapsed};return t.data&&(n.data={maxRTT:t.data.maxRoundTripTime,packetLoss:t.data.avgRecvPacketLoss}),n}),function(e){return f.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(d=ir(function*(e){var t=this;if(Xc(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(i){return Promise.reject(i)}var n=e.videoTrack,r=e.duration;if(!this._validateVideoTrackForNetworkTests(n))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=n,new Promise(function(e,n){t.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:r},function(t){t.error?n(t.error):e(t.results)})})}),function(e){return d.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){cl()?(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:(u=ir(function*(e){var t=this;if(Xc(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(n){return Promise.reject(n)}if(!this._validateVideoTrackForNetworkTests(e))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=e,new Promise(function(e,n){t.sendMessageToCallMachine({action:"test-network-connectivity"},function(t){t.error?n(t.error):e(t.results)})})}),function(e){return u.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var e=this;return new Promise(function(t){e._callState===Is?e.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(e){t(e.cpuStats)}):t({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(e){var t;if(!((null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Dc))}},{key:"_validateVideoSendSettings",value:function(e,t){var n="screenVideo"===e?["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"],r="Video send settings should be either an object or one of the supported presets: ".concat(n.join());if("string"==typeof t){if(!n.includes(t))throw new Error(r)}else{if("object"!==Qn(t))throw new Error(r);if(!t.maxQuality&&!t.encodings&&void 0===t.allowAdaptiveLayers)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(t.maxQuality&&-1===["low","medium","high"].indexOf(t.maxQuality))throw new Error("maxQuality must be either low, medium or high");if(t.encodings){var i=!1;switch(Object.keys(t.encodings).length){case 1:i=!t.encodings.low;break;case 2:i=!t.encodings.low||!t.encodings.medium;break;case 3:i=!t.encodings.low||!t.encodings.medium||!t.encodings.high;break;default:i=!0}if(i)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");t.encodings.low&&this._validateEncodingLayerHasValidProperties(t.encodings.low),t.encodings.medium&&this._validateEncodingLayerHasValidProperties(t.encodings.medium),t.encodings.high&&this._validateEncodingLayerHasValidProperties(t.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(e){var t=this;if(!e||0===Object.keys(e).length)throw new Error("Send settings must contain at least information for one track!");Object.entries(e).forEach(function(e){var n=or(e,2),r=n[0],i=n[1];t._validateVideoSendSettings(r,i)})}},{key:"updateSendSettings",value:function(e){var t=this;return this.validateUpdateSendSettings(e),this.needsLoad()?(this._preloadCache.sendSettings=e,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(n,r){t.sendMessageToCallMachine({action:"update-send-settings",sendSettings:e},function(e){e.error?r(e.error):n(e.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 tu(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(e){return tu(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:e}),this}},{key:"activeSpeakerMode",value:function(){return tu(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(e){return Qc(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=e,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:e}),this}},{key:"enumerateDevices",value:(s=ir(function*(){var e=this;if(this._callObjectMode){var t=yield navigator.mediaDevices.enumerateDevices();return"Firefox"===bl()&&wl().major>115&&wl().major<123&&(t=t.filter(function(e){return"audiooutput"!==e.kind})),{devices:t.map(function(e){var t=JSON.parse(JSON.stringify(e));if(!cl()&&"videoinput"===e.kind&&e.getCapabilities){var n,r=e.getCapabilities();t.facing=(null==r||null===(n=r.facingMode)||void 0===n?void 0:n.length)>=1?r.facingMode[0]:void 0}return t})}}return new Promise(function(t){e.sendMessageToCallMachine({action:"enumerate-devices"},function(e){t({devices:e.devices})})})}),function(){return s.apply(this,arguments)})},{key:"sendAppMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*";if(Qc(this._callState,"sendAppMessage()"),JSON.stringify(e).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:e,to:t}),this}},{key:"addFakeParticipant",value:function(e){return tu(),Qc(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(Mc({action:"add-fake-participant"},e)),this}},{key:"setShowNamesMode",value:function(e){return eu(this._callObjectMode,"setShowNamesMode()"),tu(),e&&"always"!==e&&"never"!==e?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:e}),this)}},{key:"setShowLocalVideo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return eu(this._callObjectMode,"setShowLocalVideo()"),tu(),Qc(this._callState,"setShowLocalVideo()"),"boolean"!=typeof e?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:e}),this._showLocalVideo=e,this)}},{key:"showLocalVideo",value:function(){return eu(this._callObjectMode,"showLocalVideo()"),tu(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return eu(this._callObjectMode,"setShowParticipantsBar()"),tu(),Qc(this._callState,"setShowParticipantsBar()"),"boolean"!=typeof e?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:e}),this._showParticipantsBar=e,this)}},{key:"showParticipantsBar",value:function(){return eu(this._callObjectMode,"showParticipantsBar()"),tu(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return tu(),eu(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(e){return tu(),eu(this._callObjectMode,"setCustomIntegrations()"),Qc(this._callState,"setCustomIntegrations()"),hu(e)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:e}),this._customIntegrations=e,this):this}},{key:"startCustomIntegrations",value:function(e){var t=this;if(tu(),eu(this._callObjectMode,"startCustomIntegrations()"),Qc(this._callState,"startCustomIntegrations()"),Array.isArray(e)&&e.some(function(e){return"string"!=typeof e})||!Array.isArray(e)&&"string"!=typeof e)return console.error("startCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter(function(e){return!(e in t._customIntegrations)});return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:n}),this)}},{key:"stopCustomIntegrations",value:function(e){var t=this;if(tu(),eu(this._callObjectMode,"stopCustomIntegrations()"),Qc(this._callState,"stopCustomIntegrations()"),Array.isArray(e)&&e.some(function(e){return"string"!=typeof e})||!Array.isArray(e)&&"string"!=typeof e)return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var n="string"==typeof e?[e]:e,r=n.filter(function(e){return!(e in t._customIntegrations)});return r.length?(console.error("Can't find custom integration(s): \"".concat(r.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:n}),this)}},{key:"customTrayButtons",value:function(){return eu(this._callObjectMode,"customTrayButtons()"),tu(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(e){return eu(this._callObjectMode,"updateCustomTrayButtons()"),tu(),Qc(this._callState,"updateCustomTrayButtons()"),pu(e)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:e}),this._customTrayButtons=e,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(Uc))),this)}},{key:"theme",value:function(){return eu(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(e){var t=this;return eu(this._callObjectMode,"setTheme()"),new Promise(function(n,r){try{t.validateProperties({theme:e}),t.properties.theme=Mc({},e),t.sendMessageToCallMachine({action:"set-theme",theme:t.properties.theme});try{t.emitDailyJSEvent({action:"theme-updated",theme:t.properties.theme})}catch(i){console.log("could not emit 'theme-updated'",i)}n(t.properties.theme)}catch(i){r(i)}})}},{key:"requestFullscreen",value:(o=ir(function*(){if(tu(),this._iframe&&!document.fullscreenElement&&dl())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(lr){console.log("could not make video call fullscreen",lr)}}),function(){return o.apply(this,arguments)})},{key:"exitFullscreen",value:function(){tu(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(a=ir(function*(){var e=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(t){e.sendMessageToCallMachine({action:"get-sidebar-view"},function(e){t(e.view)})})}),function(){return a.apply(this,arguments)})},{key:"setSidebarView",value:function(e){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:e}),this)}},{key:"room",value:(i=ir(function*(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeRoomConfigDefaults,n=void 0===t||t;return this._accessState.access===Ds||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(t){e.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:n},function(e){delete e.action,delete e.callbackStamp,t(e)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=ir(function*(){try{var e=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield e.json()).geo}}catch(t){return console.error("geo lookup failed",t),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=ir(function*(e){var t=this;return tu(),Qc(this._callState,"setNetworkTopology()"),new Promise(function(n,r){t.sendMessageToCallMachine({action:"set-network-topology",opts:e},function(e){e.error?r({error:e.error}):n({workerId:e.workerId})})})}),function(e){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(t=ir(function*(){var e=this;return new Promise(function(t,n){e.needsLoad()&&t({topology:"none"}),e.sendMessageToCallMachine({action:"get-network-topology"},function(e){e.error?n({error:e.error}):t({topology:e.topology})})})}),function(){return t.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(e){if(tu(),"number"!=typeof e&&!0!==e&&!1!==e)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(e));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:e})}},{key:"on",value:function(e,t){return dr.prototype.on.call(this,e,t)}},{key:"once",value:function(e,t){return dr.prototype.once.call(this,e,t)}},{key:"off",value:function(e,t){return dr.prototype.off.call(this,e,t)}},{key:"validateProperties",value:function(e){var t,n;if(null!=e&&null!==(t=e.dailyConfig)&&void 0!==t&&t.userMediaAudioConstraints){var r,i;cl()||console.warn("userMediaAudioConstraints is deprecated. You can override constraints with inputSettings.audio.settings, found in DailyCallOptions.");var a=e.inputSettings||{};a.audio=(null===(r=e.inputSettings)||void 0===r?void 0:r.audio)||{},a.audio.settings=(null===(i=e.inputSettings)||void 0===i||null===(i=i.audio)||void 0===i?void 0:i.settings)||{},a.audio.settings=Mc(Mc({},a.audio.settings),e.dailyConfig.userMediaAudioConstraints),e.inputSettings=a,delete e.dailyConfig.userMediaAudioConstraints}if(null!=e&&null!==(n=e.dailyConfig)&&void 0!==n&&n.userMediaVideoConstraints){var o,s;cl()||console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");var l=e.inputSettings||{};l.video=(null===(o=e.inputSettings)||void 0===o?void 0:o.video)||{},l.video.settings=(null===(s=e.inputSettings)||void 0===s||null===(s=s.video)||void 0===s?void 0:s.settings)||{},l.video.settings=Mc(Mc({},l.video.settings),e.dailyConfig.userMediaVideoConstraints),e.inputSettings=l,delete e.dailyConfig.userMediaVideoConstraints}for(var c in e)if($c[c]){if($c[c].validate&&!$c[c].validate(e[c],this))throw new Error("property '".concat(c,"': ").concat($c[c].help))}else console.warn("Ignoring unrecognized property '".concat(c,"'")),delete e[c]}},{key:"assembleMeetingUrl",value:function(){var e,t,n=Mc(Mc({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:null!==(e=this.properties.dailyConfig)&&void 0!==e&&e.proxyUrl?encodeURIComponent(null===(t=this.properties.dailyConfig)||void 0===t?void 0:t.proxyUrl):void 0}),r=n.url.match(/\?/)?"&":"?";return n.url+r+Object.keys($c).filter(function(e){return $c[e].queryString&&void 0!==n[e]}).map(function(e){return"".concat($c[e].queryString,"=").concat(n[e])}).join("&")}},{key:"needsLoad",value:function(){return[Os,Ns,Rs,Fs].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(e,t){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(e,t,this.callClientId,this._iframe)}},{key:"forwardPackagedMessageToCallMachine",value:function(e){this._messageChannel.forwardPackagedMessageToCallMachine(e,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(e,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(e)}},{key:"handleMessageFromCallMachine",value:function(e){switch(e.action){case"iframe-ready-for-launch-config":this.sendMessageToCallMachine(Mc({action:"iframe-launch-config"},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var t={action:tl,level:"log",code:1011,stats:{event:"bundle load",time:"no-op"===this._bundleLoadTime?0:this._bundleLoadTime,preLoaded:"no-op"===this._bundleLoadTime,url:Or(this.properties.dailyConfig)}};this.sendMessageToCallMachine(t),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case Vs:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(e);break;case"joined-meeting":var n,r=Mc({},e);delete r.internal,this._maxAppMessageSize=(null===(n=e.internal)||void 0===n?void 0:n._maxAppMessageSize)||Ys,this._joinedCallback&&(this._joinedCallback(e.participants),this._joinedCallback=null),this.emitDailyJSEvent(r);break;case"participant-joined":case"participant-updated":if(this._callState===Rs)return;if(e.participant&&e.participant.session_id){var i=e.participant.local?"local":e.participant.session_id;if(this._callObjectMode){var a=this._callMachine().store;tc(e.participant,a),nc(e.participant,a),ic(e.participant,this._participants[i],a)}try{this.maybeParticipantTracksStopped(this._participants[i],e.participant),this.maybeParticipantTracksStarted(this._participants[i],e.participant),this.maybeEventRecordingStopped(this._participants[i],e.participant),this.maybeEventRecordingStarted(this._participants[i],e.participant)}catch(lr){console.error("track events error",lr)}this.compareEqualForParticipantUpdateEvent(e.participant,this._participants[i])||(this._participants[i]=Mc({},e.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(e))}break;case"participant-left":if(e.participant&&e.participant.session_id){var o=this._participants[e.participant.session_id];o&&this.maybeParticipantTracksStopped(o,null),delete this._participants[e.participant.session_id],this.emitDailyJSEvent(e)}break;case"participant-counts-updated":hr(this._participantCounts,e.participantCounts)||(this._participantCounts=e.participantCounts,this.emitDailyJSEvent(e));break;case"access-state-updated":var s={access:e.access};e.awaitingAccess&&(s.awaitingAccess=e.awaitingAccess),hr(this._accessState,s)||(this._accessState=s,this.emitDailyJSEvent(e));break;case"meeting-session-summary-updated":if(e.meetingSession){this._meetingSessionSummary=e.meetingSession,this.emitDailyJSEvent(e);var l=Mc(Mc({},e),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(l)}break;case Gs:var c;this._iframe&&!e.preserveIframe&&(this._iframe.src=""),this._updateCallState(Fs),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(e.errorMsg),this._loadedCallback=null),e.preserveIframe;var u=Hn(e,Cc);null!=u&&null!==(c=u.error)&&void 0!==c&&c.details&&(u.error.details=JSON.parse(u.error.details)),this._maybeSendToSentry(e),this._joinedCallback&&(this._joinedCallback(null,u),this._joinedCallback=null),this.emitDailyJSEvent(u);break;case"left-meeting":this._callState!==Fs&&this._updateCallState(Rs),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(e);break;case"selected-devices-updated":e.devices&&this.emitDailyJSEvent(e);break;case"network-quality-change":var d=e.state,f=e.threshold,p=e.quality,h=d.state,m=d.reasons;h===this._network.networkState&&hr(m,this._network.networkStateReasons)&&f===this._network.threshold&&p===this._network.quality||(this._network.networkState=h,this._network.networkStateReasons=m,this._network.quality=p,this._network.threshold=f,e.networkState=h,m.length&&(e.networkStateReasons=m),delete e.state,this.emitDailyJSEvent(e));break;case"cpu-load-change":e&&e.cpuLoadState&&this.emitDailyJSEvent(e);break;case"face-counts-updated":e&&void 0!==e.faceCounts&&this.emitDailyJSEvent(e);break;case"active-speaker-change":var g=e.activeSpeaker;this._activeSpeaker.peerId!==g.peerId&&(this._activeSpeaker.peerId=g.peerId,this.emitDailyJSEvent({action:e.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var v=e.show;this._showLocalVideo=v,this.emitDailyJSEvent({action:e.action,show:v});break;case"active-speaker-mode-change":var y=e.enabled;this._activeSpeakerMode!==y&&(this._activeSpeakerMode=y,this.emitDailyJSEvent({action:e.action,enabled:this._activeSpeakerMode}));break;case"waiting-participant-added":case"waiting-participant-updated":case"waiting-participant-removed":this._waitingParticipants=e.allWaitingParticipants,this.emitDailyJSEvent({action:e.action,participant:e.participant});break;case"receive-settings-updated":hr(this._receiveSettings,e.receiveSettings)||(this._receiveSettings=e.receiveSettings,this.emitDailyJSEvent({action:e.action,receiveSettings:e.receiveSettings}));break;case Js:this._maybeUpdateInputSettings(e.inputSettings);break;case"send-settings-updated":hr(this._sendSettings,e.sendSettings)||(this._sendSettings=e.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:e.action,sendSettings:e.sendSettings}));break;case"local-audio-level":this._localAudioLevel=e.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(e);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=e.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(e);break;case"remote-media-player-started":var b=e.session_id;this._rmpPlayerState[b]=e.playerState,this.emitDailyJSEvent(e);break;case"remote-media-player-stopped":delete this._rmpPlayerState[e.session_id],this.emitDailyJSEvent(e);break;case"remote-media-player-updated":var w=e.session_id,k=this._rmpPlayerState[w];k&&this.compareEqualForRMPUpdateEvent(k,e.remoteMediaPlayerState)||(this._rmpPlayerState[w]=e.remoteMediaPlayerState,this.emitDailyJSEvent(e));break;case"custom-button-click":case"sidebar-view-changed":case"pip-started":case"pip-stopped":this.emitDailyJSEvent(e);break;case"meeting-session-state-updated":var S=this._meetingSessionState.topology!==(e.meetingSessionState&&e.meetingSessionState.topology);this._meetingSessionState=bu(e.meetingSessionState,this._callObjectMode),(this._callObjectMode||S)&&this.emitDailyJSEvent(e);break;case"local-screen-share-started":this._isScreenSharing=!0,this.emitDailyJSEvent(e);break;case"local-screen-share-stopped":case"local-screen-share-canceled":this._isScreenSharing=!1,this.emitDailyJSEvent(e);break;case $s:case Ws:case"recording-stats":case"recording-error":case"recording-upload-completed":case"transcription-started":case"transcription-stopped":case"transcription-error":case"started-camera":case"camera-error":case"app-message":case"transcription-message":case"test-completed":case"network-connection":case"recording-data":case"live-streaming-started":case"live-streaming-updated":case"live-streaming-stopped":case"live-streaming-error":case Qs:case"lang-updated":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(e);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(e,t){var n="record";e&&(t.local||!1!==t[n]||e[n]===t[n]||this.emitDailyJSEvent({action:Ws}))}},{key:"maybeEventRecordingStarted",value:function(e,t){var n="record";e&&(t.local||!0!==t[n]||e[n]===t[n]||this.emitDailyJSEvent({action:$s}))}},{key:"_trackStatePlayable",value:function(e){return!(!e||"playable"!==e.state)}},{key:"_trackChanged",value:function(e,t){return!((null==e?void 0:e.id)===(null==t?void 0:t.id))}},{key:"maybeEventTrackStopped",value:function(e,t,n){var r,i,a=null!==(r=null==t?void 0:t.tracks[e])&&void 0!==r?r:null,o=null!==(i=null==n?void 0:n.tracks[e])&&void 0!==i?i:null,s=null==a?void 0:a.track;if(s){var l=this._trackStatePlayable(a),c=this._trackStatePlayable(o),u=this._trackChanged(s,null==o?void 0:o.track);l&&(c&&!u||this.emitDailyJSEvent({action:"track-stopped",track:s,participant:null!=n?n:t,type:e}))}}},{key:"maybeEventTrackStarted",value:function(e,t,n){var r,i,a=null!==(r=null==t?void 0:t.tracks[e])&&void 0!==r?r:null,o=null!==(i=null==n?void 0:n.tracks[e])&&void 0!==i?i:null,s=null==o?void 0:o.track;if(s){var l=this._trackStatePlayable(a),c=this._trackStatePlayable(o),u=this._trackChanged(null==a?void 0:a.track,s);c&&(l&&!u||this.emitDailyJSEvent({action:"track-started",track:s,participant:n,type:e}))}}},{key:"maybeParticipantTracksStopped",value:function(e,t){if(e)for(var n in e.tracks)this.maybeEventTrackStopped(n,e,t)}},{key:"maybeParticipantTracksStarted",value:function(e,t){if(t)for(var n in t.tracks)this.maybeEventTrackStarted(n,e,t)}},{key:"compareEqualForRMPUpdateEvent",value:function(e,t){var n,r;return e.state===t.state&&(null===(n=e.settings)||void 0===n?void 0:n.volume)===(null===(r=t.settings)||void 0===r?void 0:r.volume)}},{key:"emitDailyJSEvent",value:function(e){try{e.callClientId=this.callClientId,this.emit(e.action,e)}catch(t){console.log("could not emit",e,t)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(e,t){return!(!hr(e,t)||e.videoTrack&&t.videoTrack&&(e.videoTrack.id!==t.videoTrack.id||e.videoTrack.muted!==t.videoTrack.muted||e.videoTrack.enabled!==t.videoTrack.enabled)||e.audioTrack&&t.audioTrack&&(e.audioTrack.id!==t.audioTrack.id||e.audioTrack.muted!==t.audioTrack.muted||e.audioTrack.enabled!==t.audioTrack.enabled))}},{key:"nativeUtils",value:function(){return cl()?"undefined"==typeof DailyNativeUtils?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(e){this._updateCallState(this._callState,e)}},{key:"_updateCallState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._isPreparingToJoin;if(e!==this._callState||t!==this._isPreparingToJoin){var n=this._callState,r=this._isPreparingToJoin;this._callState=e,this._isPreparingToJoin=t;var i=this._callState===Is;this.updateShowAndroidOngoingMeetingNotification(i);var a=Gc(n,r),o=Gc(this._callState,this._isPreparingToJoin);a!==o&&(this.updateKeepDeviceAwake(o),this.updateDeviceAudioMode(o),this.updateNoOpRecordingEnsuringBackgroundContinuity(o))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=Rc,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Ds},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=bu(Ic,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=Ys,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(e){cl()&&this.nativeUtils().setKeepDeviceAwake(e,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(e){if(cl()&&!this.disableReactNativeAutoDeviceManagement("audio")){var t=e?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(t)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(e){if(cl()&&this.nativeUtils().setShowOngoingMeetingNotification){var t,n,r,i;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var a=this.properties.reactNativeConfig.androidInCallNotification;t=a.title,n=a.subtitle,r=a.iconName,i=a.disableForCustomOverride}i&&(e=!1),this.nativeUtils().setShowOngoingMeetingNotification(e,t,n,r,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(e){cl()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(e)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var e;if(cl()){var t=null===(e=this._callMachine())||void 0===e||null===(e=e.store)||void 0===e?void 0:e.getState();for(var n in null==t?void 0:t.streams){var r=t.streams[n];r&&r.pendingTrack&&"audio"===r.pendingTrack.kind&&(r.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(e){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[e]}},{key:"absoluteUrl",value:function(e){if(void 0!==e){var t=document.createElement("a");return t.href=e,t.href}}},{key:"sayHello",value:function(){var e="hello, world.";return console.log(e),e}},{key:"_logUseAfterDestroy",value:function(){var e=Object.values(Nc)[0];if(this.needsLoad())if(e&&!e.needsLoad()){var t={action:tl,level:"error",code:this.strictMode?9995:9997};e.sendMessageToCallMachine(t)}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 n={action:tl,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(n,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var e=0,t=Object.values(Nc);e<t.length;e++){var n=t[e];n._callMachineInitialized?(n.sendMessageToCallMachine({action:tl,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),n._delayDuplicateInstanceLog=!1):n._delayDuplicateInstanceLog=!0}}},{key:"_maybeSendToSentry",value:function(t){var n,r,i,a;if(null!==(n=t.error)&&void 0!==n&&n.type){if(![Us,zs,Bs].includes(t.error.type))return;if(t.error.type===Bs&&t.error.msg.includes("deleted"))return}var o=null!==(r=this.properties)&&void 0!==r&&r.url?new URL(this.properties.url):void 0,s="production";o&&o.host.includes(".staging.daily")&&(s="staging");var u,d,f,p,h,m=function(){const e=[mo(),po(),Ss(),ws(),Ts(),As(),xo(),{name:"HttpContext",preprocessEvent(e){if(!Io.navigator&&!Io.location&&!Io.document)return;const t=e.request&&e.request.url||Io.location&&Io.location.href,{referrer:n}=Io.document||{},{userAgent:r}=Io.navigator||{},i=l(l(l({},e.request&&e.request.headers),n&&{Referer:n}),r&&{"User-Agent":r}),a=c(l(l({},e.request),t&&{url:t}),{headers:i});e.request=a}}];return!1!=={}.autoSessionTracking&&e.push({name:"BrowserSession",setupOnce(){void 0!==Io.document?(Qa({ignoreDuration:!0}),Ka(),as(({from:e,to:t})=>{void 0!==e&&e!==t&&(Qa({ignoreDuration:!0}),Ka())})):Bo&&Ur.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),e}().filter(function(e){return!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(e.name)}),g=new Yo({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:ds,stackParser:ys,integrations:m,environment:s}),v=new ea;if(v.setClient(g),g.init(),this.session_id&&v.setExtra("sessionId",this.session_id),this.properties){var y=Mc({},this.properties);y.userName=y.userName?"[Filtered]":void 0,y.userData=y.userData?"[Filtered]":void 0,y.token=y.token?"[Filtered]":void 0,v.setExtra("properties",y)}if(o){var b=o.searchParams.get("domain");if(!b){var w=o.host.match(/(.*?)\./);b=w&&w[1]||""}b&&v.setTag("domain",b)}t.error&&(v.setTag("fatalErrorType",t.error.type),v.setExtra("errorDetails",t.error.details),(null===(u=t.error.details)||void 0===u?void 0:u.uri)&&v.setTag("serverAddress",t.error.details.uri),(null===(d=t.error.details)||void 0===d?void 0:d.workerGroup)&&v.setTag("workerGroup",t.error.details.workerGroup),(null===(f=t.error.details)||void 0===f?void 0:f.geoGroup)&&v.setTag("geoGroup",t.error.details.geoGroup),(null===(p=t.error.details)||void 0===p?void 0:p.on)&&v.setTag("connectionAttempt",t.error.details.on),null!==(h=t.error.details)&&void 0!==h&&h.bundleUrl&&(v.setTag("bundleUrl",t.error.details.bundleUrl),v.setTag("bundleError",t.error.details.sourceError.type))),v.setTags({callMode:this._callObjectMode?cl()?"reactNative":null!==(i=this.properties)&&void 0!==i&&null!==(i=i.dailyConfig)&&void 0!==i&&null!==(i=i.callMode)&&void 0!==i&&i.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:e.version()});var k=(null===(a=t.error)||void 0===a?void 0:a.msg)||t.errorMsg;v.captureException(new Error(k))}},{key:"_callMachine",value:function(){var e;return null===(e=window._daily)||void 0===e||null===(e=e.instances)||void 0===e||null===(e=e[this.callClientId])||void 0===e?void 0:e.callMachine}},{key:"_maybeUpdateInputSettings",value:function(e){if(!hr(this._inputSettings,e)){var t=this._getInputSettings();this._inputSettings=e;var n=this._getInputSettings();hr(t,n)||this.emitDailyJSEvent({action:Js,inputSettings:n})}}}],[{key:"supportedBrowser",value:function(){if(cl())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var e=Tr.getParser(ll());return{supported:!!gl(),mobile:"mobile"===e.getPlatformType(),name:e.getBrowserName(),version:e.getBrowserVersion(),supportsFullscreen:!!dl(),supportsScreenShare:!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&(function(e,t){if(!e||!t)return!0;switch(e){case"Chrome":return t.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(13===t.major&&0===t.minor&&0===t.point);case"Firefox":return t.major>=67}return!0}(bl(),wl())||cl())),supportsSfu:!!gl(),supportsVideoProcessing:hl(),supportsAudioProcessing:ml()}}},{key:"version",value:function(){return"0.84.0"}},{key:"createCallObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.layout="none",new e(null,t)}},{key:"wrap",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(tu(),!t||!t.contentWindow||"string"!=typeof t.src)throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return n.layout||(n.customLayout?n.layout="custom-v1":n.layout="browser"),new e(t,n)}},{key:"createFrame",value:function(t,n){var r,i;tu(),t&&n?(r=t,i=n):t&&t.append?(r=t,i={}):(r=document.body,i=t||{});var a=i.iframeStyle;a||(a=r===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 o=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?o.allow="microphone, camera":o.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",o.style.visibility="hidden",r.appendChild(o),o.style.visibility=null,Object.keys(a).forEach(function(e){return o.style[e]=a[e]}),i.layout||(i.customLayout?i.layout="custom-v1":i.layout="browser");try{return new e(o,i)}catch(s){throw r.removeChild(o),s}}},{key:"createTransparentFrame",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tu();var n=document.createElement("iframe");return n.allow="microphone; camera; autoplay",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 0;\n pointer-events: none;\n ",document.body.appendChild(n),t.layout||(t.layout="custom-v1"),e.wrap(n,t)}},{key:"getCallInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e?Nc[e]:Object.values(Nc)[0]}}]);var t,n,r,i,a,o,s,u,d,f,p,h,m,g,v,y,b,w,k,S,_,x,E,C,T,M,P,A,O,N,L,j,I,R,F,D,B,z}();function Hc(e){if(e.extension){if("string"!=typeof e.extension)throw new Error("Error starting dial out: extension must be a string");if(e.extension.length>20)throw new Error("Error starting dial out: extension length must be less than or equal to 20")}if(e.waitBeforeExtensionDialSec){if("number"!=typeof e.waitBeforeExtensionDialSec)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be a number");if(e.waitBeforeExtensionDialSec>60)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be less than or equal to 60");if(!e.extension)throw new Error("Error starting dial out: waitBeforeExtensionDialSec requires a phoneNumber and extension")}}function Jc(e,t){var n={};for(var r in e)if(e[r]instanceof MediaStreamTrack)console.warn("MediaStreamTrack found in props or cache.",r),n[r]=nl;else if("dailyConfig"===r){if(e[r].modifyLocalSdpHook){var i=window._daily.instances[t].customCallbacks||{};i.modifyLocalSdpHook=e[r].modifyLocalSdpHook,window._daily.instances[t].customCallbacks=i,delete e[r].modifyLocalSdpHook}if(e[r].modifyRemoteSdpHook){var a=window._daily.instances[t].customCallbacks||{};a.modifyRemoteSdpHook=e[r].modifyRemoteSdpHook,window._daily.instances[t].customCallbacks=a,delete e[r].modifyRemoteSdpHook}n[r]=e[r]}else n[r]=e[r];return n}function Qc(e){var t=arguments.length>2?arguments[2]:void 0;if(e!==Is){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," only supported after join.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Gc(e,t){return[js,Is].includes(e)||t}function Yc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Gc(e,t)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function Kc(e){var t=arguments.length>2?arguments[2]:void 0;if(!e){var n="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method",arguments.length>3&&void 0!==arguments[3]&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw t&&(n+=" ".concat(t)),console.error(n),new Error(n)}}function Xc(e){if(e){var t="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&void 0!==arguments[1]?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 Zc(e){if(!e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(t),new Error(t)}}function eu(e){if(e){var t="".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(t),new Error(t)}}function tu(){if(cl())throw new Error("This daily-js method is not currently supported in React Native")}function nu(){if(!cl())throw new Error("This daily-js method is only supported in React Native")}function ru(e){if(void 0===e)return!0;var t;if("string"==typeof e)t=e;else try{t=JSON.stringify(e),hr(JSON.parse(t),e)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(t.length>4096)throw Error("userData is too large (".concat(t.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function iu(e,t){for(var n=t.allowAllParticipantsKey,r=function(e){var t=["local"];return n||t.push("*"),e&&!t.includes(e)},i=function(e){return!!(void 0===e.layer||Number.isInteger(e.layer)&&e.layer>=0||"inherit"===e.layer)},a=function(e){return!(!e||e.video&&!i(e.video)||e.screenVideo&&!i(e.screenVideo))},o=0,s=Object.entries(e);o<s.length;o++){var l=or(s[o],2),c=l[0],u=l[1];if(!r(c)||!a(u))return!1}return!0}function au(e){if("object"!==Qn(e))return!1;for(var t=0,n=Object.entries(e);t<n.length;t++){var r=or(n[t],2),i=r[0],a=r[1];switch(i){case"video":if("object"!==Qn(a))return!1;for(var o=0,s=Object.entries(a);o<s.length;o++){var l=or(s[o],2),c=l[0],u=l[1];switch(c){case"processor":if(!lu(u))return!1;break;case"settings":if(!cu(u))return!1;break;default:return!1}}break;case"audio":if("object"!==Qn(a))return!1;for(var d=0,f=Object.entries(a);d<f.length;d++){var p=or(f[d],2),h=p[0],m=p[1];switch(h){case"processor":if(!su(m))return!1;break;case"settings":if(!cu(m))return!1;break;default:return!1}}break;default:return!1}}return!0}function ou(e,t,n){var r,i=[];e.video&&e.video.processor&&(hl(null!==(r=null==t?void 0:t.useLegacyVideoProcessor)&&void 0!==r&&r)||(e.video.settings?delete e.video.processor:delete e.video,i.push("video"))),e.audio&&e.audio.processor&&(ml()||(e.audio.settings?delete e.audio.processor:delete e.audio,i.push("audio"))),i.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(i.join(", "))),e.audio&&e.audio.settings&&(e.audio.settings.customTrack?(n.audioTrack=e.audio.settings.customTrack,e.audio.settings={customTrack:nl}):delete n.audioTrack),e.video&&e.video.settings&&(e.video.settings.customTrack?(n.videoTrack=e.video.settings.customTrack,e.video.settings={customTrack:nl}):delete n.videoTrack)}function su(e){if(cl())return console.warn("Video processing is not yet supported in React Native"),!1;var t,n=["type"];return!(!e||"object"!==Qn(e)||(Object.keys(e).filter(function(e){return!n.includes(e)}).forEach(function(t){console.warn("invalid key inputSettings -> audio -> processor : ".concat(t)),delete e[t]}),t=e.type,"string"!=typeof t||!Object.values(il).includes(t)&&(console.error("inputSettings audio processor type invalid"),1)))}function lu(e){if(cl())return console.warn("Video processing is not yet supported in React Native"),!1;var t,n=["type","config"];if(!e)return!1;if("object"!==Qn(e))return!1;if("string"!=typeof(t=e.type)||!Object.values(rl).includes(t)&&(console.error("inputSettings video processor type invalid"),1))return!1;if(e.config){if("object"!==Qn(e.config))return!1;if(!function(e,t){var n=Object.keys(t);if(0===n.length)return!0;var r,i,a,o="invalid object in inputSettings -> video -> processor -> config";switch(e){case rl.BGBLUR:return n.length>1||"strength"!==n[0]?(console.error(o),!1):!("number"!=typeof t.strength||t.strength<=0||t.strength>1||isNaN(t.strength))||(console.error("".concat(o,"; expected: {0 < strength <= 1}, got: ").concat(t.strength)),!1);case rl.BGIMAGE:return!(void 0!==t.source&&(r=t,!("default"===r.source?(r.type="default",1):r.source instanceof ArrayBuffer||(Nr(r.source)?(r.type="url",function(e){var t=new URL(e),n=t.pathname;if("data:"===t.protocol)try{var r=n.substring(n.indexOf(":")+1,n.indexOf(";")).split("/")[1];return ol.includes(r)}catch(a){return console.error("failed to deduce blob content type",a),!1}var i=n.split(".").at(-1).toLowerCase().trim();return ol.includes(i)}(r.source)||(console.error("invalid image type; supported types: [".concat(ol.join(", "),"]")),0)):(i=r.source,a=Number(i),isNaN(a)||!Number.isInteger(a)||a<=0||a>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),0):(r.type="daily-preselect",1))))));default:return!0}}(e.type,e.config))return!1}return Object.keys(e).filter(function(e){return!n.includes(e)}).forEach(function(t){console.warn("invalid key inputSettings -> video -> processor : ".concat(t)),delete e[t]}),!0}function cu(e){return"object"===Qn(e)&&(!e.customTrack||e.customTrack instanceof MediaStreamTrack)}function uu(){var e=Object.values(rl).join(" | "),t=Object.values(il).join(" | ");return"inputSettings must be of the form: { video?: { processor?: { type: [ ".concat(e," ], config?: {} } }, audio?: { processor: {type: [ ").concat(t," ] } } }")}function du(e){var t=e.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat("base").concat(t?' | "'.concat("*",'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function fu(){return"customIntegrations should be an object of type ".concat(JSON.stringify(Vc),".")}function pu(e){if(e&&"object"!==Qn(e)||Array.isArray(e))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(Uc),".")),!1;if(e)for(var t=0,n=Object.entries(e);t<n.length;t++)for(var r=or(n[t],1)[0],i=0,a=Object.entries(e[r]);i<a.length;i++){var o=or(a[i],2),s=o[0],l=o[1],c=Uc.id[s];if(!c)return console.error("customTrayButton does not support key ".concat(s)),!1;switch(s){case"iconPath":case"iconPathDarkMode":if(!Nr(l))return console.error("customTrayButton ".concat(s," should be a url.")),!1;break;case"visualState":if(!["default","sidebar-open","active"].includes(l))return console.error("customTrayButton ".concat(s," should be ").concat(c,". Got: ").concat(l)),!1;break;default:if(Qn(l)!==c)return console.error("customTrayButton ".concat(s," should be a ").concat(c,".")),!1}}return!0}function hu(e){if(!e||e&&"object"!==Qn(e)||Array.isArray(e))return console.error(fu()),!1;for(var t=function(e){return"".concat(e," should be ").concat(Vc.id[e])},n=function(e,t){return console.error("customIntegration ".concat(e,": ").concat(t))},r=0,i=Object.entries(e);r<i.length;r++){var a=or(i[r],1)[0];if(!("label"in e[a]))return n(a,"label is required"),!1;if(!("location"in e[a]))return n(a,"location is required"),!1;if(!("src"in e[a])&&!("srcdoc"in e[a]))return n(a,"src or srcdoc is required"),!1;for(var o=0,s=Object.entries(e[a]);o<s.length;o++){var l=or(s[o],2),c=l[0],u=l[1];switch(c){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if("string"!=typeof u)return n(a,t(c)),!1;break;case"iconURL":if(!Nr(u))return n(a,"".concat(c," should be a url")),!1;break;case"src":if("srcdoc"in e[a])return n(a,"cannot have both src and srcdoc"),!1;if(!Nr(u))return n(a,'src "'.concat(u,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in e[a])return n(a,"cannot have both src and srcdoc"),!1;if("string"!=typeof u)return n(a,t(c)),!1;break;case"location":if(!["main","sidebar"].includes(u))return n(a,t(c)),!1;break;case"controlledBy":if("*"!==u&&"owners"!==u&&(!Array.isArray(u)||u.some(function(e){return"string"!=typeof e})))return n(a,t(c)),!1;break;case"shared":if((!Array.isArray(u)||u.some(function(e){return"string"!=typeof e}))&&"owners"!==u&&"boolean"!=typeof u)return n(a,t(c)),!1;break;default:if(!Vc.id[c])return console.error("customIntegration does not support key ".concat(c)),!1}}}return!0}function mu(e,t){if(void 0===t)return!1;switch(Qn(t)){case"string":return Qn(e)===t;case"object":if("object"!==Qn(e))return!1;for(var n in e)if(!mu(e[n],t[n]))return!1;return!0;default:return!1}}function gu(e,t){var n=e.sessionId,r=e.toEndPoint,i=e.callerId,a=e.useSipRefer;if(!n||!r)throw new Error("".concat(t,"() requires a sessionId and toEndPoint"));if("string"!=typeof n||"string"!=typeof r)throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(a&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'));if(i&&"string"!=typeof i)throw new Error("callerId must be of type string");if(i&&!r.startsWith("+"))throw new Error("callerId is only valid when transferring to a PSTN number")}function vu(e){if("object"!==Qn(e))throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(e.state&&!Object.values(al).includes(e.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(al));if(e.volume){if("number"!=typeof e.volume)throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(e.volume<0||e.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function yu(e,t,n){return!("number"!=typeof e||e<t||e>n)}function bu(e,t){return e&&!t&&delete e.data,e}var wu,ku={exports:{}};var Su=function(){if(wu)return ku.exports;wu=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}ku.exports=i,ku.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}h(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&h(e,"error",t,n)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,a,l,c;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),l=a[t]),void 0===l)l=a[t]=n,++e._eventsCount;else if("function"==typeof l?l=a[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),(i=s(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,c=u,console&&console.warn&&console.warn(c)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return o(t),this.on(e,u(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,u(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},ku.exports}();const _u=f(Su);for(var xu,Eu=[],Cu=0;Cu<256;++Cu)Eu.push((Cu+256).toString(16).slice(1));var Tu=new Uint8Array(16);function Mu(){if(!xu&&!(xu="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xu(Tu)}const Pu={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Au(e,t,n){if(Pu.randomUUID&&!t&&!e)return Pu.randomUUID();var r=(e=e||{}).random||(e.rng||Mu)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return function(e,t=0){return(Eu[e[t+0]]+Eu[e[t+1]]+Eu[e[t+2]]+Eu[e[t+3]]+"-"+Eu[e[t+4]]+Eu[e[t+5]]+"-"+Eu[e[t+6]]+Eu[e[t+7]]+"-"+Eu[e[t+8]]+Eu[e[t+9]]+"-"+Eu[e[t+10]]+Eu[e[t+11]]+Eu[e[t+12]]+Eu[e[t+13]]+Eu[e[t+14]]+Eu[e[t+15]]).toLowerCase()}(r)}const Ou={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},Nu={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},Lu={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},ju={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},Iu={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"};class Ru{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);t.push(0);const n=t[0],r=t[1];if(10===n)switch(r){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}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=Ru.getVersionPrecision(e),i=Ru.getVersionPrecision(t);let a=Math.max(r,i),o=0;const s=Ru.map([e,t],e=>{const t=a-Ru.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return Ru.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(o=a-Math.min(r,i)),a-=1;a>=o;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===o)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,i;if(Object.assign)return Object.assign(e,...t);for(r=0,i=t.length;r<i;r+=1){const e=t[r];if("object"==typeof e&&null!==e){Object.keys(e).forEach(t=>{n[t]=e[t]})}}return e}static getBrowserAlias(e){return Ou[e]}static getBrowserTypeByAlias(e){return Nu[e]||""}}const Fu=/version\/(\d+(\.?_?\d+)+)/i,Du=[{test:[/gptbot/i],describe(e){const t={name:"GPTBot"},n=Ru.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe(e){const t={name:"ChatGPT-User"},n=Ru.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe(e){const t={name:"OAI-SearchBot"},n=Ru.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(e){const t={name:"ClaudeBot"},n=Ru.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe(e){const t={name:"Omgilibot"},n=Ru.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe(e){const t={name:"Diffbot"},n=Ru.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe(e){const t={name:"PerplexityBot"},n=Ru.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe(e){const t={name:"Perplexity-User"},n=Ru.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe(e){const t={name:"YouBot"},n=Ru.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe(e){const t={name:"Meta-WebIndexer"},n=Ru.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe(e){const t={name:"Meta-ExternalAds"},n=Ru.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe(e){const t={name:"Meta-ExternalAgent"},n=Ru.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe(e){const t={name:"Meta-ExternalFetcher"},n=Ru.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=Ru.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe(e){const t={name:"AmazonBot"},n=Ru.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe(e){const t={name:"BingCrawler"},n=Ru.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe(e){const t={name:"BaiduSpider"},n=Ru.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe(e){const t={name:"DuckDuckBot"},n=Ru.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe(e){const t={name:"InternetArchiveCrawler"},n=Ru.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:()=>({name:"FacebookExternalHit"})},{test:[/yahoo!?[\s/]*slurp/i],describe:()=>({name:"YahooSlurp"})},{test:[/yandexbot/i,/yandexmobilebot/i],describe:()=>({name:"YandexBot"})},{test:[/pingdom/i],describe:()=>({name:"PingdomBot"})},{test:[/opera/i],describe(e){const t={name:"Opera"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=Ru.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe(e){const t={name:"Pale Moon"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=Ru.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=Ru.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=Ru.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=Ru.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=Ru.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=Ru.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=Ru.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=Ru.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=Ru.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=Ru.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=Ru.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=Ru.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=Ru.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=Ru.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=Ru.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=Ru.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=Ru.getFirstMatch(Fu,e)||Ru.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=Ru.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=Ru.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=Ru.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/librewolf/i],describe(e){const t={name:"LibreWolf"},n=Ru.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=Ru.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=Ru.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe(e){const t={name:"Sogou Browser"},n=Ru.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),r=Ru.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),i=Ru.getFirstMatch(/se ([\d.]+)x/i,e),a=n||r||i;return a&&(t.version=a),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=Ru.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=Ru.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=Ru.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=Ru.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=Ru.getFirstMatch(Fu,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:Ru.getFirstMatch(t,e),version:Ru.getSecondMatch(t,e)}}}],Bu=[{test:[/Roku\/DVP/],describe(e){const t=Ru.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:ju.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=Ru.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:ju.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=Ru.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=Ru.getWindowsVersionName(t);return{name:ju.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:ju.iOS},n=Ru.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=Ru.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=Ru.getMacOSVersionName(t),r={name:ju.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=Ru.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:ju.iOS,version:t}}},{test:[/OpenHarmony/i],describe(e){const t=Ru.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:ju.HarmonyOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=Ru.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=Ru.getAndroidVersionName(t),r={name:ju.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=Ru.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:ju.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=Ru.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||Ru.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||Ru.getFirstMatch(/\bbb(\d+)/i,e);return{name:ju.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=Ru.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:ju.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=Ru.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:ju.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:ju.Linux})},{test:[/CrOS/],describe:()=>({name:ju.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=Ru.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:ju.PlayStation4,version:t}}}],zu=[{test:[/googlebot/i],describe:()=>({type:Lu.bot,vendor:"Google"})},{test:[/amazonbot/i],describe:()=>({type:Lu.bot,vendor:"Amazon"})},{test:[/gptbot/i],describe:()=>({type:Lu.bot,vendor:"OpenAI"})},{test:[/chatgpt-user/i],describe:()=>({type:Lu.bot,vendor:"OpenAI"})},{test:[/oai-searchbot/i],describe:()=>({type:Lu.bot,vendor:"OpenAI"})},{test:[/baiduspider/i],describe:()=>({type:Lu.bot,vendor:"Baidu"})},{test:[/bingbot/i],describe:()=>({type:Lu.bot,vendor:"Bing"})},{test:[/duckduckbot/i],describe:()=>({type:Lu.bot,vendor:"DuckDuckGo"})},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:()=>({type:Lu.bot,vendor:"Anthropic"})},{test:[/omgilibot/i,/webzio-extended/i],describe:()=>({type:Lu.bot,vendor:"Webz.io"})},{test:[/diffbot/i],describe:()=>({type:Lu.bot,vendor:"Diffbot"})},{test:[/perplexitybot/i],describe:()=>({type:Lu.bot,vendor:"Perplexity AI"})},{test:[/perplexity-user/i],describe:()=>({type:Lu.bot,vendor:"Perplexity AI"})},{test:[/youbot/i],describe:()=>({type:Lu.bot,vendor:"You.com"})},{test:[/ia_archiver/i],describe:()=>({type:Lu.bot,vendor:"Internet Archive"})},{test:[/meta-webindexer/i],describe:()=>({type:Lu.bot,vendor:"Meta"})},{test:[/meta-externalads/i],describe:()=>({type:Lu.bot,vendor:"Meta"})},{test:[/meta-externalagent/i],describe:()=>({type:Lu.bot,vendor:"Meta"})},{test:[/meta-externalfetcher/i],describe:()=>({type:Lu.bot,vendor:"Meta"})},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:()=>({type:Lu.bot,vendor:"Meta"})},{test:[/yahoo/i],describe:()=>({type:Lu.bot,vendor:"Yahoo"})},{test:[/yandexbot/i,/yandexmobilebot/i],describe:()=>({type:Lu.bot,vendor:"Yandex"})},{test:[/pingdom/i],describe:()=>({type:Lu.bot,vendor:"Pingdom"})},{test:[/huawei/i],describe(e){const t=Ru.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Lu.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Lu.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Lu.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Lu.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Lu.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Lu.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Lu.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=Ru.getFirstMatch(/(ipod|iphone)/i,e);return{type:Lu.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Lu.mobile,vendor:"Nexus"})},{test:[/Nokia/i],describe(e){const t=Ru.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:Lu.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:()=>({type:Lu.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Lu.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Lu.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Lu.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Lu.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Lu.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Lu.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Lu.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Lu.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Lu.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Lu.tv})}],Uu=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Iu.Blink};const t=Ru.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Iu.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Iu.Trident},n=Ru.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Iu.Presto},n=Ru.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:Iu.Gecko},n=Ru.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Iu.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Iu.WebKit},n=Ru.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class Vu{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=Ru.find(Du,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=Ru.find(Bu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=Ru.find(zu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=Ru.find(Uu,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Ru.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let i=0;if(Object.keys(e).forEach(a=>{const o=e[a];"string"==typeof o?(r[a]=o,i+=1):"object"==typeof o&&(t[a]=o,n+=1)}),n>0){const e=Object.keys(t),n=Ru.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=Ru.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(i>0){const e=Object.keys(r),t=Ru.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const i=Ru.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(Ru.compareVersions(i,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
43
43
  /*!
44
44
  * Bowser - a browser detector
45
45
  * https://github.com/lancedikson/bowser
46
46
  * MIT License | (c) Dustin Diaz 2012-2015
47
47
  * MIT License | (c) Denis Demchenko 2015-2019
48
- */class Hu{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new qu(e,t)}static parse(e){return new qu(e).getResult()}static get BROWSER_MAP(){return Iu}static get ENGINE_MAP(){return Du}static get OS_MAP(){return Fu}static get PLATFORMS_MAP(){return Ru}}function Ju(e,t){return Object.keys(t).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})}),e}function Gu(e){return e&&e.__esModule?e.default:e}function Qu(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var Yu={},Ku={};Qu(Ku,"PipecatClient",()=>qd);var Xu;Xu=JSON.parse('{"name":"@pipecat-ai/client-js","version":"1.5.0","license":"BSD-2-Clause","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","source":"index.ts","repository":{"type":"git","url":"git+https://github.com/pipecat-ai/pipecat-client-web.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"jest --silent --passWithNoTests && parcel build --no-cache","dev":"parcel watch","lint":"eslint . --report-unused-disable-directives --max-warnings 0","test":"jest"},"jest":{"preset":"ts-jest","testEnvironment":"jsdom"},"devDependencies":{"@jest/globals":"^29.7.0","@types/clone-deep":"^4.0.4","@types/jest":"^29.5.12","@types/uuid":"^10.0.0","eslint":"^9.11.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1","jest":"^29.7.0","jest-environment-jsdom":"^30.0.2","ts-jest":"^29.2.5"},"dependencies":{"@types/events":"^3.0.3","bowser":"^2.11.0","clone-deep":"^4.0.1","events":"^3.3.0","typed-emitter":"^2.1.0","uuid":"^10.0.0"}}');var Zu,ed,td={},nd={};Qu(nd,"TransportStateEnum",()=>Zu),(ed=Zu||(Zu={})).DISCONNECTED="disconnected",ed.INITIALIZING="initializing",ed.INITIALIZED="initialized",ed.AUTHENTICATING="authenticating",ed.AUTHENTICATED="authenticated",ed.CONNECTING="connecting",ed.CONNECTED="connected",ed.READY="ready",ed.DISCONNECTING="disconnecting",ed.ERROR="error";var rd={};Qu(rd,"RTVIError",()=>id),Qu(rd,"ConnectionTimeoutError",()=>ad),Qu(rd,"StartBotError",()=>od),Qu(rd,"TransportStartError",()=>sd),Qu(rd,"InvalidTransportParamsError",()=>ld),Qu(rd,"BotNotReadyError",()=>cd),Qu(rd,"BotAlreadyStartedError",()=>ud),Qu(rd,"UnsupportedFeatureError",()=>dd),Qu(rd,"DeviceError",()=>fd);class id extends Error{constructor(e,t){super(e),this.status=t}}class ad extends id{constructor(e){super(null!=e?e:"Bot did not enter ready state within the specified timeout period.")}}class od extends id{constructor(e,t){super(null!=e?e:"Failed to connect / invalid auth bundle from base url",null!=t?t:500),this.error="invalid-request-error"}}class sd extends id{constructor(e){super(null!=e?e:"Unable to connect to transport")}}class ld extends id{constructor(e){super(null!=e?e:"Invalid transport connection parameters")}}class cd extends id{constructor(e){super(null!=e?e:"Attempt to call action on transport when not in 'ready' state.")}}class ud extends id{constructor(e){super(null!=e?e:"Pipecat client has already been started. Please call disconnect() before starting again.")}}class dd extends id{constructor(e,t,n){let r=`${e} not supported${n?`: ${n}`:""}`;t&&(r=`${t} does not support ${e}${n?`: ${n}`:""}`),super(r),this.feature=e}}class fd extends id{constructor(e,t,n,r){super(null!=n?n:`Device error for ${e.join(", ")}: ${t}`),this.devices=e,this.type=t,this.details=r}}var pd,hd,md={};Qu(md,"RTVIEvent",()=>pd),(hd=pd||(pd={})).Connected="connected",hd.Disconnected="disconnected",hd.TransportStateChanged="transportStateChanged",hd.BotStarted="botStarted",hd.BotConnected="botConnected",hd.BotReady="botReady",hd.BotDisconnected="botDisconnected",hd.Error="error",hd.ServerMessage="serverMessage",hd.ServerResponse="serverResponse",hd.MessageError="messageError",hd.Metrics="metrics",hd.BotStartedSpeaking="botStartedSpeaking",hd.BotStoppedSpeaking="botStoppedSpeaking",hd.UserStartedSpeaking="userStartedSpeaking",hd.UserStoppedSpeaking="userStoppedSpeaking",hd.UserTranscript="userTranscript",hd.BotOutput="botOutput",hd.BotTranscript="botTranscript",hd.BotLlmText="botLlmText",hd.BotLlmStarted="botLlmStarted",hd.BotLlmStopped="botLlmStopped",hd.LLMFunctionCall="llmFunctionCall",hd.BotLlmSearchResponse="botLlmSearchResponse",hd.BotTtsText="botTtsText",hd.BotTtsStarted="botTtsStarted",hd.BotTtsStopped="botTtsStopped",hd.ParticipantConnected="participantConnected",hd.ParticipantLeft="participantLeft",hd.TrackStarted="trackStarted",hd.TrackStopped="trackStopped",hd.ScreenTrackStarted="screenTrackStarted",hd.ScreenTrackStopped="screenTrackStopped",hd.ScreenShareError="screenShareError",hd.LocalAudioLevel="localAudioLevel",hd.RemoteAudioLevel="remoteAudioLevel",hd.AvailableCamsUpdated="availableCamsUpdated",hd.AvailableMicsUpdated="availableMicsUpdated",hd.AvailableSpeakersUpdated="availableSpeakersUpdated",hd.CamUpdated="camUpdated",hd.MicUpdated="micUpdated",hd.SpeakerUpdated="speakerUpdated",hd.DeviceError="deviceError";var gd={};Qu(gd,"RTVI_PROTOCOL_VERSION",()=>vd),Qu(gd,"RTVI_MESSAGE_LABEL",()=>yd),Qu(gd,"RTVIMessageType",()=>bd),Qu(gd,"AggregationType",()=>kd),Qu(gd,"setAboutClient",()=>xd),Qu(gd,"RTVIMessage",()=>Cd);const vd="1.0.0",yd="rtvi-ai";var bd,wd,kd,Sd;let _d;function xd(e){_d=_d?l(l({},_d),e):e}(wd=bd||(bd={})).CLIENT_READY="client-ready",wd.DISCONNECT_BOT="disconnect-bot",wd.CLIENT_MESSAGE="client-message",wd.SEND_TEXT="send-text",wd.APPEND_TO_CONTEXT="append-to-context",wd.BOT_READY="bot-ready",wd.ERROR="error",wd.METRICS="metrics",wd.SERVER_MESSAGE="server-message",wd.SERVER_RESPONSE="server-response",wd.ERROR_RESPONSE="error-response",wd.APPEND_TO_CONTEXT_RESULT="append-to-context-result",wd.USER_TRANSCRIPTION="user-transcription",wd.BOT_OUTPUT="bot-output",wd.BOT_TRANSCRIPTION="bot-transcription",wd.USER_STARTED_SPEAKING="user-started-speaking",wd.USER_STOPPED_SPEAKING="user-stopped-speaking",wd.BOT_STARTED_SPEAKING="bot-started-speaking",wd.BOT_STOPPED_SPEAKING="bot-stopped-speaking",wd.USER_LLM_TEXT="user-llm-text",wd.BOT_LLM_TEXT="bot-llm-text",wd.BOT_LLM_STARTED="bot-llm-started",wd.BOT_LLM_STOPPED="bot-llm-stopped",wd.LLM_FUNCTION_CALL="llm-function-call",wd.LLM_FUNCTION_CALL_RESULT="llm-function-call-result",wd.BOT_LLM_SEARCH_RESPONSE="bot-llm-search-response",wd.BOT_TTS_TEXT="bot-tts-text",wd.BOT_TTS_STARTED="bot-tts-started",wd.BOT_TTS_STOPPED="bot-tts-stopped",(Sd=kd||(kd={})).WORD="word",Sd.SENTENCE="sentence";class Cd{constructor(e,t,n){this.label=yd,this.type=e,this.data=t,this.id=n||Lu().slice(0,8)}static clientReady(){return new Cd(bd.CLIENT_READY,{version:vd,about:_d||{library:Xu.name,library_version:Xu.version}})}static disconnectBot(){return new Cd(bd.DISCONNECT_BOT,{})}static error(e,t=!1){return new Cd(bd.ERROR,{message:e,fatal:t})}}function Ed(e,t,n){const r=n.value;return n.value=function(...e){if("ready"===this.state)return r.apply(this,e);throw new cd(`Attempt to call ${t.toString()} when transport not in ready state. Await connect() first.`)},n}function Td(e,t,n){const r=n.value,i=["authenticating","connecting","connected","ready"];return n.value=function(...e){if(i.includes(this.state))throw new ud(`Attempt to call ${t.toString()} when client already started. Please call disconnect() before starting again.`);return r.apply(this,e)},n}Ju(td,nd),Ju(td,rd),Ju(td,md),Ju(td,gd);var Md={};Qu(Md,"MessageDispatcher",()=>jd);var Pd,Ad,Od={};Qu(Od,"LogLevel",()=>Pd),Qu(Od,"logger",()=>Ld),(Ad=Pd||(Pd={}))[Ad.NONE=0]="NONE",Ad[Ad.ERROR=1]="ERROR",Ad[Ad.WARN=2]="WARN",Ad[Ad.INFO=3]="INFO",Ad[Ad.DEBUG=4]="DEBUG";class Nd{constructor(){this.level=Pd.DEBUG}static getInstance(){return Nd.instance||(Nd.instance=new Nd),Nd.instance}setLevel(e){this.level=e}debug(...e){this.level>=Pd.DEBUG&&console.debug(...e)}info(...e){this.level>=Pd.INFO&&console.info(...e)}warn(...e){this.level>=Pd.WARN&&console.warn(...e)}error(...e){this.level>=Pd.ERROR&&console.error(...e)}}const Ld=Nd.getInstance();class jd{constructor(e){this._queue=new Array,this._gcInterval=void 0,this._queue=[],this._sendMethod=e}disconnect(){this.clearQueue(),clearInterval(this._gcInterval),this._gcInterval=void 0}dispatch(e,t=bd.CLIENT_MESSAGE,n=1e4){this._gcInterval||(this._gcInterval=setInterval(()=>{this._gc()},2e3));const r=new Cd(t,e),i=new Promise((e,t)=>{this._queue.push({message:r,timestamp:Date.now(),timeout:n,resolve:e,reject:t})});Ld.debug("[MessageDispatcher] dispatch",r);try{this._sendMethod(r)}catch(dr){return Ld.error("[MessageDispatcher] Error sending message",dr),Promise.reject(dr)}return this._gc(),i}clearQueue(){this._queue=[]}_resolveReject(e,t=!0){const n=this._queue.find(t=>t.message.id===e.id);return n&&(t?(Ld.debug("[MessageDispatcher] Resolve",e),n.resolve(e)):(Ld.debug("[MessageDispatcher] Reject",e),n.reject(e)),this._queue=this._queue.filter(t=>t.message.id!==e.id),Ld.debug("[MessageDispatcher] Queue",this._queue)),e}resolve(e){return this._resolveReject(e,!0)}reject(e){return this._resolveReject(e,!1)}_gc(){const e=[];this._queue=this._queue.filter(t=>{const n=Date.now()-t.timestamp<t.timeout;return n||e.push(t),n}),e.forEach(e=>{e.message.type===bd.CLIENT_MESSAGE&&e.reject(new Cd(bd.ERROR_RESPONSE,{error:"Timed out waiting for response",msgType:e.message.data.t,data:e.message.data.d,fatal:!1}))}),Ld.debug("[MessageDispatcher] GC",this._queue)}}var Id={};function Rd(e){if("object"==typeof e&&null!==e&&Object.keys(e).includes("endpoint")){const t=e.endpoint;return"string"==typeof t||t instanceof URL||"undefined"!=typeof Request&&t instanceof Request}return!1}function Fd(e,t){return d(this,null,function*(){let n;return t||(t=new AbortController),new Promise((r,i)=>{d(null,null,function*(){var a;e.timeout&&(n=setTimeout(()=>d(null,null,function*(){t.abort(),i(new Error("Timed out"))}),e.timeout)),Ld.debug(`[Pipecat Client] Fetching from ${e.endpoint}`),fetch(e.endpoint,{method:"POST",mode:"cors",headers:new Headers(l({"Content-Type":"application/json"},Object.fromEntries((null!=(a=e.headers)?a:new Headers).entries()))),body:JSON.stringify(e.requestData),signal:null==t?void 0:t.signal}).then(t=>{Ld.debug(`[Pipecat Client] Received response from ${e.endpoint}`,t),t.ok||i(t),t.json().then(e=>r(e))}).catch(e=>{Ld.error(`[Pipecat Client] Error fetching: ${e}`),i(e)}).finally(()=>{n&&clearTimeout(n)})})})})}Qu(Id,"isAPIRequest",()=>Rd),Qu(Id,"makeRequest",()=>Fd);var Dd={};Qu(Dd,"Transport",()=>Bd),Qu(Dd,"TransportWrapper",()=>zd);class Bd{constructor(){this._state="disconnected"}connect(e){this._abortController=new AbortController;let t=e;try{t=this._validateConnectionParams(e)}catch(dr){throw new id(`Invalid connection params: ${dr.message}. Please check your connection params and try again.`)}return this._connect(t)}get startBotParams(){return this._startBotParams}set startBotParams(e){this._startBotParams=e}disconnect(){return this._abortController&&this._abortController.abort(),this._disconnect()}}class zd{constructor(e){this._transport=e,this._proxy=new Proxy(this._transport,{get:(e,t,n)=>{if("function"==typeof e[t]){let n;switch(String(t)){case"initialize":n="Direct calls to initialize() are disabled and used internally by the PipecatClient.";break;case"initDevices":n="Direct calls to initDevices() are disabled. Please use the PipecatClient.initDevices() wrapper or let PipecatClient.connect() call it for you.";break;case"sendReadyMessage":n="Direct calls to sendReadyMessage() are disabled and used internally by the PipecatClient.";break;case"connect":n="Direct calls to connect() are disabled. Please use the PipecatClient.connect() wrapper.";break;case"disconnect":n="Direct calls to disconnect() are disabled. Please use the PipecatClient.disconnect() wrapper."}return n?()=>{throw new Error(n)}:(...n)=>e[t](...n)}return Reflect.get(e,t,n)}})}get proxy(){return this._proxy}}var Ud={};function Vd(){var e,t,n,r,i,a;let o={library:Xu.name,library_version:Xu.version,platform_details:{}},s=null;if(null==(e=null==window?void 0:window.navigator)?void 0:e.userAgent)try{s=Hu.parse(window.navigator.userAgent)}catch(l){}return(null==(t=null==s?void 0:s.browser)?void 0:t.name)&&(o.platform_details.browser=s.browser.name),"Safari"!==(null==(n=null==s?void 0:s.browser)?void 0:n.name)||s.browser.version?(null==(r=null==s?void 0:s.browser)?void 0:r.version)&&(o.platform_details.browser_version=s.browser.version):o.platform_details.browser_version="Web View",(null==(i=null==s?void 0:s.platform)?void 0:i.type)&&(o.platform_details.platform_type=s.platform.type),(null==(a=null==s?void 0:s.engine)?void 0:a.name)&&(o.platform_details.engine=s.engine.name),(null==s?void 0:s.os)&&(o.platform=s.os.name,o.platform_version=s.os.version),o}Qu(Ud,"learnAboutClient",()=>Vd);var $d=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class Wd extends Eu{}class qd extends Wd{constructor(e){var t,n,r;super(),this._functionCallCallbacks={},this._botTranscriptionWarned=!1,xd(Vd()),this._transport=e.transport,this._transportWrapper=new zd(this._transport);const i=c(l({},e.callbacks),{onMessageError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onMessageError)||r.call(n,t),this.emit(pd.MessageError,t)},onError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onError)||r.call(n,t);try{this.emit(pd.Error,t)}catch(dr){Ld.debug("Could not emit error",t)}const i=t.data;(null==i?void 0:i.fatal)&&(Ld.error("Fatal error reported. Disconnecting..."),this.disconnect())},onConnected:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onConnected)||n.call(t),this.emit(pd.Connected)},onDisconnected:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onDisconnected)||n.call(t),this.emit(pd.Disconnected)},onTransportStateChanged:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onTransportStateChanged)||r.call(n,t),this.emit(pd.TransportStateChanged,t)},onParticipantJoined:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onParticipantJoined)||r.call(n,t),this.emit(pd.ParticipantConnected,t)},onParticipantLeft:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onParticipantLeft)||r.call(n,t),this.emit(pd.ParticipantLeft,t)},onTrackStarted:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onTrackStarted)||i.call(r,t,n),this.emit(pd.TrackStarted,t,n)},onTrackStopped:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onTrackStopped)||i.call(r,t,n),this.emit(pd.TrackStopped,t,n)},onScreenTrackStarted:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onScreenTrackStarted)||i.call(r,t,n),this.emit(pd.ScreenTrackStarted,t,n)},onScreenTrackStopped:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onScreenTrackStopped)||i.call(r,t,n),this.emit(pd.ScreenTrackStopped,t,n)},onScreenShareError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onScreenShareError)||r.call(n,t),this.emit(pd.ScreenShareError,t)},onAvailableCamsUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableCamsUpdated)||r.call(n,t),this.emit(pd.AvailableCamsUpdated,t)},onAvailableMicsUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableMicsUpdated)||r.call(n,t),this.emit(pd.AvailableMicsUpdated,t)},onAvailableSpeakersUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableSpeakersUpdated)||r.call(n,t),this.emit(pd.AvailableSpeakersUpdated,t)},onCamUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onCamUpdated)||r.call(n,t),this.emit(pd.CamUpdated,t)},onMicUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onMicUpdated)||r.call(n,t),this.emit(pd.MicUpdated,t)},onSpeakerUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onSpeakerUpdated)||r.call(n,t),this.emit(pd.SpeakerUpdated,t)},onDeviceError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onDeviceError)||r.call(n,t),this.emit(pd.DeviceError,t)},onBotStarted:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotStarted)||r.call(n,t),this.emit(pd.BotStarted,t)},onBotConnected:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotConnected)||r.call(n,t),this.emit(pd.BotConnected,t)},onBotReady:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotReady)||r.call(n,t),this.emit(pd.BotReady,t)},onBotDisconnected:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotDisconnected)||r.call(n,t),this.emit(pd.BotDisconnected,t)},onBotStartedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotStartedSpeaking)||n.call(t),this.emit(pd.BotStartedSpeaking)},onBotStoppedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotStoppedSpeaking)||n.call(t),this.emit(pd.BotStoppedSpeaking)},onRemoteAudioLevel:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onRemoteAudioLevel)||i.call(r,t,n),this.emit(pd.RemoteAudioLevel,t,n)},onUserStartedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onUserStartedSpeaking)||n.call(t),this.emit(pd.UserStartedSpeaking)},onUserStoppedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onUserStoppedSpeaking)||n.call(t),this.emit(pd.UserStoppedSpeaking)},onLocalAudioLevel:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onLocalAudioLevel)||r.call(n,t),this.emit(pd.LocalAudioLevel,t)},onUserTranscript:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onUserTranscript)||r.call(n,t),this.emit(pd.UserTranscript,t)},onBotOutput:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotOutput)||r.call(n,t),this.emit(pd.BotOutput,t)},onBotTranscript:t=>{var n,r;this._botTranscriptionWarned||(Ld.warn("[Pipecat Client] Bot transcription is deprecated. Please use the onBotOutput instead."),this._botTranscriptionWarned=!0),null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotTranscript)||r.call(n,t),this.emit(pd.BotTranscript,t)},onBotLlmText:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotLlmText)||r.call(n,t),this.emit(pd.BotLlmText,t)},onBotLlmStarted:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotLlmStarted)||n.call(t),this.emit(pd.BotLlmStarted)},onBotLlmStopped:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotLlmStopped)||n.call(t),this.emit(pd.BotLlmStopped)},onBotTtsText:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotTtsText)||r.call(n,t),this.emit(pd.BotTtsText,t)},onBotTtsStarted:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotTtsStarted)||n.call(t),this.emit(pd.BotTtsStarted)},onBotTtsStopped:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotTtsStopped)||n.call(t),this.emit(pd.BotTtsStopped)}});this._options=c(l({},e),{callbacks:i,enableMic:null==(t=e.enableMic)||t,enableCam:null!=(n=e.enableCam)&&n,enableScreenShare:null!=(r=e.enableScreenShare)&&r}),this._initialize(),Ld.debug("[Pipecat Client] Initialized",this.version)}setLogLevel(e){Ld.setLevel(e)}initDevices(){return d(this,null,function*(){Ld.debug("[Pipecat Client] Initializing devices..."),yield this._transport.initDevices()})}startBot(e){return d(this,null,function*(){var t,n,r,i,a,o;let s;this._transport.state="authenticating",this._transport.startBotParams=e,this._abortController=new AbortController;try{s=yield Fd(e,this._abortController)}catch(dr){let a,o="An unknown error occurred while starting the bot.";if(dr instanceof Response){const r=yield dr.json();o=null!=(n=null!=(t=r.info)?t:r.detail)?n:dr.statusText,a=dr.status}else dr instanceof Error&&(o=dr.message);throw null==(i=null==(r=this._options.callbacks)?void 0:r.onError)||i.call(r,new Cd(bd.ERROR_RESPONSE,{message:o,fatal:!0})),new od(o,a)}return this._transport.state="authenticated",null==(o=null==(a=this._options.callbacks)?void 0:a.onBotStarted)||o.call(a,s),s})}connect(e){return d(this,null,function*(){return e&&Rd(e)?(Ld.warn("Calling connect with an API endpoint is deprecated. Use startBotAndConnect() instead."),this.startBotAndConnect(e)):new Promise((t,n)=>{(()=>{d(this,null,function*(){this._connectResolve=t,"disconnected"===this._transport.state&&(yield this._transport.initDevices());try{yield this._transport.connect(e),yield this._transport.sendReadyMessage()}catch(dr){return this.disconnect(),void n(dr)}})})()})})}startBotAndConnect(e){return d(this,null,function*(){"disconnected"===this._transport.state&&(yield this._transport.initDevices());const t=yield this.startBot(e);return this.connect(t)})}disconnect(){return d(this,null,function*(){yield this._transport.disconnect(),this._messageDispatcher.disconnect()})}_initialize(){this._transport.initialize(this._options,this.handleMessage.bind(this)),this._messageDispatcher=new jd(this._transport.sendMessage.bind(this._transport))}get connected(){return["connected","ready"].includes(this._transport.state)}get transport(){return this._transportWrapper.proxy}get state(){return this._transport.state}get version(){return Gu(Xu).version}getAllMics(){return d(this,null,function*(){return yield this._transport.getAllMics()})}getAllCams(){return d(this,null,function*(){return yield this._transport.getAllCams()})}getAllSpeakers(){return d(this,null,function*(){return yield this._transport.getAllSpeakers()})}get selectedMic(){return this._transport.selectedMic}get selectedCam(){return this._transport.selectedCam}get selectedSpeaker(){return this._transport.selectedSpeaker}updateMic(e){this._transport.updateMic(e)}updateCam(e){this._transport.updateCam(e)}updateSpeaker(e){this._transport.updateSpeaker(e)}enableMic(e){this._transport.enableMic(e)}get isMicEnabled(){return this._transport.isMicEnabled}enableCam(e){this._transport.enableCam(e)}get isCamEnabled(){return this._transport.isCamEnabled}tracks(){return this._transport.tracks()}enableScreenShare(e){return this._transport.enableScreenShare(e)}get isSharingScreen(){return this._transport.isSharingScreen}sendClientMessage(e,t){this._transport.sendMessage(new Cd(bd.CLIENT_MESSAGE,{t:e,d:t}))}sendClientRequest(e,t,n){return d(this,null,function*(){const r={t:e,d:t};return(yield this._messageDispatcher.dispatch(r,bd.CLIENT_MESSAGE,n)).data.d})}registerFunctionCallHandler(e,t){this._functionCallCallbacks[e]=t}unregisterFunctionCallHandler(e){delete this._functionCallCallbacks[e]}unregisterAllFunctionCallHandlers(){this._functionCallCallbacks={}}appendToContext(e){return d(this,null,function*(){return Ld.warn("appendToContext() is deprecated. Use sendText() instead."),yield this._transport.sendMessage(new Cd(bd.APPEND_TO_CONTEXT,{role:e.role,content:e.content,run_immediately:e.run_immediately})),!0})}sendText(e){return d(this,arguments,function*(e,t={}){yield this._transport.sendMessage(new Cd(bd.SEND_TEXT,{content:e,options:t}))})}disconnectBot(){this._transport.sendMessage(new Cd(bd.DISCONNECT_BOT,{}))}handleMessage(e){var t,n,r,i,a,o,s,l,c,u,d,f,p,h,m,g,v,y,b,w,k,S,_,x,C,E,T,M,P,A,O,N,L,j,I,R,F,D,B,z,U;switch(Ld.debug("[RTVI Message]",e),e.type){case bd.BOT_READY:{const i=e.data,a=i.version?i.version.split(".").map(Number):[0,0,0];Ld.debug(`[Pipecat Client] Bot is ready. Version: ${i.version}`),a[0]<1&&Ld.warn("[Pipecat Client] Bot version is less than 1.0.0, which may not be compatible with this client."),null==(t=this._connectResolve)||t.call(this,e.data),null==(r=null==(n=this._options.callbacks)?void 0:n.onBotReady)||r.call(n,e.data);break}case bd.ERROR:null==(a=null==(i=this._options.callbacks)?void 0:i.onError)||a.call(i,e);break;case bd.SERVER_RESPONSE:this._messageDispatcher.resolve(e);break;case bd.ERROR_RESPONSE:{const t=this._messageDispatcher.reject(e);null==(s=null==(o=this._options.callbacks)?void 0:o.onMessageError)||s.call(o,t);break}case bd.USER_STARTED_SPEAKING:null==(c=null==(l=this._options.callbacks)?void 0:l.onUserStartedSpeaking)||c.call(l);break;case bd.USER_STOPPED_SPEAKING:null==(d=null==(u=this._options.callbacks)?void 0:u.onUserStoppedSpeaking)||d.call(u);break;case bd.BOT_STARTED_SPEAKING:null==(p=null==(f=this._options.callbacks)?void 0:f.onBotStartedSpeaking)||p.call(f);break;case bd.BOT_STOPPED_SPEAKING:null==(m=null==(h=this._options.callbacks)?void 0:h.onBotStoppedSpeaking)||m.call(h);break;case bd.USER_TRANSCRIPTION:{const t=e.data;null==(v=null==(g=this._options.callbacks)?void 0:g.onUserTranscript)||v.call(g,t);break}case bd.BOT_OUTPUT:null==(b=null==(y=this._options.callbacks)?void 0:y.onBotOutput)||b.call(y,e.data);break;case bd.BOT_TRANSCRIPTION:null==(k=null==(w=this._options.callbacks)?void 0:w.onBotTranscript)||k.call(w,e.data);break;case bd.BOT_LLM_TEXT:null==(_=null==(S=this._options.callbacks)?void 0:S.onBotLlmText)||_.call(S,e.data);break;case bd.BOT_LLM_STARTED:null==(C=null==(x=this._options.callbacks)?void 0:x.onBotLlmStarted)||C.call(x);break;case bd.BOT_LLM_STOPPED:null==(T=null==(E=this._options.callbacks)?void 0:E.onBotLlmStopped)||T.call(E);break;case bd.BOT_TTS_TEXT:null==(P=null==(M=this._options.callbacks)?void 0:M.onBotTtsText)||P.call(M,e.data);break;case bd.BOT_TTS_STARTED:null==(O=null==(A=this._options.callbacks)?void 0:A.onBotTtsStarted)||O.call(A);break;case bd.BOT_TTS_STOPPED:null==(L=null==(N=this._options.callbacks)?void 0:N.onBotTtsStopped)||L.call(N);break;case bd.METRICS:null==(I=null==(j=this._options.callbacks)?void 0:j.onMetrics)||I.call(j,e.data),this.emit(pd.Metrics,e.data);break;case bd.SERVER_MESSAGE:null==(F=null==(R=this._options.callbacks)?void 0:R.onServerMessage)||F.call(R,e.data),this.emit(pd.ServerMessage,e.data);break;case bd.LLM_FUNCTION_CALL:{const t=e.data,n=this._functionCallCallbacks[t.function_name];if(n){n({functionName:t.function_name,arguments:t.args}).then(e=>{null!=e&&this._transport.sendMessage(new Cd(bd.LLM_FUNCTION_CALL_RESULT,{function_name:t.function_name,tool_call_id:t.tool_call_id,arguments:t.args,result:e}))})}null==(B=null==(D=this._options.callbacks)?void 0:D.onLLMFunctionCall)||B.call(D,t),this.emit(pd.LLMFunctionCall,t);break}case bd.BOT_LLM_SEARCH_RESPONSE:{const t=e.data;null==(U=null==(z=this._options.callbacks)?void 0:z.onBotLlmSearchResponse)||U.call(z,t),this.emit(pd.BotLlmSearchResponse,t);break}default:Ld.debug("[Pipecat Client] Unrecognized message type",e.type)}}}function Hd(e){return e&&e.__esModule?e.default:e}function Jd(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}$d([Td],qd.prototype,"startBot",null),$d([Td],qd.prototype,"connect",null),$d([Td],qd.prototype,"startBotAndConnect",null),$d([Ed],qd.prototype,"sendClientMessage",null),$d([Ed],qd.prototype,"sendClientRequest",null),$d([Ed],qd.prototype,"appendToContext",null),$d([Ed],qd.prototype,"sendText",null),$d([Ed],qd.prototype,"disconnectBot",null),Ju(Yu,Ku),Ju(Yu,Md),Ju(Yu,Od),Ju(Yu,Id),Ju(Yu,Dd),Ju(Yu,Ud);var Gd={};Jd(Gd,"DailyRTVIMessageType",()=>df),Jd(Gd,"DailyTransport",()=>hf);class Qd{static floatTo16BitPCM(e){const t=new ArrayBuffer(2*e.length),n=new DataView(t);let r=0;for(let i=0;i<e.length;i++,r+=2){let t=Math.max(-1,Math.min(1,e[i]));n.setInt16(r,t<0?32768*t:32767*t,!0)}return t}static mergeBuffers(e,t){const n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer}_packData(e,t){return[new Uint8Array([t,t>>8]),new Uint8Array([t,t>>8,t>>16,t>>24])][e]}pack(e,t){if(!(null==t?void 0:t.bitsPerSample))throw new Error('Missing "bitsPerSample"');if(!(null==t?void 0:t.channels))throw new Error('Missing "channels"');if(!(null==t?void 0:t.data))throw new Error('Missing "data"');const{bitsPerSample:n,channels:r,data:i}=t,a=["RIFF",this._packData(1,52),"WAVE","fmt ",this._packData(1,16),this._packData(0,1),this._packData(0,r.length),this._packData(1,e),this._packData(1,e*r.length*n/8),this._packData(0,r.length*n/8),this._packData(0,n),"data",this._packData(1,r[0].length*r.length*n/8),i],o=new Blob(a,{type:"audio/mpeg"});return{blob:o,url:URL.createObjectURL(o),channelCount:r.length,sampleRate:e,duration:i.byteLength/(r.length*e*2)}}}globalThis.WavPacker=Qd;const Yd=[4186.01,4434.92,4698.63,4978.03,5274.04,5587.65,5919.91,6271.93,6644.88,7040,7458.62,7902.13],Kd=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],Xd=[],Zd=[];for(let Ef=1;Ef<=8;Ef++)for(let e=0;e<Yd.length;e++){const t=Yd[e];Xd.push(t/Math.pow(2,8-Ef)),Zd.push(Kd[e]+Ef)}const ef=[32,2e3],tf=Xd.filter((e,t)=>Xd[t]>ef[0]&&Xd[t]<ef[1]),nf=Zd.filter((e,t)=>Xd[t]>ef[0]&&Xd[t]<ef[1]);class rf{static getFrequencies(e,t,n,r="frequency",i=-100,a=-30){n||(n=new Float32Array(e.frequencyBinCount),e.getFloatFrequencyData(n));const o=t/2,s=1/n.length*o;let l,c,u;if("music"===r||"voice"===r){const e="voice"===r?tf:Xd,t=Array(e.length).fill(i);for(let r=0;r<n.length;r++){const i=r*s,a=n[r];for(let n=e.length-1;n>=0;n--)if(i>e[n]){t[n]=Math.max(t[n],a);break}}l=t,c="voice"===r?tf:Xd,u="voice"===r?nf:Zd}else l=Array.from(n),c=l.map((e,t)=>s*t),u=c.map(e=>`${e.toFixed(2)} Hz`);const d=l.map(e=>Math.max(0,Math.min((e-i)/(a-i),1)));return{values:new Float32Array(d),frequencies:c,labels:u}}constructor(e,t=null){if(this.fftResults=[],t){const{length:n,sampleRate:r}=t,i=new OfflineAudioContext({length:n,sampleRate:r}),a=i.createBufferSource();a.buffer=t;const o=i.createAnalyser();o.fftSize=8192,o.smoothingTimeConstant=.1,a.connect(o);const s=1/60,l=n/r,c=e=>{const t=s*e;t<l&&i.suspend(t).then(()=>{const t=new Float32Array(o.frequencyBinCount);o.getFloatFrequencyData(t),this.fftResults.push(t),c(e+1)}),1===e?i.startRendering():i.resume()};a.start(0),c(1),this.audio=e,this.context=i,this.analyser=o,this.sampleRate=r,this.audioBuffer=t}else{const t=new AudioContext,n=t.createMediaElementSource(e),r=t.createAnalyser();r.fftSize=8192,r.smoothingTimeConstant=.1,n.connect(r),r.connect(t.destination),this.audio=e,this.context=t,this.analyser=r,this.sampleRate=this.context.sampleRate,this.audioBuffer=null}}getFrequencies(e="frequency",t=-100,n=-30){let r=null;if(this.audioBuffer&&this.fftResults.length){const e=this.audio.currentTime/this.audio.duration,t=Math.min(e*this.fftResults.length|0,this.fftResults.length-1);r=this.fftResults[t]}return rf.getFrequencies(this.analyser,this.sampleRate,r,e,t,n)}resumeIfSuspended(){return d(this,null,function*(){return"suspended"===this.context.state&&(yield this.context.resume()),!0})}}globalThis.AudioAnalysis=rf;const af=new Blob(["\nclass StreamProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.hasStarted = false;\n this.hasInterrupted = false;\n this.outputBuffers = [];\n this.bufferLength = 128;\n this.write = { buffer: new Float32Array(this.bufferLength), trackId: null };\n this.writeOffset = 0;\n this.trackSampleOffsets = {};\n this.port.onmessage = (event) => {\n if (event.data) {\n const payload = event.data;\n if (payload.event === 'write') {\n const int16Array = payload.buffer;\n const float32Array = new Float32Array(int16Array.length);\n for (let i = 0; i < int16Array.length; i++) {\n float32Array[i] = int16Array[i] / 0x8000; // Convert Int16 to Float32\n }\n this.writeData(float32Array, payload.trackId);\n } else if (\n payload.event === 'offset' ||\n payload.event === 'interrupt'\n ) {\n const requestId = payload.requestId;\n const trackId = this.write.trackId;\n const offset = this.trackSampleOffsets[trackId] || 0;\n this.port.postMessage({\n event: 'offset',\n requestId,\n trackId,\n offset,\n });\n if (payload.event === 'interrupt') {\n this.hasInterrupted = true;\n }\n } else {\n throw new Error(`Unhandled event \"${payload.event}\"`);\n }\n }\n };\n }\n\n writeData(float32Array, trackId = null) {\n let { buffer } = this.write;\n let offset = this.writeOffset;\n for (let i = 0; i < float32Array.length; i++) {\n buffer[offset++] = float32Array[i];\n if (offset >= buffer.length) {\n this.outputBuffers.push(this.write);\n this.write = { buffer: new Float32Array(this.bufferLength), trackId };\n buffer = this.write.buffer;\n offset = 0;\n }\n }\n this.writeOffset = offset;\n return true;\n }\n\n process(inputs, outputs, parameters) {\n const output = outputs[0];\n const outputChannelData = output[0];\n const outputBuffers = this.outputBuffers;\n if (this.hasInterrupted) {\n this.port.postMessage({ event: 'stop' });\n return false;\n } else if (outputBuffers.length) {\n this.hasStarted = true;\n const { buffer, trackId } = outputBuffers.shift();\n for (let i = 0; i < outputChannelData.length; i++) {\n outputChannelData[i] = buffer[i] || 0;\n }\n if (trackId) {\n this.trackSampleOffsets[trackId] =\n this.trackSampleOffsets[trackId] || 0;\n this.trackSampleOffsets[trackId] += buffer.length;\n }\n return true;\n } else if (this.hasStarted) {\n this.port.postMessage({ event: 'stop' });\n return false;\n } else {\n return true;\n }\n }\n}\n\nregisterProcessor('stream_processor', StreamProcessor);\n"],{type:"application/javascript"}),of=URL.createObjectURL(af);globalThis.WavStreamPlayer=class{constructor({sampleRate:e=44100}={}){this.scriptSrc=of,this.sampleRate=e,this.context=null,this.stream=null,this.analyser=null,this.trackSampleOffsets={},this.interruptedTrackIds={}}connect(){return d(this,null,function*(){this.context=new AudioContext({sampleRate:this.sampleRate}),this._speakerID&&this.context.setSinkId(this._speakerID),"suspended"===this.context.state&&(yield this.context.resume());try{yield this.context.audioWorklet.addModule(this.scriptSrc)}catch(dr){throw console.error(dr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const e=this.context.createAnalyser();return e.fftSize=8192,e.smoothingTimeConstant=.1,this.analyser=e,!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.analyser)throw new Error("Not connected, please call .connect() first");return rf.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}updateSpeaker(e){return d(this,null,function*(){const t=this._speakerID;if(this._speakerID=e,this.context)try{"default"===e?yield this.context.setSinkId():yield this.context.setSinkId(e)}catch(dr){console.error(`Could not set sinkId to ${e}: ${dr}`),this._speakerID=t}})}_start(){const e=new AudioWorkletNode(this.context,"stream_processor");return e.connect(this.context.destination),e.port.onmessage=t=>{const{event:n}=t.data;if("stop"===n)e.disconnect(),this.stream=null;else if("offset"===n){const{requestId:e,trackId:n,offset:r}=t.data,i=r/this.sampleRate;this.trackSampleOffsets[e]={trackId:n,offset:r,currentTime:i}}},this.analyser.disconnect(),e.connect(this.analyser),this.stream=e,!0}add16BitPCM(e,t="default"){if("string"!=typeof t)throw new Error("trackId must be a string");if(this.interruptedTrackIds[t])return;let n;if(this.stream||this._start(),e instanceof Int16Array)n=e;else{if(!(e instanceof ArrayBuffer))throw new Error("argument must be Int16Array or ArrayBuffer");n=new Int16Array(e)}return this.stream.port.postMessage({event:"write",buffer:n,trackId:t}),n}getTrackSampleOffset(e=!1){return d(this,null,function*(){if(!this.stream)return null;const t=crypto.randomUUID();let n;for(this.stream.port.postMessage({event:e?"interrupt":"offset",requestId:t});!n;)n=this.trackSampleOffsets[t],yield new Promise(e=>setTimeout(()=>e(),1));const{trackId:r}=n;return e&&r&&(this.interruptedTrackIds[r]=!0),n})}interrupt(){return d(this,null,function*(){return this.getTrackSampleOffset(!0)})}};const sf=new Blob(["\nclass AudioProcessor extends AudioWorkletProcessor {\n\n constructor() {\n super();\n this.port.onmessage = this.receive.bind(this);\n this.initialize();\n }\n\n initialize() {\n this.foundAudio = false;\n this.recording = false;\n this.chunks = [];\n }\n\n /**\n * Concatenates sampled chunks into channels\n * Format is chunk[Left[], Right[]]\n */\n readChannelData(chunks, channel = -1, maxChannels = 9) {\n let channelLimit;\n if (channel !== -1) {\n if (chunks[0] && chunks[0].length - 1 < channel) {\n throw new Error(\n `Channel ${channel} out of range: max ${chunks[0].length}`\n );\n }\n channelLimit = channel + 1;\n } else {\n channel = 0;\n channelLimit = Math.min(chunks[0] ? chunks[0].length : 1, maxChannels);\n }\n const channels = [];\n for (let n = channel; n < channelLimit; n++) {\n const length = chunks.reduce((sum, chunk) => {\n return sum + chunk[n].length;\n }, 0);\n const buffers = chunks.map((chunk) => chunk[n]);\n const result = new Float32Array(length);\n let offset = 0;\n for (let i = 0; i < buffers.length; i++) {\n result.set(buffers[i], offset);\n offset += buffers[i].length;\n }\n channels[n] = result;\n }\n return channels;\n }\n\n /**\n * Combines parallel audio data into correct format,\n * channels[Left[], Right[]] to float32Array[LRLRLRLR...]\n */\n formatAudioData(channels) {\n if (channels.length === 1) {\n // Simple case is only one channel\n const float32Array = channels[0].slice();\n const meanValues = channels[0].slice();\n return { float32Array, meanValues };\n } else {\n const float32Array = new Float32Array(\n channels[0].length * channels.length\n );\n const meanValues = new Float32Array(channels[0].length);\n for (let i = 0; i < channels[0].length; i++) {\n const offset = i * channels.length;\n let meanValue = 0;\n for (let n = 0; n < channels.length; n++) {\n float32Array[offset + n] = channels[n][i];\n meanValue += channels[n][i];\n }\n meanValues[i] = meanValue / channels.length;\n }\n return { float32Array, meanValues };\n }\n }\n\n /**\n * Converts 32-bit float data to 16-bit integers\n */\n floatTo16BitPCM(float32Array) {\n const buffer = new ArrayBuffer(float32Array.length * 2);\n const view = new DataView(buffer);\n let offset = 0;\n for (let i = 0; i < float32Array.length; i++, offset += 2) {\n let s = Math.max(-1, Math.min(1, float32Array[i]));\n view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true);\n }\n return buffer;\n }\n\n /**\n * Retrieves the most recent amplitude values from the audio stream\n * @param {number} channel\n */\n getValues(channel = -1) {\n const channels = this.readChannelData(this.chunks, channel);\n const { meanValues } = this.formatAudioData(channels);\n return { meanValues, channels };\n }\n\n /**\n * Exports chunks as an audio/wav file\n */\n export() {\n const channels = this.readChannelData(this.chunks);\n const { float32Array, meanValues } = this.formatAudioData(channels);\n const audioData = this.floatTo16BitPCM(float32Array);\n return {\n meanValues: meanValues,\n audio: {\n bitsPerSample: 16,\n channels: channels,\n data: audioData,\n },\n };\n }\n\n receive(e) {\n const { event, id } = e.data;\n let receiptData = {};\n switch (event) {\n case 'start':\n this.recording = true;\n break;\n case 'stop':\n this.recording = false;\n break;\n case 'clear':\n this.initialize();\n break;\n case 'export':\n receiptData = this.export();\n break;\n case 'read':\n receiptData = this.getValues();\n break;\n default:\n break;\n }\n // Always send back receipt\n this.port.postMessage({ event: 'receipt', id, data: receiptData });\n }\n\n sendChunk(chunk) {\n const channels = this.readChannelData([chunk]);\n const { float32Array, meanValues } = this.formatAudioData(channels);\n const rawAudioData = this.floatTo16BitPCM(float32Array);\n const monoAudioData = this.floatTo16BitPCM(meanValues);\n this.port.postMessage({\n event: 'chunk',\n data: {\n mono: monoAudioData,\n raw: rawAudioData,\n },\n });\n }\n\n process(inputList, outputList, parameters) {\n // Copy input to output (e.g. speakers)\n // Note that this creates choppy sounds with Mac products\n const sourceLimit = Math.min(inputList.length, outputList.length);\n for (let inputNum = 0; inputNum < sourceLimit; inputNum++) {\n const input = inputList[inputNum];\n const output = outputList[inputNum];\n const channelCount = Math.min(input.length, output.length);\n for (let channelNum = 0; channelNum < channelCount; channelNum++) {\n input[channelNum].forEach((sample, i) => {\n output[channelNum][i] = sample;\n });\n }\n }\n const inputs = inputList[0];\n // There's latency at the beginning of a stream before recording starts\n // Make sure we actually receive audio data before we start storing chunks\n let sliceIndex = 0;\n if (!this.foundAudio) {\n for (const channel of inputs) {\n sliceIndex = 0; // reset for each channel\n if (this.foundAudio) {\n break;\n }\n if (channel) {\n for (const value of channel) {\n if (value !== 0) {\n // find only one non-zero entry in any channel\n this.foundAudio = true;\n break;\n } else {\n sliceIndex++;\n }\n }\n }\n }\n }\n if (inputs && inputs[0] && this.foundAudio && this.recording) {\n // We need to copy the TypedArray, because the `process`\n // internals will reuse the same buffer to hold each input\n const chunk = inputs.map((input) => input.slice(sliceIndex));\n this.chunks.push(chunk);\n this.sendChunk(chunk);\n }\n return true;\n }\n}\n\nregisterProcessor('audio_processor', AudioProcessor);\n"],{type:"application/javascript"}),lf=URL.createObjectURL(sf);globalThis.WavRecorder=class{constructor({sampleRate:e=44100,outputToSpeakers:t=!1,debug:n=!1}={}){this.scriptSrc=lf,this.sampleRate=e,this.outputToSpeakers=t,this.debug=!!n,this._deviceChangeCallback=null,this._deviceErrorCallback=null,this._devices=[],this.deviceSelection=null,this.stream=null,this.processor=null,this.source=null,this.node=null,this.recording=!1,this._lastEventId=0,this.eventReceipts={},this.eventTimeout=5e3,this._chunkProcessor=()=>{},this._chunkProcessorSize=void 0,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)}}static decode(e,t=44100,n=-1){return d(this,null,function*(){const r=new AudioContext({sampleRate:t});let i,a;if(e instanceof Blob){if(-1!==n)throw new Error('Can not specify "fromSampleRate" when reading from Blob');a=e,i=yield a.arrayBuffer()}else if(e instanceof ArrayBuffer){if(-1!==n)throw new Error('Can not specify "fromSampleRate" when reading from ArrayBuffer');i=e,a=new Blob([i],{type:"audio/wav"})}else{let t,r;if(e instanceof Int16Array){r=e,t=new Float32Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n]/32768}else if(e instanceof Float32Array)t=e;else{if(!(e instanceof Array))throw new Error('"audioData" must be one of: Blob, Float32Arrray, Int16Array, ArrayBuffer, Array<number>');t=new Float32Array(e)}if(-1===n)throw new Error('Must specify "fromSampleRate" when reading from Float32Array, In16Array or Array');if(n<3e3)throw new Error('Minimum "fromSampleRate" is 3000 (3kHz)');r||(r=Qd.floatTo16BitPCM(t));const o={bitsPerSample:16,channels:[t],data:r};a=(new Qd).pack(n,o).blob,i=yield a.arrayBuffer()}const o=yield r.decodeAudioData(i),s=o.getChannelData(0);return{blob:a,url:URL.createObjectURL(a),values:s,audioBuffer:o}})}log(){return this.debug&&this.log(...arguments),!0}getSampleRate(){return this.sampleRate}getStatus(){return this.processor?this.recording?"recording":"paused":"ended"}_event(e){return d(this,arguments,function*(e,t={},n=null){if(!(n=n||this.processor))throw new Error("Can not send events without recording first");const r={event:e,id:this._lastEventId++,data:t};n.port.postMessage(r);const i=(new Date).valueOf();for(;!this.eventReceipts[r.id];){if((new Date).valueOf()-i>this.eventTimeout)throw new Error(`Timeout waiting for "${e}" event`);yield new Promise(e=>setTimeout(()=>e(!0),1))}const a=this.eventReceipts[r.id];return delete this.eventReceipts[r.id],a})}listenForDeviceChange(e){if(null===e&&this._deviceChangeCallback)navigator.mediaDevices.removeEventListener("devicechange",this._deviceChangeCallback),this._deviceChangeCallback=null;else if(null!==e){let t=0,n=[];const r=e=>e.map(e=>e.deviceId).sort().join(","),i=()=>d(this,null,function*(){let i=++t;const a=yield this.listDevices();i===t&&r(n)!==r(a)&&(n=a,e(a.slice()))});navigator.mediaDevices.addEventListener("devicechange",i),i(),this._deviceChangeCallback=i}return!0}listenForDeviceErrors(e){this._deviceErrorCallback=e}requestPermission(){return d(this,null,function*(){const e=yield navigator.permissions.query({name:"microphone"});if("denied"===e.state)this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:new Error("Microphone access denied")});else if("prompt"===e.state)try{const e=yield navigator.mediaDevices.getUserMedia({audio:!0});e.getTracks().forEach(e=>e.stop())}catch(dr){console.error("Error accessing microphone."),this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:dr})}return!0})}listDevices(){return d(this,null,function*(){if(!navigator.mediaDevices||!("enumerateDevices"in navigator.mediaDevices))throw new Error("Could not request user devices");yield this.requestPermission();return(yield navigator.mediaDevices.enumerateDevices()).filter(e=>"audioinput"===e.kind)})}begin(e){return d(this,null,function*(){var t;if(this.processor)throw new Error("Already connected: please call .end() to start a new session");if(!navigator.mediaDevices||!("getUserMedia"in navigator.mediaDevices))throw this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic","cam"],type:"undefined-mediadevices"}),new Error("Could not request user media");e=null!=e?e:null==(t=this.deviceSelection)?void 0:t.deviceId;try{const t={audio:!0};e&&(t.audio={deviceId:{exact:e}}),this.stream=yield navigator.mediaDevices.getUserMedia(t)}catch(s){throw this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:s}),new Error("Could not start media stream")}this.listDevices().then(t=>{e=this.stream.getAudioTracks()[0].getSettings().deviceId,console.log("find current device",t,e,this.stream.getAudioTracks()[0].getSettings()),this.deviceSelection=t.find(t=>t.deviceId===e),console.log("current device",this.deviceSelection)});const n=new AudioContext({sampleRate:this.sampleRate}),r=n.createMediaStreamSource(this.stream);try{yield n.audioWorklet.addModule(this.scriptSrc)}catch(dr){throw console.error(dr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const i=new AudioWorkletNode(n,"audio_processor");i.port.onmessage=e=>{const{event:t,id:n,data:r}=e.data;if("receipt"===t)this.eventReceipts[n]=r;else if("chunk"===t)if(this._chunkProcessorSize){const e=this._chunkProcessorBuffer;this._chunkProcessorBuffer={raw:Qd.mergeBuffers(e.raw,r.raw),mono:Qd.mergeBuffers(e.mono,r.mono)},this._chunkProcessorBuffer.mono.byteLength>=this._chunkProcessorSize&&(this._chunkProcessor(this._chunkProcessorBuffer),this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)})}else this._chunkProcessor(r)};const a=r.connect(i),o=n.createAnalyser();return o.fftSize=8192,o.smoothingTimeConstant=.1,a.connect(o),this.outputToSpeakers&&(console.warn("Warning: Output to speakers may affect sound quality,\nespecially due to system audio feedback preventative measures.\nuse only for debugging"),o.connect(n.destination)),this.source=r,this.node=a,this.analyser=o,this.processor=i,console.log("begin completed"),!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.processor)throw new Error("Session ended: please call .begin() first");return rf.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}pause(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!this.recording)throw new Error("Already paused: please call .record() first");return this._chunkProcessorBuffer.raw.byteLength&&this._chunkProcessor(this._chunkProcessorBuffer),this.log("Pausing ..."),yield this._event("stop"),this.recording=!1,!0})}record(e=()=>{},t=8192){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(this.recording)throw new Error("Already recording: please call .pause() first");if("function"!=typeof e)throw new Error("chunkProcessor must be a function");return this._chunkProcessor=e,this._chunkProcessorSize=t,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)},this.log("Recording ..."),yield this._event("start"),this.recording=!0,!0})}clear(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");return yield this._event("clear"),!0})}read(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");this.log("Reading ...");return yield this._event("read")})}save(e=!1){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!e&&this.recording)throw new Error("Currently recording: please call .pause() first, or call .save(true) to force");this.log("Exporting ...");const t=yield this._event("export");return(new Qd).pack(this.sampleRate,t.audio)})}end(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");const e=this.processor;this.log("Stopping ..."),yield this._event("stop"),this.recording=!1;this.stream.getTracks().forEach(e=>e.stop()),this.log("Exporting ...");const t=yield this._event("export",{},e);this.processor.disconnect(),this.source.disconnect(),this.node.disconnect(),this.analyser.disconnect(),this.stream=null,this.processor=null,this.source=null,this.node=null;return(new Qd).pack(this.sampleRate,t.audio)})}quit(){return d(this,null,function*(){return this.listenForDeviceChange(null),this.deviceSelection=null,this.processor&&(yield this.end()),!0})}};class cf{constructor({sampleRate:e=44100,outputToSpeakers:t=!1,debug:n=!1}={}){this.scriptSrc=lf,this.sampleRate=e,this.outputToSpeakers=t,this.debug=!!n,this.stream=null,this.processor=null,this.source=null,this.node=null,this.recording=!1,this._lastEventId=0,this.eventReceipts={},this.eventTimeout=5e3,this._chunkProcessor=()=>{},this._chunkProcessorSize=void 0,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)}}log(){return this.debug&&this.log(...arguments),!0}getSampleRate(){return this.sampleRate}getStatus(){return this.processor?this.recording?"recording":"paused":"ended"}_event(e){return d(this,arguments,function*(e,t={},n=null){if(!(n=n||this.processor))throw new Error("Can not send events without recording first");const r={event:e,id:this._lastEventId++,data:t};n.port.postMessage(r);const i=(new Date).valueOf();for(;!this.eventReceipts[r.id];){if((new Date).valueOf()-i>this.eventTimeout)throw new Error(`Timeout waiting for "${e}" event`);yield new Promise(e=>setTimeout(()=>e(!0),1))}const a=this.eventReceipts[r.id];return delete this.eventReceipts[r.id],a})}begin(e){return d(this,null,function*(){if(this.processor)throw new Error("Already connected: please call .end() to start a new session");if(!e||"audio"!==e.kind)throw new Error("No audio track provided");this.stream=new MediaStream([e]);const t=new AudioContext({sampleRate:this.sampleRate}),n=t.createMediaStreamSource(this.stream);try{yield t.audioWorklet.addModule(this.scriptSrc)}catch(dr){throw console.error(dr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const r=new AudioWorkletNode(t,"audio_processor");r.port.onmessage=e=>{const{event:t,id:n,data:r}=e.data;if("receipt"===t)this.eventReceipts[n]=r;else if("chunk"===t)if(this._chunkProcessorSize){const e=this._chunkProcessorBuffer;this._chunkProcessorBuffer={raw:Qd.mergeBuffers(e.raw,r.raw),mono:Qd.mergeBuffers(e.mono,r.mono)},this._chunkProcessorBuffer.mono.byteLength>=this._chunkProcessorSize&&(this._chunkProcessor(this._chunkProcessorBuffer),this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)})}else this._chunkProcessor(r)};const i=n.connect(r),a=t.createAnalyser();return a.fftSize=8192,a.smoothingTimeConstant=.1,i.connect(a),this.outputToSpeakers&&(console.warn("Warning: Output to speakers may affect sound quality,\nespecially due to system audio feedback preventative measures.\nuse only for debugging"),a.connect(t.destination)),this.source=n,this.node=i,this.analyser=a,this.processor=r,!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.processor)throw new Error("Session ended: please call .begin() first");return rf.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}pause(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!this.recording)throw new Error("Already paused: please call .record() first");return this._chunkProcessorBuffer.raw.byteLength&&this._chunkProcessor(this._chunkProcessorBuffer),this.log("Pausing ..."),yield this._event("stop"),this.recording=!1,!0})}record(e=()=>{},t=8192){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(this.recording)throw new Error("Already recording: HELLO please call .pause() first");if("function"!=typeof e)throw new Error("chunkProcessor must be a function");return this._chunkProcessor=e,this._chunkProcessorSize=t,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)},this.log("Recording ..."),yield this._event("start"),this.recording=!0,!0})}clear(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");return yield this._event("clear"),!0})}read(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");this.log("Reading ...");return yield this._event("read")})}save(e=!1){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!e&&this.recording)throw new Error("Currently recording: please call .pause() first, or call .save(true) to force");this.log("Exporting ...");const t=yield this._event("export");return(new Qd).pack(this.sampleRate,t.audio)})}end(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");const e=this.processor;this.log("Stopping ..."),yield this._event("stop"),this.recording=!1,this.log("Exporting ...");const t=yield this._event("export",{},e);this.processor.disconnect(),this.source.disconnect(),this.node.disconnect(),this.analyser.disconnect(),this.stream=null,this.processor=null,this.source=null,this.node=null;return(new Qd).pack(this.sampleRate,t.audio)})}quit(){return d(this,null,function*(){return this.listenForDeviceChange(null),this.processor&&(yield this.end()),!0})}}globalThis.WavRecorder=WavRecorder;var uf,df,ff;uf=JSON.parse('{"name":"@pipecat-ai/daily-transport","version":"1.5.0","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/pipecat-ai/pipecat-client-web-transports.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"parcel build --no-cache","dev":"parcel watch","lint":"eslint . --ext ts --report-unused-disable-directives --max-warnings 0"},"devDependencies":{"@pipecat-ai/client-js":"^1.5.0","eslint":"9.39.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"@pipecat-ai/client-js":"~1.5.0"},"dependencies":{"@daily-co/daily-js":"^0.84.0"},"description":"Pipecat Daily Transport Package","author":"Daily.co","bugs":{"url":"https://github.com/pipecat-ai/pipecat-client-web-transports/issues"},"homepage":"https://github.com/pipecat-ai/pipecat-client-web-transports/blob/main/transports/daily-webrtc/README.md"}'),(ff=df||(df={})).AUDIO_BUFFERING_STARTED="audio-buffering-started",ff.AUDIO_BUFFERING_STOPPED="audio-buffering-stopped";class pf{constructor(e){this._daily=e,this._proxy=new Proxy(this._daily,{get:(e,t,n)=>{if("function"==typeof e[t]){let n;switch(String(t)){case"preAuth":n="Calls to preAuth() are disabled. Please use Transport.preAuth()";break;case"startCamera":n="Calls to startCamera() are disabled. Please use PipecatClient.initDevices()";break;case"join":n="Calls to join() are disabled. Please use PipecatClient.connect()";break;case"leave":n="Calls to leave() are disabled. Please use PipecatClient.disconnect()";break;case"destroy":n="Calls to destroy() are disabled."}return n?()=>{throw new Error(n)}:(...n)=>e[t](...n)}return Reflect.get(e,t,n)}})}get proxy(){return this._proxy}}class hf extends Bd{constructor(e={}){var t;super(),this._botId="",this._selectedCam={},this._selectedMic={},this._selectedSpeaker={},this._currentAudioTrack=null,this._audioQueue=[],this._callbacks={};const n=e,{bufferLocalAudioUntilBotReady:r}=n,i=u(n,["bufferLocalAudioUntilBotReady"]);this._dailyFactoryOptions=i,void 0===(null==(t=this._dailyFactoryOptions.dailyConfig)?void 0:t.useDevicePreferenceCookies)&&(null==this._dailyFactoryOptions.dailyConfig&&(this._dailyFactoryOptions.dailyConfig={}),this._dailyFactoryOptions.dailyConfig.useDevicePreferenceCookies=!0),this._bufferLocalAudioUntilBotReady=r||!1,this._daily=Gc.createCallObject(c(l({},this._dailyFactoryOptions),{allowMultipleCallInstances:!0})),this._dailyWrapper=new pf(this._daily)}setupRecorder(){this._mediaStreamRecorder=new cf({sampleRate:hf.RECORDER_SAMPLE_RATE})}handleUserAudioStream(e){this._audioQueue.push(e)}flushAudioQueue(){if(0!==this._audioQueue.length)for(Ld.debug(`Will flush audio queue: ${this._audioQueue.length}`);this._audioQueue.length>0;){const e=[];for(;e.length<10&&this._audioQueue.length>0;){const t=this._audioQueue.shift();t&&e.push(t)}e.length>0&&this._sendAudioBatch(e)}}_sendAudioBatch(e){const t={id:"raw-audio-batch",label:"rtvi-ai",type:"raw-audio-batch",data:{base64AudioBatch:e.map(e=>{const t=new Uint8Array(e);return btoa(String.fromCharCode(...t))}),sampleRate:hf.RECORDER_SAMPLE_RATE,numChannels:1}};this.sendMessage(t)}initialize(e,t){var n,r,i;this._bufferLocalAudioUntilBotReady&&this.setupRecorder(),this._callbacks=null!=(n=e.callbacks)?n:{},this._onMessage=t,null!=this._dailyFactoryOptions.startVideoOff&&null==e.enableCam||(this._dailyFactoryOptions.startVideoOff=!(null!=(r=e.enableCam)&&r)),null!=this._dailyFactoryOptions.startAudioOff&&null==e.enableMic||(this._dailyFactoryOptions.startAudioOff=!(null==(i=e.enableMic)||i)),this.attachEventListeners(),this.state="disconnected",Ld.debug("[Daily Transport] Initialized",Hd(uf).version)}get dailyCallClient(){return this._dailyWrapper.proxy}get state(){return this._state}set state(e){var t,n;this._state!==e&&(this._state=e,null==(n=(t=this._callbacks).onTransportStateChanged)||n.call(t,e))}getSessionInfo(){return this._daily.meetingSessionSummary()}getAllCams(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"videoinput"===e.kind)})}updateCam(e){this._daily.setInputDevicesAsync({videoDeviceId:e}).then(e=>{this._selectedCam=e.camera})}get selectedCam(){return this._selectedCam}getAllMics(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"audioinput"===e.kind)})}updateMic(e){this._daily.setInputDevicesAsync({audioDeviceId:e}).then(e=>{this._selectedMic=e.mic})}get selectedMic(){return this._selectedMic}getAllSpeakers(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"audiooutput"===e.kind)})}updateSpeaker(e){this._daily.setOutputDeviceAsync({outputDeviceId:e}).then(e=>{this._selectedSpeaker=e.speaker}).catch(e=>{var t,n,r;null==(r=(n=this._callbacks).onDeviceError)||r.call(n,new fd(["speaker"],null!=(t=e.type)?t:"unknown",e.message))})}get selectedSpeaker(){return this._selectedSpeaker}enableMic(e){this._daily.setLocalAudio(e)}get isMicEnabled(){return this._daily.localAudio()}enableCam(e){this._daily.setLocalVideo(e)}get isCamEnabled(){return this._daily.localVideo()}enableScreenShare(e){e?this._daily.startScreenShare():this._daily.stopScreenShare()}get isSharingScreen(){return this._daily.localScreenAudio()||this._daily.localScreenVideo()}tracks(){var e,t,n,r,i,a,o,s,l,c,u,d,f,p,h,m,g;const v=null!=(e=this._daily.participants())?e:{},y=null==v?void 0:v[this._botId],b={local:{audio:null==(r=null==(n=null==(t=null==v?void 0:v.local)?void 0:t.tracks)?void 0:n.audio)?void 0:r.persistentTrack,screenAudio:null==(o=null==(a=null==(i=null==v?void 0:v.local)?void 0:i.tracks)?void 0:a.screenAudio)?void 0:o.persistentTrack,screenVideo:null==(c=null==(l=null==(s=null==v?void 0:v.local)?void 0:s.tracks)?void 0:l.screenVideo)?void 0:c.persistentTrack,video:null==(f=null==(d=null==(u=null==v?void 0:v.local)?void 0:u.tracks)?void 0:d.video)?void 0:f.persistentTrack}};return y&&(b.bot={audio:null==(h=null==(p=null==y?void 0:y.tracks)?void 0:p.audio)?void 0:h.persistentTrack,video:null==(g=null==(m=null==y?void 0:y.tracks)?void 0:m.video)?void 0:g.persistentTrack}),b}startRecording(){return d(this,null,function*(){var e,t;try{Ld.info("[Daily Transport] Initializing recording"),yield this._mediaStreamRecorder.record(e=>{this.handleUserAudioStream(e.mono)},hf.RECORDER_CHUNK_SIZE),null==(t=(e=this._callbacks).onAudioBufferingStarted)||t.call(e),Ld.info("[Daily Transport] Recording Initialized")}catch(dr){dr.message.includes("Already recording")||Ld.error("Error starting recording",dr)}})}preAuth(e){return d(this,null,function*(){this._dailyFactoryOptions=e,yield this._daily.preAuth(e)})}initDevices(){return d(this,null,function*(){var e,t,n,r,i,a,o,s,l,c,u,d;if(!this._daily)throw new id("Transport instance not initialized");this.state="initializing";const f=yield this._daily.startCamera(this._dailyFactoryOptions),{devices:p}=yield this._daily.enumerateDevices(),h=p.filter(e=>"videoinput"===e.kind),m=p.filter(e=>"audioinput"===e.kind),g=p.filter(e=>"audiooutput"===e.kind);this._selectedCam=f.camera,this._selectedMic=f.mic,this._selectedSpeaker=f.speaker,null==(t=(e=this._callbacks).onAvailableCamsUpdated)||t.call(e,h),null==(r=(n=this._callbacks).onAvailableMicsUpdated)||r.call(n,m),null==(a=(i=this._callbacks).onAvailableSpeakersUpdated)||a.call(i,g),null==(s=(o=this._callbacks).onCamUpdated)||s.call(o,f.camera),null==(c=(l=this._callbacks).onMicUpdated)||c.call(l,f.mic),null==(d=(u=this._callbacks).onSpeakerUpdated)||d.call(u,f.speaker),this._daily.isLocalAudioLevelObserverRunning()||(yield this._daily.startLocalAudioLevelObserver(100)),this._daily.isRemoteParticipantsAudioLevelObserverRunning()||(yield this._daily.startRemoteParticipantsAudioLevelObserver(100)),this.state="initialized"})}_validateConnectionParams(e){if(null==e)return;if("object"!=typeof e)throw new id("Invalid connection parameters");const t=e;return t.room_url?(t.url=t.room_url,delete t.room_url):t.dailyRoom&&(t.url=t.dailyRoom,delete t.dailyRoom),t.dailyToken&&(t.token=t.dailyToken,delete t.dailyToken),t.token||delete t.token,t}_connect(e){return d(this,null,function*(){var t,n,r;if(!this._daily)throw new id("Transport instance not initialized");e&&(this._dailyFactoryOptions=l(l({},this._dailyFactoryOptions),e)),this.state="connecting";try{yield this._daily.join(this._dailyFactoryOptions)}catch(dr){throw Ld.error("Failed to join room",dr),this.state="error",new sd}(null==(t=this._abortController)?void 0:t.signal.aborted)||(this.state="connected",null==(r=(n=this._callbacks).onConnected)||r.call(n))})}sendReadyMessage(){return d(this,null,function*(){return new Promise(e=>{var t,n;const r=()=>{this.state="ready",this.flushAudioQueue(),this.sendMessage(Cd.clientReady()),this.stopRecording(),e()};for(const a in this._daily.participants()){const i=this._daily.participants()[a];if(!i.local&&(null==(n=null==(t=i.tracks)?void 0:t.audio)?void 0:n.persistentTrack))return r(),void e()}const i=e=>{var t;(null==(t=e.participant)?void 0:t.local)||(this._daily.off("track-started",i),(()=>{const e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document})()?(Ld.debug("[Daily Transport] iOS device detected, adding 0.5 second delay before sending ready message"),setTimeout(r,500)):r())};this._daily.on("track-started",i)})})}stopRecording(){var e,t;this._mediaStreamRecorder&&"ended"!==this._mediaStreamRecorder.getStatus()&&(this._mediaStreamRecorder.end(),null==(t=(e=this._callbacks).onAudioBufferingStopped)||t.call(e))}attachEventListeners(){this._daily.on("available-devices-updated",this.handleAvailableDevicesUpdated.bind(this)),this._daily.on("selected-devices-updated",this.handleSelectedDevicesUpdated.bind(this)),this._daily.on("camera-error",this.handleDeviceError.bind(this)),this._daily.on("track-started",this.handleTrackStarted.bind(this)),this._daily.on("track-stopped",this.handleTrackStopped.bind(this)),this._daily.on("participant-joined",this.handleParticipantJoined.bind(this)),this._daily.on("participant-left",this.handleParticipantLeft.bind(this)),this._daily.on("local-audio-level",this.handleLocalAudioLevel.bind(this)),this._daily.on("remote-participants-audio-level",this.handleRemoteAudioLevel.bind(this)),this._daily.on("app-message",this.handleAppMessage.bind(this)),this._daily.on("left-meeting",this.handleLeftMeeting.bind(this)),this._daily.on("error",this.handleFatalError.bind(this)),this._daily.on("nonfatal-error",this.handleNonFatalError.bind(this))}_disconnect(){return d(this,null,function*(){this.state="disconnecting",this._daily.stopLocalAudioLevelObserver(),this._daily.stopRemoteParticipantsAudioLevelObserver(),this._audioQueue=[],this._currentAudioTrack=null,this.stopRecording(),yield this._daily.leave()})}sendMessage(e){this._daily.sendAppMessage(e,"*")}handleAppMessage(e){"rtvi-ai"===e.data.label&&this._onMessage({id:e.data.id,type:e.data.type,data:e.data.data})}handleAvailableDevicesUpdated(e){var t,n,r,i,a,o;null==(n=(t=this._callbacks).onAvailableCamsUpdated)||n.call(t,e.availableDevices.filter(e=>"videoinput"===e.kind)),null==(i=(r=this._callbacks).onAvailableMicsUpdated)||i.call(r,e.availableDevices.filter(e=>"audioinput"===e.kind)),null==(o=(a=this._callbacks).onAvailableSpeakersUpdated)||o.call(a,e.availableDevices.filter(e=>"audiooutput"===e.kind))}handleSelectedDevicesUpdated(e){var t,n,r,i,a,o,s,l,c;(null==(t=this._selectedCam)?void 0:t.deviceId)!==e.devices.camera&&(this._selectedCam=e.devices.camera,null==(r=(n=this._callbacks).onCamUpdated)||r.call(n,e.devices.camera)),(null==(i=this._selectedMic)?void 0:i.deviceId)!==e.devices.mic&&(this._selectedMic=e.devices.mic,null==(o=(a=this._callbacks).onMicUpdated)||o.call(a,e.devices.mic)),(null==(s=this._selectedSpeaker)?void 0:s.deviceId)!==e.devices.speaker&&(this._selectedSpeaker=e.devices.speaker,null==(c=(l=this._callbacks).onSpeakerUpdated)||c.call(l,e.devices.speaker))}handleDeviceError(e){var t,n;null==(n=(t=this._callbacks).onDeviceError)||n.call(t,(e=>{const t=[];switch(e.type){case"permissions":return e.blockedMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new fd(t,e.type,e.msg,{blockedBy:e.blockedBy});case"not-found":return e.missingMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new fd(t,e.type,e.msg);case"constraints":return e.failedMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new fd(t,e.type,e.msg,{reason:e.reason});case"cam-in-use":return t.push("cam"),new fd(t,"in-use",e.msg);case"mic-in-use":return t.push("mic"),new fd(t,"in-use",e.msg);case"cam-mic-in-use":return t.push("cam"),t.push("mic"),new fd(t,"in-use",e.msg);default:return t.push("cam"),t.push("mic"),new fd(t,e.type,e.msg)}})(e.error))}handleLocalAudioTrack(e){return d(this,null,function*(){if("ready"==this.state||!this._bufferLocalAudioUntilBotReady)return;switch(this._mediaStreamRecorder.getStatus()){case"ended":try{yield this._mediaStreamRecorder.begin(e),yield this.startRecording()}catch(dr){}break;case"paused":yield this.startRecording();break;default:if(this._currentAudioTrack!==e)try{yield this._mediaStreamRecorder.end(),yield this._mediaStreamRecorder.begin(e),yield this.startRecording()}catch(dr){}else Ld.warn("track-started event received for current track and already recording")}this._currentAudioTrack=e})}handleTrackStarted(e){var t,n,r,i,a;"screenAudio"===e.type||"screenVideo"===e.type?null==(n=(t=this._callbacks).onScreenTrackStarted)||n.call(t,e.track,e.participant?mf(e.participant):void 0):((null==(r=e.participant)?void 0:r.local)&&"audio"===e.track.kind&&this.handleLocalAudioTrack(e.track),null==(a=(i=this._callbacks).onTrackStarted)||a.call(i,e.track,e.participant?mf(e.participant):void 0))}handleTrackStopped(e){var t,n,r,i;"screenAudio"===e.type||"screenVideo"===e.type?null==(n=(t=this._callbacks).onScreenTrackStopped)||n.call(t,e.track,e.participant?mf(e.participant):void 0):null==(i=(r=this._callbacks).onTrackStopped)||i.call(r,e.track,e.participant?mf(e.participant):void 0)}handleParticipantJoined(e){var t,n,r,i;const a=mf(e.participant);null==(n=(t=this._callbacks).onParticipantJoined)||n.call(t,a),a.local||(this._botId=e.participant.session_id,null==(i=(r=this._callbacks).onBotConnected)||i.call(r,a))}handleParticipantLeft(e){var t,n,r,i;const a=mf(e.participant);null==(n=(t=this._callbacks).onParticipantLeft)||n.call(t,a),a.local||(this._botId="",null==(i=(r=this._callbacks).onBotDisconnected)||i.call(r,a))}handleLocalAudioLevel(e){var t,n;null==(n=(t=this._callbacks).onLocalAudioLevel)||n.call(t,e.audioLevel)}handleRemoteAudioLevel(e){var t,n;const r=this._daily.participants(),i=Object.keys(e.participantsAudioLevel);for(let a=0;a<i.length;a++){const o=i[a],s=e.participantsAudioLevel[o];null==(n=(t=this._callbacks).onRemoteAudioLevel)||n.call(t,s,mf(r[o]))}}handleLeftMeeting(){var e,t;this.state="disconnected",this._botId="",null==(t=(e=this._callbacks).onDisconnected)||t.call(e)}handleFatalError(e){var t,n;Ld.error("Daily fatal error",e.errorMsg),this.state="error",this._botId="",null==(n=(t=this._callbacks).onError)||n.call(t,Cd.error(e.errorMsg,!0))}handleNonFatalError(e){var t,n;if("screen-share-error"===e.type)null==(n=(t=this._callbacks).onScreenShareError)||n.call(t,e.errorMsg)}}hf.RECORDER_SAMPLE_RATE=16e3,hf.RECORDER_CHUNK_SIZE=512;const mf=e=>({id:e.user_id,local:e.local,name:e.user_name});function gf(e,t,n={}){const{pipecatClient:r,connectionState:i,isBotReady:a,isMicEnabled:o,isUserSpeaking:s,remoteAudioStream:u,addMessage:f,setPipecatClient:p,setConnectionState:h,setIsBotReady:m,setIsMicEnabled:g,setIsUserSpeaking:v,setRemoteAudioStream:y}=H(),b=x.useRef(null),w=x.useRef(!1),k=x.useRef(null),S=x.useRef(!1);x.useEffect(()=>{const e=b.current;if(e&&u)try{G("🔊 Attaching remote audio stream"),e.srcObject=u,e.volume=1;const t=e.play();t&&t.then(()=>{G("✅ Remote audio playback started")}).catch(e=>{Y("⚠️ Autoplay prevented:",e)})}catch(t){Q("❌ Failed to attach remote audio:",t)}return()=>{e&&(e.srcObject=null)}},[u]);const _=x.useCallback(()=>d(null,null,function*(){var r;if(S.current)G("⚠️ Call start already in progress, skipping");else if("disconnected"===i){S.current=!0,h("connecting");try{if(!e||!t)throw new Error("Missing agent ID or prompt token");const r={agent_id:e,conversation_metadata:c(l({},n),{agent_id:e}),prompt_access_token:t,conversation_visibility:!1,conversation_config_type:"VOICE"};G("📡 Creating Daily session...");const i=yield function(e){return d(this,null,function*(){const t=`${K}/v1/widgets/sessions/daily`;G("📡 Creating Daily session with payload:",e);const n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Prompt-Token":e.prompt_access_token},body:JSON.stringify(e)});if(!n.ok){const e=yield n.json().catch(()=>({}));throw new Error(e.detail||e.message||`HTTP ${n.status}`)}const r=yield n.json();return G("✅ Daily session created:",r.conversation_id),r})}(r);if(!(null==i?void 0:i.dailyRoom)||!(null==i?void 0:i.dailyToken))throw new Error("Invalid response from server");const{dailyRoom:a,dailyToken:s,conversation_id:u}=i;G("✅ Daily session created:",u);const b=new qd({transport:new hf,enableMic:o,enableCam:!1,timeout:3e4,callbacks:{onTransportStateChanged:e=>{G(`🔄 Transport state: ${e}`),h(e)},onConnected:()=>{G("✅ Connected to Daily room"),f({type:"separator",text:"Voice call started"})},onBotReady:e=>{G("🚀 Bot ready!",e),m(!0),h("ready")},onBotStartedSpeaking:()=>{m(e=>e||(G("🚀 Bot speaking - marking as ready (fallback)"),h("ready"),!0))},onDisconnected:()=>{G("❌ Disconnected from Daily room"),h("disconnected"),m(!1),w.current||(G("⚠️ Unexpected disconnection"),f({type:"separator",text:"Call disconnected"}))},onTrackStarted:(e,t)=>{if("audio"===e.kind&&!(null==t?void 0:t.local)){G("🎧 Remote audio track detected");const t=new MediaStream([e]);y(t)}},onUserStartedSpeaking:()=>{G("🎤 User started speaking"),v(!0)},onUserStoppedSpeaking:()=>{G("🎤 User stopped speaking"),v(!1)},onUserTranscript:e=>{(null==e?void 0:e.final)&&(null==e?void 0:e.text)&&(G("👤 User transcript:",e.text),f({type:"user",text:e.text,isTranscript:!0}))},onBotTranscript:e=>{var t;const n=(null==(t=null==e?void 0:e.text)?void 0:t.trim())||"";n&&(G("🤖 Bot transcript:",n),f({type:"assistant",text:n,isTranscript:!0}))},onMicStateChanged:e=>{g(e)},onError:e=>{var t,n;Q("❌ PipecatClient error:",e);const r=(null==(t=null==e?void 0:e.data)?void 0:t.error)||(null==e?void 0:e.message)||"";r.includes("validation error")||r.includes("FunctionResponse")||!(null==(n=null==e?void 0:e.data)?void 0:n.fatal)?(f({type:"separator",text:"Agent disconnected"}),C()):(h("error"),f({type:"system",text:`Error: ${r}`}))}}});p(b),k.current=b,G("🎥 Initializing devices..."),yield b.initDevices(),G("🔗 Connecting to Daily room..."),yield b.connect({url:a,token:s}),G("✅ Call started successfully!")}catch(a){Q("❌ Failed to start call:",a),S.current=!1,h("error");let e="Failed to start call";e=(null==(r=a.message)?void 0:r.includes("Failed to fetch"))?"Cannot reach server":"NotAllowedError"===a.name?"Microphone access denied":"NotFoundError"===a.name?"No microphone found":a.message,f({type:"system",text:`❌ ${e}`})}}else G("⚠️ Call already in progress")}),[e,t,n,i,o,h,p,m,g,y,f]),C=x.useCallback(()=>d(null,null,function*(){var e;try{if(G("🔚 Ending call..."),f({type:"separator",text:"Voice call ended"}),w.current=!0,S.current=!1,r&&"disconnected"!==i&&(yield r.disconnect()),null==(e=b.current)?void 0:e.srcObject){b.current.srcObject.getTracks().forEach(e=>e.stop()),b.current.srcObject=null}y(null),p(null),k.current=null,h("disconnected"),m(!1),setTimeout(()=>{w.current=!1},500)}catch(t){Q("❌ Error ending call:",t),S.current=!1,p(null),k.current=null,h("disconnected"),m(!1)}}),[r,i,p,h,m,y,f]),E=x.useCallback(()=>{if(r&&a)try{const e=!o;r.enableMic(e),g(e)}catch(e){Q("❌ Error toggling mic:",e)}else G("⚠️ Cannot toggle mic - client not ready")},[r,o,a,g]),T=x.useCallback(e=>d(null,null,function*(){if(r){if(!a)return Y("⚠️ Cannot send text - bot not ready yet"),void f({type:"system",text:"Please wait for the bot to be ready before sending text"});try{yield r.sendText(e),f({type:"user",text:e,isTranscript:!1}),G("✅ Text sent successfully")}catch(t){Q("❌ Error sending text:",t),f({type:"system",text:`Error: ${t.message||"Failed to send text"}`})}}else Y("⚠️ Cannot send text - client not initialized")}),[r,a,f]);return x.useEffect(()=>()=>{var e;const t=k.current;if(t&&(w.current=!0,t.disconnect().catch(e=>{Q("Error during cleanup:",e)})),null==(e=b.current)?void 0:e.srcObject){b.current.srcObject.getTracks().forEach(e=>e.stop())}},[]),{connectionState:i,isBotReady:a,isMicEnabled:o,isUserSpeaking:s,startCall:_,endCall:C,toggleMic:E,sendTextDuringCall:T,remoteAudioRef:b}}function vf({agentId:e,agentName:t,avatarUrl:n,promptToken:r,metadata:i,showTranscripts:a=!0,idlePromptMessages:o=[],onClose:s,className:l}){const{messages:c}=H(),[u,d]=x.useState(""),[f,p]=x.useState(0),h=x.useRef(null),{connectionState:m,isBotReady:g,isMicEnabled:v,isUserSpeaking:y,startCall:w,endCall:k,toggleMic:S,sendTextDuringCall:_,remoteAudioRef:C}=gf(e,r,i);x.useEffect(()=>("disconnected"===m&&w(),()=>{"disconnected"!==m&&k()}),[]);const E="connecting"===m||!g,T="ready"===m||"connected"===m,M="error"===m;x.useEffect(()=>{var e;null==(e=h.current)||e.scrollIntoView({behavior:"smooth"})},[c]),x.useEffect(()=>{if(!E||!(null==o?void 0:o.length))return;const e=setInterval(()=>{p(e=>(e+1)%o.length)},3e3);return()=>clearInterval(e)},[E,o]);const P=T&&y?{text:"Transcribing",animate:!0}:null,A=M?"error":E?"connecting":v?"listening":"muted",O=c.filter(e=>e.isTranscript||"separator"===e.type||"system"===e.type||"user"===e.type||"assistant"===e.type);return b.jsxs("div",{className:kt("flex flex-col h-full w-full animate-fade-in min-h-0 relative",l),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsx("audio",{ref:C,autoPlay:!0,playsInline:!0,style:{display:"none"}}),b.jsx("button",{onClick:()=>{k(),s()},className:"absolute top-4 right-4 p-2 rounded-full hover:opacity-80 transition-opacity z-10",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(zt,{className:"h-6 w-6"})}),E&&b.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[b.jsx("div",{className:"mb-6",children:b.jsx(Gn,{loading:!0,size:180,strokeWidth:4,gap:6,children:b.jsx(Et,{src:n,alt:t,size:"2xl",className:"shadow-lg"})})}),b.jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:"var(--widget-text-primary, #111827)"},children:t}),b.jsx("p",{className:"text-sm mb-6",style:{color:"var(--widget-status-connecting, #F59E0B)"},children:"Connecting..."}),(null==o?void 0:o.length)>0&&b.jsx("div",{className:"text-center px-4 py-3 rounded-lg max-w-xs animate-fade-in",style:{backgroundColor:"var(--widget-idle-prompt-bg, #F3F4F6)",color:"var(--widget-idle-prompt-text, #6B7280)"},children:b.jsx("p",{className:"text-sm",children:o[f]})},f)]}),!E&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 shrink-0",style:{backgroundColor:"var(--widget-header-bg, #F9FAFB)",borderBottom:"1px solid var(--widget-header-border, #E5E7EB)"},children:[b.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[b.jsxs("div",{className:"relative",children:[b.jsx(Et,{src:n,alt:t,size:"sm"}),A&&b.jsx("span",{className:kt("absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full border-2",("listening"===A||"connecting"===A)&&"animate-pulse"),style:{backgroundColor:"listening"===A?"var(--widget-status-success, #10B981)":"connecting"===A?"var(--widget-status-warning, #F59E0B)":"var(--widget-status-error, #EF4444)",borderColor:"var(--widget-header-bg, #F9FAFB)"}})]}),b.jsxs("div",{children:[b.jsx("h2",{className:"text-sm font-semibold leading-tight",style:{color:"var(--widget-header-text, #111827)"},children:t}),A&&b.jsxs("span",{className:"text-xs",style:{color:"listening"===A?"var(--widget-status-success, #10B981)":"error"===A?"var(--widget-status-error, #EF4444)":"var(--widget-text-muted, #9CA3AF)"},children:["listening"===A&&"Listening...","connecting"===A&&"Connecting...","muted"===A&&"Muted","error"===A&&"Connection failed"]})]})]}),b.jsx("div",{className:"w-9"})]}),b.jsx(zn,{className:"flex-1 min-h-0",children:b.jsxs("div",{className:"p-4 space-y-3 min-h-full",children:[0===O.length&&!P&&b.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:b.jsx("p",{className:"text-sm",style:{color:"var(--widget-text-muted, #9CA3AF)"},children:"Start Conversation"})}),O.map(e=>b.jsx(yf,{message:e},e.id)),P&&b.jsx("div",{className:"flex justify-end",children:b.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 rounded-2xl rounded-br-md text-sm",style:{backgroundColor:"var(--widget-user-message-bg, #3B82F6)",color:"var(--widget-user-message-text, #FFFFFF)"},children:[b.jsx("span",{children:P.text}),b.jsxs("span",{className:"flex gap-1",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-bounce",style:{animationDelay:"0ms"}}),b.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-bounce",style:{animationDelay:"150ms"}}),b.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-bounce",style:{animationDelay:"300ms"}})]})]})}),b.jsx("div",{ref:h})]})}),b.jsxs("div",{className:"shrink-0",style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",backgroundColor:"var(--widget-background, #FFFFFF)"},children:[b.jsxs("form",{onSubmit:e=>{e.preventDefault(),u.trim()&&T&&(_(u.trim()),d(""))},className:"flex items-center gap-2 px-4 py-2",children:[b.jsx("input",{type:"text",value:u,onChange:e=>d(e.target.value),placeholder:"Type a message...",disabled:!T,className:"flex-1 h-10 px-4 rounded-full outline-none transition-all text-sm",style:{backgroundColor:"var(--widget-input-bg, #F9FAFB)",color:"var(--widget-input-text, #111827)",border:"1px solid var(--widget-input-border, #E5E7EB)",fontFamily:"var(--widget-font-family, inherit)"}}),b.jsx(Ct,{type:"submit",variant:"ghost",size:"icon",disabled:!u.trim()||!T,className:"shrink-0 rounded-full h-10 w-10",children:b.jsx(Bt,{className:"h-4 w-4"})})]}),b.jsxs("div",{className:"flex justify-center gap-4 px-4 pt-2",style:{paddingBottom:"max(1rem, env(safe-area-inset-bottom, 0px))"},children:[b.jsx(Ct,{onClick:S,variant:v?"secondary":"outline",size:"icon-lg",className:"rounded-full h-12 w-12",disabled:!T,style:{backgroundColor:v?"var(--widget-button-secondary-bg, #F3F4F6)":"transparent",borderColor:v?void 0:"var(--widget-border, #E5E7EB)"},children:v?b.jsx(Ft,{className:"h-5 w-5",style:{color:"var(--widget-text-primary, #111827)"}}):b.jsx(Rt,{className:"h-5 w-5",style:{color:"var(--widget-text-muted, #9CA3AF)"}})}),b.jsx(Ct,{onClick:()=>{k(),s()},variant:"destructive",size:"icon-lg",className:"rounded-full h-12 w-12",children:b.jsx(Dt,{className:"h-5 w-5"})})]})]})]})]})}function yf({message:e}){const t="user"===e.type;e.type;const n="separator"===e.type,r="system"===e.type;return n?b.jsx("div",{className:"flex items-center justify-center py-1",children:b.jsx("div",{className:"px-3 py-1 rounded-full text-xs",style:{backgroundColor:"var(--widget-system-message-bg, #F3F4F6)",color:"var(--widget-text-muted, #9CA3AF)"},children:e.text})}):r?b.jsx("div",{className:"flex justify-center",children:b.jsx("div",{className:"max-w-[85%] px-4 py-2 rounded-lg text-sm",style:{backgroundColor:"var(--widget-status-error-bg, #FEE2E2)",color:"var(--widget-status-error, #DC2626)"},children:e.text})}):b.jsx("div",{className:kt("flex",t?"justify-end":"justify-start"),children:b.jsx("div",{className:kt("max-w-[80%] px-4 py-2.5 text-sm leading-relaxed",t?"rounded-2xl rounded-br-md":"rounded-2xl rounded-bl-md"),style:{backgroundColor:t?"var(--widget-user-message-bg, #3B82F6)":"var(--widget-bot-message-bg, #F3F4F6)",color:t?"var(--widget-user-message-text, #FFFFFF)":"var(--widget-bot-message-text, #111827)"},children:e.text})})}function bf({agentName:e,avatarUrl:t,variablesConfig:n=[],onSubmit:r,onClose:i,className:a}){const[o,s]=x.useState(()=>n.reduce((e,{key:t})=>c(l({},e),{[t]:""}),{})),[u,d]=x.useState({}),f=x.useMemo(()=>n.filter(e=>e.required).map(e=>e.key),[n]),p=x.useCallback(e=>e.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),[]),h=x.useCallback((e,t)=>{s(n=>c(l({},n),{[e]:t})),u[e]&&d(t=>c(l({},t),{[e]:null}))},[u]),m=x.useCallback(()=>{const e={};let t=!1;if(f.forEach(n=>{o[n]&&""!==o[n].trim()||(e[n]=`${p(n)} is required`,t=!0)}),t)return void d(e);const n=Object.fromEntries(Object.entries(o).filter(([e,t])=>t&&""!==t.trim()));r(n)},[o,f,p,r]),g=x.useCallback((e,t)=>{"Enter"===e.key&&t&&m()},[m]);return b.jsxs("div",{className:kt("flex flex-col h-full w-full animate-fade-in relative min-h-0",a),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsx("button",{onClick:i,className:"absolute top-4 right-4 p-2 rounded-full hover:opacity-80 transition-opacity z-10",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(zt,{className:"h-6 w-6"})}),b.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:b.jsxs("div",{className:"flex flex-col items-center px-6 py-8 pt-14",children:[b.jsx(Et,{src:t,alt:e,size:"xl",className:"mb-4 shadow-lg"}),b.jsx("h1",{className:"text-xl font-semibold mb-2 text-center",style:{color:"var(--widget-text-primary, #111827)"},children:"Before we start"}),b.jsxs("p",{className:"text-sm mb-6 text-center max-w-sm",style:{color:"var(--widget-text-secondary, #6B7280)"},children:["Please provide the following information to personalize your experience with ",b.jsx("span",{className:"font-medium",children:e})]}),b.jsx("div",{className:"w-full max-w-md space-y-4",children:n.map(({key:e,required:t},r)=>b.jsxs("div",{className:"space-y-1",children:[b.jsxs("label",{htmlFor:`var-${e}`,className:"block text-sm font-medium",style:{color:"var(--widget-text-primary, #111827)"},children:[p(e),t&&b.jsx("span",{className:"ml-1",style:{color:"var(--widget-status-error, #DC2626)"},children:"*"}),!t&&b.jsx("span",{className:"ml-1 text-xs font-normal",style:{color:"var(--widget-text-muted, #9CA3AF)"},children:"(optional)"})]}),b.jsx("input",{id:`var-${e}`,type:"text",value:o[e],onChange:t=>h(e,t.target.value),onKeyDown:e=>g(e,r===n.length-1),placeholder:`Enter ${p(e).toLowerCase()}`,className:"w-full px-4 py-3 rounded-lg text-sm outline-none transition-colors",style:{backgroundColor:"var(--widget-input-bg, #FFFFFF)",color:"var(--widget-input-text, #111827)",border:u[e]?"2px solid var(--widget-border-error, #DC2626)":"1px solid var(--widget-input-border, #E5E7EB)"},autoFocus:0===r}),u[e]&&b.jsx("p",{className:"text-xs",style:{color:"var(--widget-status-error, #DC2626)"},children:u[e]})]},e))})]})}),b.jsx("div",{className:"p-6 pb-safe shrink-0",style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",paddingBottom:"max(1.5rem, env(safe-area-inset-bottom, 0px))"},children:b.jsx("div",{className:"max-w-md mx-auto",children:b.jsxs(Ct,{onClick:m,variant:"default",size:"xl",className:"w-full",children:["Continue",b.jsx(Nt,{className:"h-5 w-5 ml-2"})]})})})]})}function wf({agentId:e,metadata:t={},widgetElement:n}){const{isOpen:r,currentScreen:i,setScreen:a,closeDialog:o,dynamicVariables:s,pendingScreen:c,setDynamicVariables:u,setPendingScreen:f}=H(),{agentName:p,avatarUrl:h,promptToken:m,themeConfig:g,tncConfig:v,interfaceConfig:y,appearanceConfig:w,dynamicVariablesConfig:k,isLoading:S,error:_}=function(e){var t,n,r;const{agentConfig:i,configLoading:a,configError:o,setAgentId:s,setAgentConfig:l,setConfigLoading:c,setConfigError:u}=H(),f=x.useRef(null),p=x.useRef(!1);x.useEffect(()=>{d(null,null,function*(){if(e)if(p.current)G("⏭️ Fetch already in progress, skipping...");else if(f.current===e&&i)G("✓ Using cached config for agent:",e);else{f.current&&f.current!==e&&(G("🔄 Agent ID changed, fetching new config"),l(null),f.current=null);try{p.current=!0,c(!0),u(null),s(e),G("🔍 Fetching agent config for:",e);const t=yield Z(e);if(G("✅ Agent config fetched:",t),!t||!t.widget_config)throw new Error("Invalid agent configuration structure");l(t),f.current=e}catch(_){Q("❌ Failed to fetch agent config:",_),u(_.message||"Failed to load configuration")}finally{p.current=!1,c(!1)}}else u("Agent ID is required")})},[e,i,s,l,c,u]);const h=x.useCallback(()=>d(null,null,function*(){if(e)try{f.current=null,p.current=!0,c(!0),u(null),G("🔄 Refreshing agent config for:",e);const t=yield Z(e);if(!t||!t.widget_config)throw new Error("Invalid agent configuration structure");l(t),f.current=e}catch(_){Q("❌ Failed to refresh agent config:",_),u(_.message||"Failed to load configuration")}finally{p.current=!1,c(!1)}else u("Agent ID is required")}),[e,l,c,u]),m=(null==i?void 0:i.widget_config)||{},g=((null==i?void 0:i.dynamic_variables_keys)||[]).map(e=>({key:e,required:!0})),v=(null==(t=m.widget_dynamic_variables)?void 0:t.variables)||[],y=new Set(v.map(e=>e.key)),b=[...g.filter(e=>!y.has(e.key)),...v];return{agentConfig:i,agentName:(null==i?void 0:i.agent_name)||"AI Assistant",promptToken:(null==i?void 0:i.prompt_access_token)||null,dynamicVariablesConfig:b,interfaceConfig:m.widget_interface||{},appearanceConfig:m.widget_appearance||{},avatarConfig:m.widget_avatar||{},themeConfig:m.widget_theme||{},tncConfig:m.widget_tnc_config||{},avatarUrl:(null==(r=null==(n=null==i?void 0:i.MediaFiles)?void 0:n.find(e=>"avatar"===e.fileType))?void 0:r.mediaUrl)||null,isLoading:a,error:o,refresh:h}}(e),C=(null==k?void 0:k.length)>0&&0===Object.keys(s).length,E=x.useCallback(e=>{C?(f(e),a("variables")):a(e)},[C,f,a]),T=x.useCallback(e=>{u(e),c&&(a(c),f(null))},[c,u,a,f]),M=l(l({},t),s);if(x.useEffect(()=>{!r||S||!C||"chat"!==i&&"talk"!==i||(f(i),a("variables"))},[r,S,C,i,f,a]),!r)return null;if(S)return b.jsx(kf,{children:b.jsx(Sf,{children:b.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[b.jsx(jt,{className:"h-12 w-12 animate-spin",style:{color:"var(--widget-primary-color, #3B82F6)"}}),b.jsx("p",{className:"text-sm",style:{color:"var(--widget-text-secondary, #6B7280)"},children:"Loading..."})]})})});if(_)return b.jsx(kf,{children:b.jsx(Sf,{children:b.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-6",children:[b.jsx("div",{className:"text-4xl",role:"img","aria-label":"Error",children:"😕"}),b.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--widget-text-primary, #111827)"},children:"Something went wrong"}),b.jsx("p",{className:"text-sm text-center",style:{color:"var(--widget-text-secondary, #6B7280)"},children:_}),b.jsx("button",{onClick:o,className:"mt-4 px-6 py-2 rounded-lg text-sm font-medium",style:{backgroundColor:"var(--widget-button-secondary-bg, #F3F4F6)",color:"var(--widget-button-secondary-text, #374151)"},children:"Close"})]})})});return b.jsxs(kf,{onClick:o,children:[b.jsx(ne,{theme:g,widgetElement:n}),b.jsx(Sf,{onClick:e=>e.stopPropagation(),children:(()=>{switch(i){case"variables":return b.jsx(bf,{agentName:p,avatarUrl:h,variablesConfig:k,onSubmit:T,onClose:o});case"chat":return b.jsx(Hn,{agentId:e,agentName:p,promptToken:m,metadata:M,onClose:o,onSwitchToTalk:()=>a("talk")});case"talk":return b.jsx(vf,{agentId:e,agentName:p,avatarUrl:h,promptToken:m,metadata:M,showTranscripts:y.realtime_transcript_of_the_call,idlePromptMessages:w.idle_prompt_messages,onClose:o});default:return b.jsx(Ut,{agentName:p,avatarUrl:h,tncEnabled:v.tnc_enabled,tncContent:v.tnc_content,onTalk:()=>E("talk"),onChat:()=>E("chat"),onClose:o})}})()})]})}function kf({children:e,onClick:t}){return b.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center animate-fade-in",style:{backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)"},onClick:t,children:e})}function Sf({children:e,onClick:t,className:n}){return b.jsx("div",{className:kt("relative w-full h-full overflow-hidden animate-scale-in","sm:max-w-lg sm:max-h-[90vh] sm:h-[700px] sm:rounded-2xl",n),style:{backgroundColor:"var(--widget-background, #FFFFFF)",boxShadow:"var(--widget-shadow-xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25))"},onClick:t,children:e})}const _f='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--widget-font-family),system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-bottom-0\\.5{bottom:-.125rem}.-right-0\\.5{right:-.125rem}.right-4{right:1rem}.top-4{top:1rem}.z-10{z-index:10}.z-\\[9999\\]{z-index:9999}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1 / 1}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2\\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.min-h-0{min-height:0px}.min-h-\\[200px\\]{min-height:200px}.min-h-full{min-height:100%}.w-1\\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-24{width:6rem}.w-3{width:.75rem}.w-32{width:8rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[85\\%\\]{max-width:85%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}@keyframes spin{to{transform:rotate(360deg)}}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-current{background-color:currentColor}.bg-transparent{background-color:transparent}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\\[1px\\]{padding:1px}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pt-14{padding-top:3.5rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-4{--tw-ring-offset-width: 4px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}*,*:before,*:after{box-sizing:border-box}html{scroll-behavior:smooth}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--widget-border, #e5e7eb);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--widget-text-muted, #9ca3af)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideDown{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}.animate-fade-in{animation:fadeIn .3s ease-out}.animate-slide-up{animation:slideUp .4s ease-out}.animate-slide-down{animation:slideDown .4s ease-out}.animate-scale-in{animation:scaleIn .3s ease-out}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin{animation:spin 1s linear infinite}.animate-bounce{animation:bounce .6s ease-in-out infinite}@keyframes loaderSpin{0%{transform:rotate(-90deg)}to{transform:rotate(270deg)}}@keyframes loaderDash{0%{stroke-dashoffset:478}50%{stroke-dashoffset:120}to{stroke-dashoffset:478}}.animate-loader-spin{animation:loaderSpin 1.5s linear infinite,loaderDash 2s ease-in-out infinite;transform-origin:center}.pb-safe{padding-bottom:env(safe-area-inset-bottom,0px)}.pt-safe{padding-top:env(safe-area-inset-top,0px)}.px-safe{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:opacity-90:hover{opacity:.9}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}@media(min-width:640px){.sm\\:h-\\[700px\\]{height:700px}.sm\\:max-h-\\[90vh\\]{max-height:90vh}.sm\\:max-w-lg{max-width:32rem}.sm\\:rounded-2xl{border-radius:1rem}}';class xf extends HTMLElement{constructor(){super(),this.root=null,this.shadow=null,this.themeStyleSheet=null,this.agentId=null,this.metadata={}}injectThemeCSS(e){if(this.shadow&&e)try{if(this.themeStyleSheet){const e=this.shadow.adoptedStyleSheets.indexOf(this.themeStyleSheet);e>-1&&(this.shadow.adoptedStyleSheets=this.shadow.adoptedStyleSheets.filter((t,n)=>n!==e))}const t=new CSSStyleSheet;t.replaceSync(e),this.shadow.adoptedStyleSheets=[...this.shadow.adoptedStyleSheets,t],this.themeStyleSheet=t,G("✅ Theme CSS injected")}catch(t){Q("Constructable Stylesheets failed, using fallback:",t);const n=document.createElement("style");n.setAttribute("data-eigi-theme","true"),n.textContent=e;const r=this.shadow.querySelector("[data-eigi-theme]");r&&r.remove(),this.shadow.appendChild(n),G("✅ Theme CSS injected (fallback)")}}connectedCallback(){this.agentId=this.getAttribute("agent-id");const e=this.getAttribute("metadata");if(e)try{this.metadata=JSON.parse(e)}catch(dr){Q("Failed to parse metadata:",dr)}if(!this.agentId)return void Q("EigiChat: agent-id attribute is required");const t=this.attachShadow({mode:"open"});this.shadow=t;try{const e=new CSSStyleSheet;e.replaceSync(_f),t.adoptedStyleSheets=[e],G("✅ Base CSS injected")}catch(r){const e=document.createElement("style");e.textContent=_f,t.appendChild(e),G("✅ Base CSS injected (fallback)")}const n=document.createElement("div");n.id="eigi-chat-root",t.appendChild(n),this.root=V.createRoot(n),this.render(),G("✅ EigiChat mounted with agent:",this.agentId),"undefined"!=typeof window&&window.EigiChat&&(window.EigiChat._element=this,window.EigiChat._agentId=this.agentId,window.EigiChat._metadata=this.metadata,H.getState().setAgentId(this.agentId))}render(){this.root&&this.root.render(b.jsx(C.StrictMode,{children:b.jsx(wf,{agentId:this.agentId,metadata:this.metadata,widgetElement:this})}))}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=null)}static get observedAttributes(){return["agent-id","metadata","action"]}attributeChangedCallback(e,t,n){if(t!==n)if("agent-id"===e)this.agentId=n,this.render();else if("metadata"===e){try{this.metadata=JSON.parse(n)}catch(dr){Q("Failed to parse metadata:",dr)}this.render()}else"action"===e&&this.handleAction(n)}handleAction(e){if(!e)return;const t=H.getState();switch(e){case"open":t.openDialog(),G("📖 Dialog opened via attribute");break;case"close":t.closeDialog(),G("📕 Dialog closed via attribute");break;case"toggle":t.toggleDialog(),G("🔄 Dialog toggled via attribute");break;case"openChat":t.openChat(),G("💬 Chat opened via attribute");break;case"openTalk":t.openTalk(),G("🎤 Talk opened via attribute");break;default:G("Unknown action:",e)}setTimeout(()=>{this.removeAttribute("action")},100)}}"undefined"==typeof window||customElements.get("eigi-chat")||customElements.define("eigi-chat",xf);const Cf={_element:null,_agentId:null,_metadata:{},init({agentId:e,metadata:t={}}={}){e?(this._agentId=e,this._metadata=t,H.getState().setAgentId(e),this._element?(this._element.setAttribute("agent-id",e),Object.keys(t).length>0&&this._element.setAttribute("metadata",JSON.stringify(t))):(this._element=document.createElement("eigi-chat"),this._element.setAttribute("agent-id",e),Object.keys(t).length>0&&this._element.setAttribute("metadata",JSON.stringify(t)),document.body.appendChild(this._element),G("✅ EigiChat element created"))):Q("EigiChat.init: agentId is required")},open(){this._ensureInitialized(),H.getState().openDialog(),G("📖 Dialog opened")},close(){H.getState().closeDialog(),G("📕 Dialog closed")},toggle(){H.getState().toggleDialog()},isOpen:()=>H.getState().isOpen,openChat(){this._ensureInitialized(),H.getState().openChat(),G("📖 Chat opened")},openTalk(){this._ensureInitialized(),H.getState().openTalk(),G("📖 Talk opened")},_ensureInitialized(){!this._element&&this._agentId?this.init({agentId:this._agentId,metadata:this._metadata}):this._agentId||Q("EigiChat: Call init() with agentId first, or add data-agent-id to script tag")}};if("undefined"!=typeof window){const e=document.querySelectorAll("script[data-agent-id]"),t=e[e.length-1];if(t){const e=t.getAttribute("data-agent-id"),n=t.getAttribute("data-metadata");let r={};if(n)try{r=JSON.parse(n)}catch(dr){Q("Failed to parse data-metadata:",dr)}e&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{Cf.init({agentId:e,metadata:r})}):Cf.init({agentId:e,metadata:r}))}window.EigiChat=Cf,G("✅ window.EigiChat API ready")}return e.EigiChatAPI=Cf,e.EigiChatElement=xf,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});"undefined"!=typeof window&&window.EigiChatInternal&&(window.EigiChat=window.EigiChatInternal.EigiChatAPI,window.EigiChatElement=window.EigiChatInternal.EigiChatElement);
48
+ */class $u{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Vu(e,t)}static parse(e){return new Vu(e).getResult()}static get BROWSER_MAP(){return Nu}static get ENGINE_MAP(){return Iu}static get OS_MAP(){return ju}static get PLATFORMS_MAP(){return Lu}}function Wu(e,t){return Object.keys(t).forEach(function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})}),e}function qu(e){return e&&e.__esModule?e.default:e}function Hu(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var Ju={},Qu={};Hu(Qu,"PipecatClient",()=>Vd);var Gu;Gu=JSON.parse('{"name":"@pipecat-ai/client-js","version":"1.5.0","license":"BSD-2-Clause","main":"dist/index.js","module":"dist/index.module.js","types":"dist/index.d.ts","source":"index.ts","repository":{"type":"git","url":"git+https://github.com/pipecat-ai/pipecat-client-web.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"jest --silent --passWithNoTests && parcel build --no-cache","dev":"parcel watch","lint":"eslint . --report-unused-disable-directives --max-warnings 0","test":"jest"},"jest":{"preset":"ts-jest","testEnvironment":"jsdom"},"devDependencies":{"@jest/globals":"^29.7.0","@types/clone-deep":"^4.0.4","@types/jest":"^29.5.12","@types/uuid":"^10.0.0","eslint":"^9.11.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1","jest":"^29.7.0","jest-environment-jsdom":"^30.0.2","ts-jest":"^29.2.5"},"dependencies":{"@types/events":"^3.0.3","bowser":"^2.11.0","clone-deep":"^4.0.1","events":"^3.3.0","typed-emitter":"^2.1.0","uuid":"^10.0.0"}}');var Yu,Ku,Xu={},Zu={};Hu(Zu,"TransportStateEnum",()=>Yu),(Ku=Yu||(Yu={})).DISCONNECTED="disconnected",Ku.INITIALIZING="initializing",Ku.INITIALIZED="initialized",Ku.AUTHENTICATING="authenticating",Ku.AUTHENTICATED="authenticated",Ku.CONNECTING="connecting",Ku.CONNECTED="connected",Ku.READY="ready",Ku.DISCONNECTING="disconnecting",Ku.ERROR="error";var ed={};Hu(ed,"RTVIError",()=>td),Hu(ed,"ConnectionTimeoutError",()=>nd),Hu(ed,"StartBotError",()=>rd),Hu(ed,"TransportStartError",()=>id),Hu(ed,"InvalidTransportParamsError",()=>ad),Hu(ed,"BotNotReadyError",()=>od),Hu(ed,"BotAlreadyStartedError",()=>sd),Hu(ed,"UnsupportedFeatureError",()=>ld),Hu(ed,"DeviceError",()=>cd);class td extends Error{constructor(e,t){super(e),this.status=t}}class nd extends td{constructor(e){super(null!=e?e:"Bot did not enter ready state within the specified timeout period.")}}class rd extends td{constructor(e,t){super(null!=e?e:"Failed to connect / invalid auth bundle from base url",null!=t?t:500),this.error="invalid-request-error"}}class id extends td{constructor(e){super(null!=e?e:"Unable to connect to transport")}}class ad extends td{constructor(e){super(null!=e?e:"Invalid transport connection parameters")}}class od extends td{constructor(e){super(null!=e?e:"Attempt to call action on transport when not in 'ready' state.")}}class sd extends td{constructor(e){super(null!=e?e:"Pipecat client has already been started. Please call disconnect() before starting again.")}}class ld extends td{constructor(e,t,n){let r=`${e} not supported${n?`: ${n}`:""}`;t&&(r=`${t} does not support ${e}${n?`: ${n}`:""}`),super(r),this.feature=e}}class cd extends td{constructor(e,t,n,r){super(null!=n?n:`Device error for ${e.join(", ")}: ${t}`),this.devices=e,this.type=t,this.details=r}}var ud,dd,fd={};Hu(fd,"RTVIEvent",()=>ud),(dd=ud||(ud={})).Connected="connected",dd.Disconnected="disconnected",dd.TransportStateChanged="transportStateChanged",dd.BotStarted="botStarted",dd.BotConnected="botConnected",dd.BotReady="botReady",dd.BotDisconnected="botDisconnected",dd.Error="error",dd.ServerMessage="serverMessage",dd.ServerResponse="serverResponse",dd.MessageError="messageError",dd.Metrics="metrics",dd.BotStartedSpeaking="botStartedSpeaking",dd.BotStoppedSpeaking="botStoppedSpeaking",dd.UserStartedSpeaking="userStartedSpeaking",dd.UserStoppedSpeaking="userStoppedSpeaking",dd.UserTranscript="userTranscript",dd.BotOutput="botOutput",dd.BotTranscript="botTranscript",dd.BotLlmText="botLlmText",dd.BotLlmStarted="botLlmStarted",dd.BotLlmStopped="botLlmStopped",dd.LLMFunctionCall="llmFunctionCall",dd.BotLlmSearchResponse="botLlmSearchResponse",dd.BotTtsText="botTtsText",dd.BotTtsStarted="botTtsStarted",dd.BotTtsStopped="botTtsStopped",dd.ParticipantConnected="participantConnected",dd.ParticipantLeft="participantLeft",dd.TrackStarted="trackStarted",dd.TrackStopped="trackStopped",dd.ScreenTrackStarted="screenTrackStarted",dd.ScreenTrackStopped="screenTrackStopped",dd.ScreenShareError="screenShareError",dd.LocalAudioLevel="localAudioLevel",dd.RemoteAudioLevel="remoteAudioLevel",dd.AvailableCamsUpdated="availableCamsUpdated",dd.AvailableMicsUpdated="availableMicsUpdated",dd.AvailableSpeakersUpdated="availableSpeakersUpdated",dd.CamUpdated="camUpdated",dd.MicUpdated="micUpdated",dd.SpeakerUpdated="speakerUpdated",dd.DeviceError="deviceError";var pd={};Hu(pd,"RTVI_PROTOCOL_VERSION",()=>hd),Hu(pd,"RTVI_MESSAGE_LABEL",()=>md),Hu(pd,"RTVIMessageType",()=>gd),Hu(pd,"AggregationType",()=>yd),Hu(pd,"setAboutClient",()=>kd),Hu(pd,"RTVIMessage",()=>Sd);const hd="1.0.0",md="rtvi-ai";var gd,vd,yd,bd;let wd;function kd(e){wd=wd?l(l({},wd),e):e}(vd=gd||(gd={})).CLIENT_READY="client-ready",vd.DISCONNECT_BOT="disconnect-bot",vd.CLIENT_MESSAGE="client-message",vd.SEND_TEXT="send-text",vd.APPEND_TO_CONTEXT="append-to-context",vd.BOT_READY="bot-ready",vd.ERROR="error",vd.METRICS="metrics",vd.SERVER_MESSAGE="server-message",vd.SERVER_RESPONSE="server-response",vd.ERROR_RESPONSE="error-response",vd.APPEND_TO_CONTEXT_RESULT="append-to-context-result",vd.USER_TRANSCRIPTION="user-transcription",vd.BOT_OUTPUT="bot-output",vd.BOT_TRANSCRIPTION="bot-transcription",vd.USER_STARTED_SPEAKING="user-started-speaking",vd.USER_STOPPED_SPEAKING="user-stopped-speaking",vd.BOT_STARTED_SPEAKING="bot-started-speaking",vd.BOT_STOPPED_SPEAKING="bot-stopped-speaking",vd.USER_LLM_TEXT="user-llm-text",vd.BOT_LLM_TEXT="bot-llm-text",vd.BOT_LLM_STARTED="bot-llm-started",vd.BOT_LLM_STOPPED="bot-llm-stopped",vd.LLM_FUNCTION_CALL="llm-function-call",vd.LLM_FUNCTION_CALL_RESULT="llm-function-call-result",vd.BOT_LLM_SEARCH_RESPONSE="bot-llm-search-response",vd.BOT_TTS_TEXT="bot-tts-text",vd.BOT_TTS_STARTED="bot-tts-started",vd.BOT_TTS_STOPPED="bot-tts-stopped",(bd=yd||(yd={})).WORD="word",bd.SENTENCE="sentence";class Sd{constructor(e,t,n){this.label=md,this.type=e,this.data=t,this.id=n||Au().slice(0,8)}static clientReady(){return new Sd(gd.CLIENT_READY,{version:hd,about:wd||{library:Gu.name,library_version:Gu.version}})}static disconnectBot(){return new Sd(gd.DISCONNECT_BOT,{})}static error(e,t=!1){return new Sd(gd.ERROR,{message:e,fatal:t})}}function _d(e,t,n){const r=n.value;return n.value=function(...e){if("ready"===this.state)return r.apply(this,e);throw new od(`Attempt to call ${t.toString()} when transport not in ready state. Await connect() first.`)},n}function xd(e,t,n){const r=n.value,i=["authenticating","connecting","connected","ready"];return n.value=function(...e){if(i.includes(this.state))throw new sd(`Attempt to call ${t.toString()} when client already started. Please call disconnect() before starting again.`);return r.apply(this,e)},n}Wu(Xu,Zu),Wu(Xu,ed),Wu(Xu,fd),Wu(Xu,pd);var Ed={};Hu(Ed,"MessageDispatcher",()=>Od);var Cd,Td,Md={};Hu(Md,"LogLevel",()=>Cd),Hu(Md,"logger",()=>Ad),(Td=Cd||(Cd={}))[Td.NONE=0]="NONE",Td[Td.ERROR=1]="ERROR",Td[Td.WARN=2]="WARN",Td[Td.INFO=3]="INFO",Td[Td.DEBUG=4]="DEBUG";class Pd{constructor(){this.level=Cd.DEBUG}static getInstance(){return Pd.instance||(Pd.instance=new Pd),Pd.instance}setLevel(e){this.level=e}debug(...e){this.level>=Cd.DEBUG&&console.debug(...e)}info(...e){this.level>=Cd.INFO&&console.info(...e)}warn(...e){this.level>=Cd.WARN&&console.warn(...e)}error(...e){this.level>=Cd.ERROR&&console.error(...e)}}const Ad=Pd.getInstance();class Od{constructor(e){this._queue=new Array,this._gcInterval=void 0,this._queue=[],this._sendMethod=e}disconnect(){this.clearQueue(),clearInterval(this._gcInterval),this._gcInterval=void 0}dispatch(e,t=gd.CLIENT_MESSAGE,n=1e4){this._gcInterval||(this._gcInterval=setInterval(()=>{this._gc()},2e3));const r=new Sd(t,e),i=new Promise((e,t)=>{this._queue.push({message:r,timestamp:Date.now(),timeout:n,resolve:e,reject:t})});Ad.debug("[MessageDispatcher] dispatch",r);try{this._sendMethod(r)}catch(lr){return Ad.error("[MessageDispatcher] Error sending message",lr),Promise.reject(lr)}return this._gc(),i}clearQueue(){this._queue=[]}_resolveReject(e,t=!0){const n=this._queue.find(t=>t.message.id===e.id);return n&&(t?(Ad.debug("[MessageDispatcher] Resolve",e),n.resolve(e)):(Ad.debug("[MessageDispatcher] Reject",e),n.reject(e)),this._queue=this._queue.filter(t=>t.message.id!==e.id),Ad.debug("[MessageDispatcher] Queue",this._queue)),e}resolve(e){return this._resolveReject(e,!0)}reject(e){return this._resolveReject(e,!1)}_gc(){const e=[];this._queue=this._queue.filter(t=>{const n=Date.now()-t.timestamp<t.timeout;return n||e.push(t),n}),e.forEach(e=>{e.message.type===gd.CLIENT_MESSAGE&&e.reject(new Sd(gd.ERROR_RESPONSE,{error:"Timed out waiting for response",msgType:e.message.data.t,data:e.message.data.d,fatal:!1}))}),Ad.debug("[MessageDispatcher] GC",this._queue)}}var Nd={};function Ld(e){if("object"==typeof e&&null!==e&&Object.keys(e).includes("endpoint")){const t=e.endpoint;return"string"==typeof t||t instanceof URL||"undefined"!=typeof Request&&t instanceof Request}return!1}function jd(e,t){return d(this,null,function*(){let n;return t||(t=new AbortController),new Promise((r,i)=>{d(null,null,function*(){var a;e.timeout&&(n=setTimeout(()=>d(null,null,function*(){t.abort(),i(new Error("Timed out"))}),e.timeout)),Ad.debug(`[Pipecat Client] Fetching from ${e.endpoint}`),fetch(e.endpoint,{method:"POST",mode:"cors",headers:new Headers(l({"Content-Type":"application/json"},Object.fromEntries((null!=(a=e.headers)?a:new Headers).entries()))),body:JSON.stringify(e.requestData),signal:null==t?void 0:t.signal}).then(t=>{Ad.debug(`[Pipecat Client] Received response from ${e.endpoint}`,t),t.ok||i(t),t.json().then(e=>r(e))}).catch(e=>{Ad.error(`[Pipecat Client] Error fetching: ${e}`),i(e)}).finally(()=>{n&&clearTimeout(n)})})})})}Hu(Nd,"isAPIRequest",()=>Ld),Hu(Nd,"makeRequest",()=>jd);var Id={};Hu(Id,"Transport",()=>Rd),Hu(Id,"TransportWrapper",()=>Fd);class Rd{constructor(){this._state="disconnected"}connect(e){this._abortController=new AbortController;let t=e;try{t=this._validateConnectionParams(e)}catch(lr){throw new td(`Invalid connection params: ${lr.message}. Please check your connection params and try again.`)}return this._connect(t)}get startBotParams(){return this._startBotParams}set startBotParams(e){this._startBotParams=e}disconnect(){return this._abortController&&this._abortController.abort(),this._disconnect()}}class Fd{constructor(e){this._transport=e,this._proxy=new Proxy(this._transport,{get:(e,t,n)=>{if("function"==typeof e[t]){let n;switch(String(t)){case"initialize":n="Direct calls to initialize() are disabled and used internally by the PipecatClient.";break;case"initDevices":n="Direct calls to initDevices() are disabled. Please use the PipecatClient.initDevices() wrapper or let PipecatClient.connect() call it for you.";break;case"sendReadyMessage":n="Direct calls to sendReadyMessage() are disabled and used internally by the PipecatClient.";break;case"connect":n="Direct calls to connect() are disabled. Please use the PipecatClient.connect() wrapper.";break;case"disconnect":n="Direct calls to disconnect() are disabled. Please use the PipecatClient.disconnect() wrapper."}return n?()=>{throw new Error(n)}:(...n)=>e[t](...n)}return Reflect.get(e,t,n)}})}get proxy(){return this._proxy}}var Dd={};function Bd(){var e,t,n,r,i,a;let o={library:Gu.name,library_version:Gu.version,platform_details:{}},s=null;if(null==(e=null==window?void 0:window.navigator)?void 0:e.userAgent)try{s=$u.parse(window.navigator.userAgent)}catch(l){}return(null==(t=null==s?void 0:s.browser)?void 0:t.name)&&(o.platform_details.browser=s.browser.name),"Safari"!==(null==(n=null==s?void 0:s.browser)?void 0:n.name)||s.browser.version?(null==(r=null==s?void 0:s.browser)?void 0:r.version)&&(o.platform_details.browser_version=s.browser.version):o.platform_details.browser_version="Web View",(null==(i=null==s?void 0:s.platform)?void 0:i.type)&&(o.platform_details.platform_type=s.platform.type),(null==(a=null==s?void 0:s.engine)?void 0:a.name)&&(o.platform_details.engine=s.engine.name),(null==s?void 0:s.os)&&(o.platform=s.os.name,o.platform_version=s.os.version),o}Hu(Dd,"learnAboutClient",()=>Bd);var zd=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};class Ud extends _u{}class Vd extends Ud{constructor(e){var t,n,r;super(),this._functionCallCallbacks={},this._botTranscriptionWarned=!1,kd(Bd()),this._transport=e.transport,this._transportWrapper=new Fd(this._transport);const i=c(l({},e.callbacks),{onMessageError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onMessageError)||r.call(n,t),this.emit(ud.MessageError,t)},onError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onError)||r.call(n,t);try{this.emit(ud.Error,t)}catch(lr){Ad.debug("Could not emit error",t)}const i=t.data;(null==i?void 0:i.fatal)&&(Ad.error("Fatal error reported. Disconnecting..."),this.disconnect())},onConnected:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onConnected)||n.call(t),this.emit(ud.Connected)},onDisconnected:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onDisconnected)||n.call(t),this.emit(ud.Disconnected)},onTransportStateChanged:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onTransportStateChanged)||r.call(n,t),this.emit(ud.TransportStateChanged,t)},onParticipantJoined:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onParticipantJoined)||r.call(n,t),this.emit(ud.ParticipantConnected,t)},onParticipantLeft:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onParticipantLeft)||r.call(n,t),this.emit(ud.ParticipantLeft,t)},onTrackStarted:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onTrackStarted)||i.call(r,t,n),this.emit(ud.TrackStarted,t,n)},onTrackStopped:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onTrackStopped)||i.call(r,t,n),this.emit(ud.TrackStopped,t,n)},onScreenTrackStarted:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onScreenTrackStarted)||i.call(r,t,n),this.emit(ud.ScreenTrackStarted,t,n)},onScreenTrackStopped:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onScreenTrackStopped)||i.call(r,t,n),this.emit(ud.ScreenTrackStopped,t,n)},onScreenShareError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onScreenShareError)||r.call(n,t),this.emit(ud.ScreenShareError,t)},onAvailableCamsUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableCamsUpdated)||r.call(n,t),this.emit(ud.AvailableCamsUpdated,t)},onAvailableMicsUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableMicsUpdated)||r.call(n,t),this.emit(ud.AvailableMicsUpdated,t)},onAvailableSpeakersUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onAvailableSpeakersUpdated)||r.call(n,t),this.emit(ud.AvailableSpeakersUpdated,t)},onCamUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onCamUpdated)||r.call(n,t),this.emit(ud.CamUpdated,t)},onMicUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onMicUpdated)||r.call(n,t),this.emit(ud.MicUpdated,t)},onSpeakerUpdated:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onSpeakerUpdated)||r.call(n,t),this.emit(ud.SpeakerUpdated,t)},onDeviceError:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onDeviceError)||r.call(n,t),this.emit(ud.DeviceError,t)},onBotStarted:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotStarted)||r.call(n,t),this.emit(ud.BotStarted,t)},onBotConnected:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotConnected)||r.call(n,t),this.emit(ud.BotConnected,t)},onBotReady:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotReady)||r.call(n,t),this.emit(ud.BotReady,t)},onBotDisconnected:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotDisconnected)||r.call(n,t),this.emit(ud.BotDisconnected,t)},onBotStartedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotStartedSpeaking)||n.call(t),this.emit(ud.BotStartedSpeaking)},onBotStoppedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotStoppedSpeaking)||n.call(t),this.emit(ud.BotStoppedSpeaking)},onRemoteAudioLevel:(t,n)=>{var r,i;null==(i=null==(r=null==e?void 0:e.callbacks)?void 0:r.onRemoteAudioLevel)||i.call(r,t,n),this.emit(ud.RemoteAudioLevel,t,n)},onUserStartedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onUserStartedSpeaking)||n.call(t),this.emit(ud.UserStartedSpeaking)},onUserStoppedSpeaking:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onUserStoppedSpeaking)||n.call(t),this.emit(ud.UserStoppedSpeaking)},onLocalAudioLevel:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onLocalAudioLevel)||r.call(n,t),this.emit(ud.LocalAudioLevel,t)},onUserTranscript:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onUserTranscript)||r.call(n,t),this.emit(ud.UserTranscript,t)},onBotOutput:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotOutput)||r.call(n,t),this.emit(ud.BotOutput,t)},onBotTranscript:t=>{var n,r;this._botTranscriptionWarned||(Ad.warn("[Pipecat Client] Bot transcription is deprecated. Please use the onBotOutput instead."),this._botTranscriptionWarned=!0),null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotTranscript)||r.call(n,t),this.emit(ud.BotTranscript,t)},onBotLlmText:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotLlmText)||r.call(n,t),this.emit(ud.BotLlmText,t)},onBotLlmStarted:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotLlmStarted)||n.call(t),this.emit(ud.BotLlmStarted)},onBotLlmStopped:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotLlmStopped)||n.call(t),this.emit(ud.BotLlmStopped)},onBotTtsText:t=>{var n,r;null==(r=null==(n=null==e?void 0:e.callbacks)?void 0:n.onBotTtsText)||r.call(n,t),this.emit(ud.BotTtsText,t)},onBotTtsStarted:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotTtsStarted)||n.call(t),this.emit(ud.BotTtsStarted)},onBotTtsStopped:()=>{var t,n;null==(n=null==(t=null==e?void 0:e.callbacks)?void 0:t.onBotTtsStopped)||n.call(t),this.emit(ud.BotTtsStopped)}});this._options=c(l({},e),{callbacks:i,enableMic:null==(t=e.enableMic)||t,enableCam:null!=(n=e.enableCam)&&n,enableScreenShare:null!=(r=e.enableScreenShare)&&r}),this._initialize(),Ad.debug("[Pipecat Client] Initialized",this.version)}setLogLevel(e){Ad.setLevel(e)}initDevices(){return d(this,null,function*(){Ad.debug("[Pipecat Client] Initializing devices..."),yield this._transport.initDevices()})}startBot(e){return d(this,null,function*(){var t,n,r,i,a,o;let s;this._transport.state="authenticating",this._transport.startBotParams=e,this._abortController=new AbortController;try{s=yield jd(e,this._abortController)}catch(lr){let a,o="An unknown error occurred while starting the bot.";if(lr instanceof Response){const r=yield lr.json();o=null!=(n=null!=(t=r.info)?t:r.detail)?n:lr.statusText,a=lr.status}else lr instanceof Error&&(o=lr.message);throw null==(i=null==(r=this._options.callbacks)?void 0:r.onError)||i.call(r,new Sd(gd.ERROR_RESPONSE,{message:o,fatal:!0})),new rd(o,a)}return this._transport.state="authenticated",null==(o=null==(a=this._options.callbacks)?void 0:a.onBotStarted)||o.call(a,s),s})}connect(e){return d(this,null,function*(){return e&&Ld(e)?(Ad.warn("Calling connect with an API endpoint is deprecated. Use startBotAndConnect() instead."),this.startBotAndConnect(e)):new Promise((t,n)=>{(()=>{d(this,null,function*(){this._connectResolve=t,"disconnected"===this._transport.state&&(yield this._transport.initDevices());try{yield this._transport.connect(e),yield this._transport.sendReadyMessage()}catch(lr){return this.disconnect(),void n(lr)}})})()})})}startBotAndConnect(e){return d(this,null,function*(){"disconnected"===this._transport.state&&(yield this._transport.initDevices());const t=yield this.startBot(e);return this.connect(t)})}disconnect(){return d(this,null,function*(){yield this._transport.disconnect(),this._messageDispatcher.disconnect()})}_initialize(){this._transport.initialize(this._options,this.handleMessage.bind(this)),this._messageDispatcher=new Od(this._transport.sendMessage.bind(this._transport))}get connected(){return["connected","ready"].includes(this._transport.state)}get transport(){return this._transportWrapper.proxy}get state(){return this._transport.state}get version(){return qu(Gu).version}getAllMics(){return d(this,null,function*(){return yield this._transport.getAllMics()})}getAllCams(){return d(this,null,function*(){return yield this._transport.getAllCams()})}getAllSpeakers(){return d(this,null,function*(){return yield this._transport.getAllSpeakers()})}get selectedMic(){return this._transport.selectedMic}get selectedCam(){return this._transport.selectedCam}get selectedSpeaker(){return this._transport.selectedSpeaker}updateMic(e){this._transport.updateMic(e)}updateCam(e){this._transport.updateCam(e)}updateSpeaker(e){this._transport.updateSpeaker(e)}enableMic(e){this._transport.enableMic(e)}get isMicEnabled(){return this._transport.isMicEnabled}enableCam(e){this._transport.enableCam(e)}get isCamEnabled(){return this._transport.isCamEnabled}tracks(){return this._transport.tracks()}enableScreenShare(e){return this._transport.enableScreenShare(e)}get isSharingScreen(){return this._transport.isSharingScreen}sendClientMessage(e,t){this._transport.sendMessage(new Sd(gd.CLIENT_MESSAGE,{t:e,d:t}))}sendClientRequest(e,t,n){return d(this,null,function*(){const r={t:e,d:t};return(yield this._messageDispatcher.dispatch(r,gd.CLIENT_MESSAGE,n)).data.d})}registerFunctionCallHandler(e,t){this._functionCallCallbacks[e]=t}unregisterFunctionCallHandler(e){delete this._functionCallCallbacks[e]}unregisterAllFunctionCallHandlers(){this._functionCallCallbacks={}}appendToContext(e){return d(this,null,function*(){return Ad.warn("appendToContext() is deprecated. Use sendText() instead."),yield this._transport.sendMessage(new Sd(gd.APPEND_TO_CONTEXT,{role:e.role,content:e.content,run_immediately:e.run_immediately})),!0})}sendText(e){return d(this,arguments,function*(e,t={}){yield this._transport.sendMessage(new Sd(gd.SEND_TEXT,{content:e,options:t}))})}disconnectBot(){this._transport.sendMessage(new Sd(gd.DISCONNECT_BOT,{}))}handleMessage(e){var t,n,r,i,a,o,s,l,c,u,d,f,p,h,m,g,v,y,b,w,k,S,_,x,E,C,T,M,P,A,O,N,L,j,I,R,F,D,B,z,U;switch(Ad.debug("[RTVI Message]",e),e.type){case gd.BOT_READY:{const i=e.data,a=i.version?i.version.split(".").map(Number):[0,0,0];Ad.debug(`[Pipecat Client] Bot is ready. Version: ${i.version}`),a[0]<1&&Ad.warn("[Pipecat Client] Bot version is less than 1.0.0, which may not be compatible with this client."),null==(t=this._connectResolve)||t.call(this,e.data),null==(r=null==(n=this._options.callbacks)?void 0:n.onBotReady)||r.call(n,e.data);break}case gd.ERROR:null==(a=null==(i=this._options.callbacks)?void 0:i.onError)||a.call(i,e);break;case gd.SERVER_RESPONSE:this._messageDispatcher.resolve(e);break;case gd.ERROR_RESPONSE:{const t=this._messageDispatcher.reject(e);null==(s=null==(o=this._options.callbacks)?void 0:o.onMessageError)||s.call(o,t);break}case gd.USER_STARTED_SPEAKING:null==(c=null==(l=this._options.callbacks)?void 0:l.onUserStartedSpeaking)||c.call(l);break;case gd.USER_STOPPED_SPEAKING:null==(d=null==(u=this._options.callbacks)?void 0:u.onUserStoppedSpeaking)||d.call(u);break;case gd.BOT_STARTED_SPEAKING:null==(p=null==(f=this._options.callbacks)?void 0:f.onBotStartedSpeaking)||p.call(f);break;case gd.BOT_STOPPED_SPEAKING:null==(m=null==(h=this._options.callbacks)?void 0:h.onBotStoppedSpeaking)||m.call(h);break;case gd.USER_TRANSCRIPTION:{const t=e.data;null==(v=null==(g=this._options.callbacks)?void 0:g.onUserTranscript)||v.call(g,t);break}case gd.BOT_OUTPUT:null==(b=null==(y=this._options.callbacks)?void 0:y.onBotOutput)||b.call(y,e.data);break;case gd.BOT_TRANSCRIPTION:null==(k=null==(w=this._options.callbacks)?void 0:w.onBotTranscript)||k.call(w,e.data);break;case gd.BOT_LLM_TEXT:null==(_=null==(S=this._options.callbacks)?void 0:S.onBotLlmText)||_.call(S,e.data);break;case gd.BOT_LLM_STARTED:null==(E=null==(x=this._options.callbacks)?void 0:x.onBotLlmStarted)||E.call(x);break;case gd.BOT_LLM_STOPPED:null==(T=null==(C=this._options.callbacks)?void 0:C.onBotLlmStopped)||T.call(C);break;case gd.BOT_TTS_TEXT:null==(P=null==(M=this._options.callbacks)?void 0:M.onBotTtsText)||P.call(M,e.data);break;case gd.BOT_TTS_STARTED:null==(O=null==(A=this._options.callbacks)?void 0:A.onBotTtsStarted)||O.call(A);break;case gd.BOT_TTS_STOPPED:null==(L=null==(N=this._options.callbacks)?void 0:N.onBotTtsStopped)||L.call(N);break;case gd.METRICS:null==(I=null==(j=this._options.callbacks)?void 0:j.onMetrics)||I.call(j,e.data),this.emit(ud.Metrics,e.data);break;case gd.SERVER_MESSAGE:null==(F=null==(R=this._options.callbacks)?void 0:R.onServerMessage)||F.call(R,e.data),this.emit(ud.ServerMessage,e.data);break;case gd.LLM_FUNCTION_CALL:{const t=e.data,n=this._functionCallCallbacks[t.function_name];if(n){n({functionName:t.function_name,arguments:t.args}).then(e=>{null!=e&&this._transport.sendMessage(new Sd(gd.LLM_FUNCTION_CALL_RESULT,{function_name:t.function_name,tool_call_id:t.tool_call_id,arguments:t.args,result:e}))})}null==(B=null==(D=this._options.callbacks)?void 0:D.onLLMFunctionCall)||B.call(D,t),this.emit(ud.LLMFunctionCall,t);break}case gd.BOT_LLM_SEARCH_RESPONSE:{const t=e.data;null==(U=null==(z=this._options.callbacks)?void 0:z.onBotLlmSearchResponse)||U.call(z,t),this.emit(ud.BotLlmSearchResponse,t);break}default:Ad.debug("[Pipecat Client] Unrecognized message type",e.type)}}}function $d(e){return e&&e.__esModule?e.default:e}function Wd(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}zd([xd],Vd.prototype,"startBot",null),zd([xd],Vd.prototype,"connect",null),zd([xd],Vd.prototype,"startBotAndConnect",null),zd([_d],Vd.prototype,"sendClientMessage",null),zd([_d],Vd.prototype,"sendClientRequest",null),zd([_d],Vd.prototype,"appendToContext",null),zd([_d],Vd.prototype,"sendText",null),zd([_d],Vd.prototype,"disconnectBot",null),Wu(Ju,Qu),Wu(Ju,Ed),Wu(Ju,Md),Wu(Ju,Nd),Wu(Ju,Id),Wu(Ju,Dd);var qd={};Wd(qd,"DailyRTVIMessageType",()=>lf),Wd(qd,"DailyTransport",()=>df);class Hd{static floatTo16BitPCM(e){const t=new ArrayBuffer(2*e.length),n=new DataView(t);let r=0;for(let i=0;i<e.length;i++,r+=2){let t=Math.max(-1,Math.min(1,e[i]));n.setInt16(r,t<0?32768*t:32767*t,!0)}return t}static mergeBuffers(e,t){const n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer}_packData(e,t){return[new Uint8Array([t,t>>8]),new Uint8Array([t,t>>8,t>>16,t>>24])][e]}pack(e,t){if(!(null==t?void 0:t.bitsPerSample))throw new Error('Missing "bitsPerSample"');if(!(null==t?void 0:t.channels))throw new Error('Missing "channels"');if(!(null==t?void 0:t.data))throw new Error('Missing "data"');const{bitsPerSample:n,channels:r,data:i}=t,a=["RIFF",this._packData(1,52),"WAVE","fmt ",this._packData(1,16),this._packData(0,1),this._packData(0,r.length),this._packData(1,e),this._packData(1,e*r.length*n/8),this._packData(0,r.length*n/8),this._packData(0,n),"data",this._packData(1,r[0].length*r.length*n/8),i],o=new Blob(a,{type:"audio/mpeg"});return{blob:o,url:URL.createObjectURL(o),channelCount:r.length,sampleRate:e,duration:i.byteLength/(r.length*e*2)}}}globalThis.WavPacker=Hd;const Jd=[4186.01,4434.92,4698.63,4978.03,5274.04,5587.65,5919.91,6271.93,6644.88,7040,7458.62,7902.13],Qd=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],Gd=[],Yd=[];for(let _f=1;_f<=8;_f++)for(let e=0;e<Jd.length;e++){const t=Jd[e];Gd.push(t/Math.pow(2,8-_f)),Yd.push(Qd[e]+_f)}const Kd=[32,2e3],Xd=Gd.filter((e,t)=>Gd[t]>Kd[0]&&Gd[t]<Kd[1]),Zd=Yd.filter((e,t)=>Gd[t]>Kd[0]&&Gd[t]<Kd[1]);class ef{static getFrequencies(e,t,n,r="frequency",i=-100,a=-30){n||(n=new Float32Array(e.frequencyBinCount),e.getFloatFrequencyData(n));const o=t/2,s=1/n.length*o;let l,c,u;if("music"===r||"voice"===r){const e="voice"===r?Xd:Gd,t=Array(e.length).fill(i);for(let r=0;r<n.length;r++){const i=r*s,a=n[r];for(let n=e.length-1;n>=0;n--)if(i>e[n]){t[n]=Math.max(t[n],a);break}}l=t,c="voice"===r?Xd:Gd,u="voice"===r?Zd:Yd}else l=Array.from(n),c=l.map((e,t)=>s*t),u=c.map(e=>`${e.toFixed(2)} Hz`);const d=l.map(e=>Math.max(0,Math.min((e-i)/(a-i),1)));return{values:new Float32Array(d),frequencies:c,labels:u}}constructor(e,t=null){if(this.fftResults=[],t){const{length:n,sampleRate:r}=t,i=new OfflineAudioContext({length:n,sampleRate:r}),a=i.createBufferSource();a.buffer=t;const o=i.createAnalyser();o.fftSize=8192,o.smoothingTimeConstant=.1,a.connect(o);const s=1/60,l=n/r,c=e=>{const t=s*e;t<l&&i.suspend(t).then(()=>{const t=new Float32Array(o.frequencyBinCount);o.getFloatFrequencyData(t),this.fftResults.push(t),c(e+1)}),1===e?i.startRendering():i.resume()};a.start(0),c(1),this.audio=e,this.context=i,this.analyser=o,this.sampleRate=r,this.audioBuffer=t}else{const t=new AudioContext,n=t.createMediaElementSource(e),r=t.createAnalyser();r.fftSize=8192,r.smoothingTimeConstant=.1,n.connect(r),r.connect(t.destination),this.audio=e,this.context=t,this.analyser=r,this.sampleRate=this.context.sampleRate,this.audioBuffer=null}}getFrequencies(e="frequency",t=-100,n=-30){let r=null;if(this.audioBuffer&&this.fftResults.length){const e=this.audio.currentTime/this.audio.duration,t=Math.min(e*this.fftResults.length|0,this.fftResults.length-1);r=this.fftResults[t]}return ef.getFrequencies(this.analyser,this.sampleRate,r,e,t,n)}resumeIfSuspended(){return d(this,null,function*(){return"suspended"===this.context.state&&(yield this.context.resume()),!0})}}globalThis.AudioAnalysis=ef;const tf=new Blob(["\nclass StreamProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.hasStarted = false;\n this.hasInterrupted = false;\n this.outputBuffers = [];\n this.bufferLength = 128;\n this.write = { buffer: new Float32Array(this.bufferLength), trackId: null };\n this.writeOffset = 0;\n this.trackSampleOffsets = {};\n this.port.onmessage = (event) => {\n if (event.data) {\n const payload = event.data;\n if (payload.event === 'write') {\n const int16Array = payload.buffer;\n const float32Array = new Float32Array(int16Array.length);\n for (let i = 0; i < int16Array.length; i++) {\n float32Array[i] = int16Array[i] / 0x8000; // Convert Int16 to Float32\n }\n this.writeData(float32Array, payload.trackId);\n } else if (\n payload.event === 'offset' ||\n payload.event === 'interrupt'\n ) {\n const requestId = payload.requestId;\n const trackId = this.write.trackId;\n const offset = this.trackSampleOffsets[trackId] || 0;\n this.port.postMessage({\n event: 'offset',\n requestId,\n trackId,\n offset,\n });\n if (payload.event === 'interrupt') {\n this.hasInterrupted = true;\n }\n } else {\n throw new Error(`Unhandled event \"${payload.event}\"`);\n }\n }\n };\n }\n\n writeData(float32Array, trackId = null) {\n let { buffer } = this.write;\n let offset = this.writeOffset;\n for (let i = 0; i < float32Array.length; i++) {\n buffer[offset++] = float32Array[i];\n if (offset >= buffer.length) {\n this.outputBuffers.push(this.write);\n this.write = { buffer: new Float32Array(this.bufferLength), trackId };\n buffer = this.write.buffer;\n offset = 0;\n }\n }\n this.writeOffset = offset;\n return true;\n }\n\n process(inputs, outputs, parameters) {\n const output = outputs[0];\n const outputChannelData = output[0];\n const outputBuffers = this.outputBuffers;\n if (this.hasInterrupted) {\n this.port.postMessage({ event: 'stop' });\n return false;\n } else if (outputBuffers.length) {\n this.hasStarted = true;\n const { buffer, trackId } = outputBuffers.shift();\n for (let i = 0; i < outputChannelData.length; i++) {\n outputChannelData[i] = buffer[i] || 0;\n }\n if (trackId) {\n this.trackSampleOffsets[trackId] =\n this.trackSampleOffsets[trackId] || 0;\n this.trackSampleOffsets[trackId] += buffer.length;\n }\n return true;\n } else if (this.hasStarted) {\n this.port.postMessage({ event: 'stop' });\n return false;\n } else {\n return true;\n }\n }\n}\n\nregisterProcessor('stream_processor', StreamProcessor);\n"],{type:"application/javascript"}),nf=URL.createObjectURL(tf);globalThis.WavStreamPlayer=class{constructor({sampleRate:e=44100}={}){this.scriptSrc=nf,this.sampleRate=e,this.context=null,this.stream=null,this.analyser=null,this.trackSampleOffsets={},this.interruptedTrackIds={}}connect(){return d(this,null,function*(){this.context=new AudioContext({sampleRate:this.sampleRate}),this._speakerID&&this.context.setSinkId(this._speakerID),"suspended"===this.context.state&&(yield this.context.resume());try{yield this.context.audioWorklet.addModule(this.scriptSrc)}catch(lr){throw console.error(lr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const e=this.context.createAnalyser();return e.fftSize=8192,e.smoothingTimeConstant=.1,this.analyser=e,!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.analyser)throw new Error("Not connected, please call .connect() first");return ef.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}updateSpeaker(e){return d(this,null,function*(){const t=this._speakerID;if(this._speakerID=e,this.context)try{"default"===e?yield this.context.setSinkId():yield this.context.setSinkId(e)}catch(lr){console.error(`Could not set sinkId to ${e}: ${lr}`),this._speakerID=t}})}_start(){const e=new AudioWorkletNode(this.context,"stream_processor");return e.connect(this.context.destination),e.port.onmessage=t=>{const{event:n}=t.data;if("stop"===n)e.disconnect(),this.stream=null;else if("offset"===n){const{requestId:e,trackId:n,offset:r}=t.data,i=r/this.sampleRate;this.trackSampleOffsets[e]={trackId:n,offset:r,currentTime:i}}},this.analyser.disconnect(),e.connect(this.analyser),this.stream=e,!0}add16BitPCM(e,t="default"){if("string"!=typeof t)throw new Error("trackId must be a string");if(this.interruptedTrackIds[t])return;let n;if(this.stream||this._start(),e instanceof Int16Array)n=e;else{if(!(e instanceof ArrayBuffer))throw new Error("argument must be Int16Array or ArrayBuffer");n=new Int16Array(e)}return this.stream.port.postMessage({event:"write",buffer:n,trackId:t}),n}getTrackSampleOffset(e=!1){return d(this,null,function*(){if(!this.stream)return null;const t=crypto.randomUUID();let n;for(this.stream.port.postMessage({event:e?"interrupt":"offset",requestId:t});!n;)n=this.trackSampleOffsets[t],yield new Promise(e=>setTimeout(()=>e(),1));const{trackId:r}=n;return e&&r&&(this.interruptedTrackIds[r]=!0),n})}interrupt(){return d(this,null,function*(){return this.getTrackSampleOffset(!0)})}};const rf=new Blob(["\nclass AudioProcessor extends AudioWorkletProcessor {\n\n constructor() {\n super();\n this.port.onmessage = this.receive.bind(this);\n this.initialize();\n }\n\n initialize() {\n this.foundAudio = false;\n this.recording = false;\n this.chunks = [];\n }\n\n /**\n * Concatenates sampled chunks into channels\n * Format is chunk[Left[], Right[]]\n */\n readChannelData(chunks, channel = -1, maxChannels = 9) {\n let channelLimit;\n if (channel !== -1) {\n if (chunks[0] && chunks[0].length - 1 < channel) {\n throw new Error(\n `Channel ${channel} out of range: max ${chunks[0].length}`\n );\n }\n channelLimit = channel + 1;\n } else {\n channel = 0;\n channelLimit = Math.min(chunks[0] ? chunks[0].length : 1, maxChannels);\n }\n const channels = [];\n for (let n = channel; n < channelLimit; n++) {\n const length = chunks.reduce((sum, chunk) => {\n return sum + chunk[n].length;\n }, 0);\n const buffers = chunks.map((chunk) => chunk[n]);\n const result = new Float32Array(length);\n let offset = 0;\n for (let i = 0; i < buffers.length; i++) {\n result.set(buffers[i], offset);\n offset += buffers[i].length;\n }\n channels[n] = result;\n }\n return channels;\n }\n\n /**\n * Combines parallel audio data into correct format,\n * channels[Left[], Right[]] to float32Array[LRLRLRLR...]\n */\n formatAudioData(channels) {\n if (channels.length === 1) {\n // Simple case is only one channel\n const float32Array = channels[0].slice();\n const meanValues = channels[0].slice();\n return { float32Array, meanValues };\n } else {\n const float32Array = new Float32Array(\n channels[0].length * channels.length\n );\n const meanValues = new Float32Array(channels[0].length);\n for (let i = 0; i < channels[0].length; i++) {\n const offset = i * channels.length;\n let meanValue = 0;\n for (let n = 0; n < channels.length; n++) {\n float32Array[offset + n] = channels[n][i];\n meanValue += channels[n][i];\n }\n meanValues[i] = meanValue / channels.length;\n }\n return { float32Array, meanValues };\n }\n }\n\n /**\n * Converts 32-bit float data to 16-bit integers\n */\n floatTo16BitPCM(float32Array) {\n const buffer = new ArrayBuffer(float32Array.length * 2);\n const view = new DataView(buffer);\n let offset = 0;\n for (let i = 0; i < float32Array.length; i++, offset += 2) {\n let s = Math.max(-1, Math.min(1, float32Array[i]));\n view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true);\n }\n return buffer;\n }\n\n /**\n * Retrieves the most recent amplitude values from the audio stream\n * @param {number} channel\n */\n getValues(channel = -1) {\n const channels = this.readChannelData(this.chunks, channel);\n const { meanValues } = this.formatAudioData(channels);\n return { meanValues, channels };\n }\n\n /**\n * Exports chunks as an audio/wav file\n */\n export() {\n const channels = this.readChannelData(this.chunks);\n const { float32Array, meanValues } = this.formatAudioData(channels);\n const audioData = this.floatTo16BitPCM(float32Array);\n return {\n meanValues: meanValues,\n audio: {\n bitsPerSample: 16,\n channels: channels,\n data: audioData,\n },\n };\n }\n\n receive(e) {\n const { event, id } = e.data;\n let receiptData = {};\n switch (event) {\n case 'start':\n this.recording = true;\n break;\n case 'stop':\n this.recording = false;\n break;\n case 'clear':\n this.initialize();\n break;\n case 'export':\n receiptData = this.export();\n break;\n case 'read':\n receiptData = this.getValues();\n break;\n default:\n break;\n }\n // Always send back receipt\n this.port.postMessage({ event: 'receipt', id, data: receiptData });\n }\n\n sendChunk(chunk) {\n const channels = this.readChannelData([chunk]);\n const { float32Array, meanValues } = this.formatAudioData(channels);\n const rawAudioData = this.floatTo16BitPCM(float32Array);\n const monoAudioData = this.floatTo16BitPCM(meanValues);\n this.port.postMessage({\n event: 'chunk',\n data: {\n mono: monoAudioData,\n raw: rawAudioData,\n },\n });\n }\n\n process(inputList, outputList, parameters) {\n // Copy input to output (e.g. speakers)\n // Note that this creates choppy sounds with Mac products\n const sourceLimit = Math.min(inputList.length, outputList.length);\n for (let inputNum = 0; inputNum < sourceLimit; inputNum++) {\n const input = inputList[inputNum];\n const output = outputList[inputNum];\n const channelCount = Math.min(input.length, output.length);\n for (let channelNum = 0; channelNum < channelCount; channelNum++) {\n input[channelNum].forEach((sample, i) => {\n output[channelNum][i] = sample;\n });\n }\n }\n const inputs = inputList[0];\n // There's latency at the beginning of a stream before recording starts\n // Make sure we actually receive audio data before we start storing chunks\n let sliceIndex = 0;\n if (!this.foundAudio) {\n for (const channel of inputs) {\n sliceIndex = 0; // reset for each channel\n if (this.foundAudio) {\n break;\n }\n if (channel) {\n for (const value of channel) {\n if (value !== 0) {\n // find only one non-zero entry in any channel\n this.foundAudio = true;\n break;\n } else {\n sliceIndex++;\n }\n }\n }\n }\n }\n if (inputs && inputs[0] && this.foundAudio && this.recording) {\n // We need to copy the TypedArray, because the `process`\n // internals will reuse the same buffer to hold each input\n const chunk = inputs.map((input) => input.slice(sliceIndex));\n this.chunks.push(chunk);\n this.sendChunk(chunk);\n }\n return true;\n }\n}\n\nregisterProcessor('audio_processor', AudioProcessor);\n"],{type:"application/javascript"}),af=URL.createObjectURL(rf);globalThis.WavRecorder=class{constructor({sampleRate:e=44100,outputToSpeakers:t=!1,debug:n=!1}={}){this.scriptSrc=af,this.sampleRate=e,this.outputToSpeakers=t,this.debug=!!n,this._deviceChangeCallback=null,this._deviceErrorCallback=null,this._devices=[],this.deviceSelection=null,this.stream=null,this.processor=null,this.source=null,this.node=null,this.recording=!1,this._lastEventId=0,this.eventReceipts={},this.eventTimeout=5e3,this._chunkProcessor=()=>{},this._chunkProcessorSize=void 0,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)}}static decode(e,t=44100,n=-1){return d(this,null,function*(){const r=new AudioContext({sampleRate:t});let i,a;if(e instanceof Blob){if(-1!==n)throw new Error('Can not specify "fromSampleRate" when reading from Blob');a=e,i=yield a.arrayBuffer()}else if(e instanceof ArrayBuffer){if(-1!==n)throw new Error('Can not specify "fromSampleRate" when reading from ArrayBuffer');i=e,a=new Blob([i],{type:"audio/wav"})}else{let t,r;if(e instanceof Int16Array){r=e,t=new Float32Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n]/32768}else if(e instanceof Float32Array)t=e;else{if(!(e instanceof Array))throw new Error('"audioData" must be one of: Blob, Float32Arrray, Int16Array, ArrayBuffer, Array<number>');t=new Float32Array(e)}if(-1===n)throw new Error('Must specify "fromSampleRate" when reading from Float32Array, In16Array or Array');if(n<3e3)throw new Error('Minimum "fromSampleRate" is 3000 (3kHz)');r||(r=Hd.floatTo16BitPCM(t));const o={bitsPerSample:16,channels:[t],data:r};a=(new Hd).pack(n,o).blob,i=yield a.arrayBuffer()}const o=yield r.decodeAudioData(i),s=o.getChannelData(0);return{blob:a,url:URL.createObjectURL(a),values:s,audioBuffer:o}})}log(){return this.debug&&this.log(...arguments),!0}getSampleRate(){return this.sampleRate}getStatus(){return this.processor?this.recording?"recording":"paused":"ended"}_event(e){return d(this,arguments,function*(e,t={},n=null){if(!(n=n||this.processor))throw new Error("Can not send events without recording first");const r={event:e,id:this._lastEventId++,data:t};n.port.postMessage(r);const i=(new Date).valueOf();for(;!this.eventReceipts[r.id];){if((new Date).valueOf()-i>this.eventTimeout)throw new Error(`Timeout waiting for "${e}" event`);yield new Promise(e=>setTimeout(()=>e(!0),1))}const a=this.eventReceipts[r.id];return delete this.eventReceipts[r.id],a})}listenForDeviceChange(e){if(null===e&&this._deviceChangeCallback)navigator.mediaDevices.removeEventListener("devicechange",this._deviceChangeCallback),this._deviceChangeCallback=null;else if(null!==e){let t=0,n=[];const r=e=>e.map(e=>e.deviceId).sort().join(","),i=()=>d(this,null,function*(){let i=++t;const a=yield this.listDevices();i===t&&r(n)!==r(a)&&(n=a,e(a.slice()))});navigator.mediaDevices.addEventListener("devicechange",i),i(),this._deviceChangeCallback=i}return!0}listenForDeviceErrors(e){this._deviceErrorCallback=e}requestPermission(){return d(this,null,function*(){const e=yield navigator.permissions.query({name:"microphone"});if("denied"===e.state)this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:new Error("Microphone access denied")});else if("prompt"===e.state)try{const e=yield navigator.mediaDevices.getUserMedia({audio:!0});e.getTracks().forEach(e=>e.stop())}catch(lr){console.error("Error accessing microphone."),this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:lr})}return!0})}listDevices(){return d(this,null,function*(){if(!navigator.mediaDevices||!("enumerateDevices"in navigator.mediaDevices))throw new Error("Could not request user devices");yield this.requestPermission();return(yield navigator.mediaDevices.enumerateDevices()).filter(e=>"audioinput"===e.kind)})}begin(e){return d(this,null,function*(){var t;if(this.processor)throw new Error("Already connected: please call .end() to start a new session");if(!navigator.mediaDevices||!("getUserMedia"in navigator.mediaDevices))throw this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic","cam"],type:"undefined-mediadevices"}),new Error("Could not request user media");e=null!=e?e:null==(t=this.deviceSelection)?void 0:t.deviceId;try{const t={audio:!0};e&&(t.audio={deviceId:{exact:e}}),this.stream=yield navigator.mediaDevices.getUserMedia(t)}catch(s){throw this._deviceErrorCallback&&this._deviceErrorCallback({devices:["mic"],type:"unknown",error:s}),new Error("Could not start media stream")}this.listDevices().then(t=>{e=this.stream.getAudioTracks()[0].getSettings().deviceId,console.log("find current device",t,e,this.stream.getAudioTracks()[0].getSettings()),this.deviceSelection=t.find(t=>t.deviceId===e),console.log("current device",this.deviceSelection)});const n=new AudioContext({sampleRate:this.sampleRate}),r=n.createMediaStreamSource(this.stream);try{yield n.audioWorklet.addModule(this.scriptSrc)}catch(lr){throw console.error(lr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const i=new AudioWorkletNode(n,"audio_processor");i.port.onmessage=e=>{const{event:t,id:n,data:r}=e.data;if("receipt"===t)this.eventReceipts[n]=r;else if("chunk"===t)if(this._chunkProcessorSize){const e=this._chunkProcessorBuffer;this._chunkProcessorBuffer={raw:Hd.mergeBuffers(e.raw,r.raw),mono:Hd.mergeBuffers(e.mono,r.mono)},this._chunkProcessorBuffer.mono.byteLength>=this._chunkProcessorSize&&(this._chunkProcessor(this._chunkProcessorBuffer),this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)})}else this._chunkProcessor(r)};const a=r.connect(i),o=n.createAnalyser();return o.fftSize=8192,o.smoothingTimeConstant=.1,a.connect(o),this.outputToSpeakers&&(console.warn("Warning: Output to speakers may affect sound quality,\nespecially due to system audio feedback preventative measures.\nuse only for debugging"),o.connect(n.destination)),this.source=r,this.node=a,this.analyser=o,this.processor=i,console.log("begin completed"),!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.processor)throw new Error("Session ended: please call .begin() first");return ef.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}pause(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!this.recording)throw new Error("Already paused: please call .record() first");return this._chunkProcessorBuffer.raw.byteLength&&this._chunkProcessor(this._chunkProcessorBuffer),this.log("Pausing ..."),yield this._event("stop"),this.recording=!1,!0})}record(e=()=>{},t=8192){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(this.recording)throw new Error("Already recording: please call .pause() first");if("function"!=typeof e)throw new Error("chunkProcessor must be a function");return this._chunkProcessor=e,this._chunkProcessorSize=t,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)},this.log("Recording ..."),yield this._event("start"),this.recording=!0,!0})}clear(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");return yield this._event("clear"),!0})}read(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");this.log("Reading ...");return yield this._event("read")})}save(e=!1){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!e&&this.recording)throw new Error("Currently recording: please call .pause() first, or call .save(true) to force");this.log("Exporting ...");const t=yield this._event("export");return(new Hd).pack(this.sampleRate,t.audio)})}end(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");const e=this.processor;this.log("Stopping ..."),yield this._event("stop"),this.recording=!1;this.stream.getTracks().forEach(e=>e.stop()),this.log("Exporting ...");const t=yield this._event("export",{},e);this.processor.disconnect(),this.source.disconnect(),this.node.disconnect(),this.analyser.disconnect(),this.stream=null,this.processor=null,this.source=null,this.node=null;return(new Hd).pack(this.sampleRate,t.audio)})}quit(){return d(this,null,function*(){return this.listenForDeviceChange(null),this.deviceSelection=null,this.processor&&(yield this.end()),!0})}};class of{constructor({sampleRate:e=44100,outputToSpeakers:t=!1,debug:n=!1}={}){this.scriptSrc=af,this.sampleRate=e,this.outputToSpeakers=t,this.debug=!!n,this.stream=null,this.processor=null,this.source=null,this.node=null,this.recording=!1,this._lastEventId=0,this.eventReceipts={},this.eventTimeout=5e3,this._chunkProcessor=()=>{},this._chunkProcessorSize=void 0,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)}}log(){return this.debug&&this.log(...arguments),!0}getSampleRate(){return this.sampleRate}getStatus(){return this.processor?this.recording?"recording":"paused":"ended"}_event(e){return d(this,arguments,function*(e,t={},n=null){if(!(n=n||this.processor))throw new Error("Can not send events without recording first");const r={event:e,id:this._lastEventId++,data:t};n.port.postMessage(r);const i=(new Date).valueOf();for(;!this.eventReceipts[r.id];){if((new Date).valueOf()-i>this.eventTimeout)throw new Error(`Timeout waiting for "${e}" event`);yield new Promise(e=>setTimeout(()=>e(!0),1))}const a=this.eventReceipts[r.id];return delete this.eventReceipts[r.id],a})}begin(e){return d(this,null,function*(){if(this.processor)throw new Error("Already connected: please call .end() to start a new session");if(!e||"audio"!==e.kind)throw new Error("No audio track provided");this.stream=new MediaStream([e]);const t=new AudioContext({sampleRate:this.sampleRate}),n=t.createMediaStreamSource(this.stream);try{yield t.audioWorklet.addModule(this.scriptSrc)}catch(lr){throw console.error(lr),new Error(`Could not add audioWorklet module: ${this.scriptSrc}`)}const r=new AudioWorkletNode(t,"audio_processor");r.port.onmessage=e=>{const{event:t,id:n,data:r}=e.data;if("receipt"===t)this.eventReceipts[n]=r;else if("chunk"===t)if(this._chunkProcessorSize){const e=this._chunkProcessorBuffer;this._chunkProcessorBuffer={raw:Hd.mergeBuffers(e.raw,r.raw),mono:Hd.mergeBuffers(e.mono,r.mono)},this._chunkProcessorBuffer.mono.byteLength>=this._chunkProcessorSize&&(this._chunkProcessor(this._chunkProcessorBuffer),this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)})}else this._chunkProcessor(r)};const i=n.connect(r),a=t.createAnalyser();return a.fftSize=8192,a.smoothingTimeConstant=.1,i.connect(a),this.outputToSpeakers&&(console.warn("Warning: Output to speakers may affect sound quality,\nespecially due to system audio feedback preventative measures.\nuse only for debugging"),a.connect(t.destination)),this.source=n,this.node=i,this.analyser=a,this.processor=r,!0})}getFrequencies(e="frequency",t=-100,n=-30){if(!this.processor)throw new Error("Session ended: please call .begin() first");return ef.getFrequencies(this.analyser,this.sampleRate,null,e,t,n)}pause(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!this.recording)throw new Error("Already paused: please call .record() first");return this._chunkProcessorBuffer.raw.byteLength&&this._chunkProcessor(this._chunkProcessorBuffer),this.log("Pausing ..."),yield this._event("stop"),this.recording=!1,!0})}record(e=()=>{},t=8192){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(this.recording)throw new Error("Already recording: HELLO please call .pause() first");if("function"!=typeof e)throw new Error("chunkProcessor must be a function");return this._chunkProcessor=e,this._chunkProcessorSize=t,this._chunkProcessorBuffer={raw:new ArrayBuffer(0),mono:new ArrayBuffer(0)},this.log("Recording ..."),yield this._event("start"),this.recording=!0,!0})}clear(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");return yield this._event("clear"),!0})}read(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");this.log("Reading ...");return yield this._event("read")})}save(e=!1){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");if(!e&&this.recording)throw new Error("Currently recording: please call .pause() first, or call .save(true) to force");this.log("Exporting ...");const t=yield this._event("export");return(new Hd).pack(this.sampleRate,t.audio)})}end(){return d(this,null,function*(){if(!this.processor)throw new Error("Session ended: please call .begin() first");const e=this.processor;this.log("Stopping ..."),yield this._event("stop"),this.recording=!1,this.log("Exporting ...");const t=yield this._event("export",{},e);this.processor.disconnect(),this.source.disconnect(),this.node.disconnect(),this.analyser.disconnect(),this.stream=null,this.processor=null,this.source=null,this.node=null;return(new Hd).pack(this.sampleRate,t.audio)})}quit(){return d(this,null,function*(){return this.listenForDeviceChange(null),this.processor&&(yield this.end()),!0})}}globalThis.WavRecorder=WavRecorder;var sf,lf,cf;sf=JSON.parse('{"name":"@pipecat-ai/daily-transport","version":"1.5.0","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/pipecat-ai/pipecat-client-web-transports.git"},"files":["dist","package.json","README.md"],"scripts":{"build":"parcel build --no-cache","dev":"parcel watch","lint":"eslint . --ext ts --report-unused-disable-directives --max-warnings 0"},"devDependencies":{"@pipecat-ai/client-js":"^1.5.0","eslint":"9.39.1","eslint-config-prettier":"^9.1.0","eslint-plugin-simple-import-sort":"^12.1.1"},"peerDependencies":{"@pipecat-ai/client-js":"~1.5.0"},"dependencies":{"@daily-co/daily-js":"^0.84.0"},"description":"Pipecat Daily Transport Package","author":"Daily.co","bugs":{"url":"https://github.com/pipecat-ai/pipecat-client-web-transports/issues"},"homepage":"https://github.com/pipecat-ai/pipecat-client-web-transports/blob/main/transports/daily-webrtc/README.md"}'),(cf=lf||(lf={})).AUDIO_BUFFERING_STARTED="audio-buffering-started",cf.AUDIO_BUFFERING_STOPPED="audio-buffering-stopped";class uf{constructor(e){this._daily=e,this._proxy=new Proxy(this._daily,{get:(e,t,n)=>{if("function"==typeof e[t]){let n;switch(String(t)){case"preAuth":n="Calls to preAuth() are disabled. Please use Transport.preAuth()";break;case"startCamera":n="Calls to startCamera() are disabled. Please use PipecatClient.initDevices()";break;case"join":n="Calls to join() are disabled. Please use PipecatClient.connect()";break;case"leave":n="Calls to leave() are disabled. Please use PipecatClient.disconnect()";break;case"destroy":n="Calls to destroy() are disabled."}return n?()=>{throw new Error(n)}:(...n)=>e[t](...n)}return Reflect.get(e,t,n)}})}get proxy(){return this._proxy}}class df extends Rd{constructor(e={}){var t;super(),this._botId="",this._selectedCam={},this._selectedMic={},this._selectedSpeaker={},this._currentAudioTrack=null,this._audioQueue=[],this._callbacks={};const n=e,{bufferLocalAudioUntilBotReady:r}=n,i=u(n,["bufferLocalAudioUntilBotReady"]);this._dailyFactoryOptions=i,void 0===(null==(t=this._dailyFactoryOptions.dailyConfig)?void 0:t.useDevicePreferenceCookies)&&(null==this._dailyFactoryOptions.dailyConfig&&(this._dailyFactoryOptions.dailyConfig={}),this._dailyFactoryOptions.dailyConfig.useDevicePreferenceCookies=!0),this._bufferLocalAudioUntilBotReady=r||!1,this._daily=qc.createCallObject(c(l({},this._dailyFactoryOptions),{allowMultipleCallInstances:!0})),this._dailyWrapper=new uf(this._daily)}setupRecorder(){this._mediaStreamRecorder=new of({sampleRate:df.RECORDER_SAMPLE_RATE})}handleUserAudioStream(e){this._audioQueue.push(e)}flushAudioQueue(){if(0!==this._audioQueue.length)for(Ad.debug(`Will flush audio queue: ${this._audioQueue.length}`);this._audioQueue.length>0;){const e=[];for(;e.length<10&&this._audioQueue.length>0;){const t=this._audioQueue.shift();t&&e.push(t)}e.length>0&&this._sendAudioBatch(e)}}_sendAudioBatch(e){const t={id:"raw-audio-batch",label:"rtvi-ai",type:"raw-audio-batch",data:{base64AudioBatch:e.map(e=>{const t=new Uint8Array(e);return btoa(String.fromCharCode(...t))}),sampleRate:df.RECORDER_SAMPLE_RATE,numChannels:1}};this.sendMessage(t)}initialize(e,t){var n,r,i;this._bufferLocalAudioUntilBotReady&&this.setupRecorder(),this._callbacks=null!=(n=e.callbacks)?n:{},this._onMessage=t,null!=this._dailyFactoryOptions.startVideoOff&&null==e.enableCam||(this._dailyFactoryOptions.startVideoOff=!(null!=(r=e.enableCam)&&r)),null!=this._dailyFactoryOptions.startAudioOff&&null==e.enableMic||(this._dailyFactoryOptions.startAudioOff=!(null==(i=e.enableMic)||i)),this.attachEventListeners(),this.state="disconnected",Ad.debug("[Daily Transport] Initialized",$d(sf).version)}get dailyCallClient(){return this._dailyWrapper.proxy}get state(){return this._state}set state(e){var t,n;this._state!==e&&(this._state=e,null==(n=(t=this._callbacks).onTransportStateChanged)||n.call(t,e))}getSessionInfo(){return this._daily.meetingSessionSummary()}getAllCams(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"videoinput"===e.kind)})}updateCam(e){this._daily.setInputDevicesAsync({videoDeviceId:e}).then(e=>{this._selectedCam=e.camera})}get selectedCam(){return this._selectedCam}getAllMics(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"audioinput"===e.kind)})}updateMic(e){this._daily.setInputDevicesAsync({audioDeviceId:e}).then(e=>{this._selectedMic=e.mic})}get selectedMic(){return this._selectedMic}getAllSpeakers(){return d(this,null,function*(){const{devices:e}=yield this._daily.enumerateDevices();return e.filter(e=>"audiooutput"===e.kind)})}updateSpeaker(e){this._daily.setOutputDeviceAsync({outputDeviceId:e}).then(e=>{this._selectedSpeaker=e.speaker}).catch(e=>{var t,n,r;null==(r=(n=this._callbacks).onDeviceError)||r.call(n,new cd(["speaker"],null!=(t=e.type)?t:"unknown",e.message))})}get selectedSpeaker(){return this._selectedSpeaker}enableMic(e){this._daily.setLocalAudio(e)}get isMicEnabled(){return this._daily.localAudio()}enableCam(e){this._daily.setLocalVideo(e)}get isCamEnabled(){return this._daily.localVideo()}enableScreenShare(e){e?this._daily.startScreenShare():this._daily.stopScreenShare()}get isSharingScreen(){return this._daily.localScreenAudio()||this._daily.localScreenVideo()}tracks(){var e,t,n,r,i,a,o,s,l,c,u,d,f,p,h,m,g;const v=null!=(e=this._daily.participants())?e:{},y=null==v?void 0:v[this._botId],b={local:{audio:null==(r=null==(n=null==(t=null==v?void 0:v.local)?void 0:t.tracks)?void 0:n.audio)?void 0:r.persistentTrack,screenAudio:null==(o=null==(a=null==(i=null==v?void 0:v.local)?void 0:i.tracks)?void 0:a.screenAudio)?void 0:o.persistentTrack,screenVideo:null==(c=null==(l=null==(s=null==v?void 0:v.local)?void 0:s.tracks)?void 0:l.screenVideo)?void 0:c.persistentTrack,video:null==(f=null==(d=null==(u=null==v?void 0:v.local)?void 0:u.tracks)?void 0:d.video)?void 0:f.persistentTrack}};return y&&(b.bot={audio:null==(h=null==(p=null==y?void 0:y.tracks)?void 0:p.audio)?void 0:h.persistentTrack,video:null==(g=null==(m=null==y?void 0:y.tracks)?void 0:m.video)?void 0:g.persistentTrack}),b}startRecording(){return d(this,null,function*(){var e,t;try{Ad.info("[Daily Transport] Initializing recording"),yield this._mediaStreamRecorder.record(e=>{this.handleUserAudioStream(e.mono)},df.RECORDER_CHUNK_SIZE),null==(t=(e=this._callbacks).onAudioBufferingStarted)||t.call(e),Ad.info("[Daily Transport] Recording Initialized")}catch(lr){lr.message.includes("Already recording")||Ad.error("Error starting recording",lr)}})}preAuth(e){return d(this,null,function*(){this._dailyFactoryOptions=e,yield this._daily.preAuth(e)})}initDevices(){return d(this,null,function*(){var e,t,n,r,i,a,o,s,l,c,u,d;if(!this._daily)throw new td("Transport instance not initialized");this.state="initializing";const f=yield this._daily.startCamera(this._dailyFactoryOptions),{devices:p}=yield this._daily.enumerateDevices(),h=p.filter(e=>"videoinput"===e.kind),m=p.filter(e=>"audioinput"===e.kind),g=p.filter(e=>"audiooutput"===e.kind);this._selectedCam=f.camera,this._selectedMic=f.mic,this._selectedSpeaker=f.speaker,null==(t=(e=this._callbacks).onAvailableCamsUpdated)||t.call(e,h),null==(r=(n=this._callbacks).onAvailableMicsUpdated)||r.call(n,m),null==(a=(i=this._callbacks).onAvailableSpeakersUpdated)||a.call(i,g),null==(s=(o=this._callbacks).onCamUpdated)||s.call(o,f.camera),null==(c=(l=this._callbacks).onMicUpdated)||c.call(l,f.mic),null==(d=(u=this._callbacks).onSpeakerUpdated)||d.call(u,f.speaker),this._daily.isLocalAudioLevelObserverRunning()||(yield this._daily.startLocalAudioLevelObserver(100)),this._daily.isRemoteParticipantsAudioLevelObserverRunning()||(yield this._daily.startRemoteParticipantsAudioLevelObserver(100)),this.state="initialized"})}_validateConnectionParams(e){if(null==e)return;if("object"!=typeof e)throw new td("Invalid connection parameters");const t=e;return t.room_url?(t.url=t.room_url,delete t.room_url):t.dailyRoom&&(t.url=t.dailyRoom,delete t.dailyRoom),t.dailyToken&&(t.token=t.dailyToken,delete t.dailyToken),t.token||delete t.token,t}_connect(e){return d(this,null,function*(){var t,n,r;if(!this._daily)throw new td("Transport instance not initialized");e&&(this._dailyFactoryOptions=l(l({},this._dailyFactoryOptions),e)),this.state="connecting";try{yield this._daily.join(this._dailyFactoryOptions)}catch(lr){throw Ad.error("Failed to join room",lr),this.state="error",new id}(null==(t=this._abortController)?void 0:t.signal.aborted)||(this.state="connected",null==(r=(n=this._callbacks).onConnected)||r.call(n))})}sendReadyMessage(){return d(this,null,function*(){return new Promise(e=>{var t,n;const r=()=>{this.state="ready",this.flushAudioQueue(),this.sendMessage(Sd.clientReady()),this.stopRecording(),e()};for(const a in this._daily.participants()){const i=this._daily.participants()[a];if(!i.local&&(null==(n=null==(t=i.tracks)?void 0:t.audio)?void 0:n.persistentTrack))return r(),void e()}const i=e=>{var t;(null==(t=e.participant)?void 0:t.local)||(this._daily.off("track-started",i),(()=>{const e=navigator.userAgent;return/iPad|iPhone|iPod/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document})()?(Ad.debug("[Daily Transport] iOS device detected, adding 0.5 second delay before sending ready message"),setTimeout(r,500)):r())};this._daily.on("track-started",i)})})}stopRecording(){var e,t;this._mediaStreamRecorder&&"ended"!==this._mediaStreamRecorder.getStatus()&&(this._mediaStreamRecorder.end(),null==(t=(e=this._callbacks).onAudioBufferingStopped)||t.call(e))}attachEventListeners(){this._daily.on("available-devices-updated",this.handleAvailableDevicesUpdated.bind(this)),this._daily.on("selected-devices-updated",this.handleSelectedDevicesUpdated.bind(this)),this._daily.on("camera-error",this.handleDeviceError.bind(this)),this._daily.on("track-started",this.handleTrackStarted.bind(this)),this._daily.on("track-stopped",this.handleTrackStopped.bind(this)),this._daily.on("participant-joined",this.handleParticipantJoined.bind(this)),this._daily.on("participant-left",this.handleParticipantLeft.bind(this)),this._daily.on("local-audio-level",this.handleLocalAudioLevel.bind(this)),this._daily.on("remote-participants-audio-level",this.handleRemoteAudioLevel.bind(this)),this._daily.on("app-message",this.handleAppMessage.bind(this)),this._daily.on("left-meeting",this.handleLeftMeeting.bind(this)),this._daily.on("error",this.handleFatalError.bind(this)),this._daily.on("nonfatal-error",this.handleNonFatalError.bind(this))}_disconnect(){return d(this,null,function*(){this.state="disconnecting",this._daily.stopLocalAudioLevelObserver(),this._daily.stopRemoteParticipantsAudioLevelObserver(),this._audioQueue=[],this._currentAudioTrack=null,this.stopRecording(),yield this._daily.leave()})}sendMessage(e){this._daily.sendAppMessage(e,"*")}handleAppMessage(e){"rtvi-ai"===e.data.label&&this._onMessage({id:e.data.id,type:e.data.type,data:e.data.data})}handleAvailableDevicesUpdated(e){var t,n,r,i,a,o;null==(n=(t=this._callbacks).onAvailableCamsUpdated)||n.call(t,e.availableDevices.filter(e=>"videoinput"===e.kind)),null==(i=(r=this._callbacks).onAvailableMicsUpdated)||i.call(r,e.availableDevices.filter(e=>"audioinput"===e.kind)),null==(o=(a=this._callbacks).onAvailableSpeakersUpdated)||o.call(a,e.availableDevices.filter(e=>"audiooutput"===e.kind))}handleSelectedDevicesUpdated(e){var t,n,r,i,a,o,s,l,c;(null==(t=this._selectedCam)?void 0:t.deviceId)!==e.devices.camera&&(this._selectedCam=e.devices.camera,null==(r=(n=this._callbacks).onCamUpdated)||r.call(n,e.devices.camera)),(null==(i=this._selectedMic)?void 0:i.deviceId)!==e.devices.mic&&(this._selectedMic=e.devices.mic,null==(o=(a=this._callbacks).onMicUpdated)||o.call(a,e.devices.mic)),(null==(s=this._selectedSpeaker)?void 0:s.deviceId)!==e.devices.speaker&&(this._selectedSpeaker=e.devices.speaker,null==(c=(l=this._callbacks).onSpeakerUpdated)||c.call(l,e.devices.speaker))}handleDeviceError(e){var t,n;null==(n=(t=this._callbacks).onDeviceError)||n.call(t,(e=>{const t=[];switch(e.type){case"permissions":return e.blockedMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new cd(t,e.type,e.msg,{blockedBy:e.blockedBy});case"not-found":return e.missingMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new cd(t,e.type,e.msg);case"constraints":return e.failedMedia.forEach(e=>{t.push("video"===e?"cam":"mic")}),new cd(t,e.type,e.msg,{reason:e.reason});case"cam-in-use":return t.push("cam"),new cd(t,"in-use",e.msg);case"mic-in-use":return t.push("mic"),new cd(t,"in-use",e.msg);case"cam-mic-in-use":return t.push("cam"),t.push("mic"),new cd(t,"in-use",e.msg);default:return t.push("cam"),t.push("mic"),new cd(t,e.type,e.msg)}})(e.error))}handleLocalAudioTrack(e){return d(this,null,function*(){if("ready"==this.state||!this._bufferLocalAudioUntilBotReady)return;switch(this._mediaStreamRecorder.getStatus()){case"ended":try{yield this._mediaStreamRecorder.begin(e),yield this.startRecording()}catch(lr){}break;case"paused":yield this.startRecording();break;default:if(this._currentAudioTrack!==e)try{yield this._mediaStreamRecorder.end(),yield this._mediaStreamRecorder.begin(e),yield this.startRecording()}catch(lr){}else Ad.warn("track-started event received for current track and already recording")}this._currentAudioTrack=e})}handleTrackStarted(e){var t,n,r,i,a;"screenAudio"===e.type||"screenVideo"===e.type?null==(n=(t=this._callbacks).onScreenTrackStarted)||n.call(t,e.track,e.participant?ff(e.participant):void 0):((null==(r=e.participant)?void 0:r.local)&&"audio"===e.track.kind&&this.handleLocalAudioTrack(e.track),null==(a=(i=this._callbacks).onTrackStarted)||a.call(i,e.track,e.participant?ff(e.participant):void 0))}handleTrackStopped(e){var t,n,r,i;"screenAudio"===e.type||"screenVideo"===e.type?null==(n=(t=this._callbacks).onScreenTrackStopped)||n.call(t,e.track,e.participant?ff(e.participant):void 0):null==(i=(r=this._callbacks).onTrackStopped)||i.call(r,e.track,e.participant?ff(e.participant):void 0)}handleParticipantJoined(e){var t,n,r,i;const a=ff(e.participant);null==(n=(t=this._callbacks).onParticipantJoined)||n.call(t,a),a.local||(this._botId=e.participant.session_id,null==(i=(r=this._callbacks).onBotConnected)||i.call(r,a))}handleParticipantLeft(e){var t,n,r,i;const a=ff(e.participant);null==(n=(t=this._callbacks).onParticipantLeft)||n.call(t,a),a.local||(this._botId="",null==(i=(r=this._callbacks).onBotDisconnected)||i.call(r,a))}handleLocalAudioLevel(e){var t,n;null==(n=(t=this._callbacks).onLocalAudioLevel)||n.call(t,e.audioLevel)}handleRemoteAudioLevel(e){var t,n;const r=this._daily.participants(),i=Object.keys(e.participantsAudioLevel);for(let a=0;a<i.length;a++){const o=i[a],s=e.participantsAudioLevel[o];null==(n=(t=this._callbacks).onRemoteAudioLevel)||n.call(t,s,ff(r[o]))}}handleLeftMeeting(){var e,t;this.state="disconnected",this._botId="",null==(t=(e=this._callbacks).onDisconnected)||t.call(e)}handleFatalError(e){var t,n;Ad.error("Daily fatal error",e.errorMsg),this.state="error",this._botId="",null==(n=(t=this._callbacks).onError)||n.call(t,Sd.error(e.errorMsg,!0))}handleNonFatalError(e){var t,n;if("screen-share-error"===e.type)null==(n=(t=this._callbacks).onScreenShareError)||n.call(t,e.errorMsg)}}df.RECORDER_SAMPLE_RATE=16e3,df.RECORDER_CHUNK_SIZE=512;const ff=e=>({id:e.user_id,local:e.local,name:e.user_name});function pf(e,t,n={}){const{pipecatClient:r,connectionState:i,isBotReady:a,isMicEnabled:o,isUserSpeaking:s,remoteAudioStream:u,addMessage:f,setPipecatClient:p,setConnectionState:h,setIsBotReady:m,setIsMicEnabled:g,setIsUserSpeaking:v,setRemoteAudioStream:y}=H(),b=x.useRef(null),w=x.useRef(!1),k=x.useRef(null),S=x.useRef(!1);x.useEffect(()=>{const e=b.current;if(e&&u)try{e.srcObject=u,e.volume=1;const t=e.play();t&&t.then(()=>{}).catch(e=>{})}catch(t){}return()=>{e&&(e.srcObject=null)}},[u]);const _=x.useCallback(()=>d(null,null,function*(){var r;if(!S.current&&"disconnected"===i){S.current=!0,h("connecting");try{if(!e||!t)throw new Error("Missing agent ID or prompt token");const r={agent_id:e,conversation_metadata:c(l({},n),{agent_id:e}),prompt_access_token:t,conversation_visibility:!1,conversation_config_type:"VOICE"},i=yield function(e){return d(this,null,function*(){const t=`${Q}/v1/widgets/sessions/daily`,n=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Prompt-Token":e.prompt_access_token},body:JSON.stringify(e)});if(!n.ok){const e=yield n.json().catch(()=>({}));throw new Error(e.detail||e.message||`HTTP ${n.status}`)}const r=yield n.json();return r.conversation_id,r})}(r);if(!(null==i?void 0:i.dailyRoom)||!(null==i?void 0:i.dailyToken))throw new Error("Invalid response from server");const{dailyRoom:a,dailyToken:s,conversation_id:u}=i,b=new Vd({transport:new df,enableMic:o,enableCam:!1,timeout:3e4,callbacks:{onTransportStateChanged:e=>{h(e)},onConnected:()=>{f({type:"separator",text:"Voice call started"})},onBotReady:e=>{m(!0),h("ready")},onBotStartedSpeaking:()=>{m(e=>e||(h("ready"),!0))},onDisconnected:()=>{h("disconnected"),m(!1),w.current||f({type:"separator",text:"Call disconnected"})},onTrackStarted:(e,t)=>{if("audio"===e.kind&&!(null==t?void 0:t.local)){const t=new MediaStream([e]);y(t)}},onUserStartedSpeaking:()=>{v(!0)},onUserStoppedSpeaking:()=>{v(!1)},onUserTranscript:e=>{(null==e?void 0:e.final)&&(null==e?void 0:e.text)&&(e.text,f({type:"user",text:e.text,isTranscript:!0}))},onBotTranscript:e=>{var t;const n=(null==(t=null==e?void 0:e.text)?void 0:t.trim())||"";n&&f({type:"assistant",text:n,isTranscript:!0})},onMicStateChanged:e=>{g(e)},onError:e=>{var t,n;const r=(null==(t=null==e?void 0:e.data)?void 0:t.error)||(null==e?void 0:e.message)||"";r.includes("validation error")||r.includes("FunctionResponse")||!(null==(n=null==e?void 0:e.data)?void 0:n.fatal)?(f({type:"separator",text:"Agent disconnected"}),E()):(h("error"),f({type:"system",text:`Error: ${r}`}))}}});p(b),k.current=b,yield b.initDevices(),yield b.connect({url:a,token:s})}catch(a){S.current=!1,h("error");let e="Failed to start call";e=(null==(r=a.message)?void 0:r.includes("Failed to fetch"))?"Cannot reach server":"NotAllowedError"===a.name?"Microphone access denied":"NotFoundError"===a.name?"No microphone found":a.message,f({type:"system",text:`❌ ${e}`})}}}),[e,t,n,i,o,h,p,m,g,y,f]),E=x.useCallback(()=>d(null,null,function*(){var e;try{if(f({type:"separator",text:"Voice call ended"}),w.current=!0,S.current=!1,r&&"disconnected"!==i&&(yield r.disconnect()),null==(e=b.current)?void 0:e.srcObject){b.current.srcObject.getTracks().forEach(e=>e.stop()),b.current.srcObject=null}y(null),p(null),k.current=null,h("disconnected"),m(!1),setTimeout(()=>{w.current=!1},500)}catch(t){S.current=!1,p(null),k.current=null,h("disconnected"),m(!1)}}),[r,i,p,h,m,y,f]),C=x.useCallback(()=>{if(r&&a)try{const e=!o;r.enableMic(e),g(e)}catch(e){}},[r,o,a,g]),T=x.useCallback(e=>d(null,null,function*(){if(r)if(a)try{yield r.sendText(e),f({type:"user",text:e,isTranscript:!1})}catch(t){f({type:"system",text:`Error: ${t.message||"Failed to send text"}`})}else f({type:"system",text:"Please wait for the bot to be ready before sending text"})}),[r,a,f]);return x.useEffect(()=>()=>{var e;const t=k.current;if(t&&(w.current=!0,t.disconnect().catch(e=>{})),null==(e=b.current)?void 0:e.srcObject){b.current.srcObject.getTracks().forEach(e=>e.stop())}},[]),{connectionState:i,isBotReady:a,isMicEnabled:o,isUserSpeaking:s,startCall:_,endCall:E,toggleMic:C,sendTextDuringCall:T,remoteAudioRef:b}}function hf({agentId:e,agentName:t,avatarUrl:n,promptToken:r,metadata:i,showTranscripts:a=!0,idlePromptMessages:o=[],onClose:s,className:l}){const{messages:c}=H(),[u,d]=x.useState(""),[f,p]=x.useState(0),h=x.useRef(null),{connectionState:m,isBotReady:g,isMicEnabled:v,isUserSpeaking:y,startCall:w,endCall:k,toggleMic:S,sendTextDuringCall:_,remoteAudioRef:E}=pf(e,r,i);x.useEffect(()=>("disconnected"===m&&w(),()=>{"disconnected"!==m&&k()}),[]);const C="connecting"===m||!g,T="ready"===m||"connected"===m,M="error"===m;x.useEffect(()=>{var e;null==(e=h.current)||e.scrollIntoView({behavior:"smooth"})},[c]),x.useEffect(()=>{if(!C||!(null==o?void 0:o.length))return;const e=setInterval(()=>{p(e=>(e+1)%o.length)},3e3);return()=>clearInterval(e)},[C,o]);const P=T&&y?{text:"Transcribing",animate:!0}:null,A=M?"error":C?"connecting":v?"listening":"muted",O=c.filter(e=>e.isTranscript||"separator"===e.type||"system"===e.type||"user"===e.type||"assistant"===e.type);return b.jsxs("div",{className:yt("flex flex-col h-full w-full animate-fade-in min-h-0 relative",l),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsx("audio",{ref:E,autoPlay:!0,playsInline:!0,style:{display:"none"}}),b.jsx("button",{onClick:()=>{k(),s()},className:"absolute top-4 right-4 p-2 rounded-full hover:opacity-80 transition-opacity z-10",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(Ft,{className:"h-6 w-6"})}),C&&b.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[b.jsx("div",{className:"mb-6",children:b.jsx(qn,{loading:!0,size:180,strokeWidth:4,gap:6,children:b.jsx(_t,{src:n,alt:t,size:"2xl",className:"shadow-lg"})})}),b.jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:"var(--widget-text-primary, #111827)"},children:t}),b.jsx("p",{className:"text-sm mb-6",style:{color:"var(--widget-status-connecting, #F59E0B)"},children:"Connecting..."}),(null==o?void 0:o.length)>0&&b.jsx("div",{className:"text-center px-4 py-3 rounded-lg max-w-xs animate-fade-in",style:{backgroundColor:"var(--widget-idle-prompt-bg, #F3F4F6)",color:"var(--widget-idle-prompt-text, #6B7280)"},children:b.jsx("p",{className:"text-sm",children:o[f]})},f)]}),!C&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 shrink-0",style:{backgroundColor:"var(--widget-header-bg, #F9FAFB)",borderBottom:"1px solid var(--widget-header-border, #E5E7EB)"},children:[b.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[b.jsxs("div",{className:"relative",children:[b.jsx(_t,{src:n,alt:t,size:"sm"}),A&&b.jsx("span",{className:yt("absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full border-2",("listening"===A||"connecting"===A)&&"animate-pulse"),style:{backgroundColor:"listening"===A?"var(--widget-status-success, #10B981)":"connecting"===A?"var(--widget-status-warning, #F59E0B)":"var(--widget-status-error, #EF4444)",borderColor:"var(--widget-header-bg, #F9FAFB)"}})]}),b.jsxs("div",{children:[b.jsx("h2",{className:"text-sm font-semibold leading-tight",style:{color:"var(--widget-header-text, #111827)"},children:t}),A&&b.jsxs("span",{className:"text-xs",style:{color:"listening"===A?"var(--widget-status-success, #10B981)":"error"===A?"var(--widget-status-error, #EF4444)":"var(--widget-text-muted, #9CA3AF)"},children:["listening"===A&&"Listening...","connecting"===A&&"Connecting...","muted"===A&&"Muted","error"===A&&"Connection failed"]})]})]}),b.jsx("div",{className:"w-9"})]}),b.jsx(Fn,{className:"flex-1 min-h-0",children:b.jsxs("div",{className:"p-4 space-y-3 min-h-full",children:[0===O.length&&!P&&b.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:b.jsx("p",{className:"text-sm",style:{color:"var(--widget-text-muted, #9CA3AF)"},children:"Start Conversation"})}),O.map(e=>b.jsx(mf,{message:e},e.id)),P&&b.jsx("div",{className:"flex justify-end",children:b.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 rounded-2xl rounded-br-md text-sm",style:{backgroundColor:"var(--widget-user-message-bg, #3B82F6)",color:"var(--widget-user-message-text, #FFFFFF)"},children:[b.jsx("span",{children:P.text}),b.jsxs("span",{className:"flex gap-1",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-bounce",style:{animationDelay:"0ms"}}),b.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-bounce",style:{animationDelay:"150ms"}}),b.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-bounce",style:{animationDelay:"300ms"}})]})]})}),b.jsx("div",{ref:h})]})}),b.jsxs("div",{className:"shrink-0",style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",backgroundColor:"var(--widget-background, #FFFFFF)"},children:[b.jsxs("form",{onSubmit:e=>{e.preventDefault(),u.trim()&&T&&(_(u.trim()),d(""))},className:"flex items-center gap-2 px-4 py-2",children:[b.jsx("input",{type:"text",value:u,onChange:e=>d(e.target.value),placeholder:"Type a message...",disabled:!T,className:"flex-1 h-10 px-4 rounded-full outline-none transition-all text-sm",style:{backgroundColor:"var(--widget-input-bg, #F9FAFB)",color:"var(--widget-input-text, #111827)",border:"1px solid var(--widget-input-border, #E5E7EB)",fontFamily:"var(--widget-font-family, inherit)"}}),b.jsx(St,{type:"submit",variant:"ghost",size:"icon",disabled:!u.trim()||!T,className:"shrink-0 rounded-full h-10 w-10",children:b.jsx(Rt,{className:"h-4 w-4"})})]}),b.jsxs("div",{className:"flex justify-center gap-4 px-4 pt-2",style:{paddingBottom:"max(1rem, env(safe-area-inset-bottom, 0px))"},children:[b.jsx(St,{onClick:S,variant:v?"secondary":"outline",size:"icon-lg",className:"rounded-full h-12 w-12",disabled:!T,style:{backgroundColor:v?"var(--widget-button-secondary-bg, #F3F4F6)":"transparent",borderColor:v?void 0:"var(--widget-border, #E5E7EB)"},children:v?b.jsx(jt,{className:"h-5 w-5",style:{color:"var(--widget-text-primary, #111827)"}}):b.jsx(Lt,{className:"h-5 w-5",style:{color:"var(--widget-text-muted, #9CA3AF)"}})}),b.jsx(St,{onClick:()=>{k(),s()},variant:"destructive",size:"icon-lg",className:"rounded-full h-12 w-12",children:b.jsx(It,{className:"h-5 w-5"})})]})]})]})]})}function mf({message:e}){const t="user"===e.type;e.type;const n="separator"===e.type,r="system"===e.type;return n?b.jsx("div",{className:"flex items-center justify-center py-1",children:b.jsx("div",{className:"px-3 py-1 rounded-full text-xs",style:{backgroundColor:"var(--widget-system-message-bg, #F3F4F6)",color:"var(--widget-text-muted, #9CA3AF)"},children:e.text})}):r?b.jsx("div",{className:"flex justify-center",children:b.jsx("div",{className:"max-w-[85%] px-4 py-2 rounded-lg text-sm",style:{backgroundColor:"var(--widget-status-error-bg, #FEE2E2)",color:"var(--widget-status-error, #DC2626)"},children:e.text})}):b.jsx("div",{className:yt("flex",t?"justify-end":"justify-start"),children:b.jsx("div",{className:yt("max-w-[80%] px-4 py-2.5 text-sm leading-relaxed",t?"rounded-2xl rounded-br-md":"rounded-2xl rounded-bl-md"),style:{backgroundColor:t?"var(--widget-user-message-bg, #3B82F6)":"var(--widget-bot-message-bg, #F3F4F6)",color:t?"var(--widget-user-message-text, #FFFFFF)":"var(--widget-bot-message-text, #111827)"},children:e.text})})}function gf({agentName:e,avatarUrl:t,variablesConfig:n=[],onSubmit:r,onClose:i,className:a}){const[o,s]=x.useState(()=>n.reduce((e,{key:t})=>c(l({},e),{[t]:""}),{})),[u,d]=x.useState({}),f=x.useMemo(()=>n.filter(e=>e.required).map(e=>e.key),[n]),p=x.useCallback(e=>e.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),[]),h=x.useCallback((e,t)=>{s(n=>c(l({},n),{[e]:t})),u[e]&&d(t=>c(l({},t),{[e]:null}))},[u]),m=x.useCallback(()=>{const e={};let t=!1;if(f.forEach(n=>{o[n]&&""!==o[n].trim()||(e[n]=`${p(n)} is required`,t=!0)}),t)return void d(e);const n=Object.fromEntries(Object.entries(o).filter(([e,t])=>t&&""!==t.trim()));r(n)},[o,f,p,r]),g=x.useCallback((e,t)=>{"Enter"===e.key&&t&&m()},[m]);return b.jsxs("div",{className:yt("flex flex-col h-full w-full animate-fade-in relative min-h-0",a),style:{backgroundColor:"var(--widget-background, #FFFFFF)",fontFamily:"var(--widget-font-family, system-ui)"},children:[b.jsx("button",{onClick:i,className:"absolute top-4 right-4 p-2 rounded-full hover:opacity-80 transition-opacity z-10",style:{color:"var(--widget-icon-secondary, #6B7280)"},"aria-label":"Close",children:b.jsx(Ft,{className:"h-6 w-6"})}),b.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:b.jsxs("div",{className:"flex flex-col items-center px-6 py-8 pt-14",children:[b.jsx(_t,{src:t,alt:e,size:"xl",className:"mb-4 shadow-lg"}),b.jsx("h1",{className:"text-xl font-semibold mb-2 text-center",style:{color:"var(--widget-text-primary, #111827)"},children:"Before we start"}),b.jsxs("p",{className:"text-sm mb-6 text-center max-w-sm",style:{color:"var(--widget-text-secondary, #6B7280)"},children:["Please provide the following information to personalize your experience with ",b.jsx("span",{className:"font-medium",children:e})]}),b.jsx("div",{className:"w-full max-w-md space-y-4",children:n.map(({key:e,required:t},r)=>b.jsxs("div",{className:"space-y-1",children:[b.jsxs("label",{htmlFor:`var-${e}`,className:"block text-sm font-medium",style:{color:"var(--widget-text-primary, #111827)"},children:[p(e),t&&b.jsx("span",{className:"ml-1",style:{color:"var(--widget-status-error, #DC2626)"},children:"*"}),!t&&b.jsx("span",{className:"ml-1 text-xs font-normal",style:{color:"var(--widget-text-muted, #9CA3AF)"},children:"(optional)"})]}),b.jsx("input",{id:`var-${e}`,type:"text",value:o[e],onChange:t=>h(e,t.target.value),onKeyDown:e=>g(e,r===n.length-1),placeholder:`Enter ${p(e).toLowerCase()}`,className:"w-full px-4 py-3 rounded-lg text-sm outline-none transition-colors",style:{backgroundColor:"var(--widget-input-bg, #FFFFFF)",color:"var(--widget-input-text, #111827)",border:u[e]?"2px solid var(--widget-border-error, #DC2626)":"1px solid var(--widget-input-border, #E5E7EB)"},autoFocus:0===r}),u[e]&&b.jsx("p",{className:"text-xs",style:{color:"var(--widget-status-error, #DC2626)"},children:u[e]})]},e))})]})}),b.jsx("div",{className:"p-6 pb-safe shrink-0",style:{borderTop:"1px solid var(--widget-border, #E5E7EB)",paddingBottom:"max(1.5rem, env(safe-area-inset-bottom, 0px))"},children:b.jsx("div",{className:"max-w-md mx-auto",children:b.jsxs(St,{onClick:m,variant:"default",size:"xl",className:"w-full",children:["Continue",b.jsx(Pt,{className:"h-5 w-5 ml-2"})]})})})]})}function vf({agentId:e,metadata:t={},widgetElement:n}){const{isOpen:r,currentScreen:i,setScreen:a,closeDialog:o,dynamicVariables:s,pendingScreen:c,setDynamicVariables:u,setPendingScreen:f}=H(),{agentName:p,avatarUrl:h,promptToken:m,themeConfig:g,tncConfig:v,interfaceConfig:y,appearanceConfig:w,dynamicVariablesConfig:k,isLoading:S,error:_}=function(e){var t,n,r;const{agentConfig:i,configLoading:a,configError:o,setAgentId:s,setAgentConfig:l,setConfigLoading:c,setConfigError:u}=H(),f=x.useRef(null),p=x.useRef(!1);x.useEffect(()=>{d(null,null,function*(){if(e){if(!(p.current||f.current===e&&i)){f.current&&f.current!==e&&(l(null),f.current=null);try{p.current=!0,c(!0),u(null),s(e);const t=yield Y(e);if(!t||!t.widget_config)throw new Error("Invalid agent configuration structure");l(t),f.current=e}catch(_){u(_.message||"Failed to load configuration")}finally{p.current=!1,c(!1)}}}else u("Agent ID is required")})},[e,i,s,l,c,u]);const h=x.useCallback(()=>d(null,null,function*(){if(e)try{f.current=null,p.current=!0,c(!0),u(null);const t=yield Y(e);if(!t||!t.widget_config)throw new Error("Invalid agent configuration structure");l(t),f.current=e}catch(_){u(_.message||"Failed to load configuration")}finally{p.current=!1,c(!1)}else u("Agent ID is required")}),[e,l,c,u]),m=(null==i?void 0:i.widget_config)||{},g=((null==i?void 0:i.dynamic_variables_keys)||[]).map(e=>({key:e,required:!0})),v=(null==(t=m.widget_dynamic_variables)?void 0:t.variables)||[],y=new Set(v.map(e=>e.key)),b=[...g.filter(e=>!y.has(e.key)),...v];return{agentConfig:i,agentName:(null==i?void 0:i.agent_name)||"AI Assistant",promptToken:(null==i?void 0:i.prompt_access_token)||null,dynamicVariablesConfig:b,interfaceConfig:m.widget_interface||{},appearanceConfig:m.widget_appearance||{},avatarConfig:m.widget_avatar||{},themeConfig:m.widget_theme||{},tncConfig:m.widget_tnc_config||{},avatarUrl:(null==(r=null==(n=null==i?void 0:i.MediaFiles)?void 0:n.find(e=>"avatar"===e.fileType))?void 0:r.mediaUrl)||null,isLoading:a,error:o,refresh:h}}(e),E=(null==k?void 0:k.length)>0&&0===Object.keys(s).length,C=x.useCallback(e=>{E?(f(e),a("variables")):a(e)},[E,f,a]),T=x.useCallback(e=>{u(e),c&&(a(c),f(null))},[c,u,a,f]),M=l(l({},t),s);if(x.useEffect(()=>{!r||S||!E||"chat"!==i&&"talk"!==i||(f(i),a("variables"))},[r,S,E,i,f,a]),!r)return null;if(S)return b.jsx(yf,{children:b.jsx(bf,{children:b.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[b.jsx(Ot,{className:"h-12 w-12 animate-spin",style:{color:"var(--widget-primary-color, #3B82F6)"}}),b.jsx("p",{className:"text-sm",style:{color:"var(--widget-text-secondary, #6B7280)"},children:"Loading..."})]})})});if(_)return b.jsx(yf,{children:b.jsx(bf,{children:b.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-6",children:[b.jsx("div",{className:"text-4xl",role:"img","aria-label":"Error",children:"😕"}),b.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--widget-text-primary, #111827)"},children:"Something went wrong"}),b.jsx("p",{className:"text-sm text-center",style:{color:"var(--widget-text-secondary, #6B7280)"},children:_}),b.jsx("button",{onClick:o,className:"mt-4 px-6 py-2 rounded-lg text-sm font-medium",style:{backgroundColor:"var(--widget-button-secondary-bg, #F3F4F6)",color:"var(--widget-button-secondary-text, #374151)"},children:"Close"})]})})});return b.jsxs(yf,{onClick:o,children:[b.jsx(Z,{theme:g,widgetElement:n}),b.jsx(bf,{onClick:e=>e.stopPropagation(),children:(()=>{switch(i){case"variables":return b.jsx(gf,{agentName:p,avatarUrl:h,variablesConfig:k,onSubmit:T,onClose:o});case"chat":return b.jsx($n,{agentId:e,agentName:p,promptToken:m,metadata:M,onClose:o,onSwitchToTalk:()=>a("talk")});case"talk":return b.jsx(hf,{agentId:e,agentName:p,avatarUrl:h,promptToken:m,metadata:M,showTranscripts:y.realtime_transcript_of_the_call,idlePromptMessages:w.idle_prompt_messages,onClose:o});default:return b.jsx(Dt,{agentName:p,avatarUrl:h,tncEnabled:v.tnc_enabled,tncContent:v.tnc_content,onTalk:()=>C("talk"),onChat:()=>C("chat"),onClose:o})}})()})]})}function yf({children:e,onClick:t}){return b.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center animate-fade-in",style:{backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)"},onClick:t,children:e})}function bf({children:e,onClick:t,className:n}){return b.jsx("div",{className:yt("relative w-full h-full overflow-hidden animate-scale-in","sm:max-w-lg sm:max-h-[90vh] sm:h-[700px] sm:rounded-2xl",n),style:{backgroundColor:"var(--widget-background, #FFFFFF)",boxShadow:"var(--widget-shadow-xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25))"},onClick:t,children:e})}const wf='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--widget-font-family),system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-bottom-0\\.5{bottom:-.125rem}.-right-0\\.5{right:-.125rem}.right-4{right:1rem}.top-4{top:1rem}.z-10{z-index:10}.z-\\[9999\\]{z-index:9999}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1 / 1}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2\\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.min-h-0{min-height:0px}.min-h-\\[200px\\]{min-height:200px}.min-h-full{min-height:100%}.w-1\\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-24{width:6rem}.w-3{width:.75rem}.w-32{width:8rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[85\\%\\]{max-width:85%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}@keyframes spin{to{transform:rotate(360deg)}}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-current{background-color:currentColor}.bg-transparent{background-color:transparent}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\\[1px\\]{padding:1px}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pt-14{padding-top:3.5rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-4{--tw-ring-offset-width: 4px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}*,*:before,*:after{box-sizing:border-box}html{scroll-behavior:smooth}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--widget-border, #e5e7eb);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--widget-text-muted, #9ca3af)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideDown{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes scaleIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}.animate-fade-in{animation:fadeIn .3s ease-out}.animate-slide-up{animation:slideUp .4s ease-out}.animate-slide-down{animation:slideDown .4s ease-out}.animate-scale-in{animation:scaleIn .3s ease-out}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin{animation:spin 1s linear infinite}.animate-bounce{animation:bounce .6s ease-in-out infinite}@keyframes loaderSpin{0%{transform:rotate(-90deg)}to{transform:rotate(270deg)}}@keyframes loaderDash{0%{stroke-dashoffset:478}50%{stroke-dashoffset:120}to{stroke-dashoffset:478}}.animate-loader-spin{animation:loaderSpin 1.5s linear infinite,loaderDash 2s ease-in-out infinite;transform-origin:center}.pb-safe{padding-bottom:env(safe-area-inset-bottom,0px)}.pt-safe{padding-top:env(safe-area-inset-top,0px)}.px-safe{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-80:hover{opacity:.8}.hover\\:opacity-90:hover{opacity:.9}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}@media(min-width:640px){.sm\\:h-\\[700px\\]{height:700px}.sm\\:max-h-\\[90vh\\]{max-height:90vh}.sm\\:max-w-lg{max-width:32rem}.sm\\:rounded-2xl{border-radius:1rem}}';class kf extends HTMLElement{constructor(){super(),this.root=null,this.shadow=null,this.themeStyleSheet=null,this.agentId=null,this.metadata={}}injectThemeCSS(e){if(this.shadow&&e)try{if(this.themeStyleSheet){const e=this.shadow.adoptedStyleSheets.indexOf(this.themeStyleSheet);e>-1&&(this.shadow.adoptedStyleSheets=this.shadow.adoptedStyleSheets.filter((t,n)=>n!==e))}const t=new CSSStyleSheet;t.replaceSync(e),this.shadow.adoptedStyleSheets=[...this.shadow.adoptedStyleSheets,t],this.themeStyleSheet=t}catch(t){const n=document.createElement("style");n.setAttribute("data-eigi-theme","true"),n.textContent=e;const r=this.shadow.querySelector("[data-eigi-theme]");r&&r.remove(),this.shadow.appendChild(n)}}connectedCallback(){this.agentId=this.getAttribute("agent-id");const e=this.getAttribute("metadata");if(e)try{this.metadata=JSON.parse(e)}catch(lr){}if(!this.agentId)return;const t=this.attachShadow({mode:"open"});this.shadow=t;try{const e=new CSSStyleSheet;e.replaceSync(wf),t.adoptedStyleSheets=[e]}catch(r){const e=document.createElement("style");e.textContent=wf,t.appendChild(e)}const n=document.createElement("div");n.id="eigi-chat-root",t.appendChild(n),this.root=V.createRoot(n),this.render(),this.agentId,"undefined"!=typeof window&&window.EigiChat&&(window.EigiChat._element=this,window.EigiChat._agentId=this.agentId,window.EigiChat._metadata=this.metadata,H.getState().setAgentId(this.agentId))}render(){this.root&&this.root.render(b.jsx(E.StrictMode,{children:b.jsx(vf,{agentId:this.agentId,metadata:this.metadata,widgetElement:this})}))}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=null)}static get observedAttributes(){return["agent-id","metadata","action"]}attributeChangedCallback(e,t,n){if(t!==n)if("agent-id"===e)this.agentId=n,this.render();else if("metadata"===e){try{this.metadata=JSON.parse(n)}catch(lr){}this.render()}else"action"===e&&this.handleAction(n)}handleAction(e){if(!e)return;const t=H.getState();switch(e){case"open":t.openDialog();break;case"close":t.closeDialog();break;case"toggle":t.toggleDialog();break;case"openChat":t.openChat();break;case"openTalk":t.openTalk()}setTimeout(()=>{this.removeAttribute("action")},100)}}"undefined"==typeof window||customElements.get("eigi-chat")||customElements.define("eigi-chat",kf);const Sf={_element:null,_agentId:null,_metadata:{},init({agentId:e,metadata:t={}}={}){e&&(this._agentId=e,this._metadata=t,H.getState().setAgentId(e),this._element?(this._element.setAttribute("agent-id",e),Object.keys(t).length>0&&this._element.setAttribute("metadata",JSON.stringify(t))):(this._element=document.createElement("eigi-chat"),this._element.setAttribute("agent-id",e),Object.keys(t).length>0&&this._element.setAttribute("metadata",JSON.stringify(t)),document.body.appendChild(this._element)))},open(){this._element,this._agentId,this._ensureInitialized(),this._element&&H.getState().openDialog()},close(){H.getState().closeDialog()},toggle(){H.getState().toggleDialog()},isOpen:()=>H.getState().isOpen,openChat(){this._ensureInitialized(),H.getState().openChat()},openTalk(){this._ensureInitialized(),H.getState().openTalk()},_ensureInitialized(){if(!this._element&&this._agentId)this.init({agentId:this._agentId,metadata:this._metadata});else if(!this._element){const e=document.querySelector("eigi-chat");if(e){this._element=e,this._agentId=e.getAttribute("agent-id");const t=e.getAttribute("metadata");if(t)try{this._metadata=JSON.parse(t)}catch(lr){}H.getState().setAgentId(this._agentId)}else this._agentId}}};if("undefined"!=typeof window){const e=document.querySelectorAll("script[data-agent-id]"),t=e[e.length-1];if(t){const e=t.getAttribute("data-agent-id"),n=t.getAttribute("data-metadata");let r={};if(n)try{r=JSON.parse(n)}catch(lr){}e&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{Sf.init({agentId:e,metadata:r})}):Sf.init({agentId:e,metadata:r}))}window.EigiChat=Sf,console.log("[EigiChat] API ready. Use window.EigiChat.open() to open the dialog.")}return e.EigiChatAPI=Sf,e.EigiChatElement=kf,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});"undefined"!=typeof window&&window.EigiChatInternal&&(window.EigiChat=window.EigiChatInternal.EigiChatAPI,window.EigiChatElement=window.EigiChatInternal.EigiChatElement);