@github/copilot 0.0.334-5 → 0.0.334-7

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/sdk/index.js CHANGED
@@ -112,7 +112,7 @@ ${W.stdout}${W.stderr}
112
112
  `)}async setGitConfig(I,e,l=!1){let c=omI(I),n=dmI(I);await this.cleanGitConfig(e,l),this.logger.debug(`Setting ${l?"global":"local"} git config credential.username to ${c}`),await this.execGit(["config",l?"--global":"--local","credential.username",c],e,[c]),this.logger.debug(`Setting ${l?"global":"local"} git config credential.helper to ${n6}`),await this.execGit(["config",l?"--global":"--local","credential.helper",n6],e,[n6]),this.logger.debug(`Setting ${l?"global":"local"} git config user.email to ${n}`),await this.execGit(["config",l?"--global":"--local","user.email",n],e,[n]),this.logger.debug(`Setting ${l?"global":"local"} git config user.name to ${c}`),await this.execGit(["config",l?"--global":"--local","user.name",c],e,[c]),this.logger.debug(`Setting ${l?"global":"local"} git config pull.rebase to false`),await this.execGit(["config",l?"--global":"--local","pull.rebase","false"],e)}async cleanGitConfig(I,e=!1,l=!1){this.logger.debug(`Cleaning ${e?"global":"local"} git config`),await this.clearGitConfigVal(I,"credential.helper",e),await this.clearGitConfigVal(I,"credential.username",e),await this.clearGitConfigVal(I,"user.name",e),await this.clearGitConfigVal(I,"user.email",e),await this.clearGitConfigVal(I,"pull.rebase",e),l&&I?.env?.HOME&&(this.logger.debug(`Cleaning temporary home directory: ${I.env.HOME}`),OOI(I.env.HOME,{recursive:!0}))}async clearGitConfigVal(I,e,l=!1){let c={...I,ignoreReturnCode:!0,failOnStdErr:!1,silentDebugLogging:!1},{exitCode:n}=await this.execGit(["config","get",l?"--global":"--local","--all",e],c);n===0&&await this.execGit(["config","unset",l?"--global":"--local","--all",e],I)}async execGit(I,e,l=[]){try{return await this.exec.execReturn("git",I,e,l)}catch(c){throw new $Y(c)}}async shouldCommit(I,e){try{return I||(await this.exec.execReturn("git status --porcelain | head -n 10",[],{cwd:e,shell:"sh",silent:!0})).stdout.toString().trim().length>0}catch(l){throw new $Y(l)}}async hasRemoteBranch(I,e){try{return(await this.execGit(["ls-remote","--heads","origin",I],{cwd:e,silent:!0},[I])).stdout.toString().trim().length>0}catch(l){if(l.code??!1)return!1;throw l}}async getGitDiffHunkHeaders(I,e){let l=["-c","core.quotePath=false","diff","--no-renames","--irreversible-delete","-U0"];e&&l.push(e.trim());let c=await this.execGit(l,{cwd:I}),n=[];for(let a of c.stdout.toString().split(`
113
113
  `))(a.startsWith("--- ")||a.startsWith("+++ ")||a.startsWith("@@ "))&&n.push(a);return n}};var Mh="code_review",Hf="copilot_swe_agent_code_review",DOI="ccr[EnableAgenticTools=true]",AmI="4b825dc642cb6eb9a060e54bf8d69288fbee4904",wmI=(t,I,e,l)=>{let c=new Mr(I,e);return{name:Mh,description:`Request a code review for the current PR changes. This tool analyzes the proposed changes and provides feedback.
114
114
  Call this tool before finalizing your session and completing the task to get review feedback.
115
- If the review identifies issues that you agree with, address them and call this tool again if significant changes were made.`,input_schema:{type:"object",properties:{prTitle:{type:"string",description:"Title for the pull request, specifying the task addressed by this PR"},prDescription:{type:"string",description:"Description for the pull request, explaining the task and the high-level code changes made relative to the base branch"}},required:["prTitle","prDescription"]},callback:async n=>{try{let a=t.location||process.cwd();if(!n||!n.prTitle||!n.prDescription)return{textResultForLlm:"Invalid input provided to code_review tool",resultType:"failure",error:"Missing required fields: prTitle or prDescription",toolTelemetry:{}};let s=await KOI(c,a,l,e,I);if(s.length===0)return{textResultForLlm:"No changed files found to review. Make sure you have made some changes before requesting a code review.",resultType:"failure",error:"No changed files found",toolTelemetry:{}};I.debug(`Code review requested for PR: ${n.prTitle}`),I.debug(`Files to review: ${s.map(p=>p.path).join(", ")}`);let r=process.env.NODE_ENV==="production"?"capi-prod-claude-sonnet-4":"capi-dev-claude-sonnet-4",o=POI(a,l.github?.owner?.name||"",l.github?.repo?.name||"",await c.getCurrentCommitHash(a),n.prTitle,n.prDescription),d=await _OI(r,s,o,l,e,I);if(d.alerts.length===0&&d.error)return{textResultForLlm:`Code review tool encountered an issue: ${d.error}`,resultType:"failure",error:d.error,toolTelemetry:{}};let b=d.alerts.filter(p=>!p.meta||!p.meta?.exclusionReason||p.meta.exclusionReason===""),h=`Code review completed. Reviewed ${s.length} file(s).
115
+ If the review identifies issues that you agree with, address them and call this tool again if significant changes were made.`,input_schema:{type:"object",properties:{prTitle:{type:"string",description:"Title for the pull request, specifying the task addressed by this PR"},prDescription:{type:"string",description:"Description for the pull request, explaining the task and the high-level code changes made relative to the base branch"}},required:["prTitle","prDescription"]},callback:async n=>{try{let a=t.location||process.cwd();if(!n||!n.prTitle||!n.prDescription)return{textResultForLlm:"Invalid input provided to code_review tool",resultType:"failure",error:"Missing required fields: prTitle or prDescription",toolTelemetry:{properties:{codeReviewResult:"invalid_input"}}};let s=await KOI(c,a,l,e,I);if(s.length===0)return{textResultForLlm:"No changed files found to review. Make sure you have made some changes before requesting a code review.",resultType:"failure",error:"No changed files found",toolTelemetry:{properties:{codeReviewResult:"no_changed_files"}}};I.debug(`Code review requested for PR: ${n.prTitle}`),I.debug(`Files to review: ${s.map(p=>p.path).join(", ")}`);let r=process.env.NODE_ENV==="production"?"capi-prod-claude-sonnet-4":"capi-dev-claude-sonnet-4",o=POI(a,l.github?.owner?.name||"",l.github?.repo?.name||"",await c.getCurrentCommitHash(a),n.prTitle,n.prDescription),d=await _OI(r,s,o,l,e,I);if(d.alerts.length===0&&d.error)return{textResultForLlm:`Code review tool encountered an issue: ${d.error}`,resultType:"failure",error:d.error,toolTelemetry:{properties:{codeReviewResult:"failure",codeReviewError:d.error}}};let b=d.alerts.filter(p=>!p.meta||!p.meta?.exclusionReason||p.meta.exclusionReason===""),h=`Code review completed. Reviewed ${s.length} file(s).
116
116
  `;if(b.length>0){h+=`
117
117
  Found ${b.length} review comment(s):
118
118
  `;for(let p of b)p.location.endLine===p.location.startLine?h+=`- In ${p.location.file}, line ${p.location.startLine}: ${p.message}
@@ -120,11 +120,11 @@ Found ${b.length} review comment(s):
120
120
  `}else h+=`
121
121
  No review comments found.`,d.warning&&(h+=`
122
122
 
123
- Note: ${d.warning}`);I.debug(`Code review completed: ${h}`);let Z=b.map(p=>p.meta?.queryName).filter(p=>!!p&&p.trim().length>0).sort();return{textResultForLlm:h,resultType:"success",sessionLog:h,toolTelemetry:{properties:{commentQueryNames:Z.join(", ")},restrictedProperties:{prTitle:n.prTitle,filesReviewed:s.map(p=>p.path).join(", ")},metrics:{reviewedFiles:s.length,commentsGenerated:b.length,commentsExcluded:d.alerts.length-b.length}}}}catch(a){let s=`Error during code review: ${a}`;return I.error(s),{textResultForLlm:s,resultType:"failure",error:s,toolTelemetry:{}}}},safeForTelemetry:!0}};async function KOI(t,I,e,l,c){try{let n=await t.getCurrentCommitHash(I),a=e.swebench_base_commit||"HEAD~1",s=[];try{s=await t.getChangedPaths(I,n.trim(),a)}catch(o){c.debug(`Could not get diff against ${a}, checking for working directory changes: ${o}`);try{let b=(await l.execReturn("git",["diff","--name-only"],{cwd:I})).stdout.trim().split(`
124
- `).filter(p=>p.length>0),Z=(await l.execReturn("git",["diff","--cached","--name-only"],{cwd:I})).stdout.trim().split(`
125
- `).filter(p=>p.length>0);if(s=[...new Set([...b,...Z])],s.length===0)try{s=(await l.execReturn("git",["diff","--name-only",AmI,"HEAD"],{cwd:I})).stdout.trim().split(`
126
- `).filter(W=>W.length>0),a=AmI}catch{return c.debug("Could not compare against empty tree"),[]}}catch(d){return c.error(`Error getting working directory changes: ${d}`),[]}}let r=[];for(let o of s)try{let d="";try{let h=Oh(I,o);d=await XmI(h,"utf-8")}catch{d=""}let b="";try{b=(await l.execReturn("git",["show",`${a}:${o}`],{cwd:I})).stdout}catch{b=""}r.push({path:o,contents:d,baseContents:b,regions:[[1,Math.max(1,d.split(`
127
- `).length)]]})}catch(d){c.warning(`Could not process file ${o}: ${d}`)}return r}catch(n){return c.error(`Error getting changed files: ${n}`),[]}}function POI(t,I,e,l,c,n){let a={};return!I||!e?a.repo="":(a.repo=`https://github.com/${I}/${e}`,l&&(a.repo+="#"+l)),a.input_file_mode="pr",a.repo_path=t,a.pr_title=c,a.pr_body=n,a}async function qOI(t){let I=s6.default.fileSync();return await TOI(I.name,JSON.stringify(t)),I.name}async function _OI(t,I,e,l,c,n){let a=null,s=null;try{a=await qOI(I);let r=JSON.stringify(e);s=s6.default.fileSync().name,a6.writeFileSync(s,r);let d=["run","--files",a,"--model",t,"--extra",s,"--detector",DOI,"--options","{}"];n.debug(`Running autofind CLI with args: ${d.join(" ")}`);let b=jOI(import.meta.url),h=gmI(b),Z=Oh(h,".."),p=Oh(h,"..","..");n.debug(`Current working directory: ${process.cwd()}`),n.debug(`Current file location: ${b}`),n.debug(`Current dir from file: ${h}`),n.debug(`NODE_ENV: ${process.env.NODE_ENV}`),n.debug(`__dirname equivalent: ${h}`);let W=[Oh(process.cwd(),"autofind","autofind"),Oh(p,"autofind","autofind"),Oh(h,"autofind","autofind"),Oh(Z,"autofind","autofind"),...process.env.AGENT_DIR?[Oh(process.env.AGENT_DIR,"autofind","autofind")]:[]],N=null,Y=null;n.debug(`Searching for autofind binary in ${W.length} locations`);let F="Code review tool is not available in this environment. ";F+=`Searched paths: ${W.join(", ")}. `;for(let z of W)try{await XmI(z),N=z,Y=gmI(z),n.debug(`Using autofind binary at: ${z}`);break}catch(S){if(n.debug(`Autofind binary not found at: ${z} (${S instanceof Error?S.message:S})`),F+=`Autofind binary not found at: ${z}. `,a6.existsSync(z)){let II=a6.readdirSync(z).join(", ");F+=`Contents of ${z}: ${II}. `}}if(!N||!Y){n.error("Autofind binary not found in any expected locations"),n.debug(`Searched paths: ${W.join(", ")}`);try{let z=await import("fs/promises"),S=await z.readdir(h);n.debug(`Directory (${h}) contents: ${S.join(", ")}`),F+=`Directory (${h}) contents: ${S.join(", ")}. `;let II=await z.readdir(Z),rI=Oh(Z,".."),uI=await z.readdir(rI);n.debug(`Parent directory (${Z}) contents: ${II.join(", ")}. Grandparent directory (${rI}) contents: ${uI.join(", ")}.`),F+=`Parent directory (${Z}) contents: ${II.join(", ")}. `,F+=`Grandparent directory (${rI}) contents: ${uI.join(", ")}. `;let VI=process.cwd(),UI=await z.readdir(VI);n.debug(`Working directory (${VI}) contents: ${UI.join(", ")}`),F+=`Working directory (${VI}) contents: ${UI.join(", ")}. `}catch(z){n.debug(`Failed to list directory contents: ${z}`),F+=`Failed to list directory contents: ${z}. `}return{alerts:[],warning:F}}n.debug(`Running autofind CLI from ${Y}`);let g=l.api?.copilot?.token,A=l.api?.copilot?.hmacKey,X=g&&g.length>0?g:A;if(!X||X.length===0)throw n.error("CAPI token is not set"),new Error("The code_review tool requires an LLM API key");let v=l.api?.copilot?.integrationId;if(!v||v.length===0)throw n.error("CAPI integration ID is not set"),new Error("The code_review tool requires a Copilot integration ID");let J=process.env.NODE_ENV==="production"?{CAPI_INTEGRATION_ID:v,CAPI_PROD_KEY:X}:{CAPI_INTEGRATION_ID_DEV:v,CAPI_DEV_KEY:X},k=await c.execReturn(N,d,{cwd:Y,silent:!0,env:J});if(k.exitCode!==0){if(k.stderr.includes("not found")||k.stderr.includes("No such file"))return n.warning("Autofind CLI not found, returning empty results for testing"),{alerts:[],warning:`Code review tool is not available in this environment: ${k.stderr}`};if(k.stderr.includes("no Copilot API key provided")||k.stderr.includes("fatal error getting model"))return n.warning("Autofind CLI not configured with API key, returning empty results for testing"),{alerts:[],warning:"Code review tool is not configured with a valid API key"};throw new Error(`Go adapter failed with code ${k.exitCode}: ${k.stderr}`)}k.stderr.trim()!==""&&n.debug(`Autofind CLI stderr: ${k.stderr}`);try{let z=JSON.parse(k.stdout);return z.alerts&&z.alerts.length>0?n.debug(`Go CLI response parsed successfully, and contains ${z.alerts.length} alerts`):n.debug("Go CLI response parsed successfully, but contains zero results"),z}catch(z){throw new Error(`Go adapter failed to return valid JSON: ${z}. Output: "${k.stdout}"`)}}catch(r){if(r instanceof Error&&(r.message.includes("not found")||r.message.includes("No such file")||r.message.includes("ENOENT")))return n.warning(`Autofind CLI not available, returning empty results for testing: ${r.message}`),{alerts:[],warning:`Code review tool is not available in this environment: ${r.message}`};if(r instanceof Error&&(r.message.includes("no Copilot API key provided")||r.message.includes("fatal error getting model")||r.message.includes("Go adapter failed to return valid JSON: SyntaxError: Unexpected end of JSON input")))return n.warning("Autofind CLI configuration error, returning empty results for testing"),{alerts:[],warning:"Code review tool has configuration issues (likely missing or invalid API key)"};throw r}finally{if(a)try{await QmI(a)}catch(r){n.warning(`Failed to clean up temp file ${a}: ${r}`)}if(s)try{await QmI(s)}catch(r){n.warning(`Failed to clean up extras temp file ${s}: ${r}`)}}}G();import*as XRI from"fs";G();G();G();G();function Yu(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}G();G();function Ef(t,I,e,l){if(typeof e!="function")throw new Error("method for before hook must be a function");return l||(l={}),Array.isArray(I)?I.reverse().reduce((c,n)=>Ef.bind(null,t,n,c,l),e)():Promise.resolve().then(()=>t.registry[I]?t.registry[I].reduce((c,n)=>n.hook.bind(null,c,l),e)():e(l))}G();function HmI(t,I,e,l){let c=l;t.registry[e]||(t.registry[e]=[]),I==="before"&&(l=(n,a)=>Promise.resolve().then(c.bind(null,a)).then(n.bind(null,a))),I==="after"&&(l=(n,a)=>{let s;return Promise.resolve().then(n.bind(null,a)).then(r=>(s=r,c(s,a))).then(()=>s)}),I==="error"&&(l=(n,a)=>Promise.resolve().then(n.bind(null,a)).catch(s=>c(s,a))),t.registry[e].push({hook:l,orig:c})}G();function EmI(t,I,e){if(!t.registry[I])return;let l=t.registry[I].map(c=>c.orig).indexOf(e);l!==-1&&t.registry[I].splice(l,1)}var vmI=Function.bind,CmI=vmI.bind(vmI);function JmI(t,I,e){let l=CmI(EmI,null).apply(null,e?[I,e]:[I]);t.api={remove:l},t.remove=l,["before","error","after","wrap"].forEach(c=>{let n=e?[I,c,e]:[I,c];t[c]=t.api[c]=CmI(HmI,null).apply(null,n)})}function $OI(){let t=Symbol("Singular"),I={registry:{}},e=Ef.bind(null,I,t);return JmI(e,I,t),e}function IMI(){let t={registry:{}},I=Ef.bind(null,t);return JmI(I,t),I}var LmI={Singular:$OI,Collection:IMI};G();G();var eMI="0.0.0-development",tMI=`octokit-endpoint.js/${eMI} ${Yu()}`,lMI={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":tMI},mediaType:{format:""}};function cMI(t){return t?Object.keys(t).reduce((I,e)=>(I[e.toLowerCase()]=t[e],I),{}):{}}function nMI(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let I=Object.getPrototypeOf(t);if(I===null)return!0;let e=Object.prototype.hasOwnProperty.call(I,"constructor")&&I.constructor;return typeof e=="function"&&e instanceof e&&Function.prototype.call(e)===Function.prototype.call(t)}function xmI(t,I){let e=Object.assign({},t);return Object.keys(I).forEach(l=>{nMI(I[l])?l in t?e[l]=xmI(t[l],I[l]):Object.assign(e,{[l]:I[l]}):Object.assign(e,{[l]:I[l]})}),e}function kmI(t){for(let I in t)t[I]===void 0&&delete t[I];return t}function G6(t,I,e){if(typeof I=="string"){let[c,n]=I.split(" ");e=Object.assign(n?{method:c,url:n}:{url:c},e)}else e=Object.assign({},I);e.headers=cMI(e.headers),kmI(e),kmI(e.headers);let l=xmI(t||{},e);return e.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(l.mediaType.previews=t.mediaType.previews.filter(c=>!l.mediaType.previews.includes(c)).concat(l.mediaType.previews)),l.mediaType.previews=(l.mediaType.previews||[]).map(c=>c.replace(/-preview/,""))),l}function aMI(t,I){let e=/\?/.test(t)?"&":"?",l=Object.keys(I);return l.length===0?t:t+e+l.map(c=>c==="q"?"q="+I.q.split("+").map(encodeURIComponent).join("+"):`${c}=${encodeURIComponent(I[c])}`).join("&")}var sMI=/\{[^{}}]+\}/g;function rMI(t){return t.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function GMI(t){let I=t.match(sMI);return I?I.map(rMI).reduce((e,l)=>e.concat(l),[]):[]}function fmI(t,I){let e={__proto__:null};for(let l of Object.keys(t))I.indexOf(l)===-1&&(e[l]=t[l]);return e}function BmI(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(I){return/%[0-9A-Fa-f]/.test(I)||(I=encodeURI(I).replace(/%5B/g,"[").replace(/%5D/g,"]")),I}).join("")}function Sy(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(I){return"%"+I.charCodeAt(0).toString(16).toUpperCase()})}function NE(t,I,e){return I=t==="+"||t==="#"?BmI(I):Sy(I),e?Sy(e)+"="+I:I}function Uy(t){return t!=null}function r6(t){return t===";"||t==="&"||t==="?"}function oMI(t,I,e,l){var c=t[e],n=[];if(Uy(c)&&c!=="")if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")c=c.toString(),l&&l!=="*"&&(c=c.substring(0,parseInt(l,10))),n.push(NE(I,c,r6(I)?e:""));else if(l==="*")Array.isArray(c)?c.filter(Uy).forEach(function(a){n.push(NE(I,a,r6(I)?e:""))}):Object.keys(c).forEach(function(a){Uy(c[a])&&n.push(NE(I,c[a],a))});else{let a=[];Array.isArray(c)?c.filter(Uy).forEach(function(s){a.push(NE(I,s))}):Object.keys(c).forEach(function(s){Uy(c[s])&&(a.push(Sy(s)),a.push(NE(I,c[s].toString())))}),r6(I)?n.push(Sy(e)+"="+a.join(",")):a.length!==0&&n.push(a.join(","))}else I===";"?Uy(c)&&n.push(Sy(e)):c===""&&(I==="&"||I==="?")?n.push(Sy(e)+"="):c===""&&n.push("");return n}function dMI(t){return{expand:bMI.bind(null,t)}}function bMI(t,I){var e=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(l,c,n){if(c){let s="",r=[];if(e.indexOf(c.charAt(0))!==-1&&(s=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(o){var d=/([^:\*]*)(?::(\d+)|(\*))?/.exec(o);r.push(oMI(I,s,d[1],d[2]||d[3]))}),s&&s!=="+"){var a=",";return s==="?"?a="&":s!=="#"&&(a=s),(r.length!==0?s:"")+r.join(a)}else return r.join(",")}else return BmI(n)}),t==="/"?t:t.replace(/\/$/,"")}function zmI(t){let I=t.method.toUpperCase(),e=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),l=Object.assign({},t.headers),c,n=fmI(t,["method","baseUrl","url","headers","request","mediaType"]),a=GMI(e);e=dMI(e).expand(n),/^http/.test(e)||(e=t.baseUrl+e);let s=Object.keys(t).filter(d=>a.includes(d)).concat("baseUrl"),r=fmI(n,s);if(!/application\/octet-stream/i.test(l.accept)&&(t.mediaType.format&&(l.accept=l.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),e.endsWith("/graphql")&&t.mediaType.previews?.length)){let d=l.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];l.accept=d.concat(t.mediaType.previews).map(b=>{let h=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${b}-preview${h}`}).join(",")}return["GET","HEAD"].includes(I)?e=aMI(e,r):"data"in r?c=r.data:Object.keys(r).length&&(c=r),!l["content-type"]&&typeof c<"u"&&(l["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(I)&&typeof c>"u"&&(c=""),Object.assign({method:I,url:e,headers:l},typeof c<"u"?{body:c}:null,t.request?{request:t.request}:null)}function iMI(t,I,e){return zmI(G6(t,I,e))}function UmI(t,I){let e=G6(t,I),l=iMI.bind(null,e);return Object.assign(l,{DEFAULTS:e,defaults:UmI.bind(null,e),merge:G6.bind(null,e),parse:zmI})}var SmI=UmI(null,lMI);var KmI=Qc(jmI(),1);G();var lV=class extends Error{name;status;request;response;constructor(I,e,l){super(I),this.name="HttpError",this.status=Number.parseInt(e),Number.isNaN(this.status)&&(this.status=0),"response"in l&&(this.response=l.response);let c=Object.assign({},l.request);l.request.headers.authorization&&(c.headers=Object.assign({},l.request.headers,{authorization:l.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),c.url=c.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=c}};var mMI="10.0.3",hMI={headers:{"user-agent":`octokit-request.js/${mMI} ${Yu()}`}};function ZMI(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let I=Object.getPrototypeOf(t);if(I===null)return!0;let e=Object.prototype.hasOwnProperty.call(I,"constructor")&&I.constructor;return typeof e=="function"&&e instanceof e&&Function.prototype.call(e)===Function.prototype.call(t)}async function DmI(t){let I=t.request?.fetch||globalThis.fetch;if(!I)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let e=t.request?.log||console,l=t.request?.parseSuccessResponseBody!==!1,c=ZMI(t.body)||Array.isArray(t.body)?JSON.stringify(t.body):t.body,n=Object.fromEntries(Object.entries(t.headers).map(([b,h])=>[b,String(h)])),a;try{a=await I(t.url,{method:t.method,body:c,redirect:t.request?.redirect,headers:n,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(b){let h="Unknown Error";if(b instanceof Error){if(b.name==="AbortError")throw b.status=500,b;h=b.message,b.name==="TypeError"&&"cause"in b&&(b.cause instanceof Error?h=b.cause.message:typeof b.cause=="string"&&(h=b.cause))}let Z=new lV(h,500,{request:t});throw Z.cause=b,Z}let s=a.status,r=a.url,o={};for(let[b,h]of a.headers)o[b]=h;let d={url:r,status:s,headers:o,data:""};if("deprecation"in o){let b=o.link&&o.link.match(/<([^<>]+)>; rel="deprecation"/),h=b&&b.pop();e.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${o.sunset}${h?`. See ${h}`:""}`)}if(s===204||s===205)return d;if(t.method==="HEAD"){if(s<400)return d;throw new lV(a.statusText,s,{response:d,request:t})}if(s===304)throw d.data=await o6(a),new lV("Not modified",s,{response:d,request:t});if(s>=400)throw d.data=await o6(a),new lV(uMI(d.data),s,{response:d,request:t});return d.data=l?await o6(a):a.body,d}async function o6(t){let I=t.headers.get("content-type");if(!I)return t.text().catch(()=>"");let e=(0,KmI.safeParse)(I);if(pMI(e)){let l="";try{return l=await t.text(),JSON.parse(l)}catch{return l}}else return e.type.startsWith("text/")||e.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(()=>""):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}function pMI(t){return t.type==="application/json"||t.type==="application/scim+json"}function uMI(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){let I="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(e=>JSON.stringify(e)).join(", ")}${I}`:`${t.message}${I}`}return`Unknown error: ${JSON.stringify(t)}`}function d6(t,I){let e=t.defaults(I);return Object.assign(function(c,n){let a=e.merge(c,n);if(!a.request||!a.request.hook)return DmI(e.parse(a));let s=(r,o)=>DmI(e.parse(e.merge(r,o)));return Object.assign(s,{endpoint:e,defaults:d6.bind(null,e)}),a.request.hook(s,a)},{endpoint:e,defaults:d6.bind(null,e)})}var VE=d6(SmI,hMI);G();var WMI="0.0.0-development";function NMI(t){return`Request failed due to following response errors:
123
+ Note: ${d.warning}`);I.debug(`Code review completed: ${h}`);let Z=b.map(p=>p.meta?.queryId).filter(p=>!!p&&p.trim().length>0).sort();return{textResultForLlm:h,resultType:"success",sessionLog:h,toolTelemetry:{properties:{commentQueryNames:Z.join(", "),codeReviewResult:"success"},restrictedProperties:{prTitle:n.prTitle,filesReviewed:s.map(p=>p.path).join(", ")},metrics:{reviewedFiles:s.length,commentsGenerated:b.length,commentsExcluded:d.alerts.length-b.length}}}}catch(a){let s=`Error during code review: ${a}`;return I.error(s),{textResultForLlm:s,resultType:"failure",error:s,toolTelemetry:{properties:{codeReviewResult:"failure",codeReviewError:s}}}}},safeForTelemetry:!0}};async function KOI(t,I,e,l,c){try{let n=e.swebench_base_commit||"HEAD~1",a=[];try{await t.stageChanges(I),a=await t.getChangedPaths(I,n)}catch(r){c.debug(`Could not get diff against ${n}, checking for working directory changes: ${r}`);try{let d=(await l.execReturn("git",["diff","--name-only"],{cwd:I})).stdout.trim().split(`
124
+ `).filter(Z=>Z.length>0),h=(await l.execReturn("git",["diff","--cached","--name-only"],{cwd:I})).stdout.trim().split(`
125
+ `).filter(Z=>Z.length>0);if(a=[...new Set([...d,...h])],a.length===0)try{a=(await l.execReturn("git",["diff","--name-only",AmI,"HEAD"],{cwd:I})).stdout.trim().split(`
126
+ `).filter(p=>p.length>0),n=AmI}catch{return c.debug("Could not compare against empty tree"),[]}}catch(o){return c.error(`Error getting working directory changes: ${o}`),[]}}let s=[];for(let r of a)try{let o="";try{let b=Oh(I,r);o=await XmI(b,"utf-8")}catch{o=""}let d="";try{d=(await l.execReturn("git",["show",`${n}:${r}`],{cwd:I})).stdout}catch{d=""}s.push({path:r,contents:o,baseContents:d,regions:[[1,Math.max(1,o.split(`
127
+ `).length)]]})}catch(o){c.warning(`Could not process file ${r}: ${o}`)}return s}catch(n){return c.error(`Error getting changed files: ${n}`),[]}}function POI(t,I,e,l,c,n){let a={};return!I||!e?a.repo="":(a.repo=`https://github.com/${I}/${e}`,l&&(a.repo+="#"+l)),a.input_file_mode="pr",a.repo_path=t,a.pr_title=c,a.pr_body=n,a}async function qOI(t){let I=s6.default.fileSync();return await TOI(I.name,JSON.stringify(t)),I.name}async function _OI(t,I,e,l,c,n){let a=null,s=null;try{a=await qOI(I);let r=JSON.stringify(e);s=s6.default.fileSync().name,a6.writeFileSync(s,r);let d=["run","--files",a,"--model",t,"--extra",s,"--detector",DOI,"--options","{}"];n.debug(`Running autofind CLI with args: ${d.join(" ")}`);let b=jOI(import.meta.url),h=gmI(b),Z=Oh(h,".."),p=Oh(h,"..","..");n.debug(`Current working directory: ${process.cwd()}`),n.debug(`Current file location: ${b}`),n.debug(`Current dir from file: ${h}`),n.debug(`NODE_ENV: ${process.env.NODE_ENV}`),n.debug(`__dirname equivalent: ${h}`);let W=[Oh(process.cwd(),"autofind","autofind"),Oh(p,"autofind","autofind"),Oh(h,"autofind","autofind"),Oh(Z,"autofind","autofind"),...process.env.AGENT_DIR?[Oh(process.env.AGENT_DIR,"autofind","autofind")]:[]],N=null,Y=null;n.debug(`Searching for autofind binary in ${W.length} locations`);let F="Code review tool is not available in this environment. ";F+=`Searched paths: ${W.join(", ")}. `;for(let z of W)try{await XmI(z),N=z,Y=gmI(z),n.debug(`Using autofind binary at: ${z}`);break}catch(S){if(n.debug(`Autofind binary not found at: ${z} (${S instanceof Error?S.message:S})`),F+=`Autofind binary not found at: ${z}. `,a6.existsSync(z)){let II=a6.readdirSync(z).join(", ");F+=`Contents of ${z}: ${II}. `}}if(!N||!Y){n.error("Autofind binary not found in any expected locations"),n.debug(`Searched paths: ${W.join(", ")}`);try{let z=await import("fs/promises"),S=await z.readdir(h);n.debug(`Directory (${h}) contents: ${S.join(", ")}`),F+=`Directory (${h}) contents: ${S.join(", ")}. `;let II=await z.readdir(Z),rI=Oh(Z,".."),uI=await z.readdir(rI);n.debug(`Parent directory (${Z}) contents: ${II.join(", ")}. Grandparent directory (${rI}) contents: ${uI.join(", ")}.`),F+=`Parent directory (${Z}) contents: ${II.join(", ")}. `,F+=`Grandparent directory (${rI}) contents: ${uI.join(", ")}. `;let VI=process.cwd(),UI=await z.readdir(VI);n.debug(`Working directory (${VI}) contents: ${UI.join(", ")}`),F+=`Working directory (${VI}) contents: ${UI.join(", ")}. `}catch(z){n.debug(`Failed to list directory contents: ${z}`),F+=`Failed to list directory contents: ${z}. `}return{alerts:[],warning:F}}n.debug(`Running autofind CLI from ${Y}`);let g=l.api?.copilot?.token,A=l.api?.copilot?.hmacKey,X=g&&g.length>0?g:A;if(!X||X.length===0)throw n.error("CAPI token is not set"),new Error("The code_review tool requires an LLM API key");let v=l.api?.copilot?.integrationId;if(!v||v.length===0)throw n.error("CAPI integration ID is not set"),new Error("The code_review tool requires a Copilot integration ID");let J=process.env.NODE_ENV==="production"?{CAPI_INTEGRATION_ID:v,CAPI_PROD_KEY:X}:{CAPI_INTEGRATION_ID_DEV:v,CAPI_DEV_KEY:X},k=await c.execReturn(N,d,{cwd:Y,silent:!0,env:J});if(k.exitCode!==0){if(k.stderr.includes("not found")||k.stderr.includes("No such file"))return n.warning("Autofind CLI not found, returning empty results for testing"),{alerts:[],warning:`Code review tool is not available in this environment: ${k.stderr}`};if(k.stderr.includes("no Copilot API key provided")||k.stderr.includes("fatal error getting model"))return n.warning("Autofind CLI not configured with API key, returning empty results for testing"),{alerts:[],warning:"Code review tool is not configured with a valid API key"};throw new Error(`Go adapter failed with code ${k.exitCode}: ${k.stderr}`)}k.stderr.trim()!==""&&n.debug(`Autofind CLI stderr: ${k.stderr}`);try{let z=JSON.parse(k.stdout);return z.alerts&&z.alerts.length>0?n.debug(`Go CLI response parsed successfully, and contains ${z.alerts.length} alerts`):n.debug("Go CLI response parsed successfully, but contains zero results"),z}catch(z){throw new Error(`Go adapter failed to return valid JSON: ${z}. Output: "${k.stdout}"`)}}catch(r){if(r instanceof Error&&(r.message.includes("not found")||r.message.includes("No such file")||r.message.includes("ENOENT")))return n.warning(`Autofind CLI not available, returning empty results for testing: ${r.message}`),{alerts:[],warning:`Code review tool is not available in this environment: ${r.message}`};if(r instanceof Error&&(r.message.includes("no Copilot API key provided")||r.message.includes("fatal error getting model")||r.message.includes("Go adapter failed to return valid JSON: SyntaxError: Unexpected end of JSON input")))return n.warning("Autofind CLI configuration error, returning empty results for testing"),{alerts:[],warning:"Code review tool has configuration issues (likely missing or invalid API key)"};throw r}finally{if(a)try{await QmI(a)}catch(r){n.warning(`Failed to clean up temp file ${a}: ${r}`)}if(s)try{await QmI(s)}catch(r){n.warning(`Failed to clean up extras temp file ${s}: ${r}`)}}}G();import*as XRI from"fs";G();G();G();G();function Yu(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}G();G();function Ef(t,I,e,l){if(typeof e!="function")throw new Error("method for before hook must be a function");return l||(l={}),Array.isArray(I)?I.reverse().reduce((c,n)=>Ef.bind(null,t,n,c,l),e)():Promise.resolve().then(()=>t.registry[I]?t.registry[I].reduce((c,n)=>n.hook.bind(null,c,l),e)():e(l))}G();function HmI(t,I,e,l){let c=l;t.registry[e]||(t.registry[e]=[]),I==="before"&&(l=(n,a)=>Promise.resolve().then(c.bind(null,a)).then(n.bind(null,a))),I==="after"&&(l=(n,a)=>{let s;return Promise.resolve().then(n.bind(null,a)).then(r=>(s=r,c(s,a))).then(()=>s)}),I==="error"&&(l=(n,a)=>Promise.resolve().then(n.bind(null,a)).catch(s=>c(s,a))),t.registry[e].push({hook:l,orig:c})}G();function EmI(t,I,e){if(!t.registry[I])return;let l=t.registry[I].map(c=>c.orig).indexOf(e);l!==-1&&t.registry[I].splice(l,1)}var vmI=Function.bind,CmI=vmI.bind(vmI);function JmI(t,I,e){let l=CmI(EmI,null).apply(null,e?[I,e]:[I]);t.api={remove:l},t.remove=l,["before","error","after","wrap"].forEach(c=>{let n=e?[I,c,e]:[I,c];t[c]=t.api[c]=CmI(HmI,null).apply(null,n)})}function $OI(){let t=Symbol("Singular"),I={registry:{}},e=Ef.bind(null,I,t);return JmI(e,I,t),e}function IMI(){let t={registry:{}},I=Ef.bind(null,t);return JmI(I,t),I}var LmI={Singular:$OI,Collection:IMI};G();G();var eMI="0.0.0-development",tMI=`octokit-endpoint.js/${eMI} ${Yu()}`,lMI={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":tMI},mediaType:{format:""}};function cMI(t){return t?Object.keys(t).reduce((I,e)=>(I[e.toLowerCase()]=t[e],I),{}):{}}function nMI(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let I=Object.getPrototypeOf(t);if(I===null)return!0;let e=Object.prototype.hasOwnProperty.call(I,"constructor")&&I.constructor;return typeof e=="function"&&e instanceof e&&Function.prototype.call(e)===Function.prototype.call(t)}function xmI(t,I){let e=Object.assign({},t);return Object.keys(I).forEach(l=>{nMI(I[l])?l in t?e[l]=xmI(t[l],I[l]):Object.assign(e,{[l]:I[l]}):Object.assign(e,{[l]:I[l]})}),e}function kmI(t){for(let I in t)t[I]===void 0&&delete t[I];return t}function G6(t,I,e){if(typeof I=="string"){let[c,n]=I.split(" ");e=Object.assign(n?{method:c,url:n}:{url:c},e)}else e=Object.assign({},I);e.headers=cMI(e.headers),kmI(e),kmI(e.headers);let l=xmI(t||{},e);return e.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(l.mediaType.previews=t.mediaType.previews.filter(c=>!l.mediaType.previews.includes(c)).concat(l.mediaType.previews)),l.mediaType.previews=(l.mediaType.previews||[]).map(c=>c.replace(/-preview/,""))),l}function aMI(t,I){let e=/\?/.test(t)?"&":"?",l=Object.keys(I);return l.length===0?t:t+e+l.map(c=>c==="q"?"q="+I.q.split("+").map(encodeURIComponent).join("+"):`${c}=${encodeURIComponent(I[c])}`).join("&")}var sMI=/\{[^{}}]+\}/g;function rMI(t){return t.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function GMI(t){let I=t.match(sMI);return I?I.map(rMI).reduce((e,l)=>e.concat(l),[]):[]}function fmI(t,I){let e={__proto__:null};for(let l of Object.keys(t))I.indexOf(l)===-1&&(e[l]=t[l]);return e}function BmI(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(I){return/%[0-9A-Fa-f]/.test(I)||(I=encodeURI(I).replace(/%5B/g,"[").replace(/%5D/g,"]")),I}).join("")}function Sy(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(I){return"%"+I.charCodeAt(0).toString(16).toUpperCase()})}function NE(t,I,e){return I=t==="+"||t==="#"?BmI(I):Sy(I),e?Sy(e)+"="+I:I}function Uy(t){return t!=null}function r6(t){return t===";"||t==="&"||t==="?"}function oMI(t,I,e,l){var c=t[e],n=[];if(Uy(c)&&c!=="")if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")c=c.toString(),l&&l!=="*"&&(c=c.substring(0,parseInt(l,10))),n.push(NE(I,c,r6(I)?e:""));else if(l==="*")Array.isArray(c)?c.filter(Uy).forEach(function(a){n.push(NE(I,a,r6(I)?e:""))}):Object.keys(c).forEach(function(a){Uy(c[a])&&n.push(NE(I,c[a],a))});else{let a=[];Array.isArray(c)?c.filter(Uy).forEach(function(s){a.push(NE(I,s))}):Object.keys(c).forEach(function(s){Uy(c[s])&&(a.push(Sy(s)),a.push(NE(I,c[s].toString())))}),r6(I)?n.push(Sy(e)+"="+a.join(",")):a.length!==0&&n.push(a.join(","))}else I===";"?Uy(c)&&n.push(Sy(e)):c===""&&(I==="&"||I==="?")?n.push(Sy(e)+"="):c===""&&n.push("");return n}function dMI(t){return{expand:bMI.bind(null,t)}}function bMI(t,I){var e=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(l,c,n){if(c){let s="",r=[];if(e.indexOf(c.charAt(0))!==-1&&(s=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(o){var d=/([^:\*]*)(?::(\d+)|(\*))?/.exec(o);r.push(oMI(I,s,d[1],d[2]||d[3]))}),s&&s!=="+"){var a=",";return s==="?"?a="&":s!=="#"&&(a=s),(r.length!==0?s:"")+r.join(a)}else return r.join(",")}else return BmI(n)}),t==="/"?t:t.replace(/\/$/,"")}function zmI(t){let I=t.method.toUpperCase(),e=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),l=Object.assign({},t.headers),c,n=fmI(t,["method","baseUrl","url","headers","request","mediaType"]),a=GMI(e);e=dMI(e).expand(n),/^http/.test(e)||(e=t.baseUrl+e);let s=Object.keys(t).filter(d=>a.includes(d)).concat("baseUrl"),r=fmI(n,s);if(!/application\/octet-stream/i.test(l.accept)&&(t.mediaType.format&&(l.accept=l.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),e.endsWith("/graphql")&&t.mediaType.previews?.length)){let d=l.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];l.accept=d.concat(t.mediaType.previews).map(b=>{let h=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${b}-preview${h}`}).join(",")}return["GET","HEAD"].includes(I)?e=aMI(e,r):"data"in r?c=r.data:Object.keys(r).length&&(c=r),!l["content-type"]&&typeof c<"u"&&(l["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(I)&&typeof c>"u"&&(c=""),Object.assign({method:I,url:e,headers:l},typeof c<"u"?{body:c}:null,t.request?{request:t.request}:null)}function iMI(t,I,e){return zmI(G6(t,I,e))}function UmI(t,I){let e=G6(t,I),l=iMI.bind(null,e);return Object.assign(l,{DEFAULTS:e,defaults:UmI.bind(null,e),merge:G6.bind(null,e),parse:zmI})}var SmI=UmI(null,lMI);var KmI=Qc(jmI(),1);G();var lV=class extends Error{name;status;request;response;constructor(I,e,l){super(I),this.name="HttpError",this.status=Number.parseInt(e),Number.isNaN(this.status)&&(this.status=0),"response"in l&&(this.response=l.response);let c=Object.assign({},l.request);l.request.headers.authorization&&(c.headers=Object.assign({},l.request.headers,{authorization:l.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),c.url=c.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=c}};var mMI="10.0.3",hMI={headers:{"user-agent":`octokit-request.js/${mMI} ${Yu()}`}};function ZMI(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let I=Object.getPrototypeOf(t);if(I===null)return!0;let e=Object.prototype.hasOwnProperty.call(I,"constructor")&&I.constructor;return typeof e=="function"&&e instanceof e&&Function.prototype.call(e)===Function.prototype.call(t)}async function DmI(t){let I=t.request?.fetch||globalThis.fetch;if(!I)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let e=t.request?.log||console,l=t.request?.parseSuccessResponseBody!==!1,c=ZMI(t.body)||Array.isArray(t.body)?JSON.stringify(t.body):t.body,n=Object.fromEntries(Object.entries(t.headers).map(([b,h])=>[b,String(h)])),a;try{a=await I(t.url,{method:t.method,body:c,redirect:t.request?.redirect,headers:n,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(b){let h="Unknown Error";if(b instanceof Error){if(b.name==="AbortError")throw b.status=500,b;h=b.message,b.name==="TypeError"&&"cause"in b&&(b.cause instanceof Error?h=b.cause.message:typeof b.cause=="string"&&(h=b.cause))}let Z=new lV(h,500,{request:t});throw Z.cause=b,Z}let s=a.status,r=a.url,o={};for(let[b,h]of a.headers)o[b]=h;let d={url:r,status:s,headers:o,data:""};if("deprecation"in o){let b=o.link&&o.link.match(/<([^<>]+)>; rel="deprecation"/),h=b&&b.pop();e.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${o.sunset}${h?`. See ${h}`:""}`)}if(s===204||s===205)return d;if(t.method==="HEAD"){if(s<400)return d;throw new lV(a.statusText,s,{response:d,request:t})}if(s===304)throw d.data=await o6(a),new lV("Not modified",s,{response:d,request:t});if(s>=400)throw d.data=await o6(a),new lV(uMI(d.data),s,{response:d,request:t});return d.data=l?await o6(a):a.body,d}async function o6(t){let I=t.headers.get("content-type");if(!I)return t.text().catch(()=>"");let e=(0,KmI.safeParse)(I);if(pMI(e)){let l="";try{return l=await t.text(),JSON.parse(l)}catch{return l}}else return e.type.startsWith("text/")||e.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(()=>""):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}function pMI(t){return t.type==="application/json"||t.type==="application/scim+json"}function uMI(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){let I="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(e=>JSON.stringify(e)).join(", ")}${I}`:`${t.message}${I}`}return`Unknown error: ${JSON.stringify(t)}`}function d6(t,I){let e=t.defaults(I);return Object.assign(function(c,n){let a=e.merge(c,n);if(!a.request||!a.request.hook)return DmI(e.parse(a));let s=(r,o)=>DmI(e.parse(e.merge(r,o)));return Object.assign(s,{endpoint:e,defaults:d6.bind(null,e)}),a.request.hook(s,a)},{endpoint:e,defaults:d6.bind(null,e)})}var VE=d6(SmI,hMI);G();var WMI="0.0.0-development";function NMI(t){return`Request failed due to following response errors:
128
128
  `+t.errors.map(I=>` - ${I.message}`).join(`
