hwjcode 1.1.27 → 1.1.28
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 +3 -3
- package/package.json +1 -1
package/bundle/easycode.js
CHANGED
|
@@ -573,7 +573,7 @@ ${h}`)}return t}),f1e=Uka(TOt);V1e=class extends Y1e{create(e,r){var n;let{api_v
|
|
|
573
573
|
`):[]}};jO.NEWLINE_CHARS=new Set([`
|
|
574
574
|
`,"\r"]);jO.NEWLINE_REGEXP=/\r\n|[\n\r]/g;H1e={off:0,error:200,warn:300,info:400,debug:500},QOt=(a,e,r)=>{if(a){if(wka(H1e,a))return a;U2(r).warn(`${e} was set to ${JSON.stringify(a)}, expected one of ${JSON.stringify(Object.keys(H1e))}`)}};jka={error:Uae,warn:Uae,info:Uae,debug:Uae},HOt=new WeakMap;Bk=a=>(a.options&&(a.options=Object.assign({},a.options),delete a.options.headers),a.headers&&(a.headers=Object.fromEntries((a.headers instanceof Headers?[...a.headers]:Object.entries(a.headers)).map(([e,r])=>[e,e.toLowerCase()==="x-goog-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in a&&(a.retryOfRequestLogID&&(a.retryOf=a.retryOfRequestLogID),delete a.retryOfRequestLogID),a);qMe=class a{constructor(e,r,n){this.iterator=e,this.controller=r,this.client=n}static fromSSEResponse(e,r,n){let i=!1,o=n?U2(n):console;function t(){return UO(this,arguments,function*(){var u,I,d,h;if(i)throw new bG("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let c=!1;try{try{for(var m=!0,v=Jk(qka(e,r)),G;G=yield pd(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 pd(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 pd(d.call(v)))}finally{if(I)throw I.error}}c=!0}catch(A){if(_Me(A))return yield pd(void 0);throw A}finally{c||r.abort()}})}return new a(t,r,n)}static fromReadableStream(e,r,n){let i=!1;function o(){return UO(this,arguments,function*(){var u,I,d,h;let c=new jO,m=LOt(e);try{for(var v=!0,G=Jk(m),A;A=yield pd(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 pd(R)}}catch(Z){I={error:Z}}finally{try{!v&&!u&&(d=G.return)&&(yield pd(d.call(G)))}finally{if(I)throw I.error}}for(let Z of c.flush())yield yield pd(Z)})}function t(){return UO(this,arguments,function*(){var u,I,d,h;if(i)throw new bG("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let c=!1;try{try{for(var m=!0,v=Jk(o()),G;G=yield pd(v.next()),u=G.done,!u;m=!0){h=G.value,m=!1;let A=h;c||A&&(yield yield pd(JSON.parse(A)))}}catch(A){I={error:A}}finally{try{!m&&!u&&(d=v.return)&&(yield pd(d.call(v)))}finally{if(I)throw I.error}}c=!0}catch(A){if(_Me(A))return yield pd(void 0);throw A}finally{c||r.abort()}})}return new a(t,r,n)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),i=o=>({next:()=>{if(o.length===0){let t=n.next();e.push(t),r.push(t)}return o.shift()}});return[new a(()=>i(e),this.controller,this.client),new a(()=>i(r),this.controller,this.client)]}toReadableStream(){let e=this,r;return SOt({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:i,done:o}=await r.next();if(o)return n.close();let t=tUe(JSON.stringify(i)+`
|
|
575
575
|
`);n.enqueue(t)}catch(i){n.error(i)}},async cancel(){var n;await((n=r.return)===null||n===void 0?void 0:n.call(r))}})}};KMe=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,n,i]=$ka(e,":");return i.startsWith(" ")&&(i=i.substring(1)),r==="event"?this.event=i:r==="data"&&this.data.push(i),null}};$Me=class a extends Promise{constructor(e,r,n=e6a){super(i=>{i(null)}),this.responsePromise=r,this.parseResponse=n,this.client=e}_thenUnwrap(e){return new a(this.client,this.responsePromise,async(r,n)=>e(await this.parseResponse(r,n),n))}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)}};DOt=Symbol("brand.privateNullableHeaders");Mae=a=>{let e=new Headers,r=new Set;for(let n of a){let i=new Set;for(let[o,t]of t6a(n)){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{[DOt]:!0,values:e,nulls:r}};UMe=a=>{var e,r,n,i,o,t;if(typeof globalThis.process<"u")return(n=(r=(e=globalThis.process.env)===null||e===void 0?void 0:e[a])===null||r===void 0?void 0:r.trim())!==null&&n!==void 0?n: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,a))===null||t===void 0?void 0:t.trim()};X1e=class a{constructor(e){var r,n,i,o,t,s,u,{baseURL:I=UMe("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:d=(r=UMe("GEMINI_API_KEY"))!==null&&r!==void 0?r:null,apiVersion:h="v1beta"}=e,c=y1e(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=(n=m.timeout)!==null&&n!==void 0?n:a.DEFAULT_TIMEOUT,this.logger=(i=m.logger)!==null&&i!==void 0?i:console;let v="warn";this.logLevel=v,this.logLevel=(t=(o=QOt(m.logLevel,"ClientOptions.logLevel",this))!==null&&o!==void 0?o:QOt(UMe("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:Xka(),this.encoder=Lka,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=Mae([e.headers]);if(!(r.values.has("authorization")||r.values.has("x-goog-api-key"))){if(this.apiKey)return Mae([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return Mae([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return Object.entries(e).filter(([r,n])=>typeof n<"u").map(([r,n])=>{if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")return`${encodeURIComponent(r)}=${encodeURIComponent(n)}`;if(n===null)return`${encodeURIComponent(r)}=`;throw new bG(`Cannot stringify type ${typeof n}; 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 ${MO}`}defaultIdempotencyKey(){return`stainless-node-retry-${Aka()}`}makeStatusError(e,r,n,i){return gG.generate(e,r,n,i)}buildURL(e,r,n){let i=!this.baseURLOverridden()&&n||this.baseURL,o=Nka(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),t=this.defaultQuery();return Eka(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:n}){}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,n){return this.request(Promise.resolve(n).then(i=>Object.assign({method:e,path:r},i)))}request(e,r=null){return new $Me(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){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=n===void 0?"":`, retryOf: ${n}`,v=Date.now();if(U2(this).debug(`[${c}] sending request`,Bk({retryOfRequestLogID:n,method:s.method,url:d,options:s,headers:I.headers})),!((o=s.signal)===null||o===void 0)&&o.aborted)throw new _ae;let G=new AbortController,A=await this.fetchWithTimeout(d,I,h,G).catch(zMe),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 _ae;let E=_Me(A)||/timed? ?out/i.test(String(A)+("cause"in A?String(A.cause):""));if(r)return U2(this).info(`[${c}] connection ${E?"timed out":"failed"} - ${F}`),U2(this).debug(`[${c}] connection ${E?"timed out":"failed"} (${F})`,Bk({retryOfRequestLogID:n,url:d,durationMs:Z-v,message:A.message})),this.retryRequest(s,r,n??c);throw U2(this).info(`[${c}] connection ${E?"timed out":"failed"} - error; no more retries left`),U2(this).debug(`[${c}] connection ${E?"timed out":"failed"} (error; no more retries left)`,Bk({retryOfRequestLogID:n,url:d,durationMs:Z-v,message:A.message})),E?new Z1e:new PO({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 Ska(A.body),U2(this).info(`${R} - ${b}`),U2(this).debug(`[${c}] response error (${b})`,Bk({retryOfRequestLogID:n,url:A.url,status:A.status,headers:A.headers,durationMs:Z-v})),this.retryRequest(s,r,n??c,A.headers)}let E=F?"error; no more retries left":"error; not retryable";U2(this).info(`${R} - ${E}`);let p=await A.text().catch(b=>zMe(b).message),y=Cka(p),N=y?void 0:p;throw U2(this).debug(`[${c}] response error (${E})`,Bk({retryOfRequestLogID:n,url:A.url,status:A.status,headers:A.headers,message:N,durationMs:Date.now()-v})),this.makeStatusError(A.status,y,N,A.headers)}return U2(this).info(R),U2(this).debug(`[${c}] response start`,Bk({retryOfRequestLogID:n,url:A.url,status:A.status,headers:A.headers,durationMs:Z-v})),{response:A,options:s,controller:G,requestLogID:c,retryOfRequestLogID:n,startTime:v}}async fetchWithTimeout(e,r,n,i){let o=r||{},{signal:t,method:s}=o,u=y1e(o,["signal","method"]);t&&t.addEventListener("abort",()=>i.abort());let I=setTimeout(()=>i.abort(),n),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,n,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 xka(t),this.makeRequest(e,r-1,n)}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 n,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&&Rka("timeout",t.timeout),t.timeout=(n=t.timeout)!==null&&n!==void 0?n: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:n,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=Mae([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))}:{}),Hka()),this._options.defaultHeaders,n,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 n=Mae([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.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:kka(e)}:this.encoder({body:e,headers:n})}};X1e.DEFAULT_TIMEOUT=6e4;tm=class extends X1e{constructor(){super(...arguments),this.interactions=new Q1e(this)}};OOt=tm;tm.GeminiNextGenAPIClient=OOt;tm.GeminiNextGenAPIClientError=bG;tm.APIError=gG;tm.APIConnectionError=PO;tm.APIConnectionTimeoutError=Z1e;tm.APIUserAbortError=_ae;tm.NotFoundError=E1e;tm.ConflictError=w1e;tm.RateLimitError=C1e;tm.BadRequestError=N1e;tm.AuthenticationError=W1e;tm.InternalServerError=x1e;tm.PermissionDeniedError=F1e;tm.UnprocessableEntityError=R1e;tm.toFile=Oka;tm.Interactions=Q1e;h$i=1024*1024*8;});function r6a(a,e){return{...a,...e}}function MOt(a){let{prompt_id:e,...r}=a;return r}function iV(a){return Array.isArray(a)?a.map(MOt):a}var k1e=ct(()=>{"use strict";fi();});var UOt={};ho(UOt,{DEFAULT_PROXY_CONFIG:()=>i6a,getActiveProxyServerUrl:()=>WE,getAvailableProxyServers:()=>a6a,getProxyServerInfo:()=>n6a,getProxyServers:()=>zae,hasAvailableProxyServer:()=>rUe});function zae(){return[{url:"https://api-code.deepvlab.ai",name:"Primary Development Server",region:"default",status:"active"}]}function WE(){let e=zae().find(r=>r.status==="active");if(!e)throw new Error("No active proxy server available. Please contact support.");return e.url}function a6a(){return zae().filter(e=>e.status==="active")}function rUe(){return zae().some(e=>e.status==="active")}function n6a(a){return zae().find(r=>r.url===a)}var i6a,qO=ct(()=>{"use strict";i6a={serverUrl:WE(),timeout:2e5,retryAttempts:3,retryDelay:1e3}});import{randomUUID as s6a}from"crypto";function bv(){return Pae||(Pae=s6a()),Pae}function _Ot(a){Pae=a}function zOt(){Pae=void 0}var Pae,POt,S1e=ct(()=>{"use strict";POt=bv()});function VI(a){let e=a??"1.1.27"??"unknown",r=process.platform,n=process.arch;if(e.startsWith("VSCode-")){let i=e.slice(7)||"unknown";return`${aUe}/VSCode/${i} (${r}; ${n})`}return`${aUe}/CLI/${e} (${r}; ${n})`}var aUe,sV=ct(()=>{"use strict";aUe="EasyCode"});import*as _u from"fs";import*as h3 from"path";import*as Tk from"os";function o6a(a){Lo.configure(a)}function l6a(a){Lo.setUserInfo(a)}function c6a(a){Lo.setCliVersion(a)}async function u6a(){return await Lo.getUserHeaders()}function d6a(){return Lo.getStatus()}var jae,il,Lo,oV=ct(()=>{"use strict";qO();S1e();sV();jae=259200,il=class a{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 VI(this.cliVersion)}formatTimeRemaining(e){if(e<=0)return"\u5DF2\u8FC7\u671F";let r=Math.floor(e/1e3),n=Math.floor(r/(24*3600)),i=Math.floor(r%(24*3600)/3600),o=Math.floor(r%3600/60),t=r%60;return n>0?`${n}\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=h3.join(Tk.homedir(),".easycode-user","user-info-dev.json"),this.jwtTokenFilePath=h3.join(Tk.homedir(),".easycode-user","jwt-token-dev.json"),this.usageStatsFilePath=h3.join(Tk.homedir(),".easycode-user","usage-stats-dev.json")):(this.userInfoFilePath=h3.join(Tk.homedir(),".easycode-user","user-info.json"),this.jwtTokenFilePath=h3.join(Tk.homedir(),".easycode-user","jwt-token.json"),this.usageStatsFilePath=h3.join(Tk.homedir(),".easycode-user","usage-stats.json")),this.cliVersion="1.1.27",this.config={proxyServerUrl:WE()},this.loadUserInfo(),this.loadJwtToken(),this.loadUsageStats(),this.startPeriodicStatusCheck()}startPeriodicStatusCheck(){this.periodicStatusCheckIntervalId=setInterval(()=>{if(this.jwtTokenData){let e=Date.now(),r=this.jwtTokenData.expiresAt-e,n=this.formatTimeRemaining(r),i=this.formatAbsoluteTime(this.jwtTokenData.expiresAt);if(r>0){let o=this.formatAbsoluteTime(this.jwtTokenData.expiresAt-jae*1e3);console.log(`[Login Check] \u{1F4CA} Periodic status check - Credential remaining: ${n} (until ${i}), next renewal: ${o}`)}else console.log(`[Login Check] \u26A0\uFE0F Periodic status check - Credential expired at: ${i}`)}},600*1e3)}static getInstance(){return a.instance||(a.instance=new a),a.instance}loadUserInfo(){try{if(_u.existsSync(this.userInfoFilePath)){let e=_u.readFileSync(this.userInfoFilePath,"utf8");this.userInfo=JSON.parse(e);let r=n=>{if(!n||!n.includes("@"))return n;let[i,o]=n.split("@");return i.length<=2?n:`${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=h3.dirname(this.userInfoFilePath);_u.existsSync(e)||_u.mkdirSync(e,{recursive:!0}),_u.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(_u.existsSync(this.jwtTokenFilePath)){let e=_u.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=h3.dirname(this.jwtTokenFilePath);_u.existsSync(e)||_u.mkdirSync(e,{recursive:!0}),_u.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(_u.existsSync(this.usageStatsFilePath)){let e=_u.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=h3.dirname(this.usageStatsFilePath);_u.existsSync(e)||_u.mkdirSync(e,{recursive:!0}),_u.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 n=Date.now()+e.expiresIn*1e3;this.jwtTokenData={accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,expiresAt:n,savedAt:new Date().toISOString()},this.saveJwtToken();let i=this.formatTimeRemaining(e.expiresIn*1e3),o=this.formatAbsoluteTime(n),t=this.formatAbsoluteTime(n-jae*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,n=this.formatTimeRemaining(r),i=this.jwtTokenData.expiresAt-jae*1e3,o=this.formatAbsoluteTime(i);if(this.isTokenNearExpiry()){console.log(`[Login Check] Access credential expiring soon (remaining: ${n}), 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=jae){if(!this.jwtTokenData)return!0;let r=this.jwtTokenData.expiresAt-Date.now(),n=r<=e*1e3;if(n){let i=this.formatTimeRemaining(r);console.log(`[Login Check] Credential expiry check: ${i} remaining <= ${e}s threshold, renewal needed: ${n}`)}return n}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 n=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:n+(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-jae*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{_u.existsSync(this.jwtTokenFilePath)&&_u.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(),n=this.getCliVersion(),i=this.getUserAgent(),o={"Content-Type":"application/json","X-Client-Version":n,"User-Agent":i,"X-Session-ID":bv()};return r&&(o.Authorization=`Bearer ${r}`),e&&(o["X-DVCode-Scene"]=e),o}getUserHeadersSync(){let e=this.getCliVersion(),r=this.getUserAgent(),n={"Content-Type":"application/json","X-Client-Version":e,"User-Agent":r,"X-Session-ID":bv()};return this.jwtTokenData?.accessToken&&(n.Authorization=`Bearer ${this.jwtTokenData.accessToken}`),n}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{_u.existsSync(this.userInfoFilePath)&&_u.unlinkSync(this.userInfoFilePath)}catch(e){console.warn("[Login Check] Failed to delete user info file:",e)}try{_u.existsSync(this.jwtTokenFilePath)&&_u.unlinkSync(this.jwtTokenFilePath)}catch(e){console.warn("[Login Check] Failed to delete access credential file:",e)}console.log("[Login Check] Authentication cleared")}},Lo=il.getInstance()});import{promises as Dk}from"node:fs";import qae from"node:path";import I6a from"os";var gv,L1e,ia,xA=ct(()=>{"use strict";(function(a){a[a.DEBUG=0]="DEBUG",a[a.INFO=1]="INFO",a[a.WARN=2]="WARN",a[a.ERROR=3]="ERROR"})(gv||(gv={}));L1e=class{config;logBuffer=[];constructor(e={}){if(this.config={level:gv.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=qae.join(I6a.homedir(),".easycode-user","logs",`deepv-${r}.log`)}}formatMessage(e,r,...n){let i=new Date().toISOString(),o=n.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 Dk.mkdir(qae.dirname(this.config.filePath),{recursive:!0}),await this.rotateLogIfNeeded(),await Dk.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,n,i]=$ka(e,":");return i.startsWith(" ")&&(i=i.substring(1)),r==="event"?this.event=i:r==="data"&&this.data.push(i),null}};$Me=class a extends Promise{constructor(e,r,n=e6a){super(i=>{i(null)}),this.responsePromise=r,this.parseResponse=n,this.client=e}_thenUnwrap(e){return new a(this.client,this.responsePromise,async(r,n)=>e(await this.parseResponse(r,n),n))}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)}};DOt=Symbol("brand.privateNullableHeaders");Mae=a=>{let e=new Headers,r=new Set;for(let n of a){let i=new Set;for(let[o,t]of t6a(n)){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{[DOt]:!0,values:e,nulls:r}};UMe=a=>{var e,r,n,i,o,t;if(typeof globalThis.process<"u")return(n=(r=(e=globalThis.process.env)===null||e===void 0?void 0:e[a])===null||r===void 0?void 0:r.trim())!==null&&n!==void 0?n: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,a))===null||t===void 0?void 0:t.trim()};X1e=class a{constructor(e){var r,n,i,o,t,s,u,{baseURL:I=UMe("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:d=(r=UMe("GEMINI_API_KEY"))!==null&&r!==void 0?r:null,apiVersion:h="v1beta"}=e,c=y1e(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=(n=m.timeout)!==null&&n!==void 0?n:a.DEFAULT_TIMEOUT,this.logger=(i=m.logger)!==null&&i!==void 0?i:console;let v="warn";this.logLevel=v,this.logLevel=(t=(o=QOt(m.logLevel,"ClientOptions.logLevel",this))!==null&&o!==void 0?o:QOt(UMe("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:Xka(),this.encoder=Lka,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=Mae([e.headers]);if(!(r.values.has("authorization")||r.values.has("x-goog-api-key"))){if(this.apiKey)return Mae([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return Mae([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return Object.entries(e).filter(([r,n])=>typeof n<"u").map(([r,n])=>{if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")return`${encodeURIComponent(r)}=${encodeURIComponent(n)}`;if(n===null)return`${encodeURIComponent(r)}=`;throw new bG(`Cannot stringify type ${typeof n}; 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 ${MO}`}defaultIdempotencyKey(){return`stainless-node-retry-${Aka()}`}makeStatusError(e,r,n,i){return gG.generate(e,r,n,i)}buildURL(e,r,n){let i=!this.baseURLOverridden()&&n||this.baseURL,o=Nka(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),t=this.defaultQuery();return Eka(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:n}){}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,n){return this.request(Promise.resolve(n).then(i=>Object.assign({method:e,path:r},i)))}request(e,r=null){return new $Me(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){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=n===void 0?"":`, retryOf: ${n}`,v=Date.now();if(U2(this).debug(`[${c}] sending request`,Bk({retryOfRequestLogID:n,method:s.method,url:d,options:s,headers:I.headers})),!((o=s.signal)===null||o===void 0)&&o.aborted)throw new _ae;let G=new AbortController,A=await this.fetchWithTimeout(d,I,h,G).catch(zMe),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 _ae;let E=_Me(A)||/timed? ?out/i.test(String(A)+("cause"in A?String(A.cause):""));if(r)return U2(this).info(`[${c}] connection ${E?"timed out":"failed"} - ${F}`),U2(this).debug(`[${c}] connection ${E?"timed out":"failed"} (${F})`,Bk({retryOfRequestLogID:n,url:d,durationMs:Z-v,message:A.message})),this.retryRequest(s,r,n??c);throw U2(this).info(`[${c}] connection ${E?"timed out":"failed"} - error; no more retries left`),U2(this).debug(`[${c}] connection ${E?"timed out":"failed"} (error; no more retries left)`,Bk({retryOfRequestLogID:n,url:d,durationMs:Z-v,message:A.message})),E?new Z1e:new PO({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 Ska(A.body),U2(this).info(`${R} - ${b}`),U2(this).debug(`[${c}] response error (${b})`,Bk({retryOfRequestLogID:n,url:A.url,status:A.status,headers:A.headers,durationMs:Z-v})),this.retryRequest(s,r,n??c,A.headers)}let E=F?"error; no more retries left":"error; not retryable";U2(this).info(`${R} - ${E}`);let p=await A.text().catch(b=>zMe(b).message),y=Cka(p),N=y?void 0:p;throw U2(this).debug(`[${c}] response error (${E})`,Bk({retryOfRequestLogID:n,url:A.url,status:A.status,headers:A.headers,message:N,durationMs:Date.now()-v})),this.makeStatusError(A.status,y,N,A.headers)}return U2(this).info(R),U2(this).debug(`[${c}] response start`,Bk({retryOfRequestLogID:n,url:A.url,status:A.status,headers:A.headers,durationMs:Z-v})),{response:A,options:s,controller:G,requestLogID:c,retryOfRequestLogID:n,startTime:v}}async fetchWithTimeout(e,r,n,i){let o=r||{},{signal:t,method:s}=o,u=y1e(o,["signal","method"]);t&&t.addEventListener("abort",()=>i.abort());let I=setTimeout(()=>i.abort(),n),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,n,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 xka(t),this.makeRequest(e,r-1,n)}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 n,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&&Rka("timeout",t.timeout),t.timeout=(n=t.timeout)!==null&&n!==void 0?n: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:n,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=Mae([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))}:{}),Hka()),this._options.defaultHeaders,n,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 n=Mae([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.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:kka(e)}:this.encoder({body:e,headers:n})}};X1e.DEFAULT_TIMEOUT=6e4;tm=class extends X1e{constructor(){super(...arguments),this.interactions=new Q1e(this)}};OOt=tm;tm.GeminiNextGenAPIClient=OOt;tm.GeminiNextGenAPIClientError=bG;tm.APIError=gG;tm.APIConnectionError=PO;tm.APIConnectionTimeoutError=Z1e;tm.APIUserAbortError=_ae;tm.NotFoundError=E1e;tm.ConflictError=w1e;tm.RateLimitError=C1e;tm.BadRequestError=N1e;tm.AuthenticationError=W1e;tm.InternalServerError=x1e;tm.PermissionDeniedError=F1e;tm.UnprocessableEntityError=R1e;tm.toFile=Oka;tm.Interactions=Q1e;h$i=1024*1024*8;});function r6a(a,e){return{...a,...e}}function MOt(a){let{prompt_id:e,...r}=a;return r}function iV(a){return Array.isArray(a)?a.map(MOt):a}var k1e=ct(()=>{"use strict";fi();});var UOt={};ho(UOt,{DEFAULT_PROXY_CONFIG:()=>i6a,getActiveProxyServerUrl:()=>WE,getAvailableProxyServers:()=>a6a,getProxyServerInfo:()=>n6a,getProxyServers:()=>zae,hasAvailableProxyServer:()=>rUe});function zae(){return[{url:"https://api-code.deepvlab.ai",name:"Primary Development Server",region:"default",status:"active"}]}function WE(){let e=zae().find(r=>r.status==="active");if(!e)throw new Error("No active proxy server available. Please contact support.");return e.url}function a6a(){return zae().filter(e=>e.status==="active")}function rUe(){return zae().some(e=>e.status==="active")}function n6a(a){return zae().find(r=>r.url===a)}var i6a,qO=ct(()=>{"use strict";i6a={serverUrl:WE(),timeout:2e5,retryAttempts:3,retryDelay:1e3}});import{randomUUID as s6a}from"crypto";function bv(){return Pae||(Pae=s6a()),Pae}function _Ot(a){Pae=a}function zOt(){Pae=void 0}var Pae,POt,S1e=ct(()=>{"use strict";POt=bv()});function VI(a){let e=a??"1.1.28"??"unknown",r=process.platform,n=process.arch;if(e.startsWith("VSCode-")){let i=e.slice(7)||"unknown";return`${aUe}/VSCode/${i} (${r}; ${n})`}return`${aUe}/CLI/${e} (${r}; ${n})`}var aUe,sV=ct(()=>{"use strict";aUe="EasyCode"});import*as _u from"fs";import*as h3 from"path";import*as Tk from"os";function o6a(a){Lo.configure(a)}function l6a(a){Lo.setUserInfo(a)}function c6a(a){Lo.setCliVersion(a)}async function u6a(){return await Lo.getUserHeaders()}function d6a(){return Lo.getStatus()}var jae,il,Lo,oV=ct(()=>{"use strict";qO();S1e();sV();jae=259200,il=class a{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 VI(this.cliVersion)}formatTimeRemaining(e){if(e<=0)return"\u5DF2\u8FC7\u671F";let r=Math.floor(e/1e3),n=Math.floor(r/(24*3600)),i=Math.floor(r%(24*3600)/3600),o=Math.floor(r%3600/60),t=r%60;return n>0?`${n}\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=h3.join(Tk.homedir(),".easycode-user","user-info-dev.json"),this.jwtTokenFilePath=h3.join(Tk.homedir(),".easycode-user","jwt-token-dev.json"),this.usageStatsFilePath=h3.join(Tk.homedir(),".easycode-user","usage-stats-dev.json")):(this.userInfoFilePath=h3.join(Tk.homedir(),".easycode-user","user-info.json"),this.jwtTokenFilePath=h3.join(Tk.homedir(),".easycode-user","jwt-token.json"),this.usageStatsFilePath=h3.join(Tk.homedir(),".easycode-user","usage-stats.json")),this.cliVersion="1.1.28",this.config={proxyServerUrl:WE()},this.loadUserInfo(),this.loadJwtToken(),this.loadUsageStats(),this.startPeriodicStatusCheck()}startPeriodicStatusCheck(){this.periodicStatusCheckIntervalId=setInterval(()=>{if(this.jwtTokenData){let e=Date.now(),r=this.jwtTokenData.expiresAt-e,n=this.formatTimeRemaining(r),i=this.formatAbsoluteTime(this.jwtTokenData.expiresAt);if(r>0){let o=this.formatAbsoluteTime(this.jwtTokenData.expiresAt-jae*1e3);console.log(`[Login Check] \u{1F4CA} Periodic status check - Credential remaining: ${n} (until ${i}), next renewal: ${o}`)}else console.log(`[Login Check] \u26A0\uFE0F Periodic status check - Credential expired at: ${i}`)}},600*1e3)}static getInstance(){return a.instance||(a.instance=new a),a.instance}loadUserInfo(){try{if(_u.existsSync(this.userInfoFilePath)){let e=_u.readFileSync(this.userInfoFilePath,"utf8");this.userInfo=JSON.parse(e);let r=n=>{if(!n||!n.includes("@"))return n;let[i,o]=n.split("@");return i.length<=2?n:`${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=h3.dirname(this.userInfoFilePath);_u.existsSync(e)||_u.mkdirSync(e,{recursive:!0}),_u.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(_u.existsSync(this.jwtTokenFilePath)){let e=_u.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=h3.dirname(this.jwtTokenFilePath);_u.existsSync(e)||_u.mkdirSync(e,{recursive:!0}),_u.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(_u.existsSync(this.usageStatsFilePath)){let e=_u.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=h3.dirname(this.usageStatsFilePath);_u.existsSync(e)||_u.mkdirSync(e,{recursive:!0}),_u.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 n=Date.now()+e.expiresIn*1e3;this.jwtTokenData={accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,expiresAt:n,savedAt:new Date().toISOString()},this.saveJwtToken();let i=this.formatTimeRemaining(e.expiresIn*1e3),o=this.formatAbsoluteTime(n),t=this.formatAbsoluteTime(n-jae*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,n=this.formatTimeRemaining(r),i=this.jwtTokenData.expiresAt-jae*1e3,o=this.formatAbsoluteTime(i);if(this.isTokenNearExpiry()){console.log(`[Login Check] Access credential expiring soon (remaining: ${n}), 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=jae){if(!this.jwtTokenData)return!0;let r=this.jwtTokenData.expiresAt-Date.now(),n=r<=e*1e3;if(n){let i=this.formatTimeRemaining(r);console.log(`[Login Check] Credential expiry check: ${i} remaining <= ${e}s threshold, renewal needed: ${n}`)}return n}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 n=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:n+(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-jae*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{_u.existsSync(this.jwtTokenFilePath)&&_u.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(),n=this.getCliVersion(),i=this.getUserAgent(),o={"Content-Type":"application/json","X-Client-Version":n,"User-Agent":i,"X-Session-ID":bv()};return r&&(o.Authorization=`Bearer ${r}`),e&&(o["X-DVCode-Scene"]=e),o}getUserHeadersSync(){let e=this.getCliVersion(),r=this.getUserAgent(),n={"Content-Type":"application/json","X-Client-Version":e,"User-Agent":r,"X-Session-ID":bv()};return this.jwtTokenData?.accessToken&&(n.Authorization=`Bearer ${this.jwtTokenData.accessToken}`),n}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{_u.existsSync(this.userInfoFilePath)&&_u.unlinkSync(this.userInfoFilePath)}catch(e){console.warn("[Login Check] Failed to delete user info file:",e)}try{_u.existsSync(this.jwtTokenFilePath)&&_u.unlinkSync(this.jwtTokenFilePath)}catch(e){console.warn("[Login Check] Failed to delete access credential file:",e)}console.log("[Login Check] Authentication cleared")}},Lo=il.getInstance()});import{promises as Dk}from"node:fs";import qae from"node:path";import I6a from"os";var gv,L1e,ia,xA=ct(()=>{"use strict";(function(a){a[a.DEBUG=0]="DEBUG",a[a.INFO=1]="INFO",a[a.WARN=2]="WARN",a[a.ERROR=3]="ERROR"})(gv||(gv={}));L1e=class{config;logBuffer=[];constructor(e={}){if(this.config={level:gv.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=qae.join(I6a.homedir(),".easycode-user","logs",`deepv-${r}.log`)}}formatMessage(e,r,...n){let i=new Date().toISOString(),o=n.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 Dk.mkdir(qae.dirname(this.config.filePath),{recursive:!0}),await this.rotateLogIfNeeded(),await Dk.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 Dk.stat(this.config.filePath)).size/(1024*1024)>(this.config.maxFileSize||10)){let n=new Date().toISOString().slice(0,19).replace(/[:.]/g,"-"),i=this.config.filePath.replace(".log",`-${n}.log`);await Dk.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=qae.dirname(this.config.filePath),n=(await Dk.readdir(e)).filter(t=>t.startsWith("deepv-")&&t.endsWith(".log")).map(t=>({name:t,path:qae.join(e,t),time:Dk.stat(qae.join(e,t)).then(s=>s.mtime)})),i=await Promise.all(n.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 Dk.unlink(t.path)}catch(e){console.error("\u6E05\u7406\u65E7\u65E5\u5FD7\u5931\u8D25:",e)}}log(e,r,n,...i){if(e<this.config.level)return;let o=this.formatMessage(r,n,...i);this.config.enableConsole&&(e>=gv.ERROR?console.error:e>=gv.WARN?console.warn:e>=gv.INFO?console.log:console.debug)(o),this.config.enableFile&&this.writeToFile(o)}debug(e,...r){this.log(gv.DEBUG,"DEBUG",e,...r)}info(e,...r){this.log(gv.INFO,"INFO",e,...r)}warn(e,...r){this.log(gv.WARN,"WARN",e,...r)}error(e,...r){this.log(gv.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}:{}})}},ia=new L1e({level:process.env.FILE_DEBUG==="1"?gv.DEBUG:gv.INFO,enableConsole:!0,enableFile:process.env.LOG_TO_FILE==="true",filePath:process.env.LOG_FILE_PATH})});function Lc(a){return a instanceof Error&&"code"in a}function ga(a){if(a instanceof Error)return a.message;try{return String(a)}catch{return"Failed to get error details"}}function nUe(a){if(a&&typeof a=="object"&&"response"in a){let r=h6a(a);if(r.error&&r.error.message&&r.error.code)switch(r.error.code){case 400:return new J1e(r.error.message);case 401:return new _d(r.error.message);case 403:return new B1e(r.error.message);default:}}return a}function h6a(a){return typeof a.response?.data=="string"?JSON.parse(a.response?.data):a.response?.data}function Ok(a){if(!a)return!1;try{let e=JSON.parse(a);return e&&e.error==="Unauthorized"&&e.errorCode==="AUTHENTICATION_FAILED"}catch{return!1}}var B1e,_d,J1e,au=ct(()=>{"use strict";B1e=class extends Error{},_d=class extends Error{},J1e=class extends Error{}});var Zn,jOt,QI,Gv=ct(()=>{"use strict";(function(a){a.CHAT_CONVERSATION="chat_conversation",a.WEB_FETCH="web_fetch",a.WEB_SEARCH="web_search",a.CONTENT_SUMMARY="content_summary",a.JSON_GENERATION="json_generation",a.COMPRESSION="compression",a.SUB_AGENT="sub_agent",a.CODE_ASSIST="code_assist",a.EDIT_CORRECTION="edit_correction",a.IMAGE_READER="image_reader",a.GOAL_EVALUATION="goal_evaluation"})(Zn||(Zn={}));jOt={[Zn.CHAT_CONVERSATION]:"auto",[Zn.WEB_FETCH]:"gemini-2.5-flash",[Zn.WEB_SEARCH]:"gemini-2.5-flash",[Zn.CODE_ASSIST]:"auto",[Zn.CONTENT_SUMMARY]:"gemini-2.5-flash-lite",[Zn.EDIT_CORRECTION]:"gemini-2.5-flash-lite",[Zn.JSON_GENERATION]:"gemini-2.5-flash",[Zn.COMPRESSION]:"gemini-2.5-flash",[Zn.SUB_AGENT]:"auto",[Zn.IMAGE_READER]:"gemini-2.5-flash",[Zn.GOAL_EVALUATION]:"deepseek-v4-flash"},QI=class{static getModelForScene(e){if(e)return jOt[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{[Zn.CHAT_CONVERSATION]:"\u804A\u5929\u5BF9\u8BDD",[Zn.WEB_FETCH]:"Web\u5185\u5BB9\u83B7\u53D6",[Zn.WEB_SEARCH]:"Web\u641C\u7D22",[Zn.CODE_ASSIST]:"\u4EE3\u7801\u52A9\u624B",[Zn.CONTENT_SUMMARY]:"\u5185\u5BB9\u6458\u8981",[Zn.EDIT_CORRECTION]:"\u7F16\u8F91\u6821\u6B63",[Zn.JSON_GENERATION]:"JSON\u751F\u6210",[Zn.COMPRESSION]:"\u5BF9\u8BDD\u538B\u7F29",[Zn.SUB_AGENT]:"SubAgent\u5B50\u4EE3\u7406",[Zn.IMAGE_READER]:"\u56FE\u7247\u8BC6\u522B",[Zn.GOAL_EVALUATION]:"\u76EE\u6807\u8FBE\u6210\u8BC4\u4F30"}[e]||e}}});function YA(a){return typeof a=="object"&&a!==null&&"error"in a&&typeof a.error=="object"&&"message"in a.error}function gb(a){return typeof a=="object"&&a!==null&&"message"in a&&typeof a.message=="string"}function m3(a){let e=r=>r.includes("Quota exceeded for quota metric 'Gemini")&&r.includes("Pro Requests'");if(typeof a=="string")return e(a);if(gb(a))return e(a.message);if(YA(a))return e(a.error.message);if(a&&typeof a=="object"&&"response"in a){let r=a;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 n=r.response.data;return e(n.error?.message||"")}}}return!1}function p3(a){return typeof a=="string"?a.includes("Quota exceeded for quota metric"):gb(a)?a.message.includes("Quota exceeded for quota metric"):YA(a)?a.error.message.includes("Quota exceeded for quota metric"):!1}function GG(a){if(a&&typeof a=="object"&&"response"in a){let e=a;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(a instanceof Error&&a.message&&(a.message.includes("API request failed (402):")&&(a.message.includes('"error":"Quota limit exceeded"')||a.message.includes('"error":"No quota configuration"'))||a.message.includes("API request failed (500):")&&a.message.includes("quota exceeded")||a.message.includes("Stream API error (500):")&&a.message.includes("quota exceeded")))return!0;if(typeof a=="object"&&a!==null){let e=a;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 a=="string"?a.includes("Quota limit exceeded")||a.includes("No quota configuration")||a.includes("Daily token limit would be exceeded")||a.includes("Daily request limit exceeded")||a.includes("Daily cost limit would be exceeded")||a.includes("500")&&a.includes("quota exceeded"):!1}function Kae(a){let e=null;if(a&&typeof a=="object"&&"response"in a){let r=a;if(r.response?.status===402&&r.response.data)e=r.response.data;else if(r.response?.status===500&&r.response.data){let n=r.response.data;n&&typeof n.message=="string"&&n.message.includes("quota exceeded")&&(e=n)}}else if(typeof a=="object"&&a!==null){let r=a;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 n=r.message.match(/\{.*\}$/);n&&(e=JSON.parse(n[0]))}catch{}e||(e=a)}if(!e&&a instanceof Error&&a.message&&(a.message.includes("API request failed (402):")||a.message.includes("API request failed (500):")||a.message.includes("Stream API error (500):"))&&(a.message.includes('"error":"Quota limit exceeded"')||a.message.includes('"error":"No quota configuration"')||a.message.includes("quota exceeded")))try{let r=a.message.match(/\{.*\}$/);r&&(e=JSON.parse(r[0]))}catch{}return e?e.message&&e.message.includes("quota exceeded")?m6a(e):p6a(e):null}function m6a(a){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}})(),n="",i="",o="",t="",s=a.message||"",u=s.match(/Role:\s*([^,]+)/);u&&(n=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
|
`,n&&(c+=`\u{1F464} \u89D2\u8272\u4FE1\u606F: ${n}
|
|
@@ -3754,7 +3754,7 @@ ${n}
|
|
|
3754
3754
|
\u{1F50D} Model Diagnostics: ${a}`),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(`
|
|
3755
3755
|
\u26A0\uFE0F Warnings:`),r.warnings.forEach(n=>console.log(` \u2022 ${n}`))),e&&r.recommendations.length>0&&(console.log(`
|
|
3756
3756
|
\u{1F4A1} Recommendations:`),r.recommendations.forEach(n=>console.log(` \u2022 ${n}`))),e&&(console.log(`
|
|
3757
|
-
\u{1F4CB} Full Capabilities:`),console.log(JSON.stringify(r.capabilities,null,2)))}function kGi(a){let e=Xke(a);return e.isSmallModel||e.needsSpecialHandling}function SGi(a){let e=Xke(a);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 Qoa=ct(()=>{"use strict";Jce();});import*as oN from"fs";import*as kke from"path";var LGi,xme,Hoa=ct(()=>{"use strict";Im();LGi="healthy-use-reminder.json",xme=class{projectRoot;stateFilePath;constructor(e){this.projectRoot=e;let r=zG(e);this.stateFilePath=kke.join(r,LGi)}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{oN.existsSync(this.stateFilePath)&&oN.unlinkSync(this.stateFilePath)}catch(e){process.env.DEBUG&&console.error("[HealthyUseReminderState] Failed to clear state:",e)}}loadState(){try{if(!oN.existsSync(this.stateFilePath))return null;let e=oN.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=kke.dirname(this.stateFilePath);oN.existsSync(r)||oN.mkdirSync(r,{recursive:!0}),oN.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,Rwt,BGi,JGi,TGi,Xoa=ct(()=>{"use strict";wwt="--- Content from referenced files ---",Rwt="--- End of content ---",BGi=2e3,JGi=2e3,TGi=20});function Soa(...a){return DGi(...a)}function Loa(...a){return OGi(...a)}function koa(a,e){return a in e}function Cwt(){let a={get(i,o){if(o==="write")return Soa;if(koa(o,i)){let t=i[o];return typeof t=="function"?t.bind(i):t}}},e=new Proxy(process.stdout,a),r={get(i,o){if(o==="write")return Loa;if(koa(o,i)){let t=i[o];return typeof t=="function"?t.bind(i):t}}},n=new Proxy(process.stderr,r);return{stdout:e,stderr:n}}var DGi,OGi,Boa=ct(()=>{"use strict";DGi=process.stdout.write.bind(process.stdout),OGi=process.stderr.write.bind(process.stderr)});import{readFile as MGi}from"node:fs/promises";import{fileURLToPath as UGi}from"node:url";import xwt from"node:path";function _Gi(){let a=globalThis.import?.meta??void 0;try{let r=typeof import.meta<"u"?import.meta.url:void 0;if(r)return xwt.dirname(UGi(r))}catch{}let e=globalThis.__dirname;return typeof e=="string"?e:process.cwd()}function Z5(){return Yme||(Yme=(async()=>"1.1.27")(),Yme)}function zGi(){Yme=void 0}var Yme,Ywt=ct(()=>{"use strict";});import{EventEmitter as PGi}from"node:events";var Vme,Vwt,Qwt,Joa=ct(()=>{"use strict";(function(a){a.ApprovalModeChanged="approval_mode_changed"})(Vme||(Vme={}));Vwt=class{emitter=new PGi;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()}},Qwt=new Vwt});function Ske(a){return Array.isArray(a)?a.map(e=>typeof e=="string"?{text:e}:e):typeof a=="string"?[{text:a}]:[a]}function jGi(a){return a.map(e=>typeof e.text=="string"?e.text:"").join("")}function Hwt(a){if(!a||a.length===0)return[];let e=[];for(let r of a){if(r.role&&(r.parts||r.content!==void 0)){let n=r.parts??Ske(r.content);e.push({role:r.role,parts:n});continue}if(!(r.type==="info"||r.type==="error"||r.type==="warning")){if(r.type==="user"){let n=r.content!==void 0?Ske(r.content):[],i=jGi(n).trim();if(i.startsWith("/")||i.startsWith("?")||n.length===0)continue;e.push({role:"user",parts:n});continue}if(r.type==="gemini"){let n=[];if(r.thoughts&&r.thoughts.length>0)for(let o of r.thoughts){let t=o.subject?`**${o.subject}** ${o.description}`:o.description;n.push({text:t,thought:!0})}let i=!!r.toolCalls&&r.toolCalls.length>0;if(r.content!==void 0&&n.push(...Ske(r.content)),i)for(let o of r.toolCalls)n.push({functionCall:{name:o.name,args:o.args,...o.id?{id:o.id}:{}}});if(n.length>0&&e.push({role:"model",parts:n}),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(...Ske(t.result)):o.push(t.result));o.length>0&&e.push({role:"user",parts:o})}}}}return e}var Toa=ct(()=>{"use strict";});var i8,Doa,Qme,Ooa=ct(()=>{"use strict";i8=class a extends Error{constructor(e){super(e),this.name="SessionError"}static noSessionsFound(){return new a("No persisted sessions found.")}static invalidSessionIdentifier(e,r){return new a(`Session '${e}' was not found under ${r}.`)}},Doa="latest",Qme=class{manager;constructor(e){this.manager=e}async sessionExists(e){return(await this.listAllMetadata()).some(n=>n.sessionId===e)}async listSessions(){return(await this.listAllMetadata()).map(r=>({id:r.sessionId,startTime:r.createdAt,title:r.title,messageCount:r.messageCount})).sort((r,n)=>new Date(r.startTime).getTime()-new Date(n.startTime).getTime())}async findSession(e){let r=e.trim(),n=await this.listSessions();if(n.length===0)throw i8.noSessionsFound();let i=n.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<=n.length)return n[o-1];throw i8.invalidSessionIdentifier(r,"sessions/")}async resolveSession(e){let r=e.trim(),n;if(r===Doa){let o=await this.listSessions();if(o.length===0)throw i8.noSessionsFound();n=o[o.length-1]}else n=await this.findSession(r);let i=await this.manager.loadSession(n.id);if(!i)throw new i8(`Session '${n.id}' exists in index but could not be loaded.`);return{session:n,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 qGi(a,e,r){return new Lke(a,e,r)}var Lke,Bke,Jke,Moa=ct(()=>{"use strict";Qce();sV();Lke=class a{tokenManager;baseURL;requestQueue=[];isRefreshing=!1;onAuthenticationRequired;constructor(e,r,n){this.baseURL=e.replace(/\/$/,""),this.tokenManager=r,this.onAuthenticationRequired=n}setAuthenticationRequiredCallback(e){this.onAuthenticationRequired=e}async request(e,r={}){let n=`${this.baseURL}${e}`,i=await this.prepareRequestOptions(r),o=await fetch(n,i);return o.status===401&&this.tokenManager&&(o=await this.handleUnauthorized(n,i)),o}async get(e,r={}){return this.request(e,{...r,method:"GET"})}async post(e,r,n={}){let i={...n,method:"POST",body:r?JSON.stringify(r):void 0};return r&&!n.headers?.["Content-Type"]&&(i.headers={"Content-Type":"application/json",...n.headers}),this.request(e,i)}async put(e,r,n={}){let i={...n,method:"PUT",body:r?JSON.stringify(r):void 0};return r&&!n.headers?.["Content-Type"]&&(i.headers={"Content-Type":"application/json",...n.headers}),this.request(e,i)}async delete(e,r={}){return this.request(e,{...r,method:"DELETE"})}async prepareRequestOptions(e){let r={"User-Agent":VI(),...e.headers};if(this.tokenManager)try{let n=await this.tokenManager.getAccessToken();n?r.Authorization=`Bearer ${n}`:rC("warn","\u26A0\uFE0F No access token available")}catch(n){rC("warn","\u26A0\uFE0F Failed to get access token:",n),this.onAuthenticationRequired&&n instanceof Error&&n.message?.includes("authentication required")&&(rC("log","\u{1F504} Triggering authentication flow..."),this.onAuthenticationRequired())}return{...e,headers:r}}async handleUnauthorized(e,r){if(this.isRefreshing)return new Promise((n,i)=>{this.requestQueue.push({resolve:n,reject:i,request:()=>fetch(e,r)})});this.isRefreshing=!0;try{rC("log","\u{1F504} Access token expired, attempting refresh...");let n=await this.tokenManager.refreshAccessToken();if(n){rC("log","\u2705 Token refreshed successfully");let i={...r,headers:{...r.headers,Authorization:`Bearer ${n}`}},o=fetch(e,i);return this.processRequestQueue(n),await o}else throw new Error("Failed to refresh token")}catch(n){throw console.error("\u274C Token refresh failed:",n),this.tokenManager.clearTokens?await this.tokenManager.clearTokens():this.tokenManager.clear&&this.tokenManager.clear(),this.rejectRequestQueue(new Error("Authentication required")),this.onAuthenticationRequired&&(rC("log","\u{1F504} Authentication required, triggering auth flow..."),this.onAuthenticationRequired()),new Bke("Authentication required - please re-authenticate")}finally{this.isRefreshing=!1}}processRequestQueue(e){this.requestQueue.splice(0).forEach(({resolve:n,reject:i,request:o})=>{o().then(t=>n(t)).catch(t=>i(t))})}rejectRequestQueue(e){this.requestQueue.splice(0).forEach(({reject:n})=>{n(e)})}static async checkResponse(e){if(!e.ok){let n=await e.text();throw new Jke(`HTTP ${e.status}: ${e.statusText}`,e.status,n)}let r=e.headers.get("content-type");return r&&r.includes("application/json")?await e.json():await e.text()}async requestJson(e,r={}){let n=await this.request(e,r);return a.checkResponse(n)}async postJson(e,r){let n=await this.post(e,r);return a.checkResponse(n)}async putJson(e,r){let n=await this.put(e,r);return a.checkResponse(n)}async getJson(e){let r=await this.get(e);return a.checkResponse(r)}async deleteJson(e){let r=await this.delete(e);return a.checkResponse(r)}},Bke=class extends Error{constructor(e){super(e),this.name="AuthenticationError"}},Jke=class extends Error{status;response;constructor(e,r,n){super(e),this.name="HttpError",this.status=r,this.response=n}}});function KGi(a){return Hme.getInstance(a)}function $Gi(a){let e=Hme.getInstance(a);return()=>e.handleAuthenticationRequired()}var Hme,Uoa=ct(()=>{"use strict";oV();Hme=class a{static instance=null;config;isAuthenticating=!1;constructor(e={}){this.config={authUrl:"/auth",autoOpenBrowser:!0,...e}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.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"),il.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 n=`${il.getInstance().getProxyServerUrl()}${this.config.authUrl}`;console.log(`[AuthNavigator] Redirecting to auth page: ${n}`),window.location.href=n}else console.error("[AuthNavigator] Cannot redirect in non-browser environment")}isInProgress(){return this.isAuthenticating}}});function Dke(a){let r={authUrl:"https://accounts.deepvlab.ai/login",redirectUri:`http://localhost:${a||7863}/callback?plat=deepvlab`};return new Tke(r)}var Tke,Xwt=ct(()=>{"use strict";Tke=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 n=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}`}):n?i?(console.log("\u{1F389} [DeepVlab Auth] \u83B7\u53D6\u5230JWT Token:",n),console.log("\u{1F389} [DeepVlab Auth] \u83B7\u53D6\u5230User ID:",i),console.log("\u2705 [DeepVlab Auth] DeepVlab\u8BA4\u8BC1\u6210\u529F"),{success:!0,token:n,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 Oke from"fs";import*as Lg from"path";function e1i(){return typeof globalThis.__dirname=="string"?globalThis.__dirname:""}var Xme,YH,kwt=ct(()=>{"use strict";Xme=e1i(),YH=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(Lg.join(this.customBasePath,"dist","bundled","auth","login","templates",e)),r.push(Lg.join(this.customBasePath,"bundled","auth","login","templates",e)),r.push(Lg.join(this.customBasePath,"auth","login","templates",e))),Xme&&r.push(Lg.join(Xme,e)),Xme){let o=Xme;for(let t=0;t<10;t++)r.push(Lg.join(o,"bundled","auth","login","templates",e)),r.push(Lg.join(o,"bundled",e)),r.push(Lg.join(o,"bundle","login","templates",e)),r.push(Lg.join(o,"auth","login","templates",e)),o=Lg.dirname(o)}if(typeof process<"u"&&process.cwd)try{let o=process.cwd();r.push(Lg.join(o,"bundle","login","templates",e)),r.push(Lg.join(o,"dist","bundled","auth","login","templates",e)),r.push(Lg.join(o,"bundled","auth","login","templates",e)),r.push(Lg.join(o,"auth","login","templates",e))}catch{}let n=null;for(let o of r)try{if(Oke.existsSync(o)){n=o,console.error(`\u2705 [AuthTemplates] Template loaded: ${e} from ${o}`);break}}catch{continue}if(!n){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=Oke.readFileSync(n,"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`
|
|
3757
|
+
\u{1F4CB} Full Capabilities:`),console.log(JSON.stringify(r.capabilities,null,2)))}function kGi(a){let e=Xke(a);return e.isSmallModel||e.needsSpecialHandling}function SGi(a){let e=Xke(a);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 Qoa=ct(()=>{"use strict";Jce();});import*as oN from"fs";import*as kke from"path";var LGi,xme,Hoa=ct(()=>{"use strict";Im();LGi="healthy-use-reminder.json",xme=class{projectRoot;stateFilePath;constructor(e){this.projectRoot=e;let r=zG(e);this.stateFilePath=kke.join(r,LGi)}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{oN.existsSync(this.stateFilePath)&&oN.unlinkSync(this.stateFilePath)}catch(e){process.env.DEBUG&&console.error("[HealthyUseReminderState] Failed to clear state:",e)}}loadState(){try{if(!oN.existsSync(this.stateFilePath))return null;let e=oN.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=kke.dirname(this.stateFilePath);oN.existsSync(r)||oN.mkdirSync(r,{recursive:!0}),oN.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,Rwt,BGi,JGi,TGi,Xoa=ct(()=>{"use strict";wwt="--- Content from referenced files ---",Rwt="--- End of content ---",BGi=2e3,JGi=2e3,TGi=20});function Soa(...a){return DGi(...a)}function Loa(...a){return OGi(...a)}function koa(a,e){return a in e}function Cwt(){let a={get(i,o){if(o==="write")return Soa;if(koa(o,i)){let t=i[o];return typeof t=="function"?t.bind(i):t}}},e=new Proxy(process.stdout,a),r={get(i,o){if(o==="write")return Loa;if(koa(o,i)){let t=i[o];return typeof t=="function"?t.bind(i):t}}},n=new Proxy(process.stderr,r);return{stdout:e,stderr:n}}var DGi,OGi,Boa=ct(()=>{"use strict";DGi=process.stdout.write.bind(process.stdout),OGi=process.stderr.write.bind(process.stderr)});import{readFile as MGi}from"node:fs/promises";import{fileURLToPath as UGi}from"node:url";import xwt from"node:path";function _Gi(){let a=globalThis.import?.meta??void 0;try{let r=typeof import.meta<"u"?import.meta.url:void 0;if(r)return xwt.dirname(UGi(r))}catch{}let e=globalThis.__dirname;return typeof e=="string"?e:process.cwd()}function Z5(){return Yme||(Yme=(async()=>"1.1.28")(),Yme)}function zGi(){Yme=void 0}var Yme,Ywt=ct(()=>{"use strict";});import{EventEmitter as PGi}from"node:events";var Vme,Vwt,Qwt,Joa=ct(()=>{"use strict";(function(a){a.ApprovalModeChanged="approval_mode_changed"})(Vme||(Vme={}));Vwt=class{emitter=new PGi;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()}},Qwt=new Vwt});function Ske(a){return Array.isArray(a)?a.map(e=>typeof e=="string"?{text:e}:e):typeof a=="string"?[{text:a}]:[a]}function jGi(a){return a.map(e=>typeof e.text=="string"?e.text:"").join("")}function Hwt(a){if(!a||a.length===0)return[];let e=[];for(let r of a){if(r.role&&(r.parts||r.content!==void 0)){let n=r.parts??Ske(r.content);e.push({role:r.role,parts:n});continue}if(!(r.type==="info"||r.type==="error"||r.type==="warning")){if(r.type==="user"){let n=r.content!==void 0?Ske(r.content):[],i=jGi(n).trim();if(i.startsWith("/")||i.startsWith("?")||n.length===0)continue;e.push({role:"user",parts:n});continue}if(r.type==="gemini"){let n=[];if(r.thoughts&&r.thoughts.length>0)for(let o of r.thoughts){let t=o.subject?`**${o.subject}** ${o.description}`:o.description;n.push({text:t,thought:!0})}let i=!!r.toolCalls&&r.toolCalls.length>0;if(r.content!==void 0&&n.push(...Ske(r.content)),i)for(let o of r.toolCalls)n.push({functionCall:{name:o.name,args:o.args,...o.id?{id:o.id}:{}}});if(n.length>0&&e.push({role:"model",parts:n}),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(...Ske(t.result)):o.push(t.result));o.length>0&&e.push({role:"user",parts:o})}}}}return e}var Toa=ct(()=>{"use strict";});var i8,Doa,Qme,Ooa=ct(()=>{"use strict";i8=class a extends Error{constructor(e){super(e),this.name="SessionError"}static noSessionsFound(){return new a("No persisted sessions found.")}static invalidSessionIdentifier(e,r){return new a(`Session '${e}' was not found under ${r}.`)}},Doa="latest",Qme=class{manager;constructor(e){this.manager=e}async sessionExists(e){return(await this.listAllMetadata()).some(n=>n.sessionId===e)}async listSessions(){return(await this.listAllMetadata()).map(r=>({id:r.sessionId,startTime:r.createdAt,title:r.title,messageCount:r.messageCount})).sort((r,n)=>new Date(r.startTime).getTime()-new Date(n.startTime).getTime())}async findSession(e){let r=e.trim(),n=await this.listSessions();if(n.length===0)throw i8.noSessionsFound();let i=n.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<=n.length)return n[o-1];throw i8.invalidSessionIdentifier(r,"sessions/")}async resolveSession(e){let r=e.trim(),n;if(r===Doa){let o=await this.listSessions();if(o.length===0)throw i8.noSessionsFound();n=o[o.length-1]}else n=await this.findSession(r);let i=await this.manager.loadSession(n.id);if(!i)throw new i8(`Session '${n.id}' exists in index but could not be loaded.`);return{session:n,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 qGi(a,e,r){return new Lke(a,e,r)}var Lke,Bke,Jke,Moa=ct(()=>{"use strict";Qce();sV();Lke=class a{tokenManager;baseURL;requestQueue=[];isRefreshing=!1;onAuthenticationRequired;constructor(e,r,n){this.baseURL=e.replace(/\/$/,""),this.tokenManager=r,this.onAuthenticationRequired=n}setAuthenticationRequiredCallback(e){this.onAuthenticationRequired=e}async request(e,r={}){let n=`${this.baseURL}${e}`,i=await this.prepareRequestOptions(r),o=await fetch(n,i);return o.status===401&&this.tokenManager&&(o=await this.handleUnauthorized(n,i)),o}async get(e,r={}){return this.request(e,{...r,method:"GET"})}async post(e,r,n={}){let i={...n,method:"POST",body:r?JSON.stringify(r):void 0};return r&&!n.headers?.["Content-Type"]&&(i.headers={"Content-Type":"application/json",...n.headers}),this.request(e,i)}async put(e,r,n={}){let i={...n,method:"PUT",body:r?JSON.stringify(r):void 0};return r&&!n.headers?.["Content-Type"]&&(i.headers={"Content-Type":"application/json",...n.headers}),this.request(e,i)}async delete(e,r={}){return this.request(e,{...r,method:"DELETE"})}async prepareRequestOptions(e){let r={"User-Agent":VI(),...e.headers};if(this.tokenManager)try{let n=await this.tokenManager.getAccessToken();n?r.Authorization=`Bearer ${n}`:rC("warn","\u26A0\uFE0F No access token available")}catch(n){rC("warn","\u26A0\uFE0F Failed to get access token:",n),this.onAuthenticationRequired&&n instanceof Error&&n.message?.includes("authentication required")&&(rC("log","\u{1F504} Triggering authentication flow..."),this.onAuthenticationRequired())}return{...e,headers:r}}async handleUnauthorized(e,r){if(this.isRefreshing)return new Promise((n,i)=>{this.requestQueue.push({resolve:n,reject:i,request:()=>fetch(e,r)})});this.isRefreshing=!0;try{rC("log","\u{1F504} Access token expired, attempting refresh...");let n=await this.tokenManager.refreshAccessToken();if(n){rC("log","\u2705 Token refreshed successfully");let i={...r,headers:{...r.headers,Authorization:`Bearer ${n}`}},o=fetch(e,i);return this.processRequestQueue(n),await o}else throw new Error("Failed to refresh token")}catch(n){throw console.error("\u274C Token refresh failed:",n),this.tokenManager.clearTokens?await this.tokenManager.clearTokens():this.tokenManager.clear&&this.tokenManager.clear(),this.rejectRequestQueue(new Error("Authentication required")),this.onAuthenticationRequired&&(rC("log","\u{1F504} Authentication required, triggering auth flow..."),this.onAuthenticationRequired()),new Bke("Authentication required - please re-authenticate")}finally{this.isRefreshing=!1}}processRequestQueue(e){this.requestQueue.splice(0).forEach(({resolve:n,reject:i,request:o})=>{o().then(t=>n(t)).catch(t=>i(t))})}rejectRequestQueue(e){this.requestQueue.splice(0).forEach(({reject:n})=>{n(e)})}static async checkResponse(e){if(!e.ok){let n=await e.text();throw new Jke(`HTTP ${e.status}: ${e.statusText}`,e.status,n)}let r=e.headers.get("content-type");return r&&r.includes("application/json")?await e.json():await e.text()}async requestJson(e,r={}){let n=await this.request(e,r);return a.checkResponse(n)}async postJson(e,r){let n=await this.post(e,r);return a.checkResponse(n)}async putJson(e,r){let n=await this.put(e,r);return a.checkResponse(n)}async getJson(e){let r=await this.get(e);return a.checkResponse(r)}async deleteJson(e){let r=await this.delete(e);return a.checkResponse(r)}},Bke=class extends Error{constructor(e){super(e),this.name="AuthenticationError"}},Jke=class extends Error{status;response;constructor(e,r,n){super(e),this.name="HttpError",this.status=r,this.response=n}}});function KGi(a){return Hme.getInstance(a)}function $Gi(a){let e=Hme.getInstance(a);return()=>e.handleAuthenticationRequired()}var Hme,Uoa=ct(()=>{"use strict";oV();Hme=class a{static instance=null;config;isAuthenticating=!1;constructor(e={}){this.config={authUrl:"/auth",autoOpenBrowser:!0,...e}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.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"),il.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 n=`${il.getInstance().getProxyServerUrl()}${this.config.authUrl}`;console.log(`[AuthNavigator] Redirecting to auth page: ${n}`),window.location.href=n}else console.error("[AuthNavigator] Cannot redirect in non-browser environment")}isInProgress(){return this.isAuthenticating}}});function Dke(a){let r={authUrl:"https://accounts.deepvlab.ai/login",redirectUri:`http://localhost:${a||7863}/callback?plat=deepvlab`};return new Tke(r)}var Tke,Xwt=ct(()=>{"use strict";Tke=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 n=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}`}):n?i?(console.log("\u{1F389} [DeepVlab Auth] \u83B7\u53D6\u5230JWT Token:",n),console.log("\u{1F389} [DeepVlab Auth] \u83B7\u53D6\u5230User ID:",i),console.log("\u2705 [DeepVlab Auth] DeepVlab\u8BA4\u8BC1\u6210\u529F"),{success:!0,token:n,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 Oke from"fs";import*as Lg from"path";function e1i(){return typeof globalThis.__dirname=="string"?globalThis.__dirname:""}var Xme,YH,kwt=ct(()=>{"use strict";Xme=e1i(),YH=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(Lg.join(this.customBasePath,"dist","bundled","auth","login","templates",e)),r.push(Lg.join(this.customBasePath,"bundled","auth","login","templates",e)),r.push(Lg.join(this.customBasePath,"auth","login","templates",e))),Xme&&r.push(Lg.join(Xme,e)),Xme){let o=Xme;for(let t=0;t<10;t++)r.push(Lg.join(o,"bundled","auth","login","templates",e)),r.push(Lg.join(o,"bundled",e)),r.push(Lg.join(o,"bundle","login","templates",e)),r.push(Lg.join(o,"auth","login","templates",e)),o=Lg.dirname(o)}if(typeof process<"u"&&process.cwd)try{let o=process.cwd();r.push(Lg.join(o,"bundle","login","templates",e)),r.push(Lg.join(o,"dist","bundled","auth","login","templates",e)),r.push(Lg.join(o,"bundled","auth","login","templates",e)),r.push(Lg.join(o,"auth","login","templates",e))}catch{}let n=null;for(let o of r)try{if(Oke.existsSync(o)){n=o,console.error(`\u2705 [AuthTemplates] Template loaded: ${e} from ${o}`);break}}catch{continue}if(!n){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=Oke.readFileSync(n,"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`
|
|
3758
3758
|
<!DOCTYPE html>
|
|
3759
3759
|
<html>
|
|
3760
3760
|
<head>
|
|
@@ -4935,7 +4935,7 @@ ${m}`),n?o.reset(m):m}function XAi(a,e,r,n={}){if(!$ua){$ua=!0;let o="Passing li
|
|
|
4935
4935
|
|
|
4936
4936
|
${e}
|
|
4937
4937
|
`:""}`}set message(e){this.#r=e}#i(e){if(!this.#t)return;let r=this.#e,n=BAi(r,this.#t.message);if(n)return(0,lda.codeFrameColumns)(r,{start:n},{highlightCode:e})}get codeFrame(){return this.#a??=this.#i(!0),this.#a}get rawCodeFrame(){return this.#n??=this.#i(!1),this.#n}},BAi=(a,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:n,line:i,column:o}=r.groups;return i&&o?{line:Number(i),column:Number(o)}:C5t(a,Number(n),{oneBased:!0})},JAi=a=>a.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,n)=>`"${n}"(${LAi(n)})`)});var V5t=Ze((Qoo,TAi)=>{TAi.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 uda=Ze((Hoo,DAi)=>{DAi.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 dda=Ze((Xoo,OAi)=>{OAi.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 hda=Ze((koo,Ida)=>{"use strict";var MAi=[].concat(V5t()).concat(uda()),UAi=dda();Ida.exports=function(a){var e=0;function r(){return e<a.length}function n(v){if(v instanceof RegExp){var G=a.slice(e),A=G.match(v);if(A)return e+=A[0].length,A[0]}else if(a.indexOf(v,e)===e)return e+=v.length,v}function i(){n(/[ ]*/)}function o(){for(var v,G=["WITH","AND","OR","(",")",":","+"],A=0;A<G.length&&(v=n(G[A]),!v);A++);if(v==="+"&&e>1&&a[e-2]===" ")throw new Error("Space before `+`");return v&&{type:"OPERATOR",string:v}}function t(){return n(/[A-Za-z0-9-.]+/)}function s(){var v=t();if(!v)throw new Error("Expected idstring at offset "+e);return v}function u(){if(n("DocumentRef-")){var v=s();return{type:"DOCUMENTREF",string:v}}}function I(){if(n("LicenseRef-")){var v=s();return{type:"LICENSEREF",string:v}}}function d(){var v=e,G=t();if(MAi.indexOf(G)!==-1)return{type:"LICENSE",string:G};if(UAi.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 `"+a[e]+"` at offset "+e);c.push(m)}return c}});var pda=Ze((Soo,mda)=>{"use strict";mda.exports=function(a){var e=0;function r(){return e<a.length}function n(){return r()?a[e]:null}function i(){if(!r())throw new Error;e++}function o(G){var A=n();if(A&&A.type==="OPERATOR"&&G===A.string)return i(),A.string}function t(){if(o("WITH")){var G=n();if(G&&G.type==="EXCEPTION")return i(),G.string;throw new Error("Expected exception after `WITH`")}}function s(){var G=e,A="",Z=n();if(Z.type==="DOCUMENTREF"&&(i(),A+="DocumentRef-"+Z.string+":",!o(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(Z=n(),Z.type==="LICENSEREF")return i(),A+="LicenseRef-"+Z.string,{license:A};e=G}function u(){var G=n();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 Q5t=Ze((Loo,fda)=>{"use strict";var _Ai=hda(),zAi=pda();fda.exports=function(a){return zAi(_Ai(a))}});var Wda=Ze((Boo,Nda)=>{var PAi=Q5t(),jAi=V5t();function k6e(a){try{return PAi(a),!0}catch{return!1}}function Zda(a,e){var r=e[0].length-a[0].length;return r!==0?r:a[0].toUpperCase().localeCompare(e[0].toUpperCase())}var bda=[["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(Zda),qAi=0,KAi=1,gda=[function(a){return a.toUpperCase()},function(a){return a.trim()},function(a){return a.replace(/\./g,"")},function(a){return a.replace(/\s+/g,"")},function(a){return a.replace(/\s+/g,"-")},function(a){return a.replace("v","-")},function(a){return a.replace(/,?\s*(\d)/,"-$1")},function(a){return a.replace(/,?\s*(\d)/,"-$1.0")},function(a){return a.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(a){return a.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(a){return a[0].toUpperCase()+a.slice(1)},function(a){return a.replace("/","-")},function(a){return a.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(a){return a.indexOf("3.0")!==-1?a+"-or-later":a+"-only"},function(a){return a+"only"},function(a){return a.replace(/(\d)$/,"-$1.0")},function(a){return a.replace(/(-| )?(\d)$/,"-$2-Clause")},function(a){return a.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(a){return a.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(a){return a.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(a){return a.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(a){return a.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(a){return a.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(a){return"CC-"+a},function(a){return"CC-"+a+"-4.0"},function(a){return a.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(a){return"CC-"+a.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],H5t=jAi.map(function(a){var e=/^(.*)-\d+\.\d+$/.exec(a);return e?[e[0],e[1]]:[a,null]}).reduce(function(a,e){var r=e[1];return a[r]=a[r]||[],a[r].push(e[0]),a},{}),$Ai=Object.keys(H5t).map(function(e){return[e,H5t[e]]}).filter(function(e){return e[1].length===1&&e[0]!==null&&e[0]!=="APL"}).map(function(e){return[e[0],e[1][0]]});H5t=void 0;var Gda=[["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($Ai).sort(Zda),eZi=0,tZi=1,vda=function(a){for(var e=0;e<gda.length;e++){var r=gda[e](a).trim();if(r!==a&&k6e(r))return r}return null},yda=function(a){for(var e=a.toUpperCase(),r=0;r<Gda.length;r++){var n=Gda[r];if(e.indexOf(n[eZi])>-1)return n[tZi]}return null},Ada=function(a,e){for(var r=0;r<bda.length;r++){var n=bda[r],i=n[qAi];if(a.indexOf(i)>-1){var o=a.replace(i,n[KAi]),t=e(o);if(t!==null)return t}}return null};Nda.exports=function(a,e){e=e||{};var r=e.upgrade===void 0?!0:!!e.upgrade;function n(s){return r?rZi(s):s}var i=typeof a=="string"&&a.trim().length!==0;if(!i)throw Error("Invalid argument. Expected non-empty string.");if(a=a.trim(),k6e(a))return n(a);var o=a.replace(/\+$/,"").trim();if(k6e(o))return n(o);var t=vda(a);return t!==null||(t=Ada(a,function(s){return k6e(s)?s:vda(s)}),t!==null)||(t=yda(a),t!==null)||(t=Ada(a,yda),t!==null)?n(t):null};function rZi(a){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(a)!==-1?a+"-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(a)!==-1?a.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(a)!==-1?a+"-or-later":a}});var Rda=Ze((Joo,wda)=>{var aZi=Q5t(),nZi=Wda(),Fda='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',iZi=/^SEE LICEN[CS]E IN (.+)$/;function Eda(a,e){return e.slice(0,a.length)===a}function X5t(a){if(a.hasOwnProperty("license")){var e=a.license;return Eda("LicenseRef",e)||Eda("DocumentRef",e)}else return X5t(a.left)||X5t(a.right)}wda.exports=function(a){var e;try{e=aZi(a)}catch{var r;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(r=iZi.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:r[1]};var n={validForOldPackages:!1,validForNewPackages:!1,warnings:[Fda]};if(a.trim().length!==0){var i=nZi(a);i&&n.warnings.push('license is similar to the valid expression "'+i+'"')}return n}return X5t(e)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[Fda]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}});var Qda=Ze(L6e=>{"use strict";Object.defineProperty(L6e,"__esModule",{value:!0});L6e.LRUCache=void 0;var q$=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xda=new Set,k5t=typeof process=="object"&&process?process:{},Yda=(a,e,r,n)=>{typeof k5t.emitWarning=="function"?k5t.emitWarning(a,e,r,n):console.error(`[${r}] ${e}: ${a}`)},S6e=globalThis.AbortController,Cda=globalThis.AbortSignal;if(typeof S6e>"u"){Cda=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},S6e=class{constructor(){e()}signal=new Cda;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let a=k5t.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{a&&(a=!1,Yda("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 sZi=a=>!xda.has(a),Ooo=Symbol("type"),TH=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),Vda=a=>TH(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?K$:null:null,K$=class extends Array{constructor(e){super(e),this.fill(0)}},S5t=class a{heap;length;static#e=!1;static create(e){let r=Vda(e);if(!r)return[];a.#e=!0;let n=new a(e,r);return a.#e=!1,n}constructor(e,r){if(!a.#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]}},L5t=class a{#e;#t;#r;#a;#n;#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,n,i,o)=>e.#x(r,n,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.#n}get memoMethod(){return this.#i}get dispose(){return this.#r}get disposeAfter(){return this.#a}constructor(e){let{max:r=0,ttl:n,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&&!TH(r))throw new TypeError("max option must be a nonnegative integer");let N=r?Vda(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.#n=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=S5t.create(r),this.#u=0,this.#o=0,typeof I=="function"&&(this.#r=I),typeof d=="function"?(this.#a=d,this.#f=[]):(this.#a=void 0,this.#f=void 0),this.#N=!!this.#r,this.#g=!!this.#a,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&&!TH(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!TH(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=TH(i)||i===0?i:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!TH(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";sZi(w)&&(xda.add(w),Yda("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",w,a))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#W(){let e=new K$(this.#e),r=new K$(this.#e);this.#Z=e,this.#G=r,this.#H=(o,t,s=q$.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?q$.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=n||i();let I=o.now-u;o.remainingTTL=s-I}};let n=0,i=()=>{let o=q$.now();if(this.ttlResolution>0){n=o;let t=setTimeout(()=>n=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=(n||i())-u;return s-I},this.#R=o=>{let t=r[o],s=e[o];return!!s&&!!t&&(n||i())-t>s}}#w=()=>{};#c=()=>{};#H=()=>{};#R=()=>!1;#C(){let e=new K$(this.#e);this.#o=0,this.#E=e,this.#Y=r=>{this.#o-=e[r],e[r]=0},this.#F=(r,n,i,o)=>{if(this.#v(n))return 0;if(!TH(i))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(i=o(n,r),!TH(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,n,i)=>{if(e[r]=n,this.#t){let o=this.#t-e[r];for(;this.#o>o;)this.#B(!0)}this.#o+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#o)}}#Y=e=>{};#S=(e,r,n)=>{};#F=(e,r,n,i)=>{if(n||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 n of this.#L()){let i=this.#d[n],o=this.#v(i)?i.__staleWhileFetching:i;if(o!==void 0&&e(o,this.#I[n],this))return this.get(this.#I[n],r)}}forEach(e,r=this){for(let n of this.#L()){let i=this.#d[n],o=this.#v(i)?i.__staleWhileFetching:i;o!==void 0&&e.call(r,o,this.#I[n],this)}}rforEach(e,r=this){for(let n of this.#V()){let i=this.#d[n],o=this.#v(i)?i.__staleWhileFetching:i;o!==void 0&&e.call(r,o,this.#I[n],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 n=this.#d[r],i=this.#v(n)?n.__staleWhileFetching:n;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-(q$.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 n=this.#I[r],i=this.#d[r],o=this.#v(i)?i.__staleWhileFetching:i;if(o===void 0||n===void 0)continue;let t={value:o};if(this.#Z&&this.#G){t.ttl=this.#Z[r];let s=q$.now()-this.#G[r];t.start=Math.floor(Date.now()-s)}this.#E&&(t.size=this.#E[r]),e.unshift([n,t])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=q$.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){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}=n,{noUpdateTTL:I=this.noUpdateTTL}=n,d=this.#F(e,r,n.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.#a?.(...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.#a?.(...r)}}}#B(e){let r=this.#m,n=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,n,"evict"),this.#g&&this.#f?.push([i,n,"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(n),this.#u--,r}has(e,r={}){let{updateAgeOnHas:n=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 n&&this.#w(o),i&&(i.has="hit",this.#c(i,o)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#s.get(e);if(i===void 0||!n&&this.#R(i))return;let o=this.#d[i];return this.#v(o)?o.__staleWhileFetching:o}#x(e,r,n,i){let o=r===void 0?void 0:this.#d[r];if(this.#v(o))return o;let t=new S6e,{signal:s}=n;s?.addEventListener("abort",()=>t.abort(s.reason),{signal:t.signal});let u={signal:t.signal,options:n,context:i},I=(G,A=!1)=>{let{aborted:Z}=t.signal,R=n.ignoreFetchAbort&&G!==void 0;if(n.status&&(Z&&!A?(n.status.fetchAborted=!0,n.status.fetchError=t.signal.reason,R&&(n.status.fetchAbortIgnored=!0)):n.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"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,G,u.options))),G},d=G=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=G),h(G)),h=G=>{let{aborted:A}=t.signal,Z=A&&n.allowStaleOnFetchAbort,R=Z||n.allowStaleOnFetchRejection,F=R||n.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 n.status&&E.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw G},c=(G,A)=>{let Z=this.#n?.(e,o,u);Z&&Z instanceof Promise&&Z.then(R=>G(R===void 0?void 0:R),A),t.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(G(void 0),n.allowStaleOnFetchAbort&&(G=R=>I(R,!0)))})};n.status&&(n.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 S6e}async fetch(e,r={}){let{allowStale:n=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:n,updateAgeOnGet:i,noDeleteOnStaleGet:o,status:Z});let F={allowStale:n,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=n&&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&&n;return Z&&(Z.fetch=y?"stale":"refresh",b&&y&&(Z.returnedStale=!0)),b?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#i;if(!n)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=n(e,s,{options:t,context:i});return this.set(e,u,t),u}get(e,r={}){let{allowStale:n=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&&n&&u.__staleWhileFetching!==void 0&&(t.returnedStale=!0),n?u.__staleWhileFetching:void 0):(o||this.#k(e,"expire"),t&&n&&(t.returnedStale=!0),n?u:void 0)):(t&&(t.get="hit"),I?u.__staleWhileFetching:(this.#D(s),i&&this.#w(s),u))}else t&&(t.get="miss")}#T(e,r){this.#l[r]=e,this.#h[e]=r}#D(e){e!==this.#b&&(e===this.#m?this.#m=this.#h[e]:this.#T(this.#l[e],this.#h[e]),this.#T(this.#b,e),this.#b=e)}delete(e){return this.#k(e,"delete")}#k(e,r){let n=!1;if(this.#u!==0){let i=this.#s.get(e);if(i!==void 0)if(n=!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.#a?.(...o)}return n}clear(){return this.#p("delete")}#p(e){for(let r of this.#V({allowStale:!0})){let n=this.#d[r];if(this.#v(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#I[r];this.#N&&this.#r?.(n,i,e),this.#g&&this.#f?.push([n,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,n;for(;n=r?.shift();)this.#a?.(...n)}}};L6e.LRUCache=L5t});var kda=Ze((Uoo,Xda)=>{"use strict";var sc=(...a)=>a.every(e=>e)?a.join(""):"",X0=a=>a?encodeURIComponent(a):"",Hda=a=>a.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-"),oZi={sshtemplate:({domain:a,user:e,project:r,committish:n})=>`git@${a}:${e}/${r}.git${sc("#",n)}`,sshurltemplate:({domain:a,user:e,project:r,committish:n})=>`git+ssh://git@${a}/${e}/${r}.git${sc("#",n)}`,edittemplate:({domain:a,user:e,project:r,committish:n,editpath:i,path:o})=>`https://${a}/${e}/${r}${sc("/",i,"/",X0(n||"HEAD"),"/",o)}`,browsetemplate:({domain:a,user:e,project:r,committish:n,treepath:i})=>`https://${a}/${e}/${r}${sc("/",i,"/",X0(n))}`,browsetreetemplate:({domain:a,user:e,project:r,committish:n,treepath:i,path:o,fragment:t,hashformat:s})=>`https://${a}/${e}/${r}/${i}/${X0(n||"HEAD")}/${o}${sc("#",s(t||""))}`,browseblobtemplate:({domain:a,user:e,project:r,committish:n,blobpath:i,path:o,fragment:t,hashformat:s})=>`https://${a}/${e}/${r}/${i}/${X0(n||"HEAD")}/${o}${sc("#",s(t||""))}`,docstemplate:({domain:a,user:e,project:r,treepath:n,committish:i})=>`https://${a}/${e}/${r}${sc("/",n,"/",X0(i))}#readme`,httpstemplate:({auth:a,domain:e,user:r,project:n,committish:i})=>`git+https://${sc(a,"@")}${e}/${r}/${n}.git${sc("#",i)}`,filetemplate:({domain:a,user:e,project:r,committish:n,path:i})=>`https://${a}/${e}/${r}/raw/${X0(n||"HEAD")}/${i}`,shortcuttemplate:({type:a,user:e,project:r,committish:n})=>`${a}:${e}/${r}${sc("#",n)}`,pathtemplate:({user:a,project:e,committish:r})=>`${a}/${e}${sc("#",r)}`,bugstemplate:({domain:a,user:e,project:r})=>`https://${a}/${e}/${r}/issues`,hashformat:Hda},DH={};DH.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:a,user:e,project:r,committish:n,path:i})=>`https://${sc(a,"@")}raw.githubusercontent.com/${e}/${r}/${X0(n||"HEAD")}/${i}`,gittemplate:({auth:a,domain:e,user:r,project:n,committish:i})=>`git://${sc(a,"@")}${e}/${r}/${n}.git${sc("#",i)}`,tarballtemplate:({domain:a,user:e,project:r,committish:n})=>`https://codeload.${a}/${e}/${r}/tar.gz/${X0(n||"HEAD")}`,extract:a=>{let[,e,r,n,i]=a.pathname.split("/",5);if(!(n&&n!=="tree")&&(n||(i=a.hash.slice(1)),r&&r.endsWith(".git")&&(r=r.slice(0,-4)),!(!e||!r)))return{user:e,project:r,committish:i}}};DH.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:a,user:e,project:r,committish:n,treepath:i,path:o,editpath:t})=>`https://${a}/${e}/${r}${sc("/",i,"/",X0(n||"HEAD"),"/",o,t)}`,tarballtemplate:({domain:a,user:e,project:r,committish:n})=>`https://${a}/${e}/${r}/get/${X0(n||"HEAD")}.tar.gz`,extract:a=>{let[,e,r,n]=a.pathname.split("/",4);if(!["get"].includes(n)&&(r&&r.endsWith(".git")&&(r=r.slice(0,-4)),!(!e||!r)))return{user:e,project:r,committish:a.hash.slice(1)}}};DH.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:a,domain:e,user:r,project:n,committish:i})=>`git+https://${sc(a,"@")}${e}/${r}/${n}.git${sc("#",i)}`,tarballtemplate:({domain:a,user:e,project:r,committish:n})=>`https://${a}/${e}/${r}/repository/archive.tar.gz?ref=${X0(n||"HEAD")}`,extract:a=>{let e=a.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let r=e.split("/"),n=r.pop();n.endsWith(".git")&&(n=n.slice(0,-4));let i=r.join("/");if(!(!i||!n))return{user:i,project:n,committish:a.hash.slice(1)}}};DH.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:a,project:e,committish:r})=>`git@${a}:${e}.git${sc("#",r)}`,sshurltemplate:({domain:a,project:e,committish:r})=>`git+ssh://git@${a}/${e}.git${sc("#",r)}`,edittemplate:({domain:a,user:e,project:r,committish:n,editpath:i})=>`https://${a}/${e}/${r}${sc("/",X0(n))}/${i}`,browsetemplate:({domain:a,project:e,committish:r})=>`https://${a}/${e}${sc("/",X0(r))}`,browsetreetemplate:({domain:a,project:e,committish:r,path:n,hashformat:i})=>`https://${a}/${e}${sc("/",X0(r))}${sc("#",i(n))}`,browseblobtemplate:({domain:a,project:e,committish:r,path:n,hashformat:i})=>`https://${a}/${e}${sc("/",X0(r))}${sc("#",i(n))}`,docstemplate:({domain:a,project:e,committish:r})=>`https://${a}/${e}${sc("/",X0(r))}`,httpstemplate:({domain:a,project:e,committish:r})=>`git+https://${a}/${e}.git${sc("#",r)}`,filetemplate:({user:a,project:e,committish:r,path:n})=>`https://gist.githubusercontent.com/${a}/${e}/raw${sc("/",X0(r))}/${n}`,shortcuttemplate:({type:a,project:e,committish:r})=>`${a}:${e}${sc("#",r)}`,pathtemplate:({project:a,committish:e})=>`${a}${sc("#",e)}`,bugstemplate:({domain:a,project:e})=>`https://${a}/${e}`,gittemplate:({domain:a,project:e,committish:r})=>`git://${a}/${e}.git${sc("#",r)}`,tarballtemplate:({project:a,committish:e})=>`https://codeload.github.com/gist/${a}/tar.gz/${X0(e||"HEAD")}`,extract:a=>{let[,e,r,n]=a.pathname.split("/",4);if(n!=="raw"){if(!r){if(!e)return;r=e,e=null}return r.endsWith(".git")&&(r=r.slice(0,-4)),{user:e,project:r,committish:a.hash.slice(1)}}},hashformat:function(a){return a&&"file-"+Hda(a)}};DH.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:a,user:e,project:r,committish:n,path:i})=>`https://${a}/${e}/${r}/blob/${X0(n)||"HEAD"}/${i}`,httpstemplate:({domain:a,user:e,project:r,committish:n})=>`https://${a}/${e}/${r}.git${sc("#",n)}`,tarballtemplate:({domain:a,user:e,project:r,committish:n})=>`https://${a}/${e}/${r}/archive/${X0(n)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:a=>{let[,e,r,n]=a.pathname.split("/",4);if(!["archive"].includes(n)&&(r&&r.endsWith(".git")&&(r=r.slice(0,-4)),!(!e||!r)))return{user:e,project:r,committish:a.hash.slice(1)}}};for(let[a,e]of Object.entries(DH))DH[a]=Object.assign({},oZi,e);Xda.exports=DH});var J5t=Ze((_oo,Lda)=>{var lZi=Wt("url"),B5t=(a,e,r)=>{let n=a.indexOf(r);return a.lastIndexOf(e,n>-1?n:1/0)},Sda=a=>{try{return new lZi.URL(a)}catch{}},cZi=(a,e)=>{let r=a.indexOf(":"),n=a.slice(0,r+1);if(Object.prototype.hasOwnProperty.call(e,n))return a;let i=a.indexOf("@");return i>-1?i>r?`git+ssh://${a}`:a:a.indexOf("//")===r+1?a:`${a.slice(0,r+1)}//${a.slice(r+1)}`},uZi=a=>{let e=B5t(a,"@","#"),r=B5t(a,":","#");return r>e&&(a=a.slice(0,r)+"/"+a.slice(r+1)),B5t(a,":","#")===-1&&a.indexOf("//")===-1&&(a=`git+ssh://${a}`),a};Lda.exports=(a,e)=>{let r=e?cZi(a,e):a;return Sda(r)||Sda(uZi(r))}});var Jda=Ze((zoo,Bda)=>{"use strict";var dZi=J5t(),IZi=a=>{let e=a.indexOf("#"),r=a.indexOf("/"),n=a.indexOf("/",r+1),i=a.indexOf(":"),o=/\s/.exec(a),t=a.indexOf("@"),s=!o||e>-1&&o.index>e,u=t===-1||e>-1&&t>e,I=i===-1||e>-1&&i>e,d=n===-1||e>-1&&n>e,h=r>0,c=e>-1?a[e-1]!=="/":!a.endsWith("/"),m=!a.startsWith(".");return s&&h&&c&&m&&u&&I&&d};Bda.exports=(a,e,{gitHosts:r,protocols:n})=>{if(!a)return;let i=IZi(a)?`github:${a}`:a,o=dZi(i,n);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;n[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=n[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 Dda=Ze((Poo,Tda)=>{"use strict";var{LRUCache:hZi}=Qda(),mZi=kda(),pZi=Jda(),fZi=J5t(),T5t=new hZi({max:1e3}),B6e=class a{constructor(e,r,n,i,o,t,s={}){Object.assign(this,a.#e[e],{type:e,user:r,auth:n,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){a.#e[e]=r,a.#e.byDomain[r.domain]=e,a.#e.byShortcut[`${e}:`]=e,a.#t[`${e}:`]={name:e}}static fromUrl(e,r){if(typeof e!="string")return;let n=e+JSON.stringify(r||{});if(!T5t.has(n)){let i=pZi(e,r,{gitHosts:a.#e,protocols:a.#t});T5t.set(n,i?new a(...i):void 0)}return T5t.get(n)}static parseUrl(e){return fZi(e)}#r(e,r){if(typeof e!="function")return null;let n={...this,...this.opts,...r};n.path||(n.path=""),n.path.startsWith("/")&&(n.path=n.path.slice(1)),n.noCommittish&&(n.committish=null);let i=e(n);return n.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[a,e]of Object.entries(mZi))B6e.addHost(a,e);Tda.exports=B6e});var Mda=Ze((joo,Oda)=>{Oda.exports=bZi;function bZi(a){if(!a||a==="ERROR: No README data found!")return;a=a.trim().split(`
|
|
4938
|
-
`);let e=0;for(;a[e]&&a[e].trim().match(/^(#|$)/);)e++;let r=a.length,n=e+1;for(;n<r&&a[n].trim();)n++;return a.slice(e,n).join(" ").trim()}});var Uda=Ze((qoo,gZi)=>{gZi.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 jda=Ze((Koo,Pda)=>{var GZi=Iit(),vZi=hit(),yZi=Rda(),J6e=Dda(),AZi=Wt("node:module"),ZZi=["dependencies","devDependencies","optionalDependencies"],NZi=Mda(),D5t=Wt("url"),OH=Uda(),_da=a=>a.includes("@")&&a.indexOf("@")<a.lastIndexOf(".");Pda.exports={warn:function(){},fixRepositoryField:function(a){if(a.repositories&&(this.warn("repositories"),a.repository=a.repositories[0]),!a.repository)return this.warn("missingRepository");typeof a.repository=="string"&&(a.repository={type:"git",url:a.repository});var e=a.repository.url||"";if(e){var r=J6e.fromUrl(e);r&&(e=a.repository.url=r.getDefaultRepresentation()==="shortcut"?r.https():r.toString())}e.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",e)},fixTypos:function(a){Object.keys(OH.topLevel).forEach(function(e){Object.prototype.hasOwnProperty.call(a,e)&&this.warn("typo",e,OH.topLevel[e])},this)},fixScriptsField:function(a){if(a.scripts){if(typeof a.scripts!="object"){this.warn("nonObjectScripts"),delete a.scripts;return}Object.keys(a.scripts).forEach(function(e){typeof a.scripts[e]!="string"?(this.warn("nonStringScript"),delete a.scripts[e]):OH.script[e]&&!a.scripts[OH.script[e]]&&this.warn("typo",e,OH.script[e],"scripts")},this)}},fixFilesField:function(a){var e=a.files;e&&!Array.isArray(e)?(this.warn("nonArrayFiles"),delete a.files):a.files&&(a.files=a.files.filter(function(r){return!r||typeof r!="string"?(this.warn("invalidFilename",r),!1):!0},this))},fixBinField:function(a){if(a.bin&&typeof a.bin=="string"){var e={},r;(r=a.name.match(/^@[^/]+[/](.*)$/))?e[r[1]]=a.bin:e[a.name]=a.bin,a.bin=e}},fixManField:function(a){a.man&&typeof a.man=="string"&&(a.man=[a.man])},fixBundleDependenciesField:function(a){var e="bundledDependencies",r="bundleDependencies";a[e]&&!a[r]&&(a[r]=a[e],delete a[e]),a[r]&&!Array.isArray(a[r])?(this.warn("nonArrayBundleDependencies"),delete a[r]):a[r]&&(a[r]=a[r].filter(function(n){return!n||typeof n!="string"?(this.warn("nonStringBundleDependency",n),!1):(a.dependencies||(a.dependencies={}),Object.prototype.hasOwnProperty.call(a.dependencies,n)||(this.warn("nonDependencyBundleDependency",n),a.dependencies[n]="*"),!0)},this))},fixDependencies:function(a){YZi(a,this.warn),CZi(a,this.warn),this.fixBundleDependenciesField(a),["dependencies","devDependencies"].forEach(function(e){if(e in a){if(!a[e]||typeof a[e]!="object"){this.warn("nonObjectDependencies",e),delete a[e];return}Object.keys(a[e]).forEach(function(r){var n=a[e][r];typeof n!="string"&&(this.warn("nonStringDependency",r,JSON.stringify(n)),delete a[e][r]);var i=J6e.fromUrl(a[e][r]);i&&(a[e][r]=i.toString())},this)}},this)},fixModulesField:function(a){a.modules&&(this.warn("deprecatedModules"),delete a.modules)},fixKeywordsField:function(a){typeof a.keywords=="string"&&(a.keywords=a.keywords.split(/,\s+/)),a.keywords&&!Array.isArray(a.keywords)?(delete a.keywords,this.warn("nonArrayKeywords")):a.keywords&&(a.keywords=a.keywords.filter(function(e){return typeof e!="string"||!e?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(a,e){var r=!e;if(!a.version)return a.version="",!0;if(!GZi(a.version,r))throw new Error('Invalid version: "'+a.version+'"');return a.version=vZi(a.version,r),!0},fixPeople:function(a){zda(a,wZi),zda(a,RZi)},fixNameField:function(a,e){typeof e=="boolean"?e={strict:e}:typeof e>"u"&&(e={});var r=e.strict;if(!a.name&&!r){a.name="";return}if(typeof a.name!="string")throw new Error("name field must be a string.");r||(a.name=a.name.trim()),EZi(a.name,r,e.allowLegacyCase),AZi.builtinModules.includes(a.name)&&this.warn("conflictingName",a.name)},fixDescriptionField:function(a){a.description&&typeof a.description!="string"&&(this.warn("nonStringDescription"),delete a.description),a.readme&&!a.description&&(a.description=NZi(a.readme)),a.description===void 0&&delete a.description,a.description||this.warn("missingDescription")},fixReadmeField:function(a){a.readme||(this.warn("missingReadme"),a.readme="ERROR: No README data found!")},fixBugsField:function(a){if(!a.bugs&&a.repository&&a.repository.url){var e=J6e.fromUrl(a.repository.url);e&&e.bugs()&&(a.bugs={url:e.bugs()})}else if(a.bugs){if(typeof a.bugs=="string")_da(a.bugs)?a.bugs={email:a.bugs}:D5t.parse(a.bugs).protocol?a.bugs={url:a.bugs}:this.warn("nonEmailUrlBugsString");else{VZi(a.bugs,this.warn);var r=a.bugs;a.bugs={},r.url&&(typeof r.url=="string"&&D5t.parse(r.url).protocol?a.bugs.url=r.url:this.warn("nonUrlBugsUrlField")),r.email&&(typeof r.email=="string"&&_da(r.email)?a.bugs.email=r.email:this.warn("nonEmailBugsEmailField"))}!a.bugs.email&&!a.bugs.url&&(delete a.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(a){if(!a.homepage&&a.repository&&a.repository.url){var e=J6e.fromUrl(a.repository.url);e&&e.docs()&&(a.homepage=e.docs())}if(a.homepage){if(typeof a.homepage!="string")return this.warn("nonUrlHomepage"),delete a.homepage;D5t.parse(a.homepage).protocol||(a.homepage="http://"+a.homepage)}},fixLicenseField:function(a){let e=a.license||a.licence;if(!e)return this.warn("missingLicense");if(typeof e!="string"||e.length<1||e.trim()==="")return this.warn("invalidLicense");if(!yZi(e).validForNewPackages)return this.warn("invalidLicense")}};function WZi(a){if(a.charAt(0)!=="@")return!1;var e=a.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}function FZi(a){return!a.match(/[/@\s+%:]/)&&a===encodeURIComponent(a)}function EZi(a,e,r){if(a.charAt(0)==="."||!(WZi(a)||FZi(a))||e&&!r&&a!==a.toLowerCase()||a.toLowerCase()==="node_modules"||a.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(a))}function zda(a,e){return a.author&&(a.author=e(a.author)),["maintainers","contributors"].forEach(function(r){Array.isArray(a[r])&&(a[r]=a[r].map(e))}),a}function wZi(a){if(typeof a=="string")return a;var e=a.name||"",r=a.url||a.web,n=r?" ("+r+")":"",i=a.email||a.mail,o=i?" <"+i+">":"";return e+o+n}function RZi(a){if(typeof a!="string")return a;var e=a.match(/^([^(<]+)/),r=a.match(/\(([^()]+)\)/),n=a.match(/<([^<>]+)>/),i={};return e&&e[0].trim()&&(i.name=e[0].trim()),n&&(i.email=n[1]),r&&(i.url=r[1]),i}function CZi(a){var e=a.optionalDependencies;if(e){var r=a.dependencies||{};Object.keys(e).forEach(function(n){r[n]=e[n]}),a.dependencies=r}}function xZi(a,e,r){if(!a)return{};if(typeof a=="string"&&(a=a.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(a))return a;r("deprecatedArrayDependencies",e);var n={};return a.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(/^@/,""),n[o]=t}),n}function YZi(a,e){ZZi.forEach(function(r){a[r]&&(a[r]=xZi(a[r],r,e))})}function VZi(a,e){a&&Object.keys(a).forEach(function(r){OH.bugs[r]&&(e("typo",r,OH.bugs[r],"bugs"),a[OH.bugs[r]]=a[r],delete a[r])})}});var qda=Ze(($oo,QZi)=>{QZi.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 eIa=Ze((elo,$da)=>{var Kda=Wt("util"),O5t=qda();$da.exports=function(){var a=Array.prototype.slice.call(arguments,0),e=a.shift();if(e==="typo")return HZi.apply(null,a);var r=O5t[e]?O5t[e]:e+": '%s'";return a.unshift(r),Kda.format.apply(null,a)};function HZi(a,e,r){return r&&(a=r+"['"+a+"']",e=r+"['"+e+"']"),Kda.format(O5t.typo,a,e)}});var nIa=Ze((tlo,aIa)=>{aIa.exports=tIa;var M5t=jda();tIa.fixer=M5t;var XZi=eIa(),kZi=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],SZi=["dependencies","people","typos"],U5t=kZi.map(function(a){return rIa(a)+"Field"});U5t=U5t.concat(SZi);function tIa(a,e,r){e===!0&&(e=null,r=!0),r||(r=!1),(!e||a.private)&&(e=function(){}),a.scripts&&a.scripts.install==="node-gyp rebuild"&&!a.scripts.preinstall&&(a.gypfile=!0),M5t.warn=function(){e(XZi.apply(null,arguments))},U5t.forEach(function(n){M5t["fix"+rIa(n)](a,r)}),a._id=a.name+"@"+a.version}function rIa(a){return a.charAt(0).toUpperCase()+a.slice(1)}});var iIa=ct(()=>{});import{fileURLToPath as LZi}from"node:url";function sIa(a){return a instanceof URL?LZi(a):a}var oIa=ct(()=>{iIa()});import BZi from"node:fs/promises";import JZi from"node:path";async function cIa({cwd:a,normalize:e=!0}={}){let r=await BZi.readFile(TZi(a),"utf8");return DZi(r,e)}var lIa,TZi,DZi,uIa=ct(()=>{cda();lIa=Pt(nIa(),1);oIa();TZi=a=>JZi.resolve(sIa(a)??".","package.json"),DZi=(a,e)=>{let r=typeof a=="string"?Y5t(a):a;return e&&(0,lIa.default)(r),r}});import OZi from"node:path";async function dIa(a){let e=await Hua("package.json",a);if(e)return{packageJson:await cIa({...a,cwd:OZi.dirname(e)}),path:e}}var IIa=ct(()=>{Xua();uIa()});import{fileURLToPath as MZi}from"url";import UZi from"path";async function $$(){if(T6e)return T6e;let a=await dIa({cwd:zZi});if(a)return T6e=a.packageJson,T6e}var _Zi,zZi,T6e,D6e=ct(()=>{"use strict";IIa();_Zi=MZi(import.meta.url),zZi=UZi.dirname(_Zi)});var hIa={};ho(hIa,{getCliVersion:()=>Jx});async function Jx(){let a=await $$();return"1.1.27"}var eee=ct(()=>{"use strict";D6e();});var yRt=Ze((Bho,N0a)=>{N0a.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}});var E0a=Ze((Jho,F0a)=>{var zWi=yRt();function W0a(a){this.mode=zWi.MODE_8BIT_BYTE,this.data=a}W0a.prototype={getLength:function(){return this.data.length},write:function(a){for(var e=0;e<this.data.length;e++)a.put(this.data.charCodeAt(e),8)}};F0a.exports=W0a});var ARt=Ze((Tho,w0a)=>{var lF={glog:function(a){if(a<1)throw new Error("glog("+a+")");return lF.LOG_TABLE[a]},gexp:function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return lF.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(k0=0;k0<8;k0++)lF.EXP_TABLE[k0]=1<<k0;var k0;for(k0=8;k0<256;k0++)lF.EXP_TABLE[k0]=lF.EXP_TABLE[k0-4]^lF.EXP_TABLE[k0-5]^lF.EXP_TABLE[k0-6]^lF.EXP_TABLE[k0-8];var k0;for(k0=0;k0<255;k0++)lF.LOG_TABLE[lF.EXP_TABLE[k0]]=k0;var k0;w0a.exports=lF});var ZRt=Ze((Dho,R0a)=>{var F8=ARt();function uSe(a,e){if(a.length===void 0)throw new Error(a.length+"/"+e);for(var r=0;r<a.length&&a[r]===0;)r++;this.num=new Array(a.length-r+e);for(var n=0;n<a.length-r;n++)this.num[n]=a[n+r]}uSe.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var e=new Array(this.getLength()+a.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<a.getLength();n++)e[r+n]^=F8.gexp(F8.glog(this.get(r))+F8.glog(a.get(n)));return new uSe(e,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var e=F8.glog(this.get(0))-F8.glog(a.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var i=0;i<a.getLength();i++)r[i]^=F8.gexp(F8.glog(a.get(i))+e);return new uSe(r,0).mod(a)}};R0a.exports=uSe});var x0a=Ze((Oho,C0a)=>{C0a.exports={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7}});var Q0a=Ze((Mho,V0a)=>{var hN=yRt(),Y0a=ZRt(),PWi=ARt(),PH=x0a(),Uf={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(a){for(var e=a<<10;Uf.getBCHDigit(e)-Uf.getBCHDigit(Uf.G15)>=0;)e^=Uf.G15<<Uf.getBCHDigit(e)-Uf.getBCHDigit(Uf.G15);return(a<<10|e)^Uf.G15_MASK},getBCHTypeNumber:function(a){for(var e=a<<12;Uf.getBCHDigit(e)-Uf.getBCHDigit(Uf.G18)>=0;)e^=Uf.G18<<Uf.getBCHDigit(e)-Uf.getBCHDigit(Uf.G18);return a<<12|e},getBCHDigit:function(a){for(var e=0;a!==0;)e++,a>>>=1;return e},getPatternPosition:function(a){return Uf.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,e,r){switch(a){case PH.PATTERN000:return(e+r)%2===0;case PH.PATTERN001:return e%2===0;case PH.PATTERN010:return r%3===0;case PH.PATTERN011:return(e+r)%3===0;case PH.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2===0;case PH.PATTERN101:return e*r%2+e*r%3===0;case PH.PATTERN110:return(e*r%2+e*r%3)%2===0;case PH.PATTERN111:return(e*r%3+(e+r)%2)%2===0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var e=new Y0a([1],0),r=0;r<a;r++)e=e.multiply(new Y0a([1,PWi.gexp(r)],0));return e},getLengthInBits:function(a,e){if(1<=e&&e<10)switch(a){case hN.MODE_NUMBER:return 10;case hN.MODE_ALPHA_NUM:return 9;case hN.MODE_8BIT_BYTE:return 8;case hN.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(e<27)switch(a){case hN.MODE_NUMBER:return 12;case hN.MODE_ALPHA_NUM:return 11;case hN.MODE_8BIT_BYTE:return 16;case hN.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else if(e<41)switch(a){case hN.MODE_NUMBER:return 14;case hN.MODE_ALPHA_NUM:return 13;case hN.MODE_8BIT_BYTE:return 16;case hN.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}else throw new Error("type:"+e)},getLostPoint:function(a){var e=a.getModuleCount(),r=0,n=0,i=0;for(n=0;n<e;n++)for(i=0;i<e;i++){for(var o=0,t=a.isDark(n,i),s=-1;s<=1;s++)if(!(n+s<0||e<=n+s))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||s===0&&u===0||t===a.isDark(n+s,i+u)&&o++;o>5&&(r+=3+o-5)}for(n=0;n<e-1;n++)for(i=0;i<e-1;i++){var I=0;a.isDark(n,i)&&I++,a.isDark(n+1,i)&&I++,a.isDark(n,i+1)&&I++,a.isDark(n+1,i+1)&&I++,(I===0||I===4)&&(r+=3)}for(n=0;n<e;n++)for(i=0;i<e-6;i++)a.isDark(n,i)&&!a.isDark(n,i+1)&&a.isDark(n,i+2)&&a.isDark(n,i+3)&&a.isDark(n,i+4)&&!a.isDark(n,i+5)&&a.isDark(n,i+6)&&(r+=40);for(i=0;i<e;i++)for(n=0;n<e-6;n++)a.isDark(n,i)&&!a.isDark(n+1,i)&&a.isDark(n+2,i)&&a.isDark(n+3,i)&&a.isDark(n+4,i)&&!a.isDark(n+5,i)&&a.isDark(n+6,i)&&(r+=40);var d=0;for(i=0;i<e;i++)for(n=0;n<e;n++)a.isDark(n,i)&&d++;var h=Math.abs(100*d/e/e-50)/5;return r+=h*10,r}};V0a.exports=Uf});var NRt=Ze((Uho,H0a)=>{H0a.exports={L:1,M:0,Q:3,H:2}});var k0a=Ze((_ho,X0a)=>{var dSe=NRt();function k5(a,e){this.totalCount=a,this.dataCount=e}k5.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]];k5.getRSBlocks=function(a,e){var r=k5.getRsBlockTable(a,e);if(r===void 0)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],o=0;o<n;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 k5(s,u));return i};k5.getRsBlockTable=function(a,e){switch(e){case dSe.L:return k5.RS_BLOCK_TABLE[(a-1)*4+0];case dSe.M:return k5.RS_BLOCK_TABLE[(a-1)*4+1];case dSe.Q:return k5.RS_BLOCK_TABLE[(a-1)*4+2];case dSe.H:return k5.RS_BLOCK_TABLE[(a-1)*4+3];default:return}};X0a.exports=k5});var B0a=Ze((zho,L0a)=>{function S0a(){this.buffer=[],this.length=0}S0a.prototype={get:function(a){var e=Math.floor(a/8);return(this.buffer[e]>>>7-a%8&1)==1},put:function(a,e){for(var r=0;r<e;r++)this.putBit((a>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(a){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),a&&(this.buffer[e]|=128>>>this.length%8),this.length++}};L0a.exports=S0a});var O0a=Ze((Pho,D0a)=>{var jWi=E0a(),jH=Q0a(),qWi=ZRt(),J0a=k0a(),T0a=B0a();function S5(a,e){this.typeNumber=a,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}S5.prototype={addData:function(a){var e=new jWi(a);this.dataList.push(e),this.dataCache=null},isDark:function(a,e){if(a<0||this.moduleCount<=a||e<0||this.moduleCount<=e)throw new Error(a+","+e);return this.modules[a][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var a=1;for(a=1;a<40;a++){for(var e=J0a.getRSBlocks(a,this.errorCorrectLevel),r=new T0a,n=0,i=0;i<e.length;i++)n+=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(),jH.getLengthInBits(t.mode,a)),t.write(r)}if(r.getLengthInBits()<=n*8)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,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 n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,e),this.typeNumber>=7&&this.setupTypeNumber(a),this.dataCache===null&&(this.dataCache=S5.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(a,e){for(var r=-1;r<=7;r++)if(!(a+r<=-1||this.moduleCount<=a+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n===0||n===6)||0<=n&&n<=6&&(r===0||r===6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[a+r][e+n]=!0:this.modules[a+r][e+n]=!1)},getBestMaskPattern:function(){for(var a=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=jH.getLostPoint(this);(r===0||a>n)&&(a=n,e=r)}return e},createMovieClip:function(a,e,r){var n=a.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&&(n.beginFill(0,100),n.moveTo(u,t),n.lineTo(u+i,t),n.lineTo(u+i,t+i),n.lineTo(u,t+i),n.endFill())}return n},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)this.modules[a][6]===null&&(this.modules[a][6]=a%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 a=jH.getPatternPosition(this.typeNumber),e=0;e<a.length;e++)for(var r=0;r<a.length;r++){var n=a[e],i=a[r];if(this.modules[n][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[n+o][i+t]=!0:this.modules[n+o][i+t]=!1}},setupTypeNumber:function(a){for(var e=jH.getBCHTypeNumber(this.typeNumber),r,n=0;n<18;n++)r=!a&&(e>>n&1)===1,this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r;for(var i=0;i<18;i++)r=!a&&(e>>i&1)===1,this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r},setupTypeInfo:function(a,e){for(var r=this.errorCorrectLevel<<3|e,n=jH.getBCHTypeInfo(r),i,o=0;o<15;o++)i=!a&&(n>>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=!a&&(n>>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]=!a},mapData:function(a,e){for(var r=-1,n=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[n][t-s]===null){var u=!1;o<a.length&&(u=(a[o]>>>i&1)===1);var I=jH.getMask(e,n,t-s);I&&(u=!u),this.modules[n][t-s]=u,i--,i===-1&&(o++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};S5.PAD0=236;S5.PAD1=17;S5.createData=function(a,e,r){for(var n=J0a.getRSBlocks(a,e),i=new T0a,o=0;o<r.length;o++){var t=r[o];i.put(t.mode,4),i.put(t.getLength(),jH.getLengthInBits(t.mode,a)),t.write(i)}for(var s=0,u=0;u<n.length;u++)s+=n[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(S5.PAD0,8),i.getLengthInBits()>=s*8));)i.put(S5.PAD1,8);return S5.createBytes(i,n)};S5.createBytes=function(a,e){for(var r=0,n=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;n=Math.max(n,u),i=Math.max(i,I),o[s]=new Array(u);for(var d=0;d<o[s].length;d++)o[s][d]=255&a.buffer[d+r];r+=u;var h=jH.getErrorCorrectPolynomial(I),c=new qWi(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<n;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};D0a.exports=S5});var _0a=Ze((jho,U0a)=>{var KWi=O0a(),M0a=NRt(),$Wi="\x1B[40m \x1B[0m",ISe="\x1B[47m \x1B[0m",eFi=function(a){return a?$Wi:ISe},WRt=function(a){return{times:function(e){return new Array(e).join(a)}}},tFi=function(a,e){for(var r=new Array(a),n=0;n<a;n++)r[n]=e;return r};U0a.exports={error:M0a.L,generate:function(a,e,r){typeof e=="function"&&(r=e,e={});var n=new KWi(-1,this.error);n.addData(a),n.make();var i="";if(e&&e.small){var o=!0,t=!1,s=n.getModuleCount(),u=n.modules.slice(),I=s%2===1;I&&u.push(tFi(s,t));var d={WHITE_ALL:"\u2588",WHITE_BLACK:"\u2580",BLACK_WHITE:"\u2584",BLACK_ALL:" "},h=WRt(d.BLACK_WHITE).times(s+3),c=WRt(d.WHITE_BLACK).times(s+3);i+=h+`
|
|
4938
|
+
`);let e=0;for(;a[e]&&a[e].trim().match(/^(#|$)/);)e++;let r=a.length,n=e+1;for(;n<r&&a[n].trim();)n++;return a.slice(e,n).join(" ").trim()}});var Uda=Ze((qoo,gZi)=>{gZi.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 jda=Ze((Koo,Pda)=>{var GZi=Iit(),vZi=hit(),yZi=Rda(),J6e=Dda(),AZi=Wt("node:module"),ZZi=["dependencies","devDependencies","optionalDependencies"],NZi=Mda(),D5t=Wt("url"),OH=Uda(),_da=a=>a.includes("@")&&a.indexOf("@")<a.lastIndexOf(".");Pda.exports={warn:function(){},fixRepositoryField:function(a){if(a.repositories&&(this.warn("repositories"),a.repository=a.repositories[0]),!a.repository)return this.warn("missingRepository");typeof a.repository=="string"&&(a.repository={type:"git",url:a.repository});var e=a.repository.url||"";if(e){var r=J6e.fromUrl(e);r&&(e=a.repository.url=r.getDefaultRepresentation()==="shortcut"?r.https():r.toString())}e.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",e)},fixTypos:function(a){Object.keys(OH.topLevel).forEach(function(e){Object.prototype.hasOwnProperty.call(a,e)&&this.warn("typo",e,OH.topLevel[e])},this)},fixScriptsField:function(a){if(a.scripts){if(typeof a.scripts!="object"){this.warn("nonObjectScripts"),delete a.scripts;return}Object.keys(a.scripts).forEach(function(e){typeof a.scripts[e]!="string"?(this.warn("nonStringScript"),delete a.scripts[e]):OH.script[e]&&!a.scripts[OH.script[e]]&&this.warn("typo",e,OH.script[e],"scripts")},this)}},fixFilesField:function(a){var e=a.files;e&&!Array.isArray(e)?(this.warn("nonArrayFiles"),delete a.files):a.files&&(a.files=a.files.filter(function(r){return!r||typeof r!="string"?(this.warn("invalidFilename",r),!1):!0},this))},fixBinField:function(a){if(a.bin&&typeof a.bin=="string"){var e={},r;(r=a.name.match(/^@[^/]+[/](.*)$/))?e[r[1]]=a.bin:e[a.name]=a.bin,a.bin=e}},fixManField:function(a){a.man&&typeof a.man=="string"&&(a.man=[a.man])},fixBundleDependenciesField:function(a){var e="bundledDependencies",r="bundleDependencies";a[e]&&!a[r]&&(a[r]=a[e],delete a[e]),a[r]&&!Array.isArray(a[r])?(this.warn("nonArrayBundleDependencies"),delete a[r]):a[r]&&(a[r]=a[r].filter(function(n){return!n||typeof n!="string"?(this.warn("nonStringBundleDependency",n),!1):(a.dependencies||(a.dependencies={}),Object.prototype.hasOwnProperty.call(a.dependencies,n)||(this.warn("nonDependencyBundleDependency",n),a.dependencies[n]="*"),!0)},this))},fixDependencies:function(a){YZi(a,this.warn),CZi(a,this.warn),this.fixBundleDependenciesField(a),["dependencies","devDependencies"].forEach(function(e){if(e in a){if(!a[e]||typeof a[e]!="object"){this.warn("nonObjectDependencies",e),delete a[e];return}Object.keys(a[e]).forEach(function(r){var n=a[e][r];typeof n!="string"&&(this.warn("nonStringDependency",r,JSON.stringify(n)),delete a[e][r]);var i=J6e.fromUrl(a[e][r]);i&&(a[e][r]=i.toString())},this)}},this)},fixModulesField:function(a){a.modules&&(this.warn("deprecatedModules"),delete a.modules)},fixKeywordsField:function(a){typeof a.keywords=="string"&&(a.keywords=a.keywords.split(/,\s+/)),a.keywords&&!Array.isArray(a.keywords)?(delete a.keywords,this.warn("nonArrayKeywords")):a.keywords&&(a.keywords=a.keywords.filter(function(e){return typeof e!="string"||!e?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(a,e){var r=!e;if(!a.version)return a.version="",!0;if(!GZi(a.version,r))throw new Error('Invalid version: "'+a.version+'"');return a.version=vZi(a.version,r),!0},fixPeople:function(a){zda(a,wZi),zda(a,RZi)},fixNameField:function(a,e){typeof e=="boolean"?e={strict:e}:typeof e>"u"&&(e={});var r=e.strict;if(!a.name&&!r){a.name="";return}if(typeof a.name!="string")throw new Error("name field must be a string.");r||(a.name=a.name.trim()),EZi(a.name,r,e.allowLegacyCase),AZi.builtinModules.includes(a.name)&&this.warn("conflictingName",a.name)},fixDescriptionField:function(a){a.description&&typeof a.description!="string"&&(this.warn("nonStringDescription"),delete a.description),a.readme&&!a.description&&(a.description=NZi(a.readme)),a.description===void 0&&delete a.description,a.description||this.warn("missingDescription")},fixReadmeField:function(a){a.readme||(this.warn("missingReadme"),a.readme="ERROR: No README data found!")},fixBugsField:function(a){if(!a.bugs&&a.repository&&a.repository.url){var e=J6e.fromUrl(a.repository.url);e&&e.bugs()&&(a.bugs={url:e.bugs()})}else if(a.bugs){if(typeof a.bugs=="string")_da(a.bugs)?a.bugs={email:a.bugs}:D5t.parse(a.bugs).protocol?a.bugs={url:a.bugs}:this.warn("nonEmailUrlBugsString");else{VZi(a.bugs,this.warn);var r=a.bugs;a.bugs={},r.url&&(typeof r.url=="string"&&D5t.parse(r.url).protocol?a.bugs.url=r.url:this.warn("nonUrlBugsUrlField")),r.email&&(typeof r.email=="string"&&_da(r.email)?a.bugs.email=r.email:this.warn("nonEmailBugsEmailField"))}!a.bugs.email&&!a.bugs.url&&(delete a.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(a){if(!a.homepage&&a.repository&&a.repository.url){var e=J6e.fromUrl(a.repository.url);e&&e.docs()&&(a.homepage=e.docs())}if(a.homepage){if(typeof a.homepage!="string")return this.warn("nonUrlHomepage"),delete a.homepage;D5t.parse(a.homepage).protocol||(a.homepage="http://"+a.homepage)}},fixLicenseField:function(a){let e=a.license||a.licence;if(!e)return this.warn("missingLicense");if(typeof e!="string"||e.length<1||e.trim()==="")return this.warn("invalidLicense");if(!yZi(e).validForNewPackages)return this.warn("invalidLicense")}};function WZi(a){if(a.charAt(0)!=="@")return!1;var e=a.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}function FZi(a){return!a.match(/[/@\s+%:]/)&&a===encodeURIComponent(a)}function EZi(a,e,r){if(a.charAt(0)==="."||!(WZi(a)||FZi(a))||e&&!r&&a!==a.toLowerCase()||a.toLowerCase()==="node_modules"||a.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(a))}function zda(a,e){return a.author&&(a.author=e(a.author)),["maintainers","contributors"].forEach(function(r){Array.isArray(a[r])&&(a[r]=a[r].map(e))}),a}function wZi(a){if(typeof a=="string")return a;var e=a.name||"",r=a.url||a.web,n=r?" ("+r+")":"",i=a.email||a.mail,o=i?" <"+i+">":"";return e+o+n}function RZi(a){if(typeof a!="string")return a;var e=a.match(/^([^(<]+)/),r=a.match(/\(([^()]+)\)/),n=a.match(/<([^<>]+)>/),i={};return e&&e[0].trim()&&(i.name=e[0].trim()),n&&(i.email=n[1]),r&&(i.url=r[1]),i}function CZi(a){var e=a.optionalDependencies;if(e){var r=a.dependencies||{};Object.keys(e).forEach(function(n){r[n]=e[n]}),a.dependencies=r}}function xZi(a,e,r){if(!a)return{};if(typeof a=="string"&&(a=a.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(a))return a;r("deprecatedArrayDependencies",e);var n={};return a.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(/^@/,""),n[o]=t}),n}function YZi(a,e){ZZi.forEach(function(r){a[r]&&(a[r]=xZi(a[r],r,e))})}function VZi(a,e){a&&Object.keys(a).forEach(function(r){OH.bugs[r]&&(e("typo",r,OH.bugs[r],"bugs"),a[OH.bugs[r]]=a[r],delete a[r])})}});var qda=Ze(($oo,QZi)=>{QZi.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 eIa=Ze((elo,$da)=>{var Kda=Wt("util"),O5t=qda();$da.exports=function(){var a=Array.prototype.slice.call(arguments,0),e=a.shift();if(e==="typo")return HZi.apply(null,a);var r=O5t[e]?O5t[e]:e+": '%s'";return a.unshift(r),Kda.format.apply(null,a)};function HZi(a,e,r){return r&&(a=r+"['"+a+"']",e=r+"['"+e+"']"),Kda.format(O5t.typo,a,e)}});var nIa=Ze((tlo,aIa)=>{aIa.exports=tIa;var M5t=jda();tIa.fixer=M5t;var XZi=eIa(),kZi=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],SZi=["dependencies","people","typos"],U5t=kZi.map(function(a){return rIa(a)+"Field"});U5t=U5t.concat(SZi);function tIa(a,e,r){e===!0&&(e=null,r=!0),r||(r=!1),(!e||a.private)&&(e=function(){}),a.scripts&&a.scripts.install==="node-gyp rebuild"&&!a.scripts.preinstall&&(a.gypfile=!0),M5t.warn=function(){e(XZi.apply(null,arguments))},U5t.forEach(function(n){M5t["fix"+rIa(n)](a,r)}),a._id=a.name+"@"+a.version}function rIa(a){return a.charAt(0).toUpperCase()+a.slice(1)}});var iIa=ct(()=>{});import{fileURLToPath as LZi}from"node:url";function sIa(a){return a instanceof URL?LZi(a):a}var oIa=ct(()=>{iIa()});import BZi from"node:fs/promises";import JZi from"node:path";async function cIa({cwd:a,normalize:e=!0}={}){let r=await BZi.readFile(TZi(a),"utf8");return DZi(r,e)}var lIa,TZi,DZi,uIa=ct(()=>{cda();lIa=Pt(nIa(),1);oIa();TZi=a=>JZi.resolve(sIa(a)??".","package.json"),DZi=(a,e)=>{let r=typeof a=="string"?Y5t(a):a;return e&&(0,lIa.default)(r),r}});import OZi from"node:path";async function dIa(a){let e=await Hua("package.json",a);if(e)return{packageJson:await cIa({...a,cwd:OZi.dirname(e)}),path:e}}var IIa=ct(()=>{Xua();uIa()});import{fileURLToPath as MZi}from"url";import UZi from"path";async function $$(){if(T6e)return T6e;let a=await dIa({cwd:zZi});if(a)return T6e=a.packageJson,T6e}var _Zi,zZi,T6e,D6e=ct(()=>{"use strict";IIa();_Zi=MZi(import.meta.url),zZi=UZi.dirname(_Zi)});var hIa={};ho(hIa,{getCliVersion:()=>Jx});async function Jx(){let a=await $$();return"1.1.28"}var eee=ct(()=>{"use strict";D6e();});var yRt=Ze((Bho,N0a)=>{N0a.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}});var E0a=Ze((Jho,F0a)=>{var zWi=yRt();function W0a(a){this.mode=zWi.MODE_8BIT_BYTE,this.data=a}W0a.prototype={getLength:function(){return this.data.length},write:function(a){for(var e=0;e<this.data.length;e++)a.put(this.data.charCodeAt(e),8)}};F0a.exports=W0a});var ARt=Ze((Tho,w0a)=>{var lF={glog:function(a){if(a<1)throw new Error("glog("+a+")");return lF.LOG_TABLE[a]},gexp:function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return lF.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(k0=0;k0<8;k0++)lF.EXP_TABLE[k0]=1<<k0;var k0;for(k0=8;k0<256;k0++)lF.EXP_TABLE[k0]=lF.EXP_TABLE[k0-4]^lF.EXP_TABLE[k0-5]^lF.EXP_TABLE[k0-6]^lF.EXP_TABLE[k0-8];var k0;for(k0=0;k0<255;k0++)lF.LOG_TABLE[lF.EXP_TABLE[k0]]=k0;var k0;w0a.exports=lF});var ZRt=Ze((Dho,R0a)=>{var F8=ARt();function uSe(a,e){if(a.length===void 0)throw new Error(a.length+"/"+e);for(var r=0;r<a.length&&a[r]===0;)r++;this.num=new Array(a.length-r+e);for(var n=0;n<a.length-r;n++)this.num[n]=a[n+r]}uSe.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var e=new Array(this.getLength()+a.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<a.getLength();n++)e[r+n]^=F8.gexp(F8.glog(this.get(r))+F8.glog(a.get(n)));return new uSe(e,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var e=F8.glog(this.get(0))-F8.glog(a.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var i=0;i<a.getLength();i++)r[i]^=F8.gexp(F8.glog(a.get(i))+e);return new uSe(r,0).mod(a)}};R0a.exports=uSe});var x0a=Ze((Oho,C0a)=>{C0a.exports={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7}});var Q0a=Ze((Mho,V0a)=>{var hN=yRt(),Y0a=ZRt(),PWi=ARt(),PH=x0a(),Uf={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(a){for(var e=a<<10;Uf.getBCHDigit(e)-Uf.getBCHDigit(Uf.G15)>=0;)e^=Uf.G15<<Uf.getBCHDigit(e)-Uf.getBCHDigit(Uf.G15);return(a<<10|e)^Uf.G15_MASK},getBCHTypeNumber:function(a){for(var e=a<<12;Uf.getBCHDigit(e)-Uf.getBCHDigit(Uf.G18)>=0;)e^=Uf.G18<<Uf.getBCHDigit(e)-Uf.getBCHDigit(Uf.G18);return a<<12|e},getBCHDigit:function(a){for(var e=0;a!==0;)e++,a>>>=1;return e},getPatternPosition:function(a){return Uf.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,e,r){switch(a){case PH.PATTERN000:return(e+r)%2===0;case PH.PATTERN001:return e%2===0;case PH.PATTERN010:return r%3===0;case PH.PATTERN011:return(e+r)%3===0;case PH.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2===0;case PH.PATTERN101:return e*r%2+e*r%3===0;case PH.PATTERN110:return(e*r%2+e*r%3)%2===0;case PH.PATTERN111:return(e*r%3+(e+r)%2)%2===0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var e=new Y0a([1],0),r=0;r<a;r++)e=e.multiply(new Y0a([1,PWi.gexp(r)],0));return e},getLengthInBits:function(a,e){if(1<=e&&e<10)switch(a){case hN.MODE_NUMBER:return 10;case hN.MODE_ALPHA_NUM:return 9;case hN.MODE_8BIT_BYTE:return 8;case hN.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(e<27)switch(a){case hN.MODE_NUMBER:return 12;case hN.MODE_ALPHA_NUM:return 11;case hN.MODE_8BIT_BYTE:return 16;case hN.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else if(e<41)switch(a){case hN.MODE_NUMBER:return 14;case hN.MODE_ALPHA_NUM:return 13;case hN.MODE_8BIT_BYTE:return 16;case hN.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}else throw new Error("type:"+e)},getLostPoint:function(a){var e=a.getModuleCount(),r=0,n=0,i=0;for(n=0;n<e;n++)for(i=0;i<e;i++){for(var o=0,t=a.isDark(n,i),s=-1;s<=1;s++)if(!(n+s<0||e<=n+s))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||s===0&&u===0||t===a.isDark(n+s,i+u)&&o++;o>5&&(r+=3+o-5)}for(n=0;n<e-1;n++)for(i=0;i<e-1;i++){var I=0;a.isDark(n,i)&&I++,a.isDark(n+1,i)&&I++,a.isDark(n,i+1)&&I++,a.isDark(n+1,i+1)&&I++,(I===0||I===4)&&(r+=3)}for(n=0;n<e;n++)for(i=0;i<e-6;i++)a.isDark(n,i)&&!a.isDark(n,i+1)&&a.isDark(n,i+2)&&a.isDark(n,i+3)&&a.isDark(n,i+4)&&!a.isDark(n,i+5)&&a.isDark(n,i+6)&&(r+=40);for(i=0;i<e;i++)for(n=0;n<e-6;n++)a.isDark(n,i)&&!a.isDark(n+1,i)&&a.isDark(n+2,i)&&a.isDark(n+3,i)&&a.isDark(n+4,i)&&!a.isDark(n+5,i)&&a.isDark(n+6,i)&&(r+=40);var d=0;for(i=0;i<e;i++)for(n=0;n<e;n++)a.isDark(n,i)&&d++;var h=Math.abs(100*d/e/e-50)/5;return r+=h*10,r}};V0a.exports=Uf});var NRt=Ze((Uho,H0a)=>{H0a.exports={L:1,M:0,Q:3,H:2}});var k0a=Ze((_ho,X0a)=>{var dSe=NRt();function k5(a,e){this.totalCount=a,this.dataCount=e}k5.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]];k5.getRSBlocks=function(a,e){var r=k5.getRsBlockTable(a,e);if(r===void 0)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],o=0;o<n;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 k5(s,u));return i};k5.getRsBlockTable=function(a,e){switch(e){case dSe.L:return k5.RS_BLOCK_TABLE[(a-1)*4+0];case dSe.M:return k5.RS_BLOCK_TABLE[(a-1)*4+1];case dSe.Q:return k5.RS_BLOCK_TABLE[(a-1)*4+2];case dSe.H:return k5.RS_BLOCK_TABLE[(a-1)*4+3];default:return}};X0a.exports=k5});var B0a=Ze((zho,L0a)=>{function S0a(){this.buffer=[],this.length=0}S0a.prototype={get:function(a){var e=Math.floor(a/8);return(this.buffer[e]>>>7-a%8&1)==1},put:function(a,e){for(var r=0;r<e;r++)this.putBit((a>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(a){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),a&&(this.buffer[e]|=128>>>this.length%8),this.length++}};L0a.exports=S0a});var O0a=Ze((Pho,D0a)=>{var jWi=E0a(),jH=Q0a(),qWi=ZRt(),J0a=k0a(),T0a=B0a();function S5(a,e){this.typeNumber=a,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}S5.prototype={addData:function(a){var e=new jWi(a);this.dataList.push(e),this.dataCache=null},isDark:function(a,e){if(a<0||this.moduleCount<=a||e<0||this.moduleCount<=e)throw new Error(a+","+e);return this.modules[a][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var a=1;for(a=1;a<40;a++){for(var e=J0a.getRSBlocks(a,this.errorCorrectLevel),r=new T0a,n=0,i=0;i<e.length;i++)n+=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(),jH.getLengthInBits(t.mode,a)),t.write(r)}if(r.getLengthInBits()<=n*8)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,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 n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,e),this.typeNumber>=7&&this.setupTypeNumber(a),this.dataCache===null&&(this.dataCache=S5.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(a,e){for(var r=-1;r<=7;r++)if(!(a+r<=-1||this.moduleCount<=a+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n===0||n===6)||0<=n&&n<=6&&(r===0||r===6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[a+r][e+n]=!0:this.modules[a+r][e+n]=!1)},getBestMaskPattern:function(){for(var a=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=jH.getLostPoint(this);(r===0||a>n)&&(a=n,e=r)}return e},createMovieClip:function(a,e,r){var n=a.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&&(n.beginFill(0,100),n.moveTo(u,t),n.lineTo(u+i,t),n.lineTo(u+i,t+i),n.lineTo(u,t+i),n.endFill())}return n},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)this.modules[a][6]===null&&(this.modules[a][6]=a%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 a=jH.getPatternPosition(this.typeNumber),e=0;e<a.length;e++)for(var r=0;r<a.length;r++){var n=a[e],i=a[r];if(this.modules[n][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[n+o][i+t]=!0:this.modules[n+o][i+t]=!1}},setupTypeNumber:function(a){for(var e=jH.getBCHTypeNumber(this.typeNumber),r,n=0;n<18;n++)r=!a&&(e>>n&1)===1,this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r;for(var i=0;i<18;i++)r=!a&&(e>>i&1)===1,this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r},setupTypeInfo:function(a,e){for(var r=this.errorCorrectLevel<<3|e,n=jH.getBCHTypeInfo(r),i,o=0;o<15;o++)i=!a&&(n>>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=!a&&(n>>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]=!a},mapData:function(a,e){for(var r=-1,n=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[n][t-s]===null){var u=!1;o<a.length&&(u=(a[o]>>>i&1)===1);var I=jH.getMask(e,n,t-s);I&&(u=!u),this.modules[n][t-s]=u,i--,i===-1&&(o++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};S5.PAD0=236;S5.PAD1=17;S5.createData=function(a,e,r){for(var n=J0a.getRSBlocks(a,e),i=new T0a,o=0;o<r.length;o++){var t=r[o];i.put(t.mode,4),i.put(t.getLength(),jH.getLengthInBits(t.mode,a)),t.write(i)}for(var s=0,u=0;u<n.length;u++)s+=n[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(S5.PAD0,8),i.getLengthInBits()>=s*8));)i.put(S5.PAD1,8);return S5.createBytes(i,n)};S5.createBytes=function(a,e){for(var r=0,n=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;n=Math.max(n,u),i=Math.max(i,I),o[s]=new Array(u);for(var d=0;d<o[s].length;d++)o[s][d]=255&a.buffer[d+r];r+=u;var h=jH.getErrorCorrectPolynomial(I),c=new qWi(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<n;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};D0a.exports=S5});var _0a=Ze((jho,U0a)=>{var KWi=O0a(),M0a=NRt(),$Wi="\x1B[40m \x1B[0m",ISe="\x1B[47m \x1B[0m",eFi=function(a){return a?$Wi:ISe},WRt=function(a){return{times:function(e){return new Array(e).join(a)}}},tFi=function(a,e){for(var r=new Array(a),n=0;n<a;n++)r[n]=e;return r};U0a.exports={error:M0a.L,generate:function(a,e,r){typeof e=="function"&&(r=e,e={});var n=new KWi(-1,this.error);n.addData(a),n.make();var i="";if(e&&e.small){var o=!0,t=!1,s=n.getModuleCount(),u=n.modules.slice(),I=s%2===1;I&&u.push(tFi(s,t));var d={WHITE_ALL:"\u2588",WHITE_BLACK:"\u2580",BLACK_WHITE:"\u2584",BLACK_ALL:" "},h=WRt(d.BLACK_WHITE).times(s+3),c=WRt(d.WHITE_BLACK).times(s+3);i+=h+`
|
|
4939
4939
|
`;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+`
|
|
4940
4940
|
`}I||(i+=c)}else{var G=WRt(ISe).times(n.getModuleCount()+3);i+=G+`
|
|
4941
4941
|
`,n.modules.forEach(function(A){i+=ISe,i+=A.map(eFi).join(""),i+=ISe+`
|