makecoder 2.0.84 → 2.0.86
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/cc.mjs +1497 -1497
- package/dist/coder.js +30 -30
- package/dist/gemini/{chunk-SHBVCB2A.js → chunk-CTQJGFLJ.js} +2 -2
- package/dist/gemini/{chunk-XQZDLC2N.js → chunk-EBB2IYKE.js} +2 -2
- package/dist/gemini/{chunk-OQXPTUY4.js → chunk-L5FDAQJS.js} +2 -2
- package/dist/gemini/{chunk-N65OKFPD.js → chunk-UYYXENF2.js} +2 -2
- package/dist/gemini/{core-Z5ENWQRR.js → core-B3NSJHXB.js} +1 -1
- package/dist/gemini/{devtoolsService-YLSPJ5JS.js → devtoolsService-AGS6ID67.js} +2 -2
- package/dist/gemini/{devtoolsService-DZHZEYLP.js → devtoolsService-LHW3U2EN.js} +2 -2
- package/dist/gemini/{dist-POYVVULD.js → dist-EZT2EOAT.js} +1 -1
- package/dist/gemini/gemini.js +4 -4
- package/dist/gemini/{interactiveCli-4ATZBGMY.js → interactiveCli-FGI25PZI.js} +2 -2
- package/dist/gemini/{interactiveCli-F574EI4I.js → interactiveCli-NC2XXIRS.js} +2 -2
- package/dist/gemini/{oauth2-provider-HPBKDSMW.js → oauth2-provider-HTOFGZYE.js} +1 -1
- package/dist/gemini/{oauth2-provider-XYD42NPZ.js → oauth2-provider-VD7VX4RN.js} +1 -1
- package/package.json +4 -4
- /package/dist/gemini/{tree-sitter-NXEUY244.js → tree-sitter-JU2EI3Z2.js} +0 -0
- /package/dist/gemini/{tree-sitter-bash-CUUXV34I.js → tree-sitter-bash-IAB7XJEE.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
|
-
import{$a as vS,$b as je,$c as Ld,A as iS,Aa as TS,Ab as nn,Ac as vd,B as sS,Ba as nl,Bb as BS,Bc as xe,C as Hr,Ca as rt,Cb as FS,Cc as mE,Db as US,Dc as pE,E as os,Eb as Do,Ec as fE,F as _i,Fb as ss,Fc as Rd,G as aS,Gb as HS,Gc as wd,H as ia,Ha as xS,Hb as as,Hc as Ad,I as Zt,Ib as Rn,Ic as Id,J as bd,Jb as d,Jc as gE,K as Ht,Kb as GS,Kc as hE,L as tr,Lb as WS,Lc as Od,M as eo,Mb as lg,Mc as Nd,N as og,Nb as $S,Nc as ca,O as Vn,Ob as qS,Oc as Md,P as lS,Pb as KS,Pc as dg,Q as te,Qa as SS,Qb as VS,Qc as yE,R as ns,Rb as Ye,Rc as bE,S as cS,Sb as Cd,Sc as ul,Tb as L,Tc as Dd,Ub as zS,Uc as TE,V as uS,Vb as ye,Vc as wn,W as dS,Wb as _t,Wc as Oc,X as ng,Xa as ES,Xb as Ac,Xc as xE,Ya as CS,Yb as YS,Yc as SE,Z as mS,Za as rg,Zb as XS,Zc as ko,_a as _S,_b as jS,_c as EE,aa as pS,ab as RS,ac as _d,ad as CE,b as na,ba as fS,bb as wS,bc as Ke,bd as _E,c as Kx,cb as on,cc as QS,cd as vE,d as Fr,da as vi,db as ig,dc as cg,e as _c,ea as gS,eb as rl,ec as JS,ed as kd,f as Ci,fb as AS,fc as ZS,fd as RE,g as Vx,gb as IS,gc as eE,gd as wE,h as eg,hb as Sd,hc as tE,i as zx,ia as rs,ib as OS,ic as oE,id as rn,j as Yx,jb as Wr,jc as nE,jd as Pd,k as Xx,kb as il,kc as rE,kd as Mt,l as jx,lb as NS,lc as iE,m as Ur,ma as Gr,mb as wc,mc as ll,n as Qx,nb as is,nc as sa,o as Jx,oa as hS,ob as sl,oc as sE,p as Zx,pb as Ed,pc as ug,q as tg,qa as Td,qb as MS,qc as aE,r as vc,rb as sg,rc as aa,s as eS,sb as DS,sc as la,t as tS,tb as ag,tc as Ic,u as oS,ub as LS,uc as lE,v as nS,va as yS,vb as kS,vc as cE,w as rS,wb as al,wc as cl,x as ra,xb as PS,xc as vt,y as Rc,ya as xd,yb as m,yc as uE,za as bS,zb as u,zc as dE}from"./chunk-N65OKFPD.js";import{Ad as ox,Al as xr,Be as ux,Bl as ol,Bm as yd,Cb as GT,Cd as nx,Ck as Mx,Cm as oa,Ea as $f,Ec as ad,Ed as rx,El as Lx,Ff as es,Fl as kx,Fm as Hx,Gf as Ja,Gg as dd,Gm as Jf,Hc as zT,Hf as Za,Hl as Px,Id as ix,Ih as tn,Im as Gx,Jf as fx,Jk as gd,K as NT,Kb as qf,Ke as ea,Kf as gx,Km as Wx,Lb as Kf,Li as ao,M as Zu,Me as dx,Mf as hx,Mi as el,Mm as $x,N as ed,Qb as WT,Qg as Sx,S as Wf,Sa as kT,Sc as YT,Sg as Ex,Sh as ta,Si as Xf,Ta as PT,Tg as Cx,Ua as BT,Uc as Vf,Ug as _x,Ui as Ox,Vc as XT,Wc as jT,Wg as Xe,Wh as so,Xb as $T,Xf as yx,Yc as QT,Yk as Dx,Zc as JT,_c as ZT,_j as tl,ad as ex,af as Cc,be as ld,bf as mx,bm as Bx,cf as cd,de as sx,fe as ax,ff as ud,fh as vx,fj as jf,gc as Kn,gf as px,gg as bx,gj as Nx,gn as qx,ia as od,ja as nd,jc as qT,jk as Qf,jn as Zf,ka as de,kj as md,lc as Js,mc as Zs,mm as Fx,ob as FT,oe as lx,pb as UT,pi as Rx,qf as Yf,ri as wx,sb as HT,sg as Tx,si as Ax,tc as rd,uc as Qa,ui as ts,um as Ux,vc as id,ve as zf,vk as fd,wc as KT,wd as Zi,wi as Ix,x as OT,xc as sd,xm as hd,yc as VT,yd as tx,ye as cx,zb as ja,zg as xx}from"./chunk-XQZDLC2N.js";import{$ as cT,$d as ze,Aa as Tc,Ba as xc,Bd as IT,C as Je,Ca as Ji,Da as Sc,Ea as fT,Fa as zu,Ga as Ec,Gd as td,Id as Tr,J as Ei,K as rT,L as iT,Pa as Nt,R as sT,Ra as Yu,S as aT,T as yc,U as Ku,V as lT,Vd as MT,W as Vu,Wa as Xu,X as Ze,Xb as ju,Xd as DT,Y as Br,Ya as gT,Zd as LT,_c as Gf,b as ve,ba as uT,be as Re,c as oT,da as dT,ea as mT,ga as pT,gd as xT,hd as ST,j as nT,jd as ET,kd as CT,ld as _T,mc as Qu,md as vT,nc as Ju,nd as RT,oc as yT,od as wT,pa as Xa,pc as bT,pd as AT,qc as TT,t as qo,te as pd,wa as Ff,wb as hT,xa as Uf,ya as Hf,za as bc}from"./chunk-5OV5S6OY.js";import"./chunk-TWIC4BKL.js";import{c as Lo}from"./chunk-LP5C4GJE.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as It,c as ct,d as $M,e as E}from"./chunk-YUXORC52.js";var s_=ct((qU,i_)=>{function zC(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let o=e[t],n=typeof o;(n==="object"||n==="function")&&!Object.isFrozen(o)&&zC(o)}),e}var jd=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function YC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function us(e,...t){let o=Object.create(null);for(let n in e)o[n]=e[n];return t.forEach(function(n){for(let r in n)o[r]=n[r]}),o}var ID="</span>",GC=e=>!!e.scope,OD=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let o=e.split(".");return[`${t}${o.shift()}`,...o.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},bg=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=YC(t)}openNode(t){if(!GC(t))return;let o=OD(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){GC(t)&&(this.buffer+=ID)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},WC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},Tg=class e{constructor(){this.rootNode=WC(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let o=WC({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(n=>this._walk(t,n)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{e._collapse(o)}))}},xg=class extends Tg{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){let n=t.root;o&&(n.scope=`language:${o}`),this.add(n)}toHTML(){return new bg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Mc(e){return e?typeof e=="string"?e:e.source:null}function XC(e){return da("(?=",e,")")}function ND(e){return da("(?:",e,")*")}function MD(e){return da("(?:",e,")?")}function da(...e){return e.map(o=>Mc(o)).join("")}function DD(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Eg(...e){return"("+(DD(e).capture?"":"?:")+e.map(n=>Mc(n)).join("|")+")"}function jC(e){return new RegExp(e.toString()+"|").exec("").length-1}function LD(e,t){let o=e&&e.exec(t);return o&&o.index===0}var kD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Cg(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,s=Mc(n),i="";for(;s.length>0;){let a=kD.exec(s);if(!a){i+=s;break}i+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+r):(i+=a[0],a[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var PD=/\b\B/,QC="[a-zA-Z]\\w*",_g="[a-zA-Z_]\\w*",JC="\\b\\d+(\\.\\d+)?",ZC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e_="\\b(0b[01]+)",BD="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",FD=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=da(t,/.*\b/,e.binary,/\b.*/)),us({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},Dc={begin:"\\\\[\\s\\S]",relevance:0},UD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Dc]},HD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Dc]},GD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Jd=function(e,t,o={}){let n=us({scope:"comment",begin:e,end:t,contains:[]},o);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Eg("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:da(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},WD=Jd("//","$"),$D=Jd("/\\*","\\*/"),qD=Jd("#","$"),KD={scope:"number",begin:JC,relevance:0},VD={scope:"number",begin:ZC,relevance:0},zD={scope:"number",begin:e_,relevance:0},YD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Dc,{begin:/\[/,end:/\]/,relevance:0,contains:[Dc]}]},XD={scope:"title",begin:QC,relevance:0},jD={scope:"title",begin:_g,relevance:0},QD={begin:"\\.\\s*"+_g,relevance:0},JD=function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},Xd=Object.freeze({__proto__:null,APOS_STRING_MODE:UD,BACKSLASH_ESCAPE:Dc,BINARY_NUMBER_MODE:zD,BINARY_NUMBER_RE:e_,COMMENT:Jd,C_BLOCK_COMMENT_MODE:$D,C_LINE_COMMENT_MODE:WD,C_NUMBER_MODE:VD,C_NUMBER_RE:ZC,END_SAME_AS_BEGIN:JD,HASH_COMMENT_MODE:qD,IDENT_RE:QC,MATCH_NOTHING_RE:PD,METHOD_GUARD:QD,NUMBER_MODE:KD,NUMBER_RE:JC,PHRASAL_WORDS_MODE:GD,QUOTE_STRING_MODE:HD,REGEXP_MODE:YD,RE_STARTERS_RE:BD,SHEBANG:FD,TITLE_MODE:XD,UNDERSCORE_IDENT_RE:_g,UNDERSCORE_TITLE_MODE:jD});function ZD(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function eL(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function tL(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ZD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oL(e,t){Array.isArray(e.illegal)&&(e.illegal=Eg(...e.illegal))}function nL(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function rL(e,t){e.relevance===void 0&&(e.relevance=1)}var iL=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let o=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=o.keywords,e.begin=da(o.beforeMatch,XC(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},sL=["of","and","for","in","not","or","if","then","parent","list","value"],aL="keyword";function t_(e,t,o=aL){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(s){Object.assign(n,t_(e[s],t,s))}),n;function r(s,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){let l=a.split("|");n[l[0]]=[s,lL(l[0],l[1])]})}}function lL(e,t){return t?Number(t):cL(e)?0:1}function cL(e){return sL.includes(e.toLowerCase())}var $C={},ua=e=>{console.error(e)},qC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},hl=(e,t)=>{$C[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$C[`${e}/${t}`]=!0)},Qd=new Error;function o_(e,t,{key:o}){let n=0,r=e[o],s={},i={};for(let a=1;a<=t.length;a++)i[a+n]=r[a],s[a+n]=!0,n+=jC(t[a-1]);e[o]=i,e[o]._emit=s,e[o]._multi=!0}function uL(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ua("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qd;if(typeof e.beginScope!="object"||e.beginScope===null)throw ua("beginScope must be object"),Qd;o_(e,e.begin,{key:"beginScope"}),e.begin=Cg(e.begin,{joinWith:""})}}function dL(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ua("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qd;if(typeof e.endScope!="object"||e.endScope===null)throw ua("endScope must be object"),Qd;o_(e,e.end,{key:"endScope"}),e.end=Cg(e.end,{joinWith:""})}}function mL(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function pL(e){mL(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),uL(e),dL(e)}function fL(e){function t(i,a){return new RegExp(Mc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=jC(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(Cg(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((g,f)=>f>0&&g!==void 0),p=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new o;return this.rules.slice(a).forEach(([c,p])=>l.addRule(c,p)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,c=p.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function r(i){let a=new n;return i.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function s(i,a){let l=i;if(i.isCompiled)return l;[eL,nL,pL,iL].forEach(p=>p(i,a)),e.compilerExtensions.forEach(p=>p(i,a)),i.__beforeBegin=null,[tL,oL,rL].forEach(p=>p(i,a)),i.isCompiled=!0;let c=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),c=i.keywords.$pattern,delete i.keywords.$pattern),c=c||/\w+/,i.keywords&&(i.keywords=t_(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),a&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=Mc(l.end)||"",i.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return gL(p==="self"?i:p)})),i.contains.forEach(function(p){s(p,l)}),i.starts&&s(i.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=us(e.classNameAliases||{}),s(e)}function n_(e){return e?e.endsWithParent||n_(e.starts):!1}function gL(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return us(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:n_(e)?us(e,{starts:e.starts?us(e.starts):null}):Object.isFrozen(e)?us(e):e}var hL="11.11.1",Sg=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},yg=YC,KC=us,VC=Symbol("nomatch"),yL=7,r_=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,s="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:xg};function l(N){return a.noHighlightRe.test(N)}function c(N){let F=N.className+" ";F+=N.parentNode?N.parentNode.className:"";let B=a.languageDetectRe.exec(F);if(B){let G=I(B[1]);return G||(qC(s.replace("{}",B[1])),qC("Falling back to no-highlight mode for this block.",N)),G?B[1]:"no-highlight"}return F.split(/\s+/).find(G=>l(G)||I(G))}function p(N,F,B){let G="",K="";typeof F=="object"?(G=N,B=F.ignoreIllegals,K=F.language):(hl("10.7.0","highlight(lang, code, ...args) has been deprecated."),hl("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
+
import{$a as vS,$b as je,$c as Ld,A as iS,Aa as TS,Ab as nn,Ac as vd,B as sS,Ba as nl,Bb as BS,Bc as xe,C as Hr,Ca as rt,Cb as FS,Cc as mE,Db as US,Dc as pE,E as os,Eb as Do,Ec as fE,F as _i,Fb as ss,Fc as Rd,G as aS,Gb as HS,Gc as wd,H as ia,Ha as xS,Hb as as,Hc as Ad,I as Zt,Ib as Rn,Ic as Id,J as bd,Jb as d,Jc as gE,K as Ht,Kb as GS,Kc as hE,L as tr,Lb as WS,Lc as Od,M as eo,Mb as lg,Mc as Nd,N as og,Nb as $S,Nc as ca,O as Vn,Ob as qS,Oc as Md,P as lS,Pb as KS,Pc as dg,Q as te,Qa as SS,Qb as VS,Qc as yE,R as ns,Rb as Ye,Rc as bE,S as cS,Sb as Cd,Sc as ul,Tb as L,Tc as Dd,Ub as zS,Uc as TE,V as uS,Vb as ye,Vc as wn,W as dS,Wb as _t,Wc as Oc,X as ng,Xa as ES,Xb as Ac,Xc as xE,Ya as CS,Yb as YS,Yc as SE,Z as mS,Za as rg,Zb as XS,Zc as ko,_a as _S,_b as jS,_c as EE,aa as pS,ab as RS,ac as _d,ad as CE,b as na,ba as fS,bb as wS,bc as Ke,bd as _E,c as Kx,cb as on,cc as QS,cd as vE,d as Fr,da as vi,db as ig,dc as cg,e as _c,ea as gS,eb as rl,ec as JS,ed as kd,f as Ci,fb as AS,fc as ZS,fd as RE,g as Vx,gb as IS,gc as eE,gd as wE,h as eg,hb as Sd,hc as tE,i as zx,ia as rs,ib as OS,ic as oE,id as rn,j as Yx,jb as Wr,jc as nE,jd as Pd,k as Xx,kb as il,kc as rE,kd as Mt,l as jx,lb as NS,lc as iE,m as Ur,ma as Gr,mb as wc,mc as ll,n as Qx,nb as is,nc as sa,o as Jx,oa as hS,ob as sl,oc as sE,p as Zx,pb as Ed,pc as ug,q as tg,qa as Td,qb as MS,qc as aE,r as vc,rb as sg,rc as aa,s as eS,sb as DS,sc as la,t as tS,tb as ag,tc as Ic,u as oS,ub as LS,uc as lE,v as nS,va as yS,vb as kS,vc as cE,w as rS,wb as al,wc as cl,x as ra,xb as PS,xc as vt,y as Rc,ya as xd,yb as m,yc as uE,za as bS,zb as u,zc as dE}from"./chunk-UYYXENF2.js";import{Ad as ox,Al as xr,Be as ux,Bl as ol,Bm as yd,Cb as GT,Cd as nx,Ck as Mx,Cm as oa,Ea as $f,Ec as ad,Ed as rx,El as Lx,Ff as es,Fl as kx,Fm as Hx,Gf as Ja,Gg as dd,Gm as Jf,Hc as zT,Hf as Za,Hl as Px,Id as ix,Ih as tn,Im as Gx,Jf as fx,Jk as gd,K as NT,Kb as qf,Ke as ea,Kf as gx,Km as Wx,Lb as Kf,Li as ao,M as Zu,Me as dx,Mf as hx,Mi as el,Mm as $x,N as ed,Qb as WT,Qg as Sx,S as Wf,Sa as kT,Sc as YT,Sg as Ex,Sh as ta,Si as Xf,Ta as PT,Tg as Cx,Ua as BT,Uc as Vf,Ug as _x,Ui as Ox,Vc as XT,Wc as jT,Wg as Xe,Wh as so,Xb as $T,Xf as yx,Yc as QT,Yk as Dx,Zc as JT,_c as ZT,_j as tl,ad as ex,af as Cc,be as ld,bf as mx,bm as Bx,cf as cd,de as sx,fe as ax,ff as ud,fh as vx,fj as jf,gc as Kn,gf as px,gg as bx,gj as Nx,gn as qx,ia as od,ja as nd,jc as qT,jk as Qf,jn as Zf,ka as de,kj as md,lc as Js,mc as Zs,mm as Fx,ob as FT,oe as lx,pb as UT,pi as Rx,qf as Yf,ri as wx,sb as HT,sg as Tx,si as Ax,tc as rd,uc as Qa,ui as ts,um as Ux,vc as id,ve as zf,vk as fd,wc as KT,wd as Zi,wi as Ix,x as OT,xc as sd,xm as hd,yc as VT,yd as tx,ye as cx,zb as ja,zg as xx}from"./chunk-EBB2IYKE.js";import{$ as cT,$d as ze,Aa as Tc,Ba as xc,Bd as IT,C as Je,Ca as Ji,Da as Sc,Ea as fT,Fa as zu,Ga as Ec,Gd as td,Id as Tr,J as Ei,K as rT,L as iT,Pa as Nt,R as sT,Ra as Yu,S as aT,T as yc,U as Ku,V as lT,Vd as MT,W as Vu,Wa as Xu,X as Ze,Xb as ju,Xd as DT,Y as Br,Ya as gT,Zd as LT,_c as Gf,b as ve,ba as uT,be as Re,c as oT,da as dT,ea as mT,ga as pT,gd as xT,hd as ST,j as nT,jd as ET,kd as CT,ld as _T,mc as Qu,md as vT,nc as Ju,nd as RT,oc as yT,od as wT,pa as Xa,pc as bT,pd as AT,qc as TT,t as qo,te as pd,wa as Ff,wb as hT,xa as Uf,ya as Hf,za as bc}from"./chunk-5OV5S6OY.js";import"./chunk-TWIC4BKL.js";import{c as Lo}from"./chunk-LP5C4GJE.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as It,c as ct,d as $M,e as E}from"./chunk-YUXORC52.js";var s_=ct((qU,i_)=>{function zC(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let o=e[t],n=typeof o;(n==="object"||n==="function")&&!Object.isFrozen(o)&&zC(o)}),e}var jd=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function YC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function us(e,...t){let o=Object.create(null);for(let n in e)o[n]=e[n];return t.forEach(function(n){for(let r in n)o[r]=n[r]}),o}var ID="</span>",GC=e=>!!e.scope,OD=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let o=e.split(".");return[`${t}${o.shift()}`,...o.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},bg=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=YC(t)}openNode(t){if(!GC(t))return;let o=OD(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){GC(t)&&(this.buffer+=ID)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},WC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},Tg=class e{constructor(){this.rootNode=WC(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let o=WC({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(n=>this._walk(t,n)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{e._collapse(o)}))}},xg=class extends Tg{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){let n=t.root;o&&(n.scope=`language:${o}`),this.add(n)}toHTML(){return new bg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Mc(e){return e?typeof e=="string"?e:e.source:null}function XC(e){return da("(?=",e,")")}function ND(e){return da("(?:",e,")*")}function MD(e){return da("(?:",e,")?")}function da(...e){return e.map(o=>Mc(o)).join("")}function DD(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Eg(...e){return"("+(DD(e).capture?"":"?:")+e.map(n=>Mc(n)).join("|")+")"}function jC(e){return new RegExp(e.toString()+"|").exec("").length-1}function LD(e,t){let o=e&&e.exec(t);return o&&o.index===0}var kD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Cg(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,s=Mc(n),i="";for(;s.length>0;){let a=kD.exec(s);if(!a){i+=s;break}i+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+r):(i+=a[0],a[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var PD=/\b\B/,QC="[a-zA-Z]\\w*",_g="[a-zA-Z_]\\w*",JC="\\b\\d+(\\.\\d+)?",ZC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e_="\\b(0b[01]+)",BD="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",FD=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=da(t,/.*\b/,e.binary,/\b.*/)),us({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},Dc={begin:"\\\\[\\s\\S]",relevance:0},UD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Dc]},HD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Dc]},GD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Jd=function(e,t,o={}){let n=us({scope:"comment",begin:e,end:t,contains:[]},o);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Eg("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:da(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},WD=Jd("//","$"),$D=Jd("/\\*","\\*/"),qD=Jd("#","$"),KD={scope:"number",begin:JC,relevance:0},VD={scope:"number",begin:ZC,relevance:0},zD={scope:"number",begin:e_,relevance:0},YD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Dc,{begin:/\[/,end:/\]/,relevance:0,contains:[Dc]}]},XD={scope:"title",begin:QC,relevance:0},jD={scope:"title",begin:_g,relevance:0},QD={begin:"\\.\\s*"+_g,relevance:0},JD=function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},Xd=Object.freeze({__proto__:null,APOS_STRING_MODE:UD,BACKSLASH_ESCAPE:Dc,BINARY_NUMBER_MODE:zD,BINARY_NUMBER_RE:e_,COMMENT:Jd,C_BLOCK_COMMENT_MODE:$D,C_LINE_COMMENT_MODE:WD,C_NUMBER_MODE:VD,C_NUMBER_RE:ZC,END_SAME_AS_BEGIN:JD,HASH_COMMENT_MODE:qD,IDENT_RE:QC,MATCH_NOTHING_RE:PD,METHOD_GUARD:QD,NUMBER_MODE:KD,NUMBER_RE:JC,PHRASAL_WORDS_MODE:GD,QUOTE_STRING_MODE:HD,REGEXP_MODE:YD,RE_STARTERS_RE:BD,SHEBANG:FD,TITLE_MODE:XD,UNDERSCORE_IDENT_RE:_g,UNDERSCORE_TITLE_MODE:jD});function ZD(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function eL(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function tL(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=ZD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oL(e,t){Array.isArray(e.illegal)&&(e.illegal=Eg(...e.illegal))}function nL(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function rL(e,t){e.relevance===void 0&&(e.relevance=1)}var iL=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let o=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=o.keywords,e.begin=da(o.beforeMatch,XC(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},sL=["of","and","for","in","not","or","if","then","parent","list","value"],aL="keyword";function t_(e,t,o=aL){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(s){Object.assign(n,t_(e[s],t,s))}),n;function r(s,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){let l=a.split("|");n[l[0]]=[s,lL(l[0],l[1])]})}}function lL(e,t){return t?Number(t):cL(e)?0:1}function cL(e){return sL.includes(e.toLowerCase())}var $C={},ua=e=>{console.error(e)},qC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},hl=(e,t)=>{$C[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$C[`${e}/${t}`]=!0)},Qd=new Error;function o_(e,t,{key:o}){let n=0,r=e[o],s={},i={};for(let a=1;a<=t.length;a++)i[a+n]=r[a],s[a+n]=!0,n+=jC(t[a-1]);e[o]=i,e[o]._emit=s,e[o]._multi=!0}function uL(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ua("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qd;if(typeof e.beginScope!="object"||e.beginScope===null)throw ua("beginScope must be object"),Qd;o_(e,e.begin,{key:"beginScope"}),e.begin=Cg(e.begin,{joinWith:""})}}function dL(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ua("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qd;if(typeof e.endScope!="object"||e.endScope===null)throw ua("endScope must be object"),Qd;o_(e,e.end,{key:"endScope"}),e.end=Cg(e.end,{joinWith:""})}}function mL(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function pL(e){mL(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),uL(e),dL(e)}function fL(e){function t(i,a){return new RegExp(Mc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=jC(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(Cg(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((g,f)=>f>0&&g!==void 0),p=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new o;return this.rules.slice(a).forEach(([c,p])=>l.addRule(c,p)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,c=p.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function r(i){let a=new n;return i.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function s(i,a){let l=i;if(i.isCompiled)return l;[eL,nL,pL,iL].forEach(p=>p(i,a)),e.compilerExtensions.forEach(p=>p(i,a)),i.__beforeBegin=null,[tL,oL,rL].forEach(p=>p(i,a)),i.isCompiled=!0;let c=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),c=i.keywords.$pattern,delete i.keywords.$pattern),c=c||/\w+/,i.keywords&&(i.keywords=t_(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),a&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=Mc(l.end)||"",i.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return gL(p==="self"?i:p)})),i.contains.forEach(function(p){s(p,l)}),i.starts&&s(i.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=us(e.classNameAliases||{}),s(e)}function n_(e){return e?e.endsWithParent||n_(e.starts):!1}function gL(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return us(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:n_(e)?us(e,{starts:e.starts?us(e.starts):null}):Object.isFrozen(e)?us(e):e}var hL="11.11.1",Sg=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},yg=YC,KC=us,VC=Symbol("nomatch"),yL=7,r_=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,s="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:xg};function l(N){return a.noHighlightRe.test(N)}function c(N){let F=N.className+" ";F+=N.parentNode?N.parentNode.className:"";let B=a.languageDetectRe.exec(F);if(B){let G=I(B[1]);return G||(qC(s.replace("{}",B[1])),qC("Falling back to no-highlight mode for this block.",N)),G?B[1]:"no-highlight"}return F.split(/\s+/).find(G=>l(G)||I(G))}function p(N,F,B){let G="",K="";typeof F=="object"?(G=N,B=F.ignoreIllegals,K=F.language):(hl("10.7.0","highlight(lang, code, ...args) has been deprecated."),hl("10.7.0",`Please use highlight(code, options) instead.
|
|
3
3
|
https://github.com/highlightjs/highlight.js/issues/2277`),K=N,G=F),B===void 0&&(B=!0);let z={code:G,language:K};k("before:highlight",z);let H=z.result?z.result:g(z.language,z.code,B);return H.code=z.code,k("after:highlight",H),H}function g(N,F,B,G){let K=Object.create(null);function z(se,pe){return se.keywords[pe]}function H(){if(!Ee.keywords){lt.addText(tt);return}let se=0;Ee.keywordPatternRe.lastIndex=0;let pe=Ee.keywordPatternRe.exec(tt),Me="";for(;pe;){Me+=tt.substring(se,pe.index);let ue=it.case_insensitive?pe[0].toLowerCase():pe[0],Ct=z(Ee,ue);if(Ct){let[Sn,Gn]=Ct;if(lt.addText(Me),Me="",K[ue]=(K[ue]||0)+1,K[ue]<=yL&&(xn+=Gn),Sn.startsWith("_"))Me+=pe[0];else{let Zo=it.classNameAliases[Sn]||Sn;J(pe[0],Zo)}}else Me+=pe[0];se=Ee.keywordPatternRe.lastIndex,pe=Ee.keywordPatternRe.exec(tt)}Me+=tt.substring(se),lt.addText(Me)}function V(){if(tt==="")return;let se=null;if(typeof Ee.subLanguage=="string"){if(!t[Ee.subLanguage]){lt.addText(tt);return}se=g(Ee.subLanguage,tt,!0,Ce[Ee.subLanguage]),Ce[Ee.subLanguage]=se._top}else se=y(tt,Ee.subLanguage.length?Ee.subLanguage:null);Ee.relevance>0&&(xn+=se.relevance),lt.__addSublanguage(se._emitter,se.language)}function X(){Ee.subLanguage!=null?V():H(),tt=""}function J(se,pe){se!==""&&(lt.startScope(pe),lt.addText(se),lt.endScope())}function oe(se,pe){let Me=1,ue=pe.length-1;for(;Me<=ue;){if(!se._emit[Me]){Me++;continue}let Ct=it.classNameAliases[se[Me]]||se[Me],Sn=pe[Me];Ct?J(Sn,Ct):(tt=Sn,H(),tt=""),Me++}}function Q(se,pe){return se.scope&&typeof se.scope=="string"&<.openNode(it.classNameAliases[se.scope]||se.scope),se.beginScope&&(se.beginScope._wrap?(J(tt,it.classNameAliases[se.beginScope._wrap]||se.beginScope._wrap),tt=""):se.beginScope._multi&&(oe(se.beginScope,pe),tt="")),Ee=Object.create(se,{parent:{value:Ee}}),Ee}function $(se,pe,Me){let ue=LD(se.endRe,Me);if(ue){if(se["on:end"]){let Ct=new jd(se);se["on:end"](pe,Ct),Ct.isMatchIgnored&&(ue=!1)}if(ue){for(;se.endsParent&&se.parent;)se=se.parent;return se}}if(se.endsWithParent)return $(se.parent,pe,Me)}function j(se){return Ee.matcher.regexIndex===0?(tt+=se[0],1):(Jo=!0,0)}function ee(se){let pe=se[0],Me=se.rule,ue=new jd(Me),Ct=[Me.__beforeBegin,Me["on:begin"]];for(let Sn of Ct)if(Sn&&(Sn(se,ue),ue.isMatchIgnored))return j(pe);return Me.skip?tt+=pe:(Me.excludeBegin&&(tt+=pe),X(),!Me.returnBegin&&!Me.excludeBegin&&(tt=pe)),Q(Me,se),Me.returnBegin?0:pe.length}function ae(se){let pe=se[0],Me=F.substring(se.index),ue=$(Ee,se,Me);if(!ue)return VC;let Ct=Ee;Ee.endScope&&Ee.endScope._wrap?(X(),J(pe,Ee.endScope._wrap)):Ee.endScope&&Ee.endScope._multi?(X(),oe(Ee.endScope,se)):Ct.skip?tt+=pe:(Ct.returnEnd||Ct.excludeEnd||(tt+=pe),X(),Ct.excludeEnd&&(tt=pe));do Ee.scope&<.closeNode(),!Ee.skip&&!Ee.subLanguage&&(xn+=Ee.relevance),Ee=Ee.parent;while(Ee!==ue.parent);return ue.starts&&Q(ue.starts,se),Ct.returnEnd?0:pe.length}function Z(){let se=[];for(let pe=Ee;pe!==it;pe=pe.parent)pe.scope&&se.unshift(pe.scope);se.forEach(pe=>lt.openNode(pe))}let Ae={};function Ge(se,pe){let Me=pe&&pe[0];if(tt+=se,Me==null)return X(),0;if(Ae.type==="begin"&&pe.type==="end"&&Ae.index===pe.index&&Me===""){if(tt+=F.slice(pe.index,pe.index+1),!r){let ue=new Error(`0 width match regex (${N})`);throw ue.languageName=N,ue.badRule=Ae.rule,ue}return 1}if(Ae=pe,pe.type==="begin")return ee(pe);if(pe.type==="illegal"&&!B){let ue=new Error('Illegal lexeme "'+Me+'" for mode "'+(Ee.scope||"<unnamed>")+'"');throw ue.mode=Ee,ue}else if(pe.type==="end"){let ue=ae(pe);if(ue!==VC)return ue}if(pe.type==="illegal"&&Me==="")return tt+=`
|
|
4
4
|
`,1;if(Io>1e5&&Io>pe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return tt+=Me,Me.length}let it=I(N);if(!it)throw ua(s.replace("{}",N)),new Error('Unknown language: "'+N+'"');let ke=fL(it),pt="",Ee=G||ke,Ce={},lt=new a.__emitter(a);Z();let tt="",xn=0,ro=0,Io=0,Jo=!1;try{if(it.__emitTokens)it.__emitTokens(F,lt);else{for(Ee.matcher.considerAll();;){Io++,Jo?Jo=!1:Ee.matcher.considerAll(),Ee.matcher.lastIndex=ro;let se=Ee.matcher.exec(F);if(!se)break;let pe=F.substring(ro,se.index),Me=Ge(pe,se);ro=se.index+Me}Ge(F.substring(ro))}return lt.finalize(),pt=lt.toHTML(),{language:N,value:pt,relevance:xn,illegal:!1,_emitter:lt,_top:Ee}}catch(se){if(se.message&&se.message.includes("Illegal"))return{language:N,value:yg(F),illegal:!0,relevance:0,_illegalBy:{message:se.message,index:ro,context:F.slice(ro-100,ro+100),mode:se.mode,resultSoFar:pt},_emitter:lt};if(r)return{language:N,value:yg(F),illegal:!1,relevance:0,errorRaised:se,_emitter:lt,_top:Ee};throw se}}function f(N){let F={value:yg(N),illegal:!1,relevance:0,_top:i,_emitter:new a.__emitter(a)};return F._emitter.addText(N),F}function y(N,F){F=F||a.languages||Object.keys(t);let B=f(N),G=F.filter(I).filter(v).map(X=>g(X,N,!1));G.unshift(B);let K=G.sort((X,J)=>{if(X.relevance!==J.relevance)return J.relevance-X.relevance;if(X.language&&J.language){if(I(X.language).supersetOf===J.language)return 1;if(I(J.language).supersetOf===X.language)return-1}return 0}),[z,H]=K,V=z;return V.secondBest=H,V}function h(N,F,B){let G=F&&o[F]||B;N.classList.add("hljs"),N.classList.add(`language-${G}`)}function b(N){let F=null,B=c(N);if(l(B))return;if(k("before:highlightElement",{el:N,language:B}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new Sg("One of your code blocks includes unescaped HTML.",N.innerHTML);F=N;let G=F.textContent,K=B?p(G,{language:B,ignoreIllegals:!0}):y(G);N.innerHTML=K.value,N.dataset.highlighted="yes",h(N,B,K.language),N.result={language:K.language,re:K.relevance,relevance:K.relevance},K.secondBest&&(N.secondBest={language:K.secondBest.language,relevance:K.secondBest.relevance}),k("after:highlightElement",{el:N,result:K,text:G})}function T(N){a=KC(a,N)}let x=()=>{S(),hl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){S(),hl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let A=!1;function S(){function N(){S()}if(document.readyState==="loading"){A||window.addEventListener("DOMContentLoaded",N,!1),A=!0;return}document.querySelectorAll(a.cssSelector).forEach(b)}function O(N,F){let B=null;try{B=F(e)}catch(G){if(ua("Language definition for '{}' could not be registered.".replace("{}",N)),r)ua(G);else throw G;B=i}B.name||(B.name=N),t[N]=B,B.rawDefinition=F.bind(null,e),B.aliases&&R(B.aliases,{languageName:N})}function _(N){delete t[N];for(let F of Object.keys(o))o[F]===N&&delete o[F]}function C(){return Object.keys(t)}function I(N){return N=(N||"").toLowerCase(),t[N]||t[o[N]]}function R(N,{languageName:F}){typeof N=="string"&&(N=[N]),N.forEach(B=>{o[B.toLowerCase()]=F})}function v(N){let F=I(N);return F&&!F.disableAutodetect}function D(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=F=>{N["before:highlightBlock"](Object.assign({block:F.el},F))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=F=>{N["after:highlightBlock"](Object.assign({block:F.el},F))})}function U(N){D(N),n.push(N)}function M(N){let F=n.indexOf(N);F!==-1&&n.splice(F,1)}function k(N,F){let B=N;n.forEach(function(G){G[B]&&G[B](F)})}function P(N){return hl("10.7.0","highlightBlock will be removed entirely in v12.0"),hl("10.7.0","Please use highlightElement now."),b(N)}Object.assign(e,{highlight:p,highlightAuto:y,highlightAll:S,highlightElement:b,highlightBlock:P,configure:T,initHighlighting:x,initHighlightingOnLoad:w,registerLanguage:O,unregisterLanguage:_,listLanguages:C,getLanguage:I,registerAliases:R,autoDetection:v,inherit:KC,addPlugin:U,removePlugin:M}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=hL,e.regex={concat:da,lookahead:XC,either:Eg,optional:MD,anyNumberOfTimes:ND};for(let N in Xd)typeof Xd[N]=="object"&&zC(Xd[N]);return Object.assign(e,Xd),e},yl=r_({});yl.newInstance=()=>r_({});i_.exports=yl;yl.HighlightJS=yl;yl.default=yl});var Av=ct(St=>{"use strict";var Ro=typeof Symbol=="function"&&Symbol.for,jg=Ro?Symbol.for("react.element"):60103,Qg=Ro?Symbol.for("react.portal"):60106,vm=Ro?Symbol.for("react.fragment"):60107,Rm=Ro?Symbol.for("react.strict_mode"):60108,wm=Ro?Symbol.for("react.profiler"):60114,Am=Ro?Symbol.for("react.provider"):60109,Im=Ro?Symbol.for("react.context"):60110,Jg=Ro?Symbol.for("react.async_mode"):60111,Om=Ro?Symbol.for("react.concurrent_mode"):60111,Nm=Ro?Symbol.for("react.forward_ref"):60112,Mm=Ro?Symbol.for("react.suspense"):60113,YL=Ro?Symbol.for("react.suspense_list"):60120,Dm=Ro?Symbol.for("react.memo"):60115,Lm=Ro?Symbol.for("react.lazy"):60116,XL=Ro?Symbol.for("react.block"):60121,jL=Ro?Symbol.for("react.fundamental"):60117,QL=Ro?Symbol.for("react.responder"):60118,JL=Ro?Symbol.for("react.scope"):60119;function Yn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case jg:switch(e=e.type,e){case Jg:case Om:case vm:case wm:case Rm:case Mm:return e;default:switch(e=e&&e.$$typeof,e){case Im:case Nm:case Lm:case Dm:case Am:return e;default:return t}}case Qg:return t}}}function wv(e){return Yn(e)===Om}St.AsyncMode=Jg;St.ConcurrentMode=Om;St.ContextConsumer=Im;St.ContextProvider=Am;St.Element=jg;St.ForwardRef=Nm;St.Fragment=vm;St.Lazy=Lm;St.Memo=Dm;St.Portal=Qg;St.Profiler=wm;St.StrictMode=Rm;St.Suspense=Mm;St.isAsyncMode=function(e){return wv(e)||Yn(e)===Jg};St.isConcurrentMode=wv;St.isContextConsumer=function(e){return Yn(e)===Im};St.isContextProvider=function(e){return Yn(e)===Am};St.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===jg};St.isForwardRef=function(e){return Yn(e)===Nm};St.isFragment=function(e){return Yn(e)===vm};St.isLazy=function(e){return Yn(e)===Lm};St.isMemo=function(e){return Yn(e)===Dm};St.isPortal=function(e){return Yn(e)===Qg};St.isProfiler=function(e){return Yn(e)===wm};St.isStrictMode=function(e){return Yn(e)===Rm};St.isSuspense=function(e){return Yn(e)===Mm};St.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===vm||e===Om||e===wm||e===Rm||e===Mm||e===YL||typeof e=="object"&&e!==null&&(e.$$typeof===Lm||e.$$typeof===Dm||e.$$typeof===Am||e.$$typeof===Im||e.$$typeof===Nm||e.$$typeof===jL||e.$$typeof===QL||e.$$typeof===JL||e.$$typeof===XL)};St.typeOf=Yn});var Iv=ct(Et=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,T=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function A(Z){return typeof Z=="string"||typeof Z=="function"||Z===n||Z===c||Z===s||Z===r||Z===g||Z===f||typeof Z=="object"&&Z!==null&&(Z.$$typeof===h||Z.$$typeof===y||Z.$$typeof===i||Z.$$typeof===a||Z.$$typeof===p||Z.$$typeof===T||Z.$$typeof===x||Z.$$typeof===w||Z.$$typeof===b)}function S(Z){if(typeof Z=="object"&&Z!==null){var Ae=Z.$$typeof;switch(Ae){case t:var Ge=Z.type;switch(Ge){case l:case c:case n:case s:case r:case g:return Ge;default:var it=Ge&&Ge.$$typeof;switch(it){case a:case p:case h:case y:case i:return it;default:return Ae}}case o:return Ae}}}var O=l,_=c,C=a,I=i,R=t,v=p,D=n,U=h,M=y,k=o,P=s,N=r,F=g,B=!1;function G(Z){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),K(Z)||S(Z)===l}function K(Z){return S(Z)===c}function z(Z){return S(Z)===a}function H(Z){return S(Z)===i}function V(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===t}function X(Z){return S(Z)===p}function J(Z){return S(Z)===n}function oe(Z){return S(Z)===h}function Q(Z){return S(Z)===y}function $(Z){return S(Z)===o}function j(Z){return S(Z)===s}function ee(Z){return S(Z)===r}function ae(Z){return S(Z)===g}Et.AsyncMode=O,Et.ConcurrentMode=_,Et.ContextConsumer=C,Et.ContextProvider=I,Et.Element=R,Et.ForwardRef=v,Et.Fragment=D,Et.Lazy=U,Et.Memo=M,Et.Portal=k,Et.Profiler=P,Et.StrictMode=N,Et.Suspense=F,Et.isAsyncMode=G,Et.isConcurrentMode=K,Et.isContextConsumer=z,Et.isContextProvider=H,Et.isElement=V,Et.isForwardRef=X,Et.isFragment=J,Et.isLazy=oe,Et.isMemo=Q,Et.isPortal=$,Et.isProfiler=j,Et.isStrictMode=ee,Et.isSuspense=ae,Et.isValidElementType=A,Et.typeOf=S}()});var eh=ct((kK,Zg)=>{"use strict";process.env.NODE_ENV==="production"?Zg.exports=Av():Zg.exports=Iv()});var Mv=ct((PK,Nv)=>{"use strict";var Ov=Object.getOwnPropertySymbols,ZL=Object.prototype.hasOwnProperty,ek=Object.prototype.propertyIsEnumerable;function tk(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function ok(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},o=0;o<10;o++)t["_"+String.fromCharCode(o)]=o;var n=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(n.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(s){r[s]=s}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Nv.exports=ok()?Object.assign:function(e,t){for(var o,n=tk(e),r,s=1;s<arguments.length;s++){o=Object(arguments[s]);for(var i in o)ZL.call(o,i)&&(n[i]=o[i]);if(Ov){r=Ov(o);for(var a=0;a<r.length;a++)ek.call(o,r[a])&&(n[r[a]]=o[r[a]])}}return n}});var km=ct((BK,Dv)=>{"use strict";var nk="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Dv.exports=nk});var th=ct((FK,Lv)=>{Lv.exports=Function.call.bind(Object.prototype.hasOwnProperty)});var Uv=ct((UK,Fv)=>{"use strict";var oh=function(){};process.env.NODE_ENV!=="production"&&(kv=km(),Pm={},Pv=th(),oh=function(e){var t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});var kv,Pm,Pv;function Bv(e,t,o,n,r){if(process.env.NODE_ENV!=="production"){for(var s in e)if(Pv(e,s)){var i;try{if(typeof e[s]!="function"){var a=Error((n||"React class")+": "+o+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[s](t,s,n,o,null,kv)}catch(c){i=c}if(i&&!(i instanceof Error)&&oh((n||"React class")+": type specification of "+o+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in Pm)){Pm[i.message]=!0;var l=r?r():"";oh("Failed "+o+" type: "+i.message+(l??""))}}}}Bv.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(Pm={})};Fv.exports=Bv});var Wv=ct((HK,Gv)=>{"use strict";var rk=eh(),ik=Mv(),Al=km(),nh=th(),Hv=Uv(),Il=function(){};process.env.NODE_ENV!=="production"&&(Il=function(e){var t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});function Bm(){return null}Gv.exports=function(e,t){var o=typeof Symbol=="function"&&Symbol.iterator,n="@@iterator";function r(M){var k=M&&(o&&M[o]||M[n]);if(typeof k=="function")return k}var s="<<anonymous>>",i={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:g(),arrayOf:f,element:y(),elementType:h(),instanceOf:b,node:A(),objectOf:x,oneOf:T,oneOfType:w,shape:O,exact:_};function a(M,k){return M===k?M!==0||1/M===1/k:M!==M&&k!==k}function l(M,k){this.message=M,this.data=k&&typeof k=="object"?k:{},this.stack=""}l.prototype=Error.prototype;function c(M){if(process.env.NODE_ENV!=="production")var k={},P=0;function N(B,G,K,z,H,V,X){if(z=z||s,V=V||K,X!==Al){if(t){var J=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw J.name="Invariant Violation",J}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var oe=z+":"+K;!k[oe]&&P<3&&(Il("You are manually calling a React.PropTypes validation function for the `"+V+"` prop on `"+z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),k[oe]=!0,P++)}}return G[K]==null?B?G[K]===null?new l("The "+H+" `"+V+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new l("The "+H+" `"+V+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:M(G,K,z,H,V)}var F=N.bind(null,!1);return F.isRequired=N.bind(null,!0),F}function p(M){function k(P,N,F,B,G,K){var z=P[N],H=R(z);if(H!==M){var V=v(z);return new l("Invalid "+B+" `"+G+"` of type "+("`"+V+"` supplied to `"+F+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return c(k)}function g(){return c(Bm)}function f(M){function k(P,N,F,B,G){if(typeof M!="function")return new l("Property `"+G+"` of component `"+F+"` has invalid PropType notation inside arrayOf.");var K=P[N];if(!Array.isArray(K)){var z=R(K);return new l("Invalid "+B+" `"+G+"` of type "+("`"+z+"` supplied to `"+F+"`, expected an array."))}for(var H=0;H<K.length;H++){var V=M(K,H,F,B,G+"["+H+"]",Al);if(V instanceof Error)return V}return null}return c(k)}function y(){function M(k,P,N,F,B){var G=k[P];if(!e(G)){var K=R(G);return new l("Invalid "+F+" `"+B+"` of type "+("`"+K+"` supplied to `"+N+"`, expected a single ReactElement."))}return null}return c(M)}function h(){function M(k,P,N,F,B){var G=k[P];if(!rk.isValidElementType(G)){var K=R(G);return new l("Invalid "+F+" `"+B+"` of type "+("`"+K+"` supplied to `"+N+"`, expected a single ReactElement type."))}return null}return c(M)}function b(M){function k(P,N,F,B,G){if(!(P[N]instanceof M)){var K=M.name||s,z=U(P[N]);return new l("Invalid "+B+" `"+G+"` of type "+("`"+z+"` supplied to `"+F+"`, expected ")+("instance of `"+K+"`."))}return null}return c(k)}function T(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?Il("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):Il("Invalid argument supplied to oneOf, expected an array.")),Bm;function k(P,N,F,B,G){for(var K=P[N],z=0;z<M.length;z++)if(a(K,M[z]))return null;var H=JSON.stringify(M,function(X,J){var oe=v(J);return oe==="symbol"?String(J):J});return new l("Invalid "+B+" `"+G+"` of value `"+String(K)+"` "+("supplied to `"+F+"`, expected one of "+H+"."))}return c(k)}function x(M){function k(P,N,F,B,G){if(typeof M!="function")return new l("Property `"+G+"` of component `"+F+"` has invalid PropType notation inside objectOf.");var K=P[N],z=R(K);if(z!=="object")return new l("Invalid "+B+" `"+G+"` of type "+("`"+z+"` supplied to `"+F+"`, expected an object."));for(var H in K)if(nh(K,H)){var V=M(K,H,F,B,G+"."+H,Al);if(V instanceof Error)return V}return null}return c(k)}function w(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&Il("Invalid argument supplied to oneOfType, expected an instance of array."),Bm;for(var k=0;k<M.length;k++){var P=M[k];if(typeof P!="function")return Il("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+D(P)+" at index "+k+"."),Bm}function N(F,B,G,K,z){for(var H=[],V=0;V<M.length;V++){var X=M[V],J=X(F,B,G,K,z,Al);if(J==null)return null;J.data&&nh(J.data,"expectedType")&&H.push(J.data.expectedType)}var oe=H.length>0?", expected one of type ["+H.join(", ")+"]":"";return new l("Invalid "+K+" `"+z+"` supplied to "+("`"+G+"`"+oe+"."))}return c(N)}function A(){function M(k,P,N,F,B){return C(k[P])?null:new l("Invalid "+F+" `"+B+"` supplied to "+("`"+N+"`, expected a ReactNode."))}return c(M)}function S(M,k,P,N,F){return new l((M||"React class")+": "+k+" type `"+P+"."+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+F+"`.")}function O(M){function k(P,N,F,B,G){var K=P[N],z=R(K);if(z!=="object")return new l("Invalid "+B+" `"+G+"` of type `"+z+"` "+("supplied to `"+F+"`, expected `object`."));for(var H in M){var V=M[H];if(typeof V!="function")return S(F,B,G,H,v(V));var X=V(K,H,F,B,G+"."+H,Al);if(X)return X}return null}return c(k)}function _(M){function k(P,N,F,B,G){var K=P[N],z=R(K);if(z!=="object")return new l("Invalid "+B+" `"+G+"` of type `"+z+"` "+("supplied to `"+F+"`, expected `object`."));var H=ik({},P[N],M);for(var V in H){var X=M[V];if(nh(M,V)&&typeof X!="function")return S(F,B,G,V,v(X));if(!X)return new l("Invalid "+B+" `"+G+"` key `"+V+"` supplied to `"+F+"`.\nBad object: "+JSON.stringify(P[N],null," ")+`
|
|
5
5
|
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var J=X(K,V,F,B,G+"."+V,Al);if(J)return J}return null}return c(k)}function C(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(C);if(M===null||e(M))return!0;var k=r(M);if(k){var P=k.call(M),N;if(k!==M.entries){for(;!(N=P.next()).done;)if(!C(N.value))return!1}else for(;!(N=P.next()).done;){var F=N.value;if(F&&!C(F[1]))return!1}}else return!1;return!0;default:return!1}}function I(M,k){return M==="symbol"?!0:k?k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol:!1}function R(M){var k=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":I(k,M)?"symbol":k}function v(M){if(typeof M>"u"||M===null)return""+M;var k=R(M);if(k==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return k}function D(M){var k=v(M);switch(k){case"array":case"object":return"an "+k;case"boolean":case"date":case"regexp":return"a "+k;default:return k}}function U(M){return!M.constructor||!M.constructor.name?s:M.constructor.name}return i.checkPropTypes=Hv,i.resetWarningCache=Hv.resetWarningCache,i.PropTypes=i,i}});var Vv=ct((GK,Kv)=>{"use strict";var sk=km();function $v(){}function qv(){}qv.resetWarningCache=$v;Kv.exports=function(){function e(n,r,s,i,a,l){if(l!==sk){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:qv,resetWarningCache:$v};return o.PropTypes=o,o}});var Xv=ct((WK,rh)=>{process.env.NODE_ENV!=="production"?(zv=eh(),Yv=!0,rh.exports=Wv()(zv.isElement,Yv)):rh.exports=Vv()();var zv,Yv});var eR=ct(($K,Fm)=>{"use strict";var Qv=Td(),ak=tS(),jv=/\s/g;function ih(...e){let t=ak.apply(this,e),o=(n,r)=>lk(n?n.toString():"",t,r);return o.multiline=(n,r)=>ck(n?n.toString():"",t,r),o}var Jv=(e,t,o)=>t.interpolation.toLowerCase()==="hsv"?e.hsv(o,t.hsvSpin.toLowerCase()):e.rgb(o);function lk(e,t,o){let n=Zv(o),r=Math.max(e.replace(jv,"").length,t.stops.length),s=Jv(t,n,r),i="";for(let a of e)i+=a.match(jv)?a:Qv.hex(s.shift().toHex())(a);return i}function ck(e,t,o){let n=Zv(o),r=e.split(`
|
|
@@ -116,7 +116,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
116
116
|
`),await rn())}$o("authenticated")},[i,n,$o,qn,Ys]),zy=(0,Y.useCallback)(async q=>{try{if(qn(null),!q.trim()&&q.length>1){qn("API key cannot be empty string with length greater than 1.");return}await Cx(q),await Ly(),await n.refreshAuth(Xe.USE_GEMINI),$o("authenticated")}catch(fe){qn(`Failed to save API key: ${fe instanceof Error?fe.message:String(fe)}`)}},[$o,qn,Ly,n]),Yy=(0,Y.useCallback)(()=>{$o("updating")},[$o]);(0,Y.useEffect)(()=>{Lr==="authenticated"&&(ce(n.getUserTier()),me(n.getUserPaidTier()))},[n,Lr]),(0,Y.useEffect)(()=>{if(i.merged.security.auth.enforcedType&&i.merged.security.auth.selectedType&&i.merged.security.auth.enforcedType!==i.merged.security.auth.selectedType)qn(`Authentication is enforced to be ${i.merged.security.auth.enforcedType}, but you are currently using ${i.merged.security.auth.selectedType}.`);else if(i.merged.security.auth.selectedType&&!i.merged.security.auth.useExternal){if(i.merged.security.auth.selectedType===Xe.USE_GEMINI)return;let q=kd(i.merged.security.auth.selectedType);q&&qn(q)}},[i.merged.security.auth.selectedType,i.merged.security.auth.enforcedType,i.merged.security.auth.useExternal,qn]);let{isModelDialogOpen:Tf,openModelDialog:Xy,closeModelDialog:jy}=vI(),{toggleVimEnabled:mM}=ul(),xf=(0,Y.useRef)(()=>{}),[za,Xs]=(0,Y.useState)(!1),{cleanUiDetailsVisible:Ru,setCleanUiDetailsVisible:Qy,toggleCleanUiDetailsVisible:Jy,revealCleanUiDetailsTemporarily:wu}=sM(),pM=(0,Y.useMemo)(()=>({openAuthDialog:()=>$o("updating"),openThemeDialog:Iy,openEditorDialog:sc,openPrivacyNotice:()=>S(!0),openSettingsDialog:wy,openSessionBrowser:vu,openModelDialog:Xy,openAgentConfigDialog:hi,openPermissionsDialog:pi,quit:q=>{w(q),setTimeout(async()=>{await Gr(),Ey.exit(0)},100)},setDebugMessage:T,toggleCorgiMode:()=>f(q=>!q),toggleDebugProfiler:Ka,dispatchExtensionStateUpdate:Wo,addConfirmUpdateExtensionRequest:mi,toggleBackgroundTasks:()=>{G.current(),K.current||(v(!0),z.current.size>1?xf.current(!0):xf.current(!1))},toggleShortcutsHelp:()=>Xs(q=>!q),setText:Cy}),[$o,Iy,sc,wy,vu,Xy,hi,w,T,S,f,Wo,pi,mi,Ka,Xs,Cy]),{handleSlashCommand:xi,slashCommands:Au,pendingHistoryItems:Iu,commandContext:Zy,confirmationRequest:js}=AI(n,i,c.addItem,c.clearItems,c.loadHistory,Xt,mM,I,pM,Oo,le,pr,k),[uc,eb]=(0,Y.useState)(null),[Ou,tb]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{let q=fe=>{eb({prompt:fe.prompt,onConfirm:ge=>{eb(null),fe.onConfirm(ge)}})};return Re.on(ze.ConsentRequest,q),()=>{Re.off(ze.ConsentRequest,q)}},[]);let fM=(0,Y.useCallback)(async()=>{c.addItem({type:"info",text:"Refreshing hierarchical memory (GEMINI.md or other context files)..."},Date.now());try{let q,fe;if(n.isJitContextEnabled())await n.getContextManager()?.refresh(),n.updateSystemInstructionIfInitialized(),q=Qf(n.getUserMemory()),fe=n.getGeminiMdFileCount();else{let ge=await pd(n);q=Qf(ge.memoryContent),fe=ge.fileCount}c.addItem({type:"info",text:`Memory reloaded successfully. ${q.length>0?`Loaded ${q.length} characters from ${fe} file(s)`:"No memory content found"}`},Date.now()),n.getDebugMode()&&ve.log(`[DEBUG] Refreshed memory content in config: ${q.substring(0,200)}...`)}catch(q){let fe=Tr(q);c.addItem({type:"error",text:`Error refreshing memory: ${fe}`},Date.now()),ve.warn("Error refreshing memory:",q)}},[n,c]),Sf=(0,Y.useRef)(()=>{}),gM=(0,Y.useCallback)(q=>{q?B(!0):(B(!1),Sf.current(!1))},[]);(0,Y.useEffect)(()=>{if(F){let q=c.history.findLast(ge=>ge.type==="user"),fe=_e.at(-1);(!q||typeof q.text=="string"&&q.text===fe)&&(Sf.current(!0),B(!1))}},[F,_e,c.history]);let Nu=(0,Y.useRef)([]),[hM,ob]=(0,Y.useState)(0),Ef=(0,Y.useCallback)(()=>{if(Nu.current.length===0)return null;let q=Nu.current.join(`
|
|
117
117
|
`);return Nu.current=[],ob(0),q},[]);(0,Y.useEffect)(()=>{let q=(fe,ge)=>{ge!=="user_steering"&&ge!=="background_completion"||(Nu.current.push(fe),ob(Ve=>Ve+1))};return n.injectionService.onInjection(q),()=>{n.injectionService.offInjection(q)}},[n]);let{streamingState:fo,submitQuery:Ya,initError:Cf,pendingHistoryItems:Mu,thought:dc,cancelOngoingRequest:nb,pendingToolCalls:yM,handleApprovalModeChange:rb,activePtyId:Xi,loopDetectionConfirmationRequest:Du,lastOutputTime:_f,backgroundTaskCount:vf,isBackgroundTaskVisible:kr,toggleBackgroundTasks:Lu,backgroundCurrentExecution:ib,backgroundTasks:Pr,dismissBackgroundTask:sb,retryStatus:bM}=$I(n.getGeminiClient(),c.history,c.addItem,n,i,T,xi,j,bi,qn,fM,ae,Z,gM,v,st,nt,R,Ef),No=(0,Y.useMemo)(()=>[...Iu,...Mu],[Iu,Mu]);G.current=Lu,K.current=kr,z.current=Pr;let{activeBackgroundTaskPid:ab,setIsBackgroundTaskListOpen:Qs,isBackgroundTaskListOpen:lb,setActiveBackgroundTaskPid:cb,backgroundTaskHeight:Rf}=VN({backgroundTasks:Pr,backgroundTaskCount:vf,isBackgroundTaskVisible:kr,activePtyId:Xi,embeddedShellFocused:R,setEmbeddedShellFocused:v,terminalHeight:nt});xf.current=Qs;let mc=(0,Y.useRef)(0);(0,Y.useEffect)(()=>{mc.current=_f},[_f]);let{shouldShowFocusHint:TM,inactivityStatus:ub}=XI({activePtyId:Xi,lastOutputTime:_f,streamingState:fo,pendingToolCalls:yM,embeddedShellFocused:R,isInteractiveShellEnabled:n.isInteractiveShellEnabled()}),db=ub==="action_required",mb=ub==="silent_working",xM=(0,Y.useCallback)(q=>{rb(q),Ru||wu(Sy)},[rb,Ru,wu]),{isMcpReady:pc}=PN(n),{messageQueue:ku,addMessage:Pu,clearQueue:pb,getQueuedMessagesText:fb,popAllMessages:gb}=kN({isConfigInitialized:le,streamingState:fo,submitQuery:Ya,isMcpReady:pc});Sf.current=(0,Y.useCallback)((q=!0)=>{if(Zm(No))return;if(Jm(No)){Ti.setText("");return}if(!q)return;let ge=_e.at(-1)||"",Ve=fb();Ve&&(ge=ge?`${ge}
|
|
118
118
|
|
|
119
|
-
${Ve}`:Ve,pb()),ge&&Ti.setText(ge)},[Ti,_e,fb,pb,No]);let hb=(0,Y.useCallback)(q=>{let fe=q.trim();fe&&(n.injectionService.addInjection(fe,"user_steering"),c.addItem({type:"hint",text:fe}))},[n,c]),fc=(0,Y.useCallback)(async q=>{a(),ue(null),se||(pe(!0),p||Xt());let fe=on(q.trim()),ge=fo==="idle",Ve=fo==="responding"||Jm(No);if(fe&&Ve){let{commandToExecute:Qi}=rl(q,Au??[]);if(Qi?.isSafeConcurrent){xi(q),qe(q);return}}if(n.isModelSteeringEnabled()&&Ve&&!fe){hb(q),qe(q);return}let Mo=le&&pc;if(fe&&le||ge&&Mo){if(!fe){let Qi=await vS(q,n);if(Qi.length>0){tb({files:Qi,onComplete:GM=>{tb(null),GM.allowed&&Qi.forEach(WM=>n.getWorkspaceContext().addReadOnlyPath(WM)),Ya(q)}}),qe(q);return}}Ya(q)}else ge&&!Mo&&ku.length===0&&Re.emitFeedback("info",le?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),Pu(q);qe(q)},[Pu,qe,Ya,xi,Au,pc,fo,ku.length,No,n,se,pe,p,Xt,a,hb,le,ue]),yb=(0,Y.useCallback)(()=>{a(),ue(null),c.clearItems(),zs(),Xt()},[c,zs,Xt,a,ue]),{handleInput:bb}=KI(Ti,fc),wf=!Cf&&!C&&!yf&&(fo==="idle"||fo==="responding"||fo==="waiting_for_confirmation")&&!lc&&!P,Bu=(0,Y.useRef)(null),[Fu,SM]=(0,Y.useState)(0),[Tb,EM]=(0,Y.useState)(0);(0,Y.useLayoutEffect)(()=>{!P&&Fu>0&&EM(Fu)},[P,Fu]);let Af=P&&Tb>0?Tb:Fu,xb=(0,Y.useCallback)(q=>{if(Bu.current&&(Bu.current.disconnect(),Bu.current=null),q){let fe=new nn(ge=>{let Ve=ge[0];if(Ve){let Mo=Math.round(Ve.contentRect.height);SM(Qi=>Mo!==Qi?Mo:Qi)}});fe.observe(q),Bu.current=fe}},[]),If=Math.max(0,nt-Af-Rf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(st*X1),terminalHeight:Math.max(Math.floor(If-j1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Uu,hasReceivedFocusEvent:CM}=KS(),Sb=(0,Y.useMemo)(()=>{let q=i.merged.context.fileName;return q?Array.isArray(q)?q:[q]:IT()},[i.merged.context.fileName]),Of=(0,Y.useMemo)(()=>n.getQuestion(),[n]),Eb=(0,Y.useRef)(!1),Cb=n.getGeminiClient();(0,Y.useEffect)(()=>{Of&&le&&!Eb.current&&!Va&&!cc&&!ac&&!ic&&!A&&Cb?.isInitialized?.()&&(fc(Of),Eb.current=!0)},[Of,le,fc,Va,cc,ac,ic,A,Cb]);let[_M,vM]=(0,Y.useState)(!1),[Nf,RM]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{(async()=>{let ge=(await es.getInstance()).getCurrentIde();RM(ge||null)})()},[]);let Hu=!!(Nf&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!_M),[Gu,gc]=(0,Y.useState)(!1),[_b,wM]=(0,Y.useState)(!1),[vb,AM]=(0,Y.useState)(!0),Rb=(0,Y.useCallback)(q=>{q>2&&PT(n),q>1&&xi("/quit",void 0,void 0,!1)},[n,xi]),{pressCount:wb,handlePress:Ab}=$l({windowMs:Ci,onRepeat:Rb}),{pressCount:Ib,handlePress:Ob}=$l({windowMs:Ci,onRepeat:Rb}),[Wu,Nb]=(0,Y.useState)(),[Mb,IM]=(0,Y.useState)(!1),[Mf,OM]=(0,Y.useState)(!1),[Db,Si]=df(Ci),{isFolderTrustDialogOpen:Df,discoveryResults:Lb,handleFolderTrustSelect:kb,isRestarting:Pb}=jI(i,tt,c.addItem),Lf=n.getPolicyUpdateConfirmationRequest(),[kf,Bb]=(0,Y.useState)(!!Lf),{needsRestart:Fb,restartReason:Ub}=dE(),Hb=(0,Y.useRef)(!0);WN(n,lt,c,k);let ji=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let q=Ve=>{Si({text:Ve.message,type:Ve.type})},fe=()=>{Si({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},ge=()=>{Si({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Lo.on("transient-message",q),Lo.on("selection-warning",fe),Lo.on("paste-timeout",ge),()=>{Lo.off("transient-message",q),Lo.off("selection-warning",fe),Lo.off("paste-timeout",ge),ji.current&&clearTimeout(ji.current)}},[Si]);let Pf=(0,Y.useCallback)(q=>{Si({text:q,type:"warning"})},[Si]),{handleSuspend:Gb}=jN({handleWarning:Pf,setRawMode:yt,refreshStatic:Xt,setForceRerenderKey:h,shouldUseAlternateScreen:pf});(0,Y.useEffect)(()=>{Fb&&OM(!0)},[Fb]),(0,Y.useEffect)(()=>{if(Hb.current){Hb.current=!1;return}let q=setTimeout(()=>{Xt()},300);return()=>{clearTimeout(q)}},[st,Xt]),(0,Y.useEffect)(()=>{let q=Yf.subscribe(Nb);return Nb(Yf.get()),q},[]),(0,Y.useEffect)(()=>{let q=()=>{gc(!0),pe(!1)};return Lo.on("open-debug-console",q),()=>{Lo.off("open-debug-console",q)}},[n]);let Wb=(0,Y.useCallback)(q=>{IM(q)},[]),$b=(0,Y.useCallback)(q=>{q.userSelection==="yes"?(xi("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):q.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),vM(!0)},[xi,i]),NM=(0,Y.useCallback)(q=>{if(i.merged.general.debugKeystrokeLogging&&ve.log("[DEBUG] Keystroke:",JSON.stringify(q)),za&&t(q)&&Xs(!1),p&&o["app.toggleCopyMode"](q))return N(!0),Zs(),!0;if(o["basic.quit"](q))return nb?.(),Ab(),!0;if(o["basic.exit"](q))return mf.current.text.length>0?!1:(Ob(),!0);if(o["app.suspend"](q))Gb();else if(o["app.toggleCopyMode"](q)&&!p)return Si({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0;let fe=()=>{ue(!0);let Ve=PR(c.history,No);Ve.length>0&&Q(Ve)},ge=!1;if(se||(ge=!0,pe(!0),o["app.showMoreLines"](q)&&fe(),p||Xt()),o["app.showErrorDetails"](q))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:Ve}=await import("./devtoolsService-DZHZEYLP.js");await Ve(n,Gu,()=>gc(Mo=>!Mo),()=>gc(!0))})():gc(Ve=>!Ve),!0;if(o["app.showFullTodos"](q))return wM(Ve=>!Ve),!0;if(o["app.toggleMarkdown"](q))return AM(Ve=>{let Mo=!Ve;return Xt(),Mo}),!0;if(o["app.showIdeContextDetail"](q)&&n.getIdeMode()&&Wu)return xi("/ide status"),!0;if(o["app.showMoreLines"](q)&&!ge)return pe(!1),fe(),Xt(),!0;if((o["app.focusShellInput"](q)||o["background.unfocusList"](q))&&(Xi||kr&&Pr.size>0)){if(R){let Mo=mc.current;return ji.current&&clearTimeout(ji.current),ji.current=setTimeout(()=>{mc.current===Mo?v(!1):Si({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-mc.current>=100&&!Xi&&!kr?(ji.current&&clearTimeout(ji.current),Lu(),v(!0),Pr.size>1&&Qs(!0),!0):(v(!0),!0)}else{if(o["app.unfocusShellInput"](q)||o["background.unfocus"](q))return R?(v(!1),!0):!1;if(o["background.toggle"](q))return Xi?ib():(Lu(),!kr&&Pr.size>0?(v(!0),Pr.size>1&&Qs(!0)):v(!1)),!0;if(o["background.toggleList"](q))return Pr.size>0&&kr&&(R||v(!0),Qs(!0)),!0}return!1},[se,pe,gc,n,Wu,Ab,Ob,xi,nb,Xi,Gb,R,i.merged.general.debugKeystrokeLogging,Xt,N,ji,p,za,ib,Lu,Pr,kr,Qs,mc,Si,i.merged.general.devtools,Gu,ue,o,t,c.history,No,Q]);ye(NM,{isActive:!0,priority:!0}),ye(q=>o["scroll.up"](q)||o["scroll.down"](q)||o["scroll.pageUp"](q)||o["scroll.pageDown"](q)||o["scroll.home"](q)||o["scroll.end"](q)?!1:(N(!1),Js(),!0),{isActive:P,priority:200}),(0,Y.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let q=Wp({streamingState:fo,thoughtSubject:dc?.subject,isConfirming:!!js||db,isSilentWorking:mb,folderName:Y1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});zi.current!==q&&(zi.current=q,Ft.write(`\x1B]0;${q}\x07`))},[fo,dc,js,db,mb,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,Ft]),(0,Y.useEffect)(()=>{let q=fe=>{let ge;switch(fe.severity){case"error":ge="error";break;case"warning":ge="warning";break;case"info":ge="info";break;default:throw new Error(`Unexpected severity for user feedback: ${fe.severity}`)}c.addItem({type:ge,text:fe.message},Date.now()),fe.error&&ve.warn(`[Feedback Details for "${fe.message}"]`,fe.error)};return Re.on(ze.UserFeedback,q),Re.drainBacklogs(),()=>{Re.off(ze.UserFeedback,q)}},[c]);let qb=e.version.includes("nightly"),Kb=Hu||Hu||Df||kf||H||!!js||!!uc||!!Ou||!!M||$i.length>0||!!Du||ac||gf||Tf||fi||Nr||Va||cc||ic||A||Mf||!!lc||!!Eu||!!Cu||!!_u||bf||Lr==="awaiting_api_key_input"||!!Io,MM=(0,Y.useMemo)(()=>Zm(No),[No]),Vb=$i.length>0,zb=!!Du,hc=MM||!!js||!!uc||Vb||zb||!!lc||!!Eu||!!Cu||!!_u||!!M,$u=i.merged.ui.loadingPhrases,DM=$u==="tips"||$u==="all",LM=$u==="witty"||$u==="all",kM=(!R||kr)&&fo==="responding"&&!hc,qu=0;if(pt.length>0&&i.merged.hooksConfig.notifications){let q=pt.length>1?"Executing Hooks":"Executing Hook",fe=pt.map(ge=>ge.name+(ge.index&&ge.total&&ge.total>1?` (${ge.index}/${ge.total})`:"")).join(", ");qu=q.length+fe.length+10}else kM?qu=(dc?.subject||"Waiting for model...").length+25:hc&&(qu=35);let PM=st-qu-5,{elapsedTime:Yb,currentLoadingPhrase:Xb,currentTip:jb,currentWittyPhrase:Qb}=zI({streamingState:fo,shouldShowFocusHint:TM,retryStatus:bM,showTips:DM,showWit:LM,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:PM}),Bf=n.isPlanEnabled()&&fo==="idle"&&!hc,Jb=BN({config:n,addItem:c.addItem,onApprovalModeChange:xM,isActive:!R,allowPlanMode:Bf});rM({notificationsEnabled:l,isFocused:Uu,hasReceivedFocusEvent:CM,streamingState:fo,hasPendingActionRequired:hc,pendingHistoryItems:No,commandConfirmationRequest:js,authConsentRequest:uc,permissionConfirmationRequest:Ou,hasConfirmUpdateExtensionRequests:Vb,hasLoopDetectionConfirmationRequest:zb});let Zb=wf&&fo==="idle"&&!hc;(0,Y.useEffect)(()=>{za&&!Zb&&Xs(!1)},[za,Zb,Xs]),(0,Y.useEffect)(()=>{if(!le||!n.isModelSteeringEnabled()||fo!=="idle"||!pc||Zm(No))return;let q=Ef();q&&Ya([{text:gd(q)}])},[n,c,le,pc,fo,Ya,Ef,No,hM]);let BM=(0,Y.useMemo)(()=>ep(No),[No]),[eT,FM]=(0,Y.useState)(n.getGeminiMdFileCount());(0,Y.useEffect)(()=>{let q=fe=>{FM(fe.fileCount)};return Re.on(ze.MemoryChanged,q),()=>{Re.off(ze.MemoryChanged,q)}},[]),(0,Y.useEffect)(()=>{let q=!0;return(async()=>{let[ge,Ve]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);q&&(qa(ge),Kt(Ve),pr(!0))})(),()=>{q=!1}},[n,Xt]);let UM=(0,Y.useMemo)(()=>({history:c.history,historyManager:c,isThemeDialogOpen:ac,themeError:O,isAuthenticating:Va,isConfigInitialized:le,authError:My,accountSuspensionInfo:ky,isAuthDialogOpen:cc,isAwaitingApiKeyInput:Lr==="awaiting_api_key_input",apiKeyDefaultValue:Dy,editorError:_y,isEditorDialogOpen:ic,showPrivacyNotice:A,corgiMode:g,debugMessage:b,quittingMessages:x,isSettingsDialogOpen:gf,isSessionBrowserOpen:bf,isModelDialogOpen:Tf,isAgentConfigDialogOpen:fi,selectedAgentName:Ks,selectedAgentDisplayName:hr,selectedAgentDefinition:Ki,isPermissionsDialogOpen:Nr,permissionsDialogProps:Ws,slashCommands:Au,pendingSlashCommandHistoryItems:Iu,commandContext:Zy,commandConfirmationRequest:js,authConsentRequest:uc,confirmUpdateExtensionRequests:$i,loopDetectionConfirmationRequest:Du,permissionConfirmationRequest:Ou,geminiMdFileCount:eT,streamingState:fo,initError:Cf,pendingGeminiHistoryItems:Mu,thought:dc,shellModeActive:j,userMessages:_e,buffer:Ti,inputWidth:$n,suggestionsWidth:Dr,isInputActive:wf,isResuming:yf,shouldShowIdePrompt:Hu,isFolderTrustDialogOpen:Df??!1,folderDiscoveryResults:Lb,isPolicyUpdateDialogOpen:kf,policyUpdateConfirmationRequest:Lf,isTrustedFolder:lt,constrainHeight:se,showErrorDetails:Gu,showFullTodos:_b,ideContextState:Wu,renderMarkdown:vb,ctrlCPressedOnce:wb>=1,ctrlDPressedOnce:Ib>=1,showEscapePrompt:Mb,shortcutsHelpVisible:za,cleanUiDetailsVisible:Ru,isFocused:Uu,elapsedTime:Yb,currentLoadingPhrase:Xb,currentTip:jb,currentWittyPhrase:Qb,historyRemountKey:Ae,activeHooks:pt,messageQueue:ku,queueErrorMessage:xn,showApprovalModeIndicator:Jb,allowPlanMode:Bf,currentModel:yr,quota:{userTier:Vi,stats:W,proQuotaRequest:lc,validationRequest:Eu,overageMenuRequest:Cu,emptyWalletRequest:_u},contextFileNames:Sb,errorCount:br,availableTerminalHeight:If,stableControlsHeight:Af,mainAreaWidth:vn,staticAreaMaxItemHeight:Yi,staticExtraHeight:Wn,dialogsVisible:Kb,pendingHistoryItems:No,nightly:qb,branchName:Ut,sessionStats:ft,terminalWidth:st,terminalHeight:nt,mainControlsRef:xb,rootUiRef:_n,currentIDE:Nf,updateInfo:Ee,showIdeRestartPrompt:Mf,ideTrustRestartReason:Ub,isRestarting:Pb,extensionsUpdateState:Cn,activePtyId:Xi,backgroundTaskCount:vf,isBackgroundTaskVisible:kr,embeddedShellFocused:R,showDebugProfiler:D,customDialog:M,copyModeEnabled:P,transientMessage:Db,bannerData:fr,bannerVisible:En,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:it,backgroundTasks:Pr,activeBackgroundTaskPid:ab,backgroundTaskHeight:Rf,isBackgroundTaskListOpen:lb,adminSettingsChanged:H,newAgents:Io,showIsExpandableHint:Ct,hintMode:n.isModelSteeringEnabled()&&Jm(No),hintBuffer:""}),[ac,O,Va,le,My,ky,cc,_y,ic,A,g,b,x,gf,bf,Tf,fi,Ks,hr,Ki,Nr,Ws,Au,Iu,Zy,js,uc,$i,Du,Ou,eT,fo,Cf,Mu,dc,j,_e,Ti,$n,Dr,wf,yf,Hu,Df,Lb,kf,Lf,lt,se,Gu,_b,Wu,vb,wb,Ib,Mb,za,Ru,Uu,Yb,Xb,jb,Qb,Ae,pt,ku,xn,Jb,Bf,Vi,W,lc,Eu,Cu,_u,Sb,br,If,Af,vn,Yi,Wn,Kb,No,qb,Ut,ft,st,nt,xb,_n,Nf,Ee,Mf,Ub,Pb,yr,Cn,Xi,vf,kr,c,R,D,M,Dy,Lr,P,Db,fr,En,n,it,Rf,lb,ab,Pr,H,Io,Ct]),tT=(0,Y.useCallback)(()=>S(!1),[S]),HM=(0,Y.useMemo)(()=>({handleThemeSelect:hf,closeThemeDialog:Oy,handleThemeHighlight:Ny,handleAuthSelect:Vy,setAuthState:$o,onAuthError:qn,handleEditorSelect:vy,exitEditorDialog:Ry,exitPrivacyNotice:tT,closeSettingsDialog:Ay,closeModelDialog:jy,openAgentConfigDialog:hi,closeAgentConfigDialog:Mr,openPermissionsDialog:pi,closePermissionsDialog:gr,setShellModeActive:ee,vimHandleInput:bb,handleIdePromptComplete:$b,handleFolderTrustSelect:kb,setIsPolicyUpdateDialogOpen:Bb,setConstrainHeight:pe,onEscapePromptChange:Wb,refreshStatic:Xt,handleFinalSubmit:fc,handleClearScreen:yb,handleProQuotaChoice:Fy,handleValidationChoice:Uy,handleOverageMenuChoice:Hy,handleEmptyWalletChoice:Gy,openSessionBrowser:vu,closeSessionBrowser:Wy,handleResumeSession:$y,handleDeleteSession:Ky,setQueueErrorMessage:ro,addMessage:Pu,popAllMessages:gb,handleApiKeySubmit:zy,handleApiKeyCancel:Yy,setBannerVisible:pr,setShortcutsHelpVisible:Xs,setCleanUiDetailsVisible:Qy,toggleCleanUiDetailsVisible:Jy,revealCleanUiDetailsTemporarily:wu,handleWarning:Pf,setEmbeddedShellFocused:v,dismissBackgroundTask:sb,setActiveBackgroundTaskPid:cb,setIsBackgroundTaskListOpen:Qs,setAuthContext:Ys,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(Ey.send){let q=n.getRemoteAdminSettings();q&&Ey.send({type:"admin-settings-update",settings:q})}await rn()},handleNewAgentsSelect:async q=>{if(Io&&q==="acknowledge"){let fe=n.getAgentRegistry();try{await Promise.all(Io.map(ge=>fe.acknowledgeAgent(ge)))}catch(ge){ve.error("Failed to acknowledge agents:",ge),c.addItem({type:"error",text:`Failed to acknowledge agents: ${Tr(ge)}`},Date.now())}}Jo(null)},getPreferredEditor:bi,clearAccountSuspension:()=>{Py(null),$o("updating")}}),[hf,Oy,Ny,Vy,$o,qn,vy,Ry,tT,Ay,jy,hi,Mr,pi,gr,ee,bb,$b,kb,Bb,pe,Wb,Xt,fc,yb,Fy,Uy,Hy,Gy,vu,Wy,$y,Ky,ro,Pu,gb,zy,Yy,pr,Xs,Qy,Jy,wu,Pf,v,sb,cb,Qs,Ys,Py,Io,n,c,bi]);return Lr==="awaiting_google_login_restart"?(0,Wi.jsx)(zN,{onDismiss:()=>{Ys({}),$o("updating")},config:n}):(0,Wi.jsx)(vd.Provider,{value:UM,children:(0,Wi.jsx)(zg.Provider,{value:HM,children:(0,Wi.jsx)(cl.Provider,{value:n,children:(0,Wi.jsx)(lh.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Wi.jsx)(fv,{config:n,toolCalls:BM,isExpanded:$,toggleExpansion:oe,toggleAllExpansion:Q,children:(0,Wi.jsx)(Nh.Provider,{value:Uu,children:(0,Wi.jsx)(uI,{},`app-${y}`)})})})})})})};var Hn=E(L(),1);var J1=200;async function hae(e,t,o,n=process.cwd(),r,s){Jw();let i=sd(Pd(e),e.getScreenReader()),a=i;a&&(Js(),rs(()=>{Zs()}));let{matchers:l,errors:c}=await XS();c.forEach(x=>{Re.emitFeedback("warning",x)});let p=await xx();Z1(Q1(n),t);let g=new ES({onNewMessage:x=>{Re.emitConsoleLog(x.type,x.content)},debugMode:e.getDebugMode()});g.patch(),rs(g.cleanup);let{stdout:f,stderr:y}=qT(),h=!!process.env.SHPOOL_SESSION_NAME,b=()=>(_p(),(0,Hn.jsx)(VS.Provider,{value:t,children:(0,Hn.jsx)(jS,{value:l,children:(0,Hn.jsx)(zS,{config:e,children:(0,Hn.jsx)(U_,{mouseEventsEnabled:a,children:(0,Hn.jsx)(fI,{children:(0,Hn.jsx)(K_,{children:(0,Hn.jsx)(bl,{children:(0,Hn.jsx)(rR,{children:(0,Hn.jsx)(bE,{children:(0,Hn.jsx)(aM,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:s})})})})})})})})})}));h&&await new Promise(x=>setTimeout(x,100));let T=BS(process.env.DEBUG?(0,Hn.jsx)(lM.default.StrictMode,{children:(0,Hn.jsx)(b,{})}):(0,Hn.jsx)(b,{}),{stdout:f,stderr:y,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:x})=>{x>J1&&BT(e,x),yE.reportFrameRendered()},patchConsole:!1,alternateBuffer:i,incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(Qa(),rs(()=>{rd()})),LN(t).then(x=>{RE(x,t,e.getProjectRoot())}).catch(x=>{e.getDebugMode()&&ve.warn("Update check failed:",x)}),rs(()=>T.unmount()),rs(hS())}function Z1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Wp({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Kn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Kn("\x1B]0;\x07")})}}export{hae as startInteractiveUI};
|
|
119
|
+
${Ve}`:Ve,pb()),ge&&Ti.setText(ge)},[Ti,_e,fb,pb,No]);let hb=(0,Y.useCallback)(q=>{let fe=q.trim();fe&&(n.injectionService.addInjection(fe,"user_steering"),c.addItem({type:"hint",text:fe}))},[n,c]),fc=(0,Y.useCallback)(async q=>{a(),ue(null),se||(pe(!0),p||Xt());let fe=on(q.trim()),ge=fo==="idle",Ve=fo==="responding"||Jm(No);if(fe&&Ve){let{commandToExecute:Qi}=rl(q,Au??[]);if(Qi?.isSafeConcurrent){xi(q),qe(q);return}}if(n.isModelSteeringEnabled()&&Ve&&!fe){hb(q),qe(q);return}let Mo=le&&pc;if(fe&&le||ge&&Mo){if(!fe){let Qi=await vS(q,n);if(Qi.length>0){tb({files:Qi,onComplete:GM=>{tb(null),GM.allowed&&Qi.forEach(WM=>n.getWorkspaceContext().addReadOnlyPath(WM)),Ya(q)}}),qe(q);return}}Ya(q)}else ge&&!Mo&&ku.length===0&&Re.emitFeedback("info",le?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),Pu(q);qe(q)},[Pu,qe,Ya,xi,Au,pc,fo,ku.length,No,n,se,pe,p,Xt,a,hb,le,ue]),yb=(0,Y.useCallback)(()=>{a(),ue(null),c.clearItems(),zs(),Xt()},[c,zs,Xt,a,ue]),{handleInput:bb}=KI(Ti,fc),wf=!Cf&&!C&&!yf&&(fo==="idle"||fo==="responding"||fo==="waiting_for_confirmation")&&!lc&&!P,Bu=(0,Y.useRef)(null),[Fu,SM]=(0,Y.useState)(0),[Tb,EM]=(0,Y.useState)(0);(0,Y.useLayoutEffect)(()=>{!P&&Fu>0&&EM(Fu)},[P,Fu]);let Af=P&&Tb>0?Tb:Fu,xb=(0,Y.useCallback)(q=>{if(Bu.current&&(Bu.current.disconnect(),Bu.current=null),q){let fe=new nn(ge=>{let Ve=ge[0];if(Ve){let Mo=Math.round(Ve.contentRect.height);SM(Qi=>Mo!==Qi?Mo:Qi)}});fe.observe(q),Bu.current=fe}},[]),If=Math.max(0,nt-Af-Rf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(st*X1),terminalHeight:Math.max(Math.floor(If-j1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Uu,hasReceivedFocusEvent:CM}=KS(),Sb=(0,Y.useMemo)(()=>{let q=i.merged.context.fileName;return q?Array.isArray(q)?q:[q]:IT()},[i.merged.context.fileName]),Of=(0,Y.useMemo)(()=>n.getQuestion(),[n]),Eb=(0,Y.useRef)(!1),Cb=n.getGeminiClient();(0,Y.useEffect)(()=>{Of&&le&&!Eb.current&&!Va&&!cc&&!ac&&!ic&&!A&&Cb?.isInitialized?.()&&(fc(Of),Eb.current=!0)},[Of,le,fc,Va,cc,ac,ic,A,Cb]);let[_M,vM]=(0,Y.useState)(!1),[Nf,RM]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{(async()=>{let ge=(await es.getInstance()).getCurrentIde();RM(ge||null)})()},[]);let Hu=!!(Nf&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!_M),[Gu,gc]=(0,Y.useState)(!1),[_b,wM]=(0,Y.useState)(!1),[vb,AM]=(0,Y.useState)(!0),Rb=(0,Y.useCallback)(q=>{q>2&&PT(n),q>1&&xi("/quit",void 0,void 0,!1)},[n,xi]),{pressCount:wb,handlePress:Ab}=$l({windowMs:Ci,onRepeat:Rb}),{pressCount:Ib,handlePress:Ob}=$l({windowMs:Ci,onRepeat:Rb}),[Wu,Nb]=(0,Y.useState)(),[Mb,IM]=(0,Y.useState)(!1),[Mf,OM]=(0,Y.useState)(!1),[Db,Si]=df(Ci),{isFolderTrustDialogOpen:Df,discoveryResults:Lb,handleFolderTrustSelect:kb,isRestarting:Pb}=jI(i,tt,c.addItem),Lf=n.getPolicyUpdateConfirmationRequest(),[kf,Bb]=(0,Y.useState)(!!Lf),{needsRestart:Fb,restartReason:Ub}=dE(),Hb=(0,Y.useRef)(!0);WN(n,lt,c,k);let ji=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let q=Ve=>{Si({text:Ve.message,type:Ve.type})},fe=()=>{Si({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},ge=()=>{Si({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Lo.on("transient-message",q),Lo.on("selection-warning",fe),Lo.on("paste-timeout",ge),()=>{Lo.off("transient-message",q),Lo.off("selection-warning",fe),Lo.off("paste-timeout",ge),ji.current&&clearTimeout(ji.current)}},[Si]);let Pf=(0,Y.useCallback)(q=>{Si({text:q,type:"warning"})},[Si]),{handleSuspend:Gb}=jN({handleWarning:Pf,setRawMode:yt,refreshStatic:Xt,setForceRerenderKey:h,shouldUseAlternateScreen:pf});(0,Y.useEffect)(()=>{Fb&&OM(!0)},[Fb]),(0,Y.useEffect)(()=>{if(Hb.current){Hb.current=!1;return}let q=setTimeout(()=>{Xt()},300);return()=>{clearTimeout(q)}},[st,Xt]),(0,Y.useEffect)(()=>{let q=Yf.subscribe(Nb);return Nb(Yf.get()),q},[]),(0,Y.useEffect)(()=>{let q=()=>{gc(!0),pe(!1)};return Lo.on("open-debug-console",q),()=>{Lo.off("open-debug-console",q)}},[n]);let Wb=(0,Y.useCallback)(q=>{IM(q)},[]),$b=(0,Y.useCallback)(q=>{q.userSelection==="yes"?(xi("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):q.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),vM(!0)},[xi,i]),NM=(0,Y.useCallback)(q=>{if(i.merged.general.debugKeystrokeLogging&&ve.log("[DEBUG] Keystroke:",JSON.stringify(q)),za&&t(q)&&Xs(!1),p&&o["app.toggleCopyMode"](q))return N(!0),Zs(),!0;if(o["basic.quit"](q))return nb?.(),Ab(),!0;if(o["basic.exit"](q))return mf.current.text.length>0?!1:(Ob(),!0);if(o["app.suspend"](q))Gb();else if(o["app.toggleCopyMode"](q)&&!p)return Si({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0;let fe=()=>{ue(!0);let Ve=PR(c.history,No);Ve.length>0&&Q(Ve)},ge=!1;if(se||(ge=!0,pe(!0),o["app.showMoreLines"](q)&&fe(),p||Xt()),o["app.showErrorDetails"](q))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:Ve}=await import("./devtoolsService-LHW3U2EN.js");await Ve(n,Gu,()=>gc(Mo=>!Mo),()=>gc(!0))})():gc(Ve=>!Ve),!0;if(o["app.showFullTodos"](q))return wM(Ve=>!Ve),!0;if(o["app.toggleMarkdown"](q))return AM(Ve=>{let Mo=!Ve;return Xt(),Mo}),!0;if(o["app.showIdeContextDetail"](q)&&n.getIdeMode()&&Wu)return xi("/ide status"),!0;if(o["app.showMoreLines"](q)&&!ge)return pe(!1),fe(),Xt(),!0;if((o["app.focusShellInput"](q)||o["background.unfocusList"](q))&&(Xi||kr&&Pr.size>0)){if(R){let Mo=mc.current;return ji.current&&clearTimeout(ji.current),ji.current=setTimeout(()=>{mc.current===Mo?v(!1):Si({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-mc.current>=100&&!Xi&&!kr?(ji.current&&clearTimeout(ji.current),Lu(),v(!0),Pr.size>1&&Qs(!0),!0):(v(!0),!0)}else{if(o["app.unfocusShellInput"](q)||o["background.unfocus"](q))return R?(v(!1),!0):!1;if(o["background.toggle"](q))return Xi?ib():(Lu(),!kr&&Pr.size>0?(v(!0),Pr.size>1&&Qs(!0)):v(!1)),!0;if(o["background.toggleList"](q))return Pr.size>0&&kr&&(R||v(!0),Qs(!0)),!0}return!1},[se,pe,gc,n,Wu,Ab,Ob,xi,nb,Xi,Gb,R,i.merged.general.debugKeystrokeLogging,Xt,N,ji,p,za,ib,Lu,Pr,kr,Qs,mc,Si,i.merged.general.devtools,Gu,ue,o,t,c.history,No,Q]);ye(NM,{isActive:!0,priority:!0}),ye(q=>o["scroll.up"](q)||o["scroll.down"](q)||o["scroll.pageUp"](q)||o["scroll.pageDown"](q)||o["scroll.home"](q)||o["scroll.end"](q)?!1:(N(!1),Js(),!0),{isActive:P,priority:200}),(0,Y.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let q=Wp({streamingState:fo,thoughtSubject:dc?.subject,isConfirming:!!js||db,isSilentWorking:mb,folderName:Y1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});zi.current!==q&&(zi.current=q,Ft.write(`\x1B]0;${q}\x07`))},[fo,dc,js,db,mb,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,Ft]),(0,Y.useEffect)(()=>{let q=fe=>{let ge;switch(fe.severity){case"error":ge="error";break;case"warning":ge="warning";break;case"info":ge="info";break;default:throw new Error(`Unexpected severity for user feedback: ${fe.severity}`)}c.addItem({type:ge,text:fe.message},Date.now()),fe.error&&ve.warn(`[Feedback Details for "${fe.message}"]`,fe.error)};return Re.on(ze.UserFeedback,q),Re.drainBacklogs(),()=>{Re.off(ze.UserFeedback,q)}},[c]);let qb=e.version.includes("nightly"),Kb=Hu||Hu||Df||kf||H||!!js||!!uc||!!Ou||!!M||$i.length>0||!!Du||ac||gf||Tf||fi||Nr||Va||cc||ic||A||Mf||!!lc||!!Eu||!!Cu||!!_u||bf||Lr==="awaiting_api_key_input"||!!Io,MM=(0,Y.useMemo)(()=>Zm(No),[No]),Vb=$i.length>0,zb=!!Du,hc=MM||!!js||!!uc||Vb||zb||!!lc||!!Eu||!!Cu||!!_u||!!M,$u=i.merged.ui.loadingPhrases,DM=$u==="tips"||$u==="all",LM=$u==="witty"||$u==="all",kM=(!R||kr)&&fo==="responding"&&!hc,qu=0;if(pt.length>0&&i.merged.hooksConfig.notifications){let q=pt.length>1?"Executing Hooks":"Executing Hook",fe=pt.map(ge=>ge.name+(ge.index&&ge.total&&ge.total>1?` (${ge.index}/${ge.total})`:"")).join(", ");qu=q.length+fe.length+10}else kM?qu=(dc?.subject||"Waiting for model...").length+25:hc&&(qu=35);let PM=st-qu-5,{elapsedTime:Yb,currentLoadingPhrase:Xb,currentTip:jb,currentWittyPhrase:Qb}=zI({streamingState:fo,shouldShowFocusHint:TM,retryStatus:bM,showTips:DM,showWit:LM,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:PM}),Bf=n.isPlanEnabled()&&fo==="idle"&&!hc,Jb=BN({config:n,addItem:c.addItem,onApprovalModeChange:xM,isActive:!R,allowPlanMode:Bf});rM({notificationsEnabled:l,isFocused:Uu,hasReceivedFocusEvent:CM,streamingState:fo,hasPendingActionRequired:hc,pendingHistoryItems:No,commandConfirmationRequest:js,authConsentRequest:uc,permissionConfirmationRequest:Ou,hasConfirmUpdateExtensionRequests:Vb,hasLoopDetectionConfirmationRequest:zb});let Zb=wf&&fo==="idle"&&!hc;(0,Y.useEffect)(()=>{za&&!Zb&&Xs(!1)},[za,Zb,Xs]),(0,Y.useEffect)(()=>{if(!le||!n.isModelSteeringEnabled()||fo!=="idle"||!pc||Zm(No))return;let q=Ef();q&&Ya([{text:gd(q)}])},[n,c,le,pc,fo,Ya,Ef,No,hM]);let BM=(0,Y.useMemo)(()=>ep(No),[No]),[eT,FM]=(0,Y.useState)(n.getGeminiMdFileCount());(0,Y.useEffect)(()=>{let q=fe=>{FM(fe.fileCount)};return Re.on(ze.MemoryChanged,q),()=>{Re.off(ze.MemoryChanged,q)}},[]),(0,Y.useEffect)(()=>{let q=!0;return(async()=>{let[ge,Ve]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);q&&(qa(ge),Kt(Ve),pr(!0))})(),()=>{q=!1}},[n,Xt]);let UM=(0,Y.useMemo)(()=>({history:c.history,historyManager:c,isThemeDialogOpen:ac,themeError:O,isAuthenticating:Va,isConfigInitialized:le,authError:My,accountSuspensionInfo:ky,isAuthDialogOpen:cc,isAwaitingApiKeyInput:Lr==="awaiting_api_key_input",apiKeyDefaultValue:Dy,editorError:_y,isEditorDialogOpen:ic,showPrivacyNotice:A,corgiMode:g,debugMessage:b,quittingMessages:x,isSettingsDialogOpen:gf,isSessionBrowserOpen:bf,isModelDialogOpen:Tf,isAgentConfigDialogOpen:fi,selectedAgentName:Ks,selectedAgentDisplayName:hr,selectedAgentDefinition:Ki,isPermissionsDialogOpen:Nr,permissionsDialogProps:Ws,slashCommands:Au,pendingSlashCommandHistoryItems:Iu,commandContext:Zy,commandConfirmationRequest:js,authConsentRequest:uc,confirmUpdateExtensionRequests:$i,loopDetectionConfirmationRequest:Du,permissionConfirmationRequest:Ou,geminiMdFileCount:eT,streamingState:fo,initError:Cf,pendingGeminiHistoryItems:Mu,thought:dc,shellModeActive:j,userMessages:_e,buffer:Ti,inputWidth:$n,suggestionsWidth:Dr,isInputActive:wf,isResuming:yf,shouldShowIdePrompt:Hu,isFolderTrustDialogOpen:Df??!1,folderDiscoveryResults:Lb,isPolicyUpdateDialogOpen:kf,policyUpdateConfirmationRequest:Lf,isTrustedFolder:lt,constrainHeight:se,showErrorDetails:Gu,showFullTodos:_b,ideContextState:Wu,renderMarkdown:vb,ctrlCPressedOnce:wb>=1,ctrlDPressedOnce:Ib>=1,showEscapePrompt:Mb,shortcutsHelpVisible:za,cleanUiDetailsVisible:Ru,isFocused:Uu,elapsedTime:Yb,currentLoadingPhrase:Xb,currentTip:jb,currentWittyPhrase:Qb,historyRemountKey:Ae,activeHooks:pt,messageQueue:ku,queueErrorMessage:xn,showApprovalModeIndicator:Jb,allowPlanMode:Bf,currentModel:yr,quota:{userTier:Vi,stats:W,proQuotaRequest:lc,validationRequest:Eu,overageMenuRequest:Cu,emptyWalletRequest:_u},contextFileNames:Sb,errorCount:br,availableTerminalHeight:If,stableControlsHeight:Af,mainAreaWidth:vn,staticAreaMaxItemHeight:Yi,staticExtraHeight:Wn,dialogsVisible:Kb,pendingHistoryItems:No,nightly:qb,branchName:Ut,sessionStats:ft,terminalWidth:st,terminalHeight:nt,mainControlsRef:xb,rootUiRef:_n,currentIDE:Nf,updateInfo:Ee,showIdeRestartPrompt:Mf,ideTrustRestartReason:Ub,isRestarting:Pb,extensionsUpdateState:Cn,activePtyId:Xi,backgroundTaskCount:vf,isBackgroundTaskVisible:kr,embeddedShellFocused:R,showDebugProfiler:D,customDialog:M,copyModeEnabled:P,transientMessage:Db,bannerData:fr,bannerVisible:En,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:it,backgroundTasks:Pr,activeBackgroundTaskPid:ab,backgroundTaskHeight:Rf,isBackgroundTaskListOpen:lb,adminSettingsChanged:H,newAgents:Io,showIsExpandableHint:Ct,hintMode:n.isModelSteeringEnabled()&&Jm(No),hintBuffer:""}),[ac,O,Va,le,My,ky,cc,_y,ic,A,g,b,x,gf,bf,Tf,fi,Ks,hr,Ki,Nr,Ws,Au,Iu,Zy,js,uc,$i,Du,Ou,eT,fo,Cf,Mu,dc,j,_e,Ti,$n,Dr,wf,yf,Hu,Df,Lb,kf,Lf,lt,se,Gu,_b,Wu,vb,wb,Ib,Mb,za,Ru,Uu,Yb,Xb,jb,Qb,Ae,pt,ku,xn,Jb,Bf,Vi,W,lc,Eu,Cu,_u,Sb,br,If,Af,vn,Yi,Wn,Kb,No,qb,Ut,ft,st,nt,xb,_n,Nf,Ee,Mf,Ub,Pb,yr,Cn,Xi,vf,kr,c,R,D,M,Dy,Lr,P,Db,fr,En,n,it,Rf,lb,ab,Pr,H,Io,Ct]),tT=(0,Y.useCallback)(()=>S(!1),[S]),HM=(0,Y.useMemo)(()=>({handleThemeSelect:hf,closeThemeDialog:Oy,handleThemeHighlight:Ny,handleAuthSelect:Vy,setAuthState:$o,onAuthError:qn,handleEditorSelect:vy,exitEditorDialog:Ry,exitPrivacyNotice:tT,closeSettingsDialog:Ay,closeModelDialog:jy,openAgentConfigDialog:hi,closeAgentConfigDialog:Mr,openPermissionsDialog:pi,closePermissionsDialog:gr,setShellModeActive:ee,vimHandleInput:bb,handleIdePromptComplete:$b,handleFolderTrustSelect:kb,setIsPolicyUpdateDialogOpen:Bb,setConstrainHeight:pe,onEscapePromptChange:Wb,refreshStatic:Xt,handleFinalSubmit:fc,handleClearScreen:yb,handleProQuotaChoice:Fy,handleValidationChoice:Uy,handleOverageMenuChoice:Hy,handleEmptyWalletChoice:Gy,openSessionBrowser:vu,closeSessionBrowser:Wy,handleResumeSession:$y,handleDeleteSession:Ky,setQueueErrorMessage:ro,addMessage:Pu,popAllMessages:gb,handleApiKeySubmit:zy,handleApiKeyCancel:Yy,setBannerVisible:pr,setShortcutsHelpVisible:Xs,setCleanUiDetailsVisible:Qy,toggleCleanUiDetailsVisible:Jy,revealCleanUiDetailsTemporarily:wu,handleWarning:Pf,setEmbeddedShellFocused:v,dismissBackgroundTask:sb,setActiveBackgroundTaskPid:cb,setIsBackgroundTaskListOpen:Qs,setAuthContext:Ys,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(Ey.send){let q=n.getRemoteAdminSettings();q&&Ey.send({type:"admin-settings-update",settings:q})}await rn()},handleNewAgentsSelect:async q=>{if(Io&&q==="acknowledge"){let fe=n.getAgentRegistry();try{await Promise.all(Io.map(ge=>fe.acknowledgeAgent(ge)))}catch(ge){ve.error("Failed to acknowledge agents:",ge),c.addItem({type:"error",text:`Failed to acknowledge agents: ${Tr(ge)}`},Date.now())}}Jo(null)},getPreferredEditor:bi,clearAccountSuspension:()=>{Py(null),$o("updating")}}),[hf,Oy,Ny,Vy,$o,qn,vy,Ry,tT,Ay,jy,hi,Mr,pi,gr,ee,bb,$b,kb,Bb,pe,Wb,Xt,fc,yb,Fy,Uy,Hy,Gy,vu,Wy,$y,Ky,ro,Pu,gb,zy,Yy,pr,Xs,Qy,Jy,wu,Pf,v,sb,cb,Qs,Ys,Py,Io,n,c,bi]);return Lr==="awaiting_google_login_restart"?(0,Wi.jsx)(zN,{onDismiss:()=>{Ys({}),$o("updating")},config:n}):(0,Wi.jsx)(vd.Provider,{value:UM,children:(0,Wi.jsx)(zg.Provider,{value:HM,children:(0,Wi.jsx)(cl.Provider,{value:n,children:(0,Wi.jsx)(lh.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Wi.jsx)(fv,{config:n,toolCalls:BM,isExpanded:$,toggleExpansion:oe,toggleAllExpansion:Q,children:(0,Wi.jsx)(Nh.Provider,{value:Uu,children:(0,Wi.jsx)(uI,{},`app-${y}`)})})})})})})};var Hn=E(L(),1);var J1=200;async function hae(e,t,o,n=process.cwd(),r,s){Jw();let i=sd(Pd(e),e.getScreenReader()),a=i;a&&(Js(),rs(()=>{Zs()}));let{matchers:l,errors:c}=await XS();c.forEach(x=>{Re.emitFeedback("warning",x)});let p=await xx();Z1(Q1(n),t);let g=new ES({onNewMessage:x=>{Re.emitConsoleLog(x.type,x.content)},debugMode:e.getDebugMode()});g.patch(),rs(g.cleanup);let{stdout:f,stderr:y}=qT(),h=!!process.env.SHPOOL_SESSION_NAME,b=()=>(_p(),(0,Hn.jsx)(VS.Provider,{value:t,children:(0,Hn.jsx)(jS,{value:l,children:(0,Hn.jsx)(zS,{config:e,children:(0,Hn.jsx)(U_,{mouseEventsEnabled:a,children:(0,Hn.jsx)(fI,{children:(0,Hn.jsx)(K_,{children:(0,Hn.jsx)(bl,{children:(0,Hn.jsx)(rR,{children:(0,Hn.jsx)(bE,{children:(0,Hn.jsx)(aM,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:s})})})})})})})})})}));h&&await new Promise(x=>setTimeout(x,100));let T=BS(process.env.DEBUG?(0,Hn.jsx)(lM.default.StrictMode,{children:(0,Hn.jsx)(b,{})}):(0,Hn.jsx)(b,{}),{stdout:f,stderr:y,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:x})=>{x>J1&&BT(e,x),yE.reportFrameRendered()},patchConsole:!1,alternateBuffer:i,incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(Qa(),rs(()=>{rd()})),LN(t).then(x=>{RE(x,t,e.getProjectRoot())}).catch(x=>{e.getDebugMode()&&ve.warn("Update check failed:",x)}),rs(()=>T.unmount()),rs(hS())}function Z1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Wp({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Kn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Kn("\x1B]0;\x07")})}}export{hae as startInteractiveUI};
|
|
120
120
|
/**
|
|
121
121
|
* @license
|
|
122
122
|
* Copyright 2025 Google LLC
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
|
-
import{$a as mS,$b as ze,$c as Rd,A as Vx,Aa as sS,Ab as Qo,Ac as yd,B as zx,Ba as za,Bb as _S,Bc as Te,C as Lr,Ca as Ze,Cb as vS,Cc as ZS,Db as RS,Dc as eE,E as Xi,Eb as wo,Ec as tE,F as yi,Fb as Zi,Fc as bd,G as Yx,Gb as wS,Gc as Td,H as Js,Ha as aS,Hb as es,Hc as xd,I as Yt,Ib as xn,Ic as Sd,J as ud,Jb as d,Jc as oE,K as kt,Kb as AS,Kc as nE,L as Qn,Lb as IS,Lc as Ed,M as Xt,Mb as Jf,Mc as Cd,N as Vf,Nb as OS,Nc as oa,O as Gn,Ob as NS,Oc as _d,P as Xx,Pb as MS,Pc as tg,Q as te,Qa as lS,Qb as DS,Qc as rE,R as ji,Rb as Ve,Rc as iE,S as jx,Sb as gd,Sc as el,Tb as L,Tc as vd,Ub as LS,Uc as sE,V as Qx,Vb as he,Vc as Sn,W as Jx,Wb as Tt,Wc as Ec,X as zf,Xa as cS,Xb as xc,Xc as aE,Ya as uS,Yb as kS,Yc as lE,Z as Zx,Za as Yf,Zb as PS,Zc as Io,_a as dS,_b as BS,_c as cE,aa as eS,ab as pS,ac as hd,ad as uE,b as js,ba as tS,bb as fS,bc as qe,bd as dE,c as Mx,cb as jo,cc as FS,cd as mE,d as Mr,da as bi,db as Xf,dc as Zf,e as hc,ea as oS,eb as Ya,ec as US,ed as wd,f as hi,fb as gS,fc as HS,fd as pE,g as Dx,gb as hS,gc as GS,gd as fE,h as qf,hb as pd,hc as WS,i as Lx,ia as Qi,ib as yS,ic as $S,id as Jo,j as kx,jb as Pr,jc as qS,jd as Ad,k as Px,kb as Xa,kc as KS,kd as wt,l as Bx,lb as bS,lc as VS,m as Dr,ma as kr,mb as Tc,mc as Ja,n as Fx,nb as Ji,nc as Zs,o as Ux,oa as nS,ob as ja,oc as zS,p as Hx,pb as fd,pc as eg,q as Kf,qa as dd,qb as TS,qc as YS,r as yc,rb as jf,rc as ea,s as Gx,sb as xS,sc as ta,t as Wx,tb as Qf,tc as Sc,u as $x,ub as SS,uc as XS,v as qx,va as rS,vb as ES,vc as jS,w as Kx,wb as Qa,wc as Za,x as Qs,xb as CS,xc as xt,y as bc,ya as md,yb as m,yc as QS,za as iS,zb as u,zc as JS}from"./chunk-OQXPTUY4.js";import{Ad as KT,Be as ZT,Bm as cd,Cb as OT,Cd as VT,Ck as xx,Cm as Xs,Ec as Zu,Ed as zT,El as Ex,Ff as zi,Fl as Cx,Fm as wx,Gf as qa,Gg as nd,Gm as $f,Hc as PT,Hf as Ka,Hl as _x,Id as YT,Ih as Xo,Im as Ax,Jf as nx,Jk as ad,K as xT,Kb as Pf,Ke as zs,Kf as rx,Km as Ix,Lb as Bf,M as Ku,Me as ex,Mf as ix,Mm as Ox,N as Vu,Qb as NT,Qg as ux,S as Lf,Sa as _T,Sc as BT,Sg as dx,Sh as Ys,Si as Gf,Ta as vT,Tg as mx,Ua as RT,Uc as Ff,Ug as px,Ui as Tx,Vc as FT,Wc as UT,Wg as jn,Wh as to,Xb as MT,Xf as sx,Yc as HT,Yk as Sx,Zc as GT,_c as WT,_j as Va,ad as $T,af as gc,be as ed,bf as tx,bm as vx,cf as td,de as XT,fe as jT,ff as od,fh as fx,gc as Hn,gf as ox,gg as ax,gn as Nx,ia as Yu,ja as Xu,jc as DT,jk as Wf,kj as rd,lc as Ks,mc as Vs,mm as Rx,ob as wT,oe as QT,pb as AT,pi as gx,qf as Hf,ri as hx,sb as IT,sg as lx,si as yx,tc as ju,uc as $a,ui as Yi,vc as Qu,ve as Uf,vk as sd,wc as LT,wd as Vi,wi as bx,x as TT,xc as Ju,xm as ld,yc as kT,yd as qT,ye as JT,zb as kf,zg as cx}from"./chunk-SHBVCB2A.js";import{$ as Jb,Aa as dc,Ba as mc,Bd as bT,Ca as Ki,Da as pc,Ea as nT,Fa as Uu,Ga as fc,Gd as zu,Id as gr,L as Yb,Pa as Rt,R as Xb,Ra as Hu,S as jb,T as cc,U as Bu,V as Qb,Vd as ST,W as Fu,Wa as Gu,Xb as Wu,Xd as ET,Ya as rT,Zd as CT,_c as Df,b as _e,ba as Zb,be as ve,da as eT,ea as tT,ga as oT,gd as cT,hd as uT,j as zb,jd as dT,kd as mT,ld as pT,mc as $u,md as fT,nc as qu,nd as gT,oc as sT,od as hT,pa as Wa,pc as aT,pd as yT,qc as lT,t as Fo,te as id,wa as Of,wb as iT,xa as Nf,ya as Mf,za as uc}from"./chunk-VEQE4EAQ.js";import"./chunk-TWIC4BKL.js";import{c as Ao}from"./chunk-LP5C4GJE.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as _t,c as rt,d as MM,e as E}from"./chunk-YUXORC52.js";var zC=rt((kU,VC)=>{function LC(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let o=e[t],n=typeof o;(n==="object"||n==="function")&&!Object.isFrozen(o)&&LC(o)}),e}var Wd=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function kC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ns(e,...t){let o=Object.create(null);for(let n in e)o[n]=e[n];return t.forEach(function(n){for(let r in n)o[r]=n[r]}),o}var bD="</span>",AC=e=>!!e.scope,TD=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let o=e.split(".");return[`${t}${o.shift()}`,...o.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},lg=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=kC(t)}openNode(t){if(!AC(t))return;let o=TD(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){AC(t)&&(this.buffer+=bD)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},IC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},cg=class e{constructor(){this.rootNode=IC(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let o=IC({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(n=>this._walk(t,n)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{e._collapse(o)}))}},ug=class extends cg{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){let n=t.root;o&&(n.scope=`language:${o}`),this.add(n)}toHTML(){return new lg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function _c(e){return e?typeof e=="string"?e:e.source:null}function PC(e){return ra("(?=",e,")")}function xD(e){return ra("(?:",e,")*")}function SD(e){return ra("(?:",e,")?")}function ra(...e){return e.map(o=>_c(o)).join("")}function ED(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function mg(...e){return"("+(ED(e).capture?"":"?:")+e.map(n=>_c(n)).join("|")+")"}function BC(e){return new RegExp(e.toString()+"|").exec("").length-1}function CD(e,t){let o=e&&e.exec(t);return o&&o.index===0}var _D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function pg(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,s=_c(n),i="";for(;s.length>0;){let a=_D.exec(s);if(!a){i+=s;break}i+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+r):(i+=a[0],a[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var vD=/\b\B/,FC="[a-zA-Z]\\w*",fg="[a-zA-Z_]\\w*",UC="\\b\\d+(\\.\\d+)?",HC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",GC="\\b(0b[01]+)",RD="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",wD=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=ra(t,/.*\b/,e.binary,/\b.*/)),ns({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},vc={begin:"\\\\[\\s\\S]",relevance:0},AD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[vc]},ID={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[vc]},OD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},qd=function(e,t,o={}){let n=ns({scope:"comment",begin:e,end:t,contains:[]},o);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=mg("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:ra(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},ND=qd("//","$"),MD=qd("/\\*","\\*/"),DD=qd("#","$"),LD={scope:"number",begin:UC,relevance:0},kD={scope:"number",begin:HC,relevance:0},PD={scope:"number",begin:GC,relevance:0},BD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[vc,{begin:/\[/,end:/\]/,relevance:0,contains:[vc]}]},FD={scope:"title",begin:FC,relevance:0},UD={scope:"title",begin:fg,relevance:0},HD={begin:"\\.\\s*"+fg,relevance:0},GD=function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},Gd=Object.freeze({__proto__:null,APOS_STRING_MODE:AD,BACKSLASH_ESCAPE:vc,BINARY_NUMBER_MODE:PD,BINARY_NUMBER_RE:GC,COMMENT:qd,C_BLOCK_COMMENT_MODE:MD,C_LINE_COMMENT_MODE:ND,C_NUMBER_MODE:kD,C_NUMBER_RE:HC,END_SAME_AS_BEGIN:GD,HASH_COMMENT_MODE:DD,IDENT_RE:FC,MATCH_NOTHING_RE:vD,METHOD_GUARD:HD,NUMBER_MODE:LD,NUMBER_RE:UC,PHRASAL_WORDS_MODE:OD,QUOTE_STRING_MODE:ID,REGEXP_MODE:BD,RE_STARTERS_RE:RD,SHEBANG:wD,TITLE_MODE:FD,UNDERSCORE_IDENT_RE:fg,UNDERSCORE_TITLE_MODE:UD});function WD(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function $D(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function qD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=WD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function KD(e,t){Array.isArray(e.illegal)&&(e.illegal=mg(...e.illegal))}function VD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function zD(e,t){e.relevance===void 0&&(e.relevance=1)}var YD=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let o=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=o.keywords,e.begin=ra(o.beforeMatch,PC(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},XD=["of","and","for","in","not","or","if","then","parent","list","value"],jD="keyword";function WC(e,t,o=jD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(s){Object.assign(n,WC(e[s],t,s))}),n;function r(s,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){let l=a.split("|");n[l[0]]=[s,QD(l[0],l[1])]})}}function QD(e,t){return t?Number(t):JD(e)?0:1}function JD(e){return XD.includes(e.toLowerCase())}var OC={},na=e=>{console.error(e)},NC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},sl=(e,t)=>{OC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),OC[`${e}/${t}`]=!0)},$d=new Error;function $C(e,t,{key:o}){let n=0,r=e[o],s={},i={};for(let a=1;a<=t.length;a++)i[a+n]=r[a],s[a+n]=!0,n+=BC(t[a-1]);e[o]=i,e[o]._emit=s,e[o]._multi=!0}function ZD(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw na("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$d;if(typeof e.beginScope!="object"||e.beginScope===null)throw na("beginScope must be object"),$d;$C(e,e.begin,{key:"beginScope"}),e.begin=pg(e.begin,{joinWith:""})}}function eL(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw na("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$d;if(typeof e.endScope!="object"||e.endScope===null)throw na("endScope must be object"),$d;$C(e,e.end,{key:"endScope"}),e.end=pg(e.end,{joinWith:""})}}function tL(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function oL(e){tL(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),ZD(e),eL(e)}function nL(e){function t(i,a){return new RegExp(_c(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=BC(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(pg(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((g,f)=>f>0&&g!==void 0),p=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new o;return this.rules.slice(a).forEach(([c,p])=>l.addRule(c,p)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,c=p.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function r(i){let a=new n;return i.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function s(i,a){let l=i;if(i.isCompiled)return l;[$D,VD,oL,YD].forEach(p=>p(i,a)),e.compilerExtensions.forEach(p=>p(i,a)),i.__beforeBegin=null,[qD,KD,zD].forEach(p=>p(i,a)),i.isCompiled=!0;let c=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),c=i.keywords.$pattern,delete i.keywords.$pattern),c=c||/\w+/,i.keywords&&(i.keywords=WC(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),a&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=_c(l.end)||"",i.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return rL(p==="self"?i:p)})),i.contains.forEach(function(p){s(p,l)}),i.starts&&s(i.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ns(e.classNameAliases||{}),s(e)}function qC(e){return e?e.endsWithParent||qC(e.starts):!1}function rL(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ns(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:qC(e)?ns(e,{starts:e.starts?ns(e.starts):null}):Object.isFrozen(e)?ns(e):e}var iL="11.11.1",dg=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},ag=kC,MC=ns,DC=Symbol("nomatch"),sL=7,KC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,s="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ug};function l(N){return a.noHighlightRe.test(N)}function c(N){let F=N.className+" ";F+=N.parentNode?N.parentNode.className:"";let B=a.languageDetectRe.exec(F);if(B){let G=I(B[1]);return G||(NC(s.replace("{}",B[1])),NC("Falling back to no-highlight mode for this block.",N)),G?B[1]:"no-highlight"}return F.split(/\s+/).find(G=>l(G)||I(G))}function p(N,F,B){let G="",K="";typeof F=="object"?(G=N,B=F.ignoreIllegals,K=F.language):(sl("10.7.0","highlight(lang, code, ...args) has been deprecated."),sl("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
+
import{$a as mS,$b as ze,$c as Rd,A as Vx,Aa as sS,Ab as Qo,Ac as yd,B as zx,Ba as za,Bb as _S,Bc as Te,C as Lr,Ca as Ze,Cb as vS,Cc as ZS,Db as RS,Dc as eE,E as Xi,Eb as wo,Ec as tE,F as yi,Fb as Zi,Fc as bd,G as Yx,Gb as wS,Gc as Td,H as Js,Ha as aS,Hb as es,Hc as xd,I as Yt,Ib as xn,Ic as Sd,J as ud,Jb as d,Jc as oE,K as kt,Kb as AS,Kc as nE,L as Qn,Lb as IS,Lc as Ed,M as Xt,Mb as Jf,Mc as Cd,N as Vf,Nb as OS,Nc as oa,O as Gn,Ob as NS,Oc as _d,P as Xx,Pb as MS,Pc as tg,Q as te,Qa as lS,Qb as DS,Qc as rE,R as ji,Rb as Ve,Rc as iE,S as jx,Sb as gd,Sc as el,Tb as L,Tc as vd,Ub as LS,Uc as sE,V as Qx,Vb as he,Vc as Sn,W as Jx,Wb as Tt,Wc as Ec,X as zf,Xa as cS,Xb as xc,Xc as aE,Ya as uS,Yb as kS,Yc as lE,Z as Zx,Za as Yf,Zb as PS,Zc as Io,_a as dS,_b as BS,_c as cE,aa as eS,ab as pS,ac as hd,ad as uE,b as js,ba as tS,bb as fS,bc as qe,bd as dE,c as Mx,cb as jo,cc as FS,cd as mE,d as Mr,da as bi,db as Xf,dc as Zf,e as hc,ea as oS,eb as Ya,ec as US,ed as wd,f as hi,fb as gS,fc as HS,fd as pE,g as Dx,gb as hS,gc as GS,gd as fE,h as qf,hb as pd,hc as WS,i as Lx,ia as Qi,ib as yS,ic as $S,id as Jo,j as kx,jb as Pr,jc as qS,jd as Ad,k as Px,kb as Xa,kc as KS,kd as wt,l as Bx,lb as bS,lc as VS,m as Dr,ma as kr,mb as Tc,mc as Ja,n as Fx,nb as Ji,nc as Zs,o as Ux,oa as nS,ob as ja,oc as zS,p as Hx,pb as fd,pc as eg,q as Kf,qa as dd,qb as TS,qc as YS,r as yc,rb as jf,rc as ea,s as Gx,sb as xS,sc as ta,t as Wx,tb as Qf,tc as Sc,u as $x,ub as SS,uc as XS,v as qx,va as rS,vb as ES,vc as jS,w as Kx,wb as Qa,wc as Za,x as Qs,xb as CS,xc as xt,y as bc,ya as md,yb as m,yc as QS,za as iS,zb as u,zc as JS}from"./chunk-L5FDAQJS.js";import{Ad as KT,Be as ZT,Bm as cd,Cb as OT,Cd as VT,Ck as xx,Cm as Xs,Ec as Zu,Ed as zT,El as Ex,Ff as zi,Fl as Cx,Fm as wx,Gf as qa,Gg as nd,Gm as $f,Hc as PT,Hf as Ka,Hl as _x,Id as YT,Ih as Xo,Im as Ax,Jf as nx,Jk as ad,K as xT,Kb as Pf,Ke as zs,Kf as rx,Km as Ix,Lb as Bf,M as Ku,Me as ex,Mf as ix,Mm as Ox,N as Vu,Qb as NT,Qg as ux,S as Lf,Sa as _T,Sc as BT,Sg as dx,Sh as Ys,Si as Gf,Ta as vT,Tg as mx,Ua as RT,Uc as Ff,Ug as px,Ui as Tx,Vc as FT,Wc as UT,Wg as jn,Wh as to,Xb as MT,Xf as sx,Yc as HT,Yk as Sx,Zc as GT,_c as WT,_j as Va,ad as $T,af as gc,be as ed,bf as tx,bm as vx,cf as td,de as XT,fe as jT,ff as od,fh as fx,gc as Hn,gf as ox,gg as ax,gn as Nx,ia as Yu,ja as Xu,jc as DT,jk as Wf,kj as rd,lc as Ks,mc as Vs,mm as Rx,ob as wT,oe as QT,pb as AT,pi as gx,qf as Hf,ri as hx,sb as IT,sg as lx,si as yx,tc as ju,uc as $a,ui as Yi,vc as Qu,ve as Uf,vk as sd,wc as LT,wd as Vi,wi as bx,x as TT,xc as Ju,xm as ld,yc as kT,yd as qT,ye as JT,zb as kf,zg as cx}from"./chunk-CTQJGFLJ.js";import{$ as Jb,Aa as dc,Ba as mc,Bd as bT,Ca as Ki,Da as pc,Ea as nT,Fa as Uu,Ga as fc,Gd as zu,Id as gr,L as Yb,Pa as Rt,R as Xb,Ra as Hu,S as jb,T as cc,U as Bu,V as Qb,Vd as ST,W as Fu,Wa as Gu,Xb as Wu,Xd as ET,Ya as rT,Zd as CT,_c as Df,b as _e,ba as Zb,be as ve,da as eT,ea as tT,ga as oT,gd as cT,hd as uT,j as zb,jd as dT,kd as mT,ld as pT,mc as $u,md as fT,nc as qu,nd as gT,oc as sT,od as hT,pa as Wa,pc as aT,pd as yT,qc as lT,t as Fo,te as id,wa as Of,wb as iT,xa as Nf,ya as Mf,za as uc}from"./chunk-VEQE4EAQ.js";import"./chunk-TWIC4BKL.js";import{c as Ao}from"./chunk-LP5C4GJE.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as _t,c as rt,d as MM,e as E}from"./chunk-YUXORC52.js";var zC=rt((kU,VC)=>{function LC(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let o=e[t],n=typeof o;(n==="object"||n==="function")&&!Object.isFrozen(o)&&LC(o)}),e}var Wd=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function kC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ns(e,...t){let o=Object.create(null);for(let n in e)o[n]=e[n];return t.forEach(function(n){for(let r in n)o[r]=n[r]}),o}var bD="</span>",AC=e=>!!e.scope,TD=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let o=e.split(".");return[`${t}${o.shift()}`,...o.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},lg=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=kC(t)}openNode(t){if(!AC(t))return;let o=TD(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){AC(t)&&(this.buffer+=bD)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},IC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},cg=class e{constructor(){this.rootNode=IC(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let o=IC({scope:t});this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,o){return typeof o=="string"?t.addText(o):o.children&&(t.openNode(o),o.children.forEach(n=>this._walk(t,n)),t.closeNode(o)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(o=>typeof o=="string")?t.children=[t.children.join("")]:t.children.forEach(o=>{e._collapse(o)}))}},ug=class extends cg{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,o){let n=t.root;o&&(n.scope=`language:${o}`),this.add(n)}toHTML(){return new lg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function _c(e){return e?typeof e=="string"?e:e.source:null}function PC(e){return ra("(?=",e,")")}function xD(e){return ra("(?:",e,")*")}function SD(e){return ra("(?:",e,")?")}function ra(...e){return e.map(o=>_c(o)).join("")}function ED(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function mg(...e){return"("+(ED(e).capture?"":"?:")+e.map(n=>_c(n)).join("|")+")"}function BC(e){return new RegExp(e.toString()+"|").exec("").length-1}function CD(e,t){let o=e&&e.exec(t);return o&&o.index===0}var _D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function pg(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,s=_c(n),i="";for(;s.length>0;){let a=_D.exec(s);if(!a){i+=s;break}i+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+r):(i+=a[0],a[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var vD=/\b\B/,FC="[a-zA-Z]\\w*",fg="[a-zA-Z_]\\w*",UC="\\b\\d+(\\.\\d+)?",HC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",GC="\\b(0b[01]+)",RD="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",wD=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=ra(t,/.*\b/,e.binary,/\b.*/)),ns({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},vc={begin:"\\\\[\\s\\S]",relevance:0},AD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[vc]},ID={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[vc]},OD={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},qd=function(e,t,o={}){let n=ns({scope:"comment",begin:e,end:t,contains:[]},o);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=mg("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:ra(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},ND=qd("//","$"),MD=qd("/\\*","\\*/"),DD=qd("#","$"),LD={scope:"number",begin:UC,relevance:0},kD={scope:"number",begin:HC,relevance:0},PD={scope:"number",begin:GC,relevance:0},BD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[vc,{begin:/\[/,end:/\]/,relevance:0,contains:[vc]}]},FD={scope:"title",begin:FC,relevance:0},UD={scope:"title",begin:fg,relevance:0},HD={begin:"\\.\\s*"+fg,relevance:0},GD=function(e){return Object.assign(e,{"on:begin":(t,o)=>{o.data._beginMatch=t[1]},"on:end":(t,o)=>{o.data._beginMatch!==t[1]&&o.ignoreMatch()}})},Gd=Object.freeze({__proto__:null,APOS_STRING_MODE:AD,BACKSLASH_ESCAPE:vc,BINARY_NUMBER_MODE:PD,BINARY_NUMBER_RE:GC,COMMENT:qd,C_BLOCK_COMMENT_MODE:MD,C_LINE_COMMENT_MODE:ND,C_NUMBER_MODE:kD,C_NUMBER_RE:HC,END_SAME_AS_BEGIN:GD,HASH_COMMENT_MODE:DD,IDENT_RE:FC,MATCH_NOTHING_RE:vD,METHOD_GUARD:HD,NUMBER_MODE:LD,NUMBER_RE:UC,PHRASAL_WORDS_MODE:OD,QUOTE_STRING_MODE:ID,REGEXP_MODE:BD,RE_STARTERS_RE:RD,SHEBANG:wD,TITLE_MODE:FD,UNDERSCORE_IDENT_RE:fg,UNDERSCORE_TITLE_MODE:UD});function WD(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function $D(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function qD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=WD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function KD(e,t){Array.isArray(e.illegal)&&(e.illegal=mg(...e.illegal))}function VD(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function zD(e,t){e.relevance===void 0&&(e.relevance=1)}var YD=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let o=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=o.keywords,e.begin=ra(o.beforeMatch,PC(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},XD=["of","and","for","in","not","or","if","then","parent","list","value"],jD="keyword";function WC(e,t,o=jD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(s){Object.assign(n,WC(e[s],t,s))}),n;function r(s,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){let l=a.split("|");n[l[0]]=[s,QD(l[0],l[1])]})}}function QD(e,t){return t?Number(t):JD(e)?0:1}function JD(e){return XD.includes(e.toLowerCase())}var OC={},na=e=>{console.error(e)},NC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},sl=(e,t)=>{OC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),OC[`${e}/${t}`]=!0)},$d=new Error;function $C(e,t,{key:o}){let n=0,r=e[o],s={},i={};for(let a=1;a<=t.length;a++)i[a+n]=r[a],s[a+n]=!0,n+=BC(t[a-1]);e[o]=i,e[o]._emit=s,e[o]._multi=!0}function ZD(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw na("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$d;if(typeof e.beginScope!="object"||e.beginScope===null)throw na("beginScope must be object"),$d;$C(e,e.begin,{key:"beginScope"}),e.begin=pg(e.begin,{joinWith:""})}}function eL(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw na("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$d;if(typeof e.endScope!="object"||e.endScope===null)throw na("endScope must be object"),$d;$C(e,e.end,{key:"endScope"}),e.end=pg(e.end,{joinWith:""})}}function tL(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function oL(e){tL(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),ZD(e),eL(e)}function nL(e){function t(i,a){return new RegExp(_c(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=BC(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(pg(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((g,f)=>f>0&&g!==void 0),p=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new o;return this.rules.slice(a).forEach(([c,p])=>l.addRule(c,p)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,c=p.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function r(i){let a=new n;return i.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function s(i,a){let l=i;if(i.isCompiled)return l;[$D,VD,oL,YD].forEach(p=>p(i,a)),e.compilerExtensions.forEach(p=>p(i,a)),i.__beforeBegin=null,[qD,KD,zD].forEach(p=>p(i,a)),i.isCompiled=!0;let c=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),c=i.keywords.$pattern,delete i.keywords.$pattern),c=c||/\w+/,i.keywords&&(i.keywords=WC(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),a&&(i.begin||(i.begin=/\B|\b/),l.beginRe=t(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=t(l.end)),l.terminatorEnd=_c(l.end)||"",i.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return rL(p==="self"?i:p)})),i.contains.forEach(function(p){s(p,l)}),i.starts&&s(i.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ns(e.classNameAliases||{}),s(e)}function qC(e){return e?e.endsWithParent||qC(e.starts):!1}function rL(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ns(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:qC(e)?ns(e,{starts:e.starts?ns(e.starts):null}):Object.isFrozen(e)?ns(e):e}var iL="11.11.1",dg=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},ag=kC,MC=ns,DC=Symbol("nomatch"),sL=7,KC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,s="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ug};function l(N){return a.noHighlightRe.test(N)}function c(N){let F=N.className+" ";F+=N.parentNode?N.parentNode.className:"";let B=a.languageDetectRe.exec(F);if(B){let G=I(B[1]);return G||(NC(s.replace("{}",B[1])),NC("Falling back to no-highlight mode for this block.",N)),G?B[1]:"no-highlight"}return F.split(/\s+/).find(G=>l(G)||I(G))}function p(N,F,B){let G="",K="";typeof F=="object"?(G=N,B=F.ignoreIllegals,K=F.language):(sl("10.7.0","highlight(lang, code, ...args) has been deprecated."),sl("10.7.0",`Please use highlight(code, options) instead.
|
|
3
3
|
https://github.com/highlightjs/highlight.js/issues/2277`),K=N,G=F),B===void 0&&(B=!0);let z={code:G,language:K};k("before:highlight",z);let H=z.result?z.result:g(z.language,z.code,B);return H.code=z.code,k("after:highlight",H),H}function g(N,F,B,G){let K=Object.create(null);function z(se,me){return se.keywords[me]}function H(){if(!Se.keywords){nt.addText(je);return}let se=0;Se.keywordPatternRe.lastIndex=0;let me=Se.keywordPatternRe.exec(je),Ne="";for(;me;){Ne+=je.substring(se,me.index);let ue=et.case_insensitive?me[0].toLowerCase():me[0],bt=z(Se,ue);if(bt){let[gn,Pn]=bt;if(nt.addText(Ne),Ne="",K[ue]=(K[ue]||0)+1,K[ue]<=sL&&(fn+=Pn),gn.startsWith("_"))Ne+=me[0];else{let zo=et.classNameAliases[gn]||gn;J(me[0],zo)}}else Ne+=me[0];se=Se.keywordPatternRe.lastIndex,me=Se.keywordPatternRe.exec(je)}Ne+=je.substring(se),nt.addText(Ne)}function V(){if(je==="")return;let se=null;if(typeof Se.subLanguage=="string"){if(!t[Se.subLanguage]){nt.addText(je);return}se=g(Se.subLanguage,je,!0,Ee[Se.subLanguage]),Ee[Se.subLanguage]=se._top}else se=y(je,Se.subLanguage.length?Se.subLanguage:null);Se.relevance>0&&(fn+=se.relevance),nt.__addSublanguage(se._emitter,se.language)}function X(){Se.subLanguage!=null?V():H(),je=""}function J(se,me){se!==""&&(nt.startScope(me),nt.addText(se),nt.endScope())}function oe(se,me){let Ne=1,ue=me.length-1;for(;Ne<=ue;){if(!se._emit[Ne]){Ne++;continue}let bt=et.classNameAliases[se[Ne]]||se[Ne],gn=me[Ne];bt?J(gn,bt):(je=gn,H(),je=""),Ne++}}function Q(se,me){return se.scope&&typeof se.scope=="string"&&nt.openNode(et.classNameAliases[se.scope]||se.scope),se.beginScope&&(se.beginScope._wrap?(J(je,et.classNameAliases[se.beginScope._wrap]||se.beginScope._wrap),je=""):se.beginScope._multi&&(oe(se.beginScope,me),je="")),Se=Object.create(se,{parent:{value:Se}}),Se}function $(se,me,Ne){let ue=CD(se.endRe,Ne);if(ue){if(se["on:end"]){let bt=new Wd(se);se["on:end"](me,bt),bt.isMatchIgnored&&(ue=!1)}if(ue){for(;se.endsParent&&se.parent;)se=se.parent;return se}}if(se.endsWithParent)return $(se.parent,me,Ne)}function j(se){return Se.matcher.regexIndex===0?(je+=se[0],1):(Vo=!0,0)}function ee(se){let me=se[0],Ne=se.rule,ue=new Wd(Ne),bt=[Ne.__beforeBegin,Ne["on:begin"]];for(let gn of bt)if(gn&&(gn(se,ue),ue.isMatchIgnored))return j(me);return Ne.skip?je+=me:(Ne.excludeBegin&&(je+=me),X(),!Ne.returnBegin&&!Ne.excludeBegin&&(je=me)),Q(Ne,se),Ne.returnBegin?0:me.length}function ae(se){let me=se[0],Ne=F.substring(se.index),ue=$(Se,se,Ne);if(!ue)return DC;let bt=Se;Se.endScope&&Se.endScope._wrap?(X(),J(me,Se.endScope._wrap)):Se.endScope&&Se.endScope._multi?(X(),oe(Se.endScope,se)):bt.skip?je+=me:(bt.returnEnd||bt.excludeEnd||(je+=me),X(),bt.excludeEnd&&(je=me));do Se.scope&&nt.closeNode(),!Se.skip&&!Se.subLanguage&&(fn+=Se.relevance),Se=Se.parent;while(Se!==ue.parent);return ue.starts&&Q(ue.starts,se),bt.returnEnd?0:me.length}function Z(){let se=[];for(let me=Se;me!==et;me=me.parent)me.scope&&se.unshift(me.scope);se.forEach(me=>nt.openNode(me))}let we={};function He(se,me){let Ne=me&&me[0];if(je+=se,Ne==null)return X(),0;if(we.type==="begin"&&me.type==="end"&&we.index===me.index&&Ne===""){if(je+=F.slice(me.index,me.index+1),!r){let ue=new Error(`0 width match regex (${N})`);throw ue.languageName=N,ue.badRule=we.rule,ue}return 1}if(we=me,me.type==="begin")return ee(me);if(me.type==="illegal"&&!B){let ue=new Error('Illegal lexeme "'+Ne+'" for mode "'+(Se.scope||"<unnamed>")+'"');throw ue.mode=Se,ue}else if(me.type==="end"){let ue=ae(me);if(ue!==DC)return ue}if(me.type==="illegal"&&Ne==="")return je+=`
|
|
4
4
|
`,1;if(Co>1e5&&Co>me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return je+=Ne,Ne.length}let et=I(N);if(!et)throw na(s.replace("{}",N)),new Error('Unknown language: "'+N+'"');let Le=nL(et),lt="",Se=G||Le,Ee={},nt=new a.__emitter(a);Z();let je="",fn=0,Zt=0,Co=0,Vo=!1;try{if(et.__emitTokens)et.__emitTokens(F,nt);else{for(Se.matcher.considerAll();;){Co++,Vo?Vo=!1:Se.matcher.considerAll(),Se.matcher.lastIndex=Zt;let se=Se.matcher.exec(F);if(!se)break;let me=F.substring(Zt,se.index),Ne=He(me,se);Zt=se.index+Ne}He(F.substring(Zt))}return nt.finalize(),lt=nt.toHTML(),{language:N,value:lt,relevance:fn,illegal:!1,_emitter:nt,_top:Se}}catch(se){if(se.message&&se.message.includes("Illegal"))return{language:N,value:ag(F),illegal:!0,relevance:0,_illegalBy:{message:se.message,index:Zt,context:F.slice(Zt-100,Zt+100),mode:se.mode,resultSoFar:lt},_emitter:nt};if(r)return{language:N,value:ag(F),illegal:!1,relevance:0,errorRaised:se,_emitter:nt,_top:Se};throw se}}function f(N){let F={value:ag(N),illegal:!1,relevance:0,_top:i,_emitter:new a.__emitter(a)};return F._emitter.addText(N),F}function y(N,F){F=F||a.languages||Object.keys(t);let B=f(N),G=F.filter(I).filter(v).map(X=>g(X,N,!1));G.unshift(B);let K=G.sort((X,J)=>{if(X.relevance!==J.relevance)return J.relevance-X.relevance;if(X.language&&J.language){if(I(X.language).supersetOf===J.language)return 1;if(I(J.language).supersetOf===X.language)return-1}return 0}),[z,H]=K,V=z;return V.secondBest=H,V}function h(N,F,B){let G=F&&o[F]||B;N.classList.add("hljs"),N.classList.add(`language-${G}`)}function b(N){let F=null,B=c(N);if(l(B))return;if(k("before:highlightElement",{el:N,language:B}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new dg("One of your code blocks includes unescaped HTML.",N.innerHTML);F=N;let G=F.textContent,K=B?p(G,{language:B,ignoreIllegals:!0}):y(G);N.innerHTML=K.value,N.dataset.highlighted="yes",h(N,B,K.language),N.result={language:K.language,re:K.relevance,relevance:K.relevance},K.secondBest&&(N.secondBest={language:K.secondBest.language,relevance:K.secondBest.relevance}),k("after:highlightElement",{el:N,result:K,text:G})}function T(N){a=MC(a,N)}let x=()=>{S(),sl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){S(),sl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let A=!1;function S(){function N(){S()}if(document.readyState==="loading"){A||window.addEventListener("DOMContentLoaded",N,!1),A=!0;return}document.querySelectorAll(a.cssSelector).forEach(b)}function O(N,F){let B=null;try{B=F(e)}catch(G){if(na("Language definition for '{}' could not be registered.".replace("{}",N)),r)na(G);else throw G;B=i}B.name||(B.name=N),t[N]=B,B.rawDefinition=F.bind(null,e),B.aliases&&R(B.aliases,{languageName:N})}function _(N){delete t[N];for(let F of Object.keys(o))o[F]===N&&delete o[F]}function C(){return Object.keys(t)}function I(N){return N=(N||"").toLowerCase(),t[N]||t[o[N]]}function R(N,{languageName:F}){typeof N=="string"&&(N=[N]),N.forEach(B=>{o[B.toLowerCase()]=F})}function v(N){let F=I(N);return F&&!F.disableAutodetect}function D(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=F=>{N["before:highlightBlock"](Object.assign({block:F.el},F))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=F=>{N["after:highlightBlock"](Object.assign({block:F.el},F))})}function U(N){D(N),n.push(N)}function M(N){let F=n.indexOf(N);F!==-1&&n.splice(F,1)}function k(N,F){let B=N;n.forEach(function(G){G[B]&&G[B](F)})}function P(N){return sl("10.7.0","highlightBlock will be removed entirely in v12.0"),sl("10.7.0","Please use highlightElement now."),b(N)}Object.assign(e,{highlight:p,highlightAuto:y,highlightAll:S,highlightElement:b,highlightBlock:P,configure:T,initHighlighting:x,initHighlightingOnLoad:w,registerLanguage:O,unregisterLanguage:_,listLanguages:C,getLanguage:I,registerAliases:R,autoDetection:v,inherit:MC,addPlugin:U,removePlugin:M}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=iL,e.regex={concat:ra,lookahead:PC,either:mg,optional:SD,anyNumberOfTimes:xD};for(let N in Gd)typeof Gd[N]=="object"&&LC(Gd[N]);return Object.assign(e,Gd),e},al=KC({});al.newInstance=()=>KC({});VC.exports=al;al.HighlightJS=al;al.default=al});var yv=rt(ht=>{"use strict";var xo=typeof Symbol=="function"&&Symbol.for,Gg=xo?Symbol.for("react.element"):60103,Wg=xo?Symbol.for("react.portal"):60106,ym=xo?Symbol.for("react.fragment"):60107,bm=xo?Symbol.for("react.strict_mode"):60108,Tm=xo?Symbol.for("react.profiler"):60114,xm=xo?Symbol.for("react.provider"):60109,Sm=xo?Symbol.for("react.context"):60110,$g=xo?Symbol.for("react.async_mode"):60111,Em=xo?Symbol.for("react.concurrent_mode"):60111,Cm=xo?Symbol.for("react.forward_ref"):60112,_m=xo?Symbol.for("react.suspense"):60113,BL=xo?Symbol.for("react.suspense_list"):60120,vm=xo?Symbol.for("react.memo"):60115,Rm=xo?Symbol.for("react.lazy"):60116,FL=xo?Symbol.for("react.block"):60121,UL=xo?Symbol.for("react.fundamental"):60117,HL=xo?Symbol.for("react.responder"):60118,GL=xo?Symbol.for("react.scope"):60119;function $n(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Gg:switch(e=e.type,e){case $g:case Em:case ym:case Tm:case bm:case _m:return e;default:switch(e=e&&e.$$typeof,e){case Sm:case Cm:case Rm:case vm:case xm:return e;default:return t}}case Wg:return t}}}function hv(e){return $n(e)===Em}ht.AsyncMode=$g;ht.ConcurrentMode=Em;ht.ContextConsumer=Sm;ht.ContextProvider=xm;ht.Element=Gg;ht.ForwardRef=Cm;ht.Fragment=ym;ht.Lazy=Rm;ht.Memo=vm;ht.Portal=Wg;ht.Profiler=Tm;ht.StrictMode=bm;ht.Suspense=_m;ht.isAsyncMode=function(e){return hv(e)||$n(e)===$g};ht.isConcurrentMode=hv;ht.isContextConsumer=function(e){return $n(e)===Sm};ht.isContextProvider=function(e){return $n(e)===xm};ht.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gg};ht.isForwardRef=function(e){return $n(e)===Cm};ht.isFragment=function(e){return $n(e)===ym};ht.isLazy=function(e){return $n(e)===Rm};ht.isMemo=function(e){return $n(e)===vm};ht.isPortal=function(e){return $n(e)===Wg};ht.isProfiler=function(e){return $n(e)===Tm};ht.isStrictMode=function(e){return $n(e)===bm};ht.isSuspense=function(e){return $n(e)===_m};ht.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ym||e===Em||e===Tm||e===bm||e===_m||e===BL||typeof e=="object"&&e!==null&&(e.$$typeof===Rm||e.$$typeof===vm||e.$$typeof===xm||e.$$typeof===Sm||e.$$typeof===Cm||e.$$typeof===UL||e.$$typeof===HL||e.$$typeof===GL||e.$$typeof===FL)};ht.typeOf=$n});var bv=rt(yt=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,T=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function A(Z){return typeof Z=="string"||typeof Z=="function"||Z===n||Z===c||Z===s||Z===r||Z===g||Z===f||typeof Z=="object"&&Z!==null&&(Z.$$typeof===h||Z.$$typeof===y||Z.$$typeof===i||Z.$$typeof===a||Z.$$typeof===p||Z.$$typeof===T||Z.$$typeof===x||Z.$$typeof===w||Z.$$typeof===b)}function S(Z){if(typeof Z=="object"&&Z!==null){var we=Z.$$typeof;switch(we){case t:var He=Z.type;switch(He){case l:case c:case n:case s:case r:case g:return He;default:var et=He&&He.$$typeof;switch(et){case a:case p:case h:case y:case i:return et;default:return we}}case o:return we}}}var O=l,_=c,C=a,I=i,R=t,v=p,D=n,U=h,M=y,k=o,P=s,N=r,F=g,B=!1;function G(Z){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),K(Z)||S(Z)===l}function K(Z){return S(Z)===c}function z(Z){return S(Z)===a}function H(Z){return S(Z)===i}function V(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===t}function X(Z){return S(Z)===p}function J(Z){return S(Z)===n}function oe(Z){return S(Z)===h}function Q(Z){return S(Z)===y}function $(Z){return S(Z)===o}function j(Z){return S(Z)===s}function ee(Z){return S(Z)===r}function ae(Z){return S(Z)===g}yt.AsyncMode=O,yt.ConcurrentMode=_,yt.ContextConsumer=C,yt.ContextProvider=I,yt.Element=R,yt.ForwardRef=v,yt.Fragment=D,yt.Lazy=U,yt.Memo=M,yt.Portal=k,yt.Profiler=P,yt.StrictMode=N,yt.Suspense=F,yt.isAsyncMode=G,yt.isConcurrentMode=K,yt.isContextConsumer=z,yt.isContextProvider=H,yt.isElement=V,yt.isForwardRef=X,yt.isFragment=J,yt.isLazy=oe,yt.isMemo=Q,yt.isPortal=$,yt.isProfiler=j,yt.isStrictMode=ee,yt.isSuspense=ae,yt.isValidElementType=A,yt.typeOf=S}()});var Kg=rt((wK,qg)=>{"use strict";process.env.NODE_ENV==="production"?qg.exports=yv():qg.exports=bv()});var Sv=rt((AK,xv)=>{"use strict";var Tv=Object.getOwnPropertySymbols,WL=Object.prototype.hasOwnProperty,$L=Object.prototype.propertyIsEnumerable;function qL(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function KL(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},o=0;o<10;o++)t["_"+String.fromCharCode(o)]=o;var n=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(n.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(s){r[s]=s}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}xv.exports=KL()?Object.assign:function(e,t){for(var o,n=qL(e),r,s=1;s<arguments.length;s++){o=Object(arguments[s]);for(var i in o)WL.call(o,i)&&(n[i]=o[i]);if(Tv){r=Tv(o);for(var a=0;a<r.length;a++)$L.call(o,r[a])&&(n[r[a]]=o[r[a]])}}return n}});var wm=rt((IK,Ev)=>{"use strict";var VL="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ev.exports=VL});var Vg=rt((OK,Cv)=>{Cv.exports=Function.call.bind(Object.prototype.hasOwnProperty)});var Av=rt((NK,wv)=>{"use strict";var zg=function(){};process.env.NODE_ENV!=="production"&&(_v=wm(),Am={},vv=Vg(),zg=function(e){var t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});var _v,Am,vv;function Rv(e,t,o,n,r){if(process.env.NODE_ENV!=="production"){for(var s in e)if(vv(e,s)){var i;try{if(typeof e[s]!="function"){var a=Error((n||"React class")+": "+o+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[s](t,s,n,o,null,_v)}catch(c){i=c}if(i&&!(i instanceof Error)&&zg((n||"React class")+": type specification of "+o+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in Am)){Am[i.message]=!0;var l=r?r():"";zg("Failed "+o+" type: "+i.message+(l??""))}}}}Rv.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(Am={})};wv.exports=Rv});var Nv=rt((MK,Ov)=>{"use strict";var zL=Kg(),YL=Sv(),bl=wm(),Yg=Vg(),Iv=Av(),Tl=function(){};process.env.NODE_ENV!=="production"&&(Tl=function(e){var t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});function Im(){return null}Ov.exports=function(e,t){var o=typeof Symbol=="function"&&Symbol.iterator,n="@@iterator";function r(M){var k=M&&(o&&M[o]||M[n]);if(typeof k=="function")return k}var s="<<anonymous>>",i={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:g(),arrayOf:f,element:y(),elementType:h(),instanceOf:b,node:A(),objectOf:x,oneOf:T,oneOfType:w,shape:O,exact:_};function a(M,k){return M===k?M!==0||1/M===1/k:M!==M&&k!==k}function l(M,k){this.message=M,this.data=k&&typeof k=="object"?k:{},this.stack=""}l.prototype=Error.prototype;function c(M){if(process.env.NODE_ENV!=="production")var k={},P=0;function N(B,G,K,z,H,V,X){if(z=z||s,V=V||K,X!==bl){if(t){var J=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw J.name="Invariant Violation",J}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var oe=z+":"+K;!k[oe]&&P<3&&(Tl("You are manually calling a React.PropTypes validation function for the `"+V+"` prop on `"+z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),k[oe]=!0,P++)}}return G[K]==null?B?G[K]===null?new l("The "+H+" `"+V+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new l("The "+H+" `"+V+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:M(G,K,z,H,V)}var F=N.bind(null,!1);return F.isRequired=N.bind(null,!0),F}function p(M){function k(P,N,F,B,G,K){var z=P[N],H=R(z);if(H!==M){var V=v(z);return new l("Invalid "+B+" `"+G+"` of type "+("`"+V+"` supplied to `"+F+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return c(k)}function g(){return c(Im)}function f(M){function k(P,N,F,B,G){if(typeof M!="function")return new l("Property `"+G+"` of component `"+F+"` has invalid PropType notation inside arrayOf.");var K=P[N];if(!Array.isArray(K)){var z=R(K);return new l("Invalid "+B+" `"+G+"` of type "+("`"+z+"` supplied to `"+F+"`, expected an array."))}for(var H=0;H<K.length;H++){var V=M(K,H,F,B,G+"["+H+"]",bl);if(V instanceof Error)return V}return null}return c(k)}function y(){function M(k,P,N,F,B){var G=k[P];if(!e(G)){var K=R(G);return new l("Invalid "+F+" `"+B+"` of type "+("`"+K+"` supplied to `"+N+"`, expected a single ReactElement."))}return null}return c(M)}function h(){function M(k,P,N,F,B){var G=k[P];if(!zL.isValidElementType(G)){var K=R(G);return new l("Invalid "+F+" `"+B+"` of type "+("`"+K+"` supplied to `"+N+"`, expected a single ReactElement type."))}return null}return c(M)}function b(M){function k(P,N,F,B,G){if(!(P[N]instanceof M)){var K=M.name||s,z=U(P[N]);return new l("Invalid "+B+" `"+G+"` of type "+("`"+z+"` supplied to `"+F+"`, expected ")+("instance of `"+K+"`."))}return null}return c(k)}function T(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?Tl("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):Tl("Invalid argument supplied to oneOf, expected an array.")),Im;function k(P,N,F,B,G){for(var K=P[N],z=0;z<M.length;z++)if(a(K,M[z]))return null;var H=JSON.stringify(M,function(X,J){var oe=v(J);return oe==="symbol"?String(J):J});return new l("Invalid "+B+" `"+G+"` of value `"+String(K)+"` "+("supplied to `"+F+"`, expected one of "+H+"."))}return c(k)}function x(M){function k(P,N,F,B,G){if(typeof M!="function")return new l("Property `"+G+"` of component `"+F+"` has invalid PropType notation inside objectOf.");var K=P[N],z=R(K);if(z!=="object")return new l("Invalid "+B+" `"+G+"` of type "+("`"+z+"` supplied to `"+F+"`, expected an object."));for(var H in K)if(Yg(K,H)){var V=M(K,H,F,B,G+"."+H,bl);if(V instanceof Error)return V}return null}return c(k)}function w(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&Tl("Invalid argument supplied to oneOfType, expected an instance of array."),Im;for(var k=0;k<M.length;k++){var P=M[k];if(typeof P!="function")return Tl("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+D(P)+" at index "+k+"."),Im}function N(F,B,G,K,z){for(var H=[],V=0;V<M.length;V++){var X=M[V],J=X(F,B,G,K,z,bl);if(J==null)return null;J.data&&Yg(J.data,"expectedType")&&H.push(J.data.expectedType)}var oe=H.length>0?", expected one of type ["+H.join(", ")+"]":"";return new l("Invalid "+K+" `"+z+"` supplied to "+("`"+G+"`"+oe+"."))}return c(N)}function A(){function M(k,P,N,F,B){return C(k[P])?null:new l("Invalid "+F+" `"+B+"` supplied to "+("`"+N+"`, expected a ReactNode."))}return c(M)}function S(M,k,P,N,F){return new l((M||"React class")+": "+k+" type `"+P+"."+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+F+"`.")}function O(M){function k(P,N,F,B,G){var K=P[N],z=R(K);if(z!=="object")return new l("Invalid "+B+" `"+G+"` of type `"+z+"` "+("supplied to `"+F+"`, expected `object`."));for(var H in M){var V=M[H];if(typeof V!="function")return S(F,B,G,H,v(V));var X=V(K,H,F,B,G+"."+H,bl);if(X)return X}return null}return c(k)}function _(M){function k(P,N,F,B,G){var K=P[N],z=R(K);if(z!=="object")return new l("Invalid "+B+" `"+G+"` of type `"+z+"` "+("supplied to `"+F+"`, expected `object`."));var H=YL({},P[N],M);for(var V in H){var X=M[V];if(Yg(M,V)&&typeof X!="function")return S(F,B,G,V,v(X));if(!X)return new l("Invalid "+B+" `"+G+"` key `"+V+"` supplied to `"+F+"`.\nBad object: "+JSON.stringify(P[N],null," ")+`
|
|
5
5
|
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var J=X(K,V,F,B,G+"."+V,bl);if(J)return J}return null}return c(k)}function C(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(C);if(M===null||e(M))return!0;var k=r(M);if(k){var P=k.call(M),N;if(k!==M.entries){for(;!(N=P.next()).done;)if(!C(N.value))return!1}else for(;!(N=P.next()).done;){var F=N.value;if(F&&!C(F[1]))return!1}}else return!1;return!0;default:return!1}}function I(M,k){return M==="symbol"?!0:k?k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol:!1}function R(M){var k=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":I(k,M)?"symbol":k}function v(M){if(typeof M>"u"||M===null)return""+M;var k=R(M);if(k==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return k}function D(M){var k=v(M);switch(k){case"array":case"object":return"an "+k;case"boolean":case"date":case"regexp":return"a "+k;default:return k}}function U(M){return!M.constructor||!M.constructor.name?s:M.constructor.name}return i.checkPropTypes=Iv,i.resetWarningCache=Iv.resetWarningCache,i.PropTypes=i,i}});var kv=rt((DK,Lv)=>{"use strict";var XL=wm();function Mv(){}function Dv(){}Dv.resetWarningCache=Mv;Lv.exports=function(){function e(n,r,s,i,a,l){if(l!==XL){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Dv,resetWarningCache:Mv};return o.PropTypes=o,o}});var Fv=rt((LK,Xg)=>{process.env.NODE_ENV!=="production"?(Pv=Kg(),Bv=!0,Xg.exports=Nv()(Pv.isElement,Bv)):Xg.exports=kv()();var Pv,Bv});var $v=rt((kK,Om)=>{"use strict";var Hv=dd(),jL=Wx(),Uv=/\s/g;function jg(...e){let t=jL.apply(this,e),o=(n,r)=>QL(n?n.toString():"",t,r);return o.multiline=(n,r)=>JL(n?n.toString():"",t,r),o}var Gv=(e,t,o)=>t.interpolation.toLowerCase()==="hsv"?e.hsv(o,t.hsvSpin.toLowerCase()):e.rgb(o);function QL(e,t,o){let n=Wv(o),r=Math.max(e.replace(Uv,"").length,t.stops.length),s=Gv(t,n,r),i="";for(let a of e)i+=a.match(Uv)?a:Hv.hex(s.shift().toHex())(a);return i}function JL(e,t,o){let n=Wv(o),r=e.split(`
|
|
@@ -116,7 +116,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
|
|
|
116
116
|
`),await Jo())}Bo("authenticated")},[i,n,Bo,Un,Gs]),Fy=(0,Y.useCallback)(async q=>{try{if(Un(null),!q.trim()&&q.length>1){Un("API key cannot be empty string with length greater than 1.");return}await mx(q),await vy(),await n.refreshAuth("gemini-api-key"),Bo("authenticated")}catch(pe){Un(`Failed to save API key: ${pe instanceof Error?pe.message:String(pe)}`)}},[Bo,Un,vy,n]),Uy=(0,Y.useCallback)(()=>{Bo("updating")},[Bo]);(0,Y.useEffect)(()=>{Ir==="authenticated"&&(ce(n.getUserTier()),de(n.getUserPaidTier()))},[n,Ir]),(0,Y.useEffect)(()=>{if(i.merged.security.auth.enforcedType&&i.merged.security.auth.selectedType&&i.merged.security.auth.enforcedType!==i.merged.security.auth.selectedType)Un(`Authentication is enforced to be ${i.merged.security.auth.enforcedType}, but you are currently using ${i.merged.security.auth.selectedType}.`);else if(i.merged.security.auth.selectedType&&!i.merged.security.auth.useExternal){if(i.merged.security.auth.selectedType==="gemini-api-key")return;let q=wd(i.merged.security.auth.selectedType);q&&Un(q)}},[i.merged.security.auth.selectedType,i.merged.security.auth.enforcedType,i.merged.security.auth.useExternal,Un]);let{isModelDialogOpen:df,openModelDialog:Hy,closeModelDialog:Gy}=fI(),{toggleVimEnabled:tM}=el(),mf=(0,Y.useRef)(()=>{}),[Ha,Ws]=(0,Y.useState)(!1),{cleanUiDetailsVisible:bu,setCleanUiDetailsVisible:Wy,toggleCleanUiDetailsVisible:$y,revealCleanUiDetailsTemporarily:Tu}=XN(),oM=(0,Y.useMemo)(()=>({openAuthDialog:()=>Bo("updating"),openThemeDialog:xy,openEditorDialog:Jl,openPrivacyNotice:()=>S(!0),openSettingsDialog:by,openSessionBrowser:yu,openModelDialog:Hy,openAgentConfigDialog:ui,openPermissionsDialog:ai,quit:q=>{w(q),setTimeout(async()=>{await kr(),py.exit(0)},100)},setDebugMessage:T,toggleCorgiMode:()=>f(q=>!q),toggleDebugProfiler:Fa,dispatchExtensionStateUpdate:Po,addConfirmUpdateExtensionRequest:si,toggleBackgroundTasks:()=>{G.current(),K.current||(v(!0),z.current.size>1?mf.current(!0):mf.current(!1))},toggleShortcutsHelp:()=>Ws(q=>!q),setText:fy}),[Bo,xy,Jl,by,yu,Hy,ui,w,T,S,f,Po,ai,si,Fa,Ws,fy]),{handleSlashCommand:fi,slashCommands:xu,pendingHistoryItems:Su,commandContext:qy,confirmationRequest:$s}=yI(n,i,c.addItem,c.clearItems,c.loadHistory,qt,tM,I,oM,_o,le,cr,k),[oc,Ky]=(0,Y.useState)(null),[Eu,Vy]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{let q=pe=>{Ky({prompt:pe.prompt,onConfirm:fe=>{Ky(null),pe.onConfirm(fe)}})};return ve.on("consent-request",q),()=>{ve.off("consent-request",q)}},[]);let nM=(0,Y.useCallback)(async()=>{c.addItem({type:"info",text:"Refreshing hierarchical memory (GEMINI.md or other context files)..."},Date.now());try{let q,pe;if(n.isJitContextEnabled())await n.getContextManager()?.refresh(),n.updateSystemInstructionIfInitialized(),q=Wf(n.getUserMemory()),pe=n.getGeminiMdFileCount();else{let fe=await id(n);q=Wf(fe.memoryContent),pe=fe.fileCount}c.addItem({type:"info",text:`Memory reloaded successfully. ${q.length>0?`Loaded ${q.length} characters from ${pe} file(s)`:"No memory content found"}`},Date.now()),n.getDebugMode()&&_e.log(`[DEBUG] Refreshed memory content in config: ${q.substring(0,200)}...`)}catch(q){let pe=gr(q);c.addItem({type:"error",text:`Error refreshing memory: ${pe}`},Date.now()),_e.warn("Error refreshing memory:",q)}},[n,c]),pf=(0,Y.useRef)(()=>{}),rM=(0,Y.useCallback)(q=>{q?B(!0):(B(!1),pf.current(!1))},[]);(0,Y.useEffect)(()=>{if(F){let q=c.history.findLast(fe=>fe.type==="user"),pe=Ce.at(-1);(!q||typeof q.text=="string"&&q.text===pe)&&(pf.current(!0),B(!1))}},[F,Ce,c.history]);let Cu=(0,Y.useRef)([]),[iM,zy]=(0,Y.useState)(0),ff=(0,Y.useCallback)(()=>{if(Cu.current.length===0)return null;let q=Cu.current.join(`
|
|
117
117
|
`);return Cu.current=[],zy(0),q},[]);(0,Y.useEffect)(()=>{let q=(pe,fe)=>{fe!=="user_steering"&&fe!=="background_completion"||(Cu.current.push(pe),zy(Ke=>Ke+1))};return n.injectionService.onInjection(q),()=>{n.injectionService.offInjection(q)}},[n]);let{streamingState:ao,submitQuery:Ga,initError:gf,pendingHistoryItems:_u,thought:nc,cancelOngoingRequest:Yy,pendingToolCalls:sM,handleApprovalModeChange:Xy,activePtyId:Wi,loopDetectionConfirmationRequest:vu,lastOutputTime:hf,backgroundTaskCount:yf,isBackgroundTaskVisible:Or,toggleBackgroundTasks:Ru,backgroundCurrentExecution:jy,backgroundTasks:Nr,dismissBackgroundTask:Qy,retryStatus:aM}=MI(n.getGeminiClient(),c.history,c.addItem,n,i,T,fi,j,mi,Un,nM,ae,Z,rM,v,tt,Je,R,ff),vo=(0,Y.useMemo)(()=>[...Su,..._u],[Su,_u]);G.current=Ru,K.current=Or,z.current=Nr;let{activeBackgroundTaskPid:Jy,setIsBackgroundTaskListOpen:qs,isBackgroundTaskListOpen:Zy,setActiveBackgroundTaskPid:eb,backgroundTaskHeight:bf}=kN({backgroundTasks:Nr,backgroundTaskCount:yf,isBackgroundTaskVisible:Or,activePtyId:Wi,embeddedShellFocused:R,setEmbeddedShellFocused:v,terminalHeight:Je});mf.current=qs;let rc=(0,Y.useRef)(0);(0,Y.useEffect)(()=>{rc.current=hf},[hf]);let{shouldShowFocusHint:lM,inactivityStatus:tb}=FI({activePtyId:Wi,lastOutputTime:hf,streamingState:ao,pendingToolCalls:sM,embeddedShellFocused:R,isInteractiveShellEnabled:n.isInteractiveShellEnabled()}),ob=tb==="action_required",nb=tb==="silent_working",cM=(0,Y.useCallback)(q=>{Xy(q),bu||Tu(my)},[Xy,bu,Tu]),{isMcpReady:ic}=vN(n),{messageQueue:wu,addMessage:Au,clearQueue:rb,getQueuedMessagesText:ib,popAllMessages:sb}=_N({isConfigInitialized:le,streamingState:ao,submitQuery:Ga,isMcpReady:ic});pf.current=(0,Y.useCallback)((q=!0)=>{if(Km(vo))return;if(qm(vo)){pi.setText("");return}if(!q)return;let fe=Ce.at(-1)||"",Ke=ib();Ke&&(fe=fe?`${fe}
|
|
118
118
|
|
|
119
|
-
${Ke}`:Ke,rb()),fe&&pi.setText(fe)},[pi,Ce,ib,rb,vo]);let ab=(0,Y.useCallback)(q=>{let pe=q.trim();pe&&(n.injectionService.addInjection(pe,"user_steering"),c.addItem({type:"hint",text:pe}))},[n,c]),sc=(0,Y.useCallback)(async q=>{a(),ue(null),se||(me(!0),p||qt());let pe=jo(q.trim()),fe=ao==="idle",Ke=ao==="responding"||qm(vo);if(pe&&Ke){let{commandToExecute:qi}=Ya(q,xu??[]);if(qi?.isSafeConcurrent){fi(q),$e(q);return}}if(n.isModelSteeringEnabled()&&Ke&&!pe){ab(q),$e(q);return}let Ro=le&⁣if(pe&&le||fe&&Ro){if(!pe){let qi=await mS(q,n);if(qi.length>0){Vy({files:qi,onComplete:OM=>{Vy(null),OM.allowed&&qi.forEach(NM=>n.getWorkspaceContext().addReadOnlyPath(NM)),Ga(q)}}),$e(q);return}}Ga(q)}else fe&&!Ro&&wu.length===0&&ve.emitFeedback("info",le?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),Au(q);$e(q)},[Au,$e,Ga,fi,xu,ic,ao,wu.length,vo,n,se,me,p,qt,a,ab,le,ue]),lb=(0,Y.useCallback)(()=>{a(),ue(null),c.clearItems(),Hs(),qt()},[c,Hs,qt,a,ue]),{handleInput:cb}=LI(pi,sc),Tf=!gf&&!C&&!cf&&(ao==="idle"||ao==="responding"||ao==="waiting_for_confirmation")&&!ec&&!P,Iu=(0,Y.useRef)(null),[Ou,uM]=(0,Y.useState)(0),[ub,dM]=(0,Y.useState)(0);(0,Y.useLayoutEffect)(()=>{!P&&Ou>0&&dM(Ou)},[P,Ou]);let xf=P&&ub>0?ub:Ou,db=(0,Y.useCallback)(q=>{if(Iu.current&&(Iu.current.disconnect(),Iu.current=null),q){let pe=new Qo(fe=>{let Ke=fe[0];if(Ke){let Ro=Math.round(Ke.contentRect.height);uM(qi=>Ro!==qi?Ro:qi)}});pe.observe(q),Iu.current=pe}},[]),Sf=Math.max(0,Je-xf-bf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(tt*H1),terminalHeight:Math.max(Math.floor(Sf-G1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Nu,hasReceivedFocusEvent:mM}=MS(),mb=(0,Y.useMemo)(()=>{let q=i.merged.context.fileName;return q?Array.isArray(q)?q:[q]:bT()},[i.merged.context.fileName]),Ef=(0,Y.useMemo)(()=>n.getQuestion(),[n]),pb=(0,Y.useRef)(!1),fb=n.getGeminiClient();(0,Y.useEffect)(()=>{Ef&&le&&!pb.current&&!Ua&&!tc&&!Zl&&!Ql&&!A&&fb?.isInitialized?.()&&(sc(Ef),pb.current=!0)},[Ef,le,sc,Ua,tc,Zl,Ql,A,fb]);let[pM,fM]=(0,Y.useState)(!1),[Cf,gM]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{(async()=>{let fe=(await zi.getInstance()).getCurrentIde();gM(fe||null)})()},[]);let Mu=!!(Cf&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!pM),[Du,ac]=(0,Y.useState)(!1),[gb,hM]=(0,Y.useState)(!1),[hb,yM]=(0,Y.useState)(!0),yb=(0,Y.useCallback)(q=>{q>2&&vT(n),q>1&&fi("/quit",void 0,void 0,!1)},[n,fi]),{pressCount:bb,handlePress:Tb}=kl({windowMs:hi,onRepeat:yb}),{pressCount:xb,handlePress:Sb}=kl({windowMs:hi,onRepeat:yb}),[Lu,Eb]=(0,Y.useState)(),[Cb,bM]=(0,Y.useState)(!1),[_f,TM]=(0,Y.useState)(!1),[_b,gi]=of(hi),{isFolderTrustDialogOpen:vf,discoveryResults:vb,handleFolderTrustSelect:Rb,isRestarting:wb}=UI(i,je,c.addItem),Rf=n.getPolicyUpdateConfirmationRequest(),[wf,Ab]=(0,Y.useState)(!!Rf),{needsRestart:Ib,restartReason:Ob}=JS(),Nb=(0,Y.useRef)(!0);NN(n,nt,c,k);let $i=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let q=Ke=>{gi({text:Ke.message,type:Ke.type})},pe=()=>{gi({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},fe=()=>{gi({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Ao.on("transient-message",q),Ao.on("selection-warning",pe),Ao.on("paste-timeout",fe),()=>{Ao.off("transient-message",q),Ao.off("selection-warning",pe),Ao.off("paste-timeout",fe),$i.current&&clearTimeout($i.current)}},[gi]);let Af=(0,Y.useCallback)(q=>{gi({text:q,type:"warning"})},[gi]),{handleSuspend:Mb}=UN({handleWarning:Af,setRawMode:mt,refreshStatic:qt,setForceRerenderKey:h,shouldUseAlternateScreen:rf});(0,Y.useEffect)(()=>{Ib&&TM(!0)},[Ib]),(0,Y.useEffect)(()=>{if(Nb.current){Nb.current=!1;return}let q=setTimeout(()=>{qt()},300);return()=>{clearTimeout(q)}},[tt,qt]),(0,Y.useEffect)(()=>{let q=Hf.subscribe(Eb);return Eb(Hf.get()),q},[]),(0,Y.useEffect)(()=>{let q=()=>{ac(!0),me(!1)};return Ao.on("open-debug-console",q),()=>{Ao.off("open-debug-console",q)}},[n]);let Db=(0,Y.useCallback)(q=>{bM(q)},[]),Lb=(0,Y.useCallback)(q=>{q.userSelection==="yes"?(fi("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):q.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),fM(!0)},[fi,i]),xM=(0,Y.useCallback)(q=>{if(i.merged.general.debugKeystrokeLogging&&_e.log("[DEBUG] Keystroke:",JSON.stringify(q)),Ha&&t(q)&&Ws(!1),p&&o["app.toggleCopyMode"](q))return N(!0),Vs(),!0;if(o["basic.quit"](q))return Yy?.(),Tb(),!0;if(o["basic.exit"](q))return nf.current.text.length>0?!1:(Sb(),!0);if(o["app.suspend"](q))Mb();else if(o["app.toggleCopyMode"](q)&&!p)return gi({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0;let pe=()=>{ue(!0);let Ke=vR(c.history,vo);Ke.length>0&&Q(Ke)},fe=!1;if(se||(fe=!0,me(!0),o["app.showMoreLines"](q)&&pe(),p||qt()),o["app.showErrorDetails"](q))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:Ke}=await import("./devtoolsService-YLSPJ5JS.js");await Ke(n,Du,()=>ac(Ro=>!Ro),()=>ac(!0))})():ac(Ke=>!Ke),!0;if(o["app.showFullTodos"](q))return hM(Ke=>!Ke),!0;if(o["app.toggleMarkdown"](q))return yM(Ke=>{let Ro=!Ke;return qt(),Ro}),!0;if(o["app.showIdeContextDetail"](q)&&n.getIdeMode()&&Lu)return fi("/ide status"),!0;if(o["app.showMoreLines"](q)&&!fe)return me(!1),pe(),qt(),!0;if((o["app.focusShellInput"](q)||o["background.unfocusList"](q))&&(Wi||Or&&Nr.size>0)){if(R){let Ro=rc.current;return $i.current&&clearTimeout($i.current),$i.current=setTimeout(()=>{rc.current===Ro?v(!1):gi({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-rc.current>=100&&!Wi&&!Or?($i.current&&clearTimeout($i.current),Ru(),v(!0),Nr.size>1&&qs(!0),!0):(v(!0),!0)}else{if(o["app.unfocusShellInput"](q)||o["background.unfocus"](q))return R?(v(!1),!0):!1;if(o["background.toggle"](q))return Wi?jy():(Ru(),!Or&&Nr.size>0?(v(!0),Nr.size>1&&qs(!0)):v(!1)),!0;if(o["background.toggleList"](q))return Nr.size>0&&Or&&(R||v(!0),qs(!0)),!0}return!1},[se,me,ac,n,Lu,Tb,Sb,fi,Yy,Wi,Mb,R,i.merged.general.debugKeystrokeLogging,qt,N,$i,p,Ha,jy,Ru,Nr,Or,qs,rc,gi,i.merged.general.devtools,Du,ue,o,t,c.history,vo,Q]);he(xM,{isActive:!0,priority:!0}),he(q=>o["scroll.up"](q)||o["scroll.down"](q)||o["scroll.pageUp"](q)||o["scroll.pageDown"](q)||o["scroll.home"](q)||o["scroll.end"](q)?!1:(N(!1),Ks(),!0),{isActive:P,priority:200}),(0,Y.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let q=Lp({streamingState:ao,thoughtSubject:nc?.subject,isConfirming:!!$s||ob,isSilentWorking:nb,folderName:U1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});Hi.current!==q&&(Hi.current=q,Dt.write(`\x1B]0;${q}\x07`))},[ao,nc,$s,ob,nb,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,Dt]),(0,Y.useEffect)(()=>{let q=pe=>{let fe;switch(pe.severity){case"error":fe="error";break;case"warning":fe="warning";break;case"info":fe="info";break;default:throw new Error(`Unexpected severity for user feedback: ${pe.severity}`)}c.addItem({type:fe,text:pe.message},Date.now()),pe.error&&_e.warn(`[Feedback Details for "${pe.message}"]`,pe.error)};return ve.on("user-feedback",q),ve.drainBacklogs(),()=>{ve.off("user-feedback",q)}},[c]);let kb=e.version.includes("nightly"),Pb=Mu||Mu||vf||wf||H||!!$s||!!oc||!!Eu||!!M||Pi.length>0||!!vu||Zl||af||df||li||Rr||Ua||tc||Ql||A||_f||!!ec||!!fu||!!gu||!!hu||uf||Ir==="awaiting_api_key_input"||!!Co,SM=(0,Y.useMemo)(()=>Km(vo),[vo]),Bb=Pi.length>0,Fb=!!vu,lc=SM||!!$s||!!oc||Bb||Fb||!!ec||!!fu||!!gu||!!hu||!!M,ku=i.merged.ui.loadingPhrases,EM=ku==="tips"||ku==="all",CM=ku==="witty"||ku==="all",_M=(!R||Or)&&ao==="responding"&&!lc,Pu=0;if(lt.length>0&&i.merged.hooksConfig.notifications){let q=lt.length>1?"Executing Hooks":"Executing Hook",pe=lt.map(fe=>fe.name+(fe.index&&fe.total&&fe.total>1?` (${fe.index}/${fe.total})`:"")).join(", ");Pu=q.length+pe.length+10}else _M?Pu=(nc?.subject||"Waiting for model...").length+25:lc&&(Pu=35);let vM=tt-Pu-5,{elapsedTime:Ub,currentLoadingPhrase:Hb,currentTip:Gb,currentWittyPhrase:Wb}=PI({streamingState:ao,shouldShowFocusHint:lM,retryStatus:aM,showTips:EM,showWit:CM,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:vM}),If=n.isPlanEnabled()&&ao==="idle"&&!lc,$b=RN({config:n,addItem:c.addItem,onApprovalModeChange:cM,isActive:!R,allowPlanMode:If});zN({notificationsEnabled:l,isFocused:Nu,hasReceivedFocusEvent:mM,streamingState:ao,hasPendingActionRequired:lc,pendingHistoryItems:vo,commandConfirmationRequest:$s,authConsentRequest:oc,permissionConfirmationRequest:Eu,hasConfirmUpdateExtensionRequests:Bb,hasLoopDetectionConfirmationRequest:Fb});let qb=Tf&&ao==="idle"&&!lc;(0,Y.useEffect)(()=>{Ha&&!qb&&Ws(!1)},[Ha,qb,Ws]),(0,Y.useEffect)(()=>{if(!le||!n.isModelSteeringEnabled()||ao!=="idle"||!ic||Km(vo))return;let q=ff();q&&Ga([{text:ad(q)}])},[n,c,le,ic,ao,Ga,ff,vo,iM]);let RM=(0,Y.useMemo)(()=>Vm(vo),[vo]),[Kb,wM]=(0,Y.useState)(n.getGeminiMdFileCount());(0,Y.useEffect)(()=>{let q=pe=>{wM(pe.fileCount)};return ve.on("memory-changed",q),()=>{ve.off("memory-changed",q)}},[]),(0,Y.useEffect)(()=>{let q=!0;return(async()=>{let[fe,Ke]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);q&&(Ba(fe),Ht(Ke),cr(!0))})(),()=>{q=!1}},[n,qt]);let AM=(0,Y.useMemo)(()=>({history:c.history,historyManager:c,isThemeDialogOpen:Zl,themeError:O,isAuthenticating:Ua,isConfigInitialized:le,authError:Cy,accountSuspensionInfo:Ry,isAuthDialogOpen:tc,isAwaitingApiKeyInput:Ir==="awaiting_api_key_input",apiKeyDefaultValue:_y,editorError:gy,isEditorDialogOpen:Ql,showPrivacyNotice:A,corgiMode:g,debugMessage:b,quittingMessages:x,isSettingsDialogOpen:af,isSessionBrowserOpen:uf,isModelDialogOpen:df,isAgentConfigDialogOpen:li,selectedAgentName:Fs,selectedAgentDisplayName:mr,selectedAgentDefinition:Fi,isPermissionsDialogOpen:Rr,permissionsDialogProps:ks,slashCommands:xu,pendingSlashCommandHistoryItems:Su,commandContext:qy,commandConfirmationRequest:$s,authConsentRequest:oc,confirmUpdateExtensionRequests:Pi,loopDetectionConfirmationRequest:vu,permissionConfirmationRequest:Eu,geminiMdFileCount:Kb,streamingState:ao,initError:gf,pendingGeminiHistoryItems:_u,thought:nc,shellModeActive:j,userMessages:Ce,buffer:pi,inputWidth:Fn,suggestionsWidth:Ar,isInputActive:Tf,isResuming:cf,shouldShowIdePrompt:Mu,isFolderTrustDialogOpen:vf??!1,folderDiscoveryResults:vb,isPolicyUpdateDialogOpen:wf,policyUpdateConfirmationRequest:Rf,isTrustedFolder:nt,constrainHeight:se,showErrorDetails:Du,showFullTodos:gb,ideContextState:Lu,renderMarkdown:hb,ctrlCPressedOnce:bb>=1,ctrlDPressedOnce:xb>=1,showEscapePrompt:Cb,shortcutsHelpVisible:Ha,cleanUiDetailsVisible:bu,isFocused:Nu,elapsedTime:Ub,currentLoadingPhrase:Hb,currentTip:Gb,currentWittyPhrase:Wb,historyRemountKey:we,activeHooks:lt,messageQueue:wu,queueErrorMessage:fn,showApprovalModeIndicator:$b,allowPlanMode:If,currentModel:pr,quota:{userTier:Ui,stats:W,proQuotaRequest:ec,validationRequest:fu,overageMenuRequest:gu,emptyWalletRequest:hu},contextFileNames:mb,errorCount:fr,availableTerminalHeight:Sf,stableControlsHeight:xf,mainAreaWidth:Tn,staticAreaMaxItemHeight:Gi,staticExtraHeight:Bn,dialogsVisible:Pb,pendingHistoryItems:vo,nightly:kb,branchName:Lt,sessionStats:ct,terminalWidth:tt,terminalHeight:Je,mainControlsRef:db,rootUiRef:bn,currentIDE:Cf,updateInfo:Se,showIdeRestartPrompt:_f,ideTrustRestartReason:Ob,isRestarting:wb,extensionsUpdateState:yn,activePtyId:Wi,backgroundTaskCount:yf,isBackgroundTaskVisible:Or,embeddedShellFocused:R,showDebugProfiler:D,customDialog:M,copyModeEnabled:P,transientMessage:_b,bannerData:ur,bannerVisible:hn,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:et,backgroundTasks:Nr,activeBackgroundTaskPid:Jy,backgroundTaskHeight:bf,isBackgroundTaskListOpen:Zy,adminSettingsChanged:H,newAgents:Co,showIsExpandableHint:bt,hintMode:n.isModelSteeringEnabled()&&qm(vo),hintBuffer:""}),[Zl,O,Ua,le,Cy,Ry,tc,gy,Ql,A,g,b,x,af,uf,df,li,Fs,mr,Fi,Rr,ks,xu,Su,qy,$s,oc,Pi,vu,Eu,Kb,ao,gf,_u,nc,j,Ce,pi,Fn,Ar,Tf,cf,Mu,vf,vb,wf,Rf,nt,se,Du,gb,Lu,hb,bb,xb,Cb,Ha,bu,Nu,Ub,Hb,Gb,Wb,we,lt,wu,fn,$b,If,Ui,W,ec,fu,gu,hu,mb,fr,Sf,xf,Tn,Gi,Bn,Pb,vo,kb,Lt,ct,tt,Je,db,bn,Cf,Se,_f,Ob,wb,pr,yn,Wi,yf,Or,c,R,D,M,_y,Ir,P,_b,ur,hn,n,et,bf,Zy,Jy,Nr,H,Co,bt]),Vb=(0,Y.useCallback)(()=>S(!1),[S]),IM=(0,Y.useMemo)(()=>({handleThemeSelect:lf,closeThemeDialog:Sy,handleThemeHighlight:Ey,handleAuthSelect:By,setAuthState:Bo,onAuthError:Un,handleEditorSelect:hy,exitEditorDialog:yy,exitPrivacyNotice:Vb,closeSettingsDialog:Ty,closeModelDialog:Gy,openAgentConfigDialog:ui,closeAgentConfigDialog:wr,openPermissionsDialog:ai,closePermissionsDialog:dr,setShellModeActive:ee,vimHandleInput:cb,handleIdePromptComplete:Lb,handleFolderTrustSelect:Rb,setIsPolicyUpdateDialogOpen:Ab,setConstrainHeight:me,onEscapePromptChange:Db,refreshStatic:qt,handleFinalSubmit:sc,handleClearScreen:lb,handleProQuotaChoice:Iy,handleValidationChoice:Oy,handleOverageMenuChoice:Ny,handleEmptyWalletChoice:My,openSessionBrowser:yu,closeSessionBrowser:Dy,handleResumeSession:Ly,handleDeleteSession:Py,setQueueErrorMessage:Zt,addMessage:Au,popAllMessages:sb,handleApiKeySubmit:Fy,handleApiKeyCancel:Uy,setBannerVisible:cr,setShortcutsHelpVisible:Ws,setCleanUiDetailsVisible:Wy,toggleCleanUiDetailsVisible:$y,revealCleanUiDetailsTemporarily:Tu,handleWarning:Af,setEmbeddedShellFocused:v,dismissBackgroundTask:Qy,setActiveBackgroundTaskPid:eb,setIsBackgroundTaskListOpen:qs,setAuthContext:Gs,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(py.send){let q=n.getRemoteAdminSettings();q&&py.send({type:"admin-settings-update",settings:q})}await Jo()},handleNewAgentsSelect:async q=>{if(Co&&q==="acknowledge"){let pe=n.getAgentRegistry();try{await Promise.all(Co.map(fe=>pe.acknowledgeAgent(fe)))}catch(fe){_e.error("Failed to acknowledge agents:",fe),c.addItem({type:"error",text:`Failed to acknowledge agents: ${gr(fe)}`},Date.now())}}Vo(null)},getPreferredEditor:mi,clearAccountSuspension:()=>{wy(null),Bo("updating")}}),[lf,Sy,Ey,By,Bo,Un,hy,yy,Vb,Ty,Gy,ui,wr,ai,dr,ee,cb,Lb,Rb,Ab,me,Db,qt,sc,lb,Iy,Oy,Ny,My,yu,Dy,Ly,Py,Zt,Au,sb,Fy,Uy,cr,Ws,Wy,$y,Tu,Af,v,Qy,eb,qs,Gs,wy,Co,n,c,mi]);return Ir==="awaiting_google_login_restart"?(0,ki.jsx)(PN,{onDismiss:()=>{Gs({}),Bo("updating")},config:n}):(0,ki.jsx)(yd.Provider,{value:AM,children:(0,ki.jsx)(Bg.Provider,{value:IM,children:(0,ki.jsx)(Za.Provider,{value:n,children:(0,ki.jsx)(Zg.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,ki.jsx)(nv,{config:n,toolCalls:RM,isExpanded:$,toggleExpansion:oe,toggleAllExpansion:Q,children:(0,ki.jsx)(Eh.Provider,{value:Nu,children:(0,ki.jsx)(ZA,{},`app-${y}`)})})})})})})};var kn=E(L(),1);var $1=200;async function hae(e,t,o,n=process.cwd(),r,s){Gw();let i=Ju(Ad(e),e.getScreenReader()),a=i;a&&(Ks(),Qi(()=>{Vs()}));let{matchers:l,errors:c}=await PS();c.forEach(x=>{ve.emitFeedback("warning",x)});let p=await cx();q1(W1(n),t);let g=new cS({onNewMessage:x=>{ve.emitConsoleLog(x.type,x.content)},debugMode:e.getDebugMode()});g.patch(),Qi(g.cleanup);let{stdout:f,stderr:y}=DT(),h=!!process.env.SHPOOL_SESSION_NAME,b=()=>(hp(),(0,kn.jsx)(DS.Provider,{value:t,children:(0,kn.jsx)(BS,{value:l,children:(0,kn.jsx)(LS,{config:e,children:(0,kn.jsx)(R_,{mouseEventsEnabled:a,children:(0,kn.jsx)(nI,{children:(0,kn.jsx)(M_,{children:(0,kn.jsx)(ll,{children:(0,kn.jsx)(zv,{children:(0,kn.jsx)(iE,{children:(0,kn.jsx)(jN,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:s})})})})})})})})})}));h&&await new Promise(x=>setTimeout(x,100));let T=_S(process.env.DEBUG?(0,kn.jsx)(QN.default.StrictMode,{children:(0,kn.jsx)(b,{})}):(0,kn.jsx)(b,{}),{stdout:f,stderr:y,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:x})=>{x>$1&&RT(e,x),rE.reportFrameRendered()},patchConsole:!1,alternateBuffer:i,incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&($a(),Qi(()=>{ju()})),CN(t).then(x=>{pE(x,t,e.getProjectRoot())}).catch(x=>{e.getDebugMode()&&_e.warn("Update check failed:",x)}),Qi(()=>T.unmount()),Qi(nS())}function q1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Lp({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Hn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Hn("\x1B]0;\x07")})}}export{hae as startInteractiveUI};
|
|
119
|
+
${Ke}`:Ke,rb()),fe&&pi.setText(fe)},[pi,Ce,ib,rb,vo]);let ab=(0,Y.useCallback)(q=>{let pe=q.trim();pe&&(n.injectionService.addInjection(pe,"user_steering"),c.addItem({type:"hint",text:pe}))},[n,c]),sc=(0,Y.useCallback)(async q=>{a(),ue(null),se||(me(!0),p||qt());let pe=jo(q.trim()),fe=ao==="idle",Ke=ao==="responding"||qm(vo);if(pe&&Ke){let{commandToExecute:qi}=Ya(q,xu??[]);if(qi?.isSafeConcurrent){fi(q),$e(q);return}}if(n.isModelSteeringEnabled()&&Ke&&!pe){ab(q),$e(q);return}let Ro=le&⁣if(pe&&le||fe&&Ro){if(!pe){let qi=await mS(q,n);if(qi.length>0){Vy({files:qi,onComplete:OM=>{Vy(null),OM.allowed&&qi.forEach(NM=>n.getWorkspaceContext().addReadOnlyPath(NM)),Ga(q)}}),$e(q);return}}Ga(q)}else fe&&!Ro&&wu.length===0&&ve.emitFeedback("info",le?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),Au(q);$e(q)},[Au,$e,Ga,fi,xu,ic,ao,wu.length,vo,n,se,me,p,qt,a,ab,le,ue]),lb=(0,Y.useCallback)(()=>{a(),ue(null),c.clearItems(),Hs(),qt()},[c,Hs,qt,a,ue]),{handleInput:cb}=LI(pi,sc),Tf=!gf&&!C&&!cf&&(ao==="idle"||ao==="responding"||ao==="waiting_for_confirmation")&&!ec&&!P,Iu=(0,Y.useRef)(null),[Ou,uM]=(0,Y.useState)(0),[ub,dM]=(0,Y.useState)(0);(0,Y.useLayoutEffect)(()=>{!P&&Ou>0&&dM(Ou)},[P,Ou]);let xf=P&&ub>0?ub:Ou,db=(0,Y.useCallback)(q=>{if(Iu.current&&(Iu.current.disconnect(),Iu.current=null),q){let pe=new Qo(fe=>{let Ke=fe[0];if(Ke){let Ro=Math.round(Ke.contentRect.height);uM(qi=>Ro!==qi?Ro:qi)}});pe.observe(q),Iu.current=pe}},[]),Sf=Math.max(0,Je-xf-bf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(tt*H1),terminalHeight:Math.max(Math.floor(Sf-G1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Nu,hasReceivedFocusEvent:mM}=MS(),mb=(0,Y.useMemo)(()=>{let q=i.merged.context.fileName;return q?Array.isArray(q)?q:[q]:bT()},[i.merged.context.fileName]),Ef=(0,Y.useMemo)(()=>n.getQuestion(),[n]),pb=(0,Y.useRef)(!1),fb=n.getGeminiClient();(0,Y.useEffect)(()=>{Ef&&le&&!pb.current&&!Ua&&!tc&&!Zl&&!Ql&&!A&&fb?.isInitialized?.()&&(sc(Ef),pb.current=!0)},[Ef,le,sc,Ua,tc,Zl,Ql,A,fb]);let[pM,fM]=(0,Y.useState)(!1),[Cf,gM]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{(async()=>{let fe=(await zi.getInstance()).getCurrentIde();gM(fe||null)})()},[]);let Mu=!!(Cf&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!pM),[Du,ac]=(0,Y.useState)(!1),[gb,hM]=(0,Y.useState)(!1),[hb,yM]=(0,Y.useState)(!0),yb=(0,Y.useCallback)(q=>{q>2&&vT(n),q>1&&fi("/quit",void 0,void 0,!1)},[n,fi]),{pressCount:bb,handlePress:Tb}=kl({windowMs:hi,onRepeat:yb}),{pressCount:xb,handlePress:Sb}=kl({windowMs:hi,onRepeat:yb}),[Lu,Eb]=(0,Y.useState)(),[Cb,bM]=(0,Y.useState)(!1),[_f,TM]=(0,Y.useState)(!1),[_b,gi]=of(hi),{isFolderTrustDialogOpen:vf,discoveryResults:vb,handleFolderTrustSelect:Rb,isRestarting:wb}=UI(i,je,c.addItem),Rf=n.getPolicyUpdateConfirmationRequest(),[wf,Ab]=(0,Y.useState)(!!Rf),{needsRestart:Ib,restartReason:Ob}=JS(),Nb=(0,Y.useRef)(!0);NN(n,nt,c,k);let $i=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let q=Ke=>{gi({text:Ke.message,type:Ke.type})},pe=()=>{gi({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},fe=()=>{gi({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Ao.on("transient-message",q),Ao.on("selection-warning",pe),Ao.on("paste-timeout",fe),()=>{Ao.off("transient-message",q),Ao.off("selection-warning",pe),Ao.off("paste-timeout",fe),$i.current&&clearTimeout($i.current)}},[gi]);let Af=(0,Y.useCallback)(q=>{gi({text:q,type:"warning"})},[gi]),{handleSuspend:Mb}=UN({handleWarning:Af,setRawMode:mt,refreshStatic:qt,setForceRerenderKey:h,shouldUseAlternateScreen:rf});(0,Y.useEffect)(()=>{Ib&&TM(!0)},[Ib]),(0,Y.useEffect)(()=>{if(Nb.current){Nb.current=!1;return}let q=setTimeout(()=>{qt()},300);return()=>{clearTimeout(q)}},[tt,qt]),(0,Y.useEffect)(()=>{let q=Hf.subscribe(Eb);return Eb(Hf.get()),q},[]),(0,Y.useEffect)(()=>{let q=()=>{ac(!0),me(!1)};return Ao.on("open-debug-console",q),()=>{Ao.off("open-debug-console",q)}},[n]);let Db=(0,Y.useCallback)(q=>{bM(q)},[]),Lb=(0,Y.useCallback)(q=>{q.userSelection==="yes"?(fi("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):q.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),fM(!0)},[fi,i]),xM=(0,Y.useCallback)(q=>{if(i.merged.general.debugKeystrokeLogging&&_e.log("[DEBUG] Keystroke:",JSON.stringify(q)),Ha&&t(q)&&Ws(!1),p&&o["app.toggleCopyMode"](q))return N(!0),Vs(),!0;if(o["basic.quit"](q))return Yy?.(),Tb(),!0;if(o["basic.exit"](q))return nf.current.text.length>0?!1:(Sb(),!0);if(o["app.suspend"](q))Mb();else if(o["app.toggleCopyMode"](q)&&!p)return gi({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0;let pe=()=>{ue(!0);let Ke=vR(c.history,vo);Ke.length>0&&Q(Ke)},fe=!1;if(se||(fe=!0,me(!0),o["app.showMoreLines"](q)&&pe(),p||qt()),o["app.showErrorDetails"](q))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:Ke}=await import("./devtoolsService-AGS6ID67.js");await Ke(n,Du,()=>ac(Ro=>!Ro),()=>ac(!0))})():ac(Ke=>!Ke),!0;if(o["app.showFullTodos"](q))return hM(Ke=>!Ke),!0;if(o["app.toggleMarkdown"](q))return yM(Ke=>{let Ro=!Ke;return qt(),Ro}),!0;if(o["app.showIdeContextDetail"](q)&&n.getIdeMode()&&Lu)return fi("/ide status"),!0;if(o["app.showMoreLines"](q)&&!fe)return me(!1),pe(),qt(),!0;if((o["app.focusShellInput"](q)||o["background.unfocusList"](q))&&(Wi||Or&&Nr.size>0)){if(R){let Ro=rc.current;return $i.current&&clearTimeout($i.current),$i.current=setTimeout(()=>{rc.current===Ro?v(!1):gi({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-rc.current>=100&&!Wi&&!Or?($i.current&&clearTimeout($i.current),Ru(),v(!0),Nr.size>1&&qs(!0),!0):(v(!0),!0)}else{if(o["app.unfocusShellInput"](q)||o["background.unfocus"](q))return R?(v(!1),!0):!1;if(o["background.toggle"](q))return Wi?jy():(Ru(),!Or&&Nr.size>0?(v(!0),Nr.size>1&&qs(!0)):v(!1)),!0;if(o["background.toggleList"](q))return Nr.size>0&&Or&&(R||v(!0),qs(!0)),!0}return!1},[se,me,ac,n,Lu,Tb,Sb,fi,Yy,Wi,Mb,R,i.merged.general.debugKeystrokeLogging,qt,N,$i,p,Ha,jy,Ru,Nr,Or,qs,rc,gi,i.merged.general.devtools,Du,ue,o,t,c.history,vo,Q]);he(xM,{isActive:!0,priority:!0}),he(q=>o["scroll.up"](q)||o["scroll.down"](q)||o["scroll.pageUp"](q)||o["scroll.pageDown"](q)||o["scroll.home"](q)||o["scroll.end"](q)?!1:(N(!1),Ks(),!0),{isActive:P,priority:200}),(0,Y.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let q=Lp({streamingState:ao,thoughtSubject:nc?.subject,isConfirming:!!$s||ob,isSilentWorking:nb,folderName:U1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});Hi.current!==q&&(Hi.current=q,Dt.write(`\x1B]0;${q}\x07`))},[ao,nc,$s,ob,nb,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,Dt]),(0,Y.useEffect)(()=>{let q=pe=>{let fe;switch(pe.severity){case"error":fe="error";break;case"warning":fe="warning";break;case"info":fe="info";break;default:throw new Error(`Unexpected severity for user feedback: ${pe.severity}`)}c.addItem({type:fe,text:pe.message},Date.now()),pe.error&&_e.warn(`[Feedback Details for "${pe.message}"]`,pe.error)};return ve.on("user-feedback",q),ve.drainBacklogs(),()=>{ve.off("user-feedback",q)}},[c]);let kb=e.version.includes("nightly"),Pb=Mu||Mu||vf||wf||H||!!$s||!!oc||!!Eu||!!M||Pi.length>0||!!vu||Zl||af||df||li||Rr||Ua||tc||Ql||A||_f||!!ec||!!fu||!!gu||!!hu||uf||Ir==="awaiting_api_key_input"||!!Co,SM=(0,Y.useMemo)(()=>Km(vo),[vo]),Bb=Pi.length>0,Fb=!!vu,lc=SM||!!$s||!!oc||Bb||Fb||!!ec||!!fu||!!gu||!!hu||!!M,ku=i.merged.ui.loadingPhrases,EM=ku==="tips"||ku==="all",CM=ku==="witty"||ku==="all",_M=(!R||Or)&&ao==="responding"&&!lc,Pu=0;if(lt.length>0&&i.merged.hooksConfig.notifications){let q=lt.length>1?"Executing Hooks":"Executing Hook",pe=lt.map(fe=>fe.name+(fe.index&&fe.total&&fe.total>1?` (${fe.index}/${fe.total})`:"")).join(", ");Pu=q.length+pe.length+10}else _M?Pu=(nc?.subject||"Waiting for model...").length+25:lc&&(Pu=35);let vM=tt-Pu-5,{elapsedTime:Ub,currentLoadingPhrase:Hb,currentTip:Gb,currentWittyPhrase:Wb}=PI({streamingState:ao,shouldShowFocusHint:lM,retryStatus:aM,showTips:EM,showWit:CM,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:vM}),If=n.isPlanEnabled()&&ao==="idle"&&!lc,$b=RN({config:n,addItem:c.addItem,onApprovalModeChange:cM,isActive:!R,allowPlanMode:If});zN({notificationsEnabled:l,isFocused:Nu,hasReceivedFocusEvent:mM,streamingState:ao,hasPendingActionRequired:lc,pendingHistoryItems:vo,commandConfirmationRequest:$s,authConsentRequest:oc,permissionConfirmationRequest:Eu,hasConfirmUpdateExtensionRequests:Bb,hasLoopDetectionConfirmationRequest:Fb});let qb=Tf&&ao==="idle"&&!lc;(0,Y.useEffect)(()=>{Ha&&!qb&&Ws(!1)},[Ha,qb,Ws]),(0,Y.useEffect)(()=>{if(!le||!n.isModelSteeringEnabled()||ao!=="idle"||!ic||Km(vo))return;let q=ff();q&&Ga([{text:ad(q)}])},[n,c,le,ic,ao,Ga,ff,vo,iM]);let RM=(0,Y.useMemo)(()=>Vm(vo),[vo]),[Kb,wM]=(0,Y.useState)(n.getGeminiMdFileCount());(0,Y.useEffect)(()=>{let q=pe=>{wM(pe.fileCount)};return ve.on("memory-changed",q),()=>{ve.off("memory-changed",q)}},[]),(0,Y.useEffect)(()=>{let q=!0;return(async()=>{let[fe,Ke]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);q&&(Ba(fe),Ht(Ke),cr(!0))})(),()=>{q=!1}},[n,qt]);let AM=(0,Y.useMemo)(()=>({history:c.history,historyManager:c,isThemeDialogOpen:Zl,themeError:O,isAuthenticating:Ua,isConfigInitialized:le,authError:Cy,accountSuspensionInfo:Ry,isAuthDialogOpen:tc,isAwaitingApiKeyInput:Ir==="awaiting_api_key_input",apiKeyDefaultValue:_y,editorError:gy,isEditorDialogOpen:Ql,showPrivacyNotice:A,corgiMode:g,debugMessage:b,quittingMessages:x,isSettingsDialogOpen:af,isSessionBrowserOpen:uf,isModelDialogOpen:df,isAgentConfigDialogOpen:li,selectedAgentName:Fs,selectedAgentDisplayName:mr,selectedAgentDefinition:Fi,isPermissionsDialogOpen:Rr,permissionsDialogProps:ks,slashCommands:xu,pendingSlashCommandHistoryItems:Su,commandContext:qy,commandConfirmationRequest:$s,authConsentRequest:oc,confirmUpdateExtensionRequests:Pi,loopDetectionConfirmationRequest:vu,permissionConfirmationRequest:Eu,geminiMdFileCount:Kb,streamingState:ao,initError:gf,pendingGeminiHistoryItems:_u,thought:nc,shellModeActive:j,userMessages:Ce,buffer:pi,inputWidth:Fn,suggestionsWidth:Ar,isInputActive:Tf,isResuming:cf,shouldShowIdePrompt:Mu,isFolderTrustDialogOpen:vf??!1,folderDiscoveryResults:vb,isPolicyUpdateDialogOpen:wf,policyUpdateConfirmationRequest:Rf,isTrustedFolder:nt,constrainHeight:se,showErrorDetails:Du,showFullTodos:gb,ideContextState:Lu,renderMarkdown:hb,ctrlCPressedOnce:bb>=1,ctrlDPressedOnce:xb>=1,showEscapePrompt:Cb,shortcutsHelpVisible:Ha,cleanUiDetailsVisible:bu,isFocused:Nu,elapsedTime:Ub,currentLoadingPhrase:Hb,currentTip:Gb,currentWittyPhrase:Wb,historyRemountKey:we,activeHooks:lt,messageQueue:wu,queueErrorMessage:fn,showApprovalModeIndicator:$b,allowPlanMode:If,currentModel:pr,quota:{userTier:Ui,stats:W,proQuotaRequest:ec,validationRequest:fu,overageMenuRequest:gu,emptyWalletRequest:hu},contextFileNames:mb,errorCount:fr,availableTerminalHeight:Sf,stableControlsHeight:xf,mainAreaWidth:Tn,staticAreaMaxItemHeight:Gi,staticExtraHeight:Bn,dialogsVisible:Pb,pendingHistoryItems:vo,nightly:kb,branchName:Lt,sessionStats:ct,terminalWidth:tt,terminalHeight:Je,mainControlsRef:db,rootUiRef:bn,currentIDE:Cf,updateInfo:Se,showIdeRestartPrompt:_f,ideTrustRestartReason:Ob,isRestarting:wb,extensionsUpdateState:yn,activePtyId:Wi,backgroundTaskCount:yf,isBackgroundTaskVisible:Or,embeddedShellFocused:R,showDebugProfiler:D,customDialog:M,copyModeEnabled:P,transientMessage:_b,bannerData:ur,bannerVisible:hn,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:et,backgroundTasks:Nr,activeBackgroundTaskPid:Jy,backgroundTaskHeight:bf,isBackgroundTaskListOpen:Zy,adminSettingsChanged:H,newAgents:Co,showIsExpandableHint:bt,hintMode:n.isModelSteeringEnabled()&&qm(vo),hintBuffer:""}),[Zl,O,Ua,le,Cy,Ry,tc,gy,Ql,A,g,b,x,af,uf,df,li,Fs,mr,Fi,Rr,ks,xu,Su,qy,$s,oc,Pi,vu,Eu,Kb,ao,gf,_u,nc,j,Ce,pi,Fn,Ar,Tf,cf,Mu,vf,vb,wf,Rf,nt,se,Du,gb,Lu,hb,bb,xb,Cb,Ha,bu,Nu,Ub,Hb,Gb,Wb,we,lt,wu,fn,$b,If,Ui,W,ec,fu,gu,hu,mb,fr,Sf,xf,Tn,Gi,Bn,Pb,vo,kb,Lt,ct,tt,Je,db,bn,Cf,Se,_f,Ob,wb,pr,yn,Wi,yf,Or,c,R,D,M,_y,Ir,P,_b,ur,hn,n,et,bf,Zy,Jy,Nr,H,Co,bt]),Vb=(0,Y.useCallback)(()=>S(!1),[S]),IM=(0,Y.useMemo)(()=>({handleThemeSelect:lf,closeThemeDialog:Sy,handleThemeHighlight:Ey,handleAuthSelect:By,setAuthState:Bo,onAuthError:Un,handleEditorSelect:hy,exitEditorDialog:yy,exitPrivacyNotice:Vb,closeSettingsDialog:Ty,closeModelDialog:Gy,openAgentConfigDialog:ui,closeAgentConfigDialog:wr,openPermissionsDialog:ai,closePermissionsDialog:dr,setShellModeActive:ee,vimHandleInput:cb,handleIdePromptComplete:Lb,handleFolderTrustSelect:Rb,setIsPolicyUpdateDialogOpen:Ab,setConstrainHeight:me,onEscapePromptChange:Db,refreshStatic:qt,handleFinalSubmit:sc,handleClearScreen:lb,handleProQuotaChoice:Iy,handleValidationChoice:Oy,handleOverageMenuChoice:Ny,handleEmptyWalletChoice:My,openSessionBrowser:yu,closeSessionBrowser:Dy,handleResumeSession:Ly,handleDeleteSession:Py,setQueueErrorMessage:Zt,addMessage:Au,popAllMessages:sb,handleApiKeySubmit:Fy,handleApiKeyCancel:Uy,setBannerVisible:cr,setShortcutsHelpVisible:Ws,setCleanUiDetailsVisible:Wy,toggleCleanUiDetailsVisible:$y,revealCleanUiDetailsTemporarily:Tu,handleWarning:Af,setEmbeddedShellFocused:v,dismissBackgroundTask:Qy,setActiveBackgroundTaskPid:eb,setIsBackgroundTaskListOpen:qs,setAuthContext:Gs,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(py.send){let q=n.getRemoteAdminSettings();q&&py.send({type:"admin-settings-update",settings:q})}await Jo()},handleNewAgentsSelect:async q=>{if(Co&&q==="acknowledge"){let pe=n.getAgentRegistry();try{await Promise.all(Co.map(fe=>pe.acknowledgeAgent(fe)))}catch(fe){_e.error("Failed to acknowledge agents:",fe),c.addItem({type:"error",text:`Failed to acknowledge agents: ${gr(fe)}`},Date.now())}}Vo(null)},getPreferredEditor:mi,clearAccountSuspension:()=>{wy(null),Bo("updating")}}),[lf,Sy,Ey,By,Bo,Un,hy,yy,Vb,Ty,Gy,ui,wr,ai,dr,ee,cb,Lb,Rb,Ab,me,Db,qt,sc,lb,Iy,Oy,Ny,My,yu,Dy,Ly,Py,Zt,Au,sb,Fy,Uy,cr,Ws,Wy,$y,Tu,Af,v,Qy,eb,qs,Gs,wy,Co,n,c,mi]);return Ir==="awaiting_google_login_restart"?(0,ki.jsx)(PN,{onDismiss:()=>{Gs({}),Bo("updating")},config:n}):(0,ki.jsx)(yd.Provider,{value:AM,children:(0,ki.jsx)(Bg.Provider,{value:IM,children:(0,ki.jsx)(Za.Provider,{value:n,children:(0,ki.jsx)(Zg.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,ki.jsx)(nv,{config:n,toolCalls:RM,isExpanded:$,toggleExpansion:oe,toggleAllExpansion:Q,children:(0,ki.jsx)(Eh.Provider,{value:Nu,children:(0,ki.jsx)(ZA,{},`app-${y}`)})})})})})})};var kn=E(L(),1);var $1=200;async function hae(e,t,o,n=process.cwd(),r,s){Gw();let i=Ju(Ad(e),e.getScreenReader()),a=i;a&&(Ks(),Qi(()=>{Vs()}));let{matchers:l,errors:c}=await PS();c.forEach(x=>{ve.emitFeedback("warning",x)});let p=await cx();q1(W1(n),t);let g=new cS({onNewMessage:x=>{ve.emitConsoleLog(x.type,x.content)},debugMode:e.getDebugMode()});g.patch(),Qi(g.cleanup);let{stdout:f,stderr:y}=DT(),h=!!process.env.SHPOOL_SESSION_NAME,b=()=>(hp(),(0,kn.jsx)(DS.Provider,{value:t,children:(0,kn.jsx)(BS,{value:l,children:(0,kn.jsx)(LS,{config:e,children:(0,kn.jsx)(R_,{mouseEventsEnabled:a,children:(0,kn.jsx)(nI,{children:(0,kn.jsx)(M_,{children:(0,kn.jsx)(ll,{children:(0,kn.jsx)(zv,{children:(0,kn.jsx)(iE,{children:(0,kn.jsx)(jN,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:s})})})})})})})})})}));h&&await new Promise(x=>setTimeout(x,100));let T=_S(process.env.DEBUG?(0,kn.jsx)(QN.default.StrictMode,{children:(0,kn.jsx)(b,{})}):(0,kn.jsx)(b,{}),{stdout:f,stderr:y,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:x})=>{x>$1&&RT(e,x),rE.reportFrameRendered()},patchConsole:!1,alternateBuffer:i,incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&($a(),Qi(()=>{ju()})),CN(t).then(x=>{pE(x,t,e.getProjectRoot())}).catch(x=>{e.getDebugMode()&&_e.warn("Update check failed:",x)}),Qi(()=>T.unmount()),Qi(nS())}function q1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Lp({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Hn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Hn("\x1B]0;\x07")})}}export{hae as startInteractiveUI};
|
|
120
120
|
/**
|
|
121
121
|
* @license
|
|
122
122
|
* Copyright 2025 Google LLC
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
|
-
import{Gf as g,kk as a,mk as p,nk as m,ok as A,pk as T,qk as w,rk as y,sk as U,tk as C,zc as f}from"./chunk-
|
|
2
|
+
import{Gf as g,kk as a,mk as p,nk as m,ok as A,pk as T,qk as w,rk as y,sk as U,tk as C,zc as f}from"./chunk-EBB2IYKE.js";import{Id as n,Rd as l,b as o,be as k,pa as d}from"./chunk-5OV5S6OY.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var v=class extends a{config;agentName;agentCardUrl;type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;constructor(e,t,r,i){super(),this.config=e,this.agentName=t,this.agentCardUrl=i,this.tokenStorage=new m(d.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${n(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${n(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=w(e.redirectUri),i=T(t.state,r),s=await i.port,h=y(e,t,s,void 0);if(!await f(`Authentication required for A2A agent: '${this.agentName}'.`))throw new l("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
|
|
3
3
|
|
|
4
4
|
If the browser does not open, copy and paste this URL into your browser:
|
|
5
5
|
${h}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
|
|
2
|
-
import{Gf as f,kk as a,mk as p,nk as m,ok as A,pk as T,qk as y,rk as v,sk as w,tk as C,zc as g}from"./chunk-
|
|
2
|
+
import{Gf as f,kk as a,mk as p,nk as m,ok as A,pk as T,qk as y,rk as v,sk as w,tk as C,zc as g}from"./chunk-CTQJGFLJ.js";import{Id as i,Rd as l,b as o,be as k,pa as d}from"./chunk-VEQE4EAQ.js";import"./chunk-TWIC4BKL.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import"./chunk-YUXORC52.js";var U=class extends a{constructor(e,t,r,n){super();this.config=e;this.agentName=t;this.agentCardUrl=n;this.tokenStorage=new m(d.getA2AOAuthTokensPath(),"gemini-cli-a2a"),this.authorizationUrl=e.authorization_url,this.tokenUrl=e.token_url,this.scopes=e.scopes,this.mergeAgentCardDefaults(r)}type="oauth2";tokenStorage;cachedToken=null;authorizationUrl;tokenUrl;scopes;async initialize(){(!this.authorizationUrl||!this.tokenUrl)&&this.agentCardUrl&&await this.fetchAgentCardDefaults();let e=await this.tokenStorage.getCredentials(this.agentName);e&&!this.tokenStorage.isTokenExpired(e.token)&&(this.cachedToken=e.token,o.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`))}async headers(){if(this.cachedToken&&!this.tokenStorage.isTokenExpired(this.cachedToken))return{Authorization:`Bearer ${this.cachedToken.accessToken}`};if(this.cachedToken?.refreshToken&&this.tokenUrl&&this.config.client_id)try{let e=await C({clientId:this.config.client_id,clientSecret:this.config.client_secret,scopes:this.scopes},this.cachedToken.refreshToken,this.tokenUrl);return this.cachedToken=this.toOAuthToken(e,this.cachedToken.refreshToken),await this.persistToken(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}catch(e){o.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${i(e)}`),await this.tokenStorage.deleteCredentials(this.agentName)}return this.cachedToken=await this.authenticateInteractively(),{Authorization:`Bearer ${this.cachedToken.accessToken}`}}async shouldRetryWithHeaders(e,t){if(t.status!==401&&t.status!==403){this.authRetryCount=0;return}if(!(this.authRetryCount>=a.MAX_AUTH_RETRIES))return this.authRetryCount++,o.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"),this.cachedToken=null,await this.tokenStorage.deleteCredentials(this.agentName),this.headers()}mergeAgentCardDefaults(e){if(e?.securitySchemes){for(let t of Object.values(e.securitySchemes))if(t.type==="oauth2"&&t.flows.authorizationCode){let r=t.flows.authorizationCode;this.authorizationUrl??=r.authorizationUrl,this.tokenUrl??=r.tokenUrl,this.scopes??=Object.keys(r.scopes);break}}}async fetchAgentCardDefaults(){if(this.agentCardUrl)try{o.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);let t=await new p().resolve(this.agentCardUrl,"");this.mergeAgentCardDefaults(t)}catch(e){o.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${i(e)}`)}}async authenticateInteractively(){if(!this.config.client_id)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);if(!this.authorizationUrl||!this.tokenUrl)throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);let e={clientId:this.config.client_id,clientSecret:this.config.client_secret,authorizationUrl:this.authorizationUrl,tokenUrl:this.tokenUrl,scopes:this.scopes},t=A(),r=y(e.redirectUri),n=T(t.state,r),s=await n.port,h=v(e,t,s,void 0);if(!await g(`Authentication required for A2A agent: '${this.agentName}'.`))throw new l("Authentication cancelled by user.");k.emitFeedback("info",`\u2192 Opening your browser for OAuth sign-in...
|
|
3
3
|
|
|
4
4
|
If the browser does not open, copy and paste this URL into your browser:
|
|
5
5
|
${h}
|