129
129
  `)}var YMI=class extends Error{constructor(t,I,e){super(NMI(e)),this.request=t,this.headers=I,this.response=e,this.errors=e.errors,this.data=e.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name="GraphqlResponseError";errors;data},VMI=["method","baseUrl","url","headers","request","query","mediaType","operationName"],RMI=["query","method","url"],PmI=/\/api\/v3\/?$/;function yMI(t,I,e){if(e){if(typeof I=="string"&&"query"in e)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let a in e)if(RMI.includes(a))return Promise.reject(new Error(`[@octokit/graphql] "${a}" cannot be used as variable name`))}let l=typeof I=="string"?Object.assign({query:I},e):I,c=Object.keys(l).reduce((a,s)=>VMI.includes(s)?(a[s]=l[s],a):(a.variables||(a.variables={}),a.variables[s]=l[s],a),{}),n=l.baseUrl||t.endpoint.DEFAULTS.baseUrl;return PmI.test(n)&&(c.url=n.replace(PmI,"/api/graphql")),t(c).then(a=>{if(a.data.errors){let s={};for(let r of Object.keys(a.headers))s[r]=a.headers[r];throw new YMI(c,s,a.data)}return a.data.data})}function b6(t,I){let e=t.defaults(I);return Object.assign((c,n)=>yMI(e,c,n),{defaults:b6.bind(null,e),endpoint:e.endpoint})}var cSe=b6(VE,{headers:{"user-agent":`octokit-graphql.js/${WMI} ${Yu()}`},method:"POST",url:"/graphql"});function qmI(t){return b6(t,{method:"POST",url:"/graphql"})}G();var i6="(?:[a-zA-Z0-9_-]+)",_mI="\\.",$mI=new RegExp(`^${i6}${_mI}${i6}${_mI}${i6}$`),FMI=$mI.test.bind($mI);async function QMI(t){let I=FMI(t),e=t.startsWith("v1.")||t.startsWith("ghs_"),l=t.startsWith("ghu_");return{type:"token",token:t,tokenType:I?"app":e?"installation":l?"user-to-server":"oauth"}}function gMI(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}async function AMI(t,I,e,l){let c=I.endpoint.merge(e,l);return c.headers.authorization=gMI(t),I(c)}var IhI=function(I){if(!I)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof I!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return I=I.replace(/^(token|bearer) +/i,""),Object.assign(QMI.bind(null,I),{hook:AMI.bind(null,I)})};G();var m6="7.0.3";var ehI=()=>{},XMI=console.warn.bind(console),wMI=console.error.bind(console);function HMI(t={}){return typeof t.debug!="function"&&(t.debug=ehI),typeof t.info!="function"&&(t.info=ehI),typeof t.warn!="function"&&(t.warn=XMI),typeof t.error!="function"&&(t.error=wMI),t}var thI=`octokit-core.js/${m6} ${Yu()}`,Lf=class{static VERSION=m6;static defaults(I){return class extends this{constructor(...l){let c=l[0]||{};if(typeof I=="function"){super(I(c));return}super(Object.assign({},I,c,c.userAgent&&I.userAgent?{userAgent:`${c.userAgent} ${I.userAgent}`}:null))}}}static plugins=[];static plugin(...I){let e=this.plugins;return class extends this{static plugins=e.concat(I.filter(c=>!e.includes(c)))}}constructor(I={}){let e=new LmI.Collection,l={baseUrl:VE.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},I.request,{hook:e.bind(null,"request")}),mediaType:{previews:[],format:""}};if(l.headers["user-agent"]=I.userAgent?`${I.userAgent} ${thI}`:thI,I.baseUrl&&(l.baseUrl=I.baseUrl),I.previews&&(l.mediaType.previews=I.previews),I.timeZone&&(l.headers["time-zone"]=I.timeZone),this.request=VE.defaults(l),this.graphql=qmI(this.request).defaults(l),this.log=HMI(I.log),this.hook=e,I.authStrategy){let{authStrategy:n,...a}=I,s=n(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:a},I.auth));e.wrap("request",s.hook),this.auth=s}else if(!I.auth)this.auth=async()=>({type:"unauthenticated"});else{let n=IhI(I.auth);e.wrap("request",n.hook),this.auth=n}let c=this.constructor;for(let n=0;n<c.plugins.length;++n)Object.assign(this,c.plugins[n](this,I))}request;graphql;log;hook;auth};G();G();var lhI="6.0.0";function h6(t){t.hook.wrap("request",(I,e)=>{t.log.debug("request",e);let l=Date.now(),c=t.request.endpoint.parse(e),n=c.url.replace(e.baseUrl,"");return I(e).then(a=>{let s=a.headers["x-github-request-id"];return t.log.info(`${c.method} ${n} - ${a.status} with id ${s} in ${Date.now()-l}ms`),a}).catch(a=>{let s=a.response?.headers["x-github-request-id"]||"UNKNOWN";throw t.log.error(`${c.method} ${n} - ${a.status} with id ${s} in ${Date.now()-l}ms`),a})})}h6.VERSION=lhI;G();var EMI="0.0.0-development";function vMI(t){if(!t.data)return{...t,data:[]};if(!(("total_count"in t.data||"total_commits"in t.data)&&!("url"in t.data)))return t;let e=t.data.incomplete_results,l=t.data.repository_selection,c=t.data.total_count,n=t.data.total_commits;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count,delete t.data.total_commits;let a=Object.keys(t.data)[0],s=t.data[a];return t.data=s,typeof e<"u"&&(t.data.incomplete_results=e),typeof l<"u"&&(t.data.repository_selection=l),t.data.total_count=c,t.data.total_commits=n,t}function Z6(t,I,e){let l=typeof I=="function"?I.endpoint(e):t.request.endpoint(I,e),c=typeof I=="function"?I:t.request,n=l.method,a=l.headers,s=l.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!s)return{done:!0};try{let r=await c({method:n,url:s,headers:a}),o=vMI(r);if(s=((o.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!s&&"total_commits"in o.data){let d=new URL(o.url),b=d.searchParams,h=parseInt(b.get("page")||"1",10),Z=parseInt(b.get("per_page")||"250",10);h*Z<o.data.total_commits&&(b.set("page",String(h+1)),s=d.toString())}return{value:o}}catch(r){if(r.status!==409)throw r;return s="",{value:{status:200,headers:{},data:[]}}}}})}}function chI(t,I,e,l){return typeof e=="function"&&(l=e,e=void 0),nhI(t,[],Z6(t,I,e)[Symbol.asyncIterator](),l)}function nhI(t,I,e,l){return e.next().then(c=>{if(c.done)return I;let n=!1;function a(){n=!0}return I=I.concat(l?l(c.value,a):c.value.data),n?I:nhI(t,I,e,l)})}var gSe=Object.assign(chI,{iterator:Z6});function p6(t){return{paginate:Object.assign(chI.bind(null,t),{iterator:Z6.bind(null,t)})}}p6.VERSION=EMI;G();G();var u6="16.0.0";G();G();var CMI={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createOrUpdateCustomProperties:["PATCH /orgs/{org}/properties/schema"],createOrUpdateCustomPropertiesValuesForRepos:["PATCH /orgs/{org}/properties/values"],createOrUpdateCustomProperty:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],createWebhook:["POST /orgs/{org}/hooks"],delete:["DELETE /orgs/{org}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],enableOrDisableSecurityProductOnAllOrgRepos:["POST /orgs/{org}/{security_product}/{enablement}",{},{deprecated:"octokit.rest.orgs.enableOrDisableSecurityProductOnAllOrgRepos() is deprecated, see https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization"}],get:["GET /orgs/{org}"],getAllCustomProperties:["GET /orgs/{org}/properties/schema"],getCustomProperty:["GET /orgs/{org}/properties/schema/{custom_property_name}"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listCustomPropertiesValuesForRepos:["GET /orgs/{org}/properties/values"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeCustomProperty:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateCustomPropertiesValues:["PATCH /repos/{owner}/{repo}/properties/values"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getCustomPropertiesValues:["GET /repos/{owner}/{repo}/properties/values"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues",{},{deprecated:"octokit.rest.search.issuesAndPullRequests() is deprecated, see https://docs.github.com/rest/search/search#search-issues-and-pull-requests"}],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/secret-scanning/alerts"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},ahI=CMI;var cV=new Map;for(let[t,I]of Object.entries(ahI))for(let[e,l]of Object.entries(I)){let[c,n,a]=l,[s,r]=c.split(/ /),o=Object.assign({method:s,url:r},n);cV.has(t)||cV.set(t,new Map),cV.get(t).set(e,{scope:t,methodName:e,endpointDefaults:o,decorations:a})}var JMI={has({scope:t},I){return cV.get(t).has(I)},getOwnPropertyDescriptor(t,I){return{value:this.get(t,I),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,I,e){return Object.defineProperty(t.cache,I,e),!0},deleteProperty(t,I){return delete t.cache[I],!0},ownKeys({scope:t}){return[...cV.get(t).keys()]},set(t,I,e){return t.cache[I]=e},get({octokit:t,scope:I,cache:e},l){if(e[l])return e[l];let c=cV.get(I).get(l);if(!c)return;let{endpointDefaults:n,decorations:a}=c;return a?e[l]=LMI(t,I,l,n,a):e[l]=t.request.defaults(n),e[l]}};function W6(t){let I={};for(let e of cV.keys())I[e]=new Proxy({octokit:t,scope:e,cache:{}},JMI);return I}function LMI(t,I,e,l,c){let n=t.request.defaults(l);function a(...s){let r=n.endpoint.merge(...s);if(c.mapToData)return r=Object.assign({},r,{data:r[c.mapToData],[c.mapToData]:void 0}),n(r);if(c.renamed){let[o,d]=c.renamed;t.log.warn(`octokit.${I}.${e}() has been renamed to octokit.${o}.${d}()`)}if(c.deprecated&&t.log.warn(c.deprecated),c.renamedParameters){let o=n.endpoint.merge(...s);for(let[d,b]of Object.entries(c.renamedParameters))d in o&&(t.log.warn(`"${d}" parameter is deprecated for "octokit.${I}.${e}()". Use "${b}" instead`),b in o||(o[b]=o[d]),delete o[d]);return n(o)}return n(...s)}return Object.assign(a,n)}function kMI(t){return{rest:W6(t)}}kMI.VERSION=u6;function N6(t){let I=W6(t);return{...I,rest:I}}N6.VERSION=u6;G();var shI="22.0.0";var kf=Lf.plugin(h6,N6,p6).defaults({userAgent:`octokit-rest.js/${shI}`});import*as Ti from"fs";import*as RRI from"os";import rQ from"path";import{finished as Tce}from"stream/promises";import{Readable as jce}from"stream";G();G();G();import KMI from"events";import Tr from"fs";G();import{EventEmitter as g6}from"node:events";import bhI from"node:stream";import{StringDecoder as xMI}from"node:string_decoder";var rhI=typeof process=="object"&&process?process:{stdout:null,stderr:null},BMI=t=>!!t&&typeof t=="object"&&(t instanceof Un||t instanceof bhI||zMI(t)||UMI(t)),zMI=t=>!!t&&typeof t=="object"&&t instanceof g6&&typeof t.pipe=="function"&&t.pipe!==bhI.Writable.prototype.pipe,UMI=t=>!!t&&typeof t=="object"&&t instanceof g6&&typeof t.write=="function"&&typeof t.end=="function",Th=Symbol("EOF"),jh=Symbol("maybeEmitEnd"),Vu=Symbol("emittedEnd"),ff=Symbol("emittingEnd"),RE=Symbol("emittedError"),xf=Symbol("closed"),GhI=Symbol("read"),Bf=Symbol("flush"),ohI=Symbol("flushChunk"),cb=Symbol("encoding"),Oy=Symbol("decoder"),ba=Symbol("flowing"),yE=Symbol("paused"),My=Symbol("resume"),ia=Symbol("buffer"),Ds=Symbol("pipes"),ma=Symbol("bufferLength"),Y6=Symbol("bufferPush"),zf=Symbol("bufferShift"),ms=Symbol("objectMode"),sn=Symbol("destroyed"),V6=Symbol("error"),R6=Symbol("emitData"),dhI=Symbol("emitEnd"),y6=Symbol("emitEnd2"),Ri=Symbol("async"),F6=Symbol("abort"),Uf=Symbol("aborted"),FE=Symbol("signal"),nV=Symbol("dataListeners"),jG=Symbol("discarded"),QE=t=>Promise.resolve().then(t),SMI=t=>t(),OMI=t=>t==="end"||t==="finish"||t==="prefinish",MMI=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,TMI=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Sf=class{src;dest;opts;ondrain;constructor(I,e,l){this.src=I,this.dest=e,this.opts=l,this.ondrain=()=>I[My](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(I){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Q6=class extends Sf{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(I,e,l){super(I,e,l),this.proxyErrors=c=>e.emit("error",c),I.on("error",this.proxyErrors)}},jMI=t=>!!t.objectMode,DMI=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Un=class extends g6{[ba]=!1;[yE]=!1;[Ds]=[];[ia]=[];[ms];[cb];[Ri];[Oy];[Th]=!1;[Vu]=!1;[ff]=!1;[xf]=!1;[RE]=null;[ma]=0;[sn]=!1;[FE];[Uf]=!1;[nV]=0;[jG]=!1;writable=!0;readable=!0;constructor(...I){let e=I[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");jMI(e)?(this[ms]=!0,this[cb]=null):DMI(e)?(this[cb]=e.encoding,this[ms]=!1):(this[ms]=!1,this[cb]=null),this[Ri]=!!e.async,this[Oy]=this[cb]?new xMI(this[cb]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ia]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Ds]});let{signal:l}=e;l&&(this[FE]=l,l.aborted?this[F6]():l.addEventListener("abort",()=>this[F6]()))}get bufferLength(){return this[ma]}get encoding(){return this[cb]}set encoding(I){throw new Error("Encoding must be set at instantiation time")}setEncoding(I){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ms]}set objectMode(I){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ri]}set async(I){this[Ri]=this[Ri]||!!I}[F6](){this[Uf]=!0,this.emit("abort",this[FE]?.reason),this.destroy(this[FE]?.reason)}get aborted(){return this[Uf]}set aborted(I){}write(I,e,l){if(this[Uf])return!1;if(this[Th])throw new Error("write after end");if(this[sn])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(l=e,e="utf8"),e||(e="utf8");let c=this[Ri]?QE:SMI;if(!this[ms]&&!Buffer.isBuffer(I)){if(TMI(I))I=Buffer.from(I.buffer,I.byteOffset,I.byteLength);else if(MMI(I))I=Buffer.from(I);else if(typeof I!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ms]?(this[ba]&&this[ma]!==0&&this[Bf](!0),this[ba]?this.emit("data",I):this[Y6](I),this[ma]!==0&&this.emit("readable"),l&&c(l),this[ba]):I.length?(typeof I=="string"&&!(e===this[cb]&&!this[Oy]?.lastNeed)&&(I=Buffer.from(I,e)),Buffer.isBuffer(I)&&this[cb]&&(I=this[Oy].write(I)),this[ba]&&this[ma]!==0&&this[Bf](!0),this[ba]?this.emit("data",I):this[Y6](I),this[ma]!==0&&this.emit("readable"),l&&c(l),this[ba]):(this[ma]!==0&&this.emit("readable"),l&&c(l),this[ba])}read(I){if(this[sn])return null;if(this[jG]=!1,this[ma]===0||I===0||I&&I>this[ma])return this[jh](),null;this[ms]&&(I=null),this[ia].length>1&&!this[ms]&&(this[ia]=[this[cb]?this[ia].join(""):Buffer.concat(this[ia],this[ma])]);let e=this[GhI](I||null,this[ia][0]);return this[jh](),e}[GhI](I,e){if(this[ms])this[zf]();else{let l=e;I===l.length||I===null?this[zf]():typeof l=="string"?(this[ia][0]=l.slice(I),e=l.slice(0,I),this[ma]-=I):(this[ia][0]=l.subarray(I),e=l.subarray(0,I),this[ma]-=I)}return this.emit("data",e),!this[ia].length&&!this[Th]&&this.emit("drain"),e}end(I,e,l){return typeof I=="function"&&(l=I,I=void 0),typeof e=="function"&&(l=e,e="utf8"),I!==void 0&&this.write(I,e),l&&this.once("end",l),this[Th]=!0,this.writable=!1,(this[ba]||!this[yE])&&this[jh](),this}[My](){this[sn]||(!this[nV]&&!this[Ds].length&&(this[jG]=!0),this[yE]=!1,this[ba]=!0,this.emit("resume"),this[ia].length?this[Bf]():this[Th]?this[jh]():this.emit("drain"))}resume(){return this[My]()}pause(){this[ba]=!1,this[yE]=!0,this[jG]=!1}get destroyed(){return this[sn]}get flowing(){return this[ba]}get paused(){return this[yE]}[Y6](I){this[ms]?this[ma]+=1:this[ma]+=I.length,this[ia].push(I)}[zf](){return this[ms]?this[ma]-=1:this[ma]-=this[ia][0].length,this[ia].shift()}[Bf](I=!1){do;while(this[ohI](this[zf]())&&this[ia].length);!I&&!this[ia].length&&!this[Th]&&this.emit("drain")}[ohI](I){return this.emit("data",I),this[ba]}pipe(I,e){if(this[sn])return I;this[jG]=!1;let l=this[Vu];return e=e||{},I===rhI.stdout||I===rhI.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,l?e.end&&I.end():(this[Ds].push(e.proxyErrors?new Q6(this,I,e):new Sf(this,I,e)),this[Ri]?QE(()=>this[My]()):this[My]()),I}unpipe(I){let e=this[Ds].find(l=>l.dest===I);e&&(this[Ds].length===1?(this[ba]&&this[nV]===0&&(this[ba]=!1),this[Ds]=[]):this[Ds].splice(this[Ds].indexOf(e),1),e.unpipe())}addListener(I,e){return this.on(I,e)}on(I,e){let l=super.on(I,e);if(I==="data")this[jG]=!1,this[nV]++,!this[Ds].length&&!this[ba]&&this[My]();else if(I==="readable"&&this[ma]!==0)super.emit("readable");else if(OMI(I)&&this[Vu])super.emit(I),this.removeAllListeners(I);else if(I==="error"&&this[RE]){let c=e;this[Ri]?QE(()=>c.call(this,this[RE])):c.call(this,this[RE])}return l}removeListener(I,e){return this.off(I,e)}off(I,e){let l=super.off(I,e);return I==="data"&&(this[nV]=this.listeners("data").length,this[nV]===0&&!this[jG]&&!this[Ds].length&&(this[ba]=!1)),l}removeAllListeners(I){let e=super.removeAllListeners(I);return(I==="data"||I===void 0)&&(this[nV]=0,!this[jG]&&!this[Ds].length&&(this[ba]=!1)),e}get emittedEnd(){return this[Vu]}[jh](){!this[ff]&&!this[Vu]&&!this[sn]&&this[ia].length===0&&this[Th]&&(this[ff]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[xf]&&this.emit("close"),this[ff]=!1)}emit(I,...e){let l=e[0];if(I!=="error"&&I!=="close"&&I!==sn&&this[sn])return!1;if(I==="data")return!this[ms]&&!l?!1:this[Ri]?(QE(()=>this[R6](l)),!0):this[R6](l);if(I==="end")return this[dhI]();if(I==="close"){if(this[xf]=!0,!this[Vu]&&!this[sn])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(I==="error"){this[RE]=l,super.emit(V6,l);let n=!this[FE]||this.listeners("error").length?super.emit("error",l):!1;return this[jh](),n}else if(I==="resume"){let n=super.emit("resume");return this[jh](),n}else if(I==="finish"||I==="prefinish"){let n=super.emit(I);return this.removeAllListeners(I),n}let c=super.emit(I,...e);return this[jh](),c}[R6](I){for(let l of this[Ds])l.dest.write(I)===!1&&this.pause();let e=this[jG]?!1:super.emit("data",I);return this[jh](),e}[dhI](){return this[Vu]?!1:(this[Vu]=!0,this.readable=!1,this[Ri]?(QE(()=>this[y6]()),!0):this[y6]())}[y6](){if(this[Oy]){let e=this[Oy].end();if(e){for(let l of this[Ds])l.dest.write(e);this[jG]||super.emit("data",e)}}for(let e of this[Ds])e.end();let I=super.emit("end");return this.removeAllListeners("end"),I}async collect(){let I=Object.assign([],{dataLength:0});this[ms]||(I.dataLength=0);let e=this.promise();return this.on("data",l=>{I.push(l),this[ms]||(I.dataLength+=l.length)}),await e,I}async concat(){if(this[ms])throw new Error("cannot concat in objectMode");let I=await this.collect();return this[cb]?I.join(""):Buffer.concat(I,I.dataLength)}async promise(){return new Promise((I,e)=>{this.on(sn,()=>e(new Error("stream destroyed"))),this.on("error",l=>e(l)),this.on("end",()=>I())})}[Symbol.asyncIterator](){this[jG]=!1;let I=!1,e=async()=>(this.pause(),I=!0,{value:void 0,done:!0});return{next:()=>{if(I)return e();let c=this.read();if(c!==null)return Promise.resolve({done:!1,value:c});if(this[Th])return e();let n,a,s=b=>{this.off("data",r),this.off("end",o),this.off(sn,d),e(),a(b)},r=b=>{this.off("error",s),this.off("end",o),this.off(sn,d),this.pause(),n({value:b,done:!!this[Th]})},o=()=>{this.off("error",s),this.off("data",r),this.off(sn,d),e(),n({done:!0,value:void 0})},d=()=>s(new Error("stream destroyed"));return new Promise((b,h)=>{a=h,n=b,this.once(sn,d),this.once("error",s),this.once("end",o),this.once("data",r)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[jG]=!1;let I=!1,e=()=>(this.pause(),this.off(V6,e),this.off(sn,e),this.off("end",e),I=!0,{done:!0,value:void 0}),l=()=>{if(I)return e();let c=this.read();return c===null?e():{done:!1,value:c}};return this.once("end",e),this.once(V6,e),this.once(sn,e),{next:l,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(I){if(this[sn])return I?this.emit("error",I):this.emit(sn),this;this[sn]=!0,this[jG]=!0,this[ia].length=0,this[ma]=0;let e=this;return typeof e.close=="function"&&!this[xf]&&e.close(),I?this.emit("error",I):this.emit(sn),this}static get isStream(){return BMI}};var PMI=Tr.writev,yu=Symbol("_autoClose"),ab=Symbol("_close"),gE=Symbol("_ended"),Wl=Symbol("_fd"),A6=Symbol("_finished"),Kh=Symbol("_flags"),X6=Symbol("_flush"),v6=Symbol("_handleChunk"),C6=Symbol("_makeBuf"),XE=Symbol("_mode"),Of=Symbol("_needDrain"),Dy=Symbol("_onerror"),Ky=Symbol("_onopen"),w6=Symbol("_onread"),Ty=Symbol("_onwrite"),Fu=Symbol("_open"),nb=Symbol("_path"),Ru=Symbol("_pos"),yi=Symbol("_queue"),jy=Symbol("_read"),H6=Symbol("_readSize"),Dh=Symbol("_reading"),AE=Symbol("_remain"),E6=Symbol("_size"),Mf=Symbol("_write"),aV=Symbol("_writing"),Tf=Symbol("_defaultFlag"),sV=Symbol("_errored"),rV=class extends Un{[sV]=!1;[Wl];[nb];[H6];[Dh]=!1;[E6];[AE];[yu];constructor(I,e){if(e=e||{},super(e),this.readable=!0,this.writable=!1,typeof I!="string")throw new TypeError("path must be a string");this[sV]=!1,this[Wl]=typeof e.fd=="number"?e.fd:void 0,this[nb]=I,this[H6]=e.readSize||16*1024*1024,this[Dh]=!1,this[E6]=typeof e.size=="number"?e.size:1/0,this[AE]=this[E6],this[yu]=typeof e.autoClose=="boolean"?e.autoClose:!0,typeof this[Wl]=="number"?this[jy]():this[Fu]()}get fd(){return this[Wl]}get path(){return this[nb]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Fu](){Tr.open(this[nb],"r",(I,e)=>this[Ky](I,e))}[Ky](I,e){I?this[Dy](I):(this[Wl]=e,this.emit("open",e),this[jy]())}[C6](){return Buffer.allocUnsafe(Math.min(this[H6],this[AE]))}[jy](){if(!this[Dh]){this[Dh]=!0;let I=this[C6]();if(I.length===0)return process.nextTick(()=>this[w6](null,0,I));Tr.read(this[Wl],I,0,I.length,null,(e,l,c)=>this[w6](e,l,c))}}[w6](I,e,l){this[Dh]=!1,I?this[Dy](I):this[v6](e,l)&&this[jy]()}[ab](){if(this[yu]&&typeof this[Wl]=="number"){let I=this[Wl];this[Wl]=void 0,Tr.close(I,e=>e?this.emit("error",e):this.emit("close"))}}[Dy](I){this[Dh]=!0,this[ab](),this.emit("error",I)}[v6](I,e){let l=!1;return this[AE]-=I,I>0&&(l=super.write(I<e.length?e.subarray(0,I):e)),(I===0||this[AE]<=0)&&(l=!1,this[ab](),super.end()),l}emit(I,...e){switch(I){case"prefinish":case"finish":return!1;case"drain":return typeof this[Wl]=="number"&&this[jy](),!1;case"error":return this[sV]?!1:(this[sV]=!0,super.emit(I,...e));default:return super.emit(I,...e)}}},jf=class extends rV{[Fu](){let I=!0;try{this[Ky](null,Tr.openSync(this[nb],"r")),I=!1}finally{I&&this[ab]()}}[jy](){let I=!0;try{if(!this[Dh]){this[Dh]=!0;do{let e=this[C6](),l=e.length===0?0:Tr.readSync(this[Wl],e,0,e.length,null);if(!this[v6](l,e))break}while(!0);this[Dh]=!1}I=!1}finally{I&&this[ab]()}}[ab](){if(this[yu]&&typeof this[Wl]=="number"){let I=this[Wl];this[Wl]=void 0,Tr.closeSync(I),this.emit("close")}}},Ph=class extends KMI{readable=!1;writable=!0;[sV]=!1;[aV]=!1;[gE]=!1;[yi]=[];[Of]=!1;[nb];[XE];[yu];[Wl];[Tf];[Kh];[A6]=!1;[Ru];constructor(I,e){e=e||{},super(e),this[nb]=I,this[Wl]=typeof e.fd=="number"?e.fd:void 0,this[XE]=e.mode===void 0?438:e.mode,this[Ru]=typeof e.start=="number"?e.start:void 0,this[yu]=typeof e.autoClose=="boolean"?e.autoClose:!0;let l=this[Ru]!==void 0?"r+":"w";this[Tf]=e.flags===void 0,this[Kh]=e.flags===void 0?l:e.flags,this[Wl]===void 0&&this[Fu]()}emit(I,...e){if(I==="error"){if(this[sV])return!1;this[sV]=!0}return super.emit(I,...e)}get fd(){return this[Wl]}get path(){return this[nb]}[Dy](I){this[ab](),this[aV]=!0,this.emit("error",I)}[Fu](){Tr.open(this[nb],this[Kh],this[XE],(I,e)=>this[Ky](I,e))}[Ky](I,e){this[Tf]&&this[Kh]==="r+"&&I&&I.code==="ENOENT"?(this[Kh]="w",this[Fu]()):I?this[Dy](I):(this[Wl]=e,this.emit("open",e),this[aV]||this[X6]())}end(I,e){return I&&this.write(I,e),this[gE]=!0,!this[aV]&&!this[yi].length&&typeof this[Wl]=="number"&&this[Ty](null,0),this}write(I,e){return typeof I=="string"&&(I=Buffer.from(I,e)),this[gE]?(this.emit("error",new Error("write() after end()")),!1):this[Wl]===void 0||this[aV]||this[yi].length?(this[yi].push(I),this[Of]=!0,!1):(this[aV]=!0,this[Mf](I),!0)}[Mf](I){Tr.write(this[Wl],I,0,I.length,this[Ru],(e,l)=>this[Ty](e,l))}[Ty](I,e){I?this[Dy](I):(this[Ru]!==void 0&&typeof e=="number"&&(this[Ru]+=e),this[yi].length?this[X6]():(this[aV]=!1,this[gE]&&!this[A6]?(this[A6]=!0,this[ab](),this.emit("finish")):this[Of]&&(this[Of]=!1,this.emit("drain"))))}[X6](){if(this[yi].length===0)this[gE]&&this[Ty](null,0);else if(this[yi].length===1)this[Mf](this[yi].pop());else{let I=this[yi];this[yi]=[],PMI(this[Wl],I,this[Ru],(e,l)=>this[Ty](e,l))}}[ab](){if(this[yu]&&typeof this[Wl]=="number"){let I=this[Wl];this[Wl]=void 0,Tr.close(I,e=>e?this.emit("error",e):this.emit("close"))}}},Py=class extends Ph{[Fu](){let I;if(this[Tf]&&this[Kh]==="r+")try{I=Tr.openSync(this[nb],this[Kh],this[XE])}catch(e){if(e?.code==="ENOENT")return this[Kh]="w",this[Fu]();throw e}else I=Tr.openSync(this[nb],this[Kh],this[XE]);this[Ky](null,I)}[ab](){if(this[yu]&&typeof this[Wl]=="number"){let I=this[Wl];this[Wl]=void 0,Tr.closeSync(I),this.emit("close")}}[Mf](I){let e=!0;try{this[Ty](null,Tr.writeSync(this[Wl],I,0,I.length,this[Ru])),e=!1}finally{if(e)try{this[ab]()}catch{}}}};import MhI from"node:path";G();import tF from"node:fs";import{dirname as wTI,parse as HTI}from"path";G();G();var qMI=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),ihI=t=>!!t.sync&&!!t.file,mhI=t=>!t.sync&&!!t.file,hhI=t=>!!t.sync&&!t.file,ZhI=t=>!t.sync&&!t.file;var phI=t=>!!t.file;var _MI=t=>{let I=qMI.get(t);return I||t},wE=(t={})=>{if(!t)return{};let I={};for(let[e,l]of Object.entries(t)){let c=_MI(e);I[c]=l}return I.chmod===void 0&&I.noChmod===!1&&(I.chmod=!0),delete I.noChmod,I};var Fi=(t,I,e,l,c)=>Object.assign((n=[],a,s)=>{Array.isArray(n)&&(a=n,n={}),typeof a=="function"&&(s=a,a=void 0),a?a=Array.from(a):a=[];let r=wE(n);if(c?.(r,a),ihI(r)){if(typeof s=="function")throw new TypeError("callback not supported for sync tar functions");return t(r,a)}else if(mhI(r)){let o=I(r,a),d=s||void 0;return d?o.then(()=>d(),d):o}else if(hhI(r)){if(typeof s=="function")throw new TypeError("callback not supported for sync tar functions");return e(r,a)}else if(ZhI(r)){if(typeof s=="function")throw new TypeError("callback only supported with file option");return l(r,a)}else throw new Error("impossible options??")},{syncFile:t,asyncFile:I,syncNoFile:e,asyncNoFile:l,validate:c});G();import{EventEmitter as gTI}from"events";G();import f6 from"assert";import{Buffer as GV}from"buffer";import*as eTI from"zlib";G();import $MI from"zlib";var ITI=$MI.constants||{ZLIB_VERNUM:4736},qh=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},ITI));var tTI=GV.concat,uhI=Object.getOwnPropertyDescriptor(GV,"concat"),lTI=t=>t,L6=uhI?.writable===!0||uhI?.set!==void 0?t=>{GV.concat=t?lTI:tTI}:t=>{},oV=Symbol("_superWrite"),qy=class extends Error{code;errno;constructor(I){super("zlib: "+I.message),this.code=I.code,this.errno=I.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+I.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},k6=Symbol("flushFlag"),Df=class extends Un{#I=!1;#e=!1;#t;#l;#c;#n;#G;get sawError(){return this.#I}get handle(){return this.#n}get flushFlag(){return this.#t}constructor(I,e){if(!I||typeof I!="object")throw new TypeError("invalid options for ZlibBase constructor");super(I),this.#t=I.flush??0,this.#l=I.finishFlush??0,this.#c=I.fullFlushFlag??0;try{this.#n=new eTI[e](I)}catch(l){throw new qy(l)}this.#G=l=>{this.#I||(this.#I=!0,this.close(),this.emit("error",l))},this.#n?.on("error",l=>this.#G(new qy(l))),this.once("end",()=>this.close)}close(){this.#n&&(this.#n.close(),this.#n=void 0,this.emit("close"))}reset(){if(!this.#I)return f6(this.#n,"zlib binding closed"),this.#n.reset?.()}flush(I){this.ended||(typeof I!="number"&&(I=this.#c),this.write(Object.assign(GV.alloc(0),{[k6]:I})))}end(I,e,l){return typeof I=="function"&&(l=I,e=void 0,I=void 0),typeof e=="function"&&(l=e,e=void 0),I&&(e?this.write(I,e):this.write(I)),this.flush(this.#l),this.#e=!0,super.end(l)}get ended(){return this.#e}[oV](I){return super.write(I)}write(I,e,l){if(typeof e=="function"&&(l=e,e="utf8"),typeof I=="string"&&(I=GV.from(I,e)),this.#I)return;f6(this.#n,"zlib binding closed");let c=this.#n._handle,n=c.close;c.close=()=>{};let a=this.#n.close;this.#n.close=()=>{},L6(!0);let s;try{let o=typeof I[k6]=="number"?I[k6]:this.#t;s=this.#n._processChunk(I,o),L6(!1)}catch(o){L6(!1),this.#G(new qy(o))}finally{this.#n&&(this.#n._handle=c,c.close=n,this.#n.close=a,this.#n.removeAllListeners("error"))}this.#n&&this.#n.on("error",o=>this.#G(new qy(o)));let r;if(s)if(Array.isArray(s)&&s.length>0){let o=s[0];r=this[oV](GV.from(o));for(let d=1;d<s.length;d++)r=this[oV](s[d])}else r=this[oV](GV.from(s));return l&&l(),r}},Kf=class extends Df{#I;#e;constructor(I,e){I=I||{},I.flush=I.flush||qh.Z_NO_FLUSH,I.finishFlush=I.finishFlush||qh.Z_FINISH,I.fullFlushFlag=qh.Z_FULL_FLUSH,super(I,e),this.#I=I.level,this.#e=I.strategy}params(I,e){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#I!==I||this.#e!==e){this.flush(qh.Z_SYNC_FLUSH),f6(this.handle,"zlib binding closed");let l=this.handle.flush;this.handle.flush=(c,n)=>{typeof c=="function"&&(n=c,c=this.flushFlag),this.flush(c),n?.()};try{this.handle.params(I,e)}finally{this.handle.flush=l}this.handle&&(this.#I=I,this.#e=e)}}}};var Pf=class extends Kf{#I;constructor(I){super(I,"Gzip"),this.#I=I&&!!I.portable}[oV](I){return this.#I?(this.#I=!1,I[9]=255,super[oV](I)):super[oV](I)}};var qf=class extends Kf{constructor(I){super(I,"Unzip")}},_f=class extends Df{constructor(I,e){I=I||{},I.flush=I.flush||qh.BROTLI_OPERATION_PROCESS,I.finishFlush=I.finishFlush||qh.BROTLI_OPERATION_FINISH,I.fullFlushFlag=qh.BROTLI_OPERATION_FLUSH,super(I,e)}},$f=class extends _f{constructor(I){super(I,"BrotliCompress")}},Ix=class extends _f{constructor(I){super(I,"BrotliDecompress")}};G();var _y=class t{tail;head;length=0;static create(I=[]){return new t(I)}constructor(I=[]){for(let e of I)this.push(e)}*[Symbol.iterator](){for(let I=this.head;I;I=I.next)yield I.value}removeNode(I){if(I.list!==this)throw new Error("removing node which does not belong to this list");let e=I.next,l=I.prev;return e&&(e.prev=l),l&&(l.next=e),I===this.head&&(this.head=e),I===this.tail&&(this.tail=l),this.length--,I.next=void 0,I.prev=void 0,I.list=void 0,e}unshiftNode(I){if(I===this.head)return;I.list&&I.list.removeNode(I);let e=this.head;I.list=this,I.next=e,e&&(e.prev=I),this.head=I,this.tail||(this.tail=I),this.length++}pushNode(I){if(I===this.tail)return;I.list&&I.list.removeNode(I);let e=this.tail;I.list=this,I.prev=e,e&&(e.next=I),this.tail=I,this.head||(this.head=I),this.length++}push(...I){for(let e=0,l=I.length;e<l;e++)aTI(this,I[e]);return this.length}unshift(...I){for(var e=0,l=I.length;e<l;e++)sTI(this,I[e]);return this.length}pop(){if(!this.tail)return;let I=this.tail.value,e=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,e.list=void 0,this.length--,I}shift(){if(!this.head)return;let I=this.head.value,e=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,e.list=void 0,this.length--,I}forEach(I,e){e=e||this;for(let l=this.head,c=0;l;c++)I.call(e,l.value,c,this),l=l.next}forEachReverse(I,e){e=e||this;for(let l=this.tail,c=this.length-1;l;c--)I.call(e,l.value,c,this),l=l.prev}get(I){let e=0,l=this.head;for(;l&&e<I;e++)l=l.next;if(e===I&&l)return l.value}getReverse(I){let e=0,l=this.tail;for(;l&&e<I;e++)l=l.prev;if(e===I&&l)return l.value}map(I,e){e=e||this;let l=new t;for(let c=this.head;c;)l.push(I.call(e,c.value,this)),c=c.next;return l}mapReverse(I,e){e=e||this;var l=new t;for(let c=this.tail;c;)l.push(I.call(e,c.value,this)),c=c.prev;return l}reduce(I,e){let l,c=this.head;if(arguments.length>1)l=e;else if(this.head)c=this.head.next,l=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;c;n++)l=I(l,c.value,n),c=c.next;return l}reduceReverse(I,e){let l,c=this.tail;if(arguments.length>1)l=e;else if(this.tail)c=this.tail.prev,l=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;c;n--)l=I(l,c.value,n),c=c.prev;return l}toArray(){let I=new Array(this.length);for(let e=0,l=this.head;l;e++)I[e]=l.value,l=l.next;return I}toArrayReverse(){let I=new Array(this.length);for(let e=0,l=this.tail;l;e++)I[e]=l.value,l=l.prev;return I}slice(I=0,e=this.length){e<0&&(e+=this.length),I<0&&(I+=this.length);let l=new t;if(e<I||e<0)return l;I<0&&(I=0),e>this.length&&(e=this.length);let c=this.head,n=0;for(n=0;c&&n<I;n++)c=c.next;for(;c&&n<e;n++,c=c.next)l.push(c.value);return l}sliceReverse(I=0,e=this.length){e<0&&(e+=this.length),I<0&&(I+=this.length);let l=new t;if(e<I||e<0)return l;I<0&&(I=0),e>this.length&&(e=this.length);let c=this.length,n=this.tail;for(;n&&c>e;c--)n=n.prev;for(;n&&c>I;c--,n=n.prev)l.push(n.value);return l}splice(I,e=0,...l){I>this.length&&(I=this.length-1),I<0&&(I=this.length+I);let c=this.head;for(let a=0;c&&a<I;a++)c=c.next;let n=[];for(let a=0;c&&a<e;a++)n.push(c.value),c=this.removeNode(c);c?c!==this.tail&&(c=c.prev):c=this.tail;for(let a of l)c=nTI(this,c,a);return n}reverse(){let I=this.head,e=this.tail;for(let l=I;l;l=l.prev){let c=l.prev;l.prev=l.next,l.next=c}return this.head=e,this.tail=I,this}};function nTI(t,I,e){let l=I,c=I?I.next:t.head,n=new HE(e,l,c,t);return n.next===void 0&&(t.tail=n),n.prev===void 0&&(t.head=n),t.length++,n}function aTI(t,I){t.tail=new HE(I,t.tail,void 0,t),t.head||(t.head=t.tail),t.length++}function sTI(t,I){t.head=new HE(I,void 0,t.head,t),t.tail||(t.tail=t.head),t.length++}var HE=class{list;next;prev;value;constructor(I,e,l,c){this.list=c,this.value=I,e?(e.next=this,this.prev=e):this.prev=void 0,l?(l.prev=this,this.next=l):this.next=void 0}};G();import{posix as $y}from"node:path";G();var WhI=(t,I)=>{if(Number.isSafeInteger(t))t<0?GTI(t,I):rTI(t,I);else throw Error("cannot encode number outside of javascript safe integer range");return I},rTI=(t,I)=>{I[0]=128;for(var e=I.length;e>1;e--)I[e-1]=t&255,t=Math.floor(t/256)},GTI=(t,I)=>{I[0]=255;var e=!1;t=t*-1;for(var l=I.length;l>1;l--){var c=t&255;t=Math.floor(t/256),e?I[l-1]=YhI(c):c===0?I[l-1]=0:(e=!0,I[l-1]=VhI(c))}},NhI=t=>{let I=t[0],e=I===128?dTI(t.subarray(1,t.length)):I===255?oTI(t):null;if(e===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(e))throw Error("parsed number outside of javascript safe integer range");return e},oTI=t=>{for(var I=t.length,e=0,l=!1,c=I-1;c>-1;c--){var n=Number(t[c]),a;l?a=YhI(n):n===0?a=n:(l=!0,a=VhI(n)),a!==0&&(e-=a*Math.pow(256,I-c-1))}return e},dTI=t=>{for(var I=t.length,e=0,l=I-1;l>-1;l--){var c=Number(t[l]);c!==0&&(e+=c*Math.pow(256,I-l-1))}return e},YhI=t=>(255^t)&255,VhI=t=>(255^t)+1&255;G();var ex=t=>tx.has(t);var tx=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),RhI=new Map(Array.from(tx).map(t=>[t[1],t[0]]));var DG=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#I="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(I,e=0,l,c){Buffer.isBuffer(I)?this.decode(I,e||0,l,c):I&&this.#e(I)}decode(I,e,l,c){if(e||(e=0),!I||!(I.length>=e+512))throw new Error("need 512 bytes for header");this.path=dV(I,e,100),this.mode=Qu(I,e+100,8),this.uid=Qu(I,e+108,8),this.gid=Qu(I,e+116,8),this.size=Qu(I,e+124,12),this.mtime=x6(I,e+136,12),this.cksum=Qu(I,e+148,12),c&&this.#e(c,!0),l&&this.#e(l);let n=dV(I,e+156,1);if(ex(n)&&(this.#I=n||"0"),this.#I==="0"&&this.path.slice(-1)==="/"&&(this.#I="5"),this.#I==="5"&&(this.size=0),this.linkpath=dV(I,e+157,100),I.subarray(e+257,e+265).toString()==="ustar\x0000")if(this.uname=dV(I,e+265,32),this.gname=dV(I,e+297,32),this.devmaj=Qu(I,e+329,8)??0,this.devmin=Qu(I,e+337,8)??0,I[e+475]!==0){let s=dV(I,e+345,155);this.path=s+"/"+this.path}else{let s=dV(I,e+345,130);s&&(this.path=s+"/"+this.path),this.atime=x6(I,e+476,12),this.ctime=x6(I,e+488,12)}let a=256;for(let s=e;s<e+148;s++)a+=I[s];for(let s=e+156;s<e+512;s++)a+=I[s];this.cksumValid=a===this.cksum,this.cksum===void 0&&a===256&&(this.nullBlock=!0)}#e(I,e=!1){Object.assign(this,Object.fromEntries(Object.entries(I).filter(([l,c])=>!(c==null||l==="path"&&e||l==="linkpath"&&e||l==="global"))))}encode(I,e=0){if(I||(I=this.block=Buffer.alloc(512)),this.#I==="Unsupported"&&(this.#I="0"),!(I.length>=e+512))throw new Error("need 512 bytes for header");let l=this.ctime||this.atime?130:155,c=iTI(this.path||"",l),n=c[0],a=c[1];this.needPax=!!c[2],this.needPax=bV(I,e,100,n)||this.needPax,this.needPax=gu(I,e+100,8,this.mode)||this.needPax,this.needPax=gu(I,e+108,8,this.uid)||this.needPax,this.needPax=gu(I,e+116,8,this.gid)||this.needPax,this.needPax=gu(I,e+124,12,this.size)||this.needPax,this.needPax=B6(I,e+136,12,this.mtime)||this.needPax,I[e+156]=this.#I.charCodeAt(0),this.needPax=bV(I,e+157,100,this.linkpath)||this.needPax,I.write("ustar\x0000",e+257,8),this.needPax=bV(I,e+265,32,this.uname)||this.needPax,this.needPax=bV(I,e+297,32,this.gname)||this.needPax,this.needPax=gu(I,e+329,8,this.devmaj)||this.needPax,this.needPax=gu(I,e+337,8,this.devmin)||this.needPax,this.needPax=bV(I,e+345,l,a)||this.needPax,I[e+475]!==0?this.needPax=bV(I,e+345,155,a)||this.needPax:(this.needPax=bV(I,e+345,130,a)||this.needPax,this.needPax=B6(I,e+476,12,this.atime)||this.needPax,this.needPax=B6(I,e+488,12,this.ctime)||this.needPax);let s=256;for(let r=e;r<e+148;r++)s+=I[r];for(let r=e+156;r<e+512;r++)s+=I[r];return this.cksum=s,gu(I,e+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#I==="Unsupported"?this.#I:tx.get(this.#I)}get typeKey(){return this.#I}set type(I){let e=String(RhI.get(I));if(ex(e)||e==="Unsupported")this.#I=e;else if(ex(I))this.#I=I;else throw new TypeError("invalid entry type: "+I)}},iTI=(t,I)=>{let l=t,c="",n,a=$y.parse(t).root||".";if(Buffer.byteLength(l)<100)n=[l,c,!1];else{c=$y.dirname(l),l=$y.basename(l);do Buffer.byteLength(l)<=100&&Buffer.byteLength(c)<=I?n=[l,c,!1]:Buffer.byteLength(l)>100&&Buffer.byteLength(c)<=I?n=[l.slice(0,99),c,!0]:(l=$y.join($y.basename(c),l),c=$y.dirname(c));while(c!==a&&n===void 0);n||(n=[t.slice(0,99),"",!0])}return n},dV=(t,I,e)=>t.subarray(I,I+e).toString("utf8").replace(/\0.*/,""),x6=(t,I,e)=>mTI(Qu(t,I,e)),mTI=t=>t===void 0?void 0:new Date(t*1e3),Qu=(t,I,e)=>Number(t[I])&128?NhI(t.subarray(I,I+e)):ZTI(t,I,e),hTI=t=>isNaN(t)?void 0:t,ZTI=(t,I,e)=>hTI(parseInt(t.subarray(I,I+e).toString("utf8").replace(/\0.*$/,"").trim(),8)),pTI={12:8589934591,8:2097151},gu=(t,I,e,l)=>l===void 0?!1:l>pTI[e]||l<0?(WhI(l,t.subarray(I,I+e)),!0):(uTI(t,I,e,l),!1),uTI=(t,I,e,l)=>t.write(WTI(l,e),I,e,"ascii"),WTI=(t,I)=>NTI(Math.floor(t).toString(8),I),NTI=(t,I)=>(t.length===I-1?t:new Array(I-t.length-1).join("0")+t+" ")+"\0",B6=(t,I,e,l)=>l===void 0?!1:gu(t,I,e,l.getTime()/1e3),YTI=new Array(156).join("\0"),bV=(t,I,e,l)=>l===void 0?!1:(t.write(l+YTI,I,e,"utf8"),l.length!==Buffer.byteLength(l)||l.length>e);G();import{basename as VTI}from"node:path";var Au=class t{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(I,e=!1){this.atime=I.atime,this.charset=I.charset,this.comment=I.comment,this.ctime=I.ctime,this.dev=I.dev,this.gid=I.gid,this.global=e,this.gname=I.gname,this.ino=I.ino,this.linkpath=I.linkpath,this.mtime=I.mtime,this.nlink=I.nlink,this.path=I.path,this.size=I.size,this.uid=I.uid,this.uname=I.uname}encode(){let I=this.encodeBody();if(I==="")return Buffer.allocUnsafe(0);let e=Buffer.byteLength(I),l=512*Math.ceil(1+e/512),c=Buffer.allocUnsafe(l);for(let n=0;n<512;n++)c[n]=0;new DG({path:("PaxHeader/"+VTI(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:e,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(c),c.write(I,512,e,"utf8");for(let n=e+512;n<c.length;n++)c[n]=0;return c}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(I){if(this[I]===void 0)return"";let e=this[I],l=e instanceof Date?e.getTime()/1e3:e,c=" "+(I==="dev"||I==="ino"||I==="nlink"?"SCHILY.":"")+I+"="+l+`
130
130
  `,n=Buffer.byteLength(c),a=Math.floor(Math.log(n)/Math.log(10))+1;return n+a>=Math.pow(10,a)&&(a+=1),a+n+c}static parse(I,e,l=!1){return new t(RTI(yTI(I),e),l)}},RTI=(t,I)=>I?Object.assign({},I,t):t,yTI=t=>t.replace(/\n$/,"").split(`
@@ -842,7 +842,7 @@ ${l.content}
842
842
  Additional instructions from user's \`${l.additionalInstructions.sourcePath}\`:
843
843
  ${l.additionalInstructions.content}
844
844
  `)),a+=I.parallel_tool_calls?`<tool_calling>
845
- ${F9I(I)}
845
+ ${F9I()}
846
846
  </tool_calling>`:"",a};var R9I=async(t,I,e,l={},c={},n={})=>{let a=await pGI(t,!0),s=V9I.type(),r=t===""?"":ZGI(t),o=(await Promise.all(["git","curl","gh"].map(async b=>await Y9I(b)!==null?b:null))).filter(b=>b!==null).join(", ");return`
847
847
  You are the GitHub Copilot CLI, a terminal based coding agent built by GitHub.
848
848
 
@@ -917,7 +917,19 @@ You *must* avoid doing any of these things you cannot or must not do, and also *
917
917
  * When replying to the user, offer crisp, concise responses.
918
918
  </tips_and_tricks>
919
919
 
920
- ${SHe(l,c,n,a)}`.trim()};var y9I=t=>`Here is the url of a screenshot: ${t}. You can use it to include in the PR description if it is suitable for the task.`,F9I=t=>t.parallel_tool_calls?"You have the capability to call multiple tools in a single response. For maximum efficiency, whenever you need to perform multiple independent operations, ALWAYS invoke all relevant tools simultaneously rather than sequentially. Especially when exploring repository, reading files, viewing directories, validating changes or replying to comments.":"",OHe=(t={})=>t.splitEditingTools?`<str_replace>
920
+ <avoid_excessive_markdown_and_bullet_points>
921
+ When communicating to the user, explaining in between tool calls or summarizing your progress, use concise, clear, flowing prose with complete paragraphs and sentences.
922
+ Avoid using bullet points, numbered lists, or excessive markdown formatting unless the user explicitly requests a list or ranking.
923
+ Instead of listing items, incorporate them naturally into sentences.
924
+ Use standard paragraph breaks for organization and reserve markdown primarily for code blocks and simple sentence case headings.
925
+
926
+ There is an important exception: lists are appropriate when the user specifically asks for a list or ranking, or when presenting truly discret items where a list format is the best option.
927
+ When in doubt, choose prose over bullets. NEVER output a series of overly short bullet points.
928
+ </avoid_excessive_markdown_and_bullet_points>
929
+
930
+ ${SHe(l,c,n,a)}`.trim()};var y9I=t=>`Here is the url of a screenshot: ${t}. You can use it to include in the PR description if it is suitable for the task.`,F9I=()=>`You have the capability to call multiple tools in a single response. For maximum efficiency, whenever you need to perform multiple independent operations, ALWAYS call tools simultaneously whenever the actions can be done in parallel rather than sequentially.
931
+ Especially when exploring repository, searching, reading files, viewing directories, validating changes, reporting progress or replying to comments. For Example you can read 3 different files parallelly, or report progress and edit different files in parallel. Always report progress in parallel with other tool calls that follow it as it does not depend on the result of those calls.
932
+ However, if some tool calls depend on previous calls to inform dependent values like the parameters, do NOT call these tools in parallel and instead call them sequentially.`,OHe=(t={})=>t.splitEditingTools?`<str_replace>
921
933
  You can use the **str_replace** tool to batch edits to the same file in a single response. The tool will apply edits in sequential order, removing the risk of a reader/writer conflict.
922
934
  <example>
923
935
  If renaming a variable in multiple places, call **str_replace** multiple times in the same response, once for each instance of the variable name.
@@ -953,7 +965,7 @@ old_str: "console.log("duration was \${elapsedTimeMs}ms"
953
965
  </str_replace>`:"",Q9I=(t,I={})=>{let e=t;return I.parallel_tool_calls&&(e+=`
954
966
 
955
967
  <reminder>
956
- ${F9I(I)}
968
+ ${F9I()}
957
969
  </reminder>`),I.vision&&(e+=`
958
970
 
959
971
  <reminder>
@@ -1116,7 +1128,7 @@ Answer:
1116
1128
  This tool is used to perform a semantic search of the codebase to find relevant information based on the question asked.
1117
1129
  * It leverages advanced AI techniques to understand the context and semantics of the codebase.
1118
1130
  * Use this tool when you need to find information that is not easily accessible through traditional search methods.
1119
- `,input_schema:{type:"object",properties:{question:{type:"string",description:"A question about the codebase. It should reference by name any topics, specific file names, and concepts that are relevant to the question and specify the desired output format."}},required:["question"]},callback:async l=>{let c,n=wf(t),a="",s="",r=n.split("/");if(r.length===2){[a,s]=r,e.info("Searching for repository insights");try{c=await KGI(l.question,a,s,I,e),e.info(`Blackbird results: ${c}`)}catch(o){e.error(`Error occurred while searching for repository insights: ${o}`)}}return{resultType:"success",textResultForLlm:c??"No results found.",toolTelemetry:{}}}}}async function B9I(t,I,e,l,c,n,a){let s=await O9I(t),r={cwd:s.shellTool.cwd,...t},o=await FEe(r,e,l),d=f9I(e)?[new BD(l,e,c,n,t,t.location,qz(),a).getSearch()]:[],b=t.splitEditingTools?R$(r,l,e):[eU(r,l,e)];return[s.shellTool,...s.otherTools??[],...o,...d,...b,fRI(r,I,e,l,c),ql(e,Hf)?wmI(r,l,c,e):void 0,t?.requireReasoning?y$(r):void 0,ql(e,HRI)?ERI:void 0,await QEe(t,e,l,c)].filter(h=>h!==void 0)}async function z9I(t,I){let e=await O9I(t),l={cwd:e.shellTool.cwd,...t},c=t.splitEditingTools?R$(l,I):[eU(l,I)];return[e.shellTool,...e.otherTools??[],...c,t?.requireReasoning?y$(l):void 0].filter(n=>n!==void 0)}async function yEe(t,I,e,l,c,n,a){return[...await B9I(t,I,e,l,c,n,a),CRI(t,l)]}var U9I=t=>({...Qh,supports:{...Qh.supports,reasoning:t?.thinkingMode?!0:Qh.supports?.reasoning}}),Qh={supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!1},createPR:{toolInit:B9I,jitInstructions:jGI},prDetails:{},respondToPRComment:{toolInit:yEe,jitInstructions:jGI}},S9I=t=>({"sweagent-capi":{"claude-3.5-sonnet":{...Qh,supports:{tool_choice:!1,reasoning:!1}},"claude-3.7-sonnet":{...Qh,supports:{tool_choice:!1,reasoning:!1,vision:!0}},"claude-sonnet-4":{...Qh,supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!0,vision:!0},toolConfigOverrides:{splitEditingTools:!0}},"claude-sonnet-4.5":{...Qh,supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!0,vision:!0},toolConfigOverrides:{splitEditingTools:!0}},oswe:{...Qh,supports:{tool_choice:!0,reasoning:!0,vision:!0}},"oswe-prime":{...Qh,supports:{tool_choice:!0,reasoning:!0,vision:!0}},"gpt-5":{...Qh,supports:{tool_choice:!0,reasoning:!0,parallel_tool_calls:!0,vision:!0,steering:!0}}}});async function O9I(t){let I=new OT(t);return{shellTool:I.getShellTool(),otherTools:[I.getWriteShellTool(),I.getReadShellTool(),I.getStopShellTool()]}}async function FEe(t,I,e){if(YsI(I,"cloud"))return[new l4(new uj(I,e)).getStoreMemory()];if(YsI(I,"local")){let l=new l4(new pj(t.location));return[l.getStoreMemory(),l.getReadMemory()]}return[]}async function QEe(t,I,e,l){if(t.includeCodeQLTool){let c=new Mr(e,l),n=await c.getCurrentCommitHash(t.location);return new Dz(t,c,n,I,e).getCodeQLCheckerTool()}}G();G();import{Writable as T3e}from"stream";G();G();G();G();G();var R={};da(R,{BRAND:()=>_Ee,DIRTY:()=>M0,EMPTY_PATH:()=>wEe,INVALID:()=>ye,NEVER:()=>F1e,OK:()=>zs,ParseStatus:()=>Gs,Schema:()=>mt,ZodAny:()=>CY,ZodArray:()=>nu,ZodBigInt:()=>j0,ZodBoolean:()=>D0,ZodBranded:()=>e9,ZodCatch:()=>ny,ZodDate:()=>K0,ZodDefault:()=>cy,ZodDiscriminatedUnion:()=>SD,ZodEffects:()=>Kd,ZodEnum:()=>ty,ZodError:()=>LG,ZodFirstPartyTypeKind:()=>ge,ZodFunction:()=>MD,ZodIntersection:()=>$0,ZodIssueCode:()=>YI,ZodLazy:()=>Iy,ZodLiteral:()=>ey,ZodMap:()=>XH,ZodNaN:()=>HH,ZodNativeEnum:()=>ly,ZodNever:()=>mi,ZodNull:()=>q0,ZodNullable:()=>Xh,ZodNumber:()=>T0,ZodObject:()=>kG,ZodOptional:()=>jd,ZodParsedType:()=>jI,ZodPipeline:()=>t9,ZodPromise:()=>JY,ZodReadonly:()=>ay,ZodRecord:()=>OD,ZodSchema:()=>mt,ZodSet:()=>wH,ZodString:()=>vY,ZodSymbol:()=>gH,ZodTransformer:()=>Kd,ZodTuple:()=>Ah,ZodType:()=>mt,ZodUndefined:()=>P0,ZodUnion:()=>_0,ZodUnknown:()=>cu,ZodVoid:()=>AH,addIssueToContext:()=>xI,any:()=>eoI,array:()=>Us,bigint:()=>t1e,boolean:()=>fa,coerce:()=>l9,custom:()=>_9I,date:()=>l1e,datetimeRegex:()=>P9I,defaultErrorMap:()=>tu,discriminatedUnion:()=>loI,effect:()=>p1e,enum:()=>au,function:()=>i1e,getErrorMap:()=>yH,getParsedType:()=>gh,instanceof:()=>I1e,intersection:()=>o1e,isAborted:()=>zD,isAsync:()=>FH,isDirty:()=>UD,isValid:()=>EY,late:()=>$Ee,lazy:()=>m1e,literal:()=>sl,makeIssue:()=>I9,map:()=>d1e,nan:()=>e1e,nativeEnum:()=>h1e,never:()=>s1e,null:()=>a1e,nullable:()=>W1e,number:()=>wh,object:()=>Ae,objectUtil:()=>_GI,oboolean:()=>y1e,onumber:()=>R1e,optional:()=>u1e,ostring:()=>V1e,pipeline:()=>Y1e,preprocess:()=>N1e,promise:()=>Z1e,quotelessJson:()=>gEe,record:()=>TD,set:()=>b1e,setErrorMap:()=>XEe,strictObject:()=>G1e,string:()=>vI,symbol:()=>c1e,transformer:()=>p1e,tuple:()=>coI,undefined:()=>n1e,union:()=>Ss,unknown:()=>toI,util:()=>ft,void:()=>r1e});G();G();G();G();G();var ft;(function(t){t.assertEqual=c=>{};function I(c){}t.assertIs=I;function e(c){throw new Error}t.assertNever=e,t.arrayToEnum=c=>{let n={};for(let a of c)n[a]=a;return n},t.getValidEnumValues=c=>{let n=t.objectKeys(c).filter(s=>typeof c[c[s]]!="number"),a={};for(let s of n)a[s]=c[s];return t.objectValues(a)},t.objectValues=c=>t.objectKeys(c).map(function(n){return c[n]}),t.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{let n=[];for(let a in c)Object.prototype.hasOwnProperty.call(c,a)&&n.push(a);return n},t.find=(c,n)=>{for(let a of c)if(n(a))return a},t.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&Number.isFinite(c)&&Math.floor(c)===c;function l(c,n=" | "){return c.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}t.joinValues=l,t.jsonStringifyReplacer=(c,n)=>typeof n=="bigint"?n.toString():n})(ft||(ft={}));var _GI;(function(t){t.mergeShapes=(I,e)=>({...I,...e})})(_GI||(_GI={}));var jI=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gh=t=>{switch(typeof t){case"undefined":return jI.undefined;case"string":return jI.string;case"number":return Number.isNaN(t)?jI.nan:jI.number;case"boolean":return jI.boolean;case"function":return jI.function;case"bigint":return jI.bigint;case"symbol":return jI.symbol;case"object":return Array.isArray(t)?jI.array:t===null?jI.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?jI.promise:typeof Map<"u"&&t instanceof Map?jI.map:typeof Set<"u"&&t instanceof Set?jI.set:typeof Date<"u"&&t instanceof Date?jI.date:jI.object;default:return jI.unknown}};var YI=ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gEe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),LG=class t extends Error{get errors(){return this.issues}constructor(I){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=I}format(I){let e=I||function(n){return n.message},l={_errors:[]},c=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(c);else if(a.code==="invalid_return_type")c(a.returnTypeError);else if(a.code==="invalid_arguments")c(a.argumentsError);else if(a.path.length===0)l._errors.push(e(a));else{let s=l,r=0;for(;r<a.path.length;){let o=a.path[r];r===a.path.length-1?(s[o]=s[o]||{_errors:[]},s[o]._errors.push(e(a))):s[o]=s[o]||{_errors:[]},s=s[o],r++}}};return c(this),l}static assert(I){if(!(I instanceof t))throw new Error(`Not a ZodError: ${I}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ft.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(I=e=>e.message){let e={},l=[];for(let c of this.issues)if(c.path.length>0){let n=c.path[0];e[n]=e[n]||[],e[n].push(I(c))}else l.push(I(c));return{formErrors:l,fieldErrors:e}}get formErrors(){return this.flatten()}};LG.create=t=>new LG(t);var AEe=(t,I)=>{let e;switch(t.code){case YI.invalid_type:t.received===jI.undefined?e="Required":e=`Expected ${t.expected}, received ${t.received}`;break;case YI.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(t.expected,ft.jsonStringifyReplacer)}`;break;case YI.unrecognized_keys:e=`Unrecognized key(s) in object: ${ft.joinValues(t.keys,", ")}`;break;case YI.invalid_union:e="Invalid input";break;case YI.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${ft.joinValues(t.options)}`;break;case YI.invalid_enum_value:e=`Invalid enum value. Expected ${ft.joinValues(t.options)}, received '${t.received}'`;break;case YI.invalid_arguments:e="Invalid function arguments";break;case YI.invalid_return_type:e="Invalid function return type";break;case YI.invalid_date:e="Invalid date";break;case YI.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(e=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?e=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?e=`Invalid input: must end with "${t.validation.endsWith}"`:ft.assertNever(t.validation):t.validation!=="regex"?e=`Invalid ${t.validation}`:e="Invalid";break;case YI.too_small:t.type==="array"?e=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?e=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?e=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?e=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?e=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:e="Invalid input";break;case YI.too_big:t.type==="array"?e=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?e=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?e=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?e=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?e=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:e="Invalid input";break;case YI.custom:e="Invalid input";break;case YI.invalid_intersection_types:e="Intersection results could not be merged";break;case YI.not_multiple_of:e=`Number must be a multiple of ${t.multipleOf}`;break;case YI.not_finite:e="Number must be finite";break;default:e=I.defaultError,ft.assertNever(t)}return{message:e}},tu=AEe;var M9I=tu;function XEe(t){M9I=t}function yH(){return M9I}G();var I9=t=>{let{data:I,path:e,errorMaps:l,issueData:c}=t,n=[...e,...c.path||[]],a={...c,path:n};if(c.message!==void 0)return{...c,path:n,message:c.message};let s="",r=l.filter(o=>!!o).slice().reverse();for(let o of r)s=o(a,{data:I,defaultError:s}).message;return{...c,path:n,message:s}},wEe=[];function xI(t,I){let e=yH(),l=I9({issueData:I,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,e,e===tu?void 0:tu].filter(c=>!!c)});t.common.issues.push(l)}var Gs=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(I,e){let l=[];for(let c of e){if(c.status==="aborted")return ye;c.status==="dirty"&&I.dirty(),l.push(c.value)}return{status:I.value,value:l}}static async mergeObjectAsync(I,e){let l=[];for(let c of e){let n=await c.key,a=await c.value;l.push({key:n,value:a})}return t.mergeObjectSync(I,l)}static mergeObjectSync(I,e){let l={};for(let c of e){let{key:n,value:a}=c;if(n.status==="aborted"||a.status==="aborted")return ye;n.status==="dirty"&&I.dirty(),a.status==="dirty"&&I.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||c.alwaysSet)&&(l[n.value]=a.value)}return{status:I.value,value:l}}},ye=Object.freeze({status:"aborted"}),M0=t=>({status:"dirty",value:t}),zs=t=>({status:"valid",value:t}),zD=t=>t.status==="aborted",UD=t=>t.status==="dirty",EY=t=>t.status==="valid",FH=t=>typeof Promise<"u"&&t instanceof Promise;G();G();var ae;(function(t){t.errToObj=I=>typeof I=="string"?{message:I}:I||{},t.toString=I=>typeof I=="string"?I:I?.message})(ae||(ae={}));var Dd=class{constructor(I,e,l,c){this._cachedPath=[],this.parent=I,this.data=e,this._path=l,this._key=c}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},T9I=(t,I)=>{if(EY(I))return{success:!0,data:I.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new LG(t.common.issues);return this._error=e,this._error}}};function nt(t){if(!t)return{};let{errorMap:I,invalid_type_error:e,required_error:l,description:c}=t;if(I&&(e||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return I?{errorMap:I,description:c}:{errorMap:(a,s)=>{let{message:r}=t;return a.code==="invalid_enum_value"?{message:r??s.defaultError}:typeof s.data>"u"?{message:r??l??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:r??e??s.defaultError}},description:c}}var mt=class{get description(){return this._def.description}_getType(I){return gh(I.data)}_getOrReturnCtx(I,e){return e||{common:I.parent.common,data:I.data,parsedType:gh(I.data),schemaErrorMap:this._def.errorMap,path:I.path,parent:I.parent}}_processInputParams(I){return{status:new Gs,ctx:{common:I.parent.common,data:I.data,parsedType:gh(I.data),schemaErrorMap:this._def.errorMap,path:I.path,parent:I.parent}}}_parseSync(I){let e=this._parse(I);if(FH(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(I){let e=this._parse(I);return Promise.resolve(e)}parse(I,e){let l=this.safeParse(I,e);if(l.success)return l.data;throw l.error}safeParse(I,e){let l={common:{issues:[],async:e?.async??!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:I,parsedType:gh(I)},c=this._parseSync({data:I,path:l.path,parent:l});return T9I(l,c)}"~validate"(I){let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:I,parsedType:gh(I)};if(!this["~standard"].async)try{let l=this._parseSync({data:I,path:[],parent:e});return EY(l)?{value:l.value}:{issues:e.common.issues}}catch(l){l?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:I,path:[],parent:e}).then(l=>EY(l)?{value:l.value}:{issues:e.common.issues})}async parseAsync(I,e){let l=await this.safeParseAsync(I,e);if(l.success)return l.data;throw l.error}async safeParseAsync(I,e){let l={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:I,parsedType:gh(I)},c=this._parse({data:I,path:l.path,parent:l}),n=await(FH(c)?c:Promise.resolve(c));return T9I(l,n)}refine(I,e){let l=c=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(c):e;return this._refinement((c,n)=>{let a=I(c),s=()=>n.addIssue({code:YI.custom,...l(c)});return typeof Promise<"u"&&a instanceof Promise?a.then(r=>r?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(I,e){return this._refinement((l,c)=>I(l)?!0:(c.addIssue(typeof e=="function"?e(l,c):e),!1))}_refinement(I){return new Kd({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:I}})}superRefine(I){return this._refinement(I)}constructor(I){this.spa=this.safeParseAsync,this._def=I,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return jd.create(this,this._def)}nullable(){return Xh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nu.create(this)}promise(){return JY.create(this,this._def)}or(I){return _0.create([this,I],this._def)}and(I){return $0.create(this,I,this._def)}transform(I){return new Kd({...nt(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:I}})}default(I){let e=typeof I=="function"?I:()=>I;return new cy({...nt(this._def),innerType:this,defaultValue:e,typeName:ge.ZodDefault})}brand(){return new e9({typeName:ge.ZodBranded,type:this,...nt(this._def)})}catch(I){let e=typeof I=="function"?I:()=>I;return new ny({...nt(this._def),innerType:this,catchValue:e,typeName:ge.ZodCatch})}describe(I){let e=this.constructor;return new e({...this._def,description:I})}pipe(I){return t9.create(this,I)}readonly(){return ay.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},HEe=/^c[^\s-]{8,}$/i,EEe=/^[0-9a-z]+$/,vEe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,CEe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,JEe=/^[a-z0-9_-]{21}$/i,LEe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,kEe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fEe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xEe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$GI,BEe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zEe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,UEe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,SEe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OEe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MEe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,D9I="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",TEe=new RegExp(`^${D9I}$`);function K9I(t){let I="[0-5]\\d";t.precision?I=`${I}\\.\\d{${t.precision}}`:t.precision==null&&(I=`${I}(\\.\\d+)?`);let e=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${I})${e}`}function jEe(t){return new RegExp(`^${K9I(t)}$`)}function P9I(t){let I=`${D9I}T${K9I(t)}`,e=[];return e.push(t.local?"Z?":"Z"),t.offset&&e.push("([+-]\\d{2}:?\\d{2})"),I=`${I}(${e.join("|")})`,new RegExp(`^${I}$`)}function DEe(t,I){return!!((I==="v4"||!I)&&BEe.test(t)||(I==="v6"||!I)&&UEe.test(t))}function KEe(t,I){if(!LEe.test(t))return!1;try{let[e]=t.split(".");if(!e)return!1;let l=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),c=JSON.parse(atob(l));return!(typeof c!="object"||c===null||"typ"in c&&c?.typ!=="JWT"||!c.alg||I&&c.alg!==I)}catch{return!1}}function PEe(t,I){return!!((I==="v4"||!I)&&zEe.test(t)||(I==="v6"||!I)&&SEe.test(t))}var vY=class t extends mt{_parse(I){if(this._def.coerce&&(I.data=String(I.data)),this._getType(I)!==jI.string){let n=this._getOrReturnCtx(I);return xI(n,{code:YI.invalid_type,expected:jI.string,received:n.parsedType}),ye}let l=new Gs,c;for(let n of this._def.checks)if(n.kind==="min")I.data.length<n.value&&(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),l.dirty());else if(n.kind==="max")I.data.length>n.value&&(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),l.dirty());else if(n.kind==="length"){let a=I.data.length>n.value,s=I.data.length<n.value;(a||s)&&(c=this._getOrReturnCtx(I,c),a?xI(c,{code:YI.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&xI(c,{code:YI.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),l.dirty())}else if(n.kind==="email")fEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"email",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="emoji")$GI||($GI=new RegExp(xEe,"u")),$GI.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"emoji",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="uuid")CEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"uuid",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="nanoid")JEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"nanoid",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="cuid")HEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"cuid",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="cuid2")EEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"cuid2",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="ulid")vEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"ulid",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="url")try{new URL(I.data)}catch{c=this._getOrReturnCtx(I,c),xI(c,{validation:"url",code:YI.invalid_string,message:n.message}),l.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"regex",code:YI.invalid_string,message:n.message}),l.dirty())):n.kind==="trim"?I.data=I.data.trim():n.kind==="includes"?I.data.includes(n.value,n.position)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),l.dirty()):n.kind==="toLowerCase"?I.data=I.data.toLowerCase():n.kind==="toUpperCase"?I.data=I.data.toUpperCase():n.kind==="startsWith"?I.data.startsWith(n.value)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:{startsWith:n.value},message:n.message}),l.dirty()):n.kind==="endsWith"?I.data.endsWith(n.value)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:{endsWith:n.value},message:n.message}),l.dirty()):n.kind==="datetime"?P9I(n).test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:"datetime",message:n.message}),l.dirty()):n.kind==="date"?TEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:"date",message:n.message}),l.dirty()):n.kind==="time"?jEe(n).test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:"time",message:n.message}),l.dirty()):n.kind==="duration"?kEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"duration",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="ip"?DEe(I.data,n.version)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"ip",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="jwt"?KEe(I.data,n.alg)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"jwt",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="cidr"?PEe(I.data,n.version)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"cidr",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="base64"?OEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"base64",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="base64url"?MEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"base64url",code:YI.invalid_string,message:n.message}),l.dirty()):ft.assertNever(n);return{status:l.value,value:I.data}}_regex(I,e,l){return this.refinement(c=>I.test(c),{validation:e,code:YI.invalid_string,...ae.errToObj(l)})}_addCheck(I){return new t({...this._def,checks:[...this._def.checks,I]})}email(I){return this._addCheck({kind:"email",...ae.errToObj(I)})}url(I){return this._addCheck({kind:"url",...ae.errToObj(I)})}emoji(I){return this._addCheck({kind:"emoji",...ae.errToObj(I)})}uuid(I){return this._addCheck({kind:"uuid",...ae.errToObj(I)})}nanoid(I){return this._addCheck({kind:"nanoid",...ae.errToObj(I)})}cuid(I){return this._addCheck({kind:"cuid",...ae.errToObj(I)})}cuid2(I){return this._addCheck({kind:"cuid2",...ae.errToObj(I)})}ulid(I){return this._addCheck({kind:"ulid",...ae.errToObj(I)})}base64(I){return this._addCheck({kind:"base64",...ae.errToObj(I)})}base64url(I){return this._addCheck({kind:"base64url",...ae.errToObj(I)})}jwt(I){return this._addCheck({kind:"jwt",...ae.errToObj(I)})}ip(I){return this._addCheck({kind:"ip",...ae.errToObj(I)})}cidr(I){return this._addCheck({kind:"cidr",...ae.errToObj(I)})}datetime(I){return typeof I=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:I}):this._addCheck({kind:"datetime",precision:typeof I?.precision>"u"?null:I?.precision,offset:I?.offset??!1,local:I?.local??!1,...ae.errToObj(I?.message)})}date(I){return this._addCheck({kind:"date",message:I})}time(I){return typeof I=="string"?this._addCheck({kind:"time",precision:null,message:I}):this._addCheck({kind:"time",precision:typeof I?.precision>"u"?null:I?.precision,...ae.errToObj(I?.message)})}duration(I){return this._addCheck({kind:"duration",...ae.errToObj(I)})}regex(I,e){return this._addCheck({kind:"regex",regex:I,...ae.errToObj(e)})}includes(I,e){return this._addCheck({kind:"includes",value:I,position:e?.position,...ae.errToObj(e?.message)})}startsWith(I,e){return this._addCheck({kind:"startsWith",value:I,...ae.errToObj(e)})}endsWith(I,e){return this._addCheck({kind:"endsWith",value:I,...ae.errToObj(e)})}min(I,e){return this._addCheck({kind:"min",value:I,...ae.errToObj(e)})}max(I,e){return this._addCheck({kind:"max",value:I,...ae.errToObj(e)})}length(I,e){return this._addCheck({kind:"length",value:I,...ae.errToObj(e)})}nonempty(I){return this.min(1,ae.errToObj(I))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(I=>I.kind==="datetime")}get isDate(){return!!this._def.checks.find(I=>I.kind==="date")}get isTime(){return!!this._def.checks.find(I=>I.kind==="time")}get isDuration(){return!!this._def.checks.find(I=>I.kind==="duration")}get isEmail(){return!!this._def.checks.find(I=>I.kind==="email")}get isURL(){return!!this._def.checks.find(I=>I.kind==="url")}get isEmoji(){return!!this._def.checks.find(I=>I.kind==="emoji")}get isUUID(){return!!this._def.checks.find(I=>I.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(I=>I.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(I=>I.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(I=>I.kind==="cuid2")}get isULID(){return!!this._def.checks.find(I=>I.kind==="ulid")}get isIP(){return!!this._def.checks.find(I=>I.kind==="ip")}get isCIDR(){return!!this._def.checks.find(I=>I.kind==="cidr")}get isBase64(){return!!this._def.checks.find(I=>I.kind==="base64")}get isBase64url(){return!!this._def.checks.find(I=>I.kind==="base64url")}get minLength(){let I=null;for(let e of this._def.checks)e.kind==="min"&&(I===null||e.value>I)&&(I=e.value);return I}get maxLength(){let I=null;for(let e of this._def.checks)e.kind==="max"&&(I===null||e.value<I)&&(I=e.value);return I}};vY.create=t=>new vY({checks:[],typeName:ge.ZodString,coerce:t?.coerce??!1,...nt(t)});function qEe(t,I){let e=(t.toString().split(".")[1]||"").length,l=(I.toString().split(".")[1]||"").length,c=e>l?e:l,n=Number.parseInt(t.toFixed(c).replace(".","")),a=Number.parseInt(I.toFixed(c).replace(".",""));return n%a/10**c}var T0=class t extends mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(I){if(this._def.coerce&&(I.data=Number(I.data)),this._getType(I)!==jI.number){let n=this._getOrReturnCtx(I);return xI(n,{code:YI.invalid_type,expected:jI.number,received:n.parsedType}),ye}let l,c=new Gs;for(let n of this._def.checks)n.kind==="int"?ft.isInteger(I.data)||(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.invalid_type,expected:"integer",received:"float",message:n.message}),c.dirty()):n.kind==="min"?(n.inclusive?I.data<n.value:I.data<=n.value)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),c.dirty()):n.kind==="max"?(n.inclusive?I.data>n.value:I.data>=n.value)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),c.dirty()):n.kind==="multipleOf"?qEe(I.data,n.value)!==0&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.not_multiple_of,multipleOf:n.value,message:n.message}),c.dirty()):n.kind==="finite"?Number.isFinite(I.data)||(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.not_finite,message:n.message}),c.dirty()):ft.assertNever(n);return{status:c.value,value:I.data}}gte(I,e){return this.setLimit("min",I,!0,ae.toString(e))}gt(I,e){return this.setLimit("min",I,!1,ae.toString(e))}lte(I,e){return this.setLimit("max",I,!0,ae.toString(e))}lt(I,e){return this.setLimit("max",I,!1,ae.toString(e))}setLimit(I,e,l,c){return new t({...this._def,checks:[...this._def.checks,{kind:I,value:e,inclusive:l,message:ae.toString(c)}]})}_addCheck(I){return new t({...this._def,checks:[...this._def.checks,I]})}int(I){return this._addCheck({kind:"int",message:ae.toString(I)})}positive(I){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ae.toString(I)})}negative(I){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ae.toString(I)})}nonpositive(I){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ae.toString(I)})}nonnegative(I){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ae.toString(I)})}multipleOf(I,e){return this._addCheck({kind:"multipleOf",value:I,message:ae.toString(e)})}finite(I){return this._addCheck({kind:"finite",message:ae.toString(I)})}safe(I){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ae.toString(I)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ae.toString(I)})}get minValue(){let I=null;for(let e of this._def.checks)e.kind==="min"&&(I===null||e.value>I)&&(I=e.value);return I}get maxValue(){let I=null;for(let e of this._def.checks)e.kind==="max"&&(I===null||e.value<I)&&(I=e.value);return I}get isInt(){return!!this._def.checks.find(I=>I.kind==="int"||I.kind==="multipleOf"&&ft.isInteger(I.value))}get isFinite(){let I=null,e=null;for(let l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(e===null||l.value>e)&&(e=l.value):l.kind==="max"&&(I===null||l.value<I)&&(I=l.value)}return Number.isFinite(e)&&Number.isFinite(I)}};T0.create=t=>new T0({checks:[],typeName:ge.ZodNumber,coerce:t?.coerce||!1,...nt(t)});var j0=class t extends mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(I){if(this._def.coerce)try{I.data=BigInt(I.data)}catch{return this._getInvalidInput(I)}if(this._getType(I)!==jI.bigint)return this._getInvalidInput(I);let l,c=new Gs;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?I.data<n.value:I.data<=n.value)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),c.dirty()):n.kind==="max"?(n.inclusive?I.data>n.value:I.data>=n.value)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),c.dirty()):n.kind==="multipleOf"?I.data%n.value!==BigInt(0)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.not_multiple_of,multipleOf:n.value,message:n.message}),c.dirty()):ft.assertNever(n);return{status:c.value,value:I.data}}_getInvalidInput(I){let e=this._getOrReturnCtx(I);return xI(e,{code:YI.invalid_type,expected:jI.bigint,received:e.parsedType}),ye}gte(I,e){return this.setLimit("min",I,!0,ae.toString(e))}gt(I,e){return this.setLimit("min",I,!1,ae.toString(e))}lte(I,e){return this.setLimit("max",I,!0,ae.toString(e))}lt(I,e){return this.setLimit("max",I,!1,ae.toString(e))}setLimit(I,e,l,c){return new t({...this._def,checks:[...this._def.checks,{kind:I,value:e,inclusive:l,message:ae.toString(c)}]})}_addCheck(I){return new t({...this._def,checks:[...this._def.checks,I]})}positive(I){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ae.toString(I)})}negative(I){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ae.toString(I)})}nonpositive(I){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ae.toString(I)})}nonnegative(I){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ae.toString(I)})}multipleOf(I,e){return this._addCheck({kind:"multipleOf",value:I,message:ae.toString(e)})}get minValue(){let I=null;for(let e of this._def.checks)e.kind==="min"&&(I===null||e.value>I)&&(I=e.value);return I}get maxValue(){let I=null;for(let e of this._def.checks)e.kind==="max"&&(I===null||e.value<I)&&(I=e.value);return I}};j0.create=t=>new j0({checks:[],typeName:ge.ZodBigInt,coerce:t?.coerce??!1,...nt(t)});var D0=class extends mt{_parse(I){if(this._def.coerce&&(I.data=!!I.data),this._getType(I)!==jI.boolean){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.boolean,received:l.parsedType}),ye}return zs(I.data)}};D0.create=t=>new D0({typeName:ge.ZodBoolean,coerce:t?.coerce||!1,...nt(t)});var K0=class t extends mt{_parse(I){if(this._def.coerce&&(I.data=new Date(I.data)),this._getType(I)!==jI.date){let n=this._getOrReturnCtx(I);return xI(n,{code:YI.invalid_type,expected:jI.date,received:n.parsedType}),ye}if(Number.isNaN(I.data.getTime())){let n=this._getOrReturnCtx(I);return xI(n,{code:YI.invalid_date}),ye}let l=new Gs,c;for(let n of this._def.checks)n.kind==="min"?I.data.getTime()<n.value&&(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),l.dirty()):n.kind==="max"?I.data.getTime()>n.value&&(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),l.dirty()):ft.assertNever(n);return{status:l.value,value:new Date(I.data.getTime())}}_addCheck(I){return new t({...this._def,checks:[...this._def.checks,I]})}min(I,e){return this._addCheck({kind:"min",value:I.getTime(),message:ae.toString(e)})}max(I,e){return this._addCheck({kind:"max",value:I.getTime(),message:ae.toString(e)})}get minDate(){let I=null;for(let e of this._def.checks)e.kind==="min"&&(I===null||e.value>I)&&(I=e.value);return I!=null?new Date(I):null}get maxDate(){let I=null;for(let e of this._def.checks)e.kind==="max"&&(I===null||e.value<I)&&(I=e.value);return I!=null?new Date(I):null}};K0.create=t=>new K0({checks:[],coerce:t?.coerce||!1,typeName:ge.ZodDate,...nt(t)});var gH=class extends mt{_parse(I){if(this._getType(I)!==jI.symbol){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.symbol,received:l.parsedType}),ye}return zs(I.data)}};gH.create=t=>new gH({typeName:ge.ZodSymbol,...nt(t)});var P0=class extends mt{_parse(I){if(this._getType(I)!==jI.undefined){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.undefined,received:l.parsedType}),ye}return zs(I.data)}};P0.create=t=>new P0({typeName:ge.ZodUndefined,...nt(t)});var q0=class extends mt{_parse(I){if(this._getType(I)!==jI.null){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.null,received:l.parsedType}),ye}return zs(I.data)}};q0.create=t=>new q0({typeName:ge.ZodNull,...nt(t)});var CY=class extends mt{constructor(){super(...arguments),this._any=!0}_parse(I){return zs(I.data)}};CY.create=t=>new CY({typeName:ge.ZodAny,...nt(t)});var cu=class extends mt{constructor(){super(...arguments),this._unknown=!0}_parse(I){return zs(I.data)}};cu.create=t=>new cu({typeName:ge.ZodUnknown,...nt(t)});var mi=class extends mt{_parse(I){let e=this._getOrReturnCtx(I);return xI(e,{code:YI.invalid_type,expected:jI.never,received:e.parsedType}),ye}};mi.create=t=>new mi({typeName:ge.ZodNever,...nt(t)});var AH=class extends mt{_parse(I){if(this._getType(I)!==jI.undefined){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.void,received:l.parsedType}),ye}return zs(I.data)}};AH.create=t=>new AH({typeName:ge.ZodVoid,...nt(t)});var nu=class t extends mt{_parse(I){let{ctx:e,status:l}=this._processInputParams(I),c=this._def;if(e.parsedType!==jI.array)return xI(e,{code:YI.invalid_type,expected:jI.array,received:e.parsedType}),ye;if(c.exactLength!==null){let a=e.data.length>c.exactLength.value,s=e.data.length<c.exactLength.value;(a||s)&&(xI(e,{code:a?YI.too_big:YI.too_small,minimum:s?c.exactLength.value:void 0,maximum:a?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),l.dirty())}if(c.minLength!==null&&e.data.length<c.minLength.value&&(xI(e,{code:YI.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),l.dirty()),c.maxLength!==null&&e.data.length>c.maxLength.value&&(xI(e,{code:YI.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),l.dirty()),e.common.async)return Promise.all([...e.data].map((a,s)=>c.type._parseAsync(new Dd(e,a,e.path,s)))).then(a=>Gs.mergeArray(l,a));let n=[...e.data].map((a,s)=>c.type._parseSync(new Dd(e,a,e.path,s)));return Gs.mergeArray(l,n)}get element(){return this._def.type}min(I,e){return new t({...this._def,minLength:{value:I,message:ae.toString(e)}})}max(I,e){return new t({...this._def,maxLength:{value:I,message:ae.toString(e)}})}length(I,e){return new t({...this._def,exactLength:{value:I,message:ae.toString(e)}})}nonempty(I){return this.min(1,I)}};nu.create=(t,I)=>new nu({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...nt(I)});function QH(t){if(t instanceof kG){let I={};for(let e in t.shape){let l=t.shape[e];I[e]=jd.create(QH(l))}return new kG({...t._def,shape:()=>I})}else return t instanceof nu?new nu({...t._def,type:QH(t.element)}):t instanceof jd?jd.create(QH(t.unwrap())):t instanceof Xh?Xh.create(QH(t.unwrap())):t instanceof Ah?Ah.create(t.items.map(I=>QH(I))):t}var kG=class t extends mt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let I=this._def.shape(),e=ft.objectKeys(I);return this._cached={shape:I,keys:e},this._cached}_parse(I){if(this._getType(I)!==jI.object){let o=this._getOrReturnCtx(I);return xI(o,{code:YI.invalid_type,expected:jI.object,received:o.parsedType}),ye}let{status:l,ctx:c}=this._processInputParams(I),{shape:n,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof mi&&this._def.unknownKeys==="strip"))for(let o in c.data)a.includes(o)||s.push(o);let r=[];for(let o of a){let d=n[o],b=c.data[o];r.push({key:{status:"valid",value:o},value:d._parse(new Dd(c,b,c.path,o)),alwaysSet:o in c.data})}if(this._def.catchall instanceof mi){let o=this._def.unknownKeys;if(o==="passthrough")for(let d of s)r.push({key:{status:"valid",value:d},value:{status:"valid",value:c.data[d]}});else if(o==="strict")s.length>0&&(xI(c,{code:YI.unrecognized_keys,keys:s}),l.dirty());else if(o!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let o=this._def.catchall;for(let d of s){let b=c.data[d];r.push({key:{status:"valid",value:d},value:o._parse(new Dd(c,b,c.path,d)),alwaysSet:d in c.data})}}return c.common.async?Promise.resolve().then(async()=>{let o=[];for(let d of r){let b=await d.key,h=await d.value;o.push({key:b,value:h,alwaysSet:d.alwaysSet})}return o}).then(o=>Gs.mergeObjectSync(l,o)):Gs.mergeObjectSync(l,r)}get shape(){return this._def.shape()}strict(I){return ae.errToObj,new t({...this._def,unknownKeys:"strict",...I!==void 0?{errorMap:(e,l)=>{let c=this._def.errorMap?.(e,l).message??l.defaultError;return e.code==="unrecognized_keys"?{message:ae.errToObj(I).message??c}:{message:c}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(I){return new t({...this._def,shape:()=>({...this._def.shape(),...I})})}merge(I){return new t({unknownKeys:I._def.unknownKeys,catchall:I._def.catchall,shape:()=>({...this._def.shape(),...I._def.shape()}),typeName:ge.ZodObject})}setKey(I,e){return this.augment({[I]:e})}catchall(I){return new t({...this._def,catchall:I})}pick(I){let e={};for(let l of ft.objectKeys(I))I[l]&&this.shape[l]&&(e[l]=this.shape[l]);return new t({...this._def,shape:()=>e})}omit(I){let e={};for(let l of ft.objectKeys(this.shape))I[l]||(e[l]=this.shape[l]);return new t({...this._def,shape:()=>e})}deepPartial(){return QH(this)}partial(I){let e={};for(let l of ft.objectKeys(this.shape)){let c=this.shape[l];I&&!I[l]?e[l]=c:e[l]=c.optional()}return new t({...this._def,shape:()=>e})}required(I){let e={};for(let l of ft.objectKeys(this.shape))if(I&&!I[l])e[l]=this.shape[l];else{let n=this.shape[l];for(;n instanceof jd;)n=n._def.innerType;e[l]=n}return new t({...this._def,shape:()=>e})}keyof(){return q9I(ft.objectKeys(this.shape))}};kG.create=(t,I)=>new kG({shape:()=>t,unknownKeys:"strip",catchall:mi.create(),typeName:ge.ZodObject,...nt(I)});kG.strictCreate=(t,I)=>new kG({shape:()=>t,unknownKeys:"strict",catchall:mi.create(),typeName:ge.ZodObject,...nt(I)});kG.lazycreate=(t,I)=>new kG({shape:t,unknownKeys:"strip",catchall:mi.create(),typeName:ge.ZodObject,...nt(I)});var _0=class extends mt{_parse(I){let{ctx:e}=this._processInputParams(I),l=this._def.options;function c(n){for(let s of n)if(s.result.status==="valid")return s.result;for(let s of n)if(s.result.status==="dirty")return e.common.issues.push(...s.ctx.common.issues),s.result;let a=n.map(s=>new LG(s.ctx.common.issues));return xI(e,{code:YI.invalid_union,unionErrors:a}),ye}if(e.common.async)return Promise.all(l.map(async n=>{let a={...e,common:{...e.common,issues:[]},parent:null};return{result:await n._parseAsync({data:e.data,path:e.path,parent:a}),ctx:a}})).then(c);{let n,a=[];for(let r of l){let o={...e,common:{...e.common,issues:[]},parent:null},d=r._parseSync({data:e.data,path:e.path,parent:o});if(d.status==="valid")return d;d.status==="dirty"&&!n&&(n={result:d,ctx:o}),o.common.issues.length&&a.push(o.common.issues)}if(n)return e.common.issues.push(...n.ctx.common.issues),n.result;let s=a.map(r=>new LG(r));return xI(e,{code:YI.invalid_union,unionErrors:s}),ye}}get options(){return this._def.options}};_0.create=(t,I)=>new _0({options:t,typeName:ge.ZodUnion,...nt(I)});var lu=t=>t instanceof Iy?lu(t.schema):t instanceof Kd?lu(t.innerType()):t instanceof ey?[t.value]:t instanceof ty?t.options:t instanceof ly?ft.objectValues(t.enum):t instanceof cy?lu(t._def.innerType):t instanceof P0?[void 0]:t instanceof q0?[null]:t instanceof jd?[void 0,...lu(t.unwrap())]:t instanceof Xh?[null,...lu(t.unwrap())]:t instanceof e9||t instanceof ay?lu(t.unwrap()):t instanceof ny?lu(t._def.innerType):[],SD=class t extends mt{_parse(I){let{ctx:e}=this._processInputParams(I);if(e.parsedType!==jI.object)return xI(e,{code:YI.invalid_type,expected:jI.object,received:e.parsedType}),ye;let l=this.discriminator,c=e.data[l],n=this.optionsMap.get(c);return n?e.common.async?n._parseAsync({data:e.data,path:e.path,parent:e}):n._parseSync({data:e.data,path:e.path,parent:e}):(xI(e,{code:YI.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[l]}),ye)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(I,e,l){let c=new Map;for(let n of e){let a=lu(n.shape[I]);if(!a.length)throw new Error(`A discriminator value for key \`${I}\` could not be extracted from all schema options`);for(let s of a){if(c.has(s))throw new Error(`Discriminator property ${String(I)} has duplicate value ${String(s)}`);c.set(s,n)}}return new t({typeName:ge.ZodDiscriminatedUnion,discriminator:I,options:e,optionsMap:c,...nt(l)})}};function IoI(t,I){let e=gh(t),l=gh(I);if(t===I)return{valid:!0,data:t};if(e===jI.object&&l===jI.object){let c=ft.objectKeys(I),n=ft.objectKeys(t).filter(s=>c.indexOf(s)!==-1),a={...t,...I};for(let s of n){let r=IoI(t[s],I[s]);if(!r.valid)return{valid:!1};a[s]=r.data}return{valid:!0,data:a}}else if(e===jI.array&&l===jI.array){if(t.length!==I.length)return{valid:!1};let c=[];for(let n=0;n<t.length;n++){let a=t[n],s=I[n],r=IoI(a,s);if(!r.valid)return{valid:!1};c.push(r.data)}return{valid:!0,data:c}}else return e===jI.date&&l===jI.date&&+t==+I?{valid:!0,data:t}:{valid:!1}}var $0=class extends mt{_parse(I){let{status:e,ctx:l}=this._processInputParams(I),c=(n,a)=>{if(zD(n)||zD(a))return ye;let s=IoI(n.value,a.value);return s.valid?((UD(n)||UD(a))&&e.dirty(),{status:e.value,value:s.data}):(xI(l,{code:YI.invalid_intersection_types}),ye)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([n,a])=>c(n,a)):c(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}};$0.create=(t,I,e)=>new $0({left:t,right:I,typeName:ge.ZodIntersection,...nt(e)});var Ah=class t extends mt{_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.parsedType!==jI.array)return xI(l,{code:YI.invalid_type,expected:jI.array,received:l.parsedType}),ye;if(l.data.length<this._def.items.length)return xI(l,{code:YI.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ye;!this._def.rest&&l.data.length>this._def.items.length&&(xI(l,{code:YI.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let n=[...l.data].map((a,s)=>{let r=this._def.items[s]||this._def.rest;return r?r._parse(new Dd(l,a,l.path,s)):null}).filter(a=>!!a);return l.common.async?Promise.all(n).then(a=>Gs.mergeArray(e,a)):Gs.mergeArray(e,n)}get items(){return this._def.items}rest(I){return new t({...this._def,rest:I})}};Ah.create=(t,I)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ah({items:t,typeName:ge.ZodTuple,rest:null,...nt(I)})};var OD=class t extends mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.parsedType!==jI.object)return xI(l,{code:YI.invalid_type,expected:jI.object,received:l.parsedType}),ye;let c=[],n=this._def.keyType,a=this._def.valueType;for(let s in l.data)c.push({key:n._parse(new Dd(l,s,l.path,s)),value:a._parse(new Dd(l,l.data[s],l.path,s)),alwaysSet:s in l.data});return l.common.async?Gs.mergeObjectAsync(e,c):Gs.mergeObjectSync(e,c)}get element(){return this._def.valueType}static create(I,e,l){return e instanceof mt?new t({keyType:I,valueType:e,typeName:ge.ZodRecord,...nt(l)}):new t({keyType:vY.create(),valueType:I,typeName:ge.ZodRecord,...nt(e)})}},XH=class extends mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.parsedType!==jI.map)return xI(l,{code:YI.invalid_type,expected:jI.map,received:l.parsedType}),ye;let c=this._def.keyType,n=this._def.valueType,a=[...l.data.entries()].map(([s,r],o)=>({key:c._parse(new Dd(l,s,l.path,[o,"key"])),value:n._parse(new Dd(l,r,l.path,[o,"value"]))}));if(l.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let r of a){let o=await r.key,d=await r.value;if(o.status==="aborted"||d.status==="aborted")return ye;(o.status==="dirty"||d.status==="dirty")&&e.dirty(),s.set(o.value,d.value)}return{status:e.value,value:s}})}else{let s=new Map;for(let r of a){let o=r.key,d=r.value;if(o.status==="aborted"||d.status==="aborted")return ye;(o.status==="dirty"||d.status==="dirty")&&e.dirty(),s.set(o.value,d.value)}return{status:e.value,value:s}}}};XH.create=(t,I,e)=>new XH({valueType:I,keyType:t,typeName:ge.ZodMap,...nt(e)});var wH=class t extends mt{_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.parsedType!==jI.set)return xI(l,{code:YI.invalid_type,expected:jI.set,received:l.parsedType}),ye;let c=this._def;c.minSize!==null&&l.data.size<c.minSize.value&&(xI(l,{code:YI.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),e.dirty()),c.maxSize!==null&&l.data.size>c.maxSize.value&&(xI(l,{code:YI.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),e.dirty());let n=this._def.valueType;function a(r){let o=new Set;for(let d of r){if(d.status==="aborted")return ye;d.status==="dirty"&&e.dirty(),o.add(d.value)}return{status:e.value,value:o}}let s=[...l.data.values()].map((r,o)=>n._parse(new Dd(l,r,l.path,o)));return l.common.async?Promise.all(s).then(r=>a(r)):a(s)}min(I,e){return new t({...this._def,minSize:{value:I,message:ae.toString(e)}})}max(I,e){return new t({...this._def,maxSize:{value:I,message:ae.toString(e)}})}size(I,e){return this.min(I,e).max(I,e)}nonempty(I){return this.min(1,I)}};wH.create=(t,I)=>new wH({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...nt(I)});var MD=class t extends mt{constructor(){super(...arguments),this.validate=this.implement}_parse(I){let{ctx:e}=this._processInputParams(I);if(e.parsedType!==jI.function)return xI(e,{code:YI.invalid_type,expected:jI.function,received:e.parsedType}),ye;function l(s,r){return I9({data:s,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,yH(),tu].filter(o=>!!o),issueData:{code:YI.invalid_arguments,argumentsError:r}})}function c(s,r){return I9({data:s,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,yH(),tu].filter(o=>!!o),issueData:{code:YI.invalid_return_type,returnTypeError:r}})}let n={errorMap:e.common.contextualErrorMap},a=e.data;if(this._def.returns instanceof JY){let s=this;return zs(async function(...r){let o=new LG([]),d=await s._def.args.parseAsync(r,n).catch(Z=>{throw o.addIssue(l(r,Z)),o}),b=await Reflect.apply(a,this,d);return await s._def.returns._def.type.parseAsync(b,n).catch(Z=>{throw o.addIssue(c(b,Z)),o})})}else{let s=this;return zs(function(...r){let o=s._def.args.safeParse(r,n);if(!o.success)throw new LG([l(r,o.error)]);let d=Reflect.apply(a,this,o.data),b=s._def.returns.safeParse(d,n);if(!b.success)throw new LG([c(d,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...I){return new t({...this._def,args:Ah.create(I).rest(cu.create())})}returns(I){return new t({...this._def,returns:I})}implement(I){return this.parse(I)}strictImplement(I){return this.parse(I)}static create(I,e,l){return new t({args:I||Ah.create([]).rest(cu.create()),returns:e||cu.create(),typeName:ge.ZodFunction,...nt(l)})}},Iy=class extends mt{get schema(){return this._def.getter()}_parse(I){let{ctx:e}=this._processInputParams(I);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};Iy.create=(t,I)=>new Iy({getter:t,typeName:ge.ZodLazy,...nt(I)});var ey=class extends mt{_parse(I){if(I.data!==this._def.value){let e=this._getOrReturnCtx(I);return xI(e,{received:e.data,code:YI.invalid_literal,expected:this._def.value}),ye}return{status:"valid",value:I.data}}get value(){return this._def.value}};ey.create=(t,I)=>new ey({value:t,typeName:ge.ZodLiteral,...nt(I)});function q9I(t,I){return new ty({values:t,typeName:ge.ZodEnum,...nt(I)})}var ty=class t extends mt{_parse(I){if(typeof I.data!="string"){let e=this._getOrReturnCtx(I),l=this._def.values;return xI(e,{expected:ft.joinValues(l),received:e.parsedType,code:YI.invalid_type}),ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(I.data)){let e=this._getOrReturnCtx(I),l=this._def.values;return xI(e,{received:e.data,code:YI.invalid_enum_value,options:l}),ye}return zs(I.data)}get options(){return this._def.values}get enum(){let I={};for(let e of this._def.values)I[e]=e;return I}get Values(){let I={};for(let e of this._def.values)I[e]=e;return I}get Enum(){let I={};for(let e of this._def.values)I[e]=e;return I}extract(I,e=this._def){return t.create(I,{...this._def,...e})}exclude(I,e=this._def){return t.create(this.options.filter(l=>!I.includes(l)),{...this._def,...e})}};ty.create=q9I;var ly=class extends mt{_parse(I){let e=ft.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(I);if(l.parsedType!==jI.string&&l.parsedType!==jI.number){let c=ft.objectValues(e);return xI(l,{expected:ft.joinValues(c),received:l.parsedType,code:YI.invalid_type}),ye}if(this._cache||(this._cache=new Set(ft.getValidEnumValues(this._def.values))),!this._cache.has(I.data)){let c=ft.objectValues(e);return xI(l,{received:l.data,code:YI.invalid_enum_value,options:c}),ye}return zs(I.data)}get enum(){return this._def.values}};ly.create=(t,I)=>new ly({values:t,typeName:ge.ZodNativeEnum,...nt(I)});var JY=class extends mt{unwrap(){return this._def.type}_parse(I){let{ctx:e}=this._processInputParams(I);if(e.parsedType!==jI.promise&&e.common.async===!1)return xI(e,{code:YI.invalid_type,expected:jI.promise,received:e.parsedType}),ye;let l=e.parsedType===jI.promise?e.data:Promise.resolve(e.data);return zs(l.then(c=>this._def.type.parseAsync(c,{path:e.path,errorMap:e.common.contextualErrorMap})))}};JY.create=(t,I)=>new JY({type:t,typeName:ge.ZodPromise,...nt(I)});var Kd=class extends mt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(I){let{status:e,ctx:l}=this._processInputParams(I),c=this._def.effect||null,n={addIssue:a=>{xI(l,a),a.fatal?e.abort():e.dirty()},get path(){return l.path}};if(n.addIssue=n.addIssue.bind(n),c.type==="preprocess"){let a=c.transform(l.data,n);if(l.common.async)return Promise.resolve(a).then(async s=>{if(e.value==="aborted")return ye;let r=await this._def.schema._parseAsync({data:s,path:l.path,parent:l});return r.status==="aborted"?ye:r.status==="dirty"?M0(r.value):e.value==="dirty"?M0(r.value):r});{if(e.value==="aborted")return ye;let s=this._def.schema._parseSync({data:a,path:l.path,parent:l});return s.status==="aborted"?ye:s.status==="dirty"?M0(s.value):e.value==="dirty"?M0(s.value):s}}if(c.type==="refinement"){let a=s=>{let r=c.refinement(s,n);if(l.common.async)return Promise.resolve(r);if(r instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(l.common.async===!1){let s=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return s.status==="aborted"?ye:(s.status==="dirty"&&e.dirty(),a(s.value),{status:e.value,value:s.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(s=>s.status==="aborted"?ye:(s.status==="dirty"&&e.dirty(),a(s.value).then(()=>({status:e.value,value:s.value}))))}if(c.type==="transform")if(l.common.async===!1){let a=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!EY(a))return ye;let s=c.transform(a.value,n);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:s}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(a=>EY(a)?Promise.resolve(c.transform(a.value,n)).then(s=>({status:e.value,value:s})):ye);ft.assertNever(c)}};Kd.create=(t,I,e)=>new Kd({schema:t,typeName:ge.ZodEffects,effect:I,...nt(e)});Kd.createWithPreprocess=(t,I,e)=>new Kd({schema:I,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...nt(e)});var jd=class extends mt{_parse(I){return this._getType(I)===jI.undefined?zs(void 0):this._def.innerType._parse(I)}unwrap(){return this._def.innerType}};jd.create=(t,I)=>new jd({innerType:t,typeName:ge.ZodOptional,...nt(I)});var Xh=class extends mt{_parse(I){return this._getType(I)===jI.null?zs(null):this._def.innerType._parse(I)}unwrap(){return this._def.innerType}};Xh.create=(t,I)=>new Xh({innerType:t,typeName:ge.ZodNullable,...nt(I)});var cy=class extends mt{_parse(I){let{ctx:e}=this._processInputParams(I),l=e.data;return e.parsedType===jI.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};cy.create=(t,I)=>new cy({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof I.default=="function"?I.default:()=>I.default,...nt(I)});var ny=class extends mt{_parse(I){let{ctx:e}=this._processInputParams(I),l={...e,common:{...e.common,issues:[]}},c=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return FH(c)?c.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new LG(l.common.issues)},input:l.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new LG(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}};ny.create=(t,I)=>new ny({innerType:t,typeName:ge.ZodCatch,catchValue:typeof I.catch=="function"?I.catch:()=>I.catch,...nt(I)});var HH=class extends mt{_parse(I){if(this._getType(I)!==jI.nan){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.nan,received:l.parsedType}),ye}return{status:"valid",value:I.data}}};HH.create=t=>new HH({typeName:ge.ZodNaN,...nt(t)});var _Ee=Symbol("zod_brand"),e9=class extends mt{_parse(I){let{ctx:e}=this._processInputParams(I),l=e.data;return this._def.type._parse({data:l,path:e.path,parent:e})}unwrap(){return this._def.type}},t9=class t extends mt{_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return n.status==="aborted"?ye:n.status==="dirty"?(e.dirty(),M0(n.value)):this._def.out._parseAsync({data:n.value,path:l.path,parent:l})})();{let c=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return c.status==="aborted"?ye:c.status==="dirty"?(e.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:l.path,parent:l})}}static create(I,e){return new t({in:I,out:e,typeName:ge.ZodPipeline})}},ay=class extends mt{_parse(I){let e=this._def.innerType._parse(I),l=c=>(EY(c)&&(c.value=Object.freeze(c.value)),c);return FH(e)?e.then(c=>l(c)):l(e)}unwrap(){return this._def.innerType}};ay.create=(t,I)=>new ay({innerType:t,typeName:ge.ZodReadonly,...nt(I)});function j9I(t,I){let e=typeof t=="function"?t(I):typeof t=="string"?{message:t}:t;return typeof e=="string"?{message:e}:e}function _9I(t,I={},e){return t?CY.create().superRefine((l,c)=>{let n=t(l);if(n instanceof Promise)return n.then(a=>{if(!a){let s=j9I(I,l),r=s.fatal??e??!0;c.addIssue({code:"custom",...s,fatal:r})}});if(!n){let a=j9I(I,l),s=a.fatal??e??!0;c.addIssue({code:"custom",...a,fatal:s})}}):CY.create()}var $Ee={object:kG.lazycreate},ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));var I1e=(t,I={message:`Input not instance of ${t.name}`})=>_9I(e=>e instanceof t,I),vI=vY.create,wh=T0.create,e1e=HH.create,t1e=j0.create,fa=D0.create,l1e=K0.create,c1e=gH.create,n1e=P0.create,a1e=q0.create,eoI=CY.create,toI=cu.create,s1e=mi.create,r1e=AH.create,Us=nu.create,Ae=kG.create,G1e=kG.strictCreate,Ss=_0.create,loI=SD.create,o1e=$0.create,coI=Ah.create,TD=OD.create,d1e=XH.create,b1e=wH.create,i1e=MD.create,m1e=Iy.create,sl=ey.create,au=ty.create,h1e=ly.create,Z1e=JY.create,p1e=Kd.create,u1e=jd.create,W1e=Xh.create,N1e=Kd.createWithPreprocess,Y1e=t9.create,V1e=()=>vI().optional(),R1e=()=>wh().optional(),y1e=()=>fa().optional(),l9={string:t=>vY.create({...t,coerce:!0}),number:t=>T0.create({...t,coerce:!0}),boolean:t=>D0.create({...t,coerce:!0}),bigint:t=>j0.create({...t,coerce:!0}),date:t=>K0.create({...t,coerce:!0})};var F1e=ye;var EH="2025-06-18";var $9I=[EH,"2025-03-26","2024-11-05","2024-10-07"],jD="2.0",IfI=R.union([R.string(),R.number().int()]),efI=R.string(),Q1e=R.object({progressToken:R.optional(IfI)}).passthrough(),_d=R.object({_meta:R.optional(Q1e)}).passthrough(),fG=R.object({method:R.string(),params:R.optional(_d)}),c9=R.object({_meta:R.optional(R.object({}).passthrough())}).passthrough(),Hh=R.object({method:R.string(),params:R.optional(c9)}),$d=R.object({_meta:R.optional(R.object({}).passthrough())}).passthrough(),DD=R.union([R.string(),R.number().int()]),tfI=R.object({jsonrpc:R.literal(jD),id:DD}).merge(fG).strict(),KD=t=>tfI.safeParse(t).success,lfI=R.object({jsonrpc:R.literal(jD)}).merge(Hh).strict(),cfI=t=>lfI.safeParse(t).success,nfI=R.object({jsonrpc:R.literal(jD),id:DD,result:$d}).strict(),n9=t=>nfI.safeParse(t).success,Pd;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(Pd||(Pd={}));var afI=R.object({jsonrpc:R.literal(jD),id:DD,error:R.object({code:R.number().int(),message:R.string(),data:R.optional(R.unknown())})}).strict(),sfI=t=>afI.safeParse(t).success,LY=R.union([tfI,lfI,nfI,afI]),sy=$d.strict(),PD=Hh.extend({method:R.literal("notifications/cancelled"),params:c9.extend({requestId:DD,reason:R.string().optional()})}),qD=R.object({src:R.string(),mimeType:R.optional(R.string()),sizes:R.optional(R.string())}).passthrough(),a9=R.object({name:R.string(),title:R.optional(R.string())}).passthrough(),rfI=a9.extend({version:R.string(),websiteUrl:R.optional(R.string()),icons:R.optional(R.array(qD))}),g1e=R.object({experimental:R.optional(R.object({}).passthrough()),sampling:R.optional(R.object({}).passthrough()),elicitation:R.optional(R.object({}).passthrough()),roots:R.optional(R.object({listChanged:R.optional(R.boolean())}).passthrough())}).passthrough(),A1e=fG.extend({method:R.literal("initialize"),params:_d.extend({protocolVersion:R.string(),capabilities:g1e,clientInfo:rfI})});var X1e=R.object({experimental:R.optional(R.object({}).passthrough()),logging:R.optional(R.object({}).passthrough()),completions:R.optional(R.object({}).passthrough()),prompts:R.optional(R.object({listChanged:R.optional(R.boolean())}).passthrough()),resources:R.optional(R.object({subscribe:R.optional(R.boolean()),listChanged:R.optional(R.boolean())}).passthrough()),tools:R.optional(R.object({listChanged:R.optional(R.boolean())}).passthrough())}).passthrough(),aoI=$d.extend({protocolVersion:R.string(),capabilities:X1e,serverInfo:rfI,instructions:R.optional(R.string())}),GfI=Hh.extend({method:R.literal("notifications/initialized")}),ofI=t=>GfI.safeParse(t).success,_D=fG.extend({method:R.literal("ping")}),w1e=R.object({progress:R.number(),total:R.optional(R.number()),message:R.optional(R.string())}).passthrough(),$D=Hh.extend({method:R.literal("notifications/progress"),params:c9.merge(w1e).extend({progressToken:IfI})}),IK=fG.extend({params:_d.extend({cursor:R.optional(efI)}).optional()}),eK=$d.extend({nextCursor:R.optional(efI)}),dfI=R.object({uri:R.string(),mimeType:R.optional(R.string()),_meta:R.optional(R.object({}).passthrough())}).passthrough(),bfI=dfI.extend({text:R.string()}),soI=R.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),ifI=dfI.extend({blob:soI}),mfI=a9.extend({uri:R.string(),description:R.optional(R.string()),mimeType:R.optional(R.string()),icons:R.optional(R.array(qD)),_meta:R.optional(R.object({}).passthrough())}),H1e=a9.extend({uriTemplate:R.string(),description:R.optional(R.string()),mimeType:R.optional(R.string()),_meta:R.optional(R.object({}).passthrough())}),E1e=IK.extend({method:R.literal("resources/list")}),roI=eK.extend({resources:R.array(mfI)}),v1e=IK.extend({method:R.literal("resources/templates/list")}),GoI=eK.extend({resourceTemplates:R.array(H1e)}),C1e=fG.extend({method:R.literal("resources/read"),params:_d.extend({uri:R.string()})}),ooI=$d.extend({contents:R.array(R.union([bfI,ifI]))}),J1e=Hh.extend({method:R.literal("notifications/resources/list_changed")}),L1e=fG.extend({method:R.literal("resources/subscribe"),params:_d.extend({uri:R.string()})}),k1e=fG.extend({method:R.literal("resources/unsubscribe"),params:_d.extend({uri:R.string()})}),f1e=Hh.extend({method:R.literal("notifications/resources/updated"),params:c9.extend({uri:R.string()})}),x1e=R.object({name:R.string(),description:R.optional(R.string()),required:R.optional(R.boolean())}).passthrough(),B1e=a9.extend({description:R.optional(R.string()),arguments:R.optional(R.array(x1e)),icons:R.optional(R.array(qD)),_meta:R.optional(R.object({}).passthrough())}),z1e=IK.extend({method:R.literal("prompts/list")}),doI=eK.extend({prompts:R.array(B1e)}),U1e=fG.extend({method:R.literal("prompts/get"),params:_d.extend({name:R.string(),arguments:R.optional(R.record(R.string()))})}),boI=R.object({type:R.literal("text"),text:R.string(),_meta:R.optional(R.object({}).passthrough())}).passthrough(),ioI=R.object({type:R.literal("image"),data:soI,mimeType:R.string(),_meta:R.optional(R.object({}).passthrough())}).passthrough(),moI=R.object({type:R.literal("audio"),data:soI,mimeType:R.string(),_meta:R.optional(R.object({}).passthrough())}).passthrough(),S1e=R.object({type:R.literal("resource"),resource:R.union([bfI,ifI]),_meta:R.optional(R.object({}).passthrough())}).passthrough(),O1e=mfI.extend({type:R.literal("resource_link")}),hfI=R.union([boI,ioI,moI,O1e,S1e]),M1e=R.object({role:R.enum(["user","assistant"]),content:hfI}).passthrough(),hoI=$d.extend({description:R.optional(R.string()),messages:R.array(M1e)}),T1e=Hh.extend({method:R.literal("notifications/prompts/list_changed")}),j1e=R.object({title:R.optional(R.string()),readOnlyHint:R.optional(R.boolean()),destructiveHint:R.optional(R.boolean()),idempotentHint:R.optional(R.boolean()),openWorldHint:R.optional(R.boolean())}).passthrough(),D1e=a9.extend({description:R.optional(R.string()),inputSchema:R.object({type:R.literal("object"),properties:R.optional(R.object({}).passthrough()),required:R.optional(R.array(R.string()))}).passthrough(),outputSchema:R.optional(R.object({type:R.literal("object"),properties:R.optional(R.object({}).passthrough()),required:R.optional(R.array(R.string()))}).passthrough()),annotations:R.optional(j1e),icons:R.optional(R.array(qD)),_meta:R.optional(R.object({}).passthrough())}),K1e=IK.extend({method:R.literal("tools/list")}),ZoI=eK.extend({tools:R.array(D1e)}),tK=$d.extend({content:R.array(hfI).default([]),structuredContent:R.object({}).passthrough().optional(),isError:R.optional(R.boolean())}),x3l=tK.or($d.extend({toolResult:R.unknown()})),P1e=fG.extend({method:R.literal("tools/call"),params:_d.extend({name:R.string(),arguments:R.optional(R.record(R.unknown()))})}),q1e=Hh.extend({method:R.literal("notifications/tools/list_changed")}),ZfI=R.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),_1e=fG.extend({method:R.literal("logging/setLevel"),params:_d.extend({level:ZfI})}),$1e=Hh.extend({method:R.literal("notifications/message"),params:c9.extend({level:ZfI,logger:R.optional(R.string()),data:R.unknown()})}),Ive=R.object({name:R.string().optional()}).passthrough(),eve=R.object({hints:R.optional(R.array(Ive)),costPriority:R.optional(R.number().min(0).max(1)),speedPriority:R.optional(R.number().min(0).max(1)),intelligencePriority:R.optional(R.number().min(0).max(1))}).passthrough(),tve=R.object({role:R.enum(["user","assistant"]),content:R.union([boI,ioI,moI])}).passthrough(),lve=fG.extend({method:R.literal("sampling/createMessage"),params:_d.extend({messages:R.array(tve),systemPrompt:R.optional(R.string()),includeContext:R.optional(R.enum(["none","thisServer","allServers"])),temperature:R.optional(R.number()),maxTokens:R.number().int(),stopSequences:R.optional(R.array(R.string())),metadata:R.optional(R.object({}).passthrough()),modelPreferences:R.optional(eve)})}),cve=$d.extend({model:R.string(),stopReason:R.optional(R.enum(["endTurn","stopSequence","maxTokens"]).or(R.string())),role:R.enum(["user","assistant"]),content:R.discriminatedUnion("type",[boI,ioI,moI])}),nve=R.object({type:R.literal("boolean"),title:R.optional(R.string()),description:R.optional(R.string()),default:R.optional(R.boolean())}).passthrough(),ave=R.object({type:R.literal("string"),title:R.optional(R.string()),description:R.optional(R.string()),minLength:R.optional(R.number()),maxLength:R.optional(R.number()),format:R.optional(R.enum(["email","uri","date","date-time"]))}).passthrough(),sve=R.object({type:R.enum(["number","integer"]),title:R.optional(R.string()),description:R.optional(R.string()),minimum:R.optional(R.number()),maximum:R.optional(R.number())}).passthrough(),rve=R.object({type:R.literal("string"),title:R.optional(R.string()),description:R.optional(R.string()),enum:R.array(R.string()),enumNames:R.optional(R.array(R.string()))}).passthrough(),Gve=R.union([nve,ave,sve,rve]),ove=fG.extend({method:R.literal("elicitation/create"),params:_d.extend({message:R.string(),requestedSchema:R.object({type:R.literal("object"),properties:R.record(R.string(),Gve),required:R.optional(R.array(R.string()))}).passthrough()})}),dve=$d.extend({action:R.enum(["accept","decline","cancel"]),content:R.optional(R.record(R.string(),R.unknown()))}),bve=R.object({type:R.literal("ref/resource"),uri:R.string()}).passthrough();var ive=R.object({type:R.literal("ref/prompt"),name:R.string()}).passthrough(),mve=fG.extend({method:R.literal("completion/complete"),params:_d.extend({ref:R.union([ive,bve]),argument:R.object({name:R.string(),value:R.string()}).passthrough(),context:R.optional(R.object({arguments:R.optional(R.record(R.string(),R.string()))}))})}),poI=$d.extend({completion:R.object({values:R.array(R.string()).max(100),total:R.optional(R.number().int()),hasMore:R.optional(R.boolean())}).passthrough()}),hve=R.object({uri:R.string().startsWith("file://"),name:R.optional(R.string()),_meta:R.optional(R.object({}).passthrough())}).passthrough(),Zve=fG.extend({method:R.literal("roots/list")}),pve=$d.extend({roots:R.array(hve)}),uve=Hh.extend({method:R.literal("notifications/roots/list_changed")}),B3l=R.union([_D,A1e,mve,_1e,U1e,z1e,E1e,v1e,C1e,L1e,k1e,P1e,K1e]),z3l=R.union([PD,$D,GfI,uve]),U3l=R.union([sy,cve,dve,pve]),S3l=R.union([_D,lve,ove,Zve]),O3l=R.union([PD,$D,$1e,f1e,J1e,q1e,T1e]),M3l=R.union([sy,aoI,poI,hoI,doI,roI,GoI,ooI,tK,ZoI]),qd=class extends Error{constructor(I,e,l){super(`MCP error ${I}: ${e}`),this.code=I,this.data=l,this.name="McpError"}};var Wve=6e4,lK=class{constructor(I){this._options=I,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(PD,e=>{let l=this._requestHandlerAbortControllers.get(e.params.requestId);l?.abort(e.params.reason)}),this.setNotificationHandler($D,e=>{this._onprogress(e)}),this.setRequestHandler(_D,e=>({}))}_setupTimeout(I,e,l,c,n=!1){this._timeoutInfo.set(I,{timeoutId:setTimeout(c,e),startTime:Date.now(),timeout:e,maxTotalTimeout:l,resetTimeoutOnProgress:n,onTimeout:c})}_resetTimeout(I){let e=this._timeoutInfo.get(I);if(!e)return!1;let l=Date.now()-e.startTime;if(e.maxTotalTimeout&&l>=e.maxTotalTimeout)throw this._timeoutInfo.delete(I),new qd(Pd.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:e.maxTotalTimeout,totalElapsed:l});return clearTimeout(e.timeoutId),e.timeoutId=setTimeout(e.onTimeout,e.timeout),!0}_cleanupTimeout(I){let e=this._timeoutInfo.get(I);e&&(clearTimeout(e.timeoutId),this._timeoutInfo.delete(I))}async connect(I){var e,l,c;this._transport=I;let n=(e=this.transport)===null||e===void 0?void 0:e.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let a=(l=this.transport)===null||l===void 0?void 0:l.onerror;this._transport.onerror=r=>{a?.(r),this._onerror(r)};let s=(c=this._transport)===null||c===void 0?void 0:c.onmessage;this._transport.onmessage=(r,o)=>{s?.(r,o),n9(r)||sfI(r)?this._onresponse(r):KD(r)?this._onrequest(r,o):cfI(r)?this._onnotification(r):this._onerror(new Error(`Unknown message type: ${JSON.stringify(r)}`))},await this._transport.start()}_onclose(){var I;let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(I=this.onclose)===null||I===void 0||I.call(this);let l=new qd(Pd.ConnectionClosed,"Connection closed");for(let c of e.values())c(l)}_onerror(I){var e;(e=this.onerror)===null||e===void 0||e.call(this,I)}_onnotification(I){var e;let l=(e=this._notificationHandlers.get(I.method))!==null&&e!==void 0?e:this.fallbackNotificationHandler;l!==void 0&&Promise.resolve().then(()=>l(I)).catch(c=>this._onerror(new Error(`Uncaught error in notification handler: ${c}`)))}_onrequest(I,e){var l,c;let n=(l=this._requestHandlers.get(I.method))!==null&&l!==void 0?l:this.fallbackRequestHandler,a=this._transport;if(n===void 0){a?.send({jsonrpc:"2.0",id:I.id,error:{code:Pd.MethodNotFound,message:"Method not found"}}).catch(o=>this._onerror(new Error(`Failed to send an error response: ${o}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(I.id,s);let r={signal:s.signal,sessionId:a?.sessionId,_meta:(c=I.params)===null||c===void 0?void 0:c._meta,sendNotification:o=>this.notification(o,{relatedRequestId:I.id}),sendRequest:(o,d,b)=>this.request(o,d,{...b,relatedRequestId:I.id}),authInfo:e?.authInfo,requestId:I.id,requestInfo:e?.requestInfo};Promise.resolve().then(()=>n(I,r)).then(o=>{if(!s.signal.aborted)return a?.send({result:o,jsonrpc:"2.0",id:I.id})},o=>{var d;if(!s.signal.aborted)return a?.send({jsonrpc:"2.0",id:I.id,error:{code:Number.isSafeInteger(o.code)?o.code:Pd.InternalError,message:(d=o.message)!==null&&d!==void 0?d:"Internal error"}})}).catch(o=>this._onerror(new Error(`Failed to send response: ${o}`))).finally(()=>{this._requestHandlerAbortControllers.delete(I.id)})}_onprogress(I){let{progressToken:e,...l}=I.params,c=Number(e),n=this._progressHandlers.get(c);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(I)}`));return}let a=this._responseHandlers.get(c),s=this._timeoutInfo.get(c);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(c)}catch(r){a(r);return}n(l)}_onresponse(I){let e=Number(I.id),l=this._responseHandlers.get(e);if(l===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(I)}`));return}if(this._responseHandlers.delete(e),this._progressHandlers.delete(e),this._cleanupTimeout(e),n9(I))l(I);else{let c=new qd(I.error.code,I.error.message,I.error.data);l(c)}}get transport(){return this._transport}async close(){var I;await((I=this._transport)===null||I===void 0?void 0:I.close())}request(I,e,l){let{relatedRequestId:c,resumptionToken:n,onresumptiontoken:a}=l??{};return new Promise((s,r)=>{var o,d,b,h,Z,p;if(!this._transport){r(new Error("Not connected"));return}((o=this._options)===null||o===void 0?void 0:o.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(I.method),(d=l?.signal)===null||d===void 0||d.throwIfAborted();let W=this._requestMessageId++,N={...I,jsonrpc:"2.0",id:W};l?.onprogress&&(this._progressHandlers.set(W,l.onprogress),N.params={...I.params,_meta:{...((b=I.params)===null||b===void 0?void 0:b._meta)||{},progressToken:W}});let Y=A=>{var X;this._responseHandlers.delete(W),this._progressHandlers.delete(W),this._cleanupTimeout(W),(X=this._transport)===null||X===void 0||X.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:W,reason:String(A)}},{relatedRequestId:c,resumptionToken:n,onresumptiontoken:a}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`))),r(A)};this._responseHandlers.set(W,A=>{var X;if(!(!((X=l?.signal)===null||X===void 0)&&X.aborted)){if(A instanceof Error)return r(A);try{let v=e.parse(A.result);s(v)}catch(v){r(v)}}}),(h=l?.signal)===null||h===void 0||h.addEventListener("abort",()=>{var A;Y((A=l?.signal)===null||A===void 0?void 0:A.reason)});let F=(Z=l?.timeout)!==null&&Z!==void 0?Z:Wve,g=()=>Y(new qd(Pd.RequestTimeout,"Request timed out",{timeout:F}));this._setupTimeout(W,F,l?.maxTotalTimeout,g,(p=l?.resetTimeoutOnProgress)!==null&&p!==void 0?p:!1),this._transport.send(N,{relatedRequestId:c,resumptionToken:n,onresumptiontoken:a}).catch(A=>{this._cleanupTimeout(W),r(A)})})}async notification(I,e){var l,c;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(I.method),((c=(l=this._options)===null||l===void 0?void 0:l.debouncedNotificationMethods)!==null&&c!==void 0?c:[]).includes(I.method)&&!I.params&&!e?.relatedRequestId){if(this._pendingDebouncedNotifications.has(I.method))return;this._pendingDebouncedNotifications.add(I.method),Promise.resolve().then(()=>{var r;if(this._pendingDebouncedNotifications.delete(I.method),!this._transport)return;let o={...I,jsonrpc:"2.0"};(r=this._transport)===null||r===void 0||r.send(o,e).catch(d=>this._onerror(d))});return}let s={...I,jsonrpc:"2.0"};await this._transport.send(s,e)}setRequestHandler(I,e){let l=I.shape.method.value;this.assertRequestHandlerCapability(l),this._requestHandlers.set(l,(c,n)=>Promise.resolve(e(I.parse(c),n)))}removeRequestHandler(I){this._requestHandlers.delete(I)}assertCanSetRequestHandler(I){if(this._requestHandlers.has(I))throw new Error(`A request handler for ${I} already exists, which would be overridden`)}setNotificationHandler(I,e){this._notificationHandlers.set(I.shape.method.value,l=>Promise.resolve(e(I.parse(l))))}removeNotificationHandler(I){this._notificationHandlers.delete(I)}};function pfI(t,I){return Object.entries(I).reduce((e,[l,c])=>(c&&typeof c=="object"?e[l]=e[l]?{...e[l],...c}:c:e[l]=c,e),{...t})}var qBI=Qc(PBI(),1),fK=class extends lK{constructor(I,e){var l;super(e),this._clientInfo=I,this._cachedToolOutputValidators=new Map,this._capabilities=(l=e?.capabilities)!==null&&l!==void 0?l:{},this._ajv=new qBI.default}registerCapabilities(I){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=pfI(this._capabilities,I)}assertCapability(I,e){var l;if(!(!((l=this._serverCapabilities)===null||l===void 0)&&l[I]))throw new Error(`Server does not support ${I} (required for ${e})`)}async connect(I,e){if(await super.connect(I),I.sessionId===void 0)try{let l=await this.request({method:"initialize",params:{protocolVersion:EH,capabilities:this._capabilities,clientInfo:this._clientInfo}},aoI,e);if(l===void 0)throw new Error(`Server sent invalid initialize result: ${l}`);if(!$9I.includes(l.protocolVersion))throw new Error(`Server's protocol version is not supported: ${l.protocolVersion}`);this._serverCapabilities=l.capabilities,this._serverVersion=l.serverInfo,I.setProtocolVersion&&I.setProtocolVersion(l.protocolVersion),this._instructions=l.instructions,await this.notification({method:"notifications/initialized"})}catch(l){throw this.close(),l}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(I){var e,l,c,n,a;switch(I){case"logging/setLevel":if(!(!((e=this._serverCapabilities)===null||e===void 0)&&e.logging))throw new Error(`Server does not support logging (required for ${I})`);break;case"prompts/get":case"prompts/list":if(!(!((l=this._serverCapabilities)===null||l===void 0)&&l.prompts))throw new Error(`Server does not support prompts (required for ${I})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((c=this._serverCapabilities)===null||c===void 0)&&c.resources))throw new Error(`Server does not support resources (required for ${I})`);if(I==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${I})`);break;case"tools/call":case"tools/list":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.tools))throw new Error(`Server does not support tools (required for ${I})`);break;case"completion/complete":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.completions))throw new Error(`Server does not support completions (required for ${I})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(I){var e;switch(I){case"notifications/roots/list_changed":if(!(!((e=this._capabilities.roots)===null||e===void 0)&&e.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${I})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(I){switch(I){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${I})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${I})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${I})`);break;case"ping":break}}async ping(I){return this.request({method:"ping"},sy,I)}async complete(I,e){return this.request({method:"completion/complete",params:I},poI,e)}async setLoggingLevel(I,e){return this.request({method:"logging/setLevel",params:{level:I}},sy,e)}async getPrompt(I,e){return this.request({method:"prompts/get",params:I},hoI,e)}async listPrompts(I,e){return this.request({method:"prompts/list",params:I},doI,e)}async listResources(I,e){return this.request({method:"resources/list",params:I},roI,e)}async listResourceTemplates(I,e){return this.request({method:"resources/templates/list",params:I},GoI,e)}async readResource(I,e){return this.request({method:"resources/read",params:I},ooI,e)}async subscribeResource(I,e){return this.request({method:"resources/subscribe",params:I},sy,e)}async unsubscribeResource(I,e){return this.request({method:"resources/unsubscribe",params:I},sy,e)}async callTool(I,e=tK,l){let c=await this.request({method:"tools/call",params:I},e,l),n=this.getToolOutputValidator(I.name);if(n){if(!c.structuredContent&&!c.isError)throw new qd(Pd.InvalidRequest,`Tool ${I.name} has an output schema but did not return structured content`);if(c.structuredContent)try{if(!n(c.structuredContent))throw new qd(Pd.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(n.errors)}`)}catch(a){throw a instanceof qd?a:new qd(Pd.InvalidParams,`Failed to validate structured content: ${a instanceof Error?a.message:String(a)}`)}}return c}cacheToolOutputSchemas(I){this._cachedToolOutputValidators.clear();for(let e of I)if(e.outputSchema)try{let l=this._ajv.compile(e.outputSchema);this._cachedToolOutputValidators.set(e.name,l)}catch{}}getToolOutputValidator(I){return this._cachedToolOutputValidators.get(I)}async listTools(I,e){let l=await this.request({method:"tools/list",params:I},ZoI,e);return this.cacheToolOutputSchemas(l.tools),l}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var xK=class{createClient(I,e){return new fK(I,e)}};G();G();G();G();var BK=class extends Error{constructor(I,e){super(I),this.name="ParseError",this.type=e.type,this.field=e.field,this.value=e.value,this.line=e.line}};function ebI(t){}function zK(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:I=ebI,onError:e=ebI,onRetry:l=ebI,onComment:c}=t,n="",a=!0,s,r="",o="";function d(W){let N=a?W.replace(/^\xEF\xBB\xBF/,""):W,[Y,F]=OLe(`${n}${N}`);for(let g of Y)b(g);n=F,a=!1}function b(W){if(W===""){Z();return}if(W.startsWith(":")){c&&c(W.slice(W.startsWith(": ")?2:1));return}let N=W.indexOf(":");if(N!==-1){let Y=W.slice(0,N),F=W[N+1]===" "?2:1,g=W.slice(N+F);h(Y,g,W);return}h(W,"",W)}function h(W,N,Y){switch(W){case"event":o=N;break;case"data":r=`${r}${N}
1131
+ `,input_schema:{type:"object",properties:{question:{type:"string",description:"A question about the codebase. It should reference by name any topics, specific file names, and concepts that are relevant to the question and specify the desired output format."}},required:["question"]},callback:async l=>{let c,n=wf(t),a="",s="",r=n.split("/");if(r.length===2){[a,s]=r,e.info("Searching for repository insights");try{c=await KGI(l.question,a,s,I,e),e.info(`Blackbird results: ${c}`)}catch(o){e.error(`Error occurred while searching for repository insights: ${o}`)}}return{resultType:"success",textResultForLlm:c??"No results found.",toolTelemetry:{}}}}}async function B9I(t,I,e,l,c,n,a){let s=await O9I(t),r={cwd:s.shellTool.cwd,...t},o=await FEe(r,e,l),d=f9I(e)?[new BD(l,e,c,n,t,t.location,qz(),a).getSearch()]:[],b=t.splitEditingTools?R$(r,l,e):[eU(r,l,e)];return[s.shellTool,...s.otherTools??[],...o,...d,...b,fRI(r,I,e,l,c),ql(e,Hf)?wmI(r,l,c,e):void 0,t?.requireReasoning?y$(r):void 0,ql(e,HRI)?ERI:void 0,await QEe(t,e,l,c)].filter(h=>h!==void 0)}async function z9I(t,I){let e=await O9I(t),l={cwd:e.shellTool.cwd,...t},c=t.splitEditingTools?R$(l,I):[eU(l,I)];return[e.shellTool,...e.otherTools??[],...c,t?.requireReasoning?y$(l):void 0].filter(n=>n!==void 0)}async function yEe(t,I,e,l,c,n,a){return[...await B9I(t,I,e,l,c,n,a),CRI(t,l)]}var U9I=t=>({...Qh,supports:{...Qh.supports,reasoning:t?.thinkingMode?!0:Qh.supports?.reasoning}}),Qh={supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!1},createPR:{toolInit:B9I,jitInstructions:jGI},prDetails:{},respondToPRComment:{toolInit:yEe,jitInstructions:jGI}},S9I=t=>({"sweagent-capi":{"claude-3.5-sonnet":{...Qh,supports:{tool_choice:!1,reasoning:!1}},"claude-3.7-sonnet":{...Qh,supports:{tool_choice:!1,reasoning:!1,vision:!0}},"claude-sonnet-4":{...Qh,supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!0,vision:!0},toolConfigOverrides:{splitEditingTools:!0}},"claude-sonnet-4.5":{...Qh,supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!0,vision:!0},toolConfigOverrides:{splitEditingTools:!0}},oswe:{...Qh,supports:{tool_choice:!0,reasoning:!0,vision:!0}},"oswe-prime":{...Qh,supports:{tool_choice:!0,reasoning:!0,vision:!0}},"gpt-5":{...Qh,supports:{tool_choice:!0,reasoning:!0,parallel_tool_calls:!0,vision:!0,steering:!0}}}});async function O9I(t){let I=new OT(t);return{shellTool:I.getShellTool(),otherTools:[I.getWriteShellTool(),I.getReadShellTool(),I.getStopShellTool()]}}async function FEe(t,I,e){if(YsI(I,"cloud"))return[new l4(new uj(I,e)).getStoreMemory()];if(YsI(I,"local")){let l=new l4(new pj(t.location));return[l.getStoreMemory(),l.getReadMemory()]}return[]}async function QEe(t,I,e,l){if(t.includeCodeQLTool){let c=new Mr(e,l),n=I.swebench_base_commit??await c.getCurrentCommitHash(t.location);return new Dz(t,c,n,I,e).getCodeQLCheckerTool()}}G();G();import{Writable as T3e}from"stream";G();G();G();G();G();var R={};da(R,{BRAND:()=>_Ee,DIRTY:()=>M0,EMPTY_PATH:()=>wEe,INVALID:()=>ye,NEVER:()=>F1e,OK:()=>zs,ParseStatus:()=>Gs,Schema:()=>mt,ZodAny:()=>CY,ZodArray:()=>nu,ZodBigInt:()=>j0,ZodBoolean:()=>D0,ZodBranded:()=>e9,ZodCatch:()=>ny,ZodDate:()=>K0,ZodDefault:()=>cy,ZodDiscriminatedUnion:()=>SD,ZodEffects:()=>Kd,ZodEnum:()=>ty,ZodError:()=>LG,ZodFirstPartyTypeKind:()=>ge,ZodFunction:()=>MD,ZodIntersection:()=>$0,ZodIssueCode:()=>YI,ZodLazy:()=>Iy,ZodLiteral:()=>ey,ZodMap:()=>XH,ZodNaN:()=>HH,ZodNativeEnum:()=>ly,ZodNever:()=>mi,ZodNull:()=>q0,ZodNullable:()=>Xh,ZodNumber:()=>T0,ZodObject:()=>kG,ZodOptional:()=>jd,ZodParsedType:()=>jI,ZodPipeline:()=>t9,ZodPromise:()=>JY,ZodReadonly:()=>ay,ZodRecord:()=>OD,ZodSchema:()=>mt,ZodSet:()=>wH,ZodString:()=>vY,ZodSymbol:()=>gH,ZodTransformer:()=>Kd,ZodTuple:()=>Ah,ZodType:()=>mt,ZodUndefined:()=>P0,ZodUnion:()=>_0,ZodUnknown:()=>cu,ZodVoid:()=>AH,addIssueToContext:()=>xI,any:()=>eoI,array:()=>Us,bigint:()=>t1e,boolean:()=>fa,coerce:()=>l9,custom:()=>_9I,date:()=>l1e,datetimeRegex:()=>P9I,defaultErrorMap:()=>tu,discriminatedUnion:()=>loI,effect:()=>p1e,enum:()=>au,function:()=>i1e,getErrorMap:()=>yH,getParsedType:()=>gh,instanceof:()=>I1e,intersection:()=>o1e,isAborted:()=>zD,isAsync:()=>FH,isDirty:()=>UD,isValid:()=>EY,late:()=>$Ee,lazy:()=>m1e,literal:()=>sl,makeIssue:()=>I9,map:()=>d1e,nan:()=>e1e,nativeEnum:()=>h1e,never:()=>s1e,null:()=>a1e,nullable:()=>W1e,number:()=>wh,object:()=>Ae,objectUtil:()=>_GI,oboolean:()=>y1e,onumber:()=>R1e,optional:()=>u1e,ostring:()=>V1e,pipeline:()=>Y1e,preprocess:()=>N1e,promise:()=>Z1e,quotelessJson:()=>gEe,record:()=>TD,set:()=>b1e,setErrorMap:()=>XEe,strictObject:()=>G1e,string:()=>vI,symbol:()=>c1e,transformer:()=>p1e,tuple:()=>coI,undefined:()=>n1e,union:()=>Ss,unknown:()=>toI,util:()=>ft,void:()=>r1e});G();G();G();G();G();var ft;(function(t){t.assertEqual=c=>{};function I(c){}t.assertIs=I;function e(c){throw new Error}t.assertNever=e,t.arrayToEnum=c=>{let n={};for(let a of c)n[a]=a;return n},t.getValidEnumValues=c=>{let n=t.objectKeys(c).filter(s=>typeof c[c[s]]!="number"),a={};for(let s of n)a[s]=c[s];return t.objectValues(a)},t.objectValues=c=>t.objectKeys(c).map(function(n){return c[n]}),t.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{let n=[];for(let a in c)Object.prototype.hasOwnProperty.call(c,a)&&n.push(a);return n},t.find=(c,n)=>{for(let a of c)if(n(a))return a},t.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&Number.isFinite(c)&&Math.floor(c)===c;function l(c,n=" | "){return c.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}t.joinValues=l,t.jsonStringifyReplacer=(c,n)=>typeof n=="bigint"?n.toString():n})(ft||(ft={}));var _GI;(function(t){t.mergeShapes=(I,e)=>({...I,...e})})(_GI||(_GI={}));var jI=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gh=t=>{switch(typeof t){case"undefined":return jI.undefined;case"string":return jI.string;case"number":return Number.isNaN(t)?jI.nan:jI.number;case"boolean":return jI.boolean;case"function":return jI.function;case"bigint":return jI.bigint;case"symbol":return jI.symbol;case"object":return Array.isArray(t)?jI.array:t===null?jI.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?jI.promise:typeof Map<"u"&&t instanceof Map?jI.map:typeof Set<"u"&&t instanceof Set?jI.set:typeof Date<"u"&&t instanceof Date?jI.date:jI.object;default:return jI.unknown}};var YI=ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gEe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),LG=class t extends Error{get errors(){return this.issues}constructor(I){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=I}format(I){let e=I||function(n){return n.message},l={_errors:[]},c=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(c);else if(a.code==="invalid_return_type")c(a.returnTypeError);else if(a.code==="invalid_arguments")c(a.argumentsError);else if(a.path.length===0)l._errors.push(e(a));else{let s=l,r=0;for(;r<a.path.length;){let o=a.path[r];r===a.path.length-1?(s[o]=s[o]||{_errors:[]},s[o]._errors.push(e(a))):s[o]=s[o]||{_errors:[]},s=s[o],r++}}};return c(this),l}static assert(I){if(!(I instanceof t))throw new Error(`Not a ZodError: ${I}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ft.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(I=e=>e.message){let e={},l=[];for(let c of this.issues)if(c.path.length>0){let n=c.path[0];e[n]=e[n]||[],e[n].push(I(c))}else l.push(I(c));return{formErrors:l,fieldErrors:e}}get formErrors(){return this.flatten()}};LG.create=t=>new LG(t);var AEe=(t,I)=>{let e;switch(t.code){case YI.invalid_type:t.received===jI.undefined?e="Required":e=`Expected ${t.expected}, received ${t.received}`;break;case YI.invalid_literal:e=`Invalid literal value, expected ${JSON.stringify(t.expected,ft.jsonStringifyReplacer)}`;break;case YI.unrecognized_keys:e=`Unrecognized key(s) in object: ${ft.joinValues(t.keys,", ")}`;break;case YI.invalid_union:e="Invalid input";break;case YI.invalid_union_discriminator:e=`Invalid discriminator value. Expected ${ft.joinValues(t.options)}`;break;case YI.invalid_enum_value:e=`Invalid enum value. Expected ${ft.joinValues(t.options)}, received '${t.received}'`;break;case YI.invalid_arguments:e="Invalid function arguments";break;case YI.invalid_return_type:e="Invalid function return type";break;case YI.invalid_date:e="Invalid date";break;case YI.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(e=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(e=`${e} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?e=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?e=`Invalid input: must end with "${t.validation.endsWith}"`:ft.assertNever(t.validation):t.validation!=="regex"?e=`Invalid ${t.validation}`:e="Invalid";break;case YI.too_small:t.type==="array"?e=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?e=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?e=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?e=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?e=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:e="Invalid input";break;case YI.too_big:t.type==="array"?e=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?e=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?e=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?e=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?e=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:e="Invalid input";break;case YI.custom:e="Invalid input";break;case YI.invalid_intersection_types:e="Intersection results could not be merged";break;case YI.not_multiple_of:e=`Number must be a multiple of ${t.multipleOf}`;break;case YI.not_finite:e="Number must be finite";break;default:e=I.defaultError,ft.assertNever(t)}return{message:e}},tu=AEe;var M9I=tu;function XEe(t){M9I=t}function yH(){return M9I}G();var I9=t=>{let{data:I,path:e,errorMaps:l,issueData:c}=t,n=[...e,...c.path||[]],a={...c,path:n};if(c.message!==void 0)return{...c,path:n,message:c.message};let s="",r=l.filter(o=>!!o).slice().reverse();for(let o of r)s=o(a,{data:I,defaultError:s}).message;return{...c,path:n,message:s}},wEe=[];function xI(t,I){let e=yH(),l=I9({issueData:I,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,e,e===tu?void 0:tu].filter(c=>!!c)});t.common.issues.push(l)}var Gs=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(I,e){let l=[];for(let c of e){if(c.status==="aborted")return ye;c.status==="dirty"&&I.dirty(),l.push(c.value)}return{status:I.value,value:l}}static async mergeObjectAsync(I,e){let l=[];for(let c of e){let n=await c.key,a=await c.value;l.push({key:n,value:a})}return t.mergeObjectSync(I,l)}static mergeObjectSync(I,e){let l={};for(let c of e){let{key:n,value:a}=c;if(n.status==="aborted"||a.status==="aborted")return ye;n.status==="dirty"&&I.dirty(),a.status==="dirty"&&I.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||c.alwaysSet)&&(l[n.value]=a.value)}return{status:I.value,value:l}}},ye=Object.freeze({status:"aborted"}),M0=t=>({status:"dirty",value:t}),zs=t=>({status:"valid",value:t}),zD=t=>t.status==="aborted",UD=t=>t.status==="dirty",EY=t=>t.status==="valid",FH=t=>typeof Promise<"u"&&t instanceof Promise;G();G();var ae;(function(t){t.errToObj=I=>typeof I=="string"?{message:I}:I||{},t.toString=I=>typeof I=="string"?I:I?.message})(ae||(ae={}));var Dd=class{constructor(I,e,l,c){this._cachedPath=[],this.parent=I,this.data=e,this._path=l,this._key=c}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},T9I=(t,I)=>{if(EY(I))return{success:!0,data:I.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new LG(t.common.issues);return this._error=e,this._error}}};function nt(t){if(!t)return{};let{errorMap:I,invalid_type_error:e,required_error:l,description:c}=t;if(I&&(e||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return I?{errorMap:I,description:c}:{errorMap:(a,s)=>{let{message:r}=t;return a.code==="invalid_enum_value"?{message:r??s.defaultError}:typeof s.data>"u"?{message:r??l??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:r??e??s.defaultError}},description:c}}var mt=class{get description(){return this._def.description}_getType(I){return gh(I.data)}_getOrReturnCtx(I,e){return e||{common:I.parent.common,data:I.data,parsedType:gh(I.data),schemaErrorMap:this._def.errorMap,path:I.path,parent:I.parent}}_processInputParams(I){return{status:new Gs,ctx:{common:I.parent.common,data:I.data,parsedType:gh(I.data),schemaErrorMap:this._def.errorMap,path:I.path,parent:I.parent}}}_parseSync(I){let e=this._parse(I);if(FH(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(I){let e=this._parse(I);return Promise.resolve(e)}parse(I,e){let l=this.safeParse(I,e);if(l.success)return l.data;throw l.error}safeParse(I,e){let l={common:{issues:[],async:e?.async??!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:I,parsedType:gh(I)},c=this._parseSync({data:I,path:l.path,parent:l});return T9I(l,c)}"~validate"(I){let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:I,parsedType:gh(I)};if(!this["~standard"].async)try{let l=this._parseSync({data:I,path:[],parent:e});return EY(l)?{value:l.value}:{issues:e.common.issues}}catch(l){l?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:I,path:[],parent:e}).then(l=>EY(l)?{value:l.value}:{issues:e.common.issues})}async parseAsync(I,e){let l=await this.safeParseAsync(I,e);if(l.success)return l.data;throw l.error}async safeParseAsync(I,e){let l={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:I,parsedType:gh(I)},c=this._parse({data:I,path:l.path,parent:l}),n=await(FH(c)?c:Promise.resolve(c));return T9I(l,n)}refine(I,e){let l=c=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(c):e;return this._refinement((c,n)=>{let a=I(c),s=()=>n.addIssue({code:YI.custom,...l(c)});return typeof Promise<"u"&&a instanceof Promise?a.then(r=>r?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(I,e){return this._refinement((l,c)=>I(l)?!0:(c.addIssue(typeof e=="function"?e(l,c):e),!1))}_refinement(I){return new Kd({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:I}})}superRefine(I){return this._refinement(I)}constructor(I){this.spa=this.safeParseAsync,this._def=I,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return jd.create(this,this._def)}nullable(){return Xh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nu.create(this)}promise(){return JY.create(this,this._def)}or(I){return _0.create([this,I],this._def)}and(I){return $0.create(this,I,this._def)}transform(I){return new Kd({...nt(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:I}})}default(I){let e=typeof I=="function"?I:()=>I;return new cy({...nt(this._def),innerType:this,defaultValue:e,typeName:ge.ZodDefault})}brand(){return new e9({typeName:ge.ZodBranded,type:this,...nt(this._def)})}catch(I){let e=typeof I=="function"?I:()=>I;return new ny({...nt(this._def),innerType:this,catchValue:e,typeName:ge.ZodCatch})}describe(I){let e=this.constructor;return new e({...this._def,description:I})}pipe(I){return t9.create(this,I)}readonly(){return ay.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},HEe=/^c[^\s-]{8,}$/i,EEe=/^[0-9a-z]+$/,vEe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,CEe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,JEe=/^[a-z0-9_-]{21}$/i,LEe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,kEe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fEe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xEe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$GI,BEe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zEe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,UEe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,SEe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,OEe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MEe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,D9I="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",TEe=new RegExp(`^${D9I}$`);function K9I(t){let I="[0-5]\\d";t.precision?I=`${I}\\.\\d{${t.precision}}`:t.precision==null&&(I=`${I}(\\.\\d+)?`);let e=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${I})${e}`}function jEe(t){return new RegExp(`^${K9I(t)}$`)}function P9I(t){let I=`${D9I}T${K9I(t)}`,e=[];return e.push(t.local?"Z?":"Z"),t.offset&&e.push("([+-]\\d{2}:?\\d{2})"),I=`${I}(${e.join("|")})`,new RegExp(`^${I}$`)}function DEe(t,I){return!!((I==="v4"||!I)&&BEe.test(t)||(I==="v6"||!I)&&UEe.test(t))}function KEe(t,I){if(!LEe.test(t))return!1;try{let[e]=t.split(".");if(!e)return!1;let l=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),c=JSON.parse(atob(l));return!(typeof c!="object"||c===null||"typ"in c&&c?.typ!=="JWT"||!c.alg||I&&c.alg!==I)}catch{return!1}}function PEe(t,I){return!!((I==="v4"||!I)&&zEe.test(t)||(I==="v6"||!I)&&SEe.test(t))}var vY=class t extends mt{_parse(I){if(this._def.coerce&&(I.data=String(I.data)),this._getType(I)!==jI.string){let n=this._getOrReturnCtx(I);return xI(n,{code:YI.invalid_type,expected:jI.string,received:n.parsedType}),ye}let l=new Gs,c;for(let n of this._def.checks)if(n.kind==="min")I.data.length<n.value&&(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),l.dirty());else if(n.kind==="max")I.data.length>n.value&&(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),l.dirty());else if(n.kind==="length"){let a=I.data.length>n.value,s=I.data.length<n.value;(a||s)&&(c=this._getOrReturnCtx(I,c),a?xI(c,{code:YI.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&xI(c,{code:YI.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),l.dirty())}else if(n.kind==="email")fEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"email",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="emoji")$GI||($GI=new RegExp(xEe,"u")),$GI.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"emoji",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="uuid")CEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"uuid",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="nanoid")JEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"nanoid",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="cuid")HEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"cuid",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="cuid2")EEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"cuid2",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="ulid")vEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"ulid",code:YI.invalid_string,message:n.message}),l.dirty());else if(n.kind==="url")try{new URL(I.data)}catch{c=this._getOrReturnCtx(I,c),xI(c,{validation:"url",code:YI.invalid_string,message:n.message}),l.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"regex",code:YI.invalid_string,message:n.message}),l.dirty())):n.kind==="trim"?I.data=I.data.trim():n.kind==="includes"?I.data.includes(n.value,n.position)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),l.dirty()):n.kind==="toLowerCase"?I.data=I.data.toLowerCase():n.kind==="toUpperCase"?I.data=I.data.toUpperCase():n.kind==="startsWith"?I.data.startsWith(n.value)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:{startsWith:n.value},message:n.message}),l.dirty()):n.kind==="endsWith"?I.data.endsWith(n.value)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:{endsWith:n.value},message:n.message}),l.dirty()):n.kind==="datetime"?P9I(n).test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:"datetime",message:n.message}),l.dirty()):n.kind==="date"?TEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:"date",message:n.message}),l.dirty()):n.kind==="time"?jEe(n).test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.invalid_string,validation:"time",message:n.message}),l.dirty()):n.kind==="duration"?kEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"duration",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="ip"?DEe(I.data,n.version)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"ip",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="jwt"?KEe(I.data,n.alg)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"jwt",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="cidr"?PEe(I.data,n.version)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"cidr",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="base64"?OEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"base64",code:YI.invalid_string,message:n.message}),l.dirty()):n.kind==="base64url"?MEe.test(I.data)||(c=this._getOrReturnCtx(I,c),xI(c,{validation:"base64url",code:YI.invalid_string,message:n.message}),l.dirty()):ft.assertNever(n);return{status:l.value,value:I.data}}_regex(I,e,l){return this.refinement(c=>I.test(c),{validation:e,code:YI.invalid_string,...ae.errToObj(l)})}_addCheck(I){return new t({...this._def,checks:[...this._def.checks,I]})}email(I){return this._addCheck({kind:"email",...ae.errToObj(I)})}url(I){return this._addCheck({kind:"url",...ae.errToObj(I)})}emoji(I){return this._addCheck({kind:"emoji",...ae.errToObj(I)})}uuid(I){return this._addCheck({kind:"uuid",...ae.errToObj(I)})}nanoid(I){return this._addCheck({kind:"nanoid",...ae.errToObj(I)})}cuid(I){return this._addCheck({kind:"cuid",...ae.errToObj(I)})}cuid2(I){return this._addCheck({kind:"cuid2",...ae.errToObj(I)})}ulid(I){return this._addCheck({kind:"ulid",...ae.errToObj(I)})}base64(I){return this._addCheck({kind:"base64",...ae.errToObj(I)})}base64url(I){return this._addCheck({kind:"base64url",...ae.errToObj(I)})}jwt(I){return this._addCheck({kind:"jwt",...ae.errToObj(I)})}ip(I){return this._addCheck({kind:"ip",...ae.errToObj(I)})}cidr(I){return this._addCheck({kind:"cidr",...ae.errToObj(I)})}datetime(I){return typeof I=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:I}):this._addCheck({kind:"datetime",precision:typeof I?.precision>"u"?null:I?.precision,offset:I?.offset??!1,local:I?.local??!1,...ae.errToObj(I?.message)})}date(I){return this._addCheck({kind:"date",message:I})}time(I){return typeof I=="string"?this._addCheck({kind:"time",precision:null,message:I}):this._addCheck({kind:"time",precision:typeof I?.precision>"u"?null:I?.precision,...ae.errToObj(I?.message)})}duration(I){return this._addCheck({kind:"duration",...ae.errToObj(I)})}regex(I,e){return this._addCheck({kind:"regex",regex:I,...ae.errToObj(e)})}includes(I,e){return this._addCheck({kind:"includes",value:I,position:e?.position,...ae.errToObj(e?.message)})}startsWith(I,e){return this._addCheck({kind:"startsWith",value:I,...ae.errToObj(e)})}endsWith(I,e){return this._addCheck({kind:"endsWith",value:I,...ae.errToObj(e)})}min(I,e){return this._addCheck({kind:"min",value:I,...ae.errToObj(e)})}max(I,e){return this._addCheck({kind:"max",value:I,...ae.errToObj(e)})}length(I,e){return this._addCheck({kind:"length",value:I,...ae.errToObj(e)})}nonempty(I){return this.min(1,ae.errToObj(I))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(I=>I.kind==="datetime")}get isDate(){return!!this._def.checks.find(I=>I.kind==="date")}get isTime(){return!!this._def.checks.find(I=>I.kind==="time")}get isDuration(){return!!this._def.checks.find(I=>I.kind==="duration")}get isEmail(){return!!this._def.checks.find(I=>I.kind==="email")}get isURL(){return!!this._def.checks.find(I=>I.kind==="url")}get isEmoji(){return!!this._def.checks.find(I=>I.kind==="emoji")}get isUUID(){return!!this._def.checks.find(I=>I.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(I=>I.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(I=>I.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(I=>I.kind==="cuid2")}get isULID(){return!!this._def.checks.find(I=>I.kind==="ulid")}get isIP(){return!!this._def.checks.find(I=>I.kind==="ip")}get isCIDR(){return!!this._def.checks.find(I=>I.kind==="cidr")}get isBase64(){return!!this._def.checks.find(I=>I.kind==="base64")}get isBase64url(){return!!this._def.checks.find(I=>I.kind==="base64url")}get minLength(){let I=null;for(let e of this._def.checks)e.kind==="min"&&(I===null||e.value>I)&&(I=e.value);return I}get maxLength(){let I=null;for(let e of this._def.checks)e.kind==="max"&&(I===null||e.value<I)&&(I=e.value);return I}};vY.create=t=>new vY({checks:[],typeName:ge.ZodString,coerce:t?.coerce??!1,...nt(t)});function qEe(t,I){let e=(t.toString().split(".")[1]||"").length,l=(I.toString().split(".")[1]||"").length,c=e>l?e:l,n=Number.parseInt(t.toFixed(c).replace(".","")),a=Number.parseInt(I.toFixed(c).replace(".",""));return n%a/10**c}var T0=class t extends mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(I){if(this._def.coerce&&(I.data=Number(I.data)),this._getType(I)!==jI.number){let n=this._getOrReturnCtx(I);return xI(n,{code:YI.invalid_type,expected:jI.number,received:n.parsedType}),ye}let l,c=new Gs;for(let n of this._def.checks)n.kind==="int"?ft.isInteger(I.data)||(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.invalid_type,expected:"integer",received:"float",message:n.message}),c.dirty()):n.kind==="min"?(n.inclusive?I.data<n.value:I.data<=n.value)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),c.dirty()):n.kind==="max"?(n.inclusive?I.data>n.value:I.data>=n.value)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),c.dirty()):n.kind==="multipleOf"?qEe(I.data,n.value)!==0&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.not_multiple_of,multipleOf:n.value,message:n.message}),c.dirty()):n.kind==="finite"?Number.isFinite(I.data)||(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.not_finite,message:n.message}),c.dirty()):ft.assertNever(n);return{status:c.value,value:I.data}}gte(I,e){return this.setLimit("min",I,!0,ae.toString(e))}gt(I,e){return this.setLimit("min",I,!1,ae.toString(e))}lte(I,e){return this.setLimit("max",I,!0,ae.toString(e))}lt(I,e){return this.setLimit("max",I,!1,ae.toString(e))}setLimit(I,e,l,c){return new t({...this._def,checks:[...this._def.checks,{kind:I,value:e,inclusive:l,message:ae.toString(c)}]})}_addCheck(I){return new t({...this._def,checks:[...this._def.checks,I]})}int(I){return this._addCheck({kind:"int",message:ae.toString(I)})}positive(I){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ae.toString(I)})}negative(I){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ae.toString(I)})}nonpositive(I){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ae.toString(I)})}nonnegative(I){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ae.toString(I)})}multipleOf(I,e){return this._addCheck({kind:"multipleOf",value:I,message:ae.toString(e)})}finite(I){return this._addCheck({kind:"finite",message:ae.toString(I)})}safe(I){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ae.toString(I)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ae.toString(I)})}get minValue(){let I=null;for(let e of this._def.checks)e.kind==="min"&&(I===null||e.value>I)&&(I=e.value);return I}get maxValue(){let I=null;for(let e of this._def.checks)e.kind==="max"&&(I===null||e.value<I)&&(I=e.value);return I}get isInt(){return!!this._def.checks.find(I=>I.kind==="int"||I.kind==="multipleOf"&&ft.isInteger(I.value))}get isFinite(){let I=null,e=null;for(let l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(e===null||l.value>e)&&(e=l.value):l.kind==="max"&&(I===null||l.value<I)&&(I=l.value)}return Number.isFinite(e)&&Number.isFinite(I)}};T0.create=t=>new T0({checks:[],typeName:ge.ZodNumber,coerce:t?.coerce||!1,...nt(t)});var j0=class t extends mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(I){if(this._def.coerce)try{I.data=BigInt(I.data)}catch{return this._getInvalidInput(I)}if(this._getType(I)!==jI.bigint)return this._getInvalidInput(I);let l,c=new Gs;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?I.data<n.value:I.data<=n.value)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),c.dirty()):n.kind==="max"?(n.inclusive?I.data>n.value:I.data>=n.value)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),c.dirty()):n.kind==="multipleOf"?I.data%n.value!==BigInt(0)&&(l=this._getOrReturnCtx(I,l),xI(l,{code:YI.not_multiple_of,multipleOf:n.value,message:n.message}),c.dirty()):ft.assertNever(n);return{status:c.value,value:I.data}}_getInvalidInput(I){let e=this._getOrReturnCtx(I);return xI(e,{code:YI.invalid_type,expected:jI.bigint,received:e.parsedType}),ye}gte(I,e){return this.setLimit("min",I,!0,ae.toString(e))}gt(I,e){return this.setLimit("min",I,!1,ae.toString(e))}lte(I,e){return this.setLimit("max",I,!0,ae.toString(e))}lt(I,e){return this.setLimit("max",I,!1,ae.toString(e))}setLimit(I,e,l,c){return new t({...this._def,checks:[...this._def.checks,{kind:I,value:e,inclusive:l,message:ae.toString(c)}]})}_addCheck(I){return new t({...this._def,checks:[...this._def.checks,I]})}positive(I){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ae.toString(I)})}negative(I){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ae.toString(I)})}nonpositive(I){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ae.toString(I)})}nonnegative(I){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ae.toString(I)})}multipleOf(I,e){return this._addCheck({kind:"multipleOf",value:I,message:ae.toString(e)})}get minValue(){let I=null;for(let e of this._def.checks)e.kind==="min"&&(I===null||e.value>I)&&(I=e.value);return I}get maxValue(){let I=null;for(let e of this._def.checks)e.kind==="max"&&(I===null||e.value<I)&&(I=e.value);return I}};j0.create=t=>new j0({checks:[],typeName:ge.ZodBigInt,coerce:t?.coerce??!1,...nt(t)});var D0=class extends mt{_parse(I){if(this._def.coerce&&(I.data=!!I.data),this._getType(I)!==jI.boolean){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.boolean,received:l.parsedType}),ye}return zs(I.data)}};D0.create=t=>new D0({typeName:ge.ZodBoolean,coerce:t?.coerce||!1,...nt(t)});var K0=class t extends mt{_parse(I){if(this._def.coerce&&(I.data=new Date(I.data)),this._getType(I)!==jI.date){let n=this._getOrReturnCtx(I);return xI(n,{code:YI.invalid_type,expected:jI.date,received:n.parsedType}),ye}if(Number.isNaN(I.data.getTime())){let n=this._getOrReturnCtx(I);return xI(n,{code:YI.invalid_date}),ye}let l=new Gs,c;for(let n of this._def.checks)n.kind==="min"?I.data.getTime()<n.value&&(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),l.dirty()):n.kind==="max"?I.data.getTime()>n.value&&(c=this._getOrReturnCtx(I,c),xI(c,{code:YI.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),l.dirty()):ft.assertNever(n);return{status:l.value,value:new Date(I.data.getTime())}}_addCheck(I){return new t({...this._def,checks:[...this._def.checks,I]})}min(I,e){return this._addCheck({kind:"min",value:I.getTime(),message:ae.toString(e)})}max(I,e){return this._addCheck({kind:"max",value:I.getTime(),message:ae.toString(e)})}get minDate(){let I=null;for(let e of this._def.checks)e.kind==="min"&&(I===null||e.value>I)&&(I=e.value);return I!=null?new Date(I):null}get maxDate(){let I=null;for(let e of this._def.checks)e.kind==="max"&&(I===null||e.value<I)&&(I=e.value);return I!=null?new Date(I):null}};K0.create=t=>new K0({checks:[],coerce:t?.coerce||!1,typeName:ge.ZodDate,...nt(t)});var gH=class extends mt{_parse(I){if(this._getType(I)!==jI.symbol){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.symbol,received:l.parsedType}),ye}return zs(I.data)}};gH.create=t=>new gH({typeName:ge.ZodSymbol,...nt(t)});var P0=class extends mt{_parse(I){if(this._getType(I)!==jI.undefined){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.undefined,received:l.parsedType}),ye}return zs(I.data)}};P0.create=t=>new P0({typeName:ge.ZodUndefined,...nt(t)});var q0=class extends mt{_parse(I){if(this._getType(I)!==jI.null){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.null,received:l.parsedType}),ye}return zs(I.data)}};q0.create=t=>new q0({typeName:ge.ZodNull,...nt(t)});var CY=class extends mt{constructor(){super(...arguments),this._any=!0}_parse(I){return zs(I.data)}};CY.create=t=>new CY({typeName:ge.ZodAny,...nt(t)});var cu=class extends mt{constructor(){super(...arguments),this._unknown=!0}_parse(I){return zs(I.data)}};cu.create=t=>new cu({typeName:ge.ZodUnknown,...nt(t)});var mi=class extends mt{_parse(I){let e=this._getOrReturnCtx(I);return xI(e,{code:YI.invalid_type,expected:jI.never,received:e.parsedType}),ye}};mi.create=t=>new mi({typeName:ge.ZodNever,...nt(t)});var AH=class extends mt{_parse(I){if(this._getType(I)!==jI.undefined){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.void,received:l.parsedType}),ye}return zs(I.data)}};AH.create=t=>new AH({typeName:ge.ZodVoid,...nt(t)});var nu=class t extends mt{_parse(I){let{ctx:e,status:l}=this._processInputParams(I),c=this._def;if(e.parsedType!==jI.array)return xI(e,{code:YI.invalid_type,expected:jI.array,received:e.parsedType}),ye;if(c.exactLength!==null){let a=e.data.length>c.exactLength.value,s=e.data.length<c.exactLength.value;(a||s)&&(xI(e,{code:a?YI.too_big:YI.too_small,minimum:s?c.exactLength.value:void 0,maximum:a?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),l.dirty())}if(c.minLength!==null&&e.data.length<c.minLength.value&&(xI(e,{code:YI.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),l.dirty()),c.maxLength!==null&&e.data.length>c.maxLength.value&&(xI(e,{code:YI.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),l.dirty()),e.common.async)return Promise.all([...e.data].map((a,s)=>c.type._parseAsync(new Dd(e,a,e.path,s)))).then(a=>Gs.mergeArray(l,a));let n=[...e.data].map((a,s)=>c.type._parseSync(new Dd(e,a,e.path,s)));return Gs.mergeArray(l,n)}get element(){return this._def.type}min(I,e){return new t({...this._def,minLength:{value:I,message:ae.toString(e)}})}max(I,e){return new t({...this._def,maxLength:{value:I,message:ae.toString(e)}})}length(I,e){return new t({...this._def,exactLength:{value:I,message:ae.toString(e)}})}nonempty(I){return this.min(1,I)}};nu.create=(t,I)=>new nu({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...nt(I)});function QH(t){if(t instanceof kG){let I={};for(let e in t.shape){let l=t.shape[e];I[e]=jd.create(QH(l))}return new kG({...t._def,shape:()=>I})}else return t instanceof nu?new nu({...t._def,type:QH(t.element)}):t instanceof jd?jd.create(QH(t.unwrap())):t instanceof Xh?Xh.create(QH(t.unwrap())):t instanceof Ah?Ah.create(t.items.map(I=>QH(I))):t}var kG=class t extends mt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let I=this._def.shape(),e=ft.objectKeys(I);return this._cached={shape:I,keys:e},this._cached}_parse(I){if(this._getType(I)!==jI.object){let o=this._getOrReturnCtx(I);return xI(o,{code:YI.invalid_type,expected:jI.object,received:o.parsedType}),ye}let{status:l,ctx:c}=this._processInputParams(I),{shape:n,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof mi&&this._def.unknownKeys==="strip"))for(let o in c.data)a.includes(o)||s.push(o);let r=[];for(let o of a){let d=n[o],b=c.data[o];r.push({key:{status:"valid",value:o},value:d._parse(new Dd(c,b,c.path,o)),alwaysSet:o in c.data})}if(this._def.catchall instanceof mi){let o=this._def.unknownKeys;if(o==="passthrough")for(let d of s)r.push({key:{status:"valid",value:d},value:{status:"valid",value:c.data[d]}});else if(o==="strict")s.length>0&&(xI(c,{code:YI.unrecognized_keys,keys:s}),l.dirty());else if(o!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let o=this._def.catchall;for(let d of s){let b=c.data[d];r.push({key:{status:"valid",value:d},value:o._parse(new Dd(c,b,c.path,d)),alwaysSet:d in c.data})}}return c.common.async?Promise.resolve().then(async()=>{let o=[];for(let d of r){let b=await d.key,h=await d.value;o.push({key:b,value:h,alwaysSet:d.alwaysSet})}return o}).then(o=>Gs.mergeObjectSync(l,o)):Gs.mergeObjectSync(l,r)}get shape(){return this._def.shape()}strict(I){return ae.errToObj,new t({...this._def,unknownKeys:"strict",...I!==void 0?{errorMap:(e,l)=>{let c=this._def.errorMap?.(e,l).message??l.defaultError;return e.code==="unrecognized_keys"?{message:ae.errToObj(I).message??c}:{message:c}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(I){return new t({...this._def,shape:()=>({...this._def.shape(),...I})})}merge(I){return new t({unknownKeys:I._def.unknownKeys,catchall:I._def.catchall,shape:()=>({...this._def.shape(),...I._def.shape()}),typeName:ge.ZodObject})}setKey(I,e){return this.augment({[I]:e})}catchall(I){return new t({...this._def,catchall:I})}pick(I){let e={};for(let l of ft.objectKeys(I))I[l]&&this.shape[l]&&(e[l]=this.shape[l]);return new t({...this._def,shape:()=>e})}omit(I){let e={};for(let l of ft.objectKeys(this.shape))I[l]||(e[l]=this.shape[l]);return new t({...this._def,shape:()=>e})}deepPartial(){return QH(this)}partial(I){let e={};for(let l of ft.objectKeys(this.shape)){let c=this.shape[l];I&&!I[l]?e[l]=c:e[l]=c.optional()}return new t({...this._def,shape:()=>e})}required(I){let e={};for(let l of ft.objectKeys(this.shape))if(I&&!I[l])e[l]=this.shape[l];else{let n=this.shape[l];for(;n instanceof jd;)n=n._def.innerType;e[l]=n}return new t({...this._def,shape:()=>e})}keyof(){return q9I(ft.objectKeys(this.shape))}};kG.create=(t,I)=>new kG({shape:()=>t,unknownKeys:"strip",catchall:mi.create(),typeName:ge.ZodObject,...nt(I)});kG.strictCreate=(t,I)=>new kG({shape:()=>t,unknownKeys:"strict",catchall:mi.create(),typeName:ge.ZodObject,...nt(I)});kG.lazycreate=(t,I)=>new kG({shape:t,unknownKeys:"strip",catchall:mi.create(),typeName:ge.ZodObject,...nt(I)});var _0=class extends mt{_parse(I){let{ctx:e}=this._processInputParams(I),l=this._def.options;function c(n){for(let s of n)if(s.result.status==="valid")return s.result;for(let s of n)if(s.result.status==="dirty")return e.common.issues.push(...s.ctx.common.issues),s.result;let a=n.map(s=>new LG(s.ctx.common.issues));return xI(e,{code:YI.invalid_union,unionErrors:a}),ye}if(e.common.async)return Promise.all(l.map(async n=>{let a={...e,common:{...e.common,issues:[]},parent:null};return{result:await n._parseAsync({data:e.data,path:e.path,parent:a}),ctx:a}})).then(c);{let n,a=[];for(let r of l){let o={...e,common:{...e.common,issues:[]},parent:null},d=r._parseSync({data:e.data,path:e.path,parent:o});if(d.status==="valid")return d;d.status==="dirty"&&!n&&(n={result:d,ctx:o}),o.common.issues.length&&a.push(o.common.issues)}if(n)return e.common.issues.push(...n.ctx.common.issues),n.result;let s=a.map(r=>new LG(r));return xI(e,{code:YI.invalid_union,unionErrors:s}),ye}}get options(){return this._def.options}};_0.create=(t,I)=>new _0({options:t,typeName:ge.ZodUnion,...nt(I)});var lu=t=>t instanceof Iy?lu(t.schema):t instanceof Kd?lu(t.innerType()):t instanceof ey?[t.value]:t instanceof ty?t.options:t instanceof ly?ft.objectValues(t.enum):t instanceof cy?lu(t._def.innerType):t instanceof P0?[void 0]:t instanceof q0?[null]:t instanceof jd?[void 0,...lu(t.unwrap())]:t instanceof Xh?[null,...lu(t.unwrap())]:t instanceof e9||t instanceof ay?lu(t.unwrap()):t instanceof ny?lu(t._def.innerType):[],SD=class t extends mt{_parse(I){let{ctx:e}=this._processInputParams(I);if(e.parsedType!==jI.object)return xI(e,{code:YI.invalid_type,expected:jI.object,received:e.parsedType}),ye;let l=this.discriminator,c=e.data[l],n=this.optionsMap.get(c);return n?e.common.async?n._parseAsync({data:e.data,path:e.path,parent:e}):n._parseSync({data:e.data,path:e.path,parent:e}):(xI(e,{code:YI.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[l]}),ye)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(I,e,l){let c=new Map;for(let n of e){let a=lu(n.shape[I]);if(!a.length)throw new Error(`A discriminator value for key \`${I}\` could not be extracted from all schema options`);for(let s of a){if(c.has(s))throw new Error(`Discriminator property ${String(I)} has duplicate value ${String(s)}`);c.set(s,n)}}return new t({typeName:ge.ZodDiscriminatedUnion,discriminator:I,options:e,optionsMap:c,...nt(l)})}};function IoI(t,I){let e=gh(t),l=gh(I);if(t===I)return{valid:!0,data:t};if(e===jI.object&&l===jI.object){let c=ft.objectKeys(I),n=ft.objectKeys(t).filter(s=>c.indexOf(s)!==-1),a={...t,...I};for(let s of n){let r=IoI(t[s],I[s]);if(!r.valid)return{valid:!1};a[s]=r.data}return{valid:!0,data:a}}else if(e===jI.array&&l===jI.array){if(t.length!==I.length)return{valid:!1};let c=[];for(let n=0;n<t.length;n++){let a=t[n],s=I[n],r=IoI(a,s);if(!r.valid)return{valid:!1};c.push(r.data)}return{valid:!0,data:c}}else return e===jI.date&&l===jI.date&&+t==+I?{valid:!0,data:t}:{valid:!1}}var $0=class extends mt{_parse(I){let{status:e,ctx:l}=this._processInputParams(I),c=(n,a)=>{if(zD(n)||zD(a))return ye;let s=IoI(n.value,a.value);return s.valid?((UD(n)||UD(a))&&e.dirty(),{status:e.value,value:s.data}):(xI(l,{code:YI.invalid_intersection_types}),ye)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([n,a])=>c(n,a)):c(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}};$0.create=(t,I,e)=>new $0({left:t,right:I,typeName:ge.ZodIntersection,...nt(e)});var Ah=class t extends mt{_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.parsedType!==jI.array)return xI(l,{code:YI.invalid_type,expected:jI.array,received:l.parsedType}),ye;if(l.data.length<this._def.items.length)return xI(l,{code:YI.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ye;!this._def.rest&&l.data.length>this._def.items.length&&(xI(l,{code:YI.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let n=[...l.data].map((a,s)=>{let r=this._def.items[s]||this._def.rest;return r?r._parse(new Dd(l,a,l.path,s)):null}).filter(a=>!!a);return l.common.async?Promise.all(n).then(a=>Gs.mergeArray(e,a)):Gs.mergeArray(e,n)}get items(){return this._def.items}rest(I){return new t({...this._def,rest:I})}};Ah.create=(t,I)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ah({items:t,typeName:ge.ZodTuple,rest:null,...nt(I)})};var OD=class t extends mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.parsedType!==jI.object)return xI(l,{code:YI.invalid_type,expected:jI.object,received:l.parsedType}),ye;let c=[],n=this._def.keyType,a=this._def.valueType;for(let s in l.data)c.push({key:n._parse(new Dd(l,s,l.path,s)),value:a._parse(new Dd(l,l.data[s],l.path,s)),alwaysSet:s in l.data});return l.common.async?Gs.mergeObjectAsync(e,c):Gs.mergeObjectSync(e,c)}get element(){return this._def.valueType}static create(I,e,l){return e instanceof mt?new t({keyType:I,valueType:e,typeName:ge.ZodRecord,...nt(l)}):new t({keyType:vY.create(),valueType:I,typeName:ge.ZodRecord,...nt(e)})}},XH=class extends mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.parsedType!==jI.map)return xI(l,{code:YI.invalid_type,expected:jI.map,received:l.parsedType}),ye;let c=this._def.keyType,n=this._def.valueType,a=[...l.data.entries()].map(([s,r],o)=>({key:c._parse(new Dd(l,s,l.path,[o,"key"])),value:n._parse(new Dd(l,r,l.path,[o,"value"]))}));if(l.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let r of a){let o=await r.key,d=await r.value;if(o.status==="aborted"||d.status==="aborted")return ye;(o.status==="dirty"||d.status==="dirty")&&e.dirty(),s.set(o.value,d.value)}return{status:e.value,value:s}})}else{let s=new Map;for(let r of a){let o=r.key,d=r.value;if(o.status==="aborted"||d.status==="aborted")return ye;(o.status==="dirty"||d.status==="dirty")&&e.dirty(),s.set(o.value,d.value)}return{status:e.value,value:s}}}};XH.create=(t,I,e)=>new XH({valueType:I,keyType:t,typeName:ge.ZodMap,...nt(e)});var wH=class t extends mt{_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.parsedType!==jI.set)return xI(l,{code:YI.invalid_type,expected:jI.set,received:l.parsedType}),ye;let c=this._def;c.minSize!==null&&l.data.size<c.minSize.value&&(xI(l,{code:YI.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),e.dirty()),c.maxSize!==null&&l.data.size>c.maxSize.value&&(xI(l,{code:YI.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),e.dirty());let n=this._def.valueType;function a(r){let o=new Set;for(let d of r){if(d.status==="aborted")return ye;d.status==="dirty"&&e.dirty(),o.add(d.value)}return{status:e.value,value:o}}let s=[...l.data.values()].map((r,o)=>n._parse(new Dd(l,r,l.path,o)));return l.common.async?Promise.all(s).then(r=>a(r)):a(s)}min(I,e){return new t({...this._def,minSize:{value:I,message:ae.toString(e)}})}max(I,e){return new t({...this._def,maxSize:{value:I,message:ae.toString(e)}})}size(I,e){return this.min(I,e).max(I,e)}nonempty(I){return this.min(1,I)}};wH.create=(t,I)=>new wH({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...nt(I)});var MD=class t extends mt{constructor(){super(...arguments),this.validate=this.implement}_parse(I){let{ctx:e}=this._processInputParams(I);if(e.parsedType!==jI.function)return xI(e,{code:YI.invalid_type,expected:jI.function,received:e.parsedType}),ye;function l(s,r){return I9({data:s,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,yH(),tu].filter(o=>!!o),issueData:{code:YI.invalid_arguments,argumentsError:r}})}function c(s,r){return I9({data:s,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,yH(),tu].filter(o=>!!o),issueData:{code:YI.invalid_return_type,returnTypeError:r}})}let n={errorMap:e.common.contextualErrorMap},a=e.data;if(this._def.returns instanceof JY){let s=this;return zs(async function(...r){let o=new LG([]),d=await s._def.args.parseAsync(r,n).catch(Z=>{throw o.addIssue(l(r,Z)),o}),b=await Reflect.apply(a,this,d);return await s._def.returns._def.type.parseAsync(b,n).catch(Z=>{throw o.addIssue(c(b,Z)),o})})}else{let s=this;return zs(function(...r){let o=s._def.args.safeParse(r,n);if(!o.success)throw new LG([l(r,o.error)]);let d=Reflect.apply(a,this,o.data),b=s._def.returns.safeParse(d,n);if(!b.success)throw new LG([c(d,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...I){return new t({...this._def,args:Ah.create(I).rest(cu.create())})}returns(I){return new t({...this._def,returns:I})}implement(I){return this.parse(I)}strictImplement(I){return this.parse(I)}static create(I,e,l){return new t({args:I||Ah.create([]).rest(cu.create()),returns:e||cu.create(),typeName:ge.ZodFunction,...nt(l)})}},Iy=class extends mt{get schema(){return this._def.getter()}_parse(I){let{ctx:e}=this._processInputParams(I);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};Iy.create=(t,I)=>new Iy({getter:t,typeName:ge.ZodLazy,...nt(I)});var ey=class extends mt{_parse(I){if(I.data!==this._def.value){let e=this._getOrReturnCtx(I);return xI(e,{received:e.data,code:YI.invalid_literal,expected:this._def.value}),ye}return{status:"valid",value:I.data}}get value(){return this._def.value}};ey.create=(t,I)=>new ey({value:t,typeName:ge.ZodLiteral,...nt(I)});function q9I(t,I){return new ty({values:t,typeName:ge.ZodEnum,...nt(I)})}var ty=class t extends mt{_parse(I){if(typeof I.data!="string"){let e=this._getOrReturnCtx(I),l=this._def.values;return xI(e,{expected:ft.joinValues(l),received:e.parsedType,code:YI.invalid_type}),ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(I.data)){let e=this._getOrReturnCtx(I),l=this._def.values;return xI(e,{received:e.data,code:YI.invalid_enum_value,options:l}),ye}return zs(I.data)}get options(){return this._def.values}get enum(){let I={};for(let e of this._def.values)I[e]=e;return I}get Values(){let I={};for(let e of this._def.values)I[e]=e;return I}get Enum(){let I={};for(let e of this._def.values)I[e]=e;return I}extract(I,e=this._def){return t.create(I,{...this._def,...e})}exclude(I,e=this._def){return t.create(this.options.filter(l=>!I.includes(l)),{...this._def,...e})}};ty.create=q9I;var ly=class extends mt{_parse(I){let e=ft.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(I);if(l.parsedType!==jI.string&&l.parsedType!==jI.number){let c=ft.objectValues(e);return xI(l,{expected:ft.joinValues(c),received:l.parsedType,code:YI.invalid_type}),ye}if(this._cache||(this._cache=new Set(ft.getValidEnumValues(this._def.values))),!this._cache.has(I.data)){let c=ft.objectValues(e);return xI(l,{received:l.data,code:YI.invalid_enum_value,options:c}),ye}return zs(I.data)}get enum(){return this._def.values}};ly.create=(t,I)=>new ly({values:t,typeName:ge.ZodNativeEnum,...nt(I)});var JY=class extends mt{unwrap(){return this._def.type}_parse(I){let{ctx:e}=this._processInputParams(I);if(e.parsedType!==jI.promise&&e.common.async===!1)return xI(e,{code:YI.invalid_type,expected:jI.promise,received:e.parsedType}),ye;let l=e.parsedType===jI.promise?e.data:Promise.resolve(e.data);return zs(l.then(c=>this._def.type.parseAsync(c,{path:e.path,errorMap:e.common.contextualErrorMap})))}};JY.create=(t,I)=>new JY({type:t,typeName:ge.ZodPromise,...nt(I)});var Kd=class extends mt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(I){let{status:e,ctx:l}=this._processInputParams(I),c=this._def.effect||null,n={addIssue:a=>{xI(l,a),a.fatal?e.abort():e.dirty()},get path(){return l.path}};if(n.addIssue=n.addIssue.bind(n),c.type==="preprocess"){let a=c.transform(l.data,n);if(l.common.async)return Promise.resolve(a).then(async s=>{if(e.value==="aborted")return ye;let r=await this._def.schema._parseAsync({data:s,path:l.path,parent:l});return r.status==="aborted"?ye:r.status==="dirty"?M0(r.value):e.value==="dirty"?M0(r.value):r});{if(e.value==="aborted")return ye;let s=this._def.schema._parseSync({data:a,path:l.path,parent:l});return s.status==="aborted"?ye:s.status==="dirty"?M0(s.value):e.value==="dirty"?M0(s.value):s}}if(c.type==="refinement"){let a=s=>{let r=c.refinement(s,n);if(l.common.async)return Promise.resolve(r);if(r instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(l.common.async===!1){let s=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return s.status==="aborted"?ye:(s.status==="dirty"&&e.dirty(),a(s.value),{status:e.value,value:s.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(s=>s.status==="aborted"?ye:(s.status==="dirty"&&e.dirty(),a(s.value).then(()=>({status:e.value,value:s.value}))))}if(c.type==="transform")if(l.common.async===!1){let a=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!EY(a))return ye;let s=c.transform(a.value,n);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:s}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(a=>EY(a)?Promise.resolve(c.transform(a.value,n)).then(s=>({status:e.value,value:s})):ye);ft.assertNever(c)}};Kd.create=(t,I,e)=>new Kd({schema:t,typeName:ge.ZodEffects,effect:I,...nt(e)});Kd.createWithPreprocess=(t,I,e)=>new Kd({schema:I,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...nt(e)});var jd=class extends mt{_parse(I){return this._getType(I)===jI.undefined?zs(void 0):this._def.innerType._parse(I)}unwrap(){return this._def.innerType}};jd.create=(t,I)=>new jd({innerType:t,typeName:ge.ZodOptional,...nt(I)});var Xh=class extends mt{_parse(I){return this._getType(I)===jI.null?zs(null):this._def.innerType._parse(I)}unwrap(){return this._def.innerType}};Xh.create=(t,I)=>new Xh({innerType:t,typeName:ge.ZodNullable,...nt(I)});var cy=class extends mt{_parse(I){let{ctx:e}=this._processInputParams(I),l=e.data;return e.parsedType===jI.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};cy.create=(t,I)=>new cy({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof I.default=="function"?I.default:()=>I.default,...nt(I)});var ny=class extends mt{_parse(I){let{ctx:e}=this._processInputParams(I),l={...e,common:{...e.common,issues:[]}},c=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return FH(c)?c.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new LG(l.common.issues)},input:l.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new LG(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}};ny.create=(t,I)=>new ny({innerType:t,typeName:ge.ZodCatch,catchValue:typeof I.catch=="function"?I.catch:()=>I.catch,...nt(I)});var HH=class extends mt{_parse(I){if(this._getType(I)!==jI.nan){let l=this._getOrReturnCtx(I);return xI(l,{code:YI.invalid_type,expected:jI.nan,received:l.parsedType}),ye}return{status:"valid",value:I.data}}};HH.create=t=>new HH({typeName:ge.ZodNaN,...nt(t)});var _Ee=Symbol("zod_brand"),e9=class extends mt{_parse(I){let{ctx:e}=this._processInputParams(I),l=e.data;return this._def.type._parse({data:l,path:e.path,parent:e})}unwrap(){return this._def.type}},t9=class t extends mt{_parse(I){let{status:e,ctx:l}=this._processInputParams(I);if(l.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return n.status==="aborted"?ye:n.status==="dirty"?(e.dirty(),M0(n.value)):this._def.out._parseAsync({data:n.value,path:l.path,parent:l})})();{let c=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return c.status==="aborted"?ye:c.status==="dirty"?(e.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:l.path,parent:l})}}static create(I,e){return new t({in:I,out:e,typeName:ge.ZodPipeline})}},ay=class extends mt{_parse(I){let e=this._def.innerType._parse(I),l=c=>(EY(c)&&(c.value=Object.freeze(c.value)),c);return FH(e)?e.then(c=>l(c)):l(e)}unwrap(){return this._def.innerType}};ay.create=(t,I)=>new ay({innerType:t,typeName:ge.ZodReadonly,...nt(I)});function j9I(t,I){let e=typeof t=="function"?t(I):typeof t=="string"?{message:t}:t;return typeof e=="string"?{message:e}:e}function _9I(t,I={},e){return t?CY.create().superRefine((l,c)=>{let n=t(l);if(n instanceof Promise)return n.then(a=>{if(!a){let s=j9I(I,l),r=s.fatal??e??!0;c.addIssue({code:"custom",...s,fatal:r})}});if(!n){let a=j9I(I,l),s=a.fatal??e??!0;c.addIssue({code:"custom",...a,fatal:s})}}):CY.create()}var $Ee={object:kG.lazycreate},ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));var I1e=(t,I={message:`Input not instance of ${t.name}`})=>_9I(e=>e instanceof t,I),vI=vY.create,wh=T0.create,e1e=HH.create,t1e=j0.create,fa=D0.create,l1e=K0.create,c1e=gH.create,n1e=P0.create,a1e=q0.create,eoI=CY.create,toI=cu.create,s1e=mi.create,r1e=AH.create,Us=nu.create,Ae=kG.create,G1e=kG.strictCreate,Ss=_0.create,loI=SD.create,o1e=$0.create,coI=Ah.create,TD=OD.create,d1e=XH.create,b1e=wH.create,i1e=MD.create,m1e=Iy.create,sl=ey.create,au=ty.create,h1e=ly.create,Z1e=JY.create,p1e=Kd.create,u1e=jd.create,W1e=Xh.create,N1e=Kd.createWithPreprocess,Y1e=t9.create,V1e=()=>vI().optional(),R1e=()=>wh().optional(),y1e=()=>fa().optional(),l9={string:t=>vY.create({...t,coerce:!0}),number:t=>T0.create({...t,coerce:!0}),boolean:t=>D0.create({...t,coerce:!0}),bigint:t=>j0.create({...t,coerce:!0}),date:t=>K0.create({...t,coerce:!0})};var F1e=ye;var EH="2025-06-18";var $9I=[EH,"2025-03-26","2024-11-05","2024-10-07"],jD="2.0",IfI=R.union([R.string(),R.number().int()]),efI=R.string(),Q1e=R.object({progressToken:R.optional(IfI)}).passthrough(),_d=R.object({_meta:R.optional(Q1e)}).passthrough(),fG=R.object({method:R.string(),params:R.optional(_d)}),c9=R.object({_meta:R.optional(R.object({}).passthrough())}).passthrough(),Hh=R.object({method:R.string(),params:R.optional(c9)}),$d=R.object({_meta:R.optional(R.object({}).passthrough())}).passthrough(),DD=R.union([R.string(),R.number().int()]),tfI=R.object({jsonrpc:R.literal(jD),id:DD}).merge(fG).strict(),KD=t=>tfI.safeParse(t).success,lfI=R.object({jsonrpc:R.literal(jD)}).merge(Hh).strict(),cfI=t=>lfI.safeParse(t).success,nfI=R.object({jsonrpc:R.literal(jD),id:DD,result:$d}).strict(),n9=t=>nfI.safeParse(t).success,Pd;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(Pd||(Pd={}));var afI=R.object({jsonrpc:R.literal(jD),id:DD,error:R.object({code:R.number().int(),message:R.string(),data:R.optional(R.unknown())})}).strict(),sfI=t=>afI.safeParse(t).success,LY=R.union([tfI,lfI,nfI,afI]),sy=$d.strict(),PD=Hh.extend({method:R.literal("notifications/cancelled"),params:c9.extend({requestId:DD,reason:R.string().optional()})}),qD=R.object({src:R.string(),mimeType:R.optional(R.string()),sizes:R.optional(R.string())}).passthrough(),a9=R.object({name:R.string(),title:R.optional(R.string())}).passthrough(),rfI=a9.extend({version:R.string(),websiteUrl:R.optional(R.string()),icons:R.optional(R.array(qD))}),g1e=R.object({experimental:R.optional(R.object({}).passthrough()),sampling:R.optional(R.object({}).passthrough()),elicitation:R.optional(R.object({}).passthrough()),roots:R.optional(R.object({listChanged:R.optional(R.boolean())}).passthrough())}).passthrough(),A1e=fG.extend({method:R.literal("initialize"),params:_d.extend({protocolVersion:R.string(),capabilities:g1e,clientInfo:rfI})});var X1e=R.object({experimental:R.optional(R.object({}).passthrough()),logging:R.optional(R.object({}).passthrough()),completions:R.optional(R.object({}).passthrough()),prompts:R.optional(R.object({listChanged:R.optional(R.boolean())}).passthrough()),resources:R.optional(R.object({subscribe:R.optional(R.boolean()),listChanged:R.optional(R.boolean())}).passthrough()),tools:R.optional(R.object({listChanged:R.optional(R.boolean())}).passthrough())}).passthrough(),aoI=$d.extend({protocolVersion:R.string(),capabilities:X1e,serverInfo:rfI,instructions:R.optional(R.string())}),GfI=Hh.extend({method:R.literal("notifications/initialized")}),ofI=t=>GfI.safeParse(t).success,_D=fG.extend({method:R.literal("ping")}),w1e=R.object({progress:R.number(),total:R.optional(R.number()),message:R.optional(R.string())}).passthrough(),$D=Hh.extend({method:R.literal("notifications/progress"),params:c9.merge(w1e).extend({progressToken:IfI})}),IK=fG.extend({params:_d.extend({cursor:R.optional(efI)}).optional()}),eK=$d.extend({nextCursor:R.optional(efI)}),dfI=R.object({uri:R.string(),mimeType:R.optional(R.string()),_meta:R.optional(R.object({}).passthrough())}).passthrough(),bfI=dfI.extend({text:R.string()}),soI=R.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),ifI=dfI.extend({blob:soI}),mfI=a9.extend({uri:R.string(),description:R.optional(R.string()),mimeType:R.optional(R.string()),icons:R.optional(R.array(qD)),_meta:R.optional(R.object({}).passthrough())}),H1e=a9.extend({uriTemplate:R.string(),description:R.optional(R.string()),mimeType:R.optional(R.string()),_meta:R.optional(R.object({}).passthrough())}),E1e=IK.extend({method:R.literal("resources/list")}),roI=eK.extend({resources:R.array(mfI)}),v1e=IK.extend({method:R.literal("resources/templates/list")}),GoI=eK.extend({resourceTemplates:R.array(H1e)}),C1e=fG.extend({method:R.literal("resources/read"),params:_d.extend({uri:R.string()})}),ooI=$d.extend({contents:R.array(R.union([bfI,ifI]))}),J1e=Hh.extend({method:R.literal("notifications/resources/list_changed")}),L1e=fG.extend({method:R.literal("resources/subscribe"),params:_d.extend({uri:R.string()})}),k1e=fG.extend({method:R.literal("resources/unsubscribe"),params:_d.extend({uri:R.string()})}),f1e=Hh.extend({method:R.literal("notifications/resources/updated"),params:c9.extend({uri:R.string()})}),x1e=R.object({name:R.string(),description:R.optional(R.string()),required:R.optional(R.boolean())}).passthrough(),B1e=a9.extend({description:R.optional(R.string()),arguments:R.optional(R.array(x1e)),icons:R.optional(R.array(qD)),_meta:R.optional(R.object({}).passthrough())}),z1e=IK.extend({method:R.literal("prompts/list")}),doI=eK.extend({prompts:R.array(B1e)}),U1e=fG.extend({method:R.literal("prompts/get"),params:_d.extend({name:R.string(),arguments:R.optional(R.record(R.string()))})}),boI=R.object({type:R.literal("text"),text:R.string(),_meta:R.optional(R.object({}).passthrough())}).passthrough(),ioI=R.object({type:R.literal("image"),data:soI,mimeType:R.string(),_meta:R.optional(R.object({}).passthrough())}).passthrough(),moI=R.object({type:R.literal("audio"),data:soI,mimeType:R.string(),_meta:R.optional(R.object({}).passthrough())}).passthrough(),S1e=R.object({type:R.literal("resource"),resource:R.union([bfI,ifI]),_meta:R.optional(R.object({}).passthrough())}).passthrough(),O1e=mfI.extend({type:R.literal("resource_link")}),hfI=R.union([boI,ioI,moI,O1e,S1e]),M1e=R.object({role:R.enum(["user","assistant"]),content:hfI}).passthrough(),hoI=$d.extend({description:R.optional(R.string()),messages:R.array(M1e)}),T1e=Hh.extend({method:R.literal("notifications/prompts/list_changed")}),j1e=R.object({title:R.optional(R.string()),readOnlyHint:R.optional(R.boolean()),destructiveHint:R.optional(R.boolean()),idempotentHint:R.optional(R.boolean()),openWorldHint:R.optional(R.boolean())}).passthrough(),D1e=a9.extend({description:R.optional(R.string()),inputSchema:R.object({type:R.literal("object"),properties:R.optional(R.object({}).passthrough()),required:R.optional(R.array(R.string()))}).passthrough(),outputSchema:R.optional(R.object({type:R.literal("object"),properties:R.optional(R.object({}).passthrough()),required:R.optional(R.array(R.string()))}).passthrough()),annotations:R.optional(j1e),icons:R.optional(R.array(qD)),_meta:R.optional(R.object({}).passthrough())}),K1e=IK.extend({method:R.literal("tools/list")}),ZoI=eK.extend({tools:R.array(D1e)}),tK=$d.extend({content:R.array(hfI).default([]),structuredContent:R.object({}).passthrough().optional(),isError:R.optional(R.boolean())}),x3l=tK.or($d.extend({toolResult:R.unknown()})),P1e=fG.extend({method:R.literal("tools/call"),params:_d.extend({name:R.string(),arguments:R.optional(R.record(R.unknown()))})}),q1e=Hh.extend({method:R.literal("notifications/tools/list_changed")}),ZfI=R.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),_1e=fG.extend({method:R.literal("logging/setLevel"),params:_d.extend({level:ZfI})}),$1e=Hh.extend({method:R.literal("notifications/message"),params:c9.extend({level:ZfI,logger:R.optional(R.string()),data:R.unknown()})}),Ive=R.object({name:R.string().optional()}).passthrough(),eve=R.object({hints:R.optional(R.array(Ive)),costPriority:R.optional(R.number().min(0).max(1)),speedPriority:R.optional(R.number().min(0).max(1)),intelligencePriority:R.optional(R.number().min(0).max(1))}).passthrough(),tve=R.object({role:R.enum(["user","assistant"]),content:R.union([boI,ioI,moI])}).passthrough(),lve=fG.extend({method:R.literal("sampling/createMessage"),params:_d.extend({messages:R.array(tve),systemPrompt:R.optional(R.string()),includeContext:R.optional(R.enum(["none","thisServer","allServers"])),temperature:R.optional(R.number()),maxTokens:R.number().int(),stopSequences:R.optional(R.array(R.string())),metadata:R.optional(R.object({}).passthrough()),modelPreferences:R.optional(eve)})}),cve=$d.extend({model:R.string(),stopReason:R.optional(R.enum(["endTurn","stopSequence","maxTokens"]).or(R.string())),role:R.enum(["user","assistant"]),content:R.discriminatedUnion("type",[boI,ioI,moI])}),nve=R.object({type:R.literal("boolean"),title:R.optional(R.string()),description:R.optional(R.string()),default:R.optional(R.boolean())}).passthrough(),ave=R.object({type:R.literal("string"),title:R.optional(R.string()),description:R.optional(R.string()),minLength:R.optional(R.number()),maxLength:R.optional(R.number()),format:R.optional(R.enum(["email","uri","date","date-time"]))}).passthrough(),sve=R.object({type:R.enum(["number","integer"]),title:R.optional(R.string()),description:R.optional(R.string()),minimum:R.optional(R.number()),maximum:R.optional(R.number())}).passthrough(),rve=R.object({type:R.literal("string"),title:R.optional(R.string()),description:R.optional(R.string()),enum:R.array(R.string()),enumNames:R.optional(R.array(R.string()))}).passthrough(),Gve=R.union([nve,ave,sve,rve]),ove=fG.extend({method:R.literal("elicitation/create"),params:_d.extend({message:R.string(),requestedSchema:R.object({type:R.literal("object"),properties:R.record(R.string(),Gve),required:R.optional(R.array(R.string()))}).passthrough()})}),dve=$d.extend({action:R.enum(["accept","decline","cancel"]),content:R.optional(R.record(R.string(),R.unknown()))}),bve=R.object({type:R.literal("ref/resource"),uri:R.string()}).passthrough();var ive=R.object({type:R.literal("ref/prompt"),name:R.string()}).passthrough(),mve=fG.extend({method:R.literal("completion/complete"),params:_d.extend({ref:R.union([ive,bve]),argument:R.object({name:R.string(),value:R.string()}).passthrough(),context:R.optional(R.object({arguments:R.optional(R.record(R.string(),R.string()))}))})}),poI=$d.extend({completion:R.object({values:R.array(R.string()).max(100),total:R.optional(R.number().int()),hasMore:R.optional(R.boolean())}).passthrough()}),hve=R.object({uri:R.string().startsWith("file://"),name:R.optional(R.string()),_meta:R.optional(R.object({}).passthrough())}).passthrough(),Zve=fG.extend({method:R.literal("roots/list")}),pve=$d.extend({roots:R.array(hve)}),uve=Hh.extend({method:R.literal("notifications/roots/list_changed")}),B3l=R.union([_D,A1e,mve,_1e,U1e,z1e,E1e,v1e,C1e,L1e,k1e,P1e,K1e]),z3l=R.union([PD,$D,GfI,uve]),U3l=R.union([sy,cve,dve,pve]),S3l=R.union([_D,lve,ove,Zve]),O3l=R.union([PD,$D,$1e,f1e,J1e,q1e,T1e]),M3l=R.union([sy,aoI,poI,hoI,doI,roI,GoI,ooI,tK,ZoI]),qd=class extends Error{constructor(I,e,l){super(`MCP error ${I}: ${e}`),this.code=I,this.data=l,this.name="McpError"}};var Wve=6e4,lK=class{constructor(I){this._options=I,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(PD,e=>{let l=this._requestHandlerAbortControllers.get(e.params.requestId);l?.abort(e.params.reason)}),this.setNotificationHandler($D,e=>{this._onprogress(e)}),this.setRequestHandler(_D,e=>({}))}_setupTimeout(I,e,l,c,n=!1){this._timeoutInfo.set(I,{timeoutId:setTimeout(c,e),startTime:Date.now(),timeout:e,maxTotalTimeout:l,resetTimeoutOnProgress:n,onTimeout:c})}_resetTimeout(I){let e=this._timeoutInfo.get(I);if(!e)return!1;let l=Date.now()-e.startTime;if(e.maxTotalTimeout&&l>=e.maxTotalTimeout)throw this._timeoutInfo.delete(I),new qd(Pd.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:e.maxTotalTimeout,totalElapsed:l});return clearTimeout(e.timeoutId),e.timeoutId=setTimeout(e.onTimeout,e.timeout),!0}_cleanupTimeout(I){let e=this._timeoutInfo.get(I);e&&(clearTimeout(e.timeoutId),this._timeoutInfo.delete(I))}async connect(I){var e,l,c;this._transport=I;let n=(e=this.transport)===null||e===void 0?void 0:e.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let a=(l=this.transport)===null||l===void 0?void 0:l.onerror;this._transport.onerror=r=>{a?.(r),this._onerror(r)};let s=(c=this._transport)===null||c===void 0?void 0:c.onmessage;this._transport.onmessage=(r,o)=>{s?.(r,o),n9(r)||sfI(r)?this._onresponse(r):KD(r)?this._onrequest(r,o):cfI(r)?this._onnotification(r):this._onerror(new Error(`Unknown message type: ${JSON.stringify(r)}`))},await this._transport.start()}_onclose(){var I;let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(I=this.onclose)===null||I===void 0||I.call(this);let l=new qd(Pd.ConnectionClosed,"Connection closed");for(let c of e.values())c(l)}_onerror(I){var e;(e=this.onerror)===null||e===void 0||e.call(this,I)}_onnotification(I){var e;let l=(e=this._notificationHandlers.get(I.method))!==null&&e!==void 0?e:this.fallbackNotificationHandler;l!==void 0&&Promise.resolve().then(()=>l(I)).catch(c=>this._onerror(new Error(`Uncaught error in notification handler: ${c}`)))}_onrequest(I,e){var l,c;let n=(l=this._requestHandlers.get(I.method))!==null&&l!==void 0?l:this.fallbackRequestHandler,a=this._transport;if(n===void 0){a?.send({jsonrpc:"2.0",id:I.id,error:{code:Pd.MethodNotFound,message:"Method not found"}}).catch(o=>this._onerror(new Error(`Failed to send an error response: ${o}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(I.id,s);let r={signal:s.signal,sessionId:a?.sessionId,_meta:(c=I.params)===null||c===void 0?void 0:c._meta,sendNotification:o=>this.notification(o,{relatedRequestId:I.id}),sendRequest:(o,d,b)=>this.request(o,d,{...b,relatedRequestId:I.id}),authInfo:e?.authInfo,requestId:I.id,requestInfo:e?.requestInfo};Promise.resolve().then(()=>n(I,r)).then(o=>{if(!s.signal.aborted)return a?.send({result:o,jsonrpc:"2.0",id:I.id})},o=>{var d;if(!s.signal.aborted)return a?.send({jsonrpc:"2.0",id:I.id,error:{code:Number.isSafeInteger(o.code)?o.code:Pd.InternalError,message:(d=o.message)!==null&&d!==void 0?d:"Internal error"}})}).catch(o=>this._onerror(new Error(`Failed to send response: ${o}`))).finally(()=>{this._requestHandlerAbortControllers.delete(I.id)})}_onprogress(I){let{progressToken:e,...l}=I.params,c=Number(e),n=this._progressHandlers.get(c);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(I)}`));return}let a=this._responseHandlers.get(c),s=this._timeoutInfo.get(c);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(c)}catch(r){a(r);return}n(l)}_onresponse(I){let e=Number(I.id),l=this._responseHandlers.get(e);if(l===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(I)}`));return}if(this._responseHandlers.delete(e),this._progressHandlers.delete(e),this._cleanupTimeout(e),n9(I))l(I);else{let c=new qd(I.error.code,I.error.message,I.error.data);l(c)}}get transport(){return this._transport}async close(){var I;await((I=this._transport)===null||I===void 0?void 0:I.close())}request(I,e,l){let{relatedRequestId:c,resumptionToken:n,onresumptiontoken:a}=l??{};return new Promise((s,r)=>{var o,d,b,h,Z,p;if(!this._transport){r(new Error("Not connected"));return}((o=this._options)===null||o===void 0?void 0:o.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(I.method),(d=l?.signal)===null||d===void 0||d.throwIfAborted();let W=this._requestMessageId++,N={...I,jsonrpc:"2.0",id:W};l?.onprogress&&(this._progressHandlers.set(W,l.onprogress),N.params={...I.params,_meta:{...((b=I.params)===null||b===void 0?void 0:b._meta)||{},progressToken:W}});let Y=A=>{var X;this._responseHandlers.delete(W),this._progressHandlers.delete(W),this._cleanupTimeout(W),(X=this._transport)===null||X===void 0||X.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:W,reason:String(A)}},{relatedRequestId:c,resumptionToken:n,onresumptiontoken:a}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`))),r(A)};this._responseHandlers.set(W,A=>{var X;if(!(!((X=l?.signal)===null||X===void 0)&&X.aborted)){if(A instanceof Error)return r(A);try{let v=e.parse(A.result);s(v)}catch(v){r(v)}}}),(h=l?.signal)===null||h===void 0||h.addEventListener("abort",()=>{var A;Y((A=l?.signal)===null||A===void 0?void 0:A.reason)});let F=(Z=l?.timeout)!==null&&Z!==void 0?Z:Wve,g=()=>Y(new qd(Pd.RequestTimeout,"Request timed out",{timeout:F}));this._setupTimeout(W,F,l?.maxTotalTimeout,g,(p=l?.resetTimeoutOnProgress)!==null&&p!==void 0?p:!1),this._transport.send(N,{relatedRequestId:c,resumptionToken:n,onresumptiontoken:a}).catch(A=>{this._cleanupTimeout(W),r(A)})})}async notification(I,e){var l,c;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(I.method),((c=(l=this._options)===null||l===void 0?void 0:l.debouncedNotificationMethods)!==null&&c!==void 0?c:[]).includes(I.method)&&!I.params&&!e?.relatedRequestId){if(this._pendingDebouncedNotifications.has(I.method))return;this._pendingDebouncedNotifications.add(I.method),Promise.resolve().then(()=>{var r;if(this._pendingDebouncedNotifications.delete(I.method),!this._transport)return;let o={...I,jsonrpc:"2.0"};(r=this._transport)===null||r===void 0||r.send(o,e).catch(d=>this._onerror(d))});return}let s={...I,jsonrpc:"2.0"};await this._transport.send(s,e)}setRequestHandler(I,e){let l=I.shape.method.value;this.assertRequestHandlerCapability(l),this._requestHandlers.set(l,(c,n)=>Promise.resolve(e(I.parse(c),n)))}removeRequestHandler(I){this._requestHandlers.delete(I)}assertCanSetRequestHandler(I){if(this._requestHandlers.has(I))throw new Error(`A request handler for ${I} already exists, which would be overridden`)}setNotificationHandler(I,e){this._notificationHandlers.set(I.shape.method.value,l=>Promise.resolve(e(I.parse(l))))}removeNotificationHandler(I){this._notificationHandlers.delete(I)}};function pfI(t,I){return Object.entries(I).reduce((e,[l,c])=>(c&&typeof c=="object"?e[l]=e[l]?{...e[l],...c}:c:e[l]=c,e),{...t})}var qBI=Qc(PBI(),1),fK=class extends lK{constructor(I,e){var l;super(e),this._clientInfo=I,this._cachedToolOutputValidators=new Map,this._capabilities=(l=e?.capabilities)!==null&&l!==void 0?l:{},this._ajv=new qBI.default}registerCapabilities(I){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=pfI(this._capabilities,I)}assertCapability(I,e){var l;if(!(!((l=this._serverCapabilities)===null||l===void 0)&&l[I]))throw new Error(`Server does not support ${I} (required for ${e})`)}async connect(I,e){if(await super.connect(I),I.sessionId===void 0)try{let l=await this.request({method:"initialize",params:{protocolVersion:EH,capabilities:this._capabilities,clientInfo:this._clientInfo}},aoI,e);if(l===void 0)throw new Error(`Server sent invalid initialize result: ${l}`);if(!$9I.includes(l.protocolVersion))throw new Error(`Server's protocol version is not supported: ${l.protocolVersion}`);this._serverCapabilities=l.capabilities,this._serverVersion=l.serverInfo,I.setProtocolVersion&&I.setProtocolVersion(l.protocolVersion),this._instructions=l.instructions,await this.notification({method:"notifications/initialized"})}catch(l){throw this.close(),l}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(I){var e,l,c,n,a;switch(I){case"logging/setLevel":if(!(!((e=this._serverCapabilities)===null||e===void 0)&&e.logging))throw new Error(`Server does not support logging (required for ${I})`);break;case"prompts/get":case"prompts/list":if(!(!((l=this._serverCapabilities)===null||l===void 0)&&l.prompts))throw new Error(`Server does not support prompts (required for ${I})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((c=this._serverCapabilities)===null||c===void 0)&&c.resources))throw new Error(`Server does not support resources (required for ${I})`);if(I==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${I})`);break;case"tools/call":case"tools/list":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.tools))throw new Error(`Server does not support tools (required for ${I})`);break;case"completion/complete":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.completions))throw new Error(`Server does not support completions (required for ${I})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(I){var e;switch(I){case"notifications/roots/list_changed":if(!(!((e=this._capabilities.roots)===null||e===void 0)&&e.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${I})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(I){switch(I){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${I})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${I})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${I})`);break;case"ping":break}}async ping(I){return this.request({method:"ping"},sy,I)}async complete(I,e){return this.request({method:"completion/complete",params:I},poI,e)}async setLoggingLevel(I,e){return this.request({method:"logging/setLevel",params:{level:I}},sy,e)}async getPrompt(I,e){return this.request({method:"prompts/get",params:I},hoI,e)}async listPrompts(I,e){return this.request({method:"prompts/list",params:I},doI,e)}async listResources(I,e){return this.request({method:"resources/list",params:I},roI,e)}async listResourceTemplates(I,e){return this.request({method:"resources/templates/list",params:I},GoI,e)}async readResource(I,e){return this.request({method:"resources/read",params:I},ooI,e)}async subscribeResource(I,e){return this.request({method:"resources/subscribe",params:I},sy,e)}async unsubscribeResource(I,e){return this.request({method:"resources/unsubscribe",params:I},sy,e)}async callTool(I,e=tK,l){let c=await this.request({method:"tools/call",params:I},e,l),n=this.getToolOutputValidator(I.name);if(n){if(!c.structuredContent&&!c.isError)throw new qd(Pd.InvalidRequest,`Tool ${I.name} has an output schema but did not return structured content`);if(c.structuredContent)try{if(!n(c.structuredContent))throw new qd(Pd.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(n.errors)}`)}catch(a){throw a instanceof qd?a:new qd(Pd.InvalidParams,`Failed to validate structured content: ${a instanceof Error?a.message:String(a)}`)}}return c}cacheToolOutputSchemas(I){this._cachedToolOutputValidators.clear();for(let e of I)if(e.outputSchema)try{let l=this._ajv.compile(e.outputSchema);this._cachedToolOutputValidators.set(e.name,l)}catch{}}getToolOutputValidator(I){return this._cachedToolOutputValidators.get(I)}async listTools(I,e){let l=await this.request({method:"tools/list",params:I},ZoI,e);return this.cacheToolOutputSchemas(l.tools),l}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var xK=class{createClient(I,e){return new fK(I,e)}};G();G();G();G();var BK=class extends Error{constructor(I,e){super(I),this.name="ParseError",this.type=e.type,this.field=e.field,this.value=e.value,this.line=e.line}};function ebI(t){}function zK(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:I=ebI,onError:e=ebI,onRetry:l=ebI,onComment:c}=t,n="",a=!0,s,r="",o="";function d(W){let N=a?W.replace(/^\xEF\xBB\xBF/,""):W,[Y,F]=OLe(`${n}${N}`);for(let g of Y)b(g);n=F,a=!1}function b(W){if(W===""){Z();return}if(W.startsWith(":")){c&&c(W.slice(W.startsWith(": ")?2:1));return}let N=W.indexOf(":");if(N!==-1){let Y=W.slice(0,N),F=W[N+1]===" "?2:1,g=W.slice(N+F);h(Y,g,W);return}h(W,"",W)}function h(W,N,Y){switch(W){case"event":o=N;break;case"data":r=`${r}${N}
1120
1132
  `;break;case"id":s=N.includes("\0")?void 0:N;break;case"retry":/^\d+$/.test(N)?l(parseInt(N,10)):e(new BK(`Invalid \`retry\` value: "${N}"`,{type:"invalid-retry",value:N,line:Y}));break;default:e(new BK(`Unknown field "${W.length>20?`${W.slice(0,20)}\u2026`:W}"`,{type:"unknown-field",field:W,value:N,line:Y}));break}}function Z(){r.length>0&&I({id:s,event:o||void 0,data:r.endsWith(`
1121
1133
  `)?r.slice(0,-1):r}),s=void 0,r="",o=""}function p(W={}){n&&W.consume&&b(n),a=!0,s=void 0,r="",o="",n=""}return{feed:d,reset:p}}function OLe(t){let I=[],e="",l=0;for(;l<t.length;){let c=t.indexOf("\r",l),n=t.indexOf(`
1122
1134
  `,l),a=-1;if(c!==-1&&n!==-1?a=Math.min(c,n):c!==-1?a=c:n!==-1&&(a=n),a===-1){e=t.slice(l);break}else{let s=t.slice(l,a);I.push(s),l=a+1,t[l-1]==="\r"&&t[l]===`