@jyork0828/pi-pilot 0.0.6 → 0.1.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.
- package/dist/index.js +2462 -373
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/public/assets/ArtifactsPanel-54DnCPD8.js +1 -0
- package/public/assets/FilesPanel-CdZRy4b8.js +56 -0
- package/public/assets/ResizablePanelShell-Cbkq9Bs-.js +1 -0
- package/public/assets/ResourcesPanel-D-VhpjYO.js +24 -0
- package/public/assets/SessionTree-C9twS6vi.js +16 -0
- package/public/assets/SettingsPage-D84YbQn7.js +51 -0
- package/public/assets/TerminalPanel-9CEnUXvW.css +32 -0
- package/public/assets/TerminalPanel-DgOiuHnT.js +55 -0
- package/public/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/public/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/public/assets/index-B4g3DrFC.css +1 -0
- package/public/assets/index-DfuMmOel.js +248 -0
- package/public/assets/markdown-CY-Rm0E5.js +45 -0
- package/public/assets/shiki-BZ0sbaMe.js +152 -0
- package/public/index.html +12 -3
- package/public/assets/github-dark-DHJKELXO.js +0 -1
- package/public/assets/github-light-DAi9KRSo.js +0 -1
- package/public/assets/index-CsC5-YPT.js +0 -506
- package/public/assets/index-R8FKUxOS.css +0 -1
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/scss-D5BDwBP9.js","assets/ruby-CV7NnX5q.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/sql-CRqJ_cUM.js","assets/graphql-ChdNCCLP.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/cpp-DIPi6g--.js","assets/c-BIGW1oBm.js","assets/shellscript-Yzrsuije.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/php-Csjmro_R.js","assets/json-Cp-IABpG.js","assets/vue-DMJtu8ND.js","assets/svelte-DR4MIrkg.js","assets/elixir-CkH2-t6x.js","assets/SettingsPage-D84YbQn7.js","assets/markdown-CY-Rm0E5.js","assets/shiki-BZ0sbaMe.js","assets/ResourcesPanel-D-VhpjYO.js","assets/ResizablePanelShell-Cbkq9Bs-.js","assets/SessionTree-C9twS6vi.js","assets/ArtifactsPanel-54DnCPD8.js","assets/FilesPanel-CdZRy4b8.js","assets/TerminalPanel-DgOiuHnT.js","assets/TerminalPanel-9CEnUXvW.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var zm=Object.defineProperty;var Cc=e=>{throw TypeError(e)};var Um=(e,t,n)=>t in e?zm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yt=(e,t,n)=>Um(e,typeof t!="symbol"?t+"":t,n),xl=(e,t,n)=>t.has(e)||Cc("Cannot "+n);var v=(e,t,n)=>(xl(e,t,"read from private field"),n?n.call(e):t.get(e)),I=(e,t,n)=>t.has(e)?Cc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),L=(e,t,n,r)=>(xl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),q=(e,t,n)=>(xl(e,t,"access private method"),n);var Lo=(e,t,n,r)=>({set _(s){L(e,t,s,n)},get _(){return v(e,t,r)}});import{r as y,j as i,R as Oo,M as $m,a as qm}from"./markdown-CY-Rm0E5.js";import{_ as F,c as Bm,a as Qm}from"./shiki-BZ0sbaMe.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var Tf={exports:{}},st={},Pf={exports:{}},Rf={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* scheduler.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/(function(e){function t(M,A){var z=M.length;M.push(A);e:for(;0<z;){var Q=z-1>>>1,Z=M[Q];if(0<s(Z,A))M[Q]=A,M[z]=Z,z=Q;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var A=M[0],z=M.pop();if(z!==A){M[0]=z;e:for(var Q=0,Z=M.length,lt=Z>>>1;Q<lt;){var Me=2*(Q+1)-1,Ut=M[Me],Qe=Me+1,_e=M[Qe];if(0>s(Ut,z))Qe<Z&&0>s(_e,Ut)?(M[Q]=_e,M[Qe]=z,Q=Qe):(M[Q]=Ut,M[Me]=z,Q=Me);else if(Qe<Z&&0>s(_e,z))M[Q]=_e,M[Qe]=z,Q=Qe;else break e}}return A}function s(M,A){var z=M.sortIndex-A.sortIndex;return z!==0?z:M.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var u=[],c=[],p=1,h=null,d=3,w=!1,b=!1,g=!1,j=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(M){for(var A=n(c);A!==null;){if(A.callback===null)r(c);else if(A.startTime<=M)r(c),A.sortIndex=A.expirationTime,t(u,A);else break;A=n(c)}}function k(M){if(g=!1,x(M),!b)if(n(u)!==null)b=!0,Fe(C);else{var A=n(c);A!==null&&it(k,A.startTime-M)}}function C(M,A){b=!1,g&&(g=!1,f(E),E=-1),w=!0;var z=d;try{for(x(A),h=n(u);h!==null&&(!(h.expirationTime>A)||M&&!$());){var Q=h.callback;if(typeof Q=="function"){h.callback=null,d=h.priorityLevel;var Z=Q(h.expirationTime<=A);A=e.unstable_now(),typeof Z=="function"?h.callback=Z:h===n(u)&&r(u),x(A)}else r(u);h=n(u)}if(h!==null)var lt=!0;else{var Me=n(c);Me!==null&&it(k,Me.startTime-A),lt=!1}return lt}finally{h=null,d=z,w=!1}}var S=!1,N=null,E=-1,_=5,R=-1;function $(){return!(e.unstable_now()-R<_)}function U(){if(N!==null){var M=e.unstable_now();R=M;var A=!0;try{A=N(!0,M)}finally{A?me():(S=!1,N=null)}}else S=!1}var me;if(typeof m=="function")me=function(){m(U)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Se=ce.port2;ce.port1.onmessage=U,me=function(){Se.postMessage(null)}}else me=function(){j(U,0)};function Fe(M){N=M,S||(S=!0,me())}function it(M,A){E=j(function(){M(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){b||w||(b=!0,Fe(C))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(M){switch(d){case 1:case 2:case 3:var A=3;break;default:A=d}var z=d;d=A;try{return M()}finally{d=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,A){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var z=d;d=M;try{return A()}finally{d=z}},e.unstable_scheduleCallback=function(M,A,z){var Q=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?Q+z:Q):z=Q,M){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=z+Z,M={id:p++,callback:A,priorityLevel:M,startTime:z,expirationTime:Z,sortIndex:-1},z>Q?(M.sortIndex=z,t(c,M),n(u)===null&&M===n(c)&&(g?(f(E),E=-1):g=!0,it(k,z-Q))):(M.sortIndex=Z,t(u,M),b||w||(b=!0,Fe(C))),M},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(M){var A=d;return function(){var z=d;d=A;try{return M.apply(this,arguments)}finally{d=z}}}})(Rf);Pf.exports=Rf;var Hm=Pf.exports;/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-dom.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Vm=y,rt=Hm;function P(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Mf=new Set,Qs={};function xr(e,t){ts(e,t),ts(e+"Capture",t)}function ts(e,t){for(Qs[e]=t,e=0;e<t.length;e++)Mf.add(t[e])}var tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ea=Object.prototype.hasOwnProperty,Wm=/^[: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]*$/,_c={},Tc={};function Km(e){return ea.call(Tc,e)?!0:ea.call(_c,e)?!1:Wm.test(e)?Tc[e]=!0:(_c[e]=!0,!1)}function Gm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ym(e,t,n,r){if(t===null||typeof t>"u"||Gm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Be(e,t,n,r,s,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new Be(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Re[t]=new Be(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new Be(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new Be(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Re[e]=new Be(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new Be(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new Be(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new Be(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new Be(e,5,!1,e.toLowerCase(),null,!1,!1)});var gu=/[\-:]([a-z])/g;function xu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(gu,xu);Re[t]=new Be(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(gu,xu);Re[t]=new Be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(gu,xu);Re[t]=new Be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new Be(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new Be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new Be(e,1,!1,e.toLowerCase(),null,!0,!0)});function yu(e,t,n,r){var s=Re.hasOwnProperty(t)?Re[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ym(t,n,s,r)&&(n=null),r||s===null?Km(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var on=Vm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Io=Symbol.for("react.element"),kr=Symbol.for("react.portal"),jr=Symbol.for("react.fragment"),vu=Symbol.for("react.strict_mode"),ta=Symbol.for("react.profiler"),Lf=Symbol.for("react.provider"),Of=Symbol.for("react.context"),wu=Symbol.for("react.forward_ref"),na=Symbol.for("react.suspense"),ra=Symbol.for("react.suspense_list"),bu=Symbol.for("react.memo"),fn=Symbol.for("react.lazy"),If=Symbol.for("react.offscreen"),Pc=Symbol.iterator;function hs(e){return e===null||typeof e!="object"?null:(e=Pc&&e[Pc]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Object.assign,yl;function Ns(e){if(yl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yl=t&&t[1]||""}return`
|
|
19
|
+
`+yl+e}var vl=!1;function wl(e,t){if(!e||vl)return"";vl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
|
|
20
|
+
`),o=r.stack.split(`
|
|
21
|
+
`),l=s.length-1,a=o.length-1;1<=l&&0<=a&&s[l]!==o[a];)a--;for(;1<=l&&0<=a;l--,a--)if(s[l]!==o[a]){if(l!==1||a!==1)do if(l--,a--,0>a||s[l]!==o[a]){var u=`
|
|
22
|
+
`+s[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=a);break}}}finally{vl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ns(e):""}function Xm(e){switch(e.tag){case 5:return Ns(e.type);case 16:return Ns("Lazy");case 13:return Ns("Suspense");case 19:return Ns("SuspenseList");case 0:case 2:case 15:return e=wl(e.type,!1),e;case 11:return e=wl(e.type.render,!1),e;case 1:return e=wl(e.type,!0),e;default:return""}}function sa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case jr:return"Fragment";case kr:return"Portal";case ta:return"Profiler";case vu:return"StrictMode";case na:return"Suspense";case ra:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Of:return(e.displayName||"Context")+".Consumer";case Lf:return(e._context.displayName||"Context")+".Provider";case wu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bu:return t=e.displayName||null,t!==null?t:sa(e.type)||"Memo";case fn:t=e._payload,e=e._init;try{return sa(e(t))}catch{}}return null}function Jm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sa(t);case 8:return t===vu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function zn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Af(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Zm(e){var t=Af(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ao(e){e._valueTracker||(e._valueTracker=Zm(e))}function Df(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Af(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function mi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function oa(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Rc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=zn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ff(e,t){t=t.checked,t!=null&&yu(e,"checked",t,!1)}function ia(e,t){Ff(e,t);var n=zn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?la(e,t.type,n):t.hasOwnProperty("defaultValue")&&la(e,t.type,zn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Mc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function la(e,t,n){(t!=="number"||mi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Es=Array.isArray;function Or(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+zn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function aa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return ue({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Lc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(P(92));if(Es(n)){if(1<n.length)throw Error(P(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:zn(n)}}function zf(e,t){var n=zn(t.value),r=zn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Oc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Uf(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ua(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Uf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Do,$f=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Do=Do||document.createElement("div"),Do.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Do.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ms={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eg=["Webkit","ms","Moz","O"];Object.keys(Ms).forEach(function(e){eg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ms[t]=Ms[e]})});function qf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ms.hasOwnProperty(e)&&Ms[e]?(""+t).trim():t+"px"}function Bf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=qf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var tg=ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ca(e,t){if(t){if(tg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function da(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fa=null;function ku(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pa=null,Ir=null,Ar=null;function Ic(e){if(e=So(e)){if(typeof pa!="function")throw Error(P(280));var t=e.stateNode;t&&(t=Zi(t),pa(e.stateNode,e.type,t))}}function Qf(e){Ir?Ar?Ar.push(e):Ar=[e]:Ir=e}function Hf(){if(Ir){var e=Ir,t=Ar;if(Ar=Ir=null,Ic(e),t)for(e=0;e<t.length;e++)Ic(t[e])}}function Vf(e,t){return e(t)}function Wf(){}var bl=!1;function Kf(e,t,n){if(bl)return e(t,n);bl=!0;try{return Vf(e,t,n)}finally{bl=!1,(Ir!==null||Ar!==null)&&(Wf(),Hf())}}function Vs(e,t){var n=e.stateNode;if(n===null)return null;var r=Zi(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(P(231,t,typeof n));return n}var ha=!1;if(tn)try{var ms={};Object.defineProperty(ms,"passive",{get:function(){ha=!0}}),window.addEventListener("test",ms,ms),window.removeEventListener("test",ms,ms)}catch{ha=!1}function ng(e,t,n,r,s,o,l,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(p){this.onError(p)}}var Ls=!1,gi=null,xi=!1,ma=null,rg={onError:function(e){Ls=!0,gi=e}};function sg(e,t,n,r,s,o,l,a,u){Ls=!1,gi=null,ng.apply(rg,arguments)}function og(e,t,n,r,s,o,l,a,u){if(sg.apply(this,arguments),Ls){if(Ls){var c=gi;Ls=!1,gi=null}else throw Error(P(198));xi||(xi=!0,ma=c)}}function yr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Gf(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 Ac(e){if(yr(e)!==e)throw Error(P(188))}function ig(e){var t=e.alternate;if(!t){if(t=yr(e),t===null)throw Error(P(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Ac(s),e;if(o===r)return Ac(s),t;o=o.sibling}throw Error(P(188))}if(n.return!==r.return)n=s,r=o;else{for(var l=!1,a=s.child;a;){if(a===n){l=!0,n=s,r=o;break}if(a===r){l=!0,r=s,n=o;break}a=a.sibling}if(!l){for(a=o.child;a;){if(a===n){l=!0,n=o,r=s;break}if(a===r){l=!0,r=o,n=s;break}a=a.sibling}if(!l)throw Error(P(189))}}if(n.alternate!==r)throw Error(P(190))}if(n.tag!==3)throw Error(P(188));return n.stateNode.current===n?e:t}function Yf(e){return e=ig(e),e!==null?Xf(e):null}function Xf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xf(e);if(t!==null)return t;e=e.sibling}return null}var Jf=rt.unstable_scheduleCallback,Dc=rt.unstable_cancelCallback,lg=rt.unstable_shouldYield,ag=rt.unstable_requestPaint,ge=rt.unstable_now,ug=rt.unstable_getCurrentPriorityLevel,ju=rt.unstable_ImmediatePriority,Zf=rt.unstable_UserBlockingPriority,yi=rt.unstable_NormalPriority,cg=rt.unstable_LowPriority,ep=rt.unstable_IdlePriority,Gi=null,Dt=null;function dg(e){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(Gi,e,void 0,(e.current.flags&128)===128)}catch{}}var Et=Math.clz32?Math.clz32:hg,fg=Math.log,pg=Math.LN2;function hg(e){return e>>>=0,e===0?32:31-(fg(e)/pg|0)|0}var Fo=64,zo=4194304;function Cs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~s;a!==0?r=Cs(a):(o&=l,o!==0&&(r=Cs(o)))}else l=n&~s,l!==0?r=Cs(l):o!==0&&(r=Cs(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Et(t),s=1<<n,r|=e[n],t&=~s;return r}function mg(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gg(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var l=31-Et(o),a=1<<l,u=s[l];u===-1?(!(a&n)||a&r)&&(s[l]=mg(a,t)):u<=t&&(e.expiredLanes|=a),o&=~a}}function ga(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function tp(){var e=Fo;return Fo<<=1,!(Fo&4194240)&&(Fo=64),e}function kl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ko(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Et(t),e[t]=n}function xg(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Et(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function Su(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Et(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var J=0;function np(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var rp,Nu,sp,op,ip,xa=!1,Uo=[],Pn=null,Rn=null,Mn=null,Ws=new Map,Ks=new Map,gn=[],yg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fc(e,t){switch(e){case"focusin":case"focusout":Pn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":Ws.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(t.pointerId)}}function gs(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=So(t),t!==null&&Nu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function vg(e,t,n,r,s){switch(t){case"focusin":return Pn=gs(Pn,e,t,n,r,s),!0;case"dragenter":return Rn=gs(Rn,e,t,n,r,s),!0;case"mouseover":return Mn=gs(Mn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Ws.set(o,gs(Ws.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,Ks.set(o,gs(Ks.get(o)||null,e,t,n,r,s)),!0}return!1}function lp(e){var t=Kn(e.target);if(t!==null){var n=yr(t);if(n!==null){if(t=n.tag,t===13){if(t=Gf(n),t!==null){e.blockedOn=t,ip(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ri(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ya(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fa=r,n.target.dispatchEvent(r),fa=null}else return t=So(n),t!==null&&Nu(t),e.blockedOn=n,!1;t.shift()}return!0}function zc(e,t,n){ri(e)&&n.delete(t)}function wg(){xa=!1,Pn!==null&&ri(Pn)&&(Pn=null),Rn!==null&&ri(Rn)&&(Rn=null),Mn!==null&&ri(Mn)&&(Mn=null),Ws.forEach(zc),Ks.forEach(zc)}function xs(e,t){e.blockedOn===t&&(e.blockedOn=null,xa||(xa=!0,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,wg)))}function Gs(e){function t(s){return xs(s,e)}if(0<Uo.length){xs(Uo[0],e);for(var n=1;n<Uo.length;n++){var r=Uo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Pn!==null&&xs(Pn,e),Rn!==null&&xs(Rn,e),Mn!==null&&xs(Mn,e),Ws.forEach(t),Ks.forEach(t),n=0;n<gn.length;n++)r=gn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<gn.length&&(n=gn[0],n.blockedOn===null);)lp(n),n.blockedOn===null&&gn.shift()}var Dr=on.ReactCurrentBatchConfig,wi=!0;function bg(e,t,n,r){var s=J,o=Dr.transition;Dr.transition=null;try{J=1,Eu(e,t,n,r)}finally{J=s,Dr.transition=o}}function kg(e,t,n,r){var s=J,o=Dr.transition;Dr.transition=null;try{J=4,Eu(e,t,n,r)}finally{J=s,Dr.transition=o}}function Eu(e,t,n,r){if(wi){var s=ya(e,t,n,r);if(s===null)Ml(e,t,r,bi,n),Fc(e,r);else if(vg(s,e,t,n,r))r.stopPropagation();else if(Fc(e,r),t&4&&-1<yg.indexOf(e)){for(;s!==null;){var o=So(s);if(o!==null&&rp(o),o=ya(e,t,n,r),o===null&&Ml(e,t,r,bi,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Ml(e,t,r,null,n)}}var bi=null;function ya(e,t,n,r){if(bi=null,e=ku(r),e=Kn(e),e!==null)if(t=yr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gf(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return bi=e,null}function ap(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ug()){case ju:return 1;case Zf:return 4;case yi:case cg:return 16;case ep:return 536870912;default:return 16}default:return 16}}var _n=null,Cu=null,si=null;function up(){if(si)return si;var e,t=Cu,n=t.length,r,s="value"in _n?_n.value:_n.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===s[o-r];r++);return si=s.slice(e,1<r?1-r:void 0)}function oi(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 $o(){return!0}function Uc(){return!1}function ot(e){function t(n,r,s,o,l){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?$o:Uc,this.isPropagationStopped=Uc,this}return ue(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=$o)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$o)},persist:function(){},isPersistent:$o}),t}var as={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_u=ot(as),jo=ue({},as,{view:0,detail:0}),jg=ot(jo),jl,Sl,ys,Yi=ue({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tu,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!==ys&&(ys&&e.type==="mousemove"?(jl=e.screenX-ys.screenX,Sl=e.screenY-ys.screenY):Sl=jl=0,ys=e),jl)},movementY:function(e){return"movementY"in e?e.movementY:Sl}}),$c=ot(Yi),Sg=ue({},Yi,{dataTransfer:0}),Ng=ot(Sg),Eg=ue({},jo,{relatedTarget:0}),Nl=ot(Eg),Cg=ue({},as,{animationName:0,elapsedTime:0,pseudoElement:0}),_g=ot(Cg),Tg=ue({},as,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pg=ot(Tg),Rg=ue({},as,{data:0}),qc=ot(Rg),Mg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lg={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"},Og={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ig(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Og[e])?!!t[e]:!1}function Tu(){return Ig}var Ag=ue({},jo,{key:function(e){if(e.key){var t=Mg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=oi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Lg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tu,charCode:function(e){return e.type==="keypress"?oi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?oi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dg=ot(Ag),Fg=ue({},Yi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bc=ot(Fg),zg=ue({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tu}),Ug=ot(zg),$g=ue({},as,{propertyName:0,elapsedTime:0,pseudoElement:0}),qg=ot($g),Bg=ue({},Yi,{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}),Qg=ot(Bg),Hg=[9,13,27,32],Pu=tn&&"CompositionEvent"in window,Os=null;tn&&"documentMode"in document&&(Os=document.documentMode);var Vg=tn&&"TextEvent"in window&&!Os,cp=tn&&(!Pu||Os&&8<Os&&11>=Os),Qc=" ",Hc=!1;function dp(e,t){switch(e){case"keyup":return Hg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sr=!1;function Wg(e,t){switch(e){case"compositionend":return fp(t);case"keypress":return t.which!==32?null:(Hc=!0,Qc);case"textInput":return e=t.data,e===Qc&&Hc?null:e;default:return null}}function Kg(e,t){if(Sr)return e==="compositionend"||!Pu&&dp(e,t)?(e=up(),si=Cu=_n=null,Sr=!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 cp&&t.locale!=="ko"?null:t.data;default:return null}}var Gg={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 Vc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gg[e.type]:t==="textarea"}function pp(e,t,n,r){Qf(r),t=ki(t,"onChange"),0<t.length&&(n=new _u("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Is=null,Ys=null;function Yg(e){Sp(e,0)}function Xi(e){var t=Cr(e);if(Df(t))return e}function Xg(e,t){if(e==="change")return t}var hp=!1;if(tn){var El;if(tn){var Cl="oninput"in document;if(!Cl){var Wc=document.createElement("div");Wc.setAttribute("oninput","return;"),Cl=typeof Wc.oninput=="function"}El=Cl}else El=!1;hp=El&&(!document.documentMode||9<document.documentMode)}function Kc(){Is&&(Is.detachEvent("onpropertychange",mp),Ys=Is=null)}function mp(e){if(e.propertyName==="value"&&Xi(Ys)){var t=[];pp(t,Ys,e,ku(e)),Kf(Yg,t)}}function Jg(e,t,n){e==="focusin"?(Kc(),Is=t,Ys=n,Is.attachEvent("onpropertychange",mp)):e==="focusout"&&Kc()}function Zg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xi(Ys)}function ex(e,t){if(e==="click")return Xi(t)}function tx(e,t){if(e==="input"||e==="change")return Xi(t)}function nx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _t=typeof Object.is=="function"?Object.is:nx;function Xs(e,t){if(_t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!ea.call(t,s)||!_t(e[s],t[s]))return!1}return!0}function Gc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yc(e,t){var n=Gc(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Gc(n)}}function gp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xp(){for(var e=window,t=mi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=mi(e.document)}return t}function Ru(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rx(e){var t=xp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&gp(n.ownerDocument.documentElement,n)){if(r!==null&&Ru(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=Yc(n,o);var l=Yc(n,r);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var sx=tn&&"documentMode"in document&&11>=document.documentMode,Nr=null,va=null,As=null,wa=!1;function Xc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wa||Nr==null||Nr!==mi(r)||(r=Nr,"selectionStart"in r&&Ru(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),As&&Xs(As,r)||(As=r,r=ki(va,"onSelect"),0<r.length&&(t=new _u("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function qo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Er={animationend:qo("Animation","AnimationEnd"),animationiteration:qo("Animation","AnimationIteration"),animationstart:qo("Animation","AnimationStart"),transitionend:qo("Transition","TransitionEnd")},_l={},yp={};tn&&(yp=document.createElement("div").style,"AnimationEvent"in window||(delete Er.animationend.animation,delete Er.animationiteration.animation,delete Er.animationstart.animation),"TransitionEvent"in window||delete Er.transitionend.transition);function Ji(e){if(_l[e])return _l[e];if(!Er[e])return e;var t=Er[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yp)return _l[e]=t[n];return e}var vp=Ji("animationend"),wp=Ji("animationiteration"),bp=Ji("animationstart"),kp=Ji("transitionend"),jp=new Map,Jc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function $n(e,t){jp.set(e,t),xr(t,[e])}for(var Tl=0;Tl<Jc.length;Tl++){var Pl=Jc[Tl],ox=Pl.toLowerCase(),ix=Pl[0].toUpperCase()+Pl.slice(1);$n(ox,"on"+ix)}$n(vp,"onAnimationEnd");$n(wp,"onAnimationIteration");$n(bp,"onAnimationStart");$n("dblclick","onDoubleClick");$n("focusin","onFocus");$n("focusout","onBlur");$n(kp,"onTransitionEnd");ts("onMouseEnter",["mouseout","mouseover"]);ts("onMouseLeave",["mouseout","mouseover"]);ts("onPointerEnter",["pointerout","pointerover"]);ts("onPointerLeave",["pointerout","pointerover"]);xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xr("onBeforeInput",["compositionend","keypress","textInput","paste"]);xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _s="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(" "),lx=new Set("cancel close invalid load scroll toggle".split(" ").concat(_s));function Zc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,og(r,t,void 0,e),e.currentTarget=null}function Sp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var l=r.length-1;0<=l;l--){var a=r[l],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==o&&s.isPropagationStopped())break e;Zc(s,a,c),o=u}else for(l=0;l<r.length;l++){if(a=r[l],u=a.instance,c=a.currentTarget,a=a.listener,u!==o&&s.isPropagationStopped())break e;Zc(s,a,c),o=u}}}if(xi)throw e=ma,xi=!1,ma=null,e}function ne(e,t){var n=t[Na];n===void 0&&(n=t[Na]=new Set);var r=e+"__bubble";n.has(r)||(Np(t,e,2,!1),n.add(r))}function Rl(e,t,n){var r=0;t&&(r|=4),Np(n,e,r,t)}var Bo="_reactListening"+Math.random().toString(36).slice(2);function Js(e){if(!e[Bo]){e[Bo]=!0,Mf.forEach(function(n){n!=="selectionchange"&&(lx.has(n)||Rl(n,!1,e),Rl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bo]||(t[Bo]=!0,Rl("selectionchange",!1,t))}}function Np(e,t,n,r){switch(ap(t)){case 1:var s=bg;break;case 4:s=kg;break;default:s=Eu}n=s.bind(null,t,n,e),s=void 0,!ha||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Ml(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(l===4)for(l=r.return;l!==null;){var u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;l=l.return}for(;a!==null;){if(l=Kn(a),l===null)return;if(u=l.tag,u===5||u===6){r=o=l;continue e}a=a.parentNode}}r=r.return}Kf(function(){var c=o,p=ku(n),h=[];e:{var d=jp.get(e);if(d!==void 0){var w=_u,b=e;switch(e){case"keypress":if(oi(n)===0)break e;case"keydown":case"keyup":w=Dg;break;case"focusin":b="focus",w=Nl;break;case"focusout":b="blur",w=Nl;break;case"beforeblur":case"afterblur":w=Nl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":w=$c;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=Ng;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=Ug;break;case vp:case wp:case bp:w=_g;break;case kp:w=qg;break;case"scroll":w=jg;break;case"wheel":w=Qg;break;case"copy":case"cut":case"paste":w=Pg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=Bc}var g=(t&4)!==0,j=!g&&e==="scroll",f=g?d!==null?d+"Capture":null:d;g=[];for(var m=c,x;m!==null;){x=m;var k=x.stateNode;if(x.tag===5&&k!==null&&(x=k,f!==null&&(k=Vs(m,f),k!=null&&g.push(Zs(m,k,x)))),j)break;m=m.return}0<g.length&&(d=new w(d,b,null,n,p),h.push({event:d,listeners:g}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",d&&n!==fa&&(b=n.relatedTarget||n.fromElement)&&(Kn(b)||b[nn]))break e;if((w||d)&&(d=p.window===p?p:(d=p.ownerDocument)?d.defaultView||d.parentWindow:window,w?(b=n.relatedTarget||n.toElement,w=c,b=b?Kn(b):null,b!==null&&(j=yr(b),b!==j||b.tag!==5&&b.tag!==6)&&(b=null)):(w=null,b=c),w!==b)){if(g=$c,k="onMouseLeave",f="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(g=Bc,k="onPointerLeave",f="onPointerEnter",m="pointer"),j=w==null?d:Cr(w),x=b==null?d:Cr(b),d=new g(k,m+"leave",w,n,p),d.target=j,d.relatedTarget=x,k=null,Kn(p)===c&&(g=new g(f,m+"enter",b,n,p),g.target=x,g.relatedTarget=j,k=g),j=k,w&&b)t:{for(g=w,f=b,m=0,x=g;x;x=vr(x))m++;for(x=0,k=f;k;k=vr(k))x++;for(;0<m-x;)g=vr(g),m--;for(;0<x-m;)f=vr(f),x--;for(;m--;){if(g===f||f!==null&&g===f.alternate)break t;g=vr(g),f=vr(f)}g=null}else g=null;w!==null&&ed(h,d,w,g,!1),b!==null&&j!==null&&ed(h,j,b,g,!0)}}e:{if(d=c?Cr(c):window,w=d.nodeName&&d.nodeName.toLowerCase(),w==="select"||w==="input"&&d.type==="file")var C=Xg;else if(Vc(d))if(hp)C=tx;else{C=Zg;var S=Jg}else(w=d.nodeName)&&w.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(C=ex);if(C&&(C=C(e,c))){pp(h,C,n,p);break e}S&&S(e,d,c),e==="focusout"&&(S=d._wrapperState)&&S.controlled&&d.type==="number"&&la(d,"number",d.value)}switch(S=c?Cr(c):window,e){case"focusin":(Vc(S)||S.contentEditable==="true")&&(Nr=S,va=c,As=null);break;case"focusout":As=va=Nr=null;break;case"mousedown":wa=!0;break;case"contextmenu":case"mouseup":case"dragend":wa=!1,Xc(h,n,p);break;case"selectionchange":if(sx)break;case"keydown":case"keyup":Xc(h,n,p)}var N;if(Pu)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Sr?dp(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(cp&&n.locale!=="ko"&&(Sr||E!=="onCompositionStart"?E==="onCompositionEnd"&&Sr&&(N=up()):(_n=p,Cu="value"in _n?_n.value:_n.textContent,Sr=!0)),S=ki(c,E),0<S.length&&(E=new qc(E,e,null,n,p),h.push({event:E,listeners:S}),N?E.data=N:(N=fp(n),N!==null&&(E.data=N)))),(N=Vg?Wg(e,n):Kg(e,n))&&(c=ki(c,"onBeforeInput"),0<c.length&&(p=new qc("onBeforeInput","beforeinput",null,n,p),h.push({event:p,listeners:c}),p.data=N))}Sp(h,t)})}function Zs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ki(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Vs(e,n),o!=null&&r.unshift(Zs(e,o,s)),o=Vs(e,t),o!=null&&r.push(Zs(e,o,s))),e=e.return}return r}function vr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ed(e,t,n,r,s){for(var o=t._reactName,l=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,s?(u=Vs(n,o),u!=null&&l.unshift(Zs(n,u,a))):s||(u=Vs(n,o),u!=null&&l.push(Zs(n,u,a)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var ax=/\r\n?/g,ux=/\u0000|\uFFFD/g;function td(e){return(typeof e=="string"?e:""+e).replace(ax,`
|
|
23
|
+
`).replace(ux,"")}function Qo(e,t,n){if(t=td(t),td(e)!==t&&n)throw Error(P(425))}function ji(){}var ba=null,ka=null;function ja(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sa=typeof setTimeout=="function"?setTimeout:void 0,cx=typeof clearTimeout=="function"?clearTimeout:void 0,nd=typeof Promise=="function"?Promise:void 0,dx=typeof queueMicrotask=="function"?queueMicrotask:typeof nd<"u"?function(e){return nd.resolve(null).then(e).catch(fx)}:Sa;function fx(e){setTimeout(function(){throw e})}function Ll(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Gs(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Gs(t)}function Ln(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function rd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var us=Math.random().toString(36).slice(2),At="__reactFiber$"+us,eo="__reactProps$"+us,nn="__reactContainer$"+us,Na="__reactEvents$"+us,px="__reactListeners$"+us,hx="__reactHandles$"+us;function Kn(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nn]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=rd(e);e!==null;){if(n=e[At])return n;e=rd(e)}return t}e=n,n=e.parentNode}return null}function So(e){return e=e[At]||e[nn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function Zi(e){return e[eo]||null}var Ea=[],_r=-1;function qn(e){return{current:e}}function re(e){0>_r||(e.current=Ea[_r],Ea[_r]=null,_r--)}function ee(e,t){_r++,Ea[_r]=e.current,e.current=t}var Un={},De=qn(Un),Ge=qn(!1),ur=Un;function ns(e,t){var n=e.type.contextTypes;if(!n)return Un;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ye(e){return e=e.childContextTypes,e!=null}function Si(){re(Ge),re(De)}function sd(e,t,n){if(De.current!==Un)throw Error(P(168));ee(De,t),ee(Ge,n)}function Ep(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(P(108,Jm(e)||"Unknown",s));return ue({},n,r)}function Ni(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,ur=De.current,ee(De,e),ee(Ge,Ge.current),!0}function od(e,t,n){var r=e.stateNode;if(!r)throw Error(P(169));n?(e=Ep(e,t,ur),r.__reactInternalMemoizedMergedChildContext=e,re(Ge),re(De),ee(De,e)):re(Ge),ee(Ge,n)}var Ht=null,el=!1,Ol=!1;function Cp(e){Ht===null?Ht=[e]:Ht.push(e)}function mx(e){el=!0,Cp(e)}function Bn(){if(!Ol&&Ht!==null){Ol=!0;var e=0,t=J;try{var n=Ht;for(J=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ht=null,el=!1}catch(s){throw Ht!==null&&(Ht=Ht.slice(e+1)),Jf(ju,Bn),s}finally{J=t,Ol=!1}}return null}var Tr=[],Pr=0,Ei=null,Ci=0,ct=[],dt=0,cr=null,Yt=1,Xt="";function Vn(e,t){Tr[Pr++]=Ci,Tr[Pr++]=Ei,Ei=e,Ci=t}function _p(e,t,n){ct[dt++]=Yt,ct[dt++]=Xt,ct[dt++]=cr,cr=e;var r=Yt;e=Xt;var s=32-Et(r)-1;r&=~(1<<s),n+=1;var o=32-Et(t)+s;if(30<o){var l=s-s%5;o=(r&(1<<l)-1).toString(32),r>>=l,s-=l,Yt=1<<32-Et(t)+s|n<<s|r,Xt=o+e}else Yt=1<<o|n<<s|r,Xt=e}function Mu(e){e.return!==null&&(Vn(e,1),_p(e,1,0))}function Lu(e){for(;e===Ei;)Ei=Tr[--Pr],Tr[Pr]=null,Ci=Tr[--Pr],Tr[Pr]=null;for(;e===cr;)cr=ct[--dt],ct[dt]=null,Xt=ct[--dt],ct[dt]=null,Yt=ct[--dt],ct[dt]=null}var nt=null,tt=null,se=!1,jt=null;function Tp(e,t){var n=pt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function id(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,nt=e,tt=Ln(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,nt=e,tt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=cr!==null?{id:Yt,overflow:Xt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,nt=e,tt=null,!0):!1;default:return!1}}function Ca(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _a(e){if(se){var t=tt;if(t){var n=t;if(!id(e,t)){if(Ca(e))throw Error(P(418));t=Ln(n.nextSibling);var r=nt;t&&id(e,t)?Tp(r,n):(e.flags=e.flags&-4097|2,se=!1,nt=e)}}else{if(Ca(e))throw Error(P(418));e.flags=e.flags&-4097|2,se=!1,nt=e}}}function ld(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;nt=e}function Ho(e){if(e!==nt)return!1;if(!se)return ld(e),se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ja(e.type,e.memoizedProps)),t&&(t=tt)){if(Ca(e))throw Pp(),Error(P(418));for(;t;)Tp(e,t),t=Ln(t.nextSibling)}if(ld(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tt=Ln(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tt=null}}else tt=nt?Ln(e.stateNode.nextSibling):null;return!0}function Pp(){for(var e=tt;e;)e=Ln(e.nextSibling)}function rs(){tt=nt=null,se=!1}function Ou(e){jt===null?jt=[e]:jt.push(e)}var gx=on.ReactCurrentBatchConfig;function vs(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(P(309));var r=n.stateNode}if(!r)throw Error(P(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(l){var a=s.refs;l===null?delete a[o]:a[o]=l},t._stringRef=o,t)}if(typeof e!="string")throw Error(P(284));if(!n._owner)throw Error(P(290,e))}return e}function Vo(e,t){throw e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ad(e){var t=e._init;return t(e._payload)}function Rp(e){function t(f,m){if(e){var x=f.deletions;x===null?(f.deletions=[m],f.flags|=16):x.push(m)}}function n(f,m){if(!e)return null;for(;m!==null;)t(f,m),m=m.sibling;return null}function r(f,m){for(f=new Map;m!==null;)m.key!==null?f.set(m.key,m):f.set(m.index,m),m=m.sibling;return f}function s(f,m){return f=Dn(f,m),f.index=0,f.sibling=null,f}function o(f,m,x){return f.index=x,e?(x=f.alternate,x!==null?(x=x.index,x<m?(f.flags|=2,m):x):(f.flags|=2,m)):(f.flags|=1048576,m)}function l(f){return e&&f.alternate===null&&(f.flags|=2),f}function a(f,m,x,k){return m===null||m.tag!==6?(m=$l(x,f.mode,k),m.return=f,m):(m=s(m,x),m.return=f,m)}function u(f,m,x,k){var C=x.type;return C===jr?p(f,m,x.props.children,k,x.key):m!==null&&(m.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===fn&&ad(C)===m.type)?(k=s(m,x.props),k.ref=vs(f,m,x),k.return=f,k):(k=fi(x.type,x.key,x.props,null,f.mode,k),k.ref=vs(f,m,x),k.return=f,k)}function c(f,m,x,k){return m===null||m.tag!==4||m.stateNode.containerInfo!==x.containerInfo||m.stateNode.implementation!==x.implementation?(m=ql(x,f.mode,k),m.return=f,m):(m=s(m,x.children||[]),m.return=f,m)}function p(f,m,x,k,C){return m===null||m.tag!==7?(m=ar(x,f.mode,k,C),m.return=f,m):(m=s(m,x),m.return=f,m)}function h(f,m,x){if(typeof m=="string"&&m!==""||typeof m=="number")return m=$l(""+m,f.mode,x),m.return=f,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Io:return x=fi(m.type,m.key,m.props,null,f.mode,x),x.ref=vs(f,null,m),x.return=f,x;case kr:return m=ql(m,f.mode,x),m.return=f,m;case fn:var k=m._init;return h(f,k(m._payload),x)}if(Es(m)||hs(m))return m=ar(m,f.mode,x,null),m.return=f,m;Vo(f,m)}return null}function d(f,m,x,k){var C=m!==null?m.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return C!==null?null:a(f,m,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Io:return x.key===C?u(f,m,x,k):null;case kr:return x.key===C?c(f,m,x,k):null;case fn:return C=x._init,d(f,m,C(x._payload),k)}if(Es(x)||hs(x))return C!==null?null:p(f,m,x,k,null);Vo(f,x)}return null}function w(f,m,x,k,C){if(typeof k=="string"&&k!==""||typeof k=="number")return f=f.get(x)||null,a(m,f,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Io:return f=f.get(k.key===null?x:k.key)||null,u(m,f,k,C);case kr:return f=f.get(k.key===null?x:k.key)||null,c(m,f,k,C);case fn:var S=k._init;return w(f,m,x,S(k._payload),C)}if(Es(k)||hs(k))return f=f.get(x)||null,p(m,f,k,C,null);Vo(m,k)}return null}function b(f,m,x,k){for(var C=null,S=null,N=m,E=m=0,_=null;N!==null&&E<x.length;E++){N.index>E?(_=N,N=null):_=N.sibling;var R=d(f,N,x[E],k);if(R===null){N===null&&(N=_);break}e&&N&&R.alternate===null&&t(f,N),m=o(R,m,E),S===null?C=R:S.sibling=R,S=R,N=_}if(E===x.length)return n(f,N),se&&Vn(f,E),C;if(N===null){for(;E<x.length;E++)N=h(f,x[E],k),N!==null&&(m=o(N,m,E),S===null?C=N:S.sibling=N,S=N);return se&&Vn(f,E),C}for(N=r(f,N);E<x.length;E++)_=w(N,f,E,x[E],k),_!==null&&(e&&_.alternate!==null&&N.delete(_.key===null?E:_.key),m=o(_,m,E),S===null?C=_:S.sibling=_,S=_);return e&&N.forEach(function($){return t(f,$)}),se&&Vn(f,E),C}function g(f,m,x,k){var C=hs(x);if(typeof C!="function")throw Error(P(150));if(x=C.call(x),x==null)throw Error(P(151));for(var S=C=null,N=m,E=m=0,_=null,R=x.next();N!==null&&!R.done;E++,R=x.next()){N.index>E?(_=N,N=null):_=N.sibling;var $=d(f,N,R.value,k);if($===null){N===null&&(N=_);break}e&&N&&$.alternate===null&&t(f,N),m=o($,m,E),S===null?C=$:S.sibling=$,S=$,N=_}if(R.done)return n(f,N),se&&Vn(f,E),C;if(N===null){for(;!R.done;E++,R=x.next())R=h(f,R.value,k),R!==null&&(m=o(R,m,E),S===null?C=R:S.sibling=R,S=R);return se&&Vn(f,E),C}for(N=r(f,N);!R.done;E++,R=x.next())R=w(N,f,E,R.value,k),R!==null&&(e&&R.alternate!==null&&N.delete(R.key===null?E:R.key),m=o(R,m,E),S===null?C=R:S.sibling=R,S=R);return e&&N.forEach(function(U){return t(f,U)}),se&&Vn(f,E),C}function j(f,m,x,k){if(typeof x=="object"&&x!==null&&x.type===jr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Io:e:{for(var C=x.key,S=m;S!==null;){if(S.key===C){if(C=x.type,C===jr){if(S.tag===7){n(f,S.sibling),m=s(S,x.props.children),m.return=f,f=m;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===fn&&ad(C)===S.type){n(f,S.sibling),m=s(S,x.props),m.ref=vs(f,S,x),m.return=f,f=m;break e}n(f,S);break}else t(f,S);S=S.sibling}x.type===jr?(m=ar(x.props.children,f.mode,k,x.key),m.return=f,f=m):(k=fi(x.type,x.key,x.props,null,f.mode,k),k.ref=vs(f,m,x),k.return=f,f=k)}return l(f);case kr:e:{for(S=x.key;m!==null;){if(m.key===S)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(f,m.sibling),m=s(m,x.children||[]),m.return=f,f=m;break e}else{n(f,m);break}else t(f,m);m=m.sibling}m=ql(x,f.mode,k),m.return=f,f=m}return l(f);case fn:return S=x._init,j(f,m,S(x._payload),k)}if(Es(x))return b(f,m,x,k);if(hs(x))return g(f,m,x,k);Vo(f,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(f,m.sibling),m=s(m,x),m.return=f,f=m):(n(f,m),m=$l(x,f.mode,k),m.return=f,f=m),l(f)):n(f,m)}return j}var ss=Rp(!0),Mp=Rp(!1),_i=qn(null),Ti=null,Rr=null,Iu=null;function Au(){Iu=Rr=Ti=null}function Du(e){var t=_i.current;re(_i),e._currentValue=t}function Ta(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fr(e,t){Ti=e,Iu=Rr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ke=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(Iu!==e)if(e={context:e,memoizedValue:t,next:null},Rr===null){if(Ti===null)throw Error(P(308));Rr=e,Ti.dependencies={lanes:0,firstContext:e}}else Rr=Rr.next=e;return t}var Gn=null;function Fu(e){Gn===null?Gn=[e]:Gn.push(e)}function Lp(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Fu(t)):(n.next=s.next,s.next=n),t.interleaved=n,rn(e,r)}function rn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var pn=!1;function zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Op(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function On(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,rn(e,n)}return s=r.interleaved,s===null?(t.next=t,Fu(r)):(t.next=s.next,s.next=t),r.interleaved=t,rn(e,n)}function ii(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Su(e,n)}}function ud(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Pi(e,t,n,r){var s=e.updateQueue;pn=!1;var o=s.firstBaseUpdate,l=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var u=a,c=u.next;u.next=null,l===null?o=c:l.next=c,l=u;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==l&&(a===null?p.firstBaseUpdate=c:a.next=c,p.lastBaseUpdate=u))}if(o!==null){var h=s.baseState;l=0,p=c=u=null,a=o;do{var d=a.lane,w=a.eventTime;if((r&d)===d){p!==null&&(p=p.next={eventTime:w,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var b=e,g=a;switch(d=t,w=n,g.tag){case 1:if(b=g.payload,typeof b=="function"){h=b.call(w,h,d);break e}h=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=g.payload,d=typeof b=="function"?b.call(w,h,d):b,d==null)break e;h=ue({},h,d);break e;case 2:pn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=s.effects,d===null?s.effects=[a]:d.push(a))}else w={eventTime:w,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(c=p=w,u=h):p=p.next=w,l|=d;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;d=a,a=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(p===null&&(u=h),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=p,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);fr|=l,e.lanes=l,e.memoizedState=h}}function cd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(P(191,s));s.call(r)}}}var No={},Ft=qn(No),to=qn(No),no=qn(No);function Yn(e){if(e===No)throw Error(P(174));return e}function Uu(e,t){switch(ee(no,t),ee(to,e),ee(Ft,No),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ua(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ua(t,e)}re(Ft),ee(Ft,t)}function os(){re(Ft),re(to),re(no)}function Ip(e){Yn(no.current);var t=Yn(Ft.current),n=ua(t,e.type);t!==n&&(ee(to,e),ee(Ft,n))}function $u(e){to.current===e&&(re(Ft),re(to))}var le=qn(0);function Ri(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Il=[];function qu(){for(var e=0;e<Il.length;e++)Il[e]._workInProgressVersionPrimary=null;Il.length=0}var li=on.ReactCurrentDispatcher,Al=on.ReactCurrentBatchConfig,dr=0,ae=null,be=null,Ee=null,Mi=!1,Ds=!1,ro=0,xx=0;function Le(){throw Error(P(321))}function Bu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_t(e[n],t[n]))return!1;return!0}function Qu(e,t,n,r,s,o){if(dr=o,ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,li.current=e===null||e.memoizedState===null?bx:kx,e=n(r,s),Ds){o=0;do{if(Ds=!1,ro=0,25<=o)throw Error(P(301));o+=1,Ee=be=null,t.updateQueue=null,li.current=jx,e=n(r,s)}while(Ds)}if(li.current=Li,t=be!==null&&be.next!==null,dr=0,Ee=be=ae=null,Mi=!1,t)throw Error(P(300));return e}function Hu(){var e=ro!==0;return ro=0,e}function Rt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ee===null?ae.memoizedState=Ee=e:Ee=Ee.next=e,Ee}function gt(){if(be===null){var e=ae.alternate;e=e!==null?e.memoizedState:null}else e=be.next;var t=Ee===null?ae.memoizedState:Ee.next;if(t!==null)Ee=t,be=e;else{if(e===null)throw Error(P(310));be=e,e={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},Ee===null?ae.memoizedState=Ee=e:Ee=Ee.next=e}return Ee}function so(e,t){return typeof t=="function"?t(e):t}function Dl(e){var t=gt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=be,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var l=s.next;s.next=o.next,o.next=l}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var a=l=null,u=null,c=o;do{var p=c.lane;if((dr&p)===p)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var h={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(a=u=h,l=r):u=u.next=h,ae.lanes|=p,fr|=p}c=c.next}while(c!==null&&c!==o);u===null?l=r:u.next=a,_t(r,t.memoizedState)||(Ke=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,ae.lanes|=o,fr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fl(e){var t=gt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var l=s=s.next;do o=e(o,l.action),l=l.next;while(l!==s);_t(o,t.memoizedState)||(Ke=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ap(){}function Dp(e,t){var n=ae,r=gt(),s=t(),o=!_t(r.memoizedState,s);if(o&&(r.memoizedState=s,Ke=!0),r=r.queue,Vu(Up.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Ee!==null&&Ee.memoizedState.tag&1){if(n.flags|=2048,oo(9,zp.bind(null,n,r,s,t),void 0,null),Ce===null)throw Error(P(349));dr&30||Fp(n,t,s)}return s}function Fp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ae.updateQueue,t===null?(t={lastEffect:null,stores:null},ae.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zp(e,t,n,r){t.value=n,t.getSnapshot=r,$p(t)&&qp(e)}function Up(e,t,n){return n(function(){$p(t)&&qp(e)})}function $p(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_t(e,n)}catch{return!0}}function qp(e){var t=rn(e,1);t!==null&&Ct(t,e,1,-1)}function dd(e){var t=Rt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:so,lastRenderedState:e},t.queue=e,e=e.dispatch=wx.bind(null,ae,e),[t.memoizedState,e]}function oo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ae.updateQueue,t===null?(t={lastEffect:null,stores:null},ae.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Bp(){return gt().memoizedState}function ai(e,t,n,r){var s=Rt();ae.flags|=e,s.memoizedState=oo(1|t,n,void 0,r===void 0?null:r)}function tl(e,t,n,r){var s=gt();r=r===void 0?null:r;var o=void 0;if(be!==null){var l=be.memoizedState;if(o=l.destroy,r!==null&&Bu(r,l.deps)){s.memoizedState=oo(t,n,o,r);return}}ae.flags|=e,s.memoizedState=oo(1|t,n,o,r)}function fd(e,t){return ai(8390656,8,e,t)}function Vu(e,t){return tl(2048,8,e,t)}function Qp(e,t){return tl(4,2,e,t)}function Hp(e,t){return tl(4,4,e,t)}function Vp(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Wp(e,t,n){return n=n!=null?n.concat([e]):null,tl(4,4,Vp.bind(null,t,e),n)}function Wu(){}function Kp(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gp(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Yp(e,t,n){return dr&21?(_t(n,t)||(n=tp(),ae.lanes|=n,fr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function yx(e,t){var n=J;J=n!==0&&4>n?n:4,e(!0);var r=Al.transition;Al.transition={};try{e(!1),t()}finally{J=n,Al.transition=r}}function Xp(){return gt().memoizedState}function vx(e,t,n){var r=An(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Jp(e))Zp(t,n);else if(n=Lp(e,t,n,r),n!==null){var s=qe();Ct(n,e,r,s),eh(n,t,r)}}function wx(e,t,n){var r=An(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jp(e))Zp(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,a=o(l,n);if(s.hasEagerState=!0,s.eagerState=a,_t(a,l)){var u=t.interleaved;u===null?(s.next=s,Fu(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Lp(e,t,s,r),n!==null&&(s=qe(),Ct(n,e,r,s),eh(n,t,r))}}function Jp(e){var t=e.alternate;return e===ae||t!==null&&t===ae}function Zp(e,t){Ds=Mi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Su(e,n)}}var Li={readContext:mt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},bx={readContext:mt,useCallback:function(e,t){return Rt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:fd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ai(4194308,4,Vp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ai(4194308,4,e,t)},useInsertionEffect:function(e,t){return ai(4,2,e,t)},useMemo:function(e,t){var n=Rt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Rt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=vx.bind(null,ae,e),[r.memoizedState,e]},useRef:function(e){var t=Rt();return e={current:e},t.memoizedState=e},useState:dd,useDebugValue:Wu,useDeferredValue:function(e){return Rt().memoizedState=e},useTransition:function(){var e=dd(!1),t=e[0];return e=yx.bind(null,e[1]),Rt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ae,s=Rt();if(se){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),Ce===null)throw Error(P(349));dr&30||Fp(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,fd(Up.bind(null,r,o,e),[e]),r.flags|=2048,oo(9,zp.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Rt(),t=Ce.identifierPrefix;if(se){var n=Xt,r=Yt;n=(r&~(1<<32-Et(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ro++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=xx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},kx={readContext:mt,useCallback:Kp,useContext:mt,useEffect:Vu,useImperativeHandle:Wp,useInsertionEffect:Qp,useLayoutEffect:Hp,useMemo:Gp,useReducer:Dl,useRef:Bp,useState:function(){return Dl(so)},useDebugValue:Wu,useDeferredValue:function(e){var t=gt();return Yp(t,be.memoizedState,e)},useTransition:function(){var e=Dl(so)[0],t=gt().memoizedState;return[e,t]},useMutableSource:Ap,useSyncExternalStore:Dp,useId:Xp,unstable_isNewReconciler:!1},jx={readContext:mt,useCallback:Kp,useContext:mt,useEffect:Vu,useImperativeHandle:Wp,useInsertionEffect:Qp,useLayoutEffect:Hp,useMemo:Gp,useReducer:Fl,useRef:Bp,useState:function(){return Fl(so)},useDebugValue:Wu,useDeferredValue:function(e){var t=gt();return be===null?t.memoizedState=e:Yp(t,be.memoizedState,e)},useTransition:function(){var e=Fl(so)[0],t=gt().memoizedState;return[e,t]},useMutableSource:Ap,useSyncExternalStore:Dp,useId:Xp,unstable_isNewReconciler:!1};function wt(e,t){if(e&&e.defaultProps){t=ue({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Pa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ue({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var nl={isMounted:function(e){return(e=e._reactInternals)?yr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qe(),s=An(e),o=Jt(r,s);o.payload=t,n!=null&&(o.callback=n),t=On(e,o,s),t!==null&&(Ct(t,e,s,r),ii(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qe(),s=An(e),o=Jt(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=On(e,o,s),t!==null&&(Ct(t,e,s,r),ii(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qe(),r=An(e),s=Jt(n,r);s.tag=2,t!=null&&(s.callback=t),t=On(e,s,r),t!==null&&(Ct(t,e,r,n),ii(t,e,r))}};function pd(e,t,n,r,s,o,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,l):t.prototype&&t.prototype.isPureReactComponent?!Xs(n,r)||!Xs(s,o):!0}function th(e,t,n){var r=!1,s=Un,o=t.contextType;return typeof o=="object"&&o!==null?o=mt(o):(s=Ye(t)?ur:De.current,r=t.contextTypes,o=(r=r!=null)?ns(e,s):Un),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=nl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function hd(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&nl.enqueueReplaceState(t,t.state,null)}function Ra(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},zu(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=mt(o):(o=Ye(t)?ur:De.current,s.context=ns(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Pa(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&nl.enqueueReplaceState(s,s.state,null),Pi(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function is(e,t){try{var n="",r=t;do n+=Xm(r),r=r.return;while(r);var s=n}catch(o){s=`
|
|
24
|
+
Error generating stack: `+o.message+`
|
|
25
|
+
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function zl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ma(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Sx=typeof WeakMap=="function"?WeakMap:Map;function nh(e,t,n){n=Jt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ii||(Ii=!0,qa=r),Ma(e,t)},n}function rh(e,t,n){n=Jt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Ma(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Ma(e,t),typeof r!="function"&&(In===null?In=new Set([this]):In.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function md(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Sx;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Fx.bind(null,e,t,n),t.then(e,e))}function gd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function xd(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Jt(-1,1),t.tag=2,On(n,t,1))),n.lanes|=1),e)}var Nx=on.ReactCurrentOwner,Ke=!1;function Ue(e,t,n,r){t.child=e===null?Mp(t,null,n,r):ss(t,e.child,n,r)}function yd(e,t,n,r,s){n=n.render;var o=t.ref;return Fr(t,s),r=Qu(e,t,n,r,o,s),n=Hu(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sn(e,t,s)):(se&&n&&Mu(t),t.flags|=1,Ue(e,t,r,s),t.child)}function vd(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!tc(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,sh(e,t,o,r,s)):(e=fi(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var l=o.memoizedProps;if(n=n.compare,n=n!==null?n:Xs,n(l,r)&&e.ref===t.ref)return sn(e,t,s)}return t.flags|=1,e=Dn(o,r),e.ref=t.ref,e.return=t,t.child=e}function sh(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Xs(o,r)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Ke=!0);else return t.lanes=e.lanes,sn(e,t,s)}return La(e,t,n,r,s)}function oh(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ee(Lr,Je),Je|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ee(Lr,Je),Je|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ee(Lr,Je),Je|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ee(Lr,Je),Je|=r;return Ue(e,t,s,n),t.child}function ih(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function La(e,t,n,r,s){var o=Ye(n)?ur:De.current;return o=ns(t,o),Fr(t,s),n=Qu(e,t,n,r,o,s),r=Hu(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sn(e,t,s)):(se&&r&&Mu(t),t.flags|=1,Ue(e,t,n,s),t.child)}function wd(e,t,n,r,s){if(Ye(n)){var o=!0;Ni(t)}else o=!1;if(Fr(t,s),t.stateNode===null)ui(e,t),th(t,n,r),Ra(t,n,r,s),r=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var u=l.context,c=n.contextType;typeof c=="object"&&c!==null?c=mt(c):(c=Ye(n)?ur:De.current,c=ns(t,c));var p=n.getDerivedStateFromProps,h=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";h||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==r||u!==c)&&hd(t,l,r,c),pn=!1;var d=t.memoizedState;l.state=d,Pi(t,r,l,s),u=t.memoizedState,a!==r||d!==u||Ge.current||pn?(typeof p=="function"&&(Pa(t,n,p,r),u=t.memoizedState),(a=pn||pd(t,n,a,r,d,u,c))?(h||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),l.props=r,l.state=u,l.context=c,r=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,Op(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:wt(t.type,a),l.props=c,h=t.pendingProps,d=l.context,u=n.contextType,typeof u=="object"&&u!==null?u=mt(u):(u=Ye(n)?ur:De.current,u=ns(t,u));var w=n.getDerivedStateFromProps;(p=typeof w=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==h||d!==u)&&hd(t,l,r,u),pn=!1,d=t.memoizedState,l.state=d,Pi(t,r,l,s);var b=t.memoizedState;a!==h||d!==b||Ge.current||pn?(typeof w=="function"&&(Pa(t,n,w,r),b=t.memoizedState),(c=pn||pd(t,n,c,r,d,b,u)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,b,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,b,u)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),l.props=r,l.state=b,l.context=u,r=c):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Oa(e,t,n,r,o,s)}function Oa(e,t,n,r,s,o){ih(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return s&&od(t,n,!1),sn(e,t,o);r=t.stateNode,Nx.current=t;var a=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=ss(t,e.child,null,o),t.child=ss(t,null,a,o)):Ue(e,t,a,o),t.memoizedState=r.state,s&&od(t,n,!0),t.child}function lh(e){var t=e.stateNode;t.pendingContext?sd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sd(e,t.context,!1),Uu(e,t.containerInfo)}function bd(e,t,n,r,s){return rs(),Ou(s),t.flags|=256,Ue(e,t,n,r),t.child}var Ia={dehydrated:null,treeContext:null,retryLane:0};function Aa(e){return{baseLanes:e,cachePool:null,transitions:null}}function ah(e,t,n){var r=t.pendingProps,s=le.current,o=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ee(le,s&1),e===null)return _a(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,o?(r=t.mode,o=t.child,l={mode:"hidden",children:l},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=ol(l,r,0,null),e=ar(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Aa(n),t.memoizedState=Ia,e):Ku(t,l));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Ex(e,t,l,r,a,s,n);if(o){o=r.fallback,l=t.mode,s=e.child,a=s.sibling;var u={mode:"hidden",children:r.children};return!(l&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Dn(s,u),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=Dn(a,o):(o=ar(o,l,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,l=e.child.memoizedState,l=l===null?Aa(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~n,t.memoizedState=Ia,r}return o=e.child,e=o.sibling,r=Dn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ku(e,t){return t=ol({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wo(e,t,n,r){return r!==null&&Ou(r),ss(t,e.child,null,n),e=Ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ex(e,t,n,r,s,o,l){if(n)return t.flags&256?(t.flags&=-257,r=zl(Error(P(422))),Wo(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=ol({mode:"visible",children:r.children},s,0,null),o=ar(o,s,l,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&ss(t,e.child,null,l),t.child.memoizedState=Aa(l),t.memoizedState=Ia,o);if(!(t.mode&1))return Wo(e,t,l,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(P(419)),r=zl(o,r,void 0),Wo(e,t,l,r)}if(a=(l&e.childLanes)!==0,Ke||a){if(r=Ce,r!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|l)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,rn(e,s),Ct(r,e,s,-1))}return ec(),r=zl(Error(P(421))),Wo(e,t,l,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=zx.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,tt=Ln(s.nextSibling),nt=t,se=!0,jt=null,e!==null&&(ct[dt++]=Yt,ct[dt++]=Xt,ct[dt++]=cr,Yt=e.id,Xt=e.overflow,cr=t),t=Ku(t,r.children),t.flags|=4096,t)}function kd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ta(e.return,t,n)}function Ul(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function uh(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Ue(e,t,r.children,n),r=le.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kd(e,n,t);else if(e.tag===19)kd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ee(le,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Ri(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Ul(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ri(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Ul(t,!0,n,null,o);break;case"together":Ul(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ui(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,n=Dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cx(e,t,n){switch(t.tag){case 3:lh(t),rs();break;case 5:Ip(t);break;case 1:Ye(t.type)&&Ni(t);break;case 4:Uu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;ee(_i,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ee(le,le.current&1),t.flags|=128,null):n&t.child.childLanes?ah(e,t,n):(ee(le,le.current&1),e=sn(e,t,n),e!==null?e.sibling:null);ee(le,le.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return uh(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ee(le,le.current),r)break;return null;case 22:case 23:return t.lanes=0,oh(e,t,n)}return sn(e,t,n)}var ch,Da,dh,fh;ch=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Da=function(){};dh=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Yn(Ft.current);var o=null;switch(n){case"input":s=oa(e,s),r=oa(e,r),o=[];break;case"select":s=ue({},s,{value:void 0}),r=ue({},r,{value:void 0}),o=[];break;case"textarea":s=aa(e,s),r=aa(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ji)}ca(n,r);var l;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Qs.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(l in a)!a.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in u)u.hasOwnProperty(l)&&a[l]!==u[l]&&(n||(n={}),n[l]=u[l])}else n||(o||(o=[]),o.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Qs.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&ne("scroll",e),o||a===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};fh=function(e,t,n,r){n!==r&&(t.flags|=4)};function ws(e,t){if(!se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Oe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _x(e,t,n){var r=t.pendingProps;switch(Lu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return Ye(t.type)&&Si(),Oe(t),null;case 3:return r=t.stateNode,os(),re(Ge),re(De),qu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ho(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,jt!==null&&(Ha(jt),jt=null))),Da(e,t),Oe(t),null;case 5:$u(t);var s=Yn(no.current);if(n=t.type,e!==null&&t.stateNode!=null)dh(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(P(166));return Oe(t),null}if(e=Yn(Ft.current),Ho(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[At]=t,r[eo]=o,e=(t.mode&1)!==0,n){case"dialog":ne("cancel",r),ne("close",r);break;case"iframe":case"object":case"embed":ne("load",r);break;case"video":case"audio":for(s=0;s<_s.length;s++)ne(_s[s],r);break;case"source":ne("error",r);break;case"img":case"image":case"link":ne("error",r),ne("load",r);break;case"details":ne("toggle",r);break;case"input":Rc(r,o),ne("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},ne("invalid",r);break;case"textarea":Lc(r,o),ne("invalid",r)}ca(n,o),s=null;for(var l in o)if(o.hasOwnProperty(l)){var a=o[l];l==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&Qo(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Qo(r.textContent,a,e),s=["children",""+a]):Qs.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&ne("scroll",r)}switch(n){case"input":Ao(r),Mc(r,o,!0);break;case"textarea":Ao(r),Oc(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ji)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Uf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[At]=t,e[eo]=r,ch(e,t,!1,!1),t.stateNode=e;e:{switch(l=da(n,r),n){case"dialog":ne("cancel",e),ne("close",e),s=r;break;case"iframe":case"object":case"embed":ne("load",e),s=r;break;case"video":case"audio":for(s=0;s<_s.length;s++)ne(_s[s],e);s=r;break;case"source":ne("error",e),s=r;break;case"img":case"image":case"link":ne("error",e),ne("load",e),s=r;break;case"details":ne("toggle",e),s=r;break;case"input":Rc(e,r),s=oa(e,r),ne("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ue({},r,{value:void 0}),ne("invalid",e);break;case"textarea":Lc(e,r),s=aa(e,r),ne("invalid",e);break;default:s=r}ca(n,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var u=a[o];o==="style"?Bf(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&$f(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Hs(e,u):typeof u=="number"&&Hs(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Qs.hasOwnProperty(o)?u!=null&&o==="onScroll"&&ne("scroll",e):u!=null&&yu(e,o,u,l))}switch(n){case"input":Ao(e),Mc(e,r,!1);break;case"textarea":Ao(e),Oc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+zn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Or(e,!!r.multiple,o,!1):r.defaultValue!=null&&Or(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ji)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Oe(t),null;case 6:if(e&&t.stateNode!=null)fh(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(P(166));if(n=Yn(no.current),Yn(Ft.current),Ho(t)){if(r=t.stateNode,n=t.memoizedProps,r[At]=t,(o=r.nodeValue!==n)&&(e=nt,e!==null))switch(e.tag){case 3:Qo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Qo(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[At]=t,t.stateNode=r}return Oe(t),null;case 13:if(re(le),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(se&&tt!==null&&t.mode&1&&!(t.flags&128))Pp(),rs(),t.flags|=98560,o=!1;else if(o=Ho(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(P(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(P(317));o[At]=t}else rs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oe(t),o=!1}else jt!==null&&(Ha(jt),jt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||le.current&1?je===0&&(je=3):ec())),t.updateQueue!==null&&(t.flags|=4),Oe(t),null);case 4:return os(),Da(e,t),e===null&&Js(t.stateNode.containerInfo),Oe(t),null;case 10:return Du(t.type._context),Oe(t),null;case 17:return Ye(t.type)&&Si(),Oe(t),null;case 19:if(re(le),o=t.memoizedState,o===null)return Oe(t),null;if(r=(t.flags&128)!==0,l=o.rendering,l===null)if(r)ws(o,!1);else{if(je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Ri(e),l!==null){for(t.flags|=128,ws(o,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,l=o.alternate,l===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,e=l.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ee(le,le.current&1|2),t.child}e=e.sibling}o.tail!==null&&ge()>ls&&(t.flags|=128,r=!0,ws(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ri(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ws(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!se)return Oe(t),null}else 2*ge()-o.renderingStartTime>ls&&n!==1073741824&&(t.flags|=128,r=!0,ws(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ge(),t.sibling=null,n=le.current,ee(le,r?n&1|2:n&1),t):(Oe(t),null);case 22:case 23:return Zu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Je&1073741824&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function Tx(e,t){switch(Lu(t),t.tag){case 1:return Ye(t.type)&&Si(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(),re(Ge),re(De),qu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $u(t),null;case 13:if(re(le),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));rs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(le),null;case 4:return os(),null;case 10:return Du(t.type._context),null;case 22:case 23:return Zu(),null;case 24:return null;default:return null}}var Ko=!1,Ae=!1,Px=typeof WeakSet=="function"?WeakSet:Set,O=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pe(e,t,r)}else n.current=null}function Fa(e,t,n){try{n()}catch(r){pe(e,t,r)}}var jd=!1;function Rx(e,t){if(ba=wi,e=xp(),Ru(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,a=-1,u=-1,c=0,p=0,h=e,d=null;t:for(;;){for(var w;h!==n||s!==0&&h.nodeType!==3||(a=l+s),h!==o||r!==0&&h.nodeType!==3||(u=l+r),h.nodeType===3&&(l+=h.nodeValue.length),(w=h.firstChild)!==null;)d=h,h=w;for(;;){if(h===e)break t;if(d===n&&++c===s&&(a=l),d===o&&++p===r&&(u=l),(w=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=w}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ka={focusedElem:e,selectionRange:n},wi=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var g=b.memoizedProps,j=b.memoizedState,f=t.stateNode,m=f.getSnapshotBeforeUpdate(t.elementType===t.type?g:wt(t.type,g),j);f.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(k){pe(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return b=jd,jd=!1,b}function Fs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Fa(t,n,o)}s=s.next}while(s!==r)}}function rl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function za(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ph(e){var t=e.alternate;t!==null&&(e.alternate=null,ph(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[eo],delete t[Na],delete t[px],delete t[hx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hh(e){return e.tag===5||e.tag===3||e.tag===4}function Sd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ua(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ji));else if(r!==4&&(e=e.child,e!==null))for(Ua(e,t,n),e=e.sibling;e!==null;)Ua(e,t,n),e=e.sibling}function $a(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for($a(e,t,n),e=e.sibling;e!==null;)$a(e,t,n),e=e.sibling}var Te=null,kt=!1;function an(e,t,n){for(n=n.child;n!==null;)mh(e,t,n),n=n.sibling}function mh(e,t,n){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(Gi,n)}catch{}switch(n.tag){case 5:Ae||Mr(n,t);case 6:var r=Te,s=kt;Te=null,an(e,t,n),Te=r,kt=s,Te!==null&&(kt?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(kt?(e=Te,n=n.stateNode,e.nodeType===8?Ll(e.parentNode,n):e.nodeType===1&&Ll(e,n),Gs(e)):Ll(Te,n.stateNode));break;case 4:r=Te,s=kt,Te=n.stateNode.containerInfo,kt=!0,an(e,t,n),Te=r,kt=s;break;case 0:case 11:case 14:case 15:if(!Ae&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Fa(n,t,l),s=s.next}while(s!==r)}an(e,t,n);break;case 1:if(!Ae&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){pe(n,t,a)}an(e,t,n);break;case 21:an(e,t,n);break;case 22:n.mode&1?(Ae=(r=Ae)||n.memoizedState!==null,an(e,t,n),Ae=r):an(e,t,n);break;default:an(e,t,n)}}function Nd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Px),t.forEach(function(r){var s=Ux.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function vt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:Te=a.stateNode,kt=!1;break e;case 3:Te=a.stateNode.containerInfo,kt=!0;break e;case 4:Te=a.stateNode.containerInfo,kt=!0;break e}a=a.return}if(Te===null)throw Error(P(160));mh(o,l,s),Te=null,kt=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){pe(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)gh(t,e),t=t.sibling}function gh(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vt(t,e),Pt(e),r&4){try{Fs(3,e,e.return),rl(3,e)}catch(g){pe(e,e.return,g)}try{Fs(5,e,e.return)}catch(g){pe(e,e.return,g)}}break;case 1:vt(t,e),Pt(e),r&512&&n!==null&&Mr(n,n.return);break;case 5:if(vt(t,e),Pt(e),r&512&&n!==null&&Mr(n,n.return),e.flags&32){var s=e.stateNode;try{Hs(s,"")}catch(g){pe(e,e.return,g)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,l=n!==null?n.memoizedProps:o,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&Ff(s,o),da(a,l);var c=da(a,o);for(l=0;l<u.length;l+=2){var p=u[l],h=u[l+1];p==="style"?Bf(s,h):p==="dangerouslySetInnerHTML"?$f(s,h):p==="children"?Hs(s,h):yu(s,p,h,c)}switch(a){case"input":ia(s,o);break;case"textarea":zf(s,o);break;case"select":var d=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var w=o.value;w!=null?Or(s,!!o.multiple,w,!1):d!==!!o.multiple&&(o.defaultValue!=null?Or(s,!!o.multiple,o.defaultValue,!0):Or(s,!!o.multiple,o.multiple?[]:"",!1))}s[eo]=o}catch(g){pe(e,e.return,g)}}break;case 6:if(vt(t,e),Pt(e),r&4){if(e.stateNode===null)throw Error(P(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(g){pe(e,e.return,g)}}break;case 3:if(vt(t,e),Pt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gs(t.containerInfo)}catch(g){pe(e,e.return,g)}break;case 4:vt(t,e),Pt(e);break;case 13:vt(t,e),Pt(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Xu=ge())),r&4&&Nd(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Ae=(c=Ae)||p,vt(t,e),Ae=c):vt(t,e),Pt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(O=e,p=e.child;p!==null;){for(h=O=p;O!==null;){switch(d=O,w=d.child,d.tag){case 0:case 11:case 14:case 15:Fs(4,d,d.return);break;case 1:Mr(d,d.return);var b=d.stateNode;if(typeof b.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(g){pe(r,n,g)}}break;case 5:Mr(d,d.return);break;case 22:if(d.memoizedState!==null){Cd(h);continue}}w!==null?(w.return=d,O=w):Cd(h)}p=p.sibling}e:for(p=null,h=e;;){if(h.tag===5){if(p===null){p=h;try{s=h.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=h.stateNode,u=h.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=qf("display",l))}catch(g){pe(e,e.return,g)}}}else if(h.tag===6){if(p===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(g){pe(e,e.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;p===h&&(p=null),h=h.return}p===h&&(p=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:vt(t,e),Pt(e),r&4&&Nd(e);break;case 21:break;default:vt(t,e),Pt(e)}}function Pt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(hh(n)){var r=n;break e}n=n.return}throw Error(P(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Hs(s,""),r.flags&=-33);var o=Sd(e);$a(e,o,s);break;case 3:case 4:var l=r.stateNode.containerInfo,a=Sd(e);Ua(e,a,l);break;default:throw Error(P(161))}}catch(u){pe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mx(e,t,n){O=e,xh(e)}function xh(e,t,n){for(var r=(e.mode&1)!==0;O!==null;){var s=O,o=s.child;if(s.tag===22&&r){var l=s.memoizedState!==null||Ko;if(!l){var a=s.alternate,u=a!==null&&a.memoizedState!==null||Ae;a=Ko;var c=Ae;if(Ko=l,(Ae=u)&&!c)for(O=s;O!==null;)l=O,u=l.child,l.tag===22&&l.memoizedState!==null?_d(s):u!==null?(u.return=l,O=u):_d(s);for(;o!==null;)O=o,xh(o),o=o.sibling;O=s,Ko=a,Ae=c}Ed(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,O=o):Ed(e)}}function Ed(e){for(;O!==null;){var t=O;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ae||rl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ae)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:wt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&cd(t,o,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}cd(t,l,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var h=p.dehydrated;h!==null&&Gs(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}Ae||t.flags&512&&za(t)}catch(d){pe(t,t.return,d)}}if(t===e){O=null;break}if(n=t.sibling,n!==null){n.return=t.return,O=n;break}O=t.return}}function Cd(e){for(;O!==null;){var t=O;if(t===e){O=null;break}var n=t.sibling;if(n!==null){n.return=t.return,O=n;break}O=t.return}}function _d(e){for(;O!==null;){var t=O;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{rl(4,t)}catch(u){pe(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){pe(t,s,u)}}var o=t.return;try{za(t)}catch(u){pe(t,o,u)}break;case 5:var l=t.return;try{za(t)}catch(u){pe(t,l,u)}}}catch(u){pe(t,t.return,u)}if(t===e){O=null;break}var a=t.sibling;if(a!==null){a.return=t.return,O=a;break}O=t.return}}var Lx=Math.ceil,Oi=on.ReactCurrentDispatcher,Gu=on.ReactCurrentOwner,ht=on.ReactCurrentBatchConfig,K=0,Ce=null,xe=null,Pe=0,Je=0,Lr=qn(0),je=0,io=null,fr=0,sl=0,Yu=0,zs=null,We=null,Xu=0,ls=1/0,Qt=null,Ii=!1,qa=null,In=null,Go=!1,Tn=null,Ai=0,Us=0,Ba=null,ci=-1,di=0;function qe(){return K&6?ge():ci!==-1?ci:ci=ge()}function An(e){return e.mode&1?K&2&&Pe!==0?Pe&-Pe:gx.transition!==null?(di===0&&(di=tp()),di):(e=J,e!==0||(e=window.event,e=e===void 0?16:ap(e.type)),e):1}function Ct(e,t,n,r){if(50<Us)throw Us=0,Ba=null,Error(P(185));ko(e,n,r),(!(K&2)||e!==Ce)&&(e===Ce&&(!(K&2)&&(sl|=n),je===4&&xn(e,Pe)),Xe(e,r),n===1&&K===0&&!(t.mode&1)&&(ls=ge()+500,el&&Bn()))}function Xe(e,t){var n=e.callbackNode;gg(e,t);var r=vi(e,e===Ce?Pe:0);if(r===0)n!==null&&Dc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Dc(n),t===1)e.tag===0?mx(Td.bind(null,e)):Cp(Td.bind(null,e)),dx(function(){!(K&6)&&Bn()}),n=null;else{switch(np(r)){case 1:n=ju;break;case 4:n=Zf;break;case 16:n=yi;break;case 536870912:n=ep;break;default:n=yi}n=Nh(n,yh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function yh(e,t){if(ci=-1,di=0,K&6)throw Error(P(327));var n=e.callbackNode;if(zr()&&e.callbackNode!==n)return null;var r=vi(e,e===Ce?Pe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Di(e,r);else{t=r;var s=K;K|=2;var o=wh();(Ce!==e||Pe!==t)&&(Qt=null,ls=ge()+500,lr(e,t));do try{Ax();break}catch(a){vh(e,a)}while(!0);Au(),Oi.current=o,K=s,xe!==null?t=0:(Ce=null,Pe=0,t=je)}if(t!==0){if(t===2&&(s=ga(e),s!==0&&(r=s,t=Qa(e,s))),t===1)throw n=io,lr(e,0),xn(e,r),Xe(e,ge()),n;if(t===6)xn(e,r);else{if(s=e.current.alternate,!(r&30)&&!Ox(s)&&(t=Di(e,r),t===2&&(o=ga(e),o!==0&&(r=o,t=Qa(e,o))),t===1))throw n=io,lr(e,0),xn(e,r),Xe(e,ge()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(P(345));case 2:Wn(e,We,Qt);break;case 3:if(xn(e,r),(r&130023424)===r&&(t=Xu+500-ge(),10<t)){if(vi(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){qe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Sa(Wn.bind(null,e,We,Qt),t);break}Wn(e,We,Qt);break;case 4:if(xn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var l=31-Et(r);o=1<<l,l=t[l],l>s&&(s=l),r&=~o}if(r=s,r=ge()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Lx(r/1960))-r,10<r){e.timeoutHandle=Sa(Wn.bind(null,e,We,Qt),r);break}Wn(e,We,Qt);break;case 5:Wn(e,We,Qt);break;default:throw Error(P(329))}}}return Xe(e,ge()),e.callbackNode===n?yh.bind(null,e):null}function Qa(e,t){var n=zs;return e.current.memoizedState.isDehydrated&&(lr(e,t).flags|=256),e=Di(e,t),e!==2&&(t=We,We=n,t!==null&&Ha(t)),e}function Ha(e){We===null?We=e:We.push.apply(We,e)}function Ox(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!_t(o(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xn(e,t){for(t&=~Yu,t&=~sl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Et(t),r=1<<n;e[n]=-1,t&=~r}}function Td(e){if(K&6)throw Error(P(327));zr();var t=vi(e,0);if(!(t&1))return Xe(e,ge()),null;var n=Di(e,t);if(e.tag!==0&&n===2){var r=ga(e);r!==0&&(t=r,n=Qa(e,r))}if(n===1)throw n=io,lr(e,0),xn(e,t),Xe(e,ge()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wn(e,We,Qt),Xe(e,ge()),null}function Ju(e,t){var n=K;K|=1;try{return e(t)}finally{K=n,K===0&&(ls=ge()+500,el&&Bn())}}function pr(e){Tn!==null&&Tn.tag===0&&!(K&6)&&zr();var t=K;K|=1;var n=ht.transition,r=J;try{if(ht.transition=null,J=1,e)return e()}finally{J=r,ht.transition=n,K=t,!(K&6)&&Bn()}}function Zu(){Je=Lr.current,re(Lr)}function lr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,cx(n)),xe!==null)for(n=xe.return;n!==null;){var r=n;switch(Lu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Si();break;case 3:os(),re(Ge),re(De),qu();break;case 5:$u(r);break;case 4:os();break;case 13:re(le);break;case 19:re(le);break;case 10:Du(r.type._context);break;case 22:case 23:Zu()}n=n.return}if(Ce=e,xe=e=Dn(e.current,null),Pe=Je=t,je=0,io=null,Yu=sl=fr=0,We=zs=null,Gn!==null){for(t=0;t<Gn.length;t++)if(n=Gn[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var l=o.next;o.next=s,r.next=l}n.pending=r}Gn=null}return e}function vh(e,t){do{var n=xe;try{if(Au(),li.current=Li,Mi){for(var r=ae.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Mi=!1}if(dr=0,Ee=be=ae=null,Ds=!1,ro=0,Gu.current=null,n===null||n.return===null){je=1,io=t,xe=null;break}e:{var o=e,l=n.return,a=n,u=t;if(t=Pe,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,p=a,h=p.tag;if(!(p.mode&1)&&(h===0||h===11||h===15)){var d=p.alternate;d?(p.updateQueue=d.updateQueue,p.memoizedState=d.memoizedState,p.lanes=d.lanes):(p.updateQueue=null,p.memoizedState=null)}var w=gd(l);if(w!==null){w.flags&=-257,xd(w,l,a,o,t),w.mode&1&&md(o,c,t),t=w,u=c;var b=t.updateQueue;if(b===null){var g=new Set;g.add(u),t.updateQueue=g}else b.add(u);break e}else{if(!(t&1)){md(o,c,t),ec();break e}u=Error(P(426))}}else if(se&&a.mode&1){var j=gd(l);if(j!==null){!(j.flags&65536)&&(j.flags|=256),xd(j,l,a,o,t),Ou(is(u,a));break e}}o=u=is(u,a),je!==4&&(je=2),zs===null?zs=[o]:zs.push(o),o=l;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var f=nh(o,u,t);ud(o,f);break e;case 1:a=u;var m=o.type,x=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(In===null||!In.has(x)))){o.flags|=65536,t&=-t,o.lanes|=t;var k=rh(o,a,t);ud(o,k);break e}}o=o.return}while(o!==null)}kh(n)}catch(C){t=C,xe===n&&n!==null&&(xe=n=n.return);continue}break}while(!0)}function wh(){var e=Oi.current;return Oi.current=Li,e===null?Li:e}function ec(){(je===0||je===3||je===2)&&(je=4),Ce===null||!(fr&268435455)&&!(sl&268435455)||xn(Ce,Pe)}function Di(e,t){var n=K;K|=2;var r=wh();(Ce!==e||Pe!==t)&&(Qt=null,lr(e,t));do try{Ix();break}catch(s){vh(e,s)}while(!0);if(Au(),K=n,Oi.current=r,xe!==null)throw Error(P(261));return Ce=null,Pe=0,je}function Ix(){for(;xe!==null;)bh(xe)}function Ax(){for(;xe!==null&&!lg();)bh(xe)}function bh(e){var t=Sh(e.alternate,e,Je);e.memoizedProps=e.pendingProps,t===null?kh(e):xe=t,Gu.current=null}function kh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Tx(n,t),n!==null){n.flags&=32767,xe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{je=6,xe=null;return}}else if(n=_x(n,t,Je),n!==null){xe=n;return}if(t=t.sibling,t!==null){xe=t;return}xe=t=e}while(t!==null);je===0&&(je=5)}function Wn(e,t,n){var r=J,s=ht.transition;try{ht.transition=null,J=1,Dx(e,t,n,r)}finally{ht.transition=s,J=r}return null}function Dx(e,t,n,r){do zr();while(Tn!==null);if(K&6)throw Error(P(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(xg(e,o),e===Ce&&(xe=Ce=null,Pe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Go||(Go=!0,Nh(yi,function(){return zr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=ht.transition,ht.transition=null;var l=J;J=1;var a=K;K|=4,Gu.current=null,Rx(e,n),gh(n,e),rx(ka),wi=!!ba,ka=ba=null,e.current=n,Mx(n),ag(),K=a,J=l,ht.transition=o}else e.current=n;if(Go&&(Go=!1,Tn=e,Ai=s),o=e.pendingLanes,o===0&&(In=null),dg(n.stateNode),Xe(e,ge()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Ii)throw Ii=!1,e=qa,qa=null,e;return Ai&1&&e.tag!==0&&zr(),o=e.pendingLanes,o&1?e===Ba?Us++:(Us=0,Ba=e):Us=0,Bn(),null}function zr(){if(Tn!==null){var e=np(Ai),t=ht.transition,n=J;try{if(ht.transition=null,J=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,Ai=0,K&6)throw Error(P(331));var s=K;for(K|=4,O=e.current;O!==null;){var o=O,l=o.child;if(O.flags&16){var a=o.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[u];for(O=c;O!==null;){var p=O;switch(p.tag){case 0:case 11:case 15:Fs(8,p,o)}var h=p.child;if(h!==null)h.return=p,O=h;else for(;O!==null;){p=O;var d=p.sibling,w=p.return;if(ph(p),p===c){O=null;break}if(d!==null){d.return=w,O=d;break}O=w}}}var b=o.alternate;if(b!==null){var g=b.child;if(g!==null){b.child=null;do{var j=g.sibling;g.sibling=null,g=j}while(g!==null)}}O=o}}if(o.subtreeFlags&2064&&l!==null)l.return=o,O=l;else e:for(;O!==null;){if(o=O,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Fs(9,o,o.return)}var f=o.sibling;if(f!==null){f.return=o.return,O=f;break e}O=o.return}}var m=e.current;for(O=m;O!==null;){l=O;var x=l.child;if(l.subtreeFlags&2064&&x!==null)x.return=l,O=x;else e:for(l=m;O!==null;){if(a=O,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:rl(9,a)}}catch(C){pe(a,a.return,C)}if(a===l){O=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,O=k;break e}O=a.return}}if(K=s,Bn(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(Gi,e)}catch{}r=!0}return r}finally{J=n,ht.transition=t}}return!1}function Pd(e,t,n){t=is(n,t),t=nh(e,t,1),e=On(e,t,1),t=qe(),e!==null&&(ko(e,1,t),Xe(e,t))}function pe(e,t,n){if(e.tag===3)Pd(e,e,n);else for(;t!==null;){if(t.tag===3){Pd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(In===null||!In.has(r))){e=is(n,e),e=rh(t,e,1),t=On(t,e,1),e=qe(),t!==null&&(ko(t,1,e),Xe(t,e));break}}t=t.return}}function Fx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=qe(),e.pingedLanes|=e.suspendedLanes&n,Ce===e&&(Pe&n)===n&&(je===4||je===3&&(Pe&130023424)===Pe&&500>ge()-Xu?lr(e,0):Yu|=n),Xe(e,t)}function jh(e,t){t===0&&(e.mode&1?(t=zo,zo<<=1,!(zo&130023424)&&(zo=4194304)):t=1);var n=qe();e=rn(e,t),e!==null&&(ko(e,t,n),Xe(e,n))}function zx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jh(e,n)}function Ux(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(P(314))}r!==null&&r.delete(t),jh(e,n)}var Sh;Sh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)Ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ke=!1,Cx(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,se&&t.flags&1048576&&_p(t,Ci,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ui(e,t),e=t.pendingProps;var s=ns(t,De.current);Fr(t,n),s=Qu(null,t,r,e,s,n);var o=Hu();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ye(r)?(o=!0,Ni(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,zu(t),s.updater=nl,t.stateNode=s,s._reactInternals=t,Ra(t,r,e,n),t=Oa(null,t,r,!0,o,n)):(t.tag=0,se&&o&&Mu(t),Ue(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ui(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=qx(r),e=wt(r,e),s){case 0:t=La(null,t,r,e,n);break e;case 1:t=wd(null,t,r,e,n);break e;case 11:t=yd(null,t,r,e,n);break e;case 14:t=vd(null,t,r,wt(r.type,e),n);break e}throw Error(P(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:wt(r,s),La(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:wt(r,s),wd(e,t,r,s,n);case 3:e:{if(lh(t),e===null)throw Error(P(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Op(e,t),Pi(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=is(Error(P(423)),t),t=bd(e,t,r,n,s);break e}else if(r!==s){s=is(Error(P(424)),t),t=bd(e,t,r,n,s);break e}else for(tt=Ln(t.stateNode.containerInfo.firstChild),nt=t,se=!0,jt=null,n=Mp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rs(),r===s){t=sn(e,t,n);break e}Ue(e,t,r,n)}t=t.child}return t;case 5:return Ip(t),e===null&&_a(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,l=s.children,ja(r,s)?l=null:o!==null&&ja(r,o)&&(t.flags|=32),ih(e,t),Ue(e,t,l,n),t.child;case 6:return e===null&&_a(t),null;case 13:return ah(e,t,n);case 4:return Uu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ss(t,null,r,n):Ue(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:wt(r,s),yd(e,t,r,s,n);case 7:return Ue(e,t,t.pendingProps,n),t.child;case 8:return Ue(e,t,t.pendingProps.children,n),t.child;case 12:return Ue(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,l=s.value,ee(_i,r._currentValue),r._currentValue=l,o!==null)if(_t(o.value,l)){if(o.children===s.children&&!Ge.current){t=sn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){l=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Jt(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?u.next=u:(u.next=p.next,p.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ta(o.return,n,t),a.lanes|=n;break}u=u.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(P(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),Ta(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Ue(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Fr(t,n),s=mt(s),r=r(s),t.flags|=1,Ue(e,t,r,n),t.child;case 14:return r=t.type,s=wt(r,t.pendingProps),s=wt(r.type,s),vd(e,t,r,s,n);case 15:return sh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:wt(r,s),ui(e,t),t.tag=1,Ye(r)?(e=!0,Ni(t)):e=!1,Fr(t,n),th(t,r,s),Ra(t,r,s,n),Oa(null,t,r,!0,e,n);case 19:return uh(e,t,n);case 22:return oh(e,t,n)}throw Error(P(156,t.tag))};function Nh(e,t){return Jf(e,t)}function $x(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pt(e,t,n,r){return new $x(e,t,n,r)}function tc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qx(e){if(typeof e=="function")return tc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wu)return 11;if(e===bu)return 14}return 2}function Dn(e,t){var n=e.alternate;return n===null?(n=pt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function fi(e,t,n,r,s,o){var l=2;if(r=e,typeof e=="function")tc(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case jr:return ar(n.children,s,o,t);case vu:l=8,s|=8;break;case ta:return e=pt(12,n,t,s|2),e.elementType=ta,e.lanes=o,e;case na:return e=pt(13,n,t,s),e.elementType=na,e.lanes=o,e;case ra:return e=pt(19,n,t,s),e.elementType=ra,e.lanes=o,e;case If:return ol(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Lf:l=10;break e;case Of:l=9;break e;case wu:l=11;break e;case bu:l=14;break e;case fn:l=16,r=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=pt(l,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function ar(e,t,n,r){return e=pt(7,e,r,t),e.lanes=n,e}function ol(e,t,n,r){return e=pt(22,e,r,t),e.elementType=If,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=pt(6,e,null,t),e.lanes=n,e}function ql(e,t,n){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bx(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kl(0),this.expirationTimes=kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function nc(e,t,n,r,s,o,l,a,u){return e=new Bx(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=pt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zu(o),e}function Qx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:kr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Eh(e){if(!e)return Un;e=e._reactInternals;e:{if(yr(e)!==e||e.tag!==1)throw Error(P(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ye(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(P(171))}if(e.tag===1){var n=e.type;if(Ye(n))return Ep(e,n,t)}return t}function Ch(e,t,n,r,s,o,l,a,u){return e=nc(n,r,!0,e,s,o,l,a,u),e.context=Eh(null),n=e.current,r=qe(),s=An(n),o=Jt(r,s),o.callback=t??null,On(n,o,s),e.current.lanes=s,ko(e,s,r),Xe(e,r),e}function il(e,t,n,r){var s=t.current,o=qe(),l=An(s);return n=Eh(n),t.context===null?t.context=n:t.pendingContext=n,t=Jt(o,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=On(s,t,l),e!==null&&(Ct(e,s,l,o),ii(e,s,l)),l}function Fi(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Rd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function rc(e,t){Rd(e,t),(e=e.alternate)&&Rd(e,t)}function Hx(){return null}var _h=typeof reportError=="function"?reportError:function(e){console.error(e)};function sc(e){this._internalRoot=e}ll.prototype.render=sc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));il(e,t,null,null)};ll.prototype.unmount=sc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pr(function(){il(null,e,null,null)}),t[nn]=null}};function ll(e){this._internalRoot=e}ll.prototype.unstable_scheduleHydration=function(e){if(e){var t=op();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gn.length&&t!==0&&t<gn[n].priority;n++);gn.splice(n,0,e),n===0&&lp(e)}};function oc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function al(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Md(){}function Vx(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=Fi(l);o.call(c)}}var l=Ch(t,r,e,0,null,!1,!1,"",Md);return e._reactRootContainer=l,e[nn]=l.current,Js(e.nodeType===8?e.parentNode:e),pr(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Fi(u);a.call(c)}}var u=nc(e,0,!1,null,null,!1,!1,"",Md);return e._reactRootContainer=u,e[nn]=u.current,Js(e.nodeType===8?e.parentNode:e),pr(function(){il(t,u,n,r)}),u}function ul(e,t,n,r,s){var o=n._reactRootContainer;if(o){var l=o;if(typeof s=="function"){var a=s;s=function(){var u=Fi(l);a.call(u)}}il(t,l,e,s)}else l=Vx(n,t,e,s,r);return Fi(l)}rp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Cs(t.pendingLanes);n!==0&&(Su(t,n|1),Xe(t,ge()),!(K&6)&&(ls=ge()+500,Bn()))}break;case 13:pr(function(){var r=rn(e,1);if(r!==null){var s=qe();Ct(r,e,1,s)}}),rc(e,1)}};Nu=function(e){if(e.tag===13){var t=rn(e,134217728);if(t!==null){var n=qe();Ct(t,e,134217728,n)}rc(e,134217728)}};sp=function(e){if(e.tag===13){var t=An(e),n=rn(e,t);if(n!==null){var r=qe();Ct(n,e,t,r)}rc(e,t)}};op=function(){return J};ip=function(e,t){var n=J;try{return J=e,t()}finally{J=n}};pa=function(e,t,n){switch(t){case"input":if(ia(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Zi(r);if(!s)throw Error(P(90));Df(r),ia(r,s)}}}break;case"textarea":zf(e,n);break;case"select":t=n.value,t!=null&&Or(e,!!n.multiple,t,!1)}};Vf=Ju;Wf=pr;var Wx={usingClientEntryPoint:!1,Events:[So,Cr,Zi,Qf,Hf,Ju]},bs={findFiberByHostInstance:Kn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Kx={bundleType:bs.bundleType,version:bs.version,rendererPackageName:bs.rendererPackageName,rendererConfig:bs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:on.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yf(e),e===null?null:e.stateNode},findFiberByHostInstance:bs.findFiberByHostInstance||Hx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yo.isDisabled&&Yo.supportsFiber)try{Gi=Yo.inject(Kx),Dt=Yo}catch{}}st.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wx;st.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!oc(t))throw Error(P(200));return Qx(e,t,null,n)};st.createRoot=function(e,t){if(!oc(e))throw Error(P(299));var n=!1,r="",s=_h;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=nc(e,1,!1,null,null,n,!1,r,s),e[nn]=t.current,Js(e.nodeType===8?e.parentNode:e),new sc(t)};st.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=Yf(t),e=e===null?null:e.stateNode,e};st.flushSync=function(e){return pr(e)};st.hydrate=function(e,t,n){if(!al(t))throw Error(P(200));return ul(null,e,t,!0,n)};st.hydrateRoot=function(e,t,n){if(!oc(e))throw Error(P(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",l=_h;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=Ch(t,null,e,1,n??null,s,!1,o,l),e[nn]=t.current,Js(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new ll(t)};st.render=function(e,t,n){if(!al(t))throw Error(P(200));return ul(null,e,t,!1,n)};st.unmountComponentAtNode=function(e){if(!al(e))throw Error(P(40));return e._reactRootContainer?(pr(function(){ul(null,null,e,!1,function(){e._reactRootContainer=null,e[nn]=null})}),!0):!1};st.unstable_batchedUpdates=Ju;st.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!al(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return ul(e,t,n,!1,r)};st.version="18.3.1-next-f1338f8080-20240426";function Th(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Th)}catch(e){console.error(e)}}Th(),Tf.exports=st;var Gx=Tf.exports,Ph,Ld=Gx;Ph=Ld.createRoot,Ld.hydrateRoot;var cs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Jn,vn,qr,yf,Yx=(yf=class extends cs{constructor(){super();I(this,Jn);I(this,vn);I(this,qr);L(this,qr,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){v(this,vn)||this.setEventListener(v(this,qr))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,vn))==null||t.call(this),L(this,vn,void 0))}setEventListener(t){var n;L(this,qr,t),(n=v(this,vn))==null||n.call(this),L(this,vn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){v(this,Jn)!==t&&(L(this,Jn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof v(this,Jn)=="boolean"?v(this,Jn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jn=new WeakMap,vn=new WeakMap,qr=new WeakMap,yf),ic=new Yx,Xx={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},wn,mu,vf,Jx=(vf=class{constructor(){I(this,wn,Xx);I(this,mu,!1)}setTimeoutProvider(e){L(this,wn,e)}setTimeout(e,t){return v(this,wn).setTimeout(e,t)}clearTimeout(e){v(this,wn).clearTimeout(e)}setInterval(e,t){return v(this,wn).setInterval(e,t)}clearInterval(e){v(this,wn).clearInterval(e)}},wn=new WeakMap,mu=new WeakMap,vf),Xn=new Jx;function Zx(e){setTimeout(e,0)}var ey=typeof window>"u"||"Deno"in globalThis;function $e(){}function ty(e,t){return typeof e=="function"?e(t):e}function Va(e){return typeof e=="number"&&e>=0&&e!==1/0}function Rh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fn(e,t){return typeof e=="function"?e(t):e}function et(e,t){return typeof e=="function"?e(t):e}function Od(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:l,stale:a}=e;if(l){if(r){if(t.queryHash!==lc(l,t.options))return!1}else if(!lo(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function Id(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(hr(t.options.mutationKey)!==hr(o))return!1}else if(!lo(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function lc(e,t){return((t==null?void 0:t.queryKeyHashFn)||hr)(e)}function hr(e){return JSON.stringify(e,(t,n)=>Wa(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function lo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>lo(e[n],t[n])):!1}var ny=Object.prototype.hasOwnProperty;function Mh(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Ad(e)&&Ad(t);if(!r&&!(Wa(e)&&Wa(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),a=l.length,u=r?new Array(a):{};let c=0;for(let p=0;p<a;p++){const h=r?p:l[p],d=e[h],w=t[h];if(d===w){u[h]=d,(r?p<o:ny.call(e,h))&&c++;continue}if(d===null||w===null||typeof d!="object"||typeof w!="object"){u[h]=w;continue}const b=Mh(d,w,n+1);u[h]=b,b===d&&c++}return o===a&&c===o?e:u}function zi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ad(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wa(e){if(!Dd(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Dd(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Dd(e){return Object.prototype.toString.call(e)==="[object Object]"}function ry(e){return new Promise(t=>{Xn.setTimeout(t,e)})}function Ka(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Mh(e,t):t}function sy(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function oy(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ac=Symbol();function Lh(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ac?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function uc(e,t){return typeof e=="function"?e(...t):!!e}function iy(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var ao=(()=>{let e=()=>ey;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ga(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var ly=Zx;function ay(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=ly;const o=a=>{t?e.push(a):s(()=>{n(a)})},l=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(u=>{n(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||l()}return u},batchCalls:a=>(...u)=>{o(()=>{a(...u)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var ke=ay(),Br,bn,Qr,wf,uy=(wf=class extends cs{constructor(){super();I(this,Br,!0);I(this,bn);I(this,Qr);L(this,Qr,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){v(this,bn)||this.setEventListener(v(this,Qr))}onUnsubscribe(){var t;this.hasListeners()||((t=v(this,bn))==null||t.call(this),L(this,bn,void 0))}setEventListener(t){var n;L(this,Qr,t),(n=v(this,bn))==null||n.call(this),L(this,bn,t(this.setOnline.bind(this)))}setOnline(t){v(this,Br)!==t&&(L(this,Br,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return v(this,Br)}},Br=new WeakMap,bn=new WeakMap,Qr=new WeakMap,wf),Ui=new uy;function cy(e){return Math.min(1e3*2**e,3e4)}function Oh(e){return(e??"online")==="online"?Ui.isOnline():!0}var Ya=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ih(e){let t=!1,n=0,r;const s=Ga(),o=()=>s.status!=="pending",l=g=>{var j;if(!o()){const f=new Ya(g);d(f),(j=e.onCancel)==null||j.call(e,f)}},a=()=>{t=!0},u=()=>{t=!1},c=()=>ic.isFocused()&&(e.networkMode==="always"||Ui.isOnline())&&e.canRun(),p=()=>Oh(e.networkMode)&&e.canRun(),h=g=>{o()||(r==null||r(),s.resolve(g))},d=g=>{o()||(r==null||r(),s.reject(g))},w=()=>new Promise(g=>{var j;r=f=>{(o()||c())&&g(f)},(j=e.onPause)==null||j.call(e)}).then(()=>{var g;r=void 0,o()||(g=e.onContinue)==null||g.call(e)}),b=()=>{if(o())return;let g;const j=n===0?e.initialPromise:void 0;try{g=j??e.fn()}catch(f){g=Promise.reject(f)}Promise.resolve(g).then(h).catch(f=>{var S;if(o())return;const m=e.retry??(ao.isServer()?0:3),x=e.retryDelay??cy,k=typeof x=="function"?x(n,f):x,C=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,f);if(t||!C){d(f);return}n++,(S=e.onFail)==null||S.call(e,n,f),ry(k).then(()=>c()?void 0:w()).then(()=>{t?d(f):b()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:u,canStart:p,start:()=>(p()?b():w().then(b),s)}}var Zn,bf,Ah=(bf=class{constructor(){I(this,Zn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Va(this.gcTime)&&L(this,Zn,Xn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ao.isServer()?1/0:5*60*1e3))}clearGcTimeout(){v(this,Zn)!==void 0&&(Xn.clearTimeout(v(this,Zn)),L(this,Zn,void 0))}},Zn=new WeakMap,bf);function dy(e){return{onFetch:(t,n)=>{var p,h,d,w,b;const r=t.options,s=(d=(h=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:h.fetchMore)==null?void 0:d.direction,o=((w=t.state.data)==null?void 0:w.pages)||[],l=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const c=async()=>{let g=!1;const j=x=>{iy(x,()=>t.signal,()=>g=!0)},f=Lh(t.options,t.fetchOptions),m=async(x,k,C)=>{if(g)return Promise.reject(t.signal.reason);if(k==null&&x.pages.length)return Promise.resolve(x);const N=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:k,direction:C?"backward":"forward",meta:t.options.meta};return j($),$})(),E=await f(N),{maxPages:_}=t.options,R=C?oy:sy;return{pages:R(x.pages,E,_),pageParams:R(x.pageParams,k,_)}};if(s&&o.length){const x=s==="backward",k=x?fy:Fd,C={pages:o,pageParams:l},S=k(r,C);a=await m(C,S,x)}else{const x=e??o.length;do{const k=u===0?l[0]??r.initialPageParam:Fd(r,a);if(u>0&&k==null)break;a=await m(a,k),u++}while(u<x)}return a};t.options.persister?t.fetchFn=()=>{var g,j;return(j=(g=t.options).persister)==null?void 0:j.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Fd(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function fy(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Hr,er,Vr,ut,tr,Ne,xo,nr,Ze,Dh,Bt,kf,py=(kf=class extends Ah{constructor(t){super();I(this,Ze);I(this,Hr);I(this,er);I(this,Vr);I(this,ut);I(this,tr);I(this,Ne);I(this,xo);I(this,nr);L(this,nr,!1),L(this,xo,t.defaultOptions),this.setOptions(t.options),this.observers=[],L(this,tr,t.client),L(this,ut,v(this,tr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,L(this,er,Ud(this.options)),this.state=t.state??v(this,er),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return v(this,Hr)}get promise(){var t;return(t=v(this,Ne))==null?void 0:t.promise}setOptions(t){if(this.options={...v(this,xo),...t},t!=null&&t._type&&L(this,Hr,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Ud(this.options);n.data!==void 0&&(this.setState(zd(n.data,n.dataUpdatedAt)),L(this,er,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&v(this,ut).remove(this)}setData(t,n){const r=Ka(this.state.data,t,this.options);return q(this,Ze,Bt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){q(this,Ze,Bt).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=v(this,Ne))==null?void 0:r.promise;return(s=v(this,Ne))==null||s.cancel(t),n?n.then($e).catch($e):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return v(this,er)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>et(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ac||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Fn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Rh(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=v(this,Ne))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=v(this,Ne))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),v(this,ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(v(this,Ne)&&(v(this,nr)||q(this,Ze,Dh).call(this)?v(this,Ne).cancel({revert:!0}):v(this,Ne).cancelRetry()),this.scheduleGc()),v(this,ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||q(this,Ze,Bt).call(this,{type:"invalidate"})}async fetch(t,n){var c,p,h,d,w,b,g,j,f,m,x;if(this.state.fetchStatus!=="idle"&&((c=v(this,Ne))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(v(this,Ne))return v(this,Ne).continueRetry(),v(this,Ne).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(C=>C.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(L(this,nr,!0),r.signal)})},o=()=>{const k=Lh(this.options,n),S=(()=>{const N={client:v(this,tr),queryKey:this.queryKey,meta:this.meta};return s(N),N})();return L(this,nr,!1),this.options.persister?this.options.persister(k,S,this):k(S)},a=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:v(this,tr),state:this.state,fetchFn:o};return s(k),k})(),u=v(this,Hr)==="infinite"?dy(this.options.pages):this.options.behavior;u==null||u.onFetch(a,this),L(this,Vr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=a.fetchOptions)==null?void 0:p.meta))&&q(this,Ze,Bt).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),L(this,Ne,Ih({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:k=>{k instanceof Ya&&k.revert&&this.setState({...v(this,Vr),fetchStatus:"idle"}),r.abort()},onFail:(k,C)=>{q(this,Ze,Bt).call(this,{type:"failed",failureCount:k,error:C})},onPause:()=>{q(this,Ze,Bt).call(this,{type:"pause"})},onContinue:()=>{q(this,Ze,Bt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const k=await v(this,Ne).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(w=(d=v(this,ut).config).onSuccess)==null||w.call(d,k,this),(g=(b=v(this,ut).config).onSettled)==null||g.call(b,k,this.state.error,this),k}catch(k){if(k instanceof Ya){if(k.silent)return v(this,Ne).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw q(this,Ze,Bt).call(this,{type:"error",error:k}),(f=(j=v(this,ut).config).onError)==null||f.call(j,k,this),(x=(m=v(this,ut).config).onSettled)==null||x.call(m,this.state.data,k,this),k}finally{this.scheduleGc()}}},Hr=new WeakMap,er=new WeakMap,Vr=new WeakMap,ut=new WeakMap,tr=new WeakMap,Ne=new WeakMap,xo=new WeakMap,nr=new WeakMap,Ze=new WeakSet,Dh=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Bt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Fh(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...zd(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return L(this,Vr,t.manual?s:void 0),s;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ke.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),v(this,ut).notify({query:this,type:"updated",action:t})})},kf);function Fh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Oh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zd(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ud(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var He,W,yo,ze,rr,Wr,Vt,kn,vo,Kr,Gr,sr,or,jn,Yr,X,Ts,Xa,Ja,Za,eu,tu,nu,ru,zh,jf,hy=(jf=class extends cs{constructor(t,n){super();I(this,X);I(this,He);I(this,W);I(this,yo);I(this,ze);I(this,rr);I(this,Wr);I(this,Vt);I(this,kn);I(this,vo);I(this,Kr);I(this,Gr);I(this,sr);I(this,or);I(this,jn);I(this,Yr,new Set);this.options=n,L(this,He,t),L(this,kn,null),L(this,Vt,Ga()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(v(this,W).addObserver(this),$d(v(this,W),this.options)?q(this,X,Ts).call(this):this.updateResult(),q(this,X,eu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return su(v(this,W),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return su(v(this,W),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,q(this,X,tu).call(this),q(this,X,nu).call(this),v(this,W).removeObserver(this)}setOptions(t){const n=this.options,r=v(this,W);if(this.options=v(this,He).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof et(this.options.enabled,v(this,W))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");q(this,X,ru).call(this),v(this,W).setOptions(this.options),n._defaulted&&!zi(this.options,n)&&v(this,He).getQueryCache().notify({type:"observerOptionsUpdated",query:v(this,W),observer:this});const s=this.hasListeners();s&&qd(v(this,W),r,this.options,n)&&q(this,X,Ts).call(this),this.updateResult(),s&&(v(this,W)!==r||et(this.options.enabled,v(this,W))!==et(n.enabled,v(this,W))||Fn(this.options.staleTime,v(this,W))!==Fn(n.staleTime,v(this,W)))&&q(this,X,Xa).call(this);const o=q(this,X,Ja).call(this);s&&(v(this,W)!==r||et(this.options.enabled,v(this,W))!==et(n.enabled,v(this,W))||o!==v(this,jn))&&q(this,X,Za).call(this,o)}getOptimisticResult(t){const n=v(this,He).getQueryCache().build(v(this,He),t),r=this.createResult(n,t);return gy(this,r)&&(L(this,ze,r),L(this,Wr,this.options),L(this,rr,v(this,W).state)),r}getCurrentResult(){return v(this,ze)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&v(this,Vt).status==="pending"&&v(this,Vt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){v(this,Yr).add(t)}getCurrentQuery(){return v(this,W)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=v(this,He).defaultQueryOptions(t),r=v(this,He).getQueryCache().build(v(this,He),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return q(this,X,Ts).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),v(this,ze)))}createResult(t,n){var _;const r=v(this,W),s=this.options,o=v(this,ze),l=v(this,rr),a=v(this,Wr),c=t!==r?t.state:v(this,yo),{state:p}=t;let h={...p},d=!1,w;if(n._optimisticResults){const R=this.hasListeners(),$=!R&&$d(t,n),U=R&&qd(t,r,n,s);($||U)&&(h={...h,...Fh(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:j}=h;w=h.data;let f=!1;if(n.placeholderData!==void 0&&w===void 0&&j==="pending"){let R;o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=o.data,f=!0):R=typeof n.placeholderData=="function"?n.placeholderData((_=v(this,Gr))==null?void 0:_.state.data,v(this,Gr)):n.placeholderData,R!==void 0&&(j="success",w=Ka(o==null?void 0:o.data,R,n),d=!0)}if(n.select&&w!==void 0&&!f)if(o&&w===(l==null?void 0:l.data)&&n.select===v(this,vo))w=v(this,Kr);else try{L(this,vo,n.select),w=n.select(w),w=Ka(o==null?void 0:o.data,w,n),L(this,Kr,w),L(this,kn,null)}catch(R){L(this,kn,R)}v(this,kn)&&(b=v(this,kn),w=v(this,Kr),g=Date.now(),j="error");const m=h.fetchStatus==="fetching",x=j==="pending",k=j==="error",C=x&&m,S=w!==void 0,E={status:j,fetchStatus:h.fetchStatus,isPending:x,isSuccess:j==="success",isError:k,isInitialLoading:C,isLoading:C,data:w,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!x,isLoadingError:k&&!S,isPaused:h.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:k&&S,isStale:cc(t,n),refetch:this.refetch,promise:v(this,Vt),isEnabled:et(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=E.data!==void 0,$=E.status==="error"&&!R,U=Se=>{$?Se.reject(E.error):R&&Se.resolve(E.data)},me=()=>{const Se=L(this,Vt,E.promise=Ga());U(Se)},ce=v(this,Vt);switch(ce.status){case"pending":t.queryHash===r.queryHash&&U(ce);break;case"fulfilled":($||E.data!==ce.value)&&me();break;case"rejected":(!$||E.error!==ce.reason)&&me();break}}return E}updateResult(){const t=v(this,ze),n=this.createResult(v(this,W),this.options);if(L(this,rr,v(this,W).state),L(this,Wr,this.options),v(this,rr).data!==void 0&&L(this,Gr,v(this,W)),zi(n,t))return;L(this,ze,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!v(this,Yr).size)return!0;const l=new Set(o??v(this,Yr));return this.options.throwOnError&&l.add("error"),Object.keys(v(this,ze)).some(a=>{const u=a;return v(this,ze)[u]!==t[u]&&l.has(u)})};q(this,X,zh).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&q(this,X,eu).call(this)}},He=new WeakMap,W=new WeakMap,yo=new WeakMap,ze=new WeakMap,rr=new WeakMap,Wr=new WeakMap,Vt=new WeakMap,kn=new WeakMap,vo=new WeakMap,Kr=new WeakMap,Gr=new WeakMap,sr=new WeakMap,or=new WeakMap,jn=new WeakMap,Yr=new WeakMap,X=new WeakSet,Ts=function(t){q(this,X,ru).call(this);let n=v(this,W).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($e)),n},Xa=function(){q(this,X,tu).call(this);const t=Fn(this.options.staleTime,v(this,W));if(ao.isServer()||v(this,ze).isStale||!Va(t))return;const r=Rh(v(this,ze).dataUpdatedAt,t)+1;L(this,sr,Xn.setTimeout(()=>{v(this,ze).isStale||this.updateResult()},r))},Ja=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(v(this,W)):this.options.refetchInterval)??!1},Za=function(t){q(this,X,nu).call(this),L(this,jn,t),!(ao.isServer()||et(this.options.enabled,v(this,W))===!1||!Va(v(this,jn))||v(this,jn)===0)&&L(this,or,Xn.setInterval(()=>{(this.options.refetchIntervalInBackground||ic.isFocused())&&q(this,X,Ts).call(this)},v(this,jn)))},eu=function(){q(this,X,Xa).call(this),q(this,X,Za).call(this,q(this,X,Ja).call(this))},tu=function(){v(this,sr)!==void 0&&(Xn.clearTimeout(v(this,sr)),L(this,sr,void 0))},nu=function(){v(this,or)!==void 0&&(Xn.clearInterval(v(this,or)),L(this,or,void 0))},ru=function(){const t=v(this,He).getQueryCache().build(v(this,He),this.options);if(t===v(this,W))return;const n=v(this,W);L(this,W,t),L(this,yo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zh=function(t){ke.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(v(this,ze))}),v(this,He).getQueryCache().notify({query:v(this,W),type:"observerResultsUpdated"})})},jf);function my(e,t){return et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&et(t.retryOnMount,e)===!1)}function $d(e,t){return my(e,t)||e.state.data!==void 0&&su(e,t,t.refetchOnMount)}function su(e,t,n){if(et(t.enabled,e)!==!1&&Fn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&cc(e,t)}return!1}function qd(e,t,n,r){return(e!==t||et(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&cc(e,n)}function cc(e,t){return et(t.enabled,e)!==!1&&e.isStaleByTime(Fn(t.staleTime,e))}function gy(e,t){return!zi(e.getCurrentResult(),t)}var wo,Lt,Ie,ir,Ot,dn,Sf,xy=(Sf=class extends Ah{constructor(t){super();I(this,Ot);I(this,wo);I(this,Lt);I(this,Ie);I(this,ir);L(this,wo,t.client),this.mutationId=t.mutationId,L(this,Ie,t.mutationCache),L(this,Lt,[]),this.state=t.state||Uh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){v(this,Lt).includes(t)||(v(this,Lt).push(t),this.clearGcTimeout(),v(this,Ie).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){L(this,Lt,v(this,Lt).filter(n=>n!==t)),this.scheduleGc(),v(this,Ie).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){v(this,Lt).length||(this.state.status==="pending"?this.scheduleGc():v(this,Ie).remove(this))}continue(){var t;return((t=v(this,ir))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,a,u,c,p,h,d,w,b,g,j,f,m,x,k,C,S,N;const n=()=>{q(this,Ot,dn).call(this,{type:"continue"})},r={client:v(this,wo),meta:this.options.meta,mutationKey:this.options.mutationKey};L(this,ir,Ih({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(E,_)=>{q(this,Ot,dn).call(this,{type:"failed",failureCount:E,error:_})},onPause:()=>{q(this,Ot,dn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>v(this,Ie).canRun(this)}));const s=this.state.status==="pending",o=!v(this,ir).canStart();try{if(s)n();else{q(this,Ot,dn).call(this,{type:"pending",variables:t,isPaused:o}),v(this,Ie).config.onMutate&&await v(this,Ie).config.onMutate(t,this,r);const _=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,r));_!==this.state.context&&q(this,Ot,dn).call(this,{type:"pending",context:_,variables:t,isPaused:o})}const E=await v(this,ir).start();return await((c=(u=v(this,Ie).config).onSuccess)==null?void 0:c.call(u,E,t,this.state.context,this,r)),await((h=(p=this.options).onSuccess)==null?void 0:h.call(p,E,t,this.state.context,r)),await((w=(d=v(this,Ie).config).onSettled)==null?void 0:w.call(d,E,null,this.state.variables,this.state.context,this,r)),await((g=(b=this.options).onSettled)==null?void 0:g.call(b,E,null,t,this.state.context,r)),q(this,Ot,dn).call(this,{type:"success",data:E}),E}catch(E){try{await((f=(j=v(this,Ie).config).onError)==null?void 0:f.call(j,E,t,this.state.context,this,r))}catch(_){Promise.reject(_)}try{await((x=(m=this.options).onError)==null?void 0:x.call(m,E,t,this.state.context,r))}catch(_){Promise.reject(_)}try{await((C=(k=v(this,Ie).config).onSettled)==null?void 0:C.call(k,void 0,E,this.state.variables,this.state.context,this,r))}catch(_){Promise.reject(_)}try{await((N=(S=this.options).onSettled)==null?void 0:N.call(S,void 0,E,t,this.state.context,r))}catch(_){Promise.reject(_)}throw q(this,Ot,dn).call(this,{type:"error",error:E}),E}finally{v(this,Ie).runNext(this)}}},wo=new WeakMap,Lt=new WeakMap,Ie=new WeakMap,ir=new WeakMap,Ot=new WeakSet,dn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ke.batch(()=>{v(this,Lt).forEach(r=>{r.onMutationUpdate(t)}),v(this,Ie).notify({mutation:this,type:"updated",action:t})})},Sf);function Uh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Wt,bt,bo,Nf,yy=(Nf=class extends cs{constructor(t={}){super();I(this,Wt);I(this,bt);I(this,bo);this.config=t,L(this,Wt,new Set),L(this,bt,new Map),L(this,bo,0)}build(t,n,r){const s=new xy({client:t,mutationCache:this,mutationId:++Lo(this,bo)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){v(this,Wt).add(t);const n=Xo(t);if(typeof n=="string"){const r=v(this,bt).get(n);r?r.push(t):v(this,bt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(v(this,Wt).delete(t)){const n=Xo(t);if(typeof n=="string"){const r=v(this,bt).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&v(this,bt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Xo(t);if(typeof n=="string"){const r=v(this,bt).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Xo(t);if(typeof n=="string"){const s=(r=v(this,bt).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ke.batch(()=>{v(this,Wt).forEach(t=>{this.notify({type:"removed",mutation:t})}),v(this,Wt).clear(),v(this,bt).clear()})}getAll(){return Array.from(v(this,Wt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Id(n,r))}findAll(t={}){return this.getAll().filter(n=>Id(t,n))}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ke.batch(()=>Promise.all(t.map(n=>n.continue().catch($e))))}},Wt=new WeakMap,bt=new WeakMap,bo=new WeakMap,Nf);function Xo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Kt,Sn,Ve,Gt,en,pi,ou,Ef,vy=(Ef=class extends cs{constructor(n,r){super();I(this,en);I(this,Kt);I(this,Sn);I(this,Ve);I(this,Gt);L(this,Kt,n),this.setOptions(r),this.bindMethods(),q(this,en,pi).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=v(this,Kt).defaultMutationOptions(n),zi(this.options,r)||v(this,Kt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:v(this,Ve),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&hr(r.mutationKey)!==hr(this.options.mutationKey)?this.reset():((s=v(this,Ve))==null?void 0:s.state.status)==="pending"&&v(this,Ve).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=v(this,Ve))==null||n.removeObserver(this)}onMutationUpdate(n){q(this,en,pi).call(this),q(this,en,ou).call(this,n)}getCurrentResult(){return v(this,Sn)}reset(){var n;(n=v(this,Ve))==null||n.removeObserver(this),L(this,Ve,void 0),q(this,en,pi).call(this),q(this,en,ou).call(this)}mutate(n,r){var s;return L(this,Gt,r),(s=v(this,Ve))==null||s.removeObserver(this),L(this,Ve,v(this,Kt).getMutationCache().build(v(this,Kt),this.options)),v(this,Ve).addObserver(this),v(this,Ve).execute(n)}},Kt=new WeakMap,Sn=new WeakMap,Ve=new WeakMap,Gt=new WeakMap,en=new WeakSet,pi=function(){var r;const n=((r=v(this,Ve))==null?void 0:r.state)??Uh();L(this,Sn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ou=function(n){ke.batch(()=>{var r,s,o,l,a,u,c,p;if(v(this,Gt)&&this.hasListeners()){const h=v(this,Sn).variables,d=v(this,Sn).context,w={client:v(this,Kt),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=v(this,Gt)).onSuccess)==null||s.call(r,n.data,h,d,w)}catch(b){Promise.reject(b)}try{(l=(o=v(this,Gt)).onSettled)==null||l.call(o,n.data,null,h,d,w)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(u=(a=v(this,Gt)).onError)==null||u.call(a,n.error,h,d,w)}catch(b){Promise.reject(b)}try{(p=(c=v(this,Gt)).onSettled)==null||p.call(c,void 0,n.error,h,d,w)}catch(b){Promise.reject(b)}}}this.listeners.forEach(h=>{h(v(this,Sn))})})},Ef),It,Cf,wy=(Cf=class extends cs{constructor(t={}){super();I(this,It);this.config=t,L(this,It,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??lc(s,n);let l=this.get(o);return l||(l=new py({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){v(this,It).has(t.queryHash)||(v(this,It).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=v(this,It).get(t.queryHash);n&&(t.destroy(),n===t&&v(this,It).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return v(this,It).get(t)}getAll(){return[...v(this,It).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Od(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Od(t,r)):n}notify(t){ke.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},It=new WeakMap,Cf),de,Nn,En,Xr,Jr,Cn,Zr,es,_f,by=(_f=class{constructor(e={}){I(this,de);I(this,Nn);I(this,En);I(this,Xr);I(this,Jr);I(this,Cn);I(this,Zr);I(this,es);L(this,de,e.queryCache||new wy),L(this,Nn,e.mutationCache||new yy),L(this,En,e.defaultOptions||{}),L(this,Xr,new Map),L(this,Jr,new Map),L(this,Cn,0)}mount(){Lo(this,Cn)._++,v(this,Cn)===1&&(L(this,Zr,ic.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,de).onFocus())})),L(this,es,Ui.subscribe(async e=>{e&&(await this.resumePausedMutations(),v(this,de).onOnline())})))}unmount(){var e,t;Lo(this,Cn)._--,v(this,Cn)===0&&((e=v(this,Zr))==null||e.call(this),L(this,Zr,void 0),(t=v(this,es))==null||t.call(this),L(this,es,void 0))}isFetching(e){return v(this,de).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return v(this,Nn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=v(this,de).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=v(this,de).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Fn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return v(this,de).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=v(this,de).get(r.queryHash),o=s==null?void 0:s.state.data,l=ty(t,o);if(l!==void 0)return v(this,de).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return ke.batch(()=>v(this,de).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=v(this,de).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=v(this,de);ke.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=v(this,de);return ke.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ke.batch(()=>v(this,de).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then($e).catch($e)}invalidateQueries(e,t={}){return ke.batch(()=>(v(this,de).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ke.batch(()=>v(this,de).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch($e)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then($e)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=v(this,de).build(this,t);return n.isStaleByTime(Fn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($e).catch($e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($e).catch($e)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ui.isOnline()?v(this,Nn).resumePausedMutations():Promise.resolve()}getQueryCache(){return v(this,de)}getMutationCache(){return v(this,Nn)}getDefaultOptions(){return v(this,En)}setDefaultOptions(e){L(this,En,e)}setQueryDefaults(e,t){v(this,Xr).set(hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...v(this,Xr).values()],n={};return t.forEach(r=>{lo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){v(this,Jr).set(hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...v(this,Jr).values()],n={};return t.forEach(r=>{lo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...v(this,En).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lc(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ac&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...v(this,En).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){v(this,de).clear(),v(this,Nn).clear()}},de=new WeakMap,Nn=new WeakMap,En=new WeakMap,Xr=new WeakMap,Jr=new WeakMap,Cn=new WeakMap,Zr=new WeakMap,es=new WeakMap,_f),$h=y.createContext(void 0),oe=e=>{const t=y.useContext($h);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ky=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx($h.Provider,{value:e,children:t})),qh=y.createContext(!1),jy=()=>y.useContext(qh);qh.Provider;function Sy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ny=y.createContext(Sy()),Ey=()=>y.useContext(Ny),Cy=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?uc(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},_y=e=>{y.useEffect(()=>{e.clearReset()},[e])},Ty=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||uc(n,[e.error,r])),Py=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ry=(e,t)=>e.isLoading&&e.isFetching&&!t,My=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Bd=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ly(e,t,n){var d,w,b,g;const r=jy(),s=Ey(),o=oe(),l=o.defaultQueryOptions(e);(w=(d=o.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||w.call(d,l);const a=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",Py(l),Cy(l,s,a),_y(s);const u=!o.getQueryCache().get(l.queryHash),[c]=y.useState(()=>new t(o,l)),p=c.getOptimisticResult(l),h=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(j=>{const f=h?c.subscribe(ke.batchCalls(j)):$e;return c.updateResult(),f},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),y.useEffect(()=>{c.setOptions(l)},[l,c]),My(l,p))throw Bd(l,c,s);if(Ty({result:p,errorResetBoundary:s,throwOnError:l.throwOnError,query:a,suspense:l.suspense}))throw p.error;if((g=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||g.call(b,l,p),l.experimental_prefetchInRender&&!ao.isServer()&&Ry(p,r)){const j=u?Bd(l,c,s):a==null?void 0:a.promise;j==null||j.catch($e).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?p:c.trackResult(p)}function Tt(e,t){return Ly(e,hy)}function ye(e,t){const n=oe(),[r]=y.useState(()=>new vy(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const s=y.useSyncExternalStore(y.useCallback(l=>r.subscribe(ke.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=y.useCallback((l,a)=>{r.mutate(l,a).catch($e)},[r]);if(s.error&&uc(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}class Oy{constructor(){yt(this,"ws");yt(this,"listeners",new Set);yt(this,"reconnectListeners",new Set);yt(this,"reconnectAttempt",0);yt(this,"shouldRun",!1);yt(this,"url");yt(this,"outbox",[]);yt(this,"lastSubscribe");yt(this,"_connectionEpoch",0);const t=location.protocol==="https:"?"wss:":"ws:";this.url=`${t}//${location.host}/ws`}start(){this.shouldRun||(this.shouldRun=!0,this.connect())}stop(){var t;this.shouldRun=!1,this.outbox=[],this.lastSubscribe=void 0,this._connectionEpoch=0,(t=this.ws)==null||t.close(),this.ws=void 0}send(t){var n;if(t.type==="subscribe"&&(this.lastSubscribe=t),((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.ws.send(JSON.stringify(t));return}this.outbox.push(t),this.shouldRun||this.start()}on(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onReconnect(t){return this.reconnectListeners.add(t),()=>this.reconnectListeners.delete(t)}get readyState(){var t;return((t=this.ws)==null?void 0:t.readyState)??WebSocket.CLOSED}get connectionEpoch(){return this._connectionEpoch}connect(){const t=new WebSocket(this.url);this.ws=t,t.addEventListener("open",()=>{if(this.reconnectAttempt=0,this._connectionEpoch+=1,this._connectionEpoch>1&&this.lastSubscribe&&t.send(JSON.stringify(this.lastSubscribe)),this._connectionEpoch>1)for(const r of this.reconnectListeners)try{r()}catch{}const n=this.outbox;this.outbox=[];for(const r of n)t.send(JSON.stringify(r))}),t.addEventListener("message",n=>{let r;try{r=JSON.parse(n.data)}catch{return}for(const s of this.listeners)s(r)}),t.addEventListener("close",()=>{if(this.ws=void 0,!this.shouldRun)return;const n=Math.min(15e3,500*2**this.reconnectAttempt);this.reconnectAttempt+=1,setTimeout(()=>{this.shouldRun&&this.connect()},n)}),t.addEventListener("error",()=>{})}}const fe=new Oy,Iy=3e4;async function G(e,t){const{timeout:n,...r}=t??{},s=r.signal??AbortSignal.timeout(n??Iy);return Ay(e,r,s)}async function Ay(e,t,n){const r=await fetch(e,{...t,signal:n,headers:{"Content-Type":"application/json",...t.headers??{}}});if(!r.ok){const s=await r.text().catch(()=>"");throw new Error(Dy(s)??`${r.status} ${r.statusText}${s?`: ${s}`:""}`)}return await r.json()}function Dy(e){if(e)try{const t=JSON.parse(e);if(t&&typeof t.error=="string"&&t.error.length>0)return t.error}catch{}}const Eo=e=>["config",e],Fy=(e,t)=>["config",e,t??"__none__"];function zy(e,t){return Tt({queryKey:Fy(e,t),queryFn:()=>{if(!e)throw new Error("workspaceId required");return G(`/api/workspaces/${encodeURIComponent(e)}/config`)},enabled:!!e})}function Uy(e){const t=oe();return ye({mutationFn:n=>G(`/api/workspaces/${encodeURIComponent(e)}/config/model`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Eo(e)})})}function $y(e){const t=oe();return ye({mutationFn:n=>G(`/api/workspaces/${encodeURIComponent(e)}/config/thinking-level`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Eo(e)})})}function yb(e){const t=oe();return ye({mutationFn:n=>G(`/api/workspaces/${encodeURIComponent(e)}/config/tools`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:Eo(e)})})}function qy(e,t){const n=oe();return ye({mutationFn:r=>{const s=`/api/workspaces/${encodeURIComponent(e)}/config/session-name`,o=t?`${s}?sessionPath=${encodeURIComponent(t)}`:s;return G(o,{method:"PUT",body:JSON.stringify(r)})},onSuccess:()=>{n.invalidateQueries({queryKey:Eo(e)}),n.invalidateQueries({queryKey:["workspace-sessions",e]})}})}function By(){const e=oe();y.useEffect(()=>fe.on(n=>{n.type==="event"&&(n.payload.kind!=="session_info_changed"&&n.payload.kind!=="thinking_level_changed"||e.invalidateQueries({queryKey:Eo(n.workspaceId)}))}),[e])}function Bh(e){const t=oe(),{queryKey:n,messageTypes:r,eventKinds:s}=e,o=y.useRef(n);o.current=n,y.useEffect(()=>{const l=r?new Set(r):void 0,a=s?new Set(s):void 0;return fe.on(c=>{if(l&&c.type!=="event"&&l.has(c.type)){const p=c.workspaceId;p&&t.invalidateQueries({queryKey:o.current(p)});return}a&&c.type==="event"&&a.has(c.payload.kind)&&t.invalidateQueries({queryKey:o.current(c.workspaceId)})})},[t,r,s])}function dc(e){return["workspace-sessions",e]}function Qh(e){return{queryKey:dc(e),queryFn:()=>G(`/api/workspaces/${encodeURIComponent(e)}/sessions`).then(t=>t.sessions),staleTime:3e4}}function Qy(e){return Tt({...Qh(e??""),enabled:!!e})}function Hy(e){const t=oe();return ye({mutationFn:n=>{if(!e)throw new Error("workspaceId required");const r=`?path=${encodeURIComponent(n)}`;return G(`/api/workspaces/${encodeURIComponent(e)}/sessions${r}`,{method:"DELETE"})},onSuccess:()=>t.invalidateQueries({queryKey:dc(e)})})}function Vy(e,t){return ye({mutationFn:async()=>{const n=`/api/workspaces/${encodeURIComponent(e)}/export`,r=t?`${n}?sessionPath=${encodeURIComponent(t)}`:n,s=await G(r),o=new Blob([s.html],{type:"text/html"}),l=URL.createObjectURL(o),a=document.createElement("a");a.href=l,a.download=s.filename,a.click(),URL.revokeObjectURL(l)}})}const Wy=["subscribed"],Ky=["agent_start","agent_end","compaction_end","session_info_changed"];function Gy(){Bh({queryKey:e=>dc(e),messageTypes:Wy,eventKinds:Ky})}function Hh(e){return["session-tree",e]}function vb(e,t){return Tt({queryKey:Hh(e),enabled:!!e&&t,staleTime:2e3,queryFn:()=>{if(!e)throw new Error("workspaceId required");return G(`/api/workspaces/${encodeURIComponent(e)}/tree`)}})}const Yy=["subscribed","navigate_tree_result"],Xy=["agent_end","compaction_end"];function Jy(){Bh({queryKey:e=>Hh(e),messageTypes:Yy,eventKinds:Xy})}const zt=e=>["resources",e],Co=e=>["resources",e,"skill-body"],cl=e=>["resources",e,"prompt-body"];function xt(e,t=""){return`/api/workspaces/${encodeURIComponent(e)}/resources${t}`}function Vh(e){return Tt({queryKey:zt(e),queryFn:()=>{if(!e)throw new Error("workspaceId required");return G(xt(e))},enabled:!!e})}function Zy(e){const t=oe();return ye({mutationFn:()=>G(xt(e,"/reload"),{method:"POST"}),onSuccess:n=>{t.setQueryData(zt(e),n),t.invalidateQueries({queryKey:Co(e)}),t.invalidateQueries({queryKey:cl(e)})}})}function wb(e){const t=oe();return ye({mutationFn:n=>G(xt(e,"/builtin-extensions"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(zt(e),n)})}function bb(e,t){return Tt({queryKey:[...Co(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return G(`${xt(e,"/skill")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function kb(e){const t=oe();return ye({mutationFn:n=>G(xt(e,"/skills"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(zt(e),n)})}function jb(e){const t=oe();return ye({mutationFn:({file:n,scope:r,overwrite:s})=>{const o=`?scope=${r}${s?"&overwrite=1":""}`;return G(xt(e,`/skills/install${o}`),{method:"POST",body:n,headers:{"Content-Type":"application/octet-stream"}})},onSuccess:n=>{t.setQueryData(zt(e),n),t.invalidateQueries({queryKey:Co(e)})}})}function Sb(e){const t=oe();return ye({mutationFn:n=>G(xt(e,"/skills"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(zt(e),n),t.invalidateQueries({queryKey:Co(e)})}})}function Nb(e){const t=oe();return ye({mutationFn:({filePath:n})=>G(`${xt(e,"/skills")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(zt(e),n),t.invalidateQueries({queryKey:Co(e)})}})}function Eb(e,t){return Tt({queryKey:[...cl(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return G(`${xt(e,"/prompt")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function Cb(e){const t=oe();return ye({mutationFn:n=>G(xt(e,"/prompts"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(zt(e),n)})}function _b(e){const t=oe();return ye({mutationFn:n=>G(xt(e,"/prompts"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(zt(e),n),t.invalidateQueries({queryKey:cl(e)})}})}function Tb(e){const t=oe();return ye({mutationFn:({filePath:n})=>G(`${xt(e,"/prompts")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(zt(e),n),t.invalidateQueries({queryKey:cl(e)})}})}/**
|
|
26
|
+
* @license lucide-react v0.468.0 - ISC
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the ISC license.
|
|
29
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/const e0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wh=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
31
|
+
* @license lucide-react v0.468.0 - ISC
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the ISC license.
|
|
34
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/var t0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
36
|
+
* @license lucide-react v0.468.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/const n0=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:l,...a},u)=>y.createElement("svg",{ref:u,...t0,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Wh("lucide",s),...a},[...l.map(([c,p])=>y.createElement(c,p)),...Array.isArray(o)?o:[o]]));/**
|
|
41
|
+
* @license lucide-react v0.468.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const Y=(e,t)=>{const n=y.forwardRef(({className:r,...s},o)=>y.createElement(n0,{ref:o,iconNode:t,className:Wh(`lucide-${e0(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
46
|
+
* @license lucide-react v0.468.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/const iu=Y("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
51
|
+
* @license lucide-react v0.468.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const lu=Y("Blocks",[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]]);/**
|
|
56
|
+
* @license lucide-react v0.468.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const _o=Y("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
61
|
+
* @license lucide-react v0.468.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const To=Y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
66
|
+
* @license lucide-react v0.468.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const r0=Y("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
71
|
+
* @license lucide-react v0.468.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const fc=Y("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
76
|
+
* @license lucide-react v0.468.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const s0=Y("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
81
|
+
* @license lucide-react v0.468.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const o0=Y("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
86
|
+
* @license lucide-react v0.468.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const Kh=Y("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
91
|
+
* @license lucide-react v0.468.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const i0=Y("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
96
|
+
* @license lucide-react v0.468.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const pc=Y("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
101
|
+
* @license lucide-react v0.468.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const l0=Y("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
106
|
+
* @license lucide-react v0.468.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const a0=Y("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
111
|
+
* @license lucide-react v0.468.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const u0=Y("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
116
|
+
* @license lucide-react v0.468.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const c0=Y("Files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]);/**
|
|
121
|
+
* @license lucide-react v0.468.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const d0=Y("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
126
|
+
* @license lucide-react v0.468.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const hc=Y("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
131
|
+
* @license lucide-react v0.468.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const f0=Y("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
136
|
+
* @license lucide-react v0.468.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const Qd=Y("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
141
|
+
* @license lucide-react v0.468.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const p0=Y("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
146
|
+
* @license lucide-react v0.468.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const mr=Y("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
151
|
+
* @license lucide-react v0.468.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const h0=Y("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
156
|
+
* @license lucide-react v0.468.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const m0=Y("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
161
|
+
* @license lucide-react v0.468.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const Gh=Y("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
166
|
+
* @license lucide-react v0.468.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const Hd=Y("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
171
|
+
* @license lucide-react v0.468.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const g0=Y("Shrink",[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]);/**
|
|
176
|
+
* @license lucide-react v0.468.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const x0=Y("SquareSlash",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);/**
|
|
181
|
+
* @license lucide-react v0.468.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const y0=Y("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
|
|
186
|
+
* @license lucide-react v0.468.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const v0=Y("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
191
|
+
* @license lucide-react v0.468.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const Yh=Y("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
196
|
+
* @license lucide-react v0.468.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const uo=Y("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
201
|
+
* @license lucide-react v0.468.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const mc=Y("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Xh(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Xh(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function w0(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Xh(e))&&(r&&(r+=" "),r+=t);return r}const gc="-",b0=e=>{const t=j0(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const a=l.split(gc);return a[0]===""&&a.length!==1&&a.shift(),Jh(a,t)||k0(l)},getConflictingClassGroupIds:(l,a)=>{const u=n[l]||[];return a&&r[l]?[...u,...r[l]]:u}}},Jh=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Jh(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(gc);return(l=t.validators.find(({validator:a})=>a(o)))==null?void 0:l.classGroupId},Vd=/^\[(.+)\]$/,k0=e=>{if(Vd.test(e)){const t=Vd.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},j0=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return N0(Object.entries(e.classGroups),n).forEach(([o,l])=>{au(l,r,o,t)}),r},au=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Wd(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(S0(s)){au(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,l])=>{au(l,Wd(t,o),n,r)})})},Wd=(e,t)=>{let n=e;return t.split(gc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},S0=e=>e.isThemeGetter,N0=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,a])=>[t+l,a])):o);return[n,s]}):e,E0=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,l)=>{n.set(o,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return s(o,l),l},set(o,l){n.has(o)?n.set(o,l):s(o,l)}}},Zh="!",C0=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,l=a=>{const u=[];let c=0,p=0,h;for(let j=0;j<a.length;j++){let f=a[j];if(c===0){if(f===s&&(r||a.slice(j,j+o)===t)){u.push(a.slice(p,j)),p=j+o;continue}if(f==="/"){h=j;continue}}f==="["?c++:f==="]"&&c--}const d=u.length===0?a:a.substring(p),w=d.startsWith(Zh),b=w?d.substring(1):d,g=h&&h>p?h-p:void 0;return{modifiers:u,hasImportantModifier:w,baseClassName:b,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:l}):l},_0=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},T0=e=>({cache:E0(e.cacheSize),parseClassName:C0(e),...b0(e)}),P0=/\s+/,R0=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],l=e.trim().split(P0);let a="";for(let u=l.length-1;u>=0;u-=1){const c=l[u],{modifiers:p,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:w}=n(c);let b=!!w,g=r(b?d.substring(0,w):d);if(!g){if(!b){a=c+(a.length>0?" "+a:a);continue}if(g=r(d),!g){a=c+(a.length>0?" "+a:a);continue}b=!1}const j=_0(p).join(":"),f=h?j+Zh:j,m=f+g;if(o.includes(m))continue;o.push(m);const x=s(g,b);for(let k=0;k<x.length;++k){const C=x[k];o.push(f+C)}a=c+(a.length>0?" "+a:a)}return a};function M0(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=em(t))&&(r&&(r+=" "),r+=n);return r}const em=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=em(e[r]))&&(n&&(n+=" "),n+=t);return n};function L0(e,...t){let n,r,s,o=l;function l(u){const c=t.reduce((p,h)=>h(p),e());return n=T0(c),r=n.cache.get,s=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const p=R0(u,n);return s(u,p),p}return function(){return o(M0.apply(null,arguments))}}const te=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},tm=/^\[(?:([a-z-]+):)?(.+)\]$/i,O0=/^\d+\/\d+$/,I0=new Set(["px","full","screen"]),A0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,D0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,F0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qt=e=>Ur(e)||I0.has(e)||O0.test(e),un=e=>ds(e,"length",K0),Ur=e=>!!e&&!Number.isNaN(Number(e)),Bl=e=>ds(e,"number",Ur),ks=e=>!!e&&Number.isInteger(Number(e)),$0=e=>e.endsWith("%")&&Ur(e.slice(0,-1)),B=e=>tm.test(e),cn=e=>A0.test(e),q0=new Set(["length","size","percentage"]),B0=e=>ds(e,q0,nm),Q0=e=>ds(e,"position",nm),H0=new Set(["image","url"]),V0=e=>ds(e,H0,Y0),W0=e=>ds(e,"",G0),js=()=>!0,ds=(e,t,n)=>{const r=tm.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},K0=e=>D0.test(e)&&!F0.test(e),nm=()=>!1,G0=e=>z0.test(e),Y0=e=>U0.test(e),X0=()=>{const e=te("colors"),t=te("spacing"),n=te("blur"),r=te("brightness"),s=te("borderColor"),o=te("borderRadius"),l=te("borderSpacing"),a=te("borderWidth"),u=te("contrast"),c=te("grayscale"),p=te("hueRotate"),h=te("invert"),d=te("gap"),w=te("gradientColorStops"),b=te("gradientColorStopPositions"),g=te("inset"),j=te("margin"),f=te("opacity"),m=te("padding"),x=te("saturate"),k=te("scale"),C=te("sepia"),S=te("skew"),N=te("space"),E=te("translate"),_=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",B,t],U=()=>[B,t],me=()=>["",qt,un],ce=()=>["auto",Ur,B],Se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Fe=()=>["solid","dashed","dotted","double","none"],it=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",B],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[Ur,B];return{cacheSize:500,separator:":",theme:{colors:[js],spacing:[qt,un],blur:["none","",cn,B],brightness:Q(),borderColor:[e],borderRadius:["none","","full",cn,B],borderSpacing:U(),borderWidth:me(),contrast:Q(),grayscale:A(),hueRotate:Q(),invert:A(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[$0,un],inset:$(),margin:$(),opacity:Q(),padding:U(),saturate:Q(),scale:Q(),sepia:A(),skew:Q(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",B]}],container:["container"],columns:[{columns:[cn]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Se(),B]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ks,B]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",B]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",ks,B]}],"grid-cols":[{"grid-cols":[js]}],"col-start-end":[{col:["auto",{span:["full",ks,B]},B]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[js]}],"row-start-end":[{row:["auto",{span:[ks,B]},B]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",B]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",B]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",B,t]}],"min-w":[{"min-w":[B,t,"min","max","fit"]}],"max-w":[{"max-w":[B,t,"none","full","min","max","fit","prose",{screen:[cn]},cn]}],h:[{h:[B,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[B,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[B,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[B,t,"auto","min","max","fit"]}],"font-size":[{text:["base",cn,un]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bl]}],"font-family":[{font:[js]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",B]}],"line-clamp":[{"line-clamp":["none",Ur,Bl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qt,B]}],"list-image":[{"list-image":["none",B]}],"list-style-type":[{list:["none","disc","decimal",B]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Fe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qt,un]}],"underline-offset":[{"underline-offset":["auto",qt,B]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",B]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",B]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Se(),Q0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",B0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},V0]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...Fe(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:Fe()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Fe()]}],"outline-offset":[{"outline-offset":[qt,B]}],"outline-w":[{outline:[qt,un]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[qt,un]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",cn,W0]}],"shadow-color":[{shadow:[js]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...it(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":it()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",cn,B]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[h]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",B]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",B]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",B]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[ks,B]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",B]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",B]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",B]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qt,un,Bl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},J0=L0(X0);function T(...e){return J0(w0(e))}const Z0={online:"bg-signal-ok",streaming:"bg-brand",idle:"bg-muted-foreground/40",error:"bg-signal-error",warning:"bg-signal-warn"};function ev({state:e}){return i.jsx("span",{className:T("inline-block h-1.5 w-1.5 shrink-0 rounded-full",Z0[e],e==="streaming"&&"animate-[v2-halo-brand_2.4s_ease-out_infinite]")})}const tv={default:"text-muted-foreground bg-muted border-border",brand:"text-brand bg-brand-ghost border-brand-ghost",ok:"text-signal-ok bg-signal-ok/[0.10] border-transparent",warn:"text-signal-warn bg-signal-warn/[0.10] border-transparent",error:"text-signal-error bg-error-ghost border-transparent",ghost:"text-muted-foreground bg-transparent border-border-soft"};function he({tone:e="default",mono:t=!1,className:n,title:r,children:s}){return i.jsx("span",{title:r,className:T("inline-flex items-center gap-1.5 rounded-full border px-[9px] py-[2px] text-[11.5px] font-medium leading-[1.5]",t?"font-mono tracking-normal":"tracking-[-0.005em]",tv[e],n),children:s})}function St({children:e,className:t}){return i.jsx("kbd",{className:T("inline-flex min-w-[18px] items-center justify-center rounded-[5px] border border-border bg-card px-1.5 py-px text-[10.5px] font-medium leading-none text-muted-foreground","border-b-[1.5px] border-b-border-hi",t),children:e})}function br({active:e,title:t,onClick:n,disabled:r,className:s,children:o,...l}){return i.jsx("button",{type:"button",title:t,onClick:n,disabled:r,"aria-label":l["aria-label"]??t,className:T("inline-flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-full border text-[13px] transition-[color,background-color,border-color,transform] duration-200 ring-brand-focus disabled:cursor-not-allowed disabled:opacity-50 active:scale-[0.9]",e?"border-brand-ghost bg-brand-ghost text-brand":"border-transparent text-muted-foreground hover:bg-accent/70 hover:text-foreground hover:border-border-soft",s),children:o})}function ln({tool:e,className:t}){const n="currentColor";switch(e){case"read":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M2 3h7l3 3v5a1 1 0 0 1-1 1H2zM9 3v3h3"})});case"edit":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M2 10l7-7 2 2-7 7H2zM8.5 3.5L10.5 5.5"})});case"write":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 2h6l3 3v7H3zM7 2v9M3 7h9"})});case"bash":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M2 4l3 3-3 3M7 10h5"})});case"grep":case"find":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"6",cy:"6",r:"3.5"}),i.jsx("path",{d:"M9 9l3 3"})]});case"ls":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M2 4h10M2 7h10M2 10h6"})});case"todo":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 4l1.5 1.5L7 3M3 8l1.5 1.5L7 7M9 4.5h3M9 8.5h3"})});case"ask_user":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"7",cy:"7",r:"5"}),i.jsx("path",{d:"M5.5 5.5a1.5 1.5 0 0 1 3 0c0 .9-.9 1.2-1.5 1.7v.6"}),i.jsx("circle",{cx:"7",cy:"10",r:"0.4",fill:n})]});case"web_search":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"7",cy:"7",r:"5"}),i.jsx("path",{d:"M2 7h10"}),i.jsx("path",{d:"M7 2c1.7 1.5 1.7 8.5 0 10"}),i.jsx("path",{d:"M7 2c-1.7 1.5-1.7 8.5 0 10"})]});case"web_fetch":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M7 2v6"}),i.jsx("path",{d:"M4.5 5.5L7 8l2.5-2.5"}),i.jsx("path",{d:"M2.5 11h9"})]});case"subagent":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"2",y:"2",width:"4.5",height:"4.5",rx:"1"}),i.jsx("rect",{x:"7.5",y:"7.5",width:"4.5",height:"4.5",rx:"1"}),i.jsx("path",{d:"M6.5 4.25h2.25a1 1 0 0 1 1 1V7.5"})]});default:return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,children:i.jsx("circle",{cx:"7",cy:"7",r:"3"})})}}function wr(e){return e==null?"—":e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/1e3)}s`}function Kd(e){if(e!=null)return e>=3e3?"text-signal-error":e>=1500?"text-signal-warn":"text-brand"}function yn({className:e}){return i.jsx("span",{"aria-hidden":!0,className:T("inline-block animate-pulse rounded-[5px] bg-accent/70",e)})}function Pb({rows:e=3,className:t,rowClassName:n}){return i.jsx("div",{className:T("flex flex-col gap-2",t),children:Array.from({length:e}).map((r,s)=>i.jsx(yn,{className:T("h-3",s===e-1?"w-2/3":"w-full",n)},s))})}const Rb=320,Mb=240,Lb="pi-pilot-resources-width",Ob="pi-pilot-tree-width",Ib="pi-pilot-files-width",Ab=480,Db="pi-pilot-artifact-width",Fb=320,zb=300,Ub="pi-pilot-terminal-height",$b=120,nv=480,$i={compact:"max-w-[920px]",comfortable:"max-w-[860px]"},dl="max-h-80",rm="w-[48px]",rv=272,sv="pi-pilot-sidebar-width",ov=200,iv=100;function sm(e){if(!e||typeof e!="object")return[];const n=e.tasks;return Array.isArray(n)?n.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;if(typeof s.id!="number"||typeof s.subject!="string")return[];if(!s.subject.trim())return[];const o=s.status;return o!=="pending"&&o!=="in_progress"&&o!=="completed"&&o!=="deleted"?[]:[{id:s.id,subject:s.subject,status:o,description:typeof s.description=="string"?s.description:void 0}]}):[]}function om(e){return e.filter(t=>t.status!=="deleted")}const Gd=e=>{let t;const n=new Set,r=(c,p)=>{const h=typeof c=="function"?c(t):c;if(!Object.is(h,t)){const d=t;t=p??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(w=>w(t,d))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(r,s,a);return a},lv=e=>e?Gd(e):Gd,av=e=>e;function uv(e,t=av){const n=Oo.useSyncExternalStore(e.subscribe,Oo.useCallback(()=>t(e.getState()),[e,t]),Oo.useCallback(()=>t(e.getInitialState()),[e,t]));return Oo.useDebugValue(n),n}const Yd=e=>{const t=lv(e),n=r=>uv(t,r);return Object.assign(n,t),n},fs=e=>e?Yd(e):Yd,cv=12;function qi(e,t){return`${e}\0${t??""}`}function $s(){return{steer:[],followUp:[],deliveryOrder:[]}}function Xd(e){return{steer:[...e.steer],followUp:[...e.followUp],deliveryOrder:[...e.deliveryOrder]}}function dv(e,t,n){return{...e,[n]:[...e[n],t]}}const Mt=new Map;let uu=!1;function fv(){const e=uu;return uu=!1,e}function pv(e){const t=Mt.get(qi(e.workspaceId,e.sessionPath));t&&(mv(t,e.payload),t.backgroundFresh=!0)}function hv(e,t){const n=Mt.get(qi(e,t));n&&(n.backgroundFresh=!1)}function mv(e,t){switch(t.kind){case"agent_start":e.running=!0,e.retrying=void 0;return;case"agent_end":e.running=t.willRetry,t.willRetry||(e.retrying=void 0),t.error&&(e.items=am(e.items,t.error));return;case"auto_retry_start":e.running=!0,e.retrying={attempt:t.attempt,maxAttempts:t.maxAttempts,reason:t.errorMessage};return;case"auto_retry_end":e.retrying=void 0;return;case"message_start":{if(t.role==="user"){if(t.text!==void 0){const n=lm(e.items,t.text,e.queuedOriginals);e.items=n.items,e.queuedOriginals=n.queuedOriginals}return}t.role==="assistant"&&(e.items=[...e.items,{id:Nt(),kind:"assistant",text:"",thinking:"",streaming:!0,firstTokenMs:void 0,totalMs:void 0}]);return}case"message_end":{if(t.role!=="assistant")return;const n=co(e.items);if(n<0)return;const r=e.items.slice();r[n]={...r[n],streaming:!1},e.items=r;return}case"message_update":{if(t.delta.kind==="other")return;const n=co(e.items);if(n<0)return;const r=e.items[n],s=e.items.slice();s[n]=t.delta.kind==="text"?{...r,text:r.text+t.delta.text}:{...r,thinking:r.thinking+t.delta.text},e.items=s;return}case"tool_execution_start":e.items=[...e.items,{id:Nt(),kind:"tool",toolCallId:t.toolCallId,toolName:t.toolName,args:t.args,text:"",status:"running"}];return;case"tool_execution_update":e.items=e.items.map(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId?{...n,text:t.partialText??n.text,...t.details!==void 0?{details:t.details}:{}}:n);return;case"tool_execution_end":e.items=e.items.map(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId?{...n,text:t.text??n.text,status:t.isError?"error":"ok",...t.details!==void 0?{details:t.details}:{}}:n);return;case"queue_update":e.queuedOriginals=im(e.queuedOriginals,e.queueSteering,e.queueFollowUp,t.steering,t.followUp),e.queueSteering=t.steering,e.queueFollowUp=t.followUp;return;case"compaction_start":e.compaction={reason:t.reason};return;case"compaction_end":e.compaction=void 0;return;case"context_usage":e.contextUsage={tokens:t.tokens,contextWindow:t.contextWindow,percent:t.percent};return;case"assistant_timing":{for(let n=e.items.length-1;n>=0;n--){const r=e.items[n];if(r.kind==="assistant"&&!r.streaming&&r.totalMs===void 0){const s=e.items.slice();s[n]={...r,firstTokenMs:t.firstTokenMs,totalMs:t.totalMs},e.items=s;break}}return}default:return}}let gv=1;const Nt=()=>String(gv++),xv=100,hn=new Map;function Jd(e,t){if(e!==t){for(hn.has(e)&&hn.delete(e);hn.size>=xv;){const n=hn.keys().next().value;if(n!==void 0)hn.delete(n);else break}hn.set(e,t)}}function im(e,t,n,r,s){const o=Math.max(0,t.length-r.length),l=Math.max(0,n.length-s.length),a=[];if(o>0&&l===0)for(let u=0;u<o;u++)a.push("steer");else if(l>0&&o===0)for(let u=0;u<l;u++)a.push("followUp");return a.length===0?e:{...e,deliveryOrder:[...e.deliveryOrder,...a]}}function yv(e){const t=e.deliveryOrder[0];if(!t)return{original:void 0,queuedOriginals:e};const n=e.deliveryOrder.slice(1),r=e[t],s=r[0],o=s===void 0?r:r.slice(1);return t==="steer"?{original:s,queuedOriginals:{steer:o,followUp:e.followUp,deliveryOrder:n}}:{original:s,queuedOriginals:{steer:e.steer,followUp:o,deliveryOrder:n}}}function lm(e,t,n){const r=e.findIndex(l=>l.kind==="user"&&l.pending===!0);if(r>=0){const l=e.slice(),a=l[r];return Jd(t,a.text),l[r]={...a,pending:!1},{items:l,queuedOriginals:n}}const s=yv(n),o=s.original??t;return s.original!==void 0&&Jd(t,s.original),{items:[...e,{id:Nt(),kind:"user",text:o}],queuedOriginals:s.queuedOriginals}}let qs="",Bs="",Zt=null;function Bi(){if(Zt!==null&&(cancelAnimationFrame(Zt),Zt=null),qs===""&&Bs==="")return;const e=qs,t=Bs;qs="",Bs="",V.setState(n=>{const r=co(n.items);if(r<0)return{};const s=n.items[r],o=n.items.slice();return o[r]={...s,text:e?s.text+e:s.text,thinking:t?s.thinking+t:s.thinking},{items:o}})}function Zd(){if(Zt===null){if(typeof requestAnimationFrame!="function"){Bi();return}Zt=requestAnimationFrame(()=>{Zt=null,Bi()})}}function cu(){Zt!==null&&(cancelAnimationFrame(Zt),Zt=null),qs="",Bs=""}const du={scrollTop:0,stickToBottom:!0},V=fs(e=>({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:$s(),compaction:void 0,retrying:void 0,contextUsage:void 0,latency:void 0,composerDraft:"",scrollInfo:du,reset:()=>{cu(),hn.clear(),Mt.clear(),e({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:$s(),compaction:void 0,retrying:void 0,contextUsage:void 0,latency:void 0,composerDraft:"",scrollInfo:du})},pushUser:t=>e(n=>({items:[...n.items,{id:Nt(),kind:"user",text:t,pending:!0}]})),rememberQueuedUser:(t,n)=>e(r=>({queuedOriginals:dv(r.queuedOriginals,t,n)})),apply:t=>{if(t.type==="event"&&t.payload.kind==="message_update"){const n=t.payload.delta;n.kind==="text"?(qs+=n.text,Zd()):n.kind==="thinking"&&(Bs+=n.text,Zd());return}Bi(),e(n=>wv(n,t))},setSwitching:t=>e({switching:t}),setComposerDraft:t=>e({composerDraft:t}),setScrollInfo:t=>e({scrollInfo:t}),applyHistory:(t,n)=>{cu(),e({latency:void 0,items:t.map(r=>{if(r.kind==="user"){const s=hn.get(r.text)??r.text;return{id:Nt(),kind:"user",text:s,entryId:r.entryId}}return r.kind==="assistant"?{id:Nt(),kind:"assistant",text:r.text,thinking:r.thinking,streaming:!1,firstTokenMs:void 0,totalMs:void 0,...r.error?{error:r.error}:{}}:r.kind==="tool"?{id:Nt(),kind:"tool",toolCallId:r.toolCallId,toolName:r.toolName,args:vv(r.args),text:r.text,status:r.isError?"error":"ok",...r.details!==void 0?{details:r.details}:{}}:{id:Nt(),kind:"bash",command:r.command,output:r.output,exitCode:r.exitCode}}),running:n,...n?{}:{queueSteering:[],queueFollowUp:[],queuedOriginals:$s()}})},saveSnapshot:t=>{const n=V.getState();Bi();const r=qi(t,n.sessionPath),s={sessionPath:n.sessionPath,items:n.items,running:n.running,queueSteering:n.queueSteering,queueFollowUp:n.queueFollowUp,queuedOriginals:Xd(n.queuedOriginals),compaction:n.compaction,retrying:n.retrying,contextUsage:n.contextUsage,latency:n.latency,composerDraft:n.composerDraft,scrollInfo:n.scrollInfo,backgroundFresh:!1};for(Mt.has(r)&&Mt.delete(r);Mt.size>=cv;){const o=Mt.keys().next().value;if(o!==void 0)Mt.delete(o);else break}Mt.set(r,s)},restoreSnapshot:(t,n)=>{const r=Mt.get(qi(t,n));if(!r)return{restored:!1,wasFresh:!1};const s=r.backgroundFresh;return V.setState({items:r.items,running:r.running,queueSteering:r.queueSteering,queueFollowUp:r.queueFollowUp,queuedOriginals:Xd(r.queuedOriginals),compaction:r.compaction,retrying:r.retrying,contextUsage:r.contextUsage,latency:r.latency,composerDraft:r.composerDraft,scrollInfo:r.scrollInfo}),r.backgroundFresh=!1,{restored:!0,wasFresh:s}}}));function vv(e){if(!(e==null||e==="")){if(typeof e=="object"&&!Array.isArray(e))return e;if(typeof e=="string")try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch{return}}}function wv(e,t){if(t.type==="subscribed"){cu();const n=V.getState().restoreSnapshot(t.workspaceId,t.sessionPath);return uu=n.restored?n.wasFresh:!1,n.restored?{sessionPath:t.sessionPath,switching:!1}:{sessionPath:t.sessionPath,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:$s(),compaction:void 0,retrying:void 0,latency:void 0,composerDraft:"",scrollInfo:du}}if(t.type==="error"){const n={};if(e.switching&&(n.switching=!1),t.command==="prompt"){const r=e.items.findIndex(s=>s.kind==="user"&&s.pending===!0);if(r>=0){const s=e.items.slice(),o=s[r];s[r]={...o,pending:!1},n.items=s}else n.queuedOriginals=$s()}return n}return t.type==="navigate_tree_result"?{}:t.type!=="event"?{}:bv(e,t.payload)}function bv(e,t){var n;switch(t.kind){case"agent_start":return{running:!0,retrying:void 0};case"agent_end":{if(t.willRetry)return{running:!0};const r={running:!1,retrying:void 0};return t.error&&(r.items=am(e.items,t.error)),r}case"auto_retry_start":return{running:!0,retrying:{attempt:t.attempt,maxAttempts:t.maxAttempts,reason:t.errorMessage}};case"auto_retry_end":return{retrying:void 0};case"message_start":{if(t.role==="user"){if(t.text===void 0)return{};const r=lm(e.items,t.text,e.queuedOriginals);return{items:r.items,queuedOriginals:r.queuedOriginals}}return t.role!=="assistant"?{}:{items:[...e.items,{id:Nt(),kind:"assistant",text:"",thinking:"",streaming:!0,firstTokenMs:void 0,totalMs:void 0}]}}case"message_end":{if(t.role!=="assistant")return{};const r=co(e.items);if(r<0)return{};const s=e.items.slice();return s[r]={...s[r],streaming:!1},{items:s}}case"message_update":{if(t.delta.kind==="other")return{};const r=co(e.items);if(r<0)return{};const s=e.items[r],o=t.delta.kind==="text"?{...s,text:s.text+t.delta.text}:{...s,thinking:s.thinking+t.delta.text},l=e.items.slice();return l[r]=o,{items:l}}case"tool_execution_start":return{items:[...e.items,{id:Nt(),kind:"tool",toolCallId:t.toolCallId,toolName:t.toolName,args:t.args,text:"",status:"running"}]};case"tool_execution_update":return{items:e.items.map(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId?{...r,text:t.partialText??r.text,...t.details!==void 0?{details:t.details}:{}}:r)};case"tool_execution_end":return{items:e.items.map(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId?{...r,text:t.text??r.text,status:t.isError?"error":"ok",...t.details!==void 0?{details:t.details}:{}}:r)};case"queue_update":return{queueSteering:t.steering,queueFollowUp:t.followUp,queuedOriginals:im(e.queuedOriginals,e.queueSteering,e.queueFollowUp,t.steering,t.followUp)};case"compaction_start":return{compaction:{reason:t.reason}};case"compaction_end":return{compaction:void 0};case"context_usage":return{contextUsage:{tokens:t.tokens,contextWindow:t.contextWindow,percent:t.percent}};case"assistant_timing":{const r=((n=e.latency)==null?void 0:n.rollingFirstTokenMs)??[],s=t.firstTokenMs==null?r:[...r,t.firstTokenMs].slice(-5),o={lastFirstTokenMs:t.firstTokenMs,lastTotalMs:t.totalMs,rollingFirstTokenMs:s};let l=-1;for(let u=e.items.length-1;u>=0;u--){const c=e.items[u];if(c.kind==="assistant"&&!c.streaming&&c.totalMs===void 0){l=u;break}}if(l<0)return{latency:o};const a=e.items.slice();return a[l]={...a[l],firstTokenMs:t.firstTokenMs,totalMs:t.totalMs},{items:a,latency:o}}default:return{}}}function co(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="assistant"&&n.streaming)return t}return-1}function kv(e){for(let t=e.length-1;t>=0;t--)if(e[t].kind==="assistant")return t;return-1}function am(e,t){const n=kv(e);if(n>=0&&n===e.length-1){const r=e.slice();return r[n]={...r[n],error:t},r}return[...e,{id:Nt(),kind:"assistant",text:"",thinking:"",streaming:!1,firstTokenMs:void 0,totalMs:void 0,error:t}]}function jv(){const e=V(p=>{for(let h=p.items.length-1;h>=0;h--){const d=p.items[h];if(d&&d.kind==="tool"&&d.toolName==="todo"&&d.details)return d.details}}),[t,n]=y.useState(!1),r=y.useId(),s=sm(e),o=om(s);if(o.length===0)return null;const l=o.length,a=o.filter(p=>p.status==="completed").length,u=l===0?0:a/l,c=o.find(p=>p.status==="in_progress");return i.jsxs("div",{className:"relative z-10 shrink-0 border-b border-border bg-popover",children:[i.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(p=>!p),className:"flex w-full items-center gap-2.5 px-4 py-1.5 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:[i.jsx(To,{className:T("h-3 w-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180"),"aria-hidden":!0}),i.jsx(ln,{tool:"todo",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Todos"}),i.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums text-muted-foreground",children:[a,"/",l]}),i.jsx("span",{className:`inline-block h-1 ${rm} shrink-0 overflow-hidden rounded-full bg-border-soft`,role:"progressbar","aria-valuemin":0,"aria-valuenow":a,"aria-valuemax":l,"aria-label":`Todo progress: ${a} of ${l} completed`,children:i.jsx("span",{className:"block h-full rounded-full bg-brand transition-[width] duration-300",style:{width:`${u*100}%`}})}),c&&i.jsxs("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:[i.jsx("span",{className:"text-muted-foreground/70",children:"· "}),i.jsx(mr,{className:"mr-1 inline-block h-3 w-3 text-brand align-[-2px] animate-v2-spin","aria-hidden":!0}),c.subject]}),!c&&i.jsx("span",{className:"flex-1","aria-hidden":!0})]}),t&&i.jsx("ul",{id:r,className:"border-t border-border-soft bg-background px-4 py-1.5","aria-label":"Todo items",children:o.map(p=>i.jsxs("li",{className:"flex items-start gap-2 py-[3px]",children:[i.jsx("span",{className:"mt-[2px] shrink-0",children:p.status==="completed"?i.jsx(_o,{className:"h-3.5 w-3.5 text-signal-ok","aria-hidden":!0}):p.status==="in_progress"?i.jsx(mr,{className:"h-3.5 w-3.5 text-brand animate-v2-spin","aria-label":"In progress"}):i.jsx(Kh,{className:"h-3.5 w-3.5 text-muted-foreground/40","aria-hidden":!0})}),i.jsxs("span",{className:T("min-w-0 flex-1 text-[12.5px] leading-[1.5]",p.status==="completed"?"text-muted-foreground line-through decoration-muted-foreground/30":p.status==="in_progress"?"text-foreground font-medium":"text-muted-foreground"),children:[i.jsxs("span",{className:"mr-1.5 font-mono text-[11px] text-muted-foreground/50",children:["#",p.id]}),p.subject]})]},p.id))})]})}function Sv(){const e=V(n=>n.compaction),t=V(n=>{var r;return(r=n.contextUsage)==null?void 0:r.percent});return e?i.jsxs("div",{className:"relative z-10 flex shrink-0 items-center gap-3 border-b border-border bg-signal-warn/[0.10] px-4 py-2 text-[12.5px] text-signal-warn",children:[i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:"animate-v2-spin",children:i.jsx("circle",{cx:"7",cy:"7",r:"5",stroke:"currentColor",strokeWidth:"1.4",strokeDasharray:"3 3"})}),i.jsx("span",{className:"flex-1",children:Nv(e)}),t!=null&&i.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:["Context ",Math.round(t),"%"]})]}):null}function Nv(e){switch(e.reason){case"manual":return"Compacting context (manual)…";case"threshold":return"Compacting context — threshold reached";case"overflow":return"Compacting context (overflow) — will retry the prompt";default:return"Compacting context…"}}function Ev(e,t,n=!0){return Tt({queryKey:["fs","browse",e??"~",t],queryFn:()=>{const r=new URLSearchParams;e!==void 0&&r.set("path",e),t&&r.set("showHidden","1");const s=r.toString();return G(`/api/fs/browse${s?`?${s}`:""}`)},enabled:n,staleTime:3e4})}function Cv(e,t,n=!0,r){const s=t.toLowerCase();return Tt({queryKey:["fs","search-files",e??"",s,r??0],queryFn:()=>{if(!e)throw new Error("workspaceId required");const o=new URLSearchParams;return s&&o.set("q",s),r&&o.set("limit",String(r)),G(`/api/workspaces/${encodeURIComponent(e)}/files/search${o.toString()?`?${o.toString()}`:""}`)},enabled:n&&!!e,staleTime:5e3})}function qb(e,t=!0){return Tt({queryKey:["fs","file-list",e??""],queryFn:()=>{if(!e)throw new Error("workspaceId required");return G(`/api/workspaces/${encodeURIComponent(e)}/files/list`)},enabled:t&&!!e,staleTime:1e4})}const um=(e,t)=>["fs","file",e,t];function Bb(e,t){return Tt({queryKey:um(e,t??""),queryFn:()=>{if(!t)throw new Error("relPath required");return G(`/api/workspaces/${encodeURIComponent(e)}/file?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnMount:"always",refetchOnWindowFocus:!1,staleTime:1/0})}function Qb(e){const t=oe();return ye({mutationFn:n=>G(`/api/workspaces/${encodeURIComponent(e)}/file`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:um(e,r.path)})}})}const fu="pi-pilot-density";function _v(){try{const e=localStorage.getItem(fu);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"}const cm=fs((e,t)=>({density:_v(),setDensity:n=>{try{localStorage.setItem(fu,n)}catch{}e({density:n})},toggle:()=>{const n=t().density==="compact"?"comfortable":"compact";try{localStorage.setItem(fu,n)}catch{}e({density:n})}}));function ef(e,t){if(t<=0)return null;const n=e.slice(0,t),r=/(?:^|\s)([/@])(\S*)$/.exec(n);if(!r)return null;const s=r[1]??"",o=r[2]??"",l=(r.index??0)+(r[0].length-1-o.length);return{kind:s==="/"?"slash":"at",tokenStart:l,query:o}}function Tv(e){const t=[],n=/(^|\s)([/@])(\S+)/g;let r;for(;(r=n.exec(e))!==null;){const s=r[1]??"",o=r[2]??"",l=r[3]??"",a=(r.index??0)+s.length,u=a+1+l.length;t.push({kind:o==="/"?"slash":"at",start:a,end:u,body:e.slice(a,u)})}return t}const dm=[{value:"followUp",label:"Follow-up",description:"Queue after the current reply"},{value:"steer",label:"Steer",description:"Guide the current reply"}];function Jo(e){var t;return((t=dm.find(n=>n.value===e))==null?void 0:t.label)??e}const tf=50,Pv=/\$\{@:\d+(?::\d+)?\}|\$ARGUMENTS|\$@|\$\d+/;function Rv(e){return!!e.argumentHint||Pv.test(e.content)}function Mv(e,t){if(!e)return[];const n=t.toLowerCase(),r=[];for(const s of e.skills)n&&!s.name.toLowerCase().includes(n)||r.push({key:`skill:${s.filePath}`,label:`/skill:${s.name}`,description:s.description||void 0,insertText:`/skill:${s.name} `});for(const s of e.prompts){if(n&&!s.name.toLowerCase().includes(n))continue;const o={key:`prompt:${s.filePath}`,label:`/${s.name}`,description:s.argumentHint?`${s.description??"prompt"} · ${s.argumentHint}`:s.description||"prompt"};Rv(s)?o.insertText=`/${s.name} `:o.prompt={name:s.name,description:s.description},r.push(o)}for(const s of e.extensions){const o=s.source.label==="inline";for(const l of s.commands)n&&!l.toLowerCase().includes(n)||r.push({key:`cmd:${s.resolvedPath}:${l}`,label:`/${l}`,description:o?`pi-pilot · ${l}`:`extension · ${s.source.label}`,insertText:`/${l} `})}return r.length>tf?r.slice(0,tf):r}function Lv(e){return e?e.entries.map(t=>({key:t.path,label:t.relPath,insertText:`@${t.relPath} `})):[]}function Ov({workspaceId:e,onSend:t,onAbort:n,running:r,disabled:s}){var _e;const o=V(D=>D.composerDraft),l=V(D=>D.setComposerDraft),a=o,u=l,[c,p]=y.useState(0),[h,d]=y.useState(!1),[w,b]=y.useState(0),[g,j]=y.useState(null),[f,m]=y.useState(null),[x,k]=y.useState("followUp"),C=y.useRef(null),S=y.useRef(null),N=y.useRef(!1),E=cm(D=>D.density)==="compact",_=y.useMemo(()=>ef(a,c),[a,c]),R=_==null?void 0:_.kind,$=(_==null?void 0:_.query)??"",U=Vh(R==="slash"?e:void 0),me=Cv(e,R==="at"?$:"",R==="at"),ce=y.useMemo(()=>R?R==="slash"?Mv(U.data,$):Lv(me.data):[],[R,$,U.data,me.data]),Se=_?`${_.kind}:${_.tokenStart}:${_.query}`:null,Fe=!!_&&ce.length>0&&g!==Se;y.useEffect(()=>{b(0)},[Se]),y.useEffect(()=>{g&&g!==Se&&j(null)},[Se,g]),y.useEffect(()=>{m(null)},[e]),y.useEffect(()=>{r||k("followUp")},[r]),y.useEffect(()=>{var D;f&&((D=S.current)==null||D.focus())},[f]);const it=()=>requestAnimationFrame(()=>{var D;return(D=C.current)==null?void 0:D.focus()}),M=()=>{if(s)return;const D=r?x:void 0;if(f){t(`/${f.name}`,D),m(null),u(""),p(0),it();return}const ie=a.trim();ie&&(t(ie,D),u(""),p(0))},A=()=>{m(null),it()},z=D=>{D.key==="Enter"&&!D.shiftKey?(D.preventDefault(),M()):(D.key==="Backspace"||D.key==="Delete"||D.key==="Escape")&&(D.preventDefault(),A())},Q=D=>{if(D.prompt){m(D.prompt),u(""),p(0),j(null),N.current=!1;return}const ie=C.current,ps=(ie==null?void 0:ie.value)??a,ml=(ie==null?void 0:ie.selectionStart)??c,Hn=ef(ps,ml);if(!Hn)return;const Ro=D.insertText??"",Mo=Hn.tokenStart+1+Hn.query.length,gl=ps.slice(0,Hn.tokenStart),H=ps.slice(Mo),ve=`${gl}${Ro}${H}`,we=Hn.tokenStart+Ro.length;u(ve),p(we),j(null),requestAnimationFrame(()=>{const at=C.current;at&&(at.focus(),at.setSelectionRange(we,we))})},Z=()=>{N.current=!0},lt=()=>{N.current=!1},Me=D=>{if(!(N.current||D.nativeEvent.isComposing||D.nativeEvent.keyCode===229)){if(Fe){if(D.key==="ArrowDown"){D.preventDefault(),b(ie=>(ie+1)%ce.length);return}if(D.key==="ArrowUp"){D.preventDefault(),b(ie=>(ie-1+ce.length)%ce.length);return}if(D.key==="Enter"||D.key==="Tab"){D.preventDefault();const ie=ce[w]??ce[0];ie&&Q(ie);return}if(D.key==="Escape"){D.preventDefault(),Se&&j(Se);return}}D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),M())}},Ut=s?"Switching session…":r?`Agent is running — ${Jo(x)} on Enter…`:"Write a message…",Qe=f!==null||!!a.trim();return i.jsx("div",{className:"relative shrink-0 pb-3 pt-3 v2-rise-in",children:i.jsxs("div",{className:T("pointer-events-auto mx-auto w-full px-6",E?$i.compact:$i.comfortable),children:[i.jsxs("div",{className:T("relative rounded-[16px] border bg-card transition-shadow",h?"border-brand shadow-[0_0_0_3px_hsl(var(--brand)/0.10)]":"border-border-hi shadow-glow"),children:[r&&i.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute left-4 right-4 top-0 h-[2px] rounded-full bg-brand animate-v2-working"}),!f&&Fe&&_&&i.jsx(Fv,{kind:_.kind,query:_.query,items:ce,selectedIdx:w,loading:_.kind==="slash"?U.isPending:me.isPending,truncated:_.kind==="at"?!!((_e=me.data)!=null&&_e.truncated):!1,onPick:Q,onHover:b}),f?i.jsx("div",{ref:S,tabIndex:0,role:"group","aria-label":`Loaded prompt /${f.name}`,onKeyDown:z,onFocus:()=>d(!0),onBlur:()=>d(!1),className:T("block w-full p-2 outline-none ring-brand-focus",r?"pr-28":"pr-20"),children:i.jsxs("div",{className:"flex items-start gap-2.5 rounded-[10px] border border-border-soft bg-muted/60 px-3 py-2.5",children:[i.jsx(x0,{className:"mt-px h-4 w-4 shrink-0 text-brand"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"font-mono text-[13px] leading-tight text-foreground",children:["/",f.name]}),f.description&&i.jsx("div",{className:"mt-0.5 truncate text-[12px] text-muted-foreground",children:f.description})]})]})}):i.jsx(Iv,{textareaRef:C,text:a,onTextChange:(D,ie)=>{u(D),p(ie)},onCaretChange:p,onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:Me,onCompositionStart:Z,onCompositionEnd:lt,disabled:s,placeholder:Ut}),i.jsxs("div",{className:"absolute bottom-1 right-2 z-10 flex items-center gap-1.5",children:[f&&i.jsx("button",{type:"button",onClick:A,disabled:s,title:"Remove","aria-label":"Remove loaded prompt",className:"inline-flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50 ring-brand-focus",children:i.jsx(mc,{className:"h-3.5 w-3.5"})}),r?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:M,disabled:s||!Qe,title:`Send as ${Jo(x).toLowerCase()}`,"aria-label":`Send as ${Jo(x)}`,className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-border-soft bg-card text-foreground transition-[color,background-color,transform] duration-200 hover:bg-accent active:scale-[0.9] disabled:cursor-not-allowed disabled:opacity-50 ring-brand-focus",children:i.jsx(iu,{className:"h-4 w-4",strokeWidth:2.5})}),i.jsx("button",{type:"button",onClick:n,disabled:s,title:"Stop streaming",className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-error-ghost text-signal-error transition-[color,background-color,transform] duration-200 hover:bg-error-subtle active:scale-[0.9] disabled:opacity-50 ring-brand-focus",children:i.jsx(v0,{className:"h-3 w-3",fill:"currentColor"})})]}):i.jsx("button",{type:"button",onClick:M,disabled:s||!Qe,title:"Send",className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-brand text-[hsl(var(--brand-foreground))] transition-[color,background-color,transform] duration-200 hover:bg-brand-strong active:scale-[0.9] disabled:cursor-not-allowed disabled:bg-border-soft disabled:text-muted-foreground ring-brand-focus",children:i.jsx(iu,{className:"h-4 w-4",strokeWidth:2.5})})]})]}),i.jsxs("div",{className:T("mt-1.5 flex flex-wrap items-center gap-2 text-[11.5px] text-muted-foreground",r?"justify-between":"justify-center"),children:[r&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-muted-foreground/80",children:"while running"}),i.jsx("div",{role:"radiogroup","aria-label":"Prompt behavior while running",className:"inline-flex rounded-full border border-border-soft bg-muted/60 p-0.5",children:dm.map(D=>{const ie=D.value===x;return i.jsx("button",{type:"button",role:"radio","aria-checked":ie,onClick:()=>k(D.value),title:D.description,className:T("rounded-full px-2 py-0.5 text-[11px] transition-colors ring-brand-focus",ie?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:D.label},D.value)})})]}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[i.jsx(St,{children:"⏎"}),i.jsx("span",{children:r?Jo(x).toLowerCase():"send"}),i.jsx("span",{className:"text-muted-foreground/50",children:"·"}),f?i.jsxs(i.Fragment,{children:[i.jsx(St,{children:"⌫"}),i.jsx("span",{children:"remove"})]}):i.jsxs(i.Fragment,{children:[i.jsx(St,{children:"⇧⏎"}),i.jsx("span",{children:"newline"}),i.jsx("span",{className:"text-muted-foreground/50",children:"·"}),i.jsx(St,{children:"/"}),i.jsx("span",{children:"commands"}),i.jsx("span",{className:"text-muted-foreground/50",children:"·"}),i.jsx(St,{children:"@"}),i.jsx("span",{children:"files"})]})]})]})]})})}const nf="block max-h-[180px] min-h-[40px] w-full resize-none pl-4 pr-24 pt-2 pb-2 font-sans text-[14px] leading-[1.55] tracking-[-0.005em] whitespace-pre-wrap break-words",rf=180;function Iv({textareaRef:e,text:t,onTextChange:n,onCaretChange:r,onFocus:s,onBlur:o,onKeyDown:l,onCompositionStart:a,onCompositionEnd:u,disabled:c,placeholder:p}){const h=y.useRef(null),[d,w]=y.useState(!1),b=y.useMemo(()=>Tv(t),[t]),g=y.useCallback(()=>{const S=e.current;S&&r(S.selectionStart??0)},[e,r]),j=y.useCallback(()=>{const S=e.current,N=h.current;!S||!N||(N.scrollTop=S.scrollTop,N.scrollLeft=S.scrollLeft)},[e,h]),f=y.useCallback(()=>{const S=e.current;if(!S)return;S.style.height="auto";const N=Math.min(S.scrollHeight,rf);S.style.height=`${N}px`,S.style.overflowY=S.scrollHeight>rf?"auto":"hidden",j()},[e,j]);y.useLayoutEffect(()=>{f()},[t,f]),y.useEffect(()=>{const S=e.current;if(!S||typeof ResizeObserver>"u")return;let N=S.clientWidth;const E=new ResizeObserver(()=>{const _=S.clientWidth;_!==N&&(N=_,f())});return E.observe(S),()=>E.disconnect()},[e,f]);const m=y.useMemo(()=>Av(t,b),[t,b]),k=b.length>0,C=d?"text-transparent":"text-foreground";return i.jsxs("div",{className:"relative",children:[k&&i.jsxs("div",{ref:h,"aria-hidden":!0,className:T(nf,"pointer-events-none absolute inset-0 overflow-hidden whitespace-pre-wrap"),children:[m.map((S,N)=>S.kind==="text"?i.jsx("span",{className:C,children:S.text},N):i.jsx(Dv,{body:S.text,hideText:d},N)),""]}),i.jsx("textarea",{ref:e,"data-composer-input":!0,value:t,onChange:S=>n(S.target.value,S.target.selectionStart??S.target.value.length),onSelect:g,onClick:g,onKeyUp:g,onScroll:j,onCompositionStart:()=>{w(!0),a==null||a()},onCompositionEnd:()=>{w(!1),u==null||u()},onFocus:s,onBlur:o,onKeyDown:l,disabled:c,placeholder:p,spellCheck:!1,autoCorrect:"off",rows:1,className:T(nf,"relative bg-transparent caret-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",k&&!d?"text-transparent selection:text-transparent selection:bg-brand/20":"text-foreground")})]})}function Av(e,t){if(t.length===0)return[{kind:"text",text:e}];const n=[];let r=0;for(const s of t)s.start>r&&n.push({kind:"text",text:e.slice(r,s.start)}),n.push({kind:s.kind,text:e.slice(s.start,s.end)}),r=s.end;return r<e.length&&n.push({kind:"text",text:e.slice(r)}),n}function Dv({body:e,hideText:t=!1}){return i.jsx("span",{className:T("inline rounded-[3px] bg-brand-ghost [box-decoration-break:clone] [-webkit-box-decoration-break:clone]",t?"text-transparent":"text-brand"),children:e})}function Fv({kind:e,query:t,items:n,selectedIdx:r,loading:s,truncated:o,onPick:l,onHover:a}){const u=y.useRef(null);y.useEffect(()=>{const h=u.current;if(!h)return;const d=h.querySelector(`[data-idx="${r}"]`);d==null||d.scrollIntoView({block:"nearest"})},[r]);const c=e==="slash"?"Commands":"Files",p=t?`"${t}"`:"";return i.jsxs("div",{className:"absolute bottom-full left-0 right-0 z-30 mb-2 overflow-hidden rounded-[10px] border border-border bg-popover shadow-panel",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-border-soft bg-muted px-3 py-2 text-[11.5px] text-muted-foreground",children:[i.jsxs("span",{children:[i.jsx("span",{className:"font-medium text-foreground",children:c}),p&&i.jsx("span",{className:"ml-1.5 font-mono text-muted-foreground",children:p})]}),i.jsx("span",{className:"font-mono text-[10.5px] tabular-nums",children:s?"…":`${n.length}${o?"+":""}`})]}),i.jsx("div",{ref:u,className:"max-h-64 overflow-y-auto py-1",children:n.map((h,d)=>{const w=d===r;return i.jsxs("button",{type:"button","data-idx":d,onMouseDown:b=>{b.preventDefault(),l(h)},onMouseEnter:()=>a(d),className:T("flex w-full flex-col gap-0.5 px-3 py-1.5 text-left text-[12.5px] transition-colors",w?"bg-brand-ghost text-foreground":"hover:bg-accent/60"),children:[i.jsx("span",{className:"truncate font-mono text-foreground",children:h.label}),h.description&&i.jsx("span",{className:T("truncate text-[11px]",w?"text-brand-strong":"text-muted-foreground"),children:h.description})]},h.key)})}),i.jsxs("div",{className:"flex items-center gap-2 border-t border-border-soft bg-muted px-3 py-1.5 text-[11px] text-muted-foreground",children:[i.jsx(St,{children:"↑↓"}),"nav",i.jsx(St,{children:"⏎"}),"insert",i.jsx(St,{children:"Esc"}),"dismiss"]})]})}function fm({title:e,tagline:t,hint:n,suggestions:r,onPickSuggestion:s}){return i.jsxs("div",{className:"relative z-10 flex max-w-[480px] flex-col items-center px-8 text-center v2-hero-in",children:[i.jsx("div",{className:"relative",children:i.jsx("span",{"aria-hidden":!0,className:"block font-serif italic leading-none text-brand",style:{fontSize:52},children:"π"})}),i.jsx("h2",{className:"mt-5 font-serif text-[34px] italic font-normal leading-[1.1] tracking-[-0.01em] text-foreground",children:e}),i.jsx("p",{className:"mt-2 text-[14.5px] leading-[1.6] tracking-[-0.005em] text-muted-foreground",children:t}),n&&i.jsxs("div",{className:"mt-6 inline-flex items-center gap-2 rounded-[10px] border border-border bg-card/80 backdrop-blur-sm px-3.5 py-2 text-[12.5px] text-muted-foreground shadow-sm",children:[n.keys.map(o=>i.jsx(St,{children:o},o)),i.jsx("span",{children:n.label})]}),r&&r.length>0&&s&&i.jsx("div",{className:"mt-7 flex w-full flex-col border-b border-border-soft",children:r.map((o,l)=>i.jsxs("button",{type:"button",onClick:()=>s(o.prompt),style:{animationDelay:`${.12+l*.06}s`},className:T("group/sugg v2-rise-soft flex items-center gap-2.5 border-t border-border-soft px-1.5 py-3 text-left","transition-colors duration-200 hover:bg-accent/30 active:bg-accent/40 ring-brand-focus"),children:[i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[13px] font-medium text-foreground",children:o.label}),i.jsx("span",{className:"mt-0.5 block truncate text-[12px] text-muted-foreground",children:o.prompt})]}),i.jsx("span",{className:"shrink-0 text-[14px] text-muted-foreground transition-colors group-hover/sugg:text-brand",children:"↵"})]},o.label))})]})}const gr=fs(e=>({toasts:[],errSeen:0,warnSeen:0,pushToast:t=>e(n=>({toasts:[...n.toasts,t],errSeen:n.errSeen+(t.notifyType==="error"?1:0),warnSeen:n.warnSeen+(t.notifyType==="warning"?1:0)})),dismissToast:t=>e(n=>({toasts:n.toasts.filter(r=>r.id!==t)})),resetCounters:()=>e({errSeen:0,warnSeen:0})})),pm=1500,hm="github-light-high-contrast",mm="github-dark-high-contrast",gm={typescript:()=>F(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>F(()=>import("./tsx-COt5Ahok.js"),[]),javascript:()=>F(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>F(()=>import("./jsx-g9-lgVsj.js"),[]),json:()=>F(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>F(()=>import("./jsonc-Des-eS-w.js"),[]),yaml:()=>F(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>F(()=>import("./toml-vGWfd6FD.js"),[]),markdown:()=>F(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>F(()=>import("./mdx-Cmh6b_Ma.js"),[]),html:()=>F(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2])),css:()=>F(()=>import("./css-CLj8gQPS.js"),[]),scss:()=>F(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([3,2])),less:()=>F(()=>import("./less-B1dDrJ26.js"),[]),python:()=>F(()=>import("./python-B6aJPvgy.js"),[]),ruby:()=>F(()=>import("./ruby-CV7NnX5q.js"),__vite__mapDeps([4,0,1,2,5,6,7,8,9,10,11,12,13,14,15,16])),go:()=>F(()=>import("./go-C27-OAKa.js"),[]),rust:()=>F(()=>import("./rust-B1yitclQ.js"),[]),java:()=>F(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>F(()=>import("./kotlin-BdnUsdx6.js"),[]),swift:()=>F(()=>import("./swift-D82vCrfD.js"),[]),csharp:()=>F(()=>import("./csharp-DSvCPggb.js"),[]),c:()=>F(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>F(()=>import("./cpp-DIPi6g--.js"),__vite__mapDeps([12,13,7])),"objective-c":()=>F(()=>import("./objective-c-DXmwc3jG.js"),[]),php:()=>F(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([17,0,1,2,5,6,7,18])),shellscript:()=>F(()=>import("./shellscript-Yzrsuije.js"),[]),sql:()=>F(()=>import("./sql-CRqJ_cUM.js"),[]),dockerfile:()=>F(()=>import("./dockerfile-BcOcwvcX.js"),[]),xml:()=>F(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([5,6])),vue:()=>F(()=>import("./vue-DMJtu8ND.js"),__vite__mapDeps([19,2,1,9,18,0])),svelte:()=>F(()=>import("./svelte-DR4MIrkg.js"),__vite__mapDeps([20,1,9,2])),graphql:()=>F(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([8,1,9,10,11])),diff:()=>F(()=>import("./diff-D97Zzqfu.js"),[]),ini:()=>F(()=>import("./ini-BEwlwnbL.js"),[]),make:()=>F(()=>import("./make-CHLpvVh8.js"),[]),lua:()=>F(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([15,13])),r:()=>F(()=>import("./r-Dspwwk_N.js"),[]),scala:()=>F(()=>import("./scala-C151Ov-r.js"),[]),dart:()=>F(()=>import("./dart-bE4Kk8sk.js"),[]),elixir:()=>F(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([21,0,1,2])),haskell:()=>F(()=>import("./haskell-Df6bDoY_.js"),[])},zv={ts:"typescript",js:"javascript",py:"python",rb:"ruby",rs:"rust",kt:"kotlin","c++":"cpp",cs:"csharp",objc:"objective-c",sh:"shellscript",shell:"shellscript",bash:"shellscript",zsh:"shellscript",fish:"shellscript",yml:"yaml",md:"markdown",makefile:"make",gnumakefile:"make",mk:"make",docker:"dockerfile","docker-compose":"yaml"};function xc(e){if(!e)return null;const t=e.toLowerCase().trim();return t?t in gm?t:zv[t]??null:null}let Ql=null,pu=null;const Qi=new Set,Hl=new Map;async function xm(){return Ql||(Ql=(async()=>{const[e,t]=await Promise.all([F(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),F(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[])]),n=await Bm({themes:[e.default,t.default],langs:[],engine:Qm()});return pu=n,n})()),Ql}async function ym(e){if(Qi.has(e))return;const t=Hl.get(e);if(t)return t;const n=gm[e];if(!n)return;const r=(async()=>{try{const s=await xm(),o=await n();await s.loadLanguage(o),Qi.add(e)}finally{Hl.delete(e)}})();return Hl.set(e,r),r}async function Uv(e,t,n){const r=xc(t);if(!r||e.length===0)return null;let s=0;for(let l=0;l<e.length;l++)e.charCodeAt(l)===10&&s++;return s+1>pm?null:(await ym(r),(await xm()).codeToHtml(e,{lang:r,themes:{light:hm,dark:mm},defaultColor:!1,transformers:n==null?void 0:n.transformers}))}async function Hb(e){const t=xc(e);return t?(await ym(t),Qi.has(t)):!1}function Vb(e,t){const n=xc(t);if(!n||e.length===0||!pu||!Qi.has(n))return null;let r=0;for(let s=0;s<e.length;s++)e.charCodeAt(s)===10&&r++;return r+1>pm?null:pu.codeToHtml(e,{lang:n,themes:{light:hm,dark:mm},defaultColor:!1})}function fl({code:e,lang:t,wrap:n=!1,tone:r="default",transformers:s,className:o,defer:l=!1,diffRoles:a}){const[u,c]=y.useState(null),p=y.useMemo(()=>a?[$v(a),...s??[]]:s,[a,s]);y.useEffect(()=>{let b=!1;if(c(null),!l)return Uv(e,t,{transformers:p}).then(g=>{b||c(g)}).catch(g=>{}),()=>{b=!0}},[e,t,p,l]);const h=n?"whitespace-pre-wrap break-words":"whitespace-pre",d=r==="muted"?"text-muted-foreground":"text-foreground",w="font-mono text-[12px] leading-relaxed";if(u===null){if(a){const b=e.length===0?[""]:e.split(`
|
|
206
|
+
`);return i.jsx("pre",{className:T("diff-unified overflow-auto",w,h,d,o),children:b.map((g,j)=>{const f=a[j]??"context",m=f==="add"?"+":f==="del"?"−":" ";return i.jsxs("div",{className:T("flex",vm(f)),children:[i.jsx("span",{className:"diff-marker-cell",children:m}),i.jsx("span",{className:"flex-1 pr-2",children:g||" "})]},j)})})}return i.jsx("pre",{className:T("overflow-auto",w,h,d,o),children:e})}return i.jsx("div",{className:T("shiki-mount overflow-auto",w,n&&"shiki-wrap",d,a&&"diff-unified",o),dangerouslySetInnerHTML:{__html:u}})}function vm(e){return e==="add"?"diff-line-add":e==="del"?"diff-line-del":void 0}function $v(e){return{name:"pi-pilot-unified-diff",line(t,n){const r=e[n-1]??"context",s=r==="add"?"+":r==="del"?"−":" ";t.children.unshift({type:"element",tagName:"span",properties:{class:"diff-marker-cell"},children:[{type:"text",value:s}]});const o=vm(r);if(o){const l=t.properties??(t.properties={}),a=typeof l.class=="string"?l.class:Array.isArray(l.class)?l.class.join(" "):"";l.class=a?`${a} ${o}`:o}}}}const wm="pi-pilot-theme",$r=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):void 0;function Vl(e){return e!=="system"?e:$r!=null&&$r.matches?"dark":"light"}function qv(){try{const e=localStorage.getItem(wm);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function Wl(e){const t=document.documentElement.classList;e==="dark"?t.add("dark"):t.remove("dark");const n=document.querySelector('meta[name="theme-color"]');n&&n.setAttribute("content",e==="dark"?"#0C0E12":"#F4EFE5")}const bm=fs((e,t)=>{const n=qv(),r=Vl(n);Wl(r);const s=()=>{const{choice:o}=t();if(o!=="system")return;const l=Vl("system");Wl(l),e({resolved:l})};return $r==null||$r.addEventListener("change",s),{choice:n,resolved:r,setTheme:o=>{const l=Vl(o);Wl(l);try{localStorage.setItem(wm,o)}catch{}e({choice:o,resolved:l})}}});bm.getState();const sf=80,Bv=600;function Qv({code:e,lang:t,className:n}){const r=y.useRef(null),[s,o]=y.useState(sf),l=bm(a=>a.resolved);return y.useEffect(()=>{const a=u=>{var p;if(u.source!==((p=r.current)==null?void 0:p.contentWindow))return;const c=u.data;!c||c.type!=="pi-preview-height"||typeof c.height=="number"&&o(Math.max(sf,Math.min(Bv,Math.ceil(c.height))))};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),i.jsx("iframe",{ref:r,title:`${t??"html"} preview`,sandbox:"allow-scripts",srcDoc:Hv(e,l),className:T("block w-full border-0 bg-transparent",n),style:{height:s}})}function Hv(e,t){return`<!doctype html>
|
|
207
|
+
<html>
|
|
208
|
+
<head>
|
|
209
|
+
<meta charset="utf-8">
|
|
210
|
+
<meta http-equiv="Content-Security-Policy" content="${["default-src 'none'","img-src data: blob:","media-src data: blob:","style-src 'unsafe-inline'","font-src data:","script-src 'unsafe-inline'","connect-src 'none'","form-action 'none'","base-uri 'none'","frame-src 'none'"].join("; ")}">
|
|
211
|
+
<meta name="color-scheme" content="${t}">
|
|
212
|
+
<style>
|
|
213
|
+
html { color-scheme: ${t}; }
|
|
214
|
+
html, body { margin: 0; padding: 0; background: Canvas; color: CanvasText; }
|
|
215
|
+
body { font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; }
|
|
216
|
+
</style>
|
|
217
|
+
</head>
|
|
218
|
+
<body>
|
|
219
|
+
${e}
|
|
220
|
+
<script>
|
|
221
|
+
(function () {
|
|
222
|
+
// Measure <body>, not <html>: documentElement.scrollHeight is floored at
|
|
223
|
+
// the iframe's own viewport height, which feeds back on itself and never
|
|
224
|
+
// shrinks. body sizes to its content.
|
|
225
|
+
function report() {
|
|
226
|
+
var body = document.body;
|
|
227
|
+
if (!body) return;
|
|
228
|
+
var h = Math.max(body.scrollHeight, Math.ceil(body.getBoundingClientRect().height));
|
|
229
|
+
parent.postMessage({ type: "pi-preview-height", height: h }, "*");
|
|
230
|
+
}
|
|
231
|
+
window.addEventListener("load", report);
|
|
232
|
+
if (window.ResizeObserver) {
|
|
233
|
+
try {
|
|
234
|
+
new ResizeObserver(report).observe(document.body);
|
|
235
|
+
} catch (e) {}
|
|
236
|
+
}
|
|
237
|
+
report();
|
|
238
|
+
})();
|
|
239
|
+
<\/script>
|
|
240
|
+
</body>
|
|
241
|
+
</html>`}const km=y.createContext(!1);function fo({text:e,streaming:t,className:n}){return i.jsxs("div",{className:T("font-sans text-[14px] leading-[1.5] tracking-[-0.005em] text-foreground","[&>p:last-child]:inline","[overflow-wrap:anywhere]",n),children:[i.jsx(km.Provider,{value:t??!1,children:i.jsx($m,{remarkPlugins:[qm],components:Vv,children:e})}),t&&i.jsx("span",{className:"ml-1 inline-block h-[15px] w-[2.5px] translate-y-[2px] rounded-full bg-brand align-baseline animate-v2-caret","aria-hidden":!0})]})}const Vv={h1:({children:e})=>i.jsx("h1",{className:"mb-2.5 mt-6 text-[21px] font-semibold tracking-[-0.02em] text-foreground first:mt-0",children:e}),h2:({children:e})=>i.jsx("h2",{className:"mb-2 mt-5 text-[17px] font-semibold tracking-[-0.015em] text-foreground first:mt-0",children:e}),h3:({children:e})=>i.jsx("h3",{className:"mb-1.5 mt-4 text-[15px] font-semibold tracking-[-0.01em] text-foreground first:mt-0",children:e}),h4:({children:e})=>i.jsx("h4",{className:"mb-1.5 mt-3.5 text-[14px] font-semibold tracking-[-0.005em] text-foreground first:mt-0",children:e}),h5:({children:e})=>i.jsx("h5",{className:"mb-1 mt-3 text-[13px] font-medium text-foreground first:mt-0",children:e}),h6:({children:e})=>i.jsx("h6",{className:"mb-1 mt-3 text-[12.5px] font-medium uppercase tracking-[0.04em] text-muted-foreground first:mt-0",children:e}),strong:({children:e})=>i.jsx("strong",{className:"font-medium text-foreground",children:e}),em:({children:e})=>i.jsx("em",{className:"italic text-foreground",children:e}),p:({children:e})=>i.jsx("p",{className:"my-2 first:mt-0 last:mb-0",children:e}),a:({href:e,children:t})=>i.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-brand underline underline-offset-2 transition-colors hover:text-brand-strong",children:t}),hr:()=>i.jsx("hr",{className:"my-3 border-t border-border-soft"}),ul:({children:e})=>i.jsx("ul",{className:"my-2 flex list-none flex-col gap-[3px] pl-5",children:e}),ol:({children:e,start:t})=>i.jsx("ol",{className:"my-2 flex list-decimal flex-col gap-[3px] pl-6 marker:font-mono marker:text-[12px] marker:text-muted-foreground [&>li::before]:!content-none",start:t??void 0,children:e}),li:({children:e,...t})=>{const n=typeof t.className=="string"&&t.className.includes("task-list-item");return i.jsx("li",{className:T("relative",!n&&"pl-3 before:absolute before:left-0 before:top-0 before:text-muted-foreground before:content-['·']"),children:e})},blockquote:({children:e})=>i.jsx("blockquote",{className:"my-2 border-l-2 border-brand-subtle pl-3 text-muted-foreground",children:e}),table:({children:e})=>i.jsx("div",{className:"my-3 overflow-x-auto rounded-md border border-border-soft",children:i.jsx("table",{className:"w-full border-collapse text-[12.5px]",children:e})}),thead:({children:e})=>i.jsx("thead",{className:"border-b border-border-soft bg-muted",children:e}),tbody:({children:e})=>i.jsx("tbody",{children:e}),tr:({children:e})=>i.jsx("tr",{className:"border-b border-border-soft/60 last:border-b-0",children:e}),th:({children:e,style:t})=>i.jsx("th",{style:t,className:"px-2.5 py-2 text-left text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground",children:e}),td:({children:e,style:t})=>i.jsx("td",{style:t,className:"px-2.5 py-1.5 align-top text-foreground",children:e}),img:({src:e,alt:t})=>i.jsx("img",{src:e,alt:t,className:"my-2 max-w-full rounded-md border border-border-soft"}),pre:({node:e,children:t})=>{const n=Wv(e);return n?i.jsx(Yv,{code:n.code,lang:n.lang}):i.jsx("pre",{className:"my-3 overflow-x-auto rounded-md border border-border-soft bg-muted px-3 py-2.5 font-mono text-[12px] leading-relaxed text-foreground",children:t})},code:({className:e,children:t,...n})=>typeof e=="string"&&/\blanguage-/.test(e)?i.jsx("code",{className:e,...n,children:t}):i.jsx("code",{className:"rounded-[5px] border border-border-soft bg-muted px-1.5 py-px font-mono text-[12px] text-foreground",...n,children:t})};function Wv(e){var l;if(!e||!Array.isArray(e.children))return null;const t=e.children.find(a=>a.type==="element"&&a.tagName==="code");if(!t)return null;const n=(l=t.properties)==null?void 0:l.className,r=Array.isArray(n)?n.find(a=>typeof a=="string"&&a.startsWith("language-")):void 0,s=r?r.slice(9):void 0;let o="";for(const a of t.children||[])a.type==="text"&&typeof a.value=="string"&&(o+=a.value);return o.endsWith(`
|
|
242
|
+
`)&&(o=o.slice(0,-1)),{code:o,lang:s}}const Kv=new Set(["html","svg"]),Gv="code";function Yv({code:e,lang:t}){const n=gr(w=>w.pushToast),[r,s]=y.useState(!1),[o,l]=y.useState(Gv),a=y.useContext(km),c=!!t&&Kv.has(t.toLowerCase())&&!a,p=c&&o==="preview",h=async()=>{if(e)try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1200)}catch{n({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}},d=t&&t.trim()?t.trim().toLowerCase():"text";return i.jsxs("div",{className:"group/code relative my-3 overflow-hidden rounded-lg border border-border bg-card shadow-glow",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border-soft bg-muted/30 py-1 pl-3.5 pr-1.5",children:[i.jsx("span",{className:"select-none font-mono text-[11px] leading-none tracking-[0.02em] text-muted-foreground",children:d}),i.jsxs("div",{className:"flex items-center gap-1",children:[c&&i.jsxs("div",{className:"flex items-center gap-0.5 rounded-md border border-border-soft bg-card p-0.5 text-[11px] font-medium",children:[i.jsxs("button",{type:"button",onClick:()=>l("code"),"aria-pressed":o==="code",className:T("flex items-center gap-1 rounded-[5px] px-1.5 py-0.5 transition-colors",o==="code"?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground"),children:[i.jsx(i0,{className:"h-3 w-3"}),"Code"]}),i.jsxs("button",{type:"button",onClick:()=>l("preview"),"aria-pressed":o==="preview",className:T("flex items-center gap-1 rounded-[5px] px-1.5 py-0.5 transition-colors",o==="preview"?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground"),children:[i.jsx(u0,{className:"h-3 w-3"}),"Preview"]})]}),i.jsx("button",{type:"button",onClick:h,title:"Copy code","aria-label":"Copy code",className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium leading-none text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:r?i.jsxs(i.Fragment,{children:[i.jsx(_o,{className:"h-3 w-3 text-signal-ok"}),"Copied"]}):i.jsxs(i.Fragment,{children:[i.jsx(pc,{className:"h-3 w-3"}),"Copy"]})})]})]}),p?i.jsx(Qv,{code:e,lang:t}):i.jsx(fl,{code:e,lang:t,className:"px-3.5 py-3",defer:a})]})}function Xv(e){if(!e||typeof e!="object")return null;const t=e;if(t.kind==="option"){const n=Array.isArray(t.indices)?t.indices.filter(l=>typeof l=="number"):void 0,r=Array.isArray(t.labels)?t.labels.filter(l=>typeof l=="string"):void 0,s=n&&n.length>0,o=r&&r.length>0;return!s&&!o?null:{kind:"option",indices:n,labels:r}}return t.kind==="other"&&typeof t.text=="string"?{kind:"other",text:t.text}:t.kind==="skip"?{kind:"skip"}:t.kind==="timeout"?{kind:"timeout"}:null}function Jv(e){if(e.startsWith("User selected:")){const t=[],n=/"([^"]+)"/g;let r;for(;(r=n.exec(e))!==null;)t.push(r[1]);return t.length>0?{kind:"option",labels:t}:{kind:"unknown"}}if(e.startsWith("User answered (freeform):")){const t=e.match(/"([\s\S]*)"\s*$/);return{kind:"other",text:t?t[1]:""}}return e.startsWith("User chose to skip")?{kind:"skip"}:e.startsWith("No answer within")?{kind:"timeout"}:{kind:"unknown"}}function Zv(e){if(!e)return null;const t=typeof e.question=="string"?e.question:null;if(!t)return null;const n=Array.isArray(e.options)?e.options:[],r=[];for(const s of n){if(!s||typeof s!="object")continue;const o=s;typeof o.label=="string"&&r.push({label:o.label,description:typeof o.description=="string"?o.description:void 0})}return r.length<2?null:{question:t,header:typeof e.header=="string"?e.header:void 0,options:r,multiSelect:e.multiSelect===!0,allowOther:e.allowOther!==!1}}function e1({item:e,onSubmit:t}){const n=y.useMemo(()=>Zv(e.args),[e.args]);return n?e.status==="error"?i.jsxs(Hi,{children:[i.jsx(Vi,{header:n.header,statusPill:i.jsx(he,{tone:"warn",children:"aborted"})}),i.jsx(yc,{text:n.question}),i.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12px] text-muted-foreground",children:"Question dismissed before an answer was recorded."})]}):e.status==="ok"?i.jsx(s1,{parsed:n,details:e.details,resultText:e.text}):i.jsx(t1,{parsed:n,onSubmit:t}):i.jsxs(Hi,{children:[i.jsx(Vi,{header:void 0}),i.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12.5px] text-muted-foreground",children:e.text||"ask_user: malformed arguments"})]})}function t1({parsed:e,onSubmit:t}){const[n,r]=y.useState(new Set),[s,o]=y.useState(!1),[l,a]=y.useState(""),[u,c]=y.useState(!1);y.useEffect(()=>{if(!u)return;const g=setTimeout(()=>c(!1),12e3);return()=>clearTimeout(g)},[u]);const p=g=>{r(j=>{if(e.multiSelect){const f=new Set(j);return f.has(g)?f.delete(g):f.add(g),f.size>0&&o(!1),f}return o(!1),new Set([g])})},h=()=>{o(g=>{const j=!g;return j&&r(new Set),j})},d=s?l.trim().length>0:n.size>0,w=()=>{!d||u||(c(!0),t(s?{kind:"other",text:l.trim()}:{kind:"option",indices:[...n].sort((g,j)=>g-j)}))},b=()=>{u||(c(!0),t({kind:"skip"}))};return i.jsxs(Hi,{children:[i.jsx(Vi,{header:e.header,statusPill:u?i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground",children:[i.jsx(mr,{className:"h-3 w-3 text-brand animate-v2-spin"}),"sending"]}):i.jsx(he,{tone:"brand",children:"awaiting"})}),i.jsx(yc,{text:e.question}),i.jsxs("ul",{className:"flex flex-col gap-1.5 border-t border-border-soft bg-background px-3 py-2",children:[e.options.map((g,j)=>i.jsx("li",{children:i.jsx(n1,{option:g,checked:n.has(j),disabled:u,multi:e.multiSelect,onToggle:()=>p(j)})},j)),e.allowOther&&i.jsx("li",{children:i.jsx(r1,{checked:s,value:l,disabled:u,onToggle:h,onChange:a,onEnter:w})})]}),i.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border-soft bg-muted/50 px-3 py-2",children:[i.jsx("button",{type:"button",onClick:b,disabled:u,className:"rounded-md px-3 py-1 text-[12px] text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground disabled:opacity-50 ring-brand-focus",children:"Skip"}),i.jsx("button",{type:"button",onClick:w,disabled:!d||u,className:T("rounded-md px-3 py-1 text-[12px] font-medium transition-colors ring-brand-focus",d&&!u?"bg-brand text-brand-foreground hover:bg-brand/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:"Submit"})]})]})}function n1({option:e,checked:t,disabled:n,multi:r,onToggle:s}){return i.jsxs("button",{type:"button",onClick:s,disabled:n,className:T("flex w-full items-start gap-2.5 rounded-md border px-2.5 py-1.5 text-left transition-colors ring-brand-focus",t?"border-brand bg-brand-ghost":"border-border-soft bg-card hover:border-border hover:bg-accent/40",n&&"cursor-not-allowed opacity-60"),children:[i.jsx("span",{className:T("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center border",r?"rounded-[3px]":"rounded-full",t?"border-brand bg-brand":"border-muted-foreground/40 bg-background"),"aria-hidden":!0,children:t&&i.jsx("span",{className:T("block bg-brand-foreground",r?"h-2 w-2 rounded-[1px]":"h-1.5 w-1.5 rounded-full")})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:T("block text-[12.5px] leading-[1.4]",t?"font-medium text-foreground":"text-foreground"),children:e.label}),e.description&&i.jsx("span",{className:"mt-0.5 block text-[11.5px] leading-[1.45] text-muted-foreground",children:e.description})]})]})}function r1({checked:e,value:t,disabled:n,onToggle:r,onChange:s,onEnter:o}){return i.jsxs("div",{className:T("flex items-start gap-2.5 rounded-md border px-2.5 py-1.5",e?"border-brand bg-brand-ghost":"border-border-soft bg-card",n&&"cursor-not-allowed opacity-60"),children:[i.jsx("button",{type:"button",onClick:r,disabled:n,"aria-pressed":e,"aria-label":"Other",className:T("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border ring-brand-focus transition-colors",e?"border-brand bg-brand":"border-muted-foreground/40 bg-background"),children:e&&i.jsx("span",{className:"block h-1.5 w-1.5 rounded-full bg-brand-foreground"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[12.5px] leading-[1.4] text-foreground",children:"Other"}),i.jsx("input",{type:"text",value:t,placeholder:"Type your answer",disabled:n||!e,onChange:l=>s(l.target.value),onFocus:()=>{e||r()},onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o())},className:T("mt-1 block w-full rounded-md border border-border-soft bg-background px-2 py-1 text-[12px] text-foreground placeholder:text-muted-foreground/60 ring-brand-focus disabled:opacity-50")})]})]})}function s1({parsed:e,details:t,resultText:n}){const r=y.useMemo(()=>Xv(t)??Jv(n),[t,n]),s=y.useMemo(()=>{if(r.kind!=="option")return new Set;if(r.indices)return new Set(r.indices);const l=new Set;return e.options.forEach((a,u)=>{var c;(c=r.labels)!=null&&c.includes(a.label)&&l.add(u)}),l},[r,e.options]),o=r.kind==="skip"?i.jsx(he,{tone:"warn",children:"skipped"}):r.kind==="timeout"?i.jsx(he,{tone:"warn",children:"timed out"}):i.jsx(he,{tone:"ok",children:"answered"});return i.jsxs(Hi,{children:[i.jsx(Vi,{header:e.header,statusPill:o}),i.jsx(yc,{text:e.question}),i.jsxs("ul",{className:"flex flex-col gap-1.5 border-t border-border-soft bg-background px-3 py-2",children:[e.options.map((l,a)=>{const u=s.has(a);return i.jsxs("li",{className:T("flex items-start gap-2.5 rounded-md border px-2.5 py-1.5",u?"border-brand bg-brand-ghost":"border-border-soft bg-card opacity-60"),children:[i.jsx("span",{className:T("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center border",e.multiSelect?"rounded-[3px]":"rounded-full",u?"border-brand bg-brand":"border-muted-foreground/30 bg-background"),"aria-hidden":!0,children:u&&i.jsx("span",{className:T("block bg-brand-foreground",e.multiSelect?"h-2 w-2 rounded-[1px]":"h-1.5 w-1.5 rounded-full")})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:T("block text-[12.5px] leading-[1.4]",u?"font-medium text-foreground":"text-muted-foreground"),children:l.label}),l.description&&i.jsx("span",{className:"mt-0.5 block text-[11.5px] leading-[1.45] text-muted-foreground/80",children:l.description})]})]},a)}),r.kind==="other"&&i.jsxs("li",{className:T("flex items-start gap-2.5 rounded-md border border-brand bg-brand-ghost px-2.5 py-1.5"),children:[i.jsx("span",{className:"mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-brand bg-brand","aria-hidden":!0,children:i.jsx("span",{className:"block h-1.5 w-1.5 rounded-full bg-brand-foreground"})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[12.5px] font-medium leading-[1.4] text-foreground",children:"Other"}),i.jsx("span",{className:"mt-0.5 block text-[12px] leading-[1.45] text-muted-foreground [overflow-wrap:anywhere]",children:r.text||"(empty)"})]})]})]}),(r.kind==="skip"||r.kind==="timeout"||r.kind==="unknown")&&i.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12px] text-muted-foreground",children:n})]})}function Hi({children:e}){return i.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function Vi({header:e,statusPill:t}){return i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[i.jsx(ln,{tool:"ask_user",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Ask user"}),e&&i.jsx(he,{tone:"ghost",className:"shrink-0 max-w-[120px] truncate",children:e}),i.jsx("span",{className:"min-w-0 flex-1"}),t]})}function yc({text:e}){return i.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[13px] leading-[1.5] text-foreground",children:e})}const pl="create_artifact",o1=new Set(["html","svg","markdown","code"]);function i1(e){return e.kind==="tool"&&e.toolName===pl}function jm(e){const t=e.args;if(!t||typeof t!="object")return null;const n=t,{type:r,title:s,content:o}=n;if(typeof r!="string"||!o1.has(r)||typeof s!="string"||!s.trim()||typeof o!="string")return null;const l=typeof n.id=="string"&&n.id.trim()?n.id.trim():e.toolCallId,a=typeof n.language=="string"?n.language:void 0;return{toolCallId:e.toolCallId,id:l,type:r,title:s,content:o,...a?{language:a}:{}}}function Wb(e){const t=[];for(const n of e){if(!i1(n))continue;const r=jm(n);r&&t.push(r)}return t}function Kb(e){return e.length?e[e.length-1]:null}function Gb(e,t){if(!t)return null;for(let n=e.length-1;n>=0;n--)if(e[n].toolCallId===t)return e[n];return null}function l1(e,t){return e.filter(n=>n.id===t)}function Yb(e,t){const n=l1(e,t.id),r=n.findIndex(s=>s.toolCallId===t.toolCallId);return{index:r>=0?r+1:n.length,count:n.length}}function Xb(e){const t=[],n=new Map;for(const r of e)n.has(r.id)||t.push(r.id),n.set(r.id,r);return t.map(r=>n.get(r))}const po=fs(e=>({panels:[],togglePanel:t=>e(n=>({panels:n.panels.includes(t)?n.panels.filter(r=>r!==t):[...n.panels,t]})),openPanel:t=>e(n=>n.panels.includes(t)?n:{panels:[...n.panels,t]}),closePanel:t=>e(n=>n.panels.includes(t)?{panels:n.panels.filter(r=>r!==t)}:n)})),hu=fs(e=>({selectedToolCallId:null,open:t=>{e({selectedToolCallId:t}),po.getState().openPanel("artifact")},select:t=>e({selectedToolCallId:t}),clear:()=>e({selectedToolCallId:null})})),a1=25e4;function u1(e,t){if(e===t)return Kl(e).map(h=>({role:"context",text:h}));const n=Kl(e),r=Kl(t);let s=0;const o=Math.min(n.length,r.length);for(;s<o&&n[s]===r[s];)s++;let l=n.length,a=r.length;for(;l>s&&a>s&&n[l-1]===r[a-1];)l--,a--;const u=[];for(let h=0;h<s;h++)u.push({role:"context",text:n[h]});const c=n.slice(s,l),p=r.slice(s,a);if(c.length*p.length>a1){for(const h of c)u.push({role:"del",text:h});for(const h of p)u.push({role:"add",text:h})}else u.push(...f1(c,p));for(let h=l;h<n.length;h++)u.push({role:"context",text:n[h]});return u}function c1(e){return{code:e.map(t=>t.text).join(`
|
|
243
|
+
`),roles:e.map(t=>t.role)}}function d1(e){let t=0,n=0;for(const r of e)r.role==="add"?t++:r.role==="del"&&n++;return{adds:t,dels:n}}function Kl(e){return e===""?[]:e.split(`
|
|
244
|
+
`)}function f1(e,t){const n=e.length,r=t.length;if(n===0)return t.map(u=>({role:"add",text:u}));if(r===0)return e.map(u=>({role:"del",text:u}));const s=Array.from({length:n+1},()=>new Array(r+1).fill(0));for(let u=n-1;u>=0;u--)for(let c=r-1;c>=0;c--)s[u][c]=e[u]===t[c]?s[u+1][c+1]+1:Math.max(s[u+1][c],s[u][c+1]);const o=[];let l=0,a=0;for(;l<n&&a<r;)e[l]===t[a]?(o.push({role:"context",text:e[l]}),l++,a++):s[l+1][a]>=s[l][a+1]?(o.push({role:"del",text:e[l]}),l++):(o.push({role:"add",text:t[a]}),a++);for(;l<n;)o.push({role:"del",text:e[l++]});for(;a<r;)o.push({role:"add",text:t[a++]});return o}function ho({children:e}){return i.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function mo({children:e,tone:t="muted-foreground"}){return i.jsx("pre",{className:T(`${dl} overflow-auto whitespace-pre-wrap break-words border-t border-border-soft bg-background px-3 py-2 font-mono text-[12px] leading-relaxed`,t==="foreground"?"text-foreground":"text-muted-foreground"),children:e})}function Qn({hasBody:e,header:t,body:n}){const[r,s]=y.useState(!1),o=y.useId();return e?i.jsxs(ho,{children:[i.jsx("div",{role:"button",tabIndex:0,"aria-label":"Toggle details","aria-expanded":r,"aria-controls":o,onClick:()=>s(l=>!l),onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s(a=>!a))},className:"w-full cursor-pointer text-left ring-brand-focus transition-colors hover:bg-accent/30",children:t}),r&&n&&i.jsx("div",{id:o,children:n})]}):i.jsx(ho,{children:t})}function vc({name:e,verb:t,path:n,status:r,suffix:s,stats:o}){return i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:e,className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:t}),n?i.jsx(Sm,{path:n}):i.jsx("span",{className:"flex-1 text-muted-foreground",children:"…"}),s&&i.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:s}),o&&(o.adds>0||o.dels>0)&&i.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums",children:[o.adds>0&&i.jsxs("span",{className:"text-signal-ok",children:["+",o.adds]}),o.adds>0&&o.dels>0&&" ",o.dels>0&&i.jsxs("span",{className:"text-signal-error",children:["−",o.dels]})]}),i.jsx(wc,{status:r})]})}function wc({status:e}){const t="shrink-0 text-[10px] font-medium uppercase tracking-[0.04em]";return e==="ok"?i.jsx("span",{className:T(t,"text-muted-foreground/70"),children:"Done"}):e==="error"?i.jsx("span",{className:T(t,"text-signal-error"),children:"Error"}):i.jsx("span",{className:T(t,"text-brand"),children:"Running"})}function Sm({path:e}){const t=gr(l=>l.pushToast),[n,r]=y.useState(!1),s=hi(e),o=async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1200),t({id:`copy-${Date.now()}`,workspaceId:"",message:`Copied: ${s}`,notifyType:"info"})}catch{t({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}};return i.jsxs("button",{type:"button",onClick:o,title:`${e} — click to copy`,className:"group inline-flex min-w-0 flex-1 items-center gap-1 truncate text-left font-mono text-[11.5px] tracking-[-0.005em] text-muted-foreground transition-colors hover:text-foreground",children:[i.jsx("span",{className:"truncate",children:s}),n?i.jsx(_o,{className:"h-3 w-3 shrink-0 text-signal-ok"}):i.jsx(pc,{className:"h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60"})]})}function p1({index:e,rows:t,multi:n,lang:r}){const{code:s,roles:o}=y.useMemo(()=>c1(t),[t]);return t.length===0?null:i.jsxs("div",{className:"overflow-hidden rounded-md border border-border-soft bg-card",children:[n&&i.jsxs("div",{className:"border-b border-border-soft bg-muted px-2.5 py-1 text-[11px] text-muted-foreground",children:["Edit ",e+1]}),i.jsx(fl,{code:s,lang:r,diffRoles:o})]})}function hi(e){const t="/Users/";if(e.startsWith(t)){const n=e.slice(t.length),r=n.indexOf("/");if(r>0)return"~/"+n.slice(r+1)}if(e.length>60){const n=e.split("/").filter(Boolean);if(n.length>2)return".../"+n.slice(-2).join("/")}return e}function Nm(e){return e&&typeof e=="object"?e:void 0}function ft(e){return typeof e=="string"?e:void 0}function of(e){return typeof e=="number"?e:void 0}function bc(e){return ft(e==null?void 0:e.path)??ft(e==null?void 0:e.file_path)}function h1(e){if(!e)return[];if(Array.isArray(e.edits))return e.edits.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r.oldText??r.old_string,o=r.newText??r.new_string;return typeof s=="string"&&typeof o=="string"?[{oldText:s,newText:o}]:[]});const t=ft(e.old_string)??ft(e.oldText),n=ft(e.new_string)??ft(e.newText);return typeof t=="string"&&typeof n=="string"?[{oldText:t,newText:n}]:[]}function m1(e,t){if(!t)return;if(e==="grep"){const r=ft(t.pattern),s=ft(t.path);if(r)return`/${r}/${s?` in ${hi(s)}`:""}`}if(e==="find"){const r=ft(t.pattern),s=ft(t.path);if(r)return`${r}${s?` in ${hi(s)}`:""}`}if(e==="ls"){const r=ft(t.path);return r?hi(r):"."}const n=Object.keys(t);if(n.length!==0)return`(${n.slice(0,4).join(", ")}${n.length>4?", …":""})`}function g1({item:e}){const t=hu(o=>o.open),n=hu(o=>o.selectedToolCallId),r=jm(e);if(!r)return i.jsx(ho,{children:i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-[12.5px] text-muted-foreground",children:[i.jsx(lu,{className:"h-3.5 w-3.5 shrink-0"}),"Artifact"]})});const s=n===r.toolCallId;return i.jsx(ho,{children:i.jsxs("button",{type:"button",onClick:()=>t(r.toolCallId),className:T("flex w-full items-center gap-2.5 px-3 py-2 text-left ring-brand-focus transition-colors hover:bg-accent/40",s&&"bg-brand-ghost/40"),children:[i.jsx(lu,{className:"h-4 w-4 shrink-0 text-brand"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground",children:r.title}),i.jsx(he,{tone:"ghost",children:r.type}),e.status==="running"?i.jsx(he,{tone:"warn",children:"saving"}):e.status==="error"?i.jsx(he,{tone:"error",children:"error"}):i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-[11.5px] font-medium text-brand",children:["Open",i.jsx(fc,{className:"h-3 w-3"})]})]})})}const x1=new Set(["queued","running","done","failed","timeout","aborted"]);function y1(e){if(!e||typeof e!="object")return;const t=e;if(t.version!==1||!Array.isArray(t.tasks))return;const n=[];for(const r of t.tasks){if(!r||typeof r!="object")continue;const s=r;if(typeof s.agent!="string"||typeof s.task!="string")continue;const o=typeof s.status=="string"&&x1.has(s.status)?s.status:"done";n.push({agent:s.agent,agentSource:s.agentSource==="builtin"||s.agentSource==="user"||s.agentSource==="project"?s.agentSource:void 0,task:s.task,status:o,activity:w1(s.activity),usage:b1(s.usage),model:mn(s.model),stopReason:mn(s.stopReason),errorMessage:mn(s.errorMessage),stderrTail:mn(s.stderrTail),durationMs:Ps(s.durationMs),finalPreview:mn(s.finalPreview),transcriptPath:mn(s.transcriptPath)})}return n}function v1(e){if(!e||typeof e!="object")return{};const t=e;let n;if(Array.isArray(t.tasks)){const r=[];for(const s of t.tasks){if(!s||typeof s!="object")continue;const o=s;typeof o.agent=="string"&&typeof o.task=="string"&&r.push({agent:o.agent,task:o.task})}r.length>0&&(n=r)}return{agent:mn(t.agent),task:mn(t.task),tasks:n}}function w1(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const r=n.label;typeof r=="string"&&r&&t.push(r)}return t}function b1(e){if(!e||typeof e!="object")return;const t=e,n=Ps(t.input),r=Ps(t.output),s=Ps(t.cost),o=Ps(t.turns);if(!(n===void 0&&r===void 0&&o===void 0))return{input:n??0,output:r??0,cost:s??0,turns:o??0}}function mn(e){return typeof e=="string"&&e!==""?e:void 0}function Ps(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Em(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function k1({item:e}){const t=v1(e.args),n=e.status==="running"?"running":e.status==="error"?"failed":"done",r=y1(e.details)??(t.tasks??(t.agent||t.task?[{agent:t.agent??"agent",task:t.task??""}]:[])).map(b=>({agent:b.agent,task:b.task,status:n,activity:[]})),s=S1(r,n),o=s==="running"||s==="queued",l=r.length>1,a=r[0],u=(a==null?void 0:a.task)??"",c=o&&e.text?e.text:l?r.map(b=>b.agent).join(" + "):u.replace(/\s+/g," "),p=N1(r),h=p.turns>0?`${p.turns}t · ${Em(p.tokens)} tok · $${p.cost.toFixed(3)}`:void 0,d=i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:"subagent",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Subagent"}),i.jsx(he,{tone:"ghost",children:l?`${r.length} tasks`:(a==null?void 0:a.agent)??"agent"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:c}),h&&i.jsx("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:h}),i.jsx(Cm,{status:s})]}),w=i.jsx("div",{className:"flex flex-col border-t border-border-soft bg-background",children:r.map((b,g)=>i.jsx(j1,{task:b,index:l?g:void 0,count:r.length},g))});return i.jsx(Qn,{hasBody:r.length>0,header:d,body:w})}function j1({task:e,index:t,count:n}){const r=e.status==="running"||e.status==="queued",s=e.status==="failed"||e.status==="timeout",o=e.usage,l=o&&o.turns>0?`${o.turns}t · ${Em(o.input+o.output)} tok · $${o.cost.toFixed(3)}`:void 0;return i.jsxs("div",{className:t!==void 0&&t>0?"border-t border-border":void 0,children:[t!==void 0&&i.jsxs("div",{className:"flex items-center gap-2 px-3 pb-0.5 pt-2",children:[i.jsxs("span",{className:"font-mono text-[10.5px] text-muted-foreground/70",children:[t+1,"/",n]}),i.jsx(he,{tone:"ghost",children:e.agent}),l&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:l}),i.jsx(Cm,{status:e.status})]}),e.task&&i.jsxs("div",{className:"border-b border-border-soft px-3 py-2",children:[i.jsx(Zo,{children:"Brief"}),i.jsx("div",{className:"max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-muted-foreground",children:e.task})]}),e.activity.length>0&&i.jsxs("div",{className:"border-b border-border-soft px-3 py-2",children:[i.jsxs(Zo,{children:["Activity",r?" (live)":""]}),i.jsx("div",{className:"max-h-40 overflow-auto font-mono text-[12px] leading-relaxed text-muted-foreground",children:e.activity.map((a,u)=>i.jsx("div",{className:"truncate",children:a},u))})]}),e.finalPreview&&i.jsxs("div",{className:"px-3 py-2",children:[i.jsx(Zo,{children:"Report"}),i.jsx(fo,{text:e.finalPreview,className:"text-[13px]"})]}),s&&i.jsxs("div",{className:"border-t border-border-soft px-3 py-2",children:[i.jsx(Zo,{children:"Diagnostics"}),e.errorMessage&&i.jsx("div",{className:"whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-signal-error",children:e.errorMessage}),e.stderrTail&&i.jsx("pre",{className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words font-mono text-[11.5px] leading-relaxed text-muted-foreground",children:e.stderrTail})]}),e.transcriptPath&&i.jsxs("div",{className:"flex items-center gap-2 border-t border-border-soft px-3 py-1.5 text-[11.5px] text-muted-foreground",children:[i.jsx("span",{className:"shrink-0",children:"Transcript"}),i.jsx(Sm,{path:e.transcriptPath})]})]})}function S1(e,t){if(e.length===0)return t;if(e.length===1)return e[0].status;const n=new Set(e.map(r=>r.status));return n.has("running")?"running":n.has("queued")?"queued":n.has("failed")?"failed":n.has("timeout")?"timeout":n.has("aborted")?"aborted":"done"}function N1(e){let t=0,n=0,r=0;for(const s of e)s.usage&&(t+=s.usage.turns,n+=s.usage.input+s.usage.output,r+=s.usage.cost);return{turns:t,tokens:n,cost:r}}function Cm({status:e}){switch(e){case"done":return i.jsx(he,{tone:"ok",children:"done"});case"failed":return i.jsx(he,{tone:"error",children:"failed"});case"timeout":return i.jsx(he,{tone:"error",children:"timeout"});case"aborted":return i.jsx(he,{tone:"ghost",children:"aborted"});case"queued":return i.jsx(he,{tone:"warn",children:"queued"});default:return i.jsx(he,{tone:"warn",children:"running"})}}function Zo({children:e}){return i.jsx("div",{className:"mb-1 text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground/70",children:e})}function E1(e){if(!e||typeof e!="object")return;const t=e;if(t.version!==1||t.kind!=="search")return;const n=[];if(Array.isArray(t.results))for(const r of t.results){if(!r||typeof r!="object")continue;const s=r;typeof s.url=="string"&&n.push({title:typeof s.title=="string"&&s.title?s.title:s.url,url:s.url,content:typeof s.content=="string"?s.content:"",score:Tm(s.score),publishedDate:lf(s.publishedDate)})}return{query:typeof t.query=="string"?t.query:"",answer:lf(t.answer),results:n}}function C1(e){if(!e||typeof e!="object")return;const t=e;if(t.version!==1||t.kind!=="fetch")return;const n=[];if(Array.isArray(t.results))for(const s of t.results){if(!s||typeof s!="object")continue;const o=s;typeof o.url=="string"&&n.push({url:o.url,content:typeof o.content=="string"?o.content:"",chars:Tm(o.chars)??0})}const r=[];if(Array.isArray(t.failed))for(const s of t.failed){if(!s||typeof s!="object")continue;const o=s;typeof o.url=="string"&&r.push({url:o.url,error:typeof o.error=="string"?o.error:"extraction failed"})}return{results:n,failed:r}}function _1(e){if(!e||typeof e!="object")return;const t=e.query;return typeof t=="string"&&t?t:void 0}function T1(e){if(!e||typeof e!="object")return;const t=e.urls;if(!Array.isArray(t))return;const n=t.filter(r=>typeof r=="string");return n.length?n:void 0}function Wi(e){try{return new URL(e).host.replace(/^www\./,"")}catch{return}}function _m(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?e:void 0}catch{return}}function P1(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function lf(e){return typeof e=="string"&&e!==""?e:void 0}function Tm(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function R1({item:e}){const t=E1(e.details),n=(t==null?void 0:t.query)??_1(e.args)??"",r=(t==null?void 0:t.results)??[],s=t==null?void 0:t.answer,o=e.status==="error",l=i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:"web_search",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Web search"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:n?`“${n}”`:"…"}),r.length>0&&i.jsxs("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:[r.length," result",r.length===1?"":"s"]}),i.jsx(Pm,{status:e.status,runningLabel:"searching"})]}),a=o||!!s||r.length>0,u=i.jsxs("div",{className:"flex flex-col border-t border-border-soft bg-background",children:[o&&e.text&&i.jsx(Rm,{text:e.text}),s&&i.jsxs("div",{className:"border-b border-border-soft px-3 py-2 last:border-b-0",children:[i.jsx(I1,{children:"Answer"}),i.jsx("div",{className:"whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground",children:s})]}),r.map((c,p)=>i.jsx(M1,{index:p,title:c.title,url:c.url,snippet:c.content},p))]});return i.jsx(Qn,{hasBody:a,header:l,body:u})}function M1({index:e,title:t,url:n,snippet:r}){const s=Wi(n);return i.jsxs("div",{className:"border-b border-border-soft px-3 py-2 last:border-b-0",children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"w-4 shrink-0 text-right font-mono text-[10.5px] text-muted-foreground/60",children:e+1}),i.jsx("a",{href:_m(n),target:"_blank",rel:"noreferrer noopener",onClick:o=>o.stopPropagation(),title:n,className:"min-w-0 flex-1 truncate text-[12.5px] text-foreground transition-colors hover:text-brand hover:underline",children:t}),s&&i.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:s})]}),r&&i.jsx("div",{className:"mt-1 max-h-16 overflow-hidden pl-6 text-[12px] leading-relaxed text-muted-foreground",children:r})]})}function L1({item:e}){const t=C1(e.details),n=e.status==="error",r=(t==null?void 0:t.results)??[],s=(t==null?void 0:t.failed)??[],o=T1(e.args)??[],l=(r.length?r.map(d=>d.url):o).map(d=>Wi(d)).filter(d=>!!d),a=l.length===0?"…":l.length<=2?l.join(", "):`${l[0]} +${l.length-1} more`,u=r.length+s.length||o.length,c=i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:"web_fetch",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Web fetch"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:a}),u>0&&i.jsxs("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:[u," page",u===1?"":"s"]}),i.jsx(Pm,{status:e.status,runningLabel:"fetching"})]}),p=n||r.length>0||s.length>0,h=i.jsxs("div",{className:"flex flex-col border-t border-border-soft bg-background",children:[n&&e.text&&i.jsx(Rm,{text:e.text}),r.map((d,w)=>i.jsx(O1,{url:d.url,chars:d.chars,preview:d.content},w)),s.map((d,w)=>i.jsxs("div",{className:"border-b border-border-soft px-3 py-2 last:border-b-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"shrink-0 font-mono text-[11.5px] text-signal-error",children:"failed"}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] text-muted-foreground",title:d.url,children:Wi(d.url)??d.url})]}),i.jsx("div",{className:"mt-1 break-words text-[12px] leading-relaxed text-signal-error",children:d.error})]},`f${w}`))]});return i.jsx(Qn,{hasBody:p,header:c,body:h})}function O1({url:e,chars:t,preview:n}){const r=Wi(e);return i.jsxs("div",{className:"border-b border-border-soft px-3 py-2 last:border-b-0",children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("a",{href:_m(e),target:"_blank",rel:"noreferrer noopener",onClick:s=>s.stopPropagation(),title:e,className:"min-w-0 flex-1 truncate font-mono text-[12px] text-foreground transition-colors hover:text-brand hover:underline",children:r??e}),i.jsxs("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground/70",children:[P1(t)," chars"]})]}),n&&i.jsx("div",{className:"mt-1 max-h-24 overflow-hidden whitespace-pre-wrap break-words font-mono text-[11.5px] leading-relaxed text-muted-foreground",children:n})]})}function Pm({status:e,runningLabel:t}){return e==="ok"?i.jsx(he,{tone:"ok",children:"done"}):e==="error"?i.jsx(he,{tone:"error",children:"error"}):i.jsx(he,{tone:"warn",children:t})}function I1({children:e}){return i.jsx("div",{className:"mb-1 text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground/70",children:e})}function Rm({text:e}){return i.jsx("div",{className:"whitespace-pre-wrap break-words border-b border-border-soft px-3 py-2 font-mono text-[12px] leading-relaxed text-signal-error last:border-b-0",children:e})}const Gl={30:"text-zinc-800 dark:text-zinc-200",31:"text-red-600 dark:text-red-400",32:"text-green-600 dark:text-green-400",33:"text-yellow-600 dark:text-yellow-400",34:"text-blue-600 dark:text-blue-400",35:"text-purple-600 dark:text-purple-400",36:"text-cyan-600 dark:text-cyan-400",37:"text-zinc-500 dark:text-zinc-400",90:"text-zinc-500 dark:text-zinc-500",91:"text-red-500 dark:text-red-300",92:"text-green-500 dark:text-green-300",93:"text-yellow-500 dark:text-yellow-300",94:"text-blue-500 dark:text-blue-300",95:"text-purple-500 dark:text-purple-300",96:"text-cyan-500 dark:text-cyan-300",97:"text-zinc-100"};function A1(e){if(e<0||e>255||e<16)return;if(e<232){const n=e-16,r=Math.floor(n/36),s=Math.floor(n%36/6),o=n%6,l=[0,95,135,175,215,255];return`rgb(${l[r]},${l[s]},${l[o]})`}const t=8+(e-232)*10;return`rgb(${t},${t},${t})`}function D1(e,t){const n={...e};for(let r=0;r<t.length;r++){const s=t[r];switch(s){case 0:n.fgClass=void 0,n.fgStyle=void 0,n.bold=!1,n.dim=!1,n.italic=!1,n.underline=!1;break;case 1:n.bold=!0;break;case 2:n.dim=!0;break;case 3:n.italic=!0;break;case 4:n.underline=!0;break;case 22:n.bold=!1,n.dim=!1;break;case 23:n.italic=!1;break;case 24:n.underline=!1;break;case 39:n.fgClass=void 0,n.fgStyle=void 0;break;case 38:{const o=t[r+1];if(o===5){const l=t[r+2];if(typeof l=="number"){const a=A1(l);if(a)n.fgStyle=a,n.fgClass=void 0;else if(l<16){const u=l<8?30+l:90+(l-8);n.fgClass=Gl[u],n.fgStyle=void 0}}r+=2}else if(o===2){const l=t[r+2],a=t[r+3],u=t[r+4];typeof l=="number"&&typeof a=="number"&&typeof u=="number"&&(n.fgStyle=`rgb(${l},${a},${u})`,n.fgClass=void 0),r+=4}break}default:Gl[s]&&(n.fgClass=Gl[s],n.fgStyle=void 0)}}return n}const af=/\x1b(?:\[([0-9;]*)([a-zA-Z])|\][^\x07\x1b]*(?:\x07|\x1b\\))/g;function F1(e){return e.includes("\r")?e.split(`
|
|
245
|
+
`).map(t=>{if(!t.includes("\r"))return t;const n=t.split("\r");return n[n.length-1]??""}).join(`
|
|
246
|
+
`):e}function go(e){const t=F1(e),n=[];let r={},s=0,o=0;const l=u=>{if(!u)return;if(!z1(r)){n.push(u);return}const c=U1(r),p=$1(r);n.push(i.jsx("span",{className:c||void 0,style:p,children:u},o++))};af.lastIndex=0;let a;for(;(a=af.exec(t))!==null;){const u=a.index;if(u>s&&l(t.slice(s,u)),a[2]==="m"){const c=a[1]?a[1].split(";").map(p=>p===""?0:Number(p)):[0];r=D1(r,c)}s=u+a[0].length}return s<t.length&&l(t.slice(s)),n}function z1(e){return!!(e.fgClass||e.fgStyle||e.bold||e.dim||e.italic||e.underline)}function U1(e){const t=[];return e.fgClass&&t.push(e.fgClass),e.bold&&t.push("font-bold"),e.dim&&t.push("opacity-60"),e.italic&&t.push("italic"),e.underline&&t.push("underline"),t.join(" ")}function $1(e){return e.fgStyle?{color:e.fgStyle}:void 0}const q1={ts:"typescript",mts:"typescript",cts:"typescript",tsx:"tsx",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",json:"json",jsonc:"jsonc",yaml:"yaml",yml:"yaml",toml:"toml",md:"markdown",mdx:"mdx",html:"html",htm:"html",css:"css",scss:"scss",less:"less",py:"python",pyi:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",kts:"kotlin",swift:"swift",cs:"csharp",c:"c",h:"c",cc:"cpp",cpp:"cpp",cxx:"cpp",hpp:"cpp",hh:"cpp",m:"objective-c",mm:"objective-c",php:"php",sh:"shellscript",bash:"shellscript",zsh:"shellscript",fish:"shellscript",sql:"sql",xml:"xml",vue:"vue",svelte:"svelte",graphql:"graphql",gql:"graphql",diff:"diff",patch:"diff",ini:"ini",cfg:"ini",conf:"ini",lua:"lua",r:"r",scala:"scala",dart:"dart",ex:"elixir",exs:"elixir",hs:"haskell"},B1={dockerfile:"dockerfile",makefile:"make",gnumakefile:"make"};function kc(e){if(!e)return;const t=e.lastIndexOf("/"),n=(t>=0?e.slice(t+1):e).toLowerCase();if(!n)return;const r=B1[n];if(r)return r;const s=n.lastIndexOf(".");if(s<=0)return;const o=n.slice(s+1);return q1[o]}function Q1({item:e,args:t}){const n=bc(t),r=kc(n),s=y.useMemo(()=>h1(t),[t]),o=y.useMemo(()=>s.map(c=>u1(c.oldText,c.newText)),[s]),l=e.status==="error",a=y.useMemo(()=>{let c=0,p=0;for(const h of o){const d=d1(h);c+=d.adds,p+=d.dels}return{adds:c,dels:p}},[o]),u=o.length>0||!!e.text;return i.jsx(Qn,{hasBody:u,header:i.jsx(vc,{name:"edit",verb:"Edited",path:n,status:e.status,stats:a}),body:i.jsxs(i.Fragment,{children:[o.length>0&&i.jsx("div",{className:`${dl} flex flex-col gap-2 overflow-auto border-t border-border-soft bg-background p-2`,children:o.map((c,p)=>i.jsx(p1,{index:p,rows:c,multi:o.length>1,lang:r},p))}),e.text&&(o.length===0||l)&&i.jsx(mo,{children:go(e.text)})]})})}function H1({item:e,args:t}){const n=bc(t),r=ft(t==null?void 0:t.content)??"",s=kc(n),o=e.status==="error",l=!!r||!!e.text,a=r?r.split(`
|
|
247
|
+
`).length:void 0;return i.jsx(Qn,{hasBody:l,header:i.jsx(vc,{name:"write",verb:"Wrote",path:n,status:e.status,suffix:a?`${a} ln`:void 0}),body:i.jsxs(i.Fragment,{children:[r&&i.jsx("div",{className:`${dl} overflow-auto border-t border-border-soft bg-background px-3 py-2`,children:i.jsx(fl,{code:r,lang:s})}),!r&&e.text&&i.jsx(mo,{children:go(e.text)}),r&&o&&e.text&&i.jsx(mo,{children:go(e.text)})]})})}function V1({item:e,args:t}){const n=bc(t),r=kc(n),s=of(t==null?void 0:t.offset),o=of(t==null?void 0:t.limit),l=o!==void 0?`lines ${s??1}–${(s??1)+o-1}`:s!==void 0?`from line ${s}`:void 0,a=!!e.text;return i.jsx(Qn,{hasBody:a,header:i.jsx(vc,{name:"read",verb:"Read",path:n,status:e.status,suffix:l}),body:e.text?i.jsx("div",{className:`${dl} overflow-auto border-t border-border-soft bg-background px-3 py-2`,children:i.jsx(fl,{code:e.text,lang:r,wrap:!0,tone:"muted"})}):void 0})}function uf({command:e,output:t,exitCode:n,running:r,errored:s}){const l=r?"running":s===!0||n!==void 0&&n!==0?"error":"ok",a=!!t,u=t?t.split(`
|
|
248
|
+
`).length:void 0;return i.jsx(Qn,{hasBody:a,header:i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:"bash",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"text-[12.5px] text-foreground",children:"Ran"}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] tracking-[-0.005em] text-muted-foreground",children:e}),u!=null&&i.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:[u," ln"]}),n!==void 0&&n!==0&&i.jsxs("span",{className:"font-mono text-[11px] text-signal-error",children:["exit ",n]}),i.jsx(wc,{status:l})]}),body:t?i.jsx(mo,{tone:"foreground",children:go(t)}):void 0})}function Mm({item:e,args:t}){const n=m1(e.toolName,t),r=!!e.text;return i.jsx(Qn,{hasBody:r,header:i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:e.toolName,className:"shrink-0 text-muted-foreground"}),i.jsxs("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-muted-foreground",children:[i.jsx("span",{className:"text-foreground",children:e.toolName}),n&&i.jsx("span",{className:"ml-2 font-mono text-[11.5px]",children:n})]}),i.jsx(wc,{status:e.status})]}),body:e.text?i.jsx(mo,{children:go(e.text)}):void 0})}function W1({item:e,isCurrent:t}){const n=y.useMemo(()=>om(sm(e.details)),[e.details]),r=n.length,[s,o]=y.useState(!1),l=y.useId();if(r===0)return i.jsx(Mm,{item:e,args:Nm(e.args)});const a=n.filter(h=>h.status==="completed").length,u=a/r,c=t||s,p=i.jsxs(i.Fragment,{children:[!t&&i.jsx(To,{className:T("h-3 w-3 shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")}),i.jsx(ln,{tool:"todo",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Todos"}),i.jsxs("span",{className:"inline-flex min-w-0 flex-1 items-center gap-2 text-[12px] text-muted-foreground",children:[i.jsxs("span",{className:"font-mono text-[11.5px] tabular-nums",children:[a,"/",r]}),i.jsx("span",{className:`inline-block h-1 ${rm} overflow-hidden rounded-full bg-border-soft`,role:"progressbar","aria-valuemin":0,"aria-valuenow":a,"aria-valuemax":r,"aria-label":`Todo progress: ${a} of ${r} completed`,children:i.jsx("span",{className:"block h-full rounded-full bg-brand transition-[width] duration-300",style:{width:`${u*100}%`}})})]})]});return i.jsxs(ho,{children:[t?i.jsx("div",{className:"flex items-center gap-2.5 px-3 py-2",children:p}):i.jsx("button",{type:"button","aria-expanded":s,"aria-controls":l,onClick:()=>o(h=>!h),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:p}),c&&i.jsx("ul",{id:l,className:"border-t border-border-soft bg-background px-3 py-1.5","aria-label":"Todo items",children:n.map(h=>i.jsxs("li",{className:"flex items-start gap-2 py-[3px]",children:[i.jsx("span",{className:"mt-[2px] shrink-0",children:h.status==="completed"?i.jsx(_o,{className:"h-3.5 w-3.5 text-signal-ok","aria-hidden":!0}):h.status==="in_progress"?t?i.jsx(mr,{className:"h-3.5 w-3.5 text-brand animate-v2-spin","aria-label":"In progress"}):i.jsx(o0,{className:"h-3.5 w-3.5 text-muted-foreground/70","aria-label":"Was in progress"}):i.jsx(Kh,{className:"h-3.5 w-3.5 text-muted-foreground/40","aria-hidden":!0})}),i.jsxs("span",{className:T("min-w-0 flex-1 text-[12.5px] leading-[1.5]",h.status==="completed"?"text-muted-foreground line-through decoration-muted-foreground/30":h.status==="in_progress"&&t?"text-foreground font-medium":"text-muted-foreground"),children:[i.jsxs("span",{className:"mr-1.5 font-mono text-[11px] text-muted-foreground/50",children:["#",h.id]}),h.subject]})]},h.id))})]})}function Lm({item:e,isCurrentTodo:t=!0}){if(e.kind==="bash")return i.jsx(uf,{command:e.command,output:e.output,exitCode:e.exitCode,running:!1});const n=Nm(e.args),r=e.toolName;if(r==="edit")return i.jsx(Q1,{item:e,args:n});if(r==="write")return i.jsx(H1,{item:e,args:n});if(r==="read")return i.jsx(V1,{item:e,args:n});if(r==="bash")return i.jsx(uf,{command:Y1(n==null?void 0:n.command)??"",output:e.text,exitCode:void 0,running:e.status==="running",errored:e.status==="error"});if(r==="todo")return i.jsx(W1,{item:e,isCurrent:t});if(r==="ask_user"){const s=o=>{fe.send({type:"answer_question",toolCallId:e.toolCallId,answer:o})};return i.jsx(e1,{item:e,onSubmit:s})}return r==="create_artifact"?i.jsx(g1,{item:e}):r==="subagent"?i.jsx(k1,{item:e}):r==="web_search"?i.jsx(R1,{item:e}):r==="web_fetch"?i.jsx(L1,{item:e}):i.jsx(Mm,{item:e,args:n})}function K1({items:e}){const[t,n]=y.useState(!1),r=y.useId(),s=G1(e);return i.jsxs("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:[i.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(o=>!o),className:"flex w-full items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:[i.jsx(To,{className:T("h-3 w-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")}),i.jsxs("span",{className:"shrink-0 text-[12.5px] font-medium text-foreground",children:[e.length," actions"]}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:s.map(o=>`${o.count} ${o.name}`).join(" · ")}),i.jsx(he,{tone:"ghost",children:t?"open":"batched"})]}),t&&i.jsx("div",{id:r,className:"flex flex-col gap-2 border-t border-border-soft bg-card p-2",children:e.map(o=>i.jsx(Lm,{item:o,isCurrentTodo:!1},o.id))})]})}function G1(e){const t=new Map;for(const n of e){const r=n.kind==="bash"?"bash":n.toolName;t.set(r,(t.get(r)??0)+1)}return Array.from(t.entries()).sort((n,r)=>r[1]-n[1]).map(([n,r])=>({name:n,count:r}))}function Y1(e){return typeof e=="string"?e:void 0}function X1(e){const t=[];let n=[];const r=()=>{n.length!==0&&(n.length===1?t.push({kind:"single",item:n[0]}):t.push({kind:"group",items:n}),n=[])};for(const s of e)if(s.kind==="tool"||s.kind==="bash")ew(s)||Ki(s)||tw(s)||nw(s)||rw(s)?(r(),t.push({kind:"single",item:s})):n.push(s);else{if(Z1(s))continue;r(),t.push({kind:"single",item:s})}return r(),ow(t)}function J1(e){const t=[];let n=!1;for(const r of e){if(r.kind==="single"&&r.item.kind==="user"){n=!1,t.push({entry:r,leadHeader:!1,showHeader:!1});continue}if(r.kind==="single"&&r.item.kind==="assistant"){const o=!n;r.item.text&&(n=!0),t.push({entry:r,leadHeader:!1,showHeader:o});continue}const s=!n;n=!0,t.push({entry:r,leadHeader:s,showHeader:!1})}return t}function Z1(e){return e.kind==="assistant"&&e.text.length===0}function ew(e){return e.kind==="tool"?e.status==="error":e.exitCode!==void 0&&e.exitCode!==0}function Ki(e){return e.kind==="tool"&&e.toolName==="todo"}function tw(e){return e.kind==="tool"&&e.toolName==="ask_user"}function nw(e){return e.kind==="tool"&&e.toolName===pl}function rw(e){return e.kind==="tool"&&e.toolName==="subagent"}function sw(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="single"&&Ki(n.item))return n.item.id}}function ow(e){const t=new Set;let n=0;for(let r=0;r<=e.length;r++){const s=r===e.length,o=!s&&e[r].kind==="single"&&e[r].item.kind==="user";if(s||o){let l=-1;for(let a=r-1;a>=n;a--){const u=e[a];if(u.kind==="single"&&Ki(u.item)){l=a;break}}if(l!==-1)for(let a=n;a<r;a++){const u=e[a];a!==l&&u.kind==="single"&&Ki(u.item)&&t.add(a)}n=r}}return t.size===0?e:e.filter((r,s)=>!t.has(s))}function iw({items:e,running:t,bottomPad:n,workspaceId:r,onFork:s}){const o=cm(g=>g.density)==="compact",l=y.useRef(null),a=y.useRef(!0);y.useLayoutEffect(()=>{const g=l.current;if(!g)return;const{scrollInfo:j}=V.getState();a.current=j.stickToBottom,j.stickToBottom?g.scrollTop=g.scrollHeight:g.scrollTop=j.scrollTop},[]);const u=y.useCallback(()=>{const g=l.current;g&&(a.current=g.scrollHeight-g.scrollTop-g.clientHeight<30,V.getState().setScrollInfo({scrollTop:g.scrollTop,stickToBottom:a.current}))},[]);y.useEffect(()=>{const g=l.current;!g||!a.current||(g.scrollTop=g.scrollHeight)},[e,t]),y.useEffect(()=>{const g=l.current;!g||!a.current||(g.scrollTop=g.scrollHeight)},[n]);const{rows:c,currentTodoId:p}=y.useMemo(()=>{const g=X1(e);return{rows:J1(g),currentTodoId:sw(g)}},[e]),h=e.length===0&&!t,d=e[e.length-1],w=t&&!((d==null?void 0:d.kind)==="assistant"&&d.streaming&&d.text)&&!((d==null?void 0:d.kind)==="tool"&&d.status==="running"),b=w?!fw(e):!1;return i.jsx("div",{ref:l,onScroll:u,className:T("relative z-10 min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",h?"flex items-center justify-center":"pt-4"),style:h?void 0:{maskImage:"linear-gradient(to bottom, black calc(100% - 56px), transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 56px), transparent 100%)"},children:h?i.jsx(fm,{title:"Ready when you are.",tagline:"Send a message to brief your co-pilot. Enter submits, Shift+Enter inserts a newline.",hint:{keys:["⏎"],label:"Send"},suggestions:[{label:"Explain this codebase",prompt:"Give me a tour of this project — its main modules, how they fit together, and where I'd start to make changes."},{label:"Find & fix a bug",prompt:"Help me find a bug. I'll paste the symptoms; you read the relevant code and propose a fix."},{label:"Draft a feature",prompt:"Draft the scaffolding for a new feature I'll describe, then walk me through the design trade-offs."}],onPickSuggestion:g=>{V.getState().setComposerDraft(g),requestAnimationFrame(()=>{var j;(j=document.querySelector("textarea[data-composer-input]"))==null||j.focus()})}}):i.jsxs("div",{className:T("mx-auto flex w-full flex-col px-6",o?`${$i.compact} gap-1`:`${$i.comfortable} gap-4`),style:{paddingBottom:n},children:[c.flatMap(({entry:g,leadHeader:j,showHeader:f})=>{if(g.kind==="single"&&g.item.kind==="user")return[i.jsx(Yl,{item:g.item,isCurrentTodo:g.item.id===p,compact:o,onFork:s},g.item.id)];if(g.kind==="single"&&g.item.kind==="assistant")return[i.jsx(Yl,{item:g.item,isCurrentTodo:g.item.id===p,compact:o,showHeader:f},g.item.id)];const m=[];if(j){const x=g.kind==="group"?g.items[0].id:g.item.id;m.push(i.jsx(aw,{compact:o},`pilot-hdr:${x}`))}if(g.kind==="single")m.push(i.jsx(Yl,{item:g.item,isCurrentTodo:g.item.id===p,compact:o},g.item.id));else{const x=`group:${g.items[0].id}`;m.push(i.jsx(lw,{group:g,compact:o},x))}return m}),w&&i.jsx(dw,{compact:o,showHeader:b})]})})}const Yl=y.memo(function({item:t,isCurrentTodo:n,compact:r=!1,showHeader:s=!0,onFork:o}){return t.kind==="user"?i.jsx(uw,{item:t,compact:r,onFork:o}):t.kind==="assistant"?i.jsx(cw,{item:t,compact:r,showHeader:s}):t.kind==="tool"||t.kind==="bash"?i.jsx("div",{className:r?"pl-4 border-l-2 border-border-soft ml-0.5":"pl-10",children:i.jsx(Lm,{item:t,isCurrentTodo:n})}):null});function lw({group:e,compact:t=!1}){return i.jsx("div",{className:t?"pl-4 border-l-2 border-border-soft ml-0.5":"pl-10",children:i.jsx(K1,{items:e.items})})}function aw({compact:e=!1}){return e?i.jsxs("div",{className:"flex items-center gap-2 pt-1.5",children:[i.jsx("span",{className:"h-px flex-1 bg-border-soft"}),i.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Pilot"}),i.jsx("span",{className:"h-px flex-1 bg-border-soft"})]}):i.jsxs("div",{className:"-mb-[6px] flex gap-3",children:[i.jsx("span",{"aria-hidden":!0,className:"flex w-7 shrink-0 justify-center pt-px font-serif text-[21px] italic leading-none text-brand",children:"π"}),i.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:i.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Pilot"})})]})}function cf({text:e}){const[t,n]=y.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1200)}catch{}};return i.jsx("button",{type:"button",onClick:r,title:t?"Copied":"Copy message","aria-label":"Copy message",className:"rounded-full p-1 text-muted-foreground transition-colors hover:bg-brand-ghost hover:text-brand",children:t?i.jsx(_o,{className:"h-3 w-3 text-signal-ok"}):i.jsx(pc,{className:"h-3 w-3"})})}function uw({item:e,compact:t=!1,onFork:n}){const r=n&&e.entryId&&!e.pending;return t?i.jsxs("div",{className:"group/user v2-rise-soft mt-3 flex items-baseline gap-2 rounded-r-md border-l-2 border-brand bg-brand-whisper px-2.5 py-1 first:mt-0",children:[i.jsx("span",{className:"shrink-0 text-[11.5px] font-medium text-brand",children:"You"}),i.jsx("div",{className:"min-w-0 flex-1 text-[13.5px] leading-[1.45] text-foreground [overflow-wrap:anywhere]",children:i.jsx(fo,{text:e.text})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5 self-center opacity-0 transition-opacity duration-150 group-hover/user:opacity-100",children:[i.jsx(cf,{text:e.text}),r&&i.jsx("button",{type:"button",onClick:()=>n(e.entryId),title:"Fork from here",className:"rounded-full p-1 text-muted-foreground transition-colors hover:bg-brand-ghost hover:text-brand",children:i.jsx(Qd,{className:"h-3 w-3"})})]})]}):i.jsxs("div",{className:"group/user v2-rise-soft mt-6 flex flex-col items-end gap-1.5 first:mt-0",children:[i.jsxs("div",{className:"relative max-w-[78%] rounded-2xl rounded-tr-sm border border-brand-whisper-border bg-brand-whisper px-3.5 py-2 text-[14px] leading-[1.55] text-foreground [overflow-wrap:anywhere]",children:[i.jsx(fo,{text:e.text}),i.jsxs("div",{className:"absolute right-full bottom-1 mr-1 flex items-center gap-0.5 opacity-0 transition-opacity duration-150 group-hover/user:opacity-100",children:[i.jsx(cf,{text:e.text}),r&&i.jsx("button",{type:"button",onClick:()=>n(e.entryId),title:"Fork from here",className:"rounded-full p-1 text-muted-foreground transition-colors hover:bg-brand-ghost hover:text-brand",children:i.jsx(Qd,{className:"h-3 w-3"})})]})]}),i.jsx(Rs,{children:"You"})]})}function cw({item:e,compact:t=!1,showHeader:n=!0}){return!e.text&&!e.error?null:t?i.jsxs("div",{className:"v2-rise-soft flex gap-0",children:[i.jsx("div",{className:"mr-4 flex w-0.5 shrink-0 self-stretch rounded-full bg-brand/30"}),i.jsxs("div",{className:"min-w-0 flex-1 py-0.5 [overflow-wrap:anywhere]",children:[n&&i.jsxs("div",{className:"mb-0.5 flex items-baseline gap-2",children:[i.jsx("span",{className:"text-[11.5px] font-medium text-brand",children:"Pilot"}),!e.streaming&&typeof e.firstTokenMs=="number"&&i.jsx(Rs,{className:T(Kd(e.firstTokenMs)),title:e.totalMs!=null?`first token ${wr(e.firstTokenMs)} · total ${wr(e.totalMs)}`:void 0,children:wr(e.firstTokenMs)}),e.streaming&&i.jsx(Rs,{className:"text-brand",children:"streaming…"})]}),i.jsx(fo,{text:e.text,streaming:e.streaming,className:"text-[13.5px] leading-[1.45]"}),e.error&&i.jsx(ff,{text:e.error})]})]}):i.jsxs("div",{className:"v2-rise-soft flex gap-3",children:[n?i.jsx("span",{"aria-hidden":!0,className:"flex w-7 shrink-0 justify-center pt-px font-serif text-[21px] italic leading-none text-brand",children:"π"}):i.jsx("div",{"aria-hidden":!0,className:"w-7 shrink-0"}),i.jsxs("div",{className:"min-w-0 flex-1 pt-0.5 [overflow-wrap:anywhere]",children:[n&&i.jsxs("div",{className:"mb-1 flex items-baseline gap-2",children:[i.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Pilot"}),!e.streaming&&typeof e.firstTokenMs=="number"&&i.jsx(Rs,{className:T(Kd(e.firstTokenMs)),title:e.totalMs!=null?`first token ${wr(e.firstTokenMs)} · total ${wr(e.totalMs)}`:void 0,children:wr(e.firstTokenMs)}),e.streaming&&i.jsx(Rs,{className:"text-brand",children:"streaming…"})]}),i.jsx(fo,{text:e.text,streaming:e.streaming}),e.error&&i.jsx(ff,{text:e.error})]})]})}function df(){return i.jsxs("span",{className:"flex items-center gap-[3px]",children:[i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-brand animate-v2-dot"}),i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-brand animate-v2-dot-2"}),i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-brand animate-v2-dot-3"})]})}function dw({compact:e,showHeader:t}){return e?i.jsxs("div",{"aria-hidden":!0,className:"v2-fade-in flex gap-0",children:[i.jsx("div",{className:"mr-4 flex w-0.5 shrink-0 self-stretch rounded-full bg-brand/30"}),i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 py-0.5",children:[t&&i.jsx("span",{className:"text-[11.5px] font-medium text-brand",children:"Pilot"}),i.jsx(df,{}),i.jsx("span",{className:"text-[11.5px] text-brand",children:"thinking…"})]})]}):i.jsxs("div",{"aria-hidden":!0,className:"v2-fade-in flex gap-3",children:[t?i.jsx("span",{className:"flex w-7 shrink-0 justify-center pt-px font-serif text-[21px] italic leading-none text-brand",children:"π"}):i.jsx("div",{className:"w-7 shrink-0"}),i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 pt-0.5",children:[t&&i.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Pilot"}),i.jsx(df,{}),i.jsx("span",{className:"text-[12px] text-brand",children:"thinking…"})]})]})}function fw(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="user")return!1;if(n.kind==="tool"||n.kind==="bash"||n.kind==="assistant"&&n.text)return!0}return!1}function ff({text:e}){return i.jsxs("div",{className:"mt-2 flex items-start gap-1.5 rounded-md border border-error-ghost-border bg-error-ghost px-2.5 py-1.5 text-[12.5px] leading-snug text-signal-error",children:[i.jsx(uo,{className:"mt-px h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"min-w-0 [overflow-wrap:anywhere]",children:e})]})}function Rs({children:e,className:t,title:n}){return i.jsx("span",{title:n,className:T("text-[11px] tracking-[-0.005em] text-muted-foreground",t),children:e})}function pw({workspaceId:e,sessionPath:t,running:n,onCompact:r}){const s=V(g=>{var j;return(j=g.contextUsage)==null?void 0:j.percent}),o=V(g=>g.contextUsage!==void 0),l=V(g=>g.compaction),a=V(g=>g.retrying),{data:u}=zy(e,t),c=po(g=>g.panels),p=po(g=>g.togglePanel),h=V(g=>g.items.some(j=>j.kind==="tool"&&j.toolName===pl)),d=s!=null?Math.round(s):null,w=o&&d==null,b=d!=null||w;return i.jsxs("header",{className:"relative z-20 shrink-0 border-b border-border/60 bg-popover/80 backdrop-blur-md",children:[i.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-foreground/[0.06] to-transparent"}),i.jsxs("div",{className:"flex items-center gap-2 px-4 py-[10px]",children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:n&&i.jsxs("span",{title:a!=null&&a.reason?`Retrying after error: ${a.reason}`:void 0,className:T("inline-flex shrink-0 items-center gap-1.5 text-[11.5px] font-medium",a?"text-signal-amber":"text-brand"),children:[i.jsxs("span",{className:"flex items-center gap-[3px]",children:[i.jsx("span",{className:T("h-1 w-1 rounded-full animate-v2-dot",a?"bg-signal-amber":"bg-brand")}),i.jsx("span",{className:T("h-1 w-1 rounded-full animate-v2-dot-2",a?"bg-signal-amber":"bg-brand")}),i.jsx("span",{className:T("h-1 w-1 rounded-full animate-v2-dot-3",a?"bg-signal-amber":"bg-brand")})]}),i.jsx("span",{className:"ml-0.5",children:a?`retrying${a.maxAttempts>0?` (${a.attempt}/${a.maxAttempts})`:""}…`:"thinking"})]})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[u&&i.jsx(xw,{workspaceId:e,currentModel:u.currentModel,availableModels:u.availableModels,thinkingLevel:u.thinkingLevel,availableThinkingLevels:u.availableThinkingLevels,disabled:n}),(u==null?void 0:u.currentModel)&&b&&i.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),b&&i.jsxs(he,{tone:"ghost",className:"hidden md:inline-flex",title:w?"Context · recalculating after compaction":`Context · ${d}%`,children:[i.jsx("span",{className:"text-muted-foreground",children:"Context"}),i.jsx("span",{className:T("font-mono text-[11px] tabular-nums",w?"text-muted-foreground/70":"text-foreground"),children:w?"—":`${d}%`}),i.jsx("span",{className:"inline-block h-1 w-[22px] overflow-hidden rounded-full bg-border-soft",children:w?i.jsx("span",{className:"block h-full w-full animate-v2-pulse bg-brand/50"}):i.jsx("span",{className:"block h-full rounded-full bg-gradient-to-r from-brand-strong to-brand transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,d??0)}%`}})})]}),i.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),i.jsx(br,{active:c.includes("tree"),onClick:()=>p("tree"),title:"Session Tree",children:i.jsx(f0,{className:"h-3.5 w-3.5"})}),i.jsx(br,{active:c.includes("resources"),onClick:()=>p("resources"),title:"Resources",children:i.jsx(d0,{className:"h-3.5 w-3.5"})}),i.jsx(br,{active:c.includes("files"),onClick:()=>p("files"),title:"Files",children:i.jsx(c0,{className:"h-3.5 w-3.5"})}),i.jsx(br,{active:c.includes("terminal"),onClick:()=>p("terminal"),title:"Terminal",children:i.jsx(y0,{className:"h-3.5 w-3.5"})}),(h||c.includes("artifact"))&&i.jsx(br,{active:c.includes("artifact"),onClick:()=>p("artifact"),title:"Artifacts",children:i.jsx(lu,{className:"h-3.5 w-3.5"})}),i.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),i.jsx(hw,{workspaceId:e,sessionPath:t,running:n,compacting:!!l,onCompact:r})]})]})]})}function hw({workspaceId:e,sessionPath:t,running:n,compacting:r,onCompact:s}){const[o,l]=y.useState(!1),[a,u]=y.useState(!1),[c,p]=y.useState(""),h=y.useRef(null),d=y.useRef(null),w=Vy(e,t),b=Zy(e),g=qy(e,t);y.useEffect(()=>{if(!o)return;const f=m=>{h.current&&!h.current.contains(m.target)&&(l(!1),u(!1))};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[o]),y.useEffect(()=>{var f;a&&((f=d.current)==null||f.focus())},[a]);const j=()=>{const f=c.trim();f&&g.mutate({name:f}),u(!1),l(!1)};return i.jsxs("div",{ref:h,className:"relative",children:[i.jsx(br,{active:o,onClick:()=>l(f=>!f),title:"Session actions",children:i.jsx(a0,{className:"h-3.5 w-3.5"})}),o&&i.jsx("div",{className:"absolute right-0 top-[calc(100%+6px)] z-50 w-[200px] origin-top-right animate-in fade-in zoom-in-95 overflow-hidden rounded-xl border border-border/80 bg-popover shadow-menu",children:i.jsx("div",{className:"py-1",children:a?i.jsx("div",{className:"px-3 py-2",children:i.jsx("input",{ref:d,type:"text",value:c,onChange:f=>p(f.target.value),onKeyDown:f=>{f.key==="Enter"&&j(),f.key==="Escape"&&(u(!1),l(!1))},placeholder:"Session name…",className:"w-full rounded-md border border-border bg-card px-2 py-1 text-[12px] text-foreground outline-none focus:border-brand/50"})}):i.jsxs(i.Fragment,{children:[i.jsx(ei,{icon:i.jsx(g0,{className:"h-3.5 w-3.5"}),label:"Compact context",disabled:n||r,onClick:()=>{s(),l(!1)}}),i.jsx(ei,{icon:i.jsx(l0,{className:"h-3.5 w-3.5"}),label:"Export HTML",disabled:w.isPending,onClick:()=>{w.mutate(),l(!1)}}),i.jsx(ei,{icon:i.jsx(h0,{className:"h-3.5 w-3.5"}),label:"Rename session",onClick:()=>{p(""),u(!0)}}),i.jsx(ei,{icon:i.jsx(Gh,{className:"h-3.5 w-3.5"}),label:"Reload resources",disabled:b.isPending,onClick:()=>{b.mutate(),l(!1)}})]})})})]})}function ei({icon:e,label:t,disabled:n,onClick:r}){return i.jsxs("button",{type:"button",disabled:n,onClick:r,className:T("flex w-full items-center gap-2.5 px-3 py-[7px] text-left text-[12px] text-foreground transition-colors",n?"cursor-not-allowed opacity-40":"hover:bg-accent/50"),children:[i.jsx("span",{className:"shrink-0 text-muted-foreground",children:e}),i.jsx("span",{children:t})]})}function Xl(e){return`${e.provider}/${e.modelId}`}function mw(e){const t=new Map;for(const n of e){const r=t.get(n.provider);r?r.push(n):t.set(n.provider,[n])}return Array.from(t.entries())}const gw={off:"Off",minimal:"Min",low:"Low",medium:"Med",high:"High",xhigh:"Max"};function xw({workspaceId:e,currentModel:t,availableModels:n,thinkingLevel:r,availableThinkingLevels:s,disabled:o}){const[l,a]=y.useState(!1),[u,c]=y.useState(-1),p=y.useRef(null),h=y.useRef(null),d=y.useRef(null),w=Uy(e),b=$y(e),g=t?Xl(t):"",j=mw(n),f=n.map(Xl),m=f.indexOf(g);if(y.useEffect(()=>{if(!l)return;const k=C=>{p.current&&!p.current.contains(C.target)&&a(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[l]),y.useEffect(()=>{if(!l)return;const k=C=>{var S,N;switch(C.key){case"Escape":C.preventDefault(),a(!1),(S=d.current)==null||S.focus();break;case"ArrowDown":C.preventDefault(),c(E=>{const _=E<f.length-1?E+1:0;return Jl(h.current,_),_});break;case"ArrowUp":C.preventDefault(),c(E=>{const _=E>0?E-1:f.length-1;return Jl(h.current,_),_});break;case"Enter":{C.preventDefault();const E=f[u],_=n[u];E&&_&&E!==g&&w.mutate({provider:_.provider,modelId:_.modelId}),a(!1),(N=d.current)==null||N.focus();break}}};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[l,u,f,g,n,w]),y.useEffect(()=>{if(l){const k=m>=0?m:0;c(k),requestAnimationFrame(()=>Jl(h.current,k))}},[l,m]),!t)return null;let x=0;return i.jsxs("div",{ref:p,className:"relative hidden md:block",children:[i.jsxs("button",{ref:d,type:"button",onClick:()=>a(k=>!k),disabled:o,title:t.modelId,className:T("inline-flex items-center gap-1 rounded-full border px-2.5 py-[2.5px] text-[11.5px] font-medium leading-[1.5] tracking-[-0.005em] transition-all duration-150",l?"border-brand/30 bg-brand-ghost/50 text-brand-strong":"border-border-soft bg-transparent text-foreground",o?"cursor-not-allowed opacity-50":"cursor-pointer hover:border-border-hi hover:bg-accent/40"),children:[i.jsx("span",{className:"max-w-[180px] truncate",children:t.name}),i.jsx(To,{className:T("h-2.5 w-2.5 shrink-0 opacity-50 transition-transform duration-150",l&&"rotate-180 opacity-80")})]}),l&&i.jsxs("div",{className:"absolute right-0 top-[calc(100%+6px)] z-50 w-[260px] origin-top-right animate-in fade-in zoom-in-95 overflow-hidden rounded-xl border border-border/80 bg-popover shadow-menu",role:"listbox","aria-label":"Switch model",children:[i.jsxs("div",{ref:h,className:"max-h-[320px] overflow-y-auto overscroll-contain py-1",children:[n.length===0&&i.jsx("div",{className:"px-4 py-6 text-center text-[12px] text-muted-foreground",children:"No models available. Add one in Settings → Models."}),j.map(([k,C],S)=>i.jsxs("div",{children:[S>0&&i.jsx("div",{className:"mx-3 my-1 h-px bg-border-soft"}),i.jsx("div",{className:"px-3 pb-0.5 pt-2",children:i.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.06em] text-muted-foreground/70",children:k})}),C.map(N=>{const E=Xl(N),_=E===g,R=x++,$=R===u;return i.jsx("button",{type:"button",role:"option","aria-selected":_,"data-option-index":R,onMouseEnter:()=>c(R),onClick:()=>{a(!1),_||w.mutate({provider:N.provider,modelId:N.modelId})},className:T("flex w-[calc(100%-8px)] items-center rounded-lg mx-1 px-2 py-[6px] text-left transition-colors duration-100",_?"bg-brand-ghost font-medium text-brand-strong":$?"bg-accent/50 text-foreground":"text-foreground"),children:i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px]",children:N.name})},E)})]},k))]}),s.length>0&&i.jsxs("div",{className:"border-t border-border-soft bg-popover/95 px-2 py-2",children:[i.jsx("div",{className:"px-1 pb-1.5",children:i.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.06em] text-muted-foreground/70",children:"Thinking effort"})}),i.jsx("div",{className:"flex gap-0.5 rounded-lg border border-border-soft bg-card/40 p-0.5",children:s.map(k=>i.jsx("button",{type:"button",onClick:()=>b.mutate({level:k}),disabled:o||b.isPending,className:T("min-w-0 flex-1 truncate rounded-md px-1 py-1 text-[10.5px] font-medium transition-colors",k===r?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:bg-accent/50 hover:text-foreground",(o||b.isPending)&&"cursor-not-allowed opacity-50"),children:gw[k]??k},k))})]})]})]})}function Jl(e,t){if(!e)return;const n=e.querySelector(`[data-option-index="${t}"]`);n==null||n.scrollIntoView({block:"nearest"})}function yw(e,t){const n=V(w=>w.apply),r=V(w=>w.pushUser),s=V(w=>w.rememberQueuedUser),o=V(w=>w.reset),l=V(w=>w.setSwitching),a=V(w=>w.applyHistory),u=V(w=>w.switching),c=y.useRef(null),p=y.useRef(null),h=y.useRef(0),d=y.useRef(e);return d.current=e,y.useEffect(()=>(fe.start(),()=>{}),[]),y.useEffect(()=>fe.on(b=>{if(b.type==="background_evicted"){hv(b.workspaceId,b.sessionPath);return}const g=p.current;if(b.type==="event"){const j=g?g.expectedWorkspaceId:d.current,f=g?g.expectedSessionPath:V.getState().sessionPath??null;if(b.workspaceId!==j||b.sessionPath!==f){pv(b);return}if(g){g.buffer.push(b);return}}if(b.type==="subscribed"){const j=V.getState();if(j.sessionPath!==void 0&&j.sessionPath===b.sessionPath&&d.current===b.workspaceId)return}n(b),Om(b)}),[n]),y.useEffect(()=>{if(!e){o();return}t&&l(!0),fe.send({type:"subscribe",workspaceId:e,...t?{sessionPath:t.path}:{}})},[e,t,o,l]),y.useEffect(()=>fe.onReconnect(()=>{c.current=null}),[]),y.useEffect(()=>{const w=g=>{if(g.type!=="subscribed")return;const j=g.workspaceId,f=g.sessionPath,m=c.current;if(m&&m.wsId===j&&m.sp===f)return;const x=p.current;if(x&&x.controller.abort(),c.current={wsId:j,sp:f},fv()){p.current=null;return}const k=++h.current,C=new AbortController,S={token:k,expectedWorkspaceId:j,expectedSessionPath:f,controller:C,buffer:[]};p.current=S;const N=fe.connectionEpoch,E=f?`?sessionPath=${encodeURIComponent(f)}`:"";G(`/api/workspaces/${j}/history${E}`,{signal:C.signal}).then(_=>{var U;if(((U=p.current)==null?void 0:U.token)!==k)return;const R=()=>{var me;((me=p.current)==null?void 0:me.token)===k&&(p.current=null)};if(fe.connectionEpoch!==N){R();return}if(V.getState().sessionPath!==f){R();return}a(_.items,_.isStreaming),Ss(S),p.current=null}).catch(_=>{var R;(_==null?void 0:_.name)!=="AbortError"&&((R=p.current)==null?void 0:R.token)===k&&(console.error("[useSessionStream] history fetch failed:",_),Ss(S),p.current=null)})},b=fe.on(w);return()=>{b();const g=p.current;g&&(g.controller.abort(),p.current=null,Ss(g))}},[a]),y.useEffect(()=>{const w=g=>{if(g.type!=="navigate_tree_result")return;if(g.cancelled){l(!1);return}const j=d.current;if(!j){l(!1);return}const m=V.getState().sessionPath,x=p.current;x&&x.controller.abort();const k=++h.current,C=new AbortController,S={token:k,expectedWorkspaceId:j,expectedSessionPath:m??null,controller:C,buffer:[]};p.current=S;const N=g.editorText,E=fe.connectionEpoch,_=m?`?sessionPath=${encodeURIComponent(m)}`:"";G(`/api/workspaces/${j}/history${_}`,{signal:C.signal}).then(R=>{var $;if((($=p.current)==null?void 0:$.token)===k){if(fe.connectionEpoch!==E){p.current=null,l(!1);return}a(R.items,R.isStreaming),Ss(S),p.current=null,N&&V.getState().setComposerDraft(N),l(!1)}}).catch(R=>{var $;(R==null?void 0:R.name)!=="AbortError"&&(($=p.current)==null?void 0:$.token)===k&&(console.error("[useSessionStream] navigate history fetch failed:",R),Ss(S),p.current=null,l(!1))})};return fe.on(w)},[a,l]),y.useMemo(()=>({sendPrompt(w,b){!e||u||(b!=null&&b.skipOptimistic||(b!=null&&b.streamingBehavior?s(w,b.streamingBehavior):r(w)),fe.send({type:"prompt",message:w,...b!=null&&b.streamingBehavior?{streamingBehavior:b.streamingBehavior}:{}}))},abort(){e&&fe.send({type:"abort"})},newSession(){e&&(l(!0),fe.send({type:"new_session",workspaceId:e}))},fork(w){e&&(l(!0),fe.send({type:"fork",workspaceId:e,entryId:w}))},navigateTree(w,b){!e||u||(l(!0),fe.send({type:"navigate_tree",workspaceId:e,targetId:w,summarize:b==null?void 0:b.summarize,customInstructions:b==null?void 0:b.customInstructions}))},compact(){e&&fe.send({type:"compact"})}}),[e,r,s,l,u])}function Ss(e){const{expectedWorkspaceId:t,expectedSessionPath:n,buffer:r}=e;for(const s of r)s.type==="event"&&s.workspaceId===t&&s.sessionPath===n&&(V.getState().apply(s),Om(s))}function Om(e){if(e.type!=="event")return;const t=e.payload;t.kind==="tool_execution_end"&&(t.toolName!==pl||t.isError||hu.getState().open(t.toolCallId))}function vw({workspaceId:e,sessionRequest:t}){const n=V(j=>j.items),r=V(j=>j.running),s=V(j=>j.switching),o=V(j=>j.sessionPath),{sendPrompt:l,abort:a,fork:u,compact:c}=yw(e,t),p=Vh(e).data,h=y.useMemo(()=>ww(p),[p]),d=y.useCallback((j,f)=>{const m=bw(j,h);l(j,{skipOptimistic:m,streamingBehavior:f})},[l,h]),w=y.useRef(null),[b,g]=y.useState(0);return y.useLayoutEffect(()=>{const j=w.current;if(!j)return;g(j.getBoundingClientRect().height);const f=new ResizeObserver(m=>{const x=m[0];x&&g(x.contentRect.height)});return f.observe(j),()=>f.disconnect()},[e]),e?i.jsxs("main",{className:"relative flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-clip bg-background",children:[i.jsx(pw,{workspaceId:e,sessionPath:o,running:r,onCompact:c}),i.jsx(Sv,{}),i.jsx(jv,{}),i.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[i.jsx("div",{className:"v2-fade-in flex min-h-0 flex-1 flex-col",children:i.jsx(iw,{items:n,running:r,bottomPad:b,workspaceId:e,onFork:u})},o??"none"),i.jsx("div",{ref:w,className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 flex flex-col",children:i.jsx(Ov,{workspaceId:e,onSend:d,onAbort:a,running:r,disabled:s})})]})]}):i.jsx("main",{className:"relative flex flex-1 items-center justify-center bg-background",children:i.jsx(fm,{title:"Ready when you are.",tagline:"Pick or add a workspace from the left to begin a session."})})}function ww(e){const t=new Set;if(!e)return t;for(const n of e.extensions)for(const r of n.commands)t.add(r);return t}function bw(e,t){if(t.size===0||!e.startsWith("/"))return!1;const n=e.slice(1),r=n.search(/\s/),s=r===-1?n:n.slice(0,r);return t.has(s)}const kw=120;function jw(){var e;return typeof window<"u"&&((e=window.matchMedia)==null?void 0:e.call(window,"(prefers-reduced-motion: reduce)").matches)===!0}function jc({open:e,onClose:t,zIndex:n=100,className:r,role:s="dialog",ariaLabelledBy:o,ariaDescribedBy:l,children:a}){const[u,c]=y.useState(e),[p,h]=y.useState(!1),d=y.useRef(!1),w=y.useRef(e);y.useEffect(()=>{const j=w.current;if(w.current=e,e&&!j)c(!0),h(!1),d.current=!1;else if(!e&&j&&!d.current){if(jw()){c(!1);return}d.current=!0,h(!0)}},[e]),y.useEffect(()=>{if(!p)return;const j=window.setTimeout(()=>{d.current=!1,h(!1),c(!1)},kw+40);return()=>window.clearTimeout(j)},[p]),y.useEffect(()=>{if(!u)return;const j=f=>{f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),t())};return document.addEventListener("keydown",j,!0),()=>document.removeEventListener("keydown",j,!0)},[u,t]);const b=()=>{d.current&&(d.current=!1,h(!1),c(!1))};if(!u)return null;const g=p;return i.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:n},children:[i.jsx("div",{className:T("absolute inset-0 bg-background/60 backdrop-blur-[2px]",g?"v2-fade-out":"v2-fade-in"),onClick:t,onMouseDown:j=>j.stopPropagation()}),i.jsx("div",{role:s,"aria-modal":"true","aria-labelledby":o,"aria-describedby":l,className:T("relative z-10 flex flex-col overflow-hidden rounded-xl border border-border bg-card shadow-panel",g?"v2-dialog-out":"v2-dialog-in",r),onMouseDown:j=>j.stopPropagation(),onAnimationEnd:b,children:a})]})}const hl=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||navigator.userAgent),Sw=hl?"⌘":"Ctrl",pf=hl?"⏎":"Enter",Nw=hl?"⇧":"Shift",Ew=hl?"⌫":"Backspace",Cw=[{group:"Global",rows:[{keys:[Sw,"B"],label:"Toggle sidebar"},{keys:["?"],label:"Open this cheat-sheet"}]},{group:"Composer",rows:[{keys:[pf],label:"Send"},{keys:[Nw,pf],label:"New line"},{keys:["/"],label:"Slash commands & prompts"},{keys:["@"],label:"Mention a file"}]},{group:"Messages",rows:[{keys:[Ew],label:"Remove loaded prompt card",note:"when a preset card is staged"}]}];function _w({open:e,onClose:t}){return i.jsxs(jc,{open:e,onClose:t,className:"mx-4 w-full max-w-md",ariaLabelledBy:"kbd-shortcuts-title",children:[i.jsxs("header",{className:"flex h-[44px] items-center justify-between border-b border-border-soft px-4",children:[i.jsx("h2",{id:"kbd-shortcuts-title",className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Keyboard shortcuts"}),i.jsxs("span",{className:"text-[11.5px] text-muted-foreground",children:["Press ",i.jsx(St,{children:"Esc"})," to close"]})]}),i.jsx("div",{className:"flex flex-col gap-4 overflow-y-auto p-4",children:Cw.map(n=>i.jsxs("section",{className:"flex flex-col gap-1.5",children:[i.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-[0.04em] text-muted-foreground",children:n.group}),i.jsx("ul",{className:"flex flex-col gap-1",children:n.rows.map((r,s)=>i.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md px-1 py-1",children:[i.jsxs("div",{className:"flex min-w-0 flex-col",children:[i.jsx("span",{className:"truncate text-[12.5px] text-foreground",children:r.label}),r.note&&i.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:r.note})]}),i.jsx("span",{className:"flex shrink-0 items-center gap-1",children:r.keys.map(o=>i.jsx(St,{children:o},o))})]},s))})]},n.group))})]})}let hf=0,Tw=0;function Pw(e){const t=gr(n=>n.pushToast);y.useEffect(()=>fe.on(r=>{if(r.type==="error"){const s=r.command?`${r.command}: ${r.message}`:r.message;t({id:`wserr-${++hf}`,workspaceId:e??"",message:s,notifyType:"error"});return}r.type==="event"&&r.payload.kind==="agent_end"&&r.payload.error&&r.workspaceId===e&&t({id:`wserr-${++hf}`,workspaceId:e??"",message:r.payload.error,notifyType:"error"})}),[t,e])}function Rw(){const e=gr(t=>t.pushToast);y.useEffect(()=>fe.on(n=>{if(n.type!=="extension_error")return;const r=Lw(n.extensionPath);e({id:`exterr-${++Tw}`,workspaceId:n.workspaceId,message:`${r}: ${n.event}: ${n.message}`,notifyType:"error"})}),[e])}function Mw(e){const t=gr(n=>n.pushToast);y.useEffect(()=>{},[t,e])}function Lw(e){if(!e)return"extension";const t=e.replace(/\/+$/,""),n=t.split("/"),r=n.at(-1)||t;return/^(index|extension)\.(ts|js|mjs|cjs)$/.test(r)&&n.length>=2?n[n.length-2]:r.replace(/\.(ts|js|mjs|cjs)$/,"")}function Ow(){const e=gr(n=>n.toasts),t=gr(n=>n.dismissToast);return i.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-40 flex w-72 flex-col gap-2",children:e.map(n=>i.jsx(Iw,{toast:n,onClose:()=>t(n.id)},n.id))})}function Iw({toast:e,onClose:t}){y.useEffect(()=>{const s=e.notifyType==="error"?8e3:4e3,o=setTimeout(t,s);return()=>clearTimeout(o)},[t,e.notifyType]);const n=e.notifyType==="error"||e.notifyType==="warning"?uo:e.notifyType==="info"?p0:s0,r=e.notifyType==="error"?"border-l-signal-error text-signal-error":e.notifyType==="warning"?"border-l-signal-warn text-signal-warn":"border-l-brand text-foreground";return i.jsxs("div",{className:T("pointer-events-auto flex items-start gap-2 rounded-[10px] border border-border bg-card p-3 text-[12.5px] shadow-glow-lg","border-l-[3px]",r),children:[i.jsx(n,{className:T("mt-0.5 h-3.5 w-3.5 shrink-0",e.notifyType==="info"&&"text-brand")}),i.jsx("div",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-foreground",children:e.message}),i.jsx("button",{type:"button",onClick:t,className:"text-muted-foreground transition-colors hover:text-foreground","aria-label":"Dismiss",children:i.jsx(mc,{className:"h-3 w-3"})})]})}const Po=["workspaces"];function Aw(){return Tt({queryKey:Po,queryFn:()=>G("/api/workspaces").then(e=>e.workspaces)})}function Dw(){const e=oe();return ye({mutationFn:async t=>(await G("/api/workspaces",{method:"POST",body:JSON.stringify(t)})).workspace,onSuccess:()=>e.invalidateQueries({queryKey:Po})})}function Fw(){const e=oe();return ye({mutationFn:t=>G(`/api/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:Po})})}function zw(){const e=oe();return ye({mutationFn:async t=>(await G("/api/workspaces/reorder",{method:"PUT",body:JSON.stringify(t)})).workspaces,onSuccess:t=>{e.setQueryData(Po,t)}})}function Jb(){const e=oe();return ye({mutationFn:async({id:t,trustProjectAgents:n})=>(await G(`/api/workspaces/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({trustProjectAgents:n})})).workspace,onSuccess:t=>{e.setQueryData(Po,n=>n==null?void 0:n.map(r=>r.id===t.id?t:r))}})}function Uw({open:e,initialPath:t,onClose:n,onPick:r,error:s,busy:o}){const[l,a]=y.useState(t),[u,c]=y.useState(t??""),[p,h]=y.useState(!1),{data:d,isFetching:w,error:b}=Ev(l,p,e),g=d==null?void 0:d.path;y.useEffect(()=>{g&&g!==l&&(a(g),c(g))},[g,l]),y.useEffect(()=>{e&&(a(t),c(t??""))},[e,t]);const j=(d==null?void 0:d.path)??l??"",f=s??(b instanceof Error?b.message:void 0);return i.jsxs(jc,{open:e,onClose:n,className:"m-4 h-[32rem] w-full max-w-2xl",children:[i.jsxs("header",{className:"flex items-center justify-between border-b border-border/70 bg-card/40 px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[i.jsx(hc,{className:"h-4 w-4 text-brand"}),"Add workspace"]}),i.jsx("button",{type:"button",onClick:n,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground ring-brand-focus","aria-label":"Close",children:i.jsx(mc,{className:"h-4 w-4"})})]}),i.jsx($w,{value:u,onChange:c,onSubmit:()=>{const m=u.trim();m&&a(m)}}),i.jsx(qw,{path:j,onJump:a}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx(Bw,{entries:(d==null?void 0:d.entries)??[],parent:(d==null?void 0:d.parent)??null,loading:w&&!d,error:b instanceof Error&&!d?b.message:void 0,onEnter:a})}),i.jsxs("footer",{className:"border-t border-border/70 bg-card/40 px-4 py-3",children:[i.jsxs("label",{className:"mb-2 flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("input",{type:"checkbox",checked:p,onChange:m=>h(m.target.checked),className:"h-3.5 w-3.5 accent-[hsl(var(--brand))]"}),"Show hidden directories"]}),i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("p",{className:"flex-1 truncate font-mono text-xs text-foreground",children:j||"—"}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx("button",{type:"button",onClick:n,className:"rounded-md px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground ring-brand-focus",children:"Cancel"}),i.jsxs("button",{type:"button",disabled:!j||o,onClick:()=>void r(j),className:T("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ring-brand-focus",!j||o?"bg-muted text-muted-foreground/70 cursor-not-allowed":"bg-brand text-brand-foreground hover:bg-brand-strong shadow-glow-sm"),children:[o&&i.jsx(mr,{className:"h-3 w-3 animate-spin"}),"Add this folder"]})]})]}),f&&i.jsx("p",{className:"mt-2 rounded-md border border-error-ghost bg-error-ghost px-2 py-1 text-xs text-signal-error",children:f})]})]})}function $w({value:e,onChange:t,onSubmit:n}){const r=y.useRef(null);return y.useEffect(()=>{var s;(s=r.current)==null||s.focus()},[]),i.jsx("div",{className:"border-b border-border/70 bg-background/30 px-4 py-2",children:i.jsx("input",{ref:r,type:"text",value:e,onChange:s=>t(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),n())},placeholder:"/absolute/path (Enter to jump)",className:"w-full rounded-md border border-input bg-card/60 px-2.5 py-1.5 font-mono text-xs text-foreground outline-none transition-colors focus:border-brand/40 focus:ring-1 focus:ring-brand/40"})})}function qw({path:e,onJump:t}){const n=y.useMemo(()=>Qw(e),[e]);return i.jsxs("nav",{className:"flex items-center gap-0.5 overflow-x-auto border-b border-border/70 bg-background/20 px-3 py-1.5 text-xs",children:[n.length===0&&i.jsx("span",{className:"text-muted-foreground",children:"—"}),n.map((r,s)=>i.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[i.jsx("button",{type:"button",onClick:()=>t(r.path),className:"rounded px-1.5 py-0.5 text-foreground/90 transition-colors hover:bg-accent hover:text-foreground",children:r.label}),s<n.length-1&&i.jsx(fc,{className:"h-3 w-3 text-muted-foreground"})]},r.path))]})}function Bw({entries:e,parent:t,loading:n,error:r,onEnter:s}){return n?i.jsxs("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:[i.jsx(mr,{className:"mr-2 h-3 w-3 animate-spin"}),"Loading…"]}):r?i.jsx("div",{className:"p-4 text-xs text-signal-error",children:r}):i.jsxs("ul",{className:"p-1.5",children:[t&&i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>s(t),className:mf,children:[i.jsx(iu,{className:"h-4 w-4 shrink-0 opacity-70"}),i.jsx("span",{className:"text-muted-foreground",children:".. (parent)"})]})}),e.length===0&&i.jsx("li",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"(no subdirectories)"}),e.map(o=>i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>s(o.path),className:mf,children:[i.jsx(hc,{className:"h-4 w-4 shrink-0 text-brand/70 opacity-80"}),i.jsx("span",{className:"truncate",children:o.name})]})},o.path))]})}const mf=T("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm","text-foreground/90 transition-colors hover:bg-accent hover:text-foreground");function Qw(e){if(!e)return[];const t=e.split("/").filter(Boolean),n=[{label:"/",path:"/"}];let r="";for(const s of t)r+=`/${s}`,n.push({label:s,path:r});return n}function Hw({size:e=28,running:t=!1,filled:n,className:r,title:s="pi-pilot"}){const o=n??t;return i.jsx("span",{role:"img","aria-label":s,title:s,className:T("inline-flex shrink-0 items-center justify-center rounded-full",o?"bg-brand text-[hsl(var(--brand-foreground))] border border-brand":"bg-card text-brand border border-border-hi",r),style:{width:e,height:e,fontFamily:'"Instrument Serif", "Times New Roman", serif',fontSize:Math.round(e*.5),fontStyle:"italic",lineHeight:1,letterSpacing:"-0.02em"},children:"π"})}function Vw({className:e}){return i.jsx("span",{className:T("font-sans text-[15px] font-medium tracking-[-0.01em] text-foreground",e),children:"pi-pilot"})}const Zl=e=>typeof e=="function"?e():e;function Ww({storageKey:e,defaultWidth:t,min:n,max:r,side:s="right",enabled:o=!0,onResizeEnd:l}){const[a,u]=y.useState(()=>{try{const S=localStorage.getItem(e);if(S){const N=parseInt(S,10);if(!isNaN(N)&&N>=n&&N<=Zl(r))return N}}catch{}return t}),[c,p]=y.useState(!1),h=y.useRef(!1),d=y.useRef(0),w=y.useRef(a),b=y.useRef(a),g=y.useRef(a),j=y.useRef(Zl(r)),f=y.useRef(s),m=y.useRef(n),x=y.useRef(l);y.useEffect(()=>{f.current=s,m.current=n,x.current=l},[s,n,l]),y.useEffect(()=>{b.current=a},[a]),y.useEffect(()=>{if(!o)return;const S=()=>{const N=Zl(r);j.current=N,u(E=>Math.min(E,N))};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[o,r]),y.useEffect(()=>{if(!c)try{localStorage.setItem(e,String(a))}catch{}},[a,c,e]);const k=y.useCallback(S=>{S.preventDefault(),h.current=!0,p(!0),d.current=S.clientX,w.current=b.current,g.current=b.current,document.documentElement.classList.add("is-col-resizing")},[]),C=y.useCallback(()=>{u(t)},[t]);return y.useEffect(()=>{if(!o)return;const S=E=>{if(!h.current)return;const _=f.current==="left"?d.current-E.clientX:E.clientX-d.current,R=w.current+_;g.current=R,u(Math.max(m.current,Math.min(j.current,R)))},N=()=>{var E;h.current&&(h.current=!1,p(!1),document.documentElement.classList.remove("is-col-resizing"),(E=x.current)==null||E.call(x,g.current))};return document.addEventListener("mousemove",S),document.addEventListener("mouseup",N),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",N),h.current&&(h.current=!1,document.documentElement.classList.remove("is-col-resizing"))}},[o]),{width:a,isResizing:c,onMouseDown:k,onDoubleClick:C}}function Kw({open:e,title:t,message:n,confirmLabel:r="Confirm",cancelLabel:s="Cancel",variant:o="default",onConfirm:l,onCancel:a}){const u=y.useRef(null),c=y.useRef(null);y.useEffect(()=>{if(e)c.current=document.activeElement,requestAnimationFrame(()=>{var h;return(h=u.current)==null?void 0:h.focus()});else if(c.current){const h=c.current;c.current=null,h.isConnected&&h.focus()}},[e]),y.useEffect(()=>{if(!e)return;const h=d=>{d.key==="Enter"&&(d.preventDefault(),d.stopPropagation(),l())};return document.addEventListener("keydown",h,!0),()=>document.removeEventListener("keydown",h,!0)},[e,l]);const p=o==="danger";return i.jsxs(jc,{open:e,onClose:a,zIndex:200,role:"alertdialog",ariaLabelledBy:"confirm-dialog-title",ariaDescribedBy:"confirm-dialog-message",className:"mx-4 w-full max-w-sm",children:[i.jsx("div",{className:"px-5 pt-5 pb-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[p&&i.jsx("span",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-error-subtle",children:i.jsx(uo,{className:"h-4 w-4 text-signal-error"})}),i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[i.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-foreground",children:t}),i.jsx("p",{id:"confirm-dialog-message",className:"whitespace-pre-line text-[13px] leading-relaxed text-muted-foreground",children:n})]})]})}),i.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border bg-muted/40 px-5 py-3",children:[s!==null&&i.jsx("button",{type:"button",onClick:a,className:T("rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors","border border-border bg-card text-foreground/80","hover:bg-accent hover:text-foreground","focus:outline-none focus:ring-2 focus:ring-brand/40"),children:s}),i.jsx("button",{ref:u,type:"button",onClick:l,className:T("rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors","focus:outline-none focus:ring-2",p?"bg-signal-error text-white hover:bg-signal-error/90 focus:ring-signal-error/40":"bg-brand text-brand-foreground hover:bg-brand-strong focus:ring-brand/40"),children:r})]})]})}const Im=y.createContext(null);function Am(){const e=y.useContext(Im);if(!e)throw new Error("useConfirm must be used within a <ConfirmProvider />");return e}function Gw({children:e}){const[t,n]=y.useState(null),r=y.useRef(null),s=y.useCallback(l=>(r.current&&(r.current(!1),r.current=null),new Promise(a=>{r.current=a,n({...l,open:!0})})),[]),o=y.useCallback(l=>{var a;n(u=>u?{...u,open:!1}:null),(a=r.current)==null||a.call(r,l),r.current=null},[]);return i.jsxs(Im.Provider,{value:s,children:[e,i.jsx(Kw,{open:(t==null?void 0:t.open)??!1,title:(t==null?void 0:t.title)??"",message:(t==null?void 0:t.message)??"",confirmLabel:t==null?void 0:t.confirmLabel,cancelLabel:t==null?void 0:t.cancelLabel,variant:t==null?void 0:t.variant,onConfirm:()=>o(!0),onCancel:()=>o(!1)})]})}const Yw=()=>Math.min(window.innerWidth*.6,500);function Xw({activeId:e,onSelect:t,onSelectSession:n,onNewSession:r,collapsed:s,onToggleCollapse:o,onOpenSettings:l}){const{data:a,isLoading:u}=Aw(),c=oe(),p=Dw(),h=Fw(),d=zw(),w=Am(),[b,g]=y.useState(!1),[j,f]=y.useState(void 0),[m,x]=y.useState(new Set),{width:k,isResizing:C,onMouseDown:S,onDoubleClick:N}=Ww({storageKey:sv,defaultWidth:rv,min:ov,max:Yw,side:"right",onResizeEnd:H=>{H<iv&&!s&&o()}}),E=y.useCallback(H=>{c.prefetchQuery(Qh(H))},[c]),_=y.useCallback(H=>{x(ve=>{const we=new Set(ve);return we.has(H)?we.delete(H):we.add(H),we})},[]),R=y.useRef(w);R.current=w;const $=y.useRef(h);$.current=h;const U=y.useCallback(async(H,ve)=>{await R.current({title:"Remove workspace",message:`Remove "${ve}" from the list? (Files are not deleted.)`,confirmLabel:"Remove",variant:"danger"})&&$.current.mutateAsync(H)},[]),me=V(H=>H.running),ce=V(H=>H.sessionPath),[Se,Fe]=y.useState(null),[it,M]=y.useState(null),[A,z]=y.useState(null),Q=y.useRef(null),Z=y.useRef(null),lt=y.useRef(null),[Me,Ut]=y.useState(null),Qe=y.useRef(0),_e=y.useMemo(()=>{if(!a)return;if(!Me)return a;const H=new Map(a.map(at=>[at.id,at])),ve=new Set(Me),we=[];for(const at of Me){const $t=H.get(at);$t&&we.push($t)}for(const at of a)ve.has(at.id)||we.push(at);return we},[a,Me]),D=y.useCallback(H=>{Q.current=H,Fe(H)},[]),ie=y.useCallback(()=>{Q.current=null,Z.current=null,lt.current=null,Fe(null),M(null),z(null)},[]),ps=y.useCallback((H,ve)=>{const we=Q.current;!we||H===we||(Z.current=H,lt.current=ve,M(H),z(ve))},[]),ml=y.useCallback(()=>{const H=Q.current,ve=Z.current,we=lt.current;if(!H||!ve||!we||!a)return;const $t=[...Me??a.map(Fm=>Fm.id)],Sc=$t.indexOf(H);if(Sc===-1)return;$t.splice(Sc,1);let Nc=$t.indexOf(ve);we==="after"&&(Nc+=1),$t.splice(Nc,0,H);const Ec=++Qe.current;Ut($t),d.mutate({ids:$t},{onSuccess:()=>{Qe.current===Ec&&Ut(null)},onError:()=>{Qe.current===Ec&&Ut(null)}}),Q.current=null,Z.current=null,lt.current=null,Fe(null),M(null),z(null)},[a,Me,d]),Hn=y.useCallback(()=>{Z.current=null,lt.current=null,M(null),z(null)},[]),Ro=async H=>{f(void 0);try{const ve=await p.mutateAsync({path:H});g(!1),t(ve.id)}catch(ve){f(ve instanceof Error?ve.message:String(ve))}},Mo=(_e==null?void 0:_e.length)??0,gl=s?56:k;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:T("relative h-full shrink-0",!C&&"transition-[width] duration-300 ease-out"),style:{width:`${gl}px`},children:[i.jsx("div",{className:"absolute inset-0 overflow-clip border-r border-border",children:i.jsxs("aside",{className:"flex h-full flex-col overflow-hidden bg-background will-change-transform",style:{width:`${k}px`,contain:"layout style"},children:[i.jsxs("header",{className:"flex h-[54px] shrink-0 items-center",children:[i.jsx("div",{className:"flex h-full w-[56px] shrink-0 items-center justify-center",children:i.jsx(Hw,{size:28,filled:me})}),i.jsx("div",{className:T("flex min-w-0 flex-1 items-center pr-3 transition-opacity duration-200 ease-out",s?"opacity-0":"opacity-100"),children:i.jsx(Vw,{})})]}),i.jsxs("div",{className:"relative flex h-[40px] shrink-0 items-center",children:[i.jsxs("div",{className:T("flex w-full items-center justify-between px-4 transition-opacity duration-200 ease-out",s?"pointer-events-none opacity-0":"opacity-100"),children:[i.jsxs("h2",{className:"m-0 flex items-center gap-1.5 whitespace-nowrap text-[10.5px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/70",children:["Workspaces",Mo>0&&i.jsx("span",{className:"rounded-full bg-muted px-1.5 py-px text-[10px] font-medium tabular-nums leading-none text-muted-foreground/80",children:Mo})]}),i.jsxs("button",{type:"button",tabIndex:s?-1:0,onClick:()=>{f(void 0),g(!0)},className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[12px] text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:[i.jsx("span",{className:"text-[15px] leading-none text-brand",children:"+"}),i.jsx("span",{children:"Add"})]})]}),i.jsx("div",{className:T("absolute inset-y-0 left-0 flex w-[56px] items-center justify-center transition-opacity duration-200 ease-out",s?"opacity-100":"pointer-events-none opacity-0"),children:i.jsx("button",{type:"button",tabIndex:s?0:-1,onClick:()=>{f(void 0),g(!0)},className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-[16px] leading-none text-brand transition-colors hover:bg-accent/70",title:"Add workspace","aria-label":"Add workspace",children:"+"})})]}),i.jsxs("ul",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overflow-x-hidden px-2 pb-3",onDragLeave:Hn,children:[i.jsx(gf,{show:!!u,collapsed:s,label:"Loading…"}),i.jsx(gf,{show:!u&&(_e==null?void 0:_e.length)===0,collapsed:s,label:"No workspaces yet",variant:"dashed"}),_e==null?void 0:_e.map(H=>i.jsx(Jw,{id:H.id,name:H.name,active:e===H.id,hasActiveSession:e===H.id&&!!ce,expanded:m.has(H.id),collapsed:s,isDragging:Se===H.id,showDropBefore:it===H.id&&A==="before",showDropAfter:it===H.id&&A==="after",onSelect:t,onToggleExpand:_,onSelectSession:n,onNewSession:r,onDeleteWorkspace:U,onPrefetch:E,onDragStart:D,onDragOver:ps,onDragEnd:ie,onDrop:ml},H.id))]}),i.jsx(nb,{collapsed:s,onOpenSettings:l})]})}),!s&&i.jsx("div",{onMouseDown:S,onDoubleClick:N,className:T("absolute right-0 top-0 z-30 h-full w-px cursor-col-resize","bg-transparent hover:bg-brand/60 transition-colors",C&&"bg-brand"),"aria-label":"Resize sidebar",title:"Drag to resize · double-click to reset",children:i.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2"})}),i.jsx("button",{type:"button",onClick:o,className:"absolute right-0 top-1/2 z-40 -translate-y-1/2 translate-x-1/2 rounded-full border border-border bg-card p-1 text-muted-foreground shadow-glow transition-colors hover:text-foreground","aria-label":s?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",title:s?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",children:s?i.jsx(fc,{className:"h-3.5 w-3.5"}):i.jsx(r0,{className:"h-3.5 w-3.5"})})]}),i.jsx(Uw,{open:b,onClose:()=>g(!1),onPick:Ro,error:j,busy:p.isPending})]})}function gf({show:e,collapsed:t,label:n,variant:r}){return e?i.jsx("li",{className:T("overflow-hidden text-center text-[12px] text-muted-foreground","transition-[opacity,max-height,margin,padding] duration-300 ease-out",r==="dashed"&&"rounded-lg border border-dashed border-border-soft bg-background/60",t?"pointer-events-none my-0 max-h-0 py-0 opacity-0":r==="dashed"?"mt-1 max-h-[80px] px-3 py-5 opacity-100":"max-h-[40px] px-3 py-2 opacity-100"),children:n}):null}const Jw=y.memo(function({id:t,name:n,active:r,hasActiveSession:s,expanded:o,collapsed:l,isDragging:a,showDropBefore:u,showDropAfter:c,onSelect:p,onToggleExpand:h,onSelectSession:d,onNewSession:w,onDeleteWorkspace:b,onPrefetch:g,onDragStart:j,onDragOver:f,onDragEnd:m,onDrop:x}){return i.jsxs("li",{className:T("group/ws relative",a&&"opacity-40"),draggable:!l,onMouseEnter:()=>g(t),onDragStart:k=>{j(t),k.dataTransfer.effectAllowed="move",k.dataTransfer.setData("text/plain",t)},onDragOver:k=>{k.preventDefault(),k.dataTransfer.dropEffect="move";const C=k.currentTarget.getBoundingClientRect(),S=C.top+C.height/2;f(t,k.clientY<S?"before":"after")},onDragLeave:()=>{},onDrop:k=>{k.preventDefault(),x()},onDragEnd:m,children:[u&&i.jsx("span",{className:"pointer-events-none absolute inset-x-1 top-0 z-10 h-[2px] rounded-full bg-brand"}),i.jsxs("div",{className:"relative flex h-[30px] items-center",children:[r&&!l&&!s&&i.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-1/2 z-10 h-[16px] w-[2px] -translate-y-1/2 rounded-full bg-brand"}),i.jsxs("button",{type:"button",onClick:()=>{r||p(t),h(t)},title:l?n:void 0,"aria-label":n,className:T("flex h-full w-full items-center rounded-md pr-2 text-left text-[13px] transition-colors",r?T(s?"text-foreground/90":"font-medium text-foreground",!l&&"hover:bg-accent/30"):"text-muted-foreground hover:text-foreground",!l&&!r&&"hover:bg-accent/30"),children:[i.jsx("span",{className:"flex h-full w-[40px] shrink-0 items-center justify-center",children:i.jsx("span",{className:T("flex h-7 w-7 items-center justify-center rounded-md transition-colors",l&&(r?"bg-accent/60 text-brand":"group-hover/ws:bg-accent/40")),children:i.jsx(hc,{className:T("h-[14px] w-[14px] transition-colors",r?"text-brand opacity-100":"opacity-70")})})}),i.jsx("span",{className:T("min-w-0 flex-1 truncate pr-1.5 transition-opacity duration-300 ease-out",l?"pointer-events-none opacity-0":"opacity-100"),children:n}),!l&&i.jsx(To,{className:T("h-3 w-3 shrink-0 opacity-40 transition-transform duration-200",!o&&"-rotate-90")})]}),!l&&i.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),w(t)},title:"New session","aria-label":"New session",className:"absolute right-6 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground opacity-40 transition-[opacity,background,color] hover:bg-accent/70 hover:text-foreground hover:opacity-100",children:i.jsx(m0,{className:"h-3.5 w-3.5"})})]}),i.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),b(t,n)},className:T("pointer-events-none absolute right-2 top-[15px] -translate-y-1/2 rounded p-0.5 text-muted-foreground transition-opacity duration-150","opacity-0 hover:bg-error-ghost hover:text-signal-error",!l&&"group-hover/ws:pointer-events-auto group-hover/ws:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100"),"aria-label":"Remove workspace",title:"Remove workspace",tabIndex:l?-1:0,children:i.jsx(Yh,{className:"h-3 w-3"})}),i.jsx(Zw,{workspaceId:t,expanded:o,collapsed:l,onSelectSession:d}),c&&i.jsx("span",{className:"pointer-events-none absolute inset-x-1 bottom-0 z-10 h-[2px] rounded-full bg-brand"})]})}),xf=5;function Zw({workspaceId:e,expanded:t,collapsed:n,onSelectSession:r}){const s=t&&!n,[o,l]=y.useState(!1),[a,u]=y.useState(!1);if(y.useEffect(()=>{if(!s){u(!1);return}l(!0),u(!1);const p=requestAnimationFrame(()=>{requestAnimationFrame(()=>u(!0))});return()=>cancelAnimationFrame(p)},[s]),!o)return null;const c=a&&s;return i.jsx("div",{className:T("grid ease-out transition-[grid-template-rows,opacity] duration-200",c?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),...c?void 0:{inert:""},children:i.jsx("div",{className:"min-h-0 overflow-hidden",children:i.jsx(eb,{workspaceId:e,onSelectSession:r})})})}function eb({workspaceId:e,onSelectSession:t}){const{data:n,isLoading:r}=Qy(e),s=Hy(e),o=Am(),l=V(d=>d.sessionPath),[a,u]=y.useState(xf),c=y.useCallback(async d=>{if(s.isPending)return;const w=ti(d);await o({title:"Delete session",message:`Delete session "${w}"? This cannot be undone.`,confirmLabel:"Delete",variant:"danger"})&&s.mutate(d.path,{onError:async g=>{await o({title:"Delete failed",message:`Failed to delete session: ${g.message}`,confirmLabel:"OK",cancelLabel:null})}})},[o,s]),p=(n==null?void 0:n.slice(0,a))??[],h=((n==null?void 0:n.length)??0)>a;return r&&!n?i.jsx("div",{className:"flex flex-col gap-0.5 pb-1",children:Array.from({length:3}).map((d,w)=>i.jsx("div",{className:"flex h-[28px] items-center pl-10 pr-6",children:i.jsx("div",{className:"h-2.5 w-full animate-pulse rounded bg-muted/60"})},w))}):i.jsxs("div",{className:"pb-1",children:[p.map(d=>{const w=d.path===l,b=s.isPending&&s.variables===d.path;return i.jsxs("div",{className:"group/session relative",children:[i.jsxs("button",{type:"button",onClick:()=>{w||t(e,d.path)},title:ti(d),className:T("relative flex h-[28px] w-full items-center gap-1.5 rounded-md pl-10 pr-6 text-left text-[12.5px] transition-colors",w?"font-medium text-foreground":"text-muted-foreground hover:bg-accent/30 hover:text-foreground"),children:[d.running?i.jsx("span",{title:"Running",className:"absolute left-[20px] top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-brand animate-v2-pulse"}):w?i.jsx("span",{className:"absolute left-[20px] top-1/2 h-[14px] w-[2px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-brand"}):i.jsx("span",{className:"absolute left-[20px] top-1/2 -translate-x-1/2 -translate-y-1/2 text-[6px] leading-none opacity-40",children:"●"}),i.jsx("span",{className:"truncate",children:ti(d)})]}),!w&&i.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),c(d)},disabled:s.isPending,title:"Delete session","aria-label":`Delete session ${ti(d)}`,className:T("absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground transition-opacity","hover:bg-error-ghost hover:text-signal-error",b?"opacity-100":"opacity-0 group-hover/session:opacity-100"),children:b?i.jsx(mr,{className:"h-3 w-3 animate-spin"}):i.jsx(Yh,{className:"h-3 w-3"})})]},d.path)}),h&&i.jsx("button",{type:"button",onClick:()=>u(d=>d+xf),className:"flex h-[26px] w-full items-center pl-10 pr-2 text-[12px] text-muted-foreground/60 transition-colors hover:text-muted-foreground",children:"See more"})]})}function ti(e){return e.name?e.name:e.preview?e.preview:tb(e.path)}function tb(e){return e.split("/").at(-1)??e}function nb({collapsed:e,onOpenSettings:t}){return i.jsxs("footer",{className:"relative flex h-[40px] shrink-0 items-center gap-2 border-t border-border-soft px-4",children:[i.jsxs("div",{className:T("flex w-full items-center gap-2 text-[11.5px] text-muted-foreground transition-opacity duration-200 ease-out",e?"pointer-events-none opacity-0":"opacity-100"),children:[i.jsx(ev,{state:"online"}),i.jsx("span",{children:"Online"}),i.jsx("span",{className:"flex-1"}),i.jsx("button",{type:"button",tabIndex:e?-1:0,onClick:t,title:"Settings","aria-label":"Settings",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:i.jsx(Hd,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:T("absolute inset-y-0 left-0 flex w-[56px] items-center justify-center transition-opacity duration-200 ease-out",e?"opacity-100":"pointer-events-none opacity-0"),children:i.jsx("button",{type:"button",tabIndex:e?0:-1,onClick:t,title:"Settings","aria-label":"Settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:i.jsx(Hd,{className:"h-3.5 w-3.5"})})})]})}const rb=y.lazy(()=>F(()=>import("./SettingsPage-D84YbQn7.js"),__vite__mapDeps([22,23,24])).then(e=>({default:e.SettingsPage}))),sb=y.lazy(()=>F(()=>import("./ResourcesPanel-D-VhpjYO.js"),__vite__mapDeps([25,23,26,24])).then(e=>({default:e.ResourcesPanel}))),ob=y.lazy(()=>F(()=>import("./SessionTree-C9twS6vi.js"),__vite__mapDeps([27,23,26,24])).then(e=>({default:e.SessionTree}))),ib=y.lazy(()=>F(()=>import("./ArtifactsPanel-54DnCPD8.js"),__vite__mapDeps([28,23,26,24])).then(e=>({default:e.ArtifactsPanel}))),lb=y.lazy(()=>F(()=>import("./FilesPanel-CdZRy4b8.js"),__vite__mapDeps([29,23,26,24])).then(e=>({default:e.FilesPanel}))),ab=y.lazy(()=>F(()=>import("./TerminalPanel-DgOiuHnT.js"),__vite__mapDeps([30,23,24,31])).then(e=>({default:e.TerminalPanel})));function ni(){return i.jsxs("div",{className:"flex h-full w-[320px] shrink-0 flex-col border-l border-border bg-popover",children:[i.jsx("div",{className:"h-[44px] border-b border-border-soft"}),i.jsxs("div",{className:"space-y-2 p-3",children:[i.jsx(yn,{className:"h-6 w-20 rounded-md"}),Array.from({length:5}).map((e,t)=>i.jsx(yn,{className:"h-12 w-full rounded-[10px]"},t))]})]})}function ub(){return i.jsxs("div",{className:"flex h-full w-full bg-background",children:[i.jsxs("nav",{className:"flex shrink-0 flex-col border-r border-border bg-popover",style:{width:272},children:[i.jsx("header",{className:"flex h-[60px] shrink-0 items-center px-3"}),i.jsx("div",{className:"flex flex-col gap-1 px-2 py-1",children:Array.from({length:4}).map((e,t)=>i.jsx(yn,{className:"h-9 w-full rounded-lg"},t))})]}),i.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[i.jsx("header",{className:"flex h-[60px] shrink-0 items-center border-b border-border-soft px-8",children:i.jsx(yn,{className:"h-4 w-28"})}),i.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-4 px-8 py-6",children:[i.jsx(yn,{className:"h-16 w-full rounded-lg"}),i.jsx(yn,{className:"h-24 w-full rounded-lg"}),i.jsx(yn,{className:"h-16 w-full rounded-lg"})]})]})]})}function cb(){const[e,t]=y.useState(void 0),[n,r]=y.useState(!1),[s,o]=y.useState("chat"),[l,a]=y.useState(void 0),u=po(N=>N.panels),c=po(N=>N.closePanel),p=u.includes("terminal"),h=u.some(N=>N!=="terminal"),[d,w]=y.useState(!1);y.useEffect(()=>{p&&w(!0)},[p]);const b=y.useRef(void 0),g=y.useCallback(N=>{const E=b.current;E&&V.getState().saveSnapshot(E),b.current=N},[]),j=y.useCallback(N=>{g(N),t(N),a(void 0)},[g]),f=y.useCallback((N,E)=>{g(N),t(N),a(_=>({path:E,nonce:((_==null?void 0:_.nonce)??0)+1}))},[g]),m=y.useCallback(N=>{g(N),t(N),a(void 0),fe.send({type:"new_session",workspaceId:N})},[g]);Pw(e),Rw(),By(),Jy(),Gy(),Mw(e);const x=y.useCallback(()=>{r(N=>!N)},[]),[k,C]=y.useState(!1);y.useEffect(()=>{const N=E=>{if((E.ctrlKey||E.metaKey)&&(E.key==="b"||E.key==="B")){E.preventDefault(),x();return}if(E.key==="?"&&!E.ctrlKey&&!E.metaKey&&!E.altKey){const _=document.activeElement,R=_==null?void 0:_.tagName;_ instanceof HTMLElement&&_.isContentEditable||R==="INPUT"||R==="TEXTAREA"||R==="SELECT"||(E.preventDefault(),C(U=>!U))}};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[x]);const S=s==="settings";return i.jsxs(Gw,{children:[i.jsx("div",{className:S?"contents":"hidden",children:i.jsx(y.Suspense,{fallback:i.jsx(ub,{}),children:i.jsx(rb,{workspaceId:e,onBack:()=>o("chat")})})}),i.jsxs("div",{className:S?"hidden":"flex h-full",children:[i.jsx(Xw,{activeId:e,onSelect:j,onSelectSession:f,onNewSession:m,collapsed:n,onToggleCollapse:x,onOpenSettings:()=>o("settings")}),i.jsx(vw,{workspaceId:e,sessionRequest:l},e??"none"),e&&(h||d)&&i.jsxs("div",{className:"flex h-full flex-col shrink-0",style:!h&&p?{width:nv}:void 0,children:[h&&i.jsxs("div",{className:"flex min-h-0 flex-1",children:[i.jsx(y.Suspense,{fallback:i.jsx(ni,{}),children:i.jsx(sb,{workspaceId:e,open:u.includes("resources"),onClose:()=>c("resources")},`res-${e}`)}),i.jsx(y.Suspense,{fallback:i.jsx(ni,{}),children:i.jsx(ob,{workspaceId:e,open:u.includes("tree"),onClose:()=>c("tree")},`tree-${e}`)}),i.jsx(y.Suspense,{fallback:i.jsx(ni,{}),children:i.jsx(ib,{open:u.includes("artifact"),onClose:()=>c("artifact")},`art-${e}`)}),i.jsx(y.Suspense,{fallback:i.jsx(ni,{}),children:i.jsx(lb,{workspaceId:e,open:u.includes("files"),onClose:()=>c("files")},`files-${e}`)})]}),d&&i.jsx(y.Suspense,{fallback:null,children:i.jsx(ab,{workspaceId:e,open:p,onClose:()=>c("terminal"),fill:!h},`term-${e}`)})]})]}),i.jsx(Ow,{}),i.jsx(_w,{open:k,onClose:()=>C(!1)})]})}class db extends y.Component{constructor(){super(...arguments);yt(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback:i.jsx(fb,{error:this.state.error,onReset:()=>this.setState({error:null})}):this.props.children}}function fb({error:e,onReset:t}){return i.jsx("div",{className:"flex h-full items-center justify-center bg-background text-foreground",children:i.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 p-8 text-center v2-hero-in",children:[i.jsx("span",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-error-ghost bg-error-subtle",children:i.jsx(uo,{className:"h-5 w-5 text-signal-error"})}),i.jsx("h1",{className:"text-[16px] font-semibold tracking-[-0.01em] text-foreground",children:"Something went wrong"}),i.jsx("p",{className:"max-w-[320px] text-[13.5px] leading-relaxed text-muted-foreground",children:e.message||"An unexpected error occurred."}),i.jsxs("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-card px-3.5 py-2 text-[13px] font-medium text-foreground transition-[color,background-color,border-color,transform] duration-200 hover:bg-accent hover:border-border-soft active:scale-[0.98] ring-brand-focus",children:[i.jsx(Gh,{className:"h-3.5 w-3.5"}),"Try again"]})]})})}const pb=new by({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:1,staleTime:5e3,gcTime:3e5}}}),Dm=document.getElementById("root");if(!Dm)throw new Error("missing #root");Ph(Dm).render(i.jsx(y.StrictMode,{children:i.jsx(ky,{client:pb,children:i.jsx(db,{children:i.jsx(cb,{})})})}));export{zy as $,Ab as A,lu as B,_o as C,jc as D,u0 as E,Ib as F,f0 as G,fl as H,br as I,T as J,fs as K,mr as L,Y as M,Wb as N,Xb as O,Mb as P,Hb as Q,Lb as R,rv as S,zb as T,Gb as U,Vb as V,kc as W,mc as X,Kb as Y,hu as Z,V as _,Fb as a,Am as a0,Cb as a1,kb as a2,Tb as a3,Nb as a4,cm as a5,gr as a6,Bb as a7,qb as a8,jb as a9,ye as aa,Eb as ab,Tt as ac,oe as ad,Zy as ae,Ww as af,Vh as ag,Cv as ah,vb as ai,wb as aj,Uy as ak,$y as al,yb as am,Jb as an,bb as ao,bm as ap,_b as aq,Sb as ar,Aw as as,Qb as at,Yb as au,l1 as av,fe as aw,Db as b,fo as c,To as d,r0 as e,fc as f,i0 as g,pc as h,hc as i,Rb as j,h0 as k,he as l,m0 as m,Gh as n,sv as o,Qv as p,Hd as q,yn as r,Pb as s,y0 as t,$b as u,Ub as v,Ob as w,ln as x,Yh as y,G as z};
|