cc-viewer 1.6.94 → 1.6.95
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/assets/{App-CpDREOeV.js → App-D-Apw-as.js} +1 -1
- package/dist/assets/{AppHeader.module-CmeLfozP.js → AppHeader.module-DsVA04H2.js} +5 -5
- package/dist/assets/{Mobile-dzPMTNzK.js → Mobile-RajPnX3l.js} +1 -1
- package/dist/assets/{_basePickBy-DtCw5KGL.js → _basePickBy-BJEP1GYD.js} +1 -1
- package/dist/assets/{_baseUniq-ImoXbuWJ.js → _baseUniq-BubLHFZN.js} +1 -1
- package/dist/assets/{arc-DPeHTMnU.js → arc-DQ_H2ge5.js} +1 -1
- package/dist/assets/{architectureDiagram-2XIMDMQ5-CBXj01rK.js → architectureDiagram-2XIMDMQ5-DxzXyiQV.js} +1 -1
- package/dist/assets/{blockDiagram-WCTKOSBZ-D7wcf1pW.js → blockDiagram-WCTKOSBZ-Oko9Xh01.js} +1 -1
- package/dist/assets/{c4Diagram-IC4MRINW-BRPLIdn4.js → c4Diagram-IC4MRINW-BWMun8B6.js} +1 -1
- package/dist/assets/channel-JA0OGVbb.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-BXdgQxSh.js → chunk-4BX2VUAB-D4f3BBSj.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-CGjaWrfY.js → chunk-55IACEB6-DEELbrpC.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-mMdkjRFC.js → chunk-FMBD7UC4-BMDopkZI.js} +1 -1
- package/dist/assets/{chunk-JSJVCQXG-C6OK5M-I.js → chunk-JSJVCQXG-Bl2ge6LE.js} +1 -1
- package/dist/assets/{chunk-KX2RTZJC-AEEd0Ryd.js → chunk-KX2RTZJC-D6-v2Nwr.js} +1 -1
- package/dist/assets/{chunk-NQ4KR5QH-B-8p6H36.js → chunk-NQ4KR5QH-CPoQIkEQ.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-B-CVp8R8.js → chunk-QZHKN3VN-5ObFPC7D.js} +1 -1
- package/dist/assets/{chunk-WL4C6EOR-A-wxrsg9.js → chunk-WL4C6EOR-Brx2xle-.js} +1 -1
- package/dist/assets/classDiagram-VBA2DB6C-DBQK8T70.js +1 -0
- package/dist/assets/classDiagram-v2-RAHNMMFH-DBQK8T70.js +1 -0
- package/dist/assets/clone-B_6tGAmz.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-8lbzR16F.js → cose-bilkent-S5V4N54A-BtTL0awI.js} +1 -1
- package/dist/assets/{dagre-KLK3FWXG-DMayMOCq.js → dagre-KLK3FWXG-BnJdU6vj.js} +1 -1
- package/dist/assets/{diagram-E7M64L7V-ChHSZyAh.js → diagram-E7M64L7V-DqmlnmsM.js} +1 -1
- package/dist/assets/{diagram-IFDJBPK2-BwUoLoNA.js → diagram-IFDJBPK2-CSfBzoTw.js} +1 -1
- package/dist/assets/{diagram-P4PSJMXO-W3hHvhQv.js → diagram-P4PSJMXO-W_YBtuzb.js} +1 -1
- package/dist/assets/{erDiagram-INFDFZHY-ToaX7NX1.js → erDiagram-INFDFZHY-BrXGXwQp.js} +1 -1
- package/dist/assets/{flowDiagram-PKNHOUZH-D2ZMeP7M.js → flowDiagram-PKNHOUZH-D1qO_ftR.js} +1 -1
- package/dist/assets/{ganttDiagram-A5KZAMGK-B3G9qGij.js → ganttDiagram-A5KZAMGK-Dj8Dz895.js} +1 -1
- package/dist/assets/{gitGraphDiagram-K3NZZRJ6-DVPNEMEl.js → gitGraphDiagram-K3NZZRJ6-CbtCyig0.js} +1 -1
- package/dist/assets/{graph-7WxqTkFG.js → graph-BSyLsRRZ.js} +1 -1
- package/dist/assets/{index-BJPMV8pJ.js → index-JcYe5KP6.js} +2 -2
- package/dist/assets/{infoDiagram-LFFYTUFH-BpGp_HF2.js → infoDiagram-LFFYTUFH-Dt7Cxc1A.js} +1 -1
- package/dist/assets/{ishikawaDiagram-PHBUUO56-B5VsmnNJ.js → ishikawaDiagram-PHBUUO56-BATp1eBz.js} +1 -1
- package/dist/assets/{journeyDiagram-4ABVD52K-C2z-HVVr.js → journeyDiagram-4ABVD52K-Cuk87Qh1.js} +1 -1
- package/dist/assets/{kanban-definition-K7BYSVSG-BD5yr9Bu.js → kanban-definition-K7BYSVSG-dNdjELb5.js} +1 -1
- package/dist/assets/{layout-CE4RECIN.js → layout-ikzzHuR8.js} +1 -1
- package/dist/assets/{linear-D1KJlzdf.js → linear-BBrDskBJ.js} +1 -1
- package/dist/assets/{mermaid.core-CUfJ0HRg.js → mermaid.core-TSkGvSH8.js} +4 -4
- package/dist/assets/{mindmap-definition-YRQLILUH-DxHuRKwL.js → mindmap-definition-YRQLILUH-CtDrb2x9.js} +1 -1
- package/dist/assets/{pieDiagram-SKSYHLDU-D9WiCCJ-.js → pieDiagram-SKSYHLDU-bkNmBvtc.js} +1 -1
- package/dist/assets/{quadrantDiagram-337W2JSQ-CZ8WY2Jp.js → quadrantDiagram-337W2JSQ-Byl5XeRq.js} +1 -1
- package/dist/assets/{requirementDiagram-Z7DCOOCP-D0DF0apq.js → requirementDiagram-Z7DCOOCP-CZTVT8Rt.js} +1 -1
- package/dist/assets/{sankeyDiagram-WA2Y5GQK--FyELbOO.js → sankeyDiagram-WA2Y5GQK-xmaiO1U4.js} +1 -1
- package/dist/assets/{sequenceDiagram-2WXFIKYE-BCuHKjuI.js → sequenceDiagram-2WXFIKYE-DjXGcDqg.js} +1 -1
- package/dist/assets/{stateDiagram-RAJIS63D-Luke3XUg.js → stateDiagram-RAJIS63D-42-_6Ebg.js} +1 -1
- package/dist/assets/stateDiagram-v2-FVOUBMTO-Dk8cVTL7.js +1 -0
- package/dist/assets/{timeline-definition-YZTLITO2-5YJwGq5n.js → timeline-definition-YZTLITO2-DMCYajRr.js} +1 -1
- package/dist/assets/{treemap-KZPCXAKY-sJliY-5m.js → treemap-KZPCXAKY-BHYJalU8.js} +1 -1
- package/dist/assets/{vennDiagram-LZ73GAT5-BU34zfK3.js → vennDiagram-LZ73GAT5-DlJJRJ0l.js} +1 -1
- package/dist/assets/{xychartDiagram-JWTSCODW-ALa7ypHt.js → xychartDiagram-JWTSCODW-GeZvsPf-.js} +1 -1
- package/dist/index.html +1 -1
- package/lib/perm-bridge.js +10 -7
- package/lib/sdk-manager.js +7 -1
- package/package.json +1 -1
- package/dist/assets/channel-CIlWz43T.js +0 -1
- package/dist/assets/classDiagram-VBA2DB6C-CFFsxNG8.js +0 -1
- package/dist/assets/classDiagram-v2-RAHNMMFH-CFFsxNG8.js +0 -1
- package/dist/assets/clone-CKeKraNB.js +0 -1
- package/dist/assets/stateDiagram-v2-FVOUBMTO-BKK8D7Gx.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-
|
|
2
|
-
var dB=Object.defineProperty;var uB=(t,e,n)=>e in t?dB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var nt=(t,e,n)=>uB(t,typeof e!="symbol"?e+"":e,n);import{g as S0,R as U,b as OB,r as f,c as y0,j as C,a as Gt,_ as F3,i as dT}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-TSkGvSH8.js","assets/index-JcYe5KP6.js","assets/index-DhtWNnKL.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var dB=Object.defineProperty;var uB=(t,e,n)=>e in t?dB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var nt=(t,e,n)=>uB(t,typeof e!="symbol"?e+"":e,n);import{g as S0,R as U,b as OB,r as f,c as y0,j as C,a as Gt,_ as F3,i as dT}from"./index-JcYe5KP6.js";function hB(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Y$={exports:{}};/*!
|
|
3
3
|
Copyright (c) 2018 Jed Watson.
|
|
4
4
|
Licensed under the MIT License (MIT), see
|
|
5
5
|
http://jedwatson.github.io/classnames
|
|
@@ -773,7 +773,7 @@ ${t}</tr>
|
|
|
773
773
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
774
774
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ga(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let i=this.parser.parseInline(n),r=H5(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return e&&(s+=' title="'+ga(e)+'"'),s+=">"+i+"</a>",s}image({href:t,title:e,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=H5(t);if(r===null)return ga(n);t=r;let s=`<img src="${t}" alt="${ga(n)}"`;return e&&(s+=` title="${ga(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ga(t.text)}},bP=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Bo=class __{constructor(e){nt(this,"options");nt(this,"renderer");nt(this,"textRenderer");this.options=e||_d,this.options.renderer=this.options.renderer||new Qv,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new bP}static parse(e,n){return new __(n).parse(e)}static parseInline(e,n){return new __(n).parseInline(e)}parse(e){var i,r;let n="";for(let s=0;s<e.length;s++){let o=e[s];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[o.type]){let l=o,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let a=o;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,n=this.renderer){var r,s;let i="";for(let o=0;o<e.length;o++){let a=e[o];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=c||"";continue}}let l=a;switch(l.type){case"escape":{i+=n.text(l);break}case"html":{i+=n.html(l);break}case"link":{i+=n.link(l);break}case"image":{i+=n.image(l);break}case"checkbox":{i+=n.checkbox(l);break}case"strong":{i+=n.strong(l);break}case"em":{i+=n.em(l);break}case"codespan":{i+=n.codespan(l);break}case"br":{i+=n.br(l);break}case"del":{i+=n.del(l);break}case"text":{i+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}},rg,$h=(rg=class{constructor(e){nt(this,"options");nt(this,"block");this.options=e||_d}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Vo.lex:Vo.lexInline}provideParser(){return this.block?Bo.parse:Bo.parseInline}},nt(rg,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),nt(rg,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),rg),Afe=class{constructor(...e){nt(this,"defaults",OP());nt(this,"options",this.setOptions);nt(this,"parse",this.parseMarkdown(!0));nt(this,"parseInline",this.parseMarkdown(!1));nt(this,"Parser",Bo);nt(this,"Renderer",Qv);nt(this,"TextRenderer",bP);nt(this,"Lexer",Vo);nt(this,"Tokenizer",_v);nt(this,"Hooks",$h);this.use(...e)}walkTokens(e,n){var r,s;let i=[];for(let o of e)switch(i=i.concat(n.call(this,o)),o.type){case"table":{let a=o;for(let l of a.header)i=i.concat(this.walkTokens(l.tokens,n));for(let l of a.rows)for(let c of l)i=i.concat(this.walkTokens(c.tokens,n));break}case"list":{let a=o;i=i.concat(this.walkTokens(a.items,n));break}default:{let a=o;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);i=i.concat(this.walkTokens(c,n))}):a.tokens&&(i=i.concat(this.walkTokens(a.tokens,n)))}}return i}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:n.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[s.level];o?o.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),r.extensions=n),i.renderer){let s=this.defaults.renderer||new Qv(this.defaults);for(let o in i.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=i.renderer[a],c=s[a];s[a]=(...d)=>{let u=l.apply(s,d);return u===!1&&(u=c.apply(s,d)),u||""}}r.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new _v(this.defaults);for(let o in i.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=i.tokenizer[a],c=s[a];s[a]=(...d)=>{let u=l.apply(s,d);return u===!1&&(u=c.apply(s,d)),u}}r.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new $h;for(let o in i.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=i.hooks[a],c=s[a];$h.passThroughHooks.has(o)?s[a]=d=>{if(this.defaults.async&&$h.passThroughHooksRespectAsync.has(o))return(async()=>{let O=await l.call(s,d);return c.call(s,O)})();let u=l.call(s,d);return c.call(s,u)}:s[a]=(...d)=>{if(this.defaults.async)return(async()=>{let O=await l.apply(s,d);return O===!1&&(O=await c.apply(s,d)),O})();let u=l.apply(s,d);return u===!1&&(u=c.apply(s,d)),u}}r.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,o=i.walkTokens;r.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Vo.lex(e,n??this.defaults)}parser(e,n){return Bo.parse(e,n??this.defaults)}parseMarkdown(e){return(n,i)=>{let r={...i},s={...this.defaults,...r},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(n):n,l=await(s.hooks?await s.hooks.provideLexer():e?Vo.lex:Vo.lexInline)(a,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser():e?Bo.parse:Bo.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let a=(s.hooks?s.hooks.provideLexer():e?Vo.lex:Vo.lexInline)(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():e?Bo.parse:Bo.parseInline)(a,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(a){return o(a)}}}onError(e,n){return i=>{if(i.message+=`
|
|
775
775
|
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+ga(i.message+"",!0)+"</pre>";return n?Promise.resolve(r):r}if(n)return Promise.reject(i);throw i}}},cd=new Afe;function ti(t,e){return cd.parse(t,e)}ti.options=ti.setOptions=function(t){return cd.setOptions(t),ti.defaults=cd.defaults,LA(ti.defaults),ti};ti.getDefaults=OP;ti.defaults=_d;ti.use=function(...t){return cd.use(...t),ti.defaults=cd.defaults,LA(ti.defaults),ti};ti.walkTokens=function(t,e){return cd.walkTokens(t,e)};ti.parseInline=cd.parseInline;ti.Parser=Bo;ti.parser=Bo.parse;ti.Renderer=Qv;ti.TextRenderer=bP;ti.Lexer=Vo;ti.lexer=Vo.lex;ti.Tokenizer=_v;ti.Hooks=$h;ti.parse=ti;ti.options;ti.setOptions;ti.use;ti.walkTokens;ti.parseInline;Bo.parse;Vo.lex;/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:JA,setPrototypeOf:eR,isFrozen:Mfe,getPrototypeOf:Wfe,getOwnPropertyDescriptor:jfe}=Object;let{freeze:xs,seal:Xo,create:bg}=Object,{apply:Q_,construct:x_}=typeof Reflect<"u"&&Reflect;xs||(xs=function(e){return e});Xo||(Xo=function(e){return e});Q_||(Q_=function(e,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];return e.apply(n,r)});x_||(x_=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new e(...i)});const lm=ws(Array.prototype.forEach),Nfe=ws(Array.prototype.lastIndexOf),tR=ws(Array.prototype.pop),qO=ws(Array.prototype.push),Lfe=ws(Array.prototype.splice),Sg=ws(String.prototype.toLowerCase),Zb=ws(String.prototype.toString),Gb=ws(String.prototype.match),DO=ws(String.prototype.replace),Vfe=ws(String.prototype.indexOf),Bfe=ws(String.prototype.trim),eo=ws(Object.prototype.hasOwnProperty),us=ws(RegExp.prototype.test),UO=Yfe(TypeError);function ws(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Q_(t,e,i)}}function Yfe(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return x_(t,n)}}function yn(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Sg;eR&&eR(t,null);let i=e.length;for(;i--;){let r=e[i];if(typeof r=="string"){const s=n(r);s!==r&&(Mfe(e)||(e[i]=s),r=s)}t[r]=!0}return t}function qfe(t){for(let e=0;e<t.length;e++)eo(t,e)||(t[e]=null);return t}function va(t){const e=bg(null);for(const[n,i]of JA(t))eo(t,n)&&(Array.isArray(i)?e[n]=qfe(i):i&&typeof i=="object"&&i.constructor===Object?e[n]=va(i):e[n]=i);return e}function ZO(t,e){for(;t!==null;){const i=jfe(t,e);if(i){if(i.get)return ws(i.get);if(typeof i.value=="function")return ws(i.value)}t=Wfe(t)}function n(){return null}return n}const nR=xs(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Fb=xs(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hb=xs(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Dfe=xs(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Kb=xs(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ufe=xs(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),iR=xs(["#text"]),rR=xs(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Jb=xs(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),sR=xs(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),cm=xs(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Zfe=Xo(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Gfe=Xo(/<%[\w\W]*|[\w\W]*%>/gm),Ffe=Xo(/\$\{[\w\W]*/gm),Hfe=Xo(/^data-[\-\w.\u00B7-\uFFFF]+$/),Kfe=Xo(/^aria-[\-\w]+$/),eM=Xo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Jfe=Xo(/^(?:\w+script|data):/i),epe=Xo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tM=Xo(/^html$/i),tpe=Xo(/^[a-z][.\w]*(-[.\w]+)+$/i);var oR=Object.freeze({__proto__:null,ARIA_ATTR:Kfe,ATTR_WHITESPACE:epe,CUSTOM_ELEMENT:tpe,DATA_ATTR:Hfe,DOCTYPE_NAME:tM,ERB_EXPR:Gfe,IS_ALLOWED_URI:eM,IS_SCRIPT_OR_DATA:Jfe,MUSTACHE_EXPR:Zfe,TMPLIT_EXPR:Ffe});const GO={element:1,text:3,progressingInstruction:7,comment:8,document:9},npe=function(){return typeof window>"u"?null:window},ipe=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},aR=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function nM(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:npe();const e=Ge=>nM(Ge);if(e.version="3.3.3",e.removed=[],!t||!t.document||t.document.nodeType!==GO.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const i=n,r=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:O,trustedTypes:h}=t,p=l.prototype,m=ZO(p,"cloneNode"),g=ZO(p,"remove"),v=ZO(p,"nextSibling"),$=ZO(p,"childNodes"),b=ZO(p,"parentNode");if(typeof o=="function"){const Ge=n.createElement("template");Ge.content&&Ge.content.ownerDocument&&(n=Ge.content.ownerDocument)}let S,y="";const{implementation:_,createNodeIterator:Q,createDocumentFragment:P,getElementsByTagName:w}=n,{importNode:E}=i;let z=aR();e.isSupported=typeof JA=="function"&&typeof b=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:k,ERB_EXPR:T,TMPLIT_EXPR:x,DATA_ATTR:R,ARIA_ATTR:X,IS_SCRIPT_OR_DATA:I,ATTR_WHITESPACE:A,CUSTOM_ELEMENT:W}=oR;let{IS_ALLOWED_URI:N}=oR,L=null;const Y=yn({},[...nR,...Fb,...Hb,...Kb,...iR]);let j=null;const V=yn({},[...rR,...Jb,...sR,...cm]);let B=Object.seal(bg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),F=null,ie=null;const D=Object.seal(bg(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let te=!0,pe=!0,oe=!1,ee=!0,ae=!1,Z=!0,H=!1,K=!1,se=!1,ce=!1,ve=!1,be=!1,de=!0,me=!1;const he="user-content-";let fe=!0,ke=!1,Ae={},De=null;const Ze=yn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let qe=null;const Je=yn({},["audio","video","img","source","image","track"]);let Ce=null;const we=yn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ne="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",Ve="http://www.w3.org/1999/xhtml";let Xe=Ve,Ue=!1,tt=null;const ut=yn({},[Ne,We,Ve],Zb);let Wt=yn({},["mi","mo","mn","ms","mtext"]),Vt=yn({},["annotation-xml"]);const zt=yn({},["title","style","font","a","script"]);let rn=null;const re=["application/xhtml+xml","text/html"],Se="text/html";let _e=null,Ke=null;const St=n.createElement("form"),Be=function(le){return le instanceof RegExp||le instanceof Function},Ie=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ke&&Ke===le)){if((!le||typeof le!="object")&&(le={}),le=va(le),rn=re.indexOf(le.PARSER_MEDIA_TYPE)===-1?Se:le.PARSER_MEDIA_TYPE,_e=rn==="application/xhtml+xml"?Zb:Sg,L=eo(le,"ALLOWED_TAGS")?yn({},le.ALLOWED_TAGS,_e):Y,j=eo(le,"ALLOWED_ATTR")?yn({},le.ALLOWED_ATTR,_e):V,tt=eo(le,"ALLOWED_NAMESPACES")?yn({},le.ALLOWED_NAMESPACES,Zb):ut,Ce=eo(le,"ADD_URI_SAFE_ATTR")?yn(va(we),le.ADD_URI_SAFE_ATTR,_e):we,qe=eo(le,"ADD_DATA_URI_TAGS")?yn(va(Je),le.ADD_DATA_URI_TAGS,_e):Je,De=eo(le,"FORBID_CONTENTS")?yn({},le.FORBID_CONTENTS,_e):Ze,F=eo(le,"FORBID_TAGS")?yn({},le.FORBID_TAGS,_e):va({}),ie=eo(le,"FORBID_ATTR")?yn({},le.FORBID_ATTR,_e):va({}),Ae=eo(le,"USE_PROFILES")?le.USE_PROFILES:!1,te=le.ALLOW_ARIA_ATTR!==!1,pe=le.ALLOW_DATA_ATTR!==!1,oe=le.ALLOW_UNKNOWN_PROTOCOLS||!1,ee=le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ae=le.SAFE_FOR_TEMPLATES||!1,Z=le.SAFE_FOR_XML!==!1,H=le.WHOLE_DOCUMENT||!1,ce=le.RETURN_DOM||!1,ve=le.RETURN_DOM_FRAGMENT||!1,be=le.RETURN_TRUSTED_TYPE||!1,se=le.FORCE_BODY||!1,de=le.SANITIZE_DOM!==!1,me=le.SANITIZE_NAMED_PROPS||!1,fe=le.KEEP_CONTENT!==!1,ke=le.IN_PLACE||!1,N=le.ALLOWED_URI_REGEXP||eM,Xe=le.NAMESPACE||Ve,Wt=le.MATHML_TEXT_INTEGRATION_POINTS||Wt,Vt=le.HTML_INTEGRATION_POINTS||Vt,B=le.CUSTOM_ELEMENT_HANDLING||{},le.CUSTOM_ELEMENT_HANDLING&&Be(le.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=le.CUSTOM_ELEMENT_HANDLING.tagNameCheck),le.CUSTOM_ELEMENT_HANDLING&&Be(le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=le.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),le.CUSTOM_ELEMENT_HANDLING&&typeof le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(B.allowCustomizedBuiltInElements=le.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ae&&(pe=!1),ve&&(ce=!0),Ae&&(L=yn({},iR),j=bg(null),Ae.html===!0&&(yn(L,nR),yn(j,rR)),Ae.svg===!0&&(yn(L,Fb),yn(j,Jb),yn(j,cm)),Ae.svgFilters===!0&&(yn(L,Hb),yn(j,Jb),yn(j,cm)),Ae.mathMl===!0&&(yn(L,Kb),yn(j,sR),yn(j,cm))),eo(le,"ADD_TAGS")||(D.tagCheck=null),eo(le,"ADD_ATTR")||(D.attributeCheck=null),le.ADD_TAGS&&(typeof le.ADD_TAGS=="function"?D.tagCheck=le.ADD_TAGS:(L===Y&&(L=va(L)),yn(L,le.ADD_TAGS,_e))),le.ADD_ATTR&&(typeof le.ADD_ATTR=="function"?D.attributeCheck=le.ADD_ATTR:(j===V&&(j=va(j)),yn(j,le.ADD_ATTR,_e))),le.ADD_URI_SAFE_ATTR&&yn(Ce,le.ADD_URI_SAFE_ATTR,_e),le.FORBID_CONTENTS&&(De===Ze&&(De=va(De)),yn(De,le.FORBID_CONTENTS,_e)),le.ADD_FORBID_CONTENTS&&(De===Ze&&(De=va(De)),yn(De,le.ADD_FORBID_CONTENTS,_e)),fe&&(L["#text"]=!0),H&&yn(L,["html","head","body"]),L.table&&(yn(L,["tbody"]),delete F.tbody),le.TRUSTED_TYPES_POLICY){if(typeof le.TRUSTED_TYPES_POLICY.createHTML!="function")throw UO('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw UO('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=le.TRUSTED_TYPES_POLICY,y=S.createHTML("")}else S===void 0&&(S=ipe(h,r)),S!==null&&typeof y=="string"&&(y=S.createHTML(""));xs&&xs(le),Ke=le}},Re=yn({},[...Fb,...Hb,...Dfe]),xe=yn({},[...Kb,...Ufe]),Ee=function(le){let ge=b(le);(!ge||!ge.tagName)&&(ge={namespaceURI:Xe,tagName:"template"});const Te=Sg(le.tagName),ct=Sg(ge.tagName);return tt[le.namespaceURI]?le.namespaceURI===We?ge.namespaceURI===Ve?Te==="svg":ge.namespaceURI===Ne?Te==="svg"&&(ct==="annotation-xml"||Wt[ct]):!!Re[Te]:le.namespaceURI===Ne?ge.namespaceURI===Ve?Te==="math":ge.namespaceURI===We?Te==="math"&&Vt[ct]:!!xe[Te]:le.namespaceURI===Ve?ge.namespaceURI===We&&!Vt[ct]||ge.namespaceURI===Ne&&!Wt[ct]?!1:!xe[Te]&&(zt[Te]||!Re[Te]):!!(rn==="application/xhtml+xml"&&tt[le.namespaceURI]):!1},Qe=function(le){qO(e.removed,{element:le});try{b(le).removeChild(le)}catch{g(le)}},Ye=function(le,ge){try{qO(e.removed,{attribute:ge.getAttributeNode(le),from:ge})}catch{qO(e.removed,{attribute:null,from:ge})}if(ge.removeAttribute(le),le==="is")if(ce||ve)try{Qe(ge)}catch{}else try{ge.setAttribute(le,"")}catch{}},pt=function(le){let ge=null,Te=null;if(se)le="<remove></remove>"+le;else{const et=Gb(le,/^[\r\n\t ]+/);Te=et&&et[0]}rn==="application/xhtml+xml"&&Xe===Ve&&(le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+le+"</body></html>");const ct=S?S.createHTML(le):le;if(Xe===Ve)try{ge=new O().parseFromString(ct,rn)}catch{}if(!ge||!ge.documentElement){ge=_.createDocument(Xe,"template",null);try{ge.documentElement.innerHTML=Ue?y:ct}catch{}}const ft=ge.body||ge.documentElement;return le&&Te&&ft.insertBefore(n.createTextNode(Te),ft.childNodes[0]||null),Xe===Ve?w.call(ge,H?"html":"body")[0]:H?ge.documentElement:ft},mt=function(le){return Q.call(le.ownerDocument||le,le,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Yt=function(le){return le instanceof u&&(typeof le.nodeName!="string"||typeof le.textContent!="string"||typeof le.removeChild!="function"||!(le.attributes instanceof d)||typeof le.removeAttribute!="function"||typeof le.setAttribute!="function"||typeof le.namespaceURI!="string"||typeof le.insertBefore!="function"||typeof le.hasChildNodes!="function")},st=function(le){return typeof a=="function"&&le instanceof a};function Fe(Ge,le,ge){lm(Ge,Te=>{Te.call(e,le,ge,Ke)})}const wt=function(le){let ge=null;if(Fe(z.beforeSanitizeElements,le,null),Yt(le))return Qe(le),!0;const Te=_e(le.nodeName);if(Fe(z.uponSanitizeElement,le,{tagName:Te,allowedTags:L}),Z&&le.hasChildNodes()&&!st(le.firstElementChild)&&us(/<[/\w!]/g,le.innerHTML)&&us(/<[/\w!]/g,le.textContent)||le.nodeType===GO.progressingInstruction||Z&&le.nodeType===GO.comment&&us(/<[/\w]/g,le.data))return Qe(le),!0;if(!(D.tagCheck instanceof Function&&D.tagCheck(Te))&&(!L[Te]||F[Te])){if(!F[Te]&&Kt(Te)&&(B.tagNameCheck instanceof RegExp&&us(B.tagNameCheck,Te)||B.tagNameCheck instanceof Function&&B.tagNameCheck(Te)))return!1;if(fe&&!De[Te]){const ct=b(le)||le.parentNode,ft=$(le)||le.childNodes;if(ft&&ct){const et=ft.length;for(let it=et-1;it>=0;--it){const Ct=m(ft[it],!0);Ct.__removalCount=(le.__removalCount||0)+1,ct.insertBefore(Ct,v(le))}}}return Qe(le),!0}return le instanceof l&&!Ee(le)||(Te==="noscript"||Te==="noembed"||Te==="noframes")&&us(/<\/no(script|embed|frames)/i,le.innerHTML)?(Qe(le),!0):(ae&&le.nodeType===GO.text&&(ge=le.textContent,lm([k,T,x],ct=>{ge=DO(ge,ct," ")}),le.textContent!==ge&&(qO(e.removed,{element:le.cloneNode()}),le.textContent=ge)),Fe(z.afterSanitizeElements,le,null),!1)},Ut=function(le,ge,Te){if(ie[ge]||de&&(ge==="id"||ge==="name")&&(Te in n||Te in St))return!1;if(!(pe&&!ie[ge]&&us(R,ge))){if(!(te&&us(X,ge))){if(!(D.attributeCheck instanceof Function&&D.attributeCheck(ge,le))){if(!j[ge]||ie[ge]){if(!(Kt(le)&&(B.tagNameCheck instanceof RegExp&&us(B.tagNameCheck,le)||B.tagNameCheck instanceof Function&&B.tagNameCheck(le))&&(B.attributeNameCheck instanceof RegExp&&us(B.attributeNameCheck,ge)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(ge,le))||ge==="is"&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&us(B.tagNameCheck,Te)||B.tagNameCheck instanceof Function&&B.tagNameCheck(Te))))return!1}else if(!Ce[ge]){if(!us(N,DO(Te,A,""))){if(!((ge==="src"||ge==="xlink:href"||ge==="href")&&le!=="script"&&Vfe(Te,"data:")===0&&qe[le])){if(!(oe&&!us(I,DO(Te,A,"")))){if(Te)return!1}}}}}}}return!0},Kt=function(le){return le!=="annotation-xml"&&Gb(le,W)},Jt=function(le){Fe(z.beforeSanitizeAttributes,le,null);const{attributes:ge}=le;if(!ge||Yt(le))return;const Te={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let ct=ge.length;for(;ct--;){const ft=ge[ct],{name:et,namespaceURI:it,value:Ct}=ft,Zt=_e(et),$e=Ct;let ze=et==="value"?$e:Bfe($e);if(Te.attrName=Zt,Te.attrValue=ze,Te.keepAttr=!0,Te.forceKeepAttr=void 0,Fe(z.uponSanitizeAttribute,le,Te),ze=Te.attrValue,me&&(Zt==="id"||Zt==="name")&&(Ye(et,le),ze=he+ze),Z&&us(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ze)){Ye(et,le);continue}if(Zt==="attributename"&&Gb(ze,"href")){Ye(et,le);continue}if(Te.forceKeepAttr)continue;if(!Te.keepAttr){Ye(et,le);continue}if(!ee&&us(/\/>/i,ze)){Ye(et,le);continue}ae&&lm([k,T,x],qt=>{ze=DO(ze,qt," ")});const rt=_e(le.nodeName);if(!Ut(rt,Zt,ze)){Ye(et,le);continue}if(S&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!it)switch(h.getAttributeType(rt,Zt)){case"TrustedHTML":{ze=S.createHTML(ze);break}case"TrustedScriptURL":{ze=S.createScriptURL(ze);break}}if(ze!==$e)try{it?le.setAttributeNS(it,et,ze):le.setAttribute(et,ze),Yt(le)?Qe(le):tR(e.removed)}catch{Ye(et,le)}}Fe(z.afterSanitizeAttributes,le,null)},mn=function Ge(le){let ge=null;const Te=mt(le);for(Fe(z.beforeSanitizeShadowDOM,le,null);ge=Te.nextNode();)Fe(z.uponSanitizeShadowNode,ge,null),wt(ge),Jt(ge),ge.content instanceof s&&Ge(ge.content);Fe(z.afterSanitizeShadowDOM,le,null)};return e.sanitize=function(Ge){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,Te=null,ct=null,ft=null;if(Ue=!Ge,Ue&&(Ge="<!-->"),typeof Ge!="string"&&!st(Ge))if(typeof Ge.toString=="function"){if(Ge=Ge.toString(),typeof Ge!="string")throw UO("dirty is not a string, aborting")}else throw UO("toString is not a function");if(!e.isSupported)return Ge;if(K||Ie(le),e.removed=[],typeof Ge=="string"&&(ke=!1),ke){if(Ge.nodeName){const Ct=_e(Ge.nodeName);if(!L[Ct]||F[Ct])throw UO("root node is forbidden and cannot be sanitized in-place")}}else if(Ge instanceof a)ge=pt("<!---->"),Te=ge.ownerDocument.importNode(Ge,!0),Te.nodeType===GO.element&&Te.nodeName==="BODY"||Te.nodeName==="HTML"?ge=Te:ge.appendChild(Te);else{if(!ce&&!ae&&!H&&Ge.indexOf("<")===-1)return S&&be?S.createHTML(Ge):Ge;if(ge=pt(Ge),!ge)return ce?null:be?y:""}ge&&se&&Qe(ge.firstChild);const et=mt(ke?Ge:ge);for(;ct=et.nextNode();)wt(ct),Jt(ct),ct.content instanceof s&&mn(ct.content);if(ke)return Ge;if(ce){if(ve)for(ft=P.call(ge.ownerDocument);ge.firstChild;)ft.appendChild(ge.firstChild);else ft=ge;return(j.shadowroot||j.shadowrootmode)&&(ft=E.call(i,ft,!0)),ft}let it=H?ge.outerHTML:ge.innerHTML;return H&&L["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&us(tM,ge.ownerDocument.doctype.name)&&(it="<!DOCTYPE "+ge.ownerDocument.doctype.name+`>
|
|
776
|
-
`+it),ae&&lm([k,T,x],Ct=>{it=DO(it,Ct," ")}),S&&be?S.createHTML(it):it},e.setConfig=function(){let Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ie(Ge),K=!0},e.clearConfig=function(){Ke=null,K=!1},e.isValidAttribute=function(Ge,le,ge){Ke||Ie({});const Te=_e(Ge),ct=_e(le);return Ut(Te,ct,ge)},e.addHook=function(Ge,le){typeof le=="function"&&qO(z[Ge],le)},e.removeHook=function(Ge,le){if(le!==void 0){const ge=Nfe(z[Ge],le);return ge===-1?void 0:Lfe(z[Ge],ge,1)[0]}return tR(z[Ge])},e.removeHooks=function(Ge){z[Ge]=[]},e.removeAllHooks=function(){z=aR()},e}var SP=nM();let FO=null,lR=!1,eS=null,w_=new Set;function rpe(){return FO||(FO=F3(()=>import("./mermaid.core-
|
|
776
|
+
`+it),ae&&lm([k,T,x],Ct=>{it=DO(it,Ct," ")}),S&&be?S.createHTML(it):it},e.setConfig=function(){let Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ie(Ge),K=!0},e.clearConfig=function(){Ke=null,K=!1},e.isValidAttribute=function(Ge,le,ge){Ke||Ie({});const Te=_e(Ge),ct=_e(le);return Ut(Te,ct,ge)},e.addHook=function(Ge,le){typeof le=="function"&&qO(z[Ge],le)},e.removeHook=function(Ge,le){if(le!==void 0){const ge=Nfe(z[Ge],le);return ge===-1?void 0:Lfe(z[Ge],ge,1)[0]}return tR(z[Ge])},e.removeHooks=function(Ge){z[Ge]=[]},e.removeAllHooks=function(){z=aR()},e}var SP=nM();let FO=null,lR=!1,eS=null,w_=new Set;function rpe(){return FO||(FO=F3(()=>import("./mermaid.core-TSkGvSH8.js").then(t=>t.bE),__vite__mapDeps([0,1,2])).then(t=>{const e=t.default;return e.initialize({startOnLoad:!1,theme:"dark",darkMode:!0,securityLevel:"strict",flowchart:{useMaxWidth:!0},themeVariables:{darkMode:!0,background:"#0d1117",primaryColor:"#1a3a5c",primaryTextColor:"#c9d1d9",primaryBorderColor:"#30363d",lineColor:"#58a6ff",secondaryColor:"#161b22",tertiaryColor:"#0d1117",nodeTextColor:"#c9d1d9",edgeLabelBackground:"#0d1117"}}),e}).catch(()=>(FO=null,null)),FO)}async function spe(t){if(!t)return;const e=t.querySelectorAll("code.language-mermaid");if(e.length===0)return;const n=await rpe();if(n)for(const i of e){const r=i.parentElement;if(!r||r.dataset.mermaidRendered)continue;r.dataset.mermaidRendered="1";const s=i.textContent;try{const o="mmd-"+Math.random().toString(36).slice(2,9),{svg:a}=await n.render(o,s),l=document.createElement("div");l.className="mermaid-diagram",l.innerHTML=SP.sanitize(a,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["style","foreignObject"]}),r.replaceWith(l)}catch{}}}function ope(){eS||(eS=requestAnimationFrame(()=>{eS=null;const t=w_;w_=new Set;for(const e of t)e.isConnected&&spe(e)}))}function ape(){if(lR||typeof document>"u")return;lR=!0;const t=new MutationObserver(n=>{var i;for(const r of n)for(const s of r.addedNodes)if(s.nodeType===1&&((i=s.querySelector)!=null&&i.call(s,"code.language-mermaid"))){w_.add(s),ope();return}}),e=()=>t.observe(document.body,{childList:!0,subtree:!0});document.body?e():document.addEventListener("DOMContentLoaded",e)}ape();function bo(t){if(!t)return"";try{return SP.sanitize(ti.parse(t,{breaks:!0}))}catch{return g_(t)}}const lpe=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
777
777
|
<!-- Bar chart: represents data analysis -->
|
|
778
778
|
<!-- Three vertical bars of varying height -->
|
|
779
779
|
<line x1="18" y1="20" x2="18" y2="10"/>
|
|
@@ -1100,5 +1100,5 @@ https://github.com/highlightjs/highlight.js/issues/2277`),un=$e,qt=ze),rt===void
|
|
|
1100
1100
|
...`:I.content)}})]},A))}),E.taskSubject&&C.jsx("div",{className:Tt.teamAgentPopTask,children:E.taskSubject}),R.length>0?R.map((I,A)=>{const W=(I.content||[]).filter(N=>N.type==="text").map(N=>N.text).join(`
|
|
1101
1101
|
`);return W.trim()?C.jsx("div",{className:`${Tt.teamAgentPopMsg} chat-md`,dangerouslySetInnerHTML:{__html:bo(W.length>2e3?W.slice(0,2e3)+`
|
|
1102
1102
|
|
|
1103
|
-
...`:W)}},A):null}):C.jsx("div",{className:Tt.agentNoMessages,children:"No messages"})]});return C.jsx(Sl,{content:X,trigger:"click",placement:"right",autoAdjustOverflow:!0,overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #333",padding:0,maxWidth:800,maxHeight:"70vh",overflowY:"auto"},onOpenChange:I=>p(I?z:null),children:C.jsxs("div",{className:`${Tt.teamAgentCard} ${Tt.teamAgentCardClickable} ${h===z?Tt.teamAgentCardActive:""}`,children:[C.jsxs("div",{className:Tt.teamAgentCardHeader,children:[(()=>{const I=Bu(E.name);return C.jsx("div",{className:Tt.teamAgentAvatar,style:{background:I.color},dangerouslySetInnerHTML:{__html:I.svg}})})(),C.jsx("div",{className:Tt.teamAgentName,children:E.name})]}),C.jsx("div",{className:Tt.teamAgentType,children:E.type}),C.jsxs("div",{className:Tt.teamAgentStatus,style:{color:k?"#52c41a":"#faad14"},children:[k?"✓ done":"● working"," ",C.jsxs("span",{className:Tt.agentStatusDurSuffix,children:["· ",x]})]})]})},z)})]}),C.jsxs("div",{className:Tt.teamModalContent,children:[C.jsx(i9e,{teamAgents:Q,teamTotalStart:b,teamTotalEnd:S,leadSegments:P,ganttWrapRef:d,ganttIndicatorRef:c,ganttHeight:m,onGanttHeightChange:g}),C.jsxs("div",{className:Tt.teamModalBody,ref:l,onScroll:y,children:[_.map((E,z)=>C.jsxs("div",{"data-timestamp":E.timestamp,children:[E.type==="user"&&C.jsx(ms,{role:"user",text:E.text,timestamp:E.timestamp,userProfile:s,modelInfo:w,requestIndex:E.requestIndex,onViewRequest:o}),E.type==="assistant"&&C.jsx(ms,{role:"assistant",content:E.content,timestamp:E.timestamp,modelInfo:E.modelInfo,collapseToolResults:i,expandThinking:r,toolResultMap:{},askAnswerMap:{},requestIndex:E.requestIndex,onViewRequest:o}),E.type==="sub-agent"&&C.jsx(ms,{role:"sub-agent-chat",content:E.content,toolResultMap:E.toolResultMap,label:E.label,isTeammate:E.isTeammate,timestamp:E.timestamp,collapseToolResults:i,expandThinking:r,requestIndex:E.requestIndex,onViewRequest:o}),E.type==="context"&&C.jsx(ms,{role:"assistant",content:[{type:"text",text:E.text}],timestamp:E.timestamp,modelInfo:w,collapseToolResults:i,expandThinking:r,toolResultMap:{},askAnswerMap:{}}),E.type==="teammate-report"&&C.jsxs("div",{className:Tt.teammateReportEntry,children:[C.jsxs("div",{className:Tt.teammateReportHeader,children:[(()=>{const k=Bu(E.agentName);return C.jsx("div",{className:Tt.teamAgentAvatar,style:{background:k.color},dangerouslySetInnerHTML:{__html:k.svg}})})(),C.jsx("span",{className:Tt.teammateReportName,children:E.agentName}),C.jsx("span",{className:Tt.teammateReportSummary,children:E.summary})]}),C.jsx("div",{className:`${Tt.teammateReportBody} chat-md`,dangerouslySetInnerHTML:{__html:bo(E.content)}})]})]},`tw-${z}`)),_.length===0&&C.jsx(Ns,{description:"No entries",image:Ns.PRESENTED_IMAGE_SIMPLE})]})]})]})})}const r9e="_snapLine_1xlsr_1",s9e="_snapLineActive_1xlsr_13",o9e="_snapPreview_1xlsr_24",N1={snapLine:r9e,snapLineActive:s9e,snapPreview:o9e};function a9e({isDragging:t,activeSnapLine:e,snapLines:n,terminalWidth:i,containerRef:r}){if(!t)return null;const s=r.current;if(!s)return null;const o=s.getBoundingClientRect().width,a=5;let l=null;if(e){const O=o-i-a,h=e.linePosition,p=Math.min(O,h),m=Math.abs(h-O);l=C.jsx("div",{className:N1.snapPreview,style:{left:`${p}px`,width:`${m}px`}})}const c=o-i-a,d=[...n].map(O=>({...O,dist:Math.abs(O.linePosition-c)})).sort((O,h)=>O.dist-h.dist);let u=null;if(d.length>0){const O=d[0],h=e&&e.cols===O.cols;u=C.jsx("div",{className:h?N1.snapLineActive:N1.snapLine,style:{left:`${O.linePosition}px`}},O.cols)}return C.jsxs(C.Fragment,{children:[l,u]})}const l9e="_roleFilterBar_tifk1_1",c9e="_roleChip_tifk1_10",d9e="_roleChipActive_tifk1_10",u9e="_roleAvatar_tifk1_31",O9e="_roleAvatarImg_tifk1_44",h9e="_roleName_tifk1_51",f9e="_roleCheck_tifk1_56",Rc={roleFilterBar:l9e,roleChip:c9e,roleChipActive:d9e,roleAvatar:u9e,roleAvatarImg:O9e,roleName:h9e,roleCheck:f9e};function p9e({roles:t,selectedRoles:e,onToggle:n}){return!t||t.length===0?null:C.jsx("div",{className:Rc.roleFilterBar,children:t.map(i=>{const r=e.has(i.key);return C.jsxs("button",{className:r?Rc.roleChipActive:Rc.roleChip,onClick:()=>n(i.key),children:[i.avatarImg?C.jsx("img",{src:i.avatarImg,className:Rc.roleAvatarImg,alt:i.name,onError:s=>{s.target.onerror=null,s.target.style.display="none";const o=s.target.parentNode.querySelector("[data-role-avatar-fallback]");o&&(o.style.display="")}}):null,C.jsx("div",{className:Rc.roleAvatar,style:{background:i.color||"rgba(255,255,255,0.1)",display:i.avatarImg?"none":""},"data-role-avatar-fallback":"",dangerouslySetInnerHTML:{__html:i.avatarSvg||$_(i.avatarType)}}),C.jsx("span",{className:Rc.roleName,children:i.name}),r&&C.jsx("span",{className:Rc.roleCheck,children:"✓"})]},i.key)})})}const m9e="_chatInputBar_1353e_1",g9e="_chatInputWrapper_1353e_7",v9e="_chatTextareaWrap_1353e_21",$9e="_chatTextarea_1353e_21",b9e="_chatInputBottom_1353e_46",S9e="_plusArea_1353e_53",y9e="_plusBtn_1353e_57",_9e="_plusBtnOpen_1353e_71",Q9e="_plusOverlay_1353e_81",x9e="_plusMenu_1353e_90",w9e="_plusMenuItem_1353e_103",P9e="_presetLabel_1353e_123",C9e="_chatInputHint_1353e_129",T9e="_chatInputHintSep_1353e_137",k9e="_chatInputHintTerminal_1353e_141",R9e="_chatInputHintMobile_1353e_145",E9e="_sendBtn_1353e_153",X9e="_sendBtnDisabled_1353e_168",z9e="_ghostText_1353e_179",I9e="_suggestionChip_1353e_195",A9e="_suggestionChipText_1353e_211",M9e="_suggestionChipAction_1353e_220",W9e="_streaming_1353e_290",j9e="_streamingFading_1353e_291",N9e="_streamingSvg_1353e_301",L9e="_streamingSvgFading_1353e_312",li={chatInputBar:m9e,chatInputWrapper:g9e,chatTextareaWrap:v9e,chatTextarea:$9e,chatInputBottom:b9e,plusArea:S9e,plusBtn:y9e,plusBtnOpen:_9e,plusOverlay:Q9e,plusMenu:x9e,plusMenuItem:w9e,presetLabel:P9e,chatInputHint:C9e,chatInputHintSep:T9e,chatInputHintTerminal:k9e,chatInputHintMobile:R9e,sendBtn:E9e,sendBtnDisabled:X9e,ghostText:z9e,suggestionChip:I9e,suggestionChipText:A9e,suggestionChipAction:M9e,streaming:W9e,streamingFading:j9e,streamingSvg:N9e,streamingSvgFading:L9e};function V9e({inputRef:t,inputEmpty:e,inputSuggestion:n,terminalVisible:i,onKeyDown:r,onChange:s,onSend:o,onSuggestionClick:a,onUploadPath:l,presetItems:c,onPresetSend:d,isStreaming:u,streamingFading:O}){const[h,p]=f.useState(!1);return i?n?C.jsxs("div",{className:li.suggestionChip,onClick:a,children:[C.jsx("span",{className:li.suggestionChipText,children:n}),C.jsx("span",{className:li.suggestionChipAction,children:"↵"})]}):null:C.jsx("div",{className:li.chatInputBar,children:C.jsxs("div",{className:`${li.chatInputWrapper}${u?` ${li.streaming}`:""}${O?` ${li.streamingFading}`:""}`,children:[(u||O)&&C.jsxs("svg",{className:`${li.streamingSvg}${O?` ${li.streamingSvgFading}`:""}`,children:[C.jsx("defs",{children:C.jsxs("filter",{id:"ccv-streamGlow",children:[C.jsx("feGaussianBlur",{stdDeviation:"2",result:"blur"}),C.jsxs("feMerge",{children:[C.jsx("feMergeNode",{in:"blur"}),C.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),[{da:"20 30",op:.08,off:0},{da:"16 34",op:.15,off:-4},{da:"11 39",op:.3,off:-9},{da:"6 44",op:.6,off:-14},{da:"3 47",op:1,off:-17}].map((m,g,v)=>C.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",rx:"16",ry:"16",pathLength:"100",fill:"none",strokeWidth:"1.5",stroke:"#60a5fa",strokeOpacity:m.op,strokeLinecap:"round",strokeDasharray:m.da,filter:g===v.length-1?"url(#ccv-streamGlow)":void 0,children:C.jsx("animate",{attributeName:"stroke-dashoffset",from:m.off,to:m.off-100,dur:"2.5s",repeatCount:"indefinite"})},g))]}),C.jsxs("div",{className:li.chatTextareaWrap,children:[C.jsx("textarea",{ref:t,className:li.chatTextarea,placeholder:n?"":Oe("ui.chatInput.placeholder"),rows:1,onKeyDown:r,onInput:s}),n&&e&&C.jsx("div",{className:li.ghostText,children:n})]}),C.jsxs("div",{className:li.chatInputBottom,children:[C.jsxs("div",{className:li.plusArea,children:[C.jsx("button",{className:`${li.plusBtn}${h?` ${li.plusBtnOpen}`:""}`,onClick:()=>p(m=>!m),title:Oe("ui.chatInput.more"),children:C.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),C.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),h&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:li.plusOverlay,onClick:()=>p(!1)}),C.jsxs("div",{className:li.plusMenu,children:[c&&c.length>0&&c.map(m=>{const g=m.builtinId&&!m.modified,v=g?Oe(m.teamName):m.teamName,$=g?Oe(m.description):m.description;return C.jsxs("button",{className:li.plusMenuItem,onClick:()=>{p(!1),d==null||d($)},title:$,children:[C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),C.jsx("circle",{cx:"9",cy:"7",r:"4"}),C.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),C.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),C.jsx("span",{className:li.presetLabel,children:v||$})]},m.id)}),C.jsxs("button",{className:li.plusMenuItem,onClick:()=>{p(!1);const m=document.createElement("input");m.type="file",m.onchange=async g=>{var $;const v=($=g.target.files)==null?void 0:$[0];if(v)try{const b=await bQ(v);l(b)}catch(b){console.error("[CC Viewer] Upload failed:",b)}},m.click()},children:[C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),C.jsx("polyline",{points:"17 8 12 3 7 8"}),C.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),C.jsx("span",{children:Oe("ui.terminal.upload")})]})]})]})]}),C.jsx("div",{className:Gt?li.chatInputHintMobile:li.chatInputHint,children:Gt?Oe("ui.chatInput.hintMobile"):C.jsxs(C.Fragment,{children:[Oe(n&&e?"ui.chatInput.hintTab":"ui.chatInput.hintEnter"),C.jsx("span",{className:li.chatInputHintSep,children:" · "}),C.jsx("span",{className:li.chatInputHintTerminal,children:Oe("ui.chatInput.hintTerminal")})]})}),C.jsx("button",{className:`${li.sendBtn} ${e?li.sendBtnDisabled:""}`,onClick:o,disabled:e,title:Oe("ui.chatInput.send"),children:C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),C.jsx("polyline",{points:"5 12 12 5 19 12"})]})})]})]})})}const j$=0,yc=1,kO=2,RV=4;function _3(t){return()=>t}function B9e(t){t()}function EV(t,e){return n=>t(e(n))}function Q3(t,e){return()=>t(e)}function Y9e(t,e){return n=>t(e,n)}function HC(t){return t!==void 0}function q9e(...t){return()=>{t.map(B9e)}}function RO(){}function N$(t,e){return e(t),t}function D9e(t,e){return e(t)}function yi(...t){return t}function Un(t,e){return t(yc,e)}function hn(t,e){t(j$,e)}function KC(t){t(kO)}function Pi(t){return t(RV)}function Nt(t,e){return Un(t,Y9e(e,j$))}function Go(t,e){const n=t(yc,i=>{n(),e(i)});return n}function x3(t){let e,n;return i=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{i(e)},t)}}function XV(t,e){return t===e}function $i(t=XV){let e;return n=>i=>{t(e,i)||(e=i,n(i))}}function Ht(t){return e=>n=>{t(n)&&e(n)}}function Rt(t){return e=>EV(e,t)}function Qa(t){return e=>()=>{e(t)}}function He(t,...e){const n=U9e(...e);return((i,r)=>{switch(i){case kO:KC(t);return;case yc:return Un(t,n(r))}})}function za(t,e){return n=>i=>{n(e=t(e,i))}}function md(t){return e=>n=>{t>0?t--:e(n)}}function gl(t){let e=null,n;return i=>r=>{e=r,!n&&(n=setTimeout(()=>{n=void 0,i(e)},t))}}function pn(...t){const e=new Array(t.length);let n=0,i=null;const r=2**t.length-1;return t.forEach((s,o)=>{const a=2**o;Un(s,l=>{const c=n;n|=a,e[o]=l,c!==r&&n===r&&i&&(i(),i=null)})}),s=>o=>{const a=()=>{s([o].concat(e))};n===r?a():i=a}}function U9e(...t){return e=>t.reduceRight(D9e,e)}function Z9e(t){let e,n;const i=()=>e==null?void 0:e();return function(r,s){switch(r){case yc:return s?n===s?void 0:(i(),n=s,e=Un(t,s),e):(i(),RO);case kO:i(),n=null;return}}}function ot(t){let e=t;const n=En();return((i,r)=>{switch(i){case j$:e=r;break;case yc:{r(e);break}case RV:return e}return n(i,r)})}function Kr(t,e){return N$(ot(e),n=>Nt(t,n))}function En(){const t=[];return((e,n)=>{switch(e){case j$:t.slice().forEach(i=>{i(n)});return;case kO:t.splice(0,t.length);return;case yc:return t.push(n),()=>{const i=t.indexOf(n);i>-1&&t.splice(i,1)}}})}function ao(t){return N$(En(),e=>Nt(t,e))}function Ln(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:G9e(),singleton:n}}const G9e=()=>Symbol();function F9e(t){const e=new Map,n=({constructor:i,dependencies:r,id:s,singleton:o})=>{if(o&&e.has(s))return e.get(s);const a=i(r.map(l=>n(l)));return o&&e.set(s,a),a};return n(t)}function nr(...t){const e=En(),n=new Array(t.length);let i=0;const r=2**t.length-1;return t.forEach((s,o)=>{const a=2**o;Un(s,l=>{n[o]=l,i|=a,i===r&&hn(e,n)})}),function(s,o){switch(s){case kO:{KC(e);return}case yc:return i===r&&o(n),Un(e,o)}}}function Ft(t,e=XV){return He(t,$i(e))}function Vx(...t){return function(e,n){switch(e){case kO:return;case yc:return q9e(...t.map(i=>Un(i,n)))}}}const fr={DEBUG:0,INFO:1,WARN:2,ERROR:3},H9e={[fr.DEBUG]:"debug",[fr.ERROR]:"error",[fr.INFO]:"log",[fr.WARN]:"warn"},K9e=()=>typeof globalThis>"u"?window:globalThis,_c=Ln(()=>{const t=ot(fr.ERROR);return{log:ot((e,n,i=fr.INFO)=>{const r=K9e().VIRTUOSO_LOG_LEVEL??Pi(t);i>=r&&console[H9e[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0});function wd(t,e,n){return JC(t,e,n).callbackRef}function JC(t,e,n){const i=U.useRef(null);let r=o=>{};const s=U.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(o=>{const a=()=>{const l=o[0].target;l.offsetParent!==null&&t(l)};n?a():requestAnimationFrame(a)}):null,[t,n]);return r=o=>{o&&e?(s==null||s.observe(o),i.current=o):(i.current&&(s==null||s.unobserve(i.current)),i.current=null)},{callbackRef:r,ref:i}}function J9e(t,e,n,i,r,s,o,a,l){const c=U.useCallback(d=>{const u=eWe(d.children,e,a?"offsetWidth":"offsetHeight",r);let O=d.parentElement;for(;O.dataset.virtuosoScroller===void 0;)O=O.parentElement;const h=O.lastElementChild.dataset.viewportType==="window";let p;h&&(p=O.ownerDocument.defaultView);const m=o?a?o.scrollLeft:o.scrollTop:h?a?p.scrollX||p.document.documentElement.scrollLeft:p.scrollY||p.document.documentElement.scrollTop:a?O.scrollLeft:O.scrollTop,g=o?a?o.scrollWidth:o.scrollHeight:h?a?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight:a?O.scrollWidth:O.scrollHeight,v=o?a?o.offsetWidth:o.offsetHeight:h?a?p.innerWidth:p.innerHeight:a?O.offsetWidth:O.offsetHeight;i({scrollHeight:g,scrollTop:Math.max(m,0),viewportHeight:v}),s==null||s(a?w3("column-gap",getComputedStyle(d).columnGap,r):w3("row-gap",getComputedStyle(d).rowGap,r)),u!==null&&t(u)},[t,e,r,s,o,i,a]);return JC(c,n,l)}function eWe(t,e,n,i){const r=t.length;if(r===0)return null;const s=[];for(let o=0;o<r;o++){const a=t.item(o);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),d=e(a,n);if(d===0&&i("Zero-sized element, this should not happen",{child:a},fr.ERROR),d===c)continue;const u=s[s.length-1];s.length===0||u.size!==d||u.endIndex!==l-1?s.push({endIndex:l,size:d,startIndex:l}):s[s.length-1].endIndex++}return s}function w3(t,e,n){return e!=="normal"&&(e==null?void 0:e.endsWith("px"))!==!0&&n(`${t} was not resolved to pixel value correctly`,e,fr.WARN),e==="normal"?0:parseInt(e??"0",10)}function zV(t,e,n){const i=U.useRef(null),r=U.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),d=c.width;let u,O;if(e){const h=e.getBoundingClientRect(),p=c.top-h.top;O=h.height-Math.max(0,p),u=p+e.scrollTop}else{const h=o.current.ownerDocument.defaultView;O=h.innerHeight-Math.max(0,c.top),u=c.top+h.scrollY}i.current={offsetTop:u,visibleHeight:O,visibleWidth:d},t(i.current)},[t,e]),{callbackRef:s,ref:o}=JC(r,!0,n),a=U.useCallback(()=>{r(o.current)},[r,o]);return U.useEffect(()=>{var c;if(e){e.addEventListener("scroll",a);const d=new ResizeObserver(()=>{requestAnimationFrame(a)});return d.observe(e),()=>{e.removeEventListener("scroll",a),d.unobserve(e)}}const l=(c=o.current)==null?void 0:c.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",a),l==null||l.addEventListener("resize",a),()=>{l==null||l.removeEventListener("scroll",a),l==null||l.removeEventListener("resize",a)}},[a,e,o]),s}const Xs=Ln(()=>{const t=En(),e=En(),n=ot(0),i=En(),r=ot(0),s=En(),o=En(),a=ot(0),l=ot(0),c=ot(0),d=ot(0),u=En(),O=En(),h=ot(!1),p=ot(!1),m=ot(!1);return Nt(He(t,Rt(({scrollTop:g})=>g)),e),Nt(He(t,Rt(({scrollHeight:g})=>g)),o),Nt(e,r),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:d,headerHeight:a,horizontalDirection:p,scrollBy:O,scrollContainerState:t,scrollHeight:o,scrollingInProgress:h,scrollTo:u,scrollTop:e,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:i,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),Zf={lvl:0};function IV(t,e){const n=t.length;if(n===0)return[];let{index:i,value:r}=e(t[0]);const s=[];for(let o=1;o<n;o++){const{index:a,value:l}=e(t[o]);s.push({end:a-1,start:i,value:r}),i=a,r=l}return s.push({end:1/0,start:i,value:r}),s}function oi(t){return t===Zf}function Gf(t,e){if(!oi(t))return e===t.k?t.v:e<t.k?Gf(t.l,e):Gf(t.r,e)}function ia(t,e,n="k"){if(oi(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const i=ia(t.r,e,n);return i[0]===-1/0?[t.k,t.v]:i}return ia(t.l,e,n)}function ro(t,e,n){return oi(t)?WV(e,n,1):e===t.k?Or(t,{k:e,v:n}):e<t.k?P3(Or(t,{l:ro(t.l,e,n)})):P3(Or(t,{r:ro(t.r,e,n)}))}function Tu(){return Zf}function ku(t,e,n){if(oi(t))return[];const i=ia(t,e)[0];return tWe(Yx(t,i,n))}function Bx(t,e){if(oi(t))return Zf;const{k:n,l:i,r}=t;if(e===n){if(oi(i))return r;if(oi(r))return i;const[s,o]=MV(i);return Gg(Or(t,{k:s,l:AV(i),v:o}))}return e<n?Gg(Or(t,{l:Bx(i,e)})):Gg(Or(t,{r:Bx(r,e)}))}function Jc(t){return oi(t)?[]:[...Jc(t.l),{k:t.k,v:t.v},...Jc(t.r)]}function Yx(t,e,n){if(oi(t))return[];const{k:i,l:r,r:s,v:o}=t;let a=[];return i>e&&(a=a.concat(Yx(r,e,n))),i>=e&&i<=n&&a.push({k:i,v:o}),i<=n&&(a=a.concat(Yx(s,e,n))),a}function Gg(t){const{l:e,lvl:n,r:i}=t;if(i.lvl>=n-1&&e.lvl>=n-1)return t;if(n>i.lvl+1){if(L1(e))return jV(Or(t,{lvl:n-1}));if(!oi(e)&&!oi(e.r))return Or(e.r,{l:Or(e,{r:e.r.l}),lvl:n,r:Or(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(L1(t))return qx(Or(t,{lvl:n-1}));if(!oi(i)&&!oi(i.l)){const r=i.l,s=L1(r)?i.lvl-1:i.lvl;return Or(r,{l:Or(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:qx(Or(i,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function Or(t,e){return WV(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function AV(t){return oi(t.r)?t.l:Gg(Or(t,{r:AV(t.r)}))}function L1(t){return oi(t)||t.lvl>t.r.lvl}function MV(t){return oi(t.r)?[t.k,t.v]:MV(t.r)}function WV(t,e,n,i=Zf,r=Zf){return{k:t,l:i,lvl:n,r,v:e}}function P3(t){return qx(jV(t))}function jV(t){const{l:e}=t;return!oi(e)&&e.lvl===t.lvl?Or(e,{r:Or(t,{l:e.r})}):t}function qx(t){const{lvl:e,r:n}=t;return!oi(n)&&!oi(n.r)&&n.lvl===e&&n.r.lvl===e?Or(n,{l:Or(t,{r:n.l}),lvl:e+1}):t}function tWe(t){return IV(t,({k:e,v:n})=>({index:e,value:n}))}function NV(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function Ff(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const eT=Ln(()=>({recalcInProgress:ot(!1)}),[],{singleton:!0});function LV(t,e,n){return t[$0(t,e,n)]}function $0(t,e,n,i=0){let r=t.length-1;for(;i<=r;){const s=Math.floor((i+r)/2),o=t[s],a=n(o,e);if(a===0)return s;if(a===-1){if(r-i<2)return s-1;r=s-1}else{if(r===i)return s;i=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function nWe(t,e,n,i){const r=$0(t,e,i),s=$0(t,n,i,r);return t.slice(r,s+1)}function bc(t,e){return Math.round(t.getBoundingClientRect()[e])}function L$(t){return!oi(t.groupOffsetTree)}function tT({index:t},e){return e===t?0:e<t?-1:1}function iWe(){return{groupIndices:[],groupOffsetTree:Tu(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Tu()}}function rWe(t,e){let n=oi(t)?0:1/0;for(const i of e){const{endIndex:r,size:s,startIndex:o}=i;if(n=Math.min(n,o),oi(t)){t=ro(t,0,s);continue}const a=ku(t,o-1,r+1);if(a.some(uWe(i)))continue;let l=!1,c=!1;for(const{end:d,start:u,value:O}of a)l?(r>=u||s===O)&&(t=Bx(t,u)):(c=O!==s,l=!0),d>r&&r>=u&&O!==s&&(t=ro(t,r+1,O));c&&(t=ro(t,o,s))}return[t,n]}function sWe(t){return typeof t.groupIndex<"u"}function oWe({offset:t},e){return e===t?0:e<t?-1:1}function Hf(t,e,n){if(e.length===0)return 0;const{index:i,offset:r,size:s}=LV(e,t,tT),o=t-i,a=s*o+(o-1)*n+r;return a>0?a+n:a}function VV(t,e){if(!L$(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function BV(t,e,n){if(sWe(t))return e.groupIndices[t.groupIndex]+1;const i=t.index==="LAST"?n:t.index;let r=VV(i,e);return r=Math.max(0,r,Math.min(n,r)),r}function aWe(t,e,n,i=0){return i>0&&(e=Math.max(e,LV(t,i,tT).offset)),IV(nWe(t,e,n,oWe),dWe)}function lWe(t,[e,n,i,r]){e.length>0&&i("received item sizes",e,fr.DEBUG);const s=t.sizeTree;let o=s,a=0;if(n.length>0&&oi(s)&&e.length===2){const O=e[0].size,h=e[1].size;o=n.reduce((p,m)=>ro(ro(p,m,O),m+1,h),o)}else[o,a]=rWe(o,e);if(o===s)return t;const{lastIndex:l,lastOffset:c,lastSize:d,offsetTree:u}=Dx(t.offsetTree,a,o,r);return{groupIndices:n,groupOffsetTree:n.reduce((O,h)=>ro(O,h,Hf(h,u,r)),Tu()),lastIndex:l,lastOffset:c,lastSize:d,offsetTree:u,sizeTree:o}}function cWe(t){return Jc(t).map(({k:e,v:n},i,r)=>{const s=r[i+1];return{endIndex:s!==void 0?s.k-1:1/0,size:n,startIndex:e}})}function C3(t,e){let n=0,i=0;for(;n<t;)n+=e[i+1]-e[i]-1,i++;return i-(n===t?0:1)}function Dx(t,e,n,i){let r=t,s=0,o=0,a=0,l=0;if(e!==0){l=$0(r,e-1,tT),a=r[l].offset;const c=ia(n,e-1);s=c[0],o=c[1],r.length&&r[l].size===ia(n,e)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(const{start:c,value:d}of ku(n,e,1/0)){const u=c-s,O=u*o+a+u*i;r.push({index:c,offset:O,size:d}),s=c,a=O,o=d}return{lastIndex:s,lastOffset:a,lastSize:o,offsetTree:r}}function dWe(t){return{index:t.index,value:t}}function uWe(t){const{endIndex:e,size:n,startIndex:i}=t;return r=>r.start===i&&(r.end===e||r.end===1/0)&&r.value===n}const OWe={offsetHeight:"height",offsetWidth:"width"},Ja=Ln(([{log:t},{recalcInProgress:e}])=>{const n=En(),i=En(),r=Kr(i,0),s=En(),o=En(),a=ot(0),l=ot([]),c=ot(void 0),d=ot(void 0),u=ot(void 0),O=ot(void 0),h=ot((Q,P)=>bc(Q,OWe[P])),p=ot(void 0),m=ot(0),g=iWe(),v=Kr(He(n,pn(l,t,m),za(lWe,g),$i()),g),$=Kr(He(l,$i(),za((Q,P)=>({current:P,prev:Q.current}),{current:[],prev:[]}),Rt(({prev:Q})=>Q)),[]);Nt(He(l,Ht(Q=>Q.length>0),pn(v,m),Rt(([Q,P,w])=>{const E=Q.reduce((z,k,T)=>ro(z,k,Hf(k,P.offsetTree,w)||T),Tu());return{...P,groupIndices:Q,groupOffsetTree:E}})),v),Nt(He(i,pn(v),Ht(([Q,{lastIndex:P}])=>Q<P),Rt(([Q,{lastIndex:P,lastSize:w}])=>[{endIndex:P,size:w,startIndex:Q}])),n),Nt(c,d);const b=Kr(He(c,Rt(Q=>Q===void 0)),!0);Nt(He(d,Ht(Q=>Q!==void 0&&oi(Pi(v).sizeTree)),Rt(Q=>{const P=Pi(u),w=Pi(l).length>0;return P!==void 0&&P!==0?w?[{endIndex:0,size:P,startIndex:0},{endIndex:1,size:Q,startIndex:1}]:[]:[{endIndex:0,size:Q,startIndex:0}]})),n),Nt(He(O,Ht(Q=>Q!==void 0&&Q.length>0&&oi(Pi(v).sizeTree)),Rt(Q=>{const P=[];let w=Q[0],E=0;for(let z=1;z<Q.length;z++){const k=Q[z];k!==w&&(P.push({endIndex:z-1,size:w,startIndex:E}),w=k,E=z)}return P.push({endIndex:Q.length-1,size:w,startIndex:E}),P})),n),Nt(He(l,pn(u,d),Ht(([,Q,P])=>Q!==void 0&&P!==void 0),Rt(([Q,P,w])=>{const E=[];for(let z=0;z<Q.length;z++){const k=Q[z],T=Q[z+1];E.push({startIndex:k,endIndex:k,size:P}),T!==void 0&&E.push({startIndex:k+1,endIndex:T-1,size:w})}return E})),n);const S=ao(He(n,pn(v),za(({sizes:Q},[P,w])=>({changed:w!==Q,sizes:w}),{changed:!1,sizes:g}),Rt(Q=>Q.changed)));Un(He(a,za((Q,P)=>({diff:Q.prev-P,prev:P}),{diff:0,prev:0}),Rt(Q=>Q.diff)),Q=>{const{groupIndices:P}=Pi(v);if(Q>0)hn(e,!0),hn(s,Q+C3(Q,P));else if(Q<0){const w=Pi($);w.length>0&&(Q-=C3(-Q,w)),hn(o,Q)}}),Un(He(a,pn(t)),([Q,P])=>{Q<0&&P("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},fr.ERROR)});const y=ao(s);Nt(He(s,pn(v),Rt(([Q,P])=>{const w=P.groupIndices.length>0,E=[],z=P.lastSize;if(w){const k=Gf(P.sizeTree,0);let T=0,x=0;for(;T<Q;){const X=P.groupIndices[x],I=P.groupIndices.length===x+1?1/0:P.groupIndices[x+1]-X-1;E.push({endIndex:X,size:k,startIndex:X}),E.push({endIndex:X+1+I-1,size:z,startIndex:X+1}),x++,T+=I+1}const R=Jc(P.sizeTree);return T!==Q&&R.shift(),R.reduce((X,{k:I,v:A})=>{let W=X.ranges;return X.prevSize!==0&&(W=[...X.ranges,{endIndex:I+Q-1,size:X.prevSize,startIndex:X.prevIndex}]),{prevIndex:I+Q,prevSize:A,ranges:W}},{prevIndex:Q,prevSize:0,ranges:E}).ranges}return Jc(P.sizeTree).reduce((k,{k:T,v:x})=>({prevIndex:T+Q,prevSize:x,ranges:[...k.ranges,{endIndex:T+Q-1,size:k.prevSize,startIndex:k.prevIndex}]}),{prevIndex:0,prevSize:z,ranges:[]}).ranges})),n);const _=ao(He(o,pn(v,m),Rt(([Q,{offsetTree:P},w])=>{const E=-Q;return Hf(E,P,w)})));return Nt(He(o,pn(v,m),Rt(([Q,P,w])=>{if(P.groupIndices.length>0){if(oi(P.sizeTree))return P;let z=Tu();const k=Pi($);let T=0,x=0,R=0;for(;T<-Q;){R=k[x];const X=k[x+1]-R-1;x++,T+=X+1}if(z=Jc(P.sizeTree).reduce((X,{k:I,v:A})=>ro(X,Math.max(0,I+Q),A),z),T!==-Q){const X=Gf(P.sizeTree,R);z=ro(z,0,X);const I=ia(P.sizeTree,-Q+1)[1];z=ro(z,1,I)}return{...P,sizeTree:z,...Dx(P.offsetTree,0,z,w)}}const E=Jc(P.sizeTree).reduce((z,{k,v:T})=>ro(z,Math.max(0,k+Q),T),Tu());return{...P,sizeTree:E,...Dx(P.offsetTree,0,E,w)}})),v),{beforeUnshiftWith:y,data:p,defaultItemSize:d,firstItemIndex:a,fixedItemSize:c,fixedGroupSize:u,gap:m,groupIndices:l,heightEstimates:O,itemSize:h,listRefresh:S,shiftWith:o,shiftWithOffset:_,sizeRanges:n,sizes:v,statefulTotalCount:r,totalCount:i,trackItemSizes:b,unshiftWith:s}},yi(_c,eT),{singleton:!0});function hWe(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const YV=Ln(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:i,scrollTop:r}])=>{const s=En(),o=En(),a=ao(He(s,Rt(hWe)));return Nt(He(a,Rt(l=>l.totalCount)),n),Nt(He(a,Rt(l=>l.groupIndices)),t),Nt(He(nr(r,e,i),Ht(([l,c])=>L$(c)),Rt(([l,c,d])=>ia(c.groupOffsetTree,Math.max(l-d,0),"v")[0]),$i(),Rt(l=>[l])),o),{groupCounts:s,topItemsIndexes:o}},yi(Ja,Xs)),Qc=Ln(([{log:t}])=>{const e=ot(!1),n=ao(He(e,Ht(i=>i),$i()));return Un(e,i=>{i&&Pi(t)("props updated",{},fr.DEBUG)}),{didMount:n,propsReady:e}},yi(_c),{singleton:!0}),fWe=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function qV(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!fWe)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const zp=Ln(([{gap:t,listRefresh:e,sizes:n,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:o,headerHeight:a,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:u},{log:O}])=>{const h=En(),p=En(),m=ot(0);let g=null,v=null,$=null;function b(){g!==null&&(g(),g=null),$!==null&&($(),$=null),v&&(clearTimeout(v),v=null),hn(l,!1)}return Nt(He(h,pn(n,u,i,m,a,o,O),pn(t,s,r),Rt(([[S,y,_,Q,P,w,E,z],k,T,x])=>{const R=qV(S),{align:X,behavior:I,offset:A}=R,W=Q-1,N=BV(R,y,W);let L=Hf(N,y.offsetTree,k)+w;X==="end"?(L+=T+ia(y.sizeTree,N)[1]-_+x,N===W&&(L+=E)):X==="center"?L+=(T+ia(y.sizeTree,N)[1]-_+x)/2:L-=P,A!==void 0&&A!==0&&(L+=A);const Y=j=>{b(),j?(z("retrying to scroll to",{location:S},fr.DEBUG),hn(h,S)):(hn(p,!0),z("list did not change, scroll successful",{},fr.DEBUG))};if(b(),I==="smooth"){let j=!1;$=Un(e,V=>{j=j||V}),g=Go(d,()=>{Y(j)})}else g=Go(He(e,pWe(150)),Y);return v=setTimeout(()=>{b()},1200),hn(l,!0),z("scrolling from index to",{behavior:I,index:N,top:L},fr.DEBUG),{behavior:I,top:L}})),c),{scrollTargetReached:p,scrollToIndex:h,topListHeight:m}},yi(Ja,Xs,_c),{singleton:!0});function pWe(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return i=>{i&&(e(!0),clearTimeout(n))}}}function nT(t,e){t===0?e():requestAnimationFrame(()=>{nT(t-1,e)})}function iT(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const Ip=Ln(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:i},{scrollTargetReached:r,scrollToIndex:s},{didMount:o}])=>{const a=ot(!0),l=ot(0),c=ot(!0);return Nt(He(o,pn(l),Ht(([d,u])=>u!==0),Qa(!1)),a),Nt(He(o,pn(l),Ht(([d,u])=>u!==0),Qa(!1)),c),Un(He(nr(e,o),pn(a,n,t,c),Ht(([[,d],u,{sizeTree:O},h,p])=>d&&(!oi(O)||HC(h))&&!u&&!p),pn(l)),([,d])=>{Go(r,()=>{hn(c,!0)}),nT(4,()=>{Go(i,()=>{hn(a,!0)}),hn(s,d)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},yi(Ja,Xs,zp,Qc),{singleton:!0});function DV(t,e){return Math.abs(t-e)<1.01}const Kf="up",Hh="down",mWe="none",gWe={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},vWe=0,Ap=Ln(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:i,scrollTop:r,viewportHeight:s}])=>{const o=ot(!1),a=ot(!0),l=En(),c=En(),d=ot(4),u=ot(vWe),O=Kr(He(Vx(He(Ft(r),md(1),Qa(!0)),He(Ft(r),md(1),Qa(!1),x3(100))),$i()),!1),h=Kr(He(Vx(He(n,Qa(!0)),He(n,Qa(!1),x3(200))),$i()),!1);Nt(He(nr(Ft(r),Ft(u)),Rt(([$,b])=>$<=b),$i()),a),Nt(He(a,gl(50)),c);const p=ao(He(nr(i,Ft(s),Ft(e),Ft(t),Ft(d)),za(($,[{scrollHeight:b,scrollTop:S},y,_,Q,P])=>{const w=S+y-b>-P,E={scrollHeight:b,scrollTop:S,viewportHeight:y};if(w){let k,T;return S>$.state.scrollTop?(k="SCROLLED_DOWN",T=$.state.scrollTop-S):(k="SIZE_DECREASED",T=$.state.scrollTop-S||$.scrollTopDelta),{atBottom:!0,atBottomBecause:k,scrollTopDelta:T,state:E}}let z;return E.scrollHeight>$.state.scrollHeight?z="SIZE_INCREASED":y<$.state.viewportHeight?z="VIEWPORT_HEIGHT_DECREASING":S<$.state.scrollTop?z="SCROLLING_UPWARDS":z="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:z,state:E}},gWe),$i(($,b)=>$!==void 0&&$.atBottom===b.atBottom))),m=Kr(He(i,za(($,{scrollHeight:b,scrollTop:S,viewportHeight:y})=>{if(!DV($.scrollHeight,b)){const _=b-(S+y)<1;return $.scrollTop!==S&&_?{changed:!0,jump:$.scrollTop-S,scrollHeight:b,scrollTop:S}:{changed:!0,jump:0,scrollHeight:b,scrollTop:S}}return{changed:!1,jump:0,scrollHeight:b,scrollTop:S}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Ht($=>$.changed),Rt($=>$.jump)),0);Nt(He(p,Rt($=>$.atBottom)),o),Nt(He(o,gl(50)),l);const g=ot(Hh);Nt(He(i,Rt(({scrollTop:$})=>$),$i(),za(($,b)=>Pi(h)?{direction:$.direction,prevScrollTop:b}:{direction:b<$.prevScrollTop?Kf:Hh,prevScrollTop:b},{direction:Hh,prevScrollTop:0}),Rt($=>$.direction)),g),Nt(He(i,gl(50),Qa(mWe)),g);const v=ot(0);return Nt(He(O,Ht($=>!$),Qa(0)),v),Nt(He(r,gl(100),pn(O),Ht(([$,b])=>b),za(([$,b],[S])=>[b,S],[0,0]),Rt(([$,b])=>b-$)),v),{atBottomState:p,atBottomStateChange:l,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:u,isAtBottom:o,isAtTop:a,isScrolling:O,lastJumpDueToItemResize:m,scrollDirection:g,scrollVelocity:v}},yi(Xs)),Jf="top",ep="bottom",T3="none";function k3(t,e,n){return typeof t=="number"?n===Kf&&e===Jf||n===Hh&&e===ep?t:0:n===Kf?e===Jf?t.main:t.reverse:e===ep?t.main:t.reverse}function R3(t,e){return typeof t=="number"?t:t[e]??0}const rT=Ln(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:i,viewportHeight:r}])=>{const s=En(),o=ot(0),a=ot(0),l=ot(0),c=Kr(He(nr(Ft(i),Ft(r),Ft(n),Ft(s,Ff),Ft(l),Ft(o),Ft(e),Ft(t),Ft(a)),Rt(([d,u,O,[h,p],m,g,v,$,b])=>{const S=d-$,y=g+v,_=Math.max(O-S,0);let Q=T3;const P=R3(b,Jf),w=R3(b,ep);return h-=$,h+=O+v,p+=O+v,p-=$,h>d+y-P&&(Q=Kf),p<d-_+u+w&&(Q=Hh),Q!==T3?[Math.max(S-O-k3(m,Jf,Q)-P,0),S-_-v+u+k3(m,ep,Q)+w]:null}),Ht(d=>d!==null),$i(Ff)),[0,0]);return{increaseViewportBy:a,listBoundary:s,overscan:l,topListHeight:o,visibleRange:c}},yi(Xs),{singleton:!0});function $We(t,e,n){if(L$(e)){const i=VV(t,e);return[{index:ia(e.groupOffsetTree,i)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:i,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:t,offset:0,size:0}]}const V1={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Fg(t,e,n,i,r,s){const{lastIndex:o,lastOffset:a,lastSize:l}=r;let c=0,d=0;if(t.length>0){c=t[0].offset;const m=t[t.length-1];d=m.offset+m.size}const u=n-o,O=a+u*l+(u-1)*i,h=c,p=O-d;return{bottom:d,firstItemIndex:s,items:E3(t,r,s),offsetBottom:p,offsetTop:c,top:h,topItems:E3(e,r,s),topListHeight:e.reduce((m,g)=>g.size+m,0),totalCount:n}}function UV(t,e,n,i,r,s){let o=0;if(n.groupIndices.length>0)for(const d of n.groupIndices){if(d-o>=t)break;o++}const a=t+o,l=iT(e,a),c=Array.from({length:a}).map((d,u)=>({data:s[u+l],index:u+l,offset:0,size:0}));return Fg(c,[],a,r,n,i)}function E3(t,e,n){if(t.length===0)return[];if(!L$(e))return t.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const i=t[0].index,r=t[t.length-1].index,s=[],o=ku(e.groupOffsetTree,i,r);let a,l=0;for(const c of t){(!a||a.end<c.index)&&(a=o.shift(),l=e.groupIndices.indexOf(a.start));let d;c.index===a.start?d={index:l,type:"group"}:d={groupIndex:l,index:c.index-(l+1)+n},s.push({...d,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return s}function X3(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Pd=Ln(([{data:t,firstItemIndex:e,gap:n,sizes:i,totalCount:r},s,{listBoundary:o,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:u},O,{didMount:h},{recalcInProgress:p}])=>{const m=ot([]),g=ot(0),v=En(),$=ot(0);Nt(s.topItemsIndexes,m);const b=Kr(He(nr(h,p,Ft(l,Ff),Ft(r),Ft(i),Ft(c),d,Ft(m),Ft(e),Ft(n),Ft($),t),Ht(([Q,P,,w,,,,,,,,E])=>{const z=E!==void 0&&E.length!==w;return Q&&!P&&!z}),Rt(([,,[Q,P],w,E,z,k,T,x,R,X,I])=>{var te,pe;const A=E,{offsetTree:W,sizeTree:N}=A,L=Pi(g);if(w===0)return{...V1,totalCount:w};if(Q===0&&P===0)return L===0?{...V1,totalCount:w}:UV(L,z,E,x,R,I||[]);if(oi(N))return L>0?null:Fg($We(iT(z,w),A,I),[],w,R,A,x);const Y=[];if(T.length>0){const oe=T[0],ee=T[T.length-1];let ae=0;for(const Z of ku(N,oe,ee)){const H=Z.value,K=Math.max(Z.start,oe),se=Math.min(Z.end,ee);for(let ce=K;ce<=se;ce++)Y.push({data:I==null?void 0:I[ce],index:ce,offset:ae,size:H}),ae+=H}}if(!k)return Fg([],Y,w,R,A,x);const j=T.length>0?T[T.length-1]+1:0,V=aWe(W,Q,P,j);if(V.length===0)return null;const B=w-1,F=N$([],oe=>{for(const ee of V){const ae=ee.value;let Z=ae.offset,H=ee.start;const K=ae.size;if(ae.offset<Q){H+=Math.floor((Q-ae.offset+R)/(K+R));const ce=H-ee.start;Z+=ce*K+ce*R}H<j&&(Z+=(j-H)*K,H=j);const se=Math.min(ee.end,B);for(let ce=H;ce<=se&&!(Z>=P);ce++)oe.push({data:I==null?void 0:I[ce],index:ce,offset:Z,size:K}),Z+=K+R}}),ie=X3(X,Jf),D=X3(X,ep);if(F.length>0&&(ie>0||D>0)){const oe=F[0],ee=F[F.length-1];if(ie>0&&oe.index>j){const ae=Math.min(ie,oe.index-j),Z=[];let H=oe.offset;for(let K=oe.index-1;K>=oe.index-ae;K--){const se=((te=ku(N,K,K)[0])==null?void 0:te.value)??oe.size;H-=se+R,Z.unshift({data:I==null?void 0:I[K],index:K,offset:H,size:se})}F.unshift(...Z)}if(D>0&&ee.index<B){const ae=Math.min(D,B-ee.index);let Z=ee.offset+ee.size+R;for(let H=ee.index+1;H<=ee.index+ae;H++){const K=((pe=ku(N,H,H)[0])==null?void 0:pe.value)??ee.size;F.push({data:I==null?void 0:I[H],index:H,offset:Z,size:K}),Z+=K+R}}}return Fg(F,Y,w,R,A,x)}),Ht(Q=>Q!==null),$i()),V1);Nt(He(t,Ht(HC),Rt(Q=>Q==null?void 0:Q.length)),r),Nt(He(b,Rt(Q=>Q.topListHeight)),u),Nt(u,a),Nt(He(b,Rt(Q=>[Q.top,Q.bottom])),o),Nt(He(b,Rt(Q=>Q.items)),v);const S=ao(He(b,Ht(({items:Q})=>Q.length>0),pn(r,t),Ht(([{items:Q},P])=>Q[Q.length-1].originalIndex===P-1),Rt(([,Q,P])=>[Q-1,P]),$i(Ff),Rt(([Q])=>Q))),y=ao(He(b,gl(200),Ht(({items:Q,topItems:P})=>Q.length>0&&Q[0].originalIndex===P.length),Rt(({items:Q})=>Q[0].index),$i())),_=ao(He(b,Ht(({items:Q})=>Q.length>0),Rt(({items:Q})=>{let P=0,w=Q.length-1;for(;Q[P].type==="group"&&P<w;)P++;for(;Q[w].type==="group"&&w>P;)w--;return{endIndex:Q[w].index,startIndex:Q[P].index}}),$i(NV)));return{endReached:S,initialItemCount:g,itemsRendered:v,listState:b,minOverscanItemCount:$,rangeChanged:_,startReached:y,topItemsIndexes:m,...O}},yi(Ja,YV,rT,Ip,zp,Ap,Qc,eT),{singleton:!0}),ZV=Ln(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:i},{listState:r}])=>{const s=En(),o=Kr(He(nr(n,t,i,e,r),Rt(([a,l,c,d,u])=>a+l+c+d+u.offsetBottom+u.bottom)),0);return Nt(Ft(o),s),{totalListHeight:o,totalListHeightChanged:s}},yi(Xs,Pd),{singleton:!0}),bWe=Ln(([{viewportHeight:t},{totalListHeight:e}])=>{const n=ot(!1),i=Kr(He(nr(n,t,e),Ht(([r])=>r),Rt(([,r,s])=>Math.max(0,r-s)),gl(0),$i()),0);return{alignToBottom:n,paddingTopAddition:i}},yi(Xs,ZV),{singleton:!0}),GV=Ln(()=>({context:ot(null)})),SWe=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:i,...r},viewportBottom:s,viewportTop:o})=>e<o?{...r,align:n??"start",...i!==void 0?{behavior:i}:{}}:t>s?{...r,align:n??"end",...i!==void 0?{behavior:i}:{}}:null,FV=Ln(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:i,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:o,scrollTop:a,viewportHeight:l},{scrollToIndex:c}])=>{const d=En();return Nt(He(d,pn(e,l,n,s,r,i,a),pn(t),Rt(([[u,O,h,p,m,g,v,$],b])=>{const{calculateViewLocation:S=SWe,done:y,..._}=u,Q=BV(u,O,p-1),P=Hf(Q,O.offsetTree,b)+m+g,w=P+ia(O.sizeTree,Q)[1],E=$+g,z=$+h-v,k=S({itemBottom:w,itemTop:P,locationParams:_,viewportBottom:z,viewportTop:E});return k!==null?y&&Go(He(o,Ht(T=>!T),md(Pi(o)?1:2)),y):y==null||y(),k}),Ht(u=>u!==null)),c),{scrollIntoView:d}},yi(Ja,Xs,zp,Pd,_c),{singleton:!0});function z3(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const yWe=(t,e)=>typeof t=="function"?z3(t(e)):e&&z3(t),_We=Ln(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:i},{atBottomState:r,isAtBottom:s},{scrollToIndex:o},{scrolledToInitialItem:a},{didMount:l,propsReady:c},{log:d},{scrollingInProgress:u},{context:O},{scrollIntoView:h}])=>{const p=ot(!1),m=En();let g=null;function v(y){hn(o,{align:"end",behavior:y,index:"LAST"})}Un(He(nr(He(Ft(e),md(1)),l),pn(Ft(p),s,a,u),Rt(([[y,_],Q,P,w,E])=>{let z=_&&w,k="auto";return z&&(k=yWe(Q,P||E),z=z&&k!==!1),{followOutputBehavior:k,shouldFollow:z,totalCount:y}}),Ht(({shouldFollow:y})=>y)),({followOutputBehavior:y,totalCount:_})=>{g!==null&&(g(),g=null),Pi(n)!==void 0?requestAnimationFrame(()=>{Pi(d)("following output to ",{totalCount:_},fr.DEBUG),v(y)}):g=Go(t,()=>{Pi(d)("following output to ",{totalCount:_},fr.DEBUG),v(y),g=null})});function $(y){const _=Go(r,Q=>{y&&!Q.atBottom&&Q.notAtBottomBecause==="SIZE_INCREASED"&&g===null&&(Pi(d)("scrolling to bottom due to increased size",{},fr.DEBUG),v("auto"))});setTimeout(_,100)}Un(He(nr(Ft(p),e,c),Ht(([y,,_])=>y!==!1&&_),za(({value:y},[,_])=>({refreshed:y===_,value:_}),{refreshed:!1,value:0}),Ht(({refreshed:y})=>y),pn(p,e)),([,y])=>{Pi(a)&&$(y!==!1)}),Un(m,()=>{$(Pi(p)!==!1)}),Un(nr(Ft(p),r),([y,_])=>{y!==!1&&!_.atBottom&&_.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&v("auto")});const b=ot(null),S=En();return Nt(Vx(He(Ft(i),Rt(y=>(y==null?void 0:y.length)??0)),He(Ft(e))),S),Un(He(nr(He(S,md(1)),l),pn(Ft(b),a,u,O),Rt(([[y,_],Q,P,w,E])=>_&&P&&(Q==null?void 0:Q({context:E,totalCount:y,scrollingInProgress:w}))),Ht(y=>!!y),gl(0)),y=>{g!==null&&(g(),g=null),Pi(n)!==void 0?requestAnimationFrame(()=>{Pi(d)("scrolling into view",{}),hn(h,y)}):g=Go(t,()=>{Pi(d)("scrolling into view",{}),hn(h,y),g=null})}),{autoscrollToBottom:m,followOutput:p,scrollIntoViewOnChange:b}},yi(Ja,Ap,zp,Ip,Qc,_c,Xs,GV,FV)),QWe=Ln(([{data:t,firstItemIndex:e,gap:n,sizes:i},{initialTopMostItemIndex:r},{initialItemCount:s,listState:o},{didMount:a}])=>(Nt(He(a,pn(s),Ht(([,l])=>l!==0),pn(r,i,e,n,t),Rt(([[,l],c,d,u,O,h=[]])=>UV(l,c,d,u,O,h))),o),{}),yi(Ja,Ip,Pd,Qc),{singleton:!0}),xWe=Ln(([{didMount:t},{scrollTo:e},{listState:n}])=>{const i=ot(0);return Un(He(t,pn(i),Ht(([,r])=>r!==0),Rt(([,r])=>({top:r}))),r=>{Go(He(n,md(1),Ht(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{hn(e,r)})})}),{initialScrollTop:i}},yi(Qc,Xs,Pd),{singleton:!0}),HV=Ln(([{scrollVelocity:t}])=>{const e=ot(!1),n=En(),i=ot(!1);return Nt(He(t,pn(i,e,n),Ht(([r,s])=>s!==!1&&s!==void 0),Rt(([r,s,o,a])=>{const{enter:l,exit:c}=s;if(o){if(c(r,a))return!1}else if(l(r,a))return!0;return o}),$i()),e),Un(He(nr(e,t,n),pn(i)),([[r,s,o],a])=>{r&&a!==!1&&a!==void 0&&a.change&&a.change(s,o)}),{isSeeking:e,scrollSeekConfiguration:i,scrollSeekRangeChanged:n,scrollVelocity:t}},yi(Ap),{singleton:!0}),sT=Ln(([{scrollContainerState:t,scrollTo:e}])=>{const n=En(),i=En(),r=En(),s=ot(!1),o=ot(void 0);return Nt(He(nr(n,i),Rt(([{scrollHeight:a,scrollTop:l,viewportHeight:c},{offsetTop:d}])=>({scrollHeight:a,scrollTop:Math.max(0,l-d),viewportHeight:c}))),t),Nt(He(e,pn(i),Rt(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:o,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:i}},yi(Xs)),wWe=Ln(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:i},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:o,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=En(),d=ot(void 0),u=ot(null),O=ot(null);return Nt(a,u),Nt(l,O),Un(He(c,pn(e,i,o,u,O,n)),([h,p,m,g,v,$,b])=>{const S=cWe(p.sizeTree);g&&v!==null&&$!==null&&(m=v.scrollTop-$.offsetTop),m-=b,h({ranges:S,scrollTop:m})}),Nt(He(d,Ht(HC),Rt(PWe)),r),Nt(He(s,pn(d),Ht(([,h])=>h!==void 0),$i(),Rt(([,h])=>h.ranges)),t),{getState:c,restoreStateFrom:d}},yi(Ja,Xs,Ip,Qc,sT));function PWe(t){return{align:"start",index:0,offset:t.scrollTop}}const CWe=Ln(([{topItemsIndexes:t}])=>{const e=ot(0);return Nt(He(e,Ht(n=>n>=0),Rt(n=>Array.from({length:n}).map((i,r)=>r))),t),{topItemCount:e}},yi(Pd));function KV(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const TWe=KV(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),kWe=Ln(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:i},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:o,scrollDirection:a},{listState:l},{beforeUnshiftWith:c,gap:d,shiftWithOffset:u,sizes:O},{log:h},{recalcInProgress:p}])=>{const m=ao(He(l,pn(o),za(([,v,$,b],[{bottom:S,items:y,offsetBottom:_,totalCount:Q},P])=>{const w=S+_;let E=0;return $===Q&&v.length>0&&y.length>0&&(y[0].originalIndex===0&&v[0].originalIndex===0||(E=w-b,E!==0&&(E+=P))),[E,y,Q,w]},[0,[],0,0]),Ht(([v])=>v!==0),pn(i,a,n,r,h,p),Ht(([,v,$,b,,,S])=>!S&&!b&&v!==0&&$===Kf),Rt(([[v],,,,,$])=>($("Upward scrolling compensation",{amount:v},fr.DEBUG),v))));function g(v){v>0?(hn(e,{behavior:"auto",top:-v}),hn(t,0)):(hn(t,0),hn(e,{behavior:"auto",top:-v}))}return Un(He(m,pn(t,s)),([v,$,b])=>{b&&TWe()?hn(t,$-v):g(-v)}),Un(He(nr(Kr(s,!1),t,p),Ht(([v,$,b])=>!v&&!b&&$!==0),Rt(([v,$])=>$),gl(1)),g),Nt(He(u,Rt(v=>({top:-v}))),e),Un(He(c,pn(O,d),Rt(([v,{groupIndices:$,lastSize:b,sizeTree:S},y])=>{function _(z){return z*(b+y)}if($.length===0)return _(v);let Q=0;const P=Gf(S,0);let w=0,E=0;for(;w<v;){w++,Q+=P;let z=$.length===E+1?1/0:$[E+1]-$[E]-1;w+z>v&&(Q-=P,z=v-w+1),w+=z,Q+=_(z),E++}return Q})),v=>{hn(t,v),requestAnimationFrame(()=>{hn(e,{top:v}),requestAnimationFrame(()=>{hn(t,0),hn(p,!1)})})}),{deviation:t}},yi(Xs,Ap,Pd,Ja,_c,eT)),RWe=Ln(([t,e,n,i,r,s,o,a,l,c,d])=>({...t,...e,...n,...i,...r,...s,...o,...a,...l,...c,...d}),yi(rT,QWe,Qc,HV,ZV,xWe,bWe,sT,FV,_c,GV)),JV=Ln(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:i,fixedGroupSize:r,gap:s,groupIndices:o,heightEstimates:a,itemSize:l,sizeRanges:c,sizes:d,statefulTotalCount:u,totalCount:O,trackItemSizes:h},{initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:g},v,$,b,S,{scrollToIndex:y},_,{topItemCount:Q},{groupCounts:P},w])=>{const{listState:E,minOverscanItemCount:z,topItemsIndexes:k,rangeChanged:T,...x}=S;return Nt(T,w.scrollSeekRangeChanged),Nt(He(w.windowViewportRect,Rt(R=>R.visibleHeight)),v.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:i,fixedGroupHeight:r,gap:s,groupCounts:P,heightEstimates:a,initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:g,sizeRanges:c,topItemCount:Q,topItemsIndexes:k,totalCount:O,...b,groupIndices:o,itemSize:l,listState:E,minOverscanItemCount:z,scrollToIndex:y,statefulTotalCount:u,trackItemSizes:h,rangeChanged:T,...x,...w,...v,sizes:d,...$}},yi(Ja,Ip,Xs,wWe,_We,Pd,zp,kWe,CWe,YV,RWe));function EWe(t,e){const n={},i={};let r=0;const s=t.length;for(;r<s;)i[t[r]]=1,r+=1;for(const o in e)Object.hasOwn(i,o)||(n[o]=e[o]);return n}const ng=typeof document<"u"?U.useLayoutEffect:U.useEffect;function eB(t,e,n){const i=Object.keys(e.required||{}),r=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),o=Object.keys(e.events||{}),a=U.createContext({});function l(g,v){g.propsReady!==void 0&&hn(g.propsReady,!1);for(const $ of i){const b=g[e.required[$]];hn(b,v[$])}for(const $ of r)if($ in v){const b=g[e.optional[$]];hn(b,v[$])}g.propsReady!==void 0&&hn(g.propsReady,!0)}function c(g){return s.reduce((v,$)=>(v[$]=b=>{const S=g[e.methods[$]];hn(S,b)},v),{})}function d(g){return o.reduce((v,$)=>(v[$]=Z9e(g[e.events[$]]),v),{})}const u=U.forwardRef(function(g,v){const{children:$,...b}=g,[S]=U.useState(()=>N$(F9e(t),Q=>{l(Q,b)})),[y]=U.useState(Q3(d,S));ng(()=>{for(const Q of o)Q in b&&Un(y[Q],b[Q]);return()=>{Object.values(y).map(KC)}},[b,y,S]),ng(()=>{l(S,b)}),U.useImperativeHandle(v,_3(c(S)));const _=n;return C.jsx(a.Provider,{value:S,children:n!==void 0?C.jsx(_,{...EWe([...i,...r,...o],b),children:$}):$})}),O=g=>{const v=U.useContext(a);return U.useCallback($=>{hn(v[g],$)},[v,g])},h=g=>{const v=U.useContext(a)[g],$=U.useCallback(b=>Un(v,b),[v]);return U.useSyncExternalStore($,()=>Pi(v),()=>Pi(v))},p=g=>{const v=U.useContext(a)[g],[$,b]=U.useState(Q3(Pi,v));return ng(()=>Un(v,S=>{S!==$&&b(_3(S))}),[v,$]),$},m=U.version.startsWith("18")?h:p;return{Component:u,useEmitter:(g,v)=>{const $=U.useContext(a)[g];ng(()=>Un($,v),[v,$])},useEmitterValue:m,usePublisher:O}}const tB=U.createContext(void 0),nB=U.createContext(void 0),B1="-webkit-sticky",I3="sticky",oT=KV(()=>{if(typeof document>"u")return I3;const t=document.createElement("div");return t.style.position=B1,t.style.position===B1?B1:I3}),iB=typeof document<"u"?U.useLayoutEffect:U.useEffect;function Y1(t){return"self"in t}function XWe(t){return"body"in t}function rB(t,e,n,i=RO,r,s){const o=U.useRef(null),a=U.useRef(null),l=U.useRef(null),c=U.useCallback(O=>{let h,p,m;const g=O.target;if(XWe(g)||Y1(g)){const $=Y1(g)?g:g.defaultView;m=s===!0?$.scrollX:$.scrollY,h=s===!0?$.document.documentElement.scrollWidth:$.document.documentElement.scrollHeight,p=s===!0?$.innerWidth:$.innerHeight}else m=s===!0?g.scrollLeft:g.scrollTop,h=s===!0?g.scrollWidth:g.scrollHeight,p=s===!0?g.offsetWidth:g.offsetHeight;const v=()=>{t({scrollHeight:h,scrollTop:Math.max(m,0),viewportHeight:p})};O.suppressFlushSync===!0?v():sd.flushSync(v),a.current!==null&&(m===a.current||m<=0||m===h-p)&&(a.current=null,e(!0),l.current&&(clearTimeout(l.current),l.current=null))},[t,e,s]);U.useEffect(()=>{const O=r||o.current;return i(r||o.current),c({suppressFlushSync:!0,target:O}),O.addEventListener("scroll",c,{passive:!0}),()=>{i(null),O.removeEventListener("scroll",c)}},[o,c,n,i,r]);function d(O){const h=o.current;if(!h||(s===!0?"offsetWidth"in h&&h.offsetWidth===0:"offsetHeight"in h&&h.offsetHeight===0))return;const p=O.behavior==="smooth";let m,g,v;Y1(h)?(g=Math.max(bc(h.document.documentElement,s===!0?"width":"height"),s===!0?h.document.documentElement.scrollWidth:h.document.documentElement.scrollHeight),m=s===!0?h.innerWidth:h.innerHeight,v=s===!0?window.scrollX:window.scrollY):(g=h[s===!0?"scrollWidth":"scrollHeight"],m=bc(h,s===!0?"width":"height"),v=h[s===!0?"scrollLeft":"scrollTop"]);const $=g-m;if(O.top=Math.ceil(Math.max(Math.min($,O.top),0)),DV(m,g)||O.top===v){t({scrollHeight:g,scrollTop:v,viewportHeight:m}),p&&e(!0);return}p?(a.current=O.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,e(!0)},1e3)):a.current=null,s===!0&&(O={...O.behavior!==void 0?{behavior:O.behavior}:{},left:O.top}),h.scrollTo(O)}function u(O){s===!0&&(O={...O.behavior!==void 0?{behavior:O.behavior}:{},...O.top!==void 0?{left:O.top}:{}}),o.current.scrollBy(O)}return{scrollByCallback:u,scrollerRef:o,scrollToCallback:d}}function aT(t){return t}const zWe=Ln(()=>{const t=ot(a=>`Item ${a}`),e=ot(a=>`Group ${a}`),n=ot({}),i=ot(aT),r=ot("div"),s=ot(RO),o=(a,l=null)=>Kr(He(n,Rt(c=>c[a]),$i()),l);return{components:n,computeItemKey:i,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:e,HeaderComponent:o("Header"),HeaderFooterTag:r,ItemComponent:o("Item","div"),itemContent:t,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),IWe=Ln(([t,e])=>({...t,...e}),yi(JV,zWe)),AWe=({height:t})=>C.jsx("div",{style:{height:t}}),MWe={overflowAnchor:"none",position:oT(),zIndex:1},sB={overflowAnchor:"none"},WWe={...sB,display:"inline-block",height:"100%"},A3=U.memo(function({showTopList:t=!1}){const e=ln("listState"),n=Po("sizeRanges"),i=ln("useWindowScroll"),r=ln("customScrollParent"),s=Po("windowScrollContainerState"),o=Po("scrollContainerState"),a=r||i?s:o,l=ln("itemContent"),c=ln("context"),d=ln("groupContent"),u=ln("trackItemSizes"),O=ln("itemSize"),h=ln("log"),p=Po("gap"),m=ln("horizontalDirection"),{callbackRef:g}=J9e(n,O,u,t?RO:a,h,p,r,m,ln("skipAnimationFrameInResizeObserver")),[v,$]=U.useState(0);lT("deviation",x=>{v!==x&&$(x)});const b=ln("EmptyPlaceholder"),S=ln("ScrollSeekPlaceholder")??AWe,y=ln("ListComponent"),_=ln("ItemComponent"),Q=ln("GroupComponent"),P=ln("computeItemKey"),w=ln("isSeeking"),E=ln("groupIndices").length>0,z=ln("alignToBottom"),k=ln("initialItemFinalLocationReached"),T=t?{}:{boxSizing:"border-box",...m?{display:"inline-block",height:"100%",marginLeft:v!==0?v:z?"auto":0,paddingLeft:e.offsetTop,paddingRight:e.offsetBottom,whiteSpace:"nowrap"}:{marginTop:v!==0?v:z?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},...k?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&b!==null&&b!==void 0?C.jsx(b,{...Hr(b,c)}):C.jsx(y,{...Hr(y,c),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:T,children:(t?e.topItems:e.items).map(x=>{const R=x.originalIndex,X=P(R+e.firstItemIndex,x.data,c);return w?f.createElement(S,{...Hr(S,c),height:x.size,index:x.index,key:X,type:x.type||"item",...x.type==="group"?{}:{groupIndex:x.groupIndex}}):x.type==="group"?f.createElement(Q,{...Hr(Q,c),"data-index":R,"data-item-index":x.index,"data-known-size":x.size,key:X,style:MWe},d(x.index,c)):f.createElement(_,{...Hr(_,c),...VWe(_,x.data),"data-index":R,"data-item-group-index":x.groupIndex,"data-item-index":x.index,"data-known-size":x.size,key:X,style:m?WWe:sB},E?l(x.index,x.groupIndex,x.data,c):l(x.index,x.data,c))})})}),jWe={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},NWe={outline:"none",overflowX:"auto",position:"relative"},V$=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),LWe={position:oT(),top:0,width:"100%",zIndex:1};function Hr(t,e){if(typeof t!="string")return{context:e}}function VWe(t,e){return{item:typeof t=="string"?void 0:e}}const BWe=U.memo(function(){const t=ln("HeaderComponent"),e=Po("headerHeight"),n=ln("HeaderFooterTag"),i=wd(U.useMemo(()=>s=>{e(bc(s,"height"))},[e]),!0,ln("skipAnimationFrameInResizeObserver")),r=ln("context");return t!=null?C.jsx(n,{ref:i,children:C.jsx(t,{...Hr(t,r)})}):null}),YWe=U.memo(function(){const t=ln("FooterComponent"),e=Po("footerHeight"),n=ln("HeaderFooterTag"),i=wd(U.useMemo(()=>s=>{e(bc(s,"height"))},[e]),!0,ln("skipAnimationFrameInResizeObserver")),r=ln("context");return t!=null?C.jsx(n,{ref:i,children:C.jsx(t,{...Hr(t,r)})}):null});function oB({useEmitter:t,useEmitterValue:e,usePublisher:n}){return U.memo(function({children:i,style:r,context:s,...o}){const a=n("scrollContainerState"),l=e("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=e("scrollerRef"),u=e("horizontalDirection")||!1,{scrollByCallback:O,scrollerRef:h,scrollToCallback:p}=rB(a,c,l,d,void 0,u);return t("scrollTo",p),t("scrollBy",O),C.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:h,style:{...u?NWe:jWe,...r},tabIndex:0,...o,...Hr(l,s),children:i})})}function aB({useEmitter:t,useEmitterValue:e,usePublisher:n}){return U.memo(function({children:i,style:r,context:s,...o}){const a=n("windowScrollContainerState"),l=e("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=e("totalListHeight"),u=e("deviation"),O=e("customScrollParent"),h=U.useRef(null),p=e("scrollerRef"),{scrollByCallback:m,scrollerRef:g,scrollToCallback:v}=rB(a,c,l,p,O);return iB(()=>{var $;return g.current=O||(($=h.current)==null?void 0:$.ownerDocument.defaultView),()=>{g.current=null}},[g,O]),t("windowScrollTo",v),t("scrollBy",m),C.jsx(l,{ref:h,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...d!==0?{height:d+u}:void 0},...o,...Hr(l,s),children:i})})}const qWe=({children:t})=>{const e=U.useContext(tB),n=Po("viewportHeight"),i=Po("fixedItemHeight"),r=ln("alignToBottom"),s=ln("horizontalDirection"),o=U.useMemo(()=>EV(n,l=>bc(l,s?"width":"height")),[n,s]),a=wd(o,!0,ln("skipAnimationFrameInResizeObserver"));return U.useEffect(()=>{e&&(n(e.viewportHeight),i(e.itemHeight))},[e,n,i]),C.jsx("div",{"data-viewport-type":"element",ref:a,style:V$(r),children:t})},DWe=({children:t})=>{const e=U.useContext(tB),n=Po("windowViewportRect"),i=Po("fixedItemHeight"),r=ln("customScrollParent"),s=zV(n,r,ln("skipAnimationFrameInResizeObserver")),o=ln("alignToBottom");return U.useEffect(()=>{e&&(i(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,i]),C.jsx("div",{"data-viewport-type":"window",ref:s,style:V$(o),children:t})},UWe=({children:t})=>{const e=ln("TopItemListComponent")??"div",n=ln("headerHeight"),i={...LWe,marginTop:`${n}px`},r=ln("context");return C.jsx(e,{style:i,...Hr(e,r),children:t})},ZWe=U.memo(function(t){const e=ln("useWindowScroll"),n=ln("topItemsIndexes").length>0,i=ln("customScrollParent"),r=ln("context");return C.jsxs(i||e?HWe:FWe,{...t,context:r,children:[n&&C.jsx(UWe,{children:C.jsx(A3,{showTopList:!0})}),C.jsxs(i||e?DWe:qWe,{children:[C.jsx(BWe,{}),C.jsx(A3,{}),C.jsx(YWe,{})]})]})}),{Component:GWe,useEmitter:lT,useEmitterValue:ln,usePublisher:Po}=eB(IWe,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ZWe),FWe=oB({useEmitter:lT,useEmitterValue:ln,usePublisher:Po}),HWe=aB({useEmitter:lT,useEmitterValue:ln,usePublisher:Po}),KWe=GWe,JWe=Ln(()=>{const t=ot(c=>C.jsxs("td",{children:["Item $",c]})),e=ot(null),n=ot(c=>C.jsxs("td",{colSpan:1e3,children:["Group ",c]})),i=ot(null),r=ot(null),s=ot({}),o=ot(aT),a=ot(RO),l=(c,d=null)=>Kr(He(s,Rt(u=>u[c]),$i()),d);return{components:s,computeItemKey:o,context:e,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:i,itemContent:t,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}});yi(JV,JWe);oT();const M3={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},eje={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:W3,floor:b0,max:Kh,min:q1,round:j3}=Math;function N3(t,e,n){return Array.from({length:e-t+1}).map((i,r)=>({data:n===null?null:n[r+t],index:r+t}))}function tje(t){return{...eje,items:t}}function ig(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function nje(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const ije=Ln(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:i},{footerHeight:r,headerHeight:s,scrollBy:o,scrollContainerState:a,scrollTo:l,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:u},O,h,{didMount:p,propsReady:m},{customScrollParent:g,useWindowScroll:v,windowScrollContainerState:$,windowScrollTo:b,windowViewportRect:S},y])=>{const _=ot(0),Q=ot(0),P=ot(M3),w=ot({height:0,width:0}),E=ot({height:0,width:0}),z=En(),k=En(),T=ot(0),x=ot(null),R=ot({column:0,row:0}),X=En(),I=En(),A=ot(!1),W=ot(0),N=ot(!0),L=ot(!1),Y=ot(!1);Un(He(p,pn(W),Ht(([D,te])=>te!==0)),()=>{hn(N,!1)}),Un(He(nr(p,N,E,w,W,L),Ht(([D,te,pe,oe,,ee])=>D&&!te&&pe.height!==0&&oe.height!==0&&!ee)),([,,,,D])=>{hn(L,!0),nT(1,()=>{hn(z,D)}),Go(He(c),()=>{hn(e,[0,0]),hn(N,!0)})}),Nt(He(I,Ht(D=>D!=null&&D.scrollTop>0),Qa(0)),Q),Un(He(p,pn(I),Ht(([,D])=>D!=null)),([,D])=>{D&&(hn(w,D.viewport),hn(E,D.item),hn(R,D.gap),D.scrollTop>0&&(hn(A,!0),Go(He(c,md(1)),te=>{hn(A,!1)}),hn(l,{top:D.scrollTop})))}),Nt(He(w,Rt(({height:D})=>D)),u),Nt(He(nr(Ft(w,ig),Ft(E,ig),Ft(R,(D,te)=>D!==void 0&&D.column===te.column&&D.row===te.row),Ft(c)),Rt(([D,te,pe,oe])=>({gap:pe,item:te,scrollTop:oe,viewport:D}))),X),Nt(He(nr(Ft(_),i,Ft(R,nje),Ft(E,ig),Ft(w,ig),Ft(x),Ft(Q),Ft(A),Ft(N),Ft(W)),Ht(([,,,,,,,D])=>!D),Rt(([D,[te,pe],oe,ee,ae,Z,H,,K,se])=>{const{column:ce,row:ve}=oe,{height:be,width:de}=ee,{width:me}=ae;if(H===0&&(D===0||me===0))return M3;if(de===0){const Ce=iT(se,D),we=Ce+Math.max(H-1,0);return tje(N3(Ce,we,Z))}const he=lB(me,de,ce);let fe,ke;K?te===0&&pe===0&&H>0?(fe=0,ke=H-1):(fe=he*b0((te+ve)/(be+ve)),ke=he*W3((pe+ve)/(be+ve))-1,ke=q1(D-1,Kh(ke,he-1)),fe=q1(ke,Kh(0,fe))):(fe=0,ke=-1);const Ae=N3(fe,ke,Z),{bottom:De,top:Ze}=L3(ae,oe,ee,Ae),qe=W3(D/he),Je=qe*be+(qe-1)*ve-De;return{bottom:De,itemHeight:be,items:Ae,itemWidth:de,offsetBottom:Je,offsetTop:Ze,top:Ze}})),P),Nt(He(x,Ht(D=>D!==null),Rt(D=>D.length)),_),Nt(He(nr(w,E,P,R),Ht(([D,te,{items:pe}])=>pe.length>0&&te.height!==0&&D.height!==0),Rt(([D,te,{items:pe},oe])=>{const{bottom:ee,top:ae}=L3(D,oe,te,pe);return[ae,ee]}),$i(Ff)),e);const j=ot(!1);Nt(He(c,pn(j),Rt(([D,te])=>te||D!==0)),j);const V=ao(He(nr(P,_),Ht(([{items:D}])=>D.length>0),pn(j),Ht(([[D,te],pe])=>{const oe=D.items[D.items.length-1].index===te-1;return(pe||D.bottom>0&&D.itemHeight>0&&D.offsetBottom===0&&D.items.length===te)&&oe}),Rt(([[,D]])=>D-1),$i())),B=ao(He(Ft(P),Ht(({items:D})=>D.length>0&&D[0].index===0),Qa(0),$i())),F=ao(He(Ft(P),pn(A),Ht(([{items:D},te])=>D.length>0&&!te),Rt(([{items:D}])=>({endIndex:D[D.length-1].index,startIndex:D[0].index})),$i(NV),gl(0)));Nt(F,h.scrollSeekRangeChanged),Nt(He(z,pn(w,E,_,R),Rt(([D,te,pe,oe,ee])=>{const ae=qV(D),{align:Z,behavior:H,offset:K}=ae;let se=ae.index;se==="LAST"&&(se=oe-1),se=Kh(0,se,q1(oe-1,se));let ce=Ux(te,ee,pe,se);return Z==="end"?ce=j3(ce-te.height+pe.height):Z==="center"&&(ce=j3(ce-te.height/2+pe.height/2)),K!==void 0&&K!==0&&(ce+=K),{behavior:H,top:ce}})),l);const ie=Kr(He(P,Rt(D=>D.offsetBottom+D.bottom)),0);return Nt(He(S,Rt(D=>({height:D.visibleHeight,width:D.visibleWidth}))),w),{customScrollParent:g,data:x,deviation:T,footerHeight:r,gap:R,headerHeight:s,increaseViewportBy:t,initialItemCount:Q,itemDimensions:E,overscan:n,restoreStateFrom:I,scrollBy:o,scrollContainerState:a,scrollHeight:k,scrollTo:l,scrollToIndex:z,scrollTop:c,smoothScrollTargetReached:d,totalCount:_,useWindowScroll:v,viewportDimensions:w,windowScrollContainerState:$,windowScrollTo:b,windowViewportRect:S,...h,gridState:P,horizontalDirection:Y,initialTopMostItemIndex:W,totalListHeight:ie,...O,endReached:V,propsReady:m,rangeChanged:F,startReached:B,stateChanged:X,stateRestoreInProgress:A,...y}},yi(rT,Xs,Ap,HV,Qc,sT,_c));function lB(t,e,n){return Kh(1,b0((t+n)/(b0(e)+n)))}function L3(t,e,n,i){const{height:r}=n;if(r===void 0||i.length===0)return{bottom:0,top:0};const s=Ux(t,e,n,i[0].index);return{bottom:Ux(t,e,n,i[i.length-1].index)+r,top:s}}function Ux(t,e,n,i){const r=lB(t.width,n.width,e.column),s=b0(i/r),o=s*n.height+Kh(0,s-1)*e.row;return o>0?o+e.row:o}const rje=Ln(()=>{const t=ot(u=>`Item ${u}`),e=ot({}),n=ot(null),i=ot("virtuoso-grid-item"),r=ot("virtuoso-grid-list"),s=ot(aT),o=ot("div"),a=ot(RO),l=(u,O=null)=>Kr(He(e,Rt(h=>h[u]),$i()),O),c=ot(!1),d=ot(!1);return Nt(Ft(d),c),{components:e,computeItemKey:s,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:o,itemClassName:i,ItemComponent:l("Item","div"),itemContent:t,listClassName:r,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),sje=Ln(([t,e])=>({...t,...e}),yi(ije,rje)),oje=U.memo(function(){const t=wi("gridState"),e=wi("listClassName"),n=wi("itemClassName"),i=wi("itemContent"),r=wi("computeItemKey"),s=wi("isSeeking"),o=Co("scrollHeight"),a=wi("ItemComponent"),l=wi("ListComponent"),c=wi("ScrollSeekPlaceholder"),d=wi("context"),u=Co("itemDimensions"),O=Co("gap"),h=wi("log"),p=wi("stateRestoreInProgress"),m=Co("reportReadyState"),g=wd(U.useMemo(()=>v=>{const $=v.parentElement.parentElement.scrollHeight;o($);const b=v.firstChild;if(b!==null){const{height:S,width:y}=b.getBoundingClientRect();u({height:S,width:y})}O({column:V3("column-gap",getComputedStyle(v).columnGap,h),row:V3("row-gap",getComputedStyle(v).rowGap,h)})},[o,u,O,h]),!0,!1);return iB(()=>{t.itemHeight>0&&t.itemWidth>0&&m(!0)},[t]),p?null:C.jsx(l,{className:e,ref:g,...Hr(l,d),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(v=>{const $=r(v.index,v.data,d);return s?C.jsx(c,{...Hr(c,d),height:t.itemHeight,index:v.index,width:t.itemWidth},$):f.createElement(a,{...Hr(a,d),className:n,"data-index":v.index,key:$},i(v.index,v.data,d))})})}),aje=U.memo(function(){const t=wi("HeaderComponent"),e=Co("headerHeight"),n=wi("headerFooterTag"),i=wd(U.useMemo(()=>s=>{e(bc(s,"height"))},[e]),!0,!1),r=wi("context");return t!=null?C.jsx(n,{ref:i,children:C.jsx(t,{...Hr(t,r)})}):null}),lje=U.memo(function(){const t=wi("FooterComponent"),e=Co("footerHeight"),n=wi("headerFooterTag"),i=wd(U.useMemo(()=>s=>{e(bc(s,"height"))},[e]),!0,!1),r=wi("context");return t!=null?C.jsx(n,{ref:i,children:C.jsx(t,{...Hr(t,r)})}):null}),cje=({children:t})=>{const e=U.useContext(nB),n=Co("itemDimensions"),i=Co("viewportDimensions"),r=wd(U.useMemo(()=>s=>{i(s.getBoundingClientRect())},[i]),!0,!1);return U.useEffect(()=>{e&&(i({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,i,n]),C.jsx("div",{ref:r,style:V$(!1),children:t})},dje=({children:t})=>{const e=U.useContext(nB),n=Co("windowViewportRect"),i=Co("itemDimensions"),r=wi("customScrollParent"),s=zV(n,r,!1);return U.useEffect(()=>{e&&(i({height:e.itemHeight,width:e.itemWidth}),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,i]),C.jsx("div",{ref:s,style:V$(!1),children:t})},uje=U.memo(function({...t}){const e=wi("useWindowScroll"),n=wi("customScrollParent"),i=n||e?hje:Oje,r=n||e?dje:cje,s=wi("context");return C.jsx(i,{...t,...Hr(i,s),children:C.jsxs(r,{children:[C.jsx(aje,{}),C.jsx(oje,{}),C.jsx(lje,{})]})})}),{useEmitter:cB,useEmitterValue:wi,usePublisher:Co}=eB(sje,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},uje),Oje=oB({useEmitter:cB,useEmitterValue:wi,usePublisher:Co}),hje=aB({useEmitter:cB,useEmitterValue:wi,usePublisher:Co});function V3(t,e,n){return e!=="normal"&&(e==null?void 0:e.endsWith("px"))!==!0&&n(`${t} was not resolved to pixel value correctly`,e,fr.WARN),e==="normal"?0:parseInt(e??"0",10)}const fje="_centerEmpty_ozv0m_1",pje="_container_ozv0m_8",mje="_mobileVirtuoso_ozv0m_18",gje="_sessionDividerText_ozv0m_23",vje="_lastResponseLabel_ozv0m_28",$je="_splitContainer_ozv0m_32",bje="_chatSection_ozv0m_39",Sje="_vResizer_ozv0m_47",yje="_terminalToggle_ozv0m_61",_je="_messageListWrap_ozv0m_84",Qje="_stickyBottomBtn_ozv0m_92",xje="_loadMoreWrap_ozv0m_142",wje="_loadMoreBtn_ozv0m_148",Pje="_navSidebar_ozv0m_164",Cje="_navBtn_ozv0m_181",Tje="_navBtnActive_ozv0m_201",kje="_navAvatarImg_ozv0m_221",Rje="_userPromptNavList_ozv0m_228",Eje="_userPromptNavItem_ozv0m_237",Xje="_terminalPanelWrap_ozv0m_257",zje="_navSidebarContent_ozv0m_264",Ije="_innerSplitArea_ozv0m_272",Aje="_chatSectionFlex_ozv0m_279",Mje="_overlayPanel_ozv0m_288",Wje="_streamingSpinnerWrap_ozv0m_296",jje="_sessionDivider_ozv0m_23",Nje="_loadMoreBtnLoading_ozv0m_309",Lje="_lastResponseDivider_ozv0m_314",Dt={centerEmpty:fje,container:pje,mobileVirtuoso:mje,sessionDividerText:gje,lastResponseLabel:vje,splitContainer:$je,chatSection:bje,vResizer:Sje,terminalToggle:yje,messageListWrap:_je,stickyBottomBtn:Qje,loadMoreWrap:xje,loadMoreBtn:wje,navSidebar:Pje,navBtn:Cje,navBtnActive:Tje,navAvatarImg:kje,userPromptNavList:Rje,userPromptNavItem:Eje,terminalPanelWrap:Xje,navSidebarContent:zje,innerSplitArea:Ije,chatSectionFlex:Aje,overlayPanel:Mje,streamingSpinnerWrap:Wje,sessionDivider:jje,loadMoreBtnLoading:Nje,lastResponseDivider:Lje},{Text:D1}=Tl,U1=240,Vje=100,Bje={},B3={},Yje=U.forwardRef((t,e)=>C.jsx("div",{ref:e,...t,className:Dt.container}));function qje(){return 100+Math.random()*50}class HYe extends U.Component{constructor(n){super(n);nt(this,"handleStickToBottom",()=>{this.setState({stickyBottom:!0},()=>{if(Gt&&this.virtuosoRef.current)this.virtuosoRef.current.scrollToIndex({index:"LAST",behavior:"smooth"});else{const n=this.containerRef.current;n&&(n.scrollTop=n.scrollHeight)}})});nt(this,"handleLoadMore",()=>{var o;this._mobileExtraItems+=Vje;const n=((o=this.state.allItems)==null?void 0:o.length)||0,i=this.buildAllItems(),r=this._applyMobileSlice(i),s=r.length-n;if(Gt&&this.virtuosoRef.current)this.setState({allItems:r,lastResponseItems:this._lastResponseItems,visibleCount:r.length},()=>{this.virtuosoRef.current&&s>0&&this.virtuosoRef.current.scrollToIndex({index:s,align:"start"})});else{const a=this.containerRef.current,l=a?a.scrollHeight:0,c=a?a.scrollTop:0;this.setState({allItems:r,lastResponseItems:this._lastResponseItems,visibleCount:r.length},()=>{if(a){const d=a.scrollHeight;a.scrollTop=c+(d-l)}})}});nt(this,"handlePresetSend",n=>{if(!n)return;const i=this._inputRef.current;i&&(i.value=n,i.style.height="auto",i.style.height=Math.min(i.scrollHeight,Gt?160:120)+"px",this.setState({inputEmpty:!1}),i.focus())});nt(this,"handlePromptOptionClick",n=>{if(this._promptSubmitting)return;const i=this._inputWs;if(!i||i.readyState!==WebSocket.OPEN)return;let r=this.state.ptyPrompt;r||(r=this.state.ptyPromptHistory.slice().reverse().find(O=>O.status==="active")||{options:Array.from({length:Math.max(n,3)},(O,h)=>({number:h+1,selected:h===0}))}),this._promptSubmitting=!0;const s=r.options,o=s.findIndex(O=>O.number===n);let a=s.findIndex(O=>O.selected);a<0&&(a=0);const l=o-a,c=l>0?"\x1B[B":"\x1B[A",d=Math.abs(l),u=O=>{O<d?(i.send(JSON.stringify({type:"input",data:c})),setTimeout(()=>u(O+1),30)):setTimeout(()=>{i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"input",data:"\r"}))},50)};u(0),this._currentPtyPrompt=null,this.setState(O=>{const h=O.ptyPromptHistory.slice(),p=h[h.length-1];return p&&p.status==="active"&&(h[h.length-1]={...p,status:"answered",selectedNumber:n}),{ptyPrompt:null,ptyPromptHistory:h}}),this._ptyBuffer="",this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),setTimeout(()=>{this._promptSubmitting=!1},500)});nt(this,"handlePermissionAllow",n=>{const i=this._inputWs;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"perm-hook-answer",id:n,decision:"allow"})),this.setState({pendingPermission:null})});nt(this,"handlePermissionAllowSession",n=>{const i=this._inputWs;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"perm-hook-answer",id:n,decision:"allow",allowSession:!0})),this.setState({pendingPermission:null})});nt(this,"handlePermissionDeny",n=>{const i=this._inputWs;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"perm-hook-answer",id:n,decision:"deny"})),this.setState({pendingPermission:null})});nt(this,"handlePlanApprove",n=>{const i=this._inputWs;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"sdk-plan-answer",id:n,approve:!0})),this.setState({pendingPlanApproval:null})});nt(this,"handlePlanReject",(n,i)=>{const r=this._inputWs;r&&r.readyState===WebSocket.OPEN&&r.send(JSON.stringify({type:"sdk-plan-answer",id:n,approve:!1,feedback:i||""})),this.setState({pendingPlanApproval:null})});nt(this,"handlePlanFeedbackSubmit",(n,i)=>{const r=this._inputWs;if(!r||r.readyState!==WebSocket.OPEN)return;let s=this.state.ptyPrompt;s||(s=this.state.ptyPromptHistory.slice().reverse().find(h=>h.status==="active")||{options:Array.from({length:Math.max(n,3)},(h,p)=>({number:p+1,selected:p===0}))});const o=s.options,a=o.findIndex(h=>h.number===n);let l=o.findIndex(h=>h.selected);l<0&&(l=0);const c=a-l,d=c>0?"\x1B[B":"\x1B[A",u=Math.abs(c),O=h=>{h<u?(r.send(JSON.stringify({type:"input",data:d})),setTimeout(()=>O(h+1),30)):setTimeout(()=>{r.send(JSON.stringify({type:"input",data:"\r"}));const p=this._ptyBuffer;let m=0;const g=()=>{if(m++,m>20||this._ptyBuffer!==p){r.readyState===WebSocket.OPEN&&(r.send(JSON.stringify({type:"input",data:i})),setTimeout(()=>{r.send(JSON.stringify({type:"input",data:"\r"}))},50));return}setTimeout(g,100)};setTimeout(g,100)},50)};O(0),this._currentPtyPrompt=null,this.setState(h=>{const p=h.ptyPromptHistory.slice(),m=p[p.length-1];return m&&m.status==="active"&&(p[p.length-1]={...m,status:"answered",selectedNumber:n}),{ptyPrompt:null,ptyPromptHistory:p}}),this._ptyBuffer="",this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer)});nt(this,"handleAskQuestionSubmit",(n,i,r)=>{var s,o;if(i&&r){const a={};for(const l of n){const c=r[l.questionIndex];if(c)if(l.type==="other")a[c.question]=l.text;else if(l.type==="multi"){const d=l.selectedIndices.map(u=>{var O;return(O=(c.options||[])[u])==null?void 0:O.label}).filter(Boolean);a[c.question]=d.join(", ")}else a[c.question]=((s=(c.options||[])[l.optionIndex])==null?void 0:s.label)||""}this.setState(l=>({localAskAnswers:{...l.localAskAnswers||{},[i]:a}}))}if(this.props.sdkMode){const a=this._inputWs;if(a&&a.readyState===WebSocket.OPEN){const l={},c=this._askHookQuestions||r;for(const d of n){const u=c==null?void 0:c[d.questionIndex];if(u)if(d.type==="other")l[u.question]=d.text;else if(d.type==="multi"){const O=d.selectedIndices.map(h=>{var p;return(p=(u.options||[])[h])==null?void 0:p.label}).filter(Boolean);l[u.question]=O.join(", ")}else l[u.question]=((o=(u.options||[])[d.optionIndex])==null?void 0:o.label)||""}a.send(JSON.stringify({type:"sdk-ask-answer",id:i||this._sdkAskId,answers:l})),this._sdkAskId=null}return}if(this._askHookActive&&!this._askSubmitting){this._submitViaHookBridge(n);return}if(!this._askHookActive&&!this._askSubmitting&&this._inputWs&&this._inputWs.readyState===WebSocket.OPEN){this._pendingHookAnswers=n,this._askHookWaitRetries=0,this._askSubmitting=!0,this._waitForHookBridge();return}this._submitViaPty(n)});nt(this,"handleInputSend",()=>{const n=this._inputRef.current;if(!n)return;const i=n.value.trim();i&&this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&(this.props.sdkMode?this._inputWs.send(JSON.stringify({type:"sdk-user-message",text:i})):(this._inputWs.send(JSON.stringify({type:"input",data:i})),setTimeout(()=>{this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&this._inputWs.send(JSON.stringify({type:"input",data:"\r"}))},50)),n.value="",n.style.height="auto",this.setState({inputEmpty:!0,pendingInput:i,inputSuggestion:null},()=>this.scrollToBottom()))});nt(this,"handleInputKeyDown",n=>{if(n.key==="Tab"&&this.state.inputSuggestion){n.preventDefault();const i=this._inputRef.current;i&&(i.value=this.state.inputSuggestion,i.style.height="auto",i.style.height=Math.min(i.scrollHeight,120)+"px"),this.setState({inputSuggestion:null,inputEmpty:!1});return}n.key==="Enter"&&!n.shiftKey&&!n.isComposing&&n.keyCode!==229&&(n.preventDefault(),this.handleInputSend())});nt(this,"handleInputChange",n=>{const i=n.target;i.style.height="auto",i.style.height=Math.min(i.scrollHeight,120)+"px";const r=!i.value.trim();this.setState({inputEmpty:r}),this.state.inputSuggestion&&!r&&this.setState({inputSuggestion:null})});nt(this,"handleSuggestionToTerminal",()=>{const n=this.state.inputSuggestion;!n||!this._inputWs||this._inputWs.readyState!==WebSocket.OPEN||(this._inputWs.send(JSON.stringify({type:"input",data:n})),setTimeout(()=>{this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&this._inputWs.send(JSON.stringify({type:"input",data:"\r"}))},50),this.setState({inputSuggestion:null,pendingInput:n},()=>this.scrollToBottom()))});nt(this,"handleUploadPath",n=>{const i=`"${n}"`,r=this._inputRef.current;r&&(r.value=(r.value?r.value+" ":"")+i,r.dispatchEvent(new Event("input",{bubbles:!0})),this.setState({inputEmpty:!1}))});nt(this,"handleSplitMouseDown",n=>{n.preventDefault(),this._resizing=!0;let i=[];const r=this.innerSplitRef.current;if(r){const l=r.getBoundingClientRect().width,c=7.8,d=[60,80,100,120],u=5;i=d.map(O=>{const h=O*c,p=h+u;if(p>l*.75||p<l*.15)return null;const m=l-h-u;return{cols:O,terminalPx:h,linePosition:m}}).filter(O=>O!==null)}this.setState({isDragging:!0,snapLines:i});const s=a=>{if(!this._resizing)return;const l=this.innerSplitRef.current;if(!l)return;const c=l.getBoundingClientRect(),d=c.width;let u=c.right-a.clientX;u=Math.max(200,Math.min(d*.75,u));let O=null;if(i.length>0){let p=1/0,m=null;for(const g of i){const v=Math.abs(a.clientX-c.left-g.linePosition);v<p&&(p=v,m=g)}m&&p<60&&(O=m)}this.setState({terminalWidth:u,activeSnapLine:O})},o=()=>{if(this._resizing=!1,this.state.activeSnapLine){const a=this.state.activeSnapLine.terminalPx;localStorage.setItem("cc-viewer-terminal-width",a.toString()),this.setState({terminalWidth:a,isDragging:!1,activeSnapLine:null,snapLines:[],needsInitialSnap:!1})}else localStorage.setItem("cc-viewer-terminal-width",this.state.terminalWidth.toString()),this.setState({isDragging:!1,activeSnapLine:null,snapLines:[],needsInitialSnap:!1});document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",o),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",s),document.addEventListener("mouseup",o),document.body.style.cursor="col-resize",document.body.style.userSelect="none"});nt(this,"handleToggleExpandPath",n=>{this.setState(i=>{const r=new Set(i.fileExplorerExpandedPaths);return r.has(n)?r.delete(n):r.add(n),{fileExplorerExpandedPaths:r}})});nt(this,"handleMdImageClick",n=>{const i=n.target.closest(".chat-md img");i&&i.src&&(n.preventDefault(),this.setState({mdLightboxSrc:i.src}))});nt(this,"handleOpenToolFilePath",async n=>{if(!n)return;let i=n;if(n.startsWith("/")){if(!this._projectDirCache)try{const o=await fetch(Et("/api/project-dir"));if(o.ok){const a=await o.json();a&&a.dir&&(this._projectDirCache=a.dir)}}catch{}this._projectDirCache&&n.startsWith(this._projectDirCache+"/")&&(i=n.slice(this._projectDirCache.length+1))}const r=i.split("/"),s=[];for(let o=1;o<r.length;o++)s.push(r.slice(0,o).join("/"));this._setFileExplorerOpen(!0),this.setState(o=>{const a=new Set(o.fileExplorerExpandedPaths);return s.forEach(l=>a.add(l)),{currentFile:i,currentGitDiff:null,scrollToLine:null,fileExplorerExpandedPaths:a}})});this.containerRef=U.createRef(),this.virtuosoRef=U.createRef(),this.splitContainerRef=U.createRef(),this.innerSplitRef=U.createRef(),this._incToolState=null,this._incToolProcessedCount=0,this._incToolSessionIdx=-1,this._prevSessions=null,this._reqScanCache={tsToIndex:{},modelName:null,subAgentEntries:[],processedCount:0};const i=localStorage.getItem("cc-viewer-terminal-width"),r=i?parseFloat(i):null;this.state={visibleCount:0,loading:!1,allItems:[],lastResponseItems:null,highlightTs:null,highlightFading:!1,highlightVisibleIdx:-1,terminalWidth:r||624,needsInitialSnap:r===null,inputEmpty:!0,pendingInput:null,stickyBottom:!0,ptyPrompt:null,ptyPromptHistory:[],inputSuggestion:null,fileExplorerOpen:!Gt&&localStorage.getItem("ccv_fileExplorerOpen")!=="false",currentFile:null,currentGitDiff:null,scrollToLine:null,fileExplorerExpandedPaths:new Set,gitChangesOpen:!1,snapLines:[],activeSnapLine:null,isDragging:!1,fileVersion:0,editorSessionId:null,editorFilePath:null,fileExplorerRefresh:0,gitChangesRefresh:0,roleFilterOpen:!1,roleFilterSelected:new Set,teamModalSession:null,mdLightboxSrc:null,streamingFading:!1,presetItems:[],localAskAnswers:{},pendingPermission:null,pendingPlanApproval:null},this._processedToolIds=new Set,this._projectDirCache=null,this._fileRefreshTimer=null,this._gitRefreshTimer=null,this._queueTimer=null,this._prevItemsLen=0,this._scrollTargetIdx=null,this._scrollTargetRef=U.createRef(),this._scrollFadeTimer=null,this._resizing=!1,this._inputWs=null,this._inputRef=U.createRef(),this._ptyBuffer="",this._ptyDataSeq=0,this._ptyDebounceTimer=null,this._currentPtyPrompt=null,this._askHookActive=!1,this._askHookQuestions=null,this._pendingHookAnswers=null,this._askHookWaitRetries=0,this._hookWaitTimer=null,this._mobileExtraItems=0,this._mobileSliceOffset=0,this._totalItemCount=0}_setFileExplorerOpen(n){localStorage.setItem("ccv_fileExplorerOpen",String(n)),this.setState({fileExplorerOpen:n})}_checkToolFileChanges(){var o,a;const n=this.props.mainAgentSessions;if(!n||n.length===0)return;this._processedToolIds.size>5e3&&this._processedToolIds.clear();let i=!1,r=!1,s=!1;for(const l of n){const c=[];if((a=(o=l.response)==null?void 0:o.body)!=null&&a.content&&c.push(l.response.body.content),Array.isArray(l.messages))for(const d of l.messages)d.role==="assistant"&&Array.isArray(d.content)&&c.push(d.content);for(const d of c)for(const u of d){if(u.type!=="tool_use"||!u.id||this._processedToolIds.has(u.id))continue;this._processedToolIds.add(u.id);const O=u.name;let h=u.input;if(typeof h=="string")try{h=JSON.parse(h.replace(/^\[object Object\]/,""))}catch{h={}}if(O==="Write"?(i=!0,r=!0):O==="Edit"||O==="NotebookEdit"?r=!0:O==="Bash"&&h&&h.command&&FAe(h.command)&&(i=!0,r=!0),(O==="Write"||O==="Edit"||O==="NotebookEdit")&&this.state.currentFile){const p=h&&h.file_path;if(p){let m=p;m.startsWith("/")&&this._projectDirCache&&m.startsWith(this._projectDirCache+"/")&&(m=m.slice(this._projectDirCache.length+1)),(m===this.state.currentFile||m.startsWith("/")&&m.endsWith("/"+this.state.currentFile))&&(s=!0)}}}}i&&this.state.fileExplorerOpen&&(clearTimeout(this._fileRefreshTimer),this._fileRefreshTimer=setTimeout(()=>{this.setState(l=>({fileExplorerRefresh:l.fileExplorerRefresh+1}))},500)),r&&this.state.gitChangesOpen&&(clearTimeout(this._gitRefreshTimer),this._gitRefreshTimer=setTimeout(()=>{this.setState(l=>({gitChangesRefresh:l.gitChangesRefresh+1}))},500)),s&&(clearTimeout(this._contentRefreshTimer),this._contentRefreshTimer=setTimeout(()=>{this.setState(l=>({fileVersion:l.fileVersion+1}))},500))}componentDidMount(){this.startRender(),this.props.cliMode&&this.connectInputWs(),Gt||this._bindStickyScroll(),this.state.needsInitialSnap&&this.props.cliMode&&this.props.terminalVisible&&this._snapToInitialPosition(),this._loadPresets()}shouldComponentUpdate(n,i){return n.requests!==this.props.requests||n.mainAgentSessions!==this.props.mainAgentSessions||n.collapseToolResults!==this.props.collapseToolResults||n.expandThinking!==this.props.expandThinking||n.showFullToolContent!==this.props.showFullToolContent||n.scrollToTimestamp!==this.props.scrollToTimestamp||n.cliMode!==this.props.cliMode||n.terminalVisible!==this.props.terminalVisible||n.userProfile!==this.props.userProfile||n.pendingUploadPaths!==this.props.pendingUploadPaths||n.isStreaming!==this.props.isStreaming||n.hasMoreHistory!==this.props.hasMoreHistory||n.loadingMore!==this.props.loadingMore||n.loadingSessionId!==this.props.loadingSessionId||n.lang!==this.props.lang||n.showThinkingSummaries!==this.props.showThinkingSummaries||n.fileLoading!==this.props.fileLoading||i!==this.state}componentDidUpdate(n,i){if(i.pendingPermission!==this.state.pendingPermission&&this.props.onPendingPermission&&(this.state.pendingPermission?this.props.onPendingPermission({permission:this.state.pendingPermission,handlers:{allow:this.handlePermissionAllow,allowSession:this.props.sdkMode?this.handlePermissionAllowSession:null,deny:this.handlePermissionDeny}}):this.props.onPendingPermission(null)),i.pendingPlanApproval!==this.state.pendingPlanApproval&&this.props.onPendingPlanApproval&&(this.state.pendingPlanApproval?this.props.onPendingPlanApproval({plan:this.state.pendingPlanApproval,handlers:{approve:this.handlePlanApprove,reject:this.handlePlanReject}}):this.props.onPendingPlanApproval(null)),n.isStreaming&&!this.props.isStreaming&&(this.setState({streamingFading:!0}),clearTimeout(this._streamingFadeTimer),this._streamingFadeTimer=setTimeout(()=>{this.setState({streamingFading:!1})},500)),!n.isStreaming&&this.props.isStreaming&&this.state.streamingFading&&(clearTimeout(this._streamingFadeTimer),this.setState({streamingFading:!1})),this.props.pendingUploadPaths&&this.props.pendingUploadPaths.length>0&&this.props.pendingUploadPaths!==n.pendingUploadPaths){const r=this.props.pendingUploadPaths.join(" "),s=this._inputRef.current;s?(s.value=(s.value?s.value+" ":"")+r,s.dispatchEvent(new Event("input",{bubbles:!0})),this.setState({inputEmpty:!1})):this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&this._inputWs.send(JSON.stringify({type:"input",data:r})),this.props.onUploadPathsConsumed&&this.props.onUploadPathsConsumed()}if(n.mainAgentSessions!==this.props.mainAgentSessions)this.props.mainAgentSessions!==this._prevSessions&&(this._incToolState=null,this._incToolProcessedCount=0,this._incToolSessionIdx=-1,this._prevSessions=this.props.mainAgentSessions,this._reqScanCache={tsToIndex:{},modelName:null,subAgentEntries:[],processedCount:0,subAgentProcessedCount:0}),Gt&&(this._mobileExtraItems=0),this.startRender(),this.state.pendingInput&&this.setState({pendingInput:null}),this._updateSuggestion(),this._checkToolFileChanges();else if(n.requests!==this.props.requests)this._reqScanCache.tsToIndex={},this._reqScanCache.processedCount=0,this._reqScanCache.subAgentEntries=[],this._reqScanCache.subAgentProcessedCount=0,this.startRender();else if(n.collapseToolResults!==this.props.collapseToolResults||n.expandThinking!==this.props.expandThinking){const r=this.buildAllItems(),s=this._applyMobileSlice(r);this.setState({allItems:s,lastResponseItems:this._lastResponseItems,visibleCount:s.length})}if(!n.scrollToTimestamp&&this.props.scrollToTimestamp)if(Gt&&this.props.scrollToTimestamp){const r=this.buildAllItems(),s=this._scrollTargetIdx;if(s!=null){const a=U1+this._mobileExtraItems,l=r.length>a?r.length-a:0;s<l&&(this._mobileExtraItems=r.length-s-U1,this._mobileExtraItems<0&&(this._mobileExtraItems=0))}const o=this._applyMobileSlice(r);this.setState({allItems:o,lastResponseItems:this._lastResponseItems,visibleCount:o.length},()=>this.scrollToBottom())}else{const r=this.buildAllItems(),s=this._applyMobileSlice(r);this.setState({allItems:s,lastResponseItems:this._lastResponseItems,visibleCount:s.length},()=>this.scrollToBottom())}Gt&&this.props.mobileChatVisible&&!n.mobileChatVisible&&requestAnimationFrame(()=>{if(this.virtuosoRef.current)this.virtuosoRef.current.scrollToIndex({index:"LAST"});else{const r=this.containerRef.current;r&&(r.scrollTop=r.scrollHeight)}}),!n.cliMode&&this.props.cliMode&&this.connectInputWs(),Gt||this._rebindStickyEl()}componentWillUnmount(){this._unmounted=!0,this.props.onPendingPermission&&this.props.onPendingPermission(null),this.props.onPendingPlanApproval&&this.props.onPendingPlanApproval(null),this._queueTimer&&clearTimeout(this._queueTimer),this._fadeClearTimer&&clearTimeout(this._fadeClearTimer),this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),this._fileRefreshTimer&&clearTimeout(this._fileRefreshTimer),this._gitRefreshTimer&&clearTimeout(this._gitRefreshTimer),this._contentRefreshTimer&&clearTimeout(this._contentRefreshTimer),this._wsReconnectTimer&&clearTimeout(this._wsReconnectTimer),this._waitForWsTimer&&clearTimeout(this._waitForWsTimer),this._waitForPtyTimer&&clearTimeout(this._waitForPtyTimer),this._planFeedbackTimer&&clearTimeout(this._planFeedbackTimer),this._streamingFadeTimer&&clearTimeout(this._streamingFadeTimer),this._hookWaitTimer&&clearTimeout(this._hookWaitTimer),this._pendingHookAnswers=null,this._unbindScrollFade(),Gt||this._unbindStickyScroll(),this._inputWs&&(this._inputWs.close(),this._inputWs=null)}startRender(){this._queueTimer&&clearTimeout(this._queueTimer);const n=this.buildAllItems(),i=this._lastResponseItems,r=this._applyMobileSlice(n);this._prevItemsLen=r.length,this.setState({allItems:r,lastResponseItems:i,visibleCount:r.length,loading:!1},()=>this.scrollToBottom())}queueNext(n,i){n>=i||(this._queueTimer=setTimeout(()=>{this.setState({visibleCount:n+1},()=>{this.scrollToBottom(),this.queueNext(n+1,i)})},qje()))}_isNearBottom(){const n=this.containerRef.current;return n?n.scrollHeight-n.scrollTop-n.clientHeight<=30:!0}scrollToBottom(){if(Gt&&this.virtuosoRef.current){if(this._scrollTargetIdx!=null){this.virtuosoRef.current.scrollToIndex({index:this._scrollTargetIdx,align:"center"});const n=this.props.scrollToTimestamp;this._scrollTargetRef=U.createRef(),n&&(this.setState({highlightTs:n,highlightFading:!1}),this._bindScrollFade()),this.props.onScrollTsDone&&this.props.onScrollTsDone();return}this.state.stickyBottom&&this.virtuosoRef.current.scrollToIndex({index:"LAST",behavior:"auto"});return}if(this._scrollTargetRef.current){const n=this._scrollTargetRef.current,i=this.containerRef.current;i&&n.offsetHeight>i.clientHeight?n.scrollIntoView({block:"start",behavior:"instant"}):n.scrollIntoView({block:"center",behavior:"instant"});const r=this.props.scrollToTimestamp;this._scrollTargetRef=U.createRef(),r&&(this.setState({highlightTs:r,highlightFading:!1}),this._bindScrollFade()),this.props.onScrollTsDone&&this.props.onScrollTsDone();return}if(this.state.stickyBottom){const n=this.containerRef.current;n&&(n.scrollTop=n.scrollHeight)}}_bindStickyScroll(){this._stickyScrollRafId=null,this._onStickyScroll=()=>{this._stickyScrollLock||this._stickyScrollRafId||(this._stickyScrollRafId=requestAnimationFrame(()=>{this._stickyScrollRafId=null;const n=this.containerRef.current;if(!n)return;const i=n.scrollHeight-n.scrollTop-n.clientHeight;this.state.stickyBottom&&i>50?this.setState({stickyBottom:!1}):!this.state.stickyBottom&&i<=10&&this.setState({stickyBottom:!0})}))},this._rebindStickyEl()}_rebindStickyEl(){const n=this.containerRef.current;n!==this._stickyBoundEl&&(this._stickyBoundEl&&this._stickyBoundEl.removeEventListener("scroll",this._onStickyScroll),this._stickyBoundEl=n,n&&n.addEventListener("scroll",this._onStickyScroll,{passive:!0}))}_unbindStickyScroll(){this._stickyBoundEl&&this._onStickyScroll&&(this._stickyBoundEl.removeEventListener("scroll",this._onStickyScroll),this._stickyBoundEl=null),this._stickyScrollRafId&&(cancelAnimationFrame(this._stickyScrollRafId),this._stickyScrollRafId=null)}_getScrollContainer(){return Gt?this._virtuosoScrollerEl:this.containerRef.current}_bindScrollFade(){this._unbindScrollFade(),this._scrollFadeDelayTimer=setTimeout(()=>{const n=this._getScrollContainer();n&&(this._scrollFadeBoundEl=n,this._onScrollFade=()=>{this.setState({highlightFading:!0}),this._fadeClearTimer=setTimeout(()=>{this.setState({highlightTs:null,highlightFading:!1,highlightVisibleIdx:-1})},2e3),this._unbindScrollFade()},n.addEventListener("scroll",this._onScrollFade,{passive:!0}))},500)}_unbindScrollFade(){this._scrollFadeDelayTimer&&(clearTimeout(this._scrollFadeDelayTimer),this._scrollFadeDelayTimer=null),this._fadeClearTimer&&(clearTimeout(this._fadeClearTimer),this._fadeClearTimer=null),this._onScrollFade&&this._scrollFadeBoundEl&&(this._scrollFadeBoundEl.removeEventListener("scroll",this._onScrollFade),this._scrollFadeBoundEl=null,this._onScrollFade=null)}renderSessionMessages(n,i,r,s){const{userProfile:o,collapseToolResults:a,expandThinking:l,showFullToolContent:c,showThinkingSummaries:d,onViewRequest:u}=this.props;let O=b3(n);if(!O){const k=parseInt(i.slice(1),10);this._incToolSessionIdx===k&&n.length>=this._incToolProcessedCount&&this._incToolProcessedCount>0?Lx(this._incToolState,n,this._incToolProcessedCount):(this._incToolState=kV(),Lx(this._incToolState,n,0),this._incToolSessionIdx=k),this._incToolProcessedCount=n.length,O=this._incToolState,HAe(n,O)}const{toolUseMap:h,toolResultMap:p,readContentMap:m,editSnapshotMap:g,askAnswerMap:v,planApprovalMap:$,latestPlanContent:b}=O,S=this.props.cliMode&&this.state.ptyPromptHistory.slice().reverse().find(k=>Wh(k)&&k.status==="active")||null,y=this.props.cliMode&&this.state.ptyPromptHistory.slice().reverse().find(k=>tS(k)&&k.status==="active")||null;let _=null,Q=null;const P=new Set,w=this.state.localAskAnswers||{},E=Object.keys(w).length>0?{...v,...w}:v;for(const k of n)if(k.role==="assistant"&&Array.isArray(k.content))for(const T of k.content){if(T.type==="tool_use"&&T.name==="ExitPlanMode"){const x=$[T.id];(!x||x.status==="pending")&&(_=T.id)}if(T.type==="tool_use"&&T.name==="AskUserQuestion"){P.add(T.id);const x=E[T.id];(!x||Object.keys(x).length===0)&&(Q=T.id)}}const z=[];for(let k=0;k<n.length;k++){const T=n[k],x=T.content,R=T._timestamp||null,X=R?s[R]:void 0,I=X!=null&&u?{requestIndex:X,onViewRequest:u}:Bje;if(T.role==="user"){if(Array.isArray(x)){const A=x.find(N=>N.type==="text"&&/^\[SUGGESTION MODE:/i.test((N.text||"").trim())),W=x.filter(N=>N.type==="tool_result");if(!(A&&W.length>0)){const{commands:N,textBlocks:L,skillBlocks:Y}=m_(x);for(let j=0;j<N.length;j++)z.push(C.jsx(ms,{role:"user",text:N[j],timestamp:R,userProfile:o,modelInfo:r,...I},`${i}-cmd-${k}-${j}`));for(const j of Y){const V=j.text.match(/^#\s+(.+)$/m),B=V?V[1]:"Skill";z.push(C.jsx(ms,{role:"skill-loaded",text:j.text,skillName:B,timestamp:R,...I},`${i}-skill-${k}`))}for(let j=0;j<L.length;j++){const V=/Implement the following plan:/i.test(L[j].text||"");z.push(C.jsx(ms,{role:V?"plan-prompt":"user",text:L[j].text,timestamp:R,userProfile:o,modelInfo:r,...I},`${i}-user-${k}-${j}`))}}}else if(typeof x=="string"&&!Sv(x)){const A=/Implement the following plan:/i.test(x);z.push(C.jsx(ms,{role:A?"plan-prompt":"user",text:x,timestamp:R,userProfile:o,modelInfo:r,...I},`${i}-user-${k}`))}}else T.role==="assistant"&&(Array.isArray(x)?z.push(C.jsx(ms,{role:"assistant",content:x,toolResultMap:p,readContentMap:m,editSnapshotMap:g,askAnswerMap:E,planApprovalMap:$,latestPlanContent:b,timestamp:R,modelInfo:r,collapseToolResults:a,expandThinking:l,showFullToolContent:c,showThinkingSummaries:d,ptyPrompt:this.state.ptyPrompt,activePlanPrompt:S,activeDangerousPrompt:y,lastPendingPlanId:_,lastPendingAskId:Q,onPlanApprovalClick:this.handlePromptOptionClick,onPlanFeedbackSubmit:this.handlePlanFeedbackSubmit,onDangerousApprovalClick:this.handlePromptOptionClick,onAskQuestionSubmit:this.handleAskQuestionSubmit,cliMode:this.props.cliMode,onOpenFile:this.handleOpenToolFilePath,...I},`${i}-asst-${k}`)):typeof x=="string"&&z.push(C.jsx(ms,{role:"assistant",content:[{type:"text",text:x}],toolResultMap:p,readContentMap:m,editSnapshotMap:g,askAnswerMap:E,planApprovalMap:$,latestPlanContent:b,timestamp:R,modelInfo:r,collapseToolResults:a,expandThinking:l,showFullToolContent:c,showThinkingSummaries:d,ptyPrompt:this.state.ptyPrompt,activePlanPrompt:S,activeDangerousPrompt:y,lastPendingPlanId:_,lastPendingAskId:Q,onPlanApprovalClick:this.handlePromptOptionClick,onPlanFeedbackSubmit:this.handlePlanFeedbackSubmit,onDangerousApprovalClick:this.handlePromptOptionClick,onAskQuestionSubmit:this.handleAskQuestionSubmit,cliMode:this.props.cliMode,onOpenFile:this.handleOpenToolFilePath,...I},`${i}-asst-${k}`)))}return z}_buildTeammateFallbackItems(){var u,O,h,p;const{requests:n,collapseToolResults:i,expandThinking:r,showFullToolContent:s,onViewRequest:o}=this.props;if(!n||n.length===0)return[];L5(n);const a=new Map;for(const m of n){if(!cP(m)||!((O=(u=m.body)==null?void 0:u.messages)!=null&&O.length))continue;const g=m.teammate||"teammate",v=a.get(g);(!v||m.body.messages.length>=v.messages.length)&&a.set(g,{messages:m.body.messages,response:m.response,timestamp:m.timestamp})}if(a.size===0)return[];const l=null,c=[];let d=0;for(const[m,g]of a){c.push(C.jsx(xb,{className:Dt.sessionDivider,children:C.jsx(D1,{className:Dt.sessionDividerText,children:m})},`tm-div-${d}`));const v=this.renderSessionMessages(g.messages,`tm${d}`,l,{});if(c.push(...v),d===a.size-1&&((p=(h=g.response)==null?void 0:h.body)!=null&&p.content)){const $=g.response.body.content;if(Array.isArray($)){const b=$.filter(S=>S.type==="text"&&S.text).map((S,y)=>C.jsx(ms,{role:"assistant",content:[S],collapseToolResults:i,expandThinking:r,showFullToolContent:s,onViewRequest:o,onOpenFile:this.handleOpenToolFilePath},`tm-resp-${d}-${y}`));b.length>0&&(this._lastResponseItems=b)}}d++}return c}buildAllItems(){var g,v,$,b,S;const{mainAgentSessions:n,requests:i,collapseToolResults:r,expandThinking:s,showFullToolContent:o,onViewRequest:a}=this.props;if(this._lastResponseItems=null,this._lastResponseAskQuestions=null,!n||n.length===0)return this._buildTeammateFallbackItems();const l=this._reqScanCache;if(i){const y=i.length>=l.processedCount?l.processedCount:0;y===0&&(l.tsToIndex={},l.modelName=null);for(let Q=y;Q<i.length;Q++){const P=i[Q],w=Ms(P);w&&P.timestamp&&(l.tsToIndex[P.timestamp]=Q),w&&((g=P.body)!=null&&g.model)&&(l.modelName=P.body.model)}l.processedCount=i.length,L5(i);let _=l.subAgentProcessedCount||0;if(_>0&&_<i.length)for(_--;l.subAgentEntries.length>0&&l.subAgentEntries[l.subAgentEntries.length-1].requestIndex>=_;)l.subAgentEntries.pop();for(let Q=_;Q<i.length;Q++){const P=i[Q];if(!P.timestamp)continue;const w=jx(P,i[Q+1]);if(w.type==="SubAgent"||w.type==="Teammate"){const E=($=(v=P.response)==null?void 0:v.body)==null?void 0:$.content;if(Array.isArray(E)&&E.length>0){const z=JAe(((b=P.body)==null?void 0:b.messages)||[]).toolResultMap,k=w.type==="Teammate";l.subAgentEntries.push({timestamp:P.timestamp,content:E,toolResultMap:z,label:k?CV(w.subType,(S=P.body)==null?void 0:S.model):PV(w.type,w.subType),isTeammate:k,requestIndex:Q})}}}l.subAgentProcessedCount=i.length}const c=l.tsToIndex,d=v_(l.modelName),u=l.subAgentEntries,O=[],h={};(this.props.hasMoreHistory||this.props.loadingMore)&&O.push(C.jsx("div",{className:Dt.loadMoreWrap,children:this.props.loadingMore?C.jsxs("div",{className:`${Dt.loadMoreBtn} ${Dt.loadMoreBtnLoading}`,children:[C.jsx(Ca,{size:"small",style:{marginRight:8}}),Oe("ui.loadingMoreHistory")]}):C.jsx("button",{className:Dt.loadMoreBtn,onClick:()=>this.props.onLoadMoreHistory&&this.props.onLoadMoreHistory(),children:Oe("ui.loadEarlierConversations")})},"load-more-history"));let p=0;n.forEach((y,_)=>{var P,w,E,z,k;if(_>0&&O.push(C.jsx(xb,{className:Dt.sessionDivider,children:C.jsx(D1,{className:Dt.sessionDividerText,children:"Session"})},`session-div-${_}`)),y._cold){const T=this.props.loadingSessionId===y.sessionId;O.push(C.jsx("div",{className:Dt.loadMoreWrap,children:T?C.jsxs("div",{className:`${Dt.loadMoreBtn} ${Dt.loadMoreBtnLoading}`,children:[C.jsx(Ca,{size:"small",style:{marginRight:8}}),Oe("ui.loadingMoreHistory")]}):C.jsx("button",{className:Dt.loadMoreBtn,onClick:()=>this.props.onLoadSession&&this.props.onLoadSession(y.sessionId),children:Oe("ui.loadSessionPlaceholder",{count:y.msgCount})})},`cold-session-${_}`));return}const Q=this.renderSessionMessages(y.messages,`s${_}`,d,c);for(const T of Q){const x=T.props.timestamp;for(;p<u.length&&x&&u[p].timestamp<=x;){const R=u[p];R.timestamp&&(h[R.timestamp]=O.length),O.push(C.jsx(ms,{role:"sub-agent-chat",content:R.content,toolResultMap:R.toolResultMap,label:R.label,isTeammate:R.isTeammate,timestamp:R.timestamp,collapseToolResults:r,expandThinking:s,showFullToolContent:o,requestIndex:R.requestIndex,onViewRequest:a,onOpenFile:this.handleOpenToolFilePath},`sub-${R.requestIndex}-${R.timestamp}`)),p++}x&&(h[x]=O.length),O.push(T)}for(;p<u.length;){const T=u[p],x=_<n.length-1&&((w=(P=n[_+1].messages)==null?void 0:P[0])==null?void 0:w._timestamp);if(x&&T.timestamp>x)break;T.timestamp&&(h[T.timestamp]=O.length),O.push(C.jsx(ms,{role:"sub-agent-chat",content:T.content,toolResultMap:T.toolResultMap,label:T.label,isTeammate:T.isTeammate,timestamp:T.timestamp,collapseToolResults:r,expandThinking:s,showFullToolContent:o,requestIndex:T.requestIndex,onViewRequest:a,onOpenFile:this.handleOpenToolFilePath},`sub-${T.requestIndex}-${T.timestamp}`)),p++}if(_===n.length-1&&((z=(E=y.response)==null?void 0:E.body)!=null&&z.content)){const T=y.response.body.content;if(Array.isArray(T)){const x=T.some(I=>I.type==="tool_use"&&(I.name==="AskUserQuestion"||I.name==="ExitPlanMode"));if(!(T.some(I=>I.type==="text"&&typeof I.text=="string"&&I.text.includes("[SUGGESTION MODE:"))&&!x)){const I=new Set;for(const D of y.messages)if(D.role==="assistant"&&Array.isArray(D.content))for(const te of D.content)te.type==="tool_use"&&te.name==="AskUserQuestion"&&I.add(te.id);y.entryTimestamp&&(h[y.entryTimestamp]=O.length);let A=null,W=null;const N=this.state.localAskAnswers||{};for(const D of T){if(D.type==="tool_use"&&D.name==="AskUserQuestion"){const te=N[D.id];(!te||Object.keys(te).length===0)&&(A=D.id)}D.type==="tool_use"&&D.name==="ExitPlanMode"&&(W=D.id)}this._lastResponseAskQuestions=new Set;for(const D of T)if(D.type==="tool_use"&&D.name==="AskUserQuestion"){const te=(k=D.input)==null?void 0:k.questions;if(Array.isArray(te))for(const pe of te)pe.question&&this._lastResponseAskQuestions.add(pe.question)}const L=b3(y.messages)||{},Y=L.planApprovalMap||{},j=L.latestPlanContent||null,V=this.props.cliMode&&this.state.ptyPromptHistory.slice().reverse().find(D=>Wh(D)&&D.status==="active")||null,B=this.props.cliMode&&this.state.ptyPromptHistory.slice().reverse().find(D=>tS(D)&&D.status==="active")||null,F=T.filter(D=>D.type!=="tool_use"||D.name==="AskUserQuestion"&&!I.has(D.id)||D.name==="ExitPlanMode");if(!F.some(D=>D.type==="text"?typeof D.text=="string"&&D.text.trim().length>0:D.type==="tool_use"?!0:D.type==="thinking"?typeof D.thinking=="string"&&D.thinking.trim().length>0:!1))return;this._lastResponseItems=C.jsxs(U.Fragment,{children:[C.jsx(xb,{className:Dt.lastResponseDivider,children:C.jsx(D1,{type:"secondary",className:Dt.lastResponseLabel,children:Oe("ui.lastResponse")})}),C.jsx(ms,{role:"assistant",content:F,timestamp:y.entryTimestamp,modelInfo:d,collapseToolResults:r,expandThinking:s,showFullToolContent:o,toolResultMap:B3,askAnswerMap:Object.keys(N).length>0?N:B3,planApprovalMap:Y,latestPlanContent:j,lastPendingAskId:A,lastPendingPlanId:W,activePlanPrompt:V,activeDangerousPrompt:B,ptyPrompt:this.state.ptyPrompt,onPlanApprovalClick:this.handlePromptOptionClick,onPlanFeedbackSubmit:this.handlePlanFeedbackSubmit,onDangerousApprovalClick:this.handlePromptOptionClick,cliMode:this.props.cliMode,onAskQuestionSubmit:this.handleAskQuestionSubmit,onOpenFile:this.handleOpenToolFilePath},"resp-asst")]},"last-response-group")}}}});const{scrollToTimestamp:m}=this.props;return this._scrollTargetIdx=m&&h[m]!=null?h[m]:null,this._tsItemMap=h,O}_applyMobileSlice(n){if(!Gt)return this._mobileSliceOffset=0,this._totalItemCount=n.length,n;this._totalItemCount=n.length;const i=U1+this._mobileExtraItems;if(n.length<=i)return this._mobileSliceOffset=0,n;const r=n.length-i;if(this._mobileSliceOffset=r,this._scrollTargetIdx!=null&&(this._scrollTargetIdx-=r,this._scrollTargetIdx<0&&(this._scrollTargetIdx=null)),this._tsItemMap){const s={};for(const[o,a]of Object.entries(this._tsItemMap)){const l=a-r;l>=0&&(s[o]=l)}this._tsItemMap=s}return n.slice(r)}_extractSuggestion(){var O;const{mainAgentSessions:n}=this.props;if(!(n!=null&&n.length))return null;const i=n[n.length-1],r=i==null?void 0:i.messages;if(!Array.isArray(r)||r.length===0)return null;const s=r[r.length-1];if((s==null?void 0:s.role)!=="user")return null;const o=s.content;if(!(Array.isArray(o)?o.some(h=>h.type==="text"&&/^\[SUGGESTION MODE:/i.test((h.text||"").trim())):typeof o=="string"&&/^\[SUGGESTION MODE:/im.test(o.trim())))return null;const l=i==null?void 0:i.response;if(!l)return null;const c=l.body;if(!c)return null;const d=c.stop_reason;if(d!=="end_turn"&&d!=="max_tokens")return null;const u=c.content;if(!Array.isArray(u))return null;for(let h=u.length-1;h>=0;h--)if(u[h].type==="text"&&((O=u[h].text)!=null&&O.trim()))return u[h].text.trim();return null}_updateSuggestion(){const n=this._extractSuggestion();this.setState({inputSuggestion:n||null})}_loadPresets(){let n=!1;fetch(Et("/api/claude-settings")).then(i=>i.json()).then(i=>{var r;n=((r=i==null?void 0:i.env)==null?void 0:r.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS)==="1"}).catch(()=>{}).then(()=>{n&&fetch(Et("/api/preferences")).then(i=>i.json()).then(i=>{const r=Array.isArray(i.dismissedBuiltinPresets)?new Set(i.dismissedBuiltinPresets):new Set;let s=[];Array.isArray(i.presetShortcuts)&&(s=i.presetShortcuts.map((a,l)=>typeof a=="string"?{id:Date.now()+l,teamName:"",description:a}:{id:Date.now()+l,teamName:a.teamName||"",description:a.description||"",...a.builtinId?{builtinId:a.builtinId}:{},...a.modified?{modified:!0}:{}}));const o=new Set(s.filter(a=>a.builtinId).map(a=>a.builtinId));for(const a of E9)r.has(a.builtinId)||o.has(a.builtinId)||s.unshift({id:Date.now()+Math.random(),builtinId:a.builtinId,teamName:a.teamName,description:a.description});this.setState({presetItems:s})}).catch(()=>{})})}connectInputWs(){const i=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`;this._inputWs=new WebSocket(i),this._inputWs.onmessage=r=>{try{const s=JSON.parse(r.data);s.type==="data"?this._appendPtyData(s.data):s.type==="exit"?this._clearPtyPrompt():s.type==="ask-hook-pending"?(this._askHookActive=!0,this._askHookQuestions=s.questions):s.type==="ask-hook-timeout"?(this._askHookActive=!1,this._askHookQuestions=null):s.type==="sdk-plan-pending"?this.setState({pendingPlanApproval:{id:s.id,input:s.input}}):s.type==="sdk-ask-pending"?(this._askHookActive=!0,this._askHookQuestions=s.questions,this._sdkAskId=s.id):s.type==="sdk-ask-timeout"?(this._askHookActive=!1,this._askHookQuestions=null,this._sdkAskId=null):s.type==="perm-hook-pending"?this.setState({pendingPermission:{id:s.id,toolName:s.toolName,input:s.input}}):s.type==="perm-hook-timeout"&&this.setState({pendingPermission:null})}catch{}},this._inputWs.onclose=()=>{(this.state.pendingPermission||this.state.pendingPlanApproval)&&this.setState({pendingPermission:null,pendingPlanApproval:null}),this._sdkAskId=null,this._askHookActive=!1,this._askHookQuestions=null,this._wsReconnectTimer=setTimeout(()=>{!this._unmounted&&this.splitContainerRef.current&&this.props.cliMode&&this.connectInputWs()},2e3)}}_stripAnsi(n){return n.replace(/\x1b\[[0-9;]*[A-Za-z]/g,"").replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b[^[\]](.|$)/g,"").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,"")}_appendPtyData(n){const i=this._stripAnsi(n);this._ptyBuffer+=i,this._ptyDataSeq++,this._ptyBuffer.length>4096&&(this._ptyBuffer=this._ptyBuffer.slice(-4096)),this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),this._ptyDebounceTimer=setTimeout(()=>this._detectPrompt(),200)}_detectPrompt(){const n=this._ptyBuffer.trimEnd();let i=null,r=null;const s=n.match(/([^\n]*\?)\s*\n((?:\s*[❯>]?\s*\d+\.\s+[^\n]+\n?){2,})$/);if(s){i=s[1].trim();const o=s[2].match(/\s*([❯>])?\s*(\d+)\.\s+([^\n]+)/g);o&&(r=o.map(a=>{const l=a.match(/\s*([❯>])?\s*(\d+)\.\s+(.+)/);return{number:parseInt(l[2],10),text:l[3].trim(),selected:!!l[1]}}))}if(!r){const o=n.match(/([^\n]+)\n((?:\s+[❯>]?\s+[^\n]+\n?){2,})$/);if(o){const a=o[1].trim(),c=o[2].split(`
|
|
1104
|
-
`).filter(u=>u.trim()),d=[];for(const u of c){const O=u.match(/^\s*([❯>])?\s+(.+)/);O&&O[2].trim()&&d.push({number:d.length+1,text:O[2].trim(),selected:!!O[1]})}d.length>=2&&d.some(u=>u.selected)&&(i=a,r=d)}}if(i&&r){if(/^[■\s]*[~\/.:]/.test(i)&&/\//.test(i)||/^[*■✦⏎]/.test(i))return;const o=this.state.ptyPrompt,a={question:i,options:r};o&&o.question===i?(this._currentPtyPrompt=a,this.setState({ptyPrompt:a})):(this._currentPtyPrompt=a,this.setState(l=>{const c=l.ptyPromptHistory.slice();if(l.ptyPrompt){const d=c[c.length-1];d&&d.status==="active"&&(c[c.length-1]={...d,status:"dismissed"})}return c.push({...a,status:"active",selectedNumber:null,timestamp:new Date().toISOString()}),c.length>200&&c.splice(0,c.length-200),{ptyPrompt:a,ptyPromptHistory:c}}),this.scrollToBottom());return}if(this.state.ptyPrompt){if(Wh(this.state.ptyPrompt)||tS(this.state.ptyPrompt)||this._askSubmitting)return;this._currentPtyPrompt=null,this.setState(o=>{const a=o.ptyPromptHistory.slice(),l=a[a.length-1];return l&&l.status==="active"&&(a[a.length-1]={...l,status:"dismissed"}),{ptyPrompt:null,ptyPromptHistory:a}})}}_clearPtyPrompt(){this._ptyBuffer="",this._currentPtyPrompt=null,this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),this.state.ptyPrompt&&this.setState({ptyPrompt:null})}_planSubmissionSteps(n){return n.map((i,r)=>({...i,isLast:r===n.length-1}))}_waitForHookBridge(){if(!this._unmounted){if(this._askHookActive){const n=this._pendingHookAnswers;this._pendingHookAnswers=null,this._submitViaHookBridge(n);return}if(this._askHookWaitRetries=(this._askHookWaitRetries||0)+1,this._askHookWaitRetries>30){const n=this._pendingHookAnswers;this._pendingHookAnswers=null,this._submitViaPty(n);return}this._hookWaitTimer=setTimeout(()=>this._waitForHookBridge(),100)}}_submitViaPty(n){const i=this._inputWs;if(!i||i.readyState!==WebSocket.OPEN){this._askAnswerQueue=this._planSubmissionSteps(n),this._askSubmitting=!0,this._isMultiQuestionForm=n.length>1,this.connectInputWs(),this._askWsRetries=0,this._waitForWsAndSubmit();return}if(this._askAnswerQueue=this._planSubmissionSteps(n),this._askSubmitting=!0,this._isMultiQuestionForm=n.length>1,!this._currentPtyPrompt){this._askPromptRetries=0,this._waitForPtyPromptAndSubmit();return}this._processNextAskAnswer()}_waitForWsAndSubmit(){if(this._askWsRetries=(this._askWsRetries||0)+1,this._askWsRetries>30){this._askSubmitting=!1,this._askAnswerQueue=[];return}if(this._inputWs&&this._inputWs.readyState===WebSocket.OPEN){this._currentPtyPrompt?this._processNextAskAnswer():(this._askPromptRetries=0,this._waitForPtyPromptAndSubmit());return}this._waitForWsTimer=setTimeout(()=>this._waitForWsAndSubmit(),100)}_waitForPtyPromptAndSubmit(){if(this._askPromptRetries=(this._askPromptRetries||0)+1,this._askPromptRetries>50){this._processNextAskAnswer();return}if(this._currentPtyPrompt){this._processNextAskAnswer();return}this._waitForPtyTimer=setTimeout(()=>this._waitForPtyPromptAndSubmit(),100)}_processNextAskAnswer(){if(!this._askAnswerQueue||this._askAnswerQueue.length===0){this._askSubmitting=!1;return}const n=this._askAnswerQueue.shift();if(n.type==="other"&&n.isMultiSelect){this._submitViaSequentialQueue(n,{settleMs:500});return}n.type==="other"?this._submitOtherAnswer(n):n.type==="multi"?this._submitMultiSelectAnswer(n):this._submitSingleSelectAnswer(n)}_submitSingleSelectAnswer(n){this._submitViaSequentialQueue(n)}_submitMultiSelectAnswer(n){this._submitViaSequentialQueue(n)}_submitOtherAnswer(n){this._submitViaSequentialQueue(n)}_submitViaSequentialQueue(n,i={}){const r=this._inputWs;if(!r||r.readyState!==WebSocket.OPEN){this._askSubmitting=!1;return}const s=!!this._isMultiQuestionForm,o=DAe(n,this.state.ptyPrompt,s),a=i.settleMs||300,l=c=>{try{JSON.parse(c.data).type==="input-sequential-done"&&(r.removeEventListener("message",l),this._finishCurrentAskAnswer())}catch{}};r.addEventListener("message",l),r.send(JSON.stringify({type:"input-sequential",chunks:o,settleMs:a})),setTimeout(()=>{r.removeEventListener("message",l),this._askSubmitting&&this._finishCurrentAskAnswer()},15e3)}_finishCurrentAskAnswer(){this._currentPtyPrompt=null,this.setState(n=>{const i=n.ptyPromptHistory.slice(),r=i[i.length-1];return r&&r.status==="active"&&(i[i.length-1]={...r,status:"answered"}),{ptyPrompt:null,ptyPromptHistory:i}}),(!this._askAnswerQueue||this._askAnswerQueue.length===0)&&this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),this._askAnswerQueue&&this._askAnswerQueue.length>0?setTimeout(()=>{this._processNextAskAnswer()},500):this._askSubmitting=!1}_submitViaHookBridge(n){var o,a;const i=this._inputWs;if(!i||i.readyState!==WebSocket.OPEN){this._askHookActive=!1,this._askHookQuestions=null,this._submitViaPty(n);return}this._askSubmitting=!0;const r=this._askHookQuestions||[],s={};for(const l of n){const c=r[l.questionIndex];if(!c)continue;const d=c.question;if(l.type==="other")s[d]=l.text||"";else if(l.type==="multi"){const u=(l.selectedIndices||[]).map(O=>{var h,p;return(p=(h=c.options)==null?void 0:h[O])==null?void 0:p.label}).filter(Boolean);s[d]=u.join(", ")}else s[d]=((a=(o=c.options)==null?void 0:o[l.optionIndex])==null?void 0:a.label)||""}i.send(JSON.stringify({type:"ask-hook-answer",answers:s})),this._askSubmitting=!1,this._currentPtyPrompt=null,this.setState(l=>{const c=l.ptyPromptHistory.slice(),d=c[c.length-1];return d&&d.status==="active"&&(c[c.length-1]={...d,status:"answered"}),{ptyPrompt:null,ptyPromptHistory:c}}),this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer)}_snapToInitialPosition(){this.setState({terminalWidth:468,needsInitialSnap:!1}),localStorage.setItem("cc-viewer-terminal-width","468")}_buildUserPromptNav(){const n=this._currentVisible;if(!n||n.length===0)return null;if(this._navCacheVisible===n&&this._navCacheResult)return this._navCacheResult;const i=[],r=new Set;for(let o=0;o<n.length;o++){const a=n[o].props;if(!a||a.role!=="user")continue;const l=a.text||"";if(!l)continue;const c=l.replace(/\[Image(?:\s*#\d+)?(?::?\s*source)?:\s*[^\]]+\]/gi,"").replace(/"\/tmp\/cc-viewer-uploads\/[^"]+"/g,"").trim();if(!c)continue;const d=c.substring(0,100);if(r.has(d))continue;r.add(d);const u=c.length>80?c.substring(0,80)+"...":c;i.push({display:u,visibleIdx:o,timestamp:a.timestamp||null})}if(i.length===0)return this._navCacheVisible=n,this._navCacheResult=null,null;const s=C.jsx("div",{className:Dt.userPromptNavList,children:i.map((o,a)=>C.jsx("div",{className:Dt.userPromptNavItem,onClick:()=>this._scrollToUserPrompt(o.visibleIdx,o.timestamp),children:o.display},o.visibleIdx))});return this._navCacheVisible=n,this._navCacheResult=s,s}_scrollToUserPrompt(n,i){n==null||n<0||(i?this.setState({highlightTs:i,highlightFading:!1,highlightVisibleIdx:n},()=>{this._doScrollToVisibleIdx(n),this._bindScrollFade()}):this._doScrollToVisibleIdx(n))}_doScrollToVisibleIdx(n){if(Gt&&this.virtuosoRef.current)this.virtuosoRef.current.scrollToIndex({index:n,align:"center",behavior:"smooth"});else{const i=this.containerRef.current;i&&i.children[n]&&i.children[n].scrollIntoView({behavior:"smooth",block:"center"})}}render(){var W,N,L,Y;const{mainAgentSessions:n,cliMode:i,terminalVisible:r,onToggleTerminal:s}=this.props,{allItems:o,visibleCount:a,loading:l,terminalWidth:c,lastResponseItems:d}=this.state,O=(!n||n.length===0)&&(!o||o.length===0);if(O&&!i)return this.props.fileLoading?null:C.jsx("div",{className:Dt.centerEmpty,children:C.jsx(Ns,{description:Oe("ui.noChat")})});if(l&&!i)return C.jsx("div",{className:Dt.centerEmpty,children:C.jsx(Ca,{size:"large"})});const h=new Map,p=this.props.userProfile,m=this._reqScanCache?v_(this._reqScanCache.modelName):null;for(const j of o){if(!j||!j.props)continue;const V=j.props.role;if(V==="user"||V==="plan-prompt")h.has("user")||h.set("user",{key:"user",name:(p==null?void 0:p.name)||"User",avatarType:"user",color:"rgba(255,255,255,0.1)",avatarImg:(p==null?void 0:p.avatar)||null});else if(V==="assistant")h.has("assistant")||h.set("assistant",{key:"assistant",name:(m==null?void 0:m.short)||(m==null?void 0:m.name)||"Claude",avatarType:"agent",color:(m==null?void 0:m.color)||"rgba(255,255,255,0.1)",avatarSvg:(m==null?void 0:m.svg)||null});else if(V==="sub-agent-chat"){const B=j.props.label||"SubAgent",F=`sub:${B}`;if(!h.has(F)){const ie=j.props.isTeammate;let D="sub";if(ie)D="teammate";else{const pe=B.match(/SubAgent:\s*(\w+)/i),oe=pe?pe[1].toLowerCase():"";oe==="explore"||oe==="search"?D="sub-search":oe==="plan"&&(D="sub-plan")}const te=ie?Bu(B):null;h.set(F,{key:F,name:B.length>12?B.slice(0,12)+"…":B,avatarType:D,avatarSvg:te?te.svg:void 0,color:te?te.color:"rgba(255,255,255,0.1)"})}}}const g=Array.from(h.values());let v=o;const $=this.state.roleFilterSelected.size;$>0&&$<g.length&&(v=o.filter(j=>{if(!j||!j.props)return!0;const V=j.props.role;if(V==="user"||V==="plan-prompt")return this.state.roleFilterSelected.has("user");if(V==="assistant")return this.state.roleFilterSelected.has("assistant");if(V==="sub-agent-chat"){const B=`sub:${j.props.label||"SubAgent"}`;return this.state.roleFilterSelected.has(B)}return!1}));const b=$>0&&$<g.length,S=d&&b&&!this.state.roleFilterSelected.has("assistant")?null:d,y=this._scrollTargetIdx,{highlightTs:_,highlightFading:Q,highlightVisibleIdx:P}=this.state,w=v.slice(0,b?v.length:a);this._currentVisible=w;const E=P>=0&&P<w.length?P:_!=null?w.findIndex(j=>{var V;return((V=j.props)==null?void 0:V.timestamp)===_}):-1,{pendingInput:z,stickyBottom:k,ptyPromptHistory:T}=this.state,x=i&&z?C.jsx(ms,{role:"user",text:z,timestamp:new Date().toISOString(),userProfile:this.props.userProfile},"pending-input"):null,R=k?null:C.jsxs("button",{className:Dt.stickyBottomBtn,onClick:this.handleStickToBottom,children:[C.jsx("span",{children:Oe("ui.stickyBottom")}),C.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),X=Gt&&this._mobileSliceOffset>0?C.jsx("div",{className:Dt.loadMoreWrap,children:C.jsx("button",{className:Dt.loadMoreBtn,onClick:this.handleLoadMore,children:Oe("ui.loadMoreHistory",{count:this._mobileSliceOffset})})}):null,I=this.state.roleFilterOpen&&g.length>0?C.jsx(p9e,{roles:g,selectedRoles:this.state.roleFilterSelected,onToggle:j=>this.setState(V=>{const B=new Set(V.roleFilterSelected);return B.has(j)?B.delete(j):B.add(j),{roleFilterSelected:B}})}):null,A=O||l?C.jsxs("div",{className:Dt.messageListWrap,children:[C.jsxs("div",{ref:this.containerRef,className:Dt.container,children:[!i||l?C.jsx("div",{className:Dt.centerEmpty,children:l?C.jsx(Ca,{size:"large"}):C.jsx(Ns,{description:Oe("ui.noChat")})}):null,x]}),R]}):C.jsxs("div",{className:Dt.messageListWrap,onClick:this.handleMdImageClick,children:[I,this.state.mdLightboxSrc&&C.jsx(sM,{src:this.state.mdLightboxSrc,alt:"",onClose:()=>this.setState({mdLightboxSrc:null})}),Gt?(this._virtuosoHeader=X,this._virtuosoFooter=C.jsxs(C.Fragment,{children:[(this.props.isStreaming||this.state.streamingFading)&&C.jsx("div",{className:Dt.streamingSpinnerWrap,style:this.state.streamingFading?{opacity:0}:void 0,children:C.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",children:[C.jsx("defs",{children:C.jsxs("linearGradient",{id:"ccv-spinnerGrad",x1:"0",y1:"0",x2:"1",y2:"1",children:[C.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"1"}),C.jsx("stop",{offset:"100%",stopColor:"white",stopOpacity:"0.1"})]})}),C.jsx("circle",{cx:"10",cy:"10",r:"7.5",fill:"none",strokeWidth:"2",stroke:"url(#ccv-spinnerGrad)",strokeLinecap:"round",pathLength:"100",strokeDasharray:"75 25",children:C.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 10 10",to:"360 10 10",dur:"0.8s",repeatCount:"indefinite"})})]})}),S,x]}),C.jsx(KWe,{ref:this.virtuosoRef,className:Dt.mobileVirtuoso,data:w,initialTopMostItemIndex:Math.max(0,w.length-1),followOutput:this.state.stickyBottom?"smooth":!1,atBottomStateChange:j=>{j!==this.state.stickyBottom&&this.setState({stickyBottom:j})},atBottomThreshold:60,increaseViewportBy:{top:400,bottom:200},computeItemKey:j=>{var V;return((V=w[j])==null?void 0:V.key)||`v-${j}`},itemContent:j=>{const V=w[j],B=j===y,F=j===E;let ie=V;return F&&(ie=U.cloneElement(ie,{highlight:Q?"fading":"active"})),B?C.jsx("div",{ref:this._scrollTargetRef,children:ie}):ie},scrollerRef:j=>{this._virtuosoScrollerEl=j},context:{header:this._virtuosoHeader,footer:this._virtuosoFooter},components:this._virtuosoComponents||(this._virtuosoComponents={Scroller:Yje,Header:({context:j})=>j.header,Footer:({context:j})=>j.footer})})):C.jsxs("div",{ref:this.containerRef,className:Dt.container,children:[X,w.map((j,V)=>{const B=V===y,F=V===E;let ie=j;return F&&(ie=U.cloneElement(ie,{highlight:Q?"fading":"active"})),B?C.jsx("div",{ref:this._scrollTargetRef,children:ie},j.key+"-anchor"):ie}),(this.props.isStreaming||this.state.streamingFading)&&C.jsx("div",{className:Dt.streamingSpinnerWrap,style:this.state.streamingFading?{opacity:0}:void 0,children:C.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",children:[C.jsx("defs",{children:C.jsxs("linearGradient",{id:"ccv-spinnerGrad-desktop",x1:"0",y1:"0",x2:"1",y2:"1",children:[C.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"1"}),C.jsx("stop",{offset:"100%",stopColor:"white",stopOpacity:"0.1"})]})}),C.jsx("circle",{cx:"10",cy:"10",r:"7.5",fill:"none",strokeWidth:"2",stroke:"url(#ccv-spinnerGrad-desktop)",strokeLinecap:"round",pathLength:"100",strokeDasharray:"75 25",children:C.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 10 10",to:"360 10 10",dur:"0.8s",repeatCount:"indefinite"})})]})}),S&&(y!=null&&y>=w.length?C.jsx("div",{ref:this._scrollTargetRef,children:S},"last-resp-anchor"):S),x]}),R]});return i?C.jsxs(C.Fragment,{children:[C.jsxs("div",{ref:this.splitContainerRef,className:Dt.splitContainer,children:[C.jsxs("div",{className:Dt.navSidebar,children:[C.jsx("button",{className:this.state.roleFilterOpen?Dt.navBtnActive:Dt.navBtn,onClick:()=>this.setState(j=>j.roleFilterOpen?{roleFilterOpen:!1,roleFilterSelected:new Set}:{roleFilterOpen:!0}),title:Oe("ui.roleFilter"),children:C.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})})}),C.jsx("button",{className:this.state.fileExplorerOpen?Dt.navBtnActive:Dt.navBtn,onClick:()=>{this._setFileExplorerOpen(!this.state.fileExplorerOpen),this.setState({gitChangesOpen:!1})},title:Oe("ui.fileExplorer"),children:C.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 2h9a2 2 0 0 1 2 2z"})})}),C.jsx("button",{className:this.state.gitChangesOpen?Dt.navBtnActive:Dt.navBtn,onClick:()=>this.setState(j=>(this._setFileExplorerOpen(!1),{gitChangesOpen:!j.gitChangesOpen})),title:Oe("ui.gitChanges"),children:C.jsx("svg",{width:"24",height:"24",viewBox:"0 0 1024 1024",fill:"currentColor",children:C.jsx("path",{d:"M759.53332137 326.35000897c0-48.26899766-39.4506231-87.33284994-87.87432908-86.6366625-46.95397689 0.69618746-85.08957923 39.14120645-85.39899588 86.09518335-0.23206249 40.68828971 27.53808201 74.87882971 65.13220519 84.47074592 10.82958281 2.78474987 18.41029078 12.37666607 18.64235327 23.51566553 0.38677082 21.11768647-3.40358317 44.40128953-17.24997834 63.81718442-22.20064476 31.17372767-62.42480948 42.46743545-97.93037026 52.44612248-22.43270724 6.26568719-38.75443563 7.89012462-53.14230994 9.28249954-20.42149901 2.01120825-39.76003975 3.94506233-63.89453858 17.79145747-5.10537475 2.93945818-10.13339535 6.18833303-14.85199928 9.74662453-4.09977063 3.09416652-9.90133285 0.15470833-9.90133286-4.95066641V302.60228095c0-9.43720788 5.26008307-18.17822829 13.69168683-22.3553531 28.69839444-14.23316598 48.42370599-43.93716454 48.19164353-78.20505872-0.38677082-48.57841433-41.15241468-87.71962076-89.730829-86.01782918C338.80402918 117.57112321 301.59667683 155.70672553 301.59667683 202.58334827c0 34.03583169 19.64795738 63.50776777 48.1916435 77.66357958 8.43160375 4.17712479 13.69168685 12.76343689 13.69168684 22.12329062v419.02750058c0 9.43720788-5.26008307 18.17822829-13.69168684 22.3553531-28.69839444 14.23316598-48.42370599 43.93716454-48.1916435 78.20505872 0.30941665 48.57841433 41.07506052 87.6422666 89.65347484 86.01782918C437.74000359 906.42887679 474.87000179 868.2159203 474.87000179 821.41665173c0-34.03583169-19.64795738-63.50776777-48.1916435-77.66357958-8.43160375-4.17712479-13.69168685-12.76343689-13.69168684-22.12329062v-14.85199926c0-32.48874844 15.39347842-63.27570528 42.00331048-81.91805854 2.39797906-1.70179159 4.95066642-3.32622901 7.50335379-4.79595812 14.92935344-8.58631209 25.91364457-9.66927037 44.09187287-11.4484161 15.62554091-1.54708326 35.04143581-3.48093734 61.65126786-10.90693699 39.06385228-10.98429114 92.51557887-25.91364457 124.84961898-71.39789238 18.56499911-26.06835292 27.38337367-58.01562219 26.37776956-95.14562041-0.15470833-5.33743724-0.54147915-10.67487447-1.08295828-16.16702004-0.85089578-8.27689543 2.70739569-16.24437421 9.12779121-21.50445729 19.57060322-15.78024923 32.02462345-39.99210223 32.02462345-67.14341343zM351.1033411 202.58334827c0-20.49885317 16.63114503-37.12999821 37.1299982-37.1299982s37.12999821 16.63114503 37.12999821 37.1299982-16.63114503 37.12999821-37.12999821 37.1299982-37.12999821-16.63114503-37.1299982-37.1299982z m74.25999641 618.83330346c0 20.49885317-16.63114503 37.12999821-37.12999821 37.1299982s-37.12999821-16.63114503-37.1299982-37.1299982 16.63114503-37.12999821 37.1299982-37.1299982 37.12999821 16.63114503 37.12999821 37.1299982z m247.53332139-457.93664456c-20.49885317 0-37.12999821-16.63114503-37.1299982-37.1299982s16.63114503-37.12999821 37.1299982-37.12999821 37.12999821 16.63114503 37.1299982 37.12999821-16.63114503 37.12999821-37.1299982 37.1299982z"})})}),C.jsx(S3,{requests:this.props.requests,onOpenSession:j=>this.setState({teamModalSession:j}),navBtnClass:Dt.navBtn}),C.jsx(Sl,{content:this._buildUserPromptNav(),trigger:"hover",placement:"rightTop",overlayStyle:{maxWidth:400},children:C.jsx("button",{className:Dt.navBtn,title:Oe("ui.userPromptNav"),children:C.jsx("img",{src:((W=this.props.userProfile)==null?void 0:W.avatar)||xv,className:Dt.navAvatarImg,alt:"User",onError:j=>{j.target.onerror=null,j.target.src=xv}})})})]}),C.jsxs("div",{className:Dt.innerSplitArea,ref:this.innerSplitRef,children:[C.jsx(a9e,{isDragging:this.state.isDragging,activeSnapLine:this.state.activeSnapLine,snapLines:this.state.snapLines,terminalWidth:this.state.terminalWidth,containerRef:this.innerSplitRef}),this.state.fileExplorerOpen&&C.jsx(l_e,{refreshTrigger:this.state.fileExplorerRefresh,onClose:()=>this._setFileExplorerOpen(!1),onFileClick:j=>this.setState({currentFile:j,currentGitDiff:null,scrollToLine:null}),expandedPaths:this.state.fileExplorerExpandedPaths,onToggleExpand:this.handleToggleExpandPath,currentFile:this.state.currentFile,onFileRenamed:(j,V)=>{this.setState(B=>({currentFile:B.currentFile===j?V:B.currentFile,fileExplorerRefresh:B.fileExplorerRefresh+1}))}}),this.state.gitChangesOpen&&C.jsx(MIe,{refreshTrigger:this.state.gitChangesRefresh,onClose:()=>this.setState({gitChangesOpen:!1}),onFileClick:j=>this.setState({currentGitDiff:j,currentFile:null}),onOpenFile:j=>{const V=j.split("/"),B=[];for(let F=1;F<V.length;F++)B.push(V.slice(0,F).join("/"));this._setFileExplorerOpen(!0),this.setState(F=>{const ie=new Set(F.fileExplorerExpandedPaths);return B.forEach(D=>ie.add(D)),{currentGitDiff:null,currentFile:j,scrollToLine:null,gitChangesOpen:!1,fileExplorerExpandedPaths:ie}})}}),C.jsx("div",{className:Dt.chatSection,children:C.jsxs("div",{className:Dt.chatSectionFlex,children:[this.state.currentGitDiff&&C.jsx("div",{className:Dt.overlayPanel,children:C.jsx(QAe,{filePath:this.state.currentGitDiff,onClose:()=>this.setState({currentGitDiff:null}),onOpenFile:(j,V)=>{const B=j.split("/"),F=[];for(let ie=1;ie<B.length;ie++)F.push(B.slice(0,ie).join("/"));this._setFileExplorerOpen(!0),this.setState(ie=>{const D=new Set(ie.fileExplorerExpandedPaths);return F.forEach(te=>D.add(te)),{currentGitDiff:null,currentFile:j,scrollToLine:V||1,gitChangesOpen:!1,fileExplorerExpandedPaths:D}})}})}),this.state.currentFile&&C.jsx("div",{className:Dt.overlayPanel,children:ZAe(this.state.currentFile)?C.jsx(OIe,{filePath:this.state.currentFile,editorSession:!!this.state.editorSessionId,onClose:()=>{this.state.editorSessionId&&fetch("/api/editor-done",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.state.editorSessionId})}).catch(()=>{}),this.setState({currentFile:null,fileVersion:0,editorSessionId:null,editorFilePath:null})}},this.state.fileVersion):C.jsx(q8e,{filePath:this.state.currentFile,scrollToLine:this.state.scrollToLine,editorSession:!!this.state.editorSessionId,onClose:()=>{this.state.editorSessionId&&fetch("/api/editor-done",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.state.editorSessionId})}).catch(()=>{}),this.setState({currentFile:null,fileVersion:0,editorSessionId:null,editorFilePath:null})}},this.state.fileVersion)}),A,!this.props.onPendingPermission&&C.jsx($3,{toolName:(N=this.state.pendingPermission)==null?void 0:N.toolName,toolInput:(L=this.state.pendingPermission)==null?void 0:L.input,requestId:(Y=this.state.pendingPermission)==null?void 0:Y.id,onAllow:this.handlePermissionAllow,onAllowSession:this.props.sdkMode?this.handlePermissionAllowSession:null,onDeny:this.handlePermissionDeny,visible:!!this.state.pendingPermission}),!this.props.onPendingPlanApproval&&this.state.pendingPlanApproval&&C.jsx($3,{toolName:"ExitPlanMode",toolInput:this.state.pendingPlanApproval.input,requestId:this.state.pendingPlanApproval.id,onAllow:this.handlePlanApprove,onDeny:j=>this.handlePlanReject(j,""),visible:!0}),C.jsx(V9e,{inputRef:this._inputRef,inputEmpty:this.state.inputEmpty,inputSuggestion:this.state.inputSuggestion,terminalVisible:r,onKeyDown:this.handleInputKeyDown,onChange:this.handleInputChange,onSend:this.handleInputSend,onSuggestionClick:this.handleSuggestionToTerminal,onUploadPath:this.handleUploadPath,presetItems:this.state.presetItems,onPresetSend:this.handlePresetSend,isStreaming:this.props.isStreaming,streamingFading:this.state.streamingFading})]})}),i&&!this.props.sdkMode&&s&&C.jsx("div",{className:Dt.terminalToggle,onClick:s,title:Oe(r?"ui.collapseTerminal":"ui.expandTerminal"),children:C.jsx("svg",{viewBox:"0 0 8 24",width:"8",height:"24",children:r?C.jsx("path",{d:"M4 8 L7 12 L4 16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}):C.jsx("path",{d:"M4 8 L1 12 L4 16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:Dt.vResizer,onMouseDown:this.handleSplitMouseDown}),C.jsx("div",{className:Dt.terminalPanelWrap,style:{width:c},children:C.jsx(Yye,{onEditorOpen:(j,V)=>{this.setState({editorSessionId:j,editorFilePath:V,currentFile:V,currentGitDiff:null,scrollToLine:null,fileVersion:(this.state.fileVersion||0)+1})},onFilePath:j=>{const V=`"${j}"`;this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&this._inputWs.send(JSON.stringify({type:"input",data:V}))}})})]})]})]}),C.jsx(y3,{session:this.state.teamModalSession,requests:this.props.requests,mainAgentSessions:this.props.mainAgentSessions,collapseToolResults:this.props.collapseToolResults,expandThinking:this.props.expandThinking,showFullToolContent:this.props.showFullToolContent,userProfile:this.props.userProfile,onViewRequest:this.props.onViewRequest,onClose:()=>this.setState({teamModalSession:null})})]}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:Dt.splitContainer,children:[C.jsxs("div",{className:Dt.navSidebar,children:[C.jsx("button",{className:this.state.roleFilterOpen?Dt.navBtnActive:Dt.navBtn,onClick:()=>this.setState(j=>j.roleFilterOpen?{roleFilterOpen:!1,roleFilterSelected:new Set}:{roleFilterOpen:!0}),title:Oe("ui.roleFilter"),children:C.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})})}),C.jsx(S3,{requests:this.props.requests,onOpenSession:j=>this.setState({teamModalSession:j}),navBtnClass:Dt.navBtn})]}),C.jsx("div",{className:Dt.navSidebarContent,children:A})]}),C.jsx(y3,{session:this.state.teamModalSession,requests:this.props.requests,mainAgentSessions:this.props.mainAgentSessions,collapseToolResults:this.props.collapseToolResults,expandThinking:this.props.expandThinking,showFullToolContent:this.props.showFullToolContent,userProfile:this.props.userProfile,onViewRequest:this.props.onViewRequest,onClose:()=>this.setState({teamModalSession:null})})]})}}const Dje="_helpBtn_fm45n_1",Uje="_modalBody_fm45n_25",Zje="_spinWrap_fm45n_124",Z1={helpBtn:Dje,modalBody:Uje,spinWrap:Zje},Gje=new Set(["Tool-Bash","Tool-Read","Tool-Edit","Tool-Write","Tool-Glob","Tool-Grep","Tool-NotebookEdit","Tool-WebFetch","Tool-WebSearch","Tool-Task","Tool-Agent","Tool-TaskOutput","Tool-TaskStop","Tool-TaskCreate","Tool-TaskGet","Tool-TaskUpdate","Tool-TaskList","Tool-TeamCreate","Tool-TeamDelete","Tool-SendMessage","SubAgent-Search","Tool-EnterPlanMode","Tool-ExitPlanMode","Tool-AskUserQuestion","Tool-Skill","Tool-getDiagnostics","Tool-executeCode","Tool-EnterWorktree","MainAgent","Teammate","BodyFields","ResponseFields","Tools","ToolsFirst","CacheRebuild","BodyDiffJSON","TranslateContextPollution","KVCacheContent","ProxySwitch"]);function KYe({doc:t,zIndex:e}){const[n,i]=f.useState(!1),[r,s]=f.useState(!1),[o,a]=f.useState(""),[l,c]=f.useState("");if(!t||!Gje.has(t))return null;const d=f.useCallback(async()=>{i(!0),s(!0),a(""),c(t);const O=h_();let h=null;try{const p=await fetch(`/api/concept?lang=${O}&doc=${encodeURIComponent(t)}`);p.ok&&(h=await p.text())}catch{}if(h){const p=h.match(/^#\s+(.+)/m);p&&c(p[1]),a(bo(h))}else a("<p>Document not found.</p>");s(!1)},[t]),u=Gt?{header:{padding:"8px 12px",margin:0},body:{maxHeight:"80vh",overflow:"auto",padding:"8px 10px"},content:{padding:0}}:{body:{padding:"16px 24px 24px",background:"#111",borderRadius:"4px"},content:{padding:"12px 20px"}};return C.jsxs(C.Fragment,{children:[C.jsx("span",{className:Z1.helpBtn,onClick:O=>{O.stopPropagation(),d()},children:"?"}),C.jsx(zo,{theme:{algorithm:O_.darkAlgorithm,token:{colorPrimary:"#1668dc",colorBgContainer:"#111",colorBgLayout:"#0a0a0a",colorBgElevated:"#1e1e1e",colorBorder:"#2a2a2a"}},children:C.jsx(ji,{title:l,open:n,onCancel:()=>i(!1),footer:null,width:Gt?"98vw":800,centered:Gt,styles:u,...e?{zIndex:e}:{},wrapProps:{onMouseDown:O=>O.stopPropagation()},children:r?C.jsx("div",{className:Z1.spinWrap,children:C.jsx(Ca,{})}):C.jsx("div",{className:Z1.modalBody,dangerouslySetInnerHTML:{__html:o}})})})]})}const Fje="_headerBar_h06mo_2",Hje="_logoWrap_h06mo_10",Kje="_logoWrapActive_h06mo_17",Jje="_logoImage_h06mo_26",eNe="_logoImageActive_h06mo_36",tNe="_compactBtn_h06mo_41",nNe="_compactBtnNoBorder_h06mo_47",iNe="_tokenStatsTag_h06mo_55",rNe="_tokenStatsIcon_h06mo_63",sNe="_liveTag_h06mo_68",oNe="_liveTagFill_h06mo_83",aNe="_liveTagContent_h06mo_93",lNe="_liveTagHistory_h06mo_100",cNe="_liveTagText_h06mo_106",dNe="_countdownStrong_h06mo_111",uNe="_qrcodePopover_h06mo_116",ONe="_qrcodeTitle_h06mo_134",hNe="_qrcodeUrlInput_h06mo_141",fNe="_qrcodeUrlCopy_h06mo_147",pNe="_settingsGroupBox_h06mo_158",mNe="_settingsGroupTitle_h06mo_166",gNe="_settingsItem_h06mo_175",vNe="_settingsLabel_h06mo_182",$Ne="_tokenStatsEmpty_h06mo_187",bNe="_tokenStatsContainer_h06mo_194",SNe="_tokenStatsColumn_h06mo_200",yNe="_toolStatsColumn_h06mo_204",_Ne="_modelCard_h06mo_209",QNe="_modelCardSpaced_h06mo_216 _modelCard_h06mo_209",xNe="_modelName_h06mo_222",wNe="_statsTable_h06mo_232",PNe="_th_h06mo_237",CNe="_td_h06mo_247",TNe="_label_h06mo_256",kNe="_rowBorder_h06mo_266",RNe="_rebuildTotalRow_h06mo_278",ENe="_promptExportBar_h06mo_287",XNe="_promptScrollArea_h06mo_291",zNe="_promptEmpty_h06mo_296",INe="_promptTimestamp_h06mo_302",ANe="_textPromptCard_h06mo_310",MNe="_preText_h06mo_319",WNe="_systemCollapse_h06mo_329",jNe="_systemLabel_h06mo_336",NNe="_preSys_h06mo_341",LNe="_promptTextarea_h06mo_351",VNe="_projectStatsCenter_h06mo_367",BNe="_projectStatsEmpty_h06mo_373",YNe="_projectStatsContent_h06mo_380",qNe="_projectStatsUpdated_h06mo_386",DNe="_projectStatsSummary_h06mo_392",UNe="_projectStatCard_h06mo_398",ZNe="_projectStatValue_h06mo_406",GNe="_projectStatLabel_h06mo_414",FNe="_projectStatsSection_h06mo_420",HNe="_projectStatsSectionTitle_h06mo_426",KNe="_projectStatsModelCard_h06mo_434",JNe="_projectStatsModelHeader_h06mo_441",eLe="_projectStatsModelName_h06mo_450",tLe="_projectStatsModelCount_h06mo_456",nLe="_pluginDirHint_h06mo_463",iLe="_pluginDirPath_h06mo_469",rLe="_pluginList_h06mo_482",sLe="_pluginItem_h06mo_488",oLe="_pluginInfo_h06mo_498",aLe="_pluginName_h06mo_506",lLe="_pluginFile_h06mo_512",cLe="_pluginHooks_h06mo_518",dLe="_pluginHookTag_h06mo_525",uLe="_pluginActions_h06mo_534",OLe="_pluginEmpty_h06mo_542",hLe="_cachePopover_h06mo_549",fLe="_cacheScrollArea_h06mo_553",pLe="_cachePopoverTitle_h06mo_558",mLe="_cachePopoverHeader_h06mo_567",gLe="_cacheCopyBtn_h06mo_573",vLe="_cachePopoverEmpty_h06mo_585",$Le="_cacheTokenInfo_h06mo_591",bLe="_cacheSection_h06mo_600",SLe="_cacheSectionTitle_h06mo_604",yLe="_cacheSectionArrow_h06mo_625",_Le="_cacheCodeBlock_h06mo_633",QLe="_cacheCodeBlockSystem_h06mo_647",xLe="_cacheNavBtn_h06mo_661",wLe="_cacheNavList_h06mo_676",PLe="_cacheNavItem_h06mo_682",CLe="_cacheBlockHighlight_h06mo_698",TLe="_cacheBlockHighlightFading_h06mo_703",kLe="_cacheBorderSvg_h06mo_708",RLe="_cacheBorderSvgFading_h06mo_717",ELe="_cacheBorderRect_h06mo_722",XLe="_thLeft_h06mo_732",zLe="_cacheCalibrationLabel_h06mo_737",ILe="_calibrationSelect_h06mo_745",ALe="_cachePopoverPlaceholder_h06mo_751",MLe="_cacheWriteToken_h06mo_756",WLe="_cacheReadToken_h06mo_760",jLe="_cacheCtxPercent_h06mo_764",NLe="_pluginModalFooter_h06mo_770",LLe="_pluginModalFooterLeft_h06mo_775",VLe="_pluginDirLabel_h06mo_781",BLe="_pluginEmptyTitle_h06mo_786",YLe="_pluginEmptyHint_h06mo_791",qLe="_cdnUrlLabel_h06mo_797",DLe="_cdnInput_h06mo_803",ULe="_titleIcon_h06mo_810",ZLe="_countryFlagIcon_h06mo_815",GLe="_svgIcon_h06mo_821",FLe="_iconMirror_h06mo_826",HLe="_langGrid_h06mo_831",KLe="_langBtn_h06mo_841",JLe="_countryInfoPopover_h06mo_847",eVe="_countryInfoMeta_h06mo_853",tVe="_disabledMenuItem_h06mo_858",nVe="_currentProcessBtn_h06mo_863",iVe="_proxySwapIcon_h06mo_868",rVe="_fullWidthSelect_h06mo_873",sVe="_proxyProfileTag_h06mo_878",oVe="_proxyWarning_h06mo_892",aVe="_proxyList_h06mo_902",lVe="_proxyItem_h06mo_908",cVe="_proxyItemActive_h06mo_920",dVe="_proxyItemMain_h06mo_925",uVe="_proxyItemInfo_h06mo_933",OVe="_proxyItemNameRow_h06mo_939",hVe="_proxyItemName_h06mo_939",fVe="_proxyItemDetail_h06mo_951",pVe="_proxyBuiltinTag_h06mo_960",mVe="_proxyItemActions_h06mo_970",gVe="_proxyEditForm_h06mo_976",vVe="_proxyEditRow_h06mo_984",$Ve="_proxyRequired_h06mo_994",bVe="_proxyEditDivider_h06mo_999",SVe="_proxyEditBtns_h06mo_1004",JYe={headerBar:Fje,logoWrap:Hje,logoWrapActive:Kje,logoImage:Jje,logoImageActive:eNe,compactBtn:tNe,compactBtnNoBorder:nNe,tokenStatsTag:iNe,tokenStatsIcon:rNe,liveTag:sNe,liveTagFill:oNe,liveTagContent:aNe,liveTagHistory:lNe,liveTagText:cNe,countdownStrong:dNe,qrcodePopover:uNe,qrcodeTitle:ONe,qrcodeUrlInput:hNe,qrcodeUrlCopy:fNe,settingsGroupBox:pNe,settingsGroupTitle:mNe,settingsItem:gNe,settingsLabel:vNe,tokenStatsEmpty:$Ne,tokenStatsContainer:bNe,tokenStatsColumn:SNe,toolStatsColumn:yNe,modelCard:_Ne,modelCardSpaced:QNe,modelName:xNe,statsTable:wNe,th:PNe,td:CNe,label:TNe,rowBorder:kNe,rebuildTotalRow:RNe,promptExportBar:ENe,promptScrollArea:XNe,promptEmpty:zNe,promptTimestamp:INe,textPromptCard:ANe,preText:MNe,systemCollapse:WNe,systemLabel:jNe,preSys:NNe,promptTextarea:LNe,projectStatsCenter:VNe,projectStatsEmpty:BNe,projectStatsContent:YNe,projectStatsUpdated:qNe,projectStatsSummary:DNe,projectStatCard:UNe,projectStatValue:ZNe,projectStatLabel:GNe,projectStatsSection:FNe,projectStatsSectionTitle:HNe,projectStatsModelCard:KNe,projectStatsModelHeader:JNe,projectStatsModelName:eLe,projectStatsModelCount:tLe,pluginDirHint:nLe,pluginDirPath:iLe,pluginList:rLe,pluginItem:sLe,pluginInfo:oLe,pluginName:aLe,pluginFile:lLe,pluginHooks:cLe,pluginHookTag:dLe,pluginActions:uLe,pluginEmpty:OLe,cachePopover:hLe,cacheScrollArea:fLe,cachePopoverTitle:pLe,cachePopoverHeader:mLe,cacheCopyBtn:gLe,cachePopoverEmpty:vLe,cacheTokenInfo:$Le,cacheSection:bLe,cacheSectionTitle:SLe,cacheSectionArrow:yLe,cacheCodeBlock:_Le,cacheCodeBlockSystem:QLe,cacheNavBtn:xLe,cacheNavList:wLe,cacheNavItem:PLe,cacheBlockHighlight:CLe,cacheBlockHighlightFading:TLe,cacheBorderSvg:kLe,cacheBorderSvgFading:RLe,cacheBorderRect:ELe,thLeft:XLe,cacheCalibrationLabel:zLe,calibrationSelect:ILe,cachePopoverPlaceholder:ALe,cacheWriteToken:MLe,cacheReadToken:WLe,cacheCtxPercent:jLe,pluginModalFooter:NLe,pluginModalFooterLeft:LLe,pluginDirLabel:VLe,pluginEmptyTitle:BLe,pluginEmptyHint:YLe,cdnUrlLabel:qLe,cdnInput:DLe,titleIcon:ULe,countryFlagIcon:ZLe,svgIcon:GLe,iconMirror:FLe,langGrid:HLe,langBtn:KLe,countryInfoPopover:JLe,countryInfoMeta:eVe,disabledMenuItem:tVe,currentProcessBtn:nVe,proxySwapIcon:iVe,fullWidthSelect:rVe,proxyProfileTag:sVe,proxyWarning:oVe,proxyList:aVe,proxyItem:lVe,proxyItemActive:cVe,proxyItemMain:dVe,proxyItemInfo:uVe,proxyItemNameRow:OVe,proxyItemName:hVe,proxyItemDetail:fVe,proxyBuiltinTag:pVe,proxyItemActions:mVe,proxyEditForm:gVe,proxyEditRow:vVe,proxyRequired:$Ve,proxyEditDivider:bVe,proxyEditBtns:SVe};export{ss as $,WVe as A,Si as B,Xt as C,HYe as D,Bce as E,lAe as F,PVe as G,Coe as H,cn as I,Wde as J,kn as K,$3 as L,Mt as M,Pl as N,Mue as O,ts as P,bi as Q,Yde as R,Ca as S,Yye as T,ue as U,G as V,q as W,at as X,fn as Y,Sw as Z,Pe as _,F6 as a,S8 as a0,sv as a1,yd as a2,Fo as a3,Y0 as a4,TH as a5,Cs as a6,ip as a7,ju as a8,R0 as a9,Cl as aA,Dce as aB,XI as aC,aO as aD,Ns as aE,H7 as aF,AVe as aG,PV as aH,Ho as aI,Tl as aJ,zI as aK,Mu as aL,bo as aM,gf as aN,B5 as aO,Y5 as aP,Due as aQ,zVe as aR,IVe as aS,Db as aT,MVe as aU,bQ as aV,dc as aW,oy as aX,HY as aY,GY as aZ,lc as aa,es as ab,wVe as ac,fi as ad,xVe as ae,Me as af,Mte as ag,Nw as ah,Jue as ai,gde as aj,ei as ak,dO as al,Sl as am,L5 as an,AO as ao,ji as ap,IA as aq,h_ as ar,s$ as as,fO as at,bv as au,TVe as av,Jo as aw,x7 as ax,hp as ay,b7 as az,Br as b,ne as c,ra as d,Et as e,kVe as f,Rn as g,EVe as h,LI as i,XVe as j,RVe as k,jx as l,dn as m,KYe as n,Kue as o,SP as p,Sv as q,Zn as r,JYe as s,Oe as t,J as u,m_ as v,Ms as w,el as x,CVe as y,zo as z};
|
|
1103
|
+
...`:W)}},A):null}):C.jsx("div",{className:Tt.agentNoMessages,children:"No messages"})]});return C.jsx(Sl,{content:X,trigger:"click",placement:"right",autoAdjustOverflow:!0,overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #333",padding:0,maxWidth:800,maxHeight:"70vh",overflowY:"auto"},onOpenChange:I=>p(I?z:null),children:C.jsxs("div",{className:`${Tt.teamAgentCard} ${Tt.teamAgentCardClickable} ${h===z?Tt.teamAgentCardActive:""}`,children:[C.jsxs("div",{className:Tt.teamAgentCardHeader,children:[(()=>{const I=Bu(E.name);return C.jsx("div",{className:Tt.teamAgentAvatar,style:{background:I.color},dangerouslySetInnerHTML:{__html:I.svg}})})(),C.jsx("div",{className:Tt.teamAgentName,children:E.name})]}),C.jsx("div",{className:Tt.teamAgentType,children:E.type}),C.jsxs("div",{className:Tt.teamAgentStatus,style:{color:k?"#52c41a":"#faad14"},children:[k?"✓ done":"● working"," ",C.jsxs("span",{className:Tt.agentStatusDurSuffix,children:["· ",x]})]})]})},z)})]}),C.jsxs("div",{className:Tt.teamModalContent,children:[C.jsx(i9e,{teamAgents:Q,teamTotalStart:b,teamTotalEnd:S,leadSegments:P,ganttWrapRef:d,ganttIndicatorRef:c,ganttHeight:m,onGanttHeightChange:g}),C.jsxs("div",{className:Tt.teamModalBody,ref:l,onScroll:y,children:[_.map((E,z)=>C.jsxs("div",{"data-timestamp":E.timestamp,children:[E.type==="user"&&C.jsx(ms,{role:"user",text:E.text,timestamp:E.timestamp,userProfile:s,modelInfo:w,requestIndex:E.requestIndex,onViewRequest:o}),E.type==="assistant"&&C.jsx(ms,{role:"assistant",content:E.content,timestamp:E.timestamp,modelInfo:E.modelInfo,collapseToolResults:i,expandThinking:r,toolResultMap:{},askAnswerMap:{},requestIndex:E.requestIndex,onViewRequest:o}),E.type==="sub-agent"&&C.jsx(ms,{role:"sub-agent-chat",content:E.content,toolResultMap:E.toolResultMap,label:E.label,isTeammate:E.isTeammate,timestamp:E.timestamp,collapseToolResults:i,expandThinking:r,requestIndex:E.requestIndex,onViewRequest:o}),E.type==="context"&&C.jsx(ms,{role:"assistant",content:[{type:"text",text:E.text}],timestamp:E.timestamp,modelInfo:w,collapseToolResults:i,expandThinking:r,toolResultMap:{},askAnswerMap:{}}),E.type==="teammate-report"&&C.jsxs("div",{className:Tt.teammateReportEntry,children:[C.jsxs("div",{className:Tt.teammateReportHeader,children:[(()=>{const k=Bu(E.agentName);return C.jsx("div",{className:Tt.teamAgentAvatar,style:{background:k.color},dangerouslySetInnerHTML:{__html:k.svg}})})(),C.jsx("span",{className:Tt.teammateReportName,children:E.agentName}),C.jsx("span",{className:Tt.teammateReportSummary,children:E.summary})]}),C.jsx("div",{className:`${Tt.teammateReportBody} chat-md`,dangerouslySetInnerHTML:{__html:bo(E.content)}})]})]},`tw-${z}`)),_.length===0&&C.jsx(Ns,{description:"No entries",image:Ns.PRESENTED_IMAGE_SIMPLE})]})]})]})})}const r9e="_snapLine_1xlsr_1",s9e="_snapLineActive_1xlsr_13",o9e="_snapPreview_1xlsr_24",N1={snapLine:r9e,snapLineActive:s9e,snapPreview:o9e};function a9e({isDragging:t,activeSnapLine:e,snapLines:n,terminalWidth:i,containerRef:r}){if(!t)return null;const s=r.current;if(!s)return null;const o=s.getBoundingClientRect().width,a=5;let l=null;if(e){const O=o-i-a,h=e.linePosition,p=Math.min(O,h),m=Math.abs(h-O);l=C.jsx("div",{className:N1.snapPreview,style:{left:`${p}px`,width:`${m}px`}})}const c=o-i-a,d=[...n].map(O=>({...O,dist:Math.abs(O.linePosition-c)})).sort((O,h)=>O.dist-h.dist);let u=null;if(d.length>0){const O=d[0],h=e&&e.cols===O.cols;u=C.jsx("div",{className:h?N1.snapLineActive:N1.snapLine,style:{left:`${O.linePosition}px`}},O.cols)}return C.jsxs(C.Fragment,{children:[l,u]})}const l9e="_roleFilterBar_tifk1_1",c9e="_roleChip_tifk1_10",d9e="_roleChipActive_tifk1_10",u9e="_roleAvatar_tifk1_31",O9e="_roleAvatarImg_tifk1_44",h9e="_roleName_tifk1_51",f9e="_roleCheck_tifk1_56",Rc={roleFilterBar:l9e,roleChip:c9e,roleChipActive:d9e,roleAvatar:u9e,roleAvatarImg:O9e,roleName:h9e,roleCheck:f9e};function p9e({roles:t,selectedRoles:e,onToggle:n}){return!t||t.length===0?null:C.jsx("div",{className:Rc.roleFilterBar,children:t.map(i=>{const r=e.has(i.key);return C.jsxs("button",{className:r?Rc.roleChipActive:Rc.roleChip,onClick:()=>n(i.key),children:[i.avatarImg?C.jsx("img",{src:i.avatarImg,className:Rc.roleAvatarImg,alt:i.name,onError:s=>{s.target.onerror=null,s.target.style.display="none";const o=s.target.parentNode.querySelector("[data-role-avatar-fallback]");o&&(o.style.display="")}}):null,C.jsx("div",{className:Rc.roleAvatar,style:{background:i.color||"rgba(255,255,255,0.1)",display:i.avatarImg?"none":""},"data-role-avatar-fallback":"",dangerouslySetInnerHTML:{__html:i.avatarSvg||$_(i.avatarType)}}),C.jsx("span",{className:Rc.roleName,children:i.name}),r&&C.jsx("span",{className:Rc.roleCheck,children:"✓"})]},i.key)})})}const m9e="_chatInputBar_1353e_1",g9e="_chatInputWrapper_1353e_7",v9e="_chatTextareaWrap_1353e_21",$9e="_chatTextarea_1353e_21",b9e="_chatInputBottom_1353e_46",S9e="_plusArea_1353e_53",y9e="_plusBtn_1353e_57",_9e="_plusBtnOpen_1353e_71",Q9e="_plusOverlay_1353e_81",x9e="_plusMenu_1353e_90",w9e="_plusMenuItem_1353e_103",P9e="_presetLabel_1353e_123",C9e="_chatInputHint_1353e_129",T9e="_chatInputHintSep_1353e_137",k9e="_chatInputHintTerminal_1353e_141",R9e="_chatInputHintMobile_1353e_145",E9e="_sendBtn_1353e_153",X9e="_sendBtnDisabled_1353e_168",z9e="_ghostText_1353e_179",I9e="_suggestionChip_1353e_195",A9e="_suggestionChipText_1353e_211",M9e="_suggestionChipAction_1353e_220",W9e="_streaming_1353e_290",j9e="_streamingFading_1353e_291",N9e="_streamingSvg_1353e_301",L9e="_streamingSvgFading_1353e_312",li={chatInputBar:m9e,chatInputWrapper:g9e,chatTextareaWrap:v9e,chatTextarea:$9e,chatInputBottom:b9e,plusArea:S9e,plusBtn:y9e,plusBtnOpen:_9e,plusOverlay:Q9e,plusMenu:x9e,plusMenuItem:w9e,presetLabel:P9e,chatInputHint:C9e,chatInputHintSep:T9e,chatInputHintTerminal:k9e,chatInputHintMobile:R9e,sendBtn:E9e,sendBtnDisabled:X9e,ghostText:z9e,suggestionChip:I9e,suggestionChipText:A9e,suggestionChipAction:M9e,streaming:W9e,streamingFading:j9e,streamingSvg:N9e,streamingSvgFading:L9e};function V9e({inputRef:t,inputEmpty:e,inputSuggestion:n,terminalVisible:i,onKeyDown:r,onChange:s,onSend:o,onSuggestionClick:a,onUploadPath:l,presetItems:c,onPresetSend:d,isStreaming:u,streamingFading:O}){const[h,p]=f.useState(!1);return i?n?C.jsxs("div",{className:li.suggestionChip,onClick:a,children:[C.jsx("span",{className:li.suggestionChipText,children:n}),C.jsx("span",{className:li.suggestionChipAction,children:"↵"})]}):null:C.jsx("div",{className:li.chatInputBar,children:C.jsxs("div",{className:`${li.chatInputWrapper}${u?` ${li.streaming}`:""}${O?` ${li.streamingFading}`:""}`,children:[(u||O)&&C.jsxs("svg",{className:`${li.streamingSvg}${O?` ${li.streamingSvgFading}`:""}`,children:[C.jsx("defs",{children:C.jsxs("filter",{id:"ccv-streamGlow",children:[C.jsx("feGaussianBlur",{stdDeviation:"2",result:"blur"}),C.jsxs("feMerge",{children:[C.jsx("feMergeNode",{in:"blur"}),C.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),[{da:"20 30",op:.08,off:0},{da:"16 34",op:.15,off:-4},{da:"11 39",op:.3,off:-9},{da:"6 44",op:.6,off:-14},{da:"3 47",op:1,off:-17}].map((m,g,v)=>C.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",rx:"16",ry:"16",pathLength:"100",fill:"none",strokeWidth:"1.5",stroke:"#60a5fa",strokeOpacity:m.op,strokeLinecap:"round",strokeDasharray:m.da,filter:g===v.length-1?"url(#ccv-streamGlow)":void 0,children:C.jsx("animate",{attributeName:"stroke-dashoffset",from:m.off,to:m.off-100,dur:"2.5s",repeatCount:"indefinite"})},g))]}),C.jsxs("div",{className:li.chatTextareaWrap,children:[C.jsx("textarea",{ref:t,className:li.chatTextarea,placeholder:n?"":Oe("ui.chatInput.placeholder"),rows:1,onKeyDown:r,onInput:s}),n&&e&&C.jsx("div",{className:li.ghostText,children:n})]}),C.jsxs("div",{className:li.chatInputBottom,children:[C.jsxs("div",{className:li.plusArea,children:[C.jsx("button",{className:`${li.plusBtn}${h?` ${li.plusBtnOpen}`:""}`,onClick:()=>p(m=>!m),title:Oe("ui.chatInput.more"),children:C.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),C.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),h&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:li.plusOverlay,onClick:()=>p(!1)}),C.jsxs("div",{className:li.plusMenu,children:[c&&c.length>0&&c.map(m=>{const g=m.builtinId&&!m.modified,v=g?Oe(m.teamName):m.teamName,$=g?Oe(m.description):m.description;return C.jsxs("button",{className:li.plusMenuItem,onClick:()=>{p(!1),d==null||d($)},title:$,children:[C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),C.jsx("circle",{cx:"9",cy:"7",r:"4"}),C.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),C.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),C.jsx("span",{className:li.presetLabel,children:v||$})]},m.id)}),C.jsxs("button",{className:li.plusMenuItem,onClick:()=>{p(!1);const m=document.createElement("input");m.type="file",m.onchange=async g=>{var $;const v=($=g.target.files)==null?void 0:$[0];if(v)try{const b=await bQ(v);l(b)}catch(b){console.error("[CC Viewer] Upload failed:",b)}},m.click()},children:[C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),C.jsx("polyline",{points:"17 8 12 3 7 8"}),C.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),C.jsx("span",{children:Oe("ui.terminal.upload")})]})]})]})]}),C.jsx("div",{className:Gt?li.chatInputHintMobile:li.chatInputHint,children:Gt?Oe("ui.chatInput.hintMobile"):C.jsxs(C.Fragment,{children:[Oe(n&&e?"ui.chatInput.hintTab":"ui.chatInput.hintEnter"),C.jsx("span",{className:li.chatInputHintSep,children:" · "}),C.jsx("span",{className:li.chatInputHintTerminal,children:Oe("ui.chatInput.hintTerminal")})]})}),C.jsx("button",{className:`${li.sendBtn} ${e?li.sendBtnDisabled:""}`,onClick:o,disabled:e,title:Oe("ui.chatInput.send"),children:C.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[C.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),C.jsx("polyline",{points:"5 12 12 5 19 12"})]})})]})]})})}const j$=0,yc=1,kO=2,RV=4;function _3(t){return()=>t}function B9e(t){t()}function EV(t,e){return n=>t(e(n))}function Q3(t,e){return()=>t(e)}function Y9e(t,e){return n=>t(e,n)}function HC(t){return t!==void 0}function q9e(...t){return()=>{t.map(B9e)}}function RO(){}function N$(t,e){return e(t),t}function D9e(t,e){return e(t)}function yi(...t){return t}function Un(t,e){return t(yc,e)}function hn(t,e){t(j$,e)}function KC(t){t(kO)}function Pi(t){return t(RV)}function Nt(t,e){return Un(t,Y9e(e,j$))}function Go(t,e){const n=t(yc,i=>{n(),e(i)});return n}function x3(t){let e,n;return i=>r=>{e=r,n&&clearTimeout(n),n=setTimeout(()=>{i(e)},t)}}function XV(t,e){return t===e}function $i(t=XV){let e;return n=>i=>{t(e,i)||(e=i,n(i))}}function Ht(t){return e=>n=>{t(n)&&e(n)}}function Rt(t){return e=>EV(e,t)}function Qa(t){return e=>()=>{e(t)}}function He(t,...e){const n=U9e(...e);return((i,r)=>{switch(i){case kO:KC(t);return;case yc:return Un(t,n(r))}})}function za(t,e){return n=>i=>{n(e=t(e,i))}}function md(t){return e=>n=>{t>0?t--:e(n)}}function gl(t){let e=null,n;return i=>r=>{e=r,!n&&(n=setTimeout(()=>{n=void 0,i(e)},t))}}function pn(...t){const e=new Array(t.length);let n=0,i=null;const r=2**t.length-1;return t.forEach((s,o)=>{const a=2**o;Un(s,l=>{const c=n;n|=a,e[o]=l,c!==r&&n===r&&i&&(i(),i=null)})}),s=>o=>{const a=()=>{s([o].concat(e))};n===r?a():i=a}}function U9e(...t){return e=>t.reduceRight(D9e,e)}function Z9e(t){let e,n;const i=()=>e==null?void 0:e();return function(r,s){switch(r){case yc:return s?n===s?void 0:(i(),n=s,e=Un(t,s),e):(i(),RO);case kO:i(),n=null;return}}}function ot(t){let e=t;const n=En();return((i,r)=>{switch(i){case j$:e=r;break;case yc:{r(e);break}case RV:return e}return n(i,r)})}function Kr(t,e){return N$(ot(e),n=>Nt(t,n))}function En(){const t=[];return((e,n)=>{switch(e){case j$:t.slice().forEach(i=>{i(n)});return;case kO:t.splice(0,t.length);return;case yc:return t.push(n),()=>{const i=t.indexOf(n);i>-1&&t.splice(i,1)}}})}function ao(t){return N$(En(),e=>Nt(t,e))}function Ln(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:G9e(),singleton:n}}const G9e=()=>Symbol();function F9e(t){const e=new Map,n=({constructor:i,dependencies:r,id:s,singleton:o})=>{if(o&&e.has(s))return e.get(s);const a=i(r.map(l=>n(l)));return o&&e.set(s,a),a};return n(t)}function nr(...t){const e=En(),n=new Array(t.length);let i=0;const r=2**t.length-1;return t.forEach((s,o)=>{const a=2**o;Un(s,l=>{n[o]=l,i|=a,i===r&&hn(e,n)})}),function(s,o){switch(s){case kO:{KC(e);return}case yc:return i===r&&o(n),Un(e,o)}}}function Ft(t,e=XV){return He(t,$i(e))}function Vx(...t){return function(e,n){switch(e){case kO:return;case yc:return q9e(...t.map(i=>Un(i,n)))}}}const fr={DEBUG:0,INFO:1,WARN:2,ERROR:3},H9e={[fr.DEBUG]:"debug",[fr.ERROR]:"error",[fr.INFO]:"log",[fr.WARN]:"warn"},K9e=()=>typeof globalThis>"u"?window:globalThis,_c=Ln(()=>{const t=ot(fr.ERROR);return{log:ot((e,n,i=fr.INFO)=>{const r=K9e().VIRTUOSO_LOG_LEVEL??Pi(t);i>=r&&console[H9e[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0});function wd(t,e,n){return JC(t,e,n).callbackRef}function JC(t,e,n){const i=U.useRef(null);let r=o=>{};const s=U.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(o=>{const a=()=>{const l=o[0].target;l.offsetParent!==null&&t(l)};n?a():requestAnimationFrame(a)}):null,[t,n]);return r=o=>{o&&e?(s==null||s.observe(o),i.current=o):(i.current&&(s==null||s.unobserve(i.current)),i.current=null)},{callbackRef:r,ref:i}}function J9e(t,e,n,i,r,s,o,a,l){const c=U.useCallback(d=>{const u=eWe(d.children,e,a?"offsetWidth":"offsetHeight",r);let O=d.parentElement;for(;O.dataset.virtuosoScroller===void 0;)O=O.parentElement;const h=O.lastElementChild.dataset.viewportType==="window";let p;h&&(p=O.ownerDocument.defaultView);const m=o?a?o.scrollLeft:o.scrollTop:h?a?p.scrollX||p.document.documentElement.scrollLeft:p.scrollY||p.document.documentElement.scrollTop:a?O.scrollLeft:O.scrollTop,g=o?a?o.scrollWidth:o.scrollHeight:h?a?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight:a?O.scrollWidth:O.scrollHeight,v=o?a?o.offsetWidth:o.offsetHeight:h?a?p.innerWidth:p.innerHeight:a?O.offsetWidth:O.offsetHeight;i({scrollHeight:g,scrollTop:Math.max(m,0),viewportHeight:v}),s==null||s(a?w3("column-gap",getComputedStyle(d).columnGap,r):w3("row-gap",getComputedStyle(d).rowGap,r)),u!==null&&t(u)},[t,e,r,s,o,i,a]);return JC(c,n,l)}function eWe(t,e,n,i){const r=t.length;if(r===0)return null;const s=[];for(let o=0;o<r;o++){const a=t.item(o);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),d=e(a,n);if(d===0&&i("Zero-sized element, this should not happen",{child:a},fr.ERROR),d===c)continue;const u=s[s.length-1];s.length===0||u.size!==d||u.endIndex!==l-1?s.push({endIndex:l,size:d,startIndex:l}):s[s.length-1].endIndex++}return s}function w3(t,e,n){return e!=="normal"&&(e==null?void 0:e.endsWith("px"))!==!0&&n(`${t} was not resolved to pixel value correctly`,e,fr.WARN),e==="normal"?0:parseInt(e??"0",10)}function zV(t,e,n){const i=U.useRef(null),r=U.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),d=c.width;let u,O;if(e){const h=e.getBoundingClientRect(),p=c.top-h.top;O=h.height-Math.max(0,p),u=p+e.scrollTop}else{const h=o.current.ownerDocument.defaultView;O=h.innerHeight-Math.max(0,c.top),u=c.top+h.scrollY}i.current={offsetTop:u,visibleHeight:O,visibleWidth:d},t(i.current)},[t,e]),{callbackRef:s,ref:o}=JC(r,!0,n),a=U.useCallback(()=>{r(o.current)},[r,o]);return U.useEffect(()=>{var c;if(e){e.addEventListener("scroll",a);const d=new ResizeObserver(()=>{requestAnimationFrame(a)});return d.observe(e),()=>{e.removeEventListener("scroll",a),d.unobserve(e)}}const l=(c=o.current)==null?void 0:c.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",a),l==null||l.addEventListener("resize",a),()=>{l==null||l.removeEventListener("scroll",a),l==null||l.removeEventListener("resize",a)}},[a,e,o]),s}const Xs=Ln(()=>{const t=En(),e=En(),n=ot(0),i=En(),r=ot(0),s=En(),o=En(),a=ot(0),l=ot(0),c=ot(0),d=ot(0),u=En(),O=En(),h=ot(!1),p=ot(!1),m=ot(!1);return Nt(He(t,Rt(({scrollTop:g})=>g)),e),Nt(He(t,Rt(({scrollHeight:g})=>g)),o),Nt(e,r),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:d,headerHeight:a,horizontalDirection:p,scrollBy:O,scrollContainerState:t,scrollHeight:o,scrollingInProgress:h,scrollTo:u,scrollTop:e,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:i,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),Zf={lvl:0};function IV(t,e){const n=t.length;if(n===0)return[];let{index:i,value:r}=e(t[0]);const s=[];for(let o=1;o<n;o++){const{index:a,value:l}=e(t[o]);s.push({end:a-1,start:i,value:r}),i=a,r=l}return s.push({end:1/0,start:i,value:r}),s}function oi(t){return t===Zf}function Gf(t,e){if(!oi(t))return e===t.k?t.v:e<t.k?Gf(t.l,e):Gf(t.r,e)}function ia(t,e,n="k"){if(oi(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const i=ia(t.r,e,n);return i[0]===-1/0?[t.k,t.v]:i}return ia(t.l,e,n)}function ro(t,e,n){return oi(t)?WV(e,n,1):e===t.k?Or(t,{k:e,v:n}):e<t.k?P3(Or(t,{l:ro(t.l,e,n)})):P3(Or(t,{r:ro(t.r,e,n)}))}function Tu(){return Zf}function ku(t,e,n){if(oi(t))return[];const i=ia(t,e)[0];return tWe(Yx(t,i,n))}function Bx(t,e){if(oi(t))return Zf;const{k:n,l:i,r}=t;if(e===n){if(oi(i))return r;if(oi(r))return i;const[s,o]=MV(i);return Gg(Or(t,{k:s,l:AV(i),v:o}))}return e<n?Gg(Or(t,{l:Bx(i,e)})):Gg(Or(t,{r:Bx(r,e)}))}function Jc(t){return oi(t)?[]:[...Jc(t.l),{k:t.k,v:t.v},...Jc(t.r)]}function Yx(t,e,n){if(oi(t))return[];const{k:i,l:r,r:s,v:o}=t;let a=[];return i>e&&(a=a.concat(Yx(r,e,n))),i>=e&&i<=n&&a.push({k:i,v:o}),i<=n&&(a=a.concat(Yx(s,e,n))),a}function Gg(t){const{l:e,lvl:n,r:i}=t;if(i.lvl>=n-1&&e.lvl>=n-1)return t;if(n>i.lvl+1){if(L1(e))return jV(Or(t,{lvl:n-1}));if(!oi(e)&&!oi(e.r))return Or(e.r,{l:Or(e,{r:e.r.l}),lvl:n,r:Or(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(L1(t))return qx(Or(t,{lvl:n-1}));if(!oi(i)&&!oi(i.l)){const r=i.l,s=L1(r)?i.lvl-1:i.lvl;return Or(r,{l:Or(t,{lvl:n-1,r:r.l}),lvl:r.lvl+1,r:qx(Or(i,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function Or(t,e){return WV(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function AV(t){return oi(t.r)?t.l:Gg(Or(t,{r:AV(t.r)}))}function L1(t){return oi(t)||t.lvl>t.r.lvl}function MV(t){return oi(t.r)?[t.k,t.v]:MV(t.r)}function WV(t,e,n,i=Zf,r=Zf){return{k:t,l:i,lvl:n,r,v:e}}function P3(t){return qx(jV(t))}function jV(t){const{l:e}=t;return!oi(e)&&e.lvl===t.lvl?Or(e,{r:Or(t,{l:e.r})}):t}function qx(t){const{lvl:e,r:n}=t;return!oi(n)&&!oi(n.r)&&n.lvl===e&&n.r.lvl===e?Or(n,{l:Or(t,{r:n.l}),lvl:e+1}):t}function tWe(t){return IV(t,({k:e,v:n})=>({index:e,value:n}))}function NV(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function Ff(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const eT=Ln(()=>({recalcInProgress:ot(!1)}),[],{singleton:!0});function LV(t,e,n){return t[$0(t,e,n)]}function $0(t,e,n,i=0){let r=t.length-1;for(;i<=r;){const s=Math.floor((i+r)/2),o=t[s],a=n(o,e);if(a===0)return s;if(a===-1){if(r-i<2)return s-1;r=s-1}else{if(r===i)return s;i=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function nWe(t,e,n,i){const r=$0(t,e,i),s=$0(t,n,i,r);return t.slice(r,s+1)}function bc(t,e){return Math.round(t.getBoundingClientRect()[e])}function L$(t){return!oi(t.groupOffsetTree)}function tT({index:t},e){return e===t?0:e<t?-1:1}function iWe(){return{groupIndices:[],groupOffsetTree:Tu(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Tu()}}function rWe(t,e){let n=oi(t)?0:1/0;for(const i of e){const{endIndex:r,size:s,startIndex:o}=i;if(n=Math.min(n,o),oi(t)){t=ro(t,0,s);continue}const a=ku(t,o-1,r+1);if(a.some(uWe(i)))continue;let l=!1,c=!1;for(const{end:d,start:u,value:O}of a)l?(r>=u||s===O)&&(t=Bx(t,u)):(c=O!==s,l=!0),d>r&&r>=u&&O!==s&&(t=ro(t,r+1,O));c&&(t=ro(t,o,s))}return[t,n]}function sWe(t){return typeof t.groupIndex<"u"}function oWe({offset:t},e){return e===t?0:e<t?-1:1}function Hf(t,e,n){if(e.length===0)return 0;const{index:i,offset:r,size:s}=LV(e,t,tT),o=t-i,a=s*o+(o-1)*n+r;return a>0?a+n:a}function VV(t,e){if(!L$(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function BV(t,e,n){if(sWe(t))return e.groupIndices[t.groupIndex]+1;const i=t.index==="LAST"?n:t.index;let r=VV(i,e);return r=Math.max(0,r,Math.min(n,r)),r}function aWe(t,e,n,i=0){return i>0&&(e=Math.max(e,LV(t,i,tT).offset)),IV(nWe(t,e,n,oWe),dWe)}function lWe(t,[e,n,i,r]){e.length>0&&i("received item sizes",e,fr.DEBUG);const s=t.sizeTree;let o=s,a=0;if(n.length>0&&oi(s)&&e.length===2){const O=e[0].size,h=e[1].size;o=n.reduce((p,m)=>ro(ro(p,m,O),m+1,h),o)}else[o,a]=rWe(o,e);if(o===s)return t;const{lastIndex:l,lastOffset:c,lastSize:d,offsetTree:u}=Dx(t.offsetTree,a,o,r);return{groupIndices:n,groupOffsetTree:n.reduce((O,h)=>ro(O,h,Hf(h,u,r)),Tu()),lastIndex:l,lastOffset:c,lastSize:d,offsetTree:u,sizeTree:o}}function cWe(t){return Jc(t).map(({k:e,v:n},i,r)=>{const s=r[i+1];return{endIndex:s!==void 0?s.k-1:1/0,size:n,startIndex:e}})}function C3(t,e){let n=0,i=0;for(;n<t;)n+=e[i+1]-e[i]-1,i++;return i-(n===t?0:1)}function Dx(t,e,n,i){let r=t,s=0,o=0,a=0,l=0;if(e!==0){l=$0(r,e-1,tT),a=r[l].offset;const c=ia(n,e-1);s=c[0],o=c[1],r.length&&r[l].size===ia(n,e)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(const{start:c,value:d}of ku(n,e,1/0)){const u=c-s,O=u*o+a+u*i;r.push({index:c,offset:O,size:d}),s=c,a=O,o=d}return{lastIndex:s,lastOffset:a,lastSize:o,offsetTree:r}}function dWe(t){return{index:t.index,value:t}}function uWe(t){const{endIndex:e,size:n,startIndex:i}=t;return r=>r.start===i&&(r.end===e||r.end===1/0)&&r.value===n}const OWe={offsetHeight:"height",offsetWidth:"width"},Ja=Ln(([{log:t},{recalcInProgress:e}])=>{const n=En(),i=En(),r=Kr(i,0),s=En(),o=En(),a=ot(0),l=ot([]),c=ot(void 0),d=ot(void 0),u=ot(void 0),O=ot(void 0),h=ot((Q,P)=>bc(Q,OWe[P])),p=ot(void 0),m=ot(0),g=iWe(),v=Kr(He(n,pn(l,t,m),za(lWe,g),$i()),g),$=Kr(He(l,$i(),za((Q,P)=>({current:P,prev:Q.current}),{current:[],prev:[]}),Rt(({prev:Q})=>Q)),[]);Nt(He(l,Ht(Q=>Q.length>0),pn(v,m),Rt(([Q,P,w])=>{const E=Q.reduce((z,k,T)=>ro(z,k,Hf(k,P.offsetTree,w)||T),Tu());return{...P,groupIndices:Q,groupOffsetTree:E}})),v),Nt(He(i,pn(v),Ht(([Q,{lastIndex:P}])=>Q<P),Rt(([Q,{lastIndex:P,lastSize:w}])=>[{endIndex:P,size:w,startIndex:Q}])),n),Nt(c,d);const b=Kr(He(c,Rt(Q=>Q===void 0)),!0);Nt(He(d,Ht(Q=>Q!==void 0&&oi(Pi(v).sizeTree)),Rt(Q=>{const P=Pi(u),w=Pi(l).length>0;return P!==void 0&&P!==0?w?[{endIndex:0,size:P,startIndex:0},{endIndex:1,size:Q,startIndex:1}]:[]:[{endIndex:0,size:Q,startIndex:0}]})),n),Nt(He(O,Ht(Q=>Q!==void 0&&Q.length>0&&oi(Pi(v).sizeTree)),Rt(Q=>{const P=[];let w=Q[0],E=0;for(let z=1;z<Q.length;z++){const k=Q[z];k!==w&&(P.push({endIndex:z-1,size:w,startIndex:E}),w=k,E=z)}return P.push({endIndex:Q.length-1,size:w,startIndex:E}),P})),n),Nt(He(l,pn(u,d),Ht(([,Q,P])=>Q!==void 0&&P!==void 0),Rt(([Q,P,w])=>{const E=[];for(let z=0;z<Q.length;z++){const k=Q[z],T=Q[z+1];E.push({startIndex:k,endIndex:k,size:P}),T!==void 0&&E.push({startIndex:k+1,endIndex:T-1,size:w})}return E})),n);const S=ao(He(n,pn(v),za(({sizes:Q},[P,w])=>({changed:w!==Q,sizes:w}),{changed:!1,sizes:g}),Rt(Q=>Q.changed)));Un(He(a,za((Q,P)=>({diff:Q.prev-P,prev:P}),{diff:0,prev:0}),Rt(Q=>Q.diff)),Q=>{const{groupIndices:P}=Pi(v);if(Q>0)hn(e,!0),hn(s,Q+C3(Q,P));else if(Q<0){const w=Pi($);w.length>0&&(Q-=C3(-Q,w)),hn(o,Q)}}),Un(He(a,pn(t)),([Q,P])=>{Q<0&&P("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},fr.ERROR)});const y=ao(s);Nt(He(s,pn(v),Rt(([Q,P])=>{const w=P.groupIndices.length>0,E=[],z=P.lastSize;if(w){const k=Gf(P.sizeTree,0);let T=0,x=0;for(;T<Q;){const X=P.groupIndices[x],I=P.groupIndices.length===x+1?1/0:P.groupIndices[x+1]-X-1;E.push({endIndex:X,size:k,startIndex:X}),E.push({endIndex:X+1+I-1,size:z,startIndex:X+1}),x++,T+=I+1}const R=Jc(P.sizeTree);return T!==Q&&R.shift(),R.reduce((X,{k:I,v:A})=>{let W=X.ranges;return X.prevSize!==0&&(W=[...X.ranges,{endIndex:I+Q-1,size:X.prevSize,startIndex:X.prevIndex}]),{prevIndex:I+Q,prevSize:A,ranges:W}},{prevIndex:Q,prevSize:0,ranges:E}).ranges}return Jc(P.sizeTree).reduce((k,{k:T,v:x})=>({prevIndex:T+Q,prevSize:x,ranges:[...k.ranges,{endIndex:T+Q-1,size:k.prevSize,startIndex:k.prevIndex}]}),{prevIndex:0,prevSize:z,ranges:[]}).ranges})),n);const _=ao(He(o,pn(v,m),Rt(([Q,{offsetTree:P},w])=>{const E=-Q;return Hf(E,P,w)})));return Nt(He(o,pn(v,m),Rt(([Q,P,w])=>{if(P.groupIndices.length>0){if(oi(P.sizeTree))return P;let z=Tu();const k=Pi($);let T=0,x=0,R=0;for(;T<-Q;){R=k[x];const X=k[x+1]-R-1;x++,T+=X+1}if(z=Jc(P.sizeTree).reduce((X,{k:I,v:A})=>ro(X,Math.max(0,I+Q),A),z),T!==-Q){const X=Gf(P.sizeTree,R);z=ro(z,0,X);const I=ia(P.sizeTree,-Q+1)[1];z=ro(z,1,I)}return{...P,sizeTree:z,...Dx(P.offsetTree,0,z,w)}}const E=Jc(P.sizeTree).reduce((z,{k,v:T})=>ro(z,Math.max(0,k+Q),T),Tu());return{...P,sizeTree:E,...Dx(P.offsetTree,0,E,w)}})),v),{beforeUnshiftWith:y,data:p,defaultItemSize:d,firstItemIndex:a,fixedItemSize:c,fixedGroupSize:u,gap:m,groupIndices:l,heightEstimates:O,itemSize:h,listRefresh:S,shiftWith:o,shiftWithOffset:_,sizeRanges:n,sizes:v,statefulTotalCount:r,totalCount:i,trackItemSizes:b,unshiftWith:s}},yi(_c,eT),{singleton:!0});function hWe(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const YV=Ln(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:i,scrollTop:r}])=>{const s=En(),o=En(),a=ao(He(s,Rt(hWe)));return Nt(He(a,Rt(l=>l.totalCount)),n),Nt(He(a,Rt(l=>l.groupIndices)),t),Nt(He(nr(r,e,i),Ht(([l,c])=>L$(c)),Rt(([l,c,d])=>ia(c.groupOffsetTree,Math.max(l-d,0),"v")[0]),$i(),Rt(l=>[l])),o),{groupCounts:s,topItemsIndexes:o}},yi(Ja,Xs)),Qc=Ln(([{log:t}])=>{const e=ot(!1),n=ao(He(e,Ht(i=>i),$i()));return Un(e,i=>{i&&Pi(t)("props updated",{},fr.DEBUG)}),{didMount:n,propsReady:e}},yi(_c),{singleton:!0}),fWe=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function qV(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!fWe)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const zp=Ln(([{gap:t,listRefresh:e,sizes:n,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:o,headerHeight:a,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:u},{log:O}])=>{const h=En(),p=En(),m=ot(0);let g=null,v=null,$=null;function b(){g!==null&&(g(),g=null),$!==null&&($(),$=null),v&&(clearTimeout(v),v=null),hn(l,!1)}return Nt(He(h,pn(n,u,i,m,a,o,O),pn(t,s,r),Rt(([[S,y,_,Q,P,w,E,z],k,T,x])=>{const R=qV(S),{align:X,behavior:I,offset:A}=R,W=Q-1,N=BV(R,y,W);let L=Hf(N,y.offsetTree,k)+w;X==="end"?(L+=T+ia(y.sizeTree,N)[1]-_+x,N===W&&(L+=E)):X==="center"?L+=(T+ia(y.sizeTree,N)[1]-_+x)/2:L-=P,A!==void 0&&A!==0&&(L+=A);const Y=j=>{b(),j?(z("retrying to scroll to",{location:S},fr.DEBUG),hn(h,S)):(hn(p,!0),z("list did not change, scroll successful",{},fr.DEBUG))};if(b(),I==="smooth"){let j=!1;$=Un(e,V=>{j=j||V}),g=Go(d,()=>{Y(j)})}else g=Go(He(e,pWe(150)),Y);return v=setTimeout(()=>{b()},1200),hn(l,!0),z("scrolling from index to",{behavior:I,index:N,top:L},fr.DEBUG),{behavior:I,top:L}})),c),{scrollTargetReached:p,scrollToIndex:h,topListHeight:m}},yi(Ja,Xs,_c),{singleton:!0});function pWe(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return i=>{i&&(e(!0),clearTimeout(n))}}}function nT(t,e){t===0?e():requestAnimationFrame(()=>{nT(t-1,e)})}function iT(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const Ip=Ln(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:i},{scrollTargetReached:r,scrollToIndex:s},{didMount:o}])=>{const a=ot(!0),l=ot(0),c=ot(!0);return Nt(He(o,pn(l),Ht(([d,u])=>u!==0),Qa(!1)),a),Nt(He(o,pn(l),Ht(([d,u])=>u!==0),Qa(!1)),c),Un(He(nr(e,o),pn(a,n,t,c),Ht(([[,d],u,{sizeTree:O},h,p])=>d&&(!oi(O)||HC(h))&&!u&&!p),pn(l)),([,d])=>{Go(r,()=>{hn(c,!0)}),nT(4,()=>{Go(i,()=>{hn(a,!0)}),hn(s,d)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},yi(Ja,Xs,zp,Qc),{singleton:!0});function DV(t,e){return Math.abs(t-e)<1.01}const Kf="up",Hh="down",mWe="none",gWe={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},vWe=0,Ap=Ln(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:i,scrollTop:r,viewportHeight:s}])=>{const o=ot(!1),a=ot(!0),l=En(),c=En(),d=ot(4),u=ot(vWe),O=Kr(He(Vx(He(Ft(r),md(1),Qa(!0)),He(Ft(r),md(1),Qa(!1),x3(100))),$i()),!1),h=Kr(He(Vx(He(n,Qa(!0)),He(n,Qa(!1),x3(200))),$i()),!1);Nt(He(nr(Ft(r),Ft(u)),Rt(([$,b])=>$<=b),$i()),a),Nt(He(a,gl(50)),c);const p=ao(He(nr(i,Ft(s),Ft(e),Ft(t),Ft(d)),za(($,[{scrollHeight:b,scrollTop:S},y,_,Q,P])=>{const w=S+y-b>-P,E={scrollHeight:b,scrollTop:S,viewportHeight:y};if(w){let k,T;return S>$.state.scrollTop?(k="SCROLLED_DOWN",T=$.state.scrollTop-S):(k="SIZE_DECREASED",T=$.state.scrollTop-S||$.scrollTopDelta),{atBottom:!0,atBottomBecause:k,scrollTopDelta:T,state:E}}let z;return E.scrollHeight>$.state.scrollHeight?z="SIZE_INCREASED":y<$.state.viewportHeight?z="VIEWPORT_HEIGHT_DECREASING":S<$.state.scrollTop?z="SCROLLING_UPWARDS":z="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:z,state:E}},gWe),$i(($,b)=>$!==void 0&&$.atBottom===b.atBottom))),m=Kr(He(i,za(($,{scrollHeight:b,scrollTop:S,viewportHeight:y})=>{if(!DV($.scrollHeight,b)){const _=b-(S+y)<1;return $.scrollTop!==S&&_?{changed:!0,jump:$.scrollTop-S,scrollHeight:b,scrollTop:S}:{changed:!0,jump:0,scrollHeight:b,scrollTop:S}}return{changed:!1,jump:0,scrollHeight:b,scrollTop:S}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Ht($=>$.changed),Rt($=>$.jump)),0);Nt(He(p,Rt($=>$.atBottom)),o),Nt(He(o,gl(50)),l);const g=ot(Hh);Nt(He(i,Rt(({scrollTop:$})=>$),$i(),za(($,b)=>Pi(h)?{direction:$.direction,prevScrollTop:b}:{direction:b<$.prevScrollTop?Kf:Hh,prevScrollTop:b},{direction:Hh,prevScrollTop:0}),Rt($=>$.direction)),g),Nt(He(i,gl(50),Qa(mWe)),g);const v=ot(0);return Nt(He(O,Ht($=>!$),Qa(0)),v),Nt(He(r,gl(100),pn(O),Ht(([$,b])=>b),za(([$,b],[S])=>[b,S],[0,0]),Rt(([$,b])=>b-$)),v),{atBottomState:p,atBottomStateChange:l,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:u,isAtBottom:o,isAtTop:a,isScrolling:O,lastJumpDueToItemResize:m,scrollDirection:g,scrollVelocity:v}},yi(Xs)),Jf="top",ep="bottom",T3="none";function k3(t,e,n){return typeof t=="number"?n===Kf&&e===Jf||n===Hh&&e===ep?t:0:n===Kf?e===Jf?t.main:t.reverse:e===ep?t.main:t.reverse}function R3(t,e){return typeof t=="number"?t:t[e]??0}const rT=Ln(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:i,viewportHeight:r}])=>{const s=En(),o=ot(0),a=ot(0),l=ot(0),c=Kr(He(nr(Ft(i),Ft(r),Ft(n),Ft(s,Ff),Ft(l),Ft(o),Ft(e),Ft(t),Ft(a)),Rt(([d,u,O,[h,p],m,g,v,$,b])=>{const S=d-$,y=g+v,_=Math.max(O-S,0);let Q=T3;const P=R3(b,Jf),w=R3(b,ep);return h-=$,h+=O+v,p+=O+v,p-=$,h>d+y-P&&(Q=Kf),p<d-_+u+w&&(Q=Hh),Q!==T3?[Math.max(S-O-k3(m,Jf,Q)-P,0),S-_-v+u+k3(m,ep,Q)+w]:null}),Ht(d=>d!==null),$i(Ff)),[0,0]);return{increaseViewportBy:a,listBoundary:s,overscan:l,topListHeight:o,visibleRange:c}},yi(Xs),{singleton:!0});function $We(t,e,n){if(L$(e)){const i=VV(t,e);return[{index:ia(e.groupOffsetTree,i)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:i,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:t,offset:0,size:0}]}const V1={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Fg(t,e,n,i,r,s){const{lastIndex:o,lastOffset:a,lastSize:l}=r;let c=0,d=0;if(t.length>0){c=t[0].offset;const m=t[t.length-1];d=m.offset+m.size}const u=n-o,O=a+u*l+(u-1)*i,h=c,p=O-d;return{bottom:d,firstItemIndex:s,items:E3(t,r,s),offsetBottom:p,offsetTop:c,top:h,topItems:E3(e,r,s),topListHeight:e.reduce((m,g)=>g.size+m,0),totalCount:n}}function UV(t,e,n,i,r,s){let o=0;if(n.groupIndices.length>0)for(const d of n.groupIndices){if(d-o>=t)break;o++}const a=t+o,l=iT(e,a),c=Array.from({length:a}).map((d,u)=>({data:s[u+l],index:u+l,offset:0,size:0}));return Fg(c,[],a,r,n,i)}function E3(t,e,n){if(t.length===0)return[];if(!L$(e))return t.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const i=t[0].index,r=t[t.length-1].index,s=[],o=ku(e.groupOffsetTree,i,r);let a,l=0;for(const c of t){(!a||a.end<c.index)&&(a=o.shift(),l=e.groupIndices.indexOf(a.start));let d;c.index===a.start?d={index:l,type:"group"}:d={groupIndex:l,index:c.index-(l+1)+n},s.push({...d,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return s}function X3(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const Pd=Ln(([{data:t,firstItemIndex:e,gap:n,sizes:i,totalCount:r},s,{listBoundary:o,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:u},O,{didMount:h},{recalcInProgress:p}])=>{const m=ot([]),g=ot(0),v=En(),$=ot(0);Nt(s.topItemsIndexes,m);const b=Kr(He(nr(h,p,Ft(l,Ff),Ft(r),Ft(i),Ft(c),d,Ft(m),Ft(e),Ft(n),Ft($),t),Ht(([Q,P,,w,,,,,,,,E])=>{const z=E!==void 0&&E.length!==w;return Q&&!P&&!z}),Rt(([,,[Q,P],w,E,z,k,T,x,R,X,I])=>{var te,pe;const A=E,{offsetTree:W,sizeTree:N}=A,L=Pi(g);if(w===0)return{...V1,totalCount:w};if(Q===0&&P===0)return L===0?{...V1,totalCount:w}:UV(L,z,E,x,R,I||[]);if(oi(N))return L>0?null:Fg($We(iT(z,w),A,I),[],w,R,A,x);const Y=[];if(T.length>0){const oe=T[0],ee=T[T.length-1];let ae=0;for(const Z of ku(N,oe,ee)){const H=Z.value,K=Math.max(Z.start,oe),se=Math.min(Z.end,ee);for(let ce=K;ce<=se;ce++)Y.push({data:I==null?void 0:I[ce],index:ce,offset:ae,size:H}),ae+=H}}if(!k)return Fg([],Y,w,R,A,x);const j=T.length>0?T[T.length-1]+1:0,V=aWe(W,Q,P,j);if(V.length===0)return null;const B=w-1,F=N$([],oe=>{for(const ee of V){const ae=ee.value;let Z=ae.offset,H=ee.start;const K=ae.size;if(ae.offset<Q){H+=Math.floor((Q-ae.offset+R)/(K+R));const ce=H-ee.start;Z+=ce*K+ce*R}H<j&&(Z+=(j-H)*K,H=j);const se=Math.min(ee.end,B);for(let ce=H;ce<=se&&!(Z>=P);ce++)oe.push({data:I==null?void 0:I[ce],index:ce,offset:Z,size:K}),Z+=K+R}}),ie=X3(X,Jf),D=X3(X,ep);if(F.length>0&&(ie>0||D>0)){const oe=F[0],ee=F[F.length-1];if(ie>0&&oe.index>j){const ae=Math.min(ie,oe.index-j),Z=[];let H=oe.offset;for(let K=oe.index-1;K>=oe.index-ae;K--){const se=((te=ku(N,K,K)[0])==null?void 0:te.value)??oe.size;H-=se+R,Z.unshift({data:I==null?void 0:I[K],index:K,offset:H,size:se})}F.unshift(...Z)}if(D>0&&ee.index<B){const ae=Math.min(D,B-ee.index);let Z=ee.offset+ee.size+R;for(let H=ee.index+1;H<=ee.index+ae;H++){const K=((pe=ku(N,H,H)[0])==null?void 0:pe.value)??ee.size;F.push({data:I==null?void 0:I[H],index:H,offset:Z,size:K}),Z+=K+R}}}return Fg(F,Y,w,R,A,x)}),Ht(Q=>Q!==null),$i()),V1);Nt(He(t,Ht(HC),Rt(Q=>Q==null?void 0:Q.length)),r),Nt(He(b,Rt(Q=>Q.topListHeight)),u),Nt(u,a),Nt(He(b,Rt(Q=>[Q.top,Q.bottom])),o),Nt(He(b,Rt(Q=>Q.items)),v);const S=ao(He(b,Ht(({items:Q})=>Q.length>0),pn(r,t),Ht(([{items:Q},P])=>Q[Q.length-1].originalIndex===P-1),Rt(([,Q,P])=>[Q-1,P]),$i(Ff),Rt(([Q])=>Q))),y=ao(He(b,gl(200),Ht(({items:Q,topItems:P})=>Q.length>0&&Q[0].originalIndex===P.length),Rt(({items:Q})=>Q[0].index),$i())),_=ao(He(b,Ht(({items:Q})=>Q.length>0),Rt(({items:Q})=>{let P=0,w=Q.length-1;for(;Q[P].type==="group"&&P<w;)P++;for(;Q[w].type==="group"&&w>P;)w--;return{endIndex:Q[w].index,startIndex:Q[P].index}}),$i(NV)));return{endReached:S,initialItemCount:g,itemsRendered:v,listState:b,minOverscanItemCount:$,rangeChanged:_,startReached:y,topItemsIndexes:m,...O}},yi(Ja,YV,rT,Ip,zp,Ap,Qc,eT),{singleton:!0}),ZV=Ln(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:i},{listState:r}])=>{const s=En(),o=Kr(He(nr(n,t,i,e,r),Rt(([a,l,c,d,u])=>a+l+c+d+u.offsetBottom+u.bottom)),0);return Nt(Ft(o),s),{totalListHeight:o,totalListHeightChanged:s}},yi(Xs,Pd),{singleton:!0}),bWe=Ln(([{viewportHeight:t},{totalListHeight:e}])=>{const n=ot(!1),i=Kr(He(nr(n,t,e),Ht(([r])=>r),Rt(([,r,s])=>Math.max(0,r-s)),gl(0),$i()),0);return{alignToBottom:n,paddingTopAddition:i}},yi(Xs,ZV),{singleton:!0}),GV=Ln(()=>({context:ot(null)})),SWe=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:i,...r},viewportBottom:s,viewportTop:o})=>e<o?{...r,align:n??"start",...i!==void 0?{behavior:i}:{}}:t>s?{...r,align:n??"end",...i!==void 0?{behavior:i}:{}}:null,FV=Ln(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:i,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:o,scrollTop:a,viewportHeight:l},{scrollToIndex:c}])=>{const d=En();return Nt(He(d,pn(e,l,n,s,r,i,a),pn(t),Rt(([[u,O,h,p,m,g,v,$],b])=>{const{calculateViewLocation:S=SWe,done:y,..._}=u,Q=BV(u,O,p-1),P=Hf(Q,O.offsetTree,b)+m+g,w=P+ia(O.sizeTree,Q)[1],E=$+g,z=$+h-v,k=S({itemBottom:w,itemTop:P,locationParams:_,viewportBottom:z,viewportTop:E});return k!==null?y&&Go(He(o,Ht(T=>!T),md(Pi(o)?1:2)),y):y==null||y(),k}),Ht(u=>u!==null)),c),{scrollIntoView:d}},yi(Ja,Xs,zp,Pd,_c),{singleton:!0});function z3(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const yWe=(t,e)=>typeof t=="function"?z3(t(e)):e&&z3(t),_We=Ln(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:i},{atBottomState:r,isAtBottom:s},{scrollToIndex:o},{scrolledToInitialItem:a},{didMount:l,propsReady:c},{log:d},{scrollingInProgress:u},{context:O},{scrollIntoView:h}])=>{const p=ot(!1),m=En();let g=null;function v(y){hn(o,{align:"end",behavior:y,index:"LAST"})}Un(He(nr(He(Ft(e),md(1)),l),pn(Ft(p),s,a,u),Rt(([[y,_],Q,P,w,E])=>{let z=_&&w,k="auto";return z&&(k=yWe(Q,P||E),z=z&&k!==!1),{followOutputBehavior:k,shouldFollow:z,totalCount:y}}),Ht(({shouldFollow:y})=>y)),({followOutputBehavior:y,totalCount:_})=>{g!==null&&(g(),g=null),Pi(n)!==void 0?requestAnimationFrame(()=>{Pi(d)("following output to ",{totalCount:_},fr.DEBUG),v(y)}):g=Go(t,()=>{Pi(d)("following output to ",{totalCount:_},fr.DEBUG),v(y),g=null})});function $(y){const _=Go(r,Q=>{y&&!Q.atBottom&&Q.notAtBottomBecause==="SIZE_INCREASED"&&g===null&&(Pi(d)("scrolling to bottom due to increased size",{},fr.DEBUG),v("auto"))});setTimeout(_,100)}Un(He(nr(Ft(p),e,c),Ht(([y,,_])=>y!==!1&&_),za(({value:y},[,_])=>({refreshed:y===_,value:_}),{refreshed:!1,value:0}),Ht(({refreshed:y})=>y),pn(p,e)),([,y])=>{Pi(a)&&$(y!==!1)}),Un(m,()=>{$(Pi(p)!==!1)}),Un(nr(Ft(p),r),([y,_])=>{y!==!1&&!_.atBottom&&_.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&v("auto")});const b=ot(null),S=En();return Nt(Vx(He(Ft(i),Rt(y=>(y==null?void 0:y.length)??0)),He(Ft(e))),S),Un(He(nr(He(S,md(1)),l),pn(Ft(b),a,u,O),Rt(([[y,_],Q,P,w,E])=>_&&P&&(Q==null?void 0:Q({context:E,totalCount:y,scrollingInProgress:w}))),Ht(y=>!!y),gl(0)),y=>{g!==null&&(g(),g=null),Pi(n)!==void 0?requestAnimationFrame(()=>{Pi(d)("scrolling into view",{}),hn(h,y)}):g=Go(t,()=>{Pi(d)("scrolling into view",{}),hn(h,y),g=null})}),{autoscrollToBottom:m,followOutput:p,scrollIntoViewOnChange:b}},yi(Ja,Ap,zp,Ip,Qc,_c,Xs,GV,FV)),QWe=Ln(([{data:t,firstItemIndex:e,gap:n,sizes:i},{initialTopMostItemIndex:r},{initialItemCount:s,listState:o},{didMount:a}])=>(Nt(He(a,pn(s),Ht(([,l])=>l!==0),pn(r,i,e,n,t),Rt(([[,l],c,d,u,O,h=[]])=>UV(l,c,d,u,O,h))),o),{}),yi(Ja,Ip,Pd,Qc),{singleton:!0}),xWe=Ln(([{didMount:t},{scrollTo:e},{listState:n}])=>{const i=ot(0);return Un(He(t,pn(i),Ht(([,r])=>r!==0),Rt(([,r])=>({top:r}))),r=>{Go(He(n,md(1),Ht(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{hn(e,r)})})}),{initialScrollTop:i}},yi(Qc,Xs,Pd),{singleton:!0}),HV=Ln(([{scrollVelocity:t}])=>{const e=ot(!1),n=En(),i=ot(!1);return Nt(He(t,pn(i,e,n),Ht(([r,s])=>s!==!1&&s!==void 0),Rt(([r,s,o,a])=>{const{enter:l,exit:c}=s;if(o){if(c(r,a))return!1}else if(l(r,a))return!0;return o}),$i()),e),Un(He(nr(e,t,n),pn(i)),([[r,s,o],a])=>{r&&a!==!1&&a!==void 0&&a.change&&a.change(s,o)}),{isSeeking:e,scrollSeekConfiguration:i,scrollSeekRangeChanged:n,scrollVelocity:t}},yi(Ap),{singleton:!0}),sT=Ln(([{scrollContainerState:t,scrollTo:e}])=>{const n=En(),i=En(),r=En(),s=ot(!1),o=ot(void 0);return Nt(He(nr(n,i),Rt(([{scrollHeight:a,scrollTop:l,viewportHeight:c},{offsetTop:d}])=>({scrollHeight:a,scrollTop:Math.max(0,l-d),viewportHeight:c}))),t),Nt(He(e,pn(i),Rt(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:o,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:i}},yi(Xs)),wWe=Ln(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:i},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:o,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=En(),d=ot(void 0),u=ot(null),O=ot(null);return Nt(a,u),Nt(l,O),Un(He(c,pn(e,i,o,u,O,n)),([h,p,m,g,v,$,b])=>{const S=cWe(p.sizeTree);g&&v!==null&&$!==null&&(m=v.scrollTop-$.offsetTop),m-=b,h({ranges:S,scrollTop:m})}),Nt(He(d,Ht(HC),Rt(PWe)),r),Nt(He(s,pn(d),Ht(([,h])=>h!==void 0),$i(),Rt(([,h])=>h.ranges)),t),{getState:c,restoreStateFrom:d}},yi(Ja,Xs,Ip,Qc,sT));function PWe(t){return{align:"start",index:0,offset:t.scrollTop}}const CWe=Ln(([{topItemsIndexes:t}])=>{const e=ot(0);return Nt(He(e,Ht(n=>n>=0),Rt(n=>Array.from({length:n}).map((i,r)=>r))),t),{topItemCount:e}},yi(Pd));function KV(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const TWe=KV(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),kWe=Ln(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:i},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:o,scrollDirection:a},{listState:l},{beforeUnshiftWith:c,gap:d,shiftWithOffset:u,sizes:O},{log:h},{recalcInProgress:p}])=>{const m=ao(He(l,pn(o),za(([,v,$,b],[{bottom:S,items:y,offsetBottom:_,totalCount:Q},P])=>{const w=S+_;let E=0;return $===Q&&v.length>0&&y.length>0&&(y[0].originalIndex===0&&v[0].originalIndex===0||(E=w-b,E!==0&&(E+=P))),[E,y,Q,w]},[0,[],0,0]),Ht(([v])=>v!==0),pn(i,a,n,r,h,p),Ht(([,v,$,b,,,S])=>!S&&!b&&v!==0&&$===Kf),Rt(([[v],,,,,$])=>($("Upward scrolling compensation",{amount:v},fr.DEBUG),v))));function g(v){v>0?(hn(e,{behavior:"auto",top:-v}),hn(t,0)):(hn(t,0),hn(e,{behavior:"auto",top:-v}))}return Un(He(m,pn(t,s)),([v,$,b])=>{b&&TWe()?hn(t,$-v):g(-v)}),Un(He(nr(Kr(s,!1),t,p),Ht(([v,$,b])=>!v&&!b&&$!==0),Rt(([v,$])=>$),gl(1)),g),Nt(He(u,Rt(v=>({top:-v}))),e),Un(He(c,pn(O,d),Rt(([v,{groupIndices:$,lastSize:b,sizeTree:S},y])=>{function _(z){return z*(b+y)}if($.length===0)return _(v);let Q=0;const P=Gf(S,0);let w=0,E=0;for(;w<v;){w++,Q+=P;let z=$.length===E+1?1/0:$[E+1]-$[E]-1;w+z>v&&(Q-=P,z=v-w+1),w+=z,Q+=_(z),E++}return Q})),v=>{hn(t,v),requestAnimationFrame(()=>{hn(e,{top:v}),requestAnimationFrame(()=>{hn(t,0),hn(p,!1)})})}),{deviation:t}},yi(Xs,Ap,Pd,Ja,_c,eT)),RWe=Ln(([t,e,n,i,r,s,o,a,l,c,d])=>({...t,...e,...n,...i,...r,...s,...o,...a,...l,...c,...d}),yi(rT,QWe,Qc,HV,ZV,xWe,bWe,sT,FV,_c,GV)),JV=Ln(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:i,fixedGroupSize:r,gap:s,groupIndices:o,heightEstimates:a,itemSize:l,sizeRanges:c,sizes:d,statefulTotalCount:u,totalCount:O,trackItemSizes:h},{initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:g},v,$,b,S,{scrollToIndex:y},_,{topItemCount:Q},{groupCounts:P},w])=>{const{listState:E,minOverscanItemCount:z,topItemsIndexes:k,rangeChanged:T,...x}=S;return Nt(T,w.scrollSeekRangeChanged),Nt(He(w.windowViewportRect,Rt(R=>R.visibleHeight)),v.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:i,fixedGroupHeight:r,gap:s,groupCounts:P,heightEstimates:a,initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:g,sizeRanges:c,topItemCount:Q,topItemsIndexes:k,totalCount:O,...b,groupIndices:o,itemSize:l,listState:E,minOverscanItemCount:z,scrollToIndex:y,statefulTotalCount:u,trackItemSizes:h,rangeChanged:T,...x,...w,...v,sizes:d,...$}},yi(Ja,Ip,Xs,wWe,_We,Pd,zp,kWe,CWe,YV,RWe));function EWe(t,e){const n={},i={};let r=0;const s=t.length;for(;r<s;)i[t[r]]=1,r+=1;for(const o in e)Object.hasOwn(i,o)||(n[o]=e[o]);return n}const ng=typeof document<"u"?U.useLayoutEffect:U.useEffect;function eB(t,e,n){const i=Object.keys(e.required||{}),r=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),o=Object.keys(e.events||{}),a=U.createContext({});function l(g,v){g.propsReady!==void 0&&hn(g.propsReady,!1);for(const $ of i){const b=g[e.required[$]];hn(b,v[$])}for(const $ of r)if($ in v){const b=g[e.optional[$]];hn(b,v[$])}g.propsReady!==void 0&&hn(g.propsReady,!0)}function c(g){return s.reduce((v,$)=>(v[$]=b=>{const S=g[e.methods[$]];hn(S,b)},v),{})}function d(g){return o.reduce((v,$)=>(v[$]=Z9e(g[e.events[$]]),v),{})}const u=U.forwardRef(function(g,v){const{children:$,...b}=g,[S]=U.useState(()=>N$(F9e(t),Q=>{l(Q,b)})),[y]=U.useState(Q3(d,S));ng(()=>{for(const Q of o)Q in b&&Un(y[Q],b[Q]);return()=>{Object.values(y).map(KC)}},[b,y,S]),ng(()=>{l(S,b)}),U.useImperativeHandle(v,_3(c(S)));const _=n;return C.jsx(a.Provider,{value:S,children:n!==void 0?C.jsx(_,{...EWe([...i,...r,...o],b),children:$}):$})}),O=g=>{const v=U.useContext(a);return U.useCallback($=>{hn(v[g],$)},[v,g])},h=g=>{const v=U.useContext(a)[g],$=U.useCallback(b=>Un(v,b),[v]);return U.useSyncExternalStore($,()=>Pi(v),()=>Pi(v))},p=g=>{const v=U.useContext(a)[g],[$,b]=U.useState(Q3(Pi,v));return ng(()=>Un(v,S=>{S!==$&&b(_3(S))}),[v,$]),$},m=U.version.startsWith("18")?h:p;return{Component:u,useEmitter:(g,v)=>{const $=U.useContext(a)[g];ng(()=>Un($,v),[v,$])},useEmitterValue:m,usePublisher:O}}const tB=U.createContext(void 0),nB=U.createContext(void 0),B1="-webkit-sticky",I3="sticky",oT=KV(()=>{if(typeof document>"u")return I3;const t=document.createElement("div");return t.style.position=B1,t.style.position===B1?B1:I3}),iB=typeof document<"u"?U.useLayoutEffect:U.useEffect;function Y1(t){return"self"in t}function XWe(t){return"body"in t}function rB(t,e,n,i=RO,r,s){const o=U.useRef(null),a=U.useRef(null),l=U.useRef(null),c=U.useCallback(O=>{let h,p,m;const g=O.target;if(XWe(g)||Y1(g)){const $=Y1(g)?g:g.defaultView;m=s===!0?$.scrollX:$.scrollY,h=s===!0?$.document.documentElement.scrollWidth:$.document.documentElement.scrollHeight,p=s===!0?$.innerWidth:$.innerHeight}else m=s===!0?g.scrollLeft:g.scrollTop,h=s===!0?g.scrollWidth:g.scrollHeight,p=s===!0?g.offsetWidth:g.offsetHeight;const v=()=>{t({scrollHeight:h,scrollTop:Math.max(m,0),viewportHeight:p})};O.suppressFlushSync===!0?v():sd.flushSync(v),a.current!==null&&(m===a.current||m<=0||m===h-p)&&(a.current=null,e(!0),l.current&&(clearTimeout(l.current),l.current=null))},[t,e,s]);U.useEffect(()=>{const O=r||o.current;return i(r||o.current),c({suppressFlushSync:!0,target:O}),O.addEventListener("scroll",c,{passive:!0}),()=>{i(null),O.removeEventListener("scroll",c)}},[o,c,n,i,r]);function d(O){const h=o.current;if(!h||(s===!0?"offsetWidth"in h&&h.offsetWidth===0:"offsetHeight"in h&&h.offsetHeight===0))return;const p=O.behavior==="smooth";let m,g,v;Y1(h)?(g=Math.max(bc(h.document.documentElement,s===!0?"width":"height"),s===!0?h.document.documentElement.scrollWidth:h.document.documentElement.scrollHeight),m=s===!0?h.innerWidth:h.innerHeight,v=s===!0?window.scrollX:window.scrollY):(g=h[s===!0?"scrollWidth":"scrollHeight"],m=bc(h,s===!0?"width":"height"),v=h[s===!0?"scrollLeft":"scrollTop"]);const $=g-m;if(O.top=Math.ceil(Math.max(Math.min($,O.top),0)),DV(m,g)||O.top===v){t({scrollHeight:g,scrollTop:v,viewportHeight:m}),p&&e(!0);return}p?(a.current=O.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,e(!0)},1e3)):a.current=null,s===!0&&(O={...O.behavior!==void 0?{behavior:O.behavior}:{},left:O.top}),h.scrollTo(O)}function u(O){s===!0&&(O={...O.behavior!==void 0?{behavior:O.behavior}:{},...O.top!==void 0?{left:O.top}:{}}),o.current.scrollBy(O)}return{scrollByCallback:u,scrollerRef:o,scrollToCallback:d}}function aT(t){return t}const zWe=Ln(()=>{const t=ot(a=>`Item ${a}`),e=ot(a=>`Group ${a}`),n=ot({}),i=ot(aT),r=ot("div"),s=ot(RO),o=(a,l=null)=>Kr(He(n,Rt(c=>c[a]),$i()),l);return{components:n,computeItemKey:i,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:e,HeaderComponent:o("Header"),HeaderFooterTag:r,ItemComponent:o("Item","div"),itemContent:t,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),IWe=Ln(([t,e])=>({...t,...e}),yi(JV,zWe)),AWe=({height:t})=>C.jsx("div",{style:{height:t}}),MWe={overflowAnchor:"none",position:oT(),zIndex:1},sB={overflowAnchor:"none"},WWe={...sB,display:"inline-block",height:"100%"},A3=U.memo(function({showTopList:t=!1}){const e=ln("listState"),n=Po("sizeRanges"),i=ln("useWindowScroll"),r=ln("customScrollParent"),s=Po("windowScrollContainerState"),o=Po("scrollContainerState"),a=r||i?s:o,l=ln("itemContent"),c=ln("context"),d=ln("groupContent"),u=ln("trackItemSizes"),O=ln("itemSize"),h=ln("log"),p=Po("gap"),m=ln("horizontalDirection"),{callbackRef:g}=J9e(n,O,u,t?RO:a,h,p,r,m,ln("skipAnimationFrameInResizeObserver")),[v,$]=U.useState(0);lT("deviation",x=>{v!==x&&$(x)});const b=ln("EmptyPlaceholder"),S=ln("ScrollSeekPlaceholder")??AWe,y=ln("ListComponent"),_=ln("ItemComponent"),Q=ln("GroupComponent"),P=ln("computeItemKey"),w=ln("isSeeking"),E=ln("groupIndices").length>0,z=ln("alignToBottom"),k=ln("initialItemFinalLocationReached"),T=t?{}:{boxSizing:"border-box",...m?{display:"inline-block",height:"100%",marginLeft:v!==0?v:z?"auto":0,paddingLeft:e.offsetTop,paddingRight:e.offsetBottom,whiteSpace:"nowrap"}:{marginTop:v!==0?v:z?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},...k?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&b!==null&&b!==void 0?C.jsx(b,{...Hr(b,c)}):C.jsx(y,{...Hr(y,c),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:T,children:(t?e.topItems:e.items).map(x=>{const R=x.originalIndex,X=P(R+e.firstItemIndex,x.data,c);return w?f.createElement(S,{...Hr(S,c),height:x.size,index:x.index,key:X,type:x.type||"item",...x.type==="group"?{}:{groupIndex:x.groupIndex}}):x.type==="group"?f.createElement(Q,{...Hr(Q,c),"data-index":R,"data-item-index":x.index,"data-known-size":x.size,key:X,style:MWe},d(x.index,c)):f.createElement(_,{...Hr(_,c),...VWe(_,x.data),"data-index":R,"data-item-group-index":x.groupIndex,"data-item-index":x.index,"data-known-size":x.size,key:X,style:m?WWe:sB},E?l(x.index,x.groupIndex,x.data,c):l(x.index,x.data,c))})})}),jWe={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},NWe={outline:"none",overflowX:"auto",position:"relative"},V$=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),LWe={position:oT(),top:0,width:"100%",zIndex:1};function Hr(t,e){if(typeof t!="string")return{context:e}}function VWe(t,e){return{item:typeof t=="string"?void 0:e}}const BWe=U.memo(function(){const t=ln("HeaderComponent"),e=Po("headerHeight"),n=ln("HeaderFooterTag"),i=wd(U.useMemo(()=>s=>{e(bc(s,"height"))},[e]),!0,ln("skipAnimationFrameInResizeObserver")),r=ln("context");return t!=null?C.jsx(n,{ref:i,children:C.jsx(t,{...Hr(t,r)})}):null}),YWe=U.memo(function(){const t=ln("FooterComponent"),e=Po("footerHeight"),n=ln("HeaderFooterTag"),i=wd(U.useMemo(()=>s=>{e(bc(s,"height"))},[e]),!0,ln("skipAnimationFrameInResizeObserver")),r=ln("context");return t!=null?C.jsx(n,{ref:i,children:C.jsx(t,{...Hr(t,r)})}):null});function oB({useEmitter:t,useEmitterValue:e,usePublisher:n}){return U.memo(function({children:i,style:r,context:s,...o}){const a=n("scrollContainerState"),l=e("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=e("scrollerRef"),u=e("horizontalDirection")||!1,{scrollByCallback:O,scrollerRef:h,scrollToCallback:p}=rB(a,c,l,d,void 0,u);return t("scrollTo",p),t("scrollBy",O),C.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:h,style:{...u?NWe:jWe,...r},tabIndex:0,...o,...Hr(l,s),children:i})})}function aB({useEmitter:t,useEmitterValue:e,usePublisher:n}){return U.memo(function({children:i,style:r,context:s,...o}){const a=n("windowScrollContainerState"),l=e("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=e("totalListHeight"),u=e("deviation"),O=e("customScrollParent"),h=U.useRef(null),p=e("scrollerRef"),{scrollByCallback:m,scrollerRef:g,scrollToCallback:v}=rB(a,c,l,p,O);return iB(()=>{var $;return g.current=O||(($=h.current)==null?void 0:$.ownerDocument.defaultView),()=>{g.current=null}},[g,O]),t("windowScrollTo",v),t("scrollBy",m),C.jsx(l,{ref:h,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...d!==0?{height:d+u}:void 0},...o,...Hr(l,s),children:i})})}const qWe=({children:t})=>{const e=U.useContext(tB),n=Po("viewportHeight"),i=Po("fixedItemHeight"),r=ln("alignToBottom"),s=ln("horizontalDirection"),o=U.useMemo(()=>EV(n,l=>bc(l,s?"width":"height")),[n,s]),a=wd(o,!0,ln("skipAnimationFrameInResizeObserver"));return U.useEffect(()=>{e&&(n(e.viewportHeight),i(e.itemHeight))},[e,n,i]),C.jsx("div",{"data-viewport-type":"element",ref:a,style:V$(r),children:t})},DWe=({children:t})=>{const e=U.useContext(tB),n=Po("windowViewportRect"),i=Po("fixedItemHeight"),r=ln("customScrollParent"),s=zV(n,r,ln("skipAnimationFrameInResizeObserver")),o=ln("alignToBottom");return U.useEffect(()=>{e&&(i(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,i]),C.jsx("div",{"data-viewport-type":"window",ref:s,style:V$(o),children:t})},UWe=({children:t})=>{const e=ln("TopItemListComponent")??"div",n=ln("headerHeight"),i={...LWe,marginTop:`${n}px`},r=ln("context");return C.jsx(e,{style:i,...Hr(e,r),children:t})},ZWe=U.memo(function(t){const e=ln("useWindowScroll"),n=ln("topItemsIndexes").length>0,i=ln("customScrollParent"),r=ln("context");return C.jsxs(i||e?HWe:FWe,{...t,context:r,children:[n&&C.jsx(UWe,{children:C.jsx(A3,{showTopList:!0})}),C.jsxs(i||e?DWe:qWe,{children:[C.jsx(BWe,{}),C.jsx(A3,{}),C.jsx(YWe,{})]})]})}),{Component:GWe,useEmitter:lT,useEmitterValue:ln,usePublisher:Po}=eB(IWe,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ZWe),FWe=oB({useEmitter:lT,useEmitterValue:ln,usePublisher:Po}),HWe=aB({useEmitter:lT,useEmitterValue:ln,usePublisher:Po}),KWe=GWe,JWe=Ln(()=>{const t=ot(c=>C.jsxs("td",{children:["Item $",c]})),e=ot(null),n=ot(c=>C.jsxs("td",{colSpan:1e3,children:["Group ",c]})),i=ot(null),r=ot(null),s=ot({}),o=ot(aT),a=ot(RO),l=(c,d=null)=>Kr(He(s,Rt(u=>u[c]),$i()),d);return{components:s,computeItemKey:o,context:e,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:i,itemContent:t,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}});yi(JV,JWe);oT();const M3={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},eje={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:W3,floor:b0,max:Kh,min:q1,round:j3}=Math;function N3(t,e,n){return Array.from({length:e-t+1}).map((i,r)=>({data:n===null?null:n[r+t],index:r+t}))}function tje(t){return{...eje,items:t}}function ig(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function nje(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const ije=Ln(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:i},{footerHeight:r,headerHeight:s,scrollBy:o,scrollContainerState:a,scrollTo:l,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:u},O,h,{didMount:p,propsReady:m},{customScrollParent:g,useWindowScroll:v,windowScrollContainerState:$,windowScrollTo:b,windowViewportRect:S},y])=>{const _=ot(0),Q=ot(0),P=ot(M3),w=ot({height:0,width:0}),E=ot({height:0,width:0}),z=En(),k=En(),T=ot(0),x=ot(null),R=ot({column:0,row:0}),X=En(),I=En(),A=ot(!1),W=ot(0),N=ot(!0),L=ot(!1),Y=ot(!1);Un(He(p,pn(W),Ht(([D,te])=>te!==0)),()=>{hn(N,!1)}),Un(He(nr(p,N,E,w,W,L),Ht(([D,te,pe,oe,,ee])=>D&&!te&&pe.height!==0&&oe.height!==0&&!ee)),([,,,,D])=>{hn(L,!0),nT(1,()=>{hn(z,D)}),Go(He(c),()=>{hn(e,[0,0]),hn(N,!0)})}),Nt(He(I,Ht(D=>D!=null&&D.scrollTop>0),Qa(0)),Q),Un(He(p,pn(I),Ht(([,D])=>D!=null)),([,D])=>{D&&(hn(w,D.viewport),hn(E,D.item),hn(R,D.gap),D.scrollTop>0&&(hn(A,!0),Go(He(c,md(1)),te=>{hn(A,!1)}),hn(l,{top:D.scrollTop})))}),Nt(He(w,Rt(({height:D})=>D)),u),Nt(He(nr(Ft(w,ig),Ft(E,ig),Ft(R,(D,te)=>D!==void 0&&D.column===te.column&&D.row===te.row),Ft(c)),Rt(([D,te,pe,oe])=>({gap:pe,item:te,scrollTop:oe,viewport:D}))),X),Nt(He(nr(Ft(_),i,Ft(R,nje),Ft(E,ig),Ft(w,ig),Ft(x),Ft(Q),Ft(A),Ft(N),Ft(W)),Ht(([,,,,,,,D])=>!D),Rt(([D,[te,pe],oe,ee,ae,Z,H,,K,se])=>{const{column:ce,row:ve}=oe,{height:be,width:de}=ee,{width:me}=ae;if(H===0&&(D===0||me===0))return M3;if(de===0){const Ce=iT(se,D),we=Ce+Math.max(H-1,0);return tje(N3(Ce,we,Z))}const he=lB(me,de,ce);let fe,ke;K?te===0&&pe===0&&H>0?(fe=0,ke=H-1):(fe=he*b0((te+ve)/(be+ve)),ke=he*W3((pe+ve)/(be+ve))-1,ke=q1(D-1,Kh(ke,he-1)),fe=q1(ke,Kh(0,fe))):(fe=0,ke=-1);const Ae=N3(fe,ke,Z),{bottom:De,top:Ze}=L3(ae,oe,ee,Ae),qe=W3(D/he),Je=qe*be+(qe-1)*ve-De;return{bottom:De,itemHeight:be,items:Ae,itemWidth:de,offsetBottom:Je,offsetTop:Ze,top:Ze}})),P),Nt(He(x,Ht(D=>D!==null),Rt(D=>D.length)),_),Nt(He(nr(w,E,P,R),Ht(([D,te,{items:pe}])=>pe.length>0&&te.height!==0&&D.height!==0),Rt(([D,te,{items:pe},oe])=>{const{bottom:ee,top:ae}=L3(D,oe,te,pe);return[ae,ee]}),$i(Ff)),e);const j=ot(!1);Nt(He(c,pn(j),Rt(([D,te])=>te||D!==0)),j);const V=ao(He(nr(P,_),Ht(([{items:D}])=>D.length>0),pn(j),Ht(([[D,te],pe])=>{const oe=D.items[D.items.length-1].index===te-1;return(pe||D.bottom>0&&D.itemHeight>0&&D.offsetBottom===0&&D.items.length===te)&&oe}),Rt(([[,D]])=>D-1),$i())),B=ao(He(Ft(P),Ht(({items:D})=>D.length>0&&D[0].index===0),Qa(0),$i())),F=ao(He(Ft(P),pn(A),Ht(([{items:D},te])=>D.length>0&&!te),Rt(([{items:D}])=>({endIndex:D[D.length-1].index,startIndex:D[0].index})),$i(NV),gl(0)));Nt(F,h.scrollSeekRangeChanged),Nt(He(z,pn(w,E,_,R),Rt(([D,te,pe,oe,ee])=>{const ae=qV(D),{align:Z,behavior:H,offset:K}=ae;let se=ae.index;se==="LAST"&&(se=oe-1),se=Kh(0,se,q1(oe-1,se));let ce=Ux(te,ee,pe,se);return Z==="end"?ce=j3(ce-te.height+pe.height):Z==="center"&&(ce=j3(ce-te.height/2+pe.height/2)),K!==void 0&&K!==0&&(ce+=K),{behavior:H,top:ce}})),l);const ie=Kr(He(P,Rt(D=>D.offsetBottom+D.bottom)),0);return Nt(He(S,Rt(D=>({height:D.visibleHeight,width:D.visibleWidth}))),w),{customScrollParent:g,data:x,deviation:T,footerHeight:r,gap:R,headerHeight:s,increaseViewportBy:t,initialItemCount:Q,itemDimensions:E,overscan:n,restoreStateFrom:I,scrollBy:o,scrollContainerState:a,scrollHeight:k,scrollTo:l,scrollToIndex:z,scrollTop:c,smoothScrollTargetReached:d,totalCount:_,useWindowScroll:v,viewportDimensions:w,windowScrollContainerState:$,windowScrollTo:b,windowViewportRect:S,...h,gridState:P,horizontalDirection:Y,initialTopMostItemIndex:W,totalListHeight:ie,...O,endReached:V,propsReady:m,rangeChanged:F,startReached:B,stateChanged:X,stateRestoreInProgress:A,...y}},yi(rT,Xs,Ap,HV,Qc,sT,_c));function lB(t,e,n){return Kh(1,b0((t+n)/(b0(e)+n)))}function L3(t,e,n,i){const{height:r}=n;if(r===void 0||i.length===0)return{bottom:0,top:0};const s=Ux(t,e,n,i[0].index);return{bottom:Ux(t,e,n,i[i.length-1].index)+r,top:s}}function Ux(t,e,n,i){const r=lB(t.width,n.width,e.column),s=b0(i/r),o=s*n.height+Kh(0,s-1)*e.row;return o>0?o+e.row:o}const rje=Ln(()=>{const t=ot(u=>`Item ${u}`),e=ot({}),n=ot(null),i=ot("virtuoso-grid-item"),r=ot("virtuoso-grid-list"),s=ot(aT),o=ot("div"),a=ot(RO),l=(u,O=null)=>Kr(He(e,Rt(h=>h[u]),$i()),O),c=ot(!1),d=ot(!1);return Nt(Ft(d),c),{components:e,computeItemKey:s,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:o,itemClassName:i,ItemComponent:l("Item","div"),itemContent:t,listClassName:r,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),sje=Ln(([t,e])=>({...t,...e}),yi(ije,rje)),oje=U.memo(function(){const t=wi("gridState"),e=wi("listClassName"),n=wi("itemClassName"),i=wi("itemContent"),r=wi("computeItemKey"),s=wi("isSeeking"),o=Co("scrollHeight"),a=wi("ItemComponent"),l=wi("ListComponent"),c=wi("ScrollSeekPlaceholder"),d=wi("context"),u=Co("itemDimensions"),O=Co("gap"),h=wi("log"),p=wi("stateRestoreInProgress"),m=Co("reportReadyState"),g=wd(U.useMemo(()=>v=>{const $=v.parentElement.parentElement.scrollHeight;o($);const b=v.firstChild;if(b!==null){const{height:S,width:y}=b.getBoundingClientRect();u({height:S,width:y})}O({column:V3("column-gap",getComputedStyle(v).columnGap,h),row:V3("row-gap",getComputedStyle(v).rowGap,h)})},[o,u,O,h]),!0,!1);return iB(()=>{t.itemHeight>0&&t.itemWidth>0&&m(!0)},[t]),p?null:C.jsx(l,{className:e,ref:g,...Hr(l,d),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(v=>{const $=r(v.index,v.data,d);return s?C.jsx(c,{...Hr(c,d),height:t.itemHeight,index:v.index,width:t.itemWidth},$):f.createElement(a,{...Hr(a,d),className:n,"data-index":v.index,key:$},i(v.index,v.data,d))})})}),aje=U.memo(function(){const t=wi("HeaderComponent"),e=Co("headerHeight"),n=wi("headerFooterTag"),i=wd(U.useMemo(()=>s=>{e(bc(s,"height"))},[e]),!0,!1),r=wi("context");return t!=null?C.jsx(n,{ref:i,children:C.jsx(t,{...Hr(t,r)})}):null}),lje=U.memo(function(){const t=wi("FooterComponent"),e=Co("footerHeight"),n=wi("headerFooterTag"),i=wd(U.useMemo(()=>s=>{e(bc(s,"height"))},[e]),!0,!1),r=wi("context");return t!=null?C.jsx(n,{ref:i,children:C.jsx(t,{...Hr(t,r)})}):null}),cje=({children:t})=>{const e=U.useContext(nB),n=Co("itemDimensions"),i=Co("viewportDimensions"),r=wd(U.useMemo(()=>s=>{i(s.getBoundingClientRect())},[i]),!0,!1);return U.useEffect(()=>{e&&(i({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,i,n]),C.jsx("div",{ref:r,style:V$(!1),children:t})},dje=({children:t})=>{const e=U.useContext(nB),n=Co("windowViewportRect"),i=Co("itemDimensions"),r=wi("customScrollParent"),s=zV(n,r,!1);return U.useEffect(()=>{e&&(i({height:e.itemHeight,width:e.itemWidth}),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,i]),C.jsx("div",{ref:s,style:V$(!1),children:t})},uje=U.memo(function({...t}){const e=wi("useWindowScroll"),n=wi("customScrollParent"),i=n||e?hje:Oje,r=n||e?dje:cje,s=wi("context");return C.jsx(i,{...t,...Hr(i,s),children:C.jsxs(r,{children:[C.jsx(aje,{}),C.jsx(oje,{}),C.jsx(lje,{})]})})}),{useEmitter:cB,useEmitterValue:wi,usePublisher:Co}=eB(sje,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},uje),Oje=oB({useEmitter:cB,useEmitterValue:wi,usePublisher:Co}),hje=aB({useEmitter:cB,useEmitterValue:wi,usePublisher:Co});function V3(t,e,n){return e!=="normal"&&(e==null?void 0:e.endsWith("px"))!==!0&&n(`${t} was not resolved to pixel value correctly`,e,fr.WARN),e==="normal"?0:parseInt(e??"0",10)}const fje="_centerEmpty_ozv0m_1",pje="_container_ozv0m_8",mje="_mobileVirtuoso_ozv0m_18",gje="_sessionDividerText_ozv0m_23",vje="_lastResponseLabel_ozv0m_28",$je="_splitContainer_ozv0m_32",bje="_chatSection_ozv0m_39",Sje="_vResizer_ozv0m_47",yje="_terminalToggle_ozv0m_61",_je="_messageListWrap_ozv0m_84",Qje="_stickyBottomBtn_ozv0m_92",xje="_loadMoreWrap_ozv0m_142",wje="_loadMoreBtn_ozv0m_148",Pje="_navSidebar_ozv0m_164",Cje="_navBtn_ozv0m_181",Tje="_navBtnActive_ozv0m_201",kje="_navAvatarImg_ozv0m_221",Rje="_userPromptNavList_ozv0m_228",Eje="_userPromptNavItem_ozv0m_237",Xje="_terminalPanelWrap_ozv0m_257",zje="_navSidebarContent_ozv0m_264",Ije="_innerSplitArea_ozv0m_272",Aje="_chatSectionFlex_ozv0m_279",Mje="_overlayPanel_ozv0m_288",Wje="_streamingSpinnerWrap_ozv0m_296",jje="_sessionDivider_ozv0m_23",Nje="_loadMoreBtnLoading_ozv0m_309",Lje="_lastResponseDivider_ozv0m_314",Dt={centerEmpty:fje,container:pje,mobileVirtuoso:mje,sessionDividerText:gje,lastResponseLabel:vje,splitContainer:$je,chatSection:bje,vResizer:Sje,terminalToggle:yje,messageListWrap:_je,stickyBottomBtn:Qje,loadMoreWrap:xje,loadMoreBtn:wje,navSidebar:Pje,navBtn:Cje,navBtnActive:Tje,navAvatarImg:kje,userPromptNavList:Rje,userPromptNavItem:Eje,terminalPanelWrap:Xje,navSidebarContent:zje,innerSplitArea:Ije,chatSectionFlex:Aje,overlayPanel:Mje,streamingSpinnerWrap:Wje,sessionDivider:jje,loadMoreBtnLoading:Nje,lastResponseDivider:Lje},{Text:D1}=Tl,U1=240,Vje=100,Bje={},B3={},Yje=U.forwardRef((t,e)=>C.jsx("div",{ref:e,...t,className:Dt.container}));function qje(){return 100+Math.random()*50}class HYe extends U.Component{constructor(n){super(n);nt(this,"handleStickToBottom",()=>{this.setState({stickyBottom:!0},()=>{if(Gt&&this.virtuosoRef.current)this.virtuosoRef.current.scrollToIndex({index:"LAST",behavior:"smooth"});else{const n=this.containerRef.current;n&&(n.scrollTop=n.scrollHeight)}})});nt(this,"handleLoadMore",()=>{var o;this._mobileExtraItems+=Vje;const n=((o=this.state.allItems)==null?void 0:o.length)||0,i=this.buildAllItems(),r=this._applyMobileSlice(i),s=r.length-n;if(Gt&&this.virtuosoRef.current)this.setState({allItems:r,lastResponseItems:this._lastResponseItems,visibleCount:r.length},()=>{this.virtuosoRef.current&&s>0&&this.virtuosoRef.current.scrollToIndex({index:s,align:"start"})});else{const a=this.containerRef.current,l=a?a.scrollHeight:0,c=a?a.scrollTop:0;this.setState({allItems:r,lastResponseItems:this._lastResponseItems,visibleCount:r.length},()=>{if(a){const d=a.scrollHeight;a.scrollTop=c+(d-l)}})}});nt(this,"handlePresetSend",n=>{if(!n)return;const i=this._inputRef.current;i&&(i.value=n,i.style.height="auto",i.style.height=Math.min(i.scrollHeight,Gt?160:120)+"px",this.setState({inputEmpty:!1}),i.focus())});nt(this,"handlePromptOptionClick",n=>{if(this._promptSubmitting)return;const i=this._inputWs;if(!i||i.readyState!==WebSocket.OPEN)return;let r=this.state.ptyPrompt;r||(r=this.state.ptyPromptHistory.slice().reverse().find(O=>O.status==="active")||{options:Array.from({length:Math.max(n,3)},(O,h)=>({number:h+1,selected:h===0}))}),this._promptSubmitting=!0;const s=r.options,o=s.findIndex(O=>O.number===n);let a=s.findIndex(O=>O.selected);a<0&&(a=0);const l=o-a,c=l>0?"\x1B[B":"\x1B[A",d=Math.abs(l),u=O=>{O<d?(i.send(JSON.stringify({type:"input",data:c})),setTimeout(()=>u(O+1),30)):setTimeout(()=>{i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"input",data:"\r"}))},50)};u(0),this._currentPtyPrompt=null,this.setState(O=>{const h=O.ptyPromptHistory.slice(),p=h[h.length-1];return p&&p.status==="active"&&(h[h.length-1]={...p,status:"answered",selectedNumber:n}),{ptyPrompt:null,ptyPromptHistory:h}}),this._ptyBuffer="",this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),setTimeout(()=>{this._promptSubmitting=!1},500)});nt(this,"handlePermissionAllow",n=>{const i=this._inputWs;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"perm-hook-answer",id:n,decision:"allow"})),this.setState({pendingPermission:null})});nt(this,"handlePermissionAllowSession",n=>{const i=this._inputWs;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"perm-hook-answer",id:n,decision:"allow",allowSession:!0})),this.setState({pendingPermission:null})});nt(this,"handlePermissionDeny",n=>{const i=this._inputWs;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"perm-hook-answer",id:n,decision:"deny"})),this.setState({pendingPermission:null})});nt(this,"handlePlanApprove",n=>{const i=this._inputWs;i&&i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"sdk-plan-answer",id:n,approve:!0})),this.setState({pendingPlanApproval:null})});nt(this,"handlePlanReject",(n,i)=>{const r=this._inputWs;r&&r.readyState===WebSocket.OPEN&&r.send(JSON.stringify({type:"sdk-plan-answer",id:n,approve:!1,feedback:i||""})),this.setState({pendingPlanApproval:null})});nt(this,"handlePlanFeedbackSubmit",(n,i)=>{const r=this._inputWs;if(!r||r.readyState!==WebSocket.OPEN)return;let s=this.state.ptyPrompt;s||(s=this.state.ptyPromptHistory.slice().reverse().find(h=>h.status==="active")||{options:Array.from({length:Math.max(n,3)},(h,p)=>({number:p+1,selected:p===0}))});const o=s.options,a=o.findIndex(h=>h.number===n);let l=o.findIndex(h=>h.selected);l<0&&(l=0);const c=a-l,d=c>0?"\x1B[B":"\x1B[A",u=Math.abs(c),O=h=>{h<u?(r.send(JSON.stringify({type:"input",data:d})),setTimeout(()=>O(h+1),30)):setTimeout(()=>{r.send(JSON.stringify({type:"input",data:"\r"}));const p=this._ptyBuffer;let m=0;const g=()=>{if(m++,m>20||this._ptyBuffer!==p){r.readyState===WebSocket.OPEN&&(r.send(JSON.stringify({type:"input",data:i})),setTimeout(()=>{r.send(JSON.stringify({type:"input",data:"\r"}))},50));return}setTimeout(g,100)};setTimeout(g,100)},50)};O(0),this._currentPtyPrompt=null,this.setState(h=>{const p=h.ptyPromptHistory.slice(),m=p[p.length-1];return m&&m.status==="active"&&(p[p.length-1]={...m,status:"answered",selectedNumber:n}),{ptyPrompt:null,ptyPromptHistory:p}}),this._ptyBuffer="",this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer)});nt(this,"handleAskQuestionSubmit",(n,i,r)=>{var s,o;if(i&&r){const a={};for(const l of n){const c=r[l.questionIndex];if(c)if(l.type==="other")a[c.question]=l.text;else if(l.type==="multi"){const d=l.selectedIndices.map(u=>{var O;return(O=(c.options||[])[u])==null?void 0:O.label}).filter(Boolean);a[c.question]=d.join(", ")}else a[c.question]=((s=(c.options||[])[l.optionIndex])==null?void 0:s.label)||""}this.setState(l=>({localAskAnswers:{...l.localAskAnswers||{},[i]:a}}))}if(this.props.sdkMode){const a=this._inputWs;if(a&&a.readyState===WebSocket.OPEN){const l={},c=this._askHookQuestions||r;for(const d of n){const u=c==null?void 0:c[d.questionIndex];if(u)if(d.type==="other")l[u.question]=d.text;else if(d.type==="multi"){const O=d.selectedIndices.map(h=>{var p;return(p=(u.options||[])[h])==null?void 0:p.label}).filter(Boolean);l[u.question]=O.join(", ")}else l[u.question]=((o=(u.options||[])[d.optionIndex])==null?void 0:o.label)||""}a.send(JSON.stringify({type:"sdk-ask-answer",id:i||this._sdkAskId,answers:l})),this._sdkAskId=null}return}if(this._askHookActive&&!this._askSubmitting){this._submitViaHookBridge(n);return}if(!this._askHookActive&&!this._askSubmitting&&this._inputWs&&this._inputWs.readyState===WebSocket.OPEN){this._pendingHookAnswers=n,this._askHookWaitRetries=0,this._askSubmitting=!0,this._waitForHookBridge();return}this._submitViaPty(n)});nt(this,"handleInputSend",()=>{const n=this._inputRef.current;if(!n)return;const i=n.value.trim();i&&this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&(this.props.sdkMode?this._inputWs.send(JSON.stringify({type:"sdk-user-message",text:i})):(this._inputWs.send(JSON.stringify({type:"input",data:i})),setTimeout(()=>{this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&this._inputWs.send(JSON.stringify({type:"input",data:"\r"}))},50)),n.value="",n.style.height="auto",this.setState({inputEmpty:!0,pendingInput:i,inputSuggestion:null},()=>this.scrollToBottom()))});nt(this,"handleInputKeyDown",n=>{if(n.key==="Tab"&&this.state.inputSuggestion){n.preventDefault();const i=this._inputRef.current;i&&(i.value=this.state.inputSuggestion,i.style.height="auto",i.style.height=Math.min(i.scrollHeight,120)+"px"),this.setState({inputSuggestion:null,inputEmpty:!1});return}n.key==="Enter"&&!n.shiftKey&&!n.isComposing&&n.keyCode!==229&&(n.preventDefault(),this.handleInputSend())});nt(this,"handleInputChange",n=>{const i=n.target;i.style.height="auto",i.style.height=Math.min(i.scrollHeight,120)+"px";const r=!i.value.trim();this.setState({inputEmpty:r}),this.state.inputSuggestion&&!r&&this.setState({inputSuggestion:null})});nt(this,"handleSuggestionToTerminal",()=>{const n=this.state.inputSuggestion;!n||!this._inputWs||this._inputWs.readyState!==WebSocket.OPEN||(this._inputWs.send(JSON.stringify({type:"input",data:n})),setTimeout(()=>{this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&this._inputWs.send(JSON.stringify({type:"input",data:"\r"}))},50),this.setState({inputSuggestion:null,pendingInput:n},()=>this.scrollToBottom()))});nt(this,"handleUploadPath",n=>{const i=`"${n}"`,r=this._inputRef.current;r&&(r.value=(r.value?r.value+" ":"")+i,r.dispatchEvent(new Event("input",{bubbles:!0})),this.setState({inputEmpty:!1}))});nt(this,"handleSplitMouseDown",n=>{n.preventDefault(),this._resizing=!0;let i=[];const r=this.innerSplitRef.current;if(r){const l=r.getBoundingClientRect().width,c=7.8,d=[60,80,100,120],u=5;i=d.map(O=>{const h=O*c,p=h+u;if(p>l*.75||p<l*.15)return null;const m=l-h-u;return{cols:O,terminalPx:h,linePosition:m}}).filter(O=>O!==null)}this.setState({isDragging:!0,snapLines:i});const s=a=>{if(!this._resizing)return;const l=this.innerSplitRef.current;if(!l)return;const c=l.getBoundingClientRect(),d=c.width;let u=c.right-a.clientX;u=Math.max(200,Math.min(d*.75,u));let O=null;if(i.length>0){let p=1/0,m=null;for(const g of i){const v=Math.abs(a.clientX-c.left-g.linePosition);v<p&&(p=v,m=g)}m&&p<60&&(O=m)}this.setState({terminalWidth:u,activeSnapLine:O})},o=()=>{if(this._resizing=!1,this.state.activeSnapLine){const a=this.state.activeSnapLine.terminalPx;localStorage.setItem("cc-viewer-terminal-width",a.toString()),this.setState({terminalWidth:a,isDragging:!1,activeSnapLine:null,snapLines:[],needsInitialSnap:!1})}else localStorage.setItem("cc-viewer-terminal-width",this.state.terminalWidth.toString()),this.setState({isDragging:!1,activeSnapLine:null,snapLines:[],needsInitialSnap:!1});document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",o),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",s),document.addEventListener("mouseup",o),document.body.style.cursor="col-resize",document.body.style.userSelect="none"});nt(this,"handleToggleExpandPath",n=>{this.setState(i=>{const r=new Set(i.fileExplorerExpandedPaths);return r.has(n)?r.delete(n):r.add(n),{fileExplorerExpandedPaths:r}})});nt(this,"handleMdImageClick",n=>{const i=n.target.closest(".chat-md img");i&&i.src&&(n.preventDefault(),this.setState({mdLightboxSrc:i.src}))});nt(this,"handleOpenToolFilePath",async n=>{if(!n)return;let i=n;if(n.startsWith("/")){if(!this._projectDirCache)try{const o=await fetch(Et("/api/project-dir"));if(o.ok){const a=await o.json();a&&a.dir&&(this._projectDirCache=a.dir)}}catch{}this._projectDirCache&&n.startsWith(this._projectDirCache+"/")&&(i=n.slice(this._projectDirCache.length+1))}const r=i.split("/"),s=[];for(let o=1;o<r.length;o++)s.push(r.slice(0,o).join("/"));this._setFileExplorerOpen(!0),this.setState(o=>{const a=new Set(o.fileExplorerExpandedPaths);return s.forEach(l=>a.add(l)),{currentFile:i,currentGitDiff:null,scrollToLine:null,fileExplorerExpandedPaths:a}})});this.containerRef=U.createRef(),this.virtuosoRef=U.createRef(),this.splitContainerRef=U.createRef(),this.innerSplitRef=U.createRef(),this._incToolState=null,this._incToolProcessedCount=0,this._incToolSessionIdx=-1,this._prevSessions=null,this._reqScanCache={tsToIndex:{},modelName:null,subAgentEntries:[],processedCount:0};const i=localStorage.getItem("cc-viewer-terminal-width"),r=i?parseFloat(i):null;this.state={visibleCount:0,loading:!1,allItems:[],lastResponseItems:null,highlightTs:null,highlightFading:!1,highlightVisibleIdx:-1,terminalWidth:r||624,needsInitialSnap:r===null,inputEmpty:!0,pendingInput:null,stickyBottom:!0,ptyPrompt:null,ptyPromptHistory:[],inputSuggestion:null,fileExplorerOpen:!Gt&&localStorage.getItem("ccv_fileExplorerOpen")!=="false",currentFile:null,currentGitDiff:null,scrollToLine:null,fileExplorerExpandedPaths:new Set,gitChangesOpen:!1,snapLines:[],activeSnapLine:null,isDragging:!1,fileVersion:0,editorSessionId:null,editorFilePath:null,fileExplorerRefresh:0,gitChangesRefresh:0,roleFilterOpen:!1,roleFilterSelected:new Set,teamModalSession:null,mdLightboxSrc:null,streamingFading:!1,presetItems:[],localAskAnswers:{},pendingPermission:null,pendingPlanApproval:null},this._processedToolIds=new Set,this._projectDirCache=null,this._fileRefreshTimer=null,this._gitRefreshTimer=null,this._queueTimer=null,this._prevItemsLen=0,this._scrollTargetIdx=null,this._scrollTargetRef=U.createRef(),this._scrollFadeTimer=null,this._resizing=!1,this._inputWs=null,this._inputRef=U.createRef(),this._ptyBuffer="",this._ptyDataSeq=0,this._ptyDebounceTimer=null,this._currentPtyPrompt=null,this._askHookActive=!1,this._askHookQuestions=null,this._pendingHookAnswers=null,this._askHookWaitRetries=0,this._hookWaitTimer=null,this._mobileExtraItems=0,this._mobileSliceOffset=0,this._totalItemCount=0}_setFileExplorerOpen(n){localStorage.setItem("ccv_fileExplorerOpen",String(n)),this.setState({fileExplorerOpen:n})}_checkToolFileChanges(){var o,a;const n=this.props.mainAgentSessions;if(!n||n.length===0)return;this._processedToolIds.size>5e3&&this._processedToolIds.clear();let i=!1,r=!1,s=!1;for(const l of n){const c=[];if((a=(o=l.response)==null?void 0:o.body)!=null&&a.content&&c.push(l.response.body.content),Array.isArray(l.messages))for(const d of l.messages)d.role==="assistant"&&Array.isArray(d.content)&&c.push(d.content);for(const d of c)for(const u of d){if(u.type!=="tool_use"||!u.id||this._processedToolIds.has(u.id))continue;this._processedToolIds.add(u.id);const O=u.name;let h=u.input;if(typeof h=="string")try{h=JSON.parse(h.replace(/^\[object Object\]/,""))}catch{h={}}if(O==="Write"?(i=!0,r=!0):O==="Edit"||O==="NotebookEdit"?r=!0:O==="Bash"&&h&&h.command&&FAe(h.command)&&(i=!0,r=!0),(O==="Write"||O==="Edit"||O==="NotebookEdit")&&this.state.currentFile){const p=h&&h.file_path;if(p){let m=p;m.startsWith("/")&&this._projectDirCache&&m.startsWith(this._projectDirCache+"/")&&(m=m.slice(this._projectDirCache.length+1)),(m===this.state.currentFile||m.startsWith("/")&&m.endsWith("/"+this.state.currentFile))&&(s=!0)}}}}i&&this.state.fileExplorerOpen&&(clearTimeout(this._fileRefreshTimer),this._fileRefreshTimer=setTimeout(()=>{this.setState(l=>({fileExplorerRefresh:l.fileExplorerRefresh+1}))},500)),r&&this.state.gitChangesOpen&&(clearTimeout(this._gitRefreshTimer),this._gitRefreshTimer=setTimeout(()=>{this.setState(l=>({gitChangesRefresh:l.gitChangesRefresh+1}))},500)),s&&(clearTimeout(this._contentRefreshTimer),this._contentRefreshTimer=setTimeout(()=>{this.setState(l=>({fileVersion:l.fileVersion+1}))},500))}componentDidMount(){this.startRender(),this.props.cliMode&&this.connectInputWs(),Gt||this._bindStickyScroll(),this.state.needsInitialSnap&&this.props.cliMode&&this.props.terminalVisible&&this._snapToInitialPosition(),this._loadPresets()}shouldComponentUpdate(n,i){return n.requests!==this.props.requests||n.mainAgentSessions!==this.props.mainAgentSessions||n.collapseToolResults!==this.props.collapseToolResults||n.expandThinking!==this.props.expandThinking||n.showFullToolContent!==this.props.showFullToolContent||n.scrollToTimestamp!==this.props.scrollToTimestamp||n.cliMode!==this.props.cliMode||n.terminalVisible!==this.props.terminalVisible||n.userProfile!==this.props.userProfile||n.pendingUploadPaths!==this.props.pendingUploadPaths||n.isStreaming!==this.props.isStreaming||n.hasMoreHistory!==this.props.hasMoreHistory||n.loadingMore!==this.props.loadingMore||n.loadingSessionId!==this.props.loadingSessionId||n.lang!==this.props.lang||n.showThinkingSummaries!==this.props.showThinkingSummaries||n.fileLoading!==this.props.fileLoading||i!==this.state}componentDidUpdate(n,i){if(i.pendingPermission!==this.state.pendingPermission&&this.props.onPendingPermission&&(this.state.pendingPermission?this.props.onPendingPermission({permission:this.state.pendingPermission,handlers:{allow:this.handlePermissionAllow,allowSession:this.props.sdkMode?this.handlePermissionAllowSession:null,deny:this.handlePermissionDeny}}):this.props.onPendingPermission(null)),i.pendingPlanApproval!==this.state.pendingPlanApproval&&this.props.onPendingPlanApproval&&(this.state.pendingPlanApproval?this.props.onPendingPlanApproval({plan:this.state.pendingPlanApproval,handlers:{approve:this.handlePlanApprove,reject:this.handlePlanReject}}):this.props.onPendingPlanApproval(null)),n.isStreaming&&!this.props.isStreaming&&(this.setState({streamingFading:!0}),clearTimeout(this._streamingFadeTimer),this._streamingFadeTimer=setTimeout(()=>{this.setState({streamingFading:!1})},500)),!n.isStreaming&&this.props.isStreaming&&this.state.streamingFading&&(clearTimeout(this._streamingFadeTimer),this.setState({streamingFading:!1})),this.props.pendingUploadPaths&&this.props.pendingUploadPaths.length>0&&this.props.pendingUploadPaths!==n.pendingUploadPaths){const r=this.props.pendingUploadPaths.join(" "),s=this._inputRef.current;s?(s.value=(s.value?s.value+" ":"")+r,s.dispatchEvent(new Event("input",{bubbles:!0})),this.setState({inputEmpty:!1})):this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&this._inputWs.send(JSON.stringify({type:"input",data:r})),this.props.onUploadPathsConsumed&&this.props.onUploadPathsConsumed()}if(n.mainAgentSessions!==this.props.mainAgentSessions)this.props.mainAgentSessions!==this._prevSessions&&(this._incToolState=null,this._incToolProcessedCount=0,this._incToolSessionIdx=-1,this._prevSessions=this.props.mainAgentSessions,this._reqScanCache={tsToIndex:{},modelName:null,subAgentEntries:[],processedCount:0,subAgentProcessedCount:0}),Gt&&(this._mobileExtraItems=0),this.startRender(),this.state.pendingInput&&this.setState({pendingInput:null}),this._updateSuggestion(),this._checkToolFileChanges();else if(n.requests!==this.props.requests)this._reqScanCache.tsToIndex={},this._reqScanCache.processedCount=0,this._reqScanCache.subAgentEntries=[],this._reqScanCache.subAgentProcessedCount=0,this.startRender();else if(n.collapseToolResults!==this.props.collapseToolResults||n.expandThinking!==this.props.expandThinking){const r=this.buildAllItems(),s=this._applyMobileSlice(r);this.setState({allItems:s,lastResponseItems:this._lastResponseItems,visibleCount:s.length})}if(!n.scrollToTimestamp&&this.props.scrollToTimestamp)if(Gt&&this.props.scrollToTimestamp){const r=this.buildAllItems(),s=this._scrollTargetIdx;if(s!=null){const a=U1+this._mobileExtraItems,l=r.length>a?r.length-a:0;s<l&&(this._mobileExtraItems=r.length-s-U1,this._mobileExtraItems<0&&(this._mobileExtraItems=0))}const o=this._applyMobileSlice(r);this.setState({allItems:o,lastResponseItems:this._lastResponseItems,visibleCount:o.length},()=>this.scrollToBottom())}else{const r=this.buildAllItems(),s=this._applyMobileSlice(r);this.setState({allItems:s,lastResponseItems:this._lastResponseItems,visibleCount:s.length},()=>this.scrollToBottom())}Gt&&this.props.mobileChatVisible&&!n.mobileChatVisible&&requestAnimationFrame(()=>{if(this.virtuosoRef.current)this.virtuosoRef.current.scrollToIndex({index:"LAST"});else{const r=this.containerRef.current;r&&(r.scrollTop=r.scrollHeight)}}),!n.cliMode&&this.props.cliMode&&this.connectInputWs(),Gt||this._rebindStickyEl()}componentWillUnmount(){this._unmounted=!0,this.props.onPendingPermission&&this.props.onPendingPermission(null),this.props.onPendingPlanApproval&&this.props.onPendingPlanApproval(null),this._queueTimer&&clearTimeout(this._queueTimer),this._fadeClearTimer&&clearTimeout(this._fadeClearTimer),this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),this._fileRefreshTimer&&clearTimeout(this._fileRefreshTimer),this._gitRefreshTimer&&clearTimeout(this._gitRefreshTimer),this._contentRefreshTimer&&clearTimeout(this._contentRefreshTimer),this._wsReconnectTimer&&clearTimeout(this._wsReconnectTimer),this._waitForWsTimer&&clearTimeout(this._waitForWsTimer),this._waitForPtyTimer&&clearTimeout(this._waitForPtyTimer),this._planFeedbackTimer&&clearTimeout(this._planFeedbackTimer),this._streamingFadeTimer&&clearTimeout(this._streamingFadeTimer),this._hookWaitTimer&&clearTimeout(this._hookWaitTimer),this._pendingHookAnswers=null,this._unbindScrollFade(),Gt||this._unbindStickyScroll(),this._inputWs&&(this._inputWs.close(),this._inputWs=null)}startRender(){this._queueTimer&&clearTimeout(this._queueTimer);const n=this.state.stickyBottom;this._stickyScrollLock=!0;const i=this.buildAllItems(),r=this._lastResponseItems,s=this._applyMobileSlice(i);this._prevItemsLen=s.length,this.setState({allItems:s,lastResponseItems:r,visibleCount:s.length,loading:!1},()=>{this.scrollToBottom(n),requestAnimationFrame(()=>{this._stickyScrollLock=!1})})}queueNext(n,i){n>=i||(this._queueTimer=setTimeout(()=>{this.setState({visibleCount:n+1},()=>{this.scrollToBottom(),this.queueNext(n+1,i)})},qje()))}_isNearBottom(){const n=this.containerRef.current;return n?n.scrollHeight-n.scrollTop-n.clientHeight<=30:!0}scrollToBottom(n){const i=n??this.state.stickyBottom;if(Gt&&this.virtuosoRef.current){if(this._scrollTargetIdx!=null){this.virtuosoRef.current.scrollToIndex({index:this._scrollTargetIdx,align:"center"});const r=this.props.scrollToTimestamp;this._scrollTargetRef=U.createRef(),r&&(this.setState({highlightTs:r,highlightFading:!1}),this._bindScrollFade()),this.props.onScrollTsDone&&this.props.onScrollTsDone();return}i&&(this.virtuosoRef.current.scrollToIndex({index:"LAST",behavior:"auto"}),this.state.lastResponseItems&&requestAnimationFrame(()=>{const r=this._virtuosoScrollerEl;r&&(r.scrollTop=r.scrollHeight)}));return}if(this._scrollTargetRef.current){const r=this._scrollTargetRef.current,s=this.containerRef.current;s&&r.offsetHeight>s.clientHeight?r.scrollIntoView({block:"start",behavior:"instant"}):r.scrollIntoView({block:"center",behavior:"instant"});const o=this.props.scrollToTimestamp;this._scrollTargetRef=U.createRef(),o&&(this.setState({highlightTs:o,highlightFading:!1}),this._bindScrollFade()),this.props.onScrollTsDone&&this.props.onScrollTsDone();return}if(i){const r=this.containerRef.current;r&&(r.scrollTop=r.scrollHeight)}}_bindStickyScroll(){this._stickyScrollRafId=null,this._onStickyScroll=()=>{this._stickyScrollLock||this._stickyScrollRafId||(this._stickyScrollRafId=requestAnimationFrame(()=>{this._stickyScrollRafId=null;const n=this.containerRef.current;if(!n)return;const i=n.scrollHeight-n.scrollTop-n.clientHeight;this.state.stickyBottom&&i>50?this.setState({stickyBottom:!1}):!this.state.stickyBottom&&i<=10&&this.setState({stickyBottom:!0})}))},this._rebindStickyEl()}_rebindStickyEl(){const n=this.containerRef.current;n!==this._stickyBoundEl&&(this._stickyBoundEl&&this._stickyBoundEl.removeEventListener("scroll",this._onStickyScroll),this._stickyBoundEl=n,n&&n.addEventListener("scroll",this._onStickyScroll,{passive:!0}))}_unbindStickyScroll(){this._stickyBoundEl&&this._onStickyScroll&&(this._stickyBoundEl.removeEventListener("scroll",this._onStickyScroll),this._stickyBoundEl=null),this._stickyScrollRafId&&(cancelAnimationFrame(this._stickyScrollRafId),this._stickyScrollRafId=null)}_getScrollContainer(){return Gt?this._virtuosoScrollerEl:this.containerRef.current}_bindScrollFade(){this._unbindScrollFade(),this._scrollFadeDelayTimer=setTimeout(()=>{const n=this._getScrollContainer();n&&(this._scrollFadeBoundEl=n,this._onScrollFade=()=>{this.setState({highlightFading:!0}),this._fadeClearTimer=setTimeout(()=>{this.setState({highlightTs:null,highlightFading:!1,highlightVisibleIdx:-1})},2e3),this._unbindScrollFade()},n.addEventListener("scroll",this._onScrollFade,{passive:!0}))},500)}_unbindScrollFade(){this._scrollFadeDelayTimer&&(clearTimeout(this._scrollFadeDelayTimer),this._scrollFadeDelayTimer=null),this._fadeClearTimer&&(clearTimeout(this._fadeClearTimer),this._fadeClearTimer=null),this._onScrollFade&&this._scrollFadeBoundEl&&(this._scrollFadeBoundEl.removeEventListener("scroll",this._onScrollFade),this._scrollFadeBoundEl=null,this._onScrollFade=null)}renderSessionMessages(n,i,r,s){const{userProfile:o,collapseToolResults:a,expandThinking:l,showFullToolContent:c,showThinkingSummaries:d,onViewRequest:u}=this.props;let O=b3(n);if(!O){const k=parseInt(i.slice(1),10);this._incToolSessionIdx===k&&n.length>=this._incToolProcessedCount&&this._incToolProcessedCount>0?Lx(this._incToolState,n,this._incToolProcessedCount):(this._incToolState=kV(),Lx(this._incToolState,n,0),this._incToolSessionIdx=k),this._incToolProcessedCount=n.length,O=this._incToolState,HAe(n,O)}const{toolUseMap:h,toolResultMap:p,readContentMap:m,editSnapshotMap:g,askAnswerMap:v,planApprovalMap:$,latestPlanContent:b}=O,S=this.props.cliMode&&this.state.ptyPromptHistory.slice().reverse().find(k=>Wh(k)&&k.status==="active")||null,y=this.props.cliMode&&this.state.ptyPromptHistory.slice().reverse().find(k=>tS(k)&&k.status==="active")||null;let _=null,Q=null;const P=new Set,w=this.state.localAskAnswers||{},E=Object.keys(w).length>0?{...v,...w}:v;for(const k of n)if(k.role==="assistant"&&Array.isArray(k.content))for(const T of k.content){if(T.type==="tool_use"&&T.name==="ExitPlanMode"){const x=$[T.id];(!x||x.status==="pending")&&(_=T.id)}if(T.type==="tool_use"&&T.name==="AskUserQuestion"){P.add(T.id);const x=E[T.id];(!x||Object.keys(x).length===0)&&(Q=T.id)}}const z=[];for(let k=0;k<n.length;k++){const T=n[k],x=T.content,R=T._timestamp||null,X=R?s[R]:void 0,I=X!=null&&u?{requestIndex:X,onViewRequest:u}:Bje;if(T.role==="user"){if(Array.isArray(x)){const A=x.find(N=>N.type==="text"&&/^\[SUGGESTION MODE:/i.test((N.text||"").trim())),W=x.filter(N=>N.type==="tool_result");if(!(A&&W.length>0)){const{commands:N,textBlocks:L,skillBlocks:Y}=m_(x);for(let j=0;j<N.length;j++)z.push(C.jsx(ms,{role:"user",text:N[j],timestamp:R,userProfile:o,modelInfo:r,...I},`${i}-cmd-${k}-${j}`));for(const j of Y){const V=j.text.match(/^#\s+(.+)$/m),B=V?V[1]:"Skill";z.push(C.jsx(ms,{role:"skill-loaded",text:j.text,skillName:B,timestamp:R,...I},`${i}-skill-${k}`))}for(let j=0;j<L.length;j++){const V=/Implement the following plan:/i.test(L[j].text||"");z.push(C.jsx(ms,{role:V?"plan-prompt":"user",text:L[j].text,timestamp:R,userProfile:o,modelInfo:r,...I},`${i}-user-${k}-${j}`))}}}else if(typeof x=="string"&&!Sv(x)){const A=/Implement the following plan:/i.test(x);z.push(C.jsx(ms,{role:A?"plan-prompt":"user",text:x,timestamp:R,userProfile:o,modelInfo:r,...I},`${i}-user-${k}`))}}else T.role==="assistant"&&(Array.isArray(x)?z.push(C.jsx(ms,{role:"assistant",content:x,toolResultMap:p,readContentMap:m,editSnapshotMap:g,askAnswerMap:E,planApprovalMap:$,latestPlanContent:b,timestamp:R,modelInfo:r,collapseToolResults:a,expandThinking:l,showFullToolContent:c,showThinkingSummaries:d,ptyPrompt:this.state.ptyPrompt,activePlanPrompt:S,activeDangerousPrompt:y,lastPendingPlanId:_,lastPendingAskId:Q,onPlanApprovalClick:this.handlePromptOptionClick,onPlanFeedbackSubmit:this.handlePlanFeedbackSubmit,onDangerousApprovalClick:this.handlePromptOptionClick,onAskQuestionSubmit:this.handleAskQuestionSubmit,cliMode:this.props.cliMode,onOpenFile:this.handleOpenToolFilePath,...I},`${i}-asst-${k}`)):typeof x=="string"&&z.push(C.jsx(ms,{role:"assistant",content:[{type:"text",text:x}],toolResultMap:p,readContentMap:m,editSnapshotMap:g,askAnswerMap:E,planApprovalMap:$,latestPlanContent:b,timestamp:R,modelInfo:r,collapseToolResults:a,expandThinking:l,showFullToolContent:c,showThinkingSummaries:d,ptyPrompt:this.state.ptyPrompt,activePlanPrompt:S,activeDangerousPrompt:y,lastPendingPlanId:_,lastPendingAskId:Q,onPlanApprovalClick:this.handlePromptOptionClick,onPlanFeedbackSubmit:this.handlePlanFeedbackSubmit,onDangerousApprovalClick:this.handlePromptOptionClick,onAskQuestionSubmit:this.handleAskQuestionSubmit,cliMode:this.props.cliMode,onOpenFile:this.handleOpenToolFilePath,...I},`${i}-asst-${k}`)))}return z}_buildTeammateFallbackItems(){var u,O,h,p;const{requests:n,collapseToolResults:i,expandThinking:r,showFullToolContent:s,onViewRequest:o}=this.props;if(!n||n.length===0)return[];L5(n);const a=new Map;for(const m of n){if(!cP(m)||!((O=(u=m.body)==null?void 0:u.messages)!=null&&O.length))continue;const g=m.teammate||"teammate",v=a.get(g);(!v||m.body.messages.length>=v.messages.length)&&a.set(g,{messages:m.body.messages,response:m.response,timestamp:m.timestamp})}if(a.size===0)return[];const l=null,c=[];let d=0;for(const[m,g]of a){c.push(C.jsx(xb,{className:Dt.sessionDivider,children:C.jsx(D1,{className:Dt.sessionDividerText,children:m})},`tm-div-${d}`));const v=this.renderSessionMessages(g.messages,`tm${d}`,l,{});if(c.push(...v),d===a.size-1&&((p=(h=g.response)==null?void 0:h.body)!=null&&p.content)){const $=g.response.body.content;if(Array.isArray($)){const b=$.filter(S=>S.type==="text"&&S.text).map((S,y)=>C.jsx(ms,{role:"assistant",content:[S],collapseToolResults:i,expandThinking:r,showFullToolContent:s,onViewRequest:o,onOpenFile:this.handleOpenToolFilePath},`tm-resp-${d}-${y}`));b.length>0&&(this._lastResponseItems=b)}}d++}return c}buildAllItems(){var g,v,$,b,S;const{mainAgentSessions:n,requests:i,collapseToolResults:r,expandThinking:s,showFullToolContent:o,onViewRequest:a}=this.props;if(this._lastResponseItems=null,this._lastResponseAskQuestions=null,!n||n.length===0)return this._buildTeammateFallbackItems();const l=this._reqScanCache;if(i){const y=i.length>=l.processedCount?l.processedCount:0;y===0&&(l.tsToIndex={},l.modelName=null);for(let Q=y;Q<i.length;Q++){const P=i[Q],w=Ms(P);w&&P.timestamp&&(l.tsToIndex[P.timestamp]=Q),w&&((g=P.body)!=null&&g.model)&&(l.modelName=P.body.model)}l.processedCount=i.length,L5(i);let _=l.subAgentProcessedCount||0;if(_>0&&_<i.length)for(_--;l.subAgentEntries.length>0&&l.subAgentEntries[l.subAgentEntries.length-1].requestIndex>=_;)l.subAgentEntries.pop();for(let Q=_;Q<i.length;Q++){const P=i[Q];if(!P.timestamp)continue;const w=jx(P,i[Q+1]);if(w.type==="SubAgent"||w.type==="Teammate"){const E=($=(v=P.response)==null?void 0:v.body)==null?void 0:$.content;if(Array.isArray(E)&&E.length>0){const z=JAe(((b=P.body)==null?void 0:b.messages)||[]).toolResultMap,k=w.type==="Teammate";l.subAgentEntries.push({timestamp:P.timestamp,content:E,toolResultMap:z,label:k?CV(w.subType,(S=P.body)==null?void 0:S.model):PV(w.type,w.subType),isTeammate:k,requestIndex:Q})}}}l.subAgentProcessedCount=i.length}const c=l.tsToIndex,d=v_(l.modelName),u=l.subAgentEntries,O=[],h={};(this.props.hasMoreHistory||this.props.loadingMore)&&O.push(C.jsx("div",{className:Dt.loadMoreWrap,children:this.props.loadingMore?C.jsxs("div",{className:`${Dt.loadMoreBtn} ${Dt.loadMoreBtnLoading}`,children:[C.jsx(Ca,{size:"small",style:{marginRight:8}}),Oe("ui.loadingMoreHistory")]}):C.jsx("button",{className:Dt.loadMoreBtn,onClick:()=>this.props.onLoadMoreHistory&&this.props.onLoadMoreHistory(),children:Oe("ui.loadEarlierConversations")})},"load-more-history"));let p=0;n.forEach((y,_)=>{var P,w,E,z,k;if(_>0&&O.push(C.jsx(xb,{className:Dt.sessionDivider,children:C.jsx(D1,{className:Dt.sessionDividerText,children:"Session"})},`session-div-${_}`)),y._cold){const T=this.props.loadingSessionId===y.sessionId;O.push(C.jsx("div",{className:Dt.loadMoreWrap,children:T?C.jsxs("div",{className:`${Dt.loadMoreBtn} ${Dt.loadMoreBtnLoading}`,children:[C.jsx(Ca,{size:"small",style:{marginRight:8}}),Oe("ui.loadingMoreHistory")]}):C.jsx("button",{className:Dt.loadMoreBtn,onClick:()=>this.props.onLoadSession&&this.props.onLoadSession(y.sessionId),children:Oe("ui.loadSessionPlaceholder",{count:y.msgCount})})},`cold-session-${_}`));return}const Q=this.renderSessionMessages(y.messages,`s${_}`,d,c);for(const T of Q){const x=T.props.timestamp;for(;p<u.length&&x&&u[p].timestamp<=x;){const R=u[p];R.timestamp&&(h[R.timestamp]=O.length),O.push(C.jsx(ms,{role:"sub-agent-chat",content:R.content,toolResultMap:R.toolResultMap,label:R.label,isTeammate:R.isTeammate,timestamp:R.timestamp,collapseToolResults:r,expandThinking:s,showFullToolContent:o,requestIndex:R.requestIndex,onViewRequest:a,onOpenFile:this.handleOpenToolFilePath},`sub-${R.requestIndex}-${R.timestamp}`)),p++}x&&(h[x]=O.length),O.push(T)}for(;p<u.length;){const T=u[p],x=_<n.length-1&&((w=(P=n[_+1].messages)==null?void 0:P[0])==null?void 0:w._timestamp);if(x&&T.timestamp>x)break;T.timestamp&&(h[T.timestamp]=O.length),O.push(C.jsx(ms,{role:"sub-agent-chat",content:T.content,toolResultMap:T.toolResultMap,label:T.label,isTeammate:T.isTeammate,timestamp:T.timestamp,collapseToolResults:r,expandThinking:s,showFullToolContent:o,requestIndex:T.requestIndex,onViewRequest:a,onOpenFile:this.handleOpenToolFilePath},`sub-${T.requestIndex}-${T.timestamp}`)),p++}if(_===n.length-1&&((z=(E=y.response)==null?void 0:E.body)!=null&&z.content)){const T=y.response.body.content;if(Array.isArray(T)){const x=T.some(I=>I.type==="tool_use"&&(I.name==="AskUserQuestion"||I.name==="ExitPlanMode"));if(!(T.some(I=>I.type==="text"&&typeof I.text=="string"&&I.text.includes("[SUGGESTION MODE:"))&&!x)){const I=new Set;for(const D of y.messages)if(D.role==="assistant"&&Array.isArray(D.content))for(const te of D.content)te.type==="tool_use"&&te.name==="AskUserQuestion"&&I.add(te.id);y.entryTimestamp&&(h[y.entryTimestamp]=O.length);let A=null,W=null;const N=this.state.localAskAnswers||{};for(const D of T){if(D.type==="tool_use"&&D.name==="AskUserQuestion"){const te=N[D.id];(!te||Object.keys(te).length===0)&&(A=D.id)}D.type==="tool_use"&&D.name==="ExitPlanMode"&&(W=D.id)}this._lastResponseAskQuestions=new Set;for(const D of T)if(D.type==="tool_use"&&D.name==="AskUserQuestion"){const te=(k=D.input)==null?void 0:k.questions;if(Array.isArray(te))for(const pe of te)pe.question&&this._lastResponseAskQuestions.add(pe.question)}const L=b3(y.messages)||{},Y=L.planApprovalMap||{},j=L.latestPlanContent||null,V=this.props.cliMode&&this.state.ptyPromptHistory.slice().reverse().find(D=>Wh(D)&&D.status==="active")||null,B=this.props.cliMode&&this.state.ptyPromptHistory.slice().reverse().find(D=>tS(D)&&D.status==="active")||null,F=T.filter(D=>D.type!=="tool_use"||D.name==="AskUserQuestion"&&!I.has(D.id)||D.name==="ExitPlanMode");if(!F.some(D=>D.type==="text"?typeof D.text=="string"&&D.text.trim().length>0:D.type==="tool_use"?!0:D.type==="thinking"?typeof D.thinking=="string"&&D.thinking.trim().length>0:!1))return;this._lastResponseItems=C.jsxs(U.Fragment,{children:[C.jsx(xb,{className:Dt.lastResponseDivider,children:C.jsx(D1,{type:"secondary",className:Dt.lastResponseLabel,children:Oe("ui.lastResponse")})}),C.jsx(ms,{role:"assistant",content:F,timestamp:y.entryTimestamp,modelInfo:d,collapseToolResults:r,expandThinking:s,showFullToolContent:o,toolResultMap:B3,askAnswerMap:Object.keys(N).length>0?N:B3,planApprovalMap:Y,latestPlanContent:j,lastPendingAskId:A,lastPendingPlanId:W,activePlanPrompt:V,activeDangerousPrompt:B,ptyPrompt:this.state.ptyPrompt,onPlanApprovalClick:this.handlePromptOptionClick,onPlanFeedbackSubmit:this.handlePlanFeedbackSubmit,onDangerousApprovalClick:this.handlePromptOptionClick,cliMode:this.props.cliMode,onAskQuestionSubmit:this.handleAskQuestionSubmit,onOpenFile:this.handleOpenToolFilePath},"resp-asst")]},"last-response-group")}}}});const{scrollToTimestamp:m}=this.props;return this._scrollTargetIdx=m&&h[m]!=null?h[m]:null,this._tsItemMap=h,O}_applyMobileSlice(n){if(!Gt)return this._mobileSliceOffset=0,this._totalItemCount=n.length,n;this._totalItemCount=n.length;const i=U1+this._mobileExtraItems;if(n.length<=i)return this._mobileSliceOffset=0,n;const r=n.length-i;if(this._mobileSliceOffset=r,this._scrollTargetIdx!=null&&(this._scrollTargetIdx-=r,this._scrollTargetIdx<0&&(this._scrollTargetIdx=null)),this._tsItemMap){const s={};for(const[o,a]of Object.entries(this._tsItemMap)){const l=a-r;l>=0&&(s[o]=l)}this._tsItemMap=s}return n.slice(r)}_extractSuggestion(){var O;const{mainAgentSessions:n}=this.props;if(!(n!=null&&n.length))return null;const i=n[n.length-1],r=i==null?void 0:i.messages;if(!Array.isArray(r)||r.length===0)return null;const s=r[r.length-1];if((s==null?void 0:s.role)!=="user")return null;const o=s.content;if(!(Array.isArray(o)?o.some(h=>h.type==="text"&&/^\[SUGGESTION MODE:/i.test((h.text||"").trim())):typeof o=="string"&&/^\[SUGGESTION MODE:/im.test(o.trim())))return null;const l=i==null?void 0:i.response;if(!l)return null;const c=l.body;if(!c)return null;const d=c.stop_reason;if(d!=="end_turn"&&d!=="max_tokens")return null;const u=c.content;if(!Array.isArray(u))return null;for(let h=u.length-1;h>=0;h--)if(u[h].type==="text"&&((O=u[h].text)!=null&&O.trim()))return u[h].text.trim();return null}_updateSuggestion(){const n=this._extractSuggestion();this.setState({inputSuggestion:n||null})}_loadPresets(){let n=!1;fetch(Et("/api/claude-settings")).then(i=>i.json()).then(i=>{var r;n=((r=i==null?void 0:i.env)==null?void 0:r.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS)==="1"}).catch(()=>{}).then(()=>{n&&fetch(Et("/api/preferences")).then(i=>i.json()).then(i=>{const r=Array.isArray(i.dismissedBuiltinPresets)?new Set(i.dismissedBuiltinPresets):new Set;let s=[];Array.isArray(i.presetShortcuts)&&(s=i.presetShortcuts.map((a,l)=>typeof a=="string"?{id:Date.now()+l,teamName:"",description:a}:{id:Date.now()+l,teamName:a.teamName||"",description:a.description||"",...a.builtinId?{builtinId:a.builtinId}:{},...a.modified?{modified:!0}:{}}));const o=new Set(s.filter(a=>a.builtinId).map(a=>a.builtinId));for(const a of E9)r.has(a.builtinId)||o.has(a.builtinId)||s.unshift({id:Date.now()+Math.random(),builtinId:a.builtinId,teamName:a.teamName,description:a.description});this.setState({presetItems:s})}).catch(()=>{})})}connectInputWs(){const i=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`;this._inputWs=new WebSocket(i),this._inputWs.onmessage=r=>{try{const s=JSON.parse(r.data);s.type==="data"?this._appendPtyData(s.data):s.type==="exit"?this._clearPtyPrompt():s.type==="ask-hook-pending"?(this._askHookActive=!0,this._askHookQuestions=s.questions):s.type==="ask-hook-timeout"?(this._askHookActive=!1,this._askHookQuestions=null):s.type==="sdk-plan-pending"?this.setState({pendingPlanApproval:{id:s.id,input:s.input}}):s.type==="sdk-ask-pending"?(this._askHookActive=!0,this._askHookQuestions=s.questions,this._sdkAskId=s.id):s.type==="sdk-ask-timeout"?(this._askHookActive=!1,this._askHookQuestions=null,this._sdkAskId=null):s.type==="perm-hook-pending"?this.setState({pendingPermission:{id:s.id,toolName:s.toolName,input:s.input}}):s.type==="perm-hook-timeout"&&this.setState({pendingPermission:null})}catch{}},this._inputWs.onclose=()=>{(this.state.pendingPermission||this.state.pendingPlanApproval)&&this.setState({pendingPermission:null,pendingPlanApproval:null}),this._sdkAskId=null,this._askHookActive=!1,this._askHookQuestions=null,this._wsReconnectTimer=setTimeout(()=>{!this._unmounted&&this.splitContainerRef.current&&this.props.cliMode&&this.connectInputWs()},2e3)}}_stripAnsi(n){return n.replace(/\x1b\[[0-9;]*[A-Za-z]/g,"").replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b[^[\]](.|$)/g,"").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,"")}_appendPtyData(n){const i=this._stripAnsi(n);this._ptyBuffer+=i,this._ptyDataSeq++,this._ptyBuffer.length>4096&&(this._ptyBuffer=this._ptyBuffer.slice(-4096)),this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),this._ptyDebounceTimer=setTimeout(()=>this._detectPrompt(),200)}_detectPrompt(){const n=this._ptyBuffer.trimEnd();let i=null,r=null;const s=n.match(/([^\n]*\?)\s*\n((?:\s*[❯>]?\s*\d+\.\s+[^\n]+\n?){2,})$/);if(s){i=s[1].trim();const o=s[2].match(/\s*([❯>])?\s*(\d+)\.\s+([^\n]+)/g);o&&(r=o.map(a=>{const l=a.match(/\s*([❯>])?\s*(\d+)\.\s+(.+)/);return{number:parseInt(l[2],10),text:l[3].trim(),selected:!!l[1]}}))}if(!r){const o=n.match(/([^\n]+)\n((?:\s+[❯>]?\s+[^\n]+\n?){2,})$/);if(o){const a=o[1].trim(),c=o[2].split(`
|
|
1104
|
+
`).filter(u=>u.trim()),d=[];for(const u of c){const O=u.match(/^\s*([❯>])?\s+(.+)/);O&&O[2].trim()&&d.push({number:d.length+1,text:O[2].trim(),selected:!!O[1]})}d.length>=2&&d.some(u=>u.selected)&&(i=a,r=d)}}if(i&&r){if(/^[■\s]*[~\/.:]/.test(i)&&/\//.test(i)||/^[*■✦⏎]/.test(i))return;const o=this.state.ptyPrompt,a={question:i,options:r};o&&o.question===i?(this._currentPtyPrompt=a,this.setState({ptyPrompt:a})):(this._currentPtyPrompt=a,this.setState(l=>{const c=l.ptyPromptHistory.slice();if(l.ptyPrompt){const d=c[c.length-1];d&&d.status==="active"&&(c[c.length-1]={...d,status:"dismissed"})}return c.push({...a,status:"active",selectedNumber:null,timestamp:new Date().toISOString()}),c.length>200&&c.splice(0,c.length-200),{ptyPrompt:a,ptyPromptHistory:c}}),this.scrollToBottom());return}if(this.state.ptyPrompt){if(Wh(this.state.ptyPrompt)||tS(this.state.ptyPrompt)||this._askSubmitting)return;this._currentPtyPrompt=null,this.setState(o=>{const a=o.ptyPromptHistory.slice(),l=a[a.length-1];return l&&l.status==="active"&&(a[a.length-1]={...l,status:"dismissed"}),{ptyPrompt:null,ptyPromptHistory:a}})}}_clearPtyPrompt(){this._ptyBuffer="",this._currentPtyPrompt=null,this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),this.state.ptyPrompt&&this.setState({ptyPrompt:null})}_planSubmissionSteps(n){return n.map((i,r)=>({...i,isLast:r===n.length-1}))}_waitForHookBridge(){if(!this._unmounted){if(this._askHookActive){const n=this._pendingHookAnswers;this._pendingHookAnswers=null,this._submitViaHookBridge(n);return}if(this._askHookWaitRetries=(this._askHookWaitRetries||0)+1,this._askHookWaitRetries>30){const n=this._pendingHookAnswers;this._pendingHookAnswers=null,this._submitViaPty(n);return}this._hookWaitTimer=setTimeout(()=>this._waitForHookBridge(),100)}}_submitViaPty(n){const i=this._inputWs;if(!i||i.readyState!==WebSocket.OPEN){this._askAnswerQueue=this._planSubmissionSteps(n),this._askSubmitting=!0,this._isMultiQuestionForm=n.length>1,this.connectInputWs(),this._askWsRetries=0,this._waitForWsAndSubmit();return}if(this._askAnswerQueue=this._planSubmissionSteps(n),this._askSubmitting=!0,this._isMultiQuestionForm=n.length>1,!this._currentPtyPrompt){this._askPromptRetries=0,this._waitForPtyPromptAndSubmit();return}this._processNextAskAnswer()}_waitForWsAndSubmit(){if(this._askWsRetries=(this._askWsRetries||0)+1,this._askWsRetries>30){this._askSubmitting=!1,this._askAnswerQueue=[];return}if(this._inputWs&&this._inputWs.readyState===WebSocket.OPEN){this._currentPtyPrompt?this._processNextAskAnswer():(this._askPromptRetries=0,this._waitForPtyPromptAndSubmit());return}this._waitForWsTimer=setTimeout(()=>this._waitForWsAndSubmit(),100)}_waitForPtyPromptAndSubmit(){if(this._askPromptRetries=(this._askPromptRetries||0)+1,this._askPromptRetries>50){this._processNextAskAnswer();return}if(this._currentPtyPrompt){this._processNextAskAnswer();return}this._waitForPtyTimer=setTimeout(()=>this._waitForPtyPromptAndSubmit(),100)}_processNextAskAnswer(){if(!this._askAnswerQueue||this._askAnswerQueue.length===0){this._askSubmitting=!1;return}const n=this._askAnswerQueue.shift();if(n.type==="other"&&n.isMultiSelect){this._submitViaSequentialQueue(n,{settleMs:500});return}n.type==="other"?this._submitOtherAnswer(n):n.type==="multi"?this._submitMultiSelectAnswer(n):this._submitSingleSelectAnswer(n)}_submitSingleSelectAnswer(n){this._submitViaSequentialQueue(n)}_submitMultiSelectAnswer(n){this._submitViaSequentialQueue(n)}_submitOtherAnswer(n){this._submitViaSequentialQueue(n)}_submitViaSequentialQueue(n,i={}){const r=this._inputWs;if(!r||r.readyState!==WebSocket.OPEN){this._askSubmitting=!1;return}const s=!!this._isMultiQuestionForm,o=DAe(n,this.state.ptyPrompt,s),a=i.settleMs||300,l=c=>{try{JSON.parse(c.data).type==="input-sequential-done"&&(r.removeEventListener("message",l),this._finishCurrentAskAnswer())}catch{}};r.addEventListener("message",l),r.send(JSON.stringify({type:"input-sequential",chunks:o,settleMs:a})),setTimeout(()=>{r.removeEventListener("message",l),this._askSubmitting&&this._finishCurrentAskAnswer()},15e3)}_finishCurrentAskAnswer(){this._currentPtyPrompt=null,this.setState(n=>{const i=n.ptyPromptHistory.slice(),r=i[i.length-1];return r&&r.status==="active"&&(i[i.length-1]={...r,status:"answered"}),{ptyPrompt:null,ptyPromptHistory:i}}),(!this._askAnswerQueue||this._askAnswerQueue.length===0)&&this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer),this._askAnswerQueue&&this._askAnswerQueue.length>0?setTimeout(()=>{this._processNextAskAnswer()},500):this._askSubmitting=!1}_submitViaHookBridge(n){var o,a;const i=this._inputWs;if(!i||i.readyState!==WebSocket.OPEN){this._askHookActive=!1,this._askHookQuestions=null,this._submitViaPty(n);return}this._askSubmitting=!0;const r=this._askHookQuestions||[],s={};for(const l of n){const c=r[l.questionIndex];if(!c)continue;const d=c.question;if(l.type==="other")s[d]=l.text||"";else if(l.type==="multi"){const u=(l.selectedIndices||[]).map(O=>{var h,p;return(p=(h=c.options)==null?void 0:h[O])==null?void 0:p.label}).filter(Boolean);s[d]=u.join(", ")}else s[d]=((a=(o=c.options)==null?void 0:o[l.optionIndex])==null?void 0:a.label)||""}i.send(JSON.stringify({type:"ask-hook-answer",answers:s})),this._askSubmitting=!1,this._currentPtyPrompt=null,this.setState(l=>{const c=l.ptyPromptHistory.slice(),d=c[c.length-1];return d&&d.status==="active"&&(c[c.length-1]={...d,status:"answered"}),{ptyPrompt:null,ptyPromptHistory:c}}),this._ptyDebounceTimer&&clearTimeout(this._ptyDebounceTimer)}_snapToInitialPosition(){this.setState({terminalWidth:468,needsInitialSnap:!1}),localStorage.setItem("cc-viewer-terminal-width","468")}_buildUserPromptNav(){const n=this._currentVisible;if(!n||n.length===0)return null;if(this._navCacheVisible===n&&this._navCacheResult)return this._navCacheResult;const i=[],r=new Set;for(let o=0;o<n.length;o++){const a=n[o].props;if(!a||a.role!=="user")continue;const l=a.text||"";if(!l)continue;const c=l.replace(/\[Image(?:\s*#\d+)?(?::?\s*source)?:\s*[^\]]+\]/gi,"").replace(/"\/tmp\/cc-viewer-uploads\/[^"]+"/g,"").trim();if(!c)continue;const d=c.substring(0,100);if(r.has(d))continue;r.add(d);const u=c.length>80?c.substring(0,80)+"...":c;i.push({display:u,visibleIdx:o,timestamp:a.timestamp||null})}if(i.length===0)return this._navCacheVisible=n,this._navCacheResult=null,null;const s=C.jsx("div",{className:Dt.userPromptNavList,children:i.map((o,a)=>C.jsx("div",{className:Dt.userPromptNavItem,onClick:()=>this._scrollToUserPrompt(o.visibleIdx,o.timestamp),children:o.display},o.visibleIdx))});return this._navCacheVisible=n,this._navCacheResult=s,s}_scrollToUserPrompt(n,i){n==null||n<0||(i?this.setState({highlightTs:i,highlightFading:!1,highlightVisibleIdx:n},()=>{this._doScrollToVisibleIdx(n),this._bindScrollFade()}):this._doScrollToVisibleIdx(n))}_doScrollToVisibleIdx(n){if(Gt&&this.virtuosoRef.current)this.virtuosoRef.current.scrollToIndex({index:n,align:"center",behavior:"smooth"});else{const i=this.containerRef.current;i&&i.children[n]&&i.children[n].scrollIntoView({behavior:"smooth",block:"center"})}}render(){var W,N,L,Y;const{mainAgentSessions:n,cliMode:i,terminalVisible:r,onToggleTerminal:s}=this.props,{allItems:o,visibleCount:a,loading:l,terminalWidth:c,lastResponseItems:d}=this.state,O=(!n||n.length===0)&&(!o||o.length===0);if(O&&!i)return this.props.fileLoading?null:C.jsx("div",{className:Dt.centerEmpty,children:C.jsx(Ns,{description:Oe("ui.noChat")})});if(l&&!i)return C.jsx("div",{className:Dt.centerEmpty,children:C.jsx(Ca,{size:"large"})});const h=new Map,p=this.props.userProfile,m=this._reqScanCache?v_(this._reqScanCache.modelName):null;for(const j of o){if(!j||!j.props)continue;const V=j.props.role;if(V==="user"||V==="plan-prompt")h.has("user")||h.set("user",{key:"user",name:(p==null?void 0:p.name)||"User",avatarType:"user",color:"rgba(255,255,255,0.1)",avatarImg:(p==null?void 0:p.avatar)||null});else if(V==="assistant")h.has("assistant")||h.set("assistant",{key:"assistant",name:(m==null?void 0:m.short)||(m==null?void 0:m.name)||"Claude",avatarType:"agent",color:(m==null?void 0:m.color)||"rgba(255,255,255,0.1)",avatarSvg:(m==null?void 0:m.svg)||null});else if(V==="sub-agent-chat"){const B=j.props.label||"SubAgent",F=`sub:${B}`;if(!h.has(F)){const ie=j.props.isTeammate;let D="sub";if(ie)D="teammate";else{const pe=B.match(/SubAgent:\s*(\w+)/i),oe=pe?pe[1].toLowerCase():"";oe==="explore"||oe==="search"?D="sub-search":oe==="plan"&&(D="sub-plan")}const te=ie?Bu(B):null;h.set(F,{key:F,name:B.length>12?B.slice(0,12)+"…":B,avatarType:D,avatarSvg:te?te.svg:void 0,color:te?te.color:"rgba(255,255,255,0.1)"})}}}const g=Array.from(h.values());let v=o;const $=this.state.roleFilterSelected.size;$>0&&$<g.length&&(v=o.filter(j=>{if(!j||!j.props)return!0;const V=j.props.role;if(V==="user"||V==="plan-prompt")return this.state.roleFilterSelected.has("user");if(V==="assistant")return this.state.roleFilterSelected.has("assistant");if(V==="sub-agent-chat"){const B=`sub:${j.props.label||"SubAgent"}`;return this.state.roleFilterSelected.has(B)}return!1}));const b=$>0&&$<g.length,S=d&&b&&!this.state.roleFilterSelected.has("assistant")?null:d,y=this._scrollTargetIdx,{highlightTs:_,highlightFading:Q,highlightVisibleIdx:P}=this.state,w=v.slice(0,b?v.length:a);this._currentVisible=w;const E=P>=0&&P<w.length?P:_!=null?w.findIndex(j=>{var V;return((V=j.props)==null?void 0:V.timestamp)===_}):-1,{pendingInput:z,stickyBottom:k,ptyPromptHistory:T}=this.state,x=i&&z?C.jsx(ms,{role:"user",text:z,timestamp:new Date().toISOString(),userProfile:this.props.userProfile},"pending-input"):null,R=k?null:C.jsxs("button",{className:Dt.stickyBottomBtn,onClick:this.handleStickToBottom,children:[C.jsx("span",{children:Oe("ui.stickyBottom")}),C.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),X=Gt&&this._mobileSliceOffset>0?C.jsx("div",{className:Dt.loadMoreWrap,children:C.jsx("button",{className:Dt.loadMoreBtn,onClick:this.handleLoadMore,children:Oe("ui.loadMoreHistory",{count:this._mobileSliceOffset})})}):null,I=this.state.roleFilterOpen&&g.length>0?C.jsx(p9e,{roles:g,selectedRoles:this.state.roleFilterSelected,onToggle:j=>this.setState(V=>{const B=new Set(V.roleFilterSelected);return B.has(j)?B.delete(j):B.add(j),{roleFilterSelected:B}})}):null,A=O||l?C.jsxs("div",{className:Dt.messageListWrap,children:[C.jsxs("div",{ref:this.containerRef,className:Dt.container,children:[!i||l?C.jsx("div",{className:Dt.centerEmpty,children:l?C.jsx(Ca,{size:"large"}):C.jsx(Ns,{description:Oe("ui.noChat")})}):null,x]}),R]}):C.jsxs("div",{className:Dt.messageListWrap,onClick:this.handleMdImageClick,children:[I,this.state.mdLightboxSrc&&C.jsx(sM,{src:this.state.mdLightboxSrc,alt:"",onClose:()=>this.setState({mdLightboxSrc:null})}),Gt?(this._virtuosoHeader=X,this._virtuosoFooter=C.jsxs(C.Fragment,{children:[(this.props.isStreaming||this.state.streamingFading)&&C.jsx("div",{className:Dt.streamingSpinnerWrap,style:this.state.streamingFading?{opacity:0}:void 0,children:C.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",children:[C.jsx("defs",{children:C.jsxs("linearGradient",{id:"ccv-spinnerGrad",x1:"0",y1:"0",x2:"1",y2:"1",children:[C.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"1"}),C.jsx("stop",{offset:"100%",stopColor:"white",stopOpacity:"0.1"})]})}),C.jsx("circle",{cx:"10",cy:"10",r:"7.5",fill:"none",strokeWidth:"2",stroke:"url(#ccv-spinnerGrad)",strokeLinecap:"round",pathLength:"100",strokeDasharray:"75 25",children:C.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 10 10",to:"360 10 10",dur:"0.8s",repeatCount:"indefinite"})})]})}),S,x]}),C.jsx(KWe,{ref:this.virtuosoRef,className:Dt.mobileVirtuoso,data:w,initialTopMostItemIndex:Math.max(0,w.length-1),followOutput:this.state.stickyBottom?"smooth":!1,atBottomStateChange:j=>{this._stickyScrollLock||j!==this.state.stickyBottom&&this.setState({stickyBottom:j})},atBottomThreshold:60,increaseViewportBy:{top:400,bottom:200},computeItemKey:j=>{var V;return((V=w[j])==null?void 0:V.key)||`v-${j}`},itemContent:j=>{const V=w[j],B=j===y,F=j===E;let ie=V;return F&&(ie=U.cloneElement(ie,{highlight:Q?"fading":"active"})),B?C.jsx("div",{ref:this._scrollTargetRef,children:ie}):ie},scrollerRef:j=>{this._virtuosoScrollerEl=j},context:{header:this._virtuosoHeader,footer:this._virtuosoFooter},components:this._virtuosoComponents||(this._virtuosoComponents={Scroller:Yje,Header:({context:j})=>j.header,Footer:({context:j})=>j.footer})})):C.jsxs("div",{ref:this.containerRef,className:Dt.container,children:[X,w.map((j,V)=>{const B=V===y,F=V===E;let ie=j;return F&&(ie=U.cloneElement(ie,{highlight:Q?"fading":"active"})),B?C.jsx("div",{ref:this._scrollTargetRef,children:ie},j.key+"-anchor"):ie}),(this.props.isStreaming||this.state.streamingFading)&&C.jsx("div",{className:Dt.streamingSpinnerWrap,style:this.state.streamingFading?{opacity:0}:void 0,children:C.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",children:[C.jsx("defs",{children:C.jsxs("linearGradient",{id:"ccv-spinnerGrad-desktop",x1:"0",y1:"0",x2:"1",y2:"1",children:[C.jsx("stop",{offset:"0%",stopColor:"white",stopOpacity:"1"}),C.jsx("stop",{offset:"100%",stopColor:"white",stopOpacity:"0.1"})]})}),C.jsx("circle",{cx:"10",cy:"10",r:"7.5",fill:"none",strokeWidth:"2",stroke:"url(#ccv-spinnerGrad-desktop)",strokeLinecap:"round",pathLength:"100",strokeDasharray:"75 25",children:C.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 10 10",to:"360 10 10",dur:"0.8s",repeatCount:"indefinite"})})]})}),S&&(y!=null&&y>=w.length?C.jsx("div",{ref:this._scrollTargetRef,children:S},"last-resp-anchor"):S),x]}),R]});return i?C.jsxs(C.Fragment,{children:[C.jsxs("div",{ref:this.splitContainerRef,className:Dt.splitContainer,children:[C.jsxs("div",{className:Dt.navSidebar,children:[C.jsx("button",{className:this.state.roleFilterOpen?Dt.navBtnActive:Dt.navBtn,onClick:()=>this.setState(j=>j.roleFilterOpen?{roleFilterOpen:!1,roleFilterSelected:new Set}:{roleFilterOpen:!0}),title:Oe("ui.roleFilter"),children:C.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})})}),C.jsx("button",{className:this.state.fileExplorerOpen?Dt.navBtnActive:Dt.navBtn,onClick:()=>{this._setFileExplorerOpen(!this.state.fileExplorerOpen),this.setState({gitChangesOpen:!1})},title:Oe("ui.fileExplorer"),children:C.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 2h9a2 2 0 0 1 2 2z"})})}),C.jsx("button",{className:this.state.gitChangesOpen?Dt.navBtnActive:Dt.navBtn,onClick:()=>this.setState(j=>(this._setFileExplorerOpen(!1),{gitChangesOpen:!j.gitChangesOpen})),title:Oe("ui.gitChanges"),children:C.jsx("svg",{width:"24",height:"24",viewBox:"0 0 1024 1024",fill:"currentColor",children:C.jsx("path",{d:"M759.53332137 326.35000897c0-48.26899766-39.4506231-87.33284994-87.87432908-86.6366625-46.95397689 0.69618746-85.08957923 39.14120645-85.39899588 86.09518335-0.23206249 40.68828971 27.53808201 74.87882971 65.13220519 84.47074592 10.82958281 2.78474987 18.41029078 12.37666607 18.64235327 23.51566553 0.38677082 21.11768647-3.40358317 44.40128953-17.24997834 63.81718442-22.20064476 31.17372767-62.42480948 42.46743545-97.93037026 52.44612248-22.43270724 6.26568719-38.75443563 7.89012462-53.14230994 9.28249954-20.42149901 2.01120825-39.76003975 3.94506233-63.89453858 17.79145747-5.10537475 2.93945818-10.13339535 6.18833303-14.85199928 9.74662453-4.09977063 3.09416652-9.90133285 0.15470833-9.90133286-4.95066641V302.60228095c0-9.43720788 5.26008307-18.17822829 13.69168683-22.3553531 28.69839444-14.23316598 48.42370599-43.93716454 48.19164353-78.20505872-0.38677082-48.57841433-41.15241468-87.71962076-89.730829-86.01782918C338.80402918 117.57112321 301.59667683 155.70672553 301.59667683 202.58334827c0 34.03583169 19.64795738 63.50776777 48.1916435 77.66357958 8.43160375 4.17712479 13.69168685 12.76343689 13.69168684 22.12329062v419.02750058c0 9.43720788-5.26008307 18.17822829-13.69168684 22.3553531-28.69839444 14.23316598-48.42370599 43.93716454-48.1916435 78.20505872 0.30941665 48.57841433 41.07506052 87.6422666 89.65347484 86.01782918C437.74000359 906.42887679 474.87000179 868.2159203 474.87000179 821.41665173c0-34.03583169-19.64795738-63.50776777-48.1916435-77.66357958-8.43160375-4.17712479-13.69168685-12.76343689-13.69168684-22.12329062v-14.85199926c0-32.48874844 15.39347842-63.27570528 42.00331048-81.91805854 2.39797906-1.70179159 4.95066642-3.32622901 7.50335379-4.79595812 14.92935344-8.58631209 25.91364457-9.66927037 44.09187287-11.4484161 15.62554091-1.54708326 35.04143581-3.48093734 61.65126786-10.90693699 39.06385228-10.98429114 92.51557887-25.91364457 124.84961898-71.39789238 18.56499911-26.06835292 27.38337367-58.01562219 26.37776956-95.14562041-0.15470833-5.33743724-0.54147915-10.67487447-1.08295828-16.16702004-0.85089578-8.27689543 2.70739569-16.24437421 9.12779121-21.50445729 19.57060322-15.78024923 32.02462345-39.99210223 32.02462345-67.14341343zM351.1033411 202.58334827c0-20.49885317 16.63114503-37.12999821 37.1299982-37.1299982s37.12999821 16.63114503 37.12999821 37.1299982-16.63114503 37.12999821-37.12999821 37.1299982-37.12999821-16.63114503-37.1299982-37.1299982z m74.25999641 618.83330346c0 20.49885317-16.63114503 37.12999821-37.12999821 37.1299982s-37.12999821-16.63114503-37.1299982-37.1299982 16.63114503-37.12999821 37.1299982-37.1299982 37.12999821 16.63114503 37.12999821 37.1299982z m247.53332139-457.93664456c-20.49885317 0-37.12999821-16.63114503-37.1299982-37.1299982s16.63114503-37.12999821 37.1299982-37.12999821 37.12999821 16.63114503 37.1299982 37.12999821-16.63114503 37.12999821-37.1299982 37.1299982z"})})}),C.jsx(S3,{requests:this.props.requests,onOpenSession:j=>this.setState({teamModalSession:j}),navBtnClass:Dt.navBtn}),C.jsx(Sl,{content:this._buildUserPromptNav(),trigger:"hover",placement:"rightTop",overlayStyle:{maxWidth:400},children:C.jsx("button",{className:Dt.navBtn,title:Oe("ui.userPromptNav"),children:C.jsx("img",{src:((W=this.props.userProfile)==null?void 0:W.avatar)||xv,className:Dt.navAvatarImg,alt:"User",onError:j=>{j.target.onerror=null,j.target.src=xv}})})})]}),C.jsxs("div",{className:Dt.innerSplitArea,ref:this.innerSplitRef,children:[C.jsx(a9e,{isDragging:this.state.isDragging,activeSnapLine:this.state.activeSnapLine,snapLines:this.state.snapLines,terminalWidth:this.state.terminalWidth,containerRef:this.innerSplitRef}),this.state.fileExplorerOpen&&C.jsx(l_e,{refreshTrigger:this.state.fileExplorerRefresh,onClose:()=>this._setFileExplorerOpen(!1),onFileClick:j=>this.setState({currentFile:j,currentGitDiff:null,scrollToLine:null}),expandedPaths:this.state.fileExplorerExpandedPaths,onToggleExpand:this.handleToggleExpandPath,currentFile:this.state.currentFile,onFileRenamed:(j,V)=>{this.setState(B=>({currentFile:B.currentFile===j?V:B.currentFile,fileExplorerRefresh:B.fileExplorerRefresh+1}))}}),this.state.gitChangesOpen&&C.jsx(MIe,{refreshTrigger:this.state.gitChangesRefresh,onClose:()=>this.setState({gitChangesOpen:!1}),onFileClick:j=>this.setState({currentGitDiff:j,currentFile:null}),onOpenFile:j=>{const V=j.split("/"),B=[];for(let F=1;F<V.length;F++)B.push(V.slice(0,F).join("/"));this._setFileExplorerOpen(!0),this.setState(F=>{const ie=new Set(F.fileExplorerExpandedPaths);return B.forEach(D=>ie.add(D)),{currentGitDiff:null,currentFile:j,scrollToLine:null,gitChangesOpen:!1,fileExplorerExpandedPaths:ie}})}}),C.jsx("div",{className:Dt.chatSection,children:C.jsxs("div",{className:Dt.chatSectionFlex,children:[this.state.currentGitDiff&&C.jsx("div",{className:Dt.overlayPanel,children:C.jsx(QAe,{filePath:this.state.currentGitDiff,onClose:()=>this.setState({currentGitDiff:null}),onOpenFile:(j,V)=>{const B=j.split("/"),F=[];for(let ie=1;ie<B.length;ie++)F.push(B.slice(0,ie).join("/"));this._setFileExplorerOpen(!0),this.setState(ie=>{const D=new Set(ie.fileExplorerExpandedPaths);return F.forEach(te=>D.add(te)),{currentGitDiff:null,currentFile:j,scrollToLine:V||1,gitChangesOpen:!1,fileExplorerExpandedPaths:D}})}})}),this.state.currentFile&&C.jsx("div",{className:Dt.overlayPanel,children:ZAe(this.state.currentFile)?C.jsx(OIe,{filePath:this.state.currentFile,editorSession:!!this.state.editorSessionId,onClose:()=>{this.state.editorSessionId&&fetch("/api/editor-done",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.state.editorSessionId})}).catch(()=>{}),this.setState({currentFile:null,fileVersion:0,editorSessionId:null,editorFilePath:null})}},this.state.fileVersion):C.jsx(q8e,{filePath:this.state.currentFile,scrollToLine:this.state.scrollToLine,editorSession:!!this.state.editorSessionId,onClose:()=>{this.state.editorSessionId&&fetch("/api/editor-done",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.state.editorSessionId})}).catch(()=>{}),this.setState({currentFile:null,fileVersion:0,editorSessionId:null,editorFilePath:null})}},this.state.fileVersion)}),A,!this.props.onPendingPermission&&C.jsx($3,{toolName:(N=this.state.pendingPermission)==null?void 0:N.toolName,toolInput:(L=this.state.pendingPermission)==null?void 0:L.input,requestId:(Y=this.state.pendingPermission)==null?void 0:Y.id,onAllow:this.handlePermissionAllow,onAllowSession:this.props.sdkMode?this.handlePermissionAllowSession:null,onDeny:this.handlePermissionDeny,visible:!!this.state.pendingPermission}),!this.props.onPendingPlanApproval&&this.state.pendingPlanApproval&&C.jsx($3,{toolName:"ExitPlanMode",toolInput:this.state.pendingPlanApproval.input,requestId:this.state.pendingPlanApproval.id,onAllow:this.handlePlanApprove,onDeny:j=>this.handlePlanReject(j,""),visible:!0}),C.jsx(V9e,{inputRef:this._inputRef,inputEmpty:this.state.inputEmpty,inputSuggestion:this.state.inputSuggestion,terminalVisible:r,onKeyDown:this.handleInputKeyDown,onChange:this.handleInputChange,onSend:this.handleInputSend,onSuggestionClick:this.handleSuggestionToTerminal,onUploadPath:this.handleUploadPath,presetItems:this.state.presetItems,onPresetSend:this.handlePresetSend,isStreaming:this.props.isStreaming,streamingFading:this.state.streamingFading})]})}),i&&!this.props.sdkMode&&s&&C.jsx("div",{className:Dt.terminalToggle,onClick:s,title:Oe(r?"ui.collapseTerminal":"ui.expandTerminal"),children:C.jsx("svg",{viewBox:"0 0 8 24",width:"8",height:"24",children:r?C.jsx("path",{d:"M4 8 L7 12 L4 16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}):C.jsx("path",{d:"M4 8 L1 12 L4 16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:Dt.vResizer,onMouseDown:this.handleSplitMouseDown}),C.jsx("div",{className:Dt.terminalPanelWrap,style:{width:c},children:C.jsx(Yye,{onEditorOpen:(j,V)=>{this.setState({editorSessionId:j,editorFilePath:V,currentFile:V,currentGitDiff:null,scrollToLine:null,fileVersion:(this.state.fileVersion||0)+1})},onFilePath:j=>{const V=`"${j}"`;this._inputWs&&this._inputWs.readyState===WebSocket.OPEN&&this._inputWs.send(JSON.stringify({type:"input",data:V}))}})})]})]})]}),C.jsx(y3,{session:this.state.teamModalSession,requests:this.props.requests,mainAgentSessions:this.props.mainAgentSessions,collapseToolResults:this.props.collapseToolResults,expandThinking:this.props.expandThinking,showFullToolContent:this.props.showFullToolContent,userProfile:this.props.userProfile,onViewRequest:this.props.onViewRequest,onClose:()=>this.setState({teamModalSession:null})})]}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:Dt.splitContainer,children:[C.jsxs("div",{className:Dt.navSidebar,children:[C.jsx("button",{className:this.state.roleFilterOpen?Dt.navBtnActive:Dt.navBtn,onClick:()=>this.setState(j=>j.roleFilterOpen?{roleFilterOpen:!1,roleFilterSelected:new Set}:{roleFilterOpen:!0}),title:Oe("ui.roleFilter"),children:C.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:C.jsx("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})})}),C.jsx(S3,{requests:this.props.requests,onOpenSession:j=>this.setState({teamModalSession:j}),navBtnClass:Dt.navBtn})]}),C.jsx("div",{className:Dt.navSidebarContent,children:A})]}),C.jsx(y3,{session:this.state.teamModalSession,requests:this.props.requests,mainAgentSessions:this.props.mainAgentSessions,collapseToolResults:this.props.collapseToolResults,expandThinking:this.props.expandThinking,showFullToolContent:this.props.showFullToolContent,userProfile:this.props.userProfile,onViewRequest:this.props.onViewRequest,onClose:()=>this.setState({teamModalSession:null})})]})}}const Dje="_helpBtn_fm45n_1",Uje="_modalBody_fm45n_25",Zje="_spinWrap_fm45n_124",Z1={helpBtn:Dje,modalBody:Uje,spinWrap:Zje},Gje=new Set(["Tool-Bash","Tool-Read","Tool-Edit","Tool-Write","Tool-Glob","Tool-Grep","Tool-NotebookEdit","Tool-WebFetch","Tool-WebSearch","Tool-Task","Tool-Agent","Tool-TaskOutput","Tool-TaskStop","Tool-TaskCreate","Tool-TaskGet","Tool-TaskUpdate","Tool-TaskList","Tool-TeamCreate","Tool-TeamDelete","Tool-SendMessage","SubAgent-Search","Tool-EnterPlanMode","Tool-ExitPlanMode","Tool-AskUserQuestion","Tool-Skill","Tool-getDiagnostics","Tool-executeCode","Tool-EnterWorktree","MainAgent","Teammate","BodyFields","ResponseFields","Tools","ToolsFirst","CacheRebuild","BodyDiffJSON","TranslateContextPollution","KVCacheContent","ProxySwitch"]);function KYe({doc:t,zIndex:e}){const[n,i]=f.useState(!1),[r,s]=f.useState(!1),[o,a]=f.useState(""),[l,c]=f.useState("");if(!t||!Gje.has(t))return null;const d=f.useCallback(async()=>{i(!0),s(!0),a(""),c(t);const O=h_();let h=null;try{const p=await fetch(`/api/concept?lang=${O}&doc=${encodeURIComponent(t)}`);p.ok&&(h=await p.text())}catch{}if(h){const p=h.match(/^#\s+(.+)/m);p&&c(p[1]),a(bo(h))}else a("<p>Document not found.</p>");s(!1)},[t]),u=Gt?{header:{padding:"8px 12px",margin:0},body:{maxHeight:"80vh",overflow:"auto",padding:"8px 10px"},content:{padding:0}}:{body:{padding:"16px 24px 24px",background:"#111",borderRadius:"4px"},content:{padding:"12px 20px"}};return C.jsxs(C.Fragment,{children:[C.jsx("span",{className:Z1.helpBtn,onClick:O=>{O.stopPropagation(),d()},children:"?"}),C.jsx(zo,{theme:{algorithm:O_.darkAlgorithm,token:{colorPrimary:"#1668dc",colorBgContainer:"#111",colorBgLayout:"#0a0a0a",colorBgElevated:"#1e1e1e",colorBorder:"#2a2a2a"}},children:C.jsx(ji,{title:l,open:n,onCancel:()=>i(!1),footer:null,width:Gt?"98vw":800,centered:Gt,styles:u,...e?{zIndex:e}:{},wrapProps:{onMouseDown:O=>O.stopPropagation()},children:r?C.jsx("div",{className:Z1.spinWrap,children:C.jsx(Ca,{})}):C.jsx("div",{className:Z1.modalBody,dangerouslySetInnerHTML:{__html:o}})})})]})}const Fje="_headerBar_h06mo_2",Hje="_logoWrap_h06mo_10",Kje="_logoWrapActive_h06mo_17",Jje="_logoImage_h06mo_26",eNe="_logoImageActive_h06mo_36",tNe="_compactBtn_h06mo_41",nNe="_compactBtnNoBorder_h06mo_47",iNe="_tokenStatsTag_h06mo_55",rNe="_tokenStatsIcon_h06mo_63",sNe="_liveTag_h06mo_68",oNe="_liveTagFill_h06mo_83",aNe="_liveTagContent_h06mo_93",lNe="_liveTagHistory_h06mo_100",cNe="_liveTagText_h06mo_106",dNe="_countdownStrong_h06mo_111",uNe="_qrcodePopover_h06mo_116",ONe="_qrcodeTitle_h06mo_134",hNe="_qrcodeUrlInput_h06mo_141",fNe="_qrcodeUrlCopy_h06mo_147",pNe="_settingsGroupBox_h06mo_158",mNe="_settingsGroupTitle_h06mo_166",gNe="_settingsItem_h06mo_175",vNe="_settingsLabel_h06mo_182",$Ne="_tokenStatsEmpty_h06mo_187",bNe="_tokenStatsContainer_h06mo_194",SNe="_tokenStatsColumn_h06mo_200",yNe="_toolStatsColumn_h06mo_204",_Ne="_modelCard_h06mo_209",QNe="_modelCardSpaced_h06mo_216 _modelCard_h06mo_209",xNe="_modelName_h06mo_222",wNe="_statsTable_h06mo_232",PNe="_th_h06mo_237",CNe="_td_h06mo_247",TNe="_label_h06mo_256",kNe="_rowBorder_h06mo_266",RNe="_rebuildTotalRow_h06mo_278",ENe="_promptExportBar_h06mo_287",XNe="_promptScrollArea_h06mo_291",zNe="_promptEmpty_h06mo_296",INe="_promptTimestamp_h06mo_302",ANe="_textPromptCard_h06mo_310",MNe="_preText_h06mo_319",WNe="_systemCollapse_h06mo_329",jNe="_systemLabel_h06mo_336",NNe="_preSys_h06mo_341",LNe="_promptTextarea_h06mo_351",VNe="_projectStatsCenter_h06mo_367",BNe="_projectStatsEmpty_h06mo_373",YNe="_projectStatsContent_h06mo_380",qNe="_projectStatsUpdated_h06mo_386",DNe="_projectStatsSummary_h06mo_392",UNe="_projectStatCard_h06mo_398",ZNe="_projectStatValue_h06mo_406",GNe="_projectStatLabel_h06mo_414",FNe="_projectStatsSection_h06mo_420",HNe="_projectStatsSectionTitle_h06mo_426",KNe="_projectStatsModelCard_h06mo_434",JNe="_projectStatsModelHeader_h06mo_441",eLe="_projectStatsModelName_h06mo_450",tLe="_projectStatsModelCount_h06mo_456",nLe="_pluginDirHint_h06mo_463",iLe="_pluginDirPath_h06mo_469",rLe="_pluginList_h06mo_482",sLe="_pluginItem_h06mo_488",oLe="_pluginInfo_h06mo_498",aLe="_pluginName_h06mo_506",lLe="_pluginFile_h06mo_512",cLe="_pluginHooks_h06mo_518",dLe="_pluginHookTag_h06mo_525",uLe="_pluginActions_h06mo_534",OLe="_pluginEmpty_h06mo_542",hLe="_cachePopover_h06mo_549",fLe="_cacheScrollArea_h06mo_553",pLe="_cachePopoverTitle_h06mo_558",mLe="_cachePopoverHeader_h06mo_567",gLe="_cacheCopyBtn_h06mo_573",vLe="_cachePopoverEmpty_h06mo_585",$Le="_cacheTokenInfo_h06mo_591",bLe="_cacheSection_h06mo_600",SLe="_cacheSectionTitle_h06mo_604",yLe="_cacheSectionArrow_h06mo_625",_Le="_cacheCodeBlock_h06mo_633",QLe="_cacheCodeBlockSystem_h06mo_647",xLe="_cacheNavBtn_h06mo_661",wLe="_cacheNavList_h06mo_676",PLe="_cacheNavItem_h06mo_682",CLe="_cacheBlockHighlight_h06mo_698",TLe="_cacheBlockHighlightFading_h06mo_703",kLe="_cacheBorderSvg_h06mo_708",RLe="_cacheBorderSvgFading_h06mo_717",ELe="_cacheBorderRect_h06mo_722",XLe="_thLeft_h06mo_732",zLe="_cacheCalibrationLabel_h06mo_737",ILe="_calibrationSelect_h06mo_745",ALe="_cachePopoverPlaceholder_h06mo_751",MLe="_cacheWriteToken_h06mo_756",WLe="_cacheReadToken_h06mo_760",jLe="_cacheCtxPercent_h06mo_764",NLe="_pluginModalFooter_h06mo_770",LLe="_pluginModalFooterLeft_h06mo_775",VLe="_pluginDirLabel_h06mo_781",BLe="_pluginEmptyTitle_h06mo_786",YLe="_pluginEmptyHint_h06mo_791",qLe="_cdnUrlLabel_h06mo_797",DLe="_cdnInput_h06mo_803",ULe="_titleIcon_h06mo_810",ZLe="_countryFlagIcon_h06mo_815",GLe="_svgIcon_h06mo_821",FLe="_iconMirror_h06mo_826",HLe="_langGrid_h06mo_831",KLe="_langBtn_h06mo_841",JLe="_countryInfoPopover_h06mo_847",eVe="_countryInfoMeta_h06mo_853",tVe="_disabledMenuItem_h06mo_858",nVe="_currentProcessBtn_h06mo_863",iVe="_proxySwapIcon_h06mo_868",rVe="_fullWidthSelect_h06mo_873",sVe="_proxyProfileTag_h06mo_878",oVe="_proxyWarning_h06mo_892",aVe="_proxyList_h06mo_902",lVe="_proxyItem_h06mo_908",cVe="_proxyItemActive_h06mo_920",dVe="_proxyItemMain_h06mo_925",uVe="_proxyItemInfo_h06mo_933",OVe="_proxyItemNameRow_h06mo_939",hVe="_proxyItemName_h06mo_939",fVe="_proxyItemDetail_h06mo_951",pVe="_proxyBuiltinTag_h06mo_960",mVe="_proxyItemActions_h06mo_970",gVe="_proxyEditForm_h06mo_976",vVe="_proxyEditRow_h06mo_984",$Ve="_proxyRequired_h06mo_994",bVe="_proxyEditDivider_h06mo_999",SVe="_proxyEditBtns_h06mo_1004",JYe={headerBar:Fje,logoWrap:Hje,logoWrapActive:Kje,logoImage:Jje,logoImageActive:eNe,compactBtn:tNe,compactBtnNoBorder:nNe,tokenStatsTag:iNe,tokenStatsIcon:rNe,liveTag:sNe,liveTagFill:oNe,liveTagContent:aNe,liveTagHistory:lNe,liveTagText:cNe,countdownStrong:dNe,qrcodePopover:uNe,qrcodeTitle:ONe,qrcodeUrlInput:hNe,qrcodeUrlCopy:fNe,settingsGroupBox:pNe,settingsGroupTitle:mNe,settingsItem:gNe,settingsLabel:vNe,tokenStatsEmpty:$Ne,tokenStatsContainer:bNe,tokenStatsColumn:SNe,toolStatsColumn:yNe,modelCard:_Ne,modelCardSpaced:QNe,modelName:xNe,statsTable:wNe,th:PNe,td:CNe,label:TNe,rowBorder:kNe,rebuildTotalRow:RNe,promptExportBar:ENe,promptScrollArea:XNe,promptEmpty:zNe,promptTimestamp:INe,textPromptCard:ANe,preText:MNe,systemCollapse:WNe,systemLabel:jNe,preSys:NNe,promptTextarea:LNe,projectStatsCenter:VNe,projectStatsEmpty:BNe,projectStatsContent:YNe,projectStatsUpdated:qNe,projectStatsSummary:DNe,projectStatCard:UNe,projectStatValue:ZNe,projectStatLabel:GNe,projectStatsSection:FNe,projectStatsSectionTitle:HNe,projectStatsModelCard:KNe,projectStatsModelHeader:JNe,projectStatsModelName:eLe,projectStatsModelCount:tLe,pluginDirHint:nLe,pluginDirPath:iLe,pluginList:rLe,pluginItem:sLe,pluginInfo:oLe,pluginName:aLe,pluginFile:lLe,pluginHooks:cLe,pluginHookTag:dLe,pluginActions:uLe,pluginEmpty:OLe,cachePopover:hLe,cacheScrollArea:fLe,cachePopoverTitle:pLe,cachePopoverHeader:mLe,cacheCopyBtn:gLe,cachePopoverEmpty:vLe,cacheTokenInfo:$Le,cacheSection:bLe,cacheSectionTitle:SLe,cacheSectionArrow:yLe,cacheCodeBlock:_Le,cacheCodeBlockSystem:QLe,cacheNavBtn:xLe,cacheNavList:wLe,cacheNavItem:PLe,cacheBlockHighlight:CLe,cacheBlockHighlightFading:TLe,cacheBorderSvg:kLe,cacheBorderSvgFading:RLe,cacheBorderRect:ELe,thLeft:XLe,cacheCalibrationLabel:zLe,calibrationSelect:ILe,cachePopoverPlaceholder:ALe,cacheWriteToken:MLe,cacheReadToken:WLe,cacheCtxPercent:jLe,pluginModalFooter:NLe,pluginModalFooterLeft:LLe,pluginDirLabel:VLe,pluginEmptyTitle:BLe,pluginEmptyHint:YLe,cdnUrlLabel:qLe,cdnInput:DLe,titleIcon:ULe,countryFlagIcon:ZLe,svgIcon:GLe,iconMirror:FLe,langGrid:HLe,langBtn:KLe,countryInfoPopover:JLe,countryInfoMeta:eVe,disabledMenuItem:tVe,currentProcessBtn:nVe,proxySwapIcon:iVe,fullWidthSelect:rVe,proxyProfileTag:sVe,proxyWarning:oVe,proxyList:aVe,proxyItem:lVe,proxyItemActive:cVe,proxyItemMain:dVe,proxyItemInfo:uVe,proxyItemNameRow:OVe,proxyItemName:hVe,proxyItemDetail:fVe,proxyBuiltinTag:pVe,proxyItemActions:mVe,proxyEditForm:gVe,proxyEditRow:vVe,proxyRequired:$Ve,proxyEditDivider:bVe,proxyEditBtns:SVe};export{ss as $,WVe as A,Si as B,Xt as C,HYe as D,Bce as E,lAe as F,PVe as G,Coe as H,cn as I,Wde as J,kn as K,$3 as L,Mt as M,Pl as N,Mue as O,ts as P,bi as Q,Yde as R,Ca as S,Yye as T,ue as U,G as V,q as W,at as X,fn as Y,Sw as Z,Pe as _,F6 as a,S8 as a0,sv as a1,yd as a2,Fo as a3,Y0 as a4,TH as a5,Cs as a6,ip as a7,ju as a8,R0 as a9,Cl as aA,Dce as aB,XI as aC,aO as aD,Ns as aE,H7 as aF,AVe as aG,PV as aH,Ho as aI,Tl as aJ,zI as aK,Mu as aL,bo as aM,gf as aN,B5 as aO,Y5 as aP,Due as aQ,zVe as aR,IVe as aS,Db as aT,MVe as aU,bQ as aV,dc as aW,oy as aX,HY as aY,GY as aZ,lc as aa,es as ab,wVe as ac,fi as ad,xVe as ae,Me as af,Mte as ag,Nw as ah,Jue as ai,gde as aj,ei as ak,dO as al,Sl as am,L5 as an,AO as ao,ji as ap,IA as aq,h_ as ar,s$ as as,fO as at,bv as au,TVe as av,Jo as aw,x7 as ax,hp as ay,b7 as az,Br as b,ne as c,ra as d,Et as e,kVe as f,Rn as g,EVe as h,LI as i,XVe as j,RVe as k,jx as l,dn as m,KYe as n,Kue as o,SP as p,Sv as q,Zn as r,JYe as s,Oe as t,J as u,m_ as v,Ms as w,el as x,CVe as y,zo as z};
|