makecoder 2.0.100 → 2.0.101

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.
@@ -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 lS,$b as LS,$c as Vo,A as Wx,Aa as oS,Ab as m,Ac as XS,B as $x,Ba as il,Bb as c,Bc as jS,C as Qr,Ca as mt,Cb as SS,Cc as Id,Db as ES,Dc as ve,E as fs,Eb as CS,Ec as QS,F as Di,Fb as _S,Fc as JS,G as Kx,Gb as qo,Gc as ZS,H as ua,Ha as nS,Hb as bs,Hc as Nd,I as uo,Ib as RS,Ic as Od,J as Ed,Jb as cl,Jc as Md,K as qt,Kb as Mn,Kc as Dd,L as mr,Lb as d,Lc as eE,M as bo,Mb as wS,Mc as tE,N as $f,Nb as vS,Nc as ml,O as jn,Ob as Xf,Oc as oE,P as qx,Pb as AS,Pc as Jf,Q,Qa as rS,Qb as IS,Qc as nE,R as gs,Rb as NS,Rc as rE,S as Vx,Sb as OS,Sc as pl,Tb as tt,Tc as iE,Ub as vd,Uc as pr,V as zx,Vb as M,Vc as Ld,W as Yx,Wb as MS,Wc as sE,X as Kf,Xa as iS,Xb as be,Xc as Dn,Ya as sS,Yb as vt,Yc as Bc,Z as Xx,Za as qf,Zb as kc,Zc as aE,_a as aS,_b as DS,_c as lE,aa as jx,ab as cS,ac as kS,ad as cE,b as la,ba as Qx,bb as uS,bc as it,bd as kd,c as Ax,cb as fn,cc as Ad,cd as uE,d as Xr,da as Li,db as Vf,dc as Ze,dd as dE,e as Nc,ea as Jx,eb as sl,ec as PS,ed as mE,f as Mi,fb as dS,fc as jf,g as Ix,gb as mS,gc as BS,gd as Pd,h as Gf,hb as Rd,hc as FS,hd as pE,i as Nx,ia as hs,ib as pS,ic as US,id as fE,j as Ox,jb as Zr,jc as HS,k as Mx,kb as Dc,kc as GS,kd as hn,l as Dx,lb as fS,lc as WS,ld as gE,m as jr,ma as Jr,mb as Lc,mc as $S,md as Bt,n as Lx,nb as ys,nc as KS,o as kx,oa as Zx,ob as al,oc as ul,p as Px,pb as wd,pc as da,q as Wf,qa as Cd,qb as gS,qc as qS,r as Oc,rb as hS,rc as Qf,s as Bx,sb as zf,sc as VS,t as Fx,tb as yS,tc as ma,u as Ux,ub as Yf,uc as pa,v as Hx,va as eS,vb as bS,vc as Pc,w as Gx,wb as ll,wc as zS,x as ca,xb as TS,xc as YS,y as Mc,ya as _d,yb as gn,yc as dl,za as tS,zb as xS,zc as Rt}from"./chunk-WQ23SZKZ.js";import{$c as DT,$k as gx,Ac as cd,Ag as ox,Am as xd,Bc as AT,Bd as FT,Cc as ud,Ce as VT,Dc as IT,Dd as UT,Dl as Or,Eb as Oi,El as rl,Em as Sd,Fd as HT,Fk as fx,Fm as aa,Gf as ms,Hb as _T,Hf as el,Hg as gd,Hl as hx,If as tl,Il as yx,Im as Ex,Ja as Nf,Jc as dd,Jd as GT,Jh as pn,Jm as Uf,Kf as jT,Kl as bx,L as pT,Le as ia,Lf as QT,Lm as Cx,Mc as NT,Mk as Td,N as rd,Ne as zT,Nf as JT,Ni as yo,Nm as _x,O as Ac,Oi as ol,Pb as Of,Pm as Rx,Qb as Mf,Qm as wx,Rg as nx,T as If,Tg as rx,Th as sa,Ug as ix,Ui as Pf,Vb as RT,Vg as sx,W as yT,Wi as mx,Xa as bT,Xc as OT,Xg as ut,Xh as ho,Ya as TT,Yf as ZT,Za as xT,Zc as Df,_c as MT,ac as wT,ak as nl,bd as LT,bf as Ic,cd as kT,ce as md,cf as YT,dd as PT,df as pd,ee as WT,em as Tx,ge as $T,gf as fd,gh as ax,hf as XT,hg as ex,hj as Bf,ij as px,lc as Xn,ln as vx,mj as hd,mk as Ff,na as sd,oa as ad,oc as vT,on as Hf,pa as de,pe as KT,pm as xx,qc as cs,rc as us,rf as kf,ri as lx,tb as ST,tg as tx,ti as cx,ub as ET,ui as ux,we as Lf,wi as ps,x as mT,xb as CT,xd as ds,xm as Sx,yc as ld,yi as dx,yk as bd,zc as Za,zd as BT,ze as qT}from"./chunk-RJWN4TV6.js";import{Aa as wf,Ba as vf,Ca as Cc,D as et,Da as _c,Ea as Rc,Fa as ls,Ga as wc,Gd as dT,Ha as jb,Ia as Zu,Ja as vc,K as Ni,L as Hb,Ld as id,M as Gb,Nd as Nr,S as Wb,Sa as Xt,T as $b,U as Ec,Ua as ed,V as Qu,W as Kb,X as Ju,Y as rt,Z as Yr,Za as Qb,_b as td,_d as fT,aa as qb,ae as gT,b as Re,c as Fb,ca as Vb,ce as hT,dd as Af,ea as zb,ee as je,fa as Yb,ge as we,ha as Xb,j as Ub,ld as oT,md as nT,od as rT,pc as od,pd as iT,qc as nd,qd as sT,rc as Zb,rd as aT,sa as Ja,sc as eT,sd as lT,t as tn,tc as tT,td as cT,ud as uT,ye as yd,za as Rf,zb as Jb}from"./chunk-7FAQMMW2.js";import"./chunk-TWIC4BKL.js";import{c as Lt}from"./chunk-TU3BMADG.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as Dt,c as It,d as fM,e as C}from"./chunk-YUXORC52.js";var YC=It((sU,zC)=>{function kC(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)&&kC(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 PC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Ss(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 eD="</span>",IC=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}`},ig=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=PC(t)}openNode(t){if(!IC(t))return;let o=tD(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){IC(t)&&(this.buffer+=eD)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},NC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},sg=class e{constructor(){this.rootNode=NC(),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=NC({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)}))}},ag=class extends sg{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 ig(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Uc(e){return e?typeof e=="string"?e:e.source:null}function BC(e){return ga("(?=",e,")")}function oD(e){return ga("(?:",e,")*")}function nD(e){return ga("(?:",e,")?")}function ga(...e){return e.map(o=>Uc(o)).join("")}function rD(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function cg(...e){return"("+(rD(e).capture?"":"?:")+e.map(n=>Uc(n)).join("|")+")"}function FC(e){return new RegExp(e.toString()+"|").exec("").length-1}function iD(e,t){let o=e&&e.exec(t);return o&&o.index===0}var sD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ug(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,a=Uc(n),i="";for(;a.length>0;){let s=sD.exec(a);if(!s){i+=a;break}i+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?i+="\\"+String(Number(s[1])+r):(i+=s[0],s[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var aD=/\b\B/,UC="[a-zA-Z]\\w*",dg="[a-zA-Z_]\\w*",HC="\\b\\d+(\\.\\d+)?",GC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",WC="\\b(0b[01]+)",lD="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",cD=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=ga(t,/.*\b/,e.binary,/\b.*/)),Ss({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},Hc={begin:"\\\\[\\s\\S]",relevance:0},uD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Hc]},dD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Hc]},mD={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=Ss({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=cg("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:ga(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},pD=Jd("//","$"),fD=Jd("/\\*","\\*/"),gD=Jd("#","$"),hD={scope:"number",begin:HC,relevance:0},yD={scope:"number",begin:GC,relevance:0},bD={scope:"number",begin:WC,relevance:0},TD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Hc,{begin:/\[/,end:/\]/,relevance:0,contains:[Hc]}]},xD={scope:"title",begin:UC,relevance:0},SD={scope:"title",begin:dg,relevance:0},ED={begin:"\\.\\s*"+dg,relevance:0},CD=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:Hc,BINARY_NUMBER_MODE:bD,BINARY_NUMBER_RE:WC,COMMENT:Jd,C_BLOCK_COMMENT_MODE:fD,C_LINE_COMMENT_MODE:pD,C_NUMBER_MODE:yD,C_NUMBER_RE:GC,END_SAME_AS_BEGIN:CD,HASH_COMMENT_MODE:gD,IDENT_RE:UC,MATCH_NOTHING_RE:aD,METHOD_GUARD:ED,NUMBER_MODE:hD,NUMBER_RE:HC,PHRASAL_WORDS_MODE:mD,QUOTE_STRING_MODE:dD,REGEXP_MODE:TD,RE_STARTERS_RE:lD,SHEBANG:cD,TITLE_MODE:xD,UNDERSCORE_IDENT_RE:dg,UNDERSCORE_TITLE_MODE:SD});function _D(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function RD(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function wD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=_D,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function vD(e,t){Array.isArray(e.illegal)&&(e.illegal=cg(...e.illegal))}function AD(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 ID(e,t){e.relevance===void 0&&(e.relevance=1)}var ND=(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=ga(o.beforeMatch,BC(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},OD=["of","and","for","in","not","or","if","then","parent","list","value"],MD="keyword";function $C(e,t,o=MD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(a){Object.assign(n,$C(e[a],t,a))}),n;function r(a,i){t&&(i=i.map(s=>s.toLowerCase())),i.forEach(function(s){let l=s.split("|");n[l[0]]=[a,DD(l[0],l[1])]})}}function DD(e,t){return t?Number(t):LD(e)?0:1}function LD(e){return OD.includes(e.toLowerCase())}var OC={},fa=e=>{console.error(e)},MC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Tl=(e,t)=>{OC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),OC[`${e}/${t}`]=!0)},Qd=new Error;function KC(e,t,{key:o}){let n=0,r=e[o],a={},i={};for(let s=1;s<=t.length;s++)i[s+n]=r[s],a[s+n]=!0,n+=FC(t[s-1]);e[o]=i,e[o]._emit=a,e[o]._multi=!0}function kD(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw fa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qd;if(typeof e.beginScope!="object"||e.beginScope===null)throw fa("beginScope must be object"),Qd;KC(e,e.begin,{key:"beginScope"}),e.begin=ug(e.begin,{joinWith:""})}}function PD(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw fa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qd;if(typeof e.endScope!="object"||e.endScope===null)throw fa("endScope must be object"),Qd;KC(e,e.end,{key:"endScope"}),e.end=ug(e.end,{joinWith:""})}}function BD(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function FD(e){BD(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),kD(e),PD(e)}function UD(e){function t(i,s){return new RegExp(Uc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=FC(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let s=this.regexes.map(l=>l[1]);this.matcherRe=t(ug(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(s);if(!l)return null;let u=l.findIndex((y,f)=>f>0&&y!==void 0),p=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];let l=new o;return this.rules.slice(s).forEach(([u,p])=>l.addRule(u,p)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,u=p.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(i){let s=new n;return i.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&s.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&s.addRule(i.illegal,{type:"illegal"}),s}function a(i,s){let l=i;if(i.isCompiled)return l;[RD,AD,FD,ND].forEach(p=>p(i,s)),e.compilerExtensions.forEach(p=>p(i,s)),i.__beforeBegin=null,[wD,vD,ID].forEach(p=>p(i,s)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=$C(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),s&&(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=Uc(l.end)||"",i.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return HD(p==="self"?i:p)})),i.contains.forEach(function(p){a(p,l)}),i.starts&&a(i.starts,s),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=Ss(e.classNameAliases||{}),a(e)}function qC(e){return e?e.endsWithParent||qC(e.starts):!1}function HD(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ss(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:qC(e)?Ss(e,{starts:e.starts?Ss(e.starts):null}):Object.isFrozen(e)?Ss(e):e}var GD="11.11.1",lg=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},rg=PC,DC=Ss,LC=Symbol("nomatch"),WD=7,VC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,a="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ag};function l(O){return s.noHighlightRe.test(O)}function u(O){let L=O.className+" ";L+=O.parentNode?O.parentNode.className:"";let P=s.languageDetectRe.exec(L);if(P){let $=I(P[1]);return $||(MC(a.replace("{}",P[1])),MC("Falling back to no-highlight mode for this block.",O)),$?P[1]:"no-highlight"}return L.split(/\s+/).find($=>l($)||I($))}function p(O,L,P){let $="",K="";typeof L=="object"?($=O,P=L.ignoreIllegals,K=L.language):(Tl("10.7.0","highlight(lang, code, ...args) has been deprecated."),Tl("10.7.0",`Please use highlight(code, options) instead.
2
+ import{$a as lS,$b as LS,$c as Vo,A as Wx,Aa as oS,Ab as m,Ac as XS,B as $x,Ba as il,Bb as c,Bc as jS,C as Qr,Ca as mt,Cb as SS,Cc as Id,Db as ES,Dc as ve,E as fs,Eb as CS,Ec as QS,F as Di,Fb as _S,Fc as JS,G as Kx,Gb as qo,Gc as ZS,H as ua,Ha as nS,Hb as bs,Hc as Nd,I as uo,Ib as RS,Ic as Od,J as Ed,Jb as cl,Jc as Md,K as qt,Kb as Mn,Kc as Dd,L as mr,Lb as d,Lc as eE,M as bo,Mb as wS,Mc as tE,N as $f,Nb as vS,Nc as ml,O as jn,Ob as Xf,Oc as oE,P as qx,Pb as AS,Pc as Jf,Q,Qa as rS,Qb as IS,Qc as nE,R as gs,Rb as NS,Rc as rE,S as Vx,Sb as OS,Sc as pl,Tb as tt,Tc as iE,Ub as vd,Uc as pr,V as zx,Vb as M,Vc as Ld,W as Yx,Wb as MS,Wc as sE,X as Kf,Xa as iS,Xb as be,Xc as Dn,Ya as sS,Yb as vt,Yc as Bc,Z as Xx,Za as qf,Zb as kc,Zc as aE,_a as aS,_b as DS,_c as lE,aa as jx,ab as cS,ac as kS,ad as cE,b as la,ba as Qx,bb as uS,bc as it,bd as kd,c as Ax,cb as fn,cc as Ad,cd as uE,d as Xr,da as Li,db as Vf,dc as Ze,dd as dE,e as Nc,ea as Jx,eb as sl,ec as PS,ed as mE,f as Mi,fb as dS,fc as jf,g as Ix,gb as mS,gc as BS,gd as Pd,h as Gf,hb as Rd,hc as FS,hd as pE,i as Nx,ia as hs,ib as pS,ic as US,id as fE,j as Ox,jb as Zr,jc as HS,k as Mx,kb as Dc,kc as GS,kd as hn,l as Dx,lb as fS,lc as WS,ld as gE,m as jr,ma as Jr,mb as Lc,mc as $S,md as Bt,n as Lx,nb as ys,nc as KS,o as kx,oa as Zx,ob as al,oc as ul,p as Px,pb as wd,pc as da,q as Wf,qa as Cd,qb as gS,qc as qS,r as Oc,rb as hS,rc as Qf,s as Bx,sb as zf,sc as VS,t as Fx,tb as yS,tc as ma,u as Ux,ub as Yf,uc as pa,v as Hx,va as eS,vb as bS,vc as Pc,w as Gx,wb as ll,wc as zS,x as ca,xb as TS,xc as YS,y as Mc,ya as _d,yb as gn,yc as dl,za as tS,zb as xS,zc as Rt}from"./chunk-WXQ3OUHY.js";import{$c as DT,$k as gx,Ac as cd,Ag as ox,Am as xd,Bc as AT,Bd as FT,Cc as ud,Ce as VT,Dc as IT,Dd as UT,Dl as Or,Eb as Oi,El as rl,Em as Sd,Fd as HT,Fk as fx,Fm as aa,Gf as ms,Hb as _T,Hf as el,Hg as gd,Hl as hx,If as tl,Il as yx,Im as Ex,Ja as Nf,Jc as dd,Jd as GT,Jh as pn,Jm as Uf,Kf as jT,Kl as bx,L as pT,Le as ia,Lf as QT,Lm as Cx,Mc as NT,Mk as Td,N as rd,Ne as zT,Nf as JT,Ni as yo,Nm as _x,O as Ac,Oi as ol,Pb as Of,Pm as Rx,Qb as Mf,Qm as wx,Rg as nx,T as If,Tg as rx,Th as sa,Ug as ix,Ui as Pf,Vb as RT,Vg as sx,W as yT,Wi as mx,Xa as bT,Xc as OT,Xg as ut,Xh as ho,Ya as TT,Yf as ZT,Za as xT,Zc as Df,_c as MT,ac as wT,ak as nl,bd as LT,bf as Ic,cd as kT,ce as md,cf as YT,dd as PT,df as pd,ee as WT,em as Tx,ge as $T,gf as fd,gh as ax,hf as XT,hg as ex,hj as Bf,ij as px,lc as Xn,ln as vx,mj as hd,mk as Ff,na as sd,oa as ad,oc as vT,on as Hf,pa as de,pe as KT,pm as xx,qc as cs,rc as us,rf as kf,ri as lx,tb as ST,tg as tx,ti as cx,ub as ET,ui as ux,we as Lf,wi as ps,x as mT,xb as CT,xd as ds,xm as Sx,yc as ld,yi as dx,yk as bd,zc as Za,zd as BT,ze as qT}from"./chunk-VHTOM3KV.js";import{Aa as wf,Ba as vf,Ca as Cc,D as et,Da as _c,Ea as Rc,Fa as ls,Ga as wc,Gd as dT,Ha as jb,Ia as Zu,Ja as vc,K as Ni,L as Hb,Ld as id,M as Gb,Nd as Nr,S as Wb,Sa as Xt,T as $b,U as Ec,Ua as ed,V as Qu,W as Kb,X as Ju,Y as rt,Z as Yr,Za as Qb,_b as td,_d as fT,aa as qb,ae as gT,b as Re,c as Fb,ca as Vb,ce as hT,dd as Af,ea as zb,ee as je,fa as Yb,ge as we,ha as Xb,j as Ub,ld as oT,md as nT,od as rT,pc as od,pd as iT,qc as nd,qd as sT,rc as Zb,rd as aT,sa as Ja,sc as eT,sd as lT,t as tn,tc as tT,td as cT,ud as uT,ye as yd,za as Rf,zb as Jb}from"./chunk-7FAQMMW2.js";import"./chunk-TWIC4BKL.js";import{c as Lt}from"./chunk-TU3BMADG.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as Dt,c as It,d as fM,e as C}from"./chunk-YUXORC52.js";var YC=It((sU,zC)=>{function kC(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)&&kC(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 PC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Ss(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 eD="</span>",IC=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}`},ig=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=PC(t)}openNode(t){if(!IC(t))return;let o=tD(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){IC(t)&&(this.buffer+=eD)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},NC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},sg=class e{constructor(){this.rootNode=NC(),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=NC({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)}))}},ag=class extends sg{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 ig(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Uc(e){return e?typeof e=="string"?e:e.source:null}function BC(e){return ga("(?=",e,")")}function oD(e){return ga("(?:",e,")*")}function nD(e){return ga("(?:",e,")?")}function ga(...e){return e.map(o=>Uc(o)).join("")}function rD(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function cg(...e){return"("+(rD(e).capture?"":"?:")+e.map(n=>Uc(n)).join("|")+")"}function FC(e){return new RegExp(e.toString()+"|").exec("").length-1}function iD(e,t){let o=e&&e.exec(t);return o&&o.index===0}var sD=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ug(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,a=Uc(n),i="";for(;a.length>0;){let s=sD.exec(a);if(!s){i+=a;break}i+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?i+="\\"+String(Number(s[1])+r):(i+=s[0],s[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var aD=/\b\B/,UC="[a-zA-Z]\\w*",dg="[a-zA-Z_]\\w*",HC="\\b\\d+(\\.\\d+)?",GC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",WC="\\b(0b[01]+)",lD="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",cD=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=ga(t,/.*\b/,e.binary,/\b.*/)),Ss({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},Hc={begin:"\\\\[\\s\\S]",relevance:0},uD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Hc]},dD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Hc]},mD={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=Ss({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=cg("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:ga(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},pD=Jd("//","$"),fD=Jd("/\\*","\\*/"),gD=Jd("#","$"),hD={scope:"number",begin:HC,relevance:0},yD={scope:"number",begin:GC,relevance:0},bD={scope:"number",begin:WC,relevance:0},TD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Hc,{begin:/\[/,end:/\]/,relevance:0,contains:[Hc]}]},xD={scope:"title",begin:UC,relevance:0},SD={scope:"title",begin:dg,relevance:0},ED={begin:"\\.\\s*"+dg,relevance:0},CD=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:Hc,BINARY_NUMBER_MODE:bD,BINARY_NUMBER_RE:WC,COMMENT:Jd,C_BLOCK_COMMENT_MODE:fD,C_LINE_COMMENT_MODE:pD,C_NUMBER_MODE:yD,C_NUMBER_RE:GC,END_SAME_AS_BEGIN:CD,HASH_COMMENT_MODE:gD,IDENT_RE:UC,MATCH_NOTHING_RE:aD,METHOD_GUARD:ED,NUMBER_MODE:hD,NUMBER_RE:HC,PHRASAL_WORDS_MODE:mD,QUOTE_STRING_MODE:dD,REGEXP_MODE:TD,RE_STARTERS_RE:lD,SHEBANG:cD,TITLE_MODE:xD,UNDERSCORE_IDENT_RE:dg,UNDERSCORE_TITLE_MODE:SD});function _D(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function RD(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function wD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=_D,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function vD(e,t){Array.isArray(e.illegal)&&(e.illegal=cg(...e.illegal))}function AD(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 ID(e,t){e.relevance===void 0&&(e.relevance=1)}var ND=(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=ga(o.beforeMatch,BC(o.begin)),e.starts={relevance:0,contains:[Object.assign(o,{endsParent:!0})]},e.relevance=0,delete o.beforeMatch},OD=["of","and","for","in","not","or","if","then","parent","list","value"],MD="keyword";function $C(e,t,o=MD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(a){Object.assign(n,$C(e[a],t,a))}),n;function r(a,i){t&&(i=i.map(s=>s.toLowerCase())),i.forEach(function(s){let l=s.split("|");n[l[0]]=[a,DD(l[0],l[1])]})}}function DD(e,t){return t?Number(t):LD(e)?0:1}function LD(e){return OD.includes(e.toLowerCase())}var OC={},fa=e=>{console.error(e)},MC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Tl=(e,t)=>{OC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),OC[`${e}/${t}`]=!0)},Qd=new Error;function KC(e,t,{key:o}){let n=0,r=e[o],a={},i={};for(let s=1;s<=t.length;s++)i[s+n]=r[s],a[s+n]=!0,n+=FC(t[s-1]);e[o]=i,e[o]._emit=a,e[o]._multi=!0}function kD(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw fa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qd;if(typeof e.beginScope!="object"||e.beginScope===null)throw fa("beginScope must be object"),Qd;KC(e,e.begin,{key:"beginScope"}),e.begin=ug(e.begin,{joinWith:""})}}function PD(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw fa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qd;if(typeof e.endScope!="object"||e.endScope===null)throw fa("endScope must be object"),Qd;KC(e,e.end,{key:"endScope"}),e.end=ug(e.end,{joinWith:""})}}function BD(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function FD(e){BD(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),kD(e),PD(e)}function UD(e){function t(i,s){return new RegExp(Uc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=FC(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let s=this.regexes.map(l=>l[1]);this.matcherRe=t(ug(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(s);if(!l)return null;let u=l.findIndex((y,f)=>f>0&&y!==void 0),p=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];let l=new o;return this.rules.slice(s).forEach(([u,p])=>l.addRule(u,p)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,u=p.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(i){let s=new n;return i.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&s.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&s.addRule(i.illegal,{type:"illegal"}),s}function a(i,s){let l=i;if(i.isCompiled)return l;[RD,AD,FD,ND].forEach(p=>p(i,s)),e.compilerExtensions.forEach(p=>p(i,s)),i.__beforeBegin=null,[wD,vD,ID].forEach(p=>p(i,s)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=$C(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),s&&(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=Uc(l.end)||"",i.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return HD(p==="self"?i:p)})),i.contains.forEach(function(p){a(p,l)}),i.starts&&a(i.starts,s),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=Ss(e.classNameAliases||{}),a(e)}function qC(e){return e?e.endsWithParent||qC(e.starts):!1}function HD(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ss(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:qC(e)?Ss(e,{starts:e.starts?Ss(e.starts):null}):Object.isFrozen(e)?Ss(e):e}var GD="11.11.1",lg=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},rg=PC,DC=Ss,LC=Symbol("nomatch"),WD=7,VC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,a="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ag};function l(O){return s.noHighlightRe.test(O)}function u(O){let L=O.className+" ";L+=O.parentNode?O.parentNode.className:"";let P=s.languageDetectRe.exec(L);if(P){let $=I(P[1]);return $||(MC(a.replace("{}",P[1])),MC("Falling back to no-highlight mode for this block.",O)),$?P[1]:"no-highlight"}return L.split(/\s+/).find($=>l($)||I($))}function p(O,L,P){let $="",K="";typeof L=="object"?($=O,P=L.ignoreIllegals,K=L.language):(Tl("10.7.0","highlight(lang, code, ...args) has been deprecated."),Tl("10.7.0",`Please use highlight(code, options) instead.
3
3
  https://github.com/highlightjs/highlight.js/issues/2277`),K=O,$=L),P===void 0&&(P=!0);let z={code:$,language:K};F("before:highlight",z);let H=z.result?z.result:y(z.language,z.code,P);return H.code=z.code,F("after:highlight",H),H}function y(O,L,P,$){let K=Object.create(null);function z(j,Z){return j.keywords[Z]}function H(){if(!te.keywords){Ke.addText(Ve);return}let j=0;te.keywordPatternRe.lastIndex=0;let Z=te.keywordPatternRe.exec(Ve),ie="";for(;Z;){ie+=Ve.substring(j,Z.index);let ye=Oe.case_insensitive?Z[0].toLowerCase():Z[0],Pe=z(te,ye);if(Pe){let[fe,Tt]=Pe;if(Ke.addText(ie),ie="",K[ye]=(K[ye]||0)+1,K[ye]<=WD&&(_o+=Tt),fe.startsWith("_"))ie+=Z[0];else{let Lo=Oe.classNameAliases[fe]||fe;U(Z[0],Lo)}}else ie+=Z[0];j=te.keywordPatternRe.lastIndex,Z=te.keywordPatternRe.exec(Ve)}ie+=Ve.substring(j),Ke.addText(ie)}function J(){if(Ve==="")return;let j=null;if(typeof te.subLanguage=="string"){if(!t[te.subLanguage]){Ke.addText(Ve);return}j=y(te.subLanguage,Ve,!0,ot[te.subLanguage]),ot[te.subLanguage]=j._top}else j=g(Ve,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(_o+=j.relevance),Ke.__addSublanguage(j._emitter,j.language)}function ce(){te.subLanguage!=null?J():H(),Ve=""}function U(j,Z){j!==""&&(Ke.startScope(Z),Ke.addText(j),Ke.endScope())}function Y(j,Z){let ie=1,ye=Z.length-1;for(;ie<=ye;){if(!j._emit[ie]){ie++;continue}let Pe=Oe.classNameAliases[j[ie]]||j[ie],fe=Z[ie];Pe?U(fe,Pe):(Ve=fe,H(),Ve=""),ie++}}function ee(j,Z){return j.scope&&typeof j.scope=="string"&&Ke.openNode(Oe.classNameAliases[j.scope]||j.scope),j.beginScope&&(j.beginScope._wrap?(U(Ve,Oe.classNameAliases[j.beginScope._wrap]||j.beginScope._wrap),Ve=""):j.beginScope._multi&&(Y(j.beginScope,Z),Ve="")),te=Object.create(j,{parent:{value:te}}),te}function X(j,Z,ie){let ye=iD(j.endRe,ie);if(ye){if(j["on:end"]){let Pe=new jd(j);j["on:end"](Z,Pe),Pe.isMatchIgnored&&(ye=!1)}if(ye){for(;j.endsParent&&j.parent;)j=j.parent;return j}}if(j.endsWithParent)return X(j.parent,Z,ie)}function ne(j){return te.matcher.regexIndex===0?(Ve+=j[0],1):($t=!0,0)}function le(j){let Z=j[0],ie=j.rule,ye=new jd(ie),Pe=[ie.__beforeBegin,ie["on:begin"]];for(let fe of Pe)if(fe&&(fe(j,ye),ye.isMatchIgnored))return ne(Z);return ie.skip?Ve+=Z:(ie.excludeBegin&&(Ve+=Z),ce(),!ie.returnBegin&&!ie.excludeBegin&&(Ve=Z)),ee(ie,j),ie.returnBegin?0:Z.length}function re(j){let Z=j[0],ie=L.substring(j.index),ye=X(te,j,ie);if(!ye)return LC;let Pe=te;te.endScope&&te.endScope._wrap?(ce(),U(Z,te.endScope._wrap)):te.endScope&&te.endScope._multi?(ce(),Y(te.endScope,j)):Pe.skip?Ve+=Z:(Pe.returnEnd||Pe.excludeEnd||(Ve+=Z),ce(),Pe.excludeEnd&&(Ve=Z));do te.scope&&Ke.closeNode(),!te.skip&&!te.subLanguage&&(_o+=te.relevance),te=te.parent;while(te!==ye.parent);return ye.starts&&ee(ye.starts,j),Pe.returnEnd?0:Z.length}function ae(){let j=[];for(let Z=te;Z!==Oe;Z=Z.parent)Z.scope&&j.unshift(Z.scope);j.forEach(Z=>Ke.openNode(Z))}let he={};function Qe(j,Z){let ie=Z&&Z[0];if(Ve+=j,ie==null)return ce(),0;if(he.type==="begin"&&Z.type==="end"&&he.index===Z.index&&ie===""){if(Ve+=L.slice(Z.index,Z.index+1),!r){let ye=new Error(`0 width match regex (${O})`);throw ye.languageName=O,ye.badRule=he.rule,ye}return 1}if(he=Z,Z.type==="begin")return le(Z);if(Z.type==="illegal"&&!P){let ye=new Error('Illegal lexeme "'+ie+'" for mode "'+(te.scope||"<unnamed>")+'"');throw ye.mode=te,ye}else if(Z.type==="end"){let ye=re(Z);if(ye!==LC)return ye}if(Z.type==="illegal"&&ie==="")return Ve+=`
4
4
  `,1;if(ao>1e5&&ao>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ve+=ie,ie.length}let Oe=I(O);if(!Oe)throw fa(a.replace("{}",O)),new Error('Unknown language: "'+O+'"');let Ie=UD(Oe),at="",te=$||Ie,ot={},Ke=new s.__emitter(s);ae();let Ve="",_o=0,Ro=0,ao=0,$t=!1;try{if(Oe.__emitTokens)Oe.__emitTokens(L,Ke);else{for(te.matcher.considerAll();;){ao++,$t?$t=!1:te.matcher.considerAll(),te.matcher.lastIndex=Ro;let j=te.matcher.exec(L);if(!j)break;let Z=L.substring(Ro,j.index),ie=Qe(Z,j);Ro=j.index+ie}Qe(L.substring(Ro))}return Ke.finalize(),at=Ke.toHTML(),{language:O,value:at,relevance:_o,illegal:!1,_emitter:Ke,_top:te}}catch(j){if(j.message&&j.message.includes("Illegal"))return{language:O,value:rg(L),illegal:!0,relevance:0,_illegalBy:{message:j.message,index:Ro,context:L.slice(Ro-100,Ro+100),mode:j.mode,resultSoFar:at},_emitter:Ke};if(r)return{language:O,value:rg(L),illegal:!1,relevance:0,errorRaised:j,_emitter:Ke,_top:te};throw j}}function f(O){let L={value:rg(O),illegal:!1,relevance:0,_top:i,_emitter:new s.__emitter(s)};return L._emitter.addText(O),L}function g(O,L){L=L||s.languages||Object.keys(t);let P=f(O),$=L.filter(I).filter(D).map(ce=>y(ce,O,!1));$.unshift(P);let K=$.sort((ce,U)=>{if(ce.relevance!==U.relevance)return U.relevance-ce.relevance;if(ce.language&&U.language){if(I(ce.language).supersetOf===U.language)return 1;if(I(U.language).supersetOf===ce.language)return-1}return 0}),[z,H]=K,J=z;return J.secondBest=H,J}function h(O,L,P){let $=L&&o[L]||P;O.classList.add("hljs"),O.classList.add(`language-${$}`)}function x(O){let L=null,P=u(O);if(l(P))return;if(F("before:highlightElement",{el:O,language:P}),O.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",O);return}if(O.children.length>0&&(s.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(O)),s.throwUnescapedHTML))throw new lg("One of your code blocks includes unescaped HTML.",O.innerHTML);L=O;let $=L.textContent,K=P?p($,{language:P,ignoreIllegals:!0}):g($);O.innerHTML=K.value,O.dataset.highlighted="yes",h(O,P,K.language),O.result={language:K.language,re:K.relevance,relevance:K.relevance},K.secondBest&&(O.secondBest={language:K.secondBest.language,relevance:K.secondBest.relevance}),F("after:highlightElement",{el:O,result:K,text:$})}function T(O){s=DC(s,O)}let E=()=>{b(),Tl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){b(),Tl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function b(){function O(){b()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",O,!1),S=!0;return}document.querySelectorAll(s.cssSelector).forEach(x)}function v(O,L){let P=null;try{P=L(e)}catch($){if(fa("Language definition for '{}' could not be registered.".replace("{}",O)),r)fa($);else throw $;P=i}P.name||(P.name=O),t[O]=P,P.rawDefinition=L.bind(null,e),P.aliases&&A(P.aliases,{languageName:O})}function R(O){delete t[O];for(let L of Object.keys(o))o[L]===O&&delete o[L]}function _(){return Object.keys(t)}function I(O){return O=(O||"").toLowerCase(),t[O]||t[o[O]]}function A(O,{languageName:L}){typeof O=="string"&&(O=[O]),O.forEach(P=>{o[P.toLowerCase()]=L})}function D(O){let L=I(O);return L&&!L.disableAutodetect}function N(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=L=>{O["before:highlightBlock"](Object.assign({block:L.el},L))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=L=>{O["after:highlightBlock"](Object.assign({block:L.el},L))})}function B(O){N(O),n.push(O)}function G(O){let L=n.indexOf(O);L!==-1&&n.splice(L,1)}function F(O,L){let P=O;n.forEach(function($){$[P]&&$[P](L)})}function k(O){return Tl("10.7.0","highlightBlock will be removed entirely in v12.0"),Tl("10.7.0","Please use highlightElement now."),x(O)}Object.assign(e,{highlight:p,highlightAuto:g,highlightAll:b,highlightElement:x,highlightBlock:k,configure:T,initHighlighting:E,initHighlightingOnLoad:w,registerLanguage:v,unregisterLanguage:R,listLanguages:_,getLanguage:I,registerAliases:A,autoDetection:D,inherit:DC,addPlugin:B,removePlugin:G}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=GD,e.regex={concat:ga,lookahead:BC,either:cg,optional:nD,anyNumberOfTimes:oD};for(let O in Xd)typeof Xd[O]=="object"&&kC(Xd[O]);return Object.assign(e,Xd),e},xl=VC({});xl.newInstance=()=>VC({});zC.exports=xl;xl.HighlightJS=xl;xl.default=xl});var gR=It((JK,fR)=>{"use strict";var TL="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";fR.exports=TL});var TR=It((ZK,bR)=>{"use strict";var xL=gR();function hR(){}function yR(){}yR.resetWarningCache=hR;bR.exports=function(){function e(n,r,a,i,s,l){if(l!==xL){var u=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 u.name="Invariant Violation",u}}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:yR,resetWarningCache:hR};return o.PropTypes=o,o}});var SR=It((oq,xR)=>{xR.exports=TR()();var eq,tq});var wR=It((nq,vm)=>{"use strict";var CR=Cd(),SL=Fx(),ER=/\s/g;function Pg(...e){let t=SL.apply(this,e),o=(n,r)=>EL(n?n.toString():"",t,r);return o.multiline=(n,r)=>CL(n?n.toString():"",t,r),o}var _R=(e,t,o)=>t.interpolation.toLowerCase()==="hsv"?e.hsv(o,t.hsvSpin.toLowerCase()):e.rgb(o);function EL(e,t,o){let n=RR(o),r=Math.max(e.replace(ER,"").length,t.stops.length),a=_R(t,n,r),i="";for(let s of e)i+=s.match(ER)?s:CR.hex(a.shift().toHex())(s);return i}function CL(e,t,o){let n=RR(o),r=e.split(`
5
5
  `),a=Math.max.apply(null,r.map(l=>l.length).concat([t.stops.length])),i=_R(t,n,a),s=[];for(let l of r){let u=i.slice(0),p="";for(let y of l)p+=CR.hex(u.shift().toHex())(y);s.push(p)}return s.join(`
@@ -117,7 +117,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
117
117
  `),await hn())}en("authenticated")},[i,n,en,Yn,ta]),Iy=(0,V.useCallback)(async W=>{try{if(Yn(null),!W.trim()&&W.length>1){Yn("API key cannot be empty string with length greater than 1.");return}await ix(W),await hy(),await n.refreshAuth(ut.USE_GEMINI),en("authenticated")}catch(Ce){Yn(`Failed to save API key: ${Ce instanceof Error?Ce.message:String(Ce)}`)}},[en,Yn,hy,n]),Ny=(0,V.useCallback)(()=>{en("updating")},[en]);(0,V.useEffect)(()=>{qr==="authenticated"&&(ge(n.getUserTier()),Se(n.getUserPaidTier()))},[n,qr]),(0,V.useEffect)(()=>{if(i.merged.security.auth.enforcedType&&i.merged.security.auth.selectedType&&i.merged.security.auth.enforcedType!==i.merged.security.auth.selectedType)Yn(`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===ut.USE_GEMINI)return;let W=Pd(i.merged.security.auth.selectedType);W&&Yn(W)}},[i.merged.security.auth.selectedType,i.merged.security.auth.enforcedType,i.merged.security.auth.useExternal,Yn]);let{isModelDialogOpen:sf,openModelDialog:Oy,closeModelDialog:My}=jA(),{toggleVimEnabled:PO}=pl(),af=(0,V.useRef)(()=>{}),[ja,oa]=(0,V.useState)(!1),{cleanUiDetailsVisible:Du,setCleanUiDetailsVisible:Dy,toggleCleanUiDetailsVisible:Ly,revealCleanUiDetailsTemporarily:Lu}=NO(),BO=(0,V.useMemo)(()=>({openAuthDialog:()=>en("updating"),openThemeDialog:dy,openEditorDialog:uc,openPrivacyNotice:()=>N(!0),openSettingsDialog:cy,openSessionBrowser:Mu,openModelDialog:Oy,openAgentConfigDialog:me,openPermissionsDialog:$r,quit:W=>{A(W),setTimeout(async()=>{await Jr(),ny.exit(0)},100)},setDebugMessage:_,toggleCorgiMode:()=>S(W=>!W),toggleDebugProfiler:xe,dispatchExtensionStateUpdate:sr,addConfirmUpdateExtensionRequest:vr,toggleBackgroundTasks:()=>{Y.current(),ee.current||(L(!0),X.current.size>1?af.current(!0):af.current(!1))},toggleShortcutsHelp:()=>oa(W=>!W),setText:iy}),[en,dy,uc,cy,Mu,Oy,me,A,_,N,S,sr,$r,vr,xe,oa,iy]),{handleSlashCommand:Ai,slashCommands:ku,pendingHistoryItems:Pu,commandContext:ky,confirmationRequest:na}=ZA(n,i,h.addItem,h.clearItems,h.loadHistory,oo,PO,k,BO,Js,De,Wo,z),[fc,Py]=(0,V.useState)(null),[Bu,By]=(0,V.useState)(null);(0,V.useEffect)(()=>{let W=Ce=>{Py({prompt:Ce.prompt,onConfirm:pe=>{Py(null),Ce.onConfirm(pe)}})};return we.on(je.ConsentRequest,W),()=>{we.off(je.ConsentRequest,W)}},[]);let FO=(0,V.useCallback)(async()=>{h.addItem({type:"info",text:"Refreshing hierarchical memory (GEMINI.md or other context files)..."},Date.now());try{let W,Ce;if(n.isJitContextEnabled())await n.getMemoryContextManager()?.refresh(),n.updateSystemInstructionIfInitialized(),W=Ff(n.getUserMemory()),Ce=n.getGeminiMdFileCount();else{let pe=await yd(n);W=Ff(pe.memoryContent),Ce=pe.fileCount}h.addItem({type:"info",text:`Memory reloaded successfully. ${W.length>0?`Loaded ${W.length} characters from ${Ce} file(s)`:"No memory content found"}`},Date.now()),n.getDebugMode()&&Re.log(`[DEBUG] Refreshed memory content in config: ${W.substring(0,200)}...`)}catch(W){let Ce=Nr(W);h.addItem({type:"error",text:`Error refreshing memory: ${Ce}`},Date.now()),Re.warn("Error refreshing memory:",W)}},[n,h]),lf=(0,V.useRef)(()=>{}),UO=(0,V.useCallback)(W=>{W?U(!0):(U(!1),lf.current(!1))},[]);(0,V.useEffect)(()=>{if(ce){let W=h.history.findLast(pe=>pe.type==="user"),Ce=to.at(-1);(!W||typeof W.text=="string"&&W.text===Ce)&&(lf.current(!0),U(!1))}},[ce,to,h.history]);let Fu=(0,V.useRef)([]),[HO,Fy]=(0,V.useState)(0),cf=(0,V.useCallback)(()=>{if(Fu.current.length===0)return null;let W=Fu.current.join(`
118
118
  `);return Fu.current=[],Fy(0),W},[]);(0,V.useEffect)(()=>{let W=(Ce,pe)=>{pe!=="user_steering"&&pe!=="background_completion"||(Fu.current.push(Ce),Fy(Ge=>Ge+1))};return n.injectionService.onInjection(W),()=>{n.injectionService.offInjection(W)}},[n]);let{streamingState:wo,submitQuery:Qa,initError:uf,pendingHistoryItems:Uu,thought:gc,cancelOngoingRequest:Uy,pendingToolCalls:GO,handleApprovalModeChange:Hy,activePtyId:is,loopDetectionConfirmationRequest:Hu,lastOutputTime:df,backgroundTaskCount:mf,isBackgroundTaskVisible:Vr,toggleBackgroundTasks:Gu,backgroundCurrentExecution:Gy,backgroundTasks:zr,dismissBackgroundTask:Wy,retryStatus:WO}=pI(n.getGeminiClient(),h.history,h.addItem,n,i,_,Ai,Ie,Au,Yn,FO,te,ot,UO,L,Et,_t,O,cf),Ko=(0,V.useMemo)(()=>[...Pu,...Uu],[Pu,Uu]);Y.current=Gu,ee.current=Vr,X.current=zr;let{activeBackgroundTaskPid:$y,setIsBackgroundTaskListOpen:ra,isBackgroundTaskListOpen:Ky,setActiveBackgroundTaskPid:qy,backgroundTaskHeight:pf}=hO({backgroundTasks:zr,backgroundTaskCount:mf,isBackgroundTaskVisible:Vr,activePtyId:is,embeddedShellFocused:O,setEmbeddedShellFocused:L,terminalHeight:_t});af.current=ra;let hc=(0,V.useRef)(0);(0,V.useEffect)(()=>{hc.current=df},[df]);let{shouldShowFocusHint:$O,inactivityStatus:Vy}=TI({activePtyId:is,lastOutputTime:df,streamingState:wo,pendingToolCalls:GO,embeddedShellFocused:O,isInteractiveShellEnabled:n.isInteractiveShellEnabled()}),zy=Vy==="action_required",Yy=Vy==="silent_working",KO=(0,V.useCallback)(W=>{Hy(W),Du||Lu(oy)},[Hy,Du,Lu]),{isMcpReady:yc}=sO(n),{messageQueue:Wu,addMessage:$u,clearQueue:Xy,getQueuedMessagesText:jy,popAllMessages:Qy}=iO({isConfigInitialized:De,streamingState:wo,submitQuery:Qa,isMcpReady:yc});lf.current=(0,V.useCallback)((W=!0)=>{if(Wm(Ko))return;if(Gm(Ko)){vi.setText("");return}if(!W)return;let pe=to.at(-1)||"",Ge=jy();Ge&&(pe=pe?`${pe}
119
119
 
120
- ${Ge}`:Ge,Xy()),pe&&vi.setText(pe)},[vi,to,jy,Xy,Ko]);let Jy=(0,V.useCallback)(W=>{let Ce=W.trim();Ce&&(n.injectionService.addInjection(Ce,"user_steering"),h.addItem({type:"hint",text:Ce}))},[n,h]),bc=(0,V.useCallback)(async W=>{s(),St(null),Lo||(Go(!0),x||oo());let Ce=fn(W.trim()),pe=wo==="idle",Ge=wo==="responding"||Gm(Ko);if(Ce&&Ge){let{commandToExecute:as}=sl(W,ku??[]);if(as?.isSafeConcurrent){Ai(W),lo(W);return}}if(n.isModelSteeringEnabled()&&Ge&&!Ce){Jy(W),lo(W);return}let Kt=De&&yc;if(Ce&&De||pe&&Kt){if(!Ce){let as=await lS(W,n);if(as.length>0){By({files:as,onComplete:mM=>{By(null),mM.allowed&&as.forEach(pM=>n.getWorkspaceContext().addReadOnlyPath(pM)),Qa(W)}}),lo(W);return}}Qa(W)}else pe&&!Kt&&Wu.length===0&&we.emitFeedback("info",De?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),$u(W);lo(W)},[$u,lo,Qa,Ai,ku,yc,wo,Wu.length,Ko,n,Lo,Go,x,oo,s,Jy,De,St]),Zy=(0,V.useCallback)(()=>{s(),St(null),h.clearItems(),rs(),oo()},[h,rs,oo,s,St]),{handleInput:eb}=gI(vi,bc),ff=!uf&&!F&&!nf&&(wo==="idle"||wo==="responding"||wo==="waiting_for_confirmation")&&!mc,Tc=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{Tc.current?.disconnect()},[]);let[Ku,qO]=(0,V.useState)(0),[tb,VO]=(0,V.useState)(0);(0,V.useLayoutEffect)(()=>{!H&&Ku>0&&VO(Ku)},[H,Ku]);let gf=H&&tb>0?tb:Ku,ob=(0,V.useCallback)(W=>{if(Tc.current&&(Tc.current.disconnect(),Tc.current=null),W){let Ce=new gn(pe=>{let Ge=pe[0];if(Ge){let Kt=Math.round(Ge.contentRect.height);qO(as=>Kt!==as?Kt:as)}});Ce.observe(W),Tc.current=Ce}},[]),hf=Math.max(0,_t-gf-pf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(Et*d1),terminalHeight:Math.max(Math.floor(hf-m1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:qu,hasReceivedFocusEvent:zO}=NS(),nb=(0,V.useMemo)(()=>{let W=i.merged.context.fileName;return W?Array.isArray(W)?W:[W]:dT()},[i.merged.context.fileName]),yf=(0,V.useMemo)(()=>n.getQuestion(),[n]),rb=(0,V.useRef)(!1),ib=n.getGeminiClient();(0,V.useEffect)(()=>{yf&&De&&!rb.current&&!Xa&&!pc&&!dc&&!cc&&!D&&ib?.isInitialized?.()&&(bc(yf),rb.current=!0)},[yf,De,bc,Xa,pc,dc,cc,D,ib]);let[YO,XO]=(0,V.useState)(!1),[bf,jO]=(0,V.useState)(null);(0,V.useEffect)(()=>{(async()=>{let pe=(await ms.getInstance()).getCurrentIde();jO(pe||null)})()},[]);let Vu=!!(bf&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!YO),[zu,xc]=(0,V.useState)(!1),[sb,QO]=(0,V.useState)(!1),[ab,JO]=(0,V.useState)(!0),lb=(0,V.useCallback)(W=>{W>2&&TT(n),W>1&&Ai("/quit",void 0,void 0,!1)},[n,Ai]),{pressCount:cb,handlePress:ub}=Kl({windowMs:Mi,onRepeat:lb}),{pressCount:db,handlePress:mb}=Kl({windowMs:Mi,onRepeat:lb}),[Yu,pb]=(0,V.useState)(),[fb,ZO]=(0,V.useState)(!1),[Tf,eM]=(0,V.useState)(!1),[gb,Ii]=Qp(Mi),{isFolderTrustDialogOpen:xf,discoveryResults:hb,handleFolderTrustSelect:yb,isRestarting:bb}=xI(i,ie,h.addItem),Sf=n.getPolicyUpdateConfirmationRequest(),[Ef,Tb]=(0,V.useState)(!!Sf),{needsRestart:xb,restartReason:Sb}=jS(),Eb=(0,V.useRef)(!0);mO(n,Z,h,z);let ss=(0,V.useRef)(null);(0,V.useEffect)(()=>{let W=Ge=>{Ii({text:Ge.message,type:Ge.type})},Ce=()=>{Ii({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},pe=()=>{Ii({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Lt.on("transient-message",W),Lt.on("selection-warning",Ce),Lt.on("paste-timeout",pe),()=>{Lt.off("transient-message",W),Lt.off("selection-warning",Ce),Lt.off("paste-timeout",pe),ss.current&&clearTimeout(ss.current)}},[Ii]);let Cf=(0,V.useCallback)(W=>{Ii({text:W,type:"warning"})},[Ii]),{handleSuspend:Cb}=xO({handleWarning:Cf,setRawMode:On,refreshStatic:oo,setForceRerenderKey:v,shouldUseAlternateScreen:Zp});(0,V.useEffect)(()=>{xb&&eM(!0)},[xb]),(0,V.useEffect)(()=>{if(Eb.current){Eb.current=!1;return}let W=setTimeout(()=>{oo()},300);return()=>{clearTimeout(W)}},[Et,oo]),(0,V.useEffect)(()=>{let W=kf.subscribe(pb);return pb(kf.get()),W},[]),(0,V.useEffect)(()=>{let W=()=>{xc(!0),Go(!1)};return Lt.on("open-debug-console",W),()=>{Lt.off("open-debug-console",W)}},[n]);let _b=(0,V.useCallback)(W=>{ZO(W)},[]),Rb=(0,V.useCallback)(W=>{W.userSelection==="yes"?(Ai("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):W.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),XO(!0)},[Ai,i]),tM=(0,V.useCallback)(W=>{if(i.merged.general.debugKeystrokeLogging&&Re.log("[DEBUG] Keystroke:",JSON.stringify(W)),ja&&t(W)&&oa(!1),o["app.toggleMouseMode"](W))return E(Ge=>!Ge),T&&!x&&Lt.emit("scroll-to-bottom"),!0;if(x&&o["app.toggleCopyMode"](W))return J(!0),us(),!0;if(o["basic.quit"](W))return Uy?.(),ub(),!0;if(o["basic.exit"](W))return Jp.current.text.length>0?!1:(mb(),!0);if(o["app.suspend"](W))Cb();else if(o["app.dumpFrame"](W)){let Kt=`snapshot-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return p&&(p(Kt),Re.log(`Dumped frame to: ${Kt}`)),!0}else if(o["app.startRecording"](W)){let Kt=`recording-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return y&&(y(Kt),g.current=Kt,Re.log(`Started recording to: ${Kt}`)),!0}else{if(o["app.stopRecording"](W))return f&&(f(),Re.log(`Stopped recording, saved to: ${g.current??"unknown"}`),g.current=null),!0;if(o["app.toggleCopyMode"](W)&&!x)return Ii({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0}let Ce=()=>{St(!0);let Ge=uw(h.history,Ko);Ge.length>0&&Qe(Ge)},pe=!1;if(Lo||(pe=!0,Go(!0),o["app.showMoreLines"](W)&&Ce(),x||oo()),o["app.showErrorDetails"](W))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:Ge}=await import("./devtoolsService-TCAPUJWL.js");await Ge(n,zu,()=>xc(Kt=>!Kt),()=>xc(!0))})():xc(Ge=>!Ge),!0;if(o["app.showFullTodos"](W))return QO(Ge=>!Ge),!0;if(o["app.toggleMarkdown"](W))return JO(Ge=>{let Kt=!Ge;return oo(),Kt}),!0;if(o["app.showIdeContextDetail"](W)&&n.getIdeMode()&&Yu)return Ai("/ide status"),!0;if(o["app.showMoreLines"](W)&&!pe)return Go(!1),Ce(),oo(),!0;if((o["app.focusShellInput"](W)||o["background.unfocusList"](W))&&(is||Vr&&zr.size>0)){if(O){let Kt=hc.current;return ss.current&&clearTimeout(ss.current),ss.current=setTimeout(()=>{hc.current===Kt?L(!1):Ii({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-hc.current>=100&&!is&&!Vr?(ss.current&&clearTimeout(ss.current),Gu(),L(!0),zr.size>1&&ra(!0),!0):(L(!0),!0)}else{if(o["app.unfocusShellInput"](W)||o["background.unfocus"](W))return O?(L(!1),!0):!1;if(o["background.toggle"](W))return is?Gy():(Gu(),!Vr&&zr.size>0?(L(!0),zr.size>1&&ra(!0)):L(!1)),!0;if(o["background.toggleList"](W))return zr.size>0&&Vr&&(O||L(!0),ra(!0)),!0}return!1},[Lo,Go,xc,n,Yu,ub,mb,Ai,Uy,is,Cb,O,i.merged.general.debugKeystrokeLogging,oo,J,ss,x,ja,Gy,Gu,zr,Vr,ra,hc,Ii,i.merged.general.devtools,zu,St,o,t,h.history,Ko,Qe,p,y,f,T]);be(tM,{isActive:!0,priority:!0}),be(W=>o["scroll.up"](W)||o["scroll.down"](W)||o["scroll.pageUp"](W)||o["scroll.pageDown"](W)||o["scroll.home"](W)||o["scroll.end"](W)?!1:(J(!1),T&&cs(),!0),{isActive:H,priority:200}),(0,V.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let W=Ip({streamingState:wo,thoughtSubject:gc?.subject,isConfirming:!!na||zy,isSilentWorking:Yy,folderName:u1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});ur.current!==W&&(ur.current=W,yt.write(`\x1B]0;${W}\x07`))},[wo,gc,na,zy,Yy,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,yt]),(0,V.useEffect)(()=>{let W=pe=>{let Ge;switch(pe.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: ${pe.severity}`)}h.addItem({type:Ge,text:pe.message},Date.now()),pe.error&&Re.warn(`[Feedback Details for "${pe.message}"]`,pe.error)},Ce=pe=>{h.addItem({type:"info",text:pe.message,source:pe.hookName},Date.now())};return we.on(je.UserFeedback,W),we.on(je.HookSystemMessage,Ce),we.drainBacklogs(),()=>{we.off(je.UserFeedback,W),we.off(je.HookSystemMessage,Ce)}},[h]);let wb=e.version.includes("nightly"),vb=Vu||Vu||xf||Ef||ne||!!na||!!fc||!!Bu||!!K||Gr.length>0||!!Hu||dc||tf||sf||Ri||es||Xa||pc||cc||D||Tf||!!mc||!!Iu||!!Nu||!!Ou||rf||qr==="awaiting_api_key_input"||!!fe,oM=(0,V.useMemo)(()=>Wm(Ko),[Ko]),Ab=Gr.length>0,Ib=!!Hu,Sc=oM||!!na||!!fc||Ab||Ib||!!mc||!!Iu||!!Nu||!!Ou||!!K,Xu=i.merged.ui.loadingPhrases,nM=Xu==="tips"||Xu==="all",rM=Xu==="witty"||Xu==="all",iM=(!O||Vr)&&wo==="responding"&&!Sc,ju=0;if(ao.length>0&&i.merged.hooksConfig.notifications){let W=ao.length>1?"Executing Hooks":"Executing Hook",Ce=ao.map(pe=>pe.name+(pe.index&&pe.total&&pe.total>1?` (${pe.index}/${pe.total})`:"")).join(", ");ju=W.length+Ce.length+10}else iM?ju=(gc?.subject||"Waiting for model...").length+25:Sc&&(ju=35);let sM=Et-ju-5,{elapsedTime:Nb,currentLoadingPhrase:Ob,currentTip:Mb,currentWittyPhrase:Db}=yI({streamingState:wo,shouldShowFocusHint:$O,retryStatus:WO,showTips:nM,showWit:rM,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:sM}),_f=n.isPlanEnabled()&&wo==="idle"&&!Sc,Lb=aO({config:n,addItem:h.addItem,onApprovalModeChange:KO,isActive:!O,allowPlanMode:_f});AO({notificationsEnabled:l,isFocused:qu,hasReceivedFocusEvent:zO,streamingState:wo,hasPendingActionRequired:Sc,pendingHistoryItems:Ko,commandConfirmationRequest:na,authConsentRequest:fc,permissionConfirmationRequest:Bu,hasConfirmUpdateExtensionRequests:Ab,hasLoopDetectionConfirmationRequest:Ib});let kb=ff&&wo==="idle"&&!Sc;(0,V.useEffect)(()=>{ja&&!kb&&oa(!1)},[ja,kb,oa]),(0,V.useEffect)(()=>{if(!De||!n.isModelSteeringEnabled()||wo!=="idle"||!yc||Wm(Ko))return;let W=cf();W&&Qa([{text:Td(W)}])},[n,h,De,yc,wo,Qa,cf,Ko,HO]);let aM=(0,V.useMemo)(()=>$m(Ko),[Ko]),[Pb,lM]=(0,V.useState)(n.getGeminiMdFileCount());(0,V.useEffect)(()=>{let W=Ce=>{lM(Ce.fileCount)};return we.on(je.MemoryChanged,W),()=>{we.off(je.MemoryChanged,W)}},[]),(0,V.useEffect)(()=>{let W=!0;return(async()=>{let[pe,Ge]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);W&&(Zi(pe),ir(Ge),Wo(!0))})(),()=>{W=!1}},[n,oo]);let cM=(0,V.useMemo)(()=>({buffer:vi,userMessages:to,shellModeActive:Ie,showEscapePrompt:fb,copyModeEnabled:H,inputWidth:Ya,suggestionsWidth:lc}),[vi,to,Ie,fb,H,Ya,lc]),uM=(0,V.useMemo)(()=>({history:h.history,historyManager:h,isThemeDialogOpen:dc,themeError:B,isAuthenticating:Xa,isConfigInitialized:De,authError:fy,accountSuspensionInfo:yy,isAuthDialogOpen:pc,isAwaitingApiKeyInput:qr==="awaiting_api_key_input",apiKeyDefaultValue:gy,editorError:sy,isEditorDialogOpen:cc,showPrivacyNotice:D,mouseMode:T,corgiMode:w,debugMessage:R,quittingMessages:I,isSettingsDialogOpen:tf,isSessionBrowserOpen:rf,isModelDialogOpen:sf,isAgentConfigDialogOpen:Ri,selectedAgentName:wi,selectedAgentDisplayName:ea,selectedAgentDefinition:ue,isPermissionsDialogOpen:es,permissionsDialogProps:os,slashCommands:ku,pendingSlashCommandHistoryItems:Pu,commandContext:ky,commandConfirmationRequest:na,authConsentRequest:fc,confirmUpdateExtensionRequests:Gr,loopDetectionConfirmationRequest:Hu,permissionConfirmationRequest:Bu,geminiMdFileCount:Pb,streamingState:wo,initError:uf,pendingGeminiHistoryItems:Uu,thought:gc,isInputActive:ff,isResuming:nf,shouldShowIdePrompt:Vu,isFolderTrustDialogOpen:xf??!1,folderDiscoveryResults:hb,isPolicyUpdateDialogOpen:Ef,policyUpdateConfirmationRequest:Sf,isTrustedFolder:Z,constrainHeight:Lo,showErrorDetails:zu,showFullTodos:sb,ideContextState:Yu,renderMarkdown:ab,ctrlCPressedOnce:cb>=1,ctrlDPressedOnce:db>=1,shortcutsHelpVisible:ja,cleanUiDetailsVisible:Du,isFocused:qu,elapsedTime:Nb,currentLoadingPhrase:Ob,currentTip:Mb,currentWittyPhrase:Db,historyRemountKey:Ke,activeHooks:ao,messageQueue:Wu,queueErrorMessage:ye,showApprovalModeIndicator:Lb,allowPlanMode:_f,currentModel:Ee,quota:{userTier:q,stats:Me,proQuotaRequest:mc,validationRequest:Iu,overageMenuRequest:Nu,emptyWalletRequest:Ou},contextFileNames:nb,errorCount:ns,availableTerminalHeight:hf,stableControlsHeight:gf,mainAreaWidth:Ir,staticAreaMaxItemHeight:ry,staticExtraHeight:dr,dialogsVisible:vb,pendingHistoryItems:Ko,nightly:wb,branchName:lr,sessionStats:Ar,terminalWidth:Et,terminalHeight:_t,mainControlsRef:ob,rootUiRef:cr,currentIDE:bf,updateInfo:$t,showIdeRestartPrompt:Tf,ideTrustRestartReason:Sb,isRestarting:bb,extensionsUpdateState:Qs,activePtyId:is,backgroundTaskCount:mf,isBackgroundTaskVisible:Vr,embeddedShellFocused:O,showDebugProfiler:P,customDialog:K,transientMessage:gb,bannerData:In,bannerVisible:mn,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:_o,backgroundTasks:zr,activeBackgroundTaskPid:$y,backgroundTaskHeight:pf,isBackgroundTaskListOpen:Ky,adminSettingsChanged:ne,newAgents:fe,showIsExpandableHint:Ji,hintMode:n.isModelSteeringEnabled()&&Gm(Ko),hintBuffer:""}),[dc,B,Xa,De,fy,yy,pc,sy,cc,D,T,w,R,I,tf,rf,sf,Ri,wi,ea,ue,es,os,ku,Pu,ky,na,fc,Gr,Hu,Bu,Pb,wo,uf,Uu,gc,ff,nf,Vu,xf,hb,Ef,Sf,Z,Lo,zu,sb,Yu,ab,cb,db,ja,Du,qu,Nb,Ob,Mb,Db,Ke,ao,Wu,ye,Lb,_f,q,Me,mc,Iu,Nu,Ou,nb,ns,hf,gf,Ir,ry,dr,vb,Ko,wb,lr,Ar,Et,_t,ob,cr,bf,$t,Tf,Sb,bb,Ee,Qs,is,mf,Vr,h,O,P,K,gy,qr,gb,In,mn,n,_o,pf,Ky,$y,zr,ne,fe,Ji]),Bb=(0,V.useCallback)(()=>N(!1),[N]),dM=(0,V.useMemo)(()=>({handleThemeSelect:of,closeThemeDialog:my,handleThemeHighlight:py,handleAuthSelect:Ay,setAuthState:en,onAuthError:Yn,handleEditorSelect:ay,exitEditorDialog:ly,exitPrivacyNotice:Bb,closeSettingsDialog:uy,closeModelDialog:My,openAgentConfigDialog:me,closeAgentConfigDialog:Ne,openPermissionsDialog:$r,closePermissionsDialog:ar,setShellModeActive:at,vimHandleInput:eb,handleIdePromptComplete:Rb,handleFolderTrustSelect:yb,setIsPolicyUpdateDialogOpen:Tb,setConstrainHeight:Go,onEscapePromptChange:_b,refreshStatic:oo,handleFinalSubmit:bc,handleClearScreen:Zy,handleProQuotaChoice:xy,handleValidationChoice:Sy,handleOverageMenuChoice:Ey,handleEmptyWalletChoice:Cy,openSessionBrowser:Mu,closeSessionBrowser:_y,handleResumeSession:Ry,handleDeleteSession:vy,setQueueErrorMessage:Pe,addMessage:$u,popAllMessages:Qy,handleApiKeySubmit:Iy,handleApiKeyCancel:Ny,setBannerVisible:Wo,setShortcutsHelpVisible:oa,setCleanUiDetailsVisible:Dy,toggleCleanUiDetailsVisible:Ly,revealCleanUiDetailsTemporarily:Lu,handleWarning:Cf,setEmbeddedShellFocused:L,dismissBackgroundTask:Wy,setActiveBackgroundTaskPid:qy,setIsBackgroundTaskListOpen:ra,setAuthContext:ta,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(ny.send){let W=n.getRemoteAdminSettings();W&&ny.send({type:"admin-settings-update",settings:W})}await hn()},handleNewAgentsSelect:async W=>{if(fe&&W==="acknowledge"){let Ce=n.getAgentRegistry();try{await Promise.all(fe.map(pe=>Ce.acknowledgeAgent(pe)))}catch(pe){Re.error("Failed to acknowledge agents:",pe),h.addItem({type:"error",text:`Failed to acknowledge agents: ${Nr(pe)}`},Date.now())}}Tt(null)},getPreferredEditor:Au,clearAccountSuspension:()=>{by(null),en("updating")}}),[of,my,py,Ay,en,Yn,ay,ly,Bb,uy,My,me,Ne,$r,ar,at,eb,Rb,yb,Tb,Go,_b,oo,bc,Zy,xy,Sy,Ey,Cy,Mu,_y,Ry,vy,Pe,$u,Qy,Iy,Ny,Wo,oa,Dy,Ly,Lu,Cf,L,Wy,qy,ra,ta,by,fe,n,h,Au]);return qr==="awaiting_google_login_restart"?(0,wr.jsx)(yO,{onDismiss:()=>{ta({}),en("updating")},config:n}):(0,wr.jsx)(Id.Provider,{value:uM,children:(0,wr.jsx)(iE.Provider,{value:cM,children:(0,wr.jsx)(Dg.Provider,{value:dM,children:(0,wr.jsx)(dl.Provider,{value:n,children:(0,wr.jsx)(Ug.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,wr.jsx)(Z_,{config:n,toolCalls:aM,isExpanded:Oe,toggleExpansion:he,toggleAllExpansion:Qe,children:(0,wr.jsx)(dh.Provider,{value:qu,children:(0,wr.jsx)(rm,{mouseEventsEnabled:T,children:(0,wr.jsx)(im,{children:(0,wr.jsx)(kA,{},`app-${b}`)})})})})})})})})})};var qn=C(M(),1);var f1=200;async function oae(e,t,o,n=process.cwd(),r,a){Cv();let i=ud(e.getUseAlternateBuffer(),e.getScreenReader()),s=i;s&&(cs(),hs(()=>{us()}));let{matchers:l,errors:u}=await LS();u.forEach(E=>{we.emitFeedback("warning",E)});let p=await ox();g1(p1(n),t);let y=new iS({onNewMessage:E=>{we.emitConsoleLog(E.type,E.content)},debugMode:e.getDebugMode()});y.patch(),hs(y.cleanup);let{stdout:f,stderr:g}=vT(),h=!!process.env.SHPOOL_SESSION_NAME,x=()=>(mp(),(0,qn.jsx)(OS.Provider,{value:t,children:(0,qn.jsx)(kS,{value:l,children:(0,qn.jsx)(MS,{config:e,children:(0,qn.jsx)(rm,{mouseEventsEnabled:s,children:(0,qn.jsx)(UA,{children:(0,qn.jsx)(im,{children:(0,qn.jsx)(Sl,{children:(0,qn.jsx)(NR,{children:(0,qn.jsx)(rE,{children:(0,qn.jsx)(OO,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:a})})})})})})})})})}));h&&await new Promise(E=>setTimeout(E,100));let T=SS(process.env.DEBUG?(0,qn.jsx)(MO.default.StrictMode,{children:(0,qn.jsx)(x,{})}):(0,qn.jsx)(x,{}),{stdout:f,stderr:g,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:E})=>{E>f1&&xT(e,E),nE.reportFrameRendered()},standardReactLayoutTiming:i||e.getUseTerminalBuffer(),patchConsole:!1,alternateBuffer:i,terminalBuffer:e.getUseTerminalBuffer(),renderProcess:e.getUseRenderProcess()&&e.getUseTerminalBuffer(),incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(Za(),hs(()=>{ld()})),rO(t).then(E=>{pE(E,t,e.getProjectRoot())}).catch(E=>{e.getDebugMode()&&Re.warn("Update check failed:",E)}),hs(()=>T.unmount()),hs(Zx())}function g1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Ip({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Xn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Xn("\x1B]0;\x07")})}}export{oae as startInteractiveUI};
120
+ ${Ge}`:Ge,Xy()),pe&&vi.setText(pe)},[vi,to,jy,Xy,Ko]);let Jy=(0,V.useCallback)(W=>{let Ce=W.trim();Ce&&(n.injectionService.addInjection(Ce,"user_steering"),h.addItem({type:"hint",text:Ce}))},[n,h]),bc=(0,V.useCallback)(async W=>{s(),St(null),Lo||(Go(!0),x||oo());let Ce=fn(W.trim()),pe=wo==="idle",Ge=wo==="responding"||Gm(Ko);if(Ce&&Ge){let{commandToExecute:as}=sl(W,ku??[]);if(as?.isSafeConcurrent){Ai(W),lo(W);return}}if(n.isModelSteeringEnabled()&&Ge&&!Ce){Jy(W),lo(W);return}let Kt=De&&yc;if(Ce&&De||pe&&Kt){if(!Ce){let as=await lS(W,n);if(as.length>0){By({files:as,onComplete:mM=>{By(null),mM.allowed&&as.forEach(pM=>n.getWorkspaceContext().addReadOnlyPath(pM)),Qa(W)}}),lo(W);return}}Qa(W)}else pe&&!Kt&&Wu.length===0&&we.emitFeedback("info",De?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),$u(W);lo(W)},[$u,lo,Qa,Ai,ku,yc,wo,Wu.length,Ko,n,Lo,Go,x,oo,s,Jy,De,St]),Zy=(0,V.useCallback)(()=>{s(),St(null),h.clearItems(),rs(),oo()},[h,rs,oo,s,St]),{handleInput:eb}=gI(vi,bc),ff=!uf&&!F&&!nf&&(wo==="idle"||wo==="responding"||wo==="waiting_for_confirmation")&&!mc,Tc=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{Tc.current?.disconnect()},[]);let[Ku,qO]=(0,V.useState)(0),[tb,VO]=(0,V.useState)(0);(0,V.useLayoutEffect)(()=>{!H&&Ku>0&&VO(Ku)},[H,Ku]);let gf=H&&tb>0?tb:Ku,ob=(0,V.useCallback)(W=>{if(Tc.current&&(Tc.current.disconnect(),Tc.current=null),W){let Ce=new gn(pe=>{let Ge=pe[0];if(Ge){let Kt=Math.round(Ge.contentRect.height);qO(as=>Kt!==as?Kt:as)}});Ce.observe(W),Tc.current=Ce}},[]),hf=Math.max(0,_t-gf-pf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(Et*d1),terminalHeight:Math.max(Math.floor(hf-m1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:qu,hasReceivedFocusEvent:zO}=NS(),nb=(0,V.useMemo)(()=>{let W=i.merged.context.fileName;return W?Array.isArray(W)?W:[W]:dT()},[i.merged.context.fileName]),yf=(0,V.useMemo)(()=>n.getQuestion(),[n]),rb=(0,V.useRef)(!1),ib=n.getGeminiClient();(0,V.useEffect)(()=>{yf&&De&&!rb.current&&!Xa&&!pc&&!dc&&!cc&&!D&&ib?.isInitialized?.()&&(bc(yf),rb.current=!0)},[yf,De,bc,Xa,pc,dc,cc,D,ib]);let[YO,XO]=(0,V.useState)(!1),[bf,jO]=(0,V.useState)(null);(0,V.useEffect)(()=>{(async()=>{let pe=(await ms.getInstance()).getCurrentIde();jO(pe||null)})()},[]);let Vu=!!(bf&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!YO),[zu,xc]=(0,V.useState)(!1),[sb,QO]=(0,V.useState)(!1),[ab,JO]=(0,V.useState)(!0),lb=(0,V.useCallback)(W=>{W>2&&TT(n),W>1&&Ai("/quit",void 0,void 0,!1)},[n,Ai]),{pressCount:cb,handlePress:ub}=Kl({windowMs:Mi,onRepeat:lb}),{pressCount:db,handlePress:mb}=Kl({windowMs:Mi,onRepeat:lb}),[Yu,pb]=(0,V.useState)(),[fb,ZO]=(0,V.useState)(!1),[Tf,eM]=(0,V.useState)(!1),[gb,Ii]=Qp(Mi),{isFolderTrustDialogOpen:xf,discoveryResults:hb,handleFolderTrustSelect:yb,isRestarting:bb}=xI(i,ie,h.addItem),Sf=n.getPolicyUpdateConfirmationRequest(),[Ef,Tb]=(0,V.useState)(!!Sf),{needsRestart:xb,restartReason:Sb}=jS(),Eb=(0,V.useRef)(!0);mO(n,Z,h,z);let ss=(0,V.useRef)(null);(0,V.useEffect)(()=>{let W=Ge=>{Ii({text:Ge.message,type:Ge.type})},Ce=()=>{Ii({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},pe=()=>{Ii({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return Lt.on("transient-message",W),Lt.on("selection-warning",Ce),Lt.on("paste-timeout",pe),()=>{Lt.off("transient-message",W),Lt.off("selection-warning",Ce),Lt.off("paste-timeout",pe),ss.current&&clearTimeout(ss.current)}},[Ii]);let Cf=(0,V.useCallback)(W=>{Ii({text:W,type:"warning"})},[Ii]),{handleSuspend:Cb}=xO({handleWarning:Cf,setRawMode:On,refreshStatic:oo,setForceRerenderKey:v,shouldUseAlternateScreen:Zp});(0,V.useEffect)(()=>{xb&&eM(!0)},[xb]),(0,V.useEffect)(()=>{if(Eb.current){Eb.current=!1;return}let W=setTimeout(()=>{oo()},300);return()=>{clearTimeout(W)}},[Et,oo]),(0,V.useEffect)(()=>{let W=kf.subscribe(pb);return pb(kf.get()),W},[]),(0,V.useEffect)(()=>{let W=()=>{xc(!0),Go(!1)};return Lt.on("open-debug-console",W),()=>{Lt.off("open-debug-console",W)}},[n]);let _b=(0,V.useCallback)(W=>{ZO(W)},[]),Rb=(0,V.useCallback)(W=>{W.userSelection==="yes"?(Ai("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):W.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),XO(!0)},[Ai,i]),tM=(0,V.useCallback)(W=>{if(i.merged.general.debugKeystrokeLogging&&Re.log("[DEBUG] Keystroke:",JSON.stringify(W)),ja&&t(W)&&oa(!1),o["app.toggleMouseMode"](W))return E(Ge=>!Ge),T&&!x&&Lt.emit("scroll-to-bottom"),!0;if(x&&o["app.toggleCopyMode"](W))return J(!0),us(),!0;if(o["basic.quit"](W))return Uy?.(),ub(),!0;if(o["basic.exit"](W))return Jp.current.text.length>0?!1:(mb(),!0);if(o["app.suspend"](W))Cb();else if(o["app.dumpFrame"](W)){let Kt=`snapshot-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return p&&(p(Kt),Re.log(`Dumped frame to: ${Kt}`)),!0}else if(o["app.startRecording"](W)){let Kt=`recording-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return y&&(y(Kt),g.current=Kt,Re.log(`Started recording to: ${Kt}`)),!0}else{if(o["app.stopRecording"](W))return f&&(f(),Re.log(`Stopped recording, saved to: ${g.current??"unknown"}`),g.current=null),!0;if(o["app.toggleCopyMode"](W)&&!x)return Ii({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0}let Ce=()=>{St(!0);let Ge=uw(h.history,Ko);Ge.length>0&&Qe(Ge)},pe=!1;if(Lo||(pe=!0,Go(!0),o["app.showMoreLines"](W)&&Ce(),x||oo()),o["app.showErrorDetails"](W))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:Ge}=await import("./devtoolsService-UC4LLBEB.js");await Ge(n,zu,()=>xc(Kt=>!Kt),()=>xc(!0))})():xc(Ge=>!Ge),!0;if(o["app.showFullTodos"](W))return QO(Ge=>!Ge),!0;if(o["app.toggleMarkdown"](W))return JO(Ge=>{let Kt=!Ge;return oo(),Kt}),!0;if(o["app.showIdeContextDetail"](W)&&n.getIdeMode()&&Yu)return Ai("/ide status"),!0;if(o["app.showMoreLines"](W)&&!pe)return Go(!1),Ce(),oo(),!0;if((o["app.focusShellInput"](W)||o["background.unfocusList"](W))&&(is||Vr&&zr.size>0)){if(O){let Kt=hc.current;return ss.current&&clearTimeout(ss.current),ss.current=setTimeout(()=>{hc.current===Kt?L(!1):Ii({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-hc.current>=100&&!is&&!Vr?(ss.current&&clearTimeout(ss.current),Gu(),L(!0),zr.size>1&&ra(!0),!0):(L(!0),!0)}else{if(o["app.unfocusShellInput"](W)||o["background.unfocus"](W))return O?(L(!1),!0):!1;if(o["background.toggle"](W))return is?Gy():(Gu(),!Vr&&zr.size>0?(L(!0),zr.size>1&&ra(!0)):L(!1)),!0;if(o["background.toggleList"](W))return zr.size>0&&Vr&&(O||L(!0),ra(!0)),!0}return!1},[Lo,Go,xc,n,Yu,ub,mb,Ai,Uy,is,Cb,O,i.merged.general.debugKeystrokeLogging,oo,J,ss,x,ja,Gy,Gu,zr,Vr,ra,hc,Ii,i.merged.general.devtools,zu,St,o,t,h.history,Ko,Qe,p,y,f,T]);be(tM,{isActive:!0,priority:!0}),be(W=>o["scroll.up"](W)||o["scroll.down"](W)||o["scroll.pageUp"](W)||o["scroll.pageDown"](W)||o["scroll.home"](W)||o["scroll.end"](W)?!1:(J(!1),T&&cs(),!0),{isActive:H,priority:200}),(0,V.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let W=Ip({streamingState:wo,thoughtSubject:gc?.subject,isConfirming:!!na||zy,isSilentWorking:Yy,folderName:u1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});ur.current!==W&&(ur.current=W,yt.write(`\x1B]0;${W}\x07`))},[wo,gc,na,zy,Yy,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,yt]),(0,V.useEffect)(()=>{let W=pe=>{let Ge;switch(pe.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: ${pe.severity}`)}h.addItem({type:Ge,text:pe.message},Date.now()),pe.error&&Re.warn(`[Feedback Details for "${pe.message}"]`,pe.error)},Ce=pe=>{h.addItem({type:"info",text:pe.message,source:pe.hookName},Date.now())};return we.on(je.UserFeedback,W),we.on(je.HookSystemMessage,Ce),we.drainBacklogs(),()=>{we.off(je.UserFeedback,W),we.off(je.HookSystemMessage,Ce)}},[h]);let wb=e.version.includes("nightly"),vb=Vu||Vu||xf||Ef||ne||!!na||!!fc||!!Bu||!!K||Gr.length>0||!!Hu||dc||tf||sf||Ri||es||Xa||pc||cc||D||Tf||!!mc||!!Iu||!!Nu||!!Ou||rf||qr==="awaiting_api_key_input"||!!fe,oM=(0,V.useMemo)(()=>Wm(Ko),[Ko]),Ab=Gr.length>0,Ib=!!Hu,Sc=oM||!!na||!!fc||Ab||Ib||!!mc||!!Iu||!!Nu||!!Ou||!!K,Xu=i.merged.ui.loadingPhrases,nM=Xu==="tips"||Xu==="all",rM=Xu==="witty"||Xu==="all",iM=(!O||Vr)&&wo==="responding"&&!Sc,ju=0;if(ao.length>0&&i.merged.hooksConfig.notifications){let W=ao.length>1?"Executing Hooks":"Executing Hook",Ce=ao.map(pe=>pe.name+(pe.index&&pe.total&&pe.total>1?` (${pe.index}/${pe.total})`:"")).join(", ");ju=W.length+Ce.length+10}else iM?ju=(gc?.subject||"Waiting for model...").length+25:Sc&&(ju=35);let sM=Et-ju-5,{elapsedTime:Nb,currentLoadingPhrase:Ob,currentTip:Mb,currentWittyPhrase:Db}=yI({streamingState:wo,shouldShowFocusHint:$O,retryStatus:WO,showTips:nM,showWit:rM,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:sM}),_f=n.isPlanEnabled()&&wo==="idle"&&!Sc,Lb=aO({config:n,addItem:h.addItem,onApprovalModeChange:KO,isActive:!O,allowPlanMode:_f});AO({notificationsEnabled:l,isFocused:qu,hasReceivedFocusEvent:zO,streamingState:wo,hasPendingActionRequired:Sc,pendingHistoryItems:Ko,commandConfirmationRequest:na,authConsentRequest:fc,permissionConfirmationRequest:Bu,hasConfirmUpdateExtensionRequests:Ab,hasLoopDetectionConfirmationRequest:Ib});let kb=ff&&wo==="idle"&&!Sc;(0,V.useEffect)(()=>{ja&&!kb&&oa(!1)},[ja,kb,oa]),(0,V.useEffect)(()=>{if(!De||!n.isModelSteeringEnabled()||wo!=="idle"||!yc||Wm(Ko))return;let W=cf();W&&Qa([{text:Td(W)}])},[n,h,De,yc,wo,Qa,cf,Ko,HO]);let aM=(0,V.useMemo)(()=>$m(Ko),[Ko]),[Pb,lM]=(0,V.useState)(n.getGeminiMdFileCount());(0,V.useEffect)(()=>{let W=Ce=>{lM(Ce.fileCount)};return we.on(je.MemoryChanged,W),()=>{we.off(je.MemoryChanged,W)}},[]),(0,V.useEffect)(()=>{let W=!0;return(async()=>{let[pe,Ge]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);W&&(Zi(pe),ir(Ge),Wo(!0))})(),()=>{W=!1}},[n,oo]);let cM=(0,V.useMemo)(()=>({buffer:vi,userMessages:to,shellModeActive:Ie,showEscapePrompt:fb,copyModeEnabled:H,inputWidth:Ya,suggestionsWidth:lc}),[vi,to,Ie,fb,H,Ya,lc]),uM=(0,V.useMemo)(()=>({history:h.history,historyManager:h,isThemeDialogOpen:dc,themeError:B,isAuthenticating:Xa,isConfigInitialized:De,authError:fy,accountSuspensionInfo:yy,isAuthDialogOpen:pc,isAwaitingApiKeyInput:qr==="awaiting_api_key_input",apiKeyDefaultValue:gy,editorError:sy,isEditorDialogOpen:cc,showPrivacyNotice:D,mouseMode:T,corgiMode:w,debugMessage:R,quittingMessages:I,isSettingsDialogOpen:tf,isSessionBrowserOpen:rf,isModelDialogOpen:sf,isAgentConfigDialogOpen:Ri,selectedAgentName:wi,selectedAgentDisplayName:ea,selectedAgentDefinition:ue,isPermissionsDialogOpen:es,permissionsDialogProps:os,slashCommands:ku,pendingSlashCommandHistoryItems:Pu,commandContext:ky,commandConfirmationRequest:na,authConsentRequest:fc,confirmUpdateExtensionRequests:Gr,loopDetectionConfirmationRequest:Hu,permissionConfirmationRequest:Bu,geminiMdFileCount:Pb,streamingState:wo,initError:uf,pendingGeminiHistoryItems:Uu,thought:gc,isInputActive:ff,isResuming:nf,shouldShowIdePrompt:Vu,isFolderTrustDialogOpen:xf??!1,folderDiscoveryResults:hb,isPolicyUpdateDialogOpen:Ef,policyUpdateConfirmationRequest:Sf,isTrustedFolder:Z,constrainHeight:Lo,showErrorDetails:zu,showFullTodos:sb,ideContextState:Yu,renderMarkdown:ab,ctrlCPressedOnce:cb>=1,ctrlDPressedOnce:db>=1,shortcutsHelpVisible:ja,cleanUiDetailsVisible:Du,isFocused:qu,elapsedTime:Nb,currentLoadingPhrase:Ob,currentTip:Mb,currentWittyPhrase:Db,historyRemountKey:Ke,activeHooks:ao,messageQueue:Wu,queueErrorMessage:ye,showApprovalModeIndicator:Lb,allowPlanMode:_f,currentModel:Ee,quota:{userTier:q,stats:Me,proQuotaRequest:mc,validationRequest:Iu,overageMenuRequest:Nu,emptyWalletRequest:Ou},contextFileNames:nb,errorCount:ns,availableTerminalHeight:hf,stableControlsHeight:gf,mainAreaWidth:Ir,staticAreaMaxItemHeight:ry,staticExtraHeight:dr,dialogsVisible:vb,pendingHistoryItems:Ko,nightly:wb,branchName:lr,sessionStats:Ar,terminalWidth:Et,terminalHeight:_t,mainControlsRef:ob,rootUiRef:cr,currentIDE:bf,updateInfo:$t,showIdeRestartPrompt:Tf,ideTrustRestartReason:Sb,isRestarting:bb,extensionsUpdateState:Qs,activePtyId:is,backgroundTaskCount:mf,isBackgroundTaskVisible:Vr,embeddedShellFocused:O,showDebugProfiler:P,customDialog:K,transientMessage:gb,bannerData:In,bannerVisible:mn,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:_o,backgroundTasks:zr,activeBackgroundTaskPid:$y,backgroundTaskHeight:pf,isBackgroundTaskListOpen:Ky,adminSettingsChanged:ne,newAgents:fe,showIsExpandableHint:Ji,hintMode:n.isModelSteeringEnabled()&&Gm(Ko),hintBuffer:""}),[dc,B,Xa,De,fy,yy,pc,sy,cc,D,T,w,R,I,tf,rf,sf,Ri,wi,ea,ue,es,os,ku,Pu,ky,na,fc,Gr,Hu,Bu,Pb,wo,uf,Uu,gc,ff,nf,Vu,xf,hb,Ef,Sf,Z,Lo,zu,sb,Yu,ab,cb,db,ja,Du,qu,Nb,Ob,Mb,Db,Ke,ao,Wu,ye,Lb,_f,q,Me,mc,Iu,Nu,Ou,nb,ns,hf,gf,Ir,ry,dr,vb,Ko,wb,lr,Ar,Et,_t,ob,cr,bf,$t,Tf,Sb,bb,Ee,Qs,is,mf,Vr,h,O,P,K,gy,qr,gb,In,mn,n,_o,pf,Ky,$y,zr,ne,fe,Ji]),Bb=(0,V.useCallback)(()=>N(!1),[N]),dM=(0,V.useMemo)(()=>({handleThemeSelect:of,closeThemeDialog:my,handleThemeHighlight:py,handleAuthSelect:Ay,setAuthState:en,onAuthError:Yn,handleEditorSelect:ay,exitEditorDialog:ly,exitPrivacyNotice:Bb,closeSettingsDialog:uy,closeModelDialog:My,openAgentConfigDialog:me,closeAgentConfigDialog:Ne,openPermissionsDialog:$r,closePermissionsDialog:ar,setShellModeActive:at,vimHandleInput:eb,handleIdePromptComplete:Rb,handleFolderTrustSelect:yb,setIsPolicyUpdateDialogOpen:Tb,setConstrainHeight:Go,onEscapePromptChange:_b,refreshStatic:oo,handleFinalSubmit:bc,handleClearScreen:Zy,handleProQuotaChoice:xy,handleValidationChoice:Sy,handleOverageMenuChoice:Ey,handleEmptyWalletChoice:Cy,openSessionBrowser:Mu,closeSessionBrowser:_y,handleResumeSession:Ry,handleDeleteSession:vy,setQueueErrorMessage:Pe,addMessage:$u,popAllMessages:Qy,handleApiKeySubmit:Iy,handleApiKeyCancel:Ny,setBannerVisible:Wo,setShortcutsHelpVisible:oa,setCleanUiDetailsVisible:Dy,toggleCleanUiDetailsVisible:Ly,revealCleanUiDetailsTemporarily:Lu,handleWarning:Cf,setEmbeddedShellFocused:L,dismissBackgroundTask:Wy,setActiveBackgroundTaskPid:qy,setIsBackgroundTaskListOpen:ra,setAuthContext:ta,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(ny.send){let W=n.getRemoteAdminSettings();W&&ny.send({type:"admin-settings-update",settings:W})}await hn()},handleNewAgentsSelect:async W=>{if(fe&&W==="acknowledge"){let Ce=n.getAgentRegistry();try{await Promise.all(fe.map(pe=>Ce.acknowledgeAgent(pe)))}catch(pe){Re.error("Failed to acknowledge agents:",pe),h.addItem({type:"error",text:`Failed to acknowledge agents: ${Nr(pe)}`},Date.now())}}Tt(null)},getPreferredEditor:Au,clearAccountSuspension:()=>{by(null),en("updating")}}),[of,my,py,Ay,en,Yn,ay,ly,Bb,uy,My,me,Ne,$r,ar,at,eb,Rb,yb,Tb,Go,_b,oo,bc,Zy,xy,Sy,Ey,Cy,Mu,_y,Ry,vy,Pe,$u,Qy,Iy,Ny,Wo,oa,Dy,Ly,Lu,Cf,L,Wy,qy,ra,ta,by,fe,n,h,Au]);return qr==="awaiting_google_login_restart"?(0,wr.jsx)(yO,{onDismiss:()=>{ta({}),en("updating")},config:n}):(0,wr.jsx)(Id.Provider,{value:uM,children:(0,wr.jsx)(iE.Provider,{value:cM,children:(0,wr.jsx)(Dg.Provider,{value:dM,children:(0,wr.jsx)(dl.Provider,{value:n,children:(0,wr.jsx)(Ug.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,wr.jsx)(Z_,{config:n,toolCalls:aM,isExpanded:Oe,toggleExpansion:he,toggleAllExpansion:Qe,children:(0,wr.jsx)(dh.Provider,{value:qu,children:(0,wr.jsx)(rm,{mouseEventsEnabled:T,children:(0,wr.jsx)(im,{children:(0,wr.jsx)(kA,{},`app-${b}`)})})})})})})})})})};var qn=C(M(),1);var f1=200;async function oae(e,t,o,n=process.cwd(),r,a){Cv();let i=ud(e.getUseAlternateBuffer(),e.getScreenReader()),s=i;s&&(cs(),hs(()=>{us()}));let{matchers:l,errors:u}=await LS();u.forEach(E=>{we.emitFeedback("warning",E)});let p=await ox();g1(p1(n),t);let y=new iS({onNewMessage:E=>{we.emitConsoleLog(E.type,E.content)},debugMode:e.getDebugMode()});y.patch(),hs(y.cleanup);let{stdout:f,stderr:g}=vT(),h=!!process.env.SHPOOL_SESSION_NAME,x=()=>(mp(),(0,qn.jsx)(OS.Provider,{value:t,children:(0,qn.jsx)(kS,{value:l,children:(0,qn.jsx)(MS,{config:e,children:(0,qn.jsx)(rm,{mouseEventsEnabled:s,children:(0,qn.jsx)(UA,{children:(0,qn.jsx)(im,{children:(0,qn.jsx)(Sl,{children:(0,qn.jsx)(NR,{children:(0,qn.jsx)(rE,{children:(0,qn.jsx)(OO,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:a})})})})})})})})})}));h&&await new Promise(E=>setTimeout(E,100));let T=SS(process.env.DEBUG?(0,qn.jsx)(MO.default.StrictMode,{children:(0,qn.jsx)(x,{})}):(0,qn.jsx)(x,{}),{stdout:f,stderr:g,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:E})=>{E>f1&&xT(e,E),nE.reportFrameRendered()},standardReactLayoutTiming:i||e.getUseTerminalBuffer(),patchConsole:!1,alternateBuffer:i,terminalBuffer:e.getUseTerminalBuffer(),renderProcess:e.getUseRenderProcess()&&e.getUseTerminalBuffer(),incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(Za(),hs(()=>{ld()})),rO(t).then(E=>{pE(E,t,e.getProjectRoot())}).catch(E=>{e.getDebugMode()&&Re.warn("Update check failed:",E)}),hs(()=>T.unmount()),hs(Zx())}function g1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Ip({streamingState:"idle",isConfirming:!1,isSilentWorking:!1,folderName:e,showThoughts:!!t.merged.ui.showStatusInTitle,useDynamicTitle:t.merged.ui.dynamicWindowTitle});Xn(`\x1B]0;${o}\x07`),process.on("exit",()=>{Xn("\x1B]0;\x07")})}}export{oae as startInteractiveUI};
121
121
  /**
122
122
  * @license
123
123
  * 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 Xx,$b as SS,$c as Ho,A as Ix,Aa as $x,Ab as m,Ac as PS,B as Nx,Ba as Xa,Bb as c,Bc as BS,C as qr,Ca as at,Cb as lS,Cc as Ed,Db as cS,Dc as we,E as ss,Eb as uS,Ec as FS,F as Ri,Fb as dS,Fc as US,G as Ox,Gb as Uo,Gc as HS,H as oa,Ha as Kx,Hb as us,Hc as Cd,I as io,Ib as mS,Ic as _d,J as gd,Jb as Za,Jc as Rd,K as Ht,Kb as wn,Kc as wd,L as ar,Lb as d,Lc as GS,M as mo,Mb as pS,Mc as WS,N as Df,Nb as fS,Nc as ol,O as qn,Ob as Uf,Oc as $S,P as Mx,Pb as gS,Pc as Wf,Q,Qa as qx,Qb as hS,Qc as KS,R as as,Rb as yS,Rc as qS,S as Dx,Sb as bS,Sc as nl,Tb as Je,Tc as VS,Ub as xd,Uc as lr,V as Lx,Vb as M,Vc as vd,W as kx,Wb as TS,Wc as zS,X as Lf,Xa as Vx,Xb as ye,Xc as vn,Ya as zx,Yb as Et,Yc as Ic,Z as Px,Za as kf,Zb as vc,Zc as YS,_a as Yx,_b as xS,_c as XS,aa as Bx,ab as jx,ac as ES,ad as jS,b as ea,ba as Fx,bb as Qx,bc as tt,bd as Ad,c as gx,cb as ln,cc as Sd,cd as QS,d as $r,da as wi,db as Pf,dc as Qe,dd as JS,e as Ec,ea as Ux,eb as ja,ec as CS,ed as ZS,f as _i,fb as Jx,fc as Hf,g as hx,gb as Zx,gc as _S,gd as Id,h as Of,hb as bd,hc as RS,hd as eE,i as yx,ia as ls,ib as eS,ic as wS,id as tE,j as bx,jb as zr,jc as vS,k as Tx,kb as Rc,kc as AS,kd as un,l as xx,lb as tS,lc as IS,ld as oE,m as Kr,ma as Vr,mb as wc,mc as NS,md as Mt,n as Sx,nb as cs,nc as OS,o as Ex,oa as Hx,ob as Qa,oc as el,p as Cx,pb as Td,pc as na,q as Mf,qa as hd,qb as oS,qc as MS,r as Cc,rb as nS,rc as Gf,s as _x,sb as Bf,sc as DS,t as Rx,tb as rS,tc as ra,u as wx,ub as Ff,uc as ia,v as vx,va as Gx,vb as iS,vc as Ac,w as Ax,wb as Ja,wc as LS,x as ta,xb as sS,xc as kS,y as _c,ya as yd,yb as cn,yc as tl,za as Wx,zb as aS,zc as xt}from"./chunk-FZKV2OXC.js";import{$c as ET,$k as nx,Ac as od,Ag as qT,Am as pd,Bc as yT,Bd as vT,Cc as nd,Ce as kT,Dc as bT,Dd as AT,Eb as ed,Em as fd,Fd as IT,Fk as ox,Fm as Zs,Gf as rs,Hb as pT,Hf as Va,Hg as ld,Hl as rx,If as za,Il as ix,Im as cx,Jc as rd,Jd as NT,Jh as an,Jm as Nf,Kf as UT,Kl as sx,L as oT,Le as Qs,Lf as HT,Lm as ux,Mc as TT,Mk as md,N as ju,Ne as PT,Nf as GT,Nm as dx,O as xc,Pb as Cf,Pm as mx,Qb as _f,Qm as px,Rg as VT,T as Ef,Tg as zT,Th as Js,Ug as YT,Ui as Af,Vb as fT,Vg as XT,W as sT,Wi as tx,Xa as aT,Xc as xT,Xg as wr,Xh as uo,Ya as lT,Yf as WT,Za as cT,Zc as Rf,_c as ST,ac as gT,ak as Ya,bd as CT,bf as Sc,cd as _T,ce as id,cf as BT,dd as RT,df as sd,ee as OT,em as ax,ge as MT,gf as ad,gh as jT,hf as FT,hg as $T,lc as Kn,ln as fx,mj as cd,mk as If,na as Ju,oa as Zu,oc as hT,pe as DT,pm as lx,qc as ts,rc as os,rf as vf,ri as QT,tb as uT,tg as KT,ti as JT,ub as dT,ui as ZT,we as wf,wi as is,x as tT,xb as mT,xd as ns,yc as td,yi as ex,yk as dd,zc as qa,zd as wT,ze as LT}from"./chunk-SZCTACC4.js";import{Aa as Tf,Ba as xf,Ca as gc,Da as hc,Ea as yc,Fa as es,Ga as bc,Gd as eT,Ha as Ub,Ia as qu,Ja as Tc,Ld as Qu,M as Nb,Nd as Rr,S as Ob,Sa as Kt,T as Mb,U as fc,Ua as Vu,V as $u,W as Db,X as Ku,Za as Hb,_b as zu,_d as nT,aa as Lb,ae as rT,b as _e,ca as kb,ce as iT,dd as Sf,ea as Pb,fa as Bb,ge as Re,ha as Fb,j as Ib,ld as qb,md as Vb,od as zb,pc as Yu,pd as Yb,qc as Xu,qd as Xb,rc as Wb,rd as jb,sa as Ka,sc as $b,sd as Qb,t as Xo,tc as Kb,td as Jb,ud as Zb,ye as ud,za as bf,zb as Gb}from"./chunk-F34TWSY4.js";import"./chunk-TWIC4BKL.js";import{c as It}from"./chunk-TU3BMADG.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as At,c as _t,d as nM,e as C}from"./chunk-YUXORC52.js";var kC=_t((QF,LC)=>{function EC(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)&&EC(o)}),e}var $d=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function CC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ps(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 $M="</span>",hC=e=>!!e.scope,KM=(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}`},Xf=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=CC(t)}openNode(t){if(!hC(t))return;let o=KM(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){hC(t)&&(this.buffer+=$M)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},yC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},jf=class e{constructor(){this.rootNode=yC(),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=yC({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)}))}},Qf=class extends jf{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 Xf(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Oc(e){return e?typeof e=="string"?e:e.source:null}function _C(e){return aa("(?=",e,")")}function qM(e){return aa("(?:",e,")*")}function VM(e){return aa("(?:",e,")?")}function aa(...e){return e.map(o=>Oc(o)).join("")}function zM(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Zf(...e){return"("+(zM(e).capture?"":"?:")+e.map(n=>Oc(n)).join("|")+")"}function RC(e){return new RegExp(e.toString()+"|").exec("").length-1}function YM(e,t){let o=e&&e.exec(t);return o&&o.index===0}var XM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function eg(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,a=Oc(n),i="";for(;a.length>0;){let s=XM.exec(a);if(!s){i+=a;break}i+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?i+="\\"+String(Number(s[1])+r):(i+=s[0],s[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var jM=/\b\B/,wC="[a-zA-Z]\\w*",tg="[a-zA-Z_]\\w*",vC="\\b\\d+(\\.\\d+)?",AC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",IC="\\b(0b[01]+)",QM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",JM=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=aa(t,/.*\b/,e.binary,/\b.*/)),ps({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},Mc={begin:"\\\\[\\s\\S]",relevance:0},ZM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Mc]},eD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Mc]},tD={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=ps({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=Zf("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:aa(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},oD=qd("//","$"),nD=qd("/\\*","\\*/"),rD=qd("#","$"),iD={scope:"number",begin:vC,relevance:0},sD={scope:"number",begin:AC,relevance:0},aD={scope:"number",begin:IC,relevance:0},lD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Mc,{begin:/\[/,end:/\]/,relevance:0,contains:[Mc]}]},cD={scope:"title",begin:wC,relevance:0},uD={scope:"title",begin:tg,relevance:0},dD={begin:"\\.\\s*"+tg,relevance:0},mD=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()}})},Wd=Object.freeze({__proto__:null,APOS_STRING_MODE:ZM,BACKSLASH_ESCAPE:Mc,BINARY_NUMBER_MODE:aD,BINARY_NUMBER_RE:IC,COMMENT:qd,C_BLOCK_COMMENT_MODE:nD,C_LINE_COMMENT_MODE:oD,C_NUMBER_MODE:sD,C_NUMBER_RE:AC,END_SAME_AS_BEGIN:mD,HASH_COMMENT_MODE:rD,IDENT_RE:wC,MATCH_NOTHING_RE:jM,METHOD_GUARD:dD,NUMBER_MODE:iD,NUMBER_RE:vC,PHRASAL_WORDS_MODE:tD,QUOTE_STRING_MODE:eD,REGEXP_MODE:lD,RE_STARTERS_RE:QM,SHEBANG:JM,TITLE_MODE:cD,UNDERSCORE_IDENT_RE:tg,UNDERSCORE_TITLE_MODE:uD});function pD(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function fD(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function gD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=pD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function hD(e,t){Array.isArray(e.illegal)&&(e.illegal=Zf(...e.illegal))}function yD(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 bD(e,t){e.relevance===void 0&&(e.relevance=1)}var TD=(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=aa(o.beforeMatch,_C(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"],SD="keyword";function NC(e,t,o=SD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(a){Object.assign(n,NC(e[a],t,a))}),n;function r(a,i){t&&(i=i.map(s=>s.toLowerCase())),i.forEach(function(s){let l=s.split("|");n[l[0]]=[a,ED(l[0],l[1])]})}}function ED(e,t){return t?Number(t):CD(e)?0:1}function CD(e){return xD.includes(e.toLowerCase())}var bC={},sa=e=>{console.error(e)},TC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},cl=(e,t)=>{bC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),bC[`${e}/${t}`]=!0)},Kd=new Error;function OC(e,t,{key:o}){let n=0,r=e[o],a={},i={};for(let s=1;s<=t.length;s++)i[s+n]=r[s],a[s+n]=!0,n+=RC(t[s-1]);e[o]=i,e[o]._emit=a,e[o]._multi=!0}function _D(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Kd;if(typeof e.beginScope!="object"||e.beginScope===null)throw sa("beginScope must be object"),Kd;OC(e,e.begin,{key:"beginScope"}),e.begin=eg(e.begin,{joinWith:""})}}function RD(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Kd;if(typeof e.endScope!="object"||e.endScope===null)throw sa("endScope must be object"),Kd;OC(e,e.end,{key:"endScope"}),e.end=eg(e.end,{joinWith:""})}}function wD(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function vD(e){wD(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),_D(e),RD(e)}function AD(e){function t(i,s){return new RegExp(Oc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=RC(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let s=this.regexes.map(l=>l[1]);this.matcherRe=t(eg(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(s);if(!l)return null;let u=l.findIndex((y,f)=>f>0&&y!==void 0),p=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];let l=new o;return this.rules.slice(s).forEach(([u,p])=>l.addRule(u,p)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,u=p.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(i){let s=new n;return i.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&s.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&s.addRule(i.illegal,{type:"illegal"}),s}function a(i,s){let l=i;if(i.isCompiled)return l;[fD,yD,vD,TD].forEach(p=>p(i,s)),e.compilerExtensions.forEach(p=>p(i,s)),i.__beforeBegin=null,[gD,hD,bD].forEach(p=>p(i,s)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=NC(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),s&&(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=Oc(l.end)||"",i.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return ID(p==="self"?i:p)})),i.contains.forEach(function(p){a(p,l)}),i.starts&&a(i.starts,s),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=ps(e.classNameAliases||{}),a(e)}function MC(e){return e?e.endsWithParent||MC(e.starts):!1}function ID(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ps(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:MC(e)?ps(e,{starts:e.starts?ps(e.starts):null}):Object.isFrozen(e)?ps(e):e}var ND="11.11.1",Jf=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},Yf=CC,xC=ps,SC=Symbol("nomatch"),OD=7,DC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,a="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Qf};function l(O){return s.noHighlightRe.test(O)}function u(O){let L=O.className+" ";L+=O.parentNode?O.parentNode.className:"";let P=s.languageDetectRe.exec(L);if(P){let $=I(P[1]);return $||(TC(a.replace("{}",P[1])),TC("Falling back to no-highlight mode for this block.",O)),$?P[1]:"no-highlight"}return L.split(/\s+/).find($=>l($)||I($))}function p(O,L,P){let $="",K="";typeof L=="object"?($=O,P=L.ignoreIllegals,K=L.language):(cl("10.7.0","highlight(lang, code, ...args) has been deprecated."),cl("10.7.0",`Please use highlight(code, options) instead.
2
+ import{$a as Xx,$b as SS,$c as Ho,A as Ix,Aa as $x,Ab as m,Ac as PS,B as Nx,Ba as Xa,Bb as c,Bc as BS,C as qr,Ca as at,Cb as lS,Cc as Ed,Db as cS,Dc as we,E as ss,Eb as uS,Ec as FS,F as Ri,Fb as dS,Fc as US,G as Ox,Gb as Uo,Gc as HS,H as oa,Ha as Kx,Hb as us,Hc as Cd,I as io,Ib as mS,Ic as _d,J as gd,Jb as Za,Jc as Rd,K as Ht,Kb as wn,Kc as wd,L as ar,Lb as d,Lc as GS,M as mo,Mb as pS,Mc as WS,N as Df,Nb as fS,Nc as ol,O as qn,Ob as Uf,Oc as $S,P as Mx,Pb as gS,Pc as Wf,Q,Qa as qx,Qb as hS,Qc as KS,R as as,Rb as yS,Rc as qS,S as Dx,Sb as bS,Sc as nl,Tb as Je,Tc as VS,Ub as xd,Uc as lr,V as Lx,Vb as M,Vc as vd,W as kx,Wb as TS,Wc as zS,X as Lf,Xa as Vx,Xb as ye,Xc as vn,Ya as zx,Yb as Et,Yc as Ic,Z as Px,Za as kf,Zb as vc,Zc as YS,_a as Yx,_b as xS,_c as XS,aa as Bx,ab as jx,ac as ES,ad as jS,b as ea,ba as Fx,bb as Qx,bc as tt,bd as Ad,c as gx,cb as ln,cc as Sd,cd as QS,d as $r,da as wi,db as Pf,dc as Qe,dd as JS,e as Ec,ea as Ux,eb as ja,ec as CS,ed as ZS,f as _i,fb as Jx,fc as Hf,g as hx,gb as Zx,gc as _S,gd as Id,h as Of,hb as bd,hc as RS,hd as eE,i as yx,ia as ls,ib as eS,ic as wS,id as tE,j as bx,jb as zr,jc as vS,k as Tx,kb as Rc,kc as AS,kd as un,l as xx,lb as tS,lc as IS,ld as oE,m as Kr,ma as Vr,mb as wc,mc as NS,md as Mt,n as Sx,nb as cs,nc as OS,o as Ex,oa as Hx,ob as Qa,oc as el,p as Cx,pb as Td,pc as na,q as Mf,qa as hd,qb as oS,qc as MS,r as Cc,rb as nS,rc as Gf,s as _x,sb as Bf,sc as DS,t as Rx,tb as rS,tc as ra,u as wx,ub as Ff,uc as ia,v as vx,va as Gx,vb as iS,vc as Ac,w as Ax,wb as Ja,wc as LS,x as ta,xb as sS,xc as kS,y as _c,ya as yd,yb as cn,yc as tl,za as Wx,zb as aS,zc as xt}from"./chunk-XJCP4SNL.js";import{$c as ET,$k as nx,Ac as od,Ag as qT,Am as pd,Bc as yT,Bd as vT,Cc as nd,Ce as kT,Dc as bT,Dd as AT,Eb as ed,Em as fd,Fd as IT,Fk as ox,Fm as Zs,Gf as rs,Hb as pT,Hf as Va,Hg as ld,Hl as rx,If as za,Il as ix,Im as cx,Jc as rd,Jd as NT,Jh as an,Jm as Nf,Kf as UT,Kl as sx,L as oT,Le as Qs,Lf as HT,Lm as ux,Mc as TT,Mk as md,N as ju,Ne as PT,Nf as GT,Nm as dx,O as xc,Pb as Cf,Pm as mx,Qb as _f,Qm as px,Rg as VT,T as Ef,Tg as zT,Th as Js,Ug as YT,Ui as Af,Vb as fT,Vg as XT,W as sT,Wi as tx,Xa as aT,Xc as xT,Xg as wr,Xh as uo,Ya as lT,Yf as WT,Za as cT,Zc as Rf,_c as ST,ac as gT,ak as Ya,bd as CT,bf as Sc,cd as _T,ce as id,cf as BT,dd as RT,df as sd,ee as OT,em as ax,ge as MT,gf as ad,gh as jT,hf as FT,hg as $T,lc as Kn,ln as fx,mj as cd,mk as If,na as Ju,oa as Zu,oc as hT,pe as DT,pm as lx,qc as ts,rc as os,rf as vf,ri as QT,tb as uT,tg as KT,ti as JT,ub as dT,ui as ZT,we as wf,wi as is,x as tT,xb as mT,xd as ns,yc as td,yi as ex,yk as dd,zc as qa,zd as wT,ze as LT}from"./chunk-PV736O4V.js";import{Aa as Tf,Ba as xf,Ca as gc,Da as hc,Ea as yc,Fa as es,Ga as bc,Gd as eT,Ha as Ub,Ia as qu,Ja as Tc,Ld as Qu,M as Nb,Nd as Rr,S as Ob,Sa as Kt,T as Mb,U as fc,Ua as Vu,V as $u,W as Db,X as Ku,Za as Hb,_b as zu,_d as nT,aa as Lb,ae as rT,b as _e,ca as kb,ce as iT,dd as Sf,ea as Pb,fa as Bb,ge as Re,ha as Fb,j as Ib,ld as qb,md as Vb,od as zb,pc as Yu,pd as Yb,qc as Xu,qd as Xb,rc as Wb,rd as jb,sa as Ka,sc as $b,sd as Qb,t as Xo,tc as Kb,td as Jb,ud as Zb,ye as ud,za as bf,zb as Gb}from"./chunk-F34TWSY4.js";import"./chunk-TWIC4BKL.js";import{c as It}from"./chunk-TU3BMADG.js";import"./chunk-JAFVB6DI.js";import"./chunk-A5A5SUZN.js";import{a as At,c as _t,d as nM,e as C}from"./chunk-YUXORC52.js";var kC=_t((QF,LC)=>{function EC(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)&&EC(o)}),e}var $d=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function CC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ps(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 $M="</span>",hC=e=>!!e.scope,KM=(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}`},Xf=class{constructor(t,o){this.buffer="",this.classPrefix=o.classPrefix,t.walk(this)}addText(t){this.buffer+=CC(t)}openNode(t){if(!hC(t))return;let o=KM(t.scope,{prefix:this.classPrefix});this.span(o)}closeNode(t){hC(t)&&(this.buffer+=$M)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},yC=(e={})=>{let t={children:[]};return Object.assign(t,e),t},jf=class e{constructor(){this.rootNode=yC(),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=yC({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)}))}},Qf=class extends jf{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 Xf(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Oc(e){return e?typeof e=="string"?e:e.source:null}function _C(e){return aa("(?=",e,")")}function qM(e){return aa("(?:",e,")*")}function VM(e){return aa("(?:",e,")?")}function aa(...e){return e.map(o=>Oc(o)).join("")}function zM(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Zf(...e){return"("+(zM(e).capture?"":"?:")+e.map(n=>Oc(n)).join("|")+")"}function RC(e){return new RegExp(e.toString()+"|").exec("").length-1}function YM(e,t){let o=e&&e.exec(t);return o&&o.index===0}var XM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function eg(e,{joinWith:t}){let o=0;return e.map(n=>{o+=1;let r=o,a=Oc(n),i="";for(;a.length>0;){let s=XM.exec(a);if(!s){i+=a;break}i+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?i+="\\"+String(Number(s[1])+r):(i+=s[0],s[0]==="("&&o++)}return i}).map(n=>`(${n})`).join(t)}var jM=/\b\B/,wC="[a-zA-Z]\\w*",tg="[a-zA-Z_]\\w*",vC="\\b\\d+(\\.\\d+)?",AC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",IC="\\b(0b[01]+)",QM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",JM=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=aa(t,/.*\b/,e.binary,/\b.*/)),ps({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(o,n)=>{o.index!==0&&n.ignoreMatch()}},e)},Mc={begin:"\\\\[\\s\\S]",relevance:0},ZM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Mc]},eD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Mc]},tD={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=ps({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=Zf("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:aa(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},oD=qd("//","$"),nD=qd("/\\*","\\*/"),rD=qd("#","$"),iD={scope:"number",begin:vC,relevance:0},sD={scope:"number",begin:AC,relevance:0},aD={scope:"number",begin:IC,relevance:0},lD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Mc,{begin:/\[/,end:/\]/,relevance:0,contains:[Mc]}]},cD={scope:"title",begin:wC,relevance:0},uD={scope:"title",begin:tg,relevance:0},dD={begin:"\\.\\s*"+tg,relevance:0},mD=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()}})},Wd=Object.freeze({__proto__:null,APOS_STRING_MODE:ZM,BACKSLASH_ESCAPE:Mc,BINARY_NUMBER_MODE:aD,BINARY_NUMBER_RE:IC,COMMENT:qd,C_BLOCK_COMMENT_MODE:nD,C_LINE_COMMENT_MODE:oD,C_NUMBER_MODE:sD,C_NUMBER_RE:AC,END_SAME_AS_BEGIN:mD,HASH_COMMENT_MODE:rD,IDENT_RE:wC,MATCH_NOTHING_RE:jM,METHOD_GUARD:dD,NUMBER_MODE:iD,NUMBER_RE:vC,PHRASAL_WORDS_MODE:tD,QUOTE_STRING_MODE:eD,REGEXP_MODE:lD,RE_STARTERS_RE:QM,SHEBANG:JM,TITLE_MODE:cD,UNDERSCORE_IDENT_RE:tg,UNDERSCORE_TITLE_MODE:uD});function pD(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function fD(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function gD(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=pD,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function hD(e,t){Array.isArray(e.illegal)&&(e.illegal=Zf(...e.illegal))}function yD(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 bD(e,t){e.relevance===void 0&&(e.relevance=1)}var TD=(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=aa(o.beforeMatch,_C(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"],SD="keyword";function NC(e,t,o=SD){let n=Object.create(null);return typeof e=="string"?r(o,e.split(" ")):Array.isArray(e)?r(o,e):Object.keys(e).forEach(function(a){Object.assign(n,NC(e[a],t,a))}),n;function r(a,i){t&&(i=i.map(s=>s.toLowerCase())),i.forEach(function(s){let l=s.split("|");n[l[0]]=[a,ED(l[0],l[1])]})}}function ED(e,t){return t?Number(t):CD(e)?0:1}function CD(e){return xD.includes(e.toLowerCase())}var bC={},sa=e=>{console.error(e)},TC=(e,...t)=>{console.log(`WARN: ${e}`,...t)},cl=(e,t)=>{bC[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),bC[`${e}/${t}`]=!0)},Kd=new Error;function OC(e,t,{key:o}){let n=0,r=e[o],a={},i={};for(let s=1;s<=t.length;s++)i[s+n]=r[s],a[s+n]=!0,n+=RC(t[s-1]);e[o]=i,e[o]._emit=a,e[o]._multi=!0}function _D(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Kd;if(typeof e.beginScope!="object"||e.beginScope===null)throw sa("beginScope must be object"),Kd;OC(e,e.begin,{key:"beginScope"}),e.begin=eg(e.begin,{joinWith:""})}}function RD(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Kd;if(typeof e.endScope!="object"||e.endScope===null)throw sa("endScope must be object"),Kd;OC(e,e.end,{key:"endScope"}),e.end=eg(e.end,{joinWith:""})}}function wD(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function vD(e){wD(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),_D(e),RD(e)}function AD(e){function t(i,s){return new RegExp(Oc(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class o{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=RC(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let s=this.regexes.map(l=>l[1]);this.matcherRe=t(eg(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(s);if(!l)return null;let u=l.findIndex((y,f)=>f>0&&y!==void 0),p=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,p)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];let l=new o;return this.rules.slice(s).forEach(([u,p])=>l.addRule(u,p)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,u=p.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(i){let s=new n;return i.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&s.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&s.addRule(i.illegal,{type:"illegal"}),s}function a(i,s){let l=i;if(i.isCompiled)return l;[fD,yD,vD,TD].forEach(p=>p(i,s)),e.compilerExtensions.forEach(p=>p(i,s)),i.__beforeBegin=null,[gD,hD,bD].forEach(p=>p(i,s)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=NC(i.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),s&&(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=Oc(l.end)||"",i.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(l.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(p){return ID(p==="self"?i:p)})),i.contains.forEach(function(p){a(p,l)}),i.starts&&a(i.starts,s),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=ps(e.classNameAliases||{}),a(e)}function MC(e){return e?e.endsWithParent||MC(e.starts):!1}function ID(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ps(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:MC(e)?ps(e,{starts:e.starts?ps(e.starts):null}):Object.isFrozen(e)?ps(e):e}var ND="11.11.1",Jf=class extends Error{constructor(t,o){super(t),this.name="HTMLInjectionError",this.html=o}},Yf=CC,xC=ps,SC=Symbol("nomatch"),OD=7,DC=function(e){let t=Object.create(null),o=Object.create(null),n=[],r=!0,a="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Qf};function l(O){return s.noHighlightRe.test(O)}function u(O){let L=O.className+" ";L+=O.parentNode?O.parentNode.className:"";let P=s.languageDetectRe.exec(L);if(P){let $=I(P[1]);return $||(TC(a.replace("{}",P[1])),TC("Falling back to no-highlight mode for this block.",O)),$?P[1]:"no-highlight"}return L.split(/\s+/).find($=>l($)||I($))}function p(O,L,P){let $="",K="";typeof L=="object"?($=O,P=L.ignoreIllegals,K=L.language):(cl("10.7.0","highlight(lang, code, ...args) has been deprecated."),cl("10.7.0",`Please use highlight(code, options) instead.
3
3
  https://github.com/highlightjs/highlight.js/issues/2277`),K=O,$=L),P===void 0&&(P=!0);let z={code:$,language:K};F("before:highlight",z);let H=z.result?z.result:y(z.language,z.code,P);return H.code=z.code,F("after:highlight",H),H}function y(O,L,P,$){let K=Object.create(null);function z(j,Z){return j.keywords[Z]}function H(){if(!te.keywords){$e.addText(qe);return}let j=0;te.keywordPatternRe.lastIndex=0;let Z=te.keywordPatternRe.exec(qe),ie="";for(;Z;){ie+=qe.substring(j,Z.index);let he=Ne.case_insensitive?Z[0].toLowerCase():Z[0],ke=z(te,he);if(ke){let[pe,ft]=ke;if($e.addText(ie),ie="",K[he]=(K[he]||0)+1,K[he]<=OD&&(bo+=ft),pe.startsWith("_"))ie+=Z[0];else{let Ao=Ne.classNameAliases[pe]||pe;U(Z[0],Ao)}}else ie+=Z[0];j=te.keywordPatternRe.lastIndex,Z=te.keywordPatternRe.exec(qe)}ie+=qe.substring(j),$e.addText(ie)}function J(){if(qe==="")return;let j=null;if(typeof te.subLanguage=="string"){if(!t[te.subLanguage]){$e.addText(qe);return}j=y(te.subLanguage,qe,!0,Ze[te.subLanguage]),Ze[te.subLanguage]=j._top}else j=g(qe,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(bo+=j.relevance),$e.__addSublanguage(j._emitter,j.language)}function ce(){te.subLanguage!=null?J():H(),qe=""}function U(j,Z){j!==""&&($e.startScope(Z),$e.addText(j),$e.endScope())}function Y(j,Z){let ie=1,he=Z.length-1;for(;ie<=he;){if(!j._emit[ie]){ie++;continue}let ke=Ne.classNameAliases[j[ie]]||j[ie],pe=Z[ie];ke?U(pe,ke):(qe=pe,H(),qe=""),ie++}}function ee(j,Z){return j.scope&&typeof j.scope=="string"&&$e.openNode(Ne.classNameAliases[j.scope]||j.scope),j.beginScope&&(j.beginScope._wrap?(U(qe,Ne.classNameAliases[j.beginScope._wrap]||j.beginScope._wrap),qe=""):j.beginScope._multi&&(Y(j.beginScope,Z),qe="")),te=Object.create(j,{parent:{value:te}}),te}function X(j,Z,ie){let he=YM(j.endRe,ie);if(he){if(j["on:end"]){let ke=new $d(j);j["on:end"](Z,ke),ke.isMatchIgnored&&(he=!1)}if(he){for(;j.endsParent&&j.parent;)j=j.parent;return j}}if(j.endsWithParent)return X(j.parent,Z,ie)}function ne(j){return te.matcher.regexIndex===0?(qe+=j[0],1):(Ft=!0,0)}function le(j){let Z=j[0],ie=j.rule,he=new $d(ie),ke=[ie.__beforeBegin,ie["on:begin"]];for(let pe of ke)if(pe&&(pe(j,he),he.isMatchIgnored))return ne(Z);return ie.skip?qe+=Z:(ie.excludeBegin&&(qe+=Z),ce(),!ie.returnBegin&&!ie.excludeBegin&&(qe=Z)),ee(ie,j),ie.returnBegin?0:Z.length}function re(j){let Z=j[0],ie=L.substring(j.index),he=X(te,j,ie);if(!he)return SC;let ke=te;te.endScope&&te.endScope._wrap?(ce(),U(Z,te.endScope._wrap)):te.endScope&&te.endScope._multi?(ce(),Y(te.endScope,j)):ke.skip?qe+=Z:(ke.returnEnd||ke.excludeEnd||(qe+=Z),ce(),ke.excludeEnd&&(qe=Z));do te.scope&&$e.closeNode(),!te.skip&&!te.subLanguage&&(bo+=te.relevance),te=te.parent;while(te!==he.parent);return he.starts&&ee(he.starts,j),ke.returnEnd?0:Z.length}function ae(){let j=[];for(let Z=te;Z!==Ne;Z=Z.parent)Z.scope&&j.unshift(Z.scope);j.forEach(Z=>$e.openNode(Z))}let ge={};function Xe(j,Z){let ie=Z&&Z[0];if(qe+=j,ie==null)return ce(),0;if(ge.type==="begin"&&Z.type==="end"&&ge.index===Z.index&&ie===""){if(qe+=L.slice(Z.index,Z.index+1),!r){let he=new Error(`0 width match regex (${O})`);throw he.languageName=O,he.badRule=ge.rule,he}return 1}if(ge=Z,Z.type==="begin")return le(Z);if(Z.type==="illegal"&&!P){let he=new Error('Illegal lexeme "'+ie+'" for mode "'+(te.scope||"<unnamed>")+'"');throw he.mode=te,he}else if(Z.type==="end"){let he=re(Z);if(he!==SC)return he}if(Z.type==="illegal"&&ie==="")return qe+=`
4
4
  `,1;if(oo>1e5&&oo>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qe+=ie,ie.length}let Ne=I(O);if(!Ne)throw sa(a.replace("{}",O)),new Error('Unknown language: "'+O+'"');let Ae=AD(Ne),nt="",te=$||Ae,Ze={},$e=new s.__emitter(s);ae();let qe="",bo=0,To=0,oo=0,Ft=!1;try{if(Ne.__emitTokens)Ne.__emitTokens(L,$e);else{for(te.matcher.considerAll();;){oo++,Ft?Ft=!1:te.matcher.considerAll(),te.matcher.lastIndex=To;let j=te.matcher.exec(L);if(!j)break;let Z=L.substring(To,j.index),ie=Xe(Z,j);To=j.index+ie}Xe(L.substring(To))}return $e.finalize(),nt=$e.toHTML(),{language:O,value:nt,relevance:bo,illegal:!1,_emitter:$e,_top:te}}catch(j){if(j.message&&j.message.includes("Illegal"))return{language:O,value:Yf(L),illegal:!0,relevance:0,_illegalBy:{message:j.message,index:To,context:L.slice(To-100,To+100),mode:j.mode,resultSoFar:nt},_emitter:$e};if(r)return{language:O,value:Yf(L),illegal:!1,relevance:0,errorRaised:j,_emitter:$e,_top:te};throw j}}function f(O){let L={value:Yf(O),illegal:!1,relevance:0,_top:i,_emitter:new s.__emitter(s)};return L._emitter.addText(O),L}function g(O,L){L=L||s.languages||Object.keys(t);let P=f(O),$=L.filter(I).filter(D).map(ce=>y(ce,O,!1));$.unshift(P);let K=$.sort((ce,U)=>{if(ce.relevance!==U.relevance)return U.relevance-ce.relevance;if(ce.language&&U.language){if(I(ce.language).supersetOf===U.language)return 1;if(I(U.language).supersetOf===ce.language)return-1}return 0}),[z,H]=K,J=z;return J.secondBest=H,J}function h(O,L,P){let $=L&&o[L]||P;O.classList.add("hljs"),O.classList.add(`language-${$}`)}function x(O){let L=null,P=u(O);if(l(P))return;if(F("before:highlightElement",{el:O,language:P}),O.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",O);return}if(O.children.length>0&&(s.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(O)),s.throwUnescapedHTML))throw new Jf("One of your code blocks includes unescaped HTML.",O.innerHTML);L=O;let $=L.textContent,K=P?p($,{language:P,ignoreIllegals:!0}):g($);O.innerHTML=K.value,O.dataset.highlighted="yes",h(O,P,K.language),O.result={language:K.language,re:K.relevance,relevance:K.relevance},K.secondBest&&(O.secondBest={language:K.secondBest.language,relevance:K.secondBest.relevance}),F("after:highlightElement",{el:O,result:K,text:$})}function T(O){s=xC(s,O)}let E=()=>{b(),cl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){b(),cl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function b(){function O(){b()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",O,!1),S=!0;return}document.querySelectorAll(s.cssSelector).forEach(x)}function v(O,L){let P=null;try{P=L(e)}catch($){if(sa("Language definition for '{}' could not be registered.".replace("{}",O)),r)sa($);else throw $;P=i}P.name||(P.name=O),t[O]=P,P.rawDefinition=L.bind(null,e),P.aliases&&A(P.aliases,{languageName:O})}function R(O){delete t[O];for(let L of Object.keys(o))o[L]===O&&delete o[L]}function _(){return Object.keys(t)}function I(O){return O=(O||"").toLowerCase(),t[O]||t[o[O]]}function A(O,{languageName:L}){typeof O=="string"&&(O=[O]),O.forEach(P=>{o[P.toLowerCase()]=L})}function D(O){let L=I(O);return L&&!L.disableAutodetect}function N(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=L=>{O["before:highlightBlock"](Object.assign({block:L.el},L))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=L=>{O["after:highlightBlock"](Object.assign({block:L.el},L))})}function B(O){N(O),n.push(O)}function G(O){let L=n.indexOf(O);L!==-1&&n.splice(L,1)}function F(O,L){let P=O;n.forEach(function($){$[P]&&$[P](L)})}function k(O){return cl("10.7.0","highlightBlock will be removed entirely in v12.0"),cl("10.7.0","Please use highlightElement now."),x(O)}Object.assign(e,{highlight:p,highlightAuto:g,highlightAll:b,highlightElement:x,highlightBlock:k,configure:T,initHighlighting:E,initHighlightingOnLoad:w,registerLanguage:v,unregisterLanguage:R,listLanguages:_,getLanguage:I,registerAliases:A,autoDetection:D,inherit:xC,addPlugin:B,removePlugin:G}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=ND,e.regex={concat:aa,lookahead:_C,either:Zf,optional:VM,anyNumberOfTimes:qM};for(let O in Wd)typeof Wd[O]=="object"&&EC(Wd[O]);return Object.assign(e,Wd),e},ul=DC({});ul.newInstance=()=>DC({});LC.exports=ul;ul.HighlightJS=ul;ul.default=ul});var rR=_t((KK,nR)=>{"use strict";var lL="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";nR.exports=lL});var lR=_t((qK,aR)=>{"use strict";var cL=rR();function iR(){}function sR(){}sR.resetWarningCache=iR;aR.exports=function(){function e(n,r,a,i,s,l){if(l!==cL){var u=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 u.name="Invariant Violation",u}}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:sR,resetWarningCache:iR};return o.PropTypes=o,o}});var uR=_t((YK,cR)=>{cR.exports=lR()();var VK,zK});var gR=_t((XK,xm)=>{"use strict";var mR=hd(),uL=Rx(),dR=/\s/g;function vg(...e){let t=uL.apply(this,e),o=(n,r)=>dL(n?n.toString():"",t,r);return o.multiline=(n,r)=>mL(n?n.toString():"",t,r),o}var pR=(e,t,o)=>t.interpolation.toLowerCase()==="hsv"?e.hsv(o,t.hsvSpin.toLowerCase()):e.rgb(o);function dL(e,t,o){let n=fR(o),r=Math.max(e.replace(dR,"").length,t.stops.length),a=pR(t,n,r),i="";for(let s of e)i+=s.match(dR)?s:mR.hex(a.shift().toHex())(s);return i}function mL(e,t,o){let n=fR(o),r=e.split(`
5
5
  `),a=Math.max.apply(null,r.map(l=>l.length).concat([t.stops.length])),i=pR(t,n,a),s=[];for(let l of r){let u=i.slice(0),p="";for(let y of l)p+=mR.hex(u.shift().toHex())(y);s.push(p)}return s.join(`
@@ -117,7 +117,7 @@ Logging in with Google... Restarting Gemini CLI to continue.
117
117
  `),await un())}Yo("authenticated")},[i,n,Yo,$n,zs]),xy=(0,V.useCallback)(async W=>{try{if($n(null),!W.trim()&&W.length>1){$n("API key cannot be empty string with length greater than 1.");return}await YT(W),await ay(),await n.refreshAuth("gemini-api-key"),Yo("authenticated")}catch(Ee){$n(`Failed to save API key: ${Ee instanceof Error?Ee.message:String(Ee)}`)}},[Yo,$n,ay,n]),Sy=(0,V.useCallback)(()=>{Yo("updating")},[Yo]);(0,V.useEffect)(()=>{Hr==="authenticated"&&(fe(n.getUserTier()),xe(n.getUserPaidTier()))},[n,Hr]),(0,V.useEffect)(()=>{if(i.merged.security.auth.enforcedType&&i.merged.security.auth.selectedType&&i.merged.security.auth.enforcedType!==i.merged.security.auth.selectedType)$n(`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 W=Id(i.merged.security.auth.selectedType);W&&$n(W)}},[i.merged.security.auth.selectedType,i.merged.security.auth.enforcedType,i.merged.security.auth.useExternal,$n]);let{isModelDialogOpen:Jp,openModelDialog:Ey,closeModelDialog:Cy}=UA(),{toggleVimEnabled:RO}=nl(),Zp=(0,V.useRef)(()=>{}),[Wa,Ys]=(0,V.useState)(!1),{cleanUiDetailsVisible:Ru,setCleanUiDetailsVisible:_y,toggleCleanUiDetailsVisible:Ry,revealCleanUiDetailsTemporarily:wu}=TO(),wO=(0,V.useMemo)(()=>({openAuthDialog:()=>Yo("updating"),openThemeDialog:oy,openEditorDialog:oc,openPrivacyNotice:()=>N(!0),openSettingsDialog:ey,openSessionBrowser:_u,openModelDialog:Ey,openAgentConfigDialog:de,openPermissionsDialog:Fr,quit:W=>{A(W),setTimeout(async()=>{await Vr(),Yh.exit(0)},100)},setDebugMessage:_,toggleCorgiMode:()=>S(W=>!W),toggleDebugProfiler:Te,dispatchExtensionStateUpdate:tr,addConfirmUpdateExtensionRequest:Er,toggleBackgroundTasks:()=>{Y.current(),ee.current||(L(!0),X.current.size>1?Zp.current(!0):Zp.current(!1))},toggleShortcutsHelp:()=>Ys(W=>!W),setText:jh}),[Yo,oy,oc,ey,_u,Ey,de,A,_,N,S,tr,Fr,Er,Te,Ys,jh]),{handleSlashCommand:Ei,slashCommands:vu,pendingHistoryItems:Au,commandContext:wy,confirmationRequest:Xs}=WA(n,i,h.addItem,h.clearItems,h.loadHistory,Qt,RO,k,wO,Ks,Me,Po,z),[sc,vy]=(0,V.useState)(null),[Iu,Ay]=(0,V.useState)(null);(0,V.useEffect)(()=>{let W=Ee=>{vy({prompt:Ee.prompt,onConfirm:me=>{vy(null),Ee.onConfirm(me)}})};return Re.on("consent-request",W),()=>{Re.off("consent-request",W)}},[]);let vO=(0,V.useCallback)(async()=>{h.addItem({type:"info",text:"Refreshing hierarchical memory (GEMINI.md or other context files)..."},Date.now());try{let W,Ee;if(n.isJitContextEnabled())await n.getMemoryContextManager()?.refresh(),n.updateSystemInstructionIfInitialized(),W=If(n.getUserMemory()),Ee=n.getGeminiMdFileCount();else{let me=await ud(n);W=If(me.memoryContent),Ee=me.fileCount}h.addItem({type:"info",text:`Memory reloaded successfully. ${W.length>0?`Loaded ${W.length} characters from ${Ee} file(s)`:"No memory content found"}`},Date.now()),n.getDebugMode()&&_e.log(`[DEBUG] Refreshed memory content in config: ${W.substring(0,200)}...`)}catch(W){let Ee=Rr(W);h.addItem({type:"error",text:`Error refreshing memory: ${Ee}`},Date.now()),_e.warn("Error refreshing memory:",W)}},[n,h]),ef=(0,V.useRef)(()=>{}),AO=(0,V.useCallback)(W=>{W?U(!0):(U(!1),ef.current(!1))},[]);(0,V.useEffect)(()=>{if(ce){let W=h.history.findLast(me=>me.type==="user"),Ee=jt.at(-1);(!W||typeof W.text=="string"&&W.text===Ee)&&(ef.current(!0),U(!1))}},[ce,jt,h.history]);let Nu=(0,V.useRef)([]),[IO,Iy]=(0,V.useState)(0),tf=(0,V.useCallback)(()=>{if(Nu.current.length===0)return null;let W=Nu.current.join(`
118
118
  `);return Nu.current=[],Iy(0),W},[]);(0,V.useEffect)(()=>{let W=(Ee,me)=>{me!=="user_steering"&&me!=="background_completion"||(Nu.current.push(Ee),Iy(He=>He+1))};return n.injectionService.onInjection(W),()=>{n.injectionService.offInjection(W)}},[n]);let{streamingState:xo,submitQuery:$a,initError:of,pendingHistoryItems:Ou,thought:ac,cancelOngoingRequest:Ny,pendingToolCalls:NO,handleApprovalModeChange:Oy,activePtyId:Qi,loopDetectionConfirmationRequest:Mu,lastOutputTime:nf,backgroundTaskCount:rf,isBackgroundTaskVisible:Gr,toggleBackgroundTasks:Du,backgroundCurrentExecution:My,backgroundTasks:Wr,dismissBackgroundTask:Dy,retryStatus:OO}=oI(n.getGeminiClient(),h.history,h.addItem,n,i,_,Ei,Ae,xu,$n,vO,te,Ze,AO,L,yt,Tt,O,tf),Fo=(0,V.useMemo)(()=>[...Au,...Ou],[Au,Ou]);Y.current=Du,ee.current=Gr,X.current=Wr;let{activeBackgroundTaskPid:Ly,setIsBackgroundTaskListOpen:js,isBackgroundTaskListOpen:ky,setActiveBackgroundTaskPid:Py,backgroundTaskHeight:sf}=iO({backgroundTasks:Wr,backgroundTaskCount:rf,isBackgroundTaskVisible:Gr,activePtyId:Qi,embeddedShellFocused:O,setEmbeddedShellFocused:L,terminalHeight:Tt});Zp.current=js;let lc=(0,V.useRef)(0);(0,V.useEffect)(()=>{lc.current=nf},[nf]);let{shouldShowFocusHint:MO,inactivityStatus:By}=lI({activePtyId:Qi,lastOutputTime:nf,streamingState:xo,pendingToolCalls:NO,embeddedShellFocused:O,isInteractiveShellEnabled:n.isInteractiveShellEnabled()}),Fy=By==="action_required",Uy=By==="silent_working",DO=(0,V.useCallback)(W=>{Oy(W),Ru||wu(zh)},[Oy,Ru,wu]),{isMcpReady:cc}=XN(n),{messageQueue:Lu,addMessage:ku,clearQueue:Hy,getQueuedMessagesText:Gy,popAllMessages:Wy}=YN({isConfigInitialized:Me,streamingState:xo,submitQuery:$a,isMcpReady:cc});ef.current=(0,V.useCallback)((W=!0)=>{if(km(Fo))return;if(Lm(Fo)){Si.setText("");return}if(!W)return;let me=jt.at(-1)||"",He=Gy();He&&(me=me?`${me}
119
119
 
120
- ${He}`:He,Hy()),me&&Si.setText(me)},[Si,jt,Gy,Hy,Fo]);let $y=(0,V.useCallback)(W=>{let Ee=W.trim();Ee&&(n.injectionService.addInjection(Ee,"user_steering"),h.addItem({type:"hint",text:Ee}))},[n,h]),uc=(0,V.useCallback)(async W=>{s(),ht(null),Ao||(ko(!0),x||Qt());let Ee=ln(W.trim()),me=xo==="idle",He=xo==="responding"||Lm(Fo);if(Ee&&He){let{commandToExecute:Zi}=ja(W,vu??[]);if(Zi?.isSafeConcurrent){Ei(W),no(W);return}}if(n.isModelSteeringEnabled()&&He&&!Ee){$y(W),no(W);return}let Ut=Me&&cc;if(Ee&&Me||me&&Ut){if(!Ee){let Zi=await Xx(W,n);if(Zi.length>0){Ay({files:Zi,onComplete:tM=>{Ay(null),tM.allowed&&Zi.forEach(oM=>n.getWorkspaceContext().addReadOnlyPath(oM)),$a(W)}}),no(W);return}}$a(W)}else me&&!Ut&&Lu.length===0&&Re.emitFeedback("info",Me?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),ku(W);no(W)},[ku,no,$a,Ei,vu,cc,xo,Lu.length,Fo,n,Ao,ko,x,Qt,s,$y,Me,ht]),Ky=(0,V.useCallback)(()=>{s(),ht(null),h.clearItems(),ji(),Qt()},[h,ji,Qt,s,ht]),{handleInput:qy}=rI(Si,uc),af=!of&&!F&&!jp&&(xo==="idle"||xo==="responding"||xo==="waiting_for_confirmation")&&!rc,dc=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{dc.current?.disconnect()},[]);let[Pu,LO]=(0,V.useState)(0),[Vy,kO]=(0,V.useState)(0);(0,V.useLayoutEffect)(()=>{!H&&Pu>0&&kO(Pu)},[H,Pu]);let lf=H&&Vy>0?Vy:Pu,zy=(0,V.useCallback)(W=>{if(dc.current&&(dc.current.disconnect(),dc.current=null),W){let Ee=new cn(me=>{let He=me[0];if(He){let Ut=Math.round(He.contentRect.height);LO(Zi=>Ut!==Zi?Ut:Zi)}});Ee.observe(W),dc.current=Ee}},[]),cf=Math.max(0,Tt-lf-sf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(yt*o1),terminalHeight:Math.max(Math.floor(cf-n1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Bu,hasReceivedFocusEvent:PO}=yS(),Yy=(0,V.useMemo)(()=>{let W=i.merged.context.fileName;return W?Array.isArray(W)?W:[W]:eT()},[i.merged.context.fileName]),uf=(0,V.useMemo)(()=>n.getQuestion(),[n]),Xy=(0,V.useRef)(!1),jy=n.getGeminiClient();(0,V.useEffect)(()=>{uf&&Me&&!Xy.current&&!Ga&&!ic&&!nc&&!tc&&!D&&jy?.isInitialized?.()&&(uc(uf),Xy.current=!0)},[uf,Me,uc,Ga,ic,nc,tc,D,jy]);let[BO,FO]=(0,V.useState)(!1),[df,UO]=(0,V.useState)(null);(0,V.useEffect)(()=>{(async()=>{let me=(await rs.getInstance()).getCurrentIde();UO(me||null)})()},[]);let Fu=!!(df&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!BO),[Uu,mc]=(0,V.useState)(!1),[Qy,HO]=(0,V.useState)(!1),[Jy,GO]=(0,V.useState)(!0),Zy=(0,V.useCallback)(W=>{W>2&&lT(n),W>1&&Ei("/quit",void 0,void 0,!1)},[n,Ei]),{pressCount:eb,handlePress:tb}=Pl({windowMs:_i,onRepeat:Zy}),{pressCount:ob,handlePress:nb}=Pl({windowMs:_i,onRepeat:Zy}),[Hu,rb]=(0,V.useState)(),[ib,WO]=(0,V.useState)(!1),[mf,$O]=(0,V.useState)(!1),[sb,Ci]=Kp(_i),{isFolderTrustDialogOpen:pf,discoveryResults:ab,handleFolderTrustSelect:lb,isRestarting:cb}=cI(i,ie,h.addItem),ff=n.getPolicyUpdateConfirmationRequest(),[gf,ub]=(0,V.useState)(!!ff),{needsRestart:db,restartReason:mb}=BS(),pb=(0,V.useRef)(!0);tO(n,Z,h,z);let Ji=(0,V.useRef)(null);(0,V.useEffect)(()=>{let W=He=>{Ci({text:He.message,type:He.type})},Ee=()=>{Ci({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},me=()=>{Ci({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return It.on("transient-message",W),It.on("selection-warning",Ee),It.on("paste-timeout",me),()=>{It.off("transient-message",W),It.off("selection-warning",Ee),It.off("paste-timeout",me),Ji.current&&clearTimeout(Ji.current)}},[Ci]);let hf=(0,V.useCallback)(W=>{Ci({text:W,type:"warning"})},[Ci]),{handleSuspend:fb}=cO({handleWarning:hf,setRawMode:Rn,refreshStatic:Qt,setForceRerenderKey:v,shouldUseAlternateScreen:Vp});(0,V.useEffect)(()=>{db&&$O(!0)},[db]),(0,V.useEffect)(()=>{if(pb.current){pb.current=!1;return}let W=setTimeout(()=>{Qt()},300);return()=>{clearTimeout(W)}},[yt,Qt]),(0,V.useEffect)(()=>{let W=vf.subscribe(rb);return rb(vf.get()),W},[]),(0,V.useEffect)(()=>{let W=()=>{mc(!0),ko(!1)};return It.on("open-debug-console",W),()=>{It.off("open-debug-console",W)}},[n]);let gb=(0,V.useCallback)(W=>{WO(W)},[]),hb=(0,V.useCallback)(W=>{W.userSelection==="yes"?(Ei("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):W.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),FO(!0)},[Ei,i]),KO=(0,V.useCallback)(W=>{if(i.merged.general.debugKeystrokeLogging&&_e.log("[DEBUG] Keystroke:",JSON.stringify(W)),Wa&&t(W)&&Ys(!1),o["app.toggleMouseMode"](W))return E(He=>!He),T&&!x&&It.emit("scroll-to-bottom"),!0;if(x&&o["app.toggleCopyMode"](W))return J(!0),os(),!0;if(o["basic.quit"](W))return Ny?.(),tb(),!0;if(o["basic.exit"](W))return qp.current.text.length>0?!1:(nb(),!0);if(o["app.suspend"](W))fb();else if(o["app.dumpFrame"](W)){let Ut=`snapshot-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return p&&(p(Ut),_e.log(`Dumped frame to: ${Ut}`)),!0}else if(o["app.startRecording"](W)){let Ut=`recording-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return y&&(y(Ut),g.current=Ut,_e.log(`Started recording to: ${Ut}`)),!0}else{if(o["app.stopRecording"](W))return f&&(f(),_e.log(`Stopped recording, saved to: ${g.current??"unknown"}`),g.current=null),!0;if(o["app.toggleCopyMode"](W)&&!x)return Ci({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0}let Ee=()=>{ht(!0);let He=ZR(h.history,Fo);He.length>0&&Xe(He)},me=!1;if(Ao||(me=!0,ko(!0),o["app.showMoreLines"](W)&&Ee(),x||Qt()),o["app.showErrorDetails"](W))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:He}=await import("./devtoolsService-CLP7VYOP.js");await He(n,Uu,()=>mc(Ut=>!Ut),()=>mc(!0))})():mc(He=>!He),!0;if(o["app.showFullTodos"](W))return HO(He=>!He),!0;if(o["app.toggleMarkdown"](W))return GO(He=>{let Ut=!He;return Qt(),Ut}),!0;if(o["app.showIdeContextDetail"](W)&&n.getIdeMode()&&Hu)return Ei("/ide status"),!0;if(o["app.showMoreLines"](W)&&!me)return ko(!1),Ee(),Qt(),!0;if((o["app.focusShellInput"](W)||o["background.unfocusList"](W))&&(Qi||Gr&&Wr.size>0)){if(O){let Ut=lc.current;return Ji.current&&clearTimeout(Ji.current),Ji.current=setTimeout(()=>{lc.current===Ut?L(!1):Ci({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-lc.current>=100&&!Qi&&!Gr?(Ji.current&&clearTimeout(Ji.current),Du(),L(!0),Wr.size>1&&js(!0),!0):(L(!0),!0)}else{if(o["app.unfocusShellInput"](W)||o["background.unfocus"](W))return O?(L(!1),!0):!1;if(o["background.toggle"](W))return Qi?My():(Du(),!Gr&&Wr.size>0?(L(!0),Wr.size>1&&js(!0)):L(!1)),!0;if(o["background.toggleList"](W))return Wr.size>0&&Gr&&(O||L(!0),js(!0)),!0}return!1},[Ao,ko,mc,n,Hu,tb,nb,Ei,Ny,Qi,fb,O,i.merged.general.debugKeystrokeLogging,Qt,J,Ji,x,Wa,My,Du,Wr,Gr,js,lc,Ci,i.merged.general.devtools,Uu,ht,o,t,h.history,Fo,Xe,p,y,f,T]);ye(KO,{isActive:!0,priority:!0}),ye(W=>o["scroll.up"](W)||o["scroll.down"](W)||o["scroll.pageUp"](W)||o["scroll.pageDown"](W)||o["scroll.home"](W)||o["scroll.end"](W)?!1:(J(!1),T&&ts(),!0),{isActive:H,priority:200}),(0,V.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let W=Ep({streamingState:xo,thoughtSubject:ac?.subject,isConfirming:!!Xs||Fy,isSilentWorking:Uy,folderName:t1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});ir.current!==W&&(ir.current=W,mt.write(`\x1B]0;${W}\x07`))},[xo,ac,Xs,Fy,Uy,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,mt]),(0,V.useEffect)(()=>{let W=me=>{let He;switch(me.severity){case"error":He="error";break;case"warning":He="warning";break;case"info":He="info";break;default:throw new Error(`Unexpected severity for user feedback: ${me.severity}`)}h.addItem({type:He,text:me.message},Date.now()),me.error&&_e.warn(`[Feedback Details for "${me.message}"]`,me.error)},Ee=me=>{h.addItem({type:"info",text:me.message,source:me.hookName},Date.now())};return Re.on("user-feedback",W),Re.on("hook-system-message",Ee),Re.drainBacklogs(),()=>{Re.off("user-feedback",W),Re.off("hook-system-message",Ee)}},[h]);let yb=e.version.includes("nightly"),bb=Fu||Fu||pf||gf||ne||!!Xs||!!sc||!!Iu||!!K||Pr.length>0||!!Mu||nc||Yp||Jp||Ti||Vi||Ga||ic||tc||D||mf||!!rc||!!Su||!!Eu||!!Cu||Qp||Hr==="awaiting_api_key_input"||!!pe,qO=(0,V.useMemo)(()=>km(Fo),[Fo]),Tb=Pr.length>0,xb=!!Mu,pc=qO||!!Xs||!!sc||Tb||xb||!!rc||!!Su||!!Eu||!!Cu||!!K,Gu=i.merged.ui.loadingPhrases,VO=Gu==="tips"||Gu==="all",zO=Gu==="witty"||Gu==="all",YO=(!O||Gr)&&xo==="responding"&&!pc,Wu=0;if(oo.length>0&&i.merged.hooksConfig.notifications){let W=oo.length>1?"Executing Hooks":"Executing Hook",Ee=oo.map(me=>me.name+(me.index&&me.total&&me.total>1?` (${me.index}/${me.total})`:"")).join(", ");Wu=W.length+Ee.length+10}else YO?Wu=(ac?.subject||"Waiting for model...").length+25:pc&&(Wu=35);let XO=yt-Wu-5,{elapsedTime:Sb,currentLoadingPhrase:Eb,currentTip:Cb,currentWittyPhrase:_b}=sI({streamingState:xo,shouldShowFocusHint:MO,retryStatus:OO,showTips:VO,showWit:zO,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:XO}),yf=n.isPlanEnabled()&&xo==="idle"&&!pc,Rb=jN({config:n,addItem:h.addItem,onApprovalModeChange:DO,isActive:!O,allowPlanMode:yf});yO({notificationsEnabled:l,isFocused:Bu,hasReceivedFocusEvent:PO,streamingState:xo,hasPendingActionRequired:pc,pendingHistoryItems:Fo,commandConfirmationRequest:Xs,authConsentRequest:sc,permissionConfirmationRequest:Iu,hasConfirmUpdateExtensionRequests:Tb,hasLoopDetectionConfirmationRequest:xb});let wb=af&&xo==="idle"&&!pc;(0,V.useEffect)(()=>{Wa&&!wb&&Ys(!1)},[Wa,wb,Ys]),(0,V.useEffect)(()=>{if(!Me||!n.isModelSteeringEnabled()||xo!=="idle"||!cc||km(Fo))return;let W=tf();W&&$a([{text:md(W)}])},[n,h,Me,cc,xo,$a,tf,Fo,IO]);let jO=(0,V.useMemo)(()=>Pm(Fo),[Fo]),[vb,QO]=(0,V.useState)(n.getGeminiMdFileCount());(0,V.useEffect)(()=>{let W=Ee=>{QO(Ee.fileCount)};return Re.on("memory-changed",W),()=>{Re.off("memory-changed",W)}},[]),(0,V.useEffect)(()=>{let W=!0;return(async()=>{let[me,He]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);W&&(qi(me),er(He),Po(!0))})(),()=>{W=!1}},[n,Qt]);let JO=(0,V.useMemo)(()=>({buffer:Si,userMessages:jt,shellModeActive:Ae,showEscapePrompt:ib,copyModeEnabled:H,inputWidth:Ha,suggestionsWidth:ec}),[Si,jt,Ae,ib,H,Ha,ec]),ZO=(0,V.useMemo)(()=>({history:h.history,historyManager:h,isThemeDialogOpen:nc,themeError:B,isAuthenticating:Ga,isConfigInitialized:Me,authError:iy,accountSuspensionInfo:ly,isAuthDialogOpen:ic,isAwaitingApiKeyInput:Hr==="awaiting_api_key_input",apiKeyDefaultValue:sy,editorError:Qh,isEditorDialogOpen:tc,showPrivacyNotice:D,mouseMode:T,corgiMode:w,debugMessage:R,quittingMessages:I,isSettingsDialogOpen:Yp,isSessionBrowserOpen:Qp,isModelDialogOpen:Jp,isAgentConfigDialogOpen:Ti,selectedAgentName:xi,selectedAgentDisplayName:Vs,selectedAgentDefinition:ue,isPermissionsDialogOpen:Vi,permissionsDialogProps:Yi,slashCommands:vu,pendingSlashCommandHistoryItems:Au,commandContext:wy,commandConfirmationRequest:Xs,authConsentRequest:sc,confirmUpdateExtensionRequests:Pr,loopDetectionConfirmationRequest:Mu,permissionConfirmationRequest:Iu,geminiMdFileCount:vb,streamingState:xo,initError:of,pendingGeminiHistoryItems:Ou,thought:ac,isInputActive:af,isResuming:jp,shouldShowIdePrompt:Fu,isFolderTrustDialogOpen:pf??!1,folderDiscoveryResults:ab,isPolicyUpdateDialogOpen:gf,policyUpdateConfirmationRequest:ff,isTrustedFolder:Z,constrainHeight:Ao,showErrorDetails:Uu,showFullTodos:Qy,ideContextState:Hu,renderMarkdown:Jy,ctrlCPressedOnce:eb>=1,ctrlDPressedOnce:ob>=1,shortcutsHelpVisible:Wa,cleanUiDetailsVisible:Ru,isFocused:Bu,elapsedTime:Sb,currentLoadingPhrase:Eb,currentTip:Cb,currentWittyPhrase:_b,historyRemountKey:$e,activeHooks:oo,messageQueue:Lu,queueErrorMessage:he,showApprovalModeIndicator:Rb,allowPlanMode:yf,currentModel:Se,quota:{userTier:q,stats:Oe,proQuotaRequest:rc,validationRequest:Su,overageMenuRequest:Eu,emptyWalletRequest:Cu},contextFileNames:Yy,errorCount:Xi,availableTerminalHeight:cf,stableControlsHeight:lf,mainAreaWidth:_r,staticAreaMaxItemHeight:Xh,staticExtraHeight:sr,dialogsVisible:bb,pendingHistoryItems:Fo,nightly:yb,branchName:nr,sessionStats:Cr,terminalWidth:yt,terminalHeight:Tt,mainControlsRef:zy,rootUiRef:rr,currentIDE:df,updateInfo:Ft,showIdeRestartPrompt:mf,ideTrustRestartReason:mb,isRestarting:cb,extensionsUpdateState:$s,activePtyId:Qi,backgroundTaskCount:rf,isBackgroundTaskVisible:Gr,embeddedShellFocused:O,showDebugProfiler:P,customDialog:K,transientMessage:sb,bannerData:Cn,bannerVisible:sn,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:bo,backgroundTasks:Wr,activeBackgroundTaskPid:Ly,backgroundTaskHeight:sf,isBackgroundTaskListOpen:ky,adminSettingsChanged:ne,newAgents:pe,showIsExpandableHint:Ki,hintMode:n.isModelSteeringEnabled()&&Lm(Fo),hintBuffer:""}),[nc,B,Ga,Me,iy,ly,ic,Qh,tc,D,T,w,R,I,Yp,Qp,Jp,Ti,xi,Vs,ue,Vi,Yi,vu,Au,wy,Xs,sc,Pr,Mu,Iu,vb,xo,of,Ou,ac,af,jp,Fu,pf,ab,gf,ff,Z,Ao,Uu,Qy,Hu,Jy,eb,ob,Wa,Ru,Bu,Sb,Eb,Cb,_b,$e,oo,Lu,he,Rb,yf,q,Oe,rc,Su,Eu,Cu,Yy,Xi,cf,lf,_r,Xh,sr,bb,Fo,yb,nr,Cr,yt,Tt,zy,rr,df,Ft,mf,mb,cb,Se,$s,Qi,rf,Gr,h,O,P,K,sy,Hr,sb,Cn,sn,n,bo,sf,ky,Ly,Wr,ne,pe,Ki]),Ab=(0,V.useCallback)(()=>N(!1),[N]),eM=(0,V.useMemo)(()=>({handleThemeSelect:Xp,closeThemeDialog:ny,handleThemeHighlight:ry,handleAuthSelect:Ty,setAuthState:Yo,onAuthError:$n,handleEditorSelect:Jh,exitEditorDialog:Zh,exitPrivacyNotice:Ab,closeSettingsDialog:ty,closeModelDialog:Cy,openAgentConfigDialog:de,closeAgentConfigDialog:Ie,openPermissionsDialog:Fr,closePermissionsDialog:or,setShellModeActive:nt,vimHandleInput:qy,handleIdePromptComplete:hb,handleFolderTrustSelect:lb,setIsPolicyUpdateDialogOpen:ub,setConstrainHeight:ko,onEscapePromptChange:gb,refreshStatic:Qt,handleFinalSubmit:uc,handleClearScreen:Ky,handleProQuotaChoice:dy,handleValidationChoice:my,handleOverageMenuChoice:py,handleEmptyWalletChoice:fy,openSessionBrowser:_u,closeSessionBrowser:gy,handleResumeSession:hy,handleDeleteSession:by,setQueueErrorMessage:ke,addMessage:ku,popAllMessages:Wy,handleApiKeySubmit:xy,handleApiKeyCancel:Sy,setBannerVisible:Po,setShortcutsHelpVisible:Ys,setCleanUiDetailsVisible:_y,toggleCleanUiDetailsVisible:Ry,revealCleanUiDetailsTemporarily:wu,handleWarning:hf,setEmbeddedShellFocused:L,dismissBackgroundTask:Dy,setActiveBackgroundTaskPid:Py,setIsBackgroundTaskListOpen:js,setAuthContext:zs,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(Yh.send){let W=n.getRemoteAdminSettings();W&&Yh.send({type:"admin-settings-update",settings:W})}await un()},handleNewAgentsSelect:async W=>{if(pe&&W==="acknowledge"){let Ee=n.getAgentRegistry();try{await Promise.all(pe.map(me=>Ee.acknowledgeAgent(me)))}catch(me){_e.error("Failed to acknowledge agents:",me),h.addItem({type:"error",text:`Failed to acknowledge agents: ${Rr(me)}`},Date.now())}}ft(null)},getPreferredEditor:xu,clearAccountSuspension:()=>{cy(null),Yo("updating")}}),[Xp,ny,ry,Ty,Yo,$n,Jh,Zh,Ab,ty,Cy,de,Ie,Fr,or,nt,qy,hb,lb,ub,ko,gb,Qt,uc,Ky,dy,my,py,fy,_u,gy,hy,by,ke,ku,Wy,xy,Sy,Po,Ys,_y,Ry,wu,hf,L,Dy,Py,js,zs,cy,pe,n,h,xu]);return Hr==="awaiting_google_login_restart"?(0,Sr.jsx)(sO,{onDismiss:()=>{zs({}),Yo("updating")},config:n}):(0,Sr.jsx)(Ed.Provider,{value:ZO,children:(0,Sr.jsx)(VS.Provider,{value:JO,children:(0,Sr.jsx)(Cg.Provider,{value:eM,children:(0,Sr.jsx)(tl.Provider,{value:n,children:(0,Sr.jsx)(Ng.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Sr.jsx)(W_,{config:n,toolCalls:jO,isExpanded:Ne,toggleExpansion:ge,toggleAllExpansion:Xe,children:(0,Sr.jsx)(oh.Provider,{value:Bu,children:(0,Sr.jsx)(Qd,{mouseEventsEnabled:T,children:(0,Sr.jsx)(Jd,{children:(0,Sr.jsx)(_A,{},`app-${b}`)})})})})})})})})})};var Hn=C(M(),1);var i1=200;async function oae(e,t,o,n=process.cwd(),r,a){mv();let i=nd(e.getUseAlternateBuffer(),e.getScreenReader()),s=i;s&&(ts(),ls(()=>{os()}));let{matchers:l,errors:u}=await SS();u.forEach(E=>{Re.emitFeedback("warning",E)});let p=await qT();s1(r1(n),t);let y=new Vx({onNewMessage:E=>{Re.emitConsoleLog(E.type,E.content)},debugMode:e.getDebugMode()});y.patch(),ls(y.cleanup);let{stdout:f,stderr:g}=hT(),h=!!process.env.SHPOOL_SESSION_NAME,x=()=>(ip(),(0,Hn.jsx)(bS.Provider,{value:t,children:(0,Hn.jsx)(ES,{value:l,children:(0,Hn.jsx)(TS,{config:e,children:(0,Hn.jsx)(Qd,{mouseEventsEnabled:s,children:(0,Hn.jsx)(AA,{children:(0,Hn.jsx)(Jd,{children:(0,Hn.jsx)(dl,{children:(0,Hn.jsx)(TR,{children:(0,Hn.jsx)(qS,{children:(0,Hn.jsx)(xO,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:a})})})})})})})})})}));h&&await new Promise(E=>setTimeout(E,100));let T=lS(process.env.DEBUG?(0,Hn.jsx)(SO.default.StrictMode,{children:(0,Hn.jsx)(x,{})}):(0,Hn.jsx)(x,{}),{stdout:f,stderr:g,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:E})=>{E>i1&&cT(e,E),KS.reportFrameRendered()},standardReactLayoutTiming:i||e.getUseTerminalBuffer(),patchConsole:!1,alternateBuffer:i,terminalBuffer:e.getUseTerminalBuffer(),renderProcess:e.getUseRenderProcess()&&e.getUseTerminalBuffer(),incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(qa(),ls(()=>{td()})),zN(t).then(E=>{eE(E,t,e.getProjectRoot())}).catch(E=>{e.getDebugMode()&&_e.warn("Update check failed:",E)}),ls(()=>T.unmount()),ls(Hx())}function s1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Ep({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{oae as startInteractiveUI};
120
+ ${He}`:He,Hy()),me&&Si.setText(me)},[Si,jt,Gy,Hy,Fo]);let $y=(0,V.useCallback)(W=>{let Ee=W.trim();Ee&&(n.injectionService.addInjection(Ee,"user_steering"),h.addItem({type:"hint",text:Ee}))},[n,h]),uc=(0,V.useCallback)(async W=>{s(),ht(null),Ao||(ko(!0),x||Qt());let Ee=ln(W.trim()),me=xo==="idle",He=xo==="responding"||Lm(Fo);if(Ee&&He){let{commandToExecute:Zi}=ja(W,vu??[]);if(Zi?.isSafeConcurrent){Ei(W),no(W);return}}if(n.isModelSteeringEnabled()&&He&&!Ee){$y(W),no(W);return}let Ut=Me&&cc;if(Ee&&Me||me&&Ut){if(!Ee){let Zi=await Xx(W,n);if(Zi.length>0){Ay({files:Zi,onComplete:tM=>{Ay(null),tM.allowed&&Zi.forEach(oM=>n.getWorkspaceContext().addReadOnlyPath(oM)),$a(W)}}),no(W);return}}$a(W)}else me&&!Ut&&Lu.length===0&&Re.emitFeedback("info",Me?"Waiting for MCP servers to initialize... Slash commands are still available and prompts will be queued.":"Initializing... Prompts will be queued."),ku(W);no(W)},[ku,no,$a,Ei,vu,cc,xo,Lu.length,Fo,n,Ao,ko,x,Qt,s,$y,Me,ht]),Ky=(0,V.useCallback)(()=>{s(),ht(null),h.clearItems(),ji(),Qt()},[h,ji,Qt,s,ht]),{handleInput:qy}=rI(Si,uc),af=!of&&!F&&!jp&&(xo==="idle"||xo==="responding"||xo==="waiting_for_confirmation")&&!rc,dc=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{dc.current?.disconnect()},[]);let[Pu,LO]=(0,V.useState)(0),[Vy,kO]=(0,V.useState)(0);(0,V.useLayoutEffect)(()=>{!H&&Pu>0&&kO(Pu)},[H,Pu]);let lf=H&&Vy>0?Vy:Pu,zy=(0,V.useCallback)(W=>{if(dc.current&&(dc.current.disconnect(),dc.current=null),W){let Ee=new cn(me=>{let He=me[0];if(He){let Ut=Math.round(He.contentRect.height);LO(Zi=>Ut!==Zi?Ut:Zi)}});Ee.observe(W),dc.current=Ee}},[]),cf=Math.max(0,Tt-lf-sf-1);n.setShellExecutionConfig({terminalWidth:Math.floor(yt*o1),terminalHeight:Math.max(Math.floor(cf-n1),1),pager:i.merged.tools.shell.pager,showColor:i.merged.tools.shell.showColor,sanitizationConfig:n.sanitizationConfig,sandboxManager:n.sandboxManager});let{isFocused:Bu,hasReceivedFocusEvent:PO}=yS(),Yy=(0,V.useMemo)(()=>{let W=i.merged.context.fileName;return W?Array.isArray(W)?W:[W]:eT()},[i.merged.context.fileName]),uf=(0,V.useMemo)(()=>n.getQuestion(),[n]),Xy=(0,V.useRef)(!1),jy=n.getGeminiClient();(0,V.useEffect)(()=>{uf&&Me&&!Xy.current&&!Ga&&!ic&&!nc&&!tc&&!D&&jy?.isInitialized?.()&&(uc(uf),Xy.current=!0)},[uf,Me,uc,Ga,ic,nc,tc,D,jy]);let[BO,FO]=(0,V.useState)(!1),[df,UO]=(0,V.useState)(null);(0,V.useEffect)(()=>{(async()=>{let me=(await rs.getInstance()).getCurrentIde();UO(me||null)})()},[]);let Fu=!!(df&&!n.getIdeMode()&&!i.merged.ide.hasSeenNudge&&!BO),[Uu,mc]=(0,V.useState)(!1),[Qy,HO]=(0,V.useState)(!1),[Jy,GO]=(0,V.useState)(!0),Zy=(0,V.useCallback)(W=>{W>2&&lT(n),W>1&&Ei("/quit",void 0,void 0,!1)},[n,Ei]),{pressCount:eb,handlePress:tb}=Pl({windowMs:_i,onRepeat:Zy}),{pressCount:ob,handlePress:nb}=Pl({windowMs:_i,onRepeat:Zy}),[Hu,rb]=(0,V.useState)(),[ib,WO]=(0,V.useState)(!1),[mf,$O]=(0,V.useState)(!1),[sb,Ci]=Kp(_i),{isFolderTrustDialogOpen:pf,discoveryResults:ab,handleFolderTrustSelect:lb,isRestarting:cb}=cI(i,ie,h.addItem),ff=n.getPolicyUpdateConfirmationRequest(),[gf,ub]=(0,V.useState)(!!ff),{needsRestart:db,restartReason:mb}=BS(),pb=(0,V.useRef)(!0);tO(n,Z,h,z);let Ji=(0,V.useRef)(null);(0,V.useEffect)(()=>{let W=He=>{Ci({text:He.message,type:He.type})},Ee=()=>{Ci({text:"Press Ctrl-S to enter selection mode to copy text.",type:"warning"})},me=()=>{Ci({text:"Paste Timed out. Possibly due to slow connection.",type:"warning"})};return It.on("transient-message",W),It.on("selection-warning",Ee),It.on("paste-timeout",me),()=>{It.off("transient-message",W),It.off("selection-warning",Ee),It.off("paste-timeout",me),Ji.current&&clearTimeout(Ji.current)}},[Ci]);let hf=(0,V.useCallback)(W=>{Ci({text:W,type:"warning"})},[Ci]),{handleSuspend:fb}=cO({handleWarning:hf,setRawMode:Rn,refreshStatic:Qt,setForceRerenderKey:v,shouldUseAlternateScreen:Vp});(0,V.useEffect)(()=>{db&&$O(!0)},[db]),(0,V.useEffect)(()=>{if(pb.current){pb.current=!1;return}let W=setTimeout(()=>{Qt()},300);return()=>{clearTimeout(W)}},[yt,Qt]),(0,V.useEffect)(()=>{let W=vf.subscribe(rb);return rb(vf.get()),W},[]),(0,V.useEffect)(()=>{let W=()=>{mc(!0),ko(!1)};return It.on("open-debug-console",W),()=>{It.off("open-debug-console",W)}},[n]);let gb=(0,V.useCallback)(W=>{WO(W)},[]),hb=(0,V.useCallback)(W=>{W.userSelection==="yes"?(Ei("/ide install"),i.setValue("User","ide.hasSeenNudge",!0)):W.userSelection==="dismiss"&&i.setValue("User","ide.hasSeenNudge",!0),FO(!0)},[Ei,i]),KO=(0,V.useCallback)(W=>{if(i.merged.general.debugKeystrokeLogging&&_e.log("[DEBUG] Keystroke:",JSON.stringify(W)),Wa&&t(W)&&Ys(!1),o["app.toggleMouseMode"](W))return E(He=>!He),T&&!x&&It.emit("scroll-to-bottom"),!0;if(x&&o["app.toggleCopyMode"](W))return J(!0),os(),!0;if(o["basic.quit"](W))return Ny?.(),tb(),!0;if(o["basic.exit"](W))return qp.current.text.length>0?!1:(nb(),!0);if(o["app.suspend"](W))fb();else if(o["app.dumpFrame"](W)){let Ut=`snapshot-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return p&&(p(Ut),_e.log(`Dumped frame to: ${Ut}`)),!0}else if(o["app.startRecording"](W)){let Ut=`recording-${new Date().toISOString().replace(/[:.]/g,"-")}.json`;return y&&(y(Ut),g.current=Ut,_e.log(`Started recording to: ${Ut}`)),!0}else{if(o["app.stopRecording"](W))return f&&(f(),_e.log(`Stopped recording, saved to: ${g.current??"unknown"}`),g.current=null),!0;if(o["app.toggleCopyMode"](W)&&!x)return Ci({text:"Use Ctrl+O to expand and collapse blocks of content.",type:"warning"}),!0}let Ee=()=>{ht(!0);let He=ZR(h.history,Fo);He.length>0&&Xe(He)},me=!1;if(Ao||(me=!0,ko(!0),o["app.showMoreLines"](W)&&Ee(),x||Qt()),o["app.showErrorDetails"](W))return i.merged.general.devtools?(async()=>{let{toggleDevToolsPanel:He}=await import("./devtoolsService-RUL4FIJA.js");await He(n,Uu,()=>mc(Ut=>!Ut),()=>mc(!0))})():mc(He=>!He),!0;if(o["app.showFullTodos"](W))return HO(He=>!He),!0;if(o["app.toggleMarkdown"](W))return GO(He=>{let Ut=!He;return Qt(),Ut}),!0;if(o["app.showIdeContextDetail"](W)&&n.getIdeMode()&&Hu)return Ei("/ide status"),!0;if(o["app.showMoreLines"](W)&&!me)return ko(!1),Ee(),Qt(),!0;if((o["app.focusShellInput"](W)||o["background.unfocusList"](W))&&(Qi||Gr&&Wr.size>0)){if(O){let Ut=lc.current;return Ji.current&&clearTimeout(Ji.current),Ji.current=setTimeout(()=>{lc.current===Ut?L(!1):Ci({text:"Use Shift+Tab to unfocus",type:"warning"})},150),!1}return Date.now()-lc.current>=100&&!Qi&&!Gr?(Ji.current&&clearTimeout(Ji.current),Du(),L(!0),Wr.size>1&&js(!0),!0):(L(!0),!0)}else{if(o["app.unfocusShellInput"](W)||o["background.unfocus"](W))return O?(L(!1),!0):!1;if(o["background.toggle"](W))return Qi?My():(Du(),!Gr&&Wr.size>0?(L(!0),Wr.size>1&&js(!0)):L(!1)),!0;if(o["background.toggleList"](W))return Wr.size>0&&Gr&&(O||L(!0),js(!0)),!0}return!1},[Ao,ko,mc,n,Hu,tb,nb,Ei,Ny,Qi,fb,O,i.merged.general.debugKeystrokeLogging,Qt,J,Ji,x,Wa,My,Du,Wr,Gr,js,lc,Ci,i.merged.general.devtools,Uu,ht,o,t,h.history,Fo,Xe,p,y,f,T]);ye(KO,{isActive:!0,priority:!0}),ye(W=>o["scroll.up"](W)||o["scroll.down"](W)||o["scroll.pageUp"](W)||o["scroll.pageDown"](W)||o["scroll.home"](W)||o["scroll.end"](W)?!1:(J(!1),T&&ts(),!0),{isActive:H,priority:200}),(0,V.useEffect)(()=>{if(i.merged.ui.hideWindowTitle)return;let W=Ep({streamingState:xo,thoughtSubject:ac?.subject,isConfirming:!!Xs||Fy,isSilentWorking:Uy,folderName:t1(n.getTargetDir()),showThoughts:!!i.merged.ui.showStatusInTitle,useDynamicTitle:i.merged.ui.dynamicWindowTitle});ir.current!==W&&(ir.current=W,mt.write(`\x1B]0;${W}\x07`))},[xo,ac,Xs,Fy,Uy,i.merged.ui.showStatusInTitle,i.merged.ui.dynamicWindowTitle,i.merged.ui.hideWindowTitle,n,mt]),(0,V.useEffect)(()=>{let W=me=>{let He;switch(me.severity){case"error":He="error";break;case"warning":He="warning";break;case"info":He="info";break;default:throw new Error(`Unexpected severity for user feedback: ${me.severity}`)}h.addItem({type:He,text:me.message},Date.now()),me.error&&_e.warn(`[Feedback Details for "${me.message}"]`,me.error)},Ee=me=>{h.addItem({type:"info",text:me.message,source:me.hookName},Date.now())};return Re.on("user-feedback",W),Re.on("hook-system-message",Ee),Re.drainBacklogs(),()=>{Re.off("user-feedback",W),Re.off("hook-system-message",Ee)}},[h]);let yb=e.version.includes("nightly"),bb=Fu||Fu||pf||gf||ne||!!Xs||!!sc||!!Iu||!!K||Pr.length>0||!!Mu||nc||Yp||Jp||Ti||Vi||Ga||ic||tc||D||mf||!!rc||!!Su||!!Eu||!!Cu||Qp||Hr==="awaiting_api_key_input"||!!pe,qO=(0,V.useMemo)(()=>km(Fo),[Fo]),Tb=Pr.length>0,xb=!!Mu,pc=qO||!!Xs||!!sc||Tb||xb||!!rc||!!Su||!!Eu||!!Cu||!!K,Gu=i.merged.ui.loadingPhrases,VO=Gu==="tips"||Gu==="all",zO=Gu==="witty"||Gu==="all",YO=(!O||Gr)&&xo==="responding"&&!pc,Wu=0;if(oo.length>0&&i.merged.hooksConfig.notifications){let W=oo.length>1?"Executing Hooks":"Executing Hook",Ee=oo.map(me=>me.name+(me.index&&me.total&&me.total>1?` (${me.index}/${me.total})`:"")).join(", ");Wu=W.length+Ee.length+10}else YO?Wu=(ac?.subject||"Waiting for model...").length+25:pc&&(Wu=35);let XO=yt-Wu-5,{elapsedTime:Sb,currentLoadingPhrase:Eb,currentTip:Cb,currentWittyPhrase:_b}=sI({streamingState:xo,shouldShowFocusHint:MO,retryStatus:OO,showTips:VO,showWit:zO,customWittyPhrases:i.merged.ui.customWittyPhrases,errorVerbosity:i.merged.ui.errorVerbosity,maxLength:XO}),yf=n.isPlanEnabled()&&xo==="idle"&&!pc,Rb=jN({config:n,addItem:h.addItem,onApprovalModeChange:DO,isActive:!O,allowPlanMode:yf});yO({notificationsEnabled:l,isFocused:Bu,hasReceivedFocusEvent:PO,streamingState:xo,hasPendingActionRequired:pc,pendingHistoryItems:Fo,commandConfirmationRequest:Xs,authConsentRequest:sc,permissionConfirmationRequest:Iu,hasConfirmUpdateExtensionRequests:Tb,hasLoopDetectionConfirmationRequest:xb});let wb=af&&xo==="idle"&&!pc;(0,V.useEffect)(()=>{Wa&&!wb&&Ys(!1)},[Wa,wb,Ys]),(0,V.useEffect)(()=>{if(!Me||!n.isModelSteeringEnabled()||xo!=="idle"||!cc||km(Fo))return;let W=tf();W&&$a([{text:md(W)}])},[n,h,Me,cc,xo,$a,tf,Fo,IO]);let jO=(0,V.useMemo)(()=>Pm(Fo),[Fo]),[vb,QO]=(0,V.useState)(n.getGeminiMdFileCount());(0,V.useEffect)(()=>{let W=Ee=>{QO(Ee.fileCount)};return Re.on("memory-changed",W),()=>{Re.off("memory-changed",W)}},[]),(0,V.useEffect)(()=>{let W=!0;return(async()=>{let[me,He]=await Promise.all([n.getBannerTextNoCapacityIssues(),n.getBannerTextCapacityIssues()]);W&&(qi(me),er(He),Po(!0))})(),()=>{W=!1}},[n,Qt]);let JO=(0,V.useMemo)(()=>({buffer:Si,userMessages:jt,shellModeActive:Ae,showEscapePrompt:ib,copyModeEnabled:H,inputWidth:Ha,suggestionsWidth:ec}),[Si,jt,Ae,ib,H,Ha,ec]),ZO=(0,V.useMemo)(()=>({history:h.history,historyManager:h,isThemeDialogOpen:nc,themeError:B,isAuthenticating:Ga,isConfigInitialized:Me,authError:iy,accountSuspensionInfo:ly,isAuthDialogOpen:ic,isAwaitingApiKeyInput:Hr==="awaiting_api_key_input",apiKeyDefaultValue:sy,editorError:Qh,isEditorDialogOpen:tc,showPrivacyNotice:D,mouseMode:T,corgiMode:w,debugMessage:R,quittingMessages:I,isSettingsDialogOpen:Yp,isSessionBrowserOpen:Qp,isModelDialogOpen:Jp,isAgentConfigDialogOpen:Ti,selectedAgentName:xi,selectedAgentDisplayName:Vs,selectedAgentDefinition:ue,isPermissionsDialogOpen:Vi,permissionsDialogProps:Yi,slashCommands:vu,pendingSlashCommandHistoryItems:Au,commandContext:wy,commandConfirmationRequest:Xs,authConsentRequest:sc,confirmUpdateExtensionRequests:Pr,loopDetectionConfirmationRequest:Mu,permissionConfirmationRequest:Iu,geminiMdFileCount:vb,streamingState:xo,initError:of,pendingGeminiHistoryItems:Ou,thought:ac,isInputActive:af,isResuming:jp,shouldShowIdePrompt:Fu,isFolderTrustDialogOpen:pf??!1,folderDiscoveryResults:ab,isPolicyUpdateDialogOpen:gf,policyUpdateConfirmationRequest:ff,isTrustedFolder:Z,constrainHeight:Ao,showErrorDetails:Uu,showFullTodos:Qy,ideContextState:Hu,renderMarkdown:Jy,ctrlCPressedOnce:eb>=1,ctrlDPressedOnce:ob>=1,shortcutsHelpVisible:Wa,cleanUiDetailsVisible:Ru,isFocused:Bu,elapsedTime:Sb,currentLoadingPhrase:Eb,currentTip:Cb,currentWittyPhrase:_b,historyRemountKey:$e,activeHooks:oo,messageQueue:Lu,queueErrorMessage:he,showApprovalModeIndicator:Rb,allowPlanMode:yf,currentModel:Se,quota:{userTier:q,stats:Oe,proQuotaRequest:rc,validationRequest:Su,overageMenuRequest:Eu,emptyWalletRequest:Cu},contextFileNames:Yy,errorCount:Xi,availableTerminalHeight:cf,stableControlsHeight:lf,mainAreaWidth:_r,staticAreaMaxItemHeight:Xh,staticExtraHeight:sr,dialogsVisible:bb,pendingHistoryItems:Fo,nightly:yb,branchName:nr,sessionStats:Cr,terminalWidth:yt,terminalHeight:Tt,mainControlsRef:zy,rootUiRef:rr,currentIDE:df,updateInfo:Ft,showIdeRestartPrompt:mf,ideTrustRestartReason:mb,isRestarting:cb,extensionsUpdateState:$s,activePtyId:Qi,backgroundTaskCount:rf,isBackgroundTaskVisible:Gr,embeddedShellFocused:O,showDebugProfiler:P,customDialog:K,transientMessage:sb,bannerData:Cn,bannerVisible:sn,terminalBackgroundColor:n.getTerminalBackground(),settingsNonce:bo,backgroundTasks:Wr,activeBackgroundTaskPid:Ly,backgroundTaskHeight:sf,isBackgroundTaskListOpen:ky,adminSettingsChanged:ne,newAgents:pe,showIsExpandableHint:Ki,hintMode:n.isModelSteeringEnabled()&&Lm(Fo),hintBuffer:""}),[nc,B,Ga,Me,iy,ly,ic,Qh,tc,D,T,w,R,I,Yp,Qp,Jp,Ti,xi,Vs,ue,Vi,Yi,vu,Au,wy,Xs,sc,Pr,Mu,Iu,vb,xo,of,Ou,ac,af,jp,Fu,pf,ab,gf,ff,Z,Ao,Uu,Qy,Hu,Jy,eb,ob,Wa,Ru,Bu,Sb,Eb,Cb,_b,$e,oo,Lu,he,Rb,yf,q,Oe,rc,Su,Eu,Cu,Yy,Xi,cf,lf,_r,Xh,sr,bb,Fo,yb,nr,Cr,yt,Tt,zy,rr,df,Ft,mf,mb,cb,Se,$s,Qi,rf,Gr,h,O,P,K,sy,Hr,sb,Cn,sn,n,bo,sf,ky,Ly,Wr,ne,pe,Ki]),Ab=(0,V.useCallback)(()=>N(!1),[N]),eM=(0,V.useMemo)(()=>({handleThemeSelect:Xp,closeThemeDialog:ny,handleThemeHighlight:ry,handleAuthSelect:Ty,setAuthState:Yo,onAuthError:$n,handleEditorSelect:Jh,exitEditorDialog:Zh,exitPrivacyNotice:Ab,closeSettingsDialog:ty,closeModelDialog:Cy,openAgentConfigDialog:de,closeAgentConfigDialog:Ie,openPermissionsDialog:Fr,closePermissionsDialog:or,setShellModeActive:nt,vimHandleInput:qy,handleIdePromptComplete:hb,handleFolderTrustSelect:lb,setIsPolicyUpdateDialogOpen:ub,setConstrainHeight:ko,onEscapePromptChange:gb,refreshStatic:Qt,handleFinalSubmit:uc,handleClearScreen:Ky,handleProQuotaChoice:dy,handleValidationChoice:my,handleOverageMenuChoice:py,handleEmptyWalletChoice:fy,openSessionBrowser:_u,closeSessionBrowser:gy,handleResumeSession:hy,handleDeleteSession:by,setQueueErrorMessage:ke,addMessage:ku,popAllMessages:Wy,handleApiKeySubmit:xy,handleApiKeyCancel:Sy,setBannerVisible:Po,setShortcutsHelpVisible:Ys,setCleanUiDetailsVisible:_y,toggleCleanUiDetailsVisible:Ry,revealCleanUiDetailsTemporarily:wu,handleWarning:hf,setEmbeddedShellFocused:L,dismissBackgroundTask:Dy,setActiveBackgroundTaskPid:Py,setIsBackgroundTaskListOpen:js,setAuthContext:zs,onHintInput:()=>{},onHintBackspace:()=>{},onHintClear:()=>{},onHintSubmit:()=>{},handleRestart:async()=>{if(Yh.send){let W=n.getRemoteAdminSettings();W&&Yh.send({type:"admin-settings-update",settings:W})}await un()},handleNewAgentsSelect:async W=>{if(pe&&W==="acknowledge"){let Ee=n.getAgentRegistry();try{await Promise.all(pe.map(me=>Ee.acknowledgeAgent(me)))}catch(me){_e.error("Failed to acknowledge agents:",me),h.addItem({type:"error",text:`Failed to acknowledge agents: ${Rr(me)}`},Date.now())}}ft(null)},getPreferredEditor:xu,clearAccountSuspension:()=>{cy(null),Yo("updating")}}),[Xp,ny,ry,Ty,Yo,$n,Jh,Zh,Ab,ty,Cy,de,Ie,Fr,or,nt,qy,hb,lb,ub,ko,gb,Qt,uc,Ky,dy,my,py,fy,_u,gy,hy,by,ke,ku,Wy,xy,Sy,Po,Ys,_y,Ry,wu,hf,L,Dy,Py,js,zs,cy,pe,n,h,xu]);return Hr==="awaiting_google_login_restart"?(0,Sr.jsx)(sO,{onDismiss:()=>{zs({}),Yo("updating")},config:n}):(0,Sr.jsx)(Ed.Provider,{value:ZO,children:(0,Sr.jsx)(VS.Provider,{value:JO,children:(0,Sr.jsx)(Cg.Provider,{value:eM,children:(0,Sr.jsx)(tl.Provider,{value:n,children:(0,Sr.jsx)(Ng.Provider,{value:{version:e.version,startupWarnings:e.startupWarnings||[]},children:(0,Sr.jsx)(W_,{config:n,toolCalls:jO,isExpanded:Ne,toggleExpansion:ge,toggleAllExpansion:Xe,children:(0,Sr.jsx)(oh.Provider,{value:Bu,children:(0,Sr.jsx)(Qd,{mouseEventsEnabled:T,children:(0,Sr.jsx)(Jd,{children:(0,Sr.jsx)(_A,{},`app-${b}`)})})})})})})})})})};var Hn=C(M(),1);var i1=200;async function oae(e,t,o,n=process.cwd(),r,a){mv();let i=nd(e.getUseAlternateBuffer(),e.getScreenReader()),s=i;s&&(ts(),ls(()=>{os()}));let{matchers:l,errors:u}=await SS();u.forEach(E=>{Re.emitFeedback("warning",E)});let p=await qT();s1(r1(n),t);let y=new Vx({onNewMessage:E=>{Re.emitConsoleLog(E.type,E.content)},debugMode:e.getDebugMode()});y.patch(),ls(y.cleanup);let{stdout:f,stderr:g}=hT(),h=!!process.env.SHPOOL_SESSION_NAME,x=()=>(ip(),(0,Hn.jsx)(bS.Provider,{value:t,children:(0,Hn.jsx)(ES,{value:l,children:(0,Hn.jsx)(TS,{config:e,children:(0,Hn.jsx)(Qd,{mouseEventsEnabled:s,children:(0,Hn.jsx)(AA,{children:(0,Hn.jsx)(Jd,{children:(0,Hn.jsx)(dl,{children:(0,Hn.jsx)(TR,{children:(0,Hn.jsx)(qS,{children:(0,Hn.jsx)(xO,{config:e,startupWarnings:o,version:p,resumedSessionData:r,initializationResult:a})})})})})})})})})}));h&&await new Promise(E=>setTimeout(E,100));let T=lS(process.env.DEBUG?(0,Hn.jsx)(SO.default.StrictMode,{children:(0,Hn.jsx)(x,{})}):(0,Hn.jsx)(x,{}),{stdout:f,stderr:g,stdin:process.stdin,exitOnCtrlC:!1,isScreenReaderEnabled:e.getScreenReader(),onRender:({renderTime:E})=>{E>i1&&cT(e,E),KS.reportFrameRendered()},standardReactLayoutTiming:i||e.getUseTerminalBuffer(),patchConsole:!1,alternateBuffer:i,terminalBuffer:e.getUseTerminalBuffer(),renderProcess:e.getUseRenderProcess()&&e.getUseTerminalBuffer(),incrementalRendering:t.merged.ui.incrementalRendering!==!1&&i&&!h});i&&(qa(),ls(()=>{td()})),zN(t).then(E=>{eE(E,t,e.getProjectRoot())}).catch(E=>{e.getDebugMode()&&_e.warn("Update check failed:",E)}),ls(()=>T.unmount()),ls(Hx())}function s1(e,t){if(!t.merged.ui.hideWindowTitle){let o=Ep({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{oae as startInteractiveUI};
121
121
  /**
122
122
  * @license
123
123
  * 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{Ec as g,Hf as f,nk as a,pk as p,qk as m,rk as A,sk as T,tk as y,uk as v,vk as w,wk as C}from"./chunk-SZCTACC4.js";import{Nd as i,Wd as l,b as o,ge as k,sa as d}from"./chunk-F34TWSY4.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...
2
+ import{Ec as g,Hf as f,nk as a,pk as p,qk as m,rk as A,sk as T,tk as y,uk as v,vk as w,wk as C}from"./chunk-PV736O4V.js";import{Nd as i,Wd as l,b as o,ge as k,sa as d}from"./chunk-F34TWSY4.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}
@@ -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{Ec as f,Hf as g,nk as a,pk as p,qk as m,rk as A,sk as T,tk as w,uk as y,vk as U,wk as C}from"./chunk-RJWN4TV6.js";import{Nd as n,Wd as l,b as o,ge as k,sa as d}from"./chunk-7FAQMMW2.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...
2
+ import{Ec as f,Hf as g,nk as a,pk as p,qk as m,rk as A,sk as T,tk as w,uk as y,vk as U,wk as C}from"./chunk-VHTOM3KV.js";import{Nd as n,Wd as l,b as o,ge as k,sa as d}from"./chunk-7FAQMMW2.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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makecoder",
3
- "version": "2.0.100",
3
+ "version": "2.0.101",
4
4
  "description": "MakeCoder: Unified AI agent CLI tool integrating Claude Code, Codex and Gemini CLI",
5
5
  "main": "./dist/coder.js",
6
6
  "bin": {
@@ -35,9 +35,9 @@
35
35
  "zod": "^3.25.76"
36
36
  },
37
37
  "optionalDependencies": {
38
- "makecoder-codex-darwin-arm64": "2.0.100",
39
- "makecoder-codex-linux-x64": "2.0.100",
40
- "makecoder-codex-win32-x64": "2.0.100"
38
+ "makecoder-codex-darwin-arm64": "2.0.101",
39
+ "makecoder-codex-linux-x64": "2.0.101",
40
+ "makecoder-codex-win32-x64": "2.0.101"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=20.0.0"