@kaitranntt/ccs 7.53.0-dev.1 → 7.53.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.
Files changed (32) hide show
  1. package/dist/cliproxy/config/thinking-config.d.ts.map +1 -1
  2. package/dist/cliproxy/config/thinking-config.js +0 -9
  3. package/dist/cliproxy/config/thinking-config.js.map +1 -1
  4. package/dist/cliproxy/thinking-validator.js +0 -20
  5. package/dist/cliproxy/thinking-validator.js.map +1 -1
  6. package/dist/ui/assets/{accounts-PwWppkAw.js → accounts-BGeV6RYc.js} +1 -1
  7. package/dist/ui/assets/{alert-dialog-BKNsxsSg.js → alert-dialog-BGgi27Hi.js} +1 -1
  8. package/dist/ui/assets/{api-C9f0vP-J.js → api-NqhAOtK1.js} +1 -1
  9. package/dist/ui/assets/{auth-section-D0XQSyo0.js → auth-section-B5dLDT5c.js} +1 -1
  10. package/dist/ui/assets/{backups-section-Dxj8M3n7.js → backups-section-COPmsPIk.js} +1 -1
  11. package/dist/ui/assets/{checkbox-mjr1O0jA.js → checkbox-DYHfVVrN.js} +1 -1
  12. package/dist/ui/assets/{cliproxy-BwRuqd53.js → cliproxy-BSKey7Yk.js} +1 -1
  13. package/dist/ui/assets/{cliproxy-control-panel-VThtggLh.js → cliproxy-control-panel-C-Yyhlim.js} +1 -1
  14. package/dist/ui/assets/{confirm-dialog-i-Sfbmcm.js → confirm-dialog-B7Lzqyum.js} +1 -1
  15. package/dist/ui/assets/{copilot-Bp6z4OCx.js → copilot-D-MitpPb.js} +1 -1
  16. package/dist/ui/assets/{cursor-CJP1tf06.js → cursor-BH8co9su.js} +1 -1
  17. package/dist/ui/assets/{droid-R1Tbhk5J.js → droid-C4lLcCII.js} +1 -1
  18. package/dist/ui/assets/{globalenv-section-TvE1onaY.js → globalenv-section-D0TAPAVS.js} +1 -1
  19. package/dist/ui/assets/{health-Cyjkkaf-.js → health-BzfCtqqG.js} +1 -1
  20. package/dist/ui/assets/{index-CcjPykyr.js → index-B3R5r7pg.js} +1 -1
  21. package/dist/ui/assets/{index-1DQih7xp.js → index-BoCctuVm.js} +1 -1
  22. package/dist/ui/assets/{index-DfbkdLOb.js → index-Br6LTYDi.js} +1 -1
  23. package/dist/ui/assets/index-C2HpWmQl.js +47 -0
  24. package/dist/ui/assets/{index-BlXbW1dV.js → index-DI8j_aYa.js} +1 -1
  25. package/dist/ui/assets/{proxy-status-widget-O38AQ1k4.js → proxy-status-widget-C3kt_0Qn.js} +1 -1
  26. package/dist/ui/assets/{separator-B66kRzAj.js → separator-DJb9h9_B.js} +1 -1
  27. package/dist/ui/assets/{shared-BG19Chhy.js → shared-CKcd4Q-6.js} +1 -1
  28. package/dist/ui/assets/{switch-IqCO_Age.js → switch-BVx3z2gz.js} +1 -1
  29. package/dist/ui/assets/{updates-_5C-OO-6.js → updates-D-X3ZIXa.js} +1 -1
  30. package/dist/ui/index.html +1 -1
  31. package/package.json +1 -1
  32. package/dist/ui/assets/index-WhofYWgJ.js +0 -47
@@ -0,0 +1,47 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DI8j_aYa.js","assets/radix-ui-BR1vy4kf.js","assets/react-vendor-CNOkPC89.js","assets/switch-BVx3z2gz.js","assets/icons-D2eEmpHv.js","assets/tanstack-e99Cjjy2.js","assets/notifications-B2HqRBj7.js","assets/utils-CzKF5WmX.js","assets/form-utils-Bcoyqxpq.js","assets/code-highlight-BRUf_pqB.js","assets/globalenv-section-D0TAPAVS.js","assets/index-BoCctuVm.js","assets/index-B3R5r7pg.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-C3kt_0Qn.js","assets/alert-dialog-BGgi27Hi.js","assets/auth-section-B5dLDT5c.js","assets/backups-section-COPmsPIk.js","assets/index-Br6LTYDi.js","assets/charts-BBPXh0Ar.js","assets/api-NqhAOtK1.js","assets/confirm-dialog-B7Lzqyum.js","assets/separator-DJb9h9_B.js","assets/cliproxy-BSKey7Yk.js","assets/checkbox-DYHfVVrN.js","assets/cliproxy-control-panel-C-Yyhlim.js","assets/copilot-D-MitpPb.js","assets/cursor-BH8co9su.js","assets/droid-C4lLcCII.js","assets/accounts-BGeV6RYc.js","assets/health-BzfCtqqG.js","assets/shared-CKcd4Q-6.js","assets/updates-D-X3ZIXa.js"])))=>i.map(i=>d[i]);
2
+ import{j as r,S as pr,R as ky,C as Ay,a as Ty,T as jy,D as My,P as Dy,O as Ey,b as I0,c as H0,d as B0,e as K0,f as q0,A as G0,g as Y0,h as V0,i as F0,k as Q0,l as W0,m as $0,n as X0,I as Z0,o as Oy,p as J0,q as Ry,r as Py,s as eS,t as Ly,V as tS,L as _y,u as zy,v as nS,w as aS,x as Uy,y as iS,z as oS,G as sS,B as Iy,E as lS,F as rS,H as Hy,J as cS,K as By,M as Ky,N as qy,Q as uS,U as dS,W as fS,X as Gy,Y as hS,Z as mS,_ as pS}from"./radix-ui-BR1vy4kf.js";import{e as Md,f as gS,r as S,u as gr,O as pd,N as yS,h as Dd,L as gd,R as xS,g as bS,i as vS,c as oe,B as SS,j as CS,k as Lt}from"./react-vendor-CNOkPC89.js";import{Q as wS,u as Tt,a as it,b as et,c as NS}from"./tanstack-e99Cjjy2.js";import{t as re,T as kS}from"./notifications-B2HqRBj7.js";import{L as Dn,X as vo,P as AS,C as yr,H as TS,a as jS,K as Yy,G as MS,Z as Vy,b as Fy,F as Qy,U as Wy,S as DS,A as Ds,c as ES,d as OS,M as RS,E as xr,e as br,B as PS,R as Es,W as LS,f as _S,g as zS,h as US,i as cg,j as ug,k as xo,l as Ed,m as lr,n as $y,o as IS,p as HS,q as vr,r as Od,s as Xy,t as Os,u as Sr,v as Rd,T as qn,w as Cr,x as BS,y as KS,z as wr,D as qS,I as GS,J as YS,N as Nr,O as VS,Q as FS,V as QS,Y as WS,_ as $S,$ as XS,a0 as ZS,a1 as Pd,a2 as dg,a3 as JS,a4 as eC,a5 as tC,a6 as nC,a7 as fg,a8 as aC,a9 as iC}from"./icons-D2eEmpHv.js";import{t as oC,c as sC,a as kr,e as xs,f as Cs,b as lC,d as rC,g as cC,h as uC,i as dC,j as fC,k as hC,l as mC,m as pC,n as gC,o as yC,p as xC,q as bC,r as vC,s as SC,u as CC,v as wC,w as NC,x as kC,y as AC,z as TC,A as jC,B as MC,C as DC,D as EC,E as OC,F as RC,G as PC,H as LC,I as _C,J as zC}from"./utils-CzKF5WmX.js";import{o as hg,s as mg,p as UC,a as IC,$ as HC,b as Zy,c as Va,d as BC,_ as KC,u as qC,e as pg}from"./form-utils-Bcoyqxpq.js";import{H as GC,t as gg}from"./code-highlight-BRUf_pqB.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function s(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(c){if(c.ep)return;c.ep=!0;const f=s(c);fetch(c.href,f)}})();var Fu={exports:{}},bs={},Qu={exports:{}},Wu={};var yg;function YC(){return yg||(yg=1,(function(n){function a(R,V){var ie=R.length;R.push(V);e:for(;0<ie;){var $=ie-1>>>1,se=R[$];if(0<c(se,V))R[$]=V,R[ie]=se,ie=$;else break e}}function s(R){return R.length===0?null:R[0]}function l(R){if(R.length===0)return null;var V=R[0],ie=R.pop();if(ie!==V){R[0]=ie;e:for(var $=0,se=R.length,ne=se>>>1;$<ne;){var Ne=2*($+1)-1,F=R[Ne],J=Ne+1,ce=R[J];if(0>c(F,ie))J<se&&0>c(ce,F)?(R[$]=ce,R[J]=ie,$=J):(R[$]=F,R[Ne]=ie,$=Ne);else if(J<se&&0>c(ce,ie))R[$]=ce,R[J]=ie,$=J;else break e}}return V}function c(R,V){var ie=R.sortIndex-V.sortIndex;return ie!==0?ie:R.id-V.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var p=[],y=[],C=1,x=null,v=3,N=!1,w=!1,M=!1,E=!1,j=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function U(R){for(var V=s(y);V!==null;){if(V.callback===null)l(y);else if(V.startTime<=R)l(y),V.sortIndex=V.expirationTime,a(p,V);else break;V=s(y)}}function O(R){if(M=!1,U(R),!w)if(s(p)!==null)w=!0,k||(k=!0,ee());else{var V=s(y);V!==null&&Ce(O,V.startTime-R)}}var k=!1,z=-1,X=5,W=-1;function Q(){return E?!0:!(n.unstable_now()-W<X)}function ae(){if(E=!1,k){var R=n.unstable_now();W=R;var V=!0;try{e:{w=!1,M&&(M=!1,H(z),z=-1),N=!0;var ie=v;try{t:{for(U(R),x=s(p);x!==null&&!(x.expirationTime>R&&Q());){var $=x.callback;if(typeof $=="function"){x.callback=null,v=x.priorityLevel;var se=$(x.expirationTime<=R);if(R=n.unstable_now(),typeof se=="function"){x.callback=se,U(R),V=!0;break t}x===s(p)&&l(p),U(R)}else l(p);x=s(p)}if(x!==null)V=!0;else{var ne=s(y);ne!==null&&Ce(O,ne.startTime-R),V=!1}}break e}finally{x=null,v=ie,N=!1}V=void 0}}finally{V?ee():k=!1}}}var ee;if(typeof B=="function")ee=function(){B(ae)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,fe=ye.port2;ye.port1.onmessage=ae,ee=function(){fe.postMessage(null)}}else ee=function(){j(ae,0)};function Ce(R,V){z=j(function(){R(n.unstable_now())},V)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(R){R.callback=null},n.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<R?Math.floor(1e3/R):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(R){switch(v){case 1:case 2:case 3:var V=3;break;default:V=v}var ie=v;v=V;try{return R()}finally{v=ie}},n.unstable_requestPaint=function(){E=!0},n.unstable_runWithPriority=function(R,V){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var ie=v;v=R;try{return V()}finally{v=ie}},n.unstable_scheduleCallback=function(R,V,ie){var $=n.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?$+ie:$):ie=$,R){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=ie+se,R={id:C++,callback:V,priorityLevel:R,startTime:ie,expirationTime:se,sortIndex:-1},ie>$?(R.sortIndex=ie,a(y,R),s(p)===null&&R===s(y)&&(M?(H(z),z=-1):M=!0,Ce(O,ie-$))):(R.sortIndex=se,a(p,R),w||N||(w=!0,k||(k=!0,ee()))),R},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(R){var V=v;return function(){var ie=v;v=V;try{return R.apply(this,arguments)}finally{v=ie}}}})(Wu)),Wu}var xg;function VC(){return xg||(xg=1,Qu.exports=YC()),Qu.exports}var bg;function FC(){if(bg)return bs;bg=1;var n=VC(),a=Md(),s=gS();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function h(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 m(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 p(e){if(f(e)!==e)throw Error(l(188))}function y(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,o=t;;){var u=i.return;if(u===null)break;var d=u.alternate;if(d===null){if(o=u.return,o!==null){i=o;continue}break}if(u.child===d.child){for(d=u.child;d;){if(d===i)return p(u),e;if(d===o)return p(u),t;d=d.sibling}throw Error(l(188))}if(i.return!==o.return)i=u,o=d;else{for(var g=!1,b=u.child;b;){if(b===i){g=!0,i=u,o=d;break}if(b===o){g=!0,o=u,i=d;break}b=b.sibling}if(!g){for(b=d.child;b;){if(b===i){g=!0,i=d,o=u;break}if(b===o){g=!0,o=d,i=u;break}b=b.sibling}if(!g)throw Error(l(189))}}if(i.alternate!==o)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function C(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=C(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,v=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),B=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Symbol.for("react.client.reference");function fe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case j:return"Profiler";case E:return"StrictMode";case O:return"Suspense";case k:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case B:return e.displayName||"Context";case H:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:fe(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var Ce=Array.isArray,R=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},$=[],se=-1;function ne(e){return{current:e}}function Ne(e){0>se||(e.current=$[se],$[se]=null,se--)}function F(e,t){se++,$[se]=e.current,e.current=t}var J=ne(null),ce=ne(null),te=ne(null),le=ne(null);function xe(e,t){switch(F(te,t),F(ce,e),F(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Op(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Op(t),e=Rp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ne(J),F(J,e)}function Pe(){Ne(J),Ne(ce),Ne(te)}function Ye(e){e.memoizedState!==null&&F(le,e);var t=J.current,i=Rp(t,e.type);t!==i&&(F(ce,e),F(J,i))}function St(e){ce.current===e&&(Ne(J),Ne(ce)),le.current===e&&(Ne(le),ms._currentValue=ie)}var Ct,Fe;function ot(e){if(Ct===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Ct=t&&t[1]||"",Fe=-1<i.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Ct+e+Fe}var Ut=!1;function Qt(e,t){if(!e||Ut)return"";Ut=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(I){var _=I}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(I){_=I}e.call(Y.prototype)}}else{try{throw Error()}catch(I){_=I}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(I){if(I&&_&&typeof I.stack=="string")return[I.stack,_.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=o.DetermineComponentFrameRoot(),g=d[0],b=d[1];if(g&&b){var A=g.split(`
5
+ `),L=b.split(`
6
+ `);for(u=o=0;o<A.length&&!A[o].includes("DetermineComponentFrameRoot");)o++;for(;u<L.length&&!L[u].includes("DetermineComponentFrameRoot");)u++;if(o===A.length||u===L.length)for(o=A.length-1,u=L.length-1;1<=o&&0<=u&&A[o]!==L[u];)u--;for(;1<=o&&0<=u;o--,u--)if(A[o]!==L[u]){if(o!==1||u!==1)do if(o--,u--,0>u||A[o]!==L[u]){var q=`
7
+ `+A[o].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=o&&0<=u);break}}}finally{Ut=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ot(i):""}function Yn(e,t){switch(e.tag){case 26:case 27:case 5:return ot(e.type);case 16:return ot("Lazy");case 13:return e.child!==t&&t!==null?ot("Suspense Fallback"):ot("Suspense");case 19:return ot("SuspenseList");case 0:case 15:return Qt(e.type,!1);case 11:return Qt(e.type.render,!1);case 1:return Qt(e.type,!0);case 31:return ot("Activity");default:return""}}function Te(e){try{var t="",i=null;do t+=Yn(e,i),i=e,e=e.return;while(e);return t}catch(o){return`
8
+ Error generating stack: `+o.message+`
9
+ `+o.stack}}var Wt=Object.prototype.hasOwnProperty,En=n.unstable_scheduleCallback,$t=n.unstable_cancelCallback,Sa=n.unstable_shouldYield,Vn=n.unstable_requestPaint,ht=n.unstable_now,Xt=n.unstable_getCurrentPriorityLevel,Fn=n.unstable_ImmediatePriority,ei=n.unstable_UserBlockingPriority,On=n.unstable_NormalPriority,Rn=n.unstable_LowPriority,Ti=n.unstable_IdlePriority,wo=n.log,No=n.unstable_setDisableYieldValue,Qn=null,Z=null;function De(e){if(typeof wo=="function"&&No(e),Z&&typeof Z.setStrictMode=="function")try{Z.setStrictMode(Qn,e)}catch{}}var be=Math.clz32?Math.clz32:me,Ee=Math.log,st=Math.LN2;function me(e){return e>>>=0,e===0?32:31-(Ee(e)/st|0)|0}var Ae=256,ve=262144,Oe=4194304;function tt(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 we(e,t,i){var o=e.pendingLanes;if(o===0)return 0;var u=0,d=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var b=o&134217727;return b!==0?(o=b&~d,o!==0?u=tt(o):(g&=b,g!==0?u=tt(g):i||(i=b&~e,i!==0&&(u=tt(i))))):(b=o&~d,b!==0?u=tt(b):g!==0?u=tt(g):i||(i=o&~e,i!==0&&(u=tt(i)))),u===0?0:t!==0&&t!==u&&(t&d)===0&&(d=u&-u,i=t&-t,d>=i||d===32&&(i&4194048)!==0)?t:u}function Pt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wn(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 Nt(){var e=Oe;return Oe<<=1,(Oe&62914560)===0&&(Oe=4194304),e}function Zt(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function wn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ko(e,t,i,o,u,d){var g=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var b=e.entanglements,A=e.expirationTimes,L=e.hiddenUpdates;for(i=g&~i;0<i;){var q=31-be(i),Y=1<<q;b[q]=0,A[q]=-1;var _=L[q];if(_!==null)for(L[q]=null,q=0;q<_.length;q++){var I=_[q];I!==null&&(I.lane&=-536870913)}i&=~Y}o!==0&&ti(e,o,0),d!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=d&~(g&~t))}function ti(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-be(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|i&261930}function Ao(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var o=31-be(i),u=1<<o;u&t|e[o]&t&&(e[o]|=t),i&=~u}}function dn(e,t){var i=t&-t;return i=(i&42)!==0?1:$n(i),(i&(e.suspendedLanes|t))!==0?0:i}function $n(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 ji(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function To(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:ng(e.type))}function jo(e,t){var i=V.p;try{return V.p=e,t()}finally{V.p=i}}var Ca=Math.random().toString(36).slice(2),jt="__reactFiber$"+Ca,It="__reactProps$"+Ca,Mi="__reactContainer$"+Ca,Ur="__reactEvents$"+Ca,jb="__reactListeners$"+Ca,Mb="__reactHandles$"+Ca,bf="__reactResources$"+Ca,Mo="__reactMarker$"+Ca;function Ir(e){delete e[jt],delete e[It],delete e[Ur],delete e[jb],delete e[Mb]}function Di(e){var t=e[jt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Mi]||i[jt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Hp(e);e!==null;){if(i=e[jt])return i;e=Hp(e)}return t}e=i,i=e.parentNode}return null}function Ei(e){if(e=e[jt]||e[Mi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Do(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Oi(e){var t=e[bf];return t||(t=e[bf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function kt(e){e[Mo]=!0}var vf=new Set,Sf={};function ni(e,t){Ri(e,t),Ri(e+"Capture",t)}function Ri(e,t){for(Sf[e]=t,e=0;e<t.length;e++)vf.add(t[e])}var Db=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]*$"),Cf={},wf={};function Eb(e){return Wt.call(wf,e)?!0:Wt.call(Cf,e)?!1:Db.test(e)?wf[e]=!0:(Cf[e]=!0,!1)}function Hs(e,t,i){if(Eb(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Bs(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Xn(e,t,i,o){if(o===null)e.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+o)}}function fn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ob(e,t,i){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,d=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(g){i=""+g,d.call(this,g)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return i},setValue:function(g){i=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hr(e){if(!e._valueTracker){var t=Nf(e)?"checked":"value";e._valueTracker=Ob(e,t,""+e[t])}}function kf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),o="";return e&&(o=Nf(e)?e.checked?"true":"false":e.value),e=o,e!==i?(t.setValue(e),!0):!1}function Ks(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 Rb=/[\n"\\]/g;function hn(e){return e.replace(Rb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Br(e,t,i,o,u,d,g,b){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fn(t)):e.value!==""+fn(t)&&(e.value=""+fn(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Kr(e,g,fn(t)):i!=null?Kr(e,g,fn(i)):o!=null&&e.removeAttribute("value"),u==null&&d!=null&&(e.defaultChecked=!!d),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+fn(b):e.removeAttribute("name")}function Af(e,t,i,o,u,d,g,b){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||i!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Hr(e);return}i=i!=null?""+fn(i):"",t=t!=null?""+fn(t):i,b||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=b?e.checked:!!o,e.defaultChecked=!!o,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),Hr(e)}function Kr(e,t,i){t==="number"&&Ks(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Pi(e,t,i,o){if(e=e.options,t){t={};for(var u=0;u<i.length;u++)t["$"+i[u]]=!0;for(i=0;i<e.length;i++)u=t.hasOwnProperty("$"+e[i].value),e[i].selected!==u&&(e[i].selected=u),u&&o&&(e[i].defaultSelected=!0)}else{for(i=""+fn(i),t=null,u=0;u<e.length;u++){if(e[u].value===i){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Tf(e,t,i){if(t!=null&&(t=""+fn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+fn(i):""}function jf(e,t,i,o){if(t==null){if(o!=null){if(i!=null)throw Error(l(92));if(Ce(o)){if(1<o.length)throw Error(l(93));o=o[0]}i=o}i==null&&(i=""),t=i}i=fn(t),e.defaultValue=i,o=e.textContent,o===i&&o!==""&&o!==null&&(e.value=o),Hr(e)}function Li(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Pb=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 Mf(e,t,i){var o=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,i):typeof i!="number"||i===0||Pb.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Df(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var o in i)!i.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in t)o=t[u],t.hasOwnProperty(u)&&i[u]!==o&&Mf(e,u,o)}else for(var d in t)t.hasOwnProperty(d)&&Mf(e,d,t[d])}function qr(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 Lb=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"]]),_b=/^[\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 qs(e){return _b.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zn(){}var Gr=null;function Yr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _i=null,zi=null;function Ef(e){var t=Ei(e);if(t&&(e=t.stateNode)){var i=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(Br(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+hn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var o=i[t];if(o!==e&&o.form===e.form){var u=o[It]||null;if(!u)throw Error(l(90));Br(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<i.length;t++)o=i[t],o.form===e.form&&kf(o)}break e;case"textarea":Tf(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Pi(e,!!i.multiple,t,!1)}}}var Vr=!1;function Of(e,t,i){if(Vr)return e(t,i);Vr=!0;try{var o=e(t);return o}finally{if(Vr=!1,(_i!==null||zi!==null)&&(Dl(),_i&&(t=_i,e=zi,zi=_i=null,Ef(t),e)))for(t=0;t<e.length;t++)Ef(e[t])}}function Eo(e,t){var i=e.stateNode;if(i===null)return null;var o=i[It]||null;if(o===null)return null;i=o[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":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fr=!1;if(Jn)try{var Oo={};Object.defineProperty(Oo,"passive",{get:function(){Fr=!0}}),window.addEventListener("test",Oo,Oo),window.removeEventListener("test",Oo,Oo)}catch{Fr=!1}var wa=null,Qr=null,Gs=null;function Rf(){if(Gs)return Gs;var e,t=Qr,i=t.length,o,u="value"in wa?wa.value:wa.textContent,d=u.length;for(e=0;e<i&&t[e]===u[e];e++);var g=i-e;for(o=1;o<=g&&t[i-o]===u[d-o];o++);return Gs=u.slice(e,1<o?1-o:void 0)}function Ys(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 Vs(){return!0}function Pf(){return!1}function Ht(e){function t(i,o,u,d,g){this._reactName=i,this._targetInst=u,this.type=o,this.nativeEvent=d,this.target=g,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(i=e[b],this[b]=i?i(d):d[b]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Vs:Pf,this.isPropagationStopped=Pf,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Vs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Vs)},persist:function(){},isPersistent:Vs}),t}var ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fs=Ht(ai),Ro=x({},ai,{view:0,detail:0}),zb=Ht(Ro),Wr,$r,Po,Qs=x({},Ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zr,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!==Po&&(Po&&e.type==="mousemove"?(Wr=e.screenX-Po.screenX,$r=e.screenY-Po.screenY):$r=Wr=0,Po=e),Wr)},movementY:function(e){return"movementY"in e?e.movementY:$r}}),Lf=Ht(Qs),Ub=x({},Qs,{dataTransfer:0}),Ib=Ht(Ub),Hb=x({},Ro,{relatedTarget:0}),Xr=Ht(Hb),Bb=x({},ai,{animationName:0,elapsedTime:0,pseudoElement:0}),Kb=Ht(Bb),qb=x({},ai,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gb=Ht(qb),Yb=x({},ai,{data:0}),_f=Ht(Yb),Vb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fb={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"},Qb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qb[e])?!!t[e]:!1}function Zr(){return Wb}var $b=x({},Ro,{key:function(e){if(e.key){var t=Vb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ys(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Fb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zr,charCode:function(e){return e.type==="keypress"?Ys(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ys(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xb=Ht($b),Zb=x({},Qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zf=Ht(Zb),Jb=x({},Ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zr}),ev=Ht(Jb),tv=x({},ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),nv=Ht(tv),av=x({},Qs,{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}),iv=Ht(av),ov=x({},ai,{newState:0,oldState:0}),sv=Ht(ov),lv=[9,13,27,32],Jr=Jn&&"CompositionEvent"in window,Lo=null;Jn&&"documentMode"in document&&(Lo=document.documentMode);var rv=Jn&&"TextEvent"in window&&!Lo,Uf=Jn&&(!Jr||Lo&&8<Lo&&11>=Lo),If=" ",Hf=!1;function Bf(e,t){switch(e){case"keyup":return lv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ui=!1;function cv(e,t){switch(e){case"compositionend":return Kf(t);case"keypress":return t.which!==32?null:(Hf=!0,If);case"textInput":return e=t.data,e===If&&Hf?null:e;default:return null}}function uv(e,t){if(Ui)return e==="compositionend"||!Jr&&Bf(e,t)?(e=Rf(),Gs=Qr=wa=null,Ui=!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 Uf&&t.locale!=="ko"?null:t.data;default:return null}}var dv={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 qf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dv[e.type]:t==="textarea"}function Gf(e,t,i,o){_i?zi?zi.push(o):zi=[o]:_i=o,t=zl(t,"onChange"),0<t.length&&(i=new Fs("onChange","change",null,i,o),e.push({event:i,listeners:t}))}var _o=null,zo=null;function fv(e){Ap(e,0)}function Ws(e){var t=Do(e);if(kf(t))return e}function Yf(e,t){if(e==="change")return t}var Vf=!1;if(Jn){var ec;if(Jn){var tc="oninput"in document;if(!tc){var Ff=document.createElement("div");Ff.setAttribute("oninput","return;"),tc=typeof Ff.oninput=="function"}ec=tc}else ec=!1;Vf=ec&&(!document.documentMode||9<document.documentMode)}function Qf(){_o&&(_o.detachEvent("onpropertychange",Wf),zo=_o=null)}function Wf(e){if(e.propertyName==="value"&&Ws(zo)){var t=[];Gf(t,zo,e,Yr(e)),Of(fv,t)}}function hv(e,t,i){e==="focusin"?(Qf(),_o=t,zo=i,_o.attachEvent("onpropertychange",Wf)):e==="focusout"&&Qf()}function mv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ws(zo)}function pv(e,t){if(e==="click")return Ws(t)}function gv(e,t){if(e==="input"||e==="change")return Ws(t)}function yv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jt=typeof Object.is=="function"?Object.is:yv;function Uo(e,t){if(Jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(o=0;o<i.length;o++){var u=i[o];if(!Wt.call(t,u)||!Jt(e[u],t[u]))return!1}return!0}function $f(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xf(e,t){var i=$f(e);e=0;for(var o;i;){if(i.nodeType===3){if(o=e+i.textContent.length,e<=t&&o>=t)return{node:i,offset:t-e};e=o}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=$f(i)}}function Zf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ks(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Ks(e.document)}return t}function nc(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 xv=Jn&&"documentMode"in document&&11>=document.documentMode,Ii=null,ac=null,Io=null,ic=!1;function eh(e,t,i){var o=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ic||Ii==null||Ii!==Ks(o)||(o=Ii,"selectionStart"in o&&nc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Io&&Uo(Io,o)||(Io=o,o=zl(ac,"onSelect"),0<o.length&&(t=new Fs("onSelect","select",null,t,i),e.push({event:t,listeners:o}),t.target=Ii)))}function ii(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Hi={animationend:ii("Animation","AnimationEnd"),animationiteration:ii("Animation","AnimationIteration"),animationstart:ii("Animation","AnimationStart"),transitionrun:ii("Transition","TransitionRun"),transitionstart:ii("Transition","TransitionStart"),transitioncancel:ii("Transition","TransitionCancel"),transitionend:ii("Transition","TransitionEnd")},oc={},th={};Jn&&(th=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function oi(e){if(oc[e])return oc[e];if(!Hi[e])return e;var t=Hi[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in th)return oc[e]=t[i];return e}var nh=oi("animationend"),ah=oi("animationiteration"),ih=oi("animationstart"),bv=oi("transitionrun"),vv=oi("transitionstart"),Sv=oi("transitioncancel"),oh=oi("transitionend"),sh=new Map,sc="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(" ");sc.push("scrollEnd");function Nn(e,t){sh.set(e,t),ni(t,[e])}var $s=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)},mn=[],Bi=0,lc=0;function Xs(){for(var e=Bi,t=lc=Bi=0;t<e;){var i=mn[t];mn[t++]=null;var o=mn[t];mn[t++]=null;var u=mn[t];mn[t++]=null;var d=mn[t];if(mn[t++]=null,o!==null&&u!==null){var g=o.pending;g===null?u.next=u:(u.next=g.next,g.next=u),o.pending=u}d!==0&&lh(i,u,d)}}function Zs(e,t,i,o){mn[Bi++]=e,mn[Bi++]=t,mn[Bi++]=i,mn[Bi++]=o,lc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function rc(e,t,i,o){return Zs(e,t,i,o),Js(e)}function si(e,t){return Zs(e,null,null,t),Js(e)}function lh(e,t,i){e.lanes|=i;var o=e.alternate;o!==null&&(o.lanes|=i);for(var u=!1,d=e.return;d!==null;)d.childLanes|=i,o=d.alternate,o!==null&&(o.childLanes|=i),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(u=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,u&&t!==null&&(u=31-be(i),e=d.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=i|536870912),d):null}function Js(e){if(50<ls)throw ls=0,yu=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ki={};function Cv(e,t,i,o){this.tag=e,this.key=i,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(e,t,i,o){return new Cv(e,t,i,o)}function cc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ea(e,t){var i=e.alternate;return i===null?(i=en(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function rh(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function el(e,t,i,o,u,d){var g=0;if(o=e,typeof e=="function")cc(e)&&(g=1);else if(typeof e=="string")g=T0(e,i,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=en(31,i,t,u),e.elementType=W,e.lanes=d,e;case M:return li(i.children,u,d,t);case E:g=8,u|=24;break;case j:return e=en(12,i,t,u|2),e.elementType=j,e.lanes=d,e;case O:return e=en(13,i,t,u),e.elementType=O,e.lanes=d,e;case k:return e=en(19,i,t,u),e.elementType=k,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B:g=10;break e;case H:g=9;break e;case U:g=11;break e;case z:g=14;break e;case X:g=16,o=null;break e}g=29,i=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=en(g,i,t,u),t.elementType=e,t.type=o,t.lanes=d,t}function li(e,t,i,o){return e=en(7,e,o,t),e.lanes=i,e}function uc(e,t,i){return e=en(6,e,null,t),e.lanes=i,e}function ch(e){var t=en(18,null,null,0);return t.stateNode=e,t}function dc(e,t,i){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var uh=new WeakMap;function pn(e,t){if(typeof e=="object"&&e!==null){var i=uh.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Te(t)},uh.set(e,t),t)}return{value:e,source:t,stack:Te(t)}}var qi=[],Gi=0,tl=null,Ho=0,gn=[],yn=0,Na=null,Pn=1,Ln="";function ta(e,t){qi[Gi++]=Ho,qi[Gi++]=tl,tl=e,Ho=t}function dh(e,t,i){gn[yn++]=Pn,gn[yn++]=Ln,gn[yn++]=Na,Na=e;var o=Pn;e=Ln;var u=32-be(o)-1;o&=~(1<<u),i+=1;var d=32-be(t)+u;if(30<d){var g=u-u%5;d=(o&(1<<g)-1).toString(32),o>>=g,u-=g,Pn=1<<32-be(t)+u|i<<u|o,Ln=d+e}else Pn=1<<d|i<<u|o,Ln=e}function fc(e){e.return!==null&&(ta(e,1),dh(e,1,0))}function hc(e){for(;e===tl;)tl=qi[--Gi],qi[Gi]=null,Ho=qi[--Gi],qi[Gi]=null;for(;e===Na;)Na=gn[--yn],gn[yn]=null,Ln=gn[--yn],gn[yn]=null,Pn=gn[--yn],gn[yn]=null}function fh(e,t){gn[yn++]=Pn,gn[yn++]=Ln,gn[yn++]=Na,Pn=t.id,Ln=t.overflow,Na=e}var Mt=null,nt=null,Ie=!1,ka=null,xn=!1,mc=Error(l(519));function Aa(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bo(pn(t,e)),mc}function hh(e){var t=e.stateNode,i=e.type,o=e.memoizedProps;switch(t[jt]=e,t[It]=o,i){case"dialog":_e("cancel",t),_e("close",t);break;case"iframe":case"object":case"embed":_e("load",t);break;case"video":case"audio":for(i=0;i<cs.length;i++)_e(cs[i],t);break;case"source":_e("error",t);break;case"img":case"image":case"link":_e("error",t),_e("load",t);break;case"details":_e("toggle",t);break;case"input":_e("invalid",t),Af(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":_e("invalid",t);break;case"textarea":_e("invalid",t),jf(t,o.value,o.defaultValue,o.children)}i=o.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||o.suppressHydrationWarning===!0||Dp(t.textContent,i)?(o.popover!=null&&(_e("beforetoggle",t),_e("toggle",t)),o.onScroll!=null&&_e("scroll",t),o.onScrollEnd!=null&&_e("scrollend",t),o.onClick!=null&&(t.onclick=Zn),t=!0):t=!1,t||Aa(e,!0)}function mh(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:xn=!1;return;case 27:case 3:xn=!0;return;default:Mt=Mt.return}}function Yi(e){if(e!==Mt)return!1;if(!Ie)return mh(e),Ie=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Ou(e.type,e.memoizedProps)),i=!i),i&&nt&&Aa(e),mh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));nt=Ip(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));nt=Ip(e)}else t===27?(t=nt,Ha(e.type)?(e=zu,zu=null,nt=e):nt=t):nt=Mt?vn(e.stateNode.nextSibling):null;return!0}function ri(){nt=Mt=null,Ie=!1}function pc(){var e=ka;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),ka=null),e}function Bo(e){ka===null?ka=[e]:ka.push(e)}var gc=ne(null),ci=null,na=null;function Ta(e,t,i){F(gc,t._currentValue),t._currentValue=i}function aa(e){e._currentValue=gc.current,Ne(gc)}function yc(e,t,i){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===i)break;e=e.return}}function xc(e,t,i,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var d=u.dependencies;if(d!==null){var g=u.child;d=d.firstContext;e:for(;d!==null;){var b=d;d=u;for(var A=0;A<t.length;A++)if(b.context===t[A]){d.lanes|=i,b=d.alternate,b!==null&&(b.lanes|=i),yc(d.return,i,e),o||(g=null);break e}d=b.next}}else if(u.tag===18){if(g=u.return,g===null)throw Error(l(341));g.lanes|=i,d=g.alternate,d!==null&&(d.lanes|=i),yc(g,i,e),g=null}else g=u.child;if(g!==null)g.return=u;else for(g=u;g!==null;){if(g===e){g=null;break}if(u=g.sibling,u!==null){u.return=g.return,g=u;break}g=g.return}u=g}}function Vi(e,t,i,o){e=null;for(var u=t,d=!1;u!==null;){if(!d){if((u.flags&524288)!==0)d=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var g=u.alternate;if(g===null)throw Error(l(387));if(g=g.memoizedProps,g!==null){var b=u.type;Jt(u.pendingProps.value,g.value)||(e!==null?e.push(b):e=[b])}}else if(u===le.current){if(g=u.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(ms):e=[ms])}u=u.return}e!==null&&xc(t,e,i,o),t.flags|=262144}function nl(e){for(e=e.firstContext;e!==null;){if(!Jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ui(e){ci=e,na=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return ph(ci,e)}function al(e,t){return ci===null&&ui(e),ph(e,t)}function ph(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},na===null){if(e===null)throw Error(l(308));na=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else na=na.next=t;return i}var wv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Nv=n.unstable_scheduleCallback,kv=n.unstable_NormalPriority,yt={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bc(){return{controller:new wv,data:new Map,refCount:0}}function Ko(e){e.refCount--,e.refCount===0&&Nv(kv,function(){e.controller.abort()})}var qo=null,vc=0,Fi=0,Qi=null;function Av(e,t){if(qo===null){var i=qo=[];vc=0,Fi=wu(),Qi={status:"pending",value:void 0,then:function(o){i.push(o)}}}return vc++,t.then(gh,gh),t}function gh(){if(--vc===0&&qo!==null){Qi!==null&&(Qi.status="fulfilled");var e=qo;qo=null,Fi=0,Qi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Tv(e,t){var i=[],o={status:"pending",value:null,reason:null,then:function(u){i.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<i.length;u++)(0,i[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<i.length;u++)(0,i[u])(void 0)}),o}var yh=R.S;R.S=function(e,t){ep=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Av(e,t),yh!==null&&yh(e,t)};var di=ne(null);function Sc(){var e=di.current;return e!==null?e:Je.pooledCache}function il(e,t){t===null?F(di,di.current):F(di,t.pool)}function xh(){var e=Sc();return e===null?null:{parent:yt._currentValue,pool:e}}var Wi=Error(l(460)),Cc=Error(l(474)),ol=Error(l(542)),sl={then:function(){}};function bh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vh(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Zn,Zn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e;default:if(typeof t.status=="string")t.then(Zn,Zn);else{if(e=Je,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e}throw hi=t,Wi}}function fi(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(hi=i,Wi):i}}var hi=null;function Sh(){if(hi===null)throw Error(l(459));var e=hi;return hi=null,e}function Ch(e){if(e===Wi||e===ol)throw Error(l(483))}var $i=null,Go=0;function ll(e){var t=Go;return Go+=1,$i===null&&($i=[]),vh($i,e,t)}function Yo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function rl(e,t){throw t.$$typeof===v?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wh(e){function t(D,T){if(e){var P=D.deletions;P===null?(D.deletions=[T],D.flags|=16):P.push(T)}}function i(D,T){if(!e)return null;for(;T!==null;)t(D,T),T=T.sibling;return null}function o(D){for(var T=new Map;D!==null;)D.key!==null?T.set(D.key,D):T.set(D.index,D),D=D.sibling;return T}function u(D,T){return D=ea(D,T),D.index=0,D.sibling=null,D}function d(D,T,P){return D.index=P,e?(P=D.alternate,P!==null?(P=P.index,P<T?(D.flags|=67108866,T):P):(D.flags|=67108866,T)):(D.flags|=1048576,T)}function g(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function b(D,T,P,G){return T===null||T.tag!==6?(T=uc(P,D.mode,G),T.return=D,T):(T=u(T,P),T.return=D,T)}function A(D,T,P,G){var ge=P.type;return ge===M?q(D,T,P.props.children,G,P.key):T!==null&&(T.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===X&&fi(ge)===T.type)?(T=u(T,P.props),Yo(T,P),T.return=D,T):(T=el(P.type,P.key,P.props,null,D.mode,G),Yo(T,P),T.return=D,T)}function L(D,T,P,G){return T===null||T.tag!==4||T.stateNode.containerInfo!==P.containerInfo||T.stateNode.implementation!==P.implementation?(T=dc(P,D.mode,G),T.return=D,T):(T=u(T,P.children||[]),T.return=D,T)}function q(D,T,P,G,ge){return T===null||T.tag!==7?(T=li(P,D.mode,G,ge),T.return=D,T):(T=u(T,P),T.return=D,T)}function Y(D,T,P){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=uc(""+T,D.mode,P),T.return=D,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case N:return P=el(T.type,T.key,T.props,null,D.mode,P),Yo(P,T),P.return=D,P;case w:return T=dc(T,D.mode,P),T.return=D,T;case X:return T=fi(T),Y(D,T,P)}if(Ce(T)||ee(T))return T=li(T,D.mode,P,null),T.return=D,T;if(typeof T.then=="function")return Y(D,ll(T),P);if(T.$$typeof===B)return Y(D,al(D,T),P);rl(D,T)}return null}function _(D,T,P,G){var ge=T!==null?T.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return ge!==null?null:b(D,T,""+P,G);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case N:return P.key===ge?A(D,T,P,G):null;case w:return P.key===ge?L(D,T,P,G):null;case X:return P=fi(P),_(D,T,P,G)}if(Ce(P)||ee(P))return ge!==null?null:q(D,T,P,G,null);if(typeof P.then=="function")return _(D,T,ll(P),G);if(P.$$typeof===B)return _(D,T,al(D,P),G);rl(D,P)}return null}function I(D,T,P,G,ge){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return D=D.get(P)||null,b(T,D,""+G,ge);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case N:return D=D.get(G.key===null?P:G.key)||null,A(T,D,G,ge);case w:return D=D.get(G.key===null?P:G.key)||null,L(T,D,G,ge);case X:return G=fi(G),I(D,T,P,G,ge)}if(Ce(G)||ee(G))return D=D.get(P)||null,q(T,D,G,ge,null);if(typeof G.then=="function")return I(D,T,P,ll(G),ge);if(G.$$typeof===B)return I(D,T,P,al(T,G),ge);rl(T,G)}return null}function ue(D,T,P,G){for(var ge=null,Ke=null,de=T,Me=T=0,Ue=null;de!==null&&Me<P.length;Me++){de.index>Me?(Ue=de,de=null):Ue=de.sibling;var qe=_(D,de,P[Me],G);if(qe===null){de===null&&(de=Ue);break}e&&de&&qe.alternate===null&&t(D,de),T=d(qe,T,Me),Ke===null?ge=qe:Ke.sibling=qe,Ke=qe,de=Ue}if(Me===P.length)return i(D,de),Ie&&ta(D,Me),ge;if(de===null){for(;Me<P.length;Me++)de=Y(D,P[Me],G),de!==null&&(T=d(de,T,Me),Ke===null?ge=de:Ke.sibling=de,Ke=de);return Ie&&ta(D,Me),ge}for(de=o(de);Me<P.length;Me++)Ue=I(de,D,Me,P[Me],G),Ue!==null&&(e&&Ue.alternate!==null&&de.delete(Ue.key===null?Me:Ue.key),T=d(Ue,T,Me),Ke===null?ge=Ue:Ke.sibling=Ue,Ke=Ue);return e&&de.forEach(function(Ya){return t(D,Ya)}),Ie&&ta(D,Me),ge}function Se(D,T,P,G){if(P==null)throw Error(l(151));for(var ge=null,Ke=null,de=T,Me=T=0,Ue=null,qe=P.next();de!==null&&!qe.done;Me++,qe=P.next()){de.index>Me?(Ue=de,de=null):Ue=de.sibling;var Ya=_(D,de,qe.value,G);if(Ya===null){de===null&&(de=Ue);break}e&&de&&Ya.alternate===null&&t(D,de),T=d(Ya,T,Me),Ke===null?ge=Ya:Ke.sibling=Ya,Ke=Ya,de=Ue}if(qe.done)return i(D,de),Ie&&ta(D,Me),ge;if(de===null){for(;!qe.done;Me++,qe=P.next())qe=Y(D,qe.value,G),qe!==null&&(T=d(qe,T,Me),Ke===null?ge=qe:Ke.sibling=qe,Ke=qe);return Ie&&ta(D,Me),ge}for(de=o(de);!qe.done;Me++,qe=P.next())qe=I(de,D,Me,qe.value,G),qe!==null&&(e&&qe.alternate!==null&&de.delete(qe.key===null?Me:qe.key),T=d(qe,T,Me),Ke===null?ge=qe:Ke.sibling=qe,Ke=qe);return e&&de.forEach(function(U0){return t(D,U0)}),Ie&&ta(D,Me),ge}function Ze(D,T,P,G){if(typeof P=="object"&&P!==null&&P.type===M&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case N:e:{for(var ge=P.key;T!==null;){if(T.key===ge){if(ge=P.type,ge===M){if(T.tag===7){i(D,T.sibling),G=u(T,P.props.children),G.return=D,D=G;break e}}else if(T.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===X&&fi(ge)===T.type){i(D,T.sibling),G=u(T,P.props),Yo(G,P),G.return=D,D=G;break e}i(D,T);break}else t(D,T);T=T.sibling}P.type===M?(G=li(P.props.children,D.mode,G,P.key),G.return=D,D=G):(G=el(P.type,P.key,P.props,null,D.mode,G),Yo(G,P),G.return=D,D=G)}return g(D);case w:e:{for(ge=P.key;T!==null;){if(T.key===ge)if(T.tag===4&&T.stateNode.containerInfo===P.containerInfo&&T.stateNode.implementation===P.implementation){i(D,T.sibling),G=u(T,P.children||[]),G.return=D,D=G;break e}else{i(D,T);break}else t(D,T);T=T.sibling}G=dc(P,D.mode,G),G.return=D,D=G}return g(D);case X:return P=fi(P),Ze(D,T,P,G)}if(Ce(P))return ue(D,T,P,G);if(ee(P)){if(ge=ee(P),typeof ge!="function")throw Error(l(150));return P=ge.call(P),Se(D,T,P,G)}if(typeof P.then=="function")return Ze(D,T,ll(P),G);if(P.$$typeof===B)return Ze(D,T,al(D,P),G);rl(D,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,T!==null&&T.tag===6?(i(D,T.sibling),G=u(T,P),G.return=D,D=G):(i(D,T),G=uc(P,D.mode,G),G.return=D,D=G),g(D)):i(D,T)}return function(D,T,P,G){try{Go=0;var ge=Ze(D,T,P,G);return $i=null,ge}catch(de){if(de===Wi||de===ol)throw de;var Ke=en(29,de,null,D.mode);return Ke.lanes=G,Ke.return=D,Ke}finally{}}}var mi=wh(!0),Nh=wh(!1),ja=!1;function wc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nc(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 Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Da(e,t,i){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=Js(e),lh(e,null,i),t}return Zs(e,o,t,i),Js(e)}function Vo(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,i|=o,t.lanes=i,Ao(e,i)}}function kc(e,t){var i=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,i===o)){var u=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var g={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?u=d=g:d=d.next=g,i=i.next}while(i!==null);d===null?u=d=t:d=d.next=t}else u=d=t;i={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Ac=!1;function Fo(){if(Ac){var e=Qi;if(e!==null)throw e}}function Qo(e,t,i,o){Ac=!1;var u=e.updateQueue;ja=!1;var d=u.firstBaseUpdate,g=u.lastBaseUpdate,b=u.shared.pending;if(b!==null){u.shared.pending=null;var A=b,L=A.next;A.next=null,g===null?d=L:g.next=L,g=A;var q=e.alternate;q!==null&&(q=q.updateQueue,b=q.lastBaseUpdate,b!==g&&(b===null?q.firstBaseUpdate=L:b.next=L,q.lastBaseUpdate=A))}if(d!==null){var Y=u.baseState;g=0,q=L=A=null,b=d;do{var _=b.lane&-536870913,I=_!==b.lane;if(I?(ze&_)===_:(o&_)===_){_!==0&&_===Fi&&(Ac=!0),q!==null&&(q=q.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ue=e,Se=b;_=t;var Ze=i;switch(Se.tag){case 1:if(ue=Se.payload,typeof ue=="function"){Y=ue.call(Ze,Y,_);break e}Y=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=Se.payload,_=typeof ue=="function"?ue.call(Ze,Y,_):ue,_==null)break e;Y=x({},Y,_);break e;case 2:ja=!0}}_=b.callback,_!==null&&(e.flags|=64,I&&(e.flags|=8192),I=u.callbacks,I===null?u.callbacks=[_]:I.push(_))}else I={lane:_,tag:b.tag,payload:b.payload,callback:b.callback,next:null},q===null?(L=q=I,A=Y):q=q.next=I,g|=_;if(b=b.next,b===null){if(b=u.shared.pending,b===null)break;I=b,b=I.next,I.next=null,u.lastBaseUpdate=I,u.shared.pending=null}}while(!0);q===null&&(A=Y),u.baseState=A,u.firstBaseUpdate=L,u.lastBaseUpdate=q,d===null&&(u.shared.lanes=0),La|=g,e.lanes=g,e.memoizedState=Y}}function kh(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Ah(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)kh(i[e],t)}var Xi=ne(null),cl=ne(0);function Th(e,t){e=fa,F(cl,e),F(Xi,t),fa=e|t.baseLanes}function Tc(){F(cl,fa),F(Xi,Xi.current)}function jc(){fa=cl.current,Ne(Xi),Ne(cl)}var tn=ne(null),bn=null;function Ea(e){var t=e.alternate;F(mt,mt.current&1),F(tn,e),bn===null&&(t===null||Xi.current!==null||t.memoizedState!==null)&&(bn=e)}function Mc(e){F(mt,mt.current),F(tn,e),bn===null&&(bn=e)}function jh(e){e.tag===22?(F(mt,mt.current),F(tn,e),bn===null&&(bn=e)):Oa()}function Oa(){F(mt,mt.current),F(tn,tn.current)}function nn(e){Ne(tn),bn===e&&(bn=null),Ne(mt)}var mt=ne(0);function ul(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Lu(i)||_u(i)))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 ia=0,je=null,$e=null,xt=null,dl=!1,Zi=!1,pi=!1,fl=0,Wo=0,Ji=null,jv=0;function ct(){throw Error(l(321))}function Dc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Jt(e[i],t[i]))return!1;return!0}function Ec(e,t,i,o,u,d){return ia=d,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?dm:Vc,pi=!1,d=i(o,u),pi=!1,Zi&&(d=Dh(t,i,o,u)),Mh(e),d}function Mh(e){R.H=Zo;var t=$e!==null&&$e.next!==null;if(ia=0,xt=$e=je=null,dl=!1,Wo=0,Ji=null,t)throw Error(l(300));e===null||bt||(e=e.dependencies,e!==null&&nl(e)&&(bt=!0))}function Dh(e,t,i,o){je=e;var u=0;do{if(Zi&&(Ji=null),Wo=0,Zi=!1,25<=u)throw Error(l(301));if(u+=1,xt=$e=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}R.H=fm,d=t(i,o)}while(Zi);return d}function Mv(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?$o(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(je.flags|=1024),t}function Oc(){var e=fl!==0;return fl=0,e}function Rc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Pc(e){if(dl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}dl=!1}ia=0,xt=$e=je=null,Zi=!1,Wo=fl=0,Ji=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?je.memoizedState=xt=e:xt=xt.next=e,xt}function pt(){if($e===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=xt===null?je.memoizedState:xt.next;if(t!==null)xt=t,$e=e;else{if(e===null)throw je.alternate===null?Error(l(467)):Error(l(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},xt===null?je.memoizedState=xt=e:xt=xt.next=e}return xt}function hl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $o(e){var t=Wo;return Wo+=1,Ji===null&&(Ji=[]),e=vh(Ji,e,t),t=je,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?dm:Vc),e}function ml(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return $o(e);if(e.$$typeof===B)return Dt(e)}throw Error(l(438,String(e)))}function Lc(e){var t=null,i=je.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var o=je.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=hl(),je.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),o=0;o<e;o++)i[o]=Q;return t.index++,i}function oa(e,t){return typeof t=="function"?t(e):t}function pl(e){var t=pt();return _c(t,$e,e)}function _c(e,t,i){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=i;var u=e.baseQueue,d=o.pending;if(d!==null){if(u!==null){var g=u.next;u.next=d.next,d.next=g}t.baseQueue=u=d,o.pending=null}if(d=e.baseState,u===null)e.memoizedState=d;else{t=u.next;var b=g=null,A=null,L=t,q=!1;do{var Y=L.lane&-536870913;if(Y!==L.lane?(ze&Y)===Y:(ia&Y)===Y){var _=L.revertLane;if(_===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),Y===Fi&&(q=!0);else if((ia&_)===_){L=L.next,_===Fi&&(q=!0);continue}else Y={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},A===null?(b=A=Y,g=d):A=A.next=Y,je.lanes|=_,La|=_;Y=L.action,pi&&i(d,Y),d=L.hasEagerState?L.eagerState:i(d,Y)}else _={lane:Y,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},A===null?(b=A=_,g=d):A=A.next=_,je.lanes|=Y,La|=Y;L=L.next}while(L!==null&&L!==t);if(A===null?g=d:A.next=b,!Jt(d,e.memoizedState)&&(bt=!0,q&&(i=Qi,i!==null)))throw i;e.memoizedState=d,e.baseState=g,e.baseQueue=A,o.lastRenderedState=d}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function zc(e){var t=pt(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var o=i.dispatch,u=i.pending,d=t.memoizedState;if(u!==null){i.pending=null;var g=u=u.next;do d=e(d,g.action),g=g.next;while(g!==u);Jt(d,t.memoizedState)||(bt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),i.lastRenderedState=d}return[d,o]}function Eh(e,t,i){var o=je,u=pt(),d=Ie;if(d){if(i===void 0)throw Error(l(407));i=i()}else i=t();var g=!Jt(($e||u).memoizedState,i);if(g&&(u.memoizedState=i,bt=!0),u=u.queue,Hc(Ph.bind(null,o,u,e),[e]),u.getSnapshot!==t||g||xt!==null&&xt.memoizedState.tag&1){if(o.flags|=2048,eo(9,{destroy:void 0},Rh.bind(null,o,u,i,t),null),Je===null)throw Error(l(349));d||(ia&127)!==0||Oh(o,t,i)}return i}function Oh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=je.updateQueue,t===null?(t=hl(),je.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Rh(e,t,i,o){t.value=i,t.getSnapshot=o,Lh(t)&&_h(e)}function Ph(e,t,i){return i(function(){Lh(t)&&_h(e)})}function Lh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Jt(e,i)}catch{return!0}}function _h(e){var t=si(e,2);t!==null&&Yt(t,e,2)}function Uc(e){var t=zt();if(typeof e=="function"){var i=e;if(e=i(),pi){De(!0);try{i()}finally{De(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:e},t}function zh(e,t,i,o){return e.baseState=i,_c(e,$e,typeof o=="function"?o:oa)}function Dv(e,t,i,o,u){if(xl(e))throw Error(l(485));if(e=t.action,e!==null){var d={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){d.listeners.push(g)}};R.T!==null?i(!0):d.isTransition=!1,o(d),i=t.pending,i===null?(d.next=t.pending=d,Uh(t,d)):(d.next=i.next,t.pending=i.next=d)}}function Uh(e,t){var i=t.action,o=t.payload,u=e.state;if(t.isTransition){var d=R.T,g={};R.T=g;try{var b=i(u,o),A=R.S;A!==null&&A(g,b),Ih(e,t,b)}catch(L){Ic(e,t,L)}finally{d!==null&&g.types!==null&&(d.types=g.types),R.T=d}}else try{d=i(u,o),Ih(e,t,d)}catch(L){Ic(e,t,L)}}function Ih(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(o){Hh(e,t,o)},function(o){return Ic(e,t,o)}):Hh(e,t,i)}function Hh(e,t,i){t.status="fulfilled",t.value=i,Bh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Uh(e,i)))}function Ic(e,t,i){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=i,Bh(t),t=t.next;while(t!==o)}e.action=null}function Bh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kh(e,t){return t}function qh(e,t){if(Ie){var i=Je.formState;if(i!==null){e:{var o=je;if(Ie){if(nt){t:{for(var u=nt,d=xn;u.nodeType!==8;){if(!d){u=null;break t}if(u=vn(u.nextSibling),u===null){u=null;break t}}d=u.data,u=d==="F!"||d==="F"?u:null}if(u){nt=vn(u.nextSibling),o=u.data==="F!";break e}}Aa(o)}o=!1}o&&(t=i[0])}}return i=zt(),i.memoizedState=i.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kh,lastRenderedState:t},i.queue=o,i=rm.bind(null,je,o),o.dispatch=i,o=Uc(!1),d=Yc.bind(null,je,!1,o.queue),o=zt(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,i=Dv.bind(null,je,u,d,i),u.dispatch=i,o.memoizedState=e,[t,i,!1]}function Gh(e){var t=pt();return Yh(t,$e,e)}function Yh(e,t,i){if(t=_c(e,t,Kh)[0],e=pl(oa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=$o(t)}catch(g){throw g===Wi?ol:g}else o=t;t=pt();var u=t.queue,d=u.dispatch;return i!==t.memoizedState&&(je.flags|=2048,eo(9,{destroy:void 0},Ev.bind(null,u,i),null)),[o,d,e]}function Ev(e,t){e.action=t}function Vh(e){var t=pt(),i=$e;if(i!==null)return Yh(t,i,e);pt(),t=t.memoizedState,i=pt();var o=i.queue.dispatch;return i.memoizedState=e,[t,o,!1]}function eo(e,t,i,o){return e={tag:e,create:i,deps:o,inst:t,next:null},t=je.updateQueue,t===null&&(t=hl(),je.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(o=i.next,i.next=e,e.next=o,t.lastEffect=e),e}function Fh(){return pt().memoizedState}function gl(e,t,i,o){var u=zt();je.flags|=e,u.memoizedState=eo(1|t,{destroy:void 0},i,o===void 0?null:o)}function yl(e,t,i,o){var u=pt();o=o===void 0?null:o;var d=u.memoizedState.inst;$e!==null&&o!==null&&Dc(o,$e.memoizedState.deps)?u.memoizedState=eo(t,d,i,o):(je.flags|=e,u.memoizedState=eo(1|t,d,i,o))}function Qh(e,t){gl(8390656,8,e,t)}function Hc(e,t){yl(2048,8,e,t)}function Ov(e){je.flags|=4;var t=je.updateQueue;if(t===null)t=hl(),je.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Wh(e){var t=pt().memoizedState;return Ov({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function $h(e,t){return yl(4,2,e,t)}function Xh(e,t){return yl(4,4,e,t)}function Zh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jh(e,t,i){i=i!=null?i.concat([e]):null,yl(4,4,Zh.bind(null,t,e),i)}function Bc(){}function em(e,t){var i=pt();t=t===void 0?null:t;var o=i.memoizedState;return t!==null&&Dc(t,o[1])?o[0]:(i.memoizedState=[e,t],e)}function tm(e,t){var i=pt();t=t===void 0?null:t;var o=i.memoizedState;if(t!==null&&Dc(t,o[1]))return o[0];if(o=e(),pi){De(!0);try{e()}finally{De(!1)}}return i.memoizedState=[o,t],o}function Kc(e,t,i){return i===void 0||(ia&1073741824)!==0&&(ze&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=np(),je.lanes|=e,La|=e,i)}function nm(e,t,i,o){return Jt(i,t)?i:Xi.current!==null?(e=Kc(e,i,o),Jt(e,t)||(bt=!0),e):(ia&42)===0||(ia&1073741824)!==0&&(ze&261930)===0?(bt=!0,e.memoizedState=i):(e=np(),je.lanes|=e,La|=e,t)}function am(e,t,i,o,u){var d=V.p;V.p=d!==0&&8>d?d:8;var g=R.T,b={};R.T=b,Yc(e,!1,t,i);try{var A=u(),L=R.S;if(L!==null&&L(b,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var q=Tv(A,o);Xo(e,t,q,sn(e))}else Xo(e,t,o,sn(e))}catch(Y){Xo(e,t,{then:function(){},status:"rejected",reason:Y},sn())}finally{V.p=d,g!==null&&b.types!==null&&(g.types=b.types),R.T=g}}function Rv(){}function qc(e,t,i,o){if(e.tag!==5)throw Error(l(476));var u=im(e).queue;am(e,u,t,ie,i===null?Rv:function(){return om(e),i(o)})}function im(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:ie},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function om(e){var t=im(e);t.next===null&&(t=e.alternate.memoizedState),Xo(e,t.next.queue,{},sn())}function Gc(){return Dt(ms)}function sm(){return pt().memoizedState}function lm(){return pt().memoizedState}function Pv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=sn();e=Ma(i);var o=Da(t,e,i);o!==null&&(Yt(o,t,i),Vo(o,t,i)),t={cache:bc()},e.payload=t;return}t=t.return}}function Lv(e,t,i){var o=sn();i={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},xl(e)?cm(t,i):(i=rc(e,t,i,o),i!==null&&(Yt(i,e,o),um(i,t,o)))}function rm(e,t,i){var o=sn();Xo(e,t,i,o)}function Xo(e,t,i,o){var u={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(xl(e))cm(t,u);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var g=t.lastRenderedState,b=d(g,i);if(u.hasEagerState=!0,u.eagerState=b,Jt(b,g))return Zs(e,t,u,0),Je===null&&Xs(),!1}catch{}finally{}if(i=rc(e,t,u,o),i!==null)return Yt(i,e,o),um(i,t,o),!0}return!1}function Yc(e,t,i,o){if(o={lane:2,revertLane:wu(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},xl(e)){if(t)throw Error(l(479))}else t=rc(e,i,o,2),t!==null&&Yt(t,e,2)}function xl(e){var t=e.alternate;return e===je||t!==null&&t===je}function cm(e,t){Zi=dl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function um(e,t,i){if((i&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,i|=o,t.lanes=i,Ao(e,i)}}var Zo={readContext:Dt,use:ml,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};Zo.useEffectEvent=ct;var dm={readContext:Dt,use:ml,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Qh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,gl(4194308,4,Zh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return gl(4194308,4,e,t)},useInsertionEffect:function(e,t){gl(4,2,e,t)},useMemo:function(e,t){var i=zt();t=t===void 0?null:t;var o=e();if(pi){De(!0);try{e()}finally{De(!1)}}return i.memoizedState=[o,t],o},useReducer:function(e,t,i){var o=zt();if(i!==void 0){var u=i(t);if(pi){De(!0);try{i(t)}finally{De(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=Lv.bind(null,je,e),[o.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=Uc(e);var t=e.queue,i=rm.bind(null,je,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Bc,useDeferredValue:function(e,t){var i=zt();return Kc(i,e,t)},useTransition:function(){var e=Uc(!1);return e=am.bind(null,je,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var o=je,u=zt();if(Ie){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),Je===null)throw Error(l(349));(ze&127)!==0||Oh(o,t,i)}u.memoizedState=i;var d={value:i,getSnapshot:t};return u.queue=d,Qh(Ph.bind(null,o,d,e),[e]),o.flags|=2048,eo(9,{destroy:void 0},Rh.bind(null,o,d,i,t),null),i},useId:function(){var e=zt(),t=Je.identifierPrefix;if(Ie){var i=Ln,o=Pn;i=(o&~(1<<32-be(o)-1)).toString(32)+i,t="_"+t+"R_"+i,i=fl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=jv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Gc,useFormState:qh,useActionState:qh,useOptimistic:function(e){var t=zt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Yc.bind(null,je,!0,i),i.dispatch=t,[e,t]},useMemoCache:Lc,useCacheRefresh:function(){return zt().memoizedState=Pv.bind(null,je)},useEffectEvent:function(e){var t=zt(),i={impl:e};return t.memoizedState=i,function(){if((Ve&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Vc={readContext:Dt,use:ml,useCallback:em,useContext:Dt,useEffect:Hc,useImperativeHandle:Jh,useInsertionEffect:$h,useLayoutEffect:Xh,useMemo:tm,useReducer:pl,useRef:Fh,useState:function(){return pl(oa)},useDebugValue:Bc,useDeferredValue:function(e,t){var i=pt();return nm(i,$e.memoizedState,e,t)},useTransition:function(){var e=pl(oa)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:$o(e),t]},useSyncExternalStore:Eh,useId:sm,useHostTransitionStatus:Gc,useFormState:Gh,useActionState:Gh,useOptimistic:function(e,t){var i=pt();return zh(i,$e,e,t)},useMemoCache:Lc,useCacheRefresh:lm};Vc.useEffectEvent=Wh;var fm={readContext:Dt,use:ml,useCallback:em,useContext:Dt,useEffect:Hc,useImperativeHandle:Jh,useInsertionEffect:$h,useLayoutEffect:Xh,useMemo:tm,useReducer:zc,useRef:Fh,useState:function(){return zc(oa)},useDebugValue:Bc,useDeferredValue:function(e,t){var i=pt();return $e===null?Kc(i,e,t):nm(i,$e.memoizedState,e,t)},useTransition:function(){var e=zc(oa)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:$o(e),t]},useSyncExternalStore:Eh,useId:sm,useHostTransitionStatus:Gc,useFormState:Vh,useActionState:Vh,useOptimistic:function(e,t){var i=pt();return $e!==null?zh(i,$e,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Lc,useCacheRefresh:lm};fm.useEffectEvent=Wh;function Fc(e,t,i,o){t=e.memoizedState,i=i(o,t),i=i==null?t:x({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Qc={enqueueSetState:function(e,t,i){e=e._reactInternals;var o=sn(),u=Ma(o);u.payload=t,i!=null&&(u.callback=i),t=Da(e,u,o),t!==null&&(Yt(t,e,o),Vo(t,e,o))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var o=sn(),u=Ma(o);u.tag=1,u.payload=t,i!=null&&(u.callback=i),t=Da(e,u,o),t!==null&&(Yt(t,e,o),Vo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=sn(),o=Ma(i);o.tag=2,t!=null&&(o.callback=t),t=Da(e,o,i),t!==null&&(Yt(t,e,i),Vo(t,e,i))}};function hm(e,t,i,o,u,d,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,d,g):t.prototype&&t.prototype.isPureReactComponent?!Uo(i,o)||!Uo(u,d):!0}function mm(e,t,i,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,o),t.state!==e&&Qc.enqueueReplaceState(t,t.state,null)}function gi(e,t){var i=t;if("ref"in t){i={};for(var o in t)o!=="ref"&&(i[o]=t[o])}if(e=e.defaultProps){i===t&&(i=x({},i));for(var u in e)i[u]===void 0&&(i[u]=e[u])}return i}function pm(e){$s(e)}function gm(e){console.error(e)}function ym(e){$s(e)}function bl(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function xm(e,t,i){try{var o=e.onCaughtError;o(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Wc(e,t,i){return i=Ma(i),i.tag=3,i.payload={element:null},i.callback=function(){bl(e,t)},i}function bm(e){return e=Ma(e),e.tag=3,e}function vm(e,t,i,o){var u=i.type.getDerivedStateFromError;if(typeof u=="function"){var d=o.value;e.payload=function(){return u(d)},e.callback=function(){xm(t,i,o)}}var g=i.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){xm(t,i,o),typeof u!="function"&&(_a===null?_a=new Set([this]):_a.add(this));var b=o.stack;this.componentDidCatch(o.value,{componentStack:b!==null?b:""})})}function _v(e,t,i,o,u){if(i.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=i.alternate,t!==null&&Vi(t,i,u,!0),i=tn.current,i!==null){switch(i.tag){case 31:case 13:return bn===null?El():i.alternate===null&&ut===0&&(ut=3),i.flags&=-257,i.flags|=65536,i.lanes=u,o===sl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([o]):t.add(o),vu(e,o,u)),!1;case 22:return i.flags|=65536,o===sl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([o]):i.add(o)),vu(e,o,u)),!1}throw Error(l(435,i.tag))}return vu(e,o,u),El(),!1}if(Ie)return t=tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==mc&&(e=Error(l(422),{cause:o}),Bo(pn(e,i)))):(o!==mc&&(t=Error(l(423),{cause:o}),Bo(pn(t,i))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=pn(o,i),u=Wc(e.stateNode,o,u),kc(e,u),ut!==4&&(ut=2)),!1;var d=Error(l(520),{cause:o});if(d=pn(d,i),ss===null?ss=[d]:ss.push(d),ut!==4&&(ut=2),t===null)return!0;o=pn(o,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=u&-u,i.lanes|=e,e=Wc(i.stateNode,o,e),kc(i,e),!1;case 1:if(t=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(_a===null||!_a.has(d))))return i.flags|=65536,u&=-u,i.lanes|=u,u=bm(u),vm(u,e,i,o),kc(i,u),!1}i=i.return}while(i!==null);return!1}var $c=Error(l(461)),bt=!1;function Et(e,t,i,o){t.child=e===null?Nh(t,null,i,o):mi(t,e.child,i,o)}function Sm(e,t,i,o,u){i=i.render;var d=t.ref;if("ref"in o){var g={};for(var b in o)b!=="ref"&&(g[b]=o[b])}else g=o;return ui(t),o=Ec(e,t,i,g,d,u),b=Oc(),e!==null&&!bt?(Rc(e,t,u),sa(e,t,u)):(Ie&&b&&fc(t),t.flags|=1,Et(e,t,o,u),t.child)}function Cm(e,t,i,o,u){if(e===null){var d=i.type;return typeof d=="function"&&!cc(d)&&d.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=d,wm(e,t,d,o,u)):(e=el(i.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!iu(e,u)){var g=d.memoizedProps;if(i=i.compare,i=i!==null?i:Uo,i(g,o)&&e.ref===t.ref)return sa(e,t,u)}return t.flags|=1,e=ea(d,o),e.ref=t.ref,e.return=t,t.child=e}function wm(e,t,i,o,u){if(e!==null){var d=e.memoizedProps;if(Uo(d,o)&&e.ref===t.ref)if(bt=!1,t.pendingProps=o=d,iu(e,u))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,sa(e,t,u)}return Xc(e,t,i,o,u)}function Nm(e,t,i,o){var u=o.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|i:i,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~d}else o=0,t.child=null;return km(e,t,d,i,o)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&il(t,d!==null?d.cachePool:null),d!==null?Th(t,d):Tc(),jh(t);else return o=t.lanes=536870912,km(e,t,d!==null?d.baseLanes|i:i,i,o)}else d!==null?(il(t,d.cachePool),Th(t,d),Oa(),t.memoizedState=null):(e!==null&&il(t,null),Tc(),Oa());return Et(e,t,u,i),t.child}function Jo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function km(e,t,i,o,u){var d=Sc();return d=d===null?null:{parent:yt._currentValue,pool:d},t.memoizedState={baseLanes:i,cachePool:d},e!==null&&il(t,null),Tc(),jh(t),e!==null&&Vi(e,t,o,!0),t.childLanes=u,null}function vl(e,t){return t=Cl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Am(e,t,i){return mi(t,e.child,null,i),e=vl(t,t.pendingProps),e.flags|=2,nn(t),t.memoizedState=null,e}function zv(e,t,i){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(o.mode==="hidden")return e=vl(t,o),t.lanes=536870912,Jo(null,e);if(Mc(t),(e=nt)?(e=Up(e,xn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:Pn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},i=ch(e),i.return=t,t.child=i,Mt=t,nt=null)):e=null,e===null)throw Aa(t);return t.lanes=536870912,null}return vl(t,o)}var d=e.memoizedState;if(d!==null){var g=d.dehydrated;if(Mc(t),u)if(t.flags&256)t.flags&=-257,t=Am(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(bt||Vi(e,t,i,!1),u=(i&e.childLanes)!==0,bt||u){if(o=Je,o!==null&&(g=dn(o,i),g!==0&&g!==d.retryLane))throw d.retryLane=g,si(e,g),Yt(o,e,g),$c;El(),t=Am(e,t,i)}else e=d.treeContext,nt=vn(g.nextSibling),Mt=t,Ie=!0,ka=null,xn=!1,e!==null&&fh(t,e),t=vl(t,o),t.flags|=4096;return t}return e=ea(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Sl(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Xc(e,t,i,o,u){return ui(t),i=Ec(e,t,i,o,void 0,u),o=Oc(),e!==null&&!bt?(Rc(e,t,u),sa(e,t,u)):(Ie&&o&&fc(t),t.flags|=1,Et(e,t,i,u),t.child)}function Tm(e,t,i,o,u,d){return ui(t),t.updateQueue=null,i=Dh(t,o,i,u),Mh(e),o=Oc(),e!==null&&!bt?(Rc(e,t,d),sa(e,t,d)):(Ie&&o&&fc(t),t.flags|=1,Et(e,t,i,d),t.child)}function jm(e,t,i,o,u){if(ui(t),t.stateNode===null){var d=Ki,g=i.contextType;typeof g=="object"&&g!==null&&(d=Dt(g)),d=new i(o,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Qc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=o,d.state=t.memoizedState,d.refs={},wc(t),g=i.contextType,d.context=typeof g=="object"&&g!==null?Dt(g):Ki,d.state=t.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(Fc(t,i,g,o),d.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(g=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),g!==d.state&&Qc.enqueueReplaceState(d,d.state,null),Qo(t,o,d,u),Fo(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){d=t.stateNode;var b=t.memoizedProps,A=gi(i,b);d.props=A;var L=d.context,q=i.contextType;g=Ki,typeof q=="object"&&q!==null&&(g=Dt(q));var Y=i.getDerivedStateFromProps;q=typeof Y=="function"||typeof d.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,q||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b||L!==g)&&mm(t,d,o,g),ja=!1;var _=t.memoizedState;d.state=_,Qo(t,o,d,u),Fo(),L=t.memoizedState,b||_!==L||ja?(typeof Y=="function"&&(Fc(t,i,Y,o),L=t.memoizedState),(A=ja||hm(t,i,A,o,_,L,g))?(q||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=L),d.props=o,d.state=L,d.context=g,o=A):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{d=t.stateNode,Nc(e,t),g=t.memoizedProps,q=gi(i,g),d.props=q,Y=t.pendingProps,_=d.context,L=i.contextType,A=Ki,typeof L=="object"&&L!==null&&(A=Dt(L)),b=i.getDerivedStateFromProps,(L=typeof b=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(g!==Y||_!==A)&&mm(t,d,o,A),ja=!1,_=t.memoizedState,d.state=_,Qo(t,o,d,u),Fo();var I=t.memoizedState;g!==Y||_!==I||ja||e!==null&&e.dependencies!==null&&nl(e.dependencies)?(typeof b=="function"&&(Fc(t,i,b,o),I=t.memoizedState),(q=ja||hm(t,i,q,o,_,I,A)||e!==null&&e.dependencies!==null&&nl(e.dependencies))?(L||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,I,A),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,I,A)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=I),d.props=o,d.state=I,d.context=A,o=q):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),o=!1)}return d=o,Sl(e,t),o=(t.flags&128)!==0,d||o?(d=t.stateNode,i=o&&typeof i.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&o?(t.child=mi(t,e.child,null,u),t.child=mi(t,null,i,u)):Et(e,t,i,u),t.memoizedState=d.state,e=t.child):e=sa(e,t,u),e}function Mm(e,t,i,o){return ri(),t.flags|=256,Et(e,t,i,o),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:xh()}}function eu(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=on),e}function Dm(e,t,i){var o=t.pendingProps,u=!1,d=(t.flags&128)!==0,g;if((g=d)||(g=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),g&&(u=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(u?Ea(t):Oa(),(e=nt)?(e=Up(e,xn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:Pn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},i=ch(e),i.return=t,t.child=i,Mt=t,nt=null)):e=null,e===null)throw Aa(t);return _u(e)?t.lanes=32:t.lanes=536870912,null}var b=o.children;return o=o.fallback,u?(Oa(),u=t.mode,b=Cl({mode:"hidden",children:b},u),o=li(o,u,i,null),b.return=t,o.return=t,b.sibling=o,t.child=b,o=t.child,o.memoizedState=Jc(i),o.childLanes=eu(e,g,i),t.memoizedState=Zc,Jo(null,o)):(Ea(t),tu(t,b))}var A=e.memoizedState;if(A!==null&&(b=A.dehydrated,b!==null)){if(d)t.flags&256?(Ea(t),t.flags&=-257,t=nu(e,t,i)):t.memoizedState!==null?(Oa(),t.child=e.child,t.flags|=128,t=null):(Oa(),b=o.fallback,u=t.mode,o=Cl({mode:"visible",children:o.children},u),b=li(b,u,i,null),b.flags|=2,o.return=t,b.return=t,o.sibling=b,t.child=o,mi(t,e.child,null,i),o=t.child,o.memoizedState=Jc(i),o.childLanes=eu(e,g,i),t.memoizedState=Zc,t=Jo(null,o));else if(Ea(t),_u(b)){if(g=b.nextSibling&&b.nextSibling.dataset,g)var L=g.dgst;g=L,o=Error(l(419)),o.stack="",o.digest=g,Bo({value:o,source:null,stack:null}),t=nu(e,t,i)}else if(bt||Vi(e,t,i,!1),g=(i&e.childLanes)!==0,bt||g){if(g=Je,g!==null&&(o=dn(g,i),o!==0&&o!==A.retryLane))throw A.retryLane=o,si(e,o),Yt(g,e,o),$c;Lu(b)||El(),t=nu(e,t,i)}else Lu(b)?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,nt=vn(b.nextSibling),Mt=t,Ie=!0,ka=null,xn=!1,e!==null&&fh(t,e),t=tu(t,o.children),t.flags|=4096);return t}return u?(Oa(),b=o.fallback,u=t.mode,A=e.child,L=A.sibling,o=ea(A,{mode:"hidden",children:o.children}),o.subtreeFlags=A.subtreeFlags&65011712,L!==null?b=ea(L,b):(b=li(b,u,i,null),b.flags|=2),b.return=t,o.return=t,o.sibling=b,t.child=o,Jo(null,o),o=t.child,b=e.child.memoizedState,b===null?b=Jc(i):(u=b.cachePool,u!==null?(A=yt._currentValue,u=u.parent!==A?{parent:A,pool:A}:u):u=xh(),b={baseLanes:b.baseLanes|i,cachePool:u}),o.memoizedState=b,o.childLanes=eu(e,g,i),t.memoizedState=Zc,Jo(e.child,o)):(Ea(t),i=e.child,e=i.sibling,i=ea(i,{mode:"visible",children:o.children}),i.return=t,i.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=i,t.memoizedState=null,i)}function tu(e,t){return t=Cl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Cl(e,t){return e=en(22,e,null,t),e.lanes=0,e}function nu(e,t,i){return mi(t,e.child,null,i),e=tu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Em(e,t,i){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),yc(e.return,t,i)}function au(e,t,i,o,u,d){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:i,tailMode:u,treeForkCount:d}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=o,g.tail=i,g.tailMode=u,g.treeForkCount=d)}function Om(e,t,i){var o=t.pendingProps,u=o.revealOrder,d=o.tail;o=o.children;var g=mt.current,b=(g&2)!==0;if(b?(g=g&1|2,t.flags|=128):g&=1,F(mt,g),Et(e,t,o,i),o=Ie?Ho:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Em(e,i,t);else if(e.tag===19)Em(e,i,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(u){case"forwards":for(i=t.child,u=null;i!==null;)e=i.alternate,e!==null&&ul(e)===null&&(u=i),i=i.sibling;i=u,i===null?(u=t.child,t.child=null):(u=i.sibling,i.sibling=null),au(t,!1,u,i,d,o);break;case"backwards":case"unstable_legacy-backwards":for(i=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&ul(e)===null){t.child=u;break}e=u.sibling,u.sibling=i,i=u,u=e}au(t,!0,i,null,d,o);break;case"together":au(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function sa(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),La|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Vi(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=ea(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ea(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function iu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&nl(e)))}function Uv(e,t,i){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),Ta(t,yt,e.memoizedState.cache),ri();break;case 27:case 5:Ye(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:Ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mc(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Ea(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Dm(e,t,i):(Ea(t),e=sa(e,t,i),e!==null?e.sibling:null);Ea(t);break;case 19:var u=(e.flags&128)!==0;if(o=(i&t.childLanes)!==0,o||(Vi(e,t,i,!1),o=(i&t.childLanes)!==0),u){if(o)return Om(e,t,i);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),F(mt,mt.current),o)break;return null;case 22:return t.lanes=0,Nm(e,t,i,t.pendingProps);case 24:Ta(t,yt,e.memoizedState.cache)}return sa(e,t,i)}function Rm(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!iu(e,i)&&(t.flags&128)===0)return bt=!1,Uv(e,t,i);bt=(e.flags&131072)!==0}else bt=!1,Ie&&(t.flags&1048576)!==0&&dh(t,Ho,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=fi(t.elementType),t.type=e,typeof e=="function")cc(e)?(o=gi(e,o),t.tag=1,t=jm(null,t,e,o,i)):(t.tag=0,t=Xc(null,t,e,o,i));else{if(e!=null){var u=e.$$typeof;if(u===U){t.tag=11,t=Sm(null,t,e,o,i);break e}else if(u===z){t.tag=14,t=Cm(null,t,e,o,i);break e}}throw t=fe(e)||e,Error(l(306,t,""))}}return t;case 0:return Xc(e,t,t.type,t.pendingProps,i);case 1:return o=t.type,u=gi(o,t.pendingProps),jm(e,t,o,u,i);case 3:e:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var d=t.memoizedState;u=d.element,Nc(e,t),Qo(t,o,null,i);var g=t.memoizedState;if(o=g.cache,Ta(t,yt,o),o!==d.cache&&xc(t,[yt],i,!0),Fo(),o=g.element,d.isDehydrated)if(d={element:o,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Mm(e,t,o,i);break e}else if(o!==u){u=pn(Error(l(424)),t),Bo(u),t=Mm(e,t,o,i);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(nt=vn(e.firstChild),Mt=t,Ie=!0,ka=null,xn=!0,i=Nh(t,null,o,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ri(),o===u){t=sa(e,t,i);break e}Et(e,t,o,i)}t=t.child}return t;case 26:return Sl(e,t),e===null?(i=Gp(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ie||(i=t.type,e=t.pendingProps,o=Ul(te.current).createElement(i),o[jt]=t,o[It]=e,Ot(o,i,e),kt(o),t.stateNode=o):t.memoizedState=Gp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ye(t),e===null&&Ie&&(o=t.stateNode=Bp(t.type,t.pendingProps,te.current),Mt=t,xn=!0,u=nt,Ha(t.type)?(zu=u,nt=vn(o.firstChild)):nt=u),Et(e,t,t.pendingProps.children,i),Sl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((u=o=nt)&&(o=m0(o,t.type,t.pendingProps,xn),o!==null?(t.stateNode=o,Mt=t,nt=vn(o.firstChild),xn=!1,u=!0):u=!1),u||Aa(t)),Ye(t),u=t.type,d=t.pendingProps,g=e!==null?e.memoizedProps:null,o=d.children,Ou(u,d)?o=null:g!==null&&Ou(u,g)&&(t.flags|=32),t.memoizedState!==null&&(u=Ec(e,t,Mv,null,null,i),ms._currentValue=u),Sl(e,t),Et(e,t,o,i),t.child;case 6:return e===null&&Ie&&((e=i=nt)&&(i=p0(i,t.pendingProps,xn),i!==null?(t.stateNode=i,Mt=t,nt=null,e=!0):e=!1),e||Aa(t)),null;case 13:return Dm(e,t,i);case 4:return xe(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=mi(t,null,o,i):Et(e,t,o,i),t.child;case 11:return Sm(e,t,t.type,t.pendingProps,i);case 7:return Et(e,t,t.pendingProps,i),t.child;case 8:return Et(e,t,t.pendingProps.children,i),t.child;case 12:return Et(e,t,t.pendingProps.children,i),t.child;case 10:return o=t.pendingProps,Ta(t,t.type,o.value),Et(e,t,o.children,i),t.child;case 9:return u=t.type._context,o=t.pendingProps.children,ui(t),u=Dt(u),o=o(u),t.flags|=1,Et(e,t,o,i),t.child;case 14:return Cm(e,t,t.type,t.pendingProps,i);case 15:return wm(e,t,t.type,t.pendingProps,i);case 19:return Om(e,t,i);case 31:return zv(e,t,i);case 22:return Nm(e,t,i,t.pendingProps);case 24:return ui(t),o=Dt(yt),e===null?(u=Sc(),u===null&&(u=Je,d=bc(),u.pooledCache=d,d.refCount++,d!==null&&(u.pooledCacheLanes|=i),u=d),t.memoizedState={parent:o,cache:u},wc(t),Ta(t,yt,u)):((e.lanes&i)!==0&&(Nc(e,t),Qo(t,null,null,i),Fo()),u=e.memoizedState,d=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Ta(t,yt,o)):(o=d.cache,Ta(t,yt,o),o!==u.cache&&xc(t,[yt],i,!0))),Et(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function la(e){e.flags|=4}function ou(e,t,i,o,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(sp())e.flags|=8192;else throw hi=sl,Cc}else e.flags&=-16777217}function Pm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wp(t))if(sp())e.flags|=8192;else throw hi=sl,Cc}function wl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Nt():536870912,e.lanes|=t,io|=t)}function es(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,o=0;if(t)for(var u=e.child;u!==null;)i|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)i|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=i,t}function Iv(e,t,i){var o=t.pendingProps;switch(hc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return at(t),null;case 3:return i=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),aa(yt),Pe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Yi(t)?la(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,pc())),at(t),null;case 26:var u=t.type,d=t.memoizedState;return e===null?(la(t),d!==null?(at(t),Pm(t,d)):(at(t),ou(t,u,null,o,i))):d?d!==e.memoizedState?(la(t),at(t),Pm(t,d)):(at(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&la(t),at(t),ou(t,u,e,o,i)),null;case 27:if(St(t),i=te.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&la(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return at(t),null}e=J.current,Yi(t)?hh(t):(e=Bp(u,o,i),t.stateNode=e,la(t))}return at(t),null;case 5:if(St(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&la(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return at(t),null}if(d=J.current,Yi(t))hh(t);else{var g=Ul(te.current);switch(d){case 1:d=g.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:d=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":d=g.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":d=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":d=g.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?g.createElement("select",{is:o.is}):g.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?g.createElement(u,{is:o.is}):g.createElement(u)}}d[jt]=t,d[It]=o;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)d.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=d;e:switch(Ot(d,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&la(t)}}return at(t),ou(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&la(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=te.current,Yi(t)){if(e=t.stateNode,i=t.memoizedProps,o=null,u=Mt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[jt]=t,e=!!(e.nodeValue===i||o!==null&&o.suppressHydrationWarning===!0||Dp(e.nodeValue,i)),e||Aa(t,!0)}else e=Ul(e).createTextNode(o),e[jt]=t,t.stateNode=e}return at(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(o=Yi(t),i!==null){if(e===null){if(!o)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[jt]=t}else ri(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),e=!1}else i=pc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(nn(t),t):(nn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return at(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Yi(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[jt]=t}else ri(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),u=!1}else u=pc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(nn(t),t):(nn(t),null)}return nn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=o!==null,e=e!==null&&e.memoizedState!==null,i&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==u&&(o.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),wl(t,t.updateQueue),at(t),null);case 4:return Pe(),e===null&&Tu(t.stateNode.containerInfo),at(t),null;case 10:return aa(t.type),at(t),null;case 19:if(Ne(mt),o=t.memoizedState,o===null)return at(t),null;if(u=(t.flags&128)!==0,d=o.rendering,d===null)if(u)es(o,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=ul(e),d!==null){for(t.flags|=128,es(o,!1),e=d.updateQueue,t.updateQueue=e,wl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)rh(i,e),i=i.sibling;return F(mt,mt.current&1|2),Ie&&ta(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&ht()>jl&&(t.flags|=128,u=!0,es(o,!1),t.lanes=4194304)}else{if(!u)if(e=ul(d),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,wl(t,e),es(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Ie)return at(t),null}else 2*ht()-o.renderingStartTime>jl&&i!==536870912&&(t.flags|=128,u=!0,es(o,!1),t.lanes=4194304);o.isBackwards?(d.sibling=t.child,t.child=d):(e=o.last,e!==null?e.sibling=d:t.child=d,o.last=d)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=ht(),e.sibling=null,i=mt.current,F(mt,u?i&1|2:i&1),Ie&&ta(t,o.treeForkCount),e):(at(t),null);case 22:case 23:return nn(t),jc(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(i&536870912)!==0&&(t.flags&128)===0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),i=t.updateQueue,i!==null&&wl(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==i&&(t.flags|=2048),e!==null&&Ne(di),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),aa(yt),at(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Hv(e,t){switch(hc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(yt),Pe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return St(t),null;case 31:if(t.memoizedState!==null){if(nn(t),t.alternate===null)throw Error(l(340));ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(nn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(mt),null;case 4:return Pe(),null;case 10:return aa(t.type),null;case 22:case 23:return nn(t),jc(),e!==null&&Ne(di),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return aa(yt),null;case 25:return null;default:return null}}function Lm(e,t){switch(hc(t),t.tag){case 3:aa(yt),Pe();break;case 26:case 27:case 5:St(t);break;case 4:Pe();break;case 31:t.memoizedState!==null&&nn(t);break;case 13:nn(t);break;case 19:Ne(mt);break;case 10:aa(t.type);break;case 22:case 23:nn(t),jc(),e!==null&&Ne(di);break;case 24:aa(yt)}}function ts(e,t){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var u=o.next;i=u;do{if((i.tag&e)===e){o=void 0;var d=i.create,g=i.inst;o=d(),g.destroy=o}i=i.next}while(i!==u)}}catch(b){We(t,t.return,b)}}function Ra(e,t,i){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var d=u.next;o=d;do{if((o.tag&e)===e){var g=o.inst,b=g.destroy;if(b!==void 0){g.destroy=void 0,u=t;var A=i,L=b;try{L()}catch(q){We(u,A,q)}}}o=o.next}while(o!==d)}}catch(q){We(t,t.return,q)}}function _m(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Ah(t,i)}catch(o){We(e,e.return,o)}}}function zm(e,t,i){i.props=gi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(o){We(e,t,o)}}function ns(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof i=="function"?e.refCleanup=i(o):i.current=o}}catch(u){We(e,t,u)}}function _n(e,t){var i=e.ref,o=e.refCleanup;if(i!==null)if(typeof o=="function")try{o()}catch(u){We(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(u){We(e,t,u)}else i.current=null}function Um(e){var t=e.type,i=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&o.focus();break e;case"img":i.src?o.src=i.src:i.srcSet&&(o.srcset=i.srcSet)}}catch(u){We(e,e.return,u)}}function su(e,t,i){try{var o=e.stateNode;r0(o,e.type,i,t),o[It]=t}catch(u){We(e,e.return,u)}}function Im(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ha(e.type)||e.tag===4}function lu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Im(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&&Ha(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 ru(e,t,i){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Zn));else if(o!==4&&(o===27&&Ha(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(ru(e,t,i),e=e.sibling;e!==null;)ru(e,t,i),e=e.sibling}function Nl(e,t,i){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(o!==4&&(o===27&&Ha(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Nl(e,t,i),e=e.sibling;e!==null;)Nl(e,t,i),e=e.sibling}function Hm(e){var t=e.stateNode,i=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Ot(t,o,i),t[jt]=e,t[It]=i}catch(d){We(e,e.return,d)}}var ra=!1,vt=!1,cu=!1,Bm=typeof WeakSet=="function"?WeakSet:Set,At=null;function Bv(e,t){if(e=e.containerInfo,Du=Yl,e=Jf(e),nc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var o=i.getSelection&&i.getSelection();if(o&&o.rangeCount!==0){i=o.anchorNode;var u=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var g=0,b=-1,A=-1,L=0,q=0,Y=e,_=null;t:for(;;){for(var I;Y!==i||u!==0&&Y.nodeType!==3||(b=g+u),Y!==d||o!==0&&Y.nodeType!==3||(A=g+o),Y.nodeType===3&&(g+=Y.nodeValue.length),(I=Y.firstChild)!==null;)_=Y,Y=I;for(;;){if(Y===e)break t;if(_===i&&++L===u&&(b=g),_===d&&++q===o&&(A=g),(I=Y.nextSibling)!==null)break;Y=_,_=Y.parentNode}Y=I}i=b===-1||A===-1?null:{start:b,end:A}}else i=null}i=i||{start:0,end:0}}else i=null;for(Eu={focusedElem:e,selectionRange:i},Yl=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,d=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(i=0;i<e.length;i++)u=e[i],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,i=t,u=d.memoizedProps,d=d.memoizedState,o=i.stateNode;try{var ue=gi(i.type,u);e=o.getSnapshotBeforeUpdate(ue,d),o.__reactInternalSnapshotBeforeUpdate=e}catch(Se){We(i,i.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Pu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Pu(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}}function Km(e,t,i){var o=i.flags;switch(i.tag){case 0:case 11:case 15:ua(e,i),o&4&&ts(5,i);break;case 1:if(ua(e,i),o&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(g){We(i,i.return,g)}else{var u=gi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){We(i,i.return,g)}}o&64&&_m(i),o&512&&ns(i,i.return);break;case 3:if(ua(e,i),o&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Ah(e,t)}catch(g){We(i,i.return,g)}}break;case 27:t===null&&o&4&&Hm(i);case 26:case 5:ua(e,i),t===null&&o&4&&Um(i),o&512&&ns(i,i.return);break;case 12:ua(e,i);break;case 31:ua(e,i),o&4&&Ym(e,i);break;case 13:ua(e,i),o&4&&Vm(e,i),o&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=$v.bind(null,i),g0(e,i))));break;case 22:if(o=i.memoizedState!==null||ra,!o){t=t!==null&&t.memoizedState!==null||vt,u=ra;var d=vt;ra=o,(vt=t)&&!d?da(e,i,(i.subtreeFlags&8772)!==0):ua(e,i),ra=u,vt=d}break;case 30:break;default:ua(e,i)}}function qm(e){var t=e.alternate;t!==null&&(e.alternate=null,qm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ir(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 lt=null,Bt=!1;function ca(e,t,i){for(i=i.child;i!==null;)Gm(e,t,i),i=i.sibling}function Gm(e,t,i){if(Z&&typeof Z.onCommitFiberUnmount=="function")try{Z.onCommitFiberUnmount(Qn,i)}catch{}switch(i.tag){case 26:vt||_n(i,t),ca(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:vt||_n(i,t);var o=lt,u=Bt;Ha(i.type)&&(lt=i.stateNode,Bt=!1),ca(e,t,i),ds(i.stateNode),lt=o,Bt=u;break;case 5:vt||_n(i,t);case 6:if(o=lt,u=Bt,lt=null,ca(e,t,i),lt=o,Bt=u,lt!==null)if(Bt)try{(lt.nodeType===9?lt.body:lt.nodeName==="HTML"?lt.ownerDocument.body:lt).removeChild(i.stateNode)}catch(d){We(i,t,d)}else try{lt.removeChild(i.stateNode)}catch(d){We(i,t,d)}break;case 18:lt!==null&&(Bt?(e=lt,_p(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),ho(e)):_p(lt,i.stateNode));break;case 4:o=lt,u=Bt,lt=i.stateNode.containerInfo,Bt=!0,ca(e,t,i),lt=o,Bt=u;break;case 0:case 11:case 14:case 15:Ra(2,i,t),vt||Ra(4,i,t),ca(e,t,i);break;case 1:vt||(_n(i,t),o=i.stateNode,typeof o.componentWillUnmount=="function"&&zm(i,t,o)),ca(e,t,i);break;case 21:ca(e,t,i);break;case 22:vt=(o=vt)||i.memoizedState!==null,ca(e,t,i),vt=o;break;default:ca(e,t,i)}}function Ym(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ho(e)}catch(i){We(t,t.return,i)}}}function Vm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ho(e)}catch(i){We(t,t.return,i)}}function Kv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Bm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Bm),t;default:throw Error(l(435,e.tag))}}function kl(e,t){var i=Kv(e);t.forEach(function(o){if(!i.has(o)){i.add(o);var u=Xv.bind(null,e,o);o.then(u,u)}})}function Kt(e,t){var i=t.deletions;if(i!==null)for(var o=0;o<i.length;o++){var u=i[o],d=e,g=t,b=g;e:for(;b!==null;){switch(b.tag){case 27:if(Ha(b.type)){lt=b.stateNode,Bt=!1;break e}break;case 5:lt=b.stateNode,Bt=!1;break e;case 3:case 4:lt=b.stateNode.containerInfo,Bt=!0;break e}b=b.return}if(lt===null)throw Error(l(160));Gm(d,g,u),lt=null,Bt=!1,d=u.alternate,d!==null&&(d.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fm(t,e),t=t.sibling}var kn=null;function Fm(e,t){var i=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Kt(t,e),qt(e),o&4&&(Ra(3,e,e.return),ts(3,e),Ra(5,e,e.return));break;case 1:Kt(t,e),qt(e),o&512&&(vt||i===null||_n(i,i.return)),o&64&&ra&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?o:i.concat(o))));break;case 26:var u=kn;if(Kt(t,e),qt(e),o&512&&(vt||i===null||_n(i,i.return)),o&4){var d=i!==null?i.memoizedState:null;if(o=e.memoizedState,i===null)if(o===null)if(e.stateNode===null){e:{o=e.type,i=e.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":d=u.getElementsByTagName("title")[0],(!d||d[Mo]||d[jt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=u.createElement(o),u.head.insertBefore(d,u.querySelector("head > title"))),Ot(d,o,i),d[jt]=e,kt(d),o=d;break e;case"link":var g=Fp("link","href",u).get(o+(i.href||""));if(g){for(var b=0;b<g.length;b++)if(d=g[b],d.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&d.getAttribute("rel")===(i.rel==null?null:i.rel)&&d.getAttribute("title")===(i.title==null?null:i.title)&&d.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){g.splice(b,1);break t}}d=u.createElement(o),Ot(d,o,i),u.head.appendChild(d);break;case"meta":if(g=Fp("meta","content",u).get(o+(i.content||""))){for(b=0;b<g.length;b++)if(d=g[b],d.getAttribute("content")===(i.content==null?null:""+i.content)&&d.getAttribute("name")===(i.name==null?null:i.name)&&d.getAttribute("property")===(i.property==null?null:i.property)&&d.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&d.getAttribute("charset")===(i.charSet==null?null:i.charSet)){g.splice(b,1);break t}}d=u.createElement(o),Ot(d,o,i),u.head.appendChild(d);break;default:throw Error(l(468,o))}d[jt]=e,kt(d),o=d}e.stateNode=o}else Qp(u,e.type,e.stateNode);else e.stateNode=Vp(u,o,e.memoizedProps);else d!==o?(d===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):d.count--,o===null?Qp(u,e.type,e.stateNode):Vp(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&su(e,e.memoizedProps,i.memoizedProps)}break;case 27:Kt(t,e),qt(e),o&512&&(vt||i===null||_n(i,i.return)),i!==null&&o&4&&su(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Kt(t,e),qt(e),o&512&&(vt||i===null||_n(i,i.return)),e.flags&32){u=e.stateNode;try{Li(u,"")}catch(ue){We(e,e.return,ue)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,su(e,u,i!==null?i.memoizedProps:u)),o&1024&&(cu=!0);break;case 6:if(Kt(t,e),qt(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,i=e.stateNode;try{i.nodeValue=o}catch(ue){We(e,e.return,ue)}}break;case 3:if(Bl=null,u=kn,kn=Il(t.containerInfo),Kt(t,e),kn=u,qt(e),o&4&&i!==null&&i.memoizedState.isDehydrated)try{ho(t.containerInfo)}catch(ue){We(e,e.return,ue)}cu&&(cu=!1,Qm(e));break;case 4:o=kn,kn=Il(e.stateNode.containerInfo),Kt(t,e),qt(e),kn=o;break;case 12:Kt(t,e),qt(e);break;case 31:Kt(t,e),qt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,kl(e,o)));break;case 13:Kt(t,e),qt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Tl=ht()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,kl(e,o)));break;case 22:u=e.memoizedState!==null;var A=i!==null&&i.memoizedState!==null,L=ra,q=vt;if(ra=L||u,vt=q||A,Kt(t,e),vt=q,ra=L,qt(e),o&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(i===null||A||ra||vt||yi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){A=i=t;try{if(d=A.stateNode,u)g=d.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{b=A.stateNode;var Y=A.memoizedProps.style,_=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;b.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ue){We(A,A.return,ue)}}}else if(t.tag===6){if(i===null){A=t;try{A.stateNode.nodeValue=u?"":A.memoizedProps}catch(ue){We(A,A.return,ue)}}}else if(t.tag===18){if(i===null){A=t;try{var I=A.stateNode;u?zp(I,!0):zp(A.stateNode,!1)}catch(ue){We(A,A.return,ue)}}}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;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(i=o.retryQueue,i!==null&&(o.retryQueue=null,kl(e,i))));break;case 19:Kt(t,e),qt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,kl(e,o)));break;case 30:break;case 21:break;default:Kt(t,e),qt(e)}}function qt(e){var t=e.flags;if(t&2){try{for(var i,o=e.return;o!==null;){if(Im(o)){i=o;break}o=o.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var u=i.stateNode,d=lu(e);Nl(e,d,u);break;case 5:var g=i.stateNode;i.flags&32&&(Li(g,""),i.flags&=-33);var b=lu(e);Nl(e,b,g);break;case 3:case 4:var A=i.stateNode.containerInfo,L=lu(e);ru(e,L,A);break;default:throw Error(l(161))}}catch(q){We(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Qm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ua(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Km(e,t.alternate,t),t=t.sibling}function yi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ra(4,t,t.return),yi(t);break;case 1:_n(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&zm(t,t.return,i),yi(t);break;case 27:ds(t.stateNode);case 26:case 5:_n(t,t.return),yi(t);break;case 22:t.memoizedState===null&&yi(t);break;case 30:yi(t);break;default:yi(t)}e=e.sibling}}function da(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,u=e,d=t,g=d.flags;switch(d.tag){case 0:case 11:case 15:da(u,d,i),ts(4,d);break;case 1:if(da(u,d,i),o=d,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(L){We(o,o.return,L)}if(o=d,u=o.updateQueue,u!==null){var b=o.stateNode;try{var A=u.shared.hiddenCallbacks;if(A!==null)for(u.shared.hiddenCallbacks=null,u=0;u<A.length;u++)kh(A[u],b)}catch(L){We(o,o.return,L)}}i&&g&64&&_m(d),ns(d,d.return);break;case 27:Hm(d);case 26:case 5:da(u,d,i),i&&o===null&&g&4&&Um(d),ns(d,d.return);break;case 12:da(u,d,i);break;case 31:da(u,d,i),i&&g&4&&Ym(u,d);break;case 13:da(u,d,i),i&&g&4&&Vm(u,d);break;case 22:d.memoizedState===null&&da(u,d,i),ns(d,d.return);break;case 30:break;default:da(u,d,i)}t=t.sibling}}function uu(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Ko(i))}function du(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ko(e))}function An(e,t,i,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wm(e,t,i,o),t=t.sibling}function Wm(e,t,i,o){var u=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,i,o),u&2048&&ts(9,t);break;case 1:An(e,t,i,o);break;case 3:An(e,t,i,o),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ko(e)));break;case 12:if(u&2048){An(e,t,i,o),e=t.stateNode;try{var d=t.memoizedProps,g=d.id,b=d.onPostCommit;typeof b=="function"&&b(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){We(t,t.return,A)}}else An(e,t,i,o);break;case 31:An(e,t,i,o);break;case 13:An(e,t,i,o);break;case 23:break;case 22:d=t.stateNode,g=t.alternate,t.memoizedState!==null?d._visibility&2?An(e,t,i,o):as(e,t):d._visibility&2?An(e,t,i,o):(d._visibility|=2,to(e,t,i,o,(t.subtreeFlags&10256)!==0||!1)),u&2048&&uu(g,t);break;case 24:An(e,t,i,o),u&2048&&du(t.alternate,t);break;default:An(e,t,i,o)}}function to(e,t,i,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,g=t,b=i,A=o,L=g.flags;switch(g.tag){case 0:case 11:case 15:to(d,g,b,A,u),ts(8,g);break;case 23:break;case 22:var q=g.stateNode;g.memoizedState!==null?q._visibility&2?to(d,g,b,A,u):as(d,g):(q._visibility|=2,to(d,g,b,A,u)),u&&L&2048&&uu(g.alternate,g);break;case 24:to(d,g,b,A,u),u&&L&2048&&du(g.alternate,g);break;default:to(d,g,b,A,u)}t=t.sibling}}function as(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,o=t,u=o.flags;switch(o.tag){case 22:as(i,o),u&2048&&uu(o.alternate,o);break;case 24:as(i,o),u&2048&&du(o.alternate,o);break;default:as(i,o)}t=t.sibling}}var is=8192;function no(e,t,i){if(e.subtreeFlags&is)for(e=e.child;e!==null;)$m(e,t,i),e=e.sibling}function $m(e,t,i){switch(e.tag){case 26:no(e,t,i),e.flags&is&&e.memoizedState!==null&&j0(i,kn,e.memoizedState,e.memoizedProps);break;case 5:no(e,t,i);break;case 3:case 4:var o=kn;kn=Il(e.stateNode.containerInfo),no(e,t,i),kn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=is,is=16777216,no(e,t,i),is=o):no(e,t,i));break;default:no(e,t,i)}}function Xm(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 os(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var o=t[i];At=o,Jm(o,e)}Xm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zm(e),e=e.sibling}function Zm(e){switch(e.tag){case 0:case 11:case 15:os(e),e.flags&2048&&Ra(9,e,e.return);break;case 3:os(e);break;case 12:os(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):os(e);break;default:os(e)}}function Al(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var o=t[i];At=o,Jm(o,e)}Xm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ra(8,t,t.return),Al(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function Jm(e,t){for(;At!==null;){var i=At;switch(i.tag){case 0:case 11:case 15:Ra(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var o=i.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Ko(i.memoizedState.cache)}if(o=i.child,o!==null)o.return=i,At=o;else e:for(i=e;At!==null;){o=At;var u=o.sibling,d=o.return;if(qm(o),o===i){At=null;break e}if(u!==null){u.return=d,At=u;break e}At=d}}}var qv={getCacheForType:function(e){var t=Dt(yt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Dt(yt).controller.signal}},Gv=typeof WeakMap=="function"?WeakMap:Map,Ve=0,Je=null,Le=null,ze=0,Qe=0,an=null,Pa=!1,ao=!1,fu=!1,fa=0,ut=0,La=0,xi=0,hu=0,on=0,io=0,ss=null,Gt=null,mu=!1,Tl=0,ep=0,jl=1/0,Ml=null,_a=null,wt=0,za=null,oo=null,ha=0,pu=0,gu=null,tp=null,ls=0,yu=null;function sn(){return(Ve&2)!==0&&ze!==0?ze&-ze:R.T!==null?wu():To()}function np(){if(on===0)if((ze&536870912)===0||Ie){var e=ve;ve<<=1,(ve&3932160)===0&&(ve=262144),on=e}else on=536870912;return e=tn.current,e!==null&&(e.flags|=32),on}function Yt(e,t,i){(e===Je&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(so(e,0),Ua(e,ze,on,!1)),wn(e,i),((Ve&2)===0||e!==Je)&&(e===Je&&((Ve&2)===0&&(xi|=i),ut===4&&Ua(e,ze,on,!1)),zn(e))}function ap(e,t,i){if((Ve&6)!==0)throw Error(l(327));var o=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Pt(e,t),u=o?Fv(e,t):bu(e,t,!0),d=o;do{if(u===0){ao&&!o&&Ua(e,t,0,!1);break}else{if(i=e.current.alternate,d&&!Yv(i)){u=bu(e,t,!1),d=!1;continue}if(u===2){if(d=t,e.errorRecoveryDisabledLanes&d)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var b=e;u=ss;var A=b.current.memoizedState.isDehydrated;if(A&&(so(b,g).flags|=256),g=bu(b,g,!1),g!==2){if(fu&&!A){b.errorRecoveryDisabledLanes|=d,xi|=d,u=4;break e}d=Gt,Gt=u,d!==null&&(Gt===null?Gt=d:Gt.push.apply(Gt,d))}u=g}if(d=!1,u!==2)continue}}if(u===1){so(e,0),Ua(e,t,0,!0);break}e:{switch(o=e,d=u,d){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Ua(o,t,on,!Pa);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(u=Tl+300-ht(),10<u)){if(Ua(o,t,on,!Pa),we(o,0,!0)!==0)break e;ha=t,o.timeoutHandle=Pp(ip.bind(null,o,i,Gt,Ml,mu,t,on,xi,io,Pa,d,"Throttled",-0,0),u);break e}ip(o,i,Gt,Ml,mu,t,on,xi,io,Pa,d,null,-0,0)}}break}while(!0);zn(e)}function ip(e,t,i,o,u,d,g,b,A,L,q,Y,_,I){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zn},$m(t,d,Y);var ue=(d&62914560)===d?Tl-ht():(d&4194048)===d?ep-ht():0;if(ue=M0(Y,ue),ue!==null){ha=d,e.cancelPendingCommit=ue(fp.bind(null,e,t,d,i,o,u,g,b,A,q,Y,null,_,I)),Ua(e,d,g,!L);return}}fp(e,t,d,i,o,u,g,b,A)}function Yv(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var o=0;o<i.length;o++){var u=i[o],d=u.getSnapshot;u=u.value;try{if(!Jt(d(),u))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 Ua(e,t,i,o){t&=~hu,t&=~xi,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var d=31-be(u),g=1<<d;o[d]=-1,u&=~g}i!==0&&ti(e,i,t)}function Dl(){return(Ve&6)===0?(rs(0),!1):!0}function xu(){if(Le!==null){if(Qe===0)var e=Le.return;else e=Le,na=ci=null,Pc(e),$i=null,Go=0,e=Le;for(;e!==null;)Lm(e.alternate,e),e=e.return;Le=null}}function so(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,d0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ha=0,xu(),Je=e,Le=i=ea(e.current,null),ze=t,Qe=0,an=null,Pa=!1,ao=Pt(e,t),fu=!1,io=on=hu=xi=La=ut=0,Gt=ss=null,mu=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var u=31-be(o),d=1<<u;t|=e[u],o&=~d}return fa=t,Xs(),i}function op(e,t){je=null,R.H=Zo,t===Wi||t===ol?(t=Sh(),Qe=3):t===Cc?(t=Sh(),Qe=4):Qe=t===$c?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,an=t,Le===null&&(ut=1,bl(e,pn(t,e.current)))}function sp(){var e=tn.current;return e===null?!0:(ze&4194048)===ze?bn===null:(ze&62914560)===ze||(ze&536870912)!==0?e===bn:!1}function lp(){var e=R.H;return R.H=Zo,e===null?Zo:e}function rp(){var e=R.A;return R.A=qv,e}function El(){ut=4,Pa||(ze&4194048)!==ze&&tn.current!==null||(ao=!0),(La&134217727)===0&&(xi&134217727)===0||Je===null||Ua(Je,ze,on,!1)}function bu(e,t,i){var o=Ve;Ve|=2;var u=lp(),d=rp();(Je!==e||ze!==t)&&(Ml=null,so(e,t)),t=!1;var g=ut;e:do try{if(Qe!==0&&Le!==null){var b=Le,A=an;switch(Qe){case 8:xu(),g=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(t=!0);var L=Qe;if(Qe=0,an=null,lo(e,b,A,L),i&&ao){g=0;break e}break;default:L=Qe,Qe=0,an=null,lo(e,b,A,L)}}Vv(),g=ut;break}catch(q){op(e,q)}while(!0);return t&&e.shellSuspendCounter++,na=ci=null,Ve=o,R.H=u,R.A=d,Le===null&&(Je=null,ze=0,Xs()),g}function Vv(){for(;Le!==null;)cp(Le)}function Fv(e,t){var i=Ve;Ve|=2;var o=lp(),u=rp();Je!==e||ze!==t?(Ml=null,jl=ht()+500,so(e,t)):ao=Pt(e,t);e:do try{if(Qe!==0&&Le!==null){t=Le;var d=an;t:switch(Qe){case 1:Qe=0,an=null,lo(e,t,d,1);break;case 2:case 9:if(bh(d)){Qe=0,an=null,up(t);break}t=function(){Qe!==2&&Qe!==9||Je!==e||(Qe=7),zn(e)},d.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:bh(d)?(Qe=0,an=null,up(t)):(Qe=0,an=null,lo(e,t,d,7));break;case 5:var g=null;switch(Le.tag){case 26:g=Le.memoizedState;case 5:case 27:var b=Le;if(g?Wp(g):b.stateNode.complete){Qe=0,an=null;var A=b.sibling;if(A!==null)Le=A;else{var L=b.return;L!==null?(Le=L,Ol(L)):Le=null}break t}}Qe=0,an=null,lo(e,t,d,5);break;case 6:Qe=0,an=null,lo(e,t,d,6);break;case 8:xu(),ut=6;break e;default:throw Error(l(462))}}Qv();break}catch(q){op(e,q)}while(!0);return na=ci=null,R.H=o,R.A=u,Ve=i,Le!==null?0:(Je=null,ze=0,Xs(),ut)}function Qv(){for(;Le!==null&&!Sa();)cp(Le)}function cp(e){var t=Rm(e.alternate,e,fa);e.memoizedProps=e.pendingProps,t===null?Ol(e):Le=t}function up(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Tm(i,t,t.pendingProps,t.type,void 0,ze);break;case 11:t=Tm(i,t,t.pendingProps,t.type.render,t.ref,ze);break;case 5:Pc(t);default:Lm(i,t),t=Le=rh(t,fa),t=Rm(i,t,fa)}e.memoizedProps=e.pendingProps,t===null?Ol(e):Le=t}function lo(e,t,i,o){na=ci=null,Pc(t),$i=null,Go=0;var u=t.return;try{if(_v(e,u,t,i,ze)){ut=1,bl(e,pn(i,e.current)),Le=null;return}}catch(d){if(u!==null)throw Le=u,d;ut=1,bl(e,pn(i,e.current)),Le=null;return}t.flags&32768?(Ie||o===1?e=!0:ao||(ze&536870912)!==0?e=!1:(Pa=e=!0,(o===2||o===9||o===3||o===6)&&(o=tn.current,o!==null&&o.tag===13&&(o.flags|=16384))),dp(t,e)):Ol(t)}function Ol(e){var t=e;do{if((t.flags&32768)!==0){dp(t,Pa);return}e=t.return;var i=Iv(t.alternate,t,fa);if(i!==null){Le=i;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);ut===0&&(ut=5)}function dp(e,t){do{var i=Hv(e.alternate,e);if(i!==null){i.flags&=32767,Le=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=i}while(e!==null);ut=6,Le=null}function fp(e,t,i,o,u,d,g,b,A){e.cancelPendingCommit=null;do Rl();while(wt!==0);if((Ve&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(d=t.lanes|t.childLanes,d|=lc,ko(e,i,d,g,b,A),e===Je&&(Le=Je=null,ze=0),oo=t,za=e,ha=i,pu=d,gu=u,tp=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Zv(On,function(){return yp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=R.T,R.T=null,u=V.p,V.p=2,g=Ve,Ve|=4;try{Bv(e,t,i)}finally{Ve=g,V.p=u,R.T=o}}wt=1,hp(),mp(),pp()}}function hp(){if(wt===1){wt=0;var e=za,t=oo,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=R.T,R.T=null;var o=V.p;V.p=2;var u=Ve;Ve|=4;try{Fm(t,e);var d=Eu,g=Jf(e.containerInfo),b=d.focusedElem,A=d.selectionRange;if(g!==b&&b&&b.ownerDocument&&Zf(b.ownerDocument.documentElement,b)){if(A!==null&&nc(b)){var L=A.start,q=A.end;if(q===void 0&&(q=L),"selectionStart"in b)b.selectionStart=L,b.selectionEnd=Math.min(q,b.value.length);else{var Y=b.ownerDocument||document,_=Y&&Y.defaultView||window;if(_.getSelection){var I=_.getSelection(),ue=b.textContent.length,Se=Math.min(A.start,ue),Ze=A.end===void 0?Se:Math.min(A.end,ue);!I.extend&&Se>Ze&&(g=Ze,Ze=Se,Se=g);var D=Xf(b,Se),T=Xf(b,Ze);if(D&&T&&(I.rangeCount!==1||I.anchorNode!==D.node||I.anchorOffset!==D.offset||I.focusNode!==T.node||I.focusOffset!==T.offset)){var P=Y.createRange();P.setStart(D.node,D.offset),I.removeAllRanges(),Se>Ze?(I.addRange(P),I.extend(T.node,T.offset)):(P.setEnd(T.node,T.offset),I.addRange(P))}}}}for(Y=[],I=b;I=I.parentNode;)I.nodeType===1&&Y.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<Y.length;b++){var G=Y[b];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}Yl=!!Du,Eu=Du=null}finally{Ve=u,V.p=o,R.T=i}}e.current=t,wt=2}}function mp(){if(wt===2){wt=0;var e=za,t=oo,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=R.T,R.T=null;var o=V.p;V.p=2;var u=Ve;Ve|=4;try{Km(e,t.alternate,t)}finally{Ve=u,V.p=o,R.T=i}}wt=3}}function pp(){if(wt===4||wt===3){wt=0,Vn();var e=za,t=oo,i=ha,o=tp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?wt=5:(wt=0,oo=za=null,gp(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(_a=null),ji(i),t=t.stateNode,Z&&typeof Z.onCommitFiberRoot=="function")try{Z.onCommitFiberRoot(Qn,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=R.T,u=V.p,V.p=2,R.T=null;try{for(var d=e.onRecoverableError,g=0;g<o.length;g++){var b=o[g];d(b.value,{componentStack:b.stack})}}finally{R.T=t,V.p=u}}(ha&3)!==0&&Rl(),zn(e),u=e.pendingLanes,(i&261930)!==0&&(u&42)!==0?e===yu?ls++:(ls=0,yu=e):ls=0,rs(0)}}function gp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ko(t)))}function Rl(){return hp(),mp(),pp(),yp()}function yp(){if(wt!==5)return!1;var e=za,t=pu;pu=0;var i=ji(ha),o=R.T,u=V.p;try{V.p=32>i?32:i,R.T=null,i=gu,gu=null;var d=za,g=ha;if(wt=0,oo=za=null,ha=0,(Ve&6)!==0)throw Error(l(331));var b=Ve;if(Ve|=4,Zm(d.current),Wm(d,d.current,g,i),Ve=b,rs(0,!1),Z&&typeof Z.onPostCommitFiberRoot=="function")try{Z.onPostCommitFiberRoot(Qn,d)}catch{}return!0}finally{V.p=u,R.T=o,gp(e,t)}}function xp(e,t,i){t=pn(i,t),t=Wc(e.stateNode,t,2),e=Da(e,t,2),e!==null&&(wn(e,2),zn(e))}function We(e,t,i){if(e.tag===3)xp(e,e,i);else for(;t!==null;){if(t.tag===3){xp(t,e,i);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(_a===null||!_a.has(o))){e=pn(i,e),i=bm(2),o=Da(t,i,2),o!==null&&(vm(i,o,t,e),wn(o,2),zn(o));break}}t=t.return}}function vu(e,t,i){var o=e.pingCache;if(o===null){o=e.pingCache=new Gv;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(i)||(fu=!0,u.add(i),e=Wv.bind(null,e,t,i),t.then(e,e))}function Wv(e,t,i){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Je===e&&(ze&i)===i&&(ut===4||ut===3&&(ze&62914560)===ze&&300>ht()-Tl?(Ve&2)===0&&so(e,0):hu|=i,io===ze&&(io=0)),zn(e)}function bp(e,t){t===0&&(t=Nt()),e=si(e,t),e!==null&&(wn(e,t),zn(e))}function $v(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),bp(e,i)}function Xv(e,t){var i=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(i=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(t),bp(e,i)}function Zv(e,t){return En(e,t)}var Pl=null,ro=null,Su=!1,Ll=!1,Cu=!1,Ia=0;function zn(e){e!==ro&&e.next===null&&(ro===null?Pl=ro=e:ro=ro.next=e),Ll=!0,Su||(Su=!0,e0())}function rs(e,t){if(!Cu&&Ll){Cu=!0;do for(var i=!1,o=Pl;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var d=0;else{var g=o.suspendedLanes,b=o.pingedLanes;d=(1<<31-be(42|e)+1)-1,d&=u&~(g&~b),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,wp(o,d))}else d=ze,d=we(o,o===Je?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Pt(o,d)||(i=!0,wp(o,d));o=o.next}while(i);Cu=!1}}function Jv(){vp()}function vp(){Ll=Su=!1;var e=0;Ia!==0&&u0()&&(e=Ia);for(var t=ht(),i=null,o=Pl;o!==null;){var u=o.next,d=Sp(o,t);d===0?(o.next=null,i===null?Pl=u:i.next=u,u===null&&(ro=i)):(i=o,(e!==0||(d&3)!==0)&&(Ll=!0)),o=u}wt!==0&&wt!==5||rs(e),Ia!==0&&(Ia=0)}function Sp(e,t){for(var i=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var g=31-be(d),b=1<<g,A=u[g];A===-1?((b&i)===0||(b&o)!==0)&&(u[g]=Wn(b,t)):A<=t&&(e.expiredLanes|=b),d&=~b}if(t=Je,i=ze,i=we(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,i===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&$t(o),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Pt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(o!==null&&$t(o),ji(i)){case 2:case 8:i=ei;break;case 32:i=On;break;case 268435456:i=Ti;break;default:i=On}return o=Cp.bind(null,e),i=En(i,o),e.callbackPriority=t,e.callbackNode=i,t}return o!==null&&o!==null&&$t(o),e.callbackPriority=2,e.callbackNode=null,2}function Cp(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Rl()&&e.callbackNode!==i)return null;var o=ze;return o=we(e,e===Je?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(ap(e,o,t),Sp(e,ht()),e.callbackNode!=null&&e.callbackNode===i?Cp.bind(null,e):null)}function wp(e,t){if(Rl())return null;ap(e,t,!0)}function e0(){f0(function(){(Ve&6)!==0?En(Fn,Jv):vp()})}function wu(){if(Ia===0){var e=Fi;e===0&&(e=Ae,Ae<<=1,(Ae&261888)===0&&(Ae=256)),Ia=e}return Ia}function Np(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qs(""+e)}function kp(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function t0(e,t,i,o,u){if(t==="submit"&&i&&i.stateNode===u){var d=Np((u[It]||null).action),g=o.submitter;g&&(t=(t=g[It]||null)?Np(t.formAction):g.getAttribute("formAction"),t!==null&&(d=t,g=null));var b=new Fs("action","action",null,o,u);e.push({event:b,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ia!==0){var A=g?kp(u,g):new FormData(u);qc(i,{pending:!0,data:A,method:u.method,action:d},null,A)}}else typeof d=="function"&&(b.preventDefault(),A=g?kp(u,g):new FormData(u),qc(i,{pending:!0,data:A,method:u.method,action:d},d,A))},currentTarget:u}]})}}for(var Nu=0;Nu<sc.length;Nu++){var ku=sc[Nu],n0=ku.toLowerCase(),a0=ku[0].toUpperCase()+ku.slice(1);Nn(n0,"on"+a0)}Nn(nh,"onAnimationEnd"),Nn(ah,"onAnimationIteration"),Nn(ih,"onAnimationStart"),Nn("dblclick","onDoubleClick"),Nn("focusin","onFocus"),Nn("focusout","onBlur"),Nn(bv,"onTransitionRun"),Nn(vv,"onTransitionStart"),Nn(Sv,"onTransitionCancel"),Nn(oh,"onTransitionEnd"),Ri("onMouseEnter",["mouseout","mouseover"]),Ri("onMouseLeave",["mouseout","mouseover"]),Ri("onPointerEnter",["pointerout","pointerover"]),Ri("onPointerLeave",["pointerout","pointerover"]),ni("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ni("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ni("onBeforeInput",["compositionend","keypress","textInput","paste"]),ni("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ni("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ni("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cs="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(" "),i0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cs));function Ap(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var o=e[i],u=o.event;o=o.listeners;e:{var d=void 0;if(t)for(var g=o.length-1;0<=g;g--){var b=o[g],A=b.instance,L=b.currentTarget;if(b=b.listener,A!==d&&u.isPropagationStopped())break e;d=b,u.currentTarget=L;try{d(u)}catch(q){$s(q)}u.currentTarget=null,d=A}else for(g=0;g<o.length;g++){if(b=o[g],A=b.instance,L=b.currentTarget,b=b.listener,A!==d&&u.isPropagationStopped())break e;d=b,u.currentTarget=L;try{d(u)}catch(q){$s(q)}u.currentTarget=null,d=A}}}}function _e(e,t){var i=t[Ur];i===void 0&&(i=t[Ur]=new Set);var o=e+"__bubble";i.has(o)||(Tp(t,e,2,!1),i.add(o))}function Au(e,t,i){var o=0;t&&(o|=4),Tp(i,e,o,t)}var _l="_reactListening"+Math.random().toString(36).slice(2);function Tu(e){if(!e[_l]){e[_l]=!0,vf.forEach(function(i){i!=="selectionchange"&&(i0.has(i)||Au(i,!1,e),Au(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_l]||(t[_l]=!0,Au("selectionchange",!1,t))}}function Tp(e,t,i,o){switch(ng(t)){case 2:var u=O0;break;case 8:u=R0;break;default:u=Ku}i=u.bind(null,t,i,e),u=void 0,!Fr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,i,{capture:!0,passive:u}):e.addEventListener(t,i,!0):u!==void 0?e.addEventListener(t,i,{passive:u}):e.addEventListener(t,i,!1)}function ju(e,t,i,o,u){var d=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var g=o.tag;if(g===3||g===4){var b=o.stateNode.containerInfo;if(b===u)break;if(g===4)for(g=o.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===u)return;g=g.return}for(;b!==null;){if(g=Di(b),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){o=d=g;continue e}b=b.parentNode}}o=o.return}Of(function(){var L=d,q=Yr(i),Y=[];e:{var _=sh.get(e);if(_!==void 0){var I=Fs,ue=e;switch(e){case"keypress":if(Ys(i)===0)break e;case"keydown":case"keyup":I=Xb;break;case"focusin":ue="focus",I=Xr;break;case"focusout":ue="blur",I=Xr;break;case"beforeblur":case"afterblur":I=Xr;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=Lf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=Ib;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=ev;break;case nh:case ah:case ih:I=Kb;break;case oh:I=nv;break;case"scroll":case"scrollend":I=zb;break;case"wheel":I=iv;break;case"copy":case"cut":case"paste":I=Gb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=zf;break;case"toggle":case"beforetoggle":I=sv}var Se=(t&4)!==0,Ze=!Se&&(e==="scroll"||e==="scrollend"),D=Se?_!==null?_+"Capture":null:_;Se=[];for(var T=L,P;T!==null;){var G=T;if(P=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||P===null||D===null||(G=Eo(T,D),G!=null&&Se.push(us(T,G,P))),Ze)break;T=T.return}0<Se.length&&(_=new I(_,ue,null,i,q),Y.push({event:_,listeners:Se}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",I=e==="mouseout"||e==="pointerout",_&&i!==Gr&&(ue=i.relatedTarget||i.fromElement)&&(Di(ue)||ue[Mi]))break e;if((I||_)&&(_=q.window===q?q:(_=q.ownerDocument)?_.defaultView||_.parentWindow:window,I?(ue=i.relatedTarget||i.toElement,I=L,ue=ue?Di(ue):null,ue!==null&&(Ze=f(ue),Se=ue.tag,ue!==Ze||Se!==5&&Se!==27&&Se!==6)&&(ue=null)):(I=null,ue=L),I!==ue)){if(Se=Lf,G="onMouseLeave",D="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(Se=zf,G="onPointerLeave",D="onPointerEnter",T="pointer"),Ze=I==null?_:Do(I),P=ue==null?_:Do(ue),_=new Se(G,T+"leave",I,i,q),_.target=Ze,_.relatedTarget=P,G=null,Di(q)===L&&(Se=new Se(D,T+"enter",ue,i,q),Se.target=P,Se.relatedTarget=Ze,G=Se),Ze=G,I&&ue)t:{for(Se=o0,D=I,T=ue,P=0,G=D;G;G=Se(G))P++;G=0;for(var ge=T;ge;ge=Se(ge))G++;for(;0<P-G;)D=Se(D),P--;for(;0<G-P;)T=Se(T),G--;for(;P--;){if(D===T||T!==null&&D===T.alternate){Se=D;break t}D=Se(D),T=Se(T)}Se=null}else Se=null;I!==null&&jp(Y,_,I,Se,!1),ue!==null&&Ze!==null&&jp(Y,Ze,ue,Se,!0)}}e:{if(_=L?Do(L):window,I=_.nodeName&&_.nodeName.toLowerCase(),I==="select"||I==="input"&&_.type==="file")var Ke=Yf;else if(qf(_))if(Vf)Ke=gv;else{Ke=mv;var de=hv}else I=_.nodeName,!I||I.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?L&&qr(L.elementType)&&(Ke=Yf):Ke=pv;if(Ke&&(Ke=Ke(e,L))){Gf(Y,Ke,i,q);break e}de&&de(e,_,L),e==="focusout"&&L&&_.type==="number"&&L.memoizedProps.value!=null&&Kr(_,"number",_.value)}switch(de=L?Do(L):window,e){case"focusin":(qf(de)||de.contentEditable==="true")&&(Ii=de,ac=L,Io=null);break;case"focusout":Io=ac=Ii=null;break;case"mousedown":ic=!0;break;case"contextmenu":case"mouseup":case"dragend":ic=!1,eh(Y,i,q);break;case"selectionchange":if(xv)break;case"keydown":case"keyup":eh(Y,i,q)}var Me;if(Jr)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Ui?Bf(e,i)&&(Ue="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ue="onCompositionStart");Ue&&(Uf&&i.locale!=="ko"&&(Ui||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Ui&&(Me=Rf()):(wa=q,Qr="value"in wa?wa.value:wa.textContent,Ui=!0)),de=zl(L,Ue),0<de.length&&(Ue=new _f(Ue,e,null,i,q),Y.push({event:Ue,listeners:de}),Me?Ue.data=Me:(Me=Kf(i),Me!==null&&(Ue.data=Me)))),(Me=rv?cv(e,i):uv(e,i))&&(Ue=zl(L,"onBeforeInput"),0<Ue.length&&(de=new _f("onBeforeInput","beforeinput",null,i,q),Y.push({event:de,listeners:Ue}),de.data=Me)),t0(Y,e,L,i,q)}Ap(Y,t)})}function us(e,t,i){return{instance:e,listener:t,currentTarget:i}}function zl(e,t){for(var i=t+"Capture",o=[];e!==null;){var u=e,d=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||d===null||(u=Eo(e,i),u!=null&&o.unshift(us(e,u,d)),u=Eo(e,t),u!=null&&o.push(us(e,u,d))),e.tag===3)return o;e=e.return}return[]}function o0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jp(e,t,i,o,u){for(var d=t._reactName,g=[];i!==null&&i!==o;){var b=i,A=b.alternate,L=b.stateNode;if(b=b.tag,A!==null&&A===o)break;b!==5&&b!==26&&b!==27||L===null||(A=L,u?(L=Eo(i,d),L!=null&&g.unshift(us(i,L,A))):u||(L=Eo(i,d),L!=null&&g.push(us(i,L,A)))),i=i.return}g.length!==0&&e.push({event:t,listeners:g})}var s0=/\r\n?/g,l0=/\u0000|\uFFFD/g;function Mp(e){return(typeof e=="string"?e:""+e).replace(s0,`
10
+ `).replace(l0,"")}function Dp(e,t){return t=Mp(t),Mp(e)===t}function Xe(e,t,i,o,u,d){switch(i){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Li(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Li(e,""+o);break;case"className":Bs(e,"class",o);break;case"tabIndex":Bs(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Bs(e,i,o);break;case"style":Df(e,o,d);break;case"data":if(t!=="object"){Bs(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(i);break}o=qs(""+o),e.setAttribute(i,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(i,"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 d=="function"&&(i==="formAction"?(t!=="input"&&Xe(e,t,"name",u.name,u,null),Xe(e,t,"formEncType",u.formEncType,u,null),Xe(e,t,"formMethod",u.formMethod,u,null),Xe(e,t,"formTarget",u.formTarget,u,null)):(Xe(e,t,"encType",u.encType,u,null),Xe(e,t,"method",u.method,u,null),Xe(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(i);break}o=qs(""+o),e.setAttribute(i,o);break;case"onClick":o!=null&&(e.onclick=Zn);break;case"onScroll":o!=null&&_e("scroll",e);break;case"onScrollEnd":o!=null&&_e("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(i=o.__html,i!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}i=qs(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,""+o):e.removeAttribute(i);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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":o===!0?e.setAttribute(i,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(i,o):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(i,o):e.removeAttribute(i);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(i):e.setAttribute(i,o);break;case"popover":_e("beforetoggle",e),_e("toggle",e),Hs(e,"popover",o);break;case"xlinkActuate":Xn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Xn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Xn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Xn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Xn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Xn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Xn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Xn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Xn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Hs(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Lb.get(i)||i,Hs(e,i,o))}}function Mu(e,t,i,o,u,d){switch(i){case"style":Df(e,o,d);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(i=o.__html,i!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof o=="string"?Li(e,o):(typeof o=="number"||typeof o=="bigint")&&Li(e,""+o);break;case"onScroll":o!=null&&_e("scroll",e);break;case"onScrollEnd":o!=null&&_e("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sf.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(u=i.endsWith("Capture"),t=i.slice(2,u?i.length-7:void 0),d=e[It]||null,d=d!=null?d[i]:null,typeof d=="function"&&e.removeEventListener(t,d,u),typeof o=="function")){typeof d!="function"&&d!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,o,u);break e}i in e?e[i]=o:o===!0?e.setAttribute(i,""):Hs(e,i,o)}}}function Ot(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_e("error",e),_e("load",e);var o=!1,u=!1,d;for(d in i)if(i.hasOwnProperty(d)){var g=i[d];if(g!=null)switch(d){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Xe(e,t,d,g,i,null)}}u&&Xe(e,t,"srcSet",i.srcSet,i,null),o&&Xe(e,t,"src",i.src,i,null);return;case"input":_e("invalid",e);var b=d=g=u=null,A=null,L=null;for(o in i)if(i.hasOwnProperty(o)){var q=i[o];if(q!=null)switch(o){case"name":u=q;break;case"type":g=q;break;case"checked":A=q;break;case"defaultChecked":L=q;break;case"value":d=q;break;case"defaultValue":b=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(l(137,t));break;default:Xe(e,t,o,q,i,null)}}Af(e,d,b,A,L,g,u,!1);return;case"select":_e("invalid",e),o=g=d=null;for(u in i)if(i.hasOwnProperty(u)&&(b=i[u],b!=null))switch(u){case"value":d=b;break;case"defaultValue":g=b;break;case"multiple":o=b;default:Xe(e,t,u,b,i,null)}t=d,i=g,e.multiple=!!o,t!=null?Pi(e,!!o,t,!1):i!=null&&Pi(e,!!o,i,!0);return;case"textarea":_e("invalid",e),d=u=o=null;for(g in i)if(i.hasOwnProperty(g)&&(b=i[g],b!=null))switch(g){case"value":o=b;break;case"defaultValue":u=b;break;case"children":d=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(l(91));break;default:Xe(e,t,g,b,i,null)}jf(e,o,u,d);return;case"option":for(A in i)if(i.hasOwnProperty(A)&&(o=i[A],o!=null))switch(A){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Xe(e,t,A,o,i,null)}return;case"dialog":_e("beforetoggle",e),_e("toggle",e),_e("cancel",e),_e("close",e);break;case"iframe":case"object":_e("load",e);break;case"video":case"audio":for(o=0;o<cs.length;o++)_e(cs[o],e);break;case"image":_e("error",e),_e("load",e);break;case"details":_e("toggle",e);break;case"embed":case"source":case"link":_e("error",e),_e("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(L in i)if(i.hasOwnProperty(L)&&(o=i[L],o!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Xe(e,t,L,o,i,null)}return;default:if(qr(t)){for(q in i)i.hasOwnProperty(q)&&(o=i[q],o!==void 0&&Mu(e,t,q,o,i,void 0));return}}for(b in i)i.hasOwnProperty(b)&&(o=i[b],o!=null&&Xe(e,t,b,o,i,null))}function r0(e,t,i,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,d=null,g=null,b=null,A=null,L=null,q=null;for(I in i){var Y=i[I];if(i.hasOwnProperty(I)&&Y!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":A=Y;default:o.hasOwnProperty(I)||Xe(e,t,I,null,o,Y)}}for(var _ in o){var I=o[_];if(Y=i[_],o.hasOwnProperty(_)&&(I!=null||Y!=null))switch(_){case"type":d=I;break;case"name":u=I;break;case"checked":L=I;break;case"defaultChecked":q=I;break;case"value":g=I;break;case"defaultValue":b=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(l(137,t));break;default:I!==Y&&Xe(e,t,_,I,o,Y)}}Br(e,g,b,A,L,q,d,u);return;case"select":I=g=b=_=null;for(d in i)if(A=i[d],i.hasOwnProperty(d)&&A!=null)switch(d){case"value":break;case"multiple":I=A;default:o.hasOwnProperty(d)||Xe(e,t,d,null,o,A)}for(u in o)if(d=o[u],A=i[u],o.hasOwnProperty(u)&&(d!=null||A!=null))switch(u){case"value":_=d;break;case"defaultValue":b=d;break;case"multiple":g=d;default:d!==A&&Xe(e,t,u,d,o,A)}t=b,i=g,o=I,_!=null?Pi(e,!!i,_,!1):!!o!=!!i&&(t!=null?Pi(e,!!i,t,!0):Pi(e,!!i,i?[]:"",!1));return;case"textarea":I=_=null;for(b in i)if(u=i[b],i.hasOwnProperty(b)&&u!=null&&!o.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Xe(e,t,b,null,o,u)}for(g in o)if(u=o[g],d=i[g],o.hasOwnProperty(g)&&(u!=null||d!=null))switch(g){case"value":_=u;break;case"defaultValue":I=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(l(91));break;default:u!==d&&Xe(e,t,g,u,o,d)}Tf(e,_,I);return;case"option":for(var ue in i)if(_=i[ue],i.hasOwnProperty(ue)&&_!=null&&!o.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Xe(e,t,ue,null,o,_)}for(A in o)if(_=o[A],I=i[A],o.hasOwnProperty(A)&&_!==I&&(_!=null||I!=null))switch(A){case"selected":e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:Xe(e,t,A,_,o,I)}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 Se in i)_=i[Se],i.hasOwnProperty(Se)&&_!=null&&!o.hasOwnProperty(Se)&&Xe(e,t,Se,null,o,_);for(L in o)if(_=o[L],I=i[L],o.hasOwnProperty(L)&&_!==I&&(_!=null||I!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(l(137,t));break;default:Xe(e,t,L,_,o,I)}return;default:if(qr(t)){for(var Ze in i)_=i[Ze],i.hasOwnProperty(Ze)&&_!==void 0&&!o.hasOwnProperty(Ze)&&Mu(e,t,Ze,void 0,o,_);for(q in o)_=o[q],I=i[q],!o.hasOwnProperty(q)||_===I||_===void 0&&I===void 0||Mu(e,t,q,_,o,I);return}}for(var D in i)_=i[D],i.hasOwnProperty(D)&&_!=null&&!o.hasOwnProperty(D)&&Xe(e,t,D,null,o,_);for(Y in o)_=o[Y],I=i[Y],!o.hasOwnProperty(Y)||_===I||_==null&&I==null||Xe(e,t,Y,_,o,I)}function Ep(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),o=0;o<i.length;o++){var u=i[o],d=u.transferSize,g=u.initiatorType,b=u.duration;if(d&&b&&Ep(g)){for(g=0,b=u.responseEnd,o+=1;o<i.length;o++){var A=i[o],L=A.startTime;if(L>b)break;var q=A.transferSize,Y=A.initiatorType;q&&Ep(Y)&&(A=A.responseEnd,g+=q*(A<b?1:(b-L)/(A-L)))}if(--o,t+=8*(d+g)/(u.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 Du=null,Eu=null;function Ul(e){return e.nodeType===9?e:e.ownerDocument}function Op(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 Rp(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 Ou(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 Ru=null;function u0(){var e=window.event;return e&&e.type==="popstate"?e===Ru?!1:(Ru=e,!0):(Ru=null,!1)}var Pp=typeof setTimeout=="function"?setTimeout:void 0,d0=typeof clearTimeout=="function"?clearTimeout:void 0,Lp=typeof Promise=="function"?Promise:void 0,f0=typeof queueMicrotask=="function"?queueMicrotask:typeof Lp<"u"?function(e){return Lp.resolve(null).then(e).catch(h0)}:Pp;function h0(e){setTimeout(function(){throw e})}function Ha(e){return e==="head"}function _p(e,t){var i=t,o=0;do{var u=i.nextSibling;if(e.removeChild(i),u&&u.nodeType===8)if(i=u.data,i==="/$"||i==="/&"){if(o===0){e.removeChild(u),ho(t);return}o--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")o++;else if(i==="html")ds(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,ds(i);for(var d=i.firstChild;d;){var g=d.nextSibling,b=d.nodeName;d[Mo]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&d.rel.toLowerCase()==="stylesheet"||i.removeChild(d),d=g}}else i==="body"&&ds(e.ownerDocument.body);i=u}while(i);ho(t)}function zp(e,t){var i=e;e=0;do{var o=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),o&&o.nodeType===8)if(i=o.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=o}while(i)}function Pu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Pu(i),Ir(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function m0(e,t,i,o){for(;e.nodeType===1;){var u=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Mo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=vn(e.nextSibling),e===null)break}return null}function p0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=vn(e.nextSibling),e===null))return null;return e}function Up(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=vn(e.nextSibling),e===null))return null;return e}function Lu(e){return e.data==="$?"||e.data==="$~"}function _u(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function g0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var o=function(){t(),i.removeEventListener("DOMContentLoaded",o)};i.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function vn(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 zu=null;function Ip(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return vn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Hp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Bp(e,t,i){switch(t=Ul(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function ds(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ir(e)}var Sn=new Map,Kp=new Set;function Il(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ma=V.d;V.d={f:y0,r:x0,D:b0,C:v0,L:S0,m:C0,X:N0,S:w0,M:k0};function y0(){var e=ma.f(),t=Dl();return e||t}function x0(e){var t=Ei(e);t!==null&&t.tag===5&&t.type==="form"?om(t):ma.r(e)}var co=typeof document>"u"?null:document;function qp(e,t,i){var o=co;if(o&&typeof t=="string"&&t){var u=hn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof i=="string"&&(u+='[crossorigin="'+i+'"]'),Kp.has(u)||(Kp.add(u),e={rel:e,crossOrigin:i,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Ot(t,"link",e),kt(t),o.head.appendChild(t)))}}function b0(e){ma.D(e),qp("dns-prefetch",e,null)}function v0(e,t){ma.C(e,t),qp("preconnect",e,t)}function S0(e,t,i){ma.L(e,t,i);var o=co;if(o&&e&&t){var u='link[rel="preload"][as="'+hn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(u+='[imagesrcset="'+hn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(u+='[imagesizes="'+hn(i.imageSizes)+'"]')):u+='[href="'+hn(e)+'"]';var d=u;switch(t){case"style":d=uo(e);break;case"script":d=fo(e)}Sn.has(d)||(e=x({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Sn.set(d,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(fs(d))||t==="script"&&o.querySelector(hs(d))||(t=o.createElement("link"),Ot(t,"link",e),kt(t),o.head.appendChild(t)))}}function C0(e,t){ma.m(e,t);var i=co;if(i&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+hn(o)+'"][href="'+hn(e)+'"]',d=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=fo(e)}if(!Sn.has(d)&&(e=x({rel:"modulepreload",href:e},t),Sn.set(d,e),i.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(hs(d)))return}o=i.createElement("link"),Ot(o,"link",e),kt(o),i.head.appendChild(o)}}}function w0(e,t,i){ma.S(e,t,i);var o=co;if(o&&e){var u=Oi(o).hoistableStyles,d=uo(e);t=t||"default";var g=u.get(d);if(!g){var b={loading:0,preload:null};if(g=o.querySelector(fs(d)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Sn.get(d))&&Uu(e,i);var A=g=o.createElement("link");kt(A),Ot(A,"link",e),A._p=new Promise(function(L,q){A.onload=L,A.onerror=q}),A.addEventListener("load",function(){b.loading|=1}),A.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Hl(g,t,o)}g={type:"stylesheet",instance:g,count:1,state:b},u.set(d,g)}}}function N0(e,t){ma.X(e,t);var i=co;if(i&&e){var o=Oi(i).hoistableScripts,u=fo(e),d=o.get(u);d||(d=i.querySelector(hs(u)),d||(e=x({src:e,async:!0},t),(t=Sn.get(u))&&Iu(e,t),d=i.createElement("script"),kt(d),Ot(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(u,d))}}function k0(e,t){ma.M(e,t);var i=co;if(i&&e){var o=Oi(i).hoistableScripts,u=fo(e),d=o.get(u);d||(d=i.querySelector(hs(u)),d||(e=x({src:e,async:!0,type:"module"},t),(t=Sn.get(u))&&Iu(e,t),d=i.createElement("script"),kt(d),Ot(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(u,d))}}function Gp(e,t,i,o){var u=(u=te.current)?Il(u):null;if(!u)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=uo(i.href),i=Oi(u).hoistableStyles,o=i.get(t),o||(o={type:"style",instance:null,count:0,state:null},i.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=uo(i.href);var d=Oi(u).hoistableStyles,g=d.get(e);if(g||(u=u.ownerDocument||u,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,g),(d=u.querySelector(fs(e)))&&!d._p&&(g.instance=d,g.state.loading=5),Sn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Sn.set(e,i),d||A0(u,e,i,g.state))),t&&o===null)throw Error(l(528,""));return g}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=fo(i),i=Oi(u).hoistableScripts,o=i.get(t),o||(o={type:"script",instance:null,count:0,state:null},i.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function uo(e){return'href="'+hn(e)+'"'}function fs(e){return'link[rel="stylesheet"]['+e+"]"}function Yp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function A0(e,t,i,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Ot(t,"link",i),kt(t),e.head.appendChild(t))}function fo(e){return'[src="'+hn(e)+'"]'}function hs(e){return"script[async]"+e}function Vp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+hn(i.href)+'"]');if(o)return t.instance=o,kt(o),o;var u=x({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),kt(o),Ot(o,"style",u),Hl(o,i.precedence,e),t.instance=o;case"stylesheet":u=uo(i.href);var d=e.querySelector(fs(u));if(d)return t.state.loading|=4,t.instance=d,kt(d),d;o=Yp(i),(u=Sn.get(u))&&Uu(o,u),d=(e.ownerDocument||e).createElement("link"),kt(d);var g=d;return g._p=new Promise(function(b,A){g.onload=b,g.onerror=A}),Ot(d,"link",o),t.state.loading|=4,Hl(d,i.precedence,e),t.instance=d;case"script":return d=fo(i.src),(u=e.querySelector(hs(d)))?(t.instance=u,kt(u),u):(o=i,(u=Sn.get(d))&&(o=x({},i),Iu(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),kt(u),Ot(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Hl(o,i.precedence,e));return t.instance}function Hl(e,t,i){for(var o=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,d=u,g=0;g<o.length;g++){var b=o[g];if(b.dataset.precedence===t)d=b;else if(d!==u)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Uu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Iu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Bl=null;function Fp(e,t,i){if(Bl===null){var o=new Map,u=Bl=new Map;u.set(i,o)}else u=Bl,o=u.get(i),o||(o=new Map,u.set(i,o));if(o.has(e))return o;for(o.set(e,null),i=i.getElementsByTagName(e),u=0;u<i.length;u++){var d=i[u];if(!(d[Mo]||d[jt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var g=d.getAttribute(t)||"";g=e+g;var b=o.get(g);b?b.push(d):o.set(g,[d])}}return o}function Qp(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function T0(e,t,i){if(i===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 Wp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function j0(e,t,i,o){if(i.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var u=uo(o.href),d=t.querySelector(fs(u));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Kl.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=d,kt(d);return}d=t.ownerDocument||t,o=Yp(o),(u=Sn.get(u))&&Uu(o,u),d=d.createElement("link"),kt(d);var g=d;g._p=new Promise(function(b,A){g.onload=b,g.onerror=A}),Ot(d,"link",o),i.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Kl.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Hu=0;function M0(e,t){return e.stylesheets&&e.count===0&&Gl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var o=setTimeout(function(){if(e.stylesheets&&Gl(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Hu===0&&(Hu=62500*c0());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Gl(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Hu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Kl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ql=null;function Gl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ql=new Map,t.forEach(D0,e),ql=null,Kl.call(e))}function D0(e,t){if(!(t.state.loading&4)){var i=ql.get(e);if(i)var o=i.get(null);else{i=new Map,ql.set(e,i);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<u.length;d++){var g=u[d];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(i.set(g.dataset.precedence,g),o=g)}o&&i.set(null,o)}u=t.instance,g=u.getAttribute("data-precedence"),d=i.get(g)||o,d===o&&i.set(null,u),i.set(g,u),this.count++,o=Kl.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),d?d.parentNode.insertBefore(u,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var ms={$$typeof:B,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function E0(e,t,i,o,u,d,g,b,A){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=Zt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zt(0),this.hiddenUpdates=Zt(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=d,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function $p(e,t,i,o,u,d,g,b,A,L,q,Y){return e=new E0(e,t,i,g,A,L,q,Y,b),t=1,d===!0&&(t|=24),d=en(3,null,null,t),e.current=d,d.stateNode=e,t=bc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:o,isDehydrated:i,cache:t},wc(d),e}function Xp(e){return e?(e=Ki,e):Ki}function Zp(e,t,i,o,u,d){u=Xp(u),o.context===null?o.context=u:o.pendingContext=u,o=Ma(t),o.payload={element:i},d=d===void 0?null:d,d!==null&&(o.callback=d),i=Da(e,o,t),i!==null&&(Yt(i,e,t),Vo(i,e,t))}function Jp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Bu(e,t){Jp(e,t),(e=e.alternate)&&Jp(e,t)}function eg(e){if(e.tag===13||e.tag===31){var t=si(e,67108864);t!==null&&Yt(t,e,67108864),Bu(e,67108864)}}function tg(e){if(e.tag===13||e.tag===31){var t=sn();t=$n(t);var i=si(e,t);i!==null&&Yt(i,e,t),Bu(e,t)}}var Yl=!0;function O0(e,t,i,o){var u=R.T;R.T=null;var d=V.p;try{V.p=2,Ku(e,t,i,o)}finally{V.p=d,R.T=u}}function R0(e,t,i,o){var u=R.T;R.T=null;var d=V.p;try{V.p=8,Ku(e,t,i,o)}finally{V.p=d,R.T=u}}function Ku(e,t,i,o){if(Yl){var u=qu(o);if(u===null)ju(e,t,o,Vl,i),ag(e,o);else if(L0(u,e,t,i,o))o.stopPropagation();else if(ag(e,o),t&4&&-1<P0.indexOf(e)){for(;u!==null;){var d=Ei(u);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var g=tt(d.pendingLanes);if(g!==0){var b=d;for(b.pendingLanes|=2,b.entangledLanes|=2;g;){var A=1<<31-be(g);b.entanglements[1]|=A,g&=~A}zn(d),(Ve&6)===0&&(jl=ht()+500,rs(0))}}break;case 31:case 13:b=si(d,2),b!==null&&Yt(b,d,2),Dl(),Bu(d,2)}if(d=qu(o),d===null&&ju(e,t,o,Vl,i),d===u)break;u=d}u!==null&&o.stopPropagation()}else ju(e,t,o,null,i)}}function qu(e){return e=Yr(e),Gu(e)}var Vl=null;function Gu(e){if(Vl=null,e=Di(e),e!==null){var t=f(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=h(t),e!==null)return e;e=null}else if(i===31){if(e=m(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Vl=e,null}function ng(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(Xt()){case Fn:return 2;case ei:return 8;case On:case Rn:return 32;case Ti:return 268435456;default:return 32}default:return 32}}var Yu=!1,Ba=null,Ka=null,qa=null,ps=new Map,gs=new Map,Ga=[],P0="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 ag(e,t){switch(e){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":Ka=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":ps.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gs.delete(t.pointerId)}}function ys(e,t,i,o,u,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:i,eventSystemFlags:o,nativeEvent:d,targetContainers:[u]},t!==null&&(t=Ei(t),t!==null&&eg(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function L0(e,t,i,o,u){switch(t){case"focusin":return Ba=ys(Ba,e,t,i,o,u),!0;case"dragenter":return Ka=ys(Ka,e,t,i,o,u),!0;case"mouseover":return qa=ys(qa,e,t,i,o,u),!0;case"pointerover":var d=u.pointerId;return ps.set(d,ys(ps.get(d)||null,e,t,i,o,u)),!0;case"gotpointercapture":return d=u.pointerId,gs.set(d,ys(gs.get(d)||null,e,t,i,o,u)),!0}return!1}function ig(e){var t=Di(e.target);if(t!==null){var i=f(t);if(i!==null){if(t=i.tag,t===13){if(t=h(i),t!==null){e.blockedOn=t,jo(e.priority,function(){tg(i)});return}}else if(t===31){if(t=m(i),t!==null){e.blockedOn=t,jo(e.priority,function(){tg(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=qu(e.nativeEvent);if(i===null){i=e.nativeEvent;var o=new i.constructor(i.type,i);Gr=o,i.target.dispatchEvent(o),Gr=null}else return t=Ei(i),t!==null&&eg(t),e.blockedOn=i,!1;t.shift()}return!0}function og(e,t,i){Fl(e)&&i.delete(t)}function _0(){Yu=!1,Ba!==null&&Fl(Ba)&&(Ba=null),Ka!==null&&Fl(Ka)&&(Ka=null),qa!==null&&Fl(qa)&&(qa=null),ps.forEach(og),gs.forEach(og)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,Yu||(Yu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,_0)))}var Wl=null;function sg(e){Wl!==e&&(Wl=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Wl===e&&(Wl=null);for(var t=0;t<e.length;t+=3){var i=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(Gu(o||i)===null)continue;break}var d=Ei(i);d!==null&&(e.splice(t,3),t-=3,qc(d,{pending:!0,data:u,method:i.method,action:o},o,u))}}))}function ho(e){function t(A){return Ql(A,e)}Ba!==null&&Ql(Ba,e),Ka!==null&&Ql(Ka,e),qa!==null&&Ql(qa,e),ps.forEach(t),gs.forEach(t);for(var i=0;i<Ga.length;i++){var o=Ga[i];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Ga.length&&(i=Ga[0],i.blockedOn===null);)ig(i),i.blockedOn===null&&Ga.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(o=0;o<i.length;o+=3){var u=i[o],d=i[o+1],g=u[It]||null;if(typeof d=="function")g||sg(i);else if(g){var b=null;if(d&&d.hasAttribute("formAction")){if(u=d,g=d[It]||null)b=g.formAction;else if(Gu(u)!==null)continue}else b=g.action;typeof b=="function"?i[o+1]=b:(i.splice(o,3),o-=3),sg(i)}}}function lg(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(g){return u=g})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(i,20)}function i(){if(!o&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Vu(e){this._internalRoot=e}$l.prototype.render=Vu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,o=sn();Zp(i,o,e,t,null,null)},$l.prototype.unmount=Vu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zp(e.current,2,null,e,null,null),Dl(),t[Mi]=null}};function $l(e){this._internalRoot=e}$l.prototype.unstable_scheduleHydration=function(e){if(e){var t=To();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ga.length&&t!==0&&t<Ga[i].priority;i++);Ga.splice(i,0,e),i===0&&ig(e)}};var rg=a.version;if(rg!=="19.2.1")throw Error(l(527,rg,"19.2.1"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=y(t),e=e!==null?C(e):null,e=e===null?null:e.stateNode,e};var z0={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xl.isDisabled&&Xl.supportsFiber)try{Qn=Xl.inject(z0),Z=Xl}catch{}}return bs.createRoot=function(e,t){if(!c(e))throw Error(l(299));var i=!1,o="",u=pm,d=gm,g=ym;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=$p(e,1,!1,null,null,i,o,null,u,d,g,lg),e[Mi]=t.current,Tu(e),new Vu(t)},bs.hydrateRoot=function(e,t,i){if(!c(e))throw Error(l(299));var o=!1,u="",d=pm,g=gm,b=ym,A=null;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError),i.formState!==void 0&&(A=i.formState)),t=$p(e,1,!0,t,i??null,o,u,A,d,g,b,lg),t.context=Xp(null),i=t.current,o=sn(),o=$n(o),u=Ma(o),u.callback=null,Da(i,u,o),i=o,t.current.lanes=i,wn(t,i),zn(t),e[Mi]=t.current,Tu(e),new $l(t)},bs.version="19.2.1",bs}var vg;function QC(){if(vg)return Fu.exports;vg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Fu.exports=FC(),Fu.exports}var WC=QC();const $C="modulepreload",XC=function(n){return"/"+n},Sg={},gt=function(a,s,l){let c=Promise.resolve();if(s&&s.length>0){let p=function(y){return Promise.all(y.map(C=>Promise.resolve(C).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),m=h?.nonce||h?.getAttribute("nonce");c=p(s.map(y=>{if(y=XC(y),y in Sg)return;Sg[y]=!0;const C=y.endsWith(".css"),x=C?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${x}`))return;const v=document.createElement("link");if(v.rel=C?"stylesheet":$C,C||(v.as="script"),v.crossOrigin="",v.href=y,m&&v.setAttribute("nonce",m),document.head.appendChild(v),C)return new Promise((N,w)=>{v.addEventListener("load",N),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return c.then(h=>{for(const m of h||[])m.status==="rejected"&&f(m.reason);return a().catch(f)})},ZC=new wS({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1},mutations:{retry:!1}}}),ke=n=>typeof n=="string",vs=()=>{let n,a;const s=new Promise((l,c)=>{n=l,a=c});return s.resolve=n,s.reject=a,s},Cg=n=>n==null?"":""+n,JC=(n,a,s)=>{n.forEach(l=>{a[l]&&(s[l]=a[l])})},ew=/###/g,wg=n=>n&&n.indexOf("###")>-1?n.replace(ew,"."):n,Ng=n=>!n||ke(n),Ts=(n,a,s)=>{const l=ke(a)?a.split("."):a;let c=0;for(;c<l.length-1;){if(Ng(n))return{};const f=wg(l[c]);!n[f]&&s&&(n[f]=new s),Object.prototype.hasOwnProperty.call(n,f)?n=n[f]:n={},++c}return Ng(n)?{}:{obj:n,k:wg(l[c])}},kg=(n,a,s)=>{const{obj:l,k:c}=Ts(n,a,Object);if(l!==void 0||a.length===1){l[c]=s;return}let f=a[a.length-1],h=a.slice(0,a.length-1),m=Ts(n,h,Object);for(;m.obj===void 0&&h.length;)f=`${h[h.length-1]}.${f}`,h=h.slice(0,h.length-1),m=Ts(n,h,Object),m?.obj&&typeof m.obj[`${m.k}.${f}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${f}`]=s},tw=(n,a,s,l)=>{const{obj:c,k:f}=Ts(n,a,Object);c[f]=c[f]||[],c[f].push(s)},rr=(n,a)=>{const{obj:s,k:l}=Ts(n,a);if(s&&Object.prototype.hasOwnProperty.call(s,l))return s[l]},nw=(n,a,s)=>{const l=rr(n,s);return l!==void 0?l:rr(a,s)},Jy=(n,a,s)=>{for(const l in a)l!=="__proto__"&&l!=="constructor"&&(l in n?ke(n[l])||n[l]instanceof String||ke(a[l])||a[l]instanceof String?s&&(n[l]=a[l]):Jy(n[l],a[l],s):n[l]=a[l]);return n},bi=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var aw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const iw=n=>ke(n)?n.replace(/[&<>"'\/]/g,a=>aw[a]):n;class ow{constructor(a){this.capacity=a,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(a){const s=this.regExpMap.get(a);if(s!==void 0)return s;const l=new RegExp(a);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(a,l),this.regExpQueue.push(a),l}}const sw=[" ",",","?","!",";"],lw=new ow(20),rw=(n,a,s)=>{a=a||"",s=s||"";const l=sw.filter(h=>a.indexOf(h)<0&&s.indexOf(h)<0);if(l.length===0)return!0;const c=lw.getRegExp(`(${l.map(h=>h==="?"?"\\?":h).join("|")})`);let f=!c.test(n);if(!f){const h=n.indexOf(s);h>0&&!c.test(n.substring(0,h))&&(f=!0)}return f},yd=(n,a,s=".")=>{if(!n)return;if(n[a])return Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;const l=a.split(s);let c=n;for(let f=0;f<l.length;){if(!c||typeof c!="object")return;let h,m="";for(let p=f;p<l.length;++p)if(p!==f&&(m+=s),m+=l[p],h=c[m],h!==void 0){if(["string","number","boolean"].indexOf(typeof h)>-1&&p<l.length-1)continue;f+=p-f+1;break}c=h}return c},Rs=n=>n?.replace("_","-"),cw={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,a){console?.[n]?.apply?.(console,a)}};class cr{constructor(a,s={}){this.init(a,s)}init(a,s={}){this.prefix=s.prefix||"i18next:",this.logger=a||cw,this.options=s,this.debug=s.debug}log(...a){return this.forward(a,"log","",!0)}warn(...a){return this.forward(a,"warn","",!0)}error(...a){return this.forward(a,"error","")}deprecate(...a){return this.forward(a,"warn","WARNING DEPRECATED: ",!0)}forward(a,s,l,c){return c&&!this.debug?null:(ke(a[0])&&(a[0]=`${l}${this.prefix} ${a[0]}`),this.logger[s](a))}create(a){return new cr(this.logger,{prefix:`${this.prefix}:${a}:`,...this.options})}clone(a){return a=a||this.options,a.prefix=a.prefix||this.prefix,new cr(this.logger,a)}}var Hn=new cr;class Ar{constructor(){this.observers={}}on(a,s){return a.split(" ").forEach(l=>{this.observers[l]||(this.observers[l]=new Map);const c=this.observers[l].get(s)||0;this.observers[l].set(s,c+1)}),this}off(a,s){if(this.observers[a]){if(!s){delete this.observers[a];return}this.observers[a].delete(s)}}emit(a,...s){this.observers[a]&&Array.from(this.observers[a].entries()).forEach(([c,f])=>{for(let h=0;h<f;h++)c(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,f])=>{for(let h=0;h<f;h++)c.apply(c,[a,...s])})}}class Ag extends Ar{constructor(a,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=a||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(a){this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}removeNamespaces(a){const s=this.options.ns.indexOf(a);s>-1&&this.options.ns.splice(s,1)}getResource(a,s,l,c={}){const f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,h=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;a.indexOf(".")>-1?m=a.split("."):(m=[a,s],l&&(Array.isArray(l)?m.push(...l):ke(l)&&f?m.push(...l.split(f)):m.push(l)));const p=rr(this.data,m);return!p&&!s&&!l&&a.indexOf(".")>-1&&(a=m[0],s=m[1],l=m.slice(2).join(".")),p||!h||!ke(l)?p:yd(this.data?.[a]?.[s],l,f)}addResource(a,s,l,c,f={silent:!1}){const h=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let m=[a,s];l&&(m=m.concat(h?l.split(h):l)),a.indexOf(".")>-1&&(m=a.split("."),c=s,s=m[1]),this.addNamespaces(s),kg(this.data,m,c),f.silent||this.emit("added",a,s,l,c)}addResources(a,s,l,c={silent:!1}){for(const f in l)(ke(l[f])||Array.isArray(l[f]))&&this.addResource(a,s,f,l[f],{silent:!0});c.silent||this.emit("added",a,s,l)}addResourceBundle(a,s,l,c,f,h={silent:!1,skipCopy:!1}){let m=[a,s];a.indexOf(".")>-1&&(m=a.split("."),c=l,l=s,s=m[1]),this.addNamespaces(s);let p=rr(this.data,m)||{};h.skipCopy||(l=JSON.parse(JSON.stringify(l))),c?Jy(p,l,f):p={...p,...l},kg(this.data,m,p),h.silent||this.emit("added",a,s,l)}removeResourceBundle(a,s){this.hasResourceBundle(a,s)&&delete this.data[a][s],this.removeNamespaces(s),this.emit("removed",a,s)}hasResourceBundle(a,s){return this.getResource(a,s)!==void 0}getResourceBundle(a,s){return s||(s=this.options.defaultNS),this.getResource(a,s)}getDataByLanguage(a){return this.data[a]}hasLanguageSomeTranslations(a){const s=this.getDataByLanguage(a);return!!(s&&Object.keys(s)||[]).find(c=>s[c]&&Object.keys(s[c]).length>0)}toJSON(){return this.data}}var ex={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,a,s,l,c){return n.forEach(f=>{a=this.processors[f]?.process(a,s,l,c)??a}),a}};const tx=Symbol("i18next/PATH_KEY");function uw(){const n=[],a=Object.create(null);let s;return a.get=(l,c)=>(s?.revoke?.(),c===tx?n:(n.push(c),s=Proxy.revocable(l,a),s.proxy)),Proxy.revocable(Object.create(null),a).proxy}function xd(n,a){const{[tx]:s}=n(uw());return s.join(a?.keySeparator??".")}const Tg={},$u=n=>!ke(n)&&typeof n!="boolean"&&typeof n!="number";class ur extends Ar{constructor(a,s={}){super(),JC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],a,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Hn.create("translator")}changeLanguage(a){a&&(this.language=a)}exists(a,s={interpolation:{}}){const l={...s};if(a==null)return!1;const c=this.resolve(a,l);if(c?.res===void 0)return!1;const f=$u(c.res);return!(l.returnObjects===!1&&f)}extractFromKey(a,s){let l=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;l===void 0&&(l=":");const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let f=s.ns||this.options.defaultNS||[];const h=l&&a.indexOf(l)>-1,m=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!rw(a,l,c);if(h&&!m){const p=a.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:a,namespaces:ke(f)?[f]:f};const y=a.split(l);(l!==c||l===c&&this.options.ns.indexOf(y[0])>-1)&&(f=y.shift()),a=y.join(c)}return{key:a,namespaces:ke(f)?[f]:f}}translate(a,s,l){let c=typeof s=="object"?{...s}:s;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),a==null)return"";typeof a=="function"&&(a=xd(a,{...this.options,...c})),Array.isArray(a)||(a=[String(a)]);const f=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,h=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:m,namespaces:p}=this.extractFromKey(a[a.length-1],c),y=p[p.length-1];let C=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;C===void 0&&(C=":");const x=c.lng||this.language,v=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x?.toLowerCase()==="cimode")return v?f?{res:`${y}${C}${m}`,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:y,usedParams:this.getUsedParamsDetails(c)}:`${y}${C}${m}`:f?{res:m,usedKey:m,exactUsedKey:m,usedLng:x,usedNS:y,usedParams:this.getUsedParamsDetails(c)}:m;const N=this.resolve(a,c);let w=N?.res;const M=N?.usedKey||m,E=N?.exactUsedKey||m,j=["[object Number]","[object Function]","[object RegExp]"],H=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,B=!this.i18nFormat||this.i18nFormat.handleAsObject,U=c.count!==void 0&&!ke(c.count),O=ur.hasDefaultValue(c),k=U?this.pluralResolver.getSuffix(x,c.count,c):"",z=c.ordinal&&U?this.pluralResolver.getSuffix(x,c.count,{ordinal:!1}):"",X=U&&!c.ordinal&&c.count===0,W=X&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${k}`]||c[`defaultValue${z}`]||c.defaultValue;let Q=w;B&&!w&&O&&(Q=W);const ae=$u(Q),ee=Object.prototype.toString.apply(Q);if(B&&Q&&ae&&j.indexOf(ee)<0&&!(ke(H)&&Array.isArray(Q))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ye=this.options.returnedObjectHandler?this.options.returnedObjectHandler(M,Q,{...c,ns:p}):`key '${m} (${this.language})' returned an object instead of string.`;return f?(N.res=ye,N.usedParams=this.getUsedParamsDetails(c),N):ye}if(h){const ye=Array.isArray(Q),fe=ye?[]:{},Ce=ye?E:M;for(const R in Q)if(Object.prototype.hasOwnProperty.call(Q,R)){const V=`${Ce}${h}${R}`;O&&!w?fe[R]=this.translate(V,{...c,defaultValue:$u(W)?W[R]:void 0,joinArrays:!1,ns:p}):fe[R]=this.translate(V,{...c,joinArrays:!1,ns:p}),fe[R]===V&&(fe[R]=Q[R])}w=fe}}else if(B&&ke(H)&&Array.isArray(w))w=w.join(H),w&&(w=this.extendTranslation(w,a,c,l));else{let ye=!1,fe=!1;!this.isValidLookup(w)&&O&&(ye=!0,w=W),this.isValidLookup(w)||(fe=!0,w=m);const R=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&fe?void 0:w,V=O&&W!==w&&this.options.updateMissing;if(fe||ye||V){if(this.logger.log(V?"updateKey":"missingKey",x,y,m,V?W:w),h){const ne=this.resolve(m,{...c,keySeparator:!1});ne&&ne.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ie=[];const $=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&$&&$[0])for(let ne=0;ne<$.length;ne++)ie.push($[ne]);else this.options.saveMissingTo==="all"?ie=this.languageUtils.toResolveHierarchy(c.lng||this.language):ie.push(c.lng||this.language);const se=(ne,Ne,F)=>{const J=O&&F!==w?F:R;this.options.missingKeyHandler?this.options.missingKeyHandler(ne,y,Ne,J,V,c):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ne,y,Ne,J,V,c),this.emit("missingKey",ne,y,Ne,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&U?ie.forEach(ne=>{const Ne=this.pluralResolver.getSuffixes(ne,c);X&&c[`defaultValue${this.options.pluralSeparator}zero`]&&Ne.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ne.push(`${this.options.pluralSeparator}zero`),Ne.forEach(F=>{se([ne],m+F,c[`defaultValue${F}`]||W)})}):se(ie,m,W))}w=this.extendTranslation(w,a,c,N,l),fe&&w===m&&this.options.appendNamespaceToMissingKey&&(w=`${y}${C}${m}`),(fe||ye)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${y}${C}${m}`:m,ye?w:void 0,c))}return f?(N.res=w,N.usedParams=this.getUsedParamsDetails(c),N):w}extendTranslation(a,s,l,c,f){if(this.i18nFormat?.parse)a=this.i18nFormat.parse(a,{...this.options.interpolation.defaultVariables,...l},l.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!l.skipInterpolation){l.interpolation&&this.interpolator.init({...l,interpolation:{...this.options.interpolation,...l.interpolation}});const p=ke(a)&&(l?.interpolation?.skipOnVariables!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let y;if(p){const x=a.match(this.interpolator.nestingRegexp);y=x&&x.length}let C=l.replace&&!ke(l.replace)?l.replace:l;if(this.options.interpolation.defaultVariables&&(C={...this.options.interpolation.defaultVariables,...C}),a=this.interpolator.interpolate(a,C,l.lng||this.language||c.usedLng,l),p){const x=a.match(this.interpolator.nestingRegexp),v=x&&x.length;y<v&&(l.nest=!1)}!l.lng&&c&&c.res&&(l.lng=this.language||c.usedLng),l.nest!==!1&&(a=this.interpolator.nest(a,(...x)=>f?.[0]===x[0]&&!l.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${s[0]}`),null):this.translate(...x,s),l)),l.interpolation&&this.interpolator.reset()}const h=l.postProcess||this.options.postProcess,m=ke(h)?[h]:h;return a!=null&&m?.length&&l.applyPostProcessor!==!1&&(a=ex.handle(m,a,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(l)},...l}:l,this)),a}resolve(a,s={}){let l,c,f,h,m;return ke(a)&&(a=[a]),a.forEach(p=>{if(this.isValidLookup(l))return;const y=this.extractFromKey(p,s),C=y.key;c=C;let x=y.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const v=s.count!==void 0&&!ke(s.count),N=v&&!s.ordinal&&s.count===0,w=s.context!==void 0&&(ke(s.context)||typeof s.context=="number")&&s.context!=="",M=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);x.forEach(E=>{this.isValidLookup(l)||(m=E,!Tg[`${M[0]}-${E}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(m)&&(Tg[`${M[0]}-${E}`]=!0,this.logger.warn(`key "${c}" for languages "${M.join(", ")}" won't get resolved as namespace "${m}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),M.forEach(j=>{if(this.isValidLookup(l))return;h=j;const H=[C];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(H,C,j,E,s);else{let U;v&&(U=this.pluralResolver.getSuffix(j,s.count,s));const O=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(s.ordinal&&U.indexOf(k)===0&&H.push(C+U.replace(k,this.options.pluralSeparator)),H.push(C+U),N&&H.push(C+O)),w){const z=`${C}${this.options.contextSeparator||"_"}${s.context}`;H.push(z),v&&(s.ordinal&&U.indexOf(k)===0&&H.push(z+U.replace(k,this.options.pluralSeparator)),H.push(z+U),N&&H.push(z+O))}}let B;for(;B=H.pop();)this.isValidLookup(l)||(f=B,l=this.getResource(j,E,B,s))}))})}),{res:l,usedKey:c,exactUsedKey:f,usedLng:h,usedNS:m}}isValidLookup(a){return a!==void 0&&!(!this.options.returnNull&&a===null)&&!(!this.options.returnEmptyString&&a==="")}getResource(a,s,l,c={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(a,s,l,c):this.resourceStore.getResource(a,s,l,c)}getUsedParamsDetails(a={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],l=a.replace&&!ke(a.replace);let c=l?a.replace:a;if(l&&typeof a.count<"u"&&(c.count=a.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!l){c={...c};for(const f of s)delete c[f]}return c}static hasDefaultValue(a){const s="defaultValue";for(const l in a)if(Object.prototype.hasOwnProperty.call(a,l)&&s===l.substring(0,s.length)&&a[l]!==void 0)return!0;return!1}}class jg{constructor(a){this.options=a,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Hn.create("languageUtils")}getScriptPartFromCode(a){if(a=Rs(a),!a||a.indexOf("-")<0)return null;const s=a.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(a){if(a=Rs(a),!a||a.indexOf("-")<0)return a;const s=a.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(a){if(ke(a)&&a.indexOf("-")>-1){let s;try{s=Intl.getCanonicalLocales(a)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(this.options.lowerCaseLng?a.toLowerCase():a)}return this.options.cleanCode||this.options.lowerCaseLng?a.toLowerCase():a}isSupportedCode(a){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(a=this.getLanguagePartFromCode(a)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(a)>-1}getBestMatchFromCodes(a){if(!a)return null;let s;return a.forEach(l=>{if(s)return;const c=this.formatLanguageCode(l);(!this.options.supportedLngs||this.isSupportedCode(c))&&(s=c)}),!s&&this.options.supportedLngs&&a.forEach(l=>{if(s)return;const c=this.getScriptPartFromCode(l);if(this.isSupportedCode(c))return s=c;const f=this.getLanguagePartFromCode(l);if(this.isSupportedCode(f))return s=f;s=this.options.supportedLngs.find(h=>{if(h===f)return h;if(!(h.indexOf("-")<0&&f.indexOf("-")<0)&&(h.indexOf("-")>0&&f.indexOf("-")<0&&h.substring(0,h.indexOf("-"))===f||h.indexOf(f)===0&&f.length>1))return h})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(a,s){if(!a)return[];if(typeof a=="function"&&(a=a(s)),ke(a)&&(a=[a]),Array.isArray(a))return a;if(!s)return a.default||[];let l=a[s];return l||(l=a[this.getScriptPartFromCode(s)]),l||(l=a[this.formatLanguageCode(s)]),l||(l=a[this.getLanguagePartFromCode(s)]),l||(l=a.default),l||[]}toResolveHierarchy(a,s){const l=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],a),c=[],f=h=>{h&&(this.isSupportedCode(h)?c.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return ke(a)&&(a.indexOf("-")>-1||a.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(a)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(a)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(a))):ke(a)&&f(this.formatLanguageCode(a)),l.forEach(h=>{c.indexOf(h)<0&&f(this.formatLanguageCode(h))}),c}}const Mg={zero:0,one:1,two:2,few:3,many:4,other:5},Dg={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class dw{constructor(a,s={}){this.languageUtils=a,this.options=s,this.logger=Hn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(a,s={}){const l=Rs(a==="dev"?"en":a),c=s.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:l,type:c});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let h;try{h=new Intl.PluralRules(l,{type:c})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Dg;if(!a.match(/-|_/))return Dg;const p=this.languageUtils.getLanguagePartFromCode(a);h=this.getRule(p,s)}return this.pluralRulesCache[f]=h,h}needsPlural(a,s={}){let l=this.getRule(a,s);return l||(l=this.getRule("dev",s)),l?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(a,s,l={}){return this.getSuffixes(a,l).map(c=>`${s}${c}`)}getSuffixes(a,s={}){let l=this.getRule(a,s);return l||(l=this.getRule("dev",s)),l?l.resolvedOptions().pluralCategories.sort((c,f)=>Mg[c]-Mg[f]).map(c=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(a,s,l={}){const c=this.getRule(a,l);return c?`${this.options.prepend}${l.ordinal?`ordinal${this.options.prepend}`:""}${c.select(s)}`:(this.logger.warn(`no plural rule found for: ${a}`),this.getSuffix("dev",s,l))}}const Eg=(n,a,s,l=".",c=!0)=>{let f=nw(n,a,s);return!f&&c&&ke(s)&&(f=yd(n,s,l),f===void 0&&(f=yd(a,s,l))),f},Xu=n=>n.replace(/\$/g,"$$$$");class Og{constructor(a={}){this.logger=Hn.create("interpolator"),this.options=a,this.format=a?.interpolation?.format||(s=>s),this.init(a)}init(a={}){a.interpolation||(a.interpolation={escapeValue:!0});const{escape:s,escapeValue:l,useRawValueToEscape:c,prefix:f,prefixEscaped:h,suffix:m,suffixEscaped:p,formatSeparator:y,unescapeSuffix:C,unescapePrefix:x,nestingPrefix:v,nestingPrefixEscaped:N,nestingSuffix:w,nestingSuffixEscaped:M,nestingOptionsSeparator:E,maxReplaces:j,alwaysFormat:H}=a.interpolation;this.escape=s!==void 0?s:iw,this.escapeValue=l!==void 0?l:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=f?bi(f):h||"{{",this.suffix=m?bi(m):p||"}}",this.formatSeparator=y||",",this.unescapePrefix=C?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":C||"",this.nestingPrefix=v?bi(v):N||bi("$t("),this.nestingSuffix=w?bi(w):M||bi(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=j||1e3,this.alwaysFormat=H!==void 0?H:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const a=(s,l)=>s?.source===l?(s.lastIndex=0,s):new RegExp(l,"g");this.regexp=a(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=a(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=a(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(a,s,l,c){let f,h,m;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},y=N=>{if(N.indexOf(this.formatSeparator)<0){const j=Eg(s,p,N,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(j,void 0,l,{...c,...s,interpolationkey:N}):j}const w=N.split(this.formatSeparator),M=w.shift().trim(),E=w.join(this.formatSeparator).trim();return this.format(Eg(s,p,M,this.options.keySeparator,this.options.ignoreJSONStructure),E,l,{...c,...s,interpolationkey:M})};this.resetRegExp();const C=c?.missingInterpolationHandler||this.options.missingInterpolationHandler,x=c?.interpolation?.skipOnVariables!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:N=>Xu(N)},{regex:this.regexp,safeValue:N=>this.escapeValue?Xu(this.escape(N)):Xu(N)}].forEach(N=>{for(m=0;f=N.regex.exec(a);){const w=f[1].trim();if(h=y(w),h===void 0)if(typeof C=="function"){const E=C(a,f,c);h=ke(E)?E:""}else if(c&&Object.prototype.hasOwnProperty.call(c,w))h="";else if(x){h=f[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${a}`),h="";else!ke(h)&&!this.useRawValueToEscape&&(h=Cg(h));const M=N.safeValue(h);if(a=a.replace(f[0],M),x?(N.regex.lastIndex+=h.length,N.regex.lastIndex-=f[0].length):N.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),a}nest(a,s,l={}){let c,f,h;const m=(p,y)=>{const C=this.nestingOptionsSeparator;if(p.indexOf(C)<0)return p;const x=p.split(new RegExp(`${bi(C)}[ ]*{`));let v=`{${x[1]}`;p=x[0],v=this.interpolate(v,h);const N=v.match(/'/g),w=v.match(/"/g);((N?.length??0)%2===0&&!w||(w?.length??0)%2!==0)&&(v=v.replace(/'/g,'"'));try{h=JSON.parse(v),y&&(h={...y,...h})}catch(M){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,M),`${p}${C}${v}`}return h.defaultValue&&h.defaultValue.indexOf(this.prefix)>-1&&delete h.defaultValue,p};for(;c=this.nestingRegexp.exec(a);){let p=[];h={...l},h=h.replace&&!ke(h.replace)?h.replace:h,h.applyPostProcessor=!1,delete h.defaultValue;const y=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(y!==-1&&(p=c[1].slice(y).split(this.formatSeparator).map(C=>C.trim()).filter(Boolean),c[1]=c[1].slice(0,y)),f=s(m.call(this,c[1].trim(),h),h),f&&c[0]===a&&!ke(f))return f;ke(f)||(f=Cg(f)),f||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${a}`),f=""),p.length&&(f=p.reduce((C,x)=>this.format(C,x,l.lng,{...l,interpolationkey:c[1].trim()}),f.trim())),a=a.replace(c[0],f),this.regexp.lastIndex=0}return a}}const fw=n=>{let a=n.toLowerCase().trim();const s={};if(n.indexOf("(")>-1){const l=n.split("(");a=l[0].toLowerCase().trim();const c=l[1].substring(0,l[1].length-1);a==="currency"&&c.indexOf(":")<0?s.currency||(s.currency=c.trim()):a==="relativetime"&&c.indexOf(":")<0?s.range||(s.range=c.trim()):c.split(";").forEach(h=>{if(h){const[m,...p]=h.split(":"),y=p.join(":").trim().replace(/^'+|'+$/g,""),C=m.trim();s[C]||(s[C]=y),y==="false"&&(s[C]=!1),y==="true"&&(s[C]=!0),isNaN(y)||(s[C]=parseInt(y,10))}})}return{formatName:a,formatOptions:s}},Rg=n=>{const a={};return(s,l,c)=>{let f=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(f={...f,[c.interpolationkey]:void 0});const h=l+JSON.stringify(f);let m=a[h];return m||(m=n(Rs(l),c),a[h]=m),m(s)}},hw=n=>(a,s,l)=>n(Rs(s),l)(a);class mw{constructor(a={}){this.logger=Hn.create("formatter"),this.options=a,this.init(a)}init(a,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const l=s.cacheInBuiltFormats?Rg:hw;this.formats={number:l((c,f)=>{const h=new Intl.NumberFormat(c,{...f});return m=>h.format(m)}),currency:l((c,f)=>{const h=new Intl.NumberFormat(c,{...f,style:"currency"});return m=>h.format(m)}),datetime:l((c,f)=>{const h=new Intl.DateTimeFormat(c,{...f});return m=>h.format(m)}),relativetime:l((c,f)=>{const h=new Intl.RelativeTimeFormat(c,{...f});return m=>h.format(m,f.range||"day")}),list:l((c,f)=>{const h=new Intl.ListFormat(c,{...f});return m=>h.format(m)})}}add(a,s){this.formats[a.toLowerCase().trim()]=s}addCached(a,s){this.formats[a.toLowerCase().trim()]=Rg(s)}format(a,s,l,c={}){const f=s.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(m=>m.indexOf(")")>-1)){const m=f.findIndex(p=>p.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,m)].join(this.formatSeparator)}return f.reduce((m,p)=>{const{formatName:y,formatOptions:C}=fw(p);if(this.formats[y]){let x=m;try{const v=c?.formatParams?.[c.interpolationkey]||{},N=v.locale||v.lng||c.locale||c.lng||l;x=this.formats[y](m,N,{...C,...c,...v})}catch(v){this.logger.warn(v)}return x}else this.logger.warn(`there was no format function for ${y}`);return m},a)}}const pw=(n,a)=>{n.pending[a]!==void 0&&(delete n.pending[a],n.pendingCount--)};class gw extends Ar{constructor(a,s,l,c={}){super(),this.backend=a,this.store=s,this.services=l,this.languageUtils=l.languageUtils,this.options=c,this.logger=Hn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(l,c.backend,c)}queueLoad(a,s,l,c){const f={},h={},m={},p={};return a.forEach(y=>{let C=!0;s.forEach(x=>{const v=`${y}|${x}`;!l.reload&&this.store.hasResourceBundle(y,x)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?h[v]===void 0&&(h[v]=!0):(this.state[v]=1,C=!1,h[v]===void 0&&(h[v]=!0),f[v]===void 0&&(f[v]=!0),p[x]===void 0&&(p[x]=!0)))}),C||(m[y]=!0)}),(Object.keys(f).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(f),pending:Object.keys(h),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(p)}}loaded(a,s,l){const c=a.split("|"),f=c[0],h=c[1];s&&this.emit("failedLoading",f,h,s),!s&&l&&this.store.addResourceBundle(f,h,l,void 0,void 0,{skipCopy:!0}),this.state[a]=s?-1:2,s&&l&&(this.state[a]=0);const m={};this.queue.forEach(p=>{tw(p.loaded,[f],h),pw(p,a),s&&p.errors.push(s),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(y=>{m[y]||(m[y]={});const C=p.loaded[y];C.length&&C.forEach(x=>{m[y][x]===void 0&&(m[y][x]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(p=>!p.done)}read(a,s,l,c=0,f=this.retryTimeout,h){if(!a.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:a,ns:s,fcName:l,tried:c,wait:f,callback:h});return}this.readingCalls++;const m=(y,C)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(y&&C&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,a,s,l,c+1,f*2,h)},f);return}h(y,C)},p=this.backend[l].bind(this.backend);if(p.length===2){try{const y=p(a,s);y&&typeof y.then=="function"?y.then(C=>m(null,C)).catch(m):m(null,y)}catch(y){m(y)}return}return p(a,s,m)}prepareLoading(a,s,l={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();ke(a)&&(a=this.languageUtils.toResolveHierarchy(a)),ke(s)&&(s=[s]);const f=this.queueLoad(a,s,l,c);if(!f.toLoad.length)return f.pending.length||c(),null;f.toLoad.forEach(h=>{this.loadOne(h)})}load(a,s,l){this.prepareLoading(a,s,{},l)}reload(a,s,l){this.prepareLoading(a,s,{reload:!0},l)}loadOne(a,s=""){const l=a.split("|"),c=l[0],f=l[1];this.read(c,f,"read",void 0,void 0,(h,m)=>{h&&this.logger.warn(`${s}loading namespace ${f} for language ${c} failed`,h),!h&&m&&this.logger.log(`${s}loaded namespace ${f} for language ${c}`,m),this.loaded(a,h,m)})}saveMissing(a,s,l,c,f,h={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${l}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(l==null||l==="")){if(this.backend?.create){const p={...h,isUpdate:f},y=this.backend.create.bind(this.backend);if(y.length<6)try{let C;y.length===5?C=y(a,s,l,c,p):C=y(a,s,l,c),C&&typeof C.then=="function"?C.then(x=>m(null,x)).catch(m):m(null,C)}catch(C){m(C)}else y(a,s,l,c,m,p)}!a||!a[0]||this.store.addResource(a[0],s,l,c)}}}const Zu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let a={};if(typeof n[1]=="object"&&(a=n[1]),ke(n[1])&&(a.defaultValue=n[1]),ke(n[2])&&(a.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const s=n[3]||n[2];Object.keys(s).forEach(l=>{a[l]=s[l]})}return a},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Pg=n=>(ke(n.ns)&&(n.ns=[n.ns]),ke(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),ke(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),Zl=()=>{},yw=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(s=>{typeof n[s]=="function"&&(n[s]=n[s].bind(n))})},nx="__i18next_supportNoticeShown",xw=()=>typeof globalThis<"u"&&!!globalThis[nx],bw=()=>{typeof globalThis<"u"&&(globalThis[nx]=!0)},vw=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(a=>a?.name?.indexOf("Locize")>0||a?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(a=>a?.projectId));class js extends Ar{constructor(a={},s){if(super(),this.options=Pg(a),this.services={},this.logger=Hn,this.modules={external:[]},yw(this),s&&!this.isInitialized&&!a.isClone){if(!this.options.initAsync)return this.init(a,s),this;setTimeout(()=>{this.init(a,s)},0)}}init(a={},s){this.isInitializing=!0,typeof a=="function"&&(s=a,a={}),a.defaultNS==null&&a.ns&&(ke(a.ns)?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));const l=Zu();this.options={...l,...this.options,...Pg(a)},this.options.interpolation={...l.interpolation,...this.options.interpolation},a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=l.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!vw(this)&&!xw()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),bw());const c=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?Hn.init(c(this.modules.logger),this.options):Hn.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=mw;const C=new jg(this.options);this.store=new Ag(this.options.resources,this.options);const x=this.services;x.logger=Hn,x.resourceStore=this.store,x.languageUtils=C,x.pluralResolver=new dw(C,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==l.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),y&&(!this.options.interpolation.format||this.options.interpolation.format===l.interpolation.format)&&(x.formatter=c(y),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new Og(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new gw(c(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(N,...w)=>{this.emit(N,...w)}),this.modules.languageDetector&&(x.languageDetector=c(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=c(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new ur(this.services,this.options),this.translator.on("*",(N,...w)=>{this.emit(N,...w)}),this.modules.external.forEach(N=>{N.init&&N.init(this)})}if(this.format=this.options.interpolation.format,s||(s=Zl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(y=>{this[y]=(...C)=>this.store[y](...C)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=(...C)=>(this.store[y](...C),this)});const m=vs(),p=()=>{const y=(C,x)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),m.resolve(x),s(C,x)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),m}loadResources(a,s=Zl){let l=s;const c=ke(a)?a:this.language;if(typeof a=="function"&&(l=a),!this.options.resources||this.options.partialBundledLanguages){if(c?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return l();const f=[],h=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(y=>{y!=="cimode"&&f.indexOf(y)<0&&f.push(y)})};c?h(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>h(p)),this.options.preload?.forEach?.(m=>h(m)),this.services.backendConnector.load(f,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),l(m)})}else l(null)}reloadResources(a,s,l){const c=vs();return typeof a=="function"&&(l=a,a=void 0),typeof s=="function"&&(l=s,s=void 0),a||(a=this.languages),s||(s=this.options.ns),l||(l=Zl),this.services.backendConnector.reload(a,s,f=>{c.resolve(),l(f)}),c}use(a){if(!a)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!a.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return a.type==="backend"&&(this.modules.backend=a),(a.type==="logger"||a.log&&a.warn&&a.error)&&(this.modules.logger=a),a.type==="languageDetector"&&(this.modules.languageDetector=a),a.type==="i18nFormat"&&(this.modules.i18nFormat=a),a.type==="postProcessor"&&ex.addPostProcessor(a),a.type==="formatter"&&(this.modules.formatter=a),a.type==="3rdParty"&&this.modules.external.push(a),this}setResolvedLanguage(a){if(!(!a||!this.languages)&&!(["cimode","dev"].indexOf(a)>-1)){for(let s=0;s<this.languages.length;s++){const l=this.languages[s];if(!(["cimode","dev"].indexOf(l)>-1)&&this.store.hasLanguageSomeTranslations(l)){this.resolvedLanguage=l;break}}!this.resolvedLanguage&&this.languages.indexOf(a)<0&&this.store.hasLanguageSomeTranslations(a)&&(this.resolvedLanguage=a,this.languages.unshift(a))}}changeLanguage(a,s){this.isLanguageChangingTo=a;const l=vs();this.emit("languageChanging",a);const c=m=>{this.language=m,this.languages=this.services.languageUtils.toResolveHierarchy(m),this.resolvedLanguage=void 0,this.setResolvedLanguage(m)},f=(m,p)=>{p?this.isLanguageChangingTo===a&&(c(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,l.resolve((...y)=>this.t(...y)),s&&s(m,(...y)=>this.t(...y))},h=m=>{!a&&!m&&this.services.languageDetector&&(m=[]);const p=ke(m)?m:m&&m[0],y=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(ke(m)?[m]:m);y&&(this.language||c(y),this.translator.language||this.translator.changeLanguage(y),this.services.languageDetector?.cacheUserLanguage?.(y)),this.loadResources(y,C=>{f(C,y)})};return!a&&this.services.languageDetector&&!this.services.languageDetector.async?h(this.services.languageDetector.detect()):!a&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(h):this.services.languageDetector.detect(h):h(a),l}getFixedT(a,s,l){const c=(f,h,...m)=>{let p;typeof h!="object"?p=this.options.overloadTranslationOptionHandler([f,h].concat(m)):p={...h},p.lng=p.lng||c.lng,p.lngs=p.lngs||c.lngs,p.ns=p.ns||c.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||l||c.keyPrefix);const y=this.options.keySeparator||".";let C;return p.keyPrefix&&Array.isArray(f)?C=f.map(x=>(typeof x=="function"&&(x=xd(x,{...this.options,...h})),`${p.keyPrefix}${y}${x}`)):(typeof f=="function"&&(f=xd(f,{...this.options,...h})),C=p.keyPrefix?`${p.keyPrefix}${y}${f}`:f),this.t(C,p)};return ke(a)?c.lng=a:c.lngs=a,c.ns=s,c.keyPrefix=l,c}t(...a){return this.translator?.translate(...a)}exists(...a){return this.translator?.exists(...a)}setDefaultNamespace(a){this.options.defaultNS=a}hasLoadedNamespace(a,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const l=s.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(l.toLowerCase()==="cimode")return!0;const h=(m,p)=>{const y=this.services.backendConnector.state[`${m}|${p}`];return y===-1||y===0||y===2};if(s.precheck){const m=s.precheck(this,h);if(m!==void 0)return m}return!!(this.hasResourceBundle(l,a)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(l,a)&&(!c||h(f,a)))}loadNamespaces(a,s){const l=vs();return this.options.ns?(ke(a)&&(a=[a]),a.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{l.resolve(),s&&s(c)}),l):(s&&s(),Promise.resolve())}loadLanguages(a,s){const l=vs();ke(a)&&(a=[a]);const c=this.options.preload||[],f=a.filter(h=>c.indexOf(h)<0&&this.services.languageUtils.isSupportedCode(h));return f.length?(this.options.preload=c.concat(f),this.loadResources(h=>{l.resolve(),s&&s(h)}),l):(s&&s(),Promise.resolve())}dir(a){if(a||(a=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!a)return"rtl";try{const c=new Intl.Locale(a);if(c&&c.getTextInfo){const f=c.getTextInfo();if(f&&f.direction)return f.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],l=this.services?.languageUtils||new jg(Zu());return a.toLowerCase().indexOf("-latn")>1?"ltr":s.indexOf(l.getLanguagePartFromCode(a))>-1||a.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(a={},s){const l=new js(a,s);return l.createInstance=js.createInstance,l}cloneInstance(a={},s=Zl){const l=a.forkResourceStore;l&&delete a.forkResourceStore;const c={...this.options,...a,isClone:!0},f=new js(c);if((a.debug!==void 0||a.prefix!==void 0)&&(f.logger=f.logger.clone(a)),["store","services","language"].forEach(m=>{f[m]=this[m]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},l){const m=Object.keys(this.store.data).reduce((p,y)=>(p[y]={...this.store.data[y]},p[y]=Object.keys(p[y]).reduce((C,x)=>(C[x]={...p[y][x]},C),p[y]),p),{});f.store=new Ag(m,c),f.services.resourceStore=f.store}if(a.interpolation){const p={...Zu().interpolation,...this.options.interpolation,...a.interpolation},y={...c,interpolation:p};f.services.interpolator=new Og(y)}return f.translator=new ur(f.services,c),f.translator.on("*",(m,...p)=>{f.emit(m,...p)}),f.init(c,s),f.translator.options=c,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const He=js.createInstance();He.createInstance;He.dir;He.init;He.loadResources;He.reloadResources;He.use;He.changeLanguage;He.getFixedT;He.t;He.exists;He.setDefaultNamespace;He.hasLoadedNamespace;He.loadNamespaces;He.loadLanguages;const Sw=(n,a,s,l)=>{const c=[s,{code:a,...l||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(c,"warn","react-i18next::",!0);Ni(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...c):console?.warn&&console.warn(...c)},Lg={},ax=(n,a,s,l)=>{Ni(s)&&Lg[s]||(Ni(s)&&(Lg[s]=new Date),Sw(n,a,s,l))},ix=(n,a)=>()=>{if(n.isInitialized)a();else{const s=()=>{setTimeout(()=>{n.off("initialized",s)},0),a()};n.on("initialized",s)}},bd=(n,a,s)=>{n.loadNamespaces(a,ix(n,s))},_g=(n,a,s,l)=>{if(Ni(s)&&(s=[s]),n.options.preload&&n.options.preload.indexOf(a)>-1)return bd(n,s,l);s.forEach(c=>{n.options.ns.indexOf(c)<0&&n.options.ns.push(c)}),n.loadLanguages(a,ix(n,l))},Cw=(n,a,s={})=>!a.languages||!a.languages.length?(ax(a,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:a.languages}),!0):a.hasLoadedNamespace(n,{lng:s.lng,precheck:(l,c)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&l.services.backendConnector.backend&&l.isLanguageChangingTo&&!c(l.isLanguageChangingTo,n))return!1}}),Ni=n=>typeof n=="string",ww=n=>typeof n=="object"&&n!==null,Nw=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,kw={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Aw=n=>kw[n],Tw=n=>n.replace(Nw,Aw);let vd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Tw,transDefaultProps:void 0};const jw=(n={})=>{vd={...vd,...n}},Mw=()=>vd;let ox;const Dw=n=>{ox=n},Ew=()=>ox,Ow={type:"3rdParty",init(n){jw(n.options.react),Dw(n)}},Rw=S.createContext();class Pw{constructor(){this.usedNamespaces={}}addUsedNamespaces(a){a.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Ju={exports:{}},ed={};var zg;function Lw(){if(zg)return ed;zg=1;var n=Md();function a(x,v){return x===v&&(x!==0||1/x===1/v)||x!==x&&v!==v}var s=typeof Object.is=="function"?Object.is:a,l=n.useState,c=n.useEffect,f=n.useLayoutEffect,h=n.useDebugValue;function m(x,v){var N=v(),w=l({inst:{value:N,getSnapshot:v}}),M=w[0].inst,E=w[1];return f(function(){M.value=N,M.getSnapshot=v,p(M)&&E({inst:M})},[x,N,v]),c(function(){return p(M)&&E({inst:M}),x(function(){p(M)&&E({inst:M})})},[x]),h(N),N}function p(x){var v=x.getSnapshot;x=x.value;try{var N=v();return!s(x,N)}catch{return!0}}function y(x,v){return v()}var C=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:m;return ed.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:C,ed}var Ug;function _w(){return Ug||(Ug=1,Ju.exports=Lw()),Ju.exports}var zw=_w();const Uw=(n,a)=>Ni(a)?a:ww(a)&&Ni(a.defaultValue)?a.defaultValue:Array.isArray(n)?n[n.length-1]:n,Iw={t:Uw,ready:!1},Hw=()=>()=>{},_t=(n,a={})=>{const{i18n:s}=a,{i18n:l,defaultNS:c}=S.useContext(Rw)||{},f=s||l||Ew();f&&!f.reportNamespaces&&(f.reportNamespaces=new Pw),f||ax(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const h=S.useMemo(()=>({...Mw(),...f?.options?.react,...a}),[f,a]),{useSuspense:m,keyPrefix:p}=h,y=c||f?.options?.defaultNS,C=Ni(y)?[y]:y||["translation"],x=S.useMemo(()=>C,C);f?.reportNamespaces?.addUsedNamespaces?.(x);const v=S.useRef(0),N=S.useCallback(W=>{if(!f)return Hw;const{bindI18n:Q,bindI18nStore:ae}=h,ee=()=>{v.current+=1,W()};return Q&&f.on(Q,ee),ae&&f.store.on(ae,ee),()=>{Q&&Q.split(" ").forEach(ye=>f.off(ye,ee)),ae&&ae.split(" ").forEach(ye=>f.store.off(ye,ee))}},[f,h]),w=S.useRef(),M=S.useCallback(()=>{if(!f)return Iw;const W=!!(f.isInitialized||f.initializedStoreOnce)&&x.every(Ce=>Cw(Ce,f,h)),Q=a.lng||f.language,ae=v.current,ee=w.current;if(ee&&ee.ready===W&&ee.lng===Q&&ee.keyPrefix===p&&ee.revision===ae)return ee;const fe={t:f.getFixedT(Q,h.nsMode==="fallback"?x:x[0],p),ready:W,lng:Q,keyPrefix:p,revision:ae};return w.current=fe,fe},[f,x,p,h,a.lng]),[E,j]=S.useState(0),{t:H,ready:B}=zw.useSyncExternalStore(N,M,M);S.useEffect(()=>{if(f&&!B&&!m){const W=()=>j(Q=>Q+1);a.lng?_g(f,a.lng,x,W):bd(f,x,W)}},[f,a.lng,x,B,m,E]);const U=f||{},O=S.useRef(null),k=S.useRef(),z=W=>{const Q=Object.getOwnPropertyDescriptors(W);Q.__original&&delete Q.__original;const ae=Object.create(Object.getPrototypeOf(W),Q);if(!Object.prototype.hasOwnProperty.call(ae,"__original"))try{Object.defineProperty(ae,"__original",{value:W,writable:!1,enumerable:!1,configurable:!1})}catch{}return ae},X=S.useMemo(()=>{const W=U,Q=W?.language;let ae=W;W&&(O.current&&O.current.__original===W?k.current!==Q?(ae=z(W),O.current=ae,k.current=Q):ae=O.current:(ae=z(W),O.current=ae,k.current=Q));const ee=[H,ae,B];return ee.t=H,ee.i18n=ae,ee.ready=B,ee},[H,U,B,U.resolvedLanguage,U.language,U.languages]);if(f&&m&&!B)throw new Promise(W=>{const Q=()=>W();a.lng?_g(f,a.lng,x,Q):bd(f,x,Q)});return X},sx="ccs-ui-locale",Bw=["en","zh-CN","vi"];function zs(n){return n?n.toLowerCase().startsWith("zh")?"zh-CN":n.toLowerCase().startsWith("vi")?"vi":"en":"en"}function lx(){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(sx);return n?zs(n):null}catch{return null}}function Kw(){const n=lx();return n||(typeof navigator<"u"?zs(navigator.language):"en")}function Ld(n){const a=lx();return a||(typeof navigator<"u"?zs(navigator.language):"en")}function qw(n){const a=zs(n);if(typeof window<"u")try{window.localStorage.setItem(sx,a)}catch{}return a}const Gw={en:{translation:{locale:{en:"English","zh-CN":"Simplified Chinese",vi:"Vietnamese"},layout:{languageSwitcher:"Language"},nav:{general:"General",home:"Home",analytics:"Analytics",identityAccess:"Identity & Access",apiProfiles:"API Profiles",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Overview",controlPanel:"Control Panel",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",accounts:"Accounts",allAccounts:"All Accounts",sharedData:"Shared Data",compatibleClis:"Compatible CLIs",factoryDroid:"Factory Droid",system:"System",health:"Health",settings:"Settings",openrouterTooltip:"Featured: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"Profiles",cliproxy:"CLIProxy",accounts:"Accounts",health:"Health",configurationRequired:"Configuration Required"},auth:{dashboardTitle:"CCS Dashboard",loginDescription:"Enter your credentials to access the dashboard",username:"Username",password:"Password",usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",signIn:"Sign In",signingIn:"Signing in...",loginFailed:"Login failed"},commonToast:{apiKeyRequired:"API key is required",accountAddedPresetFailed:"Account added, but failed to apply default preset",settingsCopied:"Settings copied to clipboard",enterPresetName:"Please enter a preset name to save",codeCopied:"Code copied to clipboard",copyCodeFailed:"Failed to copy code",appliedModelAllTiers:"Applied model to all tiers",settingsSaved:"Settings saved",defaultTargetUpdated:"Default target updated",failedUpdateDefaultTarget:"Failed to update default target to {{target}}{{suffix}}"},profileDialog:{editTitle:"Edit Profile",createTitle:"Create API Profile",name:"Name",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"Default Model (ANTHROPIC_MODEL)",defaultModelHint:"Leave blank to use: {{model}}",modelMappingTitle:"Model Mapping (Opus/Sonnet/Haiku)",modelMappingDesc:"Configure different model IDs for each tier. Useful for API proxies that route different model types to different backends.",opusModel:"Opus Model (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet Model (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku Model (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Cancel",saving:"Saving...",update:"Update",create:"Create"},modelTierMapping:{title:"Model Tier Mapping",advanced:"Advanced",description:"Configure different models for Claude Code's opus/sonnet/haiku tiers.",autoSuggest:"Auto-suggest based on {{provider}}",opusPlaceholder:"e.g., anthropic/claude-opus-4",sonnetPlaceholder:"e.g., anthropic/claude-sonnet-4",haikuPlaceholder:"e.g., anthropic/claude-3.5-haiku",footer:"These set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"sensitive",none:"No environment variables configured.",noneHint:"Add variables using the input below or edit the JSON directly.",addVariable:"Add Environment Variable",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"Using:",variantNameRequired:"Variant Name *",variantNamePlaceholder:"e.g., my-gemini, g3, flash",invokeHintPrefix:"Use this name to invoke:",model:"Model",modelPlaceholder:"e.g., gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"Choose from presets instead",selectModel:"Select a model",customModelName:"Custom model name...",enterAnyModel:"Enter any model name supported by CLIProxy",defaultModel:"Default: {{model}}",providerDefault:"provider default",back:"Back",skip:"Skip",creating:"Creating...",createVariant:"Create Variant",skipHint:"Skip if you just wanted to add an account without creating a variant"},customPresetDialog:{title:"Custom Preset",presetNameOptional:"Preset Name (optional)",presetNamePlaceholder:"e.g., My Custom Config",codexTipPrefix:"Codex tip: suffixes",codexTipSuffix:"pin effort. Unsuffixed models use Thinking settings.",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested",opusModel:"Opus (Most capable)",opusModelDesc:"For complex reasoning tasks",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"Balance of speed and capability",haikuModel:"Haiku (Fast)",haikuModelDesc:"Quick responses for simple tasks",cancel:"Cancel",savePreset:"Save Preset",applyPreset:"Apply Preset"},componentModelSelector:{selectModel:"Select model",availableModelsCount:"Available Models ({{count}})",preview:"Preview"},copilotSettings:{enableCopilot:"Enable Copilot",enableCopilotDesc:"Allow using GitHub Copilot subscription",basicSettings:"Basic Settings",accountType:"Account Type",accountTypeIndividual:"Individual",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Rate Limiting",rateLimitSeconds:"Rate Limit (seconds)",noLimit:"No limit",waitOnRateLimit:"Wait on Rate Limit",waitOnRateLimitDesc:"Wait instead of error when limit hit",daemonSettings:"Daemon Settings",autoStartDaemon:"Auto-start Daemon",autoStartDaemonDesc:"Start copilot-api when using profile"},providerModelSelector:{selectModel:"Select model",noModelsForProvider:"No models available for this provider",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Free Tier",paidTier:"Paid Tier",modelKnownIssues:"This model has known issues",viewIssueDetails:"View issue details",modelDeprecated:"This model is deprecated",recommended:"Recommended",allModelsCount:"All Models ({{count}})",noModelsAvailable:"No models available"},createAuthProfileDialog:{title:"Create New Account",description:"Auth profiles require Claude CLI login. Run the command below in your terminal. You can edit sync mode, group, and continuity depth later from the Accounts table.",profileName:"Profile Name",profileNamePlaceholder:"e.g., work, personal, client",invalidProfileName:"Name must start with a letter and contain only letters, numbers, dashes, or underscores.",enableSharedHistory:"Enable shared history sync with other ccs auth accounts",historySyncGroupOptional:"History Sync Group (optional)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Leave empty to use the default shared group. Spaces are normalized to dashes.",deeperContinuity:"Advanced: deeper continuity mode",deeperContinuityHint:"Adds sync for session-env, file-history, shell-snapshots, and todos. Credentials stay isolated.",invalidContextGroup:"Group must start with a letter and use only letters, numbers, dashes, or underscores (max {{max}} chars).",command:"Command",commandFallback:"ccs auth create <name>",afterRunPrefix:"After running the command:",afterRunStep1:"Complete the Claude login in your browser",afterRunStep2:"Return here and refresh to see the new account",poolingHint:"Prefer pooled Claude OAuth routing instead? Use CLIProxy Claude pool from the Accounts page action button.",close:"Close",copied:"Copied!",copyCommand:"Copy Command"},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Other"},cliproxyOverviewComponents:{availableModels:"Available Models",noModelsAvailable:"No models available",startSessionHint:"Start a CLIProxy session to fetch available models",totalCount:"{{count}} total",availableThroughGroupedByProvider:"Models available through {{backendLabel}}, grouped by provider",moreCount:"+{{count}} more"},categorizedModelSelector:{selectModel:"Select a model",noModelsAvailable:"No models available",modelPlaceholder:"Model..."},openrouterQuickStart:{recommended:"Recommended",title:"Start with OpenRouter",description:"Access {{modelCountLabel}} models from OpenAI, Anthropic, Google, Meta and more - all through one API.",featureOneApi:"One API, all providers",featureTierMapping:"Model tier mapping",createOpenRouterProfile:"Create OpenRouter Profile",getApiKeyAt:"Get your API key at",or:"or",createCustomProfile:"Create Custom API Profile"},alibabaCodingPlanQuickStart:{recommended:"Recommended",title:"Try Alibaba Coding Plan",description:"Use Alibaba Cloud Coding Plan through an Anthropic-compatible endpoint for coding workloads.",featureEndpoint:"Anthropic-compatible endpoint",featureKeyFormat:"Dedicated sk-sp API keys",createAlibabaProfile:"Create Alibaba Coding Plan Profile",readGuideAt:"Read setup guide at"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan via Anthropic endpoint",add:"Add"},credentialHealth:{title:"Credential Health",ready:"Ready",noCredentialsConfigured:"No credentials configured. Use the login buttons above to authenticate.",neverUsed:"Never used",justNow:"Just now",unknown:"Unknown",daysAgo:"{{count}}d ago",hoursAgo:"{{count}}h ago",minutesAgo:"{{count}}m ago"},proxyStatusWidget:{justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",syncReady:"Sync Ready",noConfig:"No Config",remoteProxy:"Remote Proxy",active:"Active",trafficAutoRouted:"Traffic auto-routed to remote server",tooltipSync:"Sync profiles to CLIProxy",tooltipRestart:"Restart",tooltipStop:"Stop",tooltipClose:"Close",tooltipVersionSettings:"Version settings",versionManagement:"Version Management",selectVersionPlaceholder:"Select version to install...",stable:"(stable)",install:"Install",versionsAboveUnstable:"Versions above {{version}} have known issues",versionsKnownIssues:"Version {{version}} has known issues",lastChecked:"Last checked {{time}}",notRunning:"Not running",start:"Start",port:"Port {{port}}",sessionCount:"{{count}} session",sessionCount_other:"{{count}} sessions",installFaultyTitle:"Install Version With Known Issues?",installFaultyDesc:"You are about to install <strong>v{{version}}</strong>, which falls inside the known faulty range <strong>{{range}}</strong>.",installFaultyWarning:"This version has known bugs and may fail or leave the proxy in a bad state.",installUnstableTitle:"Install Unstable Version?",installUnstableDesc:"You are about to install <strong>v{{version}}</strong>, which is above the maximum stable version <strong>v{{maxStable}}</strong>.",installUnstableWarning:"This version has known stability issues and may cause unexpected behavior.",installUnstableConfirm:"Are you sure you want to proceed?",cancel:"Cancel",installAnyway:"Install Anyway",clickToDowngrade:"Click to downgrade",clickToUpdate:"Click to update"},syncStatusCard:{profileSync:"Profile Sync",ready:"Ready",noConfig:"No Config",syncsProfilesDesc:"Syncs API profiles to local CLIProxy config",runDoctorHint:"Run <code>ccs doctor --fix</code> to generate config.",details:"Details",syncNow:"Sync Now"},syncDialog:{title:"Sync Profiles to Local CLIProxy",description:"Sync your CCS API profiles to the local CLIProxy config.yaml.",noProfiles:"No profiles configured to sync.",createProfilesFirst:"Create API profiles first using the Profiles tab.",modelLabel:"Model:",ready:"Ready",profilesToSync_one:"{{count}} profile to sync",profilesToSync_other:"{{count}} profiles to sync",cancel:"Cancel",syncing:"Syncing...",synced:"Synced!",syncNow:"Sync Now"},errorLogs:{title:"Error Logs",failedRequests_one:"{{count}} failed request",failedRequests_other:"{{count}} failed requests",cliproxyDiagnostics:"CLIProxy Diagnostics",showingCount:"Showing 50 of {{total}} logs",selectLog:"Select a log to view details",failedLoadContent:"Failed to load log content",copyAbsolutePath:"Copy absolute path",copyRawContent:"Copy raw log content",tabOverview:"Overview",tabHeaders:"Headers",tabRequest:"Request",tabResponse:"Response",tabRaw:"Raw",modelLabel:"Model:",quotaResetsIn:"Quota resets in ",method:"Method",provider:"Provider",version:"Version",endpoint:"Endpoint",url:"URL",timestamp:"Timestamp",na:"N/A",noHeaders:"No headers available",noRequestBody:"No request body",noResponseBody:"No response body",rateLimitedMsg:"Rate Limited. Switch to a different account or wait for quota reset. Model {{model}} has exhausted quota.",rateLimitedMsgNoModel:"Rate Limited. Switch to a different account or wait for quota reset.",authFailedMsg:"Authentication failed. Re-authenticate via CLIProxy Settings or check API key.",notFoundMsg:"Endpoint not found. This endpoint may not exist on this provider.",serverErrorMsg:"Server error from upstream. Retry later or check provider status page.",timeoutMsg:"Request timed out. Check network connection or increase timeout settings.",unknown:"unknown"},editAccountContext:{title:"Edit History Sync",description:'Configure how "{{name}}" shares history and continuity with other ccs auth accounts.',syncMode:"Sync Mode",selectContextMode:"Select context mode",isolatedOption:"isolated (no sync)",sharedOption:"shared (sync enabled)",sharedModeHint:"Shared mode reuses workspace context for accounts in the same history sync group.",isolatedModeHint:"Isolated mode keeps this account fully separate from other ccs auth accounts.",historySyncGroup:"History Sync Group",groupPlaceholder:"default",groupHint:"Normalized to lowercase (spaces become dashes). Allowed: letters, numbers, _ , - (max {{max}} chars).",invalidGroup:"Enter a valid group name that starts with a letter.",continuityDepth:"Continuity Depth",selectContinuityDepth:"Select continuity depth",standardOption:"standard (projects only)",deeperOption:"deeper continuity (advanced)",deeperHint:"Advanced mode also syncs session-env, file-history, shell-snapshots, and todos.",standardHint:"Standard mode syncs project workspace context only.",credentialsIsolated:"Credentials and .anthropic remain isolated per account in all modes.",cancel:"Cancel",save:"Save",saving:"Saving..."},historySyncLearningMap:{title:"How History Sync Works",description:"Isolated -> Shared -> Deeper. Use Sync per row for all changes.",learningMap:"Learning Map",isolated:"Isolated",shared:"Shared",deeper:"Deeper",cliproxyManaged_one:"{{count}} CLIProxy Claude pool account is managed in Action Center / CLIProxy page.",cliproxyManaged_other:"{{count}} CLIProxy Claude pool accounts are managed in Action Center / CLIProxy page.",showDetails:"Show details: groups, switching, and legacy policy",modeSwitch:"Mode Switch",modeSwitchDesc:"Sync dialog lets users move between isolated/shared and choose deeper continuity.",historySyncGroup:"History Sync Group",historySyncGroupDesc:"Same group means shared project context lane. Default fallback is default."},accountsTable:{name:"Name",type:"Type",defaultBadge:"default",created:"Created",lastUsed:"Last Used",historySync:"History Sync",actions:"Actions",syncTitle:"Edit sync mode, group, and continuity depth",confirmLegacyTitle:"Confirm this legacy account's current mode as explicit",sync:"Sync",confirm:"Confirm",active:"Active",setDefault:"Set Default",deleteAccount:"Delete account",cannotDeleteDefault:"Cannot delete default account",noAccounts:"No CCS auth accounts found. Use ccs auth create to add accounts.",resetToDefault:"Reset to CCS Default",deleteDialogTitle:"Delete Account",deleteDialogDesc:'Are you sure you want to delete the account "{{name}}"? This will remove the profile and all its session data. This action cannot be undone.',cancel:"Cancel",delete:"Delete",sharedGroupStandard:"shared ({{group}}, standard)",sharedGroupDeeper:"shared ({{group}}, deeper)",sharedGroupLegacy:"shared ({{group}}, standard legacy)",isolatedLegacy:"isolated (legacy default)",isolated:"isolated"},addAccountDialog:{title:"Add {{displayName}} Account",descKiro:"Choose a Kiro auth method, then authenticate via browser or import from Kiro IDE.",descDeviceCode:"Click Authenticate. A verification code will appear for you to enter on the provider website.",descOauth:"Click Authenticate to get an OAuth URL. Open it in any browser to sign in.",powerUserEnabled:"Power user mode enabled",powerUserSkipped:"AGY responsibility checklist is skipped from Settings > Proxy. You accept full responsibility for OAuth/account risk.",authMethod:"Auth Method",selectKiroAuthMethod:"Select Kiro auth method",nicknameRequired:"Nickname (required)",nicknameOptional:"Nickname (optional)",nicknamePlaceholder:"e.g., work, personal",nicknameRequiredHint:"Required for this provider. Use a unique friendly name (e.g., work, personal).",nicknameOptionalHint:"A friendly name to identify this account. Auto-generated from email if left empty.",waitingForAuth:"Waiting for authentication...",deviceCodeHint:"A verification code dialog will appear shortly. Enter the code on the provider website.",browserHint:"Complete the authentication in your browser. This dialog closes automatically.",openUrlLabel:"Open this URL in any browser to sign in:",copied:"Copied",copy:"Copy",open:"Open",popupBlocked:"Popup blocked. Copy the URL above and open it manually in your browser.",redirectPasteLabel:"Redirect didn't work? Paste the callback URL:",callbackPlaceholder:"Paste the redirect URL here...",submitCallback:"Submit Callback",submitting:"Submitting...",preparingUrl:"Preparing sign-in URL...",cancel:"Cancel",importingToken:"Importing token from Kiro IDE...",authenticate:"Authenticate",importFromIde:"Import from IDE",importing:"Importing..."},flowViz:{backToProviders:"Back to providers",showDetails:"Show Details",hideDetails:"Hide Details",resetLayout:"Reset layout",provider:"Provider",totalRequests:"Total Requests",accounts:"Accounts",connectionTimeline:"Connection Timeline",noRecentConnections:"No recent connections"},quickStats:{totalRequests:"Total Requests",successRate:"Success Rate",totalTokens:"Total Tokens",activeModels:"Active Models"},authMonitor:{accounts:"Accounts",accountsCount:"{{count}} accounts",success:"Success",failed:"Failed",successRate:"Success Rate"},accountCard:{resumeAccount:"Resume account",pauseAccount:"Pause account",quotaLoading:"Quota...",quota:"Quota",quotaUnavailable:"Quota limits unavailable",reauthNeeded:"Reauth needed",failureLabelReauth:"Reauth",failureLabelWorkspace:"Workspace",failureLabelNoAccess:"No Access",failureLabelRetry:"Retry",failureLabelReconnect:"Reconnect",failureLabelTemporary:"Temporary",failureLabelUnavailable:"Unavailable",failureHintReauth:"Refresh this account by running its auth flow again.",failureHintWorkspace:"Move this account back to an active workspace, then remove and re-add it.",failureHintNoAccess:"This account cannot access the provider quota endpoint.",failureHintRetry:"Wait a bit, then retry the quota request.",failureHintReconnect:"Remove the stale account and authenticate it again.",failureHintTemporary:"Retry later. This looks temporary.",removeAndReadd:"Remove and re-add account",autoRefreshFailed:"Auto-refresh failed"},antigravityChecklist:{title:"Antigravity OAuth Responsibility",subtitle:"Complete all 4 steps before you can authenticate.",mandatory:"Mandatory",completion:"Completion",stepsCount:"{{current}}/4 steps"},accountSafetyWarning:{title:"OAuth Account Safety Warning",subtitle:"Issue #509 · Gemini + AGY OAuth risk",firstLine:"Issue #509 documents suspension/ban reports tied to ccs agy and shared-account usage between ccs gemini and ccs agy.",secondLine:"Continue only if you accept full responsibility for OAuth and account-access risk.",issueLabel:"Read issue #509",proxySettingsLabel:"Gemini + AGY controls: Settings > Proxy"},cliproxyDialog:{name:"Name",provider:"Provider",account:"Account",accountOptional:"Account (optional)",model:"Model",modelOptional:"Model (optional)",defaultTarget:"Default Target",defaultTier:"Default Tier",tierConfig:"Tier Configuration",selectProvider:"Select provider...",useDefaultAccount:"Use default account",defaultSuffix:"(default)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Cancel",create:"Create",creating:"Creating...",saveChanges:"Save Changes",saving:"Saving...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Edit Composite Variant: {{name}}",editSingleTitle:"Edit Single Variant: {{name}}"},profileEditor:{profileInfo:"Profile Information",profileName:"Profile Name",filePath:"File Path",lastModified:"Last Modified",defaultTarget:"Default Target",quickUsage:"Quick Usage",runWithProfile:"Run with profile",runOnDroid:"Run on Droid",droidAliasExplicit:"Droid alias (explicit)",overrideToClaude:"Override to Claude",overrideToClaudeExplicit:"Override to Claude (explicit)",setAsDefault:"Set as default",provider:"Provider",custom:"Custom"},settings:{sectionLoadFailed:"Failed to load section",unknownError:"Unknown error occurred",reloadPage:"Reload page",refresh:"Refresh",copy:"Copy",copied:"Copied",saved:"Saved",loading:"Loading...",configFileNotFound:"Config file not found"},settingsTabs:{web:"Web",env:"Env",think:"Think",proxy:"Proxy",auth:"Auth",backup:"Backup"},settingsAuth:{failedFetchTokens:"Failed to fetch auth tokens",failedSaveTokens:"Failed to save tokens",tokensUpdated:"Tokens updated. Restart CLIProxy to apply.",failedRegenerate:"Failed to regenerate secret",secretRegenerated:"New management secret generated. Restart CLIProxy to apply.",failedReset:"Failed to reset tokens",tokensReset:"Tokens reset to defaults. Restart CLIProxy to apply.",description:"Configure CLIProxy authentication tokens. Changes require CLIProxy restart.",apiKey:"API Key",custom:"Custom",apiKeyDesc:"Used by Claude Code to authenticate with CLIProxy",apiKeyPlaceholder:"API key",managementSecret:"Management Secret",managementSecretDesc:"Used by CCS dashboard to access CLIProxy management APIs",managementSecretPlaceholder:"Management secret",generateSecret:"Generate new secure secret",resetDefaults:"Reset to Defaults",resetDesc:"Resets both API key and management secret to their default values.",saving:"Saving...",save:"Save"},settingsGlobalEnv:{description:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, ghcp, etc.)",enabled:"Global Env enabled",disabled:"Global Env disabled",enabledDesc:"Env vars will be injected into third-party profiles",disabledDesc:"Env vars will not be injected",envVars:"Environment Variables",noneConfigured:"No environment variables configured",addNew:"Add New Variable",keyName:"KEY_NAME",value:"value",add:"Add",quickAdd:"Quick Add Common Variables",allConfigured:"All common variables are configured"},settingsBackups:{failedFetch:"Failed to fetch backups",failedRestore:"Failed to restore backup",restoreSuccess:"Backup restored successfully",title:"Settings Backups",description:"Restore previous versions of your settings.json file. Backups are created automatically when settings are modified.",none:"No backups available",noneHint:"Backups will appear here when you modify settings",latest:"Latest",restoring:"Restoring...",restore:"Restore",restoreConfirmTitle:"Restore Backup?",restoreConfirmPrefix:"This will replace your current settings with backup from",restoreConfirmSuffix:"This action cannot be undone.",cancel:"Cancel"},settingsWebsearch:{description:"CLI-based web search for third-party profiles (gemini, codex, agy, etc.)",enabled:"WebSearch enabled",disabled:"WebSearch disabled",checking:"Checking status...",providers:"Providers",noneConfigured:"No providers configured",noneConfiguredHint:"Install CLI tools to enable web search providers",checkProviders:"Check for providers",installed:"installed",notInstalled:"not installed",model:"Model:",howInstall:"How to install {{name}} CLI",installGlobally:"Install globally",requiresKey:"(requires xAI API key)",freeTier:"(FREE tier available)",viewDocs:"View documentation"},settingsProxy:{failedLoadAgyMode:"Failed to load AGY power user mode",failedUpdateAgyMode:"Failed to update AGY power user mode",failedVerifyAgyMode:"Failed to verify AGY power user mode persistence",notPersistedAgyMode:"AGY power user mode was not persisted. Config may have been modified by another process.",agyModeEnabled:"AGY power user mode enabled.",agyModeDisabled:"AGY power user mode disabled.",typePhraseToContinue:'Type "{{value}}" to continue.',description:"Configure local or remote {{backend}} connection for proxy-based profiles",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Instance Status",connectionMode:"Connection Mode",local:"Local",remote:"Remote",localDesc:"Run {{backend}} binary on this machine",remoteDesc:"Connect to a remote {{backend}} server",backendBinary:"Backend Binary",stopProxyToSwitch:"Stop the running proxy in Instance Status to switch backend.",default:"Default",plusDesc:"Full provider support including Kiro and GitHub Copilot",originalDesc:"Original binary (Gemini, Codex, Antigravity only)",variantsIncompatible:"Existing Kiro/Copilot variants will not work with CLIProxyAPI. Switch to CLIProxyAPIPlus or remove those variants.",safety:"Safety",agyModeTitle:"Antigravity Power User Mode",agyModeDesc:"Skip AGY responsibility checklist in Add Account and `ccs agy` flows.",agyWarning:"Use only if you fully understand the OAuth suspension/ban risk pattern (#509). CCS cannot assume responsibility for account loss.",finalConfirm:"Final confirmation required",finalConfirmDesc:"Enabling this will skip AGY safety checkpoints in both dashboard and CLI. Review issue #509 and type the exact phrase to proceed.",step1:"Step 1",readIssue:"Read issue #509",step2:"Step 2",typePrefix:"Type",typeSuffix:"to enable.",typePhraseAria:"Type I ACCEPT RISK to enable Antigravity power user mode",exactPhrase:"Exact phrase required.",enableAgyMode:"Enable Power User Mode",toggleAgyMode:"Toggle AGY power user mode",fallbackSettings:"Fallback Settings",enableFallback:"Enable fallback to local",enableFallbackDesc:"Use local proxy if remote is unreachable",autoStartLocal:"Auto-start local proxy",autoStartLocalDesc:"Automatically start local proxy on fallback",advanced:"Advanced",debugMode:"Debug Mode",debugModeDesc:"Enable developer diagnostics in browser console",debugModeEnabled:"Debug mode enabled. Check browser console for detailed logs.",localProxy:"Local Proxy",port:"Port",autoStart:"Auto-start",localAutoStartDesc:"Start local proxy automatically when needed",remoteConfigTitle:"Remote Server Configuration",host:"Host",hostPlaceholder:"192.168.1.100 or proxy.example.com",defaultPort:"default: {{value}}",portPlaceholder:"Leave empty for {{value}}",protocol:"Protocol",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"For /v1/* API endpoints",apiKeyDesc:"Used for API requests to /v1/chat/completions",managementKeyOptional:"Management Key (optional)",managementKeyPlaceholder:"For /v0/management/* endpoints",managementKeyDesc:"Used for dashboard management APIs. Falls back to API Key if not set.",testing:"Testing...",testConnection:"Test Connection",connectedLatency:"Connected ({{value}}ms)",connectionFailed:"Connection failed",invalidPortOrEmpty:"Port must be an integer between 1 and 65535, or empty for default",invalidLocalPort:"Local port must be an integer between 1 and 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Configure extended thinking/reasoning for supported models.",supportedProviders:"Supported Providers",modeTitle:"Thinking Mode",modeAutoDesc:"Automatically set thinking based on model tier",modeOffDesc:"Disable extended thinking",modeManualDesc:"Set a persistent override level or use CLI flags per run",tierDefaults:"Tier Defaults",tierDefaultsDesc:"Default thinking level for each model tier when in auto mode.",persistentOverride:"Persistent Override",persistentOverrideDesc:"Applied to all sessions. CLI flags still take priority.",enterCustomBudget:"Enter custom budget",apply:"Apply",providerOverrides:"Provider Overrides ({{count}})",providerOverridesDesc:"Override tier defaults for specific providers. Add custom provider keys as needed.",addProviderPlaceholder:"Add provider key (e.g. qwen)",showWarnings:"Show Warnings",showWarningsDesc:"Display warnings when thinking values are clamped or adjusted",cliEnvOverride:"CLI & Env Override",supportLine1Prefix:"Thinking budget:",supportLine1Suffix:"(token-based)",supportLine2Prefix:"Reasoning effort:",supportLine2SuffixPrefix:"(suffix or ",supportLine2SuffixPostfix:": medium/high/xhigh)",supportLine3Prefix:"Codex suffixes pin effort (for example ",supportLine3Suffix:"); unsuffixed models use Thinking mode."},analytics:{title:"Analytics",subtitle:"Track usage and insights",month:"Month",allTime:"All Time",updated:"Updated {{value}}"},analyticsSummary:{totalTokens:"Total Tokens",totalTokensSubtitle:"{{input}} in / {{output}} out",totalCost:"Total Cost",totalCostSubtitle:"${{value}}/day avg",cacheTokens:"Cache Tokens",cacheTokensSubtitle:"${{cost}} ({{percent}}% of cost)",inputCost:"Input Cost",outputCost:"Output Cost",tokensSubtitle:"{{value}} tokens"},apiProfiles:{title:"API Profiles",new:"New",searchPlaceholder:"Search profiles...",loadingProfiles:"Loading profiles...",failedLoadTitle:"Failed to load profiles",failedLoadDesc:"Unable to fetch API profiles. Please try again.",retry:"Retry",noProfilesYet:"No API profiles yet",noProfilesDesc:"Create your first profile to connect to custom API endpoints",createProfile:"Create Profile",noProfileMatch:'No profiles match "{{query}}"',profileCount:"{{count}} profile",profileCount_other:"{{count}} profiles",configuredCount:"{{count}} configured",deleteProfileTitle:"Delete Profile",deleteProfileDesc:'Are you sure you want to delete "{{name}}"? This will remove the settings file and cannot be undone.',delete:"Delete",unsavedChangesTitle:"Unsaved Changes",unsavedChangesDesc:'You have unsaved changes in "{{current}}". Discard and switch to "{{next}}"?',discardSwitch:"Discard and Switch"},accountsPage:{title:"Accounts",managePrefix:"Manage",manageSuffix:"accounts and pool onboarding from one panel.",mobileManageSuffix:"continuity per account.",primaryActions:"Primary Actions",createAccount:"Create Account",authClaudeInPool:"Authenticate Claude in Pool",openClaudePoolSettings:"Open Claude Pool Settings",openCliProxyClaudePool:"Open CLIProxy Claude Pool",migrationFollowup:"Migration Follow-up",legacyContextPending:"{{count}} account still needs first-time mode confirmation.",legacyContextPending_other:"{{count}} accounts still need first-time mode confirmation.",legacyContinuityPending:"{{count}} shared account remains on standard legacy continuity depth.",legacyContinuityPending_other:"{{count}} shared accounts remain on standard legacy continuity depth.",confirmingLegacy:"Confirming Legacy Policies...",confirmLegacy:"Confirm Legacy Policies ({{count}})",noLegacyFollowup:"No legacy follow-up pending.",continuityGuide:"Continuity Guide",expandWhenNeeded:"Expand only when needed.",sharedStandard:"Shared Standard",sharedStandardDesc:"Project workspace sync only. Best default for most teams.",sharedDeeper:"Shared Deeper",sharedDeeperPrefix:"Adds",isolated:"Isolated",isolatedDesc:"No link. Best for strict separation.",quickCommands:"Quick Commands",quickCommandsDesc:"Copy and run in terminal.",workspaceBadge:"ccs auth Workspace",historySyncBadge:"History Sync Controls",authAccounts:"Auth Accounts",tableScopePrefix:"This table is intentionally scoped to",tableScopeMiddle:"accounts. Use",tableScopeSuffix:"for mode/group/depth changes.",accountMatrix:"Account Matrix",sharedTotalDesc:"Shared total: {{count}}. Actions include Sync settings and legacy confirmation.",loadingAccounts:"Loading accounts..."},health:{justNow:"just now",secondsAgo:"{{count}}s ago",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",systemHealth:"System Health",build:"build {{version}}",lastScan:"Last scan:",autoRefresh:"Auto-refresh:",refresh:"Refresh",checks:"Checks",version:"Version",platform:"Platform",liveMonitoring:"Live monitoring active",copied:"Copied to clipboard",refreshing:"Refreshing health checks...",fix:"Fix",applyFix:"Apply Fix",healthLabel:"health"},updates:{actionRequired:"Action Required",done:"Done",all:"All",inboxTitle:"Updates Inbox",inboxSubtitle:"Focus on actions, then mark updates done or dismissed.",needsAction:"Needs Action",doneCount:"Done",searchPlaceholder:"Search actions or commands",noNotices:"No notices match this view.",noUpdates:"No updates available.",published:"Published {{date}}",markDone:"Mark done",dismiss:"Dismiss",reopen:"Reopen",doNext:"Do Next",impactedIntegrations:"Impacted Integrations",impactedDesc:"Related areas based on update scope and routing.",whyMatters:"Why It Matters",whyMattersDesc:"Short context only, no wall-of-text release notes.",open:"Open",progressNeedsAction:"Needs Action",progressInReview:"In Review",progressDone:"Done",progressDismissed:"Dismissed",statusNew:"New",statusStable:"Stable",statusPlanned:"Planned",dashboard:"Dashboard",cliUsage:"CLI Usage"},cliproxyPage:{connected:"Connected",notConnected:"Not connected",variant:"variant",parentNotConnected:"Parent not connected",viaProvider:"via {{provider}}",emptyTitle:"CCS Profile Manager",emptyDesc:"Manage OAuth authentication, account preferences, and model selection for CLIProxy providers. Configure how CCS routes requests to different AI backends.",emptyControlPanelPrefix:"For live usage stats and real-time monitoring, visit the",controlPanel:"Control Panel",quickSetup:"Quick Setup",accountManagement:"CCS-level account management",providers:"Providers",variants:"Variants",providerCount:"{{count}} provider",providerCount_other:"{{count}} providers",connectedCount:"{{count}} connected",variantDisplay:"{{name}} ({{provider}} variant)"},copilotPage:{title:"Copilot",subtitle:"GitHub Copilot proxy",setup:"Setup",auth:"Auth",daemon:"Daemon",unofficialTitle:"Unofficial API - Use at Your Own Risk",unofficialItem1:"Reverse-engineered API - may break anytime",unofficialItem2:"Excessive use may trigger account restrictions",unofficialItem3:"No warranty, no responsibility from CCS",yes:"Yes",no:"No",installed:"Installed",missing:"Missing",integration:"Integration",enabled:"Enabled",disabled:"Disabled",github:"GitHub",connected:"Connected",notConnected:"Not Connected",authenticate:"Authenticate",authenticating:"Authenticating...",status:"Status",running:"Running",stopped:"Stopped",port:"Port",stopping:"Stopping...",stop:"Stop",starting:"Starting...",start:"Start",installing:"Installing...",installCopilotApi:"Install copilot-api",proxy:"Proxy",active:"Active",inactive:"Inactive"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Dedicated Cursor integration controls",unofficialTitle:"Unofficial API - Use at Your Own Risk",unofficialItem1:"Reverse-engineered integration may break anytime",unofficialItem2:"Abuse or excessive usage may risk account restrictions",unofficialItem3:"No warranty, no responsibility from CCS",integration:"Integration",authentication:"Authentication",daemon:"Daemon",enabled:"Enabled",disabled:"Disabled",expired:"Expired",connected:"Connected",notConnected:"Not connected",running:"Running",stopped:"Stopped",actions:"Actions",disableIntegration:"Disable Integration",enableIntegration:"Enable Integration",autoDetectAuth:"Auto-detect Auth",manualAuthImport:"Manual Auth Import",stopDaemon:"Stop Daemon",startDaemon:"Start Daemon",port:"Port",configuration:"Cursor Configuration",lastModified:"Last modified:",neverSaved:"Never saved",saving:"Saving...",save:"Save",modelConfig:"Model Config",settings:"Settings",info:"Info",presets:"Presets",presetsDesc:"Apply pre-configured model mappings",modelMapping:"Model Mapping",modelMappingDesc:"Configure which models to use for each tier",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested.",opusModel:"Opus (Most capable)",opusModelDesc:"Complex reasoning and highest quality responses.",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"General coding and day-to-day chat workloads.",haikuModel:"Haiku (Fast)",haikuModelDesc:"Low-latency and lightweight request paths.",runtimeSettings:"Runtime Settings",autoStartDaemon:"Auto-start Daemon",autoStartDesc:"Start Cursor daemon automatically when integration is used.",ghostMode:"Ghost Mode",ghostModeDesc:"Request x-ghost-mode to reduce telemetry.",provider:"Provider",filePath:"File Path",availableModels:"Available Models",loadingModels:"Loading models...",noModels:"No model metadata available yet. Start daemon and refresh.",default:"Default",rawConfiguration:"Raw Configuration (JSON)",manualImportTitle:"Manual Cursor Auth Import",manualImportDesc:"Provide Cursor access token and machine ID if auto-detect is unavailable.",accessToken:"Access Token",accessTokenPlaceholder:"Paste Cursor access token",machineId:"Machine ID",machineIdPlaceholder:"32-char hex (UUID without hyphens)",cancel:"Cancel",import:"Import",selectModel:"Select model",useDefaultModel:"Use Default Model",availableModelCount:"Available Models ({{count}})",invalidPort:"Port must be an integer between 1 and 65535",defaultModelRequired:"Default model is required",savedConfig:"Cursor config and model mapping saved",failedSaveConfig:"Failed to save config",modelsLoadingWait:"Models are still loading. Please wait before applying a preset.",noModelsAvailable:"No models available yet. Start the daemon and refresh first.",appliedCodexPreset:"Applied GPT-5.3 Codex preset",appliedClaudePreset:"Applied Claude 4.6 preset",appliedGeminiPreset:"Applied Gemini 3 preset",integrationEnabled:"Cursor integration enabled",integrationDisabled:"Cursor integration disabled",failedUpdateIntegration:"Failed to update integration state",credentialsImported:"Cursor credentials imported",autoDetectFailed:"Auto-detect failed",manualRequired:"Token and machine ID are required",manualImportFailed:"Manual import failed",failedStartDaemon:"Failed to start daemon",daemonStarted:"Daemon started",daemonStartedWithPid:"Daemon started (PID: {{pid}})",failedStopDaemon:"Failed to stop daemon",daemonStopped:"Daemon stopped",rawLoading:"Raw settings are still loading. Please wait and try again.",invalidJson:"Invalid JSON",rawSaved:"Raw settings saved",rawChanged:"Raw settings changed externally. Refresh and retry.",failedSaveRaw:"Failed to save raw settings",savedAll:"Cursor configuration saved"},droidPage:{loadingDiagnostics:"Loading Droid diagnostics...",failedDiagnostics:"Failed to load Droid diagnostics.",overview:"Overview",byok:"BYOK",docs:"Docs",runtimeInstall:"Runtime and Installation",status:"Status",detected:"Detected",notFound:"Not Found",detectionSource:"Detection source",binaryPath:"Binary path",installDirectory:"Install directory",version:"Version",overridePath:"Override (CCS_DROID_PATH)",configFiles:"Config Files",path:"Path",resolved:"Resolved",size:"Size",lastModified:"Last modified",parseWarning:"Parse warning: {{value}}",readWarning:"Read warning: {{value}}",warnings:"Warnings",byokSummary:"BYOK Summary",activeModelSelector:"Active model selector",customModels:"Custom models",ccsManaged:"CCS-managed",userManaged:"User-managed",malformedEntries:"Malformed entries",providers:"Providers",none:"none",customModelsTitle:"Custom Models",modelName:"Name / Model",provider:"Provider",baseUrl:"Base URL",noCustomModels:"No custom models",docsAlignedNotes:"Docs-Aligned Notes",factoryDocs:"Factory Docs",providerFactCheckDocs:"Provider Fact-Check Docs",providerValues:"Provider values: {{value}}",settingsHierarchy:"Settings hierarchy: {{value}}",settingsTitle:"Droid BYOK Settings",fixJsonBeforeQuickSettings:"Fix JSON syntax before using quick settings controls.",fixJsonBeforeReasoning:"Fix JSON syntax before updating BYOK reasoning settings.",unableUpdateReasoning:"Unable to update selected BYOK model reasoning setting.",fixJsonBeforeBudget:"Fix JSON syntax before updating thinking budget.",anthropicOnlyBudget:"Thinking budget is only available for Anthropic BYOK models.",invalidJson:"Invalid JSON: {{value}}",saved:"Droid settings saved",changedExternally:"Droid settings changed externally. Refresh and retry.",failedSave:"Failed to save Droid settings"},sharedPage:{commands:"Commands",skills:"Skills",agents:"Agents",title:"Shared Data",subtitle:"Commands, skills, and agents shared across Claude instances",totalShared:"Total Shared",visible:"Visible",markdownDetail:"Markdown detail view",filterPrefix:"Filter:",configurationRequired:"Configuration Required",countsUnavailable:"Counts unavailable",retryCounts:"Retry counts",filterPlaceholder:"Filter {{tab}} by name, description, or path",showing:"Showing {{visible}} of {{total}} {{tab}}",showingQuery:' for "{{query}}"',refreshing:" (refreshing...)",loadingShared:"Loading shared {{tab}}...",failedLoadShared:"Failed to load shared {{tab}}",retry:"Retry",noSharedFound:"No shared {{tab}} found. Run `ccs sync` or add items in your shared directory.",noMatch:'No {{tab}} match "{{query}}".',selectOne:"Select a {{tab}} to view full content.",pathLabel:"Path",resolvedSource:"Resolved Source",loadingMarkdown:"Loading markdown content...",failedLoadContent:"Failed to load content",retryContent:"Retry content",noMarkdown:"No markdown content available."}}},"zh-CN":{translation:{locale:{en:"English","zh-CN":"简体中文",vi:"越南语"},layout:{languageSwitcher:"语言"},nav:{general:"通用",home:"首页",analytics:"分析",identityAccess:"身份与访问",apiProfiles:"API 配置",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"概览",controlPanel:"控制面板",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",accounts:"账号",allAccounts:"全部账号",sharedData:"共享数据",compatibleClis:"兼容 CLI",factoryDroid:"Factory Droid",system:"系统",health:"健康",settings:"设置",openrouterTooltip:"精选:OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"配置",cliproxy:"CLIProxy",accounts:"账号",health:"健康",configurationRequired:"需要配置"},auth:{dashboardTitle:"CCS 控制台",loginDescription:"请输入凭据以访问控制台",username:"用户名",password:"密码",usernamePlaceholder:"请输入用户名",passwordPlaceholder:"请输入密码",signIn:"登录",signingIn:"登录中...",loginFailed:"登录失败"},commonToast:{apiKeyRequired:"API key 为必填项",accountAddedPresetFailed:"账号已添加,但应用默认预设失败",settingsCopied:"设置已复制到剪贴板",enterPresetName:"请先输入预设名称再保存",codeCopied:"验证码已复制到剪贴板",copyCodeFailed:"复制验证码失败",appliedModelAllTiers:"已将模型应用到全部层级",settingsSaved:"设置已保存",defaultTargetUpdated:"默认目标已更新",failedUpdateDefaultTarget:"更新默认目标到 {{target}} 失败{{suffix}}"},profileDialog:{editTitle:"编辑配置",createTitle:"创建 API 配置",name:"名称",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"默认模型(ANTHROPIC_MODEL)",defaultModelHint:"留空则使用:{{model}}",modelMappingTitle:"模型映射(Opus/Sonnet/Haiku)",modelMappingDesc:"为不同档位配置不同模型 ID,适合按模型类型路由到不同后端的 API 代理。",opusModel:"Opus 模型(ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet 模型(ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku 模型(ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"取消",saving:"保存中...",update:"更新",create:"创建"},modelTierMapping:{title:"模型档位映射",advanced:"高级",description:"为 Claude Code 的 opus/sonnet/haiku 档位配置不同模型。",autoSuggest:"基于 {{provider}} 自动建议",opusPlaceholder:"例如:anthropic/claude-opus-4",sonnetPlaceholder:"例如:anthropic/claude-sonnet-4",haikuPlaceholder:"例如:anthropic/claude-3.5-haiku",footer:"这些字段对应 ANTHROPIC_DEFAULT_OPUS_MODEL、ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_DEFAULT_HAIKU_MODEL。"},envEditor:{sensitive:"敏感",none:"尚未配置环境变量。",noneHint:"可在下方输入添加,或直接编辑 JSON。",addVariable:"添加环境变量",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"当前使用:",variantNameRequired:"变体名称 *",variantNamePlaceholder:"例如:my-gemini、g3、flash",invokeHintPrefix:"可通过该名称调用:",model:"模型",modelPlaceholder:"例如:gemini-2.5-pro、claude-opus-4-6-thinking",choosePresetInstead:"改为从预设中选择",selectModel:"选择模型",customModelName:"自定义模型名称...",enterAnyModel:"可输入 CLIProxy 支持的任意模型名",defaultModel:"默认:{{model}}",providerDefault:"提供商默认值",back:"返回",skip:"跳过",creating:"创建中...",createVariant:"创建变体",skipHint:"如果你只想添加账号而不创建变体,可以直接跳过"},customPresetDialog:{title:"自定义预设",presetNameOptional:"预设名称(可选)",presetNamePlaceholder:"例如:我的自定义配置",codexTipPrefix:"Codex 提示:后缀",codexTipSuffix:"会固定 effort。无后缀模型使用 Thinking 设置。",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用",opusModel:"Opus(最强)",opusModelDesc:"用于复杂推理任务",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"兼顾速度与能力",haikuModel:"Haiku(快速)",haikuModelDesc:"适合简单任务的快速响应",cancel:"取消",savePreset:"保存预设",applyPreset:"应用预设"},componentModelSelector:{selectModel:"选择模型",availableModelsCount:"可用模型({{count}})",preview:"预览"},copilotSettings:{enableCopilot:"启用 Copilot",enableCopilotDesc:"允许使用 GitHub Copilot 订阅",basicSettings:"基础设置",accountType:"账户类型",accountTypeIndividual:"个人",accountTypeBusiness:"企业",accountTypeEnterprise:"组织",rateLimiting:"速率限制",rateLimitSeconds:"速率限制(秒)",noLimit:"不限制",waitOnRateLimit:"触发限速时等待",waitOnRateLimitDesc:"达到限制时等待而不是报错",daemonSettings:"守护进程设置",autoStartDaemon:"自动启动守护进程",autoStartDaemonDesc:"使用配置时自动启动 copilot-api"},providerModelSelector:{selectModel:"选择模型",noModelsForProvider:"该提供商暂无可用模型",broken:"故障",deprecated:"已弃用",paid:"付费",freeTier:"免费档",paidTier:"付费档",modelKnownIssues:"该模型存在已知问题",viewIssueDetails:"查看问题详情",modelDeprecated:"该模型已弃用",recommended:"推荐",allModelsCount:"全部模型({{count}})",noModelsAvailable:"暂无可用模型"},createAuthProfileDialog:{title:"创建新账号",description:"Auth 配置需要先完成 Claude CLI 登录。请在终端执行下方命令。稍后你仍可在 Accounts 表中编辑同步模式、分组与连续性深度。",profileName:"配置名称",profileNamePlaceholder:"例如:work、personal、client",invalidProfileName:"名称必须以字母开头,且只能包含字母、数字、短横线或下划线。",enableSharedHistory:"与其他 ccs auth 账号启用共享历史同步",historySyncGroupOptional:"历史同步分组(可选)",historySyncGroupPlaceholder:"default、sprint-a、client-x",historySyncGroupHint:"留空将使用默认共享分组。空格会自动规范为短横线。",deeperContinuity:"高级:更深连续性模式",deeperContinuityHint:"会同步 session-env、file-history、shell-snapshots 与 todos。凭据仍保持隔离。",invalidContextGroup:"分组必须以字母开头,且只能包含字母、数字、短横线或下划线(最多 {{max}} 个字符)。",command:"命令",commandFallback:"ccs auth create <name>",afterRunPrefix:"执行命令后:",afterRunStep1:"在浏览器中完成 Claude 登录",afterRunStep2:"返回此处并刷新,即可看到新账号",poolingHint:"如果更倾向于共享池化 Claude OAuth 路由,可在 Accounts 页面操作按钮中使用 CLIProxy Claude pool。",close:"关闭",copied:"已复制!",copyCommand:"复制命令"},cliproxyModelCategory:{google:"Google(Gemini)",openai:"OpenAI(GPT)",anthropic:"Anthropic(Claude)",antigravity:"Antigravity",other:"其他"},cliproxyOverviewComponents:{availableModels:"可用模型",noModelsAvailable:"暂无可用模型",startSessionHint:"启动 CLIProxy 会话后即可拉取可用模型",totalCount:"共 {{count}} 个",availableThroughGroupedByProvider:"通过 {{backendLabel}} 提供的模型,按提供商分组",moreCount:"另外 {{count}} 个"},categorizedModelSelector:{selectModel:"选择模型",noModelsAvailable:"暂无可用模型",modelPlaceholder:"模型..."},openrouterQuickStart:{recommended:"推荐",title:"从 OpenRouter 开始",description:"通过一个 API 即可访问来自 OpenAI、Anthropic、Google、Meta 等的 {{modelCountLabel}} 个模型。",featureOneApi:"一个 API,接入全部提供商",featureTierMapping:"模型档位映射",createOpenRouterProfile:"创建 OpenRouter 配置",getApiKeyAt:"在此获取 API Key:",or:"或",createCustomProfile:"创建自定义 API 配置"},alibabaCodingPlanQuickStart:{recommended:"推荐",title:"试用阿里云 Coding Plan",description:"通过 Anthropic 兼容端点接入阿里云 Model Studio Coding Plan。",featureEndpoint:"Anthropic 兼容端点",featureKeyFormat:"专用 sk-sp API Key",createAlibabaProfile:"创建 Alibaba Coding Plan 配置",readGuideAt:"查看配置文档:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"通过 Anthropic 端点接入 Model Studio Coding Plan",add:"添加"},credentialHealth:{title:"凭据健康状态",ready:"就绪",noCredentialsConfigured:"尚未配置凭据。请使用上方登录按钮完成认证。",neverUsed:"从未使用",justNow:"刚刚",unknown:"未知",daysAgo:"{{count}} 天前",hoursAgo:"{{count}} 小时前",minutesAgo:"{{count}} 分钟前"},proxyStatusWidget:{justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",syncReady:"同步就绪",noConfig:"未配置",remoteProxy:"远程代理",active:"已连接",trafficAutoRouted:"流量已自动转发到远程服务器",tooltipSync:"同步配置到 CLIProxy",tooltipRestart:"重启",tooltipStop:"停止",tooltipClose:"关闭",tooltipVersionSettings:"版本设置",versionManagement:"版本管理",selectVersionPlaceholder:"选择要安装的版本...",stable:"(稳定版)",install:"安装",versionsAboveUnstable:"高于 {{version}} 的版本存在已知问题",versionsKnownIssues:"版本 {{version}} 存在已知问题",lastChecked:"上次检查 {{time}}",notRunning:"未运行",start:"启动",port:"端口 {{port}}",sessionCount:"{{count}} 个会话",sessionCount_other:"{{count}} 个会话",installFaultyTitle:"安装存在已知问题的版本?",installFaultyDesc:"即将安装 <strong>v{{version}}</strong>,该版本位于已知故障范围 <strong>{{range}}</strong> 内。",installFaultyWarning:"该版本存在已知缺陷,可能安装失败或让代理处于异常状态。",installUnstableTitle:"安装非稳定版本?",installUnstableDesc:"即将安装 <strong>v{{version}}</strong>,该版本高于当前最大稳定版 <strong>v{{maxStable}}</strong>。",installUnstableWarning:"该版本存在已知稳定性问题,可能导致异常行为。",installUnstableConfirm:"确定要继续吗?",cancel:"取消",installAnyway:"仍要安装",clickToDowngrade:"点击降级",clickToUpdate:"点击更新"},syncStatusCard:{profileSync:"配置同步",ready:"就绪",noConfig:"未配置",syncsProfilesDesc:"将 API 配置同步到本地 CLIProxy 配置",runDoctorHint:"运行 <code>ccs doctor --fix</code> 生成配置。",details:"详情",syncNow:"立即同步"},syncDialog:{title:"同步配置到本地 CLIProxy",description:"将 CCS API 配置同步到本地 CLIProxy 的 config.yaml。",noProfiles:"没有可同步的配置。",createProfilesFirst:"请先在「配置」页创建 API 配置。",modelLabel:"模型:",ready:"就绪",profilesToSync_one:"{{count}} 个配置待同步",profilesToSync_other:"{{count}} 个配置待同步",cancel:"取消",syncing:"同步中...",synced:"已同步!",syncNow:"立即同步"},errorLogs:{title:"错误日志",failedRequests_one:"{{count}} 个失败请求",failedRequests_other:"{{count}} 个失败请求",cliproxyDiagnostics:"CLIProxy 诊断",showingCount:"显示 50 / {{total}} 条",selectLog:"选择一条日志查看详情",failedLoadContent:"加载日志内容失败",copyAbsolutePath:"复制绝对路径",copyRawContent:"复制原始日志",tabOverview:"概览",tabHeaders:"请求头",tabRequest:"请求体",tabResponse:"响应体",tabRaw:"原始",modelLabel:"模型:",quotaResetsIn:"配额重置于 ",method:"方法",provider:"提供商",version:"版本",endpoint:"端点",url:"URL",timestamp:"时间戳",na:"无",noHeaders:"无请求头",noRequestBody:"无请求体内容",noResponseBody:"无响应体内容",rateLimitedMsg:"触发限速。请切换账号或等待配额重置。模型 {{model}} 配额已用尽。",rateLimitedMsgNoModel:"触发限速。请切换账号或等待配额重置。",authFailedMsg:"认证失败。请通过 CLIProxy 设置重新认证或检查 API Key。",notFoundMsg:"端点未找到,该提供商可能不存在此端点。",serverErrorMsg:"上游服务器错误。请稍后重试或查看提供商状态页。",timeoutMsg:"请求超时。请检查网络或增大超时设置。",unknown:"未知"},editAccountContext:{title:"编辑历史同步",description:"配置「{{name}}」与其他 ccs auth 账号共享历史与连续性的方式。",syncMode:"同步模式",selectContextMode:"选择同步模式",isolatedOption:"隔离(不同步)",sharedOption:"共享(启用同步)",sharedModeHint:"共享模式会为同一历史同步分组内的账号复用工作区上下文。",isolatedModeHint:"隔离模式使该账号与其他 ccs auth 账号完全独立。",historySyncGroup:"历史同步分组",groupPlaceholder:"default",groupHint:"会规范为小写(空格变为短横线)。允许:字母、数字、_、-(最多 {{max}} 字符)。",invalidGroup:"请输入以字母开头的有效分组名。",continuityDepth:"连续性深度",selectContinuityDepth:"选择连续性深度",standardOption:"标准(仅项目)",deeperOption:"更深连续性(高级)",deeperHint:"高级模式还会同步 session-env、file-history、shell-snapshots 和 todos。",standardHint:"标准模式仅同步项目工作区上下文。",credentialsIsolated:"凭据与 .anthropic 在所有模式下均按账号隔离。",cancel:"取消",save:"保存",saving:"保存中..."},historySyncLearningMap:{title:"历史同步说明",description:"隔离 -> 共享 -> 更深。在每行使用「同步」进行所有更改。",learningMap:"说明",isolated:"隔离",shared:"共享",deeper:"更深",cliproxyManaged_one:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",cliproxyManaged_other:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",showDetails:"显示详情:分组、切换与旧策略",modeSwitch:"模式切换",modeSwitchDesc:"同步对话框可让用户在隔离/共享间切换并选择更深连续性。",historySyncGroup:"历史同步分组",historySyncGroupDesc:"同一分组即共享项目上下文。默认回退为 default。"},accountsTable:{name:"名称",type:"类型",defaultBadge:"默认",created:"创建时间",lastUsed:"最后使用",historySync:"历史同步",actions:"操作",syncTitle:"编辑同步模式、分组与连续性深度",confirmLegacyTitle:"确认此旧账号的当前模式为显式",sync:"同步",confirm:"确认",active:"当前",setDefault:"设为默认",deleteAccount:"删除账号",cannotDeleteDefault:"不能删除默认账号",noAccounts:"未找到 CCS auth 账号。请使用 ccs auth create 添加。",resetToDefault:"恢复为 CCS 默认",deleteDialogTitle:"删除账号",deleteDialogDesc:"确定要删除账号「{{name}}」吗?将移除该配置及其所有会话数据,且无法撤销。",cancel:"取消",delete:"删除",sharedGroupStandard:"共享({{group}},标准)",sharedGroupDeeper:"共享({{group}},更深)",sharedGroupLegacy:"共享({{group}},标准旧策略)",isolatedLegacy:"隔离(旧默认)",isolated:"隔离"},addAccountDialog:{title:"添加 {{displayName}} 账号",descKiro:"选择 Kiro 认证方式,然后通过浏览器或从 Kiro IDE 导入完成认证。",descDeviceCode:"点击认证后,验证码将显示,请在提供商网站输入。",descOauth:"点击认证获取 OAuth URL,在任意浏览器中打开即可登录。",powerUserEnabled:"已启用高级用户模式",powerUserSkipped:"已在设置 > 代理 中跳过 AGY 责任清单,您需自行承担 OAuth/账号风险。",authMethod:"认证方式",selectKiroAuthMethod:"选择 Kiro 认证方式",nicknameRequired:"昵称(必填)",nicknameOptional:"昵称(选填)",nicknamePlaceholder:"例如:工作、个人",nicknameRequiredHint:"该提供商必填。请使用唯一易记名称(如工作、个人)。",nicknameOptionalHint:"用于区分账号的友好名称。留空将根据邮箱自动生成。",waitingForAuth:"等待认证中...",deviceCodeHint:"验证码对话框即将出现,请在提供商网站输入验证码。",browserHint:"在浏览器中完成认证后,本对话框将自动关闭。",openUrlLabel:"在任意浏览器中打开此 URL 登录:",copied:"已复制",copy:"复制",open:"打开",popupBlocked:"弹窗被拦截。请复制上方 URL 在浏览器中手动打开。",redirectPasteLabel:"重定向未生效?请粘贴回调 URL:",callbackPlaceholder:"在此粘贴重定向 URL...",submitCallback:"提交回调",submitting:"提交中...",preparingUrl:"正在准备登录 URL...",cancel:"取消",importingToken:"正在从 Kiro IDE 导入令牌...",authenticate:"认证",importFromIde:"从 IDE 导入",importing:"导入中..."},flowViz:{backToProviders:"返回提供商",showDetails:"显示详情",hideDetails:"隐藏详情",resetLayout:"重置布局",provider:"提供商",totalRequests:"总请求数",accounts:"账号",connectionTimeline:"连接时间线",noRecentConnections:"暂无最近连接"},quickStats:{totalRequests:"总请求数",successRate:"成功率",totalTokens:"总 Token 数",activeModels:"活跃模型数"},authMonitor:{accounts:"账号",accountsCount:"{{count}} 个账号",success:"成功",failed:"失败",successRate:"成功率"},accountCard:{resumeAccount:"恢复账号",pauseAccount:"暂停账号",quotaLoading:"配额...",quota:"配额",quotaUnavailable:"配额限制不可用",reauthNeeded:"需要重新认证",failureLabelReauth:"重新认证",failureLabelWorkspace:"工作区",failureLabelNoAccess:"无权限",failureLabelRetry:"重试",failureLabelReconnect:"重新连接",failureLabelTemporary:"临时问题",failureLabelUnavailable:"不可用",failureHintReauth:"请重新运行该账号的认证流程以刷新访问权限。",failureHintWorkspace:"请将该账号移回可用的工作区,然后移除并重新添加。",failureHintNoAccess:"该账号无法访问提供商的配额接口。",failureHintRetry:"稍后再试一次。",failureHintReconnect:"请移除这个失效账号并重新认证。",failureHintTemporary:"这看起来是临时问题,请稍后重试。",removeAndReadd:"移除并重新添加账号",autoRefreshFailed:"自动刷新失败"},antigravityChecklist:{title:"Antigravity OAuth 责任须知",subtitle:"认证前请完成全部 4 步。",mandatory:"必读",completion:"完成度",stepsCount:"{{current}}/4 步"},accountSafetyWarning:{title:"OAuth 账号安全提示",subtitle:"Issue #509 · Gemini + AGY OAuth 风险",firstLine:"Issue #509 记录了与 ccs agy 及 ccs gemini 与 ccs agy 共享账号使用相关的封禁/停用报告。",secondLine:"仅在您愿意承担 OAuth 与账号访问风险的前提下继续。",issueLabel:"查看 issue #509",proxySettingsLabel:"Gemini + AGY 控制:设置 > 代理"},cliproxyDialog:{name:"名称",provider:"提供商",account:"账号",accountOptional:"账号(选填)",model:"模型",modelOptional:"模型(选填)",defaultTarget:"默认目标",defaultTier:"默认档位",tierConfig:"档位配置",selectProvider:"选择提供商...",useDefaultAccount:"使用默认账号",defaultSuffix:"(默认)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"取消",create:"创建",creating:"创建中...",saveChanges:"保存更改",saving:"保存中...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"编辑复合变体:{{name}}",editSingleTitle:"编辑单一样式:{{name}}"},profileEditor:{profileInfo:"配置信息",profileName:"配置名称",filePath:"文件路径",lastModified:"最后修改",defaultTarget:"默认目标",quickUsage:"快速使用",runWithProfile:"使用配置运行",runOnDroid:"在 Droid 上运行",droidAliasExplicit:"Droid 别名(显式)",overrideToClaude:"切换为 Claude",overrideToClaudeExplicit:"切换为 Claude(显式)",setAsDefault:"设为默认",provider:"提供商",custom:"自定义"},settings:{sectionLoadFailed:"加载分区失败",unknownError:"发生未知错误",reloadPage:"重新加载页面",refresh:"刷新",copy:"复制",copied:"已复制",saved:"已保存",loading:"加载中...",configFileNotFound:"未找到配置文件"},settingsTabs:{web:"网页",env:"环境",think:"思考",proxy:"代理",auth:"认证",backup:"备份"},settingsAuth:{failedFetchTokens:"获取认证令牌失败",failedSaveTokens:"保存令牌失败",tokensUpdated:"令牌已更新,请重启 CLIProxy 生效。",failedRegenerate:"重新生成密钥失败",secretRegenerated:"新的管理密钥已生成,请重启 CLIProxy 生效。",failedReset:"重置令牌失败",tokensReset:"令牌已重置为默认值,请重启 CLIProxy 生效。",description:"配置 CLIProxy 认证令牌。修改后需要重启 CLIProxy。",apiKey:"API Key",custom:"自定义",apiKeyDesc:"Claude Code 通过该值向 CLIProxy 鉴权",apiKeyPlaceholder:"API key",managementSecret:"管理密钥",managementSecretDesc:"CCS Dashboard 使用该值访问 CLIProxy 管理接口",managementSecretPlaceholder:"管理密钥",generateSecret:"生成新的安全密钥",resetDefaults:"重置为默认值",resetDesc:"将 API key 和管理密钥都恢复为默认值。",saving:"保存中...",save:"保存"},settingsGlobalEnv:{description:"向所有非 Claude 订阅型配置注入环境变量(gemini、codex、agy、ghcp 等)",enabled:"全局环境变量已启用",disabled:"全局环境变量已禁用",enabledDesc:"环境变量将注入第三方配置",disabledDesc:"环境变量不会被注入",envVars:"环境变量",noneConfigured:"尚未配置环境变量",addNew:"新增变量",keyName:"KEY_NAME",value:"value",add:"添加",quickAdd:"快速添加常用变量",allConfigured:"常用变量已全部配置"},settingsBackups:{failedFetch:"获取备份失败",failedRestore:"恢复备份失败",restoreSuccess:"备份恢复成功",title:"设置备份",description:"恢复 settings.json 的历史版本。每次修改设置时会自动创建备份。",none:"暂无备份",noneHint:"修改设置后,备份会显示在这里",latest:"最新",restoring:"恢复中...",restore:"恢复",restoreConfirmTitle:"确认恢复备份?",restoreConfirmPrefix:"这将用以下备份替换当前设置:",restoreConfirmSuffix:"此操作不可撤销。",cancel:"取消"},settingsWebsearch:{description:"面向第三方配置(gemini、codex、agy 等)的 CLI 网页搜索",enabled:"WebSearch 已启用",disabled:"WebSearch 已禁用",checking:"正在检查状态...",providers:"提供商",noneConfigured:"未配置任何提供商",noneConfiguredHint:"请先安装 CLI 工具以启用网页搜索提供商",checkProviders:"检查可用提供商",installed:"已安装",notInstalled:"未安装",model:"模型:",howInstall:"如何安装 {{name}} CLI",installGlobally:"全局安装",requiresKey:"(需要 xAI API key)",freeTier:"(提供免费额度)",viewDocs:"查看文档"},settingsProxy:{failedLoadAgyMode:"加载 AGY 高级模式失败",failedUpdateAgyMode:"更新 AGY 高级模式失败",failedVerifyAgyMode:"校验 AGY 高级模式持久化失败",notPersistedAgyMode:"AGY 高级模式未成功持久化,配置可能被其他进程修改。",agyModeEnabled:"AGY 高级模式已启用。",agyModeDisabled:"AGY 高级模式已关闭。",typePhraseToContinue:"请输入“{{value}}”后继续。",description:"为基于代理的配置设置本地或远程 {{backend}} 连接",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"实例状态",connectionMode:"连接模式",local:"本地",remote:"远程",localDesc:"在本机运行 {{backend}} 二进制",remoteDesc:"连接到远程 {{backend}} 服务器",backendBinary:"后端二进制",stopProxyToSwitch:"请先在实例状态中停止正在运行的代理,再切换后端。",default:"默认",plusDesc:"完整支持包括 Kiro 和 GitHub Copilot 在内的提供商",originalDesc:"原版二进制(仅 Gemini、Codex、Antigravity)",variantsIncompatible:"现有 Kiro/Copilot 变体与 CLIProxyAPI 不兼容。请切换到 CLIProxyAPIPlus 或移除这些变体。",safety:"安全",agyModeTitle:"Antigravity 高级模式",agyModeDesc:"在 Add Account 与 `ccs agy` 流程中跳过 AGY 责任确认清单。",agyWarning:"仅在你充分理解 OAuth 封禁风险模式(#509)后使用。CCS 不对账号损失承担责任。",finalConfirm:"需要最终确认",finalConfirmDesc:"启用后会跳过 Dashboard 与 CLI 的 AGY 安全检查。请先阅读 issue #509,并输入精确短语后继续。",step1:"步骤 1",readIssue:"阅读 issue #509",step2:"步骤 2",typePrefix:"输入",typeSuffix:"以启用。",typePhraseAria:"输入 I ACCEPT RISK 以启用 Antigravity 高级模式",exactPhrase:"必须输入完全一致的短语。",enableAgyMode:"启用高级模式",toggleAgyMode:"切换 AGY 高级模式",fallbackSettings:"回退设置",enableFallback:"启用本地回退",enableFallbackDesc:"远程不可达时使用本地代理",autoStartLocal:"自动启动本地代理",autoStartLocalDesc:"发生回退时自动启动本地代理",advanced:"高级",debugMode:"调试模式",debugModeDesc:"在浏览器控制台输出开发诊断信息",debugModeEnabled:"调试模式已开启,请在浏览器控制台查看详细日志。",localProxy:"本地代理",port:"端口",autoStart:"自动启动",localAutoStartDesc:"需要时自动启动本地代理",remoteConfigTitle:"远程服务器配置",host:"主机",hostPlaceholder:"192.168.1.100 或 proxy.example.com",defaultPort:"默认:{{value}}",portPlaceholder:"留空使用 {{value}}",protocol:"协议",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"用于 /v1/* API 接口",apiKeyDesc:"用于 /v1/chat/completions 接口请求",managementKeyOptional:"管理密钥(可选)",managementKeyPlaceholder:"用于 /v0/management/* 接口",managementKeyDesc:"用于 Dashboard 管理接口。未设置时回退使用 API Key。",testing:"测试中...",testConnection:"测试连接",connectedLatency:"已连接({{value}}ms)",connectionFailed:"连接失败",invalidPortOrEmpty:"端口必须是 1 到 65535 的整数,或留空使用默认值",invalidLocalPort:"本地端口必须是 1 到 65535 的整数",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"为支持的模型配置扩展思考/推理。",supportedProviders:"支持的提供商",modeTitle:"思考模式",modeAutoDesc:"根据模型档位自动设置思考级别",modeOffDesc:"关闭扩展思考",modeManualDesc:"设置持久覆盖级别,或按次使用 CLI 参数",tierDefaults:"档位默认值",tierDefaultsDesc:"自动模式下各模型档位的默认思考级别。",persistentOverride:"持久覆盖",persistentOverrideDesc:"应用到所有会话。CLI 参数仍具有更高优先级。",enterCustomBudget:"输入自定义预算",apply:"应用",providerOverrides:"提供商覆盖({{count}})",providerOverridesDesc:"为特定提供商覆盖档位默认值。可按需添加自定义提供商键。",addProviderPlaceholder:"添加提供商键(例如 qwen)",showWarnings:"显示告警",showWarningsDesc:"当思考值被限制或调整时显示告警",cliEnvOverride:"CLI 与环境变量覆盖",supportLine1Prefix:"思考预算:",supportLine1Suffix:"(基于 token)",supportLine2Prefix:"推理强度:",supportLine2SuffixPrefix:"(后缀或 ",supportLine2SuffixPostfix:":medium/high/xhigh)",supportLine3Prefix:"Codex 后缀会固定强度(例如 ",supportLine3Suffix:");无后缀模型使用 Thinking mode。"},analytics:{title:"分析",subtitle:"追踪使用情况与洞察",month:"本月",allTime:"全部时间",updated:"更新于 {{value}}"},analyticsSummary:{totalTokens:"总 Token",totalTokensSubtitle:"输入 {{input}} / 输出 {{output}}",totalCost:"总成本",totalCostSubtitle:"日均 ${{value}}",cacheTokens:"缓存 Token",cacheTokensSubtitle:"${{cost}}(占成本 {{percent}}%)",inputCost:"输入成本",outputCost:"输出成本",tokensSubtitle:"{{value}} 个 token"},apiProfiles:{title:"API 配置",new:"新建",searchPlaceholder:"搜索配置...",loadingProfiles:"正在加载配置...",failedLoadTitle:"加载配置失败",failedLoadDesc:"无法获取 API 配置,请稍后重试。",retry:"重试",noProfilesYet:"还没有 API 配置",noProfilesDesc:"创建你的第一个配置以连接自定义 API 端点",createProfile:"创建配置",noProfileMatch:"没有匹配“{{query}}”的配置",profileCount:"{{count}} 个配置",configuredCount:"{{count}} 个已配置",deleteProfileTitle:"删除配置",deleteProfileDesc:"确定要删除“{{name}}”吗?这会移除设置文件且无法恢复。",delete:"删除",unsavedChangesTitle:"未保存的更改",unsavedChangesDesc:"你在“{{current}}”中有未保存内容,是否丢弃并切换到“{{next}}”?",discardSwitch:"丢弃并切换"},accountsPage:{title:"账号",managePrefix:"统一管理",manageSuffix:"账号与池化接入流程。",mobileManageSuffix:"的连续性配置。",primaryActions:"主要操作",createAccount:"创建账号",authClaudeInPool:"在 Pool 中认证 Claude",openClaudePoolSettings:"打开 Claude Pool 设置",openCliProxyClaudePool:"打开 CLIProxy Claude Pool",migrationFollowup:"迁移后续处理",legacyContextPending:"{{count}} 个账号仍需首次模式确认。",legacyContinuityPending:"{{count}} 个共享账号仍处于标准旧版连续性深度。",confirmingLegacy:"正在确认旧版策略...",confirmLegacy:"确认旧版策略({{count}})",noLegacyFollowup:"暂无待处理的迁移后续项。",continuityGuide:"连续性指南",expandWhenNeeded:"按需展开查看。",sharedStandard:"共享标准",sharedStandardDesc:"仅同步项目工作区。适合大多数团队。",sharedDeeper:"共享更深",sharedDeeperPrefix:"额外包含",isolated:"隔离",isolatedDesc:"不建立链接。适合严格隔离场景。",quickCommands:"快捷命令",quickCommandsDesc:"复制后在终端运行。",workspaceBadge:"ccs auth 工作区",historySyncBadge:"历史同步控制",authAccounts:"认证账号",tableScopePrefix:"该表仅展示",tableScopeMiddle:"账号。模式/分组/深度调整请使用",tableScopeSuffix:"。",accountMatrix:"账号矩阵",sharedTotalDesc:"共享总数:{{count}}。可执行 Sync 设置和旧版确认操作。",loadingAccounts:"正在加载账号..."},health:{justNow:"刚刚",secondsAgo:"{{count}} 秒前",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",systemHealth:"系统健康",build:"构建 {{version}}",lastScan:"上次扫描:",autoRefresh:"自动刷新:",refresh:"刷新",checks:"检查项",version:"版本",platform:"平台",liveMonitoring:"实时监控已启用",copied:"已复制到剪贴板",refreshing:"正在刷新健康检查...",fix:"修复",applyFix:"应用修复",healthLabel:"健康"},updates:{actionRequired:"待处理",done:"已完成",all:"全部",inboxTitle:"更新收件箱",inboxSubtitle:"先处理操作,再将更新标记为完成或忽略。",needsAction:"需处理",doneCount:"已完成",searchPlaceholder:"搜索操作或命令",noNotices:"当前视图下没有通知。",noUpdates:"暂无更新。",published:"发布于 {{date}}",markDone:"标记完成",dismiss:"忽略",reopen:"重新打开",doNext:"下一步",impactedIntegrations:"受影响的集成",impactedDesc:"根据更新范围与路由匹配的相关区域。",whyMatters:"为什么重要",whyMattersDesc:"仅保留简要背景,不展示冗长发布说明。",open:"打开",progressNeedsAction:"需处理",progressInReview:"审阅中",progressDone:"已完成",progressDismissed:"已忽略",statusNew:"新",statusStable:"稳定",statusPlanned:"计划中",dashboard:"Dashboard",cliUsage:"CLI 用法"},cliproxyPage:{connected:"已连接",notConnected:"未连接",variant:"变体",parentNotConnected:"上游未连接",viaProvider:"通过 {{provider}}",emptyTitle:"CCS 配置管理",emptyDesc:"管理 CLIProxy 提供商的 OAuth 认证、账号偏好与模型选择,配置 CCS 的请求路由。",emptyControlPanelPrefix:"如需查看实时用量和监控,请前往",controlPanel:"控制面板",quickSetup:"快速设置",accountManagement:"CCS 级账号管理",providers:"提供商",variants:"变体",providerCount:"{{count}} 个提供商",connectedCount:"{{count}} 个已连接",variantDisplay:"{{name}}({{provider}} 变体)"},copilotPage:{title:"Copilot",subtitle:"GitHub Copilot 代理",setup:"安装",auth:"认证",daemon:"守护进程",unofficialTitle:"非官方 API - 风险自负",unofficialItem1:"逆向接口,可能随时失效",unofficialItem2:"过度使用可能触发账号限制",unofficialItem3:"CCS 不提供担保,也不承担责任",yes:"是",no:"否",installed:"已安装",missing:"缺失",integration:"集成",enabled:"已启用",disabled:"已禁用",github:"GitHub",connected:"已连接",notConnected:"未连接",authenticate:"去认证",authenticating:"认证中...",status:"状态",running:"运行中",stopped:"已停止",port:"端口",stopping:"停止中...",stop:"停止",starting:"启动中...",start:"启动",installing:"安装中...",installCopilotApi:"安装 copilot-api",proxy:"代理",active:"活跃",inactive:"未激活"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Cursor 集成专用控制面板",unofficialTitle:"非官方 API - 风险自负",unofficialItem1:"逆向集成可能随时失效",unofficialItem2:"滥用或过量使用可能导致账号受限",unofficialItem3:"CCS 不提供担保,也不承担责任",integration:"集成",authentication:"认证",daemon:"守护进程",enabled:"已启用",disabled:"已禁用",expired:"已过期",connected:"已连接",notConnected:"未连接",running:"运行中",stopped:"已停止",actions:"操作",disableIntegration:"禁用集成",enableIntegration:"启用集成",autoDetectAuth:"自动检测认证",manualAuthImport:"手动导入认证",stopDaemon:"停止守护进程",startDaemon:"启动守护进程",port:"端口",configuration:"Cursor 配置",lastModified:"最后修改:",neverSaved:"从未保存",saving:"保存中...",save:"保存",modelConfig:"模型配置",settings:"设置",info:"信息",presets:"预设",presetsDesc:"应用预设模型映射",modelMapping:"模型映射",modelMappingDesc:"为不同档位配置使用模型",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用。",opusModel:"Opus(最强)",opusModelDesc:"复杂推理与最高质量输出。",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"日常编码和通用对话。",haikuModel:"Haiku(快速)",haikuModelDesc:"低延迟与轻量请求。",runtimeSettings:"运行时设置",autoStartDaemon:"自动启动守护进程",autoStartDesc:"在使用集成时自动启动 Cursor 守护进程。",ghostMode:"Ghost 模式",ghostModeDesc:"请求时附带 x-ghost-mode 以减少遥测。",provider:"提供商",filePath:"文件路径",availableModels:"可用模型",loadingModels:"加载模型中...",noModels:"暂无模型元数据,请先启动守护进程后刷新。",default:"默认",rawConfiguration:"原始配置(JSON)",manualImportTitle:"手动导入 Cursor 认证",manualImportDesc:"若无法自动检测,请提供 Cursor access token 与 machine ID。",accessToken:"访问令牌",accessTokenPlaceholder:"粘贴 Cursor access token",machineId:"机器 ID",machineIdPlaceholder:"32 位十六进制(无连字符 UUID)",cancel:"取消",import:"导入",selectModel:"选择模型",useDefaultModel:"使用默认模型",availableModelCount:"可用模型({{count}})",invalidPort:"端口必须是 1 到 65535 之间的整数",defaultModelRequired:"默认模型必填",savedConfig:"Cursor 配置与模型映射已保存",failedSaveConfig:"保存配置失败",modelsLoadingWait:"模型仍在加载中,请稍后再应用预设。",noModelsAvailable:"暂无可用模型,请先启动守护进程并刷新。",appliedCodexPreset:"已应用 GPT-5.3 Codex 预设",appliedClaudePreset:"已应用 Claude 4.6 预设",appliedGeminiPreset:"已应用 Gemini 3 预设",integrationEnabled:"Cursor 集成已启用",integrationDisabled:"Cursor 集成已禁用",failedUpdateIntegration:"更新集成状态失败",credentialsImported:"Cursor 凭据已导入",autoDetectFailed:"自动检测失败",manualRequired:"Token 和 machine ID 为必填项",manualImportFailed:"手动导入失败",failedStartDaemon:"启动守护进程失败",daemonStarted:"守护进程已启动",daemonStartedWithPid:"守护进程已启动(PID: {{pid}})",failedStopDaemon:"停止守护进程失败",daemonStopped:"守护进程已停止",rawLoading:"原始设置仍在加载,请稍后重试。",invalidJson:"JSON 无效",rawSaved:"原始设置已保存",rawChanged:"原始设置已被外部修改,请刷新后重试。",failedSaveRaw:"保存原始设置失败",savedAll:"Cursor 配置已保存"},droidPage:{loadingDiagnostics:"加载 Droid 诊断中...",failedDiagnostics:"加载 Droid 诊断失败。",overview:"概览",byok:"BYOK",docs:"文档",runtimeInstall:"运行时与安装",status:"状态",detected:"已检测",notFound:"未找到",detectionSource:"检测来源",binaryPath:"二进制路径",installDirectory:"安装目录",version:"版本",overridePath:"覆盖路径(CCS_DROID_PATH)",configFiles:"配置文件",path:"路径",resolved:"解析结果",size:"大小",lastModified:"最后修改",parseWarning:"解析告警:{{value}}",readWarning:"读取告警:{{value}}",warnings:"告警",byokSummary:"BYOK 概览",activeModelSelector:"当前模型选择器",customModels:"自定义模型",ccsManaged:"CCS 管理",userManaged:"用户管理",malformedEntries:"异常条目",providers:"提供商",none:"无",customModelsTitle:"自定义模型",modelName:"名称 / 模型",provider:"提供商",baseUrl:"Base URL",noCustomModels:"没有自定义模型",docsAlignedNotes:"文档对齐说明",factoryDocs:"Factory 文档",providerFactCheckDocs:"Provider 校验文档",providerValues:"Provider 值:{{value}}",settingsHierarchy:"Settings 层级:{{value}}",settingsTitle:"Droid BYOK 设置",fixJsonBeforeQuickSettings:"请先修复 JSON 语法,再使用快速设置。",fixJsonBeforeReasoning:"请先修复 JSON 语法,再更新 BYOK 推理设置。",unableUpdateReasoning:"无法更新所选 BYOK 模型的推理设置。",fixJsonBeforeBudget:"请先修复 JSON 语法,再更新思考预算。",anthropicOnlyBudget:"思考预算仅适用于 Anthropic BYOK 模型。",invalidJson:"JSON 无效:{{value}}",saved:"Droid 设置已保存",changedExternally:"Droid 设置已被外部修改,请刷新后重试。",failedSave:"保存 Droid 设置失败"},sharedPage:{commands:"命令",skills:"技能",agents:"代理",title:"共享数据",subtitle:"在 Claude 实例间共享的命令、技能和代理",totalShared:"共享总数",visible:"可见",markdownDetail:"Markdown 详情视图",filterPrefix:"筛选:",configurationRequired:"需要配置",countsUnavailable:"统计不可用",retryCounts:"重试统计",filterPlaceholder:"按名称、描述或路径筛选 {{tab}}",showing:"显示 {{visible}} / {{total}} 个{{tab}}",showingQuery:"(关键字“{{query}}”)",refreshing:"(刷新中...)",loadingShared:"正在加载共享{{tab}}...",failedLoadShared:"加载共享{{tab}}失败",retry:"重试",noSharedFound:"未找到共享{{tab}}。请运行 `ccs sync` 或在共享目录添加内容。",noMatch:"没有匹配“{{query}}”的{{tab}}。",selectOne:"选择一个{{tab}}查看完整内容。",pathLabel:"路径",resolvedSource:"解析后来源",loadingMarkdown:"正在加载 Markdown 内容...",failedLoadContent:"加载内容失败",retryContent:"重试内容加载",noMarkdown:"暂无 Markdown 内容。"}}},vi:{translation:{locale:{en:"Tiếng Anh","zh-CN":"Tiếng Trung giản thể",vi:"Tiếng Việt"},layout:{languageSwitcher:"Ngôn ngữ"},nav:{general:"Chung",home:"Trang chủ",analytics:"Phân tích",identityAccess:"Nhận dạng & Quyền truy cập",apiProfiles:"Hồ sơ API",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Tổng quan",controlPanel:"Bảng điều khiển",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",accounts:"Tài khoản",allAccounts:"Tất cả tài khoản",sharedData:"Dữ liệu dùng chung",compatibleClis:"CLI tương thích",factoryDroid:"Factory Droid",system:"Hệ thống",health:"Sức khỏe",settings:"Cài đặt",openrouterTooltip:"Nổi bật: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"Hồ sơ",cliproxy:"CLIProxy",accounts:"Tài khoản",health:"Sức khỏe",configurationRequired:"Cần cấu hình"},auth:{dashboardTitle:"Bảng điều khiển CCS",loginDescription:"Nhập thông tin đăng nhập của bạn để truy cập bảng điều khiển",username:"Tên người dùng",password:"Mật khẩu",usernamePlaceholder:"Nhập tên người dùng",passwordPlaceholder:"Nhập mật khẩu",signIn:"Đăng nhập",signingIn:"Đang đăng nhập...",loginFailed:"Đăng nhập không thành công"},commonToast:{apiKeyRequired:"Cần có khóa API",accountAddedPresetFailed:"Đã thêm tài khoản nhưng không áp dụng được preset mặc định",settingsCopied:"Đã sao chép cài đặt vào bảng nhớ tạm",enterPresetName:"Vui lòng nhập tên preset để lưu",codeCopied:"Đã sao chép mã vào bảng nhớ tạm",copyCodeFailed:"Không sao chép được mã",appliedModelAllTiers:"Đã áp dụng mô hình cho tất cả các tier",settingsSaved:"Đã lưu cài đặt",defaultTargetUpdated:"Đã cập nhật mục tiêu mặc định",failedUpdateDefaultTarget:"Không cập nhật được mục tiêu mặc định thành {{target}}{{suffix}}"},profileDialog:{editTitle:"Chỉnh sửa hồ sơ",createTitle:"Tạo hồ sơ API",name:"Tên",namePlaceholder:"my-api",baseUrl:"URL cơ sở",baseUrlPlaceholder:"https://api.example.com",apiKey:"Khóa API",defaultModel:"Mô hình mặc định (ANTHROPIC_MODEL)",defaultModelHint:"Để trống để sử dụng: {{model}}",modelMappingTitle:"Ánh xạ mô hình (Opus/Sonnet/Haiku)",modelMappingDesc:"Cấu hình ID mô hình riêng cho từng tier. Hữu ích với API proxy định tuyến từng loại mô hình đến backend khác nhau.",opusModel:"Mô hình Opus (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Mô hình Sonnet (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Mô hình Haiku (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Hủy bỏ",saving:"Đang lưu...",update:"Cập nhật",create:"Tạo"},modelTierMapping:{title:"Ánh xạ tầng mô hình",advanced:"Nâng cao",description:"Định cấu hình các mô hình khác nhau cho các cấp độ opus/sonnet/haiku của Claude Code.",autoSuggest:"Tự động đề xuất dựa trên {{provider}}",opusPlaceholder:"vd: anthropic/claude-opus-4",sonnetPlaceholder:"ví dụ: anthropic/claude-sonnet-4",haikuPlaceholder:"vd: anthropic/claude-3.5-haiku",footer:"Các biến này thiết lập ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"nhạy cảm",none:"Không có biến môi trường nào được cấu hình.",noneHint:"Thêm biến bằng ô nhập bên dưới hoặc chỉnh sửa trực tiếp JSON.",addVariable:"Thêm biến môi trường",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"giá trị"},setupVariant:{using:"Sử dụng:",variantNameRequired:"Tên biến thể *",variantNamePlaceholder:"ví dụ: my-gemini, g3, flash",invokeHintPrefix:"Sử dụng tên này để gọi:",model:"Mô hình",modelPlaceholder:"ví dụ: gemini-2.5-pro, claude-opus-4-5",choosePresetInstead:"Hoặc chọn từ preset có sẵn",selectModel:"Chọn mô hình",customModelName:"Tên mô hình tùy chỉnh...",enterAnyModel:"Nhập bất kỳ tên mô hình nào được CLIProxy hỗ trợ",defaultModel:"Mặc định: {{model}}",providerDefault:"mặc định theo nhà cung cấp",back:"Quay lại",skip:"Bỏ qua",creating:"Đang tạo...",createVariant:"Tạo biến thể",skipHint:"Bỏ qua nếu bạn chỉ muốn thêm tài khoản mà không tạo biến thể"},customPresetDialog:{title:"Preset tùy chỉnh",presetNameOptional:"Tên preset (tùy chọn)",presetNamePlaceholder:"ví dụ: Preset tùy chỉnh của tôi",codexTipPrefix:"Mẹo Codex: hậu tố",codexTipSuffix:"nỗ lực ghim. Các mô hình không có hậu tố sử dụng cài đặt Tư duy.",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không yêu cầu cấp mô hình cụ thể",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Đối với các nhiệm vụ lý luận phức tạp",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Cân bằng giữa tốc độ và khả năng",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Phản hồi nhanh cho các tác vụ đơn giản",cancel:"Hủy bỏ",savePreset:"Lưu preset",applyPreset:"Áp dụng cài sẵn"},componentModelSelector:{selectModel:"Chọn mô hình",availableModelsCount:"Mô hình khả dụng ({{count}})",preview:"Xem trước"},copilotSettings:{enableCopilot:"Bật Copilot",enableCopilotDesc:"Cho phép sử dụng đăng ký GitHub Copilot",basicSettings:"Cài đặt cơ bản",accountType:"Loại tài khoản",accountTypeIndividual:"Cá nhân",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Giới hạn tỷ lệ",rateLimitSeconds:"Giới hạn tốc độ (giây)",noLimit:"Không giới hạn",waitOnRateLimit:"Chờ giới hạn tỷ lệ",waitOnRateLimitDesc:"Chờ thay vì lỗi khi đạt đến giới hạn",daemonSettings:"Cài đặt Daemon",autoStartDaemon:"Daemon tự động khởi động",autoStartDaemonDesc:"Bắt đầu copilot-api khi sử dụng hồ sơ"},providerModelSelector:{selectModel:"Chọn mô hình",noModelsForProvider:"Không có mô hình nào cho nhà cung cấp này",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Gói miễn phí",paidTier:"Gói trả phí",modelKnownIssues:"Mô hình này có vấn đề đã biết",viewIssueDetails:"Xem chi tiết vấn đề",modelDeprecated:"Mô hình này không được dùng nữa",recommended:"Đề xuất",allModelsCount:"Tất cả mô hình ({{count}})",noModelsAvailable:"Không có mô hình khả dụng"},createAuthProfileDialog:{title:"Tạo tài khoản mới",description:"Hồ sơ xác thực yêu cầu đăng nhập Claude CLI. Chạy lệnh dưới đây trong terminal của bạn. Bạn có thể chỉnh sửa chế độ đồng bộ hóa, nhóm và độ liên tục sau này từ bảng Tài khoản.",profileName:"Tên hồ sơ",profileNamePlaceholder:"ví dụ: công việc, cá nhân, khách hàng",invalidProfileName:"Tên phải bắt đầu bằng một chữ cái và chỉ chứa các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới.",enableSharedHistory:"Bật đồng bộ hóa lịch sử chia sẻ với các tài khoản xác thực ccs khác",historySyncGroupOptional:"Nhóm đồng bộ hóa lịch sử (tùy chọn)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Để trống để sử dụng nhóm chia sẻ mặc định. Dấu cách được chuẩn hóa thành dấu gạch ngang.",deeperContinuity:"Nâng cao: chế độ liên tục sâu hơn",deeperContinuityHint:"Thêm đồng bộ cho session-env, file-history, shell-snapshots và todos. Thông tin xác thực vẫn tách biệt.",invalidContextGroup:"Nhóm phải bắt đầu bằng một chữ cái và chỉ sử dụng các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới (tối đa {{max}} ký tự).",command:"Lệnh",commandFallback:"ccs auth create <name>",afterRunPrefix:"Sau khi chạy lệnh:",afterRunStep1:"Hoàn tất đăng nhập Claude trong trình duyệt của bạn",afterRunStep2:"Quay lại đây và làm mới để xem tài khoản mới",poolingHint:"Muốn dùng định tuyến Claude OAuth dạng pool? Dùng CLIProxy Claude pool từ nút hành động ở trang Tài khoản.",close:"Đóng",copied:"Đã sao chép!",copyCommand:"Sao chép lệnh"},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Khác"},cliproxyOverviewComponents:{availableModels:"Mô hình khả dụng",noModelsAvailable:"Không có mô hình khả dụng",startSessionHint:"Bắt đầu phiên CLIProxy để tải danh sách mô hình khả dụng",totalCount:"tổng cộng {{count}}",availableThroughGroupedByProvider:"Các mô hình khả dụng qua {{backendLabel}}, được nhóm theo nhà cung cấp",moreCount:"+{{count}} thêm"},categorizedModelSelector:{selectModel:"Chọn mô hình",noModelsAvailable:"Không có mô hình khả dụng",modelPlaceholder:"Mô hình..."},openrouterQuickStart:{recommended:"Đề xuất",title:"Bắt đầu với OpenRouter",description:"Truy cập các mô hình {{modelCountLabel}} từ OpenAI, Anthropic, Google, Meta, v.v. - tất cả đều thông qua một API.",featureOneApi:"Một API cho mọi nhà cung cấp",featureTierMapping:"Ánh xạ tầng mô hình",createOpenRouterProfile:"Tạo hồ sơ OpenRouter",getApiKeyAt:"Nhận khóa API của bạn tại",or:"hoặc",createCustomProfile:"Tạo hồ sơ API tùy chỉnh"},alibabaCodingPlanQuickStart:{recommended:"Đề xuất",title:"Dùng thử Alibaba Coding Plan",description:"Sử dụng Alibaba Cloud Coding Plan qua endpoint tương thích Anthropic cho tác vụ lập trình.",featureEndpoint:"Endpoint tương thích Anthropic",featureKeyFormat:"Khóa API sk-sp chuyên dụng",createAlibabaProfile:"Tạo hồ sơ Alibaba Coding Plan",readGuideAt:"Xem hướng dẫn tại"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan qua endpoint Anthropic",add:"Thêm"},credentialHealth:{title:"Tình trạng thông tin xác thực",ready:"Sẵn sàng",noCredentialsConfigured:"Không có thông tin xác thực nào được định cấu hình. Sử dụng các nút đăng nhập ở trên để xác thực.",neverUsed:"Chưa bao giờ sử dụng",justNow:"Vừa rồi",unknown:"Không xác định",daysAgo:"{{count}} ngày trước",hoursAgo:"{{count}} giờ trước",minutesAgo:"{{count}} phút trước"},proxyStatusWidget:{justNow:"vừa xong",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",syncReady:"Sẵn sàng đồng bộ hóa",noConfig:"Không có cấu hình",remoteProxy:"Proxy từ xa",active:"Đang hoạt động",trafficAutoRouted:"Lưu lượng truy cập tự động được định tuyến đến máy chủ từ xa",tooltipSync:"Đồng bộ hóa hồ sơ với CLIProxy",tooltipRestart:"Khởi động lại",tooltipStop:"Dừng lại",tooltipClose:"Đóng",tooltipVersionSettings:"Cài đặt phiên bản",versionManagement:"Quản lý phiên bản",selectVersionPlaceholder:"Chọn phiên bản để cài đặt...",stable:"(ổn định)",install:"Cài đặt",versionsAboveUnstable:"Các phiên bản trên {{version}} có vấn đề đã biết",versionsKnownIssues:"Phiên bản {{version}} có vấn đề đã biết",lastChecked:"Đã kiểm tra lần cuối {{time}}",notRunning:"Không chạy",start:"Bắt đầu",port:"Cổng {{port}}",sessionCount:"{{count}} phiên",sessionCount_other:"{{count}} phiên",installFaultyTitle:"Cài đặt phiên bản có lỗi đã biết?",installFaultyDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này nằm trong dải lỗi đã biết <strong>{{range}}</strong>.",installFaultyWarning:"Phiên bản này có lỗi đã biết và có thể cài đặt thất bại hoặc làm proxy ở trạng thái xấu.",installUnstableTitle:"Cài đặt phiên bản không ổn định?",installUnstableDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này cao hơn phiên bản ổn định tối đa <strong>v{{maxStable}}</strong>.",installUnstableWarning:"Phiên bản này đã biết có vấn đề về độ ổn định và có thể gây ra hành vi không mong muốn.",installUnstableConfirm:"Bạn có chắc chắn muốn tiếp tục không?",cancel:"Hủy bỏ",installAnyway:"Vẫn cài đặt",clickToDowngrade:"Bấm để hạ cấp",clickToUpdate:"Bấm để cập nhật"},syncStatusCard:{profileSync:"Đồng bộ hồ sơ",ready:"Sẵn sàng",noConfig:"Không có cấu hình",syncsProfilesDesc:"Đồng bộ hóa cấu hình API với cấu hình CLIProxy cục bộ",runDoctorHint:"Chạy <code>ccs doctor --fix</code> để tạo cấu hình.",details:"Chi tiết",syncNow:"Đồng bộ ngay"},syncDialog:{title:"Đồng bộ hóa hồ sơ với CLIProxy cục bộ",description:"Đồng bộ hóa cấu hình API CCS của bạn với CLIProxy config.yaml cục bộ.",noProfiles:"Không có profile nào để đồng bộ.",createProfilesFirst:"Trước tiên hãy tạo hồ sơ API bằng tab Hồ sơ.",modelLabel:"Mô hình:",ready:"Sẵn sàng",profilesToSync_one:"{{count}} hồ sơ để đồng bộ hóa",profilesToSync_other:"{{count}} hồ sơ cần đồng bộ hóa",cancel:"Hủy bỏ",syncing:"Đang đồng bộ hóa...",synced:"Đã đồng bộ hóa!",syncNow:"Đồng bộ ngay"},errorLogs:{title:"Nhật ký lỗi",failedRequests_one:"{{count}} yêu cầu thất bại",failedRequests_other:"{{count}} yêu cầu thất bại",cliproxyDiagnostics:"Chẩn đoán CLIProxy",showingCount:"Hiển thị 50 trong số {{total}} nhật ký",selectLog:"Chọn nhật ký để xem chi tiết",failedLoadContent:"Không tải được nội dung nhật ký",copyAbsolutePath:"Sao chép đường dẫn tuyệt đối",copyRawContent:"Sao chép nội dung nhật ký thô",tabOverview:"Tổng quan",tabHeaders:"Tiêu đề",tabRequest:"Yêu cầu",tabResponse:"Phản hồi",tabRaw:"Raw",modelLabel:"Mô hình:",quotaResetsIn:"Quota sẽ được đặt lại sau",method:"Phương thức",provider:"Nhà cung cấp",version:"Phiên bản",endpoint:"Điểm cuối",url:"URL",timestamp:"Dấu thời gian",na:"không áp dụng",noHeaders:"Không có tiêu đề nào",noRequestBody:"Không có nội dung yêu cầu",noResponseBody:"Không có nội dung phản hồi",rateLimitedMsg:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch. Mô hình {{model}} đã hết quota.",rateLimitedMsgNoModel:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch.",authFailedMsg:"Xác thực không thành công. Xác thực lại thông qua Cài đặt CLIProxy hoặc kiểm tra khóa API.",notFoundMsg:"Không tìm thấy điểm cuối. Điểm cuối này có thể không tồn tại trên nhà cung cấp này.",serverErrorMsg:"Lỗi máy chủ từ upstream. Hãy thử lại sau hoặc kiểm tra trang trạng thái của nhà cung cấp.",timeoutMsg:"Yêu cầu hết thời gian chờ. Kiểm tra kết nối mạng hoặc tăng timeout.",unknown:"không rõ"},editAccountContext:{title:"Chỉnh sửa đồng bộ hóa lịch sử",description:'Định cấu hình cách "{{name}}" chia sẻ lịch sử và tính liên tục với các tài khoản xác thực ccs khác.',syncMode:"Chế độ đồng bộ",selectContextMode:"Chọn chế độ ngữ cảnh",isolatedOption:"tách biệt (không đồng bộ)",sharedOption:"chia sẻ (đã bật đồng bộ)",sharedModeHint:"Chế độ chia sẻ sử dụng lại ngữ cảnh không gian làm việc cho các tài khoản trong cùng một nhóm đồng bộ lịch sử.",isolatedModeHint:"Chế độ biệt lập giúp tài khoản này tách biệt hoàn toàn với các tài khoản xác thực ccs khác.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",groupPlaceholder:"mặc định",groupHint:"Chuẩn hóa thành chữ thường (dấu cách trở thành dấu gạch ngang). Được phép: chữ cái, số, _ , - (tối đa {{max}} ký tự).",invalidGroup:"Nhập tên nhóm hợp lệ bắt đầu bằng một chữ cái.",continuityDepth:"Độ sâu liên tục",selectContinuityDepth:"Chọn độ sâu liên tục",standardOption:"tiêu chuẩn (chỉ đồng bộ project)",deeperOption:"tính liên tục sâu hơn (nâng cao)",deeperHint:"Chế độ nâng cao cũng đồng bộ hóa phiên-env, lịch sử tệp, ảnh chụp nhanh shell và todos.",standardHint:"Chế độ tiêu chuẩn chỉ đồng bộ hóa bối cảnh không gian làm việc của dự án.",credentialsIsolated:"Thông tin xác thực và .anthropic vẫn được tách riêng cho mỗi tài khoản ở tất cả các chế độ.",cancel:"Hủy bỏ",save:"Lưu",saving:"Đang lưu..."},historySyncLearningMap:{title:"Cách đồng bộ hóa lịch sử hoạt động",description:"Tách biệt -> Chia sẻ -> Sâu hơn. Dùng Sync trên từng dòng để áp dụng thay đổi.",learningMap:"Bản đồ học tập",isolated:"Tách biệt",shared:"Chia sẻ",deeper:"Sâu hơn",cliproxyManaged_one:"{{count}} Tài khoản nhóm CLIProxy Claude được quản lý trong trang Action Center / CLIProxy.",cliproxyManaged_other:"{{count}} Tài khoản CLIProxy Claude pool được quản lý trong trang Action Center / CLIProxy.",showDetails:"Hiển thị chi tiết: nhóm, chuyển đổi và chính sách kế thừa",modeSwitch:"Chuyển đổi chế độ",modeSwitchDesc:"Hộp thoại đồng bộ hóa cho phép người dùng di chuyển giữa cách ly/chia sẻ và chọn tính liên tục sâu hơn.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",historySyncGroupDesc:"Cùng một nhóm nghĩa là chia sẻ cùng bối cảnh project. Nếu để trống sẽ dùng nhóm mặc định."},accountsTable:{name:"Tên",type:"Kiểu",defaultBadge:"mặc định",created:"Ngày tạo",lastUsed:"Được sử dụng lần cuối",historySync:"Đồng bộ hóa lịch sử",actions:"Hành động",syncTitle:"Chỉnh sửa chế độ đồng bộ, nhóm và độ sâu liên tục",confirmLegacyTitle:"Xác nhận chế độ hiện tại của tài khoản cũ này là rõ ràng",sync:"Đồng bộ hóa",confirm:"Xác nhận",active:"Đang hoạt động",setDefault:"Đặt mặc định",deleteAccount:"Xóa tài khoản",cannotDeleteDefault:"Không thể xóa tài khoản mặc định",noAccounts:"Không tìm thấy tài khoản xác thực CCS nào. Sử dụng ccs auth create để thêm tài khoản.",resetToDefault:"Đặt lại về mặc định CCS",deleteDialogTitle:"Xóa tài khoản",deleteDialogDesc:'Bạn có chắc chắn muốn xóa tài khoản "{{name}}" không? Thao tác này sẽ xóa hồ sơ và tất cả dữ liệu phiên của nó. Không thể hoàn tác hành động này.',cancel:"Hủy bỏ",delete:"Xóa",sharedGroupStandard:"chia sẻ ({{group}}, tiêu chuẩn)",sharedGroupDeeper:"chia sẻ ({{group}}, sâu hơn)",sharedGroupLegacy:"chia sẻ ({{group}}, kế thừa tiêu chuẩn)",isolatedLegacy:"tách biệt (mặc định cũ)",isolated:"tách biệt"},addAccountDialog:{title:"Thêm tài khoản {{displayName}}",descKiro:"Chọn phương thức xác thực Kiro, sau đó xác thực qua trình duyệt hoặc nhập từ Kiro IDE.",descDeviceCode:"Nhấp vào Xác thực. Mã xác minh sẽ xuất hiện để bạn nhập vào trang web của nhà cung cấp.",descOauth:"Nhấp vào Xác thực để nhận URL OAuth. Mở nó trong bất kỳ trình duyệt nào để đăng nhập.",powerUserEnabled:"Đã bật chế độ power user",powerUserSkipped:"Danh sách kiểm tra trách nhiệm của AGY bị bỏ qua khỏi Cài đặt > Proxy. Bạn chấp nhận hoàn toàn trách nhiệm về rủi ro tài khoản/OAuth.",authMethod:"Phương thức xác thực",selectKiroAuthMethod:"Chọn phương thức xác thực Kiro",nicknameRequired:"Biệt danh (bắt buộc)",nicknameOptional:"Biệt danh (tùy chọn)",nicknamePlaceholder:"ví dụ: công việc, cá nhân",nicknameRequiredHint:"Bắt buộc với nhà cung cấp này. Dùng tên thân thiện duy nhất (ví dụ: work, personal).",nicknameOptionalHint:"Một cái tên thân thiện để xác định tài khoản này. Tự động tạo từ email nếu để trống.",waitingForAuth:"Đang chờ xác thực...",deviceCodeHint:"Hộp thoại mã xác minh sẽ sớm xuất hiện. Nhập mã trên trang web của nhà cung cấp.",browserHint:"Hoàn tất xác thực trong trình duyệt của bạn. Hộp thoại này sẽ tự động đóng lại.",openUrlLabel:"Mở URL này trong bất kỳ trình duyệt nào để đăng nhập:",copied:"Đã sao chép",copy:"Sao chép",open:"Mở",popupBlocked:"Cửa sổ bật lên bị chặn. Sao chép URL ở trên và mở thủ công trong trình duyệt của bạn.",redirectPasteLabel:"Chuyển hướng không hoạt động? Dán URL gọi lại:",callbackPlaceholder:"Dán URL chuyển hướng vào đây...",submitCallback:"Gửi cuộc gọi lại",submitting:"Đang gửi...",preparingUrl:"Đang chuẩn bị URL đăng nhập...",cancel:"Hủy bỏ",importingToken:"Đang nhập token từ Kiro IDE...",authenticate:"Xác thực",importFromIde:"Nhập từ IDE",importing:"Đang nhập..."},flowViz:{backToProviders:"Quay lại nhà cung cấp",showDetails:"Hiển thị chi tiết",hideDetails:"Ẩn chi tiết",resetLayout:"Đặt lại bố cục",provider:"Nhà cung cấp",totalRequests:"Tổng số yêu cầu",accounts:"Tài khoản",connectionTimeline:"Dòng thời gian kết nối",noRecentConnections:"Không có kết nối gần đây"},quickStats:{totalRequests:"Tổng số yêu cầu",successRate:"Tỷ lệ thành công",totalTokens:"Tổng số token",activeModels:"Mô hình hoạt động"},authMonitor:{accounts:"Tài khoản",accountsCount:"{{count}} tài khoản",success:"Thành công",failed:"Thất bại",successRate:"Tỷ lệ thành công"},accountCard:{resumeAccount:"Tiếp tục tài khoản",pauseAccount:"Tạm dừng tài khoản",quotaLoading:"Hạn ngạch...",quota:"hạn ngạch",quotaUnavailable:"Thông tin quota chưa khả dụng",reauthNeeded:"Cần xác thực lại",failureLabelReauth:"Xác thực lại",failureLabelWorkspace:"Workspace",failureLabelNoAccess:"Không có quyền",failureLabelRetry:"Thử lại",failureLabelReconnect:"Kết nối lại",failureLabelTemporary:"Tạm thời",failureLabelUnavailable:"Chưa khả dụng",failureHintReauth:"Chạy lại luồng xác thực của tài khoản này để làm mới quyền truy cập.",failureHintWorkspace:"Chuyển tài khoản này về workspace còn hoạt động rồi xóa và thêm lại.",failureHintNoAccess:"Tài khoản này không thể truy cập endpoint quota của nhà cung cấp.",failureHintRetry:"Đợi một chút rồi thử lại yêu cầu quota.",failureHintReconnect:"Xóa tài khoản cũ rồi xác thực lại.",failureHintTemporary:"Có vẻ đây là lỗi tạm thời. Hãy thử lại sau.",removeAndReadd:"Xóa và thêm lại tài khoản",autoRefreshFailed:"Tự động làm mới không thành công"},antigravityChecklist:{title:"Trách nhiệm OAuth Antigravity",subtitle:"Hoàn thành tất cả 4 bước trước khi bạn có thể xác thực.",mandatory:"Bắt buộc",completion:"Hoàn thành",stepsCount:"{{current}}/4 bước"},accountSafetyWarning:{title:"Cảnh báo an toàn tài khoản OAuth",subtitle:"Vấn đề #509 · Rủi ro Gemini + AGY OAuth",firstLine:"Issue #509 ghi nhận các trường hợp bị đình chỉ/cấm liên quan đến ccs agy và việc dùng chung tài khoản giữa ccs gemini và ccs agy.",secondLine:"Chỉ tiếp tục nếu bạn chấp nhận hoàn toàn trách nhiệm về OAuth và rủi ro truy cập tài khoản.",issueLabel:"Đọc vấn đề #509",proxySettingsLabel:"Điều khiển Gemini + AGY: Cài đặt > Proxy"},cliproxyDialog:{name:"Tên",provider:"Nhà cung cấp",account:"Tài khoản",accountOptional:"Tài khoản (tùy chọn)",model:"Mô hình",modelOptional:"Mô hình (tùy chọn)",defaultTarget:"Mục tiêu mặc định",defaultTier:"Cấp mặc định",tierConfig:"Cấu hình cấp độ",selectProvider:"Chọn nhà cung cấp...",useDefaultAccount:"Sử dụng tài khoản mặc định",defaultSuffix:"(mặc định)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Hủy bỏ",create:"Tạo",creating:"Đang tạo...",saveChanges:"Lưu thay đổi",saving:"Đang lưu...",placeholderName:"Gemini của tôi",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Chỉnh sửa biến thể tổng hợp: {{name}}",editSingleTitle:"Chỉnh sửa biến thể: {{name}}"},profileEditor:{profileInfo:"Thông tin hồ sơ",profileName:"Tên hồ sơ",filePath:"Đường dẫn tệp",lastModified:"Sửa đổi lần cuối",defaultTarget:"Mục tiêu mặc định",quickUsage:"Sử dụng nhanh",runWithProfile:"Chạy với hồ sơ",runOnDroid:"Chạy trên Droid",droidAliasExplicit:"Bí danh Droid (rõ ràng)",overrideToClaude:"Ghi đè lên Claude",overrideToClaudeExplicit:"Ghi đè lên Claude (rõ ràng)",setAsDefault:"Đặt làm mặc định",provider:"Nhà cung cấp",custom:"Tùy chỉnh"},settings:{sectionLoadFailed:"Không tải được phần",unknownError:"Đã xảy ra lỗi không xác định",reloadPage:"Tải lại trang",refresh:"Làm mới",copy:"Sao chép",copied:"Đã sao chép",saved:"Đã lưu",loading:"Đang tải...",configFileNotFound:"Không tìm thấy tập tin cấu hình"},settingsTabs:{web:"Web",env:"Env",think:"Tư duy",proxy:"Proxy",auth:"Xác thực",backup:"Sao lưu"},settingsAuth:{failedFetchTokens:"Không thể tải token xác thực",failedSaveTokens:"Không thể lưu token",tokensUpdated:"Đã cập nhật token. Khởi động lại CLIProxy để áp dụng.",failedRegenerate:"Không thể tạo lại bí mật",secretRegenerated:"Bí mật quản lý mới được tạo. Khởi động lại CLIProxy để áp dụng.",failedReset:"Không thể đặt lại token",tokensReset:"Token đã được đặt lại về mặc định. Khởi động lại CLIProxy để áp dụng.",description:"Cấu hình token xác thực CLIProxy. Các thay đổi yêu cầu khởi động lại CLIProxy.",apiKey:"Khóa API",custom:"Tùy chỉnh",apiKeyDesc:"Được Claude Code dùng để xác thực qua CLIProxy",apiKeyPlaceholder:"Khóa API",managementSecret:"Bí mật quản lý",managementSecretDesc:"Được bảng điều khiển CCS sử dụng để truy cập API quản lý CLIProxy",managementSecretPlaceholder:"Bí mật quản lý",generateSecret:"Tạo bí mật an toàn mới",resetDefaults:"Đặt lại về mặc định",resetDesc:"Đặt lại cả khóa API và bí mật quản lý về giá trị mặc định.",saving:"Đang lưu...",save:"Lưu"},settingsGlobalEnv:{description:"Biến môi trường được áp dụng cho tất cả hồ sơ không dùng Claude subscription (gemini, codex, agy, ghcp, v.v.)",enabled:"Đã bật Env toàn cầu",disabled:"Env toàn cầu bị vô hiệu hóa",enabledDesc:"Biến Env sẽ được áp dụng cho các hồ sơ bên thứ ba",disabledDesc:"Biến Env sẽ không được áp dụng",envVars:"Biến môi trường",noneConfigured:"Không có biến môi trường nào được cấu hình",addNew:"Thêm biến mới",keyName:"KEY_NAME",value:"giá trị",add:"Thêm",quickAdd:"Thêm nhanh các biến phổ biến",allConfigured:"Tất cả biến phổ biến đã được cấu hình"},settingsBackups:{failedFetch:"Không tìm nạp được bản sao lưu",failedRestore:"Không thể khôi phục bản sao lưu",restoreSuccess:"Đã khôi phục bản sao lưu thành công",title:"Sao lưu cài đặt",description:"Khôi phục các phiên bản trước của tệp settings.json của bạn. Bản sao lưu được tạo tự động khi cài đặt được sửa đổi.",none:"Không có bản sao lưu nào",noneHint:"Bản sao lưu sẽ xuất hiện ở đây khi bạn sửa đổi cài đặt",latest:"Mới nhất",restoring:"Đang khôi phục...",restore:"Khôi phục",restoreConfirmTitle:"Khôi phục bản sao lưu?",restoreConfirmPrefix:"Điều này sẽ thay thế cài đặt hiện tại của bạn bằng bản sao lưu từ",restoreConfirmSuffix:"Không thể hoàn tác hành động này.",cancel:"Hủy bỏ"},settingsWebsearch:{description:"Tìm kiếm trên web dựa trên CLI cho hồ sơ của bên thứ ba (gemini, codex, agy, v.v.)",enabled:"Đã bật Tìm kiếm trên web",disabled:"Tìm kiếm trên web bị vô hiệu hóa",checking:"Đang kiểm tra trạng thái...",providers:"Nhà cung cấp",noneConfigured:"Không có nhà cung cấp nào được cấu hình",noneConfiguredHint:"Cài công cụ CLI để bật các nhà cung cấp WebSearch",checkProviders:"Kiểm tra các nhà cung cấp",installed:"đã cài đặt",notInstalled:"chưa được cài đặt",model:"Mô hình:",howInstall:"Cách cài đặt {{name}} CLI",installGlobally:"Cài đặt trên toàn cầu",requiresKey:"(cần khóa API xAI)",freeTier:"(Có sẵn cấp MIỄN PHÍ)",viewDocs:"Xem tài liệu"},settingsProxy:{failedLoadAgyMode:"Không thể tải chế độ power user AGY",failedUpdateAgyMode:"Không thể cập nhật chế độ power user AGY",failedVerifyAgyMode:"Không thể xác minh trạng thái lưu của chế độ power user AGY",notPersistedAgyMode:"Chế độ power user AGY chưa được lưu bền vững. Cấu hình có thể đã bị tiến trình khác sửa.",agyModeEnabled:"Đã bật chế độ power user AGY.",agyModeDisabled:"Đã tắt chế độ power user AGY.",typePhraseToContinue:'Nhập "{{value}}" để tiếp tục.',description:"Định cấu hình kết nối {{backend}} cục bộ hoặc từ xa cho cấu hình dựa trên proxy",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Trạng thái phiên bản",connectionMode:"Chế độ kết nối",local:"Cục bộ",remote:"Từ xa",localDesc:"Chạy nhị phân {{backend}} trên máy này",remoteDesc:"Kết nối với máy chủ {{backend}} từ xa",backendBinary:"Tệp thực thi backend",stopProxyToSwitch:"Dừng proxy đang chạy trong Trạng thái phiên bản trước khi chuyển backend.",default:"Mặc định",plusDesc:"Hỗ trợ đầy đủ nhà cung cấp, bao gồm Kiro và GitHub Copilot",originalDesc:"Binary gốc (chỉ Gemini, Codex, Antigravity)",variantsIncompatible:"Các biến thể Kiro/Copilot hiện tại sẽ không hoạt động với CLIProxyAPI. Chuyển sang CLIProxyAPIPlus hoặc xóa các biến thể đó.",safety:"An toàn",agyModeTitle:"Chế độ power user Antigravity",agyModeDesc:"Bỏ qua danh sách kiểm tra trách nhiệm AGY trong quy trình Thêm tài khoản và `ccs agy`.",agyWarning:"Chỉ bật nếu bạn hiểu rõ rủi ro bị đình chỉ/cấm OAuth (#509). CCS không chịu trách nhiệm khi mất tài khoản.",finalConfirm:"Xác nhận cuối cùng",finalConfirmDesc:"Việc bật tính năng này sẽ bỏ qua các điểm kiểm tra an toàn AGY trong cả bảng điều khiển và CLI. Xem lại vấn đề #509 và nhập cụm từ chính xác để tiếp tục.",step1:"Bước 1",readIssue:"Đọc vấn đề #509",step2:"Bước 2",typePrefix:"Nhập",typeSuffix:"để kích hoạt.",typePhraseAria:"Nhập I ACCEPT RISK để bật chế độ power user Antigravity",exactPhrase:"Phải nhập chính xác cụm từ.",enableAgyMode:"Bật chế độ power user",toggleAgyMode:"Chuyển đổi chế độ power user AGY",fallbackSettings:"Cài đặt dự phòng",enableFallback:"Cho phép dự phòng về cục bộ",enableFallbackDesc:"Sử dụng proxy cục bộ nếu không thể truy cập được từ xa",autoStartLocal:"Tự động khởi động proxy cục bộ",autoStartLocalDesc:"Tự động khởi động proxy cục bộ khi dự phòng",advanced:"Nâng cao",debugMode:"Chế độ gỡ lỗi",debugModeDesc:"Bật chẩn đoán dành cho nhà phát triển trong bảng điều khiển trình duyệt",debugModeEnabled:"Đã bật chế độ gỡ lỗi. Kiểm tra bảng điều khiển trình duyệt để biết nhật ký chi tiết.",localProxy:"Proxy cục bộ",port:"Cổng",autoStart:"Tự động khởi động",localAutoStartDesc:"Tự động khởi động proxy cục bộ khi cần",remoteConfigTitle:"Cấu hình máy chủ từ xa",host:"Host",hostPlaceholder:"192.168.1.100 hoặc proxy.example.com",defaultPort:"mặc định {{value}}",portPlaceholder:"Để trống để dùng {{value}}",protocol:"Giao thức",http:"HTTP",https:"HTTPS",apiKeyOptional:"Khóa API (tùy chọn)",apiKeyPlaceholder:"Đối với điểm cuối API /v1/*",apiKeyDesc:"Dùng cho các yêu cầu API đến /v1/chat/completions",managementKeyOptional:"Khóa quản lý (tùy chọn)",managementKeyPlaceholder:"Đối với điểm cuối /v0/management/*",managementKeyDesc:"Dùng cho API quản lý dashboard. Nếu bỏ trống sẽ dùng Khóa API.",testing:"Đang thử nghiệm...",testConnection:"Kiểm tra kết nối",connectedLatency:"Đã kết nối ({{value}}ms)",connectionFailed:"Kết nối không thành công",invalidPortOrEmpty:"Cổng phải là số nguyên từ 1 đến 65535 hoặc để trống theo mặc định",invalidLocalPort:"Cổng cục bộ phải là số nguyên từ 1 đến 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Định cấu hình tư duy/lý luận mở rộng cho các mô hình được hỗ trợ.",supportedProviders:"Nhà cung cấp được hỗ trợ",modeTitle:"Chế độ Thinking",modeAutoDesc:"Tự động thiết lập tư duy dựa trên tầng mô hình",modeOffDesc:"Vô hiệu hóa suy nghĩ mở rộng",modeManualDesc:"Đặt mức ghi đè liên tục hoặc sử dụng cờ CLI mỗi lần chạy",tierDefaults:"Mặc định cấp độ",tierDefaultsDesc:"Mức độ tư duy mặc định cho từng tầng mô hình khi ở chế độ tự động.",persistentOverride:"Ghi đè liên tục",persistentOverrideDesc:"Áp dụng cho tất cả các buổi. Cờ CLI vẫn được ưu tiên.",enterCustomBudget:"Nhập ngân sách tùy chỉnh",apply:"Áp dụng",providerOverrides:"Ghi đè nhà cung cấp ({{count}})",providerOverridesDesc:"Ghi đè mặc định cấp độ cho các nhà cung cấp cụ thể. Thêm khóa nhà cung cấp tùy chỉnh nếu cần.",addProviderPlaceholder:"Thêm khóa nhà cung cấp (ví dụ: qwen)",showWarnings:"Hiển thị cảnh báo",showWarningsDesc:"Hiển thị cảnh báo khi các giá trị suy nghĩ bị hạn chế hoặc điều chỉnh",cliEnvOverride:"Ghi đè CLI & Env",supportLine1Prefix:"Ngân sách suy nghĩ:",supportLine1Suffix:"(dựa trên token)",supportLine2Prefix:"Nỗ lực lý luận:",supportLine2SuffixPrefix:"(hậu tố hoặc ",supportLine2SuffixPostfix:": medium/high/xhigh)",supportLine3Prefix:"Hậu tố Codex cố định mức effort (ví dụ ",supportLine3Suffix:"); model không hậu tố sẽ dùng chế độ Thinking."},analytics:{title:"Phân tích",subtitle:"Theo dõi việc sử dụng và thông tin chi tiết",month:"Tháng",allTime:"Tất cả thời gian",updated:"Đã cập nhật {{value}}"},analyticsSummary:{totalTokens:"Tổng số token",totalTokensSubtitle:"{{input}} vào / {{output}} ra",totalCost:"Tổng chi phí",totalCostSubtitle:"trung bình ${{value}}/ngày",cacheTokens:"Token bộ đệm",cacheTokensSubtitle:"${{cost}} ({{percent}}% chi phí)",inputCost:"Chi phí đầu vào",outputCost:"Chi phí đầu ra",tokensSubtitle:"{{value}} token"},apiProfiles:{title:"Hồ sơ API",new:"Mới",searchPlaceholder:"Tìm kiếm hồ sơ...",loadingProfiles:"Đang tải hồ sơ...",failedLoadTitle:"Không tải được hồ sơ",failedLoadDesc:"Không thể tìm nạp hồ sơ API. Vui lòng thử lại.",retry:"Thử lại",noProfilesYet:"Chưa có hồ sơ API nào",noProfilesDesc:"Tạo hồ sơ đầu tiên của bạn để kết nối với các điểm cuối API tùy chỉnh",createProfile:"Tạo hồ sơ",noProfileMatch:'Không có hồ sơ nào khớp với "{{query}}"',profileCount:"{{count}} hồ sơ",profileCount_other:"{{count}} hồ sơ",configuredCount:"{{count}} đã cấu hình",deleteProfileTitle:"Xóa hồ sơ",deleteProfileDesc:'Bạn có chắc chắn muốn xóa "{{name}}" không? Thao tác này sẽ xóa tệp cài đặt và không thể hoàn tác.',delete:"Xóa",unsavedChangesTitle:"Những thay đổi chưa được lưu",unsavedChangesDesc:'Bạn có những thay đổi chưa được lưu trong "{{current}}". Hủy và chuyển sang "{{next}}"?',discardSwitch:"Loại bỏ và chuyển đổi"},accountsPage:{title:"Tài khoản",managePrefix:"Quản lý",manageSuffix:"tài khoản và nhóm đồng bộ từ một nơi.",mobileManageSuffix:"tính liên tục cho mỗi tài khoản.",primaryActions:"Hành động chính",createAccount:"Tạo tài khoản",authClaudeInPool:"Xác thực Claude trong Pool",openClaudePoolSettings:"Mở cài đặt Claude pool",openCliProxyClaudePool:"Mở CLIProxy Claude Pool",migrationFollowup:"Theo dõi sau di chuyển",legacyContextPending:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContextPending_other:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContinuityPending:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",legacyContinuityPending_other:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",confirmingLegacy:"Đang xác nhận chính sách kế thừa...",confirmLegacy:"Xác nhận chính sách kế thừa ({{count}})",noLegacyFollowup:"Không có hoạt động theo dõi kế thừa nào đang chờ xử lý.",continuityGuide:"Hướng dẫn liên tục",expandWhenNeeded:"Chỉ mở rộng khi cần thiết.",sharedStandard:"Tiêu chuẩn chung",sharedStandardDesc:"Chỉ đồng bộ hóa không gian làm việc của dự án. Mặc định tốt nhất cho hầu hết các đội.",sharedDeeper:"Chia sẻ sâu hơn",sharedDeeperPrefix:"Thêm",isolated:"Tách biệt",isolatedDesc:"Không có liên kết. Tốt nhất cho sự tách biệt nghiêm ngặt.",quickCommands:"Lệnh nhanh",quickCommandsDesc:"Sao chép và chạy trong terminal.",workspaceBadge:"Không gian làm việc `ccs auth`",historySyncBadge:"Kiểm soát đồng bộ hóa lịch sử",authAccounts:"Tài khoản xác thực",tableScopePrefix:"Bảng này được cố ý đặt trong phạm vi",tableScopeMiddle:"tài khoản. Sử dụng",tableScopeSuffix:"để thay đổi chế độ/nhóm/độ sâu.",accountMatrix:"Ma trận tài khoản",sharedTotalDesc:"Tổng số tài khoản chia sẻ: {{count}}. Bao gồm thao tác Sync và xác nhận kế thừa.",loadingAccounts:"Đang tải tài khoản..."},health:{justNow:"vừa xong",secondsAgo:"{{count}} giây trước",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",systemHealth:"Tình trạng hệ thống",build:"bản dựng {{version}}",lastScan:"Lần quét cuối cùng:",autoRefresh:"Tự động làm mới:",refresh:"Làm mới",checks:"Kiểm tra",version:"Phiên bản",platform:"Nền tảng",liveMonitoring:"Giám sát trực tiếp đang hoạt động",copied:"Đã sao chép vào bảng nhớ tạm",refreshing:"Đang làm mới kiểm tra trạng thái...",fix:"Sửa chữa",applyFix:"Áp dụng bản sửa lỗi",healthLabel:"trạng thái"},updates:{actionRequired:"Hành động bắt buộc",done:"Xong",all:"Tất cả",inboxTitle:"Hộp thư cập nhật",inboxSubtitle:"Tập trung vào các hành động, sau đó đánh dấu các cập nhật đã hoàn tất hoặc bị loại bỏ.",needsAction:"Cần hành động",doneCount:"Xong",searchPlaceholder:"Tìm kiếm hành động hoặc lệnh",noNotices:"Không có thông báo nào khớp với chế độ xem này.",noUpdates:"Hiện không có bản cập nhật nào.",published:"Đã xuất bản {{date}}",markDone:"Đánh dấu hoàn tất",dismiss:"Ẩn",reopen:"Mở lại",doNext:"Làm tiếp theo",impactedIntegrations:"Tích hợp bị ảnh hưởng",impactedDesc:"Các khu vực liên quan dựa trên phạm vi cập nhật và định tuyến.",whyMatters:"Tại sao nó quan trọng",whyMattersDesc:"Chỉ ngữ cảnh ngắn, không có ghi chú phát hành trên tường văn bản.",open:"Mở",progressNeedsAction:"Cần hành động",progressInReview:"Đang xem xét",progressDone:"Xong",progressDismissed:"Bị loại bỏ",statusNew:"Mới",statusStable:"Ổn định",statusPlanned:"Đã lên kế hoạch",dashboard:"Trang tổng quan",cliUsage:"Cách sử dụng CLI"},cliproxyPage:{connected:"Đã kết nối",notConnected:"Chưa kết nối",variant:"Biến thể",parentNotConnected:"Profile gốc chưa kết nối",viaProvider:"qua {{provider}}",emptyTitle:"Trình quản lý hồ sơ CCS",emptyDesc:"Quản lý xác thực OAuth, tùy chọn tài khoản và chọn mô hình cho nhà cung cấp CLIProxy. Cấu hình cách CCS định tuyến yêu cầu đến các backend AI khác nhau.",emptyControlPanelPrefix:"Để biết số liệu thống kê sử dụng trực tiếp và theo dõi thời gian thực, hãy truy cập",controlPanel:"Bảng điều khiển",quickSetup:"Thiết lập nhanh",accountManagement:"Quản lý tài khoản cấp CCS",providers:"Nhà cung cấp",variants:"Biến thể",providerCount:"{{count}} nhà cung cấp",providerCount_other:"{{count}} nhà cung cấp",connectedCount:"{{count}} đã kết nối",variantDisplay:"{{name}} (biến thể {{provider}})"},copilotPage:{title:"Copilot",subtitle:"Proxy GitHub Copilot",setup:"Cài đặt",auth:"Xác thực",daemon:"Daemon",unofficialTitle:"API không chính thức - Bạn phải tự chịu rủi ro khi sử dụng",unofficialItem1:"API được thiết kế ngược - có thể bị hỏng bất cứ lúc nào",unofficialItem2:"Việc sử dụng quá mức có thể gây ra hạn chế tài khoản",unofficialItem3:"Không bảo hành, không chịu trách nhiệm từ CCS",yes:"Có",no:"Không",installed:"Đã cài đặt",missing:"Thiếu",integration:"Tích hợp",enabled:"Đã bật",disabled:"Đã tắt",github:"GitHub",connected:"Đã kết nối",notConnected:"Chưa kết nối",authenticate:"Xác thực",authenticating:"Đang xác thực...",status:"Trạng thái",running:"Đang chạy",stopped:"Đã dừng",port:"Cổng",stopping:"Đang dừng...",stop:"Dừng lại",starting:"Đang bắt đầu...",start:"Bắt đầu",installing:"Đang cài đặt...",installCopilotApi:"Cài đặt copilot-api",proxy:"Proxy",active:"Đang hoạt động",inactive:"Không hoạt động"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Bảng điều khiển tích hợp Cursor",unofficialTitle:"API không chính thức - Bạn phải tự chịu rủi ro khi sử dụng",unofficialItem1:"Tích hợp thiết kế ngược có thể bị hỏng bất cứ lúc nào",unofficialItem2:"Lạm dụng hoặc sử dụng quá mức có thể có nguy cơ bị hạn chế tài khoản",unofficialItem3:"Không bảo hành, không chịu trách nhiệm từ CCS",integration:"Tích hợp",authentication:"Xác thực",daemon:"Daemon",enabled:"Đã bật",disabled:"Đã tắt",expired:"Hết hạn",connected:"Đã kết nối",notConnected:"Chưa kết nối",running:"Đang chạy",stopped:"Đã dừng",actions:"Hành động",disableIntegration:"Vô hiệu hóa tích hợp",enableIntegration:"Kích hoạt tích hợp",autoDetectAuth:"Tự động phát hiện xác thực",manualAuthImport:"Nhập xác thực thủ công",stopDaemon:"Dừng Daemon",startDaemon:"Khởi động Daemon",port:"Cổng",configuration:"Cấu hình Cursor",lastModified:"Sửa đổi lần cuối:",neverSaved:"Chưa bao giờ lưu",saving:"Đang lưu...",save:"Lưu",modelConfig:"Cấu hình mô hình",settings:"Cài đặt",info:"Thông tin",presets:"Cài đặt sẵn",presetsDesc:"Áp dụng ánh xạ mô hình được cấu hình sẵn",modelMapping:"Ánh xạ mô hình",modelMappingDesc:"Định cấu hình mô hình nào sẽ sử dụng cho từng tầng",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không chỉ định tier cụ thể.",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Lý luận phức tạp và phản hồi chất lượng cao nhất.",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Khối lượng công việc mã hóa chung và trò chuyện hàng ngày.",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Đường dẫn yêu cầu nhẹ, độ trễ thấp.",runtimeSettings:"Cài đặt thời gian chạy",autoStartDaemon:"Daemon tự động khởi động",autoStartDesc:"Tự động khởi động daemon Cursor khi dùng tích hợp.",ghostMode:"Chế độ ma",ghostModeDesc:"Gửi x-ghost-mode để giảm telemetry.",provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",availableModels:"Mô hình khả dụng",loadingModels:"Đang tải mô hình...",noModels:"Chưa có siêu dữ liệu mô hình nào. Bắt đầu daemon và làm mới.",default:"Mặc định",rawConfiguration:"Cấu hình thô (JSON)",manualImportTitle:"Nhập xác thực Cursor thủ công",manualImportDesc:"Cung cấp access token và machine ID của Cursor nếu không tự phát hiện được.",accessToken:"Access token",accessTokenPlaceholder:"Dán access token của Cursor",machineId:"ID máy",machineIdPlaceholder:"Hex 32 ký tự (UUID không có dấu gạch nối)",cancel:"Hủy bỏ",import:"Nhập",selectModel:"Chọn mô hình",useDefaultModel:"Sử dụng mô hình mặc định",availableModelCount:"Mô hình khả dụng ({{count}})",invalidPort:"Cổng phải là số nguyên từ 1 đến 65535",defaultModelRequired:"Mô hình mặc định là bắt buộc",savedConfig:"Đã lưu cấu hình Cursor và ánh xạ mô hình",failedSaveConfig:"Không lưu được cấu hình",modelsLoadingWait:"Mô hình vẫn đang tải. Vui lòng đợi trước khi áp dụng preset.",noModelsAvailable:"Chưa có mô hình nào. Hãy khởi động daemon rồi làm mới.",appliedCodexPreset:"Đã áp dụng preset Codex GPT-5.3",appliedClaudePreset:"Đã áp dụng preset Claude 4.6",appliedGeminiPreset:"Đã áp dụng preset Gemini 3",integrationEnabled:"Đã bật tích hợp Cursor",integrationDisabled:"Đã tắt tích hợp Cursor",failedUpdateIntegration:"Không cập nhật được trạng thái tích hợp",credentialsImported:"Đã nhập thông tin xác thực Cursor",autoDetectFailed:"Tự động phát hiện không thành công",manualRequired:"Cần token và machine ID",manualImportFailed:"Nhập thủ công không thành công",failedStartDaemon:"Không thể khởi động daemon",daemonStarted:"Đã khởi động daemon",daemonStartedWithPid:"Daemon đã khởi động (PID: {{pid}})",failedStopDaemon:"Không thể dừng daemon",daemonStopped:"Đã dừng daemon",rawLoading:"Cài đặt thô vẫn đang tải. Vui lòng đợi và thử lại.",invalidJson:"JSON không hợp lệ",rawSaved:"Đã lưu cài đặt thô",rawChanged:"Cài đặt thô đã thay đổi bên ngoài. Làm mới và thử lại.",failedSaveRaw:"Không lưu được cài đặt thô",savedAll:"Đã lưu cấu hình Cursor"},droidPage:{loadingDiagnostics:"Đang tải chẩn đoán Droid...",failedDiagnostics:"Không tải được chẩn đoán Droid.",overview:"Tổng quan",byok:"BYOK",docs:"Tài liệu",runtimeInstall:"Thời gian chạy và cài đặt",status:"Trạng thái",detected:"Đã phát hiện",notFound:"Không tìm thấy",detectionSource:"Nguồn phát hiện",binaryPath:"Đường dẫn nhị phân",installDirectory:"Thư mục cài đặt",version:"Phiên bản",overridePath:"Ghi đè (CCS_DROID_PATH)",configFiles:"Tệp cấu hình",path:"Đường dẫn",resolved:"Đã giải quyết",size:"Kích cỡ",lastModified:"Sửa đổi lần cuối",parseWarning:"Cảnh báo phân tích cú pháp: {{value}}",readWarning:"Đọc cảnh báo: {{value}}",warnings:"Cảnh báo",byokSummary:"Tóm tắt BYOK",activeModelSelector:"Bộ chọn mô hình hoạt động",customModels:"Mô hình tùy chỉnh",ccsManaged:"do CCS quản lý",userManaged:"Do người dùng quản lý",malformedEntries:"Mục nhập không đúng định dạng",providers:"Nhà cung cấp",none:"không có",customModelsTitle:"Mô hình tùy chỉnh",modelName:"Tên/model",provider:"Nhà cung cấp",baseUrl:"URL cơ sở",noCustomModels:"Không có mô hình tùy chỉnh",docsAlignedNotes:"Ghi chú được căn chỉnh trong Tài liệu",factoryDocs:"Tài liệu Factory",providerFactCheckDocs:"Tài liệu kiểm tra thực tế của nhà cung cấp",providerValues:"Giá trị của nhà cung cấp: {{value}}",settingsHierarchy:"Phân cấp cài đặt: {{value}}",settingsTitle:"Cài đặt BYOK của Droid",fixJsonBeforeQuickSettings:"Sửa cú pháp JSON trước khi sử dụng các điều khiển cài đặt nhanh.",fixJsonBeforeReasoning:"Sửa cú pháp JSON trước khi cập nhật cài đặt lý luận BYOK.",unableUpdateReasoning:"Không thể cập nhật cài đặt lý luận mô hình BYOK đã chọn.",fixJsonBeforeBudget:"Sửa cú pháp JSON trước khi cập nhật ngân sách tư duy.",anthropicOnlyBudget:"Ngân sách tư duy chỉ có sẵn cho các mô hình BYOK của Anthropic.",invalidJson:"JSON không hợp lệ: {{value}}",saved:"Đã lưu cài đặt Droid",changedExternally:"Cài đặt Droid đã thay đổi bên ngoài. Làm mới và thử lại.",failedSave:"Không lưu được cài đặt Droid"},sharedPage:{commands:"Lệnh",skills:"Kỹ năng",agents:"Agent",title:"Dữ liệu dùng chung",subtitle:"Các lệnh, kỹ năng và agent được chia sẻ giữa các phiên Claude",totalShared:"Tổng số mục dùng chung",visible:"Hiển thị",markdownDetail:"Chế độ xem chi tiết Markdown",filterPrefix:"Lọc:",configurationRequired:"Cần cấu hình",countsUnavailable:"Không có số liệu",retryCounts:"Số lần thử lại",filterPlaceholder:"Lọc {{tab}} theo tên, mô tả hoặc đường dẫn",showing:"Đang hiển thị {{visible}} trong số {{total}} {{tab}}",showingQuery:'cho "{{query}}"',refreshing:"(đang làm mới...)",loadingShared:"Đang tải {{tab}} dùng chung...",failedLoadShared:"Không tải được danh sách {{tab}} dùng chung",retry:"Thử lại",noSharedFound:"Không tìm thấy {{tab}} dùng chung. Chạy `ccs sync` hoặc thêm mục trong thư mục dùng chung của bạn.",noMatch:'Không có {{tab}} khớp với "{{query}}".',selectOne:"Chọn {{tab}} để xem toàn bộ nội dung.",pathLabel:"Đường dẫn",resolvedSource:"Nguồn đã giải quyết",loadingMarkdown:"Đang tải nội dung Markdown...",failedLoadContent:"Không tải được nội dung",retryContent:"Thử lại nội dung",noMarkdown:"Không có nội dung Markdown khả dụng."}}}};He.isInitialized||He.use(Ow).init({resources:Gw,lng:Kw(),fallbackLng:"en",interpolation:{escapeValue:!1}});const Yw={theme:"system",setTheme:()=>null,isDark:!1},rx=S.createContext(Yw);function Vw({children:n,defaultTheme:a="system",storageKey:s="vite-ui-theme"}){const[l,c]=S.useState(()=>localStorage.getItem(s)||a),[f,h]=S.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1);S.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),C=x=>{h(x.matches)};return y.addEventListener("change",C),()=>y.removeEventListener("change",C)},[]);const m=l==="dark"||l==="system"&&f;S.useEffect(()=>{const y=window.document.documentElement;y.classList.remove("light","dark"),y.classList.add(m?"dark":"light")},[m]);const p={theme:l,setTheme:y=>{localStorage.setItem(s,y),c(y)},isDark:m};return r.jsx(rx.Provider,{value:p,children:n})}const cx=S.createContext(null),Ig="ccs-privacy-mode";function Fw({children:n}){const[a,s]=S.useState(()=>typeof window<"u"?localStorage.getItem(Ig)==="true":!1);S.useEffect(()=>{localStorage.setItem(Ig,String(a))},[a]);const l=S.useCallback(()=>s(f=>!f),[]),c=S.useMemo(()=>({privacyMode:a,togglePrivacyMode:l}),[a,l]);return r.jsx(cx.Provider,{value:c,children:n})}function _d(){const n=S.useContext(cx);if(!n)throw new Error("usePrivacy must be used within a PrivacyProvider");return n}const ux="blur-[4px] select-none hover:blur-none transition-all duration-200",Qw="/api/auth";async function zd(n,a){const s=await fetch(`${Qw}${n}`,{headers:{"Content-Type":"application/json"},credentials:"include",...a});if(!s.ok){const l=await s.json().catch(()=>({error:"Unknown error"}));throw new Error(l.error||s.statusText)}return s.json()}function Ww(){return zd("/check")}function $w(n,a){return zd("/login",{method:"POST",body:JSON.stringify({username:n,password:a})})}function Xw(){return zd("/logout",{method:"POST"})}const dx=S.createContext(null);function Zw({children:n}){const[a,s]=S.useState(!1),[l,c]=S.useState(!1),[f,h]=S.useState(null),[m,p]=S.useState(!0);S.useEffect(()=>{Ww().then(v=>{s(v.authRequired),c(v.authenticated),h(v.username)}).catch(()=>{s(!1),c(!0)}).finally(()=>p(!1))},[]);const y=S.useCallback(async(v,N)=>{const w=await $w(v,N);c(!0),h(w.username)},[]),C=S.useCallback(async()=>{await Xw(),c(!1),h(null)},[]),x=S.useMemo(()=>({authRequired:a,isAuthenticated:l,username:f,loading:m,login:y,logout:C}),[a,l,f,m,y,C]);return r.jsx(dx.Provider,{value:x,children:n})}function Ud(){const n=S.useContext(dx);if(!n)throw new Error("useAuth must be used within an AuthProvider");return n}function Jw(){const{authRequired:n,isAuthenticated:a,loading:s}=Ud(),l=gr();return s?r.jsx("div",{className:"flex h-screen items-center justify-center",children:r.jsx(Dn,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?a?r.jsx(pd,{}):r.jsx(yS,{to:"/login",state:{from:l},replace:!0}):r.jsx(pd,{})}const td=768;function eN(){const[n,a]=S.useState(void 0);return S.useEffect(()=>{const s=window.matchMedia(`(max-width: ${td-1}px)`),l=()=>{a(window.innerWidth<td)};return s.addEventListener("change",l),a(window.innerWidth<td),()=>s.removeEventListener("change",l)},[]),!!n}const fx=S.createContext(null);function Tr(){const n=S.useContext(fx);if(!n)throw new Error("useSidebar must be used within a SidebarProvider.");return n}function K(...n){return oC(sC(n))}function hx(n){if(!Number.isFinite(n))return"0";const a=Math.max(0,Math.min(100,n));return`${Math.round(a)}`}const Hg=["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],Ft={success:"#15803d",degraded:"#b45309",failed:"#b91c1c"};function iD(n){let a=2166136261;for(let s=0;s<n.length;s++)a^=n.charCodeAt(s),a=Math.imul(a,16777619);return Hg[(a>>>0)%Hg.length]}function Sd(n){if(!n)return null;try{const a=new Date(n),s=new Date,l=a.getTime()-s.getTime();if(l<=0)return"soon";const c=Math.floor(l/(1e3*60*60));if(c>=24)return a.toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});const f=Math.floor(l%(1e3*60*60)/(1e3*60));return c>0?`in ${c}h ${f}m`:`in ${f}m`}catch{return null}}function Id(n){return n.filter(a=>{const s=(a.displayName||a.name||"").toLowerCase();return s.includes("claude")||s.includes("gpt")})}function tN(n){if(n.length===0)return null;const a=Id(n);if(a.length===0)return 0;const s=a.map(l=>l.percentage).filter(l=>typeof l=="number"&&isFinite(l));return s.length===0?0:Math.min(...s)}function nN(n){if(n.length===0)return null;const a=Id(n);return a.length===0?null:a.reduce((s,l)=>l.resetTime?s?new Date(l.resetTime)<new Date(s)?l.resetTime:s:l.resetTime:s,null)}const aN=/claude-(?:opus|sonnet)-4(?:[.-])5(?:-thinking)?(?=(?:$|[^a-z0-9]))/i;function oD(n){return aN.test((n||"").trim())}const iN=[{name:"claude-opus-4-6-thinking",displayName:"Claude Opus 4.6 (Thinking)"},{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6"},{name:"gpt-oss-120b",displayName:"GPT-OSS 120B (Medium)"}];function oN(n){const a=n.toLowerCase();return a.includes("claude")||a.includes("gpt")?"primary":a.includes("gemini 3")||a.includes("gemini-3")?"gemini-3":a.includes("gemini 2")||a.includes("gemini-2")?"gemini-2":"other"}function sN(n){if(n.length===0)return[];const a=Id(n),s=[];if(a.length===0)for(const c of iN)s.push({name:c.name,displayName:c.displayName,percentage:0,tier:"primary",exhausted:!0});for(const c of n){const f=c.displayName||c.name,h=oN(f);s.push({name:c.name,displayName:f,percentage:c.percentage,tier:h,exhausted:h==="primary"&&c.percentage===0})}const l=["primary","gemini-3","gemini-2","other"];return s.sort((c,f)=>{const h=l.indexOf(c.tier)-l.indexOf(f.tier);return h!==0?h:c.displayName.localeCompare(f.displayName)})}function lN(n){const a=new Map;for(const s of n){const l=a.get(s.tier)||[];l.push(s),a.set(s.tier,l)}return a}function Ms(n){const a=(n||"").toLowerCase(),s=a.includes("code review")||a.includes("code_review"),l=a.includes("primary"),c=a.includes("secondary");return s?l?"code-review-5h":c?"code-review-weekly":"code-review":l?"usage-5h":c?"usage-weekly":"unknown"}function rN(n,a){if(Ms(n.label)==="code-review-weekly")return"weekly";const l=n.resetAfterSeconds;if(typeof l!="number"||!isFinite(l)||l<=0)return null;const c=a.find(p=>Ms(p.label)==="usage-5h"&&typeof p.resetAfterSeconds=="number"&&isFinite(p.resetAfterSeconds)&&p.resetAfterSeconds>0),f=a.find(p=>Ms(p.label)==="usage-weekly"&&typeof p.resetAfterSeconds=="number"&&isFinite(p.resetAfterSeconds)&&p.resetAfterSeconds>0);if(!c||!f)return null;const h=Math.abs(l-c.resetAfterSeconds);return Math.abs(l-f.resetAfterSeconds)<=h?"weekly":"5h"}function cN(n,a=[]){const s=typeof n=="string"?n:n.label,l=typeof n=="string"?{label:s,resetAfterSeconds:null}:{label:s,resetAfterSeconds:n.resetAfterSeconds},c=a.length>0?a:[l];switch(Ms(s)){case"usage-5h":return"5h usage limit";case"usage-weekly":return"Weekly usage limit";case"code-review-5h":case"code-review-weekly":case"code-review":{const f=rN(l,c);return f==="5h"?"Code review (5h)":f==="weekly"?"Code review (weekly)":"Code review"}case"unknown":return s}}function jr(n){if(!n||n.length===0)return{fiveHourWindow:null,weeklyWindow:null,codeReviewWindows:[],unknownWindows:[]};let a=null,s=null;const l=[],c=[],f=[];for(const h of n)switch(Ms(h.label)){case"usage-5h":a||(a=h),f.push(h);break;case"usage-weekly":s||(s=h),f.push(h);break;case"code-review-5h":case"code-review-weekly":case"code-review":l.push(h);break;case"unknown":c.push(h),f.push(h);break}if((!a||!s)&&f.length>0){const h=f.filter(m=>typeof m.resetAfterSeconds=="number"&&m.resetAfterSeconds>=0).sort((m,p)=>(m.resetAfterSeconds||0)-(p.resetAfterSeconds||0));a||(a=h[0]||f[0]||null),s||(s=h.length>1?h[h.length-1]:f.find(m=>m!==a)||null)}return{fiveHourWindow:a,weeklyWindow:s,codeReviewWindows:l,unknownWindows:c}}function uN(n){if(!n||n.length===0)return null;const{fiveHourWindow:a,weeklyWindow:s}=jr(n),l=[a,s].filter((h,m,p)=>!!h&&p.indexOf(h)===m),f=(l.length>0?l:n).map(h=>h.remainingPercent);return Math.min(...f)}function dN(n){if(!n||n.length===0)return null;const{fiveHourWindow:a,weeklyWindow:s}=jr(n),l=[a,s].filter((h,m,p)=>!!h&&p.indexOf(h)===m),f=(l.length>0?l:n).map(h=>h.resetAt).filter(h=>h!==null);return f.length===0?null:f.sort()[0]}function fN(n){if(!n.success)return null;const a=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(l=>!!l);if(a.length>0)return Math.min(...a.map(l=>l.remainingPercent));const s=n.windows.filter(l=>l.rateLimitType!=="overage");return s.length>0?Math.min(...s.map(l=>l.remainingPercent)):null}function hN(n){if(!n.success)return null;const a=[n.coreUsage?.fiveHour?.resetAt,n.coreUsage?.weekly?.resetAt].filter(l=>!!l);if(a.length>0)return a.sort()[0];const s=n.windows.filter(l=>l.rateLimitType!=="overage").map(l=>l.resetAt).filter(l=>l!==null);return s.length===0?null:s.sort()[0]}function mN(n){if(!n||n.length===0)return null;const a=n.map(s=>s.remainingPercent);return Math.min(...a)}function pN(n){if(!n||n.length===0)return null;const a=n.map(s=>s.resetTime).filter(s=>s!==null);return a.length===0?null:a.sort()[0]}function gN(n){if(!n)return null;const a=[n.premiumInteractions.percentRemaining,n.chat.percentRemaining,n.completions.percentRemaining].filter(s=>typeof s=="number"&&isFinite(s));return a.length===0?null:Math.min(...a)}function Kn(n){return typeof n=="object"&&n!==null}function ki(n){return typeof n=="number"&&Number.isFinite(n)}function Hd(n){if(!Kn(n))return!1;const a=n.models;return typeof n.success=="boolean"&&Array.isArray(a)}function Mr(n){if(!Kn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.windows)||!("planType"in a)?!1:a.windows.every(s=>Kn(s)&&typeof s.label=="string"&&ki(s.usedPercent)&&ki(s.remainingPercent))}function Dr(n){if(!Kn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.windows)||"planType"in a?!1:a.windows.every(s=>Kn(s)&&typeof s.rateLimitType=="string"&&ki(s.remainingPercent)&&typeof s.status=="string")}function Bd(n){if(!Kn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.buckets)?!1:a.buckets.every(s=>Kn(s)&&typeof s.id=="string"&&ki(s.remainingFraction)&&ki(s.remainingPercent)&&Array.isArray(s.modelIds))}function Kd(n){if(!Kn(n))return!1;const a=n,s=a.snapshots;return typeof a.success!="boolean"||!Kn(s)?!1:["premiumInteractions","chat","completions"].every(c=>{const f=s[c];return Kn(f)&&ki(f.percentRemaining)&&ki(f.percentUsed)})}function yN(n){const a=[];return typeof n.httpStatus=="number"&&a.push(`HTTP ${n.httpStatus}`),typeof n.errorCode=="string"&&n.errorCode.trim()&&a.push(n.errorCode.trim()),a.length>0?a.join(" | "):null}function xN(n,a,s){const l=n.errorDetail?.trim()||null;if(!l)return null;const c=l.toLowerCase();return c===a.toLowerCase()||s&&c===s.toLowerCase()?null:l}function mx(n){if(!n||n.success)return null;const a=n.error?.trim()||"Quota information unavailable",s=n.actionHint?.trim()||null,l=n.errorCode?.trim().toLowerCase()||"",c=yN(n),f=xN(n,a,c),h=a.toLowerCase();return n.needsReauth||l==="token_expired"||l==="reauth_required"||h.includes("token expired")||h.includes("re-authenticate")||h.includes("reauth")||h.includes("expired or invalid")?{label:He.t("accountCard.failureLabelReauth"),summary:a,actionHint:s||He.t("accountCard.failureHintReauth"),technicalDetail:c,rawDetail:f,tone:"warning"}:l==="deactivated_workspace"||n.httpStatus===402||h.includes("workspace deactivated")||h.includes("payment or workspace access required")?{label:He.t("accountCard.failureLabelWorkspace"),summary:a,actionHint:s||He.t("accountCard.failureHintWorkspace"),technicalDetail:c,rawDetail:f,tone:"warning"}:n.isForbidden||n.httpStatus===403||l==="quota_api_forbidden"||h.includes("forbidden")?{label:He.t("accountCard.failureLabelNoAccess"),summary:a,actionHint:s||He.t("accountCard.failureHintNoAccess"),technicalDetail:c,rawDetail:f,tone:"muted"}:n.httpStatus===429||l==="rate_limited"||h.includes("rate limited")?{label:He.t("accountCard.failureLabelRetry"),summary:a,actionHint:s||He.t("accountCard.failureHintRetry"),technicalDetail:c,rawDetail:f,tone:"warning"}:l==="auth_file_missing"||l==="missing_account_id"||h.includes("auth file not found")||h.includes("missing chatgpt-account-id")?{label:He.t("accountCard.failureLabelReconnect"),summary:a,actionHint:s||He.t("accountCard.failureHintReconnect"),technicalDetail:c,rawDetail:f,tone:"muted"}:n.retryable||l==="network_timeout"||l==="network_error"||l==="provider_unavailable"||h.includes("timeout")||h.includes("network")||h.includes("fetch failed")||h.includes("service unavailable")?{label:He.t("accountCard.failureLabelTemporary"),summary:a,actionHint:s||He.t("accountCard.failureHintTemporary"),technicalDetail:c,rawDetail:f,tone:"warning"}:{label:He.t("accountCard.failureLabelUnavailable"),summary:a,actionHint:s,technicalDetail:c,rawDetail:f,tone:"muted"}}function bN(n,a){if(!a?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Hd(a)?tN(a.models):null;case"codex":return Mr(a)?uN(a.windows):null;case"claude":case"anthropic":return Dr(a)?fN(a):null;case"gemini":return Bd(a)?mN(a.buckets):null;case"ghcp":case"github-copilot":return Kd(a)?gN(a.snapshots):null;default:return null}}function vN(n,a){if(!a?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Hd(a)?nN(a.models):null;case"codex":return Mr(a)?dN(a.windows):null;case"claude":case"anthropic":return Dr(a)?hN(a):null;case"gemini":return Bd(a)?pN(a.buckets):null;case"ghcp":case"github-copilot":return Kd(a)?a.quotaResetDate:null;default:return null}}const ar=kr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ft({className:n,variant:a,size:s,asChild:l=!1,...c}){const f=l?pr:"button";return r.jsx(f,{"data-slot":"button",className:K(ar({variant:a,size:s,className:n})),...c})}function Un({className:n,type:a,...s}){return r.jsx("input",{type:a,"data-slot":"input",className:K("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n),...s})}function SN({...n}){return r.jsx(ky,{"data-slot":"sheet",...n})}function CN({...n}){return r.jsx(Dy,{"data-slot":"sheet-portal",...n})}function wN({className:n,...a}){return r.jsx(Ey,{"data-slot":"sheet-overlay",className:K("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...a})}function NN({className:n,children:a,side:s="right",...l}){return r.jsxs(CN,{children:[r.jsx(wN,{}),r.jsxs(Ay,{"data-slot":"sheet-content",className:K("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",s==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",s==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",s==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",s==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",n),...l,children:[a,r.jsxs(Ty,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[r.jsx(vo,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function kN({className:n,...a}){return r.jsx("div",{"data-slot":"sheet-header",className:K("flex flex-col gap-1.5 p-4",n),...a})}function AN({className:n,...a}){return r.jsx(jy,{"data-slot":"sheet-title",className:K("text-foreground font-semibold",n),...a})}function TN({className:n,...a}){return r.jsx(My,{"data-slot":"sheet-description",className:K("text-muted-foreground text-sm",n),...a})}function Ge({className:n,...a}){return r.jsx("div",{"data-slot":"skeleton",className:K("relative overflow-hidden bg-muted/50 before:absolute before:inset-0 before:-translate-x-full","before:bg-gradient-to-r before:from-transparent before:via-muted/30 before:to-transparent","before:animate-[shimmer_2s_infinite_ease-out] rounded-md",n),...a})}function Ci({delayDuration:n=0,...a}){return r.jsx(I0,{"data-slot":"tooltip-provider",delayDuration:n,...a})}function $a({...n}){return r.jsx(Ci,{children:r.jsx(H0,{"data-slot":"tooltip",...n})})}function Xa({...n}){return r.jsx(B0,{"data-slot":"tooltip-trigger",...n})}function Za({className:n,sideOffset:a=0,children:s,...l}){return r.jsx(K0,{children:r.jsxs(q0,{"data-slot":"tooltip-content",sideOffset:a,className:K("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),...l,children:[s,r.jsx(G0,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const jN="sidebar_state",MN=3600*24*7,DN="16rem",EN="18rem",ON="3rem",RN="b";function PN({defaultOpen:n=!0,open:a,onOpenChange:s,className:l,style:c,children:f,...h}){const m=eN(),[p,y]=S.useState(!1),[C,x]=S.useState(n),v=a??C,N=S.useCallback(j=>{const H=typeof j=="function"?j(v):j;s?s(H):x(H),document.cookie=`${jN}=${H}; path=/; max-age=${MN}`},[s,v]),w=S.useCallback(()=>m?y(j=>!j):N(j=>!j),[m,N,y]);S.useEffect(()=>{const j=H=>{H.key===RN&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),w())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[w]);const M=v?"expanded":"collapsed",E=S.useMemo(()=>({state:M,open:v,setOpen:N,isMobile:m,openMobile:p,setOpenMobile:y,toggleSidebar:w}),[M,v,N,m,p,y,w]);return r.jsx(fx.Provider,{value:E,children:r.jsx(Ci,{delayDuration:0,children:r.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":DN,"--sidebar-width-icon":ON,...c},className:K("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-svh min-h-0 w-full overflow-hidden",l),...h,children:f})})})}function LN({side:n="left",variant:a="sidebar",collapsible:s="offcanvas",className:l,children:c,...f}){const{isMobile:h,state:m,openMobile:p,setOpenMobile:y}=Tr();return s==="none"?r.jsx("div",{"data-slot":"sidebar",className:K("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",l),...f,children:c}):h?r.jsx(SN,{open:p,onOpenChange:y,...f,children:r.jsxs(NN,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":EN},side:n,children:[r.jsxs(kN,{className:"sr-only",children:[r.jsx(AN,{children:"Sidebar"}),r.jsx(TN,{children:"Displays the mobile sidebar."})]}),r.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):r.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":m,"data-collapsible":m==="collapsed"?s:"","data-variant":a,"data-side":n,"data-slot":"sidebar",children:[r.jsx("div",{"data-slot":"sidebar-gap",className:K("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),r.jsx("div",{"data-slot":"sidebar-container",className:K("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",n==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",l),...f,children:r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:c})})]})}function _N({className:n,onClick:a,...s}){const{toggleSidebar:l}=Tr();return r.jsxs(ft,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:K("size-7",n),onClick:c=>{a?.(c),l()},...s,children:[r.jsx(AS,{}),r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function zN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:K("flex flex-col gap-2 p-2",n),...a})}function UN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:K("flex flex-col gap-2 p-2",n),...a})}function IN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:K("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),...a})}function HN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:K("relative flex w-full min-w-0 flex-col p-2",n),...a})}function BN({className:n,asChild:a=!1,...s}){const l=a?pr:"div";return r.jsx(l,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:K("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",n),...s})}function KN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:K("w-full text-sm",n),...a})}function qN({className:n,...a}){return r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:K("flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center",n),...a})}function GN({className:n,...a}){return r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:K("group/menu-item relative",n),...a})}const YN=kr("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bg({asChild:n=!1,isActive:a=!1,variant:s="default",size:l="default",tooltip:c,className:f,...h}){const m=n?pr:"button",{isMobile:p,state:y}=Tr(),C=r.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":l,"data-active":a,className:K(YN({variant:s,size:l}),f),...h});return c?(typeof c=="string"&&(c={children:c}),r.jsxs($a,{children:[r.jsx(Xa,{asChild:!0,children:C}),r.jsx(Za,{side:"right",align:"center",hidden:y!=="collapsed"||p,...c})]})):C}function VN({className:n,...a}){return r.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:K("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",n),...a})}function FN({className:n,...a}){return r.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:K("group/menu-sub-item relative",n),...a})}function QN({asChild:n=!1,size:a="md",isActive:s=!1,className:l,...c}){const f=n?pr:"a";return r.jsx(f,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":s,className:K("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",l),...c})}const WN={sm:24,md:32,lg:48};function px({size:n="md",className:a,showText:s=!0}){const l=WN[n];return r.jsxs("div",{className:K("flex items-center gap-2",a),children:[r.jsx("img",{src:"/logo/ccs-logo-256.png",alt:"CCS Logo",width:l,height:l,className:"rounded"}),s&&r.jsx("span",{className:"font-bold text-lg",children:"CCS Config"})]})}const Jl="/api",gx="CONFLICT";class sD extends Error{code=gx;constructor(a="Resource modified externally"){super(a),this.name="ApiConflictError"}}function lD(n){return n instanceof Error&&"code"in n&&n.code===gx}function ws(n){return n?/^https?:\/\//i.test(n)||n===Jl||n.startsWith(`${Jl}/`)?n:`${Jl}${n.startsWith("/")?n:`/${n}`}`:Jl}async function $N(n){const a=`Request failed (${n.status}${n.statusText?` ${n.statusText}`:""})`,s=await n.text();if(!s)return a;try{const l=JSON.parse(s);return l.error?.trim()?l.error:l.message?.trim()?l.message:a}catch{return s.trim()||a}}async function he(n,a){const s=await fetch(ws(n),{headers:{"Content-Type":"application/json"},...a});if(!s.ok)throw new Error(await $N(s));if(s.status===204)return;if((s.headers.get("content-type")?.toLowerCase()??"").includes("application/json"))return await s.json();const c=await s.text();if(c)try{return JSON.parse(c)}catch{return c}}const Be={profiles:{list:()=>he("/profiles"),create:n=>he("/profiles",{method:"POST",body:JSON.stringify(n)}),update:(n,a)=>he(`/profiles/${n}`,{method:"PUT",body:JSON.stringify(a)}),delete:n=>he(`/profiles/${n}`,{method:"DELETE"}),discoverOrphans:()=>he("/profiles/orphans"),registerOrphans:n=>he("/profiles/orphans/register",{method:"POST",body:JSON.stringify(n)}),copy:(n,a)=>he(`/profiles/${n}/copy`,{method:"POST",body:JSON.stringify(a)}),export:(n,a=!1)=>he(`/profiles/${n}/export`,{method:"POST",body:JSON.stringify({includeSecrets:a})}),import:n=>he("/profiles/import",{method:"POST",body:JSON.stringify(n)})},cliproxy:{list:()=>he("/cliproxy"),getAuthStatus:()=>he("/cliproxy/auth"),create:n=>he("/cliproxy",{method:"POST",body:JSON.stringify(n)}),update:(n,a)=>he(`/cliproxy/${n}`,{method:"PUT",body:JSON.stringify(a)}),delete:n=>he(`/cliproxy/${n}`,{method:"DELETE"}),proxyStatus:()=>he("/cliproxy/proxy-status"),proxyStart:()=>he("/cliproxy/proxy-start",{method:"POST"}),proxyStop:()=>he("/cliproxy/proxy-stop",{method:"POST"}),updateCheck:()=>he("/cliproxy/update-check"),versions:()=>he("/cliproxy/versions"),install:(n,a)=>he("/cliproxy/install",{method:"POST",body:JSON.stringify({version:n,force:a})}),restart:()=>he("/cliproxy/restart",{method:"POST"}),stats:()=>he("/cliproxy/usage"),models:()=>he("/cliproxy/models"),updateModel:(n,a)=>he(`/cliproxy/models/${n}`,{method:"PUT",body:JSON.stringify({model:a})}),getConfigYaml:async()=>{const n=await fetch(ws("/cliproxy/config.yaml"));if(!n.ok)throw new Error("Failed to load config");return n.text()},saveConfigYaml:async n=>{const a=await fetch(ws("/cliproxy/config.yaml"),{method:"PUT",headers:{"Content-Type":"application/yaml"},body:n});if(!a.ok){const s=await a.json().catch(()=>({error:"Failed to save config"}));throw new Error(s.error||"Failed to save config")}},getAuthFiles:()=>he("/cliproxy/auth-files"),getAuthFile:async n=>{const a=await fetch(ws(`/cliproxy/auth-files/download?name=${encodeURIComponent(n)}`));if(!a.ok)throw new Error("Failed to load auth file");return a.text()},accounts:{list:()=>he("/cliproxy/auth/accounts"),listByProvider:n=>he(`/cliproxy/auth/accounts/${n}`),setDefault:(n,a)=>he(`/cliproxy/auth/accounts/${n}/default`,{method:"POST",body:JSON.stringify({accountId:a})}),remove:(n,a)=>he(`/cliproxy/auth/accounts/${n}/${a}`,{method:"DELETE"}),pause:(n,a)=>he(`/cliproxy/auth/accounts/${n}/${a}/pause`,{method:"POST"}),resume:(n,a)=>he(`/cliproxy/auth/accounts/${n}/${a}/resume`,{method:"POST"}),solo:(n,a)=>he("/accounts/solo",{method:"POST",body:JSON.stringify({provider:n,accountId:a})}),bulkPause:(n,a)=>he("/accounts/bulk-pause",{method:"POST",body:JSON.stringify({provider:n,accountIds:a})}),bulkResume:(n,a)=>he("/accounts/bulk-resume",{method:"POST",body:JSON.stringify({provider:n,accountIds:a})})},auth:{start:(n,a)=>he(`/cliproxy/auth/${n}/start`,{method:"POST",body:JSON.stringify({nickname:a})}),cancel:n=>he(`/cliproxy/auth/${n}/cancel`,{method:"POST"}),kiroImport:()=>he("/cliproxy/auth/kiro/import",{method:"POST"})},errorLogs:{list:()=>he("/cliproxy/error-logs"),getContent:async n=>{const a=await fetch(ws(`/cliproxy/error-logs/${encodeURIComponent(n)}`));if(!a.ok)throw new Error("Failed to load error log");return a.text()}}},accounts:{list:()=>he("/accounts"),setDefault:n=>he("/accounts/default",{method:"POST",body:JSON.stringify({name:n})}),resetDefault:()=>he("/accounts/reset-default",{method:"DELETE"}),delete:n=>he(`/accounts/${n}`,{method:"DELETE"}),updateContext:(n,a)=>he(`/accounts/${encodeURIComponent(n)}/context`,{method:"PUT",body:JSON.stringify(a)})},config:{format:()=>he("/config/format"),get:()=>he("/config"),update:n=>he("/config",{method:"PUT",body:JSON.stringify(n)}),migrate:(n=!1)=>he(`/config/migrate?dryRun=${n}`,{method:"POST"}),rollback:n=>he("/config/rollback",{method:"POST",body:JSON.stringify({backupPath:n})})},presets:{list:n=>he(`/settings/${n}/presets`),create:(n,a)=>he(`/settings/${n}/presets`,{method:"POST",body:JSON.stringify(a)}),delete:(n,a)=>he(`/settings/${n}/presets/${encodeURIComponent(a)}`,{method:"DELETE"})},cliproxyServer:{get:()=>he("/cliproxy-server"),update:n=>he("/cliproxy-server",{method:"PUT",body:JSON.stringify(n)}),getBackend:()=>he("/cliproxy-server/backend"),updateBackend:(n,a=!1)=>he("/cliproxy-server/backend",{method:"PUT",body:JSON.stringify({backend:n,force:a})}),test:n=>he("/cliproxy-server/test",{method:"POST",body:JSON.stringify(n)})},quota:{get:(n,a)=>he(`/cliproxy/quota/${n}/${encodeURIComponent(a)}`),getCodex:n=>he(`/cliproxy/quota/codex/${encodeURIComponent(n)}`),getClaude:n=>he(`/cliproxy/quota/claude/${encodeURIComponent(n)}`),getGemini:n=>he(`/cliproxy/quota/gemini/${encodeURIComponent(n)}`)}};function rD(){return Tt({queryKey:["cliproxy"],queryFn:()=>Be.cliproxy.list()})}function XN(){return Tt({queryKey:["cliproxy-auth"],queryFn:()=>Be.cliproxy.getAuthStatus()})}function cD(){const n=it();return et({mutationFn:a=>Be.cliproxy.create(a),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),re.success("Variant created successfully")},onError:a=>{re.error(a.message)}})}function uD(){const n=it();return et({mutationFn:a=>Be.cliproxy.delete(a),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),re.success("Variant deleted successfully")},onError:a=>{re.error(a.message)}})}function dD(){const n=it();return et({mutationFn:({provider:a,accountId:s})=>Be.cliproxy.accounts.setDefault(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),re.success("Default account updated")},onError:a=>{re.error(a.message)}})}function fD(){const n=it();return et({mutationFn:({provider:a,accountId:s})=>Be.cliproxy.accounts.remove(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),re.success("Account removed")},onError:a=>{re.error(a.message)}})}function ZN(){const n=it();return et({mutationFn:({provider:a,accountId:s})=>Be.cliproxy.accounts.pause(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success("Account paused")},onError:a=>{re.error(a.message)}})}function JN(){const n=it();return et({mutationFn:({provider:a,accountId:s})=>Be.cliproxy.accounts.resume(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success("Account resumed")},onError:a=>{re.error(a.message)}})}function hD(){const n=it();return et({mutationFn:({provider:a,accountId:s})=>Be.cliproxy.accounts.solo(a,s),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]});const s=a.paused.length;re.success(`Solo mode: paused ${s} other account${s!==1?"s":""}`)},onError:a=>{re.error(a.message)}})}function mD(){const n=it();return et({mutationFn:({provider:a,accountIds:s})=>Be.cliproxy.accounts.bulkPause(a,s),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success(`Paused ${a.succeeded.length} account${a.succeeded.length!==1?"s":""}`),a.failed.length>0&&re.warning(`${a.failed.length} account${a.failed.length!==1?"s":""} failed to pause`)},onError:a=>{re.error(a.message)}})}function pD(){const n=it();return et({mutationFn:({provider:a,accountIds:s})=>Be.cliproxy.accounts.bulkResume(a,s),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success(`Resumed ${a.succeeded.length} account${a.succeeded.length!==1?"s":""}`),a.failed.length>0&&re.warning(`${a.failed.length} account${a.failed.length!==1?"s":""} failed to resume`)},onError:a=>{re.error(a.message)}})}function gD(){const n=it();return et({mutationFn:({provider:a,nickname:s})=>Be.cliproxy.auth.start(a,s),onSuccess:(a,s)=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),re.success(`Account added for ${s.provider}`)},onError:a=>{re.error(a.message)}})}function yD(){return et({mutationFn:n=>Be.cliproxy.auth.cancel(n),onError:n=>{re.error(n.message)}})}function xD(){const n=it();return et({mutationFn:()=>Be.cliproxy.auth.kiroImport(),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),a.account?re.success(`Imported Kiro account: ${a.account.email||a.account.id}`):re.success("Kiro token imported")},onError:a=>{re.error(a.message)}})}function bD(){return Tt({queryKey:["cliproxy-models"],queryFn:()=>Be.cliproxy.models()})}function vD(n){return Tt({queryKey:["presets",n],queryFn:()=>Be.presets.list(n),enabled:!!n})}function SD(){const n=it();return et({mutationFn:({profile:a,data:s})=>Be.presets.create(a,s),onSuccess:(a,s)=>{n.invalidateQueries({queryKey:["presets",s.profile]}),re.success(`Preset "${s.data.name}" saved`)},onError:a=>{re.error(a.message)}})}function CD(){const n=it();return et({mutationFn:({profile:a,name:s})=>Be.presets.delete(a,s),onSuccess:(a,s)=>{n.invalidateQueries({queryKey:["presets",s.profile]}),re.success("Preset deleted")},onError:a=>{re.error(a.message)}})}function wD(){return Tt({queryKey:["proxy-status"],queryFn:()=>Be.cliproxy.proxyStatus(),refetchInterval:3e4})}function ND(){const n=it();return et({mutationFn:()=>Be.cliproxy.proxyStart(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.alreadyRunning?re.info("CLIProxy was already running"):a.started?re.success("CLIProxy started successfully"):re.error(a.error||"Failed to start CLIProxy")},onError:a=>{re.error(a.message)}})}function kD(){const n=it();return et({mutationFn:()=>Be.cliproxy.proxyStop(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.stopped?re.success(`CLIProxy stopped${a.sessionCount?` (${a.sessionCount} session(s) disconnected)`:""}`):re.error(a.error||"Failed to stop CLIProxy")},onError:a=>{re.error(a.message)}})}function e1(){return Tt({queryKey:["cliproxy-update-check"],queryFn:()=>Be.cliproxy.updateCheck(),staleTime:300*1e3,refetchInterval:300*1e3,refetchOnWindowFocus:!0})}function AD(){const n=it();return et({mutationKey:["update-backend"],mutationFn:({backend:a,force:s=!1})=>Be.cliproxyServer.updateBackend(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-update-check"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-versions"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-server-config"],refetchType:"all"}),n.invalidateQueries({queryKey:["proxy-status"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success("Backend updated")},onError:a=>{a.message.includes("Proxy is running")?re.error("Stop the proxy first to change backend"):re.error(a.message)}})}function TD(){return Tt({queryKey:["cliproxy-versions"],queryFn:()=>Be.cliproxy.versions(),staleTime:300*1e3,refetchOnWindowFocus:!0})}function jD(){const n=it();return et({mutationFn:({version:a,force:s})=>Be.cliproxy.install(a,s),onSuccess:a=>{a.requiresConfirmation||(n.invalidateQueries({queryKey:["cliproxy-versions"]}),n.invalidateQueries({queryKey:["cliproxy-update-check"]}),n.invalidateQueries({queryKey:["proxy-status"]}),a.success?re.success(a.message||`Installed v${a.version}`):re.error(a.error||"Installation failed"))},onError:a=>{re.error(a.message)}})}function MD(){const n=it();return et({mutationFn:()=>Be.cliproxy.restart(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.success?re.success(`Proxy restarted on port ${a.port}`):re.error(a.error||"Restart failed")},onError:a=>{re.error(a.message)}})}const t1=Y0,n1=V0,a1=F0;function i1(n){return[{title:n("nav.general"),items:[{path:"/",icon:TS,label:n("nav.home")},{path:"/analytics",icon:jS,label:n("nav.analytics")}]},{title:n("nav.identityAccess"),items:[{path:"/providers",icon:Yy,label:n("nav.apiProfiles"),badge:{icons:["/icons/openrouter.svg","/assets/providers/alibabacloud-color.svg","/icons/ollama.svg"]}},{path:"/cliproxy",icon:Vy,label:n("nav.cliproxyPlus"),isCollapsible:!0,children:[{path:"/cliproxy",label:n("nav.cliproxyOverview")},{path:"/cliproxy/control-panel",icon:MS,label:n("nav.controlPanel")}]},{path:"/copilot",icon:Fy,label:n("nav.githubCopilot")},{path:"/cursor",iconSrc:"/assets/sidebar/cursor.svg",label:n("nav.cursorIde")},{path:"/accounts",icon:Wy,label:n("nav.accounts"),isCollapsible:!0,children:[{path:"/accounts",label:n("nav.allAccounts")},{path:"/shared",icon:Qy,label:n("nav.sharedData")}]}]},{title:n("nav.compatibleClis"),items:[{path:"/droid",icon:DS,label:n("nav.factoryDroid")}]},{title:n("nav.system"),items:[{path:"/health",icon:Ds,label:n("nav.health")},{path:"/settings",icon:ES,label:n("nav.settings")}]}]}function o1(){const{t:n}=_t(),a=gr(),s=Dd(),{state:l}=Tr(),{data:c}=e1(),f=i1(n),h=c?.backendLabel??"CLIProxy",m=v=>v.path==="/cliproxy"?h:v.label,p=v=>a.pathname===v,y=v=>v.some(N=>p(N.path)||a.pathname.startsWith(N.path+"/")),C=v=>v.path==="/accounts"?"/shared":v.path,x=v=>{if(v.iconSrc)return r.jsx("img",{src:v.iconSrc,alt:"",className:"w-4 h-4 object-contain"});if(v.icon){const N=v.icon;return r.jsx(N,{className:"w-4 h-4"})}return null};return r.jsxs(LN,{collapsible:"icon",children:[r.jsx(zN,{className:"h-12 flex items-center justify-center",children:r.jsx(px,{size:"sm",showText:l==="expanded"})}),r.jsx(IN,{children:f.map((v,N)=>r.jsxs(HN,{children:[v.title&&r.jsx(BN,{children:v.title}),r.jsx(KN,{children:r.jsx(qN,{children:v.items.map(w=>r.jsx(GN,{children:w.isCollapsible&&w.children?r.jsxs(t1,{defaultOpen:y(w.children)||p(w.path),className:"group/collapsible",children:[r.jsx(n1,{asChild:!0,children:r.jsxs(Bg,{tooltip:m(w),isActive:y(w.children),onClick:()=>s(C(w)),children:[x(w),r.jsx("span",{className:"group-data-[collapsible=icon]:hidden",children:m(w)}),r.jsx(yr,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 group-data-[collapsible=icon]:hidden"})]})}),r.jsx(a1,{children:r.jsx(VN,{children:w.children.map(M=>r.jsx(FN,{children:r.jsx(QN,{asChild:!0,isActive:p(M.path),children:r.jsx(gd,{to:M.path,children:r.jsx("span",{children:M.label})})})},M.path))})})]}):r.jsx(Bg,{asChild:!0,isActive:p(w.path),tooltip:m(w),children:r.jsxs(gd,{to:w.path,children:[x(w),r.jsx("span",{className:"group-data-[collapsible=icon]:hidden flex-1",children:m(w)}),w.badge&&r.jsxs($a,{children:[r.jsx(Xa,{asChild:!0,children:r.jsxs("span",{className:K("group-data-[collapsible=icon]:hidden ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded transition-colors",p(w.path)?"bg-white/92 border border-white/65 shadow-sm":"bg-accent/15 text-accent border border-accent/30 group-hover/menu-item:bg-sidebar-accent-foreground/20 group-hover/menu-item:text-sidebar-accent-foreground group-hover/menu-item:border-sidebar-accent-foreground/30"),children:[(w.badge.icons&&w.badge.icons.length>0?w.badge.icons:w.badge.icon?[w.badge.icon]:[]).map(M=>r.jsx("span",{className:K("inline-flex h-4 w-4 items-center justify-center rounded-[3px] border",p(w.path)?"bg-white border-black/10":"bg-background/80 border-border/40 group-hover/menu-item:bg-white/90"),children:r.jsx("img",{src:M,alt:"",className:"h-3 w-3 object-contain"})},M)),w.badge.text&&r.jsx("span",{className:"hidden sm:inline",children:w.badge.text})]})}),r.jsx(Za,{side:"right",children:r.jsx("p",{children:n("nav.openrouterTooltip")})})]})]})})},w.path))})})]},v.title||N))}),r.jsx(UN,{className:"p-4 border-t flex items-center justify-center",children:r.jsx(_N,{})})]})}const yx=()=>{const n=S.useContext(rx);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n};function s1(){const{theme:n,setTheme:a}=yx();return r.jsxs(ft,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:[r.jsx(OS,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),r.jsx(RS,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),r.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function l1(){const{privacyMode:n,togglePrivacyMode:a}=_d();return r.jsxs($a,{children:[r.jsx(Xa,{asChild:!0,children:r.jsx(ft,{variant:"ghost",size:"icon",onClick:a,className:K("h-8 w-8 transition-colors",n&&"text-amber-600 hover:text-amber-700 dark:text-amber-400"),children:n?r.jsx(xr,{className:"h-4 w-4"}):r.jsx(br,{className:"h-4 w-4"})})}),r.jsx(Za,{children:r.jsx("p",{children:n?"Privacy mode ON - Click to show data":"Privacy mode OFF - Click to hide data"})})]})}const r1="https://github.com/kaitranntt/ccs/issues";function c1(){return r.jsx(ft,{variant:"ghost",size:"icon",asChild:!0,title:"Report an issue on GitHub",children:r.jsx("a",{href:r1,target:"_blank",rel:"noopener noreferrer",children:r.jsx(Fy,{className:"w-4 h-4"})})})}const u1="https://docs.ccs.kaitran.ca";function d1(){return r.jsx(ft,{variant:"ghost",size:"icon",asChild:!0,title:"View documentation",children:r.jsx("a",{href:u1,target:"_blank",rel:"noopener noreferrer",children:r.jsx(PS,{className:"w-4 h-4"})})})}function f1(){const[n,a]=S.useState("disconnected"),[s,l]=S.useState(!1),c=S.useRef(null),f=it(),h=S.useRef(0),m=5,p=S.useRef(null),y=S.useRef(()=>{}),C=S.useCallback(N=>{switch(N.type){case"connected":console.log("[WS] Server acknowledged connection");break;case"config-changed":f.invalidateQueries({queryKey:["profiles"]}),f.invalidateQueries({queryKey:["cliproxy"]}),re.info("Configuration updated externally");break;case"settings-changed":f.invalidateQueries({queryKey:["profiles"]}),re.info("Settings file updated");break;case"profiles-changed":f.invalidateQueries({queryKey:["accounts"]}),re.info("Accounts updated");break;case"proxy-status-changed":f.invalidateQueries({queryKey:["proxy-status"]});break;case"pong":break;default:console.log(`[WS] Unknown message: ${N.type}`)}},[f]),x=S.useCallback(()=>{if(c.current?.readyState===WebSocket.OPEN)return;a("connecting");const N=window.location.protocol==="https:"?"wss:":"ws:",w=new WebSocket(`${N}//${window.location.host}`);c.current=w,w.onopen=()=>{a("connected"),l(!1),h.current=0,console.log("[WS] Connected")},w.onmessage=M=>{try{const E=JSON.parse(M.data);C(E),window.dispatchEvent(new CustomEvent("ws-message",{detail:E}))}catch{console.log("[WS] Invalid message")}},w.onclose=()=>{if(a("disconnected"),c.current=null,h.current<m){l(!0);const M=Math.min(1e3*Math.pow(2,h.current),3e4);h.current++,console.log(`[WS] Reconnecting in ${M}ms (attempt ${h.current})`),p.current=setTimeout(()=>{y.current()},M)}else l(!1)},w.onerror=()=>{console.log("[WS] Connection error")}},[C]);y.current=x;const v=S.useCallback(()=>{h.current=m,l(!1),p.current&&(clearTimeout(p.current),p.current=null),c.current?.close()},[]);return S.useEffect(()=>(y.current(),()=>v()),[]),S.useEffect(()=>{const N=setInterval(()=>{c.current?.readyState===WebSocket.OPEN&&c.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>clearInterval(N)},[]),S.useMemo(()=>({status:n,isReconnecting:s,connect:x,disconnect:v}),[n,s,x,v])}function h1(){const{status:n,isReconnecting:a}=f1(),l={connected:{icon:_S,color:"text-green-600",label:"Connected",animate:!1},connecting:{icon:Es,color:"text-yellow-500",label:"Connecting...",animate:!0},disconnected:{icon:a?Es:LS,color:a?"text-amber-500":"text-red-500",label:a?"Reconnecting...":"Disconnected",animate:a}}[n],c=l.icon;return r.jsxs("div",{className:`flex items-center gap-1 text-sm ${l.color}`,children:[r.jsx(c,{className:`w-4 h-4 ${l.animate?"animate-spin":""}`}),r.jsx("span",{className:"hidden sm:inline",children:l.label})]})}function m1(){const[n,a]=S.useState(!1);return n?null:r.jsx("div",{className:"w-full bg-yellow-50 dark:bg-yellow-900/20 border-t border-yellow-200 dark:border-yellow-800 px-4 py-2 transition-colors duration-200",children:r.jsxs("div",{className:"flex items-center justify-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2 text-sm text-yellow-800 dark:text-yellow-200",children:[r.jsx(zS,{className:"w-4 h-4 flex-shrink-0"}),r.jsx("span",{className:"hidden sm:inline",children:"This dashboard runs locally. All data stays on your machine."}),r.jsx("span",{className:"sm:hidden",children:"Local dashboard - data stays on your device."})]}),r.jsx("button",{onClick:()=>a(!0),className:"text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 flex-shrink-0 p-1 rounded hover:bg-yellow-100 dark:hover:bg-yellow-800/30 transition-colors","aria-label":"Dismiss disclaimer",children:r.jsx(vo,{className:"w-4 h-4"})})]})})}const p1="https://claudekit.cc?ref=HMNKXOHN";function g1(){return r.jsxs("a",{href:p1,target:"_blank",rel:"noopener noreferrer",className:K("group inline-flex items-center gap-2 px-3 py-1.5 rounded-lg","bg-accent/10 border-2 border-accent/40","hover:bg-accent hover:border-accent","transition-all duration-200 shadow-sm hover:shadow-md"),title:"Powered by ClaudeKit Framework",children:[r.jsx("img",{src:"/logos/claudekit-logo.png",alt:"ClaudeKit",className:"w-5 h-5"}),r.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[r.jsx("span",{className:K("text-[10px] font-medium uppercase tracking-wide","text-muted-foreground group-hover:text-accent-foreground/80","transition-colors"),children:"Powered by"}),r.jsx("span",{className:K("text-xs font-bold text-foreground","group-hover:text-accent-foreground","transition-colors"),children:"ClaudeKit"})]})]})}const y1="https://github.com/sponsors/kaitranntt";function x1(){return r.jsxs("a",{href:y1,target:"_blank",rel:"noopener noreferrer",className:K("group inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg","bg-pink-500/10 border-2 border-pink-500/40","hover:bg-pink-400 hover:border-pink-400","transition-all duration-200 shadow-sm hover:shadow-md"),title:"Sponsor this project on GitHub",children:[r.jsx(US,{className:K("w-4 h-4 text-pink-500","group-hover:text-white group-hover:fill-white","group-hover:animate-pulse","transition-colors")}),r.jsx("span",{className:K("text-xs font-bold text-pink-600 dark:text-pink-300","group-hover:text-white dark:group-hover:text-white","transition-colors"),children:"Sponsor"})]})}function qd({...n}){return r.jsx(ky,{"data-slot":"dialog",...n})}function b1({...n}){return r.jsx(Dy,{"data-slot":"dialog-portal",...n})}function v1({className:n,...a}){return r.jsx(Ey,{"data-slot":"dialog-overlay",className:K("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),...a})}function Gd({className:n,children:a,showCloseButton:s=!0,...l}){return r.jsxs(b1,{"data-slot":"dialog-portal",children:[r.jsx(v1,{}),r.jsxs(Ay,{"data-slot":"dialog-content",className:K("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",n),...l,children:[a,s&&r.jsxs(Ty,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[r.jsx(vo,{}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Yd({className:n,...a}){return r.jsx("div",{"data-slot":"dialog-header",className:K("flex flex-col gap-2 text-center sm:text-left",n),...a})}function S1({className:n,...a}){return r.jsx("div",{"data-slot":"dialog-footer",className:K("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...a})}function Vd({className:n,...a}){return r.jsx(jy,{"data-slot":"dialog-title",className:K("text-lg leading-none font-semibold",n),...a})}function Fd({className:n,...a}){return r.jsx(My,{"data-slot":"dialog-description",className:K("text-muted-foreground text-sm",n),...a})}function C1({open:n,onClose:a,sessionId:s,provider:l,projects:c,defaultProjectId:f,supportsAll:h,onSelect:m,timeoutSeconds:p=30}){const[y,C]=S.useState(f),[x,v]=S.useState(!1),[N,w]=S.useState(p);S.useEffect(()=>{if(!n){w(p);return}const j=setInterval(()=>{w(H=>H<=1?(clearInterval(j),M(!0),0):H-1)},1e3);return()=>clearInterval(j)},[n,p]),S.useEffect(()=>{n&&(C(f),v(!1),w(p))},[n,f,p]);const M=async(j=!1)=>{if(!x){v(!0);try{await m(j?"":y),a()}catch(H){console.error("Failed to submit project selection:",H);try{await m("")}catch{}a()}}},E=l.charAt(0).toUpperCase()+l.slice(1);return r.jsx(qd,{open:n,onOpenChange:j=>!j&&!x&&a(),children:r.jsxs(Gd,{className:"sm:max-w-lg",children:[r.jsxs(Yd,{children:[r.jsxs(Vd,{className:"flex items-center gap-2",children:[r.jsx(Qy,{className:"w-5 h-5"}),"Select Google Cloud Project"]}),r.jsxs(Fd,{children:["Choose which project to use for ",E," authentication.",N>0&&r.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Auto-selecting default in ",N,"s)"]})]})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[c.map(j=>r.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${y===j.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!x&&C(j.id),children:[y===j.id?r.jsx(cg,{className:"w-5 h-5 text-primary"}):r.jsx(ug,{className:"w-5 h-5 text-muted-foreground"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"font-medium",children:j.name}),r.jsx("div",{className:"text-sm text-muted-foreground font-mono",children:j.id})]}),j.id===f&&r.jsx("span",{className:"text-xs px-2 py-1 bg-secondary rounded",children:"Default"})]},j.id)),h&&r.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${y==="ALL"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!x&&C("ALL"),children:[y==="ALL"?r.jsx(cg,{className:"w-5 h-5 text-primary"}):r.jsx(ug,{className:"w-5 h-5 text-muted-foreground"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"font-medium",children:"All Projects"}),r.jsxs("div",{className:"text-sm text-muted-foreground",children:["Onboard all ",c.length," listed projects"]})]})]})]}),r.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[r.jsx(ft,{variant:"ghost",onClick:()=>M(!0),disabled:x,children:"Use Default"}),r.jsx(ft,{onClick:()=>M(!1),disabled:x,children:x?r.jsxs(r.Fragment,{children:[r.jsx(Dn,{className:"w-4 h-4 mr-2 animate-spin"}),"Selecting..."]}):r.jsxs(r.Fragment,{children:[r.jsx(xo,{className:"w-4 h-4 mr-2"}),"Confirm Selection"]})})]})]})]})})}const bo={gemini:{displayName:"Google Gemini",description:"Gemini Pro/Flash models",oauthFlow:"authorization_code",callbackPort:8085,callbackProviderName:"gemini",authUrlProviderName:"gemini-cli",refreshOwnership:"ccs",authFilePrefixes:["gemini-","google-"],tokenTypeValues:["gemini"],aliases:["gemini-cli"]},codex:{displayName:"OpenAI Codex",description:"GPT-4 and codex models",oauthFlow:"authorization_code",callbackPort:1455,callbackProviderName:"codex",authUrlProviderName:"codex",refreshOwnership:"cliproxy",authFilePrefixes:["codex-","openai-"],tokenTypeValues:["codex"],aliases:[]},agy:{displayName:"Antigravity",description:"Antigravity AI models",oauthFlow:"authorization_code",callbackPort:51121,callbackProviderName:"antigravity",authUrlProviderName:"antigravity",refreshOwnership:"cliproxy",authFilePrefixes:["antigravity-","agy-"],tokenTypeValues:["antigravity"],aliases:["antigravity"]},qwen:{displayName:"Alibaba Qwen",description:"Qwen Code models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"qwen",authUrlProviderName:"qwen",refreshOwnership:"cliproxy",authFilePrefixes:["qwen-"],tokenTypeValues:["qwen"],aliases:[]},iflow:{displayName:"iFlow",description:"iFlow AI models",oauthFlow:"authorization_code",callbackPort:11451,callbackProviderName:"iflow",authUrlProviderName:"iflow",refreshOwnership:"cliproxy",authFilePrefixes:["iflow-"],tokenTypeValues:["iflow"],aliases:[]},kiro:{displayName:"Kiro (AWS)",description:"AWS CodeWhisperer models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kiro",authUrlProviderName:"kiro",refreshOwnership:"cliproxy",authFilePrefixes:["kiro-","aws-","codewhisperer-"],tokenTypeValues:["kiro","codewhisperer"],aliases:["codewhisperer"]},ghcp:{displayName:"GitHub Copilot (OAuth)",description:"GitHub Copilot via OAuth",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"copilot",authUrlProviderName:"github",refreshOwnership:"cliproxy",authFilePrefixes:["github-copilot-","copilot-","gh-"],tokenTypeValues:["github-copilot","copilot"],aliases:["github-copilot","copilot"]},claude:{displayName:"Claude (Anthropic)",description:"Claude Opus/Sonnet models",oauthFlow:"authorization_code",callbackPort:54545,callbackProviderName:"anthropic",authUrlProviderName:"anthropic",refreshOwnership:"unsupported",authFilePrefixes:["claude-","anthropic-"],tokenTypeValues:["claude","anthropic"],aliases:["anthropic"]},kimi:{displayName:"Kimi (Moonshot)",description:"Moonshot AI K2/K2.5 models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kimi",authUrlProviderName:"kimi",refreshOwnership:"cliproxy",authFilePrefixes:["kimi-"],tokenTypeValues:["kimi"],aliases:["moonshot"]}},Qd=Object.freeze(Object.keys(bo)),Cd=Object.freeze(["agy","codex","claude","gemini","ghcp"]);new Set(Cd);const w1=Object.freeze([...Cd,...Cd.flatMap(n=>bo[n].aliases),"all"].filter((n,a,s)=>s.indexOf(n)===a));w1.join(", ");new Set(Qd);function N1(n=bo){const a=new Map,s=Object.keys(n),l=(c,f)=>{const h=c.trim().toLowerCase();if(!h)return;const m=a.get(h);if(m&&m!==f)throw new Error(`Provider alias collision for "${h}": ${m} and ${f}`);a.set(h,f)};for(const c of s){l(c,c);for(const f of n[c].aliases)l(f,c)}return a}N1();function k1(n){return Qd.filter(a=>bo[a].oauthFlow===n)}const Wd=Qd;function Ja(n){return Wd.includes(n)}function va(n){return typeof n=="string"?n.trim().toLowerCase():""}const xx=Object.freeze(Object.fromEntries(Wd.map(n=>[n,{displayName:bo[n].displayName,description:bo[n].description}]))),A1={gemini:"/assets/providers/gemini-color.svg",agy:"/assets/providers/agy.png",codex:"/assets/providers/openai.svg",qwen:"/assets/providers/qwen-color.svg",iflow:"/assets/providers/iflow.png",kiro:"/assets/providers/kiro.png",ghcp:"/assets/providers/copilot.svg",claude:"/assets/providers/claude.svg",kimi:"/assets/providers/kimi.svg"},Kg={textClass:"text-gray-600",letter:"?"},T1={gemini:{textClass:"text-blue-600",letter:"G"},claude:{textClass:"text-orange-600",letter:"C"},codex:{textClass:"text-emerald-600",letter:"X"},agy:{textClass:"text-violet-600",letter:"A"},qwen:{textClass:"text-cyan-600",letter:"Q"},iflow:{textClass:"text-indigo-600",letter:"i"},kiro:{textClass:"text-teal-600",letter:"K"},ghcp:{textClass:"text-green-600",letter:"C"},kimi:{textClass:"text-orange-500",letter:"K"}},j1=new Set(["kimi"]);function M1(n){const a=va(n);if(Ja(a))return A1[a]}function DD(n){const a=va(n);return Ja(a)?T1[a]:{...Kg,letter:a[0]?.toUpperCase()||Kg.letter}}function ED(n){const a=va(n);return Ja(a)&&j1.has(a)}const $d={gemini:"#4285F4",agy:"#f3722c",codex:"#10a37f",vertex:"#4285F4",iflow:"#f94144",qwen:"#6236FF",kiro:"#4d908e",ghcp:"#43aa8b",claude:"#D97757",kimi:"#FF6B35"},D1={...Object.fromEntries(Wd.map(n=>[n,xx[n].displayName])),vertex:"Vertex AI"};function Xd(n){const a=va(n);return a?D1[a]||String(n):"Unknown provider"}function E1(n){const a=va(n);return Ja(a)?xx[a].description:""}const O1=[...k1("device_code")],R1=Object.freeze({ghcp:"GitHub Copilot",kiro:"Kiro (AWS)",qwen:"Qwen Code"}),P1=Object.freeze({ghcp:"Sign in with your GitHub account that has Copilot access.",qwen:"Sign in with your Qwen account to authorize access.",kiro:"Sign in with your selected Kiro auth provider to continue.",kimi:"Sign in with your Kimi account and finish the device authorization."});function OD(n){const a=va(n);return Ja(a)&&O1.includes(a)}function ir(n){const a=va(n);return a?Ja(a)?R1[a]||Xd(a):String(n):"Unknown provider"}function L1(n){const a=va(n);return Ja(a)&&P1[a]||"Complete the authorization in your browser."}const _1=["ghcp","kiro"];function RD(n){const a=va(n);return Ja(a)&&_1.includes(a)}const PD="aws",qg=[{id:"aws",label:"AWS Builder ID (Recommended)",description:"Device code flow for AWS organizations and Builder ID accounts.",flowType:"device_code",startEndpoint:"start"},{id:"aws-authcode",label:"AWS Builder ID (Auth Code)",description:"Authorization code flow via CLI binary.",flowType:"authorization_code",startEndpoint:"start"},{id:"google",label:"Google OAuth",description:"Social OAuth flow with callback URL support.",flowType:"authorization_code",startEndpoint:"start-url"},{id:"github",label:"GitHub OAuth",description:"Social OAuth flow via management API callback.",flowType:"authorization_code",startEndpoint:"start-url"}];function LD(n){return qg.find(s=>s.id===n)||qg[0]}function z1({open:n,onClose:a,sessionId:s,provider:l,userCode:c,verificationUrl:f,expiresAt:h}){const[m,p]=S.useState(!1),[y,C]=S.useState(null);S.useEffect(()=>{if(!n)return;let H=null;const B=()=>{const U=Math.max(0,Math.floor((h-Date.now())/1e3));C(U),U===0&&H&&(clearInterval(H),H=null)};return B(),H=setInterval(B,1e3),()=>{H&&clearInterval(H)}},[n,h]);const x=S.useCallback(async()=>{try{await navigator.clipboard.writeText(c),p(!0),re.success(He.t("commonToast.codeCopied")),setTimeout(()=>p(!1),2e3)}catch{re.error(He.t("commonToast.copyCodeFailed"))}},[c]),v=S.useCallback(()=>{window.open(f,"_blank","noopener,noreferrer")},[f]),N=ir(l),w=L1(l),M=N==="Unknown provider"?"Open verification page":`Open ${N.split(" ")[0]}`,E=H=>{const B=Math.floor(H/60),U=H%60;return`${B}:${U.toString().padStart(2,"0")}`},j=y===0;return r.jsx(qd,{open:n,onOpenChange:H=>!H&&a(),children:r.jsxs(Gd,{className:"sm:max-w-md","data-session-id":s,children:[r.jsxs(Yd,{children:[r.jsxs(Vd,{className:"flex items-center gap-2",children:[r.jsx(Ed,{className:"w-5 h-5"}),"Authorize ",N]}),r.jsxs(Fd,{children:["Enter the code below at the authorization page.",y!==null&&y>0&&r.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Expires in ",E(y),")"]}),j&&r.jsx("span",{className:"text-destructive ml-1 font-medium",children:"(Code expired)"})]})]}),r.jsxs("div",{className:"space-y-6 py-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"bg-muted rounded-lg p-6 text-center",children:r.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.3em] text-foreground select-all",children:c})}),r.jsx(ft,{variant:"outline",size:"icon",className:"absolute top-2 right-2",onClick:x,"aria-label":m?"Code copied":"Copy verification code",children:m?r.jsx(xo,{className:"h-4 w-4 text-green-500"}):r.jsx(lr,{className:"h-4 w-4"})})]}),r.jsx("div",{className:"text-sm text-muted-foreground text-center",children:r.jsx("p",{children:w})}),r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsxs(ft,{onClick:v,className:"w-full",children:[r.jsx($y,{className:"w-4 h-4 mr-2"}),M]}),r.jsx(ft,{variant:"outline",onClick:x,className:"w-full",children:m?r.jsxs(r.Fragment,{children:[r.jsx(xo,{className:"w-4 h-4 mr-2 text-green-500"}),"Copied!"]}):r.jsxs(r.Fragment,{children:[r.jsx(lr,{className:"w-4 h-4 mr-2"}),"Copy Code"]})})]}),r.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[r.jsx(Dn,{className:"h-4 w-4 animate-spin"}),r.jsx("span",{children:"Waiting for authorization..."})]})]})]})})}function U1({...n}){return r.jsx(Q0,{"data-slot":"dropdown-menu",...n})}function I1({...n}){return r.jsx(W0,{"data-slot":"dropdown-menu-trigger",...n})}function H1({className:n,sideOffset:a=4,...s}){return r.jsx($0,{children:r.jsx(X0,{"data-slot":"dropdown-menu-content",sideOffset:a,className:K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",n),...s})})}function B1({className:n,inset:a,variant:s="default",...l}){return r.jsx(Z0,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":s,className:K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...l})}function K1(){const{authRequired:n,isAuthenticated:a,username:s,logout:l}=Ud();if(!n||!a)return null;const c=async()=>{await l()};return r.jsxs(U1,{children:[r.jsx(I1,{asChild:!0,children:r.jsxs(ft,{variant:"ghost",size:"sm",className:"gap-2",children:[r.jsx(IS,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:s})]})}),r.jsx(H1,{align:"end",children:r.jsxs(B1,{onClick:c,className:"gap-2 text-destructive",children:[r.jsx(HS,{className:"h-4 w-4"}),"Sign Out"]})})]})}const bx=iS,_D=sS,vx=oS,Zd=S.forwardRef(({className:n,children:a,...s},l)=>r.jsxs(Oy,{ref:l,className:K("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...s,children:[a,r.jsx(J0,{asChild:!0,children:r.jsx(vr,{className:"h-4 w-4 opacity-50"})})]}));Zd.displayName=Oy.displayName;const Sx=S.forwardRef(({className:n,...a},s)=>r.jsx(Ry,{ref:s,className:K("flex cursor-default items-center justify-center py-1",n),...a,children:r.jsx(Od,{className:"h-4 w-4"})}));Sx.displayName=Ry.displayName;const Cx=S.forwardRef(({className:n,...a},s)=>r.jsx(Py,{ref:s,className:K("flex cursor-default items-center justify-center py-1",n),...a,children:r.jsx(vr,{className:"h-4 w-4"})}));Cx.displayName=Py.displayName;const Jd=S.forwardRef(({className:n,children:a,position:s="popper",...l},c)=>r.jsx(eS,{children:r.jsxs(Ly,{ref:c,className:K("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:s,...l,children:[r.jsx(Sx,{}),r.jsx(tS,{className:K("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),r.jsx(Cx,{})]})}));Jd.displayName=Ly.displayName;const q1=S.forwardRef(({className:n,...a},s)=>r.jsx(_y,{ref:s,className:K("px-2 py-1.5 text-sm font-semibold",n),...a}));q1.displayName=_y.displayName;const dr=S.forwardRef(({className:n,children:a,...s},l)=>r.jsxs(zy,{ref:l,className:K("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...s,children:[r.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(nS,{children:r.jsx(xo,{className:"h-4 w-4"})})}),r.jsx(aS,{children:a})]}));dr.displayName=zy.displayName;const G1=S.forwardRef(({className:n,...a},s)=>r.jsx(Uy,{ref:s,className:K("-mx-1 my-1 h-px bg-muted",n),...a}));G1.displayName=Uy.displayName;function Y1(){const{t:n,i18n:a}=_t(),s=zs(a.resolvedLanguage??a.language??"en"),l=c=>{const f=qw(c);a.changeLanguage(f)};return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Xy,{className:"h-4 w-4 text-muted-foreground"}),r.jsxs(bx,{value:s,onValueChange:l,children:[r.jsx(Zd,{className:"h-8 w-[150px]",children:r.jsx(vx,{placeholder:n("layout.languageSwitcher")})}),r.jsx(Jd,{children:Bw.map(c=>r.jsx(dr,{value:c,children:n(`locale.${c}`)},c))})]})]})}function V1(){const[n,a]=S.useState({isOpen:!1,prompt:null});S.useEffect(()=>{const c=f=>{const h=f.detail;h.type==="projectSelectionRequired"?(console.log("[ProjectSelection] Received prompt:",h.sessionId),a({isOpen:!0,prompt:{sessionId:h.sessionId,provider:h.provider,projects:h.projects,defaultProjectId:h.defaultProjectId,supportsAll:h.supportsAll}})):h.type==="projectSelectionTimeout"?(console.log("[ProjectSelection] Timeout:",h.sessionId),a(m=>m.prompt?.sessionId===h.sessionId?{isOpen:!1,prompt:null}:m)):h.type==="projectSelectionSubmitted"&&(console.log("[ProjectSelection] Submitted:",h.sessionId),a(m=>m.prompt?.sessionId===h.sessionId?{isOpen:!1,prompt:null}:m))};return window.addEventListener("ws-message",c),()=>{window.removeEventListener("ws-message",c)}},[]);const s=S.useCallback(async c=>{if(!n.prompt)return;if(!(await fetch(`/api/cliproxy/auth/project-selection/${n.prompt.sessionId}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedId:c})})).ok)throw new Error("Failed to submit project selection")},[n.prompt]),l=S.useCallback(()=>{a({isOpen:!1,prompt:null})},[]);return S.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,onSelect:s,onClose:l}),[n.isOpen,n.prompt,s,l])}function F1(n){return typeof n!="string"?"unknown":n.trim().toLowerCase()||"unknown"}function Q1(){const[n,a]=S.useState({isOpen:!1,prompt:null,error:null});S.useEffect(()=>{const f=h=>{const m=h.detail;if(m.type==="deviceCodeReceived"){console.log("[DeviceCode] Received prompt:",m.sessionId);const p=F1(m.provider),y=ir(p);re.info(`${y} authorization required`),a({isOpen:!0,prompt:{sessionId:m.sessionId,provider:p,userCode:m.userCode,verificationUrl:m.verificationUrl,expiresAt:m.expiresAt},error:null})}else m.type==="deviceCodeCompleted"?(console.log("[DeviceCode] Auth completed:",m.sessionId),a(p=>{if(p.prompt&&p.prompt.sessionId===m.sessionId){const y=ir(p.prompt.provider);return re.success(`${y} authentication successful!`),{isOpen:!1,prompt:null,error:null}}return p})):m.type==="deviceCodeFailed"?(console.log("[DeviceCode] Auth failed:",m.sessionId,m.error),a(p=>{if(p.prompt&&p.prompt.sessionId===m.sessionId){const y=ir(p.prompt.provider);return re.error(`${y} authentication failed`),{isOpen:!1,prompt:null,error:m.error}}return p})):m.type==="deviceCodeExpired"&&(console.log("[DeviceCode] Code expired:",m.sessionId),a(p=>p.prompt?.sessionId===m.sessionId?(re.error("Device code expired. Please try again."),{isOpen:!1,prompt:null,error:"Device code expired"}):p))};return window.addEventListener("ws-message",f),()=>{window.removeEventListener("ws-message",f)}},[]);const s=S.useCallback(()=>{a({isOpen:!1,prompt:null,error:null})},[]),l=S.useCallback(()=>{n.prompt?.verificationUrl&&window.open(n.prompt.verificationUrl,"_blank","noopener,noreferrer")},[n.prompt]),c=S.useCallback(async()=>{if(n.prompt?.userCode)try{await navigator.clipboard.writeText(n.prompt.userCode),re.success("Code copied to clipboard")}catch{re.error("Failed to copy code")}},[n.prompt]);return S.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,error:n.error,onClose:s,onOpenUrl:l,onCopyCode:c}),[n.isOpen,n.prompt,n.error,s,l,c])}const W1="ccs-dashboard:last-route";function $1(n,a="",s=""){try{localStorage.setItem(W1,`${n}${a}${s}`)}catch{}}function X1(){return r.jsxs("div",{className:"p-6 space-y-4",children:[r.jsx(Ge,{className:"h-8 w-48"}),r.jsx(Ge,{className:"h-64 w-full"})]})}function Z1(){const n=gr(),{isOpen:a,prompt:s,onSelect:l,onClose:c}=V1(),f=Q1();return S.useEffect(()=>{$1(n.pathname,n.search,n.hash)},[n.pathname,n.search,n.hash]),r.jsxs(PN,{children:[r.jsx(o1,{}),r.jsxs("main",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-background",children:[r.jsxs("header",{className:"flex h-14 items-center justify-between px-6 border-b shrink-0 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(g1,{}),r.jsx(x1,{})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(h1,{}),r.jsx(Y1,{}),r.jsx(d1,{}),r.jsx(c1,{}),r.jsx(l1,{}),r.jsx(s1,{}),r.jsx(K1,{})]})]}),r.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:r.jsx(S.Suspense,{fallback:r.jsx(X1,{}),children:r.jsx(pd,{})})}),r.jsx(m1,{})]}),s&&r.jsx(C1,{open:a,onClose:c,sessionId:s.sessionId,provider:s.provider,projects:s.projects,defaultProjectId:s.defaultProjectId,supportsAll:s.supportsAll,onSelect:l}),f.prompt&&r.jsx(z1,{open:f.isOpen,onClose:f.onClose,sessionId:f.prompt.sessionId,provider:f.prompt.provider,userCode:f.prompt.userCode,verificationUrl:f.prompt.verificationUrl,expiresAt:f.prompt.expiresAt})]})}const J1=kr("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Wa({className:n,variant:a,...s}){return r.jsx("div",{className:K(J1({variant:a}),n),...s})}function ek({version:n="5.0.0"}){return r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(px,{size:"lg",showText:!1}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("h1",{className:"text-2xl font-bold",children:"CCS Config"}),r.jsxs(Wa,{variant:"outline",className:"font-mono text-xs",children:["v",n]})]}),r.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Claude Code Switch Dashboard"})]})]})}const tk=100,Gg=["#3b3c36","#568203","#8d4557","#da9100","#3c6c82","#c96907"];function nk(n){return Gg[n%Gg.length]}function wx(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}function ak(n){const s=new Date().getTime()-n.getTime(),l=Math.floor(s/6e4);if(l<1)return"now";if(l<60)return`${l}m`;const c=Math.floor(l/60);return c<24?`${c}h`:`${Math.floor(c/24)}d`}function ik(n){const a=[];return n.forEach(s=>{const l=s.lastUsedAt?new Date(s.lastUsedAt):new Date,c=(f,h)=>{for(let m=0;m<f;m++){const p=Math.floor(Math.random()*24*60*60*1e3*(m/(f||1))),y=new Date(l.getTime()-p),C=Math.floor((Math.random()-.5)*10*60*1e3);y.setTime(y.getTime()+C);const x=new Date;y>x&&y.setTime(x.getTime()),a.push({id:`${s.id}-${h}-${m}`,timestamp:y,accountEmail:s.email,status:h,latencyMs:h==="success"?50+Math.floor(Math.random()*150):200+Math.floor(Math.random()*4800)})}};c(s.successCount,"success"),c(s.failureCount,"failed")}),a.sort((s,l)=>l.timestamp.getTime()-s.timestamp.getTime())}function ok({containerRef:n,svgRef:a,accounts:s}){if(!n.current||!a.current)return[];const l=n.current,f=a.current.getBoundingClientRect(),h=l.querySelector("[data-provider-node]");if(!h)return[];const m=h.getBoundingClientRect(),p=[];return s.forEach((y,C)=>{const x=l.querySelector(`[data-account-index="${C}"]`);if(!x)return;const v=x.getBoundingClientRect(),N=x.getAttribute("data-zone")||"left";let w,M,E,j;switch(N){case"right":w=v.left-f.left,M=v.top+v.height/2-f.top,E=m.right-f.left,j=m.top+m.height/2-f.top;break;case"top":w=v.left+v.width/2-f.left,M=v.bottom-f.top,E=m.left+m.width/2-f.left,j=m.top-f.top;break;case"bottom":w=v.left+v.width/2-f.left,M=v.top-f.top,E=m.left+m.width/2-f.left,j=m.bottom-f.top;break;default:w=v.right-f.left,M=v.top+v.height/2-f.top,E=m.left-f.left,j=m.top+m.height/2-f.top}let H,B,U,O;N==="top"||N==="bottom"?(H=w,B=M+(j-M)*.5,U=E,O=j-(j-M)*.5):(H=w+(E-w)*.5,B=M,U=E-(E-w)*.5,O=j),p.push(`M ${w} ${M} C ${H} ${B}, ${U} ${O}, ${E} ${j}`)}),p}function sk(n){const a=n.length;if(a<=2)return{leftAccounts:n,rightAccounts:[],topAccounts:[],bottomAccounts:[]};if(a<=4){const l=Math.ceil(a/2);return{leftAccounts:n.slice(0,l),rightAccounts:n.slice(l),topAccounts:[],bottomAccounts:[]}}if(a<=8){const l=Math.ceil(a/3);return{leftAccounts:n.slice(0,l),rightAccounts:n.slice(l,l*2),topAccounts:n.slice(l*2),bottomAccounts:[]}}const s=Math.ceil(a/4);return{leftAccounts:n.slice(0,s),rightAccounts:n.slice(s,s*2),topAccounts:n.slice(s*2,s*3),bottomAccounts:n.slice(s*3)}}function lk(n){return n>=9?"w-64":n>=5?"w-60":n>=3?"w-56":"w-52"}function rk({storageKey:n,onDrag:a}){const[s,l]=S.useState(null),c=S.useRef(null),f=S.useRef(!1),h=S.useCallback(()=>{try{const w=localStorage.getItem(n);if(w)return JSON.parse(w)}catch{}return{}},[n]),[m,p]=S.useState(()=>h());S.useEffect(()=>{Object.keys(m).length>0&&localStorage.setItem(n,JSON.stringify(m))},[m,n]);const y=S.useCallback(()=>{p({}),localStorage.removeItem(n)},[n]),C=S.useCallback((w,M)=>{M.preventDefault(),M.stopPropagation(),M.target.setPointerCapture(M.pointerId);const E=m[w]||{x:0,y:0};c.current={x:M.clientX,y:M.clientY,offsetX:E.x,offsetY:E.y},f.current=!1,l(w)},[m]),x=S.useCallback(w=>{if(!s||!c.current)return;const M=c.current,E=w.clientX-M.x,j=w.clientY-M.y;(Math.abs(E)>3||Math.abs(j)>3)&&(f.current=!0),p(H=>({...H,[s]:{x:M.offsetX+E,y:M.offsetY+j}})),a&&requestAnimationFrame(a)},[s,a]),v=S.useCallback(()=>{l(null),c.current=null},[]);return{dragOffsets:m,draggingId:s,didDragRef:f,handlePointerDown:C,handlePointerMove:x,handlePointerUp:v,getOffset:w=>m[w]||{x:0,y:0},resetPositions:y,hasCustomPositions:Object.keys(m).length>0}}function ck(n){let a=0,s=0;return Object.values(n).forEach(l=>{a=Math.min(a,l.y),s=Math.max(s,l.y)}),{paddingTop:Math.max(0,-a),paddingBottom:Math.max(0,s),extraHeight:Math.max(0,Math.abs(a),Math.abs(s))*2}}function uk(n){const[a,s]=S.useState(new Set),l=S.useRef({});return S.useEffect(()=>{const c=new Set,f={};if(n.forEach(h=>{const m=h.successCount+h.failureCount;f[h.id]=m;const p=l.current[h.id];p!==void 0&&m>p&&c.add(h.id)}),l.current=f,c.size>0){s(c);const h=setTimeout(()=>s(new Set),2e3);return()=>clearTimeout(h)}},[n]),a}function dk({events:n,privacyMode:a}){const{t:s}=_t();return n.length===0?r.jsx("div",{className:"h-full flex items-center justify-center rounded-xl bg-muted/20 dark:bg-zinc-900/40 border border-border/30 dark:border-white/[0.05]",children:r.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:s("flowViz.noRecentConnections")})}):r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3 px-2",children:[r.jsx(Ds,{className:"w-3.5 h-3.5 text-muted-foreground"}),r.jsx("span",{className:"text-[10px] text-muted-foreground font-medium uppercase tracking-wider",children:s("flowViz.connectionTimeline")})]}),r.jsx("div",{className:K("flex-1 rounded-xl p-4 overflow-y-auto","bg-muted/20 dark:bg-zinc-900/40 backdrop-blur-sm","border border-border/30 dark:border-white/[0.05]"),children:r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border/50 dark:bg-white/[0.08]"}),r.jsx("div",{className:"space-y-3",children:n.map(l=>{const c=l.status==="success"?Ft.success:l.status==="failed"?Ft.failed:Ft.degraded;return r.jsxs("div",{className:"relative flex items-start gap-3 pl-1",children:[r.jsx("div",{className:K("relative z-10 w-3.5 h-3.5 rounded-full flex-shrink-0 mt-0.5","ring-2 ring-background dark:ring-zinc-950"),style:{backgroundColor:c}}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("span",{className:K("text-[10px] font-mono text-foreground truncate",a&&ux),children:wx(l.accountEmail)}),r.jsx("span",{className:"text-[9px] text-muted-foreground font-mono flex-shrink-0",children:ak(l.timestamp)})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[r.jsx("span",{className:"text-[9px] font-medium uppercase",style:{color:c},children:l.status}),l.latencyMs&&r.jsxs("span",{className:"text-[9px] text-muted-foreground font-mono",children:[l.latencyMs,"ms"]})]})]})]},l.id)})})]})})]})}async function fk(){const n=await fetch("/api/cliproxy/stats");if(!n.ok){const a=await n.json();throw new Error(a.message||"Failed to fetch stats")}return n.json()}async function hk(){const n=await fetch("/api/cliproxy/status");if(!n.ok)throw new Error("Failed to fetch status");return n.json()}function mk(){return Tt({queryKey:["cliproxy-status"],queryFn:hk,refetchInterval:1e4,retry:1})}function pk(n=!0){return Tt({queryKey:["cliproxy-stats"],queryFn:fk,enabled:n,refetchInterval:5e3,retry:1,staleTime:3e3})}async function gk(){const n=await fetch("/api/cliproxy/error-logs");if(!n.ok){const s=await n.json();throw new Error(s.message||"Failed to fetch error logs")}return(await n.json()).files??[]}async function yk(n){const a=await fetch(`/api/cliproxy/error-logs/${encodeURIComponent(n)}`);if(!a.ok)throw new Error("Failed to fetch error log content");return a.text()}function xk(n=!0){return Tt({queryKey:["cliproxy-error-logs"],queryFn:gk,enabled:n,refetchInterval:3e4,retry:1,staleTime:1e4})}function bk(n){return Tt({queryKey:["cliproxy-error-log-content",n],queryFn:()=>n?yk(n):Promise.resolve(""),enabled:!!n,staleTime:6e4})}const Nx=["agy","codex","claude","gemini","ghcp"],vk={antigravity:"agy",anthropic:"claude","gemini-cli":"gemini",copilot:"ghcp","github-copilot":"ghcp"};function kx(n){const a=n.trim().toLowerCase();return a?Nx.includes(a)?a:vk[a]??null:null}async function Yg(n,a){const s=await fetch(`/api/cliproxy/quota/${n}/${encodeURIComponent(a)}`);if(!s.ok){let l="Failed to fetch quota";try{l=(await s.json()).message||l}catch{}throw new Error(l)}return s.json()}async function Sk(n){const a=await fetch(`/api/cliproxy/quota/codex/${encodeURIComponent(n)}`);if(!a.ok){let s="Failed to fetch Codex quota";try{s=(await a.json()).message||s}catch{}throw new Error(s)}return a.json()}async function Ck(n){const a=await fetch(`/api/cliproxy/quota/claude/${encodeURIComponent(n)}`);if(!a.ok){let s="Failed to fetch Claude quota";try{s=(await a.json()).message||s}catch{}throw new Error(s)}return a.json()}async function wk(n){const a=await fetch(`/api/cliproxy/quota/gemini/${encodeURIComponent(n)}`);if(!a.ok){let s="Failed to fetch Gemini quota";try{s=(await a.json()).message||s}catch{}throw new Error(s)}return a.json()}async function Nk(n){const a=await fetch(`/api/cliproxy/quota/ghcp/${encodeURIComponent(n)}`);if(!a.ok){let s="Failed to fetch GitHub Copilot quota";try{s=(await a.json()).message||s}catch{}throw new Error(s)}return a.json()}async function kk(n,a){const s=kx(n);if(!s)return Yg(n,a);switch(s){case"codex":return Sk(a);case"claude":return Ck(a);case"gemini":return wk(a);case"ghcp":return Nk(a);default:return Yg(n,a)}}function Ak(n,a,s=!0){const l=kx(n);return Tt({queryKey:["account-quota",l??n,a],queryFn:()=>kk(l??n,a),enabled:s&&!!l&&!!a,staleTime:6e4,refetchInterval:6e4,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1})}function Tk(n){if(!n)return null;const a=n.split(/[\s_-]+/g).map(s=>s.trim()).filter(s=>s.length>0).map(s=>s.charAt(0).toUpperCase()+s.slice(1));return a.length>0?a.join(" "):n}function jk(n,a){switch(n){case"five_hour":return"5h usage limit";case"seven_day":return"Weekly usage limit";case"seven_day_opus":return"Weekly usage (Opus)";case"seven_day_sonnet":return"Weekly usage (Sonnet)";case"seven_day_oauth_apps":return"Weekly usage (OAuth apps)";case"seven_day_cowork":return"Weekly usage (Cowork)";case"overage":return"Extra usage";default:return a}}function Mk({quota:n,resetTime:a}){if(!n)return r.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading quota..."});if(!n.success){const s=mx(n);return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium text-destructive",children:s?.label||n.error||"Failed to load quota"}),r.jsx("p",{className:"text-destructive/90",children:s?.summary||n.error}),s?.actionHint&&r.jsx("p",{className:"text-muted-foreground",children:s.actionHint}),s?.technicalDetail&&r.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:s.technicalDetail}),s?.rawDetail&&r.jsx("pre",{className:"whitespace-pre-wrap break-all rounded bg-muted/40 px-2 py-1 font-mono text-[10px] text-muted-foreground",children:s.rawDetail})]})}if(Hd(n)){const s=sN(n.models||[]),l=lN(s),c=["primary","gemini-3","gemini-2","other"];return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Model Quotas:"}),c.map((f,h)=>{const m=l.get(f);if(!m||m.length===0)return null;const p=c.slice(0,h).every(y=>!l.get(y)?.length);return r.jsxs("div",{children:[!p&&r.jsx("div",{className:"border-t border-border/40 my-1"}),m.map(y=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("span",{className:K("truncate",y.exhausted&&"text-red-500"),children:y.displayName}),r.jsxs("span",{className:K("font-mono",y.exhausted&&"text-red-500"),children:[y.percentage,"%"]})]},y.name))]},f)}),r.jsx(or,{resetTime:a})]})}if(Mr(n)){const{fiveHourWindow:s,weeklyWindow:l,codeReviewWindows:c,unknownWindows:f}=jr(n.windows),h=n.coreUsage?.fiveHour?.resetAt??s?.resetAt??null,m=n.coreUsage?.weekly?.resetAt??l?.resetAt??null,p=[s,l,...c,...f].filter(y=>!!y).filter((y,C,x)=>x.findIndex(v=>v.label===y.label&&v.resetAt===y.resetAt)===C);return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Rate Limits:"}),n.planType&&r.jsxs("p",{className:"text-muted-foreground",children:["Plan: ",n.planType]}),p.map((y,C)=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("span",{className:K(y.remainingPercent<20&&"text-red-500"),children:cN(y,p)}),r.jsxs("span",{className:"font-mono",children:[y.remainingPercent,"%"]})]},`${y.label}-${y.resetAt??"no-reset"}-${C}`)),r.jsx(Vg,{fiveHourResetTime:h,weeklyResetTime:m,fallbackResetTime:a})]})}if(Dr(n)){const s=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(m=>!!m).map(m=>({rateLimitType:m.rateLimitType,label:m.label,remainingPercent:m.remainingPercent,resetAt:m.resetAt,status:m.status})),l=n.windows.map(m=>({rateLimitType:m.rateLimitType,label:m.label,remainingPercent:m.remainingPercent,resetAt:m.resetAt,status:m.status})),c=[...s,...l].filter((m,p,y)=>y.findIndex(C=>C.rateLimitType===m.rateLimitType&&C.resetAt===m.resetAt&&C.status===m.status)===p),f=n.coreUsage?.fiveHour?.resetAt??n.windows.find(m=>m.rateLimitType==="five_hour")?.resetAt??null,h=n.coreUsage?.weekly?.resetAt??n.windows.find(m=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(m.rateLimitType))?.resetAt??null;return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Rate Limits:"}),c.map((m,p)=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("span",{className:K(m.remainingPercent<20&&"text-red-500"),children:jk(m.rateLimitType,m.label)}),r.jsxs("span",{className:"font-mono",children:[m.remainingPercent,"%"]})]},`${m.rateLimitType}-${m.resetAt??"no-reset"}-${m.status}-${p}`)),r.jsx(Vg,{fiveHourResetTime:f,weeklyResetTime:h,fallbackResetTime:a})]})}if(Bd(n))return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Buckets:"}),n.buckets.map(s=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsxs("span",{className:K(s.remainingPercent<20&&"text-red-500"),children:[s.label,s.tokenType?` (${s.tokenType})`:""]}),r.jsxs("span",{className:"font-mono",children:[s.remainingPercent,"%"]})]},s.id)),r.jsx(or,{resetTime:a})]});if(Kd(n)){const s=[{label:"Premium Interactions",snapshot:n.snapshots.premiumInteractions},{label:"Chat",snapshot:n.snapshots.chat},{label:"Completions",snapshot:n.snapshots.completions}],l=n.quotaResetDate??a,c=Tk(n.planType);return r.jsxs("div",{className:"text-xs space-y-1",children:[r.jsx("p",{className:"font-medium",children:"Quota Snapshots:"}),c&&r.jsxs("p",{className:"text-muted-foreground",children:["Plan: ",c]}),s.map(({label:f,snapshot:h})=>{const m=h.percentRemaining<20;return r.jsxs("div",{className:"space-y-0.5",children:[r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("span",{className:K(m&&"text-red-500"),children:f}),r.jsx("span",{className:K("font-mono",m&&"text-red-500"),children:h.unlimited?"Unlimited":`${hx(h.percentRemaining)}%`})]}),!h.unlimited&&r.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[h.remaining,"/",h.entitlement," remaining"]})]},f)}),r.jsx(or,{resetTime:l})]})}return null}function or({resetTime:n}){return n?r.jsxs("div",{className:"flex items-center gap-1.5 pt-1 border-t border-border/50",children:[r.jsx(Os,{className:"w-3 h-3 text-blue-400"}),r.jsxs("span",{className:"text-blue-400 font-medium",children:["Resets ",Sd(n)]})]}):null}function Vg({fiveHourResetTime:n,weeklyResetTime:a,fallbackResetTime:s}){const l=!!n||!!a;return!l&&!s?null:r.jsxs("div",{className:"pt-1 border-t border-border/50 space-y-1",children:[n&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Os,{className:"w-3 h-3 text-blue-400"}),r.jsxs("span",{className:"text-blue-400 font-medium",children:["5h resets ",Sd(n)]})]}),a&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Os,{className:"w-3 h-3 text-indigo-400"}),r.jsxs("span",{className:"text-indigo-400 font-medium",children:["Weekly resets ",Sd(a)]})]}),!l&&s&&r.jsx(or,{resetTime:s})]})}function Dk({success:n,failure:a,showDetails:s}){const l=n+a,c=l>0?n/l*100:100;return r.jsxs("div",{className:"mt-2 space-y-2",children:[r.jsxs("div",{className:"flex items-end justify-between px-0.5",children:[r.jsxs("div",{className:"flex flex-col",children:[r.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Success Rate"}),r.jsxs("span",{className:K("text-sm font-mono font-bold leading-none mt-0.5",c===100?"text-emerald-600 dark:text-emerald-400":c>=90?"text-amber-500":"text-red-500"),children:[Math.round(c),"%"]})]}),r.jsxs("div",{className:"flex flex-col items-end",children:[r.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Volume"}),r.jsx("span",{className:"text-xs font-mono font-medium text-foreground/80 leading-none mt-0.5",children:l.toLocaleString()})]})]}),r.jsxs("div",{className:K("grid grid-cols-2 gap-2 overflow-hidden transition-all duration-300 ease-in-out",s?"max-h-20 opacity-100 mt-2":"max-h-0 opacity-0 mt-0"),children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 rounded-md bg-emerald-500/5 dark:bg-emerald-500/10 border border-emerald-500/10",children:[r.jsx(Sr,{className:"w-2.5 h-2.5 text-emerald-600 dark:text-emerald-400"}),r.jsx("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400",children:n})]}),r.jsxs("div",{className:K("flex items-center gap-1.5 px-1.5 py-1 rounded-md border",a>0?"bg-red-500/5 dark:bg-red-500/10 border-red-500/20":"bg-muted/10 border-transparent opacity-40"),children:[r.jsx(Rd,{className:K("w-2.5 h-2.5",a>0?"text-red-500":"text-muted-foreground")}),r.jsx("span",{className:K("text-[10px] font-mono font-bold",a>0?"text-red-500":"text-muted-foreground"),children:a})]})]})]})}const Ek=["antigravity","anthropic","gemini-cli","copilot","github-copilot"],Ok={left:"border-l-2",right:"border-r-2",top:"border-t-2",bottom:"border-b-2"},Rk={left:"top-1/2 -right-1.5 -translate-y-1/2",right:"top-1/2 -left-1.5 -translate-y-1/2",top:"left-1/2 -bottom-1.5 -translate-x-1/2",bottom:"left-1/2 -top-1.5 -translate-x-1/2"};function Pk(n,a){switch(n){case"left":return{borderLeftColor:a};case"right":return{borderRightColor:a};case"top":return{borderTopColor:a};case"bottom":return{borderBottomColor:a}}}function Lk({account:n,zone:a,originalIndex:s,isHovered:l,isDragging:c,offset:f,showDetails:h,privacyMode:m,onMouseEnter:p,onMouseLeave:y,onPointerDown:C,onPointerMove:x,onPointerUp:v,onPauseToggle:N,isPausingAccount:w}){const{t:M}=_t(),E=Ok[a],j=Pk(a,n.color),H=Rk[a],B=n.provider.toLowerCase(),U=Nx.includes(B)||Ek.includes(B),O=B==="codex",k=B==="claude"||B==="anthropic",{data:z,isLoading:X}=Ak(B,n.id,U),W=bN(n.provider,z),Q=vN(n.provider,z),ae=O&&z&&Mr(z)?jr(z.windows):null,ee=[{label:"5h",value:ae?.fiveHourWindow?.remainingPercent??null},{label:"Wk",value:ae?.weeklyWindow?.remainingPercent??null}].filter(ne=>ne.value!==null),ye=k&&z&&Dr(z)?[{label:"5h",value:z.coreUsage?.fiveHour?.remainingPercent??z.windows.find(ne=>ne.rateLimitType==="five_hour")?.remainingPercent??null},{label:"Wk",value:z.coreUsage?.weekly?.remainingPercent??z.windows.find(ne=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(ne.rateLimitType))?.remainingPercent??null}].filter(ne=>ne.value!==null):[],fe=O?ee:k?ye:[],Ce=W!==null?hx(W):null,R=Ce!==null?Number(Ce):null,V=mx(z),ie=V?.label==="Reauth"?Ed:V?.tone==="warning"?qn:Cr,$=V?.tone==="warning"?"text-amber-600 dark:text-amber-400":V?.tone==="destructive"?"text-destructive":"text-muted-foreground/70",se=n.provider==="agy"&&n.tier&&n.tier!=="unknown"&&n.tier!=="free";return r.jsxs("div",{"data-account-index":s,"data-zone":a,onMouseEnter:p,onMouseLeave:y,onPointerDown:C,onPointerMove:x,onPointerUp:v,onPointerCancel:v,className:K("group/card relative rounded-lg p-3 w-44 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]",E,"select-none touch-none",l&&"bg-muted/50 dark:bg-zinc-800/60",c&&"cursor-grabbing shadow-xl scale-105 z-50",n.paused&&"opacity-60"),style:{...j,transform:`translate(${f.x}px, ${f.y}px)${c?" scale(1.05)":""}`},children:[r.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[r.jsx("span",{className:K("text-xs font-semibold text-foreground tracking-tight truncate",m&&ux),children:wx(n.email)}),se&&r.jsx("span",{className:K("text-[7px] font-bold uppercase tracking-wide px-1 py-px rounded shrink-0",n.tier==="ultra"?"bg-violet-500/15 text-violet-600 dark:bg-violet-500/25 dark:text-violet-300":"bg-yellow-500/15 text-yellow-700 dark:bg-yellow-500/20 dark:text-yellow-400"),children:n.tier})]}),N&&r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Xa,{asChild:!0,children:r.jsx(ft,{variant:"ghost",size:"icon",className:K("h-4 w-4 shrink-0","transition-all rounded-full",n.paused?"bg-amber-500/20 hover:bg-amber-500/30":"hover:bg-muted"),onClick:ne=>{ne.stopPropagation(),N(n.id,!n.paused)},disabled:w,children:w?r.jsx(Dn,{className:"w-2.5 h-2.5 animate-spin"}):n.paused?r.jsx(BS,{className:"w-2.5 h-2.5 text-amber-600 dark:text-amber-400"}):r.jsx(KS,{className:"w-2.5 h-2.5 text-muted-foreground/50 hover:text-foreground"})})}),r.jsx(Za,{side:"top",className:"text-xs",children:n.paused?M("accountCard.resumeAccount"):M("accountCard.pauseAccount")})]})}),r.jsx(wr,{className:"w-4 h-4 text-muted-foreground/40 shrink-0"})]}),r.jsx(Dk,{success:n.successCount,failure:n.failureCount,showDetails:h}),U&&r.jsx("div",{className:"mt-2 px-0.5",children:X?r.jsxs("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground",children:[r.jsx(Dn,{className:"w-2.5 h-2.5 animate-spin"}),r.jsx("span",{children:M("accountCard.quotaLoading")})]}):R!==null?r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Xa,{asChild:!0,children:r.jsxs("div",{className:"space-y-0.5 cursor-help",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:M("accountCard.quota")}),r.jsxs("span",{className:K("text-[10px] font-mono font-bold",R>50?"text-emerald-600 dark:text-emerald-400":R>20?"text-amber-500":"text-red-500"),children:[Ce,"%"]})]}),fe.length>0&&r.jsx("div",{className:"flex items-center justify-between text-[7px] text-muted-foreground/70",children:fe.map(ne=>r.jsxs("span",{children:[ne.label," ",ne.value,"%"]},ne.label))}),r.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:r.jsx("div",{className:K("h-full rounded-full transition-all",R>50?"bg-emerald-500":R>20?"bg-amber-500":"bg-red-500"),style:{width:`${R}%`}})})]})}),r.jsx(Za,{side:"top",className:"max-w-xs",children:r.jsx(Mk,{quota:z,resetTime:Q})})]})}):z?.success?r.jsx("div",{className:"text-[8px] text-muted-foreground/60",children:M("accountCard.quotaUnavailable")}):V?r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Xa,{asChild:!0,children:r.jsxs("div",{className:K("flex items-center gap-1 text-[8px]",$),children:[r.jsx(ie,{className:"w-2.5 h-2.5"}),r.jsx("span",{children:V.label})]})}),r.jsx(Za,{side:"top",className:"max-w-[220px]",children:r.jsxs("div",{className:"space-y-1 text-xs",children:[r.jsx("p",{children:V.summary}),V.actionHint&&r.jsx("p",{className:"text-muted-foreground",children:V.actionHint}),V.technicalDetail&&r.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:V.technicalDetail}),V.rawDetail&&r.jsx("pre",{className:"whitespace-pre-wrap break-all rounded bg-muted/40 px-2 py-1 font-mono text-[10px] text-muted-foreground",children:V.rawDetail})]})})]})}):null}),r.jsx("div",{className:K("absolute w-3 h-3 rounded-full transform z-20 transition-colors border","bg-muted dark:bg-zinc-800 border-border dark:border-zinc-600",H,l&&"bg-foreground dark:bg-white border-transparent")})]})}function ef({provider:n,className:a,size:s=18,withBackground:l=!1}){const c=n.toLowerCase(),f=M1(n),h=$d[c]||"#6b7280",m=l?Math.floor(s*.65):s,p=f?r.jsx("img",{src:f,alt:`${n} icon`,width:m,height:m,className:"shrink-0 object-contain"}):r.jsx("span",{className:"font-bold",style:{color:h,fontSize:m*.6},children:n.charAt(0).toUpperCase()});if(l)return r.jsx("div",{className:K("shrink-0 rounded-full bg-white border border-border flex items-center justify-center shadow-sm",a),style:{width:s,height:s},children:p});if(f)return r.jsx("img",{src:f,alt:`${n} icon`,width:s,height:s,className:K("shrink-0 rounded-sm object-contain",a)});const y=h;return r.jsx("div",{className:K("shrink-0 rounded-full flex items-center justify-center text-white font-bold",a),style:{width:s,height:s,backgroundColor:y,fontSize:s*.5},children:n.charAt(0).toUpperCase()})}function _k({providerData:n,providerColor:a,totalRequests:s,maxRequests:l,isDragging:c,offset:f,hoveredAccount:h,hasRightAccounts:m,hasTopAccounts:p,hasBottomAccounts:y,onPointerDown:C,onPointerMove:x,onPointerUp:v}){const{t:N}=_t(),{accounts:w}=n;return r.jsxs("div",{"data-provider-node":!0,onPointerDown:C,onPointerMove:x,onPointerUp:v,onPointerCancel:v,className:K("group relative w-full rounded-xl p-4 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border-2 border-border/50 dark:border-white/[0.08]",!c&&"animate-subtle-float animate-border-glow","select-none touch-none",h!==null&&"scale-[1.02]",c&&"cursor-grabbing shadow-2xl scale-105 z-50"),style:{"--glow-color":`${a}60`,borderColor:h!==null?`${a}80`:void 0,transform:`translate(${f.x}px, ${f.y}px)${c?" scale(1.05)":""}`},children:[r.jsx(wr,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),r.jsx("div",{className:"absolute inset-0 rounded-xl animate-glow-pulse pointer-events-none",style:{"--glow-color":`${a}30`}}),r.jsx("div",{className:"absolute top-1/2 -left-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),m&&r.jsx("div",{className:"absolute top-1/2 -right-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),p&&r.jsx("div",{className:"absolute left-1/2 -top-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),y&&r.jsx("div",{className:"absolute left-1/2 -bottom-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),r.jsxs("div",{className:"flex items-center gap-3 mb-4 relative z-10",children:[r.jsx("div",{className:"animate-icon-breathe",children:r.jsx(ef,{provider:n.provider,size:36,withBackground:!0})}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),r.jsx("p",{className:"text-[10px] text-muted-foreground font-medium uppercase",children:N("flowViz.provider")})]})]}),r.jsxs("div",{className:"space-y-2 relative z-10",children:[r.jsxs("div",{className:"flex justify-between items-center text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:N("flowViz.totalRequests")}),r.jsx("span",{className:"text-foreground font-mono",children:s.toLocaleString()})]}),r.jsxs("div",{className:"flex justify-between items-center text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:N("flowViz.accounts")}),r.jsx("span",{className:"text-foreground font-mono",children:w.length})]}),r.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full mt-2 overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,s/(l*w.length)*100)}%`,backgroundColor:a}})})]})]})}function zk({paths:n,accounts:a,maxRequests:s,hoveredAccount:l,pulsingAccounts:c}){return r.jsxs(r.Fragment,{children:[r.jsx("defs",{children:r.jsxs("filter",{id:"flow-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",filterUnits:"userSpaceOnUse",children:[r.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),r.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})}),n.map((f,h)=>{const m=a[h];if(!m)return null;const p=m.successCount+m.failureCount,y=Math.max(2,p/s*10),C=l===h,x=l!==null&&l!==h,v=c.has(m.id),N=nk(h);return r.jsxs("g",{children:[r.jsx("path",{d:f,fill:"none",stroke:N,strokeWidth:y,strokeOpacity:C?.8:x?.15:.4,strokeLinecap:"round",filter:C?"url(#flow-glow)":void 0,className:"transition-all duration-300"}),v&&r.jsxs(r.Fragment,{children:[r.jsx("path",{d:f,fill:"none",stroke:m.color,strokeWidth:y*2,strokeLinecap:"round",filter:"url(#flow-glow)",className:"animate-request-pulse"}),r.jsx("circle",{r:6,fill:m.color,filter:"url(#flow-glow)",style:{offsetPath:`path('${f}')`,offsetDistance:"0%",animation:"travel-dot 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards"}})]})]},h)})]})}function Uk({onBack:n,showDetails:a,onToggleDetails:s,hasCustomPositions:l,onResetPositions:c}){const{t:f}=_t();return r.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[n?r.jsxs("button",{onClick:n,className:"group flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md hover:bg-muted/50 border border-transparent hover:border-border/50",children:[r.jsx(yr,{className:"w-3.5 h-3.5 rotate-180 transition-transform group-hover:-translate-x-0.5"}),r.jsx("span",{children:f("flowViz.backToProviders")})]}):r.jsx("div",{}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:s,className:K("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",a?"bg-primary text-primary-foreground border-primary hover:bg-primary/90":"bg-background text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-muted/50"),children:[a?r.jsx(xr,{className:"w-3.5 h-3.5"}):r.jsx(br,{className:"w-3.5 h-3.5"}),r.jsx("span",{children:f(a?"flowViz.hideDetails":"flowViz.showDetails")})]}),l&&r.jsxs("button",{onClick:c,className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md border border-border/60 hover:border-border bg-background hover:bg-muted/50 shadow-sm",children:[r.jsx(qS,{className:"w-3.5 h-3.5"}),r.jsx("span",{children:f("flowViz.resetLayout")})]})]})]})}function Ik({providerData:n,onBack:a,onPauseToggle:s,isPausingAccount:l}){const c=S.useRef(null),f=S.useRef(null),[h,m]=S.useState(null),[p,y]=S.useState(!1),[C,x]=S.useState([]),{privacyMode:v}=_d(),{accounts:N}=n,w=Math.max(...N.map(J=>J.successCount+J.failureCount),1),M=N.reduce((J,ce)=>J+ce.successCount+ce.failureCount,0),E=S.useCallback(()=>{const J=ok({containerRef:c,svgRef:f,accounts:N});J.length>0&&x(J)},[N]),j=`ccs-flow-positions-${n.provider}`,{dragOffsets:H,draggingId:B,handlePointerDown:U,handlePointerMove:O,handlePointerUp:k,getOffset:z,resetPositions:X,hasCustomPositions:W}=rk({storageKey:j,onDrag:E}),Q=ck(H),ae=uk(N),ee=S.useMemo(()=>ik(N).slice(0,tk),[N]);S.useEffect(()=>{const J=setTimeout(E,50);return window.addEventListener("resize",E),()=>{clearTimeout(J),window.removeEventListener("resize",E)}},[E]),S.useEffect(()=>{const J=setTimeout(E,10);return()=>clearTimeout(J)},[H,E]),S.useEffect(()=>{const J=Date.now(),ce=350,te=()=>{E(),Date.now()-J<ce&&requestAnimationFrame(te)};requestAnimationFrame(te)},[p,E]);const ye=$d[n.provider.toLowerCase()]||"#6b7280",fe=S.useMemo(()=>sk(N),[N]),{leftAccounts:Ce,rightAccounts:R,topAccounts:V,bottomAccounts:ie}=fe,$=R.length>0,se=V.length>0,ne=ie.length>0,Ne=S.useMemo(()=>lk(N.length),[N.length]),F=(J,ce)=>J.map(te=>{const le=N.findIndex(xe=>xe.id===te.id);return r.jsx(Lk,{account:te,zone:ce,originalIndex:le,isHovered:h===le,isDragging:B===te.id,offset:z(te.id),showDetails:p,privacyMode:v,onMouseEnter:()=>m(le),onMouseLeave:()=>m(null),onPointerDown:xe=>U(te.id,xe),onPointerMove:O,onPointerUp:k,onPauseToggle:s,isPausingAccount:l},te.id)});return r.jsxs("div",{className:"flex flex-col",ref:c,children:[r.jsx(Uk,{onBack:a,showDetails:p,onToggleDetails:()=>y(!p),hasCustomPositions:W,onResetPositions:X}),r.jsxs("div",{className:"min-h-[320px] flex gap-4 px-4 py-6 self-stretch items-stretch transition-all duration-200",children:[r.jsxs("div",{className:"relative flex-1 flex flex-col items-stretch justify-center px-4",style:{paddingTop:`${24+Q.paddingTop}px`,paddingBottom:`${24+Q.paddingBottom}px`,minHeight:`${320+Q.extraHeight}px`},children:[r.jsx("svg",{ref:f,className:"absolute inset-0 w-full h-full pointer-events-none z-0 overflow-visible",children:r.jsx(zk,{paths:C,accounts:N,maxRequests:w,hoveredAccount:h,pulsingAccounts:ae})}),se&&r.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mb-8",children:F(V,"top")}),r.jsxs("div",{className:"flex items-center justify-between gap-8 flex-1",children:[r.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:F(Ce,"left")}),r.jsx("div",{className:K("z-10 flex items-center flex-shrink-0",Ne),children:r.jsx(_k,{providerData:n,providerColor:ye,totalRequests:M,maxRequests:w,isDragging:B==="provider",offset:z("provider"),hoveredAccount:h,hasRightAccounts:$,hasTopAccounts:se,hasBottomAccounts:ne,onPointerDown:J=>U("provider",J),onPointerMove:O,onPointerUp:k})}),$&&r.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:F(R,"right")})]}),ne&&r.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mt-8",children:F(ie,"bottom")})]}),r.jsx("div",{className:"w-56 flex-shrink-0 self-stretch relative",children:r.jsx("div",{className:"absolute inset-0",children:r.jsx(dk,{events:ee,privacyMode:v})})})]})]})}function Hk(n,a){const s=n+a;return s===0?100:Math.round(n/s*100)}function Bk(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}const Fg=["#1e6091","#2d8a6e","#d4a012","#c92a2d","#c45a1a","#6b9c4d","#3d5a73","#cc7614","#3a7371","#7c5fc4"];function Kk(){const{data:n,isLoading:a,error:s}=XN(),{data:l,isLoading:c,dataUpdatedAt:f}=pk(),[h,m]=S.useState("");S.useEffect(()=>{if(!f)return;const M=()=>{const j=Math.floor((Date.now()-f)/1e3);j<60?m(`${j}s ago`):m(`${Math.floor(j/60)}m ago`)};M();const E=setInterval(M,1e3);return()=>clearInterval(E)},[f]);const p=S.useMemo(()=>l?.accountStats?new Map(Object.entries(l.accountStats)):new Map,[l?.accountStats]),{accounts:y,totalSuccess:C,totalFailure:x,totalRequests:v,providerStats:N}=S.useMemo(()=>{if(!n?.authStatus)return{accounts:[],totalSuccess:0,totalFailure:0,totalRequests:0,providerStats:[]};const M=[],E=new Map;let j=0,H=0,B=0;n.authStatus.forEach(O=>{const k=O.provider;E.has(k)||E.set(k,{success:0,failure:0,accounts:[]});const z=E.get(k);z&&O.accounts?.forEach(X=>{const W=X.email||X.id,Q=p.get(W),ae=Q?.successCount??0,ee=Q?.failureCount??0;j+=ae,H+=ee,z.success+=ae,z.failure+=ee;const ye={id:X.id,email:X.email||X.id,provider:O.provider,displayName:O.displayName,isDefault:X.isDefault,successCount:ae,failureCount:ee,lastUsedAt:Q?.lastUsedAt??X.lastUsedAt,color:Fg[B%Fg.length],projectId:X.projectId,paused:X.paused,tier:X.tier};M.push(ye),z.accounts.push(ye),B++})});const U=[];return E.forEach((O,k)=>{O.accounts.length!==0&&U.push({provider:k,displayName:Xd(k),totalRequests:O.success+O.failure,successCount:O.success,failureCount:O.failure,accountCount:O.accounts.length,accounts:O.accounts})}),U.sort((O,k)=>k.totalRequests-O.totalRequests),{accounts:M,totalSuccess:j,totalFailure:H,totalRequests:j+H,providerStats:U}},[n?.authStatus,p]),w=v>0?Math.round(C/v*100):100;return{accounts:y,totalSuccess:C,totalFailure:x,totalRequests:v,providerStats:N,overallSuccessRate:w,isLoading:a||c,error:s??null,timeSinceUpdate:h}}function qk(){return r.jsxs("div",{className:"relative flex items-center justify-center w-5 h-5",children:[r.jsx("div",{className:"absolute w-4 h-4 rounded-full animate-ping opacity-20",style:{backgroundColor:Ft.success}}),r.jsx("div",{className:"absolute w-3 h-3 rounded-full animate-pulse opacity-40",style:{backgroundColor:Ft.success}}),r.jsx("div",{className:"relative w-2 h-2 rounded-full z-10",style:{backgroundColor:Ft.success}})]})}function Gk({success:n,failure:a}){return n===0&&a===0?r.jsx("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:"no activity"}):r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"flex items-center gap-0.5",children:[r.jsx(Sr,{className:"w-3 h-3 text-emerald-700 dark:text-emerald-500"}),r.jsx("span",{className:"text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-500",children:n.toLocaleString()})]}),a>0&&r.jsxs("div",{className:"flex items-center gap-0.5",children:[r.jsx(Rd,{className:"w-3 h-3 text-red-700 dark:text-red-500"}),r.jsx("span",{className:"text-[10px] font-mono font-medium text-red-700 dark:text-red-500",children:a.toLocaleString()})]})]})}function Yk({stats:n,isHovered:a,privacyMode:s,onSelect:l,onMouseEnter:c,onMouseLeave:f}){const h=Hk(n.successCount,n.failureCount),m=$d[n.provider.toLowerCase()]||"#6b7280";return r.jsxs("button",{onClick:l,onMouseEnter:c,onMouseLeave:f,className:K("group relative rounded-xl p-4 text-left transition-all duration-300","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]","hover:border-opacity-50 hover:scale-[1.02] hover:shadow-lg",a&&"ring-1"),style:{borderColor:a?m:void 0,"--ring-color":m},children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx(ef,{provider:n.provider,size:36,withBackground:!0}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),r.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[n.accountCount," account",n.accountCount!==1?"s":""]})]}),r.jsx(yr,{className:K("w-4 h-4 ml-auto text-muted-foreground transition-all",a?"opacity-100 translate-x-0":"opacity-0 -translate-x-2")})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex justify-between items-center text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:"Stats"}),r.jsx(Gk,{success:n.successCount,failure:n.failureCount})]}),r.jsxs("div",{className:"flex justify-between text-xs",children:[r.jsx("span",{className:"text-muted-foreground",children:"Success Rate"}),r.jsxs("span",{className:"font-mono font-semibold",style:{color:h===100?Ft.success:h>=95?Ft.degraded:Ft.failed},children:[h,"%"]})]}),r.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${h}%`,backgroundColor:m}})})]}),r.jsxs("div",{className:"flex gap-1 mt-3 items-center",children:[n.accounts.slice(0,5).map(p=>{const y=n.provider==="agy"&&!p.projectId;return r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:K("w-2 h-2 rounded-full",p.paused&&"opacity-50"),style:{backgroundColor:p.color},title:s?"••••••":Bk(p.email)}),y&&r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Xa,{asChild:!0,children:r.jsx(qn,{className:"absolute -top-1 -right-1 w-2.5 h-2.5 text-amber-500","aria-label":"Missing Project ID"})}),r.jsx(Za,{side:"top",className:"text-xs",children:"Missing Project ID - re-add account to fix"})]})})]},p.id)}),n.accounts.length>5&&r.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",n.accounts.length-5]})]})]})}function er({icon:n,label:a,value:s,color:l}){return r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-card/50 dark:bg-zinc-900/50 border border-border/50 dark:border-white/[0.06]",children:[r.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center",style:{backgroundColor:l?`${l}15`:"var(--muted)",color:l||"var(--muted-foreground)"},children:n}),r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:a}),r.jsx("div",{className:"text-lg font-semibold font-mono leading-tight",style:{color:l||"var(--foreground)"},children:s})]})]})}const nd="auth-monitor-selected-provider";function Vk(){const{t:n}=_t(),{accounts:a,totalSuccess:s,totalFailure:l,totalRequests:c,providerStats:f,overallSuccessRate:h,isLoading:m,error:p,timeSinceUpdate:y}=Kk(),{privacyMode:C}=_d(),[x,v]=S.useState(()=>typeof window<"u"?localStorage.getItem(nd):null),N=O=>{v(O),O?localStorage.setItem(nd,O):localStorage.removeItem(nd)},w=S.useMemo(()=>x&&f.some(O=>O.provider===x)?x:null,[x,f]),[M,E]=S.useState(null),j=ZN(),H=JN(),B=w?f.find(O=>O.provider===w):null,U=(O,k)=>{!w||j.isPending||H.isPending||(k?j.mutate({provider:w,accountId:O}):H.mutate({provider:w,accountId:O}))};return m?r.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[r.jsx(Ge,{className:"h-4 w-32"}),r.jsx(Ge,{className:"h-4 w-20"})]}),r.jsxs("div",{className:"p-4 space-y-4",children:[r.jsx("div",{className:"flex gap-3",children:[1,2,3,4].map(O=>r.jsx(Ge,{className:"h-16 flex-1 rounded-lg"},O))}),r.jsx(Ge,{className:"h-48 w-full rounded-lg"})]})]}):p||a.length===0?null:r.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border bg-gradient-to-r from-emerald-500/5 via-transparent to-transparent dark:from-emerald-500/10",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(qk,{}),r.jsx("span",{className:"text-xs font-semibold tracking-tight text-foreground",children:"LIVE"}),r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Account Monitor"})]}),r.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(GS,{className:"w-3 h-3 animate-pulse"}),r.jsxs("span",{children:["Updated ",y||"now"]})]}),r.jsx("span",{className:"text-muted-foreground/50",children:"|"}),r.jsx("span",{children:n("authMonitor.accountsCount",{count:a.length})}),r.jsxs("span",{className:"font-mono",children:[c.toLocaleString()," req"]})]})]}),r.jsxs("div",{className:"grid grid-cols-4 gap-3 p-4 border-b border-border bg-muted/20 dark:bg-zinc-900/30",children:[r.jsx(er,{icon:r.jsx(Ds,{className:"w-4 h-4"}),label:n("authMonitor.accounts"),value:a.length,color:"var(--accent)"}),r.jsx(er,{icon:r.jsx(Sr,{className:"w-4 h-4"}),label:n("authMonitor.success"),value:s.toLocaleString(),color:Ft.success}),r.jsx(er,{icon:r.jsx(Rd,{className:"w-4 h-4"}),label:n("authMonitor.failed"),value:l.toLocaleString(),color:l>0?Ft.failed:void 0}),r.jsx(er,{icon:r.jsx(Ds,{className:"w-4 h-4"}),label:n("authMonitor.successRate"),value:`${h}%`,color:h===100?Ft.success:h>=95?Ft.degraded:Ft.failed})]}),r.jsx("div",{className:"relative overflow-hidden",children:B?r.jsx(Ik,{providerData:B,onBack:()=>N(null),onPauseToggle:U,isPausingAccount:j.isPending||H.isPending}):r.jsxs("div",{className:"p-6",children:[r.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-widest mb-4",children:"Request Distribution by Provider"}),r.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:f.map(O=>r.jsx(Yk,{stats:O,isHovered:M===O.provider,privacyMode:C,onSelect:()=>N(O.provider),onMouseEnter:()=>E(O.provider),onMouseLeave:()=>E(null)},O.provider))})]})})]})}const Er=S.createContext(null);Er.displayName="PanelGroupContext";const dt={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},tf=10,wi=S.useLayoutEffect,Qg=xS.useId,Fk=typeof Qg=="function"?Qg:()=>null;let Qk=0;function nf(n=null){const a=Fk(),s=S.useRef(n||a||null);return s.current===null&&(s.current=""+Qk++),n??s.current}function Ax({children:n,className:a="",collapsedSize:s,collapsible:l,defaultSize:c,forwardedRef:f,id:h,maxSize:m,minSize:p,onCollapse:y,onExpand:C,onResize:x,order:v,style:N,tagName:w="div",...M}){const E=S.useContext(Er);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:j,expandPanel:H,getPanelSize:B,getPanelStyle:U,groupId:O,isPanelCollapsed:k,reevaluatePanelConstraints:z,registerPanel:X,resizePanel:W,unregisterPanel:Q}=E,ae=nf(h),ee=S.useRef({callbacks:{onCollapse:y,onExpand:C,onResize:x},constraints:{collapsedSize:s,collapsible:l,defaultSize:c,maxSize:m,minSize:p},id:ae,idIsFromProps:h!==void 0,order:v});S.useRef({didLogMissingDefaultSizeWarning:!1}),wi(()=>{const{callbacks:fe,constraints:Ce}=ee.current,R={...Ce};ee.current.id=ae,ee.current.idIsFromProps=h!==void 0,ee.current.order=v,fe.onCollapse=y,fe.onExpand=C,fe.onResize=x,Ce.collapsedSize=s,Ce.collapsible=l,Ce.defaultSize=c,Ce.maxSize=m,Ce.minSize=p,(R.collapsedSize!==Ce.collapsedSize||R.collapsible!==Ce.collapsible||R.maxSize!==Ce.maxSize||R.minSize!==Ce.minSize)&&z(ee.current,R)}),wi(()=>{const fe=ee.current;return X(fe),()=>{Q(fe)}},[v,ae,X,Q]),S.useImperativeHandle(f,()=>({collapse:()=>{j(ee.current)},expand:fe=>{H(ee.current,fe)},getId(){return ae},getSize(){return B(ee.current)},isCollapsed(){return k(ee.current)},isExpanded(){return!k(ee.current)},resize:fe=>{W(ee.current,fe)}}),[j,H,B,k,ae,W]);const ye=U(ee.current,c);return S.createElement(w,{...M,children:n,className:a,id:ae,style:{...ye,...N},[dt.groupId]:O,[dt.panel]:"",[dt.panelCollapsible]:l||void 0,[dt.panelId]:ae,[dt.panelSize]:parseFloat(""+ye.flexGrow).toFixed(1)})}const Ps=S.forwardRef((n,a)=>S.createElement(Ax,{...n,forwardedRef:a}));Ax.displayName="Panel";Ps.displayName="forwardRef(Panel)";let wd=null,sr=-1,Fa=null;function Wk(n,a,s){const l=(a&Ex)!==0,c=(a&Ox)!==0,f=(a&Rx)!==0,h=(a&Px)!==0;if(a){if(l)return f?"se-resize":h?"ne-resize":"e-resize";if(c)return f?"sw-resize":h?"nw-resize":"w-resize";if(f)return"s-resize";if(h)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function $k(){Fa!==null&&(document.head.removeChild(Fa),wd=null,Fa=null,sr=-1)}function ad(n,a,s){var l,c;const f=Wk(n,a);if(wd!==f){if(wd=f,Fa===null&&(Fa=document.createElement("style"),document.head.appendChild(Fa)),sr>=0){var h;(h=Fa.sheet)===null||h===void 0||h.removeRule(sr)}sr=(l=(c=Fa.sheet)===null||c===void 0?void 0:c.insertRule(`*{cursor: ${f} !important;}`))!==null&&l!==void 0?l:-1}}function Tx(n){return n.type==="keydown"}function jx(n){return n.type.startsWith("pointer")}function Mx(n){return n.type.startsWith("mouse")}function Or(n){if(jx(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Mx(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Xk(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Zk(n,a,s){return n.x<a.x+a.width&&n.x+n.width>a.x&&n.y<a.y+a.height&&n.y+n.height>a.y}function Jk(n,a){if(n===a)throw new Error("Cannot compare node with itself");const s={a:Xg(n),b:Xg(a)};let l;for(;s.a.at(-1)===s.b.at(-1);)n=s.a.pop(),a=s.b.pop(),l=n;Re(l,"Stacking order can only be calculated for elements with a common ancestor");const c={a:$g(Wg(s.a)),b:$g(Wg(s.b))};if(c.a===c.b){const f=l.childNodes,h={a:s.a.at(-1),b:s.b.at(-1)};let m=f.length;for(;m--;){const p=f[m];if(p===h.a)return 1;if(p===h.b)return-1}}return Math.sign(c.a-c.b)}const eA=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function tA(n){var a;const s=getComputedStyle((a=Dx(n))!==null&&a!==void 0?a:n).display;return s==="flex"||s==="inline-flex"}function nA(n){const a=getComputedStyle(n);return!!(a.position==="fixed"||a.zIndex!=="auto"&&(a.position!=="static"||tA(n))||+a.opacity<1||"transform"in a&&a.transform!=="none"||"webkitTransform"in a&&a.webkitTransform!=="none"||"mixBlendMode"in a&&a.mixBlendMode!=="normal"||"filter"in a&&a.filter!=="none"||"webkitFilter"in a&&a.webkitFilter!=="none"||"isolation"in a&&a.isolation==="isolate"||eA.test(a.willChange)||a.webkitOverflowScrolling==="touch")}function Wg(n){let a=n.length;for(;a--;){const s=n[a];if(Re(s,"Missing node"),nA(s))return s}return null}function $g(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Xg(n){const a=[];for(;n;)a.push(n),n=Dx(n);return a}function Dx(n){const{parentNode:a}=n;return a&&a instanceof ShadowRoot?a.host:a}const Ex=1,Ox=2,Rx=4,Px=8,aA=Xk()==="coarse";let Mn=[],yo=!1,Qa=new Map,Rr=new Map;const Ls=new Set;function iA(n,a,s,l,c){var f;const{ownerDocument:h}=a,m={direction:s,element:a,hitAreaMargins:l,setResizeHandlerState:c},p=(f=Qa.get(h))!==null&&f!==void 0?f:0;return Qa.set(h,p+1),Ls.add(m),fr(),function(){var C;Rr.delete(n),Ls.delete(m);const x=(C=Qa.get(h))!==null&&C!==void 0?C:1;if(Qa.set(h,x-1),fr(),x===1&&Qa.delete(h),Mn.includes(m)){const v=Mn.indexOf(m);v>=0&&Mn.splice(v,1),Pr(),c("up",!0,null)}}}function oA(n){const{target:a}=n,{x:s,y:l}=Or(n);yo=!0,af({target:a,x:s,y:l}),fr(),Mn.length>0&&(hr("down",n),Pr(),n.preventDefault(),Lx(a)||n.stopImmediatePropagation())}function id(n){const{x:a,y:s}=Or(n);if(yo&&n.type!=="pointerleave"&&n.buttons===0&&(yo=!1,hr("up",n)),!yo){const{target:l}=n;af({target:l,x:a,y:s})}hr("move",n),Pr(),Mn.length>0&&n.preventDefault()}function od(n){const{target:a}=n,{x:s,y:l}=Or(n);Rr.clear(),yo=!1,Mn.length>0&&(n.preventDefault(),Lx(a)||n.stopImmediatePropagation()),hr("up",n),af({target:a,x:s,y:l}),Pr(),fr()}function Lx(n){let a=n;for(;a;){if(a.hasAttribute(dt.resizeHandle))return!0;a=a.parentElement}return!1}function af({target:n,x:a,y:s}){Mn.splice(0);let l=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(l=n),Ls.forEach(c=>{const{element:f,hitAreaMargins:h}=c,m=f.getBoundingClientRect(),{bottom:p,left:y,right:C,top:x}=m,v=aA?h.coarse:h.fine;if(a>=y-v&&a<=C+v&&s>=x-v&&s<=p+v){if(l!==null&&document.contains(l)&&f!==l&&!f.contains(l)&&!l.contains(f)&&Jk(l,f)>0){let w=l,M=!1;for(;w&&!w.contains(f);){if(Zk(w.getBoundingClientRect(),m)){M=!0;break}w=w.parentElement}if(M)return}Mn.push(c)}})}function sd(n,a){Rr.set(n,a)}function Pr(){let n=!1,a=!1;Mn.forEach(l=>{const{direction:c}=l;c==="horizontal"?n=!0:a=!0});let s=0;Rr.forEach(l=>{s|=l}),n&&a?ad("intersection",s):n?ad("horizontal",s):a?ad("vertical",s):$k()}let ld;function fr(){var n;(n=ld)===null||n===void 0||n.abort(),ld=new AbortController;const a={capture:!0,signal:ld.signal};Ls.size&&(yo?(Mn.length>0&&Qa.forEach((s,l)=>{const{body:c}=l;s>0&&(c.addEventListener("contextmenu",od,a),c.addEventListener("pointerleave",id,a),c.addEventListener("pointermove",id,a))}),Qa.forEach((s,l)=>{const{body:c}=l;c.addEventListener("pointerup",od,a),c.addEventListener("pointercancel",od,a)})):Qa.forEach((s,l)=>{const{body:c}=l;s>0&&(c.addEventListener("pointerdown",oA,a),c.addEventListener("pointermove",id,a))}))}function hr(n,a){Ls.forEach(s=>{const{setResizeHandlerState:l}=s,c=Mn.includes(s);l(n,c,a)})}function sA(){const[n,a]=S.useState(0);return S.useCallback(()=>a(s=>s+1),[])}function Re(n,a){if(!n)throw console.error(a),Error(a)}function Ai(n,a,s=tf){return n.toFixed(s)===a.toFixed(s)?0:n>a?1:-1}function ga(n,a,s=tf){return Ai(n,a,s)===0}function rn(n,a,s){return Ai(n,a,s)===0}function lA(n,a,s){if(n.length!==a.length)return!1;for(let l=0;l<n.length;l++){const c=n[l],f=a[l];if(!rn(c,f,s))return!1}return!0}function go({panelConstraints:n,panelIndex:a,size:s}){const l=n[a];Re(l!=null,`Panel constraints not found for index ${a}`);let{collapsedSize:c=0,collapsible:f,maxSize:h=100,minSize:m=0}=l;if(Ai(s,m)<0)if(f){const p=(c+m)/2;Ai(s,p)<0?s=c:s=m}else s=m;return s=Math.min(h,s),s=parseFloat(s.toFixed(tf)),s}function Ns({delta:n,initialLayout:a,panelConstraints:s,pivotIndices:l,prevLayout:c,trigger:f}){if(rn(n,0))return a;const h=[...a],[m,p]=l;Re(m!=null,"Invalid first pivot index"),Re(p!=null,"Invalid second pivot index");let y=0;if(f==="keyboard"){{const x=n<0?p:m,v=s[x];Re(v,`Panel constraints not found for index ${x}`);const{collapsedSize:N=0,collapsible:w,minSize:M=0}=v;if(w){const E=a[x];if(Re(E!=null,`Previous layout not found for panel index ${x}`),rn(E,N)){const j=M-E;Ai(j,Math.abs(n))>0&&(n=n<0?0-j:j)}}}{const x=n<0?m:p,v=s[x];Re(v,`No panel constraints found for index ${x}`);const{collapsedSize:N=0,collapsible:w,minSize:M=0}=v;if(w){const E=a[x];if(Re(E!=null,`Previous layout not found for panel index ${x}`),rn(E,M)){const j=E-N;Ai(j,Math.abs(n))>0&&(n=n<0?0-j:j)}}}}{const x=n<0?1:-1;let v=n<0?p:m,N=0;for(;;){const M=a[v];Re(M!=null,`Previous layout not found for panel index ${v}`);const j=go({panelConstraints:s,panelIndex:v,size:100})-M;if(N+=j,v+=x,v<0||v>=s.length)break}const w=Math.min(Math.abs(n),Math.abs(N));n=n<0?0-w:w}{let v=n<0?m:p;for(;v>=0&&v<s.length;){const N=Math.abs(n)-Math.abs(y),w=a[v];Re(w!=null,`Previous layout not found for panel index ${v}`);const M=w-N,E=go({panelConstraints:s,panelIndex:v,size:M});if(!rn(w,E)&&(y+=w-E,h[v]=E,y.toFixed(3).localeCompare(Math.abs(n).toFixed(3),void 0,{numeric:!0})>=0))break;n<0?v--:v++}}if(lA(c,h))return c;{const x=n<0?p:m,v=a[x];Re(v!=null,`Previous layout not found for panel index ${x}`);const N=v+y,w=go({panelConstraints:s,panelIndex:x,size:N});if(h[x]=w,!rn(w,N)){let M=N-w,j=n<0?p:m;for(;j>=0&&j<s.length;){const H=h[j];Re(H!=null,`Previous layout not found for panel index ${j}`);const B=H+M,U=go({panelConstraints:s,panelIndex:j,size:B});if(rn(H,U)||(M-=U-H,h[j]=U),rn(M,0))break;n>0?j--:j++}}}const C=h.reduce((x,v)=>v+x,0);return rn(C,100)?h:c}function rA({layout:n,panelsArray:a,pivotIndices:s}){let l=0,c=100,f=0,h=0;const m=s[0];Re(m!=null,"No pivot index found"),a.forEach((x,v)=>{const{constraints:N}=x,{maxSize:w=100,minSize:M=0}=N;v===m?(l=M,c=w):(f+=M,h+=w)});const p=Math.min(c,100-f),y=Math.max(l,100-h),C=n[m];return{valueMax:p,valueMin:y,valueNow:C}}function _s(n,a=document){return Array.from(a.querySelectorAll(`[${dt.resizeHandleId}][data-panel-group-id="${n}"]`))}function _x(n,a,s=document){const c=_s(n,s).findIndex(f=>f.getAttribute(dt.resizeHandleId)===a);return c??null}function zx(n,a,s){const l=_x(n,a,s);return l!=null?[l,l+1]:[-1,-1]}function cA(n){return n instanceof HTMLElement?!0:typeof n=="object"&&n!==null&&"tagName"in n&&"getAttribute"in n}function Ux(n,a=document){if(cA(a)&&a.dataset.panelGroupId==n)return a;const s=a.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function Lr(n,a=document){const s=a.querySelector(`[${dt.resizeHandleId}="${n}"]`);return s||null}function uA(n,a,s,l=document){var c,f,h,m;const p=Lr(a,l),y=_s(n,l),C=p?y.indexOf(p):-1,x=(c=(f=s[C])===null||f===void 0?void 0:f.id)!==null&&c!==void 0?c:null,v=(h=(m=s[C+1])===null||m===void 0?void 0:m.id)!==null&&h!==void 0?h:null;return[x,v]}function dA({committedValuesRef:n,eagerValuesRef:a,groupId:s,layout:l,panelDataArray:c,panelGroupElement:f,setLayout:h}){S.useRef({didWarnAboutMissingResizeHandle:!1}),wi(()=>{if(!f)return;const m=_s(s,f);for(let p=0;p<c.length-1;p++){const{valueMax:y,valueMin:C,valueNow:x}=rA({layout:l,panelsArray:c,pivotIndices:[p,p+1]}),v=m[p];if(v!=null){const N=c[p];Re(N,`No panel data found for index "${p}"`),v.setAttribute("aria-controls",N.id),v.setAttribute("aria-valuemax",""+Math.round(y)),v.setAttribute("aria-valuemin",""+Math.round(C)),v.setAttribute("aria-valuenow",x!=null?""+Math.round(x):"")}}return()=>{m.forEach((p,y)=>{p.removeAttribute("aria-controls"),p.removeAttribute("aria-valuemax"),p.removeAttribute("aria-valuemin"),p.removeAttribute("aria-valuenow")})}},[s,l,c,f]),S.useEffect(()=>{if(!f)return;const m=a.current;Re(m,"Eager values not found");const{panelDataArray:p}=m,y=Ux(s,f);Re(y!=null,`No group found for id "${s}"`);const C=_s(s,f);Re(C,`No resize handles found for group id "${s}"`);const x=C.map(v=>{const N=v.getAttribute(dt.resizeHandleId);Re(N,"Resize handle element has no handle id attribute");const[w,M]=uA(s,N,p,f);if(w==null||M==null)return()=>{};const E=j=>{if(!j.defaultPrevented)switch(j.key){case"Enter":{j.preventDefault();const H=p.findIndex(B=>B.id===w);if(H>=0){const B=p[H];Re(B,`No panel data found for index ${H}`);const U=l[H],{collapsedSize:O=0,collapsible:k,minSize:z=0}=B.constraints;if(U!=null&&k){const X=Ns({delta:rn(U,O)?z-O:O-U,initialLayout:l,panelConstraints:p.map(W=>W.constraints),pivotIndices:zx(s,N,f),prevLayout:l,trigger:"keyboard"});l!==X&&h(X)}}break}}};return v.addEventListener("keydown",E),()=>{v.removeEventListener("keydown",E)}});return()=>{x.forEach(v=>v())}},[f,n,a,s,l,c,h])}function Zg(n,a){if(n.length!==a.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==a[s])return!1;return!0}function Ix(n,a){const s=n==="horizontal",{x:l,y:c}=Or(a);return s?l:c}function fA(n,a,s,l,c){const f=s==="horizontal",h=Lr(a,c);Re(h,`No resize handle element found for id "${a}"`);const m=h.getAttribute(dt.groupId);Re(m,"Resize handle element has no group id attribute");let{initialCursorPosition:p}=l;const y=Ix(s,n),C=Ux(m,c);Re(C,`No group element found for id "${m}"`);const x=C.getBoundingClientRect(),v=f?x.width:x.height;return(y-p)/v*100}function hA(n,a,s,l,c,f){if(Tx(n)){const h=s==="horizontal";let m=0;n.shiftKey?m=100:c!=null?m=c:m=10;let p=0;switch(n.key){case"ArrowDown":p=h?0:m;break;case"ArrowLeft":p=h?-m:0;break;case"ArrowRight":p=h?m:0;break;case"ArrowUp":p=h?0:-m;break;case"End":p=100;break;case"Home":p=-100;break}return p}else return l==null?0:fA(n,a,s,l,f)}function mA({panelDataArray:n}){const a=Array(n.length),s=n.map(f=>f.constraints);let l=0,c=100;for(let f=0;f<n.length;f++){const h=s[f];Re(h,`Panel constraints not found for index ${f}`);const{defaultSize:m}=h;m!=null&&(l++,a[f]=m,c-=m)}for(let f=0;f<n.length;f++){const h=s[f];Re(h,`Panel constraints not found for index ${f}`);const{defaultSize:m}=h;if(m!=null)continue;const p=n.length-l,y=c/p;l++,a[f]=y,c-=y}return a}function mo(n,a,s){a.forEach((l,c)=>{const f=n[c];Re(f,`Panel data not found for index ${c}`);const{callbacks:h,constraints:m,id:p}=f,{collapsedSize:y=0,collapsible:C}=m,x=s[p];if(x==null||l!==x){s[p]=l;const{onCollapse:v,onExpand:N,onResize:w}=h;w&&w(l,x),C&&(v||N)&&(N&&(x==null||ga(x,y))&&!ga(l,y)&&N(),v&&(x==null||!ga(x,y))&&ga(l,y)&&v())}})}function tr(n,a){if(n.length!==a.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!=a[s])return!1;return!0}function pA({defaultSize:n,dragState:a,layout:s,panelData:l,panelIndex:c,precision:f=3}){const h=s[c];let m;return h==null?m=n!=null?n.toFixed(f):"1":l.length===1?m="1":m=h.toFixed(f),{flexBasis:0,flexGrow:m,flexShrink:1,overflow:"hidden",pointerEvents:a!==null?"none":void 0}}function gA(n,a=10){let s=null;return(...c)=>{s!==null&&clearTimeout(s),s=setTimeout(()=>{n(...c)},a)}}function Jg(n){try{if(typeof localStorage<"u")n.getItem=a=>localStorage.getItem(a),n.setItem=(a,s)=>{localStorage.setItem(a,s)};else throw new Error("localStorage not supported in this environment")}catch(a){console.error(a),n.getItem=()=>null,n.setItem=()=>{}}}function Hx(n){return`react-resizable-panels:${n}`}function Bx(n){return n.map(a=>{const{constraints:s,id:l,idIsFromProps:c,order:f}=a;return c?l:f?`${f}:${JSON.stringify(s)}`:JSON.stringify(s)}).sort((a,s)=>a.localeCompare(s)).join(",")}function Kx(n,a){try{const s=Hx(n),l=a.getItem(s);if(l){const c=JSON.parse(l);if(typeof c=="object"&&c!=null)return c}}catch{}return null}function yA(n,a,s){var l,c;const f=(l=Kx(n,s))!==null&&l!==void 0?l:{},h=Bx(a);return(c=f[h])!==null&&c!==void 0?c:null}function xA(n,a,s,l,c){var f;const h=Hx(n),m=Bx(a),p=(f=Kx(n,c))!==null&&f!==void 0?f:{};p[m]={expandToSizes:Object.fromEntries(s.entries()),layout:l};try{c.setItem(h,JSON.stringify(p))}catch(y){console.error(y)}}function ey({layout:n,panelConstraints:a}){const s=[...n],l=s.reduce((f,h)=>f+h,0);if(s.length!==a.length)throw Error(`Invalid ${a.length} panel layout: ${s.map(f=>`${f}%`).join(", ")}`);if(!rn(l,100)&&s.length>0)for(let f=0;f<a.length;f++){const h=s[f];Re(h!=null,`No layout data found for index ${f}`);const m=100/l*h;s[f]=m}let c=0;for(let f=0;f<a.length;f++){const h=s[f];Re(h!=null,`No layout data found for index ${f}`);const m=go({panelConstraints:a,panelIndex:f,size:h});h!=m&&(c+=h-m,s[f]=m)}if(!rn(c,0))for(let f=0;f<a.length;f++){const h=s[f];Re(h!=null,`No layout data found for index ${f}`);const m=h+c,p=go({panelConstraints:a,panelIndex:f,size:m});if(h!==p&&(c-=p-h,s[f]=p,rn(c,0)))break}return s}const bA=100,ks={getItem:n=>(Jg(ks),ks.getItem(n)),setItem:(n,a)=>{Jg(ks),ks.setItem(n,a)}},ty={};function qx({autoSaveId:n=null,children:a,className:s="",direction:l,forwardedRef:c,id:f=null,onLayout:h=null,keyboardResizeBy:m=null,storage:p=ks,style:y,tagName:C="div",...x}){const v=nf(f),N=S.useRef(null),[w,M]=S.useState(null),[E,j]=S.useState([]),H=sA(),B=S.useRef({}),U=S.useRef(new Map),O=S.useRef(0),k=S.useRef({autoSaveId:n,direction:l,dragState:w,id:v,keyboardResizeBy:m,onLayout:h,storage:p}),z=S.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});S.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S.useImperativeHandle(c,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:F}=z.current;return F},setLayout:F=>{const{onLayout:J}=k.current,{layout:ce,panelDataArray:te}=z.current,le=ey({layout:F,panelConstraints:te.map(xe=>xe.constraints)});Zg(ce,le)||(j(le),z.current.layout=le,J&&J(le),mo(te,le,B.current))}}),[]),wi(()=>{k.current.autoSaveId=n,k.current.direction=l,k.current.dragState=w,k.current.id=v,k.current.onLayout=h,k.current.storage=p}),dA({committedValuesRef:k,eagerValuesRef:z,groupId:v,layout:E,panelDataArray:z.current.panelDataArray,setLayout:j,panelGroupElement:N.current}),S.useEffect(()=>{const{panelDataArray:F}=z.current;if(n){if(E.length===0||E.length!==F.length)return;let J=ty[n];J==null&&(J=gA(xA,bA),ty[n]=J);const ce=[...F],te=new Map(U.current);J(n,ce,te,E,p)}},[n,E,p]),S.useEffect(()=>{});const X=S.useCallback(F=>{const{onLayout:J}=k.current,{layout:ce,panelDataArray:te}=z.current;if(F.constraints.collapsible){const le=te.map(St=>St.constraints),{collapsedSize:xe=0,panelSize:Pe,pivotIndices:Ye}=vi(te,F,ce);if(Re(Pe!=null,`Panel size not found for panel "${F.id}"`),!ga(Pe,xe)){U.current.set(F.id,Pe);const Ct=po(te,F)===te.length-1?Pe-xe:xe-Pe,Fe=Ns({delta:Ct,initialLayout:ce,panelConstraints:le,pivotIndices:Ye,prevLayout:ce,trigger:"imperative-api"});tr(ce,Fe)||(j(Fe),z.current.layout=Fe,J&&J(Fe),mo(te,Fe,B.current))}}},[]),W=S.useCallback((F,J)=>{const{onLayout:ce}=k.current,{layout:te,panelDataArray:le}=z.current;if(F.constraints.collapsible){const xe=le.map(ot=>ot.constraints),{collapsedSize:Pe=0,panelSize:Ye=0,minSize:St=0,pivotIndices:Ct}=vi(le,F,te),Fe=J??St;if(ga(Ye,Pe)){const ot=U.current.get(F.id),Ut=ot!=null&&ot>=Fe?ot:Fe,Yn=po(le,F)===le.length-1?Ye-Ut:Ut-Ye,Te=Ns({delta:Yn,initialLayout:te,panelConstraints:xe,pivotIndices:Ct,prevLayout:te,trigger:"imperative-api"});tr(te,Te)||(j(Te),z.current.layout=Te,ce&&ce(Te),mo(le,Te,B.current))}}},[]),Q=S.useCallback(F=>{const{layout:J,panelDataArray:ce}=z.current,{panelSize:te}=vi(ce,F,J);return Re(te!=null,`Panel size not found for panel "${F.id}"`),te},[]),ae=S.useCallback((F,J)=>{const{panelDataArray:ce}=z.current,te=po(ce,F);return pA({defaultSize:J,dragState:w,layout:E,panelData:ce,panelIndex:te})},[w,E]),ee=S.useCallback(F=>{const{layout:J,panelDataArray:ce}=z.current,{collapsedSize:te=0,collapsible:le,panelSize:xe}=vi(ce,F,J);return Re(xe!=null,`Panel size not found for panel "${F.id}"`),le===!0&&ga(xe,te)},[]),ye=S.useCallback(F=>{const{layout:J,panelDataArray:ce}=z.current,{collapsedSize:te=0,collapsible:le,panelSize:xe}=vi(ce,F,J);return Re(xe!=null,`Panel size not found for panel "${F.id}"`),!le||Ai(xe,te)>0},[]),fe=S.useCallback(F=>{const{panelDataArray:J}=z.current;J.push(F),J.sort((ce,te)=>{const le=ce.order,xe=te.order;return le==null&&xe==null?0:le==null?-1:xe==null?1:le-xe}),z.current.panelDataArrayChanged=!0,H()},[H]);wi(()=>{if(z.current.panelDataArrayChanged){z.current.panelDataArrayChanged=!1;const{autoSaveId:F,onLayout:J,storage:ce}=k.current,{layout:te,panelDataArray:le}=z.current;let xe=null;if(F){const Ye=yA(F,le,ce);Ye&&(U.current=new Map(Object.entries(Ye.expandToSizes)),xe=Ye.layout)}xe==null&&(xe=mA({panelDataArray:le}));const Pe=ey({layout:xe,panelConstraints:le.map(Ye=>Ye.constraints)});Zg(te,Pe)||(j(Pe),z.current.layout=Pe,J&&J(Pe),mo(le,Pe,B.current))}}),wi(()=>{const F=z.current;return()=>{F.layout=[]}},[]);const Ce=S.useCallback(F=>{let J=!1;const ce=N.current;return ce&&window.getComputedStyle(ce,null).getPropertyValue("direction")==="rtl"&&(J=!0),function(le){le.preventDefault();const xe=N.current;if(!xe)return()=>null;const{direction:Pe,dragState:Ye,id:St,keyboardResizeBy:Ct,onLayout:Fe}=k.current,{layout:ot,panelDataArray:Ut}=z.current,{initialLayout:Qt}=Ye??{},Yn=zx(St,F,xe);let Te=hA(le,F,Pe,Ye,Ct,xe);const Wt=Pe==="horizontal";Wt&&J&&(Te=-Te);const En=Ut.map(Vn=>Vn.constraints),$t=Ns({delta:Te,initialLayout:Qt??ot,panelConstraints:En,pivotIndices:Yn,prevLayout:ot,trigger:Tx(le)?"keyboard":"mouse-or-touch"}),Sa=!tr(ot,$t);(jx(le)||Mx(le))&&O.current!=Te&&(O.current=Te,!Sa&&Te!==0?Wt?sd(F,Te<0?Ex:Ox):sd(F,Te<0?Rx:Px):sd(F,0)),Sa&&(j($t),z.current.layout=$t,Fe&&Fe($t),mo(Ut,$t,B.current))}},[]),R=S.useCallback((F,J)=>{const{onLayout:ce}=k.current,{layout:te,panelDataArray:le}=z.current,xe=le.map(ot=>ot.constraints),{panelSize:Pe,pivotIndices:Ye}=vi(le,F,te);Re(Pe!=null,`Panel size not found for panel "${F.id}"`);const Ct=po(le,F)===le.length-1?Pe-J:J-Pe,Fe=Ns({delta:Ct,initialLayout:te,panelConstraints:xe,pivotIndices:Ye,prevLayout:te,trigger:"imperative-api"});tr(te,Fe)||(j(Fe),z.current.layout=Fe,ce&&ce(Fe),mo(le,Fe,B.current))},[]),V=S.useCallback((F,J)=>{const{layout:ce,panelDataArray:te}=z.current,{collapsedSize:le=0,collapsible:xe}=J,{collapsedSize:Pe=0,collapsible:Ye,maxSize:St=100,minSize:Ct=0}=F.constraints,{panelSize:Fe}=vi(te,F,ce);Fe!=null&&(xe&&Ye&&ga(Fe,le)?ga(le,Pe)||R(F,Pe):Fe<Ct?R(F,Ct):Fe>St&&R(F,St))},[R]),ie=S.useCallback((F,J)=>{const{direction:ce}=k.current,{layout:te}=z.current;if(!N.current)return;const le=Lr(F,N.current);Re(le,`Drag handle element not found for id "${F}"`);const xe=Ix(ce,J);M({dragHandleId:F,dragHandleRect:le.getBoundingClientRect(),initialCursorPosition:xe,initialLayout:te})},[]),$=S.useCallback(()=>{M(null)},[]),se=S.useCallback(F=>{const{panelDataArray:J}=z.current,ce=po(J,F);ce>=0&&(J.splice(ce,1),delete B.current[F.id],z.current.panelDataArrayChanged=!0,H())},[H]),ne=S.useMemo(()=>({collapsePanel:X,direction:l,dragState:w,expandPanel:W,getPanelSize:Q,getPanelStyle:ae,groupId:v,isPanelCollapsed:ee,isPanelExpanded:ye,reevaluatePanelConstraints:V,registerPanel:fe,registerResizeHandle:Ce,resizePanel:R,startDragging:ie,stopDragging:$,unregisterPanel:se,panelGroupElement:N.current}),[X,w,l,W,Q,ae,v,ee,ye,V,fe,Ce,R,ie,$,se]),Ne={display:"flex",flexDirection:l==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return S.createElement(Er.Provider,{value:ne},S.createElement(C,{...x,children:a,className:s,id:f,ref:N,style:{...Ne,...y},[dt.group]:"",[dt.groupDirection]:l,[dt.groupId]:v}))}const of=S.forwardRef((n,a)=>S.createElement(qx,{...n,forwardedRef:a}));qx.displayName="PanelGroup";of.displayName="forwardRef(PanelGroup)";function po(n,a){return n.findIndex(s=>s===a||s.id===a.id)}function vi(n,a,s){const l=po(n,a),f=l===n.length-1?[l-1,l]:[l,l+1],h=s[l];return{...a.constraints,panelSize:h,pivotIndices:f}}function vA({disabled:n,handleId:a,resizeHandler:s,panelGroupElement:l}){S.useEffect(()=>{if(n||s==null||l==null)return;const c=Lr(a,l);if(c==null)return;const f=h=>{if(!h.defaultPrevented)switch(h.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{h.preventDefault(),s(h);break}case"F6":{h.preventDefault();const m=c.getAttribute(dt.groupId);Re(m,`No group element found for id "${m}"`);const p=_s(m,l),y=_x(m,a,l);Re(y!==null,`No resize element found for id "${a}"`);const C=h.shiftKey?y>0?y-1:p.length-1:y+1<p.length?y+1:0;p[C].focus();break}}};return c.addEventListener("keydown",f),()=>{c.removeEventListener("keydown",f)}},[l,n,a,s])}function sf({children:n=null,className:a="",disabled:s=!1,hitAreaMargins:l,id:c,onBlur:f,onClick:h,onDragging:m,onFocus:p,onPointerDown:y,onPointerUp:C,style:x={},tabIndex:v=0,tagName:N="div",...w}){var M,E;const j=S.useRef(null),H=S.useRef({onClick:h,onDragging:m,onPointerDown:y,onPointerUp:C});S.useEffect(()=>{H.current.onClick=h,H.current.onDragging=m,H.current.onPointerDown=y,H.current.onPointerUp=C});const B=S.useContext(Er);if(B===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:U,groupId:O,registerResizeHandle:k,startDragging:z,stopDragging:X,panelGroupElement:W}=B,Q=nf(c),[ae,ee]=S.useState("inactive"),[ye,fe]=S.useState(!1),[Ce,R]=S.useState(null),V=S.useRef({state:ae});wi(()=>{V.current.state=ae}),S.useEffect(()=>{if(s)R(null);else{const ne=k(Q);R(()=>ne)}},[s,Q,k]);const ie=(M=l?.coarse)!==null&&M!==void 0?M:15,$=(E=l?.fine)!==null&&E!==void 0?E:5;S.useEffect(()=>{if(s||Ce==null)return;const ne=j.current;Re(ne,"Element ref not attached");let Ne=!1;return iA(Q,ne,U,{coarse:ie,fine:$},(J,ce,te)=>{if(!ce){ee("inactive");return}switch(J){case"down":{ee("drag"),Ne=!1,Re(te,'Expected event to be defined for "down" action'),z(Q,te);const{onDragging:le,onPointerDown:xe}=H.current;le?.(!0),xe?.();break}case"move":{const{state:le}=V.current;Ne=!0,le!=="drag"&&ee("hover"),Re(te,'Expected event to be defined for "move" action'),Ce(te);break}case"up":{ee("hover"),X();const{onClick:le,onDragging:xe,onPointerUp:Pe}=H.current;xe?.(!1),Pe?.(),Ne||le?.();break}}})},[ie,U,s,$,k,Q,Ce,z,X]),vA({disabled:s,handleId:Q,resizeHandler:Ce,panelGroupElement:W});const se={touchAction:"none",userSelect:"none"};return S.createElement(N,{...w,children:n,className:a,id:c,onBlur:()=>{fe(!1),f?.()},onFocus:()=>{fe(!0),p?.()},ref:j,role:"separator",style:{...se,...x},tabIndex:v,[dt.groupDirection]:U,[dt.groupId]:O,[dt.resizeHandle]:"",[dt.resizeHandleActive]:ae==="drag"?"pointer":ye?"keyboard":void 0,[dt.resizeHandleEnabled]:!s,[dt.resizeHandleId]:Q,[dt.resizeHandleState]:ae})}sf.displayName="PanelResizeHandle";const So=S.forwardRef(({className:n,children:a,...s},l)=>r.jsxs(Iy,{ref:l,className:K("relative overflow-hidden",n),...s,children:[r.jsx(lS,{className:"h-full w-full rounded-[inherit]",children:a}),r.jsx(Gx,{}),r.jsx(rS,{})]}));So.displayName=Iy.displayName;const Gx=S.forwardRef(({className:n,orientation:a="vertical",...s},l)=>r.jsx(Hy,{ref:l,orientation:a,className:K("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...s,children:r.jsx(cS,{className:"relative flex-1 rounded-full bg-border"})}));Gx.displayName=Hy.displayName;function SA(n){const a={provider:"unknown",endpoint:"unknown",timestamp:new Date,raw:n},s=n.match(/error-api-provider-([^-]+)-/);s&&(a.provider=s[1]);const l=n.match(/error-api-provider-[^-]+-(.+?)-\d{4}-\d{2}-\d{2}T/);l&&(a.endpoint=l[1].replace(/-/g,"/"));const c=n.match(/(\d{4}-\d{2}-\d{2}T\d{6})/);if(c){const f=c[1],h=`${f.slice(0,10)}T${f.slice(11,13)}:${f.slice(13,15)}:${f.slice(15,17)}`;a.timestamp=new Date(h)}return a}function CA(n){const a={version:"",url:"",method:"",timestamp:"",statusCode:0,statusText:"",requestHeaders:{},requestBody:"",responseHeaders:{},responseBody:"",provider:"",endpoint:"",isClientError:!1,isServerError:!1,errorType:"unknown",model:null,quotaResetDelay:null,quotaResetTimestamp:null},s=n.split(/^===\s*(.+?)\s*===$/m);let l="";for(let c=0;c<s.length;c++){const f=s[c].trim();if(f==="REQUEST INFO"){l="request_info";continue}else if(f==="HEADERS"){l="headers";continue}else if(f==="REQUEST BODY"){l="request_body";continue}else if(f==="API RESPONSE"){l="";continue}else if(f==="RESPONSE"){l="response";continue}switch(l){case"request_info":wA(f,a);break;case"headers":a.requestHeaders=NA(f);break;case"request_body":a.requestBody=f;break;case"response":kA(f,a);break}}return AA(a),a}function wA(n,a){const s=n.split(`
11
+ `);for(const l of s){const[c,...f]=l.split(":"),h=f.join(":").trim();switch(c?.trim()?.toLowerCase()){case"version":a.version=h;break;case"url":a.url=h;break;case"method":a.method=h;break;case"timestamp":a.timestamp=h;break}}}function NA(n){const a={},s=n.split(`
12
+ `);for(const l of s){const c=l.indexOf(":");if(c>0){const f=l.slice(0,c).trim(),h=l.slice(c+1).trim();f&&(a[f]=h)}}return a}function kA(n,a){const s=n.split(`
13
+ `);let l=!1;const c=[];for(const f of s){if(f.startsWith("Status:")){const m=f.replace("Status:","").trim().split(/\s+/);a.statusCode=parseInt(m[0],10)||0,a.statusText=m.slice(1).join(" ")||MA(a.statusCode);continue}if(f.trim()===""&&!l){l=!0;continue}if(l)c.push(f);else{const h=f.indexOf(":");if(h>0){const m=f.slice(0,h).trim(),p=f.slice(h+1).trim();m&&(a.responseHeaders[m]=p)}}}a.responseBody=c.join(`
14
+ `).trim()}function AA(n){const a=n.url.match(/\/api\/provider\/([^/]+)/);a&&(n.provider=a[1]);const s=n.url.match(/\/api\/provider\/[^/]+\/(.+?)(?:\?|$)/);s&&(n.endpoint=s[1]),n.isClientError=n.statusCode>=400&&n.statusCode<500,n.isServerError=n.statusCode>=500,n.statusCode===429?n.errorType="rate_limit":n.statusCode===401||n.statusCode===403?n.errorType="auth":n.statusCode===404?n.errorType="not_found":n.statusCode>=500?n.errorType="server":(n.statusCode===408||n.statusCode===504)&&(n.errorType="timeout"),TA(n),n.statusCode===429&&jA(n)}function TA(n){if(n.requestBody)try{const a=JSON.parse(n.requestBody);typeof a.model=="string"&&(n.model=a.model)}catch{}}function jA(n){if(n.responseBody)try{const a=JSON.parse(n.responseBody),s=Nd(a);s!==null&&(n.quotaResetDelay=s);const l=kd(a);l&&(n.quotaResetTimestamp=l)}catch{}}function Nd(n){if(typeof n!="object"||n===null)return null;const a=n;if("quotaResetDelay"in a){const s=a.quotaResetDelay;if(typeof s=="number")return s;if(typeof s=="string"){const l=s.match(/^(\d+)s?$/);if(l)return parseInt(l[1],10)}}if("error"in a&&typeof a.error=="object"){const s=Nd(a.error);if(s!==null)return s}if("details"in a&&Array.isArray(a.details))for(const s of a.details){const l=Nd(s);if(l!==null)return l}return null}function kd(n){if(typeof n!="object"||n===null)return null;const a=n;for(const s of["quotaResetTimeStamp","quotaResetTimestamp","resetTime","reset_time"])if(s in a&&typeof a[s]=="string")return a[s];if("error"in a&&typeof a.error=="object"){const s=kd(a.error);if(s)return s}if("details"in a&&Array.isArray(a.details))for(const s of a.details){const l=kd(s);if(l)return l}return null}function MA(n){return{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",408:"Request Timeout",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"}[n]||""}function DA(n,a){const s=Ld(),l=s==="zh-CN",c=s==="vi",f=Date.now(),h=n*1e3,m=f-h,p=Math.floor(m/1e3),y=Math.floor(p/60),C=Math.floor(y/60),x=Math.floor(C/24);return p<60?l?"刚刚":c?"vừa xong":"just now":y<60?l?`${y} 分钟前`:c?`${y} phút trước`:`${y}m ago`:C<24?l?`${C} 小时前`:c?`${C} giờ trước`:`${C}h ago`:x<7?l?`${x} 天前`:c?`${x} ngày trước`:`${x}d ago`:new Date(h).toLocaleDateString(s,{month:"short",day:"numeric"})}function EA(n){return n>=500?"text-red-500":n===429?"text-orange-500":n>=400?"text-yellow-500":"text-gray-500"}function OA(n,a){const s=Ld();return s==="zh-CN"?{rate_limit:"限流",auth:"认证错误",not_found:"未找到",server:"服务错误",timeout:"超时",unknown:"错误"}[n]||"错误":s==="vi"?{rate_limit:"Quá giới hạn",auth:"Lỗi xác thực",not_found:"Không tìm thấy",server:"Lỗi máy chủ",timeout:"Hết thời gian chờ",unknown:"Lỗi"}[n]||"Lỗi":{rate_limit:"Rate Limited",auth:"Auth Error",not_found:"Not Found",server:"Server Error",timeout:"Timeout",unknown:"Error"}[n]||"Error"}function RA(n){if(n===null||n<=0)return null;if(n<60)return`${n}s`;if(n<3600)return`${Math.floor(n/60)}m`;const a=Math.floor(n/3600),s=Math.floor(n%3600/60);return s>0?`${a}h ${s}m`:`${a}h`}function PA(n,a){if(!n)return null;const s=Ld(),l=s==="zh-CN",c=s==="vi";try{const f=new Date(n),h=new Date,m=f.getTime()-h.getTime();if(m<=0)return l?"现在":c?"bây giờ":"now";const p=Math.floor(m/1e3);if(p<60)return l?`${p}秒`:c?`${p} giây`:`${p}s`;if(p<3600){const x=Math.floor(p/60);return l?`${x}分钟`:c?`${x} phút`:`${x}m`}const y=Math.floor(p/3600),C=Math.floor(p%3600/60);return l?C>0?`${y}小时 ${C}分钟`:`${y}小时`:c?C>0?`${y} giờ ${C} phút`:`${y} giờ`:C>0?`${y}h ${C}m`:`${y}h`}catch{return null}}function LA(n){return n?n===429?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":n>=500?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":n>=400?"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400":"bg-gray-100 text-gray-600":"bg-gray-100 text-gray-600"}function _A(n){return n||""}function zA({name:n,size:a,modified:s,isSelected:l,onClick:c,statusCode:f,model:h}){const m=S.useMemo(()=>SA(n),[n]),p=S.useMemo(()=>_A(h),[h]);return r.jsxs("button",{onClick:c,className:K("w-full px-2.5 py-2 flex items-center gap-2 text-left transition-colors","hover:bg-muted/40 border-l-[3px]",l?"bg-muted/50 border-l-red-500":"border-l-transparent"),children:[r.jsx("span",{className:K("shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded min-w-[32px] text-center",LA(f)),children:f||"???"}),r.jsx(ef,{provider:m.provider,size:18,withBackground:!0,className:"shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[r.jsx("span",{className:"text-[11px] font-medium text-foreground truncate",children:m.endpoint||"unknown"}),p&&r.jsx("span",{className:"text-[10px] text-muted-foreground truncate",title:p,children:p}),r.jsxs("div",{className:"flex items-center gap-1 text-[9px] text-muted-foreground/60",children:[r.jsx(Os,{className:"w-2.5 h-2.5"}),r.jsx("span",{children:DA(s)})]})]})]})}function ny({value:n,className:a,variant:s="outline",size:l="icon",label:c="Copy to clipboard"}){const[f,h]=S.useState(!1),m=()=>{navigator.clipboard.writeText(n),h(!0),setTimeout(()=>h(!1),2e3)};return r.jsx(Ci,{children:r.jsxs($a,{children:[r.jsx(Xa,{asChild:!0,children:r.jsxs(ft,{size:l,variant:s,className:K("relative z-10 text-muted-foreground hover:text-foreground",a),onClick:p=>{p.stopPropagation(),m()},children:[f?r.jsx(xo,{className:"h-3.5 w-3.5 text-green-500"}):r.jsx(lr,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"sr-only",children:c})]})}),r.jsx(Za,{children:r.jsx("p",{children:f?"Copied!":c})})]})})}function Ss({active:n,onClick:a,children:s,icon:l}){return r.jsxs("button",{onClick:a,className:K("px-2.5 py-1.5 text-xs font-medium rounded transition-colors flex items-center gap-1.5",n?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[l&&r.jsx(l,{className:"w-3.5 h-3.5"}),s]})}function Yx({code:n}){const a=EA(n);return r.jsx("span",{className:K("inline-flex items-center justify-center min-w-[36px] px-2 py-0.5 rounded text-xs font-bold","bg-current/10 border border-current/20",a),children:n})}function UA({parsed:n}){const{t:a}=_t(),s=RA(n.quotaResetDelay)||PA(n.quotaResetTimestamp),l=a("errorLogs.na");return r.jsx(So,{className:"h-full",children:r.jsxs("div",{className:"p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Yx,{code:n.statusCode}),r.jsx("span",{className:"text-sm font-medium",children:n.statusText}),r.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-muted/50",children:OA(n.errorType)})]}),n.model&&r.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-violet-500/10 border border-violet-500/20",children:[r.jsx(YS,{className:"w-4 h-4 text-violet-500 shrink-0"}),r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:a("errorLogs.modelLabel")}),r.jsx("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:n.model})]})]}),n.errorType==="rate_limit"&&s&&r.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[r.jsx(Os,{className:"w-4 h-4 text-amber-500 shrink-0"}),r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:a("errorLogs.quotaResetsIn")}),r.jsx("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:s})]})]}),r.jsxs("div",{className:"grid grid-cols-4 gap-3 text-xs",children:[r.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[r.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.method")}),r.jsx("div",{className:"font-medium",children:n.method||l})]}),r.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[r.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.provider")}),r.jsx("div",{className:"font-medium",children:n.provider||l})]}),r.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[r.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.version")}),r.jsx("div",{className:"font-medium",children:n.version||l})]}),r.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[r.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.endpoint")}),r.jsx("div",{className:"font-medium truncate",title:n.endpoint,children:n.endpoint||l})]})]}),r.jsxs("div",{className:"text-xs",children:[r.jsx("div",{className:"text-muted-foreground mb-1.5",children:a("errorLogs.url")}),r.jsx("div",{className:"font-mono p-2.5 rounded bg-muted/30 border border-border/50 break-all leading-relaxed",children:n.url||l})]}),r.jsxs("div",{className:"text-xs",children:[r.jsx("div",{className:"text-muted-foreground mb-1.5",children:a("errorLogs.timestamp")}),r.jsx("div",{className:"font-mono",children:n.timestamp||l})]}),n.errorType!=="unknown"&&r.jsxs("div",{className:K("flex items-start gap-3 p-3 rounded text-xs",n.errorType==="rate_limit"?"bg-amber-500/10 border border-amber-500/20":n.errorType==="auth"?"bg-red-500/10 border border-red-500/20":"bg-blue-500/10 border border-blue-500/20"),children:[n.errorType==="rate_limit"?r.jsx(qn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}):n.errorType==="auth"?r.jsx(qn,{className:"w-4 h-4 mt-0.5 text-red-500 shrink-0"}):r.jsx(Nr,{className:"w-4 h-4 mt-0.5 text-blue-500 shrink-0"}),r.jsxs("div",{className:K("leading-relaxed",n.errorType==="rate_limit"?"text-amber-600 dark:text-amber-400":n.errorType==="auth"?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400"),children:[n.errorType==="rate_limit"&&(n.model?a("errorLogs.rateLimitedMsg",{model:n.model}):a("errorLogs.rateLimitedMsgNoModel")),n.errorType==="auth"&&a("errorLogs.authFailedMsg"),n.errorType==="not_found"&&a("errorLogs.notFoundMsg"),n.errorType==="server"&&a("errorLogs.serverErrorMsg"),n.errorType==="timeout"&&a("errorLogs.timeoutMsg")]})]})]})})}function IA({headers:n}){const a=Object.entries(n);return a.length===0?r.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:"No headers available"}):r.jsx(So,{className:"h-full",children:r.jsx("div",{className:"p-4 space-y-1",children:a.map(([s,l])=>r.jsxs("div",{className:"flex gap-3 text-xs font-mono py-1.5 border-b border-border/30 last:border-0",children:[r.jsxs("span",{className:"text-muted-foreground shrink-0 min-w-[140px]",children:[s,":"]}),r.jsx("span",{className:"break-all",children:l})]},s))})})}function ay({content:n,label:a}){const{t:s}=_t();if(!n||n.trim()===""){const f=a==="Request"?"errorLogs.noRequestBody":"errorLogs.noResponseBody";return r.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:s(f)})}let l=n,c=!1;try{const f=JSON.parse(n);l=JSON.stringify(f,null,2),c=!0}catch{}return r.jsx(So,{className:"h-full",children:r.jsx("pre",{className:K("p-4 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",c?"text-emerald-700 dark:text-green-400":"text-zinc-700 dark:text-muted-foreground"),children:l})})}function HA({content:n}){return r.jsx(So,{className:"h-full",children:r.jsx("pre",{className:"p-4 text-xs font-mono text-zinc-700 dark:text-muted-foreground whitespace-pre-wrap break-all leading-relaxed",children:n})})}function BA({name:n,absolutePath:a}){const{t:s}=_t(),[l,c]=S.useState("overview"),{data:f,isLoading:h,error:m}=bk(n),p=S.useMemo(()=>f?CA(f):null,[f]);return n?h?r.jsxs("div",{className:"flex-1 p-6 space-y-3",children:[r.jsx(Ge,{className:"h-5 w-full"}),r.jsx(Ge,{className:"h-5 w-3/4"}),r.jsx(Ge,{className:"h-5 w-5/6"}),r.jsx(Ge,{className:"h-5 w-2/3"})]}):m||!f||!p?r.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:r.jsx("p",{className:"text-sm",children:s("errorLogs.failedLoadContent")})}):r.jsxs("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:[r.jsxs("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between gap-3 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[r.jsx(Yx,{code:p.statusCode}),r.jsxs("span",{className:"text-xs font-semibold truncate text-foreground",children:[p.provider,"/",p.endpoint||"unknown"]}),n&&r.jsx(ny,{value:a||n,label:s("errorLogs.copyAbsolutePath"),size:"icon-sm",className:"ml-1 text-muted-foreground hover:text-foreground opacity-50 hover:opacity-100 transition-opacity"})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[f&&r.jsx(ny,{value:f,label:s("errorLogs.copyRawContent"),variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),r.jsx("span",{className:"text-[10px] text-muted-foreground font-mono bg-muted px-1.5 py-0.5 rounded border border-border/50",children:p.method})]})]}),r.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-1 bg-muted/10 shrink-0 overflow-x-auto",children:[r.jsx(Ss,{active:l==="overview",onClick:()=>c("overview"),icon:Nr,children:s("errorLogs.tabOverview")}),r.jsx(Ss,{active:l==="headers",onClick:()=>c("headers"),icon:FS,children:s("errorLogs.tabHeaders")}),r.jsx(Ss,{active:l==="request",onClick:()=>c("request"),icon:QS,children:s("errorLogs.tabRequest")}),r.jsx(Ss,{active:l==="response",onClick:()=>c("response"),icon:WS,children:s("errorLogs.tabResponse")}),r.jsx(Ss,{active:l==="raw",onClick:()=>c("raw"),icon:$S,children:s("errorLogs.tabRaw")})]}),r.jsxs("div",{className:"flex-1 overflow-hidden bg-card/30",children:[l==="overview"&&r.jsx(UA,{parsed:p}),l==="headers"&&r.jsx(IA,{headers:p.requestHeaders}),l==="request"&&r.jsx(ay,{content:p.requestBody,label:"Request"}),l==="response"&&r.jsx(ay,{content:p.responseBody,label:"Response"}),l==="raw"&&r.jsx(HA,{content:f})]})]}):r.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center space-y-3",children:[r.jsx(VS,{className:"w-10 h-10 mx-auto opacity-40"}),r.jsx("p",{className:"text-sm",children:s("errorLogs.selectLog")})]})})}function KA(){const{t:n}=_t(),{data:a,isLoading:s}=mk(),{data:l,isLoading:c,error:f}=xk(a?.running??!1),[h,m]=S.useState(500),[p,y]=S.useState(!1),C=S.useRef(null),x=S.useRef(null),v=()=>{x.current&&(clearInterval(x.current),x.current=null)};S.useEffect(()=>{if(!p)return;const U=k=>{const z=C.current;if(!z)return;const W=z.getBoundingClientRect().top+window.scrollY,Q=k.pageY-W;m(Math.max(300,Q));const ee=window.innerHeight-k.clientY,ye=15;v(),ee<50?x.current=setInterval(()=>{window.scrollBy(0,ye)},16):k.clientY<50&&(x.current=setInterval(()=>{window.scrollBy(0,-ye)},16))},O=()=>{y(!1),v(),document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",U),document.addEventListener("mouseup",O),document.body.style.cursor="row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",O),document.body.style.cursor="default",document.body.style.userSelect="auto",v()}},[p]);const N=U=>{U.preventDefault(),y(!0)},w=S.useMemo(()=>l?.[0]?.name??null,[l]),[M,E]=S.useState(null),j=M??w,H=S.useMemo(()=>!j||!l?void 0:l.find(O=>O.name===j)?.absolutePath,[j,l]);if(s||!a?.running)return null;if(c)return r.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-sm bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm h-[500px]",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[r.jsx(Ge,{className:"h-4 w-32"}),r.jsx(Ge,{className:"h-4 w-20"})]}),r.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(U=>r.jsx(Ge,{className:"h-12 w-full rounded-lg"},U))})]});if(!l||l.length===0)return null;const B=l.length;return r.jsxs("div",{ref:C,className:"rounded-xl border border-border overflow-hidden font-mono text-sm text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm flex flex-col shadow-sm transition-[height] duration-0 ease-linear relative group/container",style:{height:h},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-gradient-to-r from-amber-500/10 via-transparent to-transparent dark:from-amber-500/15 shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(qn,{className:"w-4 h-4 text-amber-500"}),r.jsx("span",{className:"text-sm font-semibold tracking-tight",children:n("errorLogs.title")}),r.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:n("errorLogs.failedRequests",{count:B})})]}),r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(XS,{className:"w-3.5 h-3.5"}),r.jsx("span",{children:n("errorLogs.cliproxyDiagnostics")})]})]}),r.jsx("div",{className:"flex-1 min-h-0",children:r.jsxs(of,{direction:"horizontal",children:[r.jsx(Ps,{defaultSize:30,minSize:20,maxSize:50,className:"flex flex-col min-w-0",children:r.jsxs(So,{className:"h-full",children:[r.jsx("div",{className:"divide-y divide-border/50",children:l.slice(0,50).map(U=>r.jsx(zA,{name:U.name,size:U.size,modified:U.modified,isSelected:j===U.name,onClick:()=>E(U.name),statusCode:U.statusCode,model:U.model},U.name))}),l.length>50&&r.jsx("div",{className:"px-3 py-3 text-center text-[10px] text-muted-foreground border-t border-border/50",children:n("errorLogs.showingCount",{total:l.length})})]})}),r.jsxs(sf,{className:"w-[1px] bg-border hover:bg-primary/50 transition-colors flex items-center justify-center group relative z-10 w-2 -ml-1 flex items-center justify-center outline-none",children:[r.jsx("div",{className:"w-[1px] h-full bg-border group-hover:bg-primary/50 transition-colors"}),r.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-4 h-8 rounded-sm flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-muted border border-border",children:r.jsx(wr,{className:"h-4 w-4 text-muted-foreground"})})]}),r.jsx(Ps,{className:"flex flex-col min-w-0 bg-background/50",children:r.jsx(BA,{name:j,absolutePath:H})})]})}),f?r.jsx("div",{className:"px-4 py-2 border-t border-border text-xs text-destructive bg-destructive/5 shrink-0",children:f.message}):r.jsx("div",{className:"h-2 bg-border/10 border-t border-border/30 hover:bg-primary/10 transition-colors cursor-row-resize flex items-center justify-center group/handle shrink-0",onMouseDown:N,children:r.jsx(ZS,{className:"w-8 h-3 text-border group-hover:text-primary/50 transition-colors"})})]})}const qA=kr("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-900/50 dark:bg-yellow-900/20 dark:text-yellow-200 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-500",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-200 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-500",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-200 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"}},defaultVariants:{variant:"default"}}),lf=S.forwardRef(({className:n,variant:a,...s},l)=>r.jsx("div",{ref:l,role:"alert",className:K(qA({variant:a}),n),...s}));lf.displayName="Alert";const Vx=S.forwardRef(({className:n,...a},s)=>r.jsx("h5",{ref:s,className:K("mb-1 font-medium leading-none tracking-tight",n),...a}));Vx.displayName="AlertTitle";const rf=S.forwardRef(({className:n,...a},s)=>r.jsx("div",{ref:s,className:K("text-sm [&_p]:leading-relaxed",n),...a}));rf.displayName="AlertDescription";function GA(){return Tt({queryKey:["overview"],queryFn:async()=>(await fetch("/api/overview")).json()})}function Fx(n,a){return typeof n=="object"&&n!==null&&"error"in n&&typeof n.error=="string"?n.error:a}function Qx(n){const a=n.trim();if(!a)return null;try{return JSON.parse(a)}catch{return null}}function YA(n){const a=n.trim().toLowerCase();return a.startsWith("<!doctype html")||a.startsWith("<html")}function VA(n){if(!n||typeof n!="object")return!1;const a=n;return!(typeof a.content!="string"||"contentPath"in a&&typeof a.contentPath!="string")}async function Wx(n,a){const s=await n.text(),l=Qx(s);if(!n.ok){const c=Fx(l,a);throw new Error(c)}if(l===null)throw new Error(a);return l}function FA(){return Tt({queryKey:["shared","summary"],queryFn:async()=>{const n=await fetch("/api/shared/summary");return Wx(n,"Failed to fetch shared summary")}})}function zD(n){return Tt({queryKey:["shared",n],queryFn:async()=>{const a=await fetch(`/api/shared/${n}`);return Wx(a,`Failed to fetch shared ${n}`)}})}function UD(n,a){return Tt({queryKey:["shared",n,"content",a],enabled:typeof a=="string"&&a.length>0,queryFn:async()=>{if(!a)throw new Error("Missing shared item path");const s=new URLSearchParams({type:n,path:a}),l=await fetch(`/api/shared/content?${s.toString()}`),c=await l.text(),f=Qx(c);if(!l.ok)throw new Error(Fx(f,`Failed to fetch shared ${n} content`));if(VA(f))return{content:f.content,contentPath:typeof f.contentPath=="string"&&f.contentPath.length>0?f.contentPath:a};if(c.trim().length>0){if(YA(c))throw new Error("Shared content endpoint unavailable. Restart `ccs config` and try again.");return{content:c,contentPath:a}}throw new Error(`Failed to fetch shared ${n} content`)}})}const QA={ok:"success",warning:"warning",error:"error"},WA={default:{iconBg:"bg-muted",iconColor:"text-muted-foreground"},success:{iconBg:"bg-green-600/15",iconColor:"text-green-700 dark:text-green-500"},warning:{iconBg:"bg-amber-500/15",iconColor:"text-amber-700 dark:text-amber-400"},error:{iconBg:"bg-red-600/15",iconColor:"text-red-700 dark:text-red-500"},accent:{iconBg:"bg-accent/15",iconColor:"text-accent"}};function nr({title:n,value:a,icon:s,variant:l="default",onClick:c}){const f=WA[l];return r.jsxs("button",{onClick:c,className:K("flex items-center gap-3 px-4 py-2.5 rounded-lg border bg-card/50","transition-all hover:bg-card hover:shadow-sm hover:-translate-y-0.5","active:scale-[0.98]"),children:[r.jsx("div",{className:K("flex items-center justify-center w-9 h-9 rounded-md",f.iconBg),children:r.jsx(s,{className:K("w-4 h-4",f.iconColor)})}),r.jsxs("div",{className:"text-left",children:[r.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:n}),r.jsx("p",{className:K("text-lg font-bold font-mono leading-tight",f.iconColor),children:a})]})]})}function $A(){const{t:n}=_t(),a=Dd(),{data:s,isLoading:l}=GA(),{data:c,isLoading:f}=FA();if(l||f)return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"rounded-xl border p-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(Ge,{className:"h-12 w-12 rounded-lg"}),r.jsxs("div",{children:[r.jsx(Ge,{className:"h-7 w-[180px] mb-2"}),r.jsx(Ge,{className:"h-4 w-[220px]"})]})]}),r.jsx("div",{className:"flex items-center gap-3",children:[1,2,3,4].map(m=>r.jsx(Ge,{className:"h-14 w-28 rounded-lg"},m))})]}),r.jsxs("div",{className:"border rounded-xl overflow-hidden",children:[r.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center justify-between",children:[r.jsx(Ge,{className:"h-4 w-32"}),r.jsx(Ge,{className:"h-4 w-20"})]}),r.jsx("div",{className:"px-4 py-3 border-b",children:r.jsx(Ge,{className:"h-2 w-full rounded-full"})}),[1,2,3].map(m=>r.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-3 border-b last:border-b-0",children:[r.jsx(Ge,{className:"w-2.5 h-2.5 rounded-full"}),r.jsx(Ge,{className:"h-4 flex-1"}),r.jsx(Ge,{className:"h-1.5 w-24 rounded-full"}),r.jsx(Ge,{className:"h-4 w-16"})]},m))]})]});const h=s?.health?QA[s.health.status]:void 0;return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"relative overflow-hidden rounded-xl border bg-gradient-to-br from-background via-background to-muted/30",children:[r.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:r.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),r.jsxs("div",{className:"relative p-6 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[r.jsx(ek,{version:s?.version}),r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(nr,{title:n("home.profiles"),value:s?.profiles??0,icon:Yy,variant:"accent",onClick:()=>a("/providers")}),r.jsx(nr,{title:n("home.cliproxy"),value:s?.cliproxy??0,icon:Vy,variant:"accent",onClick:()=>a("/cliproxy")}),r.jsx(nr,{title:n("home.accounts"),value:s?.accounts??0,icon:Wy,variant:"default",onClick:()=>a("/accounts")}),r.jsx(nr,{title:n("home.health"),value:s?.health?`${s.health.passed}/${s.health.total}`:"-",icon:Ds,variant:h,onClick:()=>a("/health")})]})]})]}),c?.symlinkStatus&&!c.symlinkStatus.valid&&r.jsxs(lf,{variant:"warning",children:[r.jsx(qn,{className:"h-4 w-4"}),r.jsx(Vx,{children:n("home.configurationRequired")}),r.jsx(rf,{children:c.symlinkStatus.message})]}),r.jsx(Vk,{}),r.jsx(KA,{})]})}const $x=uS,cf=S.forwardRef(({className:n,...a},s)=>r.jsx(By,{ref:s,className:K("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...a}));cf.displayName=By.displayName;const mr=S.forwardRef(({className:n,...a},s)=>r.jsx(Ky,{ref:s,className:K("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n),...a}));mr.displayName=Ky.displayName;const Ad=S.forwardRef(({className:n,...a},s)=>r.jsx(qy,{ref:s,className:K("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...a}));Ad.displayName=qy.displayName;function ln({className:n,...a}){return r.jsx(dS,{"data-slot":"label",className:K("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...a})}const uf="ccs:openrouter-models",XA=1440*60*1e3,Xx="1";function Td(n){const a=parseFloat(n);return isNaN(a)||a===0?0:a*1e6}function iy(n){const a=Td(n);return a===0?"Free":a<.01?"<$0.01":a<1?`$${a.toFixed(2)}`:`$${a.toFixed(a<10?2:0)}`}function ZA(n){const a=iy(n.prompt),s=iy(n.completion);return a==="Free"&&s==="Free"?"Free":`${a}/${s}`}function JA(n){const a=n.id.toLowerCase();return a.startsWith("anthropic/")?"anthropic":a.startsWith("openai/")?"openai":a.startsWith("google/")?"google":a.startsWith("meta-llama/")||a.startsWith("meta/")?"meta":a.startsWith("mistralai/")?"mistral":a.includes(":free")||a.includes("qwen")||a.includes("deepseek")?"opensource":"other"}function eT(n){return{...n,category:JA(n),pricePerMillionPrompt:Td(n.pricing.prompt),pricePerMillionCompletion:Td(n.pricing.completion),isFree:n.pricing.prompt==="0"&&n.pricing.completion==="0",isExacto:n.id.includes(":exacto")}}function tT(n,a,s){const l=a.toLowerCase().trim();return n.filter(c=>s?.category&&c.category!==s.category||s?.freeOnly&&!c.isFree||s?.minContext&&c.context_length<s.minContext?!1:l?c.id.toLowerCase().includes(l)||c.name.toLowerCase().includes(l)||c.description?.toLowerCase().includes(l):!0)}function ID(n){return[...n].sort((a,s)=>{if(a.isFree&&!s.isFree)return-1;if(!a.isFree&&s.isFree)return 1;if(!a.isFree&&!s.isFree){if(a.isExacto&&!s.isExacto)return-1;if(!a.isExacto&&s.isExacto)return 1}return a.name.localeCompare(s.name)})}function nT(){try{const n=localStorage.getItem(uf);if(!n)return null;const a=JSON.parse(n);return a.version!==Xx||Date.now()-a.fetchedAt>XA?null:a.models}catch{return null}}function aT(n){try{localStorage.setItem(uf,JSON.stringify({models:n,fetchedAt:Date.now(),version:Xx}))}catch{}}function iT(){localStorage.removeItem(uf)}function HD(n,a){const[s]=n.split("/");if(!s)return{};const l=a.filter(h=>h.id.startsWith(`${s}/`));if(l.length===0)return{};const c=[...l].sort((h,m)=>m.pricePerMillionPrompt-h.pricePerMillionPrompt),f=Math.ceil(c.length/3);return{opus:c[0]?.id,sonnet:c[Math.min(f,c.length-1)]?.id,haiku:c[c.length-1]?.id}}function oT(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}const BD={anthropic:"Anthropic (Claude)",openai:"OpenAI (GPT)",google:"Google (Gemini)",meta:"Meta (Llama)",mistral:"Mistral",opensource:"Open Source",other:"Other"},sT={anthropic:["anthropic/"],openai:["openai/"],google:["google/"],meta:["meta-llama/","meta/"],mistral:["mistralai/"],opensource:["deepseek/","qwen/","cohere/"],other:[]};function lT(n,a=2){const s=[],l=["anthropic","openai","google","meta","mistral","opensource"];for(const c of l){const f=sT[c];if(f.length===0)continue;const m=[...n.filter(p=>f.some(y=>p.id.toLowerCase().startsWith(y)))].sort((p,y)=>(y.created??0)-(p.created??0));s.push(...m.slice(0,a))}return s.sort((c,f)=>(f.created??0)-(c.created??0))}function rT(n){const s=Date.now()/1e3-n;return s<86400?"Today":s<172800?"Yesterday":s<604800?`${Math.floor(s/86400)}d ago`:s<2592e3?`${Math.floor(s/604800)}w ago`:s<31536e3?`${Math.floor(s/2592e3)}mo ago`:`${Math.floor(s/31536e3)}y ago`}const cT="https://openrouter.ai/api/v1/models",Zx=["openrouter-models"],oy=1440*60*1e3;async function uT(){const n=await fetch(cT);if(!n.ok)throw new Error(`Failed to fetch OpenRouter models: ${n.status}`);const s=(await n.json()).data;return aT(s),s}function Jx(){return Tt({queryKey:Zx,queryFn:uT,staleTime:oy,gcTime:oy,initialData:()=>nT()??void 0,refetchOnWindowFocus:!1})}function dT(){const n=Jx(),a=(n.data??[]).map(eT);return{...n,models:a}}function KD(){const n=it();return()=>(iT(),n.invalidateQueries({queryKey:Zx}))}function qD(){const{data:n,isLoading:a,isError:s}=Jx();return{isReady:!!n&&n.length>0,isLoading:a,isError:s,modelCount:n?.length??0}}function df({profileEnv:n={}}){const[a,s]=S.useState(null),[l,c]=S.useState(!0),[f,h]=S.useState(!1);S.useEffect(()=>{m()},[]);const m=async()=>{try{c(!0);const v=await fetch("/api/global-env");if(!v.ok)throw new Error("Failed to load");const N=await v.json();s(N)}catch{s(null)}finally{c(!1)}};if(l||!a?.enabled)return null;const p=a.env||{},y=Object.keys(p);if(y.length===0)return null;const C=y.filter(v=>!(v in n)),x=y.filter(v=>v in n);return r.jsxs("div",{className:"border-t bg-muted/20",children:[r.jsxs("button",{onClick:()=>h(!f),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",children:[r.jsx(Nr,{className:"w-4 h-4 text-blue-500"}),r.jsxs("span",{className:"text-xs text-muted-foreground flex-1 text-left",children:[r.jsx("span",{className:"font-medium text-foreground",children:C.length})," global env var",C.length!==1?"s":""," will be injected at runtime",x.length>0&&r.jsxs("span",{className:"text-amber-600 dark:text-amber-400 ml-1",children:["(",x.length," overridden by profile)"]})]}),f?r.jsx(Od,{className:"w-4 h-4 text-muted-foreground"}):r.jsx(vr,{className:"w-4 h-4 text-muted-foreground"})]}),f&&r.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[C.length>0&&r.jsx("div",{className:"space-y-1",children:C.map(v=>r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-green-500/10 text-green-700 dark:text-green-400 px-2 py-1 rounded",children:[r.jsx("span",{className:"text-green-500",children:"+"}),r.jsxs("span",{className:"truncate",children:[v,"=",p[v]]})]},v))}),x.length>0&&r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:"Skipped (profile already defines):"}),x.map(v=>r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-amber-500/10 text-amber-700 dark:text-amber-400 px-2 py-1 rounded",children:[r.jsx("span",{className:"text-amber-500",children:"~"}),r.jsx("span",{className:"truncate",children:v})]},v))]}),r.jsx("div",{className:"pt-2 border-t border-border/50",children:r.jsx(ft,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 text-xs gap-1.5 -ml-2",children:r.jsxs(gd,{to:"/settings?tab=globalenv",children:[r.jsx(Pd,{className:"w-3.5 h-3.5"}),"Configure in Settings",r.jsx($y,{className:"w-3 h-3 opacity-50"})]})})})]})]})}const fT=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function GD({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:s,settings:l,onChange:c,missingRequiredFields:f=[]}){const h=f.length>0;return r.jsx(S.Suspense,{fallback:r.jsxs("div",{className:"flex items-center justify-center h-full",children:[r.jsx(Dn,{className:"w-6 h-6 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:r.jsxs("div",{className:"h-full flex flex-col",children:[!a&&s!==null&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[r.jsx(vo,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&h&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[r.jsx(qn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",r.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:f.join(", ")}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),r.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:r.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:r.jsx(fT,{value:n,onChange:c,language:"json",minHeight:"100%"})})}),r.jsx("div",{className:"mx-6 mb-4",children:r.jsx("div",{className:"border rounded-md overflow-hidden",children:r.jsx(df,{profileEnv:l?.env})})})]})})}function sy(n,a){try{var s=n()}catch(l){return a(l)}return s&&s.then?s.then(void 0,a):s}function hT(n,a){for(var s={};n.length;){var l=n[0],c=l.code,f=l.message,h=l.path.join(".");if(!s[h])if("unionErrors"in l){var m=l.unionErrors[0].errors[0];s[h]={message:m.message,type:m.code}}else s[h]={message:f,type:c};if("unionErrors"in l&&l.unionErrors.forEach(function(C){return C.errors.forEach(function(x){return n.push(x)})}),a){var p=s[h].types,y=p&&p[l.code];s[h]=Zy(h,a,s,c,y?[].concat(y,l.message):l.message)}n.shift()}return s}function mT(n,a){for(var s={};n.length;){var l=n[0],c=l.code,f=l.message,h=l.path.join(".");if(!s[h])if(l.code==="invalid_union"&&l.errors.length>0){var m=l.errors[0][0];s[h]={message:m.message,type:m.code}}else s[h]={message:f,type:c};if(l.code==="invalid_union"&&l.errors.forEach(function(C){return C.forEach(function(x){return n.push(x)})}),a){var p=s[h].types,y=p&&p[l.code];s[h]=Zy(h,a,s,c,y?[].concat(y,l.message):l.message)}n.shift()}return s}function pT(n,a,s){if(s===void 0&&(s={}),(function(l){return"_def"in l&&typeof l._def=="object"&&"typeName"in l._def})(n))return function(l,c,f){try{return Promise.resolve(sy(function(){return Promise.resolve(n[s.mode==="sync"?"parse":"parseAsync"](l,a)).then(function(h){return f.shouldUseNativeValidation&&hg({},f),{errors:{},values:s.raw?Object.assign({},l):h}})},function(h){if((function(m){return Array.isArray(m?.issues)})(h))return{values:{},errors:mg(hT(h.errors,!f.shouldUseNativeValidation&&f.criteriaMode==="all"),f)};throw h}))}catch(h){return Promise.reject(h)}};if((function(l){return"_zod"in l&&typeof l._zod=="object"})(n))return function(l,c,f){try{return Promise.resolve(sy(function(){return Promise.resolve((s.mode==="sync"?UC:IC)(n,l,a)).then(function(h){return f.shouldUseNativeValidation&&hg({},f),{errors:{},values:s.raw?Object.assign({},l):h}})},function(h){if((function(m){return m instanceof HC})(h))return{values:{},errors:mg(mT(h.issues,!f.shouldUseNativeValidation&&f.criteriaMode==="all"),f)};throw h}))}catch(h){return Promise.reject(h)}};throw new Error("Invalid input: not a Zod schema")}function YD(){return Tt({queryKey:["profiles"],queryFn:()=>Be.profiles.list()})}function gT(){const n=it();return et({mutationFn:a=>Be.profiles.create(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),re.success("Profile created successfully")},onError:a=>{re.error(a.message)}})}function VD(){const n=it();return et({mutationFn:a=>Be.profiles.delete(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),re.success("Profile deleted successfully")},onError:a=>{re.error(a.message)}})}function FD(){return et({mutationFn:()=>Be.profiles.discoverOrphans()})}function QD(){const n=it();return et({mutationFn:a=>Be.profiles.registerOrphans(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),re.success("Orphan profiles registration complete")}})}function WD(){const n=it();return et({mutationFn:({name:a,data:s})=>Be.profiles.copy(a,s),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),re.success("Profile copied successfully")}})}function $D(){return et({mutationFn:({name:n,includeSecrets:a})=>Be.profiles.export(n,a??!1)})}function XD(){const n=it();return et({mutationFn:a=>Be.profiles.import(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),re.success("Profile imported successfully")}})}const yT="https://openrouter.ai/api",eb=Object.freeze({kimi:"km",alibaba:"alibaba-coding-plan",acp:"alibaba-coding-plan"}),tb=[{id:"anthropic",name:"Anthropic (Direct API)",description:"Use your own Anthropic API key (sk-ant-...)",baseUrl:"",defaultProfileName:"anthropic",defaultModel:"claude-sonnet-4-5-20250929",apiKeyPlaceholder:"sk-ant-api03-...",apiKeyHint:"Get key at console.anthropic.com/settings/keys",category:"recommended",requiresApiKey:!0,badge:"Direct",featured:!0},{id:"openrouter",name:"OpenRouter",description:"349+ models from OpenAI, Anthropic, Google, Meta",baseUrl:yT,defaultProfileName:"openrouter",defaultModel:"anthropic/claude-opus-4.5",apiKeyPlaceholder:"sk-or-...",apiKeyHint:"Get your API key at openrouter.ai/keys",category:"recommended",requiresApiKey:!0,badge:"349+ models",featured:!0,icon:"/icons/openrouter.svg"},{id:"alibaba-coding-plan",name:"Alibaba Coding Plan",description:"Alibaba Cloud Coding Plan via Anthropic-compatible endpoint",baseUrl:"https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",defaultProfileName:"albb",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-sp-...",apiKeyHint:"Get your Coding Plan key from Alibaba Cloud Model Studio",category:"recommended",requiresApiKey:!0,badge:"Coding Plan",featured:!0,icon:"/assets/providers/alibabacloud-color.svg"},{id:"ollama",name:"Ollama (Local)",description:"Local open-source models via Ollama (32K+ context)",baseUrl:"http://localhost:11434",defaultProfileName:"ollama",defaultModel:"qwen3-coder",apiKeyPlaceholder:"ollama",apiKeyHint:"Install Ollama from ollama.com - no API key needed for local",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0,icon:"/icons/ollama.svg"},{id:"llamacpp",name:"llama.cpp (Local)",description:"Local inference via llama.cpp (LLaMA models)",baseUrl:"http://127.0.0.1:8080",defaultProfileName:"llamacpp",defaultModel:"llama3-8b",apiKeyPlaceholder:"llamacpp",apiKeyHint:"Run llama.cpp server: ./server --host 0.0.0.0 --port 8080 -m model.gguf",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0},{id:"glm",name:"GLM",description:"Claude via Z.AI",baseUrl:"https://api.z.ai/api/anthropic",defaultProfileName:"glm",defaultModel:"glm-5",apiKeyPlaceholder:"ghp_...",apiKeyHint:"Get your API key from Z.AI",category:"alternative",requiresApiKey:!0,badge:"Z.AI",icon:"/icons/zai.svg"},{id:"glmt",name:"GLMT",description:"GLM with Thinking mode support",baseUrl:"https://api.z.ai/api/coding/paas/v4/chat/completions",defaultProfileName:"glmt",defaultModel:"glm-5",apiKeyPlaceholder:"ghp_...",apiKeyHint:"Same API key as GLM",category:"alternative",requiresApiKey:!0,extraEnv:{ANTHROPIC_TEMPERATURE:"0.2",ANTHROPIC_MAX_TOKENS:"65536",MAX_THINKING_TOKENS:"32768",ENABLE_STREAMING:"true",ANTHROPIC_SAFE_MODE:"false",API_TIMEOUT_MS:"3000000"},alwaysThinkingEnabled:!0,badge:"Thinking",icon:"/icons/zai.svg"},{id:"km",name:"Kimi",description:"Moonshot AI - Fast reasoning model",baseUrl:"https://api.kimi.com/coding/",defaultProfileName:"km",defaultModel:"kimi-k2-thinking-turbo",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Moonshot AI",category:"alternative",requiresApiKey:!0,alwaysThinkingEnabled:!0,badge:"Reasoning",icon:"/icons/kimi.svg"},{id:"foundry",name:"Azure Foundry",description:"Claude via Microsoft Azure AI Foundry",baseUrl:"https://<your-resource>.services.ai.azure.com/api/anthropic",defaultProfileName:"foundry",defaultModel:"claude-sonnet-4-5",apiKeyPlaceholder:"YOUR_AZURE_API_KEY",apiKeyHint:"Create resource at ai.azure.com, get API key from Keys tab",category:"alternative",requiresApiKey:!0,badge:"Azure",icon:"/icons/azure.svg"},{id:"mm",name:"Minimax",description:"M2.1/M2.1-lightning/M2 - multilang coding (1M context)",baseUrl:"https://api.minimax.io/anthropic",defaultProfileName:"mm",defaultModel:"MiniMax-M2.1",apiKeyPlaceholder:"YOUR_MINIMAX_API_KEY_HERE",apiKeyHint:"Get your API key at platform.minimax.io",category:"alternative",requiresApiKey:!0,badge:"1M context",icon:"/icons/minimax.svg"},{id:"deepseek",name:"DeepSeek",description:"V3.2 and R1 reasoning model (128K context)",baseUrl:"https://api.deepseek.com/anthropic",defaultProfileName:"deepseek",defaultModel:"deepseek-chat",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key at platform.deepseek.com",category:"alternative",requiresApiKey:!0,badge:"Reasoning",icon:"/icons/deepseek.svg"},{id:"qwen",name:"Qwen",description:"Alibaba Cloud - Qwen3 models (256K-1M context, thinking support)",baseUrl:"https://dashscope-intl.aliyuncs.com/apps/anthropic",defaultProfileName:"qwen-api",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Alibaba Cloud Model Studio",category:"alternative",requiresApiKey:!0,badge:"Alibaba",icon:"/assets/providers/qwen-color.svg"},{id:"ollama-cloud",name:"Ollama Cloud",description:"Ollama cloud models via direct API (glm-5:cloud, minimax-m2.1:cloud)",baseUrl:"https://ollama.com",defaultProfileName:"ollama-cloud",defaultModel:"glm-5:cloud",apiKeyPlaceholder:"YOUR_OLLAMA_CLOUD_API_KEY",apiKeyHint:"Get your API key at ollama.com",category:"alternative",requiresApiKey:!0,badge:"Cloud",icon:"/icons/ollama.svg"}];function nb(n){return{...n,extraEnv:n.extraEnv?{...n.extraEnv}:void 0}}function xT(n){const a=nb(n);return a.extraEnv&&Object.freeze(a.extraEnv),Object.freeze(a)}function bT(n,a){const s=new Set;for(const c of n){const f=c.id.trim().toLowerCase();if(c.id!==f)throw new Error(`Preset ID must be normalized: "${c.id}"`);if(s.has(c.id))throw new Error(`Duplicate preset ID detected: "${c.id}"`);s.add(c.id)}const l=new Set;for(const[c,f]of Object.entries(a)){const h=c.trim().toLowerCase();if(!h)throw new Error("Preset alias keys cannot be empty");if(c!==h)throw new Error(`Preset alias must be normalized: "${c}"`);if(l.has(h))throw new Error(`Duplicate normalized preset alias detected: "${c}"`);if(l.add(h),!s.has(f))throw new Error(`Preset alias "${c}" points to unknown target "${f}"`);if(s.has(h))throw new Error(`Preset alias "${c}" collides with canonical preset ID "${h}"`)}}bT(tb,eb);const vT=Object.freeze(tb.map(xT));function ST(){return vT.map(nb)}function CT(n){const a=n.trim().toLowerCase();return eb[a]||a}const wT=ST(),ff=Object.freeze(wT.map(n=>({...n})));function NT(n,a){return a||(n?.requiresApiKey===!1?n.apiKeyPlaceholder||n.id:"")}function kT(n){return ff.filter(a=>a.category===n)}function rd(n){const a=CT(n);return ff.find(s=>s.id===a)}const AT=Va().refine(n=>n.trim().length===0||Va().url().safeParse(n).success,{message:"Invalid URL format"}),TT=BC({name:Va().min(1,"Name is required").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Must start with letter, only letters/numbers/.-_"),baseUrl:AT,apiKey:Va(),model:Va().optional(),opusModel:Va().optional(),sonnetModel:Va().optional(),haikuModel:Va().optional(),target:KC(["claude","droid"])}),jT=["/chat/completions","/v1/messages","/messages","/completions"],pa="custom",cd="openrouter",ud={name:"",baseUrl:"",apiKey:"",model:"",opusModel:"",sonnetModel:"",haikuModel:"",target:"claude"},MT=kT("recommended"),ab=ff.filter(n=>n.category!=="recommended"),DT=new Set(ab.map(n=>n.id));function ZD({open:n,onOpenChange:a,onSuccess:s,initialMode:l="openrouter"}){const{t:c}=_t(),f=gT(),[h,m]=S.useState("basic"),[p,y]=S.useState(null),[C,x]=S.useState(!1),[v,N]=S.useState(cd),[w,M]=S.useState(""),{models:E}=dT(),{register:j,handleSubmit:H,formState:{errors:B},control:U,reset:O,setValue:k}=qC({resolver:pT(TT),defaultValues:ud}),z=pg({control:U,name:"baseUrl"}),X=pg({control:U,name:"target"}),W=S.useCallback($=>{if(!$){O(ud);return}O({...ud,name:$.defaultProfileName,baseUrl:$.baseUrl,model:$.defaultModel,opusModel:$.defaultModel,sonnetModel:$.defaultModel,haikuModel:$.defaultModel})},[O]),Q=S.useMemo(()=>v===pa?null:rd(v)??null,[v]),ae=S.useMemo(()=>w.trim()?[...tT(E,w)].sort((se,ne)=>(ne.created??0)-(se.created??0)).slice(0,20):lT(E,2),[E,w]);S.useEffect(()=>{if(n)if(m("basic"),y(null),x(!1),M(""),l==="normal")N(pa),W(null);else{const se=rd(l==="openrouter"?cd:l);if(se){N(se.id),W(se);return}N(pa),W(null)}},[n,l,W]);const ee=$=>{const se=rd($);if(se){N(se.id),W(se);return}N(pa),W(null)},ye=$=>{k("model",$.id),k("opusModel",$.id),k("sonnetModel",$.id),k("haikuModel",$.id),M($.name),re.success(`Applied "${$.name}" to all model tiers`,{duration:2e3})};S.useEffect(()=>{if(z&&v===pa){const se=z.toLowerCase();for(const ne of jT)if(se.endsWith(ne)){const Ne=z.replace(new RegExp(ne+"$","i"),"");y(`URL ends with "${ne}" - Claude appends this automatically. You likely want: ${Ne}`);return}}y(null)},[z,v]);const fe=async $=>{if(Q?.requiresApiKey!==!1&&!$.apiKey){re.error(He.t("commonToast.apiKeyRequired"));return}const se={...$,apiKey:NT(Q,$.apiKey)};try{await f.mutateAsync(se),re.success(`Profile "${se.name}" created`),s(se.name),a(!1)}catch(ne){re.error(ne.message||"Failed to create profile")}},Ce=!!B.name||!!B.baseUrl||!!B.apiKey,R=!!B.model||!!B.opusModel||!!B.sonnetModel||!!B.haikuModel,V=v!==pa&&DT.has(v),ie=Q?.id===cd;return r.jsx(qd,{open:n,onOpenChange:a,children:r.jsxs(Gd,{className:"sm:max-w-[700px] p-0 gap-0 overflow-hidden max-h-[90vh] !flex !flex-col",children:[r.jsxs(Yd,{className:"p-6 pb-4 border-b",children:[r.jsxs(Vd,{className:"flex items-center gap-2",children:[r.jsx(dg,{className:"w-5 h-5 text-primary"}),"Create API Profile"]}),r.jsx(Fd,{children:"Choose a provider or configure a custom API endpoint."})]}),r.jsxs("form",{onSubmit:H(fe),className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[r.jsxs("div",{className:"px-6 py-3 border-b bg-muted/30 space-y-2",children:[r.jsxs("div",{children:[r.jsx(ln,{className:"text-xs text-muted-foreground mb-1.5 block",children:c("profileEditor.provider")}),r.jsxs("div",{className:"flex gap-2",children:[MT.map($=>r.jsx(ly,{preset:$,isSelected:v===$.id,onClick:()=>ee($.id)},$.id)),r.jsxs("button",{type:"button",onClick:()=>ee(pa),className:K("flex items-center gap-2 px-4 py-2 rounded-md border-2 transition-all text-sm font-medium",v===pa||V?"border-primary bg-primary/10 text-primary dark:bg-primary/20":"border-dashed border-muted-foreground/40 hover:border-primary/50 hover:bg-muted/50 text-muted-foreground hover:text-foreground"),children:[r.jsx(Pd,{className:"w-4 h-4"}),r.jsx("span",{children:c("profileEditor.custom")})]})]})]}),(v===pa||V)&&r.jsxs("div",{className:"pt-3 mt-2 border-t border-dashed border-muted-foreground/30",children:[r.jsx(ln,{className:"text-xs font-medium text-foreground/70 mb-2 block",children:"Quick Templates"}),r.jsx("div",{className:"flex gap-2 flex-wrap",children:ab.map($=>r.jsx(ly,{preset:$,isSelected:v===$.id,onClick:()=>ee($.id)},$.id))})]})]}),r.jsxs($x,{value:h,onValueChange:m,className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[r.jsx("div",{className:"px-6 pt-4",children:r.jsxs(cf,{className:"grid w-full grid-cols-2",children:[r.jsxs(mr,{value:"basic",className:"relative",children:["Basic Information",Ce&&r.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]}),r.jsxs(mr,{value:"models",className:"relative",children:["Model Configuration",R&&r.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]})]})}),r.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[r.jsxs(Ad,{value:"basic",className:"p-6 space-y-4 mt-0",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"name",children:["Profile Name ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Un,{id:"name",...j("name"),placeholder:"my-api",className:"font-mono"}),B.name?r.jsx("p",{className:"text-xs text-destructive",children:B.name.message}):r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in CLI:"," ",r.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:'ccs my-api "prompt"'})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ln,{htmlFor:"baseUrl",children:"API Base URL"}),r.jsx(Un,{id:"baseUrl",...j("baseUrl"),placeholder:"https://api.example.com/v1"}),B.baseUrl?r.jsx("p",{className:"text-xs text-destructive",children:B.baseUrl.message}):p?r.jsxs("div",{className:"flex items-start gap-2 text-xs text-yellow-600 bg-yellow-50 dark:bg-yellow-900/20 p-2 rounded",children:[r.jsx(qn,{className:"w-4 h-4 shrink-0 mt-0.5"}),r.jsx("span",{children:p})]}):Q?r.jsx("p",{className:"text-xs text-muted-foreground",children:Q.baseUrl?`Pre-filled from ${Q.name}. You can customize if needed.`:`Optional for ${Q.name}. Leave blank to use native Anthropic auth.`}):r.jsx("p",{className:"text-xs text-muted-foreground",children:"The endpoint that accepts OpenAI-compatible and Anthropic requests"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"apiKey",children:["API Key"," ",Q?.requiresApiKey!==!1&&r.jsx("span",{className:"text-destructive",children:"*"}),Q?.requiresApiKey===!1&&r.jsx("span",{className:"text-muted-foreground text-xs font-normal",children:"(optional)"})]}),r.jsxs("div",{className:"relative",children:[r.jsx(Un,{id:"apiKey",type:C?"text":"password",...j("apiKey"),placeholder:Q?.requiresApiKey===!1?"Optional - only if auth is enabled":Q?.apiKeyPlaceholder??"sk-...",className:"pr-10"}),r.jsx(ft,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 text-muted-foreground hover:text-foreground",onClick:()=>x(!C),tabIndex:-1,children:C?r.jsx(xr,{className:"h-4 w-4"}):r.jsx(br,{className:"h-4 w-4"})})]}),B.apiKey?r.jsx("p",{className:"text-xs text-destructive",children:B.apiKey.message}):Q?.requiresApiKey===!1?r.jsx("p",{className:"text-xs text-muted-foreground",children:"Only needed if your local endpoint has authentication enabled"}):Q?.apiKeyHint&&r.jsx("p",{className:"text-xs text-muted-foreground",children:Q.apiKeyHint})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(ln,{htmlFor:"target",children:"Default Target CLI"}),r.jsxs(bx,{value:X,onValueChange:$=>k("target",$),children:[r.jsx(Zd,{id:"target",children:r.jsx(vx,{})}),r.jsxs(Jd,{children:[r.jsx(dr,{value:"claude",children:"Claude Code (default)"}),r.jsx(dr,{value:"droid",children:"Factory Droid"})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Run with"," ",r.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:X==="droid"?"ccsd":"ccs"})," ","by default. You can still override each run with"," ",r.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"--target"}),"."]})]})]}),r.jsxs(Ad,{value:"models",className:"p-6 mt-0 space-y-4",children:[r.jsxs("div",{className:"flex items-start gap-3 p-3 bg-blue-50 dark:bg-blue-950/20 text-blue-800 dark:text-blue-300 rounded-md text-sm border border-blue-100 dark:border-blue-900/30",children:[r.jsx(Nr,{className:"w-5 h-5 shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium mb-1",children:"Model Mapping"}),r.jsx("p",{className:"text-xs opacity-90",children:"Map Claude Code tiers (Opus/Sonnet/Haiku) to models supported by your provider."})]})]}),ie&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(ln,{children:"Search Models"}),r.jsx(Un,{value:w,onChange:$=>M($.target.value),placeholder:"Type to search (e.g., opus, sonnet, gpt-4o)...",onKeyDown:$=>{$.key==="Enter"&&ae.length>0&&($.preventDefault(),ye(ae[0]))}}),r.jsx("div",{className:"border rounded-md max-h-48 overflow-y-auto",children:ae.length===0?r.jsx("p",{className:"text-sm text-muted-foreground p-3 text-center",children:w?`No models found for "${w}"`:"Loading models..."}):r.jsxs("div",{className:"p-1",children:[!w&&r.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground",children:[r.jsx(JS,{className:"w-3 h-3 text-accent"}),r.jsx("span",{children:"Newest Models"})]}),ae.map($=>r.jsx(ET,{model:$,onClick:()=>ye($),showAge:!w},$.id))]})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"model",children:["Default Model",r.jsx(Wa,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"ANTHROPIC_MODEL"})]}),r.jsx(Un,{id:"model",...j("model"),placeholder:Q?.defaultModel??"claude-sonnet-4",className:"font-mono text-sm"})]}),r.jsxs("div",{className:"grid gap-3 pt-2 border-t",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"sonnetModel",className:"text-sm",children:["Sonnet Mapping",r.jsx(Wa,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_SONNET"})]}),r.jsx(Un,{id:"sonnetModel",...j("sonnetModel"),placeholder:"e.g. gpt-4o, claude-sonnet-4",className:"font-mono text-sm h-9"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"opusModel",className:"text-sm",children:["Opus Mapping",r.jsx(Wa,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_OPUS"})]}),r.jsx(Un,{id:"opusModel",...j("opusModel"),placeholder:"e.g. o1, claude-opus-4.5",className:"font-mono text-sm h-9"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsxs(ln,{htmlFor:"haikuModel",className:"text-sm",children:["Haiku Mapping",r.jsx(Wa,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_HAIKU"})]}),r.jsx(Un,{id:"haikuModel",...j("haikuModel"),placeholder:"e.g. gpt-4o-mini, claude-3.5-haiku",className:"font-mono text-sm h-9"})]})]})]})]})]}),r.jsxs(S1,{className:"p-6 pt-4 border-t bg-muted/10",children:[r.jsx(ft,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),r.jsx(ft,{type:"submit",disabled:f.isPending,className:K(f.isPending&&"opacity-80"),children:f.isPending?r.jsxs(r.Fragment,{children:[r.jsx(Dn,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):r.jsxs(r.Fragment,{children:[r.jsx(dg,{className:"w-4 h-4 mr-2"}),"Create Profile"]})})]})]})]})]})})}function ly({preset:n,isSelected:a,onClick:s}){return r.jsxs("button",{type:"button",onClick:s,className:K("flex items-center gap-2 px-3 py-2 rounded-md border transition-all text-sm",a?n.featured?"border-accent bg-accent/10 dark:bg-accent/20 font-medium":"border-primary bg-primary/10 dark:bg-primary/20 font-medium":"border-muted-foreground/20 hover:border-muted-foreground/40 hover:bg-muted/50"),children:[n.icon?r.jsx("img",{src:n.icon,alt:"",className:"w-4 h-4"}):r.jsx("div",{className:"w-4 h-4 rounded-full bg-muted-foreground/20 flex items-center justify-center text-[9px] font-bold text-foreground/70",children:n.name.charAt(0)}),r.jsx("span",{className:"font-medium",children:n.name}),n.badge&&r.jsx(Wa,{variant:"secondary",className:"text-[10px] px-1.5 py-0 ml-0.5 bg-muted-foreground/10 text-muted-foreground",children:n.badge})]})}function ET({model:n,onClick:a,showAge:s}){return r.jsxs("button",{type:"button",onClick:a,className:"group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",children:[r.jsx("span",{className:"flex-1 truncate",children:n.name}),r.jsxs("span",{className:"text-muted-foreground group-hover:text-accent-foreground/80 ml-2 flex items-center gap-2 text-xs",children:[s&&n.created&&r.jsx(Wa,{variant:"outline",className:"text-[10px] text-accent group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30",children:rT(n.created)}),n.isFree?r.jsx(Wa,{variant:"secondary",className:"text-xs group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground",children:"Free"}):r.jsx("span",{children:ZA(n.pricing)}),r.jsx("span",{children:oT(n.context_length)})]})]})}function OT({className:n,...a}){return r.jsx("div",{"data-slot":"card",className:K("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...a})}function RT({className:n,...a}){return r.jsx("div",{"data-slot":"card-header",className:K("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...a})}function PT({className:n,...a}){return r.jsx("div",{"data-slot":"card-title",className:K("leading-none font-semibold",n),...a})}function LT({className:n,...a}){return r.jsx("div",{"data-slot":"card-description",className:K("text-muted-foreground text-sm",n),...a})}function _T({className:n,...a}){return r.jsx("div",{"data-slot":"card-content",className:K("px-6",n),...a})}const zT=["agy","claude","gemini","codex","qwen","kimi","iflow","kiro","ghcp"],JD=zT.map(n=>({id:n,name:Xd(n),description:E1(n)})),UT=["provider","auth","variant","success"];function eE(n){return n==="account"?1:UT.indexOf(n)}const IT=S.forwardRef(({className:n,value:a=0,max:s=100,indicatorClassName:l,...c},f)=>{const h=Math.min(Math.max(a/s*100,0),100);return r.jsx("div",{ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":a,className:K("relative h-2 w-full overflow-hidden rounded-full bg-secondary",n),...c,children:r.jsx("div",{className:K("h-full transition-all",l||"bg-primary"),style:{width:`${h}%`}})})});IT.displayName="Progress";const HT=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function tE({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:s,onRawJsonChange:l,profileEnv:c,missingRequiredFields:f=[]}){const h=f.length>0;return r.jsx(S.Suspense,{fallback:r.jsxs("div",{className:"flex items-center justify-center h-full",children:[r.jsx(Dn,{className:"w-6 h-6 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:r.jsxs("div",{className:"h-full flex flex-col",children:[!a&&s!==null&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[r.jsx(vo,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&h&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[r.jsx(qn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",r.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:f.join(", ")}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Apply a preset from Model Config tab or add these fields manually. Without them, Claude Code will fail with 404 errors."})]})]}),r.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:r.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:r.jsx(HT,{value:n,onChange:l,language:"json",minHeight:"100%"})})}),r.jsx("div",{className:"mx-6 mb-4",children:r.jsx("div",{className:"border rounded-md overflow-hidden",children:r.jsx(df,{profileEnv:c})})})]})})}var Vt={},ry;function BT(){if(ry)return Vt;ry=1;var n=Vt&&Vt.__assign||function(){return n=Object.assign||function(O){for(var k,z=1,X=arguments.length;z<X;z++){k=arguments[z];for(var W in k)Object.prototype.hasOwnProperty.call(k,W)&&(O[W]=k[W])}return O},n.apply(this,arguments)},a=Vt&&Vt.__createBinding||(Object.create?(function(O,k,z,X){X===void 0&&(X=z);var W=Object.getOwnPropertyDescriptor(k,z);(!W||("get"in W?!k.__esModule:W.writable||W.configurable))&&(W={enumerable:!0,get:function(){return k[z]}}),Object.defineProperty(O,X,W)}):(function(O,k,z,X){X===void 0&&(X=z),O[X]=k[z]})),s=Vt&&Vt.__setModuleDefault||(Object.create?(function(O,k){Object.defineProperty(O,"default",{enumerable:!0,value:k})}):function(O,k){O.default=k}),l=Vt&&Vt.__importStar||function(O){if(O&&O.__esModule)return O;var k={};if(O!=null)for(var z in O)z!=="default"&&Object.prototype.hasOwnProperty.call(O,z)&&a(k,O,z);return s(k,O),k},c=Vt&&Vt.__rest||function(O,k){var z={};for(var X in O)Object.prototype.hasOwnProperty.call(O,X)&&k.indexOf(X)<0&&(z[X]=O[X]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var W=0,X=Object.getOwnPropertySymbols(O);W<X.length;W++)k.indexOf(X[W])<0&&Object.prototype.propertyIsEnumerable.call(O,X[W])&&(z[X[W]]=O[X[W]]);return z};Object.defineProperty(Vt,"__esModule",{value:!0});var f=l(Md()),h=89,m=90,p=77,y=57,C=219,x=222,v=192,N=100,w=3e3,M=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),E=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),j="npm__react-simple-code-editor__textarea",H=`
15
+ /**
16
+ * Reset the text fill color so that placeholder is visible
17
+ */
18
+ .`.concat(j,`:empty {
19
+ -webkit-text-fill-color: inherit !important;
20
+ }
21
+
22
+ /**
23
+ * Hack to apply on some CSS on IE10 and IE11
24
+ */
25
+ @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
26
+ /**
27
+ * IE doesn't support '-webkit-text-fill-color'
28
+ * So we use 'color: transparent' to make the text transparent on IE
29
+ * Unlike other browsers, it doesn't affect caret color in IE
30
+ */
31
+ .`).concat(j,` {
32
+ color: transparent !important;
33
+ }
34
+
35
+ .`).concat(j,`::selection {
36
+ background-color: #accef7 !important;
37
+ color: transparent !important;
38
+ }
39
+ }
40
+ `),B=f.forwardRef(function(k,z){var X=k.autoFocus,W=k.disabled,Q=k.form,ae=k.highlight,ee=k.ignoreTabKey,ye=ee===void 0?!1:ee,fe=k.insertSpaces,Ce=fe===void 0?!0:fe,R=k.maxLength,V=k.minLength,ie=k.name,$=k.onBlur,se=k.onClick,ne=k.onFocus,Ne=k.onKeyDown,F=k.onKeyUp,J=k.onValueChange,ce=k.padding,te=ce===void 0?0:ce,le=k.placeholder,xe=k.preClassName,Pe=k.readOnly,Ye=k.required,St=k.style,Ct=k.tabSize,Fe=Ct===void 0?2:Ct,ot=k.textareaClassName,Ut=k.textareaId,Qt=k.value,Yn=c(k,["autoFocus","disabled","form","highlight","ignoreTabKey","insertSpaces","maxLength","minLength","name","onBlur","onClick","onFocus","onKeyDown","onKeyUp","onValueChange","padding","placeholder","preClassName","readOnly","required","style","tabSize","textareaClassName","textareaId","value"]),Te=f.useRef({stack:[],offset:-1}),Wt=f.useRef(null),En=f.useState(!0),$t=En[0],Sa=En[1],Vn={paddingTop:typeof te=="object"?te.top:te,paddingRight:typeof te=="object"?te.right:te,paddingBottom:typeof te=="object"?te.bottom:te,paddingLeft:typeof te=="object"?te.left:te},ht=ae(Qt),Xt=function(Z,De){return Z.substring(0,De).split(`
41
+ `)},Fn=f.useCallback(function(Z,De){var be,Ee,st;De===void 0&&(De=!1);var me=Te.current,Ae=me.stack,ve=me.offset;if(Ae.length&&ve>-1){Te.current.stack=Ae.slice(0,ve+1);var Oe=Te.current.stack.length;if(Oe>N){var tt=Oe-N;Te.current.stack=Ae.slice(tt,Oe),Te.current.offset=Math.max(Te.current.offset-tt,0)}}var we=Date.now();if(De){var Pt=Te.current.stack[Te.current.offset];if(Pt&&we-Pt.timestamp<w){var Wn=/[^a-z0-9]([a-z0-9]+)$/i,Nt=(be=Xt(Pt.value,Pt.selectionStart).pop())===null||be===void 0?void 0:be.match(Wn),Zt=(Ee=Xt(Z.value,Z.selectionStart).pop())===null||Ee===void 0?void 0:Ee.match(Wn);if(Nt?.[1]&&(!((st=Zt?.[1])===null||st===void 0)&&st.startsWith(Nt[1]))){Te.current.stack[Te.current.offset]=n(n({},Z),{timestamp:we});return}}}Te.current.stack.push(n(n({},Z),{timestamp:we})),Te.current.offset++},[]),ei=f.useCallback(function(){var Z=Wt.current;if(Z){var De=Z.value,be=Z.selectionStart,Ee=Z.selectionEnd;Fn({value:De,selectionStart:be,selectionEnd:Ee})}},[Fn]),On=function(Z){var De=Wt.current;De&&(De.value=Z.value,De.selectionStart=Z.selectionStart,De.selectionEnd=Z.selectionEnd,J?.(Z.value))},Rn=function(Z){var De=Wt.current,be=Te.current.stack[Te.current.offset];be&&De&&(Te.current.stack[Te.current.offset]=n(n({},be),{selectionStart:De.selectionStart,selectionEnd:De.selectionEnd})),Fn(Z),On(Z)},Ti=function(){var Z=Te.current,De=Z.stack,be=Z.offset,Ee=De[be-1];Ee&&(On(Ee),Te.current.offset=Math.max(be-1,0))},wo=function(){var Z=Te.current,De=Z.stack,be=Z.offset,Ee=De[be+1];Ee&&(On(Ee),Te.current.offset=Math.min(be+1,De.length-1))},No=function(Z){if(!(Ne&&(Ne(Z),Z.defaultPrevented))){Z.key==="Escape"&&Z.currentTarget.blur();var De=Z.currentTarget,be=De.value,Ee=De.selectionStart,st=De.selectionEnd,me=(Ce?" ":" ").repeat(Fe);if(Z.key==="Tab"&&!ye&&$t)if(Z.preventDefault(),Z.shiftKey){var Ae=Xt(be,Ee),ve=Ae.length-1,Oe=Xt(be,st).length-1,tt=be.split(`
42
+ `).map(function($n,ji){return ji>=ve&&ji<=Oe&&$n.startsWith(me)?$n.substring(me.length):$n}).join(`
43
+ `);if(be!==tt){var we=Ae[ve];Rn({value:tt,selectionStart:we?.startsWith(me)?Ee-me.length:Ee,selectionEnd:st-(be.length-tt.length)})}}else if(Ee!==st){var Ae=Xt(be,Ee),Pt=Ae.length-1,Wn=Xt(be,st).length-1,we=Ae[Pt];Rn({value:be.split(`
44
+ `).map(function(To,jo){return jo>=Pt&&jo<=Wn?me+To:To}).join(`
45
+ `),selectionStart:we&&/\S/.test(we)?Ee+me.length:Ee,selectionEnd:st+me.length*(Wn-Pt+1)})}else{var Nt=Ee+me.length;Rn({value:be.substring(0,Ee)+me+be.substring(st),selectionStart:Nt,selectionEnd:Nt})}else if(Z.key==="Backspace"){var Zt=Ee!==st,wn=be.substring(0,Ee);if(wn.endsWith(me)&&!Zt){Z.preventDefault();var Nt=Ee-me.length;Rn({value:be.substring(0,Ee-me.length)+be.substring(st),selectionStart:Nt,selectionEnd:Nt})}}else if(Z.key==="Enter"){if(Ee===st){var ko=Xt(be,Ee).pop(),ti=ko?.match(/^\s+/);if(ti?.[0]){Z.preventDefault();var Ao=`
46
+ `+ti[0],Nt=Ee+Ao.length;Rn({value:be.substring(0,Ee)+Ao+be.substring(st),selectionStart:Nt,selectionEnd:Nt})}}}else if(Z.keyCode===y||Z.keyCode===C||Z.keyCode===x||Z.keyCode===v){var dn=void 0;Z.keyCode===y&&Z.shiftKey?dn=["(",")"]:Z.keyCode===C?Z.shiftKey?dn=["{","}"]:dn=["[","]"]:Z.keyCode===x?Z.shiftKey?dn=['"','"']:dn=["'","'"]:Z.keyCode===v&&!Z.shiftKey&&(dn=["`","`"]),Ee!==st&&dn&&(Z.preventDefault(),Rn({value:be.substring(0,Ee)+dn[0]+be.substring(Ee,st)+dn[1]+be.substring(st),selectionStart:Ee,selectionEnd:st+2}))}else(E?Z.metaKey&&Z.keyCode===m:Z.ctrlKey&&Z.keyCode===m)&&!Z.shiftKey&&!Z.altKey?(Z.preventDefault(),Ti()):(E?Z.metaKey&&Z.keyCode===m&&Z.shiftKey:M?Z.ctrlKey&&Z.keyCode===h:Z.ctrlKey&&Z.keyCode===m&&Z.shiftKey)&&!Z.altKey?(Z.preventDefault(),wo()):Z.keyCode===p&&Z.ctrlKey&&(!E||Z.shiftKey)&&(Z.preventDefault(),Sa(function($n){return!$n}))}},Qn=function(Z){var De=Z.currentTarget,be=De.value,Ee=De.selectionStart,st=De.selectionEnd;Fn({value:be,selectionStart:Ee,selectionEnd:st},!0),J(be)};return f.useEffect(function(){ei()},[ei]),f.useImperativeHandle(z,function(){return{get session(){return{history:Te.current}},set session(Z){Te.current=Z.history}}},[]),f.createElement("div",n({},Yn,{style:n(n({},U.container),St)}),f.createElement("pre",n({className:xe,"aria-hidden":"true",style:n(n(n({},U.editor),U.highlight),Vn)},typeof ht=="string"?{dangerouslySetInnerHTML:{__html:ht+"<br />"}}:{children:ht})),f.createElement("textarea",{ref:function(Z){return Wt.current=Z},style:n(n(n({},U.editor),U.textarea),Vn),className:j+(ot?" ".concat(ot):""),id:Ut,value:Qt,onChange:Qn,onKeyDown:No,onClick:se,onKeyUp:F,onFocus:ne,onBlur:$,disabled:W,form:Q,maxLength:R,minLength:V,name:ie,placeholder:le,readOnly:Pe,required:Ye,autoFocus:X,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),f.createElement("style",{dangerouslySetInnerHTML:{__html:H}}))}),U={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}};return Vt.default=B,Vt}var KT=BT();const qT=bS(KT),GT=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function YT(n){return GT.some(a=>a.test(n))}function VT(n){if(!n.trim())return{valid:!0};try{return JSON.parse(n),{valid:!0}}catch(a){const l=a.message,c=l.match(/position (\d+)/);if(c){const f=parseInt(c[1],10),h=n.substring(0,f).split(`
47
+ `);return{valid:!1,error:l,line:h.length}}return{valid:!1,error:l}}}function ib({value:n,onChange:a,language:s="json",readonly:l=!1,className:c,minHeight:f="300px"}){const{isDark:h}=yx(),[m,p]=S.useState(!1),[y,C]=S.useState(!0),x=S.useMemo(()=>s==="json"?VT(n):{valid:!0},[n,s]),v=S.useCallback(N=>r.jsx(GC,{theme:h?gg.nightOwl:gg.github,code:N,language:s,children:({tokens:w,getLineProps:M,getTokenProps:E})=>{let j=!1;return r.jsx(r.Fragment,{children:w.map((H,B)=>r.jsx("div",{...M({line:H}),className:K(x.line===B+1&&"bg-destructive/20"),children:H.map((U,O)=>{let k=!1;if(U.types.includes("property")){const X=U.content.replace(/['"]/g,"");YT(X)?j=!0:j=!1}else(U.types.includes("string")||U.types.includes("number")||U.types.includes("boolean"))&&j?(k=!0,j=!1):U.types.includes("punctuation")&&U.content!==":"&&U.content!=="["&&U.content!=="{"&&(j=!1);const z=E({token:U});return k&&y&&(z.className=K(z.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),r.jsx("span",{...z},O)})},B))})}}),[h,s,x.line,y]);return r.jsxs("div",{className:K("flex flex-col",c),children:[r.jsxs("div",{className:K("relative rounded-md border overflow-hidden","bg-muted/30",m&&"ring-2 ring-ring ring-offset-2 ring-offset-background",l&&"opacity-70 cursor-not-allowed",!x.valid&&"border-destructive"),style:{minHeight:f},children:[r.jsx(qT,{value:n,onValueChange:l?()=>{}:a,highlight:v,padding:12,disabled:l,onFocus:()=>p(!0),onBlur:()=>p(!1),textareaClassName:K("focus:outline-none font-mono text-sm",l&&"cursor-not-allowed"),preClassName:"font-mono text-sm",style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"0.875rem",minHeight:f}},h?"dark-editor":"light-editor"),r.jsx("div",{className:"absolute top-2 right-2 z-10 opacity-50 hover:opacity-100 transition-opacity",children:r.jsx(ft,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>C(!y),title:y?"Reveal sensitive values":"Mask sensitive values",children:y?r.jsx(br,{className:"h-3 w-3"}):r.jsx(xr,{className:"h-3 w-3"})})})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[x.valid?r.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[r.jsx(Sr,{className:"w-3 h-3 text-green-500"}),"Valid ",s.toUpperCase()]}):r.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[r.jsx(Cr,{className:"w-3 h-3"}),x.error,x.line&&` (line ${x.line})`]}),l&&r.jsx("span",{className:"ml-auto text-muted-foreground",children:"(Read-only)"})]})]})}const hf=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:ib},Symbol.toStringTag,{value:"Module"})),FT={webSearchConfig:null,webSearchStatus:null,webSearchLoading:!0,webSearchStatusLoading:!0,webSearchSaving:!1,webSearchError:null,webSearchSuccess:!1,globalEnvConfig:null,globalEnvLoading:!0,globalEnvSaving:!1,globalEnvError:null,globalEnvSuccess:!1,proxyConfig:null,proxyLoading:!0,proxySaving:!1,proxyError:null,proxySuccess:!1,proxyTestResult:null,proxyTesting:!1,rawConfig:null,rawConfigLoading:!1};function QT(n,a){switch(a.type){case"SET_WEBSEARCH_CONFIG":return{...n,webSearchConfig:a.payload};case"SET_WEBSEARCH_STATUS":return{...n,webSearchStatus:a.payload};case"SET_WEBSEARCH_LOADING":return{...n,webSearchLoading:a.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...n,webSearchStatusLoading:a.payload};case"SET_WEBSEARCH_SAVING":return{...n,webSearchSaving:a.payload};case"SET_WEBSEARCH_ERROR":return{...n,webSearchError:a.payload};case"SET_WEBSEARCH_SUCCESS":return{...n,webSearchSuccess:a.payload};case"SET_GLOBALENV_CONFIG":return{...n,globalEnvConfig:a.payload};case"SET_GLOBALENV_LOADING":return{...n,globalEnvLoading:a.payload};case"SET_GLOBALENV_SAVING":return{...n,globalEnvSaving:a.payload};case"SET_GLOBALENV_ERROR":return{...n,globalEnvError:a.payload};case"SET_GLOBALENV_SUCCESS":return{...n,globalEnvSuccess:a.payload};case"SET_PROXY_CONFIG":return{...n,proxyConfig:a.payload};case"SET_PROXY_LOADING":return{...n,proxyLoading:a.payload};case"SET_PROXY_SAVING":return{...n,proxySaving:a.payload};case"SET_PROXY_ERROR":return{...n,proxyError:a.payload};case"SET_PROXY_SUCCESS":return{...n,proxySuccess:a.payload};case"SET_PROXY_TEST_RESULT":return{...n,proxyTestResult:a.payload};case"SET_PROXY_TESTING":return{...n,proxyTesting:a.payload};case"SET_RAW_CONFIG":return{...n,rawConfig:a.payload};case"SET_RAW_CONFIG_LOADING":return{...n,rawConfigLoading:a.payload};default:return n}}const ob=S.createContext(null);function WT({children:n}){const[a,s]=S.useReducer(QT,FT);return r.jsx(ob.Provider,{value:{state:a,dispatch:s},children:n})}function sb(){const n=S.useContext(ob);if(!n)throw new Error("useSettingsContext must be used within a SettingsProvider");return n}function $T(){const{dispatch:n}=sb(),a=S.useCallback(k=>n({type:"SET_WEBSEARCH_CONFIG",payload:k}),[n]),s=S.useCallback(k=>n({type:"SET_WEBSEARCH_STATUS",payload:k}),[n]),l=S.useCallback(k=>n({type:"SET_WEBSEARCH_LOADING",payload:k}),[n]),c=S.useCallback(k=>n({type:"SET_WEBSEARCH_STATUS_LOADING",payload:k}),[n]),f=S.useCallback(k=>n({type:"SET_WEBSEARCH_SAVING",payload:k}),[n]),h=S.useCallback(k=>n({type:"SET_WEBSEARCH_ERROR",payload:k}),[n]),m=S.useCallback(k=>n({type:"SET_WEBSEARCH_SUCCESS",payload:k}),[n]),p=S.useCallback(k=>n({type:"SET_GLOBALENV_CONFIG",payload:k}),[n]),y=S.useCallback(k=>n({type:"SET_GLOBALENV_LOADING",payload:k}),[n]),C=S.useCallback(k=>n({type:"SET_GLOBALENV_SAVING",payload:k}),[n]),x=S.useCallback(k=>n({type:"SET_GLOBALENV_ERROR",payload:k}),[n]),v=S.useCallback(k=>n({type:"SET_GLOBALENV_SUCCESS",payload:k}),[n]),N=S.useCallback(k=>n({type:"SET_PROXY_CONFIG",payload:k}),[n]),w=S.useCallback(k=>n({type:"SET_PROXY_LOADING",payload:k}),[n]),M=S.useCallback(k=>n({type:"SET_PROXY_SAVING",payload:k}),[n]),E=S.useCallback(k=>n({type:"SET_PROXY_ERROR",payload:k}),[n]),j=S.useCallback(k=>n({type:"SET_PROXY_SUCCESS",payload:k}),[n]),H=S.useCallback(k=>n({type:"SET_PROXY_TEST_RESULT",payload:k}),[n]),B=S.useCallback(k=>n({type:"SET_PROXY_TESTING",payload:k}),[n]),U=S.useCallback(k=>n({type:"SET_RAW_CONFIG",payload:k}),[n]),O=S.useCallback(k=>n({type:"SET_RAW_CONFIG_LOADING",payload:k}),[n]);return S.useMemo(()=>({setWebSearchConfig:a,setWebSearchStatus:s,setWebSearchLoading:l,setWebSearchStatusLoading:c,setWebSearchSaving:f,setWebSearchError:h,setWebSearchSuccess:m,setGlobalEnvConfig:p,setGlobalEnvLoading:y,setGlobalEnvSaving:C,setGlobalEnvError:x,setGlobalEnvSuccess:v,setProxyConfig:N,setProxyLoading:w,setProxySaving:M,setProxyError:E,setProxySuccess:j,setProxyTestResult:H,setProxyTesting:B,setRawConfig:U,setRawConfigLoading:O}),[a,s,l,c,f,h,m,p,y,C,x,v,N,w,M,E,j,H,B,U,O])}function XT(){const[n,a]=vS(),s=n.get("tab")?.toLowerCase(),l=s==="globalenv"?"globalenv":s==="proxy"?"proxy":s==="auth"?"auth":s==="thinking"?"thinking":s==="backups"?"backups":"websearch",c=S.useCallback(f=>{a({tab:f},{replace:!0})},[a]);return{activeTab:l,setActiveTab:c}}function ZT(){const{state:n}=sb(),a=$T(),[s,l]=S.useState(!1),c=S.useCallback(async()=>{try{a.setRawConfigLoading(!0);const h=await fetch("/api/config/raw");if(!h.ok){a.setRawConfig(null);return}const m=await h.text();a.setRawConfig(m)}catch{a.setRawConfig(null)}finally{a.setRawConfigLoading(!1)}},[a]),f=S.useCallback(async()=>{if(n.rawConfig)try{await navigator.clipboard.writeText(n.rawConfig),l(!0),setTimeout(()=>l(!1),2e3)}catch{}},[n.rawConfig]);return{rawConfig:n.rawConfig,loading:n.rawConfigLoading,copied:s,fetchRawConfig:c,copyToClipboard:f}}function cy({activeTab:n,onTabChange:a}){const{t:s}=_t(),l=[{value:"websearch",label:s("settingsTabs.web"),icon:Xy},{value:"globalenv",label:s("settingsTabs.env"),icon:Pd},{value:"thinking",label:s("settingsTabs.think"),icon:eC},{value:"proxy",label:s("settingsTabs.proxy"),icon:tC},{value:"auth",label:s("settingsTabs.auth"),icon:Ed},{value:"backups",label:s("settingsTabs.backup"),icon:nC}];return r.jsx($x,{value:n,onValueChange:c=>a(c),children:r.jsx(cf,{className:"grid w-full grid-cols-6",children:l.map(({value:c,label:f,icon:h})=>r.jsxs(mr,{value:c,className:"gap-1.5 px-1 text-xs",children:[r.jsx(h,{className:"h-3.5 w-3.5 shrink-0"}),r.jsx("span",{className:"truncate",children:f})]},c))})})}function uy(){return r.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[r.jsx(Ge,{className:"h-4 w-2/3"}),r.jsx("div",{className:"p-4 rounded-lg border",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ge,{className:"h-5 w-32"}),r.jsx(Ge,{className:"h-4 w-48"})]}),r.jsx(Ge,{className:"h-6 w-10 rounded-full"})]})}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Ge,{className:"h-5 w-24"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Ge,{className:"h-20 w-full rounded-lg"}),r.jsx(Ge,{className:"h-20 w-full rounded-lg"}),r.jsx(Ge,{className:"h-20 w-full rounded-lg"})]})]})]})}function lb(n,a=3,s=1e3){return n().catch(l=>{if(a<=0)throw l;return new Promise(c=>setTimeout(c,s)).then(()=>lb(n,a-1,s*2))})}function Co(n){return S.lazy(()=>lb(n))}const dy=Co(()=>gt(()=>import("./index-DI8j_aYa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),fy=Co(()=>gt(()=>import("./globalenv-section-D0TAPAVS.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8,9]))),hy=Co(()=>gt(()=>import("./index-BoCctuVm.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9]))),my=Co(()=>gt(()=>import("./index-B3R5r7pg.js"),__vite__mapDeps([12,1,2,3,13,4,14,15,5,6,7,8,9]))),py=Co(()=>gt(()=>import("./auth-section-B5dLDT5c.js"),__vite__mapDeps([16,1,2,4,5,6,7,8,9]))),gy=Co(()=>gt(()=>import("./backups-section-COPmsPIk.js"),__vite__mapDeps([17,1,2,15,4,5,6,7,8,9])));class yy extends S.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}render(){return this.state.hasError?r.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:r.jsxs("div",{className:"text-center p-6 max-w-md",children:[r.jsx(Cr,{className:"w-12 h-12 mx-auto mb-4 text-destructive"}),r.jsx("p",{className:"font-medium text-foreground mb-2",children:He.t("settings.sectionLoadFailed")}),r.jsx("p",{className:"text-sm mb-4",children:this.state.error?.message||He.t("settings.unknownError")}),r.jsxs(ft,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[r.jsx(Es,{className:"w-4 h-4"}),He.t("settings.reloadPage")]})]})}):this.props.children}}function JT(){const{t:n}=_t(),{activeTab:a,setActiveTab:s}=XT(),{rawConfig:l,loading:c,copied:f,fetchRawConfig:h,copyToClipboard:m}=ZT();S.useEffect(()=>{h()},[h]);const p=y=>{S.startTransition(()=>{s(y)})};return r.jsxs("div",{className:"h-[calc(100vh-100px)]",children:[r.jsxs("div",{className:"md:hidden h-full flex flex-col",children:[r.jsx("div",{className:"border-b bg-background p-4",children:r.jsx(cy,{activeTab:a,onTabChange:p})}),r.jsx(yy,{children:r.jsxs(S.Suspense,{fallback:r.jsx(uy,{}),children:[a==="websearch"&&r.jsx(dy,{}),a==="globalenv"&&r.jsx(fy,{}),a==="thinking"&&r.jsx(hy,{}),a==="proxy"&&r.jsx(my,{}),a==="auth"&&r.jsx(py,{}),a==="backups"&&r.jsx(gy,{})]})})]}),r.jsxs(of,{direction:"horizontal",className:"h-full hidden md:flex",children:[r.jsx(Ps,{defaultSize:40,minSize:30,maxSize:55,children:r.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[r.jsx("div",{className:"p-5 border-b bg-background",children:r.jsx(cy,{activeTab:a,onTabChange:p})}),r.jsx(yy,{children:r.jsxs(S.Suspense,{fallback:r.jsx(uy,{}),children:[a==="websearch"&&r.jsx(dy,{}),a==="globalenv"&&r.jsx(fy,{}),a==="thinking"&&r.jsx(hy,{}),a==="proxy"&&r.jsx(my,{}),a==="auth"&&r.jsx(py,{}),a==="backups"&&r.jsx(gy,{})]})})]})}),r.jsx(sf,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:r.jsx(wr,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),r.jsx(Ps,{defaultSize:60,minSize:35,children:r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(fg,{className:"w-5 h-5 text-primary"}),r.jsxs("div",{children:[r.jsx("h2",{className:"font-semibold",children:"config.yaml"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(ft,{variant:"outline",size:"sm",onClick:m,disabled:!l,children:f?r.jsxs(r.Fragment,{children:[r.jsx(xo,{className:"w-4 h-4 mr-1"}),n("settings.copied")]}):r.jsxs(r.Fragment,{children:[r.jsx(lr,{className:"w-4 h-4 mr-1"}),n("settings.copy")]})}),r.jsx(ft,{variant:"outline",size:"sm",onClick:h,disabled:c,children:r.jsx(Es,{className:`w-4 h-4 ${c?"animate-spin":""}`})})]})]}),r.jsx("div",{className:"flex-1 overflow-auto",children:c?r.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[r.jsx(Es,{className:"w-5 h-5 animate-spin mr-2"}),n("settings.loading")]}):l?r.jsx(ib,{value:l,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):r.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:r.jsxs("div",{className:"text-center",children:[r.jsx(fg,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),r.jsx("p",{children:n("settings.configFileNotFound")}),r.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})]})}function ej(){return r.jsx(WT,{children:r.jsx(JT,{})})}const tj=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:ej},Symbol.toStringTag,{value:"Module"})),nE=hS,aE=pS,iE=mS,nj=S.forwardRef(({className:n,align:a="center",sideOffset:s=4,...l},c)=>r.jsx(fS,{children:r.jsx(Gy,{ref:c,align:a,sideOffset:s,className:K("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...l})}));nj.displayName=Gy.displayName;function aj(n,a,s="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:n,timeZoneName:s}).format(a).split(/\s/g).slice(2).join(" ")}const ij={},As={};function Si(n,a){try{const l=(ij[n]||=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return l in As?As[l]:xy(l,l.split(":"))}catch{if(n in As)return As[n];const s=n?.match(oj);return s?xy(n,s.slice(1)):NaN}}const oj=/([+-]\d\d):?(\d\d)?/;function xy(n,a){const s=+(a[0]||0),l=+(a[1]||0),c=+(a[2]||0)/60;return As[n]=s*60+l>0?s*60+l+c:s*60-l-c}class Bn extends Date{constructor(...a){super(),a.length>1&&typeof a[a.length-1]=="string"&&(this.timeZone=a.pop()),this.internal=new Date,isNaN(Si(this.timeZone,this))?this.setTime(NaN):a.length?typeof a[0]=="number"&&(a.length===1||a.length===2&&typeof a[1]!="number")?this.setTime(a[0]):typeof a[0]=="string"?this.setTime(+new Date(a[0])):a[0]instanceof Date?this.setTime(+a[0]):(this.setTime(+new Date(...a)),rb(this),jd(this)):this.setTime(Date.now())}static tz(a,...s){return s.length?new Bn(...s,a):new Bn(Date.now(),a)}withTimeZone(a){return new Bn(+this,a)}getTimezoneOffset(){const a=-Si(this.timeZone,this);return a>0?Math.floor(a):Math.ceil(a)}setTime(a){return Date.prototype.setTime.apply(this,arguments),jd(this),+this}[Symbol.for("constructDateFrom")](a){return new Bn(+new Date(a),this.timeZone)}}const by=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!by.test(n))return;const a=n.replace(by,"$1UTC");Bn.prototype[a]&&(n.startsWith("get")?Bn.prototype[n]=function(){return this.internal[a]()}:(Bn.prototype[n]=function(){return Date.prototype[a].apply(this.internal,arguments),sj(this),+this},Bn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),jd(this),+this}))});function jd(n){n.internal.setTime(+n),n.internal.setUTCSeconds(n.internal.getUTCSeconds()-Math.round(-Si(n.timeZone,n)*60))}function sj(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),rb(n)}function rb(n){const a=Si(n.timeZone,n),s=a>0?Math.floor(a):Math.ceil(a),l=new Date(+n);l.setUTCHours(l.getUTCHours()-1);const c=-new Date(+n).getTimezoneOffset(),f=-new Date(+l).getTimezoneOffset(),h=c-f,m=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();h&&m&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+h);const p=c-s;p&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+p);const y=new Date(+n);y.setUTCSeconds(0);const C=c>0?y.getSeconds():(y.getSeconds()-60)%60,x=Math.round(-(Si(n.timeZone,n)*60))%60;(x||C)&&(n.internal.setUTCSeconds(n.internal.getUTCSeconds()+x),Date.prototype.setUTCSeconds.call(n,Date.prototype.getUTCSeconds.call(n)+x+C));const v=Si(n.timeZone,n),N=v>0?Math.floor(v):Math.ceil(v),M=-new Date(+n).getTimezoneOffset()-N,E=N!==s,j=M-p;if(E&&j){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+j);const H=Si(n.timeZone,n),B=H>0?Math.floor(H):Math.ceil(H),U=N-B;U&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+U),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+U))}}class ya extends Bn{static tz(a,...s){return s.length?new ya(...s,a):new ya(Date.now(),a)}toISOString(){const[a,s,l]=this.tzComponents(),c=`${a}${s}:${l}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[a,s,l,c]=this.internal.toUTCString().split(" ");return`${a?.slice(0,-1)} ${l} ${s} ${c}`}toTimeString(){const a=this.internal.toUTCString().split(" ")[4],[s,l,c]=this.tzComponents();return`${a} GMT${s}${l}${c} (${aj(this.timeZone,this)})`}toLocaleString(a,s){return Date.prototype.toLocaleString.call(this,a,{...s,timeZone:s?.timeZone||this.timeZone})}toLocaleDateString(a,s){return Date.prototype.toLocaleDateString.call(this,a,{...s,timeZone:s?.timeZone||this.timeZone})}toLocaleTimeString(a,s){return Date.prototype.toLocaleTimeString.call(this,a,{...s,timeZone:s?.timeZone||this.timeZone})}tzComponents(){const a=this.getTimezoneOffset(),s=a>0?"-":"+",l=String(Math.floor(Math.abs(a)/60)).padStart(2,"0"),c=String(Math.abs(a)%60).padStart(2,"0");return[s,l,c]}withTimeZone(a){return new ya(+this,a)}[Symbol.for("constructDateFrom")](a){return new ya(+new Date(a),this.timeZone)}}const vy=5,lj=4;function rj(n,a){const s=a.startOfMonth(n),l=s.getDay()>0?s.getDay():7,c=a.addDays(n,-l+1),f=a.addDays(c,vy*7-1);return a.getMonth(n)===a.getMonth(f)?vy:lj}function cb(n,a){const s=a.startOfMonth(n),l=s.getDay();return l===1?s:l===0?a.addDays(s,-6):a.addDays(s,-1*(l-1))}function cj(n,a){const s=cb(n,a),l=rj(n,a);return a.addDays(s,l*7-1)}const ub={...xs,labels:{labelDayButton:(n,a,s,l)=>{let c;l&&typeof l.format=="function"?c=l.format.bind(l):c=(h,m)=>Cs(h,m,{locale:xs,...s});let f=c(n,"PPPP");return a.today&&(f=`Today, ${f}`),a.selected&&(f=`${f}, selected`),f},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:n=>`Week ${n}`,labelYearDropdown:"Choose the Year",labelGrid:(n,a,s)=>{let l;return s&&typeof s.format=="function"?l=s.format.bind(s):l=(c,f)=>Cs(c,f,{locale:xs,...a}),l(n,"LLLL yyyy")},labelGridcell:(n,a,s,l)=>{let c;l&&typeof l.format=="function"?c=l.format.bind(l):c=(h,m)=>Cs(h,m,{locale:xs,...s});let f=c(n,"PPPP");return a?.today&&(f=`Today, ${f}`),f},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(n,a,s)=>{let l;return s&&typeof s.format=="function"?l=s.format.bind(s):l=(c,f)=>Cs(c,f,{locale:xs,...a}),l(n,"cccc")}}};class un{constructor(a,s){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ya.tz(this.options.timeZone):new this.Date,this.newDate=(l,c,f)=>this.overrides?.newDate?this.overrides.newDate(l,c,f):this.options.timeZone?new ya(l,c,f,this.options.timeZone):new Date(l,c,f),this.addDays=(l,c)=>this.overrides?.addDays?this.overrides.addDays(l,c):lC(l,c),this.addMonths=(l,c)=>this.overrides?.addMonths?this.overrides.addMonths(l,c):rC(l,c),this.addWeeks=(l,c)=>this.overrides?.addWeeks?this.overrides.addWeeks(l,c):cC(l,c),this.addYears=(l,c)=>this.overrides?.addYears?this.overrides.addYears(l,c):uC(l,c),this.differenceInCalendarDays=(l,c)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(l,c):dC(l,c),this.differenceInCalendarMonths=(l,c)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(l,c):fC(l,c),this.eachMonthOfInterval=l=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(l):hC(l),this.eachYearOfInterval=l=>{const c=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(l):mC(l),f=new Set(c.map(m=>this.getYear(m)));if(f.size===c.length)return c;const h=[];return f.forEach(m=>{h.push(new Date(m,0,1))}),h},this.endOfBroadcastWeek=l=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(l):cj(l,this),this.endOfISOWeek=l=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(l):pC(l),this.endOfMonth=l=>this.overrides?.endOfMonth?this.overrides.endOfMonth(l):gC(l),this.endOfWeek=(l,c)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(l,c):yC(l,this.options),this.endOfYear=l=>this.overrides?.endOfYear?this.overrides.endOfYear(l):xC(l),this.format=(l,c,f)=>{const h=this.overrides?.format?this.overrides.format(l,c,this.options):Cs(l,c,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(h):h},this.getISOWeek=l=>this.overrides?.getISOWeek?this.overrides.getISOWeek(l):bC(l),this.getMonth=(l,c)=>this.overrides?.getMonth?this.overrides.getMonth(l,this.options):vC(l,this.options),this.getYear=(l,c)=>this.overrides?.getYear?this.overrides.getYear(l,this.options):SC(l,this.options),this.getWeek=(l,c)=>this.overrides?.getWeek?this.overrides.getWeek(l,this.options):CC(l,this.options),this.isAfter=(l,c)=>this.overrides?.isAfter?this.overrides.isAfter(l,c):wC(l,c),this.isBefore=(l,c)=>this.overrides?.isBefore?this.overrides.isBefore(l,c):NC(l,c),this.isDate=l=>this.overrides?.isDate?this.overrides.isDate(l):kC(l),this.isSameDay=(l,c)=>this.overrides?.isSameDay?this.overrides.isSameDay(l,c):AC(l,c),this.isSameMonth=(l,c)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(l,c):TC(l,c),this.isSameYear=(l,c)=>this.overrides?.isSameYear?this.overrides.isSameYear(l,c):jC(l,c),this.max=l=>this.overrides?.max?this.overrides.max(l):MC(l),this.min=l=>this.overrides?.min?this.overrides.min(l):DC(l),this.setMonth=(l,c)=>this.overrides?.setMonth?this.overrides.setMonth(l,c):EC(l,c),this.setYear=(l,c)=>this.overrides?.setYear?this.overrides.setYear(l,c):OC(l,c),this.startOfBroadcastWeek=(l,c)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(l,this):cb(l,this),this.startOfDay=l=>this.overrides?.startOfDay?this.overrides.startOfDay(l):RC(l),this.startOfISOWeek=l=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(l):PC(l),this.startOfMonth=l=>this.overrides?.startOfMonth?this.overrides.startOfMonth(l):LC(l),this.startOfWeek=(l,c)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(l,this.options):_C(l,this.options),this.startOfYear=l=>this.overrides?.startOfYear?this.overrides.startOfYear(l):zC(l),this.options={locale:ub,...a},this.overrides=s}getDigitMap(){const{numerals:a="latn"}=this.options,s=new Intl.NumberFormat("en-US",{numberingSystem:a}),l={};for(let c=0;c<10;c++)l[c.toString()]=s.format(c);return l}replaceDigits(a){const s=this.getDigitMap();return a.replace(/\d/g,l=>s[l]||l)}formatNumber(a){return this.replaceDigits(a.toString())}getMonthYearOrder(){const a=this.options.locale?.code;return a&&un.yearFirstLocales.has(a)?"year-first":"month-first"}formatMonthYear(a){const{locale:s,timeZone:l,numerals:c}=this.options,f=s?.code;if(f&&un.yearFirstLocales.has(f))try{return new Intl.DateTimeFormat(f,{month:"long",year:"numeric",timeZone:l,numberingSystem:c}).format(a)}catch{}const h=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(a,h)}}un.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Gn=new un;class db{constructor(a,s,l=Gn){this.date=a,this.displayMonth=s,this.outside=!!(s&&!l.isSameMonth(a,s)),this.dateLib=l,this.isoDate=l.format(a,"yyyy-MM-dd"),this.displayMonthId=l.format(s,"yyyy-MM"),this.dateMonthId=l.format(a,"yyyy-MM")}isEqualTo(a){return this.dateLib.isSameDay(a.date,this.date)&&this.dateLib.isSameMonth(a.displayMonth,this.displayMonth)}}class uj{constructor(a,s){this.date=a,this.weeks=s}}class dj{constructor(a,s){this.days=s,this.weekNumber=a}}function fj(n){return oe.createElement("button",{...n})}function hj(n){return oe.createElement("span",{...n})}function mj(n){const{size:a=24,orientation:s="left",className:l}=n;return oe.createElement("svg",{className:l,width:a,height:a,viewBox:"0 0 24 24"},s==="up"&&oe.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),s==="down"&&oe.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),s==="left"&&oe.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),s==="right"&&oe.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function pj(n){const{day:a,modifiers:s,...l}=n;return oe.createElement("td",{...l})}function gj(n){const{day:a,modifiers:s,...l}=n,c=oe.useRef(null);return oe.useEffect(()=>{s.focused&&c.current?.focus()},[s.focused]),oe.createElement("button",{ref:c,...l})}var pe;(function(n){n.Root="root",n.Chevron="chevron",n.Day="day",n.DayButton="day_button",n.CaptionLabel="caption_label",n.Dropdowns="dropdowns",n.Dropdown="dropdown",n.DropdownRoot="dropdown_root",n.Footer="footer",n.MonthGrid="month_grid",n.MonthCaption="month_caption",n.MonthsDropdown="months_dropdown",n.Month="month",n.Months="months",n.Nav="nav",n.NextMonthButton="button_next",n.PreviousMonthButton="button_previous",n.Week="week",n.Weeks="weeks",n.Weekday="weekday",n.Weekdays="weekdays",n.WeekNumber="week_number",n.WeekNumberHeader="week_number_header",n.YearsDropdown="years_dropdown"})(pe||(pe={}));var rt;(function(n){n.disabled="disabled",n.hidden="hidden",n.outside="outside",n.focused="focused",n.today="today"})(rt||(rt={}));var jn;(function(n){n.range_end="range_end",n.range_middle="range_middle",n.range_start="range_start",n.selected="selected"})(jn||(jn={}));var cn;(function(n){n.weeks_before_enter="weeks_before_enter",n.weeks_before_exit="weeks_before_exit",n.weeks_after_enter="weeks_after_enter",n.weeks_after_exit="weeks_after_exit",n.caption_after_enter="caption_after_enter",n.caption_after_exit="caption_after_exit",n.caption_before_enter="caption_before_enter",n.caption_before_exit="caption_before_exit"})(cn||(cn={}));function yj(n){const{options:a,className:s,components:l,classNames:c,...f}=n,h=[c[pe.Dropdown],s].join(" "),m=a?.find(({value:p})=>p===f.value);return oe.createElement("span",{"data-disabled":f.disabled,className:c[pe.DropdownRoot]},oe.createElement(l.Select,{className:h,...f},a?.map(({value:p,label:y,disabled:C})=>oe.createElement(l.Option,{key:p,value:p,disabled:C},y))),oe.createElement("span",{className:c[pe.CaptionLabel],"aria-hidden":!0},m?.label,oe.createElement(l.Chevron,{orientation:"down",size:18,className:c[pe.Chevron]})))}function xj(n){return oe.createElement("div",{...n})}function bj(n){return oe.createElement("div",{...n})}function vj(n){const{calendarMonth:a,displayIndex:s,...l}=n;return oe.createElement("div",{...l},n.children)}function Sj(n){const{calendarMonth:a,displayIndex:s,...l}=n;return oe.createElement("div",{...l})}function Cj(n){return oe.createElement("table",{...n})}function wj(n){return oe.createElement("div",{...n})}const fb=S.createContext(void 0);function Us(){const n=S.useContext(fb);if(n===void 0)throw new Error("useDayPicker() must be used within a custom component.");return n}function Nj(n){const{components:a}=Us();return oe.createElement(a.Dropdown,{...n})}function kj(n){const{onPreviousClick:a,onNextClick:s,previousMonth:l,nextMonth:c,...f}=n,{components:h,classNames:m,labels:{labelPrevious:p,labelNext:y}}=Us(),C=S.useCallback(v=>{c&&s?.(v)},[c,s]),x=S.useCallback(v=>{l&&a?.(v)},[l,a]);return oe.createElement("nav",{...f},oe.createElement(h.PreviousMonthButton,{type:"button",className:m[pe.PreviousMonthButton],tabIndex:l?void 0:-1,"aria-disabled":l?void 0:!0,"aria-label":p(l),onClick:x},oe.createElement(h.Chevron,{disabled:l?void 0:!0,className:m[pe.Chevron],orientation:"left"})),oe.createElement(h.NextMonthButton,{type:"button",className:m[pe.NextMonthButton],tabIndex:c?void 0:-1,"aria-disabled":c?void 0:!0,"aria-label":y(c),onClick:C},oe.createElement(h.Chevron,{disabled:c?void 0:!0,orientation:"right",className:m[pe.Chevron]})))}function Aj(n){const{components:a}=Us();return oe.createElement(a.Button,{...n})}function Tj(n){return oe.createElement("option",{...n})}function jj(n){const{components:a}=Us();return oe.createElement(a.Button,{...n})}function Mj(n){const{rootRef:a,...s}=n;return oe.createElement("div",{...s,ref:a})}function Dj(n){return oe.createElement("select",{...n})}function Ej(n){const{week:a,...s}=n;return oe.createElement("tr",{...s})}function Oj(n){return oe.createElement("th",{...n})}function Rj(n){return oe.createElement("thead",{"aria-hidden":!0},oe.createElement("tr",{...n}))}function Pj(n){const{week:a,...s}=n;return oe.createElement("th",{...s})}function Lj(n){return oe.createElement("th",{...n})}function _j(n){return oe.createElement("tbody",{...n})}function zj(n){const{components:a}=Us();return oe.createElement(a.Dropdown,{...n})}const Uj=Object.freeze(Object.defineProperty({__proto__:null,Button:fj,CaptionLabel:hj,Chevron:mj,Day:pj,DayButton:gj,Dropdown:yj,DropdownNav:xj,Footer:bj,Month:vj,MonthCaption:Sj,MonthGrid:Cj,Months:wj,MonthsDropdown:Nj,Nav:kj,NextMonthButton:Aj,Option:Tj,PreviousMonthButton:jj,Root:Mj,Select:Dj,Week:Ej,WeekNumber:Pj,WeekNumberHeader:Lj,Weekday:Oj,Weekdays:Rj,Weeks:_j,YearsDropdown:zj},Symbol.toStringTag,{value:"Module"}));function xa(n,a,s=!1,l=Gn){let{from:c,to:f}=n;const{differenceInCalendarDays:h,isSameDay:m}=l;return c&&f?(h(f,c)<0&&([c,f]=[f,c]),h(a,c)>=(s?1:0)&&h(f,a)>=(s?1:0)):!s&&f?m(f,a):!s&&c?m(c,a):!1}function mf(n){return!!(n&&typeof n=="object"&&"before"in n&&"after"in n)}function _r(n){return!!(n&&typeof n=="object"&&"from"in n)}function pf(n){return!!(n&&typeof n=="object"&&"after"in n)}function gf(n){return!!(n&&typeof n=="object"&&"before"in n)}function hb(n){return!!(n&&typeof n=="object"&&"dayOfWeek"in n)}function mb(n,a){return Array.isArray(n)&&n.every(a.isDate)}function ba(n,a,s=Gn){const l=Array.isArray(a)?a:[a],{isSameDay:c,differenceInCalendarDays:f,isAfter:h}=s;return l.some(m=>{if(typeof m=="boolean")return m;if(s.isDate(m))return c(n,m);if(mb(m,s))return m.some(p=>c(n,p));if(_r(m))return xa(m,n,!1,s);if(hb(m))return Array.isArray(m.dayOfWeek)?m.dayOfWeek.includes(n.getDay()):m.dayOfWeek===n.getDay();if(mf(m)){const p=f(m.before,n),y=f(m.after,n),C=p>0,x=y<0;return h(m.before,m.after)?x&&C:C||x}return pf(m)?f(n,m.after)>0:gf(m)?f(m.before,n)>0:typeof m=="function"?m(n):!1})}function Ij(n,a,s,l,c){const{disabled:f,hidden:h,modifiers:m,showOutsideDays:p,broadcastCalendar:y,today:C=c.today()}=a,{isSameDay:x,isSameMonth:v,startOfMonth:N,isBefore:w,endOfMonth:M,isAfter:E}=c,j=s&&N(s),H=l&&M(l),B={[rt.focused]:[],[rt.outside]:[],[rt.disabled]:[],[rt.hidden]:[],[rt.today]:[]},U={};for(const O of n){const{date:k,displayMonth:z}=O,X=!!(z&&!v(k,z)),W=!!(j&&w(k,j)),Q=!!(H&&E(k,H)),ae=!!(f&&ba(k,f,c)),ee=!!(h&&ba(k,h,c))||W||Q||!y&&!p&&X||y&&p===!1&&X,ye=x(k,C);X&&B.outside.push(O),ae&&B.disabled.push(O),ee&&B.hidden.push(O),ye&&B.today.push(O),m&&Object.keys(m).forEach(fe=>{const Ce=m?.[fe];Ce&&ba(k,Ce,c)&&(U[fe]?U[fe].push(O):U[fe]=[O])})}return O=>{const k={[rt.focused]:!1,[rt.disabled]:!1,[rt.hidden]:!1,[rt.outside]:!1,[rt.today]:!1},z={};for(const X in B){const W=B[X];k[X]=W.some(Q=>Q===O)}for(const X in U)z[X]=U[X].some(W=>W===O);return{...k,...z}}}function Hj(n,a,s={}){return Object.entries(n).filter(([,c])=>c===!0).reduce((c,[f])=>(s[f]?c.push(s[f]):a[rt[f]]?c.push(a[rt[f]]):a[jn[f]]&&c.push(a[jn[f]]),c),[a[pe.Day]])}function Bj(n){return{...Uj,...n}}function Kj(n){const a={"data-mode":n.mode??void 0,"data-required":"required"in n?n.required:void 0,"data-multiple-months":n.numberOfMonths&&n.numberOfMonths>1||void 0,"data-week-numbers":n.showWeekNumber||void 0,"data-broadcast-calendar":n.broadcastCalendar||void 0,"data-nav-layout":n.navLayout||void 0};return Object.entries(n).forEach(([s,l])=>{s.startsWith("data-")&&(a[s]=l)}),a}function qj(){const n={};for(const a in pe)n[pe[a]]=`rdp-${pe[a]}`;for(const a in rt)n[rt[a]]=`rdp-${rt[a]}`;for(const a in jn)n[jn[a]]=`rdp-${jn[a]}`;for(const a in cn)n[cn[a]]=`rdp-${cn[a]}`;return n}function pb(n,a,s){return(s??new un(a)).formatMonthYear(n)}const Gj=pb;function Yj(n,a,s){return(s??new un(a)).format(n,"d")}function Vj(n,a=Gn){return a.format(n,"LLLL")}function Fj(n,a,s){return(s??new un(a)).format(n,"cccccc")}function Qj(n,a=Gn){return n<10?a.formatNumber(`0${n.toLocaleString()}`):a.formatNumber(`${n.toLocaleString()}`)}function Wj(){return""}function gb(n,a=Gn){return a.format(n,"yyyy")}const $j=gb,Xj=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:pb,formatDay:Yj,formatMonthCaption:Gj,formatMonthDropdown:Vj,formatWeekNumber:Qj,formatWeekNumberHeader:Wj,formatWeekdayName:Fj,formatYearCaption:$j,formatYearDropdown:gb},Symbol.toStringTag,{value:"Module"}));function Zj(n){return n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...Xj,...n}}function yf(n,a,s,l){let c=(l??new un(s)).format(n,"PPPP");return a.today&&(c=`Today, ${c}`),a.selected&&(c=`${c}, selected`),c}const Jj=yf;function xf(n,a,s){return(s??new un(a)).formatMonthYear(n)}const eM=xf;function yb(n,a,s,l){let c=(l??new un(s)).format(n,"PPPP");return a?.today&&(c=`Today, ${c}`),c}function xb(n){return"Choose the Month"}function bb(){return""}const tM="Go to the Next Month";function vb(n,a){return tM}function Sb(n){return"Go to the Previous Month"}function Cb(n,a,s){return(s??new un(a)).format(n,"cccc")}function wb(n,a){return`Week ${n}`}function Nb(n){return"Week Number"}function kb(n){return"Choose the Year"}const nM=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:eM,labelDay:Jj,labelDayButton:yf,labelGrid:xf,labelGridcell:yb,labelMonthDropdown:xb,labelNav:bb,labelNext:vb,labelPrevious:Sb,labelWeekNumber:wb,labelWeekNumberHeader:Nb,labelWeekday:Cb,labelYearDropdown:kb},Symbol.toStringTag,{value:"Module"})),Tn=(n,a,s)=>a||(s?typeof s=="function"?s:(...l)=>s:n);function aM(n,a){const s=a.locale?.labels??{};return{...nM,...n??{},labelDayButton:Tn(yf,n?.labelDayButton,s.labelDayButton),labelMonthDropdown:Tn(xb,n?.labelMonthDropdown,s.labelMonthDropdown),labelNext:Tn(vb,n?.labelNext,s.labelNext),labelPrevious:Tn(Sb,n?.labelPrevious,s.labelPrevious),labelWeekNumber:Tn(wb,n?.labelWeekNumber,s.labelWeekNumber),labelYearDropdown:Tn(kb,n?.labelYearDropdown,s.labelYearDropdown),labelGrid:Tn(xf,n?.labelGrid,s.labelGrid),labelGridcell:Tn(yb,n?.labelGridcell,s.labelGridcell),labelNav:Tn(bb,n?.labelNav,s.labelNav),labelWeekNumberHeader:Tn(Nb,n?.labelWeekNumberHeader,s.labelWeekNumberHeader),labelWeekday:Tn(Cb,n?.labelWeekday,s.labelWeekday)}}function iM(n,a,s,l,c){const{startOfMonth:f,startOfYear:h,endOfYear:m,eachMonthOfInterval:p,getMonth:y}=c;return p({start:h(n),end:m(n)}).map(v=>{const N=l.formatMonthDropdown(v,c),w=y(v),M=a&&v<f(a)||s&&v>f(s)||!1;return{value:w,label:N,disabled:M}})}function oM(n,a={},s={}){let l={...a?.[pe.Day]};return Object.entries(n).filter(([,c])=>c===!0).forEach(([c])=>{l={...l,...s?.[c]}}),l}function sM(n,a,s,l){const c=l??n.today(),f=s?n.startOfBroadcastWeek(c,n):a?n.startOfISOWeek(c):n.startOfWeek(c),h=[];for(let m=0;m<7;m++){const p=n.addDays(f,m);h.push(p)}return h}function lM(n,a,s,l,c=!1){if(!n||!a)return;const{startOfYear:f,endOfYear:h,eachYearOfInterval:m,getYear:p}=l,y=f(n),C=h(a),x=m({start:y,end:C});return c&&x.reverse(),x.map(v=>{const N=s.formatYearDropdown(v,l);return{value:p(v),label:N,disabled:!1}})}const Is=n=>n instanceof HTMLElement?n:null,dd=n=>[...n.querySelectorAll("[data-animated-month]")??[]],rM=n=>Is(n.querySelector("[data-animated-month]")),fd=n=>Is(n.querySelector("[data-animated-caption]")),hd=n=>Is(n.querySelector("[data-animated-weeks]")),cM=n=>Is(n.querySelector("[data-animated-nav]")),uM=n=>Is(n.querySelector("[data-animated-weekdays]"));function dM(n,a,{classNames:s,months:l,focused:c,dateLib:f}){const h=S.useRef(null),m=S.useRef(l),p=S.useRef(!1);S.useLayoutEffect(()=>{const y=m.current;if(m.current=l,!a||!n.current||!(n.current instanceof HTMLElement)||l.length===0||y.length===0||l.length!==y.length)return;const C=f.isSameMonth(l[0].date,y[0].date),x=f.isAfter(l[0].date,y[0].date),v=x?s[cn.caption_after_enter]:s[cn.caption_before_enter],N=x?s[cn.weeks_after_enter]:s[cn.weeks_before_enter],w=h.current,M=n.current.cloneNode(!0);if(M instanceof HTMLElement?(dd(M).forEach(B=>{if(!(B instanceof HTMLElement))return;const U=rM(B);U&&B.contains(U)&&B.removeChild(U);const O=fd(B);O&&O.classList.remove(v);const k=hd(B);k&&k.classList.remove(N)}),h.current=M):h.current=null,p.current||C||c)return;const E=w instanceof HTMLElement?dd(w):[],j=dd(n.current);if(j?.every(H=>H instanceof HTMLElement)&&E&&E.every(H=>H instanceof HTMLElement)){p.current=!0,n.current.style.isolation="isolate";const H=cM(n.current);H&&(H.style.zIndex="1"),j.forEach((B,U)=>{const O=E[U];if(!O)return;B.style.position="relative",B.style.overflow="hidden";const k=fd(B);k&&k.classList.add(v);const z=hd(B);z&&z.classList.add(N);const X=()=>{p.current=!1,n.current&&(n.current.style.isolation=""),H&&(H.style.zIndex=""),k&&k.classList.remove(v),z&&z.classList.remove(N),B.style.position="",B.style.overflow="",B.contains(O)&&B.removeChild(O)};O.style.pointerEvents="none",O.style.position="absolute",O.style.overflow="hidden",O.setAttribute("aria-hidden","true");const W=uM(O);W&&(W.style.opacity="0");const Q=fd(O);Q&&(Q.classList.add(x?s[cn.caption_before_exit]:s[cn.caption_after_exit]),Q.addEventListener("animationend",X));const ae=hd(O);ae&&ae.classList.add(x?s[cn.weeks_before_exit]:s[cn.weeks_after_exit]),B.insertBefore(O,B.firstChild)})}})}function fM(n,a,s,l){const c=n[0],f=n[n.length-1],{ISOWeek:h,fixedWeeks:m,broadcastCalendar:p}=s??{},{addDays:y,differenceInCalendarDays:C,differenceInCalendarMonths:x,endOfBroadcastWeek:v,endOfISOWeek:N,endOfMonth:w,endOfWeek:M,isAfter:E,startOfBroadcastWeek:j,startOfISOWeek:H,startOfWeek:B}=l,U=p?j(c,l):h?H(c):B(c),O=p?v(f):h?N(w(f)):M(w(f)),k=a&&(p?v(a):h?N(a):M(a)),z=k&&E(O,k)?k:O,X=C(z,U),W=x(f,c)+1,Q=[];for(let ye=0;ye<=X;ye++){const fe=y(U,ye);Q.push(fe)}const ee=(p?35:42)*W;if(m&&Q.length<ee){const ye=ee-Q.length;for(let fe=0;fe<ye;fe++){const Ce=y(Q[Q.length-1],1);Q.push(Ce)}}return Q}function hM(n){const a=[];return n.reduce((s,l)=>{const c=l.weeks.reduce((f,h)=>f.concat(h.days.slice()),a.slice());return s.concat(c.slice())},a.slice())}function mM(n,a,s,l){const{numberOfMonths:c=1}=s,f=[];for(let h=0;h<c;h++){const m=l.addMonths(n,h);if(a&&m>a)break;f.push(m)}return f}function Sy(n,a,s,l){const{month:c,defaultMonth:f,today:h=l.today(),numberOfMonths:m=1}=n;let p=c||f||h;const{differenceInCalendarMonths:y,addMonths:C,startOfMonth:x}=l;if(s&&y(s,p)<m-1){const v=-1*(m-1);p=C(s,v)}return a&&y(p,a)<0&&(p=a),x(p)}function pM(n,a,s,l){const{addDays:c,endOfBroadcastWeek:f,endOfISOWeek:h,endOfMonth:m,endOfWeek:p,getISOWeek:y,getWeek:C,startOfBroadcastWeek:x,startOfISOWeek:v,startOfWeek:N}=l,w=n.reduce((M,E)=>{const j=s.broadcastCalendar?x(E,l):s.ISOWeek?v(E):N(E),H=s.broadcastCalendar?f(E):s.ISOWeek?h(m(E)):p(m(E)),B=a.filter(z=>z>=j&&z<=H),U=s.broadcastCalendar?35:42;if(s.fixedWeeks&&B.length<U){const z=a.filter(X=>{const W=U-B.length;return X>H&&X<=c(H,W)});B.push(...z)}const O=B.reduce((z,X)=>{const W=s.ISOWeek?y(X):C(X),Q=z.find(ee=>ee.weekNumber===W),ae=new db(X,E,l);return Q?Q.days.push(ae):z.push(new dj(W,[ae])),z},[]),k=new uj(E,O);return M.push(k),M},[]);return s.reverseMonths?w.reverse():w}function gM(n,a){let{startMonth:s,endMonth:l}=n;const{startOfYear:c,startOfDay:f,startOfMonth:h,endOfMonth:m,addYears:p,endOfYear:y,newDate:C,today:x}=a,{fromYear:v,toYear:N,fromMonth:w,toMonth:M}=n;!s&&w&&(s=w),!s&&v&&(s=a.newDate(v,0,1)),!l&&M&&(l=M),!l&&N&&(l=C(N,11,31));const E=n.captionLayout==="dropdown"||n.captionLayout==="dropdown-years";return s?s=h(s):v?s=C(v,0,1):!s&&E&&(s=c(p(n.today??x(),-100))),l?l=m(l):N?l=C(N,11,31):!l&&E&&(l=y(n.today??x())),[s&&f(s),l&&f(l)]}function yM(n,a,s,l){if(s.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:f=1}=s,{startOfMonth:h,addMonths:m,differenceInCalendarMonths:p}=l,y=c?f:1,C=h(n);if(!a)return m(C,y);if(!(p(a,n)<f))return m(C,y)}function xM(n,a,s,l){if(s.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:f}=s,{startOfMonth:h,addMonths:m,differenceInCalendarMonths:p}=l,y=c?f??1:1,C=h(n);if(!a)return m(C,-y);if(!(p(C,a)<=0))return m(C,-y)}function bM(n){const a=[];return n.reduce((s,l)=>s.concat(l.weeks.slice()),a.slice())}function zr(n,a){const[s,l]=S.useState(n);return[a===void 0?s:a,l]}function vM(n,a){const[s,l]=gM(n,a),{startOfMonth:c,endOfMonth:f}=a,h=Sy(n,s,l,a),[m,p]=zr(h,n.month?h:void 0);S.useEffect(()=>{const U=Sy(n,s,l,a);p(U)},[n.timeZone]);const{months:y,weeks:C,days:x,previousMonth:v,nextMonth:N}=S.useMemo(()=>{const U=mM(m,l,{numberOfMonths:n.numberOfMonths},a),O=fM(U,n.endMonth?f(n.endMonth):void 0,{ISOWeek:n.ISOWeek,fixedWeeks:n.fixedWeeks,broadcastCalendar:n.broadcastCalendar},a),k=pM(U,O,{broadcastCalendar:n.broadcastCalendar,fixedWeeks:n.fixedWeeks,ISOWeek:n.ISOWeek,reverseMonths:n.reverseMonths},a),z=bM(k),X=hM(k),W=xM(m,s,n,a),Q=yM(m,l,n,a);return{months:k,weeks:z,days:X,previousMonth:W,nextMonth:Q}},[a,m.getTime(),l?.getTime(),s?.getTime(),n.disableNavigation,n.broadcastCalendar,n.endMonth?.getTime(),n.fixedWeeks,n.ISOWeek,n.numberOfMonths,n.pagedNavigation,n.reverseMonths]),{disableNavigation:w,onMonthChange:M}=n,E=U=>C.some(O=>O.days.some(k=>k.isEqualTo(U))),j=U=>{if(w)return;let O=c(U);s&&O<c(s)&&(O=c(s)),l&&O>c(l)&&(O=c(l)),p(O),M?.(O)};return{months:y,weeks:C,days:x,navStart:s,navEnd:l,previousMonth:v,nextMonth:N,goToMonth:j,goToDay:U=>{E(U)||j(U.date)}}}var In;(function(n){n[n.Today=0]="Today",n[n.Selected=1]="Selected",n[n.LastFocused=2]="LastFocused",n[n.FocusedModifier=3]="FocusedModifier"})(In||(In={}));function Cy(n){return!n[rt.disabled]&&!n[rt.hidden]&&!n[rt.outside]}function SM(n,a,s,l){let c,f=-1;for(const h of n){const m=a(h);Cy(m)&&(m[rt.focused]&&f<In.FocusedModifier?(c=h,f=In.FocusedModifier):l?.isEqualTo(h)&&f<In.LastFocused?(c=h,f=In.LastFocused):s(h.date)&&f<In.Selected?(c=h,f=In.Selected):m[rt.today]&&f<In.Today&&(c=h,f=In.Today))}return c||(c=n.find(h=>Cy(a(h)))),c}function CM(n,a,s,l,c,f,h){const{ISOWeek:m,broadcastCalendar:p}=f,{addDays:y,addMonths:C,addWeeks:x,addYears:v,endOfBroadcastWeek:N,endOfISOWeek:w,endOfWeek:M,max:E,min:j,startOfBroadcastWeek:H,startOfISOWeek:B,startOfWeek:U}=h;let k={day:y,week:x,month:C,year:v,startOfWeek:z=>p?H(z,h):m?B(z):U(z),endOfWeek:z=>p?N(z):m?w(z):M(z)}[n](s,a==="after"?1:-1);return a==="before"&&l?k=E([l,k]):a==="after"&&c&&(k=j([c,k])),k}function Ab(n,a,s,l,c,f,h,m=0){if(m>365)return;const p=CM(n,a,s.date,l,c,f,h),y=!!(f.disabled&&ba(p,f.disabled,h)),C=!!(f.hidden&&ba(p,f.hidden,h)),x=p,v=new db(p,x,h);return!y&&!C?v:Ab(n,a,v,l,c,f,h,m+1)}function wM(n,a,s,l,c){const{autoFocus:f}=n,[h,m]=S.useState(),p=SM(a.days,s,l||(()=>!1),h),[y,C]=S.useState(f?p:void 0);return{isFocusTarget:M=>!!p?.isEqualTo(M),setFocused:C,focused:y,blur:()=>{m(y),C(void 0)},moveFocus:(M,E)=>{if(!y)return;const j=Ab(M,E,y,a.navStart,a.navEnd,n,c);j&&(n.disableNavigation&&!a.days.some(B=>B.isEqualTo(j))||(a.goToDay(j),C(j)))}}}function NM(n,a){const{selected:s,required:l,onSelect:c}=n,[f,h]=zr(s,c?s:void 0),m=c?s:f,{isSameDay:p}=a,y=N=>m?.some(w=>p(w,N))??!1,{min:C,max:x}=n;return{selected:m,select:(N,w,M)=>{let E=[...m??[]];if(y(N)){if(m?.length===C||l&&m?.length===1)return;E=m?.filter(j=>!p(j,N))}else m?.length===x?E=[N]:E=[...E,N];return c||h(E),c?.(E,N,w,M),E},isSelected:y}}function kM(n,a,s=0,l=0,c=!1,f=Gn){const{from:h,to:m}=a||{},{isSameDay:p,isAfter:y,isBefore:C}=f;let x;if(!h&&!m)x={from:n,to:s>0?void 0:n};else if(h&&!m)p(h,n)?s===0?x={from:h,to:n}:c?x={from:h,to:void 0}:x=void 0:C(n,h)?x={from:n,to:h}:x={from:h,to:n};else if(h&&m)if(p(h,n)&&p(m,n))c?x={from:h,to:m}:x=void 0;else if(p(h,n))x={from:h,to:s>0?void 0:n};else if(p(m,n))x={from:n,to:s>0?void 0:n};else if(C(n,h))x={from:n,to:m};else if(y(n,h))x={from:h,to:n};else if(y(n,m))x={from:h,to:n};else throw new Error("Invalid range");if(x?.from&&x?.to){const v=f.differenceInCalendarDays(x.to,x.from);l>0&&v>l?x={from:n,to:void 0}:s>1&&v<s&&(x={from:n,to:void 0})}return x}function AM(n,a,s=Gn){const l=Array.isArray(a)?a:[a];let c=n.from;const f=s.differenceInCalendarDays(n.to,n.from),h=Math.min(f,6);for(let m=0;m<=h;m++){if(l.includes(c.getDay()))return!0;c=s.addDays(c,1)}return!1}function wy(n,a,s=Gn){return xa(n,a.from,!1,s)||xa(n,a.to,!1,s)||xa(a,n.from,!1,s)||xa(a,n.to,!1,s)}function TM(n,a,s=Gn){const l=Array.isArray(a)?a:[a];if(l.filter(m=>typeof m!="function").some(m=>typeof m=="boolean"?m:s.isDate(m)?xa(n,m,!1,s):mb(m,s)?m.some(p=>xa(n,p,!1,s)):_r(m)?m.from&&m.to?wy(n,{from:m.from,to:m.to},s):!1:hb(m)?AM(n,m.dayOfWeek,s):mf(m)?s.isAfter(m.before,m.after)?wy(n,{from:s.addDays(m.after,1),to:s.addDays(m.before,-1)},s):ba(n.from,m,s)||ba(n.to,m,s):pf(m)||gf(m)?ba(n.from,m,s)||ba(n.to,m,s):!1))return!0;const h=l.filter(m=>typeof m=="function");if(h.length){let m=n.from;const p=s.differenceInCalendarDays(n.to,n.from);for(let y=0;y<=p;y++){if(h.some(C=>C(m)))return!0;m=s.addDays(m,1)}}return!1}function jM(n,a){const{disabled:s,excludeDisabled:l,selected:c,required:f,onSelect:h}=n,[m,p]=zr(c,h?c:void 0),y=h?c:m;return{selected:y,select:(v,N,w)=>{const{min:M,max:E}=n,j=v?kM(v,y,M,E,f,a):void 0;return l&&s&&j?.from&&j.to&&TM({from:j.from,to:j.to},s,a)&&(j.from=v,j.to=void 0),h||p(j),h?.(j,v,N,w),j},isSelected:v=>y&&xa(y,v,!1,a)}}function MM(n,a){const{selected:s,required:l,onSelect:c}=n,[f,h]=zr(s,c?s:void 0),m=c?s:f,{isSameDay:p}=a;return{selected:m,select:(x,v,N)=>{let w=x;return!l&&m&&m&&p(x,m)&&(w=void 0),c||h(w),c?.(w,x,v,N),w},isSelected:x=>m?p(m,x):!1}}function DM(n,a){const s=MM(n,a),l=NM(n,a),c=jM(n,a);switch(n.mode){case"single":return s;case"multiple":return l;case"range":return c;default:return}}function Rt(n,a){return n instanceof ya&&n.timeZone===a?n:new ya(n,a)}function Ny(n,a){return typeof n=="boolean"||typeof n=="function"?n:n instanceof Date?Rt(n,a):Array.isArray(n)?n.map(s=>s instanceof Date?Rt(s,a):s):_r(n)?{...n,from:n.from?Rt(n.from,a):n.from,to:n.to?Rt(n.to,a):n.to}:mf(n)?{before:Rt(n.before,a),after:Rt(n.after,a)}:pf(n)?{after:Rt(n.after,a)}:gf(n)?{before:Rt(n.before,a)}:n}function md(n,a){return n&&(Array.isArray(n)?n.map(s=>Ny(s,a)):Ny(n,a))}function EM(n){let a=n;const s=a.timeZone;if(s&&(a={...n,timeZone:s},a.today&&(a.today=Rt(a.today,s)),a.month&&(a.month=Rt(a.month,s)),a.defaultMonth&&(a.defaultMonth=Rt(a.defaultMonth,s)),a.startMonth&&(a.startMonth=Rt(a.startMonth,s)),a.endMonth&&(a.endMonth=Rt(a.endMonth,s)),a.mode==="single"&&a.selected?a.selected=Rt(a.selected,s):a.mode==="multiple"&&a.selected?a.selected=a.selected?.map(me=>Rt(me,s)):a.mode==="range"&&a.selected&&(a.selected={from:a.selected.from?Rt(a.selected.from,s):a.selected.from,to:a.selected.to?Rt(a.selected.to,s):a.selected.to}),a.disabled!==void 0&&(a.disabled=md(a.disabled,s)),a.hidden!==void 0&&(a.hidden=md(a.hidden,s)),a.modifiers)){const me={};Object.keys(a.modifiers).forEach(Ae=>{me[Ae]=md(a.modifiers?.[Ae],s)}),a.modifiers=me}const{components:l,formatters:c,labels:f,dateLib:h,locale:m,classNames:p}=S.useMemo(()=>{const me={...ub,...a.locale},Ae=new un({locale:me,weekStartsOn:a.broadcastCalendar?1:a.weekStartsOn,firstWeekContainsDate:a.firstWeekContainsDate,useAdditionalWeekYearTokens:a.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:a.useAdditionalDayOfYearTokens,timeZone:a.timeZone,numerals:a.numerals},a.dateLib);return{dateLib:Ae,components:Bj(a.components),formatters:Zj(a.formatters),labels:aM(a.labels,Ae.options),locale:me,classNames:{...qj(),...a.classNames}}},[a.locale,a.broadcastCalendar,a.weekStartsOn,a.firstWeekContainsDate,a.useAdditionalWeekYearTokens,a.useAdditionalDayOfYearTokens,a.timeZone,a.numerals,a.dateLib,a.components,a.formatters,a.labels,a.classNames]);a.today||(a={...a,today:h.today()});const{captionLayout:y,mode:C,navLayout:x,numberOfMonths:v=1,onDayBlur:N,onDayClick:w,onDayFocus:M,onDayKeyDown:E,onDayMouseEnter:j,onDayMouseLeave:H,onNextClick:B,onPrevClick:U,showWeekNumber:O,styles:k}=a,{formatCaption:z,formatDay:X,formatMonthDropdown:W,formatWeekNumber:Q,formatWeekNumberHeader:ae,formatWeekdayName:ee,formatYearDropdown:ye}=c,fe=vM(a,h),{days:Ce,months:R,navStart:V,navEnd:ie,previousMonth:$,nextMonth:se,goToMonth:ne}=fe,Ne=Ij(Ce,a,V,ie,h),{isSelected:F,select:J,selected:ce}=DM(a,h)??{},{blur:te,focused:le,isFocusTarget:xe,moveFocus:Pe,setFocused:Ye}=wM(a,fe,Ne,F??(()=>!1),h),{labelDayButton:St,labelGridcell:Ct,labelGrid:Fe,labelMonthDropdown:ot,labelNav:Ut,labelPrevious:Qt,labelNext:Yn,labelWeekday:Te,labelWeekNumber:Wt,labelWeekNumberHeader:En,labelYearDropdown:$t}=f,Sa=S.useMemo(()=>sM(h,a.ISOWeek,a.broadcastCalendar,a.today),[h,a.ISOWeek,a.broadcastCalendar,a.today]),Vn=C!==void 0||w!==void 0,ht=S.useCallback(()=>{$&&(ne($),U?.($))},[$,ne,U]),Xt=S.useCallback(()=>{se&&(ne(se),B?.(se))},[ne,se,B]),Fn=S.useCallback((me,Ae)=>ve=>{ve.preventDefault(),ve.stopPropagation(),Ye(me),!Ae.disabled&&(J?.(me.date,Ae,ve),w?.(me.date,Ae,ve))},[J,w,Ye]),ei=S.useCallback((me,Ae)=>ve=>{Ye(me),M?.(me.date,Ae,ve)},[M,Ye]),On=S.useCallback((me,Ae)=>ve=>{te(),N?.(me.date,Ae,ve)},[te,N]),Rn=S.useCallback((me,Ae)=>ve=>{const Oe={ArrowLeft:[ve.shiftKey?"month":"day",a.dir==="rtl"?"after":"before"],ArrowRight:[ve.shiftKey?"month":"day",a.dir==="rtl"?"before":"after"],ArrowDown:[ve.shiftKey?"year":"week","after"],ArrowUp:[ve.shiftKey?"year":"week","before"],PageUp:[ve.shiftKey?"year":"month","before"],PageDown:[ve.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Oe[ve.key]){ve.preventDefault(),ve.stopPropagation();const[tt,we]=Oe[ve.key];Pe(tt,we)}E?.(me.date,Ae,ve)},[Pe,E,a.dir]),Ti=S.useCallback((me,Ae)=>ve=>{j?.(me.date,Ae,ve)},[j]),wo=S.useCallback((me,Ae)=>ve=>{H?.(me.date,Ae,ve)},[H]),No=S.useCallback(me=>Ae=>{const ve=Number(Ae.target.value),Oe=h.setMonth(h.startOfMonth(me),ve);ne(Oe)},[h,ne]),Qn=S.useCallback(me=>Ae=>{const ve=Number(Ae.target.value),Oe=h.setYear(h.startOfMonth(me),ve);ne(Oe)},[h,ne]),{className:Z,style:De}=S.useMemo(()=>({className:[p[pe.Root],a.className].filter(Boolean).join(" "),style:{...k?.[pe.Root],...a.style}}),[p,a.className,a.style,k]),be=Kj(a),Ee=S.useRef(null);dM(Ee,!!a.animate,{classNames:p,months:R,focused:le,dateLib:h});const st={dayPickerProps:a,selected:ce,select:J,isSelected:F,months:R,nextMonth:se,previousMonth:$,goToMonth:ne,getModifiers:Ne,components:l,classNames:p,styles:k,labels:f,formatters:c};return oe.createElement(fb.Provider,{value:st},oe.createElement(l.Root,{rootRef:a.animate?Ee:void 0,className:Z,style:De,dir:a.dir,id:a.id,lang:a.lang,nonce:a.nonce,title:a.title,role:a.role,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],...be},oe.createElement(l.Months,{className:p[pe.Months],style:k?.[pe.Months]},!a.hideNavigation&&!x&&oe.createElement(l.Nav,{"data-animated-nav":a.animate?"true":void 0,className:p[pe.Nav],style:k?.[pe.Nav],"aria-label":Ut(),onPreviousClick:ht,onNextClick:Xt,previousMonth:$,nextMonth:se}),R.map((me,Ae)=>oe.createElement(l.Month,{"data-animated-month":a.animate?"true":void 0,className:p[pe.Month],style:k?.[pe.Month],key:Ae,displayIndex:Ae,calendarMonth:me},x==="around"&&!a.hideNavigation&&Ae===0&&oe.createElement(l.PreviousMonthButton,{type:"button",className:p[pe.PreviousMonthButton],tabIndex:$?void 0:-1,"aria-disabled":$?void 0:!0,"aria-label":Qt($),onClick:ht,"data-animated-button":a.animate?"true":void 0},oe.createElement(l.Chevron,{disabled:$?void 0:!0,className:p[pe.Chevron],orientation:a.dir==="rtl"?"right":"left"})),oe.createElement(l.MonthCaption,{"data-animated-caption":a.animate?"true":void 0,className:p[pe.MonthCaption],style:k?.[pe.MonthCaption],calendarMonth:me,displayIndex:Ae},y?.startsWith("dropdown")?oe.createElement(l.DropdownNav,{className:p[pe.Dropdowns],style:k?.[pe.Dropdowns]},(()=>{const ve=y==="dropdown"||y==="dropdown-months"?oe.createElement(l.MonthsDropdown,{key:"month",className:p[pe.MonthsDropdown],"aria-label":ot(),classNames:p,components:l,disabled:!!a.disableNavigation,onChange:No(me.date),options:iM(me.date,V,ie,c,h),style:k?.[pe.Dropdown],value:h.getMonth(me.date)}):oe.createElement("span",{key:"month"},W(me.date,h)),Oe=y==="dropdown"||y==="dropdown-years"?oe.createElement(l.YearsDropdown,{key:"year",className:p[pe.YearsDropdown],"aria-label":$t(h.options),classNames:p,components:l,disabled:!!a.disableNavigation,onChange:Qn(me.date),options:lM(V,ie,c,h,!!a.reverseYears),style:k?.[pe.Dropdown],value:h.getYear(me.date)}):oe.createElement("span",{key:"year"},ye(me.date,h));return h.getMonthYearOrder()==="year-first"?[Oe,ve]:[ve,Oe]})(),oe.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},z(me.date,h.options,h))):oe.createElement(l.CaptionLabel,{className:p[pe.CaptionLabel],role:"status","aria-live":"polite"},z(me.date,h.options,h))),x==="around"&&!a.hideNavigation&&Ae===v-1&&oe.createElement(l.NextMonthButton,{type:"button",className:p[pe.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":Yn(se),onClick:Xt,"data-animated-button":a.animate?"true":void 0},oe.createElement(l.Chevron,{disabled:se?void 0:!0,className:p[pe.Chevron],orientation:a.dir==="rtl"?"left":"right"})),Ae===v-1&&x==="after"&&!a.hideNavigation&&oe.createElement(l.Nav,{"data-animated-nav":a.animate?"true":void 0,className:p[pe.Nav],style:k?.[pe.Nav],"aria-label":Ut(),onPreviousClick:ht,onNextClick:Xt,previousMonth:$,nextMonth:se}),oe.createElement(l.MonthGrid,{role:"grid","aria-multiselectable":C==="multiple"||C==="range","aria-label":Fe(me.date,h.options,h)||void 0,className:p[pe.MonthGrid],style:k?.[pe.MonthGrid]},!a.hideWeekdays&&oe.createElement(l.Weekdays,{"data-animated-weekdays":a.animate?"true":void 0,className:p[pe.Weekdays],style:k?.[pe.Weekdays]},O&&oe.createElement(l.WeekNumberHeader,{"aria-label":En(h.options),className:p[pe.WeekNumberHeader],style:k?.[pe.WeekNumberHeader],scope:"col"},ae()),Sa.map(ve=>oe.createElement(l.Weekday,{"aria-label":Te(ve,h.options,h),className:p[pe.Weekday],key:String(ve),style:k?.[pe.Weekday],scope:"col"},ee(ve,h.options,h)))),oe.createElement(l.Weeks,{"data-animated-weeks":a.animate?"true":void 0,className:p[pe.Weeks],style:k?.[pe.Weeks]},me.weeks.map(ve=>oe.createElement(l.Week,{className:p[pe.Week],key:ve.weekNumber,style:k?.[pe.Week],week:ve},O&&oe.createElement(l.WeekNumber,{week:ve,style:k?.[pe.WeekNumber],"aria-label":Wt(ve.weekNumber,{locale:m}),className:p[pe.WeekNumber],scope:"row",role:"rowheader"},Q(ve.weekNumber,h)),ve.days.map(Oe=>{const{date:tt}=Oe,we=Ne(Oe);if(we[rt.focused]=!we.hidden&&!!le?.isEqualTo(Oe),we[jn.selected]=F?.(tt)||we.selected,_r(ce)){const{from:Zt,to:wn}=ce;we[jn.range_start]=!!(Zt&&wn&&h.isSameDay(tt,Zt)),we[jn.range_end]=!!(Zt&&wn&&h.isSameDay(tt,wn)),we[jn.range_middle]=xa(ce,tt,!0,h)}const Pt=oM(we,k,a.modifiersStyles),Wn=Hj(we,p,a.modifiersClassNames),Nt=!Vn&&!we.hidden?Ct(tt,we,h.options,h):void 0;return oe.createElement(l.Day,{key:`${Oe.isoDate}_${Oe.displayMonthId}`,day:Oe,modifiers:we,className:Wn.join(" "),style:Pt,role:"gridcell","aria-selected":we.selected||void 0,"aria-label":Nt,"data-day":Oe.isoDate,"data-month":Oe.outside?Oe.dateMonthId:void 0,"data-selected":we.selected||void 0,"data-disabled":we.disabled||void 0,"data-hidden":we.hidden||void 0,"data-outside":Oe.outside||void 0,"data-focused":we.focused||void 0,"data-today":we.today||void 0},!we.hidden&&Vn?oe.createElement(l.DayButton,{className:p[pe.DayButton],style:k?.[pe.DayButton],type:"button",day:Oe,modifiers:we,disabled:!we.focused&&we.disabled||void 0,"aria-disabled":we.focused&&we.disabled||void 0,tabIndex:xe(Oe)?0:-1,"aria-label":St(tt,we,h.options,h),onClick:Fn(Oe,we),onBlur:On(Oe,we),onFocus:ei(Oe,we),onKeyDown:Rn(Oe,we),onMouseEnter:Ti(Oe,we),onMouseLeave:wo(Oe,we)},X(tt,h.options,h)):!we.hidden&&X(Oe.date,h.options,h))})))))))),a.footer&&oe.createElement(l.Footer,{className:p[pe.Footer],style:k?.[pe.Footer],role:"status","aria-live":"polite"},a.footer)))}function OM({className:n,classNames:a,showOutsideDays:s=!0,...l}){return r.jsx(EM,{showOutsideDays:s,className:K("p-2",n),classNames:{root:"relative",months:"flex flex-col sm:flex-row gap-2 sm:gap-4",month:"flex flex-col gap-2",month_caption:"flex justify-center pt-1 relative items-center h-8",caption_label:"text-sm font-medium",nav:"absolute inset-x-0 top-2 flex items-center justify-between px-1 z-10",button_previous:K(ar({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:K(ar({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),month_grid:"w-full border-collapse",weekdays:"flex w-full",weekday:"text-muted-foreground w-8 font-normal text-xs text-center",weeks:"flex flex-col",week:"flex w-full",day:K("relative h-8 w-8 p-0 text-center text-xs font-normal focus-within:relative focus-within:z-20","hover:bg-accent hover:text-accent-foreground rounded-full select-none"),day_button:K(ar({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:K("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-l-full aria-selected:rounded-r-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_end:K("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-r-full aria-selected:rounded-l-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_middle:K("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:K("bg-primary text-primary-foreground rounded-full","hover:bg-primary hover:text-primary-foreground","focus:bg-primary focus:text-primary-foreground"),today:"bg-accent text-accent-foreground rounded-full",outside:"text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...a},components:{Chevron:({orientation:c,className:f,...h})=>{const m=c==="left"?aC:c==="right"?yr:c==="up"?Od:vr;return r.jsx(m,{className:K("h-4 w-4",f),...h})}},...l})}OM.displayName="Calendar";const RM=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function oE({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:s,rawSettingsEnv:l,onChange:c,missingRequiredFields:f=[]}){const h=f.length>0;return r.jsx(S.Suspense,{fallback:r.jsxs("div",{className:"flex items-center justify-center h-full",children:[r.jsx(Dn,{className:"w-6 h-6 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:r.jsxs("div",{className:"h-full flex flex-col",children:[!a&&s!==null&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[r.jsx(vo,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&h&&r.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[r.jsx(qn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",r.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:f.join(", ")}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),r.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:r.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:r.jsx(RM,{value:n,onChange:c,language:"json",minHeight:"100%"})})}),r.jsx("div",{className:"mx-6 mb-4",children:r.jsx("div",{className:"border rounded-md overflow-hidden",children:r.jsx(df,{profileEnv:l})})})]})})}const sE={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},lE=[{id:"droid-target-support",title:"Factory Droid support is live",summary:"API Profiles and CLIProxy variants now support Droid as a first-class execution target.",primaryAction:"Set Droid as your default execution target for non-Claude workflows.",publishedAt:"2026-02-25",status:"new",scopes:["target","api-profiles","cliproxy"],entryIds:["droid-target","custom-api-profiles","codex-cliproxy","agy-cliproxy"],highlights:["Set default target to Droid when creating or editing API Profiles.","Set default target to Droid for CLIProxy variants, including Codex and Antigravity flows.","Use ccsd alias or --target droid for one-off target overrides."],actions:[{id:"open-api-profiles",label:"Set default target in API Profiles",description:"Open API Profiles and set Default Target to Droid for profiles you run often.",type:"route",path:"/providers"},{id:"open-cliproxy",label:"Set default target in CLIProxy variants",description:"Open CLIProxy variants and set target to Droid for Codex/Antigravity or custom variants.",type:"route",path:"/cliproxy"},{id:"copy-ccsd-command",label:"Run once with Droid alias",description:"Use ccsd to force Droid target with your current profile.",type:"command",command:"ccsd glm"},{id:"copy-target-override",label:"Run once with --target override",description:"Keep your default profile but force Droid for a single command.",type:"command",command:'ccs codex --target droid "your prompt"'}],routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccsd glm",'ccs codex --target droid "your prompt"',"ccs cliproxy create mycodex --provider codex --target droid"]},{id:"updates-center-launch",title:"Updates inbox is available for rollout tasks",summary:"A focused updates inbox exists for setup tasks and rollout guidance when you need it.",primaryAction:"Use this page only when needed for rollout tasks, then return to your normal workflow.",publishedAt:"2026-02-25",status:"new",scopes:["target","cliproxy","api-profiles","websearch"],entryIds:["droid-target","codex-cliproxy","custom-api-profiles","opencode-websearch"],highlights:["Single data source powers update content and integration mapping.","Notices can be tracked as new, seen, done, or dismissed.","Catalog covers target CLI, CLIProxy providers, and WebSearch integrations."],actions:[{id:"open-updates-page",label:"Open updates inbox when needed",description:"Review rollout tasks only when you want guided setup changes.",type:"route",path:"/updates"},{id:"copy-open-dashboard",label:"Open dashboard from terminal",description:"Re-open config dashboard anytime from CLI.",type:"command",command:"ccs config"}],routes:[{label:"Updates Inbox",path:"/updates"}],commands:["ccs config"]}],PM=[{id:"claude-target",name:"Claude Code",scope:"target",status:"stable",summary:"Default runtime target for all CCS profile types.",pillars:{baseUrl:"From profile settings (ANTHROPIC_BASE_URL)",auth:"From profile settings (ANTHROPIC_AUTH_TOKEN)",model:"From profile settings (ANTHROPIC_MODEL)"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs",'ccs glm "your prompt"']},{id:"droid-target",name:"Factory Droid",scope:"target",status:"new",summary:"First-class target for API Profiles and CLIProxy variants.",pillars:{baseUrl:"From profile or variant settings",auth:"From profile or variant settings",model:"From profile or variant settings"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccsd glm","ccs km --target droid","ccs codex --target droid"],notes:"Use ccsd alias for automatic Droid target selection."},{id:"codex-cliproxy",name:"Codex via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed provider with configurable variant model and target.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs codex","ccs cliproxy create mycodex --provider codex"]},{id:"gemini-cliproxy",name:"Gemini via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Gemini provider with multi-account management.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs gemini","ccs cliproxy create mygem --provider gemini"]},{id:"agy-cliproxy",name:"Antigravity via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Antigravity provider with variant target controls.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs agy","ccs cliproxy create myagy --provider agy --target droid"]},{id:"custom-api-profiles",name:"Custom API Profiles",scope:"api-profiles",status:"stable",summary:"Any Anthropic-compatible endpoint with per-profile target and model mapping.",pillars:{baseUrl:"User-defined endpoint",auth:"User-defined token/key",model:"User-defined model identifier"},routes:[{label:"API Profiles",path:"/providers"}],commands:["ccs api create myprofile",'ccs myprofile "your prompt"']},{id:"opencode-websearch",name:"OpenCode WebSearch",scope:"websearch",status:"stable",summary:"WebSearch provider surfaced in Settings for third-party profile workflows.",pillars:{baseUrl:"Managed by OpenCode CLI integration",auth:"Provider-specific (managed externally)",model:"Configurable in WebSearch settings"},routes:[{label:"Settings",path:"/settings"}],commands:["ccs config",'ccs codex "your prompt"'],notes:"Enable OpenCode in Settings > WebSearch to activate fallback search."}],LM=new Map(PM.map(n=>[n.id,n]));function rE(n){return n.entryIds.map(a=>LM.get(a)).filter(a=>!!a)}function cE(n){const a=new Date(`${n}T00:00:00Z`);return Number.isNaN(a.getTime())?n:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}).format(a)}function _M(){const{t:n}=_t(),[a,s]=S.useState(""),[l,c]=S.useState(""),[f,h]=S.useState(null),[m,p]=S.useState(!1),{login:y,authRequired:C,isAuthenticated:x}=Ud(),v=Dd(),w=gr().state?.from?.pathname||"/";if(S.useEffect(()=>{(x||!C)&&v(w,{replace:!0})},[x,C,v,w]),x||!C)return null;const M=async E=>{E.preventDefault(),h(null),p(!0);try{await y(a,l),v(w,{replace:!0})}catch(j){h(j instanceof Error?j.message:n("auth.loginFailed"))}finally{p(!1)}};return r.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:r.jsxs(OT,{className:"w-full max-w-sm",children:[r.jsxs(RT,{className:"space-y-1 text-center",children:[r.jsx("div",{className:"mx-auto mb-2 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:r.jsx(iC,{className:"h-6 w-6 text-primary"})}),r.jsx(PT,{className:"text-2xl",children:n("auth.dashboardTitle")}),r.jsx(LT,{children:n("auth.loginDescription")})]}),r.jsx(_T,{children:r.jsxs("form",{onSubmit:M,className:"space-y-4",children:[f&&r.jsxs(lf,{variant:"destructive",children:[r.jsx(Cr,{className:"h-4 w-4"}),r.jsx(rf,{children:f})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ln,{htmlFor:"username",children:n("auth.username")}),r.jsx(Un,{id:"username",type:"text",value:a,onChange:E=>s(E.target.value),placeholder:n("auth.usernamePlaceholder"),autoComplete:"username",disabled:m,required:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ln,{htmlFor:"password",children:n("auth.password")}),r.jsx(Un,{id:"password",type:"password",value:l,onChange:E=>c(E.target.value),placeholder:n("auth.passwordPlaceholder"),autoComplete:"current-password",disabled:m,required:!0})]}),r.jsx(ft,{type:"submit",className:"w-full",disabled:m,children:m?r.jsxs(r.Fragment,{children:[r.jsx(Dn,{className:"mr-2 h-4 w-4 animate-spin"}),n("auth.signingIn")]}):n("auth.signIn")})]})})]})})}const zM=S.lazy(()=>gt(()=>import("./index-Br6LTYDi.js"),__vite__mapDeps([18,1,2,4,5,7,19,6,8,9])).then(n=>({default:n.AnalyticsPage}))),UM=S.lazy(()=>gt(()=>import("./api-NqhAOtK1.js"),__vite__mapDeps([20,1,2,5,21,15,6,4,22,7,8,9])).then(n=>({default:n.ApiPage}))),IM=S.lazy(()=>gt(()=>import("./cliproxy-BSKey7Yk.js"),__vite__mapDeps([23,1,2,5,13,6,4,14,15,24,21,22,3,7,8,9])).then(n=>({default:n.CliproxyPage}))),HM=S.lazy(()=>gt(()=>import("./cliproxy-control-panel-C-Yyhlim.js"),__vite__mapDeps([25,1,2,5,13,4,6,7,8,9])).then(n=>({default:n.CliproxyControlPanelPage}))),BM=S.lazy(()=>gt(()=>import("./copilot-D-MitpPb.js"),__vite__mapDeps([26,1,2,5,21,15,4,22,3,6,7,8,9])).then(n=>({default:n.CopilotPage}))),KM=S.lazy(()=>gt(()=>import("./cursor-BH8co9su.js"),__vite__mapDeps([27,1,2,6,5,13,3,22,4,7,8,9])).then(n=>({default:n.CursorPage}))),qM=S.lazy(()=>gt(()=>import("./droid-C4lLcCII.js"),__vite__mapDeps([28,1,2,6,5,4,22,7,8,9])).then(n=>({default:n.DroidPage}))),GM=S.lazy(()=>gt(()=>import("./accounts-BGeV6RYc.js"),__vite__mapDeps([29,1,2,5,15,6,4,24,7,8,9])).then(n=>({default:n.AccountsPage}))),YM=S.lazy(()=>gt(()=>Promise.resolve().then(()=>tj),void 0).then(n=>({default:n.SettingsPage}))),VM=S.lazy(()=>gt(()=>import("./health-BzfCtqqG.js"),__vite__mapDeps([30,1,2,5,6,4,7,8,9])).then(n=>({default:n.HealthPage}))),FM=S.lazy(()=>gt(()=>import("./shared-CKcd4Q-6.js"),__vite__mapDeps([31,1,2,4,5,6,7,8,9])).then(n=>({default:n.SharedPage}))),QM=S.lazy(()=>gt(()=>import("./updates-D-X3ZIXa.js"),__vite__mapDeps([32,1,2,4,5,6,7,8,9])).then(n=>({default:n.UpdatesPage})));function Cn(){return r.jsx("div",{className:"flex h-64 items-center justify-center",children:r.jsx(Dn,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function WM(){return r.jsx(NS,{client:ZC,children:r.jsx(Vw,{defaultTheme:"system",storageKey:"vite-ui-theme",children:r.jsx(Fw,{children:r.jsx(Zw,{children:r.jsxs(SS,{children:[r.jsxs(CS,{children:[r.jsx(Lt,{path:"/login",element:r.jsx(_M,{})}),r.jsx(Lt,{element:r.jsx(Jw,{}),children:r.jsxs(Lt,{element:r.jsx(Z1,{}),children:[r.jsx(Lt,{path:"/",element:r.jsx($A,{})}),r.jsx(Lt,{path:"/analytics",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(zM,{})})}),r.jsx(Lt,{path:"/updates",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(QM,{})})}),r.jsx(Lt,{path:"/providers",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(UM,{})})}),r.jsx(Lt,{path:"/cliproxy",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(IM,{})})}),r.jsx(Lt,{path:"/cliproxy/control-panel",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(HM,{})})}),r.jsx(Lt,{path:"/copilot",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(BM,{})})}),r.jsx(Lt,{path:"/cursor",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(KM,{})})}),r.jsx(Lt,{path:"/droid",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(qM,{})})}),r.jsx(Lt,{path:"/accounts",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(GM,{})})}),r.jsx(Lt,{path:"/settings",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(YM,{})})}),r.jsx(Lt,{path:"/health",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(VM,{})})}),r.jsx(Lt,{path:"/shared",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(FM,{})})})]})})]}),r.jsx(kS,{position:"top-right"})]})})})})})}const Tb=document.getElementById("root");if(!Tb)throw new Error("Root element not found. Failed to mount React application.");WC.createRoot(Tb).render(r.jsx(S.StrictMode,{children:r.jsx(WM,{})}));export{YD as $,tT as A,Wa as B,OT as C,lT as D,ID as E,BD as F,ZA as G,oT as H,Un as I,rT as J,HD as K,ln as L,t1 as M,n1 as N,a1 as O,ux as P,$x as Q,cf as R,Ge as S,$a as T,mr as U,Ad as V,He as W,GD as X,Be as Y,qD as Z,LT as _,_t as a,pD as a$,VD as a0,FD as a1,QD as a2,WD as a3,$D as a4,XD as a5,Jx as a6,ZD as a7,oD as a8,XN as a9,bN as aA,vN as aB,Mr as aC,jr as aD,Dr as aE,mx as aF,Ci as aG,U1 as aH,I1 as aI,H1 as aJ,B1 as aK,hx as aL,Mk as aM,Nx as aN,bD as aO,vD as aP,SD as aQ,CD as aR,tE as aS,rD as aT,e1 as aU,dD as aV,fD as aW,ZN as aX,JN as aY,hD as aZ,mD as a_,cD as aa,gD as ab,yD as ac,qd as ad,Gd as ae,Yd as af,Vd as ag,Fd as ah,JD as ai,UT as aj,eE as ak,Ja as al,OD as am,IT as an,PD as ao,xD as ap,RD as aq,LD as ar,qg as as,_D as at,q1 as au,S1 as av,DD as aw,M1 as ax,ED as ay,Ak as az,_T as b,uD as b0,Xd as b1,ws as b2,sD as b3,lD as b4,oE as b5,ib as b6,of as b7,Ps as b8,sf as b9,kD as bA,MD as bB,jD as bC,ar as bD,FA as ba,zD as bb,UD as bc,lf as bd,Vx as be,rf as bf,cE as bg,sE as bh,lE as bi,rE as bj,sb as bk,$T as bl,ZT as bm,AD as bn,wD as bo,ax as bp,Ew as bq,Mw as br,xd as bs,Ni as bt,Sw as bu,ww as bv,Tw as bw,Rw as bx,TD as by,ND as bz,K as c,ft as d,nE as e,aE as f,nj as g,OM as h,iD as i,RT as j,PT as k,mk as l,pk as m,So as n,iE as o,Xa as p,Za as q,bx as r,Zd as s,vx as t,_d as u,Jd as v,dr as w,ny as x,dT as y,KD as z};