meldivo 2.4.4 → 2.4.6

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.
@@ -1,80 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CeWj4ejR.js","assets/_commonjsHelpers-CqkleIqs.js","assets/browser-CujOq0-h.js"])))=>i.map(i=>d[i]);
2
- var Zd=Object.defineProperty;var eh=(u,s,l)=>s in u?Zd(u,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):u[s]=l;var te=(u,s,l)=>eh(u,typeof s!="symbol"?s+"":s,l);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const g of d)if(g.type==="childList")for(const x of g.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&c(x)}).observe(document,{childList:!0,subtree:!0});function l(d){const g={};return d.integrity&&(g.integrity=d.integrity),d.referrerPolicy&&(g.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?g.credentials="include":d.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function c(d){if(d.ep)return;d.ep=!0;const g=l(d);fetch(d.href,g)}})();var ku={exports:{}},ji={},xu={exports:{}},Se={};/**
3
- * @license React
4
- * react.production.min.js
5
- *
6
- * Copyright (c) Facebook, Inc. and its affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var nf;function th(){if(nf)return Se;nf=1;var u=Symbol.for("react.element"),s=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),x=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),D=Symbol.iterator;function O(y){return y===null||typeof y!="object"?null:(y=D&&y[D]||y["@@iterator"],typeof y=="function"?y:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,se={};function N(y,j,ie){this.props=y,this.context=j,this.refs=se,this.updater=ie||$}N.prototype.isReactComponent={},N.prototype.setState=function(y,j){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,j,"setState")},N.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function Y(){}Y.prototype=N.prototype;function b(y,j,ie){this.props=y,this.context=j,this.refs=se,this.updater=ie||$}var ye=b.prototype=new Y;ye.constructor=b,X(ye,N.prototype),ye.isPureReactComponent=!0;var I=Array.isArray,K=Object.prototype.hasOwnProperty,U={current:null},ne={key:!0,ref:!0,__self:!0,__source:!0};function me(y,j,ie){var ue,pe={},we=null,ve=null;if(j!=null)for(ue in j.ref!==void 0&&(ve=j.ref),j.key!==void 0&&(we=""+j.key),j)K.call(j,ue)&&!ne.hasOwnProperty(ue)&&(pe[ue]=j[ue]);var xe=arguments.length-2;if(xe===1)pe.children=ie;else if(1<xe){for(var Te=Array(xe),it=0;it<xe;it++)Te[it]=arguments[it+2];pe.children=Te}if(y&&y.defaultProps)for(ue in xe=y.defaultProps,xe)pe[ue]===void 0&&(pe[ue]=xe[ue]);return{$$typeof:u,type:y,key:we,ref:ve,props:pe,_owner:U.current}}function ke(y,j){return{$$typeof:u,type:y.type,key:j,ref:y.ref,props:y.props,_owner:y._owner}}function W(y){return typeof y=="object"&&y!==null&&y.$$typeof===u}function _e(y){var j={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(ie){return j[ie]})}var Ge=/\/+/g;function et(y,j){return typeof y=="object"&&y!==null&&y.key!=null?_e(""+y.key):j.toString(36)}function qe(y,j,ie,ue,pe){var we=typeof y;(we==="undefined"||we==="boolean")&&(y=null);var ve=!1;if(y===null)ve=!0;else switch(we){case"string":case"number":ve=!0;break;case"object":switch(y.$$typeof){case u:case s:ve=!0}}if(ve)return ve=y,pe=pe(ve),y=ue===""?"."+et(ve,0):ue,I(pe)?(ie="",y!=null&&(ie=y.replace(Ge,"$&/")+"/"),qe(pe,j,ie,"",function(it){return it})):pe!=null&&(W(pe)&&(pe=ke(pe,ie+(!pe.key||ve&&ve.key===pe.key?"":(""+pe.key).replace(Ge,"$&/")+"/")+y)),j.push(pe)),1;if(ve=0,ue=ue===""?".":ue+":",I(y))for(var xe=0;xe<y.length;xe++){we=y[xe];var Te=ue+et(we,xe);ve+=qe(we,j,ie,Te,pe)}else if(Te=O(y),typeof Te=="function")for(y=Te.call(y),xe=0;!(we=y.next()).done;)we=we.value,Te=ue+et(we,xe++),ve+=qe(we,j,ie,Te,pe);else if(we==="object")throw j=String(y),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return ve}function Ue(y,j,ie){if(y==null)return y;var ue=[],pe=0;return qe(y,ue,"","",function(we){return j.call(ie,we,pe++)}),ue}function $e(y){if(y._status===-1){var j=y._result;j=j(),j.then(function(ie){(y._status===0||y._status===-1)&&(y._status=1,y._result=ie)},function(ie){(y._status===0||y._status===-1)&&(y._status=2,y._result=ie)}),y._status===-1&&(y._status=0,y._result=j)}if(y._status===1)return y._result.default;throw y._result}var Ne={current:null},V={transition:null},le={ReactCurrentDispatcher:Ne,ReactCurrentBatchConfig:V,ReactCurrentOwner:U};function B(){throw Error("act(...) is not supported in production builds of React.")}return Se.Children={map:Ue,forEach:function(y,j,ie){Ue(y,function(){j.apply(this,arguments)},ie)},count:function(y){var j=0;return Ue(y,function(){j++}),j},toArray:function(y){return Ue(y,function(j){return j})||[]},only:function(y){if(!W(y))throw Error("React.Children.only expected to receive a single React element child.");return y}},Se.Component=N,Se.Fragment=l,Se.Profiler=d,Se.PureComponent=b,Se.StrictMode=c,Se.Suspense=L,Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=le,Se.act=B,Se.cloneElement=function(y,j,ie){if(y==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+y+".");var ue=X({},y.props),pe=y.key,we=y.ref,ve=y._owner;if(j!=null){if(j.ref!==void 0&&(we=j.ref,ve=U.current),j.key!==void 0&&(pe=""+j.key),y.type&&y.type.defaultProps)var xe=y.type.defaultProps;for(Te in j)K.call(j,Te)&&!ne.hasOwnProperty(Te)&&(ue[Te]=j[Te]===void 0&&xe!==void 0?xe[Te]:j[Te])}var Te=arguments.length-2;if(Te===1)ue.children=ie;else if(1<Te){xe=Array(Te);for(var it=0;it<Te;it++)xe[it]=arguments[it+2];ue.children=xe}return{$$typeof:u,type:y.type,key:pe,ref:we,props:ue,_owner:ve}},Se.createContext=function(y){return y={$$typeof:x,_currentValue:y,_currentValue2:y,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},y.Provider={$$typeof:g,_context:y},y.Consumer=y},Se.createElement=me,Se.createFactory=function(y){var j=me.bind(null,y);return j.type=y,j},Se.createRef=function(){return{current:null}},Se.forwardRef=function(y){return{$$typeof:C,render:y}},Se.isValidElement=W,Se.lazy=function(y){return{$$typeof:H,_payload:{_status:-1,_result:y},_init:$e}},Se.memo=function(y,j){return{$$typeof:R,type:y,compare:j===void 0?null:j}},Se.startTransition=function(y){var j=V.transition;V.transition={};try{y()}finally{V.transition=j}},Se.unstable_act=B,Se.useCallback=function(y,j){return Ne.current.useCallback(y,j)},Se.useContext=function(y){return Ne.current.useContext(y)},Se.useDebugValue=function(){},Se.useDeferredValue=function(y){return Ne.current.useDeferredValue(y)},Se.useEffect=function(y,j){return Ne.current.useEffect(y,j)},Se.useId=function(){return Ne.current.useId()},Se.useImperativeHandle=function(y,j,ie){return Ne.current.useImperativeHandle(y,j,ie)},Se.useInsertionEffect=function(y,j){return Ne.current.useInsertionEffect(y,j)},Se.useLayoutEffect=function(y,j){return Ne.current.useLayoutEffect(y,j)},Se.useMemo=function(y,j){return Ne.current.useMemo(y,j)},Se.useReducer=function(y,j,ie){return Ne.current.useReducer(y,j,ie)},Se.useRef=function(y){return Ne.current.useRef(y)},Se.useState=function(y){return Ne.current.useState(y)},Se.useSyncExternalStore=function(y,j,ie){return Ne.current.useSyncExternalStore(y,j,ie)},Se.useTransition=function(){return Ne.current.useTransition()},Se.version="18.3.1",Se}var rf;function Wu(){return rf||(rf=1,xu.exports=th()),xu.exports}/**
11
- * @license React
12
- * react-jsx-runtime.production.min.js
13
- *
14
- * Copyright (c) Facebook, Inc. and its affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var of;function nh(){if(of)return ji;of=1;var u=Wu(),s=Symbol.for("react.element"),l=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,d=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g={key:!0,ref:!0,__self:!0,__source:!0};function x(C,L,R){var H,D={},O=null,$=null;R!==void 0&&(O=""+R),L.key!==void 0&&(O=""+L.key),L.ref!==void 0&&($=L.ref);for(H in L)c.call(L,H)&&!g.hasOwnProperty(H)&&(D[H]=L[H]);if(C&&C.defaultProps)for(H in L=C.defaultProps,L)D[H]===void 0&&(D[H]=L[H]);return{$$typeof:s,type:C,key:O,ref:$,props:D,_owner:d.current}}return ji.Fragment=l,ji.jsx=x,ji.jsxs=x,ji}var sf;function rh(){return sf||(sf=1,ku.exports=nh()),ku.exports}var h=rh(),Us={},Eu={exports:{}},Ft={},_u={exports:{}},Cu={};/**
19
- * @license React
20
- * scheduler.production.min.js
21
- *
22
- * Copyright (c) Facebook, Inc. and its affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var lf;function oh(){return lf||(lf=1,(function(u){function s(V,le){var B=V.length;V.push(le);e:for(;0<B;){var y=B-1>>>1,j=V[y];if(0<d(j,le))V[y]=le,V[B]=j,B=y;else break e}}function l(V){return V.length===0?null:V[0]}function c(V){if(V.length===0)return null;var le=V[0],B=V.pop();if(B!==le){V[0]=B;e:for(var y=0,j=V.length,ie=j>>>1;y<ie;){var ue=2*(y+1)-1,pe=V[ue],we=ue+1,ve=V[we];if(0>d(pe,B))we<j&&0>d(ve,pe)?(V[y]=ve,V[we]=B,y=we):(V[y]=pe,V[ue]=B,y=ue);else if(we<j&&0>d(ve,B))V[y]=ve,V[we]=B,y=we;else break e}}return le}function d(V,le){var B=V.sortIndex-le.sortIndex;return B!==0?B:V.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var g=performance;u.unstable_now=function(){return g.now()}}else{var x=Date,C=x.now();u.unstable_now=function(){return x.now()-C}}var L=[],R=[],H=1,D=null,O=3,$=!1,X=!1,se=!1,N=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ye(V){for(var le=l(R);le!==null;){if(le.callback===null)c(R);else if(le.startTime<=V)c(R),le.sortIndex=le.expirationTime,s(L,le);else break;le=l(R)}}function I(V){if(se=!1,ye(V),!X)if(l(L)!==null)X=!0,$e(K);else{var le=l(R);le!==null&&Ne(I,le.startTime-V)}}function K(V,le){X=!1,se&&(se=!1,Y(me),me=-1),$=!0;var B=O;try{for(ye(le),D=l(L);D!==null&&(!(D.expirationTime>le)||V&&!_e());){var y=D.callback;if(typeof y=="function"){D.callback=null,O=D.priorityLevel;var j=y(D.expirationTime<=le);le=u.unstable_now(),typeof j=="function"?D.callback=j:D===l(L)&&c(L),ye(le)}else c(L);D=l(L)}if(D!==null)var ie=!0;else{var ue=l(R);ue!==null&&Ne(I,ue.startTime-le),ie=!1}return ie}finally{D=null,O=B,$=!1}}var U=!1,ne=null,me=-1,ke=5,W=-1;function _e(){return!(u.unstable_now()-W<ke)}function Ge(){if(ne!==null){var V=u.unstable_now();W=V;var le=!0;try{le=ne(!0,V)}finally{le?et():(U=!1,ne=null)}}else U=!1}var et;if(typeof b=="function")et=function(){b(Ge)};else if(typeof MessageChannel<"u"){var qe=new MessageChannel,Ue=qe.port2;qe.port1.onmessage=Ge,et=function(){Ue.postMessage(null)}}else et=function(){N(Ge,0)};function $e(V){ne=V,U||(U=!0,et())}function Ne(V,le){me=N(function(){V(u.unstable_now())},le)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(V){V.callback=null},u.unstable_continueExecution=function(){X||$||(X=!0,$e(K))},u.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ke=0<V?Math.floor(1e3/V):5},u.unstable_getCurrentPriorityLevel=function(){return O},u.unstable_getFirstCallbackNode=function(){return l(L)},u.unstable_next=function(V){switch(O){case 1:case 2:case 3:var le=3;break;default:le=O}var B=O;O=le;try{return V()}finally{O=B}},u.unstable_pauseExecution=function(){},u.unstable_requestPaint=function(){},u.unstable_runWithPriority=function(V,le){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var B=O;O=V;try{return le()}finally{O=B}},u.unstable_scheduleCallback=function(V,le,B){var y=u.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?y+B:y):B=y,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=B+j,V={id:H++,callback:le,priorityLevel:V,startTime:B,expirationTime:j,sortIndex:-1},B>y?(V.sortIndex=B,s(R,V),l(L)===null&&V===l(R)&&(se?(Y(me),me=-1):se=!0,Ne(I,B-y))):(V.sortIndex=j,s(L,V),X||$||(X=!0,$e(K))),V},u.unstable_shouldYield=_e,u.unstable_wrapCallback=function(V){var le=O;return function(){var B=O;O=le;try{return V.apply(this,arguments)}finally{O=B}}}})(Cu)),Cu}var uf;function ih(){return uf||(uf=1,_u.exports=oh()),_u.exports}/**
27
- * @license React
28
- * react-dom.production.min.js
29
- *
30
- * Copyright (c) Facebook, Inc. and its affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var af;function sh(){if(af)return Ft;af=1;var u=Wu(),s=ih();function l(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var c=new Set,d={};function g(e,t){x(e,t),x(e+"Capture",t)}function x(e,t){for(d[e]=t,e=0;e<t.length;e++)c.add(t[e])}var C=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L=Object.prototype.hasOwnProperty,R=/^[: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]*$/,H={},D={};function O(e){return L.call(D,e)?!0:L.call(H,e)?!1:R.test(e)?D[e]=!0:(H[e]=!0,!1)}function $(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function X(e,t,n,r){if(t===null||typeof t>"u"||$(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function se(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new se(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new se(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new se(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new se(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new se(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new se(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new se(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new se(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new se(e,5,!1,e.toLowerCase(),null,!1,!1)});var Y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Y,b);N[t]=new se(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Y,b);N[t]=new se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Y,b);N[t]=new se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new se(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new se(e,1,!1,e.toLowerCase(),null,!0,!0)});function ye(e,t,n,r){var o=N.hasOwnProperty(t)?N[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(X(t,n,o,r)&&(n=null),r||o===null?O(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var I=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,K=Symbol.for("react.element"),U=Symbol.for("react.portal"),ne=Symbol.for("react.fragment"),me=Symbol.for("react.strict_mode"),ke=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),_e=Symbol.for("react.context"),Ge=Symbol.for("react.forward_ref"),et=Symbol.for("react.suspense"),qe=Symbol.for("react.suspense_list"),Ue=Symbol.for("react.memo"),$e=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),V=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,y;function j(e){if(y===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);y=t&&t[1]||""}return`
35
- `+y+e}var ie=!1;function ue(e,t){if(!e||ie)return"";ie=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(E){var r=E}Reflect.construct(e,[],t)}else{try{t.call()}catch(E){r=E}e.call(t.prototype)}else{try{throw Error()}catch(E){r=E}e()}}catch(E){if(E&&r&&typeof E.stack=="string"){for(var o=E.stack.split(`
36
- `),i=r.stack.split(`
37
- `),a=o.length-1,f=i.length-1;1<=a&&0<=f&&o[a]!==i[f];)f--;for(;1<=a&&0<=f;a--,f--)if(o[a]!==i[f]){if(a!==1||f!==1)do if(a--,f--,0>f||o[a]!==i[f]){var m=`
38
- `+o[a].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),m}while(1<=a&&0<=f);break}}}finally{ie=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?j(e):""}function pe(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return""}}function we(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ne:return"Fragment";case U:return"Portal";case ke:return"Profiler";case me:return"StrictMode";case et:return"Suspense";case qe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _e:return(e.displayName||"Context")+".Consumer";case W:return(e._context.displayName||"Context")+".Provider";case Ge:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ue:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case $e:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}function ve(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return we(t);case 8:return t===me?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Te(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function it(e){var t=Te(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gn(e){e._valueTracker||(e._valueTracker=it(e))}function Nr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Te(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ht(e,t){var n=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yn(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xe(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ut(e,t){t=t.checked,t!=null&&ye(e,"checked",t,!1)}function Pr(e,t){ut(e,t);var n=xe(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Jn(e,t.type,n):t.hasOwnProperty("defaultValue")&&Jn(e,t.type,xe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vn(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Jn(e,t,n){(t!=="number"||Lt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gn=Array.isArray;function At(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+xe(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Fn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(l(91));return B({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xn(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(l(92));if(gn(n)){if(1<n.length)throw Error(l(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xe(n)}}function Zn(e,t){var n=xe(t.value),r=xe(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Ot(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function eo(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function at(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?eo(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var er,to=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(er=er||document.createElement("div"),er.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=er.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Qs=["Webkit","ms","Moz","O"];Object.keys(yn).forEach(function(e){Qs.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yn[t]=yn[e]})});function gt(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||yn.hasOwnProperty(e)&&yn[e]?(""+t).trim():t+"px"}function no(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=gt(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Fi=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function jr(e,t){if(t){if(Fi[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(l(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(t.style!=null&&typeof t.style!="object")throw Error(l(62))}}function ro(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Uo=null;function yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $o=null,_t=null,Ln=null;function Li(e){if(e=pi(e)){if(typeof $o!="function")throw Error(l(280));var t=e.stateNode;t&&(t=es(t),$o(e.stateNode,e.type,t))}}function Vo(e){_t?Ln?Ln.push(e):Ln=[e]:_t=e}function Bo(){if(_t){var e=_t,t=Ln;if(Ln=_t=null,Li(e),t)for(e=0;e<t.length;e++)Li(t[e])}}function An(e,t){return e(t)}function Rr(){}var Wo=!1;function tr(e,t,n){if(Wo)return e(t,n);Wo=!0;try{return An(e,t,n)}finally{Wo=!1,(_t!==null||Ln!==null)&&(Rr(),Bo())}}function nr(e,t){var n=e.stateNode;if(n===null)return null;var r=es(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(l(231,t,typeof n));return n}var oo=!1;if(C)try{var On={};Object.defineProperty(On,"passive",{get:function(){oo=!0}}),window.addEventListener("test",On,On),window.removeEventListener("test",On,On)}catch{oo=!1}function Ai(e,t,n,r,o,i,a,f,m){var E=Array.prototype.slice.call(arguments,3);try{t.apply(n,E)}catch(F){this.onError(F)}}var rr=!1,Ct=null,Mr=!1,or=null,io={onError:function(e){rr=!0,Ct=e}};function Ho(e,t,n,r,o,i,a,f,m){rr=!1,Ct=null,Ai.apply(io,arguments)}function qs(e,t,n,r,o,i,a,f,m){if(Ho.apply(this,arguments),rr){if(rr){var E=Ct;rr=!1,Ct=null}else throw Error(l(198));Mr||(Mr=!0,or=E)}}function zn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ir(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Fr(e){if(zn(e)!==e)throw Error(l(188))}function so(e){var t=e.alternate;if(!t){if(t=zn(e),t===null)throw Error(l(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Fr(o),e;if(i===r)return Fr(o),t;i=i.sibling}throw Error(l(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,f=o.child;f;){if(f===n){a=!0,n=o,r=i;break}if(f===r){a=!0,r=o,n=i;break}f=f.sibling}if(!a){for(f=i.child;f;){if(f===n){a=!0,n=i,r=o;break}if(f===r){a=!0,r=i,n=o;break}f=f.sibling}if(!a)throw Error(l(189))}}if(n.alternate!==r)throw Error(l(190))}if(n.tag!==3)throw Error(l(188));return n.stateNode.current===n?e:t}function Ko(e){return e=so(e),e!==null?Qo(e):null}function Qo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qo(e);if(t!==null)return t;e=e.sibling}return null}var qo=s.unstable_scheduleCallback,rn=s.unstable_cancelCallback,Kt=s.unstable_shouldYield,on=s.unstable_requestPaint,Le=s.unstable_now,lo=s.unstable_getCurrentPriorityLevel,zt=s.unstable_ImmediatePriority,Dt=s.unstable_UserBlockingPriority,wt=s.unstable_NormalPriority,uo=s.unstable_LowPriority,tt=s.unstable_IdlePriority,Dn=null,It=null;function St(e){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(Dn,e,void 0,(e.current.flags&128)===128)}catch{}}var kt=Math.clz32?Math.clz32:Qt,Oi=Math.log,bs=Math.LN2;function Qt(e){return e>>>=0,e===0?32:31-(Oi(e)/bs|0)|0}var qt=64,wn=4194304;function Lr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sn(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var f=a&~o;f!==0?r=Lr(f):(i&=a,i!==0&&(r=Lr(i)))}else a=n&~o,a!==0?r=Lr(a):i!==0&&(r=Lr(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-kt(t),o=1<<n,r|=e[n],t&=~o;return r}function Gs(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bo(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-kt(i),f=1<<a,m=o[a];m===-1?((f&n)===0||(f&r)!==0)&&(o[a]=Gs(f,t)):m<=t&&(e.expiredLanes|=f),i&=~f}}function Go(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zi(){var e=qt;return qt<<=1,(qt&4194240)===0&&(qt=64),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function kn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kt(t),e[t]=n}function sr(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-kt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function In(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ge=0;function Di(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Yo,Jo,Ii,Un,ao,bt=!1,co=[],xn=null,Gt=null,En=null,Ar=new Map,Or=new Map,_n=[],Ys="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 submit".split(" ");function Xo(e,t){switch(e){case"focusin":case"focusout":xn=null;break;case"dragenter":case"dragleave":Gt=null;break;case"mouseover":case"mouseout":En=null;break;case"pointerover":case"pointerout":Ar.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Or.delete(t.pointerId)}}function zr(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=pi(t),t!==null&&Jo(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Js(e,t,n,r,o){switch(t){case"focusin":return xn=zr(xn,e,t,n,r,o),!0;case"dragenter":return Gt=zr(Gt,e,t,n,r,o),!0;case"mouseover":return En=zr(En,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Ar.set(i,zr(Ar.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Or.set(i,zr(Or.get(i)||null,e,t,n,r,o)),!0}return!1}function Ui(e){var t=$r(e.target);if(t!==null){var n=zn(t);if(n!==null){if(t=n.tag,t===13){if(t=ir(n),t!==null){e.blockedOn=t,ao(e.priority,function(){Ii(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function lr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ei(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Uo=r,n.target.dispatchEvent(r),Uo=null}else return t=pi(n),t!==null&&Jo(t),e.blockedOn=n,!1;t.shift()}return!0}function sn(e,t,n){lr(e)&&n.delete(t)}function ln(){bt=!1,xn!==null&&lr(xn)&&(xn=null),Gt!==null&&lr(Gt)&&(Gt=null),En!==null&&lr(En)&&(En=null),Ar.forEach(sn),Or.forEach(sn)}function Cn(e,t){e.blockedOn===t&&(e.blockedOn=null,bt||(bt=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,ln)))}function ur(e){function t(o){return Cn(o,e)}if(0<co.length){Cn(co[0],e);for(var n=1;n<co.length;n++){var r=co[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xn!==null&&Cn(xn,e),Gt!==null&&Cn(Gt,e),En!==null&&Cn(En,e),Ar.forEach(t),Or.forEach(t),n=0;n<_n.length;n++)r=_n[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<_n.length&&(n=_n[0],n.blockedOn===null);)Ui(n),n.blockedOn===null&&_n.shift()}var ar=I.ReactCurrentBatchConfig,Dr=!0;function Xs(e,t,n,r){var o=ge,i=ar.transition;ar.transition=null;try{ge=1,Zo(e,t,n,r)}finally{ge=o,ar.transition=i}}function Zs(e,t,n,r){var o=ge,i=ar.transition;ar.transition=null;try{ge=4,Zo(e,t,n,r)}finally{ge=o,ar.transition=i}}function Zo(e,t,n,r){if(Dr){var o=ei(e,t,n,r);if(o===null)fl(e,t,r,fo,n),Xo(e,r);else if(Js(o,e,t,n,r))r.stopPropagation();else if(Xo(e,r),t&4&&-1<Ys.indexOf(e)){for(;o!==null;){var i=pi(o);if(i!==null&&Yo(i),i=ei(e,t,n,r),i===null&&fl(e,t,r,fo,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else fl(e,t,r,null,n)}}var fo=null;function ei(e,t,n,r){if(fo=null,e=yt(r),e=$r(e),e!==null)if(t=zn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ir(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return fo=e,null}function $i(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(lo()){case zt:return 1;case Dt:return 4;case wt:case uo:return 16;case tt:return 536870912;default:return 16}default:return 16}}var Yt=null,cr=null,Ir=null;function ti(){if(Ir)return Ir;var e,t=cr,n=t.length,r,o="value"in Yt?Yt.value:Yt.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return Ir=o.slice(e,1<r?1-r:void 0)}function p(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function w(){return!0}function P(){return!1}function T(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(n=e[f],this[f]=n?n(i):i[f]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?w:P,this.isPropagationStopped=P,this}return B(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=w)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=w)},persist:function(){},isPersistent:w}),t}var q={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},G=T(q),Q=B({},q,{view:0,detail:0}),fe=T(Q),Oe,Ee,Ye,He=B({},Q,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Je,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ye&&(Ye&&e.type==="mousemove"?(Oe=e.screenX-Ye.screenX,Ee=e.screenY-Ye.screenY):Ee=Oe=0,Ye=e),Oe)},movementY:function(e){return"movementY"in e?e.movementY:Ee}}),je=T(He),Ut=B({},He,{dataTransfer:0}),$n=T(Ut),Ur=B({},Q,{relatedTarget:0}),ft=T(Ur),Nt=B({},q,{animationName:0,elapsedTime:0,pseudoElement:0}),ni=T(Nt),Vi=B({},q,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bi=T(Vi),el=B({},q,{data:0}),Wi=T(el),Nn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tl={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"},ri={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ho(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ri[e])?!!t[e]:!1}function Je(){return ho}var Hi=B({},Q,{key:function(e){if(e.key){var t=Nn[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=p(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?tl[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Je,charCode:function(e){return e.type==="keypress"?p(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?p(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),oi=T(Hi),po=B({},He,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ki=T(po),de=B({},Q,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Je}),Me=T(de),Ve=B({},q,{propertyName:0,elapsedTime:0,pseudoElement:0}),Re=T(Ve),dt=B({},He,{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}),$t=T(dt),Pn=[9,13,27,32],mo=C&&"CompositionEvent"in window,fr=null;C&&"documentMode"in document&&(fr=document.documentMode);var Qi=C&&"TextEvent"in window&&!fr,ii=C&&(!mo||fr&&8<fr&&11>=fr),Gu=" ",Yu=!1;function Ju(e,t){switch(e){case"keyup":return Pn.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vo=!1;function Yf(e,t){switch(e){case"compositionend":return Xu(t);case"keypress":return t.which!==32?null:(Yu=!0,Gu);case"textInput":return e=t.data,e===Gu&&Yu?null:e;default:return null}}function Jf(e,t){if(vo)return e==="compositionend"||!mo&&Ju(e,t)?(e=ti(),Ir=cr=Yt=null,vo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ii&&t.locale!=="ko"?null:t.data;default:return null}}var Xf={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 Zu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Xf[e.type]:t==="textarea"}function ea(e,t,n,r){Vo(r),t=Ji(t,"onChange"),0<t.length&&(n=new G("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var si=null,li=null;function Zf(e){ya(e,0)}function qi(e){var t=ko(e);if(Nr(t))return e}function ed(e,t){if(e==="change")return t}var ta=!1;if(C){var nl;if(C){var rl="oninput"in document;if(!rl){var na=document.createElement("div");na.setAttribute("oninput","return;"),rl=typeof na.oninput=="function"}nl=rl}else nl=!1;ta=nl&&(!document.documentMode||9<document.documentMode)}function ra(){si&&(si.detachEvent("onpropertychange",oa),li=si=null)}function oa(e){if(e.propertyName==="value"&&qi(li)){var t=[];ea(t,li,e,yt(e)),tr(Zf,t)}}function td(e,t,n){e==="focusin"?(ra(),si=t,li=n,si.attachEvent("onpropertychange",oa)):e==="focusout"&&ra()}function nd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(li)}function rd(e,t){if(e==="click")return qi(t)}function od(e,t){if(e==="input"||e==="change")return qi(t)}function id(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var un=typeof Object.is=="function"?Object.is:id;function ui(e,t){if(un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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 o=n[r];if(!L.call(t,o)||!un(e[o],t[o]))return!1}return!0}function ia(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sa(e,t){var n=ia(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ia(n)}}function la(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?la(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ua(){for(var e=window,t=Lt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function ol(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function sd(e){var t=ua(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&la(n.ownerDocument.documentElement,n)){if(r!==null&&ol(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=sa(n,i);var a=sa(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ld=C&&"documentMode"in document&&11>=document.documentMode,go=null,il=null,ai=null,sl=!1;function aa(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sl||go==null||go!==Lt(r)||(r=go,"selectionStart"in r&&ol(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ai&&ui(ai,r)||(ai=r,r=Ji(il,"onSelect"),0<r.length&&(t=new G("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=go)))}function bi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yo={animationend:bi("Animation","AnimationEnd"),animationiteration:bi("Animation","AnimationIteration"),animationstart:bi("Animation","AnimationStart"),transitionend:bi("Transition","TransitionEnd")},ll={},ca={};C&&(ca=document.createElement("div").style,"AnimationEvent"in window||(delete yo.animationend.animation,delete yo.animationiteration.animation,delete yo.animationstart.animation),"TransitionEvent"in window||delete yo.transitionend.transition);function Gi(e){if(ll[e])return ll[e];if(!yo[e])return e;var t=yo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ca)return ll[e]=t[n];return e}var fa=Gi("animationend"),da=Gi("animationiteration"),ha=Gi("animationstart"),pa=Gi("transitionend"),ma=new Map,va="abort auxClick 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 dr(e,t){ma.set(e,t),g(t,[e])}for(var ul=0;ul<va.length;ul++){var al=va[ul],ud=al.toLowerCase(),ad=al[0].toUpperCase()+al.slice(1);dr(ud,"on"+ad)}dr(fa,"onAnimationEnd"),dr(da,"onAnimationIteration"),dr(ha,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(pa,"onTransitionEnd"),x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),g("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),g("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),g("onBeforeInput",["compositionend","keypress","textInput","paste"]),g("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),g("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),g("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ci="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(" "),cd=new Set("cancel close invalid load scroll toggle".split(" ").concat(ci));function ga(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,qs(r,t,void 0,e),e.currentTarget=null}function ya(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var f=r[a],m=f.instance,E=f.currentTarget;if(f=f.listener,m!==i&&o.isPropagationStopped())break e;ga(o,f,E),i=m}else for(a=0;a<r.length;a++){if(f=r[a],m=f.instance,E=f.currentTarget,f=f.listener,m!==i&&o.isPropagationStopped())break e;ga(o,f,E),i=m}}}if(Mr)throw e=or,Mr=!1,or=null,e}function ze(e,t){var n=t[gl];n===void 0&&(n=t[gl]=new Set);var r=e+"__bubble";n.has(r)||(wa(t,e,2,!1),n.add(r))}function cl(e,t,n){var r=0;t&&(r|=4),wa(n,e,r,t)}var Yi="_reactListening"+Math.random().toString(36).slice(2);function fi(e){if(!e[Yi]){e[Yi]=!0,c.forEach(function(n){n!=="selectionchange"&&(cd.has(n)||cl(n,!1,e),cl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yi]||(t[Yi]=!0,cl("selectionchange",!1,t))}}function wa(e,t,n,r){switch($i(t)){case 1:var o=Xs;break;case 4:o=Zs;break;default:o=Zo}n=o.bind(null,t,n,e),o=void 0,!oo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function fl(e,t,n,r,o){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var f=r.stateNode.containerInfo;if(f===o||f.nodeType===8&&f.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var m=a.tag;if((m===3||m===4)&&(m=a.stateNode.containerInfo,m===o||m.nodeType===8&&m.parentNode===o))return;a=a.return}for(;f!==null;){if(a=$r(f),a===null)return;if(m=a.tag,m===5||m===6){r=i=a;continue e}f=f.parentNode}}r=r.return}tr(function(){var E=i,F=yt(n),A=[];e:{var M=ma.get(e);if(M!==void 0){var J=G,ee=e;switch(e){case"keypress":if(p(n)===0)break e;case"keydown":case"keyup":J=oi;break;case"focusin":ee="focus",J=ft;break;case"focusout":ee="blur",J=ft;break;case"beforeblur":case"afterblur":J=ft;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=je;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=$n;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=Me;break;case fa:case da:case ha:J=ni;break;case pa:J=Re;break;case"scroll":J=fe;break;case"wheel":J=$t;break;case"copy":case"cut":case"paste":J=Bi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Ki}var re=(t&4)!==0,Qe=!re&&e==="scroll",S=re?M!==null?M+"Capture":null:M;re=[];for(var v=E,k;v!==null;){k=v;var z=k.stateNode;if(k.tag===5&&z!==null&&(k=z,S!==null&&(z=nr(v,S),z!=null&&re.push(di(v,z,k)))),Qe)break;v=v.return}0<re.length&&(M=new J(M,ee,null,n,F),A.push({event:M,listeners:re}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",M&&n!==Uo&&(ee=n.relatedTarget||n.fromElement)&&($r(ee)||ee[Vn]))break e;if((J||M)&&(M=F.window===F?F:(M=F.ownerDocument)?M.defaultView||M.parentWindow:window,J?(ee=n.relatedTarget||n.toElement,J=E,ee=ee?$r(ee):null,ee!==null&&(Qe=zn(ee),ee!==Qe||ee.tag!==5&&ee.tag!==6)&&(ee=null)):(J=null,ee=E),J!==ee)){if(re=je,z="onMouseLeave",S="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(re=Ki,z="onPointerLeave",S="onPointerEnter",v="pointer"),Qe=J==null?M:ko(J),k=ee==null?M:ko(ee),M=new re(z,v+"leave",J,n,F),M.target=Qe,M.relatedTarget=k,z=null,$r(F)===E&&(re=new re(S,v+"enter",ee,n,F),re.target=k,re.relatedTarget=Qe,z=re),Qe=z,J&&ee)t:{for(re=J,S=ee,v=0,k=re;k;k=wo(k))v++;for(k=0,z=S;z;z=wo(z))k++;for(;0<v-k;)re=wo(re),v--;for(;0<k-v;)S=wo(S),k--;for(;v--;){if(re===S||S!==null&&re===S.alternate)break t;re=wo(re),S=wo(S)}re=null}else re=null;J!==null&&Sa(A,M,J,re,!1),ee!==null&&Qe!==null&&Sa(A,Qe,ee,re,!0)}}e:{if(M=E?ko(E):window,J=M.nodeName&&M.nodeName.toLowerCase(),J==="select"||J==="input"&&M.type==="file")var oe=ed;else if(Zu(M))if(ta)oe=od;else{oe=nd;var ae=td}else(J=M.nodeName)&&J.toLowerCase()==="input"&&(M.type==="checkbox"||M.type==="radio")&&(oe=rd);if(oe&&(oe=oe(e,E))){ea(A,oe,n,F);break e}ae&&ae(e,M,E),e==="focusout"&&(ae=M._wrapperState)&&ae.controlled&&M.type==="number"&&Jn(M,"number",M.value)}switch(ae=E?ko(E):window,e){case"focusin":(Zu(ae)||ae.contentEditable==="true")&&(go=ae,il=E,ai=null);break;case"focusout":ai=il=go=null;break;case"mousedown":sl=!0;break;case"contextmenu":case"mouseup":case"dragend":sl=!1,aa(A,n,F);break;case"selectionchange":if(ld)break;case"keydown":case"keyup":aa(A,n,F)}var ce;if(mo)e:{switch(e){case"compositionstart":var he="onCompositionStart";break e;case"compositionend":he="onCompositionEnd";break e;case"compositionupdate":he="onCompositionUpdate";break e}he=void 0}else vo?Ju(e,n)&&(he="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(he="onCompositionStart");he&&(ii&&n.locale!=="ko"&&(vo||he!=="onCompositionStart"?he==="onCompositionEnd"&&vo&&(ce=ti()):(Yt=F,cr="value"in Yt?Yt.value:Yt.textContent,vo=!0)),ae=Ji(E,he),0<ae.length&&(he=new Wi(he,e,null,n,F),A.push({event:he,listeners:ae}),ce?he.data=ce:(ce=Xu(n),ce!==null&&(he.data=ce)))),(ce=Qi?Yf(e,n):Jf(e,n))&&(E=Ji(E,"onBeforeInput"),0<E.length&&(F=new Wi("onBeforeInput","beforeinput",null,n,F),A.push({event:F,listeners:E}),F.data=ce))}ya(A,t)})}function di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ji(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=nr(e,n),i!=null&&r.unshift(di(e,i,o)),i=nr(e,t),i!=null&&r.push(di(e,i,o))),e=e.return}return r}function wo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Sa(e,t,n,r,o){for(var i=t._reactName,a=[];n!==null&&n!==r;){var f=n,m=f.alternate,E=f.stateNode;if(m!==null&&m===r)break;f.tag===5&&E!==null&&(f=E,o?(m=nr(n,i),m!=null&&a.unshift(di(n,m,f))):o||(m=nr(n,i),m!=null&&a.push(di(n,m,f)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var fd=/\r\n?/g,dd=/\u0000|\uFFFD/g;function ka(e){return(typeof e=="string"?e:""+e).replace(fd,`
39
- `).replace(dd,"")}function Xi(e,t,n){if(t=ka(t),ka(e)!==t&&n)throw Error(l(425))}function Zi(){}var dl=null,hl=null;function pl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ml=typeof setTimeout=="function"?setTimeout:void 0,hd=typeof clearTimeout=="function"?clearTimeout:void 0,xa=typeof Promise=="function"?Promise:void 0,pd=typeof queueMicrotask=="function"?queueMicrotask:typeof xa<"u"?function(e){return xa.resolve(null).then(e).catch(md)}:ml;function md(e){setTimeout(function(){throw e})}function vl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ur(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ur(t)}function hr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ea(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var So=Math.random().toString(36).slice(2),Tn="__reactFiber$"+So,hi="__reactProps$"+So,Vn="__reactContainer$"+So,gl="__reactEvents$"+So,vd="__reactListeners$"+So,gd="__reactHandles$"+So;function $r(e){var t=e[Tn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Vn]||n[Tn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ea(e);e!==null;){if(n=e[Tn])return n;e=Ea(e)}return t}e=n,n=e.parentNode}return null}function pi(e){return e=e[Tn]||e[Vn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ko(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(l(33))}function es(e){return e[hi]||null}var yl=[],xo=-1;function pr(e){return{current:e}}function De(e){0>xo||(e.current=yl[xo],yl[xo]=null,xo--)}function Ae(e,t){xo++,yl[xo]=e.current,e.current=t}var mr={},ht=pr(mr),Pt=pr(!1),Vr=mr;function Eo(e,t){var n=e.type.contextTypes;if(!n)return mr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Tt(e){return e=e.childContextTypes,e!=null}function ts(){De(Pt),De(ht)}function _a(e,t,n){if(ht.current!==mr)throw Error(l(168));Ae(ht,t),Ae(Pt,n)}function Ca(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(l(108,ve(e)||"Unknown",o));return B({},n,r)}function ns(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mr,Vr=ht.current,Ae(ht,e),Ae(Pt,Pt.current),!0}function Na(e,t,n){var r=e.stateNode;if(!r)throw Error(l(169));n?(e=Ca(e,t,Vr),r.__reactInternalMemoizedMergedChildContext=e,De(Pt),De(ht),Ae(ht,e)):De(Pt),Ae(Pt,n)}var Bn=null,rs=!1,wl=!1;function Pa(e){Bn===null?Bn=[e]:Bn.push(e)}function yd(e){rs=!0,Pa(e)}function vr(){if(!wl&&Bn!==null){wl=!0;var e=0,t=ge;try{var n=Bn;for(ge=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Bn=null,rs=!1}catch(o){throw Bn!==null&&(Bn=Bn.slice(e+1)),qo(zt,vr),o}finally{ge=t,wl=!1}}return null}var _o=[],Co=0,os=null,is=0,Jt=[],Xt=0,Br=null,Wn=1,Hn="";function Wr(e,t){_o[Co++]=is,_o[Co++]=os,os=e,is=t}function Ta(e,t,n){Jt[Xt++]=Wn,Jt[Xt++]=Hn,Jt[Xt++]=Br,Br=e;var r=Wn;e=Hn;var o=32-kt(r)-1;r&=~(1<<o),n+=1;var i=32-kt(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Wn=1<<32-kt(t)+o|n<<o|r,Hn=i+e}else Wn=1<<i|n<<o|r,Hn=e}function Sl(e){e.return!==null&&(Wr(e,1),Ta(e,1,0))}function kl(e){for(;e===os;)os=_o[--Co],_o[Co]=null,is=_o[--Co],_o[Co]=null;for(;e===Br;)Br=Jt[--Xt],Jt[Xt]=null,Hn=Jt[--Xt],Jt[Xt]=null,Wn=Jt[--Xt],Jt[Xt]=null}var Vt=null,Bt=null,Ie=!1,an=null;function ja(e,t){var n=nn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ra(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Vt=e,Bt=hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Vt=e,Bt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Br!==null?{id:Wn,overflow:Hn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Vt=e,Bt=null,!0):!1;default:return!1}}function xl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function El(e){if(Ie){var t=Bt;if(t){var n=t;if(!Ra(e,t)){if(xl(e))throw Error(l(418));t=hr(n.nextSibling);var r=Vt;t&&Ra(e,t)?ja(r,n):(e.flags=e.flags&-4097|2,Ie=!1,Vt=e)}}else{if(xl(e))throw Error(l(418));e.flags=e.flags&-4097|2,Ie=!1,Vt=e}}}function Ma(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Vt=e}function ss(e){if(e!==Vt)return!1;if(!Ie)return Ma(e),Ie=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!pl(e.type,e.memoizedProps)),t&&(t=Bt)){if(xl(e))throw Fa(),Error(l(418));for(;t;)ja(e,t),t=hr(t.nextSibling)}if(Ma(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Bt=hr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Bt=null}}else Bt=Vt?hr(e.stateNode.nextSibling):null;return!0}function Fa(){for(var e=Bt;e;)e=hr(e.nextSibling)}function No(){Bt=Vt=null,Ie=!1}function _l(e){an===null?an=[e]:an.push(e)}var wd=I.ReactCurrentBatchConfig;function mi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(l(309));var r=n.stateNode}if(!r)throw Error(l(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var f=o.refs;a===null?delete f[i]:f[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(l(284));if(!n._owner)throw Error(l(290,e))}return e}function ls(e,t){throw e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function La(e){var t=e._init;return t(e._payload)}function Aa(e){function t(S,v){if(e){var k=S.deletions;k===null?(S.deletions=[v],S.flags|=16):k.push(v)}}function n(S,v){if(!e)return null;for(;v!==null;)t(S,v),v=v.sibling;return null}function r(S,v){for(S=new Map;v!==null;)v.key!==null?S.set(v.key,v):S.set(v.index,v),v=v.sibling;return S}function o(S,v){return S=_r(S,v),S.index=0,S.sibling=null,S}function i(S,v,k){return S.index=k,e?(k=S.alternate,k!==null?(k=k.index,k<v?(S.flags|=2,v):k):(S.flags|=2,v)):(S.flags|=1048576,v)}function a(S){return e&&S.alternate===null&&(S.flags|=2),S}function f(S,v,k,z){return v===null||v.tag!==6?(v=mu(k,S.mode,z),v.return=S,v):(v=o(v,k),v.return=S,v)}function m(S,v,k,z){var oe=k.type;return oe===ne?F(S,v,k.props.children,z,k.key):v!==null&&(v.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===$e&&La(oe)===v.type)?(z=o(v,k.props),z.ref=mi(S,v,k),z.return=S,z):(z=Ms(k.type,k.key,k.props,null,S.mode,z),z.ref=mi(S,v,k),z.return=S,z)}function E(S,v,k,z){return v===null||v.tag!==4||v.stateNode.containerInfo!==k.containerInfo||v.stateNode.implementation!==k.implementation?(v=vu(k,S.mode,z),v.return=S,v):(v=o(v,k.children||[]),v.return=S,v)}function F(S,v,k,z,oe){return v===null||v.tag!==7?(v=Jr(k,S.mode,z,oe),v.return=S,v):(v=o(v,k),v.return=S,v)}function A(S,v,k){if(typeof v=="string"&&v!==""||typeof v=="number")return v=mu(""+v,S.mode,k),v.return=S,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case K:return k=Ms(v.type,v.key,v.props,null,S.mode,k),k.ref=mi(S,null,v),k.return=S,k;case U:return v=vu(v,S.mode,k),v.return=S,v;case $e:var z=v._init;return A(S,z(v._payload),k)}if(gn(v)||le(v))return v=Jr(v,S.mode,k,null),v.return=S,v;ls(S,v)}return null}function M(S,v,k,z){var oe=v!==null?v.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return oe!==null?null:f(S,v,""+k,z);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case K:return k.key===oe?m(S,v,k,z):null;case U:return k.key===oe?E(S,v,k,z):null;case $e:return oe=k._init,M(S,v,oe(k._payload),z)}if(gn(k)||le(k))return oe!==null?null:F(S,v,k,z,null);ls(S,k)}return null}function J(S,v,k,z,oe){if(typeof z=="string"&&z!==""||typeof z=="number")return S=S.get(k)||null,f(v,S,""+z,oe);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case K:return S=S.get(z.key===null?k:z.key)||null,m(v,S,z,oe);case U:return S=S.get(z.key===null?k:z.key)||null,E(v,S,z,oe);case $e:var ae=z._init;return J(S,v,k,ae(z._payload),oe)}if(gn(z)||le(z))return S=S.get(k)||null,F(v,S,z,oe,null);ls(v,z)}return null}function ee(S,v,k,z){for(var oe=null,ae=null,ce=v,he=v=0,ot=null;ce!==null&&he<k.length;he++){ce.index>he?(ot=ce,ce=null):ot=ce.sibling;var Pe=M(S,ce,k[he],z);if(Pe===null){ce===null&&(ce=ot);break}e&&ce&&Pe.alternate===null&&t(S,ce),v=i(Pe,v,he),ae===null?oe=Pe:ae.sibling=Pe,ae=Pe,ce=ot}if(he===k.length)return n(S,ce),Ie&&Wr(S,he),oe;if(ce===null){for(;he<k.length;he++)ce=A(S,k[he],z),ce!==null&&(v=i(ce,v,he),ae===null?oe=ce:ae.sibling=ce,ae=ce);return Ie&&Wr(S,he),oe}for(ce=r(S,ce);he<k.length;he++)ot=J(ce,S,he,k[he],z),ot!==null&&(e&&ot.alternate!==null&&ce.delete(ot.key===null?he:ot.key),v=i(ot,v,he),ae===null?oe=ot:ae.sibling=ot,ae=ot);return e&&ce.forEach(function(Cr){return t(S,Cr)}),Ie&&Wr(S,he),oe}function re(S,v,k,z){var oe=le(k);if(typeof oe!="function")throw Error(l(150));if(k=oe.call(k),k==null)throw Error(l(151));for(var ae=oe=null,ce=v,he=v=0,ot=null,Pe=k.next();ce!==null&&!Pe.done;he++,Pe=k.next()){ce.index>he?(ot=ce,ce=null):ot=ce.sibling;var Cr=M(S,ce,Pe.value,z);if(Cr===null){ce===null&&(ce=ot);break}e&&ce&&Cr.alternate===null&&t(S,ce),v=i(Cr,v,he),ae===null?oe=Cr:ae.sibling=Cr,ae=Cr,ce=ot}if(Pe.done)return n(S,ce),Ie&&Wr(S,he),oe;if(ce===null){for(;!Pe.done;he++,Pe=k.next())Pe=A(S,Pe.value,z),Pe!==null&&(v=i(Pe,v,he),ae===null?oe=Pe:ae.sibling=Pe,ae=Pe);return Ie&&Wr(S,he),oe}for(ce=r(S,ce);!Pe.done;he++,Pe=k.next())Pe=J(ce,S,he,Pe.value,z),Pe!==null&&(e&&Pe.alternate!==null&&ce.delete(Pe.key===null?he:Pe.key),v=i(Pe,v,he),ae===null?oe=Pe:ae.sibling=Pe,ae=Pe);return e&&ce.forEach(function(Xd){return t(S,Xd)}),Ie&&Wr(S,he),oe}function Qe(S,v,k,z){if(typeof k=="object"&&k!==null&&k.type===ne&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case K:e:{for(var oe=k.key,ae=v;ae!==null;){if(ae.key===oe){if(oe=k.type,oe===ne){if(ae.tag===7){n(S,ae.sibling),v=o(ae,k.props.children),v.return=S,S=v;break e}}else if(ae.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===$e&&La(oe)===ae.type){n(S,ae.sibling),v=o(ae,k.props),v.ref=mi(S,ae,k),v.return=S,S=v;break e}n(S,ae);break}else t(S,ae);ae=ae.sibling}k.type===ne?(v=Jr(k.props.children,S.mode,z,k.key),v.return=S,S=v):(z=Ms(k.type,k.key,k.props,null,S.mode,z),z.ref=mi(S,v,k),z.return=S,S=z)}return a(S);case U:e:{for(ae=k.key;v!==null;){if(v.key===ae)if(v.tag===4&&v.stateNode.containerInfo===k.containerInfo&&v.stateNode.implementation===k.implementation){n(S,v.sibling),v=o(v,k.children||[]),v.return=S,S=v;break e}else{n(S,v);break}else t(S,v);v=v.sibling}v=vu(k,S.mode,z),v.return=S,S=v}return a(S);case $e:return ae=k._init,Qe(S,v,ae(k._payload),z)}if(gn(k))return ee(S,v,k,z);if(le(k))return re(S,v,k,z);ls(S,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,v!==null&&v.tag===6?(n(S,v.sibling),v=o(v,k),v.return=S,S=v):(n(S,v),v=mu(k,S.mode,z),v.return=S,S=v),a(S)):n(S,v)}return Qe}var Po=Aa(!0),Oa=Aa(!1),us=pr(null),as=null,To=null,Cl=null;function Nl(){Cl=To=as=null}function Pl(e){var t=us.current;De(us),e._currentValue=t}function Tl(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function jo(e,t){as=e,Cl=To=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(jt=!0),e.firstContext=null)}function Zt(e){var t=e._currentValue;if(Cl!==e)if(e={context:e,memoizedValue:t,next:null},To===null){if(as===null)throw Error(l(308));To=e,as.dependencies={lanes:0,firstContext:e}}else To=To.next=e;return t}var Hr=null;function jl(e){Hr===null?Hr=[e]:Hr.push(e)}function za(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,jl(t)):(n.next=o.next,o.next=n),t.interleaved=n,Kn(e,r)}function Kn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var gr=!1;function Rl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Da(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ce&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Kn(e,n)}return o=r.interleaved,o===null?(t.next=t,jl(r)):(t.next=o.next,o.next=t),r.interleaved=t,Kn(e,n)}function cs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,In(e,n)}}function Ia(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function fs(e,t,n,r){var o=e.updateQueue;gr=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,f=o.shared.pending;if(f!==null){o.shared.pending=null;var m=f,E=m.next;m.next=null,a===null?i=E:a.next=E,a=m;var F=e.alternate;F!==null&&(F=F.updateQueue,f=F.lastBaseUpdate,f!==a&&(f===null?F.firstBaseUpdate=E:f.next=E,F.lastBaseUpdate=m))}if(i!==null){var A=o.baseState;a=0,F=E=m=null,f=i;do{var M=f.lane,J=f.eventTime;if((r&M)===M){F!==null&&(F=F.next={eventTime:J,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var ee=e,re=f;switch(M=t,J=n,re.tag){case 1:if(ee=re.payload,typeof ee=="function"){A=ee.call(J,A,M);break e}A=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=re.payload,M=typeof ee=="function"?ee.call(J,A,M):ee,M==null)break e;A=B({},A,M);break e;case 2:gr=!0}}f.callback!==null&&f.lane!==0&&(e.flags|=64,M=o.effects,M===null?o.effects=[f]:M.push(f))}else J={eventTime:J,lane:M,tag:f.tag,payload:f.payload,callback:f.callback,next:null},F===null?(E=F=J,m=A):F=F.next=J,a|=M;if(f=f.next,f===null){if(f=o.shared.pending,f===null)break;M=f,f=M.next,M.next=null,o.lastBaseUpdate=M,o.shared.pending=null}}while(!0);if(F===null&&(m=A),o.baseState=m,o.firstBaseUpdate=E,o.lastBaseUpdate=F,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);qr|=a,e.lanes=a,e.memoizedState=A}}function Ua(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(l(191,o));o.call(r)}}}var vi={},jn=pr(vi),gi=pr(vi),yi=pr(vi);function Kr(e){if(e===vi)throw Error(l(174));return e}function Ml(e,t){switch(Ae(yi,t),Ae(gi,e),Ae(jn,vi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:at(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=at(t,e)}De(jn),Ae(jn,t)}function Ro(){De(jn),De(gi),De(yi)}function $a(e){Kr(yi.current);var t=Kr(jn.current),n=at(t,e.type);t!==n&&(Ae(gi,e),Ae(jn,n))}function Fl(e){gi.current===e&&(De(jn),De(gi))}var Be=pr(0);function ds(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ll=[];function Al(){for(var e=0;e<Ll.length;e++)Ll[e]._workInProgressVersionPrimary=null;Ll.length=0}var hs=I.ReactCurrentDispatcher,Ol=I.ReactCurrentBatchConfig,Qr=0,We=null,Xe=null,nt=null,ps=!1,wi=!1,Si=0,Sd=0;function pt(){throw Error(l(321))}function zl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!un(e[n],t[n]))return!1;return!0}function Dl(e,t,n,r,o,i){if(Qr=i,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,hs.current=e===null||e.memoizedState===null?_d:Cd,e=n(r,o),wi){i=0;do{if(wi=!1,Si=0,25<=i)throw Error(l(301));i+=1,nt=Xe=null,t.updateQueue=null,hs.current=Nd,e=n(r,o)}while(wi)}if(hs.current=gs,t=Xe!==null&&Xe.next!==null,Qr=0,nt=Xe=We=null,ps=!1,t)throw Error(l(300));return e}function Il(){var e=Si!==0;return Si=0,e}function Rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?We.memoizedState=nt=e:nt=nt.next=e,nt}function en(){if(Xe===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=nt===null?We.memoizedState:nt.next;if(t!==null)nt=t,Xe=e;else{if(e===null)throw Error(l(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},nt===null?We.memoizedState=nt=e:nt=nt.next=e}return nt}function ki(e,t){return typeof t=="function"?t(e):t}function Ul(e){var t=en(),n=t.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=e;var r=Xe,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var f=a=null,m=null,E=i;do{var F=E.lane;if((Qr&F)===F)m!==null&&(m=m.next={lane:0,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null}),r=E.hasEagerState?E.eagerState:e(r,E.action);else{var A={lane:F,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null};m===null?(f=m=A,a=r):m=m.next=A,We.lanes|=F,qr|=F}E=E.next}while(E!==null&&E!==i);m===null?a=r:m.next=f,un(r,t.memoizedState)||(jt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=m,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,We.lanes|=i,qr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function $l(e){var t=en(),n=t.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);un(i,t.memoizedState)||(jt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Va(){}function Ba(e,t){var n=We,r=en(),o=t(),i=!un(r.memoizedState,o);if(i&&(r.memoizedState=o,jt=!0),r=r.queue,Vl(Ka.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||nt!==null&&nt.memoizedState.tag&1){if(n.flags|=2048,xi(9,Ha.bind(null,n,r,o,t),void 0,null),rt===null)throw Error(l(349));(Qr&30)!==0||Wa(n,t,o)}return o}function Wa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ha(e,t,n,r){t.value=n,t.getSnapshot=r,Qa(t)&&qa(e)}function Ka(e,t,n){return n(function(){Qa(t)&&qa(e)})}function Qa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!un(e,n)}catch{return!0}}function qa(e){var t=Kn(e,1);t!==null&&hn(t,e,1,-1)}function ba(e){var t=Rn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:e},t.queue=e,e=e.dispatch=Ed.bind(null,We,e),[t.memoizedState,e]}function xi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ga(){return en().memoizedState}function ms(e,t,n,r){var o=Rn();We.flags|=e,o.memoizedState=xi(1|t,n,void 0,r===void 0?null:r)}function vs(e,t,n,r){var o=en();r=r===void 0?null:r;var i=void 0;if(Xe!==null){var a=Xe.memoizedState;if(i=a.destroy,r!==null&&zl(r,a.deps)){o.memoizedState=xi(t,n,i,r);return}}We.flags|=e,o.memoizedState=xi(1|t,n,i,r)}function Ya(e,t){return ms(8390656,8,e,t)}function Vl(e,t){return vs(2048,8,e,t)}function Ja(e,t){return vs(4,2,e,t)}function Xa(e,t){return vs(4,4,e,t)}function Za(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ec(e,t,n){return n=n!=null?n.concat([e]):null,vs(4,4,Za.bind(null,t,e),n)}function Bl(){}function tc(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function nc(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zl(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function rc(e,t,n){return(Qr&21)===0?(e.baseState&&(e.baseState=!1,jt=!0),e.memoizedState=n):(un(n,t)||(n=zi(),We.lanes|=n,qr|=n,e.baseState=!0),t)}function kd(e,t){var n=ge;ge=n!==0&&4>n?n:4,e(!0);var r=Ol.transition;Ol.transition={};try{e(!1),t()}finally{ge=n,Ol.transition=r}}function oc(){return en().memoizedState}function xd(e,t,n){var r=xr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ic(e))sc(t,n);else if(n=za(e,t,n,r),n!==null){var o=Et();hn(n,e,r,o),lc(n,t,r)}}function Ed(e,t,n){var r=xr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ic(e))sc(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,f=i(a,n);if(o.hasEagerState=!0,o.eagerState=f,un(f,a)){var m=t.interleaved;m===null?(o.next=o,jl(t)):(o.next=m.next,m.next=o),t.interleaved=o;return}}catch{}finally{}n=za(e,t,o,r),n!==null&&(o=Et(),hn(n,e,r,o),lc(n,t,r))}}function ic(e){var t=e.alternate;return e===We||t!==null&&t===We}function sc(e,t){wi=ps=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,In(e,n)}}var gs={readContext:Zt,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},_d={readContext:Zt,useCallback:function(e,t){return Rn().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:Ya,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ms(4194308,4,Za.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ms(4194308,4,e,t)},useInsertionEffect:function(e,t){return ms(4,2,e,t)},useMemo:function(e,t){var n=Rn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Rn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xd.bind(null,We,e),[r.memoizedState,e]},useRef:function(e){var t=Rn();return e={current:e},t.memoizedState=e},useState:ba,useDebugValue:Bl,useDeferredValue:function(e){return Rn().memoizedState=e},useTransition:function(){var e=ba(!1),t=e[0];return e=kd.bind(null,e[1]),Rn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=We,o=Rn();if(Ie){if(n===void 0)throw Error(l(407));n=n()}else{if(n=t(),rt===null)throw Error(l(349));(Qr&30)!==0||Wa(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Ya(Ka.bind(null,r,i,e),[e]),r.flags|=2048,xi(9,Ha.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Rn(),t=rt.identifierPrefix;if(Ie){var n=Hn,r=Wn;n=(r&~(1<<32-kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Si++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Sd++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Cd={readContext:Zt,useCallback:tc,useContext:Zt,useEffect:Vl,useImperativeHandle:ec,useInsertionEffect:Ja,useLayoutEffect:Xa,useMemo:nc,useReducer:Ul,useRef:Ga,useState:function(){return Ul(ki)},useDebugValue:Bl,useDeferredValue:function(e){var t=en();return rc(t,Xe.memoizedState,e)},useTransition:function(){var e=Ul(ki)[0],t=en().memoizedState;return[e,t]},useMutableSource:Va,useSyncExternalStore:Ba,useId:oc,unstable_isNewReconciler:!1},Nd={readContext:Zt,useCallback:tc,useContext:Zt,useEffect:Vl,useImperativeHandle:ec,useInsertionEffect:Ja,useLayoutEffect:Xa,useMemo:nc,useReducer:$l,useRef:Ga,useState:function(){return $l(ki)},useDebugValue:Bl,useDeferredValue:function(e){var t=en();return Xe===null?t.memoizedState=e:rc(t,Xe.memoizedState,e)},useTransition:function(){var e=$l(ki)[0],t=en().memoizedState;return[e,t]},useMutableSource:Va,useSyncExternalStore:Ba,useId:oc,unstable_isNewReconciler:!1};function cn(e,t){if(e&&e.defaultProps){t=B({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Wl(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:B({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ys={isMounted:function(e){return(e=e._reactInternals)?zn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Et(),o=xr(e),i=Qn(r,o);i.payload=t,n!=null&&(i.callback=n),t=yr(e,i,o),t!==null&&(hn(t,e,o,r),cs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Et(),o=xr(e),i=Qn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yr(e,i,o),t!==null&&(hn(t,e,o,r),cs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Et(),r=xr(e),o=Qn(n,r);o.tag=2,t!=null&&(o.callback=t),t=yr(e,o,r),t!==null&&(hn(t,e,r,n),cs(t,e,r))}};function uc(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!ui(n,r)||!ui(o,i):!0}function ac(e,t,n){var r=!1,o=mr,i=t.contextType;return typeof i=="object"&&i!==null?i=Zt(i):(o=Tt(t)?Vr:ht.current,r=t.contextTypes,i=(r=r!=null)?Eo(e,o):mr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ys,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ys.enqueueReplaceState(t,t.state,null)}function Hl(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Rl(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Zt(i):(i=Tt(t)?Vr:ht.current,o.context=Eo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Wl(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ys.enqueueReplaceState(o,o.state,null),fs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Mo(e,t){try{var n="",r=t;do n+=pe(r),r=r.return;while(r);var o=n}catch(i){o=`
40
- Error generating stack: `+i.message+`
41
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function Kl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ql(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Pd=typeof WeakMap=="function"?WeakMap:Map;function fc(e,t,n){n=Qn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cs||(Cs=!0,lu=r),Ql(e,t)},n}function dc(e,t,n){n=Qn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ql(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ql(e,t),typeof r!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function hc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pd;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Vd.bind(null,e,t,n),t.then(e,e))}function pc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function mc(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Qn(-1,1),t.tag=2,yr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Td=I.ReactCurrentOwner,jt=!1;function xt(e,t,n,r){t.child=e===null?Oa(t,null,n,r):Po(t,e.child,n,r)}function vc(e,t,n,r,o){n=n.render;var i=t.ref;return jo(t,o),r=Dl(e,t,n,r,i,o),n=Il(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,qn(e,t,o)):(Ie&&n&&Sl(t),t.flags|=1,xt(e,t,r,o),t.child)}function gc(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!pu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,yc(e,t,i,r,o)):(e=Ms(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&o)===0){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:ui,n(a,r)&&e.ref===t.ref)return qn(e,t,o)}return t.flags|=1,e=_r(i,r),e.ref=t.ref,e.return=t,t.child=e}function yc(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ui(i,r)&&e.ref===t.ref)if(jt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,qn(e,t,o)}return ql(e,t,n,r,o)}function wc(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ae(Lo,Wt),Wt|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ae(Lo,Wt),Wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ae(Lo,Wt),Wt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ae(Lo,Wt),Wt|=r;return xt(e,t,o,n),t.child}function Sc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ql(e,t,n,r,o){var i=Tt(n)?Vr:ht.current;return i=Eo(t,i),jo(t,o),n=Dl(e,t,n,r,i,o),r=Il(),e!==null&&!jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,qn(e,t,o)):(Ie&&r&&Sl(t),t.flags|=1,xt(e,t,n,o),t.child)}function kc(e,t,n,r,o){if(Tt(n)){var i=!0;ns(t)}else i=!1;if(jo(t,o),t.stateNode===null)Ss(e,t),ac(t,n,r),Hl(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,f=t.memoizedProps;a.props=f;var m=a.context,E=n.contextType;typeof E=="object"&&E!==null?E=Zt(E):(E=Tt(n)?Vr:ht.current,E=Eo(t,E));var F=n.getDerivedStateFromProps,A=typeof F=="function"||typeof a.getSnapshotBeforeUpdate=="function";A||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(f!==r||m!==E)&&cc(t,a,r,E),gr=!1;var M=t.memoizedState;a.state=M,fs(t,r,a,o),m=t.memoizedState,f!==r||M!==m||Pt.current||gr?(typeof F=="function"&&(Wl(t,n,F,r),m=t.memoizedState),(f=gr||uc(t,n,f,r,M,m,E))?(A||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=E,r=f):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Da(e,t),f=t.memoizedProps,E=t.type===t.elementType?f:cn(t.type,f),a.props=E,A=t.pendingProps,M=a.context,m=n.contextType,typeof m=="object"&&m!==null?m=Zt(m):(m=Tt(n)?Vr:ht.current,m=Eo(t,m));var J=n.getDerivedStateFromProps;(F=typeof J=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(f!==A||M!==m)&&cc(t,a,r,m),gr=!1,M=t.memoizedState,a.state=M,fs(t,r,a,o);var ee=t.memoizedState;f!==A||M!==ee||Pt.current||gr?(typeof J=="function"&&(Wl(t,n,J,r),ee=t.memoizedState),(E=gr||uc(t,n,E,r,M,ee,m)||!1)?(F||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,ee,m),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,ee,m)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=ee),a.props=r,a.state=ee,a.context=m,r=E):(typeof a.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),r=!1)}return bl(e,t,n,r,i,o)}function bl(e,t,n,r,o,i){Sc(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&Na(t,n,!1),qn(e,t,i);r=t.stateNode,Td.current=t;var f=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Po(t,e.child,null,i),t.child=Po(t,null,f,i)):xt(e,t,f,i),t.memoizedState=r.state,o&&Na(t,n,!0),t.child}function xc(e){var t=e.stateNode;t.pendingContext?_a(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_a(e,t.context,!1),Ml(e,t.containerInfo)}function Ec(e,t,n,r,o){return No(),_l(o),t.flags|=256,xt(e,t,n,r),t.child}var Gl={dehydrated:null,treeContext:null,retryLane:0};function Yl(e){return{baseLanes:e,cachePool:null,transitions:null}}function _c(e,t,n){var r=t.pendingProps,o=Be.current,i=!1,a=(t.flags&128)!==0,f;if((f=a)||(f=e!==null&&e.memoizedState===null?!1:(o&2)!==0),f?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ae(Be,o&1),e===null)return El(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},(r&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Fs(a,r,0,null),e=Jr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Yl(n),t.memoizedState=Gl,e):Jl(t,a));if(o=e.memoizedState,o!==null&&(f=o.dehydrated,f!==null))return jd(e,t,a,r,f,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,f=o.sibling;var m={mode:"hidden",children:r.children};return(a&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=m,t.deletions=null):(r=_r(o,m),r.subtreeFlags=o.subtreeFlags&14680064),f!==null?i=_r(f,i):(i=Jr(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?Yl(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Gl,r}return i=e.child,e=i.sibling,r=_r(i,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Jl(e,t){return t=Fs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ws(e,t,n,r){return r!==null&&_l(r),Po(t,e.child,null,n),e=Jl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jd(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Kl(Error(l(422))),ws(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Fs({mode:"visible",children:r.children},o,0,null),i=Jr(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&Po(t,e.child,null,a),t.child.memoizedState=Yl(a),t.memoizedState=Gl,i);if((t.mode&1)===0)return ws(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var f=r.dgst;return r=f,i=Error(l(419)),r=Kl(i,r,void 0),ws(e,t,a,r)}if(f=(a&e.childLanes)!==0,jt||f){if(r=rt,r!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|a))!==0?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Kn(e,o),hn(r,e,o,-1))}return hu(),r=Kl(Error(l(421))),ws(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Bd.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Bt=hr(o.nextSibling),Vt=t,Ie=!0,an=null,e!==null&&(Jt[Xt++]=Wn,Jt[Xt++]=Hn,Jt[Xt++]=Br,Wn=e.id,Hn=e.overflow,Br=t),t=Jl(t,r.children),t.flags|=4096,t)}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Tl(e.return,t,n)}function Xl(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Nc(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(xt(e,t,r.children,n),r=Be.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ae(Be,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&ds(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Xl(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&ds(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Xl(t,!0,n,null,i);break;case"together":Xl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ss(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),qr|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,n=_r(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_r(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Rd(e,t,n){switch(t.tag){case 3:xc(t),No();break;case 5:$a(t);break;case 1:Tt(t.type)&&ns(t);break;case 4:Ml(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ae(us,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ae(Be,Be.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?_c(e,t,n):(Ae(Be,Be.current&1),e=qn(e,t,n),e!==null?e.sibling:null);Ae(Be,Be.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Nc(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ae(Be,Be.current),r)break;return null;case 22:case 23:return t.lanes=0,wc(e,t,n)}return qn(e,t,n)}var Pc,Zl,Tc,jc;Pc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Zl=function(){},Tc=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Kr(jn.current);var i=null;switch(n){case"input":o=Ht(e,o),r=Ht(e,r),i=[];break;case"select":o=B({},o,{value:void 0}),r=B({},r,{value:void 0}),i=[];break;case"textarea":o=Fn(e,o),r=Fn(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zi)}jr(n,r);var a;n=null;for(E in o)if(!r.hasOwnProperty(E)&&o.hasOwnProperty(E)&&o[E]!=null)if(E==="style"){var f=o[E];for(a in f)f.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else E!=="dangerouslySetInnerHTML"&&E!=="children"&&E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(d.hasOwnProperty(E)?i||(i=[]):(i=i||[]).push(E,null));for(E in r){var m=r[E];if(f=o!=null?o[E]:void 0,r.hasOwnProperty(E)&&m!==f&&(m!=null||f!=null))if(E==="style")if(f){for(a in f)!f.hasOwnProperty(a)||m&&m.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in m)m.hasOwnProperty(a)&&f[a]!==m[a]&&(n||(n={}),n[a]=m[a])}else n||(i||(i=[]),i.push(E,n)),n=m;else E==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,f=f?f.__html:void 0,m!=null&&f!==m&&(i=i||[]).push(E,m)):E==="children"?typeof m!="string"&&typeof m!="number"||(i=i||[]).push(E,""+m):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&(d.hasOwnProperty(E)?(m!=null&&E==="onScroll"&&ze("scroll",e),i||f===m||(i=[])):(i=i||[]).push(E,m))}n&&(i=i||[]).push("style",n);var E=i;(t.updateQueue=E)&&(t.flags|=4)}},jc=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ei(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Md(e,t,n){var r=t.pendingProps;switch(kl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return Tt(t.type)&&ts(),mt(t),null;case 3:return r=t.stateNode,Ro(),De(Pt),De(ht),Al(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ss(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,an!==null&&(cu(an),an=null))),Zl(e,t),mt(t),null;case 5:Fl(t);var o=Kr(yi.current);if(n=t.type,e!==null&&t.stateNode!=null)Tc(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(l(166));return mt(t),null}if(e=Kr(jn.current),ss(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Tn]=t,r[hi]=i,e=(t.mode&1)!==0,n){case"dialog":ze("cancel",r),ze("close",r);break;case"iframe":case"object":case"embed":ze("load",r);break;case"video":case"audio":for(o=0;o<ci.length;o++)ze(ci[o],r);break;case"source":ze("error",r);break;case"img":case"image":case"link":ze("error",r),ze("load",r);break;case"details":ze("toggle",r);break;case"input":Yn(r,i),ze("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ze("invalid",r);break;case"textarea":Xn(r,i),ze("invalid",r)}jr(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var f=i[a];a==="children"?typeof f=="string"?r.textContent!==f&&(i.suppressHydrationWarning!==!0&&Xi(r.textContent,f,e),o=["children",f]):typeof f=="number"&&r.textContent!==""+f&&(i.suppressHydrationWarning!==!0&&Xi(r.textContent,f,e),o=["children",""+f]):d.hasOwnProperty(a)&&f!=null&&a==="onScroll"&&ze("scroll",r)}switch(n){case"input":Gn(r),vn(r,i,!0);break;case"textarea":Gn(r),Ot(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Zi)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=eo(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Tn]=t,e[hi]=r,Pc(e,t,!1,!1),t.stateNode=e;e:{switch(a=ro(n,r),n){case"dialog":ze("cancel",e),ze("close",e),o=r;break;case"iframe":case"object":case"embed":ze("load",e),o=r;break;case"video":case"audio":for(o=0;o<ci.length;o++)ze(ci[o],e);o=r;break;case"source":ze("error",e),o=r;break;case"img":case"image":case"link":ze("error",e),ze("load",e),o=r;break;case"details":ze("toggle",e),o=r;break;case"input":Yn(e,r),o=Ht(e,r),ze("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=B({},r,{value:void 0}),ze("invalid",e);break;case"textarea":Xn(e,r),o=Fn(e,r),ze("invalid",e);break;default:o=r}jr(n,o),f=o;for(i in f)if(f.hasOwnProperty(i)){var m=f[i];i==="style"?no(e,m):i==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,m!=null&&to(e,m)):i==="children"?typeof m=="string"?(n!=="textarea"||m!=="")&&Tr(e,m):typeof m=="number"&&Tr(e,""+m):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(d.hasOwnProperty(i)?m!=null&&i==="onScroll"&&ze("scroll",e):m!=null&&ye(e,i,m,a))}switch(n){case"input":Gn(e),vn(e,r,!1);break;case"textarea":Gn(e),Ot(e);break;case"option":r.value!=null&&e.setAttribute("value",""+xe(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?At(e,!!r.multiple,i,!1):r.defaultValue!=null&&At(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Zi)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return mt(t),null;case 6:if(e&&t.stateNode!=null)jc(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(l(166));if(n=Kr(yi.current),Kr(jn.current),ss(t)){if(r=t.stateNode,n=t.memoizedProps,r[Tn]=t,(i=r.nodeValue!==n)&&(e=Vt,e!==null))switch(e.tag){case 3:Xi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xi(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Tn]=t,t.stateNode=r}return mt(t),null;case 13:if(De(Be),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ie&&Bt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Fa(),No(),t.flags|=98560,i=!1;else if(i=ss(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(l(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(l(317));i[Tn]=t}else No(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),i=!1}else an!==null&&(cu(an),an=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Be.current&1)!==0?Ze===0&&(Ze=3):hu())),t.updateQueue!==null&&(t.flags|=4),mt(t),null);case 4:return Ro(),Zl(e,t),e===null&&fi(t.stateNode.containerInfo),mt(t),null;case 10:return Pl(t.type._context),mt(t),null;case 17:return Tt(t.type)&&ts(),mt(t),null;case 19:if(De(Be),i=t.memoizedState,i===null)return mt(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Ei(i,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=ds(e),a!==null){for(t.flags|=128,Ei(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ae(Be,Be.current&1|2),t.child}e=e.sibling}i.tail!==null&&Le()>Ao&&(t.flags|=128,r=!0,Ei(i,!1),t.lanes=4194304)}else{if(!r)if(e=ds(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ei(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Ie)return mt(t),null}else 2*Le()-i.renderingStartTime>Ao&&n!==1073741824&&(t.flags|=128,r=!0,Ei(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Le(),t.sibling=null,n=Be.current,Ae(Be,r?n&1|2:n&1),t):(mt(t),null);case 22:case 23:return du(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Wt&1073741824)!==0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}function Fd(e,t){switch(kl(t),t.tag){case 1:return Tt(t.type)&&ts(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ro(),De(Pt),De(ht),Al(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Fl(t),null;case 13:if(De(Be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));No()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De(Be),null;case 4:return Ro(),null;case 10:return Pl(t.type._context),null;case 22:case 23:return du(),null;case 24:return null;default:return null}}var ks=!1,vt=!1,Ld=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Fo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ke(e,t,r)}else n.current=null}function eu(e,t,n){try{n()}catch(r){Ke(e,t,r)}}var Rc=!1;function Ad(e,t){if(dl=Dr,e=ua(),ol(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,f=-1,m=-1,E=0,F=0,A=e,M=null;t:for(;;){for(var J;A!==n||o!==0&&A.nodeType!==3||(f=a+o),A!==i||r!==0&&A.nodeType!==3||(m=a+r),A.nodeType===3&&(a+=A.nodeValue.length),(J=A.firstChild)!==null;)M=A,A=J;for(;;){if(A===e)break t;if(M===n&&++E===o&&(f=a),M===i&&++F===r&&(m=a),(J=A.nextSibling)!==null)break;A=M,M=A.parentNode}A=J}n=f===-1||m===-1?null:{start:f,end:m}}else n=null}n=n||{start:0,end:0}}else n=null;for(hl={focusedElem:e,selectionRange:n},Dr=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var ee=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ee!==null){var re=ee.memoizedProps,Qe=ee.memoizedState,S=t.stateNode,v=S.getSnapshotBeforeUpdate(t.elementType===t.type?re:cn(t.type,re),Qe);S.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(z){Ke(t,t.return,z)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return ee=Rc,Rc=!1,ee}function _i(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&eu(t,n,i)}o=o.next}while(o!==r)}}function xs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function tu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Mc(e){var t=e.alternate;t!==null&&(e.alternate=null,Mc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tn],delete t[hi],delete t[gl],delete t[vd],delete t[gd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Fc(e){return e.tag===5||e.tag===3||e.tag===4}function Lc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zi));else if(r!==4&&(e=e.child,e!==null))for(nu(e,t,n),e=e.sibling;e!==null;)nu(e,t,n),e=e.sibling}function ru(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ru(e,t,n),e=e.sibling;e!==null;)ru(e,t,n),e=e.sibling}var st=null,fn=!1;function wr(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(Dn,n)}catch{}switch(n.tag){case 5:vt||Fo(n,t);case 6:var r=st,o=fn;st=null,wr(e,t,n),st=r,fn=o,st!==null&&(fn?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(fn?(e=st,n=n.stateNode,e.nodeType===8?vl(e.parentNode,n):e.nodeType===1&&vl(e,n),ur(e)):vl(st,n.stateNode));break;case 4:r=st,o=fn,st=n.stateNode.containerInfo,fn=!0,wr(e,t,n),st=r,fn=o;break;case 0:case 11:case 14:case 15:if(!vt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&eu(n,t,a),o=o.next}while(o!==r)}wr(e,t,n);break;case 1:if(!vt&&(Fo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(f){Ke(n,t,f)}wr(e,t,n);break;case 21:wr(e,t,n);break;case 22:n.mode&1?(vt=(r=vt)||n.memoizedState!==null,wr(e,t,n),vt=r):wr(e,t,n);break;default:wr(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ld),t.forEach(function(r){var o=Wd.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function dn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,f=a;e:for(;f!==null;){switch(f.tag){case 5:st=f.stateNode,fn=!1;break e;case 3:st=f.stateNode.containerInfo,fn=!0;break e;case 4:st=f.stateNode.containerInfo,fn=!0;break e}f=f.return}if(st===null)throw Error(l(160));Ac(i,a,o),st=null,fn=!1;var m=o.alternate;m!==null&&(m.return=null),o.return=null}catch(E){Ke(o,t,E)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zc(t,e),t=t.sibling}function zc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dn(t,e),Mn(e),r&4){try{_i(3,e,e.return),xs(3,e)}catch(re){Ke(e,e.return,re)}try{_i(5,e,e.return)}catch(re){Ke(e,e.return,re)}}break;case 1:dn(t,e),Mn(e),r&512&&n!==null&&Fo(n,n.return);break;case 5:if(dn(t,e),Mn(e),r&512&&n!==null&&Fo(n,n.return),e.flags&32){var o=e.stateNode;try{Tr(o,"")}catch(re){Ke(e,e.return,re)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,f=e.type,m=e.updateQueue;if(e.updateQueue=null,m!==null)try{f==="input"&&i.type==="radio"&&i.name!=null&&ut(o,i),ro(f,a);var E=ro(f,i);for(a=0;a<m.length;a+=2){var F=m[a],A=m[a+1];F==="style"?no(o,A):F==="dangerouslySetInnerHTML"?to(o,A):F==="children"?Tr(o,A):ye(o,F,A,E)}switch(f){case"input":Pr(o,i);break;case"textarea":Zn(o,i);break;case"select":var M=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var J=i.value;J!=null?At(o,!!i.multiple,J,!1):M!==!!i.multiple&&(i.defaultValue!=null?At(o,!!i.multiple,i.defaultValue,!0):At(o,!!i.multiple,i.multiple?[]:"",!1))}o[hi]=i}catch(re){Ke(e,e.return,re)}}break;case 6:if(dn(t,e),Mn(e),r&4){if(e.stateNode===null)throw Error(l(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(re){Ke(e,e.return,re)}}break;case 3:if(dn(t,e),Mn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ur(t.containerInfo)}catch(re){Ke(e,e.return,re)}break;case 4:dn(t,e),Mn(e);break;case 13:dn(t,e),Mn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(su=Le())),r&4&&Oc(e);break;case 22:if(F=n!==null&&n.memoizedState!==null,e.mode&1?(vt=(E=vt)||F,dn(t,e),vt=E):dn(t,e),Mn(e),r&8192){if(E=e.memoizedState!==null,(e.stateNode.isHidden=E)&&!F&&(e.mode&1)!==0)for(Z=e,F=e.child;F!==null;){for(A=Z=F;Z!==null;){switch(M=Z,J=M.child,M.tag){case 0:case 11:case 14:case 15:_i(4,M,M.return);break;case 1:Fo(M,M.return);var ee=M.stateNode;if(typeof ee.componentWillUnmount=="function"){r=M,n=M.return;try{t=r,ee.props=t.memoizedProps,ee.state=t.memoizedState,ee.componentWillUnmount()}catch(re){Ke(r,n,re)}}break;case 5:Fo(M,M.return);break;case 22:if(M.memoizedState!==null){Uc(A);continue}}J!==null?(J.return=M,Z=J):Uc(A)}F=F.sibling}e:for(F=null,A=e;;){if(A.tag===5){if(F===null){F=A;try{o=A.stateNode,E?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(f=A.stateNode,m=A.memoizedProps.style,a=m!=null&&m.hasOwnProperty("display")?m.display:null,f.style.display=gt("display",a))}catch(re){Ke(e,e.return,re)}}}else if(A.tag===6){if(F===null)try{A.stateNode.nodeValue=E?"":A.memoizedProps}catch(re){Ke(e,e.return,re)}}else if((A.tag!==22&&A.tag!==23||A.memoizedState===null||A===e)&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===e)break e;for(;A.sibling===null;){if(A.return===null||A.return===e)break e;F===A&&(F=null),A=A.return}F===A&&(F=null),A.sibling.return=A.return,A=A.sibling}}break;case 19:dn(t,e),Mn(e),r&4&&Oc(e);break;case 21:break;default:dn(t,e),Mn(e)}}function Mn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Fc(n)){var r=n;break e}n=n.return}throw Error(l(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Tr(o,""),r.flags&=-33);var i=Lc(e);ru(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,f=Lc(e);nu(e,f,a);break;default:throw Error(l(161))}}catch(m){Ke(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Od(e,t,n){Z=e,Dc(e)}function Dc(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var o=Z,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||ks;if(!a){var f=o.alternate,m=f!==null&&f.memoizedState!==null||vt;f=ks;var E=vt;if(ks=a,(vt=m)&&!E)for(Z=o;Z!==null;)a=Z,m=a.child,a.tag===22&&a.memoizedState!==null?$c(o):m!==null?(m.return=a,Z=m):$c(o);for(;i!==null;)Z=i,Dc(i),i=i.sibling;Z=o,ks=f,vt=E}Ic(e)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,Z=i):Ic(e)}}function Ic(e){for(;Z!==null;){var t=Z;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:vt||xs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!vt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:cn(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ua(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ua(t,a,n)}break;case 5:var f=t.stateNode;if(n===null&&t.flags&4){n=f;var m=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":m.autoFocus&&n.focus();break;case"img":m.src&&(n.src=m.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var E=t.alternate;if(E!==null){var F=E.memoizedState;if(F!==null){var A=F.dehydrated;A!==null&&ur(A)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}vt||t.flags&512&&tu(t)}catch(M){Ke(t,t.return,M)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Uc(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function $c(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{xs(4,t)}catch(m){Ke(t,n,m)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(m){Ke(t,o,m)}}var i=t.return;try{tu(t)}catch(m){Ke(t,i,m)}break;case 5:var a=t.return;try{tu(t)}catch(m){Ke(t,a,m)}}}catch(m){Ke(t,t.return,m)}if(t===e){Z=null;break}var f=t.sibling;if(f!==null){f.return=t.return,Z=f;break}Z=t.return}}var zd=Math.ceil,Es=I.ReactCurrentDispatcher,ou=I.ReactCurrentOwner,tn=I.ReactCurrentBatchConfig,Ce=0,rt=null,be=null,lt=0,Wt=0,Lo=pr(0),Ze=0,Ci=null,qr=0,_s=0,iu=0,Ni=null,Rt=null,su=0,Ao=1/0,bn=null,Cs=!1,lu=null,Sr=null,Ns=!1,kr=null,Ps=0,Pi=0,uu=null,Ts=-1,js=0;function Et(){return(Ce&6)!==0?Le():Ts!==-1?Ts:Ts=Le()}function xr(e){return(e.mode&1)===0?1:(Ce&2)!==0&&lt!==0?lt&-lt:wd.transition!==null?(js===0&&(js=zi()),js):(e=ge,e!==0||(e=window.event,e=e===void 0?16:$i(e.type)),e)}function hn(e,t,n,r){if(50<Pi)throw Pi=0,uu=null,Error(l(185));kn(e,n,r),((Ce&2)===0||e!==rt)&&(e===rt&&((Ce&2)===0&&(_s|=n),Ze===4&&Er(e,lt)),Mt(e,r),n===1&&Ce===0&&(t.mode&1)===0&&(Ao=Le()+500,rs&&vr()))}function Mt(e,t){var n=e.callbackNode;bo(e,t);var r=Sn(e,e===rt?lt:0);if(r===0)n!==null&&rn(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&rn(n),t===1)e.tag===0?yd(Bc.bind(null,e)):Pa(Bc.bind(null,e)),pd(function(){(Ce&6)===0&&vr()}),n=null;else{switch(Di(r)){case 1:n=zt;break;case 4:n=Dt;break;case 16:n=wt;break;case 536870912:n=tt;break;default:n=wt}n=Yc(n,Vc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Vc(e,t){if(Ts=-1,js=0,(Ce&6)!==0)throw Error(l(327));var n=e.callbackNode;if(Oo()&&e.callbackNode!==n)return null;var r=Sn(e,e===rt?lt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Rs(e,r);else{t=r;var o=Ce;Ce|=2;var i=Hc();(rt!==e||lt!==t)&&(bn=null,Ao=Le()+500,Gr(e,t));do try{Ud();break}catch(f){Wc(e,f)}while(!0);Nl(),Es.current=i,Ce=o,be!==null?t=0:(rt=null,lt=0,t=Ze)}if(t!==0){if(t===2&&(o=Go(e),o!==0&&(r=o,t=au(e,o))),t===1)throw n=Ci,Gr(e,0),Er(e,r),Mt(e,Le()),n;if(t===6)Er(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Dd(o)&&(t=Rs(e,r),t===2&&(i=Go(e),i!==0&&(r=i,t=au(e,i))),t===1))throw n=Ci,Gr(e,0),Er(e,r),Mt(e,Le()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(l(345));case 2:Yr(e,Rt,bn);break;case 3:if(Er(e,r),(r&130023424)===r&&(t=su+500-Le(),10<t)){if(Sn(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Et(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ml(Yr.bind(null,e,Rt,bn),t);break}Yr(e,Rt,bn);break;case 4:if(Er(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-kt(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zd(r/1960))-r,10<r){e.timeoutHandle=ml(Yr.bind(null,e,Rt,bn),r);break}Yr(e,Rt,bn);break;case 5:Yr(e,Rt,bn);break;default:throw Error(l(329))}}}return Mt(e,Le()),e.callbackNode===n?Vc.bind(null,e):null}function au(e,t){var n=Ni;return e.current.memoizedState.isDehydrated&&(Gr(e,t).flags|=256),e=Rs(e,t),e!==2&&(t=Rt,Rt=n,t!==null&&cu(t)),e}function cu(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function Dd(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!un(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Er(e,t){for(t&=~iu,t&=~_s,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-kt(t),r=1<<n;e[n]=-1,t&=~r}}function Bc(e){if((Ce&6)!==0)throw Error(l(327));Oo();var t=Sn(e,0);if((t&1)===0)return Mt(e,Le()),null;var n=Rs(e,t);if(e.tag!==0&&n===2){var r=Go(e);r!==0&&(t=r,n=au(e,r))}if(n===1)throw n=Ci,Gr(e,0),Er(e,t),Mt(e,Le()),n;if(n===6)throw Error(l(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Yr(e,Rt,bn),Mt(e,Le()),null}function fu(e,t){var n=Ce;Ce|=1;try{return e(t)}finally{Ce=n,Ce===0&&(Ao=Le()+500,rs&&vr())}}function br(e){kr!==null&&kr.tag===0&&(Ce&6)===0&&Oo();var t=Ce;Ce|=1;var n=tn.transition,r=ge;try{if(tn.transition=null,ge=1,e)return e()}finally{ge=r,tn.transition=n,Ce=t,(Ce&6)===0&&vr()}}function du(){Wt=Lo.current,De(Lo)}function Gr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hd(n)),be!==null)for(n=be.return;n!==null;){var r=n;switch(kl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ts();break;case 3:Ro(),De(Pt),De(ht),Al();break;case 5:Fl(r);break;case 4:Ro();break;case 13:De(Be);break;case 19:De(Be);break;case 10:Pl(r.type._context);break;case 22:case 23:du()}n=n.return}if(rt=e,be=e=_r(e.current,null),lt=Wt=t,Ze=0,Ci=null,iu=_s=qr=0,Rt=Ni=null,Hr!==null){for(t=0;t<Hr.length;t++)if(n=Hr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}Hr=null}return e}function Wc(e,t){do{var n=be;try{if(Nl(),hs.current=gs,ps){for(var r=We.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ps=!1}if(Qr=0,nt=Xe=We=null,wi=!1,Si=0,ou.current=null,n===null||n.return===null){Ze=1,Ci=t,be=null;break}e:{var i=e,a=n.return,f=n,m=t;if(t=lt,f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){var E=m,F=f,A=F.tag;if((F.mode&1)===0&&(A===0||A===11||A===15)){var M=F.alternate;M?(F.updateQueue=M.updateQueue,F.memoizedState=M.memoizedState,F.lanes=M.lanes):(F.updateQueue=null,F.memoizedState=null)}var J=pc(a);if(J!==null){J.flags&=-257,mc(J,a,f,i,t),J.mode&1&&hc(i,E,t),t=J,m=E;var ee=t.updateQueue;if(ee===null){var re=new Set;re.add(m),t.updateQueue=re}else ee.add(m);break e}else{if((t&1)===0){hc(i,E,t),hu();break e}m=Error(l(426))}}else if(Ie&&f.mode&1){var Qe=pc(a);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),mc(Qe,a,f,i,t),_l(Mo(m,f));break e}}i=m=Mo(m,f),Ze!==4&&(Ze=2),Ni===null?Ni=[i]:Ni.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var S=fc(i,m,t);Ia(i,S);break e;case 1:f=m;var v=i.type,k=i.stateNode;if((i.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Sr===null||!Sr.has(k)))){i.flags|=65536,t&=-t,i.lanes|=t;var z=dc(i,f,t);Ia(i,z);break e}}i=i.return}while(i!==null)}Qc(n)}catch(oe){t=oe,be===n&&n!==null&&(be=n=n.return);continue}break}while(!0)}function Hc(){var e=Es.current;return Es.current=gs,e===null?gs:e}function hu(){(Ze===0||Ze===3||Ze===2)&&(Ze=4),rt===null||(qr&268435455)===0&&(_s&268435455)===0||Er(rt,lt)}function Rs(e,t){var n=Ce;Ce|=2;var r=Hc();(rt!==e||lt!==t)&&(bn=null,Gr(e,t));do try{Id();break}catch(o){Wc(e,o)}while(!0);if(Nl(),Ce=n,Es.current=r,be!==null)throw Error(l(261));return rt=null,lt=0,Ze}function Id(){for(;be!==null;)Kc(be)}function Ud(){for(;be!==null&&!Kt();)Kc(be)}function Kc(e){var t=Gc(e.alternate,e,Wt);e.memoizedProps=e.pendingProps,t===null?Qc(e):be=t,ou.current=null}function Qc(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Md(n,t,Wt),n!==null){be=n;return}}else{if(n=Fd(n,t),n!==null){n.flags&=32767,be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ze=6,be=null;return}}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ze===0&&(Ze=5)}function Yr(e,t,n){var r=ge,o=tn.transition;try{tn.transition=null,ge=1,$d(e,t,n,r)}finally{tn.transition=o,ge=r}return null}function $d(e,t,n,r){do Oo();while(kr!==null);if((Ce&6)!==0)throw Error(l(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(l(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(sr(e,i),e===rt&&(be=rt=null,lt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ns||(Ns=!0,Yc(wt,function(){return Oo(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=tn.transition,tn.transition=null;var a=ge;ge=1;var f=Ce;Ce|=4,ou.current=null,Ad(e,n),zc(n,e),sd(hl),Dr=!!dl,hl=dl=null,e.current=n,Od(n),on(),Ce=f,ge=a,tn.transition=i}else e.current=n;if(Ns&&(Ns=!1,kr=e,Ps=o),i=e.pendingLanes,i===0&&(Sr=null),St(n.stateNode),Mt(e,Le()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Cs)throw Cs=!1,e=lu,lu=null,e;return(Ps&1)!==0&&e.tag!==0&&Oo(),i=e.pendingLanes,(i&1)!==0?e===uu?Pi++:(Pi=0,uu=e):Pi=0,vr(),null}function Oo(){if(kr!==null){var e=Di(Ps),t=tn.transition,n=ge;try{if(tn.transition=null,ge=16>e?16:e,kr===null)var r=!1;else{if(e=kr,kr=null,Ps=0,(Ce&6)!==0)throw Error(l(331));var o=Ce;for(Ce|=4,Z=e.current;Z!==null;){var i=Z,a=i.child;if((Z.flags&16)!==0){var f=i.deletions;if(f!==null){for(var m=0;m<f.length;m++){var E=f[m];for(Z=E;Z!==null;){var F=Z;switch(F.tag){case 0:case 11:case 15:_i(8,F,i)}var A=F.child;if(A!==null)A.return=F,Z=A;else for(;Z!==null;){F=Z;var M=F.sibling,J=F.return;if(Mc(F),F===E){Z=null;break}if(M!==null){M.return=J,Z=M;break}Z=J}}}var ee=i.alternate;if(ee!==null){var re=ee.child;if(re!==null){ee.child=null;do{var Qe=re.sibling;re.sibling=null,re=Qe}while(re!==null)}}Z=i}}if((i.subtreeFlags&2064)!==0&&a!==null)a.return=i,Z=a;else e:for(;Z!==null;){if(i=Z,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:_i(9,i,i.return)}var S=i.sibling;if(S!==null){S.return=i.return,Z=S;break e}Z=i.return}}var v=e.current;for(Z=v;Z!==null;){a=Z;var k=a.child;if((a.subtreeFlags&2064)!==0&&k!==null)k.return=a,Z=k;else e:for(a=v;Z!==null;){if(f=Z,(f.flags&2048)!==0)try{switch(f.tag){case 0:case 11:case 15:xs(9,f)}}catch(oe){Ke(f,f.return,oe)}if(f===a){Z=null;break e}var z=f.sibling;if(z!==null){z.return=f.return,Z=z;break e}Z=f.return}}if(Ce=o,vr(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(Dn,e)}catch{}r=!0}return r}finally{ge=n,tn.transition=t}}return!1}function qc(e,t,n){t=Mo(n,t),t=fc(e,t,1),e=yr(e,t,1),t=Et(),e!==null&&(kn(e,1,t),Mt(e,t))}function Ke(e,t,n){if(e.tag===3)qc(e,e,n);else for(;t!==null;){if(t.tag===3){qc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Sr===null||!Sr.has(r))){e=Mo(n,e),e=dc(t,e,1),t=yr(t,e,1),e=Et(),t!==null&&(kn(t,1,e),Mt(t,e));break}}t=t.return}}function Vd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Et(),e.pingedLanes|=e.suspendedLanes&n,rt===e&&(lt&n)===n&&(Ze===4||Ze===3&&(lt&130023424)===lt&&500>Le()-su?Gr(e,0):iu|=n),Mt(e,t)}function bc(e,t){t===0&&((e.mode&1)===0?t=1:(t=wn,wn<<=1,(wn&130023424)===0&&(wn=4194304)));var n=Et();e=Kn(e,t),e!==null&&(kn(e,t,n),Mt(e,n))}function Bd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bc(e,n)}function Wd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(l(314))}r!==null&&r.delete(t),bc(e,n)}var Gc;Gc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)jt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return jt=!1,Rd(e,t,n);jt=(e.flags&131072)!==0}else jt=!1,Ie&&(t.flags&1048576)!==0&&Ta(t,is,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ss(e,t),e=t.pendingProps;var o=Eo(t,ht.current);jo(t,n),o=Dl(null,t,r,e,o,n);var i=Il();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tt(r)?(i=!0,ns(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Rl(t),o.updater=ys,t.stateNode=o,o._reactInternals=t,Hl(t,r,e,n),t=bl(null,t,r,!0,i,n)):(t.tag=0,Ie&&i&&Sl(t),xt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ss(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Kd(r),e=cn(r,e),o){case 0:t=ql(null,t,r,e,n);break e;case 1:t=kc(null,t,r,e,n);break e;case 11:t=vc(null,t,r,e,n);break e;case 14:t=gc(null,t,r,cn(r.type,e),n);break e}throw Error(l(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),ql(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),kc(e,t,r,o,n);case 3:e:{if(xc(t),e===null)throw Error(l(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Da(e,t),fs(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Mo(Error(l(423)),t),t=Ec(e,t,r,n,o);break e}else if(r!==o){o=Mo(Error(l(424)),t),t=Ec(e,t,r,n,o);break e}else for(Bt=hr(t.stateNode.containerInfo.firstChild),Vt=t,Ie=!0,an=null,n=Oa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(No(),r===o){t=qn(e,t,n);break e}xt(e,t,r,n)}t=t.child}return t;case 5:return $a(t),e===null&&El(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,pl(r,o)?a=null:i!==null&&pl(r,i)&&(t.flags|=32),Sc(e,t),xt(e,t,a,n),t.child;case 6:return e===null&&El(t),null;case 13:return _c(e,t,n);case 4:return Ml(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Po(t,null,r,n):xt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),vc(e,t,r,o,n);case 7:return xt(e,t,t.pendingProps,n),t.child;case 8:return xt(e,t,t.pendingProps.children,n),t.child;case 12:return xt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Ae(us,r._currentValue),r._currentValue=a,i!==null)if(un(i.value,a)){if(i.children===o.children&&!Pt.current){t=qn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var f=i.dependencies;if(f!==null){a=i.child;for(var m=f.firstContext;m!==null;){if(m.context===r){if(i.tag===1){m=Qn(-1,n&-n),m.tag=2;var E=i.updateQueue;if(E!==null){E=E.shared;var F=E.pending;F===null?m.next=m:(m.next=F.next,F.next=m),E.pending=m}}i.lanes|=n,m=i.alternate,m!==null&&(m.lanes|=n),Tl(i.return,n,t),f.lanes|=n;break}m=m.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(l(341));a.lanes|=n,f=a.alternate,f!==null&&(f.lanes|=n),Tl(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}xt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,jo(t,n),o=Zt(o),r=r(o),t.flags|=1,xt(e,t,r,n),t.child;case 14:return r=t.type,o=cn(r,t.pendingProps),o=cn(r.type,o),gc(e,t,r,o,n);case 15:return yc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),Ss(e,t),t.tag=1,Tt(r)?(e=!0,ns(t)):e=!1,jo(t,n),ac(t,r,o),Hl(t,r,o,n),bl(null,t,r,!0,e,n);case 19:return Nc(e,t,n);case 22:return wc(e,t,n)}throw Error(l(156,t.tag))};function Yc(e,t){return qo(e,t)}function Hd(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.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 nn(e,t,n,r){return new Hd(e,t,n,r)}function pu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kd(e){if(typeof e=="function")return pu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ge)return 11;if(e===Ue)return 14}return 2}function _r(e,t){var n=e.alternate;return n===null?(n=nn(e.tag,t,e.key,e.mode),n.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=e.flags&14680064,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=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ms(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")pu(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ne:return Jr(n.children,o,i,t);case me:a=8,o|=8;break;case ke:return e=nn(12,n,t,o|2),e.elementType=ke,e.lanes=i,e;case et:return e=nn(13,n,t,o),e.elementType=et,e.lanes=i,e;case qe:return e=nn(19,n,t,o),e.elementType=qe,e.lanes=i,e;case Ne:return Fs(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W:a=10;break e;case _e:a=9;break e;case Ge:a=11;break e;case Ue:a=14;break e;case $e:a=16,r=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=nn(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Jr(e,t,n,r){return e=nn(7,e,r,t),e.lanes=n,e}function Fs(e,t,n,r){return e=nn(22,e,r,t),e.elementType=Ne,e.lanes=n,e.stateNode={isHidden:!1},e}function mu(e,t,n){return e=nn(6,e,null,t),e.lanes=n,e}function vu(e,t,n){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qd(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ct(0),this.expirationTimes=ct(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function gu(e,t,n,r,o,i,a,f,m){return e=new Qd(e,t,n,f,m),t===1?(t=1,i===!0&&(t|=8)):t=0,i=nn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rl(i),e}function qd(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Jc(e){if(!e)return mr;e=e._reactInternals;e:{if(zn(e)!==e||e.tag!==1)throw Error(l(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(l(171))}if(e.tag===1){var n=e.type;if(Tt(n))return Ca(e,n,t)}return t}function Xc(e,t,n,r,o,i,a,f,m){return e=gu(n,r,!0,e,o,i,a,f,m),e.context=Jc(null),n=e.current,r=Et(),o=xr(n),i=Qn(r,o),i.callback=t??null,yr(n,i,o),e.current.lanes=o,kn(e,o,r),Mt(e,r),e}function Ls(e,t,n,r){var o=t.current,i=Et(),a=xr(o);return n=Jc(n),t.context===null?t.context=n:t.pendingContext=n,t=Qn(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=yr(o,t,a),e!==null&&(hn(e,o,a,i),cs(e,o,a)),a}function As(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Zc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yu(e,t){Zc(e,t),(e=e.alternate)&&Zc(e,t)}function bd(){return null}var ef=typeof reportError=="function"?reportError:function(e){console.error(e)};function wu(e){this._internalRoot=e}Os.prototype.render=wu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));Ls(e,t,null,null)},Os.prototype.unmount=wu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;br(function(){Ls(null,e,null,null)}),t[Vn]=null}};function Os(e){this._internalRoot=e}Os.prototype.unstable_scheduleHydration=function(e){if(e){var t=Un();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_n.length&&t!==0&&t<_n[n].priority;n++);_n.splice(n,0,e),n===0&&Ui(e)}};function Su(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function tf(){}function Gd(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var E=As(a);i.call(E)}}var a=Xc(t,r,e,0,null,!1,!1,"",tf);return e._reactRootContainer=a,e[Vn]=a.current,fi(e.nodeType===8?e.parentNode:e),br(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var f=r;r=function(){var E=As(m);f.call(E)}}var m=gu(e,0,!1,null,null,!1,!1,"",tf);return e._reactRootContainer=m,e[Vn]=m.current,fi(e.nodeType===8?e.parentNode:e),br(function(){Ls(t,m,n,r)}),m}function Ds(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var f=o;o=function(){var m=As(a);f.call(m)}}Ls(t,a,e,o)}else a=Gd(n,t,e,o,r);return As(a)}Yo=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Lr(t.pendingLanes);n!==0&&(In(t,n|1),Mt(t,Le()),(Ce&6)===0&&(Ao=Le()+500,vr()))}break;case 13:br(function(){var r=Kn(e,1);if(r!==null){var o=Et();hn(r,e,1,o)}}),yu(e,1)}},Jo=function(e){if(e.tag===13){var t=Kn(e,134217728);if(t!==null){var n=Et();hn(t,e,134217728,n)}yu(e,134217728)}},Ii=function(e){if(e.tag===13){var t=xr(e),n=Kn(e,t);if(n!==null){var r=Et();hn(n,e,t,r)}yu(e,t)}},Un=function(){return ge},ao=function(e,t){var n=ge;try{return ge=e,t()}finally{ge=n}},$o=function(e,t,n){switch(t){case"input":if(Pr(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=es(r);if(!o)throw Error(l(90));Nr(r),Pr(r,o)}}}break;case"textarea":Zn(e,n);break;case"select":t=n.value,t!=null&&At(e,!!n.multiple,t,!1)}},An=fu,Rr=br;var Yd={usingClientEntryPoint:!1,Events:[pi,ko,es,Vo,Bo,fu]},Ti={findFiberByHostInstance:$r,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jd={bundleType:Ti.bundleType,version:Ti.version,rendererPackageName:Ti.rendererPackageName,rendererConfig:Ti.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ko(e),e===null?null:e.stateNode},findFiberByHostInstance:Ti.findFiberByHostInstance||bd,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Is=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Is.isDisabled&&Is.supportsFiber)try{Dn=Is.inject(Jd),It=Is}catch{}}return Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yd,Ft.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Su(t))throw Error(l(200));return qd(e,t,null,n)},Ft.createRoot=function(e,t){if(!Su(e))throw Error(l(299));var n=!1,r="",o=ef;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=gu(e,1,!1,null,null,n,!1,r,o),e[Vn]=t.current,fi(e.nodeType===8?e.parentNode:e),new wu(t)},Ft.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=Ko(t),e=e===null?null:e.stateNode,e},Ft.flushSync=function(e){return br(e)},Ft.hydrate=function(e,t,n){if(!zs(t))throw Error(l(200));return Ds(null,e,t,!0,n)},Ft.hydrateRoot=function(e,t,n){if(!Su(e))throw Error(l(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=ef;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Xc(t,null,e,1,n??null,o,!1,i,a),e[Vn]=t.current,fi(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Os(t)},Ft.render=function(e,t,n){if(!zs(t))throw Error(l(200));return Ds(null,e,t,!1,n)},Ft.unmountComponentAtNode=function(e){if(!zs(e))throw Error(l(40));return e._reactRootContainer?(br(function(){Ds(null,null,e,!1,function(){e._reactRootContainer=null,e[Vn]=null})}),!0):!1},Ft.unstable_batchedUpdates=fu,Ft.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!zs(n))throw Error(l(200));if(e==null||e._reactInternals===void 0)throw Error(l(38));return Ds(e,t,n,!1,r)},Ft.version="18.3.1-next-f1338f8080-20240426",Ft}var cf;function lh(){if(cf)return Eu.exports;cf=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(s){console.error(s)}}return u(),Eu.exports=sh(),Eu.exports}var ff;function uh(){if(ff)return Us;ff=1;var u=lh();return Us.createRoot=u.createRoot,Us.hydrateRoot=u.hydrateRoot,Us}var ah=uh(),_=Wu();function df(u){return[...u.toLocaleLowerCase().matchAll(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu)].map(s=>({value:s[0],start:s.index??0}))}function Nu(u,s){if(!s.length||s.length>u.length)return!1;for(let l=0;l<=u.length-s.length;l++)if(s.every((c,d)=>u[l+d]===c))return!0;return!1}function ch(u,s){const l=u.trim(),c=df(l),d=df(s).map(({value:C})=>C),g=c.map(({value:C})=>C);if(g.join(" ")==="it seems like"&&Nu(d,g))return"";if(c.length<5||d.length<5)return l;if(Nu(d,g))return"";for(let C=c.length-1;C>=5;C--)if(Nu(d,g.slice(0,C)))return l.slice(c[C].start).replace(/^[\s,.;:!?—-]+/u,"").trim();return l}class fh{constructor(s,l,c=()=>{},d=()=>{}){te(this,"recordings",[]);te(this,"transcripts",[]);te(this,"hearing",!1);te(this,"pumpingEpoch",null);te(this,"active",null);te(this,"epoch",0);te(this,"transcribe");te(this,"send");te(this,"report");te(this,"changed");this.transcribe=s,this.send=l,this.report=c,this.changed=d}get busy(){return this.pumpingEpoch!==null||this.recordings.length>0||this.transcripts.length>0}speechStarted(){this.hearing=!0,this.changed()}speechEnded(s){this.hearing=!1,this.recordings.push(s),this.changed(),this.pump()}speechDiscarded(){this.hearing=!1,this.changed(),this.pump()}reset(){var s;this.epoch++,(s=this.active)==null||s.abort(),this.active=null,this.recordings=[],this.transcripts=[],this.hearing=!1,this.pumpingEpoch=null,this.changed()}pump(){const s=this.epoch;this.pumpingEpoch!==s&&(this.pumpingEpoch=s,this.changed(),(async()=>{try{for(;this.recordings.length&&s===this.epoch;){const c=this.recordings.shift(),d=new AbortController;this.active=d;try{const g=(await this.transcribe(c,d.signal)).trim();s===this.epoch&&g&&this.transcripts.push(g)}catch(g){if(s===this.epoch&&!d.signal.aborted)throw g}finally{this.active===d&&(this.active=null),s===this.epoch&&this.changed()}}if(s!==this.epoch||this.hearing||this.recordings.length||!this.transcripts.length)return;const l=this.transcripts.join(" ").trim();this.transcripts=[],this.changed(),l&&await this.send(l)}catch(l){s===this.epoch&&this.report(l)}finally{this.pumpingEpoch===s&&(this.pumpingEpoch=null,this.changed(),s===this.epoch&&!this.hearing&&(this.recordings.length||this.transcripts.length)&&this.pump())}})())}}const dh=2e3;class hh{constructor(s=dh){te(this,"tail",Promise.resolve());te(this,"_active",!1);te(this,"_flushing",!1);te(this,"epoch",0);te(this,"timeoutMs");te(this,"invalid",new WeakSet);this.timeoutMs=s}get acceptsCallbacks(){return this._active||this._flushing}pause(s){if(this.invalid.has(s))return Promise.reject(new Error("VAD transition is invalidated."));const l=this.epoch;return this._active=!1,this.enqueue(async()=>{l===this.epoch&&await this.withTimeout(s,s.pause(),"pause")})}start(s){if(this.invalid.has(s))return Promise.reject(new Error("VAD transition is invalidated."));const l=this.epoch;return this.enqueue(async()=>{l===this.epoch&&(await this.withTimeout(s,s.start(),"start"),l===this.epoch&&(this._active=!0))})}flush(s){if(this.invalid.has(s))return Promise.reject(new Error("VAD transition is invalidated."));const l=this.epoch;return this.enqueue(async()=>{if(l===this.epoch){this._flushing=!0;try{await this.withTimeout(s,s.pause(),"pause"),await this.withTimeout(s,s.start(),"start"),l===this.epoch&&(this._active=!0)}finally{l===this.epoch&&(this._flushing=!1)}}})}beginSession(){this.epoch++,this.tail=Promise.resolve(),this._active=!1,this._flushing=!1}deactivate(){this.epoch++,this.tail=Promise.resolve(),this._active=!1,this._flushing=!1}isInvalid(s){return this.invalid.has(s)}enqueue(s){const l=this.tail.then(s,s);return this.tail=l.catch(()=>{}),l}withTimeout(s,l,c){return new Promise((d,g)=>{const x=globalThis.setTimeout(()=>{this.invalidate(s),g(new Error(`VAD ${c} timed out.`))},this.timeoutMs);l.then(()=>{globalThis.clearTimeout(x),d()},C=>{globalThis.clearTimeout(x),g(C)})})}invalidate(s){this.invalid.add(s),this.epoch++,this.tail=Promise.resolve(),this._active=!1,this._flushing=!1}}function ph(u,s,l,c,d,g){return u===s&&l===c&&!d&&g}const mh=10,vh=2;function gh(u){const s=u.trim().replace(/["'“”‘’«»)\]}]+$/u,"").trimEnd();return/[.?!]$/.test(s)?!/(\.\.|…)$/.test(s):!1}function yh(u){return u.split(/\s+/).filter(s=>/[\p{L}\p{N}]/u.test(s)).length}function wh(u){const{text:s,resultRevision:l,revision:c,quietFrames:d}=u;return s===void 0||l!==c||d<mh?!1:gh(s)&&yh(s)>=vh}const Hs=.45,Hu=.3,Rf=160,Mf=320,Io=700,Ff=300,Lf=2e3,Fu=100;function Ku(u){if(!Number.isFinite(u))return Io;const s=Math.round(u/Fu)*Fu;return Math.min(Lf,Math.max(Ff,s))}function Sh(u=Io){return{positiveSpeechThreshold:Hs,negativeSpeechThreshold:Hu,minSpeechMs:Rf,preSpeechPadMs:Mf,redemptionMs:Ku(u)}}const kh=350,xh=20;class Eh{constructor(s,l,c=()=>{}){te(this,"preRoll",[]);te(this,"current",null);te(this,"segments",new Set);te(this,"ended",new WeakMap);te(this,"request");te(this,"preview");te(this,"endpoint");te(this,"speechThreshold",Hs);this.request=s,this.preview=l,this.endpoint=c}frame(s,l){const c=l.slice(),d=this.current;if(!d){this.preRoll.push(c),this.preRoll.length>14&&this.preRoll.shift();return}d.frames.push(c),s>=this.speechThreshold?(d.revision++,d.quiet=0):d.quiet++;const g=d.confirmed&&d.overActiveTurn&&d.requested===-1&&d.confirmedAt!==null&&d.frames.length-d.confirmedAt>=xh;d.confirmed&&!d.pending&&d.requested!==d.revision&&(g||d.quiet>=6||d.frames.length-d.lastRequest>=63)&&this.speculate(d),this.checkEndpoint(d)}begin(s=!1){const l={frames:this.preRoll,revision:1,quiet:0,confirmed:!1,requested:-1,lastRequest:0,controller:new AbortController,endpointed:!1,overActiveTurn:s,confirmedAt:null};this.preRoll=[],this.current=l,this.segments.add(l),this.preview("")}confirm(){this.current&&(this.current.confirmed=!0,this.current.confirmedAt=this.current.frames.length)}end(s){this.current&&this.ended.set(s,this.current),this.current=null,this.preRoll=[]}async finish(s,l){var g;const c=this.ended.get(s);if(this.ended.delete(s),!c)return this.request(s,l);const d=()=>c.controller.abort(l.reason);l.addEventListener("abort",d,{once:!0}),l.aborted&&d();try{const x=c.pending;return x&&!await _h(x,kh,l)&&c.controller.abort(new DOMException("Speculative transcription timed out.","AbortError")),l.throwIfAborted(),((g=c.result)==null?void 0:g.revision)===c.revision&&c.result.text.trim()?c.result.text:await this.request(s,l)}finally{l.removeEventListener("abort",d),this.segments.delete(c)}}discard(){this.current&&(this.current.controller.abort(),this.segments.delete(this.current)),this.current=null,this.preRoll=[],this.preview("")}reset(){for(const s of this.segments)s.controller.abort();this.segments.clear(),this.ended=new WeakMap,this.discard()}samples(s){const l=new Float32Array(s.frames.reduce((d,g)=>d+g.length,0));let c=0;for(const d of s.frames)l.set(d,c),c+=d.length;return l}checkEndpoint(s){var l,c;s.endpointed||this.current!==s||!s.confirmed||wh({text:(l=s.result)==null?void 0:l.text,resultRevision:(c=s.result)==null?void 0:c.revision,revision:s.revision,quietFrames:s.quiet})&&(s.endpointed=!0,this.endpoint())}speculate(s){const l=s.revision;s.requested=l,s.lastRequest=s.frames.length,s.pending=this.request(this.samples(s),s.controller.signal).then(c=>{s.controller.signal.aborted||(s.result={revision:l,text:c},this.current===s&&(this.preview(c),this.checkEndpoint(s)))}).catch(()=>{}).finally(()=>{s.pending=void 0})}}function _h(u,s,l){return new Promise((c,d)=>{if(l.aborted)return d(l.reason);const g=globalThis.setTimeout(L,s),x=()=>{R(),d(l.reason)},C=()=>{R(),c(!0)};function L(){R(),c(!1)}function R(){globalThis.clearTimeout(g),l.removeEventListener("abort",x)}l.addEventListener("abort",x,{once:!0}),u.then(C,C)})}const Lu=new Set(["um","uh","uhm","erm","hmm","mm","mhm","ah","oh"]),hf=2,Ch=1200,Nh=700;function Au(u){return[...u.toLocaleLowerCase().matchAll(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu)].map(s=>s[0])}function Ph(u){return Au(u).filter(s=>!Lu.has(s))}function Th(u,s,l,c){let d=0;for(let g=0;g<u.length;g++)if(u[g]!==s[l+g]&&(d++,d>c))return!1;return!0}function jh(u,s){let l=null;for(let c=0;c<u.length;c++)for(let d=u.length;d>c;d--){const g=d-c;if(l&&g<=l.end-l.start)break;if(g<2||g>s.length)continue;const x=Math.floor(g/4),C=u.slice(c,d);let L=!1;for(let R=0;R<=s.length-g;R++)if(Th(C,s,R,x)){L=!0;break}if(L){l={start:c,end:d};break}}return l}function Rh(u,s){const l=Au(u);if(l.filter(g=>!Lu.has(g)).length<hf)return{echo:!1,meaningful:!1};const d=Au(s);if(d.length){const g=jh(l,d);if(g&&l.filter((C,L)=>(L<g.start||L>=g.end)&&!Lu.has(C)).length<hf)return{echo:!0,meaningful:!1}}return{echo:!1,meaningful:!0}}function Ou(u,s){return Rh(u,s).meaningful}const Mh=["stop","wait","hold on","hang on","pause","shut up","enough"],Fh=Mh.map(u=>new RegExp(`\\b${u.replace(/ /g,"\\s+")}\\b`,"iu"));function Af(u,s){for(const l of Fh){if(!l.test(u)||l.test(s))continue;const c=new RegExp(l.source,`${l.flags}g`),d=u.replace(c," ").replace(/\s+/gu," ").trim().replace(/^[\s,.;:!?—-]+/u,"");return{remainder:Ph(d).length?d:""}}return null}function pf(u,s){return Af(u,s)!==null}function Of(u){return Math.max(.2,u.trim().length/15)}const Lh=1500,Ah=300,Oh=1e4;function mf(u,s,l){const c=u.filter(d=>l-(d.startedAt+d.seconds*1e3)<Oh);return c.push({text:s,startedAt:l,seconds:Of(s)}),c}function zh(u,s,l){const c=s-Lh,d=l+Ah;return u.filter(g=>g.startedAt+g.seconds*1e3>=c&&g.startedAt<=d).map(g=>g.text).join(" ")}const Dh=8,Ih=2.5;function Uh(u,s){return s===null?!1:u<s*Ih}class $h{constructor(s=()=>Date.now()){te(this,"mode","idle");te(this,"interruptOnConfirm",!1);te(this,"interrupted",!1);te(this,"startedAt",0);te(this,"wordPathBlockedFlag",!1);te(this,"now");this.now=s}get idle(){return this.mode==="idle"}get wordPathBlocked(){return this.wordPathBlockedFlag}blockWordPath(){(this.mode==="candidate"||this.mode==="accepted")&&(this.wordPathBlockedFlag=!0)}speechStart(s){return this.mode="candidate",this.interruptOnConfirm=s,this.interrupted=!1,this.wordPathBlockedFlag=!1,this.startedAt=this.now(),{duck:s,begin:!0,accepted:!1}}speechRealStart(){return this.mode==="candidate"?(this.mode="accepted",{keepDucked:this.interruptOnConfirm,begin:!1,accepted:!0}):{keepDucked:!1,begin:!1,accepted:this.mode==="accepted"}}shouldInterruptNow(s,l){return this.mode!=="accepted"||!this.interruptOnConfirm||this.interrupted?!1:pf(s,l)?(this.interrupted=!0,!0):this.wordPathBlockedFlag?!1:Ou(s,l)?(this.interrupted=!0,!0):!1}speechEnd(s,l,c){const d=this.mode==="accepted",g=this.wordPathBlockedFlag;return d?!this.interruptOnConfirm||this.interrupted?(this.reset(),{accepted:!0,interrupt:!1,send:!0,deferDecision:!1,wordPathBlocked:g}):c?pf(s,l)||!g&&Ou(s,l)?(this.reset(),{accepted:!0,interrupt:!0,send:!0,deferDecision:!1,wordPathBlocked:g}):(this.reset(),{accepted:!0,interrupt:!1,send:!1,deferDecision:!1,wordPathBlocked:g}):(this.reset(),{accepted:!0,interrupt:!1,send:!0,deferDecision:!0,wordPathBlocked:g}):(this.reset(),{accepted:!1,interrupt:!1,send:!1,deferDecision:!1,wordPathBlocked:g})}reset(){this.mode="idle",this.interruptOnConfirm=!1,this.interrupted=!1,this.wordPathBlockedFlag=!1,this.startedAt=0}}function Pu(u,s,l,c){return async d=>{d.throwIfAborted();const g=s.createAnalyser();g.fftSize=128,g.connect(l);const x=s.createGain();x.connect(g);const C=s.createBufferSource();C.buffer=u,C.connect(x),await new Promise((L,R)=>{const H=()=>{C.disconnect(),x.disconnect(),g.disconnect()},D=()=>{C.onended=null;const O=s.currentTime;x.gain.cancelScheduledValues(O),x.gain.setValueAtTime(x.gain.value,O),x.gain.linearRampToValueAtTime(0,O+Zr);try{C.stop(O+Zr)}catch{}setTimeout(H,Zr*1e3+20),R(d.reason)};C.onended=()=>{d.removeEventListener("abort",D),H(),L()},d.addEventListener("abort",D,{once:!0}),C.start(),c(g),d.aborted&&D()})}}const Vh=.1,Bh=.02,Wh=.5,Hh=.3,Zr=.005;function Kh(){return{nextTime:0,started:!1,underrunLead:Bh,restarted:!1}}function Qh(u,s,l){let c,d;return u.started?u.nextTime<s?(c=s+u.underrunLead,u.underrunLead=Math.min(Wh,u.underrunLead*2),d=!0):(c=u.nextTime,d=!1):(c=s+Vh,d=!0),u.started=!0,u.restarted=d,u.nextTime=c+l,c}function qh(u,s){return u.reduce((l,c)=>l+c.length,0)/s}function bh(u,s){return u>=Hh}function Gh(u,s,l,c){return u.started&&!c&&u.nextTime<s&&l<u.underrunLead}async function Yh(u,s,l,c,d,g){const x=u.getReader(),C=[];let L=null,R=!1,H=0,D=null;const O=()=>{const I=D;D=null,I==null||I()},$=()=>{x.cancel().catch(()=>{})};g.addEventListener("abort",$,{once:!0});const X=I=>{let K=I;L!==null&&(K=new Uint8Array(I.length+1),K[0]=L,K.set(I,1),L=null),K.length%2&&(L=K[K.length-1],K=K.subarray(0,K.length-1));const U=new DataView(K.buffer,K.byteOffset,K.byteLength),ne=new Float32Array(K.length/2);for(let me=0;me<ne.length;me++){const ke=U.getInt16(me*2,!0);ne[me]=ke<0?ke/32768:ke/32767}return ne};let se,N;const Y=new Promise((I,K)=>{se=I,N=K}),b=(async()=>{try{for(;;){const{done:I,value:K}=await x.read();if(I)break;if(!(K!=null&&K.length))continue;const U=X(K);U.length&&(H+=U.length,C.push(U),bh(H/s,!1)&&se(),O())}if(!H)throw new Error("The speech server sent no audio");return H/s}finally{R=!0,g.removeEventListener("abort",$),O()}})();b.catch(I=>N(I)),b.then(()=>se(),()=>{}),await Y;const ye=(async I=>{I.throwIfAborted();const K=l.createAnalyser();K.fftSize=128,K.connect(c);const U=l.createGain();U.connect(K);const ne=new Set,me=Kh();let ke=!1;try{await new Promise((W,_e)=>{const Ge=()=>{R&&!C.length&&!ne.size&&W()},et=()=>{if(I.aborted)return;const Ue=l.currentTime,$e=qh(C,s);if(C.length&&!Gh(me,Ue,$e,R)){const Ne=C.reduce((ie,ue)=>ie+ue.length,0),V=l.createBuffer(1,Ne,s),le=V.getChannelData(0);let B=0;for(const ie of C.splice(0))le.set(ie,B),B+=ie.length;const y=l.createBufferSource();y.buffer=V,y.connect(U);const j=Qh(me,Ue,V.duration);me.restarted&&(U.gain.cancelScheduledValues(j),U.gain.setValueAtTime(0,j),U.gain.linearRampToValueAtTime(1,j+Zr)),y.start(j),ne.add(y),y.onended=()=>{ne.delete(y),y.disconnect(),Ge()},ke||(ke=!0,d(K))}Ge(),(!R||C.length)&&(D=et)},qe=()=>{D=null;const Ue=l.currentTime;U.gain.cancelScheduledValues(Ue),U.gain.setValueAtTime(U.gain.value,Ue),U.gain.linearRampToValueAtTime(0,Ue+Zr);for(const $e of ne){$e.onended=null;try{$e.stop(Ue+Zr)}catch{}}ne.clear(),$(),_e(I.reason)};I.addEventListener("abort",qe,{once:!0}),et()}),U.disconnect(),K.disconnect()}catch(W){throw setTimeout(()=>{try{U.disconnect()}catch{}try{K.disconnect()}catch{}},Zr*1e3+20),W}});return ye.completed=b,ye}const Jh=300;class Xh{constructor(s,l,c){te(this,"run",this.fresh());te(this,"synthesize");te(this,"changed");te(this,"reportError");this.synthesize=s,this.changed=l,this.reportError=c}get busy(){const s=this.run;return s.held||s.generating||s.playing!==null||s.text.length>0||s.audio.length>0}enqueue(s){this.run.text.push(...s),this.pump(this.run)}hold(){const s=this.run;if(s.held||!(s.playing!==null||s.generating||s.audio.length>0))return!1;const c=s.audio.map(d=>d.text);return s.audio=[],s.text=[...c,...s.text],s.playing=null,s.generating=!1,s.held=!0,s.controller.abort(),s.controller=new AbortController,this.changed(),!0}resume(s){const l=this.run;l.held&&(l.held=!1,s.trim()&&l.text.unshift(s),this.pump(l))}cancel(){const s=this.run;this.run=this.fresh(),s.text=[],s.audio=[],s.controller.abort(),this.changed()}fresh(){return{controller:new AbortController,text:[],audio:[],hasDispatchedSpeech:!1,generating:!1,playing:null,held:!1}}fail(s,l){s!==this.run||s.controller.signal.aborted||s.held||(this.cancel(),this.reportError(l))}pump(s){if(s!==this.run||s.controller.signal.aborted)return;if(s.held){this.changed();return}const l=s.controller.signal;if(!s.playing&&s.audio.length){const c=s.audio.shift();s.playing=c.text,(async()=>{try{await c.prepared(l)}catch(d){this.fail(s,d)}finally{s.playing=null,s===this.run&&this.pump(s)}})()}if(!s.generating&&s.audio.length<2&&s.text.length){let c=s.text.shift();if(s.hasDispatchedSpeech)for(;s.text.length&&c.length+s.text[0].length+1<=Jh;)c+=` ${s.text.shift()}`;s.hasDispatchedSpeech=!0,s.generating=!0,(async()=>{var d;try{const g=await this.synthesize(c,l);s===this.run&&!l.aborted&&s.audio.push({text:c,prepared:g}),(d=g.completed)==null||d.catch(x=>this.fail(s,x))}catch(g){this.fail(s,g)}finally{s.generating=!1,s===this.run&&this.pump(s)}})()}this.changed()}}const Zh=/[.!?]\s+/g;function ep(u){const s=[0];for(const l of u.matchAll(Zh)){const c=l.index+l[0].length;c<u.length&&s.push(c)}return s}const tp=.98;function np(u,s){const l=u.trim();if(!l||!Number.isFinite(s)||s>=tp)return"";const c=Math.max(0,Math.min(1,s)),d=Math.round(c*l.length),g=ep(l);let x=g[0];for(const C of g)if(C<=d)x=C;else break;return l.slice(x).trim()}const rp=1500,op=400;async function ip(u,s,l,c=fetch){if(!s.trim())return"";const d=new AbortController,g=setTimeout(()=>d.abort(),rp);try{const x=await c("/api/voice/bridge",{method:"POST",headers:{"Content-Type":"application/json",...l},body:JSON.stringify({said:u.slice(-op),resume:s}),signal:d.signal});if(!x.ok)return"";const C=await x.json().catch(()=>({}));return typeof(C==null?void 0:C.bridge)=="string"?C.bridge:""}catch{return""}finally{clearTimeout(g)}}function sp(u,s){const l=u.trim();return l?`${l} ${s}`:s}const lp="modulepreload",up=function(u){return"/"+u},vf={},zf=function(s,l,c){let d=Promise.resolve();if(l&&l.length>0){let x=function(R){return Promise.all(R.map(H=>Promise.resolve(H).then(D=>({status:"fulfilled",value:D}),D=>({status:"rejected",reason:D}))))};document.getElementsByTagName("link");const C=document.querySelector("meta[property=csp-nonce]"),L=(C==null?void 0:C.nonce)||(C==null?void 0:C.getAttribute("nonce"));d=x(l.map(R=>{if(R=up(R),R in vf)return;vf[R]=!0;const H=R.endsWith(".css"),D=H?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${R}"]${D}`))return;const O=document.createElement("link");if(O.rel=H?"stylesheet":lp,H||(O.as="script"),O.crossOrigin="",O.href=R,L&&O.setAttribute("nonce",L),document.head.appendChild(O),H)return new Promise(($,X)=>{O.addEventListener("load",$),O.addEventListener("error",()=>X(new Error(`Unable to preload CSS for ${R}`)))})}))}function g(x){const C=new Event("vite:preloadError",{cancelable:!0});if(C.payload=x,window.dispatchEvent(C),!C.defaultPrevented)throw x}return d.then(x=>{for(const C of x||[])C.status==="rejected"&&g(C.reason);return s().catch(g)})},zu="/voice-assets/",ap=["silero_vad_v5.onnx","vad.worklet.bundle.min.js","ort-wasm-simd-threaded.mjs","ort-wasm-simd-threaded.wasm"];let Tu=null;function Df(){return Tu??(Tu=zf(()=>import("./index-CeWj4ejR.js").then(u=>u.i),__vite__mapDeps([0,1])).catch(u=>{throw Tu=null,u})),Tu}let gf=!1;function cp(){if(!gf){gf=!0,Df().catch(()=>{});for(const u of ap)fetch(`${zu}${u}`,{priority:"low"}).then(s=>s.ok?s.arrayBuffer():void 0).catch(()=>{})}}const If="voice-assistant.vad-redemption-ms";function Uf(u){return typeof window>"u"?void 0:window.localStorage}function ju(u){var s;try{const l=(s=Uf(u))==null?void 0:s.getItem(If);if(l==null)return Io;const c=Number(l);return Number.isFinite(c)?Ku(c):Io}catch{return Io}}function fp(u,s){var c;const l=Ku(u);try{(c=Uf(s))==null||c.setItem(If,String(l))}catch{}return l}const Du=512,Iu=16e3,dp=2e4,hp={frameSamples:Du,sampleRate:Iu,positiveSpeechThreshold:Hs,negativeSpeechThreshold:Hu,minSpeechMs:Rf,redemptionMs:Io,preSpeechPadMs:Mf,maxSpeechMs:dp,noiseFloorWindowFrames:100,noiseFloorPercentile:.3,noiseFloorMarginDb:6,noiseFloorRangeDb:24,minFloorRms:.0015,submitUserSpeechOnPause:!1};function pp(u){let s=0;for(let l=0;l<u.length;l++)s+=u[l]*u[l];return Math.sqrt(s/Math.max(1,u.length))}function yf(u){return 20*Math.log10(Math.max(u,1e-8))}function mp(u){return Math.min(1,Math.max(0,u))}function vp(u){const s=u.reduce((d,g)=>d+g.length,0),l=new Float32Array(s);let c=0;for(const d of u)l.set(d,c),c+=d.length;return l}class gp{constructor(s={}){te(this,"options");te(this,"msPerFrame");te(this,"minSpeechFrames",1);te(this,"redemptionFrames",1);te(this,"preSpeechPadFrames",0);te(this,"maxSpeechFrames",1);te(this,"state","silence");te(this,"ring",[]);te(this,"recorded",[]);te(this,"activeFrames",0);te(this,"silenceFrames",0);te(this,"noiseFloorSamples",[]);te(this,"active",!0);this.options={...hp,...s},this.msPerFrame=this.options.frameSamples/this.options.sampleRate*1e3,this.recalculateFrameCounts()}recalculateFrameCounts(){this.minSpeechFrames=Math.max(1,Math.ceil(this.options.minSpeechMs/this.msPerFrame)),this.redemptionFrames=Math.max(1,Math.ceil(this.options.redemptionMs/this.msPerFrame)),this.preSpeechPadFrames=Math.max(0,Math.ceil(this.options.preSpeechPadMs/this.msPerFrame)),this.maxSpeechFrames=Math.max(this.minSpeechFrames,Math.ceil(this.options.maxSpeechMs/this.msPerFrame))}setOptions(s){this.options={...this.options,...s},this.recalculateFrameCounts()}get noiseFloor(){return this.estimateNoiseFloor()}get speaking(){return this.state==="speech"}reset(){this.state="silence",this.ring=[],this.recorded=[],this.activeFrames=0,this.silenceFrames=0}resume(){this.active=!0}pause(){return this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment():(this.reset(),[])}endSegment(){const s=[];return this.state==="speech"?s.push({type:"speech-end",samples:vp(this.recorded)}):this.state==="maybe"&&s.push({type:"misfire"}),this.reset(),s}process(s){if(!this.active)return{probability:0,events:[]};const l=pp(s);this.state==="silence"&&this.pushNoiseFloorSample(l);const c=this.estimateNoiseFloor(),d=mp((yf(l)-yf(c)-this.options.noiseFloorMarginDb)/this.options.noiseFloorRangeDb),g=[];if(this.state==="silence")return this.pushRing(s),d>=this.options.positiveSpeechThreshold&&(this.state="maybe",this.recorded=[...this.ring],this.activeFrames=1,this.silenceFrames=0,g.push({type:"speech-start"})),{probability:d,events:g};this.recorded.push(s),d>=this.options.negativeSpeechThreshold?(this.silenceFrames=0,this.activeFrames++,this.state==="maybe"&&this.activeFrames>=this.minSpeechFrames&&(this.state="speech",g.push({type:"speech-real-start"}))):this.silenceFrames++;const C=this.recorded.length>=this.maxSpeechFrames,L=this.silenceFrames>=this.redemptionFrames;return(C||L)&&g.push(...this.endSegment()),{probability:d,events:g}}pushRing(s){this.ring.push(s),this.ring.length>this.preSpeechPadFrames&&this.ring.shift()}pushNoiseFloorSample(s){this.noiseFloorSamples.push(s),this.noiseFloorSamples.length>this.options.noiseFloorWindowFrames&&this.noiseFloorSamples.shift()}estimateNoiseFloor(){if(this.noiseFloorSamples.length===0)return this.options.minFloorRms;const s=[...this.noiseFloorSamples].sort((c,d)=>c-d),l=Math.min(s.length-1,Math.floor(s.length*this.options.noiseFloorPercentile));return Math.max(this.options.minFloorRms,s[l])}}class yp{constructor(s,l,c){te(this,"inputBuffer",[]);this.nativeSampleRate=s,this.targetSampleRate=l,this.targetFrameSize=c}process(s){const l=[];for(const c of s)for(this.inputBuffer.push(c);this.hasEnoughDataForFrame();)l.push(this.generateOutputFrame());return l}hasEnoughDataForFrame(){return this.inputBuffer.length*this.targetSampleRate/this.nativeSampleRate>=this.targetFrameSize}generateOutputFrame(){const s=new Float32Array(this.targetFrameSize);let l=0,c=0;for(;l<this.targetFrameSize;){let d=0,g=0;const x=Math.min(this.inputBuffer.length,(l+1)*this.nativeSampleRate/this.targetSampleRate);for(;c<x;){const C=this.inputBuffer[c];C!==void 0&&(d+=C,g++),c++}s[l]=g>0?d/g:0,l++}return this.inputBuffer=this.inputBuffer.slice(c),s}}const wp=`
42
- class EnergyVadWorkletProcessor extends AudioWorkletProcessor {
43
- constructor(options) {
44
- super();
45
- this.targetSampleRate = options.processorOptions.targetSampleRate;
46
- this.targetFrameSize = options.processorOptions.targetFrameSize;
47
- this.inputBuffer = [];
48
- }
49
- process(inputs) {
50
- const channel = inputs[0] && inputs[0][0];
51
- if (!channel) return true;
52
- for (let i = 0; i < channel.length; i++) {
53
- this.inputBuffer.push(channel[i]);
54
- while ((this.inputBuffer.length * this.targetSampleRate) / sampleRate >= this.targetFrameSize) {
55
- const frame = new Float32Array(this.targetFrameSize);
56
- let outputIndex = 0;
57
- let inputIndex = 0;
58
- while (outputIndex < this.targetFrameSize) {
59
- let sum = 0;
60
- let count = 0;
61
- const limit = Math.min(this.inputBuffer.length, ((outputIndex + 1) * sampleRate) / this.targetSampleRate);
62
- while (inputIndex < limit) {
63
- const value = this.inputBuffer[inputIndex];
64
- if (value !== undefined) { sum += value; count++; }
65
- inputIndex++;
66
- }
67
- frame[outputIndex] = count > 0 ? sum / count : 0;
68
- outputIndex++;
69
- }
70
- this.inputBuffer = this.inputBuffer.slice(inputIndex);
71
- this.port.postMessage(frame);
72
- }
73
- }
74
- return true;
75
- }
76
- }
77
- registerProcessor("energy-vad-worklet-processor", EnergyVadWorkletProcessor);
78
- `;class Qu{constructor(s){te(this,"options");te(this,"processor");te(this,"initState","uninitialized");te(this,"stream",null);te(this,"sourceNode",null);te(this,"workletNode",null);te(this,"scriptNode",null);te(this,"workletModuleUrl",null);te(this,"listening",!1);te(this,"handleFrame",s=>{const l=this.processor.process(s);this.options.onFrameProcessed({isSpeech:l.probability,notSpeech:1-l.probability},s);for(const c of l.events)this.dispatch(c)});te(this,"start",async()=>{switch(this.initState){case"uninitialized":{this.initState="initializing",this.processor.resume();try{this.stream=await this.options.getStream(),await this.attachAudioGraph(),this.listening=!0,this.initState="initialized"}catch(s){throw this.initState="errored",s}return}case"initialized":{if(this.listening)return;this.processor.resume(),this.stream=this.options.resumeStream?await this.options.resumeStream(this.stream):this.stream,await this.attachAudioGraph(),this.listening=!0;return}default:return}});te(this,"pause",async()=>{if(!this.listening)return;this.listening=!1;const s=this.processor.pause();for(const l of s)this.dispatch(l);this.stream&&this.options.pauseStream&&await this.options.pauseStream(this.stream),this.detachAudioGraph()});te(this,"destroy",async()=>{this.initState!=="destroyed"&&(this.listening&&await this.pause(),this.initState="destroyed",this.workletModuleUrl&&(URL.revokeObjectURL(this.workletModuleUrl),this.workletModuleUrl=null))});te(this,"setOptions",s=>{this.processor.setOptions(s)});this.options=s,this.processor=new gp({positiveSpeechThreshold:s.positiveSpeechThreshold,negativeSpeechThreshold:s.negativeSpeechThreshold,minSpeechMs:s.minSpeechMs,preSpeechPadMs:s.preSpeechPadMs,redemptionMs:s.redemptionMs,maxSpeechMs:s.maxSpeechMs,submitUserSpeechOnPause:s.submitUserSpeechOnPause??!1})}static async new(s){return new Qu(s)}dispatch(s){switch(s.type){case"speech-start":this.options.onSpeechStart();return;case"speech-real-start":this.options.onSpeechRealStart();return;case"misfire":this.options.onVADMisfire();return;case"speech-end":this.options.onSpeechEnd(s.samples);return}}async attachAudioGraph(){const s=this.options.audioContext,l=this.stream;if(!l)throw new Error("Energy VAD has no active microphone stream.");if(this.sourceNode=new MediaStreamAudioSourceNode(s,{mediaStream:l}),this.canUseAudioWorklet(s))try{await this.attachAsWorklet(s),this.sourceNode.connect(this.workletNode);return}catch{this.workletNode=null}this.attachAsScriptProcessor(s),this.sourceNode.connect(this.scriptNode)}canUseAudioWorklet(s){return"audioWorklet"in s&&typeof AudioWorkletNode=="function"}async attachAsWorklet(s){if(!this.workletModuleUrl){const l=new Blob([wp],{type:"application/javascript"});this.workletModuleUrl=URL.createObjectURL(l)}await s.audioWorklet.addModule(this.workletModuleUrl),this.workletNode=new AudioWorkletNode(s,"energy-vad-worklet-processor",{numberOfInputs:1,numberOfOutputs:0,channelCount:1,processorOptions:{targetSampleRate:Iu,targetFrameSize:Du}}),this.workletNode.port.onmessage=l=>{this.handleFrame(l.data)}}attachAsScriptProcessor(s){const l=new yp(s.sampleRate,Iu,Du),d=s.createScriptProcessor(4096,1,1);let g=!1;d.onaudioprocess=x=>{if(!g){g=!0;try{const C=x.inputBuffer.getChannelData(0);x.outputBuffer.getChannelData(0).fill(0);for(const R of l.process(C))this.handleFrame(R)}finally{g=!1}}},d.connect(s.destination),this.scriptNode=d}detachAudioGraph(){var s;(s=this.sourceNode)==null||s.disconnect(),this.sourceNode=null,this.workletNode&&(this.workletNode.port.onmessage=null,this.workletNode.disconnect(),this.workletNode=null),this.scriptNode&&(this.scriptNode.onaudioprocess=null,this.scriptNode.disconnect(),this.scriptNode=null)}}const Bs=["One moment.","Checking now.","Still on it.","Just a second.","Working on it."],Sp=1500,kp=6e3,xp=4e3,Ep=500;function _p(){return{turnActive:!1,hasSpokenThisTurn:!1,lastCueAt:null,lastCueText:null}}function Cp(u){return{turnActive:!0,hasSpokenThisTurn:!1,lastCueAt:null,lastCueText:null}}function wf(u){return{...u,turnActive:!1}}function Np(u){return u.hasSpokenThisTurn?u:{...u,hasSpokenThisTurn:!0}}function Pp(u,s,l){return{...u,lastCueAt:l,lastCueText:s}}function Tp(u,s,l){return!(!u.turnActive||!u.hasSpokenThisTurn||s<Sp||u.lastCueAt!==null&&l-u.lastCueAt<kp)}function jp(u,s=Math.random){const l=u.lastCueText?Bs.filter(d=>d!==u.lastCueText):Bs,c=l.length?l:Bs;return c[Math.min(c.length-1,Math.floor(s()*c.length))]}function $f(u){return u.replace(/```[\s\S]*?(?:```|$)/g," Code is shown on screen. ").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/<[^>]*>/g,"").replace(/[*_`#>|]/g,"").replace(/\s+/g," ").trim()}function Rp(u,s){let l=!1,c=!1,d=0,g=!1;for(let x=0;x<u.length;x++){if(u.startsWith("```",x)){l=!l,x+=2;continue}if(l)continue;if(u[x]==="`"){c=!c;continue}if(c)continue;if(u[x]==="["&&d++,u[x]==="]"&&(d=Math.max(0,d-1),u[x+1]==="("&&(g=!0)),g){u[x]===")"&&(g=!1);continue}if(d)continue;const L=(/[.!?。!?]/.test(u[x])||s&&/[,;:,;:]/.test(u[x]))&&(/[。!?,;:]/.test(u[x])||/\s/.test(u[x+1]||"")),R=u[x]==="."&&/(?:\b(?:Mr|Mrs|Ms|Dr|Prof|St|vs|etc)|\b[A-Za-z])\.$/i.test(u.slice(0,x+1)),H=s?48:160;if(L&&!R||u[x]===`
79
- `||u[x]==="—"||x>=H&&/\s/.test(u[x]))return x+1}return 0}function Mp(u,s,l){var d;let c=0;for(;c<u.length;){const g=Rp(u.slice(c),l)||(s?u.length-c:0);if(!g)return 0;c+=g;const x=((d=$f(u.slice(0,c).replace(/—/g," ")).match(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu))==null?void 0:d.length)??0,C=/[.!?。!?]["'”’)\]]*\s*$/.test(u.slice(0,c));if(x>(l&&C?1:3)||s&&c===u.length)return c}return 0}function Ru(u,s=!1,l=!1){const c=[];let d=0,g=l;for(;d<u.length;){const x=Mp(u.slice(d),s,g);if(!x)break;const C=$f(u.slice(d,d+x).replace(/—$/,"").replace(/—/g,", "));C&&(c.push(C),g=!1),d+=x}return{chunks:c,rest:s?"":u.slice(d)}}function $s(u,s,l){return u||s||l}function Fp(u){const s=new ArrayBuffer(44+u.length*2),l=new DataView(s),c=(d,g)=>[...g].forEach((x,C)=>l.setUint8(d+C,x.charCodeAt(0)));return c(0,"RIFF"),l.setUint32(4,36+u.length*2,!0),c(8,"WAVEfmt "),l.setUint32(16,16,!0),l.setUint16(20,1,!0),l.setUint16(22,1,!0),l.setUint32(24,16e3,!0),l.setUint32(28,32e3,!0),l.setUint16(32,2,!0),l.setUint16(34,16,!0),c(36,"data"),l.setUint32(40,u.length*2,!0),u.forEach((d,g)=>l.setInt16(44+g*2,Math.max(-1,Math.min(1,d))*(d<0?32768:32767),!0)),new Blob([s],{type:"audio/wav"})}function Uu(){const u=globalThis.crypto;if(u&&typeof u.randomUUID=="function")return u.randomUUID();const s=new Uint8Array(16);if(u)u.getRandomValues(s);else for(let l=0;l<s.length;l+=1)s[l]=Math.floor(Math.random()*256);return Array.from(s,l=>l.toString(16).padStart(2,"0")).join("")}const Vf="meldivo.token",Lp="meldivo.token";let zo;function Ap(){try{window.localStorage.removeItem(Lp)}catch{}const s=new URLSearchParams(window.location.hash.replace(/^#/,"")).get("token");if(s){try{window.sessionStorage.setItem(Vf,s)}catch{}zo=s;try{window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}`)}catch{}}}function Op(){if(zo!==void 0)return zo;try{zo=window.sessionStorage.getItem(Vf)}catch{zo=null}return zo}function Fe(){const u=Op();return u?{"X-Meldivo-Token":u}:{}}class pn extends Error{constructor(){super("Unauthorized"),this.name="UnauthorizedError"}}function mn(u){if(u.status===401)throw new pn;return u}const zp="voice-assistant-microphone",$u="voice-assistant-microphone-owner",Dp=15e3,Ip=5e3,Up=5e3;function Vs(){try{const u=window.localStorage.getItem($u);if(!u)return null;const s=JSON.parse(u);return typeof s.id!="string"||typeof s.expiresAt!="number"?null:{id:s.id,expiresAt:s.expiresAt}}catch{return null}}function $p(){var x;const u=Uu(),s=Date.now(),l=Vs();if(l&&l.expiresAt>s)return null;const c=()=>window.localStorage.setItem($u,JSON.stringify({id:u,expiresAt:Date.now()+Dp}));try{if(c(),((x=Vs())==null?void 0:x.id)!==u)return null}catch{return{release:()=>{}}}let d=!1;const g=window.setInterval(()=>{var C;d||((C=Vs())==null?void 0:C.id)!==u||c()},Ip);return{release:()=>{var C;if(!d){d=!0,window.clearInterval(g);try{((C=Vs())==null?void 0:C.id)===u&&window.localStorage.removeItem($u)}catch{}}}}}async function Vp(){let u,s,l;const c=new Promise((g,x)=>{s=g,l=x}),d=new Promise(g=>{u=g});return navigator.locks.request(zp,{mode:"exclusive",ifAvailable:!0},async g=>{if(!g){s(null);return}let x=!1;s({release:()=>{x||(x=!0,u())}}),await d}).catch(l),c}async function Bp(u){const s=await fetch("/api/voice/lease",{method:"POST",headers:Fe()});if(s.status===409)return null;if(!s.ok)throw new Error("Could not reserve the voice session.");const l=await s.json();if(typeof l.token!="string"||l.token.length<16)throw new Error("Voice session returned an invalid lease.");let c=!1;const d=()=>{c||(c=!0,window.clearInterval(g),fetch("/api/voice/lease",{method:"DELETE",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({token:l.token}),keepalive:!0}).catch(()=>{}))},g=window.setInterval(()=>{fetch("/api/voice/lease/heartbeat",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({token:l.token})}).then(x=>{x.status===409&&(d(),u())}).catch(()=>{})},Up);return{release:d}}async function Wp(u=()=>{}){const s=typeof navigator<"u"&&navigator.locks?await Vp():typeof window>"u"?null:$p();if(!s)return null;try{const l=await Bp(u);return l?{release:()=>{l.release(),s.release()}}:(s.release(),null)}catch(l){throw s.release(),l}}const qu="voice-assistant.selected-voice";function Bf(u){return typeof u=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(u)}function bu(u){return typeof window>"u"?void 0:window.localStorage}function Xr(u){var s;try{const l=(s=bu(u))==null?void 0:s.getItem(qu);return Bf(l)?l:void 0}catch{return}}function Hp(u,s){var l;if(!Bf(u))return!1;try{return(l=bu(s))==null||l.setItem(qu,u),!0}catch{return!1}}function Sf(u){var s;try{(s=bu(u))==null||s.removeItem(qu)}catch{}}function Wf(){return h.jsx("main",{className:"auth-screen",children:h.jsxs("p",{children:["Open the link printed by ",h.jsx("code",{children:"meldivo open"}),"."]})})}const Kp=3,kf=420,xf=140;function Qp(){const[u,s]=_.useState([]),l=_.useRef(0),c=_.useRef(new Set);_.useEffect(()=>()=>{for(const C of c.current)window.clearTimeout(C);c.current.clear()},[]);const d=_.useCallback((C,L)=>{const R=window.setTimeout(()=>{c.current.delete(R),s(H=>H.filter(D=>!C.includes(D.id)))},L);c.current.add(R)},[]),g=_.useCallback(C=>{const R={id:++l.current,name:C.name,summary:C.summary??`Using ${C.name}`,detail:C.detail,folder:C.folder,leaving:!1,delay:0};s(H=>{const D=H.filter($=>!$.leaving),O=new Set(D.slice(0,Math.max(0,D.length+1-Kp)).map($=>$.id));return O.size&&d([...O],kf),[...H.map($=>O.has($.id)?{...$,leaving:!0,delay:0}:$),R]})},[d]),x=_.useCallback(()=>{s(C=>{const L=C.filter(R=>!R.leaving);return L.length?(d(L.map(R=>R.id),kf+xf*L.length),C.map(R=>R.leaving?R:{...R,leaving:!0,delay:xf*L.indexOf(R)})):C})},[d]);return{items:u,push:g,clear:x}}function qp({items:u}){return u.length?h.jsx("ol",{className:"tool-activity","aria-live":"polite","aria-label":"What the agent is doing",children:u.map(s=>h.jsxs("li",{className:`tool-activity__item${s.leaving?" tool-activity__item--leaving":""}`,style:{"--delay":`${s.delay}ms`},"aria-hidden":s.leaving||void 0,children:[h.jsxs("span",{className:"tool-activity__summary",children:[h.jsx("span",{className:"tool-activity__tool",children:s.name.replace(/^mcp__.*__/,"")}),s.summary]}),s.detail&&h.jsx("code",{className:"tool-activity__detail",title:s.detail,children:s.detail}),s.folder&&h.jsxs("span",{className:"tool-activity__folder",children:["in ",s.folder]})]},s.id))}):null}function Do(u){const s=/^@([A-Za-z0-9._-]{1,40})\/(.+)$/.exec(u);return s?{prefix:`@${s[1]}/`,host:s[1],inner:s[2]}:{prefix:"",host:"",inner:u}}const Vu=["pi","opencode","claude"],Ks={pi:"Pi",opencode:"OpenCode",claude:"Claude Code"};let Ef=!1;function _f(u){const{host:s,inner:l}=Do(u),c=s||void 0;if(l.startsWith("new:"))return{harness:l.slice(4),title:"New chat",cwd:"~",host:c};if(l==="quick")return{title:"Quick chat",cwd:"~",host:c};const d=l.indexOf(":");return d===-1?{title:l,cwd:"",host:c}:{harness:l.slice(0,d),title:l.slice(d+1),cwd:"",host:c}}function bp(u){const s=/^(\/home\/[^/]+|\/Users\/[^/]+)(\/.*)?$/.exec(u);return s?`~${s[2]??""}`:u}function Gp(u){return`meldivo.conversation.${u}`}function Yp(u){const s=Gp(u);try{const l=window.sessionStorage.getItem(s);if(l)return l;const c=Uu();return window.sessionStorage.setItem(s,c),c}catch{return Uu()}}const Jp=12e3,Xp=560,Zp="This is a voice preview.",Hf="voice-assistant.onboarding-dismissed",em=3e3;function Ri(u){const s=/^([a-z]{2})[_-](.+)$/i.exec(u),l={af:"American female",am:"American male",bf:"British female",bm:"British male",ef:"Spanish female",em:"Spanish male",ff:"French female",fm:"French male",hf:"Hindi female",hm:"Hindi male",if:"Italian female",im:"Italian male",jf:"Japanese female",jm:"Japanese male",pf:"Portuguese female",pm:"Portuguese male",zf:"Chinese female",zm:"Chinese male"};if(s){const c=l[s[1].toLowerCase()];if(c)return`${Ri(s[2])} — ${c}`}return u.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[._-]+/g," ").replace(/\b\w/g,c=>c.toUpperCase())}function tm(){try{return window.localStorage.getItem(Hf)!=="true"}catch{return!0}}class nm extends Error{constructor(){super("Another voice tab is active. Close it or stop voice there first."),this.name="VoiceOwnershipError"}}function Cf(u,s){return new Promise((l,c)=>{if(s.aborted)return c(s.reason);const d=window.setTimeout(()=>{s.removeEventListener("abort",g),l()},u),g=()=>{window.clearTimeout(d),c(s.reason)};s.addEventListener("abort",g,{once:!0})})}async function rm(u,s){if(!u.body)throw new Error("Chat response was empty.");const l=u.body.pipeThrough(new TextDecoderStream).getReader();let c="";for(;;){const{done:d,value:g}=await l.read();if(d)break;c+=g;const x=c.split(`
80
- `);c=x.pop()??"";for(const C of x){if(!C.startsWith("data:"))continue;const L=C.slice(5).trim();if(!L)continue;let R;try{R=JSON.parse(L)}catch{continue}if(s(R),R.type==="done")return}}}function om({sessionKey:u,folder:s}){var ti;const[l,c]=_.useState("idle"),[d,g]=_.useState(0),[x,C]=_.useState(""),L=_.useRef(l),R=_.useRef(!0),H=_.useRef(!1),D=_.useRef(!1),O=_.useRef(!1),$=_.useRef(!1),X=_.useRef(null),se=_.useRef(null),N=_.useRef(null),Y=_.useRef(null),b=_.useRef(null),ye=_.useRef(!1),I=_.useRef(null),K=_.useRef(null),U=_.useRef(null),ne=_.useRef(new hh),me=_.useRef(0),ke=_.useRef(0),W=_.useRef(null),_e=_.useRef(null),Ge=_.useRef(0),et=_.useRef(Yp(s?`${u}|${s}`:u)),qe=_.useRef(u),Ue=_.useRef(null),$e=_.useRef(_f(u).harness),Ne=_.useRef(0),V=_.useRef(0),le=_.useRef(null),B=_.useRef(""),y=_.useRef(""),j=_.useRef(null),ie=_.useRef(new $h),ue=_.useRef(""),pe=_.useRef(0),we=_.useRef([]),ve=_.useRef(""),xe=_.useRef(null),Te=_.useRef(0),it=_.useRef(0),Gn=_.useRef(!1),Nr=_.useRef(null),Lt=_.useRef(null),Ht=_.useRef(!1),Yn=_.useRef(null),ut=_.useRef(_p()),Pr=_.useRef(new Map),vn=_.useRef(null),Jn=_.useRef(null),gn=_.useRef(null),At=_.useRef(null),Fn=_.useRef(0),Xn=_.useRef({}),Zn=_.useRef(),[Ot,eo]=_.useState(null),[at,er]=_.useState(!1),[to,Tr]=_.useState([]),[yn,Qs]=_.useState(""),[gt,no]=_.useState(()=>Xr()??""),[Fi,jr]=_.useState(()=>Xr()??""),[ro,Uo]=_.useState(()=>ju()),[yt,$o]=_.useState({ready:!0,downloading:!1}),[_t,Ln]=_.useState(()=>{const p=_f(u);return s&&Do(u).inner.startsWith("new:")?{...p,cwd:bp(s)}:p}),[Li,Vo]=_.useState(!1),[Bo,An]=_.useState(""),Rr=Qp(),[Wo,tr]=_.useState(!1),[nr,oo]=_.useState(""),[On,Ai]=_.useState(!1),[rr,Ct]=_.useState(""),[Mr,or]=_.useState(""),[io,Ho]=_.useState(null),[qs,zn]=_.useState(tm),ir=_.useRef(null),Fr=_.useRef(null),so=_.useRef(0),Ko=_.useRef(null),Qo=_.useRef(null),qo=_.useRef(null),rn=_.useRef(null),Kt=_.useRef(null),on=_.useRef(null),Le=_.useRef(null),lo=_.useRef(!1),zt=_.useRef(!1),Dt=()=>{W.current!==null&&window.clearTimeout(W.current),W.current=null},wt=()=>{Nr.current!==null&&window.clearTimeout(Nr.current),Nr.current=null},uo=()=>{var p;Jn.current!==null&&window.clearInterval(Jn.current),Jn.current=null,(p=vn.current)==null||p.abort(),vn.current=null},tt=p=>{L.current=p,R.current&&c(p)},Dn=p=>{p&&le.current!==p||(cancelAnimationFrame(V.current),le.current=null,$.current=!1,R.current&&g(0))},It=(p,w)=>{cancelAnimationFrame(V.current),le.current=w,$.current=!0,tt("speaking");const P=new Float32Array(p.fftSize),T=()=>{le.current===w&&(p.getFloatTimeDomainData(P),g(Math.min(1,Math.sqrt(P.reduce((q,G)=>q+G*G,0)/P.length)*6)),V.current=requestAnimationFrame(T))};T()},St=()=>{var p,w,P;H.current||L.current==="error"||($.current||(p=I.current)!=null&&p.busy&&L.current==="speaking"?tt("speaking"):b.current||(w=I.current)!=null&&w.busy||(P=U.current)!=null&&P.busy?tt(ye.current?"running":"thinking"):D.current&&tt("listening"))},kt=_.useRef(!1),Oi="Reading the conversation…",bs=async()=>{const p=qe.current,{inner:w}=Do(p);if(!(kt.current||!w.includes(":")||w.startsWith("new:"))){kt.current=!0,An(Oi);try{await fetch(`/api/sessions/${encodeURIComponent(p)}/warm`,{method:"POST",headers:Fe()})}catch{}finally{kt.current=!1,R.current&&An(P=>P===Oi?"":P)}}},Qt=()=>{const p=Y.current,w=N.current;!p||!w||(p.gain.cancelScheduledValues(w.currentTime),p.gain.setTargetAtTime(1,w.currentTime,.015))},qt=(p,w={})=>{fetch("/api/voice/event",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({kind:p,...w})}).catch(()=>{})},wn=_.useRef(null),Lr=()=>{var T;const p=((T=I.current)==null?void 0:T.hold())??!1;if(qt("barge_pause",{held:p}),!p)return;Ht.current=!0,wn.current!==null&&window.clearInterval(wn.current);let w=0;wn.current=window.setInterval(()=>{var G;if(!Ht.current){window.clearInterval(wn.current),wn.current=null;return}w=L.current==="hearing"||!!((G=U.current)!=null&&G.busy)?0:w||Date.now(),w&&Date.now()-w>=2500&&(qt("barge_resume_watchdog"),Sn())},250);const P=Lt.current;if(Lt.current=null,P){const q=(performance.now()-P.startedAt)/1e3,G=P.seconds>0?q/P.seconds:1,Q=np(P.text,G),fe=B.current.slice(0,B.current.length-Q.length).trim();Yn.current=Q?{said:fe,resume:Q}:null}else Yn.current=null},Sn=()=>{if(!Ht.current)return;Ht.current=!1;const p=Yn.current;Yn.current=null;const w=I.current;if(qt("barge_resume",{with_sentence:!!p}),!w||!p){w==null||w.resume("");return}ip(p.said,p.resume,Fe()).then(P=>{I.current===w&&w.resume(sp(P,p.resume))})},Gs=()=>{var p,w;return!!b.current||!!((p=I.current)!=null&&p.busy)||$.current||!!((w=U.current)!=null&&w.busy)||L.current==="hearing"},bo=async p=>{var q,G;(q=gn.current)==null||q.abort(),(G=At.current)==null||G.abort();const w=new AbortController;gn.current=w,Pr.current.clear();const P=Xr(),T=()=>N.current===p&&!w.signal.aborted;try{await Cf(xp,w.signal);for(const Q of Bs)for(;T();){for(;T()&&Gs();)await Cf(Ep,w.signal);if(!T())return;const fe=new AbortController;At.current=fe;try{const Oe=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/wav",...Fe()},body:JSON.stringify({text:Q,...P?{voice:P}:{}}),signal:fe.signal});if(!T()||!Oe.ok)break;const Ee=await Oe.arrayBuffer();if(!T())return;const Ye=await p.decodeAudioData(Ee);T()&&Pr.current.set(Q,Ye);break}catch{if(!fe.signal.aborted)break}finally{At.current===fe&&(At.current=null)}}}catch{}finally{gn.current===w&&(gn.current=null)}},Go=async(p,w)=>{const P=N.current,T=Pr.current.get(p);if(!P||!T)return;const q=Symbol("cue"),G=B.current;B.current=p,we.current=mf(we.current,p,performance.now());const Q=Pu(T,P,Y.current??P.destination,fe=>It(fe,q));try{await Q(w)}catch{}finally{Dn(q),B.current===p&&(B.current=G),St()}},zi=()=>{uo(),Jn.current=window.setInterval(()=>{var q;if(!ut.current.turnActive){uo();return}if($.current||(q=I.current)!=null&&q.busy||vn.current)return;const p=Date.now(),w=p-Fn.current;if(!Tp(ut.current,w,p))return;const P=jp(ut.current);ut.current=Pp(ut.current,P,p);const T=new AbortController;vn.current=T,Go(P,T.signal).finally(()=>{vn.current===T&&(vn.current=null),Fn.current=Date.now()})},300)},ct=p=>{if(!R.current)return;const w=++Ge.current;_e.current!==null&&window.clearTimeout(_e.current),C(p),tt("error"),_e.current=window.setTimeout(()=>{Ge.current===w&&(_e.current=null,C(""),L.current==="error"&&tt(D.current?H.current?"muted":"listening":"idle"))},4e3)},kn=()=>{var p;(p=j.current)==null||p.release(),j.current=null},sr=()=>{var w,P;Ne.current++;const p=ye.current||!!b.current;if(ye.current=!1,(w=b.current)==null||w.abort(),b.current=null,(P=I.current)==null||P.cancel(),Dn(),Qt(),Ht.current=!1,Yn.current=null,Lt.current=null,ut.current=wf(ut.current),uo(),p){const T=Ue.current??qe.current;fetch(`/api/sessions/${encodeURIComponent(T)}/cancel`,{method:"POST",headers:Fe()}).catch(()=>{})}Ue.current=null,!H.current&&D.current&&tt("listening")},In=()=>{var w;const p=$s(!!b.current,!!((w=I.current)!=null&&w.busy),$.current);qt("barge_interrupt",{active:p,paused:Ht.current}),p&&sr()},ge=p=>{var q,G,Q;if(!D.current&&!O.current)return;D.current=!1,O.current=!1,zt.current=!1,tr(!1),me.current++,Dt(),ne.current.deactivate(),H.current=!1,sr(),Qt(),ie.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",(q=K.current)==null||q.reset(),K.current=null,(G=U.current)==null||G.reset(),U.current=null,I.current=null;const w=X.current;X.current=null,w==null||w.destroy().catch(()=>{});const P=se.current;se.current=null,P==null||P.getTracks().forEach(fe=>{fe.onended=null,fe.stop()});const T=N.current;N.current=null,(Q=Y.current)==null||Q.disconnect(),Y.current=null,T&&T.state!=="closed"&&T.close().catch(()=>{}),kn(),ct(p)},Di=()=>{var T,q,G;if(!D.current)return;D.current=!1,zt.current=!1,tr(!1),me.current++,Dt(),ne.current.deactivate(),H.current=!1,sr(),Qt(),ie.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",(T=K.current)==null||T.reset(),K.current=null,(q=U.current)==null||q.reset(),U.current=null,I.current=null;const p=X.current;X.current=null,p==null||p.destroy().catch(()=>{});const w=se.current;se.current=null,w==null||w.getTracks().forEach(Q=>{Q.onended=null,Q.stop()});const P=N.current;N.current=null,(G=Y.current)==null||G.disconnect(),Y.current=null,P&&P.state!=="closed"&&P.close().catch(()=>{}),kn(),ct("Voice session moved to another tab. Tap the shape to reconnect.")},Yo=async(p,w)=>{const P=await fetch("/api/voice/transcribe",{method:"POST",headers:{"Content-Type":"audio/wav",...Fe()},body:Fp(p),signal:w}),T=await P.json();if(!P.ok)throw new Error(T.error??"Transcription failed.");return String(T.text??"").trim()},Jo=()=>{const p=Xn.current;if(p.reported||p.sent===void 0)return;p.reported=!0;const w=performance.now(),P=(T,q)=>T===void 0||q===void 0?void 0:Math.round(q-T);fetch("/api/voice/timing",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({silence_wait_ms:X.current?ju():void 0,speech_end_to_send_ms:P(p.speechEnd,p.sent),send_to_first_word_ms:P(p.sent,p.firstDelta),first_word_to_sound_ms:P(p.firstDelta,w),speech_end_to_sound_ms:P(p.speechEnd,w)})}).catch(()=>{})},Ii=async(p,w)=>{var Ee,Ye;const P=N.current;if(!P)throw new Error("Audio output is not ready.");const T=Symbol("playback");let q=Of(p);const G=He=>{var je;(je=vn.current)==null||je.abort(),Jo(),B.current=`${B.current} ${p.trim()}`.trim().slice(-2e3),we.current=mf(we.current,p,performance.now()),Lt.current={text:p.trim(),startedAt:performance.now(),seconds:q},It(He,T)},Q=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/pcm, audio/wav;q=0.9",...Fe()},body:JSON.stringify({text:p,...Zn.current?{voice:Zn.current}:{}}),signal:w});if(Q.headers.get("x-voice-fallback")==="configured"&&(Zn.current=void 0,Sf()),!Q.ok)throw new Error((await Q.json().catch(()=>({}))).error??"Speech generation failed.");let fe;if(Q.body&&((Ee=Q.headers.get("content-type"))!=null&&Ee.startsWith("audio/pcm"))){const He=Number(Q.headers.get("x-sample-rate"))||24e3;fe=await Yh(Q.body,He,P,Y.current??P.destination,G,w),(Ye=fe.completed)==null||Ye.then(je=>{var Ut;q=je,((Ut=Lt.current)==null?void 0:Ut.text)===p.trim()&&(Lt.current.seconds=je)},()=>{})}else{const He=await Q.arrayBuffer();w.throwIfAborted();const je=await P.decodeAudioData(He);w.throwIfAborted(),q=je.duration,fe=Pu(je,P,Y.current??P.destination,G)}const Oe=(async He=>{var je;try{await fe(He)}finally{Dn(T),((je=Lt.current)==null?void 0:je.text)===p.trim()&&(Lt.current=null),St()}});return Oe.completed=fe.completed,Oe},Un=()=>{eo(null),er(!1)},ao=(p,w)=>{eo({x:p,y:w}),er(!1)},bt=()=>{ir.current!==null&&window.clearTimeout(ir.current),ir.current=null,Fr.current=null},co=p=>{if(Ot||at){so.current=Date.now()+1e3,bt();return}if(p.pointerType!=="touch")return;bt();const{clientX:w,clientY:P,pointerId:T}=p;Fr.current={pointerId:T,x:w,y:P},ir.current=window.setTimeout(()=>{ir.current=null,Fr.current=null,so.current=Date.now()+1e3,ao(w,P)},Xp)},xn=p=>{const w=Fr.current;!w||w.pointerId!==p.pointerId||Math.hypot(p.clientX-w.x,p.clientY-w.y)>10&&bt()},Gt=()=>{var w;(w=Kt.current)==null||w.abort(),Kt.current=null,Le.current=null;const p=on.current;on.current=null,p&&p.state!=="closed"&&p.close().catch(()=>{}),Ho(null)},En=async()=>{if(!gt||io)return;Gt();const p=new AbortController;Kt.current=p;const w=new AudioContext;on.current=w,Ct(""),Ho(gt);try{await w.resume();const P=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/wav",...Fe()},body:JSON.stringify({text:Zp,voice:gt}),signal:p.signal});if(!P.ok)throw new Error((await P.json().catch(()=>({}))).error??"Voice preview failed.");const T=await P.arrayBuffer();p.signal.throwIfAborted();const q=await w.decodeAudioData(T);p.signal.throwIfAborted();const G=Pu(q,w,w.destination,()=>{});if(Kt.current!==p)return;Le.current=G,await G(p.signal)}catch(P){!(P instanceof DOMException&&P.name==="AbortError")&&Kt.current===p&&Ct(P instanceof Error?P.message:"Voice preview failed.")}finally{Kt.current===p&&(Kt.current=null),Le.current=null,on.current===w&&(on.current=null,w.state!=="closed"&&w.close().catch(()=>{})),Kt.current===null&&Ho(null)}},Ar=p=>{var P;(P=rn.current)==null||P.abort();const w=new AbortController;rn.current=w,Ai(!0),Ct(""),oo(""),fetch("/api/voice/voices",{headers:Fe(),signal:w.signal}).then(async T=>{const q=await T.json();if(!T.ok)throw new Error(typeof q.current=="string"?q.current:"Could not load voices.");const G=Array.isArray(q.voices)?q.voices.filter(Ee=>typeof Ee=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(Ee)):[],Q=typeof q.current=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(q.current)?q.current:"";if(rn.current!==w||w.signal.aborted)return;const fe=p??Xr(),Oe=fe&&(!G.length||G.includes(fe))?fe:"";Tr(G),Qs(Q),jr(Oe),no(Oe||Q||G[0]||""),oo(q.available===!1&&typeof q.warning=="string"?q.warning:"")}).catch(T=>{!(T instanceof DOMException&&T.name==="AbortError")&&!w.signal.aborted&&Ct(T instanceof Error?T.message:"Could not load voices.")}).finally(()=>{rn.current===w&&(rn.current=null,Ai(!1))})},Or=()=>{if(gt){if(!Hp(gt)){Ct("This voice could not be saved.");return}jr(gt),Ct(""),or(`${Ri(gt)} will be used from the next reply.`),N.current&&bo(N.current)}},_n=p=>{var P;const w=fp(p);Uo(w),(P=X.current)==null||P.setOptions({redemptionMs:w})},Ys=()=>{Sf(),jr(""),no(yn),Ct(""),or(`${yn?Ri(yn):"The profile default"} will be used from the next reply.`),N.current&&bo(N.current)},Xo=async()=>{var w,P;if(!D.current||H.current||zt.current)return;const p=X.current;if(p){zt.current=!0,Dt(),ie.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",y.current="",(w=K.current)==null||w.reset(),(P=U.current)==null||P.reset(),Qt(),p.setOptions({submitUserSpeechOnPause:!1});try{await ne.current.pause(p),(X.current!==p||!D.current||H.current||!lo.current)&&(zt.current=!1)}catch(T){if(zt.current=!1,X.current!==p||!D.current||H.current)return;p.setOptions({submitUserSpeechOnPause:!0}),ge(ne.current.isInvalid(p)?"Microphone transition timed out. Tap the shape to reconnect.":T instanceof Error?T.message:"Could not pause the microphone for settings.")}}},zr=async()=>{if(!zt.current)return;const p=X.current;if(zt.current=!1,!(!p||!D.current||H.current))try{await ne.current.start(p),X.current===p&&D.current&&!H.current&&(p.setOptions({submitUserSpeechOnPause:!0}),St())}catch(w){if(X.current!==p||!D.current||H.current)return;p.setOptions({submitUserSpeechOnPause:!0}),ge(ne.current.isInvalid(p)?"Microphone transition timed out. Tap the shape to reconnect.":w instanceof Error?w.message:"Could not resume the microphone after settings.")}},Js=p=>{const w=$e.current,{prefix:P}=Do(qe.current);if(w){qe.current=`${P}${w}:${p}`;return}fetch("/api/sessions",{headers:Fe()}).then(mn).then(async T=>{if(!T.ok)return;const G=(await T.json()).sessions.find(Q=>Q.id===p&&Do(Q.key).prefix===P);G&&(qe.current=G.key,$e.current=G.harness,R.current&&Ln({harness:G.harness,title:G.title,cwd:G.cwd,host:G.host}))}).catch(()=>{})},Ui=async p=>{var Q,fe,Oe;const w=++Ne.current;let P=!1,T=!1;const q=new AbortController;b.current=q,(Q=At.current)==null||Q.abort(),Zn.current=Xr(),Xn.current={speechEnd:Xn.current.speechEnd,sent:performance.now()},tt("thinking"),ut.current=Cp(ut.current),Fn.current=Date.now(),zi();const G=()=>{P=!0,T=!1,ut.current=Np(ut.current),Fn.current=Date.now()};try{if(!p||w!==Ne.current){St();return}B.current="",Zn.current=Xr();const Ee=qe.current;Ue.current=Ee;const Ye=await fetch(`/api/sessions/${encodeURIComponent(Ee)}/chat`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...Fe()},body:JSON.stringify({conversationId:et.current,message:p,...s&&Do(Ee).inner.startsWith("new:")?{cwd:s}:{}}),signal:q.signal});if(mn(Ye),!Ye.ok)throw new Error((await Ye.json().catch(()=>({}))).error??"Chat request failed.");let He="";if(await rm(Ye,je=>{var Ut,$n,Ur,ft;if(w===Ne.current)switch(je.type){case"session":Js(je.id);return;case"status":ye.current=!0,St(),An(je.message);return;case"tool":{if(ye.current=!0,St(),An(""),Rr.push(je),Fn.current=Date.now(),He.trim()){const Nt=Ru(He,!0,!P||T);He=Nt.rest,Nt.chunks.length&&(G(),(Ut=I.current)==null||Ut.enqueue(Nt.chunks))}T=!0;return}case"delta":{($n=Xn.current).firstDelta??($n.firstDelta=performance.now()),ye.current&&(ye.current=!1,St()),Rr.clear(),He+=je.text;const Nt=Ru(He,!1,!P||T);He=Nt.rest,Nt.chunks.length&&(G(),(Ur=I.current)==null||Ur.enqueue(Nt.chunks));return}case"notice":An(je.message),G(),(ft=I.current)==null||ft.enqueue([je.message]);return;case"error":throw new Error(je.message);case"done":return}}),w===Ne.current){const je=Ru(He,!0,!P||T);je.chunks.length&&(G(),(fe=I.current)==null||fe.enqueue(je.chunks))}}catch(Ee){if(Ee instanceof pn){R.current&&Vo(!0);return}!(Ee instanceof DOMException&&Ee.name==="AbortError")&&w===Ne.current&&(ct(Ee instanceof Error?Ee.message:"Voice conversation failed."),P||(Oe=I.current)==null||Oe.enqueue(["Sorry, I could not answer that. Please try again."]))}finally{b.current===q&&(b.current=null,Ue.current=null),ye.current=!1,R.current&&(An(""),Rr.clear()),w===Ne.current&&(ut.current=wf(ut.current),uo()),St()}},lr=async()=>{var Ur;if(D.current||O.current)return;O.current=!0;const p=++ke.current;let w=null,P=null,T=null,q=null,G=null,Q=null,fe=null,Oe=null;const Ee=++me.current,Ye=()=>{if(!R.current||me.current!==Ee||ke.current!==p)throw new DOMException("Voice startup was cancelled.","AbortError")};ne.current.beginSession();const He=performance.now(),je={},Ut=ft=>{je[ft]=Math.round(performance.now()-He)};let $n=!1;try{if(!window.isSecureContext||!((Ur=navigator.mediaDevices)!=null&&Ur.getUserMedia))throw new Error("Microphone access requires HTTPS or localhost.");C(""),tr(!1),tt("thinking"),w=new AudioContext;const ft=w,Nt=Wp(Di).then(de=>$n?(de==null||de.release(),null):(q=de,Ut("startup_lease_ms"),de)),ni=navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(de=>$n?(de.getTracks().forEach(Me=>Me.stop()),null):(P=de,Ut("startup_microphone_ms"),de));G=w.createGain(),G.gain.value=1,G.connect(w.destination),Q=new Xh(Ii,St,de=>{Dn(),ct(de instanceof Error?de.message:"Speech playback failed.")}),fe=new Eh(Yo,de=>{ue.current=de,pe.current=performance.now(),Dr(T,Ee)},()=>ar(T,Ee)),Oe=new fh(async(de,Me)=>{const Ve=await((fe==null?void 0:fe.finish(de.samples,Me))??Yo(de.samples,Me)),Re=de.possibleEcho?ch(Ve,de.possibleEcho):Ve,dt=de.pendingInterruptDecision,$t=Re.trim()?Re.trim().split(/\s+/).length:0;if(!dt)return Ht.current&&qt("barge_send_while_paused",{words:$t}),Re;qt("barge_final_decision",{words:$t,blocked:dt.wordPathBlocked});const Pn=Af(Re,dt.recentWindow);return Pn?(In(),Pn.remainder):!dt.wordPathBlocked&&Ou(Re,dt.recentWindow)?(In(),Re):(Sn(),"")},Ui,de=>ct(de instanceof Error?de.message:"Voice transcription failed."),St);const Vi=async()=>{if(!P)throw new Error("The microphone is not ready.");return P},Bi={getStream:Vi,pauseStream:async()=>{},resumeStream:Vi,...Sh(ju()),submitUserSpeechOnPause:!0,onSpeechStart:()=>{var Re,dt,$t,Pn;if(!sn(T,Ee))return;(Re=U.current)==null||Re.speechStarted();const de=$s(!!b.current,!!((dt=I.current)!=null&&dt.busy),$.current),Me=ie.current.speechStart(de);y.current=$.current||($t=I.current)!=null&&$t.busy?B.current:"";const Ve=performance.now();ve.current=zh(we.current,Ve,Ve),ue.current="",pe.current=0,Te.current=0,it.current=0,Gn.current=!1,Me.begin&&((Pn=K.current)==null||Pn.begin(de)),ur(T,Ee),wt(),de&&(Nr.current=window.setTimeout(()=>Dr(T,Ee),Ch))},onSpeechRealStart:()=>{var Me,Ve;if(!sn(T,Ee))return;ie.current.speechRealStart().accepted&&(Qt(),(Me=K.current)==null||Me.confirm(),ur(T,Ee),(Ve=At.current)==null||Ve.abort(),C(""),tt("hearing"))},onVADMisfire:()=>{var de,Me;sn(T,Ee)&&(Dt(),ie.current.reset(),wt(),ue.current="",pe.current=0,y.current="",ve.current="",(de=K.current)==null||de.discard(),(Me=U.current)==null||Me.speechDiscarded(),Sn(),H.current||St())},onFrameProcessed:(de,Me)=>{var Re;if(!sn(T,Ee))return;(Re=K.current)==null||Re.frame(de.isSpeech,Me);const Ve=Math.sqrt(Me.reduce((dt,$t)=>dt+$t*$t,0)/Me.length);if(g(Math.min(1,Ve*7)),$.current&&ie.current.idle)xe.current=xe.current===null?Ve:xe.current*.9+Ve*.1;else if(!ie.current.idle&&$.current&&!Gn.current&&(Te.current++,it.current+=Ve,Te.current>=Dh)){Gn.current=!0;const dt=it.current/Te.current;Uh(dt,xe.current)?ie.current.blockWordPath():xe.current!==null&&Lr()}},onSpeechEnd:de=>{var $t,Pn,mo,fr,Qi,ii;if(!sn(T,Ee))return;Xn.current={speechEnd:performance.now()},Dt(),wt();const Me=ue.current.trim()!==""&&performance.now()-pe.current<=Nh,Ve=ve.current,Re=ie.current.speechEnd(ue.current,Ve,Me);if(Ht.current&&qt("barge_speech_end",{accepted:Re.accepted,interrupt:!!Re.interrupt,send:!!Re.send,deferred:!!Re.deferDecision,fresh:Me}),ue.current="",pe.current=0,!Re.accepted){y.current="",ve.current="",($t=K.current)==null||$t.discard(),(Pn=U.current)==null||Pn.speechDiscarded(),Sn(),St();return}if(Re.interrupt?In():Re.deferDecision||Sn(),!Re.send){y.current="",ve.current="",(mo=K.current)==null||mo.discard(),(fr=U.current)==null||fr.speechDiscarded(),St();return}(Qi=K.current)==null||Qi.end(de);const dt=y.current;y.current="",ve.current="",(ii=U.current)==null||ii.speechEnded({samples:de,possibleEcho:dt,...Re.deferDecision?{pendingInterruptDecision:{recentWindow:Ve,wordPathBlocked:Re.wordPathBlocked}}:{}})}},el=Ef?Promise.resolve(null):(async()=>{try{const{MicVAD:de}=await Df(),Me=await de.new({model:"v5",audioContext:ft,startOnLoad:!1,baseAssetPath:zu,onnxWASMBasePath:zu,ortConfig:Ve=>{Ve.env.wasm.numThreads=1},...Bi});return $n?(Me.destroy().catch(()=>{}),null):(T=Me,Ut("startup_detector_ms"),Me)}catch{return Ef=!0,null}})(),[Wi,Nn,tl]=await Promise.all([Nt,ni,el,ft.resume()]);if(q=Wi,P=Nn,T=tl,!q)throw new nm;if(!Nn)throw new Error("Voice startup did not finish.");Ye();let ri=!1;T||(ri=!0,T=await Qu.new({audioContext:w,...Bi}),Ut("startup_detector_ms")),Ye(),fe.speechThreshold=ri?Hu:Hs,tr(ri),await ne.current.start(T),Ut("startup_listening_ms"),Ye();const ho=T,Je=w;if(!ho||!Je)throw new Error("Voice startup did not finish.");j.current=q,N.current=Je,Y.current=G,bo(Je),I.current=Q,K.current=fe,U.current=Oe,se.current=Nn,X.current=ho,D.current=!0;const Hi=()=>{var de,Me,Ve;if(!(se.current!==Nn||!D.current)){D.current=!1,zt.current=!1,tr(!1),me.current++,Dt(),ne.current.deactivate(),H.current=!1,sr(),Qt(),ie.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",I.current=null,(de=K.current)==null||de.reset(),K.current=null,(Me=U.current)==null||Me.reset(),U.current=null,X.current===ho&&(X.current=null),se.current===Nn&&(se.current=null),N.current===Je&&(N.current=null),(Ve=Y.current)==null||Ve.disconnect(),Y.current=null;for(const Re of Nn.getTracks())Re.onended=null,Re.readyState==="live"&&Re.stop();ho.destroy().catch(()=>{}),Je.state!=="closed"&&Je.close().catch(()=>{}),kn(),ct("Microphone disconnected. Tap the shape to reconnect.")}};for(const de of Nn.getAudioTracks())de.onended=Hi;let oi=!1;const po=()=>{if(!(N.current!==Je||!D.current)){if(Je.state==="running"||Je.state==="closed"){oi=!1;return}Je.resume().catch(()=>{}).then(()=>{N.current!==Je||!D.current||Je.state==="running"||oi||(oi=!0,ct("The device paused audio. Tap the shape to keep talking."))})}};Je.onstatechange=po;const Ki=window.setInterval(()=>{if(N.current!==Je||Je.state==="closed"){window.clearInterval(Ki),document.removeEventListener("visibilitychange",po);return}po()},2e3);if(document.addEventListener("visibilitychange",po),!Nn.getAudioTracks().some(de=>de.readyState==="live")){Hi();return}tt("listening"),fetch("/api/voice/timing",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify(je)}).catch(()=>{}),lo.current&&Xo()}catch(ft){$n=!0;const Nt=me.current===Ee&&ke.current===p;Nt&&(me.current++,Dt(),ne.current.deactivate(),X.current===T&&(X.current=null),se.current===P&&(se.current=null),N.current===w&&(N.current=null),Y.current===G&&(Y.current=null),I.current===Q&&(I.current=null),K.current===fe&&(K.current=null),U.current===Oe&&(U.current=null)),Q==null||Q.cancel(),fe==null||fe.reset(),Oe==null||Oe.reset(),G==null||G.disconnect(),T&&await T.destroy().catch(()=>{}),P==null||P.getTracks().forEach(ni=>ni.stop()),w&&w.state!=="closed"&&await w.close().catch(()=>{}),j.current===q&&(j.current=null),q==null||q.release(),Nt&&!(ft instanceof DOMException&&ft.name==="AbortError")&&ct(ft instanceof Error?ft.message:"Could not start the microphone.")}finally{ke.current===p&&(O.current=!1)}},sn=(p,w)=>(D.current||O.current)&&!lo.current&&ph(me.current,w,X.current,p,H.current,ne.current.acceptsCallbacks),ln=(p,w,P)=>p!==null&&X.current===p&&D.current&&H.current===w&&(P===void 0||me.current===P),Cn=(p,w,P)=>ln(p,w,P)&&p!==null&&!ne.current.isInvalid(p),ur=(p,w)=>{Dt(),p&&(W.current=window.setTimeout(()=>{W.current=null,sn(p,w)&&ne.current.flush(p).then(()=>{Cn(p,!1,w)}).catch(P=>{ln(p,!1,w)&&(ne.current.isInvalid(p)?ge("Microphone transition timed out. Tap the shape to reconnect."):ct(P instanceof Error?P.message:"Microphone recovery failed."))})},Jp))},ar=(p,w)=>{!p||!sn(p,w)||ne.current.flush(p).catch(P=>{ln(p,!1,w)&&(ne.current.isInvalid(p)?ge("Microphone transition timed out. Tap the shape to reconnect."):ct(P instanceof Error?P.message:"Microphone recovery failed."))})},Dr=(p,w)=>{sn(p,w)&&ie.current.shouldInterruptNow(ue.current,ve.current)&&(wt(),In(),Qt())},Xs=async()=>{var w,P,T,q,G;if(!D.current){O.current||lr();return}const p=N.current;if(p&&p.state!=="running"&&p.state!=="closed"&&(await p.resume().catch(()=>{}),p.state==="running")){tt(H.current?"muted":"listening");return}if(!H.current&&$s(!!b.current,!!((w=I.current)!=null&&w.busy),$.current)){In(),Qt();return}if(H.current=!H.current,H.current){Dt(),sr(),Qt(),ie.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",(P=K.current)==null||P.reset(),(T=U.current)==null||T.reset(),(q=se.current)==null||q.getTracks().forEach(fe=>{fe.enabled=!1});const Q=X.current;if(!ln(Q,!0))return;Q==null||Q.setOptions({submitUserSpeechOnPause:!1});try{if(Q&&await ne.current.pause(Q),!Cn(Q,!0)){ln(Q,!0)&&Q&&ne.current.isInvalid(Q)&&ge("Microphone transition timed out. Tap the shape to reconnect.");return}tt("muted")}catch(fe){if(!ln(Q,!0))return;Q&&ne.current.isInvalid(Q)?ge("Microphone transition timed out. Tap the shape to reconnect."):ct(fe instanceof Error?fe.message:"Could not pause the microphone.")}}else{(G=se.current)==null||G.getTracks().forEach(fe=>{fe.enabled=!0});const Q=X.current;if(!ln(Q,!1))return;try{if(Q){if(await ne.current.start(Q),!Cn(Q,!1)){ln(Q,!1)&&ne.current.isInvalid(Q)&&ge("Microphone transition timed out. Tap the shape to reconnect.");return}Q.setOptions({submitUserSpeechOnPause:!0})}if(!Cn(Q,!1))return;tt("listening")}catch(fe){if(!ln(Q,!1))return;Q&&ne.current.isInvalid(Q)?ge("Microphone transition timed out. Tap the shape to reconnect."):ct(fe instanceof Error?fe.message:"Could not resume the microphone.")}}},Zs=()=>{if(Un(),C(""),D.current||O.current){ge(""),window.setTimeout(()=>{!D.current&&!O.current&&lr()},0);return}lr()};if(_.useEffect(()=>{cp(),bs()},[u]),_.useEffect(()=>{const p=new AbortController;return fetch("/api/sessions",{headers:Fe(),signal:p.signal}).then(mn).then(async w=>{if(!w.ok)return;const T=(await w.json()).sessions.find(q=>q.key===u);T&&!p.signal.aborted&&($e.current=T.harness,Ln({harness:T.harness,title:T.title,cwd:T.cwd,host:T.host}))}).catch(w=>{w instanceof pn&&!p.signal.aborted&&Vo(!0)}),()=>p.abort()},[u]),_.useEffect(()=>{let p=!1;const w=()=>{fetch("/api/health",{headers:Fe()}).then(async T=>{const q=await T.json().catch(()=>({}));if(p)return;const G=q.speech??{};$o({ready:G.ready!==!1,downloading:G.downloading===!0,progress:typeof G.progress=="number"?G.progress:void 0,error:typeof G.error=="string"?G.error:void 0})}).catch(()=>{})};w();const P=window.setInterval(w,em);return()=>{p=!0,window.clearInterval(P)}},[]),_.useEffect(()=>{var p;if(lo.current=at,at?Xo():zr(),!at){io&&Gt(),(p=rn.current)==null||p.abort(),rn.current=null;return}Ct(""),or(""),Ar(Xr()??void 0)},[at]),_.useEffect(()=>{if(!Ot&&!at)return;const p=P=>{var q,G;const T=P.target;T instanceof Node&&((q=Ko.current)!=null&&q.contains(T)||(G=Qo.current)!=null&&G.contains(T))||Un()},w=P=>{P.key==="Escape"&&(P.preventDefault(),Un())};return document.addEventListener("pointerdown",p),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("keydown",w)}},[Ot,at]),_.useEffect(()=>{at&&window.setTimeout(()=>{var p;return(p=qo.current)==null?void 0:p.focus()},0)},[at]),_.useEffect(()=>()=>{var p,w,P,T,q,G,Q,fe;R.current=!1,Ge.current++,_e.current!==null&&window.clearTimeout(_e.current),_e.current=null,D.current=!1,bt(),(p=rn.current)==null||p.abort(),(w=Kt.current)==null||w.abort(),Kt.current=null,Le.current=null,on.current&&on.current.state!=="closed"&&on.current.close().catch(()=>{}),on.current=null,me.current++,Dt(),ne.current.deactivate(),sr(),Qt(),ie.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",(P=K.current)==null||P.reset(),(T=U.current)==null||T.reset(),U.current=null,(q=X.current)==null||q.destroy(),(G=se.current)==null||G.getTracks().forEach(Oe=>{Oe.onended=null,Oe.stop()}),(Q=N.current)==null||Q.close(),(fe=Y.current)==null||fe.disconnect(),Y.current=null,kn()},[]),Li)return h.jsx(Wf,{});const Zo=$s(!!b.current,!!((ti=I.current)!=null&&ti.busy),$.current),fo=D.current?l==="muted"?"Unmute microphone":Zo?"Stop reply":"Mute microphone":"Start voice conversation",ei=Ot?Math.max(12,Math.min(Ot.x,window.innerWidth-170)):0,$i=Ot?Math.max(12,Math.min(Ot.y,window.innerHeight-68)):0,Yt=Fi||yn,cr=yt.ready,Ir=yt.ready?"Ready":yt.downloading?`Downloading voice models…${typeof yt.progress=="number"?` ${Math.round(yt.progress)}%`:""}`:"Offline";return h.jsxs("main",{className:"voice-page","data-state":l,style:{"--level":d},children:[h.jsxs("header",{className:"room-header",children:[h.jsx("a",{className:"room-header__back",href:"/","aria-label":"Back to hub",children:"←"}),h.jsx("img",{className:"room-header__logo",src:"/logo-192.png",alt:"",width:22,height:22}),h.jsxs("span",{className:"room-header__title",children:[_t.harness?Ks[_t.harness]:"Meldivo"," · ",_t.title]}),(_t.host||_t.cwd)&&h.jsx("span",{className:"room-header__cwd",children:[_t.host,_t.cwd].filter(Boolean).join(" · ")})]}),Bo&&h.jsx("p",{className:"room-status",role:"status",children:Bo}),h.jsx(qp,{items:Rr.items}),Wo&&h.jsx("p",{className:"room-status voice-fallback-notice",role:"status",children:"Using basic voice detection"}),!yt.ready&&h.jsx("p",{className:"voice-health",role:"status",children:yt.error||Ir}),h.jsxs("button",{className:"voice-shape",type:"button",onClick:()=>{if(Date.now()<so.current){so.current=0;return}if(Ot||at){Un();return}Xs()},onPointerDown:co,onPointerMove:xn,onPointerUp:bt,onPointerCancel:bt,onPointerLeave:bt,onLostPointerCapture:bt,onContextMenu:p=>{p.preventDefault(),ao(p.clientX,p.clientY)},onKeyDown:p=>{if(p.key==="ContextMenu"||p.key==="F10"&&p.shiftKey){p.preventDefault();const w=p.currentTarget.getBoundingClientRect();ao(w.left+w.width/2,w.top+w.height/2)}},"aria-label":fo,"aria-haspopup":"menu","aria-expanded":!!(Ot||at),children:[h.jsx("span",{className:"voice-shape__halo"}),h.jsx("span",{className:"voice-shape__ring voice-shape__ring--one"}),h.jsx("span",{className:"voice-shape__ring voice-shape__ring--two"}),h.jsx("span",{className:"voice-shape__core"})]}),Ot&&h.jsx("div",{ref:Ko,className:"voice-context-menu",role:"menu","aria-label":"Voice options",style:{left:ei,top:$i},children:h.jsx("button",{type:"button",role:"menuitem",onClick:()=>{eo(null),er(!0)},children:"Settings"})}),at&&h.jsxs("div",{ref:Qo,className:"voice-settings",role:"dialog","aria-modal":"false","aria-labelledby":"voice-settings-title",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),Un())},children:[h.jsxs("div",{className:"voice-settings__header",children:[h.jsx("h2",{id:"voice-settings-title",children:"Voice"}),h.jsx("button",{className:"voice-settings__close",type:"button",onClick:Un,"aria-label":"Close voice settings",children:"×"})]}),h.jsxs("p",{id:"tts-provider-status",className:`voice-settings__availability voice-settings__availability--${yt.ready?"ready":yt.downloading?"checking":"offline"}`,role:"status",children:[h.jsx("span",{"aria-hidden":"true"}),Ir]}),yt.error&&h.jsx("p",{className:"voice-settings__availability-note",children:yt.error}),nr&&h.jsx("p",{className:"voice-settings__availability-note",children:nr}),On&&h.jsx("p",{className:"voice-settings__muted",children:"Loading voices…"}),!On&&to.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("label",{className:"voice-settings__label",htmlFor:"voice-choice",children:"Choose a voice"}),h.jsxs("div",{className:"voice-settings__choice",children:[h.jsx("select",{ref:qo,id:"voice-choice",value:gt,onChange:p=>{Gt(),no(p.target.value),Ct(""),or("")},"aria-describedby":"voice-current",children:to.map(p=>h.jsx("option",{value:p,children:Ri(p)},p))}),h.jsx("button",{className:"voice-settings__play",type:"button",onClick:()=>{En()},disabled:!gt||!cr||!!io,"aria-label":`Preview ${gt||"voice"}`,"aria-describedby":"tts-provider-status",title:cr?void 0:"Wait for voice models to be ready.",children:io?"…":"▶"})]}),h.jsxs("p",{id:"voice-current",className:"voice-settings__current",children:["Current: ",Yt?Ri(Yt):"profile default"]}),h.jsxs("div",{className:"voice-settings__actions",children:[h.jsx("button",{type:"button",onClick:Or,disabled:!gt||!cr||gt===Yt,"aria-describedby":"tts-provider-status",title:cr?void 0:"Wait for voice models to be ready.",children:"Use this voice"}),h.jsx("button",{type:"button",onClick:Ys,disabled:!Fi,children:"Restore default"})]})]}),!On&&!to.length&&h.jsx(h.Fragment,{children:h.jsx("p",{className:"voice-settings__muted",children:"No selectable voices are configured."})}),rr&&h.jsx("p",{className:"voice-settings__error",role:"alert",children:rr}),Mr&&h.jsx("p",{className:"voice-settings__notice",role:"status",children:Mr}),h.jsxs("label",{className:"voice-settings__label",htmlFor:"vad-redemption",children:["End-of-speech wait: ",ro," ms"]}),h.jsx("input",{id:"vad-redemption",type:"range",min:Ff,max:Lf,step:Fu,value:ro,onChange:p=>_n(Number(p.target.value)),"aria-describedby":"vad-redemption-hint"}),h.jsx("p",{id:"vad-redemption-hint",className:"voice-settings__muted",children:"How long to wait after you stop talking before the reply starts. Lower is snappier; higher avoids cutting off pauses."}),h.jsx("a",{className:"voice-settings__advanced-link",href:"/?settings=speech",children:"Speech engines and servers…"})]}),qs&&h.jsx("div",{className:"voice-onboarding",role:"dialog","aria-modal":"true","aria-labelledby":"voice-onboarding-title",children:h.jsxs("div",{className:"voice-onboarding__card",children:[h.jsx("h2",{id:"voice-onboarding-title",children:"Welcome"}),h.jsx("p",{children:"Tap to talk, or to stop a reply · hold or right-click for settings."}),h.jsx("button",{type:"button",onClick:()=>{try{window.localStorage.setItem(Hf,"true")}catch{}zn(!1)},children:"OK"})]})}),x&&h.jsxs("div",{className:"voice-error",role:"alert",title:x,children:[h.jsx("span",{children:x}),h.jsx("button",{className:"voice-error__reconnect",type:"button",onClick:Zs,children:"Reconnect"})]})]})}function Bu(u){return{engine:u.engine,url:u.url??"",apiKey:"",hasKey:!!u.hasKey,clearKey:!1,model:u.model??"",voice:u.voice??"",models:[],voices:[],status:"idle",error:""}}function Ws(u){return u.engine==="local"?{engine:"local",...u.voice?{voice:u.voice}:{}}:{engine:u.engine,url:u.url,...u.apiKey?{apiKey:u.apiKey}:{},...u.clearKey?{clearKey:!0}:{},...u.model?{model:u.model}:{},...u.voice?{voice:u.voice}:{}}}function Nf(u){const s=/^([abefhijpz])([fm])_(.+)$/.exec(u),c=(s?s[3]:u.replace(/\.(wav|mp3|flac)$/i,"")).replace(/[_-]+/g," ").trim().replace(/\b\w/g,g=>g.toUpperCase());return s?`${c} (${{a:"American",b:"British",e:"Spanish",f:"French",h:"Hindi",i:"Italian",j:"Japanese",p:"Portuguese",z:"Chinese"}[s[1]]??""} ${s[2]==="f"?"female":"male"})`.replace("( ","("):c}async function im(u,s,l){const c=mn(await fetch(u,{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify(s),signal:l})),d=await c.json().catch(()=>({}));if(!c.ok)throw new Error(d.error??"The request failed.");return d}function Pf({kind:u,engines:s,draft:l,onChange:c}){const d=s.find(N=>N.id===l.engine),g=l.engine!=="local",[x,C]=_.useState(!1),L=_.useRef(null),R=_.useRef(null),H=_.useRef(null),D=u==="tts"?"Text to speech":"Speech to text",O=`speech-${u}`,$=u==="tts"?l.model:"";_.useEffect(()=>{var b;if((b=H.current)==null||b.abort(),g&&!l.url.trim()){c(ye=>({...ye,models:[],voices:[],status:"idle",error:""}));return}const N=new AbortController;H.current=N;const Y=window.setTimeout(()=>{c(I=>({...I,status:"loading",error:""}));const ye={...Ws({...l,voice:""})};im("/api/speech/discover",{kind:u,setting:ye},N.signal).then(I=>{N.signal.aborted||c(K=>{var me;const U=I.models.some(ke=>ke.id===K.model)?K.model:I.model??((me=I.models[0])==null?void 0:me.id)??"",ne=I.voices.includes(K.voice)?K.voice:I.voice??I.voices[0]??"";return{...K,models:I.models,voices:I.voices,model:U,voice:ne,status:"ready",error:""}})}).catch(I=>{if(I instanceof pn)throw I;N.signal.aborted||c(K=>({...K,models:[],voices:[],status:"error",error:I instanceof Error?I.message:"Could not reach the server."}))})},g?600:0);return()=>{window.clearTimeout(Y),N.abort()}},[u,l.engine,l.url,l.apiKey,l.clearKey,$]);const X=()=>{var Y;(Y=L.current)==null||Y.abort();const N=R.current;R.current=null,N&&N.state!=="closed"&&N.close().catch(()=>{})};_.useEffect(()=>X,[]);const se=async()=>{if(!l.voice)return;X();const N=new AbortController;L.current=N;const Y=new AudioContext;R.current=Y,C(!0),c(b=>({...b,error:""}));try{const b=mn(await fetch("/api/speech/preview",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({setting:Ws(l),voice:l.voice}),signal:N.signal}));if(!b.ok)throw new Error((await b.json().catch(()=>({}))).error??"Preview failed.");await Y.resume();const ye=await Y.decodeAudioData(await b.arrayBuffer());if(N.signal.aborted)return;const I=Y.createBufferSource();I.buffer=ye,I.connect(Y.destination),I.onended=()=>{R.current===Y&&(X(),C(!1))},I.start()}catch(b){if(b instanceof pn)throw b;N.signal.aborted||(X(),C(!1),c(ye=>({...ye,error:b instanceof Error?b.message:"Preview failed."})))}};return h.jsxs("section",{className:"speech-section","aria-labelledby":`${O}-title`,children:[h.jsx("h3",{id:`${O}-title`,children:D}),h.jsxs("label",{className:"speech-field",children:[h.jsx("span",{children:"Engine"}),h.jsx("select",{value:l.engine,onChange:N=>{const Y=N.target.value;c(b=>({...Bu({engine:Y}),url:Y===b.engine?b.url:""}))},children:s.map(N=>h.jsxs("option",{value:N.id,children:[N.label,N.note?` · ${N.note}`:""]},N.id))})]}),g&&h.jsxs(h.Fragment,{children:[h.jsxs("label",{className:"speech-field",children:[h.jsx("span",{children:"Server address"}),h.jsx("input",{type:"url",inputMode:"url",autoComplete:"off",spellCheck:!1,placeholder:(d==null?void 0:d.defaultUrl)??"http://localhost:8000",value:l.url,onChange:N=>{const Y=N.target.value;c(b=>({...b,url:Y}))}})]}),h.jsxs("label",{className:"speech-field",children:[h.jsxs("span",{children:["API key ",h.jsx("em",{children:"(optional)"})]}),h.jsx("input",{type:"password",autoComplete:"off",placeholder:l.hasKey&&!l.clearKey?"Saved; type to replace":"Leave empty if the server has none",value:l.apiKey,onChange:N=>{const Y=N.target.value;c(b=>({...b,apiKey:Y,clearKey:!1}))}})]}),l.hasKey&&!l.apiKey&&!l.clearKey&&h.jsx("button",{type:"button",className:"speech-link",onClick:()=>c(N=>({...N,clearKey:!0})),children:"Remove saved key"})]}),l.status==="loading"&&h.jsx("p",{className:"speech-status",children:"Connecting…"}),l.status==="ready"&&g&&h.jsx("p",{className:"speech-status speech-status--ok",children:"Connected"}),l.status==="error"&&h.jsx("p",{className:"speech-status speech-status--error",role:"alert",children:l.error}),g&&l.models.length>0&&((d==null?void 0:d.hasModels)||l.models.length>1)&&h.jsxs("label",{className:"speech-field",children:[h.jsx("span",{children:"Model"}),h.jsx("select",{value:l.model,onChange:N=>{const Y=N.target.value;c(b=>({...b,model:Y}))},children:l.models.map(N=>h.jsxs("option",{value:N.id,children:[N.id,N.installed===!1?" (downloads on first use)":""]},N.id))})]}),u==="tts"&&l.voices.length>0&&h.jsxs("div",{className:"speech-field",children:[h.jsx("label",{htmlFor:`${O}-voice`,children:"Speaker"}),h.jsxs("div",{className:"speech-voice",children:[h.jsx("select",{id:`${O}-voice`,value:l.voice,onChange:N=>{const Y=N.target.value;c(b=>({...b,voice:Y}))},children:l.voices.map(N=>h.jsx("option",{value:N,children:Nf(N)},N))}),h.jsx("button",{type:"button",className:"speech-play",onClick:()=>{se()},disabled:!l.voice||x,"aria-label":`Play a preview of ${l.voice?Nf(l.voice):"this speaker"}`,children:x?"…":"▶"})]})]}),l.error&&l.status!=="error"&&h.jsx("p",{className:"speech-status speech-status--error",role:"alert",children:l.error})]})}function sm({onClose:u}){const[s,l]=_.useState(null),[c,d]=_.useState(null),[g,x]=_.useState(null),[C,L]=_.useState(""),[R,H]=_.useState(""),[D,O]=_.useState(!1);_.useEffect(()=>{fetch("/api/speech/settings",{headers:Fe()}).then(mn).then(async N=>{if(!N.ok)throw new Error("Could not load the speech settings.");const Y=await N.json();l(Y),d(Bu(Y.tts.setting)),x(Bu(Y.stt.setting))}).catch(N=>{if(N instanceof pn)throw N;L(N instanceof Error?N.message:"Could not load the speech settings.")})},[]);const $=N=>Y=>{H(""),N(b=>b&&Y(b))},X=()=>{!c||!g||(O(!0),L(""),H(""),fetch("/api/speech/settings",{method:"PUT",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({tts:Ws(c),stt:Ws(g)})}).then(mn).then(async N=>{const Y=await N.json().catch(()=>({}));if(!N.ok)throw new Error(Y.error??"Could not save the speech settings.");d(b=>b&&{...b,apiKey:"",clearKey:!1,hasKey:!!Y.tts.setting.hasKey}),x(b=>b&&{...b,apiKey:"",clearKey:!1,hasKey:!!Y.stt.setting.hasKey}),H("Saved. Every machine and browser on this hub uses it from the next turn.")}).catch(N=>{if(N instanceof pn)throw N;L(N instanceof Error?N.message:"Could not save the speech settings.")}).finally(()=>O(!1)))},se=N=>!N||N.engine!=="local"&&!N.url.trim();return h.jsxs("div",{className:"hub-remote speech-settings",role:"dialog","aria-labelledby":"speech-settings-title",children:[h.jsxs("div",{className:"hub-remote__header",children:[h.jsx("h2",{id:"speech-settings-title",children:"Speech"}),h.jsx("button",{className:"hub-remote__close",type:"button",onClick:u,"aria-label":"Close speech settings",children:"×"})]}),h.jsx("p",{className:"hub-muted speech-intro",children:"Use the built-in on-device models, or point either direction at a speech server you run, for a bigger, more realistic, or faster model."}),!s&&!C&&h.jsx("p",{className:"hub-muted",children:"Loading…"}),s&&c&&g&&h.jsxs(h.Fragment,{children:[h.jsx(Pf,{kind:"tts",engines:s.tts.engines,draft:c,onChange:$(d)}),h.jsx(Pf,{kind:"stt",engines:s.stt.engines,draft:g,onChange:$(x)}),h.jsx("div",{className:"speech-actions",children:h.jsx("button",{type:"button",className:"hub-primary",onClick:X,disabled:D||se(c)||se(g),children:D?"Saving…":"Save"})})]}),C&&h.jsx("p",{className:"hub-error",role:"alert",children:C}),R&&h.jsx("p",{className:"speech-status speech-status--ok",role:"status",children:R})]})}const lm=5e3,um=5e3;function Mi(u){const s=/^(\/home\/[^/]+|\/Users\/[^/]+)(\/.*)?$/.exec(u);return s?s[2]?`~${s[2]}`:"~":u}function Kf(u){const s=Math.max(0,Math.round((Date.now()-u)/1e3));if(s<5)return"just now";if(s<60)return`${s}s ago`;const l=Math.round(s/60);if(l<60)return`${l}m ago`;const c=Math.round(l/60);return c<24?`${c}h ago`:`${Math.round(c/24)}d ago`}function Qf(u,s){window.location.href=`/?session=${encodeURIComponent(u)}${s?`&folder=${encodeURIComponent(s)}`:""}`}function am(u){return u.busy?{className:"hub-dot hub-dot--busy",label:"busy"}:u.open?{className:"hub-dot hub-dot--open",label:"open in terminal"}:{className:"hub-dot hub-dot--idle",label:"idle"}}function cm({onClose:u}){var O;const[s,l]=_.useState(null),[c,d]=_.useState(""),[g,x]=_.useState(!1),[C,L]=_.useState(""),R=()=>{d(""),fetch("/api/remote",{headers:Fe()}).then(mn).then(async $=>{if(!$.ok)throw new Error("Could not load phone access options.");l(await $.json())}).catch($=>{if($ instanceof pn)throw $;d($ instanceof Error?$.message:"Could not load phone access options.")})};_.useEffect(R,[]),_.useEffect(()=>{var se;const $=(se=s==null?void 0:s.active)==null?void 0:se.url;if(!$){L("");return}let X=!1;return zf(()=>import("./browser-CujOq0-h.js").then(N=>N.b),__vite__mapDeps([2,1])).then(async N=>{const Y=await N.toDataURL($,{margin:1,width:200});X||L(Y)}).catch(()=>{X||L("")}),()=>{X=!0}},[(O=s==null?void 0:s.active)==null?void 0:O.url]);const H=$=>{x(!0),d(""),fetch("/api/remote",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({id:$})}).then(mn).then(async X=>{if(!X.ok)throw new Error((await X.json().catch(()=>({}))).error??"Could not enable phone access.");R()}).catch(X=>{if(X instanceof pn)throw X;d(X instanceof Error?X.message:"Could not enable phone access.")}).finally(()=>x(!1))},D=()=>{x(!0),d(""),fetch("/api/remote",{method:"DELETE",headers:Fe()}).then(mn).then($=>{if(!$.ok)throw new Error("Could not turn off phone access.");R()}).catch($=>{if($ instanceof pn)throw $;d($ instanceof Error?$.message:"Could not turn off phone access.")}).finally(()=>x(!1))};return h.jsxs("div",{className:"hub-remote",role:"dialog","aria-labelledby":"hub-remote-title",children:[h.jsxs("div",{className:"hub-remote__header",children:[h.jsx("h2",{id:"hub-remote-title",children:"Phone access"}),h.jsx("button",{className:"hub-remote__close",type:"button",onClick:u,"aria-label":"Close phone access",children:"×"})]}),!s&&!c&&h.jsx("p",{className:"hub-muted",children:"Loading…"}),c&&h.jsx("p",{className:"hub-error",role:"alert",children:c}),(s==null?void 0:s.active)&&h.jsxs("div",{className:"hub-remote__active",children:[h.jsx("p",{className:"hub-remote__url",children:s.active.url}),C&&h.jsx("img",{className:"hub-remote__qr",src:C,alt:"QR code for phone access URL"}),h.jsx("button",{type:"button",onClick:D,disabled:g,children:"Turn off"})]}),s&&!s.active&&h.jsxs(h.Fragment,{children:[h.jsx("ul",{className:"hub-remote__options",children:s.options.map($=>h.jsx("li",{children:h.jsxs("button",{type:"button",disabled:!$.ready||g,onClick:()=>H($.id),children:[$.label,$.ready?"":" (not ready)"]})},$.id))}),!s.options.some($=>$.ready)&&s.guide&&(/^https?:\/\//.test(s.guide)?h.jsx("p",{className:"hub-muted",children:h.jsx("a",{href:s.guide,target:"_blank",rel:"noreferrer",children:"Set up phone access"})}):h.jsx("p",{className:"hub-muted",children:s.guide}))]})]})}const Tf="meldivo.machine",fm=5;function dm(u){return u.id?`@${u.id}/`:""}function hm({host:u,sessions:s,selected:l,onSelect:c}){const d=s.filter(L=>L.open).length,g=s.some(L=>L.busy),x=s.reduce((L,R)=>Math.max(L,R.updatedAt),0),C=u.online?g?"hub-dot--busy":"hub-dot--online":"hub-dot--idle";return h.jsxs("button",{type:"button",role:"tab","aria-selected":l,className:`hub-machine${l?" hub-machine--selected":""}${u.online?"":" hub-machine--offline"}`,onClick:c,children:[h.jsxs("span",{className:"hub-machine__name",children:[h.jsx("span",{className:`hub-dot ${C}`,"aria-hidden":"true"}),u.name]}),h.jsx("span",{className:"hub-machine__meta",children:u.online?h.jsxs(h.Fragment,{children:[s.length," session",s.length===1?"":"s",d>0&&h.jsxs(h.Fragment,{children:[" · ",d," open"]})]}):"offline"}),u.online&&x>0&&h.jsxs("span",{className:"hub-machine__meta",children:["active ",Kf(x)]})]})}const Mu=1440*60*1e3;function pm(u,s){const l=Date.now()-u;return s==="today"?new Date(u).toDateString()===new Date().toDateString():s==="week"?l<=7*Mu:s==="month"?l<=30*Mu:s==="older"?l>30*Mu:!0}function mm(u,s){const l=[...u];return s==="title"?l.sort((c,d)=>(c.title||"").localeCompare(d.title||"",void 0,{sensitivity:"base"})):l.sort((c,d)=>s==="oldest"?c.updatedAt-d.updatedAt:d.updatedAt-c.updatedAt),l}function vm({session:u}){const s=am(u);return h.jsx("li",{children:h.jsxs("button",{type:"button",className:"hub-session",onClick:()=>Qf(u.key),children:[h.jsx("span",{className:s.className,"aria-hidden":"true",title:s.label}),h.jsxs("span",{className:"hub-session__body",children:[h.jsx("span",{className:"hub-session__title",children:u.title||"(untitled)"}),h.jsxs("span",{className:"hub-session__meta",children:[h.jsx("span",{className:"hub-session__badge",children:Ks[u.harness]}),h.jsx("span",{className:"hub-session__time",children:Kf(u.updatedAt)})]}),u.open&&h.jsx("span",{className:"hub-session__hint",children:"open in a terminal · continues as a voice copy"})]})]})})}function qf(u,s){if(s.length===0)return!0;const l=`${u.title} ${Mi(u.cwd)} ${Ks[u.harness]}`.toLowerCase();return s.every(c=>l.includes(c))}function bf(u){return u.trim().toLowerCase().split(/\s+/).filter(Boolean)}function gm({cwd:u,sessions:s,total:l}){const[c,d]=_.useState(""),g=bf(c),x=s.filter(R=>qf(R,g)),C=Mi(u),L=C==="~"?"Home folder":C||"(no folder)";return h.jsxs("section",{className:"hub-folder","aria-label":L,children:[h.jsxs("h3",{className:"hub-folder__title",children:[h.jsx("span",{children:L}),h.jsx("span",{className:"hub-folder__count",children:s.length===l?l:`${s.length} of ${l}`})]}),s.length>fm&&h.jsx("input",{type:"search",className:"hub-folder__search",placeholder:`Search in ${L}`,value:c,onChange:R=>d(R.target.value),"aria-label":`Search sessions in ${L}`,autoComplete:"off"}),x.length===0?h.jsx("p",{className:"hub-muted hub-folder__none",children:"No sessions here match."}):h.jsx("ul",{className:"hub-sessions hub-folder__list",children:x.map(R=>h.jsx(vm,{session:R},R.key))})]})}function ym({host:u,folders:s,agent:l,folder:c,onClose:d}){var H,D;const g=[...u.harnesses].filter(O=>O.available).sort((O,$)=>Vu.indexOf(O.id)-Vu.indexOf($.id)),[x,C]=_.useState(((H=g.find(O=>O.id===l))==null?void 0:H.id)??((D=g[0])==null?void 0:D.id)),[L,R]=_.useState(c==="all"?"":c);return g.length===0?h.jsx("div",{className:"hub-newchat",children:h.jsxs("p",{className:"hub-muted",children:["No coding agents are installed on ",u.name,"."]})}):h.jsxs("div",{className:"hub-newchat",role:"group","aria-label":"New chat",children:[h.jsxs("div",{className:"hub-newchat__row",children:[h.jsx("span",{className:"hub-newchat__label",children:"Agent"}),h.jsx("div",{className:"hub-chips",children:g.map(O=>h.jsx("button",{type:"button",className:`hub-chip${x===O.id?" hub-chip--on":""}`,"aria-pressed":x===O.id,onClick:()=>C(O.id),children:O.label},O.id))})]}),h.jsxs("label",{className:"hub-newchat__row",children:[h.jsx("span",{className:"hub-newchat__label",children:"Folder"}),h.jsxs("select",{className:"hub-select hub-select--wide",value:L,onChange:O=>R(O.target.value),children:[h.jsx("option",{value:"",children:"Home folder"}),s.map(O=>h.jsx("option",{value:O,children:Mi(O)},O))]})]}),h.jsxs("div",{className:"hub-newchat__actions",children:[h.jsx("button",{type:"button",className:"hub-more",onClick:d,children:"Cancel"}),h.jsx("button",{type:"button",className:"hub-primary",disabled:!x,onClick:()=>x&&Qf(`${dm(u)}new:${x}`,L||void 0),children:"Start talking"})]})]})}function wm({host:u,sessions:s}){const[l,c]=_.useState(""),[d,g]=_.useState("all"),[x,C]=_.useState("all"),[L,R]=_.useState("any"),[H,D]=_.useState("newest"),[O,$]=_.useState(!1),[X,se]=_.useState(!1);if(_.useEffect(()=>{c(""),g("all"),C("all"),R("any"),D("newest"),$(!1),se(!1)},[u.id]),!u.online)return h.jsxs("p",{className:"hub-empty",children:[u.name," is offline. Its sessions appear here as soon as it reconnects."]});const N=new Map;for(const W of s)N.set(W.cwd,Math.max(N.get(W.cwd)??0,W.updatedAt));const Y=[...N.entries()].sort((W,_e)=>_e[1]-W[1]).map(([W])=>W),b=Y.filter(W=>W&&Mi(W)!=="~"),ye=Vu.filter(W=>s.some(_e=>_e.harness===W)),I=bf(l),K=mm(s.filter(W=>d!=="all"&&W.harness!==d||x!=="all"&&W.cwd!==x||O&&!W.open||!pm(W.updatedAt,L)?!1:qf(W,I)),H),U=s.filter(W=>W.open).length,ne=d!=="all"||x!=="all"||L!=="any"||O||I.length>0,me=[];for(const W of K){const _e=me.find(Ge=>Ge.cwd===W.cwd);_e?_e.sessions.push(W):me.push({cwd:W.cwd,sessions:[W]})}const ke=new Map;for(const W of s)ke.set(W.cwd,(ke.get(W.cwd)??0)+1);return h.jsxs("div",{className:"hub-panel",role:"tabpanel",children:[h.jsxs("div",{className:"hub-search",children:[h.jsx("input",{type:"search",className:"hub-search__input",placeholder:`Search all ${s.length} sessions`,value:l,onChange:W=>c(W.target.value),"aria-label":`Search all sessions on ${u.name}`,autoComplete:"off"}),h.jsx("button",{type:"button",className:"hub-primary","aria-expanded":X,onClick:()=>se(!X),children:X?"Close":"New chat"})]}),X&&h.jsx(ym,{host:u,folders:b,agent:d,folder:x,onClose:()=>se(!1)}),s.length>0&&h.jsxs("div",{className:"hub-filters",children:[h.jsxs("div",{className:"hub-chips",role:"group","aria-label":"Filter by agent",children:[h.jsx("button",{type:"button",className:`hub-chip${d==="all"?" hub-chip--on":""}`,"aria-pressed":d==="all",onClick:()=>g("all"),children:"All agents"}),ye.map(W=>h.jsxs("button",{type:"button",className:`hub-chip${d===W?" hub-chip--on":""}`,"aria-pressed":d===W,onClick:()=>g(d===W?"all":W),children:[Ks[W]," ",h.jsx("span",{className:"hub-chip__count",children:s.filter(_e=>_e.harness===W).length})]},W)),h.jsxs("button",{type:"button",className:`hub-chip${O?" hub-chip--on":""}`,"aria-pressed":O,disabled:U===0&&!O,onClick:()=>$(!O),children:["Open now ",h.jsx("span",{className:"hub-chip__count",children:U})]})]}),h.jsxs("div",{className:"hub-selects",children:[h.jsxs("select",{className:"hub-select",value:x,onChange:W=>C(W.target.value),"aria-label":"Folder",children:[h.jsxs("option",{value:"all",children:["All folders (",Y.length,")"]}),Y.map(W=>h.jsx("option",{value:W,children:Mi(W)||"(no folder)"},W))]}),h.jsxs("select",{className:"hub-select",value:L,onChange:W=>R(W.target.value),"aria-label":"Date",children:[h.jsx("option",{value:"any",children:"Any time"}),h.jsx("option",{value:"today",children:"Today"}),h.jsx("option",{value:"week",children:"Past 7 days"}),h.jsx("option",{value:"month",children:"Past 30 days"}),h.jsx("option",{value:"older",children:"Older than 30 days"})]}),h.jsxs("select",{className:"hub-select",value:H,onChange:W=>D(W.target.value),"aria-label":"Sort",children:[h.jsx("option",{value:"newest",children:"Newest first"}),h.jsx("option",{value:"oldest",children:"Oldest first"}),h.jsx("option",{value:"title",children:"Title A–Z"})]})]})]}),s.length===0&&h.jsxs("p",{className:"hub-empty",children:["No sessions on ",u.name," yet. Tap New chat to start one."]}),s.length>0&&K.length===0&&h.jsxs("p",{className:"hub-empty",children:["No sessions match. ",h.jsx("button",{type:"button",className:"hub-link",onClick:()=>{c(""),g("all"),C("all"),R("any"),$(!1)},children:"Clear filters"})]}),ne&&K.length>0&&h.jsxs("p",{className:"hub-count",children:[K.length," of ",s.length," sessions"]}),h.jsx("div",{className:"hub-folders",children:me.map(W=>h.jsx(gm,{cwd:W.cwd,sessions:W.sessions,total:ke.get(W.cwd)??W.sessions.length},`${u.id}|${W.cwd}`))})]})}function Sm(){const[u,s]=_.useState(null),[l,c]=_.useState(""),[d,g]=_.useState(!1),[x,C]=_.useState({ready:!0,downloading:!1}),[L,R]=_.useState(!1),[H,D]=_.useState(()=>new URLSearchParams(window.location.search).get("settings")==="speech"),[O,$]=_.useState(()=>{try{return window.localStorage.getItem(Tf)}catch{return null}}),X=_.useRef(!0);if(_.useEffect(()=>(X.current=!0,()=>{X.current=!1}),[]),_.useEffect(()=>{let U=!1;const ne=()=>{fetch("/api/sessions",{headers:Fe()}).then(mn).then(async ke=>{if(!ke.ok)throw new Error("Could not load sessions.");const W=await ke.json();U||(s(W),c(""))}).catch(ke=>{if(!U){if(ke instanceof pn){g(!0);return}c(ke instanceof Error?ke.message:"Could not load sessions.")}})};ne();const me=window.setInterval(ne,lm);return()=>{U=!0,window.clearInterval(me)}},[]),_.useEffect(()=>{let U=!1;const ne=()=>{fetch("/api/health",{headers:Fe()}).then(async ke=>{const W=await ke.json().catch(()=>({}));if(U)return;const _e=W.speech??{};C({ready:_e.ready!==!1,downloading:_e.downloading===!0,progress:typeof _e.progress=="number"?_e.progress:void 0,error:typeof _e.error=="string"?_e.error:void 0})}).catch(()=>{})};ne();const me=window.setInterval(ne,um);return()=>{U=!0,window.clearInterval(me)}},[]),d)return h.jsx(Wf,{});const se=(u==null?void 0:u.hosts)??(u?[{id:"",name:u.machine,online:!0,harnesses:u.harnesses}]:[]),N=(u==null?void 0:u.sessions)??[],Y=U=>N.filter(ne=>(ne.host??"")===U.id),b=se.filter(U=>U.id!==""||se.length===1||U.harnesses.some(ne=>ne.available)||Y(U).length>0),ye=b.find(U=>U.id===O)??b.find(U=>U.online)??b[0],I=U=>{$(U);try{window.localStorage.setItem(Tf,U)}catch{}},K=x.ready?"Speech ready":x.downloading?`Downloading voice models…${typeof x.progress=="number"?` ${Math.round(x.progress)}%`:""}`:"Speech offline";return h.jsxs("main",{className:"hub-page",children:[h.jsxs("header",{className:"hub-header",children:[h.jsxs("h1",{className:"hub-title",children:[h.jsx("img",{className:"hub-logo",src:"/logo-192.png",alt:"",width:30,height:30}),b.length>1?"Meldivo":(u==null?void 0:u.machine)??"Meldivo"]}),h.jsx("p",{className:`hub-speech-status${x.ready?"":" hub-speech-status--warn"}`,role:"status",children:x.error||K}),h.jsx("button",{type:"button",className:"hub-remote-button",onClick:()=>{R(!1),D(!0)},children:"Speech"}),h.jsx("button",{type:"button",className:"hub-remote-button hub-remote-button--next",onClick:()=>{D(!1),R(!0)},children:"Phone access"})]}),l&&h.jsx("p",{className:"hub-error",role:"alert",children:l}),!u&&!l&&h.jsx("p",{className:"hub-empty",children:"Loading…"}),b.length>1&&h.jsx("nav",{className:"hub-machines",role:"tablist","aria-label":"Machines",children:b.map(U=>h.jsx(hm,{host:U,sessions:Y(U),selected:U===ye,onSelect:()=>I(U.id)},U.id||"local"))}),ye&&h.jsx(wm,{host:ye,sessions:Y(ye)}),L&&h.jsx(cm,{onClose:()=>R(!1)}),H&&h.jsx(sm,{onClose:()=>D(!1)})]})}Ap();const Gf=new URLSearchParams(window.location.search),jf=Gf.get("session");ah.createRoot(document.getElementById("root")).render(jf?h.jsx(om,{sessionKey:jf,folder:Gf.get("folder")??void 0}):h.jsx(Sm,{}));