hwjcode 1.1.31 → 1.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/easycode.js +4 -4
- package/package.json +1 -1
package/bundle/easycode.js
CHANGED
|
@@ -573,7 +573,7 @@ ${h}`)}return t}),l1e=Ukn(HOt);W1e=class extends N1e{create(e,r){var a;let{api_v
|
|
|
573
573
|
`):[]}};MO.NEWLINE_CHARS=new Set([`
|
|
574
574
|
`,"\r"]);MO.NEWLINE_REGEXP=/\r\n|[\n\r]/g;E1e={off:0,error:200,warn:300,info:400,debug:500},EOt=(n,e,r)=>{if(n){if(wkn(E1e,n))return n;X2(r).warn(`${e} was set to ${JSON.stringify(n)}, expected one of ${JSON.stringify(Object.keys(E1e))}`)}};jkn={error:Tne,warn:Tne,info:Tne,debug:Tne},wOt=new WeakMap;Qk=n=>(n.options&&(n.options=Object.assign({},n.options),delete n.options.headers),n.headers&&(n.headers=Object.fromEntries((n.headers instanceof Headers?[...n.headers]:Object.entries(n.headers)).map(([e,r])=>[e,e.toLowerCase()==="x-goog-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in n&&(n.retryOfRequestLogID&&(n.retryOf=n.retryOfRequestLogID),delete n.retryOfRequestLogID),n);zMe=class n{constructor(e,r,a){this.iterator=e,this.controller=r,this.client=a}static fromSSEResponse(e,r,a){let i=!1,o=a?X2(a):console;function t(){return TO(this,arguments,function*(){var u,I,d,h;if(i)throw new oG("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let c=!1;try{try{for(var m=!0,v=Hk(qkn(e,r)),G;G=yield id(v.next()),u=G.done,!u;m=!0){h=G.value,m=!1;let A=h;if(!c)if(A.data.startsWith("[DONE]")){c=!0;continue}else try{yield yield id(JSON.parse(A.data))}catch(Z){throw o.error("Could not parse message into JSON:",A.data),o.error("From chunk:",A.raw),Z}}}catch(A){I={error:A}}finally{try{!m&&!u&&(d=v.return)&&(yield id(d.call(v)))}finally{if(I)throw I.error}}c=!0}catch(A){if(OMe(A))return yield id(void 0);throw A}finally{c||r.abort()}})}return new n(t,r,a)}static fromReadableStream(e,r,a){let i=!1;function o(){return TO(this,arguments,function*(){var u,I,d,h;let c=new MO,m=YOt(e);try{for(var v=!0,G=Hk(m),A;A=yield id(G.next()),u=A.done,!u;v=!0){h=A.value,v=!1;let Z=h;for(let R of c.decode(Z))yield yield id(R)}}catch(Z){I={error:Z}}finally{try{!v&&!u&&(d=G.return)&&(yield id(d.call(G)))}finally{if(I)throw I.error}}for(let Z of c.flush())yield yield id(Z)})}function t(){return TO(this,arguments,function*(){var u,I,d,h;if(i)throw new oG("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let c=!1;try{try{for(var m=!0,v=Hk(o()),G;G=yield id(v.next()),u=G.done,!u;m=!0){h=G.value,m=!1;let A=h;c||A&&(yield yield id(JSON.parse(A)))}}catch(A){I={error:A}}finally{try{!m&&!u&&(d=v.return)&&(yield id(d.call(v)))}finally{if(I)throw I.error}}c=!0}catch(A){if(OMe(A))return yield id(void 0);throw A}finally{c||r.abort()}})}return new n(t,r,a)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],r=[],a=this.iterator(),i=o=>({next:()=>{if(o.length===0){let t=a.next();e.push(t),r.push(t)}return o.shift()}});return[new n(()=>i(e),this.controller,this.client),new n(()=>i(r),this.controller,this.client)]}toReadableStream(){let e=this,r;return xOt({async start(){r=e[Symbol.asyncIterator]()},async pull(a){try{let{value:i,done:o}=await r.next();if(o)return a.close();let t=KMe(JSON.stringify(i)+`
|
|
575
575
|
`);a.enqueue(t)}catch(i){a.error(i)}},async cancel(){var a;await((a=r.return)===null||a===void 0?void 0:a.call(r))}})}};PMe=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(`
|
|
576
|
-
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,a,i]=$kn(e,":");return i.startsWith(" ")&&(i=i.substring(1)),r==="event"?this.event=i:r==="data"&&this.data.push(i),null}};jMe=class n extends Promise{constructor(e,r,a=e6n){super(i=>{i(null)}),this.responsePromise=r,this.parseResponse=a,this.client=e}_thenUnwrap(e){return new n(this.client,this.responsePromise,async(r,a)=>e(await this.parseResponse(r,a),a))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(this.client,e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};XOt=Symbol("brand.privateNullableHeaders");Bne=n=>{let e=new Headers,r=new Set;for(let a of n){let i=new Set;for(let[o,t]of t6n(a)){let s=o.toLowerCase();i.has(s)||(e.delete(o),i.add(s)),t===null?(e.delete(o),r.add(s)):(e.append(o,t),r.delete(s))}}return{[XOt]:!0,values:e,nulls:r}};DMe=n=>{var e,r,a,i,o,t;if(typeof globalThis.process<"u")return(a=(r=(e=globalThis.process.env)===null||e===void 0?void 0:e[n])===null||r===void 0?void 0:r.trim())!==null&&a!==void 0?a:void 0;if(typeof globalThis.Deno<"u")return(t=(o=(i=globalThis.Deno.env)===null||i===void 0?void 0:i.get)===null||o===void 0?void 0:o.call(i,n))===null||t===void 0?void 0:t.trim()};w1e=class n{constructor(e){var r,a,i,o,t,s,u,{baseURL:I=DMe("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:d=(r=DMe("GEMINI_API_KEY"))!==null&&r!==void 0?r:null,apiVersion:h="v1beta"}=e,c=h1e(e,["baseURL","apiKey","apiVersion"]);let m=Object.assign(Object.assign({apiKey:d,apiVersion:h},c),{baseURL:I||"https://generativelanguage.googleapis.com"});this.baseURL=m.baseURL,this.timeout=(a=m.timeout)!==null&&a!==void 0?a:n.DEFAULT_TIMEOUT,this.logger=(i=m.logger)!==null&&i!==void 0?i:console;let v="warn";this.logLevel=v,this.logLevel=(t=(o=EOt(m.logLevel,"ClientOptions.logLevel",this))!==null&&o!==void 0?o:EOt(DMe("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&t!==void 0?t:v,this.fetchOptions=m.fetchOptions,this.maxRetries=(s=m.maxRetries)!==null&&s!==void 0?s:2,this.fetch=(u=m.fetch)!==null&&u!==void 0?u:Xkn(),this.encoder=Lkn,this._options=m,this.apiKey=d,this.apiVersion=h,this.clientAdapter=m.clientAdapter}withOptions(e){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),e))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.has("authorization")||e.has("x-goog-api-key"))&&!(this.apiKey&&e.get("x-goog-api-key"))&&!r.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(e){let r=Bne([e.headers]);if(!(r.values.has("authorization")||r.values.has("x-goog-api-key"))){if(this.apiKey)return Bne([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return Bne([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return Object.entries(e).filter(([r,a])=>typeof a<"u").map(([r,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(r)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(r)}=`;throw new oG(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${BO}`}defaultIdempotencyKey(){return`stainless-node-retry-${Akn()}`}makeStatusError(e,r,a,i){return lG.generate(e,r,a,i)}buildURL(e,r,a){let i=!this.baseURLOverridden()&&a||this.baseURL,o=Nkn(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),t=this.defaultQuery();return Ekn(t)||(r=Object.assign(Object.assign({},t),r)),typeof r=="object"&&r&&!Array.isArray(r)&&(o.search=this.stringifyQuery(r)),o.toString()}async prepareOptions(e){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!e.path.startsWith(`/${this.apiVersion}/projects/`)){let r=e.path.slice(this.apiVersion.length+1);e.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${r}`}}async prepareRequest(e,{url:r,options:a}){}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,a){return this.request(Promise.resolve(a).then(i=>Object.assign({method:e,path:r},i)))}request(e,r=null){return new jMe(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,a){var i,o,t;let s=await e,u=(i=s.maxRetries)!==null&&i!==void 0?i:this.maxRetries;r==null&&(r=u),await this.prepareOptions(s);let{req:I,url:d,timeout:h}=await this.buildRequest(s,{retryCount:u-r});await this.prepareRequest(I,{url:d,options:s});let c="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),m=a===void 0?"":`, retryOf: ${a}`,v=Date.now();if(X2(this).debug(`[${c}] sending request`,Qk({retryOfRequestLogID:a,method:s.method,url:d,options:s,headers:I.headers})),!((o=s.signal)===null||o===void 0)&&o.aborted)throw new Jne;let G=new AbortController,A=await this.fetchWithTimeout(d,I,h,G).catch(MMe),Z=Date.now();if(A instanceof globalThis.Error){let F=`retrying, ${r} attempts remaining`;if(!((t=s.signal)===null||t===void 0)&&t.aborted)throw new Jne;let E=OMe(A)||/timed? ?out/i.test(String(A)+("cause"in A?String(A.cause):""));if(r)return X2(this).info(`[${c}] connection ${E?"timed out":"failed"} - ${F}`),X2(this).debug(`[${c}] connection ${E?"timed out":"failed"} (${F})`,Qk({retryOfRequestLogID:a,url:d,durationMs:Z-v,message:A.message})),this.retryRequest(s,r,a??c);throw X2(this).info(`[${c}] connection ${E?"timed out":"failed"} - error; no more retries left`),X2(this).debug(`[${c}] connection ${E?"timed out":"failed"} (error; no more retries left)`,Qk({retryOfRequestLogID:a,url:d,durationMs:Z-v,message:A.message})),E?new p1e:new OO({cause:A})}let R=`[${c}${m}] ${I.method} ${d} ${A.ok?"succeeded":"failed"} with status ${A.status} in ${Z-v}ms`;if(!A.ok){let F=await this.shouldRetry(A);if(r&&F){let b=`retrying, ${r} attempts remaining`;return await Skn(A.body),X2(this).info(`${R} - ${b}`),X2(this).debug(`[${c}] response error (${b})`,Qk({retryOfRequestLogID:a,url:A.url,status:A.status,headers:A.headers,durationMs:Z-v})),this.retryRequest(s,r,a??c,A.headers)}let E=F?"error; no more retries left":"error; not retryable";X2(this).info(`${R} - ${E}`);let p=await A.text().catch(b=>MMe(b).message),y=Ckn(p),N=y?void 0:p;throw X2(this).debug(`[${c}] response error (${E})`,Qk({retryOfRequestLogID:a,url:A.url,status:A.status,headers:A.headers,message:N,durationMs:Date.now()-v})),this.makeStatusError(A.status,y,N,A.headers)}return X2(this).info(R),X2(this).debug(`[${c}] response start`,Qk({retryOfRequestLogID:a,url:A.url,status:A.status,headers:A.headers,durationMs:Z-v})),{response:A,options:s,controller:G,requestLogID:c,retryOfRequestLogID:a,startTime:v}}async fetchWithTimeout(e,r,a,i){let o=r||{},{signal:t,method:s}=o,u=h1e(o,["signal","method"]);t&&t.addEventListener("abort",()=>i.abort());let I=setTimeout(()=>i.abort(),a),d=globalThis.ReadableStream&&u.body instanceof globalThis.ReadableStream||typeof u.body=="object"&&u.body!==null&&Symbol.asyncIterator in u.body,h=Object.assign(Object.assign(Object.assign({signal:i.signal},d?{duplex:"half"}:{}),{method:"GET"}),u);s&&(h.method=s.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(I)}}async shouldRetry(e){let r=e.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,a,i){var o;let t,s=i?.get("retry-after-ms");if(s){let I=parseFloat(s);Number.isNaN(I)||(t=I)}let u=i?.get("retry-after");if(u&&!t){let I=parseFloat(u);Number.isNaN(I)?t=Date.parse(u)-Date.now():t=I*1e3}if(!(t&&0<=t&&t<60*1e3)){let I=(o=e.maxRetries)!==null&&o!==void 0?o:this.maxRetries;t=this.calculateDefaultRetryTimeoutMillis(r,I)}return await xkn(t),this.makeRequest(e,r-1,a)}calculateDefaultRetryTimeoutMillis(e,r){let o=r-e,t=Math.min(.5*Math.pow(2,o),8),s=1-Math.random()*.25;return t*s*1e3}async buildRequest(e,{retryCount:r=0}={}){var a,i,o;let t=Object.assign({},e),{method:s,path:u,query:I,defaultBaseURL:d}=t,h=this.buildURL(u,I,d);"timeout"in t&&Rkn("timeout",t.timeout),t.timeout=(a=t.timeout)!==null&&a!==void 0?a:this.timeout;let{bodyHeaders:c,body:m}=this.buildBody({options:t}),v=await this.buildHeaders({options:e,method:s,bodyHeaders:c,retryCount:r});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:s,headers:v},t.signal&&{signal:t.signal}),globalThis.ReadableStream&&m instanceof globalThis.ReadableStream&&{duplex:"half"}),m&&{body:m}),(i=this.fetchOptions)!==null&&i!==void 0?i:{}),(o=t.fetchOptions)!==null&&o!==void 0?o:{}),url:h,timeout:t.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:a,retryCount:i}){let o={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=e.idempotencyKey);let t=await this.authHeaders(e),s=Bne([o,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i)},e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{}),Hkn()),this._options.defaultHeaders,a,e.headers,t]);return this.validateHeaders(s),s.values}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let a=Bne([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&a.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:kkn(e)}:this.encoder({body:e,headers:a})}};w1e.DEFAULT_TIMEOUT=6e4;O0=class extends w1e{constructor(){super(...arguments),this.interactions=new F1e(this)}};kOt=O0;O0.GeminiNextGenAPIClient=kOt;O0.GeminiNextGenAPIClientError=oG;O0.APIError=lG;O0.APIConnectionError=OO;O0.APIConnectionTimeoutError=p1e;O0.APIUserAbortError=Jne;O0.NotFoundError=G1e;O0.ConflictError=v1e;O0.RateLimitError=A1e;O0.BadRequestError=f1e;O0.AuthenticationError=b1e;O0.InternalServerError=Z1e;O0.PermissionDeniedError=g1e;O0.UnprocessableEntityError=y1e;O0.toFile=Okn;O0.Interactions=F1e;g$i=1024*1024*8;});function r6n(n,e){return{...n,...e}}function SOt(n){let{prompt_id:e,...r}=n;return r}function KY(n){return Array.isArray(n)?n.map(SOt):n}var R1e=ct(()=>{"use strict";li();});var LOt={};ao(LOt,{DEFAULT_PROXY_CONFIG:()=>i6n,getActiveProxyServerUrl:()=>fE,getAvailableProxyServers:()=>n6n,getProxyServerInfo:()=>a6n,getProxyServers:()=>Dne,hasAvailableProxyServer:()=>$Me});function Dne(){return[{url:"https://api-code.deepvlab.ai",name:"Primary Development Server",region:"default",status:"active"}]}function fE(){let e=Dne().find(r=>r.status==="active");if(!e)throw new Error("No active proxy server available. Please contact support.");return e.url}function n6n(){return Dne().filter(e=>e.status==="active")}function $Me(){return Dne().some(e=>e.status==="active")}function a6n(n){return Dne().find(r=>r.url===n)}var i6n,UO=ct(()=>{"use strict";i6n={serverUrl:fE(),timeout:2e5,retryAttempts:3,retryDelay:1e3}});import{randomUUID as s6n}from"crypto";function ov(){return One||(One=s6n()),One}function BOt(n){One=n}function TOt(){One=void 0}var One,JOt,C1e=ct(()=>{"use strict";JOt=ov()});function ZI(n){let e=n??"1.1.31"??"unknown",r=process.platform,a=process.arch;if(e.startsWith("VSCode-")){let i=e.slice(7)||"unknown";return`${x1e}/VSCode/${i} (${r}; ${a})`}if(e.startsWith("Desktop-")){let i=e.slice(8)||"unknown";return`${x1e}/Desktop/${i} (${r}; ${a})`}return`${x1e}/CLI/${e} (${r}; ${a})`}var x1e,$Y=ct(()=>{"use strict";x1e="EasyCode"});import*as ku from"fs";import*as a3 from"path";import*as Xk from"os";function o6n(n){xo.configure(n)}function l6n(n){xo.setUserInfo(n)}function c6n(n){xo.setCliVersion(n)}async function u6n(){return await xo.getUserHeaders()}function d6n(){return xo.getStatus()}var Mne,qo,xo,eV=ct(()=>{"use strict";UO();C1e();$Y();Mne=259200,qo=class n{static instance=null;config;userInfo=null;jwtTokenData=null;usageStats={totalCreditsConsumed:0,lastUpdated:new Date().toISOString()};userInfoFilePath;jwtTokenFilePath;usageStatsFilePath;refreshPromise=null;cliVersion="unknown";periodicStatusCheckIntervalId=null;onLoginSuccessCallbacks=[];getCliVersion(){return this.cliVersion}getUserAgent(){return ZI(this.cliVersion)}formatTimeRemaining(e){if(e<=0)return"\u5DF2\u8FC7\u671F";let r=Math.floor(e/1e3),a=Math.floor(r/(24*3600)),i=Math.floor(r%(24*3600)/3600),o=Math.floor(r%3600/60),t=r%60;return a>0?`${a}\u5929${i}\u5C0F\u65F6${o}\u5206\u949F`:i>0?`${i}\u5C0F\u65F6${o}\u5206\u949F${t}\u79D2`:o>0?`${o}\u5206\u949F${t}\u79D2`:`${t}\u79D2`}formatAbsoluteTime(e){return new Date(e).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}constructor(){"https://api-code.deepvlab.ai"?.includes("localhost")?(this.userInfoFilePath=a3.join(Xk.homedir(),".easycode-user","user-info-dev.json"),this.jwtTokenFilePath=a3.join(Xk.homedir(),".easycode-user","jwt-token-dev.json"),this.usageStatsFilePath=a3.join(Xk.homedir(),".easycode-user","usage-stats-dev.json")):(this.userInfoFilePath=a3.join(Xk.homedir(),".easycode-user","user-info.json"),this.jwtTokenFilePath=a3.join(Xk.homedir(),".easycode-user","jwt-token.json"),this.usageStatsFilePath=a3.join(Xk.homedir(),".easycode-user","usage-stats.json")),this.cliVersion="1.1.31",this.config={proxyServerUrl:fE()},this.loadUserInfo(),this.loadJwtToken(),this.loadUsageStats(),this.startPeriodicStatusCheck()}startPeriodicStatusCheck(){this.periodicStatusCheckIntervalId=setInterval(()=>{if(this.jwtTokenData){let e=Date.now(),r=this.jwtTokenData.expiresAt-e,a=this.formatTimeRemaining(r),i=this.formatAbsoluteTime(this.jwtTokenData.expiresAt);if(r>0){let o=this.formatAbsoluteTime(this.jwtTokenData.expiresAt-Mne*1e3);console.log(`[Login Check] \u{1F4CA} Periodic status check - Credential remaining: ${a} (until ${i}), next renewal: ${o}`)}else console.log(`[Login Check] \u26A0\uFE0F Periodic status check - Credential expired at: ${i}`)}},600*1e3)}static getInstance(){return n.instance||(n.instance=new n),n.instance}loadUserInfo(){try{if(ku.existsSync(this.userInfoFilePath)){let e=ku.readFileSync(this.userInfoFilePath,"utf8");this.userInfo=JSON.parse(e);let r=a=>{if(!a||!a.includes("@"))return a;let[i,o]=a.split("@");return i.length<=2?a:`${i[0]+"*".repeat(i.length-2)+i[i.length-1]}@${o}`}}}catch(e){console.warn("[Login Check] Failed to load user info from local file:",e),this.userInfo=null}}saveUserInfo(){try{let e=a3.dirname(this.userInfoFilePath);ku.existsSync(e)||ku.mkdirSync(e,{recursive:!0}),ku.writeFileSync(this.userInfoFilePath,JSON.stringify(this.userInfo,null,2)),console.log("[Login Check] User info saved to local file")}catch(e){console.error("[Login Check] Failed to save user info:",e)}}loadJwtToken(){try{if(ku.existsSync(this.jwtTokenFilePath)){let e=ku.readFileSync(this.jwtTokenFilePath,"utf8");this.jwtTokenData=JSON.parse(e);let r=Date.now();this.isTokenExpired()?this.jwtTokenData=null:this.isTokenNearExpiry(300)&&console.log("\u26A0\uFE0F Access credential expiring soon, auto-renewal in progress")}else console.log("[Login Check] No stored access credential found, authentication required")}catch(e){console.warn("[Login Check] Failed to load access credential from local file:",e),this.jwtTokenData=null}}saveJwtToken(){try{if(!this.jwtTokenData)return;let e=a3.dirname(this.jwtTokenFilePath);ku.existsSync(e)||ku.mkdirSync(e,{recursive:!0}),ku.writeFileSync(this.jwtTokenFilePath,JSON.stringify(this.jwtTokenData,null,2)),console.log("[Login Check] Access credential data saved to local file")}catch(e){console.error("[Login Check] Failed to save access credential:",e)}}loadUsageStats(){try{if(ku.existsSync(this.usageStatsFilePath)){let e=ku.readFileSync(this.usageStatsFilePath,"utf8");this.usageStats=JSON.parse(e)}}catch(e){console.warn("[Login Check] Failed to load usage stats from local file:",e),this.usageStats={totalCreditsConsumed:0,lastUpdated:new Date().toISOString()}}}saveUsageStats(){try{let e=a3.dirname(this.usageStatsFilePath);ku.existsSync(e)||ku.mkdirSync(e,{recursive:!0}),ku.writeFileSync(this.usageStatsFilePath,JSON.stringify(this.usageStats,null,2)),console.log("[Login Check] Usage stats saved to local file")}catch(e){console.error("[Login Check] Failed to save usage stats:",e)}}updateUsageStats(e){e<=0||(this.usageStats.totalCreditsConsumed+=e,this.usageStats.lastUpdated=new Date().toISOString(),this.saveUsageStats(),console.log(`[Usage Stats] Updated total credits consumed: ${this.usageStats.totalCreditsConsumed} (+${e})`))}getUsageStats(){return{...this.usageStats}}checkStartupTokenStatus(){return this.jwtTokenData?{hasToken:!0,isExpired:Date.now()>=this.jwtTokenData.expiresAt,expiresAt:this.jwtTokenData.expiresAt,hasRefreshToken:!!this.jwtTokenData.refreshToken}:{hasToken:!1,isExpired:!0,expiresAt:null,hasRefreshToken:!1}}configure(e){this.config={...this.config,...e},e.userInfo&&(this.userInfo=e.userInfo,this.saveUserInfo(),console.log(`[Login Check] User info configured: ${e.userInfo.name}`)),e.proxyServerUrl&&console.log(`[Login Check] Proxy server URL: ${e.proxyServerUrl}`),e.cliVersion&&(this.cliVersion=e.cliVersion,console.log(`[Login Check] CLI version set: ${e.cliVersion}`))}setUserInfo(e){this.userInfo=e,this.saveUserInfo(),console.log(`[Login Check] User info updated: ${e.name} (${e.email||e.openId||"N/A"})`),this.triggerLoginSuccessCallbacks()}onLoginSuccess(e){this.onLoginSuccessCallbacks.push(e)}triggerLoginSuccessCallbacks(){this.onLoginSuccessCallbacks.forEach(e=>{try{e()}catch(r){console.error("[ProxyAuthManager] Error in login success callback:",r)}})}setCliVersion(e){this.cliVersion=e,console.log(`[Login Check] CLI version updated: ${e}`)}setJwtToken(e){let r=Date.now();this.jwtTokenData={accessToken:e,expiresIn:900,expiresAt:r+900*1e3,savedAt:new Date().toISOString()},this.saveJwtToken(),console.log("[Login Check] Access credential updated")}setJwtTokenData(e){let a=Date.now()+e.expiresIn*1e3;this.jwtTokenData={accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,expiresAt:a,savedAt:new Date().toISOString()},this.saveJwtToken();let i=this.formatTimeRemaining(e.expiresIn*1e3),o=this.formatAbsoluteTime(a),t=this.formatAbsoluteTime(a-Mne*1e3),u=!!e.refreshToken?", will auto-renew":", manual login required";console.log(`[Login Check] Access credential updated - valid for: ${i} (until ${o}), next renewal: ${t}${u}`)}async getAccessToken(){if(!this.jwtTokenData)return console.log("[Login Check] No access credential available, authentication required"),null;let e=Date.now(),r=this.jwtTokenData.expiresAt-e,a=this.formatTimeRemaining(r),i=this.jwtTokenData.expiresAt-Mne*1e3,o=this.formatAbsoluteTime(i);if(this.isTokenNearExpiry()){console.log(`[Login Check] Access credential expiring soon (remaining: ${a}), starting auto-renewal...`);try{return await this.refreshAccessToken()}catch(t){return console.error("[Login Check] Credential renewal failed:",t),null}}return this.jwtTokenData.accessToken}isTokenExpired(){return this.jwtTokenData?Date.now()>=this.jwtTokenData.expiresAt:!0}isTokenNearExpiry(e=Mne){if(!this.jwtTokenData)return!0;let r=this.jwtTokenData.expiresAt-Date.now(),a=r<=e*1e3;if(a){let i=this.formatTimeRemaining(r);console.log(`[Login Check] Credential expiry check: ${i} remaining <= ${e}s threshold, renewal needed: ${a}`)}return a}async refreshAccessToken(){if(this.refreshPromise)return await this.refreshPromise;this.refreshPromise=this.performTokenRefresh();try{return await this.refreshPromise}finally{this.refreshPromise=null}}async performTokenRefresh(){if(!this.jwtTokenData?.refreshToken)throw new Error("No refresh token available");try{console.log("[Login Check] Refreshing access credential...");let e=await fetch(`${this.config.proxyServerUrl}/auth/jwt/refresh`,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":this.getUserAgent()},body:JSON.stringify({refreshToken:this.jwtTokenData.refreshToken})});if(!e.ok){if(e.status===401)throw this.clearTokens(),new Error("Refresh credential expired or invalid - authentication required");let u=await e.text();throw new Error(`Credential refresh failed (${e.status}): ${u}`)}let r=await e.json();if(!r.success||!r.data?.accessToken)throw new Error("Invalid refresh response from server");let a=Date.now(),i=!!r.data.refreshToken;this.jwtTokenData={accessToken:r.data.accessToken,refreshToken:r.data.refreshToken||this.jwtTokenData.refreshToken,expiresIn:r.data.expiresIn||900,expiresAt:a+(r.data.expiresIn||900)*1e3,savedAt:new Date().toISOString()},this.saveJwtToken();let o=this.formatTimeRemaining((r.data.expiresIn||900)*1e3),t=this.formatAbsoluteTime(this.jwtTokenData.expiresAt),s=this.formatAbsoluteTime(this.jwtTokenData.expiresAt-Mne*1e3);return console.log(`[Login Check] \u2705 Credential renewed successfully - valid for: ${o} (until ${t}), next renewal: ${s}${i?" (refresh credential updated)":" (reusing existing refresh credential)"}`),this.jwtTokenData.accessToken}catch(e){throw console.error("[Login Check] Credential refresh error:",e),e}}clearTokens(){this.jwtTokenData=null;try{ku.existsSync(this.jwtTokenFilePath)&&ku.unlinkSync(this.jwtTokenFilePath)}catch(e){console.warn("[Login Check] Failed to delete access credential file:",e)}}getProxyServerUrl(){return this.config.proxyServerUrl}async getUserHeaders(e){let r=await this.getAccessToken(),a=this.getCliVersion(),i=this.getUserAgent(),o={"Content-Type":"application/json","X-Client-Version":a,"User-Agent":i,"X-Session-ID":ov()};return r&&(o.Authorization=`Bearer ${r}`),e&&(o["X-DVCode-Scene"]=e),o}getUserHeadersSync(){let e=this.getCliVersion(),r=this.getUserAgent(),a={"Content-Type":"application/json","X-Client-Version":e,"User-Agent":r,"X-Session-ID":ov()};return this.jwtTokenData?.accessToken&&(a.Authorization=`Bearer ${this.jwtTokenData.accessToken}`),a}getUserInfo(){return this.userInfo}isConfigured(){return!!this.userInfo}getStatus(){return{configured:this.isConfigured(),proxyServerUrl:this.config.proxyServerUrl,hasUserInfo:!!this.userInfo,userInfo:this.userInfo}}clear(){this.userInfo=null,this.jwtTokenData=null,this.periodicStatusCheckIntervalId!==null&&(clearInterval(this.periodicStatusCheckIntervalId),this.periodicStatusCheckIntervalId=null);try{ku.existsSync(this.userInfoFilePath)&&ku.unlinkSync(this.userInfoFilePath)}catch(e){console.warn("[Login Check] Failed to delete user info file:",e)}try{ku.existsSync(this.jwtTokenFilePath)&&ku.unlinkSync(this.jwtTokenFilePath)}catch(e){console.warn("[Login Check] Failed to delete access credential file:",e)}console.log("[Login Check] Authentication cleared")}},xo=qo.getInstance()});import{promises as kk}from"node:fs";import Une from"node:path";import I6n from"os";var lv,Y1e,an,AA=ct(()=>{"use strict";(function(n){n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR"})(lv||(lv={}));Y1e=class{config;logBuffer=[];constructor(e={}){if(this.config={level:lv.INFO,enableConsole:!0,enableFile:!1,maxFileSize:10,maxFiles:5,...e},this.config.enableFile&&!this.config.filePath){let r=new Date().toISOString().slice(0,19).replace(/[:.]/g,"-");this.config.filePath=Une.join(I6n.homedir(),".easycode-user","logs",`deepv-${r}.log`)}}formatMessage(e,r,...a){let i=new Date().toISOString(),o=a.map(t=>typeof t=="object"?JSON.stringify(t,null,2):String(t)).join(" ");return`[${i}] [${e}] ${r} ${o}`.trim()}async writeToFile(e){if(!(!this.config.enableFile||!this.config.filePath))try{await kk.mkdir(Une.dirname(this.config.filePath),{recursive:!0}),await this.rotateLogIfNeeded(),await kk.appendFile(this.config.filePath,e+`
|
|
576
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,a,i]=$kn(e,":");return i.startsWith(" ")&&(i=i.substring(1)),r==="event"?this.event=i:r==="data"&&this.data.push(i),null}};jMe=class n extends Promise{constructor(e,r,a=e6n){super(i=>{i(null)}),this.responsePromise=r,this.parseResponse=a,this.client=e}_thenUnwrap(e){return new n(this.client,this.responsePromise,async(r,a)=>e(await this.parseResponse(r,a),a))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(this.client,e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};XOt=Symbol("brand.privateNullableHeaders");Bne=n=>{let e=new Headers,r=new Set;for(let a of n){let i=new Set;for(let[o,t]of t6n(a)){let s=o.toLowerCase();i.has(s)||(e.delete(o),i.add(s)),t===null?(e.delete(o),r.add(s)):(e.append(o,t),r.delete(s))}}return{[XOt]:!0,values:e,nulls:r}};DMe=n=>{var e,r,a,i,o,t;if(typeof globalThis.process<"u")return(a=(r=(e=globalThis.process.env)===null||e===void 0?void 0:e[n])===null||r===void 0?void 0:r.trim())!==null&&a!==void 0?a:void 0;if(typeof globalThis.Deno<"u")return(t=(o=(i=globalThis.Deno.env)===null||i===void 0?void 0:i.get)===null||o===void 0?void 0:o.call(i,n))===null||t===void 0?void 0:t.trim()};w1e=class n{constructor(e){var r,a,i,o,t,s,u,{baseURL:I=DMe("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:d=(r=DMe("GEMINI_API_KEY"))!==null&&r!==void 0?r:null,apiVersion:h="v1beta"}=e,c=h1e(e,["baseURL","apiKey","apiVersion"]);let m=Object.assign(Object.assign({apiKey:d,apiVersion:h},c),{baseURL:I||"https://generativelanguage.googleapis.com"});this.baseURL=m.baseURL,this.timeout=(a=m.timeout)!==null&&a!==void 0?a:n.DEFAULT_TIMEOUT,this.logger=(i=m.logger)!==null&&i!==void 0?i:console;let v="warn";this.logLevel=v,this.logLevel=(t=(o=EOt(m.logLevel,"ClientOptions.logLevel",this))!==null&&o!==void 0?o:EOt(DMe("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&t!==void 0?t:v,this.fetchOptions=m.fetchOptions,this.maxRetries=(s=m.maxRetries)!==null&&s!==void 0?s:2,this.fetch=(u=m.fetch)!==null&&u!==void 0?u:Xkn(),this.encoder=Lkn,this._options=m,this.apiKey=d,this.apiVersion=h,this.clientAdapter=m.clientAdapter}withOptions(e){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),e))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.has("authorization")||e.has("x-goog-api-key"))&&!(this.apiKey&&e.get("x-goog-api-key"))&&!r.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(e){let r=Bne([e.headers]);if(!(r.values.has("authorization")||r.values.has("x-goog-api-key"))){if(this.apiKey)return Bne([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return Bne([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return Object.entries(e).filter(([r,a])=>typeof a<"u").map(([r,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(r)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(r)}=`;throw new oG(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${BO}`}defaultIdempotencyKey(){return`stainless-node-retry-${Akn()}`}makeStatusError(e,r,a,i){return lG.generate(e,r,a,i)}buildURL(e,r,a){let i=!this.baseURLOverridden()&&a||this.baseURL,o=Nkn(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),t=this.defaultQuery();return Ekn(t)||(r=Object.assign(Object.assign({},t),r)),typeof r=="object"&&r&&!Array.isArray(r)&&(o.search=this.stringifyQuery(r)),o.toString()}async prepareOptions(e){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!e.path.startsWith(`/${this.apiVersion}/projects/`)){let r=e.path.slice(this.apiVersion.length+1);e.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${r}`}}async prepareRequest(e,{url:r,options:a}){}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,a){return this.request(Promise.resolve(a).then(i=>Object.assign({method:e,path:r},i)))}request(e,r=null){return new jMe(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,a){var i,o,t;let s=await e,u=(i=s.maxRetries)!==null&&i!==void 0?i:this.maxRetries;r==null&&(r=u),await this.prepareOptions(s);let{req:I,url:d,timeout:h}=await this.buildRequest(s,{retryCount:u-r});await this.prepareRequest(I,{url:d,options:s});let c="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),m=a===void 0?"":`, retryOf: ${a}`,v=Date.now();if(X2(this).debug(`[${c}] sending request`,Qk({retryOfRequestLogID:a,method:s.method,url:d,options:s,headers:I.headers})),!((o=s.signal)===null||o===void 0)&&o.aborted)throw new Jne;let G=new AbortController,A=await this.fetchWithTimeout(d,I,h,G).catch(MMe),Z=Date.now();if(A instanceof globalThis.Error){let F=`retrying, ${r} attempts remaining`;if(!((t=s.signal)===null||t===void 0)&&t.aborted)throw new Jne;let E=OMe(A)||/timed? ?out/i.test(String(A)+("cause"in A?String(A.cause):""));if(r)return X2(this).info(`[${c}] connection ${E?"timed out":"failed"} - ${F}`),X2(this).debug(`[${c}] connection ${E?"timed out":"failed"} (${F})`,Qk({retryOfRequestLogID:a,url:d,durationMs:Z-v,message:A.message})),this.retryRequest(s,r,a??c);throw X2(this).info(`[${c}] connection ${E?"timed out":"failed"} - error; no more retries left`),X2(this).debug(`[${c}] connection ${E?"timed out":"failed"} (error; no more retries left)`,Qk({retryOfRequestLogID:a,url:d,durationMs:Z-v,message:A.message})),E?new p1e:new OO({cause:A})}let R=`[${c}${m}] ${I.method} ${d} ${A.ok?"succeeded":"failed"} with status ${A.status} in ${Z-v}ms`;if(!A.ok){let F=await this.shouldRetry(A);if(r&&F){let b=`retrying, ${r} attempts remaining`;return await Skn(A.body),X2(this).info(`${R} - ${b}`),X2(this).debug(`[${c}] response error (${b})`,Qk({retryOfRequestLogID:a,url:A.url,status:A.status,headers:A.headers,durationMs:Z-v})),this.retryRequest(s,r,a??c,A.headers)}let E=F?"error; no more retries left":"error; not retryable";X2(this).info(`${R} - ${E}`);let p=await A.text().catch(b=>MMe(b).message),y=Ckn(p),N=y?void 0:p;throw X2(this).debug(`[${c}] response error (${E})`,Qk({retryOfRequestLogID:a,url:A.url,status:A.status,headers:A.headers,message:N,durationMs:Date.now()-v})),this.makeStatusError(A.status,y,N,A.headers)}return X2(this).info(R),X2(this).debug(`[${c}] response start`,Qk({retryOfRequestLogID:a,url:A.url,status:A.status,headers:A.headers,durationMs:Z-v})),{response:A,options:s,controller:G,requestLogID:c,retryOfRequestLogID:a,startTime:v}}async fetchWithTimeout(e,r,a,i){let o=r||{},{signal:t,method:s}=o,u=h1e(o,["signal","method"]);t&&t.addEventListener("abort",()=>i.abort());let I=setTimeout(()=>i.abort(),a),d=globalThis.ReadableStream&&u.body instanceof globalThis.ReadableStream||typeof u.body=="object"&&u.body!==null&&Symbol.asyncIterator in u.body,h=Object.assign(Object.assign(Object.assign({signal:i.signal},d?{duplex:"half"}:{}),{method:"GET"}),u);s&&(h.method=s.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(I)}}async shouldRetry(e){let r=e.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,a,i){var o;let t,s=i?.get("retry-after-ms");if(s){let I=parseFloat(s);Number.isNaN(I)||(t=I)}let u=i?.get("retry-after");if(u&&!t){let I=parseFloat(u);Number.isNaN(I)?t=Date.parse(u)-Date.now():t=I*1e3}if(!(t&&0<=t&&t<60*1e3)){let I=(o=e.maxRetries)!==null&&o!==void 0?o:this.maxRetries;t=this.calculateDefaultRetryTimeoutMillis(r,I)}return await xkn(t),this.makeRequest(e,r-1,a)}calculateDefaultRetryTimeoutMillis(e,r){let o=r-e,t=Math.min(.5*Math.pow(2,o),8),s=1-Math.random()*.25;return t*s*1e3}async buildRequest(e,{retryCount:r=0}={}){var a,i,o;let t=Object.assign({},e),{method:s,path:u,query:I,defaultBaseURL:d}=t,h=this.buildURL(u,I,d);"timeout"in t&&Rkn("timeout",t.timeout),t.timeout=(a=t.timeout)!==null&&a!==void 0?a:this.timeout;let{bodyHeaders:c,body:m}=this.buildBody({options:t}),v=await this.buildHeaders({options:e,method:s,bodyHeaders:c,retryCount:r});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:s,headers:v},t.signal&&{signal:t.signal}),globalThis.ReadableStream&&m instanceof globalThis.ReadableStream&&{duplex:"half"}),m&&{body:m}),(i=this.fetchOptions)!==null&&i!==void 0?i:{}),(o=t.fetchOptions)!==null&&o!==void 0?o:{}),url:h,timeout:t.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:a,retryCount:i}){let o={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=e.idempotencyKey);let t=await this.authHeaders(e),s=Bne([o,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i)},e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{}),Hkn()),this._options.defaultHeaders,a,e.headers,t]);return this.validateHeaders(s),s.values}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let a=Bne([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&a.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:kkn(e)}:this.encoder({body:e,headers:a})}};w1e.DEFAULT_TIMEOUT=6e4;O0=class extends w1e{constructor(){super(...arguments),this.interactions=new F1e(this)}};kOt=O0;O0.GeminiNextGenAPIClient=kOt;O0.GeminiNextGenAPIClientError=oG;O0.APIError=lG;O0.APIConnectionError=OO;O0.APIConnectionTimeoutError=p1e;O0.APIUserAbortError=Jne;O0.NotFoundError=G1e;O0.ConflictError=v1e;O0.RateLimitError=A1e;O0.BadRequestError=f1e;O0.AuthenticationError=b1e;O0.InternalServerError=Z1e;O0.PermissionDeniedError=g1e;O0.UnprocessableEntityError=y1e;O0.toFile=Okn;O0.Interactions=F1e;g$i=1024*1024*8;});function r6n(n,e){return{...n,...e}}function SOt(n){let{prompt_id:e,...r}=n;return r}function KY(n){return Array.isArray(n)?n.map(SOt):n}var R1e=ct(()=>{"use strict";li();});var LOt={};ao(LOt,{DEFAULT_PROXY_CONFIG:()=>i6n,getActiveProxyServerUrl:()=>fE,getAvailableProxyServers:()=>n6n,getProxyServerInfo:()=>a6n,getProxyServers:()=>Dne,hasAvailableProxyServer:()=>$Me});function Dne(){return[{url:"https://api-code.deepvlab.ai",name:"Primary Development Server",region:"default",status:"active"}]}function fE(){let e=Dne().find(r=>r.status==="active");if(!e)throw new Error("No active proxy server available. Please contact support.");return e.url}function n6n(){return Dne().filter(e=>e.status==="active")}function $Me(){return Dne().some(e=>e.status==="active")}function a6n(n){return Dne().find(r=>r.url===n)}var i6n,UO=ct(()=>{"use strict";i6n={serverUrl:fE(),timeout:2e5,retryAttempts:3,retryDelay:1e3}});import{randomUUID as s6n}from"crypto";function ov(){return One||(One=s6n()),One}function BOt(n){One=n}function TOt(){One=void 0}var One,JOt,C1e=ct(()=>{"use strict";JOt=ov()});function ZI(n){let e=n??"1.1.32"??"unknown",r=process.platform,a=process.arch;if(e.startsWith("VSCode-")){let i=e.slice(7)||"unknown";return`${x1e}/VSCode/${i} (${r}; ${a})`}if(e.startsWith("Desktop-")){let i=e.slice(8)||"unknown";return`${x1e}/Desktop/${i} (${r}; ${a})`}return`${x1e}/CLI/${e} (${r}; ${a})`}var x1e,$Y=ct(()=>{"use strict";x1e="EasyCode"});import*as ku from"fs";import*as a3 from"path";import*as Xk from"os";function o6n(n){xo.configure(n)}function l6n(n){xo.setUserInfo(n)}function c6n(n){xo.setCliVersion(n)}async function u6n(){return await xo.getUserHeaders()}function d6n(){return xo.getStatus()}var Mne,qo,xo,eV=ct(()=>{"use strict";UO();C1e();$Y();Mne=259200,qo=class n{static instance=null;config;userInfo=null;jwtTokenData=null;usageStats={totalCreditsConsumed:0,lastUpdated:new Date().toISOString()};userInfoFilePath;jwtTokenFilePath;usageStatsFilePath;refreshPromise=null;cliVersion="unknown";periodicStatusCheckIntervalId=null;onLoginSuccessCallbacks=[];getCliVersion(){return this.cliVersion}getUserAgent(){return ZI(this.cliVersion)}formatTimeRemaining(e){if(e<=0)return"\u5DF2\u8FC7\u671F";let r=Math.floor(e/1e3),a=Math.floor(r/(24*3600)),i=Math.floor(r%(24*3600)/3600),o=Math.floor(r%3600/60),t=r%60;return a>0?`${a}\u5929${i}\u5C0F\u65F6${o}\u5206\u949F`:i>0?`${i}\u5C0F\u65F6${o}\u5206\u949F${t}\u79D2`:o>0?`${o}\u5206\u949F${t}\u79D2`:`${t}\u79D2`}formatAbsoluteTime(e){return new Date(e).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}constructor(){"https://api-code.deepvlab.ai"?.includes("localhost")?(this.userInfoFilePath=a3.join(Xk.homedir(),".easycode-user","user-info-dev.json"),this.jwtTokenFilePath=a3.join(Xk.homedir(),".easycode-user","jwt-token-dev.json"),this.usageStatsFilePath=a3.join(Xk.homedir(),".easycode-user","usage-stats-dev.json")):(this.userInfoFilePath=a3.join(Xk.homedir(),".easycode-user","user-info.json"),this.jwtTokenFilePath=a3.join(Xk.homedir(),".easycode-user","jwt-token.json"),this.usageStatsFilePath=a3.join(Xk.homedir(),".easycode-user","usage-stats.json")),this.cliVersion="1.1.32",this.config={proxyServerUrl:fE()},this.loadUserInfo(),this.loadJwtToken(),this.loadUsageStats(),this.startPeriodicStatusCheck()}startPeriodicStatusCheck(){this.periodicStatusCheckIntervalId=setInterval(()=>{if(this.jwtTokenData){let e=Date.now(),r=this.jwtTokenData.expiresAt-e,a=this.formatTimeRemaining(r),i=this.formatAbsoluteTime(this.jwtTokenData.expiresAt);if(r>0){let o=this.formatAbsoluteTime(this.jwtTokenData.expiresAt-Mne*1e3);console.log(`[Login Check] \u{1F4CA} Periodic status check - Credential remaining: ${a} (until ${i}), next renewal: ${o}`)}else console.log(`[Login Check] \u26A0\uFE0F Periodic status check - Credential expired at: ${i}`)}},600*1e3)}static getInstance(){return n.instance||(n.instance=new n),n.instance}loadUserInfo(){try{if(ku.existsSync(this.userInfoFilePath)){let e=ku.readFileSync(this.userInfoFilePath,"utf8");this.userInfo=JSON.parse(e);let r=a=>{if(!a||!a.includes("@"))return a;let[i,o]=a.split("@");return i.length<=2?a:`${i[0]+"*".repeat(i.length-2)+i[i.length-1]}@${o}`}}}catch(e){console.warn("[Login Check] Failed to load user info from local file:",e),this.userInfo=null}}saveUserInfo(){try{let e=a3.dirname(this.userInfoFilePath);ku.existsSync(e)||ku.mkdirSync(e,{recursive:!0}),ku.writeFileSync(this.userInfoFilePath,JSON.stringify(this.userInfo,null,2)),console.log("[Login Check] User info saved to local file")}catch(e){console.error("[Login Check] Failed to save user info:",e)}}loadJwtToken(){try{if(ku.existsSync(this.jwtTokenFilePath)){let e=ku.readFileSync(this.jwtTokenFilePath,"utf8");this.jwtTokenData=JSON.parse(e);let r=Date.now();this.isTokenExpired()?this.jwtTokenData=null:this.isTokenNearExpiry(300)&&console.log("\u26A0\uFE0F Access credential expiring soon, auto-renewal in progress")}else console.log("[Login Check] No stored access credential found, authentication required")}catch(e){console.warn("[Login Check] Failed to load access credential from local file:",e),this.jwtTokenData=null}}saveJwtToken(){try{if(!this.jwtTokenData)return;let e=a3.dirname(this.jwtTokenFilePath);ku.existsSync(e)||ku.mkdirSync(e,{recursive:!0}),ku.writeFileSync(this.jwtTokenFilePath,JSON.stringify(this.jwtTokenData,null,2)),console.log("[Login Check] Access credential data saved to local file")}catch(e){console.error("[Login Check] Failed to save access credential:",e)}}loadUsageStats(){try{if(ku.existsSync(this.usageStatsFilePath)){let e=ku.readFileSync(this.usageStatsFilePath,"utf8");this.usageStats=JSON.parse(e)}}catch(e){console.warn("[Login Check] Failed to load usage stats from local file:",e),this.usageStats={totalCreditsConsumed:0,lastUpdated:new Date().toISOString()}}}saveUsageStats(){try{let e=a3.dirname(this.usageStatsFilePath);ku.existsSync(e)||ku.mkdirSync(e,{recursive:!0}),ku.writeFileSync(this.usageStatsFilePath,JSON.stringify(this.usageStats,null,2)),console.log("[Login Check] Usage stats saved to local file")}catch(e){console.error("[Login Check] Failed to save usage stats:",e)}}updateUsageStats(e){e<=0||(this.usageStats.totalCreditsConsumed+=e,this.usageStats.lastUpdated=new Date().toISOString(),this.saveUsageStats(),console.log(`[Usage Stats] Updated total credits consumed: ${this.usageStats.totalCreditsConsumed} (+${e})`))}getUsageStats(){return{...this.usageStats}}checkStartupTokenStatus(){return this.jwtTokenData?{hasToken:!0,isExpired:Date.now()>=this.jwtTokenData.expiresAt,expiresAt:this.jwtTokenData.expiresAt,hasRefreshToken:!!this.jwtTokenData.refreshToken}:{hasToken:!1,isExpired:!0,expiresAt:null,hasRefreshToken:!1}}configure(e){this.config={...this.config,...e},e.userInfo&&(this.userInfo=e.userInfo,this.saveUserInfo(),console.log(`[Login Check] User info configured: ${e.userInfo.name}`)),e.proxyServerUrl&&console.log(`[Login Check] Proxy server URL: ${e.proxyServerUrl}`),e.cliVersion&&(this.cliVersion=e.cliVersion,console.log(`[Login Check] CLI version set: ${e.cliVersion}`))}setUserInfo(e){this.userInfo=e,this.saveUserInfo(),console.log(`[Login Check] User info updated: ${e.name} (${e.email||e.openId||"N/A"})`),this.triggerLoginSuccessCallbacks()}onLoginSuccess(e){this.onLoginSuccessCallbacks.push(e)}triggerLoginSuccessCallbacks(){this.onLoginSuccessCallbacks.forEach(e=>{try{e()}catch(r){console.error("[ProxyAuthManager] Error in login success callback:",r)}})}setCliVersion(e){this.cliVersion=e,console.log(`[Login Check] CLI version updated: ${e}`)}setJwtToken(e){let r=Date.now();this.jwtTokenData={accessToken:e,expiresIn:900,expiresAt:r+900*1e3,savedAt:new Date().toISOString()},this.saveJwtToken(),console.log("[Login Check] Access credential updated")}setJwtTokenData(e){let a=Date.now()+e.expiresIn*1e3;this.jwtTokenData={accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,expiresAt:a,savedAt:new Date().toISOString()},this.saveJwtToken();let i=this.formatTimeRemaining(e.expiresIn*1e3),o=this.formatAbsoluteTime(a),t=this.formatAbsoluteTime(a-Mne*1e3),u=!!e.refreshToken?", will auto-renew":", manual login required";console.log(`[Login Check] Access credential updated - valid for: ${i} (until ${o}), next renewal: ${t}${u}`)}async getAccessToken(){if(!this.jwtTokenData)return console.log("[Login Check] No access credential available, authentication required"),null;let e=Date.now(),r=this.jwtTokenData.expiresAt-e,a=this.formatTimeRemaining(r),i=this.jwtTokenData.expiresAt-Mne*1e3,o=this.formatAbsoluteTime(i);if(this.isTokenNearExpiry()){console.log(`[Login Check] Access credential expiring soon (remaining: ${a}), starting auto-renewal...`);try{return await this.refreshAccessToken()}catch(t){return console.error("[Login Check] Credential renewal failed:",t),null}}return this.jwtTokenData.accessToken}isTokenExpired(){return this.jwtTokenData?Date.now()>=this.jwtTokenData.expiresAt:!0}isTokenNearExpiry(e=Mne){if(!this.jwtTokenData)return!0;let r=this.jwtTokenData.expiresAt-Date.now(),a=r<=e*1e3;if(a){let i=this.formatTimeRemaining(r);console.log(`[Login Check] Credential expiry check: ${i} remaining <= ${e}s threshold, renewal needed: ${a}`)}return a}async refreshAccessToken(){if(this.refreshPromise)return await this.refreshPromise;this.refreshPromise=this.performTokenRefresh();try{return await this.refreshPromise}finally{this.refreshPromise=null}}async performTokenRefresh(){if(!this.jwtTokenData?.refreshToken)throw new Error("No refresh token available");try{console.log("[Login Check] Refreshing access credential...");let e=await fetch(`${this.config.proxyServerUrl}/auth/jwt/refresh`,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":this.getUserAgent()},body:JSON.stringify({refreshToken:this.jwtTokenData.refreshToken})});if(!e.ok){if(e.status===401)throw this.clearTokens(),new Error("Refresh credential expired or invalid - authentication required");let u=await e.text();throw new Error(`Credential refresh failed (${e.status}): ${u}`)}let r=await e.json();if(!r.success||!r.data?.accessToken)throw new Error("Invalid refresh response from server");let a=Date.now(),i=!!r.data.refreshToken;this.jwtTokenData={accessToken:r.data.accessToken,refreshToken:r.data.refreshToken||this.jwtTokenData.refreshToken,expiresIn:r.data.expiresIn||900,expiresAt:a+(r.data.expiresIn||900)*1e3,savedAt:new Date().toISOString()},this.saveJwtToken();let o=this.formatTimeRemaining((r.data.expiresIn||900)*1e3),t=this.formatAbsoluteTime(this.jwtTokenData.expiresAt),s=this.formatAbsoluteTime(this.jwtTokenData.expiresAt-Mne*1e3);return console.log(`[Login Check] \u2705 Credential renewed successfully - valid for: ${o} (until ${t}), next renewal: ${s}${i?" (refresh credential updated)":" (reusing existing refresh credential)"}`),this.jwtTokenData.accessToken}catch(e){throw console.error("[Login Check] Credential refresh error:",e),e}}clearTokens(){this.jwtTokenData=null;try{ku.existsSync(this.jwtTokenFilePath)&&ku.unlinkSync(this.jwtTokenFilePath)}catch(e){console.warn("[Login Check] Failed to delete access credential file:",e)}}getProxyServerUrl(){return this.config.proxyServerUrl}async getUserHeaders(e){let r=await this.getAccessToken(),a=this.getCliVersion(),i=this.getUserAgent(),o={"Content-Type":"application/json","X-Client-Version":a,"User-Agent":i,"X-Session-ID":ov()};return r&&(o.Authorization=`Bearer ${r}`),e&&(o["X-DVCode-Scene"]=e),o}getUserHeadersSync(){let e=this.getCliVersion(),r=this.getUserAgent(),a={"Content-Type":"application/json","X-Client-Version":e,"User-Agent":r,"X-Session-ID":ov()};return this.jwtTokenData?.accessToken&&(a.Authorization=`Bearer ${this.jwtTokenData.accessToken}`),a}getUserInfo(){return this.userInfo}isConfigured(){return!!this.userInfo}getStatus(){return{configured:this.isConfigured(),proxyServerUrl:this.config.proxyServerUrl,hasUserInfo:!!this.userInfo,userInfo:this.userInfo}}clear(){this.userInfo=null,this.jwtTokenData=null,this.periodicStatusCheckIntervalId!==null&&(clearInterval(this.periodicStatusCheckIntervalId),this.periodicStatusCheckIntervalId=null);try{ku.existsSync(this.userInfoFilePath)&&ku.unlinkSync(this.userInfoFilePath)}catch(e){console.warn("[Login Check] Failed to delete user info file:",e)}try{ku.existsSync(this.jwtTokenFilePath)&&ku.unlinkSync(this.jwtTokenFilePath)}catch(e){console.warn("[Login Check] Failed to delete access credential file:",e)}console.log("[Login Check] Authentication cleared")}},xo=qo.getInstance()});import{promises as kk}from"node:fs";import Une from"node:path";import I6n from"os";var lv,Y1e,an,AA=ct(()=>{"use strict";(function(n){n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR"})(lv||(lv={}));Y1e=class{config;logBuffer=[];constructor(e={}){if(this.config={level:lv.INFO,enableConsole:!0,enableFile:!1,maxFileSize:10,maxFiles:5,...e},this.config.enableFile&&!this.config.filePath){let r=new Date().toISOString().slice(0,19).replace(/[:.]/g,"-");this.config.filePath=Une.join(I6n.homedir(),".easycode-user","logs",`deepv-${r}.log`)}}formatMessage(e,r,...a){let i=new Date().toISOString(),o=a.map(t=>typeof t=="object"?JSON.stringify(t,null,2):String(t)).join(" ");return`[${i}] [${e}] ${r} ${o}`.trim()}async writeToFile(e){if(!(!this.config.enableFile||!this.config.filePath))try{await kk.mkdir(Une.dirname(this.config.filePath),{recursive:!0}),await this.rotateLogIfNeeded(),await kk.appendFile(this.config.filePath,e+`
|
|
577
577
|
`,"utf-8")}catch(r){console.error("\u5199\u5165\u65E5\u5FD7\u6587\u4EF6\u5931\u8D25:",r)}}async rotateLogIfNeeded(){if(this.config.filePath)try{if((await kk.stat(this.config.filePath)).size/(1024*1024)>(this.config.maxFileSize||10)){let a=new Date().toISOString().slice(0,19).replace(/[:.]/g,"-"),i=this.config.filePath.replace(".log",`-${a}.log`);await kk.rename(this.config.filePath,i),await this.cleanOldLogs()}}catch(e){e.code!=="ENOENT"&&console.error("\u65E5\u5FD7\u8F6E\u8F6C\u5931\u8D25:",e)}}async cleanOldLogs(){if(this.config.filePath)try{let e=Une.dirname(this.config.filePath),a=(await kk.readdir(e)).filter(t=>t.startsWith("deepv-")&&t.endsWith(".log")).map(t=>({name:t,path:Une.join(e,t),time:kk.stat(Une.join(e,t)).then(s=>s.mtime)})),i=await Promise.all(a.map(async t=>({...t,time:await t.time})));i.sort((t,s)=>s.time.getTime()-t.time.getTime());let o=i.slice(this.config.maxFiles||5);for(let t of o)await kk.unlink(t.path)}catch(e){console.error("\u6E05\u7406\u65E7\u65E5\u5FD7\u5931\u8D25:",e)}}log(e,r,a,...i){if(e<this.config.level)return;let o=this.formatMessage(r,a,...i);this.config.enableConsole&&(e>=lv.ERROR?console.error:e>=lv.WARN?console.warn:e>=lv.INFO?console.log:console.debug)(o),this.config.enableFile&&this.writeToFile(o)}debug(e,...r){this.log(lv.DEBUG,"DEBUG",e,...r)}info(e,...r){this.log(lv.INFO,"INFO",e,...r)}warn(e,...r){this.log(lv.WARN,"WARN",e,...r)}error(e,...r){this.log(lv.ERROR,"ERROR",e,...r)}logApiRequest(e,r){this.debug("API\u8BF7\u6C42",{endpoint:e,timestamp:new Date().toISOString(),requestSize:JSON.stringify(r).length,...process.env.FILE_DEBUG==="1"?{requestData:r}:{}})}logApiResponse(e,r){this.debug("API\u54CD\u5E94",{endpoint:e,timestamp:new Date().toISOString(),responseSize:JSON.stringify(r).length,...process.env.FILE_DEBUG==="1"?{responseData:r}:{}})}},an=new Y1e({level:process.env.FILE_DEBUG==="1"?lv.DEBUG:lv.INFO,enableConsole:!0,enableFile:process.env.LOG_TO_FILE==="true",filePath:process.env.LOG_FILE_PATH})});function Cc(n){return n instanceof Error&&"code"in n}function gn(n){if(n instanceof Error)return n.message;try{return String(n)}catch{return"Failed to get error details"}}function eUe(n){if(n&&typeof n=="object"&&"response"in n){let r=h6n(n);if(r.error&&r.error.message&&r.error.code)switch(r.error.code){case 400:return new Q1e(r.error.message);case 401:return new Xd(r.error.message);case 403:return new V1e(r.error.message);default:}}return n}function h6n(n){return typeof n.response?.data=="string"?JSON.parse(n.response?.data):n.response?.data}function Sk(n){if(!n)return!1;try{let e=JSON.parse(n);return e&&e.error==="Unauthorized"&&e.errorCode==="AUTHENTICATION_FAILED"}catch{return!1}}var V1e,Xd,Q1e,zc=ct(()=>{"use strict";V1e=class extends Error{},Xd=class extends Error{},Q1e=class extends Error{}});var Ga,DOt,NI,cv=ct(()=>{"use strict";(function(n){n.CHAT_CONVERSATION="chat_conversation",n.WEB_FETCH="web_fetch",n.WEB_SEARCH="web_search",n.CONTENT_SUMMARY="content_summary",n.JSON_GENERATION="json_generation",n.COMPRESSION="compression",n.SUB_AGENT="sub_agent",n.CODE_ASSIST="code_assist",n.EDIT_CORRECTION="edit_correction",n.IMAGE_READER="image_reader",n.GOAL_EVALUATION="goal_evaluation"})(Ga||(Ga={}));DOt={[Ga.CHAT_CONVERSATION]:"auto",[Ga.WEB_FETCH]:"gemini-2.5-flash",[Ga.WEB_SEARCH]:"gemini-2.5-flash",[Ga.CODE_ASSIST]:"auto",[Ga.CONTENT_SUMMARY]:"gemini-2.5-flash-lite",[Ga.EDIT_CORRECTION]:"gemini-2.5-flash-lite",[Ga.JSON_GENERATION]:"gemini-2.5-flash",[Ga.COMPRESSION]:"gemini-2.5-flash",[Ga.SUB_AGENT]:"auto",[Ga.IMAGE_READER]:"gemini-2.5-flash",[Ga.GOAL_EVALUATION]:"deepseek-v4-flash"},NI=class{static getModelForScene(e){if(e)return DOt[e]}static isClaudeModel(e){return e.includes("claude")||e.includes("anthropic")}static isGeminiModel(e){return e.includes("gemini")&&!this.isClaudeModel(e)}static getSceneDisplayName(e){return{[Ga.CHAT_CONVERSATION]:"\u804A\u5929\u5BF9\u8BDD",[Ga.WEB_FETCH]:"Web\u5185\u5BB9\u83B7\u53D6",[Ga.WEB_SEARCH]:"Web\u641C\u7D22",[Ga.CODE_ASSIST]:"\u4EE3\u7801\u52A9\u624B",[Ga.CONTENT_SUMMARY]:"\u5185\u5BB9\u6458\u8981",[Ga.EDIT_CORRECTION]:"\u7F16\u8F91\u6821\u6B63",[Ga.JSON_GENERATION]:"JSON\u751F\u6210",[Ga.COMPRESSION]:"\u5BF9\u8BDD\u538B\u7F29",[Ga.SUB_AGENT]:"SubAgent\u5B50\u4EE3\u7406",[Ga.IMAGE_READER]:"\u56FE\u7247\u8BC6\u522B",[Ga.GOAL_EVALUATION]:"\u76EE\u6807\u8FBE\u6210\u8BC4\u4F30"}[e]||e}}});function ZA(n){return typeof n=="object"&&n!==null&&"error"in n&&typeof n.error=="object"&&"message"in n.error}function lb(n){return typeof n=="object"&&n!==null&&"message"in n&&typeof n.message=="string"}function i3(n){let e=r=>r.includes("Quota exceeded for quota metric 'Gemini")&&r.includes("Pro Requests'");if(typeof n=="string")return e(n);if(lb(n))return e(n.message);if(ZA(n))return e(n.error.message);if(n&&typeof n=="object"&&"response"in n){let r=n;if(r.response&&r.response.data){if(typeof r.response.data=="string")return e(r.response.data);if(typeof r.response.data=="object"&&r.response.data!==null&&"error"in r.response.data){let a=r.response.data;return e(a.error?.message||"")}}}return!1}function s3(n){return typeof n=="string"?n.includes("Quota exceeded for quota metric"):lb(n)?n.message.includes("Quota exceeded for quota metric"):ZA(n)?n.error.message.includes("Quota exceeded for quota metric"):!1}function cG(n){if(n&&typeof n=="object"&&"response"in n){let e=n;if(e.response?.status===402&&e.response.data){let r=e.response.data;if(r&&typeof r.error=="string"&&(r.error==="Quota limit exceeded"||r.error==="No quota configuration")&&typeof r.message=="string")return!0}if(e.response?.status===500&&e.response.data){let r=e.response.data;if(r&&typeof r.message=="string"&&r.message.includes("quota exceeded"))return!0}}if(n instanceof Error&&n.message&&(n.message.includes("API request failed (402):")&&(n.message.includes('"error":"Quota limit exceeded"')||n.message.includes('"error":"No quota configuration"'))||n.message.includes("API request failed (500):")&&n.message.includes("quota exceeded")||n.message.includes("Stream API error (500):")&&n.message.includes("quota exceeded")))return!0;if(typeof n=="object"&&n!==null){let e=n;if(e.message&&typeof e.message=="string"&&(e.message.includes("API request failed (402):")&&(e.message.includes('"error":"Quota limit exceeded"')||e.message.includes('"error":"No quota configuration"'))||e.message.includes("API error (402):")&&(e.message.includes('"error":"Quota limit exceeded"')||e.message.includes('"error":"No quota configuration"'))||(e.message.includes("API request failed (500):")||e.message.includes("Stream API error (500):"))&&e.message.includes("quota exceeded"))||(e.error==="Quota limit exceeded"||e.error==="No quota configuration")&&typeof e.message=="string"||e.status===500&&typeof e.message=="string"&&e.message.includes("quota exceeded"))return!0}return typeof n=="string"?n.includes("Quota limit exceeded")||n.includes("No quota configuration")||n.includes("Daily token limit would be exceeded")||n.includes("Daily request limit exceeded")||n.includes("Daily cost limit would be exceeded")||n.includes("500")&&n.includes("quota exceeded"):!1}function _ne(n){let e=null;if(n&&typeof n=="object"&&"response"in n){let r=n;if(r.response?.status===402&&r.response.data)e=r.response.data;else if(r.response?.status===500&&r.response.data){let a=r.response.data;a&&typeof a.message=="string"&&a.message.includes("quota exceeded")&&(e=a)}}else if(typeof n=="object"&&n!==null){let r=n;if(r.message&&typeof r.message=="string"&&(r.message.includes("API request failed (402):")||r.message.includes("API request failed (500):")||r.message.includes("Stream API error (500):"))&&(r.message.includes('"error":"Quota limit exceeded"')||r.message.includes('"error":"No quota configuration"')||r.message.includes("quota exceeded")))try{let a=r.message.match(/\{.*\}$/);a&&(e=JSON.parse(a[0]))}catch{}e||(e=n)}if(!e&&n instanceof Error&&n.message&&(n.message.includes("API request failed (402):")||n.message.includes("API request failed (500):")||n.message.includes("Stream API error (500):"))&&(n.message.includes('"error":"Quota limit exceeded"')||n.message.includes('"error":"No quota configuration"')||n.message.includes("quota exceeded")))try{let r=n.message.match(/\{.*\}$/);r&&(e=JSON.parse(r[0]))}catch{}return e?e.message&&e.message.includes("quota exceeded")?m6n(e):p6n(e):null}function m6n(n){let r=(()=>{try{let c=process.env,m=c.LC_ALL||c.LC_CTYPE||c.LANG||"";return m.toLowerCase().includes("zh")||m.toLowerCase().includes("chinese")}catch{return!1}})(),a="",i="",o="",t="",s=n.message||"",u=s.match(/Role:\s*([^,]+)/);u&&(a=u[1].trim());let I=s.match(/Limit:\s*([^,]+)/);I&&(i=I[1].trim());let d=s.match(/Used:\s*([^,]+)/);d&&(o=d[1].trim());let h=s.match(/Cycle:\s*([^,]+)/);if(h&&(t=h[1].trim()),r){let c=`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
578
578
|
`;return c+=`\u{1F6AB} \u5F53\u524D\u6A21\u578B\u7684\u5FAA\u73AF\u914D\u989D\u5DF2\u7528\u5C3D (Cycle Quota Exceeded)
|
|
579
579
|
`,a&&(c+=`\u{1F464} \u89D2\u8272\u4FE1\u606F: ${a}
|
|
@@ -3765,7 +3765,7 @@ ${a}
|
|
|
3765
3765
|
\u{1F50D} Model Diagnostics: ${n}`),console.log(`\u{1F4CA} Reliability: ${r.capabilities.toolCallReliability}`),console.log(`\u{1F527} Format Tolerance: ${r.capabilities.needsFormatTolerance?"Yes":"No"}`),console.log(`\u{1F504} Max Concurrent Tools: ${r.capabilities.maxConcurrentTools}`),r.warnings.length>0&&(console.log(`
|
|
3766
3766
|
\u26A0\uFE0F Warnings:`),r.warnings.forEach(a=>console.log(` \u2022 ${a}`))),e&&r.recommendations.length>0&&(console.log(`
|
|
3767
3767
|
\u{1F4A1} Recommendations:`),r.recommendations.forEach(a=>console.log(` \u2022 ${a}`))),e&&(console.log(`
|
|
3768
|
-
\u{1F4CB} Full Capabilities:`),console.log(JSON.stringify(r.capabilities,null,2)))}function BGi(n){let e=Cke(n);return e.isSmallModel||e.needsSpecialHandling}function TGi(n){let e=Cke(n);return e.capabilities.toolCallReliability==="high"?"\u2705 Excellent tool calling compatibility":e.capabilities.toolCallReliability==="medium"?"\u{1F7E1} Good compatibility with enhanced error handling":"\u{1F7E0} Limited compatibility - enhanced robustness features active"}var Con=ct(()=>{"use strict";Xce();});import*as KZ from"fs";import*as xke from"path";var JGi,Fme,xon=ct(()=>{"use strict";tm();JGi="healthy-use-reminder.json",Fme=class{projectRoot;stateFilePath;constructor(e){this.projectRoot=e;let r=SG(e);this.stateFilePath=xke.join(r,JGi)}shouldShowReminder(){let r=new Date().getHours();if(!(r>=22||r<6))return this.clearState(),!1;let i=this.loadState();if(!i||i.lastReminderShownAt===0)return!0;let o=2700*1e3;return Date.now()-i.lastReminderShownAt>=o}markReminderShown(){this.saveState({lastReminderShownAt:Date.now()})}clearState(){try{KZ.existsSync(this.stateFilePath)&&KZ.unlinkSync(this.stateFilePath)}catch(e){process.env.DEBUG&&console.error("[HealthyUseReminderState] Failed to clear state:",e)}}loadState(){try{if(!KZ.existsSync(this.stateFilePath))return null;let e=KZ.readFileSync(this.stateFilePath,"utf-8");return JSON.parse(e)}catch(e){return process.env.DEBUG&&console.error("[HealthyUseReminderState] Failed to load state:",e),null}}saveState(e){try{let r=xke.dirname(this.stateFilePath);KZ.existsSync(r)||KZ.mkdirSync(r,{recursive:!0}),KZ.writeFileSync(this.stateFilePath,JSON.stringify(e,null,2),"utf-8")}catch(r){process.env.DEBUG&&console.error("[HealthyUseReminderState] Failed to save state:",r)}}}});var Wwt,Fwt,DGi,OGi,MGi,Yon=ct(()=>{"use strict";Wwt="--- Content from referenced files ---",Fwt="--- End of content ---",DGi=2e3,OGi=2e3,MGi=20});function Qon(...n){return UGi(...n)}function Hon(...n){return _Gi(...n)}function Von(n,e){return n in e}function Ewt(){let n={get(i,o){if(o==="write")return Qon;if(Von(o,i)){let t=i[o];return typeof t=="function"?t.bind(i):t}}},e=new Proxy(process.stdout,n),r={get(i,o){if(o==="write")return Hon;if(Von(o,i)){let t=i[o];return typeof t=="function"?t.bind(i):t}}},a=new Proxy(process.stderr,r);return{stdout:e,stderr:a}}var UGi,_Gi,Xon=ct(()=>{"use strict";UGi=process.stdout.write.bind(process.stdout),_Gi=process.stderr.write.bind(process.stderr)});import{readFile as zGi}from"node:fs/promises";import{fileURLToPath as PGi}from"node:url";import wwt from"node:path";function jGi(){let n=globalThis.import?.meta??void 0;try{let r=typeof import.meta<"u"?import.meta.url:void 0;if(r)return wwt.dirname(PGi(r))}catch{}let e=globalThis.__dirname;return typeof e=="string"?e:process.cwd()}function m5(){return Eme||(Eme=(async()=>"1.1.31")(),Eme)}function qGi(){Eme=void 0}var Eme,Rwt=ct(()=>{"use strict";});import{EventEmitter as KGi}from"node:events";var wme,Cwt,xwt,kon=ct(()=>{"use strict";(function(n){n.ApprovalModeChanged="approval_mode_changed"})(wme||(wme={}));Cwt=class{emitter=new KGi;on(e,r){return this.emitter.on(e,r),()=>this.emitter.off(e,r)}off(e,r){this.emitter.off(e,r)}emit(e,r){this.emitter.emit(e,r)}removeAllListeners(e){e?this.emitter.removeAllListeners(e):this.emitter.removeAllListeners()}},xwt=new Cwt});function Yke(n){return Array.isArray(n)?n.map(e=>typeof e=="string"?{text:e}:e):typeof n=="string"?[{text:n}]:[n]}function $Gi(n){return n.map(e=>typeof e.text=="string"?e.text:"").join("")}function Ywt(n){if(!n||n.length===0)return[];let e=[];for(let r of n){if(r.role&&(r.parts||r.content!==void 0)){let a=r.parts??Yke(r.content);e.push({role:r.role,parts:a});continue}if(!(r.type==="info"||r.type==="error"||r.type==="warning")){if(r.type==="user"){let a=r.content!==void 0?Yke(r.content):[],i=$Gi(a).trim();if(i.startsWith("/")||i.startsWith("?")||a.length===0)continue;e.push({role:"user",parts:a});continue}if(r.type==="gemini"){let a=[];if(r.thoughts&&r.thoughts.length>0)for(let o of r.thoughts){let t=o.subject?`**${o.subject}** ${o.description}`:o.description;a.push({text:t,thought:!0})}let i=!!r.toolCalls&&r.toolCalls.length>0;if(r.content!==void 0&&a.push(...Yke(r.content)),i)for(let o of r.toolCalls)a.push({functionCall:{name:o.name,args:o.args,...o.id?{id:o.id}:{}}});if(a.length>0&&e.push({role:"model",parts:a}),i){let o=[];for(let t of r.toolCalls)t.result!==void 0&&(typeof t.result=="string"?o.push({functionResponse:{id:t.id,name:t.name,response:{output:t.result}}}):Array.isArray(t.result)?o.push(...Yke(t.result)):o.push(t.result));o.length>0&&e.push({role:"user",parts:o})}}}}return e}var Son=ct(()=>{"use strict";});var $T,Lon,Rme,Bon=ct(()=>{"use strict";$T=class n extends Error{constructor(e){super(e),this.name="SessionError"}static noSessionsFound(){return new n("No persisted sessions found.")}static invalidSessionIdentifier(e,r){return new n(`Session '${e}' was not found under ${r}.`)}},Lon="latest",Rme=class{manager;constructor(e){this.manager=e}async sessionExists(e){return(await this.listAllMetadata()).some(a=>a.sessionId===e)}async listSessions(){return(await this.listAllMetadata()).map(r=>({id:r.sessionId,startTime:r.createdAt,title:r.title,messageCount:r.messageCount})).sort((r,a)=>new Date(r.startTime).getTime()-new Date(a.startTime).getTime())}async findSession(e){let r=e.trim(),a=await this.listSessions();if(a.length===0)throw $T.noSessionsFound();let i=a.find(t=>t.id===r);if(i)return i;let o=Number.parseInt(r,10);if(Number.isInteger(o)&&o.toString()===r&&o>0&&o<=a.length)return a[o-1];throw $T.invalidSessionIdentifier(r,"sessions/")}async resolveSession(e){let r=e.trim(),a;if(r===Lon){let o=await this.listSessions();if(o.length===0)throw $T.noSessionsFound();a=o[o.length-1]}else a=await this.findSession(r);let i=await this.manager.loadSession(a.id);if(!i)throw new $T(`Session '${a.id}' exists in index but could not be loaded.`);return{session:a,data:i}}async listAllMetadata(){let e=this.manager;return typeof e.listSessions=="function"?await e.listSessions():typeof e.getSessionIndex=="function"?(await e.getSessionIndex())?.sessions??[]:[]}}});function e1i(n,e,r){return new Vke(n,e,r)}var Vke,Qke,Hke,Ton=ct(()=>{"use strict";Rce();$Y();Vke=class n{tokenManager;baseURL;requestQueue=[];isRefreshing=!1;onAuthenticationRequired;constructor(e,r,a){this.baseURL=e.replace(/\/$/,""),this.tokenManager=r,this.onAuthenticationRequired=a}setAuthenticationRequiredCallback(e){this.onAuthenticationRequired=e}async request(e,r={}){let a=`${this.baseURL}${e}`,i=await this.prepareRequestOptions(r),o=await fetch(a,i);return o.status===401&&this.tokenManager&&(o=await this.handleUnauthorized(a,i)),o}async get(e,r={}){return this.request(e,{...r,method:"GET"})}async post(e,r,a={}){let i={...a,method:"POST",body:r?JSON.stringify(r):void 0};return r&&!a.headers?.["Content-Type"]&&(i.headers={"Content-Type":"application/json",...a.headers}),this.request(e,i)}async put(e,r,a={}){let i={...a,method:"PUT",body:r?JSON.stringify(r):void 0};return r&&!a.headers?.["Content-Type"]&&(i.headers={"Content-Type":"application/json",...a.headers}),this.request(e,i)}async delete(e,r={}){return this.request(e,{...r,method:"DELETE"})}async prepareRequestOptions(e){let r={"User-Agent":ZI(),...e.headers};if(this.tokenManager)try{let a=await this.tokenManager.getAccessToken();a?r.Authorization=`Bearer ${a}`:P4("warn","\u26A0\uFE0F No access token available")}catch(a){P4("warn","\u26A0\uFE0F Failed to get access token:",a),this.onAuthenticationRequired&&a instanceof Error&&a.message?.includes("authentication required")&&(P4("log","\u{1F504} Triggering authentication flow..."),this.onAuthenticationRequired())}return{...e,headers:r}}async handleUnauthorized(e,r){if(this.isRefreshing)return new Promise((a,i)=>{this.requestQueue.push({resolve:a,reject:i,request:()=>fetch(e,r)})});this.isRefreshing=!0;try{P4("log","\u{1F504} Access token expired, attempting refresh...");let a=await this.tokenManager.refreshAccessToken();if(a){P4("log","\u2705 Token refreshed successfully");let i={...r,headers:{...r.headers,Authorization:`Bearer ${a}`}},o=fetch(e,i);return this.processRequestQueue(a),await o}else throw new Error("Failed to refresh token")}catch(a){throw console.error("\u274C Token refresh failed:",a),this.tokenManager.clearTokens?await this.tokenManager.clearTokens():this.tokenManager.clear&&this.tokenManager.clear(),this.rejectRequestQueue(new Error("Authentication required")),this.onAuthenticationRequired&&(P4("log","\u{1F504} Authentication required, triggering auth flow..."),this.onAuthenticationRequired()),new Qke("Authentication required - please re-authenticate")}finally{this.isRefreshing=!1}}processRequestQueue(e){this.requestQueue.splice(0).forEach(({resolve:a,reject:i,request:o})=>{o().then(t=>a(t)).catch(t=>i(t))})}rejectRequestQueue(e){this.requestQueue.splice(0).forEach(({reject:a})=>{a(e)})}static async checkResponse(e){if(!e.ok){let a=await e.text();throw new Hke(`HTTP ${e.status}: ${e.statusText}`,e.status,a)}let r=e.headers.get("content-type");return r&&r.includes("application/json")?await e.json():await e.text()}async requestJson(e,r={}){let a=await this.request(e,r);return n.checkResponse(a)}async postJson(e,r){let a=await this.post(e,r);return n.checkResponse(a)}async putJson(e,r){let a=await this.put(e,r);return n.checkResponse(a)}async getJson(e){let r=await this.get(e);return n.checkResponse(r)}async deleteJson(e){let r=await this.delete(e);return n.checkResponse(r)}},Qke=class extends Error{constructor(e){super(e),this.name="AuthenticationError"}},Hke=class extends Error{status;response;constructor(e,r,a){super(e),this.name="HttpError",this.status=r,this.response=a}}});function t1i(n){return Cme.getInstance(n)}function r1i(n){let e=Cme.getInstance(n);return()=>e.handleAuthenticationRequired()}var Cme,Jon=ct(()=>{"use strict";eV();Cme=class n{static instance=null;config;isAuthenticating=!1;constructor(e={}){this.config={authUrl:"/auth",autoOpenBrowser:!0,...e}}static getInstance(e){return n.instance||(n.instance=new n(e)),n.instance}updateConfig(e){this.config={...this.config,...e}}async handleAuthenticationRequired(){if(this.isAuthenticating){console.log("[AuthNavigator] Authentication already in progress, skipping...");return}this.isAuthenticating=!0;try{console.log("\u{1F510} [AuthNavigator] Authentication required"),qo.getInstance().clear(),this.config.customAuthHandler?(console.log("[AuthNavigator] Using custom authentication handler"),await this.config.customAuthHandler()):await this.handleDefaultAuthentication()}catch(e){console.error("[AuthNavigator] Authentication handling failed:",e)}finally{this.isAuthenticating=!1}}async handleDefaultAuthentication(){console.log("[AuthNavigator] Starting default authentication flow"),typeof process<"u"&&process.argv?await this.handleCLIAuthentication():await this.handleWebAuthentication()}async handleCLIAuthentication(){console.log(""),console.log("\u{1F510} \u8BA4\u8BC1\u5DF2\u8FC7\u671F\uFF0C\u9700\u8981\u91CD\u65B0\u8BA4\u8BC1"),console.log("\u{1F4A1} \u8BF7\u5728CLI\u4E2D\u8F93\u5165 /auth \u547D\u4EE4\u8FDB\u884C\u91CD\u65B0\u8BA4\u8BC1"),console.log("")}async handleWebAuthentication(){if(typeof window<"u"){let a=`${qo.getInstance().getProxyServerUrl()}${this.config.authUrl}`;console.log(`[AuthNavigator] Redirecting to auth page: ${a}`),window.location.href=a}else console.error("[AuthNavigator] Cannot redirect in non-browser environment")}isInProgress(){return this.isAuthenticating}}});function kke(n){let r={authUrl:"https://accounts.deepvlab.ai/login",redirectUri:`http://localhost:${n||7863}/callback?plat=deepvlab`};return new Xke(r)}var Xke,Vwt=ct(()=>{"use strict";Xke=class{config;constructor(e){this.config=e}buildAuthUrl(){let e=`${this.config.authUrl}?redirect_to=${encodeURIComponent(this.config.redirectUri)}&redirect_mode=same_window`;return console.log("\u{1F517} DeepVlab\u8BA4\u8BC1URL:",e),e}handleCallback(e){console.log("\u{1F504} [DeepVlab Auth] \u5904\u7406DeepVlab\u8BA4\u8BC1\u56DE\u8C03"),console.log("\u{1F504} [DeepVlab Auth] \u56DE\u8C03URL:",e.toString());let r=Object.fromEntries(e.searchParams.entries());console.log("\u{1F504} [DeepVlab Auth] \u56DE\u8C03\u53C2\u6570:",r);let a=e.searchParams.get("token"),i=e.searchParams.get("user_id"),o=e.searchParams.get("error");return o?(console.error("\u274C [DeepVlab Auth] \u8BA4\u8BC1\u9519\u8BEF:",o),{success:!1,error:`DeepVlab\u8BA4\u8BC1\u5931\u8D25: ${o}`}):a?i?(console.log("\u{1F389} [DeepVlab Auth] \u83B7\u53D6\u5230JWT Token:",a),console.log("\u{1F389} [DeepVlab Auth] \u83B7\u53D6\u5230User ID:",i),console.log("\u2705 [DeepVlab Auth] DeepVlab\u8BA4\u8BC1\u6210\u529F"),{success:!0,token:a,user_id:i}):(console.error("\u274C [DeepVlab Auth] \u7F3A\u5C11user_id\u53C2\u6570"),{success:!1,error:"DeepVlab\u8BA4\u8BC1\u56DE\u8C03\u4E2D\u7F3A\u5C11user_id\u53C2\u6570"}):(console.error("\u274C [DeepVlab Auth] \u7F3A\u5C11token\u53C2\u6570"),{success:!1,error:"DeepVlab\u8BA4\u8BC1\u56DE\u8C03\u4E2D\u7F3A\u5C11token\u53C2\u6570"})}}});import*as Ske from"fs";import*as Rg from"path";function n1i(){return typeof globalThis.__dirname=="string"?globalThis.__dirname:""}var xme,WH,Qwt=ct(()=>{"use strict";xme=n1i(),WH=class{static cache=new Map;static customBasePath=null;static setBasePath(e){this.customBasePath=e,console.log(`\u{1F4C1} [AuthTemplates] Custom base path set: ${e}`)}static getAuthSelectPage(){return this.loadTemplate("authSelectPage.html")}static getFeishuSuccessPage(){return this.generateFeishuSuccessTemplate()}static getDeepvlabSuccessPage(){return this.generateDeepvlabSuccessTemplate()}static getErrorPage(e){return this.generateErrorTemplate(e)}static loadTemplate(e){if(this.cache.has(e))return this.cache.get(e);try{let r=[];if(this.customBasePath&&(r.push(Rg.join(this.customBasePath,"dist","bundled","auth","login","templates",e)),r.push(Rg.join(this.customBasePath,"bundled","auth","login","templates",e)),r.push(Rg.join(this.customBasePath,"auth","login","templates",e))),xme&&r.push(Rg.join(xme,e)),xme){let o=xme;for(let t=0;t<10;t++)r.push(Rg.join(o,"bundled","auth","login","templates",e)),r.push(Rg.join(o,"bundled",e)),r.push(Rg.join(o,"bundle","login","templates",e)),r.push(Rg.join(o,"auth","login","templates",e)),o=Rg.dirname(o)}if(typeof process<"u"&&process.cwd)try{let o=process.cwd();r.push(Rg.join(o,"bundle","login","templates",e)),r.push(Rg.join(o,"dist","bundled","auth","login","templates",e)),r.push(Rg.join(o,"bundled","auth","login","templates",e)),r.push(Rg.join(o,"auth","login","templates",e))}catch{}let a=null;for(let o of r)try{if(Ske.existsSync(o)){a=o,console.error(`\u2705 [AuthTemplates] Template loaded: ${e} from ${o}`);break}}catch{continue}if(!a){if(console.warn(`\u26A0\uFE0F [AuthTemplates] Template ${e} not found in any location.`),console.warn(` Tried ${r.length} paths. First 5:`),r.slice(0,5).forEach((o,t)=>console.warn(` ${t+1}. ${o}`)),console.warn(` Current dirname: ${xme||"(unavailable - cross-platform build)"}`),console.warn(` Custom base path: ${this.customBasePath||"(not set)"}`),typeof process<"u"&&process.cwd)try{console.warn(` Process cwd: ${process.cwd()}`)}catch{console.warn(" Process cwd: unavailable")}return console.log(`\u2139\uFE0F [AuthTemplates] Using fallback template for ${e}`),this.generateBasicAuthSelectTemplate()}let i=Ske.readFileSync(a,"utf-8");return this.cache.set(e,i),i}catch(r){return console.error(`\u274C [AuthTemplates] Failed to load template ${e}:`,r),this.generateBasicAuthSelectTemplate()}}static generateBasicAuthSelectTemplate(){return`
|
|
3768
|
+
\u{1F4CB} Full Capabilities:`),console.log(JSON.stringify(r.capabilities,null,2)))}function BGi(n){let e=Cke(n);return e.isSmallModel||e.needsSpecialHandling}function TGi(n){let e=Cke(n);return e.capabilities.toolCallReliability==="high"?"\u2705 Excellent tool calling compatibility":e.capabilities.toolCallReliability==="medium"?"\u{1F7E1} Good compatibility with enhanced error handling":"\u{1F7E0} Limited compatibility - enhanced robustness features active"}var Con=ct(()=>{"use strict";Xce();});import*as KZ from"fs";import*as xke from"path";var JGi,Fme,xon=ct(()=>{"use strict";tm();JGi="healthy-use-reminder.json",Fme=class{projectRoot;stateFilePath;constructor(e){this.projectRoot=e;let r=SG(e);this.stateFilePath=xke.join(r,JGi)}shouldShowReminder(){let r=new Date().getHours();if(!(r>=22||r<6))return this.clearState(),!1;let i=this.loadState();if(!i||i.lastReminderShownAt===0)return!0;let o=2700*1e3;return Date.now()-i.lastReminderShownAt>=o}markReminderShown(){this.saveState({lastReminderShownAt:Date.now()})}clearState(){try{KZ.existsSync(this.stateFilePath)&&KZ.unlinkSync(this.stateFilePath)}catch(e){process.env.DEBUG&&console.error("[HealthyUseReminderState] Failed to clear state:",e)}}loadState(){try{if(!KZ.existsSync(this.stateFilePath))return null;let e=KZ.readFileSync(this.stateFilePath,"utf-8");return JSON.parse(e)}catch(e){return process.env.DEBUG&&console.error("[HealthyUseReminderState] Failed to load state:",e),null}}saveState(e){try{let r=xke.dirname(this.stateFilePath);KZ.existsSync(r)||KZ.mkdirSync(r,{recursive:!0}),KZ.writeFileSync(this.stateFilePath,JSON.stringify(e,null,2),"utf-8")}catch(r){process.env.DEBUG&&console.error("[HealthyUseReminderState] Failed to save state:",r)}}}});var Wwt,Fwt,DGi,OGi,MGi,Yon=ct(()=>{"use strict";Wwt="--- Content from referenced files ---",Fwt="--- End of content ---",DGi=2e3,OGi=2e3,MGi=20});function Qon(...n){return UGi(...n)}function Hon(...n){return _Gi(...n)}function Von(n,e){return n in e}function Ewt(){let n={get(i,o){if(o==="write")return Qon;if(Von(o,i)){let t=i[o];return typeof t=="function"?t.bind(i):t}}},e=new Proxy(process.stdout,n),r={get(i,o){if(o==="write")return Hon;if(Von(o,i)){let t=i[o];return typeof t=="function"?t.bind(i):t}}},a=new Proxy(process.stderr,r);return{stdout:e,stderr:a}}var UGi,_Gi,Xon=ct(()=>{"use strict";UGi=process.stdout.write.bind(process.stdout),_Gi=process.stderr.write.bind(process.stderr)});import{readFile as zGi}from"node:fs/promises";import{fileURLToPath as PGi}from"node:url";import wwt from"node:path";function jGi(){let n=globalThis.import?.meta??void 0;try{let r=typeof import.meta<"u"?import.meta.url:void 0;if(r)return wwt.dirname(PGi(r))}catch{}let e=globalThis.__dirname;return typeof e=="string"?e:process.cwd()}function m5(){return Eme||(Eme=(async()=>"1.1.32")(),Eme)}function qGi(){Eme=void 0}var Eme,Rwt=ct(()=>{"use strict";});import{EventEmitter as KGi}from"node:events";var wme,Cwt,xwt,kon=ct(()=>{"use strict";(function(n){n.ApprovalModeChanged="approval_mode_changed"})(wme||(wme={}));Cwt=class{emitter=new KGi;on(e,r){return this.emitter.on(e,r),()=>this.emitter.off(e,r)}off(e,r){this.emitter.off(e,r)}emit(e,r){this.emitter.emit(e,r)}removeAllListeners(e){e?this.emitter.removeAllListeners(e):this.emitter.removeAllListeners()}},xwt=new Cwt});function Yke(n){return Array.isArray(n)?n.map(e=>typeof e=="string"?{text:e}:e):typeof n=="string"?[{text:n}]:[n]}function $Gi(n){return n.map(e=>typeof e.text=="string"?e.text:"").join("")}function Ywt(n){if(!n||n.length===0)return[];let e=[];for(let r of n){if(r.role&&(r.parts||r.content!==void 0)){let a=r.parts??Yke(r.content);e.push({role:r.role,parts:a});continue}if(!(r.type==="info"||r.type==="error"||r.type==="warning")){if(r.type==="user"){let a=r.content!==void 0?Yke(r.content):[],i=$Gi(a).trim();if(i.startsWith("/")||i.startsWith("?")||a.length===0)continue;e.push({role:"user",parts:a});continue}if(r.type==="gemini"){let a=[];if(r.thoughts&&r.thoughts.length>0)for(let o of r.thoughts){let t=o.subject?`**${o.subject}** ${o.description}`:o.description;a.push({text:t,thought:!0})}let i=!!r.toolCalls&&r.toolCalls.length>0;if(r.content!==void 0&&a.push(...Yke(r.content)),i)for(let o of r.toolCalls)a.push({functionCall:{name:o.name,args:o.args,...o.id?{id:o.id}:{}}});if(a.length>0&&e.push({role:"model",parts:a}),i){let o=[];for(let t of r.toolCalls)t.result!==void 0&&(typeof t.result=="string"?o.push({functionResponse:{id:t.id,name:t.name,response:{output:t.result}}}):Array.isArray(t.result)?o.push(...Yke(t.result)):o.push(t.result));o.length>0&&e.push({role:"user",parts:o})}}}}return e}var Son=ct(()=>{"use strict";});var $T,Lon,Rme,Bon=ct(()=>{"use strict";$T=class n extends Error{constructor(e){super(e),this.name="SessionError"}static noSessionsFound(){return new n("No persisted sessions found.")}static invalidSessionIdentifier(e,r){return new n(`Session '${e}' was not found under ${r}.`)}},Lon="latest",Rme=class{manager;constructor(e){this.manager=e}async sessionExists(e){return(await this.listAllMetadata()).some(a=>a.sessionId===e)}async listSessions(){return(await this.listAllMetadata()).map(r=>({id:r.sessionId,startTime:r.createdAt,title:r.title,messageCount:r.messageCount})).sort((r,a)=>new Date(r.startTime).getTime()-new Date(a.startTime).getTime())}async findSession(e){let r=e.trim(),a=await this.listSessions();if(a.length===0)throw $T.noSessionsFound();let i=a.find(t=>t.id===r);if(i)return i;let o=Number.parseInt(r,10);if(Number.isInteger(o)&&o.toString()===r&&o>0&&o<=a.length)return a[o-1];throw $T.invalidSessionIdentifier(r,"sessions/")}async resolveSession(e){let r=e.trim(),a;if(r===Lon){let o=await this.listSessions();if(o.length===0)throw $T.noSessionsFound();a=o[o.length-1]}else a=await this.findSession(r);let i=await this.manager.loadSession(a.id);if(!i)throw new $T(`Session '${a.id}' exists in index but could not be loaded.`);return{session:a,data:i}}async listAllMetadata(){let e=this.manager;return typeof e.listSessions=="function"?await e.listSessions():typeof e.getSessionIndex=="function"?(await e.getSessionIndex())?.sessions??[]:[]}}});function e1i(n,e,r){return new Vke(n,e,r)}var Vke,Qke,Hke,Ton=ct(()=>{"use strict";Rce();$Y();Vke=class n{tokenManager;baseURL;requestQueue=[];isRefreshing=!1;onAuthenticationRequired;constructor(e,r,a){this.baseURL=e.replace(/\/$/,""),this.tokenManager=r,this.onAuthenticationRequired=a}setAuthenticationRequiredCallback(e){this.onAuthenticationRequired=e}async request(e,r={}){let a=`${this.baseURL}${e}`,i=await this.prepareRequestOptions(r),o=await fetch(a,i);return o.status===401&&this.tokenManager&&(o=await this.handleUnauthorized(a,i)),o}async get(e,r={}){return this.request(e,{...r,method:"GET"})}async post(e,r,a={}){let i={...a,method:"POST",body:r?JSON.stringify(r):void 0};return r&&!a.headers?.["Content-Type"]&&(i.headers={"Content-Type":"application/json",...a.headers}),this.request(e,i)}async put(e,r,a={}){let i={...a,method:"PUT",body:r?JSON.stringify(r):void 0};return r&&!a.headers?.["Content-Type"]&&(i.headers={"Content-Type":"application/json",...a.headers}),this.request(e,i)}async delete(e,r={}){return this.request(e,{...r,method:"DELETE"})}async prepareRequestOptions(e){let r={"User-Agent":ZI(),...e.headers};if(this.tokenManager)try{let a=await this.tokenManager.getAccessToken();a?r.Authorization=`Bearer ${a}`:P4("warn","\u26A0\uFE0F No access token available")}catch(a){P4("warn","\u26A0\uFE0F Failed to get access token:",a),this.onAuthenticationRequired&&a instanceof Error&&a.message?.includes("authentication required")&&(P4("log","\u{1F504} Triggering authentication flow..."),this.onAuthenticationRequired())}return{...e,headers:r}}async handleUnauthorized(e,r){if(this.isRefreshing)return new Promise((a,i)=>{this.requestQueue.push({resolve:a,reject:i,request:()=>fetch(e,r)})});this.isRefreshing=!0;try{P4("log","\u{1F504} Access token expired, attempting refresh...");let a=await this.tokenManager.refreshAccessToken();if(a){P4("log","\u2705 Token refreshed successfully");let i={...r,headers:{...r.headers,Authorization:`Bearer ${a}`}},o=fetch(e,i);return this.processRequestQueue(a),await o}else throw new Error("Failed to refresh token")}catch(a){throw console.error("\u274C Token refresh failed:",a),this.tokenManager.clearTokens?await this.tokenManager.clearTokens():this.tokenManager.clear&&this.tokenManager.clear(),this.rejectRequestQueue(new Error("Authentication required")),this.onAuthenticationRequired&&(P4("log","\u{1F504} Authentication required, triggering auth flow..."),this.onAuthenticationRequired()),new Qke("Authentication required - please re-authenticate")}finally{this.isRefreshing=!1}}processRequestQueue(e){this.requestQueue.splice(0).forEach(({resolve:a,reject:i,request:o})=>{o().then(t=>a(t)).catch(t=>i(t))})}rejectRequestQueue(e){this.requestQueue.splice(0).forEach(({reject:a})=>{a(e)})}static async checkResponse(e){if(!e.ok){let a=await e.text();throw new Hke(`HTTP ${e.status}: ${e.statusText}`,e.status,a)}let r=e.headers.get("content-type");return r&&r.includes("application/json")?await e.json():await e.text()}async requestJson(e,r={}){let a=await this.request(e,r);return n.checkResponse(a)}async postJson(e,r){let a=await this.post(e,r);return n.checkResponse(a)}async putJson(e,r){let a=await this.put(e,r);return n.checkResponse(a)}async getJson(e){let r=await this.get(e);return n.checkResponse(r)}async deleteJson(e){let r=await this.delete(e);return n.checkResponse(r)}},Qke=class extends Error{constructor(e){super(e),this.name="AuthenticationError"}},Hke=class extends Error{status;response;constructor(e,r,a){super(e),this.name="HttpError",this.status=r,this.response=a}}});function t1i(n){return Cme.getInstance(n)}function r1i(n){let e=Cme.getInstance(n);return()=>e.handleAuthenticationRequired()}var Cme,Jon=ct(()=>{"use strict";eV();Cme=class n{static instance=null;config;isAuthenticating=!1;constructor(e={}){this.config={authUrl:"/auth",autoOpenBrowser:!0,...e}}static getInstance(e){return n.instance||(n.instance=new n(e)),n.instance}updateConfig(e){this.config={...this.config,...e}}async handleAuthenticationRequired(){if(this.isAuthenticating){console.log("[AuthNavigator] Authentication already in progress, skipping...");return}this.isAuthenticating=!0;try{console.log("\u{1F510} [AuthNavigator] Authentication required"),qo.getInstance().clear(),this.config.customAuthHandler?(console.log("[AuthNavigator] Using custom authentication handler"),await this.config.customAuthHandler()):await this.handleDefaultAuthentication()}catch(e){console.error("[AuthNavigator] Authentication handling failed:",e)}finally{this.isAuthenticating=!1}}async handleDefaultAuthentication(){console.log("[AuthNavigator] Starting default authentication flow"),typeof process<"u"&&process.argv?await this.handleCLIAuthentication():await this.handleWebAuthentication()}async handleCLIAuthentication(){console.log(""),console.log("\u{1F510} \u8BA4\u8BC1\u5DF2\u8FC7\u671F\uFF0C\u9700\u8981\u91CD\u65B0\u8BA4\u8BC1"),console.log("\u{1F4A1} \u8BF7\u5728CLI\u4E2D\u8F93\u5165 /auth \u547D\u4EE4\u8FDB\u884C\u91CD\u65B0\u8BA4\u8BC1"),console.log("")}async handleWebAuthentication(){if(typeof window<"u"){let a=`${qo.getInstance().getProxyServerUrl()}${this.config.authUrl}`;console.log(`[AuthNavigator] Redirecting to auth page: ${a}`),window.location.href=a}else console.error("[AuthNavigator] Cannot redirect in non-browser environment")}isInProgress(){return this.isAuthenticating}}});function kke(n){let r={authUrl:"https://accounts.deepvlab.ai/login",redirectUri:`http://localhost:${n||7863}/callback?plat=deepvlab`};return new Xke(r)}var Xke,Vwt=ct(()=>{"use strict";Xke=class{config;constructor(e){this.config=e}buildAuthUrl(){let e=`${this.config.authUrl}?redirect_to=${encodeURIComponent(this.config.redirectUri)}&redirect_mode=same_window`;return console.log("\u{1F517} DeepVlab\u8BA4\u8BC1URL:",e),e}handleCallback(e){console.log("\u{1F504} [DeepVlab Auth] \u5904\u7406DeepVlab\u8BA4\u8BC1\u56DE\u8C03"),console.log("\u{1F504} [DeepVlab Auth] \u56DE\u8C03URL:",e.toString());let r=Object.fromEntries(e.searchParams.entries());console.log("\u{1F504} [DeepVlab Auth] \u56DE\u8C03\u53C2\u6570:",r);let a=e.searchParams.get("token"),i=e.searchParams.get("user_id"),o=e.searchParams.get("error");return o?(console.error("\u274C [DeepVlab Auth] \u8BA4\u8BC1\u9519\u8BEF:",o),{success:!1,error:`DeepVlab\u8BA4\u8BC1\u5931\u8D25: ${o}`}):a?i?(console.log("\u{1F389} [DeepVlab Auth] \u83B7\u53D6\u5230JWT Token:",a),console.log("\u{1F389} [DeepVlab Auth] \u83B7\u53D6\u5230User ID:",i),console.log("\u2705 [DeepVlab Auth] DeepVlab\u8BA4\u8BC1\u6210\u529F"),{success:!0,token:a,user_id:i}):(console.error("\u274C [DeepVlab Auth] \u7F3A\u5C11user_id\u53C2\u6570"),{success:!1,error:"DeepVlab\u8BA4\u8BC1\u56DE\u8C03\u4E2D\u7F3A\u5C11user_id\u53C2\u6570"}):(console.error("\u274C [DeepVlab Auth] \u7F3A\u5C11token\u53C2\u6570"),{success:!1,error:"DeepVlab\u8BA4\u8BC1\u56DE\u8C03\u4E2D\u7F3A\u5C11token\u53C2\u6570"})}}});import*as Ske from"fs";import*as Rg from"path";function n1i(){return typeof globalThis.__dirname=="string"?globalThis.__dirname:""}var xme,WH,Qwt=ct(()=>{"use strict";xme=n1i(),WH=class{static cache=new Map;static customBasePath=null;static setBasePath(e){this.customBasePath=e,console.log(`\u{1F4C1} [AuthTemplates] Custom base path set: ${e}`)}static getAuthSelectPage(){return this.loadTemplate("authSelectPage.html")}static getFeishuSuccessPage(){return this.generateFeishuSuccessTemplate()}static getDeepvlabSuccessPage(){return this.generateDeepvlabSuccessTemplate()}static getErrorPage(e){return this.generateErrorTemplate(e)}static loadTemplate(e){if(this.cache.has(e))return this.cache.get(e);try{let r=[];if(this.customBasePath&&(r.push(Rg.join(this.customBasePath,"dist","bundled","auth","login","templates",e)),r.push(Rg.join(this.customBasePath,"bundled","auth","login","templates",e)),r.push(Rg.join(this.customBasePath,"auth","login","templates",e))),xme&&r.push(Rg.join(xme,e)),xme){let o=xme;for(let t=0;t<10;t++)r.push(Rg.join(o,"bundled","auth","login","templates",e)),r.push(Rg.join(o,"bundled",e)),r.push(Rg.join(o,"bundle","login","templates",e)),r.push(Rg.join(o,"auth","login","templates",e)),o=Rg.dirname(o)}if(typeof process<"u"&&process.cwd)try{let o=process.cwd();r.push(Rg.join(o,"bundle","login","templates",e)),r.push(Rg.join(o,"dist","bundled","auth","login","templates",e)),r.push(Rg.join(o,"bundled","auth","login","templates",e)),r.push(Rg.join(o,"auth","login","templates",e))}catch{}let a=null;for(let o of r)try{if(Ske.existsSync(o)){a=o,console.error(`\u2705 [AuthTemplates] Template loaded: ${e} from ${o}`);break}}catch{continue}if(!a){if(console.warn(`\u26A0\uFE0F [AuthTemplates] Template ${e} not found in any location.`),console.warn(` Tried ${r.length} paths. First 5:`),r.slice(0,5).forEach((o,t)=>console.warn(` ${t+1}. ${o}`)),console.warn(` Current dirname: ${xme||"(unavailable - cross-platform build)"}`),console.warn(` Custom base path: ${this.customBasePath||"(not set)"}`),typeof process<"u"&&process.cwd)try{console.warn(` Process cwd: ${process.cwd()}`)}catch{console.warn(" Process cwd: unavailable")}return console.log(`\u2139\uFE0F [AuthTemplates] Using fallback template for ${e}`),this.generateBasicAuthSelectTemplate()}let i=Ske.readFileSync(a,"utf-8");return this.cache.set(e,i),i}catch(r){return console.error(`\u274C [AuthTemplates] Failed to load template ${e}:`,r),this.generateBasicAuthSelectTemplate()}}static generateBasicAuthSelectTemplate(){return`
|
|
3769
3769
|
<!DOCTYPE html>
|
|
3770
3770
|
<html>
|
|
3771
3771
|
<head>
|
|
@@ -4946,7 +4946,7 @@ ${m}`),a?o.reset(m):m}function TAi(n,e,r,a={}){if(!$un){$un=!0;let o="Passing li
|
|
|
4946
4946
|
|
|
4947
4947
|
${e}
|
|
4948
4948
|
`:""}`}set message(e){this.#r=e}#i(e){if(!this.#t)return;let r=this.#e,a=MAi(r,this.#t.message);if(a)return(0,ldn.codeFrameColumns)(r,{start:a},{highlightCode:e})}get codeFrame(){return this.#n??=this.#i(!0),this.#n}get rawCodeFrame(){return this.#a??=this.#i(!1),this.#a}},MAi=(n,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:a,line:i,column:o}=r.groups;return i&&o?{line:Number(i),column:Number(o)}:E5t(n,Number(a),{oneBased:!0})},UAi=n=>n.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,a)=>`"${a}"(${OAi(a)})`)});var C5t=Ze((Yco,_Ai)=>{_Ai.exports=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]});var udn=Ze((Vco,zAi)=>{zAi.exports=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]});var ddn=Ze((Qco,PAi)=>{PAi.exports=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]});var hdn=Ze((Hco,Idn)=>{"use strict";var jAi=[].concat(C5t()).concat(udn()),qAi=ddn();Idn.exports=function(n){var e=0;function r(){return e<n.length}function a(v){if(v instanceof RegExp){var G=n.slice(e),A=G.match(v);if(A)return e+=A[0].length,A[0]}else if(n.indexOf(v,e)===e)return e+=v.length,v}function i(){a(/[ ]*/)}function o(){for(var v,G=["WITH","AND","OR","(",")",":","+"],A=0;A<G.length&&(v=a(G[A]),!v);A++);if(v==="+"&&e>1&&n[e-2]===" ")throw new Error("Space before `+`");return v&&{type:"OPERATOR",string:v}}function t(){return a(/[A-Za-z0-9-.]+/)}function s(){var v=t();if(!v)throw new Error("Expected idstring at offset "+e);return v}function u(){if(a("DocumentRef-")){var v=s();return{type:"DOCUMENTREF",string:v}}}function I(){if(a("LicenseRef-")){var v=s();return{type:"LICENSEREF",string:v}}}function d(){var v=e,G=t();if(jAi.indexOf(G)!==-1)return{type:"LICENSE",string:G};if(qAi.indexOf(G)!==-1)return{type:"EXCEPTION",string:G};e=v}function h(){return o()||u()||I()||d()}for(var c=[];r()&&(i(),!!r());){var m=h();if(!m)throw new Error("Unexpected `"+n[e]+"` at offset "+e);c.push(m)}return c}});var pdn=Ze((Xco,mdn)=>{"use strict";mdn.exports=function(n){var e=0;function r(){return e<n.length}function a(){return r()?n[e]:null}function i(){if(!r())throw new Error;e++}function o(G){var A=a();if(A&&A.type==="OPERATOR"&&G===A.string)return i(),A.string}function t(){if(o("WITH")){var G=a();if(G&&G.type==="EXCEPTION")return i(),G.string;throw new Error("Expected exception after `WITH`")}}function s(){var G=e,A="",Z=a();if(Z.type==="DOCUMENTREF"&&(i(),A+="DocumentRef-"+Z.string+":",!o(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(Z=a(),Z.type==="LICENSEREF")return i(),A+="LicenseRef-"+Z.string,{license:A};e=G}function u(){var G=a();if(G&&G.type==="LICENSE"){i();var A={license:G.string};o("+")&&(A.plus=!0);var Z=t();return Z&&(A.exception=Z),A}}function I(){var G=o("(");if(G){var A=m();if(!o(")"))throw new Error("Expected `)`");return A}}function d(){return I()||s()||u()}function h(G,A){return function Z(){var R=A();if(R){if(!o(G))return R;var F=Z();if(!F)throw new Error("Expected expression");return{left:R,conjunction:G.toLowerCase(),right:F}}}}var c=h("AND",d),m=h("OR",c),v=m();if(!v||r())throw new Error("Syntax error");return v}});var x5t=Ze((kco,fdn)=>{"use strict";var KAi=hdn(),$Ai=pdn();fdn.exports=function(n){return $Ai(KAi(n))}});var Wdn=Ze((Sco,Ndn)=>{var eZi=x5t(),tZi=C5t();function V6e(n){try{return eZi(n),!0}catch{return!1}}function Zdn(n,e){var r=e[0].length-n[0].length;return r!==0?r:n[0].toUpperCase().localeCompare(e[0].toUpperCase())}var bdn=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(Zdn),rZi=0,nZi=1,gdn=[function(n){return n.toUpperCase()},function(n){return n.trim()},function(n){return n.replace(/\./g,"")},function(n){return n.replace(/\s+/g,"")},function(n){return n.replace(/\s+/g,"-")},function(n){return n.replace("v","-")},function(n){return n.replace(/,?\s*(\d)/,"-$1")},function(n){return n.replace(/,?\s*(\d)/,"-$1.0")},function(n){return n.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(n){return n.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(n){return n[0].toUpperCase()+n.slice(1)},function(n){return n.replace("/","-")},function(n){return n.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(n){return n.indexOf("3.0")!==-1?n+"-or-later":n+"-only"},function(n){return n+"only"},function(n){return n.replace(/(\d)$/,"-$1.0")},function(n){return n.replace(/(-| )?(\d)$/,"-$2-Clause")},function(n){return n.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(n){return n.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(n){return n.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(n){return n.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(n){return n.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(n){return n.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(n){return"CC-"+n},function(n){return"CC-"+n+"-4.0"},function(n){return n.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(n){return"CC-"+n.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],Y5t=tZi.map(function(n){var e=/^(.*)-\d+\.\d+$/.exec(n);return e?[e[0],e[1]]:[n,null]}).reduce(function(n,e){var r=e[1];return n[r]=n[r]||[],n[r].push(e[0]),n},{}),aZi=Object.keys(Y5t).map(function(e){return[e,Y5t[e]]}).filter(function(e){return e[1].length===1&&e[0]!==null&&e[0]!=="APL"}).map(function(e){return[e[0],e[1][0]]});Y5t=void 0;var Gdn=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(aZi).sort(Zdn),iZi=0,sZi=1,vdn=function(n){for(var e=0;e<gdn.length;e++){var r=gdn[e](n).trim();if(r!==n&&V6e(r))return r}return null},ydn=function(n){for(var e=n.toUpperCase(),r=0;r<Gdn.length;r++){var a=Gdn[r];if(e.indexOf(a[iZi])>-1)return a[sZi]}return null},Adn=function(n,e){for(var r=0;r<bdn.length;r++){var a=bdn[r],i=a[rZi];if(n.indexOf(i)>-1){var o=n.replace(i,a[nZi]),t=e(o);if(t!==null)return t}}return null};Ndn.exports=function(n,e){e=e||{};var r=e.upgrade===void 0?!0:!!e.upgrade;function a(s){return r?oZi(s):s}var i=typeof n=="string"&&n.trim().length!==0;if(!i)throw Error("Invalid argument. Expected non-empty string.");if(n=n.trim(),V6e(n))return a(n);var o=n.replace(/\+$/,"").trim();if(V6e(o))return a(o);var t=vdn(n);return t!==null||(t=Adn(n,function(s){return V6e(s)?s:vdn(s)}),t!==null)||(t=ydn(n),t!==null)||(t=Adn(n,ydn),t!==null)?a(t):null};function oZi(n){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(n)!==-1?n+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(n)!==-1?n.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(n)!==-1?n+"-or-later":n}});var Rdn=Ze((Lco,wdn)=>{var lZi=x5t(),cZi=Wdn(),Fdn='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',uZi=/^SEE LICEN[CS]E IN (.+)$/;function Edn(n,e){return e.slice(0,n.length)===n}function V5t(n){if(n.hasOwnProperty("license")){var e=n.license;return Edn("LicenseRef",e)||Edn("DocumentRef",e)}else return V5t(n.left)||V5t(n.right)}wdn.exports=function(n){var e;try{e=lZi(n)}catch{var r;if(n==="UNLICENSED"||n==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(r=uZi.exec(n))return{validForOldPackages:!0,validForNewPackages:!0,inFile:r[1]};var a={validForOldPackages:!1,validForNewPackages:!1,warnings:[Fdn]};if(n.trim().length!==0){var i=cZi(n);i&&a.warnings.push('license is similar to the valid expression "'+i+'"')}return a}return V5t(e)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[Fdn]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}});var Qdn=Ze(H6e=>{"use strict";Object.defineProperty(H6e,"__esModule",{value:!0});H6e.LRUCache=void 0;var M$=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xdn=new Set,Q5t=typeof process=="object"&&process?process:{},Ydn=(n,e,r,a)=>{typeof Q5t.emitWarning=="function"?Q5t.emitWarning(n,e,r,a):console.error(`[${r}] ${e}: ${n}`)},Q6e=globalThis.AbortController,Cdn=globalThis.AbortSignal;if(typeof Q6e>"u"){Cdn=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(a,i){this._onabort.push(i)}},Q6e=class{constructor(){e()}signal=new Cdn;abort(a){if(!this.signal.aborted){this.signal.reason=a,this.signal.aborted=!0;for(let i of this.signal._onabort)i(a);this.signal.onabort?.(a)}}};let n=Q5t.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,Ydn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var dZi=n=>!xdn.has(n),Jco=Symbol("type"),HH=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),Vdn=n=>HH(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?U$:null:null,U$=class extends Array{constructor(e){super(e),this.fill(0)}},H5t=class n{heap;length;static#e=!1;static create(e){let r=Vdn(e);if(!r)return[];n.#e=!0;let a=new n(e,r);return n.#e=!1,a}constructor(e,r){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},X5t=class n{#e;#t;#r;#n;#a;#i;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#o;#s;#I;#d;#h;#l;#m;#b;#A;#f;#E;#G;#Z;#N;#y;#g;static unsafeExposeInternals(e){return{starts:e.#G,ttls:e.#Z,sizes:e.#E,keyMap:e.#s,keyList:e.#I,valList:e.#d,next:e.#h,prev:e.#l,get head(){return e.#m},get tail(){return e.#b},free:e.#A,isBackgroundFetch:r=>e.#v(r),backgroundFetch:(r,a,i,o)=>e.#x(r,a,i,o),moveToTail:r=>e.#D(r),indexes:r=>e.#L(r),rindexes:r=>e.#V(r),isStale:r=>e.#R(r)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#o}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#i}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:a,ttlResolution:i=1,ttlAutopurge:o,updateAgeOnGet:t,updateAgeOnHas:s,allowStale:u,dispose:I,disposeAfter:d,noDisposeOnSet:h,noUpdateTTL:c,maxSize:m=0,maxEntrySize:v=0,sizeCalculation:G,fetchMethod:A,memoMethod:Z,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:p,ignoreFetchAbort:y}=e;if(r!==0&&!HH(r))throw new TypeError("max option must be a nonnegative integer");let N=r?Vdn(r):Array;if(!N)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=m,this.maxEntrySize=v||this.#t,this.sizeCalculation=G,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Z!==void 0&&typeof Z!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#i=Z,A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=A,this.#y=!!A,this.#s=new Map,this.#I=new Array(r).fill(void 0),this.#d=new Array(r).fill(void 0),this.#h=new N(r),this.#l=new N(r),this.#m=0,this.#b=0,this.#A=H5t.create(r),this.#u=0,this.#o=0,typeof I=="function"&&(this.#r=I),typeof d=="function"?(this.#n=d,this.#f=[]):(this.#n=void 0,this.#f=void 0),this.#N=!!this.#r,this.#g=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!c,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!p,this.ignoreFetchAbort=!!y,this.maxEntrySize!==0){if(this.#t!==0&&!HH(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!HH(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!t,this.updateAgeOnHas=!!s,this.ttlResolution=HH(i)||i===0?i:1,this.ttlAutopurge=!!o,this.ttl=a||0,this.ttl){if(!HH(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#W()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let w="LRU_CACHE_UNBOUNDED";dZi(w)&&(xdn.add(w),Ydn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",w,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#W(){let e=new U$(this.#e),r=new U$(this.#e);this.#Z=e,this.#G=r,this.#H=(o,t,s=M$.now())=>{if(r[o]=t!==0?s:0,e[o]=t,t!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#R(o)&&this.#k(this.#I[o],"expire")},t+1);u.unref&&u.unref()}},this.#w=o=>{r[o]=e[o]!==0?M$.now():0},this.#c=(o,t)=>{if(e[t]){let s=e[t],u=r[t];if(!s||!u)return;o.ttl=s,o.start=u,o.now=a||i();let I=o.now-u;o.remainingTTL=s-I}};let a=0,i=()=>{let o=M$.now();if(this.ttlResolution>0){a=o;let t=setTimeout(()=>a=0,this.ttlResolution);t.unref&&t.unref()}return o};this.getRemainingTTL=o=>{let t=this.#s.get(o);if(t===void 0)return 0;let s=e[t],u=r[t];if(!s||!u)return 1/0;let I=(a||i())-u;return s-I},this.#R=o=>{let t=r[o],s=e[o];return!!s&&!!t&&(a||i())-t>s}}#w=()=>{};#c=()=>{};#H=()=>{};#R=()=>!1;#C(){let e=new U$(this.#e);this.#o=0,this.#E=e,this.#Y=r=>{this.#o-=e[r],e[r]=0},this.#F=(r,a,i,o)=>{if(this.#v(a))return 0;if(!HH(i))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(i=o(a,r),!HH(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#S=(r,a,i)=>{if(e[r]=a,this.#t){let o=this.#t-e[r];for(;this.#o>o;)this.#B(!0)}this.#o+=e[r],i&&(i.entrySize=a,i.totalCalculatedSize=this.#o)}}#Y=e=>{};#S=(e,r,a)=>{};#F=(e,r,a,i)=>{if(a||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#L({allowStale:e=this.allowStale}={}){if(this.#u)for(let r=this.#b;!(!this.#X(r)||((e||!this.#R(r))&&(yield r),r===this.#m));)r=this.#l[r]}*#V({allowStale:e=this.allowStale}={}){if(this.#u)for(let r=this.#m;!(!this.#X(r)||((e||!this.#R(r))&&(yield r),r===this.#b));)r=this.#h[r]}#X(e){return e!==void 0&&this.#s.get(this.#I[e])===e}*entries(){for(let e of this.#L())this.#d[e]!==void 0&&this.#I[e]!==void 0&&!this.#v(this.#d[e])&&(yield[this.#I[e],this.#d[e]])}*rentries(){for(let e of this.#V())this.#d[e]!==void 0&&this.#I[e]!==void 0&&!this.#v(this.#d[e])&&(yield[this.#I[e],this.#d[e]])}*keys(){for(let e of this.#L()){let r=this.#I[e];r!==void 0&&!this.#v(this.#d[e])&&(yield r)}}*rkeys(){for(let e of this.#V()){let r=this.#I[e];r!==void 0&&!this.#v(this.#d[e])&&(yield r)}}*values(){for(let e of this.#L())this.#d[e]!==void 0&&!this.#v(this.#d[e])&&(yield this.#d[e])}*rvalues(){for(let e of this.#V())this.#d[e]!==void 0&&!this.#v(this.#d[e])&&(yield this.#d[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let a of this.#L()){let i=this.#d[a],o=this.#v(i)?i.__staleWhileFetching:i;if(o!==void 0&&e(o,this.#I[a],this))return this.get(this.#I[a],r)}}forEach(e,r=this){for(let a of this.#L()){let i=this.#d[a],o=this.#v(i)?i.__staleWhileFetching:i;o!==void 0&&e.call(r,o,this.#I[a],this)}}rforEach(e,r=this){for(let a of this.#V()){let i=this.#d[a],o=this.#v(i)?i.__staleWhileFetching:i;o!==void 0&&e.call(r,o,this.#I[a],this)}}purgeStale(){let e=!1;for(let r of this.#V({allowStale:!0}))this.#R(r)&&(this.#k(this.#I[r],"expire"),e=!0);return e}info(e){let r=this.#s.get(e);if(r===void 0)return;let a=this.#d[r],i=this.#v(a)?a.__staleWhileFetching:a;if(i===void 0)return;let o={value:i};if(this.#Z&&this.#G){let t=this.#Z[r],s=this.#G[r];if(t&&s){let u=t-(M$.now()-s);o.ttl=u,o.start=Date.now()}}return this.#E&&(o.size=this.#E[r]),o}dump(){let e=[];for(let r of this.#L({allowStale:!0})){let a=this.#I[r],i=this.#d[r],o=this.#v(i)?i.__staleWhileFetching:i;if(o===void 0||a===void 0)continue;let t={value:o};if(this.#Z&&this.#G){t.ttl=this.#Z[r];let s=M$.now()-this.#G[r];t.start=Math.floor(Date.now()-s)}this.#E&&(t.size=this.#E[r]),e.unshift([a,t])}return e}load(e){this.clear();for(let[r,a]of e){if(a.start){let i=Date.now()-a.start;a.start=M$.now()-i}this.set(r,a.value,a)}}set(e,r,a={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:o,noDisposeOnSet:t=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:u}=a,{noUpdateTTL:I=this.noUpdateTTL}=a,d=this.#F(e,r,a.size||0,s);if(this.maxEntrySize&&d>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#k(e,"set"),this;let h=this.#u===0?void 0:this.#s.get(e);if(h===void 0)h=this.#u===0?this.#b:this.#A.length!==0?this.#A.pop():this.#u===this.#e?this.#B(!1):this.#u,this.#I[h]=e,this.#d[h]=r,this.#s.set(e,h),this.#h[this.#b]=h,this.#l[h]=this.#b,this.#b=h,this.#u++,this.#S(h,d,u),u&&(u.set="add"),I=!1;else{this.#D(h);let c=this.#d[h];if(r!==c){if(this.#y&&this.#v(c)){c.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=c;m!==void 0&&!t&&(this.#N&&this.#r?.(m,e,"set"),this.#g&&this.#f?.push([m,e,"set"]))}else t||(this.#N&&this.#r?.(c,e,"set"),this.#g&&this.#f?.push([c,e,"set"]));if(this.#Y(h),this.#S(h,d,u),this.#d[h]=r,u){u.set="replace";let m=c&&this.#v(c)?c.__staleWhileFetching:c;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update")}if(i!==0&&!this.#Z&&this.#W(),this.#Z&&(I||this.#H(h,i,o),u&&this.#c(u,h)),!t&&this.#g&&this.#f){let c=this.#f,m;for(;m=c?.shift();)this.#n?.(...m)}return this}pop(){try{for(;this.#u;){let e=this.#d[this.#m];if(this.#B(!0),this.#v(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#g&&this.#f){let e=this.#f,r;for(;r=e?.shift();)this.#n?.(...r)}}}#B(e){let r=this.#m,a=this.#I[r],i=this.#d[r];return this.#y&&this.#v(i)?i.__abortController.abort(new Error("evicted")):(this.#N||this.#g)&&(this.#N&&this.#r?.(i,a,"evict"),this.#g&&this.#f?.push([i,a,"evict"])),this.#Y(r),e&&(this.#I[r]=void 0,this.#d[r]=void 0,this.#A.push(r)),this.#u===1?(this.#m=this.#b=0,this.#A.length=0):this.#m=this.#h[r],this.#s.delete(a),this.#u--,r}has(e,r={}){let{updateAgeOnHas:a=this.updateAgeOnHas,status:i}=r,o=this.#s.get(e);if(o!==void 0){let t=this.#d[o];if(this.#v(t)&&t.__staleWhileFetching===void 0)return!1;if(this.#R(o))i&&(i.has="stale",this.#c(i,o));else return a&&this.#w(o),i&&(i.has="hit",this.#c(i,o)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:a=this.allowStale}=r,i=this.#s.get(e);if(i===void 0||!a&&this.#R(i))return;let o=this.#d[i];return this.#v(o)?o.__staleWhileFetching:o}#x(e,r,a,i){let o=r===void 0?void 0:this.#d[r];if(this.#v(o))return o;let t=new Q6e,{signal:s}=a;s?.addEventListener("abort",()=>t.abort(s.reason),{signal:t.signal});let u={signal:t.signal,options:a,context:i},I=(G,A=!1)=>{let{aborted:Z}=t.signal,R=a.ignoreFetchAbort&&G!==void 0;if(a.status&&(Z&&!A?(a.status.fetchAborted=!0,a.status.fetchError=t.signal.reason,R&&(a.status.fetchAbortIgnored=!0)):a.status.fetchResolved=!0),Z&&!R&&!A)return h(t.signal.reason);let F=m;return this.#d[r]===m&&(G===void 0?F.__staleWhileFetching?this.#d[r]=F.__staleWhileFetching:this.#k(e,"fetch"):(a.status&&(a.status.fetchUpdated=!0),this.set(e,G,u.options))),G},d=G=>(a.status&&(a.status.fetchRejected=!0,a.status.fetchError=G),h(G)),h=G=>{let{aborted:A}=t.signal,Z=A&&a.allowStaleOnFetchAbort,R=Z||a.allowStaleOnFetchRejection,F=R||a.noDeleteOnFetchRejection,E=m;if(this.#d[r]===m&&(!F||E.__staleWhileFetching===void 0?this.#k(e,"fetch"):Z||(this.#d[r]=E.__staleWhileFetching)),R)return a.status&&E.__staleWhileFetching!==void 0&&(a.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw G},c=(G,A)=>{let Z=this.#a?.(e,o,u);Z&&Z instanceof Promise&&Z.then(R=>G(R===void 0?void 0:R),A),t.signal.addEventListener("abort",()=>{(!a.ignoreFetchAbort||a.allowStaleOnFetchAbort)&&(G(void 0),a.allowStaleOnFetchAbort&&(G=R=>I(R,!0)))})};a.status&&(a.status.fetchDispatched=!0);let m=new Promise(c).then(I,d),v=Object.assign(m,{__abortController:t,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,v,{...u.options,status:void 0}),r=this.#s.get(e)):this.#d[r]=v,v}#v(e){if(!this.#y)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Q6e}async fetch(e,r={}){let{allowStale:a=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:t=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:u=0,sizeCalculation:I=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:c=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:G,forceRefresh:A=!1,status:Z,signal:R}=r;if(!this.#y)return Z&&(Z.fetch="get"),this.get(e,{allowStale:a,updateAgeOnGet:i,noDeleteOnStaleGet:o,status:Z});let F={allowStale:a,updateAgeOnGet:i,noDeleteOnStaleGet:o,ttl:t,noDisposeOnSet:s,size:u,sizeCalculation:I,noUpdateTTL:d,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:c,allowStaleOnFetchAbort:v,ignoreFetchAbort:m,status:Z,signal:R},E=this.#s.get(e);if(E===void 0){Z&&(Z.fetch="miss");let p=this.#x(e,E,F,G);return p.__returned=p}else{let p=this.#d[E];if(this.#v(p)){let f=a&&p.__staleWhileFetching!==void 0;return Z&&(Z.fetch="inflight",f&&(Z.returnedStale=!0)),f?p.__staleWhileFetching:p.__returned=p}let y=this.#R(E);if(!A&&!y)return Z&&(Z.fetch="hit"),this.#D(E),i&&this.#w(E),Z&&this.#c(Z,E),p;let N=this.#x(e,E,F,G),b=N.__staleWhileFetching!==void 0&&a;return Z&&(Z.fetch=y?"stale":"refresh",b&&y&&(Z.returnedStale=!0)),b?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,r={}){let a=await this.fetch(e,r);if(a===void 0)throw new Error("fetch() returned undefined");return a}memo(e,r={}){let a=this.#i;if(!a)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:o,...t}=r,s=this.get(e,t);if(!o&&s!==void 0)return s;let u=a(e,s,{options:t,context:i});return this.set(e,u,t),u}get(e,r={}){let{allowStale:a=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:t}=r,s=this.#s.get(e);if(s!==void 0){let u=this.#d[s],I=this.#v(u);return t&&this.#c(t,s),this.#R(s)?(t&&(t.get="stale"),I?(t&&a&&u.__staleWhileFetching!==void 0&&(t.returnedStale=!0),a?u.__staleWhileFetching:void 0):(o||this.#k(e,"expire"),t&&a&&(t.returnedStale=!0),a?u:void 0)):(t&&(t.get="hit"),I?u.__staleWhileFetching:(this.#D(s),i&&this.#w(s),u))}else t&&(t.get="miss")}#J(e,r){this.#l[r]=e,this.#h[e]=r}#D(e){e!==this.#b&&(e===this.#m?this.#m=this.#h[e]:this.#J(this.#l[e],this.#h[e]),this.#J(this.#b,e),this.#b=e)}delete(e){return this.#k(e,"delete")}#k(e,r){let a=!1;if(this.#u!==0){let i=this.#s.get(e);if(i!==void 0)if(a=!0,this.#u===1)this.#p(r);else{this.#Y(i);let o=this.#d[i];if(this.#v(o)?o.__abortController.abort(new Error("deleted")):(this.#N||this.#g)&&(this.#N&&this.#r?.(o,e,r),this.#g&&this.#f?.push([o,e,r])),this.#s.delete(e),this.#I[i]=void 0,this.#d[i]=void 0,i===this.#b)this.#b=this.#l[i];else if(i===this.#m)this.#m=this.#h[i];else{let t=this.#l[i];this.#h[t]=this.#h[i];let s=this.#h[i];this.#l[s]=this.#l[i]}this.#u--,this.#A.push(i)}}if(this.#g&&this.#f?.length){let i=this.#f,o;for(;o=i?.shift();)this.#n?.(...o)}return a}clear(){return this.#p("delete")}#p(e){for(let r of this.#V({allowStale:!0})){let a=this.#d[r];if(this.#v(a))a.__abortController.abort(new Error("deleted"));else{let i=this.#I[r];this.#N&&this.#r?.(a,i,e),this.#g&&this.#f?.push([a,i,e])}}if(this.#s.clear(),this.#d.fill(void 0),this.#I.fill(void 0),this.#Z&&this.#G&&(this.#Z.fill(0),this.#G.fill(0)),this.#E&&this.#E.fill(0),this.#m=0,this.#b=0,this.#A.length=0,this.#o=0,this.#u=0,this.#g&&this.#f){let r=this.#f,a;for(;a=r?.shift();)this.#n?.(...a)}}};H6e.LRUCache=X5t});var kdn=Ze((Oco,Xdn)=>{"use strict";var ql=(...n)=>n.every(e=>e)?n.join(""):"",W0=n=>n?encodeURIComponent(n):"",Hdn=n=>n.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-"),IZi={sshtemplate:({domain:n,user:e,project:r,committish:a})=>`git@${n}:${e}/${r}.git${ql("#",a)}`,sshurltemplate:({domain:n,user:e,project:r,committish:a})=>`git+ssh://git@${n}/${e}/${r}.git${ql("#",a)}`,edittemplate:({domain:n,user:e,project:r,committish:a,editpath:i,path:o})=>`https://${n}/${e}/${r}${ql("/",i,"/",W0(a||"HEAD"),"/",o)}`,browsetemplate:({domain:n,user:e,project:r,committish:a,treepath:i})=>`https://${n}/${e}/${r}${ql("/",i,"/",W0(a))}`,browsetreetemplate:({domain:n,user:e,project:r,committish:a,treepath:i,path:o,fragment:t,hashformat:s})=>`https://${n}/${e}/${r}/${i}/${W0(a||"HEAD")}/${o}${ql("#",s(t||""))}`,browseblobtemplate:({domain:n,user:e,project:r,committish:a,blobpath:i,path:o,fragment:t,hashformat:s})=>`https://${n}/${e}/${r}/${i}/${W0(a||"HEAD")}/${o}${ql("#",s(t||""))}`,docstemplate:({domain:n,user:e,project:r,treepath:a,committish:i})=>`https://${n}/${e}/${r}${ql("/",a,"/",W0(i))}#readme`,httpstemplate:({auth:n,domain:e,user:r,project:a,committish:i})=>`git+https://${ql(n,"@")}${e}/${r}/${a}.git${ql("#",i)}`,filetemplate:({domain:n,user:e,project:r,committish:a,path:i})=>`https://${n}/${e}/${r}/raw/${W0(a||"HEAD")}/${i}`,shortcuttemplate:({type:n,user:e,project:r,committish:a})=>`${n}:${e}/${r}${ql("#",a)}`,pathtemplate:({user:n,project:e,committish:r})=>`${n}/${e}${ql("#",r)}`,bugstemplate:({domain:n,user:e,project:r})=>`https://${n}/${e}/${r}/issues`,hashformat:Hdn},XH={};XH.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:e,project:r,committish:a,path:i})=>`https://${ql(n,"@")}raw.githubusercontent.com/${e}/${r}/${W0(a||"HEAD")}/${i}`,gittemplate:({auth:n,domain:e,user:r,project:a,committish:i})=>`git://${ql(n,"@")}${e}/${r}/${a}.git${ql("#",i)}`,tarballtemplate:({domain:n,user:e,project:r,committish:a})=>`https://codeload.${n}/${e}/${r}/tar.gz/${W0(a||"HEAD")}`,extract:n=>{let[,e,r,a,i]=n.pathname.split("/",5);if(!(a&&a!=="tree")&&(a||(i=n.hash.slice(1)),r&&r.endsWith(".git")&&(r=r.slice(0,-4)),!(!e||!r)))return{user:e,project:r,committish:i}}};XH.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:e,project:r,committish:a,treepath:i,path:o,editpath:t})=>`https://${n}/${e}/${r}${ql("/",i,"/",W0(a||"HEAD"),"/",o,t)}`,tarballtemplate:({domain:n,user:e,project:r,committish:a})=>`https://${n}/${e}/${r}/get/${W0(a||"HEAD")}.tar.gz`,extract:n=>{let[,e,r,a]=n.pathname.split("/",4);if(!["get"].includes(a)&&(r&&r.endsWith(".git")&&(r=r.slice(0,-4)),!(!e||!r)))return{user:e,project:r,committish:n.hash.slice(1)}}};XH.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:e,user:r,project:a,committish:i})=>`git+https://${ql(n,"@")}${e}/${r}/${a}.git${ql("#",i)}`,tarballtemplate:({domain:n,user:e,project:r,committish:a})=>`https://${n}/${e}/${r}/repository/archive.tar.gz?ref=${W0(a||"HEAD")}`,extract:n=>{let e=n.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let r=e.split("/"),a=r.pop();a.endsWith(".git")&&(a=a.slice(0,-4));let i=r.join("/");if(!(!i||!a))return{user:i,project:a,committish:n.hash.slice(1)}}};XH.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:e,committish:r})=>`git@${n}:${e}.git${ql("#",r)}`,sshurltemplate:({domain:n,project:e,committish:r})=>`git+ssh://git@${n}/${e}.git${ql("#",r)}`,edittemplate:({domain:n,user:e,project:r,committish:a,editpath:i})=>`https://${n}/${e}/${r}${ql("/",W0(a))}/${i}`,browsetemplate:({domain:n,project:e,committish:r})=>`https://${n}/${e}${ql("/",W0(r))}`,browsetreetemplate:({domain:n,project:e,committish:r,path:a,hashformat:i})=>`https://${n}/${e}${ql("/",W0(r))}${ql("#",i(a))}`,browseblobtemplate:({domain:n,project:e,committish:r,path:a,hashformat:i})=>`https://${n}/${e}${ql("/",W0(r))}${ql("#",i(a))}`,docstemplate:({domain:n,project:e,committish:r})=>`https://${n}/${e}${ql("/",W0(r))}`,httpstemplate:({domain:n,project:e,committish:r})=>`git+https://${n}/${e}.git${ql("#",r)}`,filetemplate:({user:n,project:e,committish:r,path:a})=>`https://gist.githubusercontent.com/${n}/${e}/raw${ql("/",W0(r))}/${a}`,shortcuttemplate:({type:n,project:e,committish:r})=>`${n}:${e}${ql("#",r)}`,pathtemplate:({project:n,committish:e})=>`${n}${ql("#",e)}`,bugstemplate:({domain:n,project:e})=>`https://${n}/${e}`,gittemplate:({domain:n,project:e,committish:r})=>`git://${n}/${e}.git${ql("#",r)}`,tarballtemplate:({project:n,committish:e})=>`https://codeload.github.com/gist/${n}/tar.gz/${W0(e||"HEAD")}`,extract:n=>{let[,e,r,a]=n.pathname.split("/",4);if(a!=="raw"){if(!r){if(!e)return;r=e,e=null}return r.endsWith(".git")&&(r=r.slice(0,-4)),{user:e,project:r,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+Hdn(n)}};XH.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:e,project:r,committish:a,path:i})=>`https://${n}/${e}/${r}/blob/${W0(a)||"HEAD"}/${i}`,httpstemplate:({domain:n,user:e,project:r,committish:a})=>`https://${n}/${e}/${r}.git${ql("#",a)}`,tarballtemplate:({domain:n,user:e,project:r,committish:a})=>`https://${n}/${e}/${r}/archive/${W0(a)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,e,r,a]=n.pathname.split("/",4);if(!["archive"].includes(a)&&(r&&r.endsWith(".git")&&(r=r.slice(0,-4)),!(!e||!r)))return{user:e,project:r,committish:n.hash.slice(1)}}};for(let[n,e]of Object.entries(XH))XH[n]=Object.assign({},IZi,e);Xdn.exports=XH});var S5t=Ze((Mco,Ldn)=>{var hZi=Wt("url"),k5t=(n,e,r)=>{let a=n.indexOf(r);return n.lastIndexOf(e,a>-1?a:1/0)},Sdn=n=>{try{return new hZi.URL(n)}catch{}},mZi=(n,e)=>{let r=n.indexOf(":"),a=n.slice(0,r+1);if(Object.prototype.hasOwnProperty.call(e,a))return n;let i=n.indexOf("@");return i>-1?i>r?`git+ssh://${n}`:n:n.indexOf("//")===r+1?n:`${n.slice(0,r+1)}//${n.slice(r+1)}`},pZi=n=>{let e=k5t(n,"@","#"),r=k5t(n,":","#");return r>e&&(n=n.slice(0,r)+"/"+n.slice(r+1)),k5t(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};Ldn.exports=(n,e)=>{let r=e?mZi(n,e):n;return Sdn(r)||Sdn(pZi(r))}});var Tdn=Ze((Uco,Bdn)=>{"use strict";var fZi=S5t(),bZi=n=>{let e=n.indexOf("#"),r=n.indexOf("/"),a=n.indexOf("/",r+1),i=n.indexOf(":"),o=/\s/.exec(n),t=n.indexOf("@"),s=!o||e>-1&&o.index>e,u=t===-1||e>-1&&t>e,I=i===-1||e>-1&&i>e,d=a===-1||e>-1&&a>e,h=r>0,c=e>-1?n[e-1]!=="/":!n.endsWith("/"),m=!n.startsWith(".");return s&&h&&c&&m&&u&&I&&d};Bdn.exports=(n,e,{gitHosts:r,protocols:a})=>{if(!n)return;let i=bZi(n)?`github:${n}`:n,o=fZi(i,a);if(!o)return;let t=r.byShortcut[o.protocol],s=r.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=t||s;if(!u)return;let I=r[t||s],d=null;a[o.protocol]?.auth&&(o.username||o.password)&&(d=`${o.username}${o.password?":"+o.password:""}`);let h=null,c=null,m=null,v=null;try{if(t){let G=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,A=G.indexOf("@");A>-1&&(G=G.slice(A+1));let Z=G.lastIndexOf("/");Z>-1?(c=decodeURIComponent(G.slice(0,Z)),c||(c=null),m=decodeURIComponent(G.slice(Z+1))):m=decodeURIComponent(G),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(h=decodeURIComponent(o.hash.slice(1))),v="shortcut"}else{if(!I.protocols.includes(o.protocol))return;let G=I.extract(o);if(!G)return;c=G.user&&decodeURIComponent(G.user),m=decodeURIComponent(G.project),h=decodeURIComponent(G.committish),v=a[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(G){if(G instanceof URIError)return;throw G}return[u,c,d,m,h,v,e]}});var Ddn=Ze((_co,Jdn)=>{"use strict";var{LRUCache:gZi}=Qdn(),GZi=kdn(),vZi=Tdn(),yZi=S5t(),L5t=new gZi({max:1e3}),X6e=class n{constructor(e,r,a,i,o,t,s={}){Object.assign(this,n.#e[e],{type:e,user:r,auth:a,project:i,committish:o,default:t,opts:s})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,r){n.#e[e]=r,n.#e.byDomain[r.domain]=e,n.#e.byShortcut[`${e}:`]=e,n.#t[`${e}:`]={name:e}}static fromUrl(e,r){if(typeof e!="string")return;let a=e+JSON.stringify(r||{});if(!L5t.has(a)){let i=vZi(e,r,{gitHosts:n.#e,protocols:n.#t});L5t.set(a,i?new n(...i):void 0)}return L5t.get(a)}static parseUrl(e){return yZi(e)}#r(e,r){if(typeof e!="function")return null;let a={...this,...this.opts,...r};a.path||(a.path=""),a.path.startsWith("/")&&(a.path=a.path.slice(1)),a.noCommittish&&(a.committish=null);let i=e(a);return a.noGitPlus&&i.startsWith("git+")?i.slice(4):i}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#r(this.sshtemplate,e)}sshurl(e){return this.#r(this.sshurltemplate,e)}browse(e,...r){return typeof e!="string"?this.#r(this.browsetemplate,e):typeof r[0]!="string"?this.#r(this.browsetreetemplate,{...r[0],path:e}):this.#r(this.browsetreetemplate,{...r[1],fragment:r[0],path:e})}browseFile(e,...r){return typeof r[0]!="string"?this.#r(this.browseblobtemplate,{...r[0],path:e}):this.#r(this.browseblobtemplate,{...r[1],fragment:r[0],path:e})}docs(e){return this.#r(this.docstemplate,e)}bugs(e){return this.#r(this.bugstemplate,e)}https(e){return this.#r(this.httpstemplate,e)}git(e){return this.#r(this.gittemplate,e)}shortcut(e){return this.#r(this.shortcuttemplate,e)}path(e){return this.#r(this.pathtemplate,e)}tarball(e){return this.#r(this.tarballtemplate,{...e,noCommittish:!1})}file(e,r){return this.#r(this.filetemplate,{...r,path:e})}edit(e,r){return this.#r(this.edittemplate,{...r,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}};for(let[n,e]of Object.entries(GZi))X6e.addHost(n,e);Jdn.exports=X6e});var Mdn=Ze((zco,Odn)=>{Odn.exports=AZi;function AZi(n){if(!n||n==="ERROR: No README data found!")return;n=n.trim().split(`
|
|
4949
|
-
`);let e=0;for(;n[e]&&n[e].trim().match(/^(#|$)/);)e++;let r=n.length,a=e+1;for(;a<r&&n[a].trim();)a++;return n.slice(e,a).join(" ").trim()}});var Udn=Ze((Pco,ZZi)=>{ZZi.exports={topLevel:{dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},bugs:{web:"url",name:"url"},script:{server:"start",tests:"test"}}});var jdn=Ze((jco,Pdn)=>{var NZi=lit(),WZi=cit(),FZi=Rdn(),k6e=Ddn(),EZi=Wt("node:module"),wZi=["dependencies","devDependencies","optionalDependencies"],RZi=Mdn(),B5t=Wt("url"),kH=Udn(),_dn=n=>n.includes("@")&&n.indexOf("@")<n.lastIndexOf(".");Pdn.exports={warn:function(){},fixRepositoryField:function(n){if(n.repositories&&(this.warn("repositories"),n.repository=n.repositories[0]),!n.repository)return this.warn("missingRepository");typeof n.repository=="string"&&(n.repository={type:"git",url:n.repository});var e=n.repository.url||"";if(e){var r=k6e.fromUrl(e);r&&(e=n.repository.url=r.getDefaultRepresentation()==="shortcut"?r.https():r.toString())}e.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",e)},fixTypos:function(n){Object.keys(kH.topLevel).forEach(function(e){Object.prototype.hasOwnProperty.call(n,e)&&this.warn("typo",e,kH.topLevel[e])},this)},fixScriptsField:function(n){if(n.scripts){if(typeof n.scripts!="object"){this.warn("nonObjectScripts"),delete n.scripts;return}Object.keys(n.scripts).forEach(function(e){typeof n.scripts[e]!="string"?(this.warn("nonStringScript"),delete n.scripts[e]):kH.script[e]&&!n.scripts[kH.script[e]]&&this.warn("typo",e,kH.script[e],"scripts")},this)}},fixFilesField:function(n){var e=n.files;e&&!Array.isArray(e)?(this.warn("nonArrayFiles"),delete n.files):n.files&&(n.files=n.files.filter(function(r){return!r||typeof r!="string"?(this.warn("invalidFilename",r),!1):!0},this))},fixBinField:function(n){if(n.bin&&typeof n.bin=="string"){var e={},r;(r=n.name.match(/^@[^/]+[/](.*)$/))?e[r[1]]=n.bin:e[n.name]=n.bin,n.bin=e}},fixManField:function(n){n.man&&typeof n.man=="string"&&(n.man=[n.man])},fixBundleDependenciesField:function(n){var e="bundledDependencies",r="bundleDependencies";n[e]&&!n[r]&&(n[r]=n[e],delete n[e]),n[r]&&!Array.isArray(n[r])?(this.warn("nonArrayBundleDependencies"),delete n[r]):n[r]&&(n[r]=n[r].filter(function(a){return!a||typeof a!="string"?(this.warn("nonStringBundleDependency",a),!1):(n.dependencies||(n.dependencies={}),Object.prototype.hasOwnProperty.call(n.dependencies,a)||(this.warn("nonDependencyBundleDependency",a),n.dependencies[a]="*"),!0)},this))},fixDependencies:function(n){kZi(n,this.warn),HZi(n,this.warn),this.fixBundleDependenciesField(n),["dependencies","devDependencies"].forEach(function(e){if(e in n){if(!n[e]||typeof n[e]!="object"){this.warn("nonObjectDependencies",e),delete n[e];return}Object.keys(n[e]).forEach(function(r){var a=n[e][r];typeof a!="string"&&(this.warn("nonStringDependency",r,JSON.stringify(a)),delete n[e][r]);var i=k6e.fromUrl(n[e][r]);i&&(n[e][r]=i.toString())},this)}},this)},fixModulesField:function(n){n.modules&&(this.warn("deprecatedModules"),delete n.modules)},fixKeywordsField:function(n){typeof n.keywords=="string"&&(n.keywords=n.keywords.split(/,\s+/)),n.keywords&&!Array.isArray(n.keywords)?(delete n.keywords,this.warn("nonArrayKeywords")):n.keywords&&(n.keywords=n.keywords.filter(function(e){return typeof e!="string"||!e?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(n,e){var r=!e;if(!n.version)return n.version="",!0;if(!NZi(n.version,r))throw new Error('Invalid version: "'+n.version+'"');return n.version=WZi(n.version,r),!0},fixPeople:function(n){zdn(n,VZi),zdn(n,QZi)},fixNameField:function(n,e){typeof e=="boolean"?e={strict:e}:typeof e>"u"&&(e={});var r=e.strict;if(!n.name&&!r){n.name="";return}if(typeof n.name!="string")throw new Error("name field must be a string.");r||(n.name=n.name.trim()),YZi(n.name,r,e.allowLegacyCase),EZi.builtinModules.includes(n.name)&&this.warn("conflictingName",n.name)},fixDescriptionField:function(n){n.description&&typeof n.description!="string"&&(this.warn("nonStringDescription"),delete n.description),n.readme&&!n.description&&(n.description=RZi(n.readme)),n.description===void 0&&delete n.description,n.description||this.warn("missingDescription")},fixReadmeField:function(n){n.readme||(this.warn("missingReadme"),n.readme="ERROR: No README data found!")},fixBugsField:function(n){if(!n.bugs&&n.repository&&n.repository.url){var e=k6e.fromUrl(n.repository.url);e&&e.bugs()&&(n.bugs={url:e.bugs()})}else if(n.bugs){if(typeof n.bugs=="string")_dn(n.bugs)?n.bugs={email:n.bugs}:B5t.parse(n.bugs).protocol?n.bugs={url:n.bugs}:this.warn("nonEmailUrlBugsString");else{SZi(n.bugs,this.warn);var r=n.bugs;n.bugs={},r.url&&(typeof r.url=="string"&&B5t.parse(r.url).protocol?n.bugs.url=r.url:this.warn("nonUrlBugsUrlField")),r.email&&(typeof r.email=="string"&&_dn(r.email)?n.bugs.email=r.email:this.warn("nonEmailBugsEmailField"))}!n.bugs.email&&!n.bugs.url&&(delete n.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(n){if(!n.homepage&&n.repository&&n.repository.url){var e=k6e.fromUrl(n.repository.url);e&&e.docs()&&(n.homepage=e.docs())}if(n.homepage){if(typeof n.homepage!="string")return this.warn("nonUrlHomepage"),delete n.homepage;B5t.parse(n.homepage).protocol||(n.homepage="http://"+n.homepage)}},fixLicenseField:function(n){let e=n.license||n.licence;if(!e)return this.warn("missingLicense");if(typeof e!="string"||e.length<1||e.trim()==="")return this.warn("invalidLicense");if(!FZi(e).validForNewPackages)return this.warn("invalidLicense")}};function CZi(n){if(n.charAt(0)!=="@")return!1;var e=n.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}function xZi(n){return!n.match(/[/@\s+%:]/)&&n===encodeURIComponent(n)}function YZi(n,e,r){if(n.charAt(0)==="."||!(CZi(n)||xZi(n))||e&&!r&&n!==n.toLowerCase()||n.toLowerCase()==="node_modules"||n.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(n))}function zdn(n,e){return n.author&&(n.author=e(n.author)),["maintainers","contributors"].forEach(function(r){Array.isArray(n[r])&&(n[r]=n[r].map(e))}),n}function VZi(n){if(typeof n=="string")return n;var e=n.name||"",r=n.url||n.web,a=r?" ("+r+")":"",i=n.email||n.mail,o=i?" <"+i+">":"";return e+o+a}function QZi(n){if(typeof n!="string")return n;var e=n.match(/^([^(<]+)/),r=n.match(/\(([^()]+)\)/),a=n.match(/<([^<>]+)>/),i={};return e&&e[0].trim()&&(i.name=e[0].trim()),a&&(i.email=a[1]),r&&(i.url=r[1]),i}function HZi(n){var e=n.optionalDependencies;if(e){var r=n.dependencies||{};Object.keys(e).forEach(function(a){r[a]=e[a]}),n.dependencies=r}}function XZi(n,e,r){if(!n)return{};if(typeof n=="string"&&(n=n.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(n))return n;r("deprecatedArrayDependencies",e);var a={};return n.filter(function(i){return typeof i=="string"}).forEach(function(i){i=i.trim().split(/(:?[@\s><=])/);var o=i.shift(),t=i.join("");t=t.trim(),t=t.replace(/^@/,""),a[o]=t}),a}function kZi(n,e){wZi.forEach(function(r){n[r]&&(n[r]=XZi(n[r],r,e))})}function SZi(n,e){n&&Object.keys(n).forEach(function(r){kH.bugs[r]&&(e("typo",r,kH.bugs[r],"bugs"),n[kH.bugs[r]]=n[r],delete n[r])})}});var qdn=Ze((qco,LZi)=>{LZi.exports={repositories:"'repositories' (plural) Not supported. Please pick one as the 'repository' field",missingRepository:"No repository field.",brokenGitUrl:"Probably broken git url: %s",nonObjectScripts:"scripts must be an object",nonStringScript:"script values must be string commands",nonArrayFiles:"Invalid 'files' member",invalidFilename:"Invalid filename in 'files' list: %s",nonArrayBundleDependencies:"Invalid 'bundleDependencies' list. Must be array of package names",nonStringBundleDependency:"Invalid bundleDependencies member: %s",nonDependencyBundleDependency:"Non-dependency in bundleDependencies: %s",nonObjectDependencies:"%s field must be an object",nonStringDependency:"Invalid dependency: %s %s",deprecatedArrayDependencies:"specifying %s as array is deprecated",deprecatedModules:"modules field is deprecated",nonArrayKeywords:"keywords should be an array of strings",nonStringKeyword:"keywords should be an array of strings",conflictingName:"%s is also the name of a node core module.",nonStringDescription:"'description' field should be a string",missingDescription:"No description",missingReadme:"No README data",missingLicense:"No license field.",nonEmailUrlBugsString:"Bug string field must be url, email, or {email,url}",nonUrlBugsUrlField:"bugs.url field must be a string url. Deleted.",nonEmailBugsEmailField:"bugs.email field must be a string email. Deleted.",emptyNormalizedBugs:"Normalized value of bugs field is an empty object. Deleted.",nonUrlHomepage:"homepage field must be a string url. Deleted.",invalidLicense:"license should be a valid SPDX license expression",typo:"%s should probably be %s."}});var eIn=Ze((Kco,$dn)=>{var Kdn=Wt("util"),T5t=qdn();$dn.exports=function(){var n=Array.prototype.slice.call(arguments,0),e=n.shift();if(e==="typo")return BZi.apply(null,n);var r=T5t[e]?T5t[e]:e+": '%s'";return n.unshift(r),Kdn.format.apply(null,n)};function BZi(n,e,r){return r&&(n=r+"['"+n+"']",e=r+"['"+e+"']"),Kdn.format(T5t.typo,n,e)}});var aIn=Ze(($co,nIn)=>{nIn.exports=tIn;var J5t=jdn();tIn.fixer=J5t;var TZi=eIn(),JZi=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],DZi=["dependencies","people","typos"],D5t=JZi.map(function(n){return rIn(n)+"Field"});D5t=D5t.concat(DZi);function tIn(n,e,r){e===!0&&(e=null,r=!0),r||(r=!1),(!e||n.private)&&(e=function(){}),n.scripts&&n.scripts.install==="node-gyp rebuild"&&!n.scripts.preinstall&&(n.gypfile=!0),J5t.warn=function(){e(TZi.apply(null,arguments))},D5t.forEach(function(a){J5t["fix"+rIn(a)](n,r)}),n._id=n.name+"@"+n.version}function rIn(n){return n.charAt(0).toUpperCase()+n.slice(1)}});var iIn=ct(()=>{});import{fileURLToPath as OZi}from"node:url";function sIn(n){return n instanceof URL?OZi(n):n}var oIn=ct(()=>{iIn()});import MZi from"node:fs/promises";import UZi from"node:path";async function cIn({cwd:n,normalize:e=!0}={}){let r=await MZi.readFile(_Zi(n),"utf8");return zZi(r,e)}var lIn,_Zi,zZi,uIn=ct(()=>{cdn();lIn=St(aIn(),1);oIn();_Zi=n=>UZi.resolve(sIn(n)??".","package.json"),zZi=(n,e)=>{let r=typeof n=="string"?R5t(n):n;return e&&(0,lIn.default)(r),r}});import PZi from"node:path";async function dIn(n){let e=await Qun("package.json",n);if(e)return{packageJson:await cIn({...n,cwd:PZi.dirname(e)}),path:e}}var IIn=ct(()=>{Hun();uIn()});import{fileURLToPath as jZi}from"url";import qZi from"path";async function _$(){if(S6e)return S6e;let n=await dIn({cwd:$Zi});if(n)return S6e=n.packageJson,S6e}var KZi,$Zi,S6e,L6e=ct(()=>{"use strict";IIn();KZi=jZi(import.meta.url),$Zi=qZi.dirname(KZi)});var hIn={};ao(hIn,{getCliVersion:()=>Qx});async function Qx(){let n=await _$();return"1.1.31"}var z$=ct(()=>{"use strict";L6e();});var gRt=Ze((kfo,N0n)=>{N0n.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}});var E0n=Ze((Sfo,F0n)=>{var $Wi=gRt();function W0n(n){this.mode=$Wi.MODE_8BIT_BYTE,this.data=n}W0n.prototype={getLength:function(){return this.data.length},write:function(n){for(var e=0;e<this.data.length;e++)n.put(this.data.charCodeAt(e),8)}};F0n.exports=W0n});var GRt=Ze((Lfo,w0n)=>{var $W={glog:function(n){if(n<1)throw new Error("glog("+n+")");return $W.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return $W.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(F0=0;F0<8;F0++)$W.EXP_TABLE[F0]=1<<F0;var F0;for(F0=8;F0<256;F0++)$W.EXP_TABLE[F0]=$W.EXP_TABLE[F0-4]^$W.EXP_TABLE[F0-5]^$W.EXP_TABLE[F0-6]^$W.EXP_TABLE[F0-8];var F0;for(F0=0;F0<255;F0++)$W.LOG_TABLE[$W.EXP_TABLE[F0]]=F0;var F0;w0n.exports=$W});var vRt=Ze((Bfo,R0n)=>{var yJ=GRt();function sSe(n,e){if(n.length===void 0)throw new Error(n.length+"/"+e);for(var r=0;r<n.length&&n[r]===0;)r++;this.num=new Array(n.length-r+e);for(var a=0;a<n.length-r;a++)this.num[a]=n[a+r]}sSe.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var e=new Array(this.getLength()+n.getLength()-1),r=0;r<this.getLength();r++)for(var a=0;a<n.getLength();a++)e[r+a]^=yJ.gexp(yJ.glog(this.get(r))+yJ.glog(n.get(a)));return new sSe(e,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var e=yJ.glog(this.get(0))-yJ.glog(n.get(0)),r=new Array(this.getLength()),a=0;a<this.getLength();a++)r[a]=this.get(a);for(var i=0;i<n.getLength();i++)r[i]^=yJ.gexp(yJ.glog(n.get(i))+e);return new sSe(r,0).mod(n)}};R0n.exports=sSe});var x0n=Ze((Tfo,C0n)=>{C0n.exports={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7}});var Q0n=Ze((Jfo,V0n)=>{var aN=gRt(),Y0n=vRt(),eFi=GRt(),JH=x0n(),Xf={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){for(var e=n<<10;Xf.getBCHDigit(e)-Xf.getBCHDigit(Xf.G15)>=0;)e^=Xf.G15<<Xf.getBCHDigit(e)-Xf.getBCHDigit(Xf.G15);return(n<<10|e)^Xf.G15_MASK},getBCHTypeNumber:function(n){for(var e=n<<12;Xf.getBCHDigit(e)-Xf.getBCHDigit(Xf.G18)>=0;)e^=Xf.G18<<Xf.getBCHDigit(e)-Xf.getBCHDigit(Xf.G18);return n<<12|e},getBCHDigit:function(n){for(var e=0;n!==0;)e++,n>>>=1;return e},getPatternPosition:function(n){return Xf.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,e,r){switch(n){case JH.PATTERN000:return(e+r)%2===0;case JH.PATTERN001:return e%2===0;case JH.PATTERN010:return r%3===0;case JH.PATTERN011:return(e+r)%3===0;case JH.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2===0;case JH.PATTERN101:return e*r%2+e*r%3===0;case JH.PATTERN110:return(e*r%2+e*r%3)%2===0;case JH.PATTERN111:return(e*r%3+(e+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){for(var e=new Y0n([1],0),r=0;r<n;r++)e=e.multiply(new Y0n([1,eFi.gexp(r)],0));return e},getLengthInBits:function(n,e){if(1<=e&&e<10)switch(n){case aN.MODE_NUMBER:return 10;case aN.MODE_ALPHA_NUM:return 9;case aN.MODE_8BIT_BYTE:return 8;case aN.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(e<27)switch(n){case aN.MODE_NUMBER:return 12;case aN.MODE_ALPHA_NUM:return 11;case aN.MODE_8BIT_BYTE:return 16;case aN.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(e<41)switch(n){case aN.MODE_NUMBER:return 14;case aN.MODE_ALPHA_NUM:return 13;case aN.MODE_8BIT_BYTE:return 16;case aN.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+e)},getLostPoint:function(n){var e=n.getModuleCount(),r=0,a=0,i=0;for(a=0;a<e;a++)for(i=0;i<e;i++){for(var o=0,t=n.isDark(a,i),s=-1;s<=1;s++)if(!(a+s<0||e<=a+s))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||s===0&&u===0||t===n.isDark(a+s,i+u)&&o++;o>5&&(r+=3+o-5)}for(a=0;a<e-1;a++)for(i=0;i<e-1;i++){var I=0;n.isDark(a,i)&&I++,n.isDark(a+1,i)&&I++,n.isDark(a,i+1)&&I++,n.isDark(a+1,i+1)&&I++,(I===0||I===4)&&(r+=3)}for(a=0;a<e;a++)for(i=0;i<e-6;i++)n.isDark(a,i)&&!n.isDark(a,i+1)&&n.isDark(a,i+2)&&n.isDark(a,i+3)&&n.isDark(a,i+4)&&!n.isDark(a,i+5)&&n.isDark(a,i+6)&&(r+=40);for(i=0;i<e;i++)for(a=0;a<e-6;a++)n.isDark(a,i)&&!n.isDark(a+1,i)&&n.isDark(a+2,i)&&n.isDark(a+3,i)&&n.isDark(a+4,i)&&!n.isDark(a+5,i)&&n.isDark(a+6,i)&&(r+=40);var d=0;for(i=0;i<e;i++)for(a=0;a<e;a++)n.isDark(a,i)&&d++;var h=Math.abs(100*d/e/e-50)/5;return r+=h*10,r}};V0n.exports=Xf});var yRt=Ze((Dfo,H0n)=>{H0n.exports={L:1,M:0,Q:3,H:2}});var k0n=Ze((Ofo,X0n)=>{var oSe=yRt();function C5(n,e){this.totalCount=n,this.dataCount=e}C5.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];C5.getRSBlocks=function(n,e){var r=C5.getRsBlockTable(n,e);if(r===void 0)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+e);for(var a=r.length/3,i=[],o=0;o<a;o++)for(var t=r[o*3+0],s=r[o*3+1],u=r[o*3+2],I=0;I<t;I++)i.push(new C5(s,u));return i};C5.getRsBlockTable=function(n,e){switch(e){case oSe.L:return C5.RS_BLOCK_TABLE[(n-1)*4+0];case oSe.M:return C5.RS_BLOCK_TABLE[(n-1)*4+1];case oSe.Q:return C5.RS_BLOCK_TABLE[(n-1)*4+2];case oSe.H:return C5.RS_BLOCK_TABLE[(n-1)*4+3];default:return}};X0n.exports=C5});var B0n=Ze((Mfo,L0n)=>{function S0n(){this.buffer=[],this.length=0}S0n.prototype={get:function(n){var e=Math.floor(n/8);return(this.buffer[e]>>>7-n%8&1)==1},put:function(n,e){for(var r=0;r<e;r++)this.putBit((n>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(n){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++}};L0n.exports=S0n});var O0n=Ze((Ufo,D0n)=>{var tFi=E0n(),DH=Q0n(),rFi=vRt(),T0n=k0n(),J0n=B0n();function x5(n,e){this.typeNumber=n,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}x5.prototype={addData:function(n){var e=new tFi(n);this.dataList.push(e),this.dataCache=null},isDark:function(n,e){if(n<0||this.moduleCount<=n||e<0||this.moduleCount<=e)throw new Error(n+","+e);return this.modules[n][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var n=1;for(n=1;n<40;n++){for(var e=T0n.getRSBlocks(n,this.errorCorrectLevel),r=new J0n,a=0,i=0;i<e.length;i++)a+=e[i].dataCount;for(var o=0;o<this.dataList.length;o++){var t=this.dataList[o];r.put(t.mode,4),r.put(t.getLength(),DH.getLengthInBits(t.mode,n)),t.write(r)}if(r.getLengthInBits()<=a*8)break}this.typeNumber=n}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(n,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var a=0;a<this.moduleCount;a++)this.modules[r][a]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(n,e),this.typeNumber>=7&&this.setupTypeNumber(n),this.dataCache===null&&(this.dataCache=x5.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(n,e){for(var r=-1;r<=7;r++)if(!(n+r<=-1||this.moduleCount<=n+r))for(var a=-1;a<=7;a++)e+a<=-1||this.moduleCount<=e+a||(0<=r&&r<=6&&(a===0||a===6)||0<=a&&a<=6&&(r===0||r===6)||2<=r&&r<=4&&2<=a&&a<=4?this.modules[n+r][e+a]=!0:this.modules[n+r][e+a]=!1)},getBestMaskPattern:function(){for(var n=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var a=DH.getLostPoint(this);(r===0||n>a)&&(n=a,e=r)}return e},createMovieClip:function(n,e,r){var a=n.createEmptyMovieClip(e,r),i=1;this.make();for(var o=0;o<this.modules.length;o++)for(var t=o*i,s=0;s<this.modules[o].length;s++){var u=s*i,I=this.modules[o][s];I&&(a.beginFill(0,100),a.moveTo(u,t),a.lineTo(u+i,t),a.lineTo(u+i,t+i),a.lineTo(u,t+i),a.endFill())}return a},setupTimingPattern:function(){for(var n=8;n<this.moduleCount-8;n++)this.modules[n][6]===null&&(this.modules[n][6]=n%2===0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]===null&&(this.modules[6][e]=e%2===0)},setupPositionAdjustPattern:function(){for(var n=DH.getPatternPosition(this.typeNumber),e=0;e<n.length;e++)for(var r=0;r<n.length;r++){var a=n[e],i=n[r];if(this.modules[a][i]===null)for(var o=-2;o<=2;o++)for(var t=-2;t<=2;t++)Math.abs(o)===2||Math.abs(t)===2||o===0&&t===0?this.modules[a+o][i+t]=!0:this.modules[a+o][i+t]=!1}},setupTypeNumber:function(n){for(var e=DH.getBCHTypeNumber(this.typeNumber),r,a=0;a<18;a++)r=!n&&(e>>a&1)===1,this.modules[Math.floor(a/3)][a%3+this.moduleCount-8-3]=r;for(var i=0;i<18;i++)r=!n&&(e>>i&1)===1,this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r},setupTypeInfo:function(n,e){for(var r=this.errorCorrectLevel<<3|e,a=DH.getBCHTypeInfo(r),i,o=0;o<15;o++)i=!n&&(a>>o&1)===1,o<6?this.modules[o][8]=i:o<8?this.modules[o+1][8]=i:this.modules[this.moduleCount-15+o][8]=i;for(var t=0;t<15;t++)i=!n&&(a>>t&1)===1,t<8?this.modules[8][this.moduleCount-t-1]=i:t<9?this.modules[8][15-t-1+1]=i:this.modules[8][15-t-1]=i;this.modules[this.moduleCount-8][8]=!n},mapData:function(n,e){for(var r=-1,a=this.moduleCount-1,i=7,o=0,t=this.moduleCount-1;t>0;t-=2)for(t===6&&t--;;){for(var s=0;s<2;s++)if(this.modules[a][t-s]===null){var u=!1;o<n.length&&(u=(n[o]>>>i&1)===1);var I=DH.getMask(e,a,t-s);I&&(u=!u),this.modules[a][t-s]=u,i--,i===-1&&(o++,i=7)}if(a+=r,a<0||this.moduleCount<=a){a-=r,r=-r;break}}}};x5.PAD0=236;x5.PAD1=17;x5.createData=function(n,e,r){for(var a=T0n.getRSBlocks(n,e),i=new J0n,o=0;o<r.length;o++){var t=r[o];i.put(t.mode,4),i.put(t.getLength(),DH.getLengthInBits(t.mode,n)),t.write(i)}for(var s=0,u=0;u<a.length;u++)s+=a[u].dataCount;if(i.getLengthInBits()>s*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+s*8+")");for(i.getLengthInBits()+4<=s*8&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(!1);for(;!(i.getLengthInBits()>=s*8||(i.put(x5.PAD0,8),i.getLengthInBits()>=s*8));)i.put(x5.PAD1,8);return x5.createBytes(i,a)};x5.createBytes=function(n,e){for(var r=0,a=0,i=0,o=new Array(e.length),t=new Array(e.length),s=0;s<e.length;s++){var u=e[s].dataCount,I=e[s].totalCount-u;a=Math.max(a,u),i=Math.max(i,I),o[s]=new Array(u);for(var d=0;d<o[s].length;d++)o[s][d]=255&n.buffer[d+r];r+=u;var h=DH.getErrorCorrectPolynomial(I),c=new rFi(o[s],h.getLength()-1),m=c.mod(h);t[s]=new Array(h.getLength()-1);for(var v=0;v<t[s].length;v++){var G=v+m.getLength()-t[s].length;t[s][v]=G>=0?m.get(G):0}}for(var A=0,Z=0;Z<e.length;Z++)A+=e[Z].totalCount;for(var R=new Array(A),F=0,E=0;E<a;E++)for(var p=0;p<e.length;p++)E<o[p].length&&(R[F++]=o[p][E]);for(var y=0;y<i;y++)for(var N=0;N<e.length;N++)y<t[N].length&&(R[F++]=t[N][y]);return R};D0n.exports=x5});var _0n=Ze((_fo,U0n)=>{var nFi=O0n(),M0n=yRt(),aFi="\x1B[40m \x1B[0m",lSe="\x1B[47m \x1B[0m",iFi=function(n){return n?aFi:lSe},ARt=function(n){return{times:function(e){return new Array(e).join(n)}}},sFi=function(n,e){for(var r=new Array(n),a=0;a<n;a++)r[a]=e;return r};U0n.exports={error:M0n.L,generate:function(n,e,r){typeof e=="function"&&(r=e,e={});var a=new nFi(-1,this.error);a.addData(n),a.make();var i="";if(e&&e.small){var o=!0,t=!1,s=a.getModuleCount(),u=a.modules.slice(),I=s%2===1;I&&u.push(sFi(s,t));var d={WHITE_ALL:"\u2588",WHITE_BLACK:"\u2580",BLACK_WHITE:"\u2584",BLACK_ALL:" "},h=ARt(d.BLACK_WHITE).times(s+3),c=ARt(d.WHITE_BLACK).times(s+3);i+=h+`
|
|
4949
|
+
`);let e=0;for(;n[e]&&n[e].trim().match(/^(#|$)/);)e++;let r=n.length,a=e+1;for(;a<r&&n[a].trim();)a++;return n.slice(e,a).join(" ").trim()}});var Udn=Ze((Pco,ZZi)=>{ZZi.exports={topLevel:{dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},bugs:{web:"url",name:"url"},script:{server:"start",tests:"test"}}});var jdn=Ze((jco,Pdn)=>{var NZi=lit(),WZi=cit(),FZi=Rdn(),k6e=Ddn(),EZi=Wt("node:module"),wZi=["dependencies","devDependencies","optionalDependencies"],RZi=Mdn(),B5t=Wt("url"),kH=Udn(),_dn=n=>n.includes("@")&&n.indexOf("@")<n.lastIndexOf(".");Pdn.exports={warn:function(){},fixRepositoryField:function(n){if(n.repositories&&(this.warn("repositories"),n.repository=n.repositories[0]),!n.repository)return this.warn("missingRepository");typeof n.repository=="string"&&(n.repository={type:"git",url:n.repository});var e=n.repository.url||"";if(e){var r=k6e.fromUrl(e);r&&(e=n.repository.url=r.getDefaultRepresentation()==="shortcut"?r.https():r.toString())}e.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",e)},fixTypos:function(n){Object.keys(kH.topLevel).forEach(function(e){Object.prototype.hasOwnProperty.call(n,e)&&this.warn("typo",e,kH.topLevel[e])},this)},fixScriptsField:function(n){if(n.scripts){if(typeof n.scripts!="object"){this.warn("nonObjectScripts"),delete n.scripts;return}Object.keys(n.scripts).forEach(function(e){typeof n.scripts[e]!="string"?(this.warn("nonStringScript"),delete n.scripts[e]):kH.script[e]&&!n.scripts[kH.script[e]]&&this.warn("typo",e,kH.script[e],"scripts")},this)}},fixFilesField:function(n){var e=n.files;e&&!Array.isArray(e)?(this.warn("nonArrayFiles"),delete n.files):n.files&&(n.files=n.files.filter(function(r){return!r||typeof r!="string"?(this.warn("invalidFilename",r),!1):!0},this))},fixBinField:function(n){if(n.bin&&typeof n.bin=="string"){var e={},r;(r=n.name.match(/^@[^/]+[/](.*)$/))?e[r[1]]=n.bin:e[n.name]=n.bin,n.bin=e}},fixManField:function(n){n.man&&typeof n.man=="string"&&(n.man=[n.man])},fixBundleDependenciesField:function(n){var e="bundledDependencies",r="bundleDependencies";n[e]&&!n[r]&&(n[r]=n[e],delete n[e]),n[r]&&!Array.isArray(n[r])?(this.warn("nonArrayBundleDependencies"),delete n[r]):n[r]&&(n[r]=n[r].filter(function(a){return!a||typeof a!="string"?(this.warn("nonStringBundleDependency",a),!1):(n.dependencies||(n.dependencies={}),Object.prototype.hasOwnProperty.call(n.dependencies,a)||(this.warn("nonDependencyBundleDependency",a),n.dependencies[a]="*"),!0)},this))},fixDependencies:function(n){kZi(n,this.warn),HZi(n,this.warn),this.fixBundleDependenciesField(n),["dependencies","devDependencies"].forEach(function(e){if(e in n){if(!n[e]||typeof n[e]!="object"){this.warn("nonObjectDependencies",e),delete n[e];return}Object.keys(n[e]).forEach(function(r){var a=n[e][r];typeof a!="string"&&(this.warn("nonStringDependency",r,JSON.stringify(a)),delete n[e][r]);var i=k6e.fromUrl(n[e][r]);i&&(n[e][r]=i.toString())},this)}},this)},fixModulesField:function(n){n.modules&&(this.warn("deprecatedModules"),delete n.modules)},fixKeywordsField:function(n){typeof n.keywords=="string"&&(n.keywords=n.keywords.split(/,\s+/)),n.keywords&&!Array.isArray(n.keywords)?(delete n.keywords,this.warn("nonArrayKeywords")):n.keywords&&(n.keywords=n.keywords.filter(function(e){return typeof e!="string"||!e?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(n,e){var r=!e;if(!n.version)return n.version="",!0;if(!NZi(n.version,r))throw new Error('Invalid version: "'+n.version+'"');return n.version=WZi(n.version,r),!0},fixPeople:function(n){zdn(n,VZi),zdn(n,QZi)},fixNameField:function(n,e){typeof e=="boolean"?e={strict:e}:typeof e>"u"&&(e={});var r=e.strict;if(!n.name&&!r){n.name="";return}if(typeof n.name!="string")throw new Error("name field must be a string.");r||(n.name=n.name.trim()),YZi(n.name,r,e.allowLegacyCase),EZi.builtinModules.includes(n.name)&&this.warn("conflictingName",n.name)},fixDescriptionField:function(n){n.description&&typeof n.description!="string"&&(this.warn("nonStringDescription"),delete n.description),n.readme&&!n.description&&(n.description=RZi(n.readme)),n.description===void 0&&delete n.description,n.description||this.warn("missingDescription")},fixReadmeField:function(n){n.readme||(this.warn("missingReadme"),n.readme="ERROR: No README data found!")},fixBugsField:function(n){if(!n.bugs&&n.repository&&n.repository.url){var e=k6e.fromUrl(n.repository.url);e&&e.bugs()&&(n.bugs={url:e.bugs()})}else if(n.bugs){if(typeof n.bugs=="string")_dn(n.bugs)?n.bugs={email:n.bugs}:B5t.parse(n.bugs).protocol?n.bugs={url:n.bugs}:this.warn("nonEmailUrlBugsString");else{SZi(n.bugs,this.warn);var r=n.bugs;n.bugs={},r.url&&(typeof r.url=="string"&&B5t.parse(r.url).protocol?n.bugs.url=r.url:this.warn("nonUrlBugsUrlField")),r.email&&(typeof r.email=="string"&&_dn(r.email)?n.bugs.email=r.email:this.warn("nonEmailBugsEmailField"))}!n.bugs.email&&!n.bugs.url&&(delete n.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(n){if(!n.homepage&&n.repository&&n.repository.url){var e=k6e.fromUrl(n.repository.url);e&&e.docs()&&(n.homepage=e.docs())}if(n.homepage){if(typeof n.homepage!="string")return this.warn("nonUrlHomepage"),delete n.homepage;B5t.parse(n.homepage).protocol||(n.homepage="http://"+n.homepage)}},fixLicenseField:function(n){let e=n.license||n.licence;if(!e)return this.warn("missingLicense");if(typeof e!="string"||e.length<1||e.trim()==="")return this.warn("invalidLicense");if(!FZi(e).validForNewPackages)return this.warn("invalidLicense")}};function CZi(n){if(n.charAt(0)!=="@")return!1;var e=n.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}function xZi(n){return!n.match(/[/@\s+%:]/)&&n===encodeURIComponent(n)}function YZi(n,e,r){if(n.charAt(0)==="."||!(CZi(n)||xZi(n))||e&&!r&&n!==n.toLowerCase()||n.toLowerCase()==="node_modules"||n.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(n))}function zdn(n,e){return n.author&&(n.author=e(n.author)),["maintainers","contributors"].forEach(function(r){Array.isArray(n[r])&&(n[r]=n[r].map(e))}),n}function VZi(n){if(typeof n=="string")return n;var e=n.name||"",r=n.url||n.web,a=r?" ("+r+")":"",i=n.email||n.mail,o=i?" <"+i+">":"";return e+o+a}function QZi(n){if(typeof n!="string")return n;var e=n.match(/^([^(<]+)/),r=n.match(/\(([^()]+)\)/),a=n.match(/<([^<>]+)>/),i={};return e&&e[0].trim()&&(i.name=e[0].trim()),a&&(i.email=a[1]),r&&(i.url=r[1]),i}function HZi(n){var e=n.optionalDependencies;if(e){var r=n.dependencies||{};Object.keys(e).forEach(function(a){r[a]=e[a]}),n.dependencies=r}}function XZi(n,e,r){if(!n)return{};if(typeof n=="string"&&(n=n.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(n))return n;r("deprecatedArrayDependencies",e);var a={};return n.filter(function(i){return typeof i=="string"}).forEach(function(i){i=i.trim().split(/(:?[@\s><=])/);var o=i.shift(),t=i.join("");t=t.trim(),t=t.replace(/^@/,""),a[o]=t}),a}function kZi(n,e){wZi.forEach(function(r){n[r]&&(n[r]=XZi(n[r],r,e))})}function SZi(n,e){n&&Object.keys(n).forEach(function(r){kH.bugs[r]&&(e("typo",r,kH.bugs[r],"bugs"),n[kH.bugs[r]]=n[r],delete n[r])})}});var qdn=Ze((qco,LZi)=>{LZi.exports={repositories:"'repositories' (plural) Not supported. Please pick one as the 'repository' field",missingRepository:"No repository field.",brokenGitUrl:"Probably broken git url: %s",nonObjectScripts:"scripts must be an object",nonStringScript:"script values must be string commands",nonArrayFiles:"Invalid 'files' member",invalidFilename:"Invalid filename in 'files' list: %s",nonArrayBundleDependencies:"Invalid 'bundleDependencies' list. Must be array of package names",nonStringBundleDependency:"Invalid bundleDependencies member: %s",nonDependencyBundleDependency:"Non-dependency in bundleDependencies: %s",nonObjectDependencies:"%s field must be an object",nonStringDependency:"Invalid dependency: %s %s",deprecatedArrayDependencies:"specifying %s as array is deprecated",deprecatedModules:"modules field is deprecated",nonArrayKeywords:"keywords should be an array of strings",nonStringKeyword:"keywords should be an array of strings",conflictingName:"%s is also the name of a node core module.",nonStringDescription:"'description' field should be a string",missingDescription:"No description",missingReadme:"No README data",missingLicense:"No license field.",nonEmailUrlBugsString:"Bug string field must be url, email, or {email,url}",nonUrlBugsUrlField:"bugs.url field must be a string url. Deleted.",nonEmailBugsEmailField:"bugs.email field must be a string email. Deleted.",emptyNormalizedBugs:"Normalized value of bugs field is an empty object. Deleted.",nonUrlHomepage:"homepage field must be a string url. Deleted.",invalidLicense:"license should be a valid SPDX license expression",typo:"%s should probably be %s."}});var eIn=Ze((Kco,$dn)=>{var Kdn=Wt("util"),T5t=qdn();$dn.exports=function(){var n=Array.prototype.slice.call(arguments,0),e=n.shift();if(e==="typo")return BZi.apply(null,n);var r=T5t[e]?T5t[e]:e+": '%s'";return n.unshift(r),Kdn.format.apply(null,n)};function BZi(n,e,r){return r&&(n=r+"['"+n+"']",e=r+"['"+e+"']"),Kdn.format(T5t.typo,n,e)}});var aIn=Ze(($co,nIn)=>{nIn.exports=tIn;var J5t=jdn();tIn.fixer=J5t;var TZi=eIn(),JZi=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],DZi=["dependencies","people","typos"],D5t=JZi.map(function(n){return rIn(n)+"Field"});D5t=D5t.concat(DZi);function tIn(n,e,r){e===!0&&(e=null,r=!0),r||(r=!1),(!e||n.private)&&(e=function(){}),n.scripts&&n.scripts.install==="node-gyp rebuild"&&!n.scripts.preinstall&&(n.gypfile=!0),J5t.warn=function(){e(TZi.apply(null,arguments))},D5t.forEach(function(a){J5t["fix"+rIn(a)](n,r)}),n._id=n.name+"@"+n.version}function rIn(n){return n.charAt(0).toUpperCase()+n.slice(1)}});var iIn=ct(()=>{});import{fileURLToPath as OZi}from"node:url";function sIn(n){return n instanceof URL?OZi(n):n}var oIn=ct(()=>{iIn()});import MZi from"node:fs/promises";import UZi from"node:path";async function cIn({cwd:n,normalize:e=!0}={}){let r=await MZi.readFile(_Zi(n),"utf8");return zZi(r,e)}var lIn,_Zi,zZi,uIn=ct(()=>{cdn();lIn=St(aIn(),1);oIn();_Zi=n=>UZi.resolve(sIn(n)??".","package.json"),zZi=(n,e)=>{let r=typeof n=="string"?R5t(n):n;return e&&(0,lIn.default)(r),r}});import PZi from"node:path";async function dIn(n){let e=await Qun("package.json",n);if(e)return{packageJson:await cIn({...n,cwd:PZi.dirname(e)}),path:e}}var IIn=ct(()=>{Hun();uIn()});import{fileURLToPath as jZi}from"url";import qZi from"path";async function _$(){if(S6e)return S6e;let n=await dIn({cwd:$Zi});if(n)return S6e=n.packageJson,S6e}var KZi,$Zi,S6e,L6e=ct(()=>{"use strict";IIn();KZi=jZi(import.meta.url),$Zi=qZi.dirname(KZi)});var hIn={};ao(hIn,{getCliVersion:()=>Qx});async function Qx(){let n=await _$();return"1.1.32"}var z$=ct(()=>{"use strict";L6e();});var gRt=Ze((kfo,N0n)=>{N0n.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}});var E0n=Ze((Sfo,F0n)=>{var $Wi=gRt();function W0n(n){this.mode=$Wi.MODE_8BIT_BYTE,this.data=n}W0n.prototype={getLength:function(){return this.data.length},write:function(n){for(var e=0;e<this.data.length;e++)n.put(this.data.charCodeAt(e),8)}};F0n.exports=W0n});var GRt=Ze((Lfo,w0n)=>{var $W={glog:function(n){if(n<1)throw new Error("glog("+n+")");return $W.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return $W.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(F0=0;F0<8;F0++)$W.EXP_TABLE[F0]=1<<F0;var F0;for(F0=8;F0<256;F0++)$W.EXP_TABLE[F0]=$W.EXP_TABLE[F0-4]^$W.EXP_TABLE[F0-5]^$W.EXP_TABLE[F0-6]^$W.EXP_TABLE[F0-8];var F0;for(F0=0;F0<255;F0++)$W.LOG_TABLE[$W.EXP_TABLE[F0]]=F0;var F0;w0n.exports=$W});var vRt=Ze((Bfo,R0n)=>{var yJ=GRt();function sSe(n,e){if(n.length===void 0)throw new Error(n.length+"/"+e);for(var r=0;r<n.length&&n[r]===0;)r++;this.num=new Array(n.length-r+e);for(var a=0;a<n.length-r;a++)this.num[a]=n[a+r]}sSe.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var e=new Array(this.getLength()+n.getLength()-1),r=0;r<this.getLength();r++)for(var a=0;a<n.getLength();a++)e[r+a]^=yJ.gexp(yJ.glog(this.get(r))+yJ.glog(n.get(a)));return new sSe(e,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var e=yJ.glog(this.get(0))-yJ.glog(n.get(0)),r=new Array(this.getLength()),a=0;a<this.getLength();a++)r[a]=this.get(a);for(var i=0;i<n.getLength();i++)r[i]^=yJ.gexp(yJ.glog(n.get(i))+e);return new sSe(r,0).mod(n)}};R0n.exports=sSe});var x0n=Ze((Tfo,C0n)=>{C0n.exports={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7}});var Q0n=Ze((Jfo,V0n)=>{var aN=gRt(),Y0n=vRt(),eFi=GRt(),JH=x0n(),Xf={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){for(var e=n<<10;Xf.getBCHDigit(e)-Xf.getBCHDigit(Xf.G15)>=0;)e^=Xf.G15<<Xf.getBCHDigit(e)-Xf.getBCHDigit(Xf.G15);return(n<<10|e)^Xf.G15_MASK},getBCHTypeNumber:function(n){for(var e=n<<12;Xf.getBCHDigit(e)-Xf.getBCHDigit(Xf.G18)>=0;)e^=Xf.G18<<Xf.getBCHDigit(e)-Xf.getBCHDigit(Xf.G18);return n<<12|e},getBCHDigit:function(n){for(var e=0;n!==0;)e++,n>>>=1;return e},getPatternPosition:function(n){return Xf.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,e,r){switch(n){case JH.PATTERN000:return(e+r)%2===0;case JH.PATTERN001:return e%2===0;case JH.PATTERN010:return r%3===0;case JH.PATTERN011:return(e+r)%3===0;case JH.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2===0;case JH.PATTERN101:return e*r%2+e*r%3===0;case JH.PATTERN110:return(e*r%2+e*r%3)%2===0;case JH.PATTERN111:return(e*r%3+(e+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){for(var e=new Y0n([1],0),r=0;r<n;r++)e=e.multiply(new Y0n([1,eFi.gexp(r)],0));return e},getLengthInBits:function(n,e){if(1<=e&&e<10)switch(n){case aN.MODE_NUMBER:return 10;case aN.MODE_ALPHA_NUM:return 9;case aN.MODE_8BIT_BYTE:return 8;case aN.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(e<27)switch(n){case aN.MODE_NUMBER:return 12;case aN.MODE_ALPHA_NUM:return 11;case aN.MODE_8BIT_BYTE:return 16;case aN.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(e<41)switch(n){case aN.MODE_NUMBER:return 14;case aN.MODE_ALPHA_NUM:return 13;case aN.MODE_8BIT_BYTE:return 16;case aN.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+e)},getLostPoint:function(n){var e=n.getModuleCount(),r=0,a=0,i=0;for(a=0;a<e;a++)for(i=0;i<e;i++){for(var o=0,t=n.isDark(a,i),s=-1;s<=1;s++)if(!(a+s<0||e<=a+s))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||s===0&&u===0||t===n.isDark(a+s,i+u)&&o++;o>5&&(r+=3+o-5)}for(a=0;a<e-1;a++)for(i=0;i<e-1;i++){var I=0;n.isDark(a,i)&&I++,n.isDark(a+1,i)&&I++,n.isDark(a,i+1)&&I++,n.isDark(a+1,i+1)&&I++,(I===0||I===4)&&(r+=3)}for(a=0;a<e;a++)for(i=0;i<e-6;i++)n.isDark(a,i)&&!n.isDark(a,i+1)&&n.isDark(a,i+2)&&n.isDark(a,i+3)&&n.isDark(a,i+4)&&!n.isDark(a,i+5)&&n.isDark(a,i+6)&&(r+=40);for(i=0;i<e;i++)for(a=0;a<e-6;a++)n.isDark(a,i)&&!n.isDark(a+1,i)&&n.isDark(a+2,i)&&n.isDark(a+3,i)&&n.isDark(a+4,i)&&!n.isDark(a+5,i)&&n.isDark(a+6,i)&&(r+=40);var d=0;for(i=0;i<e;i++)for(a=0;a<e;a++)n.isDark(a,i)&&d++;var h=Math.abs(100*d/e/e-50)/5;return r+=h*10,r}};V0n.exports=Xf});var yRt=Ze((Dfo,H0n)=>{H0n.exports={L:1,M:0,Q:3,H:2}});var k0n=Ze((Ofo,X0n)=>{var oSe=yRt();function C5(n,e){this.totalCount=n,this.dataCount=e}C5.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];C5.getRSBlocks=function(n,e){var r=C5.getRsBlockTable(n,e);if(r===void 0)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+e);for(var a=r.length/3,i=[],o=0;o<a;o++)for(var t=r[o*3+0],s=r[o*3+1],u=r[o*3+2],I=0;I<t;I++)i.push(new C5(s,u));return i};C5.getRsBlockTable=function(n,e){switch(e){case oSe.L:return C5.RS_BLOCK_TABLE[(n-1)*4+0];case oSe.M:return C5.RS_BLOCK_TABLE[(n-1)*4+1];case oSe.Q:return C5.RS_BLOCK_TABLE[(n-1)*4+2];case oSe.H:return C5.RS_BLOCK_TABLE[(n-1)*4+3];default:return}};X0n.exports=C5});var B0n=Ze((Mfo,L0n)=>{function S0n(){this.buffer=[],this.length=0}S0n.prototype={get:function(n){var e=Math.floor(n/8);return(this.buffer[e]>>>7-n%8&1)==1},put:function(n,e){for(var r=0;r<e;r++)this.putBit((n>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(n){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++}};L0n.exports=S0n});var O0n=Ze((Ufo,D0n)=>{var tFi=E0n(),DH=Q0n(),rFi=vRt(),T0n=k0n(),J0n=B0n();function x5(n,e){this.typeNumber=n,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}x5.prototype={addData:function(n){var e=new tFi(n);this.dataList.push(e),this.dataCache=null},isDark:function(n,e){if(n<0||this.moduleCount<=n||e<0||this.moduleCount<=e)throw new Error(n+","+e);return this.modules[n][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var n=1;for(n=1;n<40;n++){for(var e=T0n.getRSBlocks(n,this.errorCorrectLevel),r=new J0n,a=0,i=0;i<e.length;i++)a+=e[i].dataCount;for(var o=0;o<this.dataList.length;o++){var t=this.dataList[o];r.put(t.mode,4),r.put(t.getLength(),DH.getLengthInBits(t.mode,n)),t.write(r)}if(r.getLengthInBits()<=a*8)break}this.typeNumber=n}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(n,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var a=0;a<this.moduleCount;a++)this.modules[r][a]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(n,e),this.typeNumber>=7&&this.setupTypeNumber(n),this.dataCache===null&&(this.dataCache=x5.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(n,e){for(var r=-1;r<=7;r++)if(!(n+r<=-1||this.moduleCount<=n+r))for(var a=-1;a<=7;a++)e+a<=-1||this.moduleCount<=e+a||(0<=r&&r<=6&&(a===0||a===6)||0<=a&&a<=6&&(r===0||r===6)||2<=r&&r<=4&&2<=a&&a<=4?this.modules[n+r][e+a]=!0:this.modules[n+r][e+a]=!1)},getBestMaskPattern:function(){for(var n=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var a=DH.getLostPoint(this);(r===0||n>a)&&(n=a,e=r)}return e},createMovieClip:function(n,e,r){var a=n.createEmptyMovieClip(e,r),i=1;this.make();for(var o=0;o<this.modules.length;o++)for(var t=o*i,s=0;s<this.modules[o].length;s++){var u=s*i,I=this.modules[o][s];I&&(a.beginFill(0,100),a.moveTo(u,t),a.lineTo(u+i,t),a.lineTo(u+i,t+i),a.lineTo(u,t+i),a.endFill())}return a},setupTimingPattern:function(){for(var n=8;n<this.moduleCount-8;n++)this.modules[n][6]===null&&(this.modules[n][6]=n%2===0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]===null&&(this.modules[6][e]=e%2===0)},setupPositionAdjustPattern:function(){for(var n=DH.getPatternPosition(this.typeNumber),e=0;e<n.length;e++)for(var r=0;r<n.length;r++){var a=n[e],i=n[r];if(this.modules[a][i]===null)for(var o=-2;o<=2;o++)for(var t=-2;t<=2;t++)Math.abs(o)===2||Math.abs(t)===2||o===0&&t===0?this.modules[a+o][i+t]=!0:this.modules[a+o][i+t]=!1}},setupTypeNumber:function(n){for(var e=DH.getBCHTypeNumber(this.typeNumber),r,a=0;a<18;a++)r=!n&&(e>>a&1)===1,this.modules[Math.floor(a/3)][a%3+this.moduleCount-8-3]=r;for(var i=0;i<18;i++)r=!n&&(e>>i&1)===1,this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r},setupTypeInfo:function(n,e){for(var r=this.errorCorrectLevel<<3|e,a=DH.getBCHTypeInfo(r),i,o=0;o<15;o++)i=!n&&(a>>o&1)===1,o<6?this.modules[o][8]=i:o<8?this.modules[o+1][8]=i:this.modules[this.moduleCount-15+o][8]=i;for(var t=0;t<15;t++)i=!n&&(a>>t&1)===1,t<8?this.modules[8][this.moduleCount-t-1]=i:t<9?this.modules[8][15-t-1+1]=i:this.modules[8][15-t-1]=i;this.modules[this.moduleCount-8][8]=!n},mapData:function(n,e){for(var r=-1,a=this.moduleCount-1,i=7,o=0,t=this.moduleCount-1;t>0;t-=2)for(t===6&&t--;;){for(var s=0;s<2;s++)if(this.modules[a][t-s]===null){var u=!1;o<n.length&&(u=(n[o]>>>i&1)===1);var I=DH.getMask(e,a,t-s);I&&(u=!u),this.modules[a][t-s]=u,i--,i===-1&&(o++,i=7)}if(a+=r,a<0||this.moduleCount<=a){a-=r,r=-r;break}}}};x5.PAD0=236;x5.PAD1=17;x5.createData=function(n,e,r){for(var a=T0n.getRSBlocks(n,e),i=new J0n,o=0;o<r.length;o++){var t=r[o];i.put(t.mode,4),i.put(t.getLength(),DH.getLengthInBits(t.mode,n)),t.write(i)}for(var s=0,u=0;u<a.length;u++)s+=a[u].dataCount;if(i.getLengthInBits()>s*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+s*8+")");for(i.getLengthInBits()+4<=s*8&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(!1);for(;!(i.getLengthInBits()>=s*8||(i.put(x5.PAD0,8),i.getLengthInBits()>=s*8));)i.put(x5.PAD1,8);return x5.createBytes(i,a)};x5.createBytes=function(n,e){for(var r=0,a=0,i=0,o=new Array(e.length),t=new Array(e.length),s=0;s<e.length;s++){var u=e[s].dataCount,I=e[s].totalCount-u;a=Math.max(a,u),i=Math.max(i,I),o[s]=new Array(u);for(var d=0;d<o[s].length;d++)o[s][d]=255&n.buffer[d+r];r+=u;var h=DH.getErrorCorrectPolynomial(I),c=new rFi(o[s],h.getLength()-1),m=c.mod(h);t[s]=new Array(h.getLength()-1);for(var v=0;v<t[s].length;v++){var G=v+m.getLength()-t[s].length;t[s][v]=G>=0?m.get(G):0}}for(var A=0,Z=0;Z<e.length;Z++)A+=e[Z].totalCount;for(var R=new Array(A),F=0,E=0;E<a;E++)for(var p=0;p<e.length;p++)E<o[p].length&&(R[F++]=o[p][E]);for(var y=0;y<i;y++)for(var N=0;N<e.length;N++)y<t[N].length&&(R[F++]=t[N][y]);return R};D0n.exports=x5});var _0n=Ze((_fo,U0n)=>{var nFi=O0n(),M0n=yRt(),aFi="\x1B[40m \x1B[0m",lSe="\x1B[47m \x1B[0m",iFi=function(n){return n?aFi:lSe},ARt=function(n){return{times:function(e){return new Array(e).join(n)}}},sFi=function(n,e){for(var r=new Array(n),a=0;a<n;a++)r[a]=e;return r};U0n.exports={error:M0n.L,generate:function(n,e,r){typeof e=="function"&&(r=e,e={});var a=new nFi(-1,this.error);a.addData(n),a.make();var i="";if(e&&e.small){var o=!0,t=!1,s=a.getModuleCount(),u=a.modules.slice(),I=s%2===1;I&&u.push(sFi(s,t));var d={WHITE_ALL:"\u2588",WHITE_BLACK:"\u2580",BLACK_WHITE:"\u2584",BLACK_ALL:" "},h=ARt(d.BLACK_WHITE).times(s+3),c=ARt(d.WHITE_BLACK).times(s+3);i+=h+`
|
|
4950
4950
|
`;for(var m=0;m<s;m+=2){i+=d.WHITE_ALL;for(var v=0;v<s;v++)u[m][v]===t&&u[m+1][v]===t?i+=d.WHITE_ALL:u[m][v]===t&&u[m+1][v]===o?i+=d.WHITE_BLACK:u[m][v]===o&&u[m+1][v]===t?i+=d.BLACK_WHITE:i+=d.BLACK_ALL;i+=d.WHITE_ALL+`
|
|
4951
4951
|
`}I||(i+=c)}else{var G=ARt(lSe).times(a.getModuleCount()+3);i+=G+`
|
|
4952
4952
|
`,a.modules.forEach(function(A){i+=lSe,i+=A.map(iFi).join(""),i+=lSe+`
|
|
@@ -6679,7 +6679,7 @@ ${d.text}`:""):c=`\u274C \u65C1\u8DEF\u95EE\u7B54\u5931\u8D25\uFF1A${d.error??"\
|
|
|
6679
6679
|
\u2022 \u6700\u5C11\u6301\u7EED\uFF1A${w.hours} \u5C0F\u65F6
|
|
6680
6680
|
\u2022 \u5F3A\u5EA6\uFF1A${k}
|
|
6681
6681
|
`+(T.yoloWasEnabled?`\u2022 \u5DF2\u81EA\u52A8\u5F00\u542F YOLO \u81EA\u52A8\u6267\u884C
|
|
6682
|
-
`:"")+"\n\u6211\u5C06\u6301\u7EED\u63A8\u8FDB\u76F4\u81F3\u8FBE\u6210\u76EE\u6807\u3002\u968F\u65F6\u53EF\u7528 `/goal clear` \u7ED3\u675F\u3002",G.messageId)}catch(T){return`\u274C \u542F\u52A8\u76EE\u6807\u6A21\u5F0F\u5931\u8D25\uFF1A${T?.message||String(T)}`}if(await yXi(G,a,x,W,A))return null;if(!A.startsWith("/")){let T=A.trim(),H=Hg?.services?.settings?.merged?.favoriteModels||[],Q=W?.getCloudModels?.()||[],Y=H.map(V=>{let J=Q.find(M=>M.name===V);return
|
|
6682
|
+
`:"")+"\n\u6211\u5C06\u6301\u7EED\u63A8\u8FDB\u76F4\u81F3\u8FBE\u6210\u76EE\u6807\u3002\u968F\u65F6\u53EF\u7528 `/goal clear` \u7ED3\u675F\u3002",G.messageId)}catch(T){return`\u274C \u542F\u52A8\u76EE\u6807\u6A21\u5F0F\u5931\u8D25\uFF1A${T?.message||String(T)}`}if(await yXi(G,a,x,W,A))return null;if(!A.startsWith("/")){let T=A.trim(),H=Hg?.services?.settings?.merged?.favoriteModels||[],Q=W?.getCloudModels?.()||[],Y=H.map(V=>{let J=Q.find(M=>M.name===V);return{name:V,displayName:J?.displayName||V}}),C=await Promise.resolve().then(()=>(p5t(),tun)).then(V=>V.detectNLTrigger(T,{favorites:Y}));C&&(pa(`[NL-Trigger] type=${C.type} keyword="${C.matchedKeyword}"`),C.type==="modelSwitch"&&C.modelName?A=`/model ${C.modelName}`:C.slashCommand&&(A=C.slashCommand))}if(A.startsWith("/")){pa(`[Router] High-priority slash command matched: "${MLe(A)}"`);try{let T=await VXi(A,x,W,G.chatId);if(T!==null){F1?.addItem({type:"info",text:T},Date.now());let V=await Sl(W,x,Jee.get(G.chatId)),J=See(T,V,"Easy Code"),M=await a.createCardKitCard(J);return M?await a.sendCardKitMessage(G.chatId,M,G.messageId):await a.sendMessage(G.chatId,T,G.messageId),null}let k=await QXi(A,W,G.chatId);if(k!==null){if(k.type==="submit_prompt"){let B={...G,text:k.content};pa(`[Router] CLI Slash command redirected to prompt queue: ${k.content}`);let D=E1.get(G.chatId);D||(D=[],E1.set(G.chatId,D));let U=uX.get(G.chatId)||!1,_=null;if(U||D.length>0){let P=`\u23F3 *\u5F53\u524D\u9879\u76EE\u4EFB\u52A1\u6B63\u5728\u6267\u884C\u4E2D\uFF0C\u60A8\u7684\u65B0\u8BF7\u6C42\u5DF2\u653E\u5165\u9879\u76EE\u961F\u5217\u6392\u961F\uFF08\u5F53\u524D\u6392\u5728\u7B2C ${D.length+1} \u4F4D\uFF09...*`;_=await a.sendMessage(G.chatId,P,G.messageId)}return new Promise((z,P)=>{D.push({msg:B,resolve:z,reject:P,queueTipMessageId:_});let j=p||(y.length?`trail=[${y.join("|")}]`:"");v(a,W,x,r,G.chatId,j)})}let V=k.content||"\u2705 \u547D\u4EE4\u5DF2\u6210\u529F\u6267\u884C\u3002";F1?.addItem({type:"info",text:V},Date.now());let J=await Sl(W,x,Jee.get(G.chatId)),M=See(V,J,"Easy Code"),O=await a.createCardKitCard(M);return O?await a.sendCardKitMessage(G.chatId,O,G.messageId):await a.sendMessage(G.chatId,V,G.messageId),null}let H=`\u2753 \u672A\u77E5\u547D\u4EE4: ${A.split(/\s+/)[0]}
|
|
6683
6683
|
|
|
6684
6684
|
\u8F93\u5165 /help \u67E5\u770B\u53EF\u7528\u547D\u4EE4`;F1?.addItem({type:"info",text:H},Date.now());let Q=await Sl(W,x,Jee.get(G.chatId)),Y=See(H,Q,"Easy Code"),C=await a.createCardKitCard(Y);return C?await a.sendCardKitMessage(G.chatId,C,G.messageId):await a.sendMessage(G.chatId,H,G.messageId),null}catch(T){let k=`\u274C \u6267\u884C\u547D\u4EE4\u51FA\u9519\uFF1A${T.message||T}`;F1?.addItem({type:"info",text:k},Date.now());let H=await Sl(W,x,Jee.get(G.chatId)),Q=See(k,H,"Easy Code (Error)"),Y=await a.createCardKitCard(Q);return Y?await a.sendCardKitMessage(G.chatId,Y,G.messageId):await a.sendMessage(G.chatId,k,G.messageId),null}}let S=E1.get(G.chatId);S||(S=[],E1.set(G.chatId,S));let X=uX.get(G.chatId)||!1,L=null;if(X||S.length>0){let k=`\u23F3 *\u5F53\u524D\u9879\u76EE\u4EFB\u52A1\u6B63\u5728\u6267\u884C\u4E2D\uFF0C\u60A8\u7684\u65B0\u8BF7\u6C42\u5DF2\u653E\u5165\u9879\u76EE\u961F\u5217\u6392\u961F\uFF08\u5F53\u524D\u6392\u5728\u7B2C ${S.length+1} \u4F4D\uFF09...*`;L=await a.sendMessage(G.chatId,k,G.messageId)}return new Promise((T,k)=>{S.push({msg:G,resolve:T,reject:k,queueTipMessageId:L});let H=p||(y.length?`trail=[${y.join("|")}]`:"");v(a,W,x,r,G.chatId,H)})};function t(G){let Z=G.filter(y=>y.type==="tool").length;if(Z<=5)return G.map(y=>y.content).join(`
|
|
6685
6685
|
|