claude-mem 13.24.12 → 13.24.13
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/.codex-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/dist/bug-report/index.js +314 -0
- package/dist/npx-cli/index.js +301 -301
- package/openclaw/openclaw.plugin.json +1 -1
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/scripts/mcp-server.cjs +1 -1
- package/plugin/scripts/server-service.cjs +2 -2
- package/plugin/scripts/transcript-watcher.cjs +24 -24
- package/plugin/scripts/worker-service.cjs +284 -279
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
#!/usr/bin/env npx tsx
|
|
2
|
+
import{createRequire as eI}from"node:module";import*as Or from"node:fs/promises";import*as rr from"node:path";import{randomUUID as ZL}from"node:crypto";import*as pr from"node:fs/promises";import*as xC from"node:fs";import*as Lt from"node:path";import{execFile as eP}from"node:child_process";import{promisify as tP}from"node:util";import{Readable as rP}from"node:stream";import{pipeline as iP}from"node:stream/promises";import*as Rt from"node:fs/promises";import*as Pu from"node:fs";import*as gt from"node:path";import*as h_ from"node:child_process";import*as RC from"node:crypto";import*as DC from"node:readline";import pN from"url";import fN from"crypto";import ZN from"stream";import JN from"util";import{Readable as QN}from"stream";import iM from"stream";import gM from"http";import _M from"https";import VO from"http2";import ZO from"util";import{resolve as Fb}from"path";import Bi from"zlib";import Gr from"stream";import{EventEmitter as vM}from"events";import{randomUUID as _f}from"crypto";import{createHash as F$}from"crypto";import{basename as XB,dirname as SE}from"path";import{realpathSync as CE}from"node:fs";import{cwd as QB}from"node:process";import{realpathSync as dz}from"fs";import{homedir as hz}from"os";import{dirname as IE,resolve as Cn,sep as Si}from"path";import*as Jf from"path";import{execFile as $z}from"child_process";import{randomUUID as jz}from"crypto";import{createReadStream as QCe,realpathSync as Fz}from"fs";import{mkdir as gm,readdir as tOe,readFile as Bz,rm as Hz,writeFile as ax}from"fs/promises";import{createRequire as zz}from"module";import{homedir as _m,tmpdir as Wz}from"os";import{dirname as KE,isAbsolute as ox,join as Xt,posix as Kz,relative as Gz,resolve as lu,sep as lx,win32 as qz}from"path";import{createInterface as aOe}from"readline";import{fileURLToPath as Vz}from"url";import{setMaxListeners as Zz}from"events";import{spawn as Qz}from"child_process";import{existsSync as eW}from"fs";import{createInterface as tW}from"readline";import{StringDecoder as rW}from"string_decoder";import{homedir as zW}from"os";import{join as WW,resolve as JE}from"path";import{randomUUID as h4}from"crypto";import{join as r0}from"path";import{AsyncLocalStorage as f4}from"async_hooks";import{constants as m4}from"fs";import{appendFile as g4,copyFile as _4,lstat as v4,mkdir as y4,open as i0,readdir as s0,readFile as n0,stat as b4,unlink as E4,writeFile as Op}from"fs/promises";import{randomBytes as w4}from"crypto";import{constants as Wt}from"fs";import{lstat as rv,open as od,rename as S4,stat as C4,unlink as xc,writeFile as O4}from"fs/promises";import{constants as kx}from"fs";import{constants as Kq}from"fs";import{access as Bm,readdir as Gq,readFile as qq,readlink as Vq}from"fs/promises";import{homedir as Zq}from"os";import{delimiter as Xq,join as Xo,resolve as Mx}from"path";import*as Le from"fs";import{appendFile as o3,chmod as l3,copyFile as c3,link as u3,lstat as Tp,mkdir as d3,open as ac,readdir as p3,readFile as h0,readlink as h3,realpath as f3,rename as m3,rmdir as g3,rm as _3,stat as f0,symlink as v3,unlink as y3}from"fs/promises";import*as ct from"path";import{appendFile as Rp,mkdir as m0,rename as g0,stat as b3,symlink as E3,unlink as Dp}from"fs/promises";import{dirname as ln,isAbsolute as w3,join as Zi,resolve as Fx}from"path";import{readFile as R0}from"fs/promises";import{release as b9}from"os";import ht from"node:path";import Xx from"node:os";import Qm from"node:process";import{isAbsolute as M9}from"path";import{existsSync as Iae}from"fs";import{readFile as rxe}from"fs/promises";import{once as j0}from"events";import{constants as cc,createWriteStream as Vae}from"fs";import{lstat as axe,open as oxe,readdir as cxe,realpath as uxe,stat as pxe}from"fs/promises";import{basename as fxe,dirname as mxe,join as _xe}from"path";import{execFile as Zae}from"child_process";import{promisify as Xae}from"util";import{execFileSync as Exe}from"child_process";import{lstatSync as Sxe}from"fs";import{join as Oxe}from"path";import{basename as Mxe,dirname as Uxe,join as jxe}from"path";import{createHash as ooe}from"crypto";import{isAbsolute as ake,sep as oke}from"path";import{readdir as cke,stat as uke}from"fs/promises";import{basename as pke,dirname as hke,join as fke}from"path";import{basename as _ke,join as vke}from"path";import{readFile as bke}from"fs/promises";import{dirname as wke,join as Ske}from"path";import{basename as Oke,dirname as Ake}from"path";import{constants as Tke}from"fs";import{lstat as Dke,open as Ike}from"fs/promises";import{dirname as Pke,join as Nke}from"path";import{constants as jke}from"fs";import{open as Bke,readdir as Hke,rm as zke,stat as Wke}from"fs/promises";import{join as Gke}from"path";import{randomUUID as Vke}from"crypto";import{basename as Xke,join as Yke}from"path";import{readdir as Qke,readFile as eTe}from"fs/promises";import{isAbsolute as rTe,join as iTe,relative as sTe,sep as nTe}from"path";import{copyFile as ope,readFile as lpe,rm as lT,writeFile as cT}from"fs/promises";import{homedir as pw}from"os";import{join as Fp}from"path";import{createHash as dpe}from"crypto";import{userInfo as ppe}from"os";import{resolve as ITe}from"path";import{join as xn}from"path";import{dirname as Tfe}from"path";import{join as Hfe}from"path";import{homedir as zTe}from"os";import{dirname as KTe,join as GTe,resolve as qTe}from"path";import{join as L_e}from"path";import{isAbsolute as Nw}from"path";import{posix as wR,win32 as SR}from"path";import{posix as xve,win32 as kve}from"path";import{isIPv4 as Tve,isIPv6 as Rve}from"net";import{userInfo as jEe}from"os";import{execFile as b0e}from"child_process";import{accessSync as E0e,closeSync as w0e,constants as S0e,openSync as C0e,readSync as O0e}from"fs";if(typeof Symbol.dispose!="symbol")try{Symbol.dispose=Symbol.for("Symbol.dispose")}catch{}if(typeof Symbol.asyncDispose!="symbol")try{Symbol.asyncDispose=Symbol.for("Symbol.asyncDispose")}catch{}var tI=Object.create,{getPrototypeOf:rI,defineProperty:Yp,getOwnPropertyNames:iI}=Object,sI=Object.prototype.hasOwnProperty;function nI(e){return this[e]}var aI,oI,lr=(e,t,r)=>{var i=e!=null&&typeof e=="object";if(i){var s=t?aI??=new WeakMap:oI??=new WeakMap,n=s.get(e);if(n)return n}r=e!=null?tI(rI(e)):{};let a=t||!e||!e.__esModule?Yp(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e=="object"||typeof e=="function")for(let o of iI(e))sI.call(a,o)||Yp(a,o,{get:nI.bind(e,o),enumerable:!0});return i&&s.set(e,a),a},j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lI=e=>e;function cI(e,t){this[e]=lI.bind(null,t)}var fr=(e,t)=>{for(var r in t)Yp(e,r,{get:t[r],enumerable:!0,configurable:!0,set:cI.bind(t,r)})},Z=(e,t)=>()=>(e&&(t=e(e=0)),t),Me=eI(import.meta.url),uI=Symbol.dispose||Symbol.for("Symbol.dispose"),dI=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Ft=(e,t,r)=>{if(t!=null){if(typeof t!="object"&&typeof t!="function")throw TypeError('Object expected to be assigned to "using" declaration');var i;if(r&&(i=t[dI]),i===void 0&&(i=t[uI]),typeof i!="function")throw TypeError("Object not disposable");e.push([r,i,t])}else r&&e.push([r]);return t},Bt=(e,t,r)=>{var i=typeof SuppressedError=="function"?SuppressedError:function(a,o,l,c){return c=Error(l),c.name="SuppressedError",c.error=a,c.suppressed=o,c},s=a=>t=r?new i(a,t,"An error was suppressed during disposal"):(r=!0,a),n=a=>{for(;a=e.pop();)try{var o=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(o).then(n,l=>(s(l),n()))}catch(l){s(l)}if(r)throw t};return n()},Ld,IS,LS=Z(()=>{Ld=globalThis.process?.getBuiltinModule?.("async_hooks"),IS=Ld?e=>Ld.AsyncResource.bind(e):e=>e});function st(e){if(!e)return!1;if(typeof e=="boolean")return e;let t=String(e).toLowerCase().trim();return["1","true","yes","on"].includes(t)}function PS(e){if(e===void 0)return!1;if(typeof e=="boolean")return!e;let t=String(e).toLowerCase().trim();return["0","false","no","off"].includes(t)}function dr(){let e=new Set;return{subscribe(t){let r=IS(t);return e.add(r),()=>{e.delete(r)}},emit(...t){let r;for(let i of e)try{i(...t)}catch(s){(r??=[]).push(s)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){e.clear()}}}var pI=Z(()=>{LS()}),hI=()=>{},Qo=Z(()=>{LS(),pI(),hI()});function ie(e,t,r,i,s){if(i==="m")throw TypeError("Private method is not writable");if(i==="a"&&!s)throw TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}function D(e,t,r,i){if(r==="a"&&!i)throw TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)}var Cr=()=>{},Dc=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return Dc=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^r()&15>>+i/4).toString(16))};function Rn(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var Ic=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},we,zt,Pr,yn,Jg,NS,Jp,Qp,eh,th,rh,ih,sh,nh,dt=Z(()=>{we=class extends Error{},zt=class ah extends we{constructor(t,r,i,s,n){super(`${ah.makeMessage(t,r,i)}`),this.status=t,this.headers=s,this.requestID=s?.get("request-id"),this.error=r,this.type=n??null}static makeMessage(t,r,i){let s=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):i;return t&&s?`${t} ${s}`:t?`${t} status code (no body)`:s||"(no status code or body)"}static generate(t,r,i,s){if(!t||!s)return new yn({message:i,cause:Ic(r)});let n=r,a=n?.error?.type;return t===400?new Jp(t,n,i,s,a):t===401?new Qp(t,n,i,s,a):t===403?new eh(t,n,i,s,a):t===404?new th(t,n,i,s,a):t===409?new rh(t,n,i,s,a):t===422?new ih(t,n,i,s,a):t===429?new sh(t,n,i,s,a):t>=500?new nh(t,n,i,s,a):new ah(t,n,i,s,a)}},Pr=class extends zt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},yn=class extends zt{constructor({message:t,cause:r}){super(void 0,void 0,t||"Connection error.",void 0),r&&(this.cause=r)}},Jg=class extends yn{constructor({message:t}={}){super({message:t??"Request timed out."})}},NS=class extends we{constructor(t,{cause:r}={}){super(t??"Retryable error."),r!==void 0&&(this.cause=r)}},Jp=class extends zt{},Qp=class extends zt{},eh=class extends zt{},th=class extends zt{},rh=class extends zt{},ih=class extends zt{},sh=class extends zt{},nh=class extends zt{}});function Al(e){return typeof e!="object"?{}:e??{}}function Qv(e){if(!e)return!0;for(let t in e)return!1;return!0}function fI(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var MS,mI=e=>MS.test(e),ur=e=>(ur=Array.isArray,ur(e)),oh,gI=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new we(`${e} must be an integer`);if(t<0)throw new we(`${e} must be a positive integer`);return t},US=e=>{try{return JSON.parse(e)}catch{return}},oi=Z(()=>{dt(),MS=/^[a-z][a-z0-9+.-]*:/i,oh=ur}),ws=(e,t)=>new Promise(r=>{if(t?.aborted)return r();let i=()=>{clearTimeout(s),r()},s=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e);t?.addEventListener("abort",i,{once:!0})}),Vi="0.112.1";function _I(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function vI(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:r}of e){let i=r.exec(navigator.userAgent);if(i){let s=i[1]||0,n=i[2]||0,a=i[3]||0;return{browser:t,version:`${s}.${n}.${a}`}}}return null}var yI=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",bI=()=>{let e=_I();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Vi,"X-Stainless-OS":ty(Deno.build.os),"X-Stainless-Arch":ey(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Vi,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Vi,"X-Stainless-OS":ty(globalThis.process.platform??"unknown"),"X-Stainless-Arch":ey(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=vI();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Vi,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Vi,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},ey=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",ty=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),ry,Qg=()=>ry??(ry=bI()),lh=()=>{};function EI(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function $S(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function jS(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return $S({start(){},async pull(r){let{done:i,value:s}=await t.next();i?r.close():r.enqueue(s)},async cancel(){await t.return?.()}})}function e_(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();return r?.done&&t.releaseLock(),r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function wI(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}var SI=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)}),FS="RFC3986",BS=e=>String(e),ch,CI="RFC1738",HS=Z(()=>{ch={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:BS}});function OI(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function iy(e,t){if(ur(e)){let r=[];for(let i=0;i<e.length;i+=1)r.push(t(e[i]));return r}return t(e)}var uh=(e,t)=>(uh=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),uh(e,t)),Vr,Pd=1024,AI=(e,t,r,i,s)=>{if(e.length===0)return e;let n=e;if(typeof e=="symbol"?n=Symbol.prototype.toString.call(e):typeof e!="string"&&(n=String(e)),r==="iso-8859-1")return escape(n).replace(/%u[0-9a-f]{4}/gi,function(o){return"%26%23"+parseInt(o.slice(2),16)+"%3B"});let a="";for(let o=0;o<n.length;o+=Pd){let l=n.length>=Pd?n.slice(o,o+Pd):n,c=[];for(let u=0;u<l.length;++u){let p=l.charCodeAt(u);if(p===45||p===46||p===95||p===126||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||s===CI&&(p===40||p===41)){c[c.length]=l.charAt(u);continue}if(p<128){c[c.length]=Vr[p];continue}if(p<2048){c[c.length]=Vr[192|p>>6]+Vr[128|p&63];continue}if(p<55296||p>=57344){c[c.length]=Vr[224|p>>12]+Vr[128|p>>6&63]+Vr[128|p&63];continue}u+=1,p=65536+((p&1023)<<10|l.charCodeAt(u)&1023),c[c.length]=Vr[240|p>>18]+Vr[128|p>>12&63]+Vr[128|p>>6&63]+Vr[128|p&63]}a+=c.join("")}return a},xI=Z(()=>{HS(),oi(),Vr=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})()});function kI(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}function zS(e,t,r,i,s,n,a,o,l,c,u,p,h,f,_,v,E,y){let m=e,g=y,b=0,C=!1;for(;(g=g.get(hc))!==void 0&&!C;){let T=g.get(e);if(b+=1,typeof T<"u"){if(T===b)throw RangeError("Cyclic object value");C=!0}typeof g.get(hc)>"u"&&(b=0)}if(typeof c=="function"?m=c(t,m):m instanceof Date?m=h?.(m):r==="comma"&&ur(m)&&(m=iy(m,function(T){return T instanceof Date?h?.(T):T})),m===null){if(n)return l&&!v?l(t,At.encoder,E,"key",f):t;m=""}if(kI(m)||OI(m)){if(l){let T=v?t:l(t,At.encoder,E,"key",f);return[_?.(T)+"="+_?.(l(m,At.encoder,E,"value",f))]}return[_?.(t)+"="+_?.(String(m))]}let A=[];if(typeof m>"u")return A;let w;if(r==="comma"&&ur(m))v&&l&&(m=iy(m,l)),w=[{value:m.length>0?m.join(",")||null:void 0}];else if(ur(c))w=c;else{let T=Object.keys(m);w=u?T.sort(u):T}let S=o?String(t).replace(/\./g,"%2E"):String(t),x=i&&ur(m)&&m.length===1?S+"[]":S;if(s&&ur(m)&&m.length===0)return x+"[]";for(let T=0;T<w.length;++T){let I=w[T],L=typeof I=="object"&&typeof I.value<"u"?I.value:m[I];if(a&&L===null)continue;let P=p&&o?I.replace(/\./g,"%2E"):I,$=ur(m)?typeof r=="function"?r(x,P):x:x+(p?"."+P:"["+P+"]");y.set(e,b);let se=new WeakMap;se.set(hc,y),WS(A,zS(L,$,r,i,s,n,a,o,r==="comma"&&v&&ur(m)?null:l,c,u,p,h,f,_,v,E,se))}return A}function TI(e=At){if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw TypeError("Encoder has to be a function.");let t=e.charset||At.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let r=FS;if(typeof e.format<"u"){if(!uh(ch,e.format))throw TypeError("Unknown format option provided.");r=e.format}let i=ch[r],s=At.filter;(typeof e.filter=="function"||ur(e.filter))&&(s=e.filter);let n;if(e.arrayFormat&&e.arrayFormat in t_?n=e.arrayFormat:"indices"in e?n=e.indices?"indices":"repeat":n=At.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let a=typeof e.allowDots>"u"?e.encodeDotInKeys?!0:At.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:At.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:At.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:At.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?At.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:At.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:At.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:At.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:At.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:At.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:At.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:At.strictNullHandling}}function RI(e,t={}){let r=e,i=TI(t),s,n;typeof i.filter=="function"?(n=i.filter,r=n("",r)):ur(i.filter)&&(n=i.filter,s=n);let a=[];if(typeof r!="object"||r===null)return"";let o=t_[i.arrayFormat],l=o==="comma"&&i.commaRoundTrip;s||(s=Object.keys(r)),i.sort&&s.sort(i.sort);let c=new WeakMap;for(let h=0;h<s.length;++h){let f=s[h];i.skipNulls&&r[f]===null||WS(a,zS(r[f],f,o,l,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}let u=a.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),u.length>0?p+u:""}var t_,WS=function(e,t){Array.prototype.push.apply(e,ur(t)?t:[t])},sy,At,hc,DI=Z(()=>{xI(),HS(),oi(),t_={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},At={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:AI,encodeValuesOnly:!1,format:FS,formatter:BS,indices:!1,serializeDate(e){return(sy??(sy=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1},hc={}});function II(e){return RI(e,{arrayFormat:"brackets"})}var KS=Z(()=>{DI()});function GS(e){if(!e)return;let t;try{t=new URL(e)}catch(i){throw new nt(`Invalid token endpoint base URL "${e}": ${i}`)}if(t.protocol==="https:")return;let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(t.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new nt(`Refusing to send credential over non-https token endpoint "${e}"`)}async function qS(e,t){let r=await LI(e),i;try{i=JSON.parse(r)}catch{throw new nt(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Nr(r),t)}if(!i.access_token)throw new nt(`Token endpoint response missing access_token: ${JSON.stringify(Nr(i))}`,e.status,Nr(i),t);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new nt(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,e.status,Nr(i),t);return i}function Nr(e){if(e==null)return e;if(typeof e=="string"){let t;try{t=JSON.parse(e)}catch{return e.length<=Nd?e:e.slice(0,Nd)+`... <${e.length-Nd} more chars>`}return JSON.stringify(Nr(t))}if(typeof e=="object"&&!Array.isArray(e)){let t={};for(let[r,i]of Object.entries(e))YS.has(r)&&(t[r]=i);return t}return null}async function VS(e,t=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),i=e,s;try{i=await r.promises.realpath(e),s=await r.promises.stat(i)}catch{return}let n=s.mode&511;if(n&18)throw new nt(`Credentials file at ${i} is group/world-writable (mode 0o${n.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(n&36)throw new nt(`Credentials file at ${i} is group/world-readable (mode 0o${n.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);typeof process.getuid=="function"&&s.uid!==process.getuid()&&t(`credentials file at ${i} is owned by uid ${s.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function ZS(e,t){let r=await import("node:fs"),i=(await import("node:path")).dirname(e);await r.promises.mkdir(i,{recursive:!0,mode:448});let s=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let n=await r.promises.open(s,"w",384);try{await n.writeFile(JSON.stringify(t,null,2)),await n.sync()}finally{await n.close()}await r.promises.rename(s,e)}catch(n){throw await r.promises.unlink(s).catch(()=>{}),n}try{let n=await r.promises.open(i,"r");try{await n.sync()}finally{await n.close()}}catch{}}async function LI(e){if(!e.body)return"";let t=e.body.getReader(),r=[],i=0;for(;;){let{done:n,value:a}=await t.read();if(n)break;if(i+a.length>ny){let o=ny-i;o>0&&r.push(a.subarray(0,o)),await t.cancel();break}r.push(a),i+=a.length}let s;if(r.length===1)s=r[0];else{s=new Uint8Array(r.reduce((a,o)=>a+o.length,0));let n=0;for(let a of r)s.set(a,n),n+=a.length}return new TextDecoder("utf-8").decode(s)}var PI="urn:ietf:params:oauth:grant-type:jwt-bearer",NI="refresh_token",XS="/v1/oauth/token",Lc="oauth-2025-04-20",MI="oidc-federation-2026-04-01",UI=120,r_=30,$I=5,ny=1048576,Nd=2e3,YS,nt,el=Z(()=>{dt(),YS=new Set(["error","error_description","error_uri"]),nt=class extends we{constructor(t,r=null,i=null,s=null){super(t),this.statusCode=r,this.body=i,this.requestId=s}}});function Ss(){return Math.floor(Date.now()/1e3)}var dh=class{constructor(t,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=t,this.onAdvisoryRefreshError=r}async getToken(){let t=this.nextForce;this.nextForce=!1;let r=this.cached;if(t||r==null)return(await this.refresh(t)).token;if(r.expiresAt==null)return r.token;let i=r.expiresAt-Ss();return i>UI?r.token:i>r_?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(t=!1){return this.pendingRefresh&&!t?this.pendingRefresh:this.doRefresh(t)}backgroundRefresh(){this.pendingRefresh||Ss()-this.lastAdvisoryError<$I||this.doRefresh().catch(t=>{this.lastAdvisoryError=Ss(),this.onAdvisoryRefreshError?.(t)})}doRefresh(t=!1){return this.pendingRefresh=this.provider(t?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}},jI=Z(()=>{el()}),qe=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0};function FI(e){let t=0;for(let s of e)t+=s.length;let r=new Uint8Array(t),i=0;for(let s of e)r.set(s,i),i+=s.length;return r}function i_(e){let t;return(oy??(t=new globalThis.TextEncoder,oy=t.encode.bind(t)))(e)}function ay(e){let t;return(ly??(t=new globalThis.TextDecoder,ly=t.decode.bind(t)))(e)}var oy,ly,BI=Z(()=>{dt()});function io(){}function xl(e,t,r){return!t||To[e]>To[r]?io:t[e].bind(t)}function ph(e,t){let r=fh.get(e);if(r&&r[0]===t)return r[1];let i={error:xl("error",e,t),warn:xl("warn",e,t),info:xl("info",e,t),debug:xl("debug",e,t)};return fh.set(e,[t,i]),i}function it(e){let t=e.logger,r=e.logLevel??"off";return t?ph(t,r):JS}function HI(){let e=qe("ANTHROPIC_LOG");return(!Md||e!==cy)&&(cy=e,Md=ph(console,hh(e,"process.env['ANTHROPIC_LOG']",ph(console,Pc))??Pc)),Md}var Pc="warn",To,hh=(e,t,r)=>{if(e){if(fI(To,e))return e;r.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(To))}`)}},JS,fh,cy,Md,Hi=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),Ri=Z(()=>{oi(),To={off:0,error:200,warn:300,info:400,debug:500},JS={error:io,warn:io,info:io,debug:io},fh=new WeakMap}),QS=Z(()=>{oi(),BI(),Ri(),KS()});function eC(e){if(!e)throw Error("profile name is empty");if(e==="."||e==="..")throw Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw Error(`profile name "${e}" must not contain path separators`);if(!rC.test(e))throw Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var tC="1.0",rC,zI=async e=>{var t,r;let i=await s_();if(i===null)return null;let s=e??await iC();if(s===null)return null;eC(s);let n=await import("node:fs"),a=(await import("node:path")).join(i,"configs",`${s}.json`),o;try{o=await n.promises.readFile(a,"utf-8")}catch(u){if(u?.code!=="ENOENT")throw Error(`failed to read config file ${a}: ${u}`);o=null}if(o===null){let u=qe("ANTHROPIC_ORGANIZATION_ID"),p=qe("ANTHROPIC_IDENTITY_TOKEN_FILE"),h=qe("ANTHROPIC_FEDERATION_RULE_ID");return h&&u?{fromFile:!1,config:{organization_id:u,workspace_id:qe("ANTHROPIC_WORKSPACE_ID"),base_url:qe("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:h,service_account_id:qe("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:p?{source:"file",path:p}:void 0,scope:qe("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(o)}catch(u){throw Error(`failed to parse config file ${a}: ${u}`)}if(!l.authentication)throw Error(`config file ${a} is missing "authentication"`);let c=l.authentication.type;if(c!=="oidc_federation"&&c!=="user_oauth")throw Error(`authentication.type "${c}" is not a known authentication type`);if(l.organization_id??(l.organization_id=qe("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=qe("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=qe("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=qe("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let u=qe("ANTHROPIC_IDENTITY_TOKEN_FILE");u&&(l.authentication.identity_token={source:"file",path:u})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=qe("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=l.authentication).service_account_id??(r.service_account_id=qe("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},WI=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let r=await s_();if(!r)return null;let i=t??await iC();return i?(eC(i),(await import("node:path")).join(r,"credentials",`${i}.json`)):null},s_=async()=>{if(!KI())return null;let e=await import("node:path"),t=qe("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Qg()["X-Stainless-OS"]==="Windows"){let s=qe("APPDATA");if(s)return e.join(s,"Anthropic");let n=qe("USERPROFILE");return n?e.join(n,"AppData","Roaming","Anthropic"):null}let r=qe("XDG_CONFIG_HOME");if(r)return e.join(r,"anthropic");let i=qe("HOME");return i?e.join(i,".config","anthropic"):null},KI=()=>{let e=Qg()["X-Stainless-Runtime"];return e==="node"||e==="deno"},iC=async()=>{let e=await s_();if(!e)return null;let t=qe("ANTHROPIC_PROFILE");if(t)return t;let r=await import("node:fs"),i=(await import("node:path")).join(e,"active_config");try{return(await r.promises.readFile(i,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw Error(`failed to read ${i}: ${s}`);return"default"}},sC=Z(()=>{lh(),QS(),rC=/^[A-Za-z0-9_.-]+$/});function uy(e){if(!e)throw new we("Identity token file path is empty");return async()=>{let t=await import("node:fs"),r;try{r=await t.promises.readFile(e,"utf-8")}catch(s){throw new we(`Failed to read identity token file at ${e}: ${s}`)}let i=r.trim();if(!i)throw new we(`Identity token file at ${e} is empty`);return i}}function GI(e){if(!e)throw new we("Identity token value is empty");return()=>e}var qI=Z(()=>{dt()});function VI(e){return async()=>{GS(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16384)throw new nt(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:PI,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};e.serviceAccountId&&(r.service_account_id=e.serviceAccountId),e.workspaceId&&(r.workspace_id=e.workspaceId);let i=`${e.baseURL}${XS}`,s;try{s=await e.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${Lc},${MI}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Vi} oidcFederationProvider`},body:JSON.stringify(r)})}catch(l){throw new nt(`Failed to reach token endpoint ${i}: ${l}`)}let n=s.headers.get("Request-Id");if(!s.ok){let l=await s.text().catch(()=>""),c=Nr(l),u="";throw s.status===401&&(u=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new nt(`Token exchange failed with status ${s.status}${n?` (request-id ${n})`:""}: ${c}${u}`,s.status,c,n)}let a=await qS(s,n),o=Number(a.expires_in);if(!Number.isFinite(o))throw new nt(`Token endpoint response missing required fields: ${JSON.stringify(Nr(a))}`,s.status,Nr(a),n);return{token:a.access_token,expiresAt:Ss()+o}}}var ZI=Z(()=>{el()});function XI(e){return async t=>{let r=await import("node:fs");await VS(e.credentialsPath,e.onSafetyWarning);let i;try{i=await r.promises.readFile(e.credentialsPath,"utf-8")}catch(E){throw new nt(`Credentials file not found at ${e.credentialsPath}: ${E}`)}let s;try{s=JSON.parse(i)}catch(E){throw new nt(`Credentials file at ${e.credentialsPath} is not valid JSON: ${E}`)}let n=s.access_token;if(!n)throw new nt(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let a=s.expires_at;if(!t?.forceRefresh&&(a==null||Ss()<a-r_))return{token:n,expiresAt:a??null};let o=s.refresh_token;if(!e.clientId||!o)throw new nt(`Access token at ${e.credentialsPath} has expired and no refresh is available (client_id ${e.clientId?"set":"empty"}, refresh_token ${o?"set":"empty"})`);GS(e.baseURL);let l={grant_type:NI,refresh_token:o,client_id:e.clientId},c=`${e.baseURL}${XS}`,u;try{u=await e.fetch(c,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":Lc,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Vi} userOAuthProvider`},body:JSON.stringify(l)})}catch(E){throw new nt(`User OAuth refresh failed to reach token endpoint: ${E}`)}let p=u.headers.get("Request-Id");if(!u.ok){let E=await u.text().catch(()=>"");throw new nt(`User OAuth refresh failed (HTTP ${u.status}): ${Nr(E)}`,u.status,Nr(E),p)}let h=await qS(u,p),f=Number(h.expires_in);if(!Number.isFinite(f))throw new nt(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Nr(h))}`,u.status,Nr(h),p);let _=Ss()+f,v=h.refresh_token||o;return await ZS(e.credentialsPath,{...s,version:tC,type:"oauth_token",access_token:h.access_token,expires_at:_,refresh_token:v}),{token:h.access_token,expiresAt:_}}}var YI=Z(()=>{sC(),el()});function nC(e,t){let r=e.authentication.credentials_path??null,i=(e.base_url||t.baseURL).replace(/\/+$/,""),s=QI(e,r,i,t),n={};return e.workspace_id&&e.authentication.type==="user_oauth"&&(n["anthropic-workspace-id"]=e.workspace_id),{provider:s,extraHeaders:n,baseURL:e.base_url||void 0}}async function JI(e,t){let r=await zI(t);if(!r)return null;let{config:i,fromFile:s}=r,n=i.authentication.credentials_path||!s?i:{...i,authentication:{...i.authentication,credentials_path:await WI(i,t)??void 0}};return nC(n,e)}function QI(e,t,r,i){switch(e.authentication.type){case"oidc_federation":{let s=e.authentication,n=eL(s);if(!n)throw new nt("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!s.federation_rule_id)throw new nt("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new nt("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let a=VI({identityTokenProvider:n,federationRuleId:s.federation_rule_id,organizationId:e.organization_id,serviceAccountId:s.service_account_id,workspaceId:e.workspace_id,baseURL:r,fetch:i.fetch,userAgent:i.userAgent});return t?tL(a,t,i.onCacheWriteError,i.onSafetyWarning):a}case"user_oauth":{if(!t)throw new nt("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return XI({credentialsPath:t,clientId:e.authentication.client_id,baseURL:r,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let s=e.authentication.type;throw new nt(`authentication.type "${s}" is not a known authentication type`)}}}function eL(e){if(e.identity_token){let i=e.identity_token.source;if(i!=="file")throw new nt(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new nt('identity_token.source "file" requires a non-empty path');return uy(e.identity_token.path)}let t=qe("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return uy(t);let r=qe("ANTHROPIC_IDENTITY_TOKEN");return r?GI(r):null}function tL(e,t,r,i){return async s=>{let n=await import("node:fs");await VS(t,i);let a;try{let l=await n.promises.readFile(t,"utf-8");a=JSON.parse(l);let c=a?.access_token;if(c&&!s?.forceRefresh){let u=a?.expires_at;if(u==null||Ss()<u-r_)return{token:c,expiresAt:u??null}}}catch(l){l?.code!=="ENOENT"&&!(l instanceof SyntaxError)&&r?.(l)}let o=await e(s);try{await ZS(t,{...a??{},version:tC,type:"oauth_token",access_token:o.token,expires_at:o.expiresAt})}catch(l){r?.(l)}return o}}var rL=Z(()=>{sC(),el(),qI(),ZI(),YI()}),Os=class{constructor(){yr.set(this,void 0),br.set(this,void 0),ie(this,yr,new Uint8Array,"f"),ie(this,br,null,"f")}decode(t){if(t==null)return[];let r=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?i_(t):t;ie(this,yr,FI([D(this,yr,"f"),r]),"f");let i=[],s;for(;(s=iL(D(this,yr,"f"),D(this,br,"f")))!=null;){if(s.carriage&&D(this,br,"f")==null){ie(this,br,s.index,"f");continue}if(D(this,br,"f")!=null&&(s.index!==D(this,br,"f")+1||s.carriage)){i.push(ay(D(this,yr,"f").subarray(0,D(this,br,"f")-1))),ie(this,yr,D(this,yr,"f").subarray(D(this,br,"f")),"f"),ie(this,br,null,"f");continue}let n=D(this,br,"f")!==null?s.preceding-1:s.preceding,a=ay(D(this,yr,"f").subarray(0,n));i.push(a),ie(this,yr,D(this,yr,"f").subarray(s.index),"f"),ie(this,br,null,"f")}return i}flush(){return D(this,yr,"f").length?this.decode(`
|
|
3
|
+
`):[]}};function iL(e,t){for(let r=t??0;r<e.length;r++){if(e[r]===10)return{preceding:r,index:r+1,carriage:!1};if(e[r]===13)return{preceding:r,index:r+1,carriage:!0}}return null}function sL(e){for(let t=0;t<e.length-1;t++){if(e[t]===10&&e[t+1]===10||e[t]===13&&e[t+1]===13)return t+2;if(e[t]===13&&e[t+1]===10&&t+3<e.length&&e[t+2]===13&&e[t+3]===10)return t+4}return-1}var yr,br,aC=Z(()=>{Cr(),yr=new WeakMap,br=new WeakMap,Os.NEWLINE_CHARS=new Set([`
|
|
4
|
+
`,"\r"]),Os.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*dy(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new we("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new we("Attempted to iterate over a response with no body");let r=new mh,i=new Os,s=e_(e.body);for await(let n of nL(s))for(let a of i.decode(n)){let o=r.decode(a);o&&(yield o)}for(let n of i.flush()){let a=r.decode(n);a&&(yield a)}}async function*nL(e){let t=new Uint8Array;for await(let r of e){if(r==null)continue;let i=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?i_(r):r,s=new Uint8Array(t.length+i.length);s.set(t),s.set(i,t.length),t=s;let n;for(;(n=sL(t))!==-1;)yield t.slice(0,n),t=t.slice(n)}t.length>0&&(yield t)}var mh=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let n={event:this.event,data:this.data.join(`
|
|
5
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],n}if(this.chunks.push(t),t.startsWith(":"))return null;let[r,i,s]=aL(t,":");return s.startsWith(" ")&&(s=s.substring(1)),r==="event"?this.event=s:r==="data"&&this.data.push(s),null}};function aL(e,t){let r=e.indexOf(t);return r!==-1?[e.substring(0,r),t,e.substring(r+t.length)]:[e,"",""]}var Aa,As,Lu=Z(()=>{Cr(),dt(),aC(),oi(),Ri(),dt(),As=class so{constructor(t,r,i){this.iterator=t,Aa.set(this,void 0),this.controller=r,ie(this,Aa,i,"f")}static rawEvents(t,r=new AbortController){return dy(t,r)}static fromSSEResponse(t,r,i){let s=!1,n=i?it(i):console;async function*a(){if(s)throw new we("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let o=!1;try{for await(let l of dy(t,r)){if(l.event==="completion")try{yield JSON.parse(l.data)}catch(c){throw n.error("Could not parse message into JSON:",l.data),n.error("From chunk:",l.raw),c}if(l.event==="message_start"||l.event==="message_delta"||l.event==="message_stop"||l.event==="content_block_start"||l.event==="content_block_delta"||l.event==="content_block_stop"||l.event==="message"||l.event==="user.message"||l.event==="user.interrupt"||l.event==="user.tool_confirmation"||l.event==="user.custom_tool_result"||l.event==="user.tool_result"||l.event==="agent.message"||l.event==="agent.thinking"||l.event==="agent.tool_use"||l.event==="agent.tool_result"||l.event==="agent.mcp_tool_use"||l.event==="agent.mcp_tool_result"||l.event==="agent.custom_tool_use"||l.event==="agent.thread_context_compacted"||l.event==="session.status_running"||l.event==="session.status_idle"||l.event==="session.status_rescheduled"||l.event==="session.status_terminated"||l.event==="session.error"||l.event==="session.deleted"||l.event==="session.updated"||l.event==="span.model_request_start"||l.event==="span.model_request_end"||l.event==="span.outcome_evaluation_start"||l.event==="span.outcome_evaluation_ongoing"||l.event==="span.outcome_evaluation_end"||l.event==="user.define_outcome"||l.event==="agent.thread_message_received"||l.event==="agent.thread_message_sent"||l.event==="agent.session_thread_message_received"||l.event==="agent.session_thread_message_sent"||l.event==="session.thread_created"||l.event==="session.thread_status_created"||l.event==="session.thread_status_running"||l.event==="session.thread_status_idle"||l.event==="session.thread_status_rescheduled"||l.event==="session.thread_status_terminated"||l.event==="event_start"||l.event==="event_delta"||l.event==="system.message")try{yield JSON.parse(l.data)}catch(c){throw n.error("Could not parse message into JSON:",l.data),n.error("From chunk:",l.raw),c}if(l.event!=="ping"&&l.event==="error"){let c=US(l.data)??l.data,u=c?.error?.type;throw new zt(void 0,c,void 0,t.headers,u)}}o=!0}catch(l){if(Rn(l))return;throw l}finally{o||r.abort()}}return new so(a,r,i)}static fromReadableStream(t,r,i){let s=!1;async function*n(){let o=new Os,l=e_(t);for await(let c of l)for(let u of o.decode(c))yield u;for(let c of o.flush())yield c}async function*a(){if(s)throw new we("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let o=!1;try{for await(let l of n())o||l&&(yield JSON.parse(l));o=!0}catch(l){if(Rn(l))return;throw l}finally{o||r.abort()}}return new so(a,r,i)}[(Aa=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],r=[],i=this.iterator(),s=n=>({next:()=>{if(n.length===0){let a=i.next();t.push(a),r.push(a)}return n.shift()}});return[new so(()=>s(t),this.controller,D(this,Aa,"f")),new so(()=>s(r),this.controller,D(this,Aa,"f"))]}toReadableStream(){let t=this,r;return $S({async start(){r=t[Symbol.asyncIterator]()},async pull(i){try{let{value:s,done:n}=await r.next();if(n)return i.close();let a=i_(JSON.stringify(s)+`
|
|
6
|
+
`);i.enqueue(a)}catch(s){i.error(s)}},async cancel(){await r.return?.()}})}}});async function oC(e,t){let{response:r,requestLogID:i,retryOfRequestLogID:s,startTime:n}=t,a=await(async()=>{if(t.options.stream)return it(e).debug("response",r.status,r.url,r.headers,r.body),As.fromSSEResponse(r,t.controller);if(r.status===204)return null;if(t.options.__binaryResponse)return r;let o=r.headers.get("content-type")?.split(";")[0]?.trim();if(o?.includes("application/json")||o?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let l=await r.json();return n_(l,r)}return await r.text()})();return it(e).debug(`[${i}] response parsed`,Hi({retryOfRequestLogID:s,url:r.url,status:r.status,body:a,durationMs:Date.now()-n})),a}function n_(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}var a_=Z(()=>{Lu(),Ri()});function lC(e){return typeof e=="object"&&e!==null&&o_.has(e)}function oL(e){let t=new Set;for(;typeof e=="object"&&e!==null&&!t.has(e);){if(t.add(e),lC(e)||Rn(e)||e instanceof yn||e instanceof NS)return!0;e=e.cause}return!1}function py(e,t,r,i){return async(s,n={})=>{if(t.length===0)return e.call(void 0,s,n);let a=n.headers instanceof Headers?n.headers:new Headers(n.headers),o=await cL(e,t,r,i)({...n,headers:a,url:typeof s=="string"?s:s instanceof URL?s.href:s.url});if(o.bodyUsed||o.body?.locked)throw new we("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return o}}function lL(e,t){let r=new WeakMap;return{options:e,logger:t?it(t):HI(),parse(i){if(e?.stream&&i.ok)return hy(i,e);let s=r.get(i);return s||(s=hy(i,e),r.set(i,s)),s}}}async function hy(e,t){if(e.bodyUsed||e.body?.locked)throw new we("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return As.fromSSEResponse(e.clone(),new AbortController);if(e.status===204)return null;if(t?.__binaryResponse)return e;let r=e.headers.get("content-type")?.split(";")[0]?.trim();return r?.includes("application/json")||r?.endsWith("+json")?e.headers.get("content-length")==="0"?void 0:n_(await e.clone().json(),e):await e.clone().text()}function cL(e,t,r,i){let s=async({url:a,...o})=>{try{return await e.call(void 0,a,o)}catch(l){let c=Ic(l);throw o_.add(c),c}},n=lL(r,i);for(let a=t.length-1;a>=0;a--){let o=t[a],l=s;s=async c=>o(c,l,n)}return s}var o_,uL=Z(()=>{a_(),Ri(),dt(),Lu(),o_=new WeakSet}),xa,l_,c_=Z(()=>{Cr(),a_(),l_=class cC extends Promise{constructor(t,r,i=oC){super(s=>{s(null)}),this.responsePromise=r,this.parseResponse=i,xa.set(this,void 0),ie(this,xa,t,"f")}_thenUnwrap(t){return new cC(D(this,xa,"f"),this.responsePromise,async(r,i)=>n_(t(await this.parseResponse(r,i),i),i.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){let[t,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(D(this,xa,"f"),t))),this.parsedPromise}then(t,r){return this.parse().then(t,r)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}},xa=new WeakMap}),kl,Tl,uC,ra,Et,dC,Je=Z(()=>{Cr(),dt(),a_(),c_(),oi(),Tl=class{constructor(t,r,i,s){kl.set(this,void 0),ie(this,kl,t,"f"),this.options=s,this.response=r,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new we("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await D(this,kl,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(kl=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let r of t.getPaginatedItems())yield r}},uC=class extends l_{constructor(t,r,i){super(t,r,async(s,n)=>new i(s,n.response,await oC(s,n),n.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let r of t)yield r}},ra=class extends Tl{constructor(t,r,i,s){super(t,r,i,s),this.data=i.data||[],this.has_more=i.has_more||!1,this.first_id=i.first_id||null,this.last_id=i.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...Al(this.options.query),before_id:r}}:null}let t=this.last_id;return t?{...this.options,query:{...Al(this.options.query),after_id:t}}:null}},Et=class extends Tl{constructor(t,r,i,s){super(t,r,i,s),this.data=i.data||[],this.next_page=i.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Al(this.options.query),page:t}}:null}},dC=class extends Tl{constructor(t,r,i,s){super(t,r,i,s),this.data=i.data||[],this.next_page=i.next_page||null,this.prev_page=i.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Al(this.options.query),page:t}}:null}}});function bn(e,t,r){return pC(),new File(e,t??"unknown_file",r)}function fc(e,t){let r=typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"";return t?r.split(/[\\/]/).pop()||void 0:r}function dL(e){let t=typeof e=="function"?e:e.fetch,r=gh.get(t);if(r)return r;let i=(async()=>{try{let s="Response"in t?t.Response:(await t("data:,")).constructor,n=new FormData;return n.toString()!==await new s(n).text()}catch{return!0}})();return gh.set(t,i),i}var pC=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},hC=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",u_=async(e,t,r=!0)=>({...e,body:await pL(e.body,t,r)}),gh,pL=async(e,t,r=!0)=>{if(!await dL(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let i=new FormData;return await Promise.all(Object.entries(e||{}).map(([s,n])=>_h(i,s,n,r))),i},hL=e=>e instanceof Blob&&"name"in e,_h=async(e,t,r,i)=>{if(r!==void 0){if(r==null)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")e.append(t,String(r));else if(r instanceof Response){let s={},n=r.headers.get("Content-Type");n&&(s={type:n}),e.append(t,bn([await r.blob()],fc(r,i),s))}else if(hC(r))e.append(t,bn([await new Response(jS(r)).blob()],fc(r,i)));else if(hL(r))e.append(t,bn([r],fc(r,i),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(s=>_h(e,t+"[]",s,i)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([s,n])=>_h(e,`${t}[${s}]`,n,i)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},Ro=Z(()=>{gh=new WeakMap});async function fL(e,t,r){if(pC(),e=await e,t||(t=fc(e,!0)),gL(e))return e instanceof File&&t==null&&r==null?e:bn([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...r});if(_L(e)){let s=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),bn(await vh(s),t,r)}let i=await vh(e);if(!r?.type){let s=i.find(n=>typeof n=="object"&&"type"in n&&n.type);typeof s=="string"&&(r={...r,type:s})}return bn(i,t,r)}async function vh(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(fC(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(hC(e))for await(let r of e)t.push(...await vh(r));else{let r=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${r?`; constructor: ${r}`:""}${mL(e)}`)}return t}function mL(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(t=>`"${t}"`).join(", ")}]`}var fC=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",gL=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&fC(e),_L=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function",vL=Z(()=>{Ro(),Ro()}),mC=Z(()=>{vL()}),yL=()=>{},Ge=class{constructor(t){this._client=t}};function*bL(e){if(!e)return;if(d_ in e){let{values:i,nulls:s}=e;yield*i.entries();for(let n of s)yield[n,null];return}let t=!1,r;e instanceof Headers?r=e.entries():oh(e)?r=e:(t=!0,r=Object.entries(e??{}));for(let i of r){let s=i[0];if(typeof s!="string")throw TypeError("expected header name to be a string");let n=oh(i[1])?i[1]:[i[1]],a=!1;for(let o of n)o!==void 0&&(t&&!a&&(a=!0,yield[s,mo]),yield[s,o])}}var d_,mo,gC,EL=(e,t)=>{let r=e?e.split(",").map(i=>i.trim()).filter(Boolean):[];for(let i of t.split(",").map(s=>s.trim()))i&&!r.includes(i)&&r.push(i);return r.join(", ")},V=e=>{let t=new Headers,r=new Set;for(let i of e){let s=new Set;for(let[n,a]of bL(i)){let o=n.toLowerCase();if(gC.has(o)){if(a===mo)continue;a===null?(t.delete(n),r.add(o)):(t.set(n,EL(t.get(n),a)),r.delete(o));continue}(a===mo||!s.has(o))&&(t.delete(n),s.add(o),a===mo)||(a===null?(t.delete(n),r.add(o)):(t.append(n,a),r.delete(o)))}}return{[d_]:!0,values:t,nulls:r}},He=Z(()=>{oi(),d_=Symbol.for("brand.privateNullableHeaders"),mo=Symbol("clear"),gC=new Set(["x-stainless-helper"])});function _C(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var yh,wL=(e=_C)=>function(t,...r){if(t.length===1)return t[0];let i=!1,s=[],n=t.reduce((c,u,p)=>{/[?#]/.test(u)&&(i=!0);let h=r[p],f=(i?encodeURIComponent:e)(""+h);return p!==r.length&&(h==null||typeof h=="object"&&h.toString===Object.getPrototypeOf(Object.getPrototypeOf(h.hasOwnProperty??yh)??yh)?.toString)&&(f=h+"",s.push({start:c.length+u.length,length:f.length,error:`Value of type ${Object.prototype.toString.call(h).slice(8,-1)} is not a valid path parameter`})),c+u+(p===r.length?"":f)},""),a=n.split(/[?#]/,1)[0],o=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=o.exec(a))!==null;)s.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(s.sort((c,u)=>c.start-u.start),s.length>0){let c=0,u=s.reduce((p,h)=>{let f=" ".repeat(h.start-c),_="^".repeat(h.length);return c=h.start+h.length,p+f+_},"");throw new we(`Path parameters result in path with invalid segments:
|
|
7
|
+
${s.map(p=>p.error).join(`
|
|
8
|
+
`)}
|
|
9
|
+
${n}
|
|
10
|
+
${u}`)}return n},ue,et=Z(()=>{dt(),yh=Object.freeze(Object.create(null)),ue=wL(_C)}),bh,fy=Z(()=>{Je(),He(),et(),bh=class extends Ge{retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/deployment_runs/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}}),Eh,my=Z(()=>{Je(),He(),et(),Eh=class extends Ge{create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/deployments?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/deployments/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}update(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/deployments/${t}?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/deployments?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/deployments/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}pause(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/deployments/${t}/pause?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}run(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/deployments/${t}/run?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}unpause(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/deployments/${t}/unpause?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}}}),wh,gy=Z(()=>{Je(),He(),et(),wh=class extends Ge{create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/dreams?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/dreams/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"dreaming-2026-04-21"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/dreams?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString()},r?.headers])})}archive(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/dreams/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"dreaming-2026-04-21"].toString()},i?.headers])})}cancel(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/dreams/${t}/cancel?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"dreaming-2026-04-21"].toString()},i?.headers])})}}});function Sh(e){return{"x-stainless-helper":e}}function mc(e){return typeof e=="object"&&e!==null&&En in e}function vC(e,t){let r=new Set;if(e)for(let i of e)mc(i)&&r.add(i[En]);if(t)for(let i of t){mc(i)&&r.add(i[En]);let s=i.content;if(Array.isArray(s))for(let n of s)mc(n)&&r.add(n[En])}return Array.from(r)}function yC(e,t){let r=vC(e,t);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function SL(e){return mc(e)?{"x-stainless-helper":e[En]}:{}}var bC="x-stainless-helper",EC="x-stainless-helper-method",En,Di=Z(()=>{En=Symbol("anthropic.sdk.stainlessHelper")}),Ch,_y=Z(()=>{Je(),He(),Di(),Ro(),et(),Ch=class extends Ge{list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/files?beta=true",ra,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(t,r={},i){let{betas:s}=r??{};return this._client.delete(ue`/v1/files/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},i?.headers])})}download(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/files/${t}/content?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/files/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"files-api-2025-04-14"].toString()},i?.headers])})}upload(t,r){let{betas:i,...s}=t;return this._client.post("/v1/files?beta=true",u_({body:s,...r,headers:V([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},SL(s.file),r?.headers])},this._client))}}}),Oh,vy=Z(()=>{Je(),He(),et(),Oh=class extends Ge{retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/models/${t}?beta=true`,{...i,headers:V([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/models?beta=true",ra,{query:s,...r,headers:V([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}}}),Ah,yy=Z(()=>{Je(),He(),et(),Ah=class extends Ge{create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/user_profiles?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/user_profiles/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"user-profiles-2026-03-24"].toString()},i?.headers])})}update(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/user_profiles/${t}?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"user-profiles-2026-03-24"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/user_profiles?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/user_profiles/${t}/enrollment_url?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"user-profiles-2026-03-24"].toString()},i?.headers])})}}}),CL=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timingSafeEqual=void 0;function t(i,s=""){if(!i)throw Error(s)}function r(i,s){if(i.byteLength!==s.byteLength)return!1;i instanceof DataView||(i=new DataView(ArrayBuffer.isView(i)?i.buffer:i)),s instanceof DataView||(s=new DataView(ArrayBuffer.isView(s)?s.buffer:s)),t(i instanceof DataView),t(s instanceof DataView);let n=i.byteLength,a=0,o=-1;for(;++o<n;)a|=i.getUint8(o)^s.getUint8(o);return a===0}e.timingSafeEqual=r}),OL=j(function(e){var t=e&&e.__extends||(function(){var p=function(h,f){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,v){_.__proto__=v}||function(_,v){for(var E in v)v.hasOwnProperty(E)&&(_[E]=v[E])},p(h,f)};return function(h,f){p(h,f);function _(){this.constructor=h}h.prototype=f===null?Object.create(f):(_.prototype=f.prototype,new _)}})();Object.defineProperty(e,"__esModule",{value:!0});var r=256,i=(function(){function p(h){h===void 0&&(h="="),this._paddingCharacter=h}return p.prototype.encodedLength=function(h){return this._paddingCharacter?(h+2)/3*4|0:(h*8+5)/6|0},p.prototype.encode=function(h){for(var f="",_=0;_<h.length-2;_+=3){var v=h[_]<<16|h[_+1]<<8|h[_+2];f+=this._encodeByte(v>>>18&63),f+=this._encodeByte(v>>>12&63),f+=this._encodeByte(v>>>6&63),f+=this._encodeByte(v>>>0&63)}var E=h.length-_;if(E>0){var v=h[_]<<16|(E===2?h[_+1]<<8:0);f+=this._encodeByte(v>>>18&63),f+=this._encodeByte(v>>>12&63),E===2?f+=this._encodeByte(v>>>6&63):f+=this._paddingCharacter||"",f+=this._paddingCharacter||""}return f},p.prototype.maxDecodedLength=function(h){return this._paddingCharacter?h/4*3|0:(h*6+7)/8|0},p.prototype.decodedLength=function(h){return this.maxDecodedLength(h.length-this._getPaddingLength(h))},p.prototype.decode=function(h){if(h.length===0)return new Uint8Array(0);for(var f=this._getPaddingLength(h),_=h.length-f,v=new Uint8Array(this.maxDecodedLength(_)),E=0,y=0,m=0,g=0,b=0,C=0,A=0;y<_-4;y+=4)g=this._decodeChar(h.charCodeAt(y+0)),b=this._decodeChar(h.charCodeAt(y+1)),C=this._decodeChar(h.charCodeAt(y+2)),A=this._decodeChar(h.charCodeAt(y+3)),v[E++]=g<<2|b>>>4,v[E++]=b<<4|C>>>2,v[E++]=C<<6|A,m|=g&r,m|=b&r,m|=C&r,m|=A&r;if(y<_-1&&(g=this._decodeChar(h.charCodeAt(y)),b=this._decodeChar(h.charCodeAt(y+1)),v[E++]=g<<2|b>>>4,m|=g&r,m|=b&r),y<_-2&&(C=this._decodeChar(h.charCodeAt(y+2)),v[E++]=b<<4|C>>>2,m|=C&r),y<_-3&&(A=this._decodeChar(h.charCodeAt(y+3)),v[E++]=C<<6|A,m|=A&r),m!==0)throw Error("Base64Coder: incorrect characters for decoding");return v},p.prototype._encodeByte=function(h){var f=h;return f+=65,f+=25-h>>>8&6,f+=51-h>>>8&-75,f+=61-h>>>8&-15,f+=62-h>>>8&3,String.fromCharCode(f)},p.prototype._decodeChar=function(h){var f=r;return f+=(42-h&h-44)>>>8&-r+h-43+62,f+=(46-h&h-48)>>>8&-r+h-47+63,f+=(47-h&h-58)>>>8&-r+h-48+52,f+=(64-h&h-91)>>>8&-r+h-65+0,f+=(96-h&h-123)>>>8&-r+h-97+26,f},p.prototype._getPaddingLength=function(h){var f=0;if(this._paddingCharacter){for(var _=h.length-1;_>=0&&h[_]===this._paddingCharacter;_--)f++;if(h.length<4||f>2)throw Error("Base64Coder: incorrect padding")}return f},p})();e.Coder=i;var s=new i;function n(p){return s.encode(p)}e.encode=n;function a(p){return s.decode(p)}e.decode=a;var o=(function(p){t(h,p);function h(){return p!==null&&p.apply(this,arguments)||this}return h.prototype._encodeByte=function(f){var _=f;return _+=65,_+=25-f>>>8&6,_+=51-f>>>8&-75,_+=61-f>>>8&-13,_+=62-f>>>8&49,String.fromCharCode(_)},h.prototype._decodeChar=function(f){var _=r;return _+=(44-f&f-46)>>>8&-r+f-45+62,_+=(94-f&f-96)>>>8&-r+f-95+63,_+=(47-f&f-58)>>>8&-r+f-48+52,_+=(64-f&f-91)>>>8&-r+f-65+0,_+=(96-f&f-123)>>>8&-r+f-97+26,_},h})(i);e.URLSafeCoder=o;var l=new o;function c(p){return l.encode(p)}e.encodeURLSafe=c;function u(p){return l.decode(p)}e.decodeURLSafe=u,e.encodedLength=function(p){return s.encodedLength(p)},e.maxDecodedLength=function(p){return s.maxDecodedLength(p)},e.decodedLength=function(p){return s.decodedLength(p)}}),AL=j(function(e,t){(function(r,i){var s={};i(s);var n=s.default;for(var a in s)n[a]=s[a];typeof t=="object"&&typeof t.exports=="object"?t.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):r.sha256=n})(e,function(r){r.__esModule=!0,r.digestLength=32,r.blockSize=64;var i=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(f,_,v,E,y){for(var m,g,b,C,A,w,S,x,T,I,L,P,$;y>=64;){for(m=_[0],g=_[1],b=_[2],C=_[3],A=_[4],w=_[5],S=_[6],x=_[7],I=0;I<16;I++)L=E+I*4,f[I]=(v[L]&255)<<24|(v[L+1]&255)<<16|(v[L+2]&255)<<8|v[L+3]&255;for(I=16;I<64;I++)T=f[I-2],P=(T>>>17|T<<15)^(T>>>19|T<<13)^T>>>10,T=f[I-15],$=(T>>>7|T<<25)^(T>>>18|T<<14)^T>>>3,f[I]=(P+f[I-7]|0)+($+f[I-16]|0);for(I=0;I<64;I++)P=(((A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&w^~A&S)|0)+(x+(i[I]+f[I]|0)|0)|0,$=((m>>>2|m<<30)^(m>>>13|m<<19)^(m>>>22|m<<10))+(m&g^m&b^g&b)|0,x=S,S=w,w=A,A=C+P|0,C=b,b=g,g=m,m=P+$|0;_[0]+=m,_[1]+=g,_[2]+=b,_[3]+=C,_[4]+=A,_[5]+=w,_[6]+=S,_[7]+=x,E+=64,y-=64}return E}var n=(function(){function f(){this.digestLength=r.digestLength,this.blockSize=r.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return f.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},f.prototype.clean=function(){for(var _=0;_<this.buffer.length;_++)this.buffer[_]=0;for(var _=0;_<this.temp.length;_++)this.temp[_]=0;this.reset()},f.prototype.update=function(_,v){if(v===void 0&&(v=_.length),this.finished)throw Error("SHA256: can't update because hash was finished.");var E=0;if(this.bytesHashed+=v,this.bufferLength>0){for(;this.bufferLength<64&&v>0;)this.buffer[this.bufferLength++]=_[E++],v--;this.bufferLength===64&&(s(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(v>=64&&(E=s(this.temp,this.state,_,E,v),v%=64);v>0;)this.buffer[this.bufferLength++]=_[E++],v--;return this},f.prototype.finish=function(_){if(!this.finished){var v=this.bytesHashed,E=this.bufferLength,y=v/536870912|0,m=v<<3,g=v%64<56?64:128;this.buffer[E]=128;for(var b=E+1;b<g-8;b++)this.buffer[b]=0;this.buffer[g-8]=y>>>24&255,this.buffer[g-7]=y>>>16&255,this.buffer[g-6]=y>>>8&255,this.buffer[g-5]=y>>>0&255,this.buffer[g-4]=m>>>24&255,this.buffer[g-3]=m>>>16&255,this.buffer[g-2]=m>>>8&255,this.buffer[g-1]=m>>>0&255,s(this.temp,this.state,this.buffer,0,g),this.finished=!0}for(var b=0;b<8;b++)_[b*4+0]=this.state[b]>>>24&255,_[b*4+1]=this.state[b]>>>16&255,_[b*4+2]=this.state[b]>>>8&255,_[b*4+3]=this.state[b]>>>0&255;return this},f.prototype.digest=function(){var _=new Uint8Array(this.digestLength);return this.finish(_),_},f.prototype._saveState=function(_){for(var v=0;v<this.state.length;v++)_[v]=this.state[v]},f.prototype._restoreState=function(_,v){for(var E=0;E<this.state.length;E++)this.state[E]=_[E];this.bytesHashed=v,this.finished=!1,this.bufferLength=0},f})();r.Hash=n;var a=(function(){function f(_){this.inner=new n,this.outer=new n,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var v=new Uint8Array(this.blockSize);if(_.length>this.blockSize)new n().update(_).finish(v).clean();else for(var E=0;E<_.length;E++)v[E]=_[E];for(var E=0;E<v.length;E++)v[E]^=54;this.inner.update(v);for(var E=0;E<v.length;E++)v[E]^=106;this.outer.update(v),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var E=0;E<v.length;E++)v[E]=0}return f.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},f.prototype.clean=function(){for(var _=0;_<this.istate.length;_++)this.ostate[_]=this.istate[_]=0;this.inner.clean(),this.outer.clean()},f.prototype.update=function(_){return this.inner.update(_),this},f.prototype.finish=function(_){return this.outer.finished?this.outer.finish(_):(this.inner.finish(_),this.outer.update(_,this.digestLength).finish(_)),this},f.prototype.digest=function(){var _=new Uint8Array(this.digestLength);return this.finish(_),_},f})();r.HMAC=a;function o(f){var _=new n().update(f),v=_.digest();return _.clean(),v}r.hash=o,r.default=o;function l(f,_){var v=new a(f).update(_),E=v.digest();return v.clean(),E}r.hmac=l;function c(f,_,v,E){var y=E[0];if(y===0)throw Error("hkdf: cannot expand more");_.reset(),y>1&&_.update(f),v&&_.update(v),_.update(E),_.finish(f),E[0]++}var u=new Uint8Array(r.digestLength);function p(f,_,v,E){_===void 0&&(_=u),E===void 0&&(E=32);for(var y=new Uint8Array([1]),m=l(_,f),g=new a(m),b=new Uint8Array(g.digestLength),C=b.length,A=new Uint8Array(E),w=0;w<E;w++)C===b.length&&(c(b,g,v,y),C=0),A[w]=b[C++];return g.clean(),b.fill(0),y.fill(0),A}r.hkdf=p;function h(f,_,v,E){for(var y=new a(f),m=y.digestLength,g=new Uint8Array(4),b=new Uint8Array(m),C=new Uint8Array(m),A=new Uint8Array(E),w=0;w*m<E;w++){var S=w+1;g[0]=S>>>24&255,g[1]=S>>>16&255,g[2]=S>>>8&255,g[3]=S>>>0&255,y.reset(),y.update(_),y.update(g),y.finish(C);for(var x=0;x<m;x++)b[x]=C[x];for(var x=2;x<=v;x++){y.reset(),y.update(C).finish(C);for(var T=0;T<m;T++)b[T]^=C[T]}for(var x=0;x<m&&w*m+x<E;x++)A[w*m+x]=b[x]}for(var w=0;w<m;w++)b[w]=C[w]=0;for(var w=0;w<4;w++)g[w]=0;return y.clean(),A}r.pbkdf2=h})}),xL=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Webhook=e.WebhookVerificationError=void 0;var t=CL(),r=OL(),i=AL(),s=300;class n extends Error{constructor(c){super(c),Object.setPrototypeOf(this,n.prototype),this.name="ExtendableError",this.stack=Error(c).stack}}class a extends n{constructor(c){super(c),Object.setPrototypeOf(this,a.prototype),this.name="WebhookVerificationError"}}e.WebhookVerificationError=a;class o{constructor(c,u){if(!c)throw Error("Secret can't be empty.");if(u?.format==="raw")c instanceof Uint8Array?this.key=c:this.key=Uint8Array.from(c,p=>p.charCodeAt(0));else{if(typeof c!="string")throw Error("Expected secret to be of type string");c.startsWith(o.prefix)&&(c=c.substring(o.prefix.length)),this.key=r.decode(c)}}verify(c,u){let p={};for(let g of Object.keys(u))p[g.toLowerCase()]=u[g];let h=p["webhook-id"],f=p["webhook-signature"],_=p["webhook-timestamp"];if(!f||!h||!_)throw new a("Missing required headers");let v=this.verifyTimestamp(_),E=this.sign(h,v,c).split(",")[1],y=f.split(" "),m=new globalThis.TextEncoder;for(let g of y){let[b,C]=g.split(",");if(b==="v1"&&(0,t.timingSafeEqual)(m.encode(C),m.encode(E)))return JSON.parse(c.toString())}throw new a("No matching signature found")}sign(c,u,p){if(typeof p!="string")if(p.constructor.name==="Buffer")p=p.toString();else throw Error("Expected payload to be of type string or Buffer.");let h=new TextEncoder,f=Math.floor(u.getTime()/1e3),_=h.encode(`${c}.${f}.${p}`);return`v1,${r.encode(i.hmac(this.key,_))}`}verifyTimestamp(c){let u=Math.floor(Date.now()/1e3),p=parseInt(c,10);if(isNaN(p))throw new a("Invalid Signature Headers");if(u-p>s)throw new a("Message timestamp too old");if(p>u+s)throw new a("Message timestamp too new");return new Date(p*1e3)}}e.Webhook=o,o.prefix="whsec_"}),by,xh,Ey=Z(()=>{by=lr(xL(),1),xh=class extends Ge{unwrap(t,{headers:r,key:i}){if(r!==void 0){let s=i===void 0?this._client.webhookKey:i;if(s===null)throw Error("Webhook key must not be null in order to unwrap");new by.Webhook(s).verify(t,r)}return JSON.parse(t)}}}),kh,wy=Z(()=>{Je(),He(),et(),kh=class extends Ge{list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/agents/${t}/versions?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}}}),Nc,Sy=Z(()=>{wy(),wy(),Je(),He(),et(),Nc=class extends Ge{constructor(){super(...arguments),this.versions=new kh(this._client)}create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/agents?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s,...n}=r??{};return this._client.get(ue`/v1/agents/${t}?beta=true`,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}update(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/agents/${t}?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/agents?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/agents/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}},Nc.Versions=kh});function Mc(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let r=()=>t.abort();return e.addEventListener("abort",r),()=>e.removeEventListener("abort",r)}function go(e,t){return e instanceof zt&&e.status===t}function kL(e){return e instanceof zt&&typeof e.status=="number"&&e.status>=400&&e.status<500}function Uc(e){return kL(e)&&!go(e,408)&&!go(e,409)&&!go(e,429)}function TL(e,t,r){return Math.min(t*2**e,r)}function RL(e,t){return e+Math.random()*(t-e)}function DL(e){return e*(1-Math.random()*.25)}var $c=Z(()=>{dt()});function wC(e,{authToken:t,helper:r}){if(!t)throw new we(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let i=e,s=i._options.defaultHeaders,n=i._authState?.extraHeaders,a=n?Object.fromEntries(Object.entries(n).filter(([l])=>{let c=l.toLowerCase();return c!=="authorization"&&c!=="x-api-key"})):void 0,o=V([a,s,{[bC]:r}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:o})}var SC=Z(()=>{dt(),He(),Di()});function IL(e){return TL(e,NL,ML)}function LL(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${Dc()}`:Dc()}var zs,Rl,kr,Dl,Il,Ll,ka,Ta,Ws,PL=999,NL=1e3,ML=6e4,jc,Th=Z(()=>{Cr(),dt(),Ri(),He(),$c(),SC(),$c(),jc=class{constructor(t){zs.set(this,void 0),Rl.set(this,!1),kr.set(this,void 0),Dl.set(this,void 0),Il.set(this,void 0),Ll.set(this,void 0),ka.set(this,void 0),Ta.set(this,void 0),Ws.set(this,void 0),this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.workerId=t.workerId??LL(),ie(this,zs,wC(t.client,{authToken:t.environmentKey,helper:"environments-work-poller"}),"f"),ie(this,Il,t.autoStop??!0,"f"),ie(this,Ll,t.drain??!1,"f"),ie(this,ka,t.blockMs===void 0?PL:t.blockMs,"f"),ie(this,Ta,t.reclaimOlderThanMs??null,"f"),ie(this,Ws,t.requestOptions,"f"),ie(this,kr,new AbortController,"f"),ie(this,Dl,Mc(t.signal,D(this,kr,"f")),"f")}get signal(){return D(this,kr,"f").signal}abort(){D(this,kr,"f").abort()}async*[(zs=new WeakMap,Rl=new WeakMap,kr=new WeakMap,Dl=new WeakMap,Il=new WeakMap,Ll=new WeakMap,ka=new WeakMap,Ta=new WeakMap,Ws=new WeakMap,Symbol.asyncIterator)](){if(D(this,Rl,"f"))throw new we("Cannot iterate over a consumed WorkPoller");ie(this,Rl,!0,"f");let t=it(this.client);t.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!D(this,kr,"f").signal.aborted;){let i;try{i=await D(this,zs,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...D(this,ka,"f")!==null?{block_ms:D(this,ka,"f")}:{},...D(this,Ta,"f")!==null?{reclaim_older_than_ms:D(this,Ta,"f")}:{}},{headers:V([D(this,Ws,"f")?.headers]),signal:D(this,kr,"f").signal})}catch(s){if(D(this,kr,"f").signal.aborted)return;if(Uc(s))throw t.error("poll failed permanently, stopping poller",{error:String(s)}),s;let n=DL(IL(r));t.warn("poll failed, backing off",{error:String(s),backoff_ms:n}),r++,await ws(n,D(this,kr,"f").signal);continue}if(r=0,i==null){if(D(this,Ll,"f"))return;await ws(RL(1e3,3e3),D(this,kr,"f").signal);continue}t.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:i.id,work_type:i.data.type});try{await D(this,zs,"f").beta.environments.work.ack(i.id,{environment_id:i.environment_id},{headers:V([D(this,Ws,"f")?.headers]),signal:D(this,kr,"f").signal})}catch(s){t.error("ack failed",{work_id:i.id,error:String(s)});continue}try{yield i}finally{if(D(this,Il,"f"))try{await D(this,zs,"f").beta.environments.work.stop(i.id,{environment_id:i.environment_id},{headers:V([D(this,Ws,"f")?.headers])})}catch(s){go(s,409)||t.warn("stop failed",{work_id:i.id,error:String(s)})}}}}finally{D(this,Dl,"f").call(this)}}}}),Rh=class{constructor(){rn.set(this,[]),zi.set(this,[]),sn.set(this,!1)}push(t){if(D(this,sn,"f"))return!1;let r=D(this,zi,"f").shift();return r?r({done:!1,value:t}):D(this,rn,"f").push(t),!0}close(){if(!D(this,sn,"f"))for(ie(this,sn,!0,"f");D(this,zi,"f").length>0;)D(this,zi,"f").shift()({done:!0,value:void 0})}next(t){return D(this,rn,"f").length>0?Promise.resolve({done:!1,value:D(this,rn,"f").shift()}):D(this,sn,"f")||t?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let i=n=>{t?.removeEventListener("abort",s),r(n)},s=()=>{let n=D(this,zi,"f").indexOf(i);n>=0&&D(this,zi,"f").splice(n,1),r({done:!0,value:void 0})};D(this,zi,"f").push(i),t?.addEventListener("abort",s,{once:!0})})}tryShift(){return D(this,rn,"f").shift()}},rn,zi,sn,UL=Z(()=>{Cr(),rn=new WeakMap,zi=new WeakMap,sn=new WeakMap}),Be,Dn=Z(()=>{Be=class extends Error{constructor(t){let r=typeof t=="string"?t:t.map(i=>i.type==="text"?i.text:`[${i.type}]`).join(" ");super(r),this.name="ToolError",this.content=t}}});function Cy(e){return"name"in e?e.name:e.mcp_server_name}function $L(e){return e instanceof Be?e.content:`Error: ${e instanceof Error?e.message:String(e)}`}async function jL(e,t,r){try{let i=e.parse?e.parse(t):t;return{content:await e.run(i,r),isError:!1}}catch(i){return{content:$L(i),isError:!0}}}var FL=Z(()=>{Dn()});function CC(e){return e.type==="session.status_idle"&&e.stop_reason?.type==="end_turn"}var Dh=class{constructor(t,r){no.set(this,void 0),gc.set(this,void 0),nn.set(this,new Set),fs.set(this,!1),Zr.set(this,void 0),ie(this,no,t,"f"),ie(this,gc,r,"f")}noteEvent(t){t.type!=="user.tool_confirmation"&&(CC(t)?this.arm():this.disarm())}block(t){D(this,nn,"f").add(t),D(this,Zr,"f")!==void 0&&(ie(this,fs,!0,"f"),clearTimeout(D(this,Zr,"f")),ie(this,Zr,void 0,"f"))}unblock(t){D(this,nn,"f").delete(t),D(this,nn,"f").size===0&&D(this,fs,"f")&&this.arm()}arm(){if(!(D(this,no,"f")<=0)){if(D(this,nn,"f").size>0){ie(this,fs,!0,"f");return}ie(this,fs,!1,"f"),D(this,Zr,"f")!==void 0&&clearTimeout(D(this,Zr,"f")),ie(this,Zr,setTimeout(D(this,gc,"f"),D(this,no,"f")),"f")}}disarm(){ie(this,fs,!1,"f"),D(this,Zr,"f")!==void 0&&(clearTimeout(D(this,Zr,"f")),ie(this,Zr,void 0,"f"))}};function BL(e,t,r){return e.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:r}:{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:r}}function HL(e){if(typeof e=="string")return[{type:"text",text:e||"(no output)"}];let t=e.map(r=>r.type==="text"?{type:"text",text:r.text||"(no output)"}:r.type==="image"||r.type==="document"?r:r.type==="search_result"?{type:"search_result",source:r.source,title:r.title,content:r.content.map(i=>({type:"text",text:i.text})),citations:{enabled:r.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(r)});return t.length>0?t:[{type:"text",text:"(no output)"}]}var no,gc,nn,fs,Zr,yt,Pl,It,Nl,Ra,Ml,xt,Ks,gr,Gs,Ui,qs,yi,Da,Tr,Ul,Oy,Ay,xy,ky,Ud,Ty,$l,jl,$d,Ry,Dy,Iy=500,zL=1e4,WL=12e4,KL=3e4,Ly=3,GL=6e4,Fc,Ih=Z(()=>{Cr(),dt(),Ri(),$c(),UL(),He(),Di(),FL(),no=new WeakMap,gc=new WeakMap,nn=new WeakMap,fs=new WeakMap,Zr=new WeakMap,Fc=class{constructor(t,r){yt.add(this),Pl.set(this,!1),It.set(this,void 0),Nl.set(this,void 0),Ra.set(this,void 0),Ml.set(this,void 0),xt.set(this,void 0),Ks.set(this,new Set),gr.set(this,new Set),Gs.set(this,new Map),Ui.set(this,new Map),qs.set(this,new Rh),yi.set(this,0),Da.set(this,null),Tr.set(this,void 0),this.client=r.client,this.sessionId=t,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??GL,ie(this,xt,it(r.client),"f"),ie(this,Ml,new Map(r.tools.map(i=>[Cy(i),i])),"f"),ie(this,It,new AbortController,"f"),ie(this,Nl,Mc(r.signal,D(this,It,"f")),"f"),ie(this,Ra,r.requestOptions,"f"),ie(this,Tr,new Dh(this.maxIdleMs,()=>{D(this,xt,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),D(this,It,"f").abort()}),"f")}get signal(){return D(this,It,"f").signal}abort(){D(this,It,"f").abort()}async*[(Pl=new WeakMap,It=new WeakMap,Nl=new WeakMap,Ra=new WeakMap,Ml=new WeakMap,xt=new WeakMap,Ks=new WeakMap,gr=new WeakMap,Gs=new WeakMap,Ui=new WeakMap,qs=new WeakMap,yi=new WeakMap,Da=new WeakMap,Tr=new WeakMap,yt=new WeakSet,Symbol.asyncIterator)](){if(D(this,Pl,"f"))throw new we("Cannot iterate over a consumed SessionToolRunner");ie(this,Pl,!0,"f"),D(this,xt,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let t=D(this,yt,"m",Oy).call(this).catch(r=>{D(this,It,"f").signal.aborted||D(this,xt,"f").error("stream loop failed",{error:String(r)}),D(this,It,"f").abort()});try{for(;;){let i=await D(this,qs,"f").next(D(this,It,"f").signal);if(i.done)break;yield i.value}await t;let r;for(;(r=D(this,qs,"f").tryShift())!==void 0;)yield r}finally{D(this,It,"f").abort(),D(this,Tr,"f").disarm(),await t;try{await D(this,yt,"m",Dy).call(this)}catch(r){D(this,xt,"f").warn("drain failed",{error:String(r)})}D(this,qs,"f").close();for(let r of this.tools)try{await r.close?.()}catch(i){D(this,xt,"f").warn("tool.close failed",{tool:Cy(r),error:String(i)})}D(this,Nl,"f").call(this)}}},Ul=function(){return{...D(this,Ra,"f"),headers:V([Sh("session-tool-runner"),D(this,Ra,"f")?.headers]),signal:D(this,It,"f").signal}},Oy=async function(){let e=D(this,It,"f"),t=Iy;for(;!e.signal.aborted;){try{let r=await this.client.beta.sessions.events.stream(this.sessionId,{},D(this,yt,"m",Ul).call(this));await D(this,yt,"m",Ay).call(this);for await(let i of r)if(t=Iy,await D(this,yt,"m",ky).call(this,i))return}catch(r){if(e.signal.throwIfAborted(),Uc(r))throw D(this,xt,"f").error("permanent stream failure, shutting down",{error:String(r)}),e.abort(),r;D(this,xt,"f").warn("stream disconnected, reconnecting",{error:String(r),backoff_ms:t})}e.signal.throwIfAborted(),await ws(t,e.signal),t=Math.min(t*2,zL)}},Ay=async function(){let e=D(this,It,"f"),t=[],r=!1;try{for await(let n of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},D(this,yt,"m",Ul).call(this)))D(this,yt,"m",xy).call(this,n,t),r=CC(n)}catch(n){e.signal.throwIfAborted(),D(this,xt,"f").warn("reconcile list failed",{error:String(n)});for(let a of t)D(this,Ks,"f").delete(a.id);return}let i=t.filter(n=>!D(this,gr,"f").has(n.id));D(this,Tr,"f").disarm();for(let n of i)await D(this,yt,"m",Ud).call(this,n);for(let n of[...D(this,Ui,"f").values()]){let a=D(this,Gs,"f").get(n.id);a!==void 0&&await D(this,yt,"m",$l).call(this,n,a)}let s=i.filter(n=>!D(this,gr,"f").has(n.id)&&!D(this,Ui,"f").has(n.id));r&&s.length===0?D(this,Tr,"f").arm():D(this,Tr,"f").disarm()},xy=function(e,t){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(D(this,Ks,"f").add(e.id),!D(this,gr,"f").has(e.id)&&t.push(e)):e.type==="user.tool_result"?D(this,gr,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"?D(this,gr,"f").add(e.custom_tool_use_id):e.type==="user.tool_confirmation"&&(D(this,gr,"f").has(e.tool_use_id)||D(this,Gs,"f").set(e.tool_use_id,e.result))},ky=async function(e){switch(D(this,Tr,"f").noteEvent(e),e.type){case"agent.tool_use":case"agent.custom_tool_use":return D(this,Ks,"f").has(e.id)||(D(this,Ks,"f").add(e.id),await D(this,yt,"m",Ud).call(this,e)),!1;case"user.tool_confirmation":return await D(this,yt,"m",Ty).call(this,e),!1;case"user.tool_result":return D(this,gr,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return D(this,gr,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return D(this,xt,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),D(this,It,"f").abort(),!0;default:return!1}},Ud=async function(e){let t=e.evaluated_permission,r=t==="deny"?"deny":D(this,Gs,"f").get(e.id);if(r===void 0){t===void 0||t==="allow"?await D(this,yt,"m",$d).call(this,e,void 0):D(this,Ui,"f").has(e.id)||(D(this,xt,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),D(this,Ui,"f").set(e.id,e),D(this,Tr,"f").block(e.id));return}await D(this,yt,"m",$l).call(this,e,r)},Ty=async function(e){D(this,Gs,"f").set(e.tool_use_id,e.result);let t=D(this,Ui,"f").get(e.tool_use_id);t!==void 0&&await D(this,yt,"m",$l).call(this,t,e.result)},$l=async function(e,t){let r=D(this,Ui,"f").delete(e.id);if(t==="allow"){D(this,xt,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),!r&&D(this,Tr,"f").block(e.id);try{await D(this,yt,"m",$d).call(this,e,"allow")}finally{D(this,Tr,"f").unblock(e.id)}return}r&&D(this,Tr,"f").unblock(e.id),D(this,gr,"f").add(e.id),D(this,xt,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),D(this,yt,"m",jl).call(this,{event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1,confirmation:"deny"})},jl=function(e){D(this,qs,"f").push(e)},$d=async function(e,t){var r,i;if(!D(this,gr,"f").has(e.id)){D(this,xt,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),ie(this,yi,(r=D(this,yi,"f"),r++,r),"f");try{let s=D(this,Ml,"f").get(e.name);if(!s){D(this,xt,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),D(this,yt,"m",jl).call(this,{event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1,confirmation:t});return}let n,a,o=new AbortController,l=Mc(D(this,It,"f").signal,o),c=setTimeout(()=>o.abort(),WL);try{let h=await jL(s,e.input,{toolUse:e,toolUseBlock:e,signal:o.signal});n=h.content,a=h.isError}finally{clearTimeout(c),l()}let u=BL(e,a,HL(n)),p=await D(this,yt,"m",Ry).call(this,u,e.id);D(this,yt,"m",jl).call(this,{event:e,result:u,toolUseId:e.id,name:e.name,isError:a,posted:p,confirmation:t})}finally{ie(this,yi,(i=D(this,yi,"f"),i--,i),"f"),D(this,yi,"f")===0&&D(this,Da,"f")?.call(this)}}},Ry=async function(e,t){let r=D(this,It,"f"),i;for(let s=0;s<Ly;s++){r.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[e]},D(this,yt,"m",Ul).call(this)),D(this,gr,"f").add(t),!0}catch(n){if(i=n,Uc(n))break;s<Ly-1&&await ws((s+1)*1e3,r.signal)}}return D(this,xt,"f").error("failed to send tool result",{tool_use_id:t,error:String(i)}),!1},Dy=async function(){D(this,yi,"f")!==0&&(await Promise.race([new Promise(e=>ie(this,Da,e,"f")),ws(KL)]),ie(this,Da,null,"f"),D(this,yi,"f")>0&&D(this,xt,"f").warn("drain timeout exceeded"))}}),qL=Z(()=>{QS()});function ia(e){if(e.inputSchema.type!=="object")throw Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:t=>t,...e.close?{close:e.close}:{}}}var VL=Z(()=>{tO(),qL()});function Bc(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}async function XL(e){try{return await Or.realpath(e)}catch{return e}}async function YL(e){let t=[],r=e,i=0;for(;;){let s;try{s=await Or.realpath(r)}catch{let n=!1;try{n=(await Or.lstat(r)).isSymbolicLink()}catch{}if(n){if(++i>40)throw new Be(`path ${JSON.stringify(e)} has too many levels of symbolic links`);r=rr.resolve(rr.dirname(r),await Or.readlink(r));continue}let a=rr.dirname(r);if(a===r)return e;t.push(rr.basename(r)),r=a;continue}return t.length?rr.join(s,...t.reverse()):s}}async function JL(e,t,r){let i=r?.allowOutside??!1,s=await XL(rr.resolve(e)),n=rr.resolve(s,t);if(i)return n;let a=await YL(n);if(a!==s&&!a.startsWith(s+rr.sep))throw new Be(`path ${JSON.stringify(t)} escapes workdir`);return a}async function OC(e,t){let r=rr.dirname(e),i=rr.join(r,`.tmp-${process.pid}-${ZL()}`),s;try{s=await Or.open(i,"wx",QL),await s.writeFile(t,"utf-8"),await s.sync(),await s.close(),s=void 0,await Or.rename(i,e)}catch(n){throw s&&await s.close().catch(()=>{}),await Or.unlink(i).catch(()=>{}),n}}function Hc(e,t){switch(e?.code){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${e instanceof Error?e.message:String(e)}`}}var p_=493,QL=420,AC=Z(()=>{Dn()});async function sP(e){let{client:t,sessionId:r}=e;if(!t||!r)return async()=>{};let i=it(t),s=await t.beta.sessions.retrieve(r),n=Lt.resolve(e.workdir,"skills"),a=[];for(let o of s.agent.skills)try{let l=await nP(t,o.skill_id,o.version),c=await t.beta.skills.versions.retrieve(l,{skill_id:o.skill_id}),u=Lt.basename(c.name.trim());(u===""||u==="."||u==="..")&&(u=o.skill_id);let p=Lt.resolve(n,u);if(p!==n&&!p.startsWith(n+Lt.sep)){i.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let h=await t.beta.skills.versions.download(l,{skill_id:o.skill_id});await pr.rm(p,{recursive:!0,force:!0}),await pr.mkdir(p,{recursive:!0,mode:p_}),a.push(p),await cP(h,p),i.info("downloaded skill",{component:"agent-tool-context",skill_id:o.skill_id,version:l,dest:p})}catch(l){i.warn("failed to download skill",{component:"agent-tool-context",skill_id:o.skill_id,error:String(l)})}return async()=>{for(let o of a)await pr.rm(o,{recursive:!0,force:!0}).catch(l=>{i.warn("failed to clean up skill",{component:"agent-tool-context",dest:o,error:String(l)})})}}async function nP(e,t,r){if(/^\d+$/.test(r))return r;let i;for await(let s of e.beta.skills.versions.list(t))/^\d+$/.test(s.version)&&(i===void 0||BigInt(s.version)>BigInt(i))&&(i=s.version);if(i===void 0)throw new we(`skill ${JSON.stringify(t)} has no concrete version to resolve ${JSON.stringify(r)} against`);return i}function aP(e){for(let t of e.split(`
|
|
11
|
+
`)){let r=t.trim();if(r&&(Lt.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new we(`refusing to extract unsafe archive member: ${r}`)}}function oP(e){for(let t of e.split(`
|
|
12
|
+
`)){let r=t.trimStart()[0];if(r==="l"||r==="h"||r==="b"||r==="c"||r==="p"||r==="s")throw new we("refusing to extract archive with symlink/hardlink/device member")}}async function jd(e,t){try{let{stdout:r}=await kC(e,t);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new we(`skill extraction requires the \`${e}\` command, but it was not found on PATH`):r}}function lP(e){let t,r=!1;for(let i of e.split(`
|
|
13
|
+
`)){let s=i.trim().split("/").filter(a=>a!==""&&a!==".");if(s.length===0)continue;let n=s[0];if(t===void 0)t=n;else if(n!==t)return"";s.length>1&&(r=!0)}return t!==void 0&&r?t:""}async function cP(e,t){let r=Lt.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new we("skill download response had no body");await iP(rP.fromWeb(e.body),xC.createWriteStream(r));let i=Lt.join(Lt.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`);try{let s=await uP(r,4),n=s.length>=4&&s[0]===80&&s[1]===75&&s[2]===3&&s[3]===4,a=n?"unzip":"tar",o=await jd(a,n?["-Z1",r]:["-tf",r]);aP(o),oP(await jd(a,n?["-Z",r]:["-tvf",r]));let l=lP(o);await pr.mkdir(i,{recursive:!0,mode:p_}),await jd(a,n?["-oq",r,"-d",i]:["-xf",r,"-C",i]);let c=l?Lt.join(i,l):i;for(let u of await pr.readdir(c))await pr.rename(Lt.join(c,u),Lt.join(t,u))}finally{await pr.rm(r,{force:!0}),await pr.rm(i,{recursive:!0,force:!0})}}async function uP(e,t){let r=await pr.open(e,"r");try{let i=Buffer.alloc(t),{bytesRead:s}=await r.read(i,0,t,0);return i.subarray(0,s)}finally{await r.close()}}var kC,dP=Z(()=>{dt(),Ri(),AC(),kC=tP(eP)}),TC={};fr(TC,{betaAgentToolset20260401:()=>pP,setupSkills:()=>sP});function IC(e){return e===void 0?OP:e}function pP(e){return[fP(e),mP(e),gP(e),_P(e),vP(e),yP(e)]}function tl(e,t){return JL(e.workdir,t,{allowOutside:e.unrestrictedPaths??!1})}function hP(){let e={};for(let[t,r]of Object.entries(process.env))t.startsWith("ANTHROPIC_")||(e[t]=r);return e}var Lh=class{constructor(t,r=hP()){_c.add(this),Vt.set(this,void 0),cr.set(this,""),_o.set(this,!1),ms.set(this,!1),Ir.set(this,null),ie(this,Vt,h_.spawn("/bin/bash",["--noprofile","--norc"],{cwd:t,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),D(this,Vt,"f").stdout.setEncoding("utf8"),D(this,Vt,"f").stderr.setEncoding("utf8"),D(this,Vt,"f").stdout.on("data",i=>D(this,_c,"m",Ph).call(this,i)),D(this,Vt,"f").stderr.on("data",i=>D(this,_c,"m",Ph).call(this,i)),D(this,Vt,"f").once("close",()=>{ie(this,ms,!0,"f");let i=D(this,Ir,"f");ie(this,Ir,null,"f"),i?.resolve()})}get closed(){return D(this,ms,"f")}async exec(t,r={}){if(D(this,ms,"f"))throw new we("bash session terminated");let i=r.timeoutMs??LC,s=r.signal;if(s?.aborted)throw new we("bash command aborted");ie(this,cr,"","f"),ie(this,_o,!1,"f");let n=`__ANT_CMD_${RC.randomUUID()}_DONE__`,a=`${n.slice(0,8)}''${n.slice(8)}`,o=`{ ${t}
|
|
14
|
+
} </dev/null 2>&1; printf '\\n${a}%d\\n' $?
|
|
15
|
+
`;if(D(this,Vt,"f").stdin.write(o),D(this,cr,"f").indexOf(n)<0){let{promise:h,resolve:f}=Bc();ie(this,Ir,{sentinel:n,resolve:f},"f");let _,v;try{await Promise.race([h,new Promise((E,y)=>{_=setTimeout(()=>y(new we(`bash command timed out after ${i}ms`)),i)}),new Promise((E,y)=>{s&&(v=()=>y(new we("bash command aborted")),s.addEventListener("abort",v,{once:!0}))})])}finally{_&&clearTimeout(_),v&&s&&s.removeEventListener("abort",v),ie(this,Ir,null,"f")}}let l=D(this,cr,"f").indexOf(n);if(l<0)throw new we("bash session terminated");let c=D(this,cr,"f").slice(l+n.length).match(/^(-?\d+)/),u=c?parseInt(c[1],10):-1,p=D(this,cr,"f").slice(0,l).replace(PC,"").replace(/\n+$/,"");return D(this,_o,"f")&&(p=`[output truncated]
|
|
16
|
+
${p}`),{output:p,exitCode:u}}close(){if(D(this,ms,"f"))return;ie(this,ms,!0,"f");let t=D(this,Ir,"f");ie(this,Ir,null,"f"),t?.resolve(),D(this,Vt,"f").stdout.destroy(),D(this,Vt,"f").stderr.destroy(),D(this,Vt,"f").stdin.destroy();try{process.kill(-D(this,Vt,"f").pid,"SIGKILL")}catch{D(this,Vt,"f").kill("SIGKILL")}D(this,Vt,"f").unref()}};function fP(e){let t,r=Promise.resolve();return ia({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:i,restart:s,timeout_ms:n},a)=>{let o=r,l=Bc();r=l.promise;try{await o}catch{}try{if(s&&(t?.close(),t=void 0),!i){if(s)return"bash session restarted";throw new Be("bash: command is required")}t??(t=new Lh(e.workdir,e.env));try{let{output:c,exitCode:u}=await t.exec(i,{timeoutMs:n??LC,signal:a?.signal});if(u!==0)throw new Be(c||`exit ${u}`);return c}catch(c){throw c instanceof Be?c:(t.close(),t=void 0,new Be(`bash: ${c instanceof Error?c.message:String(c)}`))}}finally{l.resolve()}},close:()=>{t?.close(),t=void 0}})}function mP(e){return ia({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:r})=>{if(!t)throw new Be("read: file_path is required");let i=await tl(e,t),s;try{let u=await Rt.stat(i);if(!u.isFile())throw new Be(`read: ${t} is not a regular file`);let p=IC(e.maxFileBytes);if(p!==null&&u.size>p)throw new Be(`read: ${t} is ${u.size} bytes, exceeds ${p}-byte limit. Use bash (head/tail/sed) to read a slice.`);s=await Rt.readFile(i,"utf8")}catch(u){throw u instanceof Be?u:new Be(`read: ${Hc(u,t)}`)}if(!r)return s;if(r.length!==2)throw new Be("read: view_range must be [start_line, end_line]");let[n,a]=r,o=s.split(`
|
|
17
|
+
`),l=Math.max(0,n-1),c=a>0?a:o.length;return o.slice(l,c).join(`
|
|
18
|
+
`)}})}function gP(e){return ia({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:r})=>{if(!t)throw new Be("write: file_path is required");let i=await tl(e,t);try{await Rt.mkdir(gt.dirname(i),{recursive:!0,mode:p_}),await OC(i,r??"")}catch(s){throw new Be(`write: ${Hc(s,t)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${t}`}})}function _P(e){return ia({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:r,new_string:i,replace_all:s})=>{if(!t)throw new Be("edit: file_path is required");if(!r)throw new Be("edit: old_string is required");let n=await tl(e,t),a;try{let c=await Rt.stat(n);if(!c.isFile())throw new Be(`edit: ${t} is not a regular file`);let u=IC(e.maxFileBytes);if(u!==null&&c.size>u)throw new Be(`edit: ${t} is ${c.size} bytes, exceeds ${u}-byte limit. Use bash (sed/awk) to edit a large file.`);a=await Rt.readFile(n,"utf8")}catch(c){throw c instanceof Be?c:new Be(`edit: ${Hc(c,t)}`)}let o=a.split(r).length-1;if(o===0)throw new Be(`edit: old_string not found in ${t}`);let l;if(s)l=a.split(r).join(i);else{if(o>1)throw new Be(`edit: old_string appears ${o} times in ${t} (must be unique)`);l=a.replace(r,()=>i)}try{await OC(n,l)}catch(c){throw new Be(`edit: write: ${Hc(c,t)}`)}return`edited ${t} (${s?o:1} replacement(s))`}})}function vP(e){return ia({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:r})=>{if(!t)throw new Be("glob: pattern is required");let i=gt.resolve(e.workdir),s=t;if(gt.isAbsolute(t)){if(!e.unrestrictedPaths)throw new Be("glob: absolute pattern not permitted");i=gt.parse(t).root,s=gt.relative(i,t)}else r&&(i=await tl(e,r));if(!e.unrestrictedPaths&&s.split(/[\\/]/).includes(".."))throw new Be('glob: ".." is not permitted in the pattern');let n=e.unrestrictedPaths?i:await Rt.realpath(i).catch(()=>i),a=[];try{for await(let o of NC(s,{cwd:i,withFileTypes:!0,exclude:l=>l.name===".git"||l.name==="node_modules"})){if(!o.isFile())continue;let l=gt.join(o.parentPath,o.name);if(!e.unrestrictedPaths){let u;try{u=await Rt.realpath(l)}catch{continue}if(!wP(n,u))continue}let c=0;try{c=(await Rt.stat(l)).mtimeMs}catch{}a.push({path:l,mtime:c})}}catch(o){throw new Be(`glob: ${o instanceof Error?o.message:String(o)}`)}return a.length===0?"no matches":(a.sort((o,l)=>l.mtime-o.mtime),a.slice(0,xP).map(o=>o.path).join(`
|
|
19
|
+
`))}})}function yP(e){return ia({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:r},i)=>{if(!t)throw new Be("grep: pattern is required");let s=gt.resolve(e.workdir);r&&(s=await tl(e,r));let n=await CP();return n?bP(n,t,s,i?.signal):EP(t,s,i?.signal)}})}function bP(e,t,r,i){return new Promise((s,n)=>{let a=h_.spawn(e,["-n","--no-heading","-e",t,"--",r],{...i?{signal:i}:{}}),o="",l="",c=!1;a.stdout.on("data",u=>{c||(o+=u,o.length>vo&&(c=!0,o=o.slice(0,vo),a.kill("SIGKILL")))}),a.stderr.on("data",u=>l+=u),a.on("close",u=>{if(i?.aborted)return n(new Be("grep: aborted"));if(c)return s(o+`
|
|
20
|
+
[output truncated at ${vo} bytes]`);if(u===0)return s(o);if(u===1)return s("no matches");n(new Be(`grep: rg failed: ${l||`exit ${u}`}`))}),a.on("error",u=>{if(i?.aborted)return n(new Be("grep: aborted"));n(new Be(`grep: rg failed: ${u.message}`))})})}async function EP(e,t,r){let i;try{i=new RegExp(e)}catch(o){throw new Be(`grep: invalid regex: ${o instanceof Error?o.message:String(o)}`)}let s=[],n=vo,a=o=>(n-=o.length+1,n<0?(s.push(`[output truncated at ${vo} bytes]`),!1):(s.push(o),!0));if((await Rt.stat(t).catch(()=>null))?.isFile()?await Py(t,i,a):await SP(t,"",o=>Py(gt.join(t,o),i,a),r),r?.aborted)throw new Be("grep: aborted");return s.length===0?"no matches":s.join(`
|
|
21
|
+
`)}async function Py(e,t,r){let i=Pu.createReadStream(e,{encoding:"utf8"}),s=DC.createInterface({input:i,crlfDelay:1/0}),n=0;try{for await(let a of s)if(n++,!(a.length>AP)&&t.test(a)&&!r(`${e}:${n}:${a}`))return!1}catch{}finally{i.destroy()}return!0}function wP(e,t){let r=gt.relative(e,t);return r===""||!r.startsWith(".."+gt.sep)&&r!==".."&&!gt.isAbsolute(r)}async function SP(e,t,r,i){let s=TP;async function n(a,o){if(o>kP)return!0;if(i?.aborted)return!1;let l;try{l=await Rt.readdir(gt.join(e,a),{withFileTypes:!0})}catch{return!0}for(let c of l){if(c.name===".git"||c.name==="node_modules")continue;if(s--<=0||i?.aborted)return!1;let u=a?gt.join(a,c.name):c.name;if(c.isDirectory()){if(!await n(u,o+1))return!1}else if(c.isFile()&&await r(u)===!1)return!1}return!0}await n(t,0)}async function CP(){let e=(process.env.PATH??"").split(gt.delimiter);for(let t of e){let r=gt.join(t,"rg");try{return await Rt.access(r,Pu.constants.X_OK),r}catch{}}return null}var _c,Vt,cr,_o,ms,Ir,Ph,Ny=102400,LC=12e4,OP=262144,vo=102400,AP=2e3,xP=200,PC,NC,kP=40,TP=5e4,RP=Z(()=>{Cr(),dt(),Dn(),VL(),AC(),dP(),PC=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,NC=Rt.glob,Vt=new WeakMap,cr=new WeakMap,_o=new WeakMap,ms=new WeakMap,Ir=new WeakMap,_c=new WeakSet,Ph=function(e){if(ie(this,cr,D(this,cr,"f")+e,"f"),D(this,cr,"f").length>Ny&&(ie(this,cr,D(this,cr,"f").slice(D(this,cr,"f").length-Ny),"f"),ie(this,_o,!0,"f")),D(this,Ir,"f")&&D(this,cr,"f").indexOf(D(this,Ir,"f").sentinel)>=0){let t=D(this,Ir,"f");ie(this,Ir,null,"f"),t.resolve()}}}),zc=class{constructor(t){vc.add(this),ao.set(this,void 0),this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.tools=t.tools,this.workdir=t.workdir??process.cwd(),this.unrestrictedPaths=t.unrestrictedPaths,this.maxFileBytes=t.maxFileBytes,this.maxIdleMs=t.maxIdleMs,this.workerId=t.workerId,this.requestOptions=t.requestOptions,ie(this,ao,t.signal,"f")}async run(t){let{environmentId:r,environmentKey:i}=this;if(r===void 0||i===void 0)throw new we("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let s=t??D(this,ao,"f"),n=new jc({client:this.client,environmentId:r,environmentKey:i,...this.workerId!==void 0?{workerId:this.workerId}:{},...s?{signal:s}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let a of n)await D(this,vc,"m",Nh).call(this,a,i,n.signal)}async handleItem(t){let r=t?.workId??qe("ANTHROPIC_WORK_ID"),i=t?.environmentId??qe("ANTHROPIC_ENVIRONMENT_ID"),s=t?.sessionId??qe("ANTHROPIC_SESSION_ID"),n=t?.environmentKey??this.environmentKey??qe("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new we("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new we("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!s)throw new we("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!n)throw new we("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let a={id:r,environment_id:i,data:{type:"session",id:s}};await D(this,vc,"m",Nh).call(this,a,n,t?.signal??D(this,ao,"f"))}};async function DP(e,t,r,i){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...i,headers:V([i?.headers])})}catch(s){go(s,409)||r.error("force-stop on exit failed",{work_id:t.id,error:String(s)})}}async function IP(e,t,r,i,s){let n=My,a=LP,o=async()=>{try{let l=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:a},{...s,headers:V([s?.headers]),signal:r.signal});a=l.last_heartbeat,l.ttl_seconds>0&&(n=Math.max(1e3,Math.min(l.ttl_seconds*1e3/2,My))),(l.state==="stopping"||l.state==="stopped")&&(i.info("heartbeat signals shutdown",{work_id:t.id,state:l.state}),r.abort()),l.lease_extended||(i.warn("lease not extended, shutting down",{work_id:t.id}),r.abort())}catch(l){if(r.signal.throwIfAborted(),Uc(l))throw i.error("permanent heartbeat failure",{work_id:t.id,error:String(l)}),r.abort(),l;i.warn("transient heartbeat failure",{work_id:t.id,error:String(l)})}};for(await o();!r.signal.aborted;)await ws(n,r.signal),r.signal.throwIfAborted(),await o()}var vc,ao,Nh,My=3e4,LP="NO_HEARTBEAT",Uy=Z(()=>{Cr(),dt(),Ri(),$c(),He(),Ih(),Th(),SC(),ao=new WeakMap,vc=new WeakSet,Nh=async function(e,t,r){let i=it(this.client),s=wC(this.client,{authToken:t,helper:"environments-worker"}),n=e.data.id,a={workdir:this.workdir,client:this.client,sessionId:n,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{},...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}},o=await Promise.resolve().then(()=>(RP(),TC)),l=async()=>{};try{l=await o.setupSkills(a)}catch(f){i.warn("skill setup failed",{session_id:n,work_id:e.id,error:String(f)})}let c=typeof this.tools=="function"?this.tools(a):this.tools??o.betaAgentToolset20260401(a),u=new AbortController,p=Mc(r,u),h=IP(s,e,u,i,this.requestOptions).catch(f=>{u.signal.aborted||i.error("heartbeat loop failed",{work_id:e.id,error:String(f)}),u.abort()});try{let f=new Fc(n,{client:s,tools:c,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:u.signal});for await(let _ of f);}finally{u.abort(),p(),await h,await l().catch(f=>{i.warn("skill cleanup failed",{session_id:n,work_id:e.id,error:String(f)})}),await DP(s,e,i,this.requestOptions)}}}),yo,$y=Z(()=>{Je(),He(),et(),Th(),Uy(),Th(),Uy(),yo=class extends Ge{retrieve(t,r,i){let{environment_id:s,betas:n}=r;return this._client.get(ue`/v1/environments/${s}/work/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}update(t,r,i){let{environment_id:s,betas:n,...a}=r;return this._client.post(ue`/v1/environments/${s}/work/${t}?beta=true`,{body:a,...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/environments/${t}/work?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}ack(t,r,i){let{environment_id:s,betas:n}=r;return this._client.post(ue`/v1/environments/${s}/work/${t}/ack?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}heartbeat(t,r,i){let{environment_id:s,desired_ttl_seconds:n,expected_last_heartbeat:a,betas:o}=r;return this._client.post(ue`/v1/environments/${s}/work/${t}/heartbeat?beta=true`,{query:{desired_ttl_seconds:n,expected_last_heartbeat:a},...i,headers:V([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poll(t,r={},i){let{betas:s,"Anthropic-Worker-ID":n,...a}=r??{};return this._client.get(ue`/v1/environments/${t}/work/poll?beta=true`,{query:a,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...n!=null?{"Anthropic-Worker-ID":n}:void 0},i?.headers])})}stats(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/environments/${t}/work/stats?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}stop(t,r,i){let{environment_id:s,betas:n,...a}=r;return this._client.post(ue`/v1/environments/${s}/work/${t}/stop?beta=true`,{body:a,...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poller(t){return new jc({...t,client:this._client})}worker(t){return new zc({...t,client:this._client})}},yo.WorkPoller=jc,yo.EnvironmentWorker=zc}),Wc,jy=Z(()=>{$y(),$y(),Je(),He(),et(),Wc=class extends Ge{constructor(){super(...arguments),this.work=new yo(this._client)}create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/environments?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/environments/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}update(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/environments/${t}?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/environments?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(t,r={},i){let{betas:s}=r??{};return this._client.delete(ue`/v1/environments/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}archive(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/environments/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}},Wc.Work=yo}),Mh,Fy=Z(()=>{Je(),He(),et(),Mh=class extends Ge{create(t,r,i){let{view:s,betas:n,...a}=r;return this._client.post(ue`/v1/memory_stores/${t}/memories?beta=true`,{query:{view:s},body:a,...i,headers:V([{"anthropic-beta":[...n??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}retrieve(t,r,i){let{memory_store_id:s,betas:n,...a}=r;return this._client.get(ue`/v1/memory_stores/${s}/memories/${t}?beta=true`,{query:a,...i,headers:V([{"anthropic-beta":[...n??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}update(t,r,i){let{memory_store_id:s,view:n,betas:a,...o}=r;return this._client.post(ue`/v1/memory_stores/${s}/memories/${t}?beta=true`,{query:{view:n},body:o,...i,headers:V([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/memory_stores/${t}/memories?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}delete(t,r,i){let{memory_store_id:s,expected_content_sha256:n,betas:a}=r;return this._client.delete(ue`/v1/memory_stores/${s}/memories/${t}?beta=true`,{query:{expected_content_sha256:n},...i,headers:V([{"anthropic-beta":[...a??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}}}),Uh,By=Z(()=>{Je(),He(),et(),Uh=class extends Ge{retrieve(t,r,i){let{memory_store_id:s,betas:n,...a}=r;return this._client.get(ue`/v1/memory_stores/${s}/memory_versions/${t}?beta=true`,{query:a,...i,headers:V([{"anthropic-beta":[...n??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/memory_stores/${t}/memory_versions?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}redact(t,r,i){let{memory_store_id:s,betas:n}=r;return this._client.post(ue`/v1/memory_stores/${s}/memory_versions/${t}/redact?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}}}),bo,Hy=Z(()=>{Fy(),Fy(),By(),By(),Je(),He(),et(),bo=class extends Ge{constructor(){super(...arguments),this.memories=new Mh(this._client),this.memoryVersions=new Uh(this._client)}create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/memory_stores?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/memory_stores/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}update(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/memory_stores/${t}?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/memory_stores?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString()},r?.headers])})}delete(t,r={},i){let{betas:s}=r??{};return this._client.delete(ue`/v1/memory_stores/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}archive(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/memory_stores/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},i?.headers])})}},bo.Memories=Mh,bo.MemoryVersions=Uh}),rl=Z(()=>{dt()}),f_,MC=Z(()=>{dt(),aC(),f_=class UC{constructor(t,r){this.iterator=t,this.controller=r}async*decoder(){let t=new Os;for await(let r of this.iterator)for(let i of t.decode(r))yield JSON.parse(i);for(let r of t.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,r){if(!t.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new we("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new we("Attempted to iterate over a response with no body");return new UC(e_(t.body),r)}}}),$h,zy=Z(()=>{Je(),He(),MC(),rl(),et(),$h=class extends Ge{create(t,r){let{betas:i,user_profile_id:s,...n}=t;return this._client.post("/v1/messages/batches?beta=true",{body:n,...r,headers:V([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...s!=null?{"anthropic-user-profile-id":s}:void 0},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/messages/batches/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",ra,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(t,r={},i){let{betas:s}=r??{};return this._client.delete(ue`/v1/messages/batches/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},i?.headers])})}cancel(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/messages/batches/${t}/cancel?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString()},i?.headers])})}async results(t,r={},i){let s=await this.retrieve(t);if(!s.results_url)throw new we(`No batch \`results_url\`; Has it finished processing? ${s.processing_status} - ${s.id}`);let{betas:n}=r??{};return this._client.get(s.results_url,{...i,headers:V([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,o)=>f_.fromResponse(o.response,o.controller))}}}),m_,$C=Z(()=>{m_={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function jC(e){return e?.output_format??e?.output_config?.format}function Wy(e,t,r){let i=jC(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(s=>{if(s.type==="text"){let n=Object.defineProperty({...s},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(n,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return s}),parsed_output:null}:FC(e,t,r)}function FC(e,t,r){let i=null,s=e.content.map(n=>{if(n.type==="text"){let a=PP(t,n.text);i===null&&(i=a);let o=Object.defineProperty({...n},"parsed_output",{value:a,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),a},enumerable:!1})}return n});return{...e,content:s,parsed_output:i}}function PP(e,t){let r=jC(e);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(t):JSON.parse(t)}catch(i){throw new we(`Failed to parse structured output: ${i}`)}}var BC=Z(()=>{dt()}),HC=Z(()=>{Lu()}),NP=e=>{let t=0,r=[];for(;t<e.length;){let i=e[t];if(i==="\\"){t++;continue}if(i==="{"){r.push({type:"brace",value:"{"}),t++;continue}if(i==="}"){r.push({type:"brace",value:"}"}),t++;continue}if(i==="["){r.push({type:"paren",value:"["}),t++;continue}if(i==="]"){r.push({type:"paren",value:"]"}),t++;continue}if(i===":"){r.push({type:"separator",value:":"}),t++;continue}if(i===","){r.push({type:"delimiter",value:","}),t++;continue}if(i==='"'){let a="",o=!1;for(i=e[++t];i!=='"';){if(t===e.length){o=!0;break}if(i==="\\"){if(t++,t===e.length){o=!0;break}a+=i+e[t],i=e[++t]}else a+=i,i=e[++t]}i=e[++t],!o&&r.push({type:"string",value:a});continue}if(i&&/\s/.test(i)){t++;continue}let s=/[0-9]/;if(i&&s.test(i)||i==="-"||i==="."){let a="";for(i==="-"&&(a+=i,i=e[++t]);i&&(s.test(i)||i==="."||i==="e"||i==="E"||(i==="-"||i==="+")&&(a[a.length-1]==="e"||a[a.length-1]==="E"));)a+=i,i=e[++t];r.push({type:"number",value:a});continue}let n=/[a-z]/i;if(i&&n.test(i)){let a="";for(;i&&n.test(i)&&t!==e.length;)a+=i,i=e[++t];if(a=="true"||a=="false"||a==="null")r.push({type:"name",value:a});else{t++;continue}continue}t++}return r},an=e=>{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),an(e);case"number":let r=t.value[t.value.length-1];if(r==="."||r==="-"||r==="+"||r==="e"||r==="E")return e=e.slice(0,e.length-1),an(e);case"string":let i=e[e.length-2];if(i?.type==="delimiter")return e=e.slice(0,e.length-1),an(e);if(i?.type==="brace"&&i.value==="{")return e=e.slice(0,e.length-1),an(e);break;case"delimiter":return e=e.slice(0,e.length-1),an(e)}return e},MP=e=>{let t=[];return e.map(r=>{r.type==="brace"&&(r.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(r=>{r==="}"?e.push({type:"brace",value:"}"}):r==="]"&&e.push({type:"paren",value:"]"})}),e},UP=e=>{let t="";return e.map(r=>{r.type==="string"?t+='"'+r.value+'"':t+=r.value}),t},$P=e=>JSON.parse(UP(MP(an(NP(e))))),jP=()=>{};function zC(e,t){let r={};for(let n of Object.keys(e))n!=="input"&&(r[n]=e[n]);Object.defineProperty(r,wn,{value:t,enumerable:!1,writable:!0});let i,s=!1;return Object.defineProperty(r,"input",{enumerable:!0,configurable:!0,get(){return s||(i=t?$P(t):{},s=!0),i}}),r}var wn="__json_buf",WC=Z(()=>{jP()});function Fd(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}var nr,$i,Vs,Ia,Fl,La,Pa,Bl,Na,ri,Ma,Hl,zl,ds,Wl,Kl,Ua,Bd,Ky,$a,Hd,zd,Wd,Gy,Kd,KC,FP=Z(()=>{Cr(),Di(),rl(),HC(),BC(),WC(),KC=class jh{constructor(t,r){nr.add(this),this.messages=[],this.receivedMessages=[],$i.set(this,void 0),Vs.set(this,null),this.controller=new AbortController,Ia.set(this,void 0),Fl.set(this,()=>{}),La.set(this,()=>{}),Pa.set(this,void 0),Bl.set(this,()=>{}),Na.set(this,()=>{}),ri.set(this,{}),Ma.set(this,!1),Hl.set(this,!1),zl.set(this,!1),ds.set(this,!1),Wl.set(this,void 0),Kl.set(this,void 0),Ua.set(this,void 0),$a.set(this,i=>{if(ie(this,Hl,!0,"f"),Rn(i)&&(i=new Pr),i instanceof Pr)return ie(this,zl,!0,"f"),this._emit("abort",i);if(i instanceof we)return this._emit("error",i);if(i instanceof Error){let s=new we(i.message);return s.cause=i,this._emit("error",s)}return this._emit("error",new we(String(i)))}),ie(this,Ia,new Promise((i,s)=>{ie(this,Fl,i,"f"),ie(this,La,s,"f")}),"f"),ie(this,Pa,new Promise((i,s)=>{ie(this,Bl,i,"f"),ie(this,Na,s,"f")}),"f"),D(this,Ia,"f").catch(()=>{}),D(this,Pa,"f").catch(()=>{}),ie(this,Vs,t,"f"),ie(this,Ua,r?.logger??console,"f")}get response(){return D(this,Wl,"f")}get request_id(){return D(this,Kl,"f")}async withResponse(){ie(this,ds,!0,"f");let t=await D(this,Ia,"f");if(!t)throw Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){let r=new jh(null);return r._run(()=>r._fromReadableStream(t)),r}static createMessage(t,r,i,{logger:s}={}){let n=new jh(r,{logger:s});for(let a of r.messages)n._addMessageParam(a);return ie(n,Vs,{...r,stream:!0},"f"),n._run(()=>n._createMessage(t,{...r,stream:!0},{...i,headers:{...i?.headers,[EC]:"stream"}})),n}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},D(this,$a,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,r=!0){this.receivedMessages.push(t),r&&this._emit("message",t)}async _createMessage(t,r,i){let s=i?.signal,n;s&&(s.aborted&&this.controller.abort(),n=this.controller.abort.bind(this.controller),s.addEventListener("abort",n));try{D(this,nr,"m",Hd).call(this);let{response:a,data:o}=await t.create({...r,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(a);for await(let l of o)D(this,nr,"m",zd).call(this,l);if(o.controller.signal?.aborted)throw new Pr;D(this,nr,"m",Wd).call(this)}finally{s&&n&&s.removeEventListener("abort",n)}}_connected(t){this.ended||(ie(this,Wl,t,"f"),ie(this,Kl,t?.headers.get("request-id"),"f"),D(this,Fl,"f").call(this,t),this._emit("connect"))}get ended(){return D(this,Ma,"f")}get errored(){return D(this,Hl,"f")}get aborted(){return D(this,zl,"f")}abort(){this.controller.abort()}on(t,r){return(D(this,ri,"f")[t]||(D(this,ri,"f")[t]=[])).push({listener:r}),this}off(t,r){let i=D(this,ri,"f")[t];if(!i)return this;let s=i.findIndex(n=>n.listener===r);return s>=0&&i.splice(s,1),this}once(t,r){return(D(this,ri,"f")[t]||(D(this,ri,"f")[t]=[])).push({listener:r,once:!0}),this}emitted(t){return new Promise((r,i)=>{ie(this,ds,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,r)})}async done(){ie(this,ds,!0,"f"),await D(this,Pa,"f")}get currentMessage(){return D(this,$i,"f")}async finalMessage(){return await this.done(),D(this,nr,"m",Bd).call(this)}async finalText(){return await this.done(),D(this,nr,"m",Ky).call(this)}_emit(t,...r){if(D(this,Ma,"f"))return;t==="end"&&(ie(this,Ma,!0,"f"),D(this,Bl,"f").call(this));let i=D(this,ri,"f")[t];if(i&&(D(this,ri,"f")[t]=i.filter(s=>!s.once),i.forEach(({listener:s})=>s(...r))),t==="abort"){let s=r[0];!D(this,ds,"f")&&!i?.length&&Promise.reject(s),D(this,La,"f").call(this,s),D(this,Na,"f").call(this,s),this._emit("end");return}if(t==="error"){let s=r[0];!D(this,ds,"f")&&!i?.length&&Promise.reject(s),D(this,La,"f").call(this,s),D(this,Na,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",D(this,nr,"m",Bd).call(this))}async _fromReadableStream(t,r){let i=r?.signal,s;i&&(i.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),i.addEventListener("abort",s));try{D(this,nr,"m",Hd).call(this),this._connected(null);let n=As.fromReadableStream(t,this.controller);for await(let a of n)D(this,nr,"m",zd).call(this,a);if(n.controller.signal?.aborted)throw new Pr;D(this,nr,"m",Wd).call(this)}finally{i&&s&&i.removeEventListener("abort",s)}}[($i=new WeakMap,Vs=new WeakMap,Ia=new WeakMap,Fl=new WeakMap,La=new WeakMap,Pa=new WeakMap,Bl=new WeakMap,Na=new WeakMap,ri=new WeakMap,Ma=new WeakMap,Hl=new WeakMap,zl=new WeakMap,ds=new WeakMap,Wl=new WeakMap,Kl=new WeakMap,Ua=new WeakMap,$a=new WeakMap,nr=new WeakSet,Bd=function(){if(this.receivedMessages.length===0)throw new we("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Ky=function(){if(this.receivedMessages.length===0)throw new we("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(t.length===0)throw new we("stream ended without producing a content block with type=text");return t.join(" ")},Hd=function(){this.ended||ie(this,$i,void 0,"f")},zd=function(t){if(this.ended)return;let r=D(this,nr,"m",Gy).call(this,t);switch(this._emit("streamEvent",t,r),t.type){case"content_block_delta":{let i=r.content.at(-1);switch(t.delta.type){case"text_delta":{i.type==="text"&&this._emit("text",t.delta.text,i.text||"");break}case"citations_delta":{i.type==="text"&&this._emit("citation",t.delta.citation,i.citations??[]);break}case"input_json_delta":{if(Fd(i)&&D(this,ri,"f").inputJson?.length){let s;try{s=i.input}catch(n){D(this,$a,"f").call(this,D(this,nr,"m",Kd).call(this,i,n));break}this._emit("inputJson",t.delta.partial_json,s)}break}case"thinking_delta":{i.type==="thinking"&&this._emit("thinking",t.delta.thinking,i.thinking);break}case"signature_delta":{i.type==="thinking"&&this._emit("signature",i.signature);break}case"compaction_delta":{i.type==="compaction"&&i.content&&this._emit("compaction",i.content);break}default:t.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(Wy(r,D(this,Vs,"f"),{logger:D(this,Ua,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{ie(this,$i,r,"f");break}case"content_block_start":case"message_delta":break}},Wd=function(){if(this.ended)throw new we("stream has ended, this shouldn't happen");let t=D(this,$i,"f");if(!t)throw new we("request ended without sending any chunks");return ie(this,$i,void 0,"f"),Wy(t,D(this,Vs,"f"),{logger:D(this,Ua,"f")})},Gy=function(t){let r=D(this,$i,"f");if(t.type==="message_start"){if(r)throw new we(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!r)throw new we(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return r;case"message_delta":return r.container=t.delta.container,r.stop_reason=t.delta.stop_reason,r.stop_sequence=t.delta.stop_sequence,t.delta.stop_details!=null&&(r.stop_details=t.delta.stop_details),r.usage.output_tokens=t.usage.output_tokens,r.context_management=t.context_management,t.usage.input_tokens!=null&&(r.usage.input_tokens=t.usage.input_tokens),t.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens),t.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens),t.usage.server_tool_use!=null&&(r.usage.server_tool_use=t.usage.server_tool_use),t.usage.iterations!=null&&(r.usage.iterations=t.usage.iterations),r;case"content_block_start":return r.content.push(t.content_block),t.content_block.type==="fallback"&&(r.model=t.content_block.to.model),r;case"content_block_delta":{let i=r.content.at(t.index);switch(t.delta.type){case"text_delta":{i?.type==="text"&&(r.content[t.index]={...i,text:(i.text||"")+t.delta.text});break}case"citations_delta":{i?.type==="text"&&(r.content[t.index]={...i,citations:[...i.citations??[],t.delta.citation]});break}case"input_json_delta":{if(i&&Fd(i)){let s=(i[wn]||"")+t.delta.partial_json;r.content[t.index]=zC(i,s)}break}case"thinking_delta":{i?.type==="thinking"&&(r.content[t.index]={...i,thinking:i.thinking+t.delta.thinking});break}case"signature_delta":{i?.type==="thinking"&&(r.content[t.index]={...i,signature:t.delta.signature});break}case"compaction_delta":{i?.type==="compaction"&&(r.content[t.index]={...i,content:(i.content||"")+t.delta.content,encrypted_content:t.delta.encrypted_content});break}default:t.delta}return r}case"content_block_stop":{let i=r.content.at(t.index);if(i&&Fd(i)&&wn in i){let s;try{s=i.input}catch(n){s={},D(this,$a,"f").call(this,D(this,nr,"m",Kd).call(this,i,n))}Object.defineProperty(i,"input",{value:s,enumerable:!0,configurable:!0,writable:!0})}return r}}},Kd=function(t,r){let i=t[wn];return new we(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${r}. JSON: ${i}`)},Symbol.asyncIterator)](){let t=[],r=[],i=!1;return this.on("streamEvent",s=>{let n=r.shift();n?n.resolve(s):t.push(s)}),this.on("end",()=>{i=!0;for(let s of r)s.resolve(void 0);r.length=0}),this.on("abort",s=>{i=!0;for(let n of r)n.reject(s);r.length=0}),this.on("error",s=>{i=!0;for(let n of r)n.reject(s);r.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,n)=>r.push({resolve:s,reject:n})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new As(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}}),BP=1e5,HP=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
|
|
22
|
+
1. Task Overview
|
|
23
|
+
The user's core request and success criteria
|
|
24
|
+
Any clarifications or constraints they specified
|
|
25
|
+
2. Current State
|
|
26
|
+
What has been completed so far
|
|
27
|
+
Files created, modified, or analyzed (with paths if relevant)
|
|
28
|
+
Key outputs or artifacts produced
|
|
29
|
+
3. Important Discoveries
|
|
30
|
+
Technical constraints or requirements uncovered
|
|
31
|
+
Decisions made and their rationale
|
|
32
|
+
Errors encountered and how they were resolved
|
|
33
|
+
What approaches were tried that didn't work (and why)
|
|
34
|
+
4. Next Steps
|
|
35
|
+
Specific actions needed to complete the task
|
|
36
|
+
Any blockers or open questions to resolve
|
|
37
|
+
Priority order if multiple steps remain
|
|
38
|
+
5. Context to Preserve
|
|
39
|
+
User preferences or style requirements
|
|
40
|
+
Domain-specific details that aren't obvious
|
|
41
|
+
Any promises made to the user
|
|
42
|
+
Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
|
|
43
|
+
Wrap your summary in <summary></summary> tags.`;async function zP(e,t=e.messages.at(-1),r){if(!t||t.role!=="assistant"||!t.content||typeof t.content=="string")return null;let i=t.content.filter(s=>s.type==="tool_use");return i.length===0?null:{role:"user",content:await Promise.all(i.map(async s=>{let n=e.tools.find(a=>("name"in a?a.name:a.mcp_server_name)===s.name);if(!n||!("run"in n))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let a=s.input;"parse"in n&&n.parse&&(a=n.parse(a));let o=await n.run(a,{toolUse:s,toolUseBlock:s,signal:r?.signal});return{type:"tool_result",tool_use_id:s.id,content:o}}catch(a){return{type:"tool_result",tool_use_id:s.id,content:a instanceof Be?a.content:`Error: ${a instanceof Error?a.message:String(a)}`,is_error:!0}}}))}}var ja,Zs,ps,kt,ar,_r,bi,ji,Fa,qy,Gd,Fh,Vy=Z(()=>{Cr(),Dn(),dt(),He(),Di(),Fh=class{constructor(t,r,i){ja.add(this),this.client=t,Zs.set(this,!1),ps.set(this,!1),kt.set(this,void 0),ar.set(this,void 0),_r.set(this,void 0),bi.set(this,void 0),ji.set(this,void 0),Fa.set(this,0),ie(this,kt,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=vC(r.tools,r.messages);ie(this,ar,{...i,headers:V([Sh("BetaToolRunner"),s.length?{[bC]:s.join(", ")}:void 0,i?.headers])},"f"),ie(this,ji,Bc(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Zs=new WeakMap,ps=new WeakMap,kt=new WeakMap,ar=new WeakMap,_r=new WeakMap,bi=new WeakMap,ji=new WeakMap,Fa=new WeakMap,ja=new WeakSet,qy=async function(){let t=D(this,kt,"f").params.compactionControl;if(!t||!t.enabled)return!1;let r=0;if(D(this,_r,"f")!==void 0)try{let l=await D(this,_r,"f");r=l.usage.input_tokens+(l.usage.cache_creation_input_tokens??0)+(l.usage.cache_read_input_tokens??0)+l.usage.output_tokens}catch{return!1}let i=t.contextTokenThreshold??BP;if(r<i)return!1;let s=t.model??D(this,kt,"f").params.model,n=t.summaryPrompt??HP,a=D(this,kt,"f").params.messages;if(a[a.length-1].role==="assistant"){let l=a[a.length-1];if(Array.isArray(l.content)){let c=l.content.filter(u=>u.type!=="tool_use");c.length===0?a.pop():l.content=c}}let o=await this.client.beta.messages.create({model:s,messages:[...a,{role:"user",content:[{type:"text",text:n}]}],max_tokens:D(this,kt,"f").params.max_tokens},{signal:D(this,ar,"f").signal,headers:V([D(this,ar,"f").headers,Sh("compaction")])});if(o.content[0]?.type!=="text")throw new we("Expected text response for compaction");return D(this,kt,"f").params.messages=[{role:"user",content:o.content}],!0},Symbol.asyncIterator)](){var t;if(D(this,Zs,"f"))throw new we("Cannot iterate over a consumed stream");ie(this,Zs,!0,"f"),ie(this,ps,!0,"f"),ie(this,bi,void 0,"f");try{for(;;){let r;try{if(D(this,kt,"f").params.max_iterations&&D(this,Fa,"f")>=D(this,kt,"f").params.max_iterations)break;ie(this,ps,!1,"f"),ie(this,bi,void 0,"f"),ie(this,Fa,(t=D(this,Fa,"f"),t++,t),"f"),ie(this,_r,void 0,"f");let{max_iterations:i,compactionControl:s,...n}=D(this,kt,"f").params;if(n.stream?(r=this.client.beta.messages.stream({...n},D(this,ar,"f")),ie(this,_r,r.finalMessage(),"f"),D(this,_r,"f").catch(()=>{}),yield r):(ie(this,_r,this.client.beta.messages.create({...n,stream:!1},D(this,ar,"f")),"f"),yield D(this,_r,"f")),!await D(this,ja,"m",qy).call(this)){if(!D(this,ps,"f")){let o=await D(this,_r,"f");if(D(this,kt,"f").params.messages.push({role:o.role,content:o.content}),o.stop_reason==="refusal")break}let a=await D(this,ja,"m",Gd).call(this,D(this,kt,"f").params.messages.at(-1));if(a)D(this,kt,"f").params.messages.push(a);else if(!D(this,ps,"f"))break}}finally{r&&r.abort()}}if(!D(this,_r,"f"))throw new we("ToolRunner concluded without a message from the server");D(this,ji,"f").resolve(await D(this,_r,"f"))}catch(r){throw ie(this,Zs,!1,"f"),D(this,ji,"f").promise.catch(()=>{}),D(this,ji,"f").reject(r),ie(this,ji,Bc(),"f"),r}}setMessagesParams(t){typeof t=="function"?D(this,kt,"f").params=t(D(this,kt,"f").params):D(this,kt,"f").params=t,ie(this,ps,!0,"f"),ie(this,bi,void 0,"f")}setRequestOptions(t){typeof t=="function"?ie(this,ar,t(D(this,ar,"f")),"f"):ie(this,ar,{...D(this,ar,"f"),...t},"f")}async generateToolResponse(t=D(this,ar,"f").signal){let r=await D(this,_r,"f")??this.params.messages.at(-1);return r?D(this,ja,"m",Gd).call(this,r,t):null}done(){return D(this,ji,"f").promise}async runUntilDone(){if(!D(this,Zs,"f"))for await(let t of this);return this.done()}get params(){return D(this,kt,"f").params}pushMessages(...t){this.setMessagesParams(r=>({...r,messages:[...r.messages,...t]}))}then(t,r){return this.runUntilDone().then(t,r)}},Gd=async function(e,t=D(this,ar,"f").signal){return D(this,bi,"f")!==void 0?D(this,bi,"f"):(ie(this,bi,zP(D(this,kt,"f").params,e,{...D(this,ar,"f"),signal:t}),"f"),D(this,bi,"f"))}});function Zy(e){if(!e.output_format)return e;if(e.output_config?.format)throw new we("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...r}=e;return{...r,output_config:{...e.output_config,format:t}}}var qd,Xy,dn,Yy=Z(()=>{rl(),zy(),$C(),He(),Di(),BC(),FP(),Vy(),Dn(),zy(),Vy(),Dn(),qd={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026","claude-opus-4-1":"August 5th, 2026","claude-opus-4-1-20250805":"August 5th, 2026","claude-mythos-preview":"June 30th, 2026"},Xy=["claude-mythos-preview","claude-opus-4-6"],dn=class extends Ge{constructor(){super(...arguments),this.batches=new $h(this._client)}create(t,r){let i=Zy(t),{betas:s,user_profile_id:n,...a}=i;a.model in qd&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${qd[a.model]}
|
|
44
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),Xy.includes(a.model)&&a.thinking&&a.thinking.type==="enabled"&&console.warn(`Using Claude with ${a.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let o=this._client._options.timeout;if(!a.stream&&o==null){let c=m_[a.model]??void 0;o=this._client.calculateNonstreamingTimeout(a.max_tokens,c)}let l=yC(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:o??6e5,...r,headers:V([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0,...n!=null?{"anthropic-user-profile-id":n}:void 0},l,r?.headers]),stream:i.stream??!1})}parse(t,r){return r={...r,headers:V([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(t,r).then(i=>FC(i,t,{logger:this._client.logger??console}))}stream(t,r){return KC.createMessage(this,t,r)}countTokens(t,r){let i=Zy(t),{betas:s,user_profile_id:n,...a}=i;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...r,headers:V([{"anthropic-beta":[...s??[],"token-counting-2024-11-01"].toString(),...n!=null?{"anthropic-user-profile-id":n}:void 0},r?.headers])})}toolRunner(t,r){return new Fh(this._client,t,r)}},dn.Batches=$h,dn.BetaToolRunner=Fh,dn.ToolError=Be}),Kc,Jy=Z(()=>{Je(),He(),et(),Ih(),Ih(),Kc=class extends Ge{list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/sessions/${t}/events?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}send(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/sessions/${t}/events?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}stream(t,r={},i){let{betas:s,...n}=r??{};return this._client.get(ue`/v1/sessions/${t}/events/stream?beta=true`,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers]),stream:!0})}toolRunner(t,r){return new Fc(t,{...r,client:this._client})}},Kc.SessionToolRunner=Fc}),Bh,Qy=Z(()=>{Je(),He(),et(),Bh=class extends Ge{retrieve(t,r,i){let{session_id:s,betas:n}=r;return this._client.get(ue`/v1/sessions/${s}/resources/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}update(t,r,i){let{session_id:s,betas:n,...a}=r;return this._client.post(ue`/v1/sessions/${s}/resources/${t}?beta=true`,{body:a,...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/sessions/${t}/resources?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}delete(t,r,i){let{session_id:s,betas:n}=r;return this._client.delete(ue`/v1/sessions/${s}/resources/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}add(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/sessions/${t}/resources?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}}}),Hh,eb=Z(()=>{Je(),He(),et(),Hh=class extends Ge{list(t,r,i){let{session_id:s,betas:n,...a}=r;return this._client.getAPIList(ue`/v1/sessions/${s}/threads/${t}/events?beta=true`,Et,{query:a,...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}stream(t,r,i){let{session_id:s,betas:n}=r;return this._client.get(ue`/v1/sessions/${s}/threads/${t}/stream?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers]),stream:!0})}}}),Gc,tb=Z(()=>{eb(),eb(),Je(),He(),et(),Gc=class extends Ge{constructor(){super(...arguments),this.events=new Hh(this._client)}retrieve(t,r,i){let{session_id:s,betas:n}=r;return this._client.get(ue`/v1/sessions/${s}/threads/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/sessions/${t}/threads?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}archive(t,r,i){let{session_id:s,betas:n}=r;return this._client.post(ue`/v1/sessions/${s}/threads/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}},Gc.Events=Hh}),pn,rb=Z(()=>{Jy(),Jy(),Qy(),Qy(),tb(),tb(),Je(),He(),et(),pn=class extends Ge{constructor(){super(...arguments),this.events=new Kc(this._client),this.resources=new Bh(this._client),this.threads=new Gc(this._client)}create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/sessions?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/sessions/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}update(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/sessions/${t}?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/sessions?beta=true",dC,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(t,r={},i){let{betas:s}=r??{};return this._client.delete(ue`/v1/sessions/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}archive(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/sessions/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}},pn.Events=Kc,pn.Resources=Bh,pn.Threads=Gc}),zh,ib=Z(()=>{Je(),He(),Ro(),et(),zh=class extends Ge{create(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/skills/${t}/versions?beta=true`,u_({body:n,...i,headers:V([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},i?.headers])},this._client,!1))}retrieve(t,r,i){let{skill_id:s,betas:n}=r;return this._client.get(ue`/v1/skills/${s}/versions/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},i?.headers])})}list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/skills/${t}/versions?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},i?.headers])})}delete(t,r,i){let{skill_id:s,betas:n}=r;return this._client.delete(ue`/v1/skills/${s}/versions/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},i?.headers])})}download(t,r,i){let{skill_id:s,betas:n}=r;return this._client.get(ue`/v1/skills/${s}/versions/${t}/content?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},i?.headers]),__binaryResponse:!0})}}}),qc,sb=Z(()=>{ib(),ib(),Je(),He(),Ro(),et(),qc=class extends Ge{constructor(){super(...arguments),this.versions=new zh(this._client)}create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/skills?beta=true",u_({body:s,...r,headers:V([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/skills/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/skills?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(t,r={},i){let{betas:s}=r??{};return this._client.delete(ue`/v1/skills/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},i?.headers])})}},qc.Versions=zh}),Wh,nb=Z(()=>{Je(),He(),et(),Wh=class extends Ge{create(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/tunnels/${t}/certificates?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},i?.headers])})}retrieve(t,r,i){let{tunnel_id:s,betas:n}=r;return this._client.get(ue`/v1/tunnels/${s}/certificates/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"mcp-tunnels-2026-06-22"].toString()},i?.headers])})}list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/tunnels/${t}/certificates?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},i?.headers])})}archive(t,r,i){let{tunnel_id:s,betas:n}=r;return this._client.post(ue`/v1/tunnels/${s}/certificates/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"mcp-tunnels-2026-06-22"].toString()},i?.headers])})}}}),Vc,ab=Z(()=>{nb(),nb(),Je(),He(),et(),Vc=class extends Ge{constructor(){super(...arguments),this.certificates=new Wh(this._client)}create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/tunnels?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/tunnels/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/tunnels?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString()},r?.headers])})}archive(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/tunnels/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},i?.headers])})}revealToken(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/tunnels/${t}/reveal_token?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},i?.headers])})}rotateToken(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/tunnels/${t}/rotate_token?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"mcp-tunnels-2026-06-22"].toString()},i?.headers])})}},Vc.Certificates=Wh}),Kh,ob=Z(()=>{Je(),He(),et(),Kh=class extends Ge{create(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/vaults/${t}/credentials?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}retrieve(t,r,i){let{vault_id:s,betas:n}=r;return this._client.get(ue`/v1/vaults/${s}/credentials/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}update(t,r,i){let{vault_id:s,betas:n,...a}=r;return this._client.post(ue`/v1/vaults/${s}/credentials/${t}?beta=true`,{body:a,...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t,r={},i){let{betas:s,...n}=r??{};return this._client.getAPIList(ue`/v1/vaults/${t}/credentials?beta=true`,Et,{query:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}delete(t,r,i){let{vault_id:s,betas:n}=r;return this._client.delete(ue`/v1/vaults/${s}/credentials/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}archive(t,r,i){let{vault_id:s,betas:n}=r;return this._client.post(ue`/v1/vaults/${s}/credentials/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}mcpOAuthValidate(t,r,i){let{vault_id:s,betas:n}=r;return this._client.post(ue`/v1/vaults/${s}/credentials/${t}/mcp_oauth_validate?beta=true`,{...i,headers:V([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}}}),Zc,lb=Z(()=>{ob(),ob(),Je(),He(),et(),Zc=class extends Ge{constructor(){super(...arguments),this.credentials=new Kh(this._client)}create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/vaults?beta=true",{body:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/vaults/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}update(t,r,i){let{betas:s,...n}=r;return this._client.post(ue`/v1/vaults/${t}?beta=true`,{body:n,...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/vaults?beta=true",Et,{query:s,...r,headers:V([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(t,r={},i){let{betas:s}=r??{};return this._client.delete(ue`/v1/vaults/${t}?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}archive(t,r={},i){let{betas:s}=r??{};return this._client.post(ue`/v1/vaults/${t}/archive?beta=true`,{...i,headers:V([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}},Zc.Credentials=Kh}),Dt,GC=Z(()=>{fy(),fy(),my(),my(),gy(),gy(),_y(),_y(),vy(),vy(),yy(),yy(),Ey(),Ey(),Sy(),Sy(),jy(),jy(),Hy(),Hy(),Yy(),Yy(),rb(),rb(),sb(),sb(),ab(),ab(),lb(),lb(),Dt=class extends Ge{constructor(){super(...arguments),this.models=new Oh(this._client),this.messages=new dn(this._client),this.agents=new Nc(this._client),this.environments=new Wc(this._client),this.sessions=new pn(this._client),this.deployments=new Eh(this._client),this.deploymentRuns=new bh(this._client),this.vaults=new Zc(this._client),this.memoryStores=new bo(this._client),this.files=new Ch(this._client),this.skills=new qc(this._client),this.webhooks=new xh(this._client),this.userProfiles=new Ah(this._client),this.dreams=new wh(this._client),this.tunnels=new Vc(this._client)}},Dt.Models=Oh,Dt.Messages=dn,Dt.Agents=Nc,Dt.Environments=Wc,Dt.Sessions=pn,Dt.Deployments=Eh,Dt.DeploymentRuns=bh,Dt.Vaults=Zc,Dt.MemoryStores=bo,Dt.Files=Ch,Dt.Skills=qc,Dt.Webhooks=xh,Dt.UserProfiles=Ah,Dt.Dreams=wh,Dt.Tunnels=Vc}),qh,qC=Z(()=>{He(),qh=class extends Ge{create(t,r){let{betas:i,...s}=t;return this._client.post("/v1/complete",{body:s,timeout:this._client._options.timeout??6e5,...r,headers:V([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers]),stream:t.stream??!1})}}});function VC(e){return e?.output_config?.format}function cb(e,t,r){let i=VC(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(s=>s.type==="text"?Object.defineProperty({...s},"parsed_output",{value:null,enumerable:!1}):s),parsed_output:null}:ZC(e,t,r)}function ZC(e,t,r){let i=null,s=e.content.map(n=>{if(n.type==="text"){let a=WP(t,n.text);return i===null&&(i=a),Object.defineProperty({...n},"parsed_output",{value:a,enumerable:!1})}return n});return{...e,content:s,parsed_output:i}}function WP(e,t){let r=VC(e);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(t):JSON.parse(t)}catch(i){throw new we(`Failed to parse structured output: ${i}`)}}var XC=Z(()=>{dt()});function Vd(e){return e.type==="tool_use"||e.type==="server_tool_use"}var Rr,Fi,Xs,Ba,Gl,Ha,za,ql,Wa,ii,Ka,Vl,Zl,hs,Xl,Yl,Ga,Zd,ub,Xd,Yd,Jd,Qd,db,YC,KP=Z(()=>{Cr(),Di(),rl(),HC(),XC(),WC(),YC=class Zh{constructor(t,r){Rr.add(this),this.messages=[],this.receivedMessages=[],Fi.set(this,void 0),Xs.set(this,null),this.controller=new AbortController,Ba.set(this,void 0),Gl.set(this,()=>{}),Ha.set(this,()=>{}),za.set(this,void 0),ql.set(this,()=>{}),Wa.set(this,()=>{}),ii.set(this,{}),Ka.set(this,!1),Vl.set(this,!1),Zl.set(this,!1),hs.set(this,!1),Xl.set(this,void 0),Yl.set(this,void 0),Ga.set(this,void 0),Xd.set(this,i=>{if(ie(this,Vl,!0,"f"),Rn(i)&&(i=new Pr),i instanceof Pr)return ie(this,Zl,!0,"f"),this._emit("abort",i);if(i instanceof we)return this._emit("error",i);if(i instanceof Error){let s=new we(i.message);return s.cause=i,this._emit("error",s)}return this._emit("error",new we(String(i)))}),ie(this,Ba,new Promise((i,s)=>{ie(this,Gl,i,"f"),ie(this,Ha,s,"f")}),"f"),ie(this,za,new Promise((i,s)=>{ie(this,ql,i,"f"),ie(this,Wa,s,"f")}),"f"),D(this,Ba,"f").catch(()=>{}),D(this,za,"f").catch(()=>{}),ie(this,Xs,t,"f"),ie(this,Ga,r?.logger??console,"f")}get response(){return D(this,Xl,"f")}get request_id(){return D(this,Yl,"f")}async withResponse(){ie(this,hs,!0,"f");let t=await D(this,Ba,"f");if(!t)throw Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){let r=new Zh(null);return r._run(()=>r._fromReadableStream(t)),r}static createMessage(t,r,i,{logger:s}={}){let n=new Zh(r,{logger:s});for(let a of r.messages)n._addMessageParam(a);return ie(n,Xs,{...r,stream:!0},"f"),n._run(()=>n._createMessage(t,{...r,stream:!0},{...i,headers:{...i?.headers,[EC]:"stream"}})),n}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},D(this,Xd,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,r=!0){this.receivedMessages.push(t),r&&this._emit("message",t)}async _createMessage(t,r,i){let s=i?.signal,n;s&&(s.aborted&&this.controller.abort(),n=this.controller.abort.bind(this.controller),s.addEventListener("abort",n));try{D(this,Rr,"m",Yd).call(this);let{response:a,data:o}=await t.create({...r,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(a);for await(let l of o)D(this,Rr,"m",Jd).call(this,l);if(o.controller.signal?.aborted)throw new Pr;D(this,Rr,"m",Qd).call(this)}finally{s&&n&&s.removeEventListener("abort",n)}}_connected(t){this.ended||(ie(this,Xl,t,"f"),ie(this,Yl,t?.headers.get("request-id"),"f"),D(this,Gl,"f").call(this,t),this._emit("connect"))}get ended(){return D(this,Ka,"f")}get errored(){return D(this,Vl,"f")}get aborted(){return D(this,Zl,"f")}abort(){this.controller.abort()}on(t,r){return(D(this,ii,"f")[t]||(D(this,ii,"f")[t]=[])).push({listener:r}),this}off(t,r){let i=D(this,ii,"f")[t];if(!i)return this;let s=i.findIndex(n=>n.listener===r);return s>=0&&i.splice(s,1),this}once(t,r){return(D(this,ii,"f")[t]||(D(this,ii,"f")[t]=[])).push({listener:r,once:!0}),this}emitted(t){return new Promise((r,i)=>{ie(this,hs,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,r)})}async done(){ie(this,hs,!0,"f"),await D(this,za,"f")}get currentMessage(){return D(this,Fi,"f")}async finalMessage(){return await this.done(),D(this,Rr,"m",Zd).call(this)}async finalText(){return await this.done(),D(this,Rr,"m",ub).call(this)}_emit(t,...r){if(D(this,Ka,"f"))return;t==="end"&&(ie(this,Ka,!0,"f"),D(this,ql,"f").call(this));let i=D(this,ii,"f")[t];if(i&&(D(this,ii,"f")[t]=i.filter(s=>!s.once),i.forEach(({listener:s})=>s(...r))),t==="abort"){let s=r[0];!D(this,hs,"f")&&!i?.length&&Promise.reject(s),D(this,Ha,"f").call(this,s),D(this,Wa,"f").call(this,s),this._emit("end");return}if(t==="error"){let s=r[0];!D(this,hs,"f")&&!i?.length&&Promise.reject(s),D(this,Ha,"f").call(this,s),D(this,Wa,"f").call(this,s),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",D(this,Rr,"m",Zd).call(this))}async _fromReadableStream(t,r){let i=r?.signal,s;i&&(i.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),i.addEventListener("abort",s));try{D(this,Rr,"m",Yd).call(this),this._connected(null);let n=As.fromReadableStream(t,this.controller);for await(let a of n)D(this,Rr,"m",Jd).call(this,a);if(n.controller.signal?.aborted)throw new Pr;D(this,Rr,"m",Qd).call(this)}finally{i&&s&&i.removeEventListener("abort",s)}}[(Fi=new WeakMap,Xs=new WeakMap,Ba=new WeakMap,Gl=new WeakMap,Ha=new WeakMap,za=new WeakMap,ql=new WeakMap,Wa=new WeakMap,ii=new WeakMap,Ka=new WeakMap,Vl=new WeakMap,Zl=new WeakMap,hs=new WeakMap,Xl=new WeakMap,Yl=new WeakMap,Ga=new WeakMap,Xd=new WeakMap,Rr=new WeakSet,Zd=function(){if(this.receivedMessages.length===0)throw new we("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},ub=function(){if(this.receivedMessages.length===0)throw new we("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(t.length===0)throw new we("stream ended without producing a content block with type=text");return t.join(" ")},Yd=function(){this.ended||ie(this,Fi,void 0,"f")},Jd=function(t){if(this.ended)return;let r=D(this,Rr,"m",db).call(this,t);switch(this._emit("streamEvent",t,r),t.type){case"content_block_delta":{let i=r.content.at(-1);switch(t.delta.type){case"text_delta":{i.type==="text"&&this._emit("text",t.delta.text,i.text||"");break}case"citations_delta":{i.type==="text"&&this._emit("citation",t.delta.citation,i.citations??[]);break}case"input_json_delta":{Vd(i)&&D(this,ii,"f").inputJson?.length&&this._emit("inputJson",t.delta.partial_json,i.input);break}case"thinking_delta":{i.type==="thinking"&&this._emit("thinking",t.delta.thinking,i.thinking);break}case"signature_delta":{i.type==="thinking"&&this._emit("signature",i.signature);break}default:t.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(cb(r,D(this,Xs,"f"),{logger:D(this,Ga,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{ie(this,Fi,r,"f");break}case"content_block_start":case"message_delta":break}},Qd=function(){if(this.ended)throw new we("stream has ended, this shouldn't happen");let t=D(this,Fi,"f");if(!t)throw new we("request ended without sending any chunks");return ie(this,Fi,void 0,"f"),cb(t,D(this,Xs,"f"),{logger:D(this,Ga,"f")})},db=function(t){let r=D(this,Fi,"f");if(t.type==="message_start"){if(r)throw new we(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!r)throw new we(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return r;case"message_delta":return r.stop_reason=t.delta.stop_reason,r.stop_sequence=t.delta.stop_sequence,t.delta.stop_details!=null&&(r.stop_details=t.delta.stop_details),r.usage.output_tokens=t.usage.output_tokens,t.usage.input_tokens!=null&&(r.usage.input_tokens=t.usage.input_tokens),t.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens),t.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens),t.usage.server_tool_use!=null&&(r.usage.server_tool_use=t.usage.server_tool_use),r;case"content_block_start":return r.content.push({...t.content_block}),r;case"content_block_delta":{let i=r.content.at(t.index);switch(t.delta.type){case"text_delta":{i?.type==="text"&&(r.content[t.index]={...i,text:(i.text||"")+t.delta.text});break}case"citations_delta":{i?.type==="text"&&(r.content[t.index]={...i,citations:[...i.citations??[],t.delta.citation]});break}case"input_json_delta":{if(i&&Vd(i)){let s=(i[wn]||"")+t.delta.partial_json;r.content[t.index]=zC(i,s)}break}case"thinking_delta":{i?.type==="thinking"&&(r.content[t.index]={...i,thinking:i.thinking+t.delta.thinking});break}case"signature_delta":{i?.type==="thinking"&&(r.content[t.index]={...i,signature:t.delta.signature});break}default:t.delta}return r}case"content_block_stop":{let i=r.content.at(t.index);return i&&Vd(i)&&wn in i&&Object.defineProperty(i,"input",{value:i.input,enumerable:!0,configurable:!0,writable:!0}),r}}},Symbol.asyncIterator)](){let t=[],r=[],i=!1;return this.on("streamEvent",s=>{let n=r.shift();n?n.resolve(s):t.push(s)}),this.on("end",()=>{i=!0;for(let s of r)s.resolve(void 0);r.length=0}),this.on("abort",s=>{i=!0;for(let n of r)n.reject(s);r.length=0}),this.on("error",s=>{i=!0;for(let n of r)n.reject(s);r.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,n)=>r.push({resolve:s,reject:n})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new As(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}}),Xh,pb=Z(()=>{Je(),He(),MC(),rl(),et(),Xh=class extends Ge{create(t,r){let{user_profile_id:i,...s}=t;return this._client.post("/v1/messages/batches",{body:s,...r,headers:V([{...i!=null?{"anthropic-user-profile-id":i}:void 0},r?.headers])})}retrieve(t,r){return this._client.get(ue`/v1/messages/batches/${t}`,r)}list(t={},r){return this._client.getAPIList("/v1/messages/batches",ra,{query:t,...r})}delete(t,r){return this._client.delete(ue`/v1/messages/batches/${t}`,r)}cancel(t,r){return this._client.post(ue`/v1/messages/batches/${t}/cancel`,r)}async results(t,r){let i=await this.retrieve(t);if(!i.results_url)throw new we(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);return this._client.get(i.results_url,{...r,headers:V([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,n)=>f_.fromResponse(n.response,n.controller))}}}),Xc,ep,hb,JC=Z(()=>{He(),Di(),KP(),XC(),pb(),pb(),$C(),Xc=class extends Ge{constructor(){super(...arguments),this.batches=new Xh(this._client)}create(t,r){let{user_profile_id:i,...s}=t;s.model in ep&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${ep[s.model]}
|
|
45
|
+
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),hb.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!s.stream&&n==null){let o=m_[s.model]??void 0;n=this._client.calculateNonstreamingTimeout(s.max_tokens,o)}let a=yC(s.tools,s.messages);return this._client.post("/v1/messages",{body:s,timeout:n??6e5,...r,headers:V([{...i!=null?{"anthropic-user-profile-id":i}:void 0},a,r?.headers]),stream:t.stream??!1})}parse(t,r){return this.create(t,r).then(i=>ZC(i,t,{logger:this._client.logger??console}))}stream(t,r){return YC.createMessage(this,t,r,{logger:this._client.logger??console})}countTokens(t,r){let{user_profile_id:i,...s}=t;return this._client.post("/v1/messages/count_tokens",{body:s,...r,headers:V([{...i!=null?{"anthropic-user-profile-id":i}:void 0},r?.headers])})}},ep={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026","claude-opus-4-1":"August 5th, 2026","claude-opus-4-1-20250805":"August 5th, 2026","claude-mythos-preview":"June 30th, 2026"},hb=["claude-mythos-preview","claude-opus-4-6"],Xc.Batches=Xh}),Yh,QC=Z(()=>{Je(),He(),et(),Yh=class extends Ge{retrieve(t,r={},i){let{betas:s}=r??{};return this._client.get(ue`/v1/models/${t}`,{...i,headers:V([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},i?.headers])})}list(t={},r){let{betas:i,...s}=t??{};return this._client.getAPIList("/v1/models",ra,{query:s,...r,headers:V([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}}}),GP=Z(()=>{GC(),qC(),JC(),QC(),yL()}),bt=class{get credentials(){return this._authState.provider}constructor({baseURL:t=qe("ANTHROPIC_BASE_URL"),apiKey:r,authToken:i,webhookKey:s=qe("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...n}={}){if(Jh.add(this),this._requestAuthFlags=new WeakMap,yc.set(this,void 0),r===void 0&&(r=n.profile!=null?null:qe("ANTHROPIC_API_KEY")??null),i===void 0&&(i=n.profile!=null?null:qe("ANTHROPIC_AUTH_TOKEN")??null),n.profile!=null&&(n.credentials!=null||n.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let a={apiKey:r,authToken:i,webhookKey:s,...n,baseURL:t||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&yI())throw new we(`It looks like you're running in a browser-like environment.
|
|
46
|
+
|
|
47
|
+
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
48
|
+
If you understand the risks and have appropriate mitigations in place,
|
|
49
|
+
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
50
|
+
|
|
51
|
+
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
52
|
+
`);this.baseURL=a.baseURL,this._baseURLIsExplicit=n.__baseURLIsExplicit??!!t,this.timeout=a.timeout??Qh.DEFAULT_TIMEOUT,this.logger=a.logger??console,this.logLevel=Pc,this.logLevel=hh(a.logLevel,"ClientOptions.logLevel",it(this))??hh(qe("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",it(this))??Pc,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??EI(),ie(this,yc,SI,"f"),this.middleware=[...a.middleware??[]];let o=qe("ANTHROPIC_CUSTOM_HEADERS");if(o){let c={};for(let u of o.split(`
|
|
53
|
+
`)){let p=u.indexOf(":");p>=0&&(c[u.substring(0,p).trim()]=u.substring(p+1).trim())}a.defaultHeaders={...c,...a.defaultHeaders}}let l=n.__auth;if(delete a.__auth,delete a.__baseURLIsExplicit,this._options=a,this.apiKey=typeof r=="string"?r:null,this.authToken=i,this.webhookKey=s,l)this._authState=l,!this._baseURLIsExplicit&&l.baseURL&&(this.baseURL=l.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let c=a.credentials??null;if(c)this._authState.provider=c,this._authState.tokenCache=this._makeTokenCache(c);else if(a.config!=null){let u=nC(a.config,this._credentialResolverOptions());this._authState.provider=u.provider,this._authState.tokenCache=this._makeTokenCache(u.provider),this._authState.extraHeaders=u.extraHeaders,this._applyCredentialBaseURL(u.baseURL)}else a.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(a.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(t){if(!t)return;let r=t.replace(/\/+$/,"");this._authState.baseURL=r,!this._baseURLIsExplicit&&(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:t=>{it(this).debug("credential cache write failed (best-effort)",t)},onSafetyWarning:t=>{it(this).warn(t)}}}_credentialsFetch(){return py(this.fetch,this.middleware,void 0,this)}_makeTokenCache(t){return new dh(t,r=>{it(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(t){let r="credentials"in t||"config"in t||"profile"in t,i="apiKey"in t||"authToken"in t||r,s={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...t,__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in t?!0:this._baseURLIsExplicit};return new this.constructor(s)}async _resolveDefaultCredentials(t){try{let r=await JI(this._credentialResolverOptions(),t);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(t!=null)throw new we(`Profile "${t}" could not be resolved (no <config_dir>/configs/${t}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:r}){if(!(t.get("x-api-key")||t.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&t.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!r.has("authorization"))throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(t){let r=this._requestAuthFlags.get(t);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(t,r)),r}async authHeaders(t){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(t).usedTokenCache=!0,V([{Authorization:`Bearer ${r}`}])}return V([await this.apiKeyAuth(t),await this.bearerAuth(t)])}}async apiKeyAuth(t){if(this.apiKey!=null)return V([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return V([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return II(t)}getUserAgent(){return`${this.constructor.name}/JS ${Vi}`}defaultIdempotencyKey(){return`stainless-node-retry-${Dc()}`}makeStatusError(t,r,i,s){return zt.generate(t,r,i,s)}buildURL(t,r,i){let s=!D(this,Jh,"m",eO).call(this)&&i||this.baseURL,n=mI(t)?new URL(t):new URL(s+(s.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),a=this.defaultQuery(),o=Object.fromEntries(n.searchParams);return(!Qv(a)||!Qv(o))&&(r={...o,...a,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(n.search=this.stringifyQuery(r)),n.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new we("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(t){}async prepareRequest(t,{url:r,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let s=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[n,a]of Object.entries(this._authState.extraHeaders))s.has(n)||s.set(n,a);s.get("anthropic-beta")?.split(",").map(n=>n.trim())?.includes(Lc)||s.append("anthropic-beta",Lc),t.headers=s}}backendMiddleware(){return[]}get(t,r){return this.methodRequest("get",t,r)}post(t,r){return this.methodRequest("post",t,r)}patch(t,r){return this.methodRequest("patch",t,r)}put(t,r){return this.methodRequest("put",t,r)}delete(t,r){return this.methodRequest("delete",t,r)}methodRequest(t,r,i){return this.request(Promise.resolve(i).then(s=>({method:t,path:r,...s})))}request(t,r=null){return new l_(this,this.makeRequest(t,r,void 0))}async makeRequest(t,r,i){let s=await t,n=s.maxRetries??this.maxRetries;r==null&&(r=n,this._requestAuthFlags.delete(s)),await this.prepareOptions(s);let{req:a,url:o,timeout:l}=await this.buildRequest(s,{retryCount:n-r}),c="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),u=i===void 0?"":`, retryOf: ${i}`,p=Date.now();if(s.signal?.aborted)throw new Pr;let h=new AbortController,f=await this.fetchWithTimeout(o,a,l,h,s,{requestLogID:c,retryOfRequestLogID:i}).catch(Ic),_=Date.now();if(f instanceof globalThis.Error){let y=`retrying, ${r} attempts remaining`;if(s.signal?.aborted)throw new Pr;let m=Rn(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):"")),g=this.middleware.length>0||!!s.middleware?.length||this.backendMiddleware().length>0;if(g&&!m&&!oL(f))throw it(this).info(`[${c}] middleware error (not retryable)`),it(this).debug(`[${c}] middleware error (not retryable)`,Hi({retryOfRequestLogID:i,url:o,durationMs:_-p,message:f.message})),f;if(r)return it(this).info(`[${c}] connection ${m?"timed out":"failed"} - ${y}`),it(this).debug(`[${c}] connection ${m?"timed out":"failed"} (${y})`,Hi({retryOfRequestLogID:i,url:o,durationMs:_-p,message:f.message})),this.retryRequest(s,r,i??c);throw it(this).info(`[${c}] connection ${m?"timed out":"failed"} - error; no more retries left`),it(this).debug(`[${c}] connection ${m?"timed out":"failed"} (error; no more retries left)`,Hi({retryOfRequestLogID:i,url:o,durationMs:_-p,message:f.message})),m?new Jg:g&&!lC(f)?f:new yn({cause:f})}let v=[...f.headers.entries()].filter(([y])=>y==="request-id").map(([y,m])=>", "+y+": "+JSON.stringify(m)).join(""),E=`[${c}${u}${v}] ${a.method} ${o} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${_-p}ms`;if(!f.ok){let y=await this.shouldRetry(f,s);if(r&&y){let A=`retrying, ${r} attempts remaining`;return await wI(f.body),it(this).info(`${E} - ${A}`),it(this).debug(`[${c}] response error (${A})`,Hi({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:_-p})),this.retryRequest(s,r,i??c,f.headers)}let m=y?"error; no more retries left":"error; not retryable";it(this).info(`${E} - ${m}`);let g=await f.text().catch(A=>Ic(A).message),b=US(g),C=b?void 0:g;throw it(this).debug(`[${c}] response error (${m})`,Hi({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,message:C,durationMs:Date.now()-p})),this.makeStatusError(f.status,b,C,f.headers)}return it(this).info(E),it(this).debug(`[${c}] response start`,Hi({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:_-p})),{response:f,options:s,controller:h,requestLogID:c,retryOfRequestLogID:i,startTime:p}}getAPIList(t,r,i){return this.requestAPIList(r,i&&"then"in i?i.then(s=>({method:"get",path:t,...s})):{method:"get",path:t,...i})}requestAPIList(t,r){let i=this.makeRequest(r,null,void 0);return new uC(this,i,t)}async fetchWithTimeout(t,r,i,s,n,a){let{signal:o,method:l,...c}=r||{},u=this._makeAbort(s);o&&o.addEventListener("abort",u,{once:!0});let p=globalThis.ReadableStream&&c.body instanceof globalThis.ReadableStream||typeof c.body=="object"&&c.body!==null&&Symbol.asyncIterator in c.body,h={signal:s.signal,...p?{duplex:"half"}:{},method:"GET",...c};l&&(h.method=l.toUpperCase());let f=this.fetch,_=async(g,b)=>{let C=setTimeout(u,i);try{return await f.call(void 0,g,b)}finally{clearTimeout(C)}},v=n===void 0?_:async(g,b={})=>{let C=typeof g=="string"?g:g instanceof URL?g.href:g.url;return b.headers=b.headers instanceof Headers?b.headers:new Headers(b.headers),await this.prepareRequest(b,{url:C,options:n}),a&&it(this).debug(`[${a.requestLogID}] sending request`,Hi({retryOfRequestLogID:a.retryOfRequestLogID,method:b.method,url:C,options:n,headers:b.headers})),_(g,b)},E=n?.middleware,y=this.backendMiddleware(),m=E?.length||y.length?[...this.middleware,...E??[],...y]:this.middleware;return await py(v,m,n,this)(t,h)}async shouldRetry(t,r){let i=this._authFlags(r);if(t.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let s=t.headers.get("x-should-retry");return s==="true"?!0:s==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,r,i,s){let n,a=s?.get("retry-after-ms");if(a){let l=parseFloat(a);Number.isNaN(l)||(n=l)}let o=s?.get("retry-after");if(o&&!n){let l=parseFloat(o);Number.isNaN(l)?n=Date.parse(o)-Date.now():n=l*1e3}if(n===void 0){let l=t.maxRetries??this.maxRetries;n=this.calculateDefaultRetryTimeoutMillis(r,l)}return await ws(n),this.makeRequest(t,r-1,i)}calculateDefaultRetryTimeoutMillis(t,r){let i=r-t,s=Math.min(.5*Math.pow(2,i),8),n=1-Math.random()*.25;return s*n*1e3}calculateNonstreamingTimeout(t,r){if(36e5*t/128e3>6e5||r!=null&&t>r)throw new we("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(t,{retryCount:r=0}={}){let i={...t},{method:s,path:n,query:a,defaultBaseURL:o}=i;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let l=this.buildURL(n,a,o);"timeout"in i&&gI("timeout",i.timeout),i.timeout=i.timeout??this.timeout;let{bodyHeaders:c,body:u}=this.buildBody({options:i}),p=await this.buildHeaders({options:t,method:s,bodyHeaders:c,retryCount:r});return{req:{method:s,headers:p,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...i.fetchOptions??{}},url:l,timeout:i.timeout}}async buildHeaders({options:t,method:r,bodyHeaders:i,retryCount:s}){let n={};this.idempotencyHeader&&r!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),n[this.idempotencyHeader]=t.idempotencyKey);let a=V([n,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...Qg(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,i,t.headers]);return this.validateHeaders(a),a.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:r}}){if(!t)return{bodyHeaders:void 0,body:void 0};let i=V([r]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&i.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:jS(t)}:typeof t=="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:D(this,yc,"f").call(this,{body:t,headers:i})}},Jh,Qh,yc,eO,qP="\\n\\nHuman:",VP="\\n\\nAssistant:",qa,fb=Z(()=>{Cr(),oi(),lh(),KS(),dt(),el(),jI(),rL(),uL(),Je(),mC(),GP(),c_(),qC(),QC(),GC(),JC(),lh(),He(),Ri(),oi(),Qh=bt,yc=new WeakMap,Jh=new WeakSet,eO=function(){return this.baseURL!=="https://api.anthropic.com"},bt.Anthropic=Qh,bt.HUMAN_PROMPT=qP,bt.AI_PROMPT=VP,bt.DEFAULT_TIMEOUT=6e5,bt.AnthropicError=we,bt.APIError=zt,bt.APIConnectionError=yn,bt.APIConnectionTimeoutError=Jg,bt.APIUserAbortError=Pr,bt.NotFoundError=th,bt.ConflictError=rh,bt.RateLimitError=sh,bt.BadRequestError=Jp,bt.AuthenticationError=Qp,bt.InternalServerError=nh,bt.PermissionDeniedError=eh,bt.UnprocessableEntityError=ih,bt.toFile=fL,qa=class extends bt{constructor(){super(...arguments),this.completions=new qh(this),this.messages=new Xc(this),this.models=new Yh(this),this.beta=new Dt(this)}},qa.Completions=qh,qa.Messages=Xc,qa.Models=Yh,qa.Beta=Dt}),ZP=Z(()=>{dt(),Lu(),He(),Di(),oi()}),tO=Z(()=>{fb(),mC(),c_(),ZP(),fb(),Je(),dt()});function rO(e,t){return function(){return e.apply(t,arguments)}}function il(e){return e!==null&&!ks(e)&&e.constructor!==null&&!ks(e.constructor)&&er(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}function XP(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&tf(e.buffer),t}function YP(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}function sl(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,s;if(typeof e!="object"&&(e=[e]),xs(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{if(il(e))return;let n=r?Object.getOwnPropertyNames(e):Object.keys(e),a=n.length,o;for(i=0;i<a;i++)o=n[i],t.call(null,e[o],o,e)}}function iO(e,t){if(il(e))return null;t=t.toLowerCase();let r=Object.keys(e),i=r.length,s;for(;i-- >0;)if(s=r[i],t===s.toLowerCase())return s;return null}function ef(){let{caseless:e,skipUndefined:t}=sO(this)&&this||{},r={},i=(s,n)=>{if(n==="__proto__"||n==="constructor"||n==="prototype")return;let a=e&&iO(r,n)||n;bc(r[a])&&bc(s)?r[a]=ef(r[a],s):bc(s)?r[a]=ef({},s):xs(s)?r[a]=s.slice():(!t||!ks(s))&&(r[a]=s)};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&sl(arguments[s],i);return r}function JP(e){return!!(e&&er(e.append)&&e[g_]==="FormData"&&e[nl])}var mb,Do,nl,g_,Io,Kr=e=>(e=e.toLowerCase(),t=>Io(t)===e),Jl=e=>t=>typeof t===e,xs,ks,tf,gb,er,rf,al=e=>e!==null&&typeof e=="object",QP=e=>e===!0||e===!1,bc=e=>{if(Io(e)!=="object")return!1;let t=Do(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(g_ in e)&&!(nl in e)},e1=e=>{if(!al(e)||il(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},_b,vb,t1=e=>!!(e&&typeof e.uri<"u"),r1=e=>e&&typeof e.getParts<"u",yb,bb,i1=e=>al(e)&&er(e.pipe),tp,sf,s1=e=>{if(!e)return!1;if(sf&&e instanceof sf)return!0;let t=Do(e);if(!t||t===Object.prototype||!er(e.append))return!1;let r=Io(e);return r==="formdata"||r==="object"&&er(e.toString)&&e.toString()==="[object FormData]"},Eb,wb,Sb,Cb,Ob,n1=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),Wi,sO=e=>!ks(e)&&e!==Wi,a1=(e,t,r,{allOwnKeys:i}={})=>(sl(t,(s,n)=>{r&&er(s)?Object.defineProperty(e,n,{value:rO(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),o1=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),l1=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},c1=(e,t,r,i)=>{let s,n,a,o={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),n=s.length;n-- >0;)a=s[n],(!i||i(a,e,t))&&!o[a]&&(t[a]=e[a],o[a]=!0);e=r!==!1&&Do(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},u1=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},d1=e=>{if(!e)return null;if(xs(e))return e;let t=e.length;if(!rf(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},Ab,p1=(e,t)=>{let r=(e&&e[nl]).call(e),i;for(;(i=r.next())&&!i.done;){let s=i.value;t.call(e,s[0],s[1])}},h1=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},xb,f1=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,i){return r.toUpperCase()+i}),rp,kb,nO=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};sl(r,(s,n)=>{let a;(a=t(s,n,e))!==!1&&(i[n]=a||s)}),Object.defineProperties(e,i)},m1=e=>{nO(e,(t,r)=>{if(er(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(er(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},g1=(e,t)=>{let r={},i=s=>{s.forEach(n=>{r[n]=!0})};return xs(e)?i(e):i(String(e).split(t)),r},_1=()=>{},v1=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,y1=e=>{let t=[,,,,,,,,,,],r=(i,s)=>{if(al(i)){if(t.indexOf(i)>=0)return;if(il(i))return i;if(!("toJSON"in i)){t[s]=i;let n=xs(i)?[]:{};return sl(i,(a,o)=>{let l=r(a,s+1);!ks(l)&&(n[o]=l)}),t[s]=void 0,n}}return i};return r(e,0)},Tb,b1=e=>e&&(al(e)||er(e))&&er(e.then)&&er(e.catch),ip,Rb,E1=e=>e!=null&&er(e[nl]),H,ut=Z(()=>{({toString:mb}=Object.prototype),{getPrototypeOf:Do}=Object,{iterator:nl,toStringTag:g_}=Symbol,Io=(e=>t=>{let r=mb.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),{isArray:xs}=Array,ks=Jl("undefined"),tf=Kr("ArrayBuffer"),gb=Jl("string"),er=Jl("function"),rf=Jl("number"),_b=Kr("Date"),vb=Kr("File"),yb=Kr("Blob"),bb=Kr("FileList"),tp=YP(),sf=typeof tp.FormData<"u"?tp.FormData:void 0,Eb=Kr("URLSearchParams"),[wb,Sb,Cb,Ob]=["ReadableStream","Request","Response","Headers"].map(Kr),Wi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ab=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Do(Uint8Array)),xb=Kr("HTMLFormElement"),rp=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),kb=Kr("RegExp"),Tb=Kr("AsyncFunction"),ip=((e,t)=>e?setImmediate:t?((r,i)=>(Wi.addEventListener("message",({source:s,data:n})=>{s===Wi&&n===r&&i.length&&i.shift()()},!1),s=>{i.push(s),Wi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",er(Wi.postMessage)),Rb=typeof queueMicrotask<"u"?queueMicrotask.bind(Wi):typeof process<"u"&&process.nextTick||ip,H={isArray:xs,isArrayBuffer:tf,isBuffer:il,isFormData:s1,isArrayBufferView:XP,isString:gb,isNumber:rf,isBoolean:QP,isObject:al,isPlainObject:bc,isEmptyObject:e1,isReadableStream:wb,isRequest:Sb,isResponse:Cb,isHeaders:Ob,isUndefined:ks,isDate:_b,isFile:vb,isReactNativeBlob:t1,isReactNative:r1,isBlob:yb,isRegExp:kb,isFunction:er,isStream:i1,isURLSearchParams:Eb,isTypedArray:Ab,isFileList:bb,forEach:sl,merge:ef,extend:a1,trim:n1,stripBOM:o1,inherits:l1,toFlatObject:c1,kindOf:Io,kindOfTest:Kr,endsWith:u1,toArray:d1,forEachEntry:p1,matchAll:h1,isHTMLForm:xb,hasOwnProperty:rp,hasOwnProp:rp,reduceDescriptors:nO,freezeMethods:m1,toObjectSet:g1,toCamelCase:f1,noop:_1,toFiniteNumber:v1,findKey:iO,global:Wi,isContextDefined:sO,isSpecCompliantForm:JP,toJSONObject:y1,isAsyncFn:Tb,isThenable:b1,setImmediate:ip,asap:Rb,isIterable:E1}}),qt,ge,Fr=Z(()=>{ut(),qt=class aO extends Error{static from(t,r,i,s,n,a){let o=new aO(t.message,r||t.code,i,s,n);return o.cause=t,o.name=t.name,t.status!=null&&o.status==null&&(o.status=t.status),a&&Object.assign(o,a),o}constructor(t,r,i,s,n){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),i&&(this.config=i),s&&(this.request=s),n&&(this.response=n,this.status=n.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H.toJSONObject(this.config),code:this.code,status:this.status}}},qt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",qt.ERR_BAD_OPTION="ERR_BAD_OPTION",qt.ECONNABORTED="ECONNABORTED",qt.ETIMEDOUT="ETIMEDOUT",qt.ERR_NETWORK="ERR_NETWORK",qt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",qt.ERR_DEPRECATED="ERR_DEPRECATED",qt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",qt.ERR_BAD_REQUEST="ERR_BAD_REQUEST",qt.ERR_CANCELED="ERR_CANCELED",qt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",qt.ERR_INVALID_URL="ERR_INVALID_URL",qt.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED",ge=qt}),w1=j(function(e,t){var r=Me("stream").Stream,i=Me("util");t.exports=s;function s(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i.inherits(s,r),s.create=function(n,a){var o=new this;a=a||{};for(var l in a)o[l]=a[l];o.source=n;var c=n.emit;return n.emit=function(){return o._handleEmit(arguments),c.apply(n,arguments)},n.on("error",function(){}),o.pauseStream&&n.pause(),o},Object.defineProperty(s.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),s.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},s.prototype.resume=function(){this._released||this.release(),this.source.resume()},s.prototype.pause=function(){this.source.pause()},s.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(n){this.emit.apply(this,n)}.bind(this)),this._bufferedEvents=[]},s.prototype.pipe=function(){var n=r.prototype.pipe.apply(this,arguments);return this.resume(),n},s.prototype._handleEmit=function(n){if(this._released){this.emit.apply(this,n);return}n[0]==="data"&&(this.dataSize+=n[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(n)},s.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",Error(n))}}}),S1=j(function(e,t){var r=Me("util"),i=Me("stream").Stream,s=w1();t.exports=n;function n(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}r.inherits(n,i),n.create=function(a){var o=new this;a=a||{};for(var l in a)o[l]=a[l];return o},n.isStreamLike=function(a){return typeof a!="function"&&typeof a!="string"&&typeof a!="boolean"&&typeof a!="number"&&!Buffer.isBuffer(a)},n.prototype.append=function(a){var o=n.isStreamLike(a);if(o){if(!(a instanceof s)){var l=s.create(a,{maxDataSize:1/0,pauseStream:this.pauseStreams});a.on("data",this._checkDataSize.bind(this)),a=l}this._handleErrors(a),this.pauseStreams&&a.pause()}return this._streams.push(a),this},n.prototype.pipe=function(a,o){return i.prototype.pipe.call(this,a,o),this.resume(),a},n.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}},n.prototype._realGetNext=function(){var a=this._streams.shift();if(typeof a>"u"){this.end();return}if(typeof a!="function"){this._pipeNext(a);return}var o=a;o(function(l){var c=n.isStreamLike(l);c&&(l.on("data",this._checkDataSize.bind(this)),this._handleErrors(l)),this._pipeNext(l)}.bind(this))},n.prototype._pipeNext=function(a){this._currentStream=a;var o=n.isStreamLike(a);if(o){a.on("end",this._getNext.bind(this)),a.pipe(this,{end:!1});return}var l=a;this.write(l),this._getNext()},n.prototype._handleErrors=function(a){var o=this;a.on("error",function(l){o._emitError(l)})},n.prototype.write=function(a){this.emit("data",a)},n.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))},n.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")},n.prototype.end=function(){this._reset(),this.emit("end")},n.prototype.destroy=function(){this._reset(),this.emit("close")},n.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},n.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var a="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(Error(a))}},n.prototype._updateDataSize=function(){this.dataSize=0;var a=this;this._streams.forEach(function(o){o.dataSize&&(a.dataSize+=o.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},n.prototype._emitError=function(a){this._reset(),this.emit("error",a)}}),C1=j(function(e,t){t.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}}),O1=j(function(e){var t=C1(),r=Me("path").extname,i=/^\s*([^;\s]*)(?:;|\s|$)/,s=/^text\//i;e.charset=n,e.charsets={lookup:n},e.contentType=a,e.extension=o,e.extensions=Object.create(null),e.lookup=l,e.types=Object.create(null),c(e.extensions,e.types);function n(u){if(!u||typeof u!="string")return!1;var p=i.exec(u),h=p&&t[p[1].toLowerCase()];return h&&h.charset?h.charset:p&&s.test(p[1])?"UTF-8":!1}function a(u){if(!u||typeof u!="string")return!1;var p=u.indexOf("/")===-1?e.lookup(u):u;if(!p)return!1;if(p.indexOf("charset")===-1){var h=e.charset(p);h&&(p+="; charset="+h.toLowerCase())}return p}function o(u){if(!u||typeof u!="string")return!1;var p=i.exec(u),h=p&&e.extensions[p[1].toLowerCase()];return!h||!h.length?!1:h[0]}function l(u){if(!u||typeof u!="string")return!1;var p=r("x."+u).toLowerCase().substr(1);return p&&e.types[p]||!1}function c(u,p){var h=["nginx","apache",void 0,"iana"];Object.keys(t).forEach(function(f){var _=t[f],v=_.extensions;if(!(!v||!v.length)){u[f]=v;for(var E=0;E<v.length;E++){var y=v[E];if(p[y]){var m=h.indexOf(t[p[y]].source),g=h.indexOf(_.source);if(p[y]!=="application/octet-stream"&&(m>g||m===g&&p[y].substr(0,12)==="application/"))continue}p[y]=f}}})}}),A1=j(function(e,t){t.exports=r;function r(i){var s=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;s?s(i):setTimeout(i,0)}}),oO=j(function(e,t){var r=A1();t.exports=i;function i(s){var n=!1;return r(function(){n=!0}),function(a,o){n?s(a,o):r(function(){s(a,o)})}}}),lO=j(function(e,t){t.exports=r;function r(s){Object.keys(s.jobs).forEach(i.bind(s)),s.jobs={}}function i(s){typeof this.jobs[s]=="function"&&this.jobs[s]()}}),cO=j(function(e,t){var r=oO(),i=lO();t.exports=s;function s(a,o,l,c){var u=l.keyedList?l.keyedList[l.index]:l.index;l.jobs[u]=n(o,u,a[u],function(p,h){u in l.jobs&&(delete l.jobs[u],p?i(l):l.results[u]=h,c(p,l.results))})}function n(a,o,l,c){var u;return a.length==2?u=a(l,r(c)):u=a(l,o,r(c)),u}}),uO=j(function(e,t){t.exports=r;function r(i,s){var n=!Array.isArray(i),a={index:0,keyedList:n||s?Object.keys(i):null,jobs:{},results:n?{}:[],size:n?Object.keys(i).length:i.length};return s&&a.keyedList.sort(n?s:function(o,l){return s(i[o],i[l])}),a}}),dO=j(function(e,t){var r=lO(),i=oO();t.exports=s;function s(n){Object.keys(this.jobs).length&&(this.index=this.size,r(this),i(n)(null,this.results))}}),x1=j(function(e,t){var r=cO(),i=uO(),s=dO();t.exports=n;function n(a,o,l){for(var c=i(a);c.index<(c.keyedList||a).length;)r(a,o,c,function(u,p){if(u){l(u,p);return}if(Object.keys(c.jobs).length===0){l(null,c.results);return}}),c.index++;return s.bind(c,l)}}),pO=j(function(e,t){var r=cO(),i=uO(),s=dO();t.exports=n,t.exports.ascending=a,t.exports.descending=o;function n(l,c,u,p){var h=i(l,u);return r(l,c,h,function f(_,v){if(_){p(_,v);return}if(h.index++,h.index<(h.keyedList||l).length){r(l,c,h,f);return}p(null,h.results)}),s.bind(h,p)}function a(l,c){return l<c?-1:l>c?1:0}function o(l,c){return-1*a(l,c)}}),k1=j(function(e,t){var r=pO();t.exports=i;function i(s,n,a){return r(s,n,null,a)}}),T1=j(function(e,t){t.exports={parallel:x1(),serial:k1(),serialOrdered:pO()}}),hO=j(function(e,t){t.exports=Object}),R1=j(function(e,t){t.exports=Error}),D1=j(function(e,t){t.exports=EvalError}),I1=j(function(e,t){t.exports=RangeError}),L1=j(function(e,t){t.exports=ReferenceError}),P1=j(function(e,t){t.exports=SyntaxError}),__=j(function(e,t){t.exports=TypeError}),N1=j(function(e,t){t.exports=URIError}),M1=j(function(e,t){t.exports=Math.abs}),U1=j(function(e,t){t.exports=Math.floor}),$1=j(function(e,t){t.exports=Math.max}),j1=j(function(e,t){t.exports=Math.min}),F1=j(function(e,t){t.exports=Math.pow}),B1=j(function(e,t){t.exports=Math.round}),H1=j(function(e,t){t.exports=Number.isNaN||function(r){return r!==r}}),z1=j(function(e,t){var r=H1();t.exports=function(i){return r(i)||i===0?i:i<0?-1:1}}),W1=j(function(e,t){t.exports=Object.getOwnPropertyDescriptor}),fO=j(function(e,t){var r=W1();if(r)try{r([],"length")}catch{r=null}t.exports=r}),K1=j(function(e,t){var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}t.exports=r}),mO=j(function(e,t){t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},i=Symbol("test"),s=Object(i);if(typeof i=="string"||Object.prototype.toString.call(i)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var n=42;r[i]=n;for(var a in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var o=Object.getOwnPropertySymbols(r);if(o.length!==1||o[0]!==i||!Object.prototype.propertyIsEnumerable.call(r,i))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(r,i);if(l.value!==n||l.enumerable!==!0)return!1}return!0}}),G1=j(function(e,t){var r=typeof Symbol<"u"&&Symbol,i=mO();t.exports=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()}}),gO=j(function(e,t){t.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),_O=j(function(e,t){var r=hO();t.exports=r.getPrototypeOf||null}),q1=j(function(e,t){var r="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,s=Math.max,n="[object Function]",a=function(c,u){for(var p=[],h=0;h<c.length;h+=1)p[h]=c[h];for(var f=0;f<u.length;f+=1)p[f+c.length]=u[f];return p},o=function(c,u){for(var p=[],h=u||0,f=0;h<c.length;h+=1,f+=1)p[f]=c[h];return p},l=function(c,u){for(var p="",h=0;h<c.length;h+=1)p+=c[h],h+1<c.length&&(p+=u);return p};t.exports=function(c){var u=this;if(typeof u!="function"||i.apply(u)!==n)throw TypeError(r+u);for(var p=o(arguments,1),h,f=function(){if(this instanceof h){var m=u.apply(this,a(p,arguments));return Object(m)===m?m:this}return u.apply(c,a(p,arguments))},_=s(0,u.length-p.length),v=[],E=0;E<_;E++)v[E]="$"+E;if(h=Function("binder","return function ("+l(v,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var y=function(){};y.prototype=u.prototype,h.prototype=new y,y.prototype=null}return h}}),sa=j(function(e,t){var r=q1();t.exports=Function.prototype.bind||r}),v_=j(function(e,t){t.exports=Function.prototype.call}),vO=j(function(e,t){t.exports=Function.prototype.apply}),V1=j(function(e,t){t.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),Z1=j(function(e,t){var r=sa(),i=vO(),s=v_(),n=V1();t.exports=n||r.call(s,i)}),X1=j(function(e,t){var r=sa(),i=__(),s=v_(),n=Z1();t.exports=function(a){if(a.length<1||typeof a[0]!="function")throw new i("a function is required");return n(r,s,a)}}),Y1=j(function(e,t){var r=X1(),i=fO(),s;try{s=[].__proto__===Array.prototype}catch(l){if(!l||typeof l!="object"||!("code"in l)||l.code!=="ERR_PROTO_ACCESS")throw l}var n=!!s&&i&&i(Object.prototype,"__proto__"),a=Object,o=a.getPrototypeOf;t.exports=n&&typeof n.get=="function"?r([n.get]):typeof o=="function"?function(l){return o(l==null?l:a(l))}:!1}),J1=j(function(e,t){var r=gO(),i=_O(),s=Y1();t.exports=r?function(n){return r(n)}:i?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw TypeError("getProto: not an object");return i(n)}:s?function(n){return s(n)}:null}),Q1=j(function(e,t){var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,s=sa();t.exports=s.call(r,i)}),eN=j(function(e,t){var r,i=hO(),s=R1(),n=D1(),a=I1(),o=L1(),l=P1(),c=__(),u=N1(),p=M1(),h=U1(),f=$1(),_=j1(),v=F1(),E=B1(),y=z1(),m=Function,g=function(_e){try{return m('"use strict"; return ('+_e+").constructor;")()}catch{}},b=fO(),C=K1(),A=function(){throw new c},w=b?(function(){try{return arguments.callee,A}catch{try{return b(arguments,"callee").get}catch{return A}}})():A,S=G1()(),x=J1(),T=_O(),I=gO(),L=vO(),P=v_(),$={},se=typeof Uint8Array>"u"||!x?r:x(Uint8Array),ee={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":S&&x?x([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":$,"%AsyncGenerator%":$,"%AsyncGeneratorFunction%":$,"%AsyncIteratorPrototype%":$,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":$,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&x?x(x([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!x?r:x(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":a,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!x?r:x(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&x?x(""[Symbol.iterator]()):r,"%Symbol%":S?Symbol:r,"%SyntaxError%":l,"%ThrowTypeError%":w,"%TypedArray%":se,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":L,"%Object.defineProperty%":C,"%Object.getPrototypeOf%":T,"%Math.abs%":p,"%Math.floor%":h,"%Math.max%":f,"%Math.min%":_,"%Math.pow%":v,"%Math.round%":E,"%Math.sign%":y,"%Reflect.getPrototypeOf%":I};if(x)try{null.error}catch(_e){pe=x(x(_e)),ee["%Error.prototype%"]=pe}var pe,ne=function _e(F){var z;if(F==="%AsyncFunction%")z=g("async function () {}");else if(F==="%GeneratorFunction%")z=g("function* () {}");else if(F==="%AsyncGeneratorFunction%")z=g("async function* () {}");else if(F==="%AsyncGenerator%"){var Q=_e("%AsyncGeneratorFunction%");Q&&(z=Q.prototype)}else if(F==="%AsyncIteratorPrototype%"){var ce=_e("%AsyncGenerator%");ce&&x&&(z=x(ce.prototype))}return ee[F]=z,z},oe={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},W=sa(),k=Q1(),U=W.call(P,Array.prototype.concat),N=W.call(L,Array.prototype.splice),R=W.call(P,String.prototype.replace),M=W.call(P,String.prototype.slice),K=W.call(P,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ae=/\\(\\)?/g,xe=function(_e){var F=M(_e,0,1),z=M(_e,-1);if(F==="%"&&z!=="%")throw new l("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&F!=="%")throw new l("invalid intrinsic syntax, expected opening `%`");var Q=[];return R(_e,J,function(ce,Se,Te,Qe){Q[Q.length]=Te?R(Qe,ae,"$1"):Se||ce}),Q},be=function(_e,F){var z=_e,Q;if(k(oe,z)&&(Q=oe[z],z="%"+Q[0]+"%"),k(ee,z)){var ce=ee[z];if(ce===$&&(ce=ne(z)),typeof ce>"u"&&!F)throw new c("intrinsic "+_e+" exists, but is not available. Please file an issue!");return{alias:Q,name:z,value:ce}}throw new l("intrinsic "+_e+" does not exist!")};t.exports=function(_e,F){if(typeof _e!="string"||_e.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof F!="boolean")throw new c('"allowMissing" argument must be a boolean');if(K(/^%?[^%]*%?$/,_e)===null)throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=xe(_e),Q=z.length>0?z[0]:"",ce=be("%"+Q+"%",F),{name:Se,value:Te}=ce,Qe=!1,q=ce.alias;q&&(Q=q[0],N(z,U([0,1],q)));for(var te=1,he=!0;te<z.length;te+=1){var ve=z[te],fe=M(ve,0,1),De=M(ve,-1);if((fe==='"'||fe==="'"||fe==="`"||De==='"'||De==="'"||De==="`")&&fe!==De)throw new l("property names with quotes must have matching quotes");if((ve==="constructor"||!he)&&(Qe=!0),Q+="."+ve,Se="%"+Q+"%",k(ee,Se))Te=ee[Se];else if(Te!=null){if(!(ve in Te)){if(!F)throw new c("base intrinsic for "+_e+" exists, but the property is not available.");return}if(b&&te+1>=z.length){var Ct=b(Te,ve);he=!!Ct,he&&"get"in Ct&&!("originalValue"in Ct.get)?Te=Ct.get:Te=Te[ve]}else he=k(Te,ve),Te=Te[ve];he&&!Qe&&(ee[Se]=Te)}}return Te}}),tN=j(function(e,t){var r=mO();t.exports=function(){return r()&&!!Symbol.toStringTag}}),rN=j(function(e,t){var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,s=sa();t.exports=s.call(r,i)}),iN=j(function(e,t){var r=eN(),i=r("%Object.defineProperty%",!0),s=tN()(),n=rN(),a=__(),o=s?Symbol.toStringTag:null;t.exports=function(l,c){var u=arguments.length>2&&!!arguments[2]&&arguments[2].force,p=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof u<"u"&&typeof u!="boolean"||typeof p<"u"&&typeof p!="boolean")throw new a("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");o&&(u||!n(l,o))&&(i?i(l,o,{configurable:!p,enumerable:!1,value:c,writable:!1}):l[o]=c)}}),sN=j(function(e,t){var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,s=sa();t.exports=s.call(r,i)}),nN=j(function(e,t){t.exports=function(r,i){return Object.keys(i).forEach(function(s){r[s]=r[s]||i[s]}),r}}),aN=j(function(e,t){var r=S1(),i=Me("util"),s=Me("path"),n=Me("http"),a=Me("https"),o=Me("url").parse,l=Me("fs"),c=Me("stream").Stream,u=Me("crypto"),p=O1(),h=T1(),f=iN(),_=sN(),v=nN();function E(m){return String(m).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function y(m){if(!(this instanceof y))return new y(m);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],r.call(this),m=m||{};for(var g in m)this[g]=m[g]}i.inherits(y,r),y.LINE_BREAK=`\r
|
|
54
|
+
`,y.DEFAULT_CONTENT_TYPE="application/octet-stream",y.prototype.append=function(m,g,b){b=b||{},typeof b=="string"&&(b={filename:b});var C=r.prototype.append.bind(this);if((typeof g=="number"||g==null)&&(g=String(g)),Array.isArray(g)){this._error(Error("Arrays are not supported."));return}var A=this._multiPartHeader(m,g,b),w=this._multiPartFooter();C(A),C(g),C(w),this._trackLength(A,g,b)},y.prototype._trackLength=function(m,g,b){var C=0;b.knownLength!=null?C+=Number(b.knownLength):Buffer.isBuffer(g)?C=g.length:typeof g=="string"&&(C=Buffer.byteLength(g)),this._valueLength+=C,this._overheadLength+=Buffer.byteLength(m)+y.LINE_BREAK.length,!(!g||!g.path&&!(g.readable&&_(g,"httpVersion"))&&!(g instanceof c))&&(b.knownLength||this._valuesToMeasure.push(g))},y.prototype._lengthRetriever=function(m,g){_(m,"fd")?m.end!=null&&m.end!=1/0&&m.start!=null?g(null,m.end+1-(m.start?m.start:0)):l.stat(m.path,function(b,C){if(b){g(b);return}var A=C.size-(m.start?m.start:0);g(null,A)}):_(m,"httpVersion")?g(null,Number(m.headers["content-length"])):_(m,"httpModule")?(m.on("response",function(b){m.pause(),g(null,Number(b.headers["content-length"]))}),m.resume()):g("Unknown stream")},y.prototype._multiPartHeader=function(m,g,b){if(typeof b.header=="string")return b.header;var C=this._getContentDisposition(g,b),A=this._getContentType(g,b),w="",S={"Content-Disposition":["form-data",'name="'+E(m)+'"'].concat(C||[]),"Content-Type":[].concat(A||[])};typeof b.header=="object"&&v(S,b.header);var x;for(var T in S)if(_(S,T)){if(x=S[T],x==null)continue;Array.isArray(x)||(x=[x]),x.length&&(w+=T+": "+x.join("; ")+y.LINE_BREAK)}return"--"+this.getBoundary()+y.LINE_BREAK+w+y.LINE_BREAK},y.prototype._getContentDisposition=function(m,g){var b;if(typeof g.filepath=="string"?b=s.normalize(g.filepath).replace(/\\/g,"/"):g.filename||m&&(m.name||m.path)?b=s.basename(g.filename||m&&(m.name||m.path)):m&&m.readable&&_(m,"httpVersion")&&(b=s.basename(m.client._httpMessage.path||"")),b)return'filename="'+E(b)+'"'},y.prototype._getContentType=function(m,g){var b=g.contentType;return!b&&m&&m.name&&(b=p.lookup(m.name)),!b&&m&&m.path&&(b=p.lookup(m.path)),!b&&m&&m.readable&&_(m,"httpVersion")&&(b=m.headers["content-type"]),!b&&(g.filepath||g.filename)&&(b=p.lookup(g.filepath||g.filename)),!b&&m&&typeof m=="object"&&(b=y.DEFAULT_CONTENT_TYPE),b},y.prototype._multiPartFooter=function(){return function(m){var g=y.LINE_BREAK,b=this._streams.length===0;b&&(g+=this._lastBoundary()),m(g)}.bind(this)},y.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+y.LINE_BREAK},y.prototype.getHeaders=function(m){var g,b={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(g in m)_(m,g)&&(b[g.toLowerCase()]=m[g]);return b},y.prototype.setBoundary=function(m){if(typeof m!="string")throw TypeError("FormData boundary must be a string");this._boundary=m},y.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},y.prototype.getBuffer=function(){for(var m=new Buffer.alloc(0),g=this.getBoundary(),b=0,C=this._streams.length;b<C;b++)typeof this._streams[b]!="function"&&(Buffer.isBuffer(this._streams[b])?m=Buffer.concat([m,this._streams[b]]):m=Buffer.concat([m,Buffer.from(this._streams[b])]),(typeof this._streams[b]!="string"||this._streams[b].substring(2,g.length+2)!==g)&&(m=Buffer.concat([m,Buffer.from(y.LINE_BREAK)])));return Buffer.concat([m,Buffer.from(this._lastBoundary())])},y.prototype._generateBoundary=function(){this._boundary="--------------------------"+u.randomBytes(12).toString("hex")},y.prototype.getLengthSync=function(){var m=this._overheadLength+this._valueLength;return this._streams.length&&(m+=this._lastBoundary().length),this.hasKnownLength()||this._error(Error("Cannot calculate proper length in synchronous way.")),m},y.prototype.hasKnownLength=function(){var m=!0;return this._valuesToMeasure.length&&(m=!1),m},y.prototype.getLength=function(m){var g=this._overheadLength+this._valueLength;if(this._streams.length&&(g+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(m.bind(this,null,g));return}h.parallel(this._valuesToMeasure,this._lengthRetriever,function(b,C){if(b){m(b);return}C.forEach(function(A){g+=A}),m(null,g)})},y.prototype.submit=function(m,g){var b,C,A={method:"post"};return typeof m=="string"?(m=o(m),C=v({port:m.port,path:m.pathname,host:m.hostname,protocol:m.protocol},A)):(C=v(m,A),!C.port&&(C.port=C.protocol==="https:"?443:80)),C.headers=this.getHeaders(m.headers),C.protocol==="https:"?b=a.request(C):b=n.request(C),this.getLength(function(w,S){if(w&&w!=="Unknown stream"){this._error(w);return}if(S&&b.setHeader("Content-Length",S),this.pipe(b),g){var x,T=function(I,L){return b.removeListener("error",T),b.removeListener("response",x),g.call(this,I,L)};x=T.bind(this,null),b.on("error",T),b.on("response",x)}}.bind(this)),b},y.prototype._error=function(m){this.error||(this.error=m,this.pause(),this.emit("error",m))},y.prototype.toString=function(){return"[object FormData]"},f(y.prototype,"FormData"),t.exports=y}),Db,y_,yO=Z(()=>{Db=lr(aN(),1),y_=Db.default});function nf(e){return H.isPlainObject(e)||H.isArray(e)}function bO(e){return H.endsWith(e,"[]")?e.slice(0,-2):e}function sp(e,t,r){return e?e.concat(t).map(function(i,s){return i=bO(i),!r&&s?"["+i+"]":i}).join(r?".":""):t}function oN(e){return H.isArray(e)&&!e.some(nf)}function lN(e,t,r){if(!H.isObject(e))throw TypeError("target must be an object");t=t||new(y_||FormData),r=H.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,E){return!H.isUndefined(E[v])});let i=r.metaTokens,s=r.visitor||p,n=r.dots,a=r.indexes,o=r.Blob||typeof Blob<"u"&&Blob,l=r.maxDepth===void 0?100:r.maxDepth,c=o&&H.isSpecCompliantForm(t);if(!H.isFunction(s))throw TypeError("visitor must be a function");function u(v){if(v===null)return"";if(H.isDate(v))return v.toISOString();if(H.isBoolean(v))return v.toString();if(!c&&H.isBlob(v))throw new ge("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(v)||H.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function p(v,E,y){let m=v;if(H.isReactNative(t)&&H.isReactNativeBlob(v))return t.append(sp(y,E,n),u(v)),!1;if(v&&!y&&typeof v=="object"){if(H.endsWith(E,"{}"))E=i?E:E.slice(0,-2),v=JSON.stringify(v);else if(H.isArray(v)&&oN(v)||(H.isFileList(v)||H.endsWith(E,"[]"))&&(m=H.toArray(v)))return E=bO(E),m.forEach(function(g,b){!(H.isUndefined(g)||g===null)&&t.append(a===!0?sp([E],b,n):a===null?E:E+"[]",u(g))}),!1}return nf(v)?!0:(t.append(sp(y,E,n),u(v)),!1)}let h=[],f=Object.assign(EO,{defaultVisitor:p,convertValue:u,isVisitable:nf});function _(v,E,y=0){if(!H.isUndefined(v)){if(y>l)throw new ge("Object is too deeply nested ("+y+" levels). Max depth: "+l,ge.ERR_FORM_DATA_DEPTH_EXCEEDED);if(h.indexOf(v)!==-1)throw Error("Circular reference detected in "+E.join("."));h.push(v),H.forEach(v,function(m,g){(!(H.isUndefined(m)||m===null)&&s.call(t,m,H.isString(g)?g.trim():g,E,f))===!0&&_(m,E?E.concat(g):[g],y+1)}),h.pop()}}if(!H.isObject(e))throw TypeError("data must be an object");return _(e),t}var EO,ol,Nu=Z(()=>{ut(),Fr(),yO(),EO=H.toFlatObject(H,{},null,function(e){return/^is[A-Z]/.test(e)}),ol=lN});function Ib(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function Lb(e,t){this._pairs=[],e&&ol(e,this,t)}var np,wO,cN=Z(()=>{Nu(),np=Lb.prototype,np.append=function(e,t){this._pairs.push([e,t])},np.toString=function(e){let t=e?function(r){return e.call(this,r,Ib)}:Ib;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")},wO=Lb});function uN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function b_(e,t,r){if(!t)return e;let i=r&&r.encode||uN,s=H.isFunction(r)?{serialize:r}:r,n=s&&s.serialize,a;if(n?a=n(t,s):a=H.isURLSearchParams(t)?t.toString():new wO(t,s).toString(i),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var E_=Z(()=>{ut(),cN()}),af=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){H.forEach(this.handlers,function(r){r!==null&&t(r)})}},of,dN=Z(()=>{ut(),of=af}),ll,Mu=Z(()=>{ll={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0}}),SO,hN=Z(()=>{SO=pN.URLSearchParams}),ap="abcdefghijklmnopqrstuvwxyz",Pb="0123456789",lf,mN=(e=16,t=lf.ALPHA_DIGIT)=>{let r="",{length:i}=t,s=new Uint32Array(e);fN.randomFillSync(s);for(let n=0;n<e;n++)r+=t[s[n]%i];return r},CO,gN=Z(()=>{hN(),yO(),lf={DIGIT:Pb,ALPHA:ap,ALPHA_DIGIT:ap+ap.toUpperCase()+Pb},CO={isNode:!0,classes:{URLSearchParams:SO,FormData:y_,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:lf,generateString:mN,protocols:["http","https","file","data"]}}),OO={};fr(OO,{hasBrowserEnv:()=>Ec,hasStandardBrowserEnv:()=>AO,hasStandardBrowserWebWorkerEnv:()=>xO,navigator:()=>wc,origin:()=>kO});var Ec,wc,AO,xO,kO,_N=Z(()=>{Ec=typeof window<"u"&&typeof document<"u",wc=typeof navigator=="object"&&navigator||void 0,AO=Ec&&(!wc||["ReactNative","NativeScript","NS"].indexOf(wc.product)<0),xO=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kO=Ec&&window.location.href||"http://localhost"}),ft,fi=Z(()=>{gN(),_N(),ft={...OO,...CO}});function vN(e,t){return ol(e,new ft.classes.URLSearchParams,{visitor:function(r,i,s,n){return ft.isNode&&H.isBuffer(r)?(this.append(i,r.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}var yN=Z(()=>{ut(),Nu(),fi()});function bN(e){return H.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function EN(e){let t={},r=Object.keys(e),i,s=r.length,n;for(i=0;i<s;i++)n=r[i],t[n]=e[n];return t}function wN(e){function t(r,i,s,n){let a=r[n++];if(a==="__proto__")return!0;let o=Number.isFinite(+a),l=n>=r.length;return a=!a&&H.isArray(s)?s.length:a,l?(H.hasOwnProp(s,a)?s[a]=H.isArray(s[a])?s[a].concat(i):[s[a],i]:s[a]=i,!o):((!s[a]||!H.isObject(s[a]))&&(s[a]=[]),t(r,i,s[a],n)&&H.isArray(s[a])&&(s[a]=EN(s[a])),!o)}if(H.isFormData(e)&&H.isFunction(e.entries)){let r={};return H.forEachEntry(e,(i,s)=>{t(bN(i),s,r,0)}),r}return null}var w_,TO=Z(()=>{ut(),w_=wN});function SN(e,t,r){if(H.isString(e))try{return(t||JSON.parse)(e),H.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var Ys=(e,t)=>e!=null&&H.hasOwnProp(e,t)?e[t]:void 0,Ql,Uu,S_=Z(()=>{ut(),Fr(),Mu(),Nu(),yN(),fi(),TO(),Ql={transitional:ll,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r=t.getContentType()||"",i=r.indexOf("application/json")>-1,s=H.isObject(e);if(s&&H.isHTMLForm(e)&&(e=new FormData(e)),H.isFormData(e))return i?JSON.stringify(w_(e)):e;if(H.isArrayBuffer(e)||H.isBuffer(e)||H.isStream(e)||H.isFile(e)||H.isBlob(e)||H.isReadableStream(e))return e;if(H.isArrayBufferView(e))return e.buffer;if(H.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let n;if(s){let a=Ys(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return vN(e,a).toString();if((n=H.isFileList(e))||r.indexOf("multipart/form-data")>-1){let o=Ys(this,"env"),l=o&&o.FormData;return ol(n?{"files[]":e}:e,l&&new l,a)}}return s||i?(t.setContentType("application/json",!1),SN(e)):e}],transformResponse:[function(e){let t=Ys(this,"transitional")||Ql.transitional,r=t&&t.forcedJSONParsing,i=Ys(this,"responseType"),s=i==="json";if(H.isResponse(e)||H.isReadableStream(e))return e;if(e&&H.isString(e)&&(r&&!i||s)){let n=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,Ys(this,"parseReviver"))}catch(a){if(n)throw a.name==="SyntaxError"?ge.from(a,ge.ERR_BAD_RESPONSE,this,null,Ys(this,"response")):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}},H.forEach(["delete","get","head","post","put","patch"],e=>{Ql.headers[e]={}}),Uu=Ql}),RO,CN=e=>{let t={},r,i,s;return e&&e.split(`
|
|
55
|
+
`).forEach(function(n){s=n.indexOf(":"),r=n.substring(0,s).trim().toLowerCase(),i=n.substring(s+1).trim(),!(!r||t[r]&&RO[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t},ON=Z(()=>{ut(),RO=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"])});function AN(e){let t=0,r=e.length;for(;t<r;){let i=e.charCodeAt(t);if(i!==9&&i!==32)break;t+=1}for(;r>t;){let i=e.charCodeAt(r-1);if(i!==9&&i!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function Va(e){return e&&String(e).trim().toLowerCase()}function xN(e){return AN(e.replace(DO,""))}function Sc(e){return e===!1||e==null?e:H.isArray(e)?e.map(Sc):xN(String(e))}function kN(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}function op(e,t,r,i,s){if(H.isFunction(i))return i.call(this,t,r);if(s&&(t=r),!!H.isString(t)){if(H.isString(i))return t.indexOf(i)!==-1;if(H.isRegExp(i))return i.test(t)}}function TN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function RN(e,t){let r=H.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(s,n,a){return this[i].call(this,t,s,n,a)},configurable:!0})})}var lp,DO,DN=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),Za,tr,Ii=Z(()=>{ut(),ON(),lp=Symbol("internals"),DO=/[^\x09\x20-\x7E\x80-\xFF]/g,Za=class{constructor(t){t&&this.set(t)}set(t,r,i){let s=this;function n(o,l,c){let u=Va(l);if(!u)throw Error("header name must be a non-empty string");let p=H.findKey(s,u);(!p||s[p]===void 0||c===!0||c===void 0&&s[p]!==!1)&&(s[p||l]=Sc(o))}let a=(o,l)=>H.forEach(o,(c,u)=>n(c,u,l));if(H.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(H.isString(t)&&(t=t.trim())&&!DN(t))a(CN(t),r);else if(H.isObject(t)&&H.isIterable(t)){let o={},l,c;for(let u of t){if(!H.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[c=u[0]]=(l=o[c])?H.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}a(o,r)}else t!=null&&n(r,t,i);return this}get(t,r){if(t=Va(t),t){let i=H.findKey(this,t);if(i){let s=this[i];if(!r)return s;if(r===!0)return kN(s);if(H.isFunction(r))return r.call(this,s,i);if(H.isRegExp(r))return r.exec(s);throw TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Va(t),t){let i=H.findKey(this,t);return!!(i&&this[i]!==void 0&&(!r||op(this,this[i],i,r)))}return!1}delete(t,r){let i=this,s=!1;function n(a){if(a=Va(a),a){let o=H.findKey(i,a);o&&(!r||op(i,i[o],o,r))&&(delete i[o],s=!0)}}return H.isArray(t)?t.forEach(n):n(t),s}clear(t){let r=Object.keys(this),i=r.length,s=!1;for(;i--;){let n=r[i];(!t||op(this,this[n],n,t,!0))&&(delete this[n],s=!0)}return s}normalize(t){let r=this,i={};return H.forEach(this,(s,n)=>{let a=H.findKey(i,n);if(a){r[a]=Sc(s),delete r[n];return}let o=t?TN(n):String(n).trim();o!==n&&delete r[n],r[o]=Sc(s),i[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return H.forEach(this,(i,s)=>{i!=null&&i!==!1&&(r[s]=t&&H.isArray(i)?i.join(", "):i)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
56
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let i=new this(t);return r.forEach(s=>i.set(s)),i}static accessor(t){let r=(this[lp]=this[lp]={accessors:{}}).accessors,i=this.prototype;function s(n){let a=Va(n);r[a]||(RN(i,n),r[a]=!0)}return H.isArray(t)?t.forEach(s):s(t),this}},Za.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),H.reduceDescriptors(Za.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}}),H.freezeMethods(Za),tr=Za});function cp(e,t){let r=this||Uu,i=t||r,s=tr.from(i.headers),n=i.data;return H.forEach(e,function(a){n=a.call(r,n,s.normalize(),t?t.status:void 0)}),s.normalize(),n}var IN=Z(()=>{ut(),S_(),Ii()});function IO(e){return!!(e&&e.__CANCEL__)}var Nb,Qi,na=Z(()=>{Fr(),Nb=class extends ge{constructor(t,r,i){super(t??"canceled",ge.ERR_CANCELED,r,i),this.name="CanceledError",this.__CANCEL__=!0}},Qi=Nb});function hn(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new ge("Request failed with status code "+r.status,[ge.ERR_BAD_REQUEST,ge.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var C_=Z(()=>{Fr()});function LN(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function PN(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function O_(e,t,r){let i=!LN(t);return e&&(i||r===!1)?PN(e,t):t}var A_=()=>{};function NN(e){try{return new URL(e)}catch{return null}}function MN(e){var t=(typeof e=="string"?NN(e):e)||{},{protocol:r,host:i,port:s}=t;if(typeof i!="string"||!i||typeof r!="string"||(r=r.split(":",1)[0],i=i.replace(/:\d*$/,""),s=parseInt(s)||LO[r]||0,!UN(i,s)))return"";var n=cf(r+"_proxy")||cf("all_proxy");return n&&n.indexOf("://")===-1&&(n=r+"://"+n),n}function UN(e,t){var r=cf("no_proxy").toLowerCase();return r?r==="*"?!1:r.split(/[,\s]/).every(function(i){if(!i)return!0;var s=i.match(/^(.+):(\d+)$/),n=s?s[1]:i,a=s?parseInt(s[2]):0;return a&&a!==t?!0:/^[.*]/.test(n)?(n.charAt(0)==="*"&&(n=n.slice(1)),!e.endsWith(n)):e!==n}):!0}function cf(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var LO,$N=Z(()=>{LO={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443}}),jN=j(function(e,t){var r=1e3,i=r*60,s=i*60,n=s*24,a=n*7,o=n*365.25;t.exports=function(h,f){f=f||{};var _=typeof h;if(_==="string"&&h.length>0)return l(h);if(_==="number"&&isFinite(h))return f.long?u(h):c(h);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function l(h){if(h=String(h),!(h.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(f){var _=parseFloat(f[1]),v=(f[2]||"ms").toLowerCase();switch(v){case"years":case"year":case"yrs":case"yr":case"y":return _*o;case"weeks":case"week":case"w":return _*a;case"days":case"day":case"d":return _*n;case"hours":case"hour":case"hrs":case"hr":case"h":return _*s;case"minutes":case"minute":case"mins":case"min":case"m":return _*i;case"seconds":case"second":case"secs":case"sec":case"s":return _*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return _;default:return}}}}function c(h){var f=Math.abs(h);return f>=n?Math.round(h/n)+"d":f>=s?Math.round(h/s)+"h":f>=i?Math.round(h/i)+"m":f>=r?Math.round(h/r)+"s":h+"ms"}function u(h){var f=Math.abs(h);return f>=n?p(h,f,n,"day"):f>=s?p(h,f,s,"hour"):f>=i?p(h,f,i,"minute"):f>=r?p(h,f,r,"second"):h+" ms"}function p(h,f,_,v){var E=f>=_*1.5;return Math.round(h/_)+" "+v+(E?"s":"")}}),PO=j(function(e,t){function r(i){n.debug=n,n.default=n,n.coerce=p,n.disable=c,n.enable=o,n.enabled=u,n.humanize=jN(),n.destroy=h,Object.keys(i).forEach(f=>{n[f]=i[f]}),n.names=[],n.skips=[],n.formatters={};function s(f){let _=0;for(let v=0;v<f.length;v++)_=(_<<5)-_+f.charCodeAt(v),_|=0;return n.colors[Math.abs(_)%n.colors.length]}n.selectColor=s;function n(f){let _,v=null,E,y;function m(...g){if(!m.enabled)return;let b=m,C=Number(new Date),A=C-(_||C);b.diff=A,b.prev=_,b.curr=C,_=C,g[0]=n.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let w=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(S,x)=>{if(S==="%%")return"%";w++;let T=n.formatters[x];if(typeof T=="function"){let I=g[w];S=T.call(b,I),g.splice(w,1),w--}return S}),n.formatArgs.call(b,g),(b.log||n.log).apply(b,g)}return m.namespace=f,m.useColors=n.useColors(),m.color=n.selectColor(f),m.extend=a,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(E!==n.namespaces&&(E=n.namespaces,y=n.enabled(f)),y),set:g=>{v=g}}),typeof n.init=="function"&&n.init(m),m}function a(f,_){let v=n(this.namespace+(typeof _>"u"?":":_)+f);return v.log=this.log,v}function o(f){n.save(f),n.namespaces=f,n.names=[],n.skips=[];let _=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let v of _)v[0]==="-"?n.skips.push(v.slice(1)):n.names.push(v)}function l(f,_){let v=0,E=0,y=-1,m=0;for(;v<f.length;)if(E<_.length&&(_[E]===f[v]||_[E]==="*"))_[E]==="*"?(y=E,m=v,E++):(v++,E++);else if(y!==-1)E=y+1,m++,v=m;else return!1;for(;E<_.length&&_[E]==="*";)E++;return E===_.length}function c(){let f=[...n.names,...n.skips.map(_=>"-"+_)].join(",");return n.enable(""),f}function u(f){for(let _ of n.skips)if(l(f,_))return!1;for(let _ of n.names)if(l(f,_))return!0;return!1}function p(f){return f instanceof Error?f.stack||f.message:f}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=r}),FN=j(function(e,t){e.formatArgs=i,e.save=s,e.load=n,e.useColors=r,e.storage=a(),e.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;l.splice(1,0,c,"color: inherit");let u=0,p=0;l[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(u++,h==="%c"&&(p=u))}),l.splice(p,0,c)}e.log=console.debug||console.log||(()=>{});function s(l){try{l?e.storage.setItem("debug",l):e.storage.removeItem("debug")}catch{}}function n(){let l;try{l=e.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function a(){try{return localStorage}catch{}}t.exports=PO()(e);var{formatters:o}=t.exports;o.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}),BN=j(function(e,t){t.exports=(r,i=process.argv)=>{let s=r.startsWith("-")?"":r.length===1?"-":"--",n=i.indexOf(s+r),a=i.indexOf("--");return n!==-1&&(a===-1||n<a)}}),HN=j(function(e,t){var r=Me("os"),i=Me("tty"),s=BN(),{env:n}=process,a;s("no-color")||s("no-colors")||s("color=false")||s("color=never")?a=0:(s("color")||s("colors")||s("color=true")||s("color=always"))&&(a=1);function o(){if("FORCE_COLOR"in n)return n.FORCE_COLOR==="true"?1:n.FORCE_COLOR==="false"?0:n.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(n.FORCE_COLOR,10),3)}function l(p){return p===0?!1:{level:p,hasBasic:!0,has256:p>=2,has16m:p>=3}}function c(p,{streamIsTTY:h,sniffFlags:f=!0}={}){let _=o();_!==void 0&&(a=_);let v=f?a:_;if(v===0)return 0;if(f){if(s("color=16m")||s("color=full")||s("color=truecolor"))return 3;if(s("color=256"))return 2}if(p&&!h&&v===void 0)return 0;let E=v||0;if(n.TERM==="dumb")return E;if(process.platform==="win32"){let y=r.release().split(".");return Number(y[0])>=10&&Number(y[2])>=10586?Number(y[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(y=>y in n)||n.CI_NAME==="codeship"?1:E;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if(n.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in n){let y=Number.parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return y>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:E}function u(p,h={}){let f=c(p,{streamIsTTY:p&&p.isTTY,...h});return l(f)}t.exports={supportsColor:u,stdout:u({isTTY:i.isatty(1)}),stderr:u({isTTY:i.isatty(2)})}}),zN=j(function(e,t){var r=Me("tty"),i=Me("util");e.init=u,e.log=o,e.formatArgs=n,e.save=l,e.load=c,e.useColors=s,e.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let h=HN();h&&(h.stderr||h).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(h=>/^debug_/i.test(h)).reduce((h,f)=>{let _=f.substring(6).toLowerCase().replace(/_([a-z])/g,(E,y)=>y.toUpperCase()),v=process.env[f];return/^(yes|on|true|enabled)$/i.test(v)?v=!0:/^(no|off|false|disabled)$/i.test(v)?v=!1:v==="null"?v=null:v=Number(v),h[_]=v,h},{});function s(){return"colors"in e.inspectOpts?!!e.inspectOpts.colors:r.isatty(process.stderr.fd)}function n(h){let{namespace:f,useColors:_}=this;if(_){let v=this.color,E="\x1B[3"+(v<8?v:"8;5;"+v),y=` ${E};1m${f} \x1B[0m`;h[0]=y+h[0].split(`
|
|
57
|
+
`).join(`
|
|
58
|
+
`+y),h.push(E+"m+"+t.exports.humanize(this.diff)+"\x1B[0m")}else h[0]=a()+f+" "+h[0]}function a(){return e.inspectOpts.hideDate?"":new Date().toISOString()+" "}function o(...h){return process.stderr.write(i.formatWithOptions(e.inspectOpts,...h)+`
|
|
59
|
+
`)}function l(h){h?process.env.DEBUG=h:delete process.env.DEBUG}function c(){return process.env.DEBUG}function u(h){h.inspectOpts={};let f=Object.keys(e.inspectOpts);for(let _=0;_<f.length;_++)h.inspectOpts[f[_]]=e.inspectOpts[f[_]]}t.exports=PO()(e);var{formatters:p}=t.exports;p.o=function(h){return this.inspectOpts.colors=this.useColors,i.inspect(h,this.inspectOpts).split(`
|
|
60
|
+
`).map(f=>f.trim()).join(" ")},p.O=function(h){return this.inspectOpts.colors=this.useColors,i.inspect(h,this.inspectOpts)}}),WN=j(function(e,t){typeof process>"u"||process.type==="renderer"||process.__nwjs?t.exports=FN():t.exports=zN()}),KN=j(function(e,t){var r;t.exports=function(){if(!r){try{r=WN()("follow-redirects")}catch{}typeof r!="function"&&(r=function(){})}r.apply(null,arguments)}}),GN=j(function(e,t){var r=Me("url"),i=r.URL,s=Me("http"),n=Me("https"),a=Me("stream").Writable,o=Me("assert"),l=KN();(function(){var k=typeof process<"u",U=typeof window<"u"&&typeof document<"u",N=pe(Error.captureStackTrace);!k&&(U||!N)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var c=!1;try{o(new i(""))}catch(k){c=k.code==="ERR_INVALID_URL"}var u=["Authorization","Proxy-Authorization","Cookie"],p=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],h=["abort","aborted","connect","error","socket","timeout"],f=Object.create(null);h.forEach(function(k){f[k]=function(U,N,R){this._redirectable.emit(k,U,N,R)}});var _=L("ERR_INVALID_URL","Invalid URL",TypeError),v=L("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),E=L("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",v),y=L("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),m=L("ERR_STREAM_WRITE_AFTER_END","write after end"),g=a.prototype.destroy||A;function b(k,U){a.call(this),this._sanitizeOptions(k),this._options=k,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],U&&this.on("response",U);var N=this;this._onNativeResponse=function(R){try{N._processResponse(R)}catch(M){N.emit("error",M instanceof v?M:new v({cause:M}))}},this._headerFilter=new RegExp("^(?:"+u.concat(k.sensitiveHeaders).map(W).join("|")+")$","i"),this._performRequest()}b.prototype=Object.create(a.prototype),b.prototype.abort=function(){P(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},b.prototype.destroy=function(k){return P(this._currentRequest,k),g.call(this,k),this},b.prototype.write=function(k,U,N){if(this._ending)throw new m;if(!ee(k)&&!ne(k))throw TypeError("data should be a string, Buffer or Uint8Array");if(pe(U)&&(N=U,U=null),k.length===0){N&&N();return}this._requestBodyLength+k.length<=this._options.maxBodyLength?(this._requestBodyLength+=k.length,this._requestBodyBuffers.push({data:k,encoding:U}),this._currentRequest.write(k,U,N)):(this.emit("error",new y),this.abort())},b.prototype.end=function(k,U,N){if(pe(k)?(N=k,k=U=null):pe(U)&&(N=U,U=null),!k)this._ended=this._ending=!0,this._currentRequest.end(null,null,N);else{var R=this,M=this._currentRequest;this.write(k,U,function(){R._ended=!0,M.end(null,null,N)}),this._ending=!0}},b.prototype.setHeader=function(k,U){this._options.headers[k]=U,this._currentRequest.setHeader(k,U)},b.prototype.removeHeader=function(k){delete this._options.headers[k],this._currentRequest.removeHeader(k)},b.prototype.setTimeout=function(k,U){var N=this;function R(J){J.setTimeout(k),J.removeListener("timeout",J.destroy),J.addListener("timeout",J.destroy)}function M(J){N._timeout&&clearTimeout(N._timeout),N._timeout=setTimeout(function(){N.emit("timeout"),K()},k),R(J)}function K(){N._timeout&&(clearTimeout(N._timeout),N._timeout=null),N.removeListener("abort",K),N.removeListener("error",K),N.removeListener("response",K),N.removeListener("close",K),U&&N.removeListener("timeout",U),N.socket||N._currentRequest.removeListener("socket",M)}return U&&this.on("timeout",U),this.socket?M(this.socket):this._currentRequest.once("socket",M),this.on("socket",R),this.on("abort",K),this.on("error",K),this.on("response",K),this.on("close",K),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(k){b.prototype[k]=function(U,N){return this._currentRequest[k](U,N)}}),["aborted","connection","socket"].forEach(function(k){Object.defineProperty(b.prototype,k,{get:function(){return this._currentRequest[k]}})}),b.prototype._sanitizeOptions=function(k){if(k.headers||(k.headers={}),se(k.sensitiveHeaders)||(k.sensitiveHeaders=[]),k.host&&(k.hostname||(k.hostname=k.host),delete k.host),!k.pathname&&k.path){var U=k.path.indexOf("?");U<0?k.pathname=k.path:(k.pathname=k.path.substring(0,U),k.search=k.path.substring(U))}},b.prototype._performRequest=function(){var k=this._options.protocol,U=this._options.nativeProtocols[k];if(!U)throw TypeError("Unsupported protocol "+k);if(this._options.agents){var N=k.slice(0,-1);this._options.agent=this._options.agents[N]}var R=this._currentRequest=U.request(this._options,this._onNativeResponse);R._redirectable=this;for(var M of h)R.on(M,f[M]);if(this._currentUrl=/^\//.test(this._options.path)?r.format(this._options):this._options.path,this._isRedirect){var K=0,J=this,ae=this._requestBodyBuffers;(function xe(be){if(R===J._currentRequest)if(be)J.emit("error",be);else if(K<ae.length){var _e=ae[K++];R.finished||R.write(_e.data,_e.encoding,xe)}else J._ended&&R.end()})()}},b.prototype._processResponse=function(k){var U=k.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:k.headers,statusCode:U});var N=k.headers.location;if(!N||this._options.followRedirects===!1||U<300||U>=400){k.responseUrl=this._currentUrl,k.redirects=this._redirects,this.emit("response",k),this._requestBodyBuffers=[];return}if(P(this._currentRequest),k.destroy(),++this._redirectCount>this._options.maxRedirects)throw new E;var R,M=this._options.beforeRedirect;M&&(R=Object.assign({Host:k.req.getHeader("host")},this._options.headers));var K=this._options.method;((U===301||U===302)&&this._options.method==="POST"||U===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],I(/^content-/i,this._options.headers));var J=I(/^host$/i,this._options.headers),ae=w(this._currentUrl),xe=J||ae.host,be=/^\w+:/.test(N)?this._currentUrl:r.format(Object.assign(ae,{host:xe})),_e=S(N,be);if(l("redirecting to",_e.href),this._isRedirect=!0,T(_e,this._options),(_e.protocol!==ae.protocol&&_e.protocol!=="https:"||_e.host!==xe&&!$(_e.host,xe))&&I(this._headerFilter,this._options.headers),pe(M)){var F={headers:k.headers,statusCode:U},z={url:be,method:K,headers:R};M(this._options,F,z),this._sanitizeOptions(this._options)}this._performRequest()};function C(k){var U={maxRedirects:21,maxBodyLength:10485760},N={};return Object.keys(k).forEach(function(R){var M=R+":",K=N[M]=k[R],J=U[R]=Object.create(K);function ae(be,_e,F){return oe(be)?be=T(be):ee(be)?be=T(w(be)):(F=_e,_e=x(be),be={protocol:M}),pe(_e)&&(F=_e,_e=null),_e=Object.assign({maxRedirects:U.maxRedirects,maxBodyLength:U.maxBodyLength},be,_e),_e.nativeProtocols=N,!ee(_e.host)&&!ee(_e.hostname)&&(_e.hostname="::1"),o.equal(_e.protocol,M,"protocol mismatch"),l("options",_e),new b(_e,F)}function xe(be,_e,F){var z=J.request(be,_e,F);return z.end(),z}Object.defineProperties(J,{request:{value:ae,configurable:!0,enumerable:!0,writable:!0},get:{value:xe,configurable:!0,enumerable:!0,writable:!0}})}),U}function A(){}function w(k){var U;if(c)U=new i(k);else if(U=x(r.parse(k)),!ee(U.protocol))throw new _({input:k});return U}function S(k,U){return c?new i(k,U):w(r.resolve(U,k))}function x(k){if(/^\[/.test(k.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(k.hostname))throw new _({input:k.href||k});if(/^\[/.test(k.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(k.host))throw new _({input:k.href||k});return k}function T(k,U){var N=U||{};for(var R of p)N[R]=k[R];return N.hostname.startsWith("[")&&(N.hostname=N.hostname.slice(1,-1)),N.port!==""&&(N.port=Number(N.port)),N.path=N.search?N.pathname+N.search:N.pathname,N}function I(k,U){var N;for(var R in U)k.test(R)&&(N=U[R],delete U[R]);return N===null||typeof N>"u"?void 0:String(N).trim()}function L(k,U,N){function R(M){pe(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,M||{}),this.code=k,this.message=this.cause?U+": "+this.cause.message:U}return R.prototype=Object.create((N||Error).prototype),Object.defineProperties(R.prototype,{constructor:{value:R,enumerable:!1},name:{value:"Error ["+k+"]",enumerable:!1}}),R}function P(k,U){for(var N of h)k.removeListener(N,f[N]);k.on("error",A),k.destroy(U)}function $(k,U){o(ee(k)&&ee(U));var N=k.length-U.length-1;return N>0&&k[N]==="."&&k.endsWith(U)}function se(k){return k instanceof Array}function ee(k){return typeof k=="string"||k instanceof String}function pe(k){return typeof k=="function"}function ne(k){return typeof k=="object"&&"length"in k}function oe(k){return i&&k instanceof i}function W(k){return k.replace(/[\]\\/()*+?.$]/g,"\\$&")}t.exports=C({http:s,https:n}),t.exports.wrap=C}),Yc="1.15.2";function NO(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qN(e,t,r){let i=r&&r.Blob||ft.classes.Blob,s=NO(e);if(t===void 0&&i&&(t=!0),s==="data"){e=s.length?e.slice(s.length+1):e;let n=MO.exec(e);if(!n)throw new ge("Invalid URL",ge.ERR_INVALID_URL);let a=n[1],o=n[2],l=n[3],c=Buffer.from(decodeURIComponent(l),o?"base64":"utf8");if(t){if(!i)throw new ge("Blob is not supported",ge.ERR_NOT_SUPPORT);return new i([c],{type:a})}return c}throw new ge("Unsupported protocol "+s,ge.ERR_NOT_SUPPORT)}var MO,VN=Z(()=>{Fr(),fi(),MO=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/}),ec,Mb,uf,XN=Z(()=>{ut(),ec=Symbol("internals"),Mb=class extends ZN.Transform{constructor(t){t=H.toFlatObject(t,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,s)=>!H.isUndefined(s[i])),super({readableHighWaterMark:t.chunkSize});let r=this[ec]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[ec];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,i){let s=this[ec],n=s.maxRate,a=this.readableHighWaterMark,o=s.timeWindow,l=1e3/o,c=n/l,u=s.minChunkSize!==!1?Math.max(s.minChunkSize,c*.01):0,p=(f,_)=>{let v=Buffer.byteLength(f);s.bytesSeen+=v,s.bytes+=v,s.isCaptured&&this.emit("progress",s.bytesSeen),this.push(f)?process.nextTick(_):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(_)}},h=(f,_)=>{let v=Buffer.byteLength(f),E=null,y=a,m,g=0;if(n){let b=Date.now();(!s.ts||(g=b-s.ts)>=o)&&(s.ts=b,m=c-s.bytes,s.bytes=m<0?-m:0,g=0),m=c-s.bytes}if(n){if(m<=0)return setTimeout(()=>{_(null,f)},o-g);m<y&&(y=m)}y&&v>y&&v-y>u&&(E=f.subarray(y),f=f.subarray(0,y)),p(f,E?()=>{process.nextTick(_,null,E)}:_)};h(t,function f(_,v){if(_)return i(_);v?h(v,f):i(null)})}},uf=Mb}),df,YN=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[df]?yield*e[df]():yield e},x_,UO=Z(()=>{({asyncIterator:df}=Symbol),x_=YN}),pf=class{constructor(t,r){let{escapeName:i}=this.constructor,s=H.isString(r),n=`Content-Disposition: form-data; name="${i(t)}"${!s&&r.name?`; filename="${i(r.name)}"`:""}${bs}`;if(s)r=In.encode(String(r).replace(/\r?\n|\r\n?/g,bs));else{let a=String(r.type||"application/octet-stream").replace(/[\r\n]/g,"");n+=`Content-Type: ${a}${bs}`}this.headers=In.encode(n+bs),this.contentLength=s?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+eM,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;H.isTypedArray(t)?yield t:yield*x_(t),yield jO}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},$O,In,bs=`\r
|
|
61
|
+
`,jO,eM=2,tM=(e,t,r)=>{let{tag:i="form-data-boundary",size:s=25,boundary:n=i+"-"+ft.generateString(s,$O)}=r||{};if(!H.isFormData(e))throw TypeError("FormData instance required");if(n.length<1||n.length>70)throw Error("boundary must be 10-70 characters long");let a=In.encode("--"+n+bs),o=In.encode("--"+n+"--"+bs),l=o.byteLength,c=Array.from(e.entries()).map(([p,h])=>{let f=new pf(p,h);return l+=f.size,f});l+=a.byteLength*c.length,l=H.toFiniteNumber(l);let u={"Content-Type":`multipart/form-data; boundary=${n}`};return Number.isFinite(l)&&(u["Content-Length"]=l),t&&t(u),QN.from((async function*(){for(let p of c)yield a,yield*p.encode();yield o})())},FO,rM=Z(()=>{ut(),UO(),fi(),$O=ft.ALPHABET.ALPHA_DIGIT+"-_",In=typeof TextEncoder=="function"?new TextEncoder:new JN.TextEncoder,jO=In.encode(bs),FO=tM}),Ub,BO,sM=Z(()=>{Ub=class extends iM.Transform{__transform(t,r,i){this.push(t),i()}_transform(t,r,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let s=Buffer.alloc(2);s[0]=120,s[1]=156,this.push(s,r)}this.__transform(t,r,i)}},BO=Ub}),nM=(e,t)=>H.isAsyncFn(e)?function(...r){let i=r.pop();e.apply(this,r).then(s=>{try{t?i(null,...t(s)):i(null,s)}catch(n){i(n)}},i)}:e,HO,aM=Z(()=>{ut(),HO=nM});function oM(e){let t;try{t=new URL(e)}catch{return!1}let r=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!r)return!1;if(r==="*")return!0;let i=Number.parseInt(t.port,10)||KO[t.protocol.split(":",1)[0]]||0,s=jb(t.hostname.toLowerCase());return r.split(/[\s,]+/).some(n=>{if(!n)return!1;let[a,o]=cM(n);return a=jb(a),!a||o&&o!==i?!1:(a.charAt(0)==="*"&&(a=a.slice(1)),a.charAt(0)==="."?s.endsWith(a):s===a||$b(s)&&$b(a))})}var zO,WO=e=>{let t=e.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(r=>/^\d+$/.test(r)&&Number(r)>=0&&Number(r)<=255)},lM=e=>{if(e==="::1")return!0;let t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return WO(t[1]);let r=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(r){let s=parseInt(r[1],16);return s>=32512&&s<=32767}let i=e.split(":");if(i.length===8){for(let s=0;s<7;s++)if(!/^0+$/.test(i[s]))return!1;return/^0*1$/.test(i[7])}return!1},$b=e=>e?zO.has(e)||WO(e)?!0:lM(e):!1,KO,cM=e=>{let t=e,r=0;if(t.charAt(0)==="["){let n=t.indexOf("]");if(n!==-1){let a=t.slice(1,n),o=t.slice(n+1);return o.charAt(0)===":"&&/^\d+$/.test(o.slice(1))&&(r=Number.parseInt(o.slice(1),10)),[a,r]}}let i=t.indexOf(":"),s=t.lastIndexOf(":");return i!==-1&&i===s&&/^\d+$/.test(t.slice(s+1))&&(r=Number.parseInt(t.slice(s+1),10),t=t.slice(0,s)),[t,r]},jb=e=>e&&(e.charAt(0)==="["&&e.charAt(e.length-1)==="]"&&(e=e.slice(1,-1)),e.replace(/\.+$/,"")),uM=Z(()=>{zO=new Set(["localhost"]),KO={http:80,https:443,ws:80,wss:443,ftp:21}});function dM(e,t){e=e||10;let r=Array(e),i=Array(e),s=0,n=0,a;return t=t!==void 0?t:1e3,function(o){let l=Date.now(),c=i[n];a||(a=l),r[s]=o,i[s]=l;let u=n,p=0;for(;u!==s;)p+=r[u++],u=u%e;if(s=(s+1)%e,s===n&&(n=(n+1)%e),l-a<t)return;let h=c&&l-c;return h?Math.round(p*1e3/h):void 0}}var GO,pM=Z(()=>{GO=dM});function hM(e,t){let r=0,i=1e3/t,s,n,a=(o,l=Date.now())=>{r=l,s=null,n&&(clearTimeout(n),n=null),e(...o)};return[(...o)=>{let l=Date.now(),c=l-r;c>=i?a(o,l):(s=o,!n&&(n=setTimeout(()=>{n=null,a(s)},i-c)))},()=>s&&a(s)]}var qO,fM=Z(()=>{qO=hM}),Ln=(e,t,r=3)=>{let i=0,s=GO(50,250);return qO(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,l=o!=null?Math.min(a,o):a,c=Math.max(0,l-i),u=s(c);i=Math.max(i,l);let p={loaded:l,total:o,progress:o?l/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o?(o-l)/u:void 0,event:n,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(p)},r)},Jc=(e,t)=>{let r=e!=null;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},Qc=e=>(...t)=>H.asap(()=>e(...t)),k_=Z(()=>{pM(),fM(),ut()});function mM(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let r=e.slice(5,t),i=e.slice(t+1);if(/;base64/i.test(r)){let{length:s,length:n}=i;for(let u=0;u<n;u++)if(i.charCodeAt(u)===37&&u+2<n){let p=i.charCodeAt(u+1),h=i.charCodeAt(u+2);(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102)&&(s-=2,u+=2)}let a=0,o=n-1,l=u=>u>=2&&i.charCodeAt(u-2)===37&&i.charCodeAt(u-1)===51&&(i.charCodeAt(u)===68||i.charCodeAt(u)===100);o>=0&&(i.charCodeAt(o)===61?(a++,o--):l(o)&&(a++,o-=3)),a===1&&o>=0&&(i.charCodeAt(o)===61||l(o))&&a++;let c=Math.floor(s/4)*3-(a||0);return c>0?c:0}return Buffer.byteLength(i,"utf8")}var hf=class{constructor(){this.sessions=Object.create(null)}getSession(t,r){r=Object.assign({sessionTimeout:1e3},r);let i=this.sessions[t];if(i){let u=i.length;for(let p=0;p<u;p++){let[h,f]=i[p];if(!h.destroyed&&!h.closed&&ZO.isDeepStrictEqual(f,r))return h}}let s=VO.connect(t,r),n,a=()=>{if(n)return;n=!0;let u=i,p=u.length,h=p;for(;h--;)if(u[h][0]===s){p===1?delete this.sessions[t]:u.splice(h,1),s.closed||s.close();return}},o=s.request,{sessionTimeout:l}=r;if(l!=null){let u,p=0;s.request=function(){let h=o.apply(this,arguments);return p++,u&&(clearTimeout(u),u=null),h.once("close",()=>{--p||(u=setTimeout(()=>{u=null,a()},l))}),h}}s.once("close",a);let c=[s,r];return i?i.push(c):i=this.sessions[t]=[c],s}};function yM(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function XO(e,t,r){let i=t;if(!i&&i!==!1){let s=MN(r);s&&(oM(r)||(i=new URL(s)))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){if(i.auth.username||i.auth.password)i.auth=(i.auth.username||"")+":"+(i.auth.password||"");else if(typeof i.auth=="object")throw new ge("Invalid proxy authorization",ge.ERR_BAD_OPTION,{proxy:i});let n=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");let s=i.hostname||i.host;e.hostname=s,e.host=s,e.port=i.port,e.path=r,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(s){XO(s,t,s.href)}}var Bb,up,Hb,dp,zb,Wb,Kb,pp,Xa,hp,Gb=(e,[t,r])=>(e.on("end",r).on("error",r),t),qb,Vb,bM=e=>new Promise((t,r)=>{let i,s,n=(l,c)=>{s||(s=!0,i&&i(l,c))},a=l=>{n(l),t(l)},o=l=>{n(l,!0),r(l)};e(a,o,l=>i=l).catch(o)}),EM=({address:e,family:t})=>{if(!H.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},Zb=(e,t)=>EM(H.isObject(e)?e:{address:e,family:t}),Xb,YO,wM=Z(()=>{ut(),C_(),A_(),E_(),$N(),Mu(),Fr(),na(),fi(),VN(),Ii(),XN(),rM(),UO(),sM(),aM(),uM(),k_(),Bb=lr(GN(),1),up={flush:Bi.constants.Z_SYNC_FLUSH,finishFlush:Bi.constants.Z_SYNC_FLUSH},Hb={flush:Bi.constants.BROTLI_OPERATION_FLUSH,finishFlush:Bi.constants.BROTLI_OPERATION_FLUSH},dp=H.isFunction(Bi.createBrotliDecompress),{http:zb,https:Wb}=Bb.default,Kb=/https:?/,pp=Symbol("axios.http.socketListener"),Xa=Symbol("axios.http.currentReq"),hp=ft.protocols.map(e=>e+":"),qb=new hf,Vb=typeof process<"u"&&H.kindOf(process)==="process",Xb={request(e,t){let r=e.protocol+"//"+e.hostname+":"+(e.port||(e.protocol==="https:"?443:80)),{http2Options:i,headers:s}=e,n=qb.getSession(r,i),{HTTP2_HEADER_SCHEME:a,HTTP2_HEADER_METHOD:o,HTTP2_HEADER_PATH:l,HTTP2_HEADER_STATUS:c}=VO.constants,u={[a]:e.protocol.replace(":",""),[o]:e.method,[l]:e.path};H.forEach(s,(h,f)=>{f.charAt(0)!==":"&&(u[f]=h)});let p=n.request(u);return p.once("response",h=>{let f=p;h=Object.assign({},h);let _=h[c];delete h[c],f.headers=h,f.statusCode=+_,t(f)}),p}},YO=Vb&&function(e){return bM(async function(t,r,i){let s=W=>H.hasOwnProp(e,W)?e[W]:void 0,n=s("data"),a=s("lookup"),o=s("family"),l=s("httpVersion");l===void 0&&(l=1);let c=s("http2Options"),u=s("responseType"),p=s("responseEncoding"),h=e.method.toUpperCase(),f,_=!1,v;if(l=+l,Number.isNaN(l))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(l!==1&&l!==2)throw TypeError(`Unsupported protocol version '${l}'`);let E=l===2;if(a){let W=HO(a,k=>H.isArray(k)?k:[k]);a=(k,U,N)=>{W(k,U,(R,M,K)=>{if(R)return N(R);let J=H.isArray(M)?M.map(ae=>Zb(ae)):[Zb(M,K)];U.all?N(R,J):N(R,J[0].address,J[0].family)})}}let y=new vM;function m(W){try{y.emit("abort",!W||W.type?new Qi(null,e,v):W)}catch(k){console.warn("emit error",k)}}y.once("abort",r);let g=()=>{e.cancelToken&&e.cancelToken.unsubscribe(m),e.signal&&e.signal.removeEventListener("abort",m),y.removeAllListeners()};(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(m),e.signal&&(e.signal.aborted?m():e.signal.addEventListener("abort",m))),i((W,k)=>{if(f=!0,k){_=!0,g();return}let{data:U}=W;if(U instanceof Gr.Readable||U instanceof Gr.Duplex){let N=Gr.finished(U,()=>{N(),g()})}else g()});let b=O_(e.baseURL,e.url,e.allowAbsoluteUrls),C=new URL(b,ft.hasBrowserEnv?ft.origin:void 0),A=C.protocol||hp[0];if(A==="data:"){if(e.maxContentLength>-1){let k=String(e.url||b||"");if(mM(k)>e.maxContentLength)return r(new ge("maxContentLength size of "+e.maxContentLength+" exceeded",ge.ERR_BAD_RESPONSE,e))}let W;if(h!=="GET")return hn(t,r,{status:405,statusText:"method not allowed",headers:{},config:e});try{W=qN(e.url,u==="blob",{Blob:e.env&&e.env.Blob})}catch(k){throw ge.from(k,ge.ERR_BAD_REQUEST,e)}return u==="text"?(W=W.toString(p),(!p||p==="utf8")&&(W=H.stripBOM(W))):u==="stream"&&(W=Gr.Readable.from(W)),hn(t,r,{data:W,status:200,statusText:"OK",headers:new tr,config:e})}if(hp.indexOf(A)===-1)return r(new ge("Unsupported protocol "+A,ge.ERR_BAD_REQUEST,e));let w=tr.from(e.headers).normalize();w.set("User-Agent","axios/"+Yc,!1);let{onUploadProgress:S,onDownloadProgress:x}=e,T=e.maxRate,I,L;if(H.isSpecCompliantForm(n)){let W=w.getContentType(/boundary=([-_\w\d]{10,70})/i);n=FO(n,k=>{w.set(k)},{tag:`axios-${Yc}-boundary`,boundary:W&&W[1]||void 0})}else if(H.isFormData(n)&&H.isFunction(n.getHeaders)&&n.getHeaders!==Object.prototype.getHeaders){if(w.set(n.getHeaders()),!w.hasContentLength())try{let W=await ZO.promisify(n.getLength).call(n);Number.isFinite(W)&&W>=0&&w.setContentLength(W)}catch{}}else if(H.isBlob(n)||H.isFile(n))n.size&&w.setContentType(n.type||"application/octet-stream"),w.setContentLength(n.size||0),n=Gr.Readable.from(x_(n));else if(n&&!H.isStream(n)){if(!Buffer.isBuffer(n))if(H.isArrayBuffer(n))n=Buffer.from(new Uint8Array(n));else if(H.isString(n))n=Buffer.from(n,"utf-8");else return r(new ge("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",ge.ERR_BAD_REQUEST,e));if(w.setContentLength(n.length,!1),e.maxBodyLength>-1&&n.length>e.maxBodyLength)return r(new ge("Request body larger than maxBodyLength limit",ge.ERR_BAD_REQUEST,e))}let P=H.toFiniteNumber(w.getContentLength());H.isArray(T)?(I=T[0],L=T[1]):I=L=T,n&&(S||I)&&(H.isStream(n)||(n=Gr.Readable.from(n,{objectMode:!1})),n=Gr.pipeline([n,new uf({maxRate:H.toFiniteNumber(I)})],H.noop),S&&n.on("progress",Gb(n,Jc(P,Ln(Qc(S),!1,3)))));let $,se=s("auth");if(se){let W=se.username||"",k=se.password||"";$=W+":"+k}if(!$&&C.username){let{username:W,password:k}=C;$=W+":"+k}$&&w.delete("authorization");let ee;try{ee=b_(C.pathname+C.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(W){let k=Error(W.message);return k.config=e,k.url=e.url,k.exists=!0,r(k)}w.set("Accept-Encoding","gzip, compress, deflate"+(dp?", br":""),!1);let pe=Object.assign(Object.create(null),{path:ee,method:h,headers:w.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:$,protocol:A,family:o,beforeRedirect:yM,beforeRedirects:Object.create(null),http2Options:c});if(!H.isUndefined(a)&&(pe.lookup=a),e.socketPath){if(typeof e.socketPath!="string")return r(new ge("socketPath must be a string",ge.ERR_BAD_OPTION_VALUE,e));if(e.allowedSocketPaths!=null){let W=Array.isArray(e.allowedSocketPaths)?e.allowedSocketPaths:[e.allowedSocketPaths],k=Fb(e.socketPath);if(!W.some(U=>typeof U=="string"&&Fb(U)===k))return r(new ge(`socketPath "${e.socketPath}" is not permitted by allowedSocketPaths`,ge.ERR_BAD_OPTION_VALUE,e))}pe.socketPath=e.socketPath}else pe.hostname=C.hostname.startsWith("[")?C.hostname.slice(1,-1):C.hostname,pe.port=C.port,XO(pe,e.proxy,A+"//"+C.hostname+(C.port?":"+C.port:"")+pe.path);let ne,oe=Kb.test(pe.protocol);if(pe.agent=oe?e.httpsAgent:e.httpAgent,E)ne=Xb;else{let W=s("transport");if(W)ne=W;else if(e.maxRedirects===0)ne=oe?_M:gM;else{e.maxRedirects&&(pe.maxRedirects=e.maxRedirects);let k=s("beforeRedirect");k&&(pe.beforeRedirects.config=k),ne=oe?Wb:zb}}if(e.maxBodyLength>-1?pe.maxBodyLength=e.maxBodyLength:pe.maxBodyLength=1/0,pe.insecureHTTPParser=!!s("insecureHTTPParser"),v=ne.request(pe,function(W){if(v.destroyed)return;let k=[W],U=H.toFiniteNumber(W.headers["content-length"]);if(x||L){let K=new uf({maxRate:H.toFiniteNumber(L)});x&&K.on("progress",Gb(K,Jc(U,Ln(Qc(x),!0,3)))),k.push(K)}let N=W,R=W.req||v;if(e.decompress!==!1&&W.headers["content-encoding"])switch((h==="HEAD"||W.statusCode===204)&&delete W.headers["content-encoding"],(W.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":k.push(Bi.createUnzip(up)),delete W.headers["content-encoding"];break;case"deflate":k.push(new BO),k.push(Bi.createUnzip(up)),delete W.headers["content-encoding"];break;case"br":dp&&(k.push(Bi.createBrotliDecompress(Hb)),delete W.headers["content-encoding"])}N=k.length>1?Gr.pipeline(k,H.noop):k[0];let M={status:W.statusCode,statusText:W.statusMessage,headers:new tr(W.headers),config:e,request:R};if(u==="stream"){if(e.maxContentLength>-1){let K=e.maxContentLength,J=N;async function*ae(){let xe=0;for await(let be of J){if(xe+=be.length,xe>K)throw new ge("maxContentLength size of "+K+" exceeded",ge.ERR_BAD_RESPONSE,e,R);yield be}}N=Gr.Readable.from(ae(),{objectMode:!1})}M.data=N,hn(t,r,M)}else{let K=[],J=0;N.on("data",function(ae){K.push(ae),J+=ae.length,e.maxContentLength>-1&&J>e.maxContentLength&&(_=!0,N.destroy(),m(new ge("maxContentLength size of "+e.maxContentLength+" exceeded",ge.ERR_BAD_RESPONSE,e,R)))}),N.on("aborted",function(){if(_)return;let ae=new ge("stream has been aborted",ge.ERR_BAD_RESPONSE,e,R);N.destroy(ae),r(ae)}),N.on("error",function(ae){v.destroyed||r(ge.from(ae,null,e,R))}),N.on("end",function(){try{let ae=K.length===1?K[0]:Buffer.concat(K);u!=="arraybuffer"&&(ae=ae.toString(p),(!p||p==="utf8")&&(ae=H.stripBOM(ae))),M.data=ae}catch(ae){return r(ge.from(ae,null,e,M.request,M))}hn(t,r,M)})}y.once("abort",K=>{N.destroyed||(N.emit("error",K),N.destroy())})}),y.once("abort",W=>{v.close?v.close():v.destroy(W)}),v.on("error",function(W){r(ge.from(W,null,e,v))}),v.on("socket",function(W){W.setKeepAlive(!0,6e4),!W[pp]&&(W.on("error",function(k){let U=W[Xa];U&&!U.destroyed&&U.destroy(k)}),W[pp]=!0),W[Xa]=v,v.once("close",function(){W[Xa]===v&&(W[Xa]=null)})}),e.timeout){let W=parseInt(e.timeout,10);if(Number.isNaN(W)){m(new ge("error trying to parse `config.timeout` to int",ge.ERR_BAD_OPTION_VALUE,e,v));return}v.setTimeout(W,function(){if(f)return;let k=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",U=e.transitional||ll;e.timeoutErrorMessage&&(k=e.timeoutErrorMessage),m(new ge(k,U.clarifyTimeoutError?ge.ETIMEDOUT:ge.ECONNABORTED,e,v))})}else v.setTimeout(0);if(H.isStream(n)){let W=!1,k=!1;n.on("end",()=>{W=!0}),n.once("error",N=>{k=!0,v.destroy(N)}),n.on("close",()=>{!W&&!k&&m(new Qi("Request stream has been aborted",e,v))});let U=n;if(e.maxBodyLength>-1&&e.maxRedirects===0){let N=e.maxBodyLength,R=0;U=Gr.pipeline([n,new Gr.Transform({transform(M,K,J){if(R+=M.length,R>N)return J(new ge("Request body larger than maxBodyLength limit",ge.ERR_BAD_REQUEST,e,v));J(null,M)}})],H.noop),U.on("error",M=>{v.destroyed||v.destroy(M)})}U.pipe(v)}else n&&v.write(n),v.end()})}}),JO,SM=Z(()=>{fi(),JO=ft.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ft.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0}),QO,CM=Z(()=>{ut(),fi(),QO=ft.hasStandardBrowserEnv?{write(e,t,r,i,s,n,a){if(typeof document>"u")return;let o=[`${e}=${encodeURIComponent(t)}`];H.isNumber(r)&&o.push(`expires=${new Date(r).toUTCString()}`),H.isString(i)&&o.push(`path=${i}`),H.isString(s)&&o.push(`domain=${s}`),n===!0&&o.push("secure"),H.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}}});function Ts(e,t){t=t||{};let r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(c,u,p,h){return H.isPlainObject(c)&&H.isPlainObject(u)?H.merge.call({caseless:h},c,u):H.isPlainObject(u)?H.merge({},u):H.isArray(u)?u.slice():u}function s(c,u,p,h){if(H.isUndefined(u)){if(!H.isUndefined(c))return i(void 0,c,p,h)}else return i(c,u,p,h)}function n(c,u){if(!H.isUndefined(u))return i(void 0,u)}function a(c,u){if(H.isUndefined(u)){if(!H.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function o(c,u,p){if(H.hasOwnProp(t,p))return i(c,u);if(H.hasOwnProp(e,p))return i(void 0,c)}let l={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:o,headers:(c,u,p)=>s(Yb(c),Yb(u),p,!0)};return H.forEach(Object.keys({...e,...t}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;let u=H.hasOwnProp(l,c)?l[c]:s,p=H.hasOwnProp(e,c)?e[c]:void 0,h=H.hasOwnProp(t,c)?t[c]:void 0,f=u(p,h,c);H.isUndefined(f)&&u!==o||(r[c]=f)}),r}var Yb=e=>e instanceof tr?{...e}:e,T_=Z(()=>{ut(),Ii()}),eA=e=>{let t=Ts({},e),r=h=>H.hasOwnProp(t,h)?t[h]:void 0,i=r("data"),s=r("withXSRFToken"),n=r("xsrfHeaderName"),a=r("xsrfCookieName"),o=r("headers"),l=r("auth"),c=r("baseURL"),u=r("allowAbsoluteUrls"),p=r("url");if(t.headers=o=tr.from(o),t.url=b_(O_(c,p,u),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),H.isFormData(i)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(H.isFunction(i.getHeaders)){let h=i.getHeaders(),f=["content-type","content-length"];Object.entries(h).forEach(([_,v])=>{f.includes(_.toLowerCase())&&o.set(_,v)})}}if(ft.hasStandardBrowserEnv&&(H.isFunction(s)&&(s=s(t)),s===!0||s==null&&JO(t.url))){let h=n&&a&&QO.read(a);h&&o.set(n,h)}return t},tA=Z(()=>{fi(),ut(),SM(),CM(),A_(),T_(),Ii(),E_()}),Jb,rA,OM=Z(()=>{ut(),C_(),Mu(),Fr(),na(),fi(),Ii(),k_(),tA(),Jb=typeof XMLHttpRequest<"u",rA=Jb&&function(e){return new Promise(function(t,r){let i=eA(e),s=i.data,n=tr.from(i.headers).normalize(),{responseType:a,onUploadProgress:o,onDownloadProgress:l}=i,c,u,p,h,f;function _(){h&&h(),f&&f(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function E(){if(!v)return;let m=tr.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),g={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:m,config:e,request:v};hn(function(b){t(b),_()},function(b){r(b),_()},g),v=null}"onloadend"in v?v.onloadend=E:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(E)},v.onabort=function(){v&&(r(new ge("Request aborted",ge.ECONNABORTED,e,v)),v=null)},v.onerror=function(m){let g=m&&m.message?m.message:"Network Error",b=new ge(g,ge.ERR_NETWORK,e,v);b.event=m||null,r(b),v=null},v.ontimeout=function(){let m=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",g=i.transitional||ll;i.timeoutErrorMessage&&(m=i.timeoutErrorMessage),r(new ge(m,g.clarifyTimeoutError?ge.ETIMEDOUT:ge.ECONNABORTED,e,v)),v=null},s===void 0&&n.setContentType(null),"setRequestHeader"in v&&H.forEach(n.toJSON(),function(m,g){v.setRequestHeader(g,m)}),H.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),l&&([p,f]=Ln(l,!0),v.addEventListener("progress",p)),o&&v.upload&&([u,h]=Ln(o),v.upload.addEventListener("progress",u),v.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(c=m=>{v&&(r(!m||m.type?new Qi(null,e,v):m),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));let y=NO(i.url);if(y&&ft.protocols.indexOf(y)===-1){r(new ge("Unsupported protocol "+y+":",ge.ERR_BAD_REQUEST,e));return}v.send(s||null)})}}),AM=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let i=new AbortController,s,n=function(c){if(!s){s=!0,o();let u=c instanceof Error?c:this.reason;i.abort(u instanceof ge?u:new Qi(u instanceof Error?u.message:u))}},a=t&&setTimeout(()=>{a=null,n(new ge(`timeout of ${t}ms exceeded`,ge.ETIMEDOUT))},t),o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(n):c.removeEventListener("abort",n)}),e=null)};e.forEach(c=>c.addEventListener("abort",n));let{signal:l}=i;return l.unsubscribe=()=>H.asap(o),l}},iA,xM=Z(()=>{na(),Fr(),ut(),iA=AM}),kM=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let i=0,s;for(;i<r;)s=i+t,yield e.slice(i,s),i=s},TM=async function*(e,t){for await(let r of RM(e))yield*kM(r,t)},RM=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:i}=await t.read();if(r)break;yield i}}finally{await t.cancel()}},Qb=(e,t,r,i)=>{let s=TM(e,t),n=0,a,o=l=>{a||(a=!0,i&&i(l))};return new ReadableStream({async pull(l){try{let{done:c,value:u}=await s.next();if(c){o(),l.close();return}let p=u.byteLength;if(r){let h=n+=p;r(h)}l.enqueue(new Uint8Array(u))}catch(c){throw o(c),c}},cancel(l){return o(l),s.return()}},{highWaterMark:2})},eE=65536,oo,sA,ff,mf,tE=(e,...t)=>{try{return!!e(...t)}catch{return!1}},DM=e=>{e=H.merge.call({skipUndefined:!0},sA,e);let{fetch:t,Request:r,Response:i}=e,s=t?oo(t):typeof fetch=="function",n=oo(r),a=oo(i);if(!s)return!1;let o=s&&oo(ff),l=s&&(typeof mf=="function"?(_=>v=>_.encode(v))(new mf):async _=>new Uint8Array(await new r(_).arrayBuffer())),c=n&&o&&tE(()=>{let _=!1,v=new r(ft.origin,{body:new ff,method:"POST",get duplex(){return _=!0,"half"}}),E=v.headers.has("Content-Type");return v.body!=null&&v.body.cancel(),_&&!E}),u=a&&o&&tE(()=>H.isReadableStream(new i("").body)),p={stream:u&&(_=>_.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(_=>{!p[_]&&(p[_]=(v,E)=>{let y=v&&v[_];if(y)return y.call(v);throw new ge(`Response type '${_}' is not supported`,ge.ERR_NOT_SUPPORT,E)})});let h=async _=>{if(_==null)return 0;if(H.isBlob(_))return _.size;if(H.isSpecCompliantForm(_))return(await new r(ft.origin,{method:"POST",body:_}).arrayBuffer()).byteLength;if(H.isArrayBufferView(_)||H.isArrayBuffer(_))return _.byteLength;if(H.isURLSearchParams(_)&&(_=_+""),H.isString(_))return(await l(_)).byteLength},f=async(_,v)=>{let E=H.toFiniteNumber(_.getContentLength());return E??h(v)};return async _=>{let{url:v,method:E,data:y,signal:m,cancelToken:g,timeout:b,onDownloadProgress:C,onUploadProgress:A,responseType:w,headers:S,withCredentials:x="same-origin",fetchOptions:T}=eA(_),I=t||fetch;w=w?(w+"").toLowerCase():"text";let L=iA([m,g&&g.toAbortSignal()],b),P=null,$=L&&L.unsubscribe&&(()=>{L.unsubscribe()}),se;try{if(A&&c&&E!=="get"&&E!=="head"&&(se=await f(S,y))!==0){let k=new r(v,{method:"POST",body:y,duplex:"half"}),U;if(H.isFormData(y)&&(U=k.headers.get("content-type"))&&S.setContentType(U),k.body){let[N,R]=Jc(se,Ln(Qc(A)));y=Qb(k.body,eE,N,R)}}H.isString(x)||(x=x?"include":"omit");let ee=n&&"credentials"in r.prototype;if(H.isFormData(y)){let k=S.getContentType();k&&/^multipart\/form-data/i.test(k)&&!/boundary=/i.test(k)&&S.delete("content-type")}let pe={...T,signal:L,method:E.toUpperCase(),headers:S.normalize().toJSON(),body:y,duplex:"half",credentials:ee?x:void 0};P=n&&new r(v,pe);let ne=await(n?I(P,T):I(v,pe)),oe=u&&(w==="stream"||w==="response");if(u&&(C||oe&&$)){let k={};["status","statusText","headers"].forEach(M=>{k[M]=ne[M]});let U=H.toFiniteNumber(ne.headers.get("content-length")),[N,R]=C&&Jc(U,Ln(Qc(C),!0))||[];ne=new i(Qb(ne.body,eE,N,()=>{R&&R(),$&&$()}),k)}w=w||"text";let W=await p[H.findKey(p,w)||"text"](ne,_);return!oe&&$&&$(),await new Promise((k,U)=>{hn(k,U,{data:W,headers:tr.from(ne.headers),status:ne.status,statusText:ne.statusText,config:_,request:P})})}catch(ee){throw $&&$(),ee&&ee.name==="TypeError"&&/Load failed|fetch/i.test(ee.message)?Object.assign(new ge("Network Error",ge.ERR_NETWORK,_,P,ee&&ee.response),{cause:ee.cause||ee}):ge.from(ee,ee&&ee.code,_,P,ee&&ee.response)}}},nA,aA=e=>{let t=e&&e.env||{},{fetch:r,Request:i,Response:s}=t,n=[i,s,r],a=n.length,o=a,l,c,u=nA;for(;o--;)l=n[o],c=u.get(l),c===void 0&&u.set(l,c=o?new Map:DM(t)),u=c;return c},IM,LM=Z(()=>{fi(),ut(),Fr(),xM(),Ii(),k_(),tA(),C_(),{isFunction:oo}=H,sA=(({Request:e,Response:t})=>({Request:e,Response:t}))(H.global),{ReadableStream:ff,TextEncoder:mf}=H.global,nA=new Map,IM=aA()});function PM(e,t){e=H.isArray(e)?e:[e];let{length:r}=e,i,s,n={};for(let a=0;a<r;a++){i=e[a];let o;if(s=i,!NM(i)&&(s=Cc[(o=String(i)).toLowerCase()],s===void 0))throw new ge(`Unknown adapter '${o}'`);if(s&&(H.isFunction(s)||(s=s.get(t))))break;n[o||"#"+a]=s}if(!s){let a=Object.entries(n).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build")),o=r?a.length>1?`since :
|
|
62
|
+
`+a.map(rE).join(`
|
|
63
|
+
`):" "+rE(a[0]):"as no adapter specified";throw new ge("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s}var Cc,rE=e=>`- ${e}`,NM=e=>H.isFunction(e)||e===null||e===!1,R_,oA=Z(()=>{ut(),wM(),OM(),LM(),Fr(),Cc={http:YO,xhr:rA,fetch:{get:aA}},H.forEach(Cc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}}),R_={getAdapter:PM,adapters:Cc}});function fp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qi(null,e)}function iE(e){return fp(e),e.headers=tr.from(e.headers),e.data=cp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),R_.getAdapter(e.adapter||Uu.adapter,e)(e).then(function(t){return fp(e),t.data=cp.call(e,e.transformResponse,t),t.headers=tr.from(t.headers),t},function(t){return IO(t)||(fp(e),t&&t.response&&(t.response.data=cp.call(e,e.transformResponse,t.response),t.response.headers=tr.from(t.response.headers))),Promise.reject(t)})}var MM=Z(()=>{IN(),S_(),na(),Ii(),oA()});function UM(e,t,r){if(typeof e!="object")throw new ge("options must be an object",ge.ERR_BAD_OPTION_VALUE);let i=Object.keys(e),s=i.length;for(;s-- >0;){let n=i[s],a=Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0;if(a){let o=e[n],l=o===void 0||a(o,n,e);if(l!==!0)throw new ge("option "+n+" must be "+l,ge.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ge("Unknown option "+n,ge.ERR_BAD_OPTION)}}var Ya,mp,Eo,$M=Z(()=>{Fr(),Ya={},["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ya[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}),mp={},Ya.transitional=function(e,t,r){function i(s,n){return"[Axios v"+Yc+"] Transitional option '"+s+"'"+n+(r?". "+r:"")}return(s,n,a)=>{if(e===!1)throw new ge(i(n," has been removed"+(t?" in "+t:"")),ge.ERR_DEPRECATED);return t&&!mp[n]&&(mp[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,n,a):!0}},Ya.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)},Eo={assertOptions:UM,validators:Ya}}),fn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new of,response:new of}}async request(t,r){try{return await this._request(t,r)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=Error();let n=(()=>{if(!s.stack)return"";let a=s.stack.indexOf(`
|
|
64
|
+
`);return a===-1?"":s.stack.slice(a+1)})();try{if(!i.stack)i.stack=n;else if(n){let a=n.indexOf(`
|
|
65
|
+
`),o=a===-1?-1:n.indexOf(`
|
|
66
|
+
`,a+1),l=o===-1?"":n.slice(o+1);String(i.stack).endsWith(l)||(i.stack+=`
|
|
67
|
+
`+n)}}catch{}}throw i}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ts(this.defaults,r);let{transitional:i,paramsSerializer:s,headers:n}=r;i!==void 0&&Eo.assertOptions(i,{silentJSONParsing:Er.transitional(Er.boolean),forcedJSONParsing:Er.transitional(Er.boolean),clarifyTimeoutError:Er.transitional(Er.boolean),legacyInterceptorReqResOrdering:Er.transitional(Er.boolean)},!1),s!=null&&(H.isFunction(s)?r.paramsSerializer={serialize:s}:Eo.assertOptions(s,{encode:Er.function,serialize:Er.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Eo.assertOptions(r,{baseUrl:Er.spelling("baseURL"),withXsrfToken:Er.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=n&&H.merge(n.common,n[r.method]);n&&H.forEach(["delete","get","head","post","put","patch","common"],_=>{delete n[_]}),r.headers=tr.concat(a,n);let o=[],l=!0;this.interceptors.request.forEach(function(_){if(typeof _.runWhen=="function"&&_.runWhen(r)===!1)return;l=l&&_.synchronous;let v=r.transitional||ll;v&&v.legacyInterceptorReqResOrdering?o.unshift(_.fulfilled,_.rejected):o.push(_.fulfilled,_.rejected)});let c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let u,p=0,h;if(!l){let _=[iE.bind(this),void 0];for(_.unshift(...o),_.push(...c),h=_.length,u=Promise.resolve(r);p<h;)u=u.then(_[p++],_[p++]);return u}h=o.length;let f=r;for(;p<h;){let _=o[p++],v=o[p++];try{f=_(f)}catch(E){v.call(this,E);break}}try{u=iE.call(this,f)}catch(_){return Promise.reject(_)}for(p=0,h=c.length;p<h;)u=u.then(c[p++],c[p++]);return u}getUri(t){t=Ts(this.defaults,t);let r=O_(t.baseURL,t.url,t.allowAbsoluteUrls);return b_(r,t.params,t.paramsSerializer)}},Er,wo,jM=Z(()=>{ut(),E_(),dN(),MM(),T_(),A_(),$M(),Ii(),Mu(),Er=Eo.validators,H.forEach(["delete","get","head","options"],function(e){fn.prototype[e]=function(t,r){return this.request(Ts(r||{},{method:e,url:t,data:(r||{}).data}))}}),H.forEach(["post","put","patch"],function(e){function t(r){return function(i,s,n){return this.request(Ts(n||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}fn.prototype[e]=t(),fn.prototype[e+"Form"]=t(!0)}),wo=fn}),gf=class e{constructor(t){if(typeof t!="function")throw TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});let i=this;this.promise.then(s=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](s);i._listeners=null}),this.promise.then=s=>{let n,a=new Promise(o=>{i.subscribe(o),n=o}).then(s);return a.cancel=function(){i.unsubscribe(n)},a},t(function(s,n,a){i.reason||(i.reason=new Qi(s,n,a),r(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=i=>{t.abort(i)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(r){t=r}),cancel:t}}},lA,FM=Z(()=>{na(),lA=gf});function BM(e){return function(t){return e.apply(null,t)}}function HM(e){return H.isObject(e)&&e.isAxiosError===!0}var zM=Z(()=>{ut()}),tc,cA,WM=Z(()=>{tc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526},Object.entries(tc).forEach(([e,t])=>{tc[t]=e}),cA=tc});function uA(e){let t=new wo(e),r=rO(wo.prototype.request,t);return H.extend(r,wo.prototype,t,{allOwnKeys:!0}),H.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return uA(Ts(e,i))},r}var wt,gs,KM=Z(()=>{ut(),jM(),T_(),S_(),TO(),na(),FM(),Nu(),Fr(),zM(),Ii(),oA(),WM(),wt=uA(Uu),wt.Axios=wo,wt.CanceledError=Qi,wt.CancelToken=lA,wt.isCancel=IO,wt.VERSION=Yc,wt.toFormData=ol,wt.AxiosError=ge,wt.Cancel=wt.CanceledError,wt.all=function(e){return Promise.all(e)},wt.spread=BM,wt.isAxiosError=HM,wt.mergeConfig=Ts,wt.AxiosHeaders=tr,wt.formToJSON=e=>w_(H.isHTMLForm(e)?new FormData(e):e),wt.getAdapter=R_.getAdapter,wt.HttpStatusCode=cA,wt.default=wt,gs=wt}),dA=Z(()=>{KM()});function GM(e){let t,r=e.startsWith("//")?`https:${e}`:e;try{t=new URL(r).hostname}catch{t=e.match(/^[^/:]+/)?.[0]??e}return t.endsWith(".")?t.slice(0,-1):t}function qM(e){return pA.test(GM(e))}var pA,VM=Z(()=>{pA=/(^|\.)(anthropic\.com|claude\.ai|claude\.com)$/i}),rs=j(function(e,t){var r=["nodebuffer","arraybuffer","fragments"],i=typeof Blob<"u";i&&r.push("blob"),t.exports={BINARY_TYPES:r,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:i,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}}),$u=j(function(e,t){var{EMPTY_BUFFER:r}=rs(),i=Buffer[Symbol.species];function s(c,u){if(c.length===0)return r;if(c.length===1)return c[0];let p=Buffer.allocUnsafe(u),h=0;for(let f=0;f<c.length;f++){let _=c[f];p.set(_,h),h+=_.length}return h<u?new i(p.buffer,p.byteOffset,h):p}function n(c,u,p,h,f){for(let _=0;_<f;_++)p[h+_]=c[_]^u[_&3]}function a(c,u){for(let p=0;p<c.length;p++)c[p]^=u[p&3]}function o(c){return c.length===c.buffer.byteLength?c.buffer:c.buffer.slice(c.byteOffset,c.byteOffset+c.length)}function l(c){if(l.readOnly=!0,Buffer.isBuffer(c))return c;let u;return c instanceof ArrayBuffer?u=new i(c):ArrayBuffer.isView(c)?u=new i(c.buffer,c.byteOffset,c.byteLength):(u=Buffer.from(c),l.readOnly=!1),u}if(t.exports={concat:s,mask:n,toArrayBuffer:o,toBuffer:l,unmask:a},!process.env.WS_NO_BUFFER_UTIL)try{let c=(()=>{throw new Error("Cannot require module bufferutil")})();t.exports.mask=function(u,p,h,f,_){_<48?n(u,p,h,f,_):c.mask(u,p,h,f,_)},t.exports.unmask=function(u,p){u.length<32?a(u,p):c.unmask(u,p)}}catch{}}),ZM=j(function(e,t){var r=Symbol("kDone"),i=Symbol("kRun");class s{constructor(a){this[r]=()=>{this.pending--,this[i]()},this.concurrency=a||1/0,this.jobs=[],this.pending=0}add(a){this.jobs.push(a),this[i]()}[i](){if(this.pending!==this.concurrency&&this.jobs.length){let a=this.jobs.shift();this.pending++,a(this[r])}}}t.exports=s}),cl=j(function(e,t){var r=Me("zlib"),i=$u(),s=ZM(),{kStatusCode:n}=rs(),a=Buffer[Symbol.species],o=Buffer.from([0,0,255,255]),l=Symbol("permessage-deflate"),c=Symbol("total-length"),u=Symbol("callback"),p=Symbol("buffers"),h=Symbol("error"),f;class _{constructor(g){if(this._options=g||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!f){let b=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;f=new s(b)}}static get extensionName(){return"permessage-deflate"}offer(){let g={};return this._options.serverNoContextTakeover&&(g.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(g.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(g.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?g.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(g.client_max_window_bits=!0),g}accept(g){return g=this.normalizeParams(g),this.params=this._isServer?this.acceptAsServer(g):this.acceptAsClient(g),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let g=this._deflate[u];this._deflate.close(),this._deflate=null,g&&g(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(g){let b=this._options,C=g.find(A=>!(b.serverNoContextTakeover===!1&&A.server_no_context_takeover||A.server_max_window_bits&&(b.serverMaxWindowBits===!1||typeof b.serverMaxWindowBits=="number"&&b.serverMaxWindowBits>A.server_max_window_bits)||typeof b.clientMaxWindowBits=="number"&&!A.client_max_window_bits));if(!C)throw Error("None of the extension offers can be accepted");return b.serverNoContextTakeover&&(C.server_no_context_takeover=!0),b.clientNoContextTakeover&&(C.client_no_context_takeover=!0),typeof b.serverMaxWindowBits=="number"&&(C.server_max_window_bits=b.serverMaxWindowBits),typeof b.clientMaxWindowBits=="number"?C.client_max_window_bits=b.clientMaxWindowBits:(C.client_max_window_bits===!0||b.clientMaxWindowBits===!1)&&delete C.client_max_window_bits,C}acceptAsClient(g){let b=g[0];if(this._options.clientNoContextTakeover===!1&&b.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!b.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(b.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&b.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return b}normalizeParams(g){return g.forEach(b=>{Object.keys(b).forEach(C=>{let A=b[C];if(A.length>1)throw Error(`Parameter "${C}" must have only a single value`);if(A=A[0],C==="client_max_window_bits"){if(A!==!0){let w=+A;if(!Number.isInteger(w)||w<8||w>15)throw TypeError(`Invalid value for parameter "${C}": ${A}`);A=w}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${C}": ${A}`)}else if(C==="server_max_window_bits"){let w=+A;if(!Number.isInteger(w)||w<8||w>15)throw TypeError(`Invalid value for parameter "${C}": ${A}`);A=w}else if(C==="client_no_context_takeover"||C==="server_no_context_takeover"){if(A!==!0)throw TypeError(`Invalid value for parameter "${C}": ${A}`)}else throw Error(`Unknown parameter "${C}"`);b[C]=A})}),g}decompress(g,b,C){f.add(A=>{this._decompress(g,b,(w,S)=>{A(),C(w,S)})})}compress(g,b,C){f.add(A=>{this._compress(g,b,(w,S)=>{A(),C(w,S)})})}_decompress(g,b,C){let A=this._isServer?"client":"server";if(!this._inflate){let w=`${A}_max_window_bits`,S=typeof this.params[w]!="number"?r.Z_DEFAULT_WINDOWBITS:this.params[w];this._inflate=r.createInflateRaw({...this._options.zlibInflateOptions,windowBits:S}),this._inflate[l]=this,this._inflate[c]=0,this._inflate[p]=[],this._inflate.on("error",y),this._inflate.on("data",E)}this._inflate[u]=C,this._inflate.write(g),b&&this._inflate.write(o),this._inflate.flush(()=>{let w=this._inflate[h];if(w){this._inflate.close(),this._inflate=null,C(w);return}let S=i.concat(this._inflate[p],this._inflate[c]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[c]=0,this._inflate[p]=[],b&&this.params[`${A}_no_context_takeover`]&&this._inflate.reset()),C(null,S)})}_compress(g,b,C){let A=this._isServer?"server":"client";if(!this._deflate){let w=`${A}_max_window_bits`,S=typeof this.params[w]!="number"?r.Z_DEFAULT_WINDOWBITS:this.params[w];this._deflate=r.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:S}),this._deflate[c]=0,this._deflate[p]=[],this._deflate.on("data",v)}this._deflate[u]=C,this._deflate.write(g),this._deflate.flush(r.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let w=i.concat(this._deflate[p],this._deflate[c]);b&&(w=new a(w.buffer,w.byteOffset,w.length-4)),this._deflate[u]=null,this._deflate[c]=0,this._deflate[p]=[],b&&this.params[`${A}_no_context_takeover`]&&this._deflate.reset(),C(null,w)})}}t.exports=_;function v(m){this[p].push(m),this[c]+=m.length}function E(m){if(this[c]+=m.length,this[l]._maxPayload<1||this[c]<=this[l]._maxPayload){this[p].push(m);return}this[h]=RangeError("Max payload size exceeded"),this[h].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[h][n]=1009,this.removeListener("data",E),this.reset()}function y(m){if(this[l]._inflate=null,this[h]){this[u](this[h]);return}m[n]=1007,this[u](m)}}),ul=j(function(e,t){var{isUtf8:r}=Me("buffer"),{hasBlob:i}=rs(),s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function n(l){return l>=1e3&&l<=1014&&l!==1004&&l!==1005&&l!==1006||l>=3e3&&l<=4999}function a(l){let c=l.length,u=0;for(;u<c;)if((l[u]&128)===0)u++;else if((l[u]&224)===192){if(u+1===c||(l[u+1]&192)!==128||(l[u]&254)===192)return!1;u+=2}else if((l[u]&240)===224){if(u+2>=c||(l[u+1]&192)!==128||(l[u+2]&192)!==128||l[u]===224&&(l[u+1]&224)===128||l[u]===237&&(l[u+1]&224)===160)return!1;u+=3}else if((l[u]&248)===240){if(u+3>=c||(l[u+1]&192)!==128||(l[u+2]&192)!==128||(l[u+3]&192)!==128||l[u]===240&&(l[u+1]&240)===128||l[u]===244&&l[u+1]>143||l[u]>244)return!1;u+=4}else return!1;return!0}function o(l){return i&&typeof l=="object"&&typeof l.arrayBuffer=="function"&&typeof l.type=="string"&&typeof l.stream=="function"&&(l[Symbol.toStringTag]==="Blob"||l[Symbol.toStringTag]==="File")}if(t.exports={isBlob:o,isValidStatusCode:n,isValidUTF8:a,tokenChars:s},r)t.exports.isValidUTF8=function(l){return l.length<24?a(l):r(l)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let l=(()=>{throw new Error("Cannot require module utf-8-validate")})();t.exports.isValidUTF8=function(c){return c.length<32?a(c):l(c)}}catch{}}),hA=j(function(e,t){var{Writable:r}=Me("stream"),i=cl(),{BINARY_TYPES:s,EMPTY_BUFFER:n,kStatusCode:a,kWebSocket:o}=rs(),{concat:l,toArrayBuffer:c,unmask:u}=$u(),{isValidStatusCode:p,isValidUTF8:h}=ul(),f=Buffer[Symbol.species];class _ extends r{constructor(E={}){super(),this._allowSynchronousEvents=E.allowSynchronousEvents!==void 0?E.allowSynchronousEvents:!0,this._binaryType=E.binaryType||s[0],this._extensions=E.extensions||{},this._isServer=!!E.isServer,this._maxBufferedChunks=E.maxBufferedChunks|0,this._maxFragments=E.maxFragments|0,this._maxPayload=E.maxPayload|0,this._skipUTF8Validation=!!E.skipUTF8Validation,this[o]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(E,y,m){if(this._opcode===8&&this._state==0)return m();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){m(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=E.length,this._buffers.push(E),this.startLoop(m)}consume(E){if(this._bufferedBytes-=E,E===this._buffers[0].length)return this._buffers.shift();if(E<this._buffers[0].length){let m=this._buffers[0];return this._buffers[0]=new f(m.buffer,m.byteOffset+E,m.length-E),new f(m.buffer,m.byteOffset,E)}let y=Buffer.allocUnsafe(E);do{let m=this._buffers[0],g=y.length-E;E>=m.length?y.set(this._buffers.shift(),g):(y.set(new Uint8Array(m.buffer,m.byteOffset,E),g),this._buffers[0]=new f(m.buffer,m.byteOffset+E,m.length-E)),E-=m.length}while(E>0);return y}startLoop(E){this._loop=!0;do switch(this._state){case 0:this.getInfo(E);break;case 1:this.getPayloadLength16(E);break;case 2:this.getPayloadLength64(E);break;case 3:this.getMask();break;case 4:this.getData(E);break;case 5:case 6:this._loop=!1;return}while(this._loop);this._errored||E()}getInfo(E){if(this._bufferedBytes<2){this._loop=!1;return}let y=this.consume(2);if((y[0]&48)!==0){let g=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");E(g);return}let m=(y[0]&64)===64;if(m&&!this._extensions[i.extensionName]){let g=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");E(g);return}if(this._fin=(y[0]&128)===128,this._opcode=y[0]&15,this._payloadLength=y[1]&127,this._opcode===0){if(m){let g=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");E(g);return}if(!this._fragmented){let g=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");E(g);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let g=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");E(g);return}this._compressed=m}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let g=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");E(g);return}if(m){let g=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");E(g);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let g=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");E(g);return}}else{let g=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");E(g);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(y[1]&128)===128,this._isServer){if(!this._masked){let g=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");E(g);return}}else if(this._masked){let g=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");E(g);return}this._payloadLength===126?this._state=1:this._payloadLength===127?this._state=2:this.haveLength(E)}getPayloadLength16(E){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(E)}getPayloadLength64(E){if(this._bufferedBytes<8){this._loop=!1;return}let y=this.consume(8),m=y.readUInt32BE(0);if(m>Math.pow(2,21)-1){let g=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");E(g);return}this._payloadLength=m*Math.pow(2,32)+y.readUInt32BE(4),this.haveLength(E)}haveLength(E){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let y=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");E(y);return}this._masked?this._state=3:this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(E){let y=n;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}y=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&u(y,this._mask)}if(this._opcode>7){this.controlMessage(y,E);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let m=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");E(m);return}if(this._compressed){this._state=5,this.decompress(y,E);return}y.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(y)),this.dataMessage(E)}decompress(E,y){this._extensions[i.extensionName].decompress(E,this._fin,(m,g)=>{if(m)return y(m);if(g.length){if(this._messageLength+=g.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let b=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");y(b);return}this._fragments.push(g)}this.dataMessage(y),this._state===0&&this.startLoop(y)})}dataMessage(E){if(!this._fin){this._state=0;return}let y=this._messageLength,m=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let g;this._binaryType==="nodebuffer"?g=l(m,y):this._binaryType==="arraybuffer"?g=c(l(m,y)):this._binaryType==="blob"?g=new Blob(m):g=m,this._allowSynchronousEvents?(this.emit("message",g,!0),this._state=0):(this._state=6,setImmediate(()=>{this.emit("message",g,!0),this._state=0,this.startLoop(E)}))}else{let g=l(m,y);if(!this._skipUTF8Validation&&!h(g)){let b=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");E(b);return}this._state===5||this._allowSynchronousEvents?(this.emit("message",g,!1),this._state=0):(this._state=6,setImmediate(()=>{this.emit("message",g,!1),this._state=0,this.startLoop(E)}))}}controlMessage(E,y){if(this._opcode===8){if(E.length===0)this._loop=!1,this.emit("conclude",1005,n),this.end();else{let m=E.readUInt16BE(0);if(!p(m)){let b=this.createError(RangeError,`invalid status code ${m}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");y(b);return}let g=new f(E.buffer,E.byteOffset+2,E.length-2);if(!this._skipUTF8Validation&&!h(g)){let b=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");y(b);return}this._loop=!1,this.emit("conclude",m,g),this.end()}this._state=0;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",E),this._state=0):(this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",E),this._state=0,this.startLoop(y)}))}createError(E,y,m,g,b){this._loop=!1,this._errored=!0;let C=new E(m?`Invalid WebSocket frame: ${y}`:y);return Error.captureStackTrace(C,this.createError),C.code=b,C[a]=g,C}}t.exports=_}),fA=j(function(e,t){var{Duplex:r}=Me("stream"),{randomFillSync:i}=Me("crypto"),{types:{isUint8Array:s}}=Me("util"),n=cl(),{EMPTY_BUFFER:a,kWebSocket:o,NOOP:l}=rs(),{isBlob:c,isValidStatusCode:u}=ul(),{mask:p,toBuffer:h}=$u(),f=Symbol("kByteLength"),_=Buffer.alloc(4),v,E=8192,y=0,m=1,g=2;class b{constructor(S,x,T){this._extensions=x||{},T&&(this._generateMask=T,this._maskBuffer=Buffer.alloc(4)),this._socket=S,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=y,this.onerror=l,this[o]=void 0}static frame(S,x){let T,I=!1,L=2,P=!1;x.mask&&(T=x.maskBuffer||_,x.generateMask?x.generateMask(T):(E===8192&&(v===void 0&&(v=Buffer.alloc(8192)),i(v,0,8192),E=0),T[0]=v[E++],T[1]=v[E++],T[2]=v[E++],T[3]=v[E++]),P=(T[0]|T[1]|T[2]|T[3])===0,L=6);let $;typeof S=="string"?(!x.mask||P)&&x[f]!==void 0?$=x[f]:(S=Buffer.from(S),$=S.length):($=S.length,I=x.mask&&x.readOnly&&!P);let se=$;$>=65536?(L+=8,se=127):$>125&&(L+=2,se=126);let ee=Buffer.allocUnsafe(I?$+L:L);return ee[0]=x.fin?x.opcode|128:x.opcode,x.rsv1&&(ee[0]|=64),ee[1]=se,se===126?ee.writeUInt16BE($,2):se===127&&(ee[2]=ee[3]=0,ee.writeUIntBE($,4,6)),x.mask?(ee[1]|=128,ee[L-4]=T[0],ee[L-3]=T[1],ee[L-2]=T[2],ee[L-1]=T[3],P?[ee,S]:I?(p(S,T,ee,L,$),[ee]):(p(S,T,S,0,$),[ee,S])):[ee,S]}close(S,x,T,I){let L;if(S===void 0)L=a;else{if(typeof S!="number"||!u(S))throw TypeError("First argument must be a valid error code number");if(x===void 0||!x.length)L=Buffer.allocUnsafe(2),L.writeUInt16BE(S,0);else{let $=Buffer.byteLength(x);if($>123)throw RangeError("The message must not be greater than 123 bytes");if(L=Buffer.allocUnsafe(2+$),L.writeUInt16BE(S,0),typeof x=="string")L.write(x,2);else if(s(x))L.set(x,2);else throw TypeError("Second argument must be a string or a Uint8Array")}}let P={[f]:L.length,fin:!0,generateMask:this._generateMask,mask:T,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==y?this.enqueue([this.dispatch,L,!1,P,I]):this.sendFrame(b.frame(L,P),I)}ping(S,x,T){let I,L;if(typeof S=="string"?(I=Buffer.byteLength(S),L=!1):c(S)?(I=S.size,L=!1):(S=h(S),I=S.length,L=h.readOnly),I>125)throw RangeError("The data size must not be greater than 125 bytes");let P={[f]:I,fin:!0,generateMask:this._generateMask,mask:x,maskBuffer:this._maskBuffer,opcode:9,readOnly:L,rsv1:!1};c(S)?this._state!==y?this.enqueue([this.getBlobData,S,!1,P,T]):this.getBlobData(S,!1,P,T):this._state!==y?this.enqueue([this.dispatch,S,!1,P,T]):this.sendFrame(b.frame(S,P),T)}pong(S,x,T){let I,L;if(typeof S=="string"?(I=Buffer.byteLength(S),L=!1):c(S)?(I=S.size,L=!1):(S=h(S),I=S.length,L=h.readOnly),I>125)throw RangeError("The data size must not be greater than 125 bytes");let P={[f]:I,fin:!0,generateMask:this._generateMask,mask:x,maskBuffer:this._maskBuffer,opcode:10,readOnly:L,rsv1:!1};c(S)?this._state!==y?this.enqueue([this.getBlobData,S,!1,P,T]):this.getBlobData(S,!1,P,T):this._state!==y?this.enqueue([this.dispatch,S,!1,P,T]):this.sendFrame(b.frame(S,P),T)}send(S,x,T){let I=this._extensions[n.extensionName],L=x.binary?2:1,P=x.compress,$,se;typeof S=="string"?($=Buffer.byteLength(S),se=!1):c(S)?($=S.size,se=!1):(S=h(S),$=S.length,se=h.readOnly),this._firstFragment?(this._firstFragment=!1,P&&I&&I.params[I._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(P=$>=I._threshold),this._compress=P):(P=!1,L=0),x.fin&&(this._firstFragment=!0);let ee={[f]:$,fin:x.fin,generateMask:this._generateMask,mask:x.mask,maskBuffer:this._maskBuffer,opcode:L,readOnly:se,rsv1:P};c(S)?this._state!==y?this.enqueue([this.getBlobData,S,this._compress,ee,T]):this.getBlobData(S,this._compress,ee,T):this._state!==y?this.enqueue([this.dispatch,S,this._compress,ee,T]):this.dispatch(S,this._compress,ee,T)}getBlobData(S,x,T,I){this._bufferedBytes+=T[f],this._state=g,S.arrayBuffer().then(L=>{if(this._socket.destroyed){let $=Error("The socket was closed while the blob was being read");process.nextTick(C,this,$,I);return}this._bufferedBytes-=T[f];let P=h(L);x?this.dispatch(P,x,T,I):(this._state=y,this.sendFrame(b.frame(P,T),I),this.dequeue())}).catch(L=>{process.nextTick(A,this,L,I)})}dispatch(S,x,T,I){if(!x){this.sendFrame(b.frame(S,T),I);return}let L=this._extensions[n.extensionName];this._bufferedBytes+=T[f],this._state=m,L.compress(S,T.fin,(P,$)=>{if(this._socket.destroyed){let se=Error("The socket was closed while data was being compressed");C(this,se,I);return}this._bufferedBytes-=T[f],this._state=y,T.readOnly=!1,this.sendFrame(b.frame($,T),I),this.dequeue()})}dequeue(){for(;this._state===y&&this._queue.length;){let S=this._queue.shift();this._bufferedBytes-=S[3][f],Reflect.apply(S[0],this,S.slice(1))}}enqueue(S){this._bufferedBytes+=S[3][f],this._queue.push(S)}sendFrame(S,x){S.length===2?(this._socket.cork(),this._socket.write(S[0]),this._socket.write(S[1],x),this._socket.uncork()):this._socket.write(S[0],x)}}t.exports=b;function C(w,S,x){typeof x=="function"&&x(S);for(let T=0;T<w._queue.length;T++){let I=w._queue[T],L=I[I.length-1];typeof L=="function"&&L(S)}}function A(w,S,x){C(w,S,x),w.onerror(S)}}),XM=j(function(e,t){var{kForOnEventAttribute:r,kListener:i}=rs(),s=Symbol("kCode"),n=Symbol("kData"),a=Symbol("kError"),o=Symbol("kMessage"),l=Symbol("kReason"),c=Symbol("kTarget"),u=Symbol("kType"),p=Symbol("kWasClean");class h{constructor(g){this[c]=null,this[u]=g}get target(){return this[c]}get type(){return this[u]}}Object.defineProperty(h.prototype,"target",{enumerable:!0}),Object.defineProperty(h.prototype,"type",{enumerable:!0});class f extends h{constructor(g,b={}){super(g),this[s]=b.code===void 0?0:b.code,this[l]=b.reason===void 0?"":b.reason,this[p]=b.wasClean===void 0?!1:b.wasClean}get code(){return this[s]}get reason(){return this[l]}get wasClean(){return this[p]}}Object.defineProperty(f.prototype,"code",{enumerable:!0}),Object.defineProperty(f.prototype,"reason",{enumerable:!0}),Object.defineProperty(f.prototype,"wasClean",{enumerable:!0});class _ extends h{constructor(g,b={}){super(g),this[a]=b.error===void 0?null:b.error,this[o]=b.message===void 0?"":b.message}get error(){return this[a]}get message(){return this[o]}}Object.defineProperty(_.prototype,"error",{enumerable:!0}),Object.defineProperty(_.prototype,"message",{enumerable:!0});class v extends h{constructor(g,b={}){super(g),this[n]=b.data===void 0?null:b.data}get data(){return this[n]}}Object.defineProperty(v.prototype,"data",{enumerable:!0});var E={addEventListener(m,g,b={}){for(let A of this.listeners(m))if(!b[r]&&A[i]===g&&!A[r])return;let C;if(m==="message")C=function(A,w){let S=new v("message",{data:w?A:A.toString()});S[c]=this,y(g,this,S)};else if(m==="close")C=function(A,w){let S=new f("close",{code:A,reason:w.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});S[c]=this,y(g,this,S)};else if(m==="error")C=function(A){let w=new _("error",{error:A,message:A.message});w[c]=this,y(g,this,w)};else if(m==="open")C=function(){let A=new h("open");A[c]=this,y(g,this,A)};else return;C[r]=!!b[r],C[i]=g,b.once?this.once(m,C):this.on(m,C)},removeEventListener(m,g){for(let b of this.listeners(m))if(b[i]===g&&!b[r]){this.removeListener(m,b);break}}};t.exports={CloseEvent:f,ErrorEvent:_,Event:h,EventTarget:E,MessageEvent:v};function y(m,g,b){typeof m=="object"&&m.handleEvent?m.handleEvent.call(m,b):m.call(g,b)}}),D_=j(function(e,t){var{tokenChars:r}=ul();function i(a,o,l){a[o]===void 0?a[o]=[l]:a[o].push(l)}function s(a){let o=Object.create(null),l=Object.create(null),c=!1,u=!1,p=!1,h,f,_=-1,v=-1,E=-1,y=0;for(;y<a.length;y++)if(v=a.charCodeAt(y),h===void 0)if(E===-1&&r[v]===1)_===-1&&(_=y);else if(y!==0&&(v===32||v===9))E===-1&&_!==-1&&(E=y);else if(v===59||v===44){if(_===-1)throw SyntaxError(`Unexpected character at index ${y}`);E===-1&&(E=y);let g=a.slice(_,E);v===44?(i(o,g,l),l=Object.create(null)):h=g,_=E=-1}else throw SyntaxError(`Unexpected character at index ${y}`);else if(f===void 0)if(E===-1&&r[v]===1)_===-1&&(_=y);else if(v===32||v===9)E===-1&&_!==-1&&(E=y);else if(v===59||v===44){if(_===-1)throw SyntaxError(`Unexpected character at index ${y}`);E===-1&&(E=y),i(l,a.slice(_,E),!0),v===44&&(i(o,h,l),l=Object.create(null),h=void 0),_=E=-1}else if(v===61&&_!==-1&&E===-1)f=a.slice(_,y),_=E=-1;else throw SyntaxError(`Unexpected character at index ${y}`);else if(u){if(r[v]!==1)throw SyntaxError(`Unexpected character at index ${y}`);_===-1?_=y:c||(c=!0),u=!1}else if(p)if(r[v]===1)_===-1&&(_=y);else if(v===34&&_!==-1)p=!1,E=y;else if(v===92)u=!0;else throw SyntaxError(`Unexpected character at index ${y}`);else if(v===34&&a.charCodeAt(y-1)===61)p=!0;else if(E===-1&&r[v]===1)_===-1&&(_=y);else if(_!==-1&&(v===32||v===9))E===-1&&(E=y);else if(v===59||v===44){if(_===-1)throw SyntaxError(`Unexpected character at index ${y}`);E===-1&&(E=y);let g=a.slice(_,E);c&&(g=g.replace(/\\/g,""),c=!1),i(l,f,g),v===44&&(i(o,h,l),l=Object.create(null),h=void 0),f=void 0,_=E=-1}else throw SyntaxError(`Unexpected character at index ${y}`);if(_===-1||p||v===32||v===9)throw SyntaxError("Unexpected end of input");E===-1&&(E=y);let m=a.slice(_,E);return h===void 0?i(o,m,l):(f===void 0?i(l,m,!0):c?i(l,f,m.replace(/\\/g,"")):i(l,f,m),i(o,h,l)),o}function n(a){return Object.keys(a).map(o=>{let l=a[o];return Array.isArray(l)||(l=[l]),l.map(c=>[o].concat(Object.keys(c).map(u=>{let p=c[u];return Array.isArray(p)||(p=[p]),p.map(h=>h===!0?u:`${u}=${h}`).join("; ")})).join("; ")).join(", ")}).join(", ")}t.exports={format:n,parse:s}}),I_=j(function(e,t){var r=Me("events"),i=Me("https"),s=Me("http"),n=Me("net"),a=Me("tls"),{randomBytes:o,createHash:l}=Me("crypto"),{Duplex:c,Readable:u}=Me("stream"),{URL:p}=Me("url"),h=cl(),f=hA(),_=fA(),{isBlob:v}=ul(),{BINARY_TYPES:E,CLOSE_TIMEOUT:y,EMPTY_BUFFER:m,GUID:g,kForOnEventAttribute:b,kListener:C,kStatusCode:A,kWebSocket:w,NOOP:S}=rs(),{EventTarget:{addEventListener:x,removeEventListener:T}}=XM(),{format:I,parse:L}=D_(),{toBuffer:P}=$u(),$=Symbol("kAborted"),se=[8,13],ee=["CONNECTING","OPEN","CLOSING","CLOSED"],pe=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class ne extends r{constructor(te,he,ve){super(),this._binaryType=E[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=m,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=ne.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,te!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,he===void 0?he=[]:Array.isArray(he)||(typeof he=="object"&&he!==null?(ve=he,he=[]):he=[he]),oe(this,te,he,ve)):(this._autoPong=ve.autoPong,this._closeTimeout=ve.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(te){E.includes(te)&&(this._binaryType=te,this._receiver&&(this._receiver._binaryType=te))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(te,he,ve){let fe=new f({allowSynchronousEvents:ve.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:ve.maxBufferedChunks,maxFragments:ve.maxFragments,maxPayload:ve.maxPayload,skipUTF8Validation:ve.skipUTF8Validation}),De=new _(te,this._extensions,ve.generateMask);this._receiver=fe,this._sender=De,this._socket=te,fe[w]=this,De[w]=this,te[w]=this,fe.on("conclude",M),fe.on("drain",K),fe.on("error",J),fe.on("message",xe),fe.on("ping",be),fe.on("pong",_e),De.onerror=z,te.setTimeout&&te.setTimeout(0),te.setNoDelay&&te.setNoDelay(),he.length>0&&te.unshift(he),te.on("close",ce),te.on("data",Se),te.on("end",Te),te.on("error",Qe),this._readyState=ne.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=ne.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[h.extensionName]&&this._extensions[h.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=ne.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(te,he){if(this.readyState!==ne.CLOSED){if(this.readyState===ne.CONNECTING){N(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===ne.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=ne.CLOSING,this._sender.close(te,he,!this._isServer,ve=>{ve||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Q(this)}}pause(){this.readyState===ne.CONNECTING||this.readyState===ne.CLOSED||(this._paused=!0,this._socket.pause())}ping(te,he,ve){if(this.readyState===ne.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof te=="function"?(ve=te,te=he=void 0):typeof he=="function"&&(ve=he,he=void 0),typeof te=="number"&&(te=te.toString()),this.readyState!==ne.OPEN){R(this,te,ve);return}he===void 0&&(he=!this._isServer),this._sender.ping(te||m,he,ve)}pong(te,he,ve){if(this.readyState===ne.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof te=="function"?(ve=te,te=he=void 0):typeof he=="function"&&(ve=he,he=void 0),typeof te=="number"&&(te=te.toString()),this.readyState!==ne.OPEN){R(this,te,ve);return}he===void 0&&(he=!this._isServer),this._sender.pong(te||m,he,ve)}resume(){this.readyState===ne.CONNECTING||this.readyState===ne.CLOSED||(this._paused=!1,!this._receiver._writableState.needDrain&&this._socket.resume())}send(te,he,ve){if(this.readyState===ne.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof he=="function"&&(ve=he,he={}),typeof te=="number"&&(te=te.toString()),this.readyState!==ne.OPEN){R(this,te,ve);return}let fe={binary:typeof te!="string",mask:!this._isServer,compress:!0,fin:!0,...he};this._extensions[h.extensionName]||(fe.compress=!1),this._sender.send(te||m,fe,ve)}terminate(){if(this.readyState!==ne.CLOSED){if(this.readyState===ne.CONNECTING){N(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=ne.CLOSING,this._socket.destroy())}}}Object.defineProperty(ne,"CONNECTING",{enumerable:!0,value:ee.indexOf("CONNECTING")}),Object.defineProperty(ne.prototype,"CONNECTING",{enumerable:!0,value:ee.indexOf("CONNECTING")}),Object.defineProperty(ne,"OPEN",{enumerable:!0,value:ee.indexOf("OPEN")}),Object.defineProperty(ne.prototype,"OPEN",{enumerable:!0,value:ee.indexOf("OPEN")}),Object.defineProperty(ne,"CLOSING",{enumerable:!0,value:ee.indexOf("CLOSING")}),Object.defineProperty(ne.prototype,"CLOSING",{enumerable:!0,value:ee.indexOf("CLOSING")}),Object.defineProperty(ne,"CLOSED",{enumerable:!0,value:ee.indexOf("CLOSED")}),Object.defineProperty(ne.prototype,"CLOSED",{enumerable:!0,value:ee.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(q=>{Object.defineProperty(ne.prototype,q,{enumerable:!0})}),["open","error","close","message"].forEach(q=>{Object.defineProperty(ne.prototype,`on${q}`,{enumerable:!0,get(){for(let te of this.listeners(q))if(te[b])return te[C];return null},set(te){for(let he of this.listeners(q))if(he[b]){this.removeListener(q,he);break}typeof te=="function"&&this.addEventListener(q,te,{[b]:!0})}})}),ne.prototype.addEventListener=x,ne.prototype.removeEventListener=T,t.exports=ne;function oe(q,te,he,ve){let fe={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:y,protocolVersion:se[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...ve,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(q._autoPong=fe.autoPong,q._closeTimeout=fe.closeTimeout,!se.includes(fe.protocolVersion))throw RangeError(`Unsupported protocol version: ${fe.protocolVersion} (supported versions: ${se.join(", ")})`);let De;if(te instanceof p)De=te;else try{De=new p(te)}catch{throw SyntaxError(`Invalid URL: ${te}`)}De.protocol==="http:"?De.protocol="ws:":De.protocol==="https:"&&(De.protocol="wss:"),q._url=De.href;let Ct=De.protocol==="wss:",$t=De.protocol==="ws+unix:",xr;if(De.protocol!=="ws:"&&!Ct&&!$t?xr=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:$t&&!De.pathname?xr="The URL's pathname is empty":De.hash&&(xr="The URL contains a fragment identifier"),xr){let Xe=SyntaxError(xr);if(q._redirects===0)throw Xe;W(q,Xe);return}let Li=Ct?443:80,Pi=o(16).toString("base64"),ls=Ct?i.request:s.request,cs=new Set,us;if(fe.createConnection=fe.createConnection||(Ct?U:k),fe.defaultPort=fe.defaultPort||Li,fe.port=De.port||Li,fe.host=De.hostname.startsWith("[")?De.hostname.slice(1,-1):De.hostname,fe.headers={...fe.headers,"Sec-WebSocket-Version":fe.protocolVersion,"Sec-WebSocket-Key":Pi,Connection:"Upgrade",Upgrade:"websocket"},fe.path=De.pathname+De.search,fe.timeout=fe.handshakeTimeout,fe.perMessageDeflate&&(us=new h({...fe.perMessageDeflate,isServer:!1,maxPayload:fe.maxPayload}),fe.headers["Sec-WebSocket-Extensions"]=I({[h.extensionName]:us.offer()})),he.length){for(let Xe of he){if(typeof Xe!="string"||!pe.test(Xe)||cs.has(Xe))throw SyntaxError("An invalid or duplicated subprotocol was specified");cs.add(Xe)}fe.headers["Sec-WebSocket-Protocol"]=he.join(",")}if(fe.origin&&(fe.protocolVersion<13?fe.headers["Sec-WebSocket-Origin"]=fe.origin:fe.headers.Origin=fe.origin),(De.username||De.password)&&(fe.auth=`${De.username}:${De.password}`),$t){let Xe=fe.path.split(":");fe.socketPath=Xe[0],fe.path=Xe[1]}let Ot;if(fe.followRedirects){if(q._redirects===0){q._originalIpc=$t,q._originalSecure=Ct,q._originalHostOrSocketPath=$t?fe.socketPath:De.host;let Xe=ve&&ve.headers;if(ve={...ve,headers:{}},Xe)for(let[jt,Ni]of Object.entries(Xe))ve.headers[jt.toLowerCase()]=Ni}else if(q.listenerCount("redirect")===0){let Xe=$t?q._originalIpc?fe.socketPath===q._originalHostOrSocketPath:!1:q._originalIpc?!1:De.host===q._originalHostOrSocketPath;(!Xe||q._originalSecure&&!Ct)&&(delete fe.headers.authorization,delete fe.headers.cookie,!Xe&&delete fe.headers.host,fe.auth=void 0)}fe.auth&&!ve.headers.authorization&&(ve.headers.authorization="Basic "+Buffer.from(fe.auth).toString("base64")),Ot=q._req=ls(fe),q._redirects&&q.emit("redirect",q.url,Ot)}else Ot=q._req=ls(fe);fe.timeout&&Ot.on("timeout",()=>{N(q,Ot,"Opening handshake has timed out")}),Ot.on("error",Xe=>{Ot===null||Ot[$]||(Ot=q._req=null,W(q,Xe))}),Ot.on("response",Xe=>{let jt=Xe.headers.location,Ni=Xe.statusCode;if(jt&&fe.followRedirects&&Ni>=300&&Ni<400){if(++q._redirects>fe.maxRedirects){N(q,Ot,"Maximum redirects exceeded");return}Ot.abort();let Mi;try{Mi=new p(jt,te)}catch{let _i=SyntaxError(`Invalid URL: ${jt}`);W(q,_i);return}oe(q,Mi,he,ve)}else q.emit("unexpected-response",Ot,Xe)||N(q,Ot,`Unexpected server response: ${Xe.statusCode}`)}),Ot.on("upgrade",(Xe,jt,Ni)=>{if(q.emit("upgrade",Xe),q.readyState!==ne.CONNECTING)return;Ot=q._req=null;let Mi=Xe.headers.upgrade;if(Mi===void 0||Mi.toLowerCase()!=="websocket"){N(q,jt,"Invalid Upgrade header");return}let wa=l("sha1").update(Pi+g).digest("base64");if(Xe.headers["sec-websocket-accept"]!==wa){N(q,jt,"Invalid Sec-WebSocket-Accept header");return}let _i=Xe.headers["sec-websocket-protocol"],vi;if(_i!==void 0?cs.size?cs.has(_i)||(vi="Server sent an invalid subprotocol"):vi="Server sent a subprotocol but none was requested":cs.size&&(vi="Server sent no subprotocol"),vi){N(q,jt,vi);return}_i&&(q._protocol=_i);let Sa=Xe.headers["sec-websocket-extensions"];if(Sa!==void 0){if(!us){N(q,jt,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let vt;try{vt=L(Sa)}catch{N(q,jt,"Invalid Sec-WebSocket-Extensions header");return}let Bs=Object.keys(vt);if(Bs.length!==1||Bs[0]!==h.extensionName){N(q,jt,"Server indicated an extension that was not requested");return}try{us.accept(vt[h.extensionName])}catch{N(q,jt,"Invalid Sec-WebSocket-Extensions header");return}q._extensions[h.extensionName]=us}q.setSocket(jt,Ni,{allowSynchronousEvents:fe.allowSynchronousEvents,generateMask:fe.generateMask,maxBufferedChunks:fe.maxBufferedChunks,maxFragments:fe.maxFragments,maxPayload:fe.maxPayload,skipUTF8Validation:fe.skipUTF8Validation})}),fe.finishRequest?fe.finishRequest(Ot,q):Ot.end()}function W(q,te){q._readyState=ne.CLOSING,q._errorEmitted=!0,q.emit("error",te),q.emitClose()}function k(q){return q.path=q.socketPath,n.connect(q)}function U(q){return q.path=void 0,!q.servername&&q.servername!==""&&(q.servername=n.isIP(q.host)?"":q.host),a.connect(q)}function N(q,te,he){q._readyState=ne.CLOSING;let ve=Error(he);Error.captureStackTrace(ve,N),te.setHeader?(te[$]=!0,te.abort(),te.socket&&!te.socket.destroyed&&te.socket.destroy(),process.nextTick(W,q,ve)):(te.destroy(ve),te.once("error",q.emit.bind(q,"error")),te.once("close",q.emitClose.bind(q)))}function R(q,te,he){if(te){let ve=v(te)?te.size:P(te).length;q._socket?q._sender._bufferedBytes+=ve:q._bufferedAmount+=ve}if(he){let ve=Error(`WebSocket is not open: readyState ${q.readyState} (${ee[q.readyState]})`);process.nextTick(he,ve)}}function M(q,te){let he=this[w];he._closeFrameReceived=!0,he._closeMessage=te,he._closeCode=q,he._socket[w]!==void 0&&(he._socket.removeListener("data",Se),process.nextTick(F,he._socket),q===1005?he.close():he.close(q,te))}function K(){let q=this[w];q.isPaused||q._socket.resume()}function J(q){let te=this[w];te._socket[w]!==void 0&&(te._socket.removeListener("data",Se),process.nextTick(F,te._socket),te.close(q[A])),te._errorEmitted||(te._errorEmitted=!0,te.emit("error",q))}function ae(){this[w].emitClose()}function xe(q,te){this[w].emit("message",q,te)}function be(q){let te=this[w];te._autoPong&&te.pong(q,!this._isServer,S),te.emit("ping",q)}function _e(q){this[w].emit("pong",q)}function F(q){q.resume()}function z(q){let te=this[w];te.readyState!==ne.CLOSED&&(te.readyState===ne.OPEN&&(te._readyState=ne.CLOSING,Q(te)),this._socket.end(),!te._errorEmitted&&(te._errorEmitted=!0,te.emit("error",q)))}function Q(q){q._closeTimer=setTimeout(q._socket.destroy.bind(q._socket),q._closeTimeout)}function ce(){let q=this[w];if(this.removeListener("close",ce),this.removeListener("data",Se),this.removeListener("end",Te),q._readyState=ne.CLOSING,!this._readableState.endEmitted&&!q._closeFrameReceived&&!q._receiver._writableState.errorEmitted&&this._readableState.length!==0){let te=this.read(this._readableState.length);q._receiver.write(te)}q._receiver.end(),this[w]=void 0,clearTimeout(q._closeTimer),q._receiver._writableState.finished||q._receiver._writableState.errorEmitted?q.emitClose():(q._receiver.on("error",ae),q._receiver.on("finish",ae))}function Se(q){this[w]._receiver.write(q)||this.pause()}function Te(){let q=this[w];q._readyState=ne.CLOSING,q._receiver.end(),this.end()}function Qe(){let q=this[w];this.removeListener("error",Qe),this.on("error",S),q&&(q._readyState=ne.CLOSING,this.destroy())}}),YM=j(function(e,t){var r=I_(),{Duplex:i}=Me("stream");function s(l){l.emit("close")}function n(){!this.destroyed&&this._writableState.finished&&this.destroy()}function a(l){this.removeListener("error",a),this.destroy(),this.listenerCount("error")===0&&this.emit("error",l)}function o(l,c){let u=!0,p=new i({...c,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return l.on("message",function(h,f){let _=!f&&p._readableState.objectMode?h.toString():h;p.push(_)||l.pause()}),l.once("error",function(h){p.destroyed||(u=!1,p.destroy(h))}),l.once("close",function(){p.destroyed||p.push(null)}),p._destroy=function(h,f){if(l.readyState===l.CLOSED){f(h),process.nextTick(s,p);return}let _=!1;l.once("error",function(v){_=!0,f(v)}),l.once("close",function(){_||f(h),process.nextTick(s,p)}),u&&l.terminate()},p._final=function(h){if(l.readyState===l.CONNECTING){l.once("open",function(){p._final(h)});return}l._socket!==null&&(l._socket._writableState.finished?(h(),p._readableState.endEmitted&&p.destroy()):(l._socket.once("finish",function(){h()}),l.close()))},p._read=function(){l.isPaused&&l.resume()},p._write=function(h,f,_){if(l.readyState===l.CONNECTING){l.once("open",function(){p._write(h,f,_)});return}l.send(h,_)},p.on("end",n),p.on("error",a),p}t.exports=o}),mA=j(function(e,t){var{tokenChars:r}=ul();function i(s){let n=new Set,a=-1,o=-1,l=0;for(l;l<s.length;l++){let u=s.charCodeAt(l);if(o===-1&&r[u]===1)a===-1&&(a=l);else if(l!==0&&(u===32||u===9))o===-1&&a!==-1&&(o=l);else if(u===44){if(a===-1)throw SyntaxError(`Unexpected character at index ${l}`);o===-1&&(o=l);let p=s.slice(a,o);if(n.has(p))throw SyntaxError(`The "${p}" subprotocol is duplicated`);n.add(p),a=o=-1}else throw SyntaxError(`Unexpected character at index ${l}`)}if(a===-1||o!==-1)throw SyntaxError("Unexpected end of input");let c=s.slice(a,l);if(n.has(c))throw SyntaxError(`The "${c}" subprotocol is duplicated`);return n.add(c),n}t.exports={parse:i}}),JM=j(function(e,t){var r=Me("events"),i=Me("http"),{Duplex:s}=Me("stream"),{createHash:n}=Me("crypto"),a=D_(),o=cl(),l=mA(),c=I_(),{CLOSE_TIMEOUT:u,GUID:p,kWebSocket:h}=rs(),f=/^[+/0-9A-Za-z]{22}==$/;class _ extends r{constructor(C,A){if(super(),C={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:u,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:c,...C},C.port==null&&!C.server&&!C.noServer||C.port!=null&&(C.server||C.noServer)||C.server&&C.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(C.port!=null?(this._server=i.createServer((w,S)=>{let x=i.STATUS_CODES[426];S.writeHead(426,{"Content-Length":x.length,"Content-Type":"text/plain"}),S.end(x)}),this._server.listen(C.port,C.host,C.backlog,A)):C.server&&(this._server=C.server),this._server){let w=this.emit.bind(this,"connection");this._removeListeners=v(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(S,x,T)=>{this.handleUpgrade(S,x,T,w)}})}C.perMessageDeflate===!0&&(C.perMessageDeflate={}),C.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=C,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(C){if(this._state===2){C&&this.once("close",()=>{C(Error("The server is not running"))}),process.nextTick(E,this);return}if(C&&this.once("close",C),this._state!==1)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(E,this):process.nextTick(E,this);else{let A=this._server;this._removeListeners(),this._removeListeners=this._server=null,A.close(()=>{E(this)})}}shouldHandle(C){if(this.options.path){let A=C.url.indexOf("?");if((A!==-1?C.url.slice(0,A):C.url)!==this.options.path)return!1}return!0}handleUpgrade(C,A,w,S){A.on("error",y);let x=C.headers["sec-websocket-key"],T=C.headers.upgrade,I=+C.headers["sec-websocket-version"];if(C.method!=="GET"){g(this,C,A,405,"Invalid HTTP method");return}if(T===void 0||T.toLowerCase()!=="websocket"){g(this,C,A,400,"Invalid Upgrade header");return}if(x===void 0||!f.test(x)){g(this,C,A,400,"Missing or invalid Sec-WebSocket-Key header");return}if(I!==13&&I!==8){g(this,C,A,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(C)){m(A,400);return}let L=C.headers["sec-websocket-protocol"],P=new Set;if(L!==void 0)try{P=l.parse(L)}catch{g(this,C,A,400,"Invalid Sec-WebSocket-Protocol header");return}let $=C.headers["sec-websocket-extensions"],se={};if(this.options.perMessageDeflate&&$!==void 0){let ee=new o({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let pe=a.parse($);pe[o.extensionName]&&(ee.accept(pe[o.extensionName]),se[o.extensionName]=ee)}catch{g(this,C,A,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let ee={origin:C.headers[`${I===8?"sec-websocket-origin":"origin"}`],secure:!!(C.socket.authorized||C.socket.encrypted),req:C};if(this.options.verifyClient.length===2){this.options.verifyClient(ee,(pe,ne,oe,W)=>{if(!pe)return m(A,ne||401,oe,W);this.completeUpgrade(se,x,P,C,A,w,S)});return}if(!this.options.verifyClient(ee))return m(A,401)}this.completeUpgrade(se,x,P,C,A,w,S)}completeUpgrade(C,A,w,S,x,T,I){if(!x.readable||!x.writable)return x.destroy();if(x[h])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return m(x,503);let L=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${n("sha1").update(A+p).digest("base64")}`],P=new this.options.WebSocket(null,void 0,this.options);if(w.size){let $=this.options.handleProtocols?this.options.handleProtocols(w,S):w.values().next().value;$&&(L.push(`Sec-WebSocket-Protocol: ${$}`),P._protocol=$)}if(C[o.extensionName]){let $=C[o.extensionName].params,se=a.format({[o.extensionName]:[$]});L.push(`Sec-WebSocket-Extensions: ${se}`),P._extensions=C}this.emit("headers",L,S),x.write(L.concat(`\r
|
|
68
|
+
`).join(`\r
|
|
69
|
+
`)),x.removeListener("error",y),P.setSocket(x,T,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(P),P.on("close",()=>{this.clients.delete(P),this._shouldEmitClose&&!this.clients.size&&process.nextTick(E,this)})),I(P,S)}}t.exports=_;function v(b,C){for(let A of Object.keys(C))b.on(A,C[A]);return function(){for(let A of Object.keys(C))b.removeListener(A,C[A])}}function E(b){b._state=2,b.emit("close")}function y(){this.destroy()}function m(b,C,A,w){A=A||i.STATUS_CODES[C],w={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(A),...w},b.once("finish",b.destroy),b.end(`HTTP/1.1 ${C} ${i.STATUS_CODES[C]}\r
|
|
70
|
+
`+Object.keys(w).map(S=>`${S}: ${w[S]}`).join(`\r
|
|
71
|
+
`)+`\r
|
|
72
|
+
\r
|
|
73
|
+
`+A)}function g(b,C,A,w,S,x){if(b.listenerCount("wsClientError")){let T=Error(S);Error.captureStackTrace(T,g),b.emit("wsClientError",T,A,C)}else m(A,w,S,x)}}),QM,eU,tU,rU,iU,sU,nU,aU,oU=Z(()=>{QM=lr(YM(),1),eU=lr(D_(),1),tU=lr(cl(),1),rU=lr(hA(),1),iU=lr(fA(),1),sU=lr(mA(),1),nU=lr(I_(),1),aU=lr(JM(),1)});var lU,cU,uU=Z(()=>{lU=new Set(["localhost","::1","[::1]"]),cU=/^127(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/});var dU,pU,hU=Z(()=>{Qo(),dA(),oU(),uU(),dU=class extends Error{name="TestEgressBlockedError";code="TestEgressBlocked"},pU=globalThis.fetch}),gA={};fr(gA,{externalHttp:()=>_A});function Js(e,t){for(let r of[e,t?.baseURL])if(r&&qM(r))throw Error(`externalHttp: ${r} is Anthropic-operated. Use firstPartyApi from src/services/http/firstParty \u2014 it enforces the 3P data-residency gate.`)}var _A,fU=Z(()=>{dA(),VM(),hU(),_A={get(e,t){return Js(e,t),gs.get(e,t)},head(e,t){return Js(e,t),gs.head(e,t)},post(e,t,r){return Js(e,r),gs.post(e,t,r)},put(e,t,r){return Js(e,r),gs.put(e,t,r)},patch(e,t,r){return Js(e,r),gs.patch(e,t,r)},delete(e,t){return Js(e,t),gs.delete(e,t)}}}),mU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._globalThis=void 0,e._globalThis=typeof globalThis=="object"?globalThis:global}),gU=j(function(e){var t=e&&e.__createBinding||(Object.create?function(i,s,n,a){a===void 0&&(a=n),Object.defineProperty(i,a,{enumerable:!0,get:function(){return s[n]}})}:function(i,s,n,a){a===void 0&&(a=n),i[a]=s[n]}),r=e&&e.__exportStar||function(i,s){for(var n in i)n!=="default"&&!Object.prototype.hasOwnProperty.call(s,n)&&t(s,i,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(mU(),e)}),_U=j(function(e){var t=e&&e.__createBinding||(Object.create?function(i,s,n,a){a===void 0&&(a=n),Object.defineProperty(i,a,{enumerable:!0,get:function(){return s[n]}})}:function(i,s,n,a){a===void 0&&(a=n),i[a]=s[n]}),r=e&&e.__exportStar||function(i,s){for(var n in i)n!=="default"&&!Object.prototype.hasOwnProperty.call(s,n)&&t(s,i,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(gU(),e)}),vA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION="1.9.0"}),vU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCompatible=e._makeCompatibilityCheck=void 0;var t=vA(),r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function i(s){let n=new Set([s]),a=new Set,o=s.match(r);if(!o)return()=>!1;let l={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(l.prerelease!=null)return function(p){return p===s};function c(p){return a.add(p),!1}function u(p){return n.add(p),!0}return function(p){if(n.has(p))return!0;if(a.has(p))return!1;let h=p.match(r);if(!h)return c(p);let f={major:+h[1],minor:+h[2],patch:+h[3],prerelease:h[4]};return f.prerelease!=null||l.major!==f.major?c(p):l.major===0?l.minor===f.minor&&l.patch<=f.patch?u(p):c(p):l.minor<=f.minor?u(p):c(p)}}e._makeCompatibilityCheck=i,e.isCompatible=i(t.VERSION)}),aa=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unregisterGlobal=e.getGlobal=e.registerGlobal=void 0;var t=_U(),r=vA(),i=vU(),s=r.VERSION.split(".")[0],n=Symbol.for(`opentelemetry.js.api.${s}`),a=t._globalThis;function o(u,p,h,f=!1){var _;let v=a[n]=(_=a[n])!==null&&_!==void 0?_:{version:r.VERSION};if(!f&&v[u]){let E=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${u}`);return h.error(E.stack||E.message),!1}if(v.version!==r.VERSION){let E=Error(`@opentelemetry/api: Registration of version v${v.version} for ${u} does not match previously registered API v${r.VERSION}`);return h.error(E.stack||E.message),!1}return v[u]=p,h.debug(`@opentelemetry/api: Registered a global for ${u} v${r.VERSION}.`),!0}e.registerGlobal=o;function l(u){var p,h;let f=(p=a[n])===null||p===void 0?void 0:p.version;if(!(!f||!(0,i.isCompatible)(f)))return(h=a[n])===null||h===void 0?void 0:h[u]}e.getGlobal=l;function c(u,p){p.debug(`@opentelemetry/api: Unregistering a global for ${u} v${r.VERSION}.`);let h=a[n];h&&delete h[u]}e.unregisterGlobal=c}),yU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagComponentLogger=void 0;var t=aa();class r{constructor(n){this._namespace=n.namespace||"DiagComponentLogger"}debug(...n){return i("debug",this._namespace,n)}error(...n){return i("error",this._namespace,n)}info(...n){return i("info",this._namespace,n)}warn(...n){return i("warn",this._namespace,n)}verbose(...n){return i("verbose",this._namespace,n)}}e.DiagComponentLogger=r;function i(s,n,a){let o=(0,t.getGlobal)("diag");if(o)return a.unshift(n),o[s](...a)}}),L_=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagLogLevel=void 0;var t;(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(t=e.DiagLogLevel||(e.DiagLogLevel={}))}),bU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogLevelDiagLogger=void 0;var t=L_();function r(i,s){i<t.DiagLogLevel.NONE?i=t.DiagLogLevel.NONE:i>t.DiagLogLevel.ALL&&(i=t.DiagLogLevel.ALL),s=s||{};function n(a,o){let l=s[a];return typeof l=="function"&&i>=o?l.bind(s):function(){}}return{error:n("error",t.DiagLogLevel.ERROR),warn:n("warn",t.DiagLogLevel.WARN),info:n("info",t.DiagLogLevel.INFO),debug:n("debug",t.DiagLogLevel.DEBUG),verbose:n("verbose",t.DiagLogLevel.VERBOSE)}}e.createLogLevelDiagLogger=r}),oa=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagAPI=void 0;var t=yU(),r=bU(),i=L_(),s=aa(),n="diag";class a{constructor(){function l(p){return function(...h){let f=(0,s.getGlobal)("diag");if(f)return f[p](...h)}}let c=this,u=(p,h={logLevel:i.DiagLogLevel.INFO})=>{var f,_,v;if(p===c){let m=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return c.error((f=m.stack)!==null&&f!==void 0?f:m.message),!1}typeof h=="number"&&(h={logLevel:h});let E=(0,s.getGlobal)("diag"),y=(0,r.createLogLevelDiagLogger)((_=h.logLevel)!==null&&_!==void 0?_:i.DiagLogLevel.INFO,p);if(E&&!h.suppressOverrideMessage){let m=(v=Error().stack)!==null&&v!==void 0?v:"<failed to generate stacktrace>";E.warn(`Current logger will be overwritten from ${m}`),y.warn(`Current logger will overwrite one already registered from ${m}`)}return(0,s.registerGlobal)("diag",y,c,!0)};c.setLogger=u,c.disable=()=>{(0,s.unregisterGlobal)(n,c)},c.createComponentLogger=p=>new t.DiagComponentLogger(p),c.verbose=l("verbose"),c.debug=l("debug"),c.info=l("info"),c.warn=l("warn"),c.error=l("error")}static instance(){return this._instance||(this._instance=new a),this._instance}}e.DiagAPI=a}),EU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BaggageImpl=void 0;class t{constructor(i){this._entries=i?new Map(i):new Map}getEntry(i){let s=this._entries.get(i);if(s)return Object.assign({},s)}getAllEntries(){return Array.from(this._entries.entries()).map(([i,s])=>[i,s])}setEntry(i,s){let n=new t(this._entries);return n._entries.set(i,s),n}removeEntry(i){let s=new t(this._entries);return s._entries.delete(i),s}removeEntries(...i){let s=new t(this._entries);for(let n of i)s._entries.delete(n);return s}clear(){return new t}}e.BaggageImpl=t}),wU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.baggageEntryMetadataSymbol=void 0,e.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),yA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.baggageEntryMetadataFromString=e.createBaggage=void 0;var t=oa(),r=EU(),i=wU(),s=t.DiagAPI.instance();function n(o={}){return new r.BaggageImpl(new Map(Object.entries(o)))}e.createBaggage=n;function a(o){return typeof o!="string"&&(s.error(`Cannot create baggage metadata from unknown type: ${typeof o}`),o=""),{__TYPE__:i.baggageEntryMetadataSymbol,toString(){return o}}}e.baggageEntryMetadataFromString=a}),ju=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ROOT_CONTEXT=e.createContextKey=void 0;function t(i){return Symbol.for(i)}e.createContextKey=t;class r{constructor(s){let n=this;n._currentContext=s?new Map(s):new Map,n.getValue=a=>n._currentContext.get(a),n.setValue=(a,o)=>{let l=new r(n._currentContext);return l._currentContext.set(a,o),l},n.deleteValue=a=>{let o=new r(n._currentContext);return o._currentContext.delete(a),o}}}e.ROOT_CONTEXT=new r}),SU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagConsoleLogger=void 0;var t=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class r{constructor(){function s(n){return function(...a){if(console){let o=console[n];if(typeof o!="function"&&(o=console.log),typeof o=="function")return o.apply(console,a)}}}for(let n=0;n<t.length;n++)this[t[n].n]=s(t[n].c)}}e.DiagConsoleLogger=r}),bA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createNoopMeter=e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=e.NOOP_OBSERVABLE_GAUGE_METRIC=e.NOOP_OBSERVABLE_COUNTER_METRIC=e.NOOP_UP_DOWN_COUNTER_METRIC=e.NOOP_HISTOGRAM_METRIC=e.NOOP_GAUGE_METRIC=e.NOOP_COUNTER_METRIC=e.NOOP_METER=e.NoopObservableUpDownCounterMetric=e.NoopObservableGaugeMetric=e.NoopObservableCounterMetric=e.NoopObservableMetric=e.NoopHistogramMetric=e.NoopGaugeMetric=e.NoopUpDownCounterMetric=e.NoopCounterMetric=e.NoopMetric=e.NoopMeter=void 0;class t{constructor(){}createGauge(f,_){return e.NOOP_GAUGE_METRIC}createHistogram(f,_){return e.NOOP_HISTOGRAM_METRIC}createCounter(f,_){return e.NOOP_COUNTER_METRIC}createUpDownCounter(f,_){return e.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(f,_){return e.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(f,_){return e.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(f,_){return e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(f,_){}removeBatchObservableCallback(f){}}e.NoopMeter=t;class r{}e.NoopMetric=r;class i extends r{add(f,_){}}e.NoopCounterMetric=i;class s extends r{add(f,_){}}e.NoopUpDownCounterMetric=s;class n extends r{record(f,_){}}e.NoopGaugeMetric=n;class a extends r{record(f,_){}}e.NoopHistogramMetric=a;class o{addCallback(f){}removeCallback(f){}}e.NoopObservableMetric=o;class l extends o{}e.NoopObservableCounterMetric=l;class c extends o{}e.NoopObservableGaugeMetric=c;class u extends o{}e.NoopObservableUpDownCounterMetric=u,e.NOOP_METER=new t,e.NOOP_COUNTER_METRIC=new i,e.NOOP_GAUGE_METRIC=new n,e.NOOP_HISTOGRAM_METRIC=new a,e.NOOP_UP_DOWN_COUNTER_METRIC=new s,e.NOOP_OBSERVABLE_COUNTER_METRIC=new l,e.NOOP_OBSERVABLE_GAUGE_METRIC=new c,e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new u;function p(){return e.NOOP_METER}e.createNoopMeter=p}),CU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueType=void 0;var t;(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(t=e.ValueType||(e.ValueType={}))}),EA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultTextMapSetter=e.defaultTextMapGetter=void 0,e.defaultTextMapGetter={get(t,r){if(t!=null)return t[r]},keys(t){return t==null?[]:Object.keys(t)}},e.defaultTextMapSetter={set(t,r,i){t!=null&&(t[r]=i)}}}),OU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NoopContextManager=void 0;var t=ju();class r{active(){return t.ROOT_CONTEXT}with(s,n,a,...o){return n.call(a,...o)}bind(s,n){return n}enable(){return this}disable(){return this}}e.NoopContextManager=r}),Fu=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContextAPI=void 0;var t=OU(),r=aa(),i=oa(),s="context",n=new t.NoopContextManager;class a{constructor(){}static getInstance(){return this._instance||(this._instance=new a),this._instance}setGlobalContextManager(l){return(0,r.registerGlobal)(s,l,i.DiagAPI.instance())}active(){return this._getContextManager().active()}with(l,c,u,...p){return this._getContextManager().with(l,c,u,...p)}bind(l,c){return this._getContextManager().bind(l,c)}_getContextManager(){return(0,r.getGlobal)(s)||n}disable(){this._getContextManager().disable(),(0,r.unregisterGlobal)(s,i.DiagAPI.instance())}}e.ContextAPI=a}),wA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TraceFlags=void 0;var t;(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(t=e.TraceFlags||(e.TraceFlags={}))}),P_=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=void 0;var t=wA();e.INVALID_SPANID="0000000000000000",e.INVALID_TRACEID="00000000000000000000000000000000",e.INVALID_SPAN_CONTEXT={traceId:e.INVALID_TRACEID,spanId:e.INVALID_SPANID,traceFlags:t.TraceFlags.NONE}}),N_=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NonRecordingSpan=void 0;var t=P_();class r{constructor(s=t.INVALID_SPAN_CONTEXT){this._spanContext=s}spanContext(){return this._spanContext}setAttribute(s,n){return this}setAttributes(s){return this}addEvent(s,n){return this}addLink(s){return this}addLinks(s){return this}setStatus(s){return this}updateName(s){return this}end(s){}isRecording(){return!1}recordException(s,n){}}e.NonRecordingSpan=r}),SA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getSpanContext=e.setSpanContext=e.deleteSpan=e.setSpan=e.getActiveSpan=e.getSpan=void 0;var t=ju(),r=N_(),i=Fu(),s=(0,t.createContextKey)("OpenTelemetry Context Key SPAN");function n(p){return p.getValue(s)||void 0}e.getSpan=n;function a(){return n(i.ContextAPI.getInstance().active())}e.getActiveSpan=a;function o(p,h){return p.setValue(s,h)}e.setSpan=o;function l(p){return p.deleteValue(s)}e.deleteSpan=l;function c(p,h){return o(p,new r.NonRecordingSpan(h))}e.setSpanContext=c;function u(p){var h;return(h=n(p))===null||h===void 0?void 0:h.spanContext()}e.getSpanContext=u}),M_=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapSpanContext=e.isSpanContextValid=e.isValidSpanId=e.isValidTraceId=void 0;var t=P_(),r=N_(),i=/^([0-9a-f]{32})$/i,s=/^[0-9a-f]{16}$/i;function n(c){return i.test(c)&&c!==t.INVALID_TRACEID}e.isValidTraceId=n;function a(c){return s.test(c)&&c!==t.INVALID_SPANID}e.isValidSpanId=a;function o(c){return n(c.traceId)&&a(c.spanId)}e.isSpanContextValid=o;function l(c){return new r.NonRecordingSpan(c)}e.wrapSpanContext=l}),CA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NoopTracer=void 0;var t=Fu(),r=SA(),i=N_(),s=M_(),n=t.ContextAPI.getInstance();class a{startSpan(c,u,p=n.active()){if(u?.root)return new i.NonRecordingSpan;let h=p&&(0,r.getSpanContext)(p);return o(h)&&(0,s.isSpanContextValid)(h)?new i.NonRecordingSpan(h):new i.NonRecordingSpan}startActiveSpan(c,u,p,h){let f,_,v;if(arguments.length<2)return;arguments.length===2?v=u:arguments.length===3?(f=u,v=p):(f=u,_=p,v=h);let E=_??n.active(),y=this.startSpan(c,f,E),m=(0,r.setSpan)(E,y);return n.with(m,v,void 0,y)}}e.NoopTracer=a;function o(l){return typeof l=="object"&&typeof l.spanId=="string"&&typeof l.traceId=="string"&&typeof l.traceFlags=="number"}}),OA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProxyTracer=void 0;var t=CA(),r=new t.NoopTracer;class i{constructor(n,a,o,l){this._provider=n,this.name=a,this.version=o,this.options=l}startSpan(n,a,o){return this._getTracer().startSpan(n,a,o)}startActiveSpan(n,a,o,l){let c=this._getTracer();return Reflect.apply(c.startActiveSpan,c,arguments)}_getTracer(){if(this._delegate)return this._delegate;let n=this._provider.getDelegateTracer(this.name,this.version,this.options);return n?(this._delegate=n,this._delegate):r}}e.ProxyTracer=i}),AU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NoopTracerProvider=void 0;var t=CA();class r{getTracer(s,n,a){return new t.NoopTracer}}e.NoopTracerProvider=r}),AA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProxyTracerProvider=void 0;var t=OA(),r=AU(),i=new r.NoopTracerProvider;class s{getTracer(a,o,l){var c;return(c=this.getDelegateTracer(a,o,l))!==null&&c!==void 0?c:new t.ProxyTracer(this,a,o,l)}getDelegate(){var a;return(a=this._delegate)!==null&&a!==void 0?a:i}setDelegate(a){this._delegate=a}getDelegateTracer(a,o,l){var c;return(c=this._delegate)===null||c===void 0?void 0:c.getTracer(a,o,l)}}e.ProxyTracerProvider=s}),xU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SamplingDecision=void 0;var t;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(t=e.SamplingDecision||(e.SamplingDecision={}))}),kU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpanKind=void 0;var t;(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(t=e.SpanKind||(e.SpanKind={}))}),TU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpanStatusCode=void 0;var t;(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(t=e.SpanStatusCode||(e.SpanStatusCode={}))}),RU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateValue=e.validateKey=void 0;var t="[_0-9a-z-*/]",r=`[a-z]${t}{0,255}`,i=`[a-z0-9]${t}{0,240}@[a-z]${t}{0,13}`,s=new RegExp(`^(?:${r}|${i})$`),n=/^[ -~]{0,255}[!-~]$/,a=/,|=/;function o(c){return s.test(c)}e.validateKey=o;function l(c){return n.test(c)&&!a.test(c)}e.validateValue=l}),DU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TraceStateImpl=void 0;var t=RU(),r=32,i=512,s=",",n="=";class a{constructor(l){this._internalState=new Map,l&&this._parse(l)}set(l,c){let u=this._clone();return u._internalState.has(l)&&u._internalState.delete(l),u._internalState.set(l,c),u}unset(l){let c=this._clone();return c._internalState.delete(l),c}get(l){return this._internalState.get(l)}serialize(){return this._keys().reduce((l,c)=>(l.push(c+n+this.get(c)),l),[]).join(s)}_parse(l){l.length>i||(this._internalState=l.split(s).reverse().reduce((c,u)=>{let p=u.trim(),h=p.indexOf(n);if(h!==-1){let f=p.slice(0,h),_=p.slice(h+1,u.length);(0,t.validateKey)(f)&&(0,t.validateValue)(_)&&c.set(f,_)}return c},new Map),this._internalState.size>r&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let l=new a;return l._internalState=new Map(this._internalState),l}}e.TraceStateImpl=a}),IU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTraceState=void 0;var t=DU();function r(i){return new t.TraceStateImpl(i)}e.createTraceState=r}),LU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.context=void 0;var t=Fu();e.context=t.ContextAPI.getInstance()}),PU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.diag=void 0;var t=oa();e.diag=t.DiagAPI.instance()}),NU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NOOP_METER_PROVIDER=e.NoopMeterProvider=void 0;var t=bA();class r{getMeter(s,n,a){return t.NOOP_METER}}e.NoopMeterProvider=r,e.NOOP_METER_PROVIDER=new r}),MU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MetricsAPI=void 0;var t=NU(),r=aa(),i=oa(),s="metrics";class n{constructor(){}static getInstance(){return this._instance||(this._instance=new n),this._instance}setGlobalMeterProvider(o){return(0,r.registerGlobal)(s,o,i.DiagAPI.instance())}getMeterProvider(){return(0,r.getGlobal)(s)||t.NOOP_METER_PROVIDER}getMeter(o,l,c){return this.getMeterProvider().getMeter(o,l,c)}disable(){(0,r.unregisterGlobal)(s,i.DiagAPI.instance())}}e.MetricsAPI=n}),UU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.metrics=void 0;var t=MU();e.metrics=t.MetricsAPI.getInstance()}),$U=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NoopTextMapPropagator=void 0;class t{inject(i,s){}extract(i,s){return i}fields(){return[]}}e.NoopTextMapPropagator=t}),jU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deleteBaggage=e.setBaggage=e.getActiveBaggage=e.getBaggage=void 0;var t=Fu(),r=ju(),i=(0,r.createContextKey)("OpenTelemetry Baggage Key");function s(l){return l.getValue(i)||void 0}e.getBaggage=s;function n(){return s(t.ContextAPI.getInstance().active())}e.getActiveBaggage=n;function a(l,c){return l.setValue(i,c)}e.setBaggage=a;function o(l){return l.deleteValue(i)}e.deleteBaggage=o}),FU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PropagationAPI=void 0;var t=aa(),r=$U(),i=EA(),s=jU(),n=yA(),a=oa(),o="propagation",l=new r.NoopTextMapPropagator;class c{constructor(){this.createBaggage=n.createBaggage,this.getBaggage=s.getBaggage,this.getActiveBaggage=s.getActiveBaggage,this.setBaggage=s.setBaggage,this.deleteBaggage=s.deleteBaggage}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalPropagator(p){return(0,t.registerGlobal)(o,p,a.DiagAPI.instance())}inject(p,h,f=i.defaultTextMapSetter){return this._getGlobalPropagator().inject(p,h,f)}extract(p,h,f=i.defaultTextMapGetter){return this._getGlobalPropagator().extract(p,h,f)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,t.unregisterGlobal)(o,a.DiagAPI.instance())}_getGlobalPropagator(){return(0,t.getGlobal)(o)||l}}e.PropagationAPI=c}),BU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.propagation=void 0;var t=FU();e.propagation=t.PropagationAPI.getInstance()}),HU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TraceAPI=void 0;var t=aa(),r=AA(),i=M_(),s=SA(),n=oa(),a="trace";class o{constructor(){this._proxyTracerProvider=new r.ProxyTracerProvider,this.wrapSpanContext=i.wrapSpanContext,this.isSpanContextValid=i.isSpanContextValid,this.deleteSpan=s.deleteSpan,this.getSpan=s.getSpan,this.getActiveSpan=s.getActiveSpan,this.getSpanContext=s.getSpanContext,this.setSpan=s.setSpan,this.setSpanContext=s.setSpanContext}static getInstance(){return this._instance||(this._instance=new o),this._instance}setGlobalTracerProvider(c){let u=(0,t.registerGlobal)(a,this._proxyTracerProvider,n.DiagAPI.instance());return u&&this._proxyTracerProvider.setDelegate(c),u}getTracerProvider(){return(0,t.getGlobal)(a)||this._proxyTracerProvider}getTracer(c,u){return this.getTracerProvider().getTracer(c,u)}disable(){(0,t.unregisterGlobal)(a,n.DiagAPI.instance()),this._proxyTracerProvider=new r.ProxyTracerProvider}}e.TraceAPI=o}),zU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trace=void 0;var t=HU();e.trace=t.TraceAPI.getInstance()}),WU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trace=e.propagation=e.metrics=e.diag=e.context=e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=e.isValidSpanId=e.isValidTraceId=e.isSpanContextValid=e.createTraceState=e.TraceFlags=e.SpanStatusCode=e.SpanKind=e.SamplingDecision=e.ProxyTracerProvider=e.ProxyTracer=e.defaultTextMapSetter=e.defaultTextMapGetter=e.ValueType=e.createNoopMeter=e.DiagLogLevel=e.DiagConsoleLogger=e.ROOT_CONTEXT=e.createContextKey=e.baggageEntryMetadataFromString=void 0;var t=yA();Object.defineProperty(e,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return t.baggageEntryMetadataFromString}});var r=ju();Object.defineProperty(e,"createContextKey",{enumerable:!0,get:function(){return r.createContextKey}}),Object.defineProperty(e,"ROOT_CONTEXT",{enumerable:!0,get:function(){return r.ROOT_CONTEXT}});var i=SU();Object.defineProperty(e,"DiagConsoleLogger",{enumerable:!0,get:function(){return i.DiagConsoleLogger}});var s=L_();Object.defineProperty(e,"DiagLogLevel",{enumerable:!0,get:function(){return s.DiagLogLevel}});var n=bA();Object.defineProperty(e,"createNoopMeter",{enumerable:!0,get:function(){return n.createNoopMeter}});var a=CU();Object.defineProperty(e,"ValueType",{enumerable:!0,get:function(){return a.ValueType}});var o=EA();Object.defineProperty(e,"defaultTextMapGetter",{enumerable:!0,get:function(){return o.defaultTextMapGetter}}),Object.defineProperty(e,"defaultTextMapSetter",{enumerable:!0,get:function(){return o.defaultTextMapSetter}});var l=OA();Object.defineProperty(e,"ProxyTracer",{enumerable:!0,get:function(){return l.ProxyTracer}});var c=AA();Object.defineProperty(e,"ProxyTracerProvider",{enumerable:!0,get:function(){return c.ProxyTracerProvider}});var u=xU();Object.defineProperty(e,"SamplingDecision",{enumerable:!0,get:function(){return u.SamplingDecision}});var p=kU();Object.defineProperty(e,"SpanKind",{enumerable:!0,get:function(){return p.SpanKind}});var h=TU();Object.defineProperty(e,"SpanStatusCode",{enumerable:!0,get:function(){return h.SpanStatusCode}});var f=wA();Object.defineProperty(e,"TraceFlags",{enumerable:!0,get:function(){return f.TraceFlags}});var _=IU();Object.defineProperty(e,"createTraceState",{enumerable:!0,get:function(){return _.createTraceState}});var v=M_();Object.defineProperty(e,"isSpanContextValid",{enumerable:!0,get:function(){return v.isSpanContextValid}}),Object.defineProperty(e,"isValidTraceId",{enumerable:!0,get:function(){return v.isValidTraceId}}),Object.defineProperty(e,"isValidSpanId",{enumerable:!0,get:function(){return v.isValidSpanId}});var E=P_();Object.defineProperty(e,"INVALID_SPANID",{enumerable:!0,get:function(){return E.INVALID_SPANID}}),Object.defineProperty(e,"INVALID_TRACEID",{enumerable:!0,get:function(){return E.INVALID_TRACEID}}),Object.defineProperty(e,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return E.INVALID_SPAN_CONTEXT}});var y=LU();Object.defineProperty(e,"context",{enumerable:!0,get:function(){return y.context}});var m=PU();Object.defineProperty(e,"diag",{enumerable:!0,get:function(){return m.diag}});var g=UU();Object.defineProperty(e,"metrics",{enumerable:!0,get:function(){return g.metrics}});var b=BU();Object.defineProperty(e,"propagation",{enumerable:!0,get:function(){return b.propagation}});var C=zU();Object.defineProperty(e,"trace",{enumerable:!0,get:function(){return C.trace}}),e.default={context:y.context,diag:m.diag,metrics:g.metrics,propagation:b.propagation,trace:C.trace}}),eu=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(m){if(super(),!e.IDENTIFIER.test(m))throw Error("CodeGen: name must be a valid identifier");this.str=m}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class i extends t{constructor(m){super(),this._items=typeof m=="string"?[m]:m}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let m=this._items[0];return m===""||m==='""'}get str(){var m;return(m=this._str)!==null&&m!==void 0?m:this._str=this._items.reduce((g,b)=>`${g}${b}`,"")}get names(){var m;return(m=this._names)!==null&&m!==void 0?m:this._names=this._items.reduce((g,b)=>(b instanceof r&&(g[b.str]=(g[b.str]||0)+1),g),{})}}e._Code=i,e.nil=new i("");function s(y,...m){let g=[y[0]],b=0;for(;b<m.length;)o(g,m[b]),g.push(y[++b]);return new i(g)}e._=s;var n=new i("+");function a(y,...m){let g=[f(y[0])],b=0;for(;b<m.length;)g.push(n),o(g,m[b]),g.push(n,f(y[++b]));return l(g),new i(g)}e.str=a;function o(y,m){m instanceof i?y.push(...m._items):m instanceof r?y.push(m):y.push(p(m))}e.addCodeArg=o;function l(y){let m=1;for(;m<y.length-1;){if(y[m]===n){let g=c(y[m-1],y[m+1]);if(g!==void 0){y.splice(m-1,3,g);continue}y[m++]="+"}m++}}function c(y,m){if(m==='""')return y;if(y==='""')return m;if(typeof y=="string")return m instanceof r||y[y.length-1]!=='"'?void 0:typeof m!="string"?`${y.slice(0,-1)}${m}"`:m[0]==='"'?y.slice(0,-1)+m.slice(1):void 0;if(typeof m=="string"&&m[0]==='"'&&!(y instanceof r))return`"${y}${m.slice(1)}`}function u(y,m){return m.emptyStr()?y:y.emptyStr()?m:a`${y}${m}`}e.strConcat=u;function p(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:f(Array.isArray(y)?y.join(","):y)}function h(y){return new i(f(y))}e.stringify=h;function f(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=f;function _(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new i(`.${y}`):s`[${y}]`}e.getProperty=_;function v(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new i(`${y}`);throw Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=v;function E(y){return new i(y.toString())}e.regexpCode=E}),sE=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=eu();class r extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}}var i;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(i||(e.UsedValueState=i={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:c,parent:u}={}){this._names={},this._prefixes=c,this._parent=u}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let u=this._names[c]||this._nameGroup(c);return`${c}${u.index++}`}_nameGroup(c){var u,p;if(!((p=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||p===void 0)&&p.has(c)||this._prefixes&&!this._prefixes.has(c))throw Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=s;class n extends t.Name{constructor(c,u){super(u),this.prefix=c}setValue(c,{property:u,itemIndex:p}){this.value=c,this.scopePath=t._`.${new t.Name(u)}[${p}]`}}e.ValueScopeName=n;var a=t._`\n`;class o extends s{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?a:t.nil}}get(){return this._scope}name(c){return new n(c,this._newName(c))}value(c,u){var p;if(u.ref===void 0)throw Error("CodeGen: ref must be passed in value");let h=this.toName(c),{prefix:f}=h,_=(p=u.key)!==null&&p!==void 0?p:u.ref,v=this._values[f];if(v){let m=v.get(_);if(m)return m}else v=this._values[f]=new Map;v.set(_,h);let E=this._scope[f]||(this._scope[f]=[]),y=E.length;return E[y]=u.ref,h.setValue(u,{property:f,itemIndex:y}),h}getValue(c,u){let p=this._values[c];if(p)return p.get(u)}scopeRefs(c,u=this._values){return this._reduceValues(u,p=>{if(p.scopePath===void 0)throw Error(`CodeGen: name "${p}" has no value`);return t._`${c}${p.scopePath}`})}scopeCode(c=this._values,u,p){return this._reduceValues(c,h=>{if(h.value===void 0)throw Error(`CodeGen: name "${h}" has no value`);return h.value.code},u,p)}_reduceValues(c,u,p={},h){let f=t.nil;for(let _ in c){let v=c[_];if(!v)continue;let E=p[_]=p[_]||new Map;v.forEach(y=>{if(E.has(y))return;E.set(y,i.Started);let m=u(y);if(m){let g=this.opts.es5?e.varKinds.var:e.varKinds.const;f=t._`${f}${g} ${y} = ${m};${this.opts._n}`}else if(m=h?.(y))f=t._`${f}${m}${this.opts._n}`;else throw new r(y);E.set(y,i.Completed)})}return f}}e.ValueScope=o}),je=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=eu(),r=sE(),i=eu();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return i.Name}});var s=sE();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class n{optimizeNodes(){return this}optimizeNames(R,M){return this}}class a extends n{constructor(R,M,K){super(),this.varKind=R,this.name=M,this.rhs=K}render({es5:R,_n:M}){let K=R?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${K} ${this.name}${J};`+M}optimizeNames(R,M){if(R[this.name.str])return this.rhs&&(this.rhs=$(this.rhs,R,M)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends n{constructor(R,M,K){super(),this.lhs=R,this.rhs=M,this.sideEffects=K}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,M){if(!(this.lhs instanceof t.Name&&!R[this.lhs.str]&&!this.sideEffects))return this.rhs=$(this.rhs,R,M),this}get names(){let R=this.lhs instanceof t.Name?{}:{...this.lhs.names};return P(R,this.rhs)}}class l extends o{constructor(R,M,K,J){super(R,K,J),this.op=M}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class c extends n{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}}class u extends n{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}}class p extends n{constructor(R){super(),this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}}class h extends n{constructor(R){super(),this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,M){return this.code=$(this.code,R,M),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class f extends n{constructor(R=[]){super(),this.nodes=R}render(R){return this.nodes.reduce((M,K)=>M+K.render(R),"")}optimizeNodes(){let{nodes:R}=this,M=R.length;for(;M--;){let K=R[M].optimizeNodes();Array.isArray(K)?R.splice(M,1,...K):K?R[M]=K:R.splice(M,1)}return R.length>0?this:void 0}optimizeNames(R,M){let{nodes:K}=this,J=K.length;for(;J--;){let ae=K[J];ae.optimizeNames(R,M)||(se(R,ae.names),K.splice(J,1))}return K.length>0?this:void 0}get names(){return this.nodes.reduce((R,M)=>L(R,M.names),{})}}class _ extends f{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class v extends f{}class E extends _{}E.kind="else";class y extends _{constructor(R,M){super(M),this.condition=R}render(R){let M=`if(${this.condition})`+super.render(R);return this.else&&(M+="else "+this.else.render(R)),M}optimizeNodes(){super.optimizeNodes();let R=this.condition;if(R===!0)return this.nodes;let M=this.else;if(M){let K=M.optimizeNodes();M=this.else=Array.isArray(K)?new E(K):K}if(M)return R===!1?M instanceof y?M:M.nodes:this.nodes.length?this:new y(ee(R),M instanceof y?[M]:M.nodes);if(!(R===!1||!this.nodes.length))return this}optimizeNames(R,M){var K;if(this.else=(K=this.else)===null||K===void 0?void 0:K.optimizeNames(R,M),!!(super.optimizeNames(R,M)||this.else))return this.condition=$(this.condition,R,M),this}get names(){let R=super.names;return P(R,this.condition),this.else&&L(R,this.else.names),R}}y.kind="if";class m extends _{}m.kind="for";class g extends m{constructor(R){super(),this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,M){if(super.optimizeNames(R,M))return this.iteration=$(this.iteration,R,M),this}get names(){return L(super.names,this.iteration.names)}}class b extends m{constructor(R,M,K,J){super(),this.varKind=R,this.name=M,this.from=K,this.to=J}render(R){let M=R.es5?r.varKinds.var:this.varKind,{name:K,from:J,to:ae}=this;return`for(${M} ${K}=${J}; ${K}<${ae}; ${K}++)`+super.render(R)}get names(){let R=P(super.names,this.from);return P(R,this.to)}}class C extends m{constructor(R,M,K,J){super(),this.loop=R,this.varKind=M,this.name=K,this.iterable=J}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,M){if(super.optimizeNames(R,M))return this.iterable=$(this.iterable,R,M),this}get names(){return L(super.names,this.iterable.names)}}class A extends _{constructor(R,M,K){super(),this.name=R,this.args=M,this.async=K}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}}A.kind="func";class w extends f{render(R){return"return "+super.render(R)}}w.kind="return";class S extends _{render(R){let M="try"+super.render(R);return this.catch&&(M+=this.catch.render(R)),this.finally&&(M+=this.finally.render(R)),M}optimizeNodes(){var R,M;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(M=this.finally)===null||M===void 0||M.optimizeNodes(),this}optimizeNames(R,M){var K,J;return super.optimizeNames(R,M),(K=this.catch)===null||K===void 0||K.optimizeNames(R,M),(J=this.finally)===null||J===void 0||J.optimizeNames(R,M),this}get names(){let R=super.names;return this.catch&&L(R,this.catch.names),this.finally&&L(R,this.finally.names),R}}class x extends _{constructor(R){super(),this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}x.kind="catch";class T extends _{render(R){return"finally"+super.render(R)}}T.kind="finally";class I{constructor(R,M={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...M,_n:M.lines?`
|
|
74
|
+
`:""},this._extScope=R,this._scope=new r.Scope({parent:R}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,M){let K=this._extScope.value(R,M);return(this._values[K.prefix]||(this._values[K.prefix]=new Set)).add(K),K}getScopeValue(R,M){return this._extScope.getValue(R,M)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,M,K,J){let ae=this._scope.toName(M);return K!==void 0&&J&&(this._constants[ae.str]=K),this._leafNode(new a(R,ae,K)),ae}const(R,M,K){return this._def(r.varKinds.const,R,M,K)}let(R,M,K){return this._def(r.varKinds.let,R,M,K)}var(R,M,K){return this._def(r.varKinds.var,R,M,K)}assign(R,M,K){return this._leafNode(new o(R,M,K))}add(R,M){return this._leafNode(new l(R,e.operators.ADD,M))}code(R){return typeof R=="function"?R():R!==t.nil&&this._leafNode(new h(R)),this}object(...R){let M=["{"];for(let[K,J]of R)M.length>1&&M.push(","),M.push(K),(K!==J||this.opts.es5)&&(M.push(":"),(0,t.addCodeArg)(M,J));return M.push("}"),new t._Code(M)}if(R,M,K){if(this._blockNode(new y(R)),M&&K)this.code(M).else().code(K).endIf();else if(M)this.code(M).endIf();else if(K)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new y(R))}else(){return this._elseNode(new E)}endIf(){return this._endBlockNode(y,E)}_for(R,M){return this._blockNode(R),M&&this.code(M).endFor(),this}for(R,M){return this._for(new g(R),M)}forRange(R,M,K,J,ae=this.opts.es5?r.varKinds.var:r.varKinds.let){let xe=this._scope.toName(R);return this._for(new b(ae,xe,M,K),()=>J(xe))}forOf(R,M,K,J=r.varKinds.const){let ae=this._scope.toName(R);if(this.opts.es5){let xe=M instanceof t.Name?M:this.var("_arr",M);return this.forRange("_i",0,t._`${xe}.length`,be=>{this.var(ae,t._`${xe}[${be}]`),K(ae)})}return this._for(new C("of",J,ae,M),()=>K(ae))}forIn(R,M,K,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,t._`Object.keys(${M})`,K);let ae=this._scope.toName(R);return this._for(new C("in",J,ae,M),()=>K(ae))}endFor(){return this._endBlockNode(m)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new u(R))}return(R){let M=new w;if(this._blockNode(M),this.code(R),M.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(R,M,K){if(!M&&!K)throw Error('CodeGen: "try" without "catch" and "finally"');let J=new S;if(this._blockNode(J),this.code(R),M){let ae=this.name("e");this._currNode=J.catch=new x(ae),M(ae)}return K&&(this._currNode=J.finally=new T,this.code(K)),this._endBlockNode(x,T)}throw(R){return this._leafNode(new p(R))}block(R,M){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(M),this}endBlock(R){let M=this._blockStarts.pop();if(M===void 0)throw Error("CodeGen: not in self-balancing block");let K=this._nodes.length-M;if(K<0||R!==void 0&&K!==R)throw Error(`CodeGen: wrong number of nodes: ${K} vs ${R} expected`);return this._nodes.length=M,this}func(R,M=t.nil,K,J){return this._blockNode(new A(R,M,K)),J&&this.code(J).endFunc(),this}endFunc(){return this._endBlockNode(A)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,M){let K=this._currNode;if(K instanceof R||M&&K instanceof M)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${M?`${R.kind}/${M.kind}`:R.kind}"`)}_elseNode(R){let M=this._currNode;if(!(M instanceof y))throw Error('CodeGen: "else" without "if"');return this._currNode=M.else=R,this}get _root(){return this._nodes[0]}get _currNode(){let R=this._nodes;return R[R.length-1]}set _currNode(R){let M=this._nodes;M[M.length-1]=R}}e.CodeGen=I;function L(N,R){for(let M in R)N[M]=(N[M]||0)+(R[M]||0);return N}function P(N,R){return R instanceof t._CodeOrName?L(N,R.names):N}function $(N,R,M){if(N instanceof t.Name)return K(N);if(!J(N))return N;return new t._Code(N._items.reduce((ae,xe)=>(xe instanceof t.Name&&(xe=K(xe)),xe instanceof t._Code?ae.push(...xe._items):ae.push(xe),ae),[]));function K(ae){let xe=M[ae.str];return xe===void 0||R[ae.str]!==1?ae:(delete R[ae.str],xe)}function J(ae){return ae instanceof t._Code&&ae._items.some(xe=>xe instanceof t.Name&&R[xe.str]===1&&M[xe.str]!==void 0)}}function se(N,R){for(let M in R)N[M]=(N[M]||0)-(R[M]||0)}function ee(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:t._`!${U(N)}`}e.not=ee;var pe=k(e.operators.AND);function ne(...N){return N.reduce(pe)}e.and=ne;var oe=k(e.operators.OR);function W(...N){return N.reduce(oe)}e.or=W;function k(N){return(R,M)=>R===t.nil?M:M===t.nil?R:t._`${U(R)} ${N} ${U(M)}`}function U(N){return N instanceof t.Name?N:t._`(${N})`}}),Ze=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=je(),r=eu();function i(A){let w={};for(let S of A)w[S]=!0;return w}e.toHash=i;function s(A,w){return typeof w=="boolean"?w:Object.keys(w).length===0?!0:(n(A,w),!a(w,A.self.RULES.all))}e.alwaysValidSchema=s;function n(A,w=A.schema){let{opts:S,self:x}=A;if(!S.strictSchema||typeof w=="boolean")return;let T=x.RULES.keywords;for(let I in w)T[I]||C(A,`unknown keyword: "${I}"`)}e.checkUnknownRules=n;function a(A,w){if(typeof A=="boolean")return!A;for(let S in A)if(w[S])return!0;return!1}e.schemaHasRules=a;function o(A,w){if(typeof A=="boolean")return!A;for(let S in A)if(S!=="$ref"&&w.all[S])return!0;return!1}e.schemaHasRulesButRef=o;function l({topSchemaRef:A,schemaPath:w},S,x,T){if(!T){if(typeof S=="number"||typeof S=="boolean")return S;if(typeof S=="string")return t._`${S}`}return t._`${A}${w}${(0,t.getProperty)(x)}`}e.schemaRefOrVal=l;function c(A){return h(decodeURIComponent(A))}e.unescapeFragment=c;function u(A){return encodeURIComponent(p(A))}e.escapeFragment=u;function p(A){return typeof A=="number"?`${A}`:A.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=p;function h(A){return A.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=h;function f(A,w){if(Array.isArray(A))for(let S of A)w(S);else w(A)}e.eachItem=f;function _({mergeNames:A,mergeToName:w,mergeValues:S,resultToName:x}){return(T,I,L,P)=>{let $=L===void 0?I:L instanceof t.Name?(I instanceof t.Name?A(T,I,L):w(T,I,L),L):I instanceof t.Name?(w(T,L,I),I):S(I,L);return P===t.Name&&!($ instanceof t.Name)?x(T,$):$}}e.mergeEvaluated={props:_({mergeNames:(A,w,S)=>A.if(t._`${S} !== true && ${w} !== undefined`,()=>{A.if(t._`${w} === true`,()=>A.assign(S,!0),()=>A.assign(S,t._`${S} || {}`).code(t._`Object.assign(${S}, ${w})`))}),mergeToName:(A,w,S)=>A.if(t._`${S} !== true`,()=>{w===!0?A.assign(S,!0):(A.assign(S,t._`${S} || {}`),E(A,S,w))}),mergeValues:(A,w)=>A===!0?!0:{...A,...w},resultToName:v}),items:_({mergeNames:(A,w,S)=>A.if(t._`${S} !== true && ${w} !== undefined`,()=>A.assign(S,t._`${w} === true ? true : ${S} > ${w} ? ${S} : ${w}`)),mergeToName:(A,w,S)=>A.if(t._`${S} !== true`,()=>A.assign(S,w===!0?!0:t._`${S} > ${w} ? ${S} : ${w}`)),mergeValues:(A,w)=>A===!0?!0:Math.max(A,w),resultToName:(A,w)=>A.var("items",w)})};function v(A,w){if(w===!0)return A.var("props",!0);let S=A.var("props",t._`{}`);return w!==void 0&&E(A,S,w),S}e.evaluatedPropsToName=v;function E(A,w,S){Object.keys(S).forEach(x=>A.assign(t._`${w}${(0,t.getProperty)(x)}`,!0))}e.setEvaluated=E;var y={};function m(A,w){return A.scopeValue("func",{ref:w,code:y[w.code]||(y[w.code]=new r._Code(w.code))})}e.useFunc=m;var g;(function(A){A[A.Num=0]="Num",A[A.Str=1]="Str"})(g||(e.Type=g={}));function b(A,w,S){if(A instanceof t.Name){let x=w===g.Num;return S?x?t._`"[" + ${A} + "]"`:t._`"['" + ${A} + "']"`:x?t._`"/" + ${A}`:t._`"/" + ${A}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return S?(0,t.getProperty)(A).toString():"/"+p(A)}e.getErrorPath=b;function C(A,w,S=A.opts.strictSchema){if(S){if(w=`strict mode: ${w}`,S===!0)throw Error(w);A.self.logger.warn(w)}}e.checkStrictMode=C}),is=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}),Bu=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=je(),r=Ze(),i=is();e.keywordError={message:({keyword:E})=>t.str`must pass "${E}" keyword validation`},e.keyword$DataError={message:({keyword:E,schemaType:y})=>y?t.str`"${E}" keyword must be ${y} ($data)`:t.str`"${E}" keyword is invalid ($data)`};function s(E,y=e.keywordError,m,g){let{it:b}=E,{gen:C,compositeRule:A,allErrors:w}=b,S=p(E,y,m);g??(A||w)?l(C,S):c(b,t._`[${S}]`)}e.reportError=s;function n(E,y=e.keywordError,m){let{it:g}=E,{gen:b,compositeRule:C,allErrors:A}=g,w=p(E,y,m);l(b,w),!(C||A)&&c(g,i.default.vErrors)}e.reportExtraError=n;function a(E,y){E.assign(i.default.errors,y),E.if(t._`${i.default.vErrors} !== null`,()=>E.if(y,()=>E.assign(t._`${i.default.vErrors}.length`,y),()=>E.assign(i.default.vErrors,null)))}e.resetErrorsCount=a;function o({gen:E,keyword:y,schemaValue:m,data:g,errsCount:b,it:C}){if(b===void 0)throw Error("ajv implementation error");let A=E.name("err");E.forRange("i",b,i.default.errors,w=>{E.const(A,t._`${i.default.vErrors}[${w}]`),E.if(t._`${A}.instancePath === undefined`,()=>E.assign(t._`${A}.instancePath`,(0,t.strConcat)(i.default.instancePath,C.errorPath))),E.assign(t._`${A}.schemaPath`,t.str`${C.errSchemaPath}/${y}`),C.opts.verbose&&(E.assign(t._`${A}.schema`,m),E.assign(t._`${A}.data`,g))})}e.extendErrors=o;function l(E,y){let m=E.const("err",y);E.if(t._`${i.default.vErrors} === null`,()=>E.assign(i.default.vErrors,t._`[${m}]`),t._`${i.default.vErrors}.push(${m})`),E.code(t._`${i.default.errors}++`)}function c(E,y){let{gen:m,validateName:g,schemaEnv:b}=E;b.$async?m.throw(t._`new ${E.ValidationError}(${y})`):(m.assign(t._`${g}.errors`,y),m.return(!1))}var u={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(E,y,m){let{createErrors:g}=E.it;return g===!1?t._`{}`:h(E,y,m)}function h(E,y,m={}){let{gen:g,it:b}=E,C=[f(b,m),_(E,m)];return v(E,y,C),g.object(...C)}function f({errorPath:E},{instancePath:y}){let m=y?t.str`${E}${(0,r.getErrorPath)(y,r.Type.Str)}`:E;return[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,m)]}function _({keyword:E,it:{errSchemaPath:y}},{schemaPath:m,parentSchema:g}){let b=g?y:t.str`${y}/${E}`;return m&&(b=t.str`${b}${(0,r.getErrorPath)(m,r.Type.Str)}`),[u.schemaPath,b]}function v(E,{params:y,message:m},g){let{keyword:b,data:C,schemaValue:A,it:w}=E,{opts:S,propertyName:x,topSchemaRef:T,schemaPath:I}=w;g.push([u.keyword,b],[u.params,typeof y=="function"?y(E):y||t._`{}`]),S.messages&&g.push([u.message,typeof m=="function"?m(E):m]),S.verbose&&g.push([u.schema,A],[u.parentSchema,t._`${T}${I}`],[i.default.data,C]),x&&g.push([u.propertyName,x])}}),KU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=Bu(),r=je(),i=is(),s={message:"boolean schema is false"};function n(l){let{gen:c,schema:u,validateName:p}=l;u===!1?o(l,!1):typeof u=="object"&&u.$async===!0?c.return(i.default.data):(c.assign(r._`${p}.errors`,null),c.return(!0))}e.topBoolOrEmptySchema=n;function a(l,c){let{gen:u,schema:p}=l;p===!1?(u.var(c,!1),o(l)):u.var(c,!0)}e.boolOrEmptySchema=a;function o(l,c){let{gen:u,data:p}=l,h={gen:u,keyword:"false schema",data:p,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:l};(0,t.reportError)(h,s,void 0,c)}}),xA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;var t=["string","number","integer","boolean","null","object","array"],r=new Set(t);function i(n){return typeof n=="string"&&r.has(n)}e.isJSONType=i;function s(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=s}),kA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:s,self:n},a){let o=n.RULES.types[a];return o&&o!==!0&&r(s,o)}e.schemaHasRulesForType=t;function r(s,n){return n.rules.some(a=>i(s,a))}e.shouldUseGroup=r;function i(s,n){var a;return s[n.keyword]!==void 0||((a=n.definition.implements)===null||a===void 0?void 0:a.some(o=>s[o]!==void 0))}e.shouldUseRule=i}),tu=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=xA(),r=kA(),i=Bu(),s=je(),n=Ze(),a;(function(g){g[g.Correct=0]="Correct",g[g.Wrong=1]="Wrong"})(a||(e.DataType=a={}));function o(g){let b=l(g.type);if(b.includes("null")){if(g.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!b.length&&g.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');g.nullable===!0&&b.push("null")}return b}e.getSchemaTypes=o;function l(g){let b=Array.isArray(g)?g:g?[g]:[];if(b.every(t.isJSONType))return b;throw Error("type must be JSONType or JSONType[]: "+b.join(","))}e.getJSONTypes=l;function c(g,b){let{gen:C,data:A,opts:w}=g,S=p(b,w.coerceTypes),x=b.length>0&&!(S.length===0&&b.length===1&&(0,r.schemaHasRulesForType)(g,b[0]));if(x){let T=v(b,A,w.strictNumbers,a.Wrong);C.if(T,()=>{S.length?h(g,b,S):y(g)})}return x}e.coerceAndCheckDataType=c;var u=new Set(["string","number","integer","boolean","null"]);function p(g,b){return b?g.filter(C=>u.has(C)||b==="array"&&C==="array"):[]}function h(g,b,C){let{gen:A,data:w,opts:S}=g,x=A.let("dataType",s._`typeof ${w}`),T=A.let("coerced",s._`undefined`);S.coerceTypes==="array"&&A.if(s._`${x} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>A.assign(w,s._`${w}[0]`).assign(x,s._`typeof ${w}`).if(v(b,w,S.strictNumbers),()=>A.assign(T,w))),A.if(s._`${T} !== undefined`);for(let L of C)(u.has(L)||L==="array"&&S.coerceTypes==="array")&&I(L);A.else(),y(g),A.endIf(),A.if(s._`${T} !== undefined`,()=>{A.assign(w,T),f(g,T)});function I(L){switch(L){case"string":A.elseIf(s._`${x} == "number" || ${x} == "boolean"`).assign(T,s._`"" + ${w}`).elseIf(s._`${w} === null`).assign(T,s._`""`);return;case"number":A.elseIf(s._`${x} == "boolean" || ${w} === null
|
|
75
|
+
|| (${x} == "string" && ${w} && ${w} == +${w})`).assign(T,s._`+${w}`);return;case"integer":A.elseIf(s._`${x} === "boolean" || ${w} === null
|
|
76
|
+
|| (${x} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(T,s._`+${w}`);return;case"boolean":A.elseIf(s._`${w} === "false" || ${w} === 0 || ${w} === null`).assign(T,!1).elseIf(s._`${w} === "true" || ${w} === 1`).assign(T,!0);return;case"null":A.elseIf(s._`${w} === "" || ${w} === 0 || ${w} === false`),A.assign(T,null);return;case"array":A.elseIf(s._`${x} === "string" || ${x} === "number"
|
|
77
|
+
|| ${x} === "boolean" || ${w} === null`).assign(T,s._`[${w}]`)}}}function f({gen:g,parentData:b,parentDataProperty:C},A){g.if(s._`${b} !== undefined`,()=>g.assign(s._`${b}[${C}]`,A))}function _(g,b,C,A=a.Correct){let w=A===a.Correct?s.operators.EQ:s.operators.NEQ,S;switch(g){case"null":return s._`${b} ${w} null`;case"array":S=s._`Array.isArray(${b})`;break;case"object":S=s._`${b} && typeof ${b} == "object" && !Array.isArray(${b})`;break;case"integer":S=x(s._`!(${b} % 1) && !isNaN(${b})`);break;case"number":S=x();break;default:return s._`typeof ${b} ${w} ${g}`}return A===a.Correct?S:(0,s.not)(S);function x(T=s.nil){return(0,s.and)(s._`typeof ${b} == "number"`,T,C?s._`isFinite(${b})`:s.nil)}}e.checkDataType=_;function v(g,b,C,A){if(g.length===1)return _(g[0],b,C,A);let w,S=(0,n.toHash)(g);if(S.array&&S.object){let x=s._`typeof ${b} != "object"`;w=S.null?x:s._`!${b} || ${x}`,delete S.null,delete S.array,delete S.object}else w=s.nil;S.number&&delete S.integer;for(let x in S)w=(0,s.and)(w,_(x,b,C,A));return w}e.checkDataTypes=v;var E={message:({schema:g})=>`must be ${g}`,params:({schema:g,schemaValue:b})=>typeof g=="string"?s._`{type: ${g}}`:s._`{type: ${b}}`};function y(g){let b=m(g);(0,i.reportError)(b,E)}e.reportTypeError=y;function m(g){let{gen:b,data:C,schema:A}=g,w=(0,n.schemaRefOrVal)(g,A,"type");return{gen:b,keyword:"type",data:C,schema:A.type,schemaCode:w,schemaValue:w,parentSchema:A,params:{},it:g}}}),GU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;var t=je(),r=Ze();function i(n,a){let{properties:o,items:l}=n.schema;if(a==="object"&&o)for(let c in o)s(n,c,o[c].default);else a==="array"&&Array.isArray(l)&&l.forEach((c,u)=>s(n,u,c.default))}e.assignDefaults=i;function s(n,a,o){let{gen:l,compositeRule:c,data:u,opts:p}=n;if(o===void 0)return;let h=t._`${u}${(0,t.getProperty)(a)}`;if(c){(0,r.checkStrictMode)(n,`default is ignored for: ${h}`);return}let f=t._`${h} === undefined`;p.useDefaults==="empty"&&(f=t._`${f} || ${h} === null || ${h} === ""`),l.if(f,t._`${h} = ${(0,t.stringify)(o)}`)}}),ei=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=je(),r=Ze(),i=is(),s=Ze();function n(g,b){let{gen:C,data:A,it:w}=g;C.if(p(C,A,b,w.opts.ownProperties),()=>{g.setParams({missingProperty:t._`${b}`},!0),g.error()})}e.checkReportMissingProp=n;function a({gen:g,data:b,it:{opts:C}},A,w){return(0,t.or)(...A.map(S=>(0,t.and)(p(g,b,S,C.ownProperties),t._`${w} = ${S}`)))}e.checkMissingProp=a;function o(g,b){g.setParams({missingProperty:b},!0),g.error()}e.reportMissingProp=o;function l(g){return g.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=l;function c(g,b,C){return t._`${l(g)}.call(${b}, ${C})`}e.isOwnProperty=c;function u(g,b,C,A){let w=t._`${b}${(0,t.getProperty)(C)} !== undefined`;return A?t._`${w} && ${c(g,b,C)}`:w}e.propertyInData=u;function p(g,b,C,A){let w=t._`${b}${(0,t.getProperty)(C)} === undefined`;return A?(0,t.or)(w,(0,t.not)(c(g,b,C))):w}e.noPropertyInData=p;function h(g){return g?Object.keys(g).filter(b=>b!=="__proto__"):[]}e.allSchemaProperties=h;function f(g,b){return h(b).filter(C=>!(0,r.alwaysValidSchema)(g,b[C]))}e.schemaProperties=f;function _({schemaCode:g,data:b,it:{gen:C,topSchemaRef:A,schemaPath:w,errorPath:S},it:x},T,I,L){let P=L?t._`${g}, ${b}, ${A}${w}`:b,$=[[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,S)],[i.default.parentData,x.parentData],[i.default.parentDataProperty,x.parentDataProperty],[i.default.rootData,i.default.rootData]];x.opts.dynamicRef&&$.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);let se=t._`${P}, ${C.object(...$)}`;return I!==t.nil?t._`${T}.call(${I}, ${se})`:t._`${T}(${se})`}e.callValidateCode=_;var v=t._`new RegExp`;function E({gen:g,it:{opts:b}},C){let A=b.unicodeRegExp?"u":"",{regExp:w}=b.code,S=w(C,A);return g.scopeValue("pattern",{key:S.toString(),ref:S,code:t._`${w.code==="new RegExp"?v:(0,s.useFunc)(g,w)}(${C}, ${A})`})}e.usePattern=E;function y(g){let{gen:b,data:C,keyword:A,it:w}=g,S=b.name("valid");if(w.allErrors){let T=b.let("valid",!0);return x(()=>b.assign(T,!1)),T}return b.var(S,!0),x(()=>b.break()),S;function x(T){let I=b.const("len",t._`${C}.length`);b.forRange("i",0,I,L=>{g.subschema({keyword:A,dataProp:L,dataPropType:r.Type.Num},S),b.if((0,t.not)(S),T)})}}e.validateArray=y;function m(g){let{gen:b,schema:C,keyword:A,it:w}=g;if(!Array.isArray(C))throw Error("ajv implementation error");if(C.some(T=>(0,r.alwaysValidSchema)(w,T))&&!w.opts.unevaluated)return;let S=b.let("valid",!1),x=b.name("_valid");b.block(()=>C.forEach((T,I)=>{let L=g.subschema({keyword:A,schemaProp:I,compositeRule:!0},x);b.assign(S,t._`${S} || ${x}`),!g.mergeValidEvaluated(L,x)&&b.if((0,t.not)(S))})),g.result(S,()=>g.reset(),()=>g.error(!0))}e.validateUnion=m}),qU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=je(),r=is(),i=ei(),s=Bu();function n(f,_){let{gen:v,keyword:E,schema:y,parentSchema:m,it:g}=f,b=_.macro.call(g.self,y,m,g),C=u(v,E,b);g.opts.validateSchema!==!1&&g.self.validateSchema(b,!0);let A=v.name("valid");f.subschema({schema:b,schemaPath:t.nil,errSchemaPath:`${g.errSchemaPath}/${E}`,topSchemaRef:C,compositeRule:!0},A),f.pass(A,()=>f.error(!0))}e.macroKeywordCode=n;function a(f,_){var v;let{gen:E,keyword:y,schema:m,parentSchema:g,$data:b,it:C}=f;c(C,_);let A=!b&&_.compile?_.compile.call(C.self,m,g,C):_.validate,w=u(E,y,A),S=E.let("valid");f.block$data(S,x),f.ok((v=_.valid)!==null&&v!==void 0?v:S);function x(){if(_.errors===!1)L(),_.modifying&&o(f),P(()=>f.error());else{let $=_.async?T():I();_.modifying&&o(f),P(()=>l(f,$))}}function T(){let $=E.let("ruleErrs",null);return E.try(()=>L(t._`await `),se=>E.assign(S,!1).if(t._`${se} instanceof ${C.ValidationError}`,()=>E.assign($,t._`${se}.errors`),()=>E.throw(se))),$}function I(){let $=t._`${w}.errors`;return E.assign($,null),L(t.nil),$}function L($=_.async?t._`await `:t.nil){let se=C.opts.passContext?r.default.this:r.default.self,ee=!("compile"in _&&!b||_.schema===!1);E.assign(S,t._`${$}${(0,i.callValidateCode)(f,w,se,ee)}`,_.modifying)}function P($){var se;E.if((0,t.not)((se=_.valid)!==null&&se!==void 0?se:S),$)}}e.funcKeywordCode=a;function o(f){let{gen:_,data:v,it:E}=f;_.if(E.parentData,()=>_.assign(v,t._`${E.parentData}[${E.parentDataProperty}]`))}function l(f,_){let{gen:v}=f;v.if(t._`Array.isArray(${_})`,()=>{v.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${_} : ${r.default.vErrors}.concat(${_})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,s.extendErrors)(f)},()=>f.error())}function c({schemaEnv:f},_){if(_.async&&!f.$async)throw Error("async keyword in sync schema")}function u(f,_,v){if(v===void 0)throw Error(`keyword "${_}" failed to compile`);return f.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,t.stringify)(v)})}function p(f,_,v=!1){return!_.length||_.some(E=>E==="array"?Array.isArray(f):E==="object"?f&&typeof f=="object"&&!Array.isArray(f):typeof f==E||v&&typeof f>"u")}e.validSchemaType=p;function h({schema:f,opts:_,self:v,errSchemaPath:E},y,m){if(Array.isArray(y.keyword)?!y.keyword.includes(m):y.keyword!==m)throw Error("ajv implementation error");let g=y.dependencies;if(g?.some(b=>!Object.prototype.hasOwnProperty.call(f,b)))throw Error(`parent schema must have dependencies of ${m}: ${g.join(",")}`);if(y.validateSchema&&!y.validateSchema(f[m])){let b=`keyword "${m}" value is invalid at path "${E}": `+v.errorsText(y.validateSchema.errors);if(_.validateSchema==="log")v.logger.error(b);else throw Error(b)}}e.validateKeywordUsage=h}),VU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=je(),r=Ze();function i(a,{keyword:o,schemaProp:l,schema:c,schemaPath:u,errSchemaPath:p,topSchemaRef:h}){if(o!==void 0&&c!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){let f=a.schema[o];return l===void 0?{schema:f,schemaPath:t._`${a.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${a.errSchemaPath}/${o}`}:{schema:f[l],schemaPath:t._`${a.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(l)}`,errSchemaPath:`${a.errSchemaPath}/${o}/${(0,r.escapeFragment)(l)}`}}if(c!==void 0){if(u===void 0||p===void 0||h===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:u,topSchemaRef:h,errSchemaPath:p}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=i;function s(a,o,{dataProp:l,dataPropType:c,data:u,dataTypes:p,propertyName:h}){if(u!==void 0&&l!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:f}=o;if(l!==void 0){let{errorPath:v,dataPathArr:E,opts:y}=o,m=f.let("data",t._`${o.data}${(0,t.getProperty)(l)}`,!0);_(m),a.errorPath=t.str`${v}${(0,r.getErrorPath)(l,c,y.jsPropertySyntax)}`,a.parentDataProperty=t._`${l}`,a.dataPathArr=[...E,a.parentDataProperty]}if(u!==void 0){let v=u instanceof t.Name?u:f.let("data",u,!0);_(v),h!==void 0&&(a.propertyName=h)}p&&(a.dataTypes=p);function _(v){a.data=v,a.dataLevel=o.dataLevel+1,a.dataTypes=[],o.definedProperties=new Set,a.parentData=o.data,a.dataNames=[...o.dataNames,v]}}e.extendSubschemaData=s;function n(a,{jtdDiscriminator:o,jtdMetadata:l,compositeRule:c,createErrors:u,allErrors:p}){c!==void 0&&(a.compositeRule=c),u!==void 0&&(a.createErrors=u),p!==void 0&&(a.allErrors=p),a.jtdDiscriminator=o,a.jtdMetadata=l}e.extendSubschemaMode=n}),TA=j(function(e,t){t.exports=function r(i,s){if(i===s)return!0;if(i&&s&&typeof i=="object"&&typeof s=="object"){if(i.constructor!==s.constructor)return!1;var n,a,o;if(Array.isArray(i)){if(n=i.length,n!=s.length)return!1;for(a=n;a--!==0;)if(!r(i[a],s[a]))return!1;return!0}if(i.constructor===RegExp)return i.source===s.source&&i.flags===s.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===s.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===s.toString();if(o=Object.keys(i),n=o.length,n!==Object.keys(s).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(s,o[a]))return!1;for(a=n;a--!==0;){var l=o[a];if(!r(i[l],s[l]))return!1}return!0}return i!==i&&s!==s}}),ZU=j(function(e,t){var r=t.exports=function(n,a,o){typeof a=="function"&&(o=a,a={}),o=a.cb||o;var l=typeof o=="function"?o:o.pre||function(){},c=o.post||function(){};i(a,l,c,n,"",n)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function i(n,a,o,l,c,u,p,h,f,_){if(l&&typeof l=="object"&&!Array.isArray(l)){a(l,c,u,p,h,f,_);for(var v in l){var E=l[v];if(Array.isArray(E)){if(v in r.arrayKeywords)for(var y=0;y<E.length;y++)i(n,a,o,E[y],c+"/"+v+"/"+y,u,c,v,l,y)}else if(v in r.propsKeywords){if(E&&typeof E=="object")for(var m in E)i(n,a,o,E[m],c+"/"+v+"/"+s(m),u,c,v,l,m)}else(v in r.keywords||n.allKeys&&!(v in r.skipKeywords))&&i(n,a,o,E,c+"/"+v,u,c,v,l)}o(l,c,u,p,h,f,_)}}function s(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}}),Hu=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=Ze(),r=TA(),i=ZU(),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function n(E,y=!0){return typeof E=="boolean"?!0:y===!0?!o(E):y?l(E)<=y:!1}e.inlineRef=n;var a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(E){for(let y in E){if(a.has(y))return!0;let m=E[y];if(Array.isArray(m)&&m.some(o)||typeof m=="object"&&o(m))return!0}return!1}function l(E){let y=0;for(let m in E){if(m==="$ref")return 1/0;if(y++,!s.has(m)&&(typeof E[m]=="object"&&(0,t.eachItem)(E[m],g=>y+=l(g)),y===1/0))return 1/0}return y}function c(E,y="",m){m!==!1&&(y=h(y));let g=E.parse(y);return u(E,g)}e.getFullPath=c;function u(E,y){return E.serialize(y).split("#")[0]+"#"}e._getFullPath=u;var p=/#\/?$/;function h(E){return E?E.replace(p,""):""}e.normalizeId=h;function f(E,y,m){return m=h(m),E.resolve(y,m)}e.resolveUrl=f;var _=/^[a-z_][-a-z0-9._]*$/i;function v(E,y){if(typeof E=="boolean")return{};let{schemaId:m,uriResolver:g}=this.opts,b=h(E[m]||y),C={"":b},A=c(g,b,!1),w={},S=new Set;return i(E,{allKeys:!0},(I,L,P,$)=>{if($===void 0)return;let se=A+L,ee=C[$];typeof I[m]=="string"&&(ee=pe.call(this,I[m])),ne.call(this,I.$anchor),ne.call(this,I.$dynamicAnchor),C[L]=ee;function pe(oe){let W=this.opts.uriResolver.resolve;if(oe=h(ee?W(ee,oe):oe),S.has(oe))throw T(oe);S.add(oe);let k=this.refs[oe];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?x(I,k.schema,oe):oe!==h(se)&&(oe[0]==="#"?(x(I,w[oe],oe),w[oe]=I):this.refs[oe]=se),oe}function ne(oe){if(typeof oe=="string"){if(!_.test(oe))throw Error(`invalid anchor "${oe}"`);pe.call(this,`#${oe}`)}}}),w;function x(I,L,P){if(L!==void 0&&!r(I,L))throw T(P)}function T(I){return Error(`reference "${I}" resolves to more than one schema`)}}e.getSchemaRefs=v}),zu=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=KU(),r=tu(),i=kA(),s=tu(),n=GU(),a=qU(),o=VU(),l=je(),c=is(),u=Hu(),p=Ze(),h=Bu();function f(F){if(A(F)&&(S(F),C(F))){y(F);return}_(F,()=>(0,t.topBoolOrEmptySchema)(F))}e.validateFunctionCode=f;function _({gen:F,validateName:z,schema:Q,schemaEnv:ce,opts:Se},Te){Se.code.es5?F.func(z,l._`${c.default.data}, ${c.default.valCxt}`,ce.$async,()=>{F.code(l._`"use strict"; ${g(Q,Se)}`),E(F,Se),F.code(Te)}):F.func(z,l._`${c.default.data}, ${v(Se)}`,ce.$async,()=>F.code(g(Q,Se)).code(Te))}function v(F){return l._`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${F.dynamicRef?l._`, ${c.default.dynamicAnchors}={}`:l.nil}}={}`}function E(F,z){F.if(c.default.valCxt,()=>{F.var(c.default.instancePath,l._`${c.default.valCxt}.${c.default.instancePath}`),F.var(c.default.parentData,l._`${c.default.valCxt}.${c.default.parentData}`),F.var(c.default.parentDataProperty,l._`${c.default.valCxt}.${c.default.parentDataProperty}`),F.var(c.default.rootData,l._`${c.default.valCxt}.${c.default.rootData}`),z.dynamicRef&&F.var(c.default.dynamicAnchors,l._`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{F.var(c.default.instancePath,l._`""`),F.var(c.default.parentData,l._`undefined`),F.var(c.default.parentDataProperty,l._`undefined`),F.var(c.default.rootData,c.default.data),z.dynamicRef&&F.var(c.default.dynamicAnchors,l._`{}`)})}function y(F){let{schema:z,opts:Q,gen:ce}=F;_(F,()=>{Q.$comment&&z.$comment&&$(F),I(F),ce.let(c.default.vErrors,null),ce.let(c.default.errors,0),Q.unevaluated&&m(F),x(F),se(F)})}function m(F){let{gen:z,validateName:Q}=F;F.evaluated=z.const("evaluated",l._`${Q}.evaluated`),z.if(l._`${F.evaluated}.dynamicProps`,()=>z.assign(l._`${F.evaluated}.props`,l._`undefined`)),z.if(l._`${F.evaluated}.dynamicItems`,()=>z.assign(l._`${F.evaluated}.items`,l._`undefined`))}function g(F,z){let Q=typeof F=="object"&&F[z.schemaId];return Q&&(z.code.source||z.code.process)?l._`/*# sourceURL=${Q} */`:l.nil}function b(F,z){if(A(F)&&(S(F),C(F))){w(F,z);return}(0,t.boolOrEmptySchema)(F,z)}function C({schema:F,self:z}){if(typeof F=="boolean")return!F;for(let Q in F)if(z.RULES.all[Q])return!0;return!1}function A(F){return typeof F.schema!="boolean"}function w(F,z){let{schema:Q,gen:ce,opts:Se}=F;Se.$comment&&Q.$comment&&$(F),L(F),P(F);let Te=ce.const("_errs",c.default.errors);x(F,Te),ce.var(z,l._`${Te} === ${c.default.errors}`)}function S(F){(0,p.checkUnknownRules)(F),T(F)}function x(F,z){if(F.opts.jtd)return pe(F,[],!1,z);let Q=(0,r.getSchemaTypes)(F.schema),ce=(0,r.coerceAndCheckDataType)(F,Q);pe(F,Q,!ce,z)}function T(F){let{schema:z,errSchemaPath:Q,opts:ce,self:Se}=F;z.$ref&&ce.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(z,Se.RULES)&&Se.logger.warn(`$ref: keywords ignored in schema at path "${Q}"`)}function I(F){let{schema:z,opts:Q}=F;z.default!==void 0&&Q.useDefaults&&Q.strictSchema&&(0,p.checkStrictMode)(F,"default is ignored in the schema root")}function L(F){let z=F.schema[F.opts.schemaId];z&&(F.baseId=(0,u.resolveUrl)(F.opts.uriResolver,F.baseId,z))}function P(F){if(F.schema.$async&&!F.schemaEnv.$async)throw Error("async schema in sync schema")}function $({gen:F,schemaEnv:z,schema:Q,errSchemaPath:ce,opts:Se}){let Te=Q.$comment;if(Se.$comment===!0)F.code(l._`${c.default.self}.logger.log(${Te})`);else if(typeof Se.$comment=="function"){let Qe=l.str`${ce}/$comment`,q=F.scopeValue("root",{ref:z.root});F.code(l._`${c.default.self}.opts.$comment(${Te}, ${Qe}, ${q}.schema)`)}}function se(F){let{gen:z,schemaEnv:Q,validateName:ce,ValidationError:Se,opts:Te}=F;Q.$async?z.if(l._`${c.default.errors} === 0`,()=>z.return(c.default.data),()=>z.throw(l._`new ${Se}(${c.default.vErrors})`)):(z.assign(l._`${ce}.errors`,c.default.vErrors),Te.unevaluated&&ee(F),z.return(l._`${c.default.errors} === 0`))}function ee({gen:F,evaluated:z,props:Q,items:ce}){Q instanceof l.Name&&F.assign(l._`${z}.props`,Q),ce instanceof l.Name&&F.assign(l._`${z}.items`,ce)}function pe(F,z,Q,ce){let{gen:Se,schema:Te,data:Qe,allErrors:q,opts:te,self:he}=F,{RULES:ve}=he;if(Te.$ref&&(te.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(Te,ve))){Se.block(()=>ae(F,"$ref",ve.all.$ref.definition));return}te.jtd||oe(F,z),Se.block(()=>{for(let De of ve.rules)fe(De);fe(ve.post)});function fe(De){(0,i.shouldUseGroup)(Te,De)&&(De.type?(Se.if((0,s.checkDataType)(De.type,Qe,te.strictNumbers)),ne(F,De),z.length===1&&z[0]===De.type&&Q&&(Se.else(),(0,s.reportTypeError)(F)),Se.endIf()):ne(F,De),q||Se.if(l._`${c.default.errors} === ${ce||0}`))}}function ne(F,z){let{gen:Q,schema:ce,opts:{useDefaults:Se}}=F;Se&&(0,n.assignDefaults)(F,z.type),Q.block(()=>{for(let Te of z.rules)(0,i.shouldUseRule)(ce,Te)&&ae(F,Te.keyword,Te.definition,z.type)})}function oe(F,z){F.schemaEnv.meta||!F.opts.strictTypes||(W(F,z),!F.opts.allowUnionTypes&&k(F,z),U(F,F.dataTypes))}function W(F,z){if(z.length){if(!F.dataTypes.length){F.dataTypes=z;return}z.forEach(Q=>{R(F.dataTypes,Q)||K(F,`type "${Q}" not allowed by context "${F.dataTypes.join(",")}"`)}),M(F,z)}}function k(F,z){z.length>1&&!(z.length===2&&z.includes("null"))&&K(F,"use allowUnionTypes to allow union type keyword")}function U(F,z){let Q=F.self.RULES.all;for(let ce in Q){let Se=Q[ce];if(typeof Se=="object"&&(0,i.shouldUseRule)(F.schema,Se)){let{type:Te}=Se.definition;Te.length&&!Te.some(Qe=>N(z,Qe))&&K(F,`missing type "${Te.join(",")}" for keyword "${ce}"`)}}}function N(F,z){return F.includes(z)||z==="number"&&F.includes("integer")}function R(F,z){return F.includes(z)||z==="integer"&&F.includes("number")}function M(F,z){let Q=[];for(let ce of F.dataTypes)R(z,ce)?Q.push(ce):z.includes("integer")&&ce==="number"&&Q.push("integer");F.dataTypes=Q}function K(F,z){let Q=F.schemaEnv.baseId+F.errSchemaPath;z+=` at "${Q}" (strictTypes)`,(0,p.checkStrictMode)(F,z,F.opts.strictTypes)}class J{constructor(z,Q,ce){if((0,a.validateKeywordUsage)(z,Q,ce),this.gen=z.gen,this.allErrors=z.allErrors,this.keyword=ce,this.data=z.data,this.schema=z.schema[ce],this.$data=Q.$data&&z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(z,this.schema,ce,this.$data),this.schemaType=Q.schemaType,this.parentSchema=z.schema,this.params={},this.it=z,this.def=Q,this.$data)this.schemaCode=z.gen.const("vSchema",_e(this.$data,z));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,Q.schemaType,Q.allowUndefined))throw Error(`${ce} value must be ${JSON.stringify(Q.schemaType)}`);("code"in Q?Q.trackErrors:Q.errors!==!1)&&(this.errsCount=z.gen.const("_errs",c.default.errors))}result(z,Q,ce){this.failResult((0,l.not)(z),Q,ce)}failResult(z,Q,ce){this.gen.if(z),ce?ce():this.error(),Q?(this.gen.else(),Q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(z,Q){this.failResult((0,l.not)(z),void 0,Q)}fail(z){if(z===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(z){if(!this.$data)return this.fail(z);let{schemaCode:Q}=this;this.fail(l._`${Q} !== undefined && (${(0,l.or)(this.invalid$data(),z)})`)}error(z,Q,ce){if(Q){this.setParams(Q),this._error(z,ce),this.setParams({});return}this._error(z,ce)}_error(z,Q){(z?h.reportExtraError:h.reportError)(this,this.def.error,Q)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(z){this.allErrors||this.gen.if(z)}setParams(z,Q){Q?Object.assign(this.params,z):this.params=z}block$data(z,Q,ce=l.nil){this.gen.block(()=>{this.check$data(z,ce),Q()})}check$data(z=l.nil,Q=l.nil){if(!this.$data)return;let{gen:ce,schemaCode:Se,schemaType:Te,def:Qe}=this;ce.if((0,l.or)(l._`${Se} === undefined`,Q)),z!==l.nil&&ce.assign(z,!0),(Te.length||Qe.validateSchema)&&(ce.elseIf(this.invalid$data()),this.$dataError(),z!==l.nil&&ce.assign(z,!1)),ce.else()}invalid$data(){let{gen:z,schemaCode:Q,schemaType:ce,def:Se,it:Te}=this;return(0,l.or)(Qe(),q());function Qe(){if(ce.length){if(!(Q instanceof l.Name))throw Error("ajv implementation error");let te=Array.isArray(ce)?ce:[ce];return l._`${(0,s.checkDataTypes)(te,Q,Te.opts.strictNumbers,s.DataType.Wrong)}`}return l.nil}function q(){if(Se.validateSchema){let te=z.scopeValue("validate$data",{ref:Se.validateSchema});return l._`!${te}(${Q})`}return l.nil}}subschema(z,Q){let ce=(0,o.getSubschema)(this.it,z);(0,o.extendSubschemaData)(ce,this.it,z),(0,o.extendSubschemaMode)(ce,z);let Se={...this.it,...ce,items:void 0,props:void 0};return b(Se,Q),Se}mergeEvaluated(z,Q){let{it:ce,gen:Se}=this;ce.opts.unevaluated&&(ce.props!==!0&&z.props!==void 0&&(ce.props=p.mergeEvaluated.props(Se,z.props,ce.props,Q)),ce.items!==!0&&z.items!==void 0&&(ce.items=p.mergeEvaluated.items(Se,z.items,ce.items,Q)))}mergeValidEvaluated(z,Q){let{it:ce,gen:Se}=this;if(ce.opts.unevaluated&&(ce.props!==!0||ce.items!==!0))return Se.if(Q,()=>this.mergeEvaluated(z,l.Name)),!0}}e.KeywordCxt=J;function ae(F,z,Q,ce){let Se=new J(F,Q,z);"code"in Q?Q.code(Se,ce):Se.$data&&Q.validate?(0,a.funcKeywordCode)(Se,Q):"macro"in Q?(0,a.macroKeywordCode)(Se,Q):(Q.compile||Q.validate)&&(0,a.funcKeywordCode)(Se,Q)}var xe=/^\/(?:[^~]|~0|~1)*$/,be=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _e(F,{dataLevel:z,dataNames:Q,dataPathArr:ce}){let Se,Te;if(F==="")return c.default.rootData;if(F[0]==="/"){if(!xe.test(F))throw Error(`Invalid JSON-pointer: ${F}`);Se=F,Te=c.default.rootData}else{let he=be.exec(F);if(!he)throw Error(`Invalid JSON-pointer: ${F}`);let ve=+he[1];if(Se=he[2],Se==="#"){if(ve>=z)throw Error(te("property/index",ve));return ce[z-ve]}if(ve>z)throw Error(te("data",ve));if(Te=Q[z-ve],!Se)return Te}let Qe=Te,q=Se.split("/");for(let he of q)he&&(Te=l._`${Te}${(0,l.getProperty)((0,p.unescapeJsonPointer)(he))}`,Qe=l._`${Qe} && ${Te}`);return Qe;function te(he,ve){return`Cannot access ${he} ${ve} levels up, current level is ${z}`}}e.getData=_e}),U_=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});class t extends Error{constructor(i){super("validation failed"),this.errors=i,this.ajv=this.validation=!0}}e.default=t}),Wu=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Hu();class r extends Error{constructor(s,n,a,o){super(o||`can't resolve reference ${a} from id ${n}`),this.missingRef=(0,t.resolveUrl)(s,n,a),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(s,this.missingRef))}}e.default=r}),$_=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=je(),r=U_(),i=is(),s=Hu(),n=Ze(),a=zu();class o{constructor(m){var g;this.refs={},this.dynamicAnchors={};let b;typeof m.schema=="object"&&(b=m.schema),this.schema=m.schema,this.schemaId=m.schemaId,this.root=m.root||this,this.baseId=(g=m.baseId)!==null&&g!==void 0?g:(0,s.normalizeId)(b?.[m.schemaId||"$id"]),this.schemaPath=m.schemaPath,this.localRefs=m.localRefs,this.meta=m.meta,this.$async=b?.$async,this.refs={}}}e.SchemaEnv=o;function l(y){let m=p.call(this,y);if(m)return m;let g=(0,s.getFullPath)(this.opts.uriResolver,y.root.baseId),{es5:b,lines:C}=this.opts.code,{ownProperties:A}=this.opts,w=new t.CodeGen(this.scope,{es5:b,lines:C,ownProperties:A}),S;y.$async&&(S=w.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`}));let x=w.scopeName("validate");y.validateName=x;let T={gen:w,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:y.schema,code:(0,t.stringify)(y.schema)}:{ref:y.schema}),validateName:x,ValidationError:S,schema:y.schema,schemaEnv:y,rootId:g,baseId:y.baseId||g,schemaPath:t.nil,errSchemaPath:y.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},I;try{this._compilations.add(y),(0,a.validateFunctionCode)(T),w.optimize(this.opts.code.optimize);let L=w.toString();I=`${w.scopeRefs(i.default.scope)}return ${L}`,this.opts.code.process&&(I=this.opts.code.process(I,y));let P=Function(`${i.default.self}`,`${i.default.scope}`,I)(this,this.scope.get());if(this.scope.value(x,{ref:P}),P.errors=null,P.schema=y.schema,P.schemaEnv=y,y.$async&&(P.$async=!0),this.opts.code.source===!0&&(P.source={validateName:x,validateCode:L,scopeValues:w._values}),this.opts.unevaluated){let{props:$,items:se}=T;P.evaluated={props:$ instanceof t.Name?void 0:$,items:se instanceof t.Name?void 0:se,dynamicProps:$ instanceof t.Name,dynamicItems:se instanceof t.Name},P.source&&(P.source.evaluated=(0,t.stringify)(P.evaluated))}return y.validate=P,y}catch(L){throw delete y.validate,delete y.validateName,I&&this.logger.error("Error compiling schema, function code:",I),L}finally{this._compilations.delete(y)}}e.compileSchema=l;function c(y,m,g){var b;g=(0,s.resolveUrl)(this.opts.uriResolver,m,g);let C=y.refs[g];if(C)return C;let A=f.call(this,y,g);if(A===void 0){let w=(b=y.localRefs)===null||b===void 0?void 0:b[g],{schemaId:S}=this.opts;w&&(A=new o({schema:w,schemaId:S,root:y,baseId:m}))}if(A!==void 0)return y.refs[g]=u.call(this,A)}e.resolveRef=c;function u(y){return(0,s.inlineRef)(y.schema,this.opts.inlineRefs)?y.schema:y.validate?y:l.call(this,y)}function p(y){for(let m of this._compilations)if(h(m,y))return m}e.getCompilingSchema=p;function h(y,m){return y.schema===m.schema&&y.root===m.root&&y.baseId===m.baseId}function f(y,m){let g;for(;typeof(g=this.refs[m])=="string";)m=g;return g||this.schemas[m]||_.call(this,y,m)}function _(y,m){let g=this.opts.uriResolver.parse(m),b=(0,s._getFullPath)(this.opts.uriResolver,g),C=(0,s.getFullPath)(this.opts.uriResolver,y.baseId,void 0);if(Object.keys(y.schema).length>0&&b===C)return E.call(this,g,y);let A=(0,s.normalizeId)(b),w=this.refs[A]||this.schemas[A];if(typeof w=="string"){let S=_.call(this,y,w);return typeof S?.schema!="object"?void 0:E.call(this,g,S)}if(typeof w?.schema=="object"){if(w.validate||l.call(this,w),A===(0,s.normalizeId)(m)){let{schema:S}=w,{schemaId:x}=this.opts,T=S[x];return T&&(C=(0,s.resolveUrl)(this.opts.uriResolver,C,T)),new o({schema:S,schemaId:x,root:y,baseId:C})}return E.call(this,g,w)}}e.resolveSchema=_;var v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(y,{baseId:m,schema:g,root:b}){var C;if(((C=y.fragment)===null||C===void 0?void 0:C[0])!=="/")return;for(let S of y.fragment.slice(1).split("/")){if(typeof g=="boolean")return;let x=g[(0,n.unescapeFragment)(S)];if(x===void 0)return;g=x;let T=typeof g=="object"&&g[this.opts.schemaId];!v.has(S)&&T&&(m=(0,s.resolveUrl)(this.opts.uriResolver,m,T))}let A;if(typeof g!="boolean"&&g.$ref&&!(0,n.schemaHasRulesButRef)(g,this.RULES)){let S=(0,s.resolveUrl)(this.opts.uriResolver,m,g.$ref);A=_.call(this,b,S)}let{schemaId:w}=this.opts;if(A=A||new o({schema:g,schemaId:w,root:b,baseId:m}),A.schema!==A.root.schema)return A}}),XU=j(function(e,t){t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),RA=j(function(e,t){var r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),i=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),s=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),n=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function o(w){let S="",x=0,T=0;for(T=0;T<w.length;T++)if(x=w[T].charCodeAt(0),x!==48){if(!(x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102))return"";S+=w[T];break}for(T+=1;T<w.length;T++){if(x=w[T].charCodeAt(0),!(x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102))return"";S+=w[T]}return S}var l=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function c(w){return w.length=0,!0}function u(w,S,x){if(w.length){let T=o(w);if(T!=="")S.push(T);else return x.error=!0,!1;w.length=0}return!0}function p(w){let S=0,x={error:!1,address:"",zone:""},T=[],I=[],L=!1,P=!1,$=u;for(let se=0;se<w.length;se++){let ee=w[se];if(!(ee==="["||ee==="]"))if(ee===":"){if(L===!0&&(P=!0),!$(I,T,x))break;if(++S>7){x.error=!0;break}se>0&&w[se-1]===":"&&(L=!0),T.push(":");continue}else if(ee==="%"){if(!$(I,T,x))break;$=c}else{I.push(ee);continue}}return I.length&&($===c?x.zone=I.join(""):P?T.push(I.join("")):T.push(o(I))),x.address=T.join(""),x}function h(w){if(f(w,":")<2)return{host:w,isIPV6:!1};let S=p(w);if(S.error)return{host:w,isIPV6:!1};{let{address:x,address:T}=S;return S.zone&&(x+="%"+S.zone,T+="%25"+S.zone),{host:x,isIPV6:!0,escapedHost:T}}}function f(w,S){let x=0;for(let T=0;T<w.length;T++)w[T]===S&&x++;return x}function _(w){let S=w,x=[],T=-1,I=0;for(;I=S.length;){if(I===1){if(S===".")break;if(S==="/"){x.push("/");break}else{x.push(S);break}}else if(I===2){if(S[0]==="."){if(S[1]===".")break;if(S[1]==="/"){S=S.slice(2);continue}}else if(S[0]==="/"&&(S[1]==="."||S[1]==="/")){x.push("/");break}}else if(I===3&&S==="/.."){x.length!==0&&x.pop(),x.push("/");break}if(S[0]==="."){if(S[1]==="."){if(S[2]==="/"){S=S.slice(3);continue}}else if(S[1]==="/"){S=S.slice(2);continue}}else if(S[0]==="/"&&S[1]==="."){if(S[2]==="/"){S=S.slice(2);continue}else if(S[2]==="."&&S[3]==="/"){S=S.slice(3),x.length!==0&&x.pop();continue}}if((T=S.indexOf("/",1))===-1){x.push(S);break}else x.push(S.slice(0,T)),S=S.slice(T)}return x.join("")}var v={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},E=/[@/?#:]/g,y=/[@/?#]/g;function m(w,S){let x=S?y:E;return x.lastIndex=0,w.replace(x,T=>v[T])}function g(w,S=!1){if(w.indexOf("%")===-1)return w;let x="";for(let T=0;T<w.length;T++){if(w[T]==="%"&&T+2<w.length){let I=w.slice(T+1,T+3);if(s(I)){let L=I.toUpperCase(),P=String.fromCharCode(parseInt(L,16));S&&n(P)?x+=P:x+="%"+L,T+=2;continue}}x+=w[T]}return x}function b(w){let S="";for(let x=0;x<w.length;x++){if(w[x]==="%"&&x+2<w.length){let T=w.slice(x+1,x+3);if(s(T)){let I=T.toUpperCase(),L=String.fromCharCode(parseInt(I,16));L!=="."&&n(L)?S+=L:S+="%"+I,x+=2;continue}}a(w[x])?S+=w[x]:S+=escape(w[x])}return S}function C(w){let S="";for(let x=0;x<w.length;x++){if(w[x]==="%"&&x+2<w.length){let T=w.slice(x+1,x+3);if(s(T)){S+="%"+T.toUpperCase(),x+=2;continue}}S+=escape(w[x])}return S}function A(w){let S=[];if(w.userinfo!==void 0&&(S.push(w.userinfo),S.push("@")),w.host!==void 0){let x=unescape(w.host);if(!i(x)){let T=h(x);T.isIPV6===!0?x=`[${T.escapedHost}]`:x=m(x,!1)}S.push(x)}return(typeof w.port=="number"||typeof w.port=="string")&&(S.push(":"),S.push(String(w.port))),S.length?S.join(""):void 0}t.exports={nonSimpleDomain:l,recomposeAuthority:A,reescapeHostDelimiters:m,normalizePercentEncoding:g,normalizePathEncoding:b,escapePreservingEscapes:C,removeDotSegments:_,isIPv4:i,isUUID:r,normalizeIPv6:h,stringArrayToHexStripped:o}}),YU=j(function(e,t){var{isUUID:r}=RA(),i=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,s=["http","https","ws","wss","urn","urn:uuid"];function n(w){return s.indexOf(w)!==-1}function a(w){return w.secure===!0?!0:w.secure===!1?!1:w.scheme?w.scheme.length===3&&(w.scheme[0]==="w"||w.scheme[0]==="W")&&(w.scheme[1]==="s"||w.scheme[1]==="S")&&(w.scheme[2]==="s"||w.scheme[2]==="S"):!1}function o(w){return w.host||(w.error=w.error||"HTTP URIs must have a host."),w}function l(w){let S=String(w.scheme).toLowerCase()==="https";return(w.port===(S?443:80)||w.port==="")&&(w.port=void 0),w.path||(w.path="/"),w}function c(w){return w.secure=a(w),w.resourceName=(w.path||"/")+(w.query?"?"+w.query:""),w.path=void 0,w.query=void 0,w}function u(w){if((w.port===(a(w)?443:80)||w.port==="")&&(w.port=void 0),typeof w.secure=="boolean"&&(w.scheme=w.secure?"wss":"ws",w.secure=void 0),w.resourceName){let[S,x]=w.resourceName.split("?");w.path=S&&S!=="/"?S:void 0,w.query=x,w.resourceName=void 0}return w.fragment=void 0,w}function p(w,S){if(!w.path)return w.error="URN can not be parsed",w;let x=w.path.match(i);if(x){let T=S.scheme||w.scheme||"urn";w.nid=x[1].toLowerCase(),w.nss=x[2];let I=`${T}:${S.nid||w.nid}`,L=A(I);w.path=void 0,L&&(w=L.parse(w,S))}else w.error=w.error||"URN can not be parsed.";return w}function h(w,S){if(w.nid===void 0)throw Error("URN without nid cannot be serialized");let x=S.scheme||w.scheme||"urn",T=w.nid.toLowerCase(),I=`${x}:${S.nid||T}`,L=A(I);L&&(w=L.serialize(w,S));let P=w,$=w.nss;return P.path=`${T||S.nid}:${$}`,S.skipEscape=!0,P}function f(w,S){let x=w;return x.uuid=x.nss,x.nss=void 0,!S.tolerant&&(!x.uuid||!r(x.uuid))&&(x.error=x.error||"UUID is not valid."),x}function _(w){let S=w;return S.nss=(w.uuid||"").toLowerCase(),S}var v={scheme:"http",domainHost:!0,parse:o,serialize:l},E={scheme:"https",domainHost:v.domainHost,parse:o,serialize:l},y={scheme:"ws",domainHost:!0,parse:c,serialize:u},m={scheme:"wss",domainHost:y.domainHost,parse:y.parse,serialize:y.serialize},g={scheme:"urn",parse:p,serialize:h,skipNormalize:!0},b={scheme:"urn:uuid",parse:f,serialize:_,skipNormalize:!0},C={http:v,https:E,ws:y,wss:m,urn:g,"urn:uuid":b};Object.setPrototypeOf(C,null);function A(w){return w&&(C[w]||C[w.toLowerCase()])||void 0}t.exports={wsIsSecure:a,SCHEMES:C,isValidSchemeName:n,getSchemeHandler:A}}),JU=j(function(e,t){var{normalizeIPv6:r,removeDotSegments:i,recomposeAuthority:s,normalizePercentEncoding:n,normalizePathEncoding:a,escapePreservingEscapes:o,reescapeHostDelimiters:l,isIPv4:c,nonSimpleDomain:u}=RA(),{SCHEMES:p,getSchemeHandler:h}=YU();function f(T,I){return typeof T=="string"?T=A(T,I):typeof T=="object"&&(T=C(y(T,I),I)),T}function _(T,I,L){let P=L?Object.assign({scheme:"null"},L):{scheme:"null"},$=v(C(T,P),C(I,P),P,!0);return P.skipEscape=!0,y($,P)}function v(T,I,L,P){let $={};return P||(T=C(y(T,L),L),I=C(y(I,L),L)),L=L||{},!L.tolerant&&I.scheme?($.scheme=I.scheme,$.userinfo=I.userinfo,$.host=I.host,$.port=I.port,$.path=i(I.path||""),$.query=I.query):(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0?($.userinfo=I.userinfo,$.host=I.host,$.port=I.port,$.path=i(I.path||""),$.query=I.query):(I.path?(I.path[0]==="/"?$.path=i(I.path):((T.userinfo!==void 0||T.host!==void 0||T.port!==void 0)&&!T.path?$.path="/"+I.path:T.path?$.path=T.path.slice(0,T.path.lastIndexOf("/")+1)+I.path:$.path=I.path,$.path=i($.path)),$.query=I.query):($.path=T.path,I.query!==void 0?$.query=I.query:$.query=T.query),$.userinfo=T.userinfo,$.host=T.host,$.port=T.port),$.scheme=T.scheme),$.fragment=I.fragment,$}function E(T,I,L){let P=S(T,L),$=S(I,L);return P!==void 0&&$!==void 0&&P.toLowerCase()===$.toLowerCase()}function y(T,I){let L={host:T.host,scheme:T.scheme,userinfo:T.userinfo,port:T.port,path:T.path,query:T.query,nid:T.nid,nss:T.nss,uuid:T.uuid,fragment:T.fragment,reference:T.reference,resourceName:T.resourceName,secure:T.secure,error:""},P=Object.assign({},I),$=[],se=h(P.scheme||L.scheme);se&&se.serialize&&se.serialize(L,P),L.path!==void 0&&(P.skipEscape?L.path=n(L.path):(L.path=o(L.path),L.scheme!==void 0&&(L.path=L.path.split("%3A").join(":")))),P.reference!=="suffix"&&L.scheme&&$.push(L.scheme,":");let ee=s(L);if(ee!==void 0&&(P.reference!=="suffix"&&$.push("//"),$.push(ee),L.path&&L.path[0]!=="/"&&$.push("/")),L.path!==void 0){let pe=L.path;!P.absolutePath&&(!se||!se.absolutePath)&&(pe=i(pe)),ee===void 0&&pe[0]==="/"&&pe[1]==="/"&&(pe="/%2F"+pe.slice(2)),$.push(pe)}return L.query!==void 0&&$.push("?",L.query),L.fragment!==void 0&&$.push("#",L.fragment),$.join("")}var m=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(T,I){if(I[2]!==void 0&&T.path&&T.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof T.port=="number"&&(T.port<0||T.port>65535))return"URI port is malformed."}function b(T,I){let L=Object.assign({},I),P={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},$=!1,se=!1;L.reference==="suffix"&&(L.scheme?T=L.scheme+":"+T:T="//"+T);let ee=T.match(m);if(ee){P.scheme=ee[1],P.userinfo=ee[3],P.host=ee[4],P.port=parseInt(ee[5],10),P.path=ee[6]||"",P.query=ee[7],P.fragment=ee[8],isNaN(P.port)&&(P.port=ee[5]);let pe=g(P,ee);if(pe!==void 0&&(P.error=P.error||pe,$=!0),P.host)if(c(P.host)===!1){let oe=r(P.host);P.host=oe.host.toLowerCase(),se=oe.isIPV6}else se=!0;P.scheme===void 0&&P.userinfo===void 0&&P.host===void 0&&P.port===void 0&&P.query===void 0&&!P.path?P.reference="same-document":P.scheme===void 0?P.reference="relative":P.fragment===void 0?P.reference="absolute":P.reference="uri",L.reference&&L.reference!=="suffix"&&L.reference!==P.reference&&(P.error=P.error||"URI is not a "+L.reference+" reference.");let ne=h(L.scheme||P.scheme);if(!L.unicodeSupport&&(!ne||!ne.unicodeSupport)&&P.host&&(L.domainHost||ne&&ne.domainHost)&&se===!1&&u(P.host))try{P.host=URL.domainToASCII(P.host.toLowerCase())}catch(oe){P.error=P.error||"Host's domain name can not be converted to ASCII: "+oe}if((!ne||ne&&!ne.skipNormalize)&&(T.indexOf("%")!==-1&&(P.scheme!==void 0&&(P.scheme=unescape(P.scheme)),P.host!==void 0&&(P.host=l(unescape(P.host),se))),P.path&&(P.path=a(P.path)),P.fragment))try{P.fragment=encodeURI(decodeURIComponent(P.fragment))}catch{P.error=P.error||"URI malformed"}ne&&ne.parse&&ne.parse(P,L)}else P.error=P.error||"URI can not be parsed.";return{parsed:P,malformedAuthorityOrPort:$}}function C(T,I){return b(T,I).parsed}function A(T,I){return w(T,I).normalized}function w(T,I){let{parsed:L,malformedAuthorityOrPort:P}=b(T,I);return{normalized:P?T:y(L,I),malformedAuthorityOrPort:P}}function S(T,I){if(typeof T=="string"){let{normalized:L,malformedAuthorityOrPort:P}=w(T,I);return P?void 0:L}if(typeof T=="object")return y(T,I)}var x={SCHEMES:p,normalize:f,resolve:_,resolveComponent:v,equal:E,serialize:y,parse:C};t.exports=x,t.exports.default=x,t.exports.fastUri=x}),QU=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=JU();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),e$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=zu();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=je();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});var i=U_(),s=Wu(),n=xA(),a=$_(),o=je(),l=Hu(),c=tu(),u=Ze(),p=XU(),h=QU(),f=(W,k)=>new RegExp(W,k);f.code="new RegExp";var _=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},m=200;function g(W){var k,U,N,R,M,K,J,ae,xe,be,_e,F,z,Q,ce,Se,Te,Qe,q,te,he,ve,fe,De,Ct;let $t=W.strict,xr=(k=W.code)===null||k===void 0?void 0:k.optimize,Li=xr===!0||xr===void 0?1:xr||0,Pi=(N=(U=W.code)===null||U===void 0?void 0:U.regExp)!==null&&N!==void 0?N:f,ls=(R=W.uriResolver)!==null&&R!==void 0?R:h.default;return{strictSchema:(K=(M=W.strictSchema)!==null&&M!==void 0?M:$t)!==null&&K!==void 0?K:!0,strictNumbers:(ae=(J=W.strictNumbers)!==null&&J!==void 0?J:$t)!==null&&ae!==void 0?ae:!0,strictTypes:(be=(xe=W.strictTypes)!==null&&xe!==void 0?xe:$t)!==null&&be!==void 0?be:"log",strictTuples:(F=(_e=W.strictTuples)!==null&&_e!==void 0?_e:$t)!==null&&F!==void 0?F:"log",strictRequired:(Q=(z=W.strictRequired)!==null&&z!==void 0?z:$t)!==null&&Q!==void 0?Q:!1,code:W.code?{...W.code,optimize:Li,regExp:Pi}:{optimize:Li,regExp:Pi},loopRequired:(ce=W.loopRequired)!==null&&ce!==void 0?ce:m,loopEnum:(Se=W.loopEnum)!==null&&Se!==void 0?Se:m,meta:(Te=W.meta)!==null&&Te!==void 0?Te:!0,messages:(Qe=W.messages)!==null&&Qe!==void 0?Qe:!0,inlineRefs:(q=W.inlineRefs)!==null&&q!==void 0?q:!0,schemaId:(te=W.schemaId)!==null&&te!==void 0?te:"$id",addUsedSchema:(he=W.addUsedSchema)!==null&&he!==void 0?he:!0,validateSchema:(ve=W.validateSchema)!==null&&ve!==void 0?ve:!0,validateFormats:(fe=W.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(De=W.unicodeRegExp)!==null&&De!==void 0?De:!0,int32range:(Ct=W.int32range)!==null&&Ct!==void 0?Ct:!0,uriResolver:ls}}class b{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...g(k)};let{es5:U,lines:N}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:v,es5:U,lines:N}),this.logger=L(k.logger);let R=k.validateFormats;k.validateFormats=!1,this.RULES=(0,n.getRules)(),C.call(this,E,k,"NOT SUPPORTED"),C.call(this,y,k,"DEPRECATED","warn"),this._metaOpts=T.call(this),k.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&x.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),w.call(this),k.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:k,meta:U,schemaId:N}=this.opts,R=p;N==="id"&&(R={...p},R.id=R.$id,delete R.$id),U&&k&&this.addMetaSchema(R,R[N],!1)}defaultMeta(){let{meta:k,schemaId:U}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[U]||k:void 0}validate(k,U){let N;if(typeof k=="string"){if(N=this.getSchema(k),!N)throw Error(`no schema with key or ref "${k}"`)}else N=this.compile(k);let R=N(U);return"$async"in N||(this.errors=N.errors),R}compile(k,U){let N=this._addSchema(k,U);return N.validate||this._compileSchemaEnv(N)}compileAsync(k,U){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:N}=this.opts;return R.call(this,k,U);async function R(be,_e){await M.call(this,be.$schema);let F=this._addSchema(be,_e);return F.validate||K.call(this,F)}async function M(be){be&&!this.getSchema(be)&&await R.call(this,{$ref:be},!0)}async function K(be){try{return this._compileSchemaEnv(be)}catch(_e){if(!(_e instanceof s.default))throw _e;return J.call(this,_e),await ae.call(this,_e.missingSchema),K.call(this,be)}}function J({missingSchema:be,missingRef:_e}){if(this.refs[be])throw Error(`AnySchema ${be} is loaded but ${_e} cannot be resolved`)}async function ae(be){let _e=await xe.call(this,be);this.refs[be]||await M.call(this,_e.$schema),this.refs[be]||this.addSchema(_e,be,U)}async function xe(be){let _e=this._loading[be];if(_e)return _e;try{return await(this._loading[be]=N(be))}finally{delete this._loading[be]}}}addSchema(k,U,N,R=this.opts.validateSchema){if(Array.isArray(k)){for(let K of k)this.addSchema(K,void 0,N,R);return this}let M;if(typeof k=="object"){let{schemaId:K}=this.opts;if(M=k[K],M!==void 0&&typeof M!="string")throw Error(`schema ${K} must be string`)}return U=(0,l.normalizeId)(U||M),this._checkUnique(U),this.schemas[U]=this._addSchema(k,N,U,R,!0),this}addMetaSchema(k,U,N=this.opts.validateSchema){return this.addSchema(k,U,!0,N),this}validateSchema(k,U){if(typeof k=="boolean")return!0;let N;if(N=k.$schema,N!==void 0&&typeof N!="string")throw Error("$schema must be a string");if(N=N||this.opts.defaultMeta||this.defaultMeta(),!N)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let R=this.validate(N,k);if(!R&&U){let M="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(M);else throw Error(M)}return R}getSchema(k){let U;for(;typeof(U=A.call(this,k))=="string";)k=U;if(U===void 0){let{schemaId:N}=this.opts,R=new a.SchemaEnv({schema:{},schemaId:N});if(U=a.resolveSchema.call(this,R,k),!U)return;this.refs[k]=U}return U.validate||this._compileSchemaEnv(U)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let U=A.call(this,k);return typeof U=="object"&&this._cache.delete(U.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{let U=k;this._cache.delete(U);let N=k[this.opts.schemaId];return N&&(N=(0,l.normalizeId)(N),delete this.schemas[N],delete this.refs[N]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(let U of k)this.addKeyword(U);return this}addKeyword(k,U){let N;if(typeof k=="string")N=k,typeof U=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),U.keyword=N);else if(typeof k=="object"&&U===void 0){if(U=k,N=U.keyword,Array.isArray(N)&&!N.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if($.call(this,N,U),!U)return(0,u.eachItem)(N,M=>se.call(this,M)),this;pe.call(this,U);let R={...U,type:(0,c.getJSONTypes)(U.type),schemaType:(0,c.getJSONTypes)(U.schemaType)};return(0,u.eachItem)(N,R.type.length===0?M=>se.call(this,M,R):M=>R.type.forEach(K=>se.call(this,M,R,K))),this}getKeyword(k){let U=this.RULES.all[k];return typeof U=="object"?U.definition:!!U}removeKeyword(k){let{RULES:U}=this;delete U.keywords[k],delete U.all[k];for(let N of U.rules){let R=N.rules.findIndex(M=>M.keyword===k);R>=0&&N.rules.splice(R,1)}return this}addFormat(k,U){return typeof U=="string"&&(U=new RegExp(U)),this.formats[k]=U,this}errorsText(k=this.errors,{separator:U=", ",dataVar:N="data"}={}){return!k||k.length===0?"No errors":k.map(R=>`${N}${R.instancePath} ${R.message}`).reduce((R,M)=>R+U+M)}$dataMetaSchema(k,U){let N=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(let R of U){let M=R.split("/").slice(1),K=k;for(let J of M)K=K[J];for(let J in N){let ae=N[J];if(typeof ae!="object")continue;let{$data:xe}=ae.definition,be=K[J];xe&&be&&(K[J]=oe(be))}}return k}_removeAllSchemas(k,U){for(let N in k){let R=k[N];(!U||U.test(N))&&(typeof R=="string"?delete k[N]:R&&!R.meta&&(this._cache.delete(R.schema),delete k[N]))}}_addSchema(k,U,N,R=this.opts.validateSchema,M=this.opts.addUsedSchema){let K,{schemaId:J}=this.opts;if(typeof k=="object")K=k[J];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof k!="boolean")throw Error("schema must be object or boolean")}let ae=this._cache.get(k);if(ae!==void 0)return ae;N=(0,l.normalizeId)(K||N);let xe=l.getSchemaRefs.call(this,k,N);return ae=new a.SchemaEnv({schema:k,schemaId:J,meta:U,baseId:N,localRefs:xe}),this._cache.set(ae.schema,ae),M&&!N.startsWith("#")&&(N&&this._checkUnique(N),this.refs[N]=ae),R&&this.validateSchema(k,!0),ae}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):a.compileSchema.call(this,k),!k.validate)throw Error("ajv implementation error");return k.validate}_compileMetaSchema(k){let U=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,k)}finally{this.opts=U}}}b.ValidationError=i.default,b.MissingRefError=s.default,e.default=b;function C(W,k,U,N="error"){for(let R in W){let M=R;M in k&&this.logger[N](`${U}: option ${R}. ${W[M]}`)}}function A(W){return W=(0,l.normalizeId)(W),this.schemas[W]||this.refs[W]}function w(){let W=this.opts.schemas;if(W)if(Array.isArray(W))this.addSchema(W);else for(let k in W)this.addSchema(W[k],k)}function S(){for(let W in this.opts.formats){let k=this.opts.formats[W];k&&this.addFormat(W,k)}}function x(W){if(Array.isArray(W)){this.addVocabulary(W);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let k in W){let U=W[k];U.keyword||(U.keyword=k),this.addKeyword(U)}}function T(){let W={...this.opts};for(let k of _)delete W[k];return W}var I={log(){},warn(){},error(){}};function L(W){if(W===!1)return I;if(W===void 0)return console;if(W.log&&W.warn&&W.error)return W;throw Error("logger must implement log, warn and error methods")}var P=/^[a-z_$][a-z0-9_$:-]*$/i;function $(W,k){let{RULES:U}=this;if((0,u.eachItem)(W,N=>{if(U.keywords[N])throw Error(`Keyword ${N} is already defined`);if(!P.test(N))throw Error(`Keyword ${N} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw Error('$data keyword must have "code" or "validate" function')}function se(W,k,U){var N;let R=k?.post;if(U&&R)throw Error('keyword with "post" flag cannot have "type"');let{RULES:M}=this,K=R?M.post:M.rules.find(({type:ae})=>ae===U);if(K||(K={type:U,rules:[]},M.rules.push(K)),M.keywords[W]=!0,!k)return;let J={keyword:W,definition:{...k,type:(0,c.getJSONTypes)(k.type),schemaType:(0,c.getJSONTypes)(k.schemaType)}};k.before?ee.call(this,K,J,k.before):K.rules.push(J),M.all[W]=J,(N=k.implements)===null||N===void 0||N.forEach(ae=>this.addKeyword(ae))}function ee(W,k,U){let N=W.rules.findIndex(R=>R.keyword===U);N>=0?W.rules.splice(N,0,k):(W.rules.push(k),this.logger.warn(`rule ${U} is not defined`))}function pe(W){let{metaSchema:k}=W;k!==void 0&&(W.$data&&this.opts.$data&&(k=oe(k)),W.validateSchema=this.compile(k,!0))}var ne={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oe(W){return{anyOf:[W,ne]}}}),t$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),r$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;var t=Wu(),r=ei(),i=je(),s=is(),n=$_(),a=Ze(),o={keyword:"$ref",schemaType:"string",code(u){let{gen:p,schema:h,it:f}=u,{baseId:_,schemaEnv:v,validateName:E,opts:y,self:m}=f,{root:g}=v;if((h==="#"||h==="#/")&&_===g.baseId)return C();let b=n.resolveRef.call(m,g,_,h);if(b===void 0)throw new t.default(f.opts.uriResolver,_,h);if(b instanceof n.SchemaEnv)return A(b);return w(b);function C(){if(v===g)return c(u,E,v,v.$async);let S=p.scopeValue("root",{ref:g});return c(u,i._`${S}.validate`,g,g.$async)}function A(S){let x=l(u,S);c(u,x,S,S.$async)}function w(S){let x=p.scopeValue("schema",y.code.source===!0?{ref:S,code:(0,i.stringify)(S)}:{ref:S}),T=p.name("valid"),I=u.subschema({schema:S,dataTypes:[],schemaPath:i.nil,topSchemaRef:x,errSchemaPath:h},T);u.mergeEvaluated(I),u.ok(T)}}};function l(u,p){let{gen:h}=u;return p.validate?h.scopeValue("validate",{ref:p.validate}):i._`${h.scopeValue("wrapper",{ref:p})}.validate`}e.getValidate=l;function c(u,p,h,f){let{gen:_,it:v}=u,{allErrors:E,schemaEnv:y,opts:m}=v,g=m.passContext?s.default.this:i.nil;f?b():C();function b(){if(!y.$async)throw Error("async schema referenced by sync schema");let S=_.let("valid");_.try(()=>{_.code(i._`await ${(0,r.callValidateCode)(u,p,g)}`),w(p),!E&&_.assign(S,!0)},x=>{_.if(i._`!(${x} instanceof ${v.ValidationError})`,()=>_.throw(x)),A(x),!E&&_.assign(S,!1)}),u.ok(S)}function C(){u.result((0,r.callValidateCode)(u,p,g),()=>w(p),()=>A(p))}function A(S){let x=i._`${S}.errors`;_.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${x} : ${s.default.vErrors}.concat(${x})`),_.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function w(S){var x;if(!v.opts.unevaluated)return;let T=(x=h?.validate)===null||x===void 0?void 0:x.evaluated;if(v.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(v.props=a.mergeEvaluated.props(_,T.props,v.props));else{let I=_.var("props",i._`${S}.evaluated.props`);v.props=a.mergeEvaluated.props(_,I,v.props,i.Name)}if(v.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(v.items=a.mergeEvaluated.items(_,T.items,v.items));else{let I=_.var("items",i._`${S}.evaluated.items`);v.items=a.mergeEvaluated.items(_,I,v.items,i.Name)}}}e.callRef=c,e.default=o}),i$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=t$(),r=r$(),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=i}),s$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=t.operators,i={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:a,schemaCode:o})=>t.str`must be ${i[a].okStr} ${o}`,params:({keyword:a,schemaCode:o})=>t._`{comparison: ${i[a].okStr}, limit: ${o}}`},n={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(a){let{keyword:o,data:l,schemaCode:c}=a;a.fail$data(t._`${l} ${i[o].fail} ${c} || isNaN(${l})`)}};e.default=n}),n$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r={message:({schemaCode:s})=>t.str`must be multiple of ${s}`,params:({schemaCode:s})=>t._`{multipleOf: ${s}}`},i={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:r,code(s){let{gen:n,data:a,schemaCode:o,it:l}=s,c=l.opts.multipleOfPrecision,u=n.let("res"),p=c?t._`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:t._`${u} !== parseInt(${u})`;s.fail$data(t._`(${o} === 0 || (${u} = ${a}/${o}, ${p}))`)}};e.default=i}),a$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(r){let i=r.length,s=0,n=0,a;for(;n<i;)s++,a=r.charCodeAt(n++),a>=55296&&a<=56319&&n<i&&(a=r.charCodeAt(n),(a&64512)===56320&&n++);return s}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),o$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=Ze(),i=a$(),s={message({keyword:a,schemaCode:o}){let l=a==="maxLength"?"more":"fewer";return t.str`must NOT have ${l} than ${o} characters`},params:({schemaCode:a})=>t._`{limit: ${a}}`},n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:s,code(a){let{keyword:o,data:l,schemaCode:c,it:u}=a,p=o==="maxLength"?t.operators.GT:t.operators.LT,h=u.opts.unicode===!1?t._`${l}.length`:t._`${(0,r.useFunc)(a.gen,i.default)}(${l})`;a.fail$data(t._`${h} ${p} ${c}`)}};e.default=n}),l$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ei(),r=Ze(),i=je(),s={message:({schemaCode:a})=>i.str`must match pattern "${a}"`,params:({schemaCode:a})=>i._`{pattern: ${a}}`},n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:s,code(a){let{gen:o,data:l,$data:c,schema:u,schemaCode:p,it:h}=a,f=h.opts.unicodeRegExp?"u":"";if(c){let{regExp:_}=h.opts.code,v=_.code==="new RegExp"?i._`new RegExp`:(0,r.useFunc)(o,_),E=o.let("valid");o.try(()=>o.assign(E,i._`${v}(${p}, ${f}).test(${l})`),()=>o.assign(E,!1)),a.fail$data(i._`!${E}`)}else{let _=(0,t.usePattern)(a,u);a.fail$data(i._`!${_}.test(${l})`)}}};e.default=n}),c$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r={message({keyword:s,schemaCode:n}){let a=s==="maxProperties"?"more":"fewer";return t.str`must NOT have ${a} than ${n} properties`},params:({schemaCode:s})=>t._`{limit: ${s}}`},i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:r,code(s){let{keyword:n,data:a,schemaCode:o}=s,l=n==="maxProperties"?t.operators.GT:t.operators.LT;s.fail$data(t._`Object.keys(${a}).length ${l} ${o}`)}};e.default=i}),u$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ei(),r=je(),i=Ze(),s={message:({params:{missingProperty:a}})=>r.str`must have required property '${a}'`,params:({params:{missingProperty:a}})=>r._`{missingProperty: ${a}}`},n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:s,code(a){let{gen:o,schema:l,schemaCode:c,data:u,$data:p,it:h}=a,{opts:f}=h;if(!p&&l.length===0)return;let _=l.length>=f.loopRequired;if(h.allErrors?v():E(),f.strictRequired){let g=a.parentSchema.properties,{definedProperties:b}=a.it;for(let C of l)if(g?.[C]===void 0&&!b.has(C)){let A=h.schemaEnv.baseId+h.errSchemaPath,w=`required property "${C}" is not defined at "${A}" (strictRequired)`;(0,i.checkStrictMode)(h,w,h.opts.strictRequired)}}function v(){if(_||p)a.block$data(r.nil,y);else for(let g of l)(0,t.checkReportMissingProp)(a,g)}function E(){let g=o.let("missing");if(_||p){let b=o.let("valid",!0);a.block$data(b,()=>m(g,b)),a.ok(b)}else o.if((0,t.checkMissingProp)(a,l,g)),(0,t.reportMissingProp)(a,g),o.else()}function y(){o.forOf("prop",c,g=>{a.setParams({missingProperty:g}),o.if((0,t.noPropertyInData)(o,u,g,f.ownProperties),()=>a.error())})}function m(g,b){a.setParams({missingProperty:g}),o.forOf(g,c,()=>{o.assign(b,(0,t.propertyInData)(o,u,g,f.ownProperties)),o.if((0,r.not)(b),()=>{a.error(),o.break()})},r.nil)}}};e.default=n}),d$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r={message({keyword:s,schemaCode:n}){let a=s==="maxItems"?"more":"fewer";return t.str`must NOT have ${a} than ${n} items`},params:({schemaCode:s})=>t._`{limit: ${s}}`},i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r,code(s){let{keyword:n,data:a,schemaCode:o}=s,l=n==="maxItems"?t.operators.GT:t.operators.LT;s.fail$data(t._`${a}.length ${l} ${o}`)}};e.default=i}),j_=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=TA();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),p$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=tu(),r=je(),i=Ze(),s=j_(),n={message:({params:{i:o,j:l}})=>r.str`must NOT have duplicate items (items ## ${l} and ${o} are identical)`,params:({params:{i:o,j:l}})=>r._`{i: ${o}, j: ${l}}`},a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:n,code(o){let{gen:l,data:c,$data:u,schema:p,parentSchema:h,schemaCode:f,it:_}=o;if(!u&&!p)return;let v=l.let("valid"),E=h.items?(0,t.getSchemaTypes)(h.items):[];o.block$data(v,y,r._`${f} === false`),o.ok(v);function y(){let C=l.let("i",r._`${c}.length`),A=l.let("j");o.setParams({i:C,j:A}),l.assign(v,!0),l.if(r._`${C} > 1`,()=>(m()?g:b)(C,A))}function m(){return E.length>0&&!E.some(C=>C==="object"||C==="array")}function g(C,A){let w=l.name("item"),S=(0,t.checkDataTypes)(E,w,_.opts.strictNumbers,t.DataType.Wrong),x=l.const("indices",r._`{}`);l.for(r._`;${C}--;`,()=>{l.let(w,r._`${c}[${C}]`),l.if(S,r._`continue`),E.length>1&&l.if(r._`typeof ${w} == "string"`,r._`${w} += "_"`),l.if(r._`typeof ${x}[${w}] == "number"`,()=>{l.assign(A,r._`${x}[${w}]`),o.error(),l.assign(v,!1).break()}).code(r._`${x}[${w}] = ${C}`)})}function b(C,A){let w=(0,i.useFunc)(l,s.default),S=l.name("outer");l.label(S).for(r._`;${C}--;`,()=>l.for(r._`${A} = ${C}; ${A}--;`,()=>l.if(r._`${w}(${c}[${C}], ${c}[${A}])`,()=>{o.error(),l.assign(v,!1).break(S)})))}}};e.default=a}),h$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=Ze(),i=j_(),s={message:"must be equal to constant",params:({schemaCode:a})=>t._`{allowedValue: ${a}}`},n={keyword:"const",$data:!0,error:s,code(a){let{gen:o,data:l,$data:c,schemaCode:u,schema:p}=a;c||p&&typeof p=="object"?a.fail$data(t._`!${(0,r.useFunc)(o,i.default)}(${l}, ${u})`):a.fail(t._`${p} !== ${l}`)}};e.default=n}),f$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=Ze(),i=j_(),s={message:"must be equal to one of the allowed values",params:({schemaCode:a})=>t._`{allowedValues: ${a}}`},n={keyword:"enum",schemaType:"array",$data:!0,error:s,code(a){let{gen:o,data:l,$data:c,schema:u,schemaCode:p,it:h}=a;if(!c&&u.length===0)throw Error("enum must have non-empty array");let f=u.length>=h.opts.loopEnum,_,v=()=>_??(_=(0,r.useFunc)(o,i.default)),E;if(f||c)E=o.let("valid"),a.block$data(E,y);else{if(!Array.isArray(u))throw Error("ajv implementation error");let g=o.const("vSchema",p);E=(0,t.or)(...u.map((b,C)=>m(g,C)))}a.pass(E);function y(){o.assign(E,!1),o.forOf("v",p,g=>o.if(t._`${v()}(${l}, ${g})`,()=>o.assign(E,!0).break()))}function m(g,b){let C=u[b];return typeof C=="object"&&C!==null?t._`${v()}(${l}, ${g}[${b}])`:t._`${l} === ${C}`}}};e.default=n}),m$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=s$(),r=n$(),i=o$(),s=l$(),n=c$(),a=u$(),o=d$(),l=p$(),c=h$(),u=f$(),p=[t.default,r.default,i.default,s.default,n.default,a.default,o.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default];e.default=p}),DA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;var t=je(),r=Ze(),i={message:({params:{len:a}})=>t.str`must NOT have more than ${a} items`,params:({params:{len:a}})=>t._`{limit: ${a}}`},s={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:i,code(a){let{parentSchema:o,it:l}=a,{items:c}=o;if(!Array.isArray(c)){(0,r.checkStrictMode)(l,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(a,c)}};function n(a,o){let{gen:l,schema:c,data:u,keyword:p,it:h}=a;h.items=!0;let f=l.const("len",t._`${u}.length`);if(c===!1)a.setParams({len:o.length}),a.pass(t._`${f} <= ${o.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(h,c)){let v=l.var("valid",t._`${f} <= ${o.length}`);l.if((0,t.not)(v),()=>_(v)),a.ok(v)}function _(v){l.forRange("i",o.length,f,E=>{a.subschema({keyword:p,dataProp:E,dataPropType:r.Type.Num},v),!h.allErrors&&l.if((0,t.not)(v),()=>l.break())})}}e.validateAdditionalItems=n,e.default=s}),IA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;var t=je(),r=Ze(),i=ei(),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){let{schema:o,it:l}=a;if(Array.isArray(o))return n(a,"additionalItems",o);l.items=!0,!(0,r.alwaysValidSchema)(l,o)&&a.ok((0,i.validateArray)(a))}};function n(a,o,l=a.schema){let{gen:c,parentSchema:u,data:p,keyword:h,it:f}=a;E(u),f.opts.unevaluated&&l.length&&f.items!==!0&&(f.items=r.mergeEvaluated.items(c,l.length,f.items));let _=c.name("valid"),v=c.const("len",t._`${p}.length`);l.forEach((y,m)=>{(0,r.alwaysValidSchema)(f,y)||(c.if(t._`${v} > ${m}`,()=>a.subschema({keyword:h,schemaProp:m,dataProp:m},_)),a.ok(_))});function E(y){let{opts:m,errSchemaPath:g}=f,b=l.length,C=b===y.minItems&&(b===y.maxItems||y[o]===!1);if(m.strictTuples&&!C){let A=`"${h}" is ${b}-tuple, but minItems or maxItems/${o} are not specified or different at path "${g}"`;(0,r.checkStrictMode)(f,A,m.strictTuples)}}}e.validateTuple=n,e.default=s}),g$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=IA(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:i=>(0,t.validateTuple)(i,"items")};e.default=r}),_$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=Ze(),i=ei(),s=DA(),n={message:({params:{len:o}})=>t.str`must NOT have more than ${o} items`,params:({params:{len:o}})=>t._`{limit: ${o}}`},a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:n,code(o){let{schema:l,parentSchema:c,it:u}=o,{prefixItems:p}=c;u.items=!0,!(0,r.alwaysValidSchema)(u,l)&&(p?(0,s.validateAdditionalItems)(o,p):o.ok((0,i.validateArray)(o)))}};e.default=a}),v$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=Ze(),i={message:({params:{min:n,max:a}})=>a===void 0?t.str`must contain at least ${n} valid item(s)`:t.str`must contain at least ${n} and no more than ${a} valid item(s)`,params:({params:{min:n,max:a}})=>a===void 0?t._`{minContains: ${n}}`:t._`{minContains: ${n}, maxContains: ${a}}`},s={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:i,code(n){let{gen:a,schema:o,parentSchema:l,data:c,it:u}=n,p,h,{minContains:f,maxContains:_}=l;u.opts.next?(p=f===void 0?1:f,h=_):p=1;let v=a.const("len",t._`${c}.length`);if(n.setParams({min:p,max:h}),h===void 0&&p===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&p>h){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,o)){let b=t._`${v} >= ${p}`;h!==void 0&&(b=t._`${b} && ${v} <= ${h}`),n.pass(b);return}u.items=!0;let E=a.name("valid");h===void 0&&p===1?m(E,()=>a.if(E,()=>a.break())):p===0?(a.let(E,!0),h!==void 0&&a.if(t._`${c}.length > 0`,y)):(a.let(E,!1),y()),n.result(E,()=>n.reset());function y(){let b=a.name("_valid"),C=a.let("count",0);m(b,()=>a.if(b,()=>g(C)))}function m(b,C){a.forRange("i",0,v,A=>{n.subschema({keyword:"contains",dataProp:A,dataPropType:r.Type.Num,compositeRule:!0},b),C()})}function g(b){a.code(t._`${b}++`),h===void 0?a.if(t._`${b} >= ${p}`,()=>a.assign(E,!0).break()):(a.if(t._`${b} > ${h}`,()=>a.assign(E,!1).break()),p===1?a.assign(E,!0):a.if(t._`${b} >= ${p}`,()=>a.assign(E,!0)))}}};e.default=s}),y$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=je(),r=Ze(),i=ei();e.error={message:({params:{property:l,depsCount:c,deps:u}})=>{let p=c===1?"property":"properties";return t.str`must have ${p} ${u} when property ${l} is present`},params:({params:{property:l,depsCount:c,deps:u,missingProperty:p}})=>t._`{property: ${l},
|
|
78
|
+
missingProperty: ${p},
|
|
79
|
+
depsCount: ${c},
|
|
80
|
+
deps: ${u}}`};var s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){let[c,u]=n(l);a(l,c),o(l,u)}};function n({schema:l}){let c={},u={};for(let p in l){if(p==="__proto__")continue;let h=Array.isArray(l[p])?c:u;h[p]=l[p]}return[c,u]}function a(l,c=l.schema){let{gen:u,data:p,it:h}=l;if(Object.keys(c).length===0)return;let f=u.let("missing");for(let _ in c){let v=c[_];if(v.length===0)continue;let E=(0,i.propertyInData)(u,p,_,h.opts.ownProperties);l.setParams({property:_,depsCount:v.length,deps:v.join(", ")}),h.allErrors?u.if(E,()=>{for(let y of v)(0,i.checkReportMissingProp)(l,y)}):(u.if(t._`${E} && (${(0,i.checkMissingProp)(l,v,f)})`),(0,i.reportMissingProp)(l,f),u.else())}}e.validatePropertyDeps=a;function o(l,c=l.schema){let{gen:u,data:p,keyword:h,it:f}=l,_=u.name("valid");for(let v in c)(0,r.alwaysValidSchema)(f,c[v])||(u.if((0,i.propertyInData)(u,p,v,f.opts.ownProperties),()=>{let E=l.subschema({keyword:h,schemaProp:v},_);l.mergeValidEvaluated(E,_)},()=>u.var(_,!0)),l.ok(_))}e.validateSchemaDeps=o,e.default=s}),b$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=Ze(),i={message:"property name must be valid",params:({params:n})=>t._`{propertyName: ${n.propertyName}}`},s={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:i,code(n){let{gen:a,schema:o,data:l,it:c}=n;if((0,r.alwaysValidSchema)(c,o))return;let u=a.name("valid");a.forIn("key",l,p=>{n.setParams({propertyName:p}),n.subschema({keyword:"propertyNames",data:p,dataTypes:["string"],propertyName:p,compositeRule:!0},u),a.if((0,t.not)(u),()=>{n.error(!0),!c.allErrors&&a.break()})}),n.ok(u)}};e.default=s}),LA=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ei(),r=je(),i=is(),s=Ze(),n={message:"must NOT have additional properties",params:({params:o})=>r._`{additionalProperty: ${o.additionalProperty}}`},a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:n,code(o){let{gen:l,schema:c,parentSchema:u,data:p,errsCount:h,it:f}=o;if(!h)throw Error("ajv implementation error");let{allErrors:_,opts:v}=f;if(f.props=!0,v.removeAdditional!=="all"&&(0,s.alwaysValidSchema)(f,c))return;let E=(0,t.allSchemaProperties)(u.properties),y=(0,t.allSchemaProperties)(u.patternProperties);m(),o.ok(r._`${h} === ${i.default.errors}`);function m(){l.forIn("key",p,w=>{!E.length&&!y.length?C(w):l.if(g(w),()=>C(w))})}function g(w){let S;if(E.length>8){let x=(0,s.schemaRefOrVal)(f,u.properties,"properties");S=(0,t.isOwnProperty)(l,x,w)}else E.length?S=(0,r.or)(...E.map(x=>r._`${w} === ${x}`)):S=r.nil;return y.length&&(S=(0,r.or)(S,...y.map(x=>r._`${(0,t.usePattern)(o,x)}.test(${w})`))),(0,r.not)(S)}function b(w){l.code(r._`delete ${p}[${w}]`)}function C(w){if(v.removeAdditional==="all"||v.removeAdditional&&c===!1){b(w);return}if(c===!1){o.setParams({additionalProperty:w}),o.error(),!_&&l.break();return}if(typeof c=="object"&&!(0,s.alwaysValidSchema)(f,c)){let S=l.name("valid");v.removeAdditional==="failing"?(A(w,S,!1),l.if((0,r.not)(S),()=>{o.reset(),b(w)})):(A(w,S),!_&&l.if((0,r.not)(S),()=>l.break()))}}function A(w,S,x){let T={keyword:"additionalProperties",dataProp:w,dataPropType:s.Type.Str};x===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(T,S)}}};e.default=a}),E$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=zu(),r=ei(),i=Ze(),s=LA(),n={keyword:"properties",type:"object",schemaType:"object",code(a){let{gen:o,schema:l,parentSchema:c,data:u,it:p}=a;p.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&s.default.code(new t.KeywordCxt(p,s.default,"additionalProperties"));let h=(0,r.allSchemaProperties)(l);for(let y of h)p.definedProperties.add(y);p.opts.unevaluated&&h.length&&p.props!==!0&&(p.props=i.mergeEvaluated.props(o,(0,i.toHash)(h),p.props));let f=h.filter(y=>!(0,i.alwaysValidSchema)(p,l[y]));if(f.length===0)return;let _=o.name("valid");for(let y of f)v(y)?E(y):(o.if((0,r.propertyInData)(o,u,y,p.opts.ownProperties)),E(y),!p.allErrors&&o.else().var(_,!0),o.endIf()),a.it.definedProperties.add(y),a.ok(_);function v(y){return p.opts.useDefaults&&!p.compositeRule&&l[y].default!==void 0}function E(y){a.subschema({keyword:"properties",schemaProp:y,dataProp:y},_)}}};e.default=n}),w$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ei(),r=je(),i=Ze(),s=Ze(),n={keyword:"patternProperties",type:"object",schemaType:"object",code(a){let{gen:o,schema:l,data:c,parentSchema:u,it:p}=a,{opts:h}=p,f=(0,t.allSchemaProperties)(l),_=f.filter(C=>(0,i.alwaysValidSchema)(p,l[C]));if(f.length===0||_.length===f.length&&(!p.opts.unevaluated||p.props===!0))return;let v=h.strictSchema&&!h.allowMatchingProperties&&u.properties,E=o.name("valid");p.props!==!0&&!(p.props instanceof r.Name)&&(p.props=(0,s.evaluatedPropsToName)(o,p.props));let{props:y}=p;m();function m(){for(let C of f)v&&g(C),p.allErrors?b(C):(o.var(E,!0),b(C),o.if(E))}function g(C){for(let A in v)new RegExp(C).test(A)&&(0,i.checkStrictMode)(p,`property ${A} matches pattern ${C} (use allowMatchingProperties)`)}function b(C){o.forIn("key",c,A=>{o.if(r._`${(0,t.usePattern)(a,C)}.test(${A})`,()=>{let w=_.includes(C);w||a.subschema({keyword:"patternProperties",schemaProp:C,dataProp:A,dataPropType:s.Type.Str},E),p.opts.unevaluated&&y!==!0?o.assign(r._`${y}[${A}]`,!0):!w&&!p.allErrors&&o.if((0,r.not)(E),()=>o.break())})})}}};e.default=n}),S$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ze(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(i){let{gen:s,schema:n,it:a}=i;if((0,t.alwaysValidSchema)(a,n)){i.fail();return}let o=s.name("valid");i.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),i.failResult(o,()=>i.reset(),()=>i.error())},error:{message:"must NOT be valid"}};e.default=r}),C$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=ei(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:t.validateUnion,error:{message:"must match a schema in anyOf"}};e.default=r}),O$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=Ze(),i={message:"must match exactly one schema in oneOf",params:({params:n})=>t._`{passingSchemas: ${n.passing}}`},s={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:i,code(n){let{gen:a,schema:o,parentSchema:l,it:c}=n;if(!Array.isArray(o))throw Error("ajv implementation error");if(c.opts.discriminator&&l.discriminator)return;let u=o,p=a.let("valid",!1),h=a.let("passing",null),f=a.name("_valid");n.setParams({passing:h}),a.block(_),n.result(p,()=>n.reset(),()=>n.error(!0));function _(){u.forEach((v,E)=>{let y;(0,r.alwaysValidSchema)(c,v)?a.var(f,!0):y=n.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},f),E>0&&a.if(t._`${f} && ${p}`).assign(p,!1).assign(h,t._`[${h}, ${E}]`).else(),a.if(f,()=>{a.assign(p,!0),a.assign(h,E),y&&n.mergeEvaluated(y,t.Name)})})}}};e.default=s}),A$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ze(),r={keyword:"allOf",schemaType:"array",code(i){let{gen:s,schema:n,it:a}=i;if(!Array.isArray(n))throw Error("ajv implementation error");let o=s.name("valid");n.forEach((l,c)=>{if((0,t.alwaysValidSchema)(a,l))return;let u=i.subschema({keyword:"allOf",schemaProp:c},o);i.ok(o),i.mergeEvaluated(u)})}};e.default=r}),x$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=Ze(),i={message:({params:a})=>t.str`must match "${a.ifClause}" schema`,params:({params:a})=>t._`{failingKeyword: ${a.ifClause}}`},s={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:i,code(a){let{gen:o,parentSchema:l,it:c}=a;l.then===void 0&&l.else===void 0&&(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=n(c,"then"),p=n(c,"else");if(!u&&!p)return;let h=o.let("valid",!0),f=o.name("_valid");if(_(),a.reset(),u&&p){let E=o.let("ifClause");a.setParams({ifClause:E}),o.if(f,v("then",E),v("else",E))}else u?o.if(f,v("then")):o.if((0,t.not)(f),v("else"));a.pass(h,()=>a.error(!0));function _(){let E=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},f);a.mergeEvaluated(E)}function v(E,y){return()=>{let m=a.subschema({keyword:E},f);o.assign(h,f),a.mergeValidEvaluated(m,h),y?o.assign(y,t._`${E}`):a.setParams({ifClause:E})}}}};function n(a,o){let l=a.schema[o];return l!==void 0&&!(0,r.alwaysValidSchema)(a,l)}e.default=s}),k$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ze(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:i,parentSchema:s,it:n}){s.if===void 0&&(0,t.checkStrictMode)(n,`"${i}" without "if" is ignored`)}};e.default=r}),T$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=DA(),r=g$(),i=IA(),s=_$(),n=v$(),a=y$(),o=b$(),l=LA(),c=E$(),u=w$(),p=S$(),h=C$(),f=O$(),_=A$(),v=x$(),E=k$();function y(m=!1){let g=[p.default,h.default,f.default,_.default,v.default,E.default,o.default,l.default,a.default,c.default,u.default];return m?g.push(r.default,s.default):g.push(t.default,i.default),g.push(n.default),g}e.default=y}),R$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r={message:({schemaCode:s})=>t.str`must match format "${s}"`,params:({schemaCode:s})=>t._`{format: ${s}}`},i={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(s,n){let{gen:a,data:o,$data:l,schema:c,schemaCode:u,it:p}=s,{opts:h,errSchemaPath:f,schemaEnv:_,self:v}=p;if(!h.validateFormats)return;l?E():y();function E(){let m=a.scopeValue("formats",{ref:v.formats,code:h.code.formats}),g=a.const("fDef",t._`${m}[${u}]`),b=a.let("fType"),C=a.let("format");a.if(t._`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>a.assign(b,t._`${g}.type || "string"`).assign(C,t._`${g}.validate`),()=>a.assign(b,t._`"string"`).assign(C,g)),s.fail$data((0,t.or)(A(),w()));function A(){return h.strictSchema===!1?t.nil:t._`${u} && !${C}`}function w(){let S=_.$async?t._`(${g}.async ? await ${C}(${o}) : ${C}(${o}))`:t._`${C}(${o})`,x=t._`(typeof ${C} == "function" ? ${S} : ${C}.test(${o}))`;return t._`${C} && ${C} !== true && ${b} === ${n} && !${x}`}}function y(){let m=v.formats[c];if(!m){A();return}if(m===!0)return;let[g,b,C]=w(m);g===n&&s.pass(S());function A(){if(h.strictSchema===!1){v.logger.warn(x());return}throw Error(x());function x(){return`unknown format "${c}" ignored in schema at path "${f}"`}}function w(x){let T=x instanceof RegExp?(0,t.regexpCode)(x):h.code.formats?t._`${h.code.formats}${(0,t.getProperty)(c)}`:void 0,I=a.scopeValue("formats",{key:c,ref:x,code:T});return typeof x=="object"&&!(x instanceof RegExp)?[x.type||"string",x.validate,t._`${I}.validate`]:["string",x,I]}function S(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!_.$async)throw Error("async format in sync schema");return t._`await ${C}(${o})`}return typeof b=="function"?t._`${C}(${o})`:t._`${C}.test(${o})`}}}};e.default=i}),D$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=R$(),r=[t.default];e.default=r}),I$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),L$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=i$(),r=m$(),i=T$(),s=D$(),n=I$(),a=[t.default,r.default,(0,i.default)(),s.default,n.metadataVocabulary,n.contentVocabulary];e.default=a}),P$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),N$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=je(),r=P$(),i=$_(),s=Wu(),n=Ze(),a={message:({params:{discrError:l,tagName:c}})=>l===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:l,tag:c,tagName:u}})=>t._`{error: ${l}, tag: ${u}, tagValue: ${c}}`},o={keyword:"discriminator",type:"object",schemaType:"object",error:a,code(l){let{gen:c,data:u,schema:p,parentSchema:h,it:f}=l,{oneOf:_}=h;if(!f.opts.discriminator)throw Error("discriminator: requires discriminator option");let v=p.propertyName;if(typeof v!="string")throw Error("discriminator: requires propertyName");if(p.mapping)throw Error("discriminator: mapping is not supported");if(!_)throw Error("discriminator: requires oneOf keyword");let E=c.let("valid",!1),y=c.const("tag",t._`${u}${(0,t.getProperty)(v)}`);c.if(t._`typeof ${y} == "string"`,()=>m(),()=>l.error(!1,{discrError:r.DiscrError.Tag,tag:y,tagName:v})),l.ok(E);function m(){let C=b();c.if(!1);for(let A in C)c.elseIf(t._`${y} === ${A}`),c.assign(E,g(C[A]));c.else(),l.error(!1,{discrError:r.DiscrError.Mapping,tag:y,tagName:v}),c.endIf()}function g(C){let A=c.name("valid"),w=l.subschema({keyword:"oneOf",schemaProp:C},A);return l.mergeEvaluated(w,t.Name),A}function b(){var C;let A={},w=x(h),S=!0;for(let L=0;L<_.length;L++){let P=_[L];if(P?.$ref&&!(0,n.schemaHasRulesButRef)(P,f.self.RULES)){let se=P.$ref;if(P=i.resolveRef.call(f.self,f.schemaEnv.root,f.baseId,se),P instanceof i.SchemaEnv&&(P=P.schema),P===void 0)throw new s.default(f.opts.uriResolver,f.baseId,se)}let $=(C=P?.properties)===null||C===void 0?void 0:C[v];if(typeof $!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);S=S&&(w||x(P)),T($,L)}if(!S)throw Error(`discriminator: "${v}" must be required`);return A;function x({required:L}){return Array.isArray(L)&&L.includes(v)}function T(L,P){if(L.const)I(L.const,P);else if(L.enum)for(let $ of L.enum)I($,P);else throw Error(`discriminator: "properties/${v}" must have "const" or "enum"`)}function I(L,P){if(typeof L!="string"||L in A)throw Error(`discriminator: "${v}" values must be unique strings`);A[L]=P}}}};e.default=o}),M$=j(function(e,t){t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),PA=j(function(e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;var r=e$(),i=L$(),s=N$(),n=M$(),a=["/properties"],o="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let _=this.opts.$data?this.$dataMetaSchema(n,a):n;this.addMetaSchema(_,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=zu();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=je();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var p=U_();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var h=Wu();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}),U$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(I,L){return{validate:I,compare:L}}e.fullFormats={date:t(n,a),time:t(l(!0),c),"date-time":t(h(!0),f),"iso-time":t(l(),u),"iso-date-time":t(h(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:y,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:T,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:g,int32:{type:"number",validate:A},int64:{type:"number",validate:w},float:{type:"number",validate:S},double:{type:"number",validate:S},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(I){return I%4===0&&(I%100!==0||I%400===0)}var i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n(I){let L=i.exec(I);if(!L)return!1;let P=+L[1],$=+L[2],se=+L[3];return $>=1&&$<=12&&se>=1&&se<=($===2&&r(P)?29:s[$])}function a(I,L){if(I&&L)return I>L?1:I<L?-1:0}var o=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(I){return function(L){let P=o.exec(L);if(!P)return!1;let $=+P[1],se=+P[2],ee=+P[3],pe=P[4],ne=P[5]==="-"?-1:1,oe=+(P[6]||0),W=+(P[7]||0);if(oe>23||W>59||I&&!pe)return!1;if($<=23&&se<=59&&ee<60)return!0;let k=se-W*ne,U=$-oe*ne-(k<0?1:0);return(U===23||U===-1)&&(k===59||k===-1)&&ee<61}}function c(I,L){if(!(I&&L))return;let P=new Date("2020-01-01T"+I).valueOf(),$=new Date("2020-01-01T"+L).valueOf();if(P&&$)return P-$}function u(I,L){if(!(I&&L))return;let P=o.exec(I),$=o.exec(L);if(P&&$)return I=P[1]+P[2]+P[3],L=$[1]+$[2]+$[3],I>L?1:I<L?-1:0}var p=/t|\s/i;function h(I){let L=l(I);return function(P){let $=P.split(p);return $.length===2&&n($[0])&&L($[1])}}function f(I,L){if(!(I&&L))return;let P=new Date(I).valueOf(),$=new Date(L).valueOf();if(P&&$)return P-$}function _(I,L){if(!(I&&L))return;let[P,$]=I.split(p),[se,ee]=L.split(p),pe=a(P,se);if(pe!==void 0)return pe||c($,ee)}var v=/\/|:/,E=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function y(I){return v.test(I)&&E.test(I)}var m=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function g(I){return m.lastIndex=0,m.test(I)}var b=-2147483648,C=2147483647;function A(I){return Number.isInteger(I)&&I<=C&&I>=b}function w(I){return Number.isInteger(I)}function S(){return!0}var x=/[^\\]\\Z/;function T(I){if(x.test(I))return!1;try{return new RegExp(I),!0}catch{return!1}}}),$$=j(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;var t=PA(),r=je(),i=r.operators,s={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},n={message:({keyword:o,schemaCode:l})=>r.str`should be ${s[o].okStr} ${l}`,params:({keyword:o,schemaCode:l})=>r._`{comparison: ${s[o].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:n,code(o){let{gen:l,data:c,schemaCode:u,keyword:p,it:h}=o,{opts:f,self:_}=h;if(!f.validateFormats)return;let v=new t.KeywordCxt(h,_.RULES.all.format.definition,"format");v.$data?E():y();function E(){let g=l.scopeValue("formats",{ref:_.formats,code:f.code.formats}),b=l.const("fmt",r._`${g}[${v.schemaCode}]`);o.fail$data((0,r.or)(r._`typeof ${b} != "object"`,r._`${b} instanceof RegExp`,r._`typeof ${b}.compare != "function"`,m(b)))}function y(){let g=v.schema,b=_.formats[g];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw Error(`"${p}": format "${g}" does not define "compare" function`);let C=l.scopeValue("formats",{key:g,ref:b,code:f.code.formats?r._`${f.code.formats}${(0,r.getProperty)(g)}`:void 0});o.fail$data(m(C))}function m(g){return r._`${g}.compare(${c}, ${u}) ${s[p].fail} 0`}},dependencies:["format"]};var a=o=>(o.addKeyword(e.formatLimitDefinition),o);e.default=a}),j$=j(function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=U$(),i=$$(),s=je(),n=new s.Name("fullFormats"),a=new s.Name("fastFormats"),o=(c,u={keywords:!0})=>{if(Array.isArray(u))return l(c,u,r.fullFormats,n),c;let[p,h]=u.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,n],f=u.formats||r.formatNames;return l(c,f,p,h),u.keywords&&(0,i.default)(c),c};o.get=(c,u="full")=>{let p=(u==="fast"?r.fastFormats:r.fullFormats)[c];if(!p)throw Error(`Unknown format "${c}"`);return p};function l(c,u,p,h){var f,_;(f=(_=c.opts.code).formats)!==null&&f!==void 0||(_.formats=s._`require("ajv-formats/dist/formats").${h}`);for(let v of u)c.addFormat(v,p[v])}t.exports=e=o,Object.defineProperty(e,"__esModule",{value:!0}),e.default=o});var NA="[\\w-]{1,63}",DCe=new RegExp(`^${NA}$`),ICe=new RegExp(`^a(?:${NA}-)?[0-9a-f]{16}$`);function B$(e,t){let r=Buffer.from(t.replace(/-/g,""),"hex"),i=F$("sha1").update(r).update(Buffer.from(e,"utf8")).digest();i[6]=i[6]&15|80,i[8]=i[8]&63|128;let s=i.subarray(0,16).toString("hex");return`${s.slice(0,8)}-${s.slice(8,12)}-${s.slice(12,16)}-${s.slice(16,20)}-${s.slice(20,32)}`}var H$="3ab19d7e-9f35-45c2-926e-75e271cc60b3";function z$(){let e=process.env.CLAUDE_CODE_REMOTE_SESSION_ID?.trim();return e?B$(e,H$):null}function W$(){this.__data__=[],this.size=0}var K$=W$;function G$(e,t){return e===t||e!==e&&t!==t}var dl=G$;function q$(e,t){for(var r=e.length;r--;)if(dl(e[r][0],t))return r;return-1}var Ku=q$,V$=Array.prototype,Z$=V$.splice;function X$(e){var t=this.__data__,r=Ku(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():Z$.call(t,r,1),--this.size,!0}var Y$=X$;function J$(e){var t=this.__data__,r=Ku(t,e);return r<0?void 0:t[r][1]}var Q$=J$;function ej(e){return Ku(this.__data__,e)>-1}var tj=ej;function rj(e,t){var r=this.__data__,i=Ku(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}var ij=rj;function la(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}la.prototype.clear=K$;la.prototype.delete=Y$;la.prototype.get=Q$;la.prototype.has=tj;la.prototype.set=ij;var Gu=la;function sj(){this.__data__=new Gu,this.size=0}var nj=sj;function aj(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var oj=aj;function lj(e){return this.__data__.get(e)}var cj=lj;function uj(e){return this.__data__.has(e)}var dj=uj,pj=typeof global=="object"&&global&&global.Object===Object&&global,MA=pj,hj=typeof self=="object"&&self&&self.Object===Object&&self,fj=MA||hj||Function("return this")(),mi=fj,mj=mi.Symbol,Ur=mj,gj=Object.prototype,{hasOwnProperty:_j,toString:vj}=gj,Ja=Ur?Ur.toStringTag:void 0;function yj(e){var t=_j.call(e,Ja),r=e[Ja];try{e[Ja]=void 0;var i=!0}catch{}var s=vj.call(e);return i&&(t?e[Ja]=r:delete e[Ja]),s}var bj=yj,Ej=Object.prototype,wj=Ej.toString;function Sj(e){return wj.call(e)}var Cj=Sj,Oj="[object Null]",Aj="[object Undefined]",nE=Ur?Ur.toStringTag:void 0;function xj(e){return e==null?e===void 0?Aj:Oj:nE&&nE in Object(e)?bj(e):Cj(e)}var Ms=xj;function kj(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Jr=kj,Tj="[object AsyncFunction]",Rj="[object Function]",Dj="[object GeneratorFunction]",Ij="[object Proxy]";function Lj(e){if(!Jr(e))return!1;var t=Ms(e);return t==Rj||t==Dj||t==Tj||t==Ij}var F_=Lj,Pj=mi["__core-js_shared__"],gp=Pj,aE=(function(){var e=/[^.]+$/.exec(gp&&gp.keys&&gp.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Nj(e){return!!aE&&aE in e}var Mj=Nj,Uj=Function.prototype,$j=Uj.toString;function jj(e){if(e!=null){try{return $j.call(e)}catch{}try{return e+""}catch{}}return""}var Us=jj,Fj=/[\\^$.*+?()[\]{}|]/g,Bj=/^\[object .+?Constructor\]$/,Hj=Function.prototype,zj=Object.prototype,Wj=Hj.toString,Kj=zj.hasOwnProperty,Gj=RegExp("^"+Wj.call(Kj).replace(Fj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qj(e){if(!Jr(e)||Mj(e))return!1;var t=F_(e)?Gj:Bj;return t.test(Us(e))}var Vj=qj;function Zj(e,t){return e?.[t]}var Xj=Zj;function Yj(e,t){var r=Xj(e,t);return Vj(r)?r:void 0}var $s=Yj,Jj=$s(mi,"Map"),Lo=Jj,Qj=$s(Object,"create"),Po=Qj;function eF(){this.__data__=Po?Po(null):{},this.size=0}var tF=eF;function rF(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var iF=rF,sF="__lodash_hash_undefined__",nF=Object.prototype,aF=nF.hasOwnProperty;function oF(e){var t=this.__data__;if(Po){var r=t[e];return r===sF?void 0:r}return aF.call(t,e)?t[e]:void 0}var lF=oF,cF=Object.prototype,uF=cF.hasOwnProperty;function dF(e){var t=this.__data__;return Po?t[e]!==void 0:uF.call(t,e)}var pF=dF,hF="__lodash_hash_undefined__";function fF(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Po&&t===void 0?hF:t,this}var mF=fF;function ca(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}ca.prototype.clear=tF;ca.prototype.delete=iF;ca.prototype.get=lF;ca.prototype.has=pF;ca.prototype.set=mF;var oE=ca;function gF(){this.size=0,this.__data__={hash:new oE,map:new(Lo||Gu),string:new oE}}var _F=gF;function vF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var yF=vF;function bF(e,t){var r=e.__data__;return yF(t)?r[typeof t=="string"?"string":"hash"]:r.map}var qu=bF;function EF(e){var t=qu(this,e).delete(e);return this.size-=t?1:0,t}var wF=EF;function SF(e){return qu(this,e).get(e)}var CF=SF;function OF(e){return qu(this,e).has(e)}var AF=OF;function xF(e,t){var r=qu(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var kF=xF;function ua(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}ua.prototype.clear=_F;ua.prototype.delete=wF;ua.prototype.get=CF;ua.prototype.has=AF;ua.prototype.set=kF;var Vu=ua,TF=200;function RF(e,t){var r=this.__data__;if(r instanceof Gu){var i=r.__data__;if(!Lo||i.length<TF-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Vu(i)}return r.set(e,t),this.size=r.size,this}var DF=RF;function da(e){var t=this.__data__=new Gu(e);this.size=t.size}da.prototype.clear=nj;da.prototype.delete=oj;da.prototype.get=cj;da.prototype.has=dj;da.prototype.set=DF;var Sn=da,IF="__lodash_hash_undefined__";function LF(e){return this.__data__.set(e,IF),this}var PF=LF;function NF(e){return this.__data__.has(e)}var MF=NF;function ru(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Vu;++t<r;)this.add(e[t])}ru.prototype.add=ru.prototype.push=PF;ru.prototype.has=MF;var UF=ru;function $F(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}var jF=$F;function FF(e,t){return e.has(t)}var BF=FF,HF=1,zF=2;function WF(e,t,r,i,s,n){var a=r&HF,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=n.get(e),u=n.get(t);if(c&&u)return c==t&&u==e;var p=-1,h=!0,f=r&zF?new UF:void 0;for(n.set(e,t),n.set(t,e);++p<o;){var _=e[p],v=t[p];if(i)var E=a?i(v,_,p,t,e,n):i(_,v,p,e,t,n);if(E!==void 0){if(E)continue;h=!1;break}if(f){if(!jF(t,function(y,m){if(!BF(f,m)&&(_===y||s(_,y,r,i,n)))return f.push(m)})){h=!1;break}}else if(!(_===v||s(_,v,r,i,n))){h=!1;break}}return n.delete(e),n.delete(t),h}var UA=WF,KF=mi.Uint8Array,iu=KF;function GF(e){var t=-1,r=Array(e.size);return e.forEach(function(i,s){r[++t]=[s,i]}),r}var qF=GF;function VF(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var ZF=VF,XF=1,YF=2,JF="[object Boolean]",QF="[object Date]",e2="[object Error]",t2="[object Map]",r2="[object Number]",i2="[object RegExp]",s2="[object Set]",n2="[object String]",a2="[object Symbol]",o2="[object ArrayBuffer]",l2="[object DataView]",cE=Ur?Ur.prototype:void 0,_p=cE?cE.valueOf:void 0;function c2(e,t,r,i,s,n,a){switch(r){case l2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case o2:return!(e.byteLength!=t.byteLength||!n(new iu(e),new iu(t)));case JF:case QF:case r2:return dl(+e,+t);case e2:return e.name==t.name&&e.message==t.message;case i2:case n2:return e==t+"";case t2:var o=qF;case s2:var l=i&XF;if(o||(o=ZF),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=YF,a.set(e,t);var u=UA(o(e),o(t),i,s,n,a);return a.delete(e),u;case a2:if(_p)return _p.call(e)==_p.call(t)}return!1}var u2=c2;function d2(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}var B_=d2,p2=Array.isArray,Sr=p2;function h2(e,t,r){var i=t(e);return Sr(e)?i:B_(i,r(e))}var $A=h2;function f2(e,t){for(var r=-1,i=e==null?0:e.length,s=0,n=[];++r<i;){var a=e[r];t(a,r,e)&&(n[s++]=a)}return n}var m2=f2;function g2(){return[]}var jA=g2,_2=Object.prototype,v2=_2.propertyIsEnumerable,uE=Object.getOwnPropertySymbols,y2=uE?function(e){return e==null?[]:(e=Object(e),m2(uE(e),function(t){return v2.call(e,t)}))}:jA,H_=y2;function b2(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var E2=b2;function w2(e){return e!=null&&typeof e=="object"}var li=w2,S2="[object Arguments]";function C2(e){return li(e)&&Ms(e)==S2}var dE=C2,O2=Object.prototype,{hasOwnProperty:A2,propertyIsEnumerable:x2}=O2,k2=dE((function(){return arguments})())?dE:function(e){return li(e)&&A2.call(e,"callee")&&!x2.call(e,"callee")},No=k2,lo={};fr(lo,{default:()=>Pn});function T2(){return!1}var R2=T2,FA=typeof lo=="object"&&lo&&!lo.nodeType&&lo,pE=FA&&typeof Gh=="object"&&Gh&&!Gh.nodeType&&Gh,D2=pE&&pE.exports===FA,hE=D2?mi.Buffer:void 0,I2=hE?hE.isBuffer:void 0,L2=I2||R2,Pn=L2,P2=9007199254740991,N2=/^(?:0|[1-9]\d*)$/;function M2(e,t){var r=typeof e;return t=t??P2,!!t&&(r=="number"||r!="symbol"&&N2.test(e))&&e>-1&&e%1==0&&e<t}var Zu=M2,U2=9007199254740991;function $2(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=U2}var z_=$2,j2="[object Arguments]",F2="[object Array]",B2="[object Boolean]",H2="[object Date]",z2="[object Error]",W2="[object Function]",K2="[object Map]",G2="[object Number]",q2="[object Object]",V2="[object RegExp]",Z2="[object Set]",X2="[object String]",Y2="[object WeakMap]",J2="[object ArrayBuffer]",Q2="[object DataView]",eB="[object Float32Array]",tB="[object Float64Array]",rB="[object Int8Array]",iB="[object Int16Array]",sB="[object Int32Array]",nB="[object Uint8Array]",aB="[object Uint8ClampedArray]",oB="[object Uint16Array]",lB="[object Uint32Array]",lt={};lt[eB]=lt[tB]=lt[rB]=lt[iB]=lt[sB]=lt[nB]=lt[aB]=lt[oB]=lt[lB]=!0;lt[j2]=lt[F2]=lt[J2]=lt[B2]=lt[Q2]=lt[H2]=lt[z2]=lt[W2]=lt[K2]=lt[G2]=lt[q2]=lt[V2]=lt[Z2]=lt[X2]=lt[Y2]=!1;function cB(e){return li(e)&&z_(e.length)&&!!lt[Ms(e)]}var uB=cB;function dB(e){return function(t){return e(t)}}var W_=dB,co={};fr(co,{default:()=>Rs});var BA=typeof co=="object"&&co&&!co.nodeType&&co,So=BA&&typeof Vh=="object"&&Vh&&!Vh.nodeType&&Vh,pB=So&&So.exports===BA,vp=pB&&MA.process,hB=(function(){try{var e=So&&So.require&&So.require("util").types;return e||vp&&vp.binding&&vp.binding("util")}catch{}})(),Rs=hB,fE=Rs&&Rs.isTypedArray,fB=fE?W_(fE):uB,K_=fB,mB=Object.prototype,gB=mB.hasOwnProperty;function _B(e,t){var r=Sr(e),i=!r&&No(e),s=!r&&!i&&Pn(e),n=!r&&!i&&!s&&K_(e),a=r||i||s||n,o=a?E2(e.length,String):[],l=o.length;for(var c in e)(t||gB.call(e,c))&&!(a&&(c=="length"||s&&(c=="offset"||c=="parent")||n&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Zu(c,l)))&&o.push(c);return o}var HA=_B,vB=Object.prototype;function yB(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||vB;return e===r}var G_=yB;function bB(e,t){return function(r){return e(t(r))}}var zA=bB,EB=zA(Object.keys,Object),wB=EB,SB=Object.prototype,CB=SB.hasOwnProperty;function OB(e){if(!G_(e))return wB(e);var t=[];for(var r in Object(e))CB.call(e,r)&&r!="constructor"&&t.push(r);return t}var AB=OB;function xB(e){return e!=null&&z_(e.length)&&!F_(e)}var Xu=xB;function kB(e){return Xu(e)?HA(e):AB(e)}var pl=kB;function TB(e){return $A(e,pl,H_)}var vf=TB,RB=1,DB=Object.prototype,IB=DB.hasOwnProperty;function LB(e,t,r,i,s,n){var a=r&RB,o=vf(e),l=o.length,c=vf(t),u=c.length;if(l!=u&&!a)return!1;for(var p=l;p--;){var h=o[p];if(!(a?h in t:IB.call(t,h)))return!1}var f=n.get(e),_=n.get(t);if(f&&_)return f==t&&_==e;var v=!0;n.set(e,t),n.set(t,e);for(var E=a;++p<l;){h=o[p];var y=e[h],m=t[h];if(i)var g=a?i(m,y,h,t,e,n):i(y,m,h,e,t,n);if(!(g===void 0?y===m||s(y,m,r,i,n):g)){v=!1;break}E||(E=h=="constructor")}if(v&&!E){var b=e.constructor,C=t.constructor;b!=C&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(v=!1)}return n.delete(e),n.delete(t),v}var PB=LB,NB=$s(mi,"DataView"),yf=NB,MB=$s(mi,"Promise"),bf=MB,UB=$s(mi,"Set"),Ef=UB,$B=$s(mi,"WeakMap"),wf=$B,mE="[object Map]",jB="[object Object]",gE="[object Promise]",_E="[object Set]",vE="[object WeakMap]",yE="[object DataView]",FB=Us(yf),BB=Us(Lo),HB=Us(bf),zB=Us(Ef),WB=Us(wf),_s=Ms;(yf&&_s(new yf(new ArrayBuffer(1)))!=yE||Lo&&_s(new Lo)!=mE||bf&&_s(bf.resolve())!=gE||Ef&&_s(new Ef)!=_E||wf&&_s(new wf)!=vE)&&(_s=function(e){var t=Ms(e),r=t==jB?e.constructor:void 0,i=r?Us(r):"";if(i)switch(i){case FB:return yE;case BB:return mE;case HB:return gE;case zB:return _E;case WB:return vE}return t});var Mo=_s,KB=1,bE="[object Arguments]",EE="[object Array]",rc="[object Object]",GB=Object.prototype,wE=GB.hasOwnProperty;function qB(e,t,r,i,s,n){var a=Sr(e),o=Sr(t),l=a?EE:Mo(e),c=o?EE:Mo(t);l=l==bE?rc:l,c=c==bE?rc:c;var u=l==rc,p=c==rc,h=l==c;if(h&&Pn(e)){if(!Pn(t))return!1;a=!0,u=!1}if(h&&!u)return n||(n=new Sn),a||K_(e)?UA(e,t,r,i,s,n):u2(e,t,l,r,i,s,n);if(!(r&KB)){var f=u&&wE.call(e,"__wrapped__"),_=p&&wE.call(t,"__wrapped__");if(f||_){var v=f?e.value():e,E=_?t.value():t;return n||(n=new Sn),s(v,E,r,i,n)}}return h?(n||(n=new Sn),PB(e,t,r,i,s,n)):!1}var VB=qB;function WA(e,t,r,i,s){return e===t?!0:e==null||t==null||!li(e)&&!li(t)?e!==e&&t!==t:VB(e,t,r,i,WA,s)}var q_=WA;function ZB(e,t){return q_(e,t)}var Qa=ZB,YB;function ni(){return YB===!0}var Nt=class{#e;#t=new WeakMap;constructor(t){this.#e=t}of(t){let r=this.#t.get(t);if(r!==void 0)return r;let i=this.#e();return this.#t.set(t,i),i}};Qo();var Sf=class{mergedSettings=null;perSource=new Map;parsedFiles=new Map;folderListings=new Map;managedFileReads=new Map;primedFiles=new Set;policyWalks=0;walkedFolders=new Map;policy={};lastPolicyEnvComposition=null;isLoadingFromDisk=!1;autoModeUntrustedSourceWarned=!1;changed=dr();internalWrites=new Map;enabledSources;pluginBase;epoch=0;systemSpaceServingLogged=!1;systemAttestationContradicted=!1;backendReadResetTail=Promise.resolve();invalidated=dr();pluginBaseLoaded=!1;primer;localStoreProbes=new Cf;retained=new Map;retainedListings=new Map;setPluginBase(t){this.pluginBase=t,this.pluginBaseLoaded=!0}clearPluginBase(){this.pluginBase=void 0}invalidateAll(t){if(this.epoch++,this.mergedSettings=null,this.perSource.clear(),this.parsedFiles.clear(),this.primedFiles.clear(),this.policyWalks=0,this.walkedFolders.clear(),this.folderListings.clear(),this.policy={},t?.userLayer==="retain"&&ni()&&this.primer!==void 0){for(let[r,i]of this.retained)this.parsedFiles.set(r,i.parsed),this.primedFiles.add(r);for(let[r,i]of this.retainedListings)this.folderListings.set(r,i.names)}else this.retained.clear(),this.retainedListings.clear();this.invalidated.emit()}invalidatePolicyLayer(){this.mergedSettings=null,this.perSource.delete("policySettings"),this.policy={}}onInvalidate(t){return this.invalidated.subscribe(t)}seedParsedFile(t,r,i,s){if(s!==this.epoch)return!1;let n=this.parsedFiles.get(t),a=n===void 0||!Qa(n,i);this.parsedFiles.set(t,i),(a||this.primedFiles.has(t))&&this.primedFiles.add(t);let o=this.retained.get(t);return o!==void 0&&(o.parsed=i),a&&this.dropDerivedCaches(r),!0}walkReadDiffers(t,r){let i=this.parsedFiles.get(t);return i!==void 0&&!this.primedFiles.has(t)&&!Qa(i,r)}unseedParsedFile(t,r,i){i===this.epoch&&(this.retained.delete(t),!(!this.primedFiles.has(t)||r==="policySettings"&&this.policyWalks>0)&&(this.primedFiles.delete(t),this.parsedFiles.delete(t),this.dropDerivedCaches(r)))}dropDerivedCaches(t){this.perSource.delete(t),this.mergedSettings=null,t==="policySettings"&&(this.policy={})}primedFolderListing(t){return ni()?this.folderListings.get(t):void 0}folderListingForPolicyWalk(t){if(!ni())return;this.policyWalks++;let r=this.folderListings.get(t);return(!this.walkedFolders.has(t)||r!==void 0)&&this.walkedFolders.set(t,r??null),r}noteWalkListing(t,r){ni()&&this.walkedFolders.set(t,r)}get policyWalkCount(){return this.policyWalks}policyInstallVerdict(t,r,i){let s=this.parsedFiles.get(t);return s===void 0||Qa(s,r)?"install":this.primedFiles.has(t)?this.policyWalks===0?"install":this.policyWalks>i?"raced":"deferred":"raced"}folderInstallVerdict(t,r,i){if(!this.walkedFolders.has(t))return this.hasParsedDropInOutside(t,r)?"raced":"install";let s=this.walkedFolders.get(t);return s!=null&&Qa(s,r)?"install":this.policyWalks>i?"raced":"deferred"}seedFolderListing(t,r,i){if(i!==this.epoch)return!1;let s=this.folderListings.get(t);this.folderListings.set(t,r);let n=this.retainedListings.get(t);return n!==void 0&&(n.names=r),s!==void 0&&!Qa(s,r)&&this.dropDerivedCaches("policySettings"),!0}walkReadManagedFileIn(t,r){for(let[i,s]of this.parsedFiles)if(!i.includes("\0")&&!this.primedFiles.has(i)&&(s.settings!==null||s.errors.length>0)&&(i===t||SE(i)===r))return!0;return!1}walkRead(t){return this.parsedFiles.has(t)&&!this.primedFiles.has(t)}hasParsedDropInOutside(t,r){for(let i of this.parsedFiles.keys())if(!i.includes("\0")&&!this.primedFiles.has(i)&&SE(i)===t&&!r.includes(XB(i)))return!0;return!1}clearFolderListing(t,r){r===this.epoch&&(this.retainedListings.delete(t),!(!this.folderListings.has(t)||this.walkedFolders.has(t))&&(this.folderListings.delete(t),this.dropDerivedCaches("policySettings")))}retainLayer(t,r){let i={parsed:r};return this.retained.set(t,i),()=>{this.retained.get(t)===i&&this.retained.delete(t)}}dropRetainedLayer(t){this.retained.delete(t)}retainFolderListing(t,r){let i={names:r};return this.retainedListings.set(t,i),()=>{this.retainedListings.get(t)===i&&this.retainedListings.delete(t)}}},Cf=class{ownerUidsByRoot=new Map;realHomeDir=void 0;canonicalRootOwnerUids(t,r){let i=this.ownerUidsByRoot.get(t);if(i!==void 0)return i;let s=r(t);return this.ownerUidsByRoot.set(t,s),s}hasCanonicalRootOwnerUids(t){return this.ownerUidsByRoot.has(t)}primeCanonicalRootOwnerUids(t,r){return this.ownerUidsByRoot.has(t)?!1:(this.ownerUidsByRoot.set(t,r),!0)}clearCanonicalRootOwnerUids(){this.ownerUidsByRoot.clear()}normalizedRealHomeDir(t){return this.realHomeDir??=t(),this.realHomeDir}clearNormalizedRealHomeDir(){this.realHomeDir=void 0}},PCe=new Nt(()=>new Sf);function Of(){return{sent:new Set,rejected:new Set,declaredTools:void 0,declaredToolsDecided:!1,readsTranscriptRecord:!0,nameOnlyAnnouncements:new Set,surfacedOnWire:new Set}}function JB(e){let t=Of();return t.declaredTools=e.declaredTools,t.declaredToolsDecided=e.declaredToolsDecided,t.readsTranscriptRecord=e.readsTranscriptRecord,t}function OE(e){return process.platform==="darwin"?e.normalize("NFC"):e}function KA(){let e="";if(typeof process<"u"&&typeof process.cwd=="function"&&typeof CE=="function")try{let t=QB();try{e=OE(CE(t))}catch{e=OE(t)}}catch{}return e}var eH=KA(),AE=(()=>{if(typeof process>"u"||typeof process.cwd!="function")return null;try{return process.cwd()}catch{return null}})();function tH(){if(AE===null)return null;let e=process.env.CLAUDE_CODE_SESSION_KIND;return e!==void 0&&String(e).trim()==="bg"?null:AE}var Af=class{spawner=void 0;pairings=new Map;mainEnsureInFlight=!1;mainSlotBlocked=!1},xf=class{#e=Of();#t=new Map;#r=void 0;stickyBetas(){return this.#e}unlatchStickyBetas(){this.#e=JB(this.#e)}perTurnEffortPins(){return this.#t}atisLatch(){return this.#r}replaceAtisLatch(t){this.#r=t}reset(){this.#e=Of(),this.#t=new Map,this.#r=void 0}},rH=(function(){try{var e=$s(Object,"defineProperty");return e({},"",{}),e}catch{}})(),su=rH;function iH(e,t,r){t=="__proto__"&&su?su(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Yu=iH;function sH(e){return function(t,r,i){for(var s=-1,n=Object(t),a=i(t),o=a.length;o--;){var l=a[e?o:++s];if(r(n[l],l,n)===!1)break}return t}}var nH=sH,aH=nH(),GA=aH;function oH(e,t){return e&&GA(e,t,pl)}var lH=oH,cH=1,uH=2;function dH(e,t,r,i){var s=r.length,n=s,a=!i;if(e==null)return!n;for(e=Object(e);s--;){var o=r[s];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++s<n;){o=r[s];var l=o[0],c=e[l],u=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var p=new Sn;if(i)var h=i(c,u,l,e,t,p);if(!(h===void 0?q_(u,c,cH|uH,i,p):h))return!1}}return!0}var pH=dH;function hH(e){return e===e&&!Jr(e)}var qA=hH;function fH(e){for(var t=pl(e),r=t.length;r--;){var i=t[r],s=e[i];t[r]=[i,s,qA(s)]}return t}var mH=fH;function gH(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var VA=gH;function _H(e){var t=mH(e);return t.length==1&&t[0][2]?VA(t[0][0],t[0][1]):function(r){return r===e||pH(r,e,t)}}var vH=_H,yH="[object Symbol]";function bH(e){return typeof e=="symbol"||li(e)&&Ms(e)==yH}var V_=bH,EH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wH=/^\w*$/;function SH(e,t){if(Sr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||V_(e)?!0:wH.test(e)||!EH.test(e)||t!=null&&e in Object(t)}var Z_=SH,CH="Expected a function";function X_(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw TypeError(CH);var r=function(){var i=arguments,s=t?t.apply(this,i):i[0],n=r.cache;if(n.has(s))return n.get(s);var a=e.apply(this,i);return r.cache=n.set(s,a)||n,a};return r.cache=new(X_.Cache||Vu),r}X_.Cache=Vu;var Y_=X_,OH=500;function AH(e){var t=Y_(e,function(i){return r.size===OH&&r.clear(),i}),r=t.cache;return t}var xH=AH,kH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,TH=/\\(\\)?/g,RH=xH(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(kH,function(r,i,s,n){t.push(s?n.replace(TH,"$1"):i||r)}),t}),DH=RH;function IH(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}var J_=IH,LH=1/0,xE=Ur?Ur.prototype:void 0,kE=xE?xE.toString:void 0;function ZA(e){if(typeof e=="string")return e;if(Sr(e))return J_(e,ZA)+"";if(V_(e))return kE?kE.call(e):"";var t=e+"";return t=="0"&&1/e==-LH?"-0":t}var PH=ZA;function NH(e){return e==null?"":PH(e)}var MH=NH;function UH(e,t){return Sr(e)?e:Z_(e,t)?[e]:DH(MH(e))}var pa=UH,$H=1/0;function jH(e){if(typeof e=="string"||V_(e))return e;var t=e+"";return t=="0"&&1/e==-$H?"-0":t}var Ds=jH;function FH(e,t){t=pa(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[Ds(t[r++])];return r&&r==i?e:void 0}var Ju=FH;function BH(e,t,r){var i=e==null?void 0:Ju(e,t);return i===void 0?r:i}var HH=BH;function zH(e,t){return e!=null&&t in Object(e)}var WH=zH;function KH(e,t,r){t=pa(t,e);for(var i=-1,s=t.length,n=!1;++i<s;){var a=Ds(t[i]);if(!(n=e!=null&&r(e,a)))break;e=e[a]}return n||++i!=s?n:(s=e==null?0:e.length,!!s&&z_(s)&&Zu(a,s)&&(Sr(e)||No(e)))}var GH=KH;function qH(e,t){return e!=null&&GH(e,t,WH)}var XA=qH,VH=1,ZH=2;function XH(e,t){return Z_(e)&&qA(t)?VA(Ds(e),t):function(r){var i=HH(r,e);return i===void 0&&i===t?XA(r,e):q_(t,i,VH|ZH)}}var YH=XH;function JH(e){return e}var Q_=JH;function QH(e){return function(t){return t?.[e]}}var ez=QH;function tz(e){return function(t){return Ju(t,e)}}var rz=tz;function iz(e){return Z_(e)?ez(Ds(e)):rz(e)}var sz=iz;function nz(e){return typeof e=="function"?e:e==null?Q_:typeof e=="object"?Sr(e)?YH(e[0],e[1]):vH(e):sz(e)}var Qu=nz;function az(e,t){var r={};return t=Qu(t,3),lH(e,function(i,s,n){Yu(r,s,t(i,s,n))}),r}var TE=az;function oz(e,t){for(var r,i=-1,s=e.length;++i<s;){var n=t(e[i]);n!==void 0&&(r=r===void 0?n:r+n)}return r}var lz=oz;function cz(e,t){return e&&e.length?lz(e,Qu(t,2)):0}var eo=cz;function ic(e){return Object.assign(Object.create(null),e)}var kf=class{#e=0;#t=0;#r=0;#i=0;#a=Date.now();#u=void 0;#l=0;#c=0;#o=!1;#s=ic();#n=null;#d=null;#p=null;totalCostUSD(){return this.#e}totalAPIDuration(){return this.#t}totalAPIDurationWithoutRetries(){return this.#r}totalToolDuration(){return this.#i}totalDuration(){return Math.max(0,Date.now()-this.#a)}sessionStartTime(){return this.#u??this.#a}totalLinesAdded(){return this.#l}totalLinesRemoved(){return this.#c}hasUnknownModelCost(){return this.#o}modelUsage(){return this.#s}usageForModel(t){return this.#s[t]}totalInputTokens(){return eo(Object.values(this.#s),"inputTokens")}totalOutputTokens(){return eo(Object.values(this.#s),"outputTokens")}totalCacheReadInputTokens(){return eo(Object.values(this.#s),"cacheReadInputTokens")}totalCacheCreationInputTokens(){return eo(Object.values(this.#s),"cacheCreationInputTokens")}totalWebSearchRequests(){return eo(Object.values(this.#s),"webSearchRequests")}recordApiDuration(t,r){this.#t+=t,this.#r+=r}recordCost(t,r,i){this.#s[i]=r,this.#e+=t}recordToolDuration(t){this.#i+=t}recordLinesChanged(t,r){this.#l+=t,this.#c+=r}markUnknownModelCost(){this.#o=!0}zeroDurationsAndCostForTests(){this.#t=0,this.#r=0,this.#e=0}restartClock(){this.#a=Date.now(),this.anchorLogicalStart(void 0)}anchorLogicalStart(t){this.#u=t===void 0?void 0:Math.min(t,this.#a)}restore({totalCostUSD:t,totalAPIDuration:r,totalAPIDurationWithoutRetries:i,totalToolDuration:s,totalLinesAdded:n,totalLinesRemoved:a,lastDuration:o,startTime:l,modelUsage:c,hasUnknownModelCost:u},p){this.#p=p,this.#e=t,this.#t=r,this.#r=i,this.#i=s,this.#l=n,this.#c=a,this.#o=u??!1,c&&(this.#s=ic(c)),o!==void 0&&(this.#a=Date.now()-o),this.anchorLogicalStart(l)}registerSaver(t){this.#n=t}runSaver(t,r){(this.#n??(r?r.#n:null))?.(t)}registerTranscriptRecorder(t){this.#d=t}runTranscriptRecorder(t,r,i){(this.#d??(i?i.#d:null))?.(t,r)}snapshot(){return{ownerSessionId:this.#p,totalCostUSD:this.#e,totalAPIDuration:this.#t,totalAPIDurationWithoutRetries:this.#r,totalToolDuration:this.#i,startTime:this.#a,sessionLogicalStartTime:this.#u,totalLinesAdded:this.#l,totalLinesRemoved:this.#c,hasUnknownModelCost:this.#o,modelUsage:TE(this.#s,t=>({...t}))}}restoreSnapshot(t){this.#p=t.ownerSessionId,this.#e=t.totalCostUSD,this.#t=t.totalAPIDuration,this.#r=t.totalAPIDurationWithoutRetries,this.#i=t.totalToolDuration,this.#a=t.startTime,this.#u=t.sessionLogicalStartTime,this.#l=t.totalLinesAdded,this.#c=t.totalLinesRemoved,this.#o=t.hasUnknownModelCost,this.#s=ic(TE(t.modelUsage,r=>({...r})))}claim(t){this.#p??=t}scopeTo(t){this.#p=t}ownerSessionId(){return this.#p}belongsTo(t){return this.#p===t}reset(t){this.#p=t,this.#e=0,this.#t=0,this.#r=0,this.#i=0,this.#a=Date.now(),this.anchorLogicalStart(void 0),this.#l=0,this.#c=0,this.#o=!1,this.#s=ic()}},Tf=class{#e=!1;fableConsentSessionFallback(){return this.#e}replaceFableConsentSessionFallback(t){this.#e=t}reset(){this.#e=!1}},Rf=class{#e={registeredHooks:null};#t=void 0;#r=void 0;holder(){return this.#e}mainThreadAgentType(){return this.#t}replaceMainThreadAgentType(t){this.#t=t}mainThreadAgentHooks(){return this.#r}replaceMainThreadAgentHooks(t){this.#r=t}reset(){this.#e={registeredHooks:null},this.#t=void 0,this.#r=void 0}},Df=class{#e=new Map;skills(){return this.#e}lookup(t){return this.#e.get(t)}record(t,r){this.#e.set(t,r)}forget(t){this.#e.delete(t)}forgetAll(){this.#e.clear()}reset(){this.#e=new Map}},If=class{#e=[];#t;#r;#i;#a;approvedServers(){return this.#e}approveServers(t,r){for(let i of r)this.#e.some(s=>s.name===i&&s.workspaceKey===t)||this.#e.push({name:i,workspaceKey:t})}registerClientsAccessor(t){this.#t=t}acquireClientsAccessor(t){return this.#t?()=>{}:(this.#t=t,()=>{this.#t===t&&(this.#t=void 0)})}clientsFromAccessor(){return this.#t?.()}registerConnectedClientWiring(t){this.#r=t}connectedClientWiring(){return this.#r}registerToolsSwapper(t){this.#i=t}acquireToolsSwapper(t){return this.#i?()=>{}:(this.#i=t,()=>{this.#i===t&&(this.#i=void 0)})}swapServerTools(t,r){return this.#i?this.#i(t,r):!1}registerConnections(t){this.#a=t}acquireConnections(t){return this.#a?()=>{}:(this.#a=t,()=>{this.#a===t&&(this.#a=void 0)})}connections(){return this.#a}reset(){this.#e=[],this.#t=void 0}},Lf=class{#e=void 0;#t=void 0;#r=void 0;#i=void 0;#a=void 0;#u=void 0;#l=!1;#c=!1;#o=void 0;#s=void 0;mainLoopModelOverride(){return this.#e}overrideMainLoopModel(t){this.#e=t}mainLoopEffortState(){return this.#t}replaceMainLoopEffortState(t){this.#t=t}initialMainLoopModel(){return this.#r}replaceInitialMainLoopModel(t){this.#r=t}initialModelSettingLayer(){return this.#i}replaceInitialModelSettingLayer(t){this.#i=t}resolvedOrgDefault(){return this.#a}replaceResolvedOrgDefault(t){this.#a=t}initialEnvDefaultModel(){return this.#u}replaceInitialEnvDefaultModel(t){this.#u=t}refusalFallbackOccurred(){return this.#l}markRefusalFallbackOccurred(t){this.#l=!0,this.#o??=t}refusalFallbackHeaderArmed(){return this.#c}armRefusalFallbackHeader(t){this.#c=!0,this.#o??=t}refusalFallbackLatchOriginRequestId(){return this.#o}forgetRefusalFallbackOccurred(){this.#l=!1,this.#c=!1,this.#o=void 0}refusalFallbackModelLatch(){return this.#s}replaceRefusalFallbackModelLatch(t){this.#s=t}unlatchRefusalFallbackModel(){this.#s=void 0}reset(){this.#e=void 0,this.#t=void 0,this.#r=void 0,this.#i=void 0,this.#a=void 0,this.#u=void 0,this.#l=!1,this.#c=!1,this.#o=void 0,this.#s=void 0}},Pf=class{#e=new Map;#t=0;#r=void 0;#i=null;sections(){return this.#e}recordSection(t,r){this.#e.set(t,r)}forgetAllSections(){this.#e.clear()}noteInvalidation(t="other"){this.#t+=1,this.#r=t}epoch(){return this.#t}lastInvalidationReason(){return this.#r}registerWordingLatchClear(t){this.#i=t}clearWordingLatch(t){(this.#i??(t?t.#i:null))?.()}reset(){this.#e=new Map}},Nf=class{#e=null;#t=null;#r=null;#i=null;#a=null;#u=0;#l=void 0;#c=null;#o=null;#s=!1;#n=null;#d=null;#p=!1;lastAPIRequest(){return this.#e}replaceLastAPIRequest(t){this.#e=t}lastCancelledAPIMessageId(){return this.#t}replaceLastCancelledAPIMessageId(t){this.#t=t}lastAPIRequestMessages(){return this.#r}replaceLastAPIRequestMessages(t){this.#r=t}lastClassifierRequests(){return this.#i}replaceLastClassifierRequests(t){this.#i=t}promptId(){return this.#a}replacePromptId(t){this.#a=t}promptIndex(){return this.#u}replacePromptIndex(t){this.#u=t}incrementPromptIndex(){return this.#u++,this.#u}lastMainRequestId(){return this.#l}replaceLastMainRequestId(t){this.#l=t}lastMainThreadCacheTtlMs(){return this.#c}replaceLastMainThreadCacheTtlMs(t){this.#c=t,this.#o=Date.now(),this.#s=!0}lastMainThreadRequestAt(){return this.#o}mainThreadRequestedInProcess(){return this.#s}recordMainThreadTurnStart(){this.#s=!0}replaceLastMainThreadRequest(t,r){this.#o=t,this.#c=r}lastMainThreadContextTokens(){return this.#n}replaceLastMainThreadContextTokens(t){this.#n=t}stageResumeSeed(t){this.#h=t}applyResumeSeed(t){this.#h=null,this.#c=t.ttlMs,this.#o=t.requestAt,this.#n=t.contextTokens}#h=null;clearLastMainThreadRequest(t){let r=t!==void 0&&this.#h?.sessionId===t?this.#h:null;this.#h=null,this.#c=r?.ttlMs??null,this.#o=r?.requestAt??null,this.#n=r?.contextTokens??null,this.#s=!1}lastApiCompletionTimestamp(){return this.#d}replaceLastApiCompletionTimestamp(t){this.#d=t}pendingPostCompaction(){return this.#p}replacePendingPostCompaction(t){this.#p=t}reset(){this.#e=null,this.#t=null,this.#r=null,this.#i=null,this.#a=null,this.#u=0,this.#l=void 0,this.#c=null,this.#o=null,this.#s=!1,this.#n=null,this.#h=null,this.#d=null,this.#p=!1}},Mf=class{#e=[];#t=Object.create(null);#r=null;#i=0;#a=!1;#u=0;tasks(){return this.#e}schedule(t){this.#e.push(t)}replaceTasks(t){this.#e=t}chainStartedAt(t){return this.#t[t]}recordChainStart(t,r){this.#t[t]=r}forgetChainStart(t){delete this.#t[t]}tickInFlightPrompt(){return this.#r}replaceTickInFlightPrompt(t){this.#r=t}consecutiveKeepalives(){return this.#i}replaceConsecutiveKeepalives(t){this.#i=t}ended(){return this.#a}replaceEnded(t){this.#a=t}wakeFires(){return this.#u}recordWakeFire(){this.#u++}resetWakeFires(){this.#u=0}reset(){this.#e=[],this.#t=Object.create(null),this.#r=null,this.#i=0,this.#a=!1,this.#u=0}},Uf=class{#e=!1;#t=!1;#r=!1;#i=!1;#a=!1;#u=!1;#l=!1;#c=!1;#o=!1;#s=!1;#n=null;#d=null;#p=null;#h=!1;#f=null;#_=!1;#m=!1;#v=!1;#E=!1;#y=!1;#b=void 0;#S=void 0;#w=void 0;#O=null;#A=null;onboardingShownThisSession(){return this.#e}replaceOnboardingShownThisSession(t){this.#e=t}lspRecommendationShownThisSession(){return this.#t}replaceLspRecommendationShownThisSession(t){this.#t=t}sessionTrustAccepted(){return this.#r}replaceSessionTrustAccepted(t){this.#r=t}homeTrustDialogAccepted(){return this.#i}replaceHomeTrustDialogAccepted(t){this.#i=t}hasExitedPlanMode(){return this.#a}replaceHasExitedPlanMode(t){this.#a=t}needsPlanModeExitAttachment(){return this.#u}replaceNeedsPlanModeExitAttachment(t){this.#u=t}needsAutoModeExitAttachment(){return this.#l}replaceNeedsAutoModeExitAttachment(t){this.#l=t}memoryToggledOff(){return this.#c}replaceMemoryToggledOff(t){this.#c=t}teardownUnwindRequested(){return this.#h}replaceTeardownUnwindRequested(t){this.#h=t}backgroundAutoModeSetupInFlight(){return this.#o}replaceBackgroundAutoModeSetupInFlight(t){this.#o=t}launchEffortPinsReleasedForSession(){return this.#s}markLaunchEffortPinsReleasedForSession(){this.#s=!0}restoreLaunchEffortPinsReleasedForSession(t){this.#s=t}deferredToolStubGateLatch(){return this.#n}replaceDeferredToolStubGateLatch(t){this.#n=t}verifySkillRolloutGateLatch(){return this.#d}replaceVerifySkillRolloutGateLatch(t){this.#d=t}commitSkillRolloutGateLatch(){return this.#p}replaceCommitSkillRolloutGateLatch(t){this.#p=t}memoryToolsShapeLatch(){return this.#f}replaceMemoryToolsShapeLatch(t){this.#f=t}proposeGoalAvailabilityLogged(){return this.#_}markProposeGoalAvailabilityLogged(){this.#_=!0}activeRoutine(){return this.#S}replaceActiveRoutine(t){this.#S=t}inheritedTeamName(){return this.#w}replaceInheritedTeamName(t){this.#w=t}teleportedSessionInfo(){return this.#O}replaceTeleportedSessionInfo(t){this.#O=t}markFirstTeleportMessageLogged(){this.#O&&(this.#O.hasLoggedFirstMessage=!0)}cachedClaudeMdContent(){return this.#A}replaceCachedClaudeMdContent(t){this.#A=t}accountSkillsSyncEnabled(){return this.#m}replaceAccountSkillsSyncEnabled(t){this.#m=t}skillsSyncVetoed(){return this.#v}replaceSkillsSyncVetoed(t){this.#v=t}accountPluginsSyncEnabled(){return this.#E}replaceAccountPluginsSyncEnabled(t){this.#E=t}pluginsSyncVetoed(){return this.#y}replacePluginsSyncVetoed(t){this.#y=t}armPendingContextCompacted(t){this.#b=t}consumePendingContextCompacted(){let t=this.#b;return this.#b=void 0,t}forgetPendingContextCompacted(){this.#b=void 0}reset(){this.#m=!1,this.#v=!1,this.#E=!1,this.#y=!1,this.#e=!1,this.#t=!1,this.#r=!1,this.#i=!1,this.#a=!1,this.#u=!1,this.#l=!1,this.#c=!1,this.#h=!1,this.#o=!1,this.#s=!1,this.#n=null,this.#d=null,this.#p=null,this.#f=null,this.#_=!1,this.#S=void 0,this.#w=void 0,this.#O=null,this.#A=null,this.#b=void 0}},$f=class{#e=new Map;#t=new Map;#r=null;#i=new Map;#a=new Set;#u=new Set;#l=new Set;#c=new Set;#o=new Set;#s=new Set;#n=new Set;#d=new Set;#p=new Set;#h=new Map;#f=new Set;#_=void 0;#m=void 0;#v=void 0;planSlugCache(){return this.#e}forgetPlanSlug(t){this.#e.delete(t)}pendingBranchLinks(){return this.#t}replacePendingBranchLinks(){this.#t=new Map}vimSharedState(){return this.#r}replaceVimSharedState(t){this.#r=t}agentColorMap(){return this.#i}sessionCreatedTeams(){return this.#a}surfacedHookSpawnFailures(){return this.#u}bareMcpServerMatchersWarned(){return this.#l}pendingConversationEditKinds(){return this.#c}clientTruncatedAssistantIds(){return this.#o}heldStatelessReplyIds(){return this.#s}unsupportedThreadKeys(){return this.#n}pendingPrLinks(){return this.#d}policyPredicateTelemetryEmitted(){return this.#p}humanAttachmentDigests(){return this.#h}chromeAvailabilityStagesLogged(){return this.#f}replaceChromeAvailabilityStagesLogged(t){this.#f=new Set,t&&(this.#_=Date.now())}chromeAvailabilityAnchorMs(){return this.#_}pendingGoalIdleCheckin(){return this.#m}replacePendingGoalIdleCheckin(t){this.#m=t}workerCheckin(){return this.#v}replaceWorkerCheckin(t){this.#v=t}reset(){this.#e=new Map,this.#t=new Map,this.#r=null,this.#i=new Map,this.#a=new Set,this.#u=new Set,this.#l=new Set,this.#c=new Set,this.#o=new Set,this.#s=new Set,this.#n=new Set,this.#d=new Set,this.#p=new Set,this.#h=new Map,this.#f=new Set,this.#_=void 0,clearTimeout(this.#m),this.#m=void 0,clearInterval(this.#v?.timer),this.#v=void 0}},RE={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null},jf=class{#e=!1;#t=void 0;#r=void 0;#i=void 0;#a=null;#u=!1;#l=void 0;#c=RE;#o=!1;#s="idle";attacherCapsChanged=dr();rvSupervisorLinkChanged=dr();sdkDialogHostActive(){return this.#e}markSdkDialogHostActive(t){this.#e=t}sdkSupportedDialogKinds(){return this.#t}sdkSupportedDialogKindsSource(){return this.#r}declareDialogKinds(t,r){this.#t=t,this.#r=t===void 0?void 0:r}sdkPerTaskStopAffordance(){return this.#i}declarePerTaskStopAffordance(t){this.#i=t}attacherCaps(){return this.#a}replaceAttacherCaps(t){this.#a=t,this.attacherCapsChanged.emit()}rvSupervisorLinkLive(){return this.#u}replaceRvSupervisorLinkLive(t){this.#u!==t&&(this.#u=t,this.rvSupervisorLinkChanged.emit())}sdkBetas(){return this.#l}replaceSdkBetas(t){this.#l=t}caps(){return this.#c}replaceCaps(t){this.#c=t}markRemote(t){this.#c={...this.#c,workspace:t?"remote":"local"}}replBridgeActive(){return this.#o}replaceReplBridgeActive(t){this.#o!==t&&(this.#o=t)}mainLoopBusy(){return this.#s!=="idle"}mainQueryRunning(){return this.#s==="running"}replaceMainLoopStatus(t){this.#s=t}reset(){this.#e=!1,this.#t=void 0,this.#r=void 0,this.#i=void 0,this.#a=null,this.#l=void 0,this.#c=RE,this.#o=!1,this.#s="idle",this.#u=!1,this.attacherCapsChanged.clear(),this.rvSupervisorLinkChanged.clear()}},Ff=class{#e=0;#t=null;#r=0;outputTokensAtTurnStart(){return this.#e}budget(){return this.#t}continuationCount(){return this.#r}snapshotForTurn(t,r){this.#e=t,this.#t=r,this.#r=0}incrementContinuation(){this.#r++}reset(){this.#e=0,this.#t=null,this.#r=0}},DE=150,Bf=class{#e=Date.now();#t=!1;interactionFired=dr();#r=void 0;terminalFocusFired=dr();#i=!1;#a;lastInteractionTime(){return this.#e}recordInteraction(t){t?this.#u():this.#t=!0}flushIfDirty(){this.#t&&this.#u()}#u(){this.#e=Date.now(),this.#t=!1,this.interactionFired.emit()}resetBaseline(){this.#e=Date.now(),this.#t=!1}terminalFocus(){return this.#r}updateTerminalFocus(t){this.#r=t,this.terminalFocusFired.emit()}scrollDraining(){return this.#i}markScrollActivity(){this.#i=!0,this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{this.#i=!1,this.#a=void 0},DE),this.#a.unref?.()}async waitForScrollIdle(){for(;this.#i;)await new Promise(t=>setTimeout(t,DE))}reset(){this.#e=Date.now(),this.#r=void 0,this.interactionFired.clear(),this.terminalFocusFired.clear()}},uz=["sdk_single_prompt_gate","subagent_estimate","subagent_final_turn"],Hf=class{byAgent=new Map;attemptsByAgent=new Map;cappedFailuresByAgent=new Map;armGateEventEmitted=new Set;vetoedUnderPrompt=new Map;sidecarIo=Promise.resolve();rehydrateAttemptedSessions=new Set;sidecarReadsAhead=new Map;get(t){return this.byAgent.get(t)}has(t){return this.byAgent.has(t)}put(t,r){this.byAgent.set(t,r)}remove(t){this.byAgent.delete(t)}nextAttemptNumber(t){let r=(this.attemptsByAgent.get(t)??0)+1;return this.attemptsByAgent.set(t,r),r}consecutiveCountedFailures(t){return this.cappedFailuresByAgent.get(t)??0}recordCountedFailure(t){let r=(this.cappedFailuresByAgent.get(t)??0)+1;return this.cappedFailuresByAgent.set(t,r),r}clearCountedFailures(t){this.cappedFailuresByAgent.delete(t)}recordVeto(t,r){this.vetoedUnderPrompt.set(t,r)}isVetoedUnder(t,r){return this.vetoedUnderPrompt.get(t)===r}latchArmGateEvent(t){return this.armGateEventEmitted.has(t)?!1:(this.armGateEventEmitted.add(t),!0)}enqueueSidecarIo(t,r){return this.sidecarIo=this.sidecarIo.then(t,t).catch(r),this.sidecarIo}sidecarIoSettled(){return this.sidecarIo}hasAttemptedRehydrate(t){return this.rehydrateAttemptedSessions.has(t)}markRehydrateAttempted(t){this.rehydrateAttemptedSessions.add(t)}keepSidecarReadAhead(t,r){for(this.sidecarReadsAhead.delete(t);this.sidecarReadsAhead.size>=8;){let i=this.sidecarReadsAhead.keys().next().value;if(i===void 0)break;this.sidecarReadsAhead.delete(i)}this.sidecarReadsAhead.set(t,r)}takeSidecarReadAhead(t){let r=this.sidecarReadsAhead.get(t);return this.sidecarReadsAhead.delete(t),r}dropSidecarReadAhead(t){this.sidecarReadsAhead.delete(t)}forgetSubagentTelemetry(t){this.attemptsByAgent.delete(t),this.cappedFailuresByAgent.delete(t),this.vetoedUnderPrompt.delete(t);for(let r of uz)this.armGateEventEmitted.delete(`${t}:${r}`)}},zf=class{#e=null;#t=null;mainAgentId(t){return this.#e??=t,this.#e}projectDir(){return this.#t}replaceProjectDir(t){this.#t=t}},Wf=class{openToolUseId;answeredThisSession=!1;get answered(){return this.answeredThisSession}markAnswered(){this.answeredThisSession=!0}isOpenElsewhere(t){return this.openToolUseId!==void 0&&this.openToolUseId!==t}open(t){this.openToolUseId=t}closeFor(t){t!==void 0&&this.openToolUseId===t&&(this.openToolUseId=void 0)}},Kf=class{granted=!1;isGranted(){return this.granted}grant(){this.granted=!0}},Gf=class{inFlight=null;startedForTurnEnd=!1;reset(){this.inFlight?.abort(),this.inFlight=null,this.startedForTurnEnd=!1}},qf=class{firstSyncPromise=null;syncErrors=[];syncedLaneOpened=!1;removalsDeferredHere=new Set;pendingTrashRemovals=[];ensureBucketRoot=null;deferredRelist=null},Vf=class{abortController=null;reset(){this.abortController?.abort(),this.abortController=null}},Zf=class{#e=void 0;#t=void 0;ccrSessionID(){return this.#e}latchCcrSessionID(t){this.#e=t}syncEnabled(){return this.#t}latchSyncEnabled(t){return this.#t=t,t}},Xf=class{autonomousPreambleDelivered=!1;lastLoopFileDelivered=null;reset(){this.autonomousPreambleDelivered=!1,this.lastLoopFileDelivered=null}},Yf=class{exchanges=[];replace(t){this.exchanges=t}append(t,r,i){this.exchanges=[...this.exchanges,{question:t,response:r,...i&&{fallbackNotice:i}}].slice(-20)}pendingReopen=null;reopenAway=!1;get reopenPending(){return this.pendingReopen!==null}armReopen(t,r){if(this.pendingReopen){this.pendingReopen.owners.add(t);return}this.pendingReopen={owners:new Set([t]),cancel:r()}}clearPendingReopen(t){let r=this.pendingReopen;if(!r){this.reopenAway=!1;return}t!==void 0&&(r.owners.delete(t),r.owners.size>0)||(r.cancel(),this.pendingReopen=null,this.reopenAway=!1)}reopener=null;setReopener(t){this.reopener=t}get hasReopener(){return this.reopener!==null}reopenNow(){return this.reopener?.()??!1}inFlightQuestions=[];get inFlight(){return this.inFlightQuestions.at(-1)??null}pendingBesidesTop(){return this.inFlightQuestions.slice(0,-1)}setInFlight(t){this.inFlightQuestions.includes(t)||(this.inFlightQuestions=[...this.inFlightQuestions,t])}clearInFlight(t){this.inFlightQuestions.includes(t)&&(this.inFlightQuestions=this.inFlightQuestions.filter(r=>r!==t))}};function ed(e,t,r){return new Promise((i,s)=>{if(t?.aborted){r?.throwOnAbort||r?.abortError?s(r.abortError?.()??Error("aborted")):i();return}let n=setTimeout((o,l,c)=>{o?.removeEventListener("abort",l),c()},e,t,a,i);function a(){clearTimeout(n),r?.throwOnAbort||r?.abortError?s(r.abortError?.()??Error("aborted")):i()}t?.addEventListener("abort",a,{once:!0}),r?.unref&&n.unref()})}function pz(e,t){e(Error(t))}function Nn(e,t,r){let i,s=new Promise((n,a)=>{i=setTimeout(pz,t,a,r)});return Promise.race([e,s]).finally(()=>{i!==void 0&&clearTimeout(i)})}function si(e){return process.platform==="darwin"?e.normalize("NFC"):e}function Ci(e){return/^[\\/]{2}/.test(e)||id(e)}function YA(e){return/(^|[\\/])\.\.([\\/]|$)/.test(e)}function LE(e){return/^[\\/]{2}[?.][\\/](?!unc[\\/])/i.test(e)?null:e.match(/^[\\/]{2}(?:[?.][\\/]unc[\\/])?([^\\/]+)/i)?.[1]?.replace(/[A-Z]/g,t=>t.toLowerCase())??null}function Uo(e){return/(^|[\\/])\.{1,2}[. ]*([\\/]|$)/.test(e)}function td(e){return/^[\\/]{2}[?.][\\/]/.test(e)}function fz(e){return/^[\\/](GLOBAL\?\?|GLOBALROOT|DosDevices|Device)[\\/]/i.test(e)}function mz(e,t){if(!Ci(e))return!1;if(td(e)||id(e)||Uo(e))return!0;let r=LE(e);return r===null||r!==LE(t)}function JA(e){return e.length===2&&yp(e[0])==="net"||e.length===3&&yp(e[0])==="network"&&yp(e[1])==="servers"}function PE(e){if(process.platform==="win32"||!e.startsWith("/"))return null;let t=[];for(let r of e.split("/"))if(!(r===""||r===".")){if(r===".."){t.pop();continue}if(t.push(r),JA(t))return gz(r)}return null}function gz(e){return e.replace(/[A-Z]/g,t=>t.toLowerCase())}function yp(e){return e.replace(/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/g,"").toUpperCase().toLowerCase()}function _z(e,t){if(!Co(e))return!1;let r=PE(e);return r===null||r!==PE(t)}function Co(e){return process.platform==="win32"?!1:hl(e)}function hl(e){return QA(e)!==null}function QA(e){if(!e.startsWith("/"))return null;let t=[];for(let r of e.split("/"))if(!(r===""||r===".")){if(r===".."){t.pop();continue}if(t.push(r),JA(t))return"/"+t.join("/")}return null}function nu(e){if(!e.startsWith("/"))return!1;let t=[];for(let r of e.split("/"))if(!(r===""||r===".")){if(r===".."){t.pop();continue}t.push(r)}return t.length===1&&t[0].toLowerCase()==="net"}function rd(e){if(!e.startsWith("/"))return!1;let t=[];for(let r of e.split("/"))if(!(r===""||r===".")){if(r===".."){t.pop();continue}if(t.push(r),t.length===1&&t[0].toLowerCase()==="network")return!0}return!1}function vz(e){return process.platform!=="darwin"?!1:rd(e)}function yz(e){return ex(e)||hl(e)||rd(e)||nu(e)||td(e)||id(e)||fz(e)}function Mn(e){return/^[\\/]{2}wsl(\$|\.localhost)[\\/]/i.test(e)}function ex(e){return Ci(e)&&!Mn(e)}function tx(e){return e.startsWith("\\\\?\\UNC\\")?"\\\\"+e.slice(8):e.startsWith("\\\\?\\")&&e.length>=7&&e[5]===":"?e.slice(4):e}function bz(e){if(/^\\\\\?\\volume\{/i.test(e))return NE(e);if(id(e))return!0;let t=tx(e);return t!==e&&NE(t)?!0:Ci(t)&&!Mn(t)}function NE(e){return Uo(e)||e.includes("/")}var Ez=new Set(["EPERM","EBUSY","EACCES"]),wz=4,Sz=50,ME;function Qf(e){return xz(e).real??null}function Cz(e,t){let r=Cn(t).toLowerCase(),i=IE(Cn(e)).toLowerCase();if(i===r||UE(i,r)||$E(i,r,"lexical"))return!0;let s=Qf(t)?.toLowerCase();if(s==null)return!1;let n=Qf(IE(Cn(e)))?.toLowerCase();return n==null?!0:n===s||UE(n,s)||$E(n,s,"canonical")}var Oz=new Set(["node_modules",".venv","venv","env",".env","virtualenv",".tox",".nox",".direnv","__pypackages__"]);function UE(e,t){return e.startsWith(au(t)+Si)?e.split(Si).some(r=>Oz.has(r)):!1}function au(e){return e.endsWith(Si)?e.slice(0,-1):e}var bp;function $E(e,t,r){let i=hz(),s=(process.env.LOCALAPPDATA??"").trim();if(r==="lexical")return Ep(jE(i,s,l=>Cn(l).toLowerCase()),e,t);let n=i+"\0"+s;if(bp?.key===n)return Ep(bp.aliasDirs,e,t);let a=!0,o=jE(i,s,l=>{if(!Az(l))return Cn(l).toLowerCase();let c=Qf(l)?.toLowerCase();return c??(a=!1,Cn(l).toLowerCase())});return a&&(bp={key:n,aliasDirs:o}),Ep(o,e,t)}function jE(e,t,r){let i=[];if(e&&i.push(au(r(e))+Si+["appdata","local","microsoft","windowsapps"].join(Si)),t){let s=au(r(t))+Si+["microsoft","windowsapps"].join(Si);i.includes(s)||i.push(s)}return i}function Az(e){return process.platform==="win32"?/^[A-Za-z]:[\\/](?![\\/])/.test(e):e.startsWith("/")&&!Ci(e)}function Ep(e,t,r){let i=au(r);for(let s of e)if((s===i||s.startsWith(i+Si))&&(t===s||t.startsWith(s+Si)))return!0;return!1}function xz(e){let t=Tz(()=>tx(dz.native(e)));return{real:t.value,code:t.code}}function kz(e){return e!=null&&typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:void 0}function Tz(e){for(let t=0;;t++)try{return{value:e()}}catch(r){let i=kz(r);if(i===void 0||process.platform!=="win32"||!Ez.has(i)||t>=wz-1)return{code:i};ME??=new Int32Array(new SharedArrayBuffer(4)),Atomics.wait(ME,0,0,Sz)}}function id(e){return FE.test(e)||e.includes("??")&&FE.test(Rz(e))}var FE=/^[\\/]\?\?[\\/]/;function Rz(e){return Jf.win32?Jf.win32.normalize(e):e}var Dz=16,em=class{pending=null;shownThisSession=!1;changed=dr();submitted=[];submittedChanged=dr();subscribe=this.changed.subscribe;getSnapshot=()=>this.pending;subscribeSubmitted=this.submittedChanged.subscribe;submit(t){this.shownThisSession||(this.submitted.length>=Dz&&this.submitted.shift(),this.submitted.push(t),this.submittedChanged.emit())}takeSubmitted(){let t=this.submitted;return this.submitted=[],t}offer(t){this.shownThisSession||(this.pending=t,this.changed.emit())}dismiss(){this.pending!==null&&(this.pending=null,this.changed.emit())}markShown(){this.shownThisSession=!0}},tm=class{lastEmittedAt=new Map;shouldEmit(t,r,i){let s=this.lastEmittedAt.get(t)||0;if(r-s<i)return!1;if(this.lastEmittedAt.size>=100){let n=this.lastEmittedAt.keys().next().value;n!==void 0&&this.lastEmittedAt.delete(n)}return this.lastEmittedAt.set(t,r),!0}},Iz=Symbol("permission-stash-evicted"),rm=class{entriesCap;evictedKeysCap;lanes={write:new Map,read:new Map};evicted={write:new Set,read:new Set};poisoned={write:!1,read:!1};constructor(t=256,r=1048576){this.entriesCap=t,this.evictedKeysCap=r}stash(t,r,i,s="write"){if(t===void 0)return;let n=this.lanes[s],a=this.evicted[s],o=wp(t,r);if(a.has(o))return;let l=n.get(o);if(l!==void 0){let c=new Set(i);n.set(o,l.filter(u=>c.has(u)));return}if(n.size>=this.entriesCap){let c=n.keys().next().value;if(c!==void 0&&(n.delete(c),a.add(c),a.size>this.evictedKeysCap)){this.poisoned[s]=!0;let u=a.values().next().value;u!==void 0&&a.delete(u)}}n.set(o,i)}holds(t,r,i="write"){return t!==void 0&&this.lanes[i].has(wp(t,r))}consume(t,r,i="write"){if(t===void 0)return;let s=this.lanes[i],n=wp(t,r),a=s.get(n),o=a===void 0&&(this.evicted[i].delete(n)||this.poisoned[i]),l=`${t}\0`;for(let c of s.keys())c.startsWith(l)&&s.delete(c);return o?Iz:a}};function wp(e,t){return`${e}\0${t}`}function Lz(e){return rx({kind:"root",host:e.host,id:e.id,parentId:e.parentId},e.project)}function rx(e,t){let r=si(t.originalCwd),i=si(t.projectRoot),s=si(t.cwd),n=dr(),a=e.kind==="fork"?e.root.observers:new Af,o=e.kind==="fork"?e.root.autonomousLoopPreamble:new Xf,l=e.kind==="fork"?e.root.precompute:new Hf,c={get originalCwd(){return r},get projectRoot(){return i},get cwd(){return s}},u={host:e.kind==="fork"?e.root.host:e.host,get id(){return e.kind==="fork"?e.root.id:e.id},get parentId(){return e.kind==="fork"?e.root.parentId:e.parentId},get root(){return e.kind==="fork"?e.root:u},project:c,observers:a,autonomousLoopPreamble:o,btwHistory:e.kind==="fork"?e.root.btwHistory:new Yf,ccrRecap:e.kind==="fork"?e.root.ccrRecap:new Gf,conversationLatches:e.kind==="fork"?e.root.conversationLatches:new xf,costLedger:e.kind==="fork"?e.root.costLedger:new kf,fableConsentSlots:e.kind==="fork"?e.root.fableConsentSlots:new Tf,hookRegistry:e.kind==="fork"?e.root.hookRegistry:new Rf,identity:e.kind==="fork"?e.root.identity:new zf,invokedSkills:e.kind==="fork"?e.root.invokedSkills:new Df,mcpSessionWiring:e.kind==="fork"?e.root.mcpSessionWiring:new If,modelSelection:e.kind==="fork"?e.root.modelSelection:new Lf,promptAssembly:e.kind==="fork"?e.root.promptAssembly:new Pf,promptSuggestion:e.kind==="fork"?e.root.promptSuggestion:new Vf,pendingHint:e.kind==="fork"?e.root.pendingHint:new em,pluginsSync:e.kind==="fork"?e.root.pluginsSync:new qf,precompute:l,requestJournal:e.kind==="fork"?e.root.requestJournal:new Nf,sessionCron:e.kind==="fork"?e.root.sessionCron:new Mf,sessionFlags:e.kind==="fork"?e.root.sessionFlags:new Uf,sessionRefsGate:e.kind==="fork"?e.root.sessionRefsGate:new Zf,sessionScratch:e.kind==="fork"?e.root.sessionScratch:new $f,surfaceCapabilities:e.kind==="fork"?e.root.surfaceCapabilities:new jf,toolProgressThrottle:e.kind==="fork"?e.root.toolProgressThrottle:new tm,turnBudget:e.kind==="fork"?e.root.turnBudget:new Ff,userPresence:e.kind==="fork"?e.root.userPresence:new Bf,workflowUsageConsent:e.kind==="fork"?e.root.workflowUsageConsent:new Kf,outsideReadPrompt:e.kind==="fork"?e.root.outsideReadPrompt:new Wf,writePermissionStash:e.kind==="fork"?e.root.writePermissionStash:new rm,subscribe(p){let h=n.subscribe(p);if(e.kind!=="fork")return h;let f=e.root,{id:_,parentId:v}=f,E=f.subscribe(()=>{f.id===_&&f.parentId===v||(_=f.id,v=f.parentId,p())});return()=>{h(),E()}},setCwd(p){u.update({project:{cwd:p}})},withProject(p){return rx({kind:"fork",root:u.root},{originalCwd:p.originalCwd??r,projectRoot:p.projectRoot??i,cwd:p.cwd??s})},update(p){let h=!1;if(p.id!==void 0||"parentId"in p){if(e.kind==="fork")throw Error("A withProject fork cannot re-identify the session \u2014 update the root session instead");p.id!==void 0&&p.id!==e.id&&(e.id=p.id,h=!0),"parentId"in p&&p.parentId!==e.parentId&&(e.parentId=p.parentId,h=!0)}let f=p.project;if(f){if(f.originalCwd!==void 0){let _=si(f.originalCwd);_!==r&&(r=_,h=!0)}if(f.projectRoot!==void 0){let _=si(f.projectRoot);_!==i&&(i=_,h=!0)}if(f.cwd!==void 0){let _=si(f.cwd);_!==s&&(s=_,h=!0)}}h&&n.emit()}};return u}var ou=class{#e;#t=new WeakMap;constructor(t){this.#e=t}peek(t){return this.#t.get(t.root)}of(t){let r=t.root,i=this.#t.get(r);if(i!==void 0)return i;let s=this.#e();return this.#t.set(r,s),s}drop(t){this.#t.delete(t.root)}},im=class{#e=!1;#t=null;#r=!1;#i=void 0;#a=!1;#u=!1;#l=!1;#c=!1;#o=void 0;#s=!1;#n=!1;#d=null;#p=null;#h=new Map;#f="cli";#_="fresh";#m=void 0;#v=!1;#E=!1;#y=[];#b=!1;#S=!1;#w=!1;#O=!1;#A="none";#T=!1;#N=!1;#C=!1;#$=!1;#R=!1;#D=!1;#M=!0;#x=null;#k=!1;#U=null;#I=!1;#L=!1;#g={};isInteractive(){return this.#e}replaceIsInteractive(t){this.#e=t}printOutputFormat(){return this.#t}replacePrintOutputFormat(t){this.#t=t}thinkingDisplayExplicit(){return this.#r}replaceThinkingDisplayExplicit(t){this.#r=t}permissionPromptToolName(){return this.#i}replacePermissionPromptToolName(t){this.#i=t}hasStreamingInput(){return this.#a}replaceHasStreamingInput(t){this.#a=t}singleShotPrintSession(){return this.#u}replaceSingleShotPrintSession(t){this.#u=t}printInputClosed(){return this.#l}markPrintInputClosed(){this.#l=!0}modelOverrideOptOutForSession(){return this.#c}replaceModelOverrideOptOutForSession(t){this.#c=t}rendererMode(){return this.#o}replaceRendererMode(t){this.#o=t}strictToolResultPairing(){return this.#s}replaceStrictToolResultPairing(t){this.#s=t}restrictedSession(){return this.#n}replaceRestrictedSession(t){this.#n=t}workspaceRestrictionState(){return this.#d}replaceWorkspaceRestrictionState(t){this.#d=t}replaceWorkspaceRestrictionUnsubscribe(t){this.#p?.(),this.#p=t}restrictedWorkspaceRoots(){return this.#h}addRestrictedWorkspaceRoot(t,r){this.#h.set(t,r)}clearRestrictedWorkspaceRoots(){this.#h=new Map}clientType(){return this.#f}replaceClientType(t){this.#f=t}sessionStartType(){return this.#_}replaceSessionStartType(t){this.#_=t}questionPreviewFormat(){return this.#m}replaceQuestionPreviewFormat(t){this.#m=t}extendedQuestionsEnabled(){return this.#v}replaceExtendedQuestionsEnabled(t){this.#v=t}questionOptionDescriptionsOptional(){return this.#E}replaceQuestionOptionDescriptionsOptional(t){this.#E=t}replConfigArgv(){return this.#y}replaceReplConfigArgv(t){this.#y=t}userMsgOptIn(){return this.#b}replaceUserMsgOptIn(t){this.#b=t}searchToolsOptIn(){return this.#S}replaceSearchToolsOptIn(t){this.#S=t}todoToolsOptIn(){return this.#w}replaceTodoToolsOptIn(t){this.#w=t}wizardOperatorToolsEnabled(){return this.#O}replaceWizardOperatorToolsEnabled(t){this.#O=t}pollEventIngress(){return this.#A}markPollEventIngress(t){this.#A=t}sdkAgentProgressSummariesEnabled(){return this.#T}replaceSdkAgentProgressSummariesEnabled(t){this.#T=t}sessionPersistenceDisabled(){return this.#N}replaceSessionPersistenceDisabled(t){this.#N=t}diskless(){return this.#C}replaceDiskless(t){this.#C=t}sessionBypassPermissionsMode(){return this.#$}replaceSessionBypassPermissionsMode(t){this.#$=t}disableSlashCommands(){return this.#R}replaceDisableSlashCommands(t){this.#R=t}disableFileMentions(){return this.#D}replaceDisableFileMentions(t){this.#D=t}mayForwardHomeSettings(){return this.#M}replaceMayForwardHomeSettings(t){this.#M=t}homeSettingsHostConsent(){return this.#x}replaceHomeSettingsHostConsent(t){this.#x=t}scheduledTasksEnabled(){return this.#k}replaceScheduledTasksEnabled(t){this.#k=t}initJsonSchema(){return this.#U}replaceInitJsonSchema(t){this.#U=t}cliSessionConfigCarried(){return this.#I}replaceCliSessionConfigCarried(t){this.#I=t}forkRestrictedLaunchConfig(){return this.#L}replaceForkRestrictedLaunchConfig(t){this.#L=t}forkReplayLaunchConfig(){return this.#g}replaceForkReplayLaunchConfig(t){this.#g=t}reset(){this.#e=!1,this.#t=null,this.#r=!1,this.#i=void 0,this.#a=!1,this.#u=!1,this.#l=!1,this.#c=!1,this.#o=void 0,this.#s=!1,this.#n=!1,this.#d=null,this.replaceWorkspaceRestrictionUnsubscribe(null),this.#h=new Map,this.#f="cli",this.#_="fresh",this.#m=void 0,this.#v=!1,this.#E=!1,this.#y=[],this.#b=!1,this.#S=!1,this.#w=!1,this.#O=!1,this.#A="none",this.#T=!1,this.#N=!1,this.#C=!1,this.#$=!1,this.#R=!1,this.#D=!1,this.#M=!0,this.#x=null,this.#k=!1,this.#U=null,this.#I=!1,this.#L=!1,this.#g={}}},sm=class{#e=void 0;#t=void 0;#r=void 0;#i=null;#a=null;#u=!1;#l=BE();#c=null;#o=!1;flagSettingsPath(){return this.#e}replaceFlagSettingsPath(t){this.#e=t}flagSettingsExpectedContent(){return this.#t}replaceFlagSettingsExpectedContent(t){this.#t=t}flagSettingsFilePinnedContent(){return this.#r}replaceFlagSettingsFilePinnedContent(t){this.#r=t}flagSettingsInline(){return this.#i}replaceFlagSettingsInline(t){this.#i=t}parentManagedSettings(){return this.#a}replaceParentManagedSettings(t){this.#a=t}parentManagedSettingsInvalid(){return this.#u}replaceParentManagedSettingsInvalid(t){this.#u=t}allowedSettingSources(){return this.#l}replaceAllowedSettingSources(t){this.#l=t}allowedSettingSourcesWithoutRepoDirSources(){let t=this.#l;return this.#c?.of!==t&&(this.#c={of:t,result:t.filter(r=>r!=="projectSettings"&&r!=="localSettings")}),this.#c.result}useCoworkPlugins(){return this.#o}replaceUseCoworkPlugins(t){this.#o=t}reset(){this.#e=void 0,this.#t=void 0,this.#r=void 0,this.#i=null,this.#a=null,this.#u=!1,this.#l=BE(),this.#c=null,this.#o=!1}};function BE(){return["userSettings","projectSettings","localSettings","flagSettings","policySettings"]}var nm=class{#e=[];#t=[];#r=[];#i=void 0;#a=new Map;#u=new Map;#l=[];#c=[];#o=!1;#s=void 0;#n=void 0;#d=void 0;inlinePlugins(){return this.#e}replaceInlinePlugins(t){this.#e=t}inlinePluginsNoMcp(){return this.#t}replaceInlinePluginsNoMcp(t){this.#t=t}inlinePluginUrls(){return this.#r}replaceInlinePluginUrls(t){this.#r=t}syncedPluginDirs(){return this.#i??[]}syncedPluginDirsRegistered(){return this.#i!==void 0}syncedPluginAttestation(t){return this.#a.get(t)}replaceSyncedPluginDirs(t,r=new Map){this.#i=t,this.#a=r,this.#u=this.#p(this.#u)}clearSyncedPluginDirs(){this.#i=void 0,this.#a=new Map,this.#u=new Map}attestedOfficialPluginMarketplace(t){return this.#u.get(t)}replaceAttestedOfficialPluginIds(t){this.#u=this.#p(t)}#p(t){let r=new Set([...this.#a.values()].map(i=>`${i.pluginName}@${i.marketplace}`));return new Map([...t].filter(([i,s])=>r.has(`${i.slice(0,i.lastIndexOf("@"))}@${s}`)))}additionalDirectoriesForClaudeMd(){return this.#l}replaceAdditionalDirectoriesForClaudeMd(t){this.#l=t}allowedChannels(){return this.#c}replaceAllowedChannels(t){this.#c=t}hasDevChannels(){return this.#o}replaceHasDevChannels(t){this.#o=t}sessionSkillAllowlist(){return this.#s}replaceSessionSkillAllowlist(t){this.#s=t}chromeFlagOverride(){return this.#n}replaceChromeFlagOverride(t){this.#n=t}teammateAgentId(){return this.#d}replaceTeammateAgentId(t){this.#d=t}reset(){this.#e=[],this.#t=[],this.#r=[],this.clearSyncedPluginDirs(),this.#l=[],this.#c=[],this.#o=!1,this.#s=void 0,this.#n=void 0,this.#d=void 0}},am=class{#e=null;#t=null;modelStrings(){return this.#e}replaceModelStrings(t){this.#e=t}invalidate(){this.#e=null}admin3PSteeringSnapshot(){return this.#t}recordAdmin3PSteeringSnapshot(t){this.#t=t}reset(){this.#e=null,this.#t=null}},HE=[],om=class{#e=[];#t=[];#r=void 0;errorLog(){return this.#e}recordError(t){this.#e.length>=100&&this.#e.shift(),this.#e.push(t)}recordSlowOperation(t,r){}slowOperations(){if(this.#t.length===0)return HE;let t=Date.now();return this.#t.some(r=>t-r.timestamp>=1e4)&&(this.#t=this.#t.filter(r=>t-r.timestamp<1e4),this.#t.length===0)?HE:this.#t}recordDevBarAlert(t){}devBarAlert(){let t=this.#r;if(t&&Date.now()-t.timestamp>=6e4){this.#r=void 0;return}return t}reset(){this.#e=[],this.#t=[],this.#r=void 0}};function zE(){return{rateTokens:null,rateLastRefillMs:null,featureOkLogged:!1,reportedDropReasons:new Set}}var lm=class{#e=null;#t=null;#r=null;#i=null;#a=null;#u=null;#l=null;#c=null;#o=null;#s=null;#n=null;#d=null;#p=null;#h=[];#f=null;#_=zE();#m=null;#v=null;#E=null;#y={direct:null,proxied:null};#b=null;#S=null;installMeter(t,r,{omitUnits:i=!1}={}){this.#e=t;let s=n=>i?void 0:n;this.#t=r("claude_code.session.count",{description:"Count of CLI sessions started"}),this.#r=r("claude_code.lines_of_code.count",{description:"Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed and the 'model' attribute indicating which model made the change"}),this.#i=r("claude_code.pull_request.count",{description:"Number of pull requests created"}),this.#a=r("claude_code.commit.count",{description:"Number of git commits created"}),this.#u=r("claude_code.cost.usage",{description:"Cost of the Claude Code session",unit:s("USD")}),this.#l=r("claude_code.token.usage",{description:"Number of tokens used",unit:s("tokens")}),this.#c=r("claude_code.code_edit_tool.decision",{description:"Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools"}),this.#o=r("claude_code.active_time.total",{description:"Total active time in seconds",unit:s("s")})}meter(){return this.#e}sessionCounter(){return this.#t}locCounter(){return this.#r}prCounter(){return this.#i}commitCounter(){return this.#a}costCounter(){return this.#u}tokenCounter(){return this.#l}codeEditToolDecisionCounter(){return this.#c}activeTimeCounter(){return this.#o}statsStore(){return this.#s}replaceStatsStore(t){this.#s=t}loggerProvider(){return this.#n}replaceLoggerProvider(t){this.#n=t}eventLogger(){return this.#d}eventLoggerOwner(){return this.#p}attachEventLogger(t,r){if(this.#d=t,this.#p=t?r:null,!t)return;let i=this.#h;if(this.#h=null,i)for(let s of i)t.emit(s)}bufferPendingEvent(t){return this.#h===null||this.#h.length>=100?!1:(this.#h.push(t),!0)}closeWindow(t){this.#h=null,this.#f=t}windowCloseCause(){return this.#f}isWindowOpen(){return this.#h!==null}hostOtel(){return this.#_}meterProvider(){return this.#m}replaceMeterProvider(t){this.#m=t}tracerProvider(){return this.#v}replaceTracerProvider(t){this.#v=t}cachedTelemetryResource(){return this.#E}replaceCachedTelemetryResource(t){this.#E=t}cachedOtlpHttpAgentFactory(t){return this.#y[t?"proxied":"direct"]}replaceCachedOtlpHttpAgentFactory(t,r){this.#y[t?"proxied":"direct"]=r}inClusterOtlpTrustRoots(){return this.#b}replaceInClusterOtlpTrustRoots(t){this.#b=t}inClusterOtlpAgentFactory(){return this.#S}replaceInClusterOtlpAgentFactory(t){this.#S=t}reset(){this.#e=null,this.#t=null,this.#r=null,this.#i=null,this.#a=null,this.#u=null,this.#l=null,this.#c=null,this.#o=null,this.#s=null,this.#n=null,this.#d=null,this.#p=null,this.#h=[],this.#f=null,this.#_=zE(),this.#m=null,this.#v=null,this.#E=null,this.#y={direct:null,proxied:null},this.#b=null,this.#S=null}},cm=class{#e=void 0;#t=void 0;#r=!1;#i=void 0;#a=void 0;#u=new Set;#l=void 0;#c=null;#o=null;#s=0;#n=!1;#d=()=>!1;#p=null;#h=void 0;#f=null;#_=null;sessionIngressToken(){return this.#e}replaceSessionIngressToken(t){this.#e=t}oauthTokenFromFd(){return this.#t}replaceOauthTokenFromFd(t){this.#t=t}oauthTokenFromBgSnapshot(){return this.#r}replaceOauthTokenFromBgSnapshot(t){this.#r=t}oauthScopesFromFd(){return this.#i}replaceOauthScopesFromFd(t){this.#i=t}apiKeyFromFd(){return this.#a}replaceApiKeyFromFd(t){this.#a=t}descriptorAnnouncementConsumed(t){return this.#u.has(t)}markDescriptorAnnouncementConsumed(t){this.#u.add(t)}gatewayTokenFromDescriptor(){return this.#l}replaceGatewayTokenFromDescriptor(t){this.#l=t}resetFdCredentialState(){this.#e=void 0,this.#t=void 0,this.#r=!1,this.#i=void 0,this.#a=void 0}gatewayAuth(){return this.#c}replaceGatewayAuth(t){this.#c=t}gatewayServerProcess(){return this.#n}replaceGatewayServerProcess(t){this.#n=t}gatewayRequiredByHostPolicy(){return this.#d()}replaceGatewayRequiredByHostPolicyReader(t){this.#d=t}authenticatedAccount(){return this.#o}authenticatedAccountEpoch(){return this.#s}stampAuthenticatedAccount(t){let r=this.#o;t!==null&&r!==null&&t.accountUuid===r.accountUuid&&t.emailAddress===r.emailAddress&&t.organizationUuid===r.organizationUuid||(this.#s+=1,this.#o=t)}startupPolicySnapshot(){return this.#h}replaceStartupPolicySnapshot(t){this.#h=t}gatewayRefreshInFlight(){return this.#p}replaceGatewayRefreshInFlight(t){this.#p=t}sdkOAuthTokenRefreshCallback(){return this.#f}replaceSdkOAuthTokenRefreshCallback(t){this.#f=t}hostAuthTokenRefreshCallback(){return this.#_}replaceHostAuthTokenRefreshCallback(t){this.#_=t}resetForTests(){this.#e=null,this.#t=null,this.#r=!1,this.#i=void 0,this.#a=null,this.#u.clear(),this.#l=void 0,this.#c=null,this.#o=null,this.#s=0,this.#n=!1,this.#d=()=>!1,this.#p=null,this.#h=void 0,this.#f=null,this.#_=null}},um=class{#e=void 0;#t=!1;#r=!1;#i;directConnectServerUrl(){return this.#e}replaceDirectConnectServerUrl(t){this.#e=t}connectNonBlocking(){return this.#t}replaceConnectNonBlocking(t){this.#t=t}strictConfig(){return this.#r}replaceStrictConfig(t){this.#r=t}registerEnsureConnectedClient(t){this.#i=t}ensureConnectedClient(){return this.#i}reset(){this.#e=void 0,this.#t=!1,this.#r=!1}},dm=class{#e=null;#t=new Map;#r=new Map;#i=new Set;#a=!1;#u=!1;#l=!1;#c=!1;#o=new Set;#s=!1;#n=!1;#d=new Map;#p=new Map;promptCache1hAllowlist(){return this.#e}replacePromptCache1hAllowlist(t){this.#e=t}thinkingTypeOverrides(){return this.#t}recordThinkingTypeOverride(t,r){this.#t.set(t,r)}servedModelsByRequestedModel(){return this.#r}recordServedModels(t,r){this.#r.set(t,r)}effortUnsupportedModels(){return this.#i}markEffortUnsupported(t){this.#i.add(t)}midConvCachePromotionRejected(){return this.#a}markMidConvCachePromotionRejected(){this.#a=!0}perTurnEffortOkEmitted(){return this.#u}markPerTurnEffortOkEmitted(){this.#u=!0}lateToolAdditionsOkEmitted(){return this.#l}markLateToolAdditionsOkEmitted(){this.#l=!0}toolChangeHeaderRefused(){return this.#c}markToolChangeHeaderRefused(){this.#c=!0}toolChangeUnsupportedModels(){return this.#o}markToolChangeUnsupportedModel(t){this.#o.add(t)}internalModelSafeguardsSkipRefused(){return this.#s}markInternalModelSafeguardsSkipRefused(){this.#s=!0}internalModelSafeguardsSkipRefusalAnnounced(){return this.#n}markInternalModelSafeguardsSkipRefusalAnnounced(){this.#n=!0}inferenceProfileBackingModels(){return this.#d}recordInferenceProfileBackingModel(t,r){this.#d.set(t,r)}foundryDeploymentCapabilities(){return this.#p}reset(){this.#e=null,this.#t=new Map,this.#r=new Map,this.#i=new Set,this.#a=!1,this.#u=!1,this.#l=!1,this.#c=!1,this.#o=new Set,this.#s=!1,this.#n=!1,this.#d=new Map,this.#p=new Map}},pm=class{#e=!1;#t=!1;longContext1mCreditsBlocked(){return this.#e}replaceLongContext1mCreditsBlocked(t){this.#e=t}fableCreditsRequired(){return this.#t}replaceFableCreditsRequired(t){this.#t=t}reset(){this.#e=!1,this.#t=!1}},hm=class{#e=!1;#t=!1;#r=WE;#i=dr();selectorGate(){return this.#e}selectorGateEverOn(){return this.#t}replaceSelectorGate(t){this.#e=t,this.#t||=t}inheritSelectorGateEverOn(){this.#t=!0}resampleSelectorGate(t){let r=this.#e;this.#e=t,this.#t||=t,r!==t&&this.#i.emit(t)}subscribeSelectorGateChanged(t){return this.#i.subscribe(t)}replaceHostGateSubscription(t){let r=this.#r;this.#r=t,r()}dropHostGateSubscription(){this.replaceHostGateSubscription(WE)}};function WE(){}var fm=class{started=!1;stagingReaped=!1;claim(){return this.started?!1:(this.started=!0,!0)}claimStagingReap(){return this.stagingReaped?!1:(this.stagingReaped=!0,!0)}},mm=class{backgroundHousekeeping;launchOptions;settingsSource;extensionsConfig;modelStringsCache;diagnostics;telemetryHandles;credentialSlots;mcpProcessWiring;requestLatches;accountCreditLatches;proactivity;constructor(t){this.backgroundHousekeeping=t.backgroundHousekeeping,this.launchOptions=t.launchOptions,this.settingsSource=t.settingsSource,this.extensionsConfig=t.extensionsConfig,this.modelStringsCache=t.modelStringsCache,this.diagnostics=t.diagnostics,this.telemetryHandles=t.telemetryHandles,this.credentialSlots=t.credentialSlots,this.mcpProcessWiring=t.mcpProcessWiring,this.requestLatches=t.requestLatches,this.accountCreditLatches=t.accountCreditLatches,this.proactivity=t.proactivity}};function Pz(){return new mm({backgroundHousekeeping:new fm,launchOptions:new im,settingsSource:new sm,extensionsConfig:new nm,modelStringsCache:new am,diagnostics:new om,telemetryHandles:new lm,credentialSlots:new cm,mcpProcessWiring:new um,requestLatches:new dm,accountCreditLatches:new pm,proactivity:new hm})}function Nz(e=KA()){return Lz({host:Pz(),id:z$()??_f(),project:{originalCwd:e,projectRoot:e,cwd:e}})}var ix=Nz(eH);function ev(){return sx()}function sx(){return nx()?.session??ix}function sd(e){return e.of(ix.host)}function Mz(){let e=nx();return e?.session?void 0:e}var nx=()=>{};function Uz(){return Mz()?.sessionId??sx().id}var qCe=new ou(()=>dr()),VCe=new ou(()=>dr()),ZCe=new Nt(()=>dr()),Xz=50;function vm(e=Xz){let t=new AbortController;return Zz(e,t.signal),t}var cOe=new FinalizationRegistry(({parentSignalRef:e,handler:t})=>{e.deref()?.removeEventListener("abort",t)}),uOe={"user-cancel":new DOMException("user-cancel","AbortError"),"remote-cancel":new DOMException("remote-cancel","AbortError"),shutdown:new DOMException("shutdown","AbortError"),interrupt:new DOMException("interrupt","AbortError"),"turn-abort":new DOMException("turn-abort","AbortError"),background:new DOMException("background","AbortError"),"refusal-fallback-edit":new DOMException("refusal-fallback-edit","AbortError"),"recovery-timeout":new DOMException("recovery-timeout","AbortError")},Yz="server-fallback-tombstone",dOe=new DOMException(Yz,"AbortError"),Jz="subagent-park",pOe=new DOMException(Jz,"AbortError"),ha=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PreModelSwitch","PostModelSwitch","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","DirectoryAdded","MessageDisplay"];function cx(e){return e.charAt(0).toUpperCase()+e.slice(1)}function iW(e,t,r=t+"s"){return e===1?t:r}function ux(e,t){if(t<=0)return"";if(e.length<=t)return e;let r=e.slice(0,t),i=r.charCodeAt(t-1);return dx(i>=55296&&i<=56319?r.slice(0,-1):r)}function GE(e,t){if(t<=0)return"";if(e.length<=t)return e;let r=e.slice(-t),i=r.charCodeAt(0);return dx(i>=56320&&i<=57343?r.slice(1):r)}function dx(e){return typeof Buffer<"u"?Buffer.from(e,"utf16le").toString("utf16le"):sW(e)}function sW(e){let t=[];for(let r=0;r<e.length;r+=8192){let i=Math.min(r+8192,e.length),s=new Uint16Array(i-r);for(let n=r;n<i;n++)s[n-r]=e.charCodeAt(n);t.push(String.fromCharCode(...s))}return t.join("")}var nW=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/,aW=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,cu=typeof String.prototype.isWellFormed=="function"?Function.prototype.call.bind(String.prototype.isWellFormed):void 0,_Oe=typeof String.prototype.toWellFormed=="function"?Function.prototype.call.bind(String.prototype.toWellFormed):void 0;function px(e){return cu?cu(e):!nW.test(e)}function oW(e){return cu&&cu(e)?e:e.replace(aW,"")}function lW(e,t){let r=e.indexOf(t);return r===-1?e:e.slice(0,r)}function cW(e,t,r=0){let i=0,s=e.indexOf(t,r);for(;s!==-1;)i++,s=e.indexOf(t,s+1);return i}function uW(e){let t=/[\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}\u2028\u2029]/gu;if(!t.test(e))return e;let r="";for(let{segment:i}of new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(e)){let s=new RegExp("\\p{Extended_Pictographic}|\\p{Regional_Indicator}|^[#*0-9]\\uFE0F?\\u20E3$","u").test(i),n=/^\u{1F3F4}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,6}\u{E007F}$/u.test(i);t.lastIndex=0,r+=i.replace(t,(a,o)=>{if(a===`
|
|
81
|
+
`||a===" ")return a;let l=a.codePointAt(0)??0;return s&&(a==="\uFE0F"||a==="\uFE0E"||a==="\u20E3"||a==="\u200D"&&o+a.length<i.length||n&&l>=917536&&l<=917631)?a:l===27?"\u241B":l<32?String.fromCodePoint(9216+l):l===127?"\u2421":`\\u{${l.toString(16).toUpperCase()}}`})}return r}function hx(e){return uW(e).replace(/\n/g,"\u2424").replace(/\t/g,"\u2409")}function Ai(e){return Array.isArray?Array.isArray(e):gx(e)==="[object Array]"}var dW=1/0;function pW(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-dW?"-0":t}function hW(e){return e==null?"":pW(e)}function ai(e){return typeof e=="string"}function fx(e){return typeof e=="number"}function fW(e){return e===!0||e===!1||mW(e)&&gx(e)=="[object Boolean]"}function mx(e){return typeof e=="object"}function mW(e){return mx(e)&&e!==null}function wr(e){return e!=null}function Sp(e){return!e.trim().length}function gx(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var gW="Incorrect 'index' type",_W=e=>`Invalid value for key ${e}`,vW=e=>`Pattern length exceeds max of ${e}.`,yW=e=>`Missing ${e} property in key`,bW=e=>`Property 'weight' in key '${e}' must be a positive integer`,qE=Object.prototype.hasOwnProperty,ym=class{constructor(t){this._keys=[],this._keyMap={};let r=0;t.forEach(i=>{let s=_x(i);this._keys.push(s),this._keyMap[s.id]=s,r+=s.weight}),this._keys.forEach(i=>{i.weight/=r})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function _x(e){let t=null,r=null,i=null,s=1,n=null;if(ai(e)||Ai(e))i=e,t=VE(e),r=bm(e);else{if(!qE.call(e,"name"))throw Error(yW("name"));let a=e.name;if(i=a,qE.call(e,"weight")&&(s=e.weight,s<=0))throw Error(bW(a));t=VE(a),r=bm(a),n=e.getFn}return{path:t,id:r,weight:s,src:i,getFn:n}}function VE(e){return Ai(e)?e:e.split(".")}function bm(e){return Ai(e)?e.join("."):e}function EW(e,t){let r=[],i=!1,s=(n,a,o)=>{if(wr(n))if(!a[o])r.push(n);else{let l=a[o],c=n[l];if(!wr(c))return;if(o===a.length-1&&(ai(c)||fx(c)||fW(c)))r.push(hW(c));else if(Ai(c)){i=!0;for(let u=0,p=c.length;u<p;u+=1)s(c[u],a,o+1)}else a.length&&s(c,a,o+1)}};return s(e,ai(t)?t.split("."):t,0),i?r:r[0]}var wW={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},SW={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},CW={location:0,threshold:.6,distance:100},OW={useExtendedSearch:!1,getFn:EW,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Ne={...SW,...wW,...CW,...OW},AW=/[^ ]+/g;function xW(e=1,t=3){let r=new Map,i=Math.pow(10,t);return{get(s){let n=s.match(AW).length;if(r.has(n))return r.get(n);let a=1/Math.pow(n,.5*e),o=parseFloat(Math.round(a*i)/i);return r.set(n,o),o},clear(){r.clear()}}}var $o=class{constructor({getFn:t=Ne.getFn,fieldNormWeight:r=Ne.fieldNormWeight}={}){this.norm=xW(r,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((r,i)=>{this._keysMap[r.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ai(this.docs[0])?this.docs.forEach((t,r)=>{this._addString(t,r)}):this.docs.forEach((t,r)=>{this._addObject(t,r)}),this.norm.clear())}add(t){let r=this.size();ai(t)?this._addString(t,r):this._addObject(t,r)}removeAt(t){this.records.splice(t,1);for(let r=t,i=this.size();r<i;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(t,r){return t[this._keysMap[r]]}size(){return this.records.length}_addString(t,r){if(!wr(t)||Sp(t))return;let i={v:t,i:r,n:this.norm.get(t)};this.records.push(i)}_addObject(t,r){let i={i:r,$:{}};this.keys.forEach((s,n)=>{let a=s.getFn?s.getFn(t):this.getFn(t,s.path);if(wr(a)){if(Ai(a)){let o=[],l=[{nestedArrIndex:-1,value:a}];for(;l.length;){let{nestedArrIndex:c,value:u}=l.pop();if(wr(u))if(ai(u)&&!Sp(u)){let p={v:u,i:c,n:this.norm.get(u)};o.push(p)}else Ai(u)&&u.forEach((p,h)=>{l.push({nestedArrIndex:h,value:p})})}i.$[n]=o}else if(ai(a)&&!Sp(a)){let o={v:a,n:this.norm.get(a)};i.$[n]=o}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}};function vx(e,t,{getFn:r=Ne.getFn,fieldNormWeight:i=Ne.fieldNormWeight}={}){let s=new $o({getFn:r,fieldNormWeight:i});return s.setKeys(e.map(_x)),s.setSources(t),s.create(),s}function kW(e,{getFn:t=Ne.getFn,fieldNormWeight:r=Ne.fieldNormWeight}={}){let{keys:i,records:s}=e,n=new $o({getFn:t,fieldNormWeight:r});return n.setKeys(i),n.setIndexRecords(s),n}function sc(e,{errors:t=0,currentLocation:r=0,expectedLocation:i=0,distance:s=Ne.distance,ignoreLocation:n=Ne.ignoreLocation}={}){let a=t/e.length;if(n)return a;let o=Math.abs(i-r);return s?a+o/s:o?1:a}function TW(e=[],t=Ne.minMatchCharLength){let r=[],i=-1,s=-1,n=0;for(let a=e.length;n<a;n+=1){let o=e[n];o&&i===-1?i=n:!o&&i!==-1&&(s=n-1,s-i+1>=t&&r.push([i,s]),i=-1)}return e[n-1]&&n-i>=t&&r.push([i,n-1]),r}var vs=32;function RW(e,t,r,{location:i=Ne.location,distance:s=Ne.distance,threshold:n=Ne.threshold,findAllMatches:a=Ne.findAllMatches,minMatchCharLength:o=Ne.minMatchCharLength,includeMatches:l=Ne.includeMatches,ignoreLocation:c=Ne.ignoreLocation}={}){if(t.length>vs)throw Error(vW(vs));let u=t.length,p=e.length,h=Math.max(0,Math.min(i,p)),f=n,_=h,v=o>1||l,E=v?Array(p):[],y;for(;(y=e.indexOf(t,_))>-1;){let w=sc(t,{currentLocation:y,expectedLocation:h,distance:s,ignoreLocation:c});if(f=Math.min(w,f),_=y+u,v){let S=0;for(;S<u;)E[y+S]=1,S+=1}}_=-1;let m=[],g=1,b=u+p,C=1<<u-1;for(let w=0;w<u;w+=1){let S=0,x=b;for(;S<x;)sc(t,{errors:w,currentLocation:h+x,expectedLocation:h,distance:s,ignoreLocation:c})<=f?S=x:b=x,x=Math.floor((b-S)/2+S);b=x;let T=Math.max(1,h-x+1),I=a?p:Math.min(h+x,p)+u,L=Array(I+2);L[I+1]=(1<<w)-1;for(let P=I;P>=T;P-=1){let $=P-1,se=r[e.charAt($)];if(v&&(E[$]=+!!se),L[P]=(L[P+1]<<1|1)&se,w&&(L[P]|=(m[P+1]|m[P])<<1|1|m[P+1]),L[P]&C&&(g=sc(t,{errors:w,currentLocation:$,expectedLocation:h,distance:s,ignoreLocation:c}),g<=f)){if(f=g,_=$,_<=h)break;T=Math.max(1,2*h-_)}}if(sc(t,{errors:w+1,currentLocation:h,expectedLocation:h,distance:s,ignoreLocation:c})>f)break;m=L}let A={isMatch:_>=0,score:Math.max(.001,g)};if(v){let w=TW(E,o);w.length?l&&(A.indices=w):A.isMatch=!1}return A}function DW(e){let t={};for(let r=0,i=e.length;r<i;r+=1){let s=e.charAt(r);t[s]=(t[s]||0)|1<<i-r-1}return t}var uu=class{constructor(t,{location:r=Ne.location,threshold:i=Ne.threshold,distance:s=Ne.distance,includeMatches:n=Ne.includeMatches,findAllMatches:a=Ne.findAllMatches,minMatchCharLength:o=Ne.minMatchCharLength,isCaseSensitive:l=Ne.isCaseSensitive,ignoreLocation:c=Ne.ignoreLocation}={}){if(this.options={location:r,threshold:i,distance:s,includeMatches:n,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:l,ignoreLocation:c},this.pattern=l?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;let u=(h,f)=>{this.chunks.push({pattern:h,alphabet:DW(h),startIndex:f})},p=this.pattern.length;if(p>vs){let h=0,f=p%vs,_=p-f;for(;h<_;)u(this.pattern.substr(h,vs),h),h+=vs;if(f){let v=p-vs;u(this.pattern.substr(v),v)}}else u(this.pattern,0)}searchIn(t){let{isCaseSensitive:r,includeMatches:i}=this.options;if(r||(t=t.toLowerCase()),this.pattern===t){let _={isMatch:!0,score:0};return i&&(_.indices=[[0,t.length-1]]),_}let{location:s,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,ignoreLocation:c}=this.options,u=[],p=0,h=!1;this.chunks.forEach(({pattern:_,alphabet:v,startIndex:E})=>{let{isMatch:y,score:m,indices:g}=RW(t,_,v,{location:s+E,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,includeMatches:i,ignoreLocation:c});y&&(h=!0),p+=m,y&&g&&(u=[...u,...g])});let f={isMatch:h,score:h?p/this.chunks.length:1};return h&&i&&(f.indices=u),f}},ci=class{constructor(t){this.pattern=t}static isMultiMatch(t){return ZE(t,this.multiRegex)}static isSingleMatch(t){return ZE(t,this.singleRegex)}search(){}};function ZE(e,t){let r=e.match(t);return r?r[1]:null}var Em=class extends ci{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){let r=t===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}},wm=class extends ci{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){let r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}},Sm=class extends ci{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){let r=t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}},Cm=class extends ci{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){let r=!t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}},Om=class extends ci{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){let r=t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},Am=class extends ci{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){let r=!t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}},du=class extends ci{constructor(t,{location:r=Ne.location,threshold:i=Ne.threshold,distance:s=Ne.distance,includeMatches:n=Ne.includeMatches,findAllMatches:a=Ne.findAllMatches,minMatchCharLength:o=Ne.minMatchCharLength,isCaseSensitive:l=Ne.isCaseSensitive,ignoreLocation:c=Ne.ignoreLocation}={}){super(t),this._bitapSearch=new uu(t,{location:r,threshold:i,distance:s,includeMatches:n,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}},pu=class extends ci{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let r=0,i,s=[],n=this.pattern.length;for(;(i=t.indexOf(this.pattern,r))>-1;)r=i+n,s.push([i,r-1]);let a=!!s.length;return{isMatch:a,score:a?0:1,indices:s}}},xm=[Em,pu,Sm,Cm,Am,Om,wm,du],XE=xm.length,IW=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,LW="|";function PW(e,t={}){return e.split(LW).map(r=>{let i=r.trim().split(IW).filter(n=>n&&!!n.trim()),s=[];for(let n=0,a=i.length;n<a;n+=1){let o=i[n],l=!1,c=-1;for(;!l&&++c<XE;){let u=xm[c],p=u.isMultiMatch(o);p&&(s.push(new u(p,t)),l=!0)}if(!l)for(c=-1;++c<XE;){let u=xm[c],p=u.isSingleMatch(o);if(p){s.push(new u(p,t));break}}}return s})}var NW=new Set([du.type,pu.type]),km=class{constructor(t,{isCaseSensitive:r=Ne.isCaseSensitive,includeMatches:i=Ne.includeMatches,minMatchCharLength:s=Ne.minMatchCharLength,ignoreLocation:n=Ne.ignoreLocation,findAllMatches:a=Ne.findAllMatches,location:o=Ne.location,threshold:l=Ne.threshold,distance:c=Ne.distance}={}){this.query=null,this.options={isCaseSensitive:r,includeMatches:i,minMatchCharLength:s,findAllMatches:a,ignoreLocation:n,location:o,threshold:l,distance:c},this.pattern=r?t:t.toLowerCase(),this.query=PW(this.pattern,this.options)}static condition(t,r){return r.useExtendedSearch}searchIn(t){let r=this.query;if(!r)return{isMatch:!1,score:1};let{includeMatches:i,isCaseSensitive:s}=this.options;t=s?t:t.toLowerCase();let n=0,a=[],o=0;for(let l=0,c=r.length;l<c;l+=1){let u=r[l];a.length=0,n=0;for(let p=0,h=u.length;p<h;p+=1){let f=u[p],{isMatch:_,indices:v,score:E}=f.search(t);if(_){if(n+=1,o+=E,i){let y=f.constructor.type;NW.has(y)?a=[...a,...v]:a.push(v)}}else{o=0,n=0,a.length=0;break}}if(n){let p={isMatch:!0,score:o/n};return i&&(p.indices=a),p}}return{isMatch:!1,score:1}}},Tm=[];function MW(...e){Tm.push(...e)}function Rm(e,t){for(let r=0,i=Tm.length;r<i;r+=1){let s=Tm[r];if(s.condition(e,t))return new s(e,t)}return new uu(e,t)}var hu={AND:"$and",OR:"$or"},Dm={PATH:"$path",PATTERN:"$val"},Im=e=>!!(e[hu.AND]||e[hu.OR]),UW=e=>!!e[Dm.PATH],$W=e=>!Ai(e)&&mx(e)&&!Im(e),YE=e=>({[hu.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function yx(e,t,{auto:r=!0}={}){let i=s=>{let n=Object.keys(s),a=UW(s);if(!a&&n.length>1&&!Im(s))return i(YE(s));if($W(s)){let l=a?s[Dm.PATH]:n[0],c=a?s[Dm.PATTERN]:s[l];if(!ai(c))throw Error(_W(l));let u={keyId:bm(l),pattern:c};return r&&(u.searcher=Rm(c,t)),u}let o={children:[],operator:n[0]};return n.forEach(l=>{let c=s[l];Ai(c)&&c.forEach(u=>{o.children.push(i(u))})}),o};return Im(e)||(e=YE(e)),i(e)}function jW(e,{ignoreFieldNorm:t=Ne.ignoreFieldNorm}){e.forEach(r=>{let i=1;r.matches.forEach(({key:s,norm:n,score:a})=>{let o=s?s.weight:null;i*=Math.pow(a===0&&o?Number.EPSILON:a,(o||1)*(t?1:n))}),r.score=i})}function FW(e,t){let r=e.matches;t.matches=[],wr(r)&&r.forEach(i=>{if(!wr(i.indices)||!i.indices.length)return;let{indices:s,value:n}=i,a={indices:s,value:n};i.key&&(a.key=i.key.src),i.idx>-1&&(a.refIndex=i.idx),t.matches.push(a)})}function BW(e,t){t.score=e.score}function HW(e,t,{includeMatches:r=Ne.includeMatches,includeScore:i=Ne.includeScore}={}){let s=[];return r&&s.push(FW),i&&s.push(BW),e.map(n=>{let{idx:a}=n,o={item:t[a],refIndex:a};return s.length&&s.forEach(l=>{l(n,o)}),o})}var Is=class{constructor(t,r={},i){this.options={...Ne,...r},this.options.useExtendedSearch,this._keyStore=new ym(this.options.keys),this.setCollection(t,i)}setCollection(t,r){if(this._docs=t,r&&!(r instanceof $o))throw Error(gW);this._myIndex=r||vx(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){wr(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){let r=[];for(let i=0,s=this._docs.length;i<s;i+=1){let n=this._docs[i];t(n,i)&&(this.removeAt(i),i-=1,s-=1,r.push(n))}return r}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:r=-1}={}){let{includeMatches:i,includeScore:s,shouldSort:n,sortFn:a,ignoreFieldNorm:o}=this.options,l=ai(t)?ai(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return jW(l,{ignoreFieldNorm:o}),n&&l.sort(a),fx(r)&&r>-1&&(l=l.slice(0,r)),HW(l,this._docs,{includeMatches:i,includeScore:s})}_searchStringList(t){let r=Rm(t,this.options),{records:i}=this._myIndex,s=[];return i.forEach(({v:n,i:a,n:o})=>{if(!wr(n))return;let{isMatch:l,score:c,indices:u}=r.searchIn(n);l&&s.push({item:n,idx:a,matches:[{score:c,value:n,norm:o,indices:u}]})}),s}_searchLogical(t){let r=yx(t,this.options),i=(o,l,c)=>{if(!o.children){let{keyId:p,searcher:h}=o,f=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(l,p),searcher:h});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}let u=[];for(let p=0,h=o.children.length;p<h;p+=1){let f=o.children[p],_=i(f,l,c);if(_.length)u.push(..._);else if(o.operator===hu.AND)return[]}return u},s=this._myIndex.records,n={},a=[];return s.forEach(({$:o,i:l})=>{if(wr(o)){let c=i(r,o,l);c.length&&(n[l]||(n[l]={idx:l,item:o,matches:[]},a.push(n[l])),c.forEach(({matches:u})=>{n[l].matches.push(...u)}))}}),a}_searchObjectList(t){let r=Rm(t,this.options),{keys:i,records:s}=this._myIndex,n=[];return s.forEach(({$:a,i:o})=>{if(!wr(a))return;let l=[];i.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:a[u],searcher:r}))}),l.length&&n.push({idx:o,item:a,matches:l})}),n}_findMatches({key:t,value:r,searcher:i}){if(!wr(r))return[];let s=[];if(Ai(r))r.forEach(({v:n,i:a,n:o})=>{if(!wr(n))return;let{isMatch:l,score:c,indices:u}=i.searchIn(n);l&&s.push({score:c,key:t,value:n,idx:a,norm:o,indices:u})});else{let{v:n,n:a}=r,{isMatch:o,score:l,indices:c}=i.searchIn(n);o&&s.push({score:l,key:t,value:n,norm:a,indices:c})}return s}};Is.version="7.0.0";Is.createIndex=vx;Is.parseIndex=kW;Is.config=Ne;Is.parseQuery=yx;MW(km);var Un=class extends Error{};function tv(){return process.versions.bun!==void 0}Qo();var KW=/^[+-]?(\d+(\.\d*)?|\.\d+)[eE][+-]?\d+$/,GW=/^[+-]?\d{1,3}([_,\u00A0\u202F ])\d{3}(?:\1\d{3})*$/,qW=/[_,\u00A0\u202F ]/g;function VW(e){if(e.length<=32){if(KW.test(e)){let t=Number(e);return Number.isInteger(t)?t:NaN}if(GW.test(e))return parseInt(e.replace(qW,""),10)}}function ZW(e){let t=String(e).trim();return VW(t)??parseInt(t,10)}Qo();function fu(){return process.env.CLAUDE_CONFIG_DIR}var es=Y_(()=>(fu()??WW(zW(),".claude")).normalize("NFC"),fu);function XW(e){return JE(es())===JE(e)}function bx(){return process.env.CLAUDE_CODE_PROJECT_DIR_NAME}var YW=/^[A-Za-z0-9_-]{1,64}$/,JW=/^(?:con|prn|aux|nul|com[0-9]|lpt[0-9])$/i;function Ex(e){if(!(!e||!YW.test(e)||JW.test(e)))return e}function QW(){return`${fu()??""}\0${bx()??""}`}var e4=Y_(()=>fu()?Ex(bx()):void 0,QW),t4=/hooks\.slack\.com\/(?:services|workflows|triggers)\/[A-Za-z0-9/_-]+/gi,Cp={bearer:[/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi,"Bearer <token>"],basic:[/(:\s*)Basic\s+[A-Za-z0-9+/=]{8,}/gi,"$1Basic <token>"],sk:[/\bsk-[A-Za-z0-9_-]{20,}/g,"<token>"]},r4=[/\bBearer\s{1,512}(?=[A-Za-z0-9._~+/=-]{16})(?:eyJ|(?=[A-Za-z0-9._~+/=-]{0,64}[0-9=]))/i,/:\s{0,512}Basic\s{1,512}(?=[A-Za-z0-9+/=]{16})(?=[A-Za-z0-9+/=]{0,64}[0-9=])/i,/\bsk-(?=[A-Za-z0-9_-]{20})(?=[A-Za-z0-9_-]{0,64}[0-9])/],wOe=new RegExp(`(?:\\b(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-${mn("[A-Za-z0-9+/=%_-]")}|\\bxox[cd]-|(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-(?=[0-9])|xox[cd]-${mn("[A-Za-z0-9+/=%_-]")}(?=[A-Za-z0-9+/=%_-]{16}))`,"i"),wx=[[Oo("sk-ant-","[A-Za-z0-9_-]",8,QE(8)),"<token>"],[Oo("sk-(?:proj|svcacct|admin)-","[A-Za-z0-9_-]",20,QE(20)),"<token>"]],Sx=[[/(^|[^A-Za-z0-9+])AKIA[A-Z0-9]{16}(?![A-Za-z0-9+=])/g,"$1<token>"],[/(^|[^A-Za-z0-9+])ASIA[A-Z0-9]{16}(?![A-Za-z0-9+=])/g,"$1<token>"]],Cx=[[Oo("gh[opusr]_","[A-Za-z0-9]",20,mn("[A-Za-z0-9]")),"<token>"],[/github_pat_[A-Za-z0-9_]{82,}/g,"<token>"],[/sq0(?:atp|csp)-[A-Za-z0-9_-]{22,}/g,"<token>"],[/(^|[^A-Za-z0-9+/])EAAA[A-Za-z0-9+/=%_-]{56,}/g,"$1<token>"],[Oo("gl(?:pat|dt|rt|ft|soat|oas|agent|ptt|cbt|imt|ffct)-","[A-Za-z0-9_=-]",20,mn("[A-Za-z0-9_=-]"),"(?:\\.[0-9a-z]{9})?"),"<token>"],[Oo("(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-","[A-Za-z0-9+/=%_-]",10,"(?=[0-9])","",mn("[A-Za-z0-9+/=%_-]"),"gi"),"<token>"],[new RegExp(`(?:\\bxox[cd]-[A-Za-z0-9+/=%_-]{10,}|xox[cd]-${mn("[A-Za-z0-9+/=%_-]")}[A-Za-z0-9+/=%_-]{16,})`,"gi"),"<token>"],[t4,"hooks.slack.com/<redacted>"]],i4=[/\bey[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g,"<jwt>"],s4=/\beyJ(?:[A-Za-z0-9_-]{256}|[A-Za-z0-9_-]{8,2048}\.[A-Za-z0-9_-]{10})/,n4=[Cp.bearer,Cp.basic,...wx,Cp.sk,...Sx],a4=[...Cx,i4];function Oc(e){return[...n4,...a4].reduce((t,[r,i])=>t.replace(r,i),String(e))}var SOe=[...r4,...[...wx,...Sx,...Cx].map(([e])=>new RegExp(e.source,e.flags.replaceAll("g",""))),s4];function Oo(e,t,r,i,s="",n="",a="g"){let o=`${t}{${r},}${s}`;return new RegExp(`(?:\\b${e}${n}${o}|${e}${i}${o})`,a)}function mn(e){return`(?=${e}{0,64}[0-9])`}function QE(e){return`(?=[A-Za-z0-9_-]{0,64}?(?=[A-Za-z0-9]{${e}})(?=[A-Za-z0-9]{0,64}[0-9])(?=[A-Za-z0-9]{0,64}[A-Za-z]))`}tO();function Yt(e){return e}function nd(e){return e}function Ox(e){return e}var Xr=class extends Error{telemetryMessage;errorClass;constructor(t,r,i){super(t),this.name="TelemetrySafeError",this.telemetryMessage=r??t,this.errorClass=i}},o4=(e,t)=>{try{e!==null&&typeof e=="object"&&!("telemetryMessage"in e)&&Object.isExtensible(e)&&Object.assign(e,{telemetryMessage:t})}catch{}return e},Dr=(e,t)=>{try{if(e!==null&&typeof e=="object"&&Object.isExtensible(e)){let r=e,i=Object.entries(t).filter(([s,n])=>n!==void 0&&!(s in r));Object.assign(r,Object.fromEntries(i))}}catch{}return e};function l4(e){try{if(e!==null&&typeof e=="object"&&"telemetryMessage"in e&&typeof e.telemetryMessage=="string")return e.telemetryMessage}catch{}}function fl(e){return e instanceof Error?e:Error(String(e))}function Cs(e){return e instanceof Error?e.message:String(e)}function Ye(e){if(e&&typeof e=="object"&&"code"in e&&typeof e.code=="string")return e.code}function Ac(e){return c4(Ye(e))}function c4(e){return e&&/^[A-Z][A-Z0-9_]{0,63}$/.test(e)?Ox(e):void 0}function u4(e){if(typeof e=="string")return/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(e)?Ox(e):Yt("nonconforming")}function ad(e){return Ye(e)==="ENOENT"}function e0(e){return Ye(e)==="EISDIR"}var d4=new Set(["ENOENT","EACCES","EPERM","ENOTDIR","ELOOP","ENAMETOOLONG","EROFS"]);function t0(e){return p4(Ye(e))}function p4(e){return e!==void 0&&d4.has(e)}var A4=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),x4=new Set(["EPERM","EBUSY","EACCES"]);function k4(e){return`${e}.tmp.${w4(4).toString("hex")}`}var T4=4,R4=50,HOe=new Int32Array(new SharedArrayBuffer(4));function D4(e,t){if(process.platform!=="win32")return!1;let r=Ye(e);return r!==void 0&&x4.has(r)&&t<T4-1}var I4=128;async function L4(e){try{return((await rv(e)).mode&I4)===0}catch{return!1}}async function P4(e,t){let r=!1;for(let i=0;;i++)try{return await e(),r}catch(s){if(D4(s,i)){if(i===0&&t!==void 0&&await L4(t))throw s;r=!0,await ed(R4);continue}throw s}}function N4(e,t,r=S4){return P4(()=>r(e,t),t)}var M4=67108864,iv=process.platform==="win32"?0:Wt.O_NONBLOCK;async function Ax(e,t,r=process.platform){if(r!=="win32")return!0;try{return(await rv(e)).isFile()}catch(i){return t&&Ye(i)==="ENOENT"}}async function U4(e,t=!1){if(!t&&!await Ax(e,!0))return{kind:"unavailable"};let r;try{r=await od(e,process.platform==="win32"?Wt.O_RDONLY:Wt.O_RDONLY|(t?0:Wt.O_NOFOLLOW)|iv)}catch(i){return Ye(i)==="ENOENT"?{kind:"absent"}:{kind:"unavailable"}}try{let i=await r.stat();return!i.isFile()||i.size>M4?{kind:"unavailable"}:{kind:"snapshot",bytes:new Uint8Array(await r.readFile()),mode:i.mode&4095}}catch{return{kind:"unavailable"}}finally{await r.close().catch(()=>{})}}async function $4(e,t,r=!1){if(!r&&!await Ax(e,!0))return!1;let i;try{i=await od(e,process.platform==="win32"?"w":Wt.O_WRONLY|Wt.O_CREAT|Wt.O_TRUNC|(r?0:Wt.O_NOFOLLOW)|iv,t.mode)}catch{return!1}try{return(await i.stat()).isFile()?(await i.writeFile(t.bytes),await i.chmod(t.mode).catch(()=>{}),await i.close(),!0):(await i.close().catch(()=>{}),!1)}catch{return await i.close().catch(()=>{}),!1}}function nc(e,t,r){try{e instanceof Error&&(e.message=`${e.message}; ${t!==void 0?`new contents preserved at ${t}; `:""}${r==="restored"?"original target restored":r==="removed"?"partial target removed":r==="untouched"?"target untouched":"target left partial \u2014 treat contents as torn"}`,Object.assign(e,{...t!==void 0&&{preservedTmp:t},targetOutcome:r}))}catch{}return e}function Ap(e){let t=Ye(e);return t==="EINVAL"||t==="ENOTSUP"||t==="EPERM"||t==="ENOSYS"}var a0=3;async function j4(e,t){if(t!=="win32")return!1;try{return await rv(e),!0}catch(r){return Ye(r)==="ENOENT"?!1:{cause:r}}}function F4(e,t){return Object.assign(Error("EEXIST: name already taken (exclusive create)",typeof t=="object"?{cause:t.cause}:void 0),{code:"EEXIST",syscall:"lstat",path:e})}async function xx(e,t,r){for(let i=1;;i++){let s=k4(e),n=await j4(s,t);if(n!==!1){if(i<a0)continue;throw F4(s,n)}try{return await r(s)}catch(a){if(Ye(a)==="EEXIST"&&i<a0)continue;throw a}}}async function B4(e,t,r,i=process.platform){return xx(e,i,async s=>{try{return await O4(s,t,{encoding:"utf8",mode:r,flag:"wx"}),s}catch(n){throw Ye(n)!=="EEXIST"&&await xc(s).catch(()=>{}),n}})}async function H4(e,t,r=process.platform){return xx(e,r,async i=>({fh:await od(i,r==="win32"?"wx":Wt.O_WRONLY|Wt.O_CREAT|Wt.O_EXCL,t),tmp:i}))}async function z4(e,t,r,i){return W4(e,t,{mode:r,renameFn:i})}async function W4(e,t,r){let{mode:i,createMode:s,exactMode:n,flush:a,followSymlinks:o,inPlaceOnTempCreateRefused:l,renameFn:c}=r,u=i??s,p=o===!0||process.platform==="win32"?0:Wt.O_NOFOLLOW,h,f=!1,_=!1,v=async E=>{let y=await U4(e,o===!0),m=y.kind==="snapshot"?y:void 0,g=await od(e,process.platform==="win32"?Wt.O_WRONLY|Wt.O_CREAT:Wt.O_WRONLY|Wt.O_CREAT|p|iv,n??u),b;try{b=await g.stat()}catch(S){throw await g.close().catch(()=>{}),f=E!==void 0,nc(S,E,"untouched")}let C=b.isCharacterDevice();if(!b.isFile()&&!C)throw await g.close().catch(()=>{}),Object.assign(Error("refusing the in-place arm on a non-regular target"),{code:"ENXIO",path:e});let A=!1;try{C||(await g.truncate(0),A=!0),await g.writeFile(t,{encoding:"utf8"});let S=C?void 0:n??(y.kind!=="absent"?i:void 0);if(S!==void 0&&await g.chmod(S).catch(()=>{}),a===!0)try{await g.sync()}catch(x){if(!Ap(x))throw x}await g.close()}catch(S){if(await g.close().catch(()=>{}),!A)throw f=E!==void 0,nc(S,E,"untouched");f=E!==void 0;let x=m!==void 0&&await $4(e,m,o===!0)?"restored":await xc(e).then(()=>!0,T=>Ye(T)==="ENOENT")?"removed":"partial";throw nc(S,E,x)}let w=E??h;w!==void 0&&await xc(w).catch(()=>{})};try{try{if(n!==void 0||a===!0){let y=await H4(e,n??u),m=y.fh;h=y.tmp;let g=!1,b;try{if(await m.writeFile(t,{encoding:"utf8"}),n!==void 0)try{await m.chmod(n)}catch(C){if(!Ap(C))throw C}if(a===!0)try{await m.sync()}catch(C){if(!Ap(C))throw C}}catch(C){g=!0,b=C}g||(_=!0);try{await m.close()}catch(C){if(!g)throw f=!0,nc(C,h,"untouched")}if(g)throw b}else h=await B4(e,t,u),_=!0}catch(y){if(l!==!0||_||Ye(y)!=="EACCES"||!await C4(e).then(()=>!0,()=>!1))throw y;await v(void 0);return}if(h===void 0)throw Error("staging block exited without a staging file");let E=h;try{await N4(E,e,c)}catch(y){let m=Ye(y);if(m===void 0||!A4.has(m))throw y;await v(E)}}catch(E){throw h!==void 0&&!f&&await xc(h).catch(()=>{}),E}}var K4=process.platform==="win32"?0:kx.O_NONBLOCK,G4=process.platform==="win32"?0:kx.O_NOFOLLOW|K4,Lm=class{read(t){return n0(t,"utf8")}readBytes(t){return n0(t)}write(t,r,i){return Op(t,r,{encoding:"utf8",mode:i})}async mkdir(t,r){try{await y4(t,{recursive:!0,mode:r})}catch(i){if(Ye(i)!=="EEXIST")throw i}}atomicWrite(t,r,i){return z4(t,r,i)}delete(t){return E4(t)}list(t){return s0(t)}append(t,r,i){return g4(t,r,{encoding:"utf8",mode:i})}writeExclusive(t,r,i){return Op(t,r,{encoding:"utf8",flag:"wx",mode:i})}writeBytesExclusive(t,r,i){return Op(t,r,{flag:"wx",mode:i})}copy(t,r){return _4(t,r)}async stat(t){return{mtimeMs:(await b4(t)).mtimeMs}}async lstat(t){try{let r=await v4(t);return{isSymbolicLink:r.isSymbolicLink(),isFile:r.isFile(),isDirectory:r.isDirectory(),mtimeMs:r.mtimeMs,nlink:r.nlink}}catch(r){if(Ye(r)==="ENOENT")return;throw r}}async listEntries(t){return(await s0(t,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}async readRange(t,r,i){xp("readRange","offset",r),xp("readRange","length",i);let s=await i0(t,"r");try{return await o0(s,r,i)}finally{await s.close()}}async readTail(t,r,i){xp("readTail","maxBytes",r);let s=i?.noFollow?m4.O_RDONLY|G4:"r",n=await i0(t,s);try{let a=await n.stat();if(i?.noFollow&&!a.isFile())throw Object.assign(Error("ENXIO: not a regular file"),{code:"ENXIO",path:t});let{size:o}=a,l=Math.min(r,o);return await o0(n,o-l,l)}finally{await n.close()}}};function xp(e,t,r){if(!Number.isInteger(r)||r<0)throw RangeError(`${e}: ${t} must be a non-negative integer, got ${r}`)}async function o0(e,t,r){if(r===0)return Buffer.alloc(0);let i=Buffer.alloc(r),s=0;for(;s<r;){let{bytesRead:n}=await e.read(i,s,r-s,t+s);if(n===0)break;s+=n}return s===r?i:Buffer.from(i.subarray(0,s))}var q4=new f4;function Tx(){return q4.getStore()??new Lm}var Rx={};fr(Rx,{AGENT_PROXY_AUTH_TOKEN:()=>jK,ANTHROPIC_API_KEY:()=>AK,ANTHROPIC_AUTH_TOKEN:()=>xK,ANTHROPIC_AWS_API_KEY:()=>RK,ANTHROPIC_FEDERATION_RULE_ID:()=>CG,ANTHROPIC_FOUNDRY_API_KEY:()=>DK,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>IK,ANTHROPIC_ORGANIZATION_ID:()=>AG,ANTHROPIC_PROFILE:()=>kG,ANTHROPIC_WORKSPACE_ID:()=>xG,AWS_BEARER_TOKEN_BEDROCK:()=>TK,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>MK,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>NK,AWS_ROLE_ARN:()=>PK,AWS_WEB_IDENTITY_TOKEN_FILE:()=>LK,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>RG,CLAUDE_CODE_ACCOUNT_UUID:()=>TG,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>zK,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>hG,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>pG,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>SG,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>JK,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>XK,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>fG,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>OG,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>KK,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>$K,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>rG,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>tG,CLAUDE_CODE_HOST_CREDS_FILE:()=>iG,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>dG,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>ZK,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>VK,CLAUDE_CODE_OAUTH_SCOPES:()=>YK,CLAUDE_CODE_OAUTH_TOKEN:()=>kK,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>WK,CLAUDE_CODE_ORGANIZATION_UUID:()=>DG,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>mG,CLAUDE_CODE_RATE_LIMIT_TIER:()=>PG,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>eG,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>QK,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>sG,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>yG,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>bG,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>wG,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>gG,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>vG,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>EG,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>_G,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>LG,CLAUDE_CODE_USER_EMAIL:()=>IG,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>GK,CLAUDE_LOCAL_OAUTH_API_BASE:()=>lG,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>cG,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>uG,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>qK,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>nG,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>UK,ENVIRONMENT_SERVICE_KEY:()=>FK,MCP_CLIENT_SECRET:()=>BK,MCP_XAA_IDP_CLIENT_SECRET:()=>HK,USE_LOCAL_OAUTH:()=>aG,USE_STAGING_OAUTH:()=>oG});var Ve;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw Error()}e.assertNever=r,e.arrayToEnum=s=>{let n={};for(let a of s)n[a]=a;return n},e.getValidEnumValues=s=>{let n=e.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(let o of n)a[o]=s[o];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(n){return s[n]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let n=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&n.push(a);return n},e.find=(s,n)=>{for(let a of s)if(n(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function i(s,n=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}e.joinValues=i,e.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(Ve||(Ve={}));var l0;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(l0||(l0={}));var Ce=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gi=e=>{switch(typeof e){case"undefined":return Ce.undefined;case"string":return Ce.string;case"number":return Number.isNaN(e)?Ce.nan:Ce.number;case"boolean":return Ce.boolean;case"function":return Ce.function;case"bigint":return Ce.bigint;case"symbol":return Ce.symbol;case"object":return Array.isArray(e)?Ce.array:e===null?Ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ce.promise:typeof Map<"u"&&e instanceof Map?Ce.map:typeof Set<"u"&&e instanceof Set?Ce.set:typeof Date<"u"&&e instanceof Date?Ce.date:Ce.object;default:return Ce.unknown}},de=Ve.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"]),Mr=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(n){return n.message},i={_errors:[]},s=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let o=i,l=0;for(;l<a.path.length;){let c=a.path[l];l!==a.path.length-1?o[c]=o[c]||{_errors:[]}:(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(a))),o=o[c],l++}}};return s(this),i}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),i=[];for(let s of this.issues)if(s.path.length>0){let n=s.path[0];r[n]=r[n]||[],r[n].push(t(s))}else i.push(t(s));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Mr.create=e=>new Mr(e);var V4=(e,t)=>{let r;switch(e.code){case de.invalid_type:e.received===Ce.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case de.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ve.jsonStringifyReplacer)}`;break;case de.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ve.joinValues(e.keys,", ")}`;break;case de.invalid_union:r="Invalid input";break;case de.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ve.joinValues(e.options)}`;break;case de.invalid_enum_value:r=`Invalid enum value. Expected ${Ve.joinValues(e.options)}, received '${e.received}'`;break;case de.invalid_arguments:r="Invalid function arguments";break;case de.invalid_return_type:r="Invalid function return type";break;case de.invalid_date:r="Invalid date";break;case de.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ve.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case de.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case de.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case de.custom:r="Invalid input";break;case de.invalid_intersection_types:r="Intersection results could not be merged";break;case de.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case de.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ve.assertNever(e)}return{message:r}},jo=V4,Z4=jo;function Pm(){return Z4}var Nm=e=>{let{data:t,path:r,errorMaps:i,issueData:s}=e,n=[...r,...s.path||[]],a={...s,path:n};if(s.message!==void 0)return{...s,path:n,message:s.message};let o="",l=i.filter(c=>!!c).slice().reverse();for(let c of l)o=c(a,{data:t,defaultError:o}).message;return{...s,path:n,message:o}};function ye(e,t){let r=Pm(),i=Nm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===jo?void 0:jo].filter(s=>!!s)});e.common.issues.push(i)}var ir=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let i=[];for(let s of r){if(s.status==="aborted")return Ie;s.status==="dirty"&&t.dirty(),i.push(s.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,r){let i=[];for(let s of r){let n=await s.key,a=await s.value;i.push({key:n,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,r){let i={};for(let s of r){let{key:n,value:a}=s;if(n.status==="aborted"||a.status==="aborted")return Ie;n.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(i[n.value]=a.value)}return{status:t.value,value:i}}},Ie=Object.freeze({status:"aborted"}),uo=e=>({status:"dirty",value:e}),hr=e=>({status:"valid",value:e}),c0=e=>e.status==="aborted",u0=e=>e.status==="dirty",$n=e=>e.status==="valid",mu=e=>typeof Promise<"u"&&e instanceof Promise,ke;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ke||(ke={}));var $r=class{constructor(t,r,i,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=s}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}},d0=(e,t)=>{if($n(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Mr(e.common.issues);return this._error=r,this._error}}};function Ue(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:s}=e;if(t&&(r||i))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(n,a)=>{let{message:o}=e;return n.code==="invalid_enum_value"?{message:o??a.defaultError}:typeof a.data>"u"?{message:o??i??a.defaultError}:n.code!=="invalid_type"?{message:a.defaultError}:{message:o??r??a.defaultError}},description:s}}var Fe=class{get description(){return this._def.description}_getType(t){return Gi(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Gi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ir,ctx:{common:t.parent.common,data:t.data,parsedType:Gi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(mu(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Gi(t)},s=this._parseSync({data:t,path:i.path,parent:i});return d0(i,s)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Gi(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:r});return $n(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>$n(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){let i=await this.safeParseAsync(t,r);if(i.success)return i.data;throw i.error}async safeParseAsync(t,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Gi(t)},s=this._parse({data:t,path:i.path,parent:i}),n=await(mu(s)?s:Promise.resolve(s));return d0(i,n)}refine(t,r){let i=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,n)=>{let a=t(s),o=()=>n.addIssue({code:de.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(t,r){return this._refinement((i,s)=>t(i)?!0:(s.addIssue(typeof r=="function"?r(i,s):r),!1))}_refinement(t){return new Qr({schema:this,typeName:Pe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return Yr.create(this,this._def)}nullable(){return ki.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ts.create(this)}promise(){return Ls.create(this,this._def)}or(t){return Hn.create([this,t],this._def)}and(t){return zn.create(this,t,this._def)}transform(t){return new Qr({...Ue(this._def),schema:this,typeName:Pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Vn({...Ue(this._def),innerType:this,defaultValue:r,typeName:Pe.ZodDefault})}brand(){return new gu({typeName:Pe.ZodBranded,type:this,...Ue(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Zn({...Ue(this._def),innerType:this,catchValue:r,typeName:Pe.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return _u.create(this,t)}readonly(){return Xn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},X4=/^c[^\s-]{8,}$/i,Y4=/^[0-9a-z]+$/,J4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Q4=/^[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,eK=/^[a-z0-9_-]{21}$/i,tK=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rK=/^[-+]?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)?)??$/,iK=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kp,nK=/^(?:(?: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])$/,aK=/^(?:(?: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])$/,oK=/^(([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]))$/,lK=/^(([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])$/,cK=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,uK=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dx="((\\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])))",dK=new RegExp(`^${Dx}$`);function Ix(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function pK(e){return new RegExp(`^${Ix(e)}$`)}function hK(e){let t=`${Dx}T${Ix(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function fK(e,t){return!!((t==="v4"||!t)&&nK.test(e)||(t==="v6"||!t)&&oK.test(e))}function mK(e,t){if(!tK.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(i));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function gK(e,t){return!!((t==="v4"||!t)&&aK.test(e)||(t==="v6"||!t)&&lK.test(e))}var jn=class e extends Fe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ce.string){let s=this._getOrReturnCtx(t);return ye(s,{code:de.invalid_type,expected:Ce.string,received:s.parsedType}),Ie}let r=new ir,i;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),ye(i,{code:de.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),ye(i,{code:de.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let n=t.data.length>s.value,a=t.data.length<s.value;(n||a)&&(i=this._getOrReturnCtx(t,i),n?ye(i,{code:de.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ye(i,{code:de.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")iK.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"email",code:de.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")kp||(kp=new RegExp(sK,"u")),kp.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"emoji",code:de.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Q4.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"uuid",code:de.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")eK.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"nanoid",code:de.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")X4.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"cuid",code:de.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Y4.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"cuid2",code:de.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")J4.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"ulid",code:de.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ye(i,{validation:"url",code:de.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,!s.regex.test(t.data)&&(i=this._getOrReturnCtx(t,i),ye(i,{validation:"regex",code:de.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),ye(i,{code:de.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),ye(i,{code:de.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),ye(i,{code:de.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?hK(s).test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{code:de.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?dK.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{code:de.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?pK(s).test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{code:de.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?rK.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"duration",code:de.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?fK(t.data,s.version)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"ip",code:de.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?mK(t.data,s.alg)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"jwt",code:de.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?gK(t.data,s.version)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"cidr",code:de.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?cK.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"base64",code:de.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?uK.test(t.data)||(i=this._getOrReturnCtx(t,i),ye(i,{validation:"base64url",code:de.invalid_string,message:s.message}),r.dirty()):Ve.assertNever(s);return{status:r.value,value:t.data}}_regex(t,r,i){return this.refinement(s=>t.test(s),{validation:r,code:de.invalid_string,...ke.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ke.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ke.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ke.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ke.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ke.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ke.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ke.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ke.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ke.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ke.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ke.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ke.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ke.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ke.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ke.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ke.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ke.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ke.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ke.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ke.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ke.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ke.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ke.errToObj(r)})}nonempty(t){return this.min(1,ke.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};jn.create=e=>new jn({checks:[],typeName:Pe.ZodString,coerce:e?.coerce??!1,...Ue(e)});function _K(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,s=r>i?r:i,n=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return n%a/10**s}var Fo=class e extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ce.number){let s=this._getOrReturnCtx(t);return ye(s,{code:de.invalid_type,expected:Ce.number,received:s.parsedType}),Ie}let r,i=new ir;for(let s of this._def.checks)s.kind==="int"?Ve.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:de.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:de.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:de.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?_K(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),ye(r,{code:de.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:de.not_finite,message:s.message}),i.dirty()):Ve.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ke.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ke.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ke.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ke.toString(r))}setLimit(t,r,i,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:ke.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ke.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ke.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ke.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ve.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Fo.create=e=>new Fo({checks:[],typeName:Pe.ZodNumber,coerce:e?.coerce||!1,...Ue(e)});var Bo=class e extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ce.bigint)return this._getInvalidInput(t);let r,i=new ir;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:de.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:de.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:de.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ve.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ye(r,{code:de.invalid_type,expected:Ce.bigint,received:r.parsedType}),Ie}gte(t,r){return this.setLimit("min",t,!0,ke.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ke.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ke.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ke.toString(r))}setLimit(t,r,i,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:ke.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ke.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Bo.create=e=>new Bo({checks:[],typeName:Pe.ZodBigInt,coerce:e?.coerce??!1,...Ue(e)});var Ho=class extends Fe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ce.boolean){let r=this._getOrReturnCtx(t);return ye(r,{code:de.invalid_type,expected:Ce.boolean,received:r.parsedType}),Ie}return hr(t.data)}};Ho.create=e=>new Ho({typeName:Pe.ZodBoolean,coerce:e?.coerce||!1,...Ue(e)});var zo=class e extends Fe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ce.date){let s=this._getOrReturnCtx(t);return ye(s,{code:de.invalid_type,expected:Ce.date,received:s.parsedType}),Ie}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return ye(s,{code:de.invalid_date}),Ie}let r=new ir,i;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),ye(i,{code:de.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),ye(i,{code:de.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Ve.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ke.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ke.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};zo.create=e=>new zo({checks:[],coerce:e?.coerce||!1,typeName:Pe.ZodDate,...Ue(e)});var Wo=class extends Fe{_parse(t){if(this._getType(t)!==Ce.symbol){let r=this._getOrReturnCtx(t);return ye(r,{code:de.invalid_type,expected:Ce.symbol,received:r.parsedType}),Ie}return hr(t.data)}};Wo.create=e=>new Wo({typeName:Pe.ZodSymbol,...Ue(e)});var Fn=class extends Fe{_parse(t){if(this._getType(t)!==Ce.undefined){let r=this._getOrReturnCtx(t);return ye(r,{code:de.invalid_type,expected:Ce.undefined,received:r.parsedType}),Ie}return hr(t.data)}};Fn.create=e=>new Fn({typeName:Pe.ZodUndefined,...Ue(e)});var Bn=class extends Fe{_parse(t){if(this._getType(t)!==Ce.null){let r=this._getOrReturnCtx(t);return ye(r,{code:de.invalid_type,expected:Ce.null,received:r.parsedType}),Ie}return hr(t.data)}};Bn.create=e=>new Bn({typeName:Pe.ZodNull,...Ue(e)});var Ko=class extends Fe{constructor(){super(...arguments),this._any=!0}_parse(t){return hr(t.data)}};Ko.create=e=>new Ko({typeName:Pe.ZodAny,...Ue(e)});var Yi=class extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return hr(t.data)}};Yi.create=e=>new Yi({typeName:Pe.ZodUnknown,...Ue(e)});var ui=class extends Fe{_parse(t){let r=this._getOrReturnCtx(t);return ye(r,{code:de.invalid_type,expected:Ce.never,received:r.parsedType}),Ie}};ui.create=e=>new ui({typeName:Pe.ZodNever,...Ue(e)});var Go=class extends Fe{_parse(t){if(this._getType(t)!==Ce.undefined){let r=this._getOrReturnCtx(t);return ye(r,{code:de.invalid_type,expected:Ce.void,received:r.parsedType}),Ie}return hr(t.data)}};Go.create=e=>new Go({typeName:Pe.ZodVoid,...Ue(e)});var ts=class e extends Fe{_parse(t){let{ctx:r,status:i}=this._processInputParams(t),s=this._def;if(r.parsedType!==Ce.array)return ye(r,{code:de.invalid_type,expected:Ce.array,received:r.parsedType}),Ie;if(s.exactLength!==null){let a=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(a||o)&&(ye(r,{code:a?de.too_big:de.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(ye(r,{code:de.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(ye(r,{code:de.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>s.type._parseAsync(new $r(r,a,r.path,o)))).then(a=>ir.mergeArray(i,a));let n=[...r.data].map((a,o)=>s.type._parseSync(new $r(r,a,r.path,o)));return ir.mergeArray(i,n)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ke.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ke.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ke.toString(r)}})}nonempty(t){return this.min(1,t)}};ts.create=(e,t)=>new ts({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Pe.ZodArray,...Ue(t)});function on(e){if(e instanceof jr){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=Yr.create(on(i))}return new jr({...e._def,shape:()=>t})}else return e instanceof ts?new ts({...e._def,type:on(e.element)}):e instanceof Yr?Yr.create(on(e.unwrap())):e instanceof ki?ki.create(on(e.unwrap())):e instanceof xi?xi.create(e.items.map(t=>on(t))):e}var jr=class e extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ve.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Ce.object){let l=this._getOrReturnCtx(t);return ye(l,{code:de.invalid_type,expected:Ce.object,received:l.parsedType}),Ie}let{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:n}=this._getCached(),a=[];if(!(this._def.catchall instanceof ui&&this._def.unknownKeys==="strip"))for(let l in i.data)n.includes(l)||a.push(l);let o=[];for(let l of n){let c=s[l],u=i.data[l];o.push({key:{status:"valid",value:l},value:c._parse(new $r(i,u,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof ui){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)o.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(ye(i,{code:de.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let u=i.data[c];o.push({key:{status:"valid",value:c},value:l._parse(new $r(i,u,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of o){let u=await c.key,p=await c.value;l.push({key:u,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>ir.mergeObjectSync(r,l)):ir.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(t){return ke.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,i)=>{let s=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:ke.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Pe.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let i of Ve.objectKeys(t))t[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let i of Ve.objectKeys(this.shape))t[i]||(r[i]=this.shape[i]);return new e({...this._def,shape:()=>r})}deepPartial(){return on(this)}partial(t){let r={};for(let i of Ve.objectKeys(this.shape)){let s=this.shape[i];t&&!t[i]?r[i]=s:r[i]=s.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let i of Ve.objectKeys(this.shape))if(t&&!t[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Yr;)s=s._def.innerType;r[i]=s}return new e({...this._def,shape:()=>r})}keyof(){return Lx(Ve.objectKeys(this.shape))}};jr.create=(e,t)=>new jr({shape:()=>e,unknownKeys:"strip",catchall:ui.create(),typeName:Pe.ZodObject,...Ue(t)});jr.strictCreate=(e,t)=>new jr({shape:()=>e,unknownKeys:"strict",catchall:ui.create(),typeName:Pe.ZodObject,...Ue(t)});jr.lazycreate=(e,t)=>new jr({shape:e,unknownKeys:"strip",catchall:ui.create(),typeName:Pe.ZodObject,...Ue(t)});var Hn=class extends Fe{_parse(t){let{ctx:r}=this._processInputParams(t),i=this._def.options;function s(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=n.map(o=>new Mr(o.ctx.common.issues));return ye(r,{code:de.invalid_union,unionErrors:a}),Ie}if(r.common.async)return Promise.all(i.map(async n=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let n,a=[];for(let l of i){let c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let o=a.map(l=>new Mr(l));return ye(r,{code:de.invalid_union,unionErrors:o}),Ie}}get options(){return this._def.options}};Hn.create=(e,t)=>new Hn({options:e,typeName:Pe.ZodUnion,...Ue(t)});var Ei=e=>e instanceof Wn?Ei(e.schema):e instanceof Qr?Ei(e.innerType()):e instanceof Kn?[e.value]:e instanceof Gn?e.options:e instanceof qn?Ve.objectValues(e.enum):e instanceof Vn?Ei(e._def.innerType):e instanceof Fn?[void 0]:e instanceof Bn?[null]:e instanceof Yr?[void 0,...Ei(e.unwrap())]:e instanceof ki?[null,...Ei(e.unwrap())]:e instanceof gu||e instanceof Xn?Ei(e.unwrap()):e instanceof Zn?Ei(e._def.innerType):[],Mm=class e extends Fe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.object)return ye(r,{code:de.invalid_type,expected:Ce.object,received:r.parsedType}),Ie;let i=this.discriminator,s=r.data[i],n=this.optionsMap.get(s);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(ye(r,{code:de.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ie)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){let s=new Map;for(let n of r){let a=Ei(n.shape[t]);if(!a.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let o of a){if(s.has(o))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);s.set(o,n)}}return new e({typeName:Pe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Ue(i)})}};function Um(e,t){let r=Gi(e),i=Gi(t);if(e===t)return{valid:!0,data:e};if(r===Ce.object&&i===Ce.object){let s=Ve.objectKeys(t),n=Ve.objectKeys(e).filter(o=>s.indexOf(o)!==-1),a={...e,...t};for(let o of n){let l=Um(e[o],t[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(r===Ce.array&&i===Ce.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let n=0;n<e.length;n++){let a=e[n],o=t[n],l=Um(a,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return r===Ce.date&&i===Ce.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var zn=class extends Fe{_parse(t){let{status:r,ctx:i}=this._processInputParams(t),s=(n,a)=>{if(c0(n)||c0(a))return Ie;let o=Um(n.value,a.value);return o.valid?((u0(n)||u0(a))&&r.dirty(),{status:r.value,value:o.data}):(ye(i,{code:de.invalid_intersection_types}),Ie)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([n,a])=>s(n,a)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};zn.create=(e,t,r)=>new zn({left:e,right:t,typeName:Pe.ZodIntersection,...Ue(r)});var xi=class e extends Fe{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==Ce.array)return ye(i,{code:de.invalid_type,expected:Ce.array,received:i.parsedType}),Ie;if(i.data.length<this._def.items.length)return ye(i,{code:de.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ie;!this._def.rest&&i.data.length>this._def.items.length&&(ye(i,{code:de.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((n,a)=>{let o=this._def.items[a]||this._def.rest;return o?o._parse(new $r(i,n,i.path,a)):null}).filter(n=>!!n);return i.common.async?Promise.all(s).then(n=>ir.mergeArray(r,n)):ir.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};xi.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new xi({items:e,typeName:Pe.ZodTuple,rest:null,...Ue(t)})};var $m=class e extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==Ce.object)return ye(i,{code:de.invalid_type,expected:Ce.object,received:i.parsedType}),Ie;let s=[],n=this._def.keyType,a=this._def.valueType;for(let o in i.data)s.push({key:n._parse(new $r(i,o,i.path,o)),value:a._parse(new $r(i,i.data[o],i.path,o)),alwaysSet:o in i.data});return i.common.async?ir.mergeObjectAsync(r,s):ir.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,i){return r instanceof Fe?new e({keyType:t,valueType:r,typeName:Pe.ZodRecord,...Ue(i)}):new e({keyType:jn.create(),valueType:t,typeName:Pe.ZodRecord,...Ue(r)})}},qo=class extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==Ce.map)return ye(i,{code:de.invalid_type,expected:Ce.map,received:i.parsedType}),Ie;let s=this._def.keyType,n=this._def.valueType,a=[...i.data.entries()].map(([o,l],c)=>({key:s._parse(new $r(i,o,i.path,[c,"key"])),value:n._parse(new $r(i,l,i.path,[c,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ie;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of a){let{key:c,value:u}=l;if(c.status==="aborted"||u.status==="aborted")return Ie;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(c.value,u.value)}return{status:r.value,value:o}}}};qo.create=(e,t,r)=>new qo({valueType:t,keyType:e,typeName:Pe.ZodMap,...Ue(r)});var Vo=class e extends Fe{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==Ce.set)return ye(i,{code:de.invalid_type,expected:Ce.set,received:i.parsedType}),Ie;let s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ye(i,{code:de.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ye(i,{code:de.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let n=this._def.valueType;function a(l){let c=new Set;for(let u of l){if(u.status==="aborted")return Ie;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}let o=[...i.data.values()].map((l,c)=>n._parse(new $r(i,l,i.path,c)));return i.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(t,r){return new e({...this._def,minSize:{value:t,message:ke.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ke.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Vo.create=(e,t)=>new Vo({valueType:e,minSize:null,maxSize:null,typeName:Pe.ZodSet,...Ue(t)});var jm=class e extends Fe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.function)return ye(r,{code:de.invalid_type,expected:Ce.function,received:r.parsedType}),Ie;function i(o,l){return Nm({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pm(),jo].filter(c=>!!c),issueData:{code:de.invalid_arguments,argumentsError:l}})}function s(o,l){return Nm({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pm(),jo].filter(c=>!!c),issueData:{code:de.invalid_return_type,returnTypeError:l}})}let n={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Ls){let o=this;return hr(async function(...l){let c=new Mr([]),u=await o._def.args.parseAsync(l,n).catch(h=>{throw c.addIssue(i(l,h)),c}),p=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(p,n).catch(h=>{throw c.addIssue(s(p,h)),c})})}else{let o=this;return hr(function(...l){let c=o._def.args.safeParse(l,n);if(!c.success)throw new Mr([i(l,c.error)]);let u=Reflect.apply(a,this,c.data),p=o._def.returns.safeParse(u,n);if(!p.success)throw new Mr([s(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:xi.create(t).rest(Yi.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new e({args:t||xi.create([]).rest(Yi.create()),returns:r||Yi.create(),typeName:Pe.ZodFunction,...Ue(i)})}},Wn=class extends Fe{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Wn.create=(e,t)=>new Wn({getter:e,typeName:Pe.ZodLazy,...Ue(t)});var Kn=class extends Fe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ye(r,{received:r.data,code:de.invalid_literal,expected:this._def.value}),Ie}return{status:"valid",value:t.data}}get value(){return this._def.value}};Kn.create=(e,t)=>new Kn({value:e,typeName:Pe.ZodLiteral,...Ue(t)});function Lx(e,t){return new Gn({values:e,typeName:Pe.ZodEnum,...Ue(t)})}var Gn=class e extends Fe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),i=this._def.values;return ye(r,{expected:Ve.joinValues(i),received:r.parsedType,code:de.invalid_type}),Ie}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),i=this._def.values;return ye(r,{received:r.data,code:de.invalid_enum_value,options:i}),Ie}return hr(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}};Gn.create=Lx;var qn=class extends Fe{_parse(t){let r=Ve.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==Ce.string&&i.parsedType!==Ce.number){let s=Ve.objectValues(r);return ye(i,{expected:Ve.joinValues(s),received:i.parsedType,code:de.invalid_type}),Ie}if(this._cache||(this._cache=new Set(Ve.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let s=Ve.objectValues(r);return ye(i,{received:i.data,code:de.invalid_enum_value,options:s}),Ie}return hr(t.data)}get enum(){return this._def.values}};qn.create=(e,t)=>new qn({values:e,typeName:Pe.ZodNativeEnum,...Ue(t)});var Ls=class extends Fe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.promise&&r.common.async===!1)return ye(r,{code:de.invalid_type,expected:Ce.promise,received:r.parsedType}),Ie;let i=r.parsedType===Ce.promise?r.data:Promise.resolve(r.data);return hr(i.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ls.create=(e,t)=>new Ls({type:e,typeName:Pe.ZodPromise,...Ue(t)});var Qr=class extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:i}=this._processInputParams(t),s=this._def.effect||null,n={addIssue:a=>{ye(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(n.addIssue=n.addIssue.bind(n),s.type==="preprocess"){let a=s.transform(i.data,n);if(i.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return Ie;let l=await this._def.schema._parseAsync({data:o,path:i.path,parent:i});return l.status==="aborted"?Ie:l.status==="dirty"||r.value==="dirty"?uo(l.value):l});{if(r.value==="aborted")return Ie;let o=this._def.schema._parseSync({data:a,path:i.path,parent:i});return o.status==="aborted"?Ie:o.status==="dirty"||r.value==="dirty"?uo(o.value):o}}if(s.type==="refinement"){let a=o=>{let l=s.refinement(o,n);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?Ie:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?Ie:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!$n(a))return Ie;let o=s.transform(a.value,n);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>$n(a)?Promise.resolve(s.transform(a.value,n)).then(o=>({status:r.value,value:o})):Ie);Ve.assertNever(s)}};Qr.create=(e,t,r)=>new Qr({schema:e,typeName:Pe.ZodEffects,effect:t,...Ue(r)});Qr.createWithPreprocess=(e,t,r)=>new Qr({schema:t,effect:{type:"preprocess",transform:e},typeName:Pe.ZodEffects,...Ue(r)});var Yr=class extends Fe{_parse(t){return this._getType(t)===Ce.undefined?hr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Yr.create=(e,t)=>new Yr({innerType:e,typeName:Pe.ZodOptional,...Ue(t)});var ki=class extends Fe{_parse(t){return this._getType(t)===Ce.null?hr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ki.create=(e,t)=>new ki({innerType:e,typeName:Pe.ZodNullable,...Ue(t)});var Vn=class extends Fe{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return r.parsedType===Ce.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Vn.create=(e,t)=>new Vn({innerType:e,typeName:Pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ue(t)});var Zn=class extends Fe{_parse(t){let{ctx:r}=this._processInputParams(t),i={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return mu(s)?s.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Mr(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Mr(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Zn.create=(e,t)=>new Zn({innerType:e,typeName:Pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ue(t)});var Zo=class extends Fe{_parse(t){if(this._getType(t)!==Ce.nan){let r=this._getOrReturnCtx(t);return ye(r,{code:de.invalid_type,expected:Ce.nan,received:r.parsedType}),Ie}return{status:"valid",value:t.data}}};Zo.create=e=>new Zo({typeName:Pe.ZodNaN,...Ue(e)});var gu=class extends Fe{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},_u=class e extends Fe{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ie:s.status==="dirty"?(r.dirty(),uo(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ie:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(t,r){return new e({in:t,out:r,typeName:Pe.ZodPipeline})}},Xn=class extends Fe{_parse(t){let r=this._def.innerType._parse(t),i=s=>($n(s)&&(s.value=Object.freeze(s.value)),s);return mu(r)?r.then(s=>i(s)):i(r)}unwrap(){return this._def.innerType}};Xn.create=(e,t)=>new Xn({innerType:e,typeName:Pe.ZodReadonly,...Ue(t)});var WOe={object:jr.lazycreate},Pe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Pe||(Pe={}));var fa=jn.create,KOe=Fo.create,GOe=Zo.create,qOe=Bo.create,VOe=Ho.create,ZOe=zo.create,XOe=Wo.create,YOe=Fn.create,JOe=Bn.create,QOe=Ko.create,eAe=Yi.create,tAe=ui.create,rAe=Go.create,iAe=ts.create,{create:sAe,strictCreate:nAe}=jr,aAe=Hn.create,oAe=Mm.create,lAe=zn.create,cAe=xi.create,uAe=$m.create,dAe=qo.create,pAe=Vo.create,hAe=jm.create,fAe=Wn.create,mAe=Kn.create,gAe=Gn.create,_Ae=qn.create,vAe=Ls.create,yAe=Qr.create,bAe=Yr.create,EAe=ki.create,ma=Qr.createWithPreprocess,wAe=_u.create,Fm=class{resetters=[];lazy(t){let r;return this.resetters.push(()=>{r=void 0}),()=>r??=t()}reset(){for(let t of this.resetters)t()}},vK=new Fm;function re(e){return vK.lazy(e)}function yK(e){let t=e?.trim();return t||void 0}function ga(e){return e===void 0?void 0:String(e)}var bK=re(()=>ma(ga,fa().optional().transform(yK))),EK=re(()=>ma(ga,fa().optional())),wK=re(()=>ma(ga,fa().optional().transform(e=>st(e)))),SK=re(()=>ma(ga,fa().optional().transform(e=>{if(st(e))return!0;if(PS(e))return!1}))),CK=re(()=>Px());function OK(e){return typeof e=="boolean"?e?"1":"0":String(e)}var d={str:()=>bK(),rawStr:()=>EK(),bool:()=>wK(),triBool:()=>SK(),int:e=>e?Px(e):CK(),enum:e=>ma(ga,fa().optional().transform(t=>t!==void 0&&e.includes(t.trim())?t.trim():void 0))};function Px(e){return ma(ga,fa().optional().transform(t=>{if(t===void 0||e?.digitsOnly&&!/^[+-]?\d+$/.test(t.trim()))return;let r=ZW(t);if(Number.isFinite(r)&&!(e?.min!==void 0&&r<e.min)&&!(e?.max!==void 0&&r>e.max))return r}))}var AK=d.str(),xK=d.str(),kK=d.str(),TK=d.str(),RK=d.str(),DK=d.str(),IK=d.str(),LK=d.str(),PK=d.str(),NK=d.str(),MK=d.str(),UK=d.str(),$K=d.str(),jK=d.str(),FK=d.str(),BK=d.str(),HK=d.str(),zK=d.str(),WK=d.str(),KK=d.str(),GK=d.str(),qK=d.str(),VK=d.str(),ZK=d.str(),XK=d.str(),YK=d.str(),JK=d.str(),QK=d.bool(),eG=d.bool(),tG=d.int({min:1}),rG=d.str(),iG=d.str(),sG=d.str(),nG=d.str(),aG=d.bool(),oG=d.bool(),lG=d.str(),cG=d.str(),uG=d.str(),dG=d.int({min:0}),pG=d.int({min:0}),hG=d.int(),fG=d.bool(),mG=d.int(),gG=d.bool(),_G=d.bool(),vG=d.bool(),yG=d.bool(),bG=d.bool(),EG=d.bool(),wG=d.bool(),SG=d.int({min:1,max:2147483647}),CG=d.str(),OG=d.str(),AG=d.str(),xG=d.str(),kG=d.str(),TG=d.str(),RG=d.str(),DG=d.str(),IG=d.str(),LG=d.str(),PG=d.str(),Nx={};fr(Nx,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>zq,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>Mq,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>Uq,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>$q,ANT_OTEL_LOGS_EXPORTER:()=>jq,ANT_OTEL_METRICS_EXPORTER:()=>Fq,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>Hq,ANT_OTEL_TRACES_EXPORTER:()=>Bq,BETA_TRACING_ENDPOINT:()=>Wq,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>JG,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>nq,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>iq,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>sq,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>$G,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>UG,CLAUDE_CODE_DEBUG_REPAINTS:()=>jG,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>FG,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>QG,CLAUDE_CODE_FRAME_TIMING_LOG:()=>GG,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>qG,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>Rq,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>aq,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>eq,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>rq,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>tq,CLAUDE_CODE_PERFETTO_TRACE:()=>WG,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>KG,CLAUDE_CODE_PROFILE_STARTUP:()=>zG,CLAUDE_CODE_SESSION_LOG:()=>VG,CLAUDE_CODE_TEE_SDK_STDOUT:()=>YG,CLAUDE_CODE_TERMINAL_RECORDING:()=>XG,CLAUDE_DEBUG:()=>NG,CLAUDE_PTY_RECORD:()=>ZG,DEBUG:()=>MG,DEBUG_CLAUDE_AGENT_SDK:()=>BG,DEBUG_SDK:()=>HG,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>xq,OTEL_EXPORTER_OTLP_ENDPOINT:()=>uq,OTEL_EXPORTER_OTLP_HEADERS:()=>dq,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>hq,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>fq,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>mq,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>gq,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>_q,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>vq,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>yq,OTEL_EXPORTER_OTLP_PROTOCOL:()=>pq,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>bq,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>Eq,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>wq,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>kq,OTEL_LOGS_EXPORTER:()=>lq,OTEL_LOGS_EXPORT_INTERVAL:()=>Cq,OTEL_LOG_ASSISTANT_RESPONSES:()=>Iq,OTEL_LOG_RAW_API_BODIES:()=>Nq,OTEL_LOG_TOOL_CONTENT:()=>Lq,OTEL_LOG_TOOL_DETAILS:()=>Pq,OTEL_LOG_USER_PROMPTS:()=>Dq,OTEL_METRICS_EXPORTER:()=>oq,OTEL_METRIC_EXPORT_INTERVAL:()=>Sq,OTEL_RESOURCE_ATTRIBUTES:()=>Aq,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>Tq,OTEL_TRACES_EXPORTER:()=>cq,OTEL_TRACES_EXPORT_INTERVAL:()=>Oq});var NG=d.bool(),MG=d.str(),UG=d.str(),$G=d.str(),jG=d.bool(),FG=d.str(),BG=d.bool(),HG=d.bool(),zG=d.bool(),WG=d.str(),KG=d.int(),GG=d.str(),qG=d.int(),VG=d.str(),ZG=d.str(),XG=d.str(),YG=d.bool(),JG=d.bool(),QG=d.bool(),eq=d.int(),tq=d.int(),rq=d.int(),iq=d.int({min:1}),sq=d.int({min:1}),nq=d.bool(),aq=d.bool(),oq=d.str(),lq=d.str(),cq=d.str(),uq=d.str(),dq=d.str(),pq=d.str(),hq=d.str(),fq=d.str(),mq=d.str(),gq=d.str(),_q=d.str(),vq=d.str(),yq=d.str(),bq=d.str(),Eq=d.str(),wq=d.str(),Sq=d.int(),Cq=d.int(),Oq=d.int(),Aq=d.str(),xq=d.int({min:0}),kq=d.int({min:0}),Tq=d.int({min:0}),Rq=d.int({min:1,digitsOnly:!0}),Dq=d.bool(),Iq=d.triBool(),Lq=d.bool(),Pq=d.bool(),Nq=d.bool(),Mq=d.str(),Uq=d.str(),$q=d.str(),jq=d.str(),Fq=d.str(),Bq=d.str(),Hq=d.str(),zq=d.str(),Wq=d.str();function Ux(e,t){let r=0;for(let i of e)r+=+!!t(i);return r}function ld(e){return[...new Set(e)]}function $x(){return"prod"}function Yq(){if(process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL)return"-custom-oauth";switch($x()){case"local":return"-local-oauth";case"staging":return"-staging-oauth";case"prod":return""}}var Jq=31536e3,xAe=Math.round(Jq/86400),Qq="user:inference",jx="user:profile",e3="org:create_api_key",t3=[e3,jx],r3=[jx,Qq,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],kAe=ld([...t3,...r3]),p0={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",DESIGN_CLIENT_ID:"59637612-477b-4836-a601-b0589eda7704",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},i3=void 0;function s3(){let e=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",t=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",r=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:e,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${t}/oauth/authorize`,CLAUDE_AI_ORIGIN:t,TOKEN_URL:`${e}/v1/oauth/token`,API_KEY_URL:`${e}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${e}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",DESIGN_CLIENT_ID:"00000000-0000-4000-8000-000000000000",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}var n3=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];function a3(){let e=(()=>{switch($x()){case"local":return s3();case"staging":return i3??p0;case"prod":return p0}})(),t=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(t){let i=t.replace(/\/$/,"");if(!n3.includes(i))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");e={...e,BASE_API_URL:i,CONSOLE_AUTHORIZE_URL:`${i}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${i}/oauth/authorize`,CLAUDE_AI_ORIGIN:i,TOKEN_URL:`${i}/v1/oauth/token`,API_KEY_URL:`${i}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${i}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${i}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${i}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${i}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let r=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return r&&(e={...e,CLIENT_ID:r}),e}var S3={home:e=>({space:"home",path:e}),workspace:e=>({space:"workspace",path:e}),system:e=>({space:"system",path:e}),userNamed:e=>({space:"userNamed",path:e})},Hm=globalThis.process?.getBuiltinModule?.("async_hooks"),C3=Hm!==void 0,Bx=Hm?new Hm.AsyncLocalStorage:{run:(e,t)=>t(),getStore:()=>{}};function O3({writeBatch:e,sizeOf:t,flushIntervalMs:r=1e3,maxBufferSize:i=100,maxBufferBytes:s=1/0,immediateMode:n=!1}){let a=[],o=0,l=null,c=null;function u(){l&&(clearTimeout(l),l=null)}function p(v){try{e(v)}catch{}}function h(){c&&(p(c),c=null),a.length!==0&&(p(a),a=[],o=0,u())}function f(){l||(l=setTimeout(h,r))}function _(){if(c){c.push(...a),a=[],o=0,u();return}let v=a;a=[],o=0,u(),c=v,setImmediate(()=>{let E=c;c=null,E&&p(E)})}return{write(v){if(n){p([v]);return}a.push(v),o+=t(v),f(),(a.length>=i||o>=s)&&_()},flush:h,dispose(){h()}}}function A3(e){return typeof e=="function"?e:Symbol.asyncDispose in e?()=>e[Symbol.asyncDispose]():()=>e[Symbol.dispose]()}var vu=class{#e=new Set;#t=!1;get drainStarted(){return this.#t}register(t){let r=A3(t);this.#e.add(r);let i=()=>{this.#e.delete(r)};return Object.assign(i,{[Symbol.dispose]:i})}async drain(){this.#t=!0;let t=Array.from(this.#e);this.#e.clear();let r=(await Promise.allSettled(t.map(async i=>i()))).find(i=>i.status==="rejected");if(r!==void 0)throw r.reason}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}},zm=class{cleanup=new vu;preExitFlush=new vu},x3=new Nt(()=>new zm);function k3(){return sd(x3)}function Hx(e){return k3().cleanup.register(e)}var Wm=class{parsed=new Map;lookup(t){return this.parsed.get(t)}remember(t,r){this.parsed.set(t,r)}reset(){this.parsed.clear()}},_0=new Wm;function T3(e){let t=_0.lookup(e);if(t!==void 0)return t;let r=R3(e);return _0.remember(e,r),r}function R3(e){if(!e||e.trim()==="")return null;let t=e.split(",").map(n=>n.trim()).filter(Boolean);if(t.length===0)return null;let r=t.some(n=>n.startsWith("!")),i=t.some(n=>!n.startsWith("!"));if(r&&i)return null;let s=t.map(n=>n.replace(/^!/,"").toLowerCase());return{include:r?[]:s,exclude:r?s:[],isExclusive:r}}function D3(e){let t=[],r=e.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])t.push("mcp"),t.push(r[1].toLowerCase());else{let n=e.match(/^([^:[]+):/);n&&n[1]&&t.push(n[1].trim().toLowerCase())}let i=e.match(/^\[([^\]]+)]/);i&&i[1]&&t.push(i[1].trim().toLowerCase()),e.toLowerCase().includes("1p event:")&&t.push("1p");let s=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(s&&s[1]){let n=s[1].trim().toLowerCase();n.length<30&&!n.includes(" ")&&t.push(n)}return Array.from(new Set(t))}function I3(e,t){return t?e.length===0?!1:t.isExclusive?!e.some(r=>t.exclude.includes(r)):e.some(r=>t.include.includes(r)):!0}function L3(e,t){if(!t)return!0;let r=D3(e);return I3(r,t)}function P3(e,t,r){return e.destroyed||e.writableEnded?!1:(e.write(t,r),!0)}var Km=class e{everWritten=!1;drainPromise=void 0;bytesQueued=0;bytesFlushed=0;notifyFlushProgress=void 0;notifyExternallyClocked=void 0;externallyClockedPromise=void 0;externallyClocked=!1;errored=!1;flushConfirmedPromise=void 0;flushCloseListener=void 0;markEverWritten(){this.everWritten=!0}recordQueued(t){this.bytesQueued+=t}recordFlushed(t){this.bytesFlushed+=t,this.notifyFlushProgress?.()}markErrored(){this.errored=!0,this.notifyFlushProgress?.()}outstandingBytes(){return process.stdout.destroyed||this.errored?0:this.bytesQueued-this.bytesFlushed}endStdoutOnce(){if(this.drainPromise===void 0){let t=process.stdout;if(t.isTTY||t.destroyed||t.writableEnded||!this.everWritten)return;this.drainPromise=new Promise(r=>t.end(r))}return this.drainPromise}fullyFlushed(){return this.flushConfirmedPromise===void 0&&(this.flushConfirmedPromise=new Promise(t=>{let r=()=>{this.outstandingBytes()<=0&&(this.notifyFlushProgress=void 0,t())};this.notifyFlushProgress=r,this.flushCloseListener=r,process.stdout.once("close",r),r()})),this.flushConfirmedPromise}isExternallyClocked(){return this.externallyClocked}ensureExternallyClockedPromise(){return this.externallyClockedPromise??=new Promise(t=>{this.notifyExternallyClocked=t})}markExternallyClocked(){this.externallyClocked=!0,this.ensureExternallyClockedPromise(),this.notifyExternallyClocked?.(),this.notifyExternallyClocked=void 0}reset(){this.flushCloseListener!==void 0&&process.stdout.removeListener("close",this.flushCloseListener),Object.assign(this,new e)}},IAe=new Km;function N3(e){P3(process.stderr,e)}var M3=/api[_-]?key|secret|token|password|passwd|credential|bearer|authorization|auth[_-]?header|cookie|session[_-]?(?:id|key)|connection[_-]?string|(?:private|ssh|encryption|signing|access|deploy|master|license)[_-]?key|client[_-]?secret/i,v0="[^\\s,;&}\\])]+",y0=`"[^"]*"|'[^']*'|[^\\s-]{0,4}\\[REDACTED\\]['"\`]?|(?:Bearer|Basic)\\s+(?:\\[REDACTED\\]|${v0})|${v0}`,U3=["sk","ant","api"].join("-"),qr="[\\w=-]{20,}(?:\\.[0-9a-z]{9})?",zx=[{id:"url-userinfo",source:":\\/\\/([^/@\\s]+)@",confidence:"low"},{id:"gcp-service-account",source:"\\b([a-z0-9-]+@[a-z0-9-]+\\.iam\\.gserviceaccount\\.com)\\b",flags:"i",confidence:"low"},{id:"loose-anthropic-key",source:"\\b(sk-ant-?[\\w-]{10,})",confidence:"low"},{id:"http-auth-scheme",source:"\\b(?:Bearer|Basic)\\s+([A-Za-z0-9+/=._~-]{20,})",flags:"i",confidence:"low"},{id:"loose-jwt",source:"\\b(eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,})",confidence:"low"},{id:"sensitive-assign",source:`(?:${M3.source})[\\w.-]*["']?\\s*[=:]\\s*(${y0})`,flags:"i",confidence:"low"},{id:"cloud-env-var",source:`\\b(?:AWS|GOOGLE|GCP|GCLOUD|AZURE)_\\w+\\s*[=:]\\s*(${y0})`,flags:"i",confidence:"low"},{id:"aws-access-token",source:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b",confidence:"high"},{id:"gcp-api-key",source:"\\b(AIza[\\w-]{35})(?![\\w-])",confidence:"high"},{id:"google-oauth-client-secret",source:"\\bGOCSPX-[\\w-]{28}(?![\\w-])",confidence:"high"},{id:"azure-ad-client-secret",source:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${U3}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-oauth-token",source:`\\b(sk-ant-(?:oat|ort)\\d{2}-[\\w-]{20,})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:"sk-[A-Za-z0-9_-]{8,200}T3BlbkFJ[A-Za-z0-9_-]{8,200}",confidence:"high"},{id:"openai-legacy-api-key",source:"\\bsk-[a-zA-Z0-9]{48}(?![a-zA-Z0-9])",confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"supabase-secret-key",source:"\\bsb_secret_[A-Za-z0-9_-]{20,}",confidence:"high"},{id:"supabase-access-token",source:"\\bsbp_[a-z0-9]{40,}",confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:`glpat-${qr}`,confidence:"high"},{id:"gitlab-deploy-token",source:`gldt-${qr}`,confidence:"high"},{id:"gitlab-runner-authentication-token",source:`glrt-${qr}`,confidence:"high"},{id:"gitlab-oauth-app-secret",source:`gloas-${qr}`,confidence:"high"},{id:"gitlab-pipeline-trigger-token",source:`glptt-${qr}`,confidence:"high"},{id:"gitlab-kubernetes-agent-token",source:`glagent-${qr}`,confidence:"high"},{id:"gitlab-incoming-mail-token",source:`glimt-${qr}`,confidence:"high"},{id:"gitlab-scim-oauth-token",source:`glsoat-${qr}`,confidence:"high"},{id:"gitlab-ci-build-token",source:`glcbt-${qr}`,confidence:"high"},{id:"gitlab-feed-token",source:`glft-${qr}`,confidence:"high"},{id:"gitlab-feature-flag-client-token",source:`glffct-${qr}`,confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[a-z](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-rotation-token",source:"xoxe(?:\\.xox[a-z])?-[0-9]-[A-Za-z0-9-]{28,}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"slack-workflow-token",source:"\\bxwfp-[a-zA-Z0-9-]{20,}",confidence:"high"},{id:"slack-webhook-url",source:"(?:https?://)?hooks\\.slack\\.com/(?:services|workflows|triggers)/[A-Za-z0-9+/_-]{40,}",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"}],$3=64;function Gm(e,t){let r=/-----BEGIN[ A-Z0-9_-]{0,100}?PRIVATE KEY(?: BLOCK)?-----/gi,i=/-----END[ A-Z0-9_-]{0,100}?PRIVATE KEY(?: BLOCK)?-----/gi;r.lastIndex=t;let s=r.exec(e);if(!s)return null;i.lastIndex=s.index+s[0].length+$3;let n=i.exec(e);return n?{start:s.index,end:n.index+n[0].length}:null}function j3(e){return Gm(e,0)!==null}function F3(e){let t=Gm(e,0);if(!t)return e;let r="",i=0;for(;t;)r+=e.slice(i,t.start)+"[REDACTED]",i=t.end,t=Gm(e,i);return r+e.slice(i)}var b0=`(?:[\\x60'"\\s;]|\\\\[nr]|$)`,E0="(?=[^a-zA-Z0-9_\\-+=]|$)",B3="(?<![a-zA-Z0-9_\\-])";function H3(){return zx.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.confidence!=="high"?e.source:B3+(e.source.endsWith(b0)?e.source.slice(0,-b0.length)+E0:e.source+E0),(e.flags??"").replace("g","")+"g")}))}function w0(e){return zx.map(t=>({id:t.id,confidence:t.confidence,re:new RegExp(t.source,e?(t.flags??"").replace("g","")+"g":t.flags??"")}))}function Wx(e,t){if(typeof t!="string")return"[REDACTED]";let r=t.length>=2&&(t[0]==='"'||t[0]==="'")&&t.at(-1)===t[0]?t[0]:"",i=e.lastIndexOf(t);return`${e.slice(0,i)}${r}[REDACTED]${r}${e.slice(i+t.length)}`}var z3=512,W3=512,qm=class{testRules=null;redactRules=null;displayRules=null;resultCache=new Map;scan(t){this.testRules??=w0(!1);let r=[];for(let i of this.testRules)i.confidence==="high"&&i.re.test(t)&&r.push({ruleId:i.id,label:i.id.split("-").map(s=>X3[s]??cx(s)).join(" ")});return j3(t)&&r.push({ruleId:"private-key",label:"Private Key"}),r}redact(t){let r=t.length<=z3;if(r){let s=this.resultCache.get(t);if(s!==void 0)return s}this.redactRules??=w0(!0);let i=F3(t);for(let s of this.redactRules)i=i.replace(s.re,Wx);return r&&(this.resultCache.size>=W3&&this.resultCache.delete(this.resultCache.keys().next().value),this.resultCache.set(t,i)),i}redactForDisplay(t){this.displayRules??=H3();let r=t;for(let i of this.displayRules)i.confidence==="high"&&(r=r.replace(i.re,Z3));return r}},K3=new qm;function G3(e){return K3.redact(e)}var q3=/[$\x60|;&<>()\s]/,V3=/[/.@:~*?\\]/;function Z3(e,t){let r=typeof t=="string"?t:e;return q3.test(r)||V3.test(r)?e:Wx(e,t)}var X3={aws:"AWS",gcp:"GCP",api:"API",pat:"PAT",ad:"AD",tf:"TF",oauth:"OAuth",npm:"NPM",pypi:"PyPI",jwt:"JWT",ci:"CI",scim:"SCIM",github:"GitHub",gitlab:"GitLab",openai:"OpenAI",digitalocean:"DigitalOcean",huggingface:"HuggingFace",hashicorp:"HashiCorp",sendgrid:"SendGrid"},Vm={verbose:0,debug:1,info:2,warn:3,error:4},Y3=10485760;function J3(e){return Object.hasOwn(Vm,e)}function S0(e){return bz(e)?null:Fx(e)}function C0(){}var Q3={sessionId:"",fromBackend:!1};function O0(e,t,r,i){let s=Zi(t,"debug"),n=Zi(s,`${e.sessionId}.txt`),a;r===null?a=n:i!==null&&r===i?a=Zi(i,`${e.sessionId}.txt`):a=r;let o=!e.fromBackend&&a===n?"v5":"raw";return{target:a,arm:o,configHome:t,rotate:o==="raw"&&!(ln(a)===s&&a.endsWith(".txt")),pointLatest:o==="raw"&&a!==n}}function Ip(e){return S3.userNamed(w3(e)?e:Fx(e))}function e9(e){return e.code==="Failed"&&e.telemetryCode==="ENOENT"}function t9(e,t=C3){return t?e:void 0}async function A0(e,t,r,i){let s={namespace:"log",sessionId:t,channel:"debug"},n=await Bx.run(!0,()=>e.append(s,[{data:r}],i?{markLatest:!0}:void 0));return n.ok?"landed":i&&n.error.code==="InvalidArgument"&&n.error.argument==="opts.markLatest"?"refused":"dropped"}var Zm=class{deps;minLevel;filter;toStderr;filePath;runtimeDebugEnabled=!1;hasFormattedOutput=!1;debugFromLaunch;storageV5;writer=null;redirect=null;pendingWrite=Promise.resolve();unflushedChunks=[];backendLinesLogged=0;exiting=!1;exitHandlerRegistered=!1;successor=null;writtenBytes=-1;rotating=!1;resolvedLogPath=null;overrideDirectory=null;rotationTarget=null;latestMarked=!1;latestRefused=!1;constructor(t){if(this.deps=t,this.storageV5=t9(t.storageV5),t.launchIdentity!==void 0){this.minLevel=t.launchIdentity.minLevel,this.filter=t.launchIdentity.filter,this.toStderr=t.launchIdentity.toStderr,this.filePath=t.launchIdentity.filePath,this.debugFromLaunch=t.launchIdentity.debugFromLaunch;return}let r=Array.isArray(t.argv)?t.argv:[],i=r.indexOf("--"),s=i===-1?r:r.slice(0,i),n=t.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();this.minLevel=n&&J3(n)?n:"debug";let a=s.find(l=>l.startsWith("--debug="));this.filter=a?T3(a.substring(8)):null,this.toStderr=s.includes("--debug-to-stderr")||s.includes("-d2e");let o=null;for(let l=0;l<s.length;l++){let c=s[l];if(c.startsWith("--debug-file=")){o=S0(c.substring(13));break}if(c==="--debug-file"&&l+1<s.length){o=S0(s[l+1]);break}}this.filePath=o,this.debugFromLaunch=st(t.env.DEBUG)||st(t.env.DEBUG_SDK)||s.includes("--debug")||s.includes("-d")||this.toStderr||a!==void 0||this.filePath!==null}isDebugMode(){return this.runtimeDebugEnabled||this.debugFromLaunch}drainsSyncAtExit(){return!(ni()&&this.storageV5!==void 0&&this.deps.syncExitDrain===!1)}launchIdentity(){return{minLevel:this.minLevel,filter:this.filter,toStderr:this.toStderr,filePath:this.filePath,debugFromLaunch:this.debugFromLaunch,isAnt:this.deps.isAnt,isTestEnvironment:this.deps.isTestEnvironment}}enableDebugLogging(){let t=this.isDebugMode()||this.deps.isAnt;return this.runtimeDebugEnabled=!0,t}logPath(){return this.filePath??(this.overrideDirectory!==null&&this.overrideDirectory===this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR?Zi(this.overrideDirectory,`${this.deps.sessionId()}.txt`):null)??this.resolvedLogPath??this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR??this.defaultLogPath()}defaultLogPath(t=this.deps.sessionId()){return Zi(this.deps.configHomeDir(),"debug",`${t}.txt`)}learnedOverrideDirectory(){return this.overrideDirectory}isArmed(){return this.storageV5!==void 0}log(t,{level:r}={level:"debug"}){if(Vm[r]<Vm[this.minLevel]||!this.shouldLog(t))return;let i=G3(t.trim());i.includes(`
|
|
82
|
+
`)&&(i=ze(i));let s=`${new Date().toISOString()} [${r.toUpperCase()}] ${i}
|
|
83
|
+
`;if(this.toStderr){this.deps.writeToStderr(s);return}this.write(s)}write(t){let r=this.getWriter(),i=Q3;this.storageV5!==void 0&&(i={sessionId:this.deps.sessionId(),fromBackend:Bx.getStore()===!0},i.fromBackend&&this.backendLinesLogged++),r.write({origin:i,content:t}),this.exiting&&r.flush()}async flush(){let t=this.backendLinesLogged;if(this.writer?.flush(),await this.pendingWrite,this.storageV5!==void 0&&this.successor)return this.successor.flush();for(let r=0;this.backendLinesLogged!==t&&r<3;r++)t=this.backendLinesLogged,this.writer?.flush(),await this.pendingWrite}dispose(t){this.redirect=t;try{this.writer?.dispose()}finally{this.redirect=null,this.writer=null}}succeed(t){this.runtimeDebugEnabled=t.runtimeDebugEnabled,this.hasFormattedOutput=t.hasFormattedOutput,this.pendingWrite=t.pendingWrite,this.unflushedChunks=t.unflushedChunks,this.exitHandlerRegistered=t.exitHandlerRegistered,t.successor=this,t.dispose(r=>{this.write(r)})}handleExit(){if(this.successor){this.successor.handleExit();return}this.exiting=!0,this.writer?.flush(),this.drainSync()}async maybeRotate(t,r,i=Y3){let s=ni()&&this.storageV5!==void 0?this.storageV5.hostFiles:void 0;if(this.writtenBytes<0)if(s){let n=await s.stat(Ip(t));this.writtenBytes=n.ok&&n.value.kind!=="absent"?n.value.size:0}else this.writtenBytes=await b3(t).then(n=>n.size).catch(()=>0);else this.writtenBytes+=r;if(!(this.writtenBytes<=i||this.rotating)){this.rotating=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;if(s){let a=Ip(t),o=Ip(n),l=await s.rename(a,o);!l.ok&&!e9(l.error)&&(await s.delete(o,{missingOk:!0}),!(await s.rename(a,o)).ok&&await s.delete(a,{missingOk:!0}))}else try{await g0(t,n)}catch(a){ad(a)||(await Dp(n).catch(()=>{}),await g0(t,n).catch(()=>Dp(t).catch(()=>{})))}this.writtenBytes=0}finally{this.rotating=!1}}}shouldLog(t){return this.deps.isTestEnvironment&&!this.toStderr&&this.filePath===null||!this.deps.isAnt&&!this.isDebugMode()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u"?!1:L3(t,this.filter)}resolveDirToFile(t){return this.resolvedLogPath=Zi(t,`${this.deps.sessionId()}.txt`),this.resolvedLogPath}async appendGroup(t,r,i,s){if(this.storageV5!==void 0&&t.arm==="v5"){await this.appendV5AndMark(this.storageV5,r,i);return}s&&await m0(ln(t.target),{recursive:!0}).catch(()=>{});let n=t;try{await Rp(t.target,i)}catch(a){if(!e0(a))throw a;if(this.storageV5===void 0)n={...t,target:this.resolveDirToFile(t.target)},await Rp(n.target,i);else{if(this.overrideDirectory=t.target,n=O0(r,t.configHome,t.target,t.target),n.arm==="v5"){await this.appendV5AndMark(this.storageV5,r,i);return}await m0(ln(n.target),{recursive:!0}).catch(()=>{});try{await Rp(n.target,i)}catch{return}}}n.rotate&&(this.storageV5!==void 0&&n.target!==this.rotationTarget&&(this.rotationTarget=n.target,this.writtenBytes=-1),await this.maybeRotate(n.target,Buffer.byteLength(i)).catch(C0)),n.pointLatest&&this.markLatestSymlink()}async appendV5AndMark(t,r,i){let s=ni(),n=s&&!this.latestMarked&&!this.latestRefused,a=await A0(t,r.sessionId,i,n);a==="refused"&&(this.latestRefused=!0,a=await A0(t,r.sessionId,i,!1),this.log("debug log: the storage backend refused markLatest; <debug folder>/latest is not pointed in this process",{level:"warn"})),a==="landed"&&(n&&!this.latestRefused?this.latestMarked=!0:s||this.markLatestSymlink())}markLatestSymlink(){this.latestMarked||(this.latestMarked=!0,this.updateLatestSymlink())}shiftUnflushedChunk(){this.unflushedChunks.shift()}drainSync(){if(this.unflushedChunks.length===0)return;if(!this.drainsSyncAtExit()){this.unflushedChunks.length=0;return}let t=[];for(let r of this.unflushedChunks.splice(0)){let i=t.at(-1);i!==void 0&&i.armed===r.armed&&(!r.armed||i.target===r.target)?i.parts.push(r):t.push({target:r.target,armed:r.armed,parts:[r]})}for(let{target:r,armed:i,parts:s}of t){let n=i?r:this.logPath(),a=s.map(o=>o.content).join("");try{Jt().mkdirSync(ln(n))}catch{}try{Jt().appendFileSync(n,a)}catch(o){if(e0(o))try{if(!i)Jt().appendFileSync(this.resolveDirToFile(n),a);else{let l=(p,h)=>{try{Jt().appendFileSync(Zi(n,`${p}.txt`),h)}catch{}},c=s[0]?.sessionId,u="";for(let p of s)p.sessionId!==c&&(l(c,u),c=p.sessionId,u=""),u+=p.content;l(c,u)}}catch{}}}}groupLines(t){let r=t[0];if(r===void 0)return[];if(this.storageV5===void 0)return[{decision:{target:this.logPath(),arm:"raw",configHome:"",rotate:!0,pointLatest:!0},origin:r.origin,lines:t}];let i=[];for(let s of t){let n=i.at(-1);n!==void 0&&n.origin.sessionId===s.origin.sessionId&&n.origin.fromBackend===s.origin.fromBackend?n.lines.push(s):i.push({decision:O0(s.origin,this.deps.configHomeDir(),this.filePath??this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR??null,this.overrideDirectory),origin:s.origin,lines:[s]})}return i}getWriter(){if(this.writer)return this.writer;let t=null,r=this.storageV5!==void 0;return this.writer=O3({writeBatch:i=>{if(this.redirect){this.redirect(i.map(s=>s.content).join(""));return}if(this.exiting){for(let s of this.groupLines(i))this.unflushedChunks.push({target:s.decision.target,sessionId:s.origin.sessionId,armed:r,content:s.lines.map(n=>n.content).join("")});this.drainSync();return}for(let s of this.groupLines(i)){let n=s.lines.map(l=>l.content).join(""),a=ln(s.decision.target),o=s.decision.arm==="raw"&&(s.origin.fromBackend||t!==a);s.decision.arm==="raw"&&(t=a),this.unflushedChunks.push({target:s.decision.target,sessionId:s.origin.sessionId,armed:r,content:n}),this.pendingWrite=this.pendingWrite.then(this.appendGroup.bind(this,s.decision,s.origin,n,o)).catch(C0).then(this.shiftUnflushedChunk.bind(this))}},sizeOf:i=>i.content.length,flushIntervalMs:1e3,maxBufferSize:100,immediateMode:this.isDebugMode()}),this.deps.registerCleanup(async()=>{this.writer?.dispose(),await this.pendingWrite}),!this.exitHandlerRegistered&&(this.exitHandlerRegistered=!0,this.deps.onExit(this.handleExit.bind(this))),this.writer}async updateLatestSymlink(){try{let t=this.logPath(),r=Zi(ln(t),"latest");await Dp(r).catch(()=>{}),await E3(t,r)}catch{}}},Xm=class{instance=void 0;init={};setInstance(t){this.instance=t}setInit(t){this.init=t}},r9=new Nt(()=>new Xm);function i9(){return sd(r9)}function s9(e,t){return new Zm({argv:process.argv,env:process.env,sessionId:()=>Uz(),configHomeDir:()=>es(),onExit:r=>{process.on("exit",r)},registerCleanup:r=>{Hx(r)},writeToStderr:r=>{N3(r)},isAnt:t?.isAnt??!1,isTestEnvironment:t?.isTestEnvironment??!1,launchIdentity:t,storageV5:e.init.storageV5!==void 0&&e.init.configHome===es()?e.init.storageV5:void 0,syncExitDrain:e.init.syncExitDrain})}function n9(){let e=i9(),t=e.instance;if(t)return t;let r=s9(e);return e.setInstance(r),r}function We(e,t={level:"debug"}){n9().log(e,t)}var LAe=(()=>{let e=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(e!==void 0){let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t}return 1/0})(),a9={[Symbol.dispose](){}};function o9(){return a9}var Ht=o9;function ze(e,t,r){let i=[];try{let a=Ft(i,Ht`JSON.stringify(${e})`,0);return JSON.stringify(e,t,r)}catch(a){var s=a,n=1}finally{Bt(i,s,n)}}var Yn=(e,t)=>{let r=[];try{let n=Ft(r,Ht`JSON.parse(${e})`,0);return typeof t>"u"?JSON.parse(e):JSON.parse(e,t)}catch(n){var i=n,s=1}finally{Bt(r,i,s)}};function yu(e,t){let r=[];try{let n=Ft(r,Ht`structuredClone(${e})`,0);return structuredClone(e,t)}catch(n){var i=n,s=1}finally{Bt(r,i,s)}}var l9="\u2192";function c9(){return process.platform==="win32"?0:Le.constants.O_NOFOLLOW|Le.constants.O_NONBLOCK}var On=process.platform==="win32"?/[\\/]+/:/\/+/;function u9(e,t){let r=o=>o.split(On).filter(Boolean),i=ct.resolve(e),s=ct.resolve(t),n=r(i),a=r(s);return ct.parse(i).root===ct.parse(s).root&&n.length<a.length&&n.every((o,l)=>o===a[l])}function Ym(e){let t="";for(let i of e.split(/([\\/]+)/)){if(i==="."||i==="..")break;t+=i}let r=t.replace(/(?<=[^\\/])[\\/]+$/,"");return r===""?e:r}function d9(e){let t=ct.join(e).replace(/(?<=[^\\/])[\\/]+$/,"");return Ci(t)&&!Mn(t)?t:Ym(e)}function p9(e){if(e.startsWith("\\\\"))return Ym(e);let t=e.replace(/^\/+/,"/"),r=QA(t);return r!==null?r:Ym(e)}var h9=process.platform==="win32"?d9:p9;function x0(e,t,r){let i=Uo(e);return t.length===0||i||t.some(s=>s==="."||s==="..")?(r!==void 0&&(t.length>0||i)&&r(ct.join(e,...t)),i?h9(e):e):ct.join(e,...t)}var Jm="\0unverified-ancestry";function k0(e,t,r=!1){if(t?.unreadableAncestry!=="unverified")return;let i=e!==void 0&&typeof e=="object"&&"errno"in e?e.errno:void 0;if(!(i==="ENOENT"||i==="ENOTDIR")&&!(i==="ENAMETOOLONG"&&!r))return Jm}function Lp(e){return rd(e)}function Pp(e,t){return t===void 0||t.every(r=>_z(e,r))}function T0(e,t){return t===void 0||t.every(r=>mz(e,r))}function f9(e){return e?.anchors!==void 0&&e.anchors.length>0?e.anchors:e?.anchor!==void 0?[e.anchor]:void 0}async function Kx(e,t=Zx){return YA(e)||ex(e)||hl(e)||nu(e)||await m9(t,e,{surfaceNetworkRaw:!0,unreadableAncestry:"unverified"})!==void 0}function Gx(e,t,r){return g9(qx(t,r),i=>i.kind==="lstat"?e.lstatSync(i.path):i.kind==="opendirNofollow"?(e.openDirNoFollowSync(i.path),"ok"):e.readlinkSync(i.path))}function m9(e,t,r){return _9(qx(t,r),async i=>i.kind==="lstat"?e.lstat(i.path):i.kind==="opendirNofollow"?(await e.openDirNoFollow(i.path),"ok"):e.readlink(i.path))}function g9(e,t){let r;for(;;){let i=e.next(r);if(i.done)return i.value;try{r=t(i.value)}catch(s){r={errno:Ye(s)}}}}async function _9(e,t){let r;for(;;){let i=e.next(r);if(i.done)return i.value;try{r=await t(i.value)}catch(s){r={errno:Ye(s)}}}}function*qx(e,t){let r=f9(t);if(Ci(e)&&!Mn(e)&&T0(e,r)||Co(e)&&Pp(e,r))return;if(Lp(e))return e;let i=ct.resolve(e),s=ct.parse(i).root,n=s,a=i.slice(s.length).split(On).filter(Boolean),o=0,l=!1,c=!1,u,p=64;for(;a.length>0&&o<p;){if(l&&Uo(a[0]))return Jm;let h=ct.join(n,a[0]);if(Co(h)&&Pp(h,r)||Lp(h))return x0(h,a.slice(1),t?.onCollapsedLanding);let f=yield{kind:"lstat",path:h};if(f===void 0||typeof f=="string"||"errno"in f){if(process.platform!=="win32"&&typeof f=="object"&&"errno"in f&&f.errno!==void 0&&f.errno!=="ENOENT"&&f.errno!=="ENOTDIR"&&f.errno!=="ENAMETOOLONG"&&typeof(yield{kind:"opendirNofollow",path:h})=="string"){c=!0,a.shift(),n=h;continue}if(t?.launchAncestry&&!c&&typeof f=="object"&&"errno"in f&&(f.errno==="EPERM"||f.errno==="EACCES")&&u9(h,t.launchAncestry)){l=!0,a.shift(),n=h;continue}return typeof f=="object"&&"errno"in f&&(f.errno==="ENOENT"||f.errno==="ENOTDIR")&&t?.onOutcome?.({kind:"absent"}),k0(f,t,o>0)}let _=f;if(c=!0,!_.isSymbolicLink()){a.shift(),n=h;continue}o++;let v=h+"\0"+a.join("\0");if((u??=new Set).has(v))return;u.add(v);let E=yield{kind:"readlink",path:h};if(typeof E!="string")return k0(E,t,o>0);let y=E;if(!ct.isAbsolute(y)){a.shift(),a=[...y.split(On).filter(Boolean),...a];continue}let m=y;if(Ci(m)&&!Mn(m)&&T0(m,r)||Co(m)&&Pp(m,r)||Lp(m))return a.shift(),x0(m,a,t?.onCollapsedLanding);if(t?.surfaceNetworkRaw===!0&&Uo(m)&&(Ci(m)||hl(m)||rd(m)||nu(m)))return a.shift(),a.length===0?m:m+ct.sep+a.join(ct.sep);a.shift();let g=ct.parse(m).root||ct.sep;n=g,c=!1,a=[...m.slice(g.length).split(On).filter(Boolean),...a]}if(a.length>0&&t?.surfaceNetworkRaw)return Jm;if(o>0&&nu(n))return n;a.length===0&&t?.onOutcome?.({kind:"resolved",path:n})}function Vx(e,t){if(Ci(t)&&!Mn(t)||Co(t)||vz(t))return{resolvedPath:t,isSymlink:!1,isCanonical:!1};let r=Gx(e,t);if(r!==void 0)return{resolvedPath:r,isSymlink:!0,isCanonical:!1};try{let i=v9(e,t);return{resolvedPath:i,isSymlink:i!==t,isCanonical:!0}}catch{return{resolvedPath:t,isSymlink:!1,isCanonical:!1}}}function v9(e,t){try{return e.realpathSync(t)}catch(r){let i=Ye(r);if(i!=="EPERM"&&i!=="EACCES")throw r;let s,n=tH(),a=null;if(n!==null)try{let o=ct.resolve(n),l=ct.resolve(e.cwd()),c=ct.parse(o).root;if(c===ct.parse(l).root){let u=o.slice(c.length).split(On).filter(Boolean),p=l.slice(c.length).split(On).filter(Boolean),h=0;for(;h<u.length&&h<p.length&&u[h]===p[h];)h++;h>0&&(a=ct.join(c,...u.slice(0,h)))}}catch{}if(Gx(e,t,{unreadableAncestry:"unverified",surfaceNetworkRaw:!0,launchAncestry:a,onOutcome:o=>{s=o}})!==void 0||s===void 0)throw r;if(s.kind==="absent")throw Object.assign(Error("ENOENT: no such file or directory"),{code:"ENOENT",syscall:"realpath",path:t});return si(s.path)}}var Zx={cwd(){return process.cwd()},existsSync(e){let t=[];try{let s=Ft(t,Ht`fs.existsSync(${e})`,0);return Le.existsSync(e)}catch(s){var r=s,i=1}finally{Bt(t,r,i)}},async stat(e){return f0(e)},async lstat(e){return Tp(e)},async openDirNoFollow(e){if(process.platform==="win32")throw Error("openDirNoFollow is a POSIX-only examination probe");await(await ac(e,Le.constants.O_DIRECTORY|Le.constants.O_NOFOLLOW)).close()},openDirNoFollowSync(e){if(process.platform==="win32")throw Error("openDirNoFollowSync is a POSIX-only examination probe");let t=Le.openSync(e,Le.constants.O_DIRECTORY|Le.constants.O_NOFOLLOW);Le.closeSync(t)},async lstatBigint(e){return Tp(e,{bigint:!0})},async statBigint(e){return f0(e,{bigint:!0})},async readdir(e){return p3(e,{withFileTypes:!0})},async unlink(e){return y3(e)},async rmdir(e){return g3(e)},async rm(e,t){return _3(e,t)},async mkdir(e,t){try{await d3(e,{recursive:!0,...t})}catch(r){if(Ye(r)!=="EEXIST")throw r}},async readFile(e,t){return h0(e,{encoding:t.encoding})},async rename(e,t){return m3(e,t)},async realpath(e){return si(await f3(e))},async readlink(e){return h3(e)},async copyFile(e,t){return c3(e,t)},async appendFile(e,t,r){if(r?.mode!==void 0)try{let i=await ac(e,"ax",r.mode);try{await i.appendFile(t)}finally{await i.close()}return}catch(i){if(Ye(i)!=="EEXIST")throw i}return o3(e,t)},async symlink(e,t,r){return v3(e,t,r)},async link(e,t){return u3(e,t)},async chmod(e,t){return l3(e,t)},statSync(e){let t=[];try{let s=Ft(t,Ht`fs.statSync(${e})`,0);return Le.statSync(e)}catch(s){var r=s,i=1}finally{Bt(t,r,i)}},lstatSync(e){let t=[];try{let s=Ft(t,Ht`fs.lstatSync(${e})`,0);return Le.lstatSync(e)}catch(s){var r=s,i=1}finally{Bt(t,r,i)}},readFileSync(e,t){let r=[];try{let n=Ft(r,Ht`fs.readFileSync(${e})`,0);return Le.readFileSync(e,{encoding:t.encoding})}catch(n){var i=n,s=1}finally{Bt(r,i,s)}},readSync(e,t){let r=[];try{let n=Ft(r,Ht`fs.readSync(${e}, ${t.length} bytes)`,0),a;try{a=Le.openSync(e,"r");let o=[],l=0;for(;l<t.length;){let c=Buffer.allocUnsafe(Math.min(65536,t.length-l)),u=Le.readSync(a,c,0,c.length,l);if(u===0)break;o.push(c.subarray(0,u)),l+=u}return{buffer:Buffer.concat(o,l),bytesRead:l}}finally{a!==void 0&&Le.closeSync(a)}}catch(n){var i=n,s=1}finally{Bt(r,i,s)}},appendFileSync(e,t,r){let i=[];try{let a=Ft(i,Ht`fs.appendFileSync(${e}, ${t.length} chars)`,0);if(r?.mode!==void 0)try{let o=Le.openSync(e,"ax",r.mode);try{Le.appendFileSync(o,t)}finally{Le.closeSync(o)}return}catch(o){if(Ye(o)!=="EEXIST")throw o}Le.appendFileSync(e,t)}catch(a){var s=a,n=1}finally{Bt(i,s,n)}},unlinkSync(e){let t=[];try{let s=Ft(t,Ht`fs.unlinkSync(${e})`,0);Le.unlinkSync(e)}catch(s){var r=s,i=1}finally{Bt(t,r,i)}},renameSync(e,t){let r=[];try{let n=Ft(r,Ht`fs.renameSync(${e} ${l9} ${t})`,0);Le.renameSync(e,t)}catch(n){var i=n,s=1}finally{Bt(r,i,s)}},readlinkSync(e){let t=[];try{let s=Ft(t,Ht`fs.readlinkSync(${e})`,0);return Le.readlinkSync(e)}catch(s){var r=s,i=1}finally{Bt(t,r,i)}},realpathSync(e){let t=[];try{let s=Ft(t,Ht`fs.realpathSync(${e})`,0);return si(Le.realpathSync(e))}catch(s){var r=s,i=1}finally{Bt(t,r,i)}},mkdirSync(e,t){let r=[];try{let n=Ft(r,Ht`fs.mkdirSync(${e})`,0),a={recursive:!0};t?.mode!==void 0&&(a.mode=t.mode);try{Le.mkdirSync(e,a)}catch(o){if(Ye(o)!=="EEXIST")throw o}}catch(n){var i=n,s=1}finally{Bt(r,i,s)}},readdirSync(e){let t=[];try{let s=Ft(t,Ht`fs.readdirSync(${e})`,0);return Le.readdirSync(e,{withFileTypes:!0})}catch(s){var r=s,i=1}finally{Bt(t,r,i)}},rmSync(e,t){let r=[];try{let n=Ft(r,Ht`fs.rmSync(${e})`,0);Le.rmSync(e,t)}catch(n){var i=n,s=1}finally{Bt(r,i,s)}},createWriteStream(e){return Le.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return h0(e);let r=await ac(e,process.platform==="win32"?"r":Le.constants.O_RDONLY|(Le.constants.O_NONBLOCK??0)|(Le.constants.O_NOCTTY??0));try{return(await r.stat()).isFile()?await y9(r,t,"file"):Buffer.alloc(0)}finally{await r.close()}},async readFileFdGated(e,t){try{let r=c9();if(r===0&&!(await Tp(e)).isFile())return null;let i=await ac(e,Le.constants.O_RDONLY|r);try{let s=await i.stat();if(!s.isFile()||s.size>t)return null;let n=Number(s.size),a=Buffer.allocUnsafe(n),o=0;for(;o<n;){let{bytesRead:l}=await i.read(a,o,n-o,o);if(l===0)break;o+=l}return{content:(o<n?a.subarray(0,o):a).toString("utf8"),stats:s}}finally{await i.close()}}catch{return null}}};function Jt(){return Zx}async function y9(e,t,r){let i=r!==void 0?r==="file":(await e.stat()).isFile(),s=[],n=0;for(;n<t;){let a=Buffer.allocUnsafe(Math.min(65536,t-n)),{bytesRead:o}=await e.read(a,0,a.length,i?n:null);if(o===0)break;s.push(a.subarray(0,o)),n+=o}return Buffer.concat(s,n)}var E9="finished",UAe=`" ${E9}`,w9="channel",$Ae=`<${w9} source="`,Xi=Xx.homedir(),sv=Xx.tmpdir(),{env:gn}=Qm,S9=e=>{let t=ht.join(Xi,"Library");return{data:ht.join(t,"Application Support",e),config:ht.join(t,"Preferences",e),cache:ht.join(t,"Caches",e),log:ht.join(t,"Logs",e),temp:ht.join(sv,e)}},C9=e=>{let t=gn.APPDATA||ht.join(Xi,"AppData","Roaming"),r=gn.LOCALAPPDATA||ht.join(Xi,"AppData","Local");return{data:ht.join(r,e,"Data"),config:ht.join(t,e,"Config"),cache:ht.join(r,e,"Cache"),log:ht.join(r,e,"Log"),temp:ht.join(sv,e)}},O9=e=>{let t=ht.basename(Xi);return{data:ht.join(gn.XDG_DATA_HOME||ht.join(Xi,".local","share"),e),config:ht.join(gn.XDG_CONFIG_HOME||ht.join(Xi,".config"),e),cache:ht.join(gn.XDG_CACHE_HOME||ht.join(Xi,".cache"),e),log:ht.join(gn.XDG_STATE_HOME||ht.join(Xi,".local","state"),e),temp:ht.join(sv,t,e)}};function A9(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),Qm.platform==="darwin"?S9(e):Qm.platform==="win32"?C9(e):O9(e)}function x9(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t}var HAe=A9("claude-cli");function k9(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||st(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function T9(){return k9()==="essential-traffic"}var R9=100,eg=class{recentErrors=[];queue=[];sink=null;hardFailMode=void 0;remember(t){this.recentErrors.length>=R9&&this.recentErrors.shift(),this.recentErrors.push(t)}dispatch(t){if(this.sink===null){this.queue.push(t);return}switch(t.type){case"error":this.sink.logError(t.error);break;case"mcpError":this.sink.logMCPError(t.serverName,t.error);break;case"mcpDebug":this.sink.logMCPDebug(t.serverName,t.message);break}}attachSink(t){if(this.sink!==null)return;this.sink=t;let r=this.queue;this.queue=[];for(let i of r)this.dispatch(i)}isHardFailMode(){return this.hardFailMode??=process.argv.includes("--hard-fail"),this.hardFailMode}reset(){this.recentErrors=[],this.queue=[],this.sink=null,this.hardFailMode=void 0}},D0=new eg;function Yx(e){let t=fl(e);try{if(st(process.env.CLAUDE_CODE_USE_BEDROCK)||st(process.env.CLAUDE_CODE_USE_VERTEX)||st(process.env.CLAUDE_CODE_USE_FOUNDRY)||st(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||st(process.env.CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD)||st(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||T9())return;let r={error:t.stack||t.message,timestamp:new Date().toISOString()};D0.remember(r),D0.dispatch({type:"error",error:t})}catch{}}function D9(){try{return Jt().readFileSync("/proc/version",{encoding:"utf8"}).toLowerCase()}catch{return}}function I9(e){return e.includes("microsoft")||e.includes("wsl")}var tg=class{sources;primedProcVersion;fallbackProcVersion;fallbackProcVersionRead=!1;platform;wslVersion=null;macOSMajorVersion=null;linuxDistroInfo;constructor(t){this.sources=t}kernelString(){return this.primedProcVersion!==void 0?this.primedProcVersion:(this.fallbackProcVersionRead||(this.fallbackProcVersion=this.sources.readProcVersionSync(),this.fallbackProcVersionRead=!0),this.fallbackProcVersion)}getPlatform(){if(this.platform!==void 0)return this.platform;try{if(this.sources.platform==="darwin")this.platform="macos";else if(this.sources.platform==="win32")this.platform="windows";else if(this.sources.platform==="linux")if(this.sources.env.WSL_DISTRO_NAME||this.sources.env.WSL_INTEROP)this.platform="wsl";else{let t=this.kernelString();this.platform=t!==void 0&&I9(t)?"wsl":"linux"}else this.platform="unknown"}catch(t){Yx(t),this.platform="unknown"}return this.platform}getWslVersion(){if(this.wslVersion!==null)return this.wslVersion;if(this.sources.platform!=="linux"){this.wslVersion=void 0;return}let t=this.kernelString();if(t===void 0){this.wslVersion=void 0;return}let r=t.match(/wsl(\d+)/);return r&&r[1]?this.wslVersion=r[1]:t.includes("microsoft")?this.wslVersion="1":this.wslVersion=void 0,this.wslVersion}getMacOSMajorVersion(){if(this.macOSMajorVersion!==null)return this.macOSMajorVersion;if(this.sources.platform!=="darwin"){this.macOSMajorVersion=void 0;return}let t=this.sources.osRelease().match(/^(\d+)\./);return this.macOSMajorVersion=t&&t[1]?parseInt(t[1],10)-9:void 0,this.macOSMajorVersion}getLinuxDistroInfo(){return this.linuxDistroInfo??=this.readLinuxDistroInfo()}async readLinuxDistroInfo(){if(this.sources.platform!=="linux")return;let t={linuxKernel:this.sources.osRelease()};try{let r=await this.sources.readOsRelease();for(let i of r.split(`
|
|
84
|
+
`)){let s=i.match(/^(ID|VERSION_ID)=(.*)$/);if(s&&s[1]&&s[2]){let n=s[2].replace(/^"|"$/g,"");s[1]==="ID"?t.linuxDistroId=n:t.linuxDistroVersion=n}}}catch{}return t}async prime(){if(!(this.primedProcVersion!==void 0||this.sources.platform!=="linux")){try{let t=await this.sources.readProcVersion();this.primedProcVersion=t.toLowerCase()}catch(t){We(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}this.platform=void 0,this.wslVersion=null}}},L9;function P9(){return L9??=new tg({platform:process.platform,env:process.env,readProcVersionSync:D9,readProcVersion:()=>R0("/proc/version",{encoding:"utf8"}),osRelease:b9,readOsRelease:()=>R0("/etc/os-release","utf8")})}function nv(){return P9().getPlatform()}function N9(e){return!e.isDirectory()&&!e.isFile()&&!e.isSymbolicLink()&&!e.isFIFO()&&!e.isSocket()&&!e.isBlockDevice()&&!e.isCharacterDevice()}function U9(e){let t=process.cwd();return e.filter(r=>!Cz(r,t))}function Jx(e){return $9(e,Bun.which(e))}function $9(e,t){return!t||process.platform!=="win32"||M9(e)?t:U9([t])[0]??null}var j9=async e=>Jx(e),F9=Jx;function B9(){return process.platform!=="linux"?!1:Jt().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function H9(){if(process.platform==="linux")try{return Jt().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function z9(){return process.platform!=="linux"?!1:Jt().existsSync("/.dockerenv")}function W9(){return Jt().existsSync(Xo(es(),".config.json"))?Xo(es(),".config.json"):K9()}function K9(){let e=`.claude${Yq()}.json`;return Xo(process.env.CLAUDE_CONFIG_DIR||Zq(),e)}async function G9(){try{let{externalHttp:e}=await Promise.resolve().then(()=>(fU(),gA));return await e.head("http://1.1.1.1",{signal:AbortSignal.timeout(1e3)}),!0}catch{return!1}}async function q9(){return null}async function An(e){try{return!!await j9(e)}catch{return!1}}async function V9(){let e=[];return await An("npm")&&e.push("npm"),await An("yarn")&&e.push("yarn"),await An("pnpm")&&e.push("pnpm"),e}async function Z9(){let e=[];return await An("bun")&&e.push("bun"),await An("deno")&&e.push("deno"),await An("node")&&e.push("node"),e}var I0=["git","node","npm","npx","yarn","pnpm","bun","deno","tsc","python","python3","py","pip","uv","poetry","ruby","gem","bundle","rake","dotnet","msbuild","nuget","cl","nmake","cmake","ninja","make","gcc","g++","clang","cargo","rustc","go","java","javac","mvn","gradle","docker"],X9=1e3;async function Y9(e){try{return/appinstaller/i.test(await Vq(e))}catch{return!1}}async function J9(e){return e===""||yz(e)||YA(e)?!1:!await Kx(Mx(e))}async function Q9(e,t){let r=nv()==="windows",i=new Set(e),s=r?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],n=ld((process.env.PATH??"").split(Xq).map(a=>a.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(n.map(async a=>{if(!await J9(a))return;let o;try{o=await Gq(a,{withFileTypes:!0})}catch{return}let l=r&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(a);for(let c of o){if(c.isDirectory())continue;let u=c.name;if(r){let p=u.toLowerCase(),h=p.lastIndexOf(".");if(h<=0||!s.includes(p.slice(h)))continue;u=p.slice(0,h)}if(!(!i.has(u)||t.has(u))){if(r){if(l&&await Y9(Xo(a,c.name)))continue}else{let p=Xo(a,c.name);if((c.isSymbolicLink()||N9(c))&&await Kx(Mx(p)))continue;try{await Bm(p,Kq.X_OK)}catch{continue}}t.add(u)}}}))}async function e6(){let e=new Set;try{await Nn(Q9(I0,e),X9,"build tool PATH scan timed out")}catch{}return I0.filter(t=>e.has(t))}function t6(e){try{if(!e.isWslEnvironment())return!1;let t=F9("npm");return t===null?!1:t.startsWith("/mnt/c/")}catch{return!1}}function r6(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var i6=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function s6(e){let t=e.toLowerCase();return t.includes("windsurf")||t.includes("devin.app")||t.includes("devin desktop")||t.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(t)}function n6(){if(process.env.CURSOR_TRACE_ID)return"cursor";let e=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(e.includes("cursor"))return"cursor";if(s6(e))return"windsurf";if(e.includes("antigravity"))return"antigravity";let t=process.env.__CFBundleIdentifier?.toLowerCase();if(t?.includes("vscodium"))return"codium";if(t?.includes("windsurf")||t?.includes("devin"))return"windsurf";if(t?.includes("com.google.android.studio"))return"androidstudio";if(t){for(let r of i6)if(t.includes(r))return r}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")return"pycharm";if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM)return/^devin([ -]desktop)?$/i.test(process.env.TERM_PROGRAM)?"windsurf":process.env.TERM_PROGRAM;if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(Qx())return"ssh-session";if(process.env.TERM){let r=process.env.TERM;return r.includes("alacritty")?"alacritty":r.includes("rxvt")?"rxvt":r.includes("termite")?"termite":process.env.TERM}return process.stdout.isTTY?null:"non-interactive"}var rg=class{sources;globalClaudeFile;internetAccess;internetProbeOutcome;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(t){this.sources=t}getGlobalClaudeFile(){return this.globalClaudeFile??=W9()}seedGlobalClaudeFile(t){return this.globalClaudeFile===void 0?(this.globalClaudeFile=t,"seeded"):this.globalClaudeFile===t?"unchanged":"conflict"}hasInternetAccess(){return this.internetAccess??=G9().then(t=>(this.internetProbeOutcome=t,t))}getInternetProbeOutcome(){return this.internetProbeOutcome}getPackageManagers(){return this.packageManagers??=V9()}getRuntimes(){return this.runtimes??=Z9()}getDetectedBuildTools(){return this.detectedBuildTools??=e6()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=t6(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=l6(this)}async prime(){if(this.primedWslInteropExists!==void 0||process.platform!=="linux")return;let[t,r,i]=await Promise.all([Bm("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),qq("/sys/hypervisor/uuid",{encoding:"utf8"}).then(s=>s.trim().toLowerCase(),()=>{}),Bm("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=t,this.primedHypervisorUuid=r??"",this.primedDockerenvExists=i,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}},a6=new Nt(()=>new rg({wslInteropExistsSync:B9,readHypervisorUuidSync:H9,dockerenvExistsSync:z9}));function cn(){return a6.of(ev().host)}function o6(){return cn().detectDeploymentEnvironment()}function l6(e){return st(process.env.CODESPACES)?"codespaces":process.env.GITPOD_WORKSPACE_ID?"gitpod":st(process.env.CODER)||process.env.CODER_WORKSPACE_NAME?"coder":st(process.env.DEVPOD)||process.env.DEVPOD_WORKSPACE_UID?"devpod":process.env.DAYTONA_WS_ID?"daytona":st(process.env.GOOGLE_CLOUD_WORKSTATIONS)?"gcp-cloud-workstations":process.env.C9_PID||process.env.C9_USER?"aws-cloud9":process.env.REPL_ID||process.env.REPL_SLUG?"replit":process.env.PROJECT_DOMAIN?"glitch":st(process.env.VERCEL)?"vercel":process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME?"railway":st(process.env.RENDER)?"render":st(process.env.NETLIFY)?"netlify":process.env.DYNO?"heroku":process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID?"fly.io":st(process.env.CF_PAGES)?"cloudflare-pages":process.env.DENO_DEPLOYMENT_ID?"deno-deploy":process.env.AWS_LAMBDA_FUNCTION_NAME?"aws-lambda":process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE"?"aws-fargate":process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2"?"aws-ecs":e.hypervisorUuid().startsWith("ec2")?"aws-ec2":process.env.K_SERVICE?"gcp-cloud-run":process.env.GOOGLE_CLOUD_PROJECT?"gcp":process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU?"azure-app-service":process.env.AZURE_FUNCTIONS_ENVIRONMENT?"azure-functions":process.env.APP_URL?.includes("ondigitalocean.app")?"digitalocean-app-platform":process.env.SPACE_CREATOR_USER_ID?"huggingface-spaces":st(process.env.GITHUB_ACTIONS)?"github-actions":st(process.env.GITLAB_CI)?"gitlab-ci":process.env.CIRCLECI?"circleci":process.env.BUILDKITE?"buildkite":st(!1)?"ci":process.env.KUBERNETES_SERVICE_HOST?"kubernetes":e.isDockerenvPresent()?"docker":kc.platform==="darwin"?"unknown-darwin":kc.platform==="linux"?"unknown-linux":kc.platform==="win32"?"unknown-win32":"unknown"}function Qx(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var kc={hasInternetAccess(){return cn().hasInternetAccess()},probeInternalNetworkAccess:q9,isCI:st(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:n6(),isSSH:Qx,getPackageManagers(){return cn().getPackageManagers()},getRuntimes(){return cn().getRuntimes()},isRunningWithBun:tv,isWslEnvironment(){return cn().isWslEnvironment()},isNpmFromWindowsPath(){return cn().isNpmFromWindowsPath()},isConductor:r6,detectDeploymentEnvironment:o6},ek={};fr(ek,{CLAUDE_AX_PREPARK_MS:()=>d6,CLAUDE_AX_SCREEN_READER:()=>c6,CLAUDE_AX_STARTUP_QUIET_MS:()=>u6,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>p6,CLAUDE_CODE_ACCESSIBILITY:()=>v5,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>y5,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>f6,CLAUDE_CODE_AMBER_ASTROLABE:()=>GV,CLAUDE_CODE_ARTIFACT_ASSETS:()=>H5,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>T5,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>R5,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>I5,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>L5,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>D5,CLAUDE_CODE_ARTIFACT_DB:()=>P5,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>N5,CLAUDE_CODE_ARTIFACT_DELETE:()=>M5,CLAUDE_CODE_ARTIFACT_HOT:()=>W5,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>z5,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>$5,CLAUDE_CODE_ARTIFACT_PIN:()=>j5,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>B5,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>U5,CLAUDE_CODE_ARTIFACT_ROOM:()=>F5,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>K5,CLAUDE_CODE_ARTIFACT_TYPES:()=>G5,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>q5,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>V5,CLAUDE_CODE_ARTIFACT_VERIFY:()=>Z5,CLAUDE_CODE_ATTRIBUTION_ANNOUNCEMENT:()=>b5,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>X5,CLAUDE_CODE_BASALT_COVE:()=>b6,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>x5,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>Y5,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>k6,CLAUDE_CODE_BISON_CAIRN:()=>qV,CLAUDE_CODE_BREEZY_HORIZON:()=>E6,CLAUDE_CODE_BUBBLEWRAP:()=>J5,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>e8,CLAUDE_CODE_CCR_LAZY_SUBAGENT_HYDRATE:()=>Q5,CLAUDE_CODE_CHILD_SESSION:()=>t8,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>r8,CLAUDE_CODE_COLD_COMPACT:()=>i8,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>T6,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>I6,CLAUDE_CODE_COZY_TEAPOT:()=>y6,CLAUDE_CODE_DAPPER_LAGOON:()=>w6,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>N6,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>L6,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>M6,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>U6,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>$6,CLAUDE_CODE_DISABLE_ARTIFACT:()=>j6,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>F6,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>B6,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>H6,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>z6,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>K6,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>G6,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>q6,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>V6,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>Z6,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>X6,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>Y6,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>J6,CLAUDE_CODE_DISABLE_CRON:()=>Q6,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>eV,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>tV,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>rV,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>iV,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>sV,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>nV,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>W6,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>aV,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>oV,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>lV,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>cV,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>uV,CLAUDE_CODE_DISABLE_MOUSE:()=>hV,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>fV,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>mV,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>gV,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>_V,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>vV,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>yV,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>bV,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>EV,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>dV,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>wV,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>SV,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>CV,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>xV,CLAUDE_CODE_DISABLE_THINKING:()=>TV,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>RV,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>DV,CLAUDE_CODE_EDITOR_CODELIVERY:()=>R6,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>LV,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>PV,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>NV,CLAUDE_CODE_ENABLE_CFC:()=>MV,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>UV,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>$V,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>jV,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>FV,CLAUDE_CODE_ENABLE_FUNCTION_HOOKS:()=>tX,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>BV,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>HV,CLAUDE_CODE_ENABLE_NARRATION:()=>r5,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>e5,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>t5,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>i5,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>s5,CLAUDE_CODE_ENABLE_TASKS:()=>n5,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>a5,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>o5,CLAUDE_CODE_ENABLE_XAA:()=>l5,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>W8,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>s8,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>n8,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>zV,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>p8,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>u8,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>d8,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>h8,CLAUDE_CODE_FORK_SUBAGENT:()=>a8,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>f8,CLAUDE_CODE_FORWARD_USER_INTENT:()=>D6,CLAUDE_CODE_GAULT_KESTREL:()=>ZV,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>WV,CLAUDE_CODE_GENTLE_PARASOL:()=>_6,CLAUDE_CODE_GLOB_HIDDEN:()=>o8,CLAUDE_CODE_GLOB_NO_IGNORE:()=>l8,CLAUDE_CODE_GORSE_PLOVER:()=>XV,CLAUDE_CODE_HARBOR_KITE:()=>c5,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>d5,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>u5,CLAUDE_CODE_HIDE_CWD:()=>c8,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>eX,CLAUDE_CODE_HOVER_REST:()=>KV,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>O6,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>m8,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>g8,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>_8,CLAUDE_CODE_INTRO_FRAME:()=>E5,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>QV,CLAUDE_CODE_KB_COHESION_FIXES:()=>_5,CLAUDE_CODE_LANTERN_PRISM:()=>p5,CLAUDE_CODE_LARCH_CISTERN:()=>VV,CLAUDE_CODE_LUMINOUS_WHISTLE:()=>C6,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>pV,CLAUDE_CODE_MODEL_CAPABILITIES:()=>w5,CLAUDE_CODE_NANKEEN_KESTREL:()=>P6,CLAUDE_CODE_NATIVE_CURSOR:()=>v8,CLAUDE_CODE_NEW_INIT:()=>y8,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>E8,CLAUDE_CODE_NO_FLICKER:()=>b8,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>w8,CLAUDE_CODE_PARCHMENT_FERN:()=>YV,CLAUDE_CODE_PEWTER_OWL:()=>rZ,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>iZ,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>S8,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>Y8,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>rX,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>X8,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>Q8,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>J8,CLAUDE_CODE_POLISHED_DEWDROP:()=>S6,CLAUDE_CODE_POLL_EVENTS:()=>C8,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>eZ,CLAUDE_CODE_PROACTIVE:()=>O8,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>zZ,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>tZ,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>OV,CLAUDE_CODE_REPORT_FINDINGS:()=>AV,CLAUDE_CODE_SEND_FEEDBACK:()=>kV,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>C5,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>A5,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>O5,CLAUDE_CODE_SKILL_PROPOSALS:()=>A8,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>x8,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>k8,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>T8,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>R8,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>D8,CLAUDE_CODE_STELLAR_DRIFT:()=>A6,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>I8,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>WZ,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>L8,CLAUDE_CODE_SYNC_PLUGINS:()=>N8,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>P8,CLAUDE_CODE_SYNC_SKILLS:()=>M8,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>U8,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>k5,CLAUDE_CODE_THISTLE_GREBE:()=>m6,CLAUDE_CODE_THRIFTY_SONIC:()=>v6,CLAUDE_CODE_TOASTY_THIMBLE:()=>g6,CLAUDE_CODE_TODO_REMINDER_MODE:()=>h5,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>f5,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>g5,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>m5,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>$8,CLAUDE_CODE_TURN_UPDATES:()=>S5,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>j8,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>F8,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>B8,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>H8,CLAUDE_CODE_WALNUT_SPIRE:()=>z8,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>G8,CLAUDE_CODE_WEBFETCH_DEADLINE_MS:()=>q8,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>V8,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>Z8,CLAUDE_CODE_WEB_FETCH_AGENT:()=>K8,CLAUDE_CODE_WILLOW_TERN:()=>JV,CLAUDE_CODE_WISE_COMET:()=>x6,CLAUDE_CODE_WORKFLOWS:()=>IV,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>uZ,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>lZ,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>cZ,CLAUDE_DISABLE_ADOPT:()=>sZ,CLAUDE_IMPORT_CONVERSATIONS:()=>nZ,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>aZ,CLAUDE_WORKFLOW_NAME_ONLY:()=>oZ,DISABLE_AUTOUPDATER:()=>pZ,DISABLE_AUTO_COMPACT:()=>dZ,DISABLE_BRIEF_MODE_STOP_HOOK:()=>hZ,DISABLE_BUG_COMMAND:()=>fZ,DISABLE_COST_WARNINGS:()=>mZ,DISABLE_DOCTOR_COMMAND:()=>gZ,DISABLE_ERROR_REPORTING:()=>_Z,DISABLE_EXTRA_USAGE_COMMAND:()=>vZ,DISABLE_FEEDBACK_COMMAND:()=>yZ,DISABLE_GROWTHBOOK:()=>bZ,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>EZ,DISABLE_INTERLEAVED_THINKING:()=>wZ,DISABLE_LOGIN_COMMAND:()=>SZ,DISABLE_LOGOUT_COMMAND:()=>CZ,DISABLE_PROMPT_CACHING:()=>OZ,DISABLE_PROMPT_CACHING_FABLE:()=>TZ,DISABLE_PROMPT_CACHING_HAIKU:()=>AZ,DISABLE_PROMPT_CACHING_MYTHOS:()=>RZ,DISABLE_PROMPT_CACHING_OPUS:()=>xZ,DISABLE_PROMPT_CACHING_SONNET:()=>kZ,DISABLE_TELEMETRY:()=>DZ,DISABLE_UPDATES:()=>IZ,DISABLE_UPGRADE_COMMAND:()=>LZ,EMBEDDED_SEARCH_TOOLS:()=>JZ,ENABLE_BETA_TRACING_DETAILED:()=>PZ,ENABLE_CLAUDEAI_MCP_SERVERS:()=>NZ,ENABLE_ENHANCED_TELEMETRY_BETA:()=>MZ,ENABLE_LOCKLESS_UPDATES:()=>UZ,ENABLE_LSP_TOOL:()=>$Z,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>jZ,ENABLE_PID_BASED_VERSION_LOCKING:()=>FZ,ENABLE_PROMPT_CACHING_1H:()=>BZ,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>HZ,ENABLE_SESSION_BACKGROUNDING:()=>KZ,ENABLE_SESSION_PERSISTENCE:()=>GZ,ENABLE_TOOL_SEARCH:()=>qZ,FORCE_AUTOUPDATE_PLUGINS:()=>VZ,FORCE_CODE_TERMINAL:()=>ZZ,FORCE_PROMPT_CACHING_5M:()=>XZ,FORCE_VCR:()=>YZ,INK_SCREEN_READER:()=>h6,USE_API_CONTEXT_MANAGEMENT:()=>QZ});var bu=["5m","1h"],c6=d.triBool(),u6=d.int({min:0}),d6=d.int({min:0}),p6=d.triBool(),h6=d.bool(),f6=d.bool(),m6=d.str(),g6=d.str(),_6=d.str(),v6=d.triBool(),y6=d.enum(["strict","relaxed"]),b6=d.bool(),E6=d.str(),w6=d.triBool(),S6=d.enum(["drop","block","off"]),C6=d.triBool(),O6=d.triBool(),A6=d.triBool(),x6=d.triBool(),k6=d.bool(),T6=d.bool(),R6=d.bool(),D6=d.bool(),I6=d.bool(),L6=d.bool(),P6=d.bool(),N6=d.bool(),M6=d.bool(),U6=d.bool(),$6=d.bool(),j6=d.bool(),F6=d.bool(),B6=d.bool(),H6=d.bool(),z6=d.bool(),W6=d.bool(),K6=d.bool(),G6=d.bool(),q6=d.bool(),V6=d.bool(),Z6=d.bool(),X6=d.bool(),Y6=d.bool(),J6=d.bool(),Q6=d.bool(),eV=d.bool(),tV=d.bool(),rV=d.bool(),iV=d.bool(),sV=d.triBool(),nV=d.bool(),aV=d.bool(),oV=d.bool(),lV=d.bool(),cV=d.bool(),uV=d.bool(),dV=d.bool(),pV=d.enum(["corroborate","immediate","never"]),hV=d.triBool(),fV=d.triBool(),mV=d.bool(),gV=d.bool(),_V=d.bool(),vV=d.bool(),yV=d.bool(),bV=d.bool(),EV=d.bool(),wV=d.bool(),SV=d.bool(),CV=d.bool(),OV=d.triBool(),AV=d.bool(),xV=d.bool(),kV=d.triBool(),TV=d.bool(),RV=d.bool(),DV=d.bool(),IV=d.triBool(),LV=d.bool(),PV=d.bool(),NV=d.bool(),MV=d.triBool(),UV=d.bool(),$V=d.bool(),jV=d.bool(),FV=d.triBool(),BV=d.bool(),HV=d.bool(),zV=d.bool(),WV=d.bool(),KV=d.triBool(),GV=d.bool(),qV=d.triBool(),VV=d.bool(),ZV=d.bool(),XV=d.bool(),YV=d.bool(),JV=d.bool(),QV=d.int({min:1,digitsOnly:!0}),e5=d.triBool(),t5=d.bool(),r5=d.triBool(),i5=d.triBool(),s5=d.bool(),n5=d.triBool(),a5=d.bool(),o5=d.bool(),l5=d.bool(),c5=d.str(),u5=d.bool(),d5=d.bool(),p5=d.bool(),h5=d.enum(["baseline","off"]),f5=d.str(),m5=d.int(),g5=d.triBool(),_5=d.bool(),v5=d.bool(),y5=d.triBool(),b5=d.triBool(),E5=d.triBool(),w5=d.str(),S5=d.triBool(),C5=d.triBool(),O5=d.int({min:1}),A5=d.str(),x5=d.triBool(),k5=d.triBool(),T5=d.triBool(),R5=d.triBool(),D5=d.triBool(),I5=d.triBool(),L5=d.triBool(),P5=d.triBool(),N5=d.triBool(),M5=d.triBool(),U5=d.triBool(),$5=d.triBool(),j5=d.triBool(),F5=d.triBool(),B5=d.triBool(),H5=d.triBool(),z5=d.triBool(),W5=d.triBool(),K5=d.triBool(),G5=d.triBool(),q5=d.triBool(),V5=d.triBool(),Z5=d.triBool(),X5=d.triBool(),Y5=d.bool(),J5=d.bool(),Q5=d.triBool(),e8=d.bool(),t8=d.bool(),r8=d.bool(),i8=d.bool(),s8=d.bool(),n8=d.bool(),a8=d.triBool(),o8=d.bool(),l8=d.bool(),c8=d.bool(),u8=d.bool(),d8=d.bool(),p8=d.bool(),h8=d.str(),f8=d.bool(),m8=d.bool(),g8=d.bool(),_8=d.bool(),v8=d.bool(),y8=d.bool(),b8=d.triBool(),E8=d.triBool(),w8=d.bool(),S8=d.bool(),C8=d.bool(),O8=d.bool(),A8=d.bool(),x8=d.bool(),k8=d.str(),T8=d.bool(),R8=d.bool(),D8=d.bool(),I8=d.bool(),L8=d.bool(),P8=d.bool(),N8=d.bool(),M8=d.bool(),U8=d.bool(),$8=d.triBool(),j8=d.bool(),F8=d.bool(),B8=d.bool(),H8=d.triBool(),z8=d.bool(),W8=d.bool(),K8=d.triBool(),G8=d.int({min:1,digitsOnly:!0}),q8=d.int({min:0,digitsOnly:!0}),V8=d.bool(),Z8=d.bool(),X8=d.bool(),Y8=d.bool(),J8=d.bool(),Q8=d.bool(),eZ=d.bool(),tZ=d.bool(),rZ=d.triBool(),iZ=d.triBool(),sZ=d.bool(),nZ=d.bool(),aZ=d.bool(),oZ=d.bool(),lZ=d.int({min:1}),cZ=d.int({min:1}),uZ=d.int({min:0}),dZ=d.bool(),pZ=d.bool(),hZ=d.bool(),fZ=d.bool(),mZ=d.bool(),gZ=d.bool(),_Z=d.bool(),vZ=d.bool(),yZ=d.bool(),bZ=d.bool(),EZ=d.bool(),wZ=d.bool(),SZ=d.bool(),CZ=d.bool(),OZ=d.bool(),AZ=d.bool(),xZ=d.bool(),kZ=d.bool(),TZ=d.bool(),RZ=d.bool(),DZ=d.bool(),IZ=d.bool(),LZ=d.bool(),PZ=d.bool(),NZ=d.triBool(),MZ=d.bool(),UZ=d.bool(),$Z=d.bool(),jZ=d.triBool(),FZ=d.triBool(),BZ=d.bool(),HZ=d.bool(),zZ=d.enum(bu),WZ=d.enum(bu),KZ=d.bool(),GZ=d.bool(),qZ=d.str(),VZ=d.bool(),ZZ=d.bool(),XZ=d.bool(),YZ=d.bool(),JZ=d.bool(),QZ=d.bool(),eX=d.bool(),tX=d.triBool(),rX=d.triBool(),tk={};fr(tk,{ALACRITTY_LOG:()=>DY,ANDROID_HOME:()=>cY,ANDROID_SDK_ROOT:()=>uY,APPDATA:()=>LX,APP_URL:()=>aJ,AWS_CA_BUNDLE:()=>XX,AWS_EXECUTION_ENV:()=>V7,AWS_LAMBDA_FUNCTION_NAME:()=>q7,AZURE_FUNCTIONS_ENVIRONMENT:()=>nJ,BAT_THEME:()=>dJ,BROWSER:()=>bX,BUILDKITE:()=>k7,BUN_CHROME_PATH:()=>uJ,BUN_INSTALL:()=>cJ,CARGO_HTTP_CAINFO:()=>JX,CF_PAGES:()=>K7,CIRCLECI:()=>x7,CLOUDSDK_CONFIG:()=>rJ,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>VX,CODER:()=>L7,CODER_WORKSPACE_NAME:()=>P7,CODESPACES:()=>I7,COLORFGBG:()=>fY,COLORTERM:()=>hY,COMSPEC:()=>dX,CONTAINER_SANDBOX_MOUNT_POINT:()=>DX,CURL_CA_BUNDLE:()=>qX,CURSOR_TRACE_ID:()=>ZY,ComSpec:()=>hX,ConEmuANSI:()=>HY,ConEmuPID:()=>zY,ConEmuTask:()=>WY,DAYTONA_WS_ID:()=>U7,DEMO_VERSION:()=>_J,DENO_CERT:()=>YX,DENO_DEPLOYMENT_ID:()=>G7,DISPLAY:()=>EX,DO_NOT_TRACK:()=>mY,DYNO:()=>W7,EDITOR:()=>vX,FORCE_COLOR:()=>pY,GCLOUD_PROJECT:()=>Y7,GCM_INTERACTIVE:()=>i7,GH_CONFIG_DIR:()=>a7,GH_ENTERPRISE_TOKEN:()=>d7,GH_HOST:()=>u7,GH_TOKEN:()=>c7,GITHUB_ACTIONS:()=>g7,GITHUB_ACTION_INPUTS:()=>_7,GITHUB_ACTION_PATH:()=>v7,GITHUB_ACTOR:()=>y7,GITHUB_ACTOR_ID:()=>b7,GITHUB_ENTERPRISE_TOKEN:()=>h7,GITHUB_ENV:()=>f7,GITHUB_EVENT_NAME:()=>E7,GITHUB_EVENT_PATH:()=>w7,GITHUB_REPOSITORY:()=>S7,GITHUB_REPOSITORY_ID:()=>C7,GITHUB_REPOSITORY_OWNER:()=>O7,GITHUB_REPOSITORY_OWNER_ID:()=>A7,GITHUB_TOKEN:()=>p7,GITHUB_WORKSPACE:()=>m7,GITLAB_CI:()=>T7,GITPOD_WORKSPACE_ID:()=>N7,GIT_ASKPASS:()=>r7,GIT_CONFIG_COUNT:()=>s7,GIT_CONFIG_GLOBAL:()=>n7,GIT_CONFIG_NOSYSTEM:()=>sY,GIT_SSH_COMMAND:()=>e7,GIT_SSL_CAINFO:()=>iY,GIT_SSL_CAPATH:()=>nY,GIT_TERMINAL_PROMPT:()=>t7,GNOME_TERMINAL_SERVICE:()=>TY,GOOGLE_APPLICATION_CREDENTIALS:()=>J7,GOOGLE_CLOUD_PROJECT:()=>X7,GOOGLE_CLOUD_WORKSTATIONS:()=>M7,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>eY,HEX_CACERTS_PATH:()=>rY,HISTFILE:()=>BX,HOME:()=>iX,HTTPLIB2_CA_CERTS:()=>ZX,HUB_CONFIG:()=>o7,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>KY,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>GY,IS_DEMO:()=>gJ,IS_SANDBOX:()=>mJ,ITERM_SESSION_ID:()=>OY,JAVA_HOME:()=>oY,JAVA_TOOL_OPTIONS:()=>lY,KITTY_WINDOW_ID:()=>AY,KONSOLE_VERSION:()=>xY,KUBERNETES_SERVICE_HOST:()=>lJ,K_SERVICE:()=>Z7,LANG:()=>SX,LC_ALL:()=>CX,LC_TERMINAL:()=>yY,LC_TIME:()=>OX,LOCALAPPDATA:()=>PX,MSYSTEM:()=>BY,NETLIFY:()=>z7,NIX_SSL_CERT_FILE:()=>tY,NODE_EXTRA_CA_CERTS:()=>zX,NODE_OPTIONS:()=>HX,NO_COLOR:()=>dY,NoDefaultCurrentDirectoryInExePath:()=>_X,P4PORT:()=>pJ,PATH:()=>sX,PATHEXT:()=>gX,PIP_CERT:()=>QX,PLAYWRIGHT_BROWSERS_PATH:()=>hJ,PREFIX:()=>aX,PROJECT_DOMAIN:()=>F7,PWD:()=>nX,ProgramFiles:()=>mX,RENDER:()=>H7,REPL_ID:()=>$7,REPL_SLUG:()=>j7,REQUESTS_CA_BUNDLE:()=>GX,RUNNER_ENVIRONMENT:()=>D7,RUNNER_OS:()=>R7,SAFEUSER:()=>NX,SESSIONNAME:()=>LY,SHELL:()=>uX,SPACE_CREATOR_USER_ID:()=>oJ,SSH_AUTH_SOCK:()=>QY,SSH_CLIENT:()=>XY,SSH_CONNECTION:()=>YY,SSH_TTY:()=>JY,SSL_CERT_DIR:()=>KX,SSL_CERT_FILE:()=>WX,STY:()=>PY,SUDO_GID:()=>kX,SUDO_UID:()=>xX,SUDO_USER:()=>TX,SYSTEMROOT:()=>pX,SystemRoot:()=>fX,TEMP:()=>cX,TERM:()=>gY,TERMINAL:()=>bY,TERMINAL_EMULATOR:()=>EY,TERMINATOR_UUID:()=>wY,TERMUX_VERSION:()=>SY,TERM_PROGRAM:()=>_Y,TERM_PROGRAM_VERSION:()=>vY,TILIX_ID:()=>CY,TMP:()=>lX,TMPDIR:()=>oX,TMUX:()=>NY,TMUX_PANE:()=>MY,TRACEPARENT:()=>vJ,TRACESTATE:()=>yJ,USER:()=>AX,USERNAME:()=>RX,USERPROFILE:()=>IX,USE_BUILTIN_RIPGREP:()=>fJ,UV_THREADPOOL_SIZE:()=>aY,VERCEL:()=>B7,VISUAL:()=>yX,VSCODE_GIT_ASKPASS_MAIN:()=>VY,VTE_VERSION:()=>RY,WAYLAND_DISPLAY:()=>wX,WEBSITE_SITE_NAME:()=>iJ,WEBSITE_SKU:()=>sJ,WSL_DISTRO_NAME:()=>jY,WSL_INTEROP:()=>FY,WT_SESSION:()=>IY,XDG_CACHE_HOME:()=>jX,XDG_CONFIG_HOME:()=>UX,XDG_DATA_HOME:()=>$X,XDG_RUNTIME_DIR:()=>MX,XDG_STATE_HOME:()=>FX,XTERM_VERSION:()=>kY,ZDOTDIR:()=>l7,ZED_TERM:()=>$Y,ZELLIJ:()=>UY,__CFBundleIdentifier:()=>qY,gcloud_project:()=>Q7,google_application_credentials:()=>tJ,google_cloud_project:()=>eJ});var iX=d.str(),sX=d.str(),nX=d.str(),aX=d.str(),oX=d.str(),lX=d.str(),cX=d.str(),uX=d.str(),dX=d.str(),pX=d.str(),hX=d.str(),fX=d.str(),mX=d.str(),gX=d.str(),_X=d.str(),vX=d.str(),yX=d.str(),bX=d.str(),EX=d.str(),wX=d.str(),SX=d.str(),CX=d.str(),OX=d.str(),AX=d.str(),xX=d.int({min:0,digitsOnly:!0}),kX=d.int({min:0,digitsOnly:!0}),TX=d.str(),RX=d.str(),DX=d.str(),IX=d.str(),LX=d.str(),PX=d.str(),NX=d.str(),MX=d.str(),UX=d.str(),$X=d.str(),jX=d.str(),FX=d.str(),BX=d.str(),HX=d.str(),zX=d.str(),WX=d.str(),KX=d.str(),GX=d.str(),qX=d.str(),VX=d.str(),ZX=d.str(),XX=d.str(),YX=d.str(),JX=d.str(),QX=d.str(),eY=d.str(),tY=d.str(),rY=d.str(),iY=d.str(),sY=d.str(),nY=d.str(),aY=d.str(),oY=d.str(),lY=d.str(),cY=d.str(),uY=d.str(),dY=d.rawStr(),pY=d.rawStr(),hY=d.str(),fY=d.str(),mY=d.str(),gY=d.str(),_Y=d.str(),vY=d.str(),yY=d.str(),bY=d.str(),EY=d.str(),wY=d.str(),SY=d.str(),CY=d.str(),OY=d.str(),AY=d.str(),xY=d.str(),kY=d.str(),TY=d.str(),RY=d.str(),DY=d.str(),IY=d.str(),LY=d.str(),PY=d.str(),NY=d.str(),MY=d.str(),UY=d.str(),$Y=d.str(),jY=d.str(),FY=d.str(),BY=d.str(),HY=d.str(),zY=d.str(),WY=d.str(),KY=d.str(),GY=d.str(),qY=d.str(),VY=d.str(),ZY=d.rawStr(),XY=d.str(),YY=d.str(),JY=d.str(),QY=d.str(),e7=d.str(),t7=d.str(),r7=d.str(),i7=d.str(),s7=d.str(),n7=d.str(),a7=d.str(),o7=d.str(),l7=d.str(),c7=d.str(),u7=d.str(),d7=d.str(),p7=d.str(),h7=d.str(),f7=d.str(),m7=d.str(),g7=d.str(),_7=d.rawStr(),v7=d.str(),y7=d.str(),b7=d.str(),E7=d.str(),w7=d.str(),S7=d.str(),C7=d.str(),O7=d.str(),A7=d.str(),x7=d.str(),k7=d.str(),T7=d.str(),R7=d.str(),D7=d.str(),I7=d.str(),L7=d.str(),P7=d.str(),N7=d.str(),M7=d.str(),U7=d.str(),$7=d.str(),j7=d.str(),F7=d.str(),B7=d.str(),H7=d.str(),z7=d.str(),W7=d.str(),K7=d.str(),G7=d.str(),q7=d.str(),V7=d.str(),Z7=d.str(),X7=d.str(),Y7=d.str(),J7=d.str(),Q7=d.str(),eJ=d.str(),tJ=d.str(),rJ=d.str(),iJ=d.str(),sJ=d.str(),nJ=d.str(),aJ=d.str(),oJ=d.str(),lJ=d.str(),cJ=d.str(),uJ=d.str(),dJ=d.str(),pJ=d.str(),hJ=d.str(),fJ=d.str(),mJ=d.str(),gJ=d.str(),_J=d.str(),vJ=d.str(),yJ=d.str(),rk={};fr(rk,{AI_AGENT:()=>pte,ALLOW_ANT_COMPUTER_USE_MCP:()=>hte,ANTHROPIC_CONFIG_DIR:()=>bJ,BASH_MAX_OUTPUT_LENGTH:()=>Ire,CCR_SESSION_PROFILE:()=>fte,CLAUBBIT:()=>mte,CLAUDECODE:()=>gte,CLAUDE_AFK_COUNTDOWN_MS:()=>Lre,CLAUDE_AFK_TIMEOUT_MS:()=>Pre,CLAUDE_AFTER_LAST_COMPACT:()=>EJ,CLAUDE_AGENTS_SELECT:()=>wJ,CLAUDE_AGENT_SDK_CLIENT_APP:()=>SJ,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>_te,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>vte,CLAUDE_AGENT_SDK_VERSION:()=>CJ,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>Nre,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>OJ,CLAUDE_AUTO_BACKGROUND_TASKS:()=>yte,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>bte,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>AJ,CLAUDE_BG_BACKEND:()=>xJ,CLAUDE_BG_CLAIM_AUTH:()=>kJ,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>TJ,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>RJ,CLAUDE_BG_ISOLATION:()=>DJ,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>IJ,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>LJ,CLAUDE_BG_PTY_AUTH:()=>PJ,CLAUDE_BG_RENDEZVOUS_SOCK:()=>NJ,CLAUDE_BG_RV_AUTH:()=>MJ,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>UJ,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>$J,CLAUDE_BG_SOURCE:()=>jJ,CLAUDE_BG_STARTUP_WEDGE_MS:()=>Mre,CLAUDE_BG_TCC_DISCLAIMED:()=>FJ,CLAUDE_BRIDGE_BASE_URL:()=>BJ,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>HJ,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>zJ,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>Ete,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>wte,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>WJ,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>KJ,CLAUDE_BRIDGE_REATTACH_SEQ:()=>Ure,CLAUDE_BRIDGE_REATTACH_SESSION:()=>GJ,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>qJ,CLAUDE_CHROME_PAIRED_DEVICE_ID:()=>VJ,CLAUDE_CHROME_PERMISSION_MODE:()=>ZJ,CLAUDE_CLIENT_PRESENCE_FILE:()=>XJ,CLAUDE_CODE_ACTION:()=>YJ,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>JJ,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>Ste,CLAUDE_CODE_ADOPT_UNDERIVABLE_PARKED_PERMISSION:()=>cre,CLAUDE_CODE_AGENT:()=>QJ,CLAUDE_CODE_ARTIFACT:()=>eQ,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>rQ,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>iQ,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>sQ,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>tQ,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>nQ,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>aQ,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>oQ,CLAUDE_CODE_ATTRIBUTION_STATUS_TIMEOUT_MS:()=>lQ,CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS:()=>$re,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>cQ,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>Cte,CLAUDE_CODE_BASE_REF:()=>uQ,CLAUDE_CODE_BASE_REFS:()=>dQ,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>pQ,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>hQ,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>fQ,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>mQ,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>gQ,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>_Q,CLAUDE_CODE_BRIEF:()=>Ote,CLAUDE_CODE_BRIEF_UPLOAD:()=>Ate,CLAUDE_CODE_CCR_SURFACE:()=>ire,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>vQ,CLAUDE_CODE_CONTAINER_ID:()=>yQ,CLAUDE_CODE_COORDINATOR_WORKER_CHECKIN_SECONDS:()=>jre,CLAUDE_CODE_DAEMON_COLD_START:()=>xte,CLAUDE_CODE_DECSTBM:()=>bQ,CLAUDE_CODE_DESKTOP_APP_VERSION:()=>EQ,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>wQ,CLAUDE_CODE_DIR_SYNC_DISABLE_ANCHORING:()=>SQ,CLAUDE_CODE_DIR_SYNC_ENGINE:()=>xQ,CLAUDE_CODE_DIR_SYNC_FFWD:()=>kQ,CLAUDE_CODE_DIR_SYNC_GIT:()=>AQ,CLAUDE_CODE_DIR_SYNC_STREAM:()=>TQ,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>kte,CLAUDE_CODE_DISABLE_DIR_SYNC:()=>OQ,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>RQ,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>DQ,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>IQ,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>LQ,CLAUDE_CODE_DONT_INHERIT_ENV:()=>Tte,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>PQ,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>Rte,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>Dte,CLAUDE_CODE_ENTRYPOINT:()=>NQ,CLAUDE_CODE_ENVIRONMENT_KIND:()=>MQ,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>UQ,CLAUDE_CODE_EVAL_CONFINED:()=>Jte,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>Ite,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>Fre,CLAUDE_CODE_FORCE_BRIDGE:()=>Lte,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>Pte,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>Nte,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>Mte,CLAUDE_CODE_FORCE_TIP_ID:()=>$Q,CLAUDE_CODE_GIT_BASH_PATH:()=>jQ,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>Bre,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>Hre,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>FQ,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>pre,CLAUDE_CODE_HOLD_UNANSWERED_PARKED_PERMISSION:()=>lre,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>BQ,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>HQ,CLAUDE_CODE_HOST_PLATFORM:()=>zQ,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>WQ,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>zre,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>Wre,CLAUDE_CODE_IS_COWORK:()=>Ute,CLAUDE_CODE_LEGACY_BUNDLE:()=>CQ,CLAUDE_CODE_LOOP_KEEPALIVE:()=>$te,CLAUDE_CODE_LOOP_PERSISTENT:()=>jte,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>KQ,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>Kre,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>Gre,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>qre,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>GQ,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>Iie,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>Sre,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>Die,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>Fte,CLAUDE_CODE_MOCK_TRIAL:()=>Bte,CLAUDE_CODE_OVERRIDE_DATE:()=>qQ,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>are,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>dre,CLAUDE_CODE_PERFORCE_MODE:()=>VQ,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>Vre,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>Zre,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>ZQ,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>XQ,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>Xre,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>YQ,CLAUDE_CODE_POWERUP_ONBOARDING:()=>JQ,CLAUDE_CODE_PROJECT_DIR_NAME:()=>QQ,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>Yre,CLAUDE_CODE_QUESTION_EXTENDED:()=>tee,CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS:()=>ree,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>eee,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>iee,CLAUDE_CODE_REMOTE:()=>Hte,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>see,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>zte,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>nee,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>aee,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>Wte,CLAUDE_CODE_REMOTE_SESSION_ID:()=>oee,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>lee,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>cee,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>Jre,CLAUDE_CODE_REPL:()=>Kte,CLAUDE_CODE_REPO_CHECKOUTS:()=>uee,CLAUDE_CODE_RESTRICTED:()=>Gte,CLAUDE_CODE_RESUME_FROM_SESSION:()=>dee,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>qte,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>Zte,CLAUDE_CODE_RESUME_PROMPT:()=>pee,CLAUDE_CODE_RESUME_REASON:()=>Xte,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>Vte,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>Qre,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>eie,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>ure,CLAUDE_CODE_RETIRE_UNANSWERED_PARKED_PERMISSION:()=>ore,CLAUDE_CODE_SAFE_MODE:()=>Yte,CLAUDE_CODE_SANDBOXED:()=>Qte,CLAUDE_CODE_SCRIPT_CAPS:()=>tie,CLAUDE_CODE_SCROLL_SPEED:()=>hee,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>rie,CLAUDE_CODE_SESSION_ID:()=>fee,CLAUDE_CODE_SESSION_KIND:()=>mee,CLAUDE_CODE_SESSION_NAME:()=>gee,CLAUDE_CODE_SESSION_ORIGIN:()=>_ee,CLAUDE_CODE_SHELL:()=>vee,CLAUDE_CODE_SHELL_PREFIX:()=>yee,CLAUDE_CODE_SIMPLE:()=>ere,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>bee,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>Eee,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>iie,CLAUDE_CODE_SSE_PORT:()=>sie,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>wee,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>nie,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>tre,CLAUDE_CODE_SUPERVISED:()=>rre,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>sre,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>nre,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>oie,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>lie,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>aie,CLAUDE_CODE_SYNC_REUSE_WITHIN_MS:()=>cie,CLAUDE_CODE_SYNC_SESSION_REFS:()=>hre,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>uie,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>die,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>fre,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>See,CLAUDE_CODE_TAGS:()=>Cee,CLAUDE_CODE_TASK_LIST_ID:()=>Aee,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>pie,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>Oee,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>mre,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>xee,CLAUDE_CODE_TEST_FORCE_DENY:()=>gre,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>_re,CLAUDE_CODE_TEST_NO_PWSH:()=>vre,CLAUDE_CODE_TMPDIR:()=>kee,CLAUDE_CODE_TMUX_PREFIX:()=>Tee,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>yre,CLAUDE_CODE_TMUX_SESSION:()=>Ree,CLAUDE_CODE_TMUX_TRUECOLOR:()=>bre,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>Ere,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>wre,CLAUDE_CODE_TRIGGER_ID:()=>Dee,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>Cre,CLAUDE_CODE_TUI_TRIAL:()=>Ore,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>Iee,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>Lee,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>hie,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>Are,CLAUDE_CODE_WORKER_EPOCH:()=>fie,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>Pee,CLAUDE_CONFIG_DIR:()=>Nee,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>Mee,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>Uee,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>$ee,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>jee,CLAUDE_ENV_FILE:()=>Fee,CLAUDE_FORCE_DISPLAY_SURVEY:()=>xre,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>Bee,CLAUDE_INTERNAL_FC_OVERRIDES:()=>Hee,CLAUDE_JOB_DIR:()=>zee,CLAUDE_MEMORY_STORES:()=>Wee,CLAUDE_PROJECT_UUID:()=>Kee,CLAUDE_PTY_HEARTBEAT_MS:()=>mie,CLAUDE_PTY_HOST_EXEC:()=>Gee,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>gie,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>qee,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>Vee,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>Zee,CLAUDE_REPL_VARIANT:()=>Xee,CLAUDE_RUNNER_ACTIVITY_FD:()=>_ie,CLAUDE_RUNNER_FETCH_DEPTH:()=>Yee,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>Jee,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>vie,CLAUDE_SNIP:()=>Qee,CLAUDE_SSH_LOCAL_BINARY:()=>ete,CLAUDE_SSH_VERSION:()=>tte,CLAUDE_STAGE_FILE_ROOT:()=>rte,CLAUDE_TMPDIR:()=>ite,LOCAL_BRIDGE:()=>kre,MCP_CONNECTION_NONBLOCKING:()=>Tre,MCP_CONNECT_TIMEOUT_MS:()=>yie,MCP_DISCOVERY_CACHE:()=>bie,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>Eie,MCP_DISCOVERY_CACHE_STRIKES:()=>wie,MCP_DISCOVERY_CACHE_TTL_S:()=>Sie,MCP_OAUTH_CALLBACK_PORT:()=>Cie,MCP_OAUTH_CLIENT_METADATA_URL:()=>ste,MCP_PROTOCOL_NEGOTIATION:()=>Oie,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>Aie,MCP_SDK_GENERATION:()=>kie,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>xie,MCP_TIMEOUT:()=>Tie,MCP_TOOL_TIMEOUT:()=>Rie,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>nte,SDK_NATIVE_BIN:()=>ate,SESSION_INGRESS_URL:()=>ote,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>Lie,SYSTEM_REMINDER_MEMORY_CONTEXT:()=>lte,TASK_MAX_OUTPUT_LENGTH:()=>Pie,TEST_ENABLE_SESSION_PERSISTENCE:()=>Rre,ULTRAPLAN_PROMPT_FILE:()=>cte,VCR_RECORD:()=>Dre,VITALS_EMITTER_BIN:()=>ute,VOICE_STREAM_BASE_URL:()=>dte});var bJ=d.str(),EJ=d.str(),wJ=d.str(),SJ=d.str(),CJ=d.str(),OJ=d.str(),AJ=d.str(),xJ=d.str(),kJ=d.str(),TJ=d.str(),RJ=d.str(),DJ=d.str(),IJ=d.str(),LJ=d.bool(),PJ=d.str(),NJ=d.str(),MJ=d.str(),UJ=d.str(),$J=d.str(),jJ=d.str(),FJ=d.str(),BJ=d.str(),HJ=d.str(),zJ=d.str(),WJ=d.str(),KJ=d.str(),GJ=d.str(),qJ=d.str(),VJ=d.str(),ZJ=d.str(),XJ=d.str(),YJ=d.str(),JJ=d.str(),QJ=d.str(),eQ=d.str(),tQ=d.str(),rQ=d.str(),iQ=d.str(),sQ=d.str(),nQ=d.str(),aQ=d.str(),oQ=d.str(),lQ=d.int({min:0}),cQ=d.str(),uQ=d.str(),dQ=d.str(),pQ=d.str(),hQ=d.enum(["1","spent"]),fQ=d.str(),mQ=d.str(),gQ=d.str(),_Q=d.str(),vQ=d.str(),yQ=d.str(),bQ=d.str(),EQ=d.str(),wQ=d.str(),SQ=d.bool(),CQ=d.bool(),OQ=d.bool(),AQ=d.bool(),xQ=d.str(),kQ=d.str(),TQ=d.str(),RQ=d.bool(),DQ=d.bool(),IQ=d.bool(),LQ=d.bool(),PQ=d.str(),NQ=d.str(),MQ=d.str(),UQ=d.str(),$Q=d.str(),jQ=d.str(),FQ=d.str(),BQ=d.int({min:0}),HQ=d.int({min:0}),zQ=d.str(),WQ=d.str(),KQ=d.str(),GQ=d.str(),qQ=d.str(),VQ=d.str(),ZQ=d.str(),XQ=d.str(),YQ=d.str(),JQ=d.str(),QQ=d.str(),eee=d.str(),tee=d.bool(),ree=d.bool(),iee=d.str(),see=d.str(),nee=d.str(),aee=d.str(),oee=d.str(),lee=d.str(),cee=d.str(),uee=d.str(),dee=d.str(),pee=d.str(),hee=d.str(),fee=d.str(),mee=d.str(),gee=d.str(),_ee=d.enum(["claude_ai_chat"]),vee=d.str(),yee=d.str(),bee=d.str(),Eee=d.str(),wee=d.str(),See=d.str(),Cee=d.str(),Oee=d.str(),Aee=d.str(),xee=d.str(),kee=d.str(),Tee=d.str(),Ree=d.str(),Dee=d.str(),Iee=d.str(),Lee=d.str(),Pee=d.str(),Nee=d.str(),Mee=d.str(),Uee=d.str(),$ee=d.str(),jee=d.str(),Fee=d.str(),Bee=d.str(),Hee=d.str(),zee=d.str(),Wee=d.str(),Kee=d.str(),Gee=d.str(),qee=d.str(),Vee=d.str(),Zee=d.str(),Xee=d.str(),Yee=d.str(),Jee=d.str(),Qee=d.str(),ete=d.str(),tte=d.str(),rte=d.str(),ite=d.str(),ste=d.str(),nte=d.str(),ate=d.str(),ote=d.str(),lte=d.bool(),cte=d.str(),ute=d.str(),dte=d.str(),pte=d.bool(),hte=d.bool(),fte=d.bool(),mte=d.bool(),gte=d.bool(),_te=d.bool(),vte=d.bool(),yte=d.bool(),bte=d.bool(),Ete=d.bool(),wte=d.bool(),Ste=d.bool(),Cte=d.bool(),Ote=d.bool(),Ate=d.bool(),xte=d.bool(),kte=d.bool(),Tte=d.bool(),Rte=d.bool(),Dte=d.bool(),Ite=d.bool(),Lte=d.bool(),Pte=d.bool(),Nte=d.bool(),Mte=d.bool(),Ute=d.bool(),$te=d.triBool(),jte=d.bool(),Fte=d.str(),Bte=d.bool(),Hte=d.bool(),zte=d.bool(),Wte=d.bool(),Kte=d.triBool(),Gte=d.bool(),qte=d.bool(),Vte=d.str(),Zte=d.str(),Xte=d.str(),Yte=d.bool(),Jte=d.bool(),Qte=d.bool(),ere=d.bool(),tre=d.triBool(),rre=d.bool(),ire=d.str(),sre=d.bool(),nre=d.int({min:1}),are=d.int({min:0}),ore=d.bool(),lre=d.bool(),cre=d.bool(),ure=d.bool(),dre=d.bool(),pre=d.bool(),hre=d.bool(),fre=d.str(),mre=d.bool(),gre=d.rawStr(),_re=d.str(),vre=d.str(),yre=d.bool(),bre=d.rawStr(),Ere=d.str(),wre=d.str(),Sre=d.str(),Cre=d.str(),Ore=d.str(),Are=d.bool(),xre=d.bool(),kre=d.bool(),Tre=d.triBool(),Rre=d.bool(),Dre=d.bool(),Ire=d.int(),Lre=d.int(),Pre=d.int(),Nre=d.int({min:1,max:2147483647,digitsOnly:!0}),Mre=d.int(),Ure=d.int(),$re=d.int({min:1,max:86400,digitsOnly:!0}),jre=d.int({min:1,max:86400,digitsOnly:!0}),Fre=d.int(),Bre=d.int({min:1}),Hre=d.int({min:0,max:10080,digitsOnly:!0}),zre=d.int(),Wre=d.int(),Kre=d.int({min:1,digitsOnly:!0}),Gre=d.int({min:1,digitsOnly:!0}),qre=d.int({min:1,digitsOnly:!0}),Vre=d.int(),Zre=d.int(),Xre=d.int(),Yre=d.int(),Jre=d.int(),Qre=d.int(),eie=d.int(),tie=d.int(),rie=d.int({min:1}),iie=d.int(),sie=d.int(),nie=d.int(),aie=d.int({min:1}),oie=d.int({min:1}),lie=d.int({min:0}),cie=d.int({min:0,max:864e5}),uie=d.int(),die=d.int(),pie=d.int({min:1e3,max:6e4}),hie=d.int(),fie=d.int(),mie=d.int({min:1}),gie=d.int({min:1}),_ie=d.int({min:3}),vie=d.int({min:1}),yie=d.int(),bie=d.triBool(),Eie=d.int({min:1}),wie=d.int({min:1}),Sie=d.int({min:1}),Cie=d.int({min:1}),Oie=d.str(),Aie=d.int({min:1}),xie=d.int({min:1}),kie=d.str(),Tie=d.int(),Rie=d.int({min:1}),Die=d.int(),Iie=d.int(),Lie=d.int({min:1}),Pie=d.int(),ik={};fr(ik,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>Jie,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>ese,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>Qie,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>$ie,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>Fie,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>jie,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>qie,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>Zie,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>Vie,ANTHROPIC_DEFAULT_MODEL:()=>Mie,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>Bie,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>zie,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>Hie,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>Wie,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>Gie,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>Kie,ANTHROPIC_MODEL:()=>Nie,ANTHROPIC_SMALL_FAST_MODEL:()=>Uie,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>Yie,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>Xie,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>pse,CLAUDE_CODE_AUTO_MODE_MODEL:()=>ise,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>sse,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>gse,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>cse,CLAUDE_CODE_DISABLE_FAST_MODE:()=>hse,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>use,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>_se,CLAUDE_CODE_EFFORT_LEVEL:()=>dse,CLAUDE_CODE_MODEL_CATALOG:()=>vse,CLAUDE_CODE_MODEL_CATALOG_URL:()=>yse,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>lse,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>fse,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>mse,CLAUDE_CODE_SUBAGENT_MODEL:()=>tse,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>rse,CLAUDE_CONTEXT_COLLAPSE:()=>ase,CLAUDE_CONTEXT_COLLAPSE_MODEL:()=>nse,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>ose});var Nie=d.str(),Mie=d.str(),Uie=d.str(),$ie=d.str(),jie=d.str(),Fie=d.str(),Bie=d.str(),Hie=d.str(),zie=d.str(),Wie=d.str(),Kie=d.str(),Gie=d.str(),qie=d.str(),Vie=d.str(),Zie=d.str(),Xie=d.str(),Yie=d.str(),Jie=d.str(),Qie=d.str(),ese=d.str(),tse=d.str(),rse=d.bool(),ise=d.str(),sse=d.str(),nse=d.str(),ase=d.bool(),ose=d.str(),lse=d.bool(),cse=d.bool(),use=d.bool(),dse=d.str(),pse=d.bool(),hse=d.bool(),fse=d.bool(),mse=d.bool(),gse=d.bool(),_se=d.bool(),vse=d.str(),yse=d.str(),sk={};fr(sk,{ALL_PROXY:()=>Ase,ANTHROPIC_BETAS:()=>Lse,ANTHROPIC_CUSTOM_HEADERS:()=>Pse,API_FORCE_IDLE_TIMEOUT:()=>Vse,API_TIMEOUT_MS:()=>qse,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>tne,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>Use,CLAUDE_CODE_CERT_STORE:()=>Ise,CLAUDE_CODE_CLIENT_CERT:()=>kse,CLAUDE_CODE_CLIENT_KEY:()=>Tse,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>Rse,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>Dse,CLAUDE_CODE_EAGER_FLUSH:()=>nne,CLAUDE_CODE_EXTRA_BODY:()=>Nse,CLAUDE_CODE_EXTRA_METADATA:()=>Mse,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>Bse,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>ane,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>Qse,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>Jse,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>Fse,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>jse,CLAUDE_CODE_MAX_RETRIES:()=>$se,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>Hse,CLAUDE_CODE_MAX_TURNS:()=>zse,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>cne,CLAUDE_CODE_RETRY_WATCHDOG:()=>sne,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>lne,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>Zse,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>Xse,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>Yse,CLAUDE_MOCK_HEADERLESS_429:()=>one,CLAUDE_SLOW_FIRST_BYTE_MS:()=>ine,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>rne,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>ene,HTTPS_PROXY:()=>Ese,HTTP_PROXY:()=>bse,MAX_MCP_OUTPUT_TOKENS:()=>Gse,MAX_STRUCTURED_OUTPUT_RETRIES:()=>Kse,MAX_THINKING_TOKENS:()=>Wse,NO_PROXY:()=>wse,all_proxy:()=>xse,http_proxy:()=>Sse,https_proxy:()=>Cse,no_proxy:()=>Ose});var bse=d.str(),Ese=d.str(),wse=d.str(),Sse=d.str(),Cse=d.str(),Ose=d.str(),Ase=d.str(),xse=d.str(),kse=d.str(),Tse=d.str(),Rse=d.str(),Dse=d.bool(),Ise=d.str(),Lse=d.str(),Pse=d.str(),Nse=d.str(),Mse=d.str(),Use=d.str(),$se=d.int(),jse=d.int(),Fse=d.int(),Bse=d.int(),Hse=d.int({min:1}),zse=d.str(),Wse=d.int(),Kse=d.int(),Gse=d.int(),qse=d.int(),Vse=d.int(),Zse=d.triBool(),Xse=d.bool(),Yse=d.triBool(),Jse=d.triBool(),Qse=d.triBool(),ene=d.int({min:1}),tne=d.int({min:1}),rne=d.int({min:1}),ine=d.int({min:1}),sne=d.bool(),nne=d.bool(),ane=d.bool(),one=d.bool(),lne=d.int(),cne=d.int({min:0}),nk={};fr(nk,{AGENT_PROXY_URL:()=>fae,ANTHROPIC_AWS_BASE_URL:()=>Cne,ANTHROPIC_AWS_WORKSPACE_ID:()=>One,ANTHROPIC_BASE_URL:()=>_ne,ANTHROPIC_BEDROCK_BASE_URL:()=>bne,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>Sne,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>Ene,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>wne,ANTHROPIC_FOUNDRY_BASE_URL:()=>Lne,ANTHROPIC_FOUNDRY_RESOURCE:()=>Pne,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>Tne,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>xne,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>Ane,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>kne,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>Kne,ANTHROPIC_UNIX_SOCKET:()=>Gne,ANTHROPIC_VERTEX_BASE_URL:()=>Rne,ANTHROPIC_VERTEX_PROJECT_ID:()=>Dne,AWS_ACCESS_KEY_ID:()=>Fne,AWS_CONFIG_FILE:()=>$ne,AWS_DEFAULT_REGION:()=>Mne,AWS_ENDPOINT_URL:()=>zne,AWS_ENDPOINT_URL_STS:()=>Wne,AWS_PROFILE:()=>Une,AWS_REGION:()=>Nne,AWS_SECRET_ACCESS_KEY:()=>Bne,AWS_SESSION_TOKEN:()=>Hne,AWS_SHARED_CREDENTIALS_FILE:()=>jne,CCR_AGENT_PROXY_ENABLED:()=>rae,CCR_AGENT_PROXY_FRAME_HOSTS:()=>uae,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>aae,CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY:()=>cae,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>oae,CCR_AGENT_PROXY_RELAY_MODE:()=>nae,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>lae,CCR_ENABLE_BUNDLE:()=>dae,CCR_FORCE_BUNDLE:()=>pae,CCR_ON_BRANCH_DEFAULT_GUARD:()=>hae,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>sae,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>iae,CLAUDE_CODE_API_BASE_URL:()=>yne,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>Qne,CLAUDE_CODE_GB_BASE_URL:()=>eae,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>tae,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>qne,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>Zne,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>Vne,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>mae,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>fne,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>mne,CLAUDE_CODE_USE_BEDROCK:()=>dne,CLAUDE_CODE_USE_FOUNDRY:()=>hne,CLAUDE_CODE_USE_GATEWAY:()=>Xne,CLAUDE_CODE_USE_MANTLE:()=>gne,CLAUDE_CODE_USE_VERTEX:()=>pne,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>Yne,CLAUDE_GATEWAY_LOG_LEVEL:()=>Jne,CLOUD_ML_REGION:()=>Ine,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>vne});var une=["us","eu","apac","jp","au","global"],dne=d.bool(),pne=d.bool(),hne=d.bool(),fne=d.bool(),mne=d.bool(),gne=d.bool(),_ne=d.str(),vne=d.bool(),yne=d.str(),bne=d.str(),Ene=d.enum(une),wne=d.str(),Sne=d.str(),Cne=d.str(),One=d.str(),Ane=d.str(),xne=d.str(),kne=d.str(),Tne=d.str(),Rne=d.str(),Dne=d.str(),Ine=d.str(),Lne=d.str(),Pne=d.str(),Nne=d.str(),Mne=d.str(),Une=d.str(),$ne=d.str(),jne=d.str(),Fne=d.str(),Bne=d.str(),Hne=d.str(),zne=d.str(),Wne=d.str(),Kne=d.str(),Gne=d.str(),qne=d.bool(),Vne=d.bool(),Zne=d.bool(),Xne=d.bool(),Yne=d.bool(),Jne=d.str(),Qne=d.bool(),eae=d.str(),tae=d.int(),rae=d.bool(),iae=d.bool(),sae=d.bool(),nae=d.str(),aae=d.str(),oae=d.bool(),lae=d.bool(),cae=d.bool(),uae=d.str(),dae=d.bool(),pae=d.bool(),hae=d.enum(["enforce","observe","off"]),fae=d.str(),mae=d.bool(),gae={...Rx,...nk,...ik,...ek,...sk,...tk,...Nx,...rk};function av(e,t){let r=Object.create(t);for(let[i,s]of Object.entries(e)){let n=r,a;Object.defineProperty(r,i,{get:()=>{let o=process.env[i];return o!==n&&(a=s.parse(o),n=o),a},enumerable:!0,configurable:!0})}return Object.defineProperties(r,{set:{value:(i,s)=>{process.env[i]=OK(s)}},unset:{value:i=>{delete process.env[i]}}}),r}var ml=av(gae,kc),_ae={},KAe=av(_ae,null),vae={},GAe=av(vae,null),ig=class{debugFilePath=void 0;initPromise=null;logStem=null},yae=new Nt(()=>new ig);function ak(){return yae.of(ev().host)}function ok(e){if(e.initPromise)return e.initPromise;if(!ml.DEBUG_CLAUDE_AGENT_SDK)return e.debugFilePath=null,e.initPromise=Promise.resolve(),e.initPromise;let t=r0(es(),"debug");return e.logStem=`sdk-${h4()}`,e.debugFilePath=r0(t,`${e.logStem}.txt`),process.stderr.write(`SDK debug logs: ${e.debugFilePath}
|
|
85
|
+
`),e.initPromise=Tx().mkdir(t).catch(()=>{}),e.initPromise}function bae(e){return e.logStem===null?null:{namespace:"log",sessionId:e.logStem,channel:"debug"}}function Eae(){let e=ak();return ok(e),e.debugFilePath??null}function vr(e,t){let r=ak();if(r.debugFilePath===null)return;let i=`${new Date().toISOString()} ${e}
|
|
86
|
+
`;ok(r).then(()=>{if(t!==void 0){let s=bae(r);s!==null&&t.append(s,[{data:i}]).catch(()=>{});return}r.debugFilePath&&Tx().append(r.debugFilePath,i).catch(()=>{})})}function wae(e){let t=e.trim();return t.startsWith("{")&&t.endsWith("}")}function Sae(e,t){let r={...e};if(!t)return r;let i=t.enabled===!0&&t.failIfUnavailable===void 0?{...t,failIfUnavailable:!0}:t,s=r.settings;if(s&&!wae(s))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let n={sandbox:i};if(s)try{n={...Yn(s),sandbox:i}}catch{}return r.settings=ze(n),r}function L0(e,t,r){let i=String(r);i.length>1&&i.startsWith("-")?e.push(`--${t}=${i}`):e.push(`--${t}`,i)}var Cae=2e3,Np=2048,lk="sdk-exit-after-stderr-drained",Oae=200;function Mp(e){return e==="exit"?lk:e}var sg=class{#e=new Set;#t=!1;#r=()=>this.killAll();track(t){this.#e.add(t),!this.#t&&(this.#t=!0,process.on("exit",this.#r))}untrack(t){this.#e.delete(t)}isTracking(t){return this.#e.has(t)}get size(){return this.#e.size}killAll(){for(let t of this.#e)if(!t.killed)if(process.platform==="win32")try{t.stdin.end()}catch{}else t.kill("SIGTERM")}reset(){process.off("exit",this.#r),this.#t=!1,this.#e.clear()}},oc=new sg,Aae=/[(),\u0000-\u001f\u007f-\u009f]/;function xae(e){if(typeof e!="string"||e.trim()==="")throw Error("Skill names must be non-empty strings.");if(!px(e))throw new Xr(`Invalid skill name ${ze(e)}: the name contains an unpaired surrogate, which cannot survive the UTF-8 encoding of the CLI invocation; no skill discovered from the filesystem can have such a name.`,"skill name with unpaired surrogate rejected");if(e!==e.trim())throw new Xr(`Invalid skill name ${ze(e)}: leading or trailing whitespace is not allowed \u2014 the Skill tool trims the invoked name, so a padded rule can never match. Remove the padding.`,"skill name with surrounding whitespace rejected");if(Aae.test(e))throw new Xr(`Invalid skill name ${ze(e)}: parentheses, commas, and control characters are not allowed in skill names. Skill names match the skill's directory name (or 'plugin:skill' for plugin-qualified skills); rename the skill if its directory name contains these characters.`,"invalid skill name rejected");if(e==="*")throw Error("Invalid skill name '*': use skills: 'all' to enable every skill.");if(e.endsWith(":*")||e.endsWith(" *"))throw new Xr(`Invalid skill name ${ze(e)}: wildcard-suffix names are not allowed; list each skill by its exact name.`,"wildcard-suffix skill name rejected");if(e.startsWith("/"))throw new Xr(`Invalid skill name ${ze(e)}: skill names may not start with '/'. Skills are invoked as slash commands, but the skills option takes the skill's canonical name \u2014 the directory name, or 'plugin:skill'.`,"skill name with leading slash rejected");if(e.includes("\\\\"))throw new Xr(`Invalid skill name ${ze(e)}: consecutive backslashes are not allowed \u2014 the permission-rule parser collapses escaped backslashes, so the rule would name a different skill. Rename the skill.`,"skill name with consecutive backslashes rejected");if(e.endsWith("\\"))throw new Xr(`Invalid skill name ${ze(e)}: names may not end with an unpaired backslash.`,"skill name with unpaired trailing backslash rejected");return e}var ng=class{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitEventDelivered=!1;stderrTail="";exitListeners=[];abortHandler;forwardedAbort=vm();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(t){this.options=t,this.abortController=t.abortController||vm(),t.deferSpawn?(this.spawnPromise=new Promise((r,i)=>{this.spawnResolve=r,this.spawnReject=i}),this.spawnPromise.catch(()=>{})):this.initialize()}spawn(){try{this.initialize()}catch(r){throw this.spawnAbort(fl(r)),r}let t=this.pendingWrites;this.pendingWrites=[],this.spawnResolve&&(this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0);for(let r of t)this.write(r);this.pendingEndInput&&(this.pendingEndInput=!1,this.processStdin?.end())}spawnAbort(t){this.spawnReject&&(this.spawnReject(t),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[])}updateEnv(t){this.options.env?Object.assign(this.options.env,t):this.options.env={...t}}updateResume(t){this.options.resume=t}getDefaultExecutable(){return tv()?"bun":"node"}spawnLocalProcess(t){let{command:r,args:i,cwd:s,env:n,signal:a}=t,o=Qz(r,i,{cwd:s,stdio:["pipe","pipe","pipe"],signal:a,env:n,windowsHide:!0}),l=new rW("utf8"),c=!1,u=!1,p=!1,h,f=st(n.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr!==void 0;o.stderr.on("data",v=>{if(p)return;let E=l.write(v);this.stderrTail+=E,this.stderrTail.length>2*Np&&(this.stderrTail=GE(Oc(this.stderrTail),Np)),f&&(vr(E),this.options.stderr?.(E))}),o.stderr.on("error",v=>{vr(`[ProcessTransport] stderr read failed: ${v.code??v.message}`)});let _=()=>{if(p)return;p=!0,h&&clearTimeout(h),o.emit(lk,o.exitCode,o.signalCode);let v=o.stderr;Dae(v)?v.unref():v.destroy()};return o.stderr.once("close",()=>{this.stderrTail+=l.end(),c=!0,u&&_()}),o.once("exit",()=>{u=!0,this.ready=!1,c?_():h=setTimeout(_,Oae)}),{stdin:o.stdin,stdout:o.stdout,get killed(){return o.killed},get exitCode(){return o.exitCode},get signalCode(){return o.signalCode},kill:o.kill.bind(o),on:(v,E)=>o.on(Mp(v),E),once:(v,E)=>o.once(Mp(v),E),off:(v,E)=>o.off(Mp(v),E)}}initialize(){try{let{additionalDirectories:t=[],agent:r,betas:i,cwd:s,executable:n=this.getDefaultExecutable(),executableArgs:a=[],extraArgs:o={},pathToClaudeCodeExecutable:l,env:c={...process.env},thinkingConfig:u,maxTurns:p,maxBudgetUsd:h,taskBudget:f,model:_,fallbackModel:v,jsonSchema:E,permissionMode:y,allowDangerouslySkipPermissions:m,permissionPromptToolName:g,permissionPrompts:b,continueConversation:C,resume:A,settingSources:w,skills:S,disallowedTools:x=[],tools:T,mcpServers:I,strictMcpConfig:L,canUseTool:P,includePartialMessages:$,plugins:se,pluginsViaInitialize:ee,sandbox:pe}=this.options,{allowedTools:ne=[]}=this.options;if(S!==void 0){let J=S==="all"?["Skill"]:S.map(xe=>`Skill(${xae(xe)})`),ae=new Set(ne);ne=[...ne,...J.filter(xe=>!ae.has(xe))]}let oe=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(u){switch(u.type){case"enabled":u.budgetTokens===void 0?oe.push("--thinking","adaptive"):oe.push("--max-thinking-tokens",u.budgetTokens.toString());break;case"disabled":oe.push("--thinking","disabled");break;case"adaptive":oe.push("--thinking","adaptive");break}u.type!=="disabled"&&u.display&&oe.push("--thinking-display",u.display)}if(this.options.effort&&oe.push("--effort",this.options.effort),p&&oe.push("--max-turns",p.toString()),h!==void 0&&oe.push("--max-budget-usd",h.toString()),f&&oe.push("--task-budget",f.total.toString()),_&&oe.push("--model",_),r&&oe.push("--agent",r),i&&i.length>0&&oe.push("--betas",i.join(",")),E&&oe.push("--json-schema",ze(E)),this.options.debugFile?oe.push("--debug-file",this.options.debugFile):this.options.debug&&oe.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let J=Eae();J&&oe.push("--debug-file",J)}if(P){if(g)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");oe.push("--permission-prompt-tool","stdio")}else g&&oe.push("--permission-prompt-tool",g);if(b&&oe.push("--permission-prompts",b),C&&oe.push("--continue"),A&&oe.push(`--resume=${A}`),this.options.channels&&this.options.channels.length>0)for(let J of this.options.channels)L0(oe,"channels",J);if(ne.length>0&&oe.push("--allowedTools",ne.join(",")),x.length>0&&oe.push("--disallowedTools",x.join(",")),T!==void 0&&(Array.isArray(T)?T.length===0?oe.push("--tools",""):oe.push("--tools",T.join(",")):oe.push("--tools","default")),I&&Object.keys(I).length>0&&oe.push("--mcp-config",ze({mcpServers:I})),w!==void 0&&oe.push(`--setting-sources=${w.join(",")}`),L&&oe.push("--strict-mcp-config"),y&&oe.push("--permission-mode",y),m&&oe.push("--allow-dangerously-skip-permissions"),v){if(_&&v===_)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");oe.push("--fallback-model",v)}this.options.includeHookEvents&&oe.push("--include-hook-events"),$&&oe.push("--include-partial-messages"),this.options.sessionMirror&&oe.push("--session-mirror");for(let J of t)oe.push("--add-dir",J);if(ee)oe.push("--await-initialize");else if(se&&se.length>0)for(let J of se)if(J.type==="local")oe.push(J.skipMcpDiscovery?"--plugin-dir-no-mcp":"--plugin-dir",J.path);else throw Error(`Unsupported plugin type: ${J.type}`);this.options.forkSession&&oe.push("--fork-session"),this.options.resumeSessionAt&&oe.push(`--resume-session-at=${this.options.resumeSessionAt}`),this.options.resumeDropsTurn!==void 0&&oe.push(`--resume-drops-turn=${this.options.resumeDropsTurn}`),this.options.sessionId&&oe.push(`--session-id=${this.options.sessionId}`),this.options.persistSession===!1&&oe.push("--no-session-persistence"),this.options.managedSettings&&oe.push("--managed-settings",this.options.managedSettings);let W={...o??{}};this.options.settings&&(W.settings=this.options.settings);let k=Sae(W,pe);for(let[J,ae]of Object.entries(k))ae===null?oe.push(`--${J}`):L0(oe,J,ae);c.CLAUDE_CODE_ENTRYPOINT||(c.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete c.NODE_OPTIONS,st(c.DEBUG_CLAUDE_AGENT_SDK)?c.DEBUG="1":delete c.DEBUG;let U=kae(l),N=U?l:n,R=U?[...a,...oe]:[...a,l,...oe],M={command:N,args:R,cwd:s,env:c,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(vr(`Spawning Claude Code (custom): ${N} ${R.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(M)):(vr(`Spawning Claude Code: ${N} ${R.join(" ")}`),this.process=this.spawnLocalProcess(M)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,this.processStdin.on("error",J=>{vr(`[ProcessTransport] stdin write failed (child likely exited): ${J.code??J.message}`),this.ready=!1}),oc.track(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted&&this.close();let K=this.process;K.on("error",J=>{this.ready=!1;let ae=J,xe=ae.syscall!==void 0?ae.syscall.startsWith("spawn"):t0(J);if(xe&&!K.killed&&oc.untrack(K),this.abortController.signal.aborted)this.exitError=lc(),Dr(J,{telemetryMessage:"Claude Code process aborted by user",errorClass:"aborted"});else if(xe&&t0(J)){let{message:be,telemetryMessage:_e,errorClass:F}=Tae(l,U),z={telemetryMessage:`${_e}${Up(J)}`,errorClass:F,code:Ac(J)};this.exitError=Dr(ReferenceError(be),z),Dr(J,z),vr(this.exitError.message)}else{let be={telemetryMessage:xe?`Failed to spawn Claude Code process${Up(J)}`:`Claude Code process error${Up(J)}`,errorClass:xe?"spawn_failed":"process_error",code:Ac(J)};this.exitError=Dr(Error(`Failed to spawn Claude Code process: ${Oc(J.message)}`),be),Dr(J,be),vr(this.exitError.message)}}),K.on("exit",(J,ae)=>{if(this.exitEventDelivered=!0,this.ready=!1,this.abortController.signal.aborted)this.exitError=lc();else{let xe=this.getProcessExitError(J,ae);xe&&(this.exitError=xe,vr(xe.message))}}),this.ready=!this.abortController.signal.aborted}catch(t){throw this.ready=!1,t}}getProcessExitError(t,r){if(t!==0&&t!==null){let i=Number.isInteger(t)?t:void 0;return Dr(Error(`Claude Code process exited with code ${t}${this.formatStderrTail()}`),{telemetryMessage:`Claude Code process exited with code ${i??"unknown"}`,errorClass:"process_exited_nonzero",exitCode:i})}else if(r){let i=/^SIG[A-Z0-9]{1,8}$/.test(r)?r:"unknown";return Dr(Error(`Claude Code process terminated by signal ${r}${this.formatStderrTail()}`),{telemetryMessage:`Claude Code process terminated by signal ${i}`,errorClass:"process_killed_by_signal",signal:i})}}formatStderrTail(){let t=GE(Oc(this.stderrTail),Np).trim();return t?`. stderr: ${t}`:""}write(t){if(this.abortController.signal.aborted)throw P0();if(this.spawnResolve){this.pendingWrites.push(t);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){vr("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Dr(Error(`Cannot write to process that exited with error: ${this.exitError.message}`),{telemetryMessage:`Cannot write to process that exited with error: ${l4(this.exitError)??"untagged exit error"}`,errorClass:N0(this.exitError,"errorClass"),code:Ac(this.exitError),exitCode:Rae(this.exitError),signal:N0(this.exitError,"signal")});vr(`[ProcessTransport] Writing to stdin: ${t.substring(0,100)}`);try{this.processStdin.write(t)||vr("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${Cs(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?lc():Error("Query closed before spawn")),this.processStdin&&(this.processStdin.end(),this.processStdin=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);let t=this.process?.exitCode??null,r=this.process?.signalCode??null,i=!this.exitEventDelivered&&(t!==null&&t>=0||r!==null),s;i&&(this.exitEventDelivered=!0,s=this.abortController.signal.aborted?lc():this.getProcessExitError(t,r),s&&!this.exitError&&(this.exitError=s));let n=this.exitListeners;this.exitListeners=[];for(let{callback:l,handler:c}of n)if(this.process?.off("exit",c),i)try{l(s)}catch(u){vr(`[ProcessTransport] onExit callback threw during close(): ${Cs(u)}`)}let a=()=>{this.abortController.signal.aborted&&this.forwardedAbort.abort(this.abortController.signal.reason)},o=this.process;o&&!o.killed&&o.exitCode===null&&o.signalCode==null?(setTimeout((l,c)=>{if(l.exitCode!==null||l.signalCode!=null){c();return}if(process.platform==="win32"){setTimeout((u,p)=>{u.exitCode===null&&u.kill("SIGKILL"),p()},5e3,l,c).unref();return}l.kill("SIGTERM"),setTimeout(u=>{u.exitCode===null&&u.kill("SIGKILL")},5e3,l).unref(),c()},Cae,o,a).unref(),o.once("exit",()=>oc.untrack(o))):o&&(oc.untrack(o),a()),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise&&(await this.spawnPromise,this.spawnPromise=void 0),!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let t=tW({input:this.processStdout}),r=this.process?(()=>{let i=this.process,s=()=>t.close();return i.on("error",s),()=>i.off("error",s)})():void 0;this.exitError&&t.close();try{for await(let i of t)if(i.trim()){let s;try{s=Yn(i)}catch{vr(`Non-JSON stdout: ${i}`);continue}yield s}if(this.exitError)throw this.exitError;await this.waitForExit()}finally{r?.(),t.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}this.processStdin&&this.processStdin.end()}onExit(t){if(!this.process)return()=>{};let r=(i,s)=>{let n=this.getProcessExitError(i,s);t(n)};return this.process.on("exit",r),this.exitListeners.push({callback:t,handler:r}),()=>{this.process&&this.process.off("exit",r);let i=this.exitListeners.findIndex(s=>s.handler===r);i!==-1&&this.exitListeners.splice(i,1)}}async waitForExit(){if(this.exitError)throw this.exitError;if(!(!this.process||this.process.exitCode===0||this.process.killed&&this.exitEventDelivered))return new Promise((t,r)=>{let i=(n,a)=>{if(this.abortController.signal.aborted){r(P0());return}let o=this.getProcessExitError(n,a);o?r(o):t()};this.process.once("exit",i);let s=n=>{this.process.off("exit",i),r(n)};this.process.once("error",s),this.process.once("exit",()=>{this.process.off("error",s)})})}};function kae(e){return![".js",".mjs",".tsx",".ts",".jsx"].some(t=>e.endsWith(t))}function Tae(e,t){let r=t?"native binary":"executable",i=Oc(e);return eW(e)?{message:t?`Claude Code native binary at ${i} exists but failed to launch. This usually means the binary does not match this system's libc \u2014 e.g. spawning a musl-linked binary on a glibc Linux host fails because the musl dynamic loader (/lib/ld-musl-*) is missing. Specify a matching binary with options.pathToClaudeCodeExecutable.`:`Claude Code executable at ${i} exists but failed to launch.`,telemetryMessage:`Claude Code ${r} exists at the configured path but failed to launch`,errorClass:"executable_launch_failed"}:{message:t?`Claude Code native binary not found at ${i}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${i}. Is options.pathToClaudeCodeExecutable set?`,telemetryMessage:`Claude Code ${r} not found at the configured path`,errorClass:"executable_not_found"}}function Up(e){let t=Ac(e);return t===void 0?"":` (${t})`}function lc(){return Dr(new Un("Claude Code process aborted by user"),{telemetryMessage:"Claude Code process aborted by user",errorClass:"aborted"})}function P0(){return Dr(new Un("Operation aborted"),{telemetryMessage:"Operation aborted",errorClass:"aborted"})}function N0(e,t){let r=Object.hasOwn(e,t)?Reflect.get(e,t):void 0;return typeof r=="string"?r:void 0}function Rae(e){let t=Object.hasOwn(e,"exitCode")?Reflect.get(e,"exitCode"):void 0;return typeof t=="number"?t:void 0}function Dae(e){return typeof Reflect.get(e,"unref")=="function"}var Qs="@anthropic-ai/claude-agent-sdk";function Lae(){if(process.platform!=="linux")return!1;let e=typeof process.report?.getReport=="function"?process.report.getReport():null;return e!=null&&e.header?.glibcVersionRuntime===void 0}function Pae(e,t={}){let r=t.platform??process.platform,i=t.arch??process.arch,s=t.exists??Iae,n=t.preferMusl??Lae(),a="claude",o=r==="win32"?".exe":"",l=(r==="android"?[`${Qs}-linux-${i}-android`]:r==="linux"?n?[`${Qs}-linux-${i}-musl`,`${Qs}-linux-${i}`]:[`${Qs}-linux-${i}`,`${Qs}-linux-${i}-musl`]:[`${Qs}-${r}-${i}`]).map(c=>`${c}/claude${o}`);for(let c of l)try{let u=e(c);if(s(u))return u}catch{}return null}var Nae=["signed_out","identity_changed","transient","refresh_failed"];function Mae(e){return Nae.some(t=>t===e)}var ag=class{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(t){this.returned=t}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((t,r)=>{this.readResolve=t,this.readReject=r})}enqueue(t){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:t})}else this.queue.push(t)}done(){if(this.isDone=!0,this.readResolve){let t=this.readResolve;this.readResolve=void 0,this.readReject=void 0,t({done:!0,value:void 0})}}error(t){if(this.hasError=t,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(t)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}},Uae=1e3;function $ae(){return{eventQueue:[],sink:null,droppedEventCount:0}}function jae(e,t){e.eventQueue.length>=Uae&&(e.eventQueue.shift(),e.droppedEventCount++),e.eventQueue.push(t)}var og=class{state=$ae()},Fae=new Nt(()=>new og);function Bae(){return sd(Fae)}function cd(e,t){let r=Bae().state;if(r.sink===null){jae(r,{eventName:e,metadata:t,async:!1});return}r.sink.logEvent(e,t)}function Hae(e,t){cd("tengu_feature_ok",{feature_name:nd(e),...t})}function zae(e,t,r){cd("tengu_feature_bad",{...r,feature_name:nd(e),error_code:u4(t)})}async function or(e,t,r){try{let i=await t();return Hae(e),i}catch(i){throw zae(e,r?.(i)??"error"),i}}function Kt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Wae(e){return"method"in e&&"id"in e&&e.id!==null}var VAe=Object.freeze({}),ZAe=Object.freeze({name:"claude-code",title:"Claude Code",description:"Anthropic's agentic coding tool",websiteUrl:"https://claude.com/claude-code"});var lg=class{sendMcpMessage;isClosed=!1;constructor(t){this.sendMcpMessage=t}onclose;onerror;onmessage;async start(){}async send(t){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(t)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}};function M0(e){return typeof e=="number"&&Number.isInteger(e)&&e>0?e:void 0}var to=Symbol("suppressControlResponse"),cg=class e{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;onUserDialog;pendingControlResponses=new Map;unmatchedControlResponses=new Map;static UNMATCHED_CONTROL_RESPONSES_MAX=1024;cleanupPerformed=!1;sdkMessages;inputStream=new ag;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;initHooksPayload;sdkMcpServers=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;latestCommands;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(t){this.isSingleUserTurn=t}setTranscriptMirrorBatcher(t){this.transcriptMirrorBatcher=t}reportMirrorError(t,r){let i={type:"system",subtype:"mirror_error",error:r,key:t,uuid:_f(),session_id:t.sessionId};this.inputStream.enqueue(i)}addCleanupCallback(t){this.cleanupPerformed?t():this.cleanupCallbacks.push(t)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpServers.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.onUserDialog!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0||this.workSecretAnswerer!==void 0}remoteControlCallGeneration=0;workSecretAnswerer;constructor(t,r,i,s,n,a=new Map,o,l,c,u,p,h){this.transport=t,this.isSingleUserTurn=r,this.canUseTool=i,this.hooks=s,this.abortController=n,this.jsonSchema=o,this.initConfig=l,this.onElicitation=c,this.getOAuthToken=u,this.getHostAuthToken=p,this.onUserDialog=h;for(let[f,_]of a)this.connectSdkMcpServer(f,_);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(t){this.inputStream.error(t)}async stopTask(t){await this.request({subtype:"stop_task",task_id:t})}async backgroundTasks(t){return(await this.request({subtype:"background_tasks",tool_use_id:t})).response.backgrounded??!0}close(){this.cleanup()}cleanup(t){return this.cleanupPromise?this.cleanupPromise:(this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(t),this.cleanupPromise)}async performCleanup(t){for(let r of this.cleanupCallbacks)try{r()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let i of this.cancelControllers.values())i.abort();this.cancelControllers.clear(),this.transport.close();let r=t??Error("Query closed before response received");for(let{reject:i}of this.pendingControlResponses.values())i(r);this.pendingControlResponses.clear(),this.unmatchedControlResponses.clear();for(let{reject:i}of this.pendingMcpResponses.values())i(r);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let{transport:i}of this.sdkMcpServers.values())i.close().catch(()=>{});this.sdkMcpServers.clear(),t?this.inputStream.error(t):this.inputStream.done()}catch{}if(this.transport.waitForExit){let r=new AbortController;try{await Promise.race([this.transport.waitForExit(),ed(2e3,r.signal)])}catch{}finally{r.abort()}}}next(...[t]){return this.sdkMessages.next(t)}async return(t){return await this.cleanup(),this.sdkMessages.return(t)}async throw(t){return await this.cleanup(),this.sdkMessages.throw(t)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let t of this.transport.readMessages()){if(t.type==="control_response"){let r=this.pendingControlResponses.get(t.response.request_id);if(r)r.handler(t.response);else{if(this.unmatchedControlResponses.size>=e.UNMATCHED_CONTROL_RESPONSES_MAX){let i=this.unmatchedControlResponses.keys().next().value;i!==void 0&&this.unmatchedControlResponses.delete(i)}this.unmatchedControlResponses.set(t.response.request_id,t.response)}continue}else if(t.type==="control_request"){this.handleControlRequest(t);continue}else if(t.type==="control_cancel_request"){this.handleControlCancelRequest(t);continue}else{if(t.type==="keep_alive")continue;if(t.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(t.filePath,t.entries);continue}}if(t.type==="system"&&t.subtype==="commands_changed"&&Array.isArray(t.commands)&&(this.latestCommands=t.commands),t.type==="system"&&(t.subtype==="post_turn_summary"||t.subtype==="task_summary")){this.inputStream.enqueue(t);continue}if(t.type==="active_goal"){this.inputStream.enqueue(t);continue}if(t.type==="autocompact_state"){this.inputStream.enqueue(t);continue}if(t.type==="result"){this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush();let r=t.is_error?t.subtype==="success"?t.result:t.errors.map(i=>i.trim()).filter(Boolean).join("; "):void 0;this.lastErrorResultText=r||void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&(We("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput())}else t.type==="system"&&t.subtype==="session_state_changed"||(this.lastErrorResultText=void 0);this.inputStream.enqueue(t)}this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.inputStream.done(),this.cleanup()}catch(t){if(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.lastErrorResultText!==void 0&&!(t instanceof Un)&&t?.name!=="SSEHttpError"){let r=Dr(Error(`Claude Code returned an error result: ${this.lastErrorResultText}`),{telemetryMessage:"Claude Code returned an error result",errorClass:"error_result"});We(`[Query.readMessages] Replacing exit error with result text. Original: ${Cs(t)}`),this.inputStream.error(r),this.cleanup(r);return}this.inputStream.error(t),this.cleanup(t)}}async handleControlRequest(t){if(this.cancelControllers.has(t.request_id)){We(`[Query.handleControlRequest] Duplicate delivery of in-flight request ${t.request_id} (${t.request.subtype}) \u2014 skipping`);return}let r=new AbortController;this.cancelControllers.set(t.request_id,r);try{let i=await this.processControlRequest(t,r.signal);if(this.cleanupPerformed||i===to)return;let s={type:"control_response",response:{subtype:"success",request_id:t.request_id,response:i}};await Promise.resolve(this.transport.write(ze(s)+`
|
|
87
|
+
`))}catch(i){if(this.cleanupPerformed)return;let s={type:"control_response",response:{subtype:"error",request_id:t.request_id,error:Cs(i)}};try{await Promise.resolve(this.transport.write(ze(s)+`
|
|
88
|
+
`))}catch(n){We(`[Query.handleControlRequest] Error-response write failed: ${Cs(n)}`,{level:"error"})}}finally{this.cancelControllers.delete(t.request_id)}}handleControlCancelRequest(t){let r=this.cancelControllers.get(t.request_id);r&&(r.abort(),this.cancelControllers.delete(t.request_id))}async processControlRequest(t,r){if(t.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");let i=await this.canUseTool(t.request.tool_name,t.request.input,{signal:r,suggestions:t.request.permission_suggestions,blockedPath:t.request.blocked_path,decisionReason:t.request.decision_reason,title:t.request.title,displayName:t.request.display_name,description:t.request.description,defaultToNo:t.request.default_to_no,suppressAlwaysAllowRule:t.request.suppress_always_allow_rule,toolUseID:t.request.tool_use_id,agentID:t.request.agent_id,requestId:t.request_id,...t.request.matched_ask_rule&&{matchedAskRule:{source:t.request.matched_ask_rule.source,toolName:t.request.matched_ask_rule.tool_name,...t.request.matched_ask_rule.rule_content!==void 0&&{ruleContent:t.request.matched_ask_rule.rule_content}}}});return i===null?to:{...i,toolUseID:t.request.tool_use_id}}else{if(t.request.subtype==="hook_callback")return await this.handleHookCallbacks(t.request.callback_id,t.request.input,t.request.tool_use_id,r);if(t.request.subtype==="mcp_message"){let i=t.request,s=this.sdkMcpServers.get(i.server_name)?.transport;if(!s)throw Error(`SDK MCP server not found: ${i.server_name}`);return Wae(i.message)?{mcp_response:await this.handleMcpControlRequest(i.server_name,i,s)}:(s.onmessage&&s.onmessage(i.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}else if(t.request.subtype==="elicitation"){let i=t.request;if(this.onElicitation){let s=await this.onElicitation({serverName:i.mcp_server_name,message:i.message,mode:i.mode,url:i.url,elicitationId:i.elicitation_id,requestedSchema:i.requested_schema,title:i.title,displayName:i.display_name,description:i.description},{signal:r,requestId:t.request_id});return s===null?to:s}return{action:"decline"}}else if(t.request.subtype==="request_user_dialog"){if(this.onUserDialog){let i=await this.onUserDialog({dialogKind:t.request.dialog_kind,payload:t.request.payload,toolUseID:t.request.tool_use_id},{signal:r,requestId:t.request_id});return i===null?to:i}return We(`[Query] No onUserDialog handler for request_user_dialog (kind=${t.request.dialog_kind}) \u2014 staying silent so a capable client (or the worker's park deadline) settles it`),cd("tengu_request_user_dialog_response_ignored",{shape:nd("auto_cancel")}),to}else if(t.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");let i,s=await this.getOAuthToken({signal:r,onDecline:n=>{Mae(n)&&(i=n)}})??null;return s===null&&i!==void 0?{accessToken:s,reason:i}:{accessToken:s}}else if(t.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");let i=await this.getHostAuthToken({signal:r})??null;return typeof i=="string"||i===null?{authToken:i}:i}else if(t.request.subtype==="remote_control_work_secret"){let i=this.workSecretAnswerer;if(!i)throw Error("refreshWorkSecret callback is not provided.");if(!U0(i.sessionId,t.request.session_id))throw Error("remote_control_work_secret names a session this host did not attach.");return{work_secret:await i.refresh(i.sessionId,{signal:r})||null}}}throw Error("Unsupported control request subtype: "+t.request.subtype)}async*readSdkMessages(){try{for await(let t of this.inputStream)this.transport.markDelivered?.(t),yield t}finally{await this.cleanup()}}async initialize(){if(this.hooks&&!this.initHooksPayload){this.initHooksPayload={};for(let[a,o]of Object.entries(this.hooks))o.length>0&&(this.initHooksPayload[a]=o.map(l=>{let c=[];for(let u of l.hooks){let p=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(p,u),c.push(p)}return{matcher:l.matcher,hookCallbackIds:c,timeout:l.timeout}}))}let t=this.sdkMcpServers.size>0?Array.from(this.sdkMcpServers.keys()):void 0,r=Array.from(this.sdkMcpServers).flatMap(([a,{timeout:o}])=>o!==void 0?[[a,{timeout:o}]]:[]),i=r.length>0?Object.fromEntries(r):void 0,s={subtype:"initialize",hooks:this.initHooksPayload,sdkMcpServers:t,sdkMcpServerConfigs:i,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt=="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,systemPromptSnapshot:this.initConfig?.systemPromptSnapshot,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText,supportedDialogKinds:this.initConfig?.supportedDialogKinds,perTaskStopAffordance:this.initConfig?.perTaskStopAffordance,workspaceTrust:this.initConfig?.workspaceTrust,plugins:this.initConfig?.plugins},n=(await this.request(s)).response;return this.initConfig?.plugins!==void 0&&this.initConfig.plugins.length>0&&n.plugins_applied!==!0&&We(`[Query.initialize] Claude Code reported plugins_applied=${String(n.plugins_applied)} for ${this.initConfig.plugins.length} plugins sent with pluginDelivery 'initialize'; the process is running with the plugins it was launched with.`,{level:"warn"}),n}async interrupt(t){return or("sdk_interrupt",async()=>{let r=await this.request({subtype:"interrupt",...t?.cancelQueued===!0&&{cancel_queued:!0}}),i=r.response?.still_queued;if(!Array.isArray(i))return;let s=r.response?.cancelled;return{still_queued:i.filter(n=>typeof n=="string"),...Array.isArray(s)&&{cancelled:s.filter(n=>typeof n=="string")}}})}async setPermissionMode(t){await this.request({subtype:"set_permission_mode",mode:t})}async setMcpPermissionModeOverride(t,r){return(await this.request({subtype:"set_mcp_permission_mode_override",serverName:t,mode:r})).response??{}}awaitControlResponse(t){return this.transport.expectControlResponse?.(t),new Promise((r,i)=>{let s=a=>{if(a.subtype==="success"){let{pending_permission_requests:o,pending_user_dialog_requests:l,...c}=a;r(c)}else i(new Xr(a.error,"awaitControlResponse: CLI error verdict"));(a.pending_permission_requests||a.pending_user_dialog_requests)&&We("[Query] Ignoring prompt-redelivery fields on awaitControlResponse response")};if(this.cleanupPerformed){i(Error("Query closed before response received"));return}let n=this.unmatchedControlResponses.get(t);if(n){this.unmatchedControlResponses.delete(t),s(n);return}this.pendingControlResponses.set(t,{handler:a=>{this.pendingControlResponses.delete(t),s(a)},reject:i})})}async setModel(t){await this.request({subtype:"set_model",model:t})}async setMaxThinkingTokens(t,r){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:t,thinking_display:r})}async applyFlagSettings(t){return or("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:t})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async updateSettings(t,r){return or("sdk_update_settings",async()=>{await this.request({subtype:"update_settings",source:t,settings:r})})}async rewindFiles(t,r){return or("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:t,dry_run:r?.dryRun})).response)}async cancelAsyncMessage(t){return(await this.request({subtype:"cancel_async_message",message_uuid:t})).response.cancelled}async seedReadState(t,r){await this.request({subtype:"seed_read_state",path:t,mtime:r})}async setCwd(t,r){return or("sdk_set_cwd",async()=>(await this.request({subtype:"set_cwd",path:t,...r?.trustAccepted!==void 0&&{trust_accepted:r.trustAccepted},...r?.trustedDirectory!==void 0&&{trusted_directory:r.trustedDirectory}})).response)}async enableRemoteControl(t,r,i){let s=++this.remoteControlCallGeneration,n=this.workSecretAnswerer,a=i?.reattachSessionId||(i?.workSecret===void 0?void 0:Kae(i.workSecret)),o=t&&i?.workSecret!==void 0&&i.refreshWorkSecret&&a!==void 0?{sessionId:a,refresh:i.refreshWorkSecret}:void 0;this.workSecretAnswerer=o;let l;try{l=(await this.request({subtype:"remote_control",enabled:t,...r!==void 0&&{name:r},reattach_session_id:i?.reattachSessionId,keep_session_on_exit:i?.keepSessionOnExit,work_secret:i?.workSecret})).response}catch(c){throw s===this.remoteControlCallGeneration&&(this.workSecretAnswerer=void 0),c}if(t&&s===this.remoteControlCallGeneration){let c=l.bridge_session_id,u=[o,n];this.workSecretAnswerer=typeof c=="string"?u.find(p=>p!==void 0&&U0(p.sessionId,c)):void 0}return l}async submitFeedback(t,r){return(await this.request({subtype:"submit_feedback",description:t,surface:r?.surface,draft_id:r?.draft_id,type:r?.type,title:r?.title,area:r?.area,attach_transcript:r?.attach_transcript})).response}async generateSessionTitle(t,r){return or("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:t,persist:r?.persist})).response.title)}async askSideQuestion(t,r){return or("sdk_side_question",async()=>{let i=(await this.request({subtype:"side_question",question:t,...r?.history?.length&&{history:[...r.history]}},r)).response;return i.response===null?null:{response:i.response,synthetic:i.synthetic??!1,...i.refusal_fallback&&{refusalFallback:{originalModel:i.refusal_fallback.original_model,fallbackModel:i.refusal_fallback.fallback_model,content:i.refusal_fallback.content}}}},()=>r?.signal?.aborted?"cancelled":"error")}async launchUltrareview(t,r){return(await this.request({subtype:"ultrareview_launch",args:t,confirm:r?.confirm??!1})).response}async messageRated(t){await this.request({subtype:"message_rated",messageUuid:t.messageUuid,sentiment:t.sentiment,surface:t.surface,cleared:t.cleared??!1})}processPendingPermissionRequests(t){for(let r of t)r.request.subtype==="can_use_tool"&&this.handleControlRequest(r).catch(()=>{})}processPendingUserDialogRequests(t){for(let r of t)r.request.subtype==="request_user_dialog"&&this.handleControlRequest(r).catch(()=>{})}request(t,r){let i=Math.random().toString(36).substring(2,15);this.transport.expectControlResponse?.(i);let s={request_id:i,type:"control_request",request:t},n=t.subtype==="initialize";return new Promise((a,o)=>{let l=r?.signal,c,u=h=>{c?.(),a(h)},p=h=>{c?.(),o(h)};if(l){let h=()=>{this.pendingControlResponses.delete(i),p(fl(l.reason??"Control request aborted"));try{Promise.resolve(this.transport.write(ze({type:"control_cancel_request",request_id:i})+`
|
|
89
|
+
`)).catch(()=>{})}catch{}};if(l.aborted){h();return}l.addEventListener("abort",h,{once:!0}),c=()=>{l.removeEventListener("abort",h)}}this.pendingControlResponses.set(i,{handler:h=>{this.pendingControlResponses.delete(i),h.subtype==="success"?u(h):p(Dr(Error(h.error),{telemetryMessage:`Claude Code control request failed (${t.subtype})`,errorClass:"control_request_failed"})),!n&&(h.pending_permission_requests||h.pending_user_dialog_requests)?We(`[Query] Ignoring prompt-redelivery fields on non-initialize response (subtype=${t.subtype})`):(h.pending_permission_requests&&this.processPendingPermissionRequests(h.pending_permission_requests),h.pending_user_dialog_requests&&this.processPendingUserDialogRequests(h.pending_user_dialog_requests))},reject:p}),Promise.resolve(this.transport.write(ze(s)+`
|
|
90
|
+
`)).catch(h=>{this.pendingControlResponses.delete(i),p(h)})})}initializationResult(){return this.initialization}reinitialize(){return or("sdk_reinitialize",()=>this.initialize())}async supportedCommands(){let{commands:t}=await this.initialization;return this.latestCommands??t}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(t){await this.request({subtype:"mcp_reconnect",serverName:t})}async toggleMcpServer(t,r){return or("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:t,enabled:r})})}async enableChannel(t){return or("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:t})})}async mcpAuthenticate(t,r){return(await this.request({subtype:"mcp_authenticate",serverName:t,redirectUri:r})).response}async mcpClearAuth(t){return(await this.request({subtype:"mcp_clear_auth",serverName:t})).response}async mcpSubmitOAuthCallbackUrl(t,r){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:t,callbackUrl:r})).response}async claudeAuthenticate(t){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:t})).response}async claudeOAuthCallback(t,r){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:t,state:r})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(t){return(await this.request({subtype:"get_context_usage",...t})).response}async usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(t){return(await this.request({subtype:"get_usage",...t?.skipBehaviors&&{skip_behaviors:!0}})).response}async readFile(t,r){try{return(await this.request({subtype:"read_file",path:t,max_bytes:r?.maxBytes,encoding:r?.encoding})).response}catch{return null}}async reloadPlugins(t){return or("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins",...t?.holdOnCacheImpact&&{hold_on_cache_impact:!0}})).response)}async reloadSkills(){return or("sdk_reload_skills",async()=>(await this.request({subtype:"reload_skills"})).response)}async reloadOutputStyles(){return or("sdk_reload_output_styles",async()=>(await this.request({subtype:"reload_output_styles"})).response)}async setMcpServers(t){return or("sdk_mcp_set_servers",async()=>{let r={},i={};for(let[o,l]of Object.entries(t))l.type==="sdk"&&"instance"in l?r[o]=l:i[o]=l;let s=new Set(this.sdkMcpServers.keys()),n=new Set(Object.keys(r));for(let o of s)n.has(o)||await this.disconnectSdkMcpServer(o);for(let[o,l]of Object.entries(r)){let c=this.sdkMcpServers.get(o);c?M0(l.timeout)!==c.timeout&&We(`[Query.setMcpServers] MCP server '${o}' is already registered; its timeout change is ignored until the server is removed and re-added`):this.connectSdkMcpServer(o,l)}let a={};for(let o of Object.keys(r)){let l=this.sdkMcpServers.get(o)?.timeout;a[o]={type:"sdk",name:o,...l!==void 0&&{timeout:l}}}return(await this.request({subtype:"mcp_set_servers",servers:{...i,...a}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(t){We("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let i of t){if(r++,We(`[Query.streamInput] Processing message ${r}: ${i.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(ze(i)+`
|
|
91
|
+
`))}We(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(We("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),We("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof Un))throw r}}waitForFirstResult(){return this.firstResultReceived?(We("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve()):new Promise(t=>{let r=this.abortController?.signal;if(this.cleanupPerformed||r?.aborted){t();return}let i=()=>t();r?.addEventListener("abort",i,{once:!0}),this.addCleanupCallback(()=>{r?.removeEventListener("abort",i),t()}),this.firstResultReceivedResolve=()=>{r?.removeEventListener("abort",i),t()}})}handleHookCallbacks(t,r,i,s){let n=this.hookCallbacks.get(t);if(!n)throw Error(`No hook callback found for ID: ${t}`);return n(r,i,{signal:s})}connectSdkMcpServer(t,r){let i=new lg(s=>this.sendMcpServerMessageToCli(t,s));this.sdkMcpServers.set(t,{transport:i,timeout:M0(r.timeout)}),r.instance.connect(i).catch(s=>{this.sdkMcpServers.get(t)?.transport===i&&this.sdkMcpServers.delete(t),We(`[Query.connectSdkMcpServer] Failed to connect MCP server '${t}': ${s}`,{level:"error"})})}async disconnectSdkMcpServer(t){let r=this.sdkMcpServers.get(t);r&&(await r.transport.close(),this.sdkMcpServers.get(t)===r&&this.sdkMcpServers.delete(t))}sendMcpServerMessageToCli(t,r){if("id"in r&&r.id!==null&&r.id!==void 0){let s=`${t}:${r.id}`,n=this.pendingMcpResponses.get(s);if(n){n.resolve(r),this.pendingMcpResponses.delete(s);return}}let i={type:"control_request",request_id:_f(),request:{subtype:"mcp_message",server_name:t,message:r}};Promise.resolve(this.transport.write(ze(i)+`
|
|
92
|
+
`)).catch(s=>{We(`[Query.sendMcpServerMessageToCli] Transport write failed: ${s}`,{level:"error"})})}handleMcpControlRequest(t,r,i){let s="id"in r.message?r.message.id:null,n=`${t}:${s}`;return new Promise((a,o)=>{let l=()=>{this.pendingMcpResponses.delete(n)},c=p=>{l(),a(p)},u=p=>{l(),o(p)};if(this.pendingMcpResponses.set(n,{resolve:c,reject:u}),i.onmessage)i.onmessage(r.message);else{l(),o(Error("No message handler registered"));return}})}};function U0(e,t){if(e===t)return!0;let r=e.slice(e.lastIndexOf("_")+1),i=t.slice(t.lastIndexOf("_")+1);return r.length>=4&&r===i}function Kae(e){try{let t=Yn(Buffer.from(e,"base64url").toString("utf8"));if(typeof t!="object"||t===null||!("session_ingress_token"in t)||typeof t.session_ingress_token!="string")return;let r=t.session_ingress_token,i=(r.startsWith("sk-ant-si-")?r.slice(10):r).split(".");if(i.length!==3||!i[1])return;let s=Yn(Buffer.from(i[1],"base64url").toString("utf8"));return typeof s=="object"&&s!==null&&"session_id"in s&&typeof s.session_id=="string"&&s.session_id?s.session_id:void 0}catch{return}}var ck=500,uk=1048576,Gae=[200,800],ug=class{send;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;constructor(t,r){this.send=t;let{sendTimeoutMs:i=6e4,onError:s,maxPendingEntries:n=ck,maxPendingBytes:a=uk,backoffMs:o=Gae}=r??{};this.sendTimeoutMs=i,this.onError=s,this.maxPendingEntries=n,this.maxPendingBytes=a,this.backoffMs=o}enqueue(t,r){let i=ze(r).length;this.pending.push({filePath:t,entries:r,bytes:i}),this.pendingEntries+=r.length,this.pendingBytes+=i,(this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)&&(this.flushPromise=this.drain(),this.flushPromise.catch(()=>{}))}async flush(){let t=this.drain();this.flushPromise=t,await t,this.flushPromise===t&&(this.flushPromise=null)}async drain(){let t=this.flushPromise,r=this.pending.splice(0);this.pendingEntries=0,this.pendingBytes=0,t&&await t,r.length!==0&&await this.doFlush(r)}async doFlush(t){let r=new Map;for(let i of t){let s=r.get(i.filePath);s?s.push(...i.entries):r.set(i.filePath,i.entries.slice())}for(let[i,s]of r)await this.sendWithRetry(i,s)}async sendWithRetry(t,r){let i=this.backoffMs.length+1,s=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${t}`,n,a=1;for(;a<=i;a++)try{await Nn(this.send(t,r),this.sendTimeoutMs,s),n=void 0;break}catch(o){if(n=fl(o),n.message===s)break;let l=this.backoffMs[a-1];if(l===void 0)break;await ed(l)}if(n){We(`[TranscriptMirrorBatcher] flush failed for ${t} after ${a} attempt(s): ${n}`,{level:"error"});try{this.onError?.(t,n)}catch(o){We(`[TranscriptMirrorBatcher] onError callback threw: ${o}`,{level:"error"})}}}},$0=lr(WU(),1),dk="\\p{Default_Ignorable_Code_Point}\\u2800",gl=`\\p{Cc}\\p{Cf}\\p{Cs}\\p{Co}\\p{Cn}\\u2028\\u2029${dk}`,XAe=new RegExp(`[${gl}]+`,"gu"),ov="\\u200D\\uFE0E\\uFE0F",YAe=new RegExp(`(?:(?![${ov}])[${gl}])+`,"gu"),JAe=new RegExp(`(?:(?![${ov}\\n])[${gl}])+`,"gu"),QAe=new RegExp(`(?<!\\S)[${ov}]+`,"gu"),exe=new RegExp(`[\\p{Cf}\\p{Co}\\p{Cn}\\u2028\\u2029\\u007F-\\u009F${dk}]`,"gu");function qae(e){return e.replace(/[\p{Cc}\p{Cf}\u2028\u2029]+/gu," ")}function pk(e){return e.startsWith("\uFEFF")?e.slice(1):e}var dg=class{resolved=new Map;lookup(t){return this.resolved.get(t)}remember(t,r){this.resolved.set(t,r)}forget(t){this.resolved.delete(t)}},Axe=new Nt(()=>new dg);var xxe=Xae(Zae);var Yae=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Jae(e){return typeof e!="string"?null:Yae.test(e)?e:null}async function hk(e,t,r){return Qae(e,t,"w",r)}async function Qae(e,t,r,i){if(i!==void 0&&i.hoverRestOn&&(r==="w"||t.length>0))return eoe(i.source,t,r);let s=Vae(e,{mode:384,flags:r});try{for(let n of t)s.write(JSON.stringify(n)+`
|
|
93
|
+
`)||await j0(s,"drain");s.end(),await j0(s,"finish")}catch(n){throw s.destroy(),n}}async function eoe(e,t,r){let{backend:i,key:s}=e,n=t.map(o=>({data:JSON.stringify(o)+`
|
|
94
|
+
`}));if(r==="w"){let o=await i.replaceRecords(s,n,{publishDiscipline:"inPlace",mode:384});if(!o.ok)throw Error("transcript stream replace failed",{cause:o.error});return}let a=await i.append(s,n);if(!a.ok)throw Error("transcript stream append failed",{cause:a.error})}var kxe=process.platform==="win32"?cc.O_RDONLY:cc.O_RDONLY|cc.O_NOFOLLOW|cc.O_NONBLOCK;var Txe=Buffer.from('"type":"user"'),Rxe=Buffer.from('"type":"assistant"');var F0=200;function toe(e){return Math.abs(x9(e)).toString(36)}function roe(e){return e.replace(/[^a-zA-Z0-9]/g,"-")}function fk(e){let t=roe(e);return t.length<=F0?t:`${t.slice(0,F0)}-${toe(e)}`}function ioe(e){return e4()??fk(e)}var Dxe=Buffer.from('"compact_boundary"');var Ixe=Buffer.from('{"type":"attribution-snapshot"'),Lxe=Buffer.from('{"type":"system"'),soe=10,Pxe=Buffer.from([soe]);function Eu(e,t,r){return r===void 0?e:{...e,[t]:r}}function noe(e,t,r,i){let s=Eu({namespace:"transcript",projectKey:e,sessionId:t},"agentId",r);return Eu(s,"agentRelPath",i)}function aoe(e,t,r){let i=Eu({namespace:"log",sessionId:e,channel:t},"agentId",r?.agentId);return Eu(i,"runId",r?.runId)}var wu={transcript:noe,journal:(e,t,r)=>({namespace:"transcript",projectKey:e,sessionId:t,agentRelPath:r,journal:!0}),sessionJournal:(e,t,r)=>({namespace:"transcript",projectKey:e,sessionId:t,sessionJournal:r}),history:()=>({namespace:"history"}),log:aoe,globalConfig:()=>({namespace:"globalConfig"}),globalConfigCopy:(e,t)=>({namespace:"globalConfig",kind:e,stamp:t}),userSettings:()=>({namespace:"settings",layer:"user"}),projectSettings:e=>({namespace:"settings",layer:"project",projectKey:e}),localSettings:e=>({namespace:"settings",layer:"local",consentRootKey:e}),task:(e,t)=>({namespace:"task",listId:e,taskId:t}),taskListMeta:e=>({namespace:"task",listId:e,meta:!0}),taskListHighWaterMark:e=>({namespace:"task",listId:e,highWaterMark:!0}),memory:(e,t)=>({namespace:"memory",projectKey:e,relPath:t}),pluginRegistry:e=>({namespace:"pluginRegistry",file:e}),marketplaceCache:(e,t)=>({namespace:"marketplaceCache",marketplace:e,form:t}),marketplaceTree:(e,t)=>({namespace:"marketplaceCache",marketplace:e,relPath:t}),pluginCache:(e,t,r,i)=>({namespace:"pluginCache",marketplace:e,plugin:t,version:r,relPath:i}),cache:(e,t)=>({namespace:"cache",store:e,id:t}),paste:e=>({namespace:"paste",id:e}),state:e=>({namespace:"state",id:e}),pluginAssetCache:e=>({namespace:"pluginAssetCache",digest:e}),plan:e=>({namespace:"plan",name:e}),daemon:e=>({namespace:"daemon",relPath:e}),feedbackDraft:e=>({namespace:"feedbackDraft",draftId:e}),agentMemory:(e,t)=>({namespace:"agentMemory",layer:"user",agentType:e,relPath:t}),identity:()=>({namespace:"identity"}),team:e=>({namespace:"team",team:e}),sidecar:(e,t,r)=>({namespace:"sidecar",projectKey:e,sessionId:t,relPath:r}),mailbox:(e,t)=>({namespace:"mailbox",team:e,teammate:t}),scratch:(e,t)=>({namespace:"scratch",sessionId:e,relPath:t}),userConfigDir:(e,t)=>({namespace:"userConfigDir",dir:e,relPath:t}),fileHistory:(e,t)=>({namespace:"fileHistory",sessionId:e,backupFileName:t}),job:(e,t)=>({namespace:"job",jobId:e,relPath:t}),jobTimeline:e=>({namespace:"jobTimeline",jobId:e}),recording:(e,t,r)=>({namespace:"recording",projectKey:e,sessionId:t,stamp:r}),sessionLog:(e,t,r)=>({namespace:"sessionLog",projectKey:e,year:t.year,month:t.month,day:t.day,logName:r}),jobPins:()=>({namespace:"jobsRoot",file:"pins"}),jobDraft:e=>({namespace:"jobsRoot",draftKey:e}),session:e=>({namespace:"session",file:e}),bridgePointer:e=>({namespace:"bridgePointer",projectKey:e}),sessionAliases:e=>({namespace:"sessionAliases",projectKey:e}),dirSyncRecord:(e,t)=>({namespace:"dirSyncRecord",projectKey:e,sessionId:t})};function lv(e){return ooe("sha256").update(e).digest("hex")}var pg=class{available=void 0;probing=void 0;procUnreadableLogged=!1},zxe=new Nt(()=>new pg);var mk=["commands","agents","output-styles","skills","workflows","routines","themes","rules","session-env","uploads","mcp-skill-archives","usage-data","mcp-discovery-cache"],Wxe=new Set(mk),Kxe=`must be one of the userConfigDir directory names (${mk.join(", ")})`,gk=["installed","marketplaces","flagged","catalog","inUseSweep"],Gxe=new Set(gk),qxe=`must be one of the pluginRegistry files (${gk.join(", ")})`,_k=["manifest","catalog"],Vxe=new Set(_k),Zxe=`must be one of the marketplaceCache forms (${_k.join(", ")})`,vk=["world"],Xxe=new Set(vk),Yxe=`must be one of the session journal names (${vk.join(", ")})`;var yk=["backup","corrupted"],Jxe=new Set(yk),Qxe=`must be one of the global-config copy kinds (${yk.join(", ")})`;var loe="cloud-snapshots",coe=new Set(["memory","tiny_memory","bagel",loe,"bridge-pointer.json",".session-aliases"]);var bk=".cast",eke=`<stamp>${bk} inside a session's folder is that session's terminal recording stream: address it as keys.recording(projectKey, sessionId, stamp)`;var uoe=[".ccr-tip.json",".precompact.json",bk],tke=`must not end with ${uoe.join(", ")}: those name a session's project-level sibling files`;var doe=".dir-sync.json",rke=`must not end with ${doe}: that names a cloud session's directory-sync record at the project level`;var ike=`${[...coe].join(", ")} are reserved: they name project-level entries, not sessions`;var poe="timeline.jsonl",ske=`${poe} is the job's timeline stream: address it as keys.jobTimeline(jobId)`;var hg=class{projectDirCache=new Map;agentTranscriptSubdirs=new Map;cacheProjectDir(t,r){this.projectDirCache.set(t,r)}clearProjectDirCache(){this.projectDirCache.clear()}setAgentTranscriptSubdir(t,r){this.agentTranscriptSubdirs.set(t,r)}clearAgentTranscriptSubdir(t){this.agentTranscriptSubdirs.delete(t)}},mke=new Nt(()=>new hg),B0;function Y(e,t,r){function i(o,l){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),o._zod.traits.has(e))return;o._zod.traits.add(e),t(o,l);let c=a.prototype,u=Object.keys(c);for(let p=0;p<u.length;p++){let h=u[p];h in o||(o[h]=c[h].bind(o))}}let s=r?.Parent??Object;class n extends s{}Object.defineProperty(n,"name",{value:e});function a(o){var l;let c=r?.Parent?new n:this;i(c,o),(l=c._zod).deferred??(l.deferred=[]);for(let u of c._zod.deferred)u();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>r?.Parent&&o instanceof r.Parent?!0:o?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Ji=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Su=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(B0=globalThis).__zod_globalConfig??(B0.__zod_globalConfig={});var Cu=globalThis.__zod_globalConfig;function di(e){return e&&Object.assign(Cu,e),Cu}function Ek(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function H0(e,t="|"){return e.map(r=>Ck(r)).join(t)}function fg(e,t){return typeof t=="bigint"?t.toString():t}function ud(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error("cached value already set")}}}function cv(e){return e==null}function uv(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function hoe(e,t){let r=e/t,i=Math.round(r),s=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<s?0:r-i}var z0=Symbol("evaluating");function Ke(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==z0)return i===void 0&&(i=z0,i=r()),i},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function js(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ss(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function W0(e){return JSON.stringify(e)}function foe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var wk="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var moe=ud(()=>{if(Cu.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});function Jn(e){if(Yo(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Yo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Sk(e){return Jn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var goe=new Set(["string","number","symbol"]);function Qn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gi(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function Ae(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ck(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function _oe(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var voe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function yoe(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=ss(e._zod.def,{get shape(){let n={};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);t[a]&&(n[a]=r.shape[a])}return js(this,"shape",n),n},checks:[]});return gi(e,s)}function boe(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=ss(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);t[a]&&delete n[a]}return js(this,"shape",n),n},checks:[]});return gi(e,s)}function Eoe(e,t){if(!Jn(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let n in t)if(Object.getOwnPropertyDescriptor(s,n)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=ss(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return js(this,"shape",s),s}});return gi(e,i)}function woe(e,t){if(!Jn(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=ss(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return js(this,"shape",i),i}});return gi(e,r)}function Soe(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ss(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return js(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return gi(e,r)}function Coe(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let s=ss(t._zod.def,{get shape(){let n=t._zod.def.shape,a={...n};if(r)for(let o in r){if(!(o in n))throw Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=e?new e({type:"optional",innerType:n[o]}):n[o])}else for(let o in n)a[o]=e?new e({type:"optional",innerType:n[o]}):n[o];return js(this,"shape",a),a},checks:[]});return gi(t,s)}function Ooe(e,t,r){let i=ss(t._zod.def,{get shape(){let s=t._zod.def.shape,n={...s};if(r)for(let a in r){if(!(a in n))throw Error(`Unrecognized key: "${a}"`);r[a]&&(n[a]=new e({type:"nonoptional",innerType:s[a]}))}else for(let a in s)n[a]=new e({type:"nonoptional",innerType:s[a]});return js(this,"shape",n),n}});return gi(t,i)}function _n(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Aoe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function vn(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function uc(e){return typeof e=="string"?e:e?.message}function Ti(e,t,r){let i=e.message?e.message:uc(e.inst?._zod.def?.error?.(e))??uc(t?.error?.(e))??uc(r.customError?.(e))??uc(r.localeError?.(e))??"Invalid input",{inst:s,continue:n,input:a,...o}=e;return o.path??(o.path=[]),o.message=i,t?.reportInput&&(o.input=a),o}function dv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xoe(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Jo(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}var Ok=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ak=Y("$ZodError",Ok),dd=Y("$ZodError",Ok,{Parent:Error});function koe(e,t=r=>r.message){let r={},i=[];for(let s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):i.push(t(s));return{formErrors:i,fieldErrors:r}}function Toe(e,t=r=>r.message){let r={_errors:[]},i=(s,n=[])=>{for(let a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>i({issues:o},[...n,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...n,...a.path]);else{let o=[...n,...a.path];if(o.length===0)r._errors.push(t(a));else{let l=r,c=0;for(;c<o.length;){let u=o[c];c!==o.length-1?l[u]=l[u]||{_errors:[]}:(l[u]=l[u]||{_errors:[]},l[u]._errors.push(t(a))),l=l[u],c++}}}};return i(e),r}var pd=e=>(t,r,i,s)=>{let n=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new Ji;if(a.issues.length){let o=new(s?.Err??e)(a.issues.map(l=>Ti(l,n,di())));throw wk(o,s?.callee),o}return a.value},Roe=pd(dd),hd=e=>async(t,r,i,s)=>{let n=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise&&(a=await a),a.issues.length){let o=new(s?.Err??e)(a.issues.map(l=>Ti(l,n,di())));throw wk(o,s?.callee),o}return a.value},Doe=hd(dd),fd=e=>(t,r,i)=>{let s=i?{...i,async:!1}:{async:!1},n=t._zod.run({value:r,issues:[]},s);if(n instanceof Promise)throw new Ji;return n.issues.length?{success:!1,error:new(e??Ak)(n.issues.map(a=>Ti(a,s,di())))}:{success:!0,data:n.value}},xk=fd(dd),md=e=>async(t,r,i)=>{let s=i?{...i,async:!0}:{async:!0},n=t._zod.run({value:r,issues:[]},s);return n instanceof Promise&&(n=await n),n.issues.length?{success:!1,error:new e(n.issues.map(a=>Ti(a,s,di())))}:{success:!0,data:n.value}},kk=md(dd),Ioe=e=>(t,r,i)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return pd(e)(t,r,s)},Loe=e=>(t,r,i)=>pd(e)(t,r,i),Poe=e=>async(t,r,i)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return hd(e)(t,r,s)},Noe=e=>async(t,r,i)=>hd(e)(t,r,i),Moe=e=>(t,r,i)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return fd(e)(t,r,s)},Uoe=e=>(t,r,i)=>fd(e)(t,r,i),$oe=e=>async(t,r,i)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return md(e)(t,r,s)},joe=e=>async(t,r,i)=>md(e)(t,r,i),Foe=/^[cC][0-9a-z]{6,}$/,Boe=/^[0-9a-z]+$/,Hoe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zoe=/^[0-9a-vA-V]{20}$/,Woe=/^[A-Za-z0-9]{27}$/,Koe=/^[a-zA-Z0-9_-]{21}$/,Goe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qoe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,K0=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Voe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Zoe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Xoe(){return new RegExp(Zoe,"u")}var Yoe=/^(?:(?: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])$/,Joe=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Qoe=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,ele=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tle=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Tk=/^[A-Za-z0-9_-]*$/,rle=/^https?$/,ile=/^\+[1-9]\d{6,14}$/,Rk="(?:(?:\\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])))",sle=new RegExp(`^${Rk}$`);function Dk(e){return typeof e.precision=="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function nle(e){return new RegExp(`^${Dk(e)}$`)}function ale(e){let t=Dk({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${Rk}T(?:${i})$`)}var ole=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},lle=/^-?\d+$/,Ik=/^-?\d+(?:\.\d+)?$/,cle=/^(?:true|false)$/i,ule=/^null$/i,dle=/^undefined$/i,ple=/^[^A-Z]*$/,hle=/^[^a-z]*$/,mr=Y("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Lk={number:"number",bigint:"bigint",object:"date"},Pk=Y("$ZodCheckLessThan",(e,t)=>{mr.init(e,t);let r=Lk[typeof t.value];e._zod.onattach.push(i=>{let s=i._zod.bag,n=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<n&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nk=Y("$ZodCheckGreaterThan",(e,t)=>{mr.init(e,t);let r=Lk[typeof t.value];e._zod.onattach.push(i=>{let s=i._zod.bag,n=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>n&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fle=Y("$ZodCheckMultipleOf",(e,t)=>{mr.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):hoe(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),mle=Y("$ZodCheckNumberFormat",(e,t)=>{mr.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[s,n]=voe[t.format];e._zod.onattach.push(a=>{let o=a._zod.bag;o.format=t.format,o.minimum=s,o.maximum=n,r&&(o.pattern=lle)}),e._zod.check=a=>{let o=a.value;if(r){if(!Number.isInteger(o)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}o<s&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>n&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),gle=Y("$ZodCheckMaxLength",(e,t)=>{var r;mr.init(e,t),(r=e._zod.def).when??(r.when=i=>{let s=i.value;return!cv(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{let s=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let s=i.value;if(s.length<=t.maximum)return;let n=dv(s);i.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),_le=Y("$ZodCheckMinLength",(e,t)=>{var r;mr.init(e,t),(r=e._zod.def).when??(r.when=i=>{let s=i.value;return!cv(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{let s=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let s=i.value;if(s.length>=t.minimum)return;let n=dv(s);i.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),vle=Y("$ZodCheckLengthEquals",(e,t)=>{var r;mr.init(e,t),(r=e._zod.def).when??(r.when=i=>{let s=i.value;return!cv(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{let s=i._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=i=>{let s=i.value,n=s.length;if(n===t.length)return;let a=dv(s),o=n>t.length;i.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),gd=Y("$ZodCheckStringFormat",(e,t)=>{var r,i;mr.init(e,t),e._zod.onattach.push(s=>{let n=s._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),yle=Y("$ZodCheckRegex",(e,t)=>{gd.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ble=Y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ple),gd.init(e,t)}),Ele=Y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=hle),gd.init(e,t)}),wle=Y("$ZodCheckIncludes",(e,t)=>{mr.init(e,t);let r=Qn(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(s=>{let n=s._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Sle=Y("$ZodCheckStartsWith",(e,t)=>{mr.init(e,t);let r=new RegExp(`^${Qn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Cle=Y("$ZodCheckEndsWith",(e,t)=>{mr.init(e,t);let r=new RegExp(`.*${Qn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),Ole=Y("$ZodCheckOverwrite",(e,t)=>{mr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),mg=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
|
|
95
|
+
`).filter(n=>n),i=Math.min(...r.map(n=>n.length-n.trimStart().length)),s=r.map(n=>n.slice(i)).map(n=>" ".repeat(this.indent*2)+n);for(let n of s)this.content.push(n)}compile(){let t=Function,r=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,i.join(`
|
|
96
|
+
`))}},Ale={major:4,minor:4,patch:3},tt=Y("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ale;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let s of i)for(let n of s._zod.onattach)n(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(a,o,l)=>{let c=_n(a),u;for(let p of o){if(p._zod.def.when){if(Aoe(a)||!p._zod.def.when(a))continue}else if(c)continue;let h=a.issues.length,f=p._zod.check(a);if(f instanceof Promise&&l?.async===!1)throw new Ji;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,a.issues.length!==h&&(c||(c=_n(a,h)))});else{if(a.issues.length===h)continue;c||(c=_n(a,h))}}return u?u.then(()=>a):a},n=(a,o,l)=>{if(_n(a))return a.aborted=!0,a;let c=s(o,i,l);if(c instanceof Promise){if(l.async===!1)throw new Ji;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if(o.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return c instanceof Promise?c.then(u=>n(u,a,o)):n(c,a,o)}let l=e._zod.parse(a,o);if(l instanceof Promise){if(o.async===!1)throw new Ji;return l.then(c=>s(c,i,o))}return s(l,i,o)}}Ke(e,"~standard",()=>({validate:s=>{try{let n=xk(e,s);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return kk(e,s).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),pv=Y("$ZodString",(e,t)=>{tt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ole(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),pt=Y("$ZodStringFormat",(e,t)=>{gd.init(e,t),pv.init(e,t)}),xle=Y("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=qoe),pt.init(e,t)}),kle=Y("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=K0(r))}else t.pattern??(t.pattern=K0());pt.init(e,t)}),Tle=Y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Voe),pt.init(e,t)}),Rle=Y("$ZodURL",(e,t)=>{pt.init(e,t),e._zod.check=r=>{try{let i=r.value.trim();if(!t.normalize&&t.protocol?.source===rle.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let s=new URL(i);t.hostname&&(t.hostname.lastIndex=0,!t.hostname.test(s.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,!t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=s.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Dle=Y("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Xoe()),pt.init(e,t)}),Ile=Y("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Koe),pt.init(e,t)}),Lle=Y("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Foe),pt.init(e,t)}),Ple=Y("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Boe),pt.init(e,t)}),Nle=Y("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Hoe),pt.init(e,t)}),Mle=Y("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zoe),pt.init(e,t)}),Ule=Y("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Woe),pt.init(e,t)}),$le=Y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ale(t)),pt.init(e,t)}),jle=Y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=sle),pt.init(e,t)}),Fle=Y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=nle(t)),pt.init(e,t)}),Ble=Y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Goe),pt.init(e,t)}),Hle=Y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Yoe),pt.init(e,t),e._zod.bag.format="ipv4"}),zle=Y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Joe),pt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Wle=Y("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Qoe),pt.init(e,t)}),Kle=Y("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ele),pt.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw Error();let[s,n]=i;if(!n)throw Error();let a=Number(n);if(`${a}`!==n||a<0||a>128)throw Error();new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Mk(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Gle=Y("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tle),pt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Mk(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function qle(e){if(!Tk.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Mk(r)}var Vle=Y("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Tk),pt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{qle(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Zle=Y("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ile),pt.init(e,t)});function Xle(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let s=JSON.parse(atob(i));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}var Yle=Y("$ZodJWT",(e,t)=>{pt.init(e,t),e._zod.check=r=>{Xle(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Uk=Y("$ZodNumber",(e,t)=>{tt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ik,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let s=r.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return r;let n=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...n?{received:n}:{}}),r}}),Jle=Y("$ZodNumberFormat",(e,t)=>{mle.init(e,t),Uk.init(e,t)}),Qle=Y("$ZodBoolean",(e,t)=>{tt.init(e,t),e._zod.pattern=cle,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),ece=Y("$ZodUndefined",(e,t)=>{tt.init(e,t),e._zod.pattern=dle,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{let s=r.value;return typeof s>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:s,inst:e}),r}}),tce=Y("$ZodNull",(e,t)=>{tt.init(e,t),e._zod.pattern=ule,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let s=r.value;return s===null||r.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),r}}),rce=Y("$ZodUnknown",(e,t)=>{tt.init(e,t),e._zod.parse=r=>r}),ice=Y("$ZodNever",(e,t)=>{tt.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function G0(e,t,r){e.issues.length&&t.issues.push(...vn(r,e.issues)),t.value[r]=e.value}var sce=Y("$ZodArray",(e,t)=>{tt.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);let n=[];for(let a=0;a<s.length;a++){let o=s[a],l=t.element._zod.run({value:o,issues:[]},i);l instanceof Promise?n.push(l.then(c=>G0(c,r,a))):G0(l,r,a)}return n.length?Promise.all(n).then(()=>r):r}});function Ou(e,t,r,i,s,n){let a=r in i;if(e.issues.length){if(s&&n&&!a)return;t.issues.push(...vn(r,e.issues))}if(!a&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function $k(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${i}": expected a Zod schema`);let r=_oe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function jk(e,t,r,i,s,n){let a=[],o=s.keySet,l=s.catchall._zod,c=l.def.type,u=l.optin==="optional",p=l.optout==="optional";for(let h in t){if(h==="__proto__"||o.has(h))continue;if(c==="never"){a.push(h);continue}let f=l.run({value:t[h],issues:[]},i);f instanceof Promise?e.push(f.then(_=>Ou(_,r,h,t,u,p))):Ou(f,r,h,t,u,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:n}),e.length?Promise.all(e).then(()=>r):r}var Fk=Y("$ZodObject",(e,t)=>{if(tt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let o={...a};return Object.defineProperty(t,"shape",{value:o}),o}})}let r=ud(()=>$k(t));Ke(e._zod,"propValues",()=>{let a=t.shape,o={};for(let l in a){let c=a[l]._zod;if(c.values){o[l]??(o[l]=new Set);for(let u of c.values)o[l].add(u)}}return o});let i=Yo,s=t.catchall,n;e._zod.parse=(a,o)=>{n??(n=r.value);let l=a.value;if(!i(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};let c=[],u=n.shape;for(let p of n.keys){let h=u[p],f=h._zod.optin==="optional",_=h._zod.optout==="optional",v=h._zod.run({value:l[p],issues:[]},o);v instanceof Promise?c.push(v.then(E=>Ou(E,a,p,l,f,_))):Ou(v,a,p,l,f,_)}return s?jk(c,l,a,o,r.value,e):c.length?Promise.all(c).then(()=>a):a}}),nce=Y("$ZodObjectJIT",(e,t)=>{Fk.init(e,t);let r=e._zod.parse,i=ud(()=>$k(t)),s=p=>{let h=new mg(["shape","payload","ctx"]),f=i.value,_=m=>{let g=W0(m);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};h.write("const input = payload.value;");let v=Object.create(null),E=0;for(let m of f.keys)v[m]=`key_${E++}`;h.write("const newResult = {};");for(let m of f.keys){let g=v[m],b=W0(m),C=p[m],A=C?._zod?.optin==="optional",w=C?._zod?.optout==="optional";h.write(`const ${g} = ${_(m)};`),A&&w?h.write(`
|
|
97
|
+
if (${g}.issues.length) {
|
|
98
|
+
if (${b} in input) {
|
|
99
|
+
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
100
|
+
...iss,
|
|
101
|
+
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
102
|
+
})));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (${g}.value === undefined) {
|
|
107
|
+
if (${b} in input) {
|
|
108
|
+
newResult[${b}] = undefined;
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
newResult[${b}] = ${g}.value;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
`):A?h.write(`
|
|
115
|
+
if (${g}.issues.length) {
|
|
116
|
+
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
117
|
+
...iss,
|
|
118
|
+
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
119
|
+
})));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (${g}.value === undefined) {
|
|
123
|
+
if (${b} in input) {
|
|
124
|
+
newResult[${b}] = undefined;
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
newResult[${b}] = ${g}.value;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
`):h.write(`
|
|
131
|
+
const ${g}_present = ${b} in input;
|
|
132
|
+
if (${g}.issues.length) {
|
|
133
|
+
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
134
|
+
...iss,
|
|
135
|
+
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
136
|
+
})));
|
|
137
|
+
}
|
|
138
|
+
if (!${g}_present && !${g}.issues.length) {
|
|
139
|
+
payload.issues.push({
|
|
140
|
+
code: "invalid_type",
|
|
141
|
+
expected: "nonoptional",
|
|
142
|
+
input: undefined,
|
|
143
|
+
path: [${b}]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (${g}_present) {
|
|
148
|
+
if (${g}.value === undefined) {
|
|
149
|
+
newResult[${b}] = undefined;
|
|
150
|
+
} else {
|
|
151
|
+
newResult[${b}] = ${g}.value;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");let y=h.compile();return(m,g)=>y(p,m,g)},n,a=Yo,o=!Cu.jitless,l=o&&moe.value,c=t.catchall,u;e._zod.parse=(p,h)=>{u??(u=i.value);let f=p.value;return a(f)?o&&l&&h?.async===!1&&h.jitless!==!0?(n||(n=s(t.shape)),p=n(p,h),c?jk([],f,p,h,u,e):p):r(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),p)}});function q0(e,t,r,i){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let s=e.filter(n=>!_n(n));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(a=>Ti(a,i,di())))}),t)}var Bk=Y("$ZodUnion",(e,t)=>{tt.init(e,t),Ke(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ke(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ke(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Ke(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>uv(s.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,s)=>{if(r)return r(i,s);let n=!1,a=[];for(let o of t.options){let l=o._zod.run({value:i.value,issues:[]},s);if(l instanceof Promise)a.push(l),n=!0;else{if(l.issues.length===0)return l;a.push(l)}}return n?Promise.all(a).then(o=>q0(o,i,e,s)):q0(a,i,e,s)}}),ace=Y("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Bk.init(e,t);let r=e._zod.parse;Ke(e._zod,"propValues",()=>{let s={};for(let n of t.options){let a=n._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[o,l]of Object.entries(a)){s[o]||(s[o]=new Set);for(let c of l)s[o].add(c)}}return s});let i=ud(()=>{let s=t.options,n=new Map;for(let a of s){let o=a._zod.propValues?.[t.discriminator];if(!o||o.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of o){if(n.has(l))throw Error(`Duplicate discriminator value "${String(l)}"`);n.set(l,a)}}return n});e._zod.parse=(s,n)=>{let a=s.value;if(!Yo(a))return s.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),s;let o=i.value.get(a?.[t.discriminator]);return o?o._zod.run(s,n):t.unionFallback||n.direction==="backward"?r(s,n):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:a,path:[t.discriminator],inst:e}),s)}}),oce=Y("$ZodIntersection",(e,t)=>{tt.init(e,t),e._zod.parse=(r,i)=>{let s=r.value,n=t.left._zod.run({value:s,issues:[]},i),a=t.right._zod.run({value:s,issues:[]},i);return n instanceof Promise||a instanceof Promise?Promise.all([n,a]).then(([o,l])=>V0(r,o,l)):V0(r,n,a)}});function gg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Jn(e)&&Jn(t)){let r=Object.keys(t),i=Object.keys(e).filter(n=>r.indexOf(n)!==-1),s={...e,...t};for(let n of i){let a=gg(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};s[n]=a.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let s=e[i],n=t[i],a=gg(s,n);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function V0(e,t,r){let i=new Map,s;for(let o of t.issues)if(o.code==="unrecognized_keys"){s??(s=o);for(let l of o.keys)i.has(l)||i.set(l,{}),i.get(l).l=!0}else e.issues.push(o);for(let o of r.issues)if(o.code==="unrecognized_keys")for(let l of o.keys)i.has(l)||i.set(l,{}),i.get(l).r=!0;else e.issues.push(o);let n=[...i].filter(([,o])=>o.l&&o.r).map(([o])=>o);if(n.length&&s&&e.issues.push({...s,keys:n}),_n(e))return e;let a=gg(t.value,r.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var lce=Y("$ZodRecord",(e,t)=>{tt.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;if(!Jn(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;let n=[],a=t.keyType._zod.values;if(a){r.value={};let o=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){o.add(typeof c=="number"?c.toString():c);let u=t.keyType._zod.run({value:c,issues:[]},i);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>Ti(f,i,di())),input:c,path:[c],inst:e});continue}let p=u.value,h=t.valueType._zod.run({value:s[c],issues:[]},i);h instanceof Promise?n.push(h.then(f=>{f.issues.length&&r.issues.push(...vn(c,f.issues)),r.value[p]=f.value})):(h.issues.length&&r.issues.push(...vn(c,h.issues)),r.value[p]=h.value)}let l;for(let c in s)o.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{r.value={};for(let o of Reflect.ownKeys(s)){if(o==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,o))continue;let l=t.keyType._zod.run({value:o,issues:[]},i);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof o=="string"&&Ik.test(o)&&l.issues.length){let u=t.keyType._zod.run({value:Number(o),issues:[]},i);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");u.issues.length===0&&(l=u)}if(l.issues.length){t.mode==="loose"?r.value[o]=s[o]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>Ti(u,i,di())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:s[o],issues:[]},i);c instanceof Promise?n.push(c.then(u=>{u.issues.length&&r.issues.push(...vn(o,u.issues)),r.value[l.value]=u.value})):(c.issues.length&&r.issues.push(...vn(o,c.issues)),r.value[l.value]=c.value)}}return n.length?Promise.all(n).then(()=>r):r}}),cce=Y("$ZodEnum",(e,t)=>{tt.init(e,t);let r=Ek(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(s=>goe.has(typeof s)).map(s=>typeof s=="string"?Qn(s):s.toString()).join("|")})$`),e._zod.parse=(s,n)=>{let a=s.value;return i.has(a)||s.issues.push({code:"invalid_value",values:r,input:a,inst:e}),s}}),uce=Y("$ZodLiteral",(e,t)=>{if(tt.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Qn(i):i?Qn(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,s)=>{let n=i.value;return r.has(n)||i.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),i}}),dce=Y("$ZodTransform",(e,t)=>{tt.init(e,t),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Su(e.constructor.name);let s=t.transform(r.value,r);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(n=>(r.value=n,r.fallback=!0,r));if(s instanceof Promise)throw new Ji;return r.value=s,r.fallback=!0,r}});function Z0(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Hk=Y("$ZodOptional",(e,t)=>{tt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ke(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ke(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${uv(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let s=r.value,n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(a=>Z0(a,s)):Z0(n,s)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),pce=Y("$ZodExactOptional",(e,t)=>{Hk.init(e,t),Ke(e._zod,"values",()=>t.innerType._zod.values),Ke(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),hce=Y("$ZodNullable",(e,t)=>{tt.init(e,t),Ke(e._zod,"optin",()=>t.innerType._zod.optin),Ke(e._zod,"optout",()=>t.innerType._zod.optout),Ke(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${uv(r.source)}|null)$`):void 0}),Ke(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),fce=Y("$ZodDefault",(e,t)=>{tt.init(e,t),e._zod.optin="optional",Ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let s=t.innerType._zod.run(r,i);return s instanceof Promise?s.then(n=>X0(n,t)):X0(s,t)}});function X0(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var mce=Y("$ZodPrefault",(e,t)=>{tt.init(e,t),e._zod.optin="optional",Ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),gce=Y("$ZodNonOptional",(e,t)=>{tt.init(e,t),Ke(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let s=t.innerType._zod.run(r,i);return s instanceof Promise?s.then(n=>Y0(n,e)):Y0(s,e)}});function Y0(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var _ce=Y("$ZodCatch",(e,t)=>{tt.init(e,t),e._zod.optin="optional",Ke(e._zod,"optout",()=>t.innerType._zod.optout),Ke(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let s=t.innerType._zod.run(r,i);return s instanceof Promise?s.then(n=>(r.value=n.value,r.issues=n.issues,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(a=>Ti(a,i,di()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=s.value,r.issues=s.issues,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(n=>Ti(n,i,di()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),zk=Y("$ZodPipe",(e,t)=>{tt.init(e,t),Ke(e._zod,"values",()=>t.in._zod.values),Ke(e._zod,"optin",()=>t.in._zod.optin),Ke(e._zod,"optout",()=>t.out._zod.optout),Ke(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let n=t.out._zod.run(r,i);return n instanceof Promise?n.then(a=>dc(a,t.in,i)):dc(n,t.in,i)}let s=t.in._zod.run(r,i);return s instanceof Promise?s.then(n=>dc(n,t.out,i)):dc(s,t.out,i)}});function dc(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var vce=Y("$ZodPreprocess",(e,t)=>{zk.init(e,t)}),yce=Y("$ZodReadonly",(e,t)=>{tt.init(e,t),Ke(e._zod,"propValues",()=>t.innerType._zod.propValues),Ke(e._zod,"values",()=>t.innerType._zod.values),Ke(e._zod,"optin",()=>t.innerType?._zod?.optin),Ke(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let s=t.innerType._zod.run(r,i);return s instanceof Promise?s.then(J0):J0(s)}});function J0(e){return e.value=Object.freeze(e.value),e}var bce=Y("$ZodLazy",(e,t)=>{tt.init(e,t),Ke(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),Ke(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ke(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ke(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ke(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),Ece=Y("$ZodCustom",(e,t)=>{mr.init(e,t),tt.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,s=t.fn(i);if(s instanceof Promise)return s.then(n=>Q0(n,r,i,e));Q0(s,r,i,e)}});function Q0(e,t,r,i){if(!e){let s={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(s.params=i._zod.def.params),t.issues.push(Jo(s))}}var wce=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return s=>{switch(s.code){case"invalid_type":{let n=i[s.expected]??s.expected,a=xoe(s.input),o=i[a]??a;return`Invalid input: expected ${n}, received ${o}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${Ck(s.values[0])}`:`Invalid option: expected one of ${H0(s.values,"|")}`;case"too_big":{let n=s.inclusive?"<=":"<",a=t(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${n}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${n}${s.maximum.toString()}`}case"too_small":{let n=s.inclusive?">=":">",a=t(s.origin);return a?`Too small: expected ${s.origin} to have ${n}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${n}${s.minimum.toString()}`}case"invalid_format":{let n=s;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${r[n.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${H0(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(n=>`'${n}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function Sce(){return{localeError:wce()}}var ew;var _g=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let s={...i,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Cce(){return new _g}(ew=globalThis).__zod_globalRegistry??(ew.__zod_globalRegistry=Cce());var po=globalThis.__zod_globalRegistry;function Oce(e,t){return new e({type:"string",...Ae(t)})}function Ace(e,t){return new e({type:"string",coerce:!0,...Ae(t)})}function xce(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ae(t)})}function tw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(t)})}function kce(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(t)})}function Tce(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(t)})}function Rce(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(t)})}function Dce(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(t)})}function Ice(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ae(t)})}function Lce(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(t)})}function Pce(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(t)})}function Nce(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(t)})}function Mce(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(t)})}function Uce(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(t)})}function $ce(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(t)})}function jce(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(t)})}function Fce(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(t)})}function Bce(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(t)})}function Hce(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(t)})}function zce(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(t)})}function Wce(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(t)})}function Kce(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(t)})}function Gce(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(t)})}function qce(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(t)})}function Vce(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(t)})}function Zce(e,t){return new e({type:"string",format:"date",check:"string_format",...Ae(t)})}function Xce(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ae(t)})}function Yce(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ae(t)})}function Jce(e,t){return new e({type:"number",checks:[],...Ae(t)})}function Qce(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(t)})}function eue(e,t){return new e({type:"boolean",...Ae(t)})}function tue(e,t){return new e({type:"undefined",...Ae(t)})}function rue(e,t){return new e({type:"null",...Ae(t)})}function iue(e){return new e({type:"unknown"})}function sue(e,t){return new e({type:"never",...Ae(t)})}function rw(e,t){return new Pk({check:"less_than",...Ae(t),value:e,inclusive:!1})}function $p(e,t){return new Pk({check:"less_than",...Ae(t),value:e,inclusive:!0})}function iw(e,t){return new Nk({check:"greater_than",...Ae(t),value:e,inclusive:!1})}function jp(e,t){return new Nk({check:"greater_than",...Ae(t),value:e,inclusive:!0})}function sw(e,t){return new fle({check:"multiple_of",...Ae(t),value:e})}function Wk(e,t){return new gle({check:"max_length",...Ae(t),maximum:e})}function Au(e,t){return new _le({check:"min_length",...Ae(t),minimum:e})}function Kk(e,t){return new vle({check:"length_equals",...Ae(t),length:e})}function nue(e,t){return new yle({check:"string_format",format:"regex",...Ae(t),pattern:e})}function aue(e){return new ble({check:"string_format",format:"lowercase",...Ae(e)})}function oue(e){return new Ele({check:"string_format",format:"uppercase",...Ae(e)})}function lue(e,t){return new wle({check:"string_format",format:"includes",...Ae(t),includes:e})}function cue(e,t){return new Sle({check:"string_format",format:"starts_with",...Ae(t),prefix:e})}function uue(e,t){return new Cle({check:"string_format",format:"ends_with",...Ae(t),suffix:e})}function _a(e){return new Ole({check:"overwrite",tx:e})}function due(e){return _a(t=>t.normalize(e))}function pue(){return _a(e=>e.trim())}function hue(){return _a(e=>e.toLowerCase())}function fue(){return _a(e=>e.toUpperCase())}function mue(){return _a(e=>foe(e))}function gue(e,t,r){return new e({type:"array",element:t,...Ae(r)})}function _ue(e,t,r){let i=Ae(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function vue(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Ae(r)})}function yue(e,t){let r=bue(i=>(i.addIssue=s=>{if(typeof s=="string")i.issues.push(Jo(s,i.value,r._zod.def));else{let n=s;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=r),n.continue??(n.continue=!r._zod.def.abort),i.issues.push(Jo(n))}},e(i.value,i)),t);return r}function bue(e,t){let r=new mr({check:"custom",...Ae(t)});return r._zod.check=e,r}function Gk(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??po,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function St(e,t,r={path:[],schemaPath:[]}){var i;let s=e._zod.def,n=t.seen.get(e);if(n)return n.count++,r.schemaPath.includes(e)&&(n.cycle=r.path),n.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{let c={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,c);else{let p=a.schema,h=t.processors[s.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,p,c)}let u=e._zod.parent;u&&(a.ref||(a.ref=u),St(u,t,c),t.seen.get(u).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Zt(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function qk(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let a of e.seen.entries()){let o=e.metadataRegistry.get(a[0])?.id;if(o){let l=i.get(o);if(l&&l!==a[0])throw Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(o,a[0])}}let s=a=>{let o=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let u=e.external.registry.get(a[0])?.id,p=e.external.uri??(f=>f);if(u)return{ref:p(u)};let h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${p("__shared")}#/${o}/${h}`}}if(a[1]===r)return{ref:"#"};let l=`#/${o}/`,c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:l+c}},n=a=>{if(a[1].schema.$ref)return;let o=a[1],{ref:l,defId:c}=s(a);o.def={...o.schema},c&&(o.defId=c);let u=o.schema;for(let p in u)delete u[p];u.$ref=l};if(e.cycles==="throw")for(let a of e.seen.entries()){let o=a[1];if(o.cycle)throw Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
|
|
156
|
+
|
|
157
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let o=a[1];if(t===a[0]){n(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(o.cycle){n(a);continue}if(o.count>1&&e.reused==="ref"){n(a);continue}}}function Vk(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let i=o=>{let l=e.seen.get(o);if(l.ref===null)return;let c=l.def??l.schema,u={...c},p=l.ref;if(l.ref=null,p){i(p);let f=e.seen.get(p),_=f.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(_)):Object.assign(c,_),Object.assign(c,u),o._zod.parent===p)for(let v in c)v==="$ref"||v==="allOf"||v in u||delete c[v];if(_.$ref&&f.def)for(let v in c)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(c[v])===JSON.stringify(f.def[v])&&delete c[v]}let h=o._zod.parent;if(h&&h!==p){i(h);let f=e.seen.get(h);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let _ in c)_==="$ref"||_==="allOf"||_ in f.def&&JSON.stringify(c[_])===JSON.stringify(f.def[_])&&delete c[_]}e.override({zodSchema:o,jsonSchema:c,path:l.path??[]})};for(let o of[...e.seen.entries()].reverse())i(o[0]);let s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let o=e.external.registry.get(t)?.id;if(!o)throw Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,r.def??r.schema);let n=e.metadataRegistry.get(t)?.id;n!==void 0&&s.id===n&&delete s.id;let a=e.external?.defs??{};for(let o of e.seen.entries()){let l=o[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?s.$defs=a:s.definitions=a);try{let o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:xu(t,"input",e.processors),output:xu(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw Error("Error converting schema to JSON.")}}function Zt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Zt(i.element,r);if(i.type==="set")return Zt(i.valueType,r);if(i.type==="lazy")return Zt(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Zt(i.innerType,r);if(i.type==="intersection")return Zt(i.left,r)||Zt(i.right,r);if(i.type==="record"||i.type==="map")return Zt(i.keyType,r)||Zt(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Zt(i.in,r)||Zt(i.out,r);if(i.type==="object"){for(let s in i.shape)if(Zt(i.shape[s],r))return!0;return!1}if(i.type==="union"){for(let s of i.options)if(Zt(s,r))return!0;return!1}if(i.type==="tuple"){for(let s of i.items)if(Zt(s,r))return!0;return!!(i.rest&&Zt(i.rest,r))}return!1}var Eue=(e,t={})=>r=>{let i=Gk({...r,processors:t});return St(e,i),qk(i,e),Vk(i,e)},xu=(e,t,r={})=>i=>{let{libraryOptions:s,target:n}=i??{},a=Gk({...s??{},target:n,io:t,processors:r});return St(e,a),qk(a,e),Vk(a,e)},wue={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sue=(e,t,r,i)=>{let s=r;s.type="string";let{minimum:n,maximum:a,format:o,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof n=="number"&&(s.minLength=n),typeof a=="number"&&(s.maxLength=a),o&&(s.format=wue[o]??o,s.format===""&&delete s.format,o==="time"&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){let u=[...l];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Cue=(e,t,r,i)=>{let s=r,{minimum:n,maximum:a,format:o,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof o=="string"&&o.includes("int")?s.type="integer":s.type="number";let p=typeof u=="number"&&u>=(n??Number.NEGATIVE_INFINITY),h=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";p?f?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u:typeof n=="number"&&(s.minimum=n),h?f?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof a=="number"&&(s.maximum=a),typeof l=="number"&&(s.multipleOf=l)},Oue=(e,t,r,i)=>{r.type="boolean"};var Aue=(e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},xue=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")};var kue=(e,t,r,i)=>{r.not={}};var Tue=(e,t,r,i)=>{};var Rue=(e,t,r,i)=>{let s=e._zod.def,n=Ek(s.entries);n.every(a=>typeof a=="number")&&(r.type="number"),n.every(a=>typeof a=="string")&&(r.type="string"),r.enum=n},Due=(e,t,r,i)=>{let s=e._zod.def,n=[];for(let a of s.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else n.every(a=>typeof a=="number")&&(r.type="number"),n.every(a=>typeof a=="string")&&(r.type="string"),n.every(a=>typeof a=="boolean")&&(r.type="boolean"),n.every(a=>a===null)&&(r.type="null"),r.enum=n};var Iue=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")};var Lue=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")};var Pue=(e,t,r,i)=>{let s=r,n=e._zod.def,{minimum:a,maximum:o}=e._zod.bag;typeof a=="number"&&(s.minItems=a),typeof o=="number"&&(s.maxItems=o),s.type="array",s.items=St(n.element,t,{...i,path:[...i.path,"items"]})},Nue=(e,t,r,i)=>{let s=r,n=e._zod.def;s.type="object",s.properties={};let a=n.shape;for(let c in a)s.properties[c]=St(a[c],t,{...i,path:[...i.path,"properties",c]});let o=new Set(Object.keys(a)),l=new Set([...o].filter(c=>{let u=n.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(s.required=Array.from(l)),n.catchall?._zod.def.type==="never"?s.additionalProperties=!1:n.catchall?n.catchall&&(s.additionalProperties=St(n.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},Mue=(e,t,r,i)=>{let s=e._zod.def,n=s.inclusive===!1,a=s.options.map((o,l)=>St(o,t,{...i,path:[...i.path,n?"oneOf":"anyOf",l]}));n?r.oneOf=a:r.anyOf=a},Uue=(e,t,r,i)=>{let s=e._zod.def,n=St(s.left,t,{...i,path:[...i.path,"allOf",0]}),a=St(s.right,t,{...i,path:[...i.path,"allOf",1]}),o=c=>"allOf"in c&&Object.keys(c).length===1,l=[...o(n)?n.allOf:[n],...o(a)?a.allOf:[a]];r.allOf=l};var $ue=(e,t,r,i)=>{let s=r,n=e._zod.def;s.type="object";let a=n.keyType,o=a._zod.bag?.patterns;if(n.mode==="loose"&&o&&o.size>0){let c=St(n.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});s.patternProperties={};for(let u of o)s.patternProperties[u.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=St(n.keyType,t,{...i,path:[...i.path,"propertyNames"]})),s.additionalProperties=St(n.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let l=a._zod.values;if(l){let c=[...l].filter(u=>typeof u=="string"||typeof u=="number");c.length>0&&(s.required=c)}},jue=(e,t,r,i)=>{let s=e._zod.def,n=St(s.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=s.innerType,r.nullable=!0):r.anyOf=[n,{type:"null"}]},Fue=(e,t,r,i)=>{let s=e._zod.def;St(s.innerType,t,i);let n=t.seen.get(e);n.ref=s.innerType},Bue=(e,t,r,i)=>{let s=e._zod.def;St(s.innerType,t,i);let n=t.seen.get(e);n.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},Hue=(e,t,r,i)=>{let s=e._zod.def;St(s.innerType,t,i);let n=t.seen.get(e);n.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},zue=(e,t,r,i)=>{let s=e._zod.def;St(s.innerType,t,i);let n=t.seen.get(e);n.ref=s.innerType;let a;try{a=s.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Wue=(e,t,r,i)=>{let s=e._zod.def,n=s.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?n?s.out:s.in:s.out;St(a,t,i);let o=t.seen.get(e);o.ref=a},Kue=(e,t,r,i)=>{let s=e._zod.def;St(s.innerType,t,i);let n=t.seen.get(e);n.ref=s.innerType,r.readOnly=!0};var Zk=(e,t,r,i)=>{let s=e._zod.def;St(s.innerType,t,i);let n=t.seen.get(e);n.ref=s.innerType},Gue=(e,t,r,i)=>{let s=e._zod.innerType;St(s,t,i);let n=t.seen.get(e);n.ref=s};var que=Y("ZodISODateTime",(e,t)=>{$le.init(e,t),_t.init(e,t)});function Xk(e){return Vce(que,e)}var Vue=Y("ZodISODate",(e,t)=>{jle.init(e,t),_t.init(e,t)});function Zue(e){return Zce(Vue,e)}var Xue=Y("ZodISOTime",(e,t)=>{Fle.init(e,t),_t.init(e,t)});function Yue(e){return Xce(Xue,e)}var Jue=Y("ZodISODuration",(e,t)=>{Ble.init(e,t),_t.init(e,t)});function Que(e){return Yce(Jue,e)}var ede=(e,t)=>{Ak.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Toe(e,r)},flatten:{value:r=>koe(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,fg,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,fg,2)}},isEmpty:{get(){return e.issues.length===0}}})},Br=Y("ZodError",ede,{Parent:Error}),tde=pd(Br),rde=hd(Br),ide=fd(Br),sde=md(Br),nde=Ioe(Br),ade=Loe(Br),ode=Poe(Br),lde=Noe(Br),cde=Moe(Br),ude=Uoe(Br),dde=$oe(Br),pde=joe(Br),nw=new WeakMap;function _l(e,t,r){let i=Object.getPrototypeOf(e),s=nw.get(i);if(s||(s=new Set,nw.set(i,s)),!s.has(t)){s.add(t);for(let n in r){let a=r[n];Object.defineProperty(i,n,{configurable:!0,enumerable:!1,get(){let o=a.bind(this);return Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}var ot=Y("ZodType",(e,t)=>(tt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:xu(e,"input"),output:xu(e,"output")}}),e.toJSONSchema=Eue(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,i)=>tde(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>ide(e,r,i),e.parseAsync=async(r,i)=>rde(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>sde(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>nde(e,r,i),e.decode=(r,i)=>ade(e,r,i),e.encodeAsync=async(r,i)=>ode(e,r,i),e.decodeAsync=async(r,i)=>lde(e,r,i),e.safeEncode=(r,i)=>cde(e,r,i),e.safeDecode=(r,i)=>ude(e,r,i),e.safeEncodeAsync=async(r,i)=>dde(e,r,i),e.safeDecodeAsync=async(r,i)=>pde(e,r,i),_l(e,"ZodType",{check(...r){let i=this.def;return this.clone(ss(i,{checks:[...i.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return gi(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(spe(r,i))},superRefine(r,i){return this.check(npe(r,i))},overwrite(r){return this.check(_a(r))},optional(){return mt(this)},exactOptional(){return Wde(this)},nullable(){return cw(this)},nullish(){return mt(cw(this))},nonoptional(r){return Xde(this,r)},array(){return X(this)},or(r){return Re([this,r])},and(r){return fv(this,r)},transform(r){return uw(this,iT(r))},default(r){return qde(this,r)},prefault(r){return Zde(this,r)},catch(r){return Jde(this,r)},pipe(r){return uw(this,r)},readonly(){return tpe(this)},describe(r){let i=this.clone();return po.add(i,{description:r}),i},meta(...r){if(r.length===0)return po.get(this);let i=this.clone();return po.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return po.get(e)?.description},configurable:!0}),e)),Yk=Y("_ZodString",(e,t)=>{pv.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(i,s,n)=>Sue(e,i,s,n);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,_l(e,"_ZodString",{regex(...i){return this.check(nue(...i))},includes(...i){return this.check(lue(...i))},startsWith(...i){return this.check(cue(...i))},endsWith(...i){return this.check(uue(...i))},min(...i){return this.check(Au(...i))},max(...i){return this.check(Wk(...i))},length(...i){return this.check(Kk(...i))},nonempty(...i){return this.check(Au(1,...i))},lowercase(i){return this.check(aue(i))},uppercase(i){return this.check(oue(i))},trim(){return this.check(pue())},normalize(...i){return this.check(due(...i))},toLowerCase(){return this.check(hue())},toUpperCase(){return this.check(fue())},slugify(){return this.check(mue())}})}),Jk=Y("ZodString",(e,t)=>{pv.init(e,t),Yk.init(e,t),e.email=r=>e.check(xce(hde,r)),e.url=r=>e.check(Ice(fde,r)),e.jwt=r=>e.check(qce(Tde,r)),e.emoji=r=>e.check(Lce(mde,r)),e.guid=r=>e.check(tw(aw,r)),e.uuid=r=>e.check(kce(pc,r)),e.uuidv4=r=>e.check(Tce(pc,r)),e.uuidv6=r=>e.check(Rce(pc,r)),e.uuidv7=r=>e.check(Dce(pc,r)),e.nanoid=r=>e.check(Pce(gde,r)),e.guid=r=>e.check(tw(aw,r)),e.cuid=r=>e.check(Nce(_de,r)),e.cuid2=r=>e.check(Mce(vde,r)),e.ulid=r=>e.check(Uce(yde,r)),e.base64=r=>e.check(Wce(Ade,r)),e.base64url=r=>e.check(Kce(xde,r)),e.xid=r=>e.check($ce(bde,r)),e.ksuid=r=>e.check(jce(Ede,r)),e.ipv4=r=>e.check(Fce(wde,r)),e.ipv6=r=>e.check(Bce(Sde,r)),e.cidrv4=r=>e.check(Hce(Cde,r)),e.cidrv6=r=>e.check(zce(Ode,r)),e.e164=r=>e.check(Gce(kde,r)),e.datetime=r=>e.check(Xk(r)),e.date=r=>e.check(Zue(r)),e.time=r=>e.check(Yue(r)),e.duration=r=>e.check(Que(r))});function O(e){return Oce(Jk,e)}var _t=Y("ZodStringFormat",(e,t)=>{pt.init(e,t),Yk.init(e,t)}),hde=Y("ZodEmail",(e,t)=>{Tle.init(e,t),_t.init(e,t)}),aw=Y("ZodGUID",(e,t)=>{xle.init(e,t),_t.init(e,t)}),pc=Y("ZodUUID",(e,t)=>{kle.init(e,t),_t.init(e,t)}),fde=Y("ZodURL",(e,t)=>{Rle.init(e,t),_t.init(e,t)}),mde=Y("ZodEmoji",(e,t)=>{Dle.init(e,t),_t.init(e,t)}),gde=Y("ZodNanoID",(e,t)=>{Ile.init(e,t),_t.init(e,t)}),_de=Y("ZodCUID",(e,t)=>{Lle.init(e,t),_t.init(e,t)}),vde=Y("ZodCUID2",(e,t)=>{Ple.init(e,t),_t.init(e,t)}),yde=Y("ZodULID",(e,t)=>{Nle.init(e,t),_t.init(e,t)}),bde=Y("ZodXID",(e,t)=>{Mle.init(e,t),_t.init(e,t)}),Ede=Y("ZodKSUID",(e,t)=>{Ule.init(e,t),_t.init(e,t)}),wde=Y("ZodIPv4",(e,t)=>{Hle.init(e,t),_t.init(e,t)}),Sde=Y("ZodIPv6",(e,t)=>{zle.init(e,t),_t.init(e,t)}),Cde=Y("ZodCIDRv4",(e,t)=>{Wle.init(e,t),_t.init(e,t)}),Ode=Y("ZodCIDRv6",(e,t)=>{Kle.init(e,t),_t.init(e,t)}),Ade=Y("ZodBase64",(e,t)=>{Gle.init(e,t),_t.init(e,t)}),xde=Y("ZodBase64URL",(e,t)=>{Vle.init(e,t),_t.init(e,t)}),kde=Y("ZodE164",(e,t)=>{Zle.init(e,t),_t.init(e,t)}),Tde=Y("ZodJWT",(e,t)=>{Yle.init(e,t),_t.init(e,t)}),Qk=Y("ZodNumber",(e,t)=>{Uk.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(i,s,n)=>Cue(e,i,s,n),_l(e,"ZodNumber",{gt(i,s){return this.check(iw(i,s))},gte(i,s){return this.check(jp(i,s))},min(i,s){return this.check(jp(i,s))},lt(i,s){return this.check(rw(i,s))},lte(i,s){return this.check($p(i,s))},max(i,s){return this.check($p(i,s))},int(i){return this.check(ow(i))},safe(i){return this.check(ow(i))},positive(i){return this.check(iw(0,i))},nonnegative(i){return this.check(jp(0,i))},negative(i){return this.check(rw(0,i))},nonpositive(i){return this.check($p(0,i))},multipleOf(i,s){return this.check(sw(i,s))},step(i,s){return this.check(sw(i,s))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Oe(e){return Jce(Qk,e)}var Rde=Y("ZodNumberFormat",(e,t)=>{Jle.init(e,t),Qk.init(e,t)});function ow(e){return Qce(Rde,e)}var Dde=Y("ZodBoolean",(e,t)=>{Qle.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Oue(e,r,i,s)});function G(e){return eue(Dde,e)}var Ide=Y("ZodUndefined",(e,t)=>{ece.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>xue(e,r,i,s)});function lw(e){return tue(Ide,e)}var Lde=Y("ZodNull",(e,t)=>{tce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Aue(e,r,i,s)});function Pde(e){return rue(Lde,e)}var Nde=Y("ZodUnknown",(e,t)=>{rce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Tue(e,r,i,s)});function $e(){return iue(Nde)}var Mde=Y("ZodNever",(e,t)=>{ice.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>kue(e,r,i,s)});function eT(e){return sue(Mde,e)}var Ude=Y("ZodArray",(e,t)=>{sce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Pue(e,r,i,s),e.element=t.element,_l(e,"ZodArray",{min(r,i){return this.check(Au(r,i))},nonempty(r){return this.check(Au(1,r))},max(r,i){return this.check(Wk(r,i))},length(r,i){return this.check(Kk(r,i))},unwrap(){return this.element}})});function X(e,t){return gue(Ude,e,t)}var hv=Y("ZodObject",(e,t)=>{nce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Nue(e,r,i,s),Ke(e,"shape",()=>t.shape),_l(e,"ZodObject",{keyof(){return me(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:$e()})},loose(){return this.clone({...this._zod.def,catchall:$e()})},strict(){return this.clone({...this._zod.def,catchall:eT()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Eoe(this,r)},safeExtend(r){return woe(this,r)},merge(r){return Soe(this,r)},pick(r){return yoe(this,r)},omit(r){return boe(this,r)},partial(...r){return Coe(sT,this,r[0])},required(...r){return Ooe(nT,this,r[0])}})});function B(e,t){let r={type:"object",shape:e??{},...Ae(t)};return new hv(r)}function tT(e,t){return new hv({type:"object",shape:e,catchall:eT(),...Ae(t)})}function Pt(e,t){return new hv({type:"object",shape:e,catchall:$e(),...Ae(t)})}var rT=Y("ZodUnion",(e,t)=>{Bk.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Mue(e,r,i,s),e.options=t.options});function Re(e,t){return new rT({type:"union",options:e,...Ae(t)})}var $de=Y("ZodDiscriminatedUnion",(e,t)=>{rT.init(e,t),ace.init(e,t)});function _d(e,t,r){return new $de({type:"union",options:t,discriminator:e,...Ae(r)})}var jde=Y("ZodIntersection",(e,t)=>{oce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Uue(e,r,i,s)});function fv(e,t){return new jde({type:"intersection",left:e,right:t})}var vg=Y("ZodRecord",(e,t)=>{lce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>$ue(e,r,i,s),e.keyType=t.keyType,e.valueType=t.valueType});function Ee(e,t,r){return!t||!t._zod?new vg({type:"record",keyType:O(),valueType:e,...Ae(t)}):new vg({type:"record",keyType:e,valueType:t,...Ae(r)})}function Fde(e,t,r){let i=gi(e);return i._zod.values=void 0,new vg({type:"record",keyType:i,valueType:t,...Ae(r)})}var yg=Y("ZodEnum",(e,t)=>{cce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(i,s,n)=>Rue(e,i,s,n),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,s)=>{let n={};for(let a of i)if(r.has(a))n[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new yg({...t,checks:[],...Ae(s),entries:n})},e.exclude=(i,s)=>{let n={...t.entries};for(let a of i)if(r.has(a))delete n[a];else throw Error(`Key ${a} not found in enum`);return new yg({...t,checks:[],...Ae(s),entries:n})}});function me(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new yg({type:"enum",entries:r,...Ae(t)})}var Bde=Y("ZodLiteral",(e,t)=>{uce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Due(e,r,i,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function le(e,t){return new Bde({type:"literal",values:Array.isArray(e)?e:[e],...Ae(t)})}var Hde=Y("ZodTransform",(e,t)=>{dce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Lue(e,r,i,s),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Su(e.constructor.name);r.addIssue=n=>{if(typeof n=="string")r.issues.push(Jo(n,r.value,t));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Jo(a))}};let s=t.transform(r.value,r);return s instanceof Promise?s.then(n=>(r.value=n,r.fallback=!0,r)):(r.value=s,r.fallback=!0,r)}});function iT(e){return new Hde({type:"transform",transform:e})}var sT=Y("ZodOptional",(e,t)=>{Hk.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Zk(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function mt(e){return new sT({type:"optional",innerType:e})}var zde=Y("ZodExactOptional",(e,t)=>{pce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Zk(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function Wde(e){return new zde({type:"optional",innerType:e})}var Kde=Y("ZodNullable",(e,t)=>{hce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>jue(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function cw(e){return new Kde({type:"nullable",innerType:e})}var Gde=Y("ZodDefault",(e,t)=>{fce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Bue(e,r,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qde(e,t){return new Gde({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Sk(t)}})}var Vde=Y("ZodPrefault",(e,t)=>{mce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Hue(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function Zde(e,t){return new Vde({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Sk(t)}})}var nT=Y("ZodNonOptional",(e,t)=>{gce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Fue(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function Xde(e,t){return new nT({type:"nonoptional",innerType:e,...Ae(t)})}var Yde=Y("ZodCatch",(e,t)=>{_ce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>zue(e,r,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Jde(e,t){return new Yde({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var aT=Y("ZodPipe",(e,t)=>{zk.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Wue(e,r,i,s),e.in=t.in,e.out=t.out});function uw(e,t){return new aT({type:"pipe",in:e,out:t})}var Qde=Y("ZodPreprocess",(e,t)=>{aT.init(e,t),vce.init(e,t)}),epe=Y("ZodReadonly",(e,t)=>{yce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Kue(e,r,i,s),e.unwrap=()=>e._zod.def.innerType});function tpe(e){return new epe({type:"readonly",innerType:e})}var rpe=Y("ZodLazy",(e,t)=>{bce.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Gue(e,r,i,s),e.unwrap=()=>e._zod.def.getter()});function bg(e){return new rpe({type:"lazy",getter:e})}var oT=Y("ZodCustom",(e,t)=>{Ece.init(e,t),ot.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Iue(e,r,i,s)});function ipe(e,t){return _ue(oT,e??(()=>!0),t)}function spe(e,t={}){return vue(oT,e,t)}function npe(e,t){return yue(e,t)}function at(e,t){return new Qde({type:"pipe",in:iT(e),out:t})}var pi={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},dw;dw||(dw={});function ape(e){return Ace(Jk,e)}di(Sce());var xke=re(()=>B({customTitle:O()}));var Mke=re(()=>Pt({type:le("continued-in"),continuedInSessionId:O()})),Uke=re(()=>Pt({type:le("assistant"),isApiErrorMessage:G().optional(),message:Pt({stop_reason:O().nullish()}).optional()}));function cpe(e){return{globalConfig:Fp(e||pw(),".claude.json"),userSettings:Fp(e||Fp(pw(),".claude"),"settings.json")}}function hw(e,t,r,i){return e!==void 0&&t===r?{backend:e,key:i}:void 0}async function Bp(e,t,r,i){if(i)return upe(i,e,t,r);try{r?await cT(t,r(await lpe(e)),{mode:384}):await ope(e,t)}catch(s){if(Ye(s)===void 0)throw s;ad(s)||(await lT(t,{force:!0}).catch(()=>{}),We(`sessionStore resume: skipping ${e} (${Ye(s)})`))}}async function upe({backend:e,key:t},r,i,s){let n=await e.read([t]);if(!n.ok){if(n.error.code==="InvalidArgument")throw new Xr(`sessionStore resume: invalid v5 key for ${r}: ${n.error.argument}${n.error.reason?` (${n.error.reason})`:""}`,"sessionStore resume: invalid v5 key (InvalidArgument from backend read)");We(`sessionStore resume: skipping ${r} (${n.error.code})`);return}let a=n.value.items[0];if(!a?.found)return;let o=Buffer.from(a.value);try{await cT(i,s?s(o):o,{mode:384})}catch(l){if(Ye(l)===void 0)throw l;ad(l)||(await lT(i,{force:!0}).catch(()=>{}),We(`sessionStore resume: skipping ${r} (${Ye(l)})`))}}var hpe="-credentials";function fpe(e=""){let t=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,r=t!==void 0?!t:!process.env.CLAUDE_CONFIG_DIR,i=t!==void 0?t.normalize("NFC"):es(),s=r?"":`-${dpe("sha256").update(i).digest("hex").substring(0,8)}`;return`Claude Code${a3().OAUTH_FILE_SUFFIX}${e}${s}`}var mpe=/^[a-zA-Z0-9._-]+$/;function gpe(){if(process.platform==="win32")return"claude-code-user";let e;try{e=process.env.USER||ppe().username}catch{e="claude-code-user"}return mpe.test(e)?e:"claude-code-user"}var Eg=class{cache={data:null,cachedAt:0};generation=0;readInFlight=null;lastReadFailure=null;lastKnown=null;legacyApiKeyPrefetch=null},pTe=new Nt(()=>new Eg);function _pe(e,t){if(e==="bypassPermissions")return"canUseTool will not be invoked: permissionMode 'bypassPermissions' auto-approves every tool call (except explicit deny rules) before the callback is consulted. To gate every tool call, use a PreToolUse hook instead.";let r=t.filter(i=>i.length>0&&!i.includes("("));if(r.length!==0)return`canUseTool will not be invoked for: ${r.join(", ")}. Bare allowedTools entries auto-approve the whole tool before the callback is consulted. To gate every tool call, use a PreToolUse hook; or remove the bare names from allowedTools so they fall through to canUseTool. Allow rules from settings files can also shadow the callback but are not visible here.`}function vpe(e,t,r){if(!e)return;let i=_pe(t,r);i!==void 0&&process.emitWarning(i,{code:"CLAUDE_SDK_CAN_USE_TOOL_SHADOWED"})}var ype=Y("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");tt.init(e,t),e.def=t,e.type=t.type,e.parse=(r,i)=>Roe(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>xk(e,r,i),e.parseAsync=async(r,i)=>Doe(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>kk(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),e.with=e.check,e.clone=(r,i)=>gi(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.apply=r=>r(e)}),hTe=Y("ZodMiniObject",(e,t)=>{Fk.init(e,t),ype.init(e,t),Ke(e,"shape",()=>t.shape)});var bpe="io.modelcontextprotocol/related-task",vd="2.0",Tt=ipe(e=>e!==null&&(typeof e=="object"||typeof e=="function")),uT=Re([O(),Oe().int()]),dT=O(),fTe=Pt({ttl:Oe().optional(),pollInterval:Oe().optional()}),Epe=B({ttl:Oe().optional()}),wpe=B({taskId:O()}),mv=Pt({progressToken:uT.optional(),[bpe]:wpe.optional()}),Ar=B({_meta:mv.optional()}),yd=Ar.extend({task:Epe.optional()});var Mt=B({method:O(),params:Ar.loose().optional()}),Hr=B({_meta:mv.optional()}),zr=B({method:O(),params:Hr.loose().optional()}),Ut=Pt({_meta:mv.optional()}),bd=Re([O(),Oe().int()]),Spe=B({jsonrpc:le(vd),id:bd,...Mt.shape}).strict();var Cpe=B({jsonrpc:le(vd),...zr.shape}).strict();var pT=B({jsonrpc:le(vd),id:bd,result:Ut}).strict();var fw;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(fw||(fw={}));var hT=B({jsonrpc:le(vd),id:bd.optional(),error:B({code:Oe().int(),message:O(),data:$e().optional()})}).strict();var mTe=Re([Spe,Cpe,pT,hT]),gTe=Re([pT,hT]),fT=Ut.strict(),Ope=Hr.extend({requestId:bd.optional(),reason:O().optional()}),mT=zr.extend({method:le("notifications/cancelled"),params:Ope}),Ape=B({src:O(),mimeType:O().optional(),sizes:X(O()).optional(),theme:me(["light","dark"]).optional()}),vl=B({icons:X(Ape).optional()}),ea=B({name:O(),title:O().optional()}),gT=ea.extend({...ea.shape,...vl.shape,version:O(),websiteUrl:O().optional(),description:O().optional()}),xpe=fv(B({applyDefaults:G().optional()}),Ee(O(),$e())),kpe=at(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,fv(B({form:xpe.optional(),url:Tt.optional()}),Ee(O(),$e()).optional())),Tpe=Pt({list:Tt.optional(),cancel:Tt.optional(),requests:Pt({sampling:Pt({createMessage:Tt.optional()}).optional(),elicitation:Pt({create:Tt.optional()}).optional()}).optional()}),Rpe=Pt({list:Tt.optional(),cancel:Tt.optional(),requests:Pt({tools:Pt({call:Tt.optional()}).optional()}).optional()}),Dpe=B({experimental:Ee(O(),Tt).optional(),sampling:B({context:Tt.optional(),tools:Tt.optional()}).optional(),elicitation:kpe.optional(),roots:B({listChanged:G().optional()}).optional(),tasks:Tpe.optional(),extensions:Ee(O(),Tt).optional()}),Ipe=Ar.extend({protocolVersion:O(),capabilities:Dpe,clientInfo:gT}),Lpe=Mt.extend({method:le("initialize"),params:Ipe}),Ppe=B({experimental:Ee(O(),Tt).optional(),logging:Tt.optional(),completions:Tt.optional(),prompts:B({listChanged:G().optional()}).optional(),resources:B({subscribe:G().optional(),listChanged:G().optional()}).optional(),tools:B({listChanged:G().optional()}).optional(),tasks:Rpe.optional(),extensions:Ee(O(),Tt).optional()}),Npe=Ut.extend({protocolVersion:O(),capabilities:Ppe,serverInfo:gT,instructions:O().optional()}),Mpe=zr.extend({method:le("notifications/initialized"),params:Hr.optional()}),_T=Mt.extend({method:le("ping"),params:Ar.optional()}),Upe=B({progress:Oe(),total:mt(Oe()),message:mt(O())}),$pe=B({...Hr.shape,...Upe.shape,progressToken:uT}),vT=zr.extend({method:le("notifications/progress"),params:$pe}),jpe=Ar.extend({cursor:dT.optional()}),yl=Mt.extend({params:jpe.optional()}),bl=Ut.extend({nextCursor:dT.optional()}),Fpe=me(["working","input_required","completed","failed","cancelled"]),El=B({taskId:O(),status:Fpe,ttl:Re([Oe(),Pde()]),createdAt:O(),lastUpdatedAt:O(),pollInterval:mt(Oe()),statusMessage:mt(O())}),yT=Ut.extend({task:El}),Bpe=Hr.merge(El),bT=zr.extend({method:le("notifications/tasks/status"),params:Bpe}),ET=Mt.extend({method:le("tasks/get"),params:Ar.extend({taskId:O()})}),wT=Ut.merge(El),ST=Mt.extend({method:le("tasks/result"),params:Ar.extend({taskId:O()})}),_Te=Ut.loose(),CT=yl.extend({method:le("tasks/list")}),OT=bl.extend({tasks:X(El)}),AT=Mt.extend({method:le("tasks/cancel"),params:Ar.extend({taskId:O()})}),vTe=Ut.merge(El),xT=B({uri:O(),mimeType:mt(O()),_meta:Ee(O(),$e()).optional()}),kT=xT.extend({text:O()}),gv=O().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),TT=xT.extend({blob:gv}),wl=me(["user","assistant"]),va=B({audience:X(wl).optional(),priority:Oe().min(0).max(1).optional(),lastModified:Xk({offset:!0}).optional()}),RT=B({...ea.shape,...vl.shape,uri:O(),description:mt(O()),mimeType:mt(O()),size:mt(Oe()),annotations:va.optional(),_meta:mt(Pt({}))}),Hpe=B({...ea.shape,...vl.shape,uriTemplate:O(),description:mt(O()),mimeType:mt(O()),annotations:va.optional(),_meta:mt(Pt({}))}),zpe=yl.extend({method:le("resources/list")}),Wpe=bl.extend({resources:X(RT)}),Kpe=yl.extend({method:le("resources/templates/list")}),Gpe=bl.extend({resourceTemplates:X(Hpe)}),_v=Ar.extend({uri:O()}),qpe=_v,Vpe=Mt.extend({method:le("resources/read"),params:qpe}),Zpe=Ut.extend({contents:X(Re([kT,TT]))}),Xpe=zr.extend({method:le("notifications/resources/list_changed"),params:Hr.optional()}),Ype=_v,Jpe=Mt.extend({method:le("resources/subscribe"),params:Ype}),Qpe=_v,ehe=Mt.extend({method:le("resources/unsubscribe"),params:Qpe}),the=Hr.extend({uri:O()}),rhe=zr.extend({method:le("notifications/resources/updated"),params:the}),ihe=B({name:O(),description:mt(O()),required:mt(G())}),she=B({...ea.shape,...vl.shape,description:mt(O()),arguments:mt(X(ihe)),_meta:mt(Pt({}))}),nhe=yl.extend({method:le("prompts/list")}),ahe=bl.extend({prompts:X(she)}),ohe=Ar.extend({name:O(),arguments:Ee(O(),O()).optional()}),lhe=Mt.extend({method:le("prompts/get"),params:ohe}),vv=B({type:le("text"),text:O(),annotations:va.optional(),_meta:Ee(O(),$e()).optional()}),yv=B({type:le("image"),data:gv,mimeType:O(),annotations:va.optional(),_meta:Ee(O(),$e()).optional()}),bv=B({type:le("audio"),data:gv,mimeType:O(),annotations:va.optional(),_meta:Ee(O(),$e()).optional()}),che=B({type:le("tool_use"),name:O(),id:O(),input:Ee(O(),$e()),_meta:Ee(O(),$e()).optional()}),uhe=B({type:le("resource"),resource:Re([kT,TT]),annotations:va.optional(),_meta:Ee(O(),$e()).optional()}),dhe=RT.extend({type:le("resource_link")}),Ev=Re([vv,yv,bv,dhe,uhe]),phe=B({role:wl,content:Ev}),hhe=Ut.extend({description:O().optional(),messages:X(phe)}),fhe=zr.extend({method:le("notifications/prompts/list_changed"),params:Hr.optional()}),mhe=B({title:O().optional(),readOnlyHint:G().optional(),destructiveHint:G().optional(),idempotentHint:G().optional(),openWorldHint:G().optional()}),ghe=B({taskSupport:me(["required","optional","forbidden"]).optional()}),DT=B({...ea.shape,...vl.shape,description:O().optional(),inputSchema:B({type:le("object"),properties:Ee(O(),Tt).optional(),required:X(O()).optional()}).catchall($e()),outputSchema:B({type:le("object"),properties:Ee(O(),Tt).optional(),required:X(O()).optional()}).catchall($e()).optional(),annotations:mhe.optional(),execution:ghe.optional(),_meta:Ee(O(),$e()).optional()}),_he=yl.extend({method:le("tools/list")}),vhe=bl.extend({tools:X(DT)}),IT=Ut.extend({content:X(Ev).default([]),structuredContent:Ee(O(),$e()).optional(),isError:G().optional()}),yTe=IT.or(Ut.extend({toolResult:$e()})),yhe=yd.extend({name:O(),arguments:Ee(O(),$e()).optional()}),bhe=Mt.extend({method:le("tools/call"),params:yhe}),Ehe=zr.extend({method:le("notifications/tools/list_changed"),params:Hr.optional()}),bTe=B({autoRefresh:G().default(!0),debounceMs:Oe().int().nonnegative().default(300)}),LT=me(["debug","info","notice","warning","error","critical","alert","emergency"]),whe=Ar.extend({level:LT}),She=Mt.extend({method:le("logging/setLevel"),params:whe}),Che=Hr.extend({level:LT,logger:O().optional(),data:$e()}),Ohe=zr.extend({method:le("notifications/message"),params:Che}),Ahe=B({name:O().optional()}),xhe=B({hints:X(Ahe).optional(),costPriority:Oe().min(0).max(1).optional(),speedPriority:Oe().min(0).max(1).optional(),intelligencePriority:Oe().min(0).max(1).optional()}),khe=B({mode:me(["auto","required","none"]).optional()}),The=B({type:le("tool_result"),toolUseId:O().describe("The unique identifier for the corresponding tool call."),content:X(Ev).default([]),structuredContent:B({}).loose().optional(),isError:G().optional(),_meta:Ee(O(),$e()).optional()}),Rhe=_d("type",[vv,yv,bv]),ku=_d("type",[vv,yv,bv,che,The]),Dhe=B({role:wl,content:Re([ku,X(ku)]),_meta:Ee(O(),$e()).optional()}),Ihe=yd.extend({messages:X(Dhe),modelPreferences:xhe.optional(),systemPrompt:O().optional(),includeContext:me(["none","thisServer","allServers"]).optional(),temperature:Oe().optional(),maxTokens:Oe().int(),stopSequences:X(O()).optional(),metadata:Tt.optional(),tools:X(DT).optional(),toolChoice:khe.optional()}),Lhe=Mt.extend({method:le("sampling/createMessage"),params:Ihe}),Phe=Ut.extend({model:O(),stopReason:mt(me(["endTurn","stopSequence","maxTokens"]).or(O())),role:wl,content:Rhe}),Nhe=Ut.extend({model:O(),stopReason:mt(me(["endTurn","stopSequence","maxTokens","toolUse"]).or(O())),role:wl,content:Re([ku,X(ku)])}),Mhe=B({type:le("boolean"),title:O().optional(),description:O().optional(),default:G().optional()}),Uhe=B({type:le("string"),title:O().optional(),description:O().optional(),minLength:Oe().optional(),maxLength:Oe().optional(),format:me(["email","uri","date","date-time"]).optional(),default:O().optional()}),$he=B({type:me(["number","integer"]),title:O().optional(),description:O().optional(),minimum:Oe().optional(),maximum:Oe().optional(),default:Oe().optional()}),jhe=B({type:le("string"),title:O().optional(),description:O().optional(),enum:X(O()),default:O().optional()}),Fhe=B({type:le("string"),title:O().optional(),description:O().optional(),oneOf:X(B({const:O(),title:O()})),default:O().optional()}),Bhe=B({type:le("string"),title:O().optional(),description:O().optional(),enum:X(O()),enumNames:X(O()).optional(),default:O().optional()}),Hhe=Re([jhe,Fhe]),zhe=B({type:le("array"),title:O().optional(),description:O().optional(),minItems:Oe().optional(),maxItems:Oe().optional(),items:B({type:le("string"),enum:X(O())}),default:X(O()).optional()}),Whe=B({type:le("array"),title:O().optional(),description:O().optional(),minItems:Oe().optional(),maxItems:Oe().optional(),items:B({anyOf:X(B({const:O(),title:O()}))}),default:X(O()).optional()}),Khe=Re([zhe,Whe]),Ghe=Re([Bhe,Hhe,Khe]),qhe=Re([Ghe,Mhe,Uhe,$he]),Vhe=yd.extend({mode:le("form").optional(),message:O(),requestedSchema:B({type:le("object"),properties:Ee(O(),qhe),required:X(O()).optional()})}),Zhe=yd.extend({mode:le("url"),message:O(),elicitationId:O(),url:O().url()}),Xhe=Re([Vhe,Zhe]),Yhe=Mt.extend({method:le("elicitation/create"),params:Xhe}),Jhe=Hr.extend({elicitationId:O()}),Qhe=zr.extend({method:le("notifications/elicitation/complete"),params:Jhe}),efe=Ut.extend({action:me(["accept","decline","cancel"]),content:at(e=>e===null?void 0:e,Ee(O(),Re([O(),Oe(),G(),X(O())])).optional())}),tfe=B({type:le("ref/resource"),uri:O()}),rfe=B({type:le("ref/prompt"),name:O()}),ife=Ar.extend({ref:Re([rfe,tfe]),argument:B({name:O(),value:O()}),context:B({arguments:Ee(O(),O()).optional()}).optional()}),sfe=Mt.extend({method:le("completion/complete"),params:ife});var nfe=Ut.extend({completion:Pt({values:X(O()).max(100),total:mt(Oe().int()),hasMore:mt(G())})}),afe=B({uri:O().startsWith("file://"),name:O().optional(),_meta:Ee(O(),$e()).optional()}),ofe=Mt.extend({method:le("roots/list"),params:Ar.optional()}),lfe=Ut.extend({roots:X(afe)}),cfe=zr.extend({method:le("notifications/roots/list_changed"),params:Hr.optional()}),ETe=Re([_T,Lpe,sfe,She,lhe,nhe,zpe,Kpe,Vpe,Jpe,ehe,bhe,_he,ET,ST,CT,AT]),wTe=Re([mT,vT,Mpe,cfe,bT]),STe=Re([fT,Phe,Nhe,efe,lfe,wT,OT,yT]),CTe=Re([_T,Lhe,Yhe,ofe,ET,ST,CT,AT]),OTe=Re([mT,vT,Ohe,rhe,Xpe,Ehe,fhe,bT,Qhe]),ATe=Re([fT,Npe,nfe,hhe,ahe,Wpe,Gpe,Zpe,IT,vhe,wT,OT,yT]);var xTe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var kTe=lr(PA(),1),TTe=lr(j$(),1);var mw;(function(e){e.Completable="McpCompletable"})(mw||(mw={}));var RTe=re(()=>B({session_id:O(),ws_url:O(),work_dir:O().optional(),session_key:O().optional()}));var ufe=["projectSettings","localSettings"],LTe=new Set(ufe);var dfe=Object.prototype,pfe=dfe.hasOwnProperty;function hfe(e,t,r){var i=e[t];(!(pfe.call(e,t)&&dl(i,r))||r===void 0&&!(t in e))&&Yu(e,t,r)}var wv=hfe;function ffe(e,t,r,i){if(!Jr(e))return e;t=pa(t,e);for(var s=-1,n=t.length,a=n-1,o=e;o!=null&&++s<n;){var l=Ds(t[s]),c=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=a){var u=o[l];c=i?i(u,l,o):void 0,c===void 0&&(c=Jr(u)?u:Zu(t[s+1])?[]:{})}wv(o,l,c),o=o[l]}return e}var mfe=ffe;function gfe(e,t,r){for(var i=-1,s=t.length,n={};++i<s;){var a=t[i],o=Ju(e,a);r(o,a)&&mfe(n,pa(a,e),o)}return n}var PT=gfe,_fe=zA(Object.getPrototypeOf,Object),Sv=_fe,vfe=Object.getOwnPropertySymbols,yfe=vfe?function(e){for(var t=[];e;)B_(t,H_(e)),e=Sv(e);return t}:jA,NT=yfe;function bfe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Efe=bfe,wfe=Object.prototype,Sfe=wfe.hasOwnProperty;function Cfe(e){if(!Jr(e))return Efe(e);var t=G_(e),r=[];for(var i in e)i=="constructor"&&(t||!Sfe.call(e,i))||r.push(i);return r}var Ofe=Cfe;function Afe(e){return Xu(e)?HA(e,!0):Ofe(e)}var Sl=Afe;function xfe(e){return $A(e,Sl,NT)}var Cv=xfe;function kfe(e,t){if(e==null)return{};var r=J_(Cv(e),function(i){return[i]});return t=Qu(t),PT(e,r,function(i,s){return t(i,s[0])})}var MT=kfe;function UT(){}async function Rfe(e,t){let r=Jt();try{await r.appendFile(e,t)}catch{await r.mkdir(Tfe(e)).catch(UT),await r.appendFile(e,t)}}var wg=class{pendingWrite=Promise.resolve();cleanupRegistered=!1;append(t,r){this.pendingWrite=this.pendingWrite.then(Rfe.bind(null,t,r)).catch(UT),!this.cleanupRegistered&&(this.cleanupRegistered=!0,Hx(()=>this.flush()))}flush(){return this.pendingWrite}},Dfe=new Nt(()=>new wg);function Ife(){return sd(Dfe)}function Lfe(e,t,r){let i=Nfe();if(!i)return;let s;try{s=gw(e,t,Pfe(r))}catch{s=gw(e,t,{diagnostics_payload_failed:!0})}Ife().append(i,s)}function Pfe(e){try{return(typeof e=="function"?e():e)??{}}catch{return{diagnostics_payload_failed:!0}}}function gw(e,t,r){let i={timestamp:new Date().toISOString(),level:e,event:t,data:r};return ze(i)+`
|
|
158
|
+
`}function Nfe(){return ml.CLAUDE_CODE_DIAGNOSTICS_FILE}function $T(e,t,r){Mfe(e.statSync(t),t,r)}function Mfe(e,t,r){if(e.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:t});if(!e.isFile())throw Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:t});if(r!==void 0&&e.size>r)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:t,size:e.size,maxBytes:r})}function jT(e,t,r){if(r!==void 0&&e>r)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:t,size:e,maxBytes:r})}function Ufe(e){return e.byteLength===0?"utf8":e.byteLength>=2&&e[0]===255&&e[1]===254?"utf16le":(e.byteLength>=3&&e[0]===239&&e[1]===187&&e[2]===191,"utf8")}function FT(e){let{buffer:t,bytesRead:r}=Jt().readSync(e,{length:4096});return Ufe(t.subarray(0,r))}function BT(e){let t=0,r=0;for(let i=0;i<e.length;i++)e[i]===`
|
|
159
|
+
`&&(i>0&&e[i-1]==="\r"?t++:r++);return t>r?"CRLF":"LF"}function $fe(e,t){let r=Jt(),{resolvedPath:i,isSymlink:s}=Vx(r,e);s&&We(`Reading through symlink: ${e} -> ${i}`),$T(r,e,t);let n=FT(e),a;if(t===void 0)a=r.readFileSync(e,{encoding:n});else{let{buffer:l,bytesRead:c}=r.readSync(e,{length:t+1});jT(c,e,t),a=l.subarray(0,c).toString(n)}let o=BT(a.slice(0,4096));return{content:a.replaceAll(`\r
|
|
160
|
+
`,`
|
|
161
|
+
`),encoding:n,lineEndings:o}}function HT(e,t){return $fe(e,t).content}async function jfe(e,t){let r=Jt(),{resolvedPath:i,isSymlink:s}=Vx(r,e);s&&We(`Reading through symlink: ${e} -> ${i}`),$T(r,e,t);let n=FT(e),a=await r.readFileBytes(e,t===void 0?void 0:t+1);jT(a.length,e,t);let o=a.toString(n),l=BT(o.slice(0,4096));return{content:o.replaceAll(`\r
|
|
162
|
+
`,`
|
|
163
|
+
`),encoding:n,lineEndings:l}}var _w;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(_w||(_w={}));var MTe=Array(20).fill(0).map((e,t)=>" ".repeat(t)),UTe={" ":{"\n":Array(200).fill(0).map((e,t)=>`
|
|
164
|
+
`+" ".repeat(t)),"\r":Array(200).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
|
|
165
|
+
`+" ".repeat(t))}," ":{"\n":Array(200).fill(0).map((e,t)=>`
|
|
166
|
+
`+" ".repeat(t)),"\r":Array(200).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
|
|
167
|
+
`+" ".repeat(t))}},vw;(function(e){e.DEFAULT={allowTrailingComma:!1}})(vw||(vw={}));var yw;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(yw||(yw={}));var bw;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(bw||(bw={}));var Ew;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(Ew||(Ew={}));var en=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,zT=new Set,Sg=typeof process=="object"&&process?process:{},WT=(e,t,r,i)=>{typeof Sg.emitWarning=="function"?Sg.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)},{AbortController:Tu,AbortSignal:ww}=globalThis;if(typeof Tu>"u"){ww=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Tu=class{constructor(){t()}signal=new ww;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let e=Sg.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=!1,WT("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Ffe=e=>!zT.has(e);var Ki=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),KT=e=>Ki(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?kn:null:null,kn=class extends Array{constructor(t){super(t),this.fill(0)}},Cg=class e{heap;length;static#e=!1;static create(t){let r=KT(t);if(!r)return[];e.#e=!0;let i=new e(t,r);return e.#e=!1,i}constructor(t,r){if(!e.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Og=class e{#e;#t;#r;#i;#a;#u;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#c;#o;#s;#n;#d;#p;#h;#f;#_;#m;#v;#E;#y;#b;#S;#w;static unsafeExposeInternals(t){return{starts:t.#E,ttls:t.#y,sizes:t.#v,keyMap:t.#o,keyList:t.#s,valList:t.#n,next:t.#d,prev:t.#p,get head(){return t.#h},get tail(){return t.#f},free:t.#_,isBackgroundFetch:r=>t.#g(r),backgroundFetch:(r,i,s,n)=>t.#L(r,i,s,n),moveToTail:r=>t.#j(r),indexes:r=>t.#x(r),rindexes:r=>t.#k(r),isStale:r=>t.#C(r)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#c}get size(){return this.#l}get fetchMethod(){return this.#a}get memoMethod(){return this.#u}get dispose(){return this.#r}get disposeAfter(){return this.#i}constructor(t){let{max:r=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:l,dispose:c,disposeAfter:u,noDisposeOnSet:p,noUpdateTTL:h,maxSize:f=0,maxEntrySize:_=0,sizeCalculation:v,fetchMethod:E,memoMethod:y,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:g,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:C,ignoreFetchAbort:A}=t;if(r!==0&&!Ki(r))throw TypeError("max option must be a nonnegative integer");let w=r?KT(r):Array;if(!w)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=f,this.maxEntrySize=_||this.#t,this.sizeCalculation=v,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw TypeError("memoMethod must be a function if defined");if(this.#u=y,E!==void 0&&typeof E!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#a=E,this.#S=!!E,this.#o=new Map,this.#s=Array(r).fill(void 0),this.#n=Array(r).fill(void 0),this.#d=new w(r),this.#p=new w(r),this.#h=0,this.#f=0,this.#_=Cg.create(r),this.#l=0,this.#c=0,typeof c=="function"&&(this.#r=c),typeof u=="function"?(this.#i=u,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#b=!!this.#r,this.#w=!!this.#i,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#t!==0&&!Ki(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!Ki(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!g,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=Ki(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!Ki(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");!this.ttlAutopurge&&!this.#e&&!this.#t&&Ffe("LRU_CACHE_UNBOUNDED")&&(zT.add("LRU_CACHE_UNBOUNDED"),WT("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",e))}getRemainingTTL(t){return this.#o.has(t)?1/0:0}#O(){let t=new kn(this.#e),r=new kn(this.#e);this.#y=t,this.#E=r,this.#N=(n,a,o=en.now())=>{if(r[n]=a!==0?o:0,t[n]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#C(n)&&this.#P(this.#s[n],"expire")},a+1);l.unref&&l.unref()}},this.#A=n=>{r[n]=t[n]!==0?en.now():0},this.#T=(n,a)=>{if(t[a]){let o=t[a],l=r[a];if(!o||!l)return;n.ttl=o,n.start=l,n.now=i||s();let c=n.now-l;n.remainingTTL=o-c}};let i=0,s=()=>{let n=en.now();if(this.ttlResolution>0){i=n;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return n};this.getRemainingTTL=n=>{let a=this.#o.get(n);if(a===void 0)return 0;let o=t[a],l=r[a];if(!o||!l)return 1/0;let c=(i||s())-l;return o-c},this.#C=n=>{let a=r[n],o=t[n];return!!o&&!!a&&(i||s())-a>o}}#A=()=>{};#T=()=>{};#N=()=>{};#C=()=>!1;#$(){let t=new kn(this.#e);this.#c=0,this.#v=t,this.#R=r=>{this.#c-=t[r],t[r]=0},this.#M=(r,i,s,n)=>{if(this.#g(i))return 0;if(!Ki(s))if(n){if(typeof n!="function")throw TypeError("sizeCalculation must be a function");if(s=n(i,r),!Ki(s))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#D=(r,i,s)=>{if(t[r]=i,this.#t){let n=this.#t-t[r];for(;this.#c>n;)this.#I(!0)}this.#c+=t[r],s&&(s.entrySize=i,s.totalCalculatedSize=this.#c)}}#R=t=>{};#D=(t,r,i)=>{};#M=(t,r,i,s)=>{if(i||s)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#l)for(let r=this.#f;!(!this.#U(r)||((t||!this.#C(r))&&(yield r),r===this.#h));)r=this.#p[r]}*#k({allowStale:t=this.allowStale}={}){if(this.#l)for(let r=this.#h;!(!this.#U(r)||((t||!this.#C(r))&&(yield r),r===this.#f));)r=this.#d[r]}#U(t){return t!==void 0&&this.#o.get(this.#s[t])===t}*entries(){for(let t of this.#x())this.#n[t]!==void 0&&this.#s[t]!==void 0&&!this.#g(this.#n[t])&&(yield[this.#s[t],this.#n[t]])}*rentries(){for(let t of this.#k())this.#n[t]!==void 0&&this.#s[t]!==void 0&&!this.#g(this.#n[t])&&(yield[this.#s[t],this.#n[t]])}*keys(){for(let t of this.#x()){let r=this.#s[t];r!==void 0&&!this.#g(this.#n[t])&&(yield r)}}*rkeys(){for(let t of this.#k()){let r=this.#s[t];r!==void 0&&!this.#g(this.#n[t])&&(yield r)}}*values(){for(let t of this.#x())this.#n[t]!==void 0&&!this.#g(this.#n[t])&&(yield this.#n[t])}*rvalues(){for(let t of this.#k())this.#n[t]!==void 0&&!this.#g(this.#n[t])&&(yield this.#n[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let i of this.#x()){let s=this.#n[i],n=this.#g(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#s[i],this))return this.get(this.#s[i],r)}}forEach(t,r=this){for(let i of this.#x()){let s=this.#n[i],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(r,n,this.#s[i],this)}}rforEach(t,r=this){for(let i of this.#k()){let s=this.#n[i],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(r,n,this.#s[i],this)}}purgeStale(){let t=!1;for(let r of this.#k({allowStale:!0}))this.#C(r)&&(this.#P(this.#s[r],"expire"),t=!0);return t}info(t){let r=this.#o.get(t);if(r===void 0)return;let i=this.#n[r],s=this.#g(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#y&&this.#E){let a=this.#y[r],o=this.#E[r];if(a&&o){let l=a-(en.now()-o);n.ttl=l,n.start=Date.now()}}return this.#v&&(n.size=this.#v[r]),n}dump(){let t=[];for(let r of this.#x({allowStale:!0})){let i=this.#s[r],s=this.#n[r],n=this.#g(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let a={value:n};if(this.#y&&this.#E){a.ttl=this.#y[r];let o=en.now()-this.#E[r];a.start=Math.floor(Date.now()-o)}this.#v&&(a.size=this.#v[r]),t.unshift([i,a])}return t}load(t){this.clear();for(let[r,i]of t){if(i.start){let s=Date.now()-i.start;i.start=en.now()-s}this.set(r,i.value,i)}}set(t,r,i={}){if(r===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=i,{noUpdateTTL:c=this.noUpdateTTL}=i,u=this.#M(t,r,i.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#P(t,"set"),this;let p=this.#l===0?void 0:this.#o.get(t);if(p===void 0)p=this.#l===0?this.#f:this.#_.length!==0?this.#_.pop():this.#l===this.#e?this.#I(!1):this.#l,this.#s[p]=t,this.#n[p]=r,this.#o.set(t,p),this.#d[this.#f]=p,this.#p[p]=this.#f,this.#f=p,this.#l++,this.#D(p,u,l),l&&(l.set="add"),c=!1;else{this.#j(p);let h=this.#n[p];if(r!==h){if(this.#S&&this.#g(h)){h.__abortController.abort(Error("replaced"));let{__staleWhileFetching:f}=h;f!==void 0&&!a&&(this.#b&&this.#r?.(f,t,"set"),this.#w&&this.#m?.push([f,t,"set"]))}else a||(this.#b&&this.#r?.(h,t,"set"),this.#w&&this.#m?.push([h,t,"set"]));if(this.#R(p),this.#D(p,u,l),this.#n[p]=r,l){l.set="replace";let f=h&&this.#g(h)?h.__staleWhileFetching:h;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(s!==0&&!this.#y&&this.#O(),this.#y&&(c||this.#N(p,s,n),l&&this.#T(l,p)),!a&&this.#w&&this.#m){let h=this.#m,f;for(;f=h?.shift();)this.#i?.(...f)}return this}pop(){try{for(;this.#l;){let t=this.#n[this.#h];if(this.#I(!0),this.#g(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#w&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#i?.(...r)}}}#I(t){let r=this.#h,i=this.#s[r],s=this.#n[r];return this.#S&&this.#g(s)?s.__abortController.abort(Error("evicted")):(this.#b||this.#w)&&(this.#b&&this.#r?.(s,i,"evict"),this.#w&&this.#m?.push([s,i,"evict"])),this.#R(r),t&&(this.#s[r]=void 0,this.#n[r]=void 0,this.#_.push(r)),this.#l===1?(this.#h=this.#f=0,this.#_.length=0):this.#h=this.#d[r],this.#o.delete(i),this.#l--,r}has(t,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=r,n=this.#o.get(t);if(n!==void 0){let a=this.#n[n];if(this.#g(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#C(n))s&&(s.has="stale",this.#T(s,n));else return i&&this.#A(n),s&&(s.has="hit",this.#T(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,r={}){let{allowStale:i=this.allowStale}=r,s=this.#o.get(t);if(s===void 0||!i&&this.#C(s))return;let n=this.#n[s];return this.#g(n)?n.__staleWhileFetching:n}#L(t,r,i,s){let n=r===void 0?void 0:this.#n[r];if(this.#g(n))return n;let a=new Tu,{signal:o}=i;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:s},c=(v,E=!1)=>{let{aborted:y}=a.signal,m=i.ignoreFetchAbort&&v!==void 0;if(i.status&&(y&&!E?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,m&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),y&&!m&&!E)return p(a.signal.reason);let g=f;return this.#n[r]===f&&(v===void 0?g.__staleWhileFetching?this.#n[r]=g.__staleWhileFetching:this.#P(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,v,l.options))),v},u=v=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=v),p(v)),p=v=>{let{aborted:E}=a.signal,y=E&&i.allowStaleOnFetchAbort,m=y||i.allowStaleOnFetchRejection,g=m||i.noDeleteOnFetchRejection,b=f;if(this.#n[r]===f&&(!g||b.__staleWhileFetching===void 0?this.#P(t,"fetch"):y||(this.#n[r]=b.__staleWhileFetching)),m)return i.status&&b.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),b.__staleWhileFetching;if(b.__returned===b)throw v},h=(v,E)=>{let y=this.#a?.(t,n,l);y&&y instanceof Promise&&y.then(m=>v(m===void 0?void 0:m),E),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(v(void 0),i.allowStaleOnFetchAbort&&(v=m=>c(m,!0)))})};i.status&&(i.status.fetchDispatched=!0);let f=new Promise(h).then(c,u),_=Object.assign(f,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return r===void 0?(this.set(t,_,{...l.options,status:void 0}),r=this.#o.get(t)):this.#n[r]=_,_}#g(t){if(!this.#S)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Tu}async fetch(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:v,forceRefresh:E=!1,status:y,signal:m}=r;if(!this.#S)return y&&(y.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:y});let g={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:o,size:l,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:_,ignoreFetchAbort:f,status:y,signal:m},b=this.#o.get(t);if(b===void 0){y&&(y.fetch="miss");let C=this.#L(t,b,g,v);return C.__returned=C}else{let C=this.#n[b];if(this.#g(C)){let x=i&&C.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",x&&(y.returnedStale=!0)),x?C.__staleWhileFetching:C.__returned=C}let A=this.#C(b);if(!E&&!A)return y&&(y.fetch="hit"),this.#j(b),s&&this.#A(b),y&&this.#T(y,b),C;let w=this.#L(t,b,g,v),S=w.__staleWhileFetching!==void 0&&i;return y&&(y.fetch=A?"stale":"refresh",S&&A&&(y.returnedStale=!0)),S?w.__staleWhileFetching:w.__returned=w}}async forceFetch(t,r={}){let i=await this.fetch(t,r);if(i===void 0)throw Error("fetch() returned undefined");return i}memo(t,r={}){let i=this.#u;if(!i)throw Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=r,o=this.get(t,a);if(!n&&o!==void 0)return o;let l=i(t,o,{options:a,context:s});return this.set(t,l,a),l}get(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=r,o=this.#o.get(t);if(o!==void 0){let l=this.#n[o],c=this.#g(l);return a&&this.#T(a,o),this.#C(o)?(a&&(a.get="stale"),c?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(n||this.#P(t,"expire"),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),c?l.__staleWhileFetching:(this.#j(o),s&&this.#A(o),l))}else a&&(a.get="miss")}#F(t,r){this.#p[r]=t,this.#d[t]=r}#j(t){t!==this.#f&&(t===this.#h?this.#h=this.#d[t]:this.#F(this.#p[t],this.#d[t]),this.#F(this.#f,t),this.#f=t)}delete(t){return this.#P(t,"delete")}#P(t,r){let i=!1;if(this.#l!==0){let s=this.#o.get(t);if(s!==void 0)if(i=!0,this.#l===1)this.#B(r);else{this.#R(s);let n=this.#n[s];if(this.#g(n)?n.__abortController.abort(Error("deleted")):(this.#b||this.#w)&&(this.#b&&this.#r?.(n,t,r),this.#w&&this.#m?.push([n,t,r])),this.#o.delete(t),this.#s[s]=void 0,this.#n[s]=void 0,s===this.#f)this.#f=this.#p[s];else if(s===this.#h)this.#h=this.#d[s];else{let a=this.#p[s];this.#d[a]=this.#d[s];let o=this.#d[s];this.#p[o]=this.#p[s]}this.#l--,this.#_.push(s)}}if(this.#w&&this.#m?.length){let s=this.#m,n;for(;n=s?.shift();)this.#i?.(...n)}return i}clear(){return this.#B("delete")}#B(t){for(let r of this.#k({allowStale:!0})){let i=this.#n[r];if(this.#g(i))i.__abortController.abort(Error("deleted"));else{let s=this.#s[r];this.#b&&this.#r?.(i,s,t),this.#w&&this.#m?.push([i,s,t])}}if(this.#o.clear(),this.#n.fill(void 0),this.#s.fill(void 0),this.#y&&this.#E&&(this.#y.fill(0),this.#E.fill(0)),this.#v&&this.#v.fill(0),this.#h=0,this.#f=0,this.#_.length=0,this.#c=0,this.#l=0,this.#w&&this.#m){let r=this.#m,i;for(;i=r?.shift();)this.#i?.(...i)}}};function GT(e,t,r=100){let i=new Og({max:r}),s=(...n)=>{let a=t(...n),o=i.get(a);if(o!==void 0)return o;let l=e(...n);return i.set(a,l),l};return s.cache={clear:()=>i.clear(),size:()=>i.size,delete:n=>i.delete(n),get:n=>i.peek(n),has:n=>i.has(n),set:(n,a)=>{i.set(n,a)}},s}var Bfe=8192;function qT(e,t){try{return{ok:!0,value:JSON.parse(pk(e))}}catch(r){return t&&Yx(o4(r,`safeParseJSON: invalid JSON (${r instanceof Error?r.constructor.name:typeof r}, ${e.length} bytes)`)),{ok:!1}}}var Ag=class{cached=GT(qT,t=>t,50);cache=this.cached.cache;parse(t,r){return this.cached(t,r)}},Sw=new Ag,Ov=Object.assign(function(e,t=!0){if(!e)return null;let r=e.length>Bfe?qT(e,t):Sw.parse(e,t);return r.ok?r.value:null},{cache:Sw.cache}),xg=class{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=Wfe(),this.managedFilePath}getDropInDir(){return this.dropInDir??=Hfe(VT(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}},zfe=new xg;function VT(){return zfe.getManagedFilePath()}function Wfe(){let e=void 0;if(e!==void 0)return e;switch(nv()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}var Cw=["low","medium","high","xhigh","max"];function Kfe(e,t,r){(r!==void 0&&!dl(e[t],r)||r===void 0&&!(t in e))&&Yu(e,t,r)}var kg=Kfe,ho={};fr(ho,{default:()=>Av});var ZT=typeof ho=="object"&&ho&&!ho.nodeType&&ho,Ow=ZT&&typeof lE=="object"&&lE&&!lE.nodeType&&lE,Gfe=Ow&&Ow.exports===ZT,Aw=Gfe?mi.Buffer:void 0,xw=Aw?Aw.allocUnsafe:void 0;function qfe(e,t){if(t)return e.slice();var r=e.length,i=xw?xw(r):new e.constructor(r);return e.copy(i),i}var Av=qfe;function Vfe(e){var t=new e.constructor(e.byteLength);return new iu(t).set(new iu(e)),t}var xv=Vfe;function Zfe(e,t){var r=t?xv(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var XT=Zfe;function Xfe(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}var YT=Xfe,kw=Object.create,Yfe=(function(){function e(){}return function(t){if(!Jr(t))return{};if(kw)return kw(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),Jfe=Yfe;function Qfe(e){return typeof e.constructor=="function"&&!G_(e)?Jfe(Sv(e)):{}}var JT=Qfe;function eme(e){return li(e)&&Xu(e)}var tme=eme,rme="[object Object]",ime=Function.prototype,sme=Object.prototype,QT=ime.toString,nme=sme.hasOwnProperty,ame=QT.call(Object);function ome(e){if(!li(e)||Ms(e)!=rme)return!1;var t=Sv(e);if(t===null)return!0;var r=nme.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&QT.call(r)==ame}var eR=ome;function lme(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Tg=lme;function cme(e,t,r,i){var s=!r;r||(r={});for(var n=-1,a=t.length;++n<a;){var o=t[n],l=i?i(r[o],e[o],o,r,e):void 0;l===void 0&&(l=e[o]),s?Yu(r,o,l):wv(r,o,l)}return r}var ya=cme;function ume(e){return ya(e,Sl(e))}var dme=ume;function pme(e,t,r,i,s,n,a){var o=Tg(e,r),l=Tg(t,r),c=a.get(l);if(c){kg(e,r,c);return}var u=n?n(o,l,r+"",e,t,a):void 0,p=u===void 0;if(p){var h=Sr(l),f=!h&&Pn(l),_=!h&&!f&&K_(l);u=l,h||f||_?Sr(o)?u=o:tme(o)?u=YT(o):f?(p=!1,u=Av(l,!0)):_?(p=!1,u=XT(l,!0)):u=[]:eR(l)||No(l)?(u=o,No(o)?u=dme(o):(!Jr(o)||F_(o))&&(u=JT(l))):p=!1}p&&(a.set(l,u),s(u,l,i,n,a),a.delete(l)),kg(e,r,u)}var hme=pme;function tR(e,t,r,i,s){e!==t&&GA(t,function(n,a){if(s||(s=new Sn),Jr(n))hme(e,t,a,r,tR,i,s);else{var o=i?i(Tg(e,a),n,a+"",e,t,s):void 0;o===void 0&&(o=n),kg(e,a,o)}},Sl)}var fme=tR;function mme(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var gme=mme,Tw=Math.max;function _me(e,t,r){return t=Tw(t===void 0?e.length-1:t,0),function(){for(var i=arguments,s=-1,n=Tw(i.length-t,0),a=Array(n);++s<n;)a[s]=i[t+s];s=-1;for(var o=Array(t+1);++s<t;)o[s]=i[s];return o[t]=r(a),gme(e,this,o)}}var rR=_me;function vme(e){return function(){return e}}var yme=vme,bme=su?function(e,t){return su(e,"toString",{configurable:!0,enumerable:!1,value:yme(t),writable:!0})}:Q_,Eme=bme,wme=800,Sme=16,Cme=Date.now;function Ome(e){var t=0,r=0;return function(){var i=Cme(),s=Sme-(i-r);if(r=i,s>0){if(++t>=wme)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ame=Ome,xme=Ame(Eme),iR=xme;function kme(e,t){return iR(rR(e,t,Q_),e+"")}var Tme=kme;function Rme(e,t,r){if(!Jr(r))return!1;var i=typeof t;return(i=="number"?Xu(r)&&Zu(t,r.length):i=="string"&&t in r)?dl(r[t],e):!1}var Dme=Rme;function Ime(e){return Tme(function(t,r){var i=-1,s=r.length,n=s>1?r[s-1]:void 0,a=s>2?r[2]:void 0;for(n=e.length>3&&typeof n=="function"?(s--,n):void 0,a&&Dme(r[0],r[1],a)&&(n=s<3?void 0:n,s=1),t=Object(t);++i<s;){var o=r[i];o&&e(t,o,i,n)}return t})}var Lme=Ime,jTe=Lme(function(e,t,r,i){fme(e,t,r,i)});function Pme(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}var Nme=Pme;function Mme(e,t){return e&&ya(t,pl(t),e)}var Ume=Mme;function $me(e,t){return e&&ya(t,Sl(t),e)}var jme=$me;function Fme(e,t){return ya(e,H_(e),t)}var Bme=Fme;function Hme(e,t){return ya(e,NT(e),t)}var zme=Hme,Wme=Object.prototype,Kme=Wme.hasOwnProperty;function Gme(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&Kme.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var qme=Gme;function Vme(e,t){var r=t?xv(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Zme=Vme,Xme=/\w*$/;function Yme(e){var t=new e.constructor(e.source,Xme.exec(e));return t.lastIndex=e.lastIndex,t}var Jme=Yme,Rw=Ur?Ur.prototype:void 0,Dw=Rw?Rw.valueOf:void 0;function Qme(e){return Dw?Object(Dw.call(e)):{}}var ege=Qme,tge="[object Boolean]",rge="[object Date]",ige="[object Map]",sge="[object Number]",nge="[object RegExp]",age="[object Set]",oge="[object String]",lge="[object Symbol]",cge="[object ArrayBuffer]",uge="[object DataView]",dge="[object Float32Array]",pge="[object Float64Array]",hge="[object Int8Array]",fge="[object Int16Array]",mge="[object Int32Array]",gge="[object Uint8Array]",_ge="[object Uint8ClampedArray]",vge="[object Uint16Array]",yge="[object Uint32Array]";function bge(e,t,r){var i=e.constructor;switch(t){case cge:return xv(e);case tge:case rge:return new i(+e);case uge:return Zme(e,r);case dge:case pge:case hge:case fge:case mge:case gge:case _ge:case vge:case yge:return XT(e,r);case ige:return new i;case sge:case oge:return new i(e);case nge:return Jme(e);case age:return new i;case lge:return ege(e)}}var Ege=bge,wge="[object Map]";function Sge(e){return li(e)&&Mo(e)==wge}var Cge=Sge,Iw=Rs&&Rs.isMap,Oge=Iw?W_(Iw):Cge,Age=Oge,xge="[object Set]";function kge(e){return li(e)&&Mo(e)==xge}var Tge=kge,Lw=Rs&&Rs.isSet,Rge=Lw?W_(Lw):Tge,Dge=Rge,Ige=1,Lge=2,Pge=4,sR="[object Arguments]",Nge="[object Array]",Mge="[object Boolean]",Uge="[object Date]",$ge="[object Error]",nR="[object Function]",jge="[object GeneratorFunction]",Fge="[object Map]",Bge="[object Number]",aR="[object Object]",Hge="[object RegExp]",zge="[object Set]",Wge="[object String]",Kge="[object Symbol]",Gge="[object WeakMap]",qge="[object ArrayBuffer]",Vge="[object DataView]",Zge="[object Float32Array]",Xge="[object Float64Array]",Yge="[object Int8Array]",Jge="[object Int16Array]",Qge="[object Int32Array]",e_e="[object Uint8Array]",t_e="[object Uint8ClampedArray]",r_e="[object Uint16Array]",i_e="[object Uint32Array]",rt={};rt[sR]=rt[Nge]=rt[qge]=rt[Vge]=rt[Mge]=rt[Uge]=rt[Zge]=rt[Xge]=rt[Yge]=rt[Jge]=rt[Qge]=rt[Fge]=rt[Bge]=rt[aR]=rt[Hge]=rt[zge]=rt[Wge]=rt[Kge]=rt[e_e]=rt[t_e]=rt[r_e]=rt[i_e]=!0;rt[$ge]=rt[nR]=rt[Gge]=!1;function Tc(e,t,r,i,s,n){var a,o=t&Ige,l=t&Lge,c=t&Pge;if(r&&(a=s?r(e,i,s,n):r(e)),a!==void 0)return a;if(!Jr(e))return e;var u=Sr(e);if(u){if(a=qme(e),!o)return YT(e,a)}else{var p=Mo(e),h=p==nR||p==jge;if(Pn(e))return Av(e,o);if(p==aR||p==sR||h&&!s){if(a=l||h?{}:JT(e),!o)return l?zme(e,jme(a,e)):Bme(e,Ume(a,e))}else{if(!rt[p])return s?e:{};a=Ege(e,p,o)}}n||(n=new Sn);var f=n.get(e);if(f)return f;n.set(e,a),Dge(e)?e.forEach(function(E){a.add(Tc(E,t,r,E,e,n))}):Age(e)&&e.forEach(function(E,y){a.set(y,Tc(E,t,r,y,e,n))});var _=c?l?Cv:vf:l?Sl:pl,v=u?void 0:_(e);return Nme(v||e,function(E,y){v&&(y=E,E=e[y]),wv(a,y,Tc(E,t,r,y,e,n))}),a}var s_e=Tc;function n_e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var a_e=n_e;function o_e(e,t,r){var i=-1,s=e.length;t<0&&(t=-t>s?0:s+t),r=r>s?s:r,r<0&&(r+=s),s=t>r?0:r-t>>>0,t>>>=0;for(var n=Array(s);++i<s;)n[i]=e[i+t];return n}var l_e=o_e;function c_e(e,t){return t.length<2?e:Ju(e,l_e(t,0,-1))}var u_e=c_e,d_e=Object.prototype,p_e=d_e.hasOwnProperty;function h_e(e,t){t=pa(t,e);var r=-1,i=t.length;if(!i)return!0;for(;++r<i;){var s=Ds(t[r]);if(s==="__proto__"&&!p_e.call(e,"__proto__")||(s==="constructor"||s==="prototype")&&r<i-1)return!1}var n=u_e(e,t);return n==null||delete n[Ds(a_e(t))]}var f_e=h_e;function m_e(e){return eR(e)?void 0:e}var g_e=m_e,Pw=Ur?Ur.isConcatSpreadable:void 0;function __e(e){return Sr(e)||No(e)||!!(Pw&&e&&e[Pw])}var v_e=__e;function oR(e,t,r,i,s){var n=-1,a=e.length;for(r||(r=v_e),s||(s=[]);++n<a;){var o=e[n];t>0&&r(o)?t>1?oR(o,t-1,r,i,s):B_(s,o):i||(s[s.length]=o)}return s}var y_e=oR;function b_e(e){var t=e==null?0:e.length;return t?y_e(e,1):[]}var E_e=b_e;function w_e(e){return iR(rR(e,void 0,E_e),e+"")}var lR=w_e,S_e=1,C_e=2,O_e=4,FTe=lR(function(e,t){var r={};if(e==null)return r;var i=!1;t=J_(t,function(n){return n=pa(n,e),i||(i=n.length>1),n}),ya(e,Cv(e),r),i&&(r=s_e(r,S_e|C_e|O_e,g_e));for(var s=t.length;s--;)f_e(r,t[s]);return r});function A_e(e,t){return PT(e,t,function(r,i){return XA(e,i)})}var x_e=A_e,BTe=lR(function(e,t){return e==null?{}:x_e(e,t)});Qo();var k_e="Expected a function";function T_e(e){if(typeof e!="function")throw TypeError(k_e);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var R_e=T_e;function D_e(e,t){return MT(e,R_e(Qu(t)))}var I_e=D_e,P_e=re(()=>B({allowedDomains:X(O()).optional(),deniedDomains:X(O()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),strictAllowlist:G().optional().describe("When true, the sandbox runtime deterministically denies hosts not in allowedDomains instead of prompting. Enforced for sandboxed commands only \u2014 in-process tools such as WebFetch are not gated by this setting. Only honored from user, managed/policy, or CLI (--settings) settings \u2014 project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),allowManagedDomainsOnly:G().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:X(O()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:G().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:G().optional(),allowMachLookup:X(O().refine(e=>!(e.endsWith("*")?e.slice(0,-1):e).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:Oe().optional(),socksProxyPort:Oe().optional(),tlsTerminate:B({caCertPath:O().min(1).optional(),caKeyPath:O().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session. On native Windows an ephemeral CA cannot pass the sandbox trust check, so omitting the paths uses a persistent CA managed by the sandbox runtime (set up and trusted via /sandbox install); configured paths are passed to the sandbox runtime verbatim, which rejects a bad or incomplete pair at sandbox initialization. Only honored from user, managed/policy, or CLI (`--settings`) settings \u2014 project settings (.claude/settings.json and .claude/settings.local.json) are ignored.")}).optional()),N_e=re(()=>B({allowWrite:X(O()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:X(O()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:X(O()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:X(O()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:G().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:G().optional().describe("macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would withhold every access grant rather than loosen them \u2014 filesystem isolation stays on there. Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files deny entries for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.files mask entries (sentinel binds) and credentials.envVars deny/mask are unaffected. Only honored from user, managed/policy, or CLI (`--settings`) settings \u2014 project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files deny entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable file. (sandbox.credentials.envVars and credentials.files mask entries do not pin it \u2014 env scrubbing and sentinel binds are independent of the filesystem layer and survive this setting.) When unset, filesystem isolation stays on.")}).optional());function cR(e,t,r){(e.length===0||e.some(i=>i.length===0))&&r.addIssue({code:pi.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim \u2014 omit maskClaims for whole-token masking."}),t===void 0&&r.addIssue({code:pi.custom,path:["maskClaims"],message:"maskClaims requires decode \u2014 without a decode format there is no token to read claims from. Set decode, or omit maskClaims."})}function uR(e,t){let r;try{r=new RegExp(e)}catch(i){t.addIssue({code:pi.custom,path:["extract"],message:`extract is not a valid regular expression: ${Cs(i)}`});return}new RegExp(r.source+"|").exec("").length-1<1&&t.addIssue({code:pi.custom,path:["extract"],message:'extract must contain at least one capturing group \u2014 group 1 is the credential value to mask (e.g. "token:\\s*(\\S+)").'})}function dR(e){if(typeof e!="object"||e===null)return e;let t=e;if(t.mode!=="deny")return e;let r={...t};return"extract"in r&&typeof r.extract!="string"&&delete r.extract,"onExtractNoMatch"in r&&r.onExtractNoMatch!=="warn"&&r.onExtractNoMatch!=="deny"&&r.onExtractNoMatch!=="error"&&delete r.onExtractNoMatch,"decode"in r&&r.decode!=="jwt"&&delete r.decode,"maskClaims"in r&&!(Array.isArray(r.maskClaims)&&r.maskClaims.every(i=>typeof i=="string"))&&delete r.maskClaims,"maskDuplicates"in r&&typeof r.maskDuplicates!="boolean"&&delete r.maskDuplicates,"injectHosts"in r&&!(Array.isArray(r.injectHosts)&&r.injectHosts.every(i=>typeof i=="string"))&&delete r.injectHosts,r}var Rg=re(()=>at(dR,B({path:O().min(1).describe("Path to a credential file or directory. Same resolution as sandbox.filesystem.* paths: absolute, ~ expanded, or relative to the settings file root (project root for project settings, ~/.claude for user settings)."),mode:me(["deny","mask"]).describe("Access mode for this path. `deny` blocks reads inside the sandbox; `mask` shows sandboxed commands a sentinel-substituted copy (whole-file, or only the spans captured by `extract`) and the host proxy swaps sentinel\u2192real on egress to `injectHosts`. On macOS and Windows `mask` currently degrades to `deny`."),extract:O().optional().describe("Optional regex for structured masking when mode is `mask`. Applied globally to the file; capture group 1 of each match is a credential value, and only those captured spans are replaced with sentinels \u2014 the rest of the file is preserved so a tool that parses it (.netrc, JSON, YAML) still succeeds. Without `extract`, the entire file content is replaced with one sentinel (whole-file masking, suited to single-secret files). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`."),onExtractNoMatch:me(["warn","deny","error"]).optional().describe("What to do when `extract` matches nothing in the file \u2014 or, with `decode`, when no candidate survives verification. `warn` (default) emits a stderr warning and leaves the file readable as-is inside the sandbox (fail-open, for credentials that may be legitimately absent); `deny` degrades the entry to mode `deny` so the file is unreadable (fail-closed) \u2014 under `sandbox.filesystem.disabled` it is treated as `error`, since read-denies are dropped in that mode; `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise."),decode:me(["jwt"]).optional().describe("Optional encoded-credential format for `mask` mode. `jwt`: candidates are located with a built-in JWT regex (or the explicit `extract` pattern, if set), verified to actually be JWTs before masking, and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working. If no candidate verifies, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`."),maskClaims:X(O()).optional().describe("Names of top-level payload claims to mask inside each decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so a tool that decodes the token and reads a non-secret claim keeps working. Requires `decode`. If no named claim matches in any verified token, behavior is governed by `onExtractNoMatch` (default `warn`). Only meaningful when mode is `mask`; accepted but ignored for `deny`."),maskDuplicates:G().optional().describe("If true, verbatim occurrences of each captured credential value outside the regex-matched spans are also replaced with the corresponding sentinel \u2014 for a secret repeated where the regex does not reach (e.g. pasted into a comment). Matches raw substrings, so short or common values may corrupt unrelated content; intended for long, high-entropy secrets. Defaults to false. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise."),injectHosts:X(O()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to `network.allowedDomains` \u2014 the credential is injected at every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((e,t)=>{e.mode==="mask"&&e.path.endsWith("/")&&t.addIssue({code:pi.custom,path:["path"],message:'Credential mode "mask" applies to a single file, not a directory. List the specific credential file(s), or use "deny" for the directory.'}),e.mode==="mask"&&e.extract!==void 0&&uR(e.extract,t),e.mode==="mask"&&e.maskClaims!==void 0&&cR(e.maskClaims,e.decode,t)}))),Ao=()=>O().regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable name must start with a letter or underscore and contain only letters, digits, and underscores"),Dg=re(()=>at(dR,B({name:Ao().describe("Environment variable name."),mode:me(["deny","mask"]).describe("Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the host proxy swaps sentinel\u2192real on egress to `injectHosts`."),extract:O().optional().describe("Optional regex for structured masking when mode is `mask`. Applied globally to the value; capture group 1 of each match is a credential value, and only those captured spans are replaced with sentinels \u2014 the rest of the value is preserved so a tool that parses it (a `DATABASE_URL` connection string, a composite `KEY:SECRET` pair) still succeeds inside the sandbox. Without `extract`, the entire value is replaced with one sentinel (whole-value masking, suited to bare tokens). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Cannot be combined with `decode` (the decode path never consults it). Accepted but ignored for `deny`."),onExtractNoMatch:me(["warn","deny","error"]).optional().describe("What to do when `extract` matches nothing in the value. `warn` (default) emits a stderr warning and lets the variable pass through unmasked (fail-open, for credentials that may be legitimately absent); `deny` unsets the variable inside the sandbox (fail-closed); `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` is set without `decode`. On a mask entry with `decode`, the runtime takes the decode path and never consults this field, so a fail-closed setting cannot be honored \u2014 `deny` and `error` are rejected there; only `warn` is accepted. In all other shapes the field is accepted but ignored."),decode:me(["jwt"]).optional().describe("Optional encoded-credential format for `mask` mode. `jwt`: the variable's whole value is verified to actually be a JWT and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working; the proxy swaps the whole fake token on egress. If the value does not verify, the variable is left unmasked with a stderr warning (fail-open). Cannot be combined with `extract` \u2014 the decode path never consults it. Accepted but ignored for `deny`."),maskClaims:X(O()).optional().describe("Names of top-level payload claims to mask inside the decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so claim-reading clients keep working. Requires `decode`. If no named claim matches, the variable is left unmasked with a stderr warning (fail-open). Only meaningful when mode is `mask`; accepted but ignored for `deny`."),injectHosts:X(O()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to `network.allowedDomains` \u2014 the credential is injected at every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((e,t)=>{e.mode==="mask"&&e.extract!==void 0&&uR(e.extract,t),e.mode==="mask"&&e.maskClaims!==void 0&&cR(e.maskClaims,e.decode,t),e.mode==="mask"&&e.decode!==void 0&&e.extract!==void 0&&t.addIssue({code:pi.custom,path:["extract"],message:"extract cannot be combined with decode on an env entry \u2014 the runtime takes the decode path (whole-value JWT verification) and never consults extract, silently disabling the structured masking. Remove one of the two."}),e.mode==="mask"&&e.decode!==void 0&&(e.onExtractNoMatch==="deny"||e.onExtractNoMatch==="error")&&t.addIssue({code:pi.custom,path:["onExtractNoMatch"],message:"onExtractNoMatch cannot be honored on an env entry with decode \u2014 the runtime takes the decode path (which is unconditionally fail-open on verify failure) and never consults extract or onExtractNoMatch. Remove onExtractNoMatch, or drop decode to use extract-based masking (whose no-match handling does honor it)."})}))),Hp=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],Mw="_INVALID_PAIR_";var Ig=re(()=>B({accessKeyIdVar:Ao().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:Ao().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:Ao().optional().describe("Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.")}).superRefine((e,t)=>{let r=new Map;for(let[i,s]of[["accessKeyIdVar",e.accessKeyIdVar],["secretAccessKeyVar",e.secretAccessKeyVar],["sessionTokenVar",e.sessionTokenVar]]){if(s===void 0)continue;let n=r.get(s);n!==void 0?t.addIssue({code:pi.custom,path:[i],message:`${i} names the same env var ('${s}') as ${n} \u2014 each pair member must be a distinct variable.`}):r.set(s,i)}})),M_e=re(()=>{let e=me(["deny","passthrough"]);return B({streaming:e.optional().describe("Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature)."),presigned:e.optional().describe("Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`."),sigv4a:e.optional().describe("Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.")})}),U_e=re(()=>B({files:X(Rg()).optional().describe("Credential files or directories to protect. `deny` blocks reads inside the sandbox; `mask` substitutes a sentinel inside the sandbox (whole-file, or per-`extract` capture) and injects the real value at the proxy. On macOS and Windows `mask` degrades to `deny`."),envVars:X(Dg()).optional().describe("Environment variables to protect. `deny` unsets the variable for sandboxed commands; `mask` substitutes a sentinel inside the sandbox and injects the real value at the proxy."),allowPlaintextInject:G().optional().describe("Allow sentinel\u2192real substitution on the plain-HTTP proxy path. Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) settings \u2014 project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),awsPairs:X(Ig()).optional().describe("Explicit groupings of masked env vars into AWS credential pairs for SigV4 re-signing, for non-standard variable names. The conventional AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN trio is paired automatically when masked. Only honored from user, managed/policy, or CLI (`--settings`) settings \u2014 project settings (.claude/settings.json and .claude/settings.local.json) are ignored. A member is only usable when its env var is forwarded as a whole-value `mask` entry (an entry carrying `extract` or `decode` does not qualify \u2014 re-signing needs the whole real value). A pair whose key id or secret member is unusable never re-signs: it is dropped, unless it names a conventional AWS variable, in which case it is forwarded as an inert suppressor so implicit auto-pairing stays overridden. A pair whose ONLY unusable member is the session token still re-signs, without an x-amz-security-token (temporary-credential requests fail upstream until the entry is fixed)."),sigv4:M_e().optional().describe("Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) settings \u2014 project settings (.claude/settings.json and .claude/settings.local.json) are ignored.")}).superRefine((e,t)=>{let r=new Set;for(let[i,s]of(e?.awsPairs??[]).entries()){let n=[["accessKeyIdVar",s.accessKeyIdVar],["secretAccessKeyVar",s.secretAccessKeyVar],["sessionTokenVar",s.sessionTokenVar]],a=new Set;for(let[o,l]of n)l!==void 0&&(r.has(l)&&t.addIssue({code:pi.custom,path:["awsPairs",i,o],message:`"${l}" appears in more than one awsPairs slot (within or across pairs) \u2014 each variable can fill exactly one slot.`}),a.add(l));for(let o of a)r.add(o)}}).optional()),pR=re(()=>B({enabled:G().optional(),failIfUnavailable:G().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:G().optional(),allowUnsandboxedCommands:G().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:P_e(),filesystem:N_e(),credentials:U_e(),ignoreViolations:Ee(O(),X(O())).optional(),enableWeakerNestedSandbox:G().optional(),enableWeakerNetworkIsolation:G().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** \u2014 opens a potential data exfiltration vector through the trustd service. Default: false"),allowAppleEvents:G().optional().describe("macOS only: Allow sandboxed commands to send Apple Events (and look up the appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based auth flows that open URLs. **Removes code-execution isolation** \u2014 sandboxed commands can launch other applications unsandboxed with no user prompt, and can script running apps (e.g. Terminal) subject to the user's per-app TCC automation consent. Only honored from user, managed/policy, or CLI (--settings) settings \u2014 project settings (.claude/settings.json and .claude/settings.local.json) are ignored. Default: false"),excludedCommands:X(O()).optional(),ripgrep:B({command:O(),args:X(O()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support. Only honored from user, managed/policy, or CLI (--settings) settings \u2014 project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),bwrapPath:at(e=>typeof e=="string"&&Nw(e)?e:void 0,O()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:at(e=>typeof e=="string"&&Nw(e)?e:void 0,O()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());function $_e(e){let t=0,r=e.length;for(;t<r&&Uw(e.charCodeAt(t));)t++;for(;r>t&&Uw(e.charCodeAt(r-1));)r--;let i=j_e(e.slice(t,r));if(i!==-1)return{kind:"line_break",index:zp(e,t+i)};for(let s=t;s<r;s++){let n=e.charCodeAt(s);if(n===0)return{kind:"nul",index:zp(e,s)};if(n>255)return{kind:"non_ascii",index:zp(e,s),codePoint:F_e(e,s)}}return null}function j_e(e){let t=e.indexOf(`
|
|
168
|
+
`),r=e.indexOf("\r");return t===-1?r:r===-1?t:Math.min(t,r)}function Uw(e){return e===9||e===32||e===10||e===13}function F_e(e,t){return e.codePointAt(t)??e.charCodeAt(t)}function zp(e,t){let r=0;for(let i=0;i<t;i++){let s=e.charCodeAt(i);s>=55296&&s<=56319&&i+1<e.length&&(e.charCodeAt(i+1)&64512)===56320&&i++,r++}return r}var hR=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_GATEWAY","ANTHROPIC_FOUNDRY_RESOURCE","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_AWS_WORKSPACE_ID","ANTHROPIC_GOOGLE_CLOUD_PROJECT","ANTHROPIC_GOOGLE_CLOUD_LOCATION","ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID","CLOUD_ML_REGION"],$w=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"],jw="OTEL_EXPORTER_OTLP_";var XTe=[jw,`ANT_${jw}`],YTe={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...$w,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...$w,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],gcpAuthRefresh:["CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL"]},B_e=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"],fR=["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_TOKEN","CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL","CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL","CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL","CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL",...B_e],H_e=[{endpoint:"ANTHROPIC_BASE_URL",companions:["_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_BEDROCK_BASE_URL",selection:"CLAUDE_CODE_USE_BEDROCK",companions:["CLAUDE_CODE_SKIP_BEDROCK_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_VERTEX_BASE_URL",selection:"CLAUDE_CODE_USE_VERTEX",companions:["CLAUDE_CODE_SKIP_VERTEX_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_FOUNDRY_BASE_URL",selection:"CLAUDE_CODE_USE_FOUNDRY",companions:["CLAUDE_CODE_SKIP_FOUNDRY_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_AWS_BASE_URL",selection:"CLAUDE_CODE_USE_ANTHROPIC_AWS",companions:["CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_GOOGLE_CLOUD_BASE_URL",selection:"CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD",companions:["CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_BEDROCK_MANTLE_BASE_URL",selection:"CLAUDE_CODE_USE_MANTLE",companions:["CLAUDE_CODE_SKIP_MANTLE_AUTH","ANTHROPIC_CUSTOM_HEADERS"]}],JTe=ld(H_e.flatMap(e=>[e.endpoint,...e.companions])),mR=["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_BEARER_TOKEN_BEDROCK","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_FOUNDRY_AUTH_TOKEN","ANTHROPIC_AWS_API_KEY"],z_e=["CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH"],gR=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT","CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT"],_R=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],W_e=["CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR","CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR","CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR","CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR"],QTe=["CLAUDE_CODE_OAUTH_TOKEN",...W_e,"CLAUDE_CODE_ARTIFACTS_API_TOKEN","CLAUDE_CODE_SLACK_TAG_TOKEN","CLAUDE_CODE_HFI_BEARER_TOKEN","CLAUDE_BRIDGE_OAUTH_TOKEN","CLAUDE_TRUSTED_DEVICE_TOKEN","AGENT_PROXY_AUTH_TOKEN","CLAUDE_CODE_MCP_SERVE_AUTH_TOKEN","CLAUDE_BG_AUTH_SNAPSHOT_PATH","CLAUDE_BG_SOCKET_TOKENS_PATH","CLAUDE_BG_RV_AUTH","CLAUDE_BG_PTY_AUTH","CLAUDE_BG_CLAIM_AUTH"],K_e=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],vR=[...K_e,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"],yR=["AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","AWS_EC2_METADATA_SERVICE_ENDPOINT","AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_ROLE_ARN"],bR=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],eRe=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...hR,...fR,...mR,...z_e,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...vR,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...bR,...yR,"AWS_REGION","AWS_DEFAULT_REGION",...gR,"ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_BEDROCK_REGION_PREFIX","CLAUDE_CODE_CERT_STORE","DISABLE_GROWTHBOOK","CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CONTEXT_COLLAPSE_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE",..._R]),G_e=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],ER=["bwrapPath","ripgrep","socatPath"],q_e=["allowAppleEvents","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],V_e=new Set(["ANTHROPIC_BEDROCK_REGION_PREFIX","ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_SMALL_FAST_MODEL","AWS_DEFAULT_REGION","AWS_PROFILE","AWS_REGION","BASH_DEFAULT_TIMEOUT_MS","BASH_MAX_OUTPUT_LENGTH","BASH_MAX_TIMEOUT_MS","CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR","CLAUDE_CODE_API_KEY_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_TERMINAL_TITLE","CLAUDE_CODE_ENABLE_AUTO_MODE","CLAUDE_CODE_ENABLE_DESIGN_SYNC","CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL","CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS","CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL","CLAUDE_CODE_MAX_OUTPUT_TOKENS","CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_GATEWAY","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_POWERSHELL_TOOL","CLAUDE_CODE_USE_VERTEX","DISABLE_AUTOUPDATER","DISABLE_BUG_COMMAND","DISABLE_COST_WARNINGS","DISABLE_FEEDBACK_COMMAND","DISABLE_GROWTHBOOK","DISABLE_INSTALLATION_CHECKS","DISABLE_UPDATES","ENABLE_TOOL_SEARCH","MAX_MCP_OUTPUT_TOKENS","MAX_THINKING_TOKENS","MCP_CONNECT_TIMEOUT_MS","MCP_TIMEOUT","MCP_TOOL_TIMEOUT","OTEL_EXPORTER_OTLP_COMPRESSION","OTEL_EXPORTER_OTLP_HEADERS","OTEL_EXPORTER_OTLP_LOGS_COMPRESSION","OTEL_EXPORTER_OTLP_LOGS_HEADERS","OTEL_EXPORTER_OTLP_LOGS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_COMPRESSION","OTEL_EXPORTER_OTLP_METRICS_HEADERS","OTEL_EXPORTER_OTLP_METRICS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_EXPORTER_OTLP_TRACES_COMPRESSION","OTEL_EXPORTER_OTLP_TRACES_HEADERS","OTEL_EXPORTER_OTLP_TRACES_PROTOCOL","OTEL_LOG_ASSISTANT_RESPONSES","OTEL_LOG_TOOL_CONTENT","OTEL_LOG_TOOL_DETAILS","OTEL_LOG_USER_PROMPTS","OTEL_LOGS_EXPORT_INTERVAL","OTEL_LOGS_EXPORTER","OTEL_METRIC_EXPORT_INTERVAL","OTEL_METRICS_EXPORTER","OTEL_METRICS_INCLUDE_ACCOUNT_UUID","OTEL_METRICS_INCLUDE_ENTRYPOINT","OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES","OTEL_METRICS_INCLUDE_SESSION_ID","OTEL_METRICS_INCLUDE_VERSION","OTEL_RESOURCE_ATTRIBUTES","OTEL_SERVICE_NAME","OTEL_TRACES_EXPORT_INTERVAL","OTEL_TRACES_EXPORTER","USE_BUILTIN_RIPGREP","VERTEX_REGION_CLAUDE_3_5_HAIKU","VERTEX_REGION_CLAUDE_3_5_SONNET","VERTEX_REGION_CLAUDE_3_7_SONNET","VERTEX_REGION_CLAUDE_4_0_OPUS","VERTEX_REGION_CLAUDE_4_0_SONNET","VERTEX_REGION_CLAUDE_4_1_OPUS","VERTEX_REGION_CLAUDE_4_5_OPUS","VERTEX_REGION_CLAUDE_4_6_OPUS","VERTEX_REGION_CLAUDE_4_7_OPUS","VERTEX_REGION_CLAUDE_4_8_OPUS","VERTEX_REGION_CLAUDE_5_OPUS","VERTEX_REGION_CLAUDE_FABLE_5","VERTEX_REGION_CLAUDE_FABLE_5_1","VERTEX_REGION_CLAUDE_4_5_SONNET","VERTEX_REGION_CLAUDE_4_6_SONNET","VERTEX_REGION_CLAUDE_5_SONNET","VERTEX_REGION_CLAUDE_HAIKU_4_5","CLAUDE_AUTOCOMPACT_PCT_OVERRIDE","CLAUDE_CODE_AUTO_COMPACT_WINDOW","CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT","CLAUDE_CODE_MAX_CONTEXT_TOKENS","DISABLE_AUTO_COMPACT","DISABLE_COMPACT","CLAUDE_CODE_ALWAYS_ENABLE_EFFORT","CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING","CLAUDE_CODE_DISABLE_FAST_MODE","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK","CLAUDE_CODE_DISABLE_THINKING","CLAUDE_CODE_EFFORT_LEVEL","CLAUDE_CODE_PROMPT_CACHE_TTL","CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL","DISABLE_INTERLEAVED_THINKING","DISABLE_PROMPT_CACHING","DISABLE_PROMPT_CACHING_FABLE","DISABLE_PROMPT_CACHING_HAIKU","DISABLE_PROMPT_CACHING_OPUS","DISABLE_PROMPT_CACHING_SONNET","ENABLE_PROMPT_CACHING_1H","ENABLE_PROMPT_CACHING_1H_BEDROCK","FALLBACK_FOR_ALL_PRIMARY_MODELS","FORCE_PROMPT_CACHING_5M","CLAUDE_AUTO_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_ADVISOR_TOOL","CLAUDE_CODE_DISABLE_AGENT_VIEW","CLAUDE_CODE_DISABLE_ARTIFACT","CLAUDE_CODE_DISABLE_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_BUNDLED_SKILLS","CLAUDE_CODE_DISABLE_CRON","CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS","CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY","CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING","CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND","CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE","CLAUDE_CODE_DISABLE_WORKFLOWS","CLAUDE_CODE_ENABLE_AWAY_SUMMARY","CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING","CLAUDE_CODE_ENABLE_FUNCTION_HOOKS","CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION","CLAUDE_CODE_ENABLE_TASKS","CLAUDE_CODE_FORK_SUBAGENT","CLAUDE_CODE_PLAN_MODE_REQUIRED","DISABLE_DOCTOR_COMMAND","DISABLE_EXTRA_USAGE_COMMAND","DISABLE_INSTALL_GITHUB_APP_COMMAND","DISABLE_LOGIN_COMMAND","DISABLE_LOGOUT_COMMAND","DISABLE_UPGRADE_COMMAND","CLAUDE_AX_SCREEN_READER","CLAUDE_CODE_ACCESSIBILITY","CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN","CLAUDE_CODE_DISABLE_MOUSE","CLAUDE_CODE_DISABLE_MOUSE_CLICKS","CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL","CLAUDE_CODE_FORCE_STRIKETHROUGH","CLAUDE_CODE_HIDE_CWD","CLAUDE_CODE_NATIVE_CURSOR","CLAUDE_CODE_NO_FLICKER","CLAUDE_CODE_SCROLL_SPEED","CLAUDE_CODE_SYNTAX_HIGHLIGHT","API_TIMEOUT_MS","CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS","CLAUDE_CODE_COORDINATOR_WORKER_CHECKIN_SECONDS","CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS","CLAUDE_CODE_GLOB_TIMEOUT_SECONDS","CLAUDE_CODE_MAX_RETRIES","CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION","CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY","CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION","CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS","CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT","CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS","CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS","CLAUDE_STREAM_IDLE_TIMEOUT_MS","MAX_STRUCTURED_OUTPUT_RETRIES","MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE","MCP_SERVER_CONNECTION_BATCH_SIZE","SLASH_COMMAND_TOOL_CHAR_BUDGET","TASK_MAX_OUTPUT_LENGTH","MCP_CONNECTION_NONBLOCKING","CLAUDE_ENABLE_BYTE_WATCHDOG","CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK","CLAUDE_ENABLE_STREAM_WATCHDOG"]),Z_e=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),X_e=new Set(["ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),Y_e=/auth|key|token|cookie|secret|credential|session|signature|passw|jwt|assertion|cert|oidc|org|tenant|account|project|workspace|user|email|identity|principal|consumer|client|host|url|base|target|upstream|endpoint|proxy|forward|route|fallback|override|apigw|x-goog-|l5d-|bypass|guardrail|amz|x-ms-|azureml|extra-parameters|envoy|helicone|litellm|cf-aig|cf-access|beta|version/;function J_e(e){return/\r(?!\n)/.test(e)?!0:e.split(/\n|\r\n/).some(t=>{let r=t.indexOf(":");if(r===-1)return!1;let i=t.slice(0,r).trim();return!Q_e.test(i)||$_e(t.slice(r+1))!==null||Y_e.test(i.toLowerCase())})}var Q_e=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function eve(e,t){let r=e.toUpperCase();return V_e.has(r)||Z_e.has(r)&&st(t)||X_e.has(r)&&PS(t)||r==="ANTHROPIC_CUSTOM_HEADERS"&&!J_e(t)}var Ed=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],tve=[...Ed],rve=tve;function kv(e){return e==="manual"?"default":e}var rRe=`Cannot set permission mode: must be one of ${Ed.join(", ")}`;var ive=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"],sve=["normal","vim"],nve=["auto","12-hour","24-hour","24-hour-utc"],ave=["auto","tmux","iterm2","in-process"],ove=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],lve=["auto",...ove],cve=["auto","alwaysAsk","disabled"],uve=1e5,dve=1e6,pve=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function hve(e){return new RegExp(pve).test(e)}var iRe=re(()=>me(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),sRe=re(()=>me(["stdio","sse","sse-ide","http","ws","sdk"])),ba=re(()=>le("comms").optional().catch(void 0)),ns=re(()=>Oe().int().positive()),fve=3e5,CR=re(()=>Oe().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function OR({request_timeout_ms:e,...t}){return{...t,...t.timeout===void 0&&e!==void 0&&{timeout:Math.min(e,fve)}}}var mve=re(()=>B({type:le("stdio").optional(),command:O().min(1,"Command cannot be empty"),args:X(O()).default([]),env:Ee(O(),O()).optional(),timeout:ns().optional(),alwaysLoad:G().optional(),role:ba()})),gve=re(()=>G()),AR=re(()=>B({clientId:O().optional(),callbackPort:Oe().int().positive().optional(),authServerMetadataUrl:O().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:O().min(1).optional(),xaa:gve().optional()})),xR=re(()=>B({name:O(),permission_policy:me(["always_allow","always_ask","always_deny"]).optional()})),kR=re(()=>B({type:le("sse"),url:O(),headers:Ee(O(),O()).optional(),headersHelper:O().optional(),oauth:AR().optional(),timeout:ns().optional(),request_timeout_ms:CR(),tools:X(xR()).optional(),alwaysLoad:G().optional(),discoveryCache:G().optional(),role:ba(),toolPermissions:Ee(O(),Tv()).optional()}).transform(OR)),_ve=re(()=>B({type:le("sse-ide"),url:O(),ideName:O(),ideRunningInWindows:G().optional(),timeout:ns().optional(),alwaysLoad:G().optional(),role:ba()})),vve=re(()=>B({type:le("ws-ide"),url:O(),ideName:O(),authToken:O().optional(),ideRunningInWindows:G().optional(),timeout:ns().optional(),alwaysLoad:G().optional(),role:ba()})),TR=re(()=>B({type:me(["http","streamable-http"]).transform(()=>"http"),url:O(),headers:Ee(O(),O()).optional(),headersHelper:O().optional(),oauth:AR().optional(),timeout:ns().optional(),request_timeout_ms:CR(),tools:X(xR()).optional(),alwaysLoad:G().optional(),discoveryCache:G().optional(),role:ba(),toolPermissions:Ee(O(),Tv()).optional()}).transform(OR)),yve=["command","args","env","headersHelper"],bve=new Set(["http","streamable-http","sse"]),Eve=/[\p{Cc}\p{Cf}\u2028\u2029]/u,wve=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function RR(e){return/^[A-Za-z0-9_-]+$/.test(e)&&e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function Sve(e){try{let t=new URL(e);return t.protocol==="https:"&&t.hostname!==""}catch{return!1}}function DR(e,t="",r=0){return typeof e=="string"?[[t,e,!1]]:r>4||e===null||typeof e!="object"?[]:Object.entries(e).flatMap(([i,s])=>{let n=i.replace(wve,o=>`\\u${o.codePointAt(0).toString(16).padStart(4,"0")}`),a=t?`${t}.${n}`:n;return[[a,i,!0],...DR(s,a,r+1)]})}var IR=re(()=>Ee(O(),$e()).check(e=>{let t=(i,s)=>{e.issues.push({code:"custom",path:i,message:s,input:e.value})};for(let i of yve)Object.hasOwn(e.value,i)&&t([i],`"${i}" is not allowed in managed settings: only http/sse URL servers can be delivered this way, and a managed settings document must not name a program to run`);bve.has(e.value.type)||t(["type"],'managed settings can only deliver "http" or "sse" servers');let r=e.value.url;typeof r=="string"&&!Sve(r)&&t(["url"],"managed settings servers must use a valid https:// url");for(let[i,s,n]of DR(e.value))Eve.test(s)?t(i.split("."),"contains control or invisible format characters (in a key or a value); a managed settings document must not be able to print escape sequences"):!n&&hve(s)&&t(i.split("."),"${VAR} references are not expanded in managed settings; use a literal value (a managed settings document must not read the user's environment)")}).pipe(Re([TR(),kR()]))),LR=`"managedMcpServers" must be an object keyed by server name (the .mcp.json mcpServers shape; Claude Desktop's array form of its same-named key is not accepted here: use the server name as the key and "type" instead of "transport"). No managed MCP servers are installed from it until it is fixed.`;function PR(e,t){if(e===void 0)return;if(e===null||typeof e!="object"||Array.isArray(e)){t("",LR);return}let r=Object.create(null);for(let[i,s]of Object.entries(e)){if(!RR(i)){t("<invalid name>","server names may only contain letters, numbers, hyphens and underscores");continue}let n=IR().safeParse(s);if(n.success){r[i]=n.data;continue}let a=n.error.issues[0];t(i,a?[a.path.join("."),a.message].filter(Boolean).join(": "):"failed validation")}return r}var Cve=re(()=>B({type:le("ws"),url:O(),headers:Ee(O(),O()).optional(),headersHelper:O().optional(),timeout:ns().optional(),alwaysLoad:G().optional(),role:ba()})),Ove=re(()=>B({type:le("sdk"),name:O(),timeout:ns().optional(),alwaysLoad:G().optional()})),Tv=re(()=>me(["allow","ask","blocked"])),Ave=re(()=>B({type:le("claudeai-proxy"),url:O(),id:O(),displayName:O().optional(),iconUrl:O().optional(),timeout:ns().optional(),alwaysLoad:G().optional(),toolPermissions:Ee(O(),Tv()).optional(),stateless:G().optional(),cachedInitResponse:Ee(O(),$e()).nullish(),discoverSupport:me(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:Ee(O(),$e()).nullish(),eligible:G().nullish(),ineligibleReason:O().nullish(),enterpriseManaged:G().optional()})),Lg=re(()=>Re([mve(),kR(),_ve(),vve(),TR(),Cve(),Ove(),Ave()])),nRe=re(()=>B({mcpServers:Ee(O(),Lg())})),aRe=nv()==="macos"?"\u23FA":"\u25CF",oRe=re(()=>at(kv,me(rve))),lRe=re(()=>at(kv,me(Ed))),Dve=new Set(["metadata.google.internal","metadata.goog","metadata","instance-data","instance-data.ec2.internal","ip6-localhost","ip6-loopback","localhost.localdomain","localhost4","localhost4.localdomain4","localhost6","localhost6.localdomain6"]),Fw=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]);function Bw(e,t,r,i){return e===127||e===169&&t===254||e===0}function Ive(e){let t=e.indexOf("%"),r=(t>=0?e.slice(0,t):e).toLowerCase().split("::");if(r.length>2)return;let i=r[0]?r[0].split(":"):[],s=r.length===2&&r[1]?r[1].split(":"):[],n=r.length===2?s:i,a=[],o=n.at(-1);if(o!==void 0&&o.includes(".")){let h=o.split(".").map(Number);if(h.length!==4||h.some(f=>!Number.isInteger(f)||f<0||f>255))return;a=h,n.pop()}let l=h=>{let f=[];for(let _ of h){if(!/^[0-9a-f]{1,4}$/.test(_))return;let v=parseInt(_,16);f.push(v>>8,v&255)}return f},c=l(r.length===2?i:[]),u=l(n);if(c===void 0||u===void 0)return;let p=c.length+u.length+a.length;if(!(p>16||r.length===1&&p!==16))return[...c,...Array(16-p).fill(0),...u,...a]}function Lve(e){return NR(e)&&e[4]===0&&e[5]===1}function NR(e){return e[0]===0&&e[1]===100&&e[2]===255&&e[3]===155}function Pve(e){let t=[];e[0]===32&&e[1]===2&&t.push(e.slice(2,6));let r=e.slice(0,10).every(o=>o===0),i=r&&e[10]===255&&e[11]===255,s=r&&e[10]===0&&e[11]===0,n=NR(e)&&e.slice(4,12).every(o=>o===0),a=(e[8]===0||e[8]===2)&&e[9]===0&&e[10]===94&&e[11]===254;return(i||s||n||a)&&t.push(e.slice(12,16)),t}function Nve(e){let t=e.toLowerCase().replace(/^\[|\]$/g,"");if(t.endsWith(".")&&(t=t.slice(0,-1)),t===""||t==="localhost"||t.endsWith(".localhost")||Dve.has(t)||t.startsWith("instance-data.")&&t.endsWith(".compute.internal"))return!0;if(Tve(t)){if(Fw.has(t))return!0;let[i=0,s=0,n=0,a=0]=t.split(".").map(Number);return Bw(i,s,n,a)}if(!Rve(t))return!1;let r=Ive(t);return r===void 0||Lve(r)||r.every(i=>i===0)||r.slice(0,15).every(i=>i===0)&&r[15]===1||t==="fd00:ec2::254"||r[0]===254&&(r[1]??0)>=128&&(r[1]??0)<=191?!0:Pve(r).some(i=>{let[s=0,n=0,a=0,o=0]=i;return Bw(s,n,a,o)||Fw.has(`${s}.${n}.${a}.${o}`)})}var Mve=["bash","powershell"],ro=re(()=>O().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));function Uve(){let e=B({type:le("command").describe("Shell command hook type"),command:O().describe("Shell command to execute"),args:X(O()).optional().describe("Argument list for exec form. When present, `command` is resolved as an executable and spawned directly with these arguments \u2014 no shell. Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:ro(),shell:me(Mve).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:Oe().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:O().optional().describe("Custom status message to display in spinner while hook runs"),once:G().optional().describe("If true, hook runs once and is removed after execution"),async:G().optional().describe("If true, hook runs in background without blocking"),asyncRewake:G().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:O().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:O().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".'),cloud:me(["device","skip"]).optional().catch("skip").describe("@internal Where this hook may run when a cloud session is driven from this machine. 'device': offer it to the cloud session and run it here even when its script sits where the cloud session can write on this machine or cannot be pinned \u2014 the author accepts that the session may have changed files this hook executes. 'skip': never offer it to cloud sessions. Omit for the default: a command hook whose script could be read and pinned and lies outside everything the cloud session can write here is offered; other command hooks are not. Applies to this entry only: the same hook written in another settings scope keeps its own setting. An unrecognised value reads as 'skip' (the file still loads; the hook stays on this machine).")}),t=B({type:le("prompt").describe("LLM prompt hook type"),prompt:O().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:ro(),timeout:Oe().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:O().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),continueOnBlock:G().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:O().optional().describe("Custom status message to display in spinner while hook runs"),once:G().optional().describe("If true, hook runs once and is removed after execution")}),r=B({type:le("mcp_tool").describe("MCP tool hook type"),server:O().describe("Name of an already-configured MCP server to invoke"),tool:O().describe("Name of the tool on that server to call"),input:Ee(O(),$e()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:ro(),timeout:Oe().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:O().optional().describe("Custom status message to display in spinner while hook runs"),once:G().optional().describe("If true, hook runs once and is removed after execution")}),i=B({type:le("http").describe("HTTP hook type"),url:O().url().describe("URL to POST the hook input JSON to"),if:ro(),timeout:Oe().positive().optional().describe("Timeout in seconds for this specific request"),headers:Ee(O(),O()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:X(O()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:O().optional().describe("Custom status message to display in spinner while hook runs"),once:G().optional().describe("If true, hook runs once and is removed after execution"),cloud:me(["device","skip"]).optional().catch("skip").describe("@internal Where this hook may run when a cloud session is driven from this machine. 'skip': never offer it to cloud sessions; 'device' or omitted: offered (an HTTP hook has no script to pin). Applies to this entry only. An unrecognised value reads as 'skip' (the file still loads).")}),s=B({type:le("agent").describe("Agentic verifier hook type"),prompt:O().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:ro(),timeout:Oe().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:O().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:O().optional().describe("Custom status message to display in spinner while hook runs"),once:G().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:e,PromptHookSchema:t,HttpHookSchema:i,AgentHookSchema:s,McpToolHookSchema:r}}var Rv=re(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:r,HttpHookSchema:i,McpToolHookSchema:s}=Uve();return _d("type",[e,t,r,i,s])}),MR=re(()=>B({matcher:O().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:X(Rv()).describe("List of hooks to execute when the matcher matches")})),Ru=re(()=>Fde(me(ha),X(MR())));function Pg(){return new Set(Rv().options.map(e=>e.shape.type.value))}function $ve(e,t){if(!e||typeof e!="object"||Array.isArray(e)){let s=ys(e);return{problem:`Hook entry must be an object; received ${s}`,received:s,aboutType:!1}}let r=e.type;if(typeof r!="string"){let s=ys(r);return{problem:r===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${s}`,received:s,aboutType:!0}}if(!t.has(r)){let s=hx(r);return{problem:`Unknown hook type "${s}"`,received:s,aboutType:!0}}let i=Rv().safeParse(e);if(!i.success)return{problem:`Invalid ${r} hook (${UR(i.error)})`,received:r,aboutType:!1}}function UR(e){return e.issues.map(t=>t.path.length>0?`${t.path.join(".")}: ${t.message}`:t.message).join("; ")}function Dv(e){if(!e||typeof e!="object"||Array.isArray(e)||!("matcher"in e)&&Object.keys(e).some(r=>ha.includes(r)))return!1;let t=e.hooks;return Array.isArray(t)?t.length>0:!!t&&typeof t=="object"&&("matcher"in e||typeof t.type=="string")}function ta(e,t=3,{matchersCount:r=!0,unscannedKeys:i=Fve,inHooksList:s=!1}={}){return $R(e)||r&&Dv(e)?!0:t===0||!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>ta(n,t-1,{matchersCount:r,unscannedKeys:i,inHooksList:s})):s&&typeof e.type=="string"?!1:Object.entries(e).some(([n,a])=>!i.has(n)&&ta(a,t-1,{unscannedKeys:i,matchersCount:r&&!ha.includes(n),inHooksList:n==="hooks"&&Array.isArray(a)}))}function jve(e,t){return!e||typeof e!="object"||Array.isArray(e)?!1:$R(e)||Object.entries(e).some(([r,i])=>r!=="hooks"&&!t.has(r)&&ta(i,3,{unscannedKeys:t,matchersCount:!ha.includes(r)}))}var Fve=new Set,Bve=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),Hve=new Set(["metadata","mcpServers","lspServers"]),dRe=new Set([...Hve,"experimental"]);function $R(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Object.entries(e).some(([t,r])=>wd.has(t)&&r!==null&&r!==void 0&&!(Array.isArray(r)&&r.length===0))}function jR(e){return Dv(e)?!0:Array.isArray(e)?e.some(jR):!e||typeof e!="object"?!1:Object.entries(e).some(([t,r])=>wd.has(t)&&r!==null&&r!==void 0&&!(Array.isArray(r)&&r.length===0))}var wd=new Set(["PreToolUse","PermissionRequest"]);function zve(e,t){if(!Array.isArray(e))return{stripped:[],unloadableGuards:[]};let r=wd.has(t),i=Pg(),s=MR(),n=[],a=[];for(let o=e.length-1;o>=0;o--){let l=e[o],c=(f,_)=>{r||e.splice(o,1),n.push({matcherIndex:o,hookIndex:void 0,path:`${o}`,problem:f,received:_,aboutType:!1})};if(ta(l,3,{matchersCount:!1})){(r?n:a).push({matcherIndex:o,hookIndex:void 0,path:`${o}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:ys(l),aboutType:!1});continue}if(!l||typeof l!="object"||Array.isArray(l)){c(`Hook matcher must be an object; received ${ys(l)}`,ys(l));continue}let u=l.hooks;if(!Array.isArray(u)){c(`Hook matcher "hooks" must be an array of hook entries; received ${ys(u)}`,ys(u));continue}let p=[];for(let f=u.length-1;f>=0;f--){let _=$ve(u[f],i);_!==void 0&&(r||u.splice(f,1),p.push({matcherIndex:o,hookIndex:f,path:`${o}.hooks.${f}`,..._}))}let h=s.safeParse(r?{...l,hooks:[]}:l);if(!h.success){c(`Invalid hook matcher (${UR(h.error)})`,"matcher");continue}n.push(...p)}return n.reverse(),a.reverse(),r?{stripped:[],unloadableGuards:n}:{stripped:n,unloadableGuards:a}}var un="a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed";function ys(e){if(e==null)return String(e);if(Array.isArray(e))return"an array";let t=typeof e;return`${t==="object"?"an":"a"} ${t}`}var Tn="github.com",pRe=[`git@${Tn}:`,`ssh://git@${Tn}/`],hRe=[`https://${Tn}`,`https://${Tn}/`,Tn],fRe=`users.noreply.${Tn}`,Wve=/[:/\\?#@\s]/;function Kve(e){let t=Hw(e.replace(/[\t\n\r]/g,"").toLowerCase());if(t===""||Wve.test(t))return t;try{let r=new URL(`https://${t}`);return r.username!==""||r.password!==""||r.port!==""||r.pathname!=="/"||r.search!==""||r.hash!==""?t:Hw(r.hostname)}catch{return t}}var mRe=GT(function(e){let t=Kve(e);for(;t.startsWith("www.");)t=t.slice(4);return t},e=>e,50);function Hw(e){let t=e.length;for(;t>0&&e[t-1]===".";)t--;return e.slice(0,t)}function Gve(e){return qae(Zve(oW(e))).replace(/ {2,}/g," ").trim()}var qve=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,Vve=4;function Zve(e){let t=e;for(let r=0;r<Vve;r++){let i=t.replace(qve,"");if(i===t)break;t=i}return t}function Xve(e,t=160){return Yve(Gve(Jve(e,t)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(Qve,""),t)}function Yve(e,t=2e3){return e.length>t?`${ux(e,t)}\u2026`:e}function Jve(e,t){let r=ux(e,t*8);if(r.length===e.length)return r;let i=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(r);if(i===null)return r;let s=e.slice(i.index);return(s[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(s):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(s))?r.slice(0,i.index):r}var Qve=new RegExp("(?<![^\\s\\p{P}])\\p{M}+","gu"),Iv=500,eye=32;function FR(){return{claudeaiPluginId:O().max(128).optional().catch(void 0),archiveSha256:YR().optional().catch(void 0)}}function BR(){return{sourceCommand:O().max(Iv+20).optional().catch(void 0).describe("The `command`-source command the user accepted at explicit install/update. The once-per-session background re-resolve only runs while the marketplace entry still declares this exact command; a changed command (or an entry that became command-sourced later) is skipped with a warning until the user runs an explicit update."),sourceProducerPath:O().max(4096).refine(zw,{message:"must be an absolute path"}).optional().catch(void 0).describe("The directory a `command`-source plugin was last resolved to (what its command printed). Served in place in link mode and re-copied every session in copy mode, so the sandbox write-denies it; refreshed on every install/update, including no-op updates that resolve to a new location."),previousProducerPaths:X($e()).transform(e=>e.filter(t=>typeof t=="string"&&t.length<=4096&&zw(t)).slice(-eye)).optional().catch(void 0).describe("Producer directories this installation was resolved to before the current one (most recent last, bounded). A concurrent older session may still serve one of them, so the sandbox keeps write-denying them too.")}}function zw(e){return xve.isAbsolute(e)||kve.isAbsolute(e)}var HR=/[^\x20-\x7E]| {4,}/;function Lv(){return O().max(Iv,{message:"headersHelper must not be longer than the install consent UI can display"}).refine(e=>!HR.test(e),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var tye=new Set(["claude-community","claude-plugins-community","healthcare"]),rye=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins","first-party-plugins","claude-tag-plugins"]),zR=new Set([...rye,...tye]),iye=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,sye=/[^\u0020-\u007E]/;function nye(e){return zR.has(e.toLowerCase())?!1:sye.test(e)?!0:iye.test(e)}var hi=re(()=>O().startsWith("./")),Ps=re(()=>hi().endsWith(".json")),Ww=re(()=>Re([le("."),hi()])),Kw=re(()=>Re([hi().refine(e=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),O().url().refine(e=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),Ng=re(()=>hi().endsWith(".md")),Mg=re(()=>Re([Ng(),hi()])),WR={inline:"--plugin-dir session plugins",builtin:"built-in plugins","skills-dir":"plugins auto-loaded from .claude/skills/",synced:"plugins synced from your claude.ai account"};function aye(e){return Object.hasOwn(WR,e)}var KR=re(()=>O().min(1,"Marketplace must have a name").refine(e=>!e.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine(e=>!tD.test(e),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine(e=>!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&e!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine(e=>!nye(e),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).superRefine((e,t)=>{let r=e.toLowerCase();aye(r)&&t.addIssue({code:"custom",message:`Marketplace name "${r}" is reserved for ${WR[r]}`})})),Sd=re(()=>O().min(1,"Plugin name cannot be empty").refine(e=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).refine(e=>!tD.test(e),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),Pv=re(()=>B({name:O().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:O().optional().describe("Contact email for support or feedback"),url:O().optional().describe("Website, GitHub profile, or organization URL")})),oye=re(()=>B({$schema:O().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Sd().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:O().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:O().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:O().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:Pv().optional().describe("Information about the plugin creator or maintainer"),homepage:O().url().optional().describe("Plugin homepage or documentation URL"),repository:O().optional().describe("Source code repository URL"),license:O().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:X(O()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:G().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:X(sbe()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`),metadata:at(e=>Kt(e)?e:void 0,Ee(O(),$e()).optional()).describe("Free-form metadata for the plugin author's own use (e.g. entitlement or catalog fields). Preserved on the parsed manifest but not read by Claude Code.")})),lye=1,gRe=re(()=>B({description:O().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:bg(()=>Ru()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:X(O()).max(lye,{message:"hooks.json `modules` names one hooks module per plugin; a second entry is refused"}).optional().describe("The hooks module: one path, relative to this hooks.json, of a module exporting register(on). What it hooks and calls is read from its source before it loads; `claude plugin validate` shows the result."),surface:O().min(1).optional().describe("The surface module: one path, relative to this hooks.json, of a module whose exports draw the hooks module's `Client` elements on a surface, without `$`. Loaded beside the hooks module; meaningless without one.")}).refine(e=>e.hooks!==void 0||(e.modules?.length??0)>0,{message:"hooks.json must have `hooks` (the hook matchers) or `modules` (hooks modules), or both"}).refine(e=>e.surface===void 0||(e.modules?.length??0)>0,{message:"hooks.json `surface` names the surface module of a hooks module; without `modules` there is nothing to draw its Clients"})),cye=re(()=>B({hooks:Re([Ps().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),bg(()=>Ru()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),X(Re([Ps().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),bg(()=>Ru()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),uye=re(()=>B({source:Mg().optional().describe("Path to command markdown file, relative to plugin root"),content:O().optional().describe("Inline markdown content for the command"),description:O().optional().describe("Command description override"),argumentHint:O().optional().describe('Hint for command arguments (e.g., "[file]")'),model:O().optional().describe("Default model for this command"),allowedTools:X(O()).optional().describe("Tools allowed when command runs")}).refine(e=>e.source&&!e.content||!e.source&&e.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),dye=re(()=>B({commands:Re([Mg().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both."),X(Mg().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),Ee(O(),uye()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])})),pye=re(()=>B({agents:Re([Ng().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both."),X(Ng().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),hye=re(()=>B({skills:Re([Ww().describe('Path to a skill directory, relative to the plugin root ("." / "./" denote the plugin root itself). Loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring a specific subdirectory replaces the skills/ scan).'),X(Ww().describe('Path to a skill directory, relative to the plugin root ("." / "./" denote the plugin root itself).')).describe("List of skill directory paths, loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring specific subdirectories replaces the skills/ scan).")])})),fye=re(()=>Re([O(),X(O())])),GR=re(()=>B({outputStyles:Re([hi().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both."),X(hi().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),mye=re(()=>O().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),gye=16,_ye=re(()=>B({id:mye(),remote:O().max(256).regex(/^(npm:[@a-z0-9/._-]+(@[a-z0-9._+-]+)?|github:[\w.-]+\/[\w.-]+@[\w./-]+#.+\.js)$/,"must be npm:<pkg>[@ver] or github:<owner>/<repo>@<ref>#<path>.js").optional(),integrity:O().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),vye=re(()=>B({syntaxHighlighting:B({hljsLanguages:X(_ye()).max(gye)}).strict()})),qR=re(()=>B({themes:Re([hi().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both."),X(hi().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),yye=re(()=>B({})),Gw=re(()=>O().min(1)),bye=re(()=>O().min(2).refine(e=>e.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),Eye=re(()=>B({mcpServers:Re([Ps().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),Kw().describe("Path or URL to MCPB file containing MCP server configuration"),Ee(O(),Lg()).describe("MCP server configurations keyed by server name"),X(Re([Ps().describe("Path to MCP servers configuration file"),Kw().describe("Path or URL to MCPB file"),Ee(O(),Lg()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),VR=re(()=>B({type:me(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:O().describe("Human-readable label shown in the config dialog"),description:O().describe("Help text shown beneath the field in the config dialog"),required:G().optional().describe("If true, validation fails when this field is empty"),default:Re([O(),Oe(),G(),X(O())]).optional().describe("Default value used when the user provides nothing"),multiple:G().optional().describe("For string type: allow an array of strings"),sensitive:G().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:Oe().optional().describe("Minimum value (number type only)"),max:Oe().optional().describe("Maximum value (number type only)")}).strict()),wye=re(()=>B({userConfig:Ee(O().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) \u2014 they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),VR()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),Sye=re(()=>B({channels:X(B({server:O().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:O().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:Ee(O(),VR()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),qw=re(()=>tT({command:O().min(1).refine(e=>!(e.includes(" ")&&!e.startsWith("/")),{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:X(Gw()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:Ee(bye(),Gw()).refine(e=>Object.keys(e).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:me(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:Ee(O(),O()).optional().describe("Environment variables to set when starting the server"),initializationOptions:$e().optional().describe("Initialization options passed to the server during initialization"),settings:$e().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:O().optional().describe("Workspace folder path to use for the server"),startupTimeout:Oe().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:Oe().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:G().optional().describe("Whether to restart the server if it crashes"),maxRestarts:Oe().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:G().optional().describe("Whether to push publishDiagnostics into the agent context after edits. Set to false to keep LSP navigation (goToDefinition, hover, etc.) but suppress automatic diagnostic injection. Defaults to true.")})),Cye=re(()=>tT({name:O().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:O().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a <task_notification> event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd \u2014 prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:O().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:Re([le("always"),O().startsWith("on-skill-invoke:").refine(e=>e.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:<skill>" arms the first time that skill is dispatched (via Skill tool or slash command).')})),Oye=re(()=>X(Cye()).refine(e=>new Set(e.map(t=>t.name)).size===e.length,{message:"Monitor names must be unique within a plugin"})),ZR=re(()=>B({monitors:Re([Ps().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),Oye()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),Aye=re(()=>B({lspServers:Re([Ps().describe("Path to .lsp.json configuration file relative to plugin root"),Ee(O(),qw()).describe("LSP server configurations keyed by server name"),X(Re([Ps().describe("Path to LSP configuration file"),Ee(O(),qw()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),XR=re(()=>O().refine(e=>!e.includes("..")&&!e.includes("//"),"Package name cannot contain path traversal patterns").refine(e=>{let t=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return t.test(e)||r.test(e)},"Invalid npm package name format")),xye=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,kye=/^[0-9a-f]{64}$/,Tye=64,Rye=re(()=>B({sha256:O().regex(kye)}));function Dye(e){let t=Ee(O(),$e()).safeParse(e);if(!t.success)return;let r=Object.create(null),i=0;for(let[s,n]of Object.entries(t.data)){if(i>=Tye)break;let a=Rye().safeParse(n);xye.test(s)&&a.success&&(r[s]=a.data,i++)}return i>0?r:void 0}var Iye=re(()=>B({binaries:$e().transform(Dye).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),Lye=re(()=>B({settings:Ee(O(),$e()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),Pye=re(()=>B({experimental:at(e=>Kt(e)?e:void 0,B({...qR().partial().shape,...vye().partial().shape,...ZR().partial().shape,...GR().partial().shape,evals:fye().optional().describe("Directory of eval cases for the plugin evaluation harness, relative to the plugin root (default: evals/). A list is accepted; its first entry is the case directory.")}).passthrough().optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))})),Nye=re(()=>B({...oye().shape,...cye().partial().shape,...dye().partial().shape,...pye().partial().shape,...hye().partial().shape,...GR().partial().shape,...qR().partial().shape,...yye().shape,...Sye().partial().shape,...Eye().partial().shape,...Aye().partial().shape,...ZR().partial().shape,...Lye().partial().shape,...wye().partial().shape,...Iye().partial().shape,...Pye().partial().shape})),Mye=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]),xo=re(()=>_d("source",[B({source:le("url"),url:O().url().describe("Direct URL to marketplace.json file"),headers:Ee(O(),O()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:Lv().optional().describe("Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.")}),B({source:le("github"),repo:O().describe('GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form "owner/*" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value must name a single repository \u2014 a wildcard is taken literally and fails to clone.'),ref:O().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:O().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:X(O()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),B({source:le("git"),url:O().describe("Full git repository URL"),ref:O().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:O().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:X(O()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),B({source:le("npm"),package:XR().describe("NPM package containing marketplace.json")}),B({source:le("file"),path:O().describe("Local file path to marketplace.json")}),B({source:le("directory"),path:O().describe("Local directory containing .claude-plugin/marketplace.json")}),B({source:le("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),B({source:le("hostPattern"),hostPattern:O().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),B({source:le("pathPattern"),pathPattern:O().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),B({source:le("settings"),name:KR().refine(e=>!zR.has(e.toLowerCase()),{message:"Reserved marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection \u2014 validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:X(Fye()).describe("Plugin entries declared inline in settings.json"),owner:Pv().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),Wp=re(()=>O().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),YR=re(()=>O().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),Uye="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function $ye(e){try{let t=new URL(e);return t.protocol==="https:"&&!Nve(t.hostname)}catch{return!1}}var jye=re(()=>B({source:le("archive"),url:O().url().refine($ye,{message:Uye}).describe("HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive or nested one directory deep \u2014 a single wrapping directory is stripped."),sha256:YR().optional().describe("SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json version, else the entry version, else this digest) \u2014 changing only the digest while a version is declared does not trigger an update.")}).describe("Plugin distributed as a zip archive fetched over HTTPS \u2014 for hosting on any static file server or artifact repository (S3, GitLab, nginx) with no git or npm on the client. Authentication: the entry's own `headers` / `headersHelper` (bound to this URL), overlaid on the enclosing url-source marketplace's headers (static or `headersHelper`-minted) when the archive shares its origin.")),JR=re(()=>Re([at(e=>e==="."?"./":e,hi()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),B({source:le("npm"),package:XR().or(O().refine(e=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(e)||!e.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:O().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:O().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),B({source:le("url"),url:O().describe("Full git repository URL (https:// or git@)"),ref:O().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Wp().optional().describe("Specific commit SHA to use")}),B({source:le("github"),repo:O().describe("GitHub repository in owner/repo format"),ref:O().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Wp().optional().describe("Specific commit SHA to use")}),B({source:le("git-subdir"),url:O().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:O().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:O().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Wp().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),jye(),B({source:le("command"),command:O().min(1).max(Iv,{message:"command must not be longer than the install consent UI can display"}).refine(e=>!HR.test(e),{message:"command must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"}).describe("Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment."),timeout:Oe().int().positive().max(600).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:me(["copy","link"]).optional().describe("copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory in place (no copy, no size limit; macOS/Linux) \u2014 for large exports; the directory must then stay valid while Claude Code runs, and a different printed path is what signals new content.")}).describe("Plugin directory produced by a locally installed tool (e.g. an IDE that renders its plugin for the currently selected SDK). Claude Code runs the command, copies the directory it prints, and re-runs it in the background at startup to pick up changes."),B({source:le("unsupported"),error:O().optional()}).describe("Placeholder for source types this Claude Code version does not recognize, or a known type whose fields failed validation (then `error` holds the reason). Never authored by hand \u2014 PluginMarketplaceSchema rewrites unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with an actionable message.")])),Fye=re(()=>B({name:Sd().describe("Plugin name as it appears in the target repository"),source:JR().describe("Where to fetch the plugin from. Must be a remote source \u2014 relative paths have no marketplace repository to resolve against."),description:O().optional(),version:O().optional(),strict:G().optional(),headers:Ee(O(),O()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:Lv().optional().describe("Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.")}).refine(e=>typeof e.source!="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, archive, command). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine(e=>typeof e.source=="string"||e.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url, archive, command)."})),Bye=re(()=>B({cli:X(O().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) \u2014 exact match against commands run this session.'),hosts:X(O().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) \u2014 exact, case-insensitive match against hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path.'),filesRead:X(O().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) \u2014 the plugin is relevant when a file Claude has read this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive.'),manifestDeps:X(B({file:O().max(256),pattern:O().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: `file` matches the manifest filename (package.json, go.mod, requirements.txt, \u2026); `pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:X(O().max(256)).max(10).optional().describe(`Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) \u2014 the plugin is relevant when the session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),Hye=re(()=>B({topic:O().max(64).optional().describe('What the user is working with when this plugin is relevant \u2014 fills "Working with {topic}?". Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:Bye().optional().describe("Matchers that determine when the plugin is relevant.")})),zye=re(()=>Nye().partial().extend({name:Sd().describe("Unique identifier matching the plugin name"),source:JR().describe("Where to fetch the plugin from"),headers:Ee(O(),O()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:Lv().optional().describe("Command that prints a JSON object of HTTP headers for fetching this plugin's archive (e.g. a short-lived auth token); overrides this entry's `headers` and the marketplace's. Runs only when the user installs or updates this plugin, never during catalog browse. An entry that sets it must be `strict: false` with its manifest inlined here, so consent is informed from the entry alone before the command runs."),category:O().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:X(O()).optional().describe("Tags for searchability and discovery"),strict:G().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:at(e=>Kt(e)?e:void 0,Hye().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),Wye=re(()=>B({name:Sd()}));function Kye(e){let t=zye();return e.flatMap((r,i)=>{let s=t.safeParse(r);if(s.success){let o=s.data.source;return typeof o=="object"&&o.source==="unsupported"&&o.error!==void 0?[{...s.data,source:{source:"unsupported"}}]:[s.data]}let n=Wye().safeParse(r).data?.name,a=s.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`).join(", ");if(n){We(`Stubbing unparseable marketplace plugin entry (${n}): ${a}`,{level:"warn"});let o=eD(Kt(r)?r.source:void 0)?Jye:QR(r)?void 0:qye(s.error.issues)??Nv(s.error.issues);return[{name:n,source:{source:"unsupported",...o&&{error:o}},strict:!0}]}return We(`Dropping unparseable marketplace plugin entry (index ${i}): ${a}`,{level:"warn"}),[]})}var Gye=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function QR(e){if(!e||typeof e!="object")return!1;let t=e.source;if(!t||typeof t!="object")return!1;let r=t.source;return typeof r=="string"&&!Gye.has(r)}function qye(e){let t=e.find(i=>i.path.length===1&&i.path[0]==="source");if(!t||t.code!=="invalid_union")return;let r=t.errors.find(i=>!i.some(s=>s.path.length===0||s.code==="invalid_value"&&s.path[0]==="source"));if(!(!r||r.length===0))return Nv(r.map(i=>({...i,path:["source",...i.path]})))}var Vye=/^[A-Za-z0-9_$.-]{1,40}$/;function Oi(e){return Vye.test(e)?e:"<key>"}var Zye=3,Xye=160;function Nv(e){let t=e.slice(0,Zye).map(i=>{let s=i.path.map(String).map(a=>Oi(a)).join("."),n=i.code==="unrecognized_keys"?`Unrecognized ${i.keys.length===1?"field":"fields"}: ${i.keys.map(Oi).join(", ")}`:Xve(i.message,Xye);return s?`${s}: ${n}`:n}),r=e.length-t.length;return r>0?`${t.join(", ")} (+${r} more)`:t.join(", ")}var Yye=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,Jye='Bare source names resolve under metadata.pluginRoot, which this marketplace does not set (or sets to a path outside the marketplace root). Use a "./relative/path" source, or set metadata.pluginRoot to allow bare names.';function eD(e){return typeof e=="string"&&Yye.test(e)&&!e.includes("..")}function Qye(e){if(typeof e!="string"||e===""||e.startsWith("/")||e.includes("\\")||e.includes(":"))return;let t=e.replace(/^\.\//,"").replace(/\/+$/,"");if(t===""||t===".")return".";if(!t.split("/").some(r=>r===""||r==="."||r===".."))return t}function ebe(e,t){if(t===void 0||!Kt(e)||!eD(e.source))return e;let r=t==="."?`./${e.source}`:`./${t}/${e.source}`;return{...e,source:r}}function tbe(e){if(!Kt(e)||!Array.isArray(e.plugins))return e;let t=Kt(e.metadata)?Qye(e.metadata.pluginRoot):void 0;return t===void 0?e:{...e,plugins:e.plugins.map(r=>ebe(r,t))}}var rbe=re(()=>B({$schema:O().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:KR(),version:O().optional().describe("Marketplace manifest version"),description:O().optional().describe("Human-readable description of this marketplace"),owner:Pv().describe("Marketplace maintainer or curator information"),plugins:X($e()).transform(Kye).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:G().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:B({pluginRoot:O().optional().describe('Base directory for bare plugin source names, relative to the marketplace root (e.g. "./plugins" resolves "source": "formatter" as ./plugins/formatter). Sources that already start with "./" are unaffected.'),version:O().optional().describe("Marketplace version"),description:O().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:X(O()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies \u2014 no transitive trust."),renames:Ee(O(),O().nullable()).optional().catch(void 0).describe("Append-only map of old plugin name \u2192 current name (or null when removed). The loader follows this on plugin-not-found and migrates user settings to the new name.")})),_Re=re(()=>at(tbe,rbe())),Ug="[A-Za-z0-9][-A-Za-z0-9._]*",vRe=new RegExp(`^${Ug}$`),Mv=re(()=>O().regex(new RegExp(`^${Ug}@${Ug}$`),"Plugin ID must be in format: plugin@marketplace")),yRe=new RegExp(`[@:\\s/\\\\${gl}]`,"u"),bRe=new RegExp(`[${gl}]`,"u"),tD=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,ibe=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,sbe=re(()=>Re([O().regex(ibe,"Dependency must be a plugin name, optionally qualified with @marketplace").transform(e=>e.replace(/@\^[^@]*$/,"")),B({name:O().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:O().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform(e=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),nbe=re(()=>B({version:O().describe("Currently installed version"),installedAt:O().describe("ISO 8601 timestamp of installation"),lastUpdated:O().optional().describe("ISO 8601 timestamp of last update"),installPath:O().describe("Absolute path to the installed plugin directory"),gitCommitSha:O().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:O().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:G().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs)."),...FR(),...BR()})),ERe=re(()=>B({version:le(1).describe("Schema version 1"),plugins:Ee(Mv(),nbe()).describe("Map of plugin IDs to their installation metadata")})),abe=re(()=>me(["managed","user","project","local"])),obe=re(()=>B({scope:abe().describe("Installation scope"),projectPath:O().optional().describe("Project path (required for project/local scopes)"),installPath:O().describe("Absolute path to the versioned plugin directory"),version:O().optional().describe("Currently installed version"),installedAt:O().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:O().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:O().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:O().optional().describe("Tag-derived semver this install resolved to"),auto:G().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...FR(),...BR()})),wRe=re(()=>B({version:le(2).describe("Schema version 2"),plugins:Ee(Mv(),X(obe())).describe("Map of plugin IDs to arrays of installation entries")})),lbe=re(()=>B({source:xo().describe("Where to fetch the marketplace from"),installLocation:O().describe("Local cache path where marketplace manifest is stored"),lastUpdated:O().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:G().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),SRe=re(()=>Ee(O(),lbe())),Kp=["aspell","hunspell","ispell"],cbe=2147483647,ube=["autoMode","deepLink","voice","briefView","screenReader"],Gp={},Cd={autoMode:{buildGate:()=>!1,shape:()=>Gp,permissionsShape:()=>Gp,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:me(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:G().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:me(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>Gp}};function Uv(){return ube.filter(e=>Cd[e].buildGate())}function dbe(e){let t={};for(let r of e)t={...t,...Cd[r].shape()};return t}function pbe(e){let t={};for(let r of e)t={...t,...Cd[r].permissionsShape?.()};return t}function hbe(e){let t=[];for(let r of e)t.push(...Cd[r].permissionModes?.()??[]);return t}var Vw={Task:"Agent",KillShell:"TaskStop",KillBash:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",AgentOutput:"TaskOutput",BashOutput:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage",ListMcpResources:"ListMcpResourcesTool",ReadMcpResource:"ReadMcpResourceTool",ReadMcpResourceDir:"ReadMcpResourceDirTool"};function qp(e){return Object.hasOwn(Vw,e)?Vw[e]:e}var rD="workspace",CRe=`mcp__${rD}__bash`,ORe=`mcp__${rD}__web_fetch`;function Zw(e){return e.includes("*")}function fbe(e){return e.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function mbe(e){return gbe(e).replaceAll("\\\\","\\")}function gbe(e){return e.replaceAll("\\(","(").replaceAll("\\)",")")}function iD(e){let t=vbe(e,"("),r=ybe(e,")");if(t===-1&&r===-1)return{kind:"bare"};let i=e.substring(0,t);return t===-1||r<=t||r!==e.length-1||/[()]/.test(i)?{kind:"malformed"}:{kind:"call",toolName:i,rawContent:e.substring(t+1,r)}}function _be(e){let t=iD(e);if(t.kind!=="call"||!t.toolName)return{toolName:qp(e)};if(t.rawContent===""||t.rawContent==="*")return{toolName:qp(t.toolName)};let r=mbe(t.rawContent);return{toolName:qp(t.toolName),ruleContent:r}}function Vp(e){if(!e.ruleContent)return e.toolName;let t=fbe(e.ruleContent);return`${e.toolName}(${t})`}function vbe(e,t){for(let r=0;r<e.length;r++)if(e[r]===t){let i=0,s=r-1;for(;s>=0&&e[s]==="\\";)i++,s--;if(i%2===0)return r}return-1}function ybe(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]===t){let i=0,s=r-1;for(;s>=0&&e[s]==="\\";)i++,s--;if(i%2===0)return r}return-1}function sD(e){let t=e.split("__"),[r,i,...s]=t;if(r!=="mcp"||!i)return null;let n=s.length>0?s.join("__"):void 0;return{serverName:i,toolName:n}}var Du={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:e=>e.includes("*")||e.includes("?")?{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]}:{valid:!0},WebFetch:e=>e.includes("://")||e.startsWith("http")?{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]}:e.startsWith("domain:")?{valid:!0}:{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]}}};function Xw(e){return Du.filePatternTools.includes(e)}function bbe(e){return Du.bashPrefixTools.includes(e)}function Ebe(e){return Object.hasOwn(Du.customValidation,e)?Du.customValidation[e]:void 0}function nD(e,t){let r=0,i=t-1;for(;i>=0&&e[i]==="\\";)r++,i--;return r%2!==0}function Yw(e,t){let r=0;for(let i=0;i<e.length;i++)e[i]===t&&!nD(e,i)&&r++;return r}var wbe=/(?:^|[^\\])\\[()]/;function Sbe(e){return wbe.test(e)&&Yw(e,"(")!==Yw(e,")")}var Cbe=/^(?:[|&;<>]|\d+[<>])/;function Obe(e){return Cbe.test(e)}function Jw(e){for(let t=0;t<e.length;t++)if(e[t]==="*"&&!nD(e,t))return!0;return!1}function Abe(e){if(e.endsWith(":*"))return;let t=e.trim().split(/\s+/).filter(Boolean),r=t[0];if(t.length<3||r===void 0||Jw(r))return;let i=!1;for(let s of t.slice(1)){if(Obe(s))return;if(Jw(s)){i=!0;continue}if(!s.startsWith("-"))return i?r:void 0}}function Qw(e){if(!Zw(e))return null;let t=sD(e);return t&&!Zw(t.serverName)?null:{valid:!1,error:`Wildcard tool name "${e}" is not supported in allow rules`,suggestion:"An allow pattern must name the scope it widens \u2014 globs are permitted only in the tool position after a literal mcp__<server>__ prefix. Deny and ask rules accept wildcards anywhere",examples:["mcp__puppeteer__*","mcp__github__get_*"]}}function aD(e,t){if(!e||e.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let r=iD(e);if(r.kind==="malformed")return{valid:!1,error:"Malformed Tool(content) rule",suggestion:'Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal'};if(r.kind==="call"&&r.rawContent==="")return r.toolName?{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${r.toolName}" without parentheses`,examples:[`${r.toolName}`,`${r.toolName}(some-pattern)`]}:{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};let i=_be(e),s=sD(i.toolName);if(s){if(r.kind==="call")return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${i.toolName}" without parentheses, or use "mcp__${s.serverName}__*" for all tools`,examples:[`mcp__${s.serverName}`,`mcp__${s.serverName}__*`,s.toolName&&s.toolName!=="*"?`mcp__${s.serverName}__${s.toolName}`:void 0].filter(Boolean)};if(t==="allow"){let a=Qw(i.toolName);if(a)return a}return{valid:!0}}if(!i.toolName||i.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(t==="allow"){let a=Qw(i.toolName);if(a)return a}if(!i.toolName.includes("_")&&i.toolName[0]!==i.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${cx(String(i.toolName))}"`};if(r.kind==="call"&&Sbe(r.rawContent)){let a=Xw(i.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:a?"Write a Windows path with forward slashes, or spell a literal parenthesis as [(] or [)]":'Double a backslash that is a path separator ("\\\\("), and escape literal parentheses in pairs',examples:a?[`${i.toolName}(C:/Projects/(drafts)/**)`,`${i.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${i.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let n=Ebe(i.toolName);if(n&&i.ruleContent!==void 0){let a=n(i.ruleContent);if(!a.valid)return a}if(bbe(i.toolName)&&i.ruleContent!==void 0){let a=i.ruleContent;if(a.includes(":*")&&!a.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(a===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(t==="allow"){let o=Abe(a);if(o!==void 0){let l=o==="git",c=l?" For git, options such as -c and --exec-path can run arbitrary commands.":"",u=l?" (for example Bash(git status *))":"";return{valid:!0,warning:`${Vp(i)} has a wildcard before the rest of the command, so it also matches any options inserted at that position and approves them without a prompt.${c} Replace that * with the exact value you mean, or only use * after the subcommand${u}.`}}}}if(Xw(i.toolName)&&i.ruleContent!==void 0&&i.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${i.toolName}(*.ts) - matches .ts files`,`${i.toolName}(src/**) - matches all files in src`,`${i.toolName}(**/*.test.ts) - matches test files`]};if(i.ruleContent!==void 0){let a=i.toolName==="Write"||i.toolName==="NotebookEdit"||i.toolName==="MultiEdit"?"Edit":i.toolName==="Glob"?"Read":void 0;if(a!==void 0&&!i.ruleContent.includes(":*"))return{valid:!0,warning:`${Vp(i)} is not matched by file permission checks \u2014 only ${a}(path) rules are. Use ${Vp({toolName:a,ruleContent:i.ruleContent})} instead (${a} rules cover all file-${a==="Edit"?"editing":"reading"} tools).`}}return{valid:!0}}var eS=re(()=>oD()),xbe=re(()=>oD("allow"));function oD(e){return O().superRefine((t,r)=>{let i=aD(t,e);if(!i.valid){let s=i.error;i.suggestion&&(s+=`. ${i.suggestion}`),i.examples&&i.examples.length>0&&(s+=`. Examples: ${i.examples.join(", ")}`),r.addIssue({code:pi.custom,message:s,params:{received:t}})}})}var Od=["accept","hold","refuse"],$g=["off","basic","full"],kbe=re(()=>Ee(O(),ape()));function lD(e){return B({allow:X(xbe()).optional().describe("List of permission rules for allowed operations"),deny:X(eS()).optional().describe("List of permission rules for denied operations"),ask:X(eS()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:at(kv,me([...Ed,...hbe(e)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:me(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:G().optional().describe('Refuse file-tool reads (Read, Grep, Glob, LSP) outside the working directories in every permission mode; true in any settings source wins. Also set when the user picks "block" on the one-time auto-mode prompt for a read outside the working directories.'),...pbe(e),additionalDirectories:X(O()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var ARe=re(()=>lD(Uv())),Tbe=re(()=>Re([O(),B({}).passthrough().describe('{ id: stable id (letters, digits, ".", "_", "-"; max 64), text: the tip (max 500 characters, one line), cooldownSessions?: sessions to wait before showing it again (default 0), priority?: tie-break weight among never-shown tips (default 0) }')])),Rbe=re(()=>at(e=>Array.isArray(e)?e.filter(t=>typeof t=="string"||!!t&&typeof t=="object"&&!Array.isArray(t)):[],X(Tbe()))),cD=re(()=>B({source:xo().describe("Where to fetch the marketplace from"),installLocation:O().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:G().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),uD=re(()=>{let e=()=>Oe().min(0).max(1e4);return B({input:e(),output:e(),cacheRead:e(),cacheWrite:e()})}),dD=re(()=>Oe().gt(0).lte(1).optional()),pD=re(()=>B({model:O().describe('Model to select, taken verbatim: an alias ("opus"), an Anthropic model ID, or a provider-format ID (Vertex, Bedrock, gateway). Same values --model accepts.'),label:O().optional().describe("Row title. Defaults to the model name."),description:O().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:O().optional().describe(`For a model this version of Claude Code does not know: the ID of a model it does know (e.g. "claude-opus-4-8") whose client-side handling \u2014 prompt profile, capability and effort defaults \u2014 applies to it. Changes neither the row's label nor the model ID sent. Without it, a model-catalog row for a model this version does not know is not offered until Claude Code is updated.`)})),$v=re(()=>B({serverName:O().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:X(O()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:O().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine(e=>Ux([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),jv=re(()=>B({serverName:O().min(1,"Server name must be non-empty").refine(e=>e.trim().length>0,{message:"Server name must not be whitespace-only"}).refine(e=>e===e.trim(),{message:"Server name has leading or trailing whitespace and will never match (names are compared verbatim)"}).optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:X(O()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:O().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine(e=>Ux([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),hD=re(()=>B({marketplace:O(),plugin:O()})),Dbe=re(()=>at(e=>{if(typeof e!="string"||!Mv().safeParse(e).success)return e;let t=e.indexOf("@");return{marketplace:e.slice(t+1),plugin:e.slice(0,t)}},hD())),Ibe=new RegExp("[\\x00-\\x1f\\x7f-\\x9f\\u2028\\u2029]|\\p{DI}","u");function Lbe(e){let t=e.replaceAll("/","\\");return td(t)?!1:/^\\{2}[^\\]/.test(t)}function Pbe(e){return hl(e)||/^\/network\/servers(\/|$)/i.test(e)}function Nbe(e){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(e)}function Mbe(e,t,r={}){if(t==="win32"){let i=e.replaceAll("/","\\");if(td(i))return!1;let s=Lbe(i);if(r.rejectUnc&&s||r.rejectDriveRelative&&!/^[A-Za-z]:\\/.test(i)&&!s&&/^(\\|[A-Za-z]:)/.test(i)||SR.normalize(i)!==i)return!1;let n=i.split("\\");if(n.some(o=>o==="."||o==="..")||n.some((o,l)=>/[. ]$/.test(o)||o.includes(":")&&!(l===0&&/^[A-Za-z]:$/.test(o))))return!1;let a=i.startsWith("\\\\")?i.slice(2):i;return/\\{2}/.test(a)?!1:!i.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(i)}return r.rejectNetworkRoot&&Pbe(e)||r.rejectMagicLinkRoot&&Nbe(e)||wR.normalize(e)!==e||e.split("/").some(i=>i==="."||i==="..")||/\/{2}/.test(e)?!1:!e.endsWith("/")||e==="/"}var Ube=/\.(exe|ps1)$/i;function $be(e){return/\.ps1$/i.test(e)}function jbe(e){return $be(e)&&/[[\]`*?]/.test(e)}var Fbe='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',Bbe=()=>O().describe("Absolute path to the helper executable"),qi=e=>at(t=>t===null?void 0:t,e.optional()).optional(),Hbe=cbe,tS=e=>Oe().int().min(e).transform(t=>Math.min(t,Hbe)),rS=["path","script","defaultSettings"];function fD(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return rS.some(r=>t[r]===null)&&rS.every(r=>t[r]===null||t[r]===void 0)}var iS=64,Iu=re(()=>B({path:Bbe(),timeoutMs:qi(tS(1e3)),refreshIntervalMs:qi(Re([le(0),tS(6e4)]))})),mD=()=>me(["replace","merge"]).describe("How the helper's managedSettings compose with the settings of the source that delivered this entry: 'replace' (default) \u2014 the output is the policy; 'merge' \u2014 the output is deep-merged over that source's own settings the way merged managed sources compose (helper scalars win, arrays union, objects merge \u2014 except fallbackModel, forceLoginOrgUUID, gatewayInternalNetworks, sandbox.filesystem.allowRead, sandbox.credentials.awsPairs, sandbox.ripgrep and the restriction allowlists such as allowedMcpServers, availableModels and allowedHttpHookUrls, which are the helper's whole value when it emits one; tighten a permission with a deny), so a failed helper costs only the delta");function gD(e){return e==="continue"||e==="refuse"}var zbe=()=>at(e=>e===void 0||gD(e)?e:"refuse",me(["continue","refuse"]).describe(`What happens when this entry's helper fails at startup (bad path, missing file or interpreter, non-zero exit, timeout, oversize or invalid output) and no static settings payload (this entry's own, the linux entry's on WSL, or the map's "default") applies in its place: 'refuse' \u2014 Claude Code does not start, naming the failure; 'continue' \u2014 Claude Code starts without the helper's output, on the delivering source's own settings, with a /status notice. Default: 'refuse' when the entry comes from MDM or the managed settings file, 'continue' when it comes from remote managed settings. Any other value is treated as 'refuse', with a /status notice. The install and update commands start no session and are never refused over a remote entry: they report the refusal in /status. An entry whose other fields fail validation runs no helper; from MDM or the managed settings file, any value but 'continue' on it then refuses to start Claude Code until the entry is fixed, unless a static settings payload (the entry's own, kept when it validates, the linux entry's for a wsl one, or the map's "default") serves in its place. From remote, a non-interactive session runs the helper off settings verified this session without the interactive approval, so 'refuse' there too means the helper ran and failed; a launch whose remote settings could not be verified this session (offline, fetch failed) starts without the helper regardless; and a failure first reached after the session has started (settings verified or approved mid-session, which on a machine that only ever runs non-interactively is every launch) ends a session no person watches (non-interactive, a background session no client is attached to, or a teammate session) as the refused start would have, and leaves a watched interactive one (a terminal, with or without remote control, or an attached background session) running under a /status notice with its next start refused. Background refresh failures always keep the last good output whatever this says`)),Wbe=5,Kbe=()=>Oe().int().min(0).transform(e=>Math.min(e,Wbe)).describe("How many more times to run this entry's helper when a run fails to execute \u2014 it could not be launched, exited non-zero, or was stopped at timeoutMs \u2014 before that counts as a failure (a non-negative integer; default 0, a single attempt; above 5 is treated as 5). Attempts are separated by a short randomized backoff (from 250 ms, doubling per attempt, at most 4 s each) and each attempt gets the full timeoutMs, so a start that waits on the helper can wait up to (retries + 1) \xD7 timeoutMs plus the backoff. Output the helper did produce and that was refused \u2014 oversized, not a JSON object, an invalid envelope, or settings that fail validation \u2014 is not retried, and neither is an invalid path. Applies alike at startup and on each background refresh; only once the attempts are used up do the entry's failure rules (a static settings payload in its place, onFailure, the refresh notice) apply, naming the last attempt's failure"),Gbe=e=>(e==="windows"?le("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):le("sh",{message:"interpreter must be 'sh' on macos/linux/wsl"})).describe("Fixed interpreter for `script`: 'sh' (/bin/sh) on macos/linux/wsl entries; 'pwsh' (PowerShell at its fixed install locations, never PATH) on the windows entry"),qbe="exactly one of path/script must be configured",Vbe='"script" and "interpreter" must be configured together',Zbe="script must be ASCII-only on Windows (PowerShell decodes stdin with the console OEM code page); spell non-ASCII characters as escapes, e.g. [char]0x00E9",Xbe=e=>O({message:"script must be a string"}).min(1,{message:"script must not be empty"}).max(65536,{message:"script must be at most 65536 characters"}).refine(t=>!t.includes("\0"),{message:"script must not contain NUL bytes"}).refine(t=>px(t),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine(t=>e!=="windows"||!/[\u0080-\uffff]/.test(t),{message:Zbe}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)"),Lr=["macos","linux","windows","wsl"];function Ybe(e){return e==="wsl"?["wsl","linux"]:[e]}function Jbe(e){return e==="windows"?"win32":"posix"}function Qbe(e){return{rejectDriveRelative:e==="windows",rejectUnc:e==="windows",rejectNetworkRoot:e!=="windows",rejectMagicLinkRoot:e!=="windows",requireWin32ExecutableSuffix:e==="windows"}}function eEe(e){let t=Jbe(e),r=Qbe(e);return O().max(1024,{message:"path must be at most 1024 characters"}).refine(i=>!Ibe.test(i),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine(i=>(t==="win32"?SR:wR).isAbsolute(i),{message:"path must be absolute"}).refine(i=>!(t==="win32"&&r.requireWin32ExecutableSuffix)||Ube.test(i),{message:"path must end in .exe or .ps1 on Windows"}).refine(i=>t!=="win32"||!jbe(i),{message:Fbe}).refine(i=>Mbe(i,t,r),{message:t==="win32"?'path must be in normalized form: no "." or ".." segments, no doubled or trailing separators, no component ending in "." or a space, no ":" outside the drive letter, no device-namespace (\\\\?\\) prefix, no drive-relative (\\dir or C:name) or UNC (\\\\server\\share) form':'path must be in normalized form: no "." or ".." segments, no doubled or trailing separators, and not under a network automount root (/net/<host>, /Network/Servers) or a kernel magic-link root (/proc, /dev/fd)'}).describe("Absolute path to the helper executable")}var Fv=[...Lr,"default"],jg=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],Rc=["managedSettings","appendSystemPrompt"],Es=re(()=>Ee(O(),$e()).superRefine((e,t)=>{for(let r of["policyHelper","policyHelpers"])e[r]!==void 0&&e[r]!==null&&t.addIssue({code:"custom",message:`must not contain "${r}" \u2014 the default payload is applied as managed settings and cannot configure further policy helpers`});for(let r of jg)e[r]!==void 0&&e[r]!==null&&t.addIssue({code:"custom",message:`must not contain "${r}" \u2014 a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${jg.join("/")}) belong on the per-OS entries (policyHelpers.${Lr.join("/")})`});for(let r of Rc)e[r]!==void 0&&e[r]!==null&&t.addIssue({code:"custom",message:`must not contain "${r}" \u2014 a static payload is the managedSettings SUBTREE, not the helper's stdout envelope; paste the object your helper emits UNDER "managedSettings", not the envelope around it`});for(let r of Fv)e[r]!==void 0&&e[r]!==null&&t.addIssue({code:"custom",message:`must not contain "${r}" \u2014 a static payload is the VALUE of a policyHelpers key (a managed-settings object), never another policyHelpers map; don't paste the map or its "${r}" line inside the slot`})})),tEe='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function rEe(e){let{path:t,script:r,interpreter:i,defaultSettings:s}=e;return t!==void 0&&r!==void 0?qbe:r===void 0!=(i===void 0)?Vbe:t===void 0&&r===void 0&&s===void 0?tEe:null}function _D(e,t){return Iu().omit({path:!0}).extend({path:qi(eEe(e)),script:qi(Xbe(e)),interpreter:qi(Gbe(e)),outputBehavior:qi(mD()),onFailure:qi(zbe()),retries:qi(Kbe()),defaultSettings:at(r=>r===null?void 0:r,t.optional()).optional()}).check(r=>{if(r.issues.length>0)return;let i=rEe(r.value);i!==null&&r.issues.push({code:"custom",message:i,input:r.value})})}var xRe=re(()=>_D("linux",Es()));function Fg(e,t=Es()){return e==="default"?Es():_D(e,t)}var iEe=re(()=>B(Object.fromEntries(Fv.map(e=>[e,at(t=>{if(t!==null&&!(e!=="default"&&fD(t)))return t},Fg(e).optional()).optional()])))),sS=["skills","agents","hooks","mcp"],nS=Object.freeze({type:"invalid-entry-stripped"}),sEe=re(()=>Re([B({type:le("regex").describe('Config variant. This client understands "regex": matches turn output and builds a URL from named capture groups. Entries with other variants are preserved but skipped at runtime.'),pattern:O().describe("Regex matched against turn output (tool results and assistant text)"),url:O().describe("Link target. {name} placeholders are filled from named regex capture groups, e.g. (?<id>...) -> {id}. Values are URL-encoded; the origin must be literal in the template. The scheme must be https, http, or a recognized editor or workspace deep-link scheme: vscode, vscode-insiders, cursor, windsurf, zed, jetbrains, idea, slack, linear, notion, figma."),label:O().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),B({type:O().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),nEe=()=>Oe().int().min(uve).max(dve).optional().catch(void 0);function vD(e,{strictPolicyHelperKeys:t=!1}={}){function r(s){return Ee(O(),cD()).check(n=>{for(let[a,o]of Object.entries(n.value))o.source.source==="settings"&&o.source.name!==a&&n.issues.push({code:"custom",input:o.source.name,path:[a,"source","name"],message:`Settings-sourced marketplace name must match its ${s} key (got key "${a}" but source.name "${o.source.name}")`})})}let i=(s,n)=>t?at(a=>{if(a!==null)return n?n(a):a},s):s.catch(void 0);return B({$schema:O().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:O().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:O().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:O().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:O().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:O().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:O().optional().describe("Corporate launcher argv prefix for the background-agent supervisor, the sessions and workers it hosts, and the other covered background processes listed in the Claude Code corporate-launcher documentation. Equivalent to the CLAUDE_CODE_PROCESS_WRAPPER environment variable, which takes precedence when set. Honored from managed settings, a --settings/SDK-supplied settings file, and user settings, in that precedence order; project and local settings are ignored."),policyHelper:i(Iu().optional(),s=>s&&typeof s=="object"&&!Array.isArray(s)&&s.path===null?void 0:s).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:i(iEe().optional()).describe(`@internal Per-OS variant of policyHelper, keyed by platform: macos, linux, windows, wsl, plus an optional "default" entry that is a STATIC settings payload (a JSON object of managed settings, not a helper). Each per-OS entry carries a helper \u2014 a "path", or an inline "script" + "interpreter" delivered to a fixed interpreter over stdin, either with timeoutMs/refreshIntervalMs \u2014 its own static "defaultSettings" payload, or both; an entry may be payload-only. Selection for a platform walks its chain (the platform's own entry; on wsl the linux entry next): the first helper on the chain wins over policyHelper; if no helper is configured \u2014 or the selected helper fails at startup or refresh \u2014 the first payload applies (the chain's "defaultSettings" in platform-specific-first order, then the top-level "default", applied with no process spawned; unrecognized platforms reach only "default"); with no payload either, policyHelper. Honored from admin-controlled policy sources, and from remote managed settings \u2014 a payload of plain policy as delivered, like any other remote key; a helper, or a payload carrying anything the managed-settings approval dialog lists, only once the settings are verified this session and approved there (policyHelper itself is never honored from remote).`),...ml.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:B({issuer:O().url().describe("IdP issuer URL for OIDC discovery"),clientId:O().describe("Claude Code's client_id registered at the IdP"),callbackPort:Oe().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:B({type:le("command"),command:O()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:G().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:B({enabled:G().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:Oe().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 30). Re-fires every interval until you take a break."),breakThresholdMinutes:Oe().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:O().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks \u2014 just a friendly heads-up."),quietHours:B({enabled:G().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:O().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:O().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:Oe().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),desktopSessionCleanupPeriodDays:Oe().int().nonnegative().optional().describe("Retention ceiling in days for session transcripts created or last written by a desktop-host surface (Claude Desktop, Cowork), which are otherwise exempt from the cleanupPeriodDays sweep. 0 (the default) means no ceiling: such transcripts are kept until deleted another way. Unlike cleanupPeriodDays, 0 is allowed because this setting never disables writes \u2014 it only bounds an exemption from deletion. The ceiling is a hard cap: it also bounds an active archive grace, so the grace window of a release marker never keeps files past the ceiling. Ignored when cleanupPeriodDays is managed by org policy. A ceiling at or below cleanupPeriodDays effectively disables the exemption: those transcripts age out on the regular cleanupPeriodDays schedule, so the effective retention is whichever of the two periods is longer."),syncClaudeAiSkills:G().optional().describe("Set to false to turn off syncing of the skills you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced skills (~/.claude/skills/synced) can no longer be run, are hidden from every session started afterwards, and are moved to ~/.claude/skills/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced skills are blocked and hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored \u2014 the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced skills are available in every session, re-synced every 10 minutes, and removed when you disable them on claude.ai. Only applies when signed in with your Claude account."),syncClaudeAiPlugins:G().optional().describe("Set to false to turn off syncing of the plugins you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced plugins (~/.claude/plugins/synced) are hidden from every session started afterwards and moved to ~/.claude/plugins/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced plugins are hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored \u2014 the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced plugins load in every session like plugins you installed yourself (a plugin you installed with the same name takes precedence), are re-synced at each launch, and are removed when you disable them on claude.ai. Only applies when signed in with your Claude account."),skillListingMaxDescChars:Oe().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:Oe().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:G().optional().describe("When set to true in either admin-only Windows source \u2014 the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json \u2014 WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:kbe().optional().describe("Environment variables to set for Claude Code sessions"),attribution:B({commit:O().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:O().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:G().optional().describe("Whether to append the claude.ai session link to commits and PRs created from web or Remote Control sessions (default: true). Set to false to omit the Claude-Session trailer and PR-body link.")}).passthrough().optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:G().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),includeGitInstructions:G().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:lD(e).optional().describe("Tool usage permissions configuration"),model:O().optional().describe("Override the default model used by Claude Code"),fallbackModel:X(O()).optional().describe('Fallback model(s) tried in order when the primary model is overloaded or unavailable. Each element accepts a model name or alias; "default" expands to the default model. CLI --fallback-model takes precedence.'),availableModels:X(O()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),enforceAvailableModels:G().optional().describe("When true and availableModels is a non-empty array, the Default model selection is also constrained: if the default model for the user tier is not in availableModels, Default resolves to the first allowed availableModels entry instead. Has no effect when availableModels is unset or an empty array. Typically set in managed settings by enterprise administrators."),modelOverrides:Ee(O(),O()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),modelPicker:B({options:X(pD()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:G().optional().describe("When true, the picker shows only the Default row and these options \u2014 the built-in lineup, gateway-discovered models and ANTHROPIC_CUSTOM_MODEL_OPTION are hidden. When false or unset, these options are added after the built-in lineup.")}).optional().describe("Curate the /model picker: an ordered list of models with your own labels, independent of the built-in lineup and of Claude Code releases. availableModels still applies to these rows. Honored from managed, --settings/SDK, and user settings only (not from a project checkout); the highest-precedence of those that defines modelPicker wins outright (no merging across sources). Typically set in managed settings by enterprise administrators."),modelPricing:B({multiplier:dD(),overrides:Ee(O(),uD()).optional()}).optional().describe(`Price usage at your organization's contracted rates instead of list price. Affects every spend figure Claude Code reports \u2014 /cost, the status line, the SDK total_cost_usd, --max-budget-usd, and the OpenTelemetry cost metric and events \u2014 which remain USD estimates, not an invoice (the per-Mtok price labels in /model stay at list). "overrides" maps a model ID to its USD-per-million-token rates (input, output, cacheRead, cacheWrite \u2014 all four required, each 0 to 10000; cacheWrite prices both 5-minute and 1-hour cache writes). A matching row is charged exactly as written; fast-mode and US-data-residency surcharges are not added on top. A key Claude Code itself uses for a built-in model \u2014 its ID such as "claude-sonnet-4-6", or its first-party, Bedrock (any or no region prefix), Vertex or Foundry ID \u2014 covers every dated and provider form of that model; any other key \u2014 a gateway model alias, or a spelling Claude Code does not itself use \u2014 matches that model ID only (case-insensitive), and such an exact match wins over a built-in row. On Bedrock an application inference profile is matched by its backing model. An invalid row or multiplier is reported and skipped; the rest still apply. "multiplier" in (0, 1] scales every computed cost, overridden or not (0.85 = 85% of the price). Only honored from managed settings (server-managed, MDM / OS policy, or managed-settings.json), or \u2014 when none of those sets it \u2014 when supplied by a host application that manages the model provider; ignored in user, project, local and --settings sources.`),enableAllProjectMcpServers:G().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:X(O()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:X(O()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:G().optional().describe("When true in any settings source, claude.ai MCP cloud connectors are not auto-fetched or connected. Only gates auto-fetched connectors \u2014 a claudeai-proxy server passed explicitly (e.g. via --mcp-config or the SDK mcpServers option) still follows the normal MCP config trust flow. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:Ee(O(),me(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),disableBundledSkills:G().optional().describe("Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1."),managedMcpServers:Ee(O().refine(RR,{error:"server names may only contain letters, numbers, hyphens and underscores, and may not be __proto__, constructor or prototype"}),IR(),{error:LR}).optional().describe(`MCP servers the organization provides to every user, keyed by server name, each with the .mcp.json entry shape; only "http" and "sse" servers are accepted (nothing that names a program to run, no \${VAR} references). Honored from managed settings only; users cannot remove them, deniedMcpServers still applies, and they need no allowedMcpServers entry. Not read in Claude Desktop's Code tab on a third-party deployment or in Cowork sessions, where Claude Desktop supplies and locks the session's MCP servers itself.`),allowedMcpServers:X($v()).optional().describe("Enterprise allowlist of the MCP servers users may use. Governs servers users add (user, project and local config, --mcp-config, agent frontmatter, plugins, claude.ai connectors); servers the organization itself delivers (managedMcpServers, and managed-mcp.json entries that use no ${VAR} expansion) are allowed without being listed; a managed-mcp.json entry that uses ${VAR} expansion is still checked against this list. If undefined, all servers are allowed. If empty array, users can use no servers of their own. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:X(jv()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:Ru().optional().describe("Custom commands to run before/after tool executions"),worktree:B({symlinkDirectories:X(O()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:X(O()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos \u2014 only the listed paths are written to disk."),baseRef:me(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/<default-branch> for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:me(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly."),location:O().optional().catch(void 0).describe("Directory under which Claude Code Desktop creates the worktrees of SSH sessions that run on this machine (an absolute path or one starting with ~/), instead of <project>/.claude/worktrees. Read by the desktop app from the SSH host user settings; a location chosen in the desktop app's SSH connection settings takes precedence. The CLI (--worktree, EnterWorktree, agent isolation) does not read it yet.")}).optional().describe("Git worktree configuration: the CLI --worktree flag, EnterWorktree and agent isolation, plus the location Claude Code Desktop uses for SSH-session worktrees on this machine."),disableAllHooks:G().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:G().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:G().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:G().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),disableArtifact:G().optional().describe("Deprecated: use enableArtifact: false. Still honored \u2014 true disables the Artifact tool; false is ignored."),enableArtifact:G().optional().describe("Turn the Artifact tool on or off. Off in any of managed, --settings, or user settings wins; project and local settings can only turn it off. Unset defaults to on once the feature is available."),enableWorkflows:G().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:me(["unrestricted","small","medium","large"]).optional().describe('Advisory size guideline for the dynamic workflows Claude writes: "small" aims for fewer than 5 agents, "medium" (the default) fewer than 15, "large" fewer than 50, and "unrestricted" sends no guideline. A value here \u2014 including from managed settings \u2014 takes precedence over the "Dynamic workflow size" choice in /config, and that /config row is hidden while a settings file provides the key. This is a guideline, not an enforced limit.'),workflowKeywordTriggerEnabled:G().optional().describe('Enable the "ultracode" keyword trigger: including the keyword in a prompt opts that turn into the Workflow tool. Set to false to disable the trigger. Default: true.'),disableSkillShellExecution:G().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:me(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashOutputMaxChars:Oe().int().positive().optional().catch(void 0).describe("How many characters of a successful Bash or PowerShell command's output Claude receives inline (default 30000; values clamp to 4000-128000). Output past this is saved to a file and Claude receives a short preview plus the path. When set, this also replaces BASH_MAX_OUTPUT_LENGTH, which on its own only sizes the read-back window."),taskOutputMaxChars:Oe().int().positive().optional().catch(void 0).describe("How many characters of a background task's output the TaskOutput tool hands Claude inline (default 32000; values clamp to 4000-128000). Longer output is cut to its most recent characters with the path of the full output file, except that a shell command still running returns its first characters up to this size. When set, this also replaces TASK_MAX_OUTPUT_LENGTH, which on its own only sizes that window."),respondToBashCommands:G().optional().describe("Whether Claude responds after an input-box ! bash command runs. Set to false to add the command output to context without a response. Default: true."),allowManagedHooksOnly:G().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:X(O()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:X(O()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:G().optional().describe("When true (and set in managed settings), permission rules from user, project, local, and --settings files and allow rules from --allowedTools are ignored; only managed settings can add allow rules through settings. --disallowedTools and other deny and ask rules from the command line or the current session still apply."),allowManagedMcpServersOnly:G().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:G().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:at(s=>Array.isArray(s)?s.filter(n=>sS.includes(n)):s,Re([G(),X(me(sS))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control \u2014 plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:B({type:le("command"),command:O(),padding:Oe().optional(),refreshInterval:Oe().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:G().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:O().optional().describe('URL template for PR links in the footer link badges and inline messages. The detected git PR is rendered as the first footer-link badge. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),footerLinksRegexes:X(sEe().catch(nS)).transform(s=>s.filter(n=>n!==nS)).optional().catch(void 0).describe("Extra clickable footer badges that appear when a regex matches turn output (tool results and assistant responses). Read from user, flag, and managed settings only; ignored in project .claude/settings.json and local .claude/settings.local.json. At most 5 badges render; the oldest is displaced by newer matches and /clear removes them. Use to surface IDs printed by project CLIs as session links."),subagentStatusLine:B({type:le("command"),command:O()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:Ee(O(),Re([X(O()),G(),lw()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json \u2014 setting false in ~/.claude/settings.json is overridden by the project.'),prependPlugins:X(O()).optional().catch(void 0).describe("Managed plugins (plugin@marketplace ids that managed enabledPlugins sets true) whose hooks run first, outermost, in the listed order: the first id listed sees every event before any other plugin and every result after it. Managed plugins not listed here or in appendPlugins follow the listed ones; user, project and marketplace plugins come after those; then appendPlugins; then the built-in plugins. The bundled sec-default@builtin seats itself outermost (on a machine with managed settings and for Team and Enterprise organizations) unless this list is set, in which case list sec-default@builtin where it should sit or leave it out. Any other id that is not an enabled managed plugin is skipped; an id listed in both keys is prepended. Only honored from managed settings (or, on a machine with none, from user settings for your own plugins); ignored in project, local and --settings sources."),appendPlugins:X(O()).optional().catch(void 0).describe("Managed plugins (plugin@marketplace ids that managed enabledPlugins sets true) whose hooks run last among plugins, innermost, in the listed order: the last id listed sits just above the built-in plugins and sees each event as every other plugin left it. Only honored from managed settings (or, on a machine with none, from user settings for your own plugins); ignored in project, local and --settings sources."),extraKnownMarketplaces:r("extraKnownMarketplaces").optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),additionalMarketplaces:r("additionalMarketplaces").optional().describe("Alias for extraKnownMarketplaces: this key is read exactly as if it were spelled extraKnownMarketplaces. Do not set both in one file \u2014 if both appear, this key is ignored with a warning. Claude Code may rewrite this key as extraKnownMarketplaces when it updates the file. Clients older than this alias ignore it, so prefer extraKnownMarketplaces while older Claude Code versions still share the same settings."),strictKnownMarketplaces:X(xo()).optional().describe('Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these sources can be added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to allow every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only \u2014 it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces.'),allowedMarketplaces:X(xo()).optional().describe("Alias for strictKnownMarketplaces (managed settings only): this key is read exactly as if it were spelled strictKnownMarketplaces. Do not set both in one file \u2014 if both appear, this key is ignored with a warning. Clients older than this alias ignore it, so keep using strictKnownMarketplaces when the allowlist must also bind older Claude Code versions."),blockedMarketplaces:X(xo()).optional().describe('Enterprise blocklist of marketplace sources. When set in managed settings, these sources are blocked from being added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to block every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem.'),disableCommandPluginSources:G().optional().describe("Controls the `command` plugin source, whose plugin directory is produced by running a marketplace-declared command on this machine. true: command-sourced plugins are never installed, updated, or re-resolved (the command never runs). false: explicitly allowed. Unset: follows allowManagedHooksOnly \u2014 an org that restricts hook execution to managed settings gets command sources disabled too. Only honored from managed settings."),disableSideloadFlags:G().optional().describe("When true (and set in managed settings), rejects the --plugin-dir, --plugin-url, --agents, and non-sdk --mcp-config CLI flags at startup. Closes the CLI-flag bypass of strictKnownMarketplaces. Pair with allowedMcpServers for per-server MCP control; this setting does not gate other MCP entry points (SDK setMcpServers, claude mcp add, .mcp.json). Also blocks surfaces that spawn the CLI with these flags internally (see settings documentation). Only honored from managed settings; ignored in user/project/local settings."),pluginSuggestionMarketplaces:X(O()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source."),forceLoginMethod:me(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:O().min(1).optional().catch(void 0).describe('Cloud gateway URL to pre-fill and auto-connect to during login, alongside forceLoginMethod: "gateway". Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings.'),gatewayInternalNetworks:X(O()).optional().catch([yD]).meta({default:void 0}).describe("IPv4 CIDR blocks (at most 4, each /8 to /32, not overlapping) your Cloud gateway sits in: the public block your organization numbers its internal network from, which lets /login reach a gateway there. A block must lie entirely outside private space, where /login accepts a gateway without this key. /login accepts a gateway inside a listed block over a direct connection only, and only when this machine's own address on that connection is inside the same block, so /login must happen from a machine whose own address is inside the block (not through a proxy, VPN pool, container or NAT segment outside it). A bar against copied settings files, not proof of location. Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings."),parentSettingsBehavior:me(["first-wins","merge"]).optional().describe(`Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped \u2014 admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),managedSourcesBehavior:me(["first-wins","merge"]).optional().describe(`Controls how the managed settings sources compose. "first-wins" (default): the highest-priority source present (server-managed > MDM (managed plist / HKLM) > managed-settings.json) is the managed tier alone. "merge": every present source deep-merges with fixed precedence server-managed > MDM > managed-settings.json \u2014 scalars take the highest source's value (a restrictive boolean or enum \u2014 the allowManaged*Only locks, the disable* switches, the sandbox lock family \u2014 takes the strictest value any source sets) and arrays union, except fallbackModel, the restriction allowlists allowedMcpServers, availableModels, strictKnownMarketplaces and allowedChannelPlugins, and sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets one owns it whole), modelOverrides (the whole map of the highest source that sets it, dropped when that source sits below the one that sets availableModels), managedMcpServers (server names union; a name set by two sources takes the higher source's whole entry), and the keys taken from the highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod, forceLoginGatewayUrl and gatewayInternalNetworks, the credential helpers apiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, otelHeadersHelper and proxyAuthHelper, modelPicker, permissions.defaultMode, parentSettingsBehavior and the policyHelper configuration (env keeps its own per-key union). Honored only from the highest-priority source present; enable it only when every lower source is admin-controlled, since lower sources then contribute entries such as permissions.allow. HKCU and --managed-settings never take part in the merge.`),forceLoginOrgUUID:Re([O(),X(O())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:G().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:O().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:O().optional().describe("Controls the output style for assistant responses"),viewMode:me(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:O().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:G().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:pR().optional(),feedbackSurveyRate:Oe().min(0).max(1).optional().describe("Probability (0\u20131) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),feedbackDrafts:me(["notify","quiet","off"]).optional().describe('Model-drafted feedback (the SendFeedback tool). "notify" (default) shows a one-line notice when a draft is queued; "quiet" shows only the footer counter; "off" disables the tool entirely so drafts are never queued.'),spinnerTipsEnabled:G().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:B({mode:me(["append","replace"]),verbs:X(O())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:B({excludeDefault:G().optional().catch(void 0),tips:Rbe().optional(),tipsFile:O().optional().catch(void 0).describe("Absolute or ~/ local path to a JSON file holding an array of tips (same shapes as `tips`); honored from user, --settings and on-disk managed settings only. Read once per CLI process (restart to pick up edits)."),label:O().optional().catch(void 0).describe('Prefix shown before your tips in the spinner (default "Tip")')}).passthrough().optional().catch(void 0).describe("Add your organization's own tips to the spinner tip rotation. tips: strings or {id, text, cooldownSessions?, priority?} objects; tipsFile: a JSON file of the same; label: prefix shown before your tips; excludeDefault: if true, only show your tips (default: false)."),syntaxHighlightingDisabled:G().optional().describe("Whether to disable syntax highlighting in diffs"),spellcheck:B({enabled:G().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:O().optional().catch(void 0).describe(`Which spell checker to run: ${Kp.map(s=>`"${s}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:O().optional().catch(void 0).describe(`Dictionary to use, passed to the checker as-is (aspell --lang, hunspell -d, ispell -d), e.g. "en_GB"; names are checker-specific (letters, digits and _ - . , only). Default: the checker's own default`),color:O().optional().catch(void 0).describe(`Color of misspelled words (they are also underlined): a terminal color name such as "red" or "magenta", "#rrggbb", "rgb(r,g,b)", "ansi256(n)" or "ansi:<name>". Default: the theme's error color`)}).passthrough().optional().catch(void 0).describe(`Underline misspelled words in the prompt input as you type, using an installed ${Kp.slice(0,-1).join(", ")} or ${Kp.at(-1)} (off unless "enabled" is true; does nothing if none is installed). Read from user, flag and managed settings only (the whole block from the highest-precedence of those applies); ignored in project .claude/settings.json and .claude/settings.local.json.`),terminalTitleFromRename:G().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:me(bu).optional().catch(void 0).describe('Prompt cache TTL for the main conversation (interactive, -p and SDK turns, plus the helpers that run inline with it): "5m" or "1h". Unset = automatic: 1 hour on a Claude subscription within its usage limits, 5 minutes on an API key, Bedrock, Vertex or Foundry. 1-hour cache writes are billed at a higher rate; the cache stays warm across longer breaks. The CLAUDE_CODE_PROMPT_CACHE_TTL environment variable takes precedence.'),subagentPromptCacheTtl:me(bu).optional().catch(void 0).describe('Prompt cache TTL for everything outside the main conversation \u2014 subagents, workflows, background and helper requests: "5m" or "1h". Unset = automatic (5 minutes unless ENABLE_PROMPT_CACHING_1H=1). The CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL environment variable takes precedence.'),alwaysThinkingEnabled:G().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:me(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),maxEffortLevel:me(Cw).optional().catch(void 0).describe("Maximum effort level. Anything above it (an /effort or /model pick, --effort, CLAUDE_CODE_EFFORT_LEVEL, a model default) is clamped to it, on every provider including Bedrock, Vertex and Foundry. Combines with an organization's per-model effort cap by taking the lower of the two; across settings files the lowest value wins, and modelSettings.<model>.maxEffortLevel replaces it per model. Enforced client-side: an effort supplied through CLAUDE_CODE_EXTRA_BODY is not clamped."),modelSettings:at(s=>typeof s=="object"&&s!==null&&!Array.isArray(s)?I_e(s,(n,a)=>Object.hasOwn(Object.prototype,a)):s,Ee(O(),B({effortLevel:me(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model."),maxEffortLevel:me(Cw).optional().catch(void 0).describe('Maximum effort level for this model. Within one settings file it replaces the top-level maxEffortLevel for the model ("max" exempts it); across settings files the lowest applicable value wins. Keyed like effortLevel: the canonical model name also matches its dated, [1m], Bedrock and Vertex spellings.')}).passthrough().optional().catch(void 0))).optional().catch(void 0).describe("Per-model settings keyed by canonical model name."),ultracode:G().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. Session-scoped \u2014 typically provided via --settings or the apply_flag_settings control request; interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:nEe().describe("Auto-compact window size"),advisorModel:O().optional().describe("Advisor model for the server-side advisor tool."),fastMode:G().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:G().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:G().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:G().optional().describe("When false, the :emoji: shortcode typeahead (the suggestion popup and the :name: inline replacement) is disabled. When absent or true, it is enabled."),awaySummaryEnabled:G().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:G().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:me(["60s","5m","10m","never"]).optional().catch(void 0).describe("Idle time before Claude's questions auto-continue with any answers selected so far. Defaults to never \u2014 auto-continue only runs when explicitly set to 60s/5m/10m."),dialogExpiry:me(["60s","5m","10m","never"]).optional().catch(void 0).describe('Max time a permission/user dialog forwarded to a remote client stays parked awaiting an answer, and how long a HELD cross-session message awaits approval, before either resolves to its safe no-action default (cancelled / dropped-with-denial). Defaults to 5m to match the long-standing remote-dialog deadline; "never" disables the deadline. Local-only permission prompts (no remote client) are unaffected. The CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS env var, when set, overrides this. Read from trusted sources only (never a checked-in repo settings file).'),agent:O().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),modelProposedGoals:me(cve).optional().catch(void 0).describe("@internal Controls the ProposeGoal tool (model-proposed session goals). 'auto' (the default when absent) lets the model choose per proposal whether to ask for approval via its ask_user parameter; 'alwaysAsk' routes every model-proposed goal through the approval dialog; 'disabled' turns the tool off. A typed /goal is unaffected. Consent-affecting, so it is read from trusted sources only (user/policy/flag) \u2014 workspace-resident project and local settings are ignored."),companyAnnouncements:X(O()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:Ee(O(),B({mcpServers:Ee(O(),Ee(O(),Re([O(),Oe(),G(),X(O())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:Ee(O(),Re([O(),Oe(),G(),X(O())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(lw())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:B({defaultEnvironmentId:O().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:me(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:O().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:O().optional().describe("Minimum Claude Code version required to start. If the running version is older, Claude Code exits at startup with instructions to update. Only enforced from managed (policy) settings."),requiredMaximumVersion:O().optional().describe("Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup with instructions to install an approved version. Only enforced from managed (policy) settings."),plansDirectory:O().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:me(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),voice:B({enabled:G().optional(),mode:me(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:G().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:G().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:X(hD()).optional().describe("Managed-org allowlist of channel plugins. When set, replaces the default Anthropic allowlist \u2014 admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:G().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:Re([me(nve),O()]).optional().describe('Clock format for times shown in the UI: "auto" (default, follows the locale), "12-hour", "24-hour", "24-hour-utc" ("18:05Z"), or a strftime pattern such as "%H:%M" (any value containing "%"; other values read as "auto"). A pattern replaces the time everywhere; message timestamps show only the pattern, so include %Y-%m-%d for the date. /config offers the presets; a pattern is set here.'),timeZone:O().optional().describe('IANA time zone for times shown in the UI, e.g. "UTC" or "Europe/Dublin". Default: the system time zone. An unknown name falls back to the system time zone.'),doneMeansMerged:G().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),totalTokensReminder:me(["off","infinite","fixed","countdown","padded-countdown"]).optional().describe("@internal Emit a <total_tokens>N tokens left</total_tokens> block in the system prompt, after each tool result, and (when totalTokensReminderAfterUserTurn is on) after each regular user prompt. 'infinite' uses the literal value Infinite, 'fixed' uses 5000000, 'countdown' uses the live remaining context-window tokens, 'padded-countdown' counts down from totalTokensReminderBudget (re-anchoring to the full budget on each regular user prompt when totalTokensReminderAfterUserTurn is on \u2014 task-budget semantics). Defaults to padded-countdown. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:Oe().int().positive().optional().describe("@internal Starting budget (tokens) for totalTokensReminder 'padded-countdown' mode. Defaults to 15000000. Server-controlled via GrowthBook; env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET overrides."),totalTokensReminderAfterUserTurn:G().optional().describe("@internal When true, emit the totalTokensReminder block after each regular user prompt and (for 'padded-countdown') re-anchor the task budget to the full configured value at the start of each user turn. When false, the reminder appears only in the system prompt and after each tool-result batch, and 'padded-countdown' counts down over the whole session. Defaults to on. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN overrides; server-controlled via GrowthBook tengu_lapis_anchor_user_turn."),autoMemoryEnabled:G().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:O().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoDreamEnabled:G().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:G().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:G().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:G().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:me(["disable"]).optional().describe("Disable auto mode"),remoteTools:B({allowUnattendedServing:G().optional().describe("@internal When false in managed or user settings, a cloud session in auto mode may not run commands on this computer without a person approving each one, whatever consent the computer has given; a project, local or --settings value is ignored. Default: true.")}).optional().describe("@internal How this computer serves tool calls to cloud sessions"),sshConfigs:X(B({id:O().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:O().describe("Display name for the SSH connection"),sshHost:O().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:Oe().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:O().optional().describe("Path to SSH identity file (private key)"),startDirectory:O().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:O().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:X(O()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:O().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:Re([me(lve),O().startsWith("custom:").transform(s=>s)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:me(sve).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:me(["classic","readline"]).optional().catch(void 0).describe("Deprecated: no longer has any effect. The prompt's word-editing keys always follow Bash (readline) conventions."),vimInsertModeRemaps:Ee(O(),$e()).optional().catch(void 0).describe('Vim INSERT-mode key-sequence remaps, e.g. {"jj": "<Esc>"}. Each key is exactly two printable characters typed in sequence; "<Esc>" (return to NORMAL mode) is the only supported target. Applies when editorMode is "vim".'),verbose:G().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:me(ive).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:G().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:G().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),switchModelsOnFlag:G().optional().describe("When safeguards flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead."),autoContinueAtUsageLimit:G().optional().describe("When a claude.ai usage limit stops your session, wait for the limit to reset and continue the task automatically. When off, the limit dialog offers the wait as a choice instead."),autoScrollEnabled:G().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:G().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:G().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:G().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:G().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:G().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:G().optional().describe("Enable the todo / task tracking panel"),teammateMode:me(ave).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:G().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:B({shareHostProfile:me($g).optional().catch(void 0).describe("@internal What a Remote Control environment reports about this machine when it registers: 'off' reports nothing, 'basic' the OS, architecture and detected developer tools, 'full' also the names of MCP servers configured on this machine (never a repository's .mcp.json). When unset, the level comes from the feature rollout, which may be any of the three. Managed, --settings and user settings choose the level (the most restrictive wins); project and local settings can only lower it, never raise it. Read when Remote Control starts; lowering it later applies from the next registration, raising it from the next start.")}).optional().describe("@internal Remote Control (`claude remote-control`) options"),isolatePeerMachines:G().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:me(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),crossSessionInbound:me(Od).optional().catch(void 0).describe("Inbound cross-session peer messages (SendMessage from your other sessions): 'accept' delivers them, 'hold' parks them for your review without letting Claude act, 'refuse' opts this session out. An explicit value always wins. Unset (mode parity): a message auto-delivers only when the sending session's permission-mode class matches yours (bypass\u2194bypass or prompting\u2194prompting); a mismatched sender's message is held for your approval; a sender that asserts no class is held only while this session bypasses permission prompts."),autoUploadSessions:G().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:G().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:G().optional().describe("Allow Claude to push proactive mobile notifications"),...dbe(e)}).passthrough()}var aEe=re(()=>vD(Uv())),aS=Object.freeze({serverName:"invalid-entry-stripped"});function oS(e,t,r){return X(t.catch(i=>(r({path:`${e}[]`,message:`Invalid entry was ignored: ${i.issues[0]?.message??"failed validation"}`}),aS))).transform(i=>i.filter(s=>s!==aS)).optional()}var yD="(unreadable)";function Zp(e,t,r,i,s){return X($e()).transform(n=>{let a=[];for(let[o,l]of n.entries()){let c=t.safeParse(l);if(c.success){a.push(c.data);let u=s?.(l,c.data);u!==void 0&&r({path:`${e}[${o}]`,message:u,statusOnly:!0})}else{let u=c.error.issues[0],p=u===void 0?"failed validation":u.path.length?`${u.path.join(".")}: ${u.message}`:u.message;r({path:`${e}[${o}]`,message:`Invalid entry was ignored: ${p}`})}}return n.length>0&&a.length===0&&r({path:e,message:`Every entry of "${e}" was invalid; enforcing an empty allowlist (${i}) until it is fixed.`}),a}).optional().catch(()=>(r({path:e,message:`"${e}" was present but invalid; enforcing an empty allowlist (${i}) until it is fixed.`}),[]))}function oEe(e,t){let r=aEe(),i={};for(let[m,g]of Object.entries(r.shape))i[m]=g.catch(b=>{e({path:m,message:`${b.issues[0]?.message??"Failed schema validation"}. This field was ignored.`})});for(let m of["prependPlugins","appendPlugins"])m in r.shape&&(i[m]=X(O()).optional().catch(g=>{e({path:m,message:`${g.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`})}));i.allowedMcpServers=oS("allowedMcpServers",$v(),e).catch(()=>(e({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[])),i.deniedMcpServers=oS("deniedMcpServers",jv(),e).catch(()=>{e({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'})}),i.managedMcpServers=$e().transform(m=>PR(m,(g,b)=>e({path:g?`managedMcpServers.${g}`:"managedMcpServers",message:g?`Managed MCP server was ignored: ${b}`:b,statusOnly:!0}))).optional(),i.allowManagedHooksOnly=r.shape.allowManagedHooksOnly.catch(()=>(e({path:"allowManagedHooksOnly",message:'"allowManagedHooksOnly" was present but invalid; treating it as true (only managed hooks run; command-sourced plugins disabled) until it is fixed.'}),!0)),i.syncClaudeAiSkills=r.shape.syncClaudeAiSkills.catch(()=>(e({path:"syncClaudeAiSkills",message:'"syncClaudeAiSkills" was present but invalid; treating it as false (claude.ai skills sync off) until it is fixed.'}),!1)),i.syncClaudeAiPlugins=r.shape.syncClaudeAiPlugins.catch(()=>(e({path:"syncClaudeAiPlugins",message:'"syncClaudeAiPlugins" was present but invalid; treating it as false (claude.ai plugins sync off) until it is fixed.'}),!1)),i.remoteTools=r.shape.remoteTools.catch(()=>(e({path:"remoteTools",message:'"remoteTools" was present but invalid; treating allowUnattendedServing as false (no unattended serving) until it is fixed.'}),{allowUnattendedServing:!1})),i.disableCommandPluginSources=r.shape.disableCommandPluginSources.catch(()=>(e({path:"disableCommandPluginSources",message:'"disableCommandPluginSources" was present but invalid; treating it as true (command-sourced plugins disabled) until it is fixed.'}),!0)),i.allowManagedMcpServersOnly=r.shape.allowManagedMcpServersOnly.catch(()=>(e({path:"allowManagedMcpServersOnly",message:'"allowManagedMcpServersOnly" was present but invalid; treating it as true until it is fixed.'}),!0)),i.enforceAvailableModels=r.shape.enforceAvailableModels.catch(()=>(e({path:"enforceAvailableModels",message:'"enforceAvailableModels" was present but invalid; treating it as true until it is fixed.'}),!0)),i.availableModels=X($e()).transform((m,g)=>{let b=[];for(let C of m)typeof C=="string"?b.push(C):e({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(C)}); the entry was ignored.`});return b}).optional().catch(()=>(e({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[])),i.allowedHttpHookUrls=Zp("allowedHttpHookUrls",O(),e,"no HTTP hooks may run"),i.httpHookAllowedEnvVars=Zp("httpHookAllowedEnvVars",O(),e,"no environment variables may be interpolated into HTTP hook headers"),i.allowedChannelPlugins=Zp("allowedChannelPlugins",Dbe(),e,"no channel plugins admitted",(m,g)=>typeof m=="string"?`"allowedChannelPlugins" entry "${m}" was accepted; prefer the documented object form {"plugin": "${g.plugin}", "marketplace": "${g.marketplace}"}.`:void 0),i.gatewayInternalNetworks=X(O()).optional().catch(()=>(e({path:"gatewayInternalNetworks",message:'"gatewayInternalNetworks" was present but invalid; gateway sign-in governed by this source is refused until it is fixed.'}),[yD])),i.forceLoginOrgUUID=r.shape.forceLoginOrgUUID.catch(()=>(e({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]));let s=!1,n=(m,g)=>{let b=m.safeParse(g);if(!b.success)return b.error.issues.slice(0,3).map(C=>C.path.length?`${C.path.join(".")}: ${C.message}`:C.message).join("; ")},a;i.policyHelper=at(m=>{if(s=!1,a=m,m&&typeof m=="object"&&!Array.isArray(m)){let g=m;for(let b of["defaultSettings","default",...Rc])g[b]!==void 0&&g[b]!==null&&e({path:"policyHelper",message:`"${b}" on the singular policyHelper is ignored \u2014 static fallback payloads belong on the policyHelpers per-OS entries ("defaultSettings") or the map's "default" key. The intended fallback will NOT apply from here.`,statusOnly:!0});for(let b of["policyHelper","policyHelpers"])g[b]!==void 0&&g[b]!==null&&e({path:"policyHelper",message:`"${b}" inside the singular policyHelper is ignored \u2014 "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside the singular entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let b of Lr)g[b]!==void 0&&g[b]!==null&&e({path:"policyHelper",message:`"${b}" on the singular policyHelper is ignored \u2014 per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${b}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});g.claudeMd!==void 0&&g.claudeMd!==null&&e({path:"policyHelper",message:`"claudeMd" on the singular policyHelper is ignored \u2014 "claudeMd" is a managed-settings key: put it at the settings top level or inside a static payload, or emit it from the helper's stdout envelope. The intended instructions will NOT apply from here.`,statusOnly:!0}),g.outputBehavior!==void 0&&g.outputBehavior!==null&&e({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored \u2014 it is only honored on the policyHelpers per-OS entries (policyHelpers.${Lr.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0}),g.onFailure!==void 0&&g.onFailure!==null&&e({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored \u2014 it is only honored on the policyHelpers per-OS entries (policyHelpers.${Lr.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0}),g.retries!==void 0&&g.retries!==null&&e({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored \u2014 it is only honored on the policyHelpers per-OS entries (policyHelpers.${Lr.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0}),(g.path===null||g.path===void 0)&&(s=!0)}return m===null?void 0:m},Iu().optional()).catch(m=>{e({path:"policyHelper",message:`${m.issues[0]?.message??n(Iu(),a)??"Failed schema validation"}. This field was ignored.`,...s&&{statusOnly:!0}})});let o=(m,g)=>{e({path:m,message:`"${m}" is not a valid static settings payload: ${g??"failed validation"}. When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0})},l=[],c=m=>{let g=!1,b,C=Fg(m,Es().optional().catch(A=>{g=!0,o(`policyHelpers.${m}.defaultSettings`,A.issues[0]?.message??n(Es(),b&&typeof b=="object"&&!Array.isArray(b)?b.defaultSettings:void 0))}));return at(A=>{if(g=!1,b=A,m!=="default"&&A&&typeof A=="object"&&!Array.isArray(A)){let w=A;for(let x of[...Rc,"claudeMd"])w[x]!==void 0&&w[x]!==null&&e({path:`policyHelpers.${m}`,message:`"${x}" on the policyHelpers.${m} entry is ignored \u2014 helper output cannot be pre-seeded on an entry; a static fallback payload goes under this entry's "defaultSettings" (a managed-settings object). The intended content will NOT apply from here.`,statusOnly:!0});for(let x of["policyHelper","policyHelpers"])w[x]!==void 0&&w[x]!==null&&e({path:`policyHelpers.${m}`,message:`"${x}" on the policyHelpers.${m} entry is ignored \u2014 "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside an entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let x of Lr)w[x]!==void 0&&w[x]!==null&&e({path:`policyHelpers.${m}`,message:`"${x}" on the policyHelpers.${m} entry is ignored \u2014 per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${x} config will NOT apply from here.`,statusOnly:!0});w.default!==void 0&&w.default!==null&&e({path:`policyHelpers.${m}`,message:`"default" on the policyHelpers.${m} entry is ignored \u2014 the per-entry static payload field is spelled "defaultSettings"; "default" is the MAP's any-platform catch-all key (a sibling of the OS entries). The intended fallback will NOT apply from here.`,statusOnly:!0});let S=w.onFailure;if(S!=null&&!gD(S)){let x;if(typeof S=="string"){let T=S.replace(/[^\x20-\x7e]/gu,"?");x=JSON.stringify(T.length>iS?`${T.slice(0,iS-1)}\u2026`:T)}else typeof S=="number"||typeof S=="boolean"?x=String(S):x=`a non-string value (${Array.isArray(S)?"array":typeof S})`;e({path:`policyHelpers.${m}.onFailure`,message:`"onFailure": ${x} on the policyHelpers.${m} entry is not a recognized value ("continue" or "refuse"); it is treated as "refuse" \u2014 a startup failure of this entry's helper with no static payload in its place will not start Claude Code.`,statusOnly:!0})}if(fD(A))return}return A===null?void 0:A},C.optional()).catch(A=>{if(m==="default"){o("policyHelpers.default",A.issues[0]?.message??n(Es(),b));return}if(g)return;let w=n(Fg(m),b)??"failed validation",S=b,x=S&&typeof S=="object"&&!Array.isArray(S)?S:null,T=x?.onFailure,I=T!=null&&T!=="continue",L=P=>{let $=`policyHelpers.${m}`;I?l.push({entryKey:m,message:P}):e({path:$,message:P,statusOnly:!0})};if(x){let P=x.defaultSettings;if(P!=null){let $=Es().safeParse(P);if($.success){let se=x.outputBehavior,ee=se==null?null:mD().safeParse(se);if(ee&&!ee.success){L(`Invalid entry was ignored: ${w}. Its "defaultSettings" static payload was NOT kept: "outputBehavior" is unrecognized, so whether the payload replaces or merges over this source's settings is unknown. No policy helper runs on ${m} from this entry.`);return}return e({path:`policyHelpers.${m}`,message:`Invalid entry: its helper fields were ignored (${w}), but its "defaultSettings" static payload was kept. No policy helper runs on ${m} from this entry.`,statusOnly:!0}),{defaultSettings:$.data,...ee&&{outputBehavior:ee.data}}}}}L(`Invalid entry was ignored: ${w}. No policy helper runs on ${m} from this entry.`)})};i.policyHelpers=at(m=>{if(l=[],m&&typeof m=="object"&&!Array.isArray(m)){let g=m;for(let b of["defaultSettings",...Rc,"claudeMd"])g[b]!==void 0&&g[b]!==null&&e({path:"policyHelpers",message:`"${b}" directly on the policyHelpers map is ignored \u2014 static fallback payloads go on a per-OS entry's "defaultSettings" or the map's "default" key (a managed-settings object), and helper-output keys come from the helper's stdout. The intended content will NOT apply from here.`,statusOnly:!0});for(let b of["policyHelper","policyHelpers"])g[b]!==void 0&&g[b]!==null&&e({path:"policyHelpers",message:`"${b}" inside the policyHelpers map is ignored \u2014 "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; the map's keys are the per-OS entries and "default". The nested config will NOT apply from here.`,statusOnly:!0});for(let b of jg.filter(C=>C!=="defaultSettings"))if(g[b]!==void 0&&g[b]!==null){let C=b==="script"||b==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":b==="outputBehavior"||b==="onFailure"||b==="retries"?"":", or on the singular policyHelper key";e({path:"policyHelpers",message:`"${b}" directly on the policyHelpers map is ignored \u2014 helper configs go on a per-OS entry (policyHelpers.${Lr.join("/")})${C}. No helper runs from this field here.`,statusOnly:!0})}}return m===null?void 0:m},B(Object.fromEntries(Fv.map(m=>[m,c(m)]))).transform(m=>{for(let g of Object.keys(m))m[g]===void 0&&delete m[g];for(let{entryKey:g,message:b}of l){let C=`policyHelpers.${g}`,A=Ybe(g).find(S=>m[S]?.defaultSettings!==void 0&&m[S]?.defaultSettings!==null),w=A!==void 0?`${A}.defaultSettings`:m.default!==void 0?"default":null;e(w!==null?{path:C,message:`${b} Its "onFailure" requires the helper; the "policyHelpers.${w}" static payload serves in its place.`,statusOnly:!0}:{path:C,message:`${b} Its "onFailure" requires the helper, so when delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0})}return l=[],m}).optional().catch(m=>(e({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${Lr.join(", ")}) to helper entries, plus an optional "default" settings payload (${m.issues[0]?.message??"failed schema validation"}). When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0}),{})));let u=Object.freeze({mode:"deny"}),p=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),h=0,f=[],_=t===void 0?"":`${[...t].reduce((m,g)=>Math.imul(m^g.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,v=(m,g)=>{if(typeof m!="object"||m===null)return;let b=pe=>g.some(ne=>ne.path?.includes(pe)),C=pe=>{let ne=m[pe];return typeof ne=="string"?ne:b(pe)?"":void 0},A=C("accessKeyIdVar"),w=C("secretAccessKeyVar"),S=C("sessionTokenVar"),x=Hp;if(![A,w,S].some(pe=>pe!==void 0&&x.includes(pe)))return;let T=pe=>pe!==void 0&&Ao().safeParse(pe).success;h+=1;let I=pe=>`${Mw}${pe}_${_}${h}_`,L=T(A)?A:I("ACCESS_KEY_ID"),P=T(w)&&w!==L?w:I("SECRET_ACCESS_KEY"),$=S===void 0?void 0:T(S)&&S!==L&&S!==P?S:I("SESSION_TOKEN"),se=pe=>pe.startsWith(Mw);if(!se(L)&&!se(P)){let pe=x.includes(P)?P:void 0;if(P=I("SECRET_ACCESS_KEY"),pe!==void 0){let ne=v({accessKeyIdVar:pe},[]);ne!==void 0&&f.push(ne)}}let ee=Ig().safeParse({accessKeyIdVar:L,secretAccessKeyVar:P,...$!==void 0&&{sessionTokenVar:$}});return ee.success?ee.data:void 0},E=(m,g,b)=>X(g.catch(C=>{let A=b(C.value);return A!==void 0?(e({path:`sandbox.credentials.${m}[]`,message:`Invalid entry was degraded to mode "deny": ${C.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${m==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`}),A):(e({path:`sandbox.credentials.${m}[]`,message:`Invalid entry was ignored: ${C.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),u)})).transform(C=>C.filter(A=>A!==u)).optional().catch(C=>{if(typeof C.value=="object"&&C.value!==null&&!Array.isArray(C.value)){let A=g.safeParse(C.value);if(A.success)return e({path:`sandbox.credentials.${m}`,message:`"${m}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[A.data];let w=b(C.value);if(w!==void 0)return e({path:`sandbox.credentials.${m}`,message:`"${m}" must be an array; its lone entry object was invalid and was degraded to mode "deny". The credential stays blocked (not masked) until it is fixed.`}),[w]}return e({path:`sandbox.credentials.${m}`,message:`${C.issues[0]?.message??"Invalid value"}. "${m}" was ignored; these credential entries are NOT protected until it is fixed.`}),[]}),y=B({files:E("files",Rg(),m=>{if(typeof m!="object"||m===null||!("mode"in m)||m.mode!=="mask"&&m.mode!=="deny"||!("path"in m)||typeof m.path!="string")return;let g=Rg().safeParse({path:m.path,mode:"deny"});return g.success?g.data:void 0}),envVars:E("envVars",Dg(),m=>{if(typeof m!="object"||m===null||!("mode"in m)||m.mode!=="mask"&&m.mode!=="deny"||!("name"in m)||typeof m.name!="string")return;let g=Dg().safeParse({name:m.name,mode:"deny"});return g.success?g.data:void 0}),allowPlaintextInject:G().optional().catch(m=>(e({path:"sandbox.credentials.allowPlaintextInject",message:`${m.issues[0]?.message??"Invalid value"}. "allowPlaintextInject" was degraded to an explicit false; plaintext credential injection stays disabled (lower-precedence values cannot enable it) until it is fixed.`}),!1)),awsPairs:X(Ig().catch(m=>{let g=v(m.value,m.issues);return g!==void 0?(e({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${m.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`}),g):(e({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${m.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),p)})).transform(m=>{let g=m.filter(b=>b!==p);return f.length>0&&(g.push(...f),f.length=0),g}).optional().catch(m=>{let g=typeof m.value=="object"&&m.value!==null?v(m.value,[]):void 0,b=typeof m.value=="object"&&m.value!==null&&("accessKeyIdVar"in m.value||"secretAccessKeyVar"in m.value||"sessionTokenVar"in m.value);if(g===void 0&&b)return f.length=0,e({path:"sandbox.credentials.awsPairs",message:`${m.issues[0]?.message??"Invalid value"}. "awsPairs" must be an array; its lone pair-shaped entry claimed no conventional AWS name and was ignored. SigV4 re-signing stays unconfigured until it is fixed.`}),[];let C=g!==void 0?[g]:Hp.flatMap(A=>{let w=v({accessKeyIdVar:A},[]);return w!==void 0?[w]:[]});return f.length>0&&(C.push(...f),f.length=0),e({path:"sandbox.credentials.awsPairs",message:`${m.issues[0]?.message??"Invalid value"}. "awsPairs" was degraded to non-functional suppressor pair(s); implicit AWS auto-pairing stays suppressed but nothing re-signs until it is fixed.`}),C}),sigv4:B(Object.fromEntries(["streaming","presigned","sigv4a"].map(m=>[m,me(["deny","passthrough"]).optional().catch(g=>(e({path:`sandbox.credentials.sigv4.${m}`,message:`${g.issues[0]?.message??"Invalid value"}. "${m}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`}),"deny"))]))).optional().catch(m=>(e({path:"sandbox.credentials.sigv4",message:`${m.issues[0]?.message??"Invalid value"}. "sigv4" was degraded to an all-deny block (all shapes stay denied, and lower-precedence sigv4 values cannot take effect) until it is fixed.`}),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).optional().catch(m=>{e({path:"sandbox.credentials",message:`${m.issues[0]?.message??"Failed schema validation"}. The credentials block was degraded to a fail-closed skeleton (all-deny sigv4, implicit AWS auto-pairing suppressed, no masking) until it is fixed.`});let g=Hp.flatMap(b=>{let C=v({accessKeyIdVar:b},[]);return C!==void 0?[C]:[]});return f.length=0,{allowPlaintextInject:!1,awsPairs:g,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}}});return i.sandbox=pR().extend({credentials:y}).optional().catch(m=>{e({path:"sandbox",message:`${m.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});let g=m.value;if(typeof g=="object"&&g!==null&&"credentials"in g){let b=y.safeParse(g.credentials);if(b.success&&b.data!==void 0)return e({path:"sandbox.credentials",message:"The credentials block was salvaged from the invalid sandbox value and stays enforced; every other sandbox field was ignored."}),{credentials:b.data}}}),B(i).passthrough().transform(m=>{for(let g of Object.keys(m))m[g]===void 0&&delete m[g];return m})}var bD=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function lEe(e,t){if(!Kt(e))return[];let r=[];for(let{alias:i,canonical:s}of bD)i in e&&(s in e&&e[s]!==null?r.push({file:t,path:i,message:`"${i}" is an alias for "${s}" and this file sets both; the "${i}" value was ignored. Use only "${s}".`,severity:"warning",alias:i,canonical:s}):e[s]=e[i],delete e[i]);return r}function cEe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Bg(e){if(Array.isArray(e))return e.map(Bg);if(e!==null&&typeof e=="object"){let t={};for(let r of Object.keys(e).sort())t[r]=Bg(e[r]);return t}return e}var uEe=["enabled","enabledPlatforms"],ko="network.allowedDomains";function dEe(e){if(!e)return{shellSettings:{},envVars:{},sandboxSettings:{},hasHooks:!1,payloadSlots:{}};let t=ED(e),r=pEe(e);fEe([t,...r.map(([,a])=>a)]);let i={};for(let[a,o]of r){let l={shellSettings:o.hasHooks?{...o.shellSettings,hooks:Ns(o.hooks)}:o.shellSettings,envVars:o.envVars,sandboxSettings:o.sandboxSettings};SD(l)&&(i[a]=l)}let{sandboxSwitches:s,...n}=t;return{...n,payloadSlots:i}}function ED(e){let t={},r;for(let c of G_e){let u=e[c];if(c==="policyHelpers"){if(u!==null&&typeof u=="object")for(let h of Lr){let f=EEe(u[h]);f&&(t[`policyHelpers.${h}`]=f.command,f.scriptSize&&(r??={},r[`policyHelpers.${h}`]=f.scriptSize))}continue}let p;typeof u=="string"?p=u:u!==null&&typeof u=="object"&&"command"in u&&typeof u.command=="string"&&(p=u.command),p!==void 0&&p.length>0&&(t[c]=p)}let i=kEe(e);if(i&&typeof i=="object")for(let[c,u]of Object.entries(i)){let p=u?.source;if(!(!p||typeof p!="object")&&(p.source==="url"&&typeof p.headersHelper=="string"&&p.headersHelper.length>0&&(t[`extraKnownMarketplaces[${ze(c)}].source.headersHelper`]=lS(p.headersHelper,"url",p.url)),p.source==="settings"&&Array.isArray(p.plugins))){let h=new Map;for(let f of p.plugins){let _=ze(f?.name),v=h.get(_)??0;h.set(_,v+1);let E=f?.source;if(E!==null&&typeof E=="object"&&"source"in E&&E.source==="command"&&"command"in E&&typeof E.command=="string"&&E.command.length>0&&(t[`extraKnownMarketplaces[${ze(c)}].plugins[${ze(f.name)}][${v}].source.command`]=E.command),typeof f?.headersHelper=="string"&&f.headersHelper.length>0){let y=f.source,m=y!==null&&typeof y=="object";t[`extraKnownMarketplaces[${ze(c)}].plugins[${ze(f.name)}][${v}].headersHelper`]=lS(f.headersHelper,m&&"source"in y?y.source:void 0,m&&"url"in y?y.url:void 0)}}}}let s=e.sandbox,n={},a={enabled:fo(s,"enabled"),enabledPlatforms:fo(s,"enabledPlatforms"),[ko]:fo(s,ko)};if(s!==null&&typeof s=="object"){let c={enabled:a.enabled,enabledPlatforms:a.enabledPlatforms};for(let u of ER){let p=CEe(s[u]);p&&(t[`sandbox.${u}`]=Ns({value:p,...c}))}for(let u of q_e){let p=fo(s,u);mEe(u,p)&&(n[`sandbox.${u}`]=Ns({value:p,...c,...CD.has(u)&&{allowedDomains:OD(a[ko])}}))}}let o={};if(e.env&&typeof e.env=="object")for(let[c,u]of Object.entries(e.env)){if(u===void 0)continue;let p=String(u);p.length>0&&!eve(c,p)&&(o[c]=p)}let l=e.hooks!==void 0&&e.hooks!==null&&typeof e.hooks=="object"&&Object.keys(e.hooks).length>0;return{shellSettings:t,inlineHelperScriptSizes:r,envVars:o,sandboxSettings:n,hasHooks:l,hooks:l?e.hooks:void 0,sandboxSwitches:a}}function pEe(e){return hEe(e).map(([t,r])=>[t,ED(r)])}function hEe(e){let t=[];for(let r of wD){let i=`policyHelpers.${r}`,s=fo(e,i);if(!cEe(s))continue;let{policyHelper:n,policyHelpers:a,...o}=s;t.push([i,o])}return t}function fEe(e){let t=e.map(i=>Object.keys(i.sandboxSettings).length>0||ER.some(s=>i.shellSettings[`sandbox.${s}`]!==void 0)),r=e.map(i=>[...CD].some(s=>i.sandboxSettings[`sandbox.${s}`]!==void 0));e.forEach((i,s)=>{if(t.some((n,a)=>n&&a!==s))for(let n of uEe){let a=i.sandboxSwitches[n];a!==void 0&&(i.sandboxSettings[`sandbox.${n}`]=Ns({value:a}))}if(r.some((n,a)=>n&&a!==s)){let n=i.sandboxSwitches[ko];n!==void 0&&(i.sandboxSettings[`sandbox.${ko}`]=Ns({value:OD(n)??n}))}})}var wD=[...Lr.map(e=>`${e}.defaultSettings`),"default"];function Hg(e){let t=[];for(let r of wD){let i=`policyHelpers.${r}`,s=e.payloadSlots[i];s!==void 0&&SD(s)&&t.push([i,s])}return t}function SD(e){return Object.keys(e.shellSettings).length>0||Object.keys(e.envVars).length>0||Object.keys(e.sandboxSettings).length>0}var CD=new Set(["credentials","network.tlsTerminate"]);function OD(e){return Array.isArray(e)?ld(e.filter(t=>typeof t=="string")).sort():void 0}function fo(e,t){let r=e;for(let i of t.split(".")){if(r===null||typeof r!="object")return;r=r[i]}return r}function mEe(e,t){return t==null||t===!1||Array.isArray(t)&&t.length===0?!1:!(e==="credentials"&&gEe(t))}function gEe(e){return typeof e!="object"||e===null?!1:Object.entries(e).every(([t,r])=>r===void 0?!0:t==="files"||t==="envVars"?Array.isArray(r)&&r.every(i=>typeof i=="object"&&i!==null&&i.mode==="deny"):t==="sigv4"?typeof r=="object"&&r!==null&&Object.values(r).every(i=>i===void 0||i==="deny"):t==="allowPlaintextInject"&&r===!1)}function _Ee(e){return Object.keys(e.shellSettings).some(vEe)}function vEe(e){return Lr.some(t=>e===`policyHelpers.${t}`)}function yEe(e){return _Ee(e)||Object.keys(e.shellSettings).some(t=>t.startsWith("extraKnownMarketplaces["))||Hg(e).length>0}function bEe(e){return e==="sh"||e==="pwsh"}function EEe(e){if(e===null||typeof e!="object")return;let{path:t,script:r,interpreter:i,timeoutMs:s,refreshIntervalMs:n}=e,a,o;if(typeof t=="string"&&t)a=t;else if(typeof r=="string"&&r&&bEe(i))a={interpreter:i,script:SEe(r)},o=wEe(r);else return;return{command:ze([a,s??null,n??null]),scriptSize:o}}function wEe(e){return{bytes:Buffer.byteLength(e,"utf8"),lines:cW(e,`
|
|
169
|
+
`)+(e.endsWith(`
|
|
170
|
+
`)?0:1)}}function SEe(e){return lv(ze(e))}function CEe(e){if(typeof e=="string")return e||void 0;if(e===null||typeof e!="object"||!("command"in e)||typeof e.command!="string"||!e.command)return;let t="args"in e&&Array.isArray(e.args)?e.args.map(String):[];return ze([e.command,...t])}function OEe(e){return Ns(AD(e))}function AD(e){return{shellSettings:e.shellSettings,envVars:e.envVars,sandboxSettings:Object.keys(e.sandboxSettings).length>0?e.sandboxSettings:void 0,hooks:e.hooks,payloadSlots:Hg(e).length>0?Object.fromEntries(Hg(e)):void 0}}function Ns(e){return ze(Bg(e))}function AEe(e){return lv(OEe(e))}function xEe(e,t,r){return AEe(t)===e?!0:typeof r=="string"&&r.length>0&&lv(Ns({...AD(t),claudeMd:r}))===e}function lS(e,t,r){return ze([e,typeof t=="string"?t:null,typeof r=="string"?r:null])}function kEe(e){let t=e.extraKnownMarketplaces;if(t!=null)return t;let r=e;for(let{alias:i,canonical:s}of bD){if(s!=="extraKnownMarketplaces")continue;let n=r[i];if(n!=null&&typeof n=="object")return n}}var xD="remote-settings-helper-consent";function TEe(){return L_e(es(),xD)}function REe(e){let t=dEe(e);return yEe(t)?t:void 0}var zg=class{sessionCache=null;eligible=void 0;eligibilityMemo=void 0;ineligibleReason=void 0;evalPolicySnapshotOnly=!1;lastLoadStatus=void 0;lastLoadStatusChanged=dr();policySettingsNotified=!1;verifiedPayload=null;unverifiedView=null;projectedView=null;consentedPayload=null;deferredPayload=null;resetEpoch=0;backendView=void 0;replaceSessionCache(t,r){this.sessionCache=t,r?.verified&&(this.verifiedPayload=t,r.consentDeferred&&(this.deferredPayload=t))}seedFromDisk(t){this.sessionCache=t;let r=REe(t);if(r!==void 0){let i=PEe();if(i===void 0||!xEe(i,r,t.claudeMd))return}this.consentedPayload??=t}markConsented(t){this.consentedPayload=t}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(t,r){this.eligible=t,r.memoize&&(this.eligibilityMemo=t,this.ineligibleReason=t?void 0:r.ineligibleReason)}resetListener=null;registerResetListener(t){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=t}reset(){this.sessionCache=null,this.eligible=void 0,this.eligibilityMemo=void 0,this.ineligibleReason=void 0,this.evalPolicySnapshotOnly=!1,this.lastLoadStatus=void 0,this.policySettingsNotified=!1,this.verifiedPayload=null,this.unverifiedView=null,this.projectedView=null,this.consentedPayload=null,this.deferredPayload=null,this.resetEpoch++,this.emitLoadStatusChanged(void 0)}emitLoadStatusChanged(t){try{this.lastLoadStatusChanged.emit(t)}catch(r){We(`Remote settings: load-status listener threw: ${Cs(r)}`,{level:"error"})}}},DEe=new Nt(()=>new zg);function IEe(){return DEe.of(ev().host)}var LEe=4096;function PEe(){let e=NEe();if(e!==void 0)return e.attestation;try{return HT(TEe(),LEe).trim()||void 0}catch{return}}function NEe(){let e=IEe().backendView;if(!(!ni()||e===void 0||!e.ready||e.stoodDown||void 0!==void 0)){if(!XW(e.configHome)){e.standDown("config home changed");return}return e}}var kRe=wu.state("remote-settings"),TRe=wu.state(xD),RRe=new Set(["HTTPS_PROXY","HTTP_PROXY","NO_PROXY","CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","ALL_PROXY","NODE_OPTIONS","NODE_TLS_REJECT_UNAUTHORIZED",...hR,...fR,"AWS_ENDPOINT_URL_STS","AWS_ENDPOINT_URL","AWS_ENDPOINT_URL_SSO","AWS_ENDPOINT_URL_SSO_OIDC","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL_BEDROCK_RUNTIME",...vR,...yR,...bR,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...mR,"CLAUDE_CODE_API_BASE_URL","CLAUDE_CODE_OAUTH_REFRESH_TOKEN","CLAUDE_CODE_OAUTH_SCOPES","CLAUDE_CODE_OAUTH_CLIENT_ID","CLAUDE_CODE_SESSION_ACCESS_TOKEN","CLAUDE_SESSION_INGRESS_TOKEN_FILE","CLAUDE_CODE_ENVIRONMENT_KIND","CLAUDE_CODE_REMOTE_SESSION_ID","ANTHROPIC_FEDERATION_RULE_ID","ANTHROPIC_ORGANIZATION_ID","ANTHROPIC_WORKSPACE_ID","ANTHROPIC_SERVICE_ACCOUNT_ID","ANTHROPIC_IDENTITY_TOKEN","ANTHROPIC_IDENTITY_TOKEN_FILE","ANTHROPIC_SCOPE","ANTHROPIC_PROFILE","ANTHROPIC_CONFIG_DIR","CLAUDE_CODE_FEDERATION_CACHE_DIR","HOME","XDG_CONFIG_HOME","APPDATA","USERPROFILE","ANTHROPIC_CUSTOM_HEADERS","CLAUDE_CODE_HOST_CREDS_FILE","CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST","CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CONFIG_DIR","CLAUDE_SECURESTORAGE_CONFIG_DIR","CLAUDE_CODE_REMOTE_SETTINGS_PATH","CLAUDE_CODE_MANAGED_SETTINGS_PATH","CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION","CLAUDE_CODE_MOCK_REMOTE_SETTINGS","USE_LOCAL_OAUTH","USE_STAGING_OAUTH","CLAUDE_LOCAL_OAUTH_API_BASE","CLAUDE_LOCAL_OAUTH_APPS_BASE","CLAUDE_LOCAL_OAUTH_CONSOLE_BASE","CLAUDE_BRIDGE_BASE_URL","CLAUDE_BRIDGE_OAUTH_TOKEN","CLAUDE_BRIDGE_SESSION_INGRESS_URL","CLAUDE_REMOTE_TOOLS_BRIDGE_URL"].map(e=>e.toUpperCase()));var MEe={cli:!0,mcp:!0,"sdk-cli":!0,"sdk-ts":!0,"sdk-py":!0,bench:!0,"claude-vscode":!0,"claude-code-github-action":!0,"local-agent":!0,local_agent:!0,"claude-desktop":!0,remote:!0,remote_baku:!0,remote_cowork:!0,remote_trigger:!0,remote_cowork_trigger:!0,remote_desktop:!0,remote_mobile:!0,claude_in_slack:!0,"claude-in-slack":!0,"claude-in-teams":!0,"claude-desktop-3p":!0,"claude-security":!0,"ssh-remote":!0,"claude-coworker":!0,"claude-coworker-terminal":!0},DRe=new Set(Object.keys(MEe)),UEe=new Set(["claude-desktop-3p","local-agent"]);function $Ee(){let e=ml.CLAUDE_CODE_ENTRYPOINT;return e!==void 0&&UEe.has(e)}var Wg=class{entrypoint=void 0;childSession=!1;claudecode=!1;coworkFrameArtifacts=!1;setEntrypoint(t){this.entrypoint=t}setChildSession(t){this.childSession=t}setClaudecode(t){this.claudecode=t}setCoworkFrameArtifacts(t){this.coworkFrameArtifacts=t}},IRe=new Nt(()=>new Wg);var cS="com.anthropic.claudecode",kD="HKLM\\SOFTWARE\\Policies\\ClaudeCode",TD="HKCU\\SOFTWARE\\Policies\\ClaudeCode",Kg="Settings",uS="/usr/bin/plutil",FEe=["-convert","json","-o","-","--"],BEe=["-lint","-s","--"],HEe=5e3,Gg=2097152,zEe="/mnt/c/Windows/System32/reg.exe",qg="/mnt/c/Program Files/ClaudeCode";function Bv(){if(process.platform!=="linux")return!1;if(process.env.WSL_DISTRO_NAME)return!0;try{let e=Me("fs").readFileSync("/proc/version","utf8").toLowerCase();return e.includes("microsoft")||e.includes("wsl")}catch{return!1}}function WEe(){let e="";try{e=jEe().username}catch{}let t=[];return e&&t.push({path:`/Library/Managed Preferences/${e}/${cS}.plist`,label:"per-user managed preferences"}),t.push({path:`/Library/Managed Preferences/${cS}.plist`,label:"device-level managed preferences"}),t}var wi="https://code.claude.com/docs/en",KEe=[{matches:e=>e.path==="permissions.defaultMode"&&e.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${wi}/iam#permission-modes`}},{matches:e=>e.path==="apiKeyHelper"&&e.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:e=>e.path==="cleanupPeriodDays"&&e.code==="too_small",tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:e=>e.path.startsWith("env.")&&e.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${wi}/settings#environment-variables`}},{matches:e=>(e.path==="permissions.allow"||e.path==="permissions.deny")&&e.code==="invalid_type"&&e.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:e=>e.path.startsWith("hooks.")&&e.code==="invalid_key",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${wi}/hooks`}},{matches:e=>/\.hooks\.\d+\.command$/.test(e.path)&&e.code==="invalid_type"&&e.received==="undefined",tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${wi}/hooks#exec-form-and-shell-form`}},{matches:e=>e.path.includes("hooks")&&e.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:e=>e.code==="invalid_type"&&e.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:e=>e.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${wi}/settings`}},{matches:e=>e.code==="invalid_value"&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:e=>e.code==="invalid_type"&&e.expected==="object"&&e.received===null&&e.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:e=>e.path==="permissions.additionalDirectories"&&e.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${wi}/iam#working-directories`}}],GEe={permissions:`${wi}/iam#configuring-permissions`,env:`${wi}/settings#environment-variables`,hooks:`${wi}/hooks`};function qEe(e){let t=KEe.find(i=>i.matches(e));if(!t)return null;let r={...t.tip};return e.code==="invalid_value"&&e.enumValues&&!r.suggestion&&(r.suggestion=`Valid values: ${e.enumValues.map(i=>`"${i}"`).join(", ")}`),!r.docLink&&e.path&&(r.docLink=GEe[lW(e.path,".")]),r}var PRe=re(()=>vD(Uv(),{strictPolicyHelperKeys:!0}).strict());function dS(e){return e.code==="invalid_type"}function pS(e){return e.code==="invalid_value"}function VEe(e){return e.code==="unrecognized_keys"}function hS(e){return e.code==="too_small"}function Qt(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}function fS(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function ZEe(e,t){return e.issues.map(r=>{let i=r.path.map(String).join("."),s=r.message,n,a,o,l,c;if(pS(r))a=r.values.map(p=>String(p)),o=a.join(" | "),l=void 0,c=void 0;else if(dS(r)){o=r.expected;let p=fS(r.message);l=p??Qt(r.input),c=p??Qt(r.input)}else hS(r)?o=String(r.minimum):r.code==="custom"&&"params"in r&&(l=r.params.received,c=l);let u=qEe({path:i,code:r.code,expected:o,received:l,enumValues:a,message:r.message,value:l});if(pS(r))n=a?.map(p=>`"${p}"`).join(", "),s=`Invalid value. Expected one of: ${n}`;else if(dS(r)){let p=fS(r.message)??Qt(r.input);r.expected==="object"&&p==="null"&&i===""?s="Invalid or malformed JSON":s=`Expected ${r.expected}, but received ${p}`}else if(VEe(r)){let p=r.keys.join(", ");s=`Unrecognized ${iW(r.keys.length,"field")}: ${p}`}else hS(r)&&(s=`Number must be greater than or equal to ${r.minimum}`,n=String(r.minimum));return{file:t,path:i,message:s,expected:n,invalidValue:c,suggestion:u?.suggestion,docLink:u?.docLink}})}function XEe(e,t){if(!e||typeof e!="object")return[];let r=e;if(!r.permissions||typeof r.permissions!="object")return[];let i=r.permissions,s=[];for(let n of["allow","deny","ask"]){let a=i[n];Array.isArray(a)&&(i[n]=a.filter(o=>{if(typeof o!="string")return s.push({file:t,path:`permissions.${n}`,message:`Non-string value in ${n} array was removed`,severity:"warning",invalidValue:o}),!1;let l=aD(o,n);if(!l.valid){let c=`Invalid permission rule "${o}" was skipped: ${l.error}`;return l.suggestion&&(c+=`. ${l.suggestion}`),s.push({file:t,path:`permissions.${n}`,message:c,severity:"warning",invalidValue:o}),!1}return!0}))}return s}var YEe=new Set(ha);function JEe(e,t){return!e||typeof e!="object"?[]:[...jve(e,Bve)?[{file:t,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) \u2014 ${un}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...QEe(e,t)]}function QEe(e,t){if(!("hooks"in e))return[];if(e.hooks===null||typeof e.hooks!="object"||Array.isArray(e.hooks)){let s=Qt(e.hooks);return Array.isArray(e.hooks)&&(e.hooks.some(Kt)||jR(e.hooks))?[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s} \u2014 ${un}.`,invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}]:(delete e.hooks,[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s}. This field was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}])}let r=e.hooks;if(Dv(r))return[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher \u2014 ${un}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let i=[];for(let s of Object.keys(r)){let n=hx(s);if(!YEe.has(s)){if(ta(r[s],3,{matchersCount:!Array.isArray(r[s])})){i.push({file:t,path:`hooks.${n}`,message:`"${n}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks \u2014 ${un}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete r[s],i.push({file:t,path:`hooks.${n}`,message:`Unknown hook event "${n}" was ignored. Valid events: ${ha.join(", ")}`,severity:"warning",invalidValue:n,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(r[s])){let a=r[s],o=Qt(a);if(wd.has(s)&&a!==null||ta(a,3,{matchersCount:!1})){i.push({file:t,path:`hooks.${n}`,message:`Hook event "${n}" must be an array of matchers; received ${o} \u2014 ${un}.`,invalidValue:o,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete r[s],i.push({file:t,path:`hooks.${n}`,message:`Hook event "${n}" must be an array of matchers; received ${o}. This entry was ignored.`,severity:"warning",invalidValue:o,docLink:"https://code.claude.com/docs/en/hooks",...a!==null&&{preserveOnWrite:!0}})}}for(let[s,n]of Object.entries(r)){let{stripped:a,unloadableGuards:o}=zve(n,s);for(let l of o)i.push({file:t,path:l.aboutType?`hooks.${s}.${l.path}.type`:`hooks.${s}.${l.path}`,message:`${l.problem} \u2014 ${un}.${l.aboutType?` Valid types: ${[...Pg()].join(", ")}`:""}`,severity:"fatal",invalidValue:l.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let l of a)i.push({file:t,path:l.aboutType?`hooks.${s}.${l.path}.type`:`hooks.${s}.${l.path}`,message:l.aboutType?`${l.problem}; entry ignored. Valid types: ${[...Pg()].join(", ")}`:`${l.problem}; ${l.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:l.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}return i.length>0&&Object.keys(r).length===0&&delete e.hooks,i}var e0e=[{key:"allowedMcpServers",schema:$v},{key:"deniedMcpServers",schema:jv}];function t0e(e,t,r){if(!e||typeof e!="object")return[];let i=e,s=[];for(let{key:n,schema:a}of e0e){if(!(n in i))continue;if(!Array.isArray(i[n])){if(r?.keepWholeFieldInvalid)continue;let c=i[n];delete i[n],s.push({file:t,path:n,message:`"${n}" must be an array; received ${Qt(c)}. This field was ignored.`,severity:"warning",invalidValue:c});continue}let o=i[n],l=[];for(let c=0;c<o.length;c++){let u=a().safeParse(o[c]);u.success?l.push(o[c]):s.push({file:t,path:`${n}[${c}]`,message:`Invalid entry was ignored: ${u.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:o[c]})}l.length<o.length&&(i[n]=l)}return s}function r0e(e,t){if(!Kt(e)||e.managedMcpServers===void 0)return[];let r=[],i=PR(e.managedMcpServers,(s,n)=>r.push({file:t,path:s?`managedMcpServers.${s}`:"managedMcpServers",message:s?`Managed MCP server was ignored: ${n}`:n,severity:"warning"}));return i===void 0?delete e.managedMcpServers:e.managedMcpServers=i,r}function i0e(e){if(!e||typeof e!="object")return;let t=e.source;if(!t||typeof t!="object")return;let r=t.source;return typeof r=="string"?r:void 0}function s0e(e){if(!e||typeof e!="object")return!1;let t=e.source;if(!t||typeof t!="object")return!1;let r=t.plugins;return Array.isArray(r)&&r.some(QR)}function n0e(e,t){if(!e||typeof e!="object")return[];let r=e,i="extraKnownMarketplaces";if(!(i in r))return[];let s=r[i];if(!s||typeof s!="object"||Array.isArray(s)){let o=Qt(s);return delete r[i],[{file:t,path:i,message:`"${i}" must be an object mapping marketplace names to declarations; received ${o}. This field was ignored.`,severity:"warning",invalidValue:o}]}let n=s,a=[];for(let o of Object.keys(n)){let l=cD().safeParse(n[o]),c;if(l.success)l.data.source.source==="settings"&&l.data.source.name!==o&&(c=`key "${Oi(o)}" must match the settings source name "${Oi(l.data.source.name)}"`);else{let u=i0e(n[o]);if(u!==void 0&&!Mye.has(u)||s0e(n[o]))continue;c=Nv(l.error.issues)}c!==void 0&&(a.push({file:t,path:`${i}.${Oi(o)}`,message:`Invalid marketplace entry was ignored: ${c}`,severity:"warning"}),delete n[o])}return a}function a0e(e,t){if(!e||typeof e!="object")return[];let r=e,i="modelPicker";if(!(i in r))return[];let s=r[i];if(!Kt(s)||!Array.isArray(s.options)){let l=Kt(s)?`options: ${Qt(s.options)}`:Qt(s);return delete r[i],[{file:t,path:i,message:`"${i}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${l}. This field was ignored.`,severity:"warning",invalidValue:l}]}let n=[];if("replaceBuiltInOptions"in s&&typeof s.replaceBuiltInOptions!="boolean"){let l=Qt(s.replaceBuiltInOptions);delete s.replaceBuiltInOptions,n.push({file:t,path:`${i}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${l}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:l})}let a=s.options,o=[];for(let l=0;l<a.length;l++){let c=pD().safeParse(a[l]);if(c.success){o.push(a[l]);continue}n.push({file:t,path:`${i}.options.${l}`,message:`${l0e(c.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:Qt(a[l])})}return o.length!==a.length&&(s.options=o),n}function o0e(e,t){if(!e||typeof e!="object"||Array.isArray(e))return[];let r=e;if(!("modelPricing"in r)||r.modelPricing===void 0)return[];let i=r.modelPricing;if(!i||typeof i!="object"||Array.isArray(i))return delete r.modelPricing,[{file:t,path:"modelPricing",message:`"modelPricing" must be an object; received ${Qt(i)}. It was ignored.`,severity:"warning"}];let s=i,n=[];if(s.multiplier!==void 0&&!dD().safeParse(s.multiplier).success&&(n.push({file:t,path:"modelPricing.multiplier",message:'"multiplier" must be a number in (0, 1]. It was ignored.',severity:"warning",invalidValue:s.multiplier}),delete s.multiplier),s.overrides!==void 0){let a=s.overrides;if(!a||typeof a!="object"||Array.isArray(a))n.push({file:t,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${Qt(a)}. It was ignored.`,severity:"warning"}),delete s.overrides;else{let o=a;for(let l of Object.keys(o)){let c=uD().safeParse(o[l]);if(c.success&&l!=="constructor"&&l!=="__proto__")continue;let u=c.success?void 0:c.error.issues[0];n.push({file:t,path:`modelPricing.overrides.${Oi(l)}`,message:`Invalid pricing row was ignored (${u?`${u.path.join(".")||"row"}: ${u.message}`:"not a model ID"}).`,severity:"warning",invalidValue:o[l]}),delete o[l]}}}return n}function l0e(e){return e?`modelPicker row ${e.path.length>0?`"${e.path.join(".")}" `:""}${e.message}`.trim():"Invalid modelPicker row"}function c0e(e,t,r){if(!e||typeof e!="object"||Array.isArray(e))return[];let i=e,s=i.crossSessionInbound;return s===void 0||u0e(s)?[]:(r?.policySource?i.crossSessionInbound="refuse":delete i.crossSessionInbound,[h0e(s,t,r?.policySource===!0)])}function u0e(e){return typeof e=="string"&&Od.includes(e)}var d0e="crossSessionInbound";function p0e(e){let t=Od.map(i=>`"${i}"`).join(", "),r=typeof e=="string"?`"${Oi(e).replace(/^<key>$/,"<value>")}"`:Qt(e);return`must be one of ${t}; received ${r}`}function h0e(e,t,r=!1){let i=Od.map(n=>`"${n}"`).join(", "),s=r?'In managed settings an unrecognized value is treated as "refuse" (the most restrictive): cross-session messages to this session are turned away until an administrator fixes it.':"This value was ignored; while it is present, cross-session messages are held for your approval instead of being delivered. Set it to one of the values above.";return{file:t,path:d0e,message:`"crossSessionInbound" ${p0e(e)}. ${s}`,severity:"warning",expected:i,...r&&{statusOnly:!0}}}var mS="remoteControl.shareHostProfile";function f0e(e,t,r){if(!Kt(e)||e.remoteControl===void 0)return[];let i=r?.policySource===!0,s=$g.map(h=>`"${h}"`).join(", "),n=i?'In managed settings this is treated as "off" (the most restrictive): Remote Control environments report nothing about this machine until an administrator fixes it.':"While it is present, Remote Control environments report nothing about this machine.",a=h=>({file:t,path:mS,message:`${h}. ${n}`,severity:"warning",expected:s,...i?{statusOnly:!0}:{preserveOnWrite:!0}}),o=h=>typeof h=="string"?`"${Oi(h).replace(/^<key>$/,"<value>")}"`:Qt(h),l=e.remoteControl;if(!Kt(l))return i?e.remoteControl={shareHostProfile:"off"}:delete e.remoteControl,[a(`"remoteControl" must be an object like { "shareHostProfile": ${s.replace(/, /g," | ")} }; received ${o(l)}`)];let c=[],u=Object.keys(l).filter(h=>h!=="shareHostProfile");u.length>0&&(i&&(l.shareHostProfile="off"),c.push(a(`"remoteControl" has an unrecognized key ${u.map(h=>`"${Oi(h)}"`).join(", ")} (its only key is "shareHostProfile")`)));let p=l.shareHostProfile;return p!==void 0&&!(typeof p=="string"&&$g.includes(p))&&(i?l.shareHostProfile="off":delete l.shareHostProfile,c.push(a(`"${mS}" must be one of ${s}; received ${o(p)}`))),c}function RD(e,t,r){return[...lEe(e,t),...XEe(e,t),...JEe(e,t),...n0e(e,t),...a0e(e,t),...o0e(e,t),...c0e(e,t,{policySource:r?.policySource}),...f0e(e,t,{policySource:r?.policySource}),...r?.skipMcpServerEntryFilter?[]:t0e(e,t,{keepWholeFieldInvalid:r?.mcpServerEntrySalvageOnly}),...r?.mcpServerEntrySalvageOnly?r0e(e,t):[]]}function m0e(e,t){let r=gS.get(e),i=r?.get(t);if(i)return{settings:i.settings&&yu(i.settings),errors:i.errors.map(n=>({...n}))};let s=g0e(e,t);return r?r.set(t,s):gS.set(e,new Map([[t,s]])),{settings:s.settings&&yu(s.settings),errors:s.errors.map(n=>({...n}))}}var gS=new WeakMap;function g0e(e,t){let r=yu(e),i=RD(r,t,{skipMcpServerEntryFilter:!0,policySource:!0}),s=[],n=oEe(_0e(t,s),t).safeParse(r);return n.success?{settings:Object.keys(n.data).length>0?n.data:null,errors:[...i,...s]}:{settings:null,errors:[...i,...ZEe(n.error,t)]}}function DD(e){return $Ee()&&(e==="managedMcpServers"||e.startsWith("managedMcpServers."))}function _0e(e,t){return r=>{DD(r.path)||(t.push({file:e,path:r.path,message:r.message,severity:"warning",...r.statusOnly&&{statusOnly:r.statusOnly},...r.startupFatal&&{startupFatal:r.startupFatal}}),(r.statusOnly||r.startupFatal)&&We(`${e}: ${r.path}: ${r.message}`,{level:r.startupFatal?"error":"warn"}))}}var _S=2097152;function ID(e,{userWritable:t=!1}={}){return t?{file:e,path:"",message:`Managed settings document (${e}) could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.`,severity:"warning",statusOnly:!0}:{file:e,path:"",message:"Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.",startupFatal:!0}}function vS(e,t,r="file"){return{file:e,path:"",message:`${r==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${t instanceof Error?t.message:String(t)}`,severity:"fatal",errorClass:"unreadable"}}var NRe=new Set([...[...gR].filter(e=>e!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),..._R,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CONTEXT_COLLAPSE_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);var LD=["managedSourcesBehavior","wslInheritsWindowsSettings"],v0e=["policyHelper","policyHelpers"];function Vg(e){return Object.keys(e).some(t=>!LD.includes(t))}var y0e=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"],MRe=[...y0e,"otelHeadersHelper","proxyAuthHelper","forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","parentSettingsBehavior","env","modelPicker",...v0e,...LD];var Zg=class{promise=null;start(){this.promise||(this.promise=PD())}reset(){this.promise=null}},A0e=new Zg;function x0e(e){if(!e)return{status:"ok",exitCode:0,errno:null,signal:null};let t=e,r=typeof t.signal=="string"&&t.signal?t.signal:null;return typeof t.code=="string"?{status:"spawn_error",exitCode:null,errno:t.code,signal:null}:t.killed===!0?{status:"timeout",exitCode:null,errno:null,signal:r}:r?{status:"killed",exitCode:null,errno:null,signal:r}:{status:"exited",exitCode:typeof t.code=="number"?t.code:null,errno:null,signal:null}}function Xg(e,t,r){let i=Date.now();return new Promise(s=>{try{b0e(e,t,{encoding:"utf-8",timeout:HEe,windowsHide:!0,...r!==void 0&&{maxBuffer:r}},(n,a)=>{s({stdout:a??"",...x0e(n),durationMs:Date.now()-i})})}catch(n){let a=n.code;s({stdout:"",status:"spawn_error",exitCode:null,errno:typeof a=="string"?a:null,signal:null,durationMs:Date.now()-i})}})}function yS(e){return{status:e.status,exitCode:e.exitCode,errno:e.errno,signal:e.signal,durationMs:e.durationMs}}function bS(e){return e.status==="ok"||e.status==="exited"&&e.exitCode!==null}function k0e(e){return e.status==="spawn_error"&&e.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function T0e(e){let t;try{return t=C0e(e,"r"),O0e(t,Buffer.alloc(1),0,1,0),null}catch(r){return{code:r&&typeof r=="object"&&"code"in r?r.code:void 0,message:r instanceof Error?r.message:String(r)}}finally{if(t!==void 0)try{w0e(t)}catch{}}}function PD(){return(async()=>{if(process.platform==="darwin"){let e=WEe(),t=(await Promise.all(e.map(async({path:i,...s})=>{try{E0e(i,S0e.R_OK)}catch(l){let c=l&&typeof l=="object"&&"code"in l?l.code:void 0;return c==="ENOENT"||c==="ENOTDIR"?null:{stdout:null,unreadReason:l instanceof Error?l.message:String(l),...s}}let n=await Xg(uS,[...FEe,i],Gg);if(!bS(n))return{stdout:null,unreadReason:"plutil did not finish converting it",...s};if(n.status==="ok")return{stdout:n.stdout,...s};let a=await Xg(uS,[...BEe,i]);if(!bS(a))return{stdout:null,unreadReason:"plutil did not finish checking it",...s};if(a.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",...s};let o=T0e(i);return o!==null?o.code==="ENOENT"||o.code==="ENOTDIR"?null:{stdout:null,unreadReason:o.message,...s}:{stdout:"",...s}}))).filter(i=>i!==null),r=t.findIndex(i=>i.stdout!==null);return{plistStdouts:r===-1?t:t.slice(0,r+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let e=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`;return ES(e)}return Bv()?ES(zEe):{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function ES(e){let t=s=>Xg(e,["query",s,"/v",Kg],Gg),[r,i]=await Promise.all([t(kD),t(TD)]);return{plistStdouts:null,hklmStdout:r.status==="ok"?r.stdout:null,...k0e(r)&&{hklmUnreadReason:`the value exceeds ${Gg/1048576} MiB`},hkcuStdout:i.status==="ok"?i.stdout:null,outcomes:{hklm:yS(r),hkcu:yS(i)}}}function R0e(){return A0e.promise}var tn=Object.freeze({settings:{},errors:[]}),Yg=class{mdm=null;hkcu=null;wslInherits=!1;loadPromise=null;startLoad(t){this.loadPromise||(this.loadPromise=(async()=>{let r=Date.now(),i=await(R0e()??PD()),{mdm:s,hkcu:n,wslInherits:a}=await j0e(i,t);this.replace(s,n,a);let o=Date.now()-r;We(`MDM settings load completed in ${o}ms`);try{cd("tengu_managed_settings_os_read",$0e(i,o))}catch{}if(Object.keys(s.settings).length>0){We(`MDM settings found: ${Object.keys(s.settings).join(", ")}`);try{Lfe("info","mdm_settings_loaded",{duration_ms:o,key_count:Object.keys(s.settings).length,error_count:s.errors.length})}catch{}}})())}replace(t,r,i){this.mdm=t,this.hkcu=r,this.wslInherits=i}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.loadPromise=null}},wS="@builtin",D0e=["prependPlugins","appendPlugins"];function I0e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var jRe=new Nt(()=>new Yg);function Xp(e,t,{userWritable:r=!1}={}){let i=Ov(e,!1);if(!Kt(i))return{settings:{},errors:[ID(t,{userWritable:r})]};let s=[],n=i;if(r&&"managedMcpServers"in i&&(n={...i},delete n.managedMcpServers,!DD("managedMcpServers")&&s.push({file:t,path:"managedMcpServers",message:`"managedMcpServers" is only honored from administrator-controlled managed settings and was ignored in ${t}, which the user account can write.`,severity:"warning",statusOnly:!0})),r){for(let u of D0e)u in n&&(n=n===i?{...i}:n,delete n[u],s.push({file:t,path:u,message:`"${u}" is only honored from administrator-controlled managed settings and was ignored in ${t}, which the user account can write.`,severity:"warning",statusOnly:!0}));let c=n.enabledPlugins;if(I0e(c)&&Object.entries(c).filter(([u,p])=>u.endsWith(wS)||p!==!1).length>0){n=n===i?{...i}:n;let u=MT(c,(p,h)=>!h.endsWith(wS)&&p===!1);Object.keys(u).length>0?n.enabledPlugins=u:delete n.enabledPlugins,s.push({file:t,path:"enabledPlugins",message:`"enabledPlugins" entries that enable a plugin, or name a built-in, are only honored from administrator-controlled managed settings and were ignored in ${t}, which the user account can write.`,severity:"warning",statusOnly:!0})}}let{settings:a,errors:o}=m0e(n,t),l=[...s,...o];return{settings:a??{},errors:r?l.map(c=>c.severity==="warning"&&!c.startupFatal?c:{...L0e(c),severity:"warning",statusOnly:!0}):l}}function L0e({startupFatal:e,...t}){return t}function SS(e,t,r){return{file:e,path:"",message:`Managed settings document (${e}) could not be read: ${t}; none of its settings are in effect.`,severity:r?"warning":"fatal",statusOnly:!0,errorClass:"unreadable"}}function CS(e,t="Settings"){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`^[ \\t]+${r}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),s=e.match(i)?.[1]?.trimEnd();return s||null}var P0e=new Map([["ENOENT",Yt("ENOENT")],["EACCES",Yt("EACCES")],["EPERM",Yt("EPERM")],["ENOEXEC",Yt("ENOEXEC")],["EAGAIN",Yt("EAGAIN")],["EMFILE",Yt("EMFILE")],["ENOMEM",Yt("ENOMEM")],["ETIMEDOUT",Yt("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",Yt("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),N0e=new Map([["SIGTERM",Yt("SIGTERM")],["SIGKILL",Yt("SIGKILL")],["SIGINT",Yt("SIGINT")]]);function M0e(e){if(e)return P0e.get(e)??Yt("other")}function U0e(e){if(e)return N0e.get(e)??Yt("other")}function OS(e,t){return t?{[`${e}_status`]:nd(t.status),[`${e}_exit_code`]:t.exitCode??void 0,[`${e}_errno`]:M0e(t.errno),[`${e}_signal`]:U0e(t.signal),[`${e}_duration_ms`]:t.durationMs}:{}}function $0e(e,t){return{is_wsl:Bv(),await_ms:t,...OS("hklm",e.outcomes.hklm),...OS("hkcu",e.outcomes.hkcu)}}async function j0e(e,t){let r=[];for(let l of e.plistStdouts??[]){let{label:c,userWritable:u}=l;if(l.stdout===null){r.push(SS(c,l.unreadReason,u));continue}let p=Xp(l.stdout,c,{userWritable:u});if(Vg(p.settings))return{mdm:{settings:p.settings,errors:[...r,...p.errors],...u&&{userWritable:u}},hkcu:tn,wslInherits:!1};r.push(...p.errors)}let i=`Registry: ${kD}\\${Kg}`,s=null;e.hklmStdout!==null?s=Xp(CS(e.hklmStdout)??"",i):e.hklmUnreadReason!==void 0&&r.push(SS(i,e.hklmUnreadReason,!1)),s&&r.push(...s.errors);let n=Bv(),a=!1;if(n&&(a=s?.settings.wslInheritsWindowsSettings===!0,!a)){let l=await B0e(t);a=l.flag,!a&&r.push(...l.records)}let o=r.length>0?{settings:{},errors:r}:tn;if(n&&!a)return{mdm:o,hkcu:tn,wslInherits:!1};if(s&&Vg(s.settings))return{mdm:s,hkcu:tn,wslInherits:a};if(await F0e(a,t))return{mdm:o,hkcu:tn,wslInherits:a};if(e.hkcuStdout!==null){let l=Xp(CS(e.hkcuStdout)??"",`Registry: ${TD}\\${Kg}`,{userWritable:!0});if(!n||l.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:c,managedSourcesBehavior:u,...p}=l.settings;return{mdm:o,hkcu:{settings:p,errors:l.errors},wslInherits:a}}if(l.errors.length>0)return{mdm:o,hkcu:{settings:{},errors:l.errors},wslInherits:a}}return{mdm:o,hkcu:tn,wslInherits:a}}async function ND(e,t){return ni()&&t!==void 0?(await jfe(e,_S)).content:HT(e,_S)}async function MD(e,t){return ni()&&t!==void 0?await Jt().readdir(e):Jt().readdirSync(e)}async function F0e(e,t){return e&&await kS(qg,t)?!0:kS(VT(),t)}async function AS(e,t){let r=yu(Ov(await ND(e,t),!1));return!r||typeof r!="object"?!1:(RD(r,e,{skipMcpServerEntryFilter:!0,policySource:!0}),Vg(r))}function xS(e){let t=Ye(e);return t==="ENOENT"||t==="ENOTDIR"}async function B0e(e){let t=[];async function r(n){let a;try{a=await ND(n,e)}catch(l){return xS(l)||t.push(vS(n,l)),!1}if(a.trim()==="")return!1;let o=Ov(a,!1);return Kt(o)?o.wslInheritsWindowsSettings===!0:(t.push(ID(n)),!1)}if(await r(xn(qg,"managed-settings.json")))return{flag:!0,records:t};let i=xn(qg,"managed-settings.d"),s;try{s=await MD(i,e)}catch(n){return xS(n)||t.push(vS(i,n,"directory")),{flag:!1,records:t}}for(let n of s)if((n.isFile()||n.isSymbolicLink())&&n.name.endsWith(".json")&&!n.name.startsWith(".")&&await r(xn(i,n.name)))return{flag:!0,records:t};return{flag:!1,records:t}}async function kS(e,t){try{if(await AS(xn(e,"managed-settings.json"),t))return!0}catch{}try{let r=xn(e,"managed-settings.d"),i=await MD(r,t);for(let s of i)if(!(!(s.isFile()||s.isSymbolicLink())||!s.name.endsWith(".json")||s.name.startsWith(".")))try{if(await AS(xn(r,s.name),t))return!0}catch{}}catch{}return!1}process.env.NoDefaultCurrentDirectoryInExePath="1";var H0e=["enabledPlugins","extraKnownMarketplaces","additionalMarketplaces"];function TS(e){let t;try{t=Yn(pk(e.toString("utf8")))}catch{return e}if(!RS(t))return e;let r=!1;for(let s of H0e)Object.hasOwn(t,s)&&(delete t[s],r=!0);let i=t.env;return RS(i)&&Object.hasOwn(i,"CLAUDE_CONFIG_DIR")&&(delete i.CLAUDE_CONFIG_DIR,r=!0),r?ze(t):e}function RS(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}async function z0e(e,t){if(!e)return;let r=e;try{let i=Yn(e);i?.claudeAiOauth?.refreshToken&&(delete i.claudeAiOauth.refreshToken,r=ze(i))}catch{}await ax(t,r,{mode:384})}function W0e(){if(process.platform!=="darwin")return Promise.resolve(void 0);let e=fpe(hpe);return new Promise(t=>{$z("security",["find-generic-password","-a",gpe(),"-w","-s",e],{encoding:"utf-8",timeout:5e3,windowsHide:!0},(r,i)=>t(r?void 0:i.trim()||void 0))})}async function K0e(e,t,r,i,s=6e4,n){if(!Jae(t))return;let a=BD(r,i),o=await Nn(e.load({projectKey:a,sessionId:t}),s,`SessionStore.load() timed out after ${s}ms for session ${t}`);if(!o||o.length===0)return;let l=Xt(Wz(),`claude-resume-${jz()}`);try{let c=Xt(l,"projects",a);await gm(c,{recursive:!0,mode:448});let u=Xt(c,`${t}.jsonl`);await hk(u,o);let p=i?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=p??Xt(_m(),".claude"),f;try{f=await Bz(Xt(h,".credentials.json"),"utf-8")}catch(y){if(!ad(y))throw y}!p&&!(i??process.env).ANTHROPIC_API_KEY&&!(i??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(f=await W0e()??f),await z0e(f,Xt(l,".credentials.json"));let _=cpe(ml.CLAUDE_CONFIG_DIR),v=Xt(p??_m(),".claude.json");await Bp(v,Xt(l,".claude.json"),void 0,hw(n,v,_.globalConfig,wu.globalConfig()));let E=Xt(h,"settings.json");return await Bp(E,Xt(l,"settings.json"),TS,hw(n,E,_.userSettings,wu.userSettings())),await Bp(Xt(h,"cowork_settings.json"),Xt(l,"cowork_settings.json"),TS),e.listSubkeys&&await G0e(e,{projectKey:a,sessionId:t},Xt(c,t),s),l}catch(c){throw await jD(l),c}}async function G0e(e,t,r,i){let s=await Nn(e.listSubkeys({projectKey:t.projectKey,sessionId:t.sessionId}),i,`SessionStore.listSubkeys() timed out after ${i}ms for session ${t.sessionId}`);for(let n of s){let a=lu(r,n+".jsonl");if(!n||ox(n)||n.split(/[\\/]/).includes("..")||!a.startsWith(r+lx)){We(`[SessionStore] skipping unsafe subpath from listSubkeys: ${n}`,{level:"warn"});continue}let o=await Nn(e.load({projectKey:t.projectKey,sessionId:t.sessionId,subpath:n}),i,`SessionStore.load() timed out after ${i}ms for session ${t.sessionId} subpath ${n}`);if(!o||o.length===0)continue;let l=[],c=[];for(let u of o)Y0e(u)?l.push(u):c.push(u);if(c.length>0&&(await gm(KE(a),{recursive:!0}),await hk(a,c)),l.length>0){let u=l.at(-1),p=lu(r,n+".meta.json");await gm(KE(p),{recursive:!0});let{type:h,...f}=u;await ax(p,ze(f),{mode:384})}}}function UD(e,t){let{isSingleUserTurn:r,resumeConfigDir:i,deferSpawn:s}=t,{systemPrompt:n,settings:a,managedSettings:o,settingSources:l,sandbox:c,...u}=e??{},p,h,f,_;n===void 0?p="":typeof n=="string"||Array.isArray(n)?p=n:n.type==="custom"?(p=n.prompt,_=n.snapshot):n.type==="preset"&&(h=n.append,f=n.excludeDynamicSections,_=n.snapshot),process.env.CLAUDE_AGENT_SDK_VERSION="0.3.268";let{abortController:v=vm(),additionalDirectories:E=[],agent:y,agents:m,allowedTools:g=[],betas:b,canUseTool:C,continue:A,cwd:w,debug:S,debugFile:x,disallowedTools:T=[],tools:I,env:L,executable:P=tv()?"bun":"node",executableArgs:$=[],extraArgs:se={},fallbackModel:ee,enableFileCheckpointing:pe,toolConfig:ne,forkSession:oe,hooks:W,includeHookEvents:k,includePartialMessages:U,forwardSubagentText:N,onElicitation:R,onUserDialog:M,supportedDialogKinds:K,perTaskStopAffordance:J,workspaceTrust:ae,persistSession:xe,sessionStore:be,sessionStoreFlush:_e,thinking:F,effort:z,maxThinkingTokens:Q,maxTurns:ce,maxBudgetUsd:Se,taskBudget:Te,mcpServers:Qe,model:q,outputFormat:te,permissionMode:he,allowDangerouslySkipPermissions:ve=!1,permissionPromptToolName:fe,permissionPrompts:De,plugins:Ct,pluginDelivery:$t="argv",getOAuthToken:xr,getHostAuthToken:Li,workload:Pi,resume:ls,resumeSessionAt:cs,resumeDropsTurn:us,sessionId:Ot,skills:Xe,stderr:jt,strictMcpConfig:Ni}=u,Mi=he??(e?.resolvePermissionModeInCli?void 0:"default");if(be&&xe===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(K!==void 0&&K.length>0&&!M)throw Error("supportedDialogKinds requires an onUserDialog callback -- declaring dialog kinds without a handler would park dialogs nothing can answer. Provide onUserDialog, or omit supportedDialogKinds.");let wa=ae?.accepted===!0&&(typeof ae.directory!="string"||!(Kz.isAbsolute(ae.directory)||qz.isAbsolute(ae.directory)))?void 0:ae;if(ae!==void 0&&wa===void 0&&We("workspaceTrust ignored: accepted requires an absolute directory, as it exists where Claude Code runs",{level:"warn"}),be&&A&&!ls&&!be.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(be&&pe)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");if(be&&u.spawnClaudeCodeProcess&&We("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"}),vpe(!!C,Mi??"default",g),$t!=="argv"&&$t!=="initialize")throw Error("Invalid pluginDelivery. Expected 'argv' or 'initialize'.");let _i=$t==="initialize"&&Ct!==void 0&&Ct.length>0,vi=u.pathToClaudeCodeExecutable;if(!vi){let Gt=Vz(import.meta.url),sr=zz(Gt),ti=Pae(Hs=>sr.resolve(Hs));if(!ti)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);vi=ti}let Sa=te?.type==="json_schema"?te.schema:void 0,vt=L?{...L}:{...process.env};vt.CLAUDE_CODE_ENTRYPOINT||(vt.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),vt.CLAUDE_AGENT_SDK_VERSION||(vt.CLAUDE_AGENT_SDK_VERSION="0.3.268"),pe&&(vt.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),xr&&(vt.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Li&&(vt.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),ne?.askUserQuestion?.previewFormat&&(vt.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=ne.askUserQuestion.previewFormat);for(let[Gt,sr]of[[ne?.askUserQuestion?.extendedQuestions,"CLAUDE_CODE_QUESTION_EXTENDED"],[ne?.askUserQuestion?.optionalDescriptions,"CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS"]])if(Gt)vt[sr]="1";else if(!L)for(let ti of Object.keys(vt))ti.toUpperCase()===sr&&delete vt[ti];let Bs={};if($0.propagation.inject($0.context.active(),Bs),"traceparent"in Bs)for(let Gt of["TRACEPARENT","TRACESTATE"])Gt in(L??{})||delete vt[Gt];for(let[Gt,sr]of Object.entries(Bs)){let ti=Gt.toUpperCase();ti in(L??{})||(vt[ti]=sr)}let Ol={},Yv=new Map;if(Qe)for(let[Gt,sr]of Object.entries(Qe))sr.type==="sdk"&&sr.instance?Yv.set(Gt,sr):Ol[Gt]=sr;let Ca;if(F)switch(F.type){case"adaptive":Ca={type:"adaptive",display:F.display};break;case"enabled":Ca={type:"enabled",budgetTokens:F.budgetTokens,display:F.display};break;case"disabled":Ca={type:"disabled"};break}else Q!==void 0&&(Ca=Q===0?{type:"disabled"}:{type:"enabled",budgetTokens:Q});i&&(vt.CLAUDE_CONFIG_DIR=i,process.platform==="win32"&&(vt.CLAUDE_SECURESTORAGE_CONFIG_DIR=L?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??L?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""));let Jv=new ng({abortController:v,additionalDirectories:E,agent:y,betas:b,cwd:w,debug:S,debugFile:x,executable:P,executableArgs:$,extraArgs:Pi?{...se,workload:Pi}:se,pathToClaudeCodeExecutable:vi,env:vt,forkSession:oe,stderr:jt,thinkingConfig:Ca,effort:z,maxTurns:ce,maxBudgetUsd:Se,taskBudget:Te,model:q,fallbackModel:ee,jsonSchema:Sa,permissionMode:Mi,allowDangerouslySkipPermissions:ve,permissionPromptToolName:fe,permissionPrompts:De,continueConversation:be?void 0:A,resume:ls,resumeSessionAt:cs,resumeDropsTurn:us,sessionId:Ot,settings:typeof a=="object"?ze(a):a,managedSettings:o?ze(o):void 0,settingSources:l,skills:Xe,allowedTools:g,disallowedTools:T,tools:I,mcpServers:Ol,strictMcpConfig:Ni,canUseTool:!!C,hooks:!!W,includeHookEvents:k,includePartialMessages:U,persistSession:xe,sessionMirror:!!be,plugins:Ct,pluginsViaInitialize:_i,sandbox:c,spawnClaudeCodeProcess:u.spawnClaudeCodeProcess,deferSpawn:s}),QD={systemPrompt:p,appendSystemPrompt:h,planModeInstructions:u.planModeInstructions,systemPromptSnapshot:_,appendSubagentSystemPrompt:u.appendSubagentSystemPrompt,toolAliases:u.toolAliases,excludeDynamicSections:f,agents:m,title:u.title,skills:Xe,webSearchIsolationExemptMcpServers:u.webSearchIsolationExemptMcpServers,promptSuggestions:u.promptSuggestions,agentProgressSummaries:u.agentProgressSummaries,forwardSubagentText:N,supportedDialogKinds:K,perTaskStopAffordance:J,workspaceTrust:wa,plugins:_i?Ct:void 0},Dd=new cg(Jv,r,C,W,v,Yv,Sa,QD,R,xr,Li,M);if(be){let Gt=()=>Xt(vt.CLAUDE_CONFIG_DIR??Xt(_m(),".claude"),"projects"),sr=_e==="eager",ti=new ug(async(Hs,Id)=>{let Oa=DS(Hs,Gt());Oa?await be.append(Oa,Id):We(`[SessionStore] dropping mirror frame: filePath ${Hs} is not under ${Gt()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},{onError:(Hs,Id)=>{let Oa=DS(Hs,Gt());Oa&&Dd.reportMirrorError(Oa,Id.message)},maxPendingEntries:sr?0:ck,maxPendingBytes:sr?0:uk});Dd.setTranscriptMirrorBatcher(ti)}return{queryInstance:Dd,transport:Jv,abortController:v,processEnv:vt}}function $D(e,t,r,i){typeof r=="string"?t.write(ze({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+`
|
|
171
|
+
`):e.streamInput(r).catch(s=>i.abort(s))}var q0e=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);async function jD(e){for(let t=0;;t++)try{return await Hz(e,{recursive:!0,force:!0})}catch(r){if(t>=4||!q0e.has(Ye(r)??""))return;await ed((t+1)*100)}}function V0e(e,t){e.waitForExit().catch(()=>{}).finally(()=>jD(t))}function FD({prompt:e,options:t}){if((t?.resume||t?.continue)&&t?.sessionStore)return Z0e(e,t);let{queryInstance:r,transport:i,abortController:s}=UD(t,{isSingleUserTurn:typeof e=="string"});return $D(r,i,e,s),r}function Z0e(e,t){let{queryInstance:r,transport:i,abortController:s,processEnv:n}=UD({...t},{isSingleUserTurn:typeof e=="string",deferSpawn:!0}),a=lu(t.cwd??"."),o=t.sessionStore,l=t.loadTimeoutMs??6e4,c=t.resume;return(async()=>{if(c||(c=(await Nn(o.listSessions(BD(a,t.env)),l,`SessionStore.listSessions() timed out after ${l}ms`)).slice().sort((u,p)=>p.mtime-u.mtime)[0]?.sessionId),!!c)return K0e(o,c,a,t.env,t.loadTimeoutMs)})().then(u=>{if(u){i.updateResume(c);let p={CLAUDE_CONFIG_DIR:u};if(process.platform==="win32"){let h=t.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??t.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";p.CLAUDE_SECURESTORAGE_CONFIG_DIR=h,n.CLAUDE_SECURESTORAGE_CONFIG_DIR=h}i.updateEnv(p),n.CLAUDE_CONFIG_DIR=u,r.addCleanupCallback(()=>V0e(i,u))}r.isClosed()||i.spawn()}).catch(u=>{let p=fl(u);i.spawnAbort(p),r.setError(p)}),$D(r,i,e,s),r}function X0e(e){let t=lu(e??"."),r;try{r=Fz(t)}catch{r=t}return si(r)}function BD(e,t){let r=X0e(e);return t===void 0?ioe(r):(t.CLAUDE_CONFIG_DIR?Ex(t.CLAUDE_CODE_PROJECT_DIR_NAME):void 0)??fk(r)}function Y0e(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="agent_metadata"}function DS(e,t){let r=Gz(t,e),i=r.split(lx);if(i[0]===".."||ox(r)||i.length<2)return null;let s=i[0],n=i[1];if(i.length===2&&n.endsWith(".jsonl"))return{projectKey:s,sessionId:n.replace(/\.jsonl$/,"")};if(i.length>=4){let a=i.slice(2),o=a.length-1;return a[o]=a.at(-1).replace(/\.jsonl$/,""),{projectKey:s,sessionId:n,subpath:a.join("/")}}return null}import*as os from"fs/promises";import*as Wr from"path";import{exec as Lwe}from"child_process";import{promisify as Pwe}from"util";import*as qv from"os";import{readFileSync as gwe,existsSync as _we}from"fs";import{join as WD}from"path";import{homedir as KD,hostname as vwe}from"os";var Hv={HEALTH_CHECK:3e3,API_REQUEST:3e4,HOOK_READINESS_WAIT:1e4,POST_SPAWN_WAIT:15e3,READINESS_WAIT:3e4,PORT_IN_USE_WAIT:3e3,POWERSHELL_COMMAND:1e4,WINDOWS_MULTIPLIER:1.5};function HD(e){return process.platform==="win32"?Math.round(e*Hv.WINDOWS_MULTIPLIER):e}import{closeSync as Wv,existsSync as ewe,fsyncSync as zD,lstatSync as twe,mkdirSync as rwe,openSync as Kv,readFileSync as GRe,readlinkSync as iwe,realpathSync as swe,renameSync as nwe,statSync as awe,unlinkSync as owe,writeSync as lwe}from"fs";import{randomBytes as cwe}from"crypto";import{basename as uwe,dirname as Gv,join as dwe,resolve as pwe}from"path";var J0e=null;function Q0e(e){return(J0e??process.stderr.write.bind(process.stderr))(e)}function zv(e){Q0e(e)}var hwe=process.platform==="win32";function fwe(e){return e.replace(/^\uFEFF/,"")}function Ad(e){return JSON.parse(fwe(e))}function mwe(e){ewe(e)||rwe(e,{recursive:!0})}function xd(e,t){let r=e;try{if(twe(e).isSymbolicLink())try{r=swe(e)}catch(c){let u=c instanceof Error?c:new Error(String(c));zv(`claude-mem: realpathSync failed for ${e}, resolving symlink manually: ${u.message}
|
|
172
|
+
`);let p=iwe(e);r=pwe(Gv(e),p)}}catch(c){let u=c.code;if(u!=="ENOENT"&&u!=="ENOTDIR")throw c}mwe(Gv(r));let i=Gv(r),s=uwe(r),n=dwe(i,`.${s}.${process.pid}.${cwe(6).toString("hex")}.tmp`),a=Buffer.from(JSON.stringify(t,null,2)+`
|
|
173
|
+
`,"utf-8"),o;try{o=awe(r).mode&511}catch{}let l;try{l=o!==void 0?Kv(n,"w",o):Kv(n,"w");let c=0;for(;c<a.length;){let u=lwe(l,a,c,a.length-c);if(u===0)throw new Error(`writeSync stalled at ${c}/${a.length} bytes`);c+=u}if(zD(l),Wv(l),l=void 0,nwe(n,r),!hwe){let u;try{u=Kv(i,"r"),zD(u)}catch(p){let h=p instanceof Error?p:new Error(String(p));zv(`claude-mem: directory fsync failed for ${i}: ${h.message}
|
|
174
|
+
`)}finally{if(u!==void 0)try{Wv(u)}catch{}}}}catch(c){if(l!==void 0)try{Wv(l)}catch{}try{owe(n)}catch{}throw c}}var ywe="security_alert",kd=class{static DEFAULTS={CLAUDE_MEM_MODEL:"claude-haiku-4-5-20251001",CLAUDE_MEM_CONTEXT_OBSERVATIONS:"50",CLAUDE_MEM_WORKER_PORT:String(37700+(process.getuid?.()??77)%100),CLAUDE_MEM_WORKER_HOST:"127.0.0.1",CLAUDE_MEM_API_TIMEOUT_MS:String(HD(Hv.API_REQUEST)),CLAUDE_MEM_SKIP_TOOLS:"ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion",CLAUDE_MEM_PROVIDER:"claude",CLAUDE_MEM_CLAUDE_AUTH_METHOD:"subscription",CLAUDE_MEM_GEMINI_API_KEY:"",CLAUDE_MEM_GEMINI_MODEL:"gemini-flash-latest",CLAUDE_MEM_GEMINI_RATE_LIMITING_ENABLED:"true",CLAUDE_MEM_OPENROUTER_API_KEY:"",CLAUDE_MEM_OPENROUTER_MODEL:"xiaomi/mimo-v2-flash:free",CLAUDE_MEM_OPENROUTER_BASE_URL:"",CLAUDE_MEM_OPENROUTER_SITE_URL:"",CLAUDE_MEM_OPENROUTER_APP_NAME:"claude-mem",CLAUDE_MEM_DATA_DIR:WD(KD(),".claude-mem"),CLAUDE_MEM_LOG_LEVEL:"INFO",CLAUDE_MEM_PYTHON_VERSION:"3.13",CLAUDE_CODE_PATH:"",CLAUDE_MEM_CLAUDE_CONFIG_DIR:"",CLAUDE_MEM_MODE:"code",CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS:"false",CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS:"false",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT:"false",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT:"true",CLAUDE_MEM_CONTEXT_FULL_COUNT:"0",CLAUDE_MEM_CONTEXT_FULL_FIELD:"narrative",CLAUDE_MEM_CONTEXT_SESSION_COUNT:"10",CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY:"true",CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE:"false",CLAUDE_MEM_CONTEXT_SHOW_TERMINAL_OUTPUT:"true",CLAUDE_MEM_WELCOME_HINT_ENABLED:"true",CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED:"false",CLAUDE_MEM_FOLDER_USE_LOCAL_MD:"false",CLAUDE_MEM_TRANSCRIPTS_ENABLED:"true",CLAUDE_MEM_TRANSCRIPTS_CONFIG_PATH:WD(KD(),".claude-mem","transcript-watch.json"),CLAUDE_MEM_CODEX_TRANSCRIPT_INGESTION:"false",CLAUDE_MEM_MAX_CONCURRENT_AGENTS:"2",CLAUDE_MEM_OBSERVER_MAX_CONVERSATION_CHARS:"400000",CLAUDE_MEM_HOOK_FAIL_LOUD_THRESHOLD:"3",CLAUDE_MEM_EXCLUDED_PROJECTS:"",CLAUDE_MEM_FOLDER_MD_EXCLUDE:"[]",CLAUDE_MEM_FOLDER_MD_SKELETON_DENYLIST:"[]",CLAUDE_MEM_SEMANTIC_INJECT:"false",CLAUDE_MEM_SEMANTIC_INJECT_LIMIT:"5",CLAUDE_MEM_TIER_ROUTING_ENABLED:"true",CLAUDE_MEM_TIER_SIMPLE_MODEL:"haiku",CLAUDE_MEM_TIER_SUMMARY_MODEL:"",CLAUDE_MEM_TIER_FAST_MODEL:"haiku",CLAUDE_MEM_TIER_SMART_MODEL:"sonnet",CLAUDE_MEM_CHROMA_ENABLED:"true",CLAUDE_MEM_CHROMA_MODE:"local",CLAUDE_MEM_CHROMA_HOST:"127.0.0.1",CLAUDE_MEM_CHROMA_PORT:"8000",CLAUDE_MEM_CHROMA_SSL:"false",CLAUDE_MEM_CHROMA_API_KEY:"",CLAUDE_MEM_CHROMA_TENANT:"default_tenant",CLAUDE_MEM_CHROMA_DATABASE:"default_database",CLAUDE_MEM_CHROMA_PREWARM_TIMEOUT_MS:"120000",CLAUDE_MEM_CHROMA_MAX_PENDING_MUTATIONS:"5000",CLAUDE_MEM_CLOUD_SYNC_TOKEN:"",CLAUDE_MEM_CLOUD_SYNC_USER_ID:"",CLAUDE_MEM_CLOUD_SYNC_HUB_URL:"",CLAUDE_MEM_CLOUD_SYNC_DEVICE_ID:"",CLAUDE_MEM_CLOUD_SYNC_DEVICE_NAME:vwe(),CLAUDE_MEM_CLOUD_SYNC_WS:"true",CLAUDE_MEM_CLOUD_SYNC_CONTENT_BATCH_SIZE:"40",CLAUDE_MEM_CLOUD_SYNC_REQUEST_TIMEOUT_MS:"90000",CLAUDE_MEM_TV_TOKEN:"",CLAUDE_MEM_PRO_TRIAL_EMAIL:"",CLAUDE_MEM_PRO_TRIAL_AT:"",CLAUDE_MEM_PRO_TRIAL_STATE:"",CLAUDE_MEM_PRO_TRIAL_ENDS_AT:"",CLAUDE_MEM_PRO_PLAN:"",CLAUDE_MEM_PRO_FALLBACK_AT:"",CLAUDE_MEM_PRO_MEMORY_KEY:"",CLAUDE_MEM_PRO_MEMORY_BASE_URL:"",CLAUDE_MEM_PRO_MEMORY_MODEL:"",CLAUDE_MEM_TELEGRAM_ENABLED:"true",CLAUDE_MEM_TELEGRAM_BOT_TOKEN:"",CLAUDE_MEM_TELEGRAM_CHAT_ID:"",CLAUDE_MEM_TELEGRAM_TRIGGER_TYPES:"security_alert,sensitive",CLAUDE_MEM_TELEGRAM_TRIGGER_CONCEPTS:"",CLAUDE_MEM_GROK_BOT_AWARENESS_ENABLED:"true",CLAUDE_MEM_GROK_BOT_AWARENESS_AGENT_IDS:"521e962d-2ec3-4488-bfbc-54d5209ce118,95601360-61f7-4fd9-bb3a-2c976b2b85c0",CLAUDE_MEM_GROK_BOT_AWARENESS_TRIGGER_TYPES:"decision,bugfix,security_alert,sensitive",CLAUDE_MEM_GROK_BOT_AWARENESS_TRIGGER_CONCEPTS:"",CLAUDE_MEM_CCS_ALIGN_ENABLED:"true",CLAUDE_MEM_CCS_ALIGN_VIEWER_IDS:"ccs-align",CLAUDE_MEM_CCS_ALIGN_TRIGGER_TYPES:"decision,bugfix,security_alert,sensitive",CLAUDE_MEM_CCS_ALIGN_PATCH_SHADOWS:"false",CLAUDE_MEM_QUEUE_ENGINE:"sqlite",CLAUDE_MEM_REDIS_URL:"",CLAUDE_MEM_REDIS_HOST:"127.0.0.1",CLAUDE_MEM_REDIS_PORT:"6379",CLAUDE_MEM_REDIS_MODE:"external",CLAUDE_MEM_QUEUE_REDIS_PREFIX:`claude_mem_${process.env.CLAUDE_MEM_WORKER_PORT??String(37700+(process.getuid?.()??77)%100)}`,CLAUDE_MEM_AUTH_MODE:"api-key",CLAUDE_MEM_RUNTIME:"worker",CLAUDE_MEM_SERVER_URL:`http://127.0.0.1:${process.env.CLAUDE_MEM_SERVER_PORT??String(37877+(process.getuid?.()??77)%100)}`,CLAUDE_MEM_SERVER_API_KEY:"",CLAUDE_MEM_SERVER_PROJECT_ID:"",CLAUDE_MEM_SERVER_BETA_URL:`http://127.0.0.1:${process.env.CLAUDE_MEM_SERVER_PORT??String(37877+(process.getuid?.()??77)%100)}`,CLAUDE_MEM_SERVER_BETA_API_KEY:"",CLAUDE_MEM_SERVER_BETA_PROJECT_ID:""};static getAllDefaults(){return{...this.DEFAULTS}}static get(t){return process.env[t]??this.DEFAULTS[t]}static getInt(t){let r=this.get(t);return parseInt(r,10)}static applyEnvOverrides(t){let r={...t};for(let i of Object.keys(this.DEFAULTS))process.env[i]!==void 0&&(r[i]=process.env[i]);return r}static loadFromFile(t,r=!0){try{if(!_we(t)){let c=this.getAllDefaults();try{xd(t,c),console.warn("[SETTINGS] Created settings file with defaults:",t)}catch(u){console.warn("[SETTINGS] Failed to create settings file, using in-memory defaults:",t,u instanceof Error?u.message:String(u))}return r?this.applyEnvOverrides(c):c}let i=gwe(t,"utf-8"),s=Ad(i),n=s,a=s.env&&typeof s.env=="object"&&!Array.isArray(s.env),o=a&&Object.keys(s).some(c=>c!=="env");if(a&&(n=s.env,!o))try{xd(t,n),console.warn("[SETTINGS] Migrated settings file from nested to flat schema:",t)}catch(c){console.warn("[SETTINGS] Failed to auto-migrate settings file:",t,c instanceof Error?c.message:String(c))}if(n.CLAUDE_MEM_TELEGRAM_TRIGGER_TYPES===ywe){n={...n,CLAUDE_MEM_TELEGRAM_TRIGGER_TYPES:this.DEFAULTS.CLAUDE_MEM_TELEGRAM_TRIGGER_TYPES};try{xd(t,o?{...s,env:n}:n),console.warn("[SETTINGS] Migrated Telegram trigger types off the legacy default:",t)}catch(c){console.warn("[SETTINGS] Failed to migrate Telegram trigger types:",t,c instanceof Error?c.message:String(c))}}let l={...this.DEFAULTS};for(let c of Object.keys(this.DEFAULTS))n[c]!==void 0&&(l[c]=n[c]);return r?this.applyEnvOverrides(l):l}catch(i){console.warn("[SETTINGS] Failed to load settings, using defaults:",t,i instanceof Error?i.message:String(i));let s=this.getAllDefaults();return r?this.applyEnvOverrides(s):s}}};import{join as as,dirname as wwe,basename as Swe}from"path";import{homedir as GD}from"os";import{existsSync as Cwe,mkdirSync as uDe,readFileSync as Owe}from"fs";import{fileURLToPath as Awe}from"url";import{homedir as bwe}from"os";import{join as Ewe}from"path";function Td(e,t=process.platform,r=bwe()){return typeof e!="string"||e.length===0?e:e==="~"?r:e.startsWith("~/")||t==="win32"&&e.startsWith("~\\")?Ewe(r,e.slice(2)):e}function xwe(){return typeof __dirname<"u"?__dirname:wwe(Awe(import.meta.url))}var fDe=xwe();function kwe(){if(process.env.CLAUDE_MEM_DATA_DIR)return Td(process.env.CLAUDE_MEM_DATA_DIR);let e=as(GD(),".claude-mem"),t=as(e,"settings.json");try{if(Cwe(t)){let r=Ad(Owe(t,"utf-8")),i=r.env??r;if(i.CLAUDE_MEM_DATA_DIR)return Td(i.CLAUDE_MEM_DATA_DIR)}}catch{}return e}var Rd=kwe(),Twe=as(GD(),".claude"),Rwe=process.env.CLAUDE_CONFIG_DIR||Twe,mDe=as(Rwe,"plugins","marketplaces","thedotmack"),gDe=as(Rd,"logs"),qD=as(Rd,"settings.json"),Dwe="claude-mem.db";var _De=as(Rd,Dwe),Iwe=as(Rd,"observer-sessions"),vDe=Swe(Iwe);var Ea=Pwe(Lwe);function Fs(e){let t=qv.homedir();return e.replace(t,"~")}async function Nwe(){try{let e=Wr.join(process.cwd(),"package.json"),t=await os.readFile(e,"utf-8");return JSON.parse(t).version||"unknown"}catch{return"unknown"}}async function Mwe(){try{let{stdout:e}=await Ea("claude --version");return e.trim()}catch{return"not installed or not in PATH"}}async function Uwe(){try{let{stdout:e}=await Ea("bun --version");return e.trim()}catch{return"not installed"}}async function $we(){try{if(process.platform==="darwin"){let{stdout:e}=await Ea("sw_vers -productVersion");return`macOS ${e.trim()}`}else if(process.platform==="linux"){let{stdout:e}=await Ea("uname -sr");return e.trim()}else if(process.platform==="win32"){let{stdout:e}=await Ea("ver");return e.trim()}return"unknown"}catch{return"unknown"}}async function jwe(e,t){try{return await(await fetch(`http://${e}:${t}/api/health`,{signal:AbortSignal.timeout(2e3)})).json()}catch{return null}}async function Fwe(e,t){try{return await(await fetch(`http://${e}:${t}/api/stats`,{signal:AbortSignal.timeout(2e3)})).json()}catch{return null}}async function Bwe(e){try{let t=Wr.join(e,"worker.pid"),r=await os.readFile(t,"utf-8");return JSON.parse(r)}catch{return null}}async function VD(e,t){try{return(await os.readFile(e,"utf-8")).split(`
|
|
175
|
+
`).filter(s=>s.trim()).slice(-t)}catch{return[]}}async function Hwe(e){try{let t=Wr.join(e,"settings.json"),r=await os.readFile(t,"utf-8");return{exists:!0,settings:JSON.parse(r)}}catch{return{exists:!1}}}async function zwe(e){try{let t=Wr.join(e,"claude-mem.db");return{exists:!0,size:(await os.stat(t)).size}}catch{return{exists:!1}}}async function Wwe(e){try{let t=Wr.join(e,"claude-mem.db");await os.stat(t);let r="SELECT (SELECT COUNT(*) FROM observations) AS observations, (SELECT COUNT(*) FROM sessions) AS sessions, (SELECT COUNT(*) FROM session_summaries) AS summaries;",{stdout:i}=await Ea(`sqlite3 "${t}" "${r}"`),s=i.trim().split("|");return s.length===3?{observations:parseInt(s[0],10)||0,sessions:parseInt(s[1],10)||0,summaries:parseInt(s[2],10)||0}:void 0}catch{return}}async function Cl(e={}){let t=qv.homedir(),r=Wr.join(t,".claude-mem"),i=Wr.join(t,".claude","plugins","marketplaces","thedotmack"),s=process.cwd(),n=s.includes("claude-mem")&&!s.includes(".claude"),[a,o,l,c]=await Promise.all([Nwe(),Mwe(),Uwe(),$we()]),u={claudeMem:a,claudeCode:o,node:process.version,bun:l},p={os:process.platform,osVersion:c,arch:process.arch},h={pluginPath:Fs(i),dataDir:Fs(r),cwd:Fs(s),isDevMode:n},f=await Bwe(r),_=kd.loadFromFile(qD),v=process.env.CLAUDE_MEM_WORKER_HOST||_.CLAUDE_MEM_WORKER_HOST,E=process.env.CLAUDE_MEM_WORKER_PORT||_.CLAUDE_MEM_WORKER_PORT,y=typeof f?.port=="number"?f.port:parseInt(E,10),[m,g]=await Promise.all([jwe(v,y),Fwe(v,y)]),b={running:m!==null,pid:f?.pid,port:y,uptime:g?.worker?.uptime,version:g?.worker?.version,health:m,stats:g},C=[],A=[];if(e.includeLogs!==!1){let P=new Date().toISOString().split("T")[0],$=Wr.join(r,"logs",`worker-${P}.log`),se=Wr.join(r,"silent.log");[C,A]=await Promise.all([VD($,50),VD(se,50)])}let w={workerLog:C.map(Fs),silentLog:A.map(Fs)},[S,x]=await Promise.all([zwe(r),Wwe(r)]),T={path:Fs(Wr.join(r,"claude-mem.db")),exists:S.exists,size:S.size,counts:x},I=await Hwe(r),L={settingsPath:Fs(Wr.join(r,"settings.json")),settingsExist:I.exists,settings:I.settings};return{versions:u,platform:p,paths:h,worker:b,logs:w,database:T,config:L}}function Vv(e){let t="";if(t+=`## Environment
|
|
176
|
+
|
|
177
|
+
`,t+=`- **Claude-mem**: ${e.versions.claudeMem}
|
|
178
|
+
`,t+=`- **Claude Code**: ${e.versions.claudeCode}
|
|
179
|
+
`,t+=`- **Node.js**: ${e.versions.node}
|
|
180
|
+
`,t+=`- **Bun**: ${e.versions.bun}
|
|
181
|
+
`,t+=`- **OS**: ${e.platform.osVersion} (${e.platform.arch})
|
|
182
|
+
`,t+=`- **Platform**: ${e.platform.os}
|
|
183
|
+
|
|
184
|
+
`,t+=`## Paths
|
|
185
|
+
|
|
186
|
+
`,t+=`- **Plugin**: ${e.paths.pluginPath}
|
|
187
|
+
`,t+=`- **Data Directory**: ${e.paths.dataDir}
|
|
188
|
+
`,t+=`- **Current Directory**: ${e.paths.cwd}
|
|
189
|
+
`,t+=`- **Dev Mode**: ${e.paths.isDevMode?"Yes":"No"}
|
|
190
|
+
|
|
191
|
+
`,t+=`## Worker Status
|
|
192
|
+
|
|
193
|
+
`,t+=`- **Running**: ${e.worker.running?"Yes":"No"}
|
|
194
|
+
`,e.worker.running){if(t+=`- **PID**: ${e.worker.pid||"unknown"}
|
|
195
|
+
`,t+=`- **Port**: ${e.worker.port}
|
|
196
|
+
`,e.worker.uptime!==void 0){let r=Math.floor(e.worker.uptime/60);t+=`- **Uptime**: ${r} minutes
|
|
197
|
+
`}e.worker.stats&&(t+=`- **Active Sessions**: ${e.worker.stats.worker?.activeSessions||0}
|
|
198
|
+
`,t+=`- **SSE Clients**: ${e.worker.stats.worker?.sseClients||0}
|
|
199
|
+
`)}if(t+=`
|
|
200
|
+
`,t+=`## Database
|
|
201
|
+
|
|
202
|
+
`,t+=`- **Path**: ${e.database.path}
|
|
203
|
+
`,t+=`- **Exists**: ${e.database.exists?"Yes":"No"}
|
|
204
|
+
`,e.database.size){let r=(e.database.size/1024).toFixed(2);t+=`- **Size**: ${r} KB
|
|
205
|
+
`}if(e.database.counts&&(t+=`- **Observations**: ${e.database.counts.observations}
|
|
206
|
+
`,t+=`- **Sessions**: ${e.database.counts.sessions}
|
|
207
|
+
`,t+=`- **Summaries**: ${e.database.counts.summaries}
|
|
208
|
+
`),t+=`
|
|
209
|
+
`,t+=`## Configuration
|
|
210
|
+
|
|
211
|
+
`,t+=`- **Settings File**: ${e.config.settingsPath}
|
|
212
|
+
`,t+=`- **Settings Exist**: ${e.config.settingsExist?"Yes":"No"}
|
|
213
|
+
`,e.config.settings){t+=`- **Key Settings**:
|
|
214
|
+
`;let r=["CLAUDE_MEM_MODEL","CLAUDE_MEM_WORKER_PORT","CLAUDE_MEM_WORKER_HOST","CLAUDE_MEM_LOG_LEVEL","CLAUDE_MEM_CONTEXT_OBSERVATIONS"];for(let i of r)e.config.settings[i]&&(t+=` - ${i}: ${e.config.settings[i]}
|
|
215
|
+
`)}return t+=`
|
|
216
|
+
`,e.logs.workerLog.length>0&&(t+=`## Recent Worker Logs (Last 50 Lines)
|
|
217
|
+
|
|
218
|
+
`,t+="```\n",t+=e.logs.workerLog.join(`
|
|
219
|
+
`),t+="\n```\n\n"),e.logs.silentLog.length>0&&(t+=`## Silent Debug Log (Last 50 Lines)
|
|
220
|
+
|
|
221
|
+
`,t+="```\n",t+=e.logs.silentLog.join(`
|
|
222
|
+
`),t+="\n```\n\n"),t}async function ZD(e){try{let t=await Cl({includeLogs:e.includeLogs!==!1}),r=Vv(t),i=Kwe(r,e.issueDescription,e.expectedBehavior,e.stepsToReproduce),s="",n=0,a=Date.now(),o=FD({prompt:i,options:{model:"sonnet",systemPrompt:"You are a GitHub issue formatter. Format bug reports clearly and professionally.",permissionMode:"bypassPermissions",allowDangerouslySkipPermissions:!0,includePartialMessages:!0}}),l=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],c=0;for await(let h of o){if(h.type==="stream_event"){let f=h.event;if(f.type==="content_block_delta"&&f.delta?.type==="text_delta"&&f.delta.text){s+=f.delta.text,n+=f.delta.text.length;let _=((Date.now()-a)/1e3).toFixed(1),v=l[c++%l.length];process.stdout.write(`\r ${v} Generating... ${n} chars (${_}s)`)}}if(h.type==="assistant")for(let f of h.message.content)f.type==="text"&&!s&&(s=f.text,n=s.length);if(h.type==="result"){let f=h;f.subtype==="success"&&!s&&f.result&&(s=f.result,n=s.length)}}process.stdout.write("\r"+" ".repeat(60)+"\r");let u=s.match(/^#\s+(.+)$/m);return{title:u?u[1]:"Bug Report",body:s,success:!0}}catch(t){return console.error("Agent SDK failed, using template fallback:",t),Gwe(e)}}function Kwe(e,t,r,i){let s=`You are a GitHub issue formatter. Given system diagnostics and a user's bug description, create a well-structured GitHub issue for the claude-mem repository.
|
|
223
|
+
|
|
224
|
+
SYSTEM DIAGNOSTICS:
|
|
225
|
+
${e}
|
|
226
|
+
|
|
227
|
+
USER DESCRIPTION:
|
|
228
|
+
${t}
|
|
229
|
+
`;return r&&(s+=`
|
|
230
|
+
EXPECTED BEHAVIOR:
|
|
231
|
+
${r}
|
|
232
|
+
`),i&&(s+=`
|
|
233
|
+
STEPS TO REPRODUCE:
|
|
234
|
+
${i}
|
|
235
|
+
`),s+=`
|
|
236
|
+
|
|
237
|
+
IMPORTANT: If any part of the user's description is in a language other than English, translate it to English while preserving technical accuracy and meaning.
|
|
238
|
+
|
|
239
|
+
Create a GitHub issue with:
|
|
240
|
+
1. Clear, descriptive title (max 80 chars) in English - start with a single # heading
|
|
241
|
+
2. Problem statement summarizing the issue in English
|
|
242
|
+
3. Environment section (versions, platform) from the diagnostics
|
|
243
|
+
4. Steps to reproduce (if provided) in English
|
|
244
|
+
5. Expected vs actual behavior in English
|
|
245
|
+
6. Relevant logs (formatted as code blocks) if present in diagnostics
|
|
246
|
+
7. Any additional context that would help diagnose the issue
|
|
247
|
+
|
|
248
|
+
Format the output as valid GitHub Markdown. Make sure the title is a single # heading at the very top.
|
|
249
|
+
Do NOT add meta-commentary like "Here's a formatted issue" - just output the raw markdown.
|
|
250
|
+
All content must be in English for the GitHub issue.
|
|
251
|
+
`,s}async function Gwe(e){let t=await Cl({includeLogs:e.includeLogs!==!1}),r=Vv(t),i=`# Bug Report
|
|
252
|
+
|
|
253
|
+
`;return i+=`## Description
|
|
254
|
+
|
|
255
|
+
`,i+=`${e.issueDescription}
|
|
256
|
+
|
|
257
|
+
`,e.expectedBehavior&&(i+=`## Expected Behavior
|
|
258
|
+
|
|
259
|
+
`,i+=`${e.expectedBehavior}
|
|
260
|
+
|
|
261
|
+
`),e.stepsToReproduce&&(i+=`## Steps to Reproduce
|
|
262
|
+
|
|
263
|
+
`,i+=`${e.stepsToReproduce}
|
|
264
|
+
|
|
265
|
+
`),i+=r,{title:"Bug Report",body:i,success:!0}}import*as XD from"fs/promises";import*as YD from"path";import*as JD from"os";import*as Xv from"readline";import{exec as qwe}from"child_process";import{promisify as Vwe,parseArgs as Zwe}from"util";var Xwe=Vwe(qwe);function Ywe(){try{let{values:e}=Zwe({args:process.argv.slice(2),options:{help:{type:"boolean",short:"h",default:!1},verbose:{type:"boolean",short:"v",default:!1},"no-logs":{type:"boolean",default:!1},output:{type:"string",short:"o"}}});return{output:e.output,verbose:e.verbose,noLogs:e["no-logs"],help:e.help}}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exit(1)}}function Jwe(){console.log(`
|
|
266
|
+
bug-report - Generate bug reports for claude-mem
|
|
267
|
+
|
|
268
|
+
USAGE:
|
|
269
|
+
npm run bug-report [options]
|
|
270
|
+
|
|
271
|
+
OPTIONS:
|
|
272
|
+
-o, --output <file> Save report to file (default: stdout + timestamped file)
|
|
273
|
+
-v, --verbose Show all collected diagnostics
|
|
274
|
+
--no-logs Skip log collection (for privacy)
|
|
275
|
+
-h, --help Show this help message
|
|
276
|
+
|
|
277
|
+
DESCRIPTION:
|
|
278
|
+
This script collects system diagnostics, prompts you for issue details,
|
|
279
|
+
and generates a formatted GitHub issue for claude-mem using the Claude Agent SDK.
|
|
280
|
+
|
|
281
|
+
The generated report will be saved to ~/bug-report-YYYY-MM-DD-HHMMSS.md
|
|
282
|
+
and displayed in your terminal for easy copy-pasting to GitHub.
|
|
283
|
+
|
|
284
|
+
EXAMPLES:
|
|
285
|
+
# Generate a bug report interactively
|
|
286
|
+
npm run bug-report
|
|
287
|
+
|
|
288
|
+
# Generate without including logs (for privacy)
|
|
289
|
+
npm run bug-report --no-logs
|
|
290
|
+
|
|
291
|
+
# Save to a specific file
|
|
292
|
+
npm run bug-report --output ~/my-bug-report.md
|
|
293
|
+
|
|
294
|
+
# Show all diagnostic details during collection
|
|
295
|
+
npm run bug-report --verbose
|
|
296
|
+
`)}async function Qwe(e){let t=Xv.createInterface({input:process.stdin,output:process.stdout});return new Promise(r=>{t.question(e,i=>{t.close(),r(i.trim())})})}async function Zv(e){console.log(e),console.log(`(Press Enter on an empty line to finish)
|
|
297
|
+
`);let t=Xv.createInterface({input:process.stdin,output:process.stdout}),r=[];return new Promise(i=>{t.on("line",s=>{s.trim()===""&&r.length>0?(t.close(),i(r.join(`
|
|
298
|
+
`))):s.trim()!==""&&r.push(s)}),t.on("close",()=>{i(r.join(`
|
|
299
|
+
`))})})}async function eSe(){let e=Ywe();e.help&&(Jwe(),process.exit(0)),console.log(`\u{1F30E} Leave report in ANY language, and it will auto translate to English
|
|
300
|
+
`),console.log("\u{1F50D} Collecting system diagnostics...");let t=await Cl({includeLogs:!e.noLogs});console.log("\u2713 Version information collected"),console.log("\u2713 Platform details collected"),console.log("\u2713 Worker status checked"),e.noLogs||console.log(`\u2713 Logs extracted (last ${t.logs.workerLog.length+t.logs.silentLog.length} lines)`),console.log(`\u2713 Configuration loaded
|
|
301
|
+
`),console.log("\u{1F4CB} System Summary:"),console.log(` Claude-mem: v${t.versions.claudeMem}`),console.log(` Claude Code: ${t.versions.claudeCode}`),console.log(` Platform: ${t.platform.osVersion} (${t.platform.arch})`),console.log(` Worker: ${t.worker.running?`Running (PID ${t.worker.pid}, port ${t.worker.port})`:"Not running"}
|
|
302
|
+
`),e.verbose&&(console.log("\u{1F4CA} Detailed Diagnostics:"),console.log(JSON.stringify(t,null,2)),console.log());let r=await Zv("Please describe the issue you're experiencing:");r.trim()||(console.error("\u274C Issue description is required"),process.exit(1)),console.log();let i=await Zv("Expected behavior (leave blank to skip):");console.log();let s=await Zv("Steps to reproduce (leave blank to skip):");console.log();let n=await Qwe("Generate bug report? (y/n): ");n.toLowerCase()!=="y"&&n.toLowerCase()!=="yes"&&(console.log("\u274C Bug report generation cancelled"),process.exit(0)),console.log(`
|
|
303
|
+
\u{1F916} Generating bug report with Claude...`);let a=await ZD({issueDescription:r,expectedBehavior:i.trim()||void 0,stepsToReproduce:s.trim()||void 0,includeLogs:!e.noLogs});a.success||(console.error("\u274C Failed to generate bug report:",a.error),process.exit(1)),console.log(`\u2713 Issue formatted successfully
|
|
304
|
+
`);let o=new Date().toISOString().replace(/:/g,"").replace(/\..+/,"").replace("T","-"),l=YD.join(JD.homedir(),`bug-report-${o}.md`),c=e.output||l;await XD.writeFile(c,a.body,"utf-8");let u=encodeURIComponent(a.title),p=encodeURIComponent(a.body),h=`https://github.com/thedotmack/claude-mem/issues/new?title=${u}&body=${p}`;console.log("\u2500".repeat(60)),console.log("\u{1F4CB} BUG REPORT GENERATED"),console.log("\u2500".repeat(60)),console.log(),console.log(a.body),console.log(),console.log("\u2500".repeat(60)),console.log("Suggested labels: bug, needs-triage"),console.log(`Report saved to: ${c}`),console.log("\u2500".repeat(60)),console.log(),console.log("\u{1F310} Opening GitHub issue form in your browser...");try{let f=process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open";await Xwe(`${f} "${h}"`),console.log("\u2713 Browser opened successfully")}catch{console.error("\u274C Failed to open browser. Please visit:"),console.error(h)}}eSe().catch(e=>{console.error("Fatal error:",e),process.exit(1)});
|
|
305
|
+
/*! Bundled license information:
|
|
306
|
+
|
|
307
|
+
@anthropic-ai/claude-agent-sdk/sdk.mjs:
|
|
308
|
+
(*!
|
|
309
|
+
* mime-types
|
|
310
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
311
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
312
|
+
* MIT Licensed
|
|
313
|
+
*)
|
|
314
|
+
*/
|