(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))r(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"&&r(x)}).observe(document,{childList:!0,subtree:!0});function c(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 r(d){if(d.ep)return;d.ep=!0;const g=c(d);fetch(d.href,g)}})();function pc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Wr={exports:{}},Pn={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var m0;function Eg(){if(m0)return Pn;m0=1;var s=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(r,d,g){var x=null;if(g!==void 0&&(x=""+g),d.key!==void 0&&(x=""+d.key),"key"in d){g={};for(var E in d)E!=="key"&&(g[E]=d[E])}else g=d;return d=g.ref,{$$typeof:s,type:r,key:x,ref:d!==void 0?d:null,props:g}}return Pn.Fragment=i,Pn.jsx=c,Pn.jsxs=c,Pn}var g0;function wg(){return g0||(g0=1,Wr.exports=Eg()),Wr.exports}var f=wg(),Pr={exports:{}},he={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var p0;function Mg(){if(p0)return he;p0=1;var s=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),x=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),j=Symbol.iterator;function C(y){return y===null||typeof y!="object"?null:(y=j&&y[j]||y["@@iterator"],typeof y=="function"?y:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,G={};function X(y,z,O){this.props=y,this.context=z,this.refs=G,this.updater=O||B}X.prototype.isReactComponent={},X.prototype.setState=function(y,z){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,z,"setState")},X.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function H(){}H.prototype=X.prototype;function J(y,z,O){this.props=y,this.context=z,this.refs=G,this.updater=O||B}var F=J.prototype=new H;F.constructor=J,T(F,X.prototype),F.isPureReactComponent=!0;var Z=Array.isArray,Q={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function se(y,z,O,Y,P,ue){return O=ue.ref,{$$typeof:s,type:y,key:z,ref:O!==void 0?O:null,props:ue}}function le(y,z){return se(y.type,z,void 0,void 0,void 0,y.props)}function ne(y){return typeof y=="object"&&y!==null&&y.$$typeof===s}function I(y){var z={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(O){return z[O]})}var ae=/\/+/g;function de(y,z){return typeof y=="object"&&y!==null&&y.key!=null?I(""+y.key):z.toString(36)}function Ue(){}function W(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(Ue,Ue):(y.status="pending",y.then(function(z){y.status==="pending"&&(y.status="fulfilled",y.value=z)},function(z){y.status==="pending"&&(y.status="rejected",y.reason=z)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function V(y,z,O,Y,P){var ue=typeof y;(ue==="undefined"||ue==="boolean")&&(y=null);var ie=!1;if(y===null)ie=!0;else switch(ue){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(y.$$typeof){case s:case i:ie=!0;break;case S:return ie=y._init,V(ie(y._payload),z,O,Y,P)}}if(ie)return P=P(y),ie=Y===""?"."+de(y,0):Y,Z(P)?(O="",ie!=null&&(O=ie.replace(ae,"$&/")+"/"),V(P,z,O,"",function(qe){return qe})):P!=null&&(ne(P)&&(P=le(P,O+(P.key==null||y&&y.key===P.key?"":(""+P.key).replace(ae,"$&/")+"/")+ie)),z.push(P)),1;ie=0;var De=Y===""?".":Y+":";if(Z(y))for(var Se=0;Se<y.length;Se++)Y=y[Se],ue=De+de(Y,Se),ie+=V(Y,z,O,ue,P);else if(Se=C(y),typeof Se=="function")for(y=Se.call(y),Se=0;!(Y=y.next()).done;)Y=Y.value,ue=De+de(Y,Se++),ie+=V(Y,z,O,ue,P);else if(ue==="object"){if(typeof y.then=="function")return V(W(y),z,O,Y,P);throw z=String(y),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return ie}function w(y,z,O){if(y==null)return y;var Y=[],P=0;return V(y,Y,"","",function(ue){return z.call(O,ue,P++)}),Y}function U(y){if(y._status===-1){var z=y._result;z=z(),z.then(function(O){(y._status===0||y._status===-1)&&(y._status=1,y._result=O)},function(O){(y._status===0||y._status===-1)&&(y._status=2,y._result=O)}),y._status===-1&&(y._status=0,y._result=z)}if(y._status===1)return y._result.default;throw y._result}var A=typeof reportError=="function"?reportError:function(y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof y=="object"&&y!==null&&typeof y.message=="string"?String(y.message):String(y),error:y});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",y);return}console.error(y)};function K(){}return he.Children={map:w,forEach:function(y,z,O){w(y,function(){z.apply(this,arguments)},O)},count:function(y){var z=0;return w(y,function(){z++}),z},toArray:function(y){return w(y,function(z){return z})||[]},only:function(y){if(!ne(y))throw Error("React.Children.only expected to receive a single React element child.");return y}},he.Component=X,he.Fragment=c,he.Profiler=d,he.PureComponent=J,he.StrictMode=r,he.Suspense=v,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,he.__COMPILER_RUNTIME={__proto__:null,c:function(y){return Q.H.useMemoCache(y)}},he.cache=function(y){return function(){return y.apply(null,arguments)}},he.cloneElement=function(y,z,O){if(y==null)throw Error("The argument must be a React element, but you passed "+y+".");var Y=T({},y.props),P=y.key,ue=void 0;if(z!=null)for(ie in z.ref!==void 0&&(ue=void 0),z.key!==void 0&&(P=""+z.key),z)!ee.call(z,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&z.ref===void 0||(Y[ie]=z[ie]);var ie=arguments.length-2;if(ie===1)Y.children=O;else if(1<ie){for(var De=Array(ie),Se=0;Se<ie;Se++)De[Se]=arguments[Se+2];Y.children=De}return se(y.type,P,void 0,void 0,ue,Y)},he.createContext=function(y){return y={$$typeof:x,_currentValue:y,_currentValue2:y,_threadCount:0,Provider:null,Consumer:null},y.Provider=y,y.Consumer={$$typeof:g,_context:y},y},he.createElement=function(y,z,O){var Y,P={},ue=null;if(z!=null)for(Y in z.key!==void 0&&(ue=""+z.key),z)ee.call(z,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(P[Y]=z[Y]);var ie=arguments.length-2;if(ie===1)P.children=O;else if(1<ie){for(var De=Array(ie),Se=0;Se<ie;Se++)De[Se]=arguments[Se+2];P.children=De}if(y&&y.defaultProps)for(Y in ie=y.defaultProps,ie)P[Y]===void 0&&(P[Y]=ie[Y]);return se(y,ue,void 0,void 0,null,P)},he.createRef=function(){return{current:null}},he.forwardRef=function(y){return{$$typeof:E,render:y}},he.isValidElement=ne,he.lazy=function(y){return{$$typeof:S,_payload:{_status:-1,_result:y},_init:U}},he.memo=function(y,z){return{$$typeof:h,type:y,compare:z===void 0?null:z}},he.startTransition=function(y){var z=Q.T,O={};Q.T=O;try{var Y=y(),P=Q.S;P!==null&&P(O,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(K,A)}catch(ue){A(ue)}finally{Q.T=z}},he.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},he.use=function(y){return Q.H.use(y)},he.useActionState=function(y,z,O){return Q.H.useActionState(y,z,O)},he.useCallback=function(y,z){return Q.H.useCallback(y,z)},he.useContext=function(y){return Q.H.useContext(y)},he.useDebugValue=function(){},he.useDeferredValue=function(y,z){return Q.H.useDeferredValue(y,z)},he.useEffect=function(y,z,O){var Y=Q.H;if(typeof O=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Y.useEffect(y,z)},he.useId=function(){return Q.H.useId()},he.useImperativeHandle=function(y,z,O){return Q.H.useImperativeHandle(y,z,O)},he.useInsertionEffect=function(y,z){return Q.H.useInsertionEffect(y,z)},he.useLayoutEffect=function(y,z){return Q.H.useLayoutEffect(y,z)},he.useMemo=function(y,z){return Q.H.useMemo(y,z)},he.useOptimistic=function(y,z){return Q.H.useOptimistic(y,z)},he.useReducer=function(y,z,O){return Q.H.useReducer(y,z,O)},he.useRef=function(y){return Q.H.useRef(y)},he.useState=function(y){return Q.H.useState(y)},he.useSyncExternalStore=function(y,z,O){return Q.H.useSyncExternalStore(y,z,O)},he.useTransition=function(){return Q.H.useTransition()},he.version="19.1.1",he}var v0;function vc(){return v0||(v0=1,Pr.exports=Mg()),Pr.exports}var p=vc();const jg=pc(p);var Ir={exports:{}},In={},ec={exports:{}},tc={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var x0;function Ng(){return x0||(x0=1,function(s){function i(w,U){var A=w.length;w.push(U);e:for(;0<A;){var K=A-1>>>1,y=w[K];if(0<d(y,U))w[K]=U,w[A]=y,A=K;else break e}}function c(w){return w.length===0?null:w[0]}function r(w){if(w.length===0)return null;var U=w[0],A=w.pop();if(A!==U){w[0]=A;e:for(var K=0,y=w.length,z=y>>>1;K<z;){var O=2*(K+1)-1,Y=w[O],P=O+1,ue=w[P];if(0>d(Y,A))P<y&&0>d(ue,Y)?(w[K]=ue,w[P]=A,K=P):(w[K]=Y,w[O]=A,K=O);else if(P<y&&0>d(ue,A))w[K]=ue,w[P]=A,K=P;else break e}}return U}function d(w,U){var A=w.sortIndex-U.sortIndex;return A!==0?A:w.id-U.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;s.unstable_now=function(){return g.now()}}else{var x=Date,E=x.now();s.unstable_now=function(){return x.now()-E}}var v=[],h=[],S=1,j=null,C=3,B=!1,T=!1,G=!1,X=!1,H=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;function Z(w){for(var U=c(h);U!==null;){if(U.callback===null)r(h);else if(U.startTime<=w)r(h),U.sortIndex=U.expirationTime,i(v,U);else break;U=c(h)}}function Q(w){if(G=!1,Z(w),!T)if(c(v)!==null)T=!0,ee||(ee=!0,de());else{var U=c(h);U!==null&&V(Q,U.startTime-w)}}var ee=!1,se=-1,le=5,ne=-1;function I(){return X?!0:!(s.unstable_now()-ne<le)}function ae(){if(X=!1,ee){var w=s.unstable_now();ne=w;var U=!0;try{e:{T=!1,G&&(G=!1,J(se),se=-1),B=!0;var A=C;try{t:{for(Z(w),j=c(v);j!==null&&!(j.expirationTime>w&&I());){var K=j.callback;if(typeof K=="function"){j.callback=null,C=j.priorityLevel;var y=K(j.expirationTime<=w);if(w=s.unstable_now(),typeof y=="function"){j.callback=y,Z(w),U=!0;break t}j===c(v)&&r(v),Z(w)}else r(v);j=c(v)}if(j!==null)U=!0;else{var z=c(h);z!==null&&V(Q,z.startTime-w),U=!1}}break e}finally{j=null,C=A,B=!1}U=void 0}}finally{U?de():ee=!1}}}var de;if(typeof F=="function")de=function(){F(ae)};else if(typeof MessageChannel<"u"){var Ue=new MessageChannel,W=Ue.port2;Ue.port1.onmessage=ae,de=function(){W.postMessage(null)}}else de=function(){H(ae,0)};function V(w,U){se=H(function(){w(s.unstable_now())},U)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(w){w.callback=null},s.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<w?Math.floor(1e3/w):5},s.unstable_getCurrentPriorityLevel=function(){return C},s.unstable_next=function(w){switch(C){case 1:case 2:case 3:var U=3;break;default:U=C}var A=C;C=U;try{return w()}finally{C=A}},s.unstable_requestPaint=function(){X=!0},s.unstable_runWithPriority=function(w,U){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var A=C;C=w;try{return U()}finally{C=A}},s.unstable_scheduleCallback=function(w,U,A){var K=s.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?K+A:K):A=K,w){case 1:var y=-1;break;case 2:y=250;break;case 5:y=1073741823;break;case 4:y=1e4;break;default:y=5e3}return y=A+y,w={id:S++,callback:U,priorityLevel:w,startTime:A,expirationTime:y,sortIndex:-1},A>K?(w.sortIndex=A,i(h,w),c(v)===null&&w===c(h)&&(G?(J(se),se=-1):G=!0,V(Q,A-K))):(w.sortIndex=y,i(v,w),T||B||(T=!0,ee||(ee=!0,de()))),w},s.unstable_shouldYield=I,s.unstable_wrapCallback=function(w){var U=C;return function(){var A=C;C=U;try{return w.apply(this,arguments)}finally{C=A}}}}(tc)),tc}var y0;function Tg(){return y0||(y0=1,ec.exports=Ng()),ec.exports}var lc={exports:{}},dt={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var b0;function Cg(){if(b0)return dt;b0=1;var s=vc();function i(v){var h="https://react.dev/errors/"+v;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)h+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+v+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var r={d:{f:c,r:function(){throw Error(i(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},d=Symbol.for("react.portal");function g(v,h,S){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:v,containerInfo:h,implementation:S}}var x=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function E(v,h){if(v==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,dt.createPortal=function(v,h){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(i(299));return g(v,h,null,S)},dt.flushSync=function(v){var h=x.T,S=r.p;try{if(x.T=null,r.p=2,v)return v()}finally{x.T=h,r.p=S,r.d.f()}},dt.preconnect=function(v,h){typeof v=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(v,h))},dt.prefetchDNS=function(v){typeof v=="string"&&r.d.D(v)},dt.preinit=function(v,h){if(typeof v=="string"&&h&&typeof h.as=="string"){var S=h.as,j=E(S,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,B=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;S==="style"?r.d.S(v,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:j,integrity:C,fetchPriority:B}):S==="script"&&r.d.X(v,{crossOrigin:j,integrity:C,fetchPriority:B,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},dt.preinitModule=function(v,h){if(typeof v=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var S=E(h.as,h.crossOrigin);r.d.M(v,{crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(v)},dt.preload=function(v,h){if(typeof v=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var S=h.as,j=E(S,h.crossOrigin);r.d.L(v,S,{crossOrigin:j,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},dt.preloadModule=function(v,h){if(typeof v=="string")if(h){var S=E(h.as,h.crossOrigin);r.d.m(v,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(v)},dt.requestFormReset=function(v){r.d.r(v)},dt.unstable_batchedUpdates=function(v,h){return v(h)},dt.useFormState=function(v,h,S){return x.H.useFormState(v,h,S)},dt.useFormStatus=function(){return x.H.useHostTransitionStatus()},dt.version="19.1.1",dt}var S0;function kg(){if(S0)return lc.exports;S0=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(i){console.error(i)}}return s(),lc.exports=Cg(),lc.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var E0;function Ag(){if(E0)return In;E0=1;var s=Tg(),i=vc(),c=kg();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function g(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function x(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 E(e){if(g(e)!==e)throw Error(r(188))}function v(e){var t=e.alternate;if(!t){if(t=g(e),t===null)throw Error(r(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===l)return E(n),e;if(u===a)return E(n),t;u=u.sibling}throw Error(r(188))}if(l.return!==a.return)l=n,a=u;else{for(var o=!1,m=n.child;m;){if(m===l){o=!0,l=n,a=u;break}if(m===a){o=!0,a=n,l=u;break}m=m.sibling}if(!o){for(m=u.child;m;){if(m===l){o=!0,l=u,a=n;break}if(m===a){o=!0,a=u,l=n;break}m=m.sibling}if(!o)throw Error(r(189))}}if(l.alternate!==a)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?e:t}function h(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=h(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,j=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),J=Symbol.for("react.consumer"),F=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function de(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var Ue=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case X:return"Profiler";case G:return"StrictMode";case Q:return"Suspense";case ee:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case F:return(e.displayName||"Context")+".Provider";case J:return(e._context.displayName||"Context")+".Consumer";case Z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var V=Array.isArray,w=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A={pending:!1,data:null,method:null,action:null},K=[],y=-1;function z(e){return{current:e}}function O(e){0>y||(e.current=K[y],K[y]=null,y--)}function Y(e,t){y++,K[y]=e.current,e.current=t}var P=z(null),ue=z(null),ie=z(null),De=z(null);function Se(e,t){switch(Y(ie,t),Y(ue,e),Y(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$d(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$d(t),e=Gd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(P),Y(P,e)}function qe(){O(P),O(ue),O(ie)}function Ze(e){e.memoizedState!==null&&Y(De,e);var t=P.current,l=Gd(t,e.type);t!==l&&(Y(ue,e),Y(P,l))}function He(e){ue.current===e&&(O(P),O(ue)),De.current===e&&(O(De),Qn._currentValue=A)}var tt=Object.prototype.hasOwnProperty,qt=s.unstable_scheduleCallback,Tt=s.unstable_cancelCallback,ds=s.unstable_shouldYield,hs=s.unstable_requestPaint,Ct=s.unstable_now,Hu=s.unstable_getCurrentPriorityLevel,ln=s.unstable_ImmediatePriority,Yt=s.unstable_UserBlockingPriority,$t=s.unstable_NormalPriority,ms=s.unstable_LowPriority,kt=s.unstable_IdlePriority,Gl=s.log,Lu=s.unstable_setDisableYieldValue,Xl=null,ht=null;function Kt(e){if(typeof Gl=="function"&&Lu(e),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(Xl,e)}catch{}}var mt=Math.clz32?Math.clz32:Yu,Bu=Math.log,qu=Math.LN2;function Yu(e){return e>>>=0,e===0?32:31-(Bu(e)/qu|0)|0}var da=256,ha=4194304;function tl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Vl(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var m=a&134217727;return m!==0?(a=m&~u,a!==0?n=tl(a):(o&=m,o!==0?n=tl(o):l||(l=m&~e,l!==0&&(n=tl(l))))):(m=a&~u,m!==0?n=tl(m):o!==0?n=tl(o):l||(l=a&~e,l!==0&&(n=tl(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function Zl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $u(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gs(){var e=da;return da<<=1,(da&4194048)===0&&(da=256),e}function ps(){var e=ha;return ha<<=1,(ha&62914560)===0&&(ha=4194304),e}function pe(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function we(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,l,a,n,u){var o=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var m=e.entanglements,b=e.expirationTimes,R=e.hiddenUpdates;for(l=o&~l;0<l;){var L=31-mt(l),$=1<<L;m[L]=0,b[L]=-1;var D=R[L];if(D!==null)for(R[L]=null,L=0;L<D.length;L++){var _=D[L];_!==null&&(_.lane&=-536870913)}l&=~$}a!==0&&Qe(e,a,0),u!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=u&~(o&~t))}function Qe(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-mt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&4194090}function je(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-mt(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function _e(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ye(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Fe(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:r0(e.type))}function Ge(e,t){var l=U.p;try{return U.p=e,t()}finally{U.p=l}}var Le=Math.random().toString(36).slice(2),Ne="__reactFiber$"+Le,lt="__reactProps$"+Le,At="__reactContainer$"+Le,Ql="__reactEvents$"+Le,Cc="__reactListeners$"+Le,Gu="__reactHandles$"+Le,ma="__reactResources$"+Le,an="__reactMarker$"+Le;function Xu(e){delete e[Ne],delete e[lt],delete e[Ql],delete e[Cc],delete e[Gu]}function ga(e){var t=e[Ne];if(t)return t;for(var l=e.parentNode;l;){if(t=l[At]||l[Ne]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Qd(e);e!==null;){if(l=e[Ne])return l;e=Qd(e)}return t}e=l,l=e.parentNode}return null}function pa(e){if(e=e[Ne]||e[At]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function nn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function va(e){var t=e[ma];return t||(t=e[ma]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function at(e){e[an]=!0}var kc=new Set,Ac={};function Kl(e,t){xa(e,t),xa(e+"Capture",t)}function xa(e,t){for(Ac[e]=t,e=0;e<t.length;e++)kc.add(t[e])}var mh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Rc={},Oc={};function gh(e){return tt.call(Oc,e)?!0:tt.call(Rc,e)?!1:mh.test(e)?Oc[e]=!0:(Rc[e]=!0,!1)}function vs(e,t,l){if(gh(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function xs(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function ll(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}var Vu,Dc;function ya(e){if(Vu===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Vu=t&&t[1]||"",Dc=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Vu+e+Dc}var Zu=!1;function Qu(e,t){if(!e||Zu)return"";Zu=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(_){var D=_}Reflect.construct(e,[],$)}else{try{$.call()}catch(_){D=_}e.call($.prototype)}}else{try{throw Error()}catch(_){D=_}($=e())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(_){if(_&&D&&typeof _.stack=="string")return[_.stack,D.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),o=u[0],m=u[1];if(o&&m){var b=o.split(`
`),R=m.split(`
`);for(n=a=0;a<b.length&&!b[a].includes("DetermineComponentFrameRoot");)a++;for(;n<R.length&&!R[n].includes("DetermineComponentFrameRoot");)n++;if(a===b.length||n===R.length)for(a=b.length-1,n=R.length-1;1<=a&&0<=n&&b[a]!==R[n];)n--;for(;1<=a&&0<=n;a--,n--)if(b[a]!==R[n]){if(a!==1||n!==1)do if(a--,n--,0>n||b[a]!==R[n]){var L=`
`+b[a].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=a&&0<=n);break}}}finally{Zu=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ya(l):""}function ph(e){switch(e.tag){case 26:case 27:case 5:return ya(e.type);case 16:return ya("Lazy");case 13:return ya("Suspense");case 19:return ya("SuspenseList");case 0:case 15:return Qu(e.type,!1);case 11:return Qu(e.type.render,!1);case 1:return Qu(e.type,!0);case 31:return ya("Activity");default:return""}}function _c(e){try{var t="";do t+=ph(e),e=e.return;while(e);return t}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}function Rt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vh(e){var t=zc(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var n=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(o){a=""+o,u.call(this,o)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ys(e){e._valueTracker||(e._valueTracker=vh(e))}function Uc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=zc(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function bs(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}}var xh=/[\n"\\]/g;function Ot(e){return e.replace(xh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ku(e,t,l,a,n,u,o,m){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rt(t)):e.value!==""+Rt(t)&&(e.value=""+Rt(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Ju(e,o,Rt(t)):l!=null?Ju(e,o,Rt(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Rt(m):e.removeAttribute("name")}function Hc(e,t,l,a,n,u,o,m){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null))return;l=l!=null?""+Rt(l):"",t=t!=null?""+Rt(t):l,m||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=m?e.checked:!!a,e.defaultChecked=!!a,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o)}function Ju(e,t,l){t==="number"&&bs(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ba(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+Rt(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Lc(e,t,l){if(t!=null&&(t=""+Rt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Rt(l):""}function Bc(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(r(92));if(V(a)){if(1<a.length)throw Error(r(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Rt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a)}function Sa(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var yh=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qc(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||yh.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Yc(e,t,l){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&qc(e,n,a)}else for(var u in t)t.hasOwnProperty(u)&&qc(e,u,t[u])}function Fu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Sh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ss(e){return Sh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Wu=null;function Pu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ea=null,wa=null;function $c(e){var t=pa(e);if(t&&(e=t.stateNode)){var l=e[lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ku(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ot(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[lt]||null;if(!n)throw Error(r(90));Ku(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&Uc(a)}break e;case"textarea":Lc(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&ba(e,!!l.multiple,t,!1)}}}var Iu=!1;function Gc(e,t,l){if(Iu)return e(t,l);Iu=!0;try{var a=e(t);return a}finally{if(Iu=!1,(Ea!==null||wa!==null)&&(uu(),Ea&&(t=Ea,e=wa,wa=Ea=null,$c(t),e)))for(t=0;t<e.length;t++)$c(e[t])}}function sn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[lt]||null;if(a===null)return null;l=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(r(231,t,typeof l));return l}var al=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ei=!1;if(al)try{var un={};Object.defineProperty(un,"passive",{get:function(){ei=!0}}),window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{ei=!1}var Sl=null,ti=null,Es=null;function Xc(){if(Es)return Es;var e,t=ti,l=t.length,a,n="value"in Sl?Sl.value:Sl.textContent,u=n.length;for(e=0;e<l&&t[e]===n[e];e++);var o=l-e;for(a=1;a<=o&&t[l-a]===n[u-a];a++);return Es=n.slice(e,1<a?1-a:void 0)}function ws(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 Ms(){return!0}function Vc(){return!1}function pt(e){function t(l,a,n,u,o){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=u,this.target=o,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(l=e[m],this[m]=l?l(u):u[m]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Ms:Vc,this.isPropagationStopped=Vc,this}return S(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ms)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ms)},persist:function(){},isPersistent:Ms}),t}var Jl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},js=pt(Jl),rn=S({},Jl,{view:0,detail:0}),Eh=pt(rn),li,ai,cn,Ns=S({},rn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:si,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!==cn&&(cn&&e.type==="mousemove"?(li=e.screenX-cn.screenX,ai=e.screenY-cn.screenY):ai=li=0,cn=e),li)},movementY:function(e){return"movementY"in e?e.movementY:ai}}),Zc=pt(Ns),wh=S({},Ns,{dataTransfer:0}),Mh=pt(wh),jh=S({},rn,{relatedTarget:0}),ni=pt(jh),Nh=S({},Jl,{animationName:0,elapsedTime:0,pseudoElement:0}),Th=pt(Nh),Ch=S({},Jl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kh=pt(Ch),Ah=S({},Jl,{data:0}),Qc=pt(Ah),Rh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oh={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"},Dh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _h(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dh[e])?!!t[e]:!1}function si(){return _h}var zh=S({},rn,{key:function(e){if(e.key){var t=Rh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ws(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Oh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:si,charCode:function(e){return e.type==="keypress"?ws(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ws(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Uh=pt(zh),Hh=S({},Ns,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kc=pt(Hh),Lh=S({},rn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:si}),Bh=pt(Lh),qh=S({},Jl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yh=pt(qh),$h=S({},Ns,{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}),Gh=pt($h),Xh=S({},Jl,{newState:0,oldState:0}),Vh=pt(Xh),Zh=[9,13,27,32],ui=al&&"CompositionEvent"in window,on=null;al&&"documentMode"in document&&(on=document.documentMode);var Qh=al&&"TextEvent"in window&&!on,Jc=al&&(!ui||on&&8<on&&11>=on),Fc=" ",Wc=!1;function Pc(e,t){switch(e){case"keyup":return Zh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ic(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ma=!1;function Kh(e,t){switch(e){case"compositionend":return Ic(t);case"keypress":return t.which!==32?null:(Wc=!0,Fc);case"textInput":return e=t.data,e===Fc&&Wc?null:e;default:return null}}function Jh(e,t){if(Ma)return e==="compositionend"||!ui&&Pc(e,t)?(e=Xc(),Es=ti=Sl=null,Ma=!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 Jc&&t.locale!=="ko"?null:t.data;default:return null}}var Fh={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 eo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Fh[e.type]:t==="textarea"}function to(e,t,l,a){Ea?wa?wa.push(a):wa=[a]:Ea=a,t=du(t,"onChange"),0<t.length&&(l=new js("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var fn=null,dn=null;function Wh(e){Hd(e,0)}function Ts(e){var t=nn(e);if(Uc(t))return e}function lo(e,t){if(e==="change")return t}var ao=!1;if(al){var ii;if(al){var ri="oninput"in document;if(!ri){var no=document.createElement("div");no.setAttribute("oninput","return;"),ri=typeof no.oninput=="function"}ii=ri}else ii=!1;ao=ii&&(!document.documentMode||9<document.documentMode)}function so(){fn&&(fn.detachEvent("onpropertychange",uo),dn=fn=null)}function uo(e){if(e.propertyName==="value"&&Ts(dn)){var t=[];to(t,dn,e,Pu(e)),Gc(Wh,t)}}function Ph(e,t,l){e==="focusin"?(so(),fn=t,dn=l,fn.attachEvent("onpropertychange",uo)):e==="focusout"&&so()}function Ih(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ts(dn)}function em(e,t){if(e==="click")return Ts(t)}function tm(e,t){if(e==="input"||e==="change")return Ts(t)}function lm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:lm;function hn(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!tt.call(t,n)||!bt(e[n],t[n]))return!1}return!0}function io(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ro(e,t){var l=io(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=io(l)}}function co(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?co(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bs(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=bs(e.document)}return t}function ci(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")}var am=al&&"documentMode"in document&&11>=document.documentMode,ja=null,oi=null,mn=null,fi=!1;function fo(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;fi||ja==null||ja!==bs(a)||(a=ja,"selectionStart"in a&&ci(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),mn&&hn(mn,a)||(mn=a,a=du(oi,"onSelect"),0<a.length&&(t=new js("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ja)))}function Fl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Na={animationend:Fl("Animation","AnimationEnd"),animationiteration:Fl("Animation","AnimationIteration"),animationstart:Fl("Animation","AnimationStart"),transitionrun:Fl("Transition","TransitionRun"),transitionstart:Fl("Transition","TransitionStart"),transitioncancel:Fl("Transition","TransitionCancel"),transitionend:Fl("Transition","TransitionEnd")},di={},ho={};al&&(ho=document.createElement("div").style,"AnimationEvent"in window||(delete Na.animationend.animation,delete Na.animationiteration.animation,delete Na.animationstart.animation),"TransitionEvent"in window||delete Na.transitionend.transition);function Wl(e){if(di[e])return di[e];if(!Na[e])return e;var t=Na[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in ho)return di[e]=t[l];return e}var mo=Wl("animationend"),go=Wl("animationiteration"),po=Wl("animationstart"),nm=Wl("transitionrun"),sm=Wl("transitionstart"),um=Wl("transitioncancel"),vo=Wl("transitionend"),xo=new Map,hi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");hi.push("scrollEnd");function Gt(e,t){xo.set(e,t),Kl(t,[e])}var yo=new WeakMap;function Dt(e,t){if(typeof e=="object"&&e!==null){var l=yo.get(e);return l!==void 0?l:(t={value:e,source:t,stack:_c(t)},yo.set(e,t),t)}return{value:e,source:t,stack:_c(t)}}var _t=[],Ta=0,mi=0;function Cs(){for(var e=Ta,t=mi=Ta=0;t<e;){var l=_t[t];_t[t++]=null;var a=_t[t];_t[t++]=null;var n=_t[t];_t[t++]=null;var u=_t[t];if(_t[t++]=null,a!==null&&n!==null){var o=a.pending;o===null?n.next=n:(n.next=o.next,o.next=n),a.pending=n}u!==0&&bo(l,n,u)}}function ks(e,t,l,a){_t[Ta++]=e,_t[Ta++]=t,_t[Ta++]=l,_t[Ta++]=a,mi|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function gi(e,t,l,a){return ks(e,t,l,a),As(e)}function Ca(e,t){return ks(e,null,null,t),As(e)}function bo(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,u=e.return;u!==null;)u.childLanes|=l,a=u.alternate,a!==null&&(a.childLanes|=l),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(n=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,n&&t!==null&&(n=31-mt(l),e=u.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),u):null}function As(e){if(50<Bn)throw Bn=0,Sr=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ka={};function im(e,t,l,a){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function St(e,t,l,a){return new im(e,t,l,a)}function pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nl(e,t){var l=e.alternate;return l===null?(l=St(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function So(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Rs(e,t,l,a,n,u){var o=0;if(a=e,typeof e=="function")pi(e)&&(o=1);else if(typeof e=="string")o=cg(e,l,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=St(31,l,t,n),e.elementType=ne,e.lanes=u,e;case T:return Pl(l.children,n,u,t);case G:o=8,n|=24;break;case X:return e=St(12,l,t,n|2),e.elementType=X,e.lanes=u,e;case Q:return e=St(13,l,t,n),e.elementType=Q,e.lanes=u,e;case ee:return e=St(19,l,t,n),e.elementType=ee,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:case F:o=10;break e;case J:o=9;break e;case Z:o=11;break e;case se:o=14;break e;case le:o=16,a=null;break e}o=29,l=Error(r(130,e===null?"null":typeof e,"")),a=null}return t=St(o,l,t,n),t.elementType=e,t.type=a,t.lanes=u,t}function Pl(e,t,l,a){return e=St(7,e,a,t),e.lanes=l,e}function vi(e,t,l){return e=St(6,e,null,t),e.lanes=l,e}function xi(e,t,l){return t=St(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Aa=[],Ra=0,Os=null,Ds=0,zt=[],Ut=0,Il=null,sl=1,ul="";function ea(e,t){Aa[Ra++]=Ds,Aa[Ra++]=Os,Os=e,Ds=t}function Eo(e,t,l){zt[Ut++]=sl,zt[Ut++]=ul,zt[Ut++]=Il,Il=e;var a=sl;e=ul;var n=32-mt(a)-1;a&=~(1<<n),l+=1;var u=32-mt(t)+n;if(30<u){var o=n-n%5;u=(a&(1<<o)-1).toString(32),a>>=o,n-=o,sl=1<<32-mt(t)+n|l<<n|a,ul=u+e}else sl=1<<u|l<<n|a,ul=e}function yi(e){e.return!==null&&(ea(e,1),Eo(e,1,0))}function bi(e){for(;e===Os;)Os=Aa[--Ra],Aa[Ra]=null,Ds=Aa[--Ra],Aa[Ra]=null;for(;e===Il;)Il=zt[--Ut],zt[Ut]=null,ul=zt[--Ut],zt[Ut]=null,sl=zt[--Ut],zt[Ut]=null}var gt=null,Xe=null,Me=!1,ta=null,Jt=!1,Si=Error(r(519));function la(e){var t=Error(r(418,""));throw vn(Dt(t,e)),Si}function wo(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[Ne]=e,t[lt]=a,l){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(l=0;l<Yn.length;l++)xe(Yn[l],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),Hc(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),ys(t);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),Bc(t,a.value,a.defaultValue,a.children),ys(t)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Yd(t.textContent,l)?(a.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),a.onScroll!=null&&xe("scroll",t),a.onScrollEnd!=null&&xe("scrollend",t),a.onClick!=null&&(t.onclick=hu),t=!0):t=!1,t||la(e)}function Mo(e){for(gt=e.return;gt;)switch(gt.tag){case 5:case 13:Jt=!1;return;case 27:case 3:Jt=!0;return;default:gt=gt.return}}function gn(e){if(e!==gt)return!1;if(!Me)return Mo(e),Me=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Hr(e.type,e.memoizedProps)),l=!l),l&&Xe&&la(e),Mo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(l=e.data,l==="/$"){if(t===0){Xe=Vt(e.nextSibling);break e}t--}else l!=="$"&&l!=="$!"&&l!=="$?"||t++;e=e.nextSibling}Xe=null}}else t===27?(t=Xe,Hl(e.type)?(e=Yr,Yr=null,Xe=e):Xe=t):Xe=gt?Vt(e.stateNode.nextSibling):null;return!0}function pn(){Xe=gt=null,Me=!1}function jo(){var e=ta;return e!==null&&(yt===null?yt=e:yt.push.apply(yt,e),ta=null),e}function vn(e){ta===null?ta=[e]:ta.push(e)}var Ei=z(null),aa=null,il=null;function El(e,t,l){Y(Ei,t._currentValue),t._currentValue=l}function rl(e){e._currentValue=Ei.current,O(Ei)}function wi(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Mi(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var u=n.dependencies;if(u!==null){var o=n.child;u=u.firstContext;e:for(;u!==null;){var m=u;u=n;for(var b=0;b<t.length;b++)if(m.context===t[b]){u.lanes|=l,m=u.alternate,m!==null&&(m.lanes|=l),wi(u.return,l,e),a||(o=null);break e}u=m.next}}else if(n.tag===18){if(o=n.return,o===null)throw Error(r(341));o.lanes|=l,u=o.alternate,u!==null&&(u.lanes|=l),wi(o,l,e),o=null}else o=n.child;if(o!==null)o.return=n;else for(o=n;o!==null;){if(o===e){o=null;break}if(n=o.sibling,n!==null){n.return=o.return,o=n;break}o=o.return}n=o}}function xn(e,t,l,a){e=null;for(var n=t,u=!1;n!==null;){if(!u){if((n.flags&524288)!==0)u=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var o=n.alternate;if(o===null)throw Error(r(387));if(o=o.memoizedProps,o!==null){var m=n.type;bt(n.pendingProps.value,o.value)||(e!==null?e.push(m):e=[m])}}else if(n===De.current){if(o=n.alternate,o===null)throw Error(r(387));o.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Qn):e=[Qn])}n=n.return}e!==null&&Mi(t,e,l,a),t.flags|=262144}function _s(e){for(e=e.firstContext;e!==null;){if(!bt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){aa=e,il=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ft(e){return No(aa,e)}function zs(e,t){return aa===null&&na(e),No(e,t)}function No(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},il===null){if(e===null)throw Error(r(308));il=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else il=il.next=t;return l}var rm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},cm=s.unstable_scheduleCallback,om=s.unstable_NormalPriority,Ie={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ji(){return{controller:new rm,data:new Map,refCount:0}}function yn(e){e.refCount--,e.refCount===0&&cm(om,function(){e.controller.abort()})}var bn=null,Ni=0,Oa=0,Da=null;function fm(e,t){if(bn===null){var l=bn=[];Ni=0,Oa=Cr(),Da={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Ni++,t.then(To,To),t}function To(){if(--Ni===0&&bn!==null){Da!==null&&(Da.status="fulfilled");var e=bn;bn=null,Oa=0,Da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function dm(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var Co=w.S;w.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&fm(e,t),Co!==null&&Co(e,t)};var sa=z(null);function Ti(){var e=sa.current;return e!==null?e:ze.pooledCache}function Us(e,t){t===null?Y(sa,sa.current):Y(sa,t.pool)}function ko(){var e=Ti();return e===null?null:{parent:Ie._currentValue,pool:e}}var Sn=Error(r(460)),Ao=Error(r(474)),Hs=Error(r(542)),Ci={then:function(){}};function Ro(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ls(){}function Oo(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Ls,Ls),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_o(e),e;default:if(typeof t.status=="string")t.then(Ls,Ls);else{if(e=ze,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_o(e),e}throw En=t,Sn}}var En=null;function Do(){if(En===null)throw Error(r(459));var e=En;return En=null,e}function _o(e){if(e===Sn||e===Hs)throw Error(r(483))}var wl=!1;function ki(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ai(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ml(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function jl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Te&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=As(e),bo(e,null,l),t}return ks(e,a,t,l),As(e)}function wn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,je(e,l)}}function Ri(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var o={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=o:u=u.next=o,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Oi=!1;function Mn(){if(Oi){var e=Da;if(e!==null)throw e}}function jn(e,t,l,a){Oi=!1;var n=e.updateQueue;wl=!1;var u=n.firstBaseUpdate,o=n.lastBaseUpdate,m=n.shared.pending;if(m!==null){n.shared.pending=null;var b=m,R=b.next;b.next=null,o===null?u=R:o.next=R,o=b;var L=e.alternate;L!==null&&(L=L.updateQueue,m=L.lastBaseUpdate,m!==o&&(m===null?L.firstBaseUpdate=R:m.next=R,L.lastBaseUpdate=b))}if(u!==null){var $=n.baseState;o=0,L=R=b=null,m=u;do{var D=m.lane&-536870913,_=D!==m.lane;if(_?(be&D)===D:(a&D)===D){D!==0&&D===Oa&&(Oi=!0),L!==null&&(L=L.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var fe=e,ce=m;D=t;var Re=l;switch(ce.tag){case 1:if(fe=ce.payload,typeof fe=="function"){$=fe.call(Re,$,D);break e}$=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ce.payload,D=typeof fe=="function"?fe.call(Re,$,D):fe,D==null)break e;$=S({},$,D);break e;case 2:wl=!0}}D=m.callback,D!==null&&(e.flags|=64,_&&(e.flags|=8192),_=n.callbacks,_===null?n.callbacks=[D]:_.push(D))}else _={lane:D,tag:m.tag,payload:m.payload,callback:m.callback,next:null},L===null?(R=L=_,b=$):L=L.next=_,o|=D;if(m=m.next,m===null){if(m=n.shared.pending,m===null)break;_=m,m=_.next,_.next=null,n.lastBaseUpdate=_,n.shared.pending=null}}while(!0);L===null&&(b=$),n.baseState=b,n.firstBaseUpdate=R,n.lastBaseUpdate=L,u===null&&(n.shared.lanes=0),Dl|=o,e.lanes=o,e.memoizedState=$}}function zo(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function Uo(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)zo(l[e],t)}var _a=z(null),Bs=z(0);function Ho(e,t){e=gl,Y(Bs,e),Y(_a,t),gl=e|t.baseLanes}function Di(){Y(Bs,gl),Y(_a,_a.current)}function _i(){gl=Bs.current,O(_a),O(Bs)}var Nl=0,me=null,ke=null,We=null,qs=!1,za=!1,ua=!1,Ys=0,Nn=0,Ua=null,hm=0;function Ke(){throw Error(r(321))}function zi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!bt(e[l],t[l]))return!1;return!0}function Ui(e,t,l,a,n,u){return Nl=u,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?Sf:Ef,ua=!1,u=l(a,n),ua=!1,za&&(u=Bo(t,l,a,n)),Lo(e),u}function Lo(e){w.H=Qs;var t=ke!==null&&ke.next!==null;if(Nl=0,We=ke=me=null,qs=!1,Nn=0,Ua=null,t)throw Error(r(300));e===null||nt||(e=e.dependencies,e!==null&&_s(e)&&(nt=!0))}function Bo(e,t,l,a){me=e;var n=0;do{if(za&&(Ua=null),Nn=0,za=!1,25<=n)throw Error(r(301));if(n+=1,We=ke=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}w.H=bm,u=t(l,a)}while(za);return u}function mm(){var e=w.H,t=e.useState()[0];return t=typeof t.then=="function"?Tn(t):t,e=e.useState()[0],(ke!==null?ke.memoizedState:null)!==e&&(me.flags|=1024),t}function Hi(){var e=Ys!==0;return Ys=0,e}function Li(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Bi(e){if(qs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}qs=!1}Nl=0,We=ke=me=null,za=!1,Nn=Ys=0,Ua=null}function vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?me.memoizedState=We=e:We=We.next=e,We}function Pe(){if(ke===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var t=We===null?me.memoizedState:We.next;if(t!==null)We=t,ke=e;else{if(e===null)throw me.alternate===null?Error(r(467)):Error(r(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},We===null?me.memoizedState=We=e:We=We.next=e}return We}function qi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tn(e){var t=Nn;return Nn+=1,Ua===null&&(Ua=[]),e=Oo(Ua,e,t),t=me,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?Sf:Ef),e}function $s(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Tn(e);if(e.$$typeof===F)return ft(e)}throw Error(r(438,String(e)))}function Yi(e){var t=null,l=me.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=me.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=qi(),me.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=I;return t.index++,l}function cl(e,t){return typeof t=="function"?t(e):t}function Gs(e){var t=Pe();return $i(t,ke,e)}function $i(e,t,l){var a=e.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=l;var n=e.baseQueue,u=a.pending;if(u!==null){if(n!==null){var o=n.next;n.next=u.next,u.next=o}t.baseQueue=n=u,a.pending=null}if(u=e.baseState,n===null)e.memoizedState=u;else{t=n.next;var m=o=null,b=null,R=t,L=!1;do{var $=R.lane&-536870913;if($!==R.lane?(be&$)===$:(Nl&$)===$){var D=R.revertLane;if(D===0)b!==null&&(b=b.next={lane:0,revertLane:0,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),$===Oa&&(L=!0);else if((Nl&D)===D){R=R.next,D===Oa&&(L=!0);continue}else $={lane:0,revertLane:R.revertLane,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},b===null?(m=b=$,o=u):b=b.next=$,me.lanes|=D,Dl|=D;$=R.action,ua&&l(u,$),u=R.hasEagerState?R.eagerState:l(u,$)}else D={lane:$,revertLane:R.revertLane,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},b===null?(m=b=D,o=u):b=b.next=D,me.lanes|=$,Dl|=$;R=R.next}while(R!==null&&R!==t);if(b===null?o=u:b.next=m,!bt(u,e.memoizedState)&&(nt=!0,L&&(l=Da,l!==null)))throw l;e.memoizedState=u,e.baseState=o,e.baseQueue=b,a.lastRenderedState=u}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Gi(e){var t=Pe(),l=t.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,u=t.memoizedState;if(n!==null){l.pending=null;var o=n=n.next;do u=e(u,o.action),o=o.next;while(o!==n);bt(u,t.memoizedState)||(nt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),l.lastRenderedState=u}return[u,a]}function qo(e,t,l){var a=me,n=Pe(),u=Me;if(u){if(l===void 0)throw Error(r(407));l=l()}else l=t();var o=!bt((ke||n).memoizedState,l);o&&(n.memoizedState=l,nt=!0),n=n.queue;var m=Go.bind(null,a,n,e);if(Cn(2048,8,m,[e]),n.getSnapshot!==t||o||We!==null&&We.memoizedState.tag&1){if(a.flags|=2048,Ha(9,Xs(),$o.bind(null,a,n,l,t),null),ze===null)throw Error(r(349));u||(Nl&124)!==0||Yo(a,t,l)}return l}function Yo(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=me.updateQueue,t===null?(t=qi(),me.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function $o(e,t,l,a){t.value=l,t.getSnapshot=a,Xo(t)&&Vo(e)}function Go(e,t,l){return l(function(){Xo(t)&&Vo(e)})}function Xo(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!bt(e,l)}catch{return!0}}function Vo(e){var t=Ca(e,2);t!==null&&Nt(t,e,2)}function Xi(e){var t=vt();if(typeof e=="function"){var l=e;if(e=l(),ua){Kt(!0);try{l()}finally{Kt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:e},t}function Zo(e,t,l,a){return e.baseState=l,$i(e,ke,typeof a=="function"?a:cl)}function gm(e,t,l,a,n){if(Zs(e))throw Error(r(485));if(e=t.action,e!==null){var u={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){u.listeners.push(o)}};w.T!==null?l(!0):u.isTransition=!1,a(u),l=t.pending,l===null?(u.next=t.pending=u,Qo(t,u)):(u.next=l.next,t.pending=l.next=u)}}function Qo(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var u=w.T,o={};w.T=o;try{var m=l(n,a),b=w.S;b!==null&&b(o,m),Ko(e,t,m)}catch(R){Vi(e,t,R)}finally{w.T=u}}else try{u=l(n,a),Ko(e,t,u)}catch(R){Vi(e,t,R)}}function Ko(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Jo(e,t,a)},function(a){return Vi(e,t,a)}):Jo(e,t,l)}function Jo(e,t,l){t.status="fulfilled",t.value=l,Fo(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Qo(e,l)))}function Vi(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Fo(t),t=t.next;while(t!==a)}e.action=null}function Fo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Wo(e,t){return t}function Po(e,t){if(Me){var l=ze.formState;if(l!==null){e:{var a=me;if(Me){if(Xe){t:{for(var n=Xe,u=Jt;n.nodeType!==8;){if(!u){n=null;break t}if(n=Vt(n.nextSibling),n===null){n=null;break t}}u=n.data,n=u==="F!"||u==="F"?n:null}if(n){Xe=Vt(n.nextSibling),a=n.data==="F!";break e}}la(a)}a=!1}a&&(t=l[0])}}return l=vt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:t},l.queue=a,l=xf.bind(null,me,a),a.dispatch=l,a=Xi(!1),u=Fi.bind(null,me,!1,a.queue),a=vt(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=gm.bind(null,me,n,u,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function Io(e){var t=Pe();return ef(t,ke,e)}function ef(e,t,l){if(t=$i(e,t,Wo)[0],e=Gs(cl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Tn(t)}catch(o){throw o===Sn?Hs:o}else a=t;t=Pe();var n=t.queue,u=n.dispatch;return l!==t.memoizedState&&(me.flags|=2048,Ha(9,Xs(),pm.bind(null,n,l),null)),[a,u,e]}function pm(e,t){e.action=t}function tf(e){var t=Pe(),l=ke;if(l!==null)return ef(t,l,e);Pe(),t=t.memoizedState,l=Pe();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Ha(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=me.updateQueue,t===null&&(t=qi(),me.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Xs(){return{destroy:void 0,resource:void 0}}function lf(){return Pe().memoizedState}function Vs(e,t,l,a){var n=vt();a=a===void 0?null:a,me.flags|=e,n.memoizedState=Ha(1|t,Xs(),l,a)}function Cn(e,t,l,a){var n=Pe();a=a===void 0?null:a;var u=n.memoizedState.inst;ke!==null&&a!==null&&zi(a,ke.memoizedState.deps)?n.memoizedState=Ha(t,u,l,a):(me.flags|=e,n.memoizedState=Ha(1|t,u,l,a))}function af(e,t){Vs(8390656,8,e,t)}function nf(e,t){Cn(2048,8,e,t)}function sf(e,t){return Cn(4,2,e,t)}function uf(e,t){return Cn(4,4,e,t)}function rf(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cf(e,t,l){l=l!=null?l.concat([e]):null,Cn(4,4,rf.bind(null,t,e),l)}function Zi(){}function of(e,t){var l=Pe();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&zi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function ff(e,t){var l=Pe();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&zi(t,a[1]))return a[0];if(a=e(),ua){Kt(!0);try{e()}finally{Kt(!1)}}return l.memoizedState=[a,t],a}function Qi(e,t,l){return l===void 0||(Nl&1073741824)!==0?e.memoizedState=t:(e.memoizedState=l,e=md(),me.lanes|=e,Dl|=e,l)}function df(e,t,l,a){return bt(l,t)?l:_a.current!==null?(e=Qi(e,l,a),bt(e,t)||(nt=!0),e):(Nl&42)===0?(nt=!0,e.memoizedState=l):(e=md(),me.lanes|=e,Dl|=e,t)}function hf(e,t,l,a,n){var u=U.p;U.p=u!==0&&8>u?u:8;var o=w.T,m={};w.T=m,Fi(e,!1,t,l);try{var b=n(),R=w.S;if(R!==null&&R(m,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var L=dm(b,a);kn(e,t,L,jt(e))}else kn(e,t,a,jt(e))}catch($){kn(e,t,{then:function(){},status:"rejected",reason:$},jt())}finally{U.p=u,w.T=o}}function vm(){}function Ki(e,t,l,a){if(e.tag!==5)throw Error(r(476));var n=mf(e).queue;hf(e,n,t,A,l===null?vm:function(){return gf(e),l(a)})}function mf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:A,baseState:A,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:A},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gf(e){var t=mf(e).next.queue;kn(e,t,{},jt())}function Ji(){return ft(Qn)}function pf(){return Pe().memoizedState}function vf(){return Pe().memoizedState}function xm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=jt();e=Ml(l);var a=jl(t,e,l);a!==null&&(Nt(a,t,l),wn(a,t,l)),t={cache:ji()},e.payload=t;return}t=t.return}}function ym(e,t,l){var a=jt();l={lane:a,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},Zs(e)?yf(t,l):(l=gi(e,t,l,a),l!==null&&(Nt(l,e,a),bf(l,t,a)))}function xf(e,t,l){var a=jt();kn(e,t,l,a)}function kn(e,t,l,a){var n={lane:a,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(Zs(e))yf(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var o=t.lastRenderedState,m=u(o,l);if(n.hasEagerState=!0,n.eagerState=m,bt(m,o))return ks(e,t,n,0),ze===null&&Cs(),!1}catch{}finally{}if(l=gi(e,t,n,a),l!==null)return Nt(l,e,a),bf(l,t,a),!0}return!1}function Fi(e,t,l,a){if(a={lane:2,revertLane:Cr(),action:a,hasEagerState:!1,eagerState:null,next:null},Zs(e)){if(t)throw Error(r(479))}else t=gi(e,l,a,2),t!==null&&Nt(t,e,2)}function Zs(e){var t=e.alternate;return e===me||t!==null&&t===me}function yf(e,t){za=qs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function bf(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,je(e,l)}}var Qs={readContext:ft,use:$s,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useLayoutEffect:Ke,useInsertionEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useSyncExternalStore:Ke,useId:Ke,useHostTransitionStatus:Ke,useFormState:Ke,useActionState:Ke,useOptimistic:Ke,useMemoCache:Ke,useCacheRefresh:Ke},Sf={readContext:ft,use:$s,useCallback:function(e,t){return vt().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:af,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Vs(4194308,4,rf.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var l=vt();t=t===void 0?null:t;var a=e();if(ua){Kt(!0);try{e()}finally{Kt(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=vt();if(l!==void 0){var n=l(t);if(ua){Kt(!0);try{l(t)}finally{Kt(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=ym.bind(null,me,e),[a.memoizedState,e]},useRef:function(e){var t=vt();return e={current:e},t.memoizedState=e},useState:function(e){e=Xi(e);var t=e.queue,l=xf.bind(null,me,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Zi,useDeferredValue:function(e,t){var l=vt();return Qi(l,e,t)},useTransition:function(){var e=Xi(!1);return e=hf.bind(null,me,e.queue,!0,!1),vt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=me,n=vt();if(Me){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),ze===null)throw Error(r(349));(be&124)!==0||Yo(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,af(Go.bind(null,a,u,e),[e]),a.flags|=2048,Ha(9,Xs(),$o.bind(null,a,u,l,t),null),l},useId:function(){var e=vt(),t=ze.identifierPrefix;if(Me){var l=ul,a=sl;l=(a&~(1<<32-mt(a)-1)).toString(32)+l,t="«"+t+"R"+l,l=Ys++,0<l&&(t+="H"+l.toString(32)),t+="»"}else l=hm++,t="«"+t+"r"+l.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Ji,useFormState:Po,useActionState:Po,useOptimistic:function(e){var t=vt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Fi.bind(null,me,!0,l),l.dispatch=t,[e,t]},useMemoCache:Yi,useCacheRefresh:function(){return vt().memoizedState=xm.bind(null,me)}},Ef={readContext:ft,use:$s,useCallback:of,useContext:ft,useEffect:nf,useImperativeHandle:cf,useInsertionEffect:sf,useLayoutEffect:uf,useMemo:ff,useReducer:Gs,useRef:lf,useState:function(){return Gs(cl)},useDebugValue:Zi,useDeferredValue:function(e,t){var l=Pe();return df(l,ke.memoizedState,e,t)},useTransition:function(){var e=Gs(cl)[0],t=Pe().memoizedState;return[typeof e=="boolean"?e:Tn(e),t]},useSyncExternalStore:qo,useId:pf,useHostTransitionStatus:Ji,useFormState:Io,useActionState:Io,useOptimistic:function(e,t){var l=Pe();return Zo(l,ke,e,t)},useMemoCache:Yi,useCacheRefresh:vf},bm={readContext:ft,use:$s,useCallback:of,useContext:ft,useEffect:nf,useImperativeHandle:cf,useInsertionEffect:sf,useLayoutEffect:uf,useMemo:ff,useReducer:Gi,useRef:lf,useState:function(){return Gi(cl)},useDebugValue:Zi,useDeferredValue:function(e,t){var l=Pe();return ke===null?Qi(l,e,t):df(l,ke.memoizedState,e,t)},useTransition:function(){var e=Gi(cl)[0],t=Pe().memoizedState;return[typeof e=="boolean"?e:Tn(e),t]},useSyncExternalStore:qo,useId:pf,useHostTransitionStatus:Ji,useFormState:tf,useActionState:tf,useOptimistic:function(e,t){var l=Pe();return ke!==null?Zo(l,ke,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Yi,useCacheRefresh:vf},La=null,An=0;function Ks(e){var t=An;return An+=1,La===null&&(La=[]),Oo(La,e,t)}function Rn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Js(e,t){throw t.$$typeof===j?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wf(e){var t=e._init;return t(e._payload)}function Mf(e){function t(N,M){if(e){var k=N.deletions;k===null?(N.deletions=[M],N.flags|=16):k.push(M)}}function l(N,M){if(!e)return null;for(;M!==null;)t(N,M),M=M.sibling;return null}function a(N){for(var M=new Map;N!==null;)N.key!==null?M.set(N.key,N):M.set(N.index,N),N=N.sibling;return M}function n(N,M){return N=nl(N,M),N.index=0,N.sibling=null,N}function u(N,M,k){return N.index=k,e?(k=N.alternate,k!==null?(k=k.index,k<M?(N.flags|=67108866,M):k):(N.flags|=67108866,M)):(N.flags|=1048576,M)}function o(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function m(N,M,k,q){return M===null||M.tag!==6?(M=vi(k,N.mode,q),M.return=N,M):(M=n(M,k),M.return=N,M)}function b(N,M,k,q){var te=k.type;return te===T?L(N,M,k.props.children,q,k.key):M!==null&&(M.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===le&&wf(te)===M.type)?(M=n(M,k.props),Rn(M,k),M.return=N,M):(M=Rs(k.type,k.key,k.props,null,N.mode,q),Rn(M,k),M.return=N,M)}function R(N,M,k,q){return M===null||M.tag!==4||M.stateNode.containerInfo!==k.containerInfo||M.stateNode.implementation!==k.implementation?(M=xi(k,N.mode,q),M.return=N,M):(M=n(M,k.children||[]),M.return=N,M)}function L(N,M,k,q,te){return M===null||M.tag!==7?(M=Pl(k,N.mode,q,te),M.return=N,M):(M=n(M,k),M.return=N,M)}function $(N,M,k){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=vi(""+M,N.mode,k),M.return=N,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case C:return k=Rs(M.type,M.key,M.props,null,N.mode,k),Rn(k,M),k.return=N,k;case B:return M=xi(M,N.mode,k),M.return=N,M;case le:var q=M._init;return M=q(M._payload),$(N,M,k)}if(V(M)||de(M))return M=Pl(M,N.mode,k,null),M.return=N,M;if(typeof M.then=="function")return $(N,Ks(M),k);if(M.$$typeof===F)return $(N,zs(N,M),k);Js(N,M)}return null}function D(N,M,k,q){var te=M!==null?M.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return te!==null?null:m(N,M,""+k,q);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case C:return k.key===te?b(N,M,k,q):null;case B:return k.key===te?R(N,M,k,q):null;case le:return te=k._init,k=te(k._payload),D(N,M,k,q)}if(V(k)||de(k))return te!==null?null:L(N,M,k,q,null);if(typeof k.then=="function")return D(N,M,Ks(k),q);if(k.$$typeof===F)return D(N,M,zs(N,k),q);Js(N,k)}return null}function _(N,M,k,q,te){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return N=N.get(k)||null,m(M,N,""+q,te);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case C:return N=N.get(q.key===null?k:q.key)||null,b(M,N,q,te);case B:return N=N.get(q.key===null?k:q.key)||null,R(M,N,q,te);case le:var ge=q._init;return q=ge(q._payload),_(N,M,k,q,te)}if(V(q)||de(q))return N=N.get(k)||null,L(M,N,q,te,null);if(typeof q.then=="function")return _(N,M,k,Ks(q),te);if(q.$$typeof===F)return _(N,M,k,zs(M,q),te);Js(M,q)}return null}function fe(N,M,k,q){for(var te=null,ge=null,re=M,oe=M=0,ut=null;re!==null&&oe<k.length;oe++){re.index>oe?(ut=re,re=null):ut=re.sibling;var Ee=D(N,re,k[oe],q);if(Ee===null){re===null&&(re=ut);break}e&&re&&Ee.alternate===null&&t(N,re),M=u(Ee,M,oe),ge===null?te=Ee:ge.sibling=Ee,ge=Ee,re=ut}if(oe===k.length)return l(N,re),Me&&ea(N,oe),te;if(re===null){for(;oe<k.length;oe++)re=$(N,k[oe],q),re!==null&&(M=u(re,M,oe),ge===null?te=re:ge.sibling=re,ge=re);return Me&&ea(N,oe),te}for(re=a(re);oe<k.length;oe++)ut=_(re,N,oe,k[oe],q),ut!==null&&(e&&ut.alternate!==null&&re.delete(ut.key===null?oe:ut.key),M=u(ut,M,oe),ge===null?te=ut:ge.sibling=ut,ge=ut);return e&&re.forEach(function($l){return t(N,$l)}),Me&&ea(N,oe),te}function ce(N,M,k,q){if(k==null)throw Error(r(151));for(var te=null,ge=null,re=M,oe=M=0,ut=null,Ee=k.next();re!==null&&!Ee.done;oe++,Ee=k.next()){re.index>oe?(ut=re,re=null):ut=re.sibling;var $l=D(N,re,Ee.value,q);if($l===null){re===null&&(re=ut);break}e&&re&&$l.alternate===null&&t(N,re),M=u($l,M,oe),ge===null?te=$l:ge.sibling=$l,ge=$l,re=ut}if(Ee.done)return l(N,re),Me&&ea(N,oe),te;if(re===null){for(;!Ee.done;oe++,Ee=k.next())Ee=$(N,Ee.value,q),Ee!==null&&(M=u(Ee,M,oe),ge===null?te=Ee:ge.sibling=Ee,ge=Ee);return Me&&ea(N,oe),te}for(re=a(re);!Ee.done;oe++,Ee=k.next())Ee=_(re,N,oe,Ee.value,q),Ee!==null&&(e&&Ee.alternate!==null&&re.delete(Ee.key===null?oe:Ee.key),M=u(Ee,M,oe),ge===null?te=Ee:ge.sibling=Ee,ge=Ee);return e&&re.forEach(function(Sg){return t(N,Sg)}),Me&&ea(N,oe),te}function Re(N,M,k,q){if(typeof k=="object"&&k!==null&&k.type===T&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case C:e:{for(var te=k.key;M!==null;){if(M.key===te){if(te=k.type,te===T){if(M.tag===7){l(N,M.sibling),q=n(M,k.props.children),q.return=N,N=q;break e}}else if(M.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===le&&wf(te)===M.type){l(N,M.sibling),q=n(M,k.props),Rn(q,k),q.return=N,N=q;break e}l(N,M);break}else t(N,M);M=M.sibling}k.type===T?(q=Pl(k.props.children,N.mode,q,k.key),q.return=N,N=q):(q=Rs(k.type,k.key,k.props,null,N.mode,q),Rn(q,k),q.return=N,N=q)}return o(N);case B:e:{for(te=k.key;M!==null;){if(M.key===te)if(M.tag===4&&M.stateNode.containerInfo===k.containerInfo&&M.stateNode.implementation===k.implementation){l(N,M.sibling),q=n(M,k.children||[]),q.return=N,N=q;break e}else{l(N,M);break}else t(N,M);M=M.sibling}q=xi(k,N.mode,q),q.return=N,N=q}return o(N);case le:return te=k._init,k=te(k._payload),Re(N,M,k,q)}if(V(k))return fe(N,M,k,q);if(de(k)){if(te=de(k),typeof te!="function")throw Error(r(150));return k=te.call(k),ce(N,M,k,q)}if(typeof k.then=="function")return Re(N,M,Ks(k),q);if(k.$$typeof===F)return Re(N,M,zs(N,k),q);Js(N,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,M!==null&&M.tag===6?(l(N,M.sibling),q=n(M,k),q.return=N,N=q):(l(N,M),q=vi(k,N.mode,q),q.return=N,N=q),o(N)):l(N,M)}return function(N,M,k,q){try{An=0;var te=Re(N,M,k,q);return La=null,te}catch(re){if(re===Sn||re===Hs)throw re;var ge=St(29,re,null,N.mode);return ge.lanes=q,ge.return=N,ge}finally{}}}var Ba=Mf(!0),jf=Mf(!1),Ht=z(null),Ft=null;function Tl(e){var t=e.alternate;Y(et,et.current&1),Y(Ht,e),Ft===null&&(t===null||_a.current!==null||t.memoizedState!==null)&&(Ft=e)}function Nf(e){if(e.tag===22){if(Y(et,et.current),Y(Ht,e),Ft===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Ft=e)}}else Cl()}function Cl(){Y(et,et.current),Y(Ht,Ht.current)}function ol(e){O(Ht),Ft===e&&(Ft=null),O(et)}var et=z(0);function Fs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||qr(l)))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}function Wi(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:S({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Pi={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=jt(),n=Ml(a);n.payload=t,l!=null&&(n.callback=l),t=jl(e,n,a),t!==null&&(Nt(t,e,a),wn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=jt(),n=Ml(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=jl(e,n,a),t!==null&&(Nt(t,e,a),wn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=jt(),a=Ml(l);a.tag=2,t!=null&&(a.callback=t),t=jl(e,a,l),t!==null&&(Nt(t,e,l),wn(t,e,l))}};function Tf(e,t,l,a,n,u,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,o):t.prototype&&t.prototype.isPureReactComponent?!hn(l,a)||!hn(n,u):!0}function Cf(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Pi.enqueueReplaceState(t,t.state,null)}function ia(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=S({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}var Ws=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function kf(e){Ws(e)}function Af(e){console.error(e)}function Rf(e){Ws(e)}function Ps(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Of(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Ii(e,t,l){return l=Ml(l),l.tag=3,l.payload={element:null},l.callback=function(){Ps(e,t)},l}function Df(e){return e=Ml(e),e.tag=3,e}function _f(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var u=a.value;e.payload=function(){return n(u)},e.callback=function(){Of(t,l,a)}}var o=l.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Of(t,l,a),typeof n!="function"&&(_l===null?_l=new Set([this]):_l.add(this));var m=a.stack;this.componentDidCatch(a.value,{componentStack:m!==null?m:""})})}function Sm(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&xn(t,l,n,!0),l=Ht.current,l!==null){switch(l.tag){case 13:return Ft===null?wr():l.alternate===null&&Ve===0&&(Ve=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===Ci?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),jr(e,a,n)),!1;case 22:return l.flags|=65536,a===Ci?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),jr(e,a,n)),!1}throw Error(r(435,l.tag))}return jr(e,a,n),wr(),!1}if(Me)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==Si&&(e=Error(r(422),{cause:a}),vn(Dt(e,l)))):(a!==Si&&(t=Error(r(423),{cause:a}),vn(Dt(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=Dt(a,l),n=Ii(e.stateNode,a,n),Ri(e,n),Ve!==4&&(Ve=2)),!1;var u=Error(r(520),{cause:a});if(u=Dt(u,l),Ln===null?Ln=[u]:Ln.push(u),Ve!==4&&(Ve=2),t===null)return!0;a=Dt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=Ii(l.stateNode,a,e),Ri(l,e),!1;case 1:if(t=l.type,u=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(_l===null||!_l.has(u))))return l.flags|=65536,n&=-n,l.lanes|=n,n=Df(n),_f(n,e,l,a),Ri(l,n),!1}l=l.return}while(l!==null);return!1}var zf=Error(r(461)),nt=!1;function rt(e,t,l,a){t.child=e===null?jf(t,null,l,a):Ba(t,e.child,l,a)}function Uf(e,t,l,a,n){l=l.render;var u=t.ref;if("ref"in a){var o={};for(var m in a)m!=="ref"&&(o[m]=a[m])}else o=a;return na(t),a=Ui(e,t,l,o,u,n),m=Hi(),e!==null&&!nt?(Li(e,t,n),fl(e,t,n)):(Me&&m&&yi(t),t.flags|=1,rt(e,t,a,n),t.child)}function Hf(e,t,l,a,n){if(e===null){var u=l.type;return typeof u=="function"&&!pi(u)&&u.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=u,Lf(e,t,u,a,n)):(e=Rs(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!ir(e,n)){var o=u.memoizedProps;if(l=l.compare,l=l!==null?l:hn,l(o,a)&&e.ref===t.ref)return fl(e,t,n)}return t.flags|=1,e=nl(u,a),e.ref=t.ref,e.return=t,t.child=e}function Lf(e,t,l,a,n){if(e!==null){var u=e.memoizedProps;if(hn(u,a)&&e.ref===t.ref)if(nt=!1,t.pendingProps=a=u,ir(e,n))(e.flags&131072)!==0&&(nt=!0);else return t.lanes=e.lanes,fl(e,t,n)}return er(e,t,l,a,n)}function Bf(e,t,l){var a=t.pendingProps,n=a.children,u=e!==null?e.memoizedState:null;if(a.mode==="hidden"){if((t.flags&128)!==0){if(a=u!==null?u.baseLanes|l:l,e!==null){for(n=t.child=e.child,u=0;n!==null;)u=u|n.lanes|n.childLanes,n=n.sibling;t.childLanes=u&~a}else t.childLanes=0,t.child=null;return qf(e,t,a,l)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Us(t,u!==null?u.cachePool:null),u!==null?Ho(t,u):Di(),Nf(t);else return t.lanes=t.childLanes=536870912,qf(e,t,u!==null?u.baseLanes|l:l,l)}else u!==null?(Us(t,u.cachePool),Ho(t,u),Cl(),t.memoizedState=null):(e!==null&&Us(t,null),Di(),Cl());return rt(e,t,n,l),t.child}function qf(e,t,l,a){var n=Ti();return n=n===null?null:{parent:Ie._currentValue,pool:n},t.memoizedState={baseLanes:l,cachePool:n},e!==null&&Us(t,null),Di(),Nf(t),e!==null&&xn(e,t,a,!0),null}function Is(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function er(e,t,l,a,n){return na(t),l=Ui(e,t,l,a,void 0,n),a=Hi(),e!==null&&!nt?(Li(e,t,n),fl(e,t,n)):(Me&&a&&yi(t),t.flags|=1,rt(e,t,l,n),t.child)}function Yf(e,t,l,a,n,u){return na(t),t.updateQueue=null,l=Bo(t,a,l,n),Lo(e),a=Hi(),e!==null&&!nt?(Li(e,t,u),fl(e,t,u)):(Me&&a&&yi(t),t.flags|=1,rt(e,t,l,u),t.child)}function $f(e,t,l,a,n){if(na(t),t.stateNode===null){var u=ka,o=l.contextType;typeof o=="object"&&o!==null&&(u=ft(o)),u=new l(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Pi,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},ki(t),o=l.contextType,u.context=typeof o=="object"&&o!==null?ft(o):ka,u.state=t.memoizedState,o=l.getDerivedStateFromProps,typeof o=="function"&&(Wi(t,l,o,a),u.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(o=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),o!==u.state&&Pi.enqueueReplaceState(u,u.state,null),jn(t,a,u,n),Mn(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var m=t.memoizedProps,b=ia(l,m);u.props=b;var R=u.context,L=l.contextType;o=ka,typeof L=="object"&&L!==null&&(o=ft(L));var $=l.getDerivedStateFromProps;L=typeof $=="function"||typeof u.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,L||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m||R!==o)&&Cf(t,u,a,o),wl=!1;var D=t.memoizedState;u.state=D,jn(t,a,u,n),Mn(),R=t.memoizedState,m||D!==R||wl?(typeof $=="function"&&(Wi(t,l,$,a),R=t.memoizedState),(b=wl||Tf(t,l,b,a,D,R,o))?(L||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=R),u.props=a,u.state=R,u.context=o,a=b):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,Ai(e,t),o=t.memoizedProps,L=ia(l,o),u.props=L,$=t.pendingProps,D=u.context,R=l.contextType,b=ka,typeof R=="object"&&R!==null&&(b=ft(R)),m=l.getDerivedStateFromProps,(R=typeof m=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(o!==$||D!==b)&&Cf(t,u,a,b),wl=!1,D=t.memoizedState,u.state=D,jn(t,a,u,n),Mn();var _=t.memoizedState;o!==$||D!==_||wl||e!==null&&e.dependencies!==null&&_s(e.dependencies)?(typeof m=="function"&&(Wi(t,l,m,a),_=t.memoizedState),(L=wl||Tf(t,l,L,a,D,_,b)||e!==null&&e.dependencies!==null&&_s(e.dependencies))?(R||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,_,b),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,_,b)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||o===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=_),u.props=a,u.state=_,u.context=b,a=L):(typeof u.componentDidUpdate!="function"||o===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,Is(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=Ba(t,e.child,null,n),t.child=Ba(t,null,l,n)):rt(e,t,l,n),t.memoizedState=u.state,e=t.child):e=fl(e,t,n),e}function Gf(e,t,l,a){return pn(),t.flags|=256,rt(e,t,l,a),t.child}var tr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lr(e){return{baseLanes:e,cachePool:ko()}}function ar(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Lt),e}function Xf(e,t,l){var a=t.pendingProps,n=!1,u=(t.flags&128)!==0,o;if((o=u)||(o=e!==null&&e.memoizedState===null?!1:(et.current&2)!==0),o&&(n=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Me){if(n?Tl(t):Cl(),Me){var m=Xe,b;if(b=m){e:{for(b=m,m=Jt;b.nodeType!==8;){if(!m){m=null;break e}if(b=Vt(b.nextSibling),b===null){m=null;break e}}m=b}m!==null?(t.memoizedState={dehydrated:m,treeContext:Il!==null?{id:sl,overflow:ul}:null,retryLane:536870912,hydrationErrors:null},b=St(18,null,null,0),b.stateNode=m,b.return=t,t.child=b,gt=t,Xe=null,b=!0):b=!1}b||la(t)}if(m=t.memoizedState,m!==null&&(m=m.dehydrated,m!==null))return qr(m)?t.lanes=32:t.lanes=536870912,null;ol(t)}return m=a.children,a=a.fallback,n?(Cl(),n=t.mode,m=eu({mode:"hidden",children:m},n),a=Pl(a,n,l,null),m.return=t,a.return=t,m.sibling=a,t.child=m,n=t.child,n.memoizedState=lr(l),n.childLanes=ar(e,o,l),t.memoizedState=tr,a):(Tl(t),nr(t,m))}if(b=e.memoizedState,b!==null&&(m=b.dehydrated,m!==null)){if(u)t.flags&256?(Tl(t),t.flags&=-257,t=sr(e,t,l)):t.memoizedState!==null?(Cl(),t.child=e.child,t.flags|=128,t=null):(Cl(),n=a.fallback,m=t.mode,a=eu({mode:"visible",children:a.children},m),n=Pl(n,m,l,null),n.flags|=2,a.return=t,n.return=t,a.sibling=n,t.child=a,Ba(t,e.child,null,l),a=t.child,a.memoizedState=lr(l),a.childLanes=ar(e,o,l),t.memoizedState=tr,t=n);else if(Tl(t),qr(m)){if(o=m.nextSibling&&m.nextSibling.dataset,o)var R=o.dgst;o=R,a=Error(r(419)),a.stack="",a.digest=o,vn({value:a,source:null,stack:null}),t=sr(e,t,l)}else if(nt||xn(e,t,l,!1),o=(l&e.childLanes)!==0,nt||o){if(o=ze,o!==null&&(a=l&-l,a=(a&42)!==0?1:_e(a),a=(a&(o.suspendedLanes|l))!==0?0:a,a!==0&&a!==b.retryLane))throw b.retryLane=a,Ca(e,a),Nt(o,e,a),zf;m.data==="$?"||wr(),t=sr(e,t,l)}else m.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,Xe=Vt(m.nextSibling),gt=t,Me=!0,ta=null,Jt=!1,e!==null&&(zt[Ut++]=sl,zt[Ut++]=ul,zt[Ut++]=Il,sl=e.id,ul=e.overflow,Il=t),t=nr(t,a.children),t.flags|=4096);return t}return n?(Cl(),n=a.fallback,m=t.mode,b=e.child,R=b.sibling,a=nl(b,{mode:"hidden",children:a.children}),a.subtreeFlags=b.subtreeFlags&65011712,R!==null?n=nl(R,n):(n=Pl(n,m,l,null),n.flags|=2),n.return=t,a.return=t,a.sibling=n,t.child=a,a=n,n=t.child,m=e.child.memoizedState,m===null?m=lr(l):(b=m.cachePool,b!==null?(R=Ie._currentValue,b=b.parent!==R?{parent:R,pool:R}:b):b=ko(),m={baseLanes:m.baseLanes|l,cachePool:b}),n.memoizedState=m,n.childLanes=ar(e,o,l),t.memoizedState=tr,a):(Tl(t),l=e.child,e=l.sibling,l=nl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=l,t.memoizedState=null,l)}function nr(e,t){return t=eu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function eu(e,t){return e=St(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function sr(e,t,l){return Ba(t,e.child,null,l),e=nr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Vf(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),wi(e.return,t,l)}function ur(e,t,l,a,n){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=a,u.tail=l,u.tailMode=n)}function Zf(e,t,l){var a=t.pendingProps,n=a.revealOrder,u=a.tail;if(rt(e,t,a.children,l),a=et.current,(a&2)!==0)a=a&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&&Vf(e,l,t);else if(e.tag===19)Vf(e,l,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}a&=1}switch(Y(et,a),n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&Fs(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),ur(t,!1,n,l,u);break;case"backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Fs(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}ur(t,!0,l,null,u);break;case"together":ur(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Dl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(xn(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,l=nl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=nl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function ir(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_s(e)))}function Em(e,t,l){switch(t.tag){case 3:Se(t,t.stateNode.containerInfo),El(t,Ie,e.memoizedState.cache),pn();break;case 27:case 5:Ze(t);break;case 4:Se(t,t.stateNode.containerInfo);break;case 10:El(t,t.type,t.memoizedProps.value);break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Tl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Xf(e,t,l):(Tl(t),e=fl(e,t,l),e!==null?e.sibling:null);Tl(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(xn(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return Zf(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Y(et,et.current),a)break;return null;case 22:case 23:return t.lanes=0,Bf(e,t,l);case 24:El(t,Ie,e.memoizedState.cache)}return fl(e,t,l)}function Qf(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)nt=!0;else{if(!ir(e,l)&&(t.flags&128)===0)return nt=!1,Em(e,t,l);nt=(e.flags&131072)!==0}else nt=!1,Me&&(t.flags&1048576)!==0&&Eo(t,Ds,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var a=t.elementType,n=a._init;if(a=n(a._payload),t.type=a,typeof a=="function")pi(a)?(e=ia(a,e),t.tag=1,t=$f(null,t,a,e,l)):(t.tag=0,t=er(null,t,a,e,l));else{if(a!=null){if(n=a.$$typeof,n===Z){t.tag=11,t=Uf(null,t,a,e,l);break e}else if(n===se){t.tag=14,t=Hf(null,t,a,e,l);break e}}throw t=W(a)||a,Error(r(306,t,""))}}return t;case 0:return er(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=ia(a,t.pendingProps),$f(e,t,a,n,l);case 3:e:{if(Se(t,t.stateNode.containerInfo),e===null)throw Error(r(387));a=t.pendingProps;var u=t.memoizedState;n=u.element,Ai(e,t),jn(t,a,null,l);var o=t.memoizedState;if(a=o.cache,El(t,Ie,a),a!==u.cache&&Mi(t,[Ie],l,!0),Mn(),a=o.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Gf(e,t,a,l);break e}else if(a!==n){n=Dt(Error(r(424)),t),vn(n),t=Gf(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Xe=Vt(e.firstChild),gt=t,Me=!0,ta=null,Jt=!0,l=jf(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(pn(),a===n){t=fl(e,t,l);break e}rt(e,t,a,l)}t=t.child}return t;case 26:return Is(e,t),e===null?(l=Wd(t.type,null,t.pendingProps,null))?t.memoizedState=l:Me||(l=t.type,e=t.pendingProps,a=mu(ie.current).createElement(l),a[Ne]=t,a[lt]=e,ot(a,l,e),at(a),t.stateNode=a):t.memoizedState=Wd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ze(t),e===null&&Me&&(a=t.stateNode=Kd(t.type,t.pendingProps,ie.current),gt=t,Jt=!0,n=Xe,Hl(t.type)?(Yr=n,Xe=Vt(a.firstChild)):Xe=n),rt(e,t,t.pendingProps.children,l),Is(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Me&&((n=a=Xe)&&(a=Fm(a,t.type,t.pendingProps,Jt),a!==null?(t.stateNode=a,gt=t,Xe=Vt(a.firstChild),Jt=!1,n=!0):n=!1),n||la(t)),Ze(t),n=t.type,u=t.pendingProps,o=e!==null?e.memoizedProps:null,a=u.children,Hr(n,u)?a=null:o!==null&&Hr(n,o)&&(t.flags|=32),t.memoizedState!==null&&(n=Ui(e,t,mm,null,null,l),Qn._currentValue=n),Is(e,t),rt(e,t,a,l),t.child;case 6:return e===null&&Me&&((e=l=Xe)&&(l=Wm(l,t.pendingProps,Jt),l!==null?(t.stateNode=l,gt=t,Xe=null,e=!0):e=!1),e||la(t)),null;case 13:return Xf(e,t,l);case 4:return Se(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Ba(t,null,a,l):rt(e,t,a,l),t.child;case 11:return Uf(e,t,t.type,t.pendingProps,l);case 7:return rt(e,t,t.pendingProps,l),t.child;case 8:return rt(e,t,t.pendingProps.children,l),t.child;case 12:return rt(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,El(t,t.type,a.value),rt(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,na(t),n=ft(n),a=a(n),t.flags|=1,rt(e,t,a,l),t.child;case 14:return Hf(e,t,t.type,t.pendingProps,l);case 15:return Lf(e,t,t.type,t.pendingProps,l);case 19:return Zf(e,t,l);case 31:return a=t.pendingProps,l=t.mode,a={mode:a.mode,children:a.children},e===null?(l=eu(a,l),l.ref=t.ref,t.child=l,l.return=t,t=l):(l=nl(e.child,a),l.ref=t.ref,t.child=l,l.return=t,t=l),t;case 22:return Bf(e,t,l);case 24:return na(t),a=ft(Ie),e===null?(n=Ti(),n===null&&(n=ze,u=ji(),n.pooledCache=u,u.refCount++,u!==null&&(n.pooledCacheLanes|=l),n=u),t.memoizedState={parent:a,cache:n},ki(t),El(t,Ie,n)):((e.lanes&l)!==0&&(Ai(e,t),jn(t,null,null,l),Mn()),n=e.memoizedState,u=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),El(t,Ie,a)):(a=u.cache,El(t,Ie,a),a!==n.cache&&Mi(t,[Ie],l,!0))),rt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function dl(e){e.flags|=4}function Kf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!l0(t)){if(t=Ht.current,t!==null&&((be&4194048)===be?Ft!==null:(be&62914560)!==be&&(be&536870912)===0||t!==Ft))throw En=Ci,Ao;e.flags|=8192}}function tu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ps():536870912,e.lanes|=t,Ga|=t)}function On(e,t){if(!Me)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ye(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function wm(e,t,l){var a=t.pendingProps;switch(bi(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ye(t),null;case 1:return Ye(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),rl(Ie),qe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(gn(t)?dl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,jo())),Ye(t),null;case 26:return l=t.memoizedState,e===null?(dl(t),l!==null?(Ye(t),Kf(t,l)):(Ye(t),t.flags&=-16777217)):l?l!==e.memoizedState?(dl(t),Ye(t),Kf(t,l)):(Ye(t),t.flags&=-16777217):(e.memoizedProps!==a&&dl(t),Ye(t),t.flags&=-16777217),null;case 27:He(t),l=ie.current;var n=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dl(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Ye(t),null}e=P.current,gn(t)?wo(t):(e=Kd(n,a,l),t.stateNode=e,dl(t))}return Ye(t),null;case 5:if(He(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&dl(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Ye(t),null}if(e=P.current,gn(t))wo(t);else{switch(n=mu(ie.current),e){case 1:e=n.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:e=n.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":e=n.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":e=n.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":e=n.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof a.is=="string"?n.createElement("select",{is:a.is}):n.createElement("select"),a.multiple?e.multiple=!0:a.size&&(e.size=a.size);break;default:e=typeof a.is=="string"?n.createElement(l,{is:a.is}):n.createElement(l)}}e[Ne]=t,e[lt]=a;e:for(n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.tag!==27&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}t.stateNode=e;e:switch(ot(e,l,a),l){case"button":case"input":case"select":case"textarea":e=!!a.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&dl(t)}}return Ye(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&dl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=ie.current,gn(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=gt,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[Ne]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Yd(e.nodeValue,l)),e||la(t)}else e=mu(e).createTextNode(a),e[Ne]=t,t.stateNode=e}return Ye(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=gn(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(r(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[Ne]=t}else pn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ye(t),n=!1}else n=jo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(ol(t),t):(ol(t),null)}if(ol(t),(t.flags&128)!==0)return t.lanes=l,t;if(l=a!==null,e=e!==null&&e.memoizedState!==null,l){a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool);var u=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)}return l!==e&&l&&(t.child.flags|=8192),tu(t,t.updateQueue),Ye(t),null;case 4:return qe(),e===null&&Or(t.stateNode.containerInfo),Ye(t),null;case 10:return rl(t.type),Ye(t),null;case 19:if(O(et),n=t.memoizedState,n===null)return Ye(t),null;if(a=(t.flags&128)!==0,u=n.rendering,u===null)if(a)On(n,!1);else{if(Ve!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Fs(e),u!==null){for(t.flags|=128,On(n,!1),e=u.updateQueue,t.updateQueue=e,tu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)So(l,e),l=l.sibling;return Y(et,et.current&1|2),t.child}e=e.sibling}n.tail!==null&&Ct()>nu&&(t.flags|=128,a=!0,On(n,!1),t.lanes=4194304)}else{if(!a)if(e=Fs(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,tu(t,e),On(n,!0),n.tail===null&&n.tailMode==="hidden"&&!u.alternate&&!Me)return Ye(t),null}else 2*Ct()-n.renderingStartTime>nu&&l!==536870912&&(t.flags|=128,a=!0,On(n,!1),t.lanes=4194304);n.isBackwards?(u.sibling=t.child,t.child=u):(e=n.last,e!==null?e.sibling=u:t.child=u,n.last=u)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Ct(),t.sibling=null,e=et.current,Y(et,a?e&1|2:e&1),t):(Ye(t),null);case 22:case 23:return ol(t),_i(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),l=t.updateQueue,l!==null&&tu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&O(sa),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),rl(Ie),Ye(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Mm(e,t){switch(bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rl(Ie),qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return He(t),null;case 13:if(ol(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(et),null;case 4:return qe(),null;case 10:return rl(t.type),null;case 22:case 23:return ol(t),_i(),e!==null&&O(sa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return rl(Ie),null;case 25:return null;default:return null}}function Jf(e,t){switch(bi(t),t.tag){case 3:rl(Ie),qe();break;case 26:case 27:case 5:He(t);break;case 4:qe();break;case 13:ol(t);break;case 19:O(et);break;case 10:rl(t.type);break;case 22:case 23:ol(t),_i(),e!==null&&O(sa);break;case 24:rl(Ie)}}function Dn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,o=l.inst;a=u(),o.destroy=a}l=l.next}while(l!==n)}}catch(m){Oe(t,t.return,m)}}function kl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var o=a.inst,m=o.destroy;if(m!==void 0){o.destroy=void 0,n=t;var b=l,R=m;try{R()}catch(L){Oe(n,b,L)}}}a=a.next}while(a!==u)}}catch(L){Oe(t,t.return,L)}}function Ff(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Uo(t,l)}catch(a){Oe(e,e.return,a)}}}function Wf(e,t,l){l.props=ia(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Oe(e,t,a)}}function _n(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){Oe(e,t,n)}}function Wt(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){Oe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){Oe(e,t,n)}else l.current=null}function Pf(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){Oe(e,e.return,n)}}function rr(e,t,l){try{var a=e.stateNode;Vm(a,e.type,l,t),a[lt]=t}catch(n){Oe(e,e.return,n)}}function If(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hl(e.type)||e.tag===4}function cr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||If(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.tag===27&&Hl(e.type)||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 or(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=hu));else if(a!==4&&(a===27&&Hl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(or(e,t,l),e=e.sibling;e!==null;)or(e,t,l),e=e.sibling}function lu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Hl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(lu(e,t,l),e=e.sibling;e!==null;)lu(e,t,l),e=e.sibling}function ed(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);ot(t,a,l),t[Ne]=e,t[lt]=l}catch(u){Oe(e,e.return,u)}}var hl=!1,Je=!1,fr=!1,td=typeof WeakSet=="function"?WeakSet:Set,st=null;function jm(e,t){if(e=e.containerInfo,zr=bu,e=oo(e),ci(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var o=0,m=-1,b=-1,R=0,L=0,$=e,D=null;t:for(;;){for(var _;$!==l||n!==0&&$.nodeType!==3||(m=o+n),$!==u||a!==0&&$.nodeType!==3||(b=o+a),$.nodeType===3&&(o+=$.nodeValue.length),(_=$.firstChild)!==null;)D=$,$=_;for(;;){if($===e)break t;if(D===l&&++R===n&&(m=o),D===u&&++L===a&&(b=o),(_=$.nextSibling)!==null)break;$=D,D=$.parentNode}$=_}l=m===-1||b===-1?null:{start:m,end:b}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ur={focusedElem:e,selectionRange:l},bu=!1,st=t;st!==null;)if(t=st,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,st=e;else for(;st!==null;){switch(t=st,u=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,l=t,n=u.memoizedProps,u=u.memoizedState,a=l.stateNode;try{var fe=ia(l.type,n,l.elementType===l.type);e=a.getSnapshotBeforeUpdate(fe,u),a.__reactInternalSnapshotBeforeUpdate=e}catch(ce){Oe(l,l.return,ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Br(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Br(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,st=e;break}st=t.return}}function ld(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Al(e,l),a&4&&Dn(5,l);break;case 1:if(Al(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(o){Oe(l,l.return,o)}else{var n=ia(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Oe(l,l.return,o)}}a&64&&Ff(l),a&512&&_n(l,l.return);break;case 3:if(Al(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Uo(e,t)}catch(o){Oe(l,l.return,o)}}break;case 27:t===null&&a&4&&ed(l);case 26:case 5:Al(e,l),t===null&&a&4&&Pf(l),a&512&&_n(l,l.return);break;case 12:Al(e,l);break;case 13:Al(e,l),a&4&&sd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=_m.bind(null,l),Pm(e,l))));break;case 22:if(a=l.memoizedState!==null||hl,!a){t=t!==null&&t.memoizedState!==null||Je,n=hl;var u=Je;hl=a,(Je=t)&&!u?Rl(e,l,(l.subtreeFlags&8772)!==0):Al(e,l),hl=n,Je=u}break;case 30:break;default:Al(e,l)}}function ad(e){var t=e.alternate;t!==null&&(e.alternate=null,ad(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Xu(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Be=null,xt=!1;function ml(e,t,l){for(l=l.child;l!==null;)nd(e,t,l),l=l.sibling}function nd(e,t,l){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(Xl,l)}catch{}switch(l.tag){case 26:Je||Wt(l,t),ml(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Je||Wt(l,t);var a=Be,n=xt;Hl(l.type)&&(Be=l.stateNode,xt=!1),ml(e,t,l),Gn(l.stateNode),Be=a,xt=n;break;case 5:Je||Wt(l,t);case 6:if(a=Be,n=xt,Be=null,ml(e,t,l),Be=a,xt=n,Be!==null)if(xt)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(l.stateNode)}catch(u){Oe(l,t,u)}else try{Be.removeChild(l.stateNode)}catch(u){Oe(l,t,u)}break;case 18:Be!==null&&(xt?(e=Be,Zd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Wn(e)):Zd(Be,l.stateNode));break;case 4:a=Be,n=xt,Be=l.stateNode.containerInfo,xt=!0,ml(e,t,l),Be=a,xt=n;break;case 0:case 11:case 14:case 15:Je||kl(2,l,t),Je||kl(4,l,t),ml(e,t,l);break;case 1:Je||(Wt(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Wf(l,t,a)),ml(e,t,l);break;case 21:ml(e,t,l);break;case 22:Je=(a=Je)||l.memoizedState!==null,ml(e,t,l),Je=a;break;default:ml(e,t,l)}}function sd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wn(e)}catch(l){Oe(t,t.return,l)}}function Nm(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new td),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new td),t;default:throw Error(r(435,e.tag))}}function dr(e,t){var l=Nm(e);t.forEach(function(a){var n=zm.bind(null,e,a);l.has(a)||(l.add(a),a.then(n,n))})}function Et(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],u=e,o=t,m=o;e:for(;m!==null;){switch(m.tag){case 27:if(Hl(m.type)){Be=m.stateNode,xt=!1;break e}break;case 5:Be=m.stateNode,xt=!1;break e;case 3:case 4:Be=m.stateNode.containerInfo,xt=!0;break e}m=m.return}if(Be===null)throw Error(r(160));nd(u,o,n),Be=null,xt=!1,u=n.alternate,u!==null&&(u.return=null),n.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)ud(t,e),t=t.sibling}var Xt=null;function ud(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Et(t,e),wt(e),a&4&&(kl(3,e,e.return),Dn(3,e),kl(5,e,e.return));break;case 1:Et(t,e),wt(e),a&512&&(Je||l===null||Wt(l,l.return)),a&64&&hl&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=Xt;if(Et(t,e),wt(e),a&512&&(Je||l===null||Wt(l,l.return)),a&4){var u=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":u=n.getElementsByTagName("title")[0],(!u||u[an]||u[Ne]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=n.createElement(a),n.head.insertBefore(u,n.querySelector("head > title"))),ot(u,a,l),u[Ne]=e,at(u),a=u;break e;case"link":var o=e0("link","href",n).get(a+(l.href||""));if(o){for(var m=0;m<o.length;m++)if(u=o[m],u.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&u.getAttribute("rel")===(l.rel==null?null:l.rel)&&u.getAttribute("title")===(l.title==null?null:l.title)&&u.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){o.splice(m,1);break t}}u=n.createElement(a),ot(u,a,l),n.head.appendChild(u);break;case"meta":if(o=e0("meta","content",n).get(a+(l.content||""))){for(m=0;m<o.length;m++)if(u=o[m],u.getAttribute("content")===(l.content==null?null:""+l.content)&&u.getAttribute("name")===(l.name==null?null:l.name)&&u.getAttribute("property")===(l.property==null?null:l.property)&&u.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&u.getAttribute("charset")===(l.charSet==null?null:l.charSet)){o.splice(m,1);break t}}u=n.createElement(a),ot(u,a,l),n.head.appendChild(u);break;default:throw Error(r(468,a))}u[Ne]=e,at(u),a=u}e.stateNode=a}else t0(n,e.type,e.stateNode);else e.stateNode=Id(n,a,e.memoizedProps);else u!==a?(u===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):u.count--,a===null?t0(n,e.type,e.stateNode):Id(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&rr(e,e.memoizedProps,l.memoizedProps)}break;case 27:Et(t,e),wt(e),a&512&&(Je||l===null||Wt(l,l.return)),l!==null&&a&4&&rr(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Et(t,e),wt(e),a&512&&(Je||l===null||Wt(l,l.return)),e.flags&32){n=e.stateNode;try{Sa(n,"")}catch(_){Oe(e,e.return,_)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,rr(e,n,l!==null?l.memoizedProps:n)),a&1024&&(fr=!0);break;case 6:if(Et(t,e),wt(e),a&4){if(e.stateNode===null)throw Error(r(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(_){Oe(e,e.return,_)}}break;case 3:if(vu=null,n=Xt,Xt=gu(t.containerInfo),Et(t,e),Xt=n,wt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{Wn(t.containerInfo)}catch(_){Oe(e,e.return,_)}fr&&(fr=!1,id(e));break;case 4:a=Xt,Xt=gu(e.stateNode.containerInfo),Et(t,e),wt(e),Xt=a;break;case 12:Et(t,e),wt(e);break;case 13:Et(t,e),wt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(xr=Ct()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,dr(e,a)));break;case 22:n=e.memoizedState!==null;var b=l!==null&&l.memoizedState!==null,R=hl,L=Je;if(hl=R||n,Je=L||b,Et(t,e),Je=L,hl=R,wt(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||b||hl||Je||ra(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){b=l=t;try{if(u=b.stateNode,n)o=u.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{m=b.stateNode;var $=b.memoizedProps.style,D=$!=null&&$.hasOwnProperty("display")?$.display:null;m.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(_){Oe(b,b.return,_)}}}else if(t.tag===6){if(l===null){b=t;try{b.stateNode.nodeValue=n?"":b.memoizedProps}catch(_){Oe(b,b.return,_)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,dr(e,l))));break;case 19:Et(t,e),wt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,dr(e,a)));break;case 30:break;case 21:break;default:Et(t,e),wt(e)}}function wt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(If(a)){l=a;break}a=a.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var n=l.stateNode,u=cr(e);lu(e,u,n);break;case 5:var o=l.stateNode;l.flags&32&&(Sa(o,""),l.flags&=-33);var m=cr(e);lu(e,m,o);break;case 3:case 4:var b=l.stateNode.containerInfo,R=cr(e);or(e,R,b);break;default:throw Error(r(161))}}catch(L){Oe(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function id(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;id(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Al(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ld(e,t.alternate,t),t=t.sibling}function ra(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:kl(4,t,t.return),ra(t);break;case 1:Wt(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Wf(t,t.return,l),ra(t);break;case 27:Gn(t.stateNode);case 26:case 5:Wt(t,t.return),ra(t);break;case 22:t.memoizedState===null&&ra(t);break;case 30:ra(t);break;default:ra(t)}e=e.sibling}}function Rl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,u=t,o=u.flags;switch(u.tag){case 0:case 11:case 15:Rl(n,u,l),Dn(4,u);break;case 1:if(Rl(n,u,l),a=u,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(R){Oe(a,a.return,R)}if(a=u,n=a.updateQueue,n!==null){var m=a.stateNode;try{var b=n.shared.hiddenCallbacks;if(b!==null)for(n.shared.hiddenCallbacks=null,n=0;n<b.length;n++)zo(b[n],m)}catch(R){Oe(a,a.return,R)}}l&&o&64&&Ff(u),_n(u,u.return);break;case 27:ed(u);case 26:case 5:Rl(n,u,l),l&&a===null&&o&4&&Pf(u),_n(u,u.return);break;case 12:Rl(n,u,l);break;case 13:Rl(n,u,l),l&&o&4&&sd(n,u);break;case 22:u.memoizedState===null&&Rl(n,u,l),_n(u,u.return);break;case 30:break;default:Rl(n,u,l)}t=t.sibling}}function hr(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&yn(l))}function mr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yn(e))}function Pt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rd(e,t,l,a),t=t.sibling}function rd(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Pt(e,t,l,a),n&2048&&Dn(9,t);break;case 1:Pt(e,t,l,a);break;case 3:Pt(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&yn(e)));break;case 12:if(n&2048){Pt(e,t,l,a),e=t.stateNode;try{var u=t.memoizedProps,o=u.id,m=u.onPostCommit;typeof m=="function"&&m(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){Oe(t,t.return,b)}}else Pt(e,t,l,a);break;case 13:Pt(e,t,l,a);break;case 23:break;case 22:u=t.stateNode,o=t.alternate,t.memoizedState!==null?u._visibility&2?Pt(e,t,l,a):zn(e,t):u._visibility&2?Pt(e,t,l,a):(u._visibility|=2,qa(e,t,l,a,(t.subtreeFlags&10256)!==0)),n&2048&&hr(o,t);break;case 24:Pt(e,t,l,a),n&2048&&mr(t.alternate,t);break;default:Pt(e,t,l,a)}}function qa(e,t,l,a,n){for(n=n&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var u=e,o=t,m=l,b=a,R=o.flags;switch(o.tag){case 0:case 11:case 15:qa(u,o,m,b,n),Dn(8,o);break;case 23:break;case 22:var L=o.stateNode;o.memoizedState!==null?L._visibility&2?qa(u,o,m,b,n):zn(u,o):(L._visibility|=2,qa(u,o,m,b,n)),n&&R&2048&&hr(o.alternate,o);break;case 24:qa(u,o,m,b,n),n&&R&2048&&mr(o.alternate,o);break;default:qa(u,o,m,b,n)}t=t.sibling}}function zn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:zn(l,a),n&2048&&hr(a.alternate,a);break;case 24:zn(l,a),n&2048&&mr(a.alternate,a);break;default:zn(l,a)}t=t.sibling}}var Un=8192;function Ya(e){if(e.subtreeFlags&Un)for(e=e.child;e!==null;)cd(e),e=e.sibling}function cd(e){switch(e.tag){case 26:Ya(e),e.flags&Un&&e.memoizedState!==null&&fg(Xt,e.memoizedState,e.memoizedProps);break;case 5:Ya(e);break;case 3:case 4:var t=Xt;Xt=gu(e.stateNode.containerInfo),Ya(e),Xt=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Un,Un=16777216,Ya(e),Un=t):Ya(e));break;default:Ya(e)}}function od(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];st=a,dd(a,e)}od(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)fd(e),e=e.sibling}function fd(e){switch(e.tag){case 0:case 11:case 15:Hn(e),e.flags&2048&&kl(9,e,e.return);break;case 3:Hn(e);break;case 12:Hn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,au(e)):Hn(e);break;default:Hn(e)}}function au(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];st=a,dd(a,e)}od(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:kl(8,t,t.return),au(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,au(t));break;default:au(t)}e=e.sibling}}function dd(e,t){for(;st!==null;){var l=st;switch(l.tag){case 0:case 11:case 15:kl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:yn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,st=a;else e:for(l=e;st!==null;){a=st;var n=a.sibling,u=a.return;if(ad(a),a===l){st=null;break e}if(n!==null){n.return=u,st=n;break e}st=u}}}var Tm={getCacheForType:function(e){var t=ft(Ie),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l}},Cm=typeof WeakMap=="function"?WeakMap:Map,Te=0,ze=null,ve=null,be=0,Ce=0,Mt=null,Ol=!1,$a=!1,gr=!1,gl=0,Ve=0,Dl=0,ca=0,pr=0,Lt=0,Ga=0,Ln=null,yt=null,vr=!1,xr=0,nu=1/0,su=null,_l=null,ct=0,zl=null,Xa=null,Va=0,yr=0,br=null,hd=null,Bn=0,Sr=null;function jt(){if((Te&2)!==0&&be!==0)return be&-be;if(w.T!==null){var e=Oa;return e!==0?e:Cr()}return Fe()}function md(){Lt===0&&(Lt=(be&536870912)===0||Me?gs():536870912);var e=Ht.current;return e!==null&&(e.flags|=32),Lt}function Nt(e,t,l){(e===ze&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(Za(e,0),Ul(e,be,Lt,!1)),we(e,l),((Te&2)===0||e!==ze)&&(e===ze&&((Te&2)===0&&(ca|=l),Ve===4&&Ul(e,be,Lt,!1)),It(e))}function gd(e,t,l){if((Te&6)!==0)throw Error(r(327));var a=!l&&(t&124)===0&&(t&e.expiredLanes)===0||Zl(e,t),n=a?Rm(e,t):Mr(e,t,!0),u=a;do{if(n===0){$a&&!a&&Ul(e,t,0,!1);break}else{if(l=e.current.alternate,u&&!km(l)){n=Mr(e,t,!1),u=!1;continue}if(n===2){if(u=t,e.errorRecoveryDisabledLanes&u)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var m=e;n=Ln;var b=m.current.memoizedState.isDehydrated;if(b&&(Za(m,o).flags|=256),o=Mr(m,o,!1),o!==2){if(gr&&!b){m.errorRecoveryDisabledLanes|=u,ca|=u,n=4;break e}u=yt,yt=n,u!==null&&(yt===null?yt=u:yt.push.apply(yt,u))}n=o}if(u=!1,n!==2)continue}}if(n===1){Za(e,0),Ul(e,t,0,!0);break}e:{switch(a=e,u=n,u){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:Ul(a,t,Lt,!Ol);break e;case 2:yt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(n=xr+300-Ct(),10<n)){if(Ul(a,t,Lt,!Ol),Vl(a,0,!0)!==0)break e;a.timeoutHandle=Xd(pd.bind(null,a,l,yt,su,vr,t,Lt,ca,Ga,Ol,u,2,-0,0),n);break e}pd(a,l,yt,su,vr,t,Lt,ca,Ga,Ol,u,0,-0,0)}}break}while(!0);It(e)}function pd(e,t,l,a,n,u,o,m,b,R,L,$,D,_){if(e.timeoutHandle=-1,$=t.subtreeFlags,($&8192||($&16785408)===16785408)&&(Zn={stylesheets:null,count:0,unsuspend:og},cd(t),$=dg(),$!==null)){e.cancelPendingCommit=$(wd.bind(null,e,t,u,l,a,n,o,m,b,L,1,D,_)),Ul(e,u,o,!R);return}wd(e,t,u,l,a,n,o,m,b)}function km(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],u=n.getSnapshot;n=n.value;try{if(!bt(u(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 Ul(e,t,l,a){t&=~pr,t&=~ca,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var u=31-mt(n),o=1<<u;a[u]=-1,n&=~o}l!==0&&Qe(e,l,t)}function uu(){return(Te&6)===0?(qn(0),!1):!0}function Er(){if(ve!==null){if(Ce===0)var e=ve.return;else e=ve,il=aa=null,Bi(e),La=null,An=0,e=ve;for(;e!==null;)Jf(e.alternate,e),e=e.return;ve=null}}function Za(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Qm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Er(),ze=e,ve=l=nl(e.current,null),be=t,Ce=0,Mt=null,Ol=!1,$a=Zl(e,t),gr=!1,Ga=Lt=pr=ca=Dl=Ve=0,yt=Ln=null,vr=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-mt(a),u=1<<n;t|=e[n],a&=~u}return gl=t,Cs(),l}function vd(e,t){me=null,w.H=Qs,t===Sn||t===Hs?(t=Do(),Ce=3):t===Ao?(t=Do(),Ce=4):Ce=t===zf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Mt=t,ve===null&&(Ve=1,Ps(e,Dt(t,e.current)))}function xd(){var e=w.H;return w.H=Qs,e===null?Qs:e}function yd(){var e=w.A;return w.A=Tm,e}function wr(){Ve=4,Ol||(be&4194048)!==be&&Ht.current!==null||($a=!0),(Dl&134217727)===0&&(ca&134217727)===0||ze===null||Ul(ze,be,Lt,!1)}function Mr(e,t,l){var a=Te;Te|=2;var n=xd(),u=yd();(ze!==e||be!==t)&&(su=null,Za(e,t)),t=!1;var o=Ve;e:do try{if(Ce!==0&&ve!==null){var m=ve,b=Mt;switch(Ce){case 8:Er(),o=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var R=Ce;if(Ce=0,Mt=null,Qa(e,m,b,R),l&&$a){o=0;break e}break;default:R=Ce,Ce=0,Mt=null,Qa(e,m,b,R)}}Am(),o=Ve;break}catch(L){vd(e,L)}while(!0);return t&&e.shellSuspendCounter++,il=aa=null,Te=a,w.H=n,w.A=u,ve===null&&(ze=null,be=0,Cs()),o}function Am(){for(;ve!==null;)bd(ve)}function Rm(e,t){var l=Te;Te|=2;var a=xd(),n=yd();ze!==e||be!==t?(su=null,nu=Ct()+500,Za(e,t)):$a=Zl(e,t);e:do try{if(Ce!==0&&ve!==null){t=ve;var u=Mt;t:switch(Ce){case 1:Ce=0,Mt=null,Qa(e,t,u,1);break;case 2:case 9:if(Ro(u)){Ce=0,Mt=null,Sd(t);break}t=function(){Ce!==2&&Ce!==9||ze!==e||(Ce=7),It(e)},u.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:Ro(u)?(Ce=0,Mt=null,Sd(t)):(Ce=0,Mt=null,Qa(e,t,u,7));break;case 5:var o=null;switch(ve.tag){case 26:o=ve.memoizedState;case 5:case 27:var m=ve;if(!o||l0(o)){Ce=0,Mt=null;var b=m.sibling;if(b!==null)ve=b;else{var R=m.return;R!==null?(ve=R,iu(R)):ve=null}break t}}Ce=0,Mt=null,Qa(e,t,u,5);break;case 6:Ce=0,Mt=null,Qa(e,t,u,6);break;case 8:Er(),Ve=6;break e;default:throw Error(r(462))}}Om();break}catch(L){vd(e,L)}while(!0);return il=aa=null,w.H=a,w.A=n,Te=l,ve!==null?0:(ze=null,be=0,Cs(),Ve)}function Om(){for(;ve!==null&&!ds();)bd(ve)}function bd(e){var t=Qf(e.alternate,e,gl);e.memoizedProps=e.pendingProps,t===null?iu(e):ve=t}function Sd(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Yf(l,t,t.pendingProps,t.type,void 0,be);break;case 11:t=Yf(l,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:Bi(t);default:Jf(l,t),t=ve=So(t,gl),t=Qf(l,t,gl)}e.memoizedProps=e.pendingProps,t===null?iu(e):ve=t}function Qa(e,t,l,a){il=aa=null,Bi(t),La=null,An=0;var n=t.return;try{if(Sm(e,n,t,l,be)){Ve=1,Ps(e,Dt(l,e.current)),ve=null;return}}catch(u){if(n!==null)throw ve=n,u;Ve=1,Ps(e,Dt(l,e.current)),ve=null;return}t.flags&32768?(Me||a===1?e=!0:$a||(be&536870912)!==0?e=!1:(Ol=e=!0,(a===2||a===9||a===3||a===6)&&(a=Ht.current,a!==null&&a.tag===13&&(a.flags|=16384))),Ed(t,e)):iu(t)}function iu(e){var t=e;do{if((t.flags&32768)!==0){Ed(t,Ol);return}e=t.return;var l=wm(t.alternate,t,gl);if(l!==null){ve=l;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);Ve===0&&(Ve=5)}function Ed(e,t){do{var l=Mm(e.alternate,e);if(l!==null){l.flags&=32767,ve=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ve=e;return}ve=e=l}while(e!==null);Ve=6,ve=null}function wd(e,t,l,a,n,u,o,m,b){e.cancelPendingCommit=null;do ru();while(ct!==0);if((Te&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(u=t.lanes|t.childLanes,u|=mi,it(e,l,u,o,m,b),e===ze&&(ve=ze=null,be=0),Xa=t,zl=e,Va=l,yr=u,br=n,hd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Um($t,function(){return Cd(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=w.T,w.T=null,n=U.p,U.p=2,o=Te,Te|=4;try{jm(e,t,l)}finally{Te=o,U.p=n,w.T=a}}ct=1,Md(),jd(),Nd()}}function Md(){if(ct===1){ct=0;var e=zl,t=Xa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=w.T,w.T=null;var a=U.p;U.p=2;var n=Te;Te|=4;try{ud(t,e);var u=Ur,o=oo(e.containerInfo),m=u.focusedElem,b=u.selectionRange;if(o!==m&&m&&m.ownerDocument&&co(m.ownerDocument.documentElement,m)){if(b!==null&&ci(m)){var R=b.start,L=b.end;if(L===void 0&&(L=R),"selectionStart"in m)m.selectionStart=R,m.selectionEnd=Math.min(L,m.value.length);else{var $=m.ownerDocument||document,D=$&&$.defaultView||window;if(D.getSelection){var _=D.getSelection(),fe=m.textContent.length,ce=Math.min(b.start,fe),Re=b.end===void 0?ce:Math.min(b.end,fe);!_.extend&&ce>Re&&(o=Re,Re=ce,ce=o);var N=ro(m,ce),M=ro(m,Re);if(N&&M&&(_.rangeCount!==1||_.anchorNode!==N.node||_.anchorOffset!==N.offset||_.focusNode!==M.node||_.focusOffset!==M.offset)){var k=$.createRange();k.setStart(N.node,N.offset),_.removeAllRanges(),ce>Re?(_.addRange(k),_.extend(M.node,M.offset)):(k.setEnd(M.node,M.offset),_.addRange(k))}}}}for($=[],_=m;_=_.parentNode;)_.nodeType===1&&$.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<$.length;m++){var q=$[m];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}bu=!!zr,Ur=zr=null}finally{Te=n,U.p=a,w.T=l}}e.current=t,ct=2}}function jd(){if(ct===2){ct=0;var e=zl,t=Xa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=w.T,w.T=null;var a=U.p;U.p=2;var n=Te;Te|=4;try{ld(e,t.alternate,t)}finally{Te=n,U.p=a,w.T=l}}ct=3}}function Nd(){if(ct===4||ct===3){ct=0,hs();var e=zl,t=Xa,l=Va,a=hd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ct=5:(ct=0,Xa=zl=null,Td(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(_l=null),ye(l),t=t.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(Xl,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=w.T,n=U.p,U.p=2,w.T=null;try{for(var u=e.onRecoverableError,o=0;o<a.length;o++){var m=a[o];u(m.value,{componentStack:m.stack})}}finally{w.T=t,U.p=n}}(Va&3)!==0&&ru(),It(e),n=e.pendingLanes,(l&4194090)!==0&&(n&42)!==0?e===Sr?Bn++:(Bn=0,Sr=e):Bn=0,qn(0)}}function Td(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,yn(t)))}function ru(e){return Md(),jd(),Nd(),Cd()}function Cd(){if(ct!==5)return!1;var e=zl,t=yr;yr=0;var l=ye(Va),a=w.T,n=U.p;try{U.p=32>l?32:l,w.T=null,l=br,br=null;var u=zl,o=Va;if(ct=0,Xa=zl=null,Va=0,(Te&6)!==0)throw Error(r(331));var m=Te;if(Te|=4,fd(u.current),rd(u,u.current,o,l),Te=m,qn(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(Xl,u)}catch{}return!0}finally{U.p=n,w.T=a,Td(e,t)}}function kd(e,t,l){t=Dt(l,t),t=Ii(e.stateNode,t,2),e=jl(e,t,2),e!==null&&(we(e,2),It(e))}function Oe(e,t,l){if(e.tag===3)kd(e,e,l);else for(;t!==null;){if(t.tag===3){kd(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(_l===null||!_l.has(a))){e=Dt(l,e),l=Df(2),a=jl(t,l,2),a!==null&&(_f(l,a,t,e),we(a,2),It(a));break}}t=t.return}}function jr(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Cm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(gr=!0,n.add(l),e=Dm.bind(null,e,t,l),t.then(e,e))}function Dm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,ze===e&&(be&l)===l&&(Ve===4||Ve===3&&(be&62914560)===be&&300>Ct()-xr?(Te&2)===0&&Za(e,0):pr|=l,Ga===be&&(Ga=0)),It(e)}function Ad(e,t){t===0&&(t=ps()),e=Ca(e,t),e!==null&&(we(e,t),It(e))}function _m(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Ad(e,l)}function zm(e,t){var l=0;switch(e.tag){case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),Ad(e,l)}function Um(e,t){return qt(e,t)}var cu=null,Ka=null,Nr=!1,ou=!1,Tr=!1,oa=0;function It(e){e!==Ka&&e.next===null&&(Ka===null?cu=Ka=e:Ka=Ka.next=e),ou=!0,Nr||(Nr=!0,Lm())}function qn(e,t){if(!Tr&&ou){Tr=!0;do for(var l=!1,a=cu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var o=a.suspendedLanes,m=a.pingedLanes;u=(1<<31-mt(42|e)+1)-1,u&=n&~(o&~m),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,_d(a,u))}else u=be,u=Vl(a,a===ze?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Zl(a,u)||(l=!0,_d(a,u));a=a.next}while(l);Tr=!1}}function Hm(){Rd()}function Rd(){ou=Nr=!1;var e=0;oa!==0&&(Zm()&&(e=oa),oa=0);for(var t=Ct(),l=null,a=cu;a!==null;){var n=a.next,u=Od(a,t);u===0?(a.next=null,l===null?cu=n:l.next=n,n===null&&(Ka=l)):(l=a,(e!==0||(u&3)!==0)&&(ou=!0)),a=n}qn(e)}function Od(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var o=31-mt(u),m=1<<o,b=n[o];b===-1?((m&l)===0||(m&a)!==0)&&(n[o]=$u(m,t)):b<=t&&(e.expiredLanes|=m),u&=~m}if(t=ze,l=be,l=Vl(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Tt(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Zl(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Tt(a),ye(l)){case 2:case 8:l=Yt;break;case 32:l=$t;break;case 268435456:l=kt;break;default:l=$t}return a=Dd.bind(null,e),l=qt(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Tt(a),e.callbackPriority=2,e.callbackNode=null,2}function Dd(e,t){if(ct!==0&&ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(ru()&&e.callbackNode!==l)return null;var a=be;return a=Vl(e,e===ze?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(gd(e,a,t),Od(e,Ct()),e.callbackNode!=null&&e.callbackNode===l?Dd.bind(null,e):null)}function _d(e,t){if(ru())return null;gd(e,t,!0)}function Lm(){Km(function(){(Te&6)!==0?qt(ln,Hm):Rd()})}function Cr(){return oa===0&&(oa=gs()),oa}function zd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ss(""+e)}function Ud(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Bm(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var u=zd((n[lt]||null).action),o=a.submitter;o&&(t=(t=o[lt]||null)?zd(t.formAction):o.getAttribute("formAction"),t!==null&&(u=t,o=null));var m=new js("action","action",null,a,n);e.push({event:m,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(oa!==0){var b=o?Ud(n,o):new FormData(n);Ki(l,{pending:!0,data:b,method:n.method,action:u},null,b)}}else typeof u=="function"&&(m.preventDefault(),b=o?Ud(n,o):new FormData(n),Ki(l,{pending:!0,data:b,method:n.method,action:u},u,b))},currentTarget:n}]})}}for(var kr=0;kr<hi.length;kr++){var Ar=hi[kr],qm=Ar.toLowerCase(),Ym=Ar[0].toUpperCase()+Ar.slice(1);Gt(qm,"on"+Ym)}Gt(mo,"onAnimationEnd"),Gt(go,"onAnimationIteration"),Gt(po,"onAnimationStart"),Gt("dblclick","onDoubleClick"),Gt("focusin","onFocus"),Gt("focusout","onBlur"),Gt(nm,"onTransitionRun"),Gt(sm,"onTransitionStart"),Gt(um,"onTransitionCancel"),Gt(vo,"onTransitionEnd"),xa("onMouseEnter",["mouseout","mouseover"]),xa("onMouseLeave",["mouseout","mouseover"]),xa("onPointerEnter",["pointerout","pointerover"]),xa("onPointerLeave",["pointerout","pointerover"]),Kl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yn="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(" "),$m=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yn));function Hd(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var o=a.length-1;0<=o;o--){var m=a[o],b=m.instance,R=m.currentTarget;if(m=m.listener,b!==u&&n.isPropagationStopped())break e;u=m,n.currentTarget=R;try{u(n)}catch(L){Ws(L)}n.currentTarget=null,u=b}else for(o=0;o<a.length;o++){if(m=a[o],b=m.instance,R=m.currentTarget,m=m.listener,b!==u&&n.isPropagationStopped())break e;u=m,n.currentTarget=R;try{u(n)}catch(L){Ws(L)}n.currentTarget=null,u=b}}}}function xe(e,t){var l=t[Ql];l===void 0&&(l=t[Ql]=new Set);var a=e+"__bubble";l.has(a)||(Ld(t,e,2,!1),l.add(a))}function Rr(e,t,l){var a=0;t&&(a|=4),Ld(l,e,a,t)}var fu="_reactListening"+Math.random().toString(36).slice(2);function Or(e){if(!e[fu]){e[fu]=!0,kc.forEach(function(l){l!=="selectionchange"&&($m.has(l)||Rr(l,!1,e),Rr(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fu]||(t[fu]=!0,Rr("selectionchange",!1,t))}}function Ld(e,t,l,a){switch(r0(t)){case 2:var n=gg;break;case 8:n=pg;break;default:n=Zr}l=n.bind(null,t,l,e),n=void 0,!ei||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function Dr(e,t,l,a,n){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var o=a.tag;if(o===3||o===4){var m=a.stateNode.containerInfo;if(m===n)break;if(o===4)for(o=a.return;o!==null;){var b=o.tag;if((b===3||b===4)&&o.stateNode.containerInfo===n)return;o=o.return}for(;m!==null;){if(o=ga(m),o===null)return;if(b=o.tag,b===5||b===6||b===26||b===27){a=u=o;continue e}m=m.parentNode}}a=a.return}Gc(function(){var R=u,L=Pu(l),$=[];e:{var D=xo.get(e);if(D!==void 0){var _=js,fe=e;switch(e){case"keypress":if(ws(l)===0)break e;case"keydown":case"keyup":_=Uh;break;case"focusin":fe="focus",_=ni;break;case"focusout":fe="blur",_=ni;break;case"beforeblur":case"afterblur":_=ni;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=Zc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=Mh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=Bh;break;case mo:case go:case po:_=Th;break;case vo:_=Yh;break;case"scroll":case"scrollend":_=Eh;break;case"wheel":_=Gh;break;case"copy":case"cut":case"paste":_=kh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=Kc;break;case"toggle":case"beforetoggle":_=Vh}var ce=(t&4)!==0,Re=!ce&&(e==="scroll"||e==="scrollend"),N=ce?D!==null?D+"Capture":null:D;ce=[];for(var M=R,k;M!==null;){var q=M;if(k=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||k===null||N===null||(q=sn(M,N),q!=null&&ce.push($n(M,q,k))),Re)break;M=M.return}0<ce.length&&(D=new _(D,fe,null,l,L),$.push({event:D,listeners:ce}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",D&&l!==Wu&&(fe=l.relatedTarget||l.fromElement)&&(ga(fe)||fe[At]))break e;if((_||D)&&(D=L.window===L?L:(D=L.ownerDocument)?D.defaultView||D.parentWindow:window,_?(fe=l.relatedTarget||l.toElement,_=R,fe=fe?ga(fe):null,fe!==null&&(Re=g(fe),ce=fe.tag,fe!==Re||ce!==5&&ce!==27&&ce!==6)&&(fe=null)):(_=null,fe=R),_!==fe)){if(ce=Zc,q="onMouseLeave",N="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ce=Kc,q="onPointerLeave",N="onPointerEnter",M="pointer"),Re=_==null?D:nn(_),k=fe==null?D:nn(fe),D=new ce(q,M+"leave",_,l,L),D.target=Re,D.relatedTarget=k,q=null,ga(L)===R&&(ce=new ce(N,M+"enter",fe,l,L),ce.target=k,ce.relatedTarget=Re,q=ce),Re=q,_&&fe)t:{for(ce=_,N=fe,M=0,k=ce;k;k=Ja(k))M++;for(k=0,q=N;q;q=Ja(q))k++;for(;0<M-k;)ce=Ja(ce),M--;for(;0<k-M;)N=Ja(N),k--;for(;M--;){if(ce===N||N!==null&&ce===N.alternate)break t;ce=Ja(ce),N=Ja(N)}ce=null}else ce=null;_!==null&&Bd($,D,_,ce,!1),fe!==null&&Re!==null&&Bd($,Re,fe,ce,!0)}}e:{if(D=R?nn(R):window,_=D.nodeName&&D.nodeName.toLowerCase(),_==="select"||_==="input"&&D.type==="file")var te=lo;else if(eo(D))if(ao)te=tm;else{te=Ih;var ge=Ph}else _=D.nodeName,!_||_.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?R&&Fu(R.elementType)&&(te=lo):te=em;if(te&&(te=te(e,R))){to($,te,l,L);break e}ge&&ge(e,D,R),e==="focusout"&&R&&D.type==="number"&&R.memoizedProps.value!=null&&Ju(D,"number",D.value)}switch(ge=R?nn(R):window,e){case"focusin":(eo(ge)||ge.contentEditable==="true")&&(ja=ge,oi=R,mn=null);break;case"focusout":mn=oi=ja=null;break;case"mousedown":fi=!0;break;case"contextmenu":case"mouseup":case"dragend":fi=!1,fo($,l,L);break;case"selectionchange":if(am)break;case"keydown":case"keyup":fo($,l,L)}var re;if(ui)e:{switch(e){case"compositionstart":var oe="onCompositionStart";break e;case"compositionend":oe="onCompositionEnd";break e;case"compositionupdate":oe="onCompositionUpdate";break e}oe=void 0}else Ma?Pc(e,l)&&(oe="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(oe="onCompositionStart");oe&&(Jc&&l.locale!=="ko"&&(Ma||oe!=="onCompositionStart"?oe==="onCompositionEnd"&&Ma&&(re=Xc()):(Sl=L,ti="value"in Sl?Sl.value:Sl.textContent,Ma=!0)),ge=du(R,oe),0<ge.length&&(oe=new Qc(oe,e,null,l,L),$.push({event:oe,listeners:ge}),re?oe.data=re:(re=Ic(l),re!==null&&(oe.data=re)))),(re=Qh?Kh(e,l):Jh(e,l))&&(oe=du(R,"onBeforeInput"),0<oe.length&&(ge=new Qc("onBeforeInput","beforeinput",null,l,L),$.push({event:ge,listeners:oe}),ge.data=re)),Bm($,e,R,l,L)}Hd($,t)})}function $n(e,t,l){return{instance:e,listener:t,currentTarget:l}}function du(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,u=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||u===null||(n=sn(e,l),n!=null&&a.unshift($n(e,n,u)),n=sn(e,t),n!=null&&a.push($n(e,n,u))),e.tag===3)return a;e=e.return}return[]}function Ja(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Bd(e,t,l,a,n){for(var u=t._reactName,o=[];l!==null&&l!==a;){var m=l,b=m.alternate,R=m.stateNode;if(m=m.tag,b!==null&&b===a)break;m!==5&&m!==26&&m!==27||R===null||(b=R,n?(R=sn(l,u),R!=null&&o.unshift($n(l,R,b))):n||(R=sn(l,u),R!=null&&o.push($n(l,R,b)))),l=l.return}o.length!==0&&e.push({event:t,listeners:o})}var Gm=/\r\n?/g,Xm=/\u0000|\uFFFD/g;function qd(e){return(typeof e=="string"?e:""+e).replace(Gm,`
`).replace(Xm,"")}function Yd(e,t){return t=qd(t),qd(e)===t}function hu(){}function Ae(e,t,l,a,n,u){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Sa(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Sa(e,""+a);break;case"className":xs(e,"class",a);break;case"tabIndex":xs(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":xs(e,l,a);break;case"style":Yc(e,a,u);break;case"data":if(t!=="object"){xs(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Ss(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(l==="formAction"?(t!=="input"&&Ae(e,t,"name",n.name,n,null),Ae(e,t,"formEncType",n.formEncType,n,null),Ae(e,t,"formMethod",n.formMethod,n,null),Ae(e,t,"formTarget",n.formTarget,n,null)):(Ae(e,t,"encType",n.encType,n,null),Ae(e,t,"method",n.method,n,null),Ae(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Ss(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=hu);break;case"onScroll":a!=null&&xe("scroll",e);break;case"onScrollEnd":a!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Ss(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":xe("beforetoggle",e),xe("toggle",e),vs(e,"popover",a);break;case"xlinkActuate":ll(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ll(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ll(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ll(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ll(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ll(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ll(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ll(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ll(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":vs(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=bh.get(l)||l,vs(e,l,a))}}function _r(e,t,l,a,n,u){switch(l){case"style":Yc(e,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Sa(e,a):(typeof a=="number"||typeof a=="bigint")&&Sa(e,""+a);break;case"onScroll":a!=null&&xe("scroll",e);break;case"onScrollEnd":a!=null&&xe("scrollend",e);break;case"onClick":a!=null&&(e.onclick=hu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ac.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),u=e[lt]||null,u=u!=null?u[l]:null,typeof u=="function"&&e.removeEventListener(t,u,n),typeof a=="function")){typeof u!="function"&&u!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):vs(e,l,a)}}}function ot(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var a=!1,n=!1,u;for(u in l)if(l.hasOwnProperty(u)){var o=l[u];if(o!=null)switch(u){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Ae(e,t,u,o,l,null)}}n&&Ae(e,t,"srcSet",l.srcSet,l,null),a&&Ae(e,t,"src",l.src,l,null);return;case"input":xe("invalid",e);var m=u=o=n=null,b=null,R=null;for(a in l)if(l.hasOwnProperty(a)){var L=l[a];if(L!=null)switch(a){case"name":n=L;break;case"type":o=L;break;case"checked":b=L;break;case"defaultChecked":R=L;break;case"value":u=L;break;case"defaultValue":m=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,t));break;default:Ae(e,t,a,L,l,null)}}Hc(e,u,m,b,R,o,n,!1),ys(e);return;case"select":xe("invalid",e),a=o=u=null;for(n in l)if(l.hasOwnProperty(n)&&(m=l[n],m!=null))switch(n){case"value":u=m;break;case"defaultValue":o=m;break;case"multiple":a=m;default:Ae(e,t,n,m,l,null)}t=u,l=o,e.multiple=!!a,t!=null?ba(e,!!a,t,!1):l!=null&&ba(e,!!a,l,!0);return;case"textarea":xe("invalid",e),u=n=a=null;for(o in l)if(l.hasOwnProperty(o)&&(m=l[o],m!=null))switch(o){case"value":a=m;break;case"defaultValue":n=m;break;case"children":u=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:Ae(e,t,o,m,l,null)}Bc(e,a,n,u),ys(e);return;case"option":for(b in l)if(l.hasOwnProperty(b)&&(a=l[b],a!=null))switch(b){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ae(e,t,b,a,l,null)}return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(a=0;a<Yn.length;a++)xe(Yn[a],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(R in l)if(l.hasOwnProperty(R)&&(a=l[R],a!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Ae(e,t,R,a,l,null)}return;default:if(Fu(t)){for(L in l)l.hasOwnProperty(L)&&(a=l[L],a!==void 0&&_r(e,t,L,a,l,void 0));return}}for(m in l)l.hasOwnProperty(m)&&(a=l[m],a!=null&&Ae(e,t,m,a,l,null))}function Vm(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,u=null,o=null,m=null,b=null,R=null,L=null;for(_ in l){var $=l[_];if(l.hasOwnProperty(_)&&$!=null)switch(_){case"checked":break;case"value":break;case"defaultValue":b=$;default:a.hasOwnProperty(_)||Ae(e,t,_,null,a,$)}}for(var D in a){var _=a[D];if($=l[D],a.hasOwnProperty(D)&&(_!=null||$!=null))switch(D){case"type":u=_;break;case"name":n=_;break;case"checked":R=_;break;case"defaultChecked":L=_;break;case"value":o=_;break;case"defaultValue":m=_;break;case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(137,t));break;default:_!==$&&Ae(e,t,D,_,a,$)}}Ku(e,o,m,b,R,L,u,n);return;case"select":_=o=m=D=null;for(u in l)if(b=l[u],l.hasOwnProperty(u)&&b!=null)switch(u){case"value":break;case"multiple":_=b;default:a.hasOwnProperty(u)||Ae(e,t,u,null,a,b)}for(n in a)if(u=a[n],b=l[n],a.hasOwnProperty(n)&&(u!=null||b!=null))switch(n){case"value":D=u;break;case"defaultValue":m=u;break;case"multiple":o=u;default:u!==b&&Ae(e,t,n,u,a,b)}t=m,l=o,a=_,D!=null?ba(e,!!l,D,!1):!!a!=!!l&&(t!=null?ba(e,!!l,t,!0):ba(e,!!l,l?[]:"",!1));return;case"textarea":_=D=null;for(m in l)if(n=l[m],l.hasOwnProperty(m)&&n!=null&&!a.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Ae(e,t,m,null,a,n)}for(o in a)if(n=a[o],u=l[o],a.hasOwnProperty(o)&&(n!=null||u!=null))switch(o){case"value":D=n;break;case"defaultValue":_=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(r(91));break;default:n!==u&&Ae(e,t,o,n,a,u)}Lc(e,D,_);return;case"option":for(var fe in l)if(D=l[fe],l.hasOwnProperty(fe)&&D!=null&&!a.hasOwnProperty(fe))switch(fe){case"selected":e.selected=!1;break;default:Ae(e,t,fe,null,a,D)}for(b in a)if(D=a[b],_=l[b],a.hasOwnProperty(b)&&D!==_&&(D!=null||_!=null))switch(b){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:Ae(e,t,b,D,a,_)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ce in l)D=l[ce],l.hasOwnProperty(ce)&&D!=null&&!a.hasOwnProperty(ce)&&Ae(e,t,ce,null,a,D);for(R in a)if(D=a[R],_=l[R],a.hasOwnProperty(R)&&D!==_&&(D!=null||_!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(137,t));break;default:Ae(e,t,R,D,a,_)}return;default:if(Fu(t)){for(var Re in l)D=l[Re],l.hasOwnProperty(Re)&&D!==void 0&&!a.hasOwnProperty(Re)&&_r(e,t,Re,void 0,a,D);for(L in a)D=a[L],_=l[L],!a.hasOwnProperty(L)||D===_||D===void 0&&_===void 0||_r(e,t,L,D,a,_);return}}for(var N in l)D=l[N],l.hasOwnProperty(N)&&D!=null&&!a.hasOwnProperty(N)&&Ae(e,t,N,null,a,D);for($ in a)D=a[$],_=l[$],!a.hasOwnProperty($)||D===_||D==null&&_==null||Ae(e,t,$,D,a,_)}var zr=null,Ur=null;function mu(e){return e.nodeType===9?e:e.ownerDocument}function $d(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Gd(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Hr(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lr=null;function Zm(){var e=window.event;return e&&e.type==="popstate"?e===Lr?!1:(Lr=e,!0):(Lr=null,!1)}var Xd=typeof setTimeout=="function"?setTimeout:void 0,Qm=typeof clearTimeout=="function"?clearTimeout:void 0,Vd=typeof Promise=="function"?Promise:void 0,Km=typeof queueMicrotask=="function"?queueMicrotask:typeof Vd<"u"?function(e){return Vd.resolve(null).then(e).catch(Jm)}:Xd;function Jm(e){setTimeout(function(){throw e})}function Hl(e){return e==="head"}function Zd(e,t){var l=t,a=0,n=0;do{var u=l.nextSibling;if(e.removeChild(l),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(0<a&&8>a){l=a;var o=e.ownerDocument;if(l&1&&Gn(o.documentElement),l&2&&Gn(o.body),l&4)for(l=o.head,Gn(l),o=l.firstChild;o;){var m=o.nextSibling,b=o.nodeName;o[an]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&o.rel.toLowerCase()==="stylesheet"||l.removeChild(o),o=m}}if(n===0){e.removeChild(u),Wn(t);return}n--}else l==="$"||l==="$?"||l==="$!"?n++:a=l.charCodeAt(0)-48;else a=0;l=u}while(l);Wn(t)}function Br(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Br(l),Xu(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Fm(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[an])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Vt(e.nextSibling),e===null)break}return null}function Wm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Vt(e.nextSibling),e===null))return null;return e}function qr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function Pm(e,t){var l=e.ownerDocument;if(e.data!=="$?"||l.readyState==="complete")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Vt(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==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Yr=null;function Qd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"){if(t===0)return e;t--}else l==="/$"&&t++}e=e.previousSibling}return null}function Kd(e,t,l){switch(t=mu(l),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Gn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Xu(e)}var Bt=new Map,Jd=new Set;function gu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pl=U.d;U.d={f:Im,r:eg,D:tg,C:lg,L:ag,m:ng,X:ug,S:sg,M:ig};function Im(){var e=pl.f(),t=uu();return e||t}function eg(e){var t=pa(e);t!==null&&t.tag===5&&t.type==="form"?gf(t):pl.r(e)}var Fa=typeof document>"u"?null:document;function Fd(e,t,l){var a=Fa;if(a&&typeof t=="string"&&t){var n=Ot(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),Jd.has(n)||(Jd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),ot(t,"link",e),at(t),a.head.appendChild(t)))}}function tg(e){pl.D(e),Fd("dns-prefetch",e,null)}function lg(e,t){pl.C(e,t),Fd("preconnect",e,t)}function ag(e,t,l){pl.L(e,t,l);var a=Fa;if(a&&e&&t){var n='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+Ot(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+Ot(l.imageSizes)+'"]')):n+='[href="'+Ot(e)+'"]';var u=n;switch(t){case"style":u=Wa(e);break;case"script":u=Pa(e)}Bt.has(u)||(e=S({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Bt.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(Xn(u))||t==="script"&&a.querySelector(Vn(u))||(t=a.createElement("link"),ot(t,"link",e),at(t),a.head.appendChild(t)))}}function ng(e,t){pl.m(e,t);var l=Fa;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Ot(a)+'"][href="'+Ot(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Pa(e)}if(!Bt.has(u)&&(e=S({rel:"modulepreload",href:e},t),Bt.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Vn(u)))return}a=l.createElement("link"),ot(a,"link",e),at(a),l.head.appendChild(a)}}}function sg(e,t,l){pl.S(e,t,l);var a=Fa;if(a&&e){var n=va(a).hoistableStyles,u=Wa(e);t=t||"default";var o=n.get(u);if(!o){var m={loading:0,preload:null};if(o=a.querySelector(Xn(u)))m.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Bt.get(u))&&$r(e,l);var b=o=a.createElement("link");at(b),ot(b,"link",e),b._p=new Promise(function(R,L){b.onload=R,b.onerror=L}),b.addEventListener("load",function(){m.loading|=1}),b.addEventListener("error",function(){m.loading|=2}),m.loading|=4,pu(o,t,a)}o={type:"stylesheet",instance:o,count:1,state:m},n.set(u,o)}}}function ug(e,t){pl.X(e,t);var l=Fa;if(l&&e){var a=va(l).hoistableScripts,n=Pa(e),u=a.get(n);u||(u=l.querySelector(Vn(n)),u||(e=S({src:e,async:!0},t),(t=Bt.get(n))&&Gr(e,t),u=l.createElement("script"),at(u),ot(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function ig(e,t){pl.M(e,t);var l=Fa;if(l&&e){var a=va(l).hoistableScripts,n=Pa(e),u=a.get(n);u||(u=l.querySelector(Vn(n)),u||(e=S({src:e,async:!0,type:"module"},t),(t=Bt.get(n))&&Gr(e,t),u=l.createElement("script"),at(u),ot(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function Wd(e,t,l,a){var n=(n=ie.current)?gu(n):null;if(!n)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Wa(l.href),l=va(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Wa(l.href);var u=va(n).hoistableStyles,o=u.get(e);if(o||(n=n.ownerDocument||n,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,o),(u=n.querySelector(Xn(e)))&&!u._p&&(o.instance=u,o.state.loading=5),Bt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Bt.set(e,l),u||rg(n,e,l,o.state))),t&&a===null)throw Error(r(528,""));return o}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Pa(l),l=va(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Wa(e){return'href="'+Ot(e)+'"'}function Xn(e){return'link[rel="stylesheet"]['+e+"]"}function Pd(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function rg(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ot(t,"link",l),at(t),e.head.appendChild(t))}function Pa(e){return'[src="'+Ot(e)+'"]'}function Vn(e){return"script[async]"+e}function Id(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ot(l.href)+'"]');if(a)return t.instance=a,at(a),a;var n=S({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),at(a),ot(a,"style",n),pu(a,l.precedence,e),t.instance=a;case"stylesheet":n=Wa(l.href);var u=e.querySelector(Xn(n));if(u)return t.state.loading|=4,t.instance=u,at(u),u;a=Pd(l),(n=Bt.get(n))&&$r(a,n),u=(e.ownerDocument||e).createElement("link"),at(u);var o=u;return o._p=new Promise(function(m,b){o.onload=m,o.onerror=b}),ot(u,"link",a),t.state.loading|=4,pu(u,l.precedence,e),t.instance=u;case"script":return u=Pa(l.src),(n=e.querySelector(Vn(u)))?(t.instance=n,at(n),n):(a=l,(n=Bt.get(u))&&(a=S({},l),Gr(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),at(n),ot(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,pu(a,l.precedence,e));return t.instance}function pu(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,o=0;o<a.length;o++){var m=a[o];if(m.dataset.precedence===t)u=m;else if(u!==n)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function $r(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Gr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var vu=null;function e0(e,t,l){if(vu===null){var a=new Map,n=vu=new Map;n.set(l,a)}else n=vu,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var u=l[n];if(!(u[an]||u[Ne]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var o=u.getAttribute(t)||"";o=e+o;var m=a.get(o);m?m.push(u):a.set(o,[u])}}return a}function t0(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function cg(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function l0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Zn=null;function og(){}function fg(e,t,l){if(Zn===null)throw Error(r(475));var a=Zn;if(t.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var n=Wa(l.href),u=e.querySelector(Xn(n));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(a.count++,a=xu.bind(a),e.then(a,a)),t.state.loading|=4,t.instance=u,at(u);return}u=e.ownerDocument||e,l=Pd(l),(n=Bt.get(n))&&$r(l,n),u=u.createElement("link"),at(u);var o=u;o._p=new Promise(function(m,b){o.onload=m,o.onerror=b}),ot(u,"link",l),t.instance=u}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(a.count++,t=xu.bind(a),e.addEventListener("load",t),e.addEventListener("error",t))}}function dg(){if(Zn===null)throw Error(r(475));var e=Zn;return e.stylesheets&&e.count===0&&Xr(e,e.stylesheets),0<e.count?function(t){var l=setTimeout(function(){if(e.stylesheets&&Xr(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(l)}}:null}function xu(){if(this.count--,this.count===0){if(this.stylesheets)Xr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yu=null;function Xr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yu=new Map,t.forEach(hg,e),yu=null,xu.call(e))}function hg(e,t){if(!(t.state.loading&4)){var l=yu.get(e);if(l)var a=l.get(null);else{l=new Map,yu.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<n.length;u++){var o=n[u];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(l.set(o.dataset.precedence,o),a=o)}a&&l.set(null,a)}n=t.instance,o=n.getAttribute("data-precedence"),u=l.get(o)||a,u===a&&l.set(null,n),l.set(o,n),this.count++,a=xu.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),u?u.parentNode.insertBefore(n,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Qn={$$typeof:F,Provider:null,Consumer:null,_currentValue:A,_currentValue2:A,_threadCount:0};function mg(e,t,l,a,n,u,o,m){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pe(0),this.hiddenUpdates=pe(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=u,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=m,this.incompleteTransitions=new Map}function a0(e,t,l,a,n,u,o,m,b,R,L,$){return e=new mg(e,t,l,o,m,b,R,$),t=1,u===!0&&(t|=24),u=St(3,null,null,t),e.current=u,u.stateNode=e,t=ji(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:l,cache:t},ki(u),e}function n0(e){return e?(e=ka,e):ka}function s0(e,t,l,a,n,u){n=n0(n),a.context===null?a.context=n:a.pendingContext=n,a=Ml(t),a.payload={element:l},u=u===void 0?null:u,u!==null&&(a.callback=u),l=jl(e,a,t),l!==null&&(Nt(l,e,t),wn(l,e,t))}function u0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Vr(e,t){u0(e,t),(e=e.alternate)&&u0(e,t)}function i0(e){if(e.tag===13){var t=Ca(e,67108864);t!==null&&Nt(t,e,67108864),Vr(e,67108864)}}var bu=!0;function gg(e,t,l,a){var n=w.T;w.T=null;var u=U.p;try{U.p=2,Zr(e,t,l,a)}finally{U.p=u,w.T=n}}function pg(e,t,l,a){var n=w.T;w.T=null;var u=U.p;try{U.p=8,Zr(e,t,l,a)}finally{U.p=u,w.T=n}}function Zr(e,t,l,a){if(bu){var n=Qr(a);if(n===null)Dr(e,t,a,Su,l),c0(e,a);else if(xg(n,e,t,l,a))a.stopPropagation();else if(c0(e,a),t&4&&-1<vg.indexOf(e)){for(;n!==null;){var u=pa(n);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var o=tl(u.pendingLanes);if(o!==0){var m=u;for(m.pendingLanes|=2,m.entangledLanes|=2;o;){var b=1<<31-mt(o);m.entanglements[1]|=b,o&=~b}It(u),(Te&6)===0&&(nu=Ct()+500,qn(0))}}break;case 13:m=Ca(u,2),m!==null&&Nt(m,u,2),uu(),Vr(u,2)}if(u=Qr(a),u===null&&Dr(e,t,a,Su,l),u===n)break;n=u}n!==null&&a.stopPropagation()}else Dr(e,t,a,null,l)}}function Qr(e){return e=Pu(e),Kr(e)}var Su=null;function Kr(e){if(Su=null,e=ga(e),e!==null){var t=g(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=x(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Su=e,null}function r0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Hu()){case ln:return 2;case Yt:return 8;case $t:case ms:return 32;case kt:return 268435456;default:return 32}default:return 32}}var Jr=!1,Ll=null,Bl=null,ql=null,Kn=new Map,Jn=new Map,Yl=[],vg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function c0(e,t){switch(e){case"focusin":case"focusout":Ll=null;break;case"dragenter":case"dragleave":Bl=null;break;case"mouseover":case"mouseout":ql=null;break;case"pointerover":case"pointerout":Kn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jn.delete(t.pointerId)}}function Fn(e,t,l,a,n,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:u,targetContainers:[n]},t!==null&&(t=pa(t),t!==null&&i0(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function xg(e,t,l,a,n){switch(t){case"focusin":return Ll=Fn(Ll,e,t,l,a,n),!0;case"dragenter":return Bl=Fn(Bl,e,t,l,a,n),!0;case"mouseover":return ql=Fn(ql,e,t,l,a,n),!0;case"pointerover":var u=n.pointerId;return Kn.set(u,Fn(Kn.get(u)||null,e,t,l,a,n)),!0;case"gotpointercapture":return u=n.pointerId,Jn.set(u,Fn(Jn.get(u)||null,e,t,l,a,n)),!0}return!1}function o0(e){var t=ga(e.target);if(t!==null){var l=g(t);if(l!==null){if(t=l.tag,t===13){if(t=x(l),t!==null){e.blockedOn=t,Ge(e.priority,function(){if(l.tag===13){var a=jt();a=_e(a);var n=Ca(l,a);n!==null&&Nt(n,l,a),Vr(l,a)}});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Eu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Qr(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Wu=a,l.target.dispatchEvent(a),Wu=null}else return t=pa(l),t!==null&&i0(t),e.blockedOn=l,!1;t.shift()}return!0}function f0(e,t,l){Eu(e)&&l.delete(t)}function yg(){Jr=!1,Ll!==null&&Eu(Ll)&&(Ll=null),Bl!==null&&Eu(Bl)&&(Bl=null),ql!==null&&Eu(ql)&&(ql=null),Kn.forEach(f0),Jn.forEach(f0)}function wu(e,t){e.blockedOn===t&&(e.blockedOn=null,Jr||(Jr=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,yg)))}var Mu=null;function d0(e){Mu!==e&&(Mu=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Mu===e&&(Mu=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(Kr(a||l)===null)continue;break}var u=pa(l);u!==null&&(e.splice(t,3),t-=3,Ki(u,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function Wn(e){function t(b){return wu(b,e)}Ll!==null&&wu(Ll,e),Bl!==null&&wu(Bl,e),ql!==null&&wu(ql,e),Kn.forEach(t),Jn.forEach(t);for(var l=0;l<Yl.length;l++){var a=Yl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Yl.length&&(l=Yl[0],l.blockedOn===null);)o0(l),l.blockedOn===null&&Yl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],u=l[a+1],o=n[lt]||null;if(typeof u=="function")o||d0(l);else if(o){var m=null;if(u&&u.hasAttribute("formAction")){if(n=u,o=u[lt]||null)m=o.formAction;else if(Kr(n)!==null)continue}else m=o.action;typeof m=="function"?l[a+1]=m:(l.splice(a,3),a-=3),d0(l)}}}function Fr(e){this._internalRoot=e}ju.prototype.render=Fr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var l=t.current,a=jt();s0(l,a,e,t,null,null)},ju.prototype.unmount=Fr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;s0(e.current,2,null,e,null,null),uu(),t[At]=null}};function ju(e){this._internalRoot=e}ju.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fe();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Yl.length&&t!==0&&t<Yl[l].priority;l++);Yl.splice(l,0,e),l===0&&o0(e)}};var h0=i.version;if(h0!=="19.1.1")throw Error(r(527,h0,"19.1.1"));U.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=v(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var bg={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nu.isDisabled&&Nu.supportsFiber)try{Xl=Nu.inject(bg),ht=Nu}catch{}}return In.createRoot=function(e,t){if(!d(e))throw Error(r(299));var l=!1,a="",n=kf,u=Af,o=Rf,m=null;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(m=t.unstable_transitionCallbacks)),t=a0(e,1,!1,null,null,l,a,n,u,o,m,null),e[At]=t.current,Or(e),new Fr(t)},In.hydrateRoot=function(e,t,l){if(!d(e))throw Error(r(299));var a=!1,n="",u=kf,o=Af,m=Rf,b=null,R=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(u=l.onUncaughtError),l.onCaughtError!==void 0&&(o=l.onCaughtError),l.onRecoverableError!==void 0&&(m=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(b=l.unstable_transitionCallbacks),l.formState!==void 0&&(R=l.formState)),t=a0(e,1,!0,t,l??null,a,n,u,o,m,b,R),t.context=n0(null),l=t.current,a=jt(),a=_e(a),n=Ml(a),n.callback=null,jl(l,n,a),l=a,t.current.lanes=l,we(t,l),It(t),e[At]=t.current,Or(e),new ju(t)},In.version="19.1.1",In}var w0;function Rg(){if(w0)return Ir.exports;w0=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(i){console.error(i)}}return s(),Ir.exports=Ag(),Ir.exports}var Og=Rg(),es={},M0;function Dg(){if(M0)return es;M0=1,Object.defineProperty(es,"__esModule",{value:!0}),es.parse=x,es.serialize=h;const s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,c=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,d=Object.prototype.toString,g=(()=>{const C=function(){};return C.prototype=Object.create(null),C})();function x(C,B){const T=new g,G=C.length;if(G<2)return T;const X=B?.decode||S;let H=0;do{const J=C.indexOf("=",H);if(J===-1)break;const F=C.indexOf(";",H),Z=F===-1?G:F;if(J>Z){H=C.lastIndexOf(";",J-1)+1;continue}const Q=E(C,H,J),ee=v(C,J,Q),se=C.slice(Q,ee);if(T[se]===void 0){let le=E(C,J+1,Z),ne=v(C,Z,le);const I=X(C.slice(le,ne));T[se]=I}H=Z+1}while(H<G);return T}function E(C,B,T){do{const G=C.charCodeAt(B);if(G!==32&&G!==9)return B}while(++B<T);return T}function v(C,B,T){for(;B>T;){const G=C.charCodeAt(--B);if(G!==32&&G!==9)return B+1}return T}function h(C,B,T){const G=T?.encode||encodeURIComponent;if(!s.test(C))throw new TypeError(`argument name is invalid: ${C}`);const X=G(B);if(!i.test(X))throw new TypeError(`argument val is invalid: ${B}`);let H=C+"="+X;if(!T)return H;if(T.maxAge!==void 0){if(!Number.isInteger(T.maxAge))throw new TypeError(`option maxAge is invalid: ${T.maxAge}`);H+="; Max-Age="+T.maxAge}if(T.domain){if(!c.test(T.domain))throw new TypeError(`option domain is invalid: ${T.domain}`);H+="; Domain="+T.domain}if(T.path){if(!r.test(T.path))throw new TypeError(`option path is invalid: ${T.path}`);H+="; Path="+T.path}if(T.expires){if(!j(T.expires)||!Number.isFinite(T.expires.valueOf()))throw new TypeError(`option expires is invalid: ${T.expires}`);H+="; Expires="+T.expires.toUTCString()}if(T.httpOnly&&(H+="; HttpOnly"),T.secure&&(H+="; Secure"),T.partitioned&&(H+="; Partitioned"),T.priority)switch(typeof T.priority=="string"?T.priority.toLowerCase():void 0){case"low":H+="; Priority=Low";break;case"medium":H+="; Priority=Medium";break;case"high":H+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${T.priority}`)}if(T.sameSite)switch(typeof T.sameSite=="string"?T.sameSite.toLowerCase():T.sameSite){case!0:case"strict":H+="; SameSite=Strict";break;case"lax":H+="; SameSite=Lax";break;case"none":H+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${T.sameSite}`)}return H}function S(C){if(C.indexOf("%")===-1)return C;try{return decodeURIComponent(C)}catch{return C}}function j(C){return d.call(C)==="[object Date]"}return es}Dg();var j0="popstate";function _g(s={}){function i(r,d){let{pathname:g,search:x,hash:E}=r.location;return sc("",{pathname:g,search:x,hash:E},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function c(r,d){return typeof d=="string"?d:ss(d)}return Ug(i,c,null,s)}function $e(s,i){if(s===!1||s===null||typeof s>"u")throw new Error(i)}function Zt(s,i){if(!s){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function zg(){return Math.random().toString(36).substring(2,10)}function N0(s,i){return{usr:s.state,key:s.key,idx:i}}function sc(s,i,c=null,r){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof i=="string"?en(i):i,state:c,key:i&&i.key||r||zg()}}function ss({pathname:s="/",search:i="",hash:c=""}){return i&&i!=="?"&&(s+=i.charAt(0)==="?"?i:"?"+i),c&&c!=="#"&&(s+=c.charAt(0)==="#"?c:"#"+c),s}function en(s){let i={};if(s){let c=s.indexOf("#");c>=0&&(i.hash=s.substring(c),s=s.substring(0,c));let r=s.indexOf("?");r>=0&&(i.search=s.substring(r),s=s.substring(0,r)),s&&(i.pathname=s)}return i}function Ug(s,i,c,r={}){let{window:d=document.defaultView,v5Compat:g=!1}=r,x=d.history,E="POP",v=null,h=S();h==null&&(h=0,x.replaceState({...x.state,idx:h},""));function S(){return(x.state||{idx:null}).idx}function j(){E="POP";let X=S(),H=X==null?null:X-h;h=X,v&&v({action:E,location:G.location,delta:H})}function C(X,H){E="PUSH";let J=sc(G.location,X,H);h=S()+1;let F=N0(J,h),Z=G.createHref(J);try{x.pushState(F,"",Z)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;d.location.assign(Z)}g&&v&&v({action:E,location:G.location,delta:1})}function B(X,H){E="REPLACE";let J=sc(G.location,X,H);h=S();let F=N0(J,h),Z=G.createHref(J);x.replaceState(F,"",Z),g&&v&&v({action:E,location:G.location,delta:0})}function T(X){return Hg(X)}let G={get action(){return E},get location(){return s(d,x)},listen(X){if(v)throw new Error("A history only accepts one active listener");return d.addEventListener(j0,j),v=X,()=>{d.removeEventListener(j0,j),v=null}},createHref(X){return i(d,X)},createURL:T,encodeLocation(X){let H=T(X);return{pathname:H.pathname,search:H.search,hash:H.hash}},push:C,replace:B,go(X){return x.go(X)}};return G}function Hg(s,i=!1){let c="http://localhost";typeof window<"u"&&(c=window.location.origin!=="null"?window.location.origin:window.location.href),$e(c,"No window.location.(origin|href) available to create URL");let r=typeof s=="string"?s:ss(s);return r=r.replace(/ $/,"%20"),!i&&r.startsWith("//")&&(r=c+r),new URL(r,c)}function L0(s,i,c="/"){return Lg(s,i,c,!1)}function Lg(s,i,c,r){let d=typeof i=="string"?en(i):i,g=xl(d.pathname||"/",c);if(g==null)return null;let x=B0(s);Bg(x);let E=null;for(let v=0;E==null&&v<x.length;++v){let h=Fg(g);E=Kg(x[v],h,r)}return E}function B0(s,i=[],c=[],r=""){let d=(g,x,E)=>{let v={relativePath:E===void 0?g.path||"":E,caseSensitive:g.caseSensitive===!0,childrenIndex:x,route:g};v.relativePath.startsWith("/")&&($e(v.relativePath.startsWith(r),`Absolute route path "${v.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(r.length));let h=vl([r,v.relativePath]),S=c.concat(v);g.children&&g.children.length>0&&($e(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),B0(g.children,i,S,h)),!(g.path==null&&!g.index)&&i.push({path:h,score:Zg(h,g.index),routesMeta:S})};return s.forEach((g,x)=>{if(g.path===""||!g.path?.includes("?"))d(g,x);else for(let E of q0(g.path))d(g,x,E)}),i}function q0(s){let i=s.split("/");if(i.length===0)return[];let[c,...r]=i,d=c.endsWith("?"),g=c.replace(/\?$/,"");if(r.length===0)return d?[g,""]:[g];let x=q0(r.join("/")),E=[];return E.push(...x.map(v=>v===""?g:[g,v].join("/"))),d&&E.push(...x),E.map(v=>s.startsWith("/")&&v===""?"/":v)}function Bg(s){s.sort((i,c)=>i.score!==c.score?c.score-i.score:Qg(i.routesMeta.map(r=>r.childrenIndex),c.routesMeta.map(r=>r.childrenIndex)))}var qg=/^:[\w-]+$/,Yg=3,$g=2,Gg=1,Xg=10,Vg=-2,T0=s=>s==="*";function Zg(s,i){let c=s.split("/"),r=c.length;return c.some(T0)&&(r+=Vg),i&&(r+=$g),c.filter(d=>!T0(d)).reduce((d,g)=>d+(qg.test(g)?Yg:g===""?Gg:Xg),r)}function Qg(s,i){return s.length===i.length&&s.slice(0,-1).every((r,d)=>r===i[d])?s[s.length-1]-i[i.length-1]:0}function Kg(s,i,c=!1){let{routesMeta:r}=s,d={},g="/",x=[];for(let E=0;E<r.length;++E){let v=r[E],h=E===r.length-1,S=g==="/"?i:i.slice(g.length)||"/",j=Du({path:v.relativePath,caseSensitive:v.caseSensitive,end:h},S),C=v.route;if(!j&&h&&c&&!r[r.length-1].route.index&&(j=Du({path:v.relativePath,caseSensitive:v.caseSensitive,end:!1},S)),!j)return null;Object.assign(d,j.params),x.push({params:d,pathname:vl([g,j.pathname]),pathnameBase:ep(vl([g,j.pathnameBase])),route:C}),j.pathnameBase!=="/"&&(g=vl([g,j.pathnameBase]))}return x}function Du(s,i){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[c,r]=Jg(s.path,s.caseSensitive,s.end),d=i.match(c);if(!d)return null;let g=d[0],x=g.replace(/(.)\/+$/,"$1"),E=d.slice(1);return{params:r.reduce((h,{paramName:S,isOptional:j},C)=>{if(S==="*"){let T=E[C]||"";x=g.slice(0,g.length-T.length).replace(/(.)\/+$/,"$1")}const B=E[C];return j&&!B?h[S]=void 0:h[S]=(B||"").replace(/%2F/g,"/"),h},{}),pathname:g,pathnameBase:x,pattern:s}}function Jg(s,i=!1,c=!0){Zt(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let r=[],d="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(x,E,v)=>(r.push({paramName:E,isOptional:v!=null}),v?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(r.push({paramName:"*"}),d+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):c?d+="\\/*$":s!==""&&s!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),r]}function Fg(s){try{return s.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Zt(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),s}}function xl(s,i){if(i==="/")return s;if(!s.toLowerCase().startsWith(i.toLowerCase()))return null;let c=i.endsWith("/")?i.length-1:i.length,r=s.charAt(c);return r&&r!=="/"?null:s.slice(c)||"/"}function Wg(s,i="/"){let{pathname:c,search:r="",hash:d=""}=typeof s=="string"?en(s):s;return{pathname:c?c.startsWith("/")?c:Pg(c,i):i,search:tp(r),hash:lp(d)}}function Pg(s,i){let c=i.replace(/\/+$/,"").split("/");return s.split("/").forEach(d=>{d===".."?c.length>1&&c.pop():d!=="."&&c.push(d)}),c.length>1?c.join("/"):"/"}function ac(s,i,c,r){return`Cannot include a '${s}' character in a manually specified \`to.${i}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${c}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ig(s){return s.filter((i,c)=>c===0||i.route.path&&i.route.path.length>0)}function Y0(s){let i=Ig(s);return i.map((c,r)=>r===i.length-1?c.pathname:c.pathnameBase)}function $0(s,i,c,r=!1){let d;typeof s=="string"?d=en(s):(d={...s},$e(!d.pathname||!d.pathname.includes("?"),ac("?","pathname","search",d)),$e(!d.pathname||!d.pathname.includes("#"),ac("#","pathname","hash",d)),$e(!d.search||!d.search.includes("#"),ac("#","search","hash",d)));let g=s===""||d.pathname==="",x=g?"/":d.pathname,E;if(x==null)E=c;else{let j=i.length-1;if(!r&&x.startsWith("..")){let C=x.split("/");for(;C[0]==="..";)C.shift(),j-=1;d.pathname=C.join("/")}E=j>=0?i[j]:"/"}let v=Wg(d,E),h=x&&x!=="/"&&x.endsWith("/"),S=(g||x===".")&&c.endsWith("/");return!v.pathname.endsWith("/")&&(h||S)&&(v.pathname+="/"),v}var vl=s=>s.join("/").replace(/\/\/+/g,"/"),ep=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),tp=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,lp=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function ap(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}var G0=["POST","PUT","PATCH","DELETE"];new Set(G0);var np=["GET",...G0];new Set(np);var tn=p.createContext(null);tn.displayName="DataRouter";var _u=p.createContext(null);_u.displayName="DataRouterState";var X0=p.createContext({isTransitioning:!1});X0.displayName="ViewTransition";var sp=p.createContext(new Map);sp.displayName="Fetchers";var up=p.createContext(null);up.displayName="Await";var el=p.createContext(null);el.displayName="Navigation";var is=p.createContext(null);is.displayName="Location";var yl=p.createContext({outlet:null,matches:[],isDataRoute:!1});yl.displayName="Route";var xc=p.createContext(null);xc.displayName="RouteError";function ip(s,{relative:i}={}){$e(rs(),"useHref() may be used only in the context of a <Router> component.");let{basename:c,navigator:r}=p.useContext(el),{hash:d,pathname:g,search:x}=os(s,{relative:i}),E=g;return c!=="/"&&(E=g==="/"?c:vl([c,g])),r.createHref({pathname:E,search:x,hash:d})}function rs(){return p.useContext(is)!=null}function bl(){return $e(rs(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(is).location}var V0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Z0(s){p.useContext(el).static||p.useLayoutEffect(s)}function cs(){let{isDataRoute:s}=p.useContext(yl);return s?bp():rp()}function rp(){$e(rs(),"useNavigate() may be used only in the context of a <Router> component.");let s=p.useContext(tn),{basename:i,navigator:c}=p.useContext(el),{matches:r}=p.useContext(yl),{pathname:d}=bl(),g=JSON.stringify(Y0(r)),x=p.useRef(!1);return Z0(()=>{x.current=!0}),p.useCallback((v,h={})=>{if(Zt(x.current,V0),!x.current)return;if(typeof v=="number"){c.go(v);return}let S=$0(v,JSON.parse(g),d,h.relative==="path");s==null&&i!=="/"&&(S.pathname=S.pathname==="/"?i:vl([i,S.pathname])),(h.replace?c.replace:c.push)(S,h.state,h)},[i,c,g,d,s])}p.createContext(null);function os(s,{relative:i}={}){let{matches:c}=p.useContext(yl),{pathname:r}=bl(),d=JSON.stringify(Y0(c));return p.useMemo(()=>$0(s,JSON.parse(d),r,i==="path"),[s,d,r,i])}function cp(s,i){return Q0(s,i)}function Q0(s,i,c,r){$e(rs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=p.useContext(el),{matches:g}=p.useContext(yl),x=g[g.length-1],E=x?x.params:{},v=x?x.pathname:"/",h=x?x.pathnameBase:"/",S=x&&x.route;{let H=S&&S.path||"";K0(v,!S||H.endsWith("*")||H.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${v}" (under <Route path="${H}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${H}"> to <Route path="${H==="/"?"*":`${H}/*`}">.`)}let j=bl(),C;if(i){let H=typeof i=="string"?en(i):i;$e(h==="/"||H.pathname?.startsWith(h),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${H.pathname}" was given in the \`location\` prop.`),C=H}else C=j;let B=C.pathname||"/",T=B;if(h!=="/"){let H=h.replace(/^\//,"").split("/");T="/"+B.replace(/^\//,"").split("/").slice(H.length).join("/")}let G=L0(s,{pathname:T});Zt(S||G!=null,`No routes matched location "${C.pathname}${C.search}${C.hash}" `),Zt(G==null||G[G.length-1].route.element!==void 0||G[G.length-1].route.Component!==void 0||G[G.length-1].route.lazy!==void 0,`Matched leaf route at location "${C.pathname}${C.search}${C.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let X=mp(G&&G.map(H=>Object.assign({},H,{params:Object.assign({},E,H.params),pathname:vl([h,d.encodeLocation?d.encodeLocation(H.pathname).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?h:vl([h,d.encodeLocation?d.encodeLocation(H.pathnameBase).pathname:H.pathnameBase])})),g,c,r);return i&&X?p.createElement(is.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...C},navigationType:"POP"}},X):X}function op(){let s=yp(),i=ap(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),c=s instanceof Error?s.stack:null,r="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:r},g={padding:"2px 4px",backgroundColor:r},x=null;return console.error("Error handled by React Router default ErrorBoundary:",s),x=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:g},"ErrorBoundary")," or"," ",p.createElement("code",{style:g},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},i),c?p.createElement("pre",{style:d},c):null,x)}var fp=p.createElement(op,null),dp=class extends p.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,i){return i.location!==s.location||i.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:i.error,location:i.location,revalidation:s.revalidation||i.revalidation}}componentDidCatch(s,i){console.error("React Router caught the following error during render",s,i)}render(){return this.state.error!==void 0?p.createElement(yl.Provider,{value:this.props.routeContext},p.createElement(xc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function hp({routeContext:s,match:i,children:c}){let r=p.useContext(tn);return r&&r.static&&r.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=i.route.id),p.createElement(yl.Provider,{value:s},c)}function mp(s,i=[],c=null,r=null){if(s==null){if(!c)return null;if(c.errors)s=c.matches;else if(i.length===0&&!c.initialized&&c.matches.length>0)s=c.matches;else return null}let d=s,g=c?.errors;if(g!=null){let v=d.findIndex(h=>h.route.id&&g?.[h.route.id]!==void 0);$e(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(g).join(",")}`),d=d.slice(0,Math.min(d.length,v+1))}let x=!1,E=-1;if(c)for(let v=0;v<d.length;v++){let h=d[v];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(E=v),h.route.id){let{loaderData:S,errors:j}=c,C=h.route.loader&&!S.hasOwnProperty(h.route.id)&&(!j||j[h.route.id]===void 0);if(h.route.lazy||C){x=!0,E>=0?d=d.slice(0,E+1):d=[d[0]];break}}}return d.reduceRight((v,h,S)=>{let j,C=!1,B=null,T=null;c&&(j=g&&h.route.id?g[h.route.id]:void 0,B=h.route.errorElement||fp,x&&(E<0&&S===0?(K0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,T=null):E===S&&(C=!0,T=h.route.hydrateFallbackElement||null)));let G=i.concat(d.slice(0,S+1)),X=()=>{let H;return j?H=B:C?H=T:h.route.Component?H=p.createElement(h.route.Component,null):h.route.element?H=h.route.element:H=v,p.createElement(hp,{match:h,routeContext:{outlet:v,matches:G,isDataRoute:c!=null},children:H})};return c&&(h.route.ErrorBoundary||h.route.errorElement||S===0)?p.createElement(dp,{location:c.location,revalidation:c.revalidation,component:B,error:j,children:X(),routeContext:{outlet:null,matches:G,isDataRoute:!0}}):X()},null)}function yc(s){return`${s} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function gp(s){let i=p.useContext(tn);return $e(i,yc(s)),i}function pp(s){let i=p.useContext(_u);return $e(i,yc(s)),i}function vp(s){let i=p.useContext(yl);return $e(i,yc(s)),i}function bc(s){let i=vp(s),c=i.matches[i.matches.length-1];return $e(c.route.id,`${s} can only be used on routes that contain a unique "id"`),c.route.id}function xp(){return bc("useRouteId")}function yp(){let s=p.useContext(xc),i=pp("useRouteError"),c=bc("useRouteError");return s!==void 0?s:i.errors?.[c]}function bp(){let{router:s}=gp("useNavigate"),i=bc("useNavigate"),c=p.useRef(!1);return Z0(()=>{c.current=!0}),p.useCallback(async(d,g={})=>{Zt(c.current,V0),c.current&&(typeof d=="number"?s.navigate(d):await s.navigate(d,{fromRouteId:i,...g}))},[s,i])}var C0={};function K0(s,i,c){!i&&!C0[s]&&(C0[s]=!0,Zt(!1,c))}p.memo(Sp);function Sp({routes:s,future:i,state:c}){return Q0(s,void 0,c,i)}function uc(s){$e(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ep({basename:s="/",children:i=null,location:c,navigationType:r="POP",navigator:d,static:g=!1}){$e(!rs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=s.replace(/^\/*/,"/"),E=p.useMemo(()=>({basename:x,navigator:d,static:g,future:{}}),[x,d,g]);typeof c=="string"&&(c=en(c));let{pathname:v="/",search:h="",hash:S="",state:j=null,key:C="default"}=c,B=p.useMemo(()=>{let T=xl(v,x);return T==null?null:{location:{pathname:T,search:h,hash:S,state:j,key:C},navigationType:r}},[x,v,h,S,j,C,r]);return Zt(B!=null,`<Router basename="${x}"> is not able to match the URL "${v}${h}${S}" because it does not start with the basename, so the <Router> won't render anything.`),B==null?null:p.createElement(el.Provider,{value:E},p.createElement(is.Provider,{children:i,value:B}))}function wp({children:s,location:i}){return cp(ic(s),i)}function ic(s,i=[]){let c=[];return p.Children.forEach(s,(r,d)=>{if(!p.isValidElement(r))return;let g=[...i,d];if(r.type===p.Fragment){c.push.apply(c,ic(r.props.children,g));return}$e(r.type===uc,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$e(!r.props.index||!r.props.children,"An index route cannot have child routes.");let x={id:r.props.id||g.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(x.children=ic(r.props.children,g)),c.push(x)}),c}var Cu="get",ku="application/x-www-form-urlencoded";function zu(s){return s!=null&&typeof s.tagName=="string"}function Mp(s){return zu(s)&&s.tagName.toLowerCase()==="button"}function jp(s){return zu(s)&&s.tagName.toLowerCase()==="form"}function Np(s){return zu(s)&&s.tagName.toLowerCase()==="input"}function Tp(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function Cp(s,i){return s.button===0&&(!i||i==="_self")&&!Tp(s)}function rc(s=""){return new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((i,c)=>{let r=s[c];return i.concat(Array.isArray(r)?r.map(d=>[c,d]):[[c,r]])},[]))}function kp(s,i){let c=rc(s);return i&&i.forEach((r,d)=>{c.has(d)||i.getAll(d).forEach(g=>{c.append(d,g)})}),c}var Tu=null;function Ap(){if(Tu===null)try{new FormData(document.createElement("form"),0),Tu=!1}catch{Tu=!0}return Tu}var Rp=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nc(s){return s!=null&&!Rp.has(s)?(Zt(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ku}"`),null):s}function Op(s,i){let c,r,d,g,x;if(jp(s)){let E=s.getAttribute("action");r=E?xl(E,i):null,c=s.getAttribute("method")||Cu,d=nc(s.getAttribute("enctype"))||ku,g=new FormData(s)}else if(Mp(s)||Np(s)&&(s.type==="submit"||s.type==="image")){let E=s.form;if(E==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let v=s.getAttribute("formaction")||E.getAttribute("action");if(r=v?xl(v,i):null,c=s.getAttribute("formmethod")||E.getAttribute("method")||Cu,d=nc(s.getAttribute("formenctype"))||nc(E.getAttribute("enctype"))||ku,g=new FormData(E,s),!Ap()){let{name:h,type:S,value:j}=s;if(S==="image"){let C=h?`${h}.`:"";g.append(`${C}x`,"0"),g.append(`${C}y`,"0")}else h&&g.append(h,j)}}else{if(zu(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');c=Cu,r=null,d=ku,x=s}return g&&d==="text/plain"&&(x=g,g=void 0),{action:r,method:c.toLowerCase(),encType:d,formData:g,body:x}}function Sc(s,i){if(s===!1||s===null||typeof s>"u")throw new Error(i)}async function Dp(s,i){if(s.id in i)return i[s.id];try{let c=await import(s.module);return i[s.id]=c,c}catch(c){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(c),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _p(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function zp(s,i,c){let r=await Promise.all(s.map(async d=>{let g=i.routes[d.route.id];if(g){let x=await Dp(g,c);return x.links?x.links():[]}return[]}));return Bp(r.flat(1).filter(_p).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function k0(s,i,c,r,d,g){let x=(v,h)=>c[h]?v.route.id!==c[h].route.id:!0,E=(v,h)=>c[h].pathname!==v.pathname||c[h].route.path?.endsWith("*")&&c[h].params["*"]!==v.params["*"];return g==="assets"?i.filter((v,h)=>x(v,h)||E(v,h)):g==="data"?i.filter((v,h)=>{let S=r.routes[v.route.id];if(!S||!S.hasLoader)return!1;if(x(v,h)||E(v,h))return!0;if(v.route.shouldRevalidate){let j=v.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:c[0]?.params||{},nextUrl:new URL(s,window.origin),nextParams:v.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function Up(s,i,{includeHydrateFallback:c}={}){return Hp(s.map(r=>{let d=i.routes[r.route.id];if(!d)return[];let g=[d.module];return d.clientActionModule&&(g=g.concat(d.clientActionModule)),d.clientLoaderModule&&(g=g.concat(d.clientLoaderModule)),c&&d.hydrateFallbackModule&&(g=g.concat(d.hydrateFallbackModule)),d.imports&&(g=g.concat(d.imports)),g}).flat(1))}function Hp(s){return[...new Set(s)]}function Lp(s){let i={},c=Object.keys(s).sort();for(let r of c)i[r]=s[r];return i}function Bp(s,i){let c=new Set;return new Set(i),s.reduce((r,d)=>{let g=JSON.stringify(Lp(d));return c.has(g)||(c.add(g),r.push({key:g,link:d})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var qp=new Set([100,101,204,205]);function Yp(s,i){let c=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return c.pathname==="/"?c.pathname="_root.data":i&&xl(c.pathname,i)==="/"?c.pathname=`${i.replace(/\/$/,"")}/_root.data`:c.pathname=`${c.pathname.replace(/\/$/,"")}.data`,c}function J0(){let s=p.useContext(tn);return Sc(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function $p(){let s=p.useContext(_u);return Sc(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var Ec=p.createContext(void 0);Ec.displayName="FrameworkContext";function F0(){let s=p.useContext(Ec);return Sc(s,"You must render this element inside a <HydratedRouter> element"),s}function Gp(s,i){let c=p.useContext(Ec),[r,d]=p.useState(!1),[g,x]=p.useState(!1),{onFocus:E,onBlur:v,onMouseEnter:h,onMouseLeave:S,onTouchStart:j}=i,C=p.useRef(null);p.useEffect(()=>{if(s==="render"&&x(!0),s==="viewport"){let G=H=>{H.forEach(J=>{x(J.isIntersecting)})},X=new IntersectionObserver(G,{threshold:.5});return C.current&&X.observe(C.current),()=>{X.disconnect()}}},[s]),p.useEffect(()=>{if(r){let G=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(G)}}},[r]);let B=()=>{d(!0)},T=()=>{d(!1),x(!1)};return c?s!=="intent"?[g,C,{}]:[g,C,{onFocus:ts(E,B),onBlur:ts(v,T),onMouseEnter:ts(h,B),onMouseLeave:ts(S,T),onTouchStart:ts(j,B)}]:[!1,C,{}]}function ts(s,i){return c=>{s&&s(c),c.defaultPrevented||i(c)}}function Xp({page:s,...i}){let{router:c}=J0(),r=p.useMemo(()=>L0(c.routes,s,c.basename),[c.routes,s,c.basename]);return r?p.createElement(Zp,{page:s,matches:r,...i}):null}function Vp(s){let{manifest:i,routeModules:c}=F0(),[r,d]=p.useState([]);return p.useEffect(()=>{let g=!1;return zp(s,i,c).then(x=>{g||d(x)}),()=>{g=!0}},[s,i,c]),r}function Zp({page:s,matches:i,...c}){let r=bl(),{manifest:d,routeModules:g}=F0(),{basename:x}=J0(),{loaderData:E,matches:v}=$p(),h=p.useMemo(()=>k0(s,i,v,d,r,"data"),[s,i,v,d,r]),S=p.useMemo(()=>k0(s,i,v,d,r,"assets"),[s,i,v,d,r]),j=p.useMemo(()=>{if(s===r.pathname+r.search+r.hash)return[];let T=new Set,G=!1;if(i.forEach(H=>{let J=d.routes[H.route.id];!J||!J.hasLoader||(!h.some(F=>F.route.id===H.route.id)&&H.route.id in E&&g[H.route.id]?.shouldRevalidate||J.hasClientLoader?G=!0:T.add(H.route.id))}),T.size===0)return[];let X=Yp(s,x);return G&&T.size>0&&X.searchParams.set("_routes",i.filter(H=>T.has(H.route.id)).map(H=>H.route.id).join(",")),[X.pathname+X.search]},[x,E,r,d,h,i,s,g]),C=p.useMemo(()=>Up(S,d),[S,d]),B=Vp(S);return p.createElement(p.Fragment,null,j.map(T=>p.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...c})),C.map(T=>p.createElement("link",{key:T,rel:"modulepreload",href:T,...c})),B.map(({key:T,link:G})=>p.createElement("link",{key:T,...G})))}function Qp(...s){return i=>{s.forEach(c=>{typeof c=="function"?c(i):c!=null&&(c.current=i)})}}var W0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{W0&&(window.__reactRouterVersion="7.6.2")}catch{}function Kp({basename:s,children:i,window:c}){let r=p.useRef();r.current==null&&(r.current=_g({window:c,v5Compat:!0}));let d=r.current,[g,x]=p.useState({action:d.action,location:d.location}),E=p.useCallback(v=>{p.startTransition(()=>x(v))},[x]);return p.useLayoutEffect(()=>d.listen(E),[d,E]),p.createElement(Ep,{basename:s,children:i,location:g.location,navigationType:g.action,navigator:d})}var P0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,I0=p.forwardRef(function({onClick:i,discover:c="render",prefetch:r="none",relative:d,reloadDocument:g,replace:x,state:E,target:v,to:h,preventScrollReset:S,viewTransition:j,...C},B){let{basename:T}=p.useContext(el),G=typeof h=="string"&&P0.test(h),X,H=!1;if(typeof h=="string"&&G&&(X=h,W0))try{let ne=new URL(window.location.href),I=h.startsWith("//")?new URL(ne.protocol+h):new URL(h),ae=xl(I.pathname,T);I.origin===ne.origin&&ae!=null?h=ae+I.search+I.hash:H=!0}catch{Zt(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let J=ip(h,{relative:d}),[F,Z,Q]=Gp(r,C),ee=Pp(h,{replace:x,state:E,target:v,preventScrollReset:S,relative:d,viewTransition:j});function se(ne){i&&i(ne),ne.defaultPrevented||ee(ne)}let le=p.createElement("a",{...C,...Q,href:X||J,onClick:H||g?i:se,ref:Qp(B,Z),target:v,"data-discover":!G&&c==="render"?"true":void 0});return F&&!G?p.createElement(p.Fragment,null,le,p.createElement(Xp,{page:J})):le});I0.displayName="Link";var Jp=p.forwardRef(function({"aria-current":i="page",caseSensitive:c=!1,className:r="",end:d=!1,style:g,to:x,viewTransition:E,children:v,...h},S){let j=os(x,{relative:h.relative}),C=bl(),B=p.useContext(_u),{navigator:T,basename:G}=p.useContext(el),X=B!=null&&nv(j)&&E===!0,H=T.encodeLocation?T.encodeLocation(j).pathname:j.pathname,J=C.pathname,F=B&&B.navigation&&B.navigation.location?B.navigation.location.pathname:null;c||(J=J.toLowerCase(),F=F?F.toLowerCase():null,H=H.toLowerCase()),F&&G&&(F=xl(F,G)||F);const Z=H!=="/"&&H.endsWith("/")?H.length-1:H.length;let Q=J===H||!d&&J.startsWith(H)&&J.charAt(Z)==="/",ee=F!=null&&(F===H||!d&&F.startsWith(H)&&F.charAt(H.length)==="/"),se={isActive:Q,isPending:ee,isTransitioning:X},le=Q?i:void 0,ne;typeof r=="function"?ne=r(se):ne=[r,Q?"active":null,ee?"pending":null,X?"transitioning":null].filter(Boolean).join(" ");let I=typeof g=="function"?g(se):g;return p.createElement(I0,{...h,"aria-current":le,className:ne,ref:S,style:I,to:x,viewTransition:E},typeof v=="function"?v(se):v)});Jp.displayName="NavLink";var Fp=p.forwardRef(({discover:s="render",fetcherKey:i,navigate:c,reloadDocument:r,replace:d,state:g,method:x=Cu,action:E,onSubmit:v,relative:h,preventScrollReset:S,viewTransition:j,...C},B)=>{let T=lv(),G=av(E,{relative:h}),X=x.toLowerCase()==="get"?"get":"post",H=typeof E=="string"&&P0.test(E),J=F=>{if(v&&v(F),F.defaultPrevented)return;F.preventDefault();let Z=F.nativeEvent.submitter,Q=Z?.getAttribute("formmethod")||x;T(Z||F.currentTarget,{fetcherKey:i,method:Q,navigate:c,replace:d,state:g,relative:h,preventScrollReset:S,viewTransition:j})};return p.createElement("form",{ref:B,method:X,action:G,onSubmit:r?v:J,...C,"data-discover":!H&&s==="render"?"true":void 0})});Fp.displayName="Form";function Wp(s){return`${s} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function eh(s){let i=p.useContext(tn);return $e(i,Wp(s)),i}function Pp(s,{target:i,replace:c,state:r,preventScrollReset:d,relative:g,viewTransition:x}={}){let E=cs(),v=bl(),h=os(s,{relative:g});return p.useCallback(S=>{if(Cp(S,i)){S.preventDefault();let j=c!==void 0?c:ss(v)===ss(h);E(s,{replace:j,state:r,preventScrollReset:d,relative:g,viewTransition:x})}},[v,E,h,c,r,i,s,d,g,x])}function Ip(s){Zt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let i=p.useRef(rc(s)),c=p.useRef(!1),r=bl(),d=p.useMemo(()=>kp(r.search,c.current?null:i.current),[r.search]),g=cs(),x=p.useCallback((E,v)=>{const h=rc(typeof E=="function"?E(d):E);c.current=!0,g("?"+h,v)},[g,d]);return[d,x]}var ev=0,tv=()=>`__${String(++ev)}__`;function lv(){let{router:s}=eh("useSubmit"),{basename:i}=p.useContext(el),c=xp();return p.useCallback(async(r,d={})=>{let{action:g,method:x,encType:E,formData:v,body:h}=Op(r,i);if(d.navigate===!1){let S=d.fetcherKey||tv();await s.fetch(S,c,d.action||g,{preventScrollReset:d.preventScrollReset,formData:v,body:h,formMethod:d.method||x,formEncType:d.encType||E,flushSync:d.flushSync})}else await s.navigate(d.action||g,{preventScrollReset:d.preventScrollReset,formData:v,body:h,formMethod:d.method||x,formEncType:d.encType||E,replace:d.replace,state:d.state,fromRouteId:c,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,i,c])}function av(s,{relative:i}={}){let{basename:c}=p.useContext(el),r=p.useContext(yl);$e(r,"useFormAction must be used inside a RouteContext");let[d]=r.matches.slice(-1),g={...os(s||".",{relative:i})},x=bl();if(s==null){g.search=x.search;let E=new URLSearchParams(g.search),v=E.getAll("index");if(v.some(S=>S==="")){E.delete("index"),v.filter(j=>j).forEach(j=>E.append("index",j));let S=E.toString();g.search=S?`?${S}`:""}}return(!s||s===".")&&d.route.index&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),c!=="/"&&(g.pathname=g.pathname==="/"?c:vl([c,g.pathname])),ss(g)}function nv(s,i={}){let c=p.useContext(X0);$e(c!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=eh("useViewTransitionState"),d=os(s,{relative:i.relative});if(!c.isTransitioning)return!1;let g=xl(c.currentLocation.pathname,r)||c.currentLocation.pathname,x=xl(c.nextLocation.pathname,r)||c.nextLocation.pathname;return Du(d.pathname,x)!=null||Du(d.pathname,g)!=null}[...qp];function sv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const A0=p.forwardRef(sv);function uv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const iv=p.forwardRef(uv);function rv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12a7.5 7.5 0 0 0 15 0m-15 0a7.5 7.5 0 1 1 15 0m-15 0H3m16.5 0H21m-1.5 0H12m-8.457 3.077 1.41-.513m14.095-5.13 1.41-.513M5.106 17.785l1.15-.964m11.49-9.642 1.149-.964M7.501 19.795l.75-1.3m7.5-12.99.75-1.3m-6.063 16.658.26-1.477m2.605-14.772.26-1.477m0 17.726-.26-1.477M10.698 4.614l-.26-1.477M16.5 19.794l-.75-1.299M7.5 4.205 12 12m6.894 5.785-1.149-.964M6.256 7.178l-1.15-.964m15.352 8.864-1.41-.513M4.954 9.435l-1.41-.514M12.002 12l-3.75 6.495"}))}const cv=p.forwardRef(rv);function ov({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"}))}const fv=p.forwardRef(ov);function dv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const hv=p.forwardRef(dv);function mv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const gv=p.forwardRef(mv);function pv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const vv=p.forwardRef(pv);function xv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const th=p.forwardRef(xv);function yv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const bv=p.forwardRef(yv);function Sv({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const wc=p.forwardRef(Sv),Qt={ENDPOINTS:{CHAT:"/api/chat",ABORT:"/api/abort",PROJECTS:"/api/projects",HISTORIES:"/api/projects",CONVERSATIONS:"/api/projects",MODELS:"/api/models",PROVIDERS:"/api/providers"}},Ev=s=>`${Qt.ENDPOINTS.ABORT}/${s}`,wv=()=>Qt.ENDPOINTS.CHAT,lh=()=>Qt.ENDPOINTS.PROJECTS,Mv=()=>Qt.ENDPOINTS.MODELS,jv=()=>Qt.ENDPOINTS.PROVIDERS,Nv=s=>`${Qt.ENDPOINTS.PROVIDERS}/${encodeURIComponent(s)}/api-key`,Tv=s=>`${Qt.ENDPOINTS.PROVIDERS}/${encodeURIComponent(s)}/oauth/authorize`,Cv=s=>`${Qt.ENDPOINTS.PROVIDERS}/${encodeURIComponent(s)}/oauth/callback`,kv=()=>Qt.ENDPOINTS.PROJECTS,Av=(s,i)=>{const c=encodeURIComponent(s),r=`${Qt.ENDPOINTS.HISTORIES}/${c}/histories`;return i?`${r}?path=${encodeURIComponent(i)}`:r},Rv=(s,i,c)=>{const r=encodeURIComponent(s),d=`${Qt.ENDPOINTS.CONVERSATIONS}/${r}/histories/${i}`;return c?`${d}?path=${encodeURIComponent(c)}`:d};function ah({onClick:s}){return f.jsx("button",{onClick:s,className:"p-3 rounded-xl bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 hover:bg-white dark:hover:bg-slate-800 transition-all duration-200 backdrop-blur-sm shadow-sm hover:shadow-md","aria-label":"Open settings",children:f.jsx(cv,{className:"w-5 h-5 text-slate-600 dark:text-slate-400"})})}const nh=p.createContext(null);function Uu(){const s=p.useContext(nh);if(!s)throw new Error("useSettings must be used within a SettingsProvider");return s}function Ov(){const{enterBehavior:s,toggleEnterBehavior:i}=Uu();return{enterBehavior:s,toggleEnterBehavior:i}}function Dv(){const{theme:s,enterBehavior:i,toggleTheme:c,toggleEnterBehavior:r}=Uu();return f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{"aria-live":"polite",className:"sr-only",id:"settings-announcements",children:[s==="light"?"Light mode enabled":"Dark mode enabled","."," ",i==="send"?"Enter key sends messages":"Enter key creates newlines","."]}),f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-medium text-slate-800 dark:text-slate-100 mb-4",children:"General Settings"}),f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 mb-2 block",children:"Theme"}),f.jsx("div",{className:"flex items-center gap-2",children:f.jsxs("button",{onClick:c,className:"flex items-center gap-3 px-4 py-3 bg-slate-50 dark:bg-slate-700/50 border border-slate-200 dark:border-slate-600 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-all duration-200 text-left flex-1",role:"switch","aria-checked":s==="dark","aria-label":`Theme toggle. Currently set to ${s} mode. Click to switch to ${s==="light"?"dark":"light"} mode.`,children:[s==="light"?f.jsx(bv,{className:"w-5 h-5 text-yellow-500"}):f.jsx(vv,{className:"w-5 h-5 text-blue-400"}),f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-slate-800 dark:text-slate-100",children:s==="light"?"Light Mode":"Dark Mode"}),f.jsxs("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:["Click to switch to ",s==="light"?"dark":"light"," ","mode"]})]})]})})]}),f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 mb-2 block",children:"Enter Key Behavior"}),f.jsx("div",{className:"flex items-center gap-2",children:f.jsxs("button",{onClick:r,className:"flex items-center gap-3 px-4 py-3 bg-slate-50 dark:bg-slate-700/50 border border-slate-200 dark:border-slate-600 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-all duration-200 text-left flex-1",role:"switch","aria-checked":i==="send","aria-label":`Enter key behavior toggle. Currently set to ${i==="send"?"send message":"newline"}. Click to switch behavior.`,children:[f.jsx(fv,{className:"w-5 h-5 text-slate-600 dark:text-slate-400"}),f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium text-slate-800 dark:text-slate-100",children:i==="send"?"Enter to Send":"Enter for Newline"}),f.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:i==="send"?"Enter sends message, Shift+Enter for newline":"Enter adds newline, Shift+Enter sends message"})]})]})}),f.jsx("div",{className:"mt-2 text-xs text-slate-500 dark:text-slate-400",children:"Controls how the Enter key behaves when typing messages in the chat input."})]})]})]})]})}function sh({isOpen:s,onClose:i}){if(p.useEffect(()=>{const r=d=>{d.key==="Escape"&&s&&i()};return s&&(document.addEventListener("keydown",r),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",r),document.body.style.overflow="unset"}},[s,i]),!s)return null;const c=r=>{r.target===r.currentTarget&&i()};return f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:c,children:f.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 shadow-xl max-w-lg w-full max-h-[90vh] overflow-hidden",children:[f.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-slate-200 dark:border-slate-700",children:[f.jsx("h2",{className:"text-xl font-semibold text-slate-800 dark:text-slate-100",children:"Settings"}),f.jsx("button",{onClick:i,className:"p-2 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors","aria-label":"Close settings",children:f.jsx(wc,{className:"w-5 h-5 text-slate-500 dark:text-slate-400"})})]}),f.jsx("div",{className:"overflow-y-auto max-h-[calc(90vh-120px)]",children:f.jsx("div",{className:"p-6",children:f.jsx(Dv,{})})})]})})}function _v(){const[s,i]=p.useState([]),[c,r]=p.useState(!0),[d,g]=p.useState(null),[x,E]=p.useState(!1),[v,h]=p.useState(!1),[S,j]=p.useState(""),[C,B]=p.useState(!0),[T,G]=p.useState(null),[X,H]=p.useState(!1),J=cs();p.useEffect(()=>{F()},[]);const F=async()=>{try{r(!0);const I=await fetch(lh());if(!I.ok)throw new Error(`Failed to load projects: ${I.statusText}`);const ae=await I.json();i(ae.projects)}catch(I){g(I instanceof Error?I.message:"Failed to load projects")}finally{r(!1)}},Z=I=>{const ae=I.startsWith("/")?I:`/${I}`;J(`/projects${ae}`)},Q=()=>{E(!0)},ee=()=>{E(!1)},se=()=>{G(null),j(""),B(!0),h(!0)},le=()=>{h(!1)},ne=async I=>{I.preventDefault();const ae=S.trim();if(!ae){G("Please enter a project path.");return}try{H(!0),G(null);const de=await fetch(kv(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ae,create:C})}),Ue=await de.json();if(!de.ok||!Ue.success)throw new Error(Ue.error||"Failed to create project");await F(),h(!1)}catch(de){G(de instanceof Error?de.message:"Failed to create project")}finally{H(!1)}};return c?f.jsx("div",{className:"flex items-center justify-center min-h-screen",children:f.jsx("div",{className:"text-slate-600 dark:text-slate-400",children:"Loading projects..."})}):d?f.jsx("div",{className:"flex items-center justify-center min-h-screen",children:f.jsxs("div",{className:"text-red-600 dark:text-red-400",children:["Error: ",d]})}):f.jsx("div",{className:"min-h-screen bg-slate-50 dark:bg-slate-900 transition-colors duration-300",children:f.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[f.jsxs("div",{className:"flex items-center justify-between mb-8",children:[f.jsx("h1",{className:"text-slate-800 dark:text-slate-100 text-3xl font-bold tracking-tight",children:"Select a Project"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("button",{onClick:se,className:"inline-flex items-center gap-2 px-4 py-2 bg-slate-900 text-white rounded-lg hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-slate-200 transition-colors",children:[f.jsx(th,{className:"h-4 w-4"}),"New Project"]}),f.jsx(ah,{onClick:Q})]})]}),f.jsx("div",{className:"space-y-3",children:s.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("h2",{className:"text-slate-700 dark:text-slate-300 text-lg font-medium mb-4",children:"Recent Projects"}),s.map(I=>f.jsxs("button",{onClick:()=>Z(I.path),className:"w-full flex items-center gap-3 p-4 bg-white dark:bg-slate-800 hover:bg-slate-50 dark:hover:bg-slate-700 border border-slate-200 dark:border-slate-700 rounded-lg transition-colors text-left",children:[f.jsx(gv,{className:"h-5 w-5 text-slate-500 dark:text-slate-400 flex-shrink-0"}),f.jsx("span",{className:"text-slate-800 dark:text-slate-200 font-mono text-sm",children:I.path})]},I.path))]})}),f.jsx(sh,{isOpen:x,onClose:ee}),v&&f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:I=>{I.target===I.currentTarget&&le()},children:f.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 shadow-xl max-w-lg w-full overflow-hidden",children:[f.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-slate-200 dark:border-slate-700",children:[f.jsx("h2",{className:"text-xl font-semibold text-slate-800 dark:text-slate-100",children:"Create Project"}),f.jsx("button",{onClick:le,className:"p-2 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors","aria-label":"Close create project",children:f.jsx(wc,{className:"w-5 h-5 text-slate-500 dark:text-slate-400"})})]}),f.jsxs("form",{onSubmit:ne,className:"p-6 space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300",children:"Project path"}),f.jsx("input",{type:"text",value:S,onChange:I=>j(I.target.value),placeholder:"D:\\\\projects\\\\my-app",className:"w-full rounded-lg border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-900 px-3 py-2 text-slate-800 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-slate-500"})]}),f.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 dark:text-slate-300",children:[f.jsx("input",{type:"checkbox",checked:C,onChange:I=>B(I.target.checked),className:"h-4 w-4 rounded border-slate-300 text-slate-900"}),"Create directory if missing"]}),T&&f.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:T}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.jsx("button",{type:"button",onClick:le,className:"px-4 py-2 rounded-lg border border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 transition-colors",children:"Cancel"}),f.jsx("button",{type:"submit",disabled:X,className:"px-4 py-2 rounded-lg bg-slate-900 text-white hover:bg-slate-800 disabled:opacity-60 disabled:cursor-not-allowed dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-slate-200 transition-colors",children:X?"Creating...":"Create"})]})]})]})})]})})}function zv(s){return s.type==="system"}function Uv(s){return s.type==="assistant"}function Hv(s){return s.type==="result"}function Lv(s){return s.type==="user"}function Bv(s){return typeof s=="object"&&s!==null&&"type"in s&&s.type==="thinking"&&"thinking"in s&&typeof s.thinking=="string"}const R0={TEXTAREA_MAX_HEIGHT:200},cc={ABORT:"Escape",SUBMIT:"Enter",PERMISSION_MODE_TOGGLE:"M"},uh={SUMMARY_MAX_LENGTH:50,SESSION_ID_DISPLAY_LENGTH:8},fa={MULTI_WORD_COMMANDS:["cargo","git","npm","yarn","docker"],WILDCARD_COMMAND:"*",DEFAULT_TOOL_NAME:"Unknown",BASH_BUILTINS:["cd","pwd","export","unset","alias","unalias","history","jobs","bg","fg","exit","return","shift","break","continue","which"],COMMAND_SEPARATORS:["&&","||",";","|"]};function qv(s,i){const c=s||fa.DEFAULT_TOOL_NAME;let r=[];return c==="Bash"&&i?.command&&typeof i.command=="string"?r=Yv(i.command):c==="ExitPlanMode"?r=["ExitPlanMode"]:r=[fa.WILDCARD_COMMAND],c!=="Bash"&&r.length===0&&(r=[fa.WILDCARD_COMMAND]),{toolName:c,commands:r}}function Yv(s){const c=$v(s).map(g=>Gv(g.trim())).filter(Boolean),r=c.filter(g=>!fa.BASH_BUILTINS.includes(g)),d=r.length>0?r:c;return[...new Set(d)]}function $v(s){const i=fa.COMMAND_SEPARATORS.map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),c=new RegExp(`\\s*(${i})\\s*`);return s.split(c).filter((r,d)=>d%2===0&&r.trim()!=="")}function Gv(s){const i=s.split(/\s+/);return i.length>=2&&fa.MULTI_WORD_COMMANDS.includes(i[0])?i.slice(0,2).join(" "):i[0]||""}function Xv(s,i){return s!=="Bash"?[s]:i.map(c=>c!==fa.WILDCARD_COMMAND?`${s}(${c}:*)`:s)}function Vv(s){if(!s)return"";if(s.path)return`(${s.path})`;if(s.file_path)return`(${s.file_path})`;if(s.command)return`(${s.command})`;if(s.pattern)return`(${s.pattern})`;if(s.url)return`(${s.url})`;const i=Object.keys(s);if(i.length>0){const c=i[0],r=s[c];return typeof r=="string"&&r.length<50?`(${r})`:`(${i.length} ${i.length===1?"arg":"args"})`}return""}function ls(s){const i=s.toLowerCase();return[".html",".htm",".md",".txt",".json",".xml",".css",".js",".ts",".jsx",".tsx",".svg",".png",".jpg",".jpeg",".gif",".webp",".bmp",".xlsx",".xls",".csv",".py"].includes(i)}function O0(s,i){const c=[],d=[".html",".htm",".md",".txt",".json",".xml",".css",".js",".ts",".jsx",".tsx",".svg",".png",".jpg",".jpeg",".gif",".webp",".bmp",".xlsx",".xls",".csv",".py"].map(v=>v.replace(".","")).join("|");if(s==="Write"){const v=[/Created file at:\s*([^\s\n]+)/gi,/Wrote file at:\s*([^\s\n]+)/gi,/Updated file at:\s*([^\s\n]+)/gi,/Created\s+([^\s\n]+\.(?:[a-zA-Z0-9]+))(?:\s|$)/gi,/Wrote\s+([^\s\n]+\.(?:[a-zA-Z0-9]+))(?:\s|$)/gi,/Updated\s+([^\s\n]+\.(?:[a-zA-Z0-9]+))(?:\s|$)/gi,/File:\s+([^\s\n]+\.(?:[a-zA-Z0-9]+))(?:\s|$)/gi,/Writing to:\s*([^\s\n]+)/gi,/"file_path"\s*:\s*["']([^"']+)["']/gi,/"path"\s*:\s*["']([^"']+\.(?:[a-zA-Z0-9]+))["']/gi,/File created successfully at:\s*([^\s\n]+)/gi];for(const h of v){h.lastIndex=0;let S;for(;(S=h.exec(i))!==null;){const C=S[1].trim().replace(/[\'\"\;:.,\s]+$/,"").replace(/^['"]+|['"]+$/g,"");C&&C.length>0&&ls(as(C))&&c.push(C)}}}if(s==="result"||i.includes("tool_result")){const v=/(?:file_path|filePath|path):\s*[\'\"]?([^\s\'\"\n]+\.[a-zA-Z0-9]+)/g;let h;for(;(h=v.exec(i))!==null;){const S=h[1].trim();S&&ls(as(S))&&c.push(S)}}const g=[new RegExp(`(?:[A-Za-z]:[\\/]|\\/)[^s"'<>]+\\.(?:${d})`,"gi"),new RegExp(`[^s"'<>]+\\.(?:${d})`,"gi")];for(const v of g){v.lastIndex=0;let h;for(;(h=v.exec(i))!==null;){const j=h[0].trim().replace(/[\'\"\;:.,\s]+$/,"").replace(/^["']+|["']+$/g,"");j&&ls(as(j))&&c.push(j)}}const x=[],E=new Set;for(const v of c)E.has(v)||(E.add(v),x.push(v));return x}function Zv(s,i){const c=[];if(!i)return c;if(s==="Write"){const r=i,d=r.file_path;if(typeof d=="string"&&d.length>0){const x=d.trim();ls(as(x))&&c.push(x)}const g=r.path;if(typeof g=="string"&&g.length>0){const x=g.trim();ls(as(x))&&!c.includes(x)&&c.push(x)}}return c}function as(s){const i=s.split(/[\\/]/),c=i[i.length-1],r=c.lastIndexOf("."),d=r>0?c.slice(r):"";return d.startsWith(".")?d:`.${d}`}function Qv(s){return s.startsWith("image/")}function Kv(s){return s==="text/html"||s==="application/xhtml+xml"}function Jv(s){return s==="text/markdown"}function Fv(s){return s.includes("excel")||s.includes("spreadsheet")||s==="text/csv"}function Wv(s){return s.startsWith("text/")||s==="application/json"}function ih(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}function Pv(s){if(s.includes(`
`)){const i=s.split(`
`).filter(c=>c.trim());if(i.length>0)return`${i.length} ${i.length===1?"line":"lines"}`}else if(s.includes("Found")){const i=s.match(/Found (\d+)/);if(i)return`Found ${i[1]}`}else if(s.includes("files")){const i=s.match(/(\d+)\s+files?/);if(i)return`${i[1]} files`}else if(s.length<uh.SUMMARY_MAX_LENGTH)return s.trim();return`${s.length} chars`}function oc(s,i){return{...s,timestamp:i??Date.now()}}function rh(s,i){return{...s,timestamp:i??Date.now()}}function fc(s,i){const c=s.name||"Unknown",r=Vv(s.input),d=Zv(c,s.input);return{type:"tool",content:`${c}${r}`,timestamp:i??Date.now(),filePaths:d}}function ch(s,i,c,r){const d=Pv(i);return{type:"tool_result",toolName:s,content:i,summary:d,timestamp:c??Date.now(),toolUseResult:r}}function oh(s,i){return{type:"thinking",content:s,timestamp:i??Date.now()}}function Iv(s){if(typeof s!="object"||s===null)return!1;const i=s;return typeof i.content=="string"&&typeof i.status=="string"&&["pending","in_progress","completed"].includes(i.status)&&typeof i.activeForm=="string"}function ex(s){try{if(s.todos&&Array.isArray(s.todos))return s.todos.every(Iv)?s.todos:(console.debug("Invalid todo item structure in input:",s.todos),null)}catch(i){console.debug("Failed to extract todo data from input:",i)}return null}function tx(s,i){const c=ex(s);return c?{type:"todo",todos:c,timestamp:i??Date.now()}:null}function lx(s){return new Mc().processMessage(s,{addMessage:()=>{}},{isStreaming:!1,timestamp:new Date(s.timestamp).getTime()})}function ax(s){return new Mc().processMessagesBatch(s)}function nx(s){return s.includes("tool_use_error")}class Mc{toolUseCache=new Map;clearCache(){this.toolUseCache.clear()}cacheToolUse(i,c,r){this.toolUseCache.set(i,{name:c,input:r})}getCachedToolInfo(i){return this.toolUseCache.get(i)}handlePermissionError(i,c){c.onAbortRequest&&c.onAbortRequest();const r=i.tool_use_id||"",d=this.getCachedToolInfo(r),{toolName:g,commands:x}=qv(d?.name,d?.input),E=Xv(g,x);c.onPermissionError&&c.onPermissionError(g,E,r)}processToolResult(i,c,r,d){const g=typeof i.content=="string"?i.content:JSON.stringify(i.content);if(r.isStreaming&&i.is_error&&!nx(g)){this.handlePermissionError(i,c);return}const x=i.tool_use_id||"",v=this.getCachedToolInfo(x)?.name||"Tool";if(v==="TodoWrite")return;const h=ch(v,g,r.timestamp,d);c.addMessage(h)}handleAssistantText(i,c,r){if(!r.isStreaming)return;let d=c.currentAssistantMessage;d||(d={type:"chat",role:"assistant",content:"",timestamp:r.timestamp||Date.now()},c.setCurrentAssistantMessage?.(d),c.addMessage(d));const g=(d.content||"")+(i.text||""),x={...d,content:g};c.setCurrentAssistantMessage?.(x),c.updateLastMessage?.(g)}handleToolUse(i,c,r){if(i.id&&i.name&&this.cacheToolUse(i.id,i.name,i.input||{}),i.name==="ExitPlanMode"){const g={type:"plan",plan:i.input?.plan||"",toolUseId:i.id||"",timestamp:r.timestamp||Date.now()};c.addMessage(g)}else if(i.name==="TodoWrite"){const d=tx(i.input||{},r.timestamp);if(d)c.addMessage(d);else{const g=fc(i,r.timestamp);c.addMessage(g)}}else{const d=fc(i,r.timestamp);c.addMessage(d)}}processSystemMessage(i,c,r){const d=r.timestamp||Date.now();if(r.isStreaming&&i.subtype==="init"){if(c.setHasReceivedInit?.(!0),c.shouldShowInitMessage?.()??!0){const x=oc(i,d);c.addMessage(x),c.onInitMessageShown?.()}}else{const g=oc(i,d);c.addMessage(g)}}processAssistantMessage(i,c,r){const d=r.timestamp||Date.now(),g=[];r.isStreaming&&c.hasReceivedInit&&i.session_id&&c.onSessionId&&c.onSessionId(i.session_id);const x=r.isStreaming?c:{...c,addMessage:h=>g.push(h)};let E="";const v=[];if(i.message?.content&&Array.isArray(i.message.content)){for(const h of i.message.content)if(h.type==="text")r.isStreaming?this.handleAssistantText(h,c,r):E+=h.text;else if(h.type==="tool_use")this.handleToolUse(h,x,r);else if(Bv(h)){const S=oh(h.thinking,d);r.isStreaming?c.addMessage(S):v.push(S)}}if(!r.isStreaming){const h=[];if(h.push(...v),h.push(...g),E.trim()){const S={type:"chat",role:"assistant",content:E.trim(),timestamp:d};h.push(S)}return h}return g}processResultMessage(i,c,r){const d=r.timestamp||Date.now(),g=rh(i,d);c.addMessage(g),r.isStreaming&&c.setCurrentAssistantMessage?.(null)}processUserMessage(i,c,r){const d=r.timestamp||Date.now(),g=[],x=r.isStreaming?c:{...c,addMessage:v=>g.push(v)},E=i.message.content;if(Array.isArray(E)){for(const v of E)if(v.type==="tool_result"){const h=i.toolUseResult;this.processToolResult(v,x,r,h)}else if(v.type==="text"){const h={type:"chat",role:"user",content:v.text,timestamp:d};x.addMessage(h)}}else if(typeof E=="string"){const v={type:"chat",role:"user",content:E,timestamp:d};x.addMessage(v)}return g}processMessage(i,c,r={}){const d=r.timestamp||("timestamp"in i?new Date(i.timestamp).getTime():Date.now()),g={...r,timestamp:d};switch(i.type){case"system":return this.processSystemMessage(i,c,g),[];case"assistant":return this.processAssistantMessage(i,c,g);case"result":return this.processResultMessage(i,c,g),[];case"user":return this.processUserMessage(i,c,g);default:return console.warn("Unknown message type:",i.type),[]}}processMessagesBatch(i,c){const r=[],d={addMessage:g=>r.push(g),...c};this.clearCache();for(const g of i){const x=this.processMessage(g,d,{isStreaming:!1,timestamp:new Date(g.timestamp).getTime()});r.push(...x)}return r}}function sx(){const s=p.useMemo(()=>new Mc,[]),i=p.useCallback(d=>({addMessage:d.addMessage,updateLastMessage:d.updateLastMessage,currentAssistantMessage:d.currentAssistantMessage,setCurrentAssistantMessage:d.setCurrentAssistantMessage,onSessionId:d.onSessionId,hasReceivedInit:d.hasReceivedInit,setHasReceivedInit:d.setHasReceivedInit,shouldShowInitMessage:d.shouldShowInitMessage,onInitMessageShown:d.onInitMessageShown,onPermissionError:d.onPermissionError,onAbortRequest:d.onAbortRequest}),[]),c=p.useCallback((d,g)=>{const x=i(g);switch(d.type){case"system":if(!zv(d)){console.warn("Invalid system message:",d);return}break;case"assistant":if(!Uv(d)){console.warn("Invalid assistant message:",d);return}break;case"result":if(!Hv(d)){console.warn("Invalid result message:",d);return}break;case"user":if(!Lv(d)){console.warn("Invalid user message:",d);return}break;default:console.log("Unknown OpenCode message type:",d);return}s.processMessage(d,x,{isStreaming:!0})},[s,i]);return{processStreamLine:p.useCallback((d,g)=>{try{const x=JSON.parse(d);if(x.type==="claude_json"&&x.data){const E=x.data;c(E,g)}else if(x.type==="error"){const E={type:"error",subtype:"stream_error",message:x.error||"Unknown error",timestamp:Date.now()};g.addMessage(E)}else if(x.type==="aborted"){const E={type:"system",subtype:"abort",message:"Operation was aborted by user",timestamp:Date.now()};g.addMessage(E),g.setCurrentAssistantMessage(null)}}catch(x){console.error("Failed to parse stream line:",x)}},[c])}}function ux(){const{processStreamLine:s}=sx();return{processStreamLine:s}}function ix(){if(typeof crypto<"u"&&crypto.randomUUID)try{return crypto.randomUUID()}catch{console.debug("crypto.randomUUID() not available, trying crypto.getRandomValues()")}if(typeof crypto<"u"&&crypto.getRandomValues)try{const s=new Uint8Array(16);crypto.getRandomValues(s),s[6]=s[6]&15|64,s[8]=s[8]&63|128;const i=Array.from(s).map(c=>c.toString(16).padStart(2,"0")).join("");return[i.slice(0,8),i.slice(8,12),i.slice(12,16),i.slice(16,20),i.slice(20,32)].join("-")}catch{console.debug("crypto.getRandomValues() not available, using Math.random() fallback")}return console.debug("Using Math.random() for ID generation - not cryptographically secure"),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(s){const i=Math.random()*16|0;return(s==="x"?i:i&3|8).toString(16)})}const rx=[];function cx(s={}){const{initialMessages:i=rx,initialSessionId:c=null}=s,r=p.useMemo(()=>i,[i]),[d,g]=p.useState(r),[x,E]=p.useState(""),[v,h]=p.useState(!1),[S,j]=p.useState(c),[C,B]=p.useState(null),[T,G]=p.useState(!1),[X,H]=p.useState(!1),[J,F]=p.useState(null);p.useEffect(()=>{g(r)},[r]),p.useEffect(()=>{j(c)},[c]);const Z=p.useCallback(I=>{g(ae=>[...ae,I])},[]),Q=p.useCallback(I=>{g(ae=>ae.map((de,Ue)=>Ue===ae.length-1&&de.type==="chat"?{...de,content:I}:de))},[]),ee=p.useCallback(()=>{E("")},[]),se=p.useCallback(()=>{const I=ix();return B(I),I},[]),le=p.useCallback(()=>{h(!1),B(null),F(null)},[]),ne=p.useCallback(()=>{h(!0),F(null),H(!1)},[]);return{messages:d,input:x,isLoading:v,currentSessionId:S,currentRequestId:C,hasShownInitMessage:T,hasReceivedInit:X,currentAssistantMessage:J,setMessages:g,setInput:E,setIsLoading:h,setCurrentSessionId:j,setCurrentRequestId:B,setHasShownInitMessage:G,setHasReceivedInit:H,setCurrentAssistantMessage:F,addMessage:Z,updateLastMessage:Q,clearInput:ee,generateRequestId:se,resetRequestState:le,startRequest:ne}}function ox(s={}){const{onPermissionModeChange:i}=s,[c,r]=p.useState([]),[d,g]=p.useState(null),[x,E]=p.useState(null),[v,h]=p.useState(!1),S=p.useCallback((J,F,Z)=>{g({isOpen:!0,toolName:J,patterns:F,toolUseId:Z}),h(!0)},[]),j=p.useCallback(()=>{g(null),h(!1)},[]),C=p.useCallback(J=>{E({isOpen:!0,planContent:J}),h(!0)},[]),B=p.useCallback(()=>{E(null),h(!1)},[]),T=p.useCallback((J,F)=>[...F||c,J],[c]),G=p.useCallback((J,F)=>{const Q=[...F||c,J];return r(Q),Q},[c]),X=p.useCallback(()=>{r([])},[]),H=p.useCallback(J=>{i?.(J)},[i]);return{allowedTools:c,permissionRequest:d,showPermissionRequest:S,closePermissionRequest:j,allowToolTemporary:T,allowToolPermanent:G,resetPermissions:X,isPermissionMode:v,setIsPermissionMode:h,planModeRequest:x,showPlanModeRequest:C,closePlanModeRequest:B,updatePermissionMode:H}}function fx(){const[s,i]=p.useState("acceptEdits"),c=p.useCallback(r=>{i(r)},[]);return{permissionMode:s,setPermissionMode:c,isPlanMode:s==="plan",isDefaultMode:s==="default",isAcceptEditsMode:s==="acceptEdits"}}function dx(){const s=p.useCallback(async r=>{await fetch(Ev(r),{method:"POST",headers:{"Content-Type":"application/json"}})},[]),i=p.useCallback(async(r,d,g)=>{if(!(!r||!d))try{await s(r)}catch(x){console.error("Failed to abort request:",x)}finally{g()}},[s]),c=p.useCallback(r=>async()=>{try{await s(r)}catch(d){console.error("Failed to abort request:",d)}},[s]);return{abortRequest:i,createAbortHandler:c}}function hx(){const s=p.useCallback(E=>oc(E),[]),i=p.useCallback(E=>fc(E),[]),c=p.useCallback(E=>rh(E),[]),r=p.useCallback((E,v,h,S)=>ch(E,v,h,S),[]),d=p.useCallback(E=>oh(E),[]),g=p.useCallback(E=>lx(E),[]),x=p.useCallback(E=>ax(E),[]);return{createSystemMessage:s,createToolMessage:i,createResultMessage:c,createToolResultMessage:r,createThinkingMessage:d,convertTimestampedSDKMessage:g,convertConversationHistory:x}}function mx(s){return typeof s=="object"&&s!==null&&"type"in s&&"timestamp"in s&&typeof s.timestamp=="string"}function gx(){const[s,i]=p.useState({messages:[],loading:!1,error:null,sessionId:null}),{convertConversationHistory:c}=hx(),r=p.useCallback(async(g,x,E)=>{if(!g||!x){i(v=>({...v,error:"Encoded project name and session ID are required"}));return}try{i(C=>({...C,loading:!0,error:null}));const v=await fetch(Rv(g,x,E));if(!v.ok)throw new Error(`Failed to load conversation: ${v.status} ${v.statusText}`);const h=await v.json();if(!h.messages||!Array.isArray(h.messages))throw new Error("Invalid conversation history format");const S=[];for(const C of h.messages)mx(C)?S.push(C):console.warn("Skipping invalid message in history:",C);const j=c(S);i(C=>({...C,messages:j,loading:!1,sessionId:h.sessionId}))}catch(v){console.error("Error loading conversation history:",v),i(h=>({...h,loading:!1,error:v instanceof Error?v.message:"Failed to load conversation history"}))}},[c]),d=p.useCallback(()=>{i({messages:[],loading:!1,error:null,sessionId:null})},[]);return{...s,loadHistory:r,clearHistory:d}}function px(s,i,c){const r=gx();return p.useEffect(()=>{s&&i?r.loadHistory(s,i,c):i||r.clearHistory()},[s,i]),r}function Au(s){return s.replace(/^\/([A-Za-z]:)/,"$1").replace(/\\/g,"/")}function vx(s){return s&&Au(s).replace(/\//g,"\\")}function ns(s,i){let c=s.trim();if(!c)return c;if(c=c.replace(/^file:\/\//i,""),c=c.replace(/^\/?([A-Za-z]:)/,"$1"),c=c.replace(/^["']+|["']+$/g,""),c=c.replace(/\\/g,"/"),i){const r=i.replace(/\\/g,"/").replace(/\/+$/,""),d=c.toLowerCase(),g=r.toLowerCase();d.startsWith(`${g}/`)&&(c=c.slice(r.length+1))}return c}function dc(s){return/^[A-Za-z]:\//.test(s)||s.startsWith("//")}function hc(s){const i=s.lastIndexOf("/");if(i===-1)return{directory:"",fileName:s};const c=s.slice(0,i),r=s.slice(i+1);return{directory:c,fileName:r||s}}const xx="/api/file";function yx(s){const[i,c]=p.useState(new Map),[r,d]=p.useState(null),[g,x]=p.useState(null),[E,v]=p.useState(null),[h,S]=p.useState(!1),[j,C]=p.useState(null);p.useEffect(()=>{x(null),v(null),C(null)},[r?.path]);const B=p.useCallback((J,F)=>{const Z=ns(J,s)||J;c(Q=>{const ee=new Map(Q),se=Z.split(".").pop()?.toLowerCase()||"";return ee.set(Z,{path:Z,name:Z.split(/[\\/]/).pop()||Z,extension:se.startsWith(".")?se:`.${se}`,size:F,mimeType:bx(se)}),ee})},[s]),T=p.useCallback(J=>{c(F=>{const Z=new Map(F);return Z.delete(J),Z}),r?.path===J&&d(null)},[r]),G=p.useCallback(()=>{c(new Map),d(null),x(null),v(null),C(null)},[]),X=p.useCallback(async J=>{d(J),S(!0),C(null);const F=ns(J.path,s)||J.path;let Z=F,Q=s;if(dc(F)){const{directory:ee,fileName:se}=hc(F);Q=ee||s,Z=se}if(!Q){C("No working directory configured"),S(!1);return}console.log("[FileCanvas] Selecting file:",Z,J.name);try{const ee=new URLSearchParams({path:Z,workingDirectory:Q}),se=await fetch(`${xx}?${ee}`);if(!se.ok){const ne=await se.json();throw console.error("[FileCanvas] Error response:",ne),se.status===404&&T(F),new Error(ne.error||`HTTP ${se.status}`)}const le=await se.json();if(console.log("[FileCanvas] File response:",le),le.success)le.content&&(console.log("[FileCanvas] Setting content, length:",le.content.length),x(le.content)),le.base64&&(console.log("[FileCanvas] Setting base64, length:",le.base64.length),v(le.base64)),le.mimeType&&r?.mimeType!==le.mimeType&&d(ne=>ne&&{...ne,mimeType:le.mimeType});else throw new Error(le.error||"Failed to read file")}catch(ee){console.error("[FileCanvas] Error loading file:",ee),C(ee instanceof Error?ee.message:"Failed to load file")}finally{S(!1),console.log("[FileCanvas] selectFile completed, loading:",!1)}},[s,T]);return{files:p.useCallback(()=>Array.from(i.values()),[i])(),selectedFile:r,fileContent:g,fileBase64:E,isLoading:h,error:j,addFile:B,removeFile:T,clearFiles:G,selectFile:X}}function bx(s){const i=s.toLowerCase();return{".html":"text/html",".htm":"text/html",".css":"text/css",".js":"text/javascript",".ts":"text/typescript",".json":"application/json",".md":"text/markdown",".txt":"text/plain",".xml":"application/xml",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".ico":"image/x-icon",".bmp":"image/bmp",".pdf":"application/pdf",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".xls":"application/vnd.ms-excel",".csv":"text/csv",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".doc":"application/msword"}[i]||"application/octet-stream"}function Sx({onClick:s}){return f.jsx("button",{onClick:s,className:"p-3 rounded-xl bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 hover:bg-white dark:hover:bg-slate-800 transition-all duration-200 backdrop-blur-sm shadow-sm hover:shadow-md","aria-label":"View conversation history",children:f.jsx(iv,{className:"w-5 h-5 text-slate-600 dark:text-slate-400"})})}function Ex({title:s,titleId:i,...c},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":i},c),s?p.createElement("title",{id:i},s):null,p.createElement("path",{fillRule:"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z",clipRule:"evenodd"}))}const wx=p.forwardRef(Ex);function mc(s){if(!s)return"Unknown";const i=s.match(/Bash\(([^:]+):/);return i?i[1]:s}function Mx(s){if(s.length===0)return f.jsx("p",{className:"text-slate-600 dark:text-slate-300 mb-3",children:"OpenCode wants to use bash commands, but the specific commands could not be determined."});if(s.length>1){const c=s.map(mc);return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"text-slate-600 dark:text-slate-300 mb-2",children:"OpenCode wants to use the following commands:"}),f.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:c.map((r,d)=>f.jsx("span",{className:"font-mono bg-slate-100 dark:bg-slate-700 px-2 py-1 rounded text-sm",children:r},d))})]})}else{const c=mc(s[0]);return f.jsxs("p",{className:"text-slate-600 dark:text-slate-300 mb-3",children:["OpenCode wants to use the"," ",f.jsx("span",{className:"font-mono bg-slate-100 dark:bg-slate-700 px-2 py-1 rounded text-sm",children:c})," ","command."]})}}function jx(s){if(s.length===0)return"Yes, and don't ask again for bash commands";const i=s.length>1,c=s.map(mc);return i?`Yes, and don't ask again for ${c.join(" and ")} commands`:`Yes, and don't ask again for ${c[0]} command`}function Nx({patterns:s,onAllow:i,onAllowPermanent:c,onDeny:r,getButtonClassName:d=(E,v)=>v,onSelectionChange:g,externalSelectedOption:x}){const[E,v]=p.useState("allow"),h=x!==void 0,S=x??E,j=p.useCallback(C=>{x===void 0&&v(C),g?.(C)},[g,x]);return p.useEffect(()=>{if(x!==void 0)return;const C=["allow","allowPermanent","deny"],B=T=>{if(T.key==="ArrowDown"){T.preventDefault();const X=(C.indexOf(S)+1)%C.length;j(C[X])}else if(T.key==="ArrowUp"){T.preventDefault();const X=(C.indexOf(S)-1+C.length)%C.length;j(C[X])}else T.key==="Enter"&&S?(T.preventDefault(),S==="allow"?i():S==="allowPermanent"?c():S==="deny"&&r()):T.key==="Escape"&&(T.preventDefault(),r())};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[S,i,c,r,j,x]),f.jsxs("div",{className:"flex-shrink-0 px-4 py-4 bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 rounded-xl backdrop-blur-sm shadow-sm",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[f.jsx("div",{className:"p-2 bg-amber-100 dark:bg-amber-900/20 rounded-lg",children:f.jsx(hv,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),f.jsx("h3",{className:"text-lg font-semibold text-slate-800 dark:text-slate-100",children:"Permission Required"})]}),f.jsxs("div",{className:"mb-4",children:[Mx(s),f.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Do you want to proceed? (Press ESC to deny)"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("button",{onClick:()=>{j("allow"),i()},onFocus:()=>j("allow"),onBlur:()=>{h||v(null)},onMouseEnter:()=>j("allow"),onMouseLeave:()=>{h||v(null)},className:d("allow",`w-full p-3 rounded-lg cursor-pointer transition-all duration-200 text-left focus:outline-none ${S==="allow"?"bg-blue-50 dark:bg-blue-900/20 border-2 border-blue-500 dark:border-blue-400 shadow-sm":"border-2 border-transparent"}`),children:f.jsx("span",{className:`text-sm font-medium ${S==="allow"?"text-blue-700 dark:text-blue-300":"text-slate-700 dark:text-slate-300"}`,children:"Yes"})}),f.jsx("button",{onClick:()=>{j("allowPermanent"),c()},onFocus:()=>j("allowPermanent"),onBlur:()=>{h||v(null)},onMouseEnter:()=>j("allowPermanent"),onMouseLeave:()=>{h||v(null)},className:d("allowPermanent",`w-full p-3 rounded-lg cursor-pointer transition-all duration-200 text-left focus:outline-none ${S==="allowPermanent"?"bg-green-50 dark:bg-green-900/20 border-2 border-green-500 dark:border-green-400 shadow-sm":"border-2 border-transparent"}`),children:f.jsx("span",{className:`text-sm font-medium ${S==="allowPermanent"?"text-green-700 dark:text-green-300":"text-slate-700 dark:text-slate-300"}`,children:jx(s)})}),f.jsx("button",{onClick:()=>{j("deny"),r()},onFocus:()=>j("deny"),onBlur:()=>{h||v(null)},onMouseEnter:()=>j("deny"),onMouseLeave:()=>{h||v(null)},className:d("deny",`w-full p-3 rounded-lg cursor-pointer transition-all duration-200 text-left focus:outline-none ${S==="deny"?"bg-slate-50 dark:bg-slate-800 border-2 border-slate-400 dark:border-slate-500 shadow-sm":"border-2 border-transparent"}`),children:f.jsx("span",{className:`text-sm font-medium ${S==="deny"?"text-slate-800 dark:text-slate-200":"text-slate-700 dark:text-slate-300"}`,children:"No"})})]})]})}function Tx({onAcceptWithEdits:s,onAcceptDefault:i,onKeepPlanning:c,getButtonClassName:r=(x,E)=>E,onSelectionChange:d,externalSelectedOption:g}){const[x,E]=p.useState("acceptWithEdits"),v=g!==void 0,h=g??x,S=p.useCallback(j=>{g===void 0&&E(j),d?.(j)},[d,g]);return p.useEffect(()=>{if(g!==void 0)return;const j=["acceptWithEdits","acceptDefault","keepPlanning"],C=B=>{if(B.key==="ArrowDown"){B.preventDefault();const G=(j.indexOf(h)+1)%j.length;S(j[G])}else if(B.key==="ArrowUp"){B.preventDefault();const G=(j.indexOf(h)-1+j.length)%j.length;S(j[G])}else B.key==="Enter"&&h?(B.preventDefault(),h==="acceptWithEdits"?s():h==="acceptDefault"?i():h==="keepPlanning"&&c()):B.key==="Escape"&&(B.preventDefault(),c())};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[h,i,s,c,S,g]),f.jsxs("div",{className:"flex-shrink-0 px-4 py-4 bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 rounded-xl backdrop-blur-sm shadow-sm",children:[f.jsx("div",{className:"mb-4",children:f.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Choose how to proceed (Press ESC to keep planning)"})}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("button",{onClick:()=>{S("acceptWithEdits"),s()},onFocus:()=>S("acceptWithEdits"),onBlur:()=>{v||E(null)},onMouseEnter:()=>S("acceptWithEdits"),onMouseLeave:()=>{v||E(null)},className:r("acceptWithEdits",`w-full p-3 rounded-lg cursor-pointer transition-all duration-200 text-left focus:outline-none ${h==="acceptWithEdits"?"bg-green-50 dark:bg-green-900/20 border-2 border-green-500 dark:border-green-400 shadow-sm":"border-2 border-transparent"}`),children:f.jsx("span",{className:`text-sm font-medium ${h==="acceptWithEdits"?"text-green-700 dark:text-green-300":"text-slate-700 dark:text-slate-300"}`,children:"Yes, switch to build (auto-accept edits)"})}),f.jsx("button",{onClick:()=>{S("acceptDefault"),i()},onFocus:()=>S("acceptDefault"),onBlur:()=>{v||E(null)},onMouseEnter:()=>S("acceptDefault"),onMouseLeave:()=>{v||E(null)},className:r("acceptDefault",`w-full p-3 rounded-lg cursor-pointer transition-all duration-200 text-left focus:outline-none ${h==="acceptDefault"?"bg-blue-50 dark:bg-blue-900/20 border-2 border-blue-500 dark:border-blue-400 shadow-sm":"border-2 border-transparent"}`),children:f.jsx("span",{className:`text-sm font-medium ${h==="acceptDefault"?"text-blue-700 dark:text-blue-300":"text-slate-700 dark:text-slate-300"}`,children:"Yes, switch to build (manual approvals)"})}),f.jsx("button",{onClick:()=>{S("keepPlanning"),c()},onFocus:()=>S("keepPlanning"),onBlur:()=>{v||E(null)},onMouseEnter:()=>S("keepPlanning"),onMouseLeave:()=>{v||E(null)},className:r("keepPlanning",`w-full p-3 rounded-lg cursor-pointer transition-all duration-200 text-left focus:outline-none ${h==="keepPlanning"?"bg-slate-50 dark:bg-slate-800 border-2 border-slate-400 dark:border-slate-500 shadow-sm":"border-2 border-transparent"}`),children:f.jsx("span",{className:`text-sm font-medium ${h==="keepPlanning"?"text-slate-800 dark:text-slate-200":"text-slate-700 dark:text-slate-300"}`,children:"No, keep planning"})})]})]})}const Cx=["opencode","anthropic","openai","google","github-copilot","openrouter","modelscope","moonshot","moonshot-ai","moonshot-ai-china","qwen","zai-coding-plan"],kx=new Set(Cx),D0={opencode:"Create an API key at https://opencode.ai/auth",openai:"Use your OpenAI API key",anthropic:"Use your Anthropic API key",google:"Use your Google AI Studio API key",openrouter:"Use your OpenRouter API key",vercel:"Create a token at https://vercel.link/ai-gateway-token"};function Ax({isOpen:s,onClose:i}){const[c,r]=p.useState([]),[d,g]=p.useState([]),[x,E]=p.useState({}),[v,h]=p.useState(!1),[S,j]=p.useState(null),[C,B]=p.useState(""),[T,G]=p.useState(null),[X,H]=p.useState(0),[J,F]=p.useState(""),[Z,Q]=p.useState(null),[ee,se]=p.useState(""),[le,ne]=p.useState("idle"),I=async()=>{h(!0),j(null);try{const O=await fetch(jv()),Y=await O.json().catch(()=>({}));if(!O.ok)throw new Error(Y.error||`Failed to load providers (${O.status})`);const P=Y;r(P.providers||[]),g(P.connected||[]),E(P.authMethods||{}),!T&&P.providers?.length&&G(P.providers[0].id)}catch(O){console.error("Failed to load providers:",O),j("Failed to load providers")}finally{h(!1)}};p.useEffect(()=>{s&&I()},[s]),p.useEffect(()=>{H(0),F(""),Q(null),se(""),ne("idle")},[T]),p.useEffect(()=>{Q(null),se(""),ne("idle")},[X]);const ae=p.useMemo(()=>{const O=C.trim().toLowerCase();return O?c.filter(Y=>{const P=Y.name?.toLowerCase()||"",ue=Y.id.toLowerCase();return P.includes(O)||ue.includes(O)}):c},[c,C]),[de,Ue]=p.useMemo(()=>{const O=[],Y=[],P=ae.slice().sort((ue,ie)=>(ue.name||ue.id).localeCompare(ie.name||ie.id));for(const ue of P){if(kx.has(ue.id)){O.push(ue);continue}Y.push(ue)}return[O,Y]},[ae]),W=p.useMemo(()=>{if(T)return c.find(O=>O.id===T)},[c,T]),V=p.useMemo(()=>{if(!W)return[];const O=x[W.id]||[];return O.length>0?O:[{type:"api",label:"API key"}]},[x,W]),w=V[X],U=W?d.includes(W.id):!1,A=async()=>{if(!(!W||!J.trim())){ne("working");try{const O=await fetch(Nv(W.id),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:J.trim()})});if(!O.ok)throw new Error(`Failed to save key (${O.status})`);ne("success"),F(""),await I()}catch(O){console.error("Failed to save api key:",O),ne("error")}}},K=async()=>{if(W){ne("working");try{const O=await fetch(Tv(W.id),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:X})});if(!O.ok)throw new Error(`Failed to start oauth (${O.status})`);const Y=await O.json();if(!Y?.url)throw new Error("Missing oauth url");Q(Y),ne("idle"),window.open(Y.url,"_blank","noopener,noreferrer")}catch(O){console.error("Failed to start oauth:",O),ne("error")}}},y=async()=>{if(!(!W||!Z)&&!(Z.method==="code"&&!ee.trim())){ne("working");try{const O=await fetch(Cv(W.id),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:X,code:Z.method==="code"?ee.trim():void 0})});if(!O.ok)throw new Error(`Failed to complete oauth (${O.status})`);ne("success"),Q(null),se(""),await I()}catch(O){console.error("Failed to complete oauth:",O),ne("error")}}};if(p.useEffect(()=>{const O=Y=>{Y.key==="Escape"&&s&&i()};return s&&(document.addEventListener("keydown",O),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",O),document.body.style.overflow="unset"}},[s,i]),!s)return null;const z=O=>{O.target===O.currentTarget&&i()};return f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:z,children:f.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 shadow-xl w-full max-w-4xl max-h-[90vh] overflow-hidden",children:[f.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-slate-200 dark:border-slate-700",children:[f.jsxs("div",{children:[f.jsx("h2",{className:"text-xl font-semibold text-slate-800 dark:text-slate-100",children:"Connect a Provider"}),f.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Add API keys or complete OAuth to unlock models"})]}),f.jsx("button",{onClick:i,className:"p-2 rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors","aria-label":"Close connect modal",children:f.jsx(wc,{className:"w-5 h-5 text-slate-500 dark:text-slate-400"})})]}),f.jsxs("div",{className:"flex h-[70vh]",children:[f.jsxs("div",{className:"w-1/3 border-r border-slate-200 dark:border-slate-700 p-4 flex flex-col gap-3",children:[f.jsx("input",{value:C,onChange:O=>B(O.target.value),placeholder:"Search providers",className:"px-3 py-2 text-sm bg-slate-50 dark:bg-slate-700/50 border border-slate-200 dark:border-slate-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"}),f.jsxs("div",{className:"flex-1 overflow-y-auto",children:[v&&f.jsx("div",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Loading providers..."}),!v&&ae.length===0&&f.jsx("div",{className:"text-sm text-slate-500 dark:text-slate-400",children:"No providers found"}),f.jsxs("ul",{className:"space-y-4",children:[de.length>0&&f.jsxs("li",{children:[f.jsx("div",{className:"text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500 mb-2",children:"Popular"}),f.jsx("ul",{className:"space-y-1",children:de.map(O=>f.jsx("li",{children:f.jsxs("button",{onClick:()=>G(O.id),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${O.id===T?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-200":"hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-200"}`,children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{children:O.name||O.id}),d.includes(O.id)&&f.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-200",children:"Connected"})]}),f.jsx("div",{className:"text-[11px] text-slate-400 dark:text-slate-500",children:O.id})]})},O.id))})]}),Ue.length>0&&f.jsxs("li",{children:[f.jsx("div",{className:"text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500 mb-2",children:"Other"}),f.jsx("ul",{className:"space-y-1",children:Ue.map(O=>f.jsx("li",{children:f.jsxs("button",{onClick:()=>G(O.id),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${O.id===T?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-200":"hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-200"}`,children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{children:O.name||O.id}),d.includes(O.id)&&f.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-200",children:"Connected"})]}),f.jsx("div",{className:"text-[11px] text-slate-400 dark:text-slate-500",children:O.id})]})},O.id))})]})]})]}),f.jsx("div",{className:"text-xs text-slate-400 dark:text-slate-500",children:S||"Select a provider to connect"})]}),f.jsxs("div",{className:"flex-1 p-6 overflow-y-auto",children:[!W&&f.jsx("div",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Choose a provider to continue."}),W&&f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-lg font-semibold text-slate-800 dark:text-slate-100",children:W.name||W.id}),f.jsxs("div",{className:"text-sm text-slate-500 dark:text-slate-400",children:["Provider ID: ",W.id]})]}),U&&f.jsx("div",{className:"text-xs px-3 py-1 rounded-full bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-200",children:"Connected"})]}),V.length>0&&f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:"Auth method"}),f.jsx("div",{className:"flex flex-wrap gap-2",children:V.map((O,Y)=>f.jsx("button",{onClick:()=>H(Y),className:`px-3 py-1 text-xs rounded-full border ${Y===X?"border-blue-500 text-blue-600 dark:text-blue-300":"border-slate-300 dark:border-slate-600 text-slate-500 dark:text-slate-400"}`,children:O.label},`${O.label}-${Y}`))})]}),!w&&f.jsx("div",{className:"text-sm text-slate-500 dark:text-slate-400",children:"This provider does not expose an interactive auth method."}),W&&D0[W.id]&&f.jsx("div",{className:"text-xs text-slate-400 dark:text-slate-500",children:D0[W.id]}),w?.type==="api"&&f.jsxs("div",{className:"space-y-3",children:[f.jsx("label",{className:"text-sm font-medium text-slate-700 dark:text-slate-300",children:"API key"}),f.jsx("input",{type:"password",value:J,onChange:O=>F(O.target.value),placeholder:"Paste your API key",className:"w-full px-3 py-2 text-sm bg-slate-50 dark:bg-slate-700/50 border border-slate-200 dark:border-slate-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{onClick:A,disabled:!J.trim()||le==="working",className:"px-4 py-2 text-sm rounded-lg bg-blue-600 text-white hover:bg-blue-700 disabled:bg-slate-400 disabled:cursor-not-allowed",children:"Save API Key"}),le==="success"&&f.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400",children:"Saved"}),le==="error"&&f.jsx("span",{className:"text-xs text-red-500",children:"Failed"})]})]}),w?.type==="oauth"&&f.jsxs("div",{className:"space-y-4",children:[f.jsx("button",{onClick:K,disabled:le==="working",className:"px-4 py-2 text-sm rounded-lg bg-blue-600 text-white hover:bg-blue-700 disabled:bg-slate-400 disabled:cursor-not-allowed",children:"Start OAuth"}),Z&&f.jsxs("div",{className:"space-y-3 rounded-lg border border-slate-200 dark:border-slate-600 p-4",children:[f.jsx("div",{className:"text-sm text-slate-600 dark:text-slate-300",children:Z.instructions||"Open the link to authorize."}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{readOnly:!0,value:Z.url,className:"flex-1 px-3 py-2 text-xs bg-slate-50 dark:bg-slate-700/50 border border-slate-200 dark:border-slate-600 rounded-lg"}),f.jsx("button",{onClick:()=>window.open(Z.url,"_blank","noopener,noreferrer"),className:"px-3 py-2 text-xs rounded-lg border border-slate-300 dark:border-slate-600",children:"Open"})]}),Z.method==="code"&&f.jsx("input",{value:ee,onChange:O=>se(O.target.value),placeholder:"Paste authorization code",className:"w-full px-3 py-2 text-sm bg-slate-50 dark:bg-slate-700/50 border border-slate-200 dark:border-slate-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"}),f.jsx("button",{onClick:y,disabled:le==="working"||Z.method==="code"&&!ee.trim(),className:"px-4 py-2 text-sm rounded-lg bg-emerald-600 text-white hover:bg-emerald-700 disabled:bg-slate-400 disabled:cursor-not-allowed",children:"Complete OAuth"}),le==="success"&&f.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400",children:"Connected"}),le==="error"&&f.jsx("span",{className:"text-xs text-red-500",children:"Failed"})]})]})]})]})]})]})})}function Rx({input:s,isLoading:i,currentRequestId:c,onInputChange:r,onSubmit:d,onAbort:g,permissionMode:x,onPermissionModeChange:E,showPermissions:v=!1,permissionData:h,planPermissionData:S}){const j=p.useRef(null),[C,B]=p.useState(!1),{enterBehavior:T}=Ov(),{settings:G,updateSettings:X}=Uu(),[H,J]=p.useState([]),[F,Z]=p.useState(!1),[Q,ee]=p.useState(!1);p.useEffect(()=>{!i&&!v&&j.current&&j.current.focus()},[i,v]),p.useEffect(()=>{const A=j.current;if(A){A.style.height="auto";const K=getComputedStyle(A),y=parseInt(K.maxHeight,10)||R0.TEXTAREA_MAX_HEIGHT,z=Math.min(A.scrollHeight,y);A.style.height=`${z}px`}},[s]),p.useEffect(()=>{(async()=>{Z(!0);try{const K=await fetch(Mv());if(!K.ok)throw new Error(`Failed to load models (${K.status})`);const y=await K.json();J(Array.isArray(y.models)?y.models:[])}catch(K){console.error("Failed to load models:",K),J([])}finally{Z(!1)}})()},[]);const se=A=>{const K=A.target.value.trim();X({model:K.length>0?K:void 0})},le=()=>{ee(!0)},ne=A=>{A.preventDefault(),d()},I=A=>{if(A.key===cc.PERMISSION_MODE_TOGGLE&&A.shiftKey&&A.ctrlKey&&!A.metaKey&&!C){A.preventDefault(),E(U(x));return}A.key===cc.SUBMIT&&!C&&(T==="newline"?ae(A):de(A))},ae=A=>{A.shiftKey&&(A.preventDefault(),d())},de=A=>{A.shiftKey||(A.preventDefault(),d())},Ue=()=>{B(!0)},W=()=>{setTimeout(()=>B(!1),0)},V=A=>{switch(A){case"default":return"build";case"plan":return"plan";case"acceptEdits":return"build"}},w=A=>{switch(A){case"default":return"build";case"plan":return"plan";case"acceptEdits":return"build"}},U=A=>{const K=["plan","acceptEdits"],y=A==="default"?"acceptEdits":A,z=K.indexOf(y);return z===-1?"plan":K[(z+1)%K.length]};return v&&S?f.jsx(Tx,{onAcceptWithEdits:S.onAcceptWithEdits,onAcceptDefault:S.onAcceptDefault,onKeepPlanning:S.onKeepPlanning,getButtonClassName:S.getButtonClassName,onSelectionChange:S.onSelectionChange,externalSelectedOption:S.externalSelectedOption}):v&&h?f.jsx(Nx,{patterns:h.patterns,onAllow:h.onAllow,onAllowPermanent:h.onAllowPermanent,onDeny:h.onDeny,getButtonClassName:h.getButtonClassName,onSelectionChange:h.onSelectionChange,externalSelectedOption:h.externalSelectedOption}):f.jsxs("div",{className:"flex-shrink-0",children:[f.jsxs("form",{onSubmit:ne,className:"relative",children:[f.jsx("textarea",{ref:j,value:s,onChange:A=>r(A.target.value),onKeyDown:I,onCompositionStart:Ue,onCompositionEnd:W,placeholder:i&&c?"Processing...":"Type message...",rows:1,className:`w-full px-4 py-3 pr-20 bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 backdrop-blur-sm shadow-sm text-slate-800 dark:text-slate-100 placeholder-slate-400 dark:placeholder-slate-500 resize-none overflow-hidden min-h-[48px] max-h-[${R0.TEXTAREA_MAX_HEIGHT}px]`,disabled:i}),f.jsxs("div",{className:"absolute right-2 bottom-3 flex gap-2",children:[i&&c&&f.jsx("button",{type:"button",onClick:g,className:"p-2 bg-red-100 hover:bg-red-200 dark:bg-red-900/20 dark:hover:bg-red-900/30 text-red-600 dark:text-red-400 rounded-lg transition-all duration-200 shadow-sm hover:shadow-md",title:"Stop (ESC)",children:f.jsx(wx,{className:"w-4 h-4"})}),f.jsx("button",{type:"submit",disabled:!s.trim()||i,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:bg-slate-400 text-white rounded-lg font-medium transition-all duration-200 shadow-sm hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50 text-sm",children:i?"...":x==="plan"?"Plan":"Send"})]})]}),f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsxs("button",{type:"button",onClick:()=>E(U(x)),className:"px-4 py-1 text-xs text-slate-600 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200 font-mono text-left transition-colors cursor-pointer",title:`Current: ${w(x)} - Click to cycle (Ctrl+Shift+M)`,children:[V(x),f.jsx("span",{className:"ml-2 text-slate-400 dark:text-slate-500 text-[10px]",children:"- Click to cycle (Ctrl+Shift+M)"})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("select",{value:G.model??"",onChange:se,className:"px-2 py-1 text-xs bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-slate-700 dark:text-slate-200",title:"Model",children:[f.jsx("option",{value:"",children:"Model: default"}),H.map(A=>f.jsx("option",{value:A,children:A},A)),F&&f.jsx("option",{value:"",children:"Loading..."})]}),f.jsx("button",{type:"button",onClick:le,className:"px-2 py-1 text-xs bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 rounded-lg text-slate-600 dark:text-slate-300 hover:text-slate-800 dark:hover:text-slate-100 transition-colors",title:"Connect providers",children:"Connect"})]})]}),f.jsx(Ax,{isOpen:Q,onClose:()=>ee(!1)})]})}function Ox(s){return s.type==="chat"}function Dx(s){return s.type==="system"||s.type==="result"||s.type==="error"}function _x(s){return s.type==="tool"}function zx(s){return s.type==="tool_result"}function Ux(s){return s.type==="plan"}function Hx(s){return s.type==="thinking"}function Lx(s){return s.type==="todo"}var Ru={exports:{}},Bx=Ru.exports,_0;function qx(){return _0||(_0=1,function(s,i){(function(c,r){s.exports=r()})(Bx,function(){var c=1e3,r=6e4,d=36e5,g="millisecond",x="second",E="minute",v="hour",h="day",S="week",j="month",C="quarter",B="year",T="date",G="Invalid Date",X=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,H=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,J={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(W){var V=["th","st","nd","rd"],w=W%100;return"["+W+(V[(w-20)%10]||V[w]||V[0])+"]"}},F=function(W,V,w){var U=String(W);return!U||U.length>=V?W:""+Array(V+1-U.length).join(w)+W},Z={s:F,z:function(W){var V=-W.utcOffset(),w=Math.abs(V),U=Math.floor(w/60),A=w%60;return(V<=0?"+":"-")+F(U,2,"0")+":"+F(A,2,"0")},m:function W(V,w){if(V.date()<w.date())return-W(w,V);var U=12*(w.year()-V.year())+(w.month()-V.month()),A=V.clone().add(U,j),K=w-A<0,y=V.clone().add(U+(K?-1:1),j);return+(-(U+(w-A)/(K?A-y:y-A))||0)},a:function(W){return W<0?Math.ceil(W)||0:Math.floor(W)},p:function(W){return{M:j,y:B,w:S,d:h,D:T,h:v,m:E,s:x,ms:g,Q:C}[W]||String(W||"").toLowerCase().replace(/s$/,"")},u:function(W){return W===void 0}},Q="en",ee={};ee[Q]=J;var se="$isDayjsObject",le=function(W){return W instanceof de||!(!W||!W[se])},ne=function W(V,w,U){var A;if(!V)return Q;if(typeof V=="string"){var K=V.toLowerCase();ee[K]&&(A=K),w&&(ee[K]=w,A=K);var y=V.split("-");if(!A&&y.length>1)return W(y[0])}else{var z=V.name;ee[z]=V,A=z}return!U&&A&&(Q=A),A||!U&&Q},I=function(W,V){if(le(W))return W.clone();var w=typeof V=="object"?V:{};return w.date=W,w.args=arguments,new de(w)},ae=Z;ae.l=ne,ae.i=le,ae.w=function(W,V){return I(W,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var de=function(){function W(w){this.$L=ne(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[se]=!0}var V=W.prototype;return V.parse=function(w){this.$d=function(U){var A=U.date,K=U.utc;if(A===null)return new Date(NaN);if(ae.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var y=A.match(X);if(y){var z=y[2]-1||0,O=(y[7]||"0").substring(0,3);return K?new Date(Date.UTC(y[1],z,y[3]||1,y[4]||0,y[5]||0,y[6]||0,O)):new Date(y[1],z,y[3]||1,y[4]||0,y[5]||0,y[6]||0,O)}}return new Date(A)}(w),this.init()},V.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},V.$utils=function(){return ae},V.isValid=function(){return this.$d.toString()!==G},V.isSame=function(w,U){var A=I(w);return this.startOf(U)<=A&&A<=this.endOf(U)},V.isAfter=function(w,U){return I(w)<this.startOf(U)},V.isBefore=function(w,U){return this.endOf(U)<I(w)},V.$g=function(w,U,A){return ae.u(w)?this[U]:this.set(A,w)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(w,U){var A=this,K=!!ae.u(U)||U,y=ae.p(w),z=function(qe,Ze){var He=ae.w(A.$u?Date.UTC(A.$y,Ze,qe):new Date(A.$y,Ze,qe),A);return K?He:He.endOf(h)},O=function(qe,Ze){return ae.w(A.toDate()[qe].apply(A.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(Ze)),A)},Y=this.$W,P=this.$M,ue=this.$D,ie="set"+(this.$u?"UTC":"");switch(y){case B:return K?z(1,0):z(31,11);case j:return K?z(1,P):z(0,P+1);case S:var De=this.$locale().weekStart||0,Se=(Y<De?Y+7:Y)-De;return z(K?ue-Se:ue+(6-Se),P);case h:case T:return O(ie+"Hours",0);case v:return O(ie+"Minutes",1);case E:return O(ie+"Seconds",2);case x:return O(ie+"Milliseconds",3);default:return this.clone()}},V.endOf=function(w){return this.startOf(w,!1)},V.$set=function(w,U){var A,K=ae.p(w),y="set"+(this.$u?"UTC":""),z=(A={},A[h]=y+"Date",A[T]=y+"Date",A[j]=y+"Month",A[B]=y+"FullYear",A[v]=y+"Hours",A[E]=y+"Minutes",A[x]=y+"Seconds",A[g]=y+"Milliseconds",A)[K],O=K===h?this.$D+(U-this.$W):U;if(K===j||K===B){var Y=this.clone().set(T,1);Y.$d[z](O),Y.init(),this.$d=Y.set(T,Math.min(this.$D,Y.daysInMonth())).$d}else z&&this.$d[z](O);return this.init(),this},V.set=function(w,U){return this.clone().$set(w,U)},V.get=function(w){return this[ae.p(w)]()},V.add=function(w,U){var A,K=this;w=Number(w);var y=ae.p(U),z=function(P){var ue=I(K);return ae.w(ue.date(ue.date()+Math.round(P*w)),K)};if(y===j)return this.set(j,this.$M+w);if(y===B)return this.set(B,this.$y+w);if(y===h)return z(1);if(y===S)return z(7);var O=(A={},A[E]=r,A[v]=d,A[x]=c,A)[y]||1,Y=this.$d.getTime()+w*O;return ae.w(Y,this)},V.subtract=function(w,U){return this.add(-1*w,U)},V.format=function(w){var U=this,A=this.$locale();if(!this.isValid())return A.invalidDate||G;var K=w||"YYYY-MM-DDTHH:mm:ssZ",y=ae.z(this),z=this.$H,O=this.$m,Y=this.$M,P=A.weekdays,ue=A.months,ie=A.meridiem,De=function(Ze,He,tt,qt){return Ze&&(Ze[He]||Ze(U,K))||tt[He].slice(0,qt)},Se=function(Ze){return ae.s(z%12||12,Ze,"0")},qe=ie||function(Ze,He,tt){var qt=Ze<12?"AM":"PM";return tt?qt.toLowerCase():qt};return K.replace(H,function(Ze,He){return He||function(tt){switch(tt){case"YY":return String(U.$y).slice(-2);case"YYYY":return ae.s(U.$y,4,"0");case"M":return Y+1;case"MM":return ae.s(Y+1,2,"0");case"MMM":return De(A.monthsShort,Y,ue,3);case"MMMM":return De(ue,Y);case"D":return U.$D;case"DD":return ae.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return De(A.weekdaysMin,U.$W,P,2);case"ddd":return De(A.weekdaysShort,U.$W,P,3);case"dddd":return P[U.$W];case"H":return String(z);case"HH":return ae.s(z,2,"0");case"h":return Se(1);case"hh":return Se(2);case"a":return qe(z,O,!0);case"A":return qe(z,O,!1);case"m":return String(O);case"mm":return ae.s(O,2,"0");case"s":return String(U.$s);case"ss":return ae.s(U.$s,2,"0");case"SSS":return ae.s(U.$ms,3,"0");case"Z":return y}return null}(Ze)||y.replace(":","")})},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(w,U,A){var K,y=this,z=ae.p(U),O=I(w),Y=(O.utcOffset()-this.utcOffset())*r,P=this-O,ue=function(){return ae.m(y,O)};switch(z){case B:K=ue()/12;break;case j:K=ue();break;case C:K=ue()/3;break;case S:K=(P-Y)/6048e5;break;case h:K=(P-Y)/864e5;break;case v:K=P/d;break;case E:K=P/r;break;case x:K=P/c;break;default:K=P}return A?K:ae.a(K)},V.daysInMonth=function(){return this.endOf(j).$D},V.$locale=function(){return ee[this.$L]},V.locale=function(w,U){if(!w)return this.$L;var A=this.clone(),K=ne(w,U,!0);return K&&(A.$L=K),A},V.clone=function(){return ae.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},W}(),Ue=de.prototype;return I.prototype=Ue,[["$ms",g],["$s",x],["$m",E],["$H",v],["$W",h],["$M",j],["$y",B],["$D",T]].forEach(function(W){Ue[W[1]]=function(V){return this.$g(V,W[0],W[1])}}),I.extend=function(W,V){return W.$i||(W(V,de,I),W.$i=!0),I},I.locale=ne,I.isDayjs=le,I.unix=function(W){return I(1e3*W)},I.en=ee[Q],I.Ls=ee,I.p={},I})}(Ru)),Ru.exports}var Yx=qx();const us=pc(Yx);var Ou={exports:{}},$x=Ou.exports,z0;function Gx(){return z0||(z0=1,function(s,i){(function(c,r){s.exports=r()})($x,function(){return function(c,r,d){c=c||{};var g=r.prototype,x={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function E(h,S,j,C){return g.fromToBase(h,S,j,C)}d.en.relativeTime=x,g.fromToBase=function(h,S,j,C,B){for(var T,G,X,H=j.$locale().relativeTime||x,J=c.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],F=J.length,Z=0;Z<F;Z+=1){var Q=J[Z];Q.d&&(T=C?d(h).diff(j,Q.d,!0):j.diff(h,Q.d,!0));var ee=(c.rounding||Math.round)(Math.abs(T));if(X=T>0,ee<=Q.r||!Q.r){ee<=1&&Z>0&&(Q=J[Z-1]);var se=H[Q.l];B&&(ee=B(""+ee)),G=typeof se=="string"?se.replace("%d",ee):se(ee,S,Q.l,X);break}}if(S)return G;var le=X?H.future:H.past;return typeof le=="function"?le(G):le.replace("%s",G)},g.to=function(h,S){return E(h,S,this,!0)},g.from=function(h,S){return E(h,S,this)};var v=function(h){return h.$u?d.utc():d()};g.toNow=function(h){return this.to(v(this),h)},g.fromNow=function(h){return this.from(v(this),h)}}})}(Ou)),Ou.exports}var Xx=Gx();const Vx=pc(Xx);us.extend(Vx);function Zx(s){const i=us(s),c=us();return i.isSame(c,"day")?i.format("HH:mm"):i.isSame(c,"year")?i.format("MMM D, HH:mm"):i.format("MMM D, YYYY HH:mm")}function Qx(s){const i=us(s),c=us();return i.isAfter(c)||c.diff(i,"minute")<1?"just now":i.fromNow()}function jc({timestamp:s,className:i="",mode:c="absolute"}){const[r,d]=p.useState("");return p.useEffect(()=>{const g=()=>{d(c==="absolute"?Zx(s):Qx(s))};if(g(),c==="relative"){const x=setInterval(g,6e4);return()=>clearInterval(x)}},[s,c]),f.jsx("span",{className:i,"aria-label":`Sent at ${r}`,children:r})}function fs({alignment:s,colorScheme:i,children:c}){const r=s==="right"?"justify-end":s==="center"?"justify-center":"justify-start";return f.jsx("div",{className:`mb-4 flex ${r}`,children:f.jsx("div",{className:`max-w-[85%] sm:max-w-[70%] rounded-lg px-4 py-3 ${i}`,children:c})})}function Kx(s){return typeof s=="object"&&s!==null&&"lines"in s&&Array.isArray(s.lines)}function fh(s){return Array.isArray(s)&&s.every(Kx)}function Jx(s){return typeof s=="object"&&s!==null&&"structuredPatch"in s&&fh(s.structuredPatch)}function Fx(s){return typeof s=="object"&&s!==null&&"stdout"in s&&typeof s.stdout=="string"&&"stderr"in s&&typeof s.stderr=="string"}function Nc(s,i=5){if(!s||s.trim().length===0)return{preview:"",hasMore:!1,totalLines:0,previewLines:0};const c=s.split(`
`),r=c.length;return r<=i?{preview:s,hasMore:!1,totalLines:r,previewLines:r}:{preview:c.slice(0,i).join(`
`),hasMore:!0,totalLines:r,previewLines:i}}function Wx(s,i,c=20){if(!fh(s))return{details:i,summary:"",defaultExpanded:!0};let r=0,d=0;const g=[];for(const S of s)for(const j of S.lines)g.push(j),j.startsWith("+")?r++:j.startsWith("-")&&d++;const x=g.join(`
`),v=g.length<=c;let h="";return r>0&&d>0?h=`+${r}/-${d} lines`:r>0?h=`+${r} lines`:d>0&&(h=`-${d} lines`),{details:x,summary:h,defaultExpanded:v,previewContent:v?void 0:g.slice(0,c).join(`
`)}}function Px(s,i,c,r=5){return Nc(c?i:s,r)}function Ix(s,i){const c=s-i;return`[+${c} more line${c===1?"":"s"}]`}function Tc({label:s,details:i,colorScheme:c,icon:r,badge:d,defaultExpanded:g=!1,maxPreviewLines:x=5,showPreview:E=!0,previewContent:v,previewSummary:h}){const[S,j]=p.useState(g),C=i.trim().length>0,B=C&&!g,T=jg.useMemo(()=>{const X=i.split(`
`).length;return v!==void 0?{preview:v,hasMore:!0,totalLines:X,previewLines:v.split(`
`).length}:E?Nc(i,x):{preview:"",hasMore:!1,totalLines:X,previewLines:0}},[i,x,v,E]),G=E&&!S&&C&&T.hasMore;return f.jsxs("div",{className:`mb-3 p-3 rounded-lg ${c.bg} border ${c.border}`,children:[f.jsxs("div",{className:`${c.header} text-xs font-medium mb-1 flex items-center gap-2 ${B?"cursor-pointer hover:opacity-80":""}`,role:B?"button":void 0,tabIndex:B?0:void 0,"aria-expanded":B?S:void 0,onClick:B?()=>j(!S):void 0,onKeyDown:B?X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),j(!S))}:void 0,children:[r&&f.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-xs",children:r}),f.jsx("span",{children:s}),d&&f.jsxs("span",{className:"opacity-80",children:["(",d,")"]}),h&&f.jsx("span",{className:"opacity-60 text-xs ml-2",children:h}),B&&f.jsx("span",{className:"ml-1 opacity-80",children:S?"▼":"▶"})]}),G&&f.jsxs("div",{className:"mt-2 pl-6 border-l-2 border-dashed opacity-80",style:{borderColor:"inherit"},children:[f.jsx("pre",{className:`whitespace-pre-wrap ${c.content} text-xs font-mono leading-relaxed`,children:T.preview}),f.jsx("div",{className:`${c.content} text-xs opacity-60 mt-1 italic`,children:Ix(T.totalLines,T.previewLines)})]}),C&&S&&f.jsx("pre",{className:`whitespace-pre-wrap ${c.content} text-xs font-mono leading-relaxed mt-2 pl-6 border-l-2 ${c.border}`,children:i})]})}const ey=new RegExp("\x1B\\[[0-9;]*m","g");function ty(s){return s.type==="system"&&"content"in s&&typeof s.content=="string"&&!("subtype"in s)}function ly({message:s}){const i=s.role==="user",c=i?"bg-blue-600 text-white":"bg-slate-200 dark:bg-slate-700 text-slate-800 dark:text-slate-100";return f.jsxs(fs,{alignment:i?"right":"left",colorScheme:c,children:[f.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[f.jsx("div",{className:`text-xs font-semibold opacity-90 ${i?"text-blue-100":"text-slate-600 dark:text-slate-400"}`,children:i?"User":"OpenCode"}),f.jsx(jc,{timestamp:s.timestamp,className:`text-xs opacity-70 ${i?"text-blue-200":"text-slate-500 dark:text-slate-500"}`})]}),f.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono leading-relaxed",children:s.content})]})}function ay({message:s}){const i=()=>s.type==="system"&&"subtype"in s&&s.subtype==="init"?[`Model: ${s.model}`,`Session: ${s.session_id.substring(0,uh.SESSION_ID_DISPLAY_LENGTH)}`,`Tools: ${s.tools.length} available`,`CWD: ${s.cwd}`,`Permission Mode: ${s.permissionMode}`,`API Key Source: ${s.apiKeySource}`].join(`
`):s.type==="result"?[`Duration: ${s.duration_ms}ms`,`Cost: $${s.total_cost_usd.toFixed(4)}`,`Tokens: ${s.usage.input_tokens} in, ${s.usage.output_tokens} out`].join(`
`):s.type==="error"?s.message:ty(s)?s.content.replace(ey,""):JSON.stringify(s,null,2),c=()=>s.type==="system"?"System":s.type==="result"?"Result":s.type==="error"?"Error":"Message",r=i();return f.jsx(Tc,{label:c(),details:r,badge:"subtype"in s?s.subtype:void 0,icon:f.jsx("span",{className:"bg-blue-400 dark:bg-blue-500",children:"⚙"}),colorScheme:{header:"text-blue-800 dark:text-blue-300",content:"text-blue-700 dark:text-blue-300",border:"border-blue-200 dark:border-blue-700",bg:"bg-blue-50/80 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800"}})}function ny({message:s}){return f.jsx(fs,{alignment:"left",colorScheme:"bg-emerald-100 dark:bg-emerald-900 text-emerald-800 dark:text-emerald-100",children:f.jsxs("div",{className:"text-xs font-semibold mb-2 opacity-90 text-emerald-700 dark:text-emerald-300 flex items-center gap-2",children:[f.jsx("div",{className:"w-4 h-4 bg-emerald-500 dark:bg-emerald-600 rounded-full flex items-center justify-center text-white text-xs",children:"🔧"}),s.content]})})}function sy({message:s}){const i=s.toolUseResult;let c,r,d=5,g=s.content,x=!1;if(s.toolName==="Edit"&&Jx(i)){const v=Wx(i.structuredPatch,s.content,20);g=v.details,r=v.summary,c=v.previewContent,x=v.defaultExpanded,d=20}else if(s.toolName==="Bash"&&Fx(i)){const v=!!i.stderr?.trim(),h=Px(i.stdout||"",i.stderr||"",v,5);h.hasMore&&(c=h.preview)}else if(s.toolName==="Grep"&&s.content.trim().length>0){const v=Nc(s.content,5);v.hasMore&&(c=v.preview)}const E=s.toolName==="Bash"||s.toolName==="Edit"||s.toolName==="Grep";return f.jsx(Tc,{label:s.toolName,details:g,badge:s.toolName==="Edit"?void 0:s.summary,icon:f.jsx("span",{className:"bg-emerald-400 dark:bg-emerald-500",children:"✓"}),colorScheme:{header:"text-emerald-800 dark:text-emerald-300",content:"text-emerald-700 dark:text-emerald-300",border:"border-emerald-200 dark:border-emerald-700",bg:"bg-emerald-50/80 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800"},previewContent:c,previewSummary:r,maxPreviewLines:d,showPreview:E,defaultExpanded:x})}function uy({message:s}){return f.jsxs(fs,{alignment:"left",colorScheme:"bg-blue-50 dark:bg-blue-900/20 text-blue-900 dark:text-blue-100",children:[f.jsxs("div",{className:"mb-3 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"text-xs font-semibold opacity-90 text-blue-700 dark:text-blue-300 flex items-center gap-2",children:[f.jsx("div",{className:"w-4 h-4 bg-blue-500 dark:bg-blue-600 rounded-full flex items-center justify-center text-white text-xs",children:"📋"}),"Ready to code?"]}),f.jsx(jc,{timestamp:s.timestamp,className:"text-xs opacity-70 text-blue-600 dark:text-blue-400"})]}),f.jsxs("div",{className:"mb-3",children:[f.jsx("p",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-2",children:"Here is OpenCode's plan:"}),f.jsx("div",{className:"bg-blue-100/50 dark:bg-blue-800/30 border border-blue-200 dark:border-blue-700 rounded-lg p-3",children:f.jsx("pre",{className:"text-sm text-blue-900 dark:text-blue-100 whitespace-pre-wrap font-mono leading-relaxed",children:s.plan})})]})]})}function iy({message:s}){return f.jsx(Tc,{label:"OpenCode's Reasoning",details:s.content,badge:"thinking",icon:f.jsx("span",{className:"bg-purple-400 dark:bg-purple-500",children:"💭"}),colorScheme:{header:"text-purple-700 dark:text-purple-300",content:"text-purple-600 dark:text-purple-400 italic",border:"border-purple-200 dark:border-purple-700",bg:"bg-purple-50/60 dark:bg-purple-900/15 border border-purple-200 dark:border-purple-800"},defaultExpanded:!0})}function ry({message:s}){const i=r=>{switch(r){case"completed":return{icon:"✅",label:"Completed"};case"in_progress":return{icon:"🔄",label:"In progress"};case"pending":default:return{icon:"⏳",label:"Pending"}}},c=r=>{switch(r){case"completed":return"text-green-700 dark:text-green-400";case"in_progress":return"text-blue-700 dark:text-blue-400";case"pending":default:return"text-gray-600 dark:text-gray-400"}};return f.jsxs(fs,{alignment:"left",colorScheme:"bg-amber-50 dark:bg-amber-900/20 text-amber-900 dark:text-amber-100",children:[f.jsxs("div",{className:"mb-3 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"text-xs font-semibold opacity-90 text-amber-700 dark:text-amber-300 flex items-center gap-2",children:[f.jsx("div",{className:"w-4 h-4 bg-amber-500 dark:bg-amber-600 rounded-full flex items-center justify-center text-white text-xs","aria-hidden":"true",children:"📋"}),"Todo List Updated"]}),f.jsx(jc,{timestamp:s.timestamp,className:"text-xs opacity-70 text-amber-600 dark:text-amber-400"})]}),f.jsx("div",{className:"space-y-1",children:s.todos.map((r,d)=>{const g=i(r.status);return f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:"text-sm flex-shrink-0 mt-0.5","aria-label":g.label,children:g.icon}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`text-sm ${c(r.status)}`,children:r.content}),r.status==="in_progress"&&f.jsx("div",{className:"text-xs text-amber-600 dark:text-amber-500 italic",children:r.activeForm})]})]},d)})}),f.jsxs("div",{className:"mt-3 text-xs text-amber-700 dark:text-amber-400",children:[s.todos.filter(r=>r.status==="completed").length," of"," ",s.todos.length," completed"]})]})}function cy(){return f.jsxs(fs,{alignment:"left",colorScheme:"bg-slate-200 dark:bg-slate-700 text-slate-800 dark:text-slate-100",children:[f.jsx("div",{className:"text-xs font-semibold mb-2 opacity-90 text-slate-600 dark:text-slate-400",children:"OpenCode"}),f.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[f.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),f.jsx("span",{className:"animate-pulse",children:"Thinking..."})]})]})}function oy({messages:s,isLoading:i}){const c=p.useRef(null),r=p.useRef(null),d=()=>{c.current&&c.current.scrollIntoView&&c.current.scrollIntoView({behavior:"smooth"})};p.useEffect(()=>{d()},[s]);const g=(x,E)=>{const v=`${x.timestamp}-${E}`;return Dx(x)?f.jsx(ay,{message:x},v):_x(x)?f.jsx(ny,{message:x},v):zx(x)?f.jsx(sy,{message:x},v):Ux(x)?f.jsx(uy,{message:x},v):Hx(x)?f.jsx(iy,{message:x},v):Lx(x)?f.jsx(ry,{message:x},v):Ox(x)?f.jsx(ly,{message:x},v):null};return f.jsx("div",{ref:r,className:"flex-1 overflow-y-auto bg-white/70 dark:bg-slate-800/70 border border-slate-200/60 dark:border-slate-700/60 p-3 sm:p-6 mb-3 sm:mb-6 rounded-2xl shadow-sm backdrop-blur-sm flex flex-col",children:s.length===0?f.jsx(fy,{}):f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"flex-1","aria-hidden":"true"}),s.map(g),i&&f.jsx(cy,{}),f.jsx("div",{ref:c})]})})}function fy(){return f.jsx("div",{className:"flex-1 flex items-center justify-center text-center text-slate-500 dark:text-slate-400",children:f.jsxs("div",{children:[f.jsx("div",{className:"text-6xl mb-6 opacity-60",children:f.jsx("span",{role:"img","aria-label":"chat icon",children:"💬"})}),f.jsx("p",{className:"text-lg font-medium",children:"Start a conversation with OpenCode"}),f.jsx("p",{className:"text-sm mt-2 opacity-80",children:"Type your message below to begin"})]})})}function dy({encodedName:s,workingDirectory:i}){const c=cs(),[r,d]=p.useState([]),[g,x]=p.useState(null),[E,v]=p.useState(!0),[h,S]=p.useState(null);p.useEffect(()=>{(async()=>{if(!(!s||!i))try{v(!0);const B=await fetch(Av(s,i));if(!B.ok)throw new Error(`Failed to load conversations: ${B.statusText}`);const T=await B.json();if(d(T.conversations||[]),T.debug){const G=T.debug.newest?new Date(T.debug.newest).toLocaleString():"n/a",X=T.debug.oldest?new Date(T.debug.oldest).toLocaleString():"n/a",H=Array.isArray(T.debug.sampleDirs)?T.debug.sampleDirs.filter(Boolean).slice(0,3).join(" | "):"",J=T.debug.rawHead?`raw=${T.debug.rawHead}`:"",F=T.debug.stderrHead?`stderr=${T.debug.stderrHead}`:"",Z=typeof T.debug.code=="number"?`code=${T.debug.code}`:"",Q=T.debug.parseError?`parse=${T.debug.parseError}`:"",ee=typeof T.debug.dataLen=="number"?`data=${T.debug.dataLen}`:"",se=T.debug.dataType?`type=${T.debug.dataType}`:"",le=T.debug.firstKeys?`keys=${T.debug.firstKeys}`:"";x(`sessions=${T.debug.count}, newest=${G}, oldest=${X}, cwd=${T.debug.cwd||""}${H?`, sample=${H}`:""}${Z?`, ${Z}`:""}${Q?`, ${Q}`:""}${ee?`, ${ee}`:""}${se?`, ${se}`:""}${le?`, ${le}`:""}${J?`, ${J}`:""}${F?`, ${F}`:""}`)}else x(null)}catch(B){S(B instanceof Error?B.message:"Failed to load conversations")}finally{v(!1)}})()},[s,i]);const j=C=>{const B=new URLSearchParams;B.set("sessionId",C),c({search:B.toString()})};return E||!s||!i?f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-8 h-8 border-2 border-slate-300 border-t-slate-600 rounded-full animate-spin mx-auto mb-4"}),f.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:!s||!i?"Loading project...":"Loading conversations..."})]})}):h?f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center max-w-md",children:[f.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-red-100 dark:bg-red-900/20 rounded-full flex items-center justify-center",children:f.jsx("svg",{className:"w-8 h-8 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),f.jsx("h2",{className:"text-slate-800 dark:text-slate-100 text-xl font-semibold mb-2",children:"Error Loading History"}),f.jsx("p",{className:"text-slate-600 dark:text-slate-400 text-sm mb-4",children:h}),g&&f.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500",children:g})]})}):r.length===0?f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-slate-200 dark:bg-slate-700 rounded-full flex items-center justify-center",children:f.jsx("svg",{className:"w-8 h-8 text-slate-400 dark:text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),f.jsx("h2",{className:"text-slate-800 dark:text-slate-100 text-xl font-semibold mb-2",children:"No Conversations Yet"}),f.jsx("p",{className:"text-slate-600 dark:text-slate-400 text-sm max-w-sm",children:"Start chatting to see your conversation history here."}),g&&f.jsx("p",{className:"mt-3 text-xs text-slate-500 dark:text-slate-400",children:g})]})}):f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsxs("div",{className:"p-6 h-full flex flex-col",children:[g&&f.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 mb-3",children:g}),f.jsx("div",{className:"grid gap-4 flex-1 overflow-y-auto",children:r.map(C=>f.jsx("div",{onClick:()=>j(C.sessionId),className:"p-4 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-slate-300 dark:hover:border-slate-600 transition-colors cursor-pointer shadow-sm hover:shadow-md",children:f.jsxs("div",{className:"flex items-start justify-between",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("h3",{className:"text-sm font-medium text-slate-900 dark:text-slate-100 truncate",children:["Session: ",C.sessionId.substring(0,8),"..."]}),f.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:[new Date(C.startTime).toLocaleString()," •"," ",C.messageCount," messages"]}),f.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 mt-2 line-clamp-2",children:C.lastMessagePreview})]}),f.jsx("div",{className:"ml-4 flex-shrink-0",children:f.jsx("svg",{className:"w-5 h-5 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})},C.sessionId))})]})})}function hy({fileInfo:s,content:i,base64:c,isLoading:r,error:d}){return console.log("[FileCanvas] Render called with:",{fileInfo:s?{path:s.path,mimeType:s.mimeType}:null,contentLength:i?.length,contentPreview:i?.substring(0,50),base64Length:c?.length,error:d,isLoading:r}),s?r?f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-8 h-8 border-2 border-slate-300 border-t-slate-600 rounded-full animate-spin mx-auto mb-3"}),f.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"Loading file..."})]})}):d?f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center max-w-sm",children:[f.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-red-100 dark:bg-red-900/20 rounded-full flex items-center justify-center",children:f.jsx("svg",{className:"w-8 h-8 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 118 0z"})})}),f.jsx("p",{className:"text-sm text-red-600 dark:text-red-400 mb-2",children:"Error"}),f.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400",children:d})]})}):!i&&!c?(console.warn("[FileCanvas] Both content and base64 are null, cannot display file"),f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("svg",{className:"w-16 h-16 mx-auto mb-3 opacity-30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),f.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"No content available"})]})})):f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsx("div",{className:"flex-shrink-0 border-b border-slate-200 dark:border-slate-700 p-3 bg-slate-50/50 dark:bg-slate-800/50",children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx(gy,{extension:s.extension}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:"text-sm font-medium text-slate-800 dark:text-slate-200 truncate",children:s.name}),f.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[f.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:ih(s.size)}),f.jsx("span",{className:"text-xs text-slate-400 dark:text-slate-600",children:"•"}),f.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:s.extension})]})]})]})}),f.jsx("div",{className:"flex-1 overflow-auto bg-white dark:bg-slate-900",children:my(s,i,c)})]}):f.jsx("div",{className:"h-full flex items-center justify-center text-slate-400 dark:text-slate-600",children:f.jsxs("div",{className:"text-center",children:[f.jsx("svg",{className:"w-16 h-16 mx-auto mb-4 opacity-30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),f.jsx("p",{className:"text-sm",children:"No file selected"}),f.jsx("p",{className:"text-xs mt-1 opacity-60",children:"Select a file from the list to preview"})]})})}function my(s,i,c){const r=s?.mimeType||"",d=i??"",g=c??"",x=!!d,E=!!g;return console.log("[FileCanvas] renderFileContent called:",{mimeType:r,hasContent:x,hasBase64:E}),Qv(r)&&E?f.jsx("div",{className:"h-full flex items-center justify-center p-4",children:f.jsx("img",{src:`data:${r};base64,${g}`,alt:s?.name||"",className:"max-w-full max-h-full object-contain"})}):Kv(r)&&x?f.jsx("iframe",{title:s?.name||"",srcDoc:d,className:"w-full h-full border-0",sandbox:"allow-same-origin allow-scripts allow-forms"}):Jv(r)&&x?f.jsx("div",{className:"p-4",children:f.jsx("pre",{className:"text-sm text-slate-800 dark:text-slate-200 whitespace-pre-wrap font-mono leading-relaxed",children:d})}):Fv(r)&&x?f.jsxs("div",{className:"p-4",children:[f.jsx("div",{className:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:f.jsx("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:"Excel/CSV preview - displaying as text"})}),f.jsx("pre",{className:"text-xs text-slate-800 dark:text-slate-200 whitespace-pre-wrap font-mono leading-relaxed overflow-auto",children:d})]}):Wv(r)&&x?f.jsx("div",{className:"p-4",children:f.jsx("pre",{className:"text-sm text-slate-800 dark:text-slate-200 whitespace-pre-wrap font-mono leading-relaxed overflow-auto",children:d})}):E?f.jsx("div",{className:"h-full flex items-center justify-center p-4",children:f.jsxs("div",{className:"text-center",children:[f.jsx("svg",{className:"w-12 h-12 mx-auto mb-3 opacity-30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01.2 2z"})}),f.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"Binary file preview not available"})]})}):null}function gy({extension:s}){const i=s.toLowerCase();let c="📄",r="bg-slate-100 dark:bg-slate-800";return[".html",".htm"].includes(i)?(c="🌐",r="bg-orange-100 dark:bg-orange-900/30"):[".css"].includes(i)?(c="🎨",r="bg-pink-100 dark:bg-pink-900/30"):[".js",".ts",".tsx",".jsx"].includes(i)?(c="📜",r="bg-yellow-100 dark:bg-yellow-900/30"):[".json"].includes(i)?(c="📋",r="bg-amber-100 dark:bg-amber-900/30"):[".md"].includes(i)?(c="📝",r="bg-purple-100 dark:bg-purple-900/30"):[".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"].includes(i)?(c="🖼️",r="bg-green-100 dark:bg-green-900/30"):[".xlsx",".xls",".csv"].includes(i)&&(c="📊",r="bg-emerald-100 dark:bg-emerald-900/30"),f.jsx("div",{className:`w-10 h-10 flex-shrink-0 ${r} rounded-lg flex items-center justify-center text-lg`,children:c})}function py({files:s,selectedFile:i,onFileSelect:c,onClearFiles:r}){return s.length===0?f.jsx("div",{className:"h-full flex items-center justify-center p-4",children:f.jsxs("div",{className:"text-center text-slate-400 dark:text-slate-600",children:[f.jsx("svg",{className:"w-12 h-12 mx-auto mb-3 opacity-30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),f.jsx("p",{className:"text-sm",children:"No files generated yet"}),f.jsx("p",{className:"text-xs mt-1 opacity-60",children:"Files created by OpenCode will appear here"})]})}):f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsx("div",{className:"flex-shrink-0 border-b border-slate-200 dark:border-slate-700 p-3 bg-slate-50/50 dark:bg-slate-800/50",children:f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("svg",{className:"w-4 h-4 text-slate-600 dark:text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),f.jsxs("span",{className:"text-sm font-medium text-slate-800 dark:text-slate-200",children:["Generated Files (",s.length,")"]})]}),f.jsx("button",{onClick:r,className:"p-1.5 rounded-lg text-slate-500 hover:text-slate-700 hover:bg-slate-200 dark:text-slate-500 dark:hover:text-slate-300 dark:hover:bg-slate-700 transition-colors",title:"Clear all files",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})}),f.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:s.map(d=>f.jsx(vy,{file:d,isSelected:i?.path===d.path,onClick:()=>c(d)},d.path))})]})}function vy({file:s,isSelected:i,onClick:c}){return f.jsx("button",{onClick:c,className:`w-full text-left p-2.5 rounded-lg border transition-all duration-200 ${i?"bg-blue-50 dark:bg-blue-900/30 border-blue-200 dark:border-blue-800 shadow-sm":"bg-white dark:bg-slate-800 border-slate-200 dark:border-slate-700 hover:border-slate-300 dark:hover:border-slate-600 hover:shadow-sm"}`,children:f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx(xy,{extension:s.extension,isSelected:i}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:`text-sm font-medium truncate ${i?"text-blue-800 dark:text-blue-200":"text-slate-800 dark:text-slate-200"}`,children:s.name}),f.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[f.jsx(yy,{extension:s.extension}),f.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:ih(s.size)})]})]})]})})}function xy({extension:s,isSelected:i=!1}){const c=s.toLowerCase();let r="📄",d="bg-slate-100 dark:bg-slate-700";return[".html",".htm"].includes(c)?(r="🌐",d=i?"bg-blue-100 dark:bg-blue-800":"bg-orange-100 dark:bg-orange-900/30"):[".css"].includes(c)?(r="🎨",d=i?"bg-blue-100 dark:bg-blue-800":"bg-pink-100 dark:bg-pink-900/30"):[".js",".ts",".tsx",".jsx"].includes(c)?(r="📜",d=i?"bg-blue-100 dark:bg-blue-800":"bg-yellow-100 dark:bg-yellow-900/30"):[".json"].includes(c)?(r="📋",d=i?"bg-blue-100 dark:bg-blue-800":"bg-amber-100 dark:bg-amber-900/30"):[".md"].includes(c)?(r="📝",d=i?"bg-blue-100 dark:bg-blue-800":"bg-purple-100 dark:bg-purple-900/30"):[".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"].includes(c)?(r="🖼️",d=i?"bg-blue-100 dark:bg-blue-800":"bg-green-100 dark:bg-green-900/30"):[".xlsx",".xls",".csv"].includes(c)?(r="📊",d=i?"bg-blue-100 dark:bg-blue-800":"bg-emerald-100 dark:bg-emerald-900/30"):[".pdf"].includes(c)&&(r="📕",d=i?"bg-blue-100 dark:bg-blue-800":"bg-red-100 dark:bg-red-900/30"),f.jsx("div",{className:`w-9 h-9 flex-shrink-0 rounded-lg flex items-center justify-center text-base ${d}`,children:r})}function yy({extension:s}){const i=s.toLowerCase().replace(".","");return f.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300",children:i})}function by(){const s=bl(),i=cs(),[c]=Ip(),[r,d]=p.useState([]),[g,x]=p.useState(!1),[E,v]=p.useState(!1),h=p.useRef(0),{settings:S}=Uu(),j=(()=>{const pe=s.pathname.replace("/projects","");if(!pe)return;const we=decodeURIComponent(pe);return Au(we)})(),C=j?vx(j):void 0,B=c.get("view"),T=c.get("sessionId"),G=B==="history",X=!!T&&!G,{processStreamLine:H}=ux(),{abortRequest:J,createAbortHandler:F}=dx(),Z=yx(j),{permissionMode:Q,setPermissionMode:ee}=fx(),se=p.useCallback(()=>{if(!j||!r.length)return null;const pe=r.find(je=>je.path===j),we=Au(j),it=r.find(je=>Au(je.path)===we);return(pe||it)?.encodedName||null},[j,r]),{messages:le,loading:ne,error:I,sessionId:ae}=px(se()||void 0,T||void 0,C),{messages:de,input:Ue,isLoading:W,currentSessionId:V,currentRequestId:w,hasShownInitMessage:U,currentAssistantMessage:A,setInput:K,setMessages:y,setCurrentSessionId:z,setHasShownInitMessage:O,setHasReceivedInit:Y,setCurrentAssistantMessage:P,addMessage:ue,updateLastMessage:ie,clearInput:De,generateRequestId:Se,resetRequestState:qe,startRequest:Ze}=cx({initialMessages:le,initialSessionId:ae||void 0});p.useEffect(()=>{if(!G&&!ne&&de.length>0){const pe=de.slice(-10),we=_e=>{const ye=ns(_e,j)||_e;if(dc(ye)){const{directory:Fe,fileName:Ge}=hc(ye);return{path:Ge,workingDirectory:Fe||j,normalizedPath:ye}}return{path:ye,workingDirectory:j,normalizedPath:ye}},it=async _e=>{if(!j)return;const ye=we(_e);if(!ye.workingDirectory||Z.files.some(Le=>Le.path===ye.normalizedPath))return;const Ge=new URLSearchParams({path:ye.path,workingDirectory:ye.workingDirectory});try{const Le=await fetch(`/api/file/info?${Ge}`);if(!Le.ok)return;const Ne=await Le.json();Ne?.path&&Z.addFile(_e,Ne.size||0)}catch(Le){console.debug("Failed to check file info:",Le)}},Qe=[],je=async()=>{if(!j||!pe.some(Ge=>Ge.type==="tool"||Ge.type==="tool_result"))return;const _e=pe.reduce((Ge,Le)=>Math.max(Ge,Le.timestamp||0),0),ye=Math.max(_e-2e3,h.current);h.current=Date.now();const Fe=new URLSearchParams({workingDirectory:j,since:String(ye)});try{const Ge=await fetch(`/api/files/recent?${Fe}`);if(!Ge.ok)return;const Le=await Ge.json();if(!Le?.files||!Array.isArray(Le.files))return;for(const Ne of Le.files){if(!Ne?.path)continue;const lt=ns(Ne.path,j)||Ne.path;Z.files.some(Ql=>Ql.path===lt)||Z.addFile(Ne.path,Ne.size||0)}}catch(Ge){console.debug("Failed to scan recent files:",Ge)}};for(const _e of pe){if(_e.type==="tool"){const ye=_e;if(ye.filePaths&&ye.filePaths.length>0)for(const Fe of ye.filePaths)Qe.push(it(Fe))}if(_e.type==="tool_result"){const ye=_e,Fe=O0(ye.toolName,ye.content);for(const Ge of Fe)Qe.push(it(Ge))}}Qe.length>0&&Promise.allSettled(Qe),je()}},[de,G,ne,Z,j]),p.useEffect(()=>{if(!X||ne||!j||de.length===0)return;const pe=Qe=>{const je=ns(Qe,j)||Qe;if(dc(je)){const{directory:_e,fileName:ye}=hc(je);return{path:ye,workingDirectory:_e||j,normalizedPath:je}}return{path:je,workingDirectory:j,normalizedPath:je}},we=async Qe=>{const je=pe(Qe);if(!je.workingDirectory||Z.files.some(Fe=>Fe.path===je.normalizedPath))return;const ye=new URLSearchParams({path:je.path,workingDirectory:je.workingDirectory});try{const Fe=await fetch(`/api/file/info?${ye}`);if(!Fe.ok)return;const Ge=await Fe.json();Ge?.path&&Z.addFile(Qe,Ge.size||0)}catch(Fe){console.debug("Failed to check file info:",Fe)}},it=[];for(const Qe of de){if(Qe.type==="tool"){const je=Qe;if(je.filePaths&&je.filePaths.length>0)for(const _e of je.filePaths)it.push(we(_e))}if(Qe.type==="tool_result"){const je=Qe,_e=O0(je.toolName,je.content);for(const ye of _e)it.push(we(ye))}}it.length>0&&Promise.allSettled(it)},[de,X,ne,Z,j]);const{allowedTools:He,permissionRequest:tt,showPermissionRequest:qt,closePermissionRequest:Tt,allowToolTemporary:ds,allowToolPermanent:hs,isPermissionMode:Ct,planModeRequest:Hu,showPlanModeRequest:ln,closePlanModeRequest:Yt,updatePermissionMode:$t}=ox({onPermissionModeChange:ee}),ms=p.useCallback((pe,we,it)=>{we.includes("ExitPlanMode")?ln(""):qt(pe,we,it)},[qt,ln]),kt=p.useCallback(async(pe,we,it=!1,Qe)=>{const je=pe||Ue.trim();if(!je||W)return;const _e=Se();if(!it){const ye={type:"chat",role:"user",content:je,timestamp:Date.now()};ue(ye)}pe||De(),Ze();try{const ye=await fetch(wv(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:je,requestId:_e,...V?{sessionId:V}:{},allowedTools:we||He,...j?{workingDirectory:j}:{},permissionMode:Qe||Q,...S.model?{model:S.model}:{}})});if(!ye.body)throw new Error("No response body");const Fe=ye.body.getReader(),Ge=new TextDecoder;let Le=!1,Ne=!1;const lt={currentAssistantMessage:A,setCurrentAssistantMessage:P,addMessage:ue,updateLastMessage:ie,onSessionId:z,shouldShowInitMessage:()=>!U,onInitMessageShown:()=>O(!0),get hasReceivedInit(){return Le},setHasReceivedInit:At=>{Le=At,Y(At)},onPermissionError:ms,onAbortRequest:async()=>{Ne=!0,await F(_e)()}};for(;;){const{done:At,value:Ql}=await Fe.read();if(At||Ne)break;const Gu=Ge.decode(Ql).split(`
`).filter(ma=>ma.trim());for(const ma of Gu){if(Ne)break;H(ma,lt)}if(Ne)break}}catch(ye){console.error("Failed to send message:",ye),ue({type:"chat",role:"assistant",content:"Error: Failed to get response",timestamp:Date.now()})}finally{qe()}},[Ue,W,V,He,U,A,j,Q,S.model,Se,De,Ze,ue,ie,z,O,Y,P,qe,H,ms,F]),Gl=p.useCallback(()=>{J(w,W,qe)},[J,w,W,qe]),Lu=p.useCallback(()=>{if(!tt)return;let pe=He;tt.patterns.forEach(we=>{pe=ds(we,pe)}),Tt(),V&&kt("continue",pe,!0)},[tt,V,kt,He,ds,Tt]),Xl=p.useCallback(()=>{if(!tt)return;let pe=He;tt.patterns.forEach(we=>{pe=hs(we,pe)}),Tt(),V&&kt("continue",pe,!0)},[tt,V,kt,He,hs,Tt]),ht=p.useCallback(()=>{Tt()},[Tt]),Kt=p.useCallback(()=>{$t("acceptEdits"),Yt(),V&&kt("accept",He,!0,"acceptEdits")},[$t,Yt,V,kt,He]),mt=p.useCallback(()=>{$t("default"),Yt(),V&&kt("accept",He,!0,"default")},[$t,Yt,V,kt,He]),Bu=p.useCallback(()=>{$t("plan"),Yt()},[$t,Yt]),qu=tt?{patterns:tt.patterns,onAllow:Lu,onAllowPermanent:Xl,onDeny:ht}:void 0,Yu=Hu?{onAcceptWithEdits:Kt,onAcceptDefault:mt,onKeepPlanning:Bu}:void 0,da=p.useCallback(()=>{const pe=new URLSearchParams;pe.set("view","history"),i({search:pe.toString()})},[i]),ha=p.useCallback(()=>{x(!0)},[]),tl=p.useCallback(()=>{x(!1)},[]);p.useEffect(()=>{(async()=>{try{const we=await fetch(lh());if(we.ok){const it=await we.json();d(it.projects||[])}}catch(we){console.error("Failed to load projects:",we)}})()},[]);const Vl=p.useCallback(()=>{i({search:""})},[i]),Zl=p.useCallback(()=>{const pe=new URLSearchParams;pe.set("view","history"),i({search:pe.toString()})},[i]),$u=p.useCallback(()=>{i("/")},[i]),gs=p.useCallback(()=>{j&&i(`/projects/${j}`)},[i,j]),ps=p.useCallback(()=>{W&&w&&Gl(),qe(),De(),y([]),z(null),O(!1),Y(!1),P(null),Tt(),Yt(),i(j?`/projects/${j}`:{search:""})},[W,w,Gl,qe,De,y,z,O,Y,P,Tt,Yt,i,j]);return p.useEffect(()=>{const pe=we=>{we.key===cc.ABORT&&W&&w&&(we.preventDefault(),Gl())};return document.addEventListener("keydown",pe),()=>document.removeEventListener("keydown",pe)},[W,w,Gl]),f.jsx("div",{className:"min-h-screen bg-slate-50 dark:bg-slate-900 transition-colors duration-300",children:f.jsxs("div",{className:"max-w-7xl mx-auto p-3 sm:p-6 h-screen flex flex-col",children:[f.jsxs("div",{className:"flex items-center justify-between mb-4 sm:mb-8 flex-shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-4",children:[G&&f.jsx("button",{onClick:Vl,className:"p-2 rounded-lg bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 hover:bg-white dark:hover:bg-slate-800 transition-all duration-200 backdrop-blur-sm shadow-sm hover:shadow-md","aria-label":"Back to chat",children:f.jsx(A0,{className:"w-5 h-5 text-slate-600 dark:text-slate-400"})}),X&&f.jsx("button",{onClick:Zl,className:"p-2 rounded-lg bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 hover:bg-white dark:hover:bg-slate-800 transition-all duration-200 backdrop-blur-sm shadow-sm hover:shadow-md","aria-label":"Back to history",children:f.jsx(A0,{className:"w-5 h-5 text-slate-600 dark:text-slate-400"})}),f.jsxs("div",{children:[f.jsx("nav",{"aria-label":"Breadcrumb",children:f.jsxs("div",{className:"flex items-center",children:[f.jsx("button",{onClick:$u,className:"text-slate-800 dark:text-slate-100 text-lg sm:text-3xl font-bold tracking-tight hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-slate-900 rounded-md px-1 -mx-1","aria-label":"Back to project selection",children:"OpenCode Web UI"}),(G||T)&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:"text-slate-800 dark:text-slate-100 text-lg sm:text-3xl font-bold tracking-tight mx-3 select-none","aria-hidden":"true",children:[" ","›"," "]}),f.jsx("h1",{className:"text-slate-800 dark:text-slate-100 text-lg sm:text-3xl font-bold tracking-tight","aria-current":"page",children:G?"Conversation History":"Conversation"})]})]})}),j&&f.jsxs("div",{className:"flex items-center text-sm font-mono mt-1",children:[f.jsx("button",{onClick:gs,className:"text-slate-600 dark:text-slate-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-slate-900 rounded px-1 -mx-1 cursor-pointer","aria-label":`Return to new chat in ${j}`,children:j}),T&&f.jsxs("span",{className:"ml-2 text-xs text-slate-600 dark:text-slate-400",children:["Session: ",T.substring(0,8),"..."]})]})]})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[!G&&f.jsxs("button",{onClick:ps,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 hover:bg-white dark:hover:bg-slate-800 transition-all duration-200 backdrop-blur-sm shadow-sm hover:shadow-md text-sm font-medium text-slate-700 dark:text-slate-200",title:"New conversation","aria-label":"New conversation",children:[f.jsx(th,{className:"w-4 h-4"}),"New Chat"]}),!G&&f.jsx(Sx,{onClick:da}),f.jsx("button",{onClick:()=>v(!E),className:`p-2 rounded-lg transition-all duration-200 ${E?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"bg-white/80 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200"}`,title:E?"Close file canvas":"Open file canvas","aria-label":E?"Close file canvas":"Open file canvas",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})})}),f.jsx(ah,{onClick:ha})]})]}),f.jsxs("div",{className:"flex-1 flex gap-3 overflow-hidden",children:[f.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:G?f.jsx(dy,{workingDirectory:j,encodedName:se(),onBack:Vl}):ne?f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-8 h-8 border-2 border-slate-300 border-t-slate-600 rounded-full animate-spin mx-auto mb-4"}),f.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"Loading conversation history..."})]})}):I?f.jsx("div",{className:"flex-1 flex items-center justify-center",children:f.jsxs("div",{className:"text-center max-w-md",children:[f.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-red-100 dark:bg-red-900/20 rounded-full flex items-center justify-center",children:f.jsx("svg",{className:"w-8 h-8 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),f.jsx("h2",{className:"text-slate-800 dark:text-slate-100 text-xl font-semibold mb-2",children:"Error Loading Conversation"}),f.jsx("p",{className:"text-slate-600 dark:text-slate-400 text-sm mb-4",children:I}),f.jsx("button",{onClick:()=>i({search:""}),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Start New Conversation"})]})}):f.jsxs(f.Fragment,{children:[f.jsx(oy,{messages:de,isLoading:W}),f.jsx(Rx,{input:Ue,isLoading:W,currentRequestId:w,onInputChange:K,onSubmit:()=>kt(),onAbort:Gl,permissionMode:Q,onPermissionModeChange:ee,showPermissions:Ct,permissionData:qu,planPermissionData:Yu})]})}),E&&f.jsx("div",{className:"hidden lg:flex w-96 flex-col overflow-hidden bg-white/70 dark:bg-slate-800/70 border border-slate-200/60 dark:border-slate-700/60 rounded-2xl shadow-sm backdrop-blur-sm",children:f.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[f.jsx("div",{className:"h-1/3 flex flex-col border-b border-slate-200 dark:border-slate-700",children:f.jsx(py,{files:Z.files,selectedFile:Z.selectedFile,onFileSelect:Z.selectFile,onClearFiles:Z.clearFiles})}),f.jsx("div",{className:"h-2/3 flex flex-col",children:f.jsx(hy,{fileInfo:Z.selectedFile,content:Z.fileContent,base64:Z.fileBase64,isLoading:Z.isLoading,error:Z.error})})]})})]}),f.jsx(sh,{isOpen:g,onClose:tl})]})})}const dh=1,Ia={SETTINGS:"opencode-webui-settings",THEME:"opencode-webui-theme",ENTER_BEHAVIOR:"opencode-webui-enter-behavior"};function gc(s,i){try{const c=localStorage.getItem(s);return c?JSON.parse(c):i}catch{return i}}function Sy(s,i){try{localStorage.setItem(s,JSON.stringify(i))}catch{}}function U0(s){try{localStorage.removeItem(s)}catch{}}function H0(){const s=gc(Ia.SETTINGS,null);return s&&s.version===dh?s:Ey()}function hh(s){Sy(Ia.SETTINGS,s)}function Ey(){const i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",c=gc(Ia.THEME,i),r=gc(Ia.ENTER_BEHAVIOR,"send"),d={theme:c,enterBehavior:r,version:dh};return hh(d),U0(Ia.THEME),U0(Ia.ENTER_BEHAVIOR),d}function wy({children:s}){const[i,c]=p.useState(()=>H0()),[r,d]=p.useState(!1);p.useEffect(()=>{const h=H0();c(h),d(!0)},[]),p.useEffect(()=>{if(!r)return;const h=window.document.documentElement;i.theme==="dark"?h.classList.add("dark"):h.classList.remove("dark"),hh(i)},[i,r]);const g=p.useCallback(h=>{c(S=>({...S,...h}))},[]),x=p.useCallback(()=>{g({theme:i.theme==="light"?"dark":"light"})},[i.theme,g]),E=p.useCallback(()=>{g({enterBehavior:i.enterBehavior==="send"?"newline":"send"})},[i.enterBehavior,g]),v=p.useMemo(()=>({settings:i,theme:i.theme,enterBehavior:i.enterBehavior,toggleTheme:x,toggleEnterBehavior:E,updateSettings:g}),[i,x,E,g]);return f.jsx(nh.Provider,{value:v,children:s})}const My=null;function jy(){return f.jsx(wy,{children:f.jsx(Kp,{children:f.jsxs(wp,{children:[f.jsx(uc,{path:"/",element:f.jsx(_v,{})}),f.jsx(uc,{path:"/projects/*",element:f.jsx(by,{})}),My]})})})}Og.createRoot(document.getElementById("root")).render(f.jsx(p.StrictMode,{children:f.jsx(jy,{})}));
