import{g as mn,c as fn,a as bn}from"./tokenStats.worker-NweTEP7y.js";var vn={},An=Object.freeze({__proto__:null,default:vn});const je=10,$r=(e=0)=>r=>`\x1B[${r+e}m`,Gr=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,xr=(e=0)=>(r,t,n)=>`\x1B[${38+e};2;${r};${t};${n}m`,_={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(_.modifier);const wn=Object.keys(_.color),Sn=Object.keys(_.bgColor);[...wn,...Sn];function On(){const e=new Map;for(const[r,t]of Object.entries(_)){for(const[n,i]of Object.entries(t))_[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=_[n],e.set(i[0],i[1]);Object.defineProperty(_,r,{value:t,enumerable:!1})}return Object.defineProperty(_,"codes",{value:e,enumerable:!1}),_.color.close="\x1B[39m",_.bgColor.close="\x1B[49m",_.color.ansi=$r(),_.color.ansi256=Gr(),_.color.ansi16m=xr(),_.bgColor.ansi=$r(je),_.bgColor.ansi256=Gr(je),_.bgColor.ansi16m=xr(je),Object.defineProperties(_,{rgbToAnsi256:{value(r,t,n){return r===t&&t===n?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(r){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(a=>a+a).join(""));const i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:r=>_.rgbToAnsi256(..._.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let t,n,i;if(r>=232)t=((r-232)*10+8)/255,n=t,i=t;else{r-=16;const f=r%36;t=Math.floor(r/36)/5,n=Math.floor(f/6)/5,i=f%6/5}const a=Math.max(t,n,i)*2;if(a===0)return 30;let u=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return a===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(r,t,n)=>_.ansi256ToAnsi(_.rgbToAnsi256(r,t,n)),enumerable:!1},hexToAnsi:{value:r=>_.ansi256ToAnsi(_.hexToAnsi256(r)),enumerable:!1}}),_}const X=On(),Lr=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:r})=>r==="Chromium");if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),Wr=Lr!==0&&{level:Lr},Tn={stdout:Wr,stderr:Wr};function jn(e,r,t){let n=e.indexOf(r);if(n===-1)return e;const i=r.length;let a=0,u="";do u+=e.slice(a,n)+r+t,a=n+i,n=e.indexOf(r,a);while(n!==-1);return u+=e.slice(a),u}function Pn(e,r,t,n){let i=0,a="";do{const u=e[n-1]==="\r";a+=e.slice(i,u?n-1:n)+r+(u?`\r
`:`
`)+t,i=n+1,n=e.indexOf(`
`,i)}while(n!==-1);return a+=e.slice(i),a}const{stdout:Vr,stderr:zr}=Tn,Rr=Symbol("GENERATOR"),fe=Symbol("STYLER"),pe=Symbol("IS_EMPTY"),Hr=["ansi","ansi","ansi256","ansi16m"],ue=Object.create(null),En=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const t=Vr?Vr.level:0;e.level=r.level===void 0?t:r.level},kn=e=>{const r=(...t)=>t.join(" ");return En(r,e),Object.setPrototypeOf(r,ye.prototype),r};function ye(e){return kn(e)}Object.setPrototypeOf(ye.prototype,Function.prototype);for(const[e,r]of Object.entries(X))ue[e]={get(){const t=Se(this,_r(r.open,r.close,this[fe]),this[pe]);return Object.defineProperty(this,e,{value:t}),t}};ue.visible={get(){const e=Se(this,this[fe],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const Fr=(e,r,t,...n)=>e==="rgb"?r==="ansi16m"?X[t].ansi16m(...n):r==="ansi256"?X[t].ansi256(X.rgbToAnsi256(...n)):X[t].ansi(X.rgbToAnsi(...n)):e==="hex"?Fr("rgb",r,t,...X.hexToRgb(...n)):X[t][e](...n),Bn=["rgb","hex","ansi256"];for(const e of Bn){ue[e]={get(){const{level:t}=this;return function(...n){const i=_r(Fr(e,Hr[t],"color",...n),X.color.close,this[fe]);return Se(this,i,this[pe])}}};const r="bg"+e[0].toUpperCase()+e.slice(1);ue[r]={get(){const{level:t}=this;return function(...n){const i=_r(Fr(e,Hr[t],"bgColor",...n),X.bgColor.close,this[fe]);return Se(this,i,this[pe])}}}}const In=Object.defineProperties(()=>{},{...ue,level:{enumerable:!0,get(){return this[Rr].level},set(e){this[Rr].level=e}}}),_r=(e,r,t)=>{let n,i;return t===void 0?(n=e,i=r):(n=t.openAll+e,i=r+t.closeAll),{open:e,close:r,openAll:n,closeAll:i,parent:t}},Se=(e,r,t)=>{const n=(...i)=>Rn(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,In),n[Rr]=e,n[fe]=r,n[pe]=t,n},Rn=(e,r)=>{if(e.level<=0||!r)return e[pe]?"":r;let t=e[fe];if(t===void 0)return r;const{openAll:n,closeAll:i}=t;if(r.includes("\x1B"))for(;t!==void 0;)r=jn(r,t.close,t.open),t=t.parent;const a=r.indexOf(`
`);return a!==-1&&(r=Pn(r,i,n,a)),n+r+i};Object.defineProperties(ye.prototype,ue);const Ae=ye();ye({level:zr?zr.level:0});var Jr;(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"})(Jr||(Jr={}));new Array(20).fill(0).map((e,r)=>" ".repeat(r));const oe=200;new Array(oe).fill(0).map((e,r)=>`
`+" ".repeat(r)),new Array(oe).fill(0).map((e,r)=>"\r"+" ".repeat(r)),new Array(oe).fill(0).map((e,r)=>`\r
`+" ".repeat(r)),new Array(oe).fill(0).map((e,r)=>`
`+"	".repeat(r)),new Array(oe).fill(0).map((e,r)=>"\r"+"	".repeat(r)),new Array(oe).fill(0).map((e,r)=>`\r
`+"	".repeat(r));var Yr;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Yr||(Yr={}));var Xr;(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"})(Xr||(Xr={}));var Qr;(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"})(Qr||(Qr={}));var Zr;(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"})(Zr||(Zr={}));var ae={exports:{}},Pe=mn(An),Ee={exports:{}};/**
 * @preserve
 * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
 *
 * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
 * @see http://github.com/homebrewing/brauhaus-diff
 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
 * @see http://github.com/garycourt/murmurhash-js
 * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
 * @see http://sites.google.com/site/murmurhash/
 */var Kr;function Fn(){return Kr||(Kr=1,(function(e){(function(){var r;function t(n,i){var a=this instanceof t?this:r;if(a.reset(i),typeof n=="string"&&n.length>0&&a.hash(n),a!==this)return a}t.prototype.hash=function(n){var i,a,u,f,l;switch(l=n.length,this.len+=l,a=this.k1,u=0,this.rem){case 0:a^=l>u?n.charCodeAt(u++)&65535:0;case 1:a^=l>u?(n.charCodeAt(u++)&65535)<<8:0;case 2:a^=l>u?(n.charCodeAt(u++)&65535)<<16:0;case 3:a^=l>u?(n.charCodeAt(u)&255)<<24:0,a^=l>u?(n.charCodeAt(u++)&65280)>>8:0}if(this.rem=l+this.rem&3,l-=this.rem,l>0){for(i=this.h1;a=a*11601+(a&65535)*3432906752&4294967295,a=a<<15|a>>>17,a=a*13715+(a&65535)*461832192&4294967295,i^=a,i=i<<13|i>>>19,i=i*5+3864292196&4294967295,!(u>=l);)a=n.charCodeAt(u++)&65535^(n.charCodeAt(u++)&65535)<<8^(n.charCodeAt(u++)&65535)<<16,f=n.charCodeAt(u++),a^=(f&255)<<24^(f&65280)>>8;switch(a=0,this.rem){case 3:a^=(n.charCodeAt(u+2)&65535)<<16;case 2:a^=(n.charCodeAt(u+1)&65535)<<8;case 1:a^=n.charCodeAt(u)&65535}this.h1=i}return this.k1=a,this},t.prototype.result=function(){var n,i;return n=this.k1,i=this.h1,n>0&&(n=n*11601+(n&65535)*3432906752&4294967295,n=n<<15|n>>>17,n=n*13715+(n&65535)*461832192&4294967295,i^=n),i^=this.len,i^=i>>>16,i=i*51819+(i&65535)*2246770688&4294967295,i^=i>>>13,i=i*44597+(i&65535)*3266445312&4294967295,i^=i>>>16,i>>>0},t.prototype.reset=function(n){return this.h1=typeof n=="number"?n:0,this.rem=this.k1=this.len=0,this},r=new t,e.exports=t})()})(Ee)),Ee.exports}var ke={},Be={},Cr;function _n(){return Cr||(Cr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.signals=void 0,e.signals=[],e.signals.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&e.signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")})(Be)),Be}var et;function qn(){return et||(et=1,(function(e){var r;Object.defineProperty(e,"__esModule",{value:!0}),e.unload=e.load=e.onExit=e.signals=void 0;const t=_n();Object.defineProperty(e,"signals",{enumerable:!0,get:function(){return t.signals}});const n=E=>!!E&&typeof E=="object"&&typeof E.removeListener=="function"&&typeof E.emit=="function"&&typeof E.reallyExit=="function"&&typeof E.listeners=="function"&&typeof E.kill=="function"&&typeof E.pid=="number"&&typeof E.on=="function",i=Symbol.for("signal-exit emitter"),a=globalThis,u=Object.defineProperty.bind(Object);class f{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(a[i])return a[i];u(a,i,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(w,g){this.listeners[w].push(g)}removeListener(w,g){const h=this.listeners[w],p=h.indexOf(g);p!==-1&&(p===0&&h.length===1?h.length=0:h.splice(p,1))}emit(w,g,h){if(this.emitted[w])return!1;this.emitted[w]=!0;let p=!1;for(const v of this.listeners[w])p=v(g,h)===!0||p;return w==="exit"&&(p=this.emit("afterExit",g,h)||p),p}}class l{}const m=E=>({onExit(w,g){return E.onExit(w,g)},load(){return E.load()},unload(){return E.unload()}});class S extends l{onExit(){return()=>{}}load(){}unload(){}}class d extends l{#a=A.platform==="win32"?"SIGINT":"SIGHUP";#r=new f;#e;#i;#o;#n={};#t=!1;constructor(w){super(),this.#e=w,this.#n={};for(const g of t.signals)this.#n[g]=()=>{const h=this.#e.listeners(g);let{count:p}=this.#r;const v=w;if(typeof v.__signal_exit_emitter__=="object"&&typeof v.__signal_exit_emitter__.count=="number"&&(p+=v.__signal_exit_emitter__.count),h.length===p){this.unload();const b=this.#r.emit("exit",null,g),I=g==="SIGHUP"?this.#a:g;b||w.kill(w.pid,I)}};this.#o=w.reallyExit,this.#i=w.emit}onExit(w,g){if(!n(this.#e))return()=>{};this.#t===!1&&this.load();const h=g?.alwaysLast?"afterExit":"exit";return this.#r.on(h,w),()=>{this.#r.removeListener(h,w),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#t){this.#t=!0,this.#r.count+=1;for(const w of t.signals)try{const g=this.#n[w];g&&this.#e.on(w,g)}catch{}this.#e.emit=(w,...g)=>this.#u(w,...g),this.#e.reallyExit=w=>this.#f(w)}}unload(){this.#t&&(this.#t=!1,t.signals.forEach(w=>{const g=this.#n[w];if(!g)throw new Error("Listener not defined for signal: "+w);try{this.#e.removeListener(w,g)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#o,this.#r.count-=1)}#f(w){return n(this.#e)?(this.#e.exitCode=w||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#u(w,...g){const h=this.#i;if(w==="exit"&&n(this.#e)){typeof g[0]=="number"&&(this.#e.exitCode=g[0]);const p=h.call(this.#e,w,...g);return this.#r.emit("exit",this.#e.exitCode,null),p}else return h.call(this.#e,w,...g)}}const A=globalThis.process;r=m(n(A)?new d(A):new S),e.onExit=r.onExit,e.load=r.load,e.unload=r.unload})(ke)),ke}var Ie={},Re={},Fe,rt;function un(){return rt||(rt=1,Fe=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;r[t]=i;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 u=Object.getOwnPropertySymbols(r);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(r,t);if(f.value!==i||f.enumerable!==!0)return!1}return!0}),Fe}var _e,tt;function Oe(){if(tt)return _e;tt=1;var e=un();return _e=function(){return e()&&!!Symbol.toStringTag},_e}var qe,nt;function sn(){return nt||(nt=1,qe=Object),qe}var De,it;function Dn(){return it||(it=1,De=Error),De}var Ne,ot;function Nn(){return ot||(ot=1,Ne=EvalError),Ne}var Me,at;function Mn(){return at||(at=1,Me=RangeError),Me}var Ue,ft;function Un(){return ft||(ft=1,Ue=ReferenceError),Ue}var $e,ut;function cn(){return ut||(ut=1,$e=SyntaxError),$e}var Ge,st;function ge(){return st||(st=1,Ge=TypeError),Ge}var xe,ct;function $n(){return ct||(ct=1,xe=URIError),xe}var Le,lt;function Gn(){return lt||(lt=1,Le=Math.abs),Le}var We,pt;function xn(){return pt||(pt=1,We=Math.floor),We}var Ve,yt;function Ln(){return yt||(yt=1,Ve=Math.max),Ve}var ze,gt;function Wn(){return gt||(gt=1,ze=Math.min),ze}var He,dt;function Vn(){return dt||(dt=1,He=Math.pow),He}var Je,ht;function zn(){return ht||(ht=1,Je=Math.round),Je}var Ye,mt;function Hn(){return mt||(mt=1,Ye=Number.isNaN||function(r){return r!==r}),Ye}var Xe,bt;function Jn(){if(bt)return Xe;bt=1;var e=Hn();return Xe=function(t){return e(t)||t===0?t:t<0?-1:1},Xe}var Qe,vt;function Yn(){return vt||(vt=1,Qe=Object.getOwnPropertyDescriptor),Qe}var Ze,At;function se(){if(At)return Ze;At=1;var e=Yn();if(e)try{e([],"length")}catch{e=null}return Ze=e,Ze}var Ke,wt;function Te(){if(wt)return Ke;wt=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Ke=e,Ke}var Ce,St;function Xn(){if(St)return Ce;St=1;var e=typeof Symbol<"u"&&Symbol,r=un();return Ce=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r()},Ce}var er,Ot;function ln(){return Ot||(Ot=1,er=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),er}var rr,Tt;function pn(){if(Tt)return rr;Tt=1;var e=sn();return rr=e.getPrototypeOf||null,rr}var tr,jt;function Qn(){if(jt)return tr;jt=1;var e="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(l,m){for(var S=[],d=0;d<l.length;d+=1)S[d]=l[d];for(var A=0;A<m.length;A+=1)S[A+l.length]=m[A];return S},a=function(l,m){for(var S=[],d=m,A=0;d<l.length;d+=1,A+=1)S[A]=l[d];return S},u=function(f,l){for(var m="",S=0;S<f.length;S+=1)m+=f[S],S+1<f.length&&(m+=l);return m};return tr=function(l){var m=this;if(typeof m!="function"||r.apply(m)!==n)throw new TypeError(e+m);for(var S=a(arguments,1),d,A=function(){if(this instanceof d){var p=m.apply(this,i(S,arguments));return Object(p)===p?p:this}return m.apply(l,i(S,arguments))},E=t(0,m.length-S.length),w=[],g=0;g<E;g++)w[g]="$"+g;if(d=Function("binder","return function ("+u(w,",")+"){ return binder.apply(this,arguments); }")(A),m.prototype){var h=function(){};h.prototype=m.prototype,d.prototype=new h,h.prototype=null}return d},tr}var nr,Pt;function de(){if(Pt)return nr;Pt=1;var e=Qn();return nr=Function.prototype.bind||e,nr}var ir,Et;function qr(){return Et||(Et=1,ir=Function.prototype.call),ir}var or,kt;function Dr(){return kt||(kt=1,or=Function.prototype.apply),or}var ar,Bt;function Zn(){return Bt||(Bt=1,ar=typeof Reflect<"u"&&Reflect&&Reflect.apply),ar}var fr,It;function yn(){if(It)return fr;It=1;var e=de(),r=Dr(),t=qr(),n=Zn();return fr=n||e.call(t,r),fr}var ur,Rt;function Nr(){if(Rt)return ur;Rt=1;var e=de(),r=ge(),t=qr(),n=yn();return ur=function(a){if(a.length<1||typeof a[0]!="function")throw new r("a function is required");return n(e,t,a)},ur}var sr,Ft;function Kn(){if(Ft)return sr;Ft=1;var e=Nr(),r=se(),t;try{t=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var n=!!t&&r&&r(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return sr=n&&typeof n.get=="function"?e([n.get]):typeof a=="function"?function(f){return a(f==null?f:i(f))}:!1,sr}var cr,_t;function Mr(){if(_t)return cr;_t=1;var e=ln(),r=pn(),t=Kn();return cr=e?function(i){return e(i)}:r?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return r(i)}:t?function(i){return t(i)}:null,cr}var lr,qt;function gn(){if(qt)return lr;qt=1;var e=Function.prototype.call,r=Object.prototype.hasOwnProperty,t=de();return lr=t.call(e,r),lr}var pr,Dt;function dn(){if(Dt)return pr;Dt=1;var e,r=sn(),t=Dn(),n=Nn(),i=Mn(),a=Un(),u=cn(),f=ge(),l=$n(),m=Gn(),S=xn(),d=Ln(),A=Wn(),E=Vn(),w=zn(),g=Jn(),h=Function,p=function(T){try{return h('"use strict"; return ('+T+").constructor;")()}catch{}},v=se(),b=Te(),I=function(){throw new f},U=v?(function(){try{return arguments.callee,I}catch{try{return v(arguments,"callee").get}catch{return I}}})():I,D=Xn()(),j=Mr(),V=pn(),Q=ln(),z=Dr(),W=qr(),M={},C=typeof Uint8Array>"u"||!j?e:j(Uint8Array),G={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":D&&j?j([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":M,"%AsyncGenerator%":M,"%AsyncGeneratorFunction%":M,"%AsyncIteratorPrototype%":M,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":M,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D&&j?j(j([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!D||!j?e:j(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!D||!j?e:j(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D&&j?j(""[Symbol.iterator]()):e,"%Symbol%":D?Symbol:e,"%SyntaxError%":u,"%ThrowTypeError%":U,"%TypedArray%":C,"%TypeError%":f,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":W,"%Function.prototype.apply%":z,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":V,"%Math.abs%":m,"%Math.floor%":S,"%Math.max%":d,"%Math.min%":A,"%Math.pow%":E,"%Math.round%":w,"%Math.sign%":g,"%Reflect.getPrototypeOf%":Q};if(j)try{null.error}catch(T){var ee=j(j(T));G["%Error.prototype%"]=ee}var J=function T(O){var P;if(O==="%AsyncFunction%")P=p("async function () {}");else if(O==="%GeneratorFunction%")P=p("function* () {}");else if(O==="%AsyncGeneratorFunction%")P=p("async function* () {}");else if(O==="%AsyncGenerator%"){var B=T("%AsyncGeneratorFunction%");B&&(P=B.prototype)}else if(O==="%AsyncIteratorPrototype%"){var q=T("%AsyncGenerator%");q&&j&&(P=j(q.prototype))}return G[O]=P,P},te={__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"]},H=de(),Z=gn(),x=H.call(W,Array.prototype.concat),ne=H.call(z,Array.prototype.splice),K=H.call(W,String.prototype.replace),o=H.call(W,String.prototype.slice),s=H.call(W,RegExp.prototype.exec),y=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,R=function(O){var P=o(O,0,1),B=o(O,-1);if(P==="%"&&B!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(B==="%"&&P!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var q=[];return K(O,y,function($,L,N,ie){q[q.length]=N?K(ie,k,"$1"):L||$}),q},F=function(O,P){var B=O,q;if(Z(te,B)&&(q=te[B],B="%"+q[0]+"%"),Z(G,B)){var $=G[B];if($===M&&($=J(B)),typeof $>"u"&&!P)throw new f("intrinsic "+O+" exists, but is not available. Please file an issue!");return{alias:q,name:B,value:$}}throw new u("intrinsic "+O+" does not exist!")};return pr=function(O,P){if(typeof O!="string"||O.length===0)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof P!="boolean")throw new f('"allowMissing" argument must be a boolean');if(s(/^%?[^%]*%?$/,O)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var B=R(O),q=B.length>0?B[0]:"",$=F("%"+q+"%",P),L=$.name,N=$.value,ie=!1,ce=$.alias;ce&&(q=ce[0],ne(B,x([0,1],ce)));for(var c=1,re=!0;c<B.length;c+=1){var Y=B[c],me=o(Y,0,1),be=o(Y,-1);if((me==='"'||me==="'"||me==="`"||be==='"'||be==="'"||be==="`")&&me!==be)throw new u("property names with quotes must have matching quotes");if((Y==="constructor"||!re)&&(ie=!0),q+="."+Y,L="%"+q+"%",Z(G,L))N=G[L];else if(N!=null){if(!(Y in N)){if(!P)throw new f("base intrinsic for "+O+" exists, but the property is not available.");return}if(v&&c+1>=B.length){var ve=v(N,Y);re=!!ve,re&&"get"in ve&&!("originalValue"in ve.get)?N=ve.get:N=N[Y]}else re=Z(N,Y),N=N[Y];re&&!ie&&(G[L]=N)}}return N},pr}var yr,Nt;function he(){if(Nt)return yr;Nt=1;var e=dn(),r=Nr(),t=r([e("%String.prototype.indexOf%")]);return yr=function(i,a){var u=e(i,!!a);return typeof u=="function"&&t(i,".prototype.")>-1?r([u]):u},yr}var gr,Mt;function Cn(){if(Mt)return gr;Mt=1;var e=Oe()(),r=he(),t=r("Object.prototype.toString"),n=function(f){return e&&f&&typeof f=="object"&&Symbol.toStringTag in f?!1:t(f)==="[object Arguments]"},i=function(f){return n(f)?!0:f!==null&&typeof f=="object"&&"length"in f&&typeof f.length=="number"&&f.length>=0&&t(f)!=="[object Array]"&&"callee"in f&&t(f.callee)==="[object Function]"},a=(function(){return n(arguments)})();return n.isLegacyArguments=i,gr=a?n:i,gr}var dr,Ut;function ei(){if(Ut)return dr;Ut=1;var e=he(),r=Oe()(),t=gn(),n=se(),i;if(r){var a=e("RegExp.prototype.exec"),u={},f=function(){throw u},l={toString:f,valueOf:f};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=f),i=function(A){if(!A||typeof A!="object")return!1;var E=n(A,"lastIndex"),w=E&&t(E,"value");if(!w)return!1;try{a(A,l)}catch(g){return g===u}}}else{var m=e("Object.prototype.toString"),S="[object RegExp]";i=function(A){return!A||typeof A!="object"&&typeof A!="function"?!1:m(A)===S}}return dr=i,dr}var hr,$t;function ri(){if($t)return hr;$t=1;var e=he(),r=ei(),t=e("RegExp.prototype.exec"),n=ge();return hr=function(a){if(!r(a))throw new n("`regex` must be a RegExp");return function(f){return t(a,f)!==null}},hr}var mr,Gt;function ti(){if(Gt)return mr;Gt=1;const e=function*(){}.constructor;return mr=()=>e,mr}var br,xt;function ni(){if(xt)return br;xt=1;var e=he(),r=ri(),t=r(/^\s*(?:function)?\*/),n=Oe()(),i=Mr(),a=e("Object.prototype.toString"),u=e("Function.prototype.toString"),f=ti();return br=function(m){if(typeof m!="function")return!1;if(t(u(m)))return!0;if(!n){var S=a(m);return S==="[object GeneratorFunction]"}if(!i)return!1;var d=f();return d&&i(m)===d.prototype},br}var vr,Lt;function ii(){if(Lt)return vr;Lt=1;var e=Function.prototype.toString,r=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,n;if(typeof r=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},r(function(){throw 42},null,t)}catch(v){v!==n&&(r=null)}else r=null;var i=/^\s*class\b/,a=function(b){try{var I=e.call(b);return i.test(I)}catch{return!1}},u=function(b){try{return a(b)?!1:(e.call(b),!0)}catch{return!1}},f=Object.prototype.toString,l="[object Object]",m="[object Function]",S="[object GeneratorFunction]",d="[object HTMLAllCollection]",A="[object HTML document.all class]",E="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,g=!(0 in[,]),h=function(){return!1};if(typeof document=="object"){var p=document.all;f.call(p)===f.call(document.all)&&(h=function(b){if((g||!b)&&(typeof b>"u"||typeof b=="object"))try{var I=f.call(b);return(I===d||I===A||I===E||I===l)&&b("")==null}catch{}return!1})}return vr=r?function(b){if(h(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{r(b,null,t)}catch(I){if(I!==n)return!1}return!a(b)&&u(b)}:function(b){if(h(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(w)return u(b);if(a(b))return!1;var I=f.call(b);return I!==m&&I!==S&&!/^\[object HTML/.test(I)?!1:u(b)},vr}var Ar,Wt;function oi(){if(Wt)return Ar;Wt=1;var e=ii(),r=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(l,m,S){for(var d=0,A=l.length;d<A;d++)t.call(l,d)&&(S==null?m(l[d],d,l):m.call(S,l[d],d,l))},i=function(l,m,S){for(var d=0,A=l.length;d<A;d++)S==null?m(l.charAt(d),d,l):m.call(S,l.charAt(d),d,l)},a=function(l,m,S){for(var d in l)t.call(l,d)&&(S==null?m(l[d],d,l):m.call(S,l[d],d,l))};function u(f){return r.call(f)==="[object Array]"}return Ar=function(l,m,S){if(!e(m))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=S),u(l)?n(l,m,d):typeof l=="string"?i(l,m,d):a(l,m,d)},Ar}var wr,Vt;function ai(){return Vt||(Vt=1,wr=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),wr}var Sr,zt;function fi(){if(zt)return Sr;zt=1;var e=ai(),r=typeof globalThis>"u"?fn:globalThis;return Sr=function(){for(var n=[],i=0;i<e.length;i++)typeof r[e[i]]=="function"&&(n[n.length]=e[i]);return n},Sr}var Or={exports:{}},Tr,Ht;function ui(){if(Ht)return Tr;Ht=1;var e=Te(),r=cn(),t=ge(),n=se();return Tr=function(a,u,f){if(!a||typeof a!="object"&&typeof a!="function")throw new t("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,m=arguments.length>4?arguments[4]:null,S=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,A=!!n&&n(a,u);if(e)e(a,u,{configurable:S===null&&A?A.configurable:!S,enumerable:l===null&&A?A.enumerable:!l,value:f,writable:m===null&&A?A.writable:!m});else if(d||!l&&!m&&!S)a[u]=f;else throw new r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Tr}var jr,Jt;function si(){if(Jt)return jr;Jt=1;var e=Te(),r=function(){return!!e};return r.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},jr=r,jr}var Pr,Yt;function ci(){if(Yt)return Pr;Yt=1;var e=dn(),r=ui(),t=si()(),n=se(),i=ge(),a=e("%Math.floor%");return Pr=function(f,l){if(typeof f!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||a(l)!==l)throw new i("`length` must be a positive 32-bit integer");var m=arguments.length>2&&!!arguments[2],S=!0,d=!0;if("length"in f&&n){var A=n(f,"length");A&&!A.configurable&&(S=!1),A&&!A.writable&&(d=!1)}return(S||d||!m)&&(t?r(f,"length",l,!0,!0):r(f,"length",l)),f},Pr}var Er,Xt;function li(){if(Xt)return Er;Xt=1;var e=de(),r=Dr(),t=yn();return Er=function(){return t(e,r,arguments)},Er}var Qt;function pi(){return Qt||(Qt=1,(function(e){var r=ci(),t=Te(),n=Nr(),i=li();e.exports=function(u){var f=n(arguments),l=u.length-(arguments.length-1);return r(f,1+(l>0?l:0),!0)},t?t(e.exports,"apply",{value:i}):e.exports.apply=i})(Or)),Or.exports}var kr,Zt;function hn(){if(Zt)return kr;Zt=1;var e=oi(),r=fi(),t=pi(),n=he(),i=se(),a=Mr(),u=n("Object.prototype.toString"),f=Oe()(),l=typeof globalThis>"u"?fn:globalThis,m=r(),S=n("String.prototype.slice"),d=n("Array.prototype.indexOf",!0)||function(h,p){for(var v=0;v<h.length;v+=1)if(h[v]===p)return v;return-1},A={__proto__:null};f&&i&&a?e(m,function(g){var h=new l[g];if(Symbol.toStringTag in h&&a){var p=a(h),v=i(p,Symbol.toStringTag);if(!v&&p){var b=a(p);v=i(b,Symbol.toStringTag)}A["$"+g]=t(v.get)}}):e(m,function(g){var h=new l[g],p=h.slice||h.set;p&&(A["$"+g]=t(p))});var E=function(h){var p=!1;return e(A,function(v,b){if(!p)try{"$"+v(h)===b&&(p=S(b,1))}catch{}}),p},w=function(h){var p=!1;return e(A,function(v,b){if(!p)try{v(h),p=S(b,1)}catch{}}),p};return kr=function(h){if(!h||typeof h!="object")return!1;if(!f){var p=S(u(h),8,-1);return d(m,p)>-1?p:p!=="Object"?!1:w(h)}return i?E(h):null},kr}var Br,Kt;function yi(){if(Kt)return Br;Kt=1;var e=hn();return Br=function(t){return!!e(t)},Br}var Ct;function gi(){return Ct||(Ct=1,(function(e){var r=Cn(),t=ni(),n=hn(),i=yi();function a(c){return c.call.bind(c)}var u=typeof BigInt<"u",f=typeof Symbol<"u",l=a(Object.prototype.toString),m=a(Number.prototype.valueOf),S=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(u)var A=a(BigInt.prototype.valueOf);if(f)var E=a(Symbol.prototype.valueOf);function w(c,re){if(typeof c!="object")return!1;try{return re(c),!0}catch{return!1}}e.isArgumentsObject=r,e.isGeneratorFunction=t,e.isTypedArray=i;function g(c){return typeof Promise<"u"&&c instanceof Promise||c!==null&&typeof c=="object"&&typeof c.then=="function"&&typeof c.catch=="function"}e.isPromise=g;function h(c){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(c):i(c)||o(c)}e.isArrayBufferView=h;function p(c){return n(c)==="Uint8Array"}e.isUint8Array=p;function v(c){return n(c)==="Uint8ClampedArray"}e.isUint8ClampedArray=v;function b(c){return n(c)==="Uint16Array"}e.isUint16Array=b;function I(c){return n(c)==="Uint32Array"}e.isUint32Array=I;function U(c){return n(c)==="Int8Array"}e.isInt8Array=U;function D(c){return n(c)==="Int16Array"}e.isInt16Array=D;function j(c){return n(c)==="Int32Array"}e.isInt32Array=j;function V(c){return n(c)==="Float32Array"}e.isFloat32Array=V;function Q(c){return n(c)==="Float64Array"}e.isFloat64Array=Q;function z(c){return n(c)==="BigInt64Array"}e.isBigInt64Array=z;function W(c){return n(c)==="BigUint64Array"}e.isBigUint64Array=W;function M(c){return l(c)==="[object Map]"}M.working=typeof Map<"u"&&M(new Map);function C(c){return typeof Map>"u"?!1:M.working?M(c):c instanceof Map}e.isMap=C;function G(c){return l(c)==="[object Set]"}G.working=typeof Set<"u"&&G(new Set);function ee(c){return typeof Set>"u"?!1:G.working?G(c):c instanceof Set}e.isSet=ee;function J(c){return l(c)==="[object WeakMap]"}J.working=typeof WeakMap<"u"&&J(new WeakMap);function te(c){return typeof WeakMap>"u"?!1:J.working?J(c):c instanceof WeakMap}e.isWeakMap=te;function H(c){return l(c)==="[object WeakSet]"}H.working=typeof WeakSet<"u"&&H(new WeakSet);function Z(c){return H(c)}e.isWeakSet=Z;function x(c){return l(c)==="[object ArrayBuffer]"}x.working=typeof ArrayBuffer<"u"&&x(new ArrayBuffer);function ne(c){return typeof ArrayBuffer>"u"?!1:x.working?x(c):c instanceof ArrayBuffer}e.isArrayBuffer=ne;function K(c){return l(c)==="[object DataView]"}K.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&K(new DataView(new ArrayBuffer(1),0,1));function o(c){return typeof DataView>"u"?!1:K.working?K(c):c instanceof DataView}e.isDataView=o;var s=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function y(c){return l(c)==="[object SharedArrayBuffer]"}function k(c){return typeof s>"u"?!1:(typeof y.working>"u"&&(y.working=y(new s)),y.working?y(c):c instanceof s)}e.isSharedArrayBuffer=k;function R(c){return l(c)==="[object AsyncFunction]"}e.isAsyncFunction=R;function F(c){return l(c)==="[object Map Iterator]"}e.isMapIterator=F;function T(c){return l(c)==="[object Set Iterator]"}e.isSetIterator=T;function O(c){return l(c)==="[object Generator]"}e.isGeneratorObject=O;function P(c){return l(c)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=P;function B(c){return w(c,m)}e.isNumberObject=B;function q(c){return w(c,S)}e.isStringObject=q;function $(c){return w(c,d)}e.isBooleanObject=$;function L(c){return u&&w(c,A)}e.isBigIntObject=L;function N(c){return f&&w(c,E)}e.isSymbolObject=N;function ie(c){return B(c)||q(c)||$(c)||L(c)||N(c)}e.isBoxedPrimitive=ie;function ce(c){return typeof Uint8Array<"u"&&(ne(c)||k(c))}e.isAnyArrayBuffer=ce,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(c){Object.defineProperty(e,c,{enumerable:!1,value:function(){throw new Error(c+" is not supported in userland")}})})})(Re)),Re}var Ir,en;function di(){return en||(en=1,Ir=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"}),Ir}var we={exports:{}},rn;function hi(){return rn||(rn=1,typeof Object.create=="function"?we.exports=function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:we.exports=function(r,t){if(t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r}}),we.exports}var tn;function mi(){return tn||(tn=1,(function(e){var r={},t=Object.getOwnPropertyDescriptors||function(s){for(var y=Object.keys(s),k={},R=0;R<y.length;R++)k[y[R]]=Object.getOwnPropertyDescriptor(s,y[R]);return k},n=/%[sdj%]/g;e.format=function(o){if(!D(o)){for(var s=[],y=0;y<arguments.length;y++)s.push(f(arguments[y]));return s.join(" ")}for(var y=1,k=arguments,R=k.length,F=String(o).replace(n,function(O){if(O==="%%")return"%";if(y>=R)return O;switch(O){case"%s":return String(k[y++]);case"%d":return Number(k[y++]);case"%j":try{return JSON.stringify(k[y++])}catch{return"[Circular]"}default:return O}}),T=k[y];y<R;T=k[++y])b(T)||!z(T)?F+=" "+T:F+=" "+f(T);return F},e.deprecate=function(o,s){if(typeof process<"u"&&process.noDeprecation===!0)return o;if(typeof process>"u")return function(){return e.deprecate(o,s).apply(this,arguments)};var y=!1;function k(){if(!y){if(process.throwDeprecation)throw new Error(s);process.traceDeprecation?console.trace(s):console.error(s),y=!0}return o.apply(this,arguments)}return k};var i={},a=/^$/;if(r.NODE_DEBUG){var u=r.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+u+"$","i")}e.debuglog=function(o){if(o=o.toUpperCase(),!i[o])if(a.test(o)){var s=process.pid;i[o]=function(){var y=e.format.apply(e,arguments);console.error("%s %d: %s",o,s,y)}}else i[o]=function(){};return i[o]};function f(o,s){var y={seen:[],stylize:m};return arguments.length>=3&&(y.depth=arguments[2]),arguments.length>=4&&(y.colors=arguments[3]),v(s)?y.showHidden=s:s&&e._extend(y,s),V(y.showHidden)&&(y.showHidden=!1),V(y.depth)&&(y.depth=2),V(y.colors)&&(y.colors=!1),V(y.customInspect)&&(y.customInspect=!0),y.colors&&(y.stylize=l),d(y,o,y.depth)}e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(o,s){var y=f.styles[s];return y?"\x1B["+f.colors[y][0]+"m"+o+"\x1B["+f.colors[y][1]+"m":o}function m(o,s){return o}function S(o){var s={};return o.forEach(function(y,k){s[y]=!0}),s}function d(o,s,y){if(o.customInspect&&s&&C(s.inspect)&&s.inspect!==e.inspect&&!(s.constructor&&s.constructor.prototype===s)){var k=s.inspect(y,o);return D(k)||(k=d(o,k,y)),k}var R=A(o,s);if(R)return R;var F=Object.keys(s),T=S(F);if(o.showHidden&&(F=Object.getOwnPropertyNames(s)),M(s)&&(F.indexOf("message")>=0||F.indexOf("description")>=0))return E(s);if(F.length===0){if(C(s)){var O=s.name?": "+s.name:"";return o.stylize("[Function"+O+"]","special")}if(Q(s))return o.stylize(RegExp.prototype.toString.call(s),"regexp");if(W(s))return o.stylize(Date.prototype.toString.call(s),"date");if(M(s))return E(s)}var P="",B=!1,q=["{","}"];if(p(s)&&(B=!0,q=["[","]"]),C(s)){var $=s.name?": "+s.name:"";P=" [Function"+$+"]"}if(Q(s)&&(P=" "+RegExp.prototype.toString.call(s)),W(s)&&(P=" "+Date.prototype.toUTCString.call(s)),M(s)&&(P=" "+E(s)),F.length===0&&(!B||s.length==0))return q[0]+P+q[1];if(y<0)return Q(s)?o.stylize(RegExp.prototype.toString.call(s),"regexp"):o.stylize("[Object]","special");o.seen.push(s);var L;return B?L=w(o,s,y,T,F):L=F.map(function(N){return g(o,s,y,T,N,B)}),o.seen.pop(),h(L,P,q)}function A(o,s){if(V(s))return o.stylize("undefined","undefined");if(D(s)){var y="'"+JSON.stringify(s).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return o.stylize(y,"string")}if(U(s))return o.stylize(""+s,"number");if(v(s))return o.stylize(""+s,"boolean");if(b(s))return o.stylize("null","null")}function E(o){return"["+Error.prototype.toString.call(o)+"]"}function w(o,s,y,k,R){for(var F=[],T=0,O=s.length;T<O;++T)Z(s,String(T))?F.push(g(o,s,y,k,String(T),!0)):F.push("");return R.forEach(function(P){P.match(/^\d+$/)||F.push(g(o,s,y,k,P,!0))}),F}function g(o,s,y,k,R,F){var T,O,P;if(P=Object.getOwnPropertyDescriptor(s,R)||{value:s[R]},P.get?P.set?O=o.stylize("[Getter/Setter]","special"):O=o.stylize("[Getter]","special"):P.set&&(O=o.stylize("[Setter]","special")),Z(k,R)||(T="["+R+"]"),O||(o.seen.indexOf(P.value)<0?(b(y)?O=d(o,P.value,null):O=d(o,P.value,y-1),O.indexOf(`
`)>-1&&(F?O=O.split(`
`).map(function(B){return"  "+B}).join(`
`).slice(2):O=`
`+O.split(`
`).map(function(B){return"   "+B}).join(`
`))):O=o.stylize("[Circular]","special")),V(T)){if(F&&R.match(/^\d+$/))return O;T=JSON.stringify(""+R),T.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(T=T.slice(1,-1),T=o.stylize(T,"name")):(T=T.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),T=o.stylize(T,"string"))}return T+": "+O}function h(o,s,y){var k=o.reduce(function(R,F){return F.indexOf(`
`)>=0,R+F.replace(/\u001b\[\d\d?m/g,"").length+1},0);return k>60?y[0]+(s===""?"":s+`
 `)+" "+o.join(`,
  `)+" "+y[1]:y[0]+s+" "+o.join(", ")+" "+y[1]}e.types=gi();function p(o){return Array.isArray(o)}e.isArray=p;function v(o){return typeof o=="boolean"}e.isBoolean=v;function b(o){return o===null}e.isNull=b;function I(o){return o==null}e.isNullOrUndefined=I;function U(o){return typeof o=="number"}e.isNumber=U;function D(o){return typeof o=="string"}e.isString=D;function j(o){return typeof o=="symbol"}e.isSymbol=j;function V(o){return o===void 0}e.isUndefined=V;function Q(o){return z(o)&&ee(o)==="[object RegExp]"}e.isRegExp=Q,e.types.isRegExp=Q;function z(o){return typeof o=="object"&&o!==null}e.isObject=z;function W(o){return z(o)&&ee(o)==="[object Date]"}e.isDate=W,e.types.isDate=W;function M(o){return z(o)&&(ee(o)==="[object Error]"||o instanceof Error)}e.isError=M,e.types.isNativeError=M;function C(o){return typeof o=="function"}e.isFunction=C;function G(o){return o===null||typeof o=="boolean"||typeof o=="number"||typeof o=="string"||typeof o=="symbol"||typeof o>"u"}e.isPrimitive=G,e.isBuffer=di();function ee(o){return Object.prototype.toString.call(o)}function J(o){return o<10?"0"+o.toString(10):o.toString(10)}var te=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function H(){var o=new Date,s=[J(o.getHours()),J(o.getMinutes()),J(o.getSeconds())].join(":");return[o.getDate(),te[o.getMonth()],s].join(" ")}e.log=function(){console.log("%s - %s",H(),e.format.apply(e,arguments))},e.inherits=hi(),e._extend=function(o,s){if(!s||!z(s))return o;for(var y=Object.keys(s),k=y.length;k--;)o[y[k]]=s[y[k]];return o};function Z(o,s){return Object.prototype.hasOwnProperty.call(o,s)}var x=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(s){if(typeof s!="function")throw new TypeError('The "original" argument must be of type Function');if(x&&s[x]){var y=s[x];if(typeof y!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(y,x,{value:y,enumerable:!1,writable:!1,configurable:!0}),y}function y(){for(var k,R,F=new Promise(function(P,B){k=P,R=B}),T=[],O=0;O<arguments.length;O++)T.push(arguments[O]);T.push(function(P,B){P?R(P):k(B)});try{s.apply(this,T)}catch(P){R(P)}return F}return Object.setPrototypeOf(y,Object.getPrototypeOf(s)),x&&Object.defineProperty(y,x,{value:y,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(y,t(s))},e.promisify.custom=x;function ne(o,s){if(!o){var y=new Error("Promise was rejected with a falsy value");y.reason=o,o=y}return s(o)}function K(o){if(typeof o!="function")throw new TypeError('The "original" argument must be of type Function');function s(){for(var y=[],k=0;k<arguments.length;k++)y.push(arguments[k]);var R=y.pop();if(typeof R!="function")throw new TypeError("The last argument must be of type Function");var F=this,T=function(){return R.apply(F,arguments)};o.apply(this,y).then(function(O){process.nextTick(T.bind(null,null,O))},function(O){process.nextTick(ne.bind(null,O,T))})}return Object.setPrototypeOf(s,Object.getPrototypeOf(o)),Object.defineProperties(s,t(o)),s}e.callbackify=K})(Ie)),Ie}var nn;function bi(){if(nn)return ae.exports;nn=1,ae.exports=E,ae.exports.sync=w,ae.exports._getTmpname=l,ae.exports._cleanupOnExit=m;const e=Pe,r=Fn(),{onExit:t}=qn(),n=Pe,{promisify:i}=mi(),a={},u=(function(){try{return Pe.threadId}catch{return 0}})();let f=0;function l(g){return g+"."+r(__filename).hash(String(process.pid)).hash(String(u)).hash(String(++f)).result()}function m(g){return()=>{try{e.unlinkSync(typeof g=="function"?g():g)}catch{}}}function S(g){return new Promise(h=>{a[g]||(a[g]=[]),a[g].push(h),a[g].length===1&&h()})}function d(g){return g.code==="ENOSYS"||(!process.getuid||process.getuid()!==0)&&(g.code==="EINVAL"||g.code==="EPERM")}async function A(g,h,p={}){typeof p=="string"&&(p={encoding:p});let v,b;const I=t(m(()=>b)),U=n.resolve(g);try{await S(U);const D=await i(e.realpath)(g).catch(()=>g);if(b=l(D),!p.mode||!p.chown){const j=await i(e.stat)(D).catch(()=>{});j&&(p.mode==null&&(p.mode=j.mode),p.chown==null&&process.getuid&&(p.chown={uid:j.uid,gid:j.gid}))}v=await i(e.open)(b,"w",p.mode),p.tmpfileCreated&&await p.tmpfileCreated(b),ArrayBuffer.isView(h)?await i(e.write)(v,h,0,h.length,0):h!=null&&await i(e.write)(v,String(h),0,String(p.encoding||"utf8")),p.fsync!==!1&&await i(e.fsync)(v),await i(e.close)(v),v=null,p.chown&&await i(e.chown)(b,p.chown.uid,p.chown.gid).catch(j=>{if(!d(j))throw j}),p.mode&&await i(e.chmod)(b,p.mode).catch(j=>{if(!d(j))throw j}),await i(e.rename)(b,D)}finally{v&&await i(e.close)(v).catch(()=>{}),I(),await i(e.unlink)(b).catch(()=>{}),a[U].shift(),a[U].length>0?a[U][0]():delete a[U]}}async function E(g,h,p,v){p instanceof Function&&(v=p,p={});const b=A(g,h,p);if(v)try{const I=await b;return v(I)}catch(I){return v(I)}return b}function w(g,h,p){typeof p=="string"?p={encoding:p}:p||(p={});try{g=e.realpathSync(g)}catch{}const v=l(g);if(!p.mode||!p.chown)try{const j=e.statSync(g);p=Object.assign({},p),p.mode||(p.mode=j.mode),!p.chown&&process.getuid&&(p.chown={uid:j.uid,gid:j.gid})}catch{}let b;const I=m(v),U=t(I);let D=!0;try{if(b=e.openSync(v,"w",p.mode||438),p.tmpfileCreated&&p.tmpfileCreated(v),ArrayBuffer.isView(h)?e.writeSync(b,h,0,h.length,0):h!=null&&e.writeSync(b,String(h),0,String(p.encoding||"utf8")),p.fsync!==!1&&e.fsyncSync(b),e.closeSync(b),b=null,p.chown)try{e.chownSync(v,p.chown.uid,p.chown.gid)}catch(j){if(!d(j))throw j}if(p.mode)try{e.chmodSync(v,p.mode)}catch(j){if(!d(j))throw j}e.renameSync(v,g),D=!1}finally{if(b)try{e.closeSync(b)}catch{}U(),D&&I()}}return ae.exports}var vi=bi(),on=bn(vi),Ai={};class wi{constructor(r){const t=Ai.CMUX_TEST_ROOT;this.rootDir=r??t??(void 0)((void 0)(),".cmux"),this.sessionsDir=(void 0)(this.rootDir,"sessions"),this.srcDir=(void 0)(this.rootDir,"src"),this.configFile=(void 0)(this.rootDir,"config.json"),this.providersFile=(void 0)(this.rootDir,"providers.jsonc"),this.secretsFile=(void 0)(this.rootDir,"secrets.json")}loadConfigOrDefault(){try{(void 0)(this.configFile)}catch(r){console.error("Error loading config:",r)}return{projects:new Map}}saveConfig(r){try{(void 0)(this.rootDir)||(void 0)(this.rootDir,{recursive:!0});const t={projects:Array.from(r.projects.entries())};on.sync(this.configFile,JSON.stringify(t,null,2))}catch(t){console.error("Error saving config:",t)}}editConfig(r){const t=this.loadConfigOrDefault(),n=r(t);this.saveConfig(n)}getProjectName(r){return r.split("/").pop()??r.split("\\").pop()??"unknown"}generateStableId(){return(void 0)(5).toString("hex")}generateLegacyId(r,t){const n=this.getProjectName(r),i=t.split("/").pop()??t.split("\\").pop()??"unknown";return`${n}-${i}`}addPathsToMetadata(r,t,n){return{...r,namedWorkspacePath:t}}findWorkspace(r){const t=this.loadConfigOrDefault();for(const[n,i]of t.projects)for(const a of i.workspaces){if(a.id===r)return{workspacePath:a.path,projectPath:n};if(!a.id){const u=a.path.split("/").pop()??a.path.split("\\").pop()??"unknown";if((void 0)((void 0)(this.getSessionDir(u),"metadata.json")),this.generateLegacyId(n,a.path)===r)return{workspacePath:a.path,projectPath:n}}}return null}getSessionDir(r){return(void 0)(this.sessionsDir,r)}getAllWorkspaceMetadata(){const r=this.loadConfigOrDefault(),t=[];let n=!1;for(const[i,a]of r.projects){const u=this.getProjectName(i);for(const f of a.workspaces){const l=f.path.split("/").pop()??f.path.split("\\").pop()??"unknown";try{if(f.id&&f.name){const A={id:f.id,name:f.name,projectName:u,projectPath:i,createdAt:f.createdAt??new Date().toISOString(),runtimeConfig:f.runtimeConfig};f.createdAt||(f.createdAt=A.createdAt,n=!0),t.push(this.addPathsToMetadata(A,f.path,i));continue}const m=this.generateLegacyId(i,f.path),S=(void 0)(this.getSessionDir(m),"metadata.json");let d=!1;if((void 0)(S),!d){const E={id:this.generateLegacyId(i,f.path),name:l,projectName:u,projectPath:i,createdAt:new Date().toISOString()};f.id=E.id,f.name=E.name,f.createdAt=E.createdAt,n=!0,t.push(this.addPathsToMetadata(E,f.path,i))}}catch(m){console.error("Failed to load/migrate workspace metadata:",m);const d={id:this.generateLegacyId(i,f.path),name:l,projectName:u,projectPath:i,createdAt:new Date().toISOString()};t.push(this.addPathsToMetadata(d,f.path,i))}}}return n&&this.saveConfig(r),t}addWorkspace(r,t){this.editConfig(n=>{let i=n.projects.get(r);i||(i={workspaces:[]},n.projects.set(r,i));const a=i.workspaces.findIndex(m=>m.id===t.id),u=this.getProjectName(r),l={path:(void 0)(this.srcDir,u,t.name),id:t.id,name:t.name,createdAt:t.createdAt};return a>=0?i.workspaces[a]=l:i.workspaces.push(l),n})}loadProvidersConfig(){try{(void 0)(this.providersFile)}catch(r){console.error("Error loading providers config:",r)}return null}saveProvidersConfig(r){try{(void 0)(this.rootDir)||(void 0)(this.rootDir,{recursive:!0});const n=`// Providers configuration for cmux
// Configure your AI providers here
// Example:
// {
//   "anthropic": {
//     "apiKey": "sk-...",
//     "baseUrl": "https://api.anthropic.com"
//   }
// }
${JSON.stringify(r,null,2)}`;(void 0)(this.providersFile,n)}catch(t){throw console.error("Error saving providers config:",t),t}}loadSecretsConfig(){try{(void 0)(this.secretsFile)}catch(r){console.error("Error loading secrets config:",r)}return{}}saveSecretsConfig(r){try{(void 0)(this.rootDir)||(void 0)(this.rootDir,{recursive:!0}),on.sync(this.secretsFile,JSON.stringify(r,null,2))}catch(t){throw console.error("Error saving secrets config:",t),t}}getProjectSecrets(r){return this.loadSecretsConfig()[r]??[]}updateProjectSecrets(r,t){const n=this.loadSecretsConfig();n[r]=t,this.saveSecretsConfig(n)}}const Si=new wi;function Oi(e){if(!e)return!1;const r=e.toLowerCase();return r==="1"||r==="true"||r==="yes"}var Ti={};const an=(void 0)(Si.rootDir,"debug_obj");function Ur(){return Oi(Ti.CMUX_DEBUG)}function ji(){return process.stdout.isTTY??!1}function Pi(){const e=new Date;let r=e.getHours();const t=e.getMinutes(),n=e.getMilliseconds(),i=r>=12?"PM":"AM";r=r%12,r=r||12;const a=String(t).padStart(2,"0"),u=String(n).padStart(3,"0");return`${r}:${a}.${u}${i}`}function Ei(){const r=new Error().stack?.split(`
`);if(r&&r.length>4){const t=r[4],n=/\((.+):(\d+):\d+\)/.exec(t)??/at (.+):(\d+):\d+/.exec(t);if(n){const[,i,a]=n;return`${i.replace(/^.*\/cmux\//,"")}:${a}`}}return"unknown:0"}function le(e,...r){const t=Pi(),n=Ei(),i=ji();let a;if(i){const u=Ae.dim(t),f=Ae.cyan(n);e==="error"?a=`${u} ${f}`:e==="debug"?a=`${u} ${Ae.gray(n)}`:a=`${u} ${f}`}else a=`${t} ${n}`;try{e==="error"?i?console.error(a,...r.map(u=>typeof u=="string"?Ae.red(u):u)):console.error(a,...r):e==="debug"?Ur()&&console.log(a,...r):console.log(a,...r)}catch(u){const f=u&&typeof u=="object"&&"code"in u?u.code:void 0,l=u&&typeof u=="object"&&"message"in u?String(u.message):"Unknown error";if(f!=="EPIPE")try{(e==="error"?process.stderr:process.stdout).write(`${t} ${n} Console error: ${l}
`)}catch{}}}function ki(e,r){if(Ur())try{(void 0)(an,{recursive:!0});const t=(void 0)(an,e);(void 0)((void 0)(t),{recursive:!0}),(void 0)(t,JSON.stringify(r,null,2),"utf-8"),le("debug",`Dumped object to ${t}`)}catch(t){le("error",`Failed to dump debug object to ${e}:`,t)}}const Ii={info:(...e)=>{le("info",...e)},error:(...e)=>{le("error",...e)},debug:(...e)=>{le("debug",...e)},debug_obj:ki,isDebugMode:Ur};export{Ii as log};
//# sourceMappingURL=log-RdxAqbty.js.map
