@actalk/inkos-studio 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,395 @@
1
+ (function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))o(m);new MutationObserver(m=>{for(const x of m)if(x.type==="childList")for(const y of x.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&o(y)}).observe(document,{childList:!0,subtree:!0});function u(m){const x={};return m.integrity&&(x.integrity=m.integrity),m.referrerPolicy&&(x.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?x.credentials="include":m.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function o(m){if(m.ep)return;m.ep=!0;const x=u(m);fetch(m.href,x)}})();var Yc={exports:{}},$n={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var vm;function Hg(){if(vm)return $n;vm=1;var r=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function u(o,m,x){var y=null;if(x!==void 0&&(y=""+x),m.key!==void 0&&(y=""+m.key),"key"in m){x={};for(var T in m)T!=="key"&&(x[T]=m[T])}else x=m;return m=x.ref,{$$typeof:r,type:o,key:y,ref:m!==void 0?m:null,props:x}}return $n.Fragment=f,$n.jsx=u,$n.jsxs=u,$n}var jm;function qg(){return jm||(jm=1,Yc.exports=Hg()),Yc.exports}var s=qg(),Vc={exports:{}},me={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Sm;function Lg(){if(Sm)return me;Sm=1;var r=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),y=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),L=Symbol.iterator;function B(b){return b===null||typeof b!="object"?null:(b=L&&b[L]||b["@@iterator"],typeof b=="function"?b:null)}var Y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,Z={};function ce(b,_,Q){this.props=b,this.context=_,this.refs=Z,this.updater=Q||Y}ce.prototype.isReactComponent={},ce.prototype.setState=function(b,_){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,_,"setState")},ce.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function X(){}X.prototype=ce.prototype;function $(b,_,Q){this.props=b,this.context=_,this.refs=Z,this.updater=Q||Y}var fe=$.prototype=new X;fe.constructor=$,R(fe,ce.prototype),fe.isPureReactComponent=!0;var ke=Array.isArray;function W(){}var ae={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function oe(b,_,Q){var J=Q.ref;return{$$typeof:r,type:b,key:_,ref:J!==void 0?J:null,props:Q}}function q(b,_){return oe(b.type,_,b.props)}function K(b){return typeof b=="object"&&b!==null&&b.$$typeof===r}function le(b){var _={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(Q){return _[Q]})}var he=/\/+/g;function Ee(b,_){return typeof b=="object"&&b!==null&&b.key!=null?le(""+b.key):_.toString(36)}function Ae(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(W,W):(b.status="pending",b.then(function(_){b.status==="pending"&&(b.status="fulfilled",b.value=_)},function(_){b.status==="pending"&&(b.status="rejected",b.reason=_)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function k(b,_,Q,J,ne){var ie=typeof b;(ie==="undefined"||ie==="boolean")&&(b=null);var be=!1;if(b===null)be=!0;else switch(ie){case"bigint":case"string":case"number":be=!0;break;case"object":switch(b.$$typeof){case r:case f:be=!0;break;case A:return be=b._init,k(be(b._payload),_,Q,J,ne)}}if(be)return ne=ne(b),be=J===""?"."+Ee(b,0):J,ke(ne)?(Q="",be!=null&&(Q=be.replace(he,"$&/")+"/"),k(ne,_,Q,"",function(Kt){return Kt})):ne!=null&&(K(ne)&&(ne=q(ne,Q+(ne.key==null||b&&b.key===ne.key?"":(""+ne.key).replace(he,"$&/")+"/")+be)),_.push(ne)),1;be=0;var Je=J===""?".":J+":";if(ke(b))for(var pe=0;pe<b.length;pe++)J=b[pe],ie=Je+Ee(J,pe),be+=k(J,_,Q,ie,ne);else if(pe=B(b),typeof pe=="function")for(b=pe.call(b),pe=0;!(J=b.next()).done;)J=J.value,ie=Je+Ee(J,pe++),be+=k(J,_,Q,ie,ne);else if(ie==="object"){if(typeof b.then=="function")return k(Ae(b),_,Q,J,ne);throw _=String(b),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return be}function H(b,_,Q){if(b==null)return b;var J=[],ne=0;return k(b,J,"","",function(ie){return _.call(Q,ie,ne++)}),J}function F(b){if(b._status===-1){var _=b._result;_=_(),_.then(function(Q){(b._status===0||b._status===-1)&&(b._status=1,b._result=Q)},function(Q){(b._status===0||b._status===-1)&&(b._status=2,b._result=Q)}),b._status===-1&&(b._status=0,b._result=_)}if(b._status===1)return b._result.default;throw b._result}var de=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)},w={map:H,forEach:function(b,_,Q){H(b,function(){_.apply(this,arguments)},Q)},count:function(b){var _=0;return H(b,function(){_++}),_},toArray:function(b){return H(b,function(_){return _})||[]},only:function(b){if(!K(b))throw Error("React.Children.only expected to receive a single React element child.");return b}};return me.Activity=S,me.Children=w,me.Component=ce,me.Fragment=u,me.Profiler=m,me.PureComponent=$,me.StrictMode=o,me.Suspense=h,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ae,me.__COMPILER_RUNTIME={__proto__:null,c:function(b){return ae.H.useMemoCache(b)}},me.cache=function(b){return function(){return b.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(b,_,Q){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var J=R({},b.props),ne=b.key;if(_!=null)for(ie in _.key!==void 0&&(ne=""+_.key),_)!V.call(_,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&_.ref===void 0||(J[ie]=_[ie]);var ie=arguments.length-2;if(ie===1)J.children=Q;else if(1<ie){for(var be=Array(ie),Je=0;Je<ie;Je++)be[Je]=arguments[Je+2];J.children=be}return oe(b.type,ne,J)},me.createContext=function(b){return b={$$typeof:y,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:x,_context:b},b},me.createElement=function(b,_,Q){var J,ne={},ie=null;if(_!=null)for(J in _.key!==void 0&&(ie=""+_.key),_)V.call(_,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ne[J]=_[J]);var be=arguments.length-2;if(be===1)ne.children=Q;else if(1<be){for(var Je=Array(be),pe=0;pe<be;pe++)Je[pe]=arguments[pe+2];ne.children=Je}if(b&&b.defaultProps)for(J in be=b.defaultProps,be)ne[J]===void 0&&(ne[J]=be[J]);return oe(b,ie,ne)},me.createRef=function(){return{current:null}},me.forwardRef=function(b){return{$$typeof:T,render:b}},me.isValidElement=K,me.lazy=function(b){return{$$typeof:A,_payload:{_status:-1,_result:b},_init:F}},me.memo=function(b,_){return{$$typeof:p,type:b,compare:_===void 0?null:_}},me.startTransition=function(b){var _=ae.T,Q={};ae.T=Q;try{var J=b(),ne=ae.S;ne!==null&&ne(Q,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(W,de)}catch(ie){de(ie)}finally{_!==null&&Q.types!==null&&(_.types=Q.types),ae.T=_}},me.unstable_useCacheRefresh=function(){return ae.H.useCacheRefresh()},me.use=function(b){return ae.H.use(b)},me.useActionState=function(b,_,Q){return ae.H.useActionState(b,_,Q)},me.useCallback=function(b,_){return ae.H.useCallback(b,_)},me.useContext=function(b){return ae.H.useContext(b)},me.useDebugValue=function(){},me.useDeferredValue=function(b,_){return ae.H.useDeferredValue(b,_)},me.useEffect=function(b,_){return ae.H.useEffect(b,_)},me.useEffectEvent=function(b){return ae.H.useEffectEvent(b)},me.useId=function(){return ae.H.useId()},me.useImperativeHandle=function(b,_,Q){return ae.H.useImperativeHandle(b,_,Q)},me.useInsertionEffect=function(b,_){return ae.H.useInsertionEffect(b,_)},me.useLayoutEffect=function(b,_){return ae.H.useLayoutEffect(b,_)},me.useMemo=function(b,_){return ae.H.useMemo(b,_)},me.useOptimistic=function(b,_){return ae.H.useOptimistic(b,_)},me.useReducer=function(b,_,Q){return ae.H.useReducer(b,_,Q)},me.useRef=function(b){return ae.H.useRef(b)},me.useState=function(b){return ae.H.useState(b)},me.useSyncExternalStore=function(b,_,Q){return ae.H.useSyncExternalStore(b,_,Q)},me.useTransition=function(){return ae.H.useTransition()},me.version="19.2.4",me}var Nm;function lo(){return Nm||(Nm=1,Vc.exports=Lg()),Vc.exports}var D=lo(),Qc={exports:{}},Wn={},Xc={exports:{}},Zc={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var zm;function Gg(){return zm||(zm=1,(function(r){function f(k,H){var F=k.length;k.push(H);e:for(;0<F;){var de=F-1>>>1,w=k[de];if(0<m(w,H))k[de]=H,k[F]=w,F=de;else break e}}function u(k){return k.length===0?null:k[0]}function o(k){if(k.length===0)return null;var H=k[0],F=k.pop();if(F!==H){k[0]=F;e:for(var de=0,w=k.length,b=w>>>1;de<b;){var _=2*(de+1)-1,Q=k[_],J=_+1,ne=k[J];if(0>m(Q,F))J<w&&0>m(ne,Q)?(k[de]=ne,k[J]=F,de=J):(k[de]=Q,k[_]=F,de=_);else if(J<w&&0>m(ne,F))k[de]=ne,k[J]=F,de=J;else break e}}return H}function m(k,H){var F=k.sortIndex-H.sortIndex;return F!==0?F:k.id-H.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;r.unstable_now=function(){return x.now()}}else{var y=Date,T=y.now();r.unstable_now=function(){return y.now()-T}}var h=[],p=[],A=1,S=null,L=3,B=!1,Y=!1,R=!1,Z=!1,ce=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function fe(k){for(var H=u(p);H!==null;){if(H.callback===null)o(p);else if(H.startTime<=k)o(p),H.sortIndex=H.expirationTime,f(h,H);else break;H=u(p)}}function ke(k){if(R=!1,fe(k),!Y)if(u(h)!==null)Y=!0,W||(W=!0,le());else{var H=u(p);H!==null&&Ae(ke,H.startTime-k)}}var W=!1,ae=-1,V=5,oe=-1;function q(){return Z?!0:!(r.unstable_now()-oe<V)}function K(){if(Z=!1,W){var k=r.unstable_now();oe=k;var H=!0;try{e:{Y=!1,R&&(R=!1,X(ae),ae=-1),B=!0;var F=L;try{t:{for(fe(k),S=u(h);S!==null&&!(S.expirationTime>k&&q());){var de=S.callback;if(typeof de=="function"){S.callback=null,L=S.priorityLevel;var w=de(S.expirationTime<=k);if(k=r.unstable_now(),typeof w=="function"){S.callback=w,fe(k),H=!0;break t}S===u(h)&&o(h),fe(k)}else o(h);S=u(h)}if(S!==null)H=!0;else{var b=u(p);b!==null&&Ae(ke,b.startTime-k),H=!1}}break e}finally{S=null,L=F,B=!1}H=void 0}}finally{H?le():W=!1}}}var le;if(typeof $=="function")le=function(){$(K)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Ee=he.port2;he.port1.onmessage=K,le=function(){Ee.postMessage(null)}}else le=function(){ce(K,0)};function Ae(k,H){ae=ce(function(){k(r.unstable_now())},H)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(k){k.callback=null},r.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<k?Math.floor(1e3/k):5},r.unstable_getCurrentPriorityLevel=function(){return L},r.unstable_next=function(k){switch(L){case 1:case 2:case 3:var H=3;break;default:H=L}var F=L;L=H;try{return k()}finally{L=F}},r.unstable_requestPaint=function(){Z=!0},r.unstable_runWithPriority=function(k,H){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var F=L;L=k;try{return H()}finally{L=F}},r.unstable_scheduleCallback=function(k,H,F){var de=r.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?de+F:de):F=de,k){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=F+w,k={id:A++,callback:H,priorityLevel:k,startTime:F,expirationTime:w,sortIndex:-1},F>de?(k.sortIndex=F,f(p,k),u(h)===null&&k===u(p)&&(R?(X(ae),ae=-1):R=!0,Ae(ke,F-de))):(k.sortIndex=w,f(h,k),Y||B||(Y=!0,W||(W=!0,le()))),k},r.unstable_shouldYield=q,r.unstable_wrapCallback=function(k){var H=L;return function(){var F=L;L=H;try{return k.apply(this,arguments)}finally{L=F}}}})(Zc)),Zc}var km;function Yg(){return km||(km=1,Xc.exports=Gg()),Xc.exports}var Kc={exports:{}},dt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Em;function Vg(){if(Em)return dt;Em=1;var r=lo();function f(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var A=2;A<arguments.length;A++)p+="&args[]="+encodeURIComponent(arguments[A])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(f(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},m=Symbol.for("react.portal");function x(h,p,A){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:S==null?null:""+S,children:h,containerInfo:p,implementation:A}}var y=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function T(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,dt.createPortal=function(h,p){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(f(299));return x(h,p,null,A)},dt.flushSync=function(h){var p=y.T,A=o.p;try{if(y.T=null,o.p=2,h)return h()}finally{y.T=p,o.p=A,o.d.f()}},dt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(h,p))},dt.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},dt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var A=p.as,S=T(A,p.crossOrigin),L=typeof p.integrity=="string"?p.integrity:void 0,B=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;A==="style"?o.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:S,integrity:L,fetchPriority:B}):A==="script"&&o.d.X(h,{crossOrigin:S,integrity:L,fetchPriority:B,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},dt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var A=T(p.as,p.crossOrigin);o.d.M(h,{crossOrigin:A,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(h)},dt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var A=p.as,S=T(A,p.crossOrigin);o.d.L(h,A,{crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},dt.preloadModule=function(h,p){if(typeof h=="string")if(p){var A=T(p.as,p.crossOrigin);o.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:A,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(h)},dt.requestFormReset=function(h){o.d.r(h)},dt.unstable_batchedUpdates=function(h,p){return h(p)},dt.useFormState=function(h,p,A){return y.H.useFormState(h,p,A)},dt.useFormStatus=function(){return y.H.useHostTransitionStatus()},dt.version="19.2.4",dt}var Tm;function Qg(){if(Tm)return Kc.exports;Tm=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(f){console.error(f)}}return r(),Kc.exports=Vg(),Kc.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var wm;function Xg(){if(wm)return Wn;wm=1;var r=Yg(),f=lo(),u=Qg();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function x(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function y(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 T(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(x(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=x(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,l=t;;){var n=a.return;if(n===null)break;var i=n.alternate;if(i===null){if(l=n.return,l!==null){a=l;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===a)return h(n),e;if(i===l)return h(n),t;i=i.sibling}throw Error(o(188))}if(a.return!==l.return)a=n,l=i;else{for(var c=!1,d=n.child;d;){if(d===a){c=!0,a=n,l=i;break}if(d===l){c=!0,l=n,a=i;break}d=d.sibling}if(!c){for(d=i.child;d;){if(d===a){c=!0,a=i,l=n;break}if(d===l){c=!0,l=i,a=n;break}d=d.sibling}if(!c)throw Error(o(189))}}if(a.alternate!==l)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,L=Symbol.for("react.element"),B=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),$=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),ke=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function Ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case ce:return"Profiler";case Z:return"StrictMode";case ke:return"Suspense";case W:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Y:return"Portal";case $:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case fe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return t=e.displayName||null,t!==null?t:Ee(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return Ee(e(t))}catch{}}return null}var Ae=Array.isArray,k=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},de=[],w=-1;function b(e){return{current:e}}function _(e){0>w||(e.current=de[w],de[w]=null,w--)}function Q(e,t){w++,de[w]=e.current,e.current=t}var J=b(null),ne=b(null),ie=b(null),be=b(null);function Je(e,t){switch(Q(ie,t),Q(ne,e),Q(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vf(t),e=Qf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_(J),Q(J,e)}function pe(){_(J),_(ne),_(ie)}function Kt(e){e.memoizedState!==null&&Q(be,e);var t=J.current,a=Qf(t,e.type);t!==a&&(Q(ne,e),Q(J,a))}function et(e){ne.current===e&&(_(J),_(ne)),be.current===e&&(_(be),Xn._currentValue=F)}var pt,xa;function mt(e){if(pt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);pt=t&&t[1]||"",xa=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+pt+e+xa}var en=!1;function tn(e,t){if(!e||en)return"";en=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(C){var E=C}Reflect.construct(e,[],U)}else{try{U.call()}catch(C){E=C}e.call(U.prototype)}}else{try{throw Error()}catch(C){E=C}(U=e())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(C){if(C&&E&&typeof C.stack=="string")return[C.stack,E.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),c=i[0],d=i[1];if(c&&d){var g=c.split(`
44
+ `),z=d.split(`
45
+ `);for(n=l=0;l<g.length&&!g[l].includes("DetermineComponentFrameRoot");)l++;for(;n<z.length&&!z[n].includes("DetermineComponentFrameRoot");)n++;if(l===g.length||n===z.length)for(l=g.length-1,n=z.length-1;1<=l&&0<=n&&g[l]!==z[n];)n--;for(;1<=l&&0<=n;l--,n--)if(g[l]!==z[n]){if(l!==1||n!==1)do if(l--,n--,0>n||g[l]!==z[n]){var M=`
46
+ `+g[l].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),M}while(1<=l&&0<=n);break}}}finally{en=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?mt(a):""}function Ci(e,t){switch(e.tag){case 26:case 27:case 5:return mt(e.type);case 16:return mt("Lazy");case 13:return e.child!==t&&t!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return tn(e.type,!1);case 11:return tn(e.type.render,!1);case 1:return tn(e.type,!0);case 31:return mt("Activity");default:return""}}function G(e){try{var t="",a=null;do t+=Ci(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
47
+ Error generating stack: `+l.message+`
48
+ `+l.stack}}var qe=Object.prototype.hasOwnProperty,Be=r.unstable_scheduleCallback,st=r.unstable_cancelCallback,pl=r.unstable_shouldYield,_t=r.unstable_requestPaint,Ve=r.unstable_now,yh=r.unstable_getCurrentPriorityLevel,vo=r.unstable_ImmediatePriority,jo=r.unstable_UserBlockingPriority,ts=r.unstable_NormalPriority,bh=r.unstable_LowPriority,So=r.unstable_IdlePriority,vh=r.log,jh=r.unstable_setDisableYieldValue,an=null,Nt=null;function ya(e){if(typeof vh=="function"&&jh(e),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(an,e)}catch{}}var zt=Math.clz32?Math.clz32:zh,Sh=Math.log,Nh=Math.LN2;function zh(e){return e>>>=0,e===0?32:31-(Sh(e)/Nh|0)|0}var as=256,ls=262144,ns=4194304;function Ja(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:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;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 ss(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var n=0,i=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var d=l&134217727;return d!==0?(l=d&~i,l!==0?n=Ja(l):(c&=d,c!==0?n=Ja(c):a||(a=d&~e,a!==0&&(n=Ja(a))))):(d=l&~i,d!==0?n=Ja(d):c!==0?n=Ja(c):a||(a=l&~e,a!==0&&(n=Ja(a)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:n}function ln(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function kh(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 No(){var e=ns;return ns<<=1,(ns&62914560)===0&&(ns=4194304),e}function Ai(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function nn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Eh(e,t,a,l,n,i){var c=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var d=e.entanglements,g=e.expirationTimes,z=e.hiddenUpdates;for(a=c&~a;0<a;){var M=31-zt(a),U=1<<M;d[M]=0,g[M]=-1;var E=z[M];if(E!==null)for(z[M]=null,M=0;M<E.length;M++){var C=E[M];C!==null&&(C.lane&=-536870913)}a&=~U}l!==0&&zo(e,l,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(c&~t))}function zo(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-zt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function ko(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-zt(a),n=1<<l;n&t|e[l]&t&&(e[l]|=t),a&=~n}}function Eo(e,t){var a=t&-t;return a=(a&42)!==0?1:Mi(a),(a&(e.suspendedLanes|t))!==0?0:a}function Mi(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 _i(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function To(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:mm(e.type))}function wo(e,t){var a=H.p;try{return H.p=e,t()}finally{H.p=a}}var ba=Math.random().toString(36).slice(2),it="__reactFiber$"+ba,gt="__reactProps$"+ba,gl="__reactContainer$"+ba,Oi="__reactEvents$"+ba,Th="__reactListeners$"+ba,wh="__reactHandles$"+ba,Co="__reactResources$"+ba,sn="__reactMarker$"+ba;function Di(e){delete e[it],delete e[gt],delete e[Oi],delete e[Th],delete e[wh]}function xl(e){var t=e[it];if(t)return t;for(var a=e.parentNode;a;){if(t=a[gl]||a[it]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Ff(e);e!==null;){if(a=e[it])return a;e=Ff(e)}return t}e=a,a=e.parentNode}return null}function yl(e){if(e=e[it]||e[gl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function rn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function bl(e){var t=e[Co];return t||(t=e[Co]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function lt(e){e[sn]=!0}var Ao=new Set,Mo={};function $a(e,t){vl(e,t),vl(e+"Capture",t)}function vl(e,t){for(Mo[e]=t,e=0;e<t.length;e++)Ao.add(t[e])}var Ch=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]*$"),_o={},Oo={};function Ah(e){return qe.call(Oo,e)?!0:qe.call(_o,e)?!1:Ch.test(e)?Oo[e]=!0:(_o[e]=!0,!1)}function is(e,t,a){if(Ah(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function rs(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function It(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function Ot(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Do(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Mh(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var n=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(c){a=""+c,i.call(this,c)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(c){a=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ri(e){if(!e._valueTracker){var t=Do(e)?"checked":"value";e._valueTracker=Mh(e,t,""+e[t])}}function Ro(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=Do(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function cs(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 _h=/[\n"\\]/g;function Dt(e){return e.replace(_h,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ui(e,t,a,l,n,i,c,d){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ot(t)):e.value!==""+Ot(t)&&(e.value=""+Ot(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Bi(e,c,Ot(t)):a!=null?Bi(e,c,Ot(a)):l!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.name=""+Ot(d):e.removeAttribute("name")}function Uo(e,t,a,l,n,i,c,d){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Ri(e);return}a=a!=null?""+Ot(a):"",t=t!=null?""+Ot(t):a,d||t===e.value||(e.value=t),e.defaultValue=t}l=l??n,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=d?e.checked:!!l,e.defaultChecked=!!l,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Ri(e)}function Bi(e,t,a){t==="number"&&cs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function jl(e,t,a,l){if(e=e.options,t){t={};for(var n=0;n<a.length;n++)t["$"+a[n]]=!0;for(a=0;a<e.length;a++)n=t.hasOwnProperty("$"+e[a].value),e[a].selected!==n&&(e[a].selected=n),n&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Ot(a),t=null,n=0;n<e.length;n++){if(e[n].value===a){e[n].selected=!0,l&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Bo(e,t,a){if(t!=null&&(t=""+Ot(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ot(a):""}function Ho(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(o(92));if(Ae(l)){if(1<l.length)throw Error(o(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=Ot(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Ri(e)}function Sl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Oh=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 qo(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||Oh.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Lo(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var n in t)l=t[n],t.hasOwnProperty(n)&&a[n]!==l&&qo(e,n,l)}else for(var i in t)t.hasOwnProperty(i)&&qo(e,i,t[i])}function Hi(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 Dh=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"]]),Rh=/^[\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 os(e){return Rh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Pt(){}var qi=null;function Li(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nl=null,zl=null;function Go(e){var t=yl(e);if(t&&(e=t.stateNode)){var a=e[gt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ui(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Dt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var n=l[gt]||null;if(!n)throw Error(o(90));Ui(l,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Ro(l)}break e;case"textarea":Bo(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&jl(e,!!a.multiple,t,!1)}}}var Gi=!1;function Yo(e,t,a){if(Gi)return e(t,a);Gi=!0;try{var l=e(t);return l}finally{if(Gi=!1,(Nl!==null||zl!==null)&&(Ws(),Nl&&(t=Nl,e=zl,zl=Nl=null,Go(t),e)))for(t=0;t<e.length;t++)Go(e[t])}}function cn(e,t){var a=e.stateNode;if(a===null)return null;var l=a[gt]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yi=!1;if(ea)try{var on={};Object.defineProperty(on,"passive",{get:function(){Yi=!0}}),window.addEventListener("test",on,on),window.removeEventListener("test",on,on)}catch{Yi=!1}var va=null,Vi=null,us=null;function Vo(){if(us)return us;var e,t=Vi,a=t.length,l,n="value"in va?va.value:va.textContent,i=n.length;for(e=0;e<a&&t[e]===n[e];e++);var c=a-e;for(l=1;l<=c&&t[a-l]===n[i-l];l++);return us=n.slice(e,1<l?1-l:void 0)}function ds(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 fs(){return!0}function Qo(){return!1}function xt(e){function t(a,l,n,i,c){this._reactName=a,this._targetInst=n,this.type=l,this.nativeEvent=i,this.target=c,this.currentTarget=null;for(var d in e)e.hasOwnProperty(d)&&(a=e[d],this[d]=a?a(i):i[d]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?fs:Qo,this.isPropagationStopped=Qo,this}return S(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=fs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var Wa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ms=xt(Wa),un=S({},Wa,{view:0,detail:0}),Uh=xt(un),Qi,Xi,dn,hs=S({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ki,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!==dn&&(dn&&e.type==="mousemove"?(Qi=e.screenX-dn.screenX,Xi=e.screenY-dn.screenY):Xi=Qi=0,dn=e),Qi)},movementY:function(e){return"movementY"in e?e.movementY:Xi}}),Xo=xt(hs),Bh=S({},hs,{dataTransfer:0}),Hh=xt(Bh),qh=S({},un,{relatedTarget:0}),Zi=xt(qh),Lh=S({},Wa,{animationName:0,elapsedTime:0,pseudoElement:0}),Gh=xt(Lh),Yh=S({},Wa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vh=xt(Yh),Qh=S({},Wa,{data:0}),Zo=xt(Qh),Xh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zh={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"},Kh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kh[e])?!!t[e]:!1}function Ki(){return Jh}var $h=S({},un,{key:function(e){if(e.key){var t=Xh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ki,charCode:function(e){return e.type==="keypress"?ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Wh=xt($h),Fh=S({},hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ko=xt(Fh),Ih=S({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ki}),Ph=xt(Ih),ep=S({},Wa,{propertyName:0,elapsedTime:0,pseudoElement:0}),tp=xt(ep),ap=S({},hs,{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}),lp=xt(ap),np=S({},Wa,{newState:0,oldState:0}),sp=xt(np),ip=[9,13,27,32],Ji=ea&&"CompositionEvent"in window,fn=null;ea&&"documentMode"in document&&(fn=document.documentMode);var rp=ea&&"TextEvent"in window&&!fn,Jo=ea&&(!Ji||fn&&8<fn&&11>=fn),$o=" ",Wo=!1;function Fo(e,t){switch(e){case"keyup":return ip.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Io(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kl=!1;function cp(e,t){switch(e){case"compositionend":return Io(t);case"keypress":return t.which!==32?null:(Wo=!0,$o);case"textInput":return e=t.data,e===$o&&Wo?null:e;default:return null}}function op(e,t){if(kl)return e==="compositionend"||!Ji&&Fo(e,t)?(e=Vo(),us=Vi=va=null,kl=!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 Jo&&t.locale!=="ko"?null:t.data;default:return null}}var up={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 Po(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!up[e.type]:t==="textarea"}function eu(e,t,a,l){Nl?zl?zl.push(l):zl=[l]:Nl=l,t=li(t,"onChange"),0<t.length&&(a=new ms("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var mn=null,hn=null;function dp(e){Bf(e,0)}function ps(e){var t=rn(e);if(Ro(t))return e}function tu(e,t){if(e==="change")return t}var au=!1;if(ea){var $i;if(ea){var Wi="oninput"in document;if(!Wi){var lu=document.createElement("div");lu.setAttribute("oninput","return;"),Wi=typeof lu.oninput=="function"}$i=Wi}else $i=!1;au=$i&&(!document.documentMode||9<document.documentMode)}function nu(){mn&&(mn.detachEvent("onpropertychange",su),hn=mn=null)}function su(e){if(e.propertyName==="value"&&ps(hn)){var t=[];eu(t,hn,e,Li(e)),Yo(dp,t)}}function fp(e,t,a){e==="focusin"?(nu(),mn=t,hn=a,mn.attachEvent("onpropertychange",su)):e==="focusout"&&nu()}function mp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ps(hn)}function hp(e,t){if(e==="click")return ps(t)}function pp(e,t){if(e==="input"||e==="change")return ps(t)}function gp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:gp;function pn(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var n=a[l];if(!qe.call(t,n)||!kt(e[n],t[n]))return!1}return!0}function iu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ru(e,t){var a=iu(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=iu(a)}}function cu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ou(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=cs(e.document)}return t}function Fi(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 xp=ea&&"documentMode"in document&&11>=document.documentMode,El=null,Ii=null,gn=null,Pi=!1;function uu(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Pi||El==null||El!==cs(l)||(l=El,"selectionStart"in l&&Fi(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),gn&&pn(gn,l)||(gn=l,l=li(Ii,"onSelect"),0<l.length&&(t=new ms("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=El)))}function Fa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Tl={animationend:Fa("Animation","AnimationEnd"),animationiteration:Fa("Animation","AnimationIteration"),animationstart:Fa("Animation","AnimationStart"),transitionrun:Fa("Transition","TransitionRun"),transitionstart:Fa("Transition","TransitionStart"),transitioncancel:Fa("Transition","TransitionCancel"),transitionend:Fa("Transition","TransitionEnd")},er={},du={};ea&&(du=document.createElement("div").style,"AnimationEvent"in window||(delete Tl.animationend.animation,delete Tl.animationiteration.animation,delete Tl.animationstart.animation),"TransitionEvent"in window||delete Tl.transitionend.transition);function Ia(e){if(er[e])return er[e];if(!Tl[e])return e;var t=Tl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in du)return er[e]=t[a];return e}var fu=Ia("animationend"),mu=Ia("animationiteration"),hu=Ia("animationstart"),yp=Ia("transitionrun"),bp=Ia("transitionstart"),vp=Ia("transitioncancel"),pu=Ia("transitionend"),gu=new Map,tr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");tr.push("scrollEnd");function Qt(e,t){gu.set(e,t),$a(t,[e])}var gs=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)},Rt=[],wl=0,ar=0;function xs(){for(var e=wl,t=ar=wl=0;t<e;){var a=Rt[t];Rt[t++]=null;var l=Rt[t];Rt[t++]=null;var n=Rt[t];Rt[t++]=null;var i=Rt[t];if(Rt[t++]=null,l!==null&&n!==null){var c=l.pending;c===null?n.next=n:(n.next=c.next,c.next=n),l.pending=n}i!==0&&xu(a,n,i)}}function ys(e,t,a,l){Rt[wl++]=e,Rt[wl++]=t,Rt[wl++]=a,Rt[wl++]=l,ar|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function lr(e,t,a,l){return ys(e,t,a,l),bs(e)}function Pa(e,t){return ys(e,null,null,t),bs(e)}function xu(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var n=!1,i=e.return;i!==null;)i.childLanes|=a,l=i.alternate,l!==null&&(l.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-zt(a),e=i.hiddenUpdates,l=e[n],l===null?e[n]=[t]:l.push(t),t.lane=a|536870912),i):null}function bs(e){if(50<Hn)throw Hn=0,fc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Cl={};function jp(e,t,a,l){this.tag=e,this.key=a,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,a,l){return new jp(e,t,a,l)}function nr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ta(e,t){var a=e.alternate;return a===null?(a=Et(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function yu(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function vs(e,t,a,l,n,i){var c=0;if(l=e,typeof e=="function")nr(e)&&(c=1);else if(typeof e=="string")c=Eg(e,a,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case oe:return e=Et(31,a,t,n),e.elementType=oe,e.lanes=i,e;case R:return el(a.children,n,i,t);case Z:c=8,n|=24;break;case ce:return e=Et(12,a,t,n|2),e.elementType=ce,e.lanes=i,e;case ke:return e=Et(13,a,t,n),e.elementType=ke,e.lanes=i,e;case W:return e=Et(19,a,t,n),e.elementType=W,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:c=10;break e;case X:c=9;break e;case fe:c=11;break e;case ae:c=14;break e;case V:c=16,l=null;break e}c=29,a=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=Et(c,a,t,n),t.elementType=e,t.type=l,t.lanes=i,t}function el(e,t,a,l){return e=Et(7,e,l,t),e.lanes=a,e}function sr(e,t,a){return e=Et(6,e,null,t),e.lanes=a,e}function bu(e){var t=Et(18,null,null,0);return t.stateNode=e,t}function ir(e,t,a){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vu=new WeakMap;function Ut(e,t){if(typeof e=="object"&&e!==null){var a=vu.get(e);return a!==void 0?a:(t={value:e,source:t,stack:G(t)},vu.set(e,t),t)}return{value:e,source:t,stack:G(t)}}var Al=[],Ml=0,js=null,xn=0,Bt=[],Ht=0,ja=null,Jt=1,$t="";function aa(e,t){Al[Ml++]=xn,Al[Ml++]=js,js=e,xn=t}function ju(e,t,a){Bt[Ht++]=Jt,Bt[Ht++]=$t,Bt[Ht++]=ja,ja=e;var l=Jt;e=$t;var n=32-zt(l)-1;l&=~(1<<n),a+=1;var i=32-zt(t)+n;if(30<i){var c=n-n%5;i=(l&(1<<c)-1).toString(32),l>>=c,n-=c,Jt=1<<32-zt(t)+n|a<<n|l,$t=i+e}else Jt=1<<i|a<<n|l,$t=e}function rr(e){e.return!==null&&(aa(e,1),ju(e,1,0))}function cr(e){for(;e===js;)js=Al[--Ml],Al[Ml]=null,xn=Al[--Ml],Al[Ml]=null;for(;e===ja;)ja=Bt[--Ht],Bt[Ht]=null,$t=Bt[--Ht],Bt[Ht]=null,Jt=Bt[--Ht],Bt[Ht]=null}function Su(e,t){Bt[Ht++]=Jt,Bt[Ht++]=$t,Bt[Ht++]=ja,Jt=t.id,$t=t.overflow,ja=e}var rt=null,Le=null,ze=!1,Sa=null,qt=!1,or=Error(o(519));function Na(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yn(Ut(t,e)),or}function Nu(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[it]=e,t[gt]=l,a){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(a=0;a<Ln.length;a++)je(Ln[a],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),Uo(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),Ho(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||Gf(t.textContent,a)?(l.popover!=null&&(je("beforetoggle",t),je("toggle",t)),l.onScroll!=null&&je("scroll",t),l.onScrollEnd!=null&&je("scrollend",t),l.onClick!=null&&(t.onclick=Pt),t=!0):t=!1,t||Na(e,!0)}function zu(e){for(rt=e.return;rt;)switch(rt.tag){case 5:case 31:case 13:qt=!1;return;case 27:case 3:qt=!0;return;default:rt=rt.return}}function _l(e){if(e!==rt)return!1;if(!ze)return zu(e),ze=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Tc(e.type,e.memoizedProps)),a=!a),a&&Le&&Na(e),zu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Le=Wf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Le=Wf(e)}else t===27?(t=Le,Ba(e.type)?(e=_c,_c=null,Le=e):Le=t):Le=rt?Gt(e.stateNode.nextSibling):null;return!0}function tl(){Le=rt=null,ze=!1}function ur(){var e=Sa;return e!==null&&(jt===null?jt=e:jt.push.apply(jt,e),Sa=null),e}function yn(e){Sa===null?Sa=[e]:Sa.push(e)}var dr=b(null),al=null,la=null;function za(e,t,a){Q(dr,t._currentValue),t._currentValue=a}function na(e){e._currentValue=dr.current,_(dr)}function fr(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function mr(e,t,a,l){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var c=n.child;i=i.firstContext;e:for(;i!==null;){var d=i;i=n;for(var g=0;g<t.length;g++)if(d.context===t[g]){i.lanes|=a,d=i.alternate,d!==null&&(d.lanes|=a),fr(i.return,a,e),l||(c=null);break e}i=d.next}}else if(n.tag===18){if(c=n.return,c===null)throw Error(o(341));c.lanes|=a,i=c.alternate,i!==null&&(i.lanes|=a),fr(c,a,e),c=null}else c=n.child;if(c!==null)c.return=n;else for(c=n;c!==null;){if(c===e){c=null;break}if(n=c.sibling,n!==null){n.return=c.return,c=n;break}c=c.return}n=c}}function Ol(e,t,a,l){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var c=n.alternate;if(c===null)throw Error(o(387));if(c=c.memoizedProps,c!==null){var d=n.type;kt(n.pendingProps.value,c.value)||(e!==null?e.push(d):e=[d])}}else if(n===be.current){if(c=n.alternate,c===null)throw Error(o(387));c.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Xn):e=[Xn])}n=n.return}e!==null&&mr(t,e,a,l),t.flags|=262144}function Ss(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ll(e){al=e,la=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ct(e){return ku(al,e)}function Ns(e,t){return al===null&&ll(e),ku(e,t)}function ku(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},la===null){if(e===null)throw Error(o(308));la=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else la=la.next=t;return a}var Sp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Np=r.unstable_scheduleCallback,zp=r.unstable_NormalPriority,$e={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hr(){return{controller:new Sp,data:new Map,refCount:0}}function bn(e){e.refCount--,e.refCount===0&&Np(zp,function(){e.controller.abort()})}var vn=null,pr=0,Dl=0,Rl=null;function kp(e,t){if(vn===null){var a=vn=[];pr=0,Dl=yc(),Rl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return pr++,t.then(Eu,Eu),t}function Eu(){if(--pr===0&&vn!==null){Rl!==null&&(Rl.status="fulfilled");var e=vn;vn=null,Dl=0,Rl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ep(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var n=0;n<a.length;n++)(0,a[n])(t)},function(n){for(l.status="rejected",l.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),l}var Tu=k.S;k.S=function(e,t){df=Ve(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&kp(e,t),Tu!==null&&Tu(e,t)};var nl=b(null);function gr(){var e=nl.current;return e!==null?e:Ue.pooledCache}function zs(e,t){t===null?Q(nl,nl.current):Q(nl,t.pool)}function wu(){var e=gr();return e===null?null:{parent:$e._currentValue,pool:e}}var Ul=Error(o(460)),xr=Error(o(474)),ks=Error(o(542)),Es={then:function(){}};function Cu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Au(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Pt,Pt),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_u(e),e;default:if(typeof t.status=="string")t.then(Pt,Pt);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=l}},function(l){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_u(e),e}throw il=t,Ul}}function sl(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(il=a,Ul):a}}var il=null;function Mu(){if(il===null)throw Error(o(459));var e=il;return il=null,e}function _u(e){if(e===Ul||e===ks)throw Error(o(483))}var Bl=null,jn=0;function Ts(e){var t=jn;return jn+=1,Bl===null&&(Bl=[]),Au(Bl,e,t)}function Sn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ws(e,t){throw t.$$typeof===L?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ou(e){function t(j,v){if(e){var N=j.deletions;N===null?(j.deletions=[v],j.flags|=16):N.push(v)}}function a(j,v){if(!e)return null;for(;v!==null;)t(j,v),v=v.sibling;return null}function l(j){for(var v=new Map;j!==null;)j.key!==null?v.set(j.key,j):v.set(j.index,j),j=j.sibling;return v}function n(j,v){return j=ta(j,v),j.index=0,j.sibling=null,j}function i(j,v,N){return j.index=N,e?(N=j.alternate,N!==null?(N=N.index,N<v?(j.flags|=67108866,v):N):(j.flags|=67108866,v)):(j.flags|=1048576,v)}function c(j){return e&&j.alternate===null&&(j.flags|=67108866),j}function d(j,v,N,O){return v===null||v.tag!==6?(v=sr(N,j.mode,O),v.return=j,v):(v=n(v,N),v.return=j,v)}function g(j,v,N,O){var re=N.type;return re===R?M(j,v,N.props.children,O,N.key):v!==null&&(v.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===V&&sl(re)===v.type)?(v=n(v,N.props),Sn(v,N),v.return=j,v):(v=vs(N.type,N.key,N.props,null,j.mode,O),Sn(v,N),v.return=j,v)}function z(j,v,N,O){return v===null||v.tag!==4||v.stateNode.containerInfo!==N.containerInfo||v.stateNode.implementation!==N.implementation?(v=ir(N,j.mode,O),v.return=j,v):(v=n(v,N.children||[]),v.return=j,v)}function M(j,v,N,O,re){return v===null||v.tag!==7?(v=el(N,j.mode,O,re),v.return=j,v):(v=n(v,N),v.return=j,v)}function U(j,v,N){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=sr(""+v,j.mode,N),v.return=j,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case B:return N=vs(v.type,v.key,v.props,null,j.mode,N),Sn(N,v),N.return=j,N;case Y:return v=ir(v,j.mode,N),v.return=j,v;case V:return v=sl(v),U(j,v,N)}if(Ae(v)||le(v))return v=el(v,j.mode,N,null),v.return=j,v;if(typeof v.then=="function")return U(j,Ts(v),N);if(v.$$typeof===$)return U(j,Ns(j,v),N);ws(j,v)}return null}function E(j,v,N,O){var re=v!==null?v.key:null;if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return re!==null?null:d(j,v,""+N,O);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case B:return N.key===re?g(j,v,N,O):null;case Y:return N.key===re?z(j,v,N,O):null;case V:return N=sl(N),E(j,v,N,O)}if(Ae(N)||le(N))return re!==null?null:M(j,v,N,O,null);if(typeof N.then=="function")return E(j,v,Ts(N),O);if(N.$$typeof===$)return E(j,v,Ns(j,N),O);ws(j,N)}return null}function C(j,v,N,O,re){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return j=j.get(N)||null,d(v,j,""+O,re);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case B:return j=j.get(O.key===null?N:O.key)||null,g(v,j,O,re);case Y:return j=j.get(O.key===null?N:O.key)||null,z(v,j,O,re);case V:return O=sl(O),C(j,v,N,O,re)}if(Ae(O)||le(O))return j=j.get(N)||null,M(v,j,O,re,null);if(typeof O.then=="function")return C(j,v,N,Ts(O),re);if(O.$$typeof===$)return C(j,v,N,Ns(v,O),re);ws(v,O)}return null}function I(j,v,N,O){for(var re=null,Te=null,te=v,xe=v=0,Ne=null;te!==null&&xe<N.length;xe++){te.index>xe?(Ne=te,te=null):Ne=te.sibling;var we=E(j,te,N[xe],O);if(we===null){te===null&&(te=Ne);break}e&&te&&we.alternate===null&&t(j,te),v=i(we,v,xe),Te===null?re=we:Te.sibling=we,Te=we,te=Ne}if(xe===N.length)return a(j,te),ze&&aa(j,xe),re;if(te===null){for(;xe<N.length;xe++)te=U(j,N[xe],O),te!==null&&(v=i(te,v,xe),Te===null?re=te:Te.sibling=te,Te=te);return ze&&aa(j,xe),re}for(te=l(te);xe<N.length;xe++)Ne=C(te,j,xe,N[xe],O),Ne!==null&&(e&&Ne.alternate!==null&&te.delete(Ne.key===null?xe:Ne.key),v=i(Ne,v,xe),Te===null?re=Ne:Te.sibling=Ne,Te=Ne);return e&&te.forEach(function(Ya){return t(j,Ya)}),ze&&aa(j,xe),re}function ue(j,v,N,O){if(N==null)throw Error(o(151));for(var re=null,Te=null,te=v,xe=v=0,Ne=null,we=N.next();te!==null&&!we.done;xe++,we=N.next()){te.index>xe?(Ne=te,te=null):Ne=te.sibling;var Ya=E(j,te,we.value,O);if(Ya===null){te===null&&(te=Ne);break}e&&te&&Ya.alternate===null&&t(j,te),v=i(Ya,v,xe),Te===null?re=Ya:Te.sibling=Ya,Te=Ya,te=Ne}if(we.done)return a(j,te),ze&&aa(j,xe),re;if(te===null){for(;!we.done;xe++,we=N.next())we=U(j,we.value,O),we!==null&&(v=i(we,v,xe),Te===null?re=we:Te.sibling=we,Te=we);return ze&&aa(j,xe),re}for(te=l(te);!we.done;xe++,we=N.next())we=C(te,j,xe,we.value,O),we!==null&&(e&&we.alternate!==null&&te.delete(we.key===null?xe:we.key),v=i(we,v,xe),Te===null?re=we:Te.sibling=we,Te=we);return e&&te.forEach(function(Bg){return t(j,Bg)}),ze&&aa(j,xe),re}function Re(j,v,N,O){if(typeof N=="object"&&N!==null&&N.type===R&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case B:e:{for(var re=N.key;v!==null;){if(v.key===re){if(re=N.type,re===R){if(v.tag===7){a(j,v.sibling),O=n(v,N.props.children),O.return=j,j=O;break e}}else if(v.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===V&&sl(re)===v.type){a(j,v.sibling),O=n(v,N.props),Sn(O,N),O.return=j,j=O;break e}a(j,v);break}else t(j,v);v=v.sibling}N.type===R?(O=el(N.props.children,j.mode,O,N.key),O.return=j,j=O):(O=vs(N.type,N.key,N.props,null,j.mode,O),Sn(O,N),O.return=j,j=O)}return c(j);case Y:e:{for(re=N.key;v!==null;){if(v.key===re)if(v.tag===4&&v.stateNode.containerInfo===N.containerInfo&&v.stateNode.implementation===N.implementation){a(j,v.sibling),O=n(v,N.children||[]),O.return=j,j=O;break e}else{a(j,v);break}else t(j,v);v=v.sibling}O=ir(N,j.mode,O),O.return=j,j=O}return c(j);case V:return N=sl(N),Re(j,v,N,O)}if(Ae(N))return I(j,v,N,O);if(le(N)){if(re=le(N),typeof re!="function")throw Error(o(150));return N=re.call(N),ue(j,v,N,O)}if(typeof N.then=="function")return Re(j,v,Ts(N),O);if(N.$$typeof===$)return Re(j,v,Ns(j,N),O);ws(j,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,v!==null&&v.tag===6?(a(j,v.sibling),O=n(v,N),O.return=j,j=O):(a(j,v),O=sr(N,j.mode,O),O.return=j,j=O),c(j)):a(j,v)}return function(j,v,N,O){try{jn=0;var re=Re(j,v,N,O);return Bl=null,re}catch(te){if(te===Ul||te===ks)throw te;var Te=Et(29,te,null,j.mode);return Te.lanes=O,Te.return=j,Te}finally{}}}var rl=Ou(!0),Du=Ou(!1),ka=!1;function yr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function br(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 Ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ta(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ce&2)!==0){var n=l.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),l.pending=t,t=bs(e),xu(e,null,a),t}return ys(e,l,t,a),bs(e)}function Nn(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,ko(e,a)}}function vr(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var n=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?n=i=c:i=i.next=c,a=a.next}while(a!==null);i===null?n=i=t:i=i.next=t}else n=i=t;a={baseState:l.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var jr=!1;function zn(){if(jr){var e=Rl;if(e!==null)throw e}}function kn(e,t,a,l){jr=!1;var n=e.updateQueue;ka=!1;var i=n.firstBaseUpdate,c=n.lastBaseUpdate,d=n.shared.pending;if(d!==null){n.shared.pending=null;var g=d,z=g.next;g.next=null,c===null?i=z:c.next=z,c=g;var M=e.alternate;M!==null&&(M=M.updateQueue,d=M.lastBaseUpdate,d!==c&&(d===null?M.firstBaseUpdate=z:d.next=z,M.lastBaseUpdate=g))}if(i!==null){var U=n.baseState;c=0,M=z=g=null,d=i;do{var E=d.lane&-536870913,C=E!==d.lane;if(C?(Se&E)===E:(l&E)===E){E!==0&&E===Dl&&(jr=!0),M!==null&&(M=M.next={lane:0,tag:d.tag,payload:d.payload,callback:null,next:null});e:{var I=e,ue=d;E=t;var Re=a;switch(ue.tag){case 1:if(I=ue.payload,typeof I=="function"){U=I.call(Re,U,E);break e}U=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=ue.payload,E=typeof I=="function"?I.call(Re,U,E):I,E==null)break e;U=S({},U,E);break e;case 2:ka=!0}}E=d.callback,E!==null&&(e.flags|=64,C&&(e.flags|=8192),C=n.callbacks,C===null?n.callbacks=[E]:C.push(E))}else C={lane:E,tag:d.tag,payload:d.payload,callback:d.callback,next:null},M===null?(z=M=C,g=U):M=M.next=C,c|=E;if(d=d.next,d===null){if(d=n.shared.pending,d===null)break;C=d,d=C.next,C.next=null,n.lastBaseUpdate=C,n.shared.pending=null}}while(!0);M===null&&(g=U),n.baseState=g,n.firstBaseUpdate=z,n.lastBaseUpdate=M,i===null&&(n.shared.lanes=0),_a|=c,e.lanes=c,e.memoizedState=U}}function Ru(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Uu(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Ru(a[e],t)}var Hl=b(null),Cs=b(0);function Bu(e,t){e=ma,Q(Cs,e),Q(Hl,t),ma=e|t.baseLanes}function Sr(){Q(Cs,ma),Q(Hl,Hl.current)}function Nr(){ma=Cs.current,_(Hl),_(Cs)}var Tt=b(null),Lt=null;function wa(e){var t=e.alternate;Q(Ze,Ze.current&1),Q(Tt,e),Lt===null&&(t===null||Hl.current!==null||t.memoizedState!==null)&&(Lt=e)}function zr(e){Q(Ze,Ze.current),Q(Tt,e),Lt===null&&(Lt=e)}function Hu(e){e.tag===22?(Q(Ze,Ze.current),Q(Tt,e),Lt===null&&(Lt=e)):Ca()}function Ca(){Q(Ze,Ze.current),Q(Tt,Tt.current)}function wt(e){_(Tt),Lt===e&&(Lt=null),_(Ze)}var Ze=b(0);function As(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Ac(a)||Mc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var sa=0,ge=null,Oe=null,We=null,Ms=!1,ql=!1,cl=!1,_s=0,En=0,Ll=null,Tp=0;function Qe(){throw Error(o(321))}function kr(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!kt(e[a],t[a]))return!1;return!0}function Er(e,t,a,l,n,i){return sa=i,ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?jd:Gr,cl=!1,i=a(l,n),cl=!1,ql&&(i=Lu(t,a,l,n)),qu(e),i}function qu(e){k.H=Cn;var t=Oe!==null&&Oe.next!==null;if(sa=0,We=Oe=ge=null,Ms=!1,En=0,Ll=null,t)throw Error(o(300));e===null||Fe||(e=e.dependencies,e!==null&&Ss(e)&&(Fe=!0))}function Lu(e,t,a,l){ge=e;var n=0;do{if(ql&&(Ll=null),En=0,ql=!1,25<=n)throw Error(o(301));if(n+=1,We=Oe=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}k.H=Sd,i=t(a,l)}while(ql);return i}function wp(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Tn(t):t,e=e.useState()[0],(Oe!==null?Oe.memoizedState:null)!==e&&(ge.flags|=1024),t}function Tr(){var e=_s!==0;return _s=0,e}function wr(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Cr(e){if(Ms){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ms=!1}sa=0,We=Oe=ge=null,ql=!1,En=_s=0,Ll=null}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?ge.memoizedState=We=e:We=We.next=e,We}function Ke(){if(Oe===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=We===null?ge.memoizedState:We.next;if(t!==null)We=t,Oe=e;else{if(e===null)throw ge.alternate===null?Error(o(467)):Error(o(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},We===null?ge.memoizedState=We=e:We=We.next=e}return We}function Os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tn(e){var t=En;return En+=1,Ll===null&&(Ll=[]),e=Au(Ll,e,t),t=ge,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?jd:Gr),e}function Ds(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Tn(e);if(e.$$typeof===$)return ct(e)}throw Error(o(438,String(e)))}function Ar(e){var t=null,a=ge.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=ge.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Os(),ge.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=q;return t.index++,a}function ia(e,t){return typeof t=="function"?t(e):t}function Rs(e){var t=Ke();return Mr(t,Oe,e)}function Mr(e,t,a){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=a;var n=e.baseQueue,i=l.pending;if(i!==null){if(n!==null){var c=n.next;n.next=i.next,i.next=c}t.baseQueue=n=i,l.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var d=c=null,g=null,z=t,M=!1;do{var U=z.lane&-536870913;if(U!==z.lane?(Se&U)===U:(sa&U)===U){var E=z.revertLane;if(E===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),U===Dl&&(M=!0);else if((sa&E)===E){z=z.next,E===Dl&&(M=!0);continue}else U={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},g===null?(d=g=U,c=i):g=g.next=U,ge.lanes|=E,_a|=E;U=z.action,cl&&a(i,U),i=z.hasEagerState?z.eagerState:a(i,U)}else E={lane:U,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},g===null?(d=g=E,c=i):g=g.next=E,ge.lanes|=U,_a|=U;z=z.next}while(z!==null&&z!==t);if(g===null?c=i:g.next=d,!kt(i,e.memoizedState)&&(Fe=!0,M&&(a=Rl,a!==null)))throw a;e.memoizedState=i,e.baseState=c,e.baseQueue=g,l.lastRenderedState=i}return n===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function _r(e){var t=Ke(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var l=a.dispatch,n=a.pending,i=t.memoizedState;if(n!==null){a.pending=null;var c=n=n.next;do i=e(i,c.action),c=c.next;while(c!==n);kt(i,t.memoizedState)||(Fe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,l]}function Gu(e,t,a){var l=ge,n=Ke(),i=ze;if(i){if(a===void 0)throw Error(o(407));a=a()}else a=t();var c=!kt((Oe||n).memoizedState,a);if(c&&(n.memoizedState=a,Fe=!0),n=n.queue,Rr(Qu.bind(null,l,n,e),[e]),n.getSnapshot!==t||c||We!==null&&We.memoizedState.tag&1){if(l.flags|=2048,Gl(9,{destroy:void 0},Vu.bind(null,l,n,a,t),null),Ue===null)throw Error(o(349));i||(sa&127)!==0||Yu(l,t,a)}return a}function Yu(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ge.updateQueue,t===null?(t=Os(),ge.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Vu(e,t,a,l){t.value=a,t.getSnapshot=l,Xu(t)&&Zu(e)}function Qu(e,t,a){return a(function(){Xu(t)&&Zu(e)})}function Xu(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!kt(e,a)}catch{return!0}}function Zu(e){var t=Pa(e,2);t!==null&&St(t,e,2)}function Or(e){var t=ht();if(typeof e=="function"){var a=e;if(e=a(),cl){ya(!0);try{a()}finally{ya(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:e},t}function Ku(e,t,a,l){return e.baseState=a,Mr(e,Oe,typeof l=="function"?l:ia)}function Cp(e,t,a,l,n){if(Hs(e))throw Error(o(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){i.listeners.push(c)}};k.T!==null?a(!0):i.isTransition=!1,l(i),a=t.pending,a===null?(i.next=t.pending=i,Ju(t,i)):(i.next=a.next,t.pending=a.next=i)}}function Ju(e,t){var a=t.action,l=t.payload,n=e.state;if(t.isTransition){var i=k.T,c={};k.T=c;try{var d=a(n,l),g=k.S;g!==null&&g(c,d),$u(e,t,d)}catch(z){Dr(e,t,z)}finally{i!==null&&c.types!==null&&(i.types=c.types),k.T=i}}else try{i=a(n,l),$u(e,t,i)}catch(z){Dr(e,t,z)}}function $u(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Wu(e,t,l)},function(l){return Dr(e,t,l)}):Wu(e,t,a)}function Wu(e,t,a){t.status="fulfilled",t.value=a,Fu(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Ju(e,a)))}function Dr(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,Fu(t),t=t.next;while(t!==l)}e.action=null}function Fu(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Iu(e,t){return t}function Pu(e,t){if(ze){var a=Ue.formState;if(a!==null){e:{var l=ge;if(ze){if(Le){t:{for(var n=Le,i=qt;n.nodeType!==8;){if(!i){n=null;break t}if(n=Gt(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Le=Gt(n.nextSibling),l=n.data==="F!";break e}}Na(l)}l=!1}l&&(t=a[0])}}return a=ht(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Iu,lastRenderedState:t},a.queue=l,a=yd.bind(null,ge,l),l.dispatch=a,l=Or(!1),i=Lr.bind(null,ge,!1,l.queue),l=ht(),n={state:t,dispatch:null,action:e,pending:null},l.queue=n,a=Cp.bind(null,ge,n,i,a),n.dispatch=a,l.memoizedState=e,[t,a,!1]}function ed(e){var t=Ke();return td(t,Oe,e)}function td(e,t,a){if(t=Mr(e,t,Iu)[0],e=Rs(ia)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Tn(t)}catch(c){throw c===Ul?ks:c}else l=t;t=Ke();var n=t.queue,i=n.dispatch;return a!==t.memoizedState&&(ge.flags|=2048,Gl(9,{destroy:void 0},Ap.bind(null,n,a),null)),[l,i,e]}function Ap(e,t){e.action=t}function ad(e){var t=Ke(),a=Oe;if(a!==null)return td(t,a,e);Ke(),t=t.memoizedState,a=Ke();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Gl(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=ge.updateQueue,t===null&&(t=Os(),ge.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function ld(){return Ke().memoizedState}function Us(e,t,a,l){var n=ht();ge.flags|=e,n.memoizedState=Gl(1|t,{destroy:void 0},a,l===void 0?null:l)}function Bs(e,t,a,l){var n=Ke();l=l===void 0?null:l;var i=n.memoizedState.inst;Oe!==null&&l!==null&&kr(l,Oe.memoizedState.deps)?n.memoizedState=Gl(t,i,a,l):(ge.flags|=e,n.memoizedState=Gl(1|t,i,a,l))}function nd(e,t){Us(8390656,8,e,t)}function Rr(e,t){Bs(2048,8,e,t)}function Mp(e){ge.flags|=4;var t=ge.updateQueue;if(t===null)t=Os(),ge.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function sd(e){var t=Ke().memoizedState;return Mp({ref:t,nextImpl:e}),function(){if((Ce&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function id(e,t){return Bs(4,2,e,t)}function rd(e,t){return Bs(4,4,e,t)}function cd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function od(e,t,a){a=a!=null?a.concat([e]):null,Bs(4,4,cd.bind(null,t,e),a)}function Ur(){}function ud(e,t){var a=Ke();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&kr(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function dd(e,t){var a=Ke();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&kr(t,l[1]))return l[0];if(l=e(),cl){ya(!0);try{e()}finally{ya(!1)}}return a.memoizedState=[l,t],l}function Br(e,t,a){return a===void 0||(sa&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=mf(),ge.lanes|=e,_a|=e,a)}function fd(e,t,a,l){return kt(a,t)?a:Hl.current!==null?(e=Br(e,a,l),kt(e,t)||(Fe=!0),e):(sa&42)===0||(sa&1073741824)!==0&&(Se&261930)===0?(Fe=!0,e.memoizedState=a):(e=mf(),ge.lanes|=e,_a|=e,t)}function md(e,t,a,l,n){var i=H.p;H.p=i!==0&&8>i?i:8;var c=k.T,d={};k.T=d,Lr(e,!1,t,a);try{var g=n(),z=k.S;if(z!==null&&z(d,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var M=Ep(g,l);wn(e,t,M,Mt(e))}else wn(e,t,l,Mt(e))}catch(U){wn(e,t,{then:function(){},status:"rejected",reason:U},Mt())}finally{H.p=i,c!==null&&d.types!==null&&(c.types=d.types),k.T=c}}function _p(){}function Hr(e,t,a,l){if(e.tag!==5)throw Error(o(476));var n=hd(e).queue;md(e,n,t,F,a===null?_p:function(){return pd(e),a(l)})}function hd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:F},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pd(e){var t=hd(e);t.next===null&&(t=e.alternate.memoizedState),wn(e,t.next.queue,{},Mt())}function qr(){return ct(Xn)}function gd(){return Ke().memoizedState}function xd(){return Ke().memoizedState}function Op(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Mt();e=Ea(a);var l=Ta(t,e,a);l!==null&&(St(l,t,a),Nn(l,t,a)),t={cache:hr()},e.payload=t;return}t=t.return}}function Dp(e,t,a){var l=Mt();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hs(e)?bd(t,a):(a=lr(e,t,a,l),a!==null&&(St(a,e,l),vd(a,t,l)))}function yd(e,t,a){var l=Mt();wn(e,t,a,l)}function wn(e,t,a,l){var n={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))bd(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,d=i(c,a);if(n.hasEagerState=!0,n.eagerState=d,kt(d,c))return ys(e,t,n,0),Ue===null&&xs(),!1}catch{}finally{}if(a=lr(e,t,n,l),a!==null)return St(a,e,l),vd(a,t,l),!0}return!1}function Lr(e,t,a,l){if(l={lane:2,revertLane:yc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(o(479))}else t=lr(e,a,l,2),t!==null&&St(t,e,2)}function Hs(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function bd(e,t){ql=Ms=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function vd(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,ko(e,a)}}var Cn={readContext:ct,use:Ds,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};Cn.useEffectEvent=Qe;var jd={readContext:ct,use:Ds,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:nd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Us(4194308,4,cd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Us(4194308,4,e,t)},useInsertionEffect:function(e,t){Us(4,2,e,t)},useMemo:function(e,t){var a=ht();t=t===void 0?null:t;var l=e();if(cl){ya(!0);try{e()}finally{ya(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=ht();if(a!==void 0){var n=a(t);if(cl){ya(!0);try{a(t)}finally{ya(!1)}}}else n=t;return l.memoizedState=l.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=Dp.bind(null,ge,e),[l.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:function(e){e=Or(e);var t=e.queue,a=yd.bind(null,ge,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ur,useDeferredValue:function(e,t){var a=ht();return Br(a,e,t)},useTransition:function(){var e=Or(!1);return e=md.bind(null,ge,e.queue,!0,!1),ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=ge,n=ht();if(ze){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),Ue===null)throw Error(o(349));(Se&127)!==0||Yu(l,t,a)}n.memoizedState=a;var i={value:a,getSnapshot:t};return n.queue=i,nd(Qu.bind(null,l,i,e),[e]),l.flags|=2048,Gl(9,{destroy:void 0},Vu.bind(null,l,i,a,t),null),a},useId:function(){var e=ht(),t=Ue.identifierPrefix;if(ze){var a=$t,l=Jt;a=(l&~(1<<32-zt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=_s++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Tp++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:qr,useFormState:Pu,useActionState:Pu,useOptimistic:function(e){var t=ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Lr.bind(null,ge,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ar,useCacheRefresh:function(){return ht().memoizedState=Op.bind(null,ge)},useEffectEvent:function(e){var t=ht(),a={impl:e};return t.memoizedState=a,function(){if((Ce&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},Gr={readContext:ct,use:Ds,useCallback:ud,useContext:ct,useEffect:Rr,useImperativeHandle:od,useInsertionEffect:id,useLayoutEffect:rd,useMemo:dd,useReducer:Rs,useRef:ld,useState:function(){return Rs(ia)},useDebugValue:Ur,useDeferredValue:function(e,t){var a=Ke();return fd(a,Oe.memoizedState,e,t)},useTransition:function(){var e=Rs(ia)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:Tn(e),t]},useSyncExternalStore:Gu,useId:gd,useHostTransitionStatus:qr,useFormState:ed,useActionState:ed,useOptimistic:function(e,t){var a=Ke();return Ku(a,Oe,e,t)},useMemoCache:Ar,useCacheRefresh:xd};Gr.useEffectEvent=sd;var Sd={readContext:ct,use:Ds,useCallback:ud,useContext:ct,useEffect:Rr,useImperativeHandle:od,useInsertionEffect:id,useLayoutEffect:rd,useMemo:dd,useReducer:_r,useRef:ld,useState:function(){return _r(ia)},useDebugValue:Ur,useDeferredValue:function(e,t){var a=Ke();return Oe===null?Br(a,e,t):fd(a,Oe.memoizedState,e,t)},useTransition:function(){var e=_r(ia)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:Tn(e),t]},useSyncExternalStore:Gu,useId:gd,useHostTransitionStatus:qr,useFormState:ad,useActionState:ad,useOptimistic:function(e,t){var a=Ke();return Oe!==null?Ku(a,Oe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ar,useCacheRefresh:xd};Sd.useEffectEvent=sd;function Yr(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:S({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Vr={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Mt(),n=Ea(l);n.payload=t,a!=null&&(n.callback=a),t=Ta(e,n,l),t!==null&&(St(t,e,l),Nn(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Mt(),n=Ea(l);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Ta(e,n,l),t!==null&&(St(t,e,l),Nn(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Mt(),l=Ea(a);l.tag=2,t!=null&&(l.callback=t),t=Ta(e,l,a),t!==null&&(St(t,e,a),Nn(t,e,a))}};function Nd(e,t,a,l,n,i,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,c):t.prototype&&t.prototype.isPureReactComponent?!pn(a,l)||!pn(n,i):!0}function zd(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Vr.enqueueReplaceState(t,t.state,null)}function ol(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=S({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function kd(e){gs(e)}function Ed(e){console.error(e)}function Td(e){gs(e)}function qs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function wd(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Qr(e,t,a){return a=Ea(a),a.tag=3,a.payload={element:null},a.callback=function(){qs(e,t)},a}function Cd(e){return e=Ea(e),e.tag=3,e}function Ad(e,t,a,l){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var i=l.value;e.payload=function(){return n(i)},e.callback=function(){wd(t,a,l)}}var c=a.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){wd(t,a,l),typeof n!="function"&&(Oa===null?Oa=new Set([this]):Oa.add(this));var d=l.stack;this.componentDidCatch(l.value,{componentStack:d!==null?d:""})})}function Rp(e,t,a,l,n){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Ol(t,a,n,!0),a=Tt.current,a!==null){switch(a.tag){case 31:case 13:return Lt===null?Fs():a.alternate===null&&Xe===0&&(Xe=3),a.flags&=-257,a.flags|=65536,a.lanes=n,l===Es?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),pc(e,l,n)),!1;case 22:return a.flags|=65536,l===Es?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),pc(e,l,n)),!1}throw Error(o(435,a.tag))}return pc(e,l,n),Fs(),!1}if(ze)return t=Tt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,l!==or&&(e=Error(o(422),{cause:l}),yn(Ut(e,a)))):(l!==or&&(t=Error(o(423),{cause:l}),yn(Ut(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,l=Ut(l,a),n=Qr(e.stateNode,l,n),vr(e,n),Xe!==4&&(Xe=2)),!1;var i=Error(o(520),{cause:l});if(i=Ut(i,a),Bn===null?Bn=[i]:Bn.push(i),Xe!==4&&(Xe=2),t===null)return!0;l=Ut(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=Qr(a.stateNode,l,e),vr(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Oa===null||!Oa.has(i))))return a.flags|=65536,n&=-n,a.lanes|=n,n=Cd(n),Ad(n,e,a,l),vr(a,n),!1}a=a.return}while(a!==null);return!1}var Xr=Error(o(461)),Fe=!1;function ot(e,t,a,l){t.child=e===null?Du(t,null,a,l):rl(t,e.child,a,l)}function Md(e,t,a,l,n){a=a.render;var i=t.ref;if("ref"in l){var c={};for(var d in l)d!=="ref"&&(c[d]=l[d])}else c=l;return ll(t),l=Er(e,t,a,c,i,n),d=Tr(),e!==null&&!Fe?(wr(e,t,n),ra(e,t,n)):(ze&&d&&rr(t),t.flags|=1,ot(e,t,l,n),t.child)}function _d(e,t,a,l,n){if(e===null){var i=a.type;return typeof i=="function"&&!nr(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Od(e,t,i,l,n)):(e=vs(a.type,null,l,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Pr(e,n)){var c=i.memoizedProps;if(a=a.compare,a=a!==null?a:pn,a(c,l)&&e.ref===t.ref)return ra(e,t,n)}return t.flags|=1,e=ta(i,l),e.ref=t.ref,e.return=t,t.child=e}function Od(e,t,a,l,n){if(e!==null){var i=e.memoizedProps;if(pn(i,l)&&e.ref===t.ref)if(Fe=!1,t.pendingProps=l=i,Pr(e,n))(e.flags&131072)!==0&&(Fe=!0);else return t.lanes=e.lanes,ra(e,t,n)}return Zr(e,t,a,l,n)}function Dd(e,t,a,l){var n=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(l=t.child=e.child,n=0;l!==null;)n=n|l.lanes|l.childLanes,l=l.sibling;l=n&~i}else l=0,t.child=null;return Rd(e,t,i,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&zs(t,i!==null?i.cachePool:null),i!==null?Bu(t,i):Sr(),Hu(t);else return l=t.lanes=536870912,Rd(e,t,i!==null?i.baseLanes|a:a,a,l)}else i!==null?(zs(t,i.cachePool),Bu(t,i),Ca(),t.memoizedState=null):(e!==null&&zs(t,null),Sr(),Ca());return ot(e,t,n,a),t.child}function An(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rd(e,t,a,l,n){var i=gr();return i=i===null?null:{parent:$e._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&zs(t,null),Sr(),Hu(t),e!==null&&Ol(e,t,l,!0),t.childLanes=n,null}function Ls(e,t){return t=Ys({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ud(e,t,a){return rl(t,e.child,null,a),e=Ls(t,t.pendingProps),e.flags|=2,wt(t),t.memoizedState=null,e}function Up(e,t,a){var l=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(l.mode==="hidden")return e=Ls(t,l),t.lanes=536870912,An(null,e);if(zr(t),(e=Le)?(e=$f(e,qt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ja!==null?{id:Jt,overflow:$t}:null,retryLane:536870912,hydrationErrors:null},a=bu(e),a.return=t,t.child=a,rt=t,Le=null)):e=null,e===null)throw Na(t);return t.lanes=536870912,null}return Ls(t,l)}var i=e.memoizedState;if(i!==null){var c=i.dehydrated;if(zr(t),n)if(t.flags&256)t.flags&=-257,t=Ud(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Fe||Ol(e,t,a,!1),n=(a&e.childLanes)!==0,Fe||n){if(l=Ue,l!==null&&(c=Eo(l,a),c!==0&&c!==i.retryLane))throw i.retryLane=c,Pa(e,c),St(l,e,c),Xr;Fs(),t=Ud(e,t,a)}else e=i.treeContext,Le=Gt(c.nextSibling),rt=t,ze=!0,Sa=null,qt=!1,e!==null&&Su(t,e),t=Ls(t,l),t.flags|=4096;return t}return e=ta(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gs(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Zr(e,t,a,l,n){return ll(t),a=Er(e,t,a,l,void 0,n),l=Tr(),e!==null&&!Fe?(wr(e,t,n),ra(e,t,n)):(ze&&l&&rr(t),t.flags|=1,ot(e,t,a,n),t.child)}function Bd(e,t,a,l,n,i){return ll(t),t.updateQueue=null,a=Lu(t,l,a,n),qu(e),l=Tr(),e!==null&&!Fe?(wr(e,t,i),ra(e,t,i)):(ze&&l&&rr(t),t.flags|=1,ot(e,t,a,i),t.child)}function Hd(e,t,a,l,n){if(ll(t),t.stateNode===null){var i=Cl,c=a.contextType;typeof c=="object"&&c!==null&&(i=ct(c)),i=new a(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Vr,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},yr(t),c=a.contextType,i.context=typeof c=="object"&&c!==null?ct(c):Cl,i.state=t.memoizedState,c=a.getDerivedStateFromProps,typeof c=="function"&&(Yr(t,a,c,l),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(c=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),c!==i.state&&Vr.enqueueReplaceState(i,i.state,null),kn(t,l,i,n),zn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var d=t.memoizedProps,g=ol(a,d);i.props=g;var z=i.context,M=a.contextType;c=Cl,typeof M=="object"&&M!==null&&(c=ct(M));var U=a.getDerivedStateFromProps;M=typeof U=="function"||typeof i.getSnapshotBeforeUpdate=="function",d=t.pendingProps!==d,M||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d||z!==c)&&zd(t,i,l,c),ka=!1;var E=t.memoizedState;i.state=E,kn(t,l,i,n),zn(),z=t.memoizedState,d||E!==z||ka?(typeof U=="function"&&(Yr(t,a,U,l),z=t.memoizedState),(g=ka||Nd(t,a,g,l,E,z,c))?(M||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=z),i.props=l,i.state=z,i.context=c,l=g):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,br(e,t),c=t.memoizedProps,M=ol(a,c),i.props=M,U=t.pendingProps,E=i.context,z=a.contextType,g=Cl,typeof z=="object"&&z!==null&&(g=ct(z)),d=a.getDerivedStateFromProps,(z=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(c!==U||E!==g)&&zd(t,i,l,g),ka=!1,E=t.memoizedState,i.state=E,kn(t,l,i,n),zn();var C=t.memoizedState;c!==U||E!==C||ka||e!==null&&e.dependencies!==null&&Ss(e.dependencies)?(typeof d=="function"&&(Yr(t,a,d,l),C=t.memoizedState),(M=ka||Nd(t,a,M,l,E,C,g)||e!==null&&e.dependencies!==null&&Ss(e.dependencies))?(z||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,C,g),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,C,g)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&E===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&E===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=C),i.props=l,i.state=C,i.context=g,l=M):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&E===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&E===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,Gs(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=rl(t,e.child,null,n),t.child=rl(t,null,a,n)):ot(e,t,a,n),t.memoizedState=i.state,e=t.child):e=ra(e,t,n),e}function qd(e,t,a,l){return tl(),t.flags|=256,ot(e,t,a,l),t.child}var Kr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jr(e){return{baseLanes:e,cachePool:wu()}}function $r(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=At),e}function Ld(e,t,a){var l=t.pendingProps,n=!1,i=(t.flags&128)!==0,c;if((c=i)||(c=e!==null&&e.memoizedState===null?!1:(Ze.current&2)!==0),c&&(n=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(n?wa(t):Ca(),(e=Le)?(e=$f(e,qt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ja!==null?{id:Jt,overflow:$t}:null,retryLane:536870912,hydrationErrors:null},a=bu(e),a.return=t,t.child=a,rt=t,Le=null)):e=null,e===null)throw Na(t);return Mc(e)?t.lanes=32:t.lanes=536870912,null}var d=l.children;return l=l.fallback,n?(Ca(),n=t.mode,d=Ys({mode:"hidden",children:d},n),l=el(l,n,a,null),d.return=t,l.return=t,d.sibling=l,t.child=d,l=t.child,l.memoizedState=Jr(a),l.childLanes=$r(e,c,a),t.memoizedState=Kr,An(null,l)):(wa(t),Wr(t,d))}var g=e.memoizedState;if(g!==null&&(d=g.dehydrated,d!==null)){if(i)t.flags&256?(wa(t),t.flags&=-257,t=Fr(e,t,a)):t.memoizedState!==null?(Ca(),t.child=e.child,t.flags|=128,t=null):(Ca(),d=l.fallback,n=t.mode,l=Ys({mode:"visible",children:l.children},n),d=el(d,n,a,null),d.flags|=2,l.return=t,d.return=t,l.sibling=d,t.child=l,rl(t,e.child,null,a),l=t.child,l.memoizedState=Jr(a),l.childLanes=$r(e,c,a),t.memoizedState=Kr,t=An(null,l));else if(wa(t),Mc(d)){if(c=d.nextSibling&&d.nextSibling.dataset,c)var z=c.dgst;c=z,l=Error(o(419)),l.stack="",l.digest=c,yn({value:l,source:null,stack:null}),t=Fr(e,t,a)}else if(Fe||Ol(e,t,a,!1),c=(a&e.childLanes)!==0,Fe||c){if(c=Ue,c!==null&&(l=Eo(c,a),l!==0&&l!==g.retryLane))throw g.retryLane=l,Pa(e,l),St(c,e,l),Xr;Ac(d)||Fs(),t=Fr(e,t,a)}else Ac(d)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,Le=Gt(d.nextSibling),rt=t,ze=!0,Sa=null,qt=!1,e!==null&&Su(t,e),t=Wr(t,l.children),t.flags|=4096);return t}return n?(Ca(),d=l.fallback,n=t.mode,g=e.child,z=g.sibling,l=ta(g,{mode:"hidden",children:l.children}),l.subtreeFlags=g.subtreeFlags&65011712,z!==null?d=ta(z,d):(d=el(d,n,a,null),d.flags|=2),d.return=t,l.return=t,l.sibling=d,t.child=l,An(null,l),l=t.child,d=e.child.memoizedState,d===null?d=Jr(a):(n=d.cachePool,n!==null?(g=$e._currentValue,n=n.parent!==g?{parent:g,pool:g}:n):n=wu(),d={baseLanes:d.baseLanes|a,cachePool:n}),l.memoizedState=d,l.childLanes=$r(e,c,a),t.memoizedState=Kr,An(e.child,l)):(wa(t),a=e.child,e=a.sibling,a=ta(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=a,t.memoizedState=null,a)}function Wr(e,t){return t=Ys({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ys(e,t){return e=Et(22,e,null,t),e.lanes=0,e}function Fr(e,t,a){return rl(t,e.child,null,a),e=Wr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gd(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),fr(e.return,t,a)}function Ir(e,t,a,l,n,i){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:n,treeForkCount:i}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=l,c.tail=a,c.tailMode=n,c.treeForkCount=i)}function Yd(e,t,a){var l=t.pendingProps,n=l.revealOrder,i=l.tail;l=l.children;var c=Ze.current,d=(c&2)!==0;if(d?(c=c&1|2,t.flags|=128):c&=1,Q(Ze,c),ot(e,t,l,a),l=ze?xn:0,!d&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gd(e,a,t);else if(e.tag===19)Gd(e,a,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}switch(n){case"forwards":for(a=t.child,n=null;a!==null;)e=a.alternate,e!==null&&As(e)===null&&(n=a),a=a.sibling;a=n,a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),Ir(t,!1,n,a,i,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&As(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}Ir(t,!0,a,null,i,l);break;case"together":Ir(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ra(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),_a|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Ol(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=ta(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ta(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Pr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ss(e)))}function Bp(e,t,a){switch(t.tag){case 3:Je(t,t.stateNode.containerInfo),za(t,$e,e.memoizedState.cache),tl();break;case 27:case 5:Kt(t);break;case 4:Je(t,t.stateNode.containerInfo);break;case 10:za(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zr(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(wa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Ld(e,t,a):(wa(t),e=ra(e,t,a),e!==null?e.sibling:null);wa(t);break;case 19:var n=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(Ol(e,t,a,!1),l=(a&t.childLanes)!==0),n){if(l)return Yd(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Q(Ze,Ze.current),l)break;return null;case 22:return t.lanes=0,Dd(e,t,a,t.pendingProps);case 24:za(t,$e,e.memoizedState.cache)}return ra(e,t,a)}function Vd(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Fe=!0;else{if(!Pr(e,a)&&(t.flags&128)===0)return Fe=!1,Bp(e,t,a);Fe=(e.flags&131072)!==0}else Fe=!1,ze&&(t.flags&1048576)!==0&&ju(t,xn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=sl(t.elementType),t.type=e,typeof e=="function")nr(e)?(l=ol(e,l),t.tag=1,t=Hd(null,t,e,l,a)):(t.tag=0,t=Zr(null,t,e,l,a));else{if(e!=null){var n=e.$$typeof;if(n===fe){t.tag=11,t=Md(null,t,e,l,a);break e}else if(n===ae){t.tag=14,t=_d(null,t,e,l,a);break e}}throw t=Ee(e)||e,Error(o(306,t,""))}}return t;case 0:return Zr(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,n=ol(l,t.pendingProps),Hd(e,t,l,n,a);case 3:e:{if(Je(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var i=t.memoizedState;n=i.element,br(e,t),kn(t,l,null,a);var c=t.memoizedState;if(l=c.cache,za(t,$e,l),l!==i.cache&&mr(t,[$e],a,!0),zn(),l=c.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=qd(e,t,l,a);break e}else if(l!==n){n=Ut(Error(o(424)),t),yn(n),t=qd(e,t,l,a);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(Le=Gt(e.firstChild),rt=t,ze=!0,Sa=null,qt=!0,a=Du(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(tl(),l===n){t=ra(e,t,a);break e}ot(e,t,l,a)}t=t.child}return t;case 26:return Gs(e,t),e===null?(a=tm(t.type,null,t.pendingProps,null))?t.memoizedState=a:ze||(a=t.type,e=t.pendingProps,l=ni(ie.current).createElement(a),l[it]=t,l[gt]=e,ut(l,a,e),lt(l),t.stateNode=l):t.memoizedState=tm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Kt(t),e===null&&ze&&(l=t.stateNode=If(t.type,t.pendingProps,ie.current),rt=t,qt=!0,n=Le,Ba(t.type)?(_c=n,Le=Gt(l.firstChild)):Le=n),ot(e,t,t.pendingProps.children,a),Gs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((n=l=Le)&&(l=mg(l,t.type,t.pendingProps,qt),l!==null?(t.stateNode=l,rt=t,Le=Gt(l.firstChild),qt=!1,n=!0):n=!1),n||Na(t)),Kt(t),n=t.type,i=t.pendingProps,c=e!==null?e.memoizedProps:null,l=i.children,Tc(n,i)?l=null:c!==null&&Tc(n,c)&&(t.flags|=32),t.memoizedState!==null&&(n=Er(e,t,wp,null,null,a),Xn._currentValue=n),Gs(e,t),ot(e,t,l,a),t.child;case 6:return e===null&&ze&&((e=a=Le)&&(a=hg(a,t.pendingProps,qt),a!==null?(t.stateNode=a,rt=t,Le=null,e=!0):e=!1),e||Na(t)),null;case 13:return Ld(e,t,a);case 4:return Je(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=rl(t,null,l,a):ot(e,t,l,a),t.child;case 11:return Md(e,t,t.type,t.pendingProps,a);case 7:return ot(e,t,t.pendingProps,a),t.child;case 8:return ot(e,t,t.pendingProps.children,a),t.child;case 12:return ot(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,za(t,t.type,l.value),ot(e,t,l.children,a),t.child;case 9:return n=t.type._context,l=t.pendingProps.children,ll(t),n=ct(n),l=l(n),t.flags|=1,ot(e,t,l,a),t.child;case 14:return _d(e,t,t.type,t.pendingProps,a);case 15:return Od(e,t,t.type,t.pendingProps,a);case 19:return Yd(e,t,a);case 31:return Up(e,t,a);case 22:return Dd(e,t,a,t.pendingProps);case 24:return ll(t),l=ct($e),e===null?(n=gr(),n===null&&(n=Ue,i=hr(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=a),n=i),t.memoizedState={parent:l,cache:n},yr(t),za(t,$e,n)):((e.lanes&a)!==0&&(br(e,t),kn(t,null,null,a),zn()),n=e.memoizedState,i=t.memoizedState,n.parent!==l?(n={parent:l,cache:l},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),za(t,$e,l)):(l=i.cache,za(t,$e,l),l!==n.cache&&mr(t,[$e],a,!0))),ot(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ca(e){e.flags|=4}function ec(e,t,a,l,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(xf())e.flags|=8192;else throw il=Es,xr}else e.flags&=-16777217}function Qd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!im(t))if(xf())e.flags|=8192;else throw il=Es,xr}function Vs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?No():536870912,e.lanes|=t,Xl|=t)}function Mn(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Ge(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var n=e.child;n!==null;)a|=n.lanes|n.childLanes,l|=n.subtreeFlags&65011712,l|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)a|=n.lanes|n.childLanes,l|=n.subtreeFlags,l|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function Hp(e,t,a){var l=t.pendingProps;switch(cr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return Ge(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),na($e),pe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(_l(t)?ca(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ur())),Ge(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(ca(t),i!==null?(Ge(t),Qd(t,i)):(Ge(t),ec(t,n,null,l,a))):i?i!==e.memoizedState?(ca(t),Ge(t),Qd(t,i)):(Ge(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&ca(t),Ge(t),ec(t,n,e,l,a)),null;case 27:if(et(t),a=ie.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ca(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Ge(t),null}e=J.current,_l(t)?Nu(t):(e=If(n,l,a),t.stateNode=e,ca(t))}return Ge(t),null;case 5:if(et(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ca(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Ge(t),null}if(i=J.current,_l(t))Nu(t);else{var c=ni(ie.current);switch(i){case 1:i=c.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=c.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=c.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=c.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?c.createElement("select",{is:l.is}):c.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?c.createElement(n,{is:l.is}):c.createElement(n)}}i[it]=t,i[gt]=l;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=i;e:switch(ut(i,n,l),n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ca(t)}}return Ge(t),ec(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&ca(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=ie.current,_l(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,n=rt,n!==null)switch(n.tag){case 27:case 5:l=n.memoizedProps}e[it]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Gf(e.nodeValue,a)),e||Na(t,!0)}else e=ni(e).createTextNode(l),e[it]=t,t.stateNode=e}return Ge(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=_l(t),a!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[it]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),e=!1}else a=ur(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(wt(t),t):(wt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Ge(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=_l(t),l!==null&&l.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[it]=t}else tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),n=!1}else n=ur(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(wt(t),t):(wt(t),null)}return wt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,n=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(n=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==n&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Vs(t,t.updateQueue),Ge(t),null);case 4:return pe(),e===null&&Sc(t.stateNode.containerInfo),Ge(t),null;case 10:return na(t.type),Ge(t),null;case 19:if(_(Ze),l=t.memoizedState,l===null)return Ge(t),null;if(n=(t.flags&128)!==0,i=l.rendering,i===null)if(n)Mn(l,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=As(e),i!==null){for(t.flags|=128,Mn(l,!1),e=i.updateQueue,t.updateQueue=e,Vs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)yu(a,e),a=a.sibling;return Q(Ze,Ze.current&1|2),ze&&aa(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ve()>Js&&(t.flags|=128,n=!0,Mn(l,!1),t.lanes=4194304)}else{if(!n)if(e=As(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Vs(t,e),Mn(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!ze)return Ge(t),null}else 2*Ve()-l.renderingStartTime>Js&&a!==536870912&&(t.flags|=128,n=!0,Mn(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ve(),e.sibling=null,a=Ze.current,Q(Ze,n?a&1|2:a&1),ze&&aa(t,l.treeForkCount),e):(Ge(t),null);case 22:case 23:return wt(t),Nr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),a=t.updateQueue,a!==null&&Vs(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&_(nl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),na($e),Ge(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function qp(e,t){switch(cr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return na($e),pe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return et(t),null;case 31:if(t.memoizedState!==null){if(wt(t),t.alternate===null)throw Error(o(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _(Ze),null;case 4:return pe(),null;case 10:return na(t.type),null;case 22:case 23:return wt(t),Nr(),e!==null&&_(nl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return na($e),null;case 25:return null;default:return null}}function Xd(e,t){switch(cr(t),t.tag){case 3:na($e),pe();break;case 26:case 27:case 5:et(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&wt(t);break;case 13:wt(t);break;case 19:_(Ze);break;case 10:na(t.type);break;case 22:case 23:wt(t),Nr(),e!==null&&_(nl);break;case 24:na($e)}}function _n(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var n=l.next;a=n;do{if((a.tag&e)===e){l=void 0;var i=a.create,c=a.inst;l=i(),c.destroy=l}a=a.next}while(a!==n)}}catch(d){_e(t,t.return,d)}}function Aa(e,t,a){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var i=n.next;l=i;do{if((l.tag&e)===e){var c=l.inst,d=c.destroy;if(d!==void 0){c.destroy=void 0,n=t;var g=a,z=d;try{z()}catch(M){_e(n,g,M)}}}l=l.next}while(l!==i)}}catch(M){_e(t,t.return,M)}}function Zd(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Uu(t,a)}catch(l){_e(e,e.return,l)}}}function Kd(e,t,a){a.props=ol(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){_e(e,t,l)}}function On(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(n){_e(e,t,n)}}function Wt(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(n){_e(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){_e(e,t,n)}else a.current=null}function Jd(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(n){_e(e,e.return,n)}}function tc(e,t,a){try{var l=e.stateNode;rg(l,e.type,a,t),l[gt]=t}catch(n){_e(e,e.return,n)}}function $d(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ba(e.type)||e.tag===4}function ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$d(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&&Ba(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 lc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Pt));else if(l!==4&&(l===27&&Ba(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(lc(e,t,a),e=e.sibling;e!==null;)lc(e,t,a),e=e.sibling}function Qs(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&Ba(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Qs(e,t,a),e=e.sibling;e!==null;)Qs(e,t,a),e=e.sibling}function Wd(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);ut(t,l,a),t[it]=e,t[gt]=a}catch(i){_e(e,e.return,i)}}var oa=!1,Ie=!1,nc=!1,Fd=typeof WeakSet=="function"?WeakSet:Set,nt=null;function Lp(e,t){if(e=e.containerInfo,kc=di,e=ou(e),Fi(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var n=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var c=0,d=-1,g=-1,z=0,M=0,U=e,E=null;t:for(;;){for(var C;U!==a||n!==0&&U.nodeType!==3||(d=c+n),U!==i||l!==0&&U.nodeType!==3||(g=c+l),U.nodeType===3&&(c+=U.nodeValue.length),(C=U.firstChild)!==null;)E=U,U=C;for(;;){if(U===e)break t;if(E===a&&++z===n&&(d=c),E===i&&++M===l&&(g=c),(C=U.nextSibling)!==null)break;U=E,E=U.parentNode}U=C}a=d===-1||g===-1?null:{start:d,end:g}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ec={focusedElem:e,selectionRange:a},di=!1,nt=t;nt!==null;)if(t=nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nt=e;else for(;nt!==null;){switch(t=nt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)n=e[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,n=i.memoizedProps,i=i.memoizedState,l=a.stateNode;try{var I=ol(a.type,n);e=l.getSnapshotBeforeUpdate(I,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(ue){_e(a,a.return,ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Cc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Cc(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,nt=e;break}nt=t.return}}function Id(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:da(e,a),l&4&&_n(5,a);break;case 1:if(da(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(c){_e(a,a.return,c)}else{var n=ol(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){_e(a,a.return,c)}}l&64&&Zd(a),l&512&&On(a,a.return);break;case 3:if(da(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Uu(e,t)}catch(c){_e(a,a.return,c)}}break;case 27:t===null&&l&4&&Wd(a);case 26:case 5:da(e,a),t===null&&l&4&&Jd(a),l&512&&On(a,a.return);break;case 12:da(e,a);break;case 31:da(e,a),l&4&&tf(e,a);break;case 13:da(e,a),l&4&&af(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=$p.bind(null,a),pg(e,a))));break;case 22:if(l=a.memoizedState!==null||oa,!l){t=t!==null&&t.memoizedState!==null||Ie,n=oa;var i=Ie;oa=l,(Ie=t)&&!i?fa(e,a,(a.subtreeFlags&8772)!==0):da(e,a),oa=n,Ie=i}break;case 30:break;default:da(e,a)}}function Pd(e){var t=e.alternate;t!==null&&(e.alternate=null,Pd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Di(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 Ye=null,yt=!1;function ua(e,t,a){for(a=a.child;a!==null;)ef(e,t,a),a=a.sibling}function ef(e,t,a){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(an,a)}catch{}switch(a.tag){case 26:Ie||Wt(a,t),ua(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ie||Wt(a,t);var l=Ye,n=yt;Ba(a.type)&&(Ye=a.stateNode,yt=!1),ua(e,t,a),Yn(a.stateNode),Ye=l,yt=n;break;case 5:Ie||Wt(a,t);case 6:if(l=Ye,n=yt,Ye=null,ua(e,t,a),Ye=l,yt=n,Ye!==null)if(yt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(a.stateNode)}catch(i){_e(a,t,i)}else try{Ye.removeChild(a.stateNode)}catch(i){_e(a,t,i)}break;case 18:Ye!==null&&(yt?(e=Ye,Kf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Pl(e)):Kf(Ye,a.stateNode));break;case 4:l=Ye,n=yt,Ye=a.stateNode.containerInfo,yt=!0,ua(e,t,a),Ye=l,yt=n;break;case 0:case 11:case 14:case 15:Aa(2,a,t),Ie||Aa(4,a,t),ua(e,t,a);break;case 1:Ie||(Wt(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Kd(a,t,l)),ua(e,t,a);break;case 21:ua(e,t,a);break;case 22:Ie=(l=Ie)||a.memoizedState!==null,ua(e,t,a),Ie=l;break;default:ua(e,t,a)}}function tf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pl(e)}catch(a){_e(t,t.return,a)}}}function af(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pl(e)}catch(a){_e(t,t.return,a)}}function Gp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fd),t;default:throw Error(o(435,e.tag))}}function Xs(e,t){var a=Gp(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var n=Wp.bind(null,e,l);l.then(n,n)}})}function bt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var n=a[l],i=e,c=t,d=c;e:for(;d!==null;){switch(d.tag){case 27:if(Ba(d.type)){Ye=d.stateNode,yt=!1;break e}break;case 5:Ye=d.stateNode,yt=!1;break e;case 3:case 4:Ye=d.stateNode.containerInfo,yt=!0;break e}d=d.return}if(Ye===null)throw Error(o(160));ef(i,c,n),Ye=null,yt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)lf(t,e),t=t.sibling}var Xt=null;function lf(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bt(t,e),vt(e),l&4&&(Aa(3,e,e.return),_n(3,e),Aa(5,e,e.return));break;case 1:bt(t,e),vt(e),l&512&&(Ie||a===null||Wt(a,a.return)),l&64&&oa&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var n=Xt;if(bt(t,e),vt(e),l&512&&(Ie||a===null||Wt(a,a.return)),l&4){var i=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,n=n.ownerDocument||n;t:switch(l){case"title":i=n.getElementsByTagName("title")[0],(!i||i[sn]||i[it]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(l),n.head.insertBefore(i,n.querySelector("head > title"))),ut(i,l,a),i[it]=e,lt(i),l=i;break e;case"link":var c=nm("link","href",n).get(l+(a.href||""));if(c){for(var d=0;d<c.length;d++)if(i=c[d],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){c.splice(d,1);break t}}i=n.createElement(l),ut(i,l,a),n.head.appendChild(i);break;case"meta":if(c=nm("meta","content",n).get(l+(a.content||""))){for(d=0;d<c.length;d++)if(i=c[d],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){c.splice(d,1);break t}}i=n.createElement(l),ut(i,l,a),n.head.appendChild(i);break;default:throw Error(o(468,l))}i[it]=e,lt(i),l=i}e.stateNode=l}else sm(n,e.type,e.stateNode);else e.stateNode=lm(n,l,e.memoizedProps);else i!==l?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,l===null?sm(n,e.type,e.stateNode):lm(n,l,e.memoizedProps)):l===null&&e.stateNode!==null&&tc(e,e.memoizedProps,a.memoizedProps)}break;case 27:bt(t,e),vt(e),l&512&&(Ie||a===null||Wt(a,a.return)),a!==null&&l&4&&tc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(bt(t,e),vt(e),l&512&&(Ie||a===null||Wt(a,a.return)),e.flags&32){n=e.stateNode;try{Sl(n,"")}catch(I){_e(e,e.return,I)}}l&4&&e.stateNode!=null&&(n=e.memoizedProps,tc(e,n,a!==null?a.memoizedProps:n)),l&1024&&(nc=!0);break;case 6:if(bt(t,e),vt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(I){_e(e,e.return,I)}}break;case 3:if(ri=null,n=Xt,Xt=si(t.containerInfo),bt(t,e),Xt=n,vt(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Pl(t.containerInfo)}catch(I){_e(e,e.return,I)}nc&&(nc=!1,nf(e));break;case 4:l=Xt,Xt=si(e.stateNode.containerInfo),bt(t,e),vt(e),Xt=l;break;case 12:bt(t,e),vt(e);break;case 31:bt(t,e),vt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Xs(e,l)));break;case 13:bt(t,e),vt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ks=Ve()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Xs(e,l)));break;case 22:n=e.memoizedState!==null;var g=a!==null&&a.memoizedState!==null,z=oa,M=Ie;if(oa=z||n,Ie=M||g,bt(t,e),Ie=M,oa=z,vt(e),l&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(a===null||g||oa||Ie||ul(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){g=a=t;try{if(i=g.stateNode,n)c=i.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{d=g.stateNode;var U=g.memoizedProps.style,E=U!=null&&U.hasOwnProperty("display")?U.display:null;d.style.display=E==null||typeof E=="boolean"?"":(""+E).trim()}}catch(I){_e(g,g.return,I)}}}else if(t.tag===6){if(a===null){g=t;try{g.stateNode.nodeValue=n?"":g.memoizedProps}catch(I){_e(g,g.return,I)}}}else if(t.tag===18){if(a===null){g=t;try{var C=g.stateNode;n?Jf(C,!0):Jf(g.stateNode,!1)}catch(I){_e(g,g.return,I)}}}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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,Xs(e,a))));break;case 19:bt(t,e),vt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Xs(e,l)));break;case 30:break;case 21:break;default:bt(t,e),vt(e)}}function vt(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if($d(l)){a=l;break}l=l.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var n=a.stateNode,i=ac(e);Qs(e,i,n);break;case 5:var c=a.stateNode;a.flags&32&&(Sl(c,""),a.flags&=-33);var d=ac(e);Qs(e,d,c);break;case 3:case 4:var g=a.stateNode.containerInfo,z=ac(e);lc(e,z,g);break;default:throw Error(o(161))}}catch(M){_e(e,e.return,M)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function nf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;nf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function da(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Id(e,t.alternate,t),t=t.sibling}function ul(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Aa(4,t,t.return),ul(t);break;case 1:Wt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Kd(t,t.return,a),ul(t);break;case 27:Yn(t.stateNode);case 26:case 5:Wt(t,t.return),ul(t);break;case 22:t.memoizedState===null&&ul(t);break;case 30:ul(t);break;default:ul(t)}e=e.sibling}}function fa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,n=e,i=t,c=i.flags;switch(i.tag){case 0:case 11:case 15:fa(n,i,a),_n(4,i);break;case 1:if(fa(n,i,a),l=i,n=l.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(z){_e(l,l.return,z)}if(l=i,n=l.updateQueue,n!==null){var d=l.stateNode;try{var g=n.shared.hiddenCallbacks;if(g!==null)for(n.shared.hiddenCallbacks=null,n=0;n<g.length;n++)Ru(g[n],d)}catch(z){_e(l,l.return,z)}}a&&c&64&&Zd(i),On(i,i.return);break;case 27:Wd(i);case 26:case 5:fa(n,i,a),a&&l===null&&c&4&&Jd(i),On(i,i.return);break;case 12:fa(n,i,a);break;case 31:fa(n,i,a),a&&c&4&&tf(n,i);break;case 13:fa(n,i,a),a&&c&4&&af(n,i);break;case 22:i.memoizedState===null&&fa(n,i,a),On(i,i.return);break;case 30:break;default:fa(n,i,a)}t=t.sibling}}function sc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&bn(a))}function ic(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bn(e))}function Zt(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sf(e,t,a,l),t=t.sibling}function sf(e,t,a,l){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Zt(e,t,a,l),n&2048&&_n(9,t);break;case 1:Zt(e,t,a,l);break;case 3:Zt(e,t,a,l),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bn(e)));break;case 12:if(n&2048){Zt(e,t,a,l),e=t.stateNode;try{var i=t.memoizedProps,c=i.id,d=i.onPostCommit;typeof d=="function"&&d(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){_e(t,t.return,g)}}else Zt(e,t,a,l);break;case 31:Zt(e,t,a,l);break;case 13:Zt(e,t,a,l);break;case 23:break;case 22:i=t.stateNode,c=t.alternate,t.memoizedState!==null?i._visibility&2?Zt(e,t,a,l):Dn(e,t):i._visibility&2?Zt(e,t,a,l):(i._visibility|=2,Yl(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),n&2048&&sc(c,t);break;case 24:Zt(e,t,a,l),n&2048&&ic(t.alternate,t);break;default:Zt(e,t,a,l)}}function Yl(e,t,a,l,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,c=t,d=a,g=l,z=c.flags;switch(c.tag){case 0:case 11:case 15:Yl(i,c,d,g,n),_n(8,c);break;case 23:break;case 22:var M=c.stateNode;c.memoizedState!==null?M._visibility&2?Yl(i,c,d,g,n):Dn(i,c):(M._visibility|=2,Yl(i,c,d,g,n)),n&&z&2048&&sc(c.alternate,c);break;case 24:Yl(i,c,d,g,n),n&&z&2048&&ic(c.alternate,c);break;default:Yl(i,c,d,g,n)}t=t.sibling}}function Dn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,n=l.flags;switch(l.tag){case 22:Dn(a,l),n&2048&&sc(l.alternate,l);break;case 24:Dn(a,l),n&2048&&ic(l.alternate,l);break;default:Dn(a,l)}t=t.sibling}}var Rn=8192;function Vl(e,t,a){if(e.subtreeFlags&Rn)for(e=e.child;e!==null;)rf(e,t,a),e=e.sibling}function rf(e,t,a){switch(e.tag){case 26:Vl(e,t,a),e.flags&Rn&&e.memoizedState!==null&&Tg(a,Xt,e.memoizedState,e.memoizedProps);break;case 5:Vl(e,t,a);break;case 3:case 4:var l=Xt;Xt=si(e.stateNode.containerInfo),Vl(e,t,a),Xt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Rn,Rn=16777216,Vl(e,t,a),Rn=l):Vl(e,t,a));break;default:Vl(e,t,a)}}function cf(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 Un(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];nt=l,uf(l,e)}cf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)of(e),e=e.sibling}function of(e){switch(e.tag){case 0:case 11:case 15:Un(e),e.flags&2048&&Aa(9,e,e.return);break;case 3:Un(e);break;case 12:Un(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zs(e)):Un(e);break;default:Un(e)}}function Zs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];nt=l,uf(l,e)}cf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Aa(8,t,t.return),Zs(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Zs(t));break;default:Zs(t)}e=e.sibling}}function uf(e,t){for(;nt!==null;){var a=nt;switch(a.tag){case 0:case 11:case 15:Aa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:bn(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,nt=l;else e:for(a=e;nt!==null;){l=nt;var n=l.sibling,i=l.return;if(Pd(l),l===a){nt=null;break e}if(n!==null){n.return=i,nt=n;break e}nt=i}}}var Yp={getCacheForType:function(e){var t=ct($e),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return ct($e).controller.signal}},Vp=typeof WeakMap=="function"?WeakMap:Map,Ce=0,Ue=null,ve=null,Se=0,Me=0,Ct=null,Ma=!1,Ql=!1,rc=!1,ma=0,Xe=0,_a=0,dl=0,cc=0,At=0,Xl=0,Bn=null,jt=null,oc=!1,Ks=0,df=0,Js=1/0,$s=null,Oa=null,tt=0,Da=null,Zl=null,ha=0,uc=0,dc=null,ff=null,Hn=0,fc=null;function Mt(){return(Ce&2)!==0&&Se!==0?Se&-Se:k.T!==null?yc():To()}function mf(){if(At===0)if((Se&536870912)===0||ze){var e=ls;ls<<=1,(ls&3932160)===0&&(ls=262144),At=e}else At=536870912;return e=Tt.current,e!==null&&(e.flags|=32),At}function St(e,t,a){(e===Ue&&(Me===2||Me===9)||e.cancelPendingCommit!==null)&&(Kl(e,0),Ra(e,Se,At,!1)),nn(e,a),((Ce&2)===0||e!==Ue)&&(e===Ue&&((Ce&2)===0&&(dl|=a),Xe===4&&Ra(e,Se,At,!1)),Ft(e))}function hf(e,t,a){if((Ce&6)!==0)throw Error(o(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||ln(e,t),n=l?Zp(e,t):hc(e,t,!0),i=l;do{if(n===0){Ql&&!l&&Ra(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Qp(a)){n=hc(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var d=e;n=Bn;var g=d.current.memoizedState.isDehydrated;if(g&&(Kl(d,c).flags|=256),c=hc(d,c,!1),c!==2){if(rc&&!g){d.errorRecoveryDisabledLanes|=i,dl|=i,n=4;break e}i=jt,jt=n,i!==null&&(jt===null?jt=i:jt.push.apply(jt,i))}n=c}if(i=!1,n!==2)continue}}if(n===1){Kl(e,0),Ra(e,t,0,!0);break}e:{switch(l=e,i=n,i){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Ra(l,t,At,!Ma);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(n=Ks+300-Ve(),10<n)){if(Ra(l,t,At,!Ma),ss(l,0,!0)!==0)break e;ha=t,l.timeoutHandle=Xf(pf.bind(null,l,a,jt,$s,oc,t,At,dl,Xl,Ma,i,"Throttled",-0,0),n);break e}pf(l,a,jt,$s,oc,t,At,dl,Xl,Ma,i,null,-0,0)}}break}while(!0);Ft(e)}function pf(e,t,a,l,n,i,c,d,g,z,M,U,E,C){if(e.timeoutHandle=-1,U=t.subtreeFlags,U&8192||(U&16785408)===16785408){U={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pt},rf(t,i,U);var I=(i&62914560)===i?Ks-Ve():(i&4194048)===i?df-Ve():0;if(I=wg(U,I),I!==null){ha=i,e.cancelPendingCommit=I(Nf.bind(null,e,t,i,a,l,n,c,d,g,M,U,null,E,C)),Ra(e,i,c,!z);return}}Nf(e,t,i,a,l,n,c,d,g)}function Qp(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var n=a[l],i=n.getSnapshot;n=n.value;try{if(!kt(i(),n))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Ra(e,t,a,l){t&=~cc,t&=~dl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var n=t;0<n;){var i=31-zt(n),c=1<<i;l[i]=-1,n&=~c}a!==0&&zo(e,a,t)}function Ws(){return(Ce&6)===0?(qn(0),!1):!0}function mc(){if(ve!==null){if(Me===0)var e=ve.return;else e=ve,la=al=null,Cr(e),Bl=null,jn=0,e=ve;for(;e!==null;)Xd(e.alternate,e),e=e.return;ve=null}}function Kl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,ug(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ha=0,mc(),Ue=e,ve=a=ta(e.current,null),Se=t,Me=0,Ct=null,Ma=!1,Ql=ln(e,t),rc=!1,Xl=At=cc=dl=_a=Xe=0,jt=Bn=null,oc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var n=31-zt(l),i=1<<n;t|=e[n],l&=~i}return ma=t,xs(),a}function gf(e,t){ge=null,k.H=Cn,t===Ul||t===ks?(t=Mu(),Me=3):t===xr?(t=Mu(),Me=4):Me=t===Xr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ct=t,ve===null&&(Xe=1,qs(e,Ut(t,e.current)))}function xf(){var e=Tt.current;return e===null?!0:(Se&4194048)===Se?Lt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===Lt:!1}function yf(){var e=k.H;return k.H=Cn,e===null?Cn:e}function bf(){var e=k.A;return k.A=Yp,e}function Fs(){Xe=4,Ma||(Se&4194048)!==Se&&Tt.current!==null||(Ql=!0),(_a&134217727)===0&&(dl&134217727)===0||Ue===null||Ra(Ue,Se,At,!1)}function hc(e,t,a){var l=Ce;Ce|=2;var n=yf(),i=bf();(Ue!==e||Se!==t)&&($s=null,Kl(e,t)),t=!1;var c=Xe;e:do try{if(Me!==0&&ve!==null){var d=ve,g=Ct;switch(Me){case 8:mc(),c=6;break e;case 3:case 2:case 9:case 6:Tt.current===null&&(t=!0);var z=Me;if(Me=0,Ct=null,Jl(e,d,g,z),a&&Ql){c=0;break e}break;default:z=Me,Me=0,Ct=null,Jl(e,d,g,z)}}Xp(),c=Xe;break}catch(M){gf(e,M)}while(!0);return t&&e.shellSuspendCounter++,la=al=null,Ce=l,k.H=n,k.A=i,ve===null&&(Ue=null,Se=0,xs()),c}function Xp(){for(;ve!==null;)vf(ve)}function Zp(e,t){var a=Ce;Ce|=2;var l=yf(),n=bf();Ue!==e||Se!==t?($s=null,Js=Ve()+500,Kl(e,t)):Ql=ln(e,t);e:do try{if(Me!==0&&ve!==null){t=ve;var i=Ct;t:switch(Me){case 1:Me=0,Ct=null,Jl(e,t,i,1);break;case 2:case 9:if(Cu(i)){Me=0,Ct=null,jf(t);break}t=function(){Me!==2&&Me!==9||Ue!==e||(Me=7),Ft(e)},i.then(t,t);break e;case 3:Me=7;break e;case 4:Me=5;break e;case 7:Cu(i)?(Me=0,Ct=null,jf(t)):(Me=0,Ct=null,Jl(e,t,i,7));break;case 5:var c=null;switch(ve.tag){case 26:c=ve.memoizedState;case 5:case 27:var d=ve;if(c?im(c):d.stateNode.complete){Me=0,Ct=null;var g=d.sibling;if(g!==null)ve=g;else{var z=d.return;z!==null?(ve=z,Is(z)):ve=null}break t}}Me=0,Ct=null,Jl(e,t,i,5);break;case 6:Me=0,Ct=null,Jl(e,t,i,6);break;case 8:mc(),Xe=6;break e;default:throw Error(o(462))}}Kp();break}catch(M){gf(e,M)}while(!0);return la=al=null,k.H=l,k.A=n,Ce=a,ve!==null?0:(Ue=null,Se=0,xs(),Xe)}function Kp(){for(;ve!==null&&!pl();)vf(ve)}function vf(e){var t=Vd(e.alternate,e,ma);e.memoizedProps=e.pendingProps,t===null?Is(e):ve=t}function jf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Bd(a,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=Bd(a,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Cr(t);default:Xd(a,t),t=ve=yu(t,ma),t=Vd(a,t,ma)}e.memoizedProps=e.pendingProps,t===null?Is(e):ve=t}function Jl(e,t,a,l){la=al=null,Cr(t),Bl=null,jn=0;var n=t.return;try{if(Rp(e,n,t,a,Se)){Xe=1,qs(e,Ut(a,e.current)),ve=null;return}}catch(i){if(n!==null)throw ve=n,i;Xe=1,qs(e,Ut(a,e.current)),ve=null;return}t.flags&32768?(ze||l===1?e=!0:Ql||(Se&536870912)!==0?e=!1:(Ma=e=!0,(l===2||l===9||l===3||l===6)&&(l=Tt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Sf(t,e)):Is(t)}function Is(e){var t=e;do{if((t.flags&32768)!==0){Sf(t,Ma);return}e=t.return;var a=Hp(t.alternate,t,ma);if(a!==null){ve=a;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);Xe===0&&(Xe=5)}function Sf(e,t){do{var a=qp(e.alternate,e);if(a!==null){a.flags&=32767,ve=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ve=e;return}ve=e=a}while(e!==null);Xe=6,ve=null}function Nf(e,t,a,l,n,i,c,d,g){e.cancelPendingCommit=null;do Ps();while(tt!==0);if((Ce&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(i=t.lanes|t.childLanes,i|=ar,Eh(e,a,i,c,d,g),e===Ue&&(ve=Ue=null,Se=0),Zl=t,Da=e,ha=a,uc=i,dc=n,ff=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Fp(ts,function(){return wf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=k.T,k.T=null,n=H.p,H.p=2,c=Ce,Ce|=4;try{Lp(e,t,a)}finally{Ce=c,H.p=n,k.T=l}}tt=1,zf(),kf(),Ef()}}function zf(){if(tt===1){tt=0;var e=Da,t=Zl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var l=H.p;H.p=2;var n=Ce;Ce|=4;try{lf(t,e);var i=Ec,c=ou(e.containerInfo),d=i.focusedElem,g=i.selectionRange;if(c!==d&&d&&d.ownerDocument&&cu(d.ownerDocument.documentElement,d)){if(g!==null&&Fi(d)){var z=g.start,M=g.end;if(M===void 0&&(M=z),"selectionStart"in d)d.selectionStart=z,d.selectionEnd=Math.min(M,d.value.length);else{var U=d.ownerDocument||document,E=U&&U.defaultView||window;if(E.getSelection){var C=E.getSelection(),I=d.textContent.length,ue=Math.min(g.start,I),Re=g.end===void 0?ue:Math.min(g.end,I);!C.extend&&ue>Re&&(c=Re,Re=ue,ue=c);var j=ru(d,ue),v=ru(d,Re);if(j&&v&&(C.rangeCount!==1||C.anchorNode!==j.node||C.anchorOffset!==j.offset||C.focusNode!==v.node||C.focusOffset!==v.offset)){var N=U.createRange();N.setStart(j.node,j.offset),C.removeAllRanges(),ue>Re?(C.addRange(N),C.extend(v.node,v.offset)):(N.setEnd(v.node,v.offset),C.addRange(N))}}}}for(U=[],C=d;C=C.parentNode;)C.nodeType===1&&U.push({element:C,left:C.scrollLeft,top:C.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<U.length;d++){var O=U[d];O.element.scrollLeft=O.left,O.element.scrollTop=O.top}}di=!!kc,Ec=kc=null}finally{Ce=n,H.p=l,k.T=a}}e.current=t,tt=2}}function kf(){if(tt===2){tt=0;var e=Da,t=Zl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var l=H.p;H.p=2;var n=Ce;Ce|=4;try{Id(e,t.alternate,t)}finally{Ce=n,H.p=l,k.T=a}}tt=3}}function Ef(){if(tt===4||tt===3){tt=0,_t();var e=Da,t=Zl,a=ha,l=ff;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?tt=5:(tt=0,Zl=Da=null,Tf(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Oa=null),_i(a),t=t.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(an,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=k.T,n=H.p,H.p=2,k.T=null;try{for(var i=e.onRecoverableError,c=0;c<l.length;c++){var d=l[c];i(d.value,{componentStack:d.stack})}}finally{k.T=t,H.p=n}}(ha&3)!==0&&Ps(),Ft(e),n=e.pendingLanes,(a&261930)!==0&&(n&42)!==0?e===fc?Hn++:(Hn=0,fc=e):Hn=0,qn(0)}}function Tf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bn(t)))}function Ps(){return zf(),kf(),Ef(),wf()}function wf(){if(tt!==5)return!1;var e=Da,t=uc;uc=0;var a=_i(ha),l=k.T,n=H.p;try{H.p=32>a?32:a,k.T=null,a=dc,dc=null;var i=Da,c=ha;if(tt=0,Zl=Da=null,ha=0,(Ce&6)!==0)throw Error(o(331));var d=Ce;if(Ce|=4,of(i.current),sf(i,i.current,c,a),Ce=d,qn(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(an,i)}catch{}return!0}finally{H.p=n,k.T=l,Tf(e,t)}}function Cf(e,t,a){t=Ut(a,t),t=Qr(e.stateNode,t,2),e=Ta(e,t,2),e!==null&&(nn(e,2),Ft(e))}function _e(e,t,a){if(e.tag===3)Cf(e,e,a);else for(;t!==null;){if(t.tag===3){Cf(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Oa===null||!Oa.has(l))){e=Ut(a,e),a=Cd(2),l=Ta(t,a,2),l!==null&&(Ad(a,l,t,e),nn(l,2),Ft(l));break}}t=t.return}}function pc(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Vp;var n=new Set;l.set(t,n)}else n=l.get(t),n===void 0&&(n=new Set,l.set(t,n));n.has(a)||(rc=!0,n.add(a),e=Jp.bind(null,e,t,a),t.then(e,e))}function Jp(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ue===e&&(Se&a)===a&&(Xe===4||Xe===3&&(Se&62914560)===Se&&300>Ve()-Ks?(Ce&2)===0&&Kl(e,0):cc|=a,Xl===Se&&(Xl=0)),Ft(e)}function Af(e,t){t===0&&(t=No()),e=Pa(e,t),e!==null&&(nn(e,t),Ft(e))}function $p(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Af(e,a)}function Wp(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,n=e.memoizedState;n!==null&&(a=n.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Af(e,a)}function Fp(e,t){return Be(e,t)}var ei=null,$l=null,gc=!1,ti=!1,xc=!1,Ua=0;function Ft(e){e!==$l&&e.next===null&&($l===null?ei=$l=e:$l=$l.next=e),ti=!0,gc||(gc=!0,Pp())}function qn(e,t){if(!xc&&ti){xc=!0;do for(var a=!1,l=ei;l!==null;){if(e!==0){var n=l.pendingLanes;if(n===0)var i=0;else{var c=l.suspendedLanes,d=l.pingedLanes;i=(1<<31-zt(42|e)+1)-1,i&=n&~(c&~d),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Df(l,i))}else i=Se,i=ss(l,l===Ue?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||ln(l,i)||(a=!0,Df(l,i));l=l.next}while(a);xc=!1}}function Ip(){Mf()}function Mf(){ti=gc=!1;var e=0;Ua!==0&&og()&&(e=Ua);for(var t=Ve(),a=null,l=ei;l!==null;){var n=l.next,i=_f(l,t);i===0?(l.next=null,a===null?ei=n:a.next=n,n===null&&($l=a)):(a=l,(e!==0||(i&3)!==0)&&(ti=!0)),l=n}tt!==0&&tt!==5||qn(e),Ua!==0&&(Ua=0)}function _f(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var c=31-zt(i),d=1<<c,g=n[c];g===-1?((d&a)===0||(d&l)!==0)&&(n[c]=kh(d,t)):g<=t&&(e.expiredLanes|=d),i&=~d}if(t=Ue,a=Se,a=ss(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Me===2||Me===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&st(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ln(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&st(l),_i(a)){case 2:case 8:a=jo;break;case 32:a=ts;break;case 268435456:a=So;break;default:a=ts}return l=Of.bind(null,e),a=Be(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&st(l),e.callbackPriority=2,e.callbackNode=null,2}function Of(e,t){if(tt!==0&&tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ps()&&e.callbackNode!==a)return null;var l=Se;return l=ss(e,e===Ue?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(hf(e,l,t),_f(e,Ve()),e.callbackNode!=null&&e.callbackNode===a?Of.bind(null,e):null)}function Df(e,t){if(Ps())return null;hf(e,t,!0)}function Pp(){dg(function(){(Ce&6)!==0?Be(vo,Ip):Mf()})}function yc(){if(Ua===0){var e=Dl;e===0&&(e=as,as<<=1,(as&261888)===0&&(as=256)),Ua=e}return Ua}function Rf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:os(""+e)}function Uf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function eg(e,t,a,l,n){if(t==="submit"&&a&&a.stateNode===n){var i=Rf((n[gt]||null).action),c=l.submitter;c&&(t=(t=c[gt]||null)?Rf(t.formAction):c.getAttribute("formAction"),t!==null&&(i=t,c=null));var d=new ms("action","action",null,l,n);e.push({event:d,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ua!==0){var g=c?Uf(n,c):new FormData(n);Hr(a,{pending:!0,data:g,method:n.method,action:i},null,g)}}else typeof i=="function"&&(d.preventDefault(),g=c?Uf(n,c):new FormData(n),Hr(a,{pending:!0,data:g,method:n.method,action:i},i,g))},currentTarget:n}]})}}for(var bc=0;bc<tr.length;bc++){var vc=tr[bc],tg=vc.toLowerCase(),ag=vc[0].toUpperCase()+vc.slice(1);Qt(tg,"on"+ag)}Qt(fu,"onAnimationEnd"),Qt(mu,"onAnimationIteration"),Qt(hu,"onAnimationStart"),Qt("dblclick","onDoubleClick"),Qt("focusin","onFocus"),Qt("focusout","onBlur"),Qt(yp,"onTransitionRun"),Qt(bp,"onTransitionStart"),Qt(vp,"onTransitionCancel"),Qt(pu,"onTransitionEnd"),vl("onMouseEnter",["mouseout","mouseover"]),vl("onMouseLeave",["mouseout","mouseover"]),vl("onPointerEnter",["pointerout","pointerover"]),vl("onPointerLeave",["pointerout","pointerover"]),$a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$a("onBeforeInput",["compositionend","keypress","textInput","paste"]),$a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ln="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(" "),lg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ln));function Bf(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],n=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var c=l.length-1;0<=c;c--){var d=l[c],g=d.instance,z=d.currentTarget;if(d=d.listener,g!==i&&n.isPropagationStopped())break e;i=d,n.currentTarget=z;try{i(n)}catch(M){gs(M)}n.currentTarget=null,i=g}else for(c=0;c<l.length;c++){if(d=l[c],g=d.instance,z=d.currentTarget,d=d.listener,g!==i&&n.isPropagationStopped())break e;i=d,n.currentTarget=z;try{i(n)}catch(M){gs(M)}n.currentTarget=null,i=g}}}}function je(e,t){var a=t[Oi];a===void 0&&(a=t[Oi]=new Set);var l=e+"__bubble";a.has(l)||(Hf(t,e,2,!1),a.add(l))}function jc(e,t,a){var l=0;t&&(l|=4),Hf(a,e,l,t)}var ai="_reactListening"+Math.random().toString(36).slice(2);function Sc(e){if(!e[ai]){e[ai]=!0,Ao.forEach(function(a){a!=="selectionchange"&&(lg.has(a)||jc(a,!1,e),jc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ai]||(t[ai]=!0,jc("selectionchange",!1,t))}}function Hf(e,t,a,l){switch(mm(t)){case 2:var n=Mg;break;case 8:n=_g;break;default:n=Bc}a=n.bind(null,t,a,e),n=void 0,!Yi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),l?n!==void 0?e.addEventListener(t,a,{capture:!0,passive:n}):e.addEventListener(t,a,!0):n!==void 0?e.addEventListener(t,a,{passive:n}):e.addEventListener(t,a,!1)}function Nc(e,t,a,l,n){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var c=l.tag;if(c===3||c===4){var d=l.stateNode.containerInfo;if(d===n)break;if(c===4)for(c=l.return;c!==null;){var g=c.tag;if((g===3||g===4)&&c.stateNode.containerInfo===n)return;c=c.return}for(;d!==null;){if(c=xl(d),c===null)return;if(g=c.tag,g===5||g===6||g===26||g===27){l=i=c;continue e}d=d.parentNode}}l=l.return}Yo(function(){var z=i,M=Li(a),U=[];e:{var E=gu.get(e);if(E!==void 0){var C=ms,I=e;switch(e){case"keypress":if(ds(a)===0)break e;case"keydown":case"keyup":C=Wh;break;case"focusin":I="focus",C=Zi;break;case"focusout":I="blur",C=Zi;break;case"beforeblur":case"afterblur":C=Zi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":C=Xo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":C=Hh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":C=Ph;break;case fu:case mu:case hu:C=Gh;break;case pu:C=tp;break;case"scroll":case"scrollend":C=Uh;break;case"wheel":C=lp;break;case"copy":case"cut":case"paste":C=Vh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":C=Ko;break;case"toggle":case"beforetoggle":C=sp}var ue=(t&4)!==0,Re=!ue&&(e==="scroll"||e==="scrollend"),j=ue?E!==null?E+"Capture":null:E;ue=[];for(var v=z,N;v!==null;){var O=v;if(N=O.stateNode,O=O.tag,O!==5&&O!==26&&O!==27||N===null||j===null||(O=cn(v,j),O!=null&&ue.push(Gn(v,O,N))),Re)break;v=v.return}0<ue.length&&(E=new C(E,I,null,a,M),U.push({event:E,listeners:ue}))}}if((t&7)===0){e:{if(E=e==="mouseover"||e==="pointerover",C=e==="mouseout"||e==="pointerout",E&&a!==qi&&(I=a.relatedTarget||a.fromElement)&&(xl(I)||I[gl]))break e;if((C||E)&&(E=M.window===M?M:(E=M.ownerDocument)?E.defaultView||E.parentWindow:window,C?(I=a.relatedTarget||a.toElement,C=z,I=I?xl(I):null,I!==null&&(Re=x(I),ue=I.tag,I!==Re||ue!==5&&ue!==27&&ue!==6)&&(I=null)):(C=null,I=z),C!==I)){if(ue=Xo,O="onMouseLeave",j="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(ue=Ko,O="onPointerLeave",j="onPointerEnter",v="pointer"),Re=C==null?E:rn(C),N=I==null?E:rn(I),E=new ue(O,v+"leave",C,a,M),E.target=Re,E.relatedTarget=N,O=null,xl(M)===z&&(ue=new ue(j,v+"enter",I,a,M),ue.target=N,ue.relatedTarget=Re,O=ue),Re=O,C&&I)t:{for(ue=ng,j=C,v=I,N=0,O=j;O;O=ue(O))N++;O=0;for(var re=v;re;re=ue(re))O++;for(;0<N-O;)j=ue(j),N--;for(;0<O-N;)v=ue(v),O--;for(;N--;){if(j===v||v!==null&&j===v.alternate){ue=j;break t}j=ue(j),v=ue(v)}ue=null}else ue=null;C!==null&&qf(U,E,C,ue,!1),I!==null&&Re!==null&&qf(U,Re,I,ue,!0)}}e:{if(E=z?rn(z):window,C=E.nodeName&&E.nodeName.toLowerCase(),C==="select"||C==="input"&&E.type==="file")var Te=tu;else if(Po(E))if(au)Te=pp;else{Te=mp;var te=fp}else C=E.nodeName,!C||C.toLowerCase()!=="input"||E.type!=="checkbox"&&E.type!=="radio"?z&&Hi(z.elementType)&&(Te=tu):Te=hp;if(Te&&(Te=Te(e,z))){eu(U,Te,a,M);break e}te&&te(e,E,z),e==="focusout"&&z&&E.type==="number"&&z.memoizedProps.value!=null&&Bi(E,"number",E.value)}switch(te=z?rn(z):window,e){case"focusin":(Po(te)||te.contentEditable==="true")&&(El=te,Ii=z,gn=null);break;case"focusout":gn=Ii=El=null;break;case"mousedown":Pi=!0;break;case"contextmenu":case"mouseup":case"dragend":Pi=!1,uu(U,a,M);break;case"selectionchange":if(xp)break;case"keydown":case"keyup":uu(U,a,M)}var xe;if(Ji)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else kl?Fo(e,a)&&(Ne="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ne="onCompositionStart");Ne&&(Jo&&a.locale!=="ko"&&(kl||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&kl&&(xe=Vo()):(va=M,Vi="value"in va?va.value:va.textContent,kl=!0)),te=li(z,Ne),0<te.length&&(Ne=new Zo(Ne,e,null,a,M),U.push({event:Ne,listeners:te}),xe?Ne.data=xe:(xe=Io(a),xe!==null&&(Ne.data=xe)))),(xe=rp?cp(e,a):op(e,a))&&(Ne=li(z,"onBeforeInput"),0<Ne.length&&(te=new Zo("onBeforeInput","beforeinput",null,a,M),U.push({event:te,listeners:Ne}),te.data=xe)),eg(U,e,z,a,M)}Bf(U,t)})}function Gn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function li(e,t){for(var a=t+"Capture",l=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=cn(e,a),n!=null&&l.unshift(Gn(e,n,i)),n=cn(e,t),n!=null&&l.push(Gn(e,n,i))),e.tag===3)return l;e=e.return}return[]}function ng(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function qf(e,t,a,l,n){for(var i=t._reactName,c=[];a!==null&&a!==l;){var d=a,g=d.alternate,z=d.stateNode;if(d=d.tag,g!==null&&g===l)break;d!==5&&d!==26&&d!==27||z===null||(g=z,n?(z=cn(a,i),z!=null&&c.unshift(Gn(a,z,g))):n||(z=cn(a,i),z!=null&&c.push(Gn(a,z,g)))),a=a.return}c.length!==0&&e.push({event:t,listeners:c})}var sg=/\r\n?/g,ig=/\u0000|\uFFFD/g;function Lf(e){return(typeof e=="string"?e:""+e).replace(sg,`
49
+ `).replace(ig,"")}function Gf(e,t){return t=Lf(t),Lf(e)===t}function De(e,t,a,l,n,i){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Sl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Sl(e,""+l);break;case"className":rs(e,"class",l);break;case"tabIndex":rs(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":rs(e,a,l);break;case"style":Lo(e,l,i);break;case"data":if(t!=="object"){rs(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=os(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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 i=="function"&&(a==="formAction"?(t!=="input"&&De(e,t,"name",n.name,n,null),De(e,t,"formEncType",n.formEncType,n,null),De(e,t,"formMethod",n.formMethod,n,null),De(e,t,"formTarget",n.formTarget,n,null)):(De(e,t,"encType",n.encType,n,null),De(e,t,"method",n.method,n,null),De(e,t,"target",n.target,n,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=os(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Pt);break;case"onScroll":l!=null&&je("scroll",e);break;case"onScrollEnd":l!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=os(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":je("beforetoggle",e),je("toggle",e),is(e,"popover",l);break;case"xlinkActuate":It(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":It(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":It(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":It(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":It(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":It(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":It(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":It(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":It(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":is(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Dh.get(a)||a,is(e,a,l))}}function zc(e,t,a,l,n,i){switch(a){case"style":Lo(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(a=l.__html,a!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof l=="string"?Sl(e,l):(typeof l=="number"||typeof l=="bigint")&&Sl(e,""+l);break;case"onScroll":l!=null&&je("scroll",e);break;case"onScrollEnd":l!=null&&je("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Pt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mo.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),t=a.slice(2,n?a.length-7:void 0),i=e[gt]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof l=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,n);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):is(e,a,l)}}}function ut(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var l=!1,n=!1,i;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];if(c!=null)switch(i){case"src":l=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:De(e,t,i,c,a,null)}}n&&De(e,t,"srcSet",a.srcSet,a,null),l&&De(e,t,"src",a.src,a,null);return;case"input":je("invalid",e);var d=i=c=n=null,g=null,z=null;for(l in a)if(a.hasOwnProperty(l)){var M=a[l];if(M!=null)switch(l){case"name":n=M;break;case"type":c=M;break;case"checked":g=M;break;case"defaultChecked":z=M;break;case"value":i=M;break;case"defaultValue":d=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,t));break;default:De(e,t,l,M,a,null)}}Uo(e,i,d,g,z,c,n,!1);return;case"select":je("invalid",e),l=c=i=null;for(n in a)if(a.hasOwnProperty(n)&&(d=a[n],d!=null))switch(n){case"value":i=d;break;case"defaultValue":c=d;break;case"multiple":l=d;default:De(e,t,n,d,a,null)}t=i,a=c,e.multiple=!!l,t!=null?jl(e,!!l,t,!1):a!=null&&jl(e,!!l,a,!0);return;case"textarea":je("invalid",e),i=n=l=null;for(c in a)if(a.hasOwnProperty(c)&&(d=a[c],d!=null))switch(c){case"value":l=d;break;case"defaultValue":n=d;break;case"children":i=d;break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:De(e,t,c,d,a,null)}Ho(e,l,n,i);return;case"option":for(g in a)if(a.hasOwnProperty(g)&&(l=a[g],l!=null))switch(g){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:De(e,t,g,l,a,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(l=0;l<Ln.length;l++)je(Ln[l],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("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(z in a)if(a.hasOwnProperty(z)&&(l=a[z],l!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:De(e,t,z,l,a,null)}return;default:if(Hi(t)){for(M in a)a.hasOwnProperty(M)&&(l=a[M],l!==void 0&&zc(e,t,M,l,a,void 0));return}}for(d in a)a.hasOwnProperty(d)&&(l=a[d],l!=null&&De(e,t,d,l,a,null))}function rg(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,c=null,d=null,g=null,z=null,M=null;for(C in a){var U=a[C];if(a.hasOwnProperty(C)&&U!=null)switch(C){case"checked":break;case"value":break;case"defaultValue":g=U;default:l.hasOwnProperty(C)||De(e,t,C,null,l,U)}}for(var E in l){var C=l[E];if(U=a[E],l.hasOwnProperty(E)&&(C!=null||U!=null))switch(E){case"type":i=C;break;case"name":n=C;break;case"checked":z=C;break;case"defaultChecked":M=C;break;case"value":c=C;break;case"defaultValue":d=C;break;case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(o(137,t));break;default:C!==U&&De(e,t,E,C,l,U)}}Ui(e,c,d,g,z,M,i,n);return;case"select":C=c=d=E=null;for(i in a)if(g=a[i],a.hasOwnProperty(i)&&g!=null)switch(i){case"value":break;case"multiple":C=g;default:l.hasOwnProperty(i)||De(e,t,i,null,l,g)}for(n in l)if(i=l[n],g=a[n],l.hasOwnProperty(n)&&(i!=null||g!=null))switch(n){case"value":E=i;break;case"defaultValue":d=i;break;case"multiple":c=i;default:i!==g&&De(e,t,n,i,l,g)}t=d,a=c,l=C,E!=null?jl(e,!!a,E,!1):!!l!=!!a&&(t!=null?jl(e,!!a,t,!0):jl(e,!!a,a?[]:"",!1));return;case"textarea":C=E=null;for(d in a)if(n=a[d],a.hasOwnProperty(d)&&n!=null&&!l.hasOwnProperty(d))switch(d){case"value":break;case"children":break;default:De(e,t,d,null,l,n)}for(c in l)if(n=l[c],i=a[c],l.hasOwnProperty(c)&&(n!=null||i!=null))switch(c){case"value":E=n;break;case"defaultValue":C=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(o(91));break;default:n!==i&&De(e,t,c,n,l,i)}Bo(e,E,C);return;case"option":for(var I in a)if(E=a[I],a.hasOwnProperty(I)&&E!=null&&!l.hasOwnProperty(I))switch(I){case"selected":e.selected=!1;break;default:De(e,t,I,null,l,E)}for(g in l)if(E=l[g],C=a[g],l.hasOwnProperty(g)&&E!==C&&(E!=null||C!=null))switch(g){case"selected":e.selected=E&&typeof E!="function"&&typeof E!="symbol";break;default:De(e,t,g,E,l,C)}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 ue in a)E=a[ue],a.hasOwnProperty(ue)&&E!=null&&!l.hasOwnProperty(ue)&&De(e,t,ue,null,l,E);for(z in l)if(E=l[z],C=a[z],l.hasOwnProperty(z)&&E!==C&&(E!=null||C!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(E!=null)throw Error(o(137,t));break;default:De(e,t,z,E,l,C)}return;default:if(Hi(t)){for(var Re in a)E=a[Re],a.hasOwnProperty(Re)&&E!==void 0&&!l.hasOwnProperty(Re)&&zc(e,t,Re,void 0,l,E);for(M in l)E=l[M],C=a[M],!l.hasOwnProperty(M)||E===C||E===void 0&&C===void 0||zc(e,t,M,E,l,C);return}}for(var j in a)E=a[j],a.hasOwnProperty(j)&&E!=null&&!l.hasOwnProperty(j)&&De(e,t,j,null,l,E);for(U in l)E=l[U],C=a[U],!l.hasOwnProperty(U)||E===C||E==null&&C==null||De(e,t,U,E,l,C)}function Yf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var n=a[l],i=n.transferSize,c=n.initiatorType,d=n.duration;if(i&&d&&Yf(c)){for(c=0,d=n.responseEnd,l+=1;l<a.length;l++){var g=a[l],z=g.startTime;if(z>d)break;var M=g.transferSize,U=g.initiatorType;M&&Yf(U)&&(g=g.responseEnd,c+=M*(g<d?1:(d-z)/(g-z)))}if(--l,t+=8*(i+c)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var kc=null,Ec=null;function ni(e){return e.nodeType===9?e:e.ownerDocument}function Vf(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 Qf(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 Tc(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 wc=null;function og(){var e=window.event;return e&&e.type==="popstate"?e===wc?!1:(wc=e,!0):(wc=null,!1)}var Xf=typeof setTimeout=="function"?setTimeout:void 0,ug=typeof clearTimeout=="function"?clearTimeout:void 0,Zf=typeof Promise=="function"?Promise:void 0,dg=typeof queueMicrotask=="function"?queueMicrotask:typeof Zf<"u"?function(e){return Zf.resolve(null).then(e).catch(fg)}:Xf;function fg(e){setTimeout(function(){throw e})}function Ba(e){return e==="head"}function Kf(e,t){var a=t,l=0;do{var n=a.nextSibling;if(e.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(n),Pl(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Yn(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Yn(a);for(var i=a.firstChild;i;){var c=i.nextSibling,d=i.nodeName;i[sn]||d==="SCRIPT"||d==="STYLE"||d==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=c}}else a==="body"&&Yn(e.ownerDocument.body);a=n}while(a);Pl(t)}function Jf(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function Cc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Cc(a),Di(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function mg(e,t,a,l){for(;e.nodeType===1;){var n=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[sn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==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(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Gt(e.nextSibling),e===null)break}return null}function hg(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Gt(e.nextSibling),e===null))return null;return e}function $f(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Gt(e.nextSibling),e===null))return null;return e}function Ac(e){return e.data==="$?"||e.data==="$~"}function Mc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function pg(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Gt(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==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var _c=null;function Wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Gt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Ff(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function If(e,t,a){switch(t=ni(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Yn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Di(e)}var Yt=new Map,Pf=new Set;function si(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pa=H.d;H.d={f:gg,r:xg,D:yg,C:bg,L:vg,m:jg,X:Ng,S:Sg,M:zg};function gg(){var e=pa.f(),t=Ws();return e||t}function xg(e){var t=yl(e);t!==null&&t.tag===5&&t.type==="form"?pd(t):pa.r(e)}var Wl=typeof document>"u"?null:document;function em(e,t,a){var l=Wl;if(l&&typeof t=="string"&&t){var n=Dt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),Pf.has(n)||(Pf.add(n),e={rel:e,crossOrigin:a,href:t},l.querySelector(n)===null&&(t=l.createElement("link"),ut(t,"link",e),lt(t),l.head.appendChild(t)))}}function yg(e){pa.D(e),em("dns-prefetch",e,null)}function bg(e,t){pa.C(e,t),em("preconnect",e,t)}function vg(e,t,a){pa.L(e,t,a);var l=Wl;if(l&&e&&t){var n='link[rel="preload"][as="'+Dt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+Dt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+Dt(a.imageSizes)+'"]')):n+='[href="'+Dt(e)+'"]';var i=n;switch(t){case"style":i=Fl(e);break;case"script":i=Il(e)}Yt.has(i)||(e=S({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Yt.set(i,e),l.querySelector(n)!==null||t==="style"&&l.querySelector(Vn(i))||t==="script"&&l.querySelector(Qn(i))||(t=l.createElement("link"),ut(t,"link",e),lt(t),l.head.appendChild(t)))}}function jg(e,t){pa.m(e,t);var a=Wl;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Dt(l)+'"][href="'+Dt(e)+'"]',i=n;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Il(e)}if(!Yt.has(i)&&(e=S({rel:"modulepreload",href:e},t),Yt.set(i,e),a.querySelector(n)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Qn(i)))return}l=a.createElement("link"),ut(l,"link",e),lt(l),a.head.appendChild(l)}}}function Sg(e,t,a){pa.S(e,t,a);var l=Wl;if(l&&e){var n=bl(l).hoistableStyles,i=Fl(e);t=t||"default";var c=n.get(i);if(!c){var d={loading:0,preload:null};if(c=l.querySelector(Vn(i)))d.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Yt.get(i))&&Oc(e,a);var g=c=l.createElement("link");lt(g),ut(g,"link",e),g._p=new Promise(function(z,M){g.onload=z,g.onerror=M}),g.addEventListener("load",function(){d.loading|=1}),g.addEventListener("error",function(){d.loading|=2}),d.loading|=4,ii(c,t,l)}c={type:"stylesheet",instance:c,count:1,state:d},n.set(i,c)}}}function Ng(e,t){pa.X(e,t);var a=Wl;if(a&&e){var l=bl(a).hoistableScripts,n=Il(e),i=l.get(n);i||(i=a.querySelector(Qn(n)),i||(e=S({src:e,async:!0},t),(t=Yt.get(n))&&Dc(e,t),i=a.createElement("script"),lt(i),ut(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function zg(e,t){pa.M(e,t);var a=Wl;if(a&&e){var l=bl(a).hoistableScripts,n=Il(e),i=l.get(n);i||(i=a.querySelector(Qn(n)),i||(e=S({src:e,async:!0,type:"module"},t),(t=Yt.get(n))&&Dc(e,t),i=a.createElement("script"),lt(i),ut(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function tm(e,t,a,l){var n=(n=ie.current)?si(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Fl(a.href),a=bl(n).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Fl(a.href);var i=bl(n).hoistableStyles,c=i.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,c),(i=n.querySelector(Vn(e)))&&!i._p&&(c.instance=i,c.state.loading=5),Yt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Yt.set(e,a),i||kg(n,e,a,c.state))),t&&l===null)throw Error(o(528,""));return c}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Il(a),a=bl(n).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Fl(e){return'href="'+Dt(e)+'"'}function Vn(e){return'link[rel="stylesheet"]['+e+"]"}function am(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function kg(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),ut(t,"link",a),lt(t),e.head.appendChild(t))}function Il(e){return'[src="'+Dt(e)+'"]'}function Qn(e){return"script[async]"+e}function lm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Dt(a.href)+'"]');if(l)return t.instance=l,lt(l),l;var n=S({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),lt(l),ut(l,"style",n),ii(l,a.precedence,e),t.instance=l;case"stylesheet":n=Fl(a.href);var i=e.querySelector(Vn(n));if(i)return t.state.loading|=4,t.instance=i,lt(i),i;l=am(a),(n=Yt.get(n))&&Oc(l,n),i=(e.ownerDocument||e).createElement("link"),lt(i);var c=i;return c._p=new Promise(function(d,g){c.onload=d,c.onerror=g}),ut(i,"link",l),t.state.loading|=4,ii(i,a.precedence,e),t.instance=i;case"script":return i=Il(a.src),(n=e.querySelector(Qn(i)))?(t.instance=n,lt(n),n):(l=a,(n=Yt.get(i))&&(l=S({},a),Dc(l,n)),e=e.ownerDocument||e,n=e.createElement("script"),lt(n),ut(n,"link",l),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,ii(l,a.precedence,e));return t.instance}function ii(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=l.length?l[l.length-1]:null,i=n,c=0;c<l.length;c++){var d=l[c];if(d.dataset.precedence===t)i=d;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Oc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Dc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ri=null;function nm(e,t,a){if(ri===null){var l=new Map,n=ri=new Map;n.set(a,l)}else n=ri,l=n.get(a),l||(l=new Map,n.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),n=0;n<a.length;n++){var i=a[n];if(!(i[sn]||i[it]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var c=i.getAttribute(t)||"";c=e+c;var d=l.get(c);d?d.push(i):l.set(c,[i])}}return l}function sm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Eg(e,t,a){if(a===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 im(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tg(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=Fl(l.href),i=t.querySelector(Vn(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ci.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,lt(i);return}i=t.ownerDocument||t,l=am(l),(n=Yt.get(n))&&Oc(l,n),i=i.createElement("link"),lt(i);var c=i;c._p=new Promise(function(d,g){c.onload=d,c.onerror=g}),ut(i,"link",l),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ci.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Rc=0;function wg(e,t){return e.stylesheets&&e.count===0&&ui(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&ui(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Rc===0&&(Rc=62500*cg());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ui(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Rc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(n)}}:null}function ci(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ui(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var oi=null;function ui(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oi=new Map,t.forEach(Cg,e),oi=null,ci.call(e))}function Cg(e,t){if(!(t.state.loading&4)){var a=oi.get(e);if(a)var l=a.get(null);else{a=new Map,oi.set(e,a);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var c=n[i];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(a.set(c.dataset.precedence,c),l=c)}l&&a.set(null,l)}n=t.instance,c=n.getAttribute("data-precedence"),i=a.get(c)||l,i===l&&a.set(null,n),a.set(c,n),this.count++,l=ci.bind(this),n.addEventListener("load",l),n.addEventListener("error",l),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Xn={$$typeof:$,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function Ag(e,t,a,l,n,i,c,d,g){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=Ai(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ai(0),this.hiddenUpdates=Ai(null),this.identifierPrefix=l,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function rm(e,t,a,l,n,i,c,d,g,z,M,U){return e=new Ag(e,t,a,c,g,z,M,U,d),t=1,i===!0&&(t|=24),i=Et(3,null,null,t),e.current=i,i.stateNode=e,t=hr(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:a,cache:t},yr(i),e}function cm(e){return e?(e=Cl,e):Cl}function om(e,t,a,l,n,i){n=cm(n),l.context===null?l.context=n:l.pendingContext=n,l=Ea(t),l.payload={element:a},i=i===void 0?null:i,i!==null&&(l.callback=i),a=Ta(e,l,t),a!==null&&(St(a,e,t),Nn(a,e,t))}function um(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Uc(e,t){um(e,t),(e=e.alternate)&&um(e,t)}function dm(e){if(e.tag===13||e.tag===31){var t=Pa(e,67108864);t!==null&&St(t,e,67108864),Uc(e,67108864)}}function fm(e){if(e.tag===13||e.tag===31){var t=Mt();t=Mi(t);var a=Pa(e,t);a!==null&&St(a,e,t),Uc(e,t)}}var di=!0;function Mg(e,t,a,l){var n=k.T;k.T=null;var i=H.p;try{H.p=2,Bc(e,t,a,l)}finally{H.p=i,k.T=n}}function _g(e,t,a,l){var n=k.T;k.T=null;var i=H.p;try{H.p=8,Bc(e,t,a,l)}finally{H.p=i,k.T=n}}function Bc(e,t,a,l){if(di){var n=Hc(l);if(n===null)Nc(e,t,l,fi,a),hm(e,l);else if(Dg(n,e,t,a,l))l.stopPropagation();else if(hm(e,l),t&4&&-1<Og.indexOf(e)){for(;n!==null;){var i=yl(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var c=Ja(i.pendingLanes);if(c!==0){var d=i;for(d.pendingLanes|=2,d.entangledLanes|=2;c;){var g=1<<31-zt(c);d.entanglements[1]|=g,c&=~g}Ft(i),(Ce&6)===0&&(Js=Ve()+500,qn(0))}}break;case 31:case 13:d=Pa(i,2),d!==null&&St(d,i,2),Ws(),Uc(i,2)}if(i=Hc(l),i===null&&Nc(e,t,l,fi,a),i===n)break;n=i}n!==null&&l.stopPropagation()}else Nc(e,t,l,null,a)}}function Hc(e){return e=Li(e),qc(e)}var fi=null;function qc(e){if(fi=null,e=xl(e),e!==null){var t=x(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=y(t),e!==null)return e;e=null}else if(a===31){if(e=T(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fi=e,null}function mm(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(yh()){case vo:return 2;case jo:return 8;case ts:case bh:return 32;case So:return 268435456;default:return 32}default:return 32}}var Lc=!1,Ha=null,qa=null,La=null,Zn=new Map,Kn=new Map,Ga=[],Og="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 hm(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":La=null;break;case"pointerover":case"pointerout":Zn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kn.delete(t.pointerId)}}function Jn(e,t,a,l,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:i,targetContainers:[n]},t!==null&&(t=yl(t),t!==null&&dm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Dg(e,t,a,l,n){switch(t){case"focusin":return Ha=Jn(Ha,e,t,a,l,n),!0;case"dragenter":return qa=Jn(qa,e,t,a,l,n),!0;case"mouseover":return La=Jn(La,e,t,a,l,n),!0;case"pointerover":var i=n.pointerId;return Zn.set(i,Jn(Zn.get(i)||null,e,t,a,l,n)),!0;case"gotpointercapture":return i=n.pointerId,Kn.set(i,Jn(Kn.get(i)||null,e,t,a,l,n)),!0}return!1}function pm(e){var t=xl(e.target);if(t!==null){var a=x(t);if(a!==null){if(t=a.tag,t===13){if(t=y(a),t!==null){e.blockedOn=t,wo(e.priority,function(){fm(a)});return}}else if(t===31){if(t=T(a),t!==null){e.blockedOn=t,wo(e.priority,function(){fm(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Hc(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);qi=l,a.target.dispatchEvent(l),qi=null}else return t=yl(a),t!==null&&dm(t),e.blockedOn=a,!1;t.shift()}return!0}function gm(e,t,a){mi(e)&&a.delete(t)}function Rg(){Lc=!1,Ha!==null&&mi(Ha)&&(Ha=null),qa!==null&&mi(qa)&&(qa=null),La!==null&&mi(La)&&(La=null),Zn.forEach(gm),Kn.forEach(gm)}function hi(e,t){e.blockedOn===t&&(e.blockedOn=null,Lc||(Lc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Rg)))}var pi=null;function xm(e){pi!==e&&(pi=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){pi===e&&(pi=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],n=e[t+2];if(typeof l!="function"){if(qc(l||a)===null)continue;break}var i=yl(a);i!==null&&(e.splice(t,3),t-=3,Hr(i,{pending:!0,data:n,method:a.method,action:l},l,n))}}))}function Pl(e){function t(g){return hi(g,e)}Ha!==null&&hi(Ha,e),qa!==null&&hi(qa,e),La!==null&&hi(La,e),Zn.forEach(t),Kn.forEach(t);for(var a=0;a<Ga.length;a++){var l=Ga[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ga.length&&(a=Ga[0],a.blockedOn===null);)pm(a),a.blockedOn===null&&Ga.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var n=a[l],i=a[l+1],c=n[gt]||null;if(typeof i=="function")c||xm(a);else if(c){var d=null;if(i&&i.hasAttribute("formAction")){if(n=i,c=i[gt]||null)d=c.formAction;else if(qc(n)!==null)continue}else d=c.action;typeof d=="function"?a[l+1]=d:(a.splice(l,3),l-=3),xm(a)}}}function ym(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(c){return n=c})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function Gc(e){this._internalRoot=e}gi.prototype.render=Gc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,l=Mt();om(a,l,e,t,null,null)},gi.prototype.unmount=Gc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;om(e.current,2,null,e,null,null),Ws(),t[gl]=null}};function gi(e){this._internalRoot=e}gi.prototype.unstable_scheduleHydration=function(e){if(e){var t=To();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ga.length&&t!==0&&t<Ga[a].priority;a++);Ga.splice(a,0,e),a===0&&pm(e)}};var bm=f.version;if(bm!=="19.2.4")throw Error(o(527,bm,"19.2.4"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=p(t),e=e!==null?A(e):null,e=e===null?null:e.stateNode,e};var Ug={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xi.isDisabled&&xi.supportsFiber)try{an=xi.inject(Ug),Nt=xi}catch{}}return Wn.createRoot=function(e,t){if(!m(e))throw Error(o(299));var a=!1,l="",n=kd,i=Ed,c=Td;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=rm(e,1,!1,null,null,a,l,null,n,i,c,ym),e[gl]=t.current,Sc(e),new Gc(t)},Wn.hydrateRoot=function(e,t,a){if(!m(e))throw Error(o(299));var l=!1,n="",i=kd,c=Ed,d=Td,g=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(c=a.onCaughtError),a.onRecoverableError!==void 0&&(d=a.onRecoverableError),a.formState!==void 0&&(g=a.formState)),t=rm(e,1,!0,t,a??null,l,n,g,i,c,d,ym),t.context=cm(null),a=t.current,l=Mt(),l=Mi(l),n=Ea(l),n.callback=null,Ta(a,n,l),a=l,t.current.lanes=a,nn(t,a),Ft(t),e[gl]=t.current,Sc(e),new gi(t)},Wn.version="19.2.4",Wn}var Cm;function Zg(){if(Cm)return Qc.exports;Cm=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(f){console.error(f)}}return r(),Qc.exports=Xg(),Qc.exports}var Kg=Zg();const yi="/api",Fc="inkos:api-invalidate";function zi(r){const f=String(r??"").trim();return f?f.startsWith(`${yi}/`)||f===yi?f:f.startsWith("/")?`${yi}${f}`:`${yi}/${f}`:null}function Vm(r){const f=zi(r);if(!f)return[];if(f==="/api/books/create")return["/api/books"];if(f==="/api/project")return["/api/project"];if(f.startsWith("/api/project/"))return["/api/project",f];const u=f.match(/^\/api\/books\/([^/]+)\/(write-next|draft)$/);if(u)return["/api/books",`/api/books/${u[1]}`];const o=f.match(/^\/api\/books\/([^/]+)\/chapters\/\d+\/(approve|reject)$/);return o?["/api/books",`/api/books/${o[1]}`]:/^\/api\/daemon\/(start|stop)$/.test(f)?["/api/daemon"]:[]}function Qm(r){!r.length||typeof window>"u"||window.dispatchEvent(new CustomEvent(Fc,{detail:{paths:[...new Set(r)]}}))}async function Jg(r){if((r.headers.get("content-type")??"").includes("application/json"))try{const u=await r.json();if(typeof u.error=="string"&&u.error.trim())return u.error;if(u.error&&typeof u.error=="object"&&"message"in u.error&&typeof u.error.message=="string"&&u.error.message.trim())return u.error.message}catch{}return`${r.status} ${r.statusText}`.trim()}async function He(r,f={},u){const o=zi(r);if(!o)throw new Error("API path is required");const x=await fetch(o,f);if(!x.ok)throw new Error(await Jg(x));if(x.status===204)return;if(!(x.headers.get("content-type")??"").includes("application/json")){const T=await x.text();return T.trim()?JSON.parse(T):void 0}return await x.json()}function Pe(r){const[f,u]=D.useState(null),[o,m]=D.useState(!0),[x,y]=D.useState(null),T=D.useCallback(async()=>{const h=zi(r);if(!h){u(null),y(null),m(!1);return}m(!0),y(null);try{const p=await He(h);u(p)}catch(p){y(p instanceof Error?p.message:String(p))}finally{m(!1)}},[r]);return D.useEffect(()=>{T()},[T]),D.useEffect(()=>{const h=zi(r);if(!h||typeof window>"u")return;const p=A=>{const S=A.detail;S!=null&&S.paths.includes(h)&&T()};return window.addEventListener(Fc,p),()=>{window.removeEventListener(Fc,p)}},[r,T]),{data:f,loading:o,error:x,refetch:T}}async function ft(r,f){const u=await He(r,{method:"POST",headers:{"Content-Type":"application/json"},body:f?JSON.stringify(f):void 0});return Qm(Vm(r)),u}async function $g(r,f){const u=await He(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:f?JSON.stringify(f):void 0});return Qm(Vm(r)),u}const Wg=new Set(["write:start","draft:start"]),Fg=new Set(["write:complete","write:error","draft:complete","draft:error"]),Ig=new Set(["write:complete","write:error","draft:complete","draft:error","rewrite:complete","rewrite:error","revise:complete","revise:error","audit:complete","audit:error"]),Pg=new Set(["book:created","book:deleted","book:error","write:complete","write:error","draft:complete","draft:error","rewrite:complete","rewrite:error","revise:complete","revise:error","audit:complete","audit:error"]),ex=new Set(["daemon:started","daemon:stopped","daemon:error"]);function no(r){const f=r.data;return typeof(f==null?void 0:f.bookId)=="string"?f.bookId:null}function tx(r){const f=new Set;for(const u of r){const o=no(u);if(o){if(Wg.has(u.event)){f.add(o);continue}Fg.has(u.event)&&f.delete(o)}}return f}function ax(r,f){let u=!1,o=!1,m=null;for(const x of r){if(no(x)!==f)continue;const y=x.data;switch(x.event){case"write:start":u=!0,m=null;break;case"write:complete":u=!1,m=null;break;case"write:error":u=!1,m=typeof(y==null?void 0:y.error)=="string"?y.error:"Unknown error";break;case"draft:start":o=!0,m=null;break;case"draft:complete":o=!1,m=null;break;case"draft:error":o=!1,m=typeof(y==null?void 0:y.error)=="string"?y.error:"Unknown error";break}}return{writing:u,drafting:o,lastError:m}}function lx(r,f){return no(r)===f&&Ig.has(r.event)}function Xm(r){return!!(r&&Pg.has(r.event))}function Zm(r){return!!(r&&ex.has(r.event))}/**
50
+ * @license lucide-react v0.577.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Km=(...r)=>r.filter((f,u,o)=>!!f&&f.trim()!==""&&o.indexOf(f)===u).join(" ").trim();/**
55
+ * @license lucide-react v0.577.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */const nx=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
60
+ * @license lucide-react v0.577.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const sx=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(f,u,o)=>o?o.toUpperCase():u.toLowerCase());/**
65
+ * @license lucide-react v0.577.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const Am=r=>{const f=sx(r);return f.charAt(0).toUpperCase()+f.slice(1)};/**
70
+ * @license lucide-react v0.577.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */var ix={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
75
+ * @license lucide-react v0.577.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const rx=r=>{for(const f in r)if(f.startsWith("aria-")||f==="role"||f==="title")return!0;return!1};/**
80
+ * @license lucide-react v0.577.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const cx=D.forwardRef(({color:r="currentColor",size:f=24,strokeWidth:u=2,absoluteStrokeWidth:o,className:m="",children:x,iconNode:y,...T},h)=>D.createElement("svg",{ref:h,...ix,width:f,height:f,stroke:r,strokeWidth:o?Number(u)*24/Number(f):u,className:Km("lucide",m),...!x&&!rx(T)&&{"aria-hidden":"true"},...T},[...y.map(([p,A])=>D.createElement(p,A)),...Array.isArray(x)?x:[x]]));/**
85
+ * @license lucide-react v0.577.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const se=(r,f)=>{const u=D.forwardRef(({className:o,...m},x)=>D.createElement(cx,{ref:x,iconNode:f,className:Km(`lucide-${nx(Am(r))}`,`lucide-${r}`,o),...m}));return u.displayName=Am(r),u};/**
90
+ * @license lucide-react v0.577.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const ox=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ux=se("arrow-up",ox);/**
95
+ * @license lucide-react v0.577.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const dx=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],fx=se("badge-check",dx);/**
100
+ * @license lucide-react v0.577.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const mx=[["path",{d:"M5 7a2 2 0 0 0-2 2v11",key:"1yhqjt"}],["path",{d:"M5.803 18H5a2 2 0 0 0 0 4h9.5a.5.5 0 0 0 .5-.5V21",key:"edzzo5"}],["path",{d:"M9 15V4a2 2 0 0 1 2-2h9.5a.5.5 0 0 1 .5.5v14a.5.5 0 0 1-.5.5H11a2 2 0 0 1 0-4h10",key:"1nwzrg"}]],hx=se("book-copy",mx);/**
105
+ * @license lucide-react v0.577.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const px=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ic=se("book-open",px);/**
110
+ * @license lucide-react v0.577.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const gx=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],xx=se("book",gx);/**
115
+ * @license lucide-react v0.577.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const yx=[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z",key:"11gyqh"}],["path",{d:"M9 11v2",key:"1ueba0"}]],bx=se("bot-message-square",yx);/**
120
+ * @license lucide-react v0.577.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const vx=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],jx=se("boxes",vx);/**
125
+ * @license lucide-react v0.577.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const Sx=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Jm=se("brain",Sx);/**
130
+ * @license lucide-react v0.577.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const Nx=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],zx=se("chart-column",Nx);/**
135
+ * @license lucide-react v0.577.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const kx=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],$m=se("chart-no-axes-column",kx);/**
140
+ * @license lucide-react v0.577.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Ex=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Tx=se("check-check",Ex);/**
145
+ * @license lucide-react v0.577.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const wx=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Wm=se("check",wx);/**
150
+ * @license lucide-react v0.577.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const Cx=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ax=se("chevron-left",Cx);/**
155
+ * @license lucide-react v0.577.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const Mx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Fm=se("circle-alert",Mx);/**
160
+ * @license lucide-react v0.577.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const _x=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ti=se("circle-check",_x);/**
165
+ * @license lucide-react v0.577.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const Ox=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],so=se("circle-x",Ox);/**
170
+ * @license lucide-react v0.577.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const Dx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Pc=se("clock",Dx);/**
175
+ * @license lucide-react v0.577.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const Rx=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Ux=se("database",Rx);/**
180
+ * @license lucide-react v0.577.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const Bx=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],io=se("download",Bx);/**
185
+ * @license lucide-react v0.577.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const Hx=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],qx=se("ellipsis-vertical",Hx);/**
190
+ * @license lucide-react v0.577.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const Lx=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Im=se("eye",Lx);/**
195
+ * @license lucide-react v0.577.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const Gx=[["path",{d:"M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z",key:"18jl4k"}],["path",{d:"M16 8 2 22",key:"vp34q"}],["path",{d:"M17.5 15H9",key:"1oz8nu"}]],Yx=se("feather",Gx);/**
200
+ * @license lucide-react v0.577.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const Vx=[["path",{d:"M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1",key:"1q9hii"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],eo=se("file-input",Vx);/**
205
+ * @license lucide-react v0.577.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const Qx=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],Xx=se("file-output",Qx);/**
210
+ * @license lucide-react v0.577.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const Zx=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],to=se("file-text",Zx);/**
215
+ * @license lucide-react v0.577.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const Kx=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],Jx=se("flame",Kx);/**
220
+ * @license lucide-react v0.577.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const $x=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Wx=se("hash",$x);/**
225
+ * @license lucide-react v0.577.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const Fx=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Ix=se("lightbulb",Fx);/**
230
+ * @license lucide-react v0.577.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const Px=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],ey=se("list",Px);/**
235
+ * @license lucide-react v0.577.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const ty=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],es=se("loader-circle",ty);/**
240
+ * @license lucide-react v0.577.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const ay=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Pm=se("message-square",ay);/**
245
+ * @license lucide-react v0.577.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const ly=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ny=se("moon",ly);/**
250
+ * @license lucide-react v0.577.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const sy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],iy=se("panel-right-close",sy);/**
255
+ * @license lucide-react v0.577.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const ry=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],cy=se("pen-tool",ry);/**
260
+ * @license lucide-react v0.577.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const oy=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ro=se("pencil",oy);/**
265
+ * @license lucide-react v0.577.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const uy=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ki=se("plus",uy);/**
270
+ * @license lucide-react v0.577.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const dy=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],fy=se("refresh-cw",dy);/**
275
+ * @license lucide-react v0.577.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const my=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],co=se("rotate-ccw",my);/**
280
+ * @license lucide-react v0.577.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const hy=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],oo=se("save",hy);/**
285
+ * @license lucide-react v0.577.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const py=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],gy=se("scroll-text",py);/**
290
+ * @license lucide-react v0.577.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const xy=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yy=se("search",xy);/**
295
+ * @license lucide-react v0.577.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const by=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],eh=se("settings",by);/**
300
+ * @license lucide-react v0.577.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const vy=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],jy=se("shield-check",vy);/**
305
+ * @license lucide-react v0.577.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const Sy=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Ny=se("shield",Sy);/**
310
+ * @license lucide-react v0.577.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const zy=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],uo=se("sparkles",zy);/**
315
+ * @license lucide-react v0.577.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const ky=[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]],th=se("stethoscope",ky);/**
320
+ * @license lucide-react v0.577.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const Ey=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ty=se("sun",Ey);/**
325
+ * @license lucide-react v0.577.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const wy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Cy=se("target",wy);/**
330
+ * @license lucide-react v0.577.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const Ay=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],My=se("terminal",Ay);/**
335
+ * @license lucide-react v0.577.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const _y=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],wi=se("trash-2",_y);/**
340
+ * @license lucide-react v0.577.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const Oy=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],fo=se("trending-up",Oy);/**
345
+ * @license lucide-react v0.577.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const Dy=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],mo=se("triangle-alert",Dy);/**
350
+ * @license lucide-react v0.577.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const Ry=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Uy=se("type",Ry);/**
355
+ * @license lucide-react v0.577.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const By=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Hy=se("upload",By);/**
360
+ * @license lucide-react v0.577.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const qy=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ly=se("user",qy);/**
365
+ * @license lucide-react v0.577.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const Gy=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],ho=se("wand-sparkles",Gy);/**
370
+ * @license lucide-react v0.577.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const Yy=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Vy=se("wrench",Yy);/**
375
+ * @license lucide-react v0.577.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const Qy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],po=se("x",Qy);/**
380
+ * @license lucide-react v0.577.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const Xy=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ml=se("zap",Xy);function Zy({nav:r,activePage:f,sse:u,t:o}){const{data:m,refetch:x}=Pe("/books"),{data:y,refetch:T}=Pe("/daemon");return D.useEffect(()=>{const h=u.messages.at(-1);h&&(Xm(h)&&x(),Zm(h)&&T())},[x,T,u.messages]),s.jsxs("aside",{className:"w-[260px] shrink-0 border-r border-border bg-background/80 backdrop-blur-md flex flex-col h-full overflow-hidden select-none",children:[s.jsx("div",{className:"px-6 py-8",children:s.jsxs("button",{onClick:r.toDashboard,className:"group flex items-center gap-2 hover:opacity-80 transition-all duration-300",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary flex items-center justify-center text-primary-foreground shadow-lg shadow-primary/20 group-hover:scale-105 transition-transform",children:s.jsx(gy,{size:18})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"font-serif text-xl leading-none italic font-medium",children:"InkOS"}),s.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground font-bold mt-1",children:"Studio"})]})]})}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-2 space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"px-3 mb-3 flex items-center justify-between",children:[s.jsx("span",{className:"text-[11px] uppercase tracking-widest text-muted-foreground font-bold",children:o("nav.books")}),s.jsx("button",{onClick:r.toBookCreate,className:"p-1 rounded-md text-muted-foreground hover:text-primary hover:bg-primary/10 transition-all group",title:o("nav.newBook"),children:s.jsx(ki,{size:14,className:"group-hover:rotate-90 transition-transform duration-300"})})]}),s.jsxs("div",{className:"space-y-1",children:[m==null?void 0:m.books.map(h=>s.jsxs("button",{onClick:()=>r.toBook(h.id),className:`w-full group flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-all duration-200 ${f===`book:${h.id}`?"bg-primary/10 text-primary font-semibold":"text-foreground font-medium hover:text-foreground hover:bg-secondary/50"}`,children:[s.jsx(xx,{size:16,className:f===`book:${h.id}`?"text-primary":"text-muted-foreground group-hover:text-foreground"}),s.jsx("span",{className:"truncate flex-1 text-left",children:h.title}),h.chaptersWritten>0&&s.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground group-hover:bg-primary/20 group-hover:text-primary transition-colors",children:h.chaptersWritten})]},h.id)),(!(m!=null&&m.books)||m.books.length===0)&&s.jsx("div",{className:"px-3 py-6 text-xs text-muted-foreground/70 italic text-center border border-dashed border-border rounded-lg",children:o("dash.noBooks")})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"px-3 mb-3",children:s.jsx("span",{className:"text-[11px] uppercase tracking-widest text-muted-foreground font-bold",children:o("nav.system")})}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Va,{label:o("create.genre"),icon:s.jsx(jx,{size:16}),active:f==="genres",onClick:r.toGenres}),s.jsx(Va,{label:o("nav.config"),icon:s.jsx(eh,{size:16}),active:f==="config",onClick:r.toConfig}),s.jsx(Va,{label:o("nav.daemon"),icon:s.jsx(ml,{size:16}),active:f==="daemon",onClick:r.toDaemon,badge:y!=null&&y.running?o("nav.running"):void 0,badgeColor:y!=null&&y.running?"bg-emerald-500/10 text-emerald-500":"bg-muted text-muted-foreground"}),s.jsx(Va,{label:o("nav.logs"),icon:s.jsx(My,{size:16}),active:f==="logs",onClick:r.toLogs})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"px-3 mb-3",children:s.jsx("span",{className:"text-[11px] uppercase tracking-widest text-muted-foreground font-bold",children:o("nav.tools")})}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Va,{label:o("nav.style"),icon:s.jsx(ho,{size:16}),active:f==="style",onClick:r.toStyle}),s.jsx(Va,{label:o("nav.import"),icon:s.jsx(eo,{size:16}),active:f==="import",onClick:r.toImport}),s.jsx(Va,{label:o("nav.radar"),icon:s.jsx(fo,{size:16}),active:f==="radar",onClick:r.toRadar}),s.jsx(Va,{label:o("nav.doctor"),icon:s.jsx(th,{size:16}),active:f==="doctor",onClick:r.toDoctor})]})]})]}),s.jsx("div",{className:"p-4 border-t border-border bg-secondary/40",children:s.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg bg-card border border-border shadow-sm",children:[s.jsx("div",{className:`w-2 h-2 rounded-full ${y!=null&&y.running?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40"}`}),s.jsx("span",{className:"text-[11px] font-semibold text-foreground/80 uppercase tracking-wider",children:y!=null&&y.running?o("nav.agentOnline"):o("nav.agentOffline")})]})})]})}function Va({label:r,icon:f,active:u,onClick:o,badge:m,badgeColor:x}){return s.jsxs("button",{onClick:o,className:`w-full group flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-all duration-200 ${u?"bg-secondary text-foreground font-semibold shadow-sm border border-border":"text-foreground font-medium hover:text-foreground hover:bg-secondary/50"}`,children:[s.jsx("span",{className:`transition-colors ${u?"text-primary":"text-muted-foreground group-hover:text-foreground"}`,children:f}),s.jsx("span",{className:"flex-1 text-left",children:r}),m&&s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full font-bold uppercase tracking-tight ${x}`,children:m})]})}function ah(r){var f,u,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var m=r.length;for(f=0;f<m;f++)r[f]&&(u=ah(r[f]))&&(o&&(o+=" "),o+=u)}else for(u in r)r[u]&&(o&&(o+=" "),o+=u);return o}function Ky(){for(var r,f,u=0,o="",m=arguments.length;u<m;u++)(r=arguments[u])&&(f=ah(r))&&(o&&(o+=" "),o+=f);return o}const Jy=(r,f)=>{const u=new Array(r.length+f.length);for(let o=0;o<r.length;o++)u[o]=r[o];for(let o=0;o<f.length;o++)u[r.length+o]=f[o];return u},$y=(r,f)=>({classGroupId:r,validator:f}),lh=(r=new Map,f=null,u)=>({nextPart:r,validators:f,classGroupId:u}),Ei="-",Mm=[],Wy="arbitrary..",Fy=r=>{const f=Py(r),{conflictingClassGroups:u,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:y=>{if(y.startsWith("[")&&y.endsWith("]"))return Iy(y);const T=y.split(Ei),h=T[0]===""&&T.length>1?1:0;return nh(T,h,f)},getConflictingClassGroupIds:(y,T)=>{if(T){const h=o[y],p=u[y];return h?p?Jy(p,h):h:p||Mm}return u[y]||Mm}}},nh=(r,f,u)=>{if(r.length-f===0)return u.classGroupId;const m=r[f],x=u.nextPart.get(m);if(x){const p=nh(r,f+1,x);if(p)return p}const y=u.validators;if(y===null)return;const T=f===0?r.join(Ei):r.slice(f).join(Ei),h=y.length;for(let p=0;p<h;p++){const A=y[p];if(A.validator(T))return A.classGroupId}},Iy=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const f=r.slice(1,-1),u=f.indexOf(":"),o=f.slice(0,u);return o?Wy+o:void 0})(),Py=r=>{const{theme:f,classGroups:u}=r;return e0(u,f)},e0=(r,f)=>{const u=lh();for(const o in r){const m=r[o];go(m,u,o,f)}return u},go=(r,f,u,o)=>{const m=r.length;for(let x=0;x<m;x++){const y=r[x];t0(y,f,u,o)}},t0=(r,f,u,o)=>{if(typeof r=="string"){a0(r,f,u);return}if(typeof r=="function"){l0(r,f,u,o);return}n0(r,f,u,o)},a0=(r,f,u)=>{const o=r===""?f:sh(f,r);o.classGroupId=u},l0=(r,f,u,o)=>{if(s0(r)){go(r(o),f,u,o);return}f.validators===null&&(f.validators=[]),f.validators.push($y(u,r))},n0=(r,f,u,o)=>{const m=Object.entries(r),x=m.length;for(let y=0;y<x;y++){const[T,h]=m[y];go(h,sh(f,T),u,o)}},sh=(r,f)=>{let u=r;const o=f.split(Ei),m=o.length;for(let x=0;x<m;x++){const y=o[x];let T=u.nextPart.get(y);T||(T=lh(),u.nextPart.set(y,T)),u=T}return u},s0=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,i0=r=>{if(r<1)return{get:()=>{},set:()=>{}};let f=0,u=Object.create(null),o=Object.create(null);const m=(x,y)=>{u[x]=y,f++,f>r&&(f=0,o=u,u=Object.create(null))};return{get(x){let y=u[x];if(y!==void 0)return y;if((y=o[x])!==void 0)return m(x,y),y},set(x,y){x in u?u[x]=y:m(x,y)}}},ao="!",_m=":",r0=[],Om=(r,f,u,o,m)=>({modifiers:r,hasImportantModifier:f,baseClassName:u,maybePostfixModifierPosition:o,isExternal:m}),c0=r=>{const{prefix:f,experimentalParseClassName:u}=r;let o=m=>{const x=[];let y=0,T=0,h=0,p;const A=m.length;for(let R=0;R<A;R++){const Z=m[R];if(y===0&&T===0){if(Z===_m){x.push(m.slice(h,R)),h=R+1;continue}if(Z==="/"){p=R;continue}}Z==="["?y++:Z==="]"?y--:Z==="("?T++:Z===")"&&T--}const S=x.length===0?m:m.slice(h);let L=S,B=!1;S.endsWith(ao)?(L=S.slice(0,-1),B=!0):S.startsWith(ao)&&(L=S.slice(1),B=!0);const Y=p&&p>h?p-h:void 0;return Om(x,B,L,Y)};if(f){const m=f+_m,x=o;o=y=>y.startsWith(m)?x(y.slice(m.length)):Om(r0,!1,y,void 0,!0)}if(u){const m=o;o=x=>u({className:x,parseClassName:m})}return o},o0=r=>{const f=new Map;return r.orderSensitiveModifiers.forEach((u,o)=>{f.set(u,1e6+o)}),u=>{const o=[];let m=[];for(let x=0;x<u.length;x++){const y=u[x],T=y[0]==="[",h=f.has(y);T||h?(m.length>0&&(m.sort(),o.push(...m),m=[]),o.push(y)):m.push(y)}return m.length>0&&(m.sort(),o.push(...m)),o}},u0=r=>({cache:i0(r.cacheSize),parseClassName:c0(r),sortModifiers:o0(r),...Fy(r)}),d0=/\s+/,f0=(r,f)=>{const{parseClassName:u,getClassGroupId:o,getConflictingClassGroupIds:m,sortModifiers:x}=f,y=[],T=r.trim().split(d0);let h="";for(let p=T.length-1;p>=0;p-=1){const A=T[p],{isExternal:S,modifiers:L,hasImportantModifier:B,baseClassName:Y,maybePostfixModifierPosition:R}=u(A);if(S){h=A+(h.length>0?" "+h:h);continue}let Z=!!R,ce=o(Z?Y.substring(0,R):Y);if(!ce){if(!Z){h=A+(h.length>0?" "+h:h);continue}if(ce=o(Y),!ce){h=A+(h.length>0?" "+h:h);continue}Z=!1}const X=L.length===0?"":L.length===1?L[0]:x(L).join(":"),$=B?X+ao:X,fe=$+ce;if(y.indexOf(fe)>-1)continue;y.push(fe);const ke=m(ce,Z);for(let W=0;W<ke.length;++W){const ae=ke[W];y.push($+ae)}h=A+(h.length>0?" "+h:h)}return h},m0=(...r)=>{let f=0,u,o,m="";for(;f<r.length;)(u=r[f++])&&(o=ih(u))&&(m&&(m+=" "),m+=o);return m},ih=r=>{if(typeof r=="string")return r;let f,u="";for(let o=0;o<r.length;o++)r[o]&&(f=ih(r[o]))&&(u&&(u+=" "),u+=f);return u},h0=(r,...f)=>{let u,o,m,x;const y=h=>{const p=f.reduce((A,S)=>S(A),r());return u=u0(p),o=u.cache.get,m=u.cache.set,x=T,T(h)},T=h=>{const p=o(h);if(p)return p;const A=f0(h,u);return m(h,A),A};return x=y,(...h)=>x(m0(...h))},p0=[],at=r=>{const f=u=>u[r]||p0;return f.isThemeGetter=!0,f},rh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ch=/^\((?:(\w[\w-]*):)?(.+)\)$/i,g0=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,x0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,y0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,b0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,v0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qa=r=>g0.test(r),ye=r=>!!r&&!Number.isNaN(Number(r)),Xa=r=>!!r&&Number.isInteger(Number(r)),Jc=r=>r.endsWith("%")&&ye(r.slice(0,-1)),ga=r=>x0.test(r),oh=()=>!0,S0=r=>y0.test(r)&&!b0.test(r),xo=()=>!1,N0=r=>v0.test(r),z0=r=>j0.test(r),k0=r=>!P(r)&&!ee(r),E0=r=>Ka(r,fh,xo),P=r=>rh.test(r),fl=r=>Ka(r,mh,S0),Dm=r=>Ka(r,D0,ye),T0=r=>Ka(r,ph,oh),w0=r=>Ka(r,hh,xo),Rm=r=>Ka(r,uh,xo),C0=r=>Ka(r,dh,z0),bi=r=>Ka(r,gh,N0),ee=r=>ch.test(r),Fn=r=>hl(r,mh),A0=r=>hl(r,hh),Um=r=>hl(r,uh),M0=r=>hl(r,fh),_0=r=>hl(r,dh),vi=r=>hl(r,gh,!0),O0=r=>hl(r,ph,!0),Ka=(r,f,u)=>{const o=rh.exec(r);return o?o[1]?f(o[1]):u(o[2]):!1},hl=(r,f,u=!1)=>{const o=ch.exec(r);return o?o[1]?f(o[1]):u:!1},uh=r=>r==="position"||r==="percentage",dh=r=>r==="image"||r==="url",fh=r=>r==="length"||r==="size"||r==="bg-size",mh=r=>r==="length",D0=r=>r==="number",hh=r=>r==="family-name",ph=r=>r==="number"||r==="weight",gh=r=>r==="shadow",R0=()=>{const r=at("color"),f=at("font"),u=at("text"),o=at("font-weight"),m=at("tracking"),x=at("leading"),y=at("breakpoint"),T=at("container"),h=at("spacing"),p=at("radius"),A=at("shadow"),S=at("inset-shadow"),L=at("text-shadow"),B=at("drop-shadow"),Y=at("blur"),R=at("perspective"),Z=at("aspect"),ce=at("ease"),X=at("animate"),$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ke=()=>[...fe(),ee,P],W=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto","contain","none"],V=()=>[ee,P,h],oe=()=>[Qa,"full","auto",...V()],q=()=>[Xa,"none","subgrid",ee,P],K=()=>["auto",{span:["full",Xa,ee,P]},Xa,ee,P],le=()=>[Xa,"auto",ee,P],he=()=>["auto","min","max","fr",ee,P],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Ae=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...V()],H=()=>[Qa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],F=()=>[Qa,"screen","full","dvw","lvw","svw","min","max","fit",...V()],de=()=>[Qa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],w=()=>[r,ee,P],b=()=>[...fe(),Um,Rm,{position:[ee,P]}],_=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Q=()=>["auto","cover","contain",M0,E0,{size:[ee,P]}],J=()=>[Jc,Fn,fl],ne=()=>["","none","full",p,ee,P],ie=()=>["",ye,Fn,fl],be=()=>["solid","dashed","dotted","double"],Je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[ye,Jc,Um,Rm],Kt=()=>["","none",Y,ee,P],et=()=>["none",ye,ee,P],pt=()=>["none",ye,ee,P],xa=()=>[ye,ee,P],mt=()=>[Qa,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ga],breakpoint:[ga],color:[oh],container:[ga],"drop-shadow":[ga],ease:["in","out","in-out"],font:[k0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ga],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ga],shadow:[ga],spacing:["px",ye],text:[ga],"text-shadow":[ga],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qa,P,ee,Z]}],container:["container"],columns:[{columns:[ye,P,ee,T]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ke()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:ae()}],"overscroll-x":[{"overscroll-x":ae()}],"overscroll-y":[{"overscroll-y":ae()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{"inset-s":oe(),start:oe()}],end:[{"inset-e":oe(),end:oe()}],"inset-bs":[{"inset-bs":oe()}],"inset-be":[{"inset-be":oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[Xa,"auto",ee,P]}],basis:[{basis:[Qa,"full","auto",T,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ye,Qa,"auto","initial","none",P]}],grow:[{grow:["",ye,ee,P]}],shrink:[{shrink:["",ye,ee,P]}],order:[{order:[Xa,"first","last","none",ee,P]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":he()}],"auto-rows":[{"auto-rows":he()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...Ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...Ae()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...Ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...Ae(),"baseline"]}],"place-self":[{"place-self":["auto",...Ae()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...de()]}],"min-block-size":[{"min-block":["auto",...de()]}],"max-block-size":[{"max-block":["none",...de()]}],w:[{w:[T,"screen",...H()]}],"min-w":[{"min-w":[T,"screen","none",...H()]}],"max-w":[{"max-w":[T,"screen","none","prose",{screen:[y]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",u,Fn,fl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,O0,T0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jc,P]}],"font-family":[{font:[A0,w0,f]}],"font-features":[{"font-features":[P]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[m,ee,P]}],"line-clamp":[{"line-clamp":[ye,"none",ee,Dm]}],leading:[{leading:[x,...V()]}],"list-image":[{"list-image":["none",ee,P]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[ye,"from-font","auto",ee,fl]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[ye,"auto",ee,P]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,P]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,P]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:b()}],"bg-repeat":[{bg:_()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xa,ee,P],radial:["",ee,P],conic:[Xa,ee,P]},_0,C0]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-bs":[{"border-bs":w()}],"border-color-be":[{"border-be":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ye,ee,P]}],"outline-w":[{outline:["",ye,Fn,fl]}],"outline-color":[{outline:w()}],shadow:[{shadow:["","none",A,vi,bi]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":["none",S,vi,bi]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[ye,fl]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":["none",L,vi,bi]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[ye,ee,P]}],"mix-blend":[{"mix-blend":[...Je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[ee,P]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":fe()}],"mask-image-conic-pos":[{"mask-conic":[ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:b()}],"mask-repeat":[{mask:_()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,P]}],filter:[{filter:["","none",ee,P]}],blur:[{blur:Kt()}],brightness:[{brightness:[ye,ee,P]}],contrast:[{contrast:[ye,ee,P]}],"drop-shadow":[{"drop-shadow":["","none",B,vi,bi]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:["",ye,ee,P]}],"hue-rotate":[{"hue-rotate":[ye,ee,P]}],invert:[{invert:["",ye,ee,P]}],saturate:[{saturate:[ye,ee,P]}],sepia:[{sepia:["",ye,ee,P]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,P]}],"backdrop-blur":[{"backdrop-blur":Kt()}],"backdrop-brightness":[{"backdrop-brightness":[ye,ee,P]}],"backdrop-contrast":[{"backdrop-contrast":[ye,ee,P]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ye,ee,P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ye,ee,P]}],"backdrop-invert":[{"backdrop-invert":["",ye,ee,P]}],"backdrop-opacity":[{"backdrop-opacity":[ye,ee,P]}],"backdrop-saturate":[{"backdrop-saturate":[ye,ee,P]}],"backdrop-sepia":[{"backdrop-sepia":["",ye,ee,P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,P]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ye,"initial",ee,P]}],ease:[{ease:["linear","initial",ce,ee,P]}],delay:[{delay:[ye,ee,P]}],animate:[{animate:["none",X,ee,P]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[R,ee,P]}],"perspective-origin":[{"perspective-origin":ke()}],rotate:[{rotate:et()}],"rotate-x":[{"rotate-x":et()}],"rotate-y":[{"rotate-y":et()}],"rotate-z":[{"rotate-z":et()}],scale:[{scale:pt()}],"scale-x":[{"scale-x":pt()}],"scale-y":[{"scale-y":pt()}],"scale-z":[{"scale-z":pt()}],"scale-3d":["scale-3d"],skew:[{skew:xa()}],"skew-x":[{"skew-x":xa()}],"skew-y":[{"skew-y":xa()}],transform:[{transform:[ee,P,"","none","gpu","cpu"]}],"transform-origin":[{origin:ke()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:mt()}],"translate-x":[{"translate-x":mt()}],"translate-y":[{"translate-y":mt()}],"translate-z":[{"translate-z":mt()}],"translate-none":["translate-none"],accent:[{accent:w()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:w()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,P]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,P]}],fill:[{fill:["none",...w()]}],"stroke-w":[{stroke:[ye,Fn,fl,Dm]}],stroke:[{stroke:["none",...w()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},U0=h0(R0);function Pn(...r){return U0(Ky(r))}function B0(r){return r.filter(f=>f.role==="user"||f.role==="assistant").map(f=>({role:f.role,content:f.content,timestamp:f.timestamp}))}function H0(r,f){return r&&f.some(u=>u.id===r)?{bookId:r,reason:"active"}:f.length===1?{bookId:f[0].id,reason:"single"}:f.length===0?{bookId:null,reason:"missing"}:{bookId:null,reason:"ambiguous"}}function q0(r){return[r.activeBookId??"no-book",r.draftTitle?`draft:${r.draftTitle}`:void 0,r.automationMode??"semi",r.currentStage].filter(Boolean).join(" · ")}function L0({phase:r}){const f=r.toLowerCase();return f.includes("think")||f.includes("plan")?s.jsx(Jm,{size:14,className:"text-purple-500 animate-pulse"}):f.includes("writ")||f.includes("draft")||f.includes("stream")?s.jsx(cy,{size:14,className:"text-blue-500 chat-icon-write"}):f.includes("audit")||f.includes("review")?s.jsx(Ny,{size:14,className:"text-amber-500 animate-pulse"}):f.includes("revis")||f.includes("fix")||f.includes("spot")?s.jsx(Vy,{size:14,className:"text-orange-500 chat-icon-spin-slow"}):f.includes("complet")||f.includes("done")||f.includes("success")?s.jsx(Ti,{size:14,className:"text-emerald-500 chat-icon-pop"}):f.includes("error")||f.includes("fail")?s.jsx(mo,{size:14,className:"text-destructive animate-pulse"}):s.jsx(es,{size:14,className:"text-primary animate-spin"})}function G0(){return s.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center opacity-40 select-none fade-in",children:[s.jsx("div",{className:"w-14 h-14 rounded-2xl border border-dashed border-border flex items-center justify-center mb-4 bg-secondary/30",children:s.jsx(bx,{size:24,className:"text-muted-foreground"})}),s.jsx("p",{className:"text-sm italic font-serif mb-1",children:"How shall we proceed today?"}),s.jsx("p",{className:"text-[10px] text-muted-foreground/60 uppercase tracking-widest",children:"Type a command below"})]})}function Y0(){return s.jsxs("div",{className:"flex gap-2.5 chat-msg-assistant",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-secondary flex items-center justify-center shrink-0 chat-thinking-glow",children:s.jsx(Jm,{size:14,className:"text-primary animate-pulse"})}),s.jsxs("div",{className:"bg-card border border-border/50 px-3.5 py-2.5 rounded-2xl rounded-tl-sm flex gap-1.5 items-center",children:[s.jsx("span",{className:"w-1.5 h-1.5 bg-primary/50 rounded-full chat-typing-dot"}),s.jsx("span",{className:"w-1.5 h-1.5 bg-primary/50 rounded-full chat-typing-dot"}),s.jsx("span",{className:"w-1.5 h-1.5 bg-primary/50 rounded-full chat-typing-dot"})]})]})}function V0({msg:r}){const f=r.role==="user",u=r.content.startsWith("⋯"),o=r.content.startsWith("✓"),m=r.content.startsWith("✗");return s.jsxs("div",{className:Pn("flex gap-2.5",f?"flex-row-reverse chat-msg-user":"chat-msg-assistant"),children:[s.jsx("div",{className:Pn("w-7 h-7 rounded-lg flex items-center justify-center shrink-0 mt-0.5 transition-colors",f?"bg-primary/10":"bg-secondary"),children:f?s.jsx(Ly,{size:14,className:"text-primary"}):o?s.jsx(Ti,{size:14,className:"text-emerald-500 chat-icon-pop"}):m?s.jsx(so,{size:14,className:"text-destructive"}):u?s.jsx(es,{size:14,className:"text-primary animate-spin"}):s.jsx(uo,{size:14,className:"text-primary"})}),s.jsxs("div",{className:Pn("max-w-[80%] rounded-2xl px-3.5 py-2 text-sm leading-relaxed shadow-sm",f?"bg-primary text-primary-foreground font-medium rounded-tr-sm":u?"bg-secondary/50 border border-border/30 text-muted-foreground font-mono text-xs rounded-tl-sm":"bg-card border border-border/50 text-foreground font-serif rounded-tl-sm"),children:[o&&s.jsxs("span",{className:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400 font-sans font-medium text-[10px] mb-1 uppercase tracking-wider",children:[s.jsx(fx,{size:11}),"Complete"]}),m&&s.jsxs("span",{className:"flex items-center gap-1.5 text-destructive font-sans font-medium text-[10px] mb-1 uppercase tracking-wider",children:[s.jsx(Fm,{size:11}),"Error"]}),s.jsx("div",{children:r.content}),s.jsx("div",{className:Pn("text-[9px] mt-1.5 font-mono",f?"text-primary-foreground/40":"text-muted-foreground/40"),children:new Date(r.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}function ji({icon:r,label:f,onClick:u}){return s.jsxs("button",{onClick:u,className:"shrink-0 flex items-center gap-1 px-2.5 py-1 rounded-lg bg-secondary/50 border border-border/30 text-[10px] font-medium text-muted-foreground hover:text-primary hover:border-primary/30 hover:bg-primary/5 transition-all group",children:[s.jsx("span",{className:"group-hover:scale-110 transition-transform",children:r}),f]})}function Q0({open:r,onClose:f,t:u,sse:o,activeBookId:m}){const[x,y]=D.useState(""),[T,h]=D.useState([]),[p,A]=D.useState(!1),[S,L]=D.useState({}),B=D.useRef(null),Y=D.useRef(null);D.useEffect(()=>{Y.current&&Y.current.scrollTo({top:Y.current.scrollHeight,behavior:"smooth"})},[T,o.messages.length]),D.useEffect(()=>{r&&setTimeout(()=>{var q;return(q=B.current)==null?void 0:q.focus()},300)},[r]),D.useEffect(()=>{if(!r)return;let q=!1;return He("/interaction/session").then(K=>{var le,he,Ee,Ae,k,H,F,de,w,b;q||(L({activeBookId:K.activeBookId??((le=K.session)==null?void 0:le.activeBookId),draftTitle:(Ee=(he=K.session)==null?void 0:he.creationDraft)==null?void 0:Ee.title,automationMode:(Ae=K.session)==null?void 0:Ae.automationMode,currentStage:((H=(k=K.session)==null?void 0:k.currentExecution)==null?void 0:H.stageLabel)??((de=(F=K.session)==null?void 0:F.currentExecution)==null?void 0:de.status),pendingSummary:(b=(w=K.session)==null?void 0:w.pendingDecision)==null?void 0:b.summary}),h(_=>{var Q;return _.length>0?_:B0(((Q=K.session)==null?void 0:Q.messages)??[])}))}).catch(()=>{}),()=>{q=!0}},[r]);const R=D.useRef(!1);R.current=p,D.useEffect(()=>{const q=o.messages.slice(-1)[0];if(!q||q.event==="ping")return;const K=q.data;if(q.event==="write:complete"||q.event==="draft:complete"){A(!1);const le=K.title??`Chapter ${K.chapterNumber}`;h(he=>{var Ee;return[...he,{role:"assistant",content:`✓ ${le} (${((Ee=K.wordCount)==null?void 0:Ee.toLocaleString())??"?"} chars)`,timestamp:Date.now()}]})}if((q.event==="write:error"||q.event==="draft:error")&&(A(!1),h(le=>[...le,{role:"assistant",content:`✗ ${K.error??"Unknown error"}`,timestamp:Date.now()}])),q.event==="log"&&R.current){const le=K.message;le&&(le.includes("Phase")||le.includes("streaming")||le.includes("Writing")||le.includes("Audit")||le.includes("Revis"))&&h(he=>{const Ee=he[he.length-1];return(Ee==null?void 0:Ee.role)==="assistant"&&Ee.content.startsWith("⋯")?[...he.slice(0,-1),{role:"assistant",content:`⋯ ${le}`,timestamp:Date.now()}]:[...he,{role:"assistant",content:`⋯ ${le}`,timestamp:Date.now()}]})}},[o.messages.length]);const Z=D.useMemo(()=>{const q=[...T].reverse().find(K=>K.role==="assistant"&&K.content.startsWith("⋯"));return(q==null?void 0:q.content.replace("⋯ ",""))??"Initializing..."},[T]),ce=async q=>{var le,he,Ee,Ae;const K=q.toLowerCase();try{if(K.match(/^(写下一章|write next)/)){const{books:H}=await He("/books"),F=H0(m,H);if(F.bookId){h(de=>[...de,{role:"assistant",content:fe?`⋯ 开始处理《${F.bookId}》...`:`⋯ Starting ${F.bookId}...`,timestamp:Date.now()}]),await ft(`/books/${F.bookId}/write-next`,{});return}A(!1),h(de=>[...de,{role:"assistant",content:F.reason==="missing"?fe?"✗ 还没有书,先创建一本再写。":"✗ No books yet. Create one first.":fe?"✗ 当前有多本书,请先打开目标书籍后再执行“写下一章”。":'✗ Multiple books found. Open the target book first, then run "write next".',timestamp:Date.now()}]);return}const k=await He("/agent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({instruction:q,activeBookId:m})});A(!1),k.session&&L({activeBookId:k.session.activeBookId??m,draftTitle:(le=k.session.creationDraft)==null?void 0:le.title,automationMode:k.session.automationMode,currentStage:((he=k.session.currentExecution)==null?void 0:he.stageLabel)??((Ee=k.session.currentExecution)==null?void 0:Ee.status),pendingSummary:(Ae=k.session.pendingDecision)==null?void 0:Ae.summary}),h(H=>[...H,{role:"assistant",content:k.response??"Acknowledged.",timestamp:Date.now()}])}catch(k){A(!1),h(H=>[...H,{role:"assistant",content:`✗ ${k instanceof Error?k.message:String(k)}`,timestamp:Date.now()}])}},X=async()=>{const q=x.trim();!q||p||(y(""),h(K=>[...K,{role:"user",content:q,timestamp:Date.now()}]),A(!0),await ce(q))},$=async q=>{p||(y(""),h(K=>[...K,{role:"user",content:q,timestamp:Date.now()}]),A(!0),await ce(q))},fe=u("nav.connected")==="已连接",ae=fe?["写下一章","审计第5章","帮我创建一本都市修仙小说","扫描市场趋势","导出全书为 epub","分析文风 → 导入到我的书","导入已有章节续写","创建一个玄幻题材的同人","修订第5章,spot-fix"]:["write next chapter","audit chapter 5","create a LitRPG novel","scan market trends","export book as epub","analyze style → import","import chapters to continue","create a progression fantasy fanfic","revise chapter 5, spot-fix"],[V,oe]=D.useState(()=>Math.floor(Math.random()*ae.length));return D.useEffect(()=>{if(x)return;const q=setInterval(()=>oe(K=>(K+1)%ae.length),8e3);return()=>clearInterval(q)},[x,ae.length]),s.jsx("aside",{className:Pn("h-full flex flex-col border-l border-border/40 bg-background/80 backdrop-blur-md chat-panel-enter shrink-0 overflow-hidden",r?"w-[380px] opacity-100":"w-0 opacity-0"),children:r&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"h-12 shrink-0 px-4 flex items-center justify-between border-b border-border/40",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsxs("div",{className:"relative shrink-0",children:[s.jsx(uo,{size:15,className:"text-primary chat-icon-glow"}),p&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 bg-primary rounded-full animate-ping"})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] font-bold text-muted-foreground",children:"InkOS Assistant"}),s.jsx("div",{className:"text-[10px] text-muted-foreground/60 truncate",children:q0({activeBookId:S.activeBookId??m,automationMode:S.automationMode,currentStage:S.currentStage})})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>h([]),className:"p-1.5 rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors group",title:"Clear conversation",children:s.jsx(wi,{size:14,className:"group-hover:animate-[shake_0.3s_ease-in-out]"})}),s.jsx("button",{onClick:f,className:"p-1.5 rounded-md text-muted-foreground hover:bg-secondary transition-colors group",title:"Close panel",children:s.jsx(iy,{size:14,className:"group-hover:translate-x-0.5 transition-transform"})})]})]}),p&&s.jsx("div",{className:"shrink-0 px-4 py-2 border-b border-border/30 bg-primary/[0.03] fade-in",children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(L0,{phase:Z}),s.jsx("span",{className:"text-xs font-medium text-primary truncate flex-1",children:Z}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx("span",{className:"w-1 h-1 bg-primary/40 rounded-full chat-typing-dot"}),s.jsx("span",{className:"w-1 h-1 bg-primary/40 rounded-full chat-typing-dot"}),s.jsx("span",{className:"w-1 h-1 bg-primary/40 rounded-full chat-typing-dot"})]})]})}),!p&&S.pendingSummary&&s.jsx("div",{className:"shrink-0 px-4 py-2 border-b border-border/30 bg-amber-500/[0.06] fade-in",children:s.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-amber-700 dark:text-amber-300",children:[s.jsx(mo,{size:12}),s.jsx("span",{className:"truncate",children:S.pendingSummary})]})}),s.jsxs("div",{ref:Y,className:"flex-1 overflow-y-auto px-4 py-4 space-y-3",children:[T.length===0&&!p&&s.jsx(G0,{}),T.map((q,K)=>s.jsx(V0,{msg:q},`${q.timestamp}-${K}`)),p&&!T.some(q=>q.content.startsWith("⋯"))&&s.jsx(Y0,{})]}),s.jsxs("div",{className:"shrink-0 px-3 py-2 border-t border-border/30 flex gap-1.5 overflow-x-auto",children:[s.jsx(ji,{icon:s.jsx(ml,{size:11}),label:u("dash.writeNext"),onClick:()=>void $(fe?"写下一章":"write next")}),s.jsx(ji,{icon:s.jsx(yy,{size:11}),label:u("book.audit"),onClick:()=>void $(fe?"审计第1章":"audit chapter 1")}),s.jsx(ji,{icon:s.jsx(Xx,{size:11}),label:u("book.export"),onClick:()=>void $(fe?"导出全书":"export book as epub")}),s.jsx(ji,{icon:s.jsx(fo,{size:11}),label:u("nav.radar"),onClick:()=>void $(fe?"扫描市场趋势":"scan market trends")})]}),s.jsxs("div",{className:"shrink-0 p-3 border-t border-border/40",children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-xl bg-secondary/30 border border-border/40 px-3 py-1.5 focus-within:border-primary/40 focus-within:ring-2 focus-within:ring-primary/10 transition-all",children:[s.jsx(Pm,{size:14,className:"text-muted-foreground/50 shrink-0"}),s.jsx("input",{ref:B,type:"text",value:x,onChange:q=>y(q.target.value),onKeyDown:q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),X())},placeholder:u("common.enterCommand"),disabled:p,className:"flex-1 bg-transparent text-sm placeholder:text-muted-foreground/50 outline-none ring-0 shadow-none disabled:opacity-50",style:{outline:"none",boxShadow:"none"}}),s.jsx("button",{onClick:X,disabled:!x.trim()||p,className:"w-7 h-7 rounded-lg bg-primary text-primary-foreground flex items-center justify-center hover:scale-105 active:scale-95 transition-all disabled:opacity-20 disabled:scale-100 shadow-sm shadow-primary/20",children:p?s.jsx(es,{size:14,className:"animate-spin"}):s.jsx(ux,{size:14,strokeWidth:2.5})})]}),!x&&s.jsxs("div",{className:"mt-1.5 px-1 flex items-center gap-1.5",children:[s.jsx(Ix,{size:10,className:"text-muted-foreground/30 shrink-0"}),s.jsx("span",{className:"text-[9px] text-muted-foreground/40 truncate fade-in",children:ae[V]},V)]})]})]})})}function Vt(r){return{card:"border-border hover:border-primary/40 transition-all duration-200",cardStatic:"border-border",surface:"bg-card",muted:"text-muted-foreground",subtle:"text-muted-foreground",link:"hover:text-primary transition-colors cursor-pointer",input:"bg-input/40 border border-border text-foreground focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all duration-200",btnPrimary:"bg-primary text-primary-foreground hover:opacity-90 active:opacity-80 transition-opacity",btnSecondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 transition-colors",btnSuccess:"bg-emerald-600 text-white hover:bg-emerald-700 dark:bg-emerald-700 dark:hover:bg-emerald-600 transition-colors",btnDanger:"bg-destructive text-destructive-foreground hover:opacity-90 transition-opacity",tableHeader:"bg-muted/60 text-muted-foreground text-xs uppercase tracking-wider font-medium",tableDivide:"divide-border",tableHover:"hover:bg-muted/40 transition-colors",error:"border-destructive/50 bg-destructive/10 text-destructive",info:"border-primary/30 bg-primary/8 text-primary",code:"bg-muted text-foreground/80 font-mono",active:"text-emerald-500",paused:"text-amber-500",mono:"font-mono text-sm",accent:"text-primary"}}function yo({open:r,title:f,message:u,confirmLabel:o,cancelLabel:m,variant:x="default",onConfirm:y,onCancel:T}){const h=D.useRef(null);if(D.useEffect(()=>{if(!r)return;const A=S=>{S.key==="Escape"&&T()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[r,T]),!r)return null;const p=x==="danger";return s.jsx("div",{ref:h,className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm fade-in",onClick:A=>{A.target===h.current&&T()},children:s.jsxs("div",{className:"bg-card border border-border rounded-2xl shadow-2xl shadow-primary/10 w-full max-w-md mx-4 overflow-hidden chat-msg-assistant",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 pt-6 pb-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[p&&s.jsx("div",{className:"w-10 h-10 rounded-xl bg-destructive/10 flex items-center justify-center",children:s.jsx(mo,{size:20,className:"text-destructive"})}),s.jsx("h3",{className:"text-lg font-semibold",children:f})]}),s.jsx("button",{onClick:T,className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",children:s.jsx(po,{size:16})})]}),s.jsx("div",{className:"px-6 py-4",children:s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:u})}),s.jsxs("div",{className:"flex justify-end gap-3 px-6 pb-6",children:[s.jsx("button",{onClick:T,className:"px-4 py-2.5 text-sm font-medium rounded-xl bg-secondary text-foreground hover:bg-secondary/80 transition-all border border-border/50",children:m}),s.jsx("button",{onClick:y,className:`px-4 py-2.5 text-sm font-bold rounded-xl transition-all hover:scale-105 active:scale-95 shadow-sm ${p?"bg-destructive text-white hover:shadow-destructive/20":"bg-primary text-primary-foreground hover:shadow-primary/20"}`,children:o})]})]})})}function X0({bookId:r,bookTitle:f,nav:u,t:o,onDelete:m,onOpenChange:x}){const[y,T]=D.useState(!1),h=B=>{T(Y=>{const R=typeof B=="function"?B(Y):B;return x==null||x(R),R})},[p,A]=D.useState(!1),S=D.useRef(null);D.useEffect(()=>{if(!y)return;const B=Y=>{S.current&&!S.current.contains(Y.target)&&h(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[y]);const L=async()=>{A(!1),h(!1),await He(`/books/${r}`,{method:"DELETE"}),m()};return s.jsxs("div",{ref:S,className:"relative",children:[s.jsx("button",{onClick:()=>h(B=>!B),className:"p-3 rounded-xl text-muted-foreground hover:text-primary hover:bg-primary/10 hover:scale-105 active:scale-95 transition-all cursor-pointer",children:s.jsx(qx,{size:18})}),y&&s.jsxs("div",{className:"absolute right-0 top-full mt-1 w-44 bg-card border border-border rounded-xl shadow-lg shadow-primary/5 py-1 z-50 fade-in",children:[s.jsxs("button",{onClick:()=>{h(!1),u.toBook(r)},className:"w-full flex items-center gap-2.5 px-4 py-2.5 text-sm text-foreground hover:bg-secondary/50 transition-colors cursor-pointer",children:[s.jsx(eh,{size:14,className:"text-muted-foreground"}),o("book.settings")]}),s.jsxs("a",{href:`/api/books/${r}/export?format=txt`,download:!0,onClick:()=>h(!1),className:"w-full flex items-center gap-2.5 px-4 py-2.5 text-sm text-foreground hover:bg-secondary/50 transition-colors cursor-pointer",children:[s.jsx(io,{size:14,className:"text-muted-foreground"}),o("book.export")]}),s.jsx("div",{className:"border-t border-border/50 my-1"}),s.jsxs("button",{onClick:()=>{h(!1),A(!0)},className:"w-full flex items-center gap-2.5 px-4 py-2.5 text-sm text-destructive hover:bg-destructive/10 transition-colors cursor-pointer",children:[s.jsx(wi,{size:14}),o("book.deleteBook")]})]}),s.jsx(yo,{open:p,title:o("book.deleteBook"),message:`${o("book.confirmDelete")}
385
+
386
+ "${f}"`,confirmLabel:o("common.delete"),cancelLabel:o("common.cancel"),variant:"danger",onConfirm:L,onCancel:()=>A(!1)})]})}function Z0({nav:r,sse:f,theme:u,t:o}){var B,Y;const[m,x]=D.useState(null),{data:y,loading:T,error:h,refetch:p}=Pe("/books"),A=D.useMemo(()=>tx(f.messages),[f.messages]),S=f.messages.filter(R=>R.event==="log").slice(-8),L=f.messages.filter(R=>R.event==="llm:progress").slice(-1)[0];return D.useEffect(()=>{const R=f.messages.at(-1);R&&Xm(R)&&p()},[p,f.messages]),T?s.jsxs("div",{className:"flex flex-col items-center justify-center py-32 space-y-4",children:[s.jsx("div",{className:"w-8 h-8 border-2 border-primary/20 border-t-primary rounded-full animate-spin"}),s.jsx("span",{className:"text-sm text-muted-foreground animate-pulse",children:"Gathering manuscripts..."})]}):h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-20 bg-destructive/5 border border-destructive/20 rounded-2xl",children:[s.jsx(Fm,{className:"text-destructive mb-4",size:32}),s.jsx("h2",{className:"text-lg font-semibold text-destructive",children:"Failed to load library"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:h})]}):y!=null&&y.books.length?s.jsxs("div",{className:"space-y-12",children:[s.jsxs("div",{className:"flex items-end justify-between border-b border-border/40 pb-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-serif text-4xl mb-2",children:o("dash.title")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o("dash.subtitle")})]}),s.jsxs("button",{onClick:r.toBookCreate,className:"group flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-bold bg-primary text-primary-foreground hover:scale-105 active:scale-95 transition-all shadow-lg shadow-primary/20",children:[s.jsx(ki,{size:16}),o("nav.newBook")]})]}),s.jsx("div",{className:"grid gap-6",children:y.books.map((R,Z)=>{const ce=A.has(R.id),X=`stagger-${Math.min(Z+1,5)}`;return s.jsxs("div",{className:`paper-sheet group relative rounded-2xl fade-in ${X} ${m===R.id?"z-50":""}`,children:[s.jsxs("div",{className:"p-8 flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx("div",{className:"p-2 rounded-lg bg-primary/5 text-primary",children:s.jsx(Ic,{size:20})}),s.jsx("button",{onClick:()=>r.toBook(R.id),className:"font-serif text-2xl hover:text-primary transition-all text-left truncate block font-medium hover:underline underline-offset-4 decoration-primary/30",children:R.title})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-y-2 gap-x-4 text-[13px] text-muted-foreground font-medium",children:[s.jsx("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded bg-secondary/50",children:s.jsx("span",{className:"uppercase tracking-wider",children:R.genre})}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Pc,{size:14}),s.jsxs("span",{children:[R.chaptersWritten," ",o("dash.chapters")]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:`w-2 h-2 rounded-full ${R.status==="active"?"bg-emerald-500":R.status==="paused"?"bg-amber-500":"bg-muted-foreground"}`}),s.jsx("span",{children:R.status==="active"?o("book.statusActive"):R.status==="paused"?o("book.statusPaused"):R.status==="outlining"?o("book.statusOutlining"):R.status==="completed"?o("book.statusCompleted"):R.status==="dropped"?o("book.statusDropped"):R.status})]}),R.language==="en"&&s.jsx("span",{className:"px-1.5 py-0.5 rounded border border-primary/20 text-primary text-[10px] font-bold",children:"EN"}),R.fanficMode&&s.jsxs("span",{className:"flex items-center gap-1 text-purple-500",children:[s.jsx(ml,{size:12}),s.jsx("span",{className:"italic",children:R.fanficMode})]})]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0 ml-6",children:[s.jsx("button",{onClick:async()=>{try{await ft(`/books/${R.id}/write-next`)}catch($){alert($ instanceof Error?$.message:"Write failed")}},disabled:ce,className:`flex items-center gap-2 px-6 py-3 rounded-xl text-sm font-bold transition-all shadow-sm ${ce?"bg-primary/20 text-primary cursor-wait animate-pulse":"bg-secondary text-foreground hover:bg-primary hover:text-primary-foreground hover:shadow-lg hover:shadow-primary/20 hover:scale-105 active:scale-95"}`,children:ce?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 border-2 border-primary/20 border-t-primary rounded-full animate-spin"}),o("dash.writing")]}):s.jsxs(s.Fragment,{children:[s.jsx(ml,{size:16}),o("dash.writeNext")]})}),s.jsx("button",{onClick:()=>r.toAnalytics(R.id),className:"p-3 rounded-xl bg-secondary text-muted-foreground hover:text-primary hover:bg-primary/10 hover:border-primary/30 hover:shadow-md hover:scale-105 active:scale-95 transition-all border border-border/50 shadow-sm",title:o("dash.stats"),children:s.jsx($m,{size:18})}),s.jsx(X0,{bookId:R.id,bookTitle:R.title,nav:r,t:o,onDelete:()=>p(),onOpenChange:$=>x($?R.id:null)})]})]}),ce&&s.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-secondary overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary w-1/3 animate-[progress_2s_ease-in-out_infinite]"})})]},R.id)})}),A.size>0&&S.length>0&&s.jsxs("div",{className:"glass-panel rounded-2xl p-8 border-primary/20 bg-primary/[0.02] shadow-2xl shadow-primary/5 fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 rounded-lg bg-primary text-primary-foreground shadow-lg shadow-primary/20",children:s.jsx(Jx,{size:18,className:"animate-pulse"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-bold uppercase tracking-widest text-primary",children:" Manuscript Foundry"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Real-time LLM generation tracking"})]})]}),L&&s.jsxs("div",{className:"flex items-center gap-4 text-xs font-bold text-primary px-4 py-2 rounded-full bg-primary/10 border border-primary/20",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Pc,{size:12}),s.jsxs("span",{children:[Math.round((((B=L.data)==null?void 0:B.elapsedMs)??0)/1e3),"s"]})]}),s.jsx("div",{className:"w-px h-3 bg-primary/20"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ml,{size:12}),s.jsxs("span",{children:[(((Y=L.data)==null?void 0:Y.totalChars)??0).toLocaleString()," Chars"]})]})]})]}),s.jsx("div",{className:"space-y-2 font-mono text-xs bg-black/5 dark:bg-black/20 p-6 rounded-xl border border-border/50 max-h-[200px] overflow-y-auto scrollbar-thin",children:S.map((R,Z)=>{const ce=R.data;return s.jsxs("div",{className:"flex gap-3 leading-relaxed animate-in fade-in slide-in-from-left-2 duration-300",children:[s.jsxs("span",{className:"text-primary/60 font-bold shrink-0",children:["[",ce.tag,"]"]}),s.jsx("span",{className:"text-muted-foreground",children:ce.message})]},Z)})})]}),s.jsx("style",{children:`
387
+ @keyframes progress {
388
+ 0% { transform: translateX(-100%); }
389
+ 100% { transform: translateX(300%); }
390
+ }
391
+ `})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[60vh] text-center fade-in",children:[s.jsx("div",{className:"w-20 h-20 rounded-full bg-primary/5 flex items-center justify-center mb-8",children:s.jsx(Ic,{size:40,className:"text-primary/20"})}),s.jsx("h2",{className:"font-serif text-3xl italic text-foreground/80 mb-3",children:o("dash.noBooks")}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-xs leading-relaxed mb-10",children:o("dash.createFirst")}),s.jsxs("button",{onClick:r.toBookCreate,className:"group flex items-center gap-2 px-8 py-3.5 rounded-xl text-sm font-bold bg-primary text-primary-foreground hover:scale-105 active:scale-95 transition-all shadow-lg shadow-primary/20",children:[s.jsx(ki,{size:18}),o("nav.newBook")]})]})}function K0(r,f){var o;const u={"ready-for-review":()=>f("chapter.readyForReview"),approved:()=>f("chapter.approved"),drafted:()=>f("chapter.drafted"),"needs-revision":()=>f("chapter.needsRevision"),imported:()=>f("chapter.imported"),"audit-failed":()=>f("chapter.auditFailed")};return((o=u[r])==null?void 0:o.call(u))??r}const Bm={"ready-for-review":{color:"text-amber-500 bg-amber-500/10",icon:s.jsx(Im,{size:12})},approved:{color:"text-emerald-500 bg-emerald-500/10",icon:s.jsx(Wm,{size:12})},drafted:{color:"text-muted-foreground bg-muted/20",icon:s.jsx(to,{size:12})},"needs-revision":{color:"text-destructive bg-destructive/10",icon:s.jsx(co,{size:12})},imported:{color:"text-blue-500 bg-blue-500/10",icon:s.jsx(io,{size:12})}};function J0({bookId:r,nav:f,theme:u,t:o,sse:m}){const{data:x,loading:y,error:T,refetch:h}=Pe(`/books/${r}`),[p,A]=D.useState(!1),[S,L]=D.useState(!1),[B,Y]=D.useState(!1),[R,Z]=D.useState(!1),[ce,X]=D.useState([]),[$,fe]=D.useState([]),[ke,W]=D.useState([]),[ae,V]=D.useState(!1),[oe,q]=D.useState(null),[K,le]=D.useState(null),[he,Ee]=D.useState(null),[Ae,k]=D.useState("txt"),[H,F]=D.useState(!1),de=D.useMemo(()=>ax(m.messages,r),[r,m.messages]),w=p||de.writing,b=S||de.drafting,_=x?x.nextChapter-1:0;D.useEffect(()=>{const G=m.messages.at(-1);if(!G)return;const qe=G.data;if((qe==null?void 0:qe.bookId)===r){if(G.event==="write:start"){A(!1);return}if(G.event==="draft:start"){L(!1);return}lx(G,r)&&(A(!1),L(!1),h())}},[r,h,m.messages]);const Q=async()=>{A(!0);try{await ft(`/books/${r}/write-next`)}catch(G){A(!1),alert(G instanceof Error?G.message:"Failed")}},J=async()=>{L(!0);try{await ft(`/books/${r}/draft`)}catch(G){L(!1),alert(G instanceof Error?G.message:"Failed")}},ne=async()=>{Z(!1),Y(!0);try{const G=await fetch(`/api/books/${r}`,{method:"DELETE"});if(!G.ok){const qe=await G.json().catch(()=>({}));throw new Error(qe.error??`${G.status}`)}f.toDashboard()}catch(G){alert(G instanceof Error?G.message:"Delete failed")}finally{Y(!1)}},ie=async G=>{const qe=window.prompt((x==null?void 0:x.book.language)==="en"?"Optional rewrite brief for this run only. Leave blank to use existing focus.":"可选:输入这次重写要遵循的补充想法。留空则沿用现有 focus。","");if(qe!==null){X(Be=>[...Be,G]);try{await He(`/books/${r}/rewrite/${G}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({brief:qe.trim()||void 0})}),h()}catch(Be){alert(Be instanceof Error?Be.message:"Rewrite failed")}finally{X(Be=>Be.filter(st=>st!==G))}}},be=async(G,qe)=>{const Be=window.prompt((x==null?void 0:x.book.language)==="en"?"Optional revise brief for this run only. Leave blank to use existing focus.":"可选:输入这次修订要遵循的补充想法。留空则沿用现有 focus。","");if(Be!==null){fe(st=>[...st,G]);try{await He(`/books/${r}/revise/${G}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:qe,brief:Be.trim()||void 0})}),h()}catch(st){alert(st instanceof Error?st.message:"Revision failed")}finally{fe(st=>st.filter(pl=>pl!==G))}}},Je=async G=>{const qe=window.prompt((x==null?void 0:x.book.language)==="en"?"Optional sync brief for interpreting the edited chapter body. Leave blank to sync directly from the text.":"可选:输入这次同步时要遵循的补充说明。留空则直接按正文同步。","");if(qe!==null){W(Be=>[...Be,G]);try{await He(`/books/${r}/resync/${G}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({brief:qe.trim()||void 0})}),h()}catch(Be){alert(Be instanceof Error?Be.message:"Sync failed")}finally{W(Be=>Be.filter(st=>st!==G))}}},pe=async()=>{if(x){V(!0);try{const G={};oe!==null&&(G.chapterWordCount=oe),K!==null&&(G.targetChapters=K),he!==null&&(G.status=he),await He(`/books/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)}),h()}catch(G){alert(G instanceof Error?G.message:"Save failed")}finally{V(!1)}}},Kt=async()=>{if(!x)return;const G=x.chapters.filter(Be=>Be.status==="ready-for-review");let qe=0;for(const Be of G)try{await ft(`/books/${r}/chapters/${Be.number}/approve`)}catch{qe+=1}qe>0&&alert(`${qe}/${G.length} approve(s) failed`),h()};if(y)return s.jsxs("div",{className:"flex flex-col items-center justify-center py-32 space-y-4",children:[s.jsx("div",{className:"w-8 h-8 border-2 border-primary/20 border-t-primary rounded-full animate-spin"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:o("common.loading")})]});if(T)return s.jsxs("div",{className:"text-destructive p-8 bg-destructive/5 rounded-xl border border-destructive/20",children:["Error: ",T]});if(!x)return null;const{book:et,chapters:pt}=x,xa=pt.reduce((G,qe)=>G+(qe.wordCount??0),0),mt=pt.filter(G=>G.status==="ready-for-review").length,en=oe??et.chapterWordCount,tn=K??et.targetChapters??0,Ci=he??et.status;return s.jsxs("div",{className:"space-y-8 fade-in",children:[s.jsxs("nav",{className:"flex items-center gap-2 text-[13px] font-medium text-muted-foreground",children:[s.jsxs("button",{onClick:f.toDashboard,className:"hover:text-primary transition-colors flex items-center gap-1",children:[s.jsx(Ax,{size:14}),o("bread.books")]}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{className:"text-foreground",children:et.title})]}),s.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 border-b border-border/40 pb-8",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h1",{className:"text-4xl font-serif font-medium",children:et.title}),et.language==="en"&&s.jsx("span",{className:"px-1.5 py-0.5 rounded border border-primary/20 text-primary text-[10px] font-bold",children:"EN"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground font-medium",children:[s.jsx("span",{className:"px-2 py-0.5 rounded bg-secondary/50 text-foreground/70 uppercase tracking-wider text-xs",children:et.genre}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(to,{size:14}),s.jsxs("span",{children:[pt.length," ",o("dash.chapters")]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(ml,{size:14}),s.jsxs("span",{children:[xa.toLocaleString()," ",o("book.words")]})]}),et.fanficMode&&s.jsxs("span",{className:"flex items-center gap-1 text-purple-500",children:[s.jsx(uo,{size:12}),s.jsxs("span",{className:"italic",children:["fanfic:",et.fanficMode]})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{onClick:Q,disabled:w||b,className:"flex items-center gap-2 px-5 py-2.5 text-sm font-bold bg-primary text-primary-foreground rounded-xl hover:scale-105 active:scale-95 transition-all shadow-lg shadow-primary/20 disabled:opacity-50",children:[w?s.jsx("div",{className:"w-4 h-4 border-2 border-primary-foreground/20 border-t-primary-foreground rounded-full animate-spin"}):s.jsx(ml,{size:16}),o(w?"dash.writing":"book.writeNext")]}),s.jsxs("button",{onClick:J,disabled:w||b,className:"flex items-center gap-2 px-5 py-2.5 text-sm font-bold bg-secondary text-foreground rounded-xl hover:bg-secondary/80 transition-all border border-border/50 disabled:opacity-50",children:[b?s.jsx("div",{className:"w-4 h-4 border-2 border-muted-foreground/20 border-t-muted-foreground rounded-full animate-spin"}):s.jsx(ho,{size:16}),o(b?"book.drafting":"book.draftOnly")]}),s.jsxs("button",{onClick:()=>Z(!0),disabled:B,className:"flex items-center gap-2 px-5 py-2.5 text-sm font-bold bg-destructive/10 text-destructive rounded-xl hover:bg-destructive hover:text-white transition-all border border-destructive/20 disabled:opacity-50",children:[B?s.jsx("div",{className:"w-4 h-4 border-2 border-destructive/20 border-t-destructive rounded-full animate-spin"}):s.jsx(wi,{size:16}),o(B?"common.loading":"book.deleteBook")]})]})]}),(w||b||de.lastError)&&s.jsx("div",{className:`rounded-2xl border px-4 py-3 text-sm ${de.lastError?"border-destructive/30 bg-destructive/5 text-destructive":"border-primary/20 bg-primary/[0.04] text-foreground"}`,children:de.lastError?s.jsxs("span",{children:[o("book.pipelineFailed"),": ",de.lastError]}):w?s.jsx("span",{children:o("book.pipelineWriting")}):s.jsx("span",{children:o("book.pipelineDrafting")})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-1",children:[mt>0&&s.jsxs("button",{onClick:Kt,className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-emerald-500/10 text-emerald-600 rounded-lg hover:bg-emerald-500/20 transition-all border border-emerald-500/20",children:[s.jsx(Tx,{size:14}),o("book.approveAll")," (",mt,")"]}),s.jsxs("button",{onClick:()=>f.toTruth(r),className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-secondary/50 text-muted-foreground rounded-lg hover:text-foreground hover:bg-secondary transition-all border border-border/50",children:[s.jsx(Ux,{size:14}),o("book.truthFiles")]}),s.jsxs("button",{onClick:()=>f.toAnalytics(r),className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-secondary/50 text-muted-foreground rounded-lg hover:text-foreground hover:bg-secondary transition-all border border-border/50",children:[s.jsx($m,{size:14}),o("book.analytics")]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{value:Ae,onChange:G=>k(G.target.value),className:"px-2 py-2 text-xs font-bold bg-secondary/50 text-muted-foreground rounded-lg border border-border/50 outline-none",children:[s.jsx("option",{value:"txt",children:"TXT"}),s.jsx("option",{value:"md",children:"MD"}),s.jsx("option",{value:"epub",children:"EPUB"})]}),s.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-bold text-muted-foreground cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:H,onChange:G=>F(G.target.checked),className:"rounded border-border/50"}),o("book.approvedOnly")]}),s.jsxs("button",{onClick:async()=>{try{const G=await He(`/books/${r}/export-save`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({format:Ae,approvedOnly:H})});alert(`${o("common.exportSuccess")}
392
+ ${G.path}
393
+ (${G.chapters} ${o("dash.chapters")})`)}catch(G){alert(G instanceof Error?G.message:"Export failed")}},className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-secondary/50 text-muted-foreground rounded-lg hover:text-foreground hover:bg-secondary transition-all border border-border/50",children:[s.jsx(io,{size:14}),o("book.export")]})]})]}),s.jsxs("div",{className:"paper-sheet rounded-2xl border border-border/40 shadow-sm p-6",children:[s.jsx("h2",{className:"text-sm font-bold uppercase tracking-widest text-muted-foreground mb-4",children:o("book.settings")}),s.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("label",{className:"text-[11px] font-bold uppercase tracking-widest text-muted-foreground",children:o("create.wordsPerChapter")}),s.jsx("input",{type:"number",value:en,onChange:G=>q(Number(G.target.value)),className:"px-3 py-2 text-sm rounded-lg border border-border/50 bg-secondary/30 outline-none focus:border-primary/50 w-32"})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("label",{className:"text-[11px] font-bold uppercase tracking-widest text-muted-foreground",children:o("create.targetChapters")}),s.jsx("input",{type:"number",value:tn,onChange:G=>le(Number(G.target.value)),className:"px-3 py-2 text-sm rounded-lg border border-border/50 bg-secondary/30 outline-none focus:border-primary/50 w-32"})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("label",{className:"text-[11px] font-bold uppercase tracking-widest text-muted-foreground",children:o("book.status")}),s.jsxs("select",{value:Ci,onChange:G=>Ee(G.target.value),className:"px-3 py-2 text-sm rounded-lg border border-border/50 bg-secondary/30 outline-none focus:border-primary/50",children:[s.jsx("option",{value:"active",children:o("book.statusActive")}),s.jsx("option",{value:"paused",children:o("book.statusPaused")}),s.jsx("option",{value:"outlining",children:o("book.statusOutlining")}),s.jsx("option",{value:"completed",children:o("book.statusCompleted")}),s.jsx("option",{value:"dropped",children:o("book.statusDropped")})]})]}),s.jsxs("button",{onClick:pe,disabled:ae,className:"flex items-center gap-2 px-4 py-2 text-sm font-bold bg-primary text-primary-foreground rounded-lg hover:scale-105 active:scale-95 transition-all disabled:opacity-50",children:[ae?s.jsx("div",{className:"w-4 h-4 border-2 border-primary-foreground/20 border-t-primary-foreground rounded-full animate-spin"}):s.jsx(oo,{size:14}),o(ae?"book.saving":"book.save")]})]})]}),s.jsxs("div",{className:"paper-sheet rounded-2xl overflow-hidden border border-border/40 shadow-xl shadow-primary/5",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-muted/30 border-b border-border/50",children:[s.jsx("th",{className:"text-left px-6 py-4 font-bold text-[11px] uppercase tracking-widest text-muted-foreground w-16",children:"#"}),s.jsx("th",{className:"text-left px-6 py-4 font-bold text-[11px] uppercase tracking-widest text-muted-foreground",children:o("book.manuscriptTitle")}),s.jsx("th",{className:"text-left px-6 py-4 font-bold text-[11px] uppercase tracking-widest text-muted-foreground w-28",children:o("book.words")}),s.jsx("th",{className:"text-left px-6 py-4 font-bold text-[11px] uppercase tracking-widest text-muted-foreground w-36",children:o("book.status")}),s.jsx("th",{className:"text-right px-6 py-4 font-bold text-[11px] uppercase tracking-widest text-muted-foreground",children:o("book.curate")})]})}),s.jsx("tbody",{className:"divide-y divide-border/30",children:pt.map((G,qe)=>{var st,pl;const Be=`stagger-${Math.min(qe+1,5)}`;return s.jsxs("tr",{className:`group hover:bg-primary/[0.02] transition-colors fade-in ${Be}`,children:[s.jsx("td",{className:"px-6 py-4 text-muted-foreground/60 font-mono text-xs",children:G.number.toString().padStart(2,"0")}),s.jsx("td",{className:"px-6 py-4",children:s.jsx("button",{onClick:()=>f.toChapter(r,G.number),className:"font-serif text-lg font-medium hover:text-primary transition-colors text-left",children:G.title||o("chapter.label").replace("{n}",String(G.number))})}),s.jsx("td",{className:"px-6 py-4 text-muted-foreground font-medium tabular-nums text-xs",children:(G.wordCount??0).toLocaleString()}),s.jsx("td",{className:"px-6 py-4",children:s.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-bold uppercase tracking-tight ${((st=Bm[G.status])==null?void 0:st.color)??"bg-muted text-muted-foreground"}`,children:[(pl=Bm[G.status])==null?void 0:pl.icon,K0(G.status,o)]})}),s.jsx("td",{className:"px-6 py-4 text-right",children:s.jsxs("div",{className:"flex gap-1.5 justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:[G.status==="ready-for-review"&&s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:async()=>{try{await ft(`/books/${r}/chapters/${G.number}/approve`),h()}catch(_t){alert(_t instanceof Error?_t.message:"Approve failed")}},className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-600 hover:bg-emerald-500 hover:text-white transition-all shadow-sm",title:o("book.approve"),children:s.jsx(Wm,{size:14})}),s.jsx("button",{onClick:async()=>{try{await ft(`/books/${r}/chapters/${G.number}/reject`),h()}catch(_t){alert(_t instanceof Error?_t.message:"Reject failed")}},className:"p-2 rounded-lg bg-destructive/10 text-destructive hover:bg-destructive hover:text-white transition-all shadow-sm",title:o("book.reject"),children:s.jsx(po,{size:14})})]}),s.jsx("button",{onClick:async()=>{var _t;try{const Ve=await He(`/books/${r}/audit/${G.number}`,{method:"POST"});alert(Ve.passed?"Audit passed":`Audit failed: ${((_t=Ve.issues)==null?void 0:_t.length)??0} issues`),h()}catch(Ve){alert(Ve instanceof Error?Ve.message:"Audit failed")}},className:"p-2 rounded-lg bg-secondary text-muted-foreground hover:text-primary hover:bg-primary/10 transition-all shadow-sm",title:o("book.audit"),children:s.jsx(jy,{size:14})}),s.jsx("button",{onClick:()=>ie(G.number),disabled:ce.includes(G.number),className:"p-2 rounded-lg bg-secondary text-muted-foreground hover:text-primary hover:bg-primary/10 transition-all shadow-sm disabled:opacity-50",title:o("book.rewrite"),children:ce.includes(G.number)?s.jsx("div",{className:"w-3.5 h-3.5 border-2 border-muted-foreground/20 border-t-muted-foreground rounded-full animate-spin"}):s.jsx(co,{size:14})}),s.jsx("button",{onClick:()=>Je(G.number),disabled:ke.includes(G.number)||G.number!==_,className:"p-2 rounded-lg bg-secondary text-muted-foreground hover:text-primary hover:bg-primary/10 transition-all shadow-sm disabled:opacity-50",title:(x==null?void 0:x.book.language)==="en"?"Sync truth/state from edited chapter":"根据已编辑章节同步 truth/state",children:ke.includes(G.number)?s.jsx("div",{className:"w-3.5 h-3.5 border-2 border-muted-foreground/20 border-t-muted-foreground rounded-full animate-spin"}):s.jsx(fy,{size:14})}),s.jsxs("select",{disabled:$.includes(G.number),value:"",onChange:_t=>{const Ve=_t.target.value;Ve&&be(G.number,Ve)},className:"px-2 py-1.5 text-[11px] font-bold rounded-lg bg-secondary text-muted-foreground border border-border/50 outline-none hover:text-primary hover:bg-primary/10 transition-all disabled:opacity-50 cursor-pointer",title:"Revise with AI",children:[s.jsx("option",{value:"",disabled:!0,children:$.includes(G.number)?o("common.loading"):o("book.curate")}),s.jsx("option",{value:"spot-fix",children:o("book.spotFix")}),s.jsx("option",{value:"polish",children:o("book.polish")}),s.jsx("option",{value:"rewrite",children:o("book.rewrite")}),s.jsx("option",{value:"rework",children:o("book.rework")}),s.jsx("option",{value:"anti-detect",children:o("book.antiDetect")})]})]})})]},G.number)})})]})}),pt.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-full bg-muted/20 flex items-center justify-center mb-4",children:s.jsx(to,{size:20,className:"text-muted-foreground/40"})}),s.jsx("p",{className:"text-sm italic font-serif text-muted-foreground",children:o("book.noChapters")})]})]}),s.jsx(yo,{open:R,title:o("book.deleteBook"),message:o("book.confirmDelete"),confirmLabel:o("common.delete"),cancelLabel:o("common.cancel"),variant:"danger",onConfirm:ne,onCancel:()=>Z(!1)})]})}const $0={zh:{idleTitle:"从一句模糊想法开始",idleBody:"直接描述题材、世界观、主角、核心冲突,或告诉我你想先改哪一块。共享草案会在 TUI 和 Studio Chat 之间同步。",promptLabel:"继续打磨这本书",promptPlaceholder:"例如:我想写个港风商战悬疑,主角先做灰产再洗白。",promptPlaceholderFollowup:"例如:世界观改成近未来港口城;女主不要太早出场;卷一先查账再砸场。",submit:"更新草案",submitting:"处理中…",create:"按当前草案建书",creating:"创建中…",discard:"丢弃草案",draftHeading:"当前 foundation 草案",missingHeading:"还缺这些关键信息",missingHint:"这些字段未必都要一次填满,但缺得太多时不要急着建书。",syncedHint:"这份草案和 TUI / Studio Chat 共享。",helperTitle:"建议这样推进",helperBody:"先定世界观和主角,再定核心冲突、简介和卷一方向。想看当前草案时,可以在 TUI 里用 /draft。"},en:{idleTitle:"Start from a rough idea",idleBody:"Describe the genre, world, protagonist, and core conflict. The shared draft stays in sync across TUI and Studio Chat.",promptLabel:"Refine this book",promptPlaceholder:"Example: I want a harbor-noir business thriller about a fixer trying to go legit.",promptPlaceholderFollowup:"Example: move the world to a near-future port city; delay the heroine; make volume one about chasing ledgers first.",submit:"Update draft",submitting:"Working…",create:"Create book from draft",creating:"Creating…",discard:"Discard draft",draftHeading:"Current foundation draft",missingHeading:"Still missing",missingHint:"You do not need every field immediately, but do not create the book while the foundation is still vague.",syncedHint:"This draft is shared with TUI and Studio Chat.",helperTitle:"Recommended flow",helperBody:"Lock the world and protagonist first, then settle the conflict, blurb, and volume-one direction. In TUI, use /draft to inspect the same draft."}};function W0(r,f){const u=r.trim();return u?f?u:`/new ${u}`:""}function Hm(r){var f,u;return r?r.readyToCreate?!0:!!((f=r.title)!=null&&f.trim()&&((u=r.genre)!=null&&u.trim())&&typeof r.targetChapters=="number"&&typeof r.chapterWordCount=="number"):!1}function F0(r,f){return(f==="en"?[r.title?{key:"title",label:"Title",value:r.title}:void 0,r.worldPremise?{key:"worldPremise",label:"World",value:r.worldPremise}:void 0,r.protagonist?{key:"protagonist",label:"Protagonist",value:r.protagonist}:void 0,r.conflictCore?{key:"conflictCore",label:"Core Conflict",value:r.conflictCore}:void 0,r.volumeOutline?{key:"volumeOutline",label:"Volume Direction",value:r.volumeOutline}:void 0,r.blurb?{key:"blurb",label:"Blurb",value:r.blurb}:void 0,r.nextQuestion?{key:"nextQuestion",label:"Next",value:r.nextQuestion}:void 0]:[r.title?{key:"title",label:"书名",value:r.title}:void 0,r.worldPremise?{key:"worldPremise",label:"世界观",value:r.worldPremise}:void 0,r.protagonist?{key:"protagonist",label:"主角",value:r.protagonist}:void 0,r.conflictCore?{key:"conflictCore",label:"核心冲突",value:r.conflictCore}:void 0,r.volumeOutline?{key:"volumeOutline",label:"卷纲方向",value:r.volumeOutline}:void 0,r.blurb?{key:"blurb",label:"简介",value:r.blurb}:void 0,r.nextQuestion?{key:"nextQuestion",label:"下一步",value:r.nextQuestion}:void 0]).filter(o=>!!o)}const I0=120,P0=250,eb=2500;async function tb(r,f={}){const u=f.fetchBook??(p=>He(`/books/${p}`)),o=f.fetchStatus??(p=>He(`/books/${p}/create-status`)),m=f.maxAttempts??I0,x=f.delayMs??P0,y=f.waitImpl??(p=>new Promise(A=>{setTimeout(A,p)}));let T,h;for(let p=0;p<m;p+=1)try{await u(r);return}catch(A){T=A;try{const S=await o(r);if(h=S.status,S.status==="error")throw new Error(S.error??`Book "${r}" failed to create`)}catch(S){if(S instanceof Error&&S.message!=="404 Not Found")throw S}if(p===m-1){if(h==="creating")break;throw A}await y(x)}throw h==="creating"?new Error(`Book "${r}" is still being created. Wait a moment and refresh.`):T instanceof Error?T:new Error(`Book "${r}" was not ready`)}function ab({nav:r,theme:f,t:u}){const o=Vt(),{data:m}=Pe("/project"),x=(m==null?void 0:m.language)??"zh",y=$0[x],[T,h]=D.useState(),[p,A]=D.useState(""),[S,L]=D.useState(!0),[B,Y]=D.useState(!1),[R,Z]=D.useState(!1),[ce,X]=D.useState(null),[$,fe]=D.useState(null),ke=D.useMemo(()=>T?F0(T,x):[],[T,x]),W=async()=>{var he;const le=(he=(await He("/interaction/session")).session)==null?void 0:he.creationDraft;return h(le),le};D.useEffect(()=>{let K=!1;return L(!0),W().catch(le=>{K||X(le instanceof Error?le.message:String(le))}).finally(()=>{K||L(!1)}),()=>{K=!0}},[]),D.useEffect(()=>{if(B||R)return;const K=setInterval(()=>{W().catch(()=>{})},eb);return()=>{clearInterval(K)}},[B,R]);const ae=async K=>He("/agent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({instruction:K})}),V=async()=>{var le;const K=W0(p,!!T);if(K){Y(!0),X(null);try{const he=await ae(K);A(""),fe(he.response??null),h((le=he.session)==null?void 0:le.creationDraft)}catch(he){X(he instanceof Error?he.message:String(he))}finally{Y(!1)}}},oe=async()=>{var K;if(Hm(T)){Z(!0),X(null);try{const le=await ae("/create"),he=(K=le.session)==null?void 0:K.activeBookId;if(!he)throw new Error(x==="zh"?"创建完成后没有返回书籍 ID。":"Create succeeded but no book id was returned.");fe(le.response??null),h(void 0),await tb(he),r.toBook(he)}catch(le){X(le instanceof Error?le.message:String(le))}finally{Z(!1)}}},q=async()=>{Y(!0),X(null);try{const K=await ae("/discard");fe(K.response??null),h(void 0),A(""),await W().catch(()=>{})}catch(K){X(K instanceof Error?K.message:String(K))}finally{Y(!1)}};return s.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:o.link,children:u("bread.books")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{children:u("bread.newBook")})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("h1",{className:"font-serif text-3xl",children:u("create.title")}),s.jsx("p",{className:"text-sm text-muted-foreground leading-7",children:y.idleBody})]}),ce&&s.jsx("div",{className:`border ${o.error} rounded-md px-4 py-3`,children:ce}),$&&s.jsx("div",{className:"border border-primary/20 bg-primary/5 rounded-md px-4 py-3 text-sm text-primary",children:$}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.1fr_0.9fr]",children:[s.jsx("section",{className:"space-y-4",children:s.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/70 p-5 space-y-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground font-bold",children:y.draftHeading}),s.jsx("div",{className:"text-xs text-muted-foreground",children:y.syncedHint})]}),S?s.jsx("div",{className:"text-sm text-muted-foreground",children:x==="zh"?"读取共享草案中…":"Loading shared draft…"}):T?s.jsxs("div",{className:"space-y-4",children:[ke.length>0?s.jsx("div",{className:"space-y-3",children:ke.map(K=>s.jsxs("div",{className:"rounded-xl border border-border/50 bg-background/70 px-4 py-3",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground font-semibold",children:K.label}),s.jsx("div",{className:"mt-1 text-sm leading-7 whitespace-pre-wrap",children:K.value})]},K.key))}):null,T.missingFields.length>0?s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-medium text-foreground",children:y.missingHeading}),s.jsx("div",{className:"flex flex-wrap gap-2",children:T.missingFields.map(K=>s.jsx("span",{className:"rounded-full border border-border/70 bg-secondary/50 px-3 py-1 text-xs text-muted-foreground",children:K},K))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:y.missingHint})]}):null]}):s.jsxs("div",{className:"rounded-xl border border-dashed border-border/70 bg-background/50 px-5 py-6",children:[s.jsx("div",{className:"font-medium",children:y.idleTitle}),s.jsx("p",{className:"mt-2 text-sm text-muted-foreground leading-7",children:y.helperBody})]})]})}),s.jsx("section",{className:"space-y-4",children:s.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/70 p-5 space-y-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground font-bold",children:y.promptLabel}),s.jsx("div",{className:"text-xs text-muted-foreground",children:y.helperTitle})]}),s.jsx("textarea",{value:p,onChange:K=>A(K.target.value),rows:10,className:`w-full ${o.input} rounded-xl px-4 py-3 focus:outline-none text-sm leading-7 resize-y`,placeholder:T?y.promptPlaceholderFollowup:y.promptPlaceholder}),s.jsxs("div",{className:"flex flex-wrap gap-3",children:[s.jsx("button",{onClick:V,disabled:B||R||!p.trim(),className:`px-4 py-3 ${o.btnPrimary} rounded-md disabled:opacity-50 font-medium text-sm`,children:B?y.submitting:y.submit}),s.jsx("button",{onClick:oe,disabled:!Hm(T)||R||B,className:"px-4 py-3 rounded-md border border-border bg-secondary text-secondary-foreground disabled:opacity-50 font-medium text-sm",children:R?y.creating:y.create}),s.jsx("button",{onClick:q,disabled:!T||B||R,className:"px-4 py-3 rounded-md border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 disabled:opacity-50 font-medium text-sm",children:y.discard})]})]})})]})]})}function lb({bookId:r,chapterNumber:f,nav:u,theme:o,t:m}){const{data:x,loading:y,error:T,refetch:h}=Pe(`/books/${r}/chapters/${f}`),[p,A]=D.useState(!1),[S,L]=D.useState(""),[B,Y]=D.useState(!1),R=()=>{x&&(L(x.content),A(!0))},Z=()=>{A(!1),L("")},ce=async()=>{Y(!0);try{await He(`/books/${r}/chapters/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:S})}),A(!1),h()}catch(oe){alert(oe instanceof Error?oe.message:"Save failed")}finally{Y(!1)}};if(y)return s.jsxs("div",{className:"flex flex-col items-center justify-center py-32 space-y-4",children:[s.jsx("div",{className:"w-8 h-8 border-2 border-primary/20 border-t-primary rounded-full animate-spin"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:m("reader.openingManuscript")})]});if(T)return s.jsxs("div",{className:"text-destructive p-8 bg-destructive/5 rounded-xl border border-destructive/20",children:["Error: ",T]});if(!x)return null;const X=x.content.split(`
394
+ `),$=X.find(oe=>oe.startsWith("# ")),fe=($==null?void 0:$.replace(/^#\s*/,""))??`Chapter ${f}`,ke=X.filter(oe=>oe!==$).join(`
395
+ `).trim(),W=async()=>{try{await ft(`/books/${r}/chapters/${f}/approve`),u.toBook(r)}catch(oe){alert(oe instanceof Error?oe.message:"Approve failed")}},ae=async()=>{try{await ft(`/books/${r}/chapters/${f}/reject`),u.toBook(r)}catch(oe){alert(oe instanceof Error?oe.message:"Reject failed")}},V=ke.split(/\n\n+/).filter(Boolean);return s.jsxs("div",{className:"max-w-4xl mx-auto space-y-10 fade-in",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6",children:[s.jsxs("nav",{className:"flex items-center gap-2 text-[13px] font-medium text-muted-foreground",children:[s.jsx("button",{onClick:u.toDashboard,className:"hover:text-primary transition-colors flex items-center gap-1",children:m("bread.books")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("button",{onClick:()=>u.toBook(r),className:"hover:text-primary transition-colors truncate max-w-[120px]",children:r}),s.jsx("span",{className:"text-border",children:"/"}),s.jsxs("span",{className:"text-foreground flex items-center gap-1",children:[s.jsx(Wx,{size:12}),f]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:()=>u.toBook(r),className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-secondary text-muted-foreground rounded-xl hover:text-foreground hover:bg-secondary/80 transition-all border border-border/50",children:[s.jsx(ey,{size:14}),m("reader.backToList")]}),p?s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:ce,disabled:B,className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-primary text-primary-foreground rounded-xl hover:scale-105 active:scale-95 transition-all shadow-sm disabled:opacity-50",children:[B?s.jsx("div",{className:"w-3.5 h-3.5 border-2 border-primary-foreground/20 border-t-primary-foreground rounded-full animate-spin"}):s.jsx(oo,{size:14}),m(B?"book.saving":"book.save")]}),s.jsxs("button",{onClick:Z,className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-secondary text-muted-foreground rounded-xl hover:text-foreground transition-all border border-border/50",children:[s.jsx(Im,{size:14}),m("reader.preview")]})]}):s.jsxs("button",{onClick:R,className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-secondary text-muted-foreground rounded-xl hover:text-primary hover:bg-primary/10 transition-all border border-border/50",children:[s.jsx(ro,{size:14}),m("reader.edit")]}),s.jsxs("button",{onClick:W,className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-emerald-500/10 text-emerald-600 rounded-xl hover:bg-emerald-500 hover:text-white transition-all border border-emerald-500/20 shadow-sm",children:[s.jsx(Ti,{size:14}),m("reader.approve")]}),s.jsxs("button",{onClick:ae,className:"flex items-center gap-2 px-4 py-2 text-xs font-bold bg-destructive/10 text-destructive rounded-xl hover:bg-destructive hover:text-white transition-all border border-destructive/20 shadow-sm",children:[s.jsx(so,{size:14}),m("reader.reject")]})]})]}),s.jsxs("div",{className:"paper-sheet rounded-2xl p-8 md:p-16 lg:p-24 shadow-2xl shadow-primary/5 min-h-[80vh] relative overflow-hidden",children:[s.jsx("div",{className:"absolute top-0 left-8 w-px h-full bg-primary/5 hidden md:block"}),s.jsx("div",{className:"absolute top-0 right-8 w-px h-full bg-primary/5 hidden md:block"}),s.jsxs("header",{className:"mb-16 text-center",children:[s.jsxs("div",{className:"flex items-center justify-center gap-2 text-muted-foreground/30 mb-8 select-none",children:[s.jsx("div",{className:"h-px w-12 bg-border/40"}),s.jsx(Ic,{size:20}),s.jsx("div",{className:"h-px w-12 bg-border/40"})]}),s.jsx("h1",{className:"text-4xl md:text-5xl font-serif font-medium italic text-foreground tracking-tight leading-tight",children:fe}),s.jsxs("div",{className:"mt-8 flex items-center justify-center gap-4 text-[10px] font-bold uppercase tracking-[0.2em] text-muted-foreground/60",children:[s.jsx("span",{children:m("reader.manuscriptPage")}),s.jsx("span",{className:"text-border",children:"·"}),s.jsx("span",{children:f.toString().padStart(2,"0")})]})]}),p?s.jsx("textarea",{value:S,onChange:oe=>L(oe.target.value),className:"w-full min-h-[60vh] bg-transparent font-serif text-lg leading-[1.8] text-foreground/90 focus:outline-none resize-none border border-border/30 rounded-lg p-6 focus:border-primary/40 focus:ring-2 focus:ring-primary/10 transition-all",autoFocus:!0}):s.jsx("article",{className:"prose prose-zinc dark:prose-invert max-w-none",children:V.map((oe,q)=>s.jsx("p",{className:"font-serif text-lg md:text-xl leading-[1.8] text-foreground/90 mb-8 first-letter:text-2xl first-letter:font-bold first-letter:text-primary/40",children:oe},q))}),s.jsxs("footer",{className:"mt-24 pt-12 border-t border-border/20 flex flex-col items-center gap-6 text-center",children:[s.jsxs("div",{className:"flex items-center gap-4 text-xs font-medium text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-secondary/50",children:[s.jsx(Uy,{size:14,className:"text-primary/60"}),s.jsxs("span",{children:[ke.length.toLocaleString()," ",m("reader.characters")]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-secondary/50",children:[s.jsx(Pc,{size:14,className:"text-primary/60"}),s.jsxs("span",{children:[Math.ceil(ke.length/500)," ",m("reader.minRead")]})]})]}),s.jsx("p",{className:"text-[10px] uppercase tracking-widest text-muted-foreground/40 font-bold",children:m("reader.endOfChapter")})]})]}),s.jsx("div",{className:"flex justify-between items-center py-8",children:f>1?s.jsxs("button",{onClick:()=>u.toBook(r),className:"flex items-center gap-2 text-sm font-bold text-muted-foreground hover:text-primary transition-all group",children:[s.jsx(co,{size:16,className:"group-hover:-rotate-45 transition-transform"}),m("reader.chapterList")]}):s.jsx("div",{})})]})}function nb({bookId:r,nav:f,theme:u,t:o}){const m=Vt(),{data:x,loading:y,error:T}=Pe(`/books/${r}/analytics`);if(y)return s.jsx("div",{className:m.muted,children:o("common.loading")});if(T)return s.jsxs("div",{className:"text-red-400",children:[o("common.error"),": ",T]});if(!x)return null;const h=Object.entries(x.statusDistribution),p=h.reduce((A,[,S])=>A+S,0);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:`flex items-center gap-2 text-sm ${m.muted}`,children:[s.jsx("button",{onClick:f.toDashboard,className:m.link,children:o("bread.books")}),s.jsx("span",{children:"/"}),s.jsx("button",{onClick:()=>f.toBook(r),className:m.link,children:r}),s.jsx("span",{children:"/"}),s.jsx("span",{className:m.subtle,children:o("analytics.title")})]}),s.jsx("h1",{className:"text-2xl font-semibold",children:o("analytics.title")}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsx($c,{label:o("analytics.totalChapters"),value:x.totalChapters.toString(),c:m}),s.jsx($c,{label:o("analytics.totalWords"),value:x.totalWords.toLocaleString(),c:m}),s.jsx($c,{label:o("analytics.avgWords"),value:x.avgWordsPerChapter.toLocaleString(),c:m})]}),h.length>0&&s.jsxs("div",{className:`border ${m.cardStatic} rounded-lg p-5`,children:[s.jsx("h2",{className:`text-sm font-medium ${m.subtle} mb-4`,children:o("analytics.statusDist")}),s.jsx("div",{className:"space-y-3",children:h.map(([A,S])=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[s.jsx("span",{className:m.subtle,children:A}),s.jsx("span",{className:m.muted,children:S})]}),s.jsx("div",{className:`h-2 ${m.btnSecondary} rounded-full overflow-hidden`,children:s.jsx("div",{className:"h-full bg-zinc-500 rounded-full transition-all",style:{width:`${p>0?S/p*100:0}%`}})})]},A))})]})]})}function $c({label:r,value:f,c:u}){return s.jsxs("div",{className:`border ${u.cardStatic} rounded-lg p-5`,children:[s.jsx("div",{className:`text-sm ${u.muted} mb-1`,children:r}),s.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:f})]})}const sb=["writer","auditor","reviser","architect","radar","chapter-analyzer"];async function ib(r,f={}){await(f.putApiImpl??$g)("/project",r)}function rb(r){return Object.fromEntries(Object.entries((r==null?void 0:r.overrides)??{}).map(([f,u])=>[f,{...u}]))}function cb({nav:r,theme:f,t:u}){const o=Vt(),{data:m,loading:x,error:y,refetch:T}=Pe("/project"),[h,p]=D.useState(!1),[A,S]=D.useState(!1),[L,B]=D.useState({});if(x)return s.jsx("div",{className:"text-muted-foreground py-20 text-center text-sm",children:"Loading..."});if(y)return s.jsxs("div",{className:"text-destructive py-20 text-center",children:["Error: ",y]});if(!m)return null;const Y=()=>{B({temperature:m.temperature,maxTokens:m.maxTokens,stream:m.stream,language:m.language}),p(!0)},R=async()=>{S(!0);try{await ib(L),p(!1),T()}catch(Z){alert(Z instanceof Error?Z.message:"Failed")}finally{S(!1)}};return s.jsxs("div",{className:"max-w-xl mx-auto space-y-8",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:o.link,children:u("bread.home")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{className:"text-foreground",children:u("bread.config")})]}),s.jsxs("div",{className:"flex items-baseline justify-between",children:[s.jsx("h1",{className:"font-serif text-3xl",children:u("config.title")}),!h&&s.jsx("button",{onClick:Y,className:`px-3 py-2 text-xs rounded-md ${o.btnSecondary}`,children:"Edit"})]}),s.jsxs("div",{className:`border ${o.cardStatic} rounded-lg divide-y divide-border/40`,children:[s.jsx(Za,{label:u("config.project"),value:m.name}),s.jsx(Za,{label:u("config.provider"),value:m.provider}),s.jsx(Za,{label:u("config.model"),value:m.model}),s.jsx(Za,{label:u("config.baseUrl"),value:m.baseUrl,mono:!0}),h?s.jsxs(s.Fragment,{children:[s.jsx(Si,{label:u("config.language"),value:L.language,onChange:Z=>B({...L,language:Z}),type:"select",options:[{value:"zh",label:u("config.chinese")},{value:"en",label:u("config.english")}],c:o}),s.jsx(Si,{label:u("config.temperature"),value:String(L.temperature),onChange:Z=>B({...L,temperature:parseFloat(Z)}),type:"number",c:o}),s.jsx(Si,{label:u("config.maxTokens"),value:String(L.maxTokens),onChange:Z=>B({...L,maxTokens:parseInt(Z,10)}),type:"number",c:o}),s.jsx(Si,{label:u("config.stream"),value:String(L.stream),onChange:Z=>B({...L,stream:Z==="true"}),type:"select",options:[{value:"true",label:u("config.enabled")},{value:"false",label:u("config.disabled")}],c:o})]}):s.jsxs(s.Fragment,{children:[s.jsx(Za,{label:u("config.language"),value:m.language==="en"?u("config.english"):u("config.chinese")}),s.jsx(Za,{label:u("config.temperature"),value:String(m.temperature),mono:!0}),s.jsx(Za,{label:u("config.maxTokens"),value:String(m.maxTokens),mono:!0}),s.jsx(Za,{label:u("config.stream"),value:m.stream?u("config.enabled"):u("config.disabled")})]})]}),h&&s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx("button",{onClick:()=>p(!1),className:`px-4 py-2.5 text-sm rounded-md ${o.btnSecondary}`,children:u("config.cancel")}),s.jsx("button",{onClick:R,disabled:A,className:`px-4 py-2.5 text-sm rounded-md ${o.btnPrimary} disabled:opacity-50`,children:u(A?"config.saving":"config.save")})]}),s.jsx(ob,{theme:f,t:u})]})}function qm(){return{model:"",provider:"",baseUrl:""}}function ob({theme:r,t:f}){const u=Vt(),{data:o,loading:m,error:x,refetch:y}=Pe("/project/model-overrides"),[T,h]=D.useState({}),[p,A]=D.useState(!1);if(D.useEffect(()=>{h(rb(o))},[o]),m)return s.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"Loading model overrides..."});if(x)return s.jsxs("div",{className:"text-destructive py-8 text-center text-sm",children:["Error: ",x]});const S=(B,Y,R)=>{const Z=T[B]??qm();h({...T,[B]:{...Z,[Y]:R}})},L=async()=>{A(!0);try{await He("/project/model-overrides",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({overrides:T})}),y()}catch(B){alert(B instanceof Error?B.message:"Failed to save model overrides")}finally{A(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"font-serif text-xl mt-4",children:f("config.modelRouting")}),s.jsx("div",{className:`border ${u.cardStatic} rounded-lg overflow-hidden`,children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border/40 text-muted-foreground text-left",children:[s.jsx("th",{className:"px-4 py-2.5 font-medium",children:f("config.agent")}),s.jsx("th",{className:"px-4 py-2.5 font-medium",children:f("config.model")}),s.jsx("th",{className:"px-4 py-2.5 font-medium",children:f("config.provider")}),s.jsx("th",{className:"px-4 py-2.5 font-medium",children:f("config.baseUrl")})]})}),s.jsx("tbody",{children:sb.map(B=>{const Y=T[B]??qm();return s.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[s.jsx("td",{className:"px-4 py-2 font-mono text-foreground/80",children:B}),s.jsx("td",{className:"px-4 py-2",children:s.jsx("input",{type:"text",value:Y.model,onChange:R=>S(B,"model",R.target.value),placeholder:f("config.default"),className:`${u.input} rounded px-2 py-1 text-sm w-full`})}),s.jsx("td",{className:"px-4 py-2",children:s.jsx("input",{type:"text",value:Y.provider,onChange:R=>S(B,"provider",R.target.value),placeholder:f("config.optional"),className:`${u.input} rounded px-2 py-1 text-sm w-full`})}),s.jsx("td",{className:"px-4 py-2",children:s.jsx("input",{type:"text",value:Y.baseUrl,onChange:R=>S(B,"baseUrl",R.target.value),placeholder:f("config.optional"),className:`${u.input} rounded px-2 py-1 text-sm w-full`})})]},B)})})]})}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{onClick:L,disabled:p,className:`px-4 py-2.5 text-sm rounded-md ${u.btnPrimary} disabled:opacity-50`,children:f(p?"config.saving":"config.saveOverrides")})})]})}function Za({label:r,value:f,mono:u}){return s.jsxs("div",{className:"flex justify-between px-4 py-3",children:[s.jsx("span",{className:"text-muted-foreground text-sm",children:r}),s.jsx("span",{className:u?"font-mono text-sm":"text-sm",children:f})]})}function Si({label:r,value:f,onChange:u,type:o,options:m,c:x}){return s.jsxs("div",{className:"flex justify-between items-center px-4 py-2.5",children:[s.jsx("span",{className:"text-muted-foreground text-sm",children:r}),o==="select"&&m?s.jsx("select",{value:f,onChange:y=>u(y.target.value),className:`${x.input} rounded px-2 py-1 text-sm w-32`,children:m.map(y=>s.jsx("option",{value:y.value,children:y.label},y.value))}):s.jsx("input",{type:"number",value:f,onChange:y=>u(y.target.value),className:`${x.input} rounded px-2 py-1 text-sm w-32 text-right`})]})}function ub({bookId:r,nav:f,theme:u,t:o}){const m=Vt(),{data:x}=Pe(`/books/${r}/truth`),[y,T]=D.useState(null),[h,p]=D.useState(!1),[A,S]=D.useState(""),[L,B]=D.useState(!1),{data:Y,refetch:R}=Pe(y?`/books/${r}/truth/${y}`:""),Z=()=>{S((Y==null?void 0:Y.content)??""),p(!0)},ce=()=>{p(!1)},X=async()=>{if(y){B(!0);try{await He(`/books/${r}/truth/${y}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:A})}),p(!1),R()}catch($){alert($ instanceof Error?$.message:"Failed to save")}finally{B(!1)}}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:f.toDashboard,className:m.link,children:o("bread.books")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("button",{onClick:()=>f.toBook(r),className:m.link,children:r}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{className:"text-foreground",children:o("truth.title")})]}),s.jsx("h1",{className:"font-serif text-3xl",children:o("truth.title")}),s.jsxs("div",{className:"grid grid-cols-[240px_1fr] gap-6",children:[s.jsxs("div",{className:`border ${m.cardStatic} rounded-lg overflow-hidden`,children:[x==null?void 0:x.files.map($=>s.jsxs("button",{onClick:()=>{T($.name),p(!1)},className:`w-full text-left px-3 py-2.5 text-sm border-b border-border/40 transition-colors ${y===$.name?"bg-primary/10 text-primary":"hover:bg-muted/30 text-muted-foreground"}`,children:[s.jsx("div",{className:"font-mono text-sm truncate",children:$.name}),s.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[$.size.toLocaleString()," ",o("truth.chars")]})]},$.name)),(!(x!=null&&x.files)||x.files.length===0)&&s.jsx("div",{className:"px-3 py-4 text-sm text-muted-foreground text-center",children:o("truth.empty")})]}),s.jsx("div",{className:`border ${m.cardStatic} rounded-lg p-5 min-h-[400px] flex flex-col`,children:y&&(Y==null?void 0:Y.content)!=null?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end gap-2 mb-3",children:h?s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:ce,className:`inline-flex items-center gap-1 px-3 py-1.5 text-xs rounded-md ${m.btnSecondary}`,children:[s.jsx(po,{size:14}),"Cancel"]}),s.jsxs("button",{onClick:X,disabled:L,className:`inline-flex items-center gap-1 px-3 py-1.5 text-xs rounded-md ${m.btnPrimary} disabled:opacity-50`,children:[s.jsx(oo,{size:14}),o(L?"truth.saving":"truth.save")]})]}):s.jsxs("button",{onClick:Z,className:`inline-flex items-center gap-1 px-3 py-1.5 text-xs rounded-md ${m.btnSecondary}`,children:[s.jsx(ro,{size:14}),"Edit"]})}),h?s.jsx("textarea",{value:A,onChange:$=>S($.target.value),className:`${m.input} flex-1 rounded-md p-3 text-sm font-mono leading-relaxed resize-none min-h-[360px]`}):s.jsx("pre",{className:"text-sm leading-relaxed whitespace-pre-wrap font-mono text-foreground/80",children:Y.content})]}):y&&(Y==null?void 0:Y.content)===null?s.jsx("div",{className:"text-muted-foreground text-sm",children:o("truth.notFound")}):s.jsx("div",{className:"text-muted-foreground/50 text-sm italic",children:o("truth.selectFile")})})]})]})}function db({nav:r,theme:f,t:u,sse:o}){const m=Vt(),{data:x,refetch:y}=Pe("/daemon"),[T,h]=D.useState(!1);D.useEffect(()=>{const B=o.messages.at(-1);Zm(B)&&y()},[y,o.messages]);const p=o.messages.filter(B=>B.event.startsWith("daemon:")||B.event==="log").slice(-20),A=async()=>{h(!0);try{await ft("/daemon/start"),y()}catch(B){alert(B instanceof Error?B.message:"Failed")}finally{h(!1)}},S=async()=>{h(!0);try{await ft("/daemon/stop"),y()}catch(B){alert(B instanceof Error?B.message:"Failed")}finally{h(!1)}},L=(x==null?void 0:x.running)??!1;return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:m.link,children:u("bread.home")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{className:"text-foreground",children:u("nav.daemon")})]}),s.jsxs("div",{className:"flex items-baseline justify-between",children:[s.jsx("h1",{className:"font-serif text-3xl",children:u("daemon.title")}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:`text-sm uppercase tracking-wide font-medium ${L?"text-emerald-500":"text-muted-foreground"}`,children:u(L?"daemon.running":"daemon.stopped")}),L?s.jsx("button",{onClick:S,disabled:T,className:`px-4 py-2.5 text-sm rounded-md ${m.btnDanger} disabled:opacity-50`,children:u(T?"daemon.stopping":"daemon.stop")}):s.jsx("button",{onClick:A,disabled:T,className:`px-4 py-2.5 text-sm rounded-md ${m.btnPrimary} disabled:opacity-50`,children:u(T?"daemon.starting":"daemon.start")})]})]}),s.jsxs("div",{className:`border ${m.cardStatic} rounded-lg`,children:[s.jsx("div",{className:"px-5 py-3.5 border-b border-border",children:s.jsx("span",{className:"text-sm uppercase tracking-wide text-muted-foreground font-medium",children:u("daemon.eventLog")})}),s.jsx("div",{className:"p-4 max-h-[500px] overflow-y-auto",children:p.length>0?s.jsx("div",{className:"space-y-1.5 font-mono text-sm",children:p.map((B,Y)=>{const R=B.data;return s.jsxs("div",{className:"leading-relaxed text-muted-foreground",children:[s.jsx("span",{className:"text-primary/50",children:B.event}),s.jsx("span",{className:"text-border mx-1.5",children:"›"}),s.jsx("span",{children:String(R.message??R.bookId??JSON.stringify(R))})]},Y)})}):s.jsx("div",{className:"text-muted-foreground text-sm italic py-8 text-center",children:u(L?"daemon.waitingEvents":"daemon.startHint")})})]})]})}const fb={error:"text-destructive",warn:"text-amber-500",info:"text-primary/70",debug:"text-muted-foreground/50"};function mb({nav:r,theme:f,t:u}){const o=Vt(),{data:m,refetch:x}=Pe("/logs");return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:o.link,children:u("bread.home")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{className:"text-foreground",children:u("logs.title")})]}),s.jsxs("div",{className:"flex items-baseline justify-between",children:[s.jsx("h1",{className:"font-serif text-3xl",children:u("logs.title")}),s.jsx("button",{onClick:()=>x(),className:`px-4 py-2.5 text-sm rounded-md ${o.btnSecondary}`,children:u("common.refresh")})]}),s.jsx("div",{className:`border ${o.cardStatic} rounded-lg overflow-hidden`,children:s.jsx("div",{className:"p-4 max-h-[600px] overflow-y-auto",children:m!=null&&m.entries&&m.entries.length>0?s.jsx("div",{className:"space-y-1 font-mono text-sm leading-relaxed",children:m.entries.map((y,T)=>s.jsxs("div",{className:"flex gap-2",children:[y.timestamp&&s.jsx("span",{className:"text-muted-foreground shrink-0 w-20 tabular-nums",children:new Date(y.timestamp).toLocaleTimeString()}),y.level&&s.jsx("span",{className:`shrink-0 w-12 uppercase ${fb[y.level]??"text-muted-foreground"}`,children:y.level}),y.tag&&s.jsxs("span",{className:"text-primary/70 shrink-0",children:["[",y.tag,"]"]}),s.jsx("span",{className:"text-foreground/80",children:y.message})]},T))}):s.jsx("div",{className:"text-muted-foreground text-sm italic py-12 text-center",children:u("logs.empty")})})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:u("logs.showingRecent")})]})}const hb={"nav.books":{zh:"书籍",en:"Books"},"nav.newBook":{zh:"新建书籍",en:"New Book"},"nav.config":{zh:"配置",en:"Config"},"nav.connected":{zh:"已连接",en:"Connected"},"nav.disconnected":{zh:"未连接",en:"Disconnected"},"dash.title":{zh:"书籍列表",en:"Books"},"dash.noBooks":{zh:"还没有书",en:"No books yet"},"dash.createFirst":{zh:"创建第一本书开始写作",en:"Create your first book to get started"},"dash.writeNext":{zh:"写下一章",en:"Write Next"},"dash.writing":{zh:"写作中...",en:"Writing..."},"dash.stats":{zh:"统计",en:"Stats"},"dash.chapters":{zh:"章",en:"chapters"},"dash.recentEvents":{zh:"最近事件",en:"Recent Events"},"dash.writingProgress":{zh:"写作进度",en:"Writing Progress"},"book.writeNext":{zh:"写下一章",en:"Write Next"},"book.draftOnly":{zh:"仅草稿",en:"Draft Only"},"book.approveAll":{zh:"全部通过",en:"Approve All"},"book.analytics":{zh:"数据分析",en:"Analytics"},"book.noChapters":{zh:"暂无章节,点击「写下一章」开始",en:'No chapters yet. Click "Write Next" to start.'},"book.approve":{zh:"通过",en:"Approve"},"book.reject":{zh:"驳回",en:"Reject"},"book.words":{zh:"字",en:"words"},"reader.backToList":{zh:"返回列表",en:"Back to List"},"reader.approve":{zh:"通过",en:"Approve"},"reader.reject":{zh:"驳回",en:"Reject"},"reader.chapterList":{zh:"章节列表",en:"Chapter List"},"reader.characters":{zh:"字符",en:"characters"},"reader.edit":{zh:"编辑",en:"Edit"},"reader.preview":{zh:"预览",en:"Preview"},"create.title":{zh:"创建书籍",en:"Create Book"},"create.bookTitle":{zh:"书名",en:"Title"},"create.language":{zh:"语言",en:"Language"},"create.genre":{zh:"题材",en:"Genre"},"create.wordsPerChapter":{zh:"每章字数",en:"Words / Chapter"},"create.targetChapters":{zh:"目标章数",en:"Target Chapters"},"create.creating":{zh:"创建中...",en:"Creating..."},"create.submit":{zh:"创建书籍",en:"Create Book"},"create.titleRequired":{zh:"请输入书名",en:"Title is required"},"create.genreRequired":{zh:"请选择题材",en:"Genre is required"},"create.placeholder":{zh:"请输入书名...",en:"Book title..."},"analytics.title":{zh:"数据分析",en:"Analytics"},"analytics.totalChapters":{zh:"总章数",en:"Total Chapters"},"analytics.totalWords":{zh:"总字数",en:"Total Words"},"analytics.avgWords":{zh:"平均字数/章",en:"Avg Words/Chapter"},"analytics.statusDist":{zh:"状态分布",en:"Status Distribution"},"bread.books":{zh:"书籍",en:"Books"},"bread.newBook":{zh:"新建书籍",en:"New Book"},"bread.config":{zh:"配置",en:"Config"},"bread.home":{zh:"首页",en:"Home"},"bread.chapter":{zh:"第{n}章",en:"Chapter {n}"},"config.title":{zh:"项目配置",en:"Project Config"},"config.project":{zh:"项目名",en:"Project"},"config.language":{zh:"语言",en:"Language"},"config.provider":{zh:"提供方",en:"Provider"},"config.model":{zh:"模型",en:"Model"},"config.editHint":{zh:"通过 CLI 编辑配置:",en:"Edit via CLI:"},"nav.system":{zh:"系统",en:"System"},"nav.daemon":{zh:"守护进程",en:"Daemon"},"nav.logs":{zh:"日志",en:"Logs"},"nav.running":{zh:"运行中",en:"Running"},"nav.agentOnline":{zh:"代理在线",en:"Agent Online"},"nav.agentOffline":{zh:"代理离线",en:"Agent Offline"},"nav.tools":{zh:"工具",en:"Tools"},"nav.style":{zh:"文风",en:"Style"},"nav.import":{zh:"导入",en:"Import"},"nav.radar":{zh:"市场雷达",en:"Radar"},"nav.doctor":{zh:"环境诊断",en:"Doctor"},"book.deleteBook":{zh:"删除书籍",en:"Delete Book"},"book.confirmDelete":{zh:"确认删除此书及所有章节?",en:"Delete this book and all chapters?"},"book.settings":{zh:"书籍设置",en:"Book Settings"},"book.status":{zh:"状态",en:"Status"},"book.drafting":{zh:"草稿中...",en:"Drafting..."},"book.pipelineWriting":{zh:"后台正在写作,本页会在完成后自动刷新。",en:"Background writing is running. This page will refresh automatically when it finishes."},"book.pipelineDrafting":{zh:"后台正在生成草稿,本页会在完成后自动刷新。",en:"Background drafting is running. This page will refresh automatically when it finishes."},"book.pipelineFailed":{zh:"后台任务失败",en:"Background job failed"},"book.save":{zh:"保存",en:"Save"},"book.saving":{zh:"保存中...",en:"Saving..."},"book.rewrite":{zh:"重写",en:"Rewrite"},"book.audit":{zh:"审计",en:"Audit"},"book.export":{zh:"导出",en:"Export"},"book.approvedOnly":{zh:"仅已通过",en:"Approved Only"},"book.manuscriptTitle":{zh:"章节标题",en:"Manuscript Title"},"book.curate":{zh:"操作",en:"Actions"},"book.spotFix":{zh:"精修",en:"Spot Fix"},"book.polish":{zh:"打磨",en:"Polish"},"book.rework":{zh:"重作",en:"Rework"},"book.antiDetect":{zh:"反检测",en:"Anti-Detect"},"book.statusActive":{zh:"进行中",en:"Active"},"book.statusPaused":{zh:"已暂停",en:"Paused"},"book.statusOutlining":{zh:"大纲中",en:"Outlining"},"book.statusCompleted":{zh:"已完成",en:"Completed"},"book.statusDropped":{zh:"已放弃",en:"Dropped"},"book.truthFiles":{zh:"真相文件",en:"Truth Files"},"style.title":{zh:"文风分析",en:"Style Analyzer"},"style.sourceName":{zh:"来源名称",en:"Source Name"},"style.sourceExample":{zh:"如:参考小说",en:"e.g. Reference Novel"},"style.textSample":{zh:"文本样本",en:"Text Sample"},"style.pasteHint":{zh:"粘贴参考文本进行文风分析...",en:"Paste reference text for style analysis..."},"style.analyze":{zh:"分析",en:"Analyze"},"style.analyzing":{zh:"分析中...",en:"Analyzing..."},"style.results":{zh:"分析结果",en:"Analysis Results"},"style.avgSentence":{zh:"平均句长",en:"Avg Sentence Length"},"style.vocabDiversity":{zh:"词汇多样性",en:"Vocabulary Diversity"},"style.avgParagraph":{zh:"平均段落长度",en:"Avg Paragraph Length"},"style.sentenceStdDev":{zh:"句长标准差",en:"Sentence StdDev"},"style.topPatterns":{zh:"主要模式",en:"Top Patterns"},"style.rhetoricalFeatures":{zh:"修辞特征",en:"Rhetorical Features"},"style.importToBook":{zh:"导入到书籍",en:"Import to Book"},"style.selectBook":{zh:"选择书籍...",en:"Select book..."},"style.importGuide":{zh:"导入文风指南",en:"Import Style Guide"},"style.emptyHint":{zh:"粘贴文本并点击分析查看文风档案",en:"Paste text and click Analyze to see style profile"},"import.title":{zh:"导入工具",en:"Import Tools"},"import.chapters":{zh:"导入章节",en:"Import Chapters"},"import.canon":{zh:"导入母本",en:"Import Canon"},"import.fanfic":{zh:"同人创作",en:"Fanfic"},"import.selectTarget":{zh:"选择目标书籍...",en:"Select target book..."},"import.splitRegex":{zh:"分割正则(可选)",en:"Split regex (optional)"},"import.pasteChapters":{zh:"粘贴章节文本...",en:"Paste chapter text..."},"import.selectSource":{zh:"选择源(母本)...",en:"Select source (parent)..."},"import.selectDerivative":{zh:"选择目标(衍生)...",en:"Select target (derivative)..."},"import.fanficTitle":{zh:"同人小说标题",en:"Fanfic title"},"import.pasteMaterial":{zh:"粘贴原作文本/设定/角色资料...",en:"Paste source material..."},"import.importing":{zh:"导入中...",en:"Importing..."},"import.creating":{zh:"创建中...",en:"Creating..."},"radar.title":{zh:"市场雷达",en:"Market Radar"},"radar.scan":{zh:"扫描市场",en:"Scan Market"},"radar.scanning":{zh:"扫描中...",en:"Scanning..."},"radar.summary":{zh:"市场概要",en:"Market Summary"},"radar.emptyHint":{zh:"点击「扫描市场」分析当前趋势和机会",en:'Click "Scan Market" to analyze trends and opportunities'},"doctor.title":{zh:"环境诊断",en:"Environment Check"},"doctor.recheck":{zh:"重新检查",en:"Re-check"},"doctor.inkosJson":{zh:"inkos.json 配置",en:"inkos.json configuration"},"doctor.projectEnv":{zh:"项目 .env 文件",en:"Project .env file"},"doctor.globalEnv":{zh:"全局 ~/.inkos/.env",en:"Global ~/.inkos/.env"},"doctor.booksDir":{zh:"书籍目录",en:"Books directory"},"doctor.llmApi":{zh:"LLM API 连接",en:"LLM API connectivity"},"doctor.connected":{zh:"已连接",en:"Connected"},"doctor.failed":{zh:"失败",en:"Failed"},"doctor.allPassed":{zh:"所有检查通过 — 环境健康",en:"All checks passed — environment is healthy"},"doctor.someFailed":{zh:"部分检查失败 — 请查看配置",en:"Some checks failed — review configuration"},"genre.createNew":{zh:"创建新题材",en:"Create New Genre"},"genre.editGenre":{zh:"编辑",en:"Edit"},"genre.deleteGenre":{zh:"删除",en:"Delete"},"genre.confirmDelete":{zh:"确认删除此题材?",en:"Delete this genre?"},"genre.chapterTypes":{zh:"章节类型",en:"Chapter Types"},"genre.fatigueWords":{zh:"疲劳词",en:"Fatigue Words"},"genre.numericalSystem":{zh:"数值系统",en:"Numerical System"},"genre.powerScaling":{zh:"力量等级",en:"Power Scaling"},"genre.eraResearch":{zh:"时代研究",en:"Era Research"},"genre.pacingRule":{zh:"节奏规则",en:"Pacing Rule"},"genre.rules":{zh:"规则",en:"Rules"},"genre.saveChanges":{zh:"保存更改",en:"Save Changes"},"genre.cancel":{zh:"取消",en:"Cancel"},"genre.copyToProject":{zh:"复制到项目",en:"Copy to Project"},"genre.selectHint":{zh:"选择题材查看详情",en:"Select a genre to view details"},"genre.commaSeparated":{zh:"逗号分隔",en:"comma-separated"},"genre.rulesMd":{zh:"规则(Markdown)",en:"Rules (Markdown)"},"config.modelRouting":{zh:"模型路由",en:"Model Routing"},"config.agent":{zh:"代理",en:"Agent"},"config.baseUrl":{zh:"基础 URL",en:"Base URL"},"config.default":{zh:"默认",en:"default"},"config.optional":{zh:"可选",en:"optional"},"config.saveOverrides":{zh:"保存路由",en:"Save Overrides"},"config.save":{zh:"保存",en:"Save"},"config.saving":{zh:"保存中...",en:"Saving..."},"config.cancel":{zh:"取消",en:"Cancel"},"config.edit":{zh:"编辑",en:"Edit"},"config.enabled":{zh:"启用",en:"Enabled"},"config.disabled":{zh:"禁用",en:"Disabled"},"truth.title":{zh:"真相文件",en:"Truth Files"},"truth.edit":{zh:"编辑",en:"Edit"},"truth.chars":{zh:"字",en:"chars"},"truth.save":{zh:"保存",en:"Save"},"truth.saving":{zh:"保存中...",en:"Saving..."},"truth.cancel":{zh:"取消",en:"Cancel"},"truth.empty":{zh:"暂无文件",en:"No truth files"},"truth.noFiles":{zh:"暂无文件",en:"No truth files"},"truth.notFound":{zh:"文件未找到",en:"File not found"},"truth.selectFile":{zh:"选择文件查看内容",en:"Select a file to view"},"truth.selectHint":{zh:"选择文件查看内容",en:"Select a file to view"},"dash.subtitle":{zh:"管理你的文学宇宙和 AI 辅助草稿。",en:"Manage your literary universe and AI-assisted drafts."},"reader.openingManuscript":{zh:"打开书稿中...",en:"Opening manuscript..."},"reader.manuscriptPage":{zh:"书稿页",en:"Manuscript Page"},"reader.minRead":{zh:"分钟阅读",en:"min read"},"reader.endOfChapter":{zh:"本章完",en:"End of Chapter"},"daemon.title":{zh:"守护进程控制",en:"Daemon Control"},"daemon.running":{zh:"运行中",en:"Running"},"daemon.stopped":{zh:"已停止",en:"Stopped"},"daemon.start":{zh:"启动",en:"Start"},"daemon.stop":{zh:"停止",en:"Stop"},"daemon.starting":{zh:"启动中...",en:"Starting..."},"daemon.stopping":{zh:"停止中...",en:"Stopping..."},"daemon.waitingEvents":{zh:"等待事件...",en:"Waiting for events..."},"daemon.startHint":{zh:"启动守护进程查看事件",en:"Start the daemon to see events"},"daemon.eventLog":{zh:"事件日志",en:"Event Log"},"config.temperature":{zh:"温度",en:"Temperature"},"config.maxTokens":{zh:"最大令牌数",en:"Max Tokens"},"config.stream":{zh:"流式输出",en:"Stream"},"config.chinese":{zh:"中文",en:"Chinese"},"config.english":{zh:"英文",en:"English"},"create.platform":{zh:"平台",en:"Platform"},"common.save":{zh:"保存",en:"Save"},"common.cancel":{zh:"取消",en:"Cancel"},"common.delete":{zh:"删除",en:"Delete"},"common.edit":{zh:"编辑",en:"Edit"},"common.error":{zh:"错误",en:"Error"},"common.loading":{zh:"加载中...",en:"Loading..."},"common.refresh":{zh:"刷新",en:"Refresh"},"common.enterCommand":{zh:"输入指令...",en:"Enter command..."},"chapter.readyForReview":{zh:"待审核",en:"Ready for Review"},"chapter.approved":{zh:"已通过",en:"Approved"},"chapter.drafted":{zh:"草稿",en:"Drafted"},"chapter.needsRevision":{zh:"需修订",en:"Needs Revision"},"chapter.imported":{zh:"已导入",en:"Imported"},"chapter.auditFailed":{zh:"审计失败",en:"Audit Failed"},"chapter.label":{zh:"第{n}章",en:"Chapter {n}"},"common.exportSuccess":{zh:"已导出到项目目录",en:"Exported to project directory"},"common.exportFormat":{zh:"导出格式",en:"Export format"},"logs.title":{zh:"日志",en:"Logs"},"logs.empty":{zh:"暂无日志",en:"No log entries yet"},"logs.showingRecent":{zh:"当前展示最近日志记录。",en:"Showing recent log entries."}};function bo(){const{data:r}=Pe("/project"),f=(r==null?void 0:r.language)==="en"?"en":"zh";function u(o){return hb[o][f]}return{t:u,lang:f}}const Lm={id:"",name:"",language:"zh",chapterTypes:"",fatigueWords:"",numericalSystem:!1,powerScaling:!1,eraResearch:!1,pacingRule:"",body:""};function Ni(r){return r.split(",").map(f=>f.trim()).filter(Boolean)}function pb({form:r,onChange:f,onSubmit:u,onCancel:o,isEdit:m,c:x,t:y}){const T=(h,p)=>f({...r,[h]:p});return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"ID"}),s.jsx("input",{type:"text",value:r.id,onChange:h=>T("id",h.target.value),disabled:m,className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm disabled:opacity-50"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Name"}),s.jsx("input",{type:"text",value:r.name,onChange:h=>T("name",h.target.value),className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Language"}),s.jsxs("select",{value:r.language,onChange:h=>T("language",h.target.value),className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm",children:[s.jsx("option",{value:"zh",children:"zh"}),s.jsx("option",{value:"en",children:"en"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Chapter Types (comma-separated)"}),s.jsx("input",{type:"text",value:r.chapterTypes,onChange:h=>T("chapterTypes",h.target.value),className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Fatigue Words (comma-separated)"}),s.jsx("input",{type:"text",value:r.fatigueWords,onChange:h=>T("fatigueWords",h.target.value),className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),s.jsxs("div",{className:"flex gap-6",children:[s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:r.numericalSystem,onChange:h=>T("numericalSystem",h.target.checked)}),"Numerical System"]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:r.powerScaling,onChange:h=>T("powerScaling",h.target.checked)}),"Power Scaling"]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:r.eraResearch,onChange:h=>T("eraResearch",h.target.checked)}),"Era Research"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Pacing Rule"}),s.jsx("input",{type:"text",value:r.pacingRule,onChange:h=>T("pacingRule",h.target.value),className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Rules (Markdown)"}),s.jsx("textarea",{value:r.body,onChange:h=>T("body",h.target.value),rows:6,className:"mt-1 w-full rounded-md border border-border bg-background px-3 py-2 text-sm font-mono"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:u,className:`px-4 py-2 text-sm rounded-md ${x.btnPrimary}`,children:y(m?"genre.saveChanges":"genre.createNew")}),s.jsx("button",{onClick:o,className:`px-4 py-2 text-sm rounded-md ${x.btnSecondary}`,children:y("genre.cancel")})]})]})}function gb({nav:r,theme:f,t:u}){const o=Vt(),{lang:m}=bo(),{data:x,refetch:y}=Pe("/genres"),[T,h]=D.useState(null),[p,A]=D.useState("hidden"),[S,L]=D.useState(Lm),[B,Y]=D.useState(!1),R=(x==null?void 0:x.genres.filter(q=>q.language===m||q.source==="project"))??[],Z=T&&R.some(q=>q.id===T)?T:null,ce=R.find(q=>q.id===Z)??null,{data:X}=Pe(Z?`/genres/${Z}`:""),$=async q=>{await ft(`/genres/${q}/copy`),alert(`Copied ${q} to project genres/`),y()},fe=()=>{L(Lm),A("create")},ke=()=>{X&&(L({id:X.profile.id,name:X.profile.name,language:X.profile.language,chapterTypes:X.profile.chapterTypes.join(", "),fatigueWords:X.profile.fatigueWords.join(", "),numericalSystem:X.profile.numericalSystem,powerScaling:X.profile.powerScaling,eraResearch:X.profile.eraResearch??!1,pacingRule:X.profile.pacingRule,body:X.body}),A("edit"))},W=()=>{A("hidden")},ae=async()=>{try{await ft("/genres/create",{id:S.id,name:S.name,language:S.language,chapterTypes:Ni(S.chapterTypes),fatigueWords:Ni(S.fatigueWords),numericalSystem:S.numericalSystem,powerScaling:S.powerScaling,eraResearch:S.eraResearch,pacingRule:S.pacingRule,body:S.body}),A("hidden"),y()}catch(q){alert(q instanceof Error?q.message:"Failed to create genre")}},V=async()=>{if(Z)try{await He(`/genres/${Z}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({profile:{id:S.id,name:S.name,language:S.language,chapterTypes:Ni(S.chapterTypes),fatigueWords:Ni(S.fatigueWords),numericalSystem:S.numericalSystem,powerScaling:S.powerScaling,eraResearch:S.eraResearch,pacingRule:S.pacingRule},body:S.body})}),A("hidden"),y()}catch(q){alert(q instanceof Error?q.message:"Failed to update genre")}},oe=async()=>{if(Z){Y(!1);try{await He(`/genres/${Z}`,{method:"DELETE"}),h(null),y()}catch(q){alert(q instanceof Error?q.message:"Failed to delete genre")}}};return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:o.link,children:u("bread.home")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{children:u("create.genre")})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"font-serif text-3xl",children:u("create.genre")}),s.jsxs("button",{onClick:fe,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md ${o.btnPrimary}`,children:[s.jsx(ki,{size:16}),"Create Genre"]})]}),p!=="hidden"&&s.jsxs("div",{className:`border ${o.cardStatic} rounded-lg p-6`,children:[s.jsx("h2",{className:"text-lg font-medium mb-4",children:p==="create"?"Create New Genre":`Edit: ${S.id}`}),s.jsx(pb,{form:S,onChange:L,onSubmit:p==="create"?ae:V,onCancel:W,isEdit:p==="edit",c:o,t:u})]}),s.jsxs("div",{className:"grid grid-cols-[250px_1fr] gap-6",children:[s.jsx("div",{className:`border ${o.cardStatic} rounded-lg overflow-hidden`,children:R.map(q=>s.jsxs("button",{onClick:()=>h(q.id),className:`w-full text-left px-4 py-3 border-b border-border/40 transition-colors ${Z===q.id?"bg-primary/10 text-primary":"hover:bg-muted/30"}`,children:[s.jsx("div",{className:"text-sm font-medium",children:q.name}),s.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[q.id," · ",q.language," · ",q.source]})]},q.id))}),s.jsx("div",{className:`border ${o.cardStatic} rounded-lg p-6 min-h-[400px]`,children:Z&&X?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-medium",children:X.profile.name}),s.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:[X.profile.id," · ",X.profile.language," ·",X.profile.numericalSystem?" Numerical":"",X.profile.powerScaling?" Power":"",X.profile.eraResearch?" Era":""]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:ke,className:`flex items-center gap-1.5 px-3 py-1.5 text-sm ${o.btnSecondary} rounded-md`,children:[s.jsx(ro,{size:14}),"Edit"]}),(ce==null?void 0:ce.source)==="project"&&s.jsxs("button",{onClick:()=>Y(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-sm ${o.btnDanger} rounded-md`,children:[s.jsx(wi,{size:14}),"Delete"]}),s.jsx("button",{onClick:()=>Z&&$(Z),className:`px-3 py-1.5 text-sm ${o.btnSecondary} rounded-md`,children:"Copy to Project"})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-2",children:"Chapter Types"}),s.jsx("div",{className:"flex gap-2 flex-wrap",children:X.profile.chapterTypes.map(q=>s.jsx("span",{className:"px-2 py-1 text-xs bg-secondary rounded",children:q},q))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-2",children:"Fatigue Words"}),s.jsxs("div",{className:"flex gap-2 flex-wrap",children:[X.profile.fatigueWords.slice(0,15).map(q=>s.jsx("span",{className:"px-2 py-1 text-xs bg-secondary rounded",children:q},q)),X.profile.fatigueWords.length>15&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",X.profile.fatigueWords.length-15]})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-2",children:"Pacing"}),s.jsx("div",{className:"text-sm",children:X.profile.pacingRule||"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-2",children:"Rules"}),s.jsx("pre",{className:"text-sm leading-relaxed whitespace-pre-wrap font-mono text-foreground/80 bg-muted/30 p-4 rounded-md max-h-[300px] overflow-y-auto",children:X.body||"—"})]})]}):s.jsx("div",{className:"text-muted-foreground text-sm italic flex items-center justify-center h-full",children:"Select a genre to view details"})})]}),s.jsx(yo,{open:B,title:"Delete Genre",message:`Delete genre "${Z}"?`,confirmLabel:u("common.delete")??"Delete",cancelLabel:u("genre.cancel")??"Cancel",variant:"danger",onConfirm:()=>void oe(),onCancel:()=>Y(!1)})]})}function xb(r,f){const u=r.trim()||f.trim();return u?u.startsWith("Error:")?{tone:"error",message:u}:u.endsWith("...")?{tone:"info",message:u}:{tone:"success",message:u}:null}function yb({nav:r,theme:f,t:u}){const o=Vt(),[m,x]=D.useState(""),[y,T]=D.useState(""),[h,p]=D.useState(null),[A,S]=D.useState(!1),[L,B]=D.useState(""),[Y,R]=D.useState(""),[Z,ce]=D.useState(""),{data:X}=Pe("/books"),$=xb(L,Z),fe=async()=>{if(m.trim()){S(!0),p(null),B("");try{const W=await He("/style/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:m,sourceName:y||"sample"})});p(W)}catch(W){B(`Error: ${W instanceof Error?W.message:String(W)}`)}S(!1)}},ke=async()=>{if(!(!Y||!m.trim())){ce("Importing...");try{await ft(`/books/${Y}/style/import`,{text:m,sourceName:y||"sample"}),ce("Style guide imported successfully!")}catch(W){ce(`Error: ${W instanceof Error?W.message:String(W)}`)}}};return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:o.link,children:u("bread.home")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{children:u("nav.style")})]}),s.jsxs("h1",{className:"font-serif text-3xl flex items-center gap-3",children:[s.jsx(ho,{size:28,className:"text-primary"}),u("style.title")]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground block mb-2",children:u("style.sourceName")}),s.jsx("input",{type:"text",value:y,onChange:W=>T(W.target.value),placeholder:u("style.sourceExample"),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm focus:outline-none focus:border-primary"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground block mb-2",children:u("style.textSample")}),s.jsx("textarea",{value:m,onChange:W=>x(W.target.value),rows:12,placeholder:u("style.pasteHint"),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm focus:outline-none focus:border-primary resize-none font-mono"})]}),s.jsx("div",{className:"flex gap-3",children:s.jsxs("button",{onClick:fe,disabled:!m.trim()||A,className:`px-4 py-2 text-sm rounded-lg ${o.btnPrimary} disabled:opacity-30 flex items-center gap-2`,children:[s.jsx(zx,{size:14}),u(A?"style.analyzing":"style.analyze")]})})]}),s.jsxs("div",{className:"space-y-4",children:[h&&s.jsxs("div",{className:`border ${o.cardStatic} rounded-lg p-5 space-y-4`,children:[s.jsx("h3",{className:"font-semibold text-sm uppercase tracking-wider text-muted-foreground",children:u("style.results")}),s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[s.jsxs("div",{className:"bg-secondary/30 rounded-lg p-3",children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:u("style.avgSentence")}),s.jsx("div",{className:"text-xl font-bold",children:h.avgSentenceLength.toFixed(1)})]}),s.jsxs("div",{className:"bg-secondary/30 rounded-lg p-3",children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:u("style.vocabDiversity")}),s.jsxs("div",{className:"text-xl font-bold",children:[(h.vocabularyDiversity*100).toFixed(0),"%"]})]}),s.jsxs("div",{className:"bg-secondary/30 rounded-lg p-3",children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:u("style.avgParagraph")}),s.jsx("div",{className:"text-xl font-bold",children:h.avgParagraphLength.toFixed(0)})]}),s.jsxs("div",{className:"bg-secondary/30 rounded-lg p-3",children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:u("style.sentenceStdDev")}),s.jsx("div",{className:"text-xl font-bold",children:h.sentenceLengthStdDev.toFixed(1)})]})]}),h.topPatterns.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-2",children:u("style.topPatterns")}),s.jsx("div",{className:"flex gap-2 flex-wrap",children:h.topPatterns.map(W=>s.jsx("span",{className:"px-2 py-1 text-xs bg-secondary rounded",children:W},W))})]}),h.rhetoricalFeatures.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-2",children:u("style.rhetoricalFeatures")}),s.jsx("div",{className:"flex gap-2 flex-wrap",children:h.rhetoricalFeatures.map(W=>s.jsx("span",{className:"px-2 py-1 text-xs bg-primary/10 text-primary rounded",children:W},W))})]}),s.jsxs("div",{className:"border-t border-border pt-4 mt-4 space-y-3",children:[s.jsxs("h4",{className:"font-semibold text-sm flex items-center gap-2",children:[s.jsx(Hy,{size:14}),u("style.importToBook")]}),s.jsxs("select",{value:Y,onChange:W=>R(W.target.value),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm",children:[s.jsx("option",{value:"",children:u("style.selectBook")}),X==null?void 0:X.books.map(W=>s.jsx("option",{value:W.id,children:W.title},W.id))]}),s.jsx("button",{onClick:ke,disabled:!Y,className:`px-4 py-2 text-sm rounded-lg ${o.btnSecondary} disabled:opacity-30`,children:u("style.importGuide")}),Z&&s.jsx("div",{className:"text-xs text-muted-foreground",children:Z})]})]}),!h&&!A&&s.jsx("div",{className:`border border-dashed ${o.cardStatic} rounded-lg p-8 text-center text-muted-foreground text-sm italic`,children:u("style.emptyHint")})]})]}),$&&s.jsx("div",{className:`px-4 py-3 rounded-lg text-sm ${$.tone==="error"?"bg-destructive/10 text-destructive":$.tone==="info"?"bg-secondary text-muted-foreground":"bg-emerald-500/10 text-emerald-600"}`,children:$.message})]})}function bb({nav:r,theme:f,t:u}){const o=Vt(),{lang:m}=bo(),{data:x}=Pe("/books"),[y,T]=D.useState("chapters"),[h,p]=D.useState(""),[A,S]=D.useState(!1),[L,B]=D.useState(""),[Y,R]=D.useState(""),[Z,ce]=D.useState(""),[X,$]=D.useState(""),[fe,ke]=D.useState(""),[W,ae]=D.useState(""),[V,oe]=D.useState(""),[q,K]=D.useState("canon"),[le,he]=D.useState("other"),[Ee,Ae]=D.useState(m),k=async()=>{if(!(!L.trim()||!Y)){S(!0),p("");try{const w=await He(`/books/${Y}/import/chapters`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:L,splitRegex:Z||void 0})});p(`Imported ${w.importedCount} chapters`)}catch(w){p(`Error: ${w instanceof Error?w.message:String(w)}`)}S(!1)}},H=async()=>{if(!(!X||!fe)){S(!0),p("");try{await ft(`/books/${X}/import/canon`,{fromBookId:fe}),p("Canon imported successfully!")}catch(w){p(`Error: ${w instanceof Error?w.message:String(w)}`)}S(!1)}},F=async()=>{if(!(!W.trim()||!V.trim())){S(!0),p("");try{const w=await He("/fanfic/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:W,sourceText:V,mode:q,genre:le,language:Ee})});p(`Fanfic created: ${w.bookId}`)}catch(w){p(`Error: ${w instanceof Error?w.message:String(w)}`)}S(!1)}},de=[{id:"chapters",label:u("import.chapters"),icon:s.jsx(eo,{size:14})},{id:"canon",label:u("import.canon"),icon:s.jsx(hx,{size:14})},{id:"fanfic",label:u("import.fanfic"),icon:s.jsx(Yx,{size:14})}];return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:o.link,children:u("bread.home")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{children:u("nav.import")})]}),s.jsxs("h1",{className:"font-serif text-3xl flex items-center gap-3",children:[s.jsx(eo,{size:28,className:"text-primary"}),u("import.title")]}),s.jsx("div",{className:"flex gap-1 bg-secondary/30 rounded-lg p-1 w-fit",children:de.map(w=>s.jsxs("button",{onClick:()=>{T(w.id),p("")},className:`px-4 py-2 rounded-md text-sm font-medium flex items-center gap-2 transition-all ${y===w.id?"bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[w.icon," ",w.label]},w.id))}),s.jsxs("div",{className:`border ${o.cardStatic} rounded-lg p-6 space-y-4`,children:[y==="chapters"&&s.jsxs(s.Fragment,{children:[s.jsxs("select",{value:Y,onChange:w=>R(w.target.value),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm",children:[s.jsx("option",{value:"",children:u("import.selectTarget")}),x==null?void 0:x.books.map(w=>s.jsx("option",{value:w.id,children:w.title},w.id))]}),s.jsx("input",{type:"text",value:Z,onChange:w=>ce(w.target.value),placeholder:u("import.splitRegex"),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm font-mono"}),s.jsx("textarea",{value:L,onChange:w=>B(w.target.value),rows:10,placeholder:u("import.pasteChapters"),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm resize-none font-mono"}),s.jsx("button",{onClick:k,disabled:A||!Y||!L.trim(),className:`px-4 py-2 text-sm rounded-lg ${o.btnPrimary} disabled:opacity-30`,children:u(A?"import.importing":"import.chapters")})]}),y==="canon"&&s.jsxs(s.Fragment,{children:[s.jsxs("select",{value:fe,onChange:w=>ke(w.target.value),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm",children:[s.jsx("option",{value:"",children:u("import.selectSource")}),x==null?void 0:x.books.map(w=>s.jsx("option",{value:w.id,children:w.title},w.id))]}),s.jsxs("select",{value:X,onChange:w=>$(w.target.value),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm",children:[s.jsx("option",{value:"",children:u("import.selectDerivative")}),x==null?void 0:x.books.map(w=>s.jsx("option",{value:w.id,children:w.title},w.id))]}),s.jsx("button",{onClick:H,disabled:A||!X||!fe,className:`px-4 py-2 text-sm rounded-lg ${o.btnPrimary} disabled:opacity-30`,children:u(A?"import.importing":"import.canon")})]}),y==="fanfic"&&s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"text",value:W,onChange:w=>ae(w.target.value),placeholder:u("import.fanficTitle"),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm"}),s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("select",{value:q,onChange:w=>K(w.target.value),className:"px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm",children:[s.jsx("option",{value:"canon",children:"Canon"}),s.jsx("option",{value:"au",children:"AU"}),s.jsx("option",{value:"ooc",children:"OOC"}),s.jsx("option",{value:"cp",children:"CP"})]}),s.jsxs("select",{value:le,onChange:w=>he(w.target.value),className:"px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm",children:[s.jsx("option",{value:"other",children:"Other"}),s.jsx("option",{value:"xuanhuan",children:"玄幻"}),s.jsx("option",{value:"urban",children:"都市"}),s.jsx("option",{value:"xianxia",children:"仙侠"})]}),s.jsxs("select",{value:Ee,onChange:w=>Ae(w.target.value),className:"px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm",children:[s.jsx("option",{value:"zh",children:"中文"}),s.jsx("option",{value:"en",children:"English"})]})]}),s.jsx("textarea",{value:V,onChange:w=>oe(w.target.value),rows:10,placeholder:u("import.pasteMaterial"),className:"w-full px-3 py-2 rounded-lg bg-secondary/30 border border-border text-sm resize-none font-mono"}),s.jsx("button",{onClick:F,disabled:A||!W.trim()||!V.trim(),className:`px-4 py-2 text-sm rounded-lg ${o.btnPrimary} disabled:opacity-30`,children:u(A?"import.creating":"import.fanfic")})]}),h&&s.jsx("div",{className:`text-sm px-3 py-2 rounded-lg ${h.startsWith("Error")?"bg-destructive/10 text-destructive":"bg-emerald-500/10 text-emerald-600"}`,children:h})]})]})}function vb({nav:r,theme:f,t:u}){const o=Vt(),[m,x]=D.useState(null),[y,T]=D.useState(!1),[h,p]=D.useState(""),A=async()=>{T(!0),p(""),x(null);try{const S=await He("/radar/scan",{method:"POST"});x(S)}catch(S){p(S instanceof Error?S.message:String(S))}T(!1)};return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:o.link,children:u("bread.home")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{children:u("nav.radar")})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h1",{className:"font-serif text-3xl flex items-center gap-3",children:[s.jsx(fo,{size:28,className:"text-primary"}),u("radar.title")]}),s.jsxs("button",{onClick:A,disabled:y,className:`px-5 py-2.5 text-sm rounded-lg ${o.btnPrimary} disabled:opacity-30 flex items-center gap-2`,children:[y?s.jsx(es,{size:14,className:"animate-spin"}):s.jsx(Cy,{size:14}),u(y?"radar.scanning":"radar.scan")]})]}),h&&s.jsx("div",{className:"bg-destructive/10 text-destructive px-4 py-3 rounded-lg text-sm",children:h}),m&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:`border ${o.cardStatic} rounded-lg p-5`,children:[s.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground mb-3",children:u("radar.summary")}),s.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:m.marketSummary})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:m.recommendations.map((S,L)=>s.jsxs("div",{className:`border ${o.cardStatic} rounded-lg p-5 space-y-3`,children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:[S.platform," · ",S.genre]}),s.jsxs("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${S.confidence>=.7?"bg-emerald-500/10 text-emerald-600":S.confidence>=.4?"bg-amber-500/10 text-amber-600":"bg-muted text-muted-foreground"}`,children:[(S.confidence*100).toFixed(0),"%"]})]}),s.jsx("p",{className:"text-sm font-semibold",children:S.concept}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:S.reasoning}),S.benchmarkTitles.length>0&&s.jsx("div",{className:"flex gap-2 flex-wrap",children:S.benchmarkTitles.map(B=>s.jsx("span",{className:"px-2 py-0.5 text-[10px] bg-secondary rounded",children:B},B))})]},L))})]}),!m&&!y&&!h&&s.jsx("div",{className:`border border-dashed ${o.cardStatic} rounded-lg p-12 text-center text-muted-foreground text-sm italic`,children:u("radar.emptyHint")})]})}function In({label:r,ok:f,detail:u}){return s.jsxs("div",{className:"flex items-center gap-3 py-3 border-b border-border/30 last:border-0",children:[f?s.jsx(Ti,{size:18,className:"text-emerald-500 shrink-0"}):s.jsx(so,{size:18,className:"text-destructive shrink-0"}),s.jsx("span",{className:"text-sm font-medium flex-1",children:r}),u&&s.jsx("span",{className:"text-xs text-muted-foreground",children:u})]})}function jb({nav:r,theme:f,t:u}){const o=Vt(),{data:m,refetch:x}=Pe("/doctor");return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("button",{onClick:r.toDashboard,className:o.link,children:u("bread.home")}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{children:u("nav.doctor")})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h1",{className:"font-serif text-3xl flex items-center gap-3",children:[s.jsx(th,{size:28,className:"text-primary"}),u("doctor.title")]}),s.jsx("button",{onClick:()=>x(),className:`px-4 py-2 text-sm rounded-lg ${o.btnSecondary}`,children:u("doctor.recheck")})]}),m?s.jsxs("div",{className:`border ${o.cardStatic} rounded-lg p-5`,children:[s.jsx(In,{label:u("doctor.inkosJson"),ok:m.inkosJson}),s.jsx(In,{label:u("doctor.projectEnv"),ok:m.projectEnv}),s.jsx(In,{label:u("doctor.globalEnv"),ok:m.globalEnv}),s.jsx(In,{label:u("doctor.booksDir"),ok:m.booksDir,detail:`${m.bookCount} book(s)`}),s.jsx(In,{label:u("doctor.llmApi"),ok:m.llmConnected,detail:m.llmConnected?u("doctor.connected"):u("doctor.failed")})]}):s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(es,{size:24,className:"animate-spin text-primary"})}),m&&s.jsx("div",{className:`px-4 py-3 rounded-lg text-sm font-medium ${m.inkosJson&&(m.projectEnv||m.globalEnv)&&m.llmConnected?"bg-emerald-500/10 text-emerald-600":"bg-amber-500/10 text-amber-600"}`,children:m.inkosJson&&(m.projectEnv||m.globalEnv)&&m.llmConnected?u("doctor.allPassed"):u("doctor.someFailed")})]})}function Sb({onSelect:r}){const[f,u]=D.useState(null),[o,m]=D.useState(null),x=y=>{m(y),setTimeout(()=>r(y),400)};return s.jsxs("div",{className:"min-h-screen bg-background flex flex-col items-center justify-center px-8",children:[s.jsxs("div",{className:"mb-16 text-center",children:[s.jsxs("div",{className:"flex items-baseline justify-center gap-1.5 mb-4",children:[s.jsx("span",{className:"font-serif text-6xl italic text-primary",children:"Ink"}),s.jsx("span",{className:"text-5xl font-semibold tracking-tight text-foreground",children:"OS"})]}),s.jsx("div",{className:"text-base text-muted-foreground tracking-widest uppercase",children:"Studio"})]}),s.jsxs("div",{className:"flex gap-8 mb-16",children:[s.jsxs("button",{onClick:()=>x("zh"),onMouseEnter:()=>u("zh"),onMouseLeave:()=>u(null),className:`group w-80 border rounded-lg p-10 text-left transition-all duration-300 ${o==="zh"?"border-primary bg-primary/10 scale-[1.02]":f==="zh"?"border-primary/50 bg-card":"border-border bg-card/50"}`,children:[s.jsx("div",{className:"font-serif text-3xl mb-4 text-foreground",children:"中文创作"}),s.jsx("div",{className:"text-base text-foreground/70 leading-relaxed mb-6",children:"玄幻 · 仙侠 · 都市 · 恐怖 · 通用"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"番茄小说 · 起点中文网 · 飞卢"})]}),s.jsxs("button",{onClick:()=>x("en"),onMouseEnter:()=>u("en"),onMouseLeave:()=>u(null),className:`group w-80 border rounded-lg p-10 text-left transition-all duration-300 ${o==="en"?"border-primary bg-primary/10 scale-[1.02]":f==="en"?"border-primary/50 bg-card":"border-border bg-card/50"}`,children:[s.jsx("div",{className:"font-serif text-3xl italic mb-4 text-foreground",children:"English Writing"}),s.jsx("div",{className:"text-base text-foreground/70 leading-relaxed mb-6",children:"LitRPG · Progression · Romantasy · Sci-Fi · Isekai"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Royal Road · Kindle Unlimited · Scribble Hub"})]})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"可在设置中更改 · Can be changed in Settings"})]})}const Nb=["book:creating","book:created","book:deleted","book:error","write:start","write:complete","write:error","draft:start","draft:complete","draft:error","daemon:chapter","daemon:started","daemon:stopped","daemon:error","agent:start","agent:complete","agent:error","audit:start","audit:complete","audit:error","revise:start","revise:complete","revise:error","rewrite:start","rewrite:complete","rewrite:error","style:start","style:complete","style:error","import:start","import:complete","import:error","fanfic:start","fanfic:complete","fanfic:error","fanfic:refresh:start","fanfic:refresh:complete","fanfic:refresh:error","radar:start","radar:complete","radar:error","log","llm:progress","ping"];function zb(r="/api/events"){const[f,u]=D.useState([]),[o,m]=D.useState(!1),x=D.useRef(null);D.useEffect(()=>{const T=new EventSource(r);x.current=T,T.onopen=()=>m(!0),T.onerror=()=>m(!1);const h=p=>{try{const A=p.data?JSON.parse(p.data):null;u(S=>[...S.slice(-99),{event:p.type,data:A,timestamp:Date.now()}])}catch{}};for(const p of Nb)T.addEventListener(p,h);return()=>{T.close(),x.current=null}},[r]);const y=D.useCallback(()=>u([]),[]);return{messages:f,connected:o,clear:y}}const xh="inkos:studio:theme";function kb(r){return r>=6&&r<18?"light":"dark"}function Wc(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function Gm(r){const f=r==null?void 0:r.getItem(xh);return f==="light"||f==="dark"?f:null}function Ym(r){return r.storedTheme??kb(r.hour)}function Eb(){const[r,f]=D.useState(()=>Ym({hour:new Date().getHours(),storedTheme:Gm(Wc())}));return D.useEffect(()=>{const o=setInterval(()=>{const m=Gm(Wc());f(Ym({hour:new Date().getHours(),storedTheme:m}))},6e4);return()=>clearInterval(o)},[]),{theme:r,setTheme:o=>{const m=Wc();try{m==null||m.setItem(xh,o)}catch{}f(o)}}}const Tb=!0;function wb(r){return r.page==="book"||r.page==="chapter"||r.page==="truth"||r.page==="analytics"?r.bookId:void 0}function Cb(){const[r,f]=D.useState({page:"dashboard"}),u=zb(),{theme:o,setTheme:m}=Eb(),{t:x}=bo(),{data:y,refetch:T}=Pe("/project"),[h,p]=D.useState(!1),[A,S]=D.useState(!1),[L,B]=D.useState(Tb),Y=o==="dark";D.useEffect(()=>{document.documentElement.classList.toggle("dark",Y)},[Y]),D.useEffect(()=>{y&&(y.languageExplicit||p(!0),S(!0))},[y]);const R={toDashboard:()=>f({page:"dashboard"}),toBook:X=>f({page:"book",bookId:X}),toBookCreate:()=>f({page:"book-create"}),toChapter:(X,$)=>f({page:"chapter",bookId:X,chapterNumber:$}),toAnalytics:X=>f({page:"analytics",bookId:X}),toConfig:()=>f({page:"config"}),toTruth:X=>f({page:"truth",bookId:X}),toDaemon:()=>f({page:"daemon"}),toLogs:()=>f({page:"logs"}),toGenres:()=>f({page:"genres"}),toStyle:()=>f({page:"style"}),toImport:()=>f({page:"import"}),toRadar:()=>f({page:"radar"}),toDoctor:()=>f({page:"doctor"})},Z=wb(r),ce=Z?`book:${Z}`:r.page;return A?h?s.jsx(Sb,{onSelect:async X=>{await ft("/project/language",{language:X}),p(!1),T()}}):s.jsxs("div",{className:"h-screen bg-background text-foreground flex overflow-hidden font-sans",children:[s.jsx(Zy,{nav:R,activePage:ce,sse:u,t:x}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background/30 backdrop-blur-sm",children:[s.jsxs("header",{className:"h-14 shrink-0 flex items-center justify-between px-8 border-b border-border/40",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground font-bold",children:"InkOS Studio"})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:()=>m(Y?"light":"dark"),className:"w-8 h-8 flex items-center justify-center rounded-lg bg-secondary text-muted-foreground hover:text-primary hover:bg-primary/10 transition-all shadow-sm",title:Y?"Switch to Light Mode":"Switch to Dark Mode",children:Y?s.jsx(Ty,{size:16}):s.jsx(ny,{size:16})}),s.jsx("button",{onClick:()=>B(X=>!X),className:`w-8 h-8 flex items-center justify-center rounded-lg transition-all shadow-sm ${L?"bg-primary text-primary-foreground shadow-primary/20":"bg-secondary text-muted-foreground hover:text-primary hover:bg-primary/10"}`,title:"Toggle AI Assistant",children:s.jsx(Pm,{size:16})})]})]}),s.jsx("main",{className:"flex-1 overflow-y-auto scroll-smooth",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-12 md:px-12 lg:py-16 fade-in",children:[r.page==="dashboard"&&s.jsx(Z0,{nav:R,sse:u,theme:o,t:x}),r.page==="book"&&s.jsx(J0,{bookId:r.bookId,nav:R,theme:o,t:x,sse:u}),r.page==="book-create"&&s.jsx(ab,{nav:R,theme:o,t:x}),r.page==="chapter"&&s.jsx(lb,{bookId:r.bookId,chapterNumber:r.chapterNumber,nav:R,theme:o,t:x}),r.page==="analytics"&&s.jsx(nb,{bookId:r.bookId,nav:R,theme:o,t:x}),r.page==="config"&&s.jsx(cb,{nav:R,theme:o,t:x}),r.page==="truth"&&s.jsx(ub,{bookId:r.bookId,nav:R,theme:o,t:x}),r.page==="daemon"&&s.jsx(db,{nav:R,theme:o,t:x,sse:u}),r.page==="logs"&&s.jsx(mb,{nav:R,theme:o,t:x}),r.page==="genres"&&s.jsx(gb,{nav:R,theme:o,t:x}),r.page==="style"&&s.jsx(yb,{nav:R,theme:o,t:x}),r.page==="import"&&s.jsx(bb,{nav:R,theme:o,t:x}),r.page==="radar"&&s.jsx(vb,{nav:R,theme:o,t:x}),r.page==="doctor"&&s.jsx(jb,{nav:R,theme:o,t:x})]})})]}),s.jsx(Q0,{open:L,onClose:()=>B(!1),t:x,sse:u,activeBookId:Z})]}):s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx("div",{className:"w-12 h-12 border-4 border-primary/20 border-t-primary rounded-full animate-spin"})})}Kg.createRoot(document.getElementById("root")).render(s.jsx(D.StrictMode,{children:s.jsx(Cb,{})}));