@minimax-ai/code 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
1
  import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
2
- import{n as kr}from"./chunk-Z4VKGZFA.js";import{a as ue,c as S,e as xr}from"./chunk-D76SO2ME.js";var Kl=S((g_,Ul)=>{var Me=ue("constants"),gy=process.cwd,Yn=null,by=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Yn||(Yn=gy.call(process)),Yn};try{process.cwd()}catch{}typeof process.chdir=="function"&&(jr=process.chdir,process.chdir=function(e){Yn=null,jr.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,jr));var jr;Ul.exports=Sy;function Sy(e){Me.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=l(e.statSync),e.fstatSync=l(e.fstatSync),e.lstatSync=l(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(u,f,d){d&&process.nextTick(d)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(u,f,d,p){p&&process.nextTick(p)},e.lchownSync=function(){}),by==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(u){function f(d,p,y){var m=Date.now(),h=0;u(d,p,function g(b){if(b&&(b.code==="EACCES"||b.code==="EPERM"||b.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(p,function(v,x){v&&v.code==="ENOENT"?u(d,p,g):y(b)})},h),h<100&&(h+=10);return}y&&y(b)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(u){function f(d,p,y,m,h,g){var b;if(g&&typeof g=="function"){var v=0;b=function(x,k,C){if(x&&x.code==="EAGAIN"&&v<10)return v++,u.call(e,d,p,y,m,h,b);g.apply(this,arguments)}}return u.call(e,d,p,y,m,h,b)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(u){return function(f,d,p,y,m){for(var h=0;;)try{return u.call(e,f,d,p,y,m)}catch(g){if(g.code==="EAGAIN"&&h<10){h++;continue}throw g}}})(e.readSync);function t(u){u.lchmod=function(f,d,p){u.open(f,Me.O_WRONLY|Me.O_SYMLINK,d,function(y,m){if(y){p&&p(y);return}u.fchmod(m,d,function(h){u.close(m,function(g){p&&p(h||g)})})})},u.lchmodSync=function(f,d){var p=u.openSync(f,Me.O_WRONLY|Me.O_SYMLINK,d),y=!0,m;try{m=u.fchmodSync(p,d),y=!1}finally{if(y)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}}function n(u){Me.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,d,p,y){u.open(f,Me.O_SYMLINK,function(m,h){if(m){y&&y(m);return}u.futimes(h,d,p,function(g){u.close(h,function(b){y&&y(g||b)})})})},u.lutimesSync=function(f,d,p){var y=u.openSync(f,Me.O_SYMLINK),m,h=!0;try{m=u.futimesSync(y,d,p),h=!1}finally{if(h)try{u.closeSync(y)}catch{}else u.closeSync(y)}return m}):u.futimes&&(u.lutimes=function(f,d,p,y){y&&process.nextTick(y)},u.lutimesSync=function(){})}function i(u){return u&&function(f,d,p){return u.call(e,f,d,function(y){c(y)&&(y=null),p&&p.apply(this,arguments)})}}function r(u){return u&&function(f,d){try{return u.call(e,f,d)}catch(p){if(!c(p))throw p}}}function o(u){return u&&function(f,d,p,y){return u.call(e,f,d,p,function(m){c(m)&&(m=null),y&&y.apply(this,arguments)})}}function s(u){return u&&function(f,d,p){try{return u.call(e,f,d,p)}catch(y){if(!c(y))throw y}}}function a(u){return u&&function(f,d,p){typeof d=="function"&&(p=d,d=null);function y(m,h){h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),p&&p.apply(this,arguments)}return d?u.call(e,f,d,y):u.call(e,f,y)}}function l(u){return u&&function(f,d){var p=d?u.call(e,f,d):u.call(e,f);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function c(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Gl=S((b_,Yl)=>{var Vl=ue("stream").Stream;Yl.exports=vy;function vy(e){return{ReadStream:t,WriteStream:n};function t(i,r){if(!(this instanceof t))return new t(i,r);Vl.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var s=Object.keys(r),a=0,l=s.length;a<l;a++){var c=s[a];this[c]=r[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(u,f){if(u){o.emit("error",u),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function n(i,r){if(!(this instanceof n))return new n(i,r);Vl.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var o=Object.keys(r),s=0,a=o.length;s<a;s++){var l=o[s];this[l]=r[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Hl=S((S_,Wl)=>{"use strict";Wl.exports=wy;var Ay=Object.getPrototypeOf||function(e){return e.__proto__};function wy(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Ay(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}});var Yr=S((v_,Vr)=>{var F=ue("fs"),_y=Kl(),Ey=Gl(),xy=Hl(),Gn=ue("util"),z,Hn;typeof Symbol=="function"&&typeof Symbol.for=="function"?(z=Symbol.for("graceful-fs.queue"),Hn=Symbol.for("graceful-fs.previous")):(z="___graceful-fs.queue",Hn="___graceful-fs.previous");function ky(){}function Ql(e,t){Object.defineProperty(e,z,{get:function(){return t}})}var Ze=ky;Gn.debuglog?Ze=Gn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ze=function(){var e=Gn.format.apply(Gn,arguments);e="GFS4: "+e.split(/\n/).join(`
3
- GFS4: `),console.error(e)});F[z]||(Jl=global[z]||[],Ql(F,Jl),F.close=(function(e){function t(n,i){return e.call(F,n,function(r){r||Xl(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,Hn,{value:e}),t})(F.close),F.closeSync=(function(e){function t(n){e.apply(F,arguments),Xl()}return Object.defineProperty(t,Hn,{value:e}),t})(F.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ze(F[z]),ue("assert").equal(F[z].length,0)}));var Jl;global[z]||Ql(global,F[z]);Vr.exports=Ur(xy(F));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F.__patched&&(Vr.exports=Ur(F),F.__patched=!0);function Ur(e){_y(e),e.gracefulify=Ur,e.createReadStream=k,e.createWriteStream=C;var t=e.readFile;e.readFile=n;function n(A,O,E){return typeof O=="function"&&(E=O,O=null),T(A,O,E);function T($,G,D,q){return t($,G,function(N){N&&(N.code==="EMFILE"||N.code==="ENFILE")?bt([T,[$,G,D],N,q||Date.now(),Date.now()]):typeof D=="function"&&D.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=r;function r(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(G,D,q,N,X){return i(G,D,q,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?bt([$,[G,D,q,N],P,X||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=s);function s(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(G,D,q,N,X){return o(G,D,q,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?bt([$,[G,D,q,N],P,X||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var a=e.copyFile;a&&(e.copyFile=l);function l(A,O,E,T){return typeof E=="function"&&(T=E,E=0),$(A,O,E,T);function $(G,D,q,N,X){return a(G,D,q,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?bt([$,[G,D,q,N],P,X||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var c=e.readdir;e.readdir=f;var u=/^v[0-5]\./;function f(A,O,E){typeof O=="function"&&(E=O,O=null);var T=u.test(process.version)?function(D,q,N,X){return c(D,$(D,q,N,X))}:function(D,q,N,X){return c(D,q,$(D,q,N,X))};return T(A,O,E);function $(G,D,q,N){return function(X,P){X&&(X.code==="EMFILE"||X.code==="ENFILE")?bt([T,[G,D,q],X,N||Date.now(),Date.now()]):(P&&P.sort&&P.sort(),typeof q=="function"&&q.call(this,X,P))}}}if(process.version.substr(0,4)==="v0.8"){var d=Ey(e);g=d.ReadStream,v=d.WriteStream}var p=e.ReadStream;p&&(g.prototype=Object.create(p.prototype),g.prototype.open=b);var y=e.WriteStream;y&&(v.prototype=Object.create(y.prototype),v.prototype.open=x),Object.defineProperty(e,"ReadStream",{get:function(){return g},set:function(A){g=A},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(A){v=A},enumerable:!0,configurable:!0});var m=g;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var h=v;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(A){h=A},enumerable:!0,configurable:!0});function g(A,O){return this instanceof g?(p.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function b(){var A=this;w(A.path,A.flags,A.mode,function(O,E){O?(A.autoClose&&A.destroy(),A.emit("error",O)):(A.fd=E,A.emit("open",E),A.read())})}function v(A,O){return this instanceof v?(y.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function x(){var A=this;w(A.path,A.flags,A.mode,function(O,E){O?(A.destroy(),A.emit("error",O)):(A.fd=E,A.emit("open",E))})}function k(A,O){return new e.ReadStream(A,O)}function C(A,O){return new e.WriteStream(A,O)}var L=e.open;e.open=w;function w(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(G,D,q,N,X){return L(G,D,q,function(P,u_){P&&(P.code==="EMFILE"||P.code==="ENFILE")?bt([$,[G,D,q,N],P,X||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}return e}function bt(e){Ze("ENQUEUE",e[0].name,e[1]),F[z].push(e),Kr()}var Wn;function Xl(){for(var e=Date.now(),t=0;t<F[z].length;++t)F[z][t].length>2&&(F[z][t][3]=e,F[z][t][4]=e);Kr()}function Kr(){if(clearTimeout(Wn),Wn=void 0,F[z].length!==0){var e=F[z].shift(),t=e[0],n=e[1],i=e[2],r=e[3],o=e[4];if(r===void 0)Ze("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-r>=6e4){Ze("TIMEOUT",t.name,n);var s=n.pop();typeof s=="function"&&s.call(null,i)}else{var a=Date.now()-o,l=Math.max(o-r,1),c=Math.min(l*1.2,100);a>=c?(Ze("RETRY",t.name,n),t.apply(null,n.concat([r]))):F[z].push(e)}Wn===void 0&&(Wn=setTimeout(Kr,0))}}});var Zl=S((A_,zl)=>{function fe(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}zl.exports=fe;fe.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};fe.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};fe.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var i=this,r=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},n);return this._options.unref&&r.unref(),!0};fe.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};fe.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};fe.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};fe.prototype.start=fe.prototype.try;fe.prototype.errors=function(){return this._errors};fe.prototype.attempts=function(){return this._attempts};fe.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,i=0;i<this._errors.length;i++){var r=this._errors[i],o=r.message,s=(e[o]||0)+1;e[o]=s,s>=n&&(t=r,n=s)}return t}});var ec=S(et=>{var Cy=Zl();et.operation=function(e){var t=et.timeouts(e);return new Cy(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};et.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],r=0;r<t.retries;r++)i.push(this.createTimeout(r,t));return e&&e.forever&&!i.length&&i.push(this.createTimeout(r,t)),i.sort(function(o,s){return o-s}),i};et.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,i=Math.round(n*t.minTimeout*Math.pow(t.factor,e));return i=Math.min(i,t.maxTimeout),i};et.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n){n=[];for(var i in e)typeof e[i]=="function"&&n.push(i)}for(var r=0;r<n.length;r++){var o=n[r],s=e[o];e[o]=function(l){var c=et.operation(t),u=Array.prototype.slice.call(arguments,1),f=u.pop();u.push(function(d){c.retry(d)||(d&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){l.apply(e,u)})}.bind(e,s),e[o].options=t}}});var nc=S((__,tc)=>{tc.exports=ec()});var ic=S((E_,Jn)=>{Jn.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Jn.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Jn.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var lc=S((x_,At)=>{var R=global.process,tt=function(e){return 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"};tt(R)?(rc=ue("assert"),St=ic(),oc=/^win/i.test(R.platform),Qt=ue("events"),typeof Qt!="function"&&(Qt=Qt.EventEmitter),R.__signal_exit_emitter__?H=R.__signal_exit_emitter__:(H=R.__signal_exit_emitter__=new Qt,H.count=0,H.emitted={}),H.infinite||(H.setMaxListeners(1/0),H.infinite=!0),At.exports=function(e,t){if(!tt(global.process))return function(){};rc.equal(typeof e,"function","a callback must be provided for exit handler"),vt===!1&&Gr();var n="exit";t&&t.alwaysLast&&(n="afterexit");var i=function(){H.removeListener(n,e),H.listeners("exit").length===0&&H.listeners("afterexit").length===0&&Xn()};return H.on(n,e),i},Xn=function(){!vt||!tt(global.process)||(vt=!1,St.forEach(function(t){try{R.removeListener(t,Qn[t])}catch{}}),R.emit=zn,R.reallyExit=Wr,H.count-=1)},At.exports.unload=Xn,nt=function(t,n,i){H.emitted[t]||(H.emitted[t]=!0,H.emit(t,n,i))},Qn={},St.forEach(function(e){Qn[e]=function(){if(tt(global.process)){var n=R.listeners(e);n.length===H.count&&(Xn(),nt("exit",null,e),nt("afterexit",null,e),oc&&e==="SIGHUP"&&(e="SIGINT"),R.kill(R.pid,e))}}}),At.exports.signals=function(){return St},vt=!1,Gr=function(){vt||!tt(global.process)||(vt=!0,H.count+=1,St=St.filter(function(t){try{return R.on(t,Qn[t]),!0}catch{return!1}}),R.emit=ac,R.reallyExit=sc)},At.exports.load=Gr,Wr=R.reallyExit,sc=function(t){tt(global.process)&&(R.exitCode=t||0,nt("exit",R.exitCode,null),nt("afterexit",R.exitCode,null),Wr.call(R,R.exitCode))},zn=R.emit,ac=function(t,n){if(t==="exit"&&tt(global.process)){n!==void 0&&(R.exitCode=n);var i=zn.apply(this,arguments);return nt("exit",R.exitCode,null),nt("afterexit",R.exitCode,null),i}else return zn.apply(this,arguments)}):At.exports=function(){return function(){}};var rc,St,oc,Qt,H,Xn,nt,Qn,vt,Gr,Wr,sc,zn,ac});var uc=S((k_,Hr)=>{"use strict";var cc=Symbol();function Oy(e,t,n){let i=t[cc];if(i)return t.stat(e,(o,s)=>{if(o)return n(o);n(null,s.mtime,i)});let r=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,r,r,o=>{if(o)return n(o);t.stat(e,(s,a)=>{if(s)return n(s);let l=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,cc,{value:l}),n(null,a.mtime,l)})})}function Ty(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}Hr.exports.probe=Oy;Hr.exports.getMtime=Ty});var hc=S((C_,Zt)=>{"use strict";var Iy=ue("path"),Qr=Yr(),Ly=nc(),My=lc(),fc=uc(),Ee={};function zt(e,t){return t.lockfilePath||`${e}.lock`}function zr(e,t,n){if(!t.realpath)return n(null,Iy.resolve(e));t.fs.realpath(e,n)}function Xr(e,t,n){let i=zt(e,t);t.fs.mkdir(i,r=>{if(!r)return fc.probe(i,t.fs,(o,s,a)=>{if(o)return t.fs.rmdir(i,()=>{}),n(o);n(null,s,a)});if(r.code!=="EEXIST")return n(r);if(t.stale<=0)return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(i,(o,s)=>{if(o)return o.code==="ENOENT"?Xr(e,{...t,stale:0},n):n(o);if(!dc(s,t))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));pc(e,t,a=>{if(a)return n(a);Xr(e,{...t,stale:0},n)})})})}function dc(e,t){return e.mtime.getTime()<Date.now()-t.stale}function pc(e,t,n){t.fs.rmdir(zt(e,t),i=>{if(i&&i.code!=="ENOENT")return n(i);n()})}function Zn(e,t){let n=Ee[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(i,r)=>{let o=n.lastUpdate+t.stale<Date.now();if(i)return i.code==="ENOENT"||o?Jr(e,n,Object.assign(i,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,Zn(e,t));if(!(n.mtime.getTime()===r.mtime.getTime()))return Jr(e,n,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=fc.getMtime(n.mtimePrecision);t.fs.utimes(n.lockfilePath,a,a,l=>{let c=n.lastUpdate+t.stale<Date.now();if(!n.released){if(l)return l.code==="ENOENT"||c?Jr(e,n,Object.assign(l,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,Zn(e,t));n.mtime=a,n.lastUpdate=Date.now(),n.updateDelay=null,Zn(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function Jr(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),Ee[e]===t&&delete Ee[e],t.options.onCompromised(n)}function Ny(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:Qr,onCompromised:i=>{throw i},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),zr(e,t,(i,r)=>{if(i)return n(i);let o=Ly.operation(t.retries);o.attempt(()=>{Xr(r,t,(s,a,l)=>{if(o.retry(s))return;if(s)return n(o.mainError());let c=Ee[r]={lockfilePath:zt(r,t),mtime:a,mtimePrecision:l,options:t,lastUpdate:Date.now()};Zn(r,t),n(null,u=>{if(c.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));mc(r,{...t,realpath:!1},u)})})})})}function mc(e,t,n){t={fs:Qr,realpath:!0,...t},zr(e,t,(i,r)=>{if(i)return n(i);let o=Ee[r];if(!o)return n(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete Ee[r],pc(r,t,n)})}function Py(e,t,n){t={stale:1e4,realpath:!0,fs:Qr,...t},t.stale=Math.max(t.stale||0,2e3),zr(e,t,(i,r)=>{if(i)return n(i);t.fs.stat(zt(r,t),(o,s)=>o?o.code==="ENOENT"?n(null,!1):n(o):n(null,!dc(s,t)))})}function Ry(){return Ee}My(()=>{for(let e in Ee){let t=Ee[e].options;try{t.fs.rmdirSync(zt(e,t))}catch{}}});Zt.exports.lock=Ny;Zt.exports.unlock=mc;Zt.exports.check=Py;Zt.exports.getLocks=Ry});var gc=S((O_,yc)=>{"use strict";var Dy=Yr();function Fy(e){let t=["mkdir","realpath","stat","rmdir","utimes"],n={...e};return t.forEach(i=>{n[i]=(...r)=>{let o=r.pop(),s;try{s=e[`${i}Sync`](...r)}catch(a){return o(a)}o(null,s)}}),n}function By(e){return(...t)=>new Promise((n,i)=>{t.push((r,o)=>{r?i(r):n(o)}),e(...t)})}function qy(e){return(...t)=>{let n,i;if(t.push((r,o)=>{n=r,i=o}),e(...t),n)throw n;return i}}function $y(e){if(e={...e},e.fs=Fy(e.fs||Dy),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}yc.exports={toPromise:By,toSync:qy,toSyncOptions:$y}});var eo=S((T_,Ne)=>{"use strict";var wt=hc(),{toPromise:ei,toSync:ti,toSyncOptions:Zr}=gc();async function bc(e,t){let n=await ei(wt.lock)(e,t);return ei(n)}function jy(e,t){let n=ti(wt.lock)(e,Zr(t));return ti(n)}function Uy(e,t){return ei(wt.unlock)(e,t)}function Ky(e,t){return ti(wt.unlock)(e,Zr(t))}function Vy(e,t){return ei(wt.check)(e,t)}function Yy(e,t){return ti(wt.check)(e,Zr(t))}Ne.exports=bc;Ne.exports.lock=bc;Ne.exports.unlock=Uy;Ne.exports.lockSync=jy;Ne.exports.unlockSync=Ky;Ne.exports.check=Vy;Ne.exports.checkSync=Yy});var I=S(Z=>{"use strict";var io=Symbol.for("yaml.alias"),_c=Symbol.for("yaml.document"),ni=Symbol.for("yaml.map"),Ec=Symbol.for("yaml.pair"),ro=Symbol.for("yaml.scalar"),ii=Symbol.for("yaml.seq"),xe=Symbol.for("yaml.node.type"),Jy=e=>!!e&&typeof e=="object"&&e[xe]===io,Xy=e=>!!e&&typeof e=="object"&&e[xe]===_c,Qy=e=>!!e&&typeof e=="object"&&e[xe]===ni,zy=e=>!!e&&typeof e=="object"&&e[xe]===Ec,xc=e=>!!e&&typeof e=="object"&&e[xe]===ro,Zy=e=>!!e&&typeof e=="object"&&e[xe]===ii;function kc(e){if(e&&typeof e=="object")switch(e[xe]){case ni:case ii:return!0}return!1}function eg(e){if(e&&typeof e=="object")switch(e[xe]){case io:case ni:case ro:case ii:return!0}return!1}var tg=e=>(xc(e)||kc(e))&&!!e.anchor;Z.ALIAS=io;Z.DOC=_c;Z.MAP=ni;Z.NODE_TYPE=xe;Z.PAIR=Ec;Z.SCALAR=ro;Z.SEQ=ii;Z.hasAnchor=tg;Z.isAlias=Jy;Z.isCollection=kc;Z.isDocument=Xy;Z.isMap=Qy;Z.isNode=eg;Z.isPair=zy;Z.isScalar=xc;Z.isSeq=Zy});var en=S(oo=>{"use strict";var V=I(),ae=Symbol("break visit"),Cc=Symbol("skip children"),Se=Symbol("remove node");function ri(e,t){let n=Oc(t);V.isDocument(e)?Et(null,e.contents,n,Object.freeze([e]))===Se&&(e.contents=null):Et(null,e,n,Object.freeze([]))}ri.BREAK=ae;ri.SKIP=Cc;ri.REMOVE=Se;function Et(e,t,n,i){let r=Tc(e,t,n,i);if(V.isNode(r)||V.isPair(r))return Ic(e,i,r),Et(e,r,n,i);if(typeof r!="symbol"){if(V.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=Et(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===Se&&(t.items.splice(o,1),o-=1)}}}else if(V.isPair(t)){i=Object.freeze(i.concat(t));let o=Et("key",t.key,n,i);if(o===ae)return ae;o===Se&&(t.key=null);let s=Et("value",t.value,n,i);if(s===ae)return ae;s===Se&&(t.value=null)}}return r}async function oi(e,t){let n=Oc(t);V.isDocument(e)?await xt(null,e.contents,n,Object.freeze([e]))===Se&&(e.contents=null):await xt(null,e,n,Object.freeze([]))}oi.BREAK=ae;oi.SKIP=Cc;oi.REMOVE=Se;async function xt(e,t,n,i){let r=await Tc(e,t,n,i);if(V.isNode(r)||V.isPair(r))return Ic(e,i,r),xt(e,r,n,i);if(typeof r!="symbol"){if(V.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=await xt(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===Se&&(t.items.splice(o,1),o-=1)}}}else if(V.isPair(t)){i=Object.freeze(i.concat(t));let o=await xt("key",t.key,n,i);if(o===ae)return ae;o===Se&&(t.key=null);let s=await xt("value",t.value,n,i);if(s===ae)return ae;s===Se&&(t.value=null)}}return r}function Oc(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Tc(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(V.isMap(t))return n.Map?.(e,t,i);if(V.isSeq(t))return n.Seq?.(e,t,i);if(V.isPair(t))return n.Pair?.(e,t,i);if(V.isScalar(t))return n.Scalar?.(e,t,i);if(V.isAlias(t))return n.Alias?.(e,t,i)}function Ic(e,t,n){let i=t[t.length-1];if(V.isCollection(i))i.items[e]=n;else if(V.isPair(i))e==="key"?i.key=n:i.value=n;else if(V.isDocument(i))i.contents=n;else{let r=V.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}oo.visit=ri;oo.visitAsync=oi});var so=S(Mc=>{"use strict";var Lc=I(),ng=en(),ig={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},rg=e=>e.replace(/[!,[\]{}]/g,t=>ig[t]),tn=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+rg(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&Lc.isNode(t.contents)){let o={};ng.visit(t.contents,(s,a)=>{Lc.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
4
- `)}};tn.defaultYaml={explicit:!1,version:"1.2"};tn.defaultTags={"!!":"tag:yaml.org,2002:"};Mc.Directives=tn});var si=S(nn=>{"use strict";var Nc=I(),og=en();function sg(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Pc(e){let t=new Set;return og.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function Rc(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function ag(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=Pc(e));let s=Rc(t,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(Nc.isScalar(s.node)||Nc.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}nn.anchorIsValid=sg;nn.anchorNames=Pc;nn.createNodeAnchors=ag;nn.findNewAnchor=Rc});var ao=S(Dc=>{"use strict";function rn(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r<o;++r){let s=i[r],a=rn(e,i,String(r),s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let o=i.get(r),s=rn(e,i,r,o);s===void 0?i.delete(r):s!==o&&i.set(r,s)}else if(i instanceof Set)for(let r of Array.from(i)){let o=rn(e,i,r,r);o===void 0?i.delete(r):o!==r&&(i.delete(r),i.add(o))}else for(let[r,o]of Object.entries(i)){let s=rn(e,i,r,o);s===void 0?delete i[r]:s!==o&&(i[r]=s)}return e.call(t,n,i)}Dc.applyReviver=rn});var Re=S(Bc=>{"use strict";var lg=I();function Fc(e,t,n){if(Array.isArray(e))return e.map((i,r)=>Fc(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!lg.hasAnchor(e))return e.toJSON(t,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}Bc.toJS=Fc});var ai=S($c=>{"use strict";var cg=ao(),qc=I(),ug=Re(),lo=class{constructor(t){Object.defineProperty(this,qc.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!qc.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=ug.toJS(this,"",s);if(typeof r=="function")for(let{count:l,res:c}of s.anchors.values())r(c,l);return typeof o=="function"?cg.applyReviver(o,{"":a},"",a):a}};$c.NodeBase=lo});var on=S(jc=>{"use strict";var fg=si(),dg=en(),kt=I(),pg=ai(),mg=Re(),co=class extends pg.NodeBase{constructor(t){super(kt.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],dg.visit(t,{Node:(o,s)=>{(kt.isAlias(s)||kt.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}return r}toJSON(t,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:o}=n,s=this.resolve(r,n);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(s);if(a||(mg.toJS(s,null,n),a=i.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=li(r,s,i)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,i){let r=`*${this.source}`;if(t){if(fg.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}};function li(e,t,n){if(kt.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(kt.isCollection(t)){let i=0;for(let r of t.items){let o=li(e,r,n);o>i&&(i=o)}return i}else if(kt.isPair(t)){let i=li(e,t.key,n),r=li(e,t.value,n);return Math.max(i,r)}return 1}jc.Alias=co});var U=S(uo=>{"use strict";var hg=I(),yg=ai(),gg=Re(),bg=e=>!e||typeof e!="function"&&typeof e!="object",De=class extends yg.NodeBase{constructor(t){super(hg.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:gg.toJS(this.value,t,n)}toString(){return String(this.value)}};De.BLOCK_FOLDED="BLOCK_FOLDED";De.BLOCK_LITERAL="BLOCK_LITERAL";De.PLAIN="PLAIN";De.QUOTE_DOUBLE="QUOTE_DOUBLE";De.QUOTE_SINGLE="QUOTE_SINGLE";uo.Scalar=De;uo.isScalarValue=bg});var sn=S(Kc=>{"use strict";var Sg=on(),rt=I(),Uc=U(),vg="tag:yaml.org,2002:";function Ag(e,t,n){if(t){let i=n.filter(o=>o.tag===t),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>i.identify?.(e)&&!i.format)}function wg(e,t,n){if(rt.isDocument(e)&&(e=e.contents),rt.isNode(e))return e;if(rt.isPair(e)){let f=n.schema[rt.MAP].createNode?.(n.schema,null,n);return f.items.push(e),f}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,l;if(i&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=r(e)),new Sg.Alias(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=vg+t.slice(2));let c=Ag(e,t,s.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let f=new Uc.Scalar(e);return l&&(l.node=f),f}c=e instanceof Map?s[rt.MAP]:Symbol.iterator in Object(e)?s[rt.SEQ]:s[rt.MAP]}o&&(o(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,e,n):new Uc.Scalar(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}Kc.createNode=wg});var ui=S(ci=>{"use strict";var _g=sn(),ve=I(),Eg=ai();function fo(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){let o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return _g.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Vc=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,po=class extends Eg.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>ve.isNode(i)||ve.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Vc(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(ve.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,fo(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){let[n,...i]=t;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(ve.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){let[i,...r]=t,o=this.get(i,!0);return r.length===0?!n&&ve.isScalar(o)?o.value:o:ve.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ve.isPair(n))return!1;let i=n.value;return i==null||t&&ve.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){let[n,...i]=t;if(i.length===0)return this.has(n);let r=this.get(n,!0);return ve.isCollection(r)?r.hasIn(i):!1}setIn(t,n){let[i,...r]=t;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(ve.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,fo(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};ci.Collection=po;ci.collectionFromPath=fo;ci.isEmptyPath=Vc});var an=S(fi=>{"use strict";var xg=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function mo(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var kg=(e,t,n)=>e.endsWith(`
2
+ import{n as kr}from"./chunk-Z4VKGZFA.js";import{a as ue,c as S,e as xr}from"./chunk-D76SO2ME.js";var Kl=S((g_,Ul)=>{var Me=ue("constants"),by=process.cwd,Yn=null,Sy=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Yn||(Yn=by.call(process)),Yn};try{process.cwd()}catch{}typeof process.chdir=="function"&&(jr=process.chdir,process.chdir=function(e){Yn=null,jr.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,jr));var jr;Ul.exports=vy;function vy(e){Me.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=l(e.statSync),e.fstatSync=l(e.fstatSync),e.lstatSync=l(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(u,f,d){d&&process.nextTick(d)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(u,f,d,p){p&&process.nextTick(p)},e.lchownSync=function(){}),Sy==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(u){function f(d,p,y){var m=Date.now(),h=0;u(d,p,function g(b){if(b&&(b.code==="EACCES"||b.code==="EPERM"||b.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(p,function(v,x){v&&v.code==="ENOENT"?u(d,p,g):y(b)})},h),h<100&&(h+=10);return}y&&y(b)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(u){function f(d,p,y,m,h,g){var b;if(g&&typeof g=="function"){var v=0;b=function(x,k,C){if(x&&x.code==="EAGAIN"&&v<10)return v++,u.call(e,d,p,y,m,h,b);g.apply(this,arguments)}}return u.call(e,d,p,y,m,h,b)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(u){return function(f,d,p,y,m){for(var h=0;;)try{return u.call(e,f,d,p,y,m)}catch(g){if(g.code==="EAGAIN"&&h<10){h++;continue}throw g}}})(e.readSync);function t(u){u.lchmod=function(f,d,p){u.open(f,Me.O_WRONLY|Me.O_SYMLINK,d,function(y,m){if(y){p&&p(y);return}u.fchmod(m,d,function(h){u.close(m,function(g){p&&p(h||g)})})})},u.lchmodSync=function(f,d){var p=u.openSync(f,Me.O_WRONLY|Me.O_SYMLINK,d),y=!0,m;try{m=u.fchmodSync(p,d),y=!1}finally{if(y)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}}function n(u){Me.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,d,p,y){u.open(f,Me.O_SYMLINK,function(m,h){if(m){y&&y(m);return}u.futimes(h,d,p,function(g){u.close(h,function(b){y&&y(g||b)})})})},u.lutimesSync=function(f,d,p){var y=u.openSync(f,Me.O_SYMLINK),m,h=!0;try{m=u.futimesSync(y,d,p),h=!1}finally{if(h)try{u.closeSync(y)}catch{}else u.closeSync(y)}return m}):u.futimes&&(u.lutimes=function(f,d,p,y){y&&process.nextTick(y)},u.lutimesSync=function(){})}function i(u){return u&&function(f,d,p){return u.call(e,f,d,function(y){c(y)&&(y=null),p&&p.apply(this,arguments)})}}function r(u){return u&&function(f,d){try{return u.call(e,f,d)}catch(p){if(!c(p))throw p}}}function o(u){return u&&function(f,d,p,y){return u.call(e,f,d,p,function(m){c(m)&&(m=null),y&&y.apply(this,arguments)})}}function s(u){return u&&function(f,d,p){try{return u.call(e,f,d,p)}catch(y){if(!c(y))throw y}}}function a(u){return u&&function(f,d,p){typeof d=="function"&&(p=d,d=null);function y(m,h){h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),p&&p.apply(this,arguments)}return d?u.call(e,f,d,y):u.call(e,f,y)}}function l(u){return u&&function(f,d){var p=d?u.call(e,f,d):u.call(e,f);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function c(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Gl=S((b_,Yl)=>{var Vl=ue("stream").Stream;Yl.exports=Ay;function Ay(e){return{ReadStream:t,WriteStream:n};function t(i,r){if(!(this instanceof t))return new t(i,r);Vl.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var s=Object.keys(r),a=0,l=s.length;a<l;a++){var c=s[a];this[c]=r[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(u,f){if(u){o.emit("error",u),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function n(i,r){if(!(this instanceof n))return new n(i,r);Vl.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var o=Object.keys(r),s=0,a=o.length;s<a;s++){var l=o[s];this[l]=r[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Hl=S((S_,Wl)=>{"use strict";Wl.exports=_y;var wy=Object.getPrototypeOf||function(e){return e.__proto__};function _y(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:wy(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}});var Yr=S((v_,Vr)=>{var F=ue("fs"),Ey=Kl(),xy=Gl(),ky=Hl(),Gn=ue("util"),z,Hn;typeof Symbol=="function"&&typeof Symbol.for=="function"?(z=Symbol.for("graceful-fs.queue"),Hn=Symbol.for("graceful-fs.previous")):(z="___graceful-fs.queue",Hn="___graceful-fs.previous");function Cy(){}function Ql(e,t){Object.defineProperty(e,z,{get:function(){return t}})}var Ze=Cy;Gn.debuglog?Ze=Gn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ze=function(){var e=Gn.format.apply(Gn,arguments);e="GFS4: "+e.split(/\n/).join(`
3
+ GFS4: `),console.error(e)});F[z]||(Jl=global[z]||[],Ql(F,Jl),F.close=(function(e){function t(n,i){return e.call(F,n,function(r){r||Xl(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,Hn,{value:e}),t})(F.close),F.closeSync=(function(e){function t(n){e.apply(F,arguments),Xl()}return Object.defineProperty(t,Hn,{value:e}),t})(F.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ze(F[z]),ue("assert").equal(F[z].length,0)}));var Jl;global[z]||Ql(global,F[z]);Vr.exports=Ur(ky(F));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F.__patched&&(Vr.exports=Ur(F),F.__patched=!0);function Ur(e){Ey(e),e.gracefulify=Ur,e.createReadStream=k,e.createWriteStream=C;var t=e.readFile;e.readFile=n;function n(A,O,E){return typeof O=="function"&&(E=O,O=null),T(A,O,E);function T($,G,D,q){return t($,G,function(N){N&&(N.code==="EMFILE"||N.code==="ENFILE")?bt([T,[$,G,D],N,q||Date.now(),Date.now()]):typeof D=="function"&&D.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=r;function r(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(G,D,q,N,X){return i(G,D,q,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?bt([$,[G,D,q,N],P,X||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=s);function s(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(G,D,q,N,X){return o(G,D,q,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?bt([$,[G,D,q,N],P,X||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var a=e.copyFile;a&&(e.copyFile=l);function l(A,O,E,T){return typeof E=="function"&&(T=E,E=0),$(A,O,E,T);function $(G,D,q,N,X){return a(G,D,q,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?bt([$,[G,D,q,N],P,X||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}var c=e.readdir;e.readdir=f;var u=/^v[0-5]\./;function f(A,O,E){typeof O=="function"&&(E=O,O=null);var T=u.test(process.version)?function(D,q,N,X){return c(D,$(D,q,N,X))}:function(D,q,N,X){return c(D,q,$(D,q,N,X))};return T(A,O,E);function $(G,D,q,N){return function(X,P){X&&(X.code==="EMFILE"||X.code==="ENFILE")?bt([T,[G,D,q],X,N||Date.now(),Date.now()]):(P&&P.sort&&P.sort(),typeof q=="function"&&q.call(this,X,P))}}}if(process.version.substr(0,4)==="v0.8"){var d=xy(e);g=d.ReadStream,v=d.WriteStream}var p=e.ReadStream;p&&(g.prototype=Object.create(p.prototype),g.prototype.open=b);var y=e.WriteStream;y&&(v.prototype=Object.create(y.prototype),v.prototype.open=x),Object.defineProperty(e,"ReadStream",{get:function(){return g},set:function(A){g=A},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return v},set:function(A){v=A},enumerable:!0,configurable:!0});var m=g;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var h=v;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(A){h=A},enumerable:!0,configurable:!0});function g(A,O){return this instanceof g?(p.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function b(){var A=this;w(A.path,A.flags,A.mode,function(O,E){O?(A.autoClose&&A.destroy(),A.emit("error",O)):(A.fd=E,A.emit("open",E),A.read())})}function v(A,O){return this instanceof v?(y.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function x(){var A=this;w(A.path,A.flags,A.mode,function(O,E){O?(A.destroy(),A.emit("error",O)):(A.fd=E,A.emit("open",E))})}function k(A,O){return new e.ReadStream(A,O)}function C(A,O){return new e.WriteStream(A,O)}var L=e.open;e.open=w;function w(A,O,E,T){return typeof E=="function"&&(T=E,E=null),$(A,O,E,T);function $(G,D,q,N,X){return L(G,D,q,function(P,u_){P&&(P.code==="EMFILE"||P.code==="ENFILE")?bt([$,[G,D,q,N],P,X||Date.now(),Date.now()]):typeof N=="function"&&N.apply(this,arguments)})}}return e}function bt(e){Ze("ENQUEUE",e[0].name,e[1]),F[z].push(e),Kr()}var Wn;function Xl(){for(var e=Date.now(),t=0;t<F[z].length;++t)F[z][t].length>2&&(F[z][t][3]=e,F[z][t][4]=e);Kr()}function Kr(){if(clearTimeout(Wn),Wn=void 0,F[z].length!==0){var e=F[z].shift(),t=e[0],n=e[1],i=e[2],r=e[3],o=e[4];if(r===void 0)Ze("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-r>=6e4){Ze("TIMEOUT",t.name,n);var s=n.pop();typeof s=="function"&&s.call(null,i)}else{var a=Date.now()-o,l=Math.max(o-r,1),c=Math.min(l*1.2,100);a>=c?(Ze("RETRY",t.name,n),t.apply(null,n.concat([r]))):F[z].push(e)}Wn===void 0&&(Wn=setTimeout(Kr,0))}}});var Zl=S((A_,zl)=>{function fe(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}zl.exports=fe;fe.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};fe.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};fe.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1;var i=this,r=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},n);return this._options.unref&&r.unref(),!0};fe.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};fe.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};fe.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};fe.prototype.start=fe.prototype.try;fe.prototype.errors=function(){return this._errors};fe.prototype.attempts=function(){return this._attempts};fe.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,i=0;i<this._errors.length;i++){var r=this._errors[i],o=r.message,s=(e[o]||0)+1;e[o]=s,s>=n&&(t=r,n=s)}return t}});var ec=S(et=>{var Oy=Zl();et.operation=function(e){var t=et.timeouts(e);return new Oy(t,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};et.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],r=0;r<t.retries;r++)i.push(this.createTimeout(r,t));return e&&e.forever&&!i.length&&i.push(this.createTimeout(r,t)),i.sort(function(o,s){return o-s}),i};et.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,i=Math.round(n*t.minTimeout*Math.pow(t.factor,e));return i=Math.min(i,t.maxTimeout),i};et.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n){n=[];for(var i in e)typeof e[i]=="function"&&n.push(i)}for(var r=0;r<n.length;r++){var o=n[r],s=e[o];e[o]=function(l){var c=et.operation(t),u=Array.prototype.slice.call(arguments,1),f=u.pop();u.push(function(d){c.retry(d)||(d&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){l.apply(e,u)})}.bind(e,s),e[o].options=t}}});var nc=S((__,tc)=>{tc.exports=ec()});var ic=S((E_,Jn)=>{Jn.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Jn.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Jn.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var lc=S((x_,At)=>{var R=global.process,tt=function(e){return 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"};tt(R)?(rc=ue("assert"),St=ic(),oc=/^win/i.test(R.platform),Qt=ue("events"),typeof Qt!="function"&&(Qt=Qt.EventEmitter),R.__signal_exit_emitter__?H=R.__signal_exit_emitter__:(H=R.__signal_exit_emitter__=new Qt,H.count=0,H.emitted={}),H.infinite||(H.setMaxListeners(1/0),H.infinite=!0),At.exports=function(e,t){if(!tt(global.process))return function(){};rc.equal(typeof e,"function","a callback must be provided for exit handler"),vt===!1&&Gr();var n="exit";t&&t.alwaysLast&&(n="afterexit");var i=function(){H.removeListener(n,e),H.listeners("exit").length===0&&H.listeners("afterexit").length===0&&Xn()};return H.on(n,e),i},Xn=function(){!vt||!tt(global.process)||(vt=!1,St.forEach(function(t){try{R.removeListener(t,Qn[t])}catch{}}),R.emit=zn,R.reallyExit=Wr,H.count-=1)},At.exports.unload=Xn,nt=function(t,n,i){H.emitted[t]||(H.emitted[t]=!0,H.emit(t,n,i))},Qn={},St.forEach(function(e){Qn[e]=function(){if(tt(global.process)){var n=R.listeners(e);n.length===H.count&&(Xn(),nt("exit",null,e),nt("afterexit",null,e),oc&&e==="SIGHUP"&&(e="SIGINT"),R.kill(R.pid,e))}}}),At.exports.signals=function(){return St},vt=!1,Gr=function(){vt||!tt(global.process)||(vt=!0,H.count+=1,St=St.filter(function(t){try{return R.on(t,Qn[t]),!0}catch{return!1}}),R.emit=ac,R.reallyExit=sc)},At.exports.load=Gr,Wr=R.reallyExit,sc=function(t){tt(global.process)&&(R.exitCode=t||0,nt("exit",R.exitCode,null),nt("afterexit",R.exitCode,null),Wr.call(R,R.exitCode))},zn=R.emit,ac=function(t,n){if(t==="exit"&&tt(global.process)){n!==void 0&&(R.exitCode=n);var i=zn.apply(this,arguments);return nt("exit",R.exitCode,null),nt("afterexit",R.exitCode,null),i}else return zn.apply(this,arguments)}):At.exports=function(){return function(){}};var rc,St,oc,Qt,H,Xn,nt,Qn,vt,Gr,Wr,sc,zn,ac});var uc=S((k_,Hr)=>{"use strict";var cc=Symbol();function Ty(e,t,n){let i=t[cc];if(i)return t.stat(e,(o,s)=>{if(o)return n(o);n(null,s.mtime,i)});let r=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,r,r,o=>{if(o)return n(o);t.stat(e,(s,a)=>{if(s)return n(s);let l=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(t,cc,{value:l}),n(null,a.mtime,l)})})}function Iy(e){let t=Date.now();return e==="s"&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}Hr.exports.probe=Ty;Hr.exports.getMtime=Iy});var hc=S((C_,Zt)=>{"use strict";var Ly=ue("path"),Qr=Yr(),My=nc(),Ny=lc(),fc=uc(),Ee={};function zt(e,t){return t.lockfilePath||`${e}.lock`}function zr(e,t,n){if(!t.realpath)return n(null,Ly.resolve(e));t.fs.realpath(e,n)}function Xr(e,t,n){let i=zt(e,t);t.fs.mkdir(i,r=>{if(!r)return fc.probe(i,t.fs,(o,s,a)=>{if(o)return t.fs.rmdir(i,()=>{}),n(o);n(null,s,a)});if(r.code!=="EEXIST")return n(r);if(t.stale<=0)return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));t.fs.stat(i,(o,s)=>{if(o)return o.code==="ENOENT"?Xr(e,{...t,stale:0},n):n(o);if(!dc(s,t))return n(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:e}));pc(e,t,a=>{if(a)return n(a);Xr(e,{...t,stale:0},n)})})})}function dc(e,t){return e.mtime.getTime()<Date.now()-t.stale}function pc(e,t,n){t.fs.rmdir(zt(e,t),i=>{if(i&&i.code!=="ENOENT")return n(i);n()})}function Zn(e,t){let n=Ee[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(i,r)=>{let o=n.lastUpdate+t.stale<Date.now();if(i)return i.code==="ENOENT"||o?Jr(e,n,Object.assign(i,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,Zn(e,t));if(!(n.mtime.getTime()===r.mtime.getTime()))return Jr(e,n,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=fc.getMtime(n.mtimePrecision);t.fs.utimes(n.lockfilePath,a,a,l=>{let c=n.lastUpdate+t.stale<Date.now();if(!n.released){if(l)return l.code==="ENOENT"||c?Jr(e,n,Object.assign(l,{code:"ECOMPROMISED"})):(n.updateDelay=1e3,Zn(e,t));n.mtime=a,n.lastUpdate=Date.now(),n.updateDelay=null,Zn(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function Jr(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),Ee[e]===t&&delete Ee[e],t.options.onCompromised(n)}function Py(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:Qr,onCompromised:i=>{throw i},...t},t.retries=t.retries||0,t.retries=typeof t.retries=="number"?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),zr(e,t,(i,r)=>{if(i)return n(i);let o=My.operation(t.retries);o.attempt(()=>{Xr(r,t,(s,a,l)=>{if(o.retry(s))return;if(s)return n(o.mainError());let c=Ee[r]={lockfilePath:zt(r,t),mtime:a,mtimePrecision:l,options:t,lastUpdate:Date.now()};Zn(r,t),n(null,u=>{if(c.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));mc(r,{...t,realpath:!1},u)})})})})}function mc(e,t,n){t={fs:Qr,realpath:!0,...t},zr(e,t,(i,r)=>{if(i)return n(i);let o=Ee[r];if(!o)return n(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete Ee[r],pc(r,t,n)})}function Ry(e,t,n){t={stale:1e4,realpath:!0,fs:Qr,...t},t.stale=Math.max(t.stale||0,2e3),zr(e,t,(i,r)=>{if(i)return n(i);t.fs.stat(zt(r,t),(o,s)=>o?o.code==="ENOENT"?n(null,!1):n(o):n(null,!dc(s,t)))})}function Dy(){return Ee}Ny(()=>{for(let e in Ee){let t=Ee[e].options;try{t.fs.rmdirSync(zt(e,t))}catch{}}});Zt.exports.lock=Py;Zt.exports.unlock=mc;Zt.exports.check=Ry;Zt.exports.getLocks=Dy});var gc=S((O_,yc)=>{"use strict";var Fy=Yr();function By(e){let t=["mkdir","realpath","stat","rmdir","utimes"],n={...e};return t.forEach(i=>{n[i]=(...r)=>{let o=r.pop(),s;try{s=e[`${i}Sync`](...r)}catch(a){return o(a)}o(null,s)}}),n}function qy(e){return(...t)=>new Promise((n,i)=>{t.push((r,o)=>{r?i(r):n(o)}),e(...t)})}function $y(e){return(...t)=>{let n,i;if(t.push((r,o)=>{n=r,i=o}),e(...t),n)throw n;return i}}function jy(e){if(e={...e},e.fs=By(e.fs||Fy),typeof e.retries=="number"&&e.retries>0||e.retries&&typeof e.retries.retries=="number"&&e.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return e}yc.exports={toPromise:qy,toSync:$y,toSyncOptions:jy}});var eo=S((T_,Ne)=>{"use strict";var wt=hc(),{toPromise:ei,toSync:ti,toSyncOptions:Zr}=gc();async function bc(e,t){let n=await ei(wt.lock)(e,t);return ei(n)}function Uy(e,t){let n=ti(wt.lock)(e,Zr(t));return ti(n)}function Ky(e,t){return ei(wt.unlock)(e,t)}function Vy(e,t){return ti(wt.unlock)(e,Zr(t))}function Yy(e,t){return ei(wt.check)(e,t)}function Gy(e,t){return ti(wt.check)(e,Zr(t))}Ne.exports=bc;Ne.exports.lock=bc;Ne.exports.unlock=Ky;Ne.exports.lockSync=Uy;Ne.exports.unlockSync=Vy;Ne.exports.check=Yy;Ne.exports.checkSync=Gy});var I=S(Z=>{"use strict";var io=Symbol.for("yaml.alias"),_c=Symbol.for("yaml.document"),ni=Symbol.for("yaml.map"),Ec=Symbol.for("yaml.pair"),ro=Symbol.for("yaml.scalar"),ii=Symbol.for("yaml.seq"),xe=Symbol.for("yaml.node.type"),Xy=e=>!!e&&typeof e=="object"&&e[xe]===io,Qy=e=>!!e&&typeof e=="object"&&e[xe]===_c,zy=e=>!!e&&typeof e=="object"&&e[xe]===ni,Zy=e=>!!e&&typeof e=="object"&&e[xe]===Ec,xc=e=>!!e&&typeof e=="object"&&e[xe]===ro,eg=e=>!!e&&typeof e=="object"&&e[xe]===ii;function kc(e){if(e&&typeof e=="object")switch(e[xe]){case ni:case ii:return!0}return!1}function tg(e){if(e&&typeof e=="object")switch(e[xe]){case io:case ni:case ro:case ii:return!0}return!1}var ng=e=>(xc(e)||kc(e))&&!!e.anchor;Z.ALIAS=io;Z.DOC=_c;Z.MAP=ni;Z.NODE_TYPE=xe;Z.PAIR=Ec;Z.SCALAR=ro;Z.SEQ=ii;Z.hasAnchor=ng;Z.isAlias=Xy;Z.isCollection=kc;Z.isDocument=Qy;Z.isMap=zy;Z.isNode=tg;Z.isPair=Zy;Z.isScalar=xc;Z.isSeq=eg});var en=S(oo=>{"use strict";var V=I(),ae=Symbol("break visit"),Cc=Symbol("skip children"),Se=Symbol("remove node");function ri(e,t){let n=Oc(t);V.isDocument(e)?Et(null,e.contents,n,Object.freeze([e]))===Se&&(e.contents=null):Et(null,e,n,Object.freeze([]))}ri.BREAK=ae;ri.SKIP=Cc;ri.REMOVE=Se;function Et(e,t,n,i){let r=Tc(e,t,n,i);if(V.isNode(r)||V.isPair(r))return Ic(e,i,r),Et(e,r,n,i);if(typeof r!="symbol"){if(V.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=Et(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===Se&&(t.items.splice(o,1),o-=1)}}}else if(V.isPair(t)){i=Object.freeze(i.concat(t));let o=Et("key",t.key,n,i);if(o===ae)return ae;o===Se&&(t.key=null);let s=Et("value",t.value,n,i);if(s===ae)return ae;s===Se&&(t.value=null)}}return r}async function oi(e,t){let n=Oc(t);V.isDocument(e)?await xt(null,e.contents,n,Object.freeze([e]))===Se&&(e.contents=null):await xt(null,e,n,Object.freeze([]))}oi.BREAK=ae;oi.SKIP=Cc;oi.REMOVE=Se;async function xt(e,t,n,i){let r=await Tc(e,t,n,i);if(V.isNode(r)||V.isPair(r))return Ic(e,i,r),xt(e,r,n,i);if(typeof r!="symbol"){if(V.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let s=await xt(o,t.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===ae)return ae;s===Se&&(t.items.splice(o,1),o-=1)}}}else if(V.isPair(t)){i=Object.freeze(i.concat(t));let o=await xt("key",t.key,n,i);if(o===ae)return ae;o===Se&&(t.key=null);let s=await xt("value",t.value,n,i);if(s===ae)return ae;s===Se&&(t.value=null)}}return r}function Oc(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Tc(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(V.isMap(t))return n.Map?.(e,t,i);if(V.isSeq(t))return n.Seq?.(e,t,i);if(V.isPair(t))return n.Pair?.(e,t,i);if(V.isScalar(t))return n.Scalar?.(e,t,i);if(V.isAlias(t))return n.Alias?.(e,t,i)}function Ic(e,t,n){let i=t[t.length-1];if(V.isCollection(i))i.items[e]=n;else if(V.isPair(i))e==="key"?i.key=n:i.value=n;else if(V.isDocument(i))i.contents=n;else{let r=V.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}oo.visit=ri;oo.visitAsync=oi});var so=S(Mc=>{"use strict";var Lc=I(),ig=en(),rg={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},og=e=>e.replace(/[!,[\]{}]/g,t=>rg[t]),tn=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+og(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&Lc.isNode(t.contents)){let o={};ig.visit(t.contents,(s,a)=>{Lc.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
4
+ `)}};tn.defaultYaml={explicit:!1,version:"1.2"};tn.defaultTags={"!!":"tag:yaml.org,2002:"};Mc.Directives=tn});var si=S(nn=>{"use strict";var Nc=I(),sg=en();function ag(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Pc(e){let t=new Set;return sg.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function Rc(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function lg(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=Pc(e));let s=Rc(t,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(Nc.isScalar(s.node)||Nc.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}nn.anchorIsValid=ag;nn.anchorNames=Pc;nn.createNodeAnchors=lg;nn.findNewAnchor=Rc});var ao=S(Dc=>{"use strict";function rn(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r<o;++r){let s=i[r],a=rn(e,i,String(r),s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let o=i.get(r),s=rn(e,i,r,o);s===void 0?i.delete(r):s!==o&&i.set(r,s)}else if(i instanceof Set)for(let r of Array.from(i)){let o=rn(e,i,r,r);o===void 0?i.delete(r):o!==r&&(i.delete(r),i.add(o))}else for(let[r,o]of Object.entries(i)){let s=rn(e,i,r,o);s===void 0?delete i[r]:s!==o&&(i[r]=s)}return e.call(t,n,i)}Dc.applyReviver=rn});var Re=S(Bc=>{"use strict";var cg=I();function Fc(e,t,n){if(Array.isArray(e))return e.map((i,r)=>Fc(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!cg.hasAnchor(e))return e.toJSON(t,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}Bc.toJS=Fc});var ai=S($c=>{"use strict";var ug=ao(),qc=I(),fg=Re(),lo=class{constructor(t){Object.defineProperty(this,qc.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!qc.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=fg.toJS(this,"",s);if(typeof r=="function")for(let{count:l,res:c}of s.anchors.values())r(c,l);return typeof o=="function"?ug.applyReviver(o,{"":a},"",a):a}};$c.NodeBase=lo});var on=S(jc=>{"use strict";var dg=si(),pg=en(),kt=I(),mg=ai(),hg=Re(),co=class extends mg.NodeBase{constructor(t){super(kt.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],pg.visit(t,{Node:(o,s)=>{(kt.isAlias(s)||kt.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}return r}toJSON(t,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:o}=n,s=this.resolve(r,n);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(s);if(a||(hg.toJS(s,null,n),a=i.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=li(r,s,i)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,i){let r=`*${this.source}`;if(t){if(dg.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}};function li(e,t,n){if(kt.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(kt.isCollection(t)){let i=0;for(let r of t.items){let o=li(e,r,n);o>i&&(i=o)}return i}else if(kt.isPair(t)){let i=li(e,t.key,n),r=li(e,t.value,n);return Math.max(i,r)}return 1}jc.Alias=co});var U=S(uo=>{"use strict";var yg=I(),gg=ai(),bg=Re(),Sg=e=>!e||typeof e!="function"&&typeof e!="object",De=class extends gg.NodeBase{constructor(t){super(yg.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:bg.toJS(this.value,t,n)}toString(){return String(this.value)}};De.BLOCK_FOLDED="BLOCK_FOLDED";De.BLOCK_LITERAL="BLOCK_LITERAL";De.PLAIN="PLAIN";De.QUOTE_DOUBLE="QUOTE_DOUBLE";De.QUOTE_SINGLE="QUOTE_SINGLE";uo.Scalar=De;uo.isScalarValue=Sg});var sn=S(Kc=>{"use strict";var vg=on(),rt=I(),Uc=U(),Ag="tag:yaml.org,2002:";function wg(e,t,n){if(t){let i=n.filter(o=>o.tag===t),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>i.identify?.(e)&&!i.format)}function _g(e,t,n){if(rt.isDocument(e)&&(e=e.contents),rt.isNode(e))return e;if(rt.isPair(e)){let f=n.schema[rt.MAP].createNode?.(n.schema,null,n);return f.items.push(e),f}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,l;if(i&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=r(e)),new vg.Alias(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=Ag+t.slice(2));let c=wg(e,t,s.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let f=new Uc.Scalar(e);return l&&(l.node=f),f}c=e instanceof Map?s[rt.MAP]:Symbol.iterator in Object(e)?s[rt.SEQ]:s[rt.MAP]}o&&(o(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,e,n):new Uc.Scalar(e);return t?u.tag=t:c.default||(u.tag=c.tag),l&&(l.node=u),u}Kc.createNode=_g});var ui=S(ci=>{"use strict";var Eg=sn(),ve=I(),xg=ai();function fo(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){let o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return Eg.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Vc=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,po=class extends xg.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>ve.isNode(i)||ve.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Vc(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(ve.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,fo(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){let[n,...i]=t;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(ve.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){let[i,...r]=t,o=this.get(i,!0);return r.length===0?!n&&ve.isScalar(o)?o.value:o:ve.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ve.isPair(n))return!1;let i=n.value;return i==null||t&&ve.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){let[n,...i]=t;if(i.length===0)return this.has(n);let r=this.get(n,!0);return ve.isCollection(r)?r.hasIn(i):!1}setIn(t,n){let[i,...r]=t;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(ve.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,fo(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};ci.Collection=po;ci.collectionFromPath=fo;ci.isEmptyPath=Vc});var an=S(fi=>{"use strict";var kg=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function mo(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Cg=(e,t,n)=>e.endsWith(`
5
5
  `)?mo(n,t):n.includes(`
6
6
  `)?`
7
- `+mo(n,t):(e.endsWith(" ")?"":" ")+n;fi.indentComment=mo;fi.lineComment=kg;fi.stringifyComment=xg});var Gc=S(ln=>{"use strict";var Cg="flow",ho="block",di="quoted";function Og(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return e;r<o&&(o=0);let l=Math.max(1+o,1+r-t.length);if(e.length<=l)return e;let c=[],u={},f=r-t.length;typeof i=="number"&&(i>r-Math.max(2,o)?c.push(0):f=r-i);let d,p,y=!1,m=-1,h=-1,g=-1;n===ho&&(m=Yc(e,m,t.length),m!==-1&&(f=m+l));for(let v;v=e[m+=1];){if(n===di&&v==="\\"){switch(h=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if(v===`
7
+ `+mo(n,t):(e.endsWith(" ")?"":" ")+n;fi.indentComment=mo;fi.lineComment=Cg;fi.stringifyComment=kg});var Gc=S(ln=>{"use strict";var Og="flow",ho="block",di="quoted";function Tg(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return e;r<o&&(o=0);let l=Math.max(1+o,1+r-t.length);if(e.length<=l)return e;let c=[],u={},f=r-t.length;typeof i=="number"&&(i>r-Math.max(2,o)?c.push(0):f=r-i);let d,p,y=!1,m=-1,h=-1,g=-1;n===ho&&(m=Yc(e,m,t.length),m!==-1&&(f=m+l));for(let v;v=e[m+=1];){if(n===di&&v==="\\"){switch(h=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if(v===`
8
8
  `)n===ho&&(m=Yc(e,m,t.length)),f=m+t.length+l,d=void 0;else{if(v===" "&&p&&p!==" "&&p!==`
9
9
  `&&p!==" "){let x=e[m+1];x&&x!==" "&&x!==`
10
10
  `&&x!==" "&&(d=m)}if(m>=f)if(d)c.push(d),f=d+l,d=void 0;else if(n===di){for(;p===" "||p===" ";)p=v,v=e[m+=1],y=!0;let x=m>g+1?m-2:h-1;if(u[x])return e;c.push(x),u[x]=!0,f=x+l,d=void 0}else y=!0}p=v}if(y&&a&&a(),c.length===0)return e;s&&s();let b=e.slice(0,c[0]);for(let v=0;v<c.length;++v){let x=c[v],k=c[v+1]||e.length;x===0?b=`
11
11
  ${t}${e.slice(0,k)}`:(n===di&&u[x]&&(b+=`${e[x]}\\`),b+=`
12
12
  ${t}${e.slice(x+1,k)}`)}return b}function Yc(e,t,n){let i=t,r=t+1,o=e[r];for(;o===" "||o===" ";)if(t<r+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
13
- `);i=t,r=t+1,o=e[r]}return i}ln.FOLD_BLOCK=ho;ln.FOLD_FLOW=Cg;ln.FOLD_QUOTED=di;ln.foldFlowLines=Og});var un=S(Wc=>{"use strict";var pe=U(),Fe=Gc(),mi=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),hi=e=>/^(%|---|\.\.\.)/m.test(e);function Tg(e,t,n){if(!t||t<0)return!1;let i=t-n,r=e.length;if(r<=i)return!1;for(let o=0,s=0;o<r;++o)if(e[o]===`
13
+ `);i=t,r=t+1,o=e[r]}return i}ln.FOLD_BLOCK=ho;ln.FOLD_FLOW=Og;ln.FOLD_QUOTED=di;ln.foldFlowLines=Tg});var un=S(Wc=>{"use strict";var pe=U(),Fe=Gc(),mi=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),hi=e=>/^(%|---|\.\.\.)/m.test(e);function Ig(e,t,n){if(!t||t<0)return!1;let i=t-n,r=e.length;if(r<=i)return!1;for(let o=0,s=0;o<r;++o)if(e[o]===`
14
14
  `){if(o-s>i)return!0;if(s=o+1,r-s<=i)return!1}return!0}function cn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(hi(e)?" ":""),s="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(s+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{s+=n.slice(a,l);let u=n.substr(l+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(i||n[l+2]==='"'||n.length<r)l+=1;else{for(s+=n.slice(a,l)+`
15
15
 
16
16
  `;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)s+=`
@@ -19,7 +19,7 @@ ${t}${e.slice(x+1,k)}`)}return b}function Yc(e,t,n){let i=t,r=t+1,o=e[r];for(;o=
19
19
  ${n}`)+"'";return t.implicitKey?i:Fe.foldFlowLines(i,n,Fe.FOLD_FLOW,mi(t,!1))}function Ct(e,t){let{singleQuote:n}=t.options,i;if(n===!1)i=cn;else{let r=e.includes('"'),o=e.includes("'");r&&!o?i=yo:o&&!r?i=cn:i=n?yo:cn}return i(e,t)}var go;try{go=new RegExp(`(^|(?<!
20
20
  ))
21
21
  +(?!
22
- |$)`,"g")}catch{go=/\n+(?!\n|$)/g}function pi({comment:e,type:t,value:n},i,r,o){let{blockQuote:s,commentString:a,lineWidth:l}=i.options;if(!s||/\n[\t ]+$/.test(n))return Ct(n,i);let c=i.indent||(i.forceBlockIndent||hi(n)?" ":""),u=s==="literal"?!0:s==="folded"||t===pe.Scalar.BLOCK_FOLDED?!1:t===pe.Scalar.BLOCK_LITERAL?!0:!Tg(n,l,c.length);if(!n)return u?`|
22
+ |$)`,"g")}catch{go=/\n+(?!\n|$)/g}function pi({comment:e,type:t,value:n},i,r,o){let{blockQuote:s,commentString:a,lineWidth:l}=i.options;if(!s||/\n[\t ]+$/.test(n))return Ct(n,i);let c=i.indent||(i.forceBlockIndent||hi(n)?" ":""),u=s==="literal"?!0:s==="folded"||t===pe.Scalar.BLOCK_FOLDED?!1:t===pe.Scalar.BLOCK_LITERAL?!0:!Ig(n,l,c.length);if(!n)return u?`|
23
23
  `:`>
24
24
  `;let f,d;for(d=n.length;d>0;--d){let k=n[d-1];if(k!==`
25
25
  `&&k!==" "&&k!==" ")break}let p=n.substring(d),y=p.indexOf(`
@@ -28,12 +28,12 @@ ${n}`)+"'";return t.implicitKey?i:Fe.foldFlowLines(i,n,Fe.FOLD_FLOW,mi(t,!1))}fu
28
28
  `)g=h;else break}let b=n.substring(0,g<h?g+1:h);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${c}`));let x=(m?c?"2":"1":"")+f;if(e&&(x+=" "+a(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let k=n.replace(/\n+/g,`
29
29
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),C=!1,L=mi(i,!0);s!=="folded"&&t!==pe.Scalar.BLOCK_FOLDED&&(L.onOverflow=()=>{C=!0});let w=Fe.foldFlowLines(`${b}${k}${p}`,c,Fe.FOLD_BLOCK,L);if(!C)return`>${x}
30
30
  ${c}${w}`}return n=n.replace(/\n+/g,`$&${c}`),`|${x}
31
- ${c}${b}${n}${p}`}function Ig(e,t,n,i){let{type:r,value:o}=e,{actualString:s,implicitKey:a,indent:l,indentStep:c,inFlow:u}=t;if(a&&o.includes(`
31
+ ${c}${b}${n}${p}`}function Lg(e,t,n,i){let{type:r,value:o}=e,{actualString:s,implicitKey:a,indent:l,indentStep:c,inFlow:u}=t;if(a&&o.includes(`
32
32
  `)||u&&/[[\]{},]/.test(o))return Ct(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
33
33
  `)?Ct(o,t):pi(e,t,n,i);if(!a&&!u&&r!==pe.Scalar.PLAIN&&o.includes(`
34
34
  `))return pi(e,t,n,i);if(hi(o)){if(l==="")return t.forceBlockIndent=!0,pi(e,t,n,i);if(a&&l===c)return Ct(o,t)}let f=o.replace(/\n+/g,`$&
35
- ${l}`);if(s){let d=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:p,tags:y}=t.doc.schema;if(y.some(d)||p?.some(d))return Ct(o,t)}return a?f:Fe.foldFlowLines(f,l,Fe.FOLD_FLOW,mi(t,!1))}function Lg(e,t,n,i){let{implicitKey:r,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==pe.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=pe.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case pe.Scalar.BLOCK_FOLDED:case pe.Scalar.BLOCK_LITERAL:return r||o?Ct(s.value,t):pi(s,t,n,i);case pe.Scalar.QUOTE_DOUBLE:return cn(s.value,t);case pe.Scalar.QUOTE_SINGLE:return yo(s.value,t);case pe.Scalar.PLAIN:return Ig(s,t,n,i);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=t.options,d=r&&u||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}Wc.stringifyString=Lg});var fn=S(bo=>{"use strict";var Mg=si(),Be=I(),Ng=an(),Pg=un();function Rg(e,t){let n=Object.assign({blockQuote:!0,commentString:Ng.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Dg(e,t){if(t.tag){let r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,i;if(Be.isScalar(t)){i=t.value;let r=e.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else i=t,n=e.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Fg(e,t,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(Be.isScalar(e)||Be.isCollection(e))&&e.anchor;o&&Mg.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function Bg(e,t,n,i){if(Be.isPair(e))return e.toString(t,n,i);if(Be.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,o=Be.isNode(e)?e:t.doc.createNode(e,{onTagObj:l=>r=l});r??(r=Dg(t.doc.schema.tags,o));let s=Fg(o,r,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,t,n,i):Be.isScalar(o)?Pg.stringifyString(o,t,n,i):o.toString(t,n,i);return s?Be.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
36
- ${t.indent}${a}`:a}bo.createStringifyContext=Rg;bo.stringify=Bg});var Qc=S(Xc=>{"use strict";var ke=I(),Hc=U(),Jc=fn(),dn=an();function qg({key:e,value:t},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,d=ke.isNode(e)&&e.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(ke.isCollection(e)||!ke.isNode(e)&&typeof e=="object"){let L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let p=!f&&(!e||d&&t==null&&!n.inFlow||ke.isCollection(e)||(ke.isScalar(e)?e.type===Hc.Scalar.BLOCK_FOLDED||e.type===Hc.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:a+l});let y=!1,m=!1,h=Jc.stringify(e,n,()=>y=!0,()=>m=!0);if(!p&&!n.inFlow&&h.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||t==null)return y&&i&&i(),h===""?"?":p?`? ${h}`:h}else if(o&&!f||t==null&&p)return h=`? ${h}`,d&&!y?h+=dn.lineComment(h,n.indent,c(d)):m&&r&&r(),h;y&&(d=null),p?(d&&(h+=dn.lineComment(h,n.indent,c(d))),h=`? ${h}
35
+ ${l}`);if(s){let d=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:p,tags:y}=t.doc.schema;if(y.some(d)||p?.some(d))return Ct(o,t)}return a?f:Fe.foldFlowLines(f,l,Fe.FOLD_FLOW,mi(t,!1))}function Mg(e,t,n,i){let{implicitKey:r,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==pe.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=pe.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case pe.Scalar.BLOCK_FOLDED:case pe.Scalar.BLOCK_LITERAL:return r||o?Ct(s.value,t):pi(s,t,n,i);case pe.Scalar.QUOTE_DOUBLE:return cn(s.value,t);case pe.Scalar.QUOTE_SINGLE:return yo(s.value,t);case pe.Scalar.PLAIN:return Lg(s,t,n,i);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=t.options,d=r&&u||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}Wc.stringifyString=Mg});var fn=S(bo=>{"use strict";var Ng=si(),Be=I(),Pg=an(),Rg=un();function Dg(e,t){let n=Object.assign({blockQuote:!0,commentString:Pg.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Fg(e,t){if(t.tag){let r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,i;if(Be.isScalar(t)){i=t.value;let r=e.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else i=t,n=e.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Bg(e,t,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(Be.isScalar(e)||Be.isCollection(e))&&e.anchor;o&&Ng.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function qg(e,t,n,i){if(Be.isPair(e))return e.toString(t,n,i);if(Be.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,o=Be.isNode(e)?e:t.doc.createNode(e,{onTagObj:l=>r=l});r??(r=Fg(t.doc.schema.tags,o));let s=Bg(o,r,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,t,n,i):Be.isScalar(o)?Rg.stringifyString(o,t,n,i):o.toString(t,n,i);return s?Be.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
36
+ ${t.indent}${a}`:a}bo.createStringifyContext=Dg;bo.stringify=qg});var Qc=S(Xc=>{"use strict";var ke=I(),Hc=U(),Jc=fn(),dn=an();function $g({key:e,value:t},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,d=ke.isNode(e)&&e.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(ke.isCollection(e)||!ke.isNode(e)&&typeof e=="object"){let L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let p=!f&&(!e||d&&t==null&&!n.inFlow||ke.isCollection(e)||(ke.isScalar(e)?e.type===Hc.Scalar.BLOCK_FOLDED||e.type===Hc.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:a+l});let y=!1,m=!1,h=Jc.stringify(e,n,()=>y=!0,()=>m=!0);if(!p&&!n.inFlow&&h.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||t==null)return y&&i&&i(),h===""?"?":p?`? ${h}`:h}else if(o&&!f||t==null&&p)return h=`? ${h}`,d&&!y?h+=dn.lineComment(h,n.indent,c(d)):m&&r&&r(),h;y&&(d=null),p?(d&&(h+=dn.lineComment(h,n.indent,c(d))),h=`? ${h}
37
37
  ${a}:`):(h=`${h}:`,d&&(h+=dn.lineComment(h,n.indent,c(d))));let g,b,v;ke.isNode(t)?(g=!!t.spaceBefore,b=t.commentBefore,v=t.comment):(g=!1,b=null,v=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!p&&!d&&ke.isScalar(t)&&(n.indentAtStart=h.length+1),m=!1,!u&&l.length>=2&&!n.inFlow&&!p&&ke.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let x=!1,k=Jc.stringify(t,n,()=>x=!0,()=>m=!0),C=" ";if(d||g||b){if(C=g?`
38
38
  `:"",b){let L=c(b);C+=`
39
39
  ${dn.indentComment(L,n.indent)}`}k===""&&!n.inFlow?C===`
@@ -43,32 +43,32 @@ ${dn.indentComment(L,n.indent)}`}k===""&&!n.inFlow?C===`
43
43
  ${n.indent}`}else if(!p&&ke.isCollection(t)){let L=k[0],w=k.indexOf(`
44
44
  `),A=w!==-1,O=n.inFlow??t.flow??t.items.length===0;if(A||!O){let E=!1;if(A&&(L==="&"||L==="!")){let T=k.indexOf(" ");L==="&"&&T!==-1&&T<w&&k[T+1]==="!"&&(T=k.indexOf(" ",T+1)),(T===-1||w<T)&&(E=!0)}E||(C=`
45
45
  ${n.indent}`)}}else(k===""||k[0]===`
46
- `)&&(C="");return h+=C+k,n.inFlow?x&&i&&i():v&&!x?h+=dn.lineComment(h,n.indent,c(v)):m&&r&&r(),h}Xc.stringifyPair=qg});var vo=S(So=>{"use strict";var zc=ue("process");function $g(e,...t){e==="debug"&&console.log(...t)}function jg(e,t){(e==="debug"||e==="warn")&&(typeof zc.emitWarning=="function"?zc.emitWarning(t):console.warn(t))}So.debug=$g;So.warn=jg});var vi=S(Si=>{"use strict";var bi=I(),Zc=U(),yi="<<",gi={identify:e=>e===yi||typeof e=="symbol"&&e.description===yi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Zc.Scalar(Symbol(yi)),{addToJSMap:eu}),stringify:()=>yi},Ug=(e,t)=>(gi.identify(t)||bi.isScalar(t)&&(!t.type||t.type===Zc.Scalar.PLAIN)&&gi.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===gi.tag&&n.default);function eu(e,t,n){let i=tu(e,n);if(bi.isSeq(i))for(let r of i.items)Ao(e,t,r);else if(Array.isArray(i))for(let r of i)Ao(e,t,r);else Ao(e,t,i)}function Ao(e,t,n){let i=tu(e,n);if(!bi.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,e,Map);for(let[o,s]of r)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function tu(e,t){return e&&bi.isAlias(t)?t.resolve(e.doc,e):t}Si.addMergeToJSMap=eu;Si.isMergeKey=Ug;Si.merge=gi});var _o=S(ru=>{"use strict";var Kg=vo(),nu=vi(),Vg=fn(),iu=I(),wo=Re();function Yg(e,t,{key:n,value:i}){if(iu.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(nu.isMergeKey(e,n))nu.addMergeToJSMap(e,t,i);else{let r=wo.toJS(n,"",e);if(t instanceof Map)t.set(r,wo.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=Gg(n,r,e),s=wo.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function Gg(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(iu.isNode(e)&&n?.doc){let i=Vg.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=e.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Kg.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}ru.addPairToJSMap=Yg});var qe=S(Eo=>{"use strict";var ou=sn(),Wg=Qc(),Hg=_o(),Ai=I();function Jg(e,t,n){let i=ou.createNode(e,void 0,n),r=ou.createNode(t,void 0,n);return new wi(i,r)}var wi=class e{constructor(t,n=null){Object.defineProperty(this,Ai.NODE_TYPE,{value:Ai.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ai.isNode(n)&&(n=n.clone(t)),Ai.isNode(i)&&(i=i.clone(t)),new e(n,i)}toJSON(t,n){let i=n?.mapAsMap?new Map:{};return Hg.addPairToJSMap(n,i,this)}toString(t,n,i){return t?.doc?Wg.stringifyPair(this,t,n,i):JSON.stringify(this)}};Eo.Pair=wi;Eo.createPair=Jg});var xo=S(au=>{"use strict";var ot=I(),su=fn(),_i=an();function Xg(e,t,n){return(t.inFlow??e.flow?zg:Qg)(e,t,n)}function Qg({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:o,type:null}),f=!1,d=[];for(let y=0;y<t.length;++y){let m=t[y],h=null;if(ot.isNode(m))!f&&m.spaceBefore&&d.push(""),Ei(n,d,m.commentBefore,f),m.comment&&(h=m.comment);else if(ot.isPair(m)){let b=ot.isNode(m.key)?m.key:null;b&&(!f&&b.spaceBefore&&d.push(""),Ei(n,d,b.commentBefore,f))}f=!1;let g=su.stringify(m,u,()=>h=null,()=>f=!0);h&&(g+=_i.lineComment(g,o,c(h))),f&&h&&(f=!1),d.push(i+g)}let p;if(d.length===0)p=r.start+r.end;else{p=d[0];for(let y=1;y<d.length;++y){let m=d[y];p+=m?`
46
+ `)&&(C="");return h+=C+k,n.inFlow?x&&i&&i():v&&!x?h+=dn.lineComment(h,n.indent,c(v)):m&&r&&r(),h}Xc.stringifyPair=$g});var vo=S(So=>{"use strict";var zc=ue("process");function jg(e,...t){e==="debug"&&console.log(...t)}function Ug(e,t){(e==="debug"||e==="warn")&&(typeof zc.emitWarning=="function"?zc.emitWarning(t):console.warn(t))}So.debug=jg;So.warn=Ug});var vi=S(Si=>{"use strict";var bi=I(),Zc=U(),yi="<<",gi={identify:e=>e===yi||typeof e=="symbol"&&e.description===yi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Zc.Scalar(Symbol(yi)),{addToJSMap:eu}),stringify:()=>yi},Kg=(e,t)=>(gi.identify(t)||bi.isScalar(t)&&(!t.type||t.type===Zc.Scalar.PLAIN)&&gi.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===gi.tag&&n.default);function eu(e,t,n){let i=tu(e,n);if(bi.isSeq(i))for(let r of i.items)Ao(e,t,r);else if(Array.isArray(i))for(let r of i)Ao(e,t,r);else Ao(e,t,i)}function Ao(e,t,n){let i=tu(e,n);if(!bi.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,e,Map);for(let[o,s]of r)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function tu(e,t){return e&&bi.isAlias(t)?t.resolve(e.doc,e):t}Si.addMergeToJSMap=eu;Si.isMergeKey=Kg;Si.merge=gi});var _o=S(ru=>{"use strict";var Vg=vo(),nu=vi(),Yg=fn(),iu=I(),wo=Re();function Gg(e,t,{key:n,value:i}){if(iu.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(nu.isMergeKey(e,n))nu.addMergeToJSMap(e,t,i);else{let r=wo.toJS(n,"",e);if(t instanceof Map)t.set(r,wo.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=Wg(n,r,e),s=wo.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function Wg(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(iu.isNode(e)&&n?.doc){let i=Yg.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=e.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Vg.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}ru.addPairToJSMap=Gg});var qe=S(Eo=>{"use strict";var ou=sn(),Hg=Qc(),Jg=_o(),Ai=I();function Xg(e,t,n){let i=ou.createNode(e,void 0,n),r=ou.createNode(t,void 0,n);return new wi(i,r)}var wi=class e{constructor(t,n=null){Object.defineProperty(this,Ai.NODE_TYPE,{value:Ai.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ai.isNode(n)&&(n=n.clone(t)),Ai.isNode(i)&&(i=i.clone(t)),new e(n,i)}toJSON(t,n){let i=n?.mapAsMap?new Map:{};return Jg.addPairToJSMap(n,i,this)}toString(t,n,i){return t?.doc?Hg.stringifyPair(this,t,n,i):JSON.stringify(this)}};Eo.Pair=wi;Eo.createPair=Xg});var xo=S(au=>{"use strict";var ot=I(),su=fn(),_i=an();function Qg(e,t,n){return(t.inFlow??e.flow?Zg:zg)(e,t,n)}function zg({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:o,type:null}),f=!1,d=[];for(let y=0;y<t.length;++y){let m=t[y],h=null;if(ot.isNode(m))!f&&m.spaceBefore&&d.push(""),Ei(n,d,m.commentBefore,f),m.comment&&(h=m.comment);else if(ot.isPair(m)){let b=ot.isNode(m.key)?m.key:null;b&&(!f&&b.spaceBefore&&d.push(""),Ei(n,d,b.commentBefore,f))}f=!1;let g=su.stringify(m,u,()=>h=null,()=>f=!0);h&&(g+=_i.lineComment(g,o,c(h))),f&&h&&(f=!1),d.push(i+g)}let p;if(d.length===0)p=r.start+r.end;else{p=d[0];for(let y=1;y<d.length;++y){let m=d[y];p+=m?`
47
47
  ${l}${m}`:`
48
48
  `}}return e?(p+=`
49
- `+_i.indentComment(c(e),l),a&&a()):f&&s&&s(),p}function zg({items:e},t,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;i+=o;let l=Object.assign({},t,{indent:i,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let y=0;y<e.length;++y){let m=e[y],h=null;if(ot.isNode(m))m.spaceBefore&&f.push(""),Ei(t,f,m.commentBefore,!1),m.comment&&(h=m.comment);else if(ot.isPair(m)){let b=ot.isNode(m.key)?m.key:null;b&&(b.spaceBefore&&f.push(""),Ei(t,f,b.commentBefore,!1),b.comment&&(c=!0));let v=ot.isNode(m.value)?m.value:null;v?(v.comment&&(h=v.comment),v.commentBefore&&(c=!0)):m.value==null&&b?.comment&&(h=b.comment)}h&&(c=!0);let g=su.stringify(m,l,()=>h=null);c||(c=f.length>u||g.includes(`
49
+ `+_i.indentComment(c(e),l),a&&a()):f&&s&&s(),p}function Zg({items:e},t,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;i+=o;let l=Object.assign({},t,{indent:i,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let y=0;y<e.length;++y){let m=e[y],h=null;if(ot.isNode(m))m.spaceBefore&&f.push(""),Ei(t,f,m.commentBefore,!1),m.comment&&(h=m.comment);else if(ot.isPair(m)){let b=ot.isNode(m.key)?m.key:null;b&&(b.spaceBefore&&f.push(""),Ei(t,f,b.commentBefore,!1),b.comment&&(c=!0));let v=ot.isNode(m.value)?m.value:null;v?(v.comment&&(h=v.comment),v.commentBefore&&(c=!0)):m.value==null&&b?.comment&&(h=b.comment)}h&&(c=!0);let g=su.stringify(m,l,()=>h=null);c||(c=f.length>u||g.includes(`
50
50
  `)),y<e.length-1?g+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=f.reduce((b,v)=>b+v.length+2,2)+(g.length+2)>t.options.lineWidth)),c&&(g+=",")),h&&(g+=_i.lineComment(g,i,a(h))),f.push(g),u=f.length}let{start:d,end:p}=n;if(f.length===0)return d+p;if(!c){let y=f.reduce((m,h)=>m+h.length+2,2);c=t.options.lineWidth>0&&y>t.options.lineWidth}if(c){let y=d;for(let m of f)y+=m?`
51
51
  ${o}${r}${m}`:`
52
52
  `;return`${y}
53
- ${r}${p}`}else return`${d}${s}${f.join(" ")}${s}${p}`}function Ei({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=_i.indentComment(t(i),e);n.push(o.trimStart())}}au.stringifyCollection=Xg});var je=S(Co=>{"use strict";var Zg=xo(),eb=_o(),tb=ui(),$e=I(),xi=qe(),nb=U();function pn(e,t){let n=$e.isScalar(t)?t.value:t;for(let i of e)if($e.isPair(i)&&(i.key===t||i.key===n||$e.isScalar(i.key)&&i.key.value===n))return i}var ko=class extends tb.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($e.MAP,t),this.items=[]}static from(t,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(t),a=(l,c)=>{if(typeof o=="function")c=o.call(n,l,c);else if(Array.isArray(o)&&!o.includes(l))return;(c!==void 0||r)&&s.items.push(xi.createPair(l,c,i))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let i;$e.isPair(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new xi.Pair(t,t?.value):i=new xi.Pair(t.key,t.value);let r=pn(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);$e.isScalar(r.value)&&nb.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(t){let n=pn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=pn(this.items,t)?.value;return(!n&&$e.isScalar(r)?r.value:r)??void 0}has(t){return!!pn(this.items,t)}set(t,n){this.add(new xi.Pair(t,n),!0)}toJSON(t,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)eb.addPairToJSMap(n,r,o);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!$e.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Zg.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}};Co.YAMLMap=ko;Co.findPair=pn});var Ot=S(cu=>{"use strict";var ib=I(),lu=je(),rb={collection:"map",default:!0,nodeClass:lu.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return ib.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>lu.YAMLMap.from(e,t,n)};cu.map=rb});var Ue=S(uu=>{"use strict";var ob=sn(),sb=xo(),ab=ui(),Ci=I(),lb=U(),cb=Re(),Oo=class extends ab.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ci.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=ki(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let i=ki(t);if(typeof i!="number")return;let r=this.items[i];return!n&&Ci.isScalar(r)?r.value:r}has(t){let n=ki(t);return typeof n=="number"&&n<this.items.length}set(t,n){let i=ki(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);let r=this.items[i];Ci.isScalar(r)&&lb.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(t,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let o of this.items)i.push(cb.toJS(o,String(r++),n));return i}toString(t,n,i){return t?sb.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof r=="function"){let l=n instanceof Set?a:String(s++);a=r.call(n,l,a)}o.items.push(ob.createNode(a,void 0,i))}}return o}};function ki(e){let t=Ci.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}uu.YAMLSeq=Oo});var Tt=S(du=>{"use strict";var ub=I(),fu=Ue(),fb={collection:"seq",default:!0,nodeClass:fu.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return ub.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>fu.YAMLSeq.from(e,t,n)};du.seq=fb});var mn=S(pu=>{"use strict";var db=un(),pb={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),db.stringifyString(e,t,n,i)}};pu.string=pb});var Oi=S(yu=>{"use strict";var mu=U(),hu={identify:e=>e==null,createNode:()=>new mu.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new mu.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&hu.test.test(e)?e:t.options.nullStr};yu.nullTag=hu});var To=S(bu=>{"use strict";var mb=U(),gu={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new mb.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&gu.test.test(e)){let i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};bu.boolTag=gu});var It=S(Su=>{"use strict";function hb({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}Su.stringifyNumber=hb});var Lo=S(Ti=>{"use strict";var yb=U(),Io=It(),gb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Io.stringifyNumber},bb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Io.stringifyNumber(e)}},Sb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new yb.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Io.stringifyNumber};Ti.float=Sb;Ti.floatExp=bb;Ti.floatNaN=gb});var No=S(Li=>{"use strict";var vu=It(),Ii=e=>typeof e=="bigint"||Number.isInteger(e),Mo=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Au(e,t,n){let{value:i}=e;return Ii(i)&&i>=0?n+i.toString(t):vu.stringifyNumber(e)}var vb={identify:e=>Ii(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Mo(e,2,8,n),stringify:e=>Au(e,8,"0o")},Ab={identify:Ii,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Mo(e,0,10,n),stringify:vu.stringifyNumber},wb={identify:e=>Ii(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Mo(e,2,16,n),stringify:e=>Au(e,16,"0x")};Li.int=Ab;Li.intHex=wb;Li.intOct=vb});var _u=S(wu=>{"use strict";var _b=Ot(),Eb=Oi(),xb=Tt(),kb=mn(),Cb=To(),Po=Lo(),Ro=No(),Ob=[_b.map,xb.seq,kb.string,Eb.nullTag,Cb.boolTag,Ro.intOct,Ro.int,Ro.intHex,Po.floatNaN,Po.floatExp,Po.float];wu.schema=Ob});var ku=S(xu=>{"use strict";var Tb=U(),Ib=Ot(),Lb=Tt();function Eu(e){return typeof e=="bigint"||Number.isInteger(e)}var Mi=({value:e})=>JSON.stringify(e),Mb=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Mi},{identify:e=>e==null,createNode:()=>new Tb.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Mi},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Mi},{identify:Eu,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Eu(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Mi}],Nb={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Pb=[Ib.map,Lb.seq].concat(Mb,Nb);xu.schema=Pb});var Fo=S(Cu=>{"use strict";var hn=ue("buffer"),Do=U(),Rb=un(),Db={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof hn.Buffer=="function")return hn.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,r,o){if(!n)return"";let s=n,a;if(typeof hn.Buffer=="function")a=s instanceof hn.Buffer?s.toString("base64"):hn.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<s.length;++c)l+=String.fromCharCode(s[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Do.Scalar.BLOCK_LITERAL),t!==Do.Scalar.QUOTE_DOUBLE){let l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,d=0;f<c;++f,d+=l)u[f]=a.substr(d,l);a=u.join(t===Do.Scalar.BLOCK_LITERAL?`
54
- `:" ")}return Rb.stringifyString({comment:e,type:t,value:a},i,r,o)}};Cu.binary=Db});var Ri=S(Pi=>{"use strict";var Ni=I(),Bo=qe(),Fb=U(),Bb=Ue();function Ou(e,t){if(Ni.isSeq(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!Ni.isPair(i)){if(Ni.isMap(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new Bo.Pair(new Fb.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
53
+ ${r}${p}`}else return`${d}${s}${f.join(" ")}${s}${p}`}function Ei({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=_i.indentComment(t(i),e);n.push(o.trimStart())}}au.stringifyCollection=Qg});var je=S(Co=>{"use strict";var eb=xo(),tb=_o(),nb=ui(),$e=I(),xi=qe(),ib=U();function pn(e,t){let n=$e.isScalar(t)?t.value:t;for(let i of e)if($e.isPair(i)&&(i.key===t||i.key===n||$e.isScalar(i.key)&&i.key.value===n))return i}var ko=class extends nb.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($e.MAP,t),this.items=[]}static from(t,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(t),a=(l,c)=>{if(typeof o=="function")c=o.call(n,l,c);else if(Array.isArray(o)&&!o.includes(l))return;(c!==void 0||r)&&s.items.push(xi.createPair(l,c,i))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let i;$e.isPair(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new xi.Pair(t,t?.value):i=new xi.Pair(t.key,t.value);let r=pn(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);$e.isScalar(r.value)&&ib.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(t){let n=pn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=pn(this.items,t)?.value;return(!n&&$e.isScalar(r)?r.value:r)??void 0}has(t){return!!pn(this.items,t)}set(t,n){this.add(new xi.Pair(t,n),!0)}toJSON(t,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)tb.addPairToJSMap(n,r,o);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!$e.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),eb.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}};Co.YAMLMap=ko;Co.findPair=pn});var Ot=S(cu=>{"use strict";var rb=I(),lu=je(),ob={collection:"map",default:!0,nodeClass:lu.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return rb.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>lu.YAMLMap.from(e,t,n)};cu.map=ob});var Ue=S(uu=>{"use strict";var sb=sn(),ab=xo(),lb=ui(),Ci=I(),cb=U(),ub=Re(),Oo=class extends lb.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ci.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=ki(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let i=ki(t);if(typeof i!="number")return;let r=this.items[i];return!n&&Ci.isScalar(r)?r.value:r}has(t){let n=ki(t);return typeof n=="number"&&n<this.items.length}set(t,n){let i=ki(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);let r=this.items[i];Ci.isScalar(r)&&cb.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(t,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let o of this.items)i.push(ub.toJS(o,String(r++),n));return i}toString(t,n,i){return t?ab.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof r=="function"){let l=n instanceof Set?a:String(s++);a=r.call(n,l,a)}o.items.push(sb.createNode(a,void 0,i))}}return o}};function ki(e){let t=Ci.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}uu.YAMLSeq=Oo});var Tt=S(du=>{"use strict";var fb=I(),fu=Ue(),db={collection:"seq",default:!0,nodeClass:fu.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return fb.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>fu.YAMLSeq.from(e,t,n)};du.seq=db});var mn=S(pu=>{"use strict";var pb=un(),mb={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),pb.stringifyString(e,t,n,i)}};pu.string=mb});var Oi=S(yu=>{"use strict";var mu=U(),hu={identify:e=>e==null,createNode:()=>new mu.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new mu.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&hu.test.test(e)?e:t.options.nullStr};yu.nullTag=hu});var To=S(bu=>{"use strict";var hb=U(),gu={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new hb.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&gu.test.test(e)){let i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};bu.boolTag=gu});var It=S(Su=>{"use strict";function yb({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}Su.stringifyNumber=yb});var Lo=S(Ti=>{"use strict";var gb=U(),Io=It(),bb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Io.stringifyNumber},Sb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Io.stringifyNumber(e)}},vb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new gb.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Io.stringifyNumber};Ti.float=vb;Ti.floatExp=Sb;Ti.floatNaN=bb});var No=S(Li=>{"use strict";var vu=It(),Ii=e=>typeof e=="bigint"||Number.isInteger(e),Mo=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Au(e,t,n){let{value:i}=e;return Ii(i)&&i>=0?n+i.toString(t):vu.stringifyNumber(e)}var Ab={identify:e=>Ii(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Mo(e,2,8,n),stringify:e=>Au(e,8,"0o")},wb={identify:Ii,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Mo(e,0,10,n),stringify:vu.stringifyNumber},_b={identify:e=>Ii(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Mo(e,2,16,n),stringify:e=>Au(e,16,"0x")};Li.int=wb;Li.intHex=_b;Li.intOct=Ab});var _u=S(wu=>{"use strict";var Eb=Ot(),xb=Oi(),kb=Tt(),Cb=mn(),Ob=To(),Po=Lo(),Ro=No(),Tb=[Eb.map,kb.seq,Cb.string,xb.nullTag,Ob.boolTag,Ro.intOct,Ro.int,Ro.intHex,Po.floatNaN,Po.floatExp,Po.float];wu.schema=Tb});var ku=S(xu=>{"use strict";var Ib=U(),Lb=Ot(),Mb=Tt();function Eu(e){return typeof e=="bigint"||Number.isInteger(e)}var Mi=({value:e})=>JSON.stringify(e),Nb=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Mi},{identify:e=>e==null,createNode:()=>new Ib.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Mi},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Mi},{identify:Eu,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Eu(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Mi}],Pb={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Rb=[Lb.map,Mb.seq].concat(Nb,Pb);xu.schema=Rb});var Fo=S(Cu=>{"use strict";var hn=ue("buffer"),Do=U(),Db=un(),Fb={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof hn.Buffer=="function")return hn.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,r,o){if(!n)return"";let s=n,a;if(typeof hn.Buffer=="function")a=s instanceof hn.Buffer?s.toString("base64"):hn.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<s.length;++c)l+=String.fromCharCode(s[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Do.Scalar.BLOCK_LITERAL),t!==Do.Scalar.QUOTE_DOUBLE){let l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,d=0;f<c;++f,d+=l)u[f]=a.substr(d,l);a=u.join(t===Do.Scalar.BLOCK_LITERAL?`
54
+ `:" ")}return Db.stringifyString({comment:e,type:t,value:a},i,r,o)}};Cu.binary=Fb});var Ri=S(Pi=>{"use strict";var Ni=I(),Bo=qe(),Bb=U(),qb=Ue();function Ou(e,t){if(Ni.isSeq(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!Ni.isPair(i)){if(Ni.isMap(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new Bo.Pair(new Bb.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
55
55
  ${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment}
56
- ${o.comment}`:i.comment}i=r}e.items[n]=Ni.isPair(i)?i:new Bo.Pair(i)}}else t("Expected a sequence for this tag");return e}function Tu(e,t,n){let{replacer:i}=n,r=new Bb.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof i=="function"&&(s=i.call(t,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;r.items.push(Bo.createPair(a,l,n))}return r}var qb={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ou,createNode:Tu};Pi.createPairs=Tu;Pi.pairs=qb;Pi.resolvePairs=Ou});var jo=S($o=>{"use strict";var Iu=I(),qo=Re(),yn=je(),$b=Ue(),Lu=Ri(),st=class e extends $b.YAMLSeq{constructor(){super(),this.add=yn.YAMLMap.prototype.add.bind(this),this.delete=yn.YAMLMap.prototype.delete.bind(this),this.get=yn.YAMLMap.prototype.get.bind(this),this.has=yn.YAMLMap.prototype.has.bind(this),this.set=yn.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(Iu.isPair(r)?(o=qo.toJS(r.key,"",n),s=qo.toJS(r.value,o,n)):o=qo.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(t,n,i){let r=Lu.createPairs(t,n,i),o=new this;return o.items=r.items,o}};st.tag="tag:yaml.org,2002:omap";var jb={collection:"seq",identify:e=>e instanceof Map,nodeClass:st,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=Lu.resolvePairs(e,t),i=[];for(let{key:r}of n.items)Iu.isScalar(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new st,n)},createNode:(e,t,n)=>st.from(e,t,n)};$o.YAMLOMap=st;$o.omap=jb});var Du=S(Uo=>{"use strict";var Mu=U();function Nu({value:e,source:t},n){return t&&(e?Pu:Ru).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Pu={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Mu.Scalar(!0),stringify:Nu},Ru={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Mu.Scalar(!1),stringify:Nu};Uo.falseTag=Ru;Uo.trueTag=Pu});var Fu=S(Di=>{"use strict";var Ub=U(),Ko=It(),Kb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ko.stringifyNumber},Vb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ko.stringifyNumber(e)}},Yb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Ub.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:Ko.stringifyNumber};Di.float=Yb;Di.floatExp=Vb;Di.floatNaN=Kb});var qu=S(bn=>{"use strict";var Bu=It(),gn=e=>typeof e=="bigint"||Number.isInteger(e);function Fi(e,t,n,{intAsBigInt:i}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return r==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return r==="-"?-1*o:o}function Vo(e,t,n){let{value:i}=e;if(gn(i)){let r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Bu.stringifyNumber(e)}var Gb={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Fi(e,2,2,n),stringify:e=>Vo(e,2,"0b")},Wb={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Fi(e,1,8,n),stringify:e=>Vo(e,8,"0")},Hb={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Fi(e,0,10,n),stringify:Bu.stringifyNumber},Jb={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Fi(e,2,16,n),stringify:e=>Vo(e,16,"0x")};bn.int=Hb;bn.intBin=Gb;bn.intHex=Jb;bn.intOct=Wb});var Go=S(Yo=>{"use strict";var $i=I(),Bi=qe(),qi=je(),at=class e extends qi.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;$i.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Bi.Pair(t.key,null):n=new Bi.Pair(t,null),qi.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let i=qi.findPair(this.items,t);return!n&&$i.isPair(i)?$i.isScalar(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=qi.findPair(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Bi.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(Bi.createPair(s,null,i));return o}};at.tag="tag:yaml.org,2002:set";var Xb={collection:"map",identify:e=>e instanceof Set,nodeClass:at,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>at.from(e,t,n),resolve(e,t){if($i.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new at,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Yo.YAMLSet=at;Yo.set=Xb});var Ho=S(ji=>{"use strict";var Qb=It();function Wo(e,t){let n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=s=>t?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function $u(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return Qb.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));let r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var zb={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Wo(e,n),stringify:$u},Zb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Wo(e,!1),stringify:$u},ju={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(ju.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(n,i-1,r,o||0,s||0,a||0,l),u=t[8];if(u&&u!=="Z"){let f=Wo(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ji.floatTime=Zb;ji.intTime=zb;ji.timestamp=ju});var Vu=S(Ku=>{"use strict";var e0=Ot(),t0=Oi(),n0=Tt(),i0=mn(),r0=Fo(),Uu=Du(),Jo=Fu(),Ui=qu(),o0=vi(),s0=jo(),a0=Ri(),l0=Go(),Xo=Ho(),c0=[e0.map,n0.seq,i0.string,t0.nullTag,Uu.trueTag,Uu.falseTag,Ui.intBin,Ui.intOct,Ui.int,Ui.intHex,Jo.floatNaN,Jo.floatExp,Jo.float,r0.binary,o0.merge,s0.omap,a0.pairs,l0.set,Xo.intTime,Xo.floatTime,Xo.timestamp];Ku.schema=c0});var ef=S(Zo=>{"use strict";var Hu=Ot(),u0=Oi(),Ju=Tt(),f0=mn(),d0=To(),Qo=Lo(),zo=No(),p0=_u(),m0=ku(),Xu=Fo(),Sn=vi(),Qu=jo(),zu=Ri(),Yu=Vu(),Zu=Go(),Ki=Ho(),Gu=new Map([["core",p0.schema],["failsafe",[Hu.map,Ju.seq,f0.string]],["json",m0.schema],["yaml11",Yu.schema],["yaml-1.1",Yu.schema]]),Wu={binary:Xu.binary,bool:d0.boolTag,float:Qo.float,floatExp:Qo.floatExp,floatNaN:Qo.floatNaN,floatTime:Ki.floatTime,int:zo.int,intHex:zo.intHex,intOct:zo.intOct,intTime:Ki.intTime,map:Hu.map,merge:Sn.merge,null:u0.nullTag,omap:Qu.omap,pairs:zu.pairs,seq:Ju.seq,set:Zu.set,timestamp:Ki.timestamp},h0={"tag:yaml.org,2002:binary":Xu.binary,"tag:yaml.org,2002:merge":Sn.merge,"tag:yaml.org,2002:omap":Qu.omap,"tag:yaml.org,2002:pairs":zu.pairs,"tag:yaml.org,2002:set":Zu.set,"tag:yaml.org,2002:timestamp":Ki.timestamp};function y0(e,t,n){let i=Gu.get(t);if(i&&!e)return n&&!i.includes(Sn.merge)?i.concat(Sn.merge):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{let o=Array.from(Gu.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)r=r.concat(o);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Sn.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?Wu[s]:s;if(!a){let l=JSON.stringify(s),c=Object.keys(Wu).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return o.includes(a)||o.push(a),o},[])}Zo.coreKnownTags=h0;Zo.getTags=y0});var ns=S(tf=>{"use strict";var es=I(),g0=Ot(),b0=Tt(),S0=mn(),Vi=ef(),v0=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,ts=class e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?Vi.getTags(t,"compat"):t?Vi.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?Vi.coreKnownTags:{},this.tags=Vi.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,es.MAP,{value:g0.map}),Object.defineProperty(this,es.SCALAR,{value:S0.string}),Object.defineProperty(this,es.SEQ,{value:b0.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?v0:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};tf.Schema=ts});var rf=S(nf=>{"use strict";var A0=I(),is=fn(),vn=an();function w0(e,t){let n=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);l?(n.push(l),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");let r=is.createStringifyContext(e,t),{commentString:o}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let l=o(e.commentBefore);n.unshift(vn.indentComment(l,""))}let s=!1,a=null;if(e.contents){if(A0.isNode(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(vn.indentComment(u,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>s=!0,c=is.stringify(e.contents,r,()=>a=null,l);a&&(c+=vn.lineComment(c,"",o(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(is.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let l=o(e.comment);l.includes(`
56
+ ${o.comment}`:i.comment}i=r}e.items[n]=Ni.isPair(i)?i:new Bo.Pair(i)}}else t("Expected a sequence for this tag");return e}function Tu(e,t,n){let{replacer:i}=n,r=new qb.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof i=="function"&&(s=i.call(t,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;r.items.push(Bo.createPair(a,l,n))}return r}var $b={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ou,createNode:Tu};Pi.createPairs=Tu;Pi.pairs=$b;Pi.resolvePairs=Ou});var jo=S($o=>{"use strict";var Iu=I(),qo=Re(),yn=je(),jb=Ue(),Lu=Ri(),st=class e extends jb.YAMLSeq{constructor(){super(),this.add=yn.YAMLMap.prototype.add.bind(this),this.delete=yn.YAMLMap.prototype.delete.bind(this),this.get=yn.YAMLMap.prototype.get.bind(this),this.has=yn.YAMLMap.prototype.has.bind(this),this.set=yn.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(Iu.isPair(r)?(o=qo.toJS(r.key,"",n),s=qo.toJS(r.value,o,n)):o=qo.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(t,n,i){let r=Lu.createPairs(t,n,i),o=new this;return o.items=r.items,o}};st.tag="tag:yaml.org,2002:omap";var Ub={collection:"seq",identify:e=>e instanceof Map,nodeClass:st,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=Lu.resolvePairs(e,t),i=[];for(let{key:r}of n.items)Iu.isScalar(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new st,n)},createNode:(e,t,n)=>st.from(e,t,n)};$o.YAMLOMap=st;$o.omap=Ub});var Du=S(Uo=>{"use strict";var Mu=U();function Nu({value:e,source:t},n){return t&&(e?Pu:Ru).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Pu={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Mu.Scalar(!0),stringify:Nu},Ru={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Mu.Scalar(!1),stringify:Nu};Uo.falseTag=Ru;Uo.trueTag=Pu});var Fu=S(Di=>{"use strict";var Kb=U(),Ko=It(),Vb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ko.stringifyNumber},Yb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Ko.stringifyNumber(e)}},Gb={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Kb.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:Ko.stringifyNumber};Di.float=Gb;Di.floatExp=Yb;Di.floatNaN=Vb});var qu=S(bn=>{"use strict";var Bu=It(),gn=e=>typeof e=="bigint"||Number.isInteger(e);function Fi(e,t,n,{intAsBigInt:i}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return r==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return r==="-"?-1*o:o}function Vo(e,t,n){let{value:i}=e;if(gn(i)){let r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Bu.stringifyNumber(e)}var Wb={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Fi(e,2,2,n),stringify:e=>Vo(e,2,"0b")},Hb={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Fi(e,1,8,n),stringify:e=>Vo(e,8,"0")},Jb={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Fi(e,0,10,n),stringify:Bu.stringifyNumber},Xb={identify:gn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Fi(e,2,16,n),stringify:e=>Vo(e,16,"0x")};bn.int=Jb;bn.intBin=Wb;bn.intHex=Xb;bn.intOct=Hb});var Go=S(Yo=>{"use strict";var $i=I(),Bi=qe(),qi=je(),at=class e extends qi.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;$i.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Bi.Pair(t.key,null):n=new Bi.Pair(t,null),qi.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let i=qi.findPair(this.items,t);return!n&&$i.isPair(i)?$i.isScalar(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=qi.findPair(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Bi.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(Bi.createPair(s,null,i));return o}};at.tag="tag:yaml.org,2002:set";var Qb={collection:"map",identify:e=>e instanceof Set,nodeClass:at,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>at.from(e,t,n),resolve(e,t){if($i.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new at,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Yo.YAMLSet=at;Yo.set=Qb});var Ho=S(ji=>{"use strict";var zb=It();function Wo(e,t){let n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=s=>t?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function $u(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return zb.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));let r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Zb={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Wo(e,n),stringify:$u},e0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Wo(e,!1),stringify:$u},ju={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(ju.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0,c=Date.UTC(n,i-1,r,o||0,s||0,a||0,l),u=t[8];if(u&&u!=="Z"){let f=Wo(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ji.floatTime=e0;ji.intTime=Zb;ji.timestamp=ju});var Vu=S(Ku=>{"use strict";var t0=Ot(),n0=Oi(),i0=Tt(),r0=mn(),o0=Fo(),Uu=Du(),Jo=Fu(),Ui=qu(),s0=vi(),a0=jo(),l0=Ri(),c0=Go(),Xo=Ho(),u0=[t0.map,i0.seq,r0.string,n0.nullTag,Uu.trueTag,Uu.falseTag,Ui.intBin,Ui.intOct,Ui.int,Ui.intHex,Jo.floatNaN,Jo.floatExp,Jo.float,o0.binary,s0.merge,a0.omap,l0.pairs,c0.set,Xo.intTime,Xo.floatTime,Xo.timestamp];Ku.schema=u0});var ef=S(Zo=>{"use strict";var Hu=Ot(),f0=Oi(),Ju=Tt(),d0=mn(),p0=To(),Qo=Lo(),zo=No(),m0=_u(),h0=ku(),Xu=Fo(),Sn=vi(),Qu=jo(),zu=Ri(),Yu=Vu(),Zu=Go(),Ki=Ho(),Gu=new Map([["core",m0.schema],["failsafe",[Hu.map,Ju.seq,d0.string]],["json",h0.schema],["yaml11",Yu.schema],["yaml-1.1",Yu.schema]]),Wu={binary:Xu.binary,bool:p0.boolTag,float:Qo.float,floatExp:Qo.floatExp,floatNaN:Qo.floatNaN,floatTime:Ki.floatTime,int:zo.int,intHex:zo.intHex,intOct:zo.intOct,intTime:Ki.intTime,map:Hu.map,merge:Sn.merge,null:f0.nullTag,omap:Qu.omap,pairs:zu.pairs,seq:Ju.seq,set:Zu.set,timestamp:Ki.timestamp},y0={"tag:yaml.org,2002:binary":Xu.binary,"tag:yaml.org,2002:merge":Sn.merge,"tag:yaml.org,2002:omap":Qu.omap,"tag:yaml.org,2002:pairs":zu.pairs,"tag:yaml.org,2002:set":Zu.set,"tag:yaml.org,2002:timestamp":Ki.timestamp};function g0(e,t,n){let i=Gu.get(t);if(i&&!e)return n&&!i.includes(Sn.merge)?i.concat(Sn.merge):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{let o=Array.from(Gu.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)r=r.concat(o);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Sn.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?Wu[s]:s;if(!a){let l=JSON.stringify(s),c=Object.keys(Wu).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return o.includes(a)||o.push(a),o},[])}Zo.coreKnownTags=y0;Zo.getTags=g0});var ns=S(tf=>{"use strict";var es=I(),b0=Ot(),S0=Tt(),v0=mn(),Vi=ef(),A0=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,ts=class e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?Vi.getTags(t,"compat"):t?Vi.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?Vi.coreKnownTags:{},this.tags=Vi.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,es.MAP,{value:b0.map}),Object.defineProperty(this,es.SCALAR,{value:v0.string}),Object.defineProperty(this,es.SEQ,{value:S0.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?A0:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};tf.Schema=ts});var rf=S(nf=>{"use strict";var w0=I(),is=fn(),vn=an();function _0(e,t){let n=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let l=e.directives.toString(e);l?(n.push(l),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");let r=is.createStringifyContext(e,t),{commentString:o}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let l=o(e.commentBefore);n.unshift(vn.indentComment(l,""))}let s=!1,a=null;if(e.contents){if(w0.isNode(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(vn.indentComment(u,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}let l=a?void 0:()=>s=!0,c=is.stringify(e.contents,r,()=>a=null,l);a&&(c+=vn.lineComment(c,"",o(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(is.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let l=o(e.comment);l.includes(`
57
57
  `)?(n.push("..."),n.push(vn.indentComment(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=e.comment;l&&s&&(l=l.replace(/^\n+/,"")),l&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(vn.indentComment(o(l),"")))}return n.join(`
58
58
  `)+`
59
- `}nf.stringifyDocument=w0});var An=S(of=>{"use strict";var _0=on(),Lt=ui(),de=I(),E0=qe(),x0=Re(),k0=ns(),C0=rf(),rs=si(),O0=ao(),T0=sn(),os=so(),ss=class e{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,de.NODE_TYPE,{value:de.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new os.Directives({version:s}),this.setSchema(s,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){let t=Object.create(e.prototype,{[de.NODE_TYPE]:{value:de.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=de.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Mt(this.contents)&&this.contents.add(t)}addIn(t,n){Mt(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let i=rs.anchorNames(this);t.anchor=!n||i.has(n)?rs.findNewAnchor(n||"a",i):n}return new _0.Alias(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let h=b=>typeof b=="number"||b instanceof String||b instanceof Number,g=n.filter(h).map(String);g.length>0&&(n=n.concat(g)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:l,onTagObj:c,tag:u}=i??{},{onAnchor:f,setAnchors:d,sourceObjects:p}=rs.createNodeAnchors(this,s||"a"),y={aliasDuplicateObjects:o??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:p},m=T0.createNode(t,u,y);return a&&de.isCollection(m)&&(m.flow=!0),d(),m}createPair(t,n,i={}){let r=this.createNode(t,null,i),o=this.createNode(n,null,i);return new E0.Pair(r,o)}delete(t){return Mt(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Lt.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Mt(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return de.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Lt.isEmptyPath(t)?!n&&de.isScalar(this.contents)?this.contents.value:this.contents:de.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return de.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Lt.isEmptyPath(t)?this.contents!==void 0:de.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Lt.collectionFromPath(this.schema,[t],n):Mt(this.contents)&&this.contents.set(t,n)}setIn(t,n){Lt.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Lt.collectionFromPath(this.schema,Array.from(t),n):Mt(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new os.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new os.Directives({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new k0.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=x0.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:c,res:u}of a.anchors.values())o(u,c);return typeof s=="function"?O0.applyReviver(s,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return C0.stringifyDocument(this,t)}};function Mt(e){if(de.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}of.Document=ss});var En=S(_n=>{"use strict";var wn=class extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}},as=class extends wn{constructor(t,n,i){super("YAMLParseError",t,n,i)}},ls=class extends wn{constructor(t,n,i){super("YAMLWarning",t,n,i)}},I0=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
59
+ `}nf.stringifyDocument=_0});var An=S(of=>{"use strict";var E0=on(),Lt=ui(),de=I(),x0=qe(),k0=Re(),C0=ns(),O0=rf(),rs=si(),T0=ao(),I0=sn(),os=so(),ss=class e{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,de.NODE_TYPE,{value:de.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new os.Directives({version:s}),this.setSchema(s,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){let t=Object.create(e.prototype,{[de.NODE_TYPE]:{value:de.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=de.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Mt(this.contents)&&this.contents.add(t)}addIn(t,n){Mt(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let i=rs.anchorNames(this);t.anchor=!n||i.has(n)?rs.findNewAnchor(n||"a",i):n}return new E0.Alias(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let h=b=>typeof b=="number"||b instanceof String||b instanceof Number,g=n.filter(h).map(String);g.length>0&&(n=n.concat(g)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:l,onTagObj:c,tag:u}=i??{},{onAnchor:f,setAnchors:d,sourceObjects:p}=rs.createNodeAnchors(this,s||"a"),y={aliasDuplicateObjects:o??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:p},m=I0.createNode(t,u,y);return a&&de.isCollection(m)&&(m.flow=!0),d(),m}createPair(t,n,i={}){let r=this.createNode(t,null,i),o=this.createNode(n,null,i);return new x0.Pair(r,o)}delete(t){return Mt(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Lt.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Mt(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return de.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Lt.isEmptyPath(t)?!n&&de.isScalar(this.contents)?this.contents.value:this.contents:de.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return de.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Lt.isEmptyPath(t)?this.contents!==void 0:de.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Lt.collectionFromPath(this.schema,[t],n):Mt(this.contents)&&this.contents.set(t,n)}setIn(t,n){Lt.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Lt.collectionFromPath(this.schema,Array.from(t),n):Mt(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new os.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new os.Directives({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new C0.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=k0.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:c,res:u}of a.anchors.values())o(u,c);return typeof s=="function"?T0.applyReviver(s,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return O0.stringifyDocument(this,t)}};function Mt(e){if(de.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}of.Document=ss});var En=S(_n=>{"use strict";var wn=class extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}},as=class extends wn{constructor(t,n,i){super("YAMLParseError",t,n,i)}},ls=class extends wn{constructor(t,n,i){super("YAMLWarning",t,n,i)}},L0=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
60
60
  `),s=a+s}if(/[^ ]/.test(s)){let a=1,l=n.linePos[1];l?.line===i&&l.col>r&&(a=Math.max(1,Math.min(l.col-r,80-o)));let c=" ".repeat(o)+"^".repeat(a);n.message+=`:
61
61
 
62
62
  ${s}
63
63
  ${c}
64
- `}};_n.YAMLError=wn;_n.YAMLParseError=as;_n.YAMLWarning=ls;_n.prettifyError=I0});var xn=S(sf=>{"use strict";function L0(e,{flow:t,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let l=!1,c=a,u=a,f="",d="",p=!1,y=!1,m=null,h=null,g=null,b=null,v=null,x=null,k=null;for(let w of e)switch(y&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&o(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),m&&(c&&w.type!=="comment"&&w.type!=="newline"&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),w.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&w.source.includes(" ")&&(m=w),u=!0;break;case"comment":{u||o(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=w.source.substring(1)||" ";f?f+=d+A:f=A,d="",c=!1;break}case"newline":c?f?f+=w.source:(!x||n!=="seq-item-ind")&&(l=!0):d+=w.source,c=!0,p=!0,(h||g)&&(b=w),u=!0;break;case"anchor":h&&o(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&o(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=w,k??(k=w.offset),c=!1,u=!1,y=!0;break;case"tag":{g&&o(w,"MULTIPLE_TAGS","A node can have at most one tag"),g=w,k??(k=w.offset),c=!1,u=!1,y=!0;break}case n:(h||g)&&o(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),x&&o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${t??"collection"}`),x=w,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){v&&o(w,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=w,c=!1,u=!1;break}default:o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),c=!1,u=!1}let C=e[e.length-1],L=C?C.offset+C.source.length:r;return y&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:x,spaceBefore:l,comment:f,hasNewline:p,anchor:h,tag:g,newlineAfterProp:b,end:L,start:k??L}}sf.resolveProps=L0});var Yi=S(af=>{"use strict";function cs(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
65
- `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(cs(t.key)||cs(t.value))return!0}return!1;default:return!0}}af.containsNewline=cs});var us=S(lf=>{"use strict";var M0=Yi();function N0(e,t,n){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&M0.containsNewline(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}lf.flowIndentCheck=N0});var fs=S(uf=>{"use strict";var cf=I();function P0(e,t,n){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||cf.isScalar(o)&&cf.isScalar(s)&&o.value===s.value;return t.some(o=>r(o.key,n))}uf.mapIncludes=P0});var yf=S(hf=>{"use strict";var ff=qe(),R0=je(),df=xn(),D0=Yi(),pf=us(),F0=fs(),mf="All mapping items must start at the same column";function B0({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??R0.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let l=i.offset,c=null;for(let u of i.items){let{start:f,key:d,sep:p,value:y}=u,m=df.resolveProps(f,{indicator:"explicit-key-ind",next:d??p?.[0],offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0}),h=!m.found;if(h){if(d&&(d.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&r(l,"BAD_INDENT",mf)),!m.anchor&&!m.tag&&!p){c=m.end,m.comment&&(a.comment?a.comment+=`
66
- `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||D0.containsNewline(d))&&r(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==i.indent&&r(l,"BAD_INDENT",mf);n.atKey=!0;let g=m.end,b=d?e(n,d,m,r):t(n,g,f,null,m,r);n.schema.compat&&pf.flowIndentCheck(i.indent,d,r),n.atKey=!1,F0.mapIncludes(n,a.items,b)&&r(g,"DUPLICATE_KEY","Map keys must be unique");let v=df.resolveProps(p??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:r,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(l=v.end,v.found){h&&(y?.type==="block-map"&&!v.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<v.found.offset-1024&&r(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=y?e(n,y,v,r):t(n,l,p,null,v,r);n.schema.compat&&pf.flowIndentCheck(i.indent,y,r),l=x.range[2];let k=new ff.Pair(b,x);n.options.keepSourceTokens&&(k.srcToken=u),a.items.push(k)}else{h&&r(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(b.comment?b.comment+=`
67
- `+v.comment:b.comment=v.comment);let x=new ff.Pair(b);n.options.keepSourceTokens&&(x.srcToken=u),a.items.push(x)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,c??l],a}hf.resolveBlockMap=B0});var bf=S(gf=>{"use strict";var q0=Ue(),$0=xn(),j0=us();function U0({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??q0.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=i.offset,c=null;for(let{start:u,value:f}of i.items){let d=$0.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?r(d.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=d.end,d.comment&&(a.comment=d.comment);continue}let p=f?e(n,f,d,r):t(n,d.end,u,null,d,r);n.schema.compat&&j0.flowIndentCheck(i.indent,f,r),l=p.range[2],a.items.push(p)}return a.range=[i.offset,l,c??l],a}gf.resolveBlockSeq=U0});var Nt=S(Sf=>{"use strict";function K0(e,t,n,i){let r="";if(e){let o=!1,s="";for(let a of e){let{source:l,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{n&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";r?r+=s+u:r=u,s="";break}case"newline":r&&(s+=l),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:r,offset:t}}Sf.resolveEnd=K0});var _f=S(wf=>{"use strict";var V0=I(),Y0=qe(),vf=je(),G0=Ue(),W0=Nt(),Af=xn(),H0=Yi(),J0=fs(),ds="Block collections are not allowed within flow collections",ps=e=>e&&(e.type==="block-map"||e.type==="block-seq");function X0({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",l=o?.nodeClass??(s?vf.YAMLMap:G0.YAMLSeq),c=new l(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let h=0;h<i.items.length;++h){let g=i.items[h],{start:b,key:v,sep:x,value:k}=g,C=Af.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:v??x?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!k){h===0&&C.comma?r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<i.items.length-1&&r(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),C.comment&&(c.comment?c.comment+=`
68
- `+C.comment:c.comment=C.comment),f=C.end;continue}!s&&n.options.strict&&H0.containsNewline(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)C.comma&&r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(C.comma||r(C.start,"MISSING_CHAR",`Missing , between ${a} items`),C.comment){let L="";e:for(let w of b)switch(w.type){case"comma":case"space":break;case"comment":L=w.source.substring(1);break e;default:break e}if(L){let w=c.items[c.items.length-1];V0.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
64
+ `}};_n.YAMLError=wn;_n.YAMLParseError=as;_n.YAMLWarning=ls;_n.prettifyError=L0});var xn=S(sf=>{"use strict";function M0(e,{flow:t,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let l=!1,c=a,u=a,f="",d="",p=!1,y=!1,m=null,h=null,g=null,b=null,v=null,x=null,k=null;for(let w of e)switch(y&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&o(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),m&&(c&&w.type!=="comment"&&w.type!=="newline"&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),w.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&w.source.includes(" ")&&(m=w),u=!0;break;case"comment":{u||o(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=w.source.substring(1)||" ";f?f+=d+A:f=A,d="",c=!1;break}case"newline":c?f?f+=w.source:(!x||n!=="seq-item-ind")&&(l=!0):d+=w.source,c=!0,p=!0,(h||g)&&(b=w),u=!0;break;case"anchor":h&&o(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&o(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=w,k??(k=w.offset),c=!1,u=!1,y=!0;break;case"tag":{g&&o(w,"MULTIPLE_TAGS","A node can have at most one tag"),g=w,k??(k=w.offset),c=!1,u=!1,y=!0;break}case n:(h||g)&&o(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),x&&o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${t??"collection"}`),x=w,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){v&&o(w,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=w,c=!1,u=!1;break}default:o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),c=!1,u=!1}let C=e[e.length-1],L=C?C.offset+C.source.length:r;return y&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:x,spaceBefore:l,comment:f,hasNewline:p,anchor:h,tag:g,newlineAfterProp:b,end:L,start:k??L}}sf.resolveProps=M0});var Yi=S(af=>{"use strict";function cs(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
65
+ `))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(cs(t.key)||cs(t.value))return!0}return!1;default:return!0}}af.containsNewline=cs});var us=S(lf=>{"use strict";var N0=Yi();function P0(e,t,n){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&N0.containsNewline(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}lf.flowIndentCheck=P0});var fs=S(uf=>{"use strict";var cf=I();function R0(e,t,n){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||cf.isScalar(o)&&cf.isScalar(s)&&o.value===s.value;return t.some(o=>r(o.key,n))}uf.mapIncludes=R0});var yf=S(hf=>{"use strict";var ff=qe(),D0=je(),df=xn(),F0=Yi(),pf=us(),B0=fs(),mf="All mapping items must start at the same column";function q0({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??D0.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let l=i.offset,c=null;for(let u of i.items){let{start:f,key:d,sep:p,value:y}=u,m=df.resolveProps(f,{indicator:"explicit-key-ind",next:d??p?.[0],offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0}),h=!m.found;if(h){if(d&&(d.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&r(l,"BAD_INDENT",mf)),!m.anchor&&!m.tag&&!p){c=m.end,m.comment&&(a.comment?a.comment+=`
66
+ `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||F0.containsNewline(d))&&r(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==i.indent&&r(l,"BAD_INDENT",mf);n.atKey=!0;let g=m.end,b=d?e(n,d,m,r):t(n,g,f,null,m,r);n.schema.compat&&pf.flowIndentCheck(i.indent,d,r),n.atKey=!1,B0.mapIncludes(n,a.items,b)&&r(g,"DUPLICATE_KEY","Map keys must be unique");let v=df.resolveProps(p??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:r,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(l=v.end,v.found){h&&(y?.type==="block-map"&&!v.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<v.found.offset-1024&&r(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=y?e(n,y,v,r):t(n,l,p,null,v,r);n.schema.compat&&pf.flowIndentCheck(i.indent,y,r),l=x.range[2];let k=new ff.Pair(b,x);n.options.keepSourceTokens&&(k.srcToken=u),a.items.push(k)}else{h&&r(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(b.comment?b.comment+=`
67
+ `+v.comment:b.comment=v.comment);let x=new ff.Pair(b);n.options.keepSourceTokens&&(x.srcToken=u),a.items.push(x)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,c??l],a}hf.resolveBlockMap=q0});var bf=S(gf=>{"use strict";var $0=Ue(),j0=xn(),U0=us();function K0({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??$0.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=i.offset,c=null;for(let{start:u,value:f}of i.items){let d=j0.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:l,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?r(d.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=d.end,d.comment&&(a.comment=d.comment);continue}let p=f?e(n,f,d,r):t(n,d.end,u,null,d,r);n.schema.compat&&U0.flowIndentCheck(i.indent,f,r),l=p.range[2],a.items.push(p)}return a.range=[i.offset,l,c??l],a}gf.resolveBlockSeq=K0});var Nt=S(Sf=>{"use strict";function V0(e,t,n,i){let r="";if(e){let o=!1,s="";for(let a of e){let{source:l,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{n&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";r?r+=s+u:r=u,s="";break}case"newline":r&&(s+=l),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:r,offset:t}}Sf.resolveEnd=V0});var _f=S(wf=>{"use strict";var Y0=I(),G0=qe(),vf=je(),W0=Ue(),H0=Nt(),Af=xn(),J0=Yi(),X0=fs(),ds="Block collections are not allowed within flow collections",ps=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Q0({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",l=o?.nodeClass??(s?vf.YAMLMap:W0.YAMLSeq),c=new l(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let h=0;h<i.items.length;++h){let g=i.items[h],{start:b,key:v,sep:x,value:k}=g,C=Af.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:v??x?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!k){h===0&&C.comma?r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<i.items.length-1&&r(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),C.comment&&(c.comment?c.comment+=`
68
+ `+C.comment:c.comment=C.comment),f=C.end;continue}!s&&n.options.strict&&J0.containsNewline(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)C.comma&&r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(C.comma||r(C.start,"MISSING_CHAR",`Missing , between ${a} items`),C.comment){let L="";e:for(let w of b)switch(w.type){case"comma":case"space":break;case"comment":L=w.source.substring(1);break e;default:break e}if(L){let w=c.items[c.items.length-1];Y0.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
69
69
  `+L:w.comment=L,C.comment=C.comment.substring(L.length+1)}}if(!s&&!x&&!C.found){let L=k?e(n,k,C,r):t(n,C.end,x,null,C,r);c.items.push(L),f=L.range[2],ps(k)&&r(L.range,"BLOCK_IN_FLOW",ds)}else{n.atKey=!0;let L=C.end,w=v?e(n,v,C,r):t(n,L,b,null,C,r);ps(v)&&r(w.range,"BLOCK_IN_FLOW",ds),n.atKey=!1;let A=Af.resolveProps(x??[],{flow:a,indicator:"map-value-ind",next:k,offset:w.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(A.found){if(!s&&!C.found&&n.options.strict){if(x)for(let T of x){if(T===A.found)break;if(T.type==="newline"){r(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<A.found.offset-1024&&r(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source?.[0]===":"?r(k,"MISSING_CHAR",`Missing space after : in ${a}`):r(A.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let O=k?e(n,k,A,r):A.found?t(n,A.end,x,null,A,r):null;O?ps(k)&&r(O.range,"BLOCK_IN_FLOW",ds):A.comment&&(w.comment?w.comment+=`
70
- `+A.comment:w.comment=A.comment);let E=new Y0.Pair(w,O);if(n.options.keepSourceTokens&&(E.srcToken=g),s){let T=c;J0.mapIncludes(n,T.items,w)&&r(L,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(E)}else{let T=new vf.YAMLMap(n.schema);T.flow=!0,T.items.push(E);let $=(O??w).range;T.range=[w.range[0],$[1],$[2]],c.items.push(T)}f=O?O.range[2]:A.end}}let d=s?"}":"]",[p,...y]=i.end,m=f;if(p?.source===d)m=p.offset+p.source.length;else{let h=a[0].toUpperCase()+a.substring(1),g=u?`${h} must end with a ${d}`:`${h} in block collection must be sufficiently indented and end with a ${d}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",g),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let h=W0.resolveEnd(y,m,n.options.strict,r);h.comment&&(c.comment?c.comment+=`
71
- `+h.comment:c.comment=h.comment),c.range=[i.offset,m,h.offset]}else c.range=[i.offset,m,m];return c}wf.resolveFlowCollection=X0});var xf=S(Ef=>{"use strict";var Q0=I(),z0=U(),Z0=je(),eS=Ue(),tS=yf(),nS=bf(),iS=_f();function ms(e,t,n,i,r,o){let s=n.type==="block-map"?tS.resolveBlockMap(e,t,n,i,o):n.type==="block-seq"?nS.resolveBlockSeq(e,t,n,i,o):iS.resolveFlowCollection(e,t,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function rS(e,t,n,i,r){let o=i.tag,s=o?t.directives.tagName(o.source,d=>r(o,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:p}=i,y=d&&o?d.offset>o.offset?d:o:d??o;y&&(!p||p.offset<y.offset)&&r(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===Z0.YAMLMap.tagName&&a==="map"||s===eS.YAMLSeq.tagName&&a==="seq")return ms(e,t,n,r,s);let l=t.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!l){let d=t.schema.knownTags[s];if(d?.collection===a)t.schema.tags.push(Object.assign({},d,{default:!1})),l=d;else return d?r(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),ms(e,t,n,r,s)}let c=ms(e,t,n,r,s,l),u=l.resolve?.(c,d=>r(o,"TAG_RESOLVE_FAILED",d),t.options)??c,f=Q0.isNode(u)?u:new z0.Scalar(u);return f.range=c.range,f.tag=s,l?.format&&(f.format=l.format),f}Ef.composeCollection=rS});var ys=S(kf=>{"use strict";var hs=U();function oS(e,t,n){let i=t.offset,r=sS(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?hs.Scalar.BLOCK_FOLDED:hs.Scalar.BLOCK_LITERAL,s=t.source?aS(t.source):[],a=s.length;for(let m=s.length-1;m>=0;--m){let h=s[m][1];if(h===""||h==="\r")a=m;else break}if(a===0){let m=r.chomp==="+"&&s.length>0?`
70
+ `+A.comment:w.comment=A.comment);let E=new G0.Pair(w,O);if(n.options.keepSourceTokens&&(E.srcToken=g),s){let T=c;X0.mapIncludes(n,T.items,w)&&r(L,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(E)}else{let T=new vf.YAMLMap(n.schema);T.flow=!0,T.items.push(E);let $=(O??w).range;T.range=[w.range[0],$[1],$[2]],c.items.push(T)}f=O?O.range[2]:A.end}}let d=s?"}":"]",[p,...y]=i.end,m=f;if(p?.source===d)m=p.offset+p.source.length;else{let h=a[0].toUpperCase()+a.substring(1),g=u?`${h} must end with a ${d}`:`${h} in block collection must be sufficiently indented and end with a ${d}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",g),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let h=H0.resolveEnd(y,m,n.options.strict,r);h.comment&&(c.comment?c.comment+=`
71
+ `+h.comment:c.comment=h.comment),c.range=[i.offset,m,h.offset]}else c.range=[i.offset,m,m];return c}wf.resolveFlowCollection=Q0});var xf=S(Ef=>{"use strict";var z0=I(),Z0=U(),eS=je(),tS=Ue(),nS=yf(),iS=bf(),rS=_f();function ms(e,t,n,i,r,o){let s=n.type==="block-map"?nS.resolveBlockMap(e,t,n,i,o):n.type==="block-seq"?iS.resolveBlockSeq(e,t,n,i,o):rS.resolveFlowCollection(e,t,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function oS(e,t,n,i,r){let o=i.tag,s=o?t.directives.tagName(o.source,d=>r(o,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:p}=i,y=d&&o?d.offset>o.offset?d:o:d??o;y&&(!p||p.offset<y.offset)&&r(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===eS.YAMLMap.tagName&&a==="map"||s===tS.YAMLSeq.tagName&&a==="seq")return ms(e,t,n,r,s);let l=t.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!l){let d=t.schema.knownTags[s];if(d?.collection===a)t.schema.tags.push(Object.assign({},d,{default:!1})),l=d;else return d?r(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),ms(e,t,n,r,s)}let c=ms(e,t,n,r,s,l),u=l.resolve?.(c,d=>r(o,"TAG_RESOLVE_FAILED",d),t.options)??c,f=z0.isNode(u)?u:new Z0.Scalar(u);return f.range=c.range,f.tag=s,l?.format&&(f.format=l.format),f}Ef.composeCollection=oS});var ys=S(kf=>{"use strict";var hs=U();function sS(e,t,n){let i=t.offset,r=aS(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?hs.Scalar.BLOCK_FOLDED:hs.Scalar.BLOCK_LITERAL,s=t.source?lS(t.source):[],a=s.length;for(let m=s.length-1;m>=0;--m){let h=s[m][1];if(h===""||h==="\r")a=m;else break}if(a===0){let m=r.chomp==="+"&&s.length>0?`
72
72
  `.repeat(Math.max(1,s.length-1)):"",h=i+r.length;return t.source&&(h+=t.source.length),{value:m,type:o,comment:r.comment,range:[i,h,h]}}let l=t.indent+r.indent,c=t.offset+r.length,u=0;for(let m=0;m<a;++m){let[h,g]=s[m];if(g===""||g==="\r")r.indent===0&&h.length>l&&(l=h.length);else{h.length<l&&n(c+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=h.length),u=m,l===0&&!e.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=h.length+g.length+1}for(let m=s.length-1;m>=a;--m)s[m][0].length>l&&(a=m+1);let f="",d="",p=!1;for(let m=0;m<u;++m)f+=s[m][0].slice(l)+`
73
73
  `;for(let m=u;m<a;++m){let[h,g]=s[m];c+=h.length+g.length+1;let b=g[g.length-1]==="\r";if(b&&(g=g.slice(0,-1)),g&&h.length<l){let x=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-g.length-(b?2:1),"BAD_INDENT",x),h=""}o===hs.Scalar.BLOCK_LITERAL?(f+=d+h.slice(l)+g,d=`
74
74
  `):h.length>l||g[0]===" "?(d===" "?d=`
@@ -83,41 +83,41 @@ ${c}
83
83
  `+s[m][0].slice(l);f[f.length-1]!==`
84
84
  `&&(f+=`
85
85
  `);break;default:f+=`
86
- `}let y=i+r.length+t.source.length;return{value:f,type:o,comment:r.comment,range:[i,y,y]}}function sS({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=t[0],o=r[0],s=0,a="",l=-1;for(let d=1;d<r.length;++d){let p=r[d];if(!a&&(p==="-"||p==="+"))a=p;else{let y=Number(p);!s&&y?s=y:l===-1&&(l=e+d)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",f=r.length;for(let d=1;d<t.length;++d){let p=t[d];switch(p.type){case"space":c=!0;case"newline":f+=p.source.length;break;case"comment":n&&!c&&i(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":i(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;i(p,"UNEXPECTED_TOKEN",y);let m=p.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function aS(e){let t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),o=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let s=1;s<t.length;s+=2)o.push([t[s],t[s+1]]);return o}kf.resolveBlockScalar=oS});var bs=S(Of=>{"use strict";var gs=U(),lS=Nt();function cS(e,t,n){let{offset:i,type:r,source:o,end:s}=e,a,l,c=(d,p,y)=>n(i+d,p,y);switch(r){case"scalar":a=gs.Scalar.PLAIN,l=uS(o,c);break;case"single-quoted-scalar":a=gs.Scalar.QUOTE_SINGLE,l=fS(o,c);break;case"double-quoted-scalar":a=gs.Scalar.QUOTE_DOUBLE,l=dS(o,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,f=lS.resolveEnd(s,u,t,n);return{value:l,type:a,comment:f.comment,range:[i,u,f.offset]}}function uS(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Cf(e)}function fS(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Cf(e.slice(1,-1)).replace(/''/g,"'")}function Cf(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
86
+ `}let y=i+r.length+t.source.length;return{value:f,type:o,comment:r.comment,range:[i,y,y]}}function aS({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=t[0],o=r[0],s=0,a="",l=-1;for(let d=1;d<r.length;++d){let p=r[d];if(!a&&(p==="-"||p==="+"))a=p;else{let y=Number(p);!s&&y?s=y:l===-1&&(l=e+d)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",f=r.length;for(let d=1;d<t.length;++d){let p=t[d];switch(p.type){case"space":c=!0;case"newline":f+=p.source.length;break;case"comment":n&&!c&&i(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":i(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;i(p,"UNEXPECTED_TOKEN",y);let m=p.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function lS(e){let t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),o=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let s=1;s<t.length;s+=2)o.push([t[s],t[s+1]]);return o}kf.resolveBlockScalar=sS});var bs=S(Of=>{"use strict";var gs=U(),cS=Nt();function uS(e,t,n){let{offset:i,type:r,source:o,end:s}=e,a,l,c=(d,p,y)=>n(i+d,p,y);switch(r){case"scalar":a=gs.Scalar.PLAIN,l=fS(o,c);break;case"single-quoted-scalar":a=gs.Scalar.QUOTE_SINGLE,l=dS(o,c);break;case"double-quoted-scalar":a=gs.Scalar.QUOTE_DOUBLE,l=pS(o,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,f=cS.resolveEnd(s,u,t,n);return{value:l,type:a,comment:f.comment,range:[i,u,f.offset]}}function fS(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Cf(e)}function dS(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Cf(e.slice(1,-1)).replace(/''/g,"'")}function Cf(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
87
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
88
88
  `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let r=i[1],o=" ",s=t.lastIndex;for(n.lastIndex=s;i=n.exec(e);)i[1]===""?o===`
89
89
  `?r+=o:o=`
90
- `:(r+=o+i[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,i=a.exec(e),r+o+(i?.[1]??"")}function dS(e,t){let n="";for(let i=1;i<e.length-1;++i){let r=e[i];if(!(r==="\r"&&e[i+1]===`
90
+ `:(r+=o+i[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,i=a.exec(e),r+o+(i?.[1]??"")}function pS(e,t){let n="";for(let i=1;i<e.length-1;++i){let r=e[i];if(!(r==="\r"&&e[i+1]===`
91
91
  `))if(r===`
92
- `){let{fold:o,offset:s}=pS(e,i);n+=o,i=s}else if(r==="\\"){let o=e[++i],s=mS[o];if(s)n+=s;else if(o===`
92
+ `){let{fold:o,offset:s}=mS(e,i);n+=o,i=s}else if(r==="\\"){let o=e[++i],s=hS[o];if(s)n+=s;else if(o===`
93
93
  `)for(o=e[i+1];o===" "||o===" ";)o=e[++i+1];else if(o==="\r"&&e[i+1]===`
94
- `)for(o=e[++i+1];o===" "||o===" ";)o=e[++i+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=hS(e,i+1,a,t),i+=a}else{let a=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let o=i,s=e[i+1];for(;s===" "||s===" ";)s=e[++i+1];s!==`
94
+ `)for(o=e[++i+1];o===" "||o===" ";)o=e[++i+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=yS(e,i+1,a,t),i+=a}else{let a=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let o=i,s=e[i+1];for(;s===" "||s===" ";)s=e[++i+1];s!==`
95
95
  `&&!(s==="\r"&&e[i+2]===`
96
- `)&&(n+=i>o?e.slice(o,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function pS(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
96
+ `)&&(n+=i>o?e.slice(o,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function mS(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
97
97
  `||i==="\r")&&!(i==="\r"&&e[t+2]!==`
98
98
  `);)i===`
99
99
  `&&(n+=`
100
- `),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}var mS={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
101
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hS(e,t,n,i){let r=e.substr(t,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Of.resolveFlowScalar=cS});var Lf=S(If=>{"use strict";var lt=I(),Tf=U(),yS=ys(),gS=bs();function bS(e,t,n,i){let{value:r,type:o,comment:s,range:a}=t.type==="block-scalar"?yS.resolveBlockScalar(e,t,i):gS.resolveFlowScalar(t,e.options.strict,i),l=n?e.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,c;e.options.stringKeys&&e.atKey?c=e.schema[lt.SCALAR]:l?c=SS(e.schema,r,l,n,i):t.type==="scalar"?c=vS(e,r,t,i):c=e.schema[lt.SCALAR];let u;try{let f=c.resolve(r,d=>i(n??t,"TAG_RESOLVE_FAILED",d),e.options);u=lt.isScalar(f)?f:new Tf.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",d),u=new Tf.Scalar(r)}return u.range=a,u.source=r,o&&(u.type=o),l&&(u.tag=l),c.format&&(u.format=c.format),s&&(u.comment=s),u}function SS(e,t,n,i,r){if(n==="!")return e[lt.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[lt.SCALAR])}function vS({atKey:e,directives:t,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[lt.SCALAR];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(i))??n[lt.SCALAR];if(s.tag!==a.tag){let l=t.tagString(s.tag),c=t.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;o(r,"TAG_RESOLVE_FAILED",u,!0)}}return s}If.composeScalar=bS});var Nf=S(Mf=>{"use strict";function AS(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];r?.type==="space";)e+=r.source.length,r=t[++i];break}}return e}Mf.emptyScalarPosition=AS});var Df=S(vs=>{"use strict";var wS=on(),_S=I(),ES=xf(),Pf=Lf(),xS=Nt(),kS=Nf(),CS={composeNode:Rf,composeEmptyNode:Ss};function Rf(e,t,n,i){let r=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:l}=n,c,u=!0;switch(t.type){case"alias":c=OS(e,t,i),(a||l)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Pf.composeScalar(e,t,l,i),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=ES.composeCollection(CS,e,t,n,i),a&&(c.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",d)}break;default:{let f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=Ss(e,t.offset,void 0,null,n,i)),a&&c.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!_S.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(c.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?c.comment=s:c.commentBefore=s),e.options.keepSourceTokens&&u&&(c.srcToken=t),c}function Ss(e,t,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:l},c){let u={type:"scalar",offset:kS.emptyScalarPosition(t,n,i),indent:-1,source:""},f=Pf.composeScalar(e,u,a,c);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&c(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=l),f}function OS({options:e},{offset:t,source:n,end:i},r){let o=new wS.Alias(n.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=xS.resolveEnd(i,s,e.strict,r);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}vs.composeEmptyNode=Ss;vs.composeNode=Rf});var qf=S(Bf=>{"use strict";var TS=An(),Ff=Df(),IS=Nt(),LS=xn();function MS(e,t,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:t},e),l=new TS.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=LS.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?Ff.composeNode(c,r,u,s):Ff.composeEmptyNode(c,u.end,i,null,u,s);let f=l.contents.range[2],d=IS.resolveEnd(o,f,!1,s);return d.comment&&(l.comment=d.comment),l.range=[n,f,d.offset],l}Bf.composeDoc=MS});var ws=S(Uf=>{"use strict";var NS=ue("process"),PS=so(),RS=An(),kn=En(),$f=I(),DS=qf(),FS=Nt();function Cn(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function jf(e){let t="",n=!1,i=!1;for(let r=0;r<e.length;++r){let o=e[r];switch(o[0]){case"#":t+=(t===""?"":i?`
100
+ `),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}var hS={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
101
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yS(e,t,n,i){let r=e.substr(t,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Of.resolveFlowScalar=uS});var Lf=S(If=>{"use strict";var lt=I(),Tf=U(),gS=ys(),bS=bs();function SS(e,t,n,i){let{value:r,type:o,comment:s,range:a}=t.type==="block-scalar"?gS.resolveBlockScalar(e,t,i):bS.resolveFlowScalar(t,e.options.strict,i),l=n?e.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,c;e.options.stringKeys&&e.atKey?c=e.schema[lt.SCALAR]:l?c=vS(e.schema,r,l,n,i):t.type==="scalar"?c=AS(e,r,t,i):c=e.schema[lt.SCALAR];let u;try{let f=c.resolve(r,d=>i(n??t,"TAG_RESOLVE_FAILED",d),e.options);u=lt.isScalar(f)?f:new Tf.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",d),u=new Tf.Scalar(r)}return u.range=a,u.source=r,o&&(u.type=o),l&&(u.tag=l),c.format&&(u.format=c.format),s&&(u.comment=s),u}function vS(e,t,n,i,r){if(n==="!")return e[lt.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[lt.SCALAR])}function AS({atKey:e,directives:t,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[lt.SCALAR];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(i))??n[lt.SCALAR];if(s.tag!==a.tag){let l=t.tagString(s.tag),c=t.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;o(r,"TAG_RESOLVE_FAILED",u,!0)}}return s}If.composeScalar=SS});var Nf=S(Mf=>{"use strict";function wS(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];r?.type==="space";)e+=r.source.length,r=t[++i];break}}return e}Mf.emptyScalarPosition=wS});var Df=S(vs=>{"use strict";var _S=on(),ES=I(),xS=xf(),Pf=Lf(),kS=Nt(),CS=Nf(),OS={composeNode:Rf,composeEmptyNode:Ss};function Rf(e,t,n,i){let r=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:l}=n,c,u=!0;switch(t.type){case"alias":c=TS(e,t,i),(a||l)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Pf.composeScalar(e,t,l,i),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=xS.composeCollection(OS,e,t,n,i),a&&(c.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",d)}break;default:{let f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=Ss(e,t.offset,void 0,null,n,i)),a&&c.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ES.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(c.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?c.comment=s:c.commentBefore=s),e.options.keepSourceTokens&&u&&(c.srcToken=t),c}function Ss(e,t,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:l},c){let u={type:"scalar",offset:CS.emptyScalarPosition(t,n,i),indent:-1,source:""},f=Pf.composeScalar(e,u,a,c);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&c(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=l),f}function TS({options:e},{offset:t,source:n,end:i},r){let o=new _S.Alias(n.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=kS.resolveEnd(i,s,e.strict,r);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}vs.composeEmptyNode=Ss;vs.composeNode=Rf});var qf=S(Bf=>{"use strict";var IS=An(),Ff=Df(),LS=Nt(),MS=xn();function NS(e,t,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:t},e),l=new IS.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=MS.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?Ff.composeNode(c,r,u,s):Ff.composeEmptyNode(c,u.end,i,null,u,s);let f=l.contents.range[2],d=LS.resolveEnd(o,f,!1,s);return d.comment&&(l.comment=d.comment),l.range=[n,f,d.offset],l}Bf.composeDoc=NS});var ws=S(Uf=>{"use strict";var PS=ue("process"),RS=so(),DS=An(),kn=En(),$f=I(),FS=qf(),BS=Nt();function Cn(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function jf(e){let t="",n=!1,i=!1;for(let r=0;r<e.length;++r){let o=e[r];switch(o[0]){case"#":t+=(t===""?"":i?`
102
102
 
103
103
  `:`
104
- `)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}var As=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let s=Cn(n);o?this.warnings.push(new kn.YAMLWarning(s,i,r)):this.errors.push(new kn.YAMLParseError(s,i,r))},this.directives=new PS.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:i,afterEmptyLine:r}=jf(this.prelude);if(i){let o=t.contents;if(n)t.comment=t.comment?`${t.comment}
104
+ `)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}var As=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let s=Cn(n);o?this.warnings.push(new kn.YAMLWarning(s,i,r)):this.errors.push(new kn.YAMLParseError(s,i,r))},this.directives=new RS.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:i,afterEmptyLine:r}=jf(this.prelude);if(i){let o=t.contents;if(n)t.comment=t.comment?`${t.comment}
105
105
  ${i}`:i;else if(r||t.directives.docStart||!o)t.commentBefore=i;else if($f.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];$f.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i}
106
106
  ${a}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i}
107
- ${s}`:i}}if(n){for(let o=0;o<this.errors.length;++o)t.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)t.warnings.push(this.warnings[o])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:jf(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(let r of t)yield*this.next(r);yield*this.end(n,i)}*next(t){switch(NS.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,i,r)=>{let o=Cn(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=DS.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new kn.YAMLParseError(Cn(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new kn.YAMLParseError(Cn(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=FS.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
108
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new kn.YAMLParseError(Cn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let i=Object.assign({_directives:this.directives},this.options),r=new RS.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};Uf.Composer=As});var Yf=S(Gi=>{"use strict";var BS=ys(),qS=bs(),$S=En(),Kf=un();function jS(e,t=!0,n){if(e){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new $S.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return qS.resolveFlowScalar(e,t,i);case"block-scalar":return BS.resolveBlockScalar({options:{strict:t}},e,i)}}return null}function US(e,t){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=t,a=Kf.stringifyString({type:s,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:i,source:`
107
+ ${s}`:i}}if(n){for(let o=0;o<this.errors.length;++o)t.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)t.warnings.push(this.warnings[o])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:jf(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(let r of t)yield*this.next(r);yield*this.end(n,i)}*next(t){switch(PS.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,i,r)=>{let o=Cn(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=FS.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new kn.YAMLParseError(Cn(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new kn.YAMLParseError(Cn(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=BS.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
108
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new kn.YAMLParseError(Cn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let i=Object.assign({_directives:this.directives},this.options),r=new DS.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};Uf.Composer=As});var Yf=S(Gi=>{"use strict";var qS=ys(),$S=bs(),jS=En(),Kf=un();function US(e,t=!0,n){if(e){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new jS.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return $S.resolveFlowScalar(e,t,i);case"block-scalar":return qS.resolveBlockScalar({options:{strict:t}},e,i)}}return null}function KS(e,t){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=t,a=Kf.stringifyString({type:s,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:i,source:`
109
109
  `}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
110
110
  `),u=a.substring(0,c),f=a.substring(c+1)+`
111
111
  `,d=[{type:"block-scalar-header",offset:o,indent:i,source:u}];return Vf(d,l)||d.push({type:"newline",offset:-1,indent:i,source:`
112
- `}),{type:"block-scalar",offset:o,indent:i,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:l};default:return{type:"scalar",offset:o,indent:i,source:a,end:l}}}function KS(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=Kf.stringifyString({type:s,value:t},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":VS(e,l);break;case'"':_s(e,l,"double-quoted-scalar");break;case"'":_s(e,l,"single-quoted-scalar");break;default:_s(e,l,"scalar")}}function VS(e,t){let n=t.indexOf(`
112
+ `}),{type:"block-scalar",offset:o,indent:i,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:l};default:return{type:"scalar",offset:o,indent:i,source:a,end:l}}}function VS(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=Kf.stringifyString({type:s,value:t},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":YS(e,l);break;case'"':_s(e,l,"double-quoted-scalar");break;case"'":_s(e,l,"single-quoted-scalar");break;default:_s(e,l,"scalar")}}function YS(e,t){let n=t.indexOf(`
113
113
  `),i=t.substring(0,n),r=t.substring(n+1)+`
114
114
  `;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,e.source=r}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];Vf(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
115
115
  `});for(let l of Object.keys(e))l!=="type"&&l!=="offset"&&delete e[l];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:r})}}function Vf(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function _s(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let i=e.props.slice(1),r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(let o of i)o.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
116
- `};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}Gi.createScalarToken=US;Gi.resolveAsScalar=jS;Gi.setScalarValue=KS});var Wf=S(Gf=>{"use strict";var YS=e=>"type"in e?Hi(e):Wi(e);function Hi(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=Hi(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Wi(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Wi(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Wi(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function Wi({start:e,key:t,sep:n,value:i}){let r="";for(let o of e)r+=o.source;if(t&&(r+=Hi(t)),n)for(let o of n)r+=o.source;return i&&(r+=Hi(i)),r}Gf.stringify=YS});var Qf=S(Xf=>{"use strict";var Es=Symbol("break visit"),GS=Symbol("skip children"),Hf=Symbol("remove item");function ct(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),Jf(Object.freeze([]),e,t)}ct.BREAK=Es;ct.SKIP=GS;ct.REMOVE=Hf;ct.itemAtPath=(e,t)=>{let n=e;for(let[i,r]of t){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};ct.parentCollection=(e,t)=>{let n=ct.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Jf(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=t[r];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=Jf(Object.freeze(e.concat([[r,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===Es)return Es;a===Hf&&(o.items.splice(s,1),s-=1)}}typeof i=="function"&&r==="key"&&(i=i(t,e))}}return typeof i=="function"?i(t,e):i}Xf.visit=ct});var Ji=S(le=>{"use strict";var xs=Yf(),WS=Wf(),HS=Qf(),ks="\uFEFF",Cs="",Os="",Ts="",JS=e=>!!e&&"items"in e,XS=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function QS(e){switch(e){case ks:return"<BOM>";case Cs:return"<DOC>";case Os:return"<FLOW_END>";case Ts:return"<SCALAR>";default:return JSON.stringify(e)}}function zS(e){switch(e){case ks:return"byte-order-mark";case Cs:return"doc-mode";case Os:return"flow-error-end";case Ts:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
116
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}Gi.createScalarToken=KS;Gi.resolveAsScalar=US;Gi.setScalarValue=VS});var Wf=S(Gf=>{"use strict";var GS=e=>"type"in e?Hi(e):Wi(e);function Hi(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=Hi(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Wi(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Wi(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Wi(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function Wi({start:e,key:t,sep:n,value:i}){let r="";for(let o of e)r+=o.source;if(t&&(r+=Hi(t)),n)for(let o of n)r+=o.source;return i&&(r+=Hi(i)),r}Gf.stringify=GS});var Qf=S(Xf=>{"use strict";var Es=Symbol("break visit"),WS=Symbol("skip children"),Hf=Symbol("remove item");function ct(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),Jf(Object.freeze([]),e,t)}ct.BREAK=Es;ct.SKIP=WS;ct.REMOVE=Hf;ct.itemAtPath=(e,t)=>{let n=e;for(let[i,r]of t){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};ct.parentCollection=(e,t)=>{let n=ct.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Jf(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=t[r];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=Jf(Object.freeze(e.concat([[r,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===Es)return Es;a===Hf&&(o.items.splice(s,1),s-=1)}}typeof i=="function"&&r==="key"&&(i=i(t,e))}}return typeof i=="function"?i(t,e):i}Xf.visit=ct});var Ji=S(le=>{"use strict";var xs=Yf(),HS=Wf(),JS=Qf(),ks="\uFEFF",Cs="",Os="",Ts="",XS=e=>!!e&&"items"in e,QS=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function zS(e){switch(e){case ks:return"<BOM>";case Cs:return"<DOC>";case Os:return"<FLOW_END>";case Ts:return"<SCALAR>";default:return JSON.stringify(e)}}function ZS(e){switch(e){case ks:return"byte-order-mark";case Cs:return"doc-mode";case Os:return"flow-error-end";case Ts:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
117
117
  `:case`\r
118
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}le.createScalarToken=xs.createScalarToken;le.resolveAsScalar=xs.resolveAsScalar;le.setScalarValue=xs.setScalarValue;le.stringify=WS.stringify;le.visit=HS.visit;le.BOM=ks;le.DOCUMENT=Cs;le.FLOW_END=Os;le.SCALAR=Ts;le.isCollection=JS;le.isScalar=XS;le.prettyToken=QS;le.tokenType=zS});var Ms=S(Zf=>{"use strict";var On=Ji();function me(e){switch(e){case void 0:case" ":case`
119
- `:case"\r":case" ":return!0;default:return!1}}var zf=new Set("0123456789ABCDEFabcdef"),ZS=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xi=new Set(",[]{}"),ev=new Set(` ,[]{}
120
- \r `),Is=e=>!e||ev.has(e),Ls=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
118
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}le.createScalarToken=xs.createScalarToken;le.resolveAsScalar=xs.resolveAsScalar;le.setScalarValue=xs.setScalarValue;le.stringify=HS.stringify;le.visit=JS.visit;le.BOM=ks;le.DOCUMENT=Cs;le.FLOW_END=Os;le.SCALAR=Ts;le.isCollection=XS;le.isScalar=QS;le.prettyToken=zS;le.tokenType=ZS});var Ms=S(Zf=>{"use strict";var On=Ji();function me(e){switch(e){case void 0:case" ":case`
119
+ `:case"\r":case" ":return!0;default:return!1}}var zf=new Set("0123456789ABCDEFabcdef"),ev=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xi=new Set(",[]{}"),tv=new Set(` ,[]{}
120
+ \r `),Is=e=>!e||tv.has(e),Ls=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
121
121
  `?!0:n==="\r"?this.buffer[t+1]===`
122
122
  `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){let r=this.buffer[i+t+1];if(r===`
123
123
  `||!r&&!this.atEnd)return t+i+1}return n===`
@@ -132,13 +132,13 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
132
132
  `&&o>=this.pos&&o+1+n>a)t=o;else break}while(!0);return yield On.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(me(o)||t&&Xi.has(o))break;n=i}else if(me(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===`
133
133
  `?(i+=1,r=`
134
134
  `,o=this.buffer[i+1]):n=i),o==="#"||t&&Xi.has(o))break;if(r===`
135
- `){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(t&&Xi.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield On.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Is),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(me(i)||n&&Xi.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!me(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(ZS.has(n))n=this.buffer[++t];else if(n==="%"&&zf.has(this.buffer[t+1])&&zf.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
135
+ `){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(t&&Xi.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield On.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Is),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(me(i)||n&&Xi.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!me(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(ev.has(n))n=this.buffer[++t];else if(n==="%"&&zf.has(this.buffer[t+1])&&zf.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
136
136
  `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
137
- `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Zf.Lexer=Ls});var Ps=S(ed=>{"use strict";var Ns=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){let o=n+i>>1;this.lineStarts[o]<t?n=o+1:i=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}};ed.LineCounter=Ns});var Ds=S(od=>{"use strict";var tv=ue("process"),td=Ji(),nv=Ms();function Ke(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function nd(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function rd(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Qi(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Pt(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function zi(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function id(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!Ke(t.start,"explicit-key-ind")&&!Ke(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,rd(t.value)?t.value.end?zi(t.value.end,t.sep):t.value.end=t.sep:zi(t.start,t.sep),delete t.sep)}var Rs=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new nv.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(t,n))yield*this.next(i);n||(yield*this.end())}*next(t){if(this.source=t,tv.env.LOG_TOKENS&&console.log("|",td.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=td.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&id(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&nd(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{nd(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=Qi(this.peek(2)),i=Pt(n),r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];let o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
137
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Zf.Lexer=Ls});var Ps=S(ed=>{"use strict";var Ns=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){let o=n+i>>1;this.lineStarts[o]<t?n=o+1:i=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}};ed.LineCounter=Ns});var Ds=S(od=>{"use strict";var nv=ue("process"),td=Ji(),iv=Ms();function Ke(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function nd(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function rd(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Qi(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Pt(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function zi(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function id(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!Ke(t.start,"explicit-key-ind")&&!Ke(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,rd(t.value)?t.value.end?zi(t.value.end,t.sep):t.value.end=t.sep:zi(t.start,t.sep),delete t.sep)}var Rs=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new iv.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(t,n))yield*this.next(i);n||(yield*this.end())}*next(t){if(this.source=t,nv.env.LOG_TOKENS&&console.log("|",td.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=td.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&id(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&nd(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{nd(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=Qi(this.peek(2)),i=Pt(n),r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];let o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
138
138
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
139
139
  `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){zi(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let s=[];for(let a=0;a<n.sep.length;++a){let l=n.sep[a];switch(l.type){case"newline":s.push(a);break;case"space":break;case"comment":l.indent>t.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ke(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(rd(n.key)&&!Ke(n.sep,"newline")){let s=Pt(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:l}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ke(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=Pt(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ke(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);r||n.value?(t.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ke(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&t.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){zi(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ke(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Qi(i),o=Pt(r);id(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
140
140
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
141
- `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Qi(t),i=Pt(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Qi(t),i=Pt(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};od.Parser=Rs});var ud=S(In=>{"use strict";var sd=ws(),iv=An(),Tn=En(),rv=vo(),ov=I(),sv=Ps(),ad=Ds();function ld(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new sv.LineCounter||null,prettyErrors:t}}function av(e,t={}){let{lineCounter:n,prettyErrors:i}=ld(t),r=new ad.Parser(n?.addNewLine),o=new sd.Composer(t),s=Array.from(o.compose(r.parse(e)));if(i&&n)for(let a of s)a.errors.forEach(Tn.prettifyError(e,n)),a.warnings.forEach(Tn.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function cd(e,t={}){let{lineCounter:n,prettyErrors:i}=ld(t),r=new ad.Parser(n?.addNewLine),o=new sd.Composer(t),s=null;for(let a of o.compose(r.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Tn.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach(Tn.prettifyError(e,n)),s.warnings.forEach(Tn.prettifyError(e,n))),s}function lv(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=cd(e,n);if(!r)return null;if(r.warnings.forEach(o=>rv.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function cv(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return ov.isDocument(e)&&!i?e.toString(n):new iv.Document(e,i,n).toString(n)}In.parse=lv;In.parseAllDocuments=av;In.parseDocument=cd;In.stringify=cv});var dd=S(M=>{"use strict";var uv=ws(),fv=An(),dv=ns(),Fs=En(),pv=on(),Ve=I(),mv=qe(),hv=U(),yv=je(),gv=Ue(),bv=Ji(),Sv=Ms(),vv=Ps(),Av=Ds(),Zi=ud(),fd=en();M.Composer=uv.Composer;M.Document=fv.Document;M.Schema=dv.Schema;M.YAMLError=Fs.YAMLError;M.YAMLParseError=Fs.YAMLParseError;M.YAMLWarning=Fs.YAMLWarning;M.Alias=pv.Alias;M.isAlias=Ve.isAlias;M.isCollection=Ve.isCollection;M.isDocument=Ve.isDocument;M.isMap=Ve.isMap;M.isNode=Ve.isNode;M.isPair=Ve.isPair;M.isScalar=Ve.isScalar;M.isSeq=Ve.isSeq;M.Pair=mv.Pair;M.Scalar=hv.Scalar;M.YAMLMap=yv.YAMLMap;M.YAMLSeq=gv.YAMLSeq;M.CST=bv;M.Lexer=Sv.Lexer;M.LineCounter=vv.LineCounter;M.Parser=Av.Parser;M.parse=Zi.parse;M.parseAllDocuments=Zi.parseAllDocuments;M.parseDocument=Zi.parseDocument;M.stringify=Zi.stringify;M.visit=fd.visit;M.visitAsync=fd.visitAsync});function Ba(e){return!1}function f_(e){return e.replace(/^#{2,4} MCP\/App citation examples\r?\n\r?\n```\r?\n[\s\S]*?^```\r?\n\s*/gm,t=>t.includes("#mavis-source=")?"":t).replace(/^#{2,4} Citations\r?\n(?:[ \t]*\r?\n)*Cite every used result where it supports the answer\.[\s\S]*?^Do not cite unused calls or unsupported claims, invent metadata, output bare parenthesized links, or add trailing source\/reference lists\.\r?\n*/gm,t=>t.includes("Citation candidate")?"":t)}function d_(e){let n=["- Independent tool calls can run in parallel in one response.","- Issue independent tool calls together when safe. Run dependent calls or conflicting writes sequentially, and follow each tool's concurrency restrictions."].find(u=>e.includes(u));if(!n)return e;let i="- Reference code as `file_path:line_number` \u2014 it's clickable.",r="- Reference code as `file_path:line_number` so it is clickable. Place references near the relevant claim; group them only when there are many files.",o=["- Cite sources where they support the answer, using exact source URLs or supplied links.","- Place references near the relevant claim; group them only when there are many files.","- Cite only sources you used; do not invent sources or links."].join(`
141
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Qi(t),i=Pt(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Qi(t),i=Pt(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};od.Parser=Rs});var ud=S(In=>{"use strict";var sd=ws(),rv=An(),Tn=En(),ov=vo(),sv=I(),av=Ps(),ad=Ds();function ld(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new av.LineCounter||null,prettyErrors:t}}function lv(e,t={}){let{lineCounter:n,prettyErrors:i}=ld(t),r=new ad.Parser(n?.addNewLine),o=new sd.Composer(t),s=Array.from(o.compose(r.parse(e)));if(i&&n)for(let a of s)a.errors.forEach(Tn.prettifyError(e,n)),a.warnings.forEach(Tn.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function cd(e,t={}){let{lineCounter:n,prettyErrors:i}=ld(t),r=new ad.Parser(n?.addNewLine),o=new sd.Composer(t),s=null;for(let a of o.compose(r.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Tn.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach(Tn.prettifyError(e,n)),s.warnings.forEach(Tn.prettifyError(e,n))),s}function cv(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=cd(e,n);if(!r)return null;if(r.warnings.forEach(o=>ov.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function uv(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return sv.isDocument(e)&&!i?e.toString(n):new rv.Document(e,i,n).toString(n)}In.parse=cv;In.parseAllDocuments=lv;In.parseDocument=cd;In.stringify=uv});var dd=S(M=>{"use strict";var fv=ws(),dv=An(),pv=ns(),Fs=En(),mv=on(),Ve=I(),hv=qe(),yv=U(),gv=je(),bv=Ue(),Sv=Ji(),vv=Ms(),Av=Ps(),wv=Ds(),Zi=ud(),fd=en();M.Composer=fv.Composer;M.Document=dv.Document;M.Schema=pv.Schema;M.YAMLError=Fs.YAMLError;M.YAMLParseError=Fs.YAMLParseError;M.YAMLWarning=Fs.YAMLWarning;M.Alias=mv.Alias;M.isAlias=Ve.isAlias;M.isCollection=Ve.isCollection;M.isDocument=Ve.isDocument;M.isMap=Ve.isMap;M.isNode=Ve.isNode;M.isPair=Ve.isPair;M.isScalar=Ve.isScalar;M.isSeq=Ve.isSeq;M.Pair=hv.Pair;M.Scalar=yv.Scalar;M.YAMLMap=gv.YAMLMap;M.YAMLSeq=bv.YAMLSeq;M.CST=Sv;M.Lexer=vv.Lexer;M.LineCounter=Av.LineCounter;M.Parser=wv.Parser;M.parse=Zi.parse;M.parseAllDocuments=Zi.parseAllDocuments;M.parseDocument=Zi.parseDocument;M.stringify=Zi.stringify;M.visit=fd.visit;M.visitAsync=fd.visitAsync});function Ba(e){return!1}function f_(e){return e.replace(/^#{2,4} MCP\/App citation examples\r?\n\r?\n```\r?\n[\s\S]*?^```\r?\n\s*/gm,t=>t.includes("#mavis-source=")?"":t).replace(/^#{2,4} Citations\r?\n(?:[ \t]*\r?\n)*Cite every used result where it supports the answer\.[\s\S]*?^Do not cite unused calls or unsupported claims, invent metadata, output bare parenthesized links, or add trailing source\/reference lists\.\r?\n*/gm,t=>t.includes("Citation candidate")?"":t)}function d_(e){let n=["- Independent tool calls can run in parallel in one response.","- Issue independent tool calls together when safe. Run dependent calls or conflicting writes sequentially, and follow each tool's concurrency restrictions."].find(u=>e.includes(u));if(!n)return e;let i="- Reference code as `file_path:line_number` \u2014 it's clickable.",r="- Reference code as `file_path:line_number` so it is clickable. Place references near the relevant claim; group them only when there are many files.",o=["- Cite sources where they support the answer, using exact source URLs or supplied links.","- Place references near the relevant claim; group them only when there are many files.","- Cite only sources you used; do not invent sources or links."].join(`
142
142
  `),a=["- When referencing code, use `file_path:line_number` format.","- When citing one or two files, place one or two `file_path:line_number` references in the relevant conclusion sentence. Use a separate evidence list only when there are many references.",i,"- Reference code as `file_path:line_number` \u2014 it's clickable in the TUI."].reduce((u,f)=>u.replaceAll(`${f}\r
143
143
  `,"").replaceAll(`${f}
144
144
  `,""),e.replace(r,"- Place references near the relevant claim; group them only when there are many files.")).replace(n,`${n}
@@ -153,41 +153,41 @@ ${o}
153
153
  ${u}`):`${a.trimEnd()}
154
154
 
155
155
  ## References
156
- ${o}`}function Qp(e,t=process.env){return Ba({platform:e,internalBuild:t.__MAVIS_BUILD_INTERNAL==="true",insideBuild:t.__MAVIS_BUILD_INSIDE==="true"})}import{randomBytes as Gy}from"node:crypto";import{promises as Pe}from"node:fs";import{dirname as Wy,join as Sc}from"node:path";function el(e){return typeof e>"u"||e===null}function zp(e){return typeof e=="object"&&e!==null}function Zp(e){return Array.isArray(e)?e:el(e)?[]:[e]}function em(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;n<i;n+=1)r=o[n],e[r]=t[r];return e}function tm(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function nm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var im=el,rm=zp,om=Zp,sm=tm,am=nm,lm=em,K={isNothing:im,isObject:rm,toArray:om,repeat:sm,isNegativeZero:am,extend:lm};function tl(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
156
+ ${o}`}function zp(e,t=process.env){return Ba({platform:e,internalBuild:t.__MAVIS_BUILD_INTERNAL==="true",insideBuild:t.__MAVIS_BUILD_INSIDE==="true"})}import{randomBytes as Wy}from"node:crypto";import{promises as Pe}from"node:fs";import{dirname as Hy,join as Sc}from"node:path";function el(e){return typeof e>"u"||e===null}function Zp(e){return typeof e=="object"&&e!==null}function em(e){return Array.isArray(e)?e:el(e)?[]:[e]}function tm(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;n<i;n+=1)r=o[n],e[r]=t[r];return e}function nm(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function im(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var rm=el,om=Zp,sm=em,am=nm,lm=im,cm=tm,K={isNothing:rm,isObject:om,toArray:sm,repeat:am,isNegativeZero:lm,extend:cm};function tl(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
157
157
 
158
- `+e.mark.snippet),i+" "+n):i}function Wt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=tl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Wt.prototype=Object.create(Error.prototype);Wt.prototype.constructor=Wt;Wt.prototype.toString=function(t){return this.name+": "+tl(this,t)};var ie=Wt;function Cr(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(o=" ... ",t=i-a+o.length),n-i>a&&(s=" ...",n=i+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:i-t+o.length}}function Or(e,t){return K.repeat(" ",t-e.length)+e}function cm(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],o,s=-1;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,c,u=Math.min(e.line+t.linesAfter,r.length).toString().length,f=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)c=Cr(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),f),a=K.repeat(" ",t.indent)+Or((e.line-l+1).toString(),u)+" | "+c.str+`
158
+ `+e.mark.snippet),i+" "+n):i}function Wt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=tl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Wt.prototype=Object.create(Error.prototype);Wt.prototype.constructor=Wt;Wt.prototype.toString=function(t){return this.name+": "+tl(this,t)};var ie=Wt;function Cr(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(o=" ... ",t=i-a+o.length),n-i>a&&(s=" ...",n=i+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:i-t+o.length}}function Or(e,t){return K.repeat(" ",t-e.length)+e}function um(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],o,s=-1;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,c,u=Math.min(e.line+t.linesAfter,r.length).toString().length,f=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)c=Cr(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),f),a=K.repeat(" ",t.indent)+Or((e.line-l+1).toString(),u)+" | "+c.str+`
159
159
  `+a;for(c=Cr(e.buffer,i[s],r[s],e.position,f),a+=K.repeat(" ",t.indent)+Or((e.line+1).toString(),u)+" | "+c.str+`
160
160
  `,a+=K.repeat("-",t.indent+u+3+c.pos)+`^
161
161
  `,l=1;l<=t.linesAfter&&!(s+l>=r.length);l++)c=Cr(e.buffer,i[s+l],r[s+l],e.position-(i[s]-i[s+l]),f),a+=K.repeat(" ",t.indent)+Or((e.line+l+1).toString(),u)+" | "+c.str+`
162
- `;return a.replace(/\n$/,"")}var um=cm,fm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],dm=["scalar","sequence","mapping"];function pm(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function mm(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(fm.indexOf(n)===-1)throw new ie('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=pm(t.styleAliases||null),dm.indexOf(this.kind)===-1)throw new ie('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Q=mm;function qa(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(o,s){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(r=s)}),n[r]=i}),n}function hm(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(i);return e}function Ir(e){return this.extend(e)}Ir.prototype.extend=function(t){var n=[],i=[];if(t instanceof Q)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new ie("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof Q))throw new ie("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new ie("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new ie("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof Q))throw new ie("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Ir.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=qa(r,"implicit"),r.compiledExplicit=qa(r,"explicit"),r.compiledTypeMap=hm(r.compiledImplicit,r.compiledExplicit),r};var nl=Ir,il=new Q("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),rl=new Q("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),ol=new Q("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),sl=new nl({explicit:[il,rl,ol]});function ym(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function gm(){return null}function bm(e){return e===null}var al=new Q("tag:yaml.org,2002:null",{kind:"scalar",resolve:ym,construct:gm,predicate:bm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Sm(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function vm(e){return e==="true"||e==="True"||e==="TRUE"}function Am(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ll=new Q("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Sm,construct:vm,predicate:Am,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function wm(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function _m(e){return 48<=e&&e<=55}function Em(e){return 48<=e&&e<=57}function xm(e){if(e===null)return!1;var t=e.length,n=0,i=!1,r;if(!t)return!1;if(r=e[n],(r==="-"||r==="+")&&(r=e[++n]),r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!wm(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!_m(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!Em(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function km(e){var t=e,n=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function Cm(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!K.isNegativeZero(e)}var cl=new Q("tag:yaml.org,2002:int",{kind:"scalar",resolve:xm,construct:km,predicate:Cm,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Om=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Tm(e){return!(e===null||!Om.test(e)||e[e.length-1]==="_")}function Im(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var Lm=/^[-+]?[0-9]+e/;function Mm(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(K.isNegativeZero(e))return"-0.0";return n=e.toString(10),Lm.test(n)?n.replace("e",".e"):n}function Nm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||K.isNegativeZero(e))}var ul=new Q("tag:yaml.org,2002:float",{kind:"scalar",resolve:Tm,construct:Im,predicate:Nm,represent:Mm,defaultStyle:"lowercase"}),fl=sl.extend({implicit:[al,ll,cl,ul]}),dl=fl,pl=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ml=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Pm(e){return e===null?!1:pl.exec(e)!==null||ml.exec(e)!==null}function Rm(e){var t,n,i,r,o,s,a,l=0,c=null,u,f,d;if(t=pl.exec(e),t===null&&(t=ml.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],f=+(t[11]||0),c=(u*60+f)*6e4,t[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,i,r,o,s,a,l)),c&&d.setTime(d.getTime()-c),d}function Dm(e){return e.toISOString()}var hl=new Q("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Pm,construct:Rm,instanceOf:Date,represent:Dm});function Fm(e){return e==="<<"||e===null}var yl=new Q("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Fm}),Rr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
163
- \r`;function Bm(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=Rr;for(n=0;n<r;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function qm(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=Rr,s=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function $m(e){var t="",n=0,i,r,o=e.length,s=Rr;for(i=0;i<o;i++)i%3===0&&i&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[i];return r=o%3,r===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):r===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):r===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function jm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var gl=new Q("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Bm,construct:qm,predicate:jm,represent:$m}),Um=Object.prototype.hasOwnProperty,Km=Object.prototype.toString;function Vm(e){if(e===null)return!0;var t=[],n,i,r,o,s,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],s=!1,Km.call(r)!=="[object Object]")return!1;for(o in r)if(Um.call(r,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function Ym(e){return e!==null?e:[]}var bl=new Q("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Vm,construct:Ym}),Gm=Object.prototype.toString;function Wm(e){if(e===null)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(i=s[t],Gm.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;o[t]=[r[0],i[r[0]]]}return!0}function Hm(e){if(e===null)return[];var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)i=s[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var Sl=new Q("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Wm,construct:Hm}),Jm=Object.prototype.hasOwnProperty;function Xm(e){if(e===null)return!0;var t,n=e;for(t in n)if(Jm.call(n,t)&&n[t]!==null)return!1;return!0}function Qm(e){return e!==null?e:{}}var vl=new Q("tag:yaml.org,2002:set",{kind:"mapping",resolve:Xm,construct:Qm}),Dr=dl.extend({implicit:[hl,yl],explicit:[gl,bl,Sl,vl]}),Le=Object.prototype.hasOwnProperty,qn=1,Al=2,wl=3,$n=4,Tr=1,zm=2,$a=3,Zm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,eh=/[\x85\u2028\u2029]/,th=/[,\[\]\{\}]/,_l=/^(?:!|!!|![a-z\-]+!)$/i,El=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ja(e){return Object.prototype.toString.call(e)}function ge(e){return e===10||e===13}function ze(e){return e===9||e===32}function se(e){return e===9||e===32||e===10||e===13}function ht(e){return e===44||e===91||e===93||e===123||e===125}function nh(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ih(e){return e===120?2:e===117?4:e===85?8:0}function rh(e){return 48<=e&&e<=57?e-48:-1}function Ua(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
164
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function oh(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function xl(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var kl=new Array(256),Cl=new Array(256);for(Qe=0;Qe<256;Qe++)kl[Qe]=Ua(Qe)?1:0,Cl[Qe]=Ua(Qe);var Qe;function sh(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Dr,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ol(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=um(n),new ie(t,n)}function _(e,t){throw Ol(e,t)}function jn(e,t){e.onWarning&&e.onWarning.call(null,Ol(e,t))}var Ka={YAML:function(t,n,i){var r,o,s;t.version!==null&&_(t,"duplication of %YAML directive"),i.length!==1&&_(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&_(t,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&_(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&jn(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,o;i.length!==2&&_(t,"TAG directive accepts exactly two arguments"),r=i[0],o=i[1],_l.test(r)||_(t,"ill-formed tag handle (first argument) of the TAG directive"),Le.call(t.tagMap,r)&&_(t,'there is a previously declared suffix for "'+r+'" tag handle'),El.test(o)||_(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{_(t,"tag prefix is malformed: "+o)}t.tagMap[r]=o}};function Ie(e,t,n,i){var r,o,s,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,o=a.length;r<o;r+=1)s=a.charCodeAt(r),s===9||32<=s&&s<=1114111||_(e,"expected valid JSON character");else Zm.test(a)&&_(e,"the stream contains non-printable characters");e.result+=a}}function Va(e,t,n,i){var r,o,s,a;for(K.isObject(n)||_(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),s=0,a=r.length;s<a;s+=1)o=r[s],Le.call(t,o)||(xl(t,o,n[o]),i[o]=!0)}function yt(e,t,n,i,r,o,s,a,l){var c,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,u=r.length;c<u;c+=1)Array.isArray(r[c])&&_(e,"nested arrays are not supported inside keys"),typeof r=="object"&&ja(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&ja(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)Va(e,t,o[c],n);else Va(e,t,o,n);else!e.json&&!Le.call(n,r)&&Le.call(t,r)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,_(e,"duplicated mapping key")),xl(t,r,o),delete n[r];return t}function Fr(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):_(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function j(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;ze(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(ge(r))for(Fr(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&i!==0&&e.lineIndent<n&&jn(e,"deficient indentation"),i}function Vn(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||se(n)))}function Br(e,t){t===1?e.result+=" ":t>1&&(e.result+=K.repeat(`
165
- `,t-1))}function ah(e,t,n){var i,r,o,s,a,l,c,u,f=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),se(p)||ht(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(r=e.input.charCodeAt(e.position+1),se(r)||n&&ht(r)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;p!==0;){if(p===58){if(r=e.input.charCodeAt(e.position+1),se(r)||n&&ht(r))break}else if(p===35){if(i=e.input.charCodeAt(e.position-1),se(i))break}else{if(e.position===e.lineStart&&Vn(e)||n&&ht(p))break;if(ge(p))if(l=e.line,c=e.lineStart,u=e.lineIndent,j(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=c,e.lineIndent=u;break}}a&&(Ie(e,o,s,!1),Br(e,e.line-l),o=s=e.position,a=!1),ze(p)||(s=e.position+1),p=e.input.charCodeAt(++e.position)}return Ie(e,o,s,!1),e.result?!0:(e.kind=f,e.result=d,!1)}function lh(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Ie(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else ge(n)?(Ie(e,i,r,!0),Br(e,j(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Vn(e)?_(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);_(e,"unexpected end of the stream within a single quoted scalar")}function ch(e,t){var n,i,r,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Ie(e,n,e.position,!0),e.position++,!0;if(a===92){if(Ie(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),ge(a))j(e,!1,t);else if(a<256&&kl[a])e.result+=Cl[a],e.position++;else if((s=ih(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=nh(a))>=0?o=(o<<4)+s:_(e,"expected hexadecimal character");e.result+=oh(o),e.position++}else _(e,"unknown escape sequence");n=i=e.position}else ge(a)?(Ie(e,n,i,!0),Br(e,j(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Vn(e)?_(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}_(e,"unexpected end of the stream within a double quoted scalar")}function uh(e,t){var n=!0,i,r,o,s=e.tag,a,l=e.anchor,c,u,f,d,p,y=Object.create(null),m,h,g,b;if(b=e.input.charCodeAt(e.position),b===91)u=93,p=!1,a=[];else if(b===123)u=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),b=e.input.charCodeAt(++e.position);b!==0;){if(j(e,!0,t),b=e.input.charCodeAt(e.position),b===u)return e.position++,e.tag=s,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=a,!0;n?b===44&&_(e,"expected the node content, but found ','"):_(e,"missed comma between flow collection entries"),h=m=g=null,f=d=!1,b===63&&(c=e.input.charCodeAt(e.position+1),se(c)&&(f=d=!0,e.position++,j(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,gt(e,t,qn,!1,!0),h=e.tag,m=e.result,j(e,!0,t),b=e.input.charCodeAt(e.position),(d||e.line===i)&&b===58&&(f=!0,b=e.input.charCodeAt(++e.position),j(e,!0,t),gt(e,t,qn,!1,!0),g=e.result),p?yt(e,a,y,h,m,g,i,r,o):f?a.push(yt(e,null,y,h,m,g,i,r,o)):a.push(m),j(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(n=!0,b=e.input.charCodeAt(++e.position)):n=!1}_(e,"unexpected end of the stream within a flow collection")}function fh(e,t){var n,i,r=Tr,o=!1,s=!1,a=t,l=0,c=!1,u,f;if(f=e.input.charCodeAt(e.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)Tr===r?r=f===43?$a:zm:_(e,"repeat of a chomping mode identifier");else if((u=rh(f))>=0)u===0?_(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?_(e,"repeat of an indentation width identifier"):(a=t+u-1,s=!0);else break;if(ze(f)){do f=e.input.charCodeAt(++e.position);while(ze(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!ge(f)&&f!==0)}for(;f!==0;){for(Fr(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),ge(f)){l++;continue}if(e.lineIndent<a){r===$a?e.result+=K.repeat(`
162
+ `;return a.replace(/\n$/,"")}var fm=um,dm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],pm=["scalar","sequence","mapping"];function mm(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function hm(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(dm.indexOf(n)===-1)throw new ie('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=mm(t.styleAliases||null),pm.indexOf(this.kind)===-1)throw new ie('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Q=hm;function qa(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(o,s){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(r=s)}),n[r]=i}),n}function ym(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(i);return e}function Ir(e){return this.extend(e)}Ir.prototype.extend=function(t){var n=[],i=[];if(t instanceof Q)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new ie("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof Q))throw new ie("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new ie("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new ie("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof Q))throw new ie("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Ir.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=qa(r,"implicit"),r.compiledExplicit=qa(r,"explicit"),r.compiledTypeMap=ym(r.compiledImplicit,r.compiledExplicit),r};var nl=Ir,il=new Q("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),rl=new Q("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),ol=new Q("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),sl=new nl({explicit:[il,rl,ol]});function gm(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function bm(){return null}function Sm(e){return e===null}var al=new Q("tag:yaml.org,2002:null",{kind:"scalar",resolve:gm,construct:bm,predicate:Sm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function vm(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Am(e){return e==="true"||e==="True"||e==="TRUE"}function wm(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ll=new Q("tag:yaml.org,2002:bool",{kind:"scalar",resolve:vm,construct:Am,predicate:wm,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function _m(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Em(e){return 48<=e&&e<=55}function xm(e){return 48<=e&&e<=57}function km(e){if(e===null)return!1;var t=e.length,n=0,i=!1,r;if(!t)return!1;if(r=e[n],(r==="-"||r==="+")&&(r=e[++n]),r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!_m(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Em(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!xm(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function Cm(e){var t=e,n=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function Om(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!K.isNegativeZero(e)}var cl=new Q("tag:yaml.org,2002:int",{kind:"scalar",resolve:km,construct:Cm,predicate:Om,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Tm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Im(e){return!(e===null||!Tm.test(e)||e[e.length-1]==="_")}function Lm(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var Mm=/^[-+]?[0-9]+e/;function Nm(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(K.isNegativeZero(e))return"-0.0";return n=e.toString(10),Mm.test(n)?n.replace("e",".e"):n}function Pm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||K.isNegativeZero(e))}var ul=new Q("tag:yaml.org,2002:float",{kind:"scalar",resolve:Im,construct:Lm,predicate:Pm,represent:Nm,defaultStyle:"lowercase"}),fl=sl.extend({implicit:[al,ll,cl,ul]}),dl=fl,pl=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ml=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Rm(e){return e===null?!1:pl.exec(e)!==null||ml.exec(e)!==null}function Dm(e){var t,n,i,r,o,s,a,l=0,c=null,u,f,d;if(t=pl.exec(e),t===null&&(t=ml.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],f=+(t[11]||0),c=(u*60+f)*6e4,t[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,i,r,o,s,a,l)),c&&d.setTime(d.getTime()-c),d}function Fm(e){return e.toISOString()}var hl=new Q("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Rm,construct:Dm,instanceOf:Date,represent:Fm});function Bm(e){return e==="<<"||e===null}var yl=new Q("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Bm}),Rr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
163
+ \r`;function qm(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=Rr;for(n=0;n<r;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function $m(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=Rr,s=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function jm(e){var t="",n=0,i,r,o=e.length,s=Rr;for(i=0;i<o;i++)i%3===0&&i&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[i];return r=o%3,r===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):r===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):r===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function Um(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var gl=new Q("tag:yaml.org,2002:binary",{kind:"scalar",resolve:qm,construct:$m,predicate:Um,represent:jm}),Km=Object.prototype.hasOwnProperty,Vm=Object.prototype.toString;function Ym(e){if(e===null)return!0;var t=[],n,i,r,o,s,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],s=!1,Vm.call(r)!=="[object Object]")return!1;for(o in r)if(Km.call(r,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function Gm(e){return e!==null?e:[]}var bl=new Q("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Ym,construct:Gm}),Wm=Object.prototype.toString;function Hm(e){if(e===null)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(i=s[t],Wm.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;o[t]=[r[0],i[r[0]]]}return!0}function Jm(e){if(e===null)return[];var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)i=s[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var Sl=new Q("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Hm,construct:Jm}),Xm=Object.prototype.hasOwnProperty;function Qm(e){if(e===null)return!0;var t,n=e;for(t in n)if(Xm.call(n,t)&&n[t]!==null)return!1;return!0}function zm(e){return e!==null?e:{}}var vl=new Q("tag:yaml.org,2002:set",{kind:"mapping",resolve:Qm,construct:zm}),Dr=dl.extend({implicit:[hl,yl],explicit:[gl,bl,Sl,vl]}),Le=Object.prototype.hasOwnProperty,qn=1,Al=2,wl=3,$n=4,Tr=1,Zm=2,$a=3,eh=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,th=/[\x85\u2028\u2029]/,nh=/[,\[\]\{\}]/,_l=/^(?:!|!!|![a-z\-]+!)$/i,El=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ja(e){return Object.prototype.toString.call(e)}function ge(e){return e===10||e===13}function ze(e){return e===9||e===32}function se(e){return e===9||e===32||e===10||e===13}function ht(e){return e===44||e===91||e===93||e===123||e===125}function ih(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function rh(e){return e===120?2:e===117?4:e===85?8:0}function oh(e){return 48<=e&&e<=57?e-48:-1}function Ua(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
164
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function sh(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function xl(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var kl=new Array(256),Cl=new Array(256);for(Qe=0;Qe<256;Qe++)kl[Qe]=Ua(Qe)?1:0,Cl[Qe]=Ua(Qe);var Qe;function ah(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Dr,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ol(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=fm(n),new ie(t,n)}function _(e,t){throw Ol(e,t)}function jn(e,t){e.onWarning&&e.onWarning.call(null,Ol(e,t))}var Ka={YAML:function(t,n,i){var r,o,s;t.version!==null&&_(t,"duplication of %YAML directive"),i.length!==1&&_(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&_(t,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&_(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&jn(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,o;i.length!==2&&_(t,"TAG directive accepts exactly two arguments"),r=i[0],o=i[1],_l.test(r)||_(t,"ill-formed tag handle (first argument) of the TAG directive"),Le.call(t.tagMap,r)&&_(t,'there is a previously declared suffix for "'+r+'" tag handle'),El.test(o)||_(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{_(t,"tag prefix is malformed: "+o)}t.tagMap[r]=o}};function Ie(e,t,n,i){var r,o,s,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,o=a.length;r<o;r+=1)s=a.charCodeAt(r),s===9||32<=s&&s<=1114111||_(e,"expected valid JSON character");else eh.test(a)&&_(e,"the stream contains non-printable characters");e.result+=a}}function Va(e,t,n,i){var r,o,s,a;for(K.isObject(n)||_(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),s=0,a=r.length;s<a;s+=1)o=r[s],Le.call(t,o)||(xl(t,o,n[o]),i[o]=!0)}function yt(e,t,n,i,r,o,s,a,l){var c,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,u=r.length;c<u;c+=1)Array.isArray(r[c])&&_(e,"nested arrays are not supported inside keys"),typeof r=="object"&&ja(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&ja(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)Va(e,t,o[c],n);else Va(e,t,o,n);else!e.json&&!Le.call(n,r)&&Le.call(t,r)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,_(e,"duplicated mapping key")),xl(t,r,o),delete n[r];return t}function Fr(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):_(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function j(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;ze(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(ge(r))for(Fr(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&i!==0&&e.lineIndent<n&&jn(e,"deficient indentation"),i}function Vn(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||se(n)))}function Br(e,t){t===1?e.result+=" ":t>1&&(e.result+=K.repeat(`
165
+ `,t-1))}function lh(e,t,n){var i,r,o,s,a,l,c,u,f=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),se(p)||ht(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(r=e.input.charCodeAt(e.position+1),se(r)||n&&ht(r)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;p!==0;){if(p===58){if(r=e.input.charCodeAt(e.position+1),se(r)||n&&ht(r))break}else if(p===35){if(i=e.input.charCodeAt(e.position-1),se(i))break}else{if(e.position===e.lineStart&&Vn(e)||n&&ht(p))break;if(ge(p))if(l=e.line,c=e.lineStart,u=e.lineIndent,j(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=c,e.lineIndent=u;break}}a&&(Ie(e,o,s,!1),Br(e,e.line-l),o=s=e.position,a=!1),ze(p)||(s=e.position+1),p=e.input.charCodeAt(++e.position)}return Ie(e,o,s,!1),e.result?!0:(e.kind=f,e.result=d,!1)}function ch(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Ie(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else ge(n)?(Ie(e,i,r,!0),Br(e,j(e,!1,t)),i=r=e.position):e.position===e.lineStart&&Vn(e)?_(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);_(e,"unexpected end of the stream within a single quoted scalar")}function uh(e,t){var n,i,r,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Ie(e,n,e.position,!0),e.position++,!0;if(a===92){if(Ie(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),ge(a))j(e,!1,t);else if(a<256&&kl[a])e.result+=Cl[a],e.position++;else if((s=rh(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=ih(a))>=0?o=(o<<4)+s:_(e,"expected hexadecimal character");e.result+=sh(o),e.position++}else _(e,"unknown escape sequence");n=i=e.position}else ge(a)?(Ie(e,n,i,!0),Br(e,j(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Vn(e)?_(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}_(e,"unexpected end of the stream within a double quoted scalar")}function fh(e,t){var n=!0,i,r,o,s=e.tag,a,l=e.anchor,c,u,f,d,p,y=Object.create(null),m,h,g,b;if(b=e.input.charCodeAt(e.position),b===91)u=93,p=!1,a=[];else if(b===123)u=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),b=e.input.charCodeAt(++e.position);b!==0;){if(j(e,!0,t),b=e.input.charCodeAt(e.position),b===u)return e.position++,e.tag=s,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=a,!0;n?b===44&&_(e,"expected the node content, but found ','"):_(e,"missed comma between flow collection entries"),h=m=g=null,f=d=!1,b===63&&(c=e.input.charCodeAt(e.position+1),se(c)&&(f=d=!0,e.position++,j(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,gt(e,t,qn,!1,!0),h=e.tag,m=e.result,j(e,!0,t),b=e.input.charCodeAt(e.position),(d||e.line===i)&&b===58&&(f=!0,b=e.input.charCodeAt(++e.position),j(e,!0,t),gt(e,t,qn,!1,!0),g=e.result),p?yt(e,a,y,h,m,g,i,r,o):f?a.push(yt(e,null,y,h,m,g,i,r,o)):a.push(m),j(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(n=!0,b=e.input.charCodeAt(++e.position)):n=!1}_(e,"unexpected end of the stream within a flow collection")}function dh(e,t){var n,i,r=Tr,o=!1,s=!1,a=t,l=0,c=!1,u,f;if(f=e.input.charCodeAt(e.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)Tr===r?r=f===43?$a:Zm:_(e,"repeat of a chomping mode identifier");else if((u=oh(f))>=0)u===0?_(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?_(e,"repeat of an indentation width identifier"):(a=t+u-1,s=!0);else break;if(ze(f)){do f=e.input.charCodeAt(++e.position);while(ze(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!ge(f)&&f!==0)}for(;f!==0;){for(Fr(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),ge(f)){l++;continue}if(e.lineIndent<a){r===$a?e.result+=K.repeat(`
166
166
  `,o?1+l:l):r===Tr&&o&&(e.result+=`
167
167
  `);break}for(i?ze(f)?(c=!0,e.result+=K.repeat(`
168
168
  `,o?1+l:l)):c?(c=!1,e.result+=K.repeat(`
169
169
  `,l+1)):l===0?o&&(e.result+=" "):e.result+=K.repeat(`
170
170
  `,l):e.result+=K.repeat(`
171
- `,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!ge(f)&&f!==0;)f=e.input.charCodeAt(++e.position);Ie(e,n,e.position,!1)}return!0}function Ya(e,t){var n,i=e.tag,r=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,_(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!se(s))));){if(a=!0,e.position++,j(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,gt(e,t,wl,!1,!0),o.push(e.result),j(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)_(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=o,!0):!1}function dh(e,t,n){var i,r,o,s,a,l,c=e.tag,u=e.anchor,f={},d=Object.create(null),p=null,y=null,m=null,h=!1,g=!1,b;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),b=e.input.charCodeAt(e.position);b!==0;){if(!h&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,_(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(b===63||b===58)&&se(i))b===63?(h&&(yt(e,f,d,p,y,null,s,a,l),p=y=m=null),g=!0,h=!0,r=!0):h?(h=!1,r=!0):_(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,b=i;else{if(s=e.line,a=e.lineStart,l=e.position,!gt(e,n,Al,!1,!0))break;if(e.line===o){for(b=e.input.charCodeAt(e.position);ze(b);)b=e.input.charCodeAt(++e.position);if(b===58)b=e.input.charCodeAt(++e.position),se(b)||_(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(yt(e,f,d,p,y,null,s,a,l),p=y=m=null),g=!0,h=!1,r=!1,p=e.tag,y=e.result;else if(g)_(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(g)_(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0}if((e.line===o||e.lineIndent>t)&&(h&&(s=e.line,a=e.lineStart,l=e.position),gt(e,t,$n,!0,r)&&(h?y=e.result:m=e.result),h||(yt(e,f,d,p,y,m,s,a,l),p=y=m=null),j(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&b!==0)_(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&yt(e,f,d,p,y,null,s,a,l),g&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=f),g}function ph(e){var t,n=!1,i=!1,r,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&_(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(i=!0,r="!!",s=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):_(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!se(s);)s===33&&(i?_(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),_l.test(r)||_(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),th.test(o)&&_(e,"tag suffix cannot contain flow indicator characters")}o&&!El.test(o)&&_(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{_(e,"tag name is malformed: "+o)}return n?e.tag=o:Le.call(e.tagMap,r)?e.tag=e.tagMap[r]+o:r==="!"?e.tag="!"+o:r==="!!"?e.tag="tag:yaml.org,2002:"+o:_(e,'undeclared tag handle "'+r+'"'),!0}function mh(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&_(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!se(n)&&!ht(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&_(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function hh(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!se(i)&&!ht(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&_(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Le.call(e.anchorMap,n)||_(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],j(e,!0,-1),!0}function gt(e,t,n,i,r){var o,s,a,l=1,c=!1,u=!1,f,d,p,y,m,h;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=$n===n||wl===n,i&&j(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;ph(e)||mh(e);)j(e,!0,-1)?(c=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||r),(l===1||$n===n)&&(qn===n||Al===n?m=t:m=t+1,h=e.position-e.lineStart,l===1?a&&(Ya(e,h)||dh(e,h,m))||uh(e,m)?u=!0:(s&&fh(e,m)||lh(e,m)||ch(e,m)?u=!0:hh(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&_(e,"alias node should not have any properties")):ah(e,m,qn===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&Ya(e,h))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&_(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,d=e.implicitTypes.length;f<d;f+=1)if(y=e.implicitTypes[f],y.resolve(e.result)){e.result=y.construct(e.result),e.tag=y.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Le.call(e.typeMap[e.kind||"fallback"],e.tag))y=e.typeMap[e.kind||"fallback"][e.tag];else for(y=null,p=e.typeMap.multi[e.kind||"fallback"],f=0,d=p.length;f<d;f+=1)if(e.tag.slice(0,p[f].tag.length)===p[f].tag){y=p[f];break}y||_(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&_(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"'),y.resolve(e.result,e.tag)?(e.result=y.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):_(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function yh(e){var t=e.position,n,i,r,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(j(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!se(s);)s=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&_(e,"directive name must not be less than one character in length");s!==0;){for(;ze(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!ge(s));break}if(ge(s))break;for(n=e.position;s!==0&&!se(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&Fr(e),Le.call(Ka,i)?Ka[i](e,i,r):jn(e,'unknown document directive "'+i+'"')}if(j(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,j(e,!0,-1)):o&&_(e,"directives end mark is expected"),gt(e,e.lineIndent-1,$n,!1,!0),j(e,!0,-1),e.checkLineBreaks&&eh.test(e.input.slice(t,e.position))&&jn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Vn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,j(e,!0,-1));return}if(e.position<e.length-1)_(e,"end of the stream or a document separator is expected");else return}function Tl(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
172
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new sh(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,_(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)yh(n);return n.documents}function gh(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var i=Tl(e,n);if(typeof t!="function")return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function bh(e,t){var n=Tl(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new ie("expected a single document in the stream, but found more")}}var Sh=gh,vh=bh,Il={loadAll:Sh,load:vh},Ll=Object.prototype.toString,Ml=Object.prototype.hasOwnProperty,qr=65279,Ah=9,Ht=10,wh=13,_h=32,Eh=33,xh=34,Lr=35,kh=37,Ch=38,Oh=39,Th=42,Nl=44,Ih=45,Un=58,Lh=61,Mh=62,Nh=63,Ph=64,Pl=91,Rl=93,Rh=96,Dl=123,Dh=124,Fl=125,te={};te[0]="\\0";te[7]="\\a";te[8]="\\b";te[9]="\\t";te[10]="\\n";te[11]="\\v";te[12]="\\f";te[13]="\\r";te[27]="\\e";te[34]='\\"';te[92]="\\\\";te[133]="\\N";te[160]="\\_";te[8232]="\\L";te[8233]="\\P";var Fh=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Bh=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function qh(e,t){var n,i,r,o,s,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,o=i.length;r<o;r+=1)s=i[r],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&Ml.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function $h(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new ie("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+K.repeat("0",i-t.length)+t}var jh=1,Jt=2;function Uh(e){this.schema=e.schema||Dr,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=K.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=qh(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Jt:jh,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ga(e,t){for(var n=K.repeat(" ",t),i=0,r=-1,o="",s,a=e.length;i<a;)r=e.indexOf(`
171
+ `,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!ge(f)&&f!==0;)f=e.input.charCodeAt(++e.position);Ie(e,n,e.position,!1)}return!0}function Ya(e,t){var n,i=e.tag,r=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,_(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!se(s))));){if(a=!0,e.position++,j(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,gt(e,t,wl,!1,!0),o.push(e.result),j(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)_(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=o,!0):!1}function ph(e,t,n){var i,r,o,s,a,l,c=e.tag,u=e.anchor,f={},d=Object.create(null),p=null,y=null,m=null,h=!1,g=!1,b;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),b=e.input.charCodeAt(e.position);b!==0;){if(!h&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,_(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(b===63||b===58)&&se(i))b===63?(h&&(yt(e,f,d,p,y,null,s,a,l),p=y=m=null),g=!0,h=!0,r=!0):h?(h=!1,r=!0):_(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,b=i;else{if(s=e.line,a=e.lineStart,l=e.position,!gt(e,n,Al,!1,!0))break;if(e.line===o){for(b=e.input.charCodeAt(e.position);ze(b);)b=e.input.charCodeAt(++e.position);if(b===58)b=e.input.charCodeAt(++e.position),se(b)||_(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(yt(e,f,d,p,y,null,s,a,l),p=y=m=null),g=!0,h=!1,r=!1,p=e.tag,y=e.result;else if(g)_(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(g)_(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0}if((e.line===o||e.lineIndent>t)&&(h&&(s=e.line,a=e.lineStart,l=e.position),gt(e,t,$n,!0,r)&&(h?y=e.result:m=e.result),h||(yt(e,f,d,p,y,m,s,a,l),p=y=m=null),j(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&b!==0)_(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&yt(e,f,d,p,y,null,s,a,l),g&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=f),g}function mh(e){var t,n=!1,i=!1,r,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&_(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(i=!0,r="!!",s=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):_(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!se(s);)s===33&&(i?_(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),_l.test(r)||_(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),nh.test(o)&&_(e,"tag suffix cannot contain flow indicator characters")}o&&!El.test(o)&&_(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{_(e,"tag name is malformed: "+o)}return n?e.tag=o:Le.call(e.tagMap,r)?e.tag=e.tagMap[r]+o:r==="!"?e.tag="!"+o:r==="!!"?e.tag="tag:yaml.org,2002:"+o:_(e,'undeclared tag handle "'+r+'"'),!0}function hh(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&_(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!se(n)&&!ht(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&_(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function yh(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!se(i)&&!ht(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&_(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Le.call(e.anchorMap,n)||_(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],j(e,!0,-1),!0}function gt(e,t,n,i,r){var o,s,a,l=1,c=!1,u=!1,f,d,p,y,m,h;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=$n===n||wl===n,i&&j(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;mh(e)||hh(e);)j(e,!0,-1)?(c=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||r),(l===1||$n===n)&&(qn===n||Al===n?m=t:m=t+1,h=e.position-e.lineStart,l===1?a&&(Ya(e,h)||ph(e,h,m))||fh(e,m)?u=!0:(s&&dh(e,m)||ch(e,m)||uh(e,m)?u=!0:yh(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&_(e,"alias node should not have any properties")):lh(e,m,qn===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&Ya(e,h))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&_(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,d=e.implicitTypes.length;f<d;f+=1)if(y=e.implicitTypes[f],y.resolve(e.result)){e.result=y.construct(e.result),e.tag=y.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Le.call(e.typeMap[e.kind||"fallback"],e.tag))y=e.typeMap[e.kind||"fallback"][e.tag];else for(y=null,p=e.typeMap.multi[e.kind||"fallback"],f=0,d=p.length;f<d;f+=1)if(e.tag.slice(0,p[f].tag.length)===p[f].tag){y=p[f];break}y||_(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&_(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"'),y.resolve(e.result,e.tag)?(e.result=y.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):_(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function gh(e){var t=e.position,n,i,r,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(j(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!se(s);)s=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&_(e,"directive name must not be less than one character in length");s!==0;){for(;ze(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!ge(s));break}if(ge(s))break;for(n=e.position;s!==0&&!se(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&Fr(e),Le.call(Ka,i)?Ka[i](e,i,r):jn(e,'unknown document directive "'+i+'"')}if(j(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,j(e,!0,-1)):o&&_(e,"directives end mark is expected"),gt(e,e.lineIndent-1,$n,!1,!0),j(e,!0,-1),e.checkLineBreaks&&th.test(e.input.slice(t,e.position))&&jn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Vn(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,j(e,!0,-1));return}if(e.position<e.length-1)_(e,"end of the stream or a document separator is expected");else return}function Tl(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
172
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new ah(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,_(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)gh(n);return n.documents}function bh(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var i=Tl(e,n);if(typeof t!="function")return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function Sh(e,t){var n=Tl(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new ie("expected a single document in the stream, but found more")}}var vh=bh,Ah=Sh,Il={loadAll:vh,load:Ah},Ll=Object.prototype.toString,Ml=Object.prototype.hasOwnProperty,qr=65279,wh=9,Ht=10,_h=13,Eh=32,xh=33,kh=34,Lr=35,Ch=37,Oh=38,Th=39,Ih=42,Nl=44,Lh=45,Un=58,Mh=61,Nh=62,Ph=63,Rh=64,Pl=91,Rl=93,Dh=96,Dl=123,Fh=124,Fl=125,te={};te[0]="\\0";te[7]="\\a";te[8]="\\b";te[9]="\\t";te[10]="\\n";te[11]="\\v";te[12]="\\f";te[13]="\\r";te[27]="\\e";te[34]='\\"';te[92]="\\\\";te[133]="\\N";te[160]="\\_";te[8232]="\\L";te[8233]="\\P";var Bh=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],qh=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function $h(e,t){var n,i,r,o,s,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,o=i.length;r<o;r+=1)s=i[r],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&Ml.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function jh(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new ie("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+K.repeat("0",i-t.length)+t}var Uh=1,Jt=2;function Kh(e){this.schema=e.schema||Dr,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=K.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=$h(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Jt:Uh,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ga(e,t){for(var n=K.repeat(" ",t),i=0,r=-1,o="",s,a=e.length;i<a;)r=e.indexOf(`
173
173
  `,i),r===-1?(s=e.slice(i),i=a):(s=e.slice(i,r+1),i=r+1),s.length&&s!==`
174
174
  `&&(o+=n),o+=s;return o}function Mr(e,t){return`
175
- `+K.repeat(" ",e.indent*t)}function Kh(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function Kn(e){return e===_h||e===Ah}function Xt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==qr||65536<=e&&e<=1114111}function Wa(e){return Xt(e)&&e!==qr&&e!==wh&&e!==Ht}function Ha(e,t,n){var i=Wa(e),r=i&&!Kn(e);return(n?i:i&&e!==Nl&&e!==Pl&&e!==Rl&&e!==Dl&&e!==Fl)&&e!==Lr&&!(t===Un&&!r)||Wa(t)&&!Kn(t)&&e===Lr||t===Un&&r}function Vh(e){return Xt(e)&&e!==qr&&!Kn(e)&&e!==Ih&&e!==Nh&&e!==Un&&e!==Nl&&e!==Pl&&e!==Rl&&e!==Dl&&e!==Fl&&e!==Lr&&e!==Ch&&e!==Th&&e!==Eh&&e!==Dh&&e!==Lh&&e!==Mh&&e!==Oh&&e!==xh&&e!==kh&&e!==Ph&&e!==Rh}function Yh(e){return!Kn(e)&&e!==Un}function Gt(e,t){var n=e.charCodeAt(t),i;return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function Bl(e){var t=/^\n* /;return t.test(e)}var ql=1,Nr=2,$l=3,jl=4,mt=5;function Gh(e,t,n,i,r,o,s,a){var l,c=0,u=null,f=!1,d=!1,p=i!==-1,y=-1,m=Vh(Gt(e,0))&&Yh(Gt(e,e.length-1));if(t||s)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Gt(e,l),!Xt(c))return mt;m=m&&Ha(c,u,a),u=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Gt(e,l),c===Ht)f=!0,p&&(d=d||l-y-1>i&&e[y+1]!==" ",y=l);else if(!Xt(c))return mt;m=m&&Ha(c,u,a),u=c}d=d||p&&l-y-1>i&&e[y+1]!==" "}return!f&&!d?m&&!s&&!r(e)?ql:o===Jt?mt:Nr:n>9&&Bl(e)?mt:s?o===Jt?mt:Nr:d?jl:$l}function Wh(e,t,n,i,r){e.dump=(function(){if(t.length===0)return e.quotingType===Jt?'""':"''";if(!e.noCompatMode&&(Fh.indexOf(t)!==-1||Bh.test(t)))return e.quotingType===Jt?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(c){return Kh(e,c)}switch(Gh(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case ql:return t;case Nr:return"'"+t.replace(/'/g,"''")+"'";case $l:return"|"+Ja(t,e.indent)+Xa(Ga(t,o));case jl:return">"+Ja(t,e.indent)+Xa(Ga(Hh(t,s),o));case mt:return'"'+Jh(t)+'"';default:throw new ie("impossible error: invalid scalar style")}})()}function Ja(e,t){var n=Bl(e)?String(t):"",i=e[e.length-1]===`
175
+ `+K.repeat(" ",e.indent*t)}function Vh(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function Kn(e){return e===Eh||e===wh}function Xt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==qr||65536<=e&&e<=1114111}function Wa(e){return Xt(e)&&e!==qr&&e!==_h&&e!==Ht}function Ha(e,t,n){var i=Wa(e),r=i&&!Kn(e);return(n?i:i&&e!==Nl&&e!==Pl&&e!==Rl&&e!==Dl&&e!==Fl)&&e!==Lr&&!(t===Un&&!r)||Wa(t)&&!Kn(t)&&e===Lr||t===Un&&r}function Yh(e){return Xt(e)&&e!==qr&&!Kn(e)&&e!==Lh&&e!==Ph&&e!==Un&&e!==Nl&&e!==Pl&&e!==Rl&&e!==Dl&&e!==Fl&&e!==Lr&&e!==Oh&&e!==Ih&&e!==xh&&e!==Fh&&e!==Mh&&e!==Nh&&e!==Th&&e!==kh&&e!==Ch&&e!==Rh&&e!==Dh}function Gh(e){return!Kn(e)&&e!==Un}function Gt(e,t){var n=e.charCodeAt(t),i;return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function Bl(e){var t=/^\n* /;return t.test(e)}var ql=1,Nr=2,$l=3,jl=4,mt=5;function Wh(e,t,n,i,r,o,s,a){var l,c=0,u=null,f=!1,d=!1,p=i!==-1,y=-1,m=Yh(Gt(e,0))&&Gh(Gt(e,e.length-1));if(t||s)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Gt(e,l),!Xt(c))return mt;m=m&&Ha(c,u,a),u=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Gt(e,l),c===Ht)f=!0,p&&(d=d||l-y-1>i&&e[y+1]!==" ",y=l);else if(!Xt(c))return mt;m=m&&Ha(c,u,a),u=c}d=d||p&&l-y-1>i&&e[y+1]!==" "}return!f&&!d?m&&!s&&!r(e)?ql:o===Jt?mt:Nr:n>9&&Bl(e)?mt:s?o===Jt?mt:Nr:d?jl:$l}function Hh(e,t,n,i,r){e.dump=(function(){if(t.length===0)return e.quotingType===Jt?'""':"''";if(!e.noCompatMode&&(Bh.indexOf(t)!==-1||qh.test(t)))return e.quotingType===Jt?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(c){return Vh(e,c)}switch(Wh(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case ql:return t;case Nr:return"'"+t.replace(/'/g,"''")+"'";case $l:return"|"+Ja(t,e.indent)+Xa(Ga(t,o));case jl:return">"+Ja(t,e.indent)+Xa(Ga(Jh(t,s),o));case mt:return'"'+Xh(t)+'"';default:throw new ie("impossible error: invalid scalar style")}})()}function Ja(e,t){var n=Bl(e)?String(t):"",i=e[e.length-1]===`
176
176
  `,r=i&&(e[e.length-2]===`
177
177
  `||e===`
178
178
  `),o=r?"+":i?"":"-";return n+o+`
179
179
  `}function Xa(e){return e[e.length-1]===`
180
- `?e.slice(0,-1):e}function Hh(e,t){for(var n=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
180
+ `?e.slice(0,-1):e}function Jh(e,t){for(var n=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
181
181
  `);return c=c!==-1?c:e.length,n.lastIndex=c,Qa(e.slice(0,c),t)})(),r=e[0]===`
182
182
  `||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",i+=a+(!r&&!o&&l!==""?`
183
183
  `:"")+Qa(l,t),r=o}return i}function Qa(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,o,s=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(o=s>r?s:a,l+=`
184
184
  `+e.slice(r,o),r=o+1),s=a;return l+=`
185
185
  `,e.length-r>t&&s>r?l+=e.slice(r,s)+`
186
- `+e.slice(s+1):l+=e.slice(r),l.slice(1)}function Jh(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=Gt(e,r),i=te[n],!i&&Xt(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||$h(n);return t}function Xh(e,t,n){var i="",r=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(_e(e,t,a,!1,!1)||typeof a>"u"&&_e(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function za(e,t,n,i){var r="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(_e(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&_e(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=Mr(e,t)),e.dump&&Ht===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function Qh(e,t,n){var i="",r=e.tag,o=Object.keys(n),s,a,l,c,u;for(s=0,a=o.length;s<a;s+=1)u="",i!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=o[s],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),_e(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),_e(e,t,c,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function zh(e,t,n,i){var r="",o=e.tag,s=Object.keys(n),a,l,c,u,f,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new ie("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)d="",(!i||r!=="")&&(d+=Mr(e,t)),c=s[a],u=n[c],e.replacer&&(u=e.replacer.call(n,c,u)),_e(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Ht===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,f&&(d+=Mr(e,t)),_e(e,t+1,u,!0,f)&&(e.dump&&Ht===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,r+=d));e.tag=o,e.dump=r||"{}"}function Za(e,t,n){var i,r,o,s,a,l;for(r=n?e.explicitTypes:e.implicitTypes,o=0,s=r.length;o<s;o+=1)if(a=r[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,Ll.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(Ml.call(a.represent,l))i=a.represent[l](t,l);else throw new ie("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function _e(e,t,n,i,r,o,s){e.tag=null,e.dump=n,Za(e,n,!1)||Za(e,n,!0);var a=Ll.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",f,d;if(u&&(f=e.duplicates.indexOf(n),d=f!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(r=!1),d&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(u&&d&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(zh(e,t,e.dump,r),d&&(e.dump="&ref_"+f+e.dump)):(Qh(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?za(e,t-1,e.dump,r):za(e,t,e.dump,r),d&&(e.dump="&ref_"+f+e.dump)):(Xh(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Wh(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ie("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Zh(e,t){var n=[],i=[],r,o;for(Pr(e,n,i),r=0,o=i.length;r<o;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(o)}function Pr(e,t,n){var i,r,o;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;r<o;r+=1)Pr(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;r<o;r+=1)Pr(e[i[r]],t,n)}function ey(e,t){t=t||{};var n=new Uh(t);n.noRefs||Zh(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),_e(n,0,i,!0,!0)?n.dump+`
187
- `:""}var ty=ey,ny={dump:ty};function $r(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var iy=Q,ry=nl,oy=sl,sy=fl,ay=dl,ly=Dr,cy=Il.load,uy=Il.loadAll,fy=ny.dump,dy=ie,py={binary:gl,float:ul,map:ol,null:al,pairs:Sl,set:vl,timestamp:hl,bool:ll,int:cl,merge:yl,omap:bl,seq:rl,str:il},my=$r("safeLoad","load"),hy=$r("safeLoadAll","loadAll"),yy=$r("safeDump","dump"),W={Type:iy,Schema:ry,FAILSAFE_SCHEMA:oy,JSON_SCHEMA:sy,CORE_SCHEMA:ay,DEFAULT_SCHEMA:ly,load:cy,loadAll:uy,dump:fy,YAMLException:dy,types:py,safeLoad:my,safeLoadAll:hy,safeDump:yy};var Ac=xr(eo(),1);async function Hy(e,t){let n=Sc(e,"config.yaml"),i,r=!1,o;try{await Pe.mkdir(e,{recursive:!0}),await Pe.writeFile(n,"",{flag:"a",mode:384}),await Pe.chmod(n,384);let s=await Pe.realpath(n);i=Sc(Wy(s),`.config-tmp-${Gy(6).toString("hex")}`),o=await Ac.default.lock(s,{stale:1e4,retries:{retries:20,factor:1,minTimeout:5,maxTimeout:25}});let l=W.load(await Pe.readFile(s,"utf8"))??{};if(!vc(l))throw new Error("Invalid config document");let c=l.tui??{};if(!vc(c))throw new Error("Invalid TUI settings");let u={...c};t===void 0?delete u.statusLine:u.statusLine=[...t];let f={...l,tui:u},d=384,p=await Pe.open(i,"wx",d);r=!0;try{await p.writeFile(W.dump(f,{lineWidth:-1,noRefs:!0}),"utf8"),await p.chmod(d)}finally{await p.close()}await Pe.rename(i,s)}catch{throw new Error("Unable to save status line settings. Check config.yaml syntax and permissions.")}finally{r&&i&&await Pe.unlink(i).catch(()=>{}),await o?.().catch(()=>{})}}function vc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function to(e){if(typeof e!="object"||e===null||Array.isArray(e))return{};let t=e.enabled;return typeof t=="boolean"?{enabled:t}:{}}function no(e,t){return{enabled:to(t).enabled??to(e).enabled??!0}}import Oe from"node:fs";import be from"node:fs";var wc=384;function _t(e){if(process.platform==="win32")return;let t=be.statSync(e).mode;(t&63)!==0&&be.chmodSync(e,t&448)}function it(e,t,n=!1){let i=be.constants.O_WRONLY|be.constants.O_CREAT|(n?be.constants.O_EXCL:0),r=be.openSync(e,i,wc);try{be.fchmodSync(r,wc),be.ftruncateSync(r,0),be.writeFileSync(r,t)}finally{be.closeSync(r)}}import{isDeepStrictEqual as hd}from"node:util";var ee=xr(dd(),1);function er(e){try{let t=W.load(e);return Bs(t)?t:{}}catch{return{}}}function Ln(e,t,n){let i=(0,ee.parseDocument)(e,{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!0});if(i.errors.length>0||!(0,ee.isMap)(i.contents)&&e.trim()!=="")return md(n);try{let r=gd(t,n);if(r.length===0)return e;wv(i),Ev(i);for(let s of r){let a=_v(i,s.path);s.kind==="delete"?i.deleteIn(a):i.setIn(a,s.value)}let o=i.toString({indent:2,lineWidth:-1});if(!hd(W.load(o),W.load(md(n))))throw new Error("The serialized configuration does not match the intended values");return o}catch(r){throw new Error(`config.yaml could not be rewritten: ${r instanceof Error?r.message:String(r)}${r instanceof RangeError?". Remove the self-referential YAML anchor and retry.":""}`)}}function wv(e){(0,ee.visit)(e,{Scalar(t,n){if(n.addToJSMap||typeof n.source!="string"||n.type!=="PLAIN"&&!n.tag)return;let i=n.type==="PLAIN"&&!n.source.includes(`
188
- `)?n.source:JSON.stringify(n.source),r=n.tag?`!<${n.tag}> `:"",o=W.load(`value: ${r}${i}`).value;hd(n.value,o)||(n.value=o,delete n.format)}})}function yd(e,t){return e.items.find(n=>(0,ee.isScalar)(n.key)&&String(n.key.value)===t)?.key??t}function _v(e,t){let n=[],i=e.contents;for(let r of t)n.push((0,ee.isMap)(i)?yd(i,r):r),i=e.getIn(n,!0);return n}function Ev(e){let t=new Map;(0,ee.visit)(e,{Alias(n,i){let r=i.toJS(e),o=pd(e,r);o.comment=i.comment,o.commentBefore=i.commentBefore,o.spaceBefore=i.spaceBefore,t.set(i,o)}}),(0,ee.visit)(e,{Alias:(n,i)=>t.get(i)}),(0,ee.visit)(e,{Map(n,i){let r=i.items.filter(a=>(0,ee.isScalar)(a.key)&&a.key.addToJSMap);if(r.length===0)return;let o=i.toJS(e),s=r.flatMap(a=>[a.key,a.value].flatMap(l=>(0,ee.isNode)(l)?[l.commentBefore,l.comment]:[]));i.commentBefore=[i.commentBefore,...s].filter(Boolean).join(`
189
- `)||void 0,i.items=i.items.filter(a=>!r.includes(a));for(let[a,l]of Object.entries(o))i.has(yd(i,a))||i.set(a,pd(e,l))}}),e.setSchema(e.directives?.yaml.version??"1.2",{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!1})}function pd(e,t){let n=e.createNode(t,{aliasDuplicateObjects:!1});return(0,ee.visit)(n,{Pair(i,r){(0,ee.isScalar)(r.key)&&r.key.value==="<<"&&(r.key.type="QUOTE_DOUBLE")}}),n}function gd(e,t,n=[]){if(!Bs(e)||!Bs(t))return xv(e,t)?[]:[{kind:"set",path:n,value:t}];let i=[];for(let r of new Set([...Object.keys(e),...Object.keys(t)])){let o=[...n,r];!(r in t)||t[r]===void 0?i.push({kind:"delete",path:o}):r in e?i.push(...gd(e[r],t[r],o)):i.push({kind:"set",path:o,value:t[r]})}return i}function xv(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function md(e){return W.dump(e,{indent:2,lineWidth:-1,noRefs:!0})}function Bs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Rt(e){if(typeof e!="object"||e===null)return!1;if("v2_enabled"in e&&typeof e.v2_enabled=="boolean")return e.v2_enabled;if(!("v2"in e))return!1;let t=e.v2;return typeof t!="object"||t===null?!1:"enabled"in t&&typeof t.enabled=="boolean"?t.enabled:"writeEnabled"in t&&t.writeEnabled===!0||"recallEnabled"in t&&t.recallEnabled===!0}var tr={enabled:!1,detailedLoggingEnabled:!1,writeEnabled:!1,recallEnabled:!1,eligibleSessionIdleMs:600*1e3,maxCaptureInputTokens:64e3,maxSessionDocBytes:64*1024,maxSelectedSessions:256,maxConsolidationInputTokens:256e3,maxMemoryMarkdownBytes:2*1024*1024,maxSummaryInjectionTokens:2500,maxCaptureSessionsPerWake:6,maxCaptureConcurrency:2,eligibleSessionMaxAgeDays:30,maxCaptureAttemptsPerRevision:3,captureFailureBackoffMs:3600*1e3,publicationCooldownMs:360*60*1e3,maxConsolidationAgentTurns:64,minModelQuotaRemainingPercent:25,captureModel:void 0,captureReasoningEffort:"low",consolidationModel:void 0,consolidationReasoningEffort:"medium",retentionDays:90};function vd(e,t){let n=e.memory,i=n!=null&&typeof n=="object"&&!Array.isArray(n)?n:{},r=i.dailyDigest,o=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},s=i.v2,a=s!=null&&typeof s=="object"&&!Array.isArray(s)?s:{},l=t.v2,c=i.legacyRecallDisabledAgents;return{legacyRecallDisabledAgents:c&&typeof c=="object"&&!Array.isArray(c)?Object.fromEntries(Object.entries(c).filter(([,u])=>typeof u=="boolean")):{},enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,proactive:typeof i.proactive=="boolean"?i.proactive:t.proactive,dailyDigest:{enabled:typeof o.enabled=="boolean"?o.enabled:t.dailyDigest.enabled},v2_enabled:typeof i.v2_enabled=="boolean"||["enabled","writeEnabled","recallEnabled"].some(u=>typeof a[u]=="boolean")?Rt(i):Rt(t),v2:{...typeof a.enabled=="boolean"?{enabled:a.enabled}:{},detailedLoggingEnabled:qs(a.detailedLoggingEnabled,l.detailedLoggingEnabled),writeEnabled:qs(a.writeEnabled,l.writeEnabled),recallEnabled:qs(a.recallEnabled,l.recallEnabled),eligibleSessionIdleMs:re(a.eligibleSessionIdleMs,l.eligibleSessionIdleMs),maxCaptureInputTokens:re(a.maxCaptureInputTokens,l.maxCaptureInputTokens),maxSessionDocBytes:re(a.maxSessionDocBytes,l.maxSessionDocBytes),maxSelectedSessions:re(a.maxSelectedSessions,l.maxSelectedSessions),maxConsolidationInputTokens:re(a.maxConsolidationInputTokens,l.maxConsolidationInputTokens),maxMemoryMarkdownBytes:re(a.maxMemoryMarkdownBytes,l.maxMemoryMarkdownBytes),maxSummaryInjectionTokens:re(a.maxSummaryInjectionTokens,l.maxSummaryInjectionTokens),maxCaptureSessionsPerWake:re(a.maxCaptureSessionsPerWake,l.maxCaptureSessionsPerWake),maxCaptureConcurrency:re(a.maxCaptureConcurrency,l.maxCaptureConcurrency),eligibleSessionMaxAgeDays:re(a.eligibleSessionMaxAgeDays,l.eligibleSessionMaxAgeDays),maxCaptureAttemptsPerRevision:re(a.maxCaptureAttemptsPerRevision,l.maxCaptureAttemptsPerRevision),captureFailureBackoffMs:re(a.captureFailureBackoffMs,l.captureFailureBackoffMs),publicationCooldownMs:re(a.publicationCooldownMs,l.publicationCooldownMs),maxConsolidationAgentTurns:re(a.maxConsolidationAgentTurns,l.maxConsolidationAgentTurns),minModelQuotaRemainingPercent:kv(a.minModelQuotaRemainingPercent,l.minModelQuotaRemainingPercent),captureModel:bd(a.captureModel,l.captureModel),captureReasoningEffort:Sd(a.captureReasoningEffort,l.captureReasoningEffort),consolidationModel:bd(a.consolidationModel,l.consolidationModel),consolidationReasoningEffort:Sd(a.consolidationReasoningEffort,l.consolidationReasoningEffort),retentionDays:re(a.retentionDays,l.retentionDays)}}}function qs(e,t){return typeof e=="boolean"?e:t}function re(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function kv(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0&&e<=100?e:t}function bd(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}function Sd(e,t){return e==="low"||e==="medium"||e==="high"?e:t}function Cv(e,t){return!Rt(e)&&e?.enabled!==!1&&e?.legacyRecallDisabledAgents?.[t]!==!0}import oe from"node:path";import kA from"node:os";import{spawnSync as CA}from"node:child_process";import{fileURLToPath as OA}from"node:url";function Ad(e){let t=e.tui;if(t==null||typeof t!="object"||Array.isArray(t))return{};let n=t,i=n.notifications,r;if(i&&typeof i=="object"&&!Array.isArray(i)){let{when:l,method:c}=i;r={...l==="unfocused"||l==="always"||l==="never"?{when:l}:{},...c==="auto"||c==="osc9"||c==="osc777"||c==="bel"?{method:c}:{}}}let o=n.statusLine,s=Array.isArray(o)?o.filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean):void 0,a=Ov(n.customStatusLine);return{...typeof n.showTips=="boolean"?{showTips:n.showTips}:{},...r?{notifications:r}:{},...s?{statusLine:s}:{},...a?{customStatusLine:a}:{}}}function Ov(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e,n=typeof t.command=="string"?t.command.trim():"";if(n)return{command:n,...t.display==="inline"||t.display==="block"?{display:t.display}:{},...t.position==="above"||t.position==="below"?{position:t.position}:{},...t.colorMode==="plain"||t.colorMode==="ansi"?{colorMode:t.colorMode}:{},...typeof t.maxLines=="number"&&Number.isFinite(t.maxLines)?{maxLines:t.maxLines}:{},...typeof t.timeoutMs=="number"&&Number.isFinite(t.timeoutMs)?{timeoutMs:t.timeoutMs}:{},...typeof t.intervalSeconds=="number"&&Number.isFinite(t.intervalSeconds)?{intervalSeconds:t.intervalSeconds}:{}}}import{createHash as Tv,randomUUID as Iv}from"node:crypto";import ir from"node:fs";import nr from"node:path";function Ed(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e,n={};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseURL=="string"&&(n.baseURL=t.baseURL);let i=js(t.modelContextLimits);return i&&(n.modelContextLimits=i),Object.keys(n).length>0?n:void 0}function js(e){if(!B(e))return;let t=Object.entries(e).filter(n=>n[0].length>0&&Number.isSafeInteger(n[1])&&n[1]>0);return t.length>0?Object.fromEntries(t):void 0}function xd(e,t){let n=e.minimax;if(!n?.models||!t)return e;let i=!1,r=Object.fromEntries(Object.entries(n.models).map(([o,s])=>{let a=t[o];return a===void 0||!s.contextWindowOptions?.includes(a)||s.limit?.context===a?[o,s]:(i=!0,[o,{...s,limit:{...s.limit,context:a}}])}));return i?{...e,minimax:{...n,models:r}}:e}function kd(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=Object.entries(e).filter(([,n])=>n!=null&&typeof n=="object"&&!Array.isArray(n));if(t.length!==0)return Object.fromEntries(t.map(([n,i])=>[n,Od(i)]))}function Cd(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,B(n)?Od(n):n]))}function Od(e){if(!B(e.models))return e;let t=!1,n=Object.fromEntries(Object.entries(e.models).map(([i,r])=>{if(!B(r)||!B(r.thinking))return[i,r];let o=typeof r.thinking.effort=="string"?r.thinking.effort.trim():"",s=typeof r.thinking.defaultEffort=="string"?r.thinking.defaultEffort.trim():"";if(!Object.hasOwn(r.thinking,"effort")&&!Object.hasOwn(r.thinking,"defaultEffort"))return[i,r];let a=[],l=new Set;if(Array.isArray(r.thinking.effortOptions))for(let d of r.thinking.effortOptions){if(typeof d!="string")continue;let p=d.trim();!p||l.has(p)||(l.add(p),a.push(p))}o&&!l.has(o)&&(l.add(o),a.push(o)),s&&!l.has(s)&&(l.add(s),a.push(s));let c={...r.thinking};delete c.effort,delete c.effortOptions,delete c.defaultEffort;let u={...c,...a.length>0?{effortOptions:a}:{},...s?{defaultEffort:s}:{}},f={...r};return Object.keys(u).length>0?f.thinking=u:delete f.thinking,t=!0,[i,f]}));return t?{...e,models:n}:e}var Td="byok_legacy_provider_to_custom_provider_v1",Id="config.yaml.bak.byok-legacy-provider.",$s=new Set(["minimax","minimax_api","provider","custom_provider"]),Lv=/^[A-Za-z0-9 _-]+$/;function Ld(e,t){let n={migrated:!1,migratedProviders:{}};if(!t.isManagedRuntime()||!ir.existsSync(e))return n;let i=Pv(e);if(!B(i.provider))return n;let r=i.provider,o=B(i.custom_provider)?i.custom_provider:{},s=Kv(i),a={},l={...o},c=new Set(Object.keys(l)),u=!1,f=t.getManagedPreset().provider;for(let[d,p]of Object.entries(r)){if(!Rv(d,p,f))continue;let y=s.providers[d];if(y&&!$s.has(y)&&!B(l[y])){delete r[d],u=!0;continue}let m=y&&!$s.has(y)?y:Bv(d,p,c);a[d]=m,B(l[m])||(l[m]=Fv(p),c.add(m),u=!0),s.providers[d]!==m&&(s.providers[d]=m,u=!0),delete r[d],u=!0}if(!u&&Object.keys(a).length===0)return n;if(u=_d(i,"defaultModel",a)||u,u=_d(i,"defaultLightModel",a)||u,u=jv(i,a)||u,!u)return{migrated:!1,migratedProviders:a};Object.keys(l).length>0?i.custom_provider=l:delete i.custom_provider,Vv(i,s);try{let d=Uv(e);return it(e,W.dump(i,{indent:2,lineWidth:-1,noRefs:!0})),{migrated:!0,migratedProviders:a,backupPath:d}}catch(d){return console.warn(`[config] legacy BYOK provider migration skipped: ${Gv(d)}`),{migrated:!1,migratedProviders:a}}}function Md(e,t){let n=e.provider,i=e.defaultModel;if(Object.prototype.hasOwnProperty.call(n,"minimax_api")){let{minimax_api:y,...m}=n;n=m,console.warn('[config] "minimax_api" is a reserved provider id; ignoring provider.minimax_api from config.yaml')}let o=t.getManagedPreset().provider.minimax,s=n.minimax,a=t.isManagedRuntime();if(!(a||Mv(s,t)))return{provider:n,defaultModel:i};let c=s?.options,u=a&&t.shouldEnforceManagedProviderProtection(),f=Nv(o.models,s?.models),d=typeof c?.baseURL=="string"&&c.baseURL.length>0?c.baseURL:void 0,p=u&&d!=null&&!t.isManagedPresetBaseUrl(d);return n={...n,minimax:{...o,...s??{},npm:s?.npm??o.npm,models:f,options:{...o.options??{},...c??{},...p?{apiKey:o.options?.apiKey}:{},...u?{authMode:"managed-login",baseURL:o.options?.baseURL}:{}}}},{provider:n,defaultModel:i}}function Mv(e,t){let n=e?.options;return n?.authMode==="managed-login"?!0:typeof n?.baseURL=="string"&&t.isManagedPresetBaseUrl(n.baseURL)}function Nv(e,t){return t&&Object.keys(t).length>0?t:e??{}}function Pv(e){try{let t=W.load(ir.readFileSync(e,"utf-8"));return B(t)?t:{}}catch{return{}}}function Rv(e,t,n){return e==="minimax"||e==="minimax_api"||!Yv(t)||!Dv(t)?!1:!Object.prototype.hasOwnProperty.call(n,e)}function Dv(e){let t=B(e.options)?e.options:void 0;return typeof t?.apiKey=="string"&&t.apiKey.trim().length>0&&typeof t.baseURL=="string"&&t.baseURL.trim().length>0&&B(e.models)}function Fv(e){let t=B(e.options)?e.options:{};return{...e,kind:"custom",enabled:e.enabled!==!1,options:{...t,authMode:"api-key"}}}function Bv(e,t,n){let i=B(t)?t:{},r=typeof i.name=="string"?i.name:void 0,o=`provider-${qv(e)}`,s=wd(e)??wd(r)??o;for(let a=0;;a+=1){let l=a===0?s:`${s}-${a+1}`;if(!n.has(l)&&!$s.has(l))return l}}function wd(e){let t=e?.trim();return!t||!Lv.test(t)?void 0:t.toLowerCase().replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function qv(e){return Tv("sha256").update(e).digest("hex").slice(0,8)}function _d(e,t,n){let i=e[t];if(typeof i!="string")return!1;let r=$v(i,n);return r===i?!1:(e[t]=r,!0)}function $v(e,t){let n=e.indexOf("/");if(n<=0||n===e.length-1)return e;let i=e.slice(0,n),r=t[i];return r?`custom_provider:${r}/${e.slice(n+1)}`:e}function jv(e,t){if(!B(e.nexus)||!B(e.nexus.model))return!1;let n=e.nexus.model.providerID;if(typeof n!="string")return!1;let i=t[n];return i?(e.nexus.model.providerID=`custom_provider:${i}`,!0):!1}function Nd(e){if(process.platform==="win32")return;let t=nr.dirname(e),n;try{n=ir.readdirSync(t,{withFileTypes:!0})}catch{console.warn(`[config] Could not inspect legacy BYOK backups in ${JSON.stringify(t)}. Backup permissions were not verified; check directory access and restrict backup permissions manually.`);return}for(let i of n)if(i.isFile()&&i.name.startsWith(Id)){let r=nr.join(t,i.name);try{_t(r)}catch{console.warn(`[config] Could not restrict legacy BYOK backup ${JSON.stringify(r)}. It may still be readable by other users; restrict its permissions manually.`)}}}function Uv(e){let t=nr.join(nr.dirname(e),`${Id}${Date.now()}.${Iv()}`);return _t(e),it(t,ir.readFileSync(e),!0),t}function Kv(e){let n=(B(e.migrations)?e.migrations:void 0)?.[Td];return{providers:B(n)&&B(n.providers)?Object.fromEntries(Object.entries(n.providers).filter(r=>typeof r[1]=="string")):{}}}function Vv(e,t){let n=B(e.migrations)?e.migrations:{};n[Td]={version:1,providers:t.providers},e.migrations=n}function Yv(e){return B(e)?typeof e.name=="string"||typeof e.npm=="string"||typeof e.api=="string"||B(e.options)||B(e.models):!1}function B(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Gv(e){return e instanceof Error?e.message:String(e)}function Pd(e,t){if(e==null||typeof e!="object"||Array.isArray(e))return t;let n=Reflect.get(e,"mode"),i=Reflect.get(e,"turnDiffCard");return{mode:n==="inline"||n==="subagent"?n:t.mode,turnDiffCard:i==="concise"||i==="standard"?i:t.turnDiffCard,modeSource:n==="inline"||n==="subagent"?"explicit":"default"}}function Rd(e,t){let n=t.keepAlive,i=t.xdg,r=t.spawnConcurrency,o=()=>({enabled:n.enabled,maxProcesses:n.maxProcesses,maxLifetimeMs:n.maxLifetimeMs,agents:[...n.agents]}),s=e.opencode;if(s==null||typeof s!="object"||Array.isArray(s))return{keepAlive:o(),xdg:{...i},spawnConcurrency:r};let a=s,l=a.spawnConcurrency,c=typeof l=="number"&&Number.isFinite(l)&&l>0&&Number.isInteger(l)?l:r,u=Wv(a.xdg,i),f=a.keepAlive;if(f==null||typeof f!="object"||Array.isArray(f))return{keepAlive:o(),xdg:u,spawnConcurrency:c};let d=f,p=d.maxProcesses,y=typeof p=="number"&&Number.isFinite(p)&&p>0&&Number.isInteger(p)?p:n.maxProcesses,m=d.maxLifetimeMs,h=typeof m=="number"&&Number.isFinite(m)&&m>0&&Number.isInteger(m)?m:n.maxLifetimeMs,g=d.agents,b;return Array.isArray(g)?(b=g.filter(v=>typeof v=="string"&&v.length>0),b.length===0&&(b=[...n.agents])):b=[...n.agents],{keepAlive:{enabled:typeof d.enabled=="boolean"?d.enabled:n.enabled,maxProcesses:y,maxLifetimeMs:h,agents:b},xdg:u,spawnConcurrency:c}}function Wv(e,t){let n=e!=null&&typeof e=="object"&&!Array.isArray(e)?e:void 0,i=n?.startupImport,r=i==="background"||i==="blocking"||i==="off"?i:t.startupImport;return{dataIsolation:typeof n?.dataIsolation=="boolean"?n.dataIsolation:t.dataIsolation,startupImport:r}}function rr(e){let t=JSON.stringify({level:40,time:Date.now(),name:"config.asr",msg:e});process.stderr.write(`${t}
190
- `)}var sr={enabled:!0};function Dd(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e,n=typeof t.apiKey=="string"&&t.apiKey.trim().length>0,i=typeof t.resourceId=="string"&&t.resourceId.trim().length>0;return n||i}function or(e){return typeof e=="string"&&e.trim().length>0}function Fd(e){let t=e.asr;if(t==null||typeof t!="object"||Array.isArray(t))return{...sr};let n=t;return Dd(n.seed)&&rr("Ignoring legacy `asr.seed.*` in config \u2014 Seed ASR was retired from the daemon; only Amadeus remains. Remove `asr.seed` from config.yaml."),Dd(n.qwen)&&rr("Ignoring legacy `asr.qwen.apiKey` in config \u2014 Qwen ASR was retired from the daemon; only Amadeus remains. Remove `asr.qwen` from config.yaml."),(or(n.mode)||or(n.proxyBaseUrl))&&rr("Ignoring legacy `asr.mode` / `asr.proxyBaseUrl` in config \u2014 the daemon no longer runs the shared asr-proxy WebSocket path. The Amadeus HTTP proxy is managed by the application environment. Remove these keys from config.yaml."),(or(n.primaryProvider)||or(n.fallbackProvider))&&rr("Ignoring legacy `asr.primaryProvider` / `asr.fallbackProvider` in config \u2014 only Amadeus remains and provider selection is no longer configurable. Remove these keys from config.yaml."),{enabled:typeof n.enabled=="boolean"?n.enabled:sr.enabled}}var Hv={policyOwner:"core",storageWriteVersion:2,classifierTimeoutMs:6e4,userConfirmationEnabled:!0};function Bd(e,t=Hv){let n=e.permission;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.policyOwner===void 0?t.policyOwner:i.policyOwner==="engine"||i.policyOwner==="core"?i.policyOwner:"engine",o=i.storageWriteVersion===1||i.storageWriteVersion===2?i.storageWriteVersion:t.storageWriteVersion,s=i.classifierTimeoutMs,a=typeof s=="number"&&Number.isFinite(s)&&s>=5e3?Math.floor(s):t.classifierTimeoutMs,l=typeof i.userConfirmationEnabled=="boolean"?i.userConfirmationEnabled:t.userConfirmationEnabled;return{policyOwner:r,storageWriteVersion:o,classifierTimeoutMs:a,userConfirmationEnabled:l}}var qd=["user-cc","user-codex","user-agents","workspace-minimax","workspace-cc","workspace-agents"],Jv={"user-cc":"user-claude","workspace-cc":"workspace-claude"},lr={external:{enabled:!0,walkUp:!0,duplicateWarn:!0,sources:{"workspace-minimax":{enabled:!0,priority:65},"workspace-cc":{enabled:!0,priority:60},"workspace-agents":{enabled:!0,priority:55},"user-cc":{enabled:!0,priority:40},"user-codex":{enabled:!0,priority:35},"user-agents":{enabled:!0,priority:30}}}};function ar(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Xv(e,t){return ar(e)?{enabled:typeof e.enabled=="boolean"?e.enabled:t.enabled,priority:typeof e.priority=="number"&&Number.isFinite(e.priority)?e.priority:t.priority}:t}function Us(e){let t=lr,n=ar(e.skills)?e.skills:{},i=ar(n.external)?n.external:{},r=ar(i.sources)?i.sources:{},o={...t.external.sources};for(let s of qd){let a=Jv[s],l=Object.hasOwn(r,s)?r[s]:a?r[a]:void 0;o[s]=Xv(l,t.external.sources[s])}return{external:{enabled:typeof i.enabled=="boolean"?i.enabled:t.external.enabled,walkUp:typeof i.walkUp=="boolean"?i.walkUp:t.external.walkUp,duplicateWarn:typeof i.duplicateWarn=="boolean"?i.duplicateWarn:t.external.duplicateWarn,sources:o}}}var Qv=qd;var $d=["pi-agent"],Dt="pi-agent";function jd(e){return typeof e!="string"?Dt:$d.includes(e)?e:Dt}function Ks(e){return e==null||typeof e!="object"||Array.isArray(e)?{defaultFramework:Dt}:{defaultFramework:jd(e.defaultFramework)}}import Y from"node:fs";import zv from"node:os";import Ft from"node:path";var Wd=".minimax",Hd=".mavis",Zv={error:()=>{},info:()=>{},warn:()=>{}};function Hs(e){return e??zv.homedir()}function Jd(e,t){return t?`${e}-${t}`:e}function Xd(e,t){return Ft.join(Hs(e),Jd(Wd,t))}function Qd(e,t){return Ft.join(Hs(e),Jd(Hd,t))}function Ys(e){try{let t=Y.lstatSync(e);return t.isSymbolicLink()?{kind:"link"}:t.isDirectory()?{kind:"directory"}:{kind:"other"}}catch(t){let n=t.code;return n==="ENOENT"||n==="ENOTDIR"?{kind:"missing"}:{kind:"inaccessible",error:t}}}function Vs(e){let t=Ft.resolve(e);return process.platform==="win32"?(t=t.replace(/^\\\\\?\\/,""),t.toLowerCase()):t}function Js(e,t){try{let n=Y.readlinkSync(e),i=Vs(t);return Vs(Ft.resolve(Ft.dirname(e),n))===i||Vs(n)===i}catch{return!1}}function cr(e,t,n){if(!Js(e,t))try{Y.symlinkSync(t,e,process.platform==="win32"?"junction":"dir")}catch(i){n.warn(`Failed to create compat link ${e} -> ${t}: ${String(i)}`)}}function Ud(e,t,n){if(t.kind==="missing")return!0;if(t.kind==="link"||t.kind==="other")try{return Y.unlinkSync(e),!0}catch(i){return n.warn(`Failed to remove ${e} before creating compat link: ${String(i)}`),!1}return!1}function Gs(e){try{let t=Y.readdirSync(e);if(t.length===0)return"empty";if(t.length===1&&t[0]==="workspace")try{return Y.readdirSync(Ft.join(e,"workspace")).length>0?"hasData":"empty"}catch{return"unknown"}return"hasData"}catch{return"unknown"}}function Ws(e){try{return Y.statSync(e).isDirectory()?Gs(e):void 0}catch{return"unknown"}}function eA(e,t){return`${e}.backup-${t()}`}function tA(e,t,n){let i=eA(e,n);try{return Y.renameSync(e,i),t.warn(`Backed up legacy data dir ${e} -> ${i}`),!0}catch(r){return t.warn(`Failed to back up legacy data dir ${e}: ${String(r)}`),!1}}function nA(e,t,n,i){if(Js(e,t))return!0;let r=Ys(e);if(r.kind==="missing")return!0;if(r.kind==="link"){let o=Ws(e);return o==="hasData"||o==="unknown"?(n.warn(`Cannot replace legacy data dir symlink ${e}; it may point to real data outside ${t}`),!1):Ud(e,r,n)}return r.kind==="other"?Ud(e,r,n):r.kind==="directory"?tA(e,n,i):(n.warn(`Cannot replace inaccessible legacy data dir ${e}; leaving it untouched`),!1)}function Kd(e,t,n,i){nA(e,t,n,i)&&cr(e,t,n)}function iA(e,t){try{return Y.rmSync(e,{recursive:!0,force:!1}),!0}catch(n){return t.warn(`Failed to remove empty primary data dir ${e}: ${String(n)}`),!1}}function Vd(e,t,n){try{return Y.renameSync(e,t),n.info(`Migrated legacy data dir ${e} -> ${t}`),!0}catch(i){return n.warn(`Failed to migrate legacy data dir ${e} -> ${t}: ${String(i)}`),!1}}function rA(e,t,n,i){try{Y.cpSync(e,n,{recursive:!0,errorOnExist:!0,force:!1}),Y.unlinkSync(t);try{Y.rmSync(e,{recursive:!0,force:!1})}catch(r){i.warn(`Copied legacy symlink data dir ${e} -> ${n}, but failed to remove old target: ${String(r)}`)}return i.info(`Copied legacy data dir symlink target ${e} -> ${n}`),!0}catch(r){try{Y.existsSync(n)&&Y.rmSync(n,{recursive:!0,force:!0})}catch(o){i.warn(`Failed to clean up partial primary data dir ${n}: ${String(o)}`)}return i.warn(`Failed to copy legacy symlink data dir ${t} -> ${n}: ${String(r)}`),!1}}function Yd(e,t,n){try{let i=Y.realpathSync(e);try{Y.renameSync(i,t)}catch(r){if(r.code==="EXDEV")return rA(i,e,t,n);throw r}return Y.unlinkSync(e),n.info(`Migrated legacy data dir symlink target ${i} -> ${t}`),!0}catch(i){return n.warn(`Failed to migrate legacy symlink data dir ${e} -> ${t}: ${String(i)}`),!1}}function Gd(e,t){try{return Y.mkdirSync(e,{recursive:!0}),!0}catch(n){return t.warn(`Failed to create primary data dir ${e}: ${String(n)}`),!1}}function oA(e,t,n,i){let r=Ys(e),o=Ys(t);if(r.kind==="inaccessible")return n.warn(`Primary data dir ${e} is inaccessible; not treating it as missing`),e;if(r.kind==="directory"){let s=Gs(e),a=o.kind==="directory"?Gs(t):o.kind==="link"?Ws(t)??"empty":"empty";if(s==="empty"){if(o.kind==="inaccessible"||a==="unknown")return n.warn(`Legacy data dir ${t} may contain data but is inaccessible; not using empty primary ${e}`),t;if((o.kind==="directory"||o.kind==="link")&&a==="hasData"){if(!iA(e,n))return t;if(o.kind==="link"){if(!Yd(t,e,n))return t}else if(!Vd(t,e,n))return t;return cr(t,e,n),e}}return Kd(t,e,n,i),e}if(Js(t,e))return Gd(e,n),e;if(o.kind==="directory")return Vd(t,e,n)?(cr(t,e,n),e):t;if(o.kind==="link"){let s=Ws(t);if(s==="hasData")return Yd(t,e,n)?(cr(t,e,n),e):t;if(s==="unknown")return n.warn(`Legacy data dir symlink ${t} target is inaccessible; not treating it as missing`),t}return o.kind==="inaccessible"?(n.warn(`Legacy data dir ${t} is inaccessible; not treating it as missing`),t):r.kind==="link"||r.kind==="other"?(n.warn(`Primary data dir path ${e} exists but is not a directory; using it without migration`),e):(Gd(e,n),Kd(t,e,n,i),e)}function Ye(e={}){let t=Hs(e.homeDir),n=e.profile??null;return oA(Xd(t,n),Qd(t,n),e.logger??Zv,e.nowMs??Date.now)}function sA(e,t){return Ye({homeDir:e,logger:t})}function aA(e,t,n){return Ye({homeDir:t,profile:e,logger:n})}var ta=["read","write","edit","bash","task_query","task_output","task_stop","grep","glob","todowrite","web_fetch","website_deploy","workspace_semantic_search"],na=["images_understand","image_synthesize","images_search_and_download","image_reverse_search","submit_video_generation","query_video_generation","gen_videos","batch_text_to_video","batch_image_to_video","get_voice_list","batch_text_to_audio","batch_text_to_music","synthesize_speech","batch_synthesize_speech","audios_understand","videos_understand","transcribe_audio"],ia=["code-review","deep-research","deploy-website","docx","edit-deployed-website","init","lark-tools","llm-call","mcode-tools-master","mavis-doctor","pdf","plugin-creator","pptx","skill-creator","skill-refiner","visual-page","x-link-reader","xlsx"],ep=["control-in-app-browser","resume-codex","mavis","create-agent","minimax-code-product","miniapp-creator"],lA=new Set(["modelConfigId","persona","tools","builtinTools","skills","features"]),cA=new Set(["enabled"]),Zs=new Set(["mavis","delegation","webSearch"]),tp=new Set(ta),zd=["task_query","task_output","task_stop"],np=new Set(na),ea=new Set(ia),ip=new Set(ep),uA=new Set(["plan-mode"]);function ra(e){let t=ur(e),n=ur(t?.default);return{default:n?dA(n):{}}}function fA(e,t="agent"){if(e===void 0)return{};let n=Qs(e,t);zs(n,lA,t);let i={};if(n.modelConfigId!==void 0&&((typeof n.modelConfigId!="string"||!n.modelConfigId.trim())&&ce(`${t}.modelConfigId`,"must be a non-empty string"),i.modelConfigId=n.modelConfigId.trim()),n.persona!==void 0){let r=Qs(n.persona,`${t}.persona`);zs(r,cA,`${t}.persona`),r.enabled!==void 0&&typeof r.enabled!="boolean"&&ce(`${t}.persona.enabled`,"must be a boolean"),i.persona={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{}}}if(n.tools!==void 0&&(Array.isArray(n.tools)||ce(`${t}.tools`,"must be an array"),i.tools=n.tools.map((r,o)=>((typeof r!="string"||!tp.has(r))&&ce(`${t}.tools[${o}]`,`must be one of ${ta.join(", ")}`),r))),n.builtinTools!==void 0&&(Array.isArray(n.builtinTools)||ce(`${t}.builtinTools`,"must be an array"),i.builtinTools=n.builtinTools.map((r,o)=>(r==="web_search"&&ce(`${t}.builtinTools[${o}]`,"web_search is feature-owned; use features.webSearch"),(typeof r!="string"||!np.has(r))&&ce(`${t}.builtinTools[${o}]`,`must be one of ${na.join(", ")}`),r))),n.skills!==void 0&&(Array.isArray(n.skills)||ce(`${t}.skills`,"must be an array"),i.skills=n.skills.map((r,o)=>{if(typeof r=="string"&&ip.has(r.trim())){let s=r.trim();ce(`${t}.skills[${o}]`,`${s} is capability-owned; use its owning Tool or feature switch`)}return(typeof r!="string"||!ea.has(r.trim()))&&ce(`${t}.skills[${o}]`,`must be one of ${ia.join(", ")}`),r.trim()})),n.features!==void 0){let r=Qs(n.features,`${t}.features`);zs(r,Zs,`${t}.features`);for(let o of Zs)r[o]!==void 0&&typeof r[o]!="boolean"&&ce(`${t}.features.${o}`,"must be a boolean");i.features={...typeof r.mavis=="boolean"?{mavis:r.mavis}:{},...typeof r.delegation=="boolean"?{delegation:r.delegation}:{},...typeof r.webSearch=="boolean"?{webSearch:r.webSearch}:{}}}return i}function dA(e){let t={};typeof e.modelConfigId=="string"&&e.modelConfigId.trim()&&(t.modelConfigId=e.modelConfigId.trim());let n=ur(e.persona);if(typeof n?.enabled=="boolean"&&(t.persona={enabled:n.enabled}),Zd(e.tools,tp)){let r=[...e.tools];zd.some(o=>r.includes(o))||r.push(...zd),t.tools=r}if(Zd(e.builtinTools,np)&&(t.builtinTools=[...e.builtinTools]),Array.isArray(e.skills)){let r=e.skills.map(o=>typeof o=="string"?o.trim():o);r.every(o=>typeof o=="string"&&(ea.has(o)||uA.has(o))&&!ip.has(o))&&(t.skills=r.filter(o=>typeof o=="string"&&ea.has(o)))}let i=ur(e.features);if(i){let r={};for(let o of Zs)typeof i[o]=="boolean"&&(r[o]=i[o]);Object.keys(r).length>0&&(t.features=r)}return t}function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function Zd(e,t){return Array.isArray(e)&&e.every(n=>typeof n=="string"&&t.has(n))}function pA(e={},t={}){return{persona:{enabled:t.persona?.enabled??e.persona?.enabled??!0},tools:Xs(t.tools??e.tools),builtinTools:Xs(t.builtinTools??e.builtinTools),skills:Xs(t.skills??e.skills),features:{mavis:t.features?.mavis??e.features?.mavis??!0,delegation:t.features?.delegation??e.features?.delegation??!0,webSearch:t.features?.webSearch??e.features?.webSearch??!0}}}function mA(e,t){return e.tools===void 0||e.tools.includes(t)}function hA(e,t){return e.builtinTools===void 0||e.builtinTools.includes(t)}function yA(e,t){return e.skills===void 0||e.skills.includes(t)}function Xs(e){return e===void 0?void 0:[...e]}function Qs(e,t){return(e==null||typeof e!="object"||Array.isArray(e))&&ce(t,"must be an object"),e}function zs(e,t,n){for(let i of Object.keys(e))t.has(i)||ce(`${n}.${i}`,"is not supported")}function ce(e,t){throw new Error(`Invalid configuration at ${e}: ${t}`)}var oa={enabled:!0};function rp(e,t=oa){let n=e.askUser;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled}}var Ge={enabled:!0,enabledSource:"default"};function sa(e,t=Ge){let n=e.dataContribution;if(n==null||typeof n!="object"||Array.isArray(n))return{...t,enabledSource:"default"};let i=n,r=typeof i.enabled=="boolean";return{enabled:r?i.enabled:t.enabled,enabledSource:r?"explicit":"default"}}function op(e){try{let t=e()?.dataContribution?.enabled;return typeof t=="boolean"?t:Ge.enabled}catch{return Ge.enabled}}var lp=["none","evaluator","subagent"],cp=["brief","transcript"],up=["same-route-small-fast"],fp="goal-verifier-readonly",dp=[fp],he={budget:{graceSteps:1},breaker:{repeatedReplyLimit:3},verifier:{repeatedNotMetLimit:5,evidence:"brief"},evaluator:{modelPolicy:"same-route-small-fast",maxTokens:32e3,timeoutSeconds:60,maxRetries:1}},aa={budget:{graceSteps:3},evaluator:{maxRetries:1}};function la(e){let t=[],n=Bt(e,"goal",t);qt(n,"goal",t,["objectiveMaxChars","verification","budget","breaker","verifier","evaluator","subagent"]);let i=Bt(n.budget,"goal.budget",t);qt(i,"goal.budget",t,["defaultTokens","defaultMainTurns","defaultActiveSeconds","graceSteps"]);let r=Bt(n.breaker,"goal.breaker",t);qt(r,"goal.breaker",t,["repeatedReplyLimit"]);let o=Bt(n.verifier,"goal.verifier",t);qt(o,"goal.verifier",t,["repeatedNotMetLimit","evidence"]);let s=Bt(n.evaluator,"goal.evaluator",t);qt(s,"goal.evaluator",t,["modelPolicy","maxTokens","timeoutSeconds","maxRetries"]);let a=Bt(n.subagent,"goal.subagent",t);qt(a,"goal.subagent",t,["profile","maxTurns","maxTokens","timeoutSeconds"]);let l=ap(n.verification,"goal.verification",lp,t),c=ut(n.objectiveMaxChars,"goal.objectiveMaxChars",t,{min:1}),u=ut(i.defaultTokens,"goal.budget.defaultTokens",t,{min:1}),f=ut(i.defaultMainTurns,"goal.budget.defaultMainTurns",t,{min:1}),d=ut(i.defaultActiveSeconds,"goal.budget.defaultActiveSeconds",t,{min:1}),p=ap(a.profile,"goal.subagent.profile",dp,t),y=ut(a.maxTurns,"goal.subagent.maxTurns",t,{min:1}),m=ut(a.maxTokens,"goal.subagent.maxTokens",t,{min:1}),h=ut(a.timeoutSeconds,"goal.subagent.timeoutSeconds",t,{min:1}),g={...p!==void 0?{profile:p}:{},...y!==void 0?{maxTurns:y}:{},...m!==void 0?{maxTokens:m}:{},...h!==void 0?{timeoutSeconds:h}:{}};return{config:{...c!==void 0?{objectiveMaxChars:c}:{},...l!==void 0?{verification:l}:{},budget:{...u!==void 0?{defaultTokens:u}:{},...f!==void 0?{defaultMainTurns:f}:{},...d!==void 0?{defaultActiveSeconds:d}:{},graceSteps:$t(i.graceSteps,"goal.budget.graceSteps",he.budget.graceSteps,t,{min:0,max:aa.budget.graceSteps})},breaker:{repeatedReplyLimit:$t(r.repeatedReplyLimit,"goal.breaker.repeatedReplyLimit",he.breaker.repeatedReplyLimit,t,{min:1})},verifier:{repeatedNotMetLimit:$t(o.repeatedNotMetLimit,"goal.verifier.repeatedNotMetLimit",he.verifier.repeatedNotMetLimit,t,{min:1}),evidence:sp(o.evidence,"goal.verifier.evidence",cp,he.verifier.evidence,t)},evaluator:{modelPolicy:sp(s.modelPolicy,"goal.evaluator.modelPolicy",up,he.evaluator.modelPolicy,t),maxTokens:$t(s.maxTokens,"goal.evaluator.maxTokens",he.evaluator.maxTokens,t,{min:1}),timeoutSeconds:$t(s.timeoutSeconds,"goal.evaluator.timeoutSeconds",he.evaluator.timeoutSeconds,t,{min:1}),maxRetries:$t(s.maxRetries,"goal.evaluator.maxRetries",he.evaluator.maxRetries,t,{min:0,max:aa.evaluator.maxRetries})},...Object.keys(g).length>0?{subagent:g}:{}},warnings:t}}function Bt(e,t,n){return e===void 0?{}:e===null||typeof e!="object"||Array.isArray(e)?(n.push(We(t,"expected an object; using defaults")),{}):e}function qt(e,t,n,i){for(let r of Object.keys(e))i.includes(r)||n.push(We(`${t}.${r}`,"unknown key ignored"))}function $t(e,t,n,i,r){return e==null?n:!Number.isInteger(e)||e<r.min?(i.push(We(t,`expected an integer >= ${r.min}; using default`)),n):r.max!=null&&e>r.max?(i.push(We(t,`exceeds maximum ${r.max}; clamped`)),r.max):e}function ut(e,t,n,i){if(e!=null){if(!Number.isInteger(e)||e<i.min){n.push(We(t,`expected an integer >= ${i.min}; ignored`));return}return i.max!=null&&e>i.max?(n.push(We(t,`exceeds maximum ${i.max}; clamped`)),i.max):e}}function sp(e,t,n,i,r){return e==null?i:typeof e!="string"||!n.includes(e)?(r.push(We(t,`expected one of: ${n.join(", ")}; using default`)),i):e}function ap(e,t,n,i){if(e!=null){if(typeof e!="string"||!n.includes(e)){i.push(We(t,`expected one of: ${n.join(", ")}; ignored`));return}return e}}function We(e,t){return`Invalid goal config at ${e}: ${t}`}var Ae={enabled:!0,maxInlineKiB:64,mcpDetailsMaxInlineKiB:32,watermarkKiB:256,minSavingsKiB:256,minCandidateKiB:2,keepRecentRounds:5},gA=Math.floor(Number.MAX_SAFE_INTEGER/1024);function ca(e){let t=SA(e)?e:{};return{enabled:typeof t.enabled=="boolean"?t.enabled:Ae.enabled,maxInlineKiB:Mn(t.maxInlineKiB,Ae.maxInlineKiB),mcpDetailsMaxInlineKiB:Mn(t.mcpDetailsMaxInlineKiB,Ae.mcpDetailsMaxInlineKiB),watermarkKiB:Mn(t.watermarkKiB,Ae.watermarkKiB),minSavingsKiB:Mn(t.minSavingsKiB,Ae.minSavingsKiB),minCandidateKiB:Mn(t.minCandidateKiB,Ae.minCandidateKiB),keepRecentRounds:bA(t.keepRecentRounds,Ae.keepRecentRounds)}}function Mn(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0&&e<=gA?e:t}function bA(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function SA(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nn={};function ua(e){if(e==null||typeof e!="object"||Array.isArray(e))return{...Nn};let t=Reflect.get(e,"chromePath");return typeof t!="string"||!t.trim()?{...Nn}:{chromePath:t.trim()}}import{isIP as vA}from"node:net";function pp(e){return{enabled:!1,filesystemMode:"full_access"}}function mp(e){return!e.enabled||e.filesystemMode==="full_access"?{enabled:!1,filesystemMode:"full_access"}:{...e}}function da(e){let t=pp(e);return{enabled:t.enabled,filesystem:{policy:{mode:t.filesystemMode},denyRead:[],denyWrite:[]},network:{policy:{mode:"allow_all"},deniedDomains:[]},localAccess:"open"}}var pa=da(process.platform),AA=new Set(["read_only","workspace_write","delete_guard","full_access"]),wA=new Set(["deny","allow_all"]);function ma(e,t=process.platform){let n=da(t);if(e===void 0)return n;let i=Pn(e,"sandbox",["enabled","filesystem","network","localAccess"]),r=i.filesystem===void 0?{}:Pn(i.filesystem,"sandbox.filesystem",["policy","denyRead","denyWrite","allowGitConfig"]),o=r.policy===void 0?{}:Pn(r.policy,"sandbox.filesystem.policy",["mode"]),s=i.network===void 0?{}:Pn(i.network,"sandbox.network",["policy","deniedDomains"]),a=s.policy===void 0?{}:Pn(s.policy,"sandbox.network.policy",["mode"]),l=i.enabled===void 0?n.enabled:_A(i.enabled,"sandbox.enabled"),c=o.mode??(l?"delete_guard":"full_access");if(typeof c!="string"||!AA.has(c))throw new Error(`Invalid sandbox.filesystem.policy.mode "${String(c)}"`);let u=a.mode??n.network.policy.mode;if(typeof u!="string"||!wA.has(u))throw new Error(`Invalid sandbox.network.policy.mode "${String(u)}"`);let f=s.deniedDomains===void 0?[...n.network.deniedDomains]:fa(s.deniedDomains,"sandbox.network.deniedDomains");for(let p of f)EA(p);let d=mp({enabled:l,filesystemMode:c});return{enabled:d.enabled,filesystem:{policy:{mode:d.filesystemMode},denyRead:r.denyRead===void 0?[...n.filesystem.denyRead]:fa(r.denyRead,"sandbox.filesystem.denyRead"),denyWrite:r.denyWrite===void 0?[...n.filesystem.denyWrite]:fa(r.denyWrite,"sandbox.filesystem.denyWrite")},network:{policy:{mode:"allow_all"},deniedDomains:[]},localAccess:i.localAccess===void 0?n.localAccess:i.localAccess==="open"||i.localAccess==="restricted"?i.localAccess:(()=>{throw new Error(`Invalid sandbox.localAccess "${String(i.localAccess)}"`)})()}}function Pn(e,t,n){if(e==null||typeof e!="object"||Array.isArray(e))throw new Error(`Invalid ${t}: expected object`);let i=e,r=Object.keys(i).find(o=>!n.includes(o));if(r)throw new Error(`Unknown ${t}.${r}`);return i}function _A(e,t){if(typeof e!="boolean")throw new Error(`Invalid ${t}: expected boolean`);return e}function fa(e,t){if(!Array.isArray(e)||e.some(n=>typeof n!="string"))throw new Error(`Invalid ${t}: expected string array`);return[...e]}function EA(e){let t=()=>{throw new Error(`Invalid sandbox.network.deniedDomains entry "${e}"`)},n=e.match(/^\[([^\]]+)\](?::(.+))?$/);if(n){vA(n[1]??"")!==6&&t(),hp(n[2],e);return}(e.match(/:/g)??[]).length>1&&t();let i=e.lastIndexOf(":"),r=i>-1?e.slice(0,i):e,o=i>-1?e.slice(i+1):void 0;hp(o,e),r!=="*"&&(xA(r)||t())}function xA(e){if(e.includes("://")||e.includes("/")||e.includes(":"))return!1;if(e==="localhost")return!0;if(e.startsWith("*.")){let n=e.slice(2).split(".");return n.length>=2&&n.every(i=>i.length>0)}return e.includes("*")?!1:e.includes(".")&&!e.startsWith(".")&&!e.endsWith(".")}function hp(e,t){if(e===void 0)return;let n=Number(e);if(!/^[1-9][0-9]{0,4}$/.test(e)||!Number.isInteger(n)||n>65535)throw new Error(`Invalid sandbox.network.deniedDomains entry "${t}"`)}var fr={maxConcurrentPerSession:4};function ha(e){let n=(e!=null&&typeof e=="object"&&!Array.isArray(e)?e:{}).maxConcurrentPerSession;return{maxConcurrentPerSession:typeof n=="number"&&Number.isSafeInteger(n)&&n>0?n:fr.maxConcurrentPerSession}}function yp(e,t){return t.length===0?!1:t.includes("*")?!0:t.includes(e)}function TA(){return process.env.__MAVIS_ALLOW_LEGACY_RUNTIME_ENV==="1"}var gp={dev:"test",test:"test",staging:"staging",prod:"prod"};function IA(e){return e==="cn"||e==="en"}function _p(e){return e==="test"||e==="prod"||e==="dev"||e==="staging"}function Ep(){let e=process.env.MAVIS_REGION;if(IA(e))return e;if(pr()){let t=process.env.NEXT_PUBLIC_LOCALE;if(t==="zh")return"cn";if(t==="en")return"en"}return"en"}function Te(){let e=process.env.MAVIS_BUILD_ENV;if(_p(e))return e;if(pr()){let t=process.env.NEXT_PUBLIC_BUILD_ENV,n=t&&Object.prototype.hasOwnProperty.call(gp,t)?gp[t]:void 0;if(n)return n}return"dev"}function dr(){if(kp("managed"))return!0;let e=process.env.__MAVIS_RUNTIME_MANAGED;return e==="1"?!0:e==="0"?!1:!!(pr()||Te()==="prod"||Te()==="staging")}function pr(){let e=process.versions;return process.env.ELECTRON_RUN_AS_NODE==="1"||typeof e.electron=="string"}function mr(){return`${Ep()}-${Te()}`}var Ce={none:0,test:1,internal:2,online:3},LA={internal:"internal",inside:"online"};function MA(e){for(let[t,n]of Object.entries(e)){if(Ce[n.defaultVisibility]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultVisibility (${n.defaultVisibility}) must not exceed configurableVisibility (${n.configurableVisibility})`);for(let i of n.defaultBuildVariants??[]){let r=LA[i];if(Ce[r]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultBuildVariant (${i}) must not exceed configurableVisibility (${n.configurableVisibility})`)}for(let i of n.defaultBuildEnvironments??[])if(Ce[i==="prod"?"online":"test"]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultBuildEnvironment (${i}) must not exceed configurableVisibility (${n.configurableVisibility})`)}}var Dn={autoMemory:{defaultVisibility:"online",configurableVisibility:"online"},skillEvolve:{defaultVisibility:"test",configurableVisibility:"online"},skillEvolveBuiltinMr:{defaultVisibility:"none",configurableVisibility:"test"},skillProposal:{defaultVisibility:"test",configurableVisibility:"online"},browserBridge:{defaultVisibility:"test",configurableVisibility:"online"},filePanelBrowser:{defaultVisibility:"online",configurableVisibility:"online"},filePanelBrowserMultiTab:{defaultVisibility:"online",configurableVisibility:"online"},browserUseTooling:{defaultVisibility:"online",configurableVisibility:"online"},browserUseAutoOpenPanel:{defaultVisibility:"online",configurableVisibility:"online"},browserAgentCursor:{defaultVisibility:"online",configurableVisibility:"online"},desktopPlanMode:{defaultVisibility:"online",configurableVisibility:"online"},desktopPlanModeAgentEntry:{defaultVisibility:"none",configurableVisibility:"online"},peek:{defaultVisibility:"test",configurableVisibility:"test"},keepAlive:{defaultVisibility:"test",configurableVisibility:"test"},promptOverride:{defaultVisibility:"test",configurableVisibility:"test"},asr:{defaultVisibility:"online",configurableVisibility:"online"},taskHistoryProjectGrouping:{defaultVisibility:"online",configurableVisibility:"online"},threadGoal:{defaultVisibility:"online",configurableVisibility:"online"},mcodeTools:{defaultVisibility:"none",defaultBuildEnvironments:["dev","test","staging","prod"],defaultPlatforms:["darwin","linux","win32"],configurableVisibility:"online"},codexOAuth:{defaultVisibility:"none",defaultBuildEnvironments:["dev"],defaultBuildVariants:["internal"],configurableVisibility:"online"}};MA(Dn);function NA(e){return(e.buildEnv??Te())!=="prod"?"test":e.internalBuild===!0?"internal":"online"}function PA(e,t){let n=e.defaultBuildVariants;return n?t.internalBuild===!0&&n.includes("internal")||t.insideBuild===!0&&n.includes("inside"):!1}function RA(e,t){let n=t.defaultBuildEnvironment??t.buildEnv??Sa();return e.defaultBuildEnvironments?.includes(n)===!0}function Sa(){let e=pr()?process.env.NEXT_PUBLIC_BUILD_ENV:void 0;return _p(e)?e:Te()}function bp(e,t){return e.defaultPlatforms?.includes(t.platform??process.platform)!==!1}function va(e,t,n={}){let i=Dn[e],r=Ce[NA(n)],o=n.defaultBuildEnvironment??n.buildEnv??Sa();return e==="mcodeTools"&&o==="dev"&&n.mcodeToolsDevMode==="published"&&bp(i,n)?!0:t===!1?!1:t===!0?r<=Ce[i.configurableVisibility]:bp(i,n)?RA(i,n)||PA(i,n)?!0:r<=Ce[i.defaultVisibility]:!1}function DA(e){return Dn[e].configurableVisibility==="online"}function Aa(e=process.env){return e.__MAVIS_BUILD_INTERNAL==="true"}function FA(e=process.env){return e.__MAVIS_BUILD_INSIDE==="true"}var BA={APP_DIR:".minimax",ENV_PREFIX:"minimax",CLI_NAME:"minimax"},xp="__MAVIS_RUNTIME";function hr(e){return TA()?process.env[`${xp}_${e}`]:void 0}function yr(e){let t=`--${e}`;for(let n=2;n<process.argv.length;n++){let i=process.argv[n];if(i===t)return process.argv[n+1];if(i?.startsWith(`${t}=`))return i.slice(t.length+1)}}function kp(e){let t=`--${e}`;return process.argv.slice(2).some(n=>n===t||n.startsWith(`${t}=`))}var jt=5321,ga=5001,ya=65535,Cp=500,wa=2,qA=Cp*wa,Op=qA+wa,Sp=1,$A=new Set(["agent-archon","mavis"]),vp=(()=>{let t=new Uint32Array(256);for(let n=0;n<256;n++){let i=n<<24;for(let r=0;r<8;r++)i=(i&2147483648)!==0?79764919^i<<1:i<<1,i>>>=0;t[n]=i>>>0}return t})();function jA(e){let t=Buffer.from(`${e}
191
- `,"utf-8"),n=0;for(let r of t)n=(vp[(n>>>24^r)&255]^n<<8)>>>0;let i=t.length;for(;i!==0;)n=(vp[(n>>>24^i&255)&255]^n<<8)>>>0,i>>>=8;return(n^4294967295)>>>0}function UA(e){return jA(e)%Cp*wa+2}function Ap(e,t){try{let n=CA("git",e,{encoding:"utf-8",timeout:3e3,stdio:["ignore","pipe","pipe"],...t?{cwd:t}:{}});return n.status===0&&n.stdout?n.stdout.trim():null}catch{return null}}function KA(e){return e.match(/[/:]([^/:]+?)(?:\.git)?$/)?.[1]??null}function Tp(){return process.env.MINIMAX_DATA_DIR?.trim()||process.env.MAVIS_DATA_DIR?.trim()}function gr(){return!(kp("disable-git-auto-config")||hr("DISABLE_GIT_AUTO_CONFIG")||yr("data-dir")||Tp())}function br(){let e=yr("profile")??hr("PROFILE");return e&&e.length>0?e:null}function Ip(){let e=yr("port")??hr("PORT"),t=e?parseInt(e,10):NaN;return Number.isNaN(t)?null:t}function ba(){let e=yr("data-dir")??Tp()??hr("DATA_DIR");return e&&e.length>0?e:null}function VA(){return!!(br()&&ba())}function Lp(){return!!(br()&&Ip()!==null)}var ft=null;function YA(){ft=null}function dt(){if(ft!==null)return ft;let e={runtimePort:jt,uiPort:ga,profile:null,autoDetected:!1};return ft=e,e}function GA(){try{if(typeof __dirname=="string")return __dirname}catch{}let e=new Error().stack??"";for(let t of e.split(`
192
- `)){let n=/file:\/\/[^)\s]+/u.exec(t)?.[0]?.replace(/:\d+:\d+$/u,"");if(n)try{return oe.dirname(OA(n))}catch{}let i=/\(?((?:\/|[A-Za-z]:\\)[^()]+?\.(?:cjs|mjs|js|ts)):\d+:\d+\)?/u.exec(t)?.[1];if(i)return oe.dirname(i)}}function WA(){let e=br();return e||(gr()?dt().profile:null)}function _a(){let e=br();if(VA())return ba();if(gr()){let n=dt();if(n.autoDetected&&n.profile)return Ye({profile:n.profile})}let t=ba();return t||(e?Ye({profile:e}):Ye())}function Ut(){return oe.join(_a(),"config.yaml")}var HA={support_files_api:!0,files_api_upload_endpoint:"/v1/files/upload",max_image_bytes_inline:10485760,max_video_bytes_inline:52428800,max_request_body_bytes:67108864,max_attachments_count:4},Mp={"MiniMax-M3":{name:"MiniMax-M3",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text","image","video"],output:["text"]},limit:{context:512e3,output:128e3},contextWindowOptions:[512e3,1e6],contextWindowOptionHints:{1e6:"higher_usage"},options:{reasoningSummary:"auto"},thinking_config:{mode:"switchable",default_value:"true"},variants:{"none-thinking":{thinking:{type:"disabled"}},thinking:{thinking:{type:"adaptive"}}},capabilities:HA},"MiniMax-M2.7-highspeed":{name:"MiniMax-M2.7-highspeed",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text"],output:["text"]},limit:{context:2e5,output:128e3}},"MiniMax-M2.7":{name:"MiniMax-M2.7",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text"],output:["text"]},limit:{context:2e5,output:128e3}}},Kt=Mp,Sr={"cn-test":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","cn-dev":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","cn-staging":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","en-test":"https://agent.minimax.io/mavis/api/v1/llm/v1","en-dev":"https://agent.minimax.io/mavis/api/v1/llm/v1","en-staging":"https://agent.minimax.io/mavis/api/v1/llm/v1","cn-prod":"https://agent.minimax.cn/mavis/api/v1/llm/v1","en-prod":"https://agent.minimax.io/mavis/api/v1/llm/v1"},Np=["https://agent.minimaxi.com/mavis/api/v1/llm/v1"],JA=new Set([...Object.values(Sr),...Np]),XA=new Set([...Object.values(Sr),...Np].map(e=>new URL(e).origin));function Pp(e){if(JA.has(e))return!0;try{let t=new URL(e);return!t.username&&!t.password&&XA.has(t.origin)}catch{return!1}}function Rp(){return Te()==="test"}function QA(){return!Rp()}function zA(e){if(!dr()||!Oe.existsSync(e))return;let t=Dp(e),{provider:n}=t;if(n==null||typeof n!="object"||Array.isArray(n))return;let{minimax:i}=n;if(i==null||typeof i!="object"||Array.isArray(i))return;let{options:r}=i;if(r==null||typeof r!="object"||Array.isArray(r))return;let o=r.baseURL;if(typeof o!="string")return;let s=Sr[mr()];if(o===s||!Pp(o))return;let a=Oe.readFileSync(e);r.baseURL=s;try{let l=a.toString("utf-8");it(e,Ln(l,er(l),t))}catch(l){let c=!1;try{c=Oe.readFileSync(e).equals(a)}catch{}if(!c)throw l;console.warn("[config] managed preset baseURL sync skipped; config file unchanged, using runtime provider settings")}}function He(e){return{provider:{minimax:{name:"MiniMax",npm:"@ai-sdk/anthropic",options:{authMode:"managed-login",apiKey:"sk-xxx",baseURL:Sr[e]},models:Mp}},defaultModel:"minimax/MiniMax-M3"}}var Ea={"cn-test":He("cn-test"),"cn-dev":He("cn-dev"),"cn-staging":He("cn-staging"),"cn-prod":He("cn-prod"),"en-test":He("en-test"),"en-dev":He("en-dev"),"en-staging":He("en-staging"),"en-prod":He("en-prod")},J={logLevel:"info",devPort:ga,permissionMode:"auto",sseErrorPush:{history:!0,stream:!0},beta:Object.fromEntries(Object.keys(Dn).map(e=>[e,va(e,void 0,{buildEnv:"dev"})])),agents:{default:{}},memory:{enabled:!0,proactive:!1,dailyDigest:{enabled:!1},v2:{...tr}},subagent:{...fr},skillEvolve:{enabled:!0,inSession:{N:20,minIntervalSeconds:30,maxPendingPerSession:1},signalCooldownHours:24,minConfidence:.7,excludeAgents:["skill-editor"],disableModelPrefixes:["MiniMax-M2"],builtinMrEnabled:!1,sourceRepo:void 0,proposal:{enabled:!1,eligibleAgents:["mavis"],minMessageCount:40,skipPassiveSessionEnd:!0},lifecycle:{staleThresholdDays:15,archiveThresholdDays:30}},sessionRotate:{enabled:!0,activeSessionLookbackHours:12},agentStop:{debounceMs:500,maxActiveSpanMs:1800*1e3},asr:{...sr},skills:lr,askUser:{...oa},dataContribution:{...Ge},sessionTitle:{enabled:!0},cli:{spawn:{enabled:!1}},browser:{...Nn},tui:{},opencode:{xdg:{dataIsolation:!1,startupImport:"off"},keepAlive:{enabled:!1,maxProcesses:5,maxLifetimeMs:288e5,agents:["mavis","main","verifier","code-reviewer"]},spawnConcurrency:3},contextManagement:{disableSystemReminderModels:[],cuMaxScreenshotsInContext:2},runawayGuard:{enabled:!0},toolResultCompaction:{...Ae},agentRuntime:{defaultFramework:Dt},logRetentionDays:3,review:{mode:"subagent",turnDiffCard:"concise",modeSource:"default"},goal:structuredClone(he),sandbox:structuredClone(pa),goalWarnings:[]};function ZA(){let e=Ut(),t=oe.dirname(e);if(Oe.existsSync(t)||Oe.mkdirSync(t,{recursive:!0}),Oe.existsSync(e)){ka(e);return}if(!dr()){let r=Ye({homeDir:kA.homedir()}),o=oe.join(r,"config.yaml");e!==o&&Oe.existsSync(o)&&(_t(o),it(e,Oe.readFileSync(o),!0));return}let n=Ea[mr()],i=W.dump({logLevel:J.logLevel,provider:xa?n.provider:void 0,defaultModel:n.defaultModel,dataContribution:{enabled:Ge.enabled},memory:{enabled:!1}});it(e,i,!0)}function Dp(e=Ut()){return er(ew(e))}function ew(e=Ut()){try{return Oe.readFileSync(e,"utf-8")}catch{return""}}var Rn=null;function tw(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e;return{branchFinish:typeof t.branchFinish=="boolean"?t.branchFinish:!1}}var Fp={isManagedRuntime:dr,shouldEnforceManagedProviderProtection:QA,getManagedPreset:()=>Ea[mr()],isManagedPresetBaseUrl:Pp},Bp=!0,xa=!0;function nw(e){Bp=e}function iw(e){xa=e}function ka(e){_t(e),Nd(e),Bp&&Ld(e,Fp),xa&&zA(e)}function vr(){Rn=null}function Ar(){if(Rn)return Rn;ZA();let e=Dp();return Rn=Ca(e,_a()),Rn}function Ca(e,t){let n=e.sseErrorPush,i=n!=null&&typeof n=="object"&&!Array.isArray(n)?n:void 0,r=typeof e.devPort=="number"?e.devPort:J.devPort;if(gr()&&!Lp()){let c=dt();c.autoDetected&&(r=c.uiPort)}let o=la(e.goal),s=Md({provider:e.provider!=null&&typeof e.provider=="object"&&!Array.isArray(e.provider)?Cd(e.provider):{},defaultModel:typeof e.defaultModel=="string"?e.defaultModel:void 0},Fp),a=js(e.minimaxModelContextLimits),l=rw(e);return{logLevel:typeof e.logLevel=="string"?e.logLevel:J.logLevel,devPort:r,...s,provider:xd(s.provider,a),defaultModelVariant:typeof e.defaultModelVariant=="string"?e.defaultModelVariant:void 0,defaultModelThinking:e.defaultModelThinking&&typeof e.defaultModelThinking=="object"&&typeof e.defaultModelThinking.effort=="string"?{effort:e.defaultModelThinking.effort}:void 0,defaultModelContextWindow:Number.isSafeInteger(e.defaultModelContextWindow)&&Number(e.defaultModelContextWindow)>0&&Number(e.defaultModelContextWindow)<=2147483647?Number(e.defaultModelContextWindow):void 0,minimax_api:Ed(e.minimax_api),minimaxModelContextLimits:a,custom_provider:kd(e.custom_provider),minimaxModelSource:typeof e.minimaxModelSource=="string"&&(e.minimaxModelSource==="token_plan"||e.minimaxModelSource==="minimax_api_key")?e.minimaxModelSource:void 0,nexus:e.nexus!=null&&typeof e.nexus=="object"&&!Array.isArray(e.nexus)?(()=>{let c={};typeof Reflect.get(e.nexus,"enabled")=="boolean"&&(c.enabled=Reflect.get(e.nexus,"enabled"));let u=Reflect.get(e.nexus,"model");return u!=null&&typeof u=="object"&&!Array.isArray(u)&&typeof Reflect.get(u,"providerID")=="string"&&typeof Reflect.get(u,"modelID")=="string"&&(c.model={providerID:Reflect.get(u,"providerID"),modelID:Reflect.get(u,"modelID"),...typeof Reflect.get(u,"variant")=="string"?{variant:Reflect.get(u,"variant")}:{}}),Object.keys(c).length>0?c:void 0})():void 0,defaultLightModel:typeof e.defaultLightModel=="string"?e.defaultLightModel:void 0,permissionMode:typeof e.permissionMode=="string"&&["default","bypassPermissions","auto","off"].includes(e.permissionMode)?e.permissionMode:J.permissionMode,permission:Bd(e),sseErrorPush:{history:typeof i?.history=="boolean"?i.history:J.sseErrorPush.history,stream:typeof i?.stream=="boolean"?i.stream:J.sseErrorPush.stream},notifications:tw(e.notifications),dataDir:t,agentsDir:oe.join(t,"agents"),sessionsDir:oe.join(t,"sessions"),memoryDir:oe.join(t,"memory"),skillsDir:oe.join(t,"skills"),builtinSkillsDir:oe.join(t,".builtin-skills"),logsDir:oe.join(t,"logs"),pluginsDir:oe.join(t,"plugins"),plansDir:oe.join(t,"plans"),harnessesDir:oe.join(t,"harnesses"),subAgentsDir:oe.join(t,"subagents"),beta:l,agents:ra(e.agents),memory:vd(e,J.memory),subagent:ha(e.subagent),skillEvolve:aw(e,l),sessionRotate:lw(e),agentStop:cw(e),asr:Fd(e),skills:Us(e),askUser:rp(e,J.askUser),dataContribution:sa(e,J.dataContribution),sessionTitle:uw(e),cli:fw(e),browser:ua(e.browser),tui:Ad(e),opencode:Rd(e,J.opencode),contextManagement:dw(e),runawayGuard:no(e.runawayGuard),toolResultCompaction:ca(e.toolResultCompaction),agentRuntime:Ks(e.agentRuntime),logRetentionDays:pw(e),contentReview:mw(e),mcpToolSearch:hw(e),review:Pd(e.review,J.review),promptConfig:qp(e.promptConfig),goal:o.config,goalWarnings:o.warnings,sandbox:ma(e.sandbox)}}function rw(e){let t=e.beta!=null&&typeof e.beta=="object"&&!Array.isArray(e.beta)?e.beta:{},n={buildEnv:Te(),defaultBuildEnvironment:Sa(),internalBuild:Aa(),insideBuild:FA(),mcodeToolsDevMode:process.env.MAVIS_DEV_MCODE_TOOLS_MODE==="published"?"published":void 0},i={};for(let r of Object.keys(Dn))i[r]=va(r,t[r],n);return i}function ow(e){let t=e.provider;if(t==null||typeof t!="object"||Array.isArray(t))return[];let n=[];for(let i of Object.values(t)){if(i==null||typeof i!="object"||Array.isArray(i))continue;let{models:r}=i;r==null||typeof r!="object"||Array.isArray(r)||n.push(...Object.keys(r))}return n}function sw(e,t){if(t.length===0)return!0;let n=ow(e);if(n.length===0)return!1;let i=t.map(r=>r.toLowerCase());return!n.every(r=>i.some(o=>r.toLowerCase().startsWith(o)))}function wp(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}function aw(e,t){let n=J.skillEvolve,i=e.skillEvolve,o=i!=null&&typeof i=="object"&&!Array.isArray(i)?i:{},s=o.inSession,{inSession:a}=n;if(s!=null&&typeof s=="object"&&!Array.isArray(s)){let E=s;a={N:typeof E.N=="number"&&E.N>0?E.N:n.inSession.N,minIntervalSeconds:typeof E.minIntervalSeconds=="number"&&E.minIntervalSeconds>=0?E.minIntervalSeconds:n.inSession.minIntervalSeconds,maxPendingPerSession:typeof E.maxPendingPerSession=="number"&&E.maxPendingPerSession>=1?E.maxPendingPerSession:n.inSession.maxPendingPerSession}}let l=o.excludeAgents,c=Array.isArray(l)&&l.every(E=>typeof E=="string")?l:n.excludeAgents,u=Array.isArray(o.disableModelPrefixes)&&o.disableModelPrefixes.every(E=>typeof E=="string")?o.disableModelPrefixes:n.disableModelPrefixes,f=t.skillEvolve?typeof o.enabled=="boolean"?o.enabled:sw(e,u):!1,d=f&&t.skillEvolveBuiltinMr?typeof o.builtinMrEnabled=="boolean"?o.builtinMrEnabled:n.builtinMrEnabled:!1,p=o.sourceRepo,y=typeof p=="string"&&p.trim().length>0?p.trim():n.sourceRepo,m=o.proposal,h=n.proposal,g=m!=null&&typeof m=="object"&&!Array.isArray(m)?m:{},b=Array.isArray(g.eligibleAgents)&&g.eligibleAgents.every(E=>typeof E=="string")?g.eligibleAgents:h.eligibleAgents,v=typeof g.minMessageCount=="number"&&g.minMessageCount>=1?Math.floor(g.minMessageCount):h.minMessageCount,x=typeof g.skipPassiveSessionEnd=="boolean"?g.skipPassiveSessionEnd:h.skipPassiveSessionEnd,k=typeof g.enabled=="boolean"?g.enabled:null,C=f&&t.skillProposal?k??!0:!1,L=o.lifecycle,w=L&&typeof L=="object"&&!Array.isArray(L)?L:{},A=wp(w.staleThresholdDays,n.lifecycle.staleThresholdDays),O=wp(w.archiveThresholdDays,n.lifecycle.archiveThresholdDays);if(!(A<O))throw new Error(`Invalid skillEvolve.lifecycle config: staleThresholdDays (${A}) must be strictly less than archiveThresholdDays (${O}).`);return{enabled:f,inSession:a,signalCooldownHours:typeof o.signalCooldownHours=="number"&&o.signalCooldownHours>0?o.signalCooldownHours:n.signalCooldownHours,minConfidence:typeof o.minConfidence=="number"&&o.minConfidence>=0&&o.minConfidence<=1?o.minConfidence:n.minConfidence,scannerModel:typeof o.scannerModel=="string"?o.scannerModel:void 0,excludeAgents:c,disableModelPrefixes:u,builtinMrEnabled:d,sourceRepo:y,proposal:{enabled:C,eligibleAgents:b,minMessageCount:v,skipPassiveSessionEnd:x},lifecycle:{staleThresholdDays:A,archiveThresholdDays:O}}}function lw(e){let t=J.sessionRotate,n=e.sessionRotate;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.activeSessionLookbackHours;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,activeSessionLookbackHours:typeof r=="number"&&Number.isFinite(r)&&r>0?r:t.activeSessionLookbackHours}}function cw(e){let t=J.agentStop,n=e.agentStop;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.debounceMs,o=i.maxActiveSpanMs;return{debounceMs:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:t.debounceMs,maxActiveSpanMs:typeof o=="number"&&Number.isFinite(o)&&o>=0?o:t.maxActiveSpanMs}}function qp(e){let t=Te()==="prod"&&!Aa();if(e==null||typeof e!="object"||Array.isArray(e))return{autoUpdate:t};let n=e.autoUpdate;return{autoUpdate:typeof n=="boolean"?n:t}}function uw(e){let t=J.sessionTitle,n=e.sessionTitle;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled}}function fw(e){let t=J.cli,n=e.cli;if(n==null||typeof n!="object"||Array.isArray(n))return{spawn:{...t.spawn}};let i=n.spawn;if(i==null||typeof i!="object"||Array.isArray(i))return{spawn:{...t.spawn}};let r=i;return{spawn:{enabled:typeof r.enabled=="boolean"?r.enabled:t.spawn.enabled}}}function dw(e){let t=J.contextManagement,n=e.contextManagement;if(n==null||typeof n!="object"||Array.isArray(n))return{disableSystemReminderModels:[...t.disableSystemReminderModels],cuMaxScreenshotsInContext:t.cuMaxScreenshotsInContext};let i=n,r=i.disableSystemReminderModels,o=Array.isArray(r)&&r.every(l=>typeof l=="string"&&l.length>0)?r:[...t.disableSystemReminderModels],s=i.cuMaxScreenshotsInContext,a=typeof s=="number"&&Number.isFinite(s)&&s>=0?Math.floor(s):t.cuMaxScreenshotsInContext;return{disableSystemReminderModels:o,cuMaxScreenshotsInContext:a}}function pw(e){let t=e.logRetentionDays;return typeof t=="number"&&t>=1&&Number.isFinite(t)?Math.floor(t):J.logRetentionDays}function mw(e){let t=e.contentReview;if(t==null||typeof t!="object"||Array.isArray(t))return;let n={},i=Reflect.get(t,"enabled");typeof i=="boolean"&&(n.enabled=i);let r=Reflect.get(t,"testBaseURL");return typeof r=="string"&&r.trim()&&(n.testBaseURL=r.trim()),Object.keys(n).length>0?n:void 0}function hw(e){let t=e.mcpToolSearch;if(t==null||typeof t!="object"||Array.isArray(t))return;let n={},i=Reflect.get(t,"enabled");typeof i=="boolean"&&(n.enabled=i);let r=Reflect.get(t,"systemHint");typeof r=="boolean"&&(n.systemHint=r);let o=Reflect.get(t,"thresholdPct");typeof o=="number"&&(n.thresholdPct=o);let s=Reflect.get(t,"minDeferCount");typeof s=="number"&&(n.minDeferCount=s);let a=Reflect.get(t,"topKDefault");typeof a=="number"&&(n.topKDefault=a);let l=Reflect.get(t,"topKMax");typeof l=="number"&&(n.topKMax=l);let c=Reflect.get(t,"maxSchemaTextLen");typeof c=="number"&&(n.maxSchemaTextLen=c);let u=Reflect.get(t,"modelWhitelist");return Array.isArray(u)&&(n.modelWhitelist=u.filter(f=>typeof f=="string")),Object.keys(n).length>0?n:void 0}function $p(){let e=Ip();if(gr()&&!Lp()){let t=dt();if(t.autoDetected)return t.runtimePort}return e??jt}function yw(e=$p()){let t=e+Op;if(t<=ya)return t;let n=e+Sp;if(n<=ya)return n;throw new Error(`Cannot allocate an OpenCode sidecar port for runtime port ${String(e)}; choose a runtime port <= ${String(ya-Sp)}.`)}var gw=["agent.minimaxi.com","agent.minimaxi.com","agent.minimax.io","agent.minimax.io","agent.minimax.io","agent.minimax.cn","agent.minimaxi.com"],bw=new Set(gw.map(e=>`https://${e}`));function Sw(e,t){return/^custom_provider:minimax-legacy(?:-\d+)?$/u.test(e)&&(!t||Oa(t))}function Oa(e){try{let t=new URL(e);return t.username||t.password?!1:bw.has(t.origin.toLowerCase())}catch{return!1}}function vw(e){if(!(e!=="managed-login"&&e!=="api-key"&&e!=="oauth"))return e}function Ta(e){let t=typeof e?.baseURL=="string"?e.baseURL.trim():"",n=t.length>0&&Oa(t),i=vw(e?.authMode),r=[];return typeof e?.authMode=="string"&&!i&&r.push(`Unknown provider authMode "${e.authMode}"; falling back to compatibility resolution.`),i?(i==="managed-login"&&t.length>0&&!n&&!e?.allowManagedBaseURLOverride&&r.push("Provider authMode is managed-login but baseURL is not a known managed MiniMax host."),{authMode:i,source:"explicit",managedBaseURL:n,warnings:r}):n?(r.push("Provider authMode is inferred from a managed MiniMax baseURL; set options.authMode: managed-login to make this explicit."),{authMode:"managed-login",source:"inferred-managed-base-url",managedBaseURL:n,warnings:r}):{authMode:"api-key",source:"default-api-key",managedBaseURL:n,warnings:r}}var Je="minimax",Vt="minimax_api",La="custom_provider:";function Aw(e,t){return e==="anthropic-messages"&&(t===Je||t===Vt)}function Ma(e,t){if(t===Vt)return"minimax_api_key";if(t.startsWith(La))return"custom_provider";if(t!==Je)return"configured_provider";if(e.minimaxModelSource==="minimax_api_key")return"minimax_api_key";let n=e.provider?.[t]?.options;return Ta({authMode:n?.authMode,baseURL:n?.baseURL}).authMode==="managed-login"?"managed_token_plan":"configured_provider"}function jp(e,t,n){switch(Ma(e,t)){case"managed_token_plan":return Ia(e.provider?.[t],!0);case"minimax_api_key":return Object.keys(Kt);case"custom_provider":{let r=e.custom_provider?.[t.slice(La.length)];return!r||r.enabled===!1?[]:Ia(r)}case"configured_provider":return Ia(e.provider?.[t])}}function ww(e){let t=Ma(e.config,e.providerId),n=e.modelId.trim();return n.length>0&&jp(e.config,e.providerId,e.preset).includes(n)?{available:!0,route:t}:{available:!1,route:t,code:e.source==="config_default"?"DEFAULT_MODEL_NOT_AVAILABLE_FOR_ROUTE":"MODEL_NOT_AVAILABLE_FOR_ROUTE",message:`Model "${e.providerId}/${e.modelId}" is not available for the "${t}" route (preset ${e.preset}).`}}function Ia(e,t=!1){let n=Object.entries(e?.models??{}).filter(([,s])=>s?.enabled!==!1).map(([s])=>s),i=e?.model_order;if(!t||!Array.isArray(i)||!i.every(s=>typeof s=="string"))return n;let r=new Set(n);return[...i.filter(s=>r.delete(s)),...n.filter(s=>r.has(s))]}var _w=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function Na(e){if(typeof e=="string")return _w.exec(e.trim())?.[1]}function Up(e){let{field:t,provider:n,value:i}=e;if(i==null)return;if(typeof i!="string")throw new Error(`Provider "${n}": ${t} must be a string or a \`\${NAME}\` environment variable reference, received ${kw(i)}.`);let r=i.trim();if(!r)return;let o=Na(r);if(!o)return r;let s=(e.env??process.env)[o]?.trim();if(!s)throw new Error(`Provider "${n}": ${t} references environment variable "${o}", which is not set.`);return s}function Ew(e){if(!(typeof e.value=="string"&&e.value.trim().length>0))return{configured:!1};let n=xw(e.value)?"env":"plaintext";try{let i=Up(e);return{configured:!0,source:n,...i?{secret:i}:{}}}catch{return{configured:!0,source:n}}}function xw(e){return Na(e)!==void 0}function kw(e){return Array.isArray(e)?"a list":`a ${typeof e}`}import{randomBytes as Cw}from"node:crypto";import pt,{readFileSync as Ow}from"node:fs";import{dirname as Kp,join as Tw}from"node:path";var Vp=xr(eo(),1);var Ra=384,wr=new Set(["__proto__","prototype","constructor"]),Iw=["minimax_api","custom_provider"];async function Lw(e){let t=e.trim();if(!t||t.includes(".")||wr.has(t))throw new ne("Invalid provider id");return Bn(async n=>(ye(n.provider)&&delete n.provider[t],{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function Mw(e){if(!ye(e)||!ye(e.models))throw new ne("Invalid managed MiniMax provider snapshot");return _r(e),Bn(async t=>(t.provider={...ye(t.provider)?t.provider:{},[Je]:structuredClone(e)},{write:!0,value:void 0})).then(({config:t})=>({config:t}))}var ne=class extends Error{name="LocalModelProviderConfigValidationError"},Fn=class extends Error{name="LocalModelProviderConfigWriteError";constructor(){super("Local runtime failed to update config file")}};async function Nw(e){return Bn(async(t,n)=>{let i={minimax_api:ye(t.minimax_api)?t.minimax_api:void 0,custom_provider:qw(ye(t.custom_provider)?t.custom_provider:void 0),minimaxModelSource:typeof t.minimaxModelSource=="string"?t.minimaxModelSource:void 0,defaultModel:typeof t.defaultModel=="string"?t.defaultModel:void 0,defaultModelVariant:typeof t.defaultModelVariant=="string"?t.defaultModelVariant:void 0};await e(i,n);for(let r of Iw){let o=i[r];if(o===void 0){delete t[r];continue}if(!ye(o))throw new ne(`Invalid BYOK config subtree "${r}"`);_r(o),t[r]=o}return Pa(t,"minimaxModelSource",i.minimaxModelSource),t.defaultModel!==i.defaultModel&&(delete t.defaultModelThinking,delete t.defaultModelContextWindow),Pa(t,"defaultModel",i.defaultModel),Pa(t,"defaultModelVariant",i.defaultModelVariant),{write:!0,value:void 0}}).then(({config:t})=>({config:t}))}async function Pw(e){let t=e.modelKey.trim();if(!t)throw new ne("Default model must not be empty");if(e.contextLimit!==void 0&&(!Number.isSafeInteger(e.contextLimit)||e.contextLimit<=0||e.contextLimit>2147483647))throw new ne("Invalid default context");if(e.thinking?.effort!==void 0&&(typeof e.thinking.effort!="string"||!e.thinking.effort.trim()))throw new ne("Invalid default effort");return Bn(async n=>(n.defaultModel=t,e.contextLimit===void 0?delete n.defaultModelContextWindow:n.defaultModelContextWindow=e.contextLimit,e.thinking?.effort===void 0?delete n.defaultModelThinking:n.defaultModelThinking={effort:e.thinking.effort},e.variant===void 0?delete n.defaultModelVariant:n.defaultModelVariant=e.variant,{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function Rw(e,t){let n=e.modelId.trim();if(e.providerId!==Je&&e.providerId!==Vt||!n||wr.has(n))throw new ne("Invalid MiniMax model context target");if(e.providerId===Vt&&!Kt[n]?.contextWindowOptions?.includes(e.contextLimit))throw new ne("Invalid MiniMax API context limit");let i=await Bn(async(r,o)=>{if((e.providerId===Je?o.provider?.[e.providerId]?.models?.[n]?.limit?.context:Dw(o,n))!==e.expectedContextLimit)return{write:!1,value:!1};if(!await t(o))return{write:!1,value:!1};let a=e.providerId===Je?["minimaxModelContextLimits",n]:["minimax_api","modelContextLimits",n];return $w(r,a,e.contextLimit),{write:!0,value:!0}});return{config:i.config,updated:i.value}}function Dw(e,t){let n=Kt[t],i=e.minimax_api?.modelContextLimits?.[t];return i!==void 0&&n?.contextWindowOptions?.includes(i)?i:n?.limit?.context}async function Bn(e){let t=Ut(),n;try{await pt.promises.mkdir(Kp(t),{recursive:!0}),await pt.promises.writeFile(t,"",{flag:"a",mode:Ra}),await pt.promises.chmod(t,Ra),n=await Vp.default.lock(t,{stale:1e4,retries:{retries:20,factor:1,minTimeout:5,maxTimeout:25}});let i=Bw(t),r=structuredClone(i);vr();let o=await e(r,Ar());return o.write&&(_r(r),await Fw(t,Ln(Ow(t,"utf-8"),i,r)),vr()),{config:Ar(),value:o.value}}catch(i){throw i instanceof ne||i instanceof Fn?i:new Fn}finally{await n?.().catch(()=>{})}}async function Fw(e,t){let n=Tw(Kp(e),`.config-tmp-${Cw(6).toString("hex")}`),i=!1;try{let r=Ra,o=await pt.promises.open(n,"wx",r);i=!0;try{await o.writeFile(t,"utf-8"),await o.chmod(r)}finally{await o.close()}await pt.promises.rename(n,e)}catch{throw i&&await pt.promises.unlink(n).catch(()=>{}),new Fn}}function Bw(e){let t=pt.readFileSync(e,"utf-8"),n;try{n=W.load(t)}catch{throw new ne("Invalid config.yaml: unable to parse YAML")}if(n==null)return{};if(!ye(n)||Object.getPrototypeOf(n)!==Object.prototype)throw new ne("Invalid config.yaml: expected a YAML mapping");return n}function qw(e){if(e)return Object.fromEntries(Object.entries(e).filter(([,t])=>ye(t)))}function Pa(e,t,n){n===void 0?delete e[t]:e[t]=n}function $w(e,t,n){let i=t.at(-1);if(!i)throw new ne("Invalid config path");let r=e;for(let o of t.slice(0,-1)){if(!o||wr.has(o))throw new ne("Invalid config path");let s=r[o];if(ye(s))r=s;else{let a={};r[o]=a,r=a}}r[i]=n}function _r(e){for(let[t,n]of Object.entries(e)){if(!t||wr.has(t))throw new ne(`Local runtime cannot update config field segment "${t}"`);ye(n)&&_r(n)}}function ye(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Xw(e){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let i=JSON.parse(t),r=typeof i.pid=="number"?i.pid:parseInt(String(i.pid),10);if(isNaN(r)||r<=0)return null;let o=Qw(i.owner)?i.owner:"unknown",s=zw(i.startedAt);return{pid:r,owner:o,...s!==void 0?{startedAt:s}:{},...typeof i.mode=="string"?{mode:i.mode}:{},...typeof i.startupToken=="string"?{startupToken:i.startupToken}:{}}}catch{return null}let n=parseInt(t,10);return isNaN(n)||n<=0?null:{pid:n,owner:"unknown"}}function Qw(e){return e==="electron"||e==="cli"||e==="unknown"}function zw(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e!="string")return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}function Zw(e,t){let n={pid:e,owner:t,startedAt:Date.now()};return JSON.stringify(n)}function e_(){let e=process.argv.slice(2);for(let t=0;t<e.length;t++){let n=e[t],i=n==="--owner"?e[t+1]:n?.startsWith("--owner=")?n.slice(8):void 0;if(i==="electron")return"electron";if(i==="service"||i==="cli")return"cli"}return"cli"}import Xe from"node:fs";import t_ from"node:path";var Yp="local-runtime.auth.json";function we(e){return typeof e=="string"&&e.trim().length>0?e.trim():void 0}function Da(e){return e?{...we(e.accessToken)?{accessToken:we(e.accessToken)}:{},...we(e.realUserID)?{realUserID:we(e.realUserID)}:{},...we(e.userEmail)?{userEmail:we(e.userEmail)}:{},...we(e.userName)?{userName:we(e.userName)}:{},...we(e.subUserName)?{subUserName:we(e.subUserName)}:{}}:{}}function Er(e){return t_.join(e,Yp)}function n_(e){try{let t=Xe.readFileSync(Er(e),"utf-8"),n=JSON.parse(t);if(n.version!==1||!n.auth||typeof n.auth!="object")return;let i=Da(n.auth);return i.accessToken?i:void 0}catch{return}}function i_(e,t,n={}){let i=Er(e),r=Da(t);if(!r.accessToken)return Gp(e),{path:i,written:!1};Xe.mkdirSync(e,{recursive:!0,mode:448});let o={version:1,updatedAtMs:Date.now(),auth:r},s=`${i}.${process.pid}.${Date.now()}.tmp`;return Xe.writeFileSync(s,`${JSON.stringify(o,null,2)}
193
- `,{encoding:"utf-8",mode:384}),n.retryWindowsFileSystem?(kr(()=>Xe.renameSync(s,i)),kr(()=>Xe.chmodSync(i,384))):(Xe.renameSync(s,i),Xe.chmodSync(i,384)),{path:i,written:!0}}function Gp(e){try{Xe.rmSync(Er(e),{force:!0})}catch{}}import Wp from"node:net";var Hp={"e2e-runtime":5e3,"e2e-ui":5500,"smoke-runtime":7e3},Fa=100;async function r_(e,t={}){let n=t.isPortFree??s_,i=t.getFreePort??a_,r=t.getWorktreeBasePort??o_,o=r()+Hp[e],s=o-r();if(s<Fa)throw new Error(`pickTestPort(${e}): role offset ${s} collides with app runtime (0); must be >= ${Fa}.`);return o>65535?i():await n(o)?o:i()}function o_(){let e=dt();return e.autoDetected?e.runtimePort:jt}async function s_(e){return new Promise(t=>{let n=Wp.createServer();n.once("error",()=>t(!1)),n.listen(e,"127.0.0.1",()=>{n.close(()=>t(!0))})})}async function a_(){return new Promise((e,t)=>{let n=Wp.createServer();n.listen(0,"127.0.0.1",()=>{let i=n.address();if(i&&typeof i!="string"){let{port:r}=i;n.close(()=>e(r))}else n.close(()=>t(new Error("Failed to get free port")))}),n.on("error",t)})}import Jp from"node:fs";var Yt=class extends Error{code;configPath;constructor(t,n,i,r){super(i,r),this.name="ConfigFileError",this.code=t,this.configPath=n}};function Xp(e){let t;try{t=Jp.readFileSync(e,"utf-8")}catch(i){throw new Yt("CONFIG_READ_FAILED",e,`Cannot read config ${e}.`,{cause:i})}let n;try{n=W.load(t)}catch(i){throw new Yt("CONFIG_PARSE_FAILED",e,`Config is not valid YAML: ${e}`,{cause:i})}if(n==null||typeof n!="object"||Array.isArray(n))throw new Yt("CONFIG_ROOT_INVALID",e,`Config root must be an object: ${e}`);return n}function l_(e,t){return Jp.existsSync(e)&&ka(e),Ca(Xp(e),t.dataDir)}function c_(e,t){let n=Xp(e);if(n.beta==null||typeof n.beta!="object"||Array.isArray(n.beta))return;let i=n.beta[t];return typeof i=="boolean"?i:void 0}export{eo as a,f_ as b,d_ as c,Qp as d,W as e,Hy as f,to as g,no as h,dd as i,er as j,Ln as k,Rt as l,tr as m,Cv as n,lr as o,Us as p,Qv as q,$d as r,Dt as s,jd as t,Ks as u,Wd as v,Hd as w,Xd as x,Qd as y,Ye as z,sA as A,aA as B,ta as C,na as D,ia as E,ep as F,ra as G,fA as H,pA as I,mA as J,hA as K,yA as L,Ge as M,sa as N,op as O,lp as P,cp as Q,up as R,fp as S,dp as T,he as U,aa as V,la as W,Ae as X,ca as Y,Nn as Z,ua as _,mp as $,da as aa,pa as ba,ma as ca,fr as da,ha as ea,yp as fa,Ep as ga,Te as ha,dr as ia,mr as ja,va as ka,DA as la,Aa as ma,BA as na,xp as oa,jt as pa,Op as qa,YA as ra,dt as sa,WA as ta,_a as ua,Ut as va,Kt as wa,Rp as xa,Ea as ya,nw as za,iw as Aa,vr as Ba,Ar as Ca,qp as Da,$p as Ea,yw as Fa,Sw as Ga,Oa as Ha,Ta as Ia,Je as Ja,Vt as Ka,La,Aw as Ma,Ma as Na,jp as Oa,ww as Pa,Na as Qa,Up as Ra,Ew as Sa,Lw as Ta,Mw as Ua,Nw as Va,Pw as Wa,Rw as Xa,Xw as Ya,Zw as Za,e_ as _a,Yp as $a,Da as ab,Er as bb,n_ as cb,i_ as db,Gp as eb,Hp as fb,Fa as gb,r_ as hb,Yt as ib,l_ as jb,c_ as kb};
186
+ `+e.slice(s+1):l+=e.slice(r),l.slice(1)}function Xh(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=Gt(e,r),i=te[n],!i&&Xt(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||jh(n);return t}function Qh(e,t,n){var i="",r=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(_e(e,t,a,!1,!1)||typeof a>"u"&&_e(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function za(e,t,n,i){var r="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(_e(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&_e(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=Mr(e,t)),e.dump&&Ht===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function zh(e,t,n){var i="",r=e.tag,o=Object.keys(n),s,a,l,c,u;for(s=0,a=o.length;s<a;s+=1)u="",i!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=o[s],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),_e(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),_e(e,t,c,!1,!1)&&(u+=e.dump,i+=u));e.tag=r,e.dump="{"+i+"}"}function Zh(e,t,n,i){var r="",o=e.tag,s=Object.keys(n),a,l,c,u,f,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new ie("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)d="",(!i||r!=="")&&(d+=Mr(e,t)),c=s[a],u=n[c],e.replacer&&(u=e.replacer.call(n,c,u)),_e(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Ht===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,f&&(d+=Mr(e,t)),_e(e,t+1,u,!0,f)&&(e.dump&&Ht===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,r+=d));e.tag=o,e.dump=r||"{}"}function Za(e,t,n){var i,r,o,s,a,l;for(r=n?e.explicitTypes:e.implicitTypes,o=0,s=r.length;o<s;o+=1)if(a=r[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,Ll.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(Ml.call(a.represent,l))i=a.represent[l](t,l);else throw new ie("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function _e(e,t,n,i,r,o,s){e.tag=null,e.dump=n,Za(e,n,!1)||Za(e,n,!0);var a=Ll.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",f,d;if(u&&(f=e.duplicates.indexOf(n),d=f!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(r=!1),d&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(u&&d&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(Zh(e,t,e.dump,r),d&&(e.dump="&ref_"+f+e.dump)):(zh(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?za(e,t-1,e.dump,r):za(e,t,e.dump,r),d&&(e.dump="&ref_"+f+e.dump)):(Qh(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Hh(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ie("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function ey(e,t){var n=[],i=[],r,o;for(Pr(e,n,i),r=0,o=i.length;r<o;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(o)}function Pr(e,t,n){var i,r,o;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;r<o;r+=1)Pr(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;r<o;r+=1)Pr(e[i[r]],t,n)}function ty(e,t){t=t||{};var n=new Kh(t);n.noRefs||ey(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),_e(n,0,i,!0,!0)?n.dump+`
187
+ `:""}var ny=ty,iy={dump:ny};function $r(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var ry=Q,oy=nl,sy=sl,ay=fl,ly=dl,cy=Dr,uy=Il.load,fy=Il.loadAll,dy=iy.dump,py=ie,my={binary:gl,float:ul,map:ol,null:al,pairs:Sl,set:vl,timestamp:hl,bool:ll,int:cl,merge:yl,omap:bl,seq:rl,str:il},hy=$r("safeLoad","load"),yy=$r("safeLoadAll","loadAll"),gy=$r("safeDump","dump"),W={Type:ry,Schema:oy,FAILSAFE_SCHEMA:sy,JSON_SCHEMA:ay,CORE_SCHEMA:ly,DEFAULT_SCHEMA:cy,load:uy,loadAll:fy,dump:dy,YAMLException:py,types:my,safeLoad:hy,safeLoadAll:yy,safeDump:gy};var Ac=xr(eo(),1);async function Jy(e,t){let n=Sc(e,"config.yaml"),i,r=!1,o;try{await Pe.mkdir(e,{recursive:!0}),await Pe.writeFile(n,"",{flag:"a",mode:384}),await Pe.chmod(n,384);let s=await Pe.realpath(n);i=Sc(Hy(s),`.config-tmp-${Wy(6).toString("hex")}`),o=await Ac.default.lock(s,{stale:1e4,retries:{retries:20,factor:1,minTimeout:5,maxTimeout:25}});let l=W.load(await Pe.readFile(s,"utf8"))??{};if(!vc(l))throw new Error("Invalid config document");let c=l.tui??{};if(!vc(c))throw new Error("Invalid TUI settings");let u={...c};t===void 0?delete u.statusLine:u.statusLine=[...t];let f={...l,tui:u},d=384,p=await Pe.open(i,"wx",d);r=!0;try{await p.writeFile(W.dump(f,{lineWidth:-1,noRefs:!0}),"utf8"),await p.chmod(d)}finally{await p.close()}await Pe.rename(i,s)}catch{throw new Error("Unable to save status line settings. Check config.yaml syntax and permissions.")}finally{r&&i&&await Pe.unlink(i).catch(()=>{}),await o?.().catch(()=>{})}}function vc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}function to(e){if(typeof e!="object"||e===null||Array.isArray(e))return{};let t=e.enabled;return typeof t=="boolean"?{enabled:t}:{}}function no(e,t){return{enabled:to(t).enabled??to(e).enabled??!0}}import Oe from"node:fs";import be from"node:fs";var wc=384;function _t(e){if(process.platform==="win32")return;let t=be.statSync(e).mode;(t&63)!==0&&be.chmodSync(e,t&448)}function it(e,t,n=!1){let i=be.constants.O_WRONLY|be.constants.O_CREAT|(n?be.constants.O_EXCL:0),r=be.openSync(e,i,wc);try{be.fchmodSync(r,wc),be.ftruncateSync(r,0),be.writeFileSync(r,t)}finally{be.closeSync(r)}}import{isDeepStrictEqual as hd}from"node:util";var ee=xr(dd(),1);function er(e){try{let t=W.load(e);return Bs(t)?t:{}}catch{return{}}}function Ln(e,t,n){let i=(0,ee.parseDocument)(e,{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!0});if(i.errors.length>0||!(0,ee.isMap)(i.contents)&&e.trim()!=="")return md(n);try{let r=gd(t,n);if(r.length===0)return e;_v(i),xv(i);for(let s of r){let a=Ev(i,s.path);s.kind==="delete"?i.deleteIn(a):i.setIn(a,s.value)}let o=i.toString({indent:2,lineWidth:-1});if(!hd(W.load(o),W.load(md(n))))throw new Error("The serialized configuration does not match the intended values");return o}catch(r){throw new Error(`config.yaml could not be rewritten: ${r instanceof Error?r.message:String(r)}${r instanceof RangeError?". Remove the self-referential YAML anchor and retry.":""}`)}}function _v(e){(0,ee.visit)(e,{Scalar(t,n){if(n.addToJSMap||typeof n.source!="string"||n.type!=="PLAIN"&&!n.tag)return;let i=n.type==="PLAIN"&&!n.source.includes(`
188
+ `)?n.source:JSON.stringify(n.source),r=n.tag?`!<${n.tag}> `:"",o=W.load(`value: ${r}${i}`).value;hd(n.value,o)||(n.value=o,delete n.format)}})}function yd(e,t){return e.items.find(n=>(0,ee.isScalar)(n.key)&&String(n.key.value)===t)?.key??t}function Ev(e,t){let n=[],i=e.contents;for(let r of t)n.push((0,ee.isMap)(i)?yd(i,r):r),i=e.getIn(n,!0);return n}function xv(e){let t=new Map;(0,ee.visit)(e,{Alias(n,i){let r=i.toJS(e),o=pd(e,r);o.comment=i.comment,o.commentBefore=i.commentBefore,o.spaceBefore=i.spaceBefore,t.set(i,o)}}),(0,ee.visit)(e,{Alias:(n,i)=>t.get(i)}),(0,ee.visit)(e,{Map(n,i){let r=i.items.filter(a=>(0,ee.isScalar)(a.key)&&a.key.addToJSMap);if(r.length===0)return;let o=i.toJS(e),s=r.flatMap(a=>[a.key,a.value].flatMap(l=>(0,ee.isNode)(l)?[l.commentBefore,l.comment]:[]));i.commentBefore=[i.commentBefore,...s].filter(Boolean).join(`
189
+ `)||void 0,i.items=i.items.filter(a=>!r.includes(a));for(let[a,l]of Object.entries(o))i.has(yd(i,a))||i.set(a,pd(e,l))}}),e.setSchema(e.directives?.yaml.version??"1.2",{schema:"core",compat:"yaml-1.1",customTags:["timestamp"],merge:!1})}function pd(e,t){let n=e.createNode(t,{aliasDuplicateObjects:!1});return(0,ee.visit)(n,{Pair(i,r){(0,ee.isScalar)(r.key)&&r.key.value==="<<"&&(r.key.type="QUOTE_DOUBLE")}}),n}function gd(e,t,n=[]){if(!Bs(e)||!Bs(t))return kv(e,t)?[]:[{kind:"set",path:n,value:t}];let i=[];for(let r of new Set([...Object.keys(e),...Object.keys(t)])){let o=[...n,r];!(r in t)||t[r]===void 0?i.push({kind:"delete",path:o}):r in e?i.push(...gd(e[r],t[r],o)):i.push({kind:"set",path:o,value:t[r]})}return i}function kv(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function md(e){return W.dump(e,{indent:2,lineWidth:-1,noRefs:!0})}function Bs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Rt(e){if(typeof e!="object"||e===null)return!1;if("v2_enabled"in e&&typeof e.v2_enabled=="boolean")return e.v2_enabled;if(!("v2"in e))return!1;let t=e.v2;return typeof t!="object"||t===null?!1:"enabled"in t&&typeof t.enabled=="boolean"?t.enabled:"writeEnabled"in t&&t.writeEnabled===!0||"recallEnabled"in t&&t.recallEnabled===!0}var tr={enabled:!1,detailedLoggingEnabled:!1,writeEnabled:!1,recallEnabled:!1,eligibleSessionIdleMs:600*1e3,maxCaptureInputTokens:64e3,maxSessionDocBytes:64*1024,maxSelectedSessions:256,maxConsolidationInputTokens:256e3,maxMemoryMarkdownBytes:2*1024*1024,maxSummaryInjectionTokens:2500,maxCaptureSessionsPerWake:6,maxCaptureConcurrency:2,eligibleSessionMaxAgeDays:30,maxCaptureAttemptsPerRevision:3,captureFailureBackoffMs:3600*1e3,publicationCooldownMs:360*60*1e3,maxConsolidationAgentTurns:64,minModelQuotaRemainingPercent:25,captureModel:void 0,captureReasoningEffort:"low",consolidationModel:void 0,consolidationReasoningEffort:"medium",retentionDays:90};function vd(e,t){let n=e.memory,i=n!=null&&typeof n=="object"&&!Array.isArray(n)?n:{},r=i.dailyDigest,o=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},s=i.v2,a=s!=null&&typeof s=="object"&&!Array.isArray(s)?s:{},l=t.v2,c=i.legacyRecallDisabledAgents;return{legacyRecallDisabledAgents:c&&typeof c=="object"&&!Array.isArray(c)?Object.fromEntries(Object.entries(c).filter(([,u])=>typeof u=="boolean")):{},enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,proactive:typeof i.proactive=="boolean"?i.proactive:t.proactive,dailyDigest:{enabled:typeof o.enabled=="boolean"?o.enabled:t.dailyDigest.enabled},v2_enabled:typeof i.v2_enabled=="boolean"||["enabled","writeEnabled","recallEnabled"].some(u=>typeof a[u]=="boolean")?Rt(i):Rt(t),v2:{...typeof a.enabled=="boolean"?{enabled:a.enabled}:{},detailedLoggingEnabled:qs(a.detailedLoggingEnabled,l.detailedLoggingEnabled),writeEnabled:qs(a.writeEnabled,l.writeEnabled),recallEnabled:qs(a.recallEnabled,l.recallEnabled),eligibleSessionIdleMs:re(a.eligibleSessionIdleMs,l.eligibleSessionIdleMs),maxCaptureInputTokens:re(a.maxCaptureInputTokens,l.maxCaptureInputTokens),maxSessionDocBytes:re(a.maxSessionDocBytes,l.maxSessionDocBytes),maxSelectedSessions:re(a.maxSelectedSessions,l.maxSelectedSessions),maxConsolidationInputTokens:re(a.maxConsolidationInputTokens,l.maxConsolidationInputTokens),maxMemoryMarkdownBytes:re(a.maxMemoryMarkdownBytes,l.maxMemoryMarkdownBytes),maxSummaryInjectionTokens:re(a.maxSummaryInjectionTokens,l.maxSummaryInjectionTokens),maxCaptureSessionsPerWake:re(a.maxCaptureSessionsPerWake,l.maxCaptureSessionsPerWake),maxCaptureConcurrency:re(a.maxCaptureConcurrency,l.maxCaptureConcurrency),eligibleSessionMaxAgeDays:re(a.eligibleSessionMaxAgeDays,l.eligibleSessionMaxAgeDays),maxCaptureAttemptsPerRevision:re(a.maxCaptureAttemptsPerRevision,l.maxCaptureAttemptsPerRevision),captureFailureBackoffMs:re(a.captureFailureBackoffMs,l.captureFailureBackoffMs),publicationCooldownMs:re(a.publicationCooldownMs,l.publicationCooldownMs),maxConsolidationAgentTurns:re(a.maxConsolidationAgentTurns,l.maxConsolidationAgentTurns),minModelQuotaRemainingPercent:Cv(a.minModelQuotaRemainingPercent,l.minModelQuotaRemainingPercent),captureModel:bd(a.captureModel,l.captureModel),captureReasoningEffort:Sd(a.captureReasoningEffort,l.captureReasoningEffort),consolidationModel:bd(a.consolidationModel,l.consolidationModel),consolidationReasoningEffort:Sd(a.consolidationReasoningEffort,l.consolidationReasoningEffort),retentionDays:re(a.retentionDays,l.retentionDays)}}}function qs(e,t){return typeof e=="boolean"?e:t}function re(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function Cv(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0&&e<=100?e:t}function bd(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}function Sd(e,t){return e==="low"||e==="medium"||e==="high"?e:t}function Ov(e,t){return!Rt(e)&&e?.enabled!==!1&&e?.legacyRecallDisabledAgents?.[t]!==!0}import oe from"node:path";import CA from"node:os";import{spawnSync as OA}from"node:child_process";import{fileURLToPath as TA}from"node:url";function Ad(e){let t=e.tui;if(t==null||typeof t!="object"||Array.isArray(t))return{};let n=t,i=n.notifications,r;if(i&&typeof i=="object"&&!Array.isArray(i)){let{when:l,method:c}=i;r={...l==="unfocused"||l==="always"||l==="never"?{when:l}:{},...c==="auto"||c==="osc9"||c==="osc777"||c==="bel"?{method:c}:{}}}let o=n.statusLine,s=Array.isArray(o)?o.filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean):void 0,a=Tv(n.customStatusLine);return{...typeof n.showTips=="boolean"?{showTips:n.showTips}:{},...r?{notifications:r}:{},...s?{statusLine:s}:{},...a?{customStatusLine:a}:{}}}function Tv(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e,n=typeof t.command=="string"?t.command.trim():"";if(n)return{command:n,...t.display==="inline"||t.display==="block"?{display:t.display}:{},...t.position==="above"||t.position==="below"?{position:t.position}:{},...t.colorMode==="plain"||t.colorMode==="ansi"?{colorMode:t.colorMode}:{},...typeof t.maxLines=="number"&&Number.isFinite(t.maxLines)?{maxLines:t.maxLines}:{},...typeof t.timeoutMs=="number"&&Number.isFinite(t.timeoutMs)?{timeoutMs:t.timeoutMs}:{},...typeof t.intervalSeconds=="number"&&Number.isFinite(t.intervalSeconds)?{intervalSeconds:t.intervalSeconds}:{}}}import{createHash as Iv,randomUUID as Lv}from"node:crypto";import ir from"node:fs";import nr from"node:path";function Ed(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e,n={};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseURL=="string"&&(n.baseURL=t.baseURL);let i=js(t.modelContextLimits);return i&&(n.modelContextLimits=i),Object.keys(n).length>0?n:void 0}function js(e){if(!B(e))return;let t=Object.entries(e).filter(n=>n[0].length>0&&Number.isSafeInteger(n[1])&&n[1]>0);return t.length>0?Object.fromEntries(t):void 0}function xd(e,t){let n=e.minimax;if(!n?.models||!t)return e;let i=!1,r=Object.fromEntries(Object.entries(n.models).map(([o,s])=>{let a=t[o];return a===void 0||!s.contextWindowOptions?.includes(a)||s.limit?.context===a?[o,s]:(i=!0,[o,{...s,limit:{...s.limit,context:a}}])}));return i?{...e,minimax:{...n,models:r}}:e}function kd(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=Object.entries(e).filter(([,n])=>n!=null&&typeof n=="object"&&!Array.isArray(n));if(t.length!==0)return Object.fromEntries(t.map(([n,i])=>[n,Od(i)]))}function Cd(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,B(n)?Od(n):n]))}function Od(e){if(!B(e.models))return e;let t=!1,n=Object.fromEntries(Object.entries(e.models).map(([i,r])=>{if(!B(r)||!B(r.thinking))return[i,r];let o=typeof r.thinking.effort=="string"?r.thinking.effort.trim():"",s=typeof r.thinking.defaultEffort=="string"?r.thinking.defaultEffort.trim():"";if(!Object.hasOwn(r.thinking,"effort")&&!Object.hasOwn(r.thinking,"defaultEffort"))return[i,r];let a=[],l=new Set;if(Array.isArray(r.thinking.effortOptions))for(let d of r.thinking.effortOptions){if(typeof d!="string")continue;let p=d.trim();!p||l.has(p)||(l.add(p),a.push(p))}o&&!l.has(o)&&(l.add(o),a.push(o)),s&&!l.has(s)&&(l.add(s),a.push(s));let c={...r.thinking};delete c.effort,delete c.effortOptions,delete c.defaultEffort;let u={...c,...a.length>0?{effortOptions:a}:{},...s?{defaultEffort:s}:{}},f={...r};return Object.keys(u).length>0?f.thinking=u:delete f.thinking,t=!0,[i,f]}));return t?{...e,models:n}:e}var Td="byok_legacy_provider_to_custom_provider_v1",Id="config.yaml.bak.byok-legacy-provider.",$s=new Set(["minimax","minimax_api","provider","custom_provider"]),Mv=/^[A-Za-z0-9 _-]+$/;function Ld(e,t){let n={migrated:!1,migratedProviders:{}};if(!t.isManagedRuntime()||!ir.existsSync(e))return n;let i=Rv(e);if(!B(i.provider))return n;let r=i.provider,o=B(i.custom_provider)?i.custom_provider:{},s=Vv(i),a={},l={...o},c=new Set(Object.keys(l)),u=!1,f=t.getManagedPreset().provider;for(let[d,p]of Object.entries(r)){if(!Dv(d,p,f))continue;let y=s.providers[d];if(y&&!$s.has(y)&&!B(l[y])){delete r[d],u=!0;continue}let m=y&&!$s.has(y)?y:qv(d,p,c);a[d]=m,B(l[m])||(l[m]=Bv(p),c.add(m),u=!0),s.providers[d]!==m&&(s.providers[d]=m,u=!0),delete r[d],u=!0}if(!u&&Object.keys(a).length===0)return n;if(u=_d(i,"defaultModel",a)||u,u=_d(i,"defaultLightModel",a)||u,u=Uv(i,a)||u,!u)return{migrated:!1,migratedProviders:a};Object.keys(l).length>0?i.custom_provider=l:delete i.custom_provider,Yv(i,s);try{let d=Kv(e);return it(e,W.dump(i,{indent:2,lineWidth:-1,noRefs:!0})),{migrated:!0,migratedProviders:a,backupPath:d}}catch(d){return console.warn(`[config] legacy BYOK provider migration skipped: ${Wv(d)}`),{migrated:!1,migratedProviders:a}}}function Md(e,t){let n=e.provider,i=e.defaultModel;if(Object.prototype.hasOwnProperty.call(n,"minimax_api")){let{minimax_api:y,...m}=n;n=m,console.warn('[config] "minimax_api" is a reserved provider id; ignoring provider.minimax_api from config.yaml')}let o=t.getManagedPreset().provider.minimax,s=n.minimax,a=t.isManagedRuntime();if(!(a||Nv(s,t)))return{provider:n,defaultModel:i};let c=s?.options,u=a&&t.shouldEnforceManagedProviderProtection(),f=Pv(o.models,s?.models),d=typeof c?.baseURL=="string"&&c.baseURL.length>0?c.baseURL:void 0,p=u&&d!=null&&!t.isManagedPresetBaseUrl(d);return n={...n,minimax:{...o,...s??{},npm:s?.npm??o.npm,models:f,options:{...o.options??{},...c??{},...p?{apiKey:o.options?.apiKey}:{},...u?{authMode:"managed-login",baseURL:o.options?.baseURL}:{}}}},{provider:n,defaultModel:i}}function Nv(e,t){let n=e?.options;return n?.authMode==="managed-login"?!0:typeof n?.baseURL=="string"&&t.isManagedPresetBaseUrl(n.baseURL)}function Pv(e,t){return t&&Object.keys(t).length>0?t:e??{}}function Rv(e){try{let t=W.load(ir.readFileSync(e,"utf-8"));return B(t)?t:{}}catch{return{}}}function Dv(e,t,n){return e==="minimax"||e==="minimax_api"||!Gv(t)||!Fv(t)?!1:!Object.prototype.hasOwnProperty.call(n,e)}function Fv(e){let t=B(e.options)?e.options:void 0;return typeof t?.apiKey=="string"&&t.apiKey.trim().length>0&&typeof t.baseURL=="string"&&t.baseURL.trim().length>0&&B(e.models)}function Bv(e){let t=B(e.options)?e.options:{};return{...e,kind:"custom",enabled:e.enabled!==!1,options:{...t,authMode:"api-key"}}}function qv(e,t,n){let i=B(t)?t:{},r=typeof i.name=="string"?i.name:void 0,o=`provider-${$v(e)}`,s=wd(e)??wd(r)??o;for(let a=0;;a+=1){let l=a===0?s:`${s}-${a+1}`;if(!n.has(l)&&!$s.has(l))return l}}function wd(e){let t=e?.trim();return!t||!Mv.test(t)?void 0:t.toLowerCase().replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function $v(e){return Iv("sha256").update(e).digest("hex").slice(0,8)}function _d(e,t,n){let i=e[t];if(typeof i!="string")return!1;let r=jv(i,n);return r===i?!1:(e[t]=r,!0)}function jv(e,t){let n=e.indexOf("/");if(n<=0||n===e.length-1)return e;let i=e.slice(0,n),r=t[i];return r?`custom_provider:${r}/${e.slice(n+1)}`:e}function Uv(e,t){if(!B(e.nexus)||!B(e.nexus.model))return!1;let n=e.nexus.model.providerID;if(typeof n!="string")return!1;let i=t[n];return i?(e.nexus.model.providerID=`custom_provider:${i}`,!0):!1}function Nd(e){if(process.platform==="win32")return;let t=nr.dirname(e),n;try{n=ir.readdirSync(t,{withFileTypes:!0})}catch{console.warn(`[config] Could not inspect legacy BYOK backups in ${JSON.stringify(t)}. Backup permissions were not verified; check directory access and restrict backup permissions manually.`);return}for(let i of n)if(i.isFile()&&i.name.startsWith(Id)){let r=nr.join(t,i.name);try{_t(r)}catch{console.warn(`[config] Could not restrict legacy BYOK backup ${JSON.stringify(r)}. It may still be readable by other users; restrict its permissions manually.`)}}}function Kv(e){let t=nr.join(nr.dirname(e),`${Id}${Date.now()}.${Lv()}`);return _t(e),it(t,ir.readFileSync(e),!0),t}function Vv(e){let n=(B(e.migrations)?e.migrations:void 0)?.[Td];return{providers:B(n)&&B(n.providers)?Object.fromEntries(Object.entries(n.providers).filter(r=>typeof r[1]=="string")):{}}}function Yv(e,t){let n=B(e.migrations)?e.migrations:{};n[Td]={version:1,providers:t.providers},e.migrations=n}function Gv(e){return B(e)?typeof e.name=="string"||typeof e.npm=="string"||typeof e.api=="string"||B(e.options)||B(e.models):!1}function B(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Wv(e){return e instanceof Error?e.message:String(e)}function Pd(e,t){if(e==null||typeof e!="object"||Array.isArray(e))return t;let n=Reflect.get(e,"mode"),i=Reflect.get(e,"turnDiffCard");return{mode:n==="inline"||n==="subagent"?n:t.mode,turnDiffCard:i==="concise"||i==="standard"?i:t.turnDiffCard,modeSource:n==="inline"||n==="subagent"?"explicit":"default"}}function Rd(e,t){let n=t.keepAlive,i=t.xdg,r=t.spawnConcurrency,o=()=>({enabled:n.enabled,maxProcesses:n.maxProcesses,maxLifetimeMs:n.maxLifetimeMs,agents:[...n.agents]}),s=e.opencode;if(s==null||typeof s!="object"||Array.isArray(s))return{keepAlive:o(),xdg:{...i},spawnConcurrency:r};let a=s,l=a.spawnConcurrency,c=typeof l=="number"&&Number.isFinite(l)&&l>0&&Number.isInteger(l)?l:r,u=Hv(a.xdg,i),f=a.keepAlive;if(f==null||typeof f!="object"||Array.isArray(f))return{keepAlive:o(),xdg:u,spawnConcurrency:c};let d=f,p=d.maxProcesses,y=typeof p=="number"&&Number.isFinite(p)&&p>0&&Number.isInteger(p)?p:n.maxProcesses,m=d.maxLifetimeMs,h=typeof m=="number"&&Number.isFinite(m)&&m>0&&Number.isInteger(m)?m:n.maxLifetimeMs,g=d.agents,b;return Array.isArray(g)?(b=g.filter(v=>typeof v=="string"&&v.length>0),b.length===0&&(b=[...n.agents])):b=[...n.agents],{keepAlive:{enabled:typeof d.enabled=="boolean"?d.enabled:n.enabled,maxProcesses:y,maxLifetimeMs:h,agents:b},xdg:u,spawnConcurrency:c}}function Hv(e,t){let n=e!=null&&typeof e=="object"&&!Array.isArray(e)?e:void 0,i=n?.startupImport,r=i==="background"||i==="blocking"||i==="off"?i:t.startupImport;return{dataIsolation:typeof n?.dataIsolation=="boolean"?n.dataIsolation:t.dataIsolation,startupImport:r}}function rr(e){let t=JSON.stringify({level:40,time:Date.now(),name:"config.asr",msg:e});process.stderr.write(`${t}
190
+ `)}var sr={enabled:!0};function Dd(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;let t=e,n=typeof t.apiKey=="string"&&t.apiKey.trim().length>0,i=typeof t.resourceId=="string"&&t.resourceId.trim().length>0;return n||i}function or(e){return typeof e=="string"&&e.trim().length>0}function Fd(e){let t=e.asr;if(t==null||typeof t!="object"||Array.isArray(t))return{...sr};let n=t;return Dd(n.seed)&&rr("Ignoring legacy `asr.seed.*` in config \u2014 Seed ASR was retired from the daemon; only Amadeus remains. Remove `asr.seed` from config.yaml."),Dd(n.qwen)&&rr("Ignoring legacy `asr.qwen.apiKey` in config \u2014 Qwen ASR was retired from the daemon; only Amadeus remains. Remove `asr.qwen` from config.yaml."),(or(n.mode)||or(n.proxyBaseUrl))&&rr("Ignoring legacy `asr.mode` / `asr.proxyBaseUrl` in config \u2014 the daemon no longer runs the shared asr-proxy WebSocket path. The Amadeus HTTP proxy is managed by the application environment. Remove these keys from config.yaml."),(or(n.primaryProvider)||or(n.fallbackProvider))&&rr("Ignoring legacy `asr.primaryProvider` / `asr.fallbackProvider` in config \u2014 only Amadeus remains and provider selection is no longer configurable. Remove these keys from config.yaml."),{enabled:typeof n.enabled=="boolean"?n.enabled:sr.enabled}}var Jv={policyOwner:"core",storageWriteVersion:2,classifierTimeoutMs:6e4,userConfirmationEnabled:!0};function Bd(e,t=Jv){let n=e.permission;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.policyOwner===void 0?t.policyOwner:i.policyOwner==="engine"||i.policyOwner==="core"?i.policyOwner:"engine",o=i.storageWriteVersion===1||i.storageWriteVersion===2?i.storageWriteVersion:t.storageWriteVersion,s=i.classifierTimeoutMs,a=typeof s=="number"&&Number.isFinite(s)&&s>=5e3?Math.floor(s):t.classifierTimeoutMs,l=typeof i.userConfirmationEnabled=="boolean"?i.userConfirmationEnabled:t.userConfirmationEnabled;return{policyOwner:r,storageWriteVersion:o,classifierTimeoutMs:a,userConfirmationEnabled:l}}var qd=["user-cc","user-codex","user-agents","workspace-minimax","workspace-cc","workspace-agents"],Xv={"user-cc":"user-claude","workspace-cc":"workspace-claude"},lr={external:{enabled:!0,walkUp:!0,duplicateWarn:!0,sources:{"workspace-minimax":{enabled:!0,priority:65},"workspace-cc":{enabled:!0,priority:60},"workspace-agents":{enabled:!0,priority:55},"user-cc":{enabled:!0,priority:40},"user-codex":{enabled:!0,priority:35},"user-agents":{enabled:!0,priority:30}}}};function ar(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Qv(e,t){return ar(e)?{enabled:typeof e.enabled=="boolean"?e.enabled:t.enabled,priority:typeof e.priority=="number"&&Number.isFinite(e.priority)?e.priority:t.priority}:t}function Us(e){let t=lr,n=ar(e.skills)?e.skills:{},i=ar(n.external)?n.external:{},r=ar(i.sources)?i.sources:{},o={...t.external.sources};for(let s of qd){let a=Xv[s],l=Object.hasOwn(r,s)?r[s]:a?r[a]:void 0;o[s]=Qv(l,t.external.sources[s])}return{external:{enabled:typeof i.enabled=="boolean"?i.enabled:t.external.enabled,walkUp:typeof i.walkUp=="boolean"?i.walkUp:t.external.walkUp,duplicateWarn:typeof i.duplicateWarn=="boolean"?i.duplicateWarn:t.external.duplicateWarn,sources:o}}}var zv=qd;var $d=["pi-agent"],Dt="pi-agent";function jd(e){return typeof e!="string"?Dt:$d.includes(e)?e:Dt}function Ks(e){return e==null||typeof e!="object"||Array.isArray(e)?{defaultFramework:Dt}:{defaultFramework:jd(e.defaultFramework)}}import Y from"node:fs";import Zv from"node:os";import Ft from"node:path";var Wd=".minimax",Hd=".mavis",eA={error:()=>{},info:()=>{},warn:()=>{}};function Hs(e){return e??Zv.homedir()}function Jd(e,t){return t?`${e}-${t}`:e}function Xd(e,t){return Ft.join(Hs(e),Jd(Wd,t))}function Qd(e,t){return Ft.join(Hs(e),Jd(Hd,t))}function Ys(e){try{let t=Y.lstatSync(e);return t.isSymbolicLink()?{kind:"link"}:t.isDirectory()?{kind:"directory"}:{kind:"other"}}catch(t){let n=t.code;return n==="ENOENT"||n==="ENOTDIR"?{kind:"missing"}:{kind:"inaccessible",error:t}}}function Vs(e){let t=Ft.resolve(e);return process.platform==="win32"?(t=t.replace(/^\\\\\?\\/,""),t.toLowerCase()):t}function Js(e,t){try{let n=Y.readlinkSync(e),i=Vs(t);return Vs(Ft.resolve(Ft.dirname(e),n))===i||Vs(n)===i}catch{return!1}}function cr(e,t,n){if(!Js(e,t))try{Y.symlinkSync(t,e,process.platform==="win32"?"junction":"dir")}catch(i){n.warn(`Failed to create compat link ${e} -> ${t}: ${String(i)}`)}}function Ud(e,t,n){if(t.kind==="missing")return!0;if(t.kind==="link"||t.kind==="other")try{return Y.unlinkSync(e),!0}catch(i){return n.warn(`Failed to remove ${e} before creating compat link: ${String(i)}`),!1}return!1}function Gs(e){try{let t=Y.readdirSync(e);if(t.length===0)return"empty";if(t.length===1&&t[0]==="workspace")try{return Y.readdirSync(Ft.join(e,"workspace")).length>0?"hasData":"empty"}catch{return"unknown"}return"hasData"}catch{return"unknown"}}function Ws(e){try{return Y.statSync(e).isDirectory()?Gs(e):void 0}catch{return"unknown"}}function tA(e,t){return`${e}.backup-${t()}`}function nA(e,t,n){let i=tA(e,n);try{return Y.renameSync(e,i),t.warn(`Backed up legacy data dir ${e} -> ${i}`),!0}catch(r){return t.warn(`Failed to back up legacy data dir ${e}: ${String(r)}`),!1}}function iA(e,t,n,i){if(Js(e,t))return!0;let r=Ys(e);if(r.kind==="missing")return!0;if(r.kind==="link"){let o=Ws(e);return o==="hasData"||o==="unknown"?(n.warn(`Cannot replace legacy data dir symlink ${e}; it may point to real data outside ${t}`),!1):Ud(e,r,n)}return r.kind==="other"?Ud(e,r,n):r.kind==="directory"?nA(e,n,i):(n.warn(`Cannot replace inaccessible legacy data dir ${e}; leaving it untouched`),!1)}function Kd(e,t,n,i){iA(e,t,n,i)&&cr(e,t,n)}function rA(e,t){try{return Y.rmSync(e,{recursive:!0,force:!1}),!0}catch(n){return t.warn(`Failed to remove empty primary data dir ${e}: ${String(n)}`),!1}}function Vd(e,t,n){try{return Y.renameSync(e,t),n.info(`Migrated legacy data dir ${e} -> ${t}`),!0}catch(i){return n.warn(`Failed to migrate legacy data dir ${e} -> ${t}: ${String(i)}`),!1}}function oA(e,t,n,i){try{Y.cpSync(e,n,{recursive:!0,errorOnExist:!0,force:!1}),Y.unlinkSync(t);try{Y.rmSync(e,{recursive:!0,force:!1})}catch(r){i.warn(`Copied legacy symlink data dir ${e} -> ${n}, but failed to remove old target: ${String(r)}`)}return i.info(`Copied legacy data dir symlink target ${e} -> ${n}`),!0}catch(r){try{Y.existsSync(n)&&Y.rmSync(n,{recursive:!0,force:!0})}catch(o){i.warn(`Failed to clean up partial primary data dir ${n}: ${String(o)}`)}return i.warn(`Failed to copy legacy symlink data dir ${t} -> ${n}: ${String(r)}`),!1}}function Yd(e,t,n){try{let i=Y.realpathSync(e);try{Y.renameSync(i,t)}catch(r){if(r.code==="EXDEV")return oA(i,e,t,n);throw r}return Y.unlinkSync(e),n.info(`Migrated legacy data dir symlink target ${i} -> ${t}`),!0}catch(i){return n.warn(`Failed to migrate legacy symlink data dir ${e} -> ${t}: ${String(i)}`),!1}}function Gd(e,t){try{return Y.mkdirSync(e,{recursive:!0}),!0}catch(n){return t.warn(`Failed to create primary data dir ${e}: ${String(n)}`),!1}}function sA(e,t,n,i){let r=Ys(e),o=Ys(t);if(r.kind==="inaccessible")return n.warn(`Primary data dir ${e} is inaccessible; not treating it as missing`),e;if(r.kind==="directory"){let s=Gs(e),a=o.kind==="directory"?Gs(t):o.kind==="link"?Ws(t)??"empty":"empty";if(s==="empty"){if(o.kind==="inaccessible"||a==="unknown")return n.warn(`Legacy data dir ${t} may contain data but is inaccessible; not using empty primary ${e}`),t;if((o.kind==="directory"||o.kind==="link")&&a==="hasData"){if(!rA(e,n))return t;if(o.kind==="link"){if(!Yd(t,e,n))return t}else if(!Vd(t,e,n))return t;return cr(t,e,n),e}}return Kd(t,e,n,i),e}if(Js(t,e))return Gd(e,n),e;if(o.kind==="directory")return Vd(t,e,n)?(cr(t,e,n),e):t;if(o.kind==="link"){let s=Ws(t);if(s==="hasData")return Yd(t,e,n)?(cr(t,e,n),e):t;if(s==="unknown")return n.warn(`Legacy data dir symlink ${t} target is inaccessible; not treating it as missing`),t}return o.kind==="inaccessible"?(n.warn(`Legacy data dir ${t} is inaccessible; not treating it as missing`),t):r.kind==="link"||r.kind==="other"?(n.warn(`Primary data dir path ${e} exists but is not a directory; using it without migration`),e):(Gd(e,n),Kd(t,e,n,i),e)}function Ye(e={}){let t=Hs(e.homeDir),n=e.profile??null;return sA(Xd(t,n),Qd(t,n),e.logger??eA,e.nowMs??Date.now)}function aA(e,t){return Ye({homeDir:e,logger:t})}function lA(e,t,n){return Ye({homeDir:t,profile:e,logger:n})}var ta=["read","write","edit","bash","task_query","task_output","task_stop","grep","glob","todowrite","web_fetch","website_deploy","workspace_semantic_search"],na=["images_understand","image_synthesize","images_search_and_download","image_reverse_search","submit_video_generation","query_video_generation","gen_videos","batch_text_to_video","batch_image_to_video","get_voice_list","batch_text_to_audio","batch_text_to_music","synthesize_speech","batch_synthesize_speech","audios_understand","videos_understand","transcribe_audio"],ia=["code-review","deep-research","deploy-website","docx","edit-deployed-website","init","lark-tools","llm-call","mcode-tools-master","mavis-doctor","pdf","plugin-creator","pptx","skill-creator","skill-refiner","visual-page","x-link-reader","xlsx"],ep=["control-in-app-browser","resume-codex","mavis","create-agent","minimax-code-product","miniapp-creator"],cA=new Set(["modelConfigId","persona","tools","builtinTools","skills","features"]),uA=new Set(["enabled"]),Zs=new Set(["mavis","delegation","webSearch"]),tp=new Set(ta),zd=["task_query","task_output","task_stop"],np=new Set(na),ea=new Set(ia),ip=new Set(ep),fA=new Set(["plan-mode"]);function ra(e){let t=ur(e),n=ur(t?.default);return{default:n?pA(n):{}}}function dA(e,t="agent"){if(e===void 0)return{};let n=Qs(e,t);zs(n,cA,t);let i={};if(n.modelConfigId!==void 0&&((typeof n.modelConfigId!="string"||!n.modelConfigId.trim())&&ce(`${t}.modelConfigId`,"must be a non-empty string"),i.modelConfigId=n.modelConfigId.trim()),n.persona!==void 0){let r=Qs(n.persona,`${t}.persona`);zs(r,uA,`${t}.persona`),r.enabled!==void 0&&typeof r.enabled!="boolean"&&ce(`${t}.persona.enabled`,"must be a boolean"),i.persona={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{}}}if(n.tools!==void 0&&(Array.isArray(n.tools)||ce(`${t}.tools`,"must be an array"),i.tools=n.tools.map((r,o)=>((typeof r!="string"||!tp.has(r))&&ce(`${t}.tools[${o}]`,`must be one of ${ta.join(", ")}`),r))),n.builtinTools!==void 0&&(Array.isArray(n.builtinTools)||ce(`${t}.builtinTools`,"must be an array"),i.builtinTools=n.builtinTools.map((r,o)=>(r==="web_search"&&ce(`${t}.builtinTools[${o}]`,"web_search is feature-owned; use features.webSearch"),(typeof r!="string"||!np.has(r))&&ce(`${t}.builtinTools[${o}]`,`must be one of ${na.join(", ")}`),r))),n.skills!==void 0&&(Array.isArray(n.skills)||ce(`${t}.skills`,"must be an array"),i.skills=n.skills.map((r,o)=>{if(typeof r=="string"&&ip.has(r.trim())){let s=r.trim();ce(`${t}.skills[${o}]`,`${s} is capability-owned; use its owning Tool or feature switch`)}return(typeof r!="string"||!ea.has(r.trim()))&&ce(`${t}.skills[${o}]`,`must be one of ${ia.join(", ")}`),r.trim()})),n.features!==void 0){let r=Qs(n.features,`${t}.features`);zs(r,Zs,`${t}.features`);for(let o of Zs)r[o]!==void 0&&typeof r[o]!="boolean"&&ce(`${t}.features.${o}`,"must be a boolean");i.features={...typeof r.mavis=="boolean"?{mavis:r.mavis}:{},...typeof r.delegation=="boolean"?{delegation:r.delegation}:{},...typeof r.webSearch=="boolean"?{webSearch:r.webSearch}:{}}}return i}function pA(e){let t={};typeof e.modelConfigId=="string"&&e.modelConfigId.trim()&&(t.modelConfigId=e.modelConfigId.trim());let n=ur(e.persona);if(typeof n?.enabled=="boolean"&&(t.persona={enabled:n.enabled}),Zd(e.tools,tp)){let r=[...e.tools];zd.some(o=>r.includes(o))||r.push(...zd),t.tools=r}if(Zd(e.builtinTools,np)&&(t.builtinTools=[...e.builtinTools]),Array.isArray(e.skills)){let r=e.skills.map(o=>typeof o=="string"?o.trim():o);r.every(o=>typeof o=="string"&&(ea.has(o)||fA.has(o))&&!ip.has(o))&&(t.skills=r.filter(o=>typeof o=="string"&&ea.has(o)))}let i=ur(e.features);if(i){let r={};for(let o of Zs)typeof i[o]=="boolean"&&(r[o]=i[o]);Object.keys(r).length>0&&(t.features=r)}return t}function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function Zd(e,t){return Array.isArray(e)&&e.every(n=>typeof n=="string"&&t.has(n))}function mA(e={},t={}){return{persona:{enabled:t.persona?.enabled??e.persona?.enabled??!0},tools:Xs(t.tools??e.tools),builtinTools:Xs(t.builtinTools??e.builtinTools),skills:Xs(t.skills??e.skills),features:{mavis:t.features?.mavis??e.features?.mavis??!0,delegation:t.features?.delegation??e.features?.delegation??!0,webSearch:t.features?.webSearch??e.features?.webSearch??!0}}}function hA(e,t){return e.tools===void 0||e.tools.includes(t)}function yA(e,t){return e.builtinTools===void 0||e.builtinTools.includes(t)}function gA(e,t){return e.skills===void 0||e.skills.includes(t)}function Xs(e){return e===void 0?void 0:[...e]}function Qs(e,t){return(e==null||typeof e!="object"||Array.isArray(e))&&ce(t,"must be an object"),e}function zs(e,t,n){for(let i of Object.keys(e))t.has(i)||ce(`${n}.${i}`,"is not supported")}function ce(e,t){throw new Error(`Invalid configuration at ${e}: ${t}`)}var oa={enabled:!0};function rp(e,t=oa){let n=e.askUser;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled}}var Ge={enabled:!0,enabledSource:"default"};function sa(e,t=Ge){let n=e.dataContribution;if(n==null||typeof n!="object"||Array.isArray(n))return{...t,enabledSource:"default"};let i=n,r=typeof i.enabled=="boolean";return{enabled:r?i.enabled:t.enabled,enabledSource:r?"explicit":"default"}}function op(e){try{let t=e()?.dataContribution?.enabled;return typeof t=="boolean"?t:Ge.enabled}catch{return Ge.enabled}}var lp=["none","evaluator","subagent"],cp=["brief","transcript"],up=["same-route-small-fast"],fp="goal-verifier-readonly",dp=[fp],he={budget:{graceSteps:1},breaker:{repeatedReplyLimit:3},verifier:{repeatedNotMetLimit:5,evidence:"brief"},evaluator:{modelPolicy:"same-route-small-fast",maxTokens:32e3,timeoutSeconds:60,maxRetries:1}},aa={budget:{graceSteps:3},evaluator:{maxRetries:1}};function la(e){let t=[],n=Bt(e,"goal",t);qt(n,"goal",t,["objectiveMaxChars","verification","budget","breaker","verifier","evaluator","subagent"]);let i=Bt(n.budget,"goal.budget",t);qt(i,"goal.budget",t,["defaultTokens","defaultMainTurns","defaultActiveSeconds","graceSteps"]);let r=Bt(n.breaker,"goal.breaker",t);qt(r,"goal.breaker",t,["repeatedReplyLimit"]);let o=Bt(n.verifier,"goal.verifier",t);qt(o,"goal.verifier",t,["repeatedNotMetLimit","evidence"]);let s=Bt(n.evaluator,"goal.evaluator",t);qt(s,"goal.evaluator",t,["modelPolicy","maxTokens","timeoutSeconds","maxRetries"]);let a=Bt(n.subagent,"goal.subagent",t);qt(a,"goal.subagent",t,["profile","maxTurns","maxTokens","timeoutSeconds"]);let l=ap(n.verification,"goal.verification",lp,t),c=ut(n.objectiveMaxChars,"goal.objectiveMaxChars",t,{min:1}),u=ut(i.defaultTokens,"goal.budget.defaultTokens",t,{min:1}),f=ut(i.defaultMainTurns,"goal.budget.defaultMainTurns",t,{min:1}),d=ut(i.defaultActiveSeconds,"goal.budget.defaultActiveSeconds",t,{min:1}),p=ap(a.profile,"goal.subagent.profile",dp,t),y=ut(a.maxTurns,"goal.subagent.maxTurns",t,{min:1}),m=ut(a.maxTokens,"goal.subagent.maxTokens",t,{min:1}),h=ut(a.timeoutSeconds,"goal.subagent.timeoutSeconds",t,{min:1}),g={...p!==void 0?{profile:p}:{},...y!==void 0?{maxTurns:y}:{},...m!==void 0?{maxTokens:m}:{},...h!==void 0?{timeoutSeconds:h}:{}};return{config:{...c!==void 0?{objectiveMaxChars:c}:{},...l!==void 0?{verification:l}:{},budget:{...u!==void 0?{defaultTokens:u}:{},...f!==void 0?{defaultMainTurns:f}:{},...d!==void 0?{defaultActiveSeconds:d}:{},graceSteps:$t(i.graceSteps,"goal.budget.graceSteps",he.budget.graceSteps,t,{min:0,max:aa.budget.graceSteps})},breaker:{repeatedReplyLimit:$t(r.repeatedReplyLimit,"goal.breaker.repeatedReplyLimit",he.breaker.repeatedReplyLimit,t,{min:1})},verifier:{repeatedNotMetLimit:$t(o.repeatedNotMetLimit,"goal.verifier.repeatedNotMetLimit",he.verifier.repeatedNotMetLimit,t,{min:1}),evidence:sp(o.evidence,"goal.verifier.evidence",cp,he.verifier.evidence,t)},evaluator:{modelPolicy:sp(s.modelPolicy,"goal.evaluator.modelPolicy",up,he.evaluator.modelPolicy,t),maxTokens:$t(s.maxTokens,"goal.evaluator.maxTokens",he.evaluator.maxTokens,t,{min:1}),timeoutSeconds:$t(s.timeoutSeconds,"goal.evaluator.timeoutSeconds",he.evaluator.timeoutSeconds,t,{min:1}),maxRetries:$t(s.maxRetries,"goal.evaluator.maxRetries",he.evaluator.maxRetries,t,{min:0,max:aa.evaluator.maxRetries})},...Object.keys(g).length>0?{subagent:g}:{}},warnings:t}}function Bt(e,t,n){return e===void 0?{}:e===null||typeof e!="object"||Array.isArray(e)?(n.push(We(t,"expected an object; using defaults")),{}):e}function qt(e,t,n,i){for(let r of Object.keys(e))i.includes(r)||n.push(We(`${t}.${r}`,"unknown key ignored"))}function $t(e,t,n,i,r){return e==null?n:!Number.isInteger(e)||e<r.min?(i.push(We(t,`expected an integer >= ${r.min}; using default`)),n):r.max!=null&&e>r.max?(i.push(We(t,`exceeds maximum ${r.max}; clamped`)),r.max):e}function ut(e,t,n,i){if(e!=null){if(!Number.isInteger(e)||e<i.min){n.push(We(t,`expected an integer >= ${i.min}; ignored`));return}return i.max!=null&&e>i.max?(n.push(We(t,`exceeds maximum ${i.max}; clamped`)),i.max):e}}function sp(e,t,n,i,r){return e==null?i:typeof e!="string"||!n.includes(e)?(r.push(We(t,`expected one of: ${n.join(", ")}; using default`)),i):e}function ap(e,t,n,i){if(e!=null){if(typeof e!="string"||!n.includes(e)){i.push(We(t,`expected one of: ${n.join(", ")}; ignored`));return}return e}}function We(e,t){return`Invalid goal config at ${e}: ${t}`}var Ae={enabled:!0,maxInlineKiB:64,mcpDetailsMaxInlineKiB:32,watermarkKiB:256,minSavingsKiB:256,minCandidateKiB:2,keepRecentRounds:5},bA=Math.floor(Number.MAX_SAFE_INTEGER/1024);function ca(e){let t=vA(e)?e:{};return{enabled:typeof t.enabled=="boolean"?t.enabled:Ae.enabled,maxInlineKiB:Mn(t.maxInlineKiB,Ae.maxInlineKiB),mcpDetailsMaxInlineKiB:Mn(t.mcpDetailsMaxInlineKiB,Ae.mcpDetailsMaxInlineKiB),watermarkKiB:Mn(t.watermarkKiB,Ae.watermarkKiB),minSavingsKiB:Mn(t.minSavingsKiB,Ae.minSavingsKiB),minCandidateKiB:Mn(t.minCandidateKiB,Ae.minCandidateKiB),keepRecentRounds:SA(t.keepRecentRounds,Ae.keepRecentRounds)}}function Mn(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0&&e<=bA?e:t}function SA(e,t){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:t}function vA(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nn={};function ua(e){if(e==null||typeof e!="object"||Array.isArray(e))return{...Nn};let t=Reflect.get(e,"chromePath");return typeof t!="string"||!t.trim()?{...Nn}:{chromePath:t.trim()}}import{isIP as AA}from"node:net";function pp(e){return{enabled:!1,filesystemMode:"full_access"}}function mp(e){return!e.enabled||e.filesystemMode==="full_access"?{enabled:!1,filesystemMode:"full_access"}:{...e}}function da(e){let t=pp(e);return{enabled:t.enabled,filesystem:{policy:{mode:t.filesystemMode},denyRead:[],denyWrite:[]},network:{policy:{mode:"allow_all"},deniedDomains:[]},localAccess:"open"}}var pa=da(process.platform),wA=new Set(["read_only","workspace_write","delete_guard","full_access"]),_A=new Set(["deny","allow_all"]);function ma(e,t=process.platform){let n=da(t);if(e===void 0)return n;let i=Pn(e,"sandbox",["enabled","filesystem","network","localAccess"]),r=i.filesystem===void 0?{}:Pn(i.filesystem,"sandbox.filesystem",["policy","denyRead","denyWrite","allowGitConfig"]),o=r.policy===void 0?{}:Pn(r.policy,"sandbox.filesystem.policy",["mode"]),s=i.network===void 0?{}:Pn(i.network,"sandbox.network",["policy","deniedDomains"]),a=s.policy===void 0?{}:Pn(s.policy,"sandbox.network.policy",["mode"]),l=i.enabled===void 0?n.enabled:EA(i.enabled,"sandbox.enabled"),c=o.mode??(l?"delete_guard":"full_access");if(typeof c!="string"||!wA.has(c))throw new Error(`Invalid sandbox.filesystem.policy.mode "${String(c)}"`);let u=a.mode??n.network.policy.mode;if(typeof u!="string"||!_A.has(u))throw new Error(`Invalid sandbox.network.policy.mode "${String(u)}"`);let f=s.deniedDomains===void 0?[...n.network.deniedDomains]:fa(s.deniedDomains,"sandbox.network.deniedDomains");for(let p of f)xA(p);let d=mp({enabled:l,filesystemMode:c});return{enabled:d.enabled,filesystem:{policy:{mode:d.filesystemMode},denyRead:r.denyRead===void 0?[...n.filesystem.denyRead]:fa(r.denyRead,"sandbox.filesystem.denyRead"),denyWrite:r.denyWrite===void 0?[...n.filesystem.denyWrite]:fa(r.denyWrite,"sandbox.filesystem.denyWrite")},network:{policy:{mode:"allow_all"},deniedDomains:[]},localAccess:i.localAccess===void 0?n.localAccess:i.localAccess==="open"||i.localAccess==="restricted"?i.localAccess:(()=>{throw new Error(`Invalid sandbox.localAccess "${String(i.localAccess)}"`)})()}}function Pn(e,t,n){if(e==null||typeof e!="object"||Array.isArray(e))throw new Error(`Invalid ${t}: expected object`);let i=e,r=Object.keys(i).find(o=>!n.includes(o));if(r)throw new Error(`Unknown ${t}.${r}`);return i}function EA(e,t){if(typeof e!="boolean")throw new Error(`Invalid ${t}: expected boolean`);return e}function fa(e,t){if(!Array.isArray(e)||e.some(n=>typeof n!="string"))throw new Error(`Invalid ${t}: expected string array`);return[...e]}function xA(e){let t=()=>{throw new Error(`Invalid sandbox.network.deniedDomains entry "${e}"`)},n=e.match(/^\[([^\]]+)\](?::(.+))?$/);if(n){AA(n[1]??"")!==6&&t(),hp(n[2],e);return}(e.match(/:/g)??[]).length>1&&t();let i=e.lastIndexOf(":"),r=i>-1?e.slice(0,i):e,o=i>-1?e.slice(i+1):void 0;hp(o,e),r!=="*"&&(kA(r)||t())}function kA(e){if(e.includes("://")||e.includes("/")||e.includes(":"))return!1;if(e==="localhost")return!0;if(e.startsWith("*.")){let n=e.slice(2).split(".");return n.length>=2&&n.every(i=>i.length>0)}return e.includes("*")?!1:e.includes(".")&&!e.startsWith(".")&&!e.endsWith(".")}function hp(e,t){if(e===void 0)return;let n=Number(e);if(!/^[1-9][0-9]{0,4}$/.test(e)||!Number.isInteger(n)||n>65535)throw new Error(`Invalid sandbox.network.deniedDomains entry "${t}"`)}var fr={maxConcurrentPerSession:4};function ha(e){let n=(e!=null&&typeof e=="object"&&!Array.isArray(e)?e:{}).maxConcurrentPerSession;return{maxConcurrentPerSession:typeof n=="number"&&Number.isSafeInteger(n)&&n>0?n:fr.maxConcurrentPerSession}}function yp(e,t){return t.length===0?!1:t.includes("*")?!0:t.includes(e)}function IA(){return process.env.__MAVIS_ALLOW_LEGACY_RUNTIME_ENV==="1"}var gp={dev:"test",test:"test",staging:"staging",prod:"prod"};function LA(e){return e==="cn"||e==="en"}function Ep(e){return e==="test"||e==="prod"||e==="dev"||e==="staging"}function xp(){let e=process.env.MAVIS_REGION;if(LA(e))return e;if(pr()){let t=process.env.NEXT_PUBLIC_LOCALE;if(t==="zh")return"cn";if(t==="en")return"en"}return"en"}function Te(){let e=process.env.MAVIS_BUILD_ENV;if(Ep(e))return e;if(pr()){let t=process.env.NEXT_PUBLIC_BUILD_ENV,n=t&&Object.prototype.hasOwnProperty.call(gp,t)?gp[t]:void 0;if(n)return n}return"dev"}function dr(){if(Cp("managed"))return!0;let e=process.env.__MAVIS_RUNTIME_MANAGED;return e==="1"?!0:e==="0"?!1:!!(pr()||Te()==="prod"||Te()==="staging")}function pr(){let e=process.versions;return process.env.ELECTRON_RUN_AS_NODE==="1"||typeof e.electron=="string"}function mr(){return`${xp()}-${Te()}`}var Ce={none:0,test:1,internal:2,online:3},MA={internal:"internal",inside:"online"};function NA(e){for(let[t,n]of Object.entries(e)){if(Ce[n.defaultVisibility]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultVisibility (${n.defaultVisibility}) must not exceed configurableVisibility (${n.configurableVisibility})`);for(let i of n.defaultBuildVariants??[]){let r=MA[i];if(Ce[r]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultBuildVariant (${i}) must not exceed configurableVisibility (${n.configurableVisibility})`)}for(let i of n.defaultBuildEnvironments??[])if(Ce[i==="prod"?"online":"test"]>Ce[n.configurableVisibility])throw new Error(`Invalid beta feature definition "${t}": defaultBuildEnvironment (${i}) must not exceed configurableVisibility (${n.configurableVisibility})`)}}var Dn={autoMemory:{defaultVisibility:"online",configurableVisibility:"online"},skillEvolve:{defaultVisibility:"test",configurableVisibility:"online"},skillEvolveBuiltinMr:{defaultVisibility:"none",configurableVisibility:"test"},skillProposal:{defaultVisibility:"test",configurableVisibility:"online"},browserBridge:{defaultVisibility:"test",configurableVisibility:"online"},filePanelBrowser:{defaultVisibility:"online",configurableVisibility:"online"},filePanelBrowserMultiTab:{defaultVisibility:"online",configurableVisibility:"online"},browserUseTooling:{defaultVisibility:"online",configurableVisibility:"online"},browserUseAutoOpenPanel:{defaultVisibility:"online",configurableVisibility:"online"},browserAgentCursor:{defaultVisibility:"online",configurableVisibility:"online"},desktopPlanMode:{defaultVisibility:"online",configurableVisibility:"online"},desktopPlanModeAgentEntry:{defaultVisibility:"none",configurableVisibility:"online"},peek:{defaultVisibility:"test",configurableVisibility:"test"},keepAlive:{defaultVisibility:"test",configurableVisibility:"test"},promptOverride:{defaultVisibility:"test",configurableVisibility:"test"},asr:{defaultVisibility:"online",configurableVisibility:"online"},taskHistoryProjectGrouping:{defaultVisibility:"online",configurableVisibility:"online"},threadGoal:{defaultVisibility:"online",configurableVisibility:"online"},mcodeTools:{defaultVisibility:"none",defaultBuildEnvironments:["dev","test","staging","prod"],defaultPlatforms:["darwin","linux","win32"],configurableVisibility:"online"},codexOAuth:{defaultVisibility:"none",defaultBuildEnvironments:["dev"],defaultBuildVariants:["internal"],configurableVisibility:"online"}};NA(Dn);function PA(e){return(e.buildEnv??Te())!=="prod"?"test":e.internalBuild===!0?"internal":"online"}function RA(e,t){let n=e.defaultBuildVariants;return n?t.internalBuild===!0&&n.includes("internal")||t.insideBuild===!0&&n.includes("inside"):!1}function DA(e,t){let n=t.defaultBuildEnvironment??t.buildEnv??Sa();return e.defaultBuildEnvironments?.includes(n)===!0}function Sa(){let e=pr()?process.env.NEXT_PUBLIC_BUILD_ENV:void 0;return Ep(e)?e:Te()}function bp(e,t){return e.defaultPlatforms?.includes(t.platform??process.platform)!==!1}function va(e,t,n={}){let i=Dn[e],r=Ce[PA(n)],o=n.defaultBuildEnvironment??n.buildEnv??Sa();return e==="mcodeTools"&&o==="dev"&&n.mcodeToolsDevMode==="published"&&bp(i,n)?!0:t===!1?!1:t===!0?r<=Ce[i.configurableVisibility]:bp(i,n)?DA(i,n)||RA(i,n)?!0:r<=Ce[i.defaultVisibility]:!1}function FA(e){return Dn[e].configurableVisibility==="online"}function Aa(e=process.env){return e.__MAVIS_BUILD_INTERNAL==="true"}function BA(e=process.env){return e.__MAVIS_BUILD_INSIDE==="true"}var qA={APP_DIR:".minimax",ENV_PREFIX:"minimax",CLI_NAME:"minimax"},kp="__MAVIS_RUNTIME";function hr(e){return IA()?process.env[`${kp}_${e}`]:void 0}function yr(e){let t=`--${e}`;for(let n=2;n<process.argv.length;n++){let i=process.argv[n];if(i===t)return process.argv[n+1];if(i?.startsWith(`${t}=`))return i.slice(t.length+1)}}function Cp(e){let t=`--${e}`;return process.argv.slice(2).some(n=>n===t||n.startsWith(`${t}=`))}var jt=5321,ga=5001,ya=65535,Op=500,wa=2,$A=Op*wa,Tp=$A+wa,Sp=1,jA=new Set(["agent-archon","mavis"]),vp=(()=>{let t=new Uint32Array(256);for(let n=0;n<256;n++){let i=n<<24;for(let r=0;r<8;r++)i=(i&2147483648)!==0?79764919^i<<1:i<<1,i>>>=0;t[n]=i>>>0}return t})();function UA(e){let t=Buffer.from(`${e}
191
+ `,"utf-8"),n=0;for(let r of t)n=(vp[(n>>>24^r)&255]^n<<8)>>>0;let i=t.length;for(;i!==0;)n=(vp[(n>>>24^i&255)&255]^n<<8)>>>0,i>>>=8;return(n^4294967295)>>>0}function KA(e){return UA(e)%Op*wa+2}function Ap(e,t){try{let n=OA("git",e,{encoding:"utf-8",timeout:3e3,stdio:["ignore","pipe","pipe"],...t?{cwd:t}:{}});return n.status===0&&n.stdout?n.stdout.trim():null}catch{return null}}function VA(e){return e.match(/[/:]([^/:]+?)(?:\.git)?$/)?.[1]??null}function Ip(){return process.env.MINIMAX_DATA_DIR?.trim()||process.env.MAVIS_DATA_DIR?.trim()}function gr(){return!(Cp("disable-git-auto-config")||hr("DISABLE_GIT_AUTO_CONFIG")||yr("data-dir")||Ip())}function br(){let e=yr("profile")??hr("PROFILE");return e&&e.length>0?e:null}function Lp(){let e=yr("port")??hr("PORT"),t=e?parseInt(e,10):NaN;return Number.isNaN(t)?null:t}function ba(){let e=yr("data-dir")??Ip()??hr("DATA_DIR");return e&&e.length>0?e:null}function YA(){return!!(br()&&ba())}function Mp(){return!!(br()&&Lp()!==null)}var ft=null;function GA(){ft=null}function dt(){if(ft!==null)return ft;let e={runtimePort:jt,uiPort:ga,profile:null,autoDetected:!1};return ft=e,e}function WA(){try{if(typeof __dirname=="string")return __dirname}catch{}let e=new Error().stack??"";for(let t of e.split(`
192
+ `)){let n=/file:\/\/[^)\s]+/u.exec(t)?.[0]?.replace(/:\d+:\d+$/u,"");if(n)try{return oe.dirname(TA(n))}catch{}let i=/\(?((?:\/|[A-Za-z]:\\)[^()]+?\.(?:cjs|mjs|js|ts)):\d+:\d+\)?/u.exec(t)?.[1];if(i)return oe.dirname(i)}}function HA(){let e=br();return e||(gr()?dt().profile:null)}function _a(){let e=br();if(YA())return ba();if(gr()){let n=dt();if(n.autoDetected&&n.profile)return Ye({profile:n.profile})}let t=ba();return t||(e?Ye({profile:e}):Ye())}function Ut(){return oe.join(_a(),"config.yaml")}var wp={support_files_api:!0,files_api_upload_endpoint:"/v1/files/upload",max_image_bytes_inline:10485760,max_video_bytes_inline:52428800,max_request_body_bytes:67108864,max_attachments_count:4},Np={"MiniMax-M3":{name:"MiniMax-M3",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text","image","video"],output:["text"]},limit:{context:512e3,output:128e3},contextWindowOptions:[512e3,1e6],contextWindowOptionHints:{1e6:"higher_usage"},options:{reasoningSummary:"auto"},thinking_config:{mode:"switchable",default_value:"true"},variants:{"none-thinking":{thinking:{type:"disabled"}},thinking:{thinking:{type:"adaptive"}}},capabilities:wp},"MiniMax-M3.1-Flash-Preview":{name:"M3.1-Flash-Preview",attachment:!0,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text","image","video"],output:["text"]},limit:{context:512e3,output:128e3},contextWindowOptions:[512e3,1e6],contextWindowOptionHints:{1e6:"higher_usage"},options:{reasoningSummary:"auto"},thinking:{effortOptions:["default","low","medium","high","xhigh","max"],defaultEffort:"default"},thinking_config:{mode:"forced_on"},variants:{"none-thinking":{thinking:{type:"disabled"}},thinking:{thinking:{type:"adaptive"}}},capabilities:wp},"MiniMax-M2.7-highspeed":{name:"MiniMax-M2.7-highspeed",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text"],output:["text"]},limit:{context:2e5,output:128e3}},"MiniMax-M2.7":{name:"MiniMax-M2.7",attachment:!1,reasoning:!0,tool_call:!0,temperature:!0,modalities:{input:["text"],output:["text"]},limit:{context:2e5,output:128e3}}},Kt=Np,Sr={"cn-test":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","cn-dev":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","cn-staging":"https://agent.minimaxi.com/mavis/api/v1/llm/v1","en-test":"https://agent.minimax.io/mavis/api/v1/llm/v1","en-dev":"https://agent.minimax.io/mavis/api/v1/llm/v1","en-staging":"https://agent.minimax.io/mavis/api/v1/llm/v1","cn-prod":"https://agent.minimax.cn/mavis/api/v1/llm/v1","en-prod":"https://agent.minimax.io/mavis/api/v1/llm/v1"},Pp=["https://agent.minimaxi.com/mavis/api/v1/llm/v1"],JA=new Set([...Object.values(Sr),...Pp]),XA=new Set([...Object.values(Sr),...Pp].map(e=>new URL(e).origin));function Rp(e){if(JA.has(e))return!0;try{let t=new URL(e);return!t.username&&!t.password&&XA.has(t.origin)}catch{return!1}}function Dp(){return Te()==="test"}function QA(){return!Dp()}function zA(e){if(!dr()||!Oe.existsSync(e))return;let t=Fp(e),{provider:n}=t;if(n==null||typeof n!="object"||Array.isArray(n))return;let{minimax:i}=n;if(i==null||typeof i!="object"||Array.isArray(i))return;let{options:r}=i;if(r==null||typeof r!="object"||Array.isArray(r))return;let o=r.baseURL;if(typeof o!="string")return;let s=Sr[mr()];if(o===s||!Rp(o))return;let a=Oe.readFileSync(e);r.baseURL=s;try{let l=a.toString("utf-8");it(e,Ln(l,er(l),t))}catch(l){let c=!1;try{c=Oe.readFileSync(e).equals(a)}catch{}if(!c)throw l;console.warn("[config] managed preset baseURL sync skipped; config file unchanged, using runtime provider settings")}}function He(e){return{provider:{minimax:{name:"MiniMax",npm:"@ai-sdk/anthropic",options:{authMode:"managed-login",apiKey:"sk-xxx",baseURL:Sr[e]},models:Np}},defaultModel:"minimax/MiniMax-M3"}}var Ea={"cn-test":He("cn-test"),"cn-dev":He("cn-dev"),"cn-staging":He("cn-staging"),"cn-prod":He("cn-prod"),"en-test":He("en-test"),"en-dev":He("en-dev"),"en-staging":He("en-staging"),"en-prod":He("en-prod")},J={logLevel:"info",devPort:ga,permissionMode:"auto",sseErrorPush:{history:!0,stream:!0},beta:Object.fromEntries(Object.keys(Dn).map(e=>[e,va(e,void 0,{buildEnv:"dev"})])),agents:{default:{}},memory:{enabled:!0,proactive:!1,dailyDigest:{enabled:!1},v2:{...tr}},subagent:{...fr},skillEvolve:{enabled:!0,inSession:{N:20,minIntervalSeconds:30,maxPendingPerSession:1},signalCooldownHours:24,minConfidence:.7,excludeAgents:["skill-editor"],disableModelPrefixes:["MiniMax-M2"],builtinMrEnabled:!1,sourceRepo:void 0,proposal:{enabled:!1,eligibleAgents:["mavis"],minMessageCount:40,skipPassiveSessionEnd:!0},lifecycle:{staleThresholdDays:15,archiveThresholdDays:30}},sessionRotate:{enabled:!0,activeSessionLookbackHours:12},agentStop:{debounceMs:500,maxActiveSpanMs:1800*1e3},asr:{...sr},skills:lr,askUser:{...oa},dataContribution:{...Ge},sessionTitle:{enabled:!0},cli:{spawn:{enabled:!1}},browser:{...Nn},tui:{},opencode:{xdg:{dataIsolation:!1,startupImport:"off"},keepAlive:{enabled:!1,maxProcesses:5,maxLifetimeMs:288e5,agents:["mavis","main","verifier","code-reviewer"]},spawnConcurrency:3},contextManagement:{disableSystemReminderModels:[],cuMaxScreenshotsInContext:2},runawayGuard:{enabled:!0},toolResultCompaction:{...Ae},agentRuntime:{defaultFramework:Dt},logRetentionDays:3,review:{mode:"subagent",turnDiffCard:"concise",modeSource:"default"},goal:structuredClone(he),sandbox:structuredClone(pa),goalWarnings:[]};function ZA(){let e=Ut(),t=oe.dirname(e);if(Oe.existsSync(t)||Oe.mkdirSync(t,{recursive:!0}),Oe.existsSync(e)){ka(e);return}if(!dr()){let r=Ye({homeDir:CA.homedir()}),o=oe.join(r,"config.yaml");e!==o&&Oe.existsSync(o)&&(_t(o),it(e,Oe.readFileSync(o),!0));return}let n=Ea[mr()],i=W.dump({logLevel:J.logLevel,provider:xa?n.provider:void 0,defaultModel:n.defaultModel,dataContribution:{enabled:Ge.enabled},memory:{enabled:!1}});it(e,i,!0)}function Fp(e=Ut()){return er(ew(e))}function ew(e=Ut()){try{return Oe.readFileSync(e,"utf-8")}catch{return""}}var Rn=null;function tw(e){if(e==null||typeof e!="object"||Array.isArray(e))return;let t=e;return{branchFinish:typeof t.branchFinish=="boolean"?t.branchFinish:!1}}var Bp={isManagedRuntime:dr,shouldEnforceManagedProviderProtection:QA,getManagedPreset:()=>Ea[mr()],isManagedPresetBaseUrl:Rp},qp=!0,xa=!0;function nw(e){qp=e}function iw(e){xa=e}function ka(e){_t(e),Nd(e),qp&&Ld(e,Bp),xa&&zA(e)}function vr(){Rn=null}function Ar(){if(Rn)return Rn;ZA();let e=Fp();return Rn=Ca(e,_a()),Rn}function Ca(e,t){let n=e.sseErrorPush,i=n!=null&&typeof n=="object"&&!Array.isArray(n)?n:void 0,r=typeof e.devPort=="number"?e.devPort:J.devPort;if(gr()&&!Mp()){let c=dt();c.autoDetected&&(r=c.uiPort)}let o=la(e.goal),s=Md({provider:e.provider!=null&&typeof e.provider=="object"&&!Array.isArray(e.provider)?Cd(e.provider):{},defaultModel:typeof e.defaultModel=="string"?e.defaultModel:void 0},Bp),a=js(e.minimaxModelContextLimits),l=rw(e);return{logLevel:typeof e.logLevel=="string"?e.logLevel:J.logLevel,devPort:r,...s,provider:xd(s.provider,a),defaultModelVariant:typeof e.defaultModelVariant=="string"?e.defaultModelVariant:void 0,defaultModelThinking:e.defaultModelThinking&&typeof e.defaultModelThinking=="object"&&typeof e.defaultModelThinking.effort=="string"?{effort:e.defaultModelThinking.effort}:void 0,defaultModelContextWindow:Number.isSafeInteger(e.defaultModelContextWindow)&&Number(e.defaultModelContextWindow)>0&&Number(e.defaultModelContextWindow)<=2147483647?Number(e.defaultModelContextWindow):void 0,minimax_api:Ed(e.minimax_api),minimaxModelContextLimits:a,custom_provider:kd(e.custom_provider),minimaxModelSource:typeof e.minimaxModelSource=="string"&&(e.minimaxModelSource==="token_plan"||e.minimaxModelSource==="minimax_api_key")?e.minimaxModelSource:void 0,nexus:e.nexus!=null&&typeof e.nexus=="object"&&!Array.isArray(e.nexus)?(()=>{let c={};typeof Reflect.get(e.nexus,"enabled")=="boolean"&&(c.enabled=Reflect.get(e.nexus,"enabled"));let u=Reflect.get(e.nexus,"model");return u!=null&&typeof u=="object"&&!Array.isArray(u)&&typeof Reflect.get(u,"providerID")=="string"&&typeof Reflect.get(u,"modelID")=="string"&&(c.model={providerID:Reflect.get(u,"providerID"),modelID:Reflect.get(u,"modelID"),...typeof Reflect.get(u,"variant")=="string"?{variant:Reflect.get(u,"variant")}:{}}),Object.keys(c).length>0?c:void 0})():void 0,defaultLightModel:typeof e.defaultLightModel=="string"?e.defaultLightModel:void 0,permissionMode:typeof e.permissionMode=="string"&&["default","bypassPermissions","auto","off"].includes(e.permissionMode)?e.permissionMode:J.permissionMode,permission:Bd(e),sseErrorPush:{history:typeof i?.history=="boolean"?i.history:J.sseErrorPush.history,stream:typeof i?.stream=="boolean"?i.stream:J.sseErrorPush.stream},notifications:tw(e.notifications),dataDir:t,agentsDir:oe.join(t,"agents"),sessionsDir:oe.join(t,"sessions"),memoryDir:oe.join(t,"memory"),skillsDir:oe.join(t,"skills"),builtinSkillsDir:oe.join(t,".builtin-skills"),logsDir:oe.join(t,"logs"),pluginsDir:oe.join(t,"plugins"),plansDir:oe.join(t,"plans"),harnessesDir:oe.join(t,"harnesses"),subAgentsDir:oe.join(t,"subagents"),beta:l,agents:ra(e.agents),memory:vd(e,J.memory),subagent:ha(e.subagent),skillEvolve:aw(e,l),sessionRotate:lw(e),agentStop:cw(e),asr:Fd(e),skills:Us(e),askUser:rp(e,J.askUser),dataContribution:sa(e,J.dataContribution),sessionTitle:uw(e),cli:fw(e),browser:ua(e.browser),tui:Ad(e),opencode:Rd(e,J.opencode),contextManagement:dw(e),runawayGuard:no(e.runawayGuard),toolResultCompaction:ca(e.toolResultCompaction),agentRuntime:Ks(e.agentRuntime),logRetentionDays:pw(e),contentReview:mw(e),mcpToolSearch:hw(e),review:Pd(e.review,J.review),promptConfig:$p(e.promptConfig),goal:o.config,goalWarnings:o.warnings,sandbox:ma(e.sandbox)}}function rw(e){let t=e.beta!=null&&typeof e.beta=="object"&&!Array.isArray(e.beta)?e.beta:{},n={buildEnv:Te(),defaultBuildEnvironment:Sa(),internalBuild:Aa(),insideBuild:BA(),mcodeToolsDevMode:process.env.MAVIS_DEV_MCODE_TOOLS_MODE==="published"?"published":void 0},i={};for(let r of Object.keys(Dn))i[r]=va(r,t[r],n);return i}function ow(e){let t=e.provider;if(t==null||typeof t!="object"||Array.isArray(t))return[];let n=[];for(let i of Object.values(t)){if(i==null||typeof i!="object"||Array.isArray(i))continue;let{models:r}=i;r==null||typeof r!="object"||Array.isArray(r)||n.push(...Object.keys(r))}return n}function sw(e,t){if(t.length===0)return!0;let n=ow(e);if(n.length===0)return!1;let i=t.map(r=>r.toLowerCase());return!n.every(r=>i.some(o=>r.toLowerCase().startsWith(o)))}function _p(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}function aw(e,t){let n=J.skillEvolve,i=e.skillEvolve,o=i!=null&&typeof i=="object"&&!Array.isArray(i)?i:{},s=o.inSession,{inSession:a}=n;if(s!=null&&typeof s=="object"&&!Array.isArray(s)){let E=s;a={N:typeof E.N=="number"&&E.N>0?E.N:n.inSession.N,minIntervalSeconds:typeof E.minIntervalSeconds=="number"&&E.minIntervalSeconds>=0?E.minIntervalSeconds:n.inSession.minIntervalSeconds,maxPendingPerSession:typeof E.maxPendingPerSession=="number"&&E.maxPendingPerSession>=1?E.maxPendingPerSession:n.inSession.maxPendingPerSession}}let l=o.excludeAgents,c=Array.isArray(l)&&l.every(E=>typeof E=="string")?l:n.excludeAgents,u=Array.isArray(o.disableModelPrefixes)&&o.disableModelPrefixes.every(E=>typeof E=="string")?o.disableModelPrefixes:n.disableModelPrefixes,f=t.skillEvolve?typeof o.enabled=="boolean"?o.enabled:sw(e,u):!1,d=f&&t.skillEvolveBuiltinMr?typeof o.builtinMrEnabled=="boolean"?o.builtinMrEnabled:n.builtinMrEnabled:!1,p=o.sourceRepo,y=typeof p=="string"&&p.trim().length>0?p.trim():n.sourceRepo,m=o.proposal,h=n.proposal,g=m!=null&&typeof m=="object"&&!Array.isArray(m)?m:{},b=Array.isArray(g.eligibleAgents)&&g.eligibleAgents.every(E=>typeof E=="string")?g.eligibleAgents:h.eligibleAgents,v=typeof g.minMessageCount=="number"&&g.minMessageCount>=1?Math.floor(g.minMessageCount):h.minMessageCount,x=typeof g.skipPassiveSessionEnd=="boolean"?g.skipPassiveSessionEnd:h.skipPassiveSessionEnd,k=typeof g.enabled=="boolean"?g.enabled:null,C=f&&t.skillProposal?k??!0:!1,L=o.lifecycle,w=L&&typeof L=="object"&&!Array.isArray(L)?L:{},A=_p(w.staleThresholdDays,n.lifecycle.staleThresholdDays),O=_p(w.archiveThresholdDays,n.lifecycle.archiveThresholdDays);if(!(A<O))throw new Error(`Invalid skillEvolve.lifecycle config: staleThresholdDays (${A}) must be strictly less than archiveThresholdDays (${O}).`);return{enabled:f,inSession:a,signalCooldownHours:typeof o.signalCooldownHours=="number"&&o.signalCooldownHours>0?o.signalCooldownHours:n.signalCooldownHours,minConfidence:typeof o.minConfidence=="number"&&o.minConfidence>=0&&o.minConfidence<=1?o.minConfidence:n.minConfidence,scannerModel:typeof o.scannerModel=="string"?o.scannerModel:void 0,excludeAgents:c,disableModelPrefixes:u,builtinMrEnabled:d,sourceRepo:y,proposal:{enabled:C,eligibleAgents:b,minMessageCount:v,skipPassiveSessionEnd:x},lifecycle:{staleThresholdDays:A,archiveThresholdDays:O}}}function lw(e){let t=J.sessionRotate,n=e.sessionRotate;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.activeSessionLookbackHours;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,activeSessionLookbackHours:typeof r=="number"&&Number.isFinite(r)&&r>0?r:t.activeSessionLookbackHours}}function cw(e){let t=J.agentStop,n=e.agentStop;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n,r=i.debounceMs,o=i.maxActiveSpanMs;return{debounceMs:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:t.debounceMs,maxActiveSpanMs:typeof o=="number"&&Number.isFinite(o)&&o>=0?o:t.maxActiveSpanMs}}function $p(e){let t=Te()==="prod"&&!Aa();if(e==null||typeof e!="object"||Array.isArray(e))return{autoUpdate:t};let n=e.autoUpdate;return{autoUpdate:typeof n=="boolean"?n:t}}function uw(e){let t=J.sessionTitle,n=e.sessionTitle;if(n==null||typeof n!="object"||Array.isArray(n))return{...t};let i=n;return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled}}function fw(e){let t=J.cli,n=e.cli;if(n==null||typeof n!="object"||Array.isArray(n))return{spawn:{...t.spawn}};let i=n.spawn;if(i==null||typeof i!="object"||Array.isArray(i))return{spawn:{...t.spawn}};let r=i;return{spawn:{enabled:typeof r.enabled=="boolean"?r.enabled:t.spawn.enabled}}}function dw(e){let t=J.contextManagement,n=e.contextManagement;if(n==null||typeof n!="object"||Array.isArray(n))return{disableSystemReminderModels:[...t.disableSystemReminderModels],cuMaxScreenshotsInContext:t.cuMaxScreenshotsInContext};let i=n,r=i.disableSystemReminderModels,o=Array.isArray(r)&&r.every(l=>typeof l=="string"&&l.length>0)?r:[...t.disableSystemReminderModels],s=i.cuMaxScreenshotsInContext,a=typeof s=="number"&&Number.isFinite(s)&&s>=0?Math.floor(s):t.cuMaxScreenshotsInContext;return{disableSystemReminderModels:o,cuMaxScreenshotsInContext:a}}function pw(e){let t=e.logRetentionDays;return typeof t=="number"&&t>=1&&Number.isFinite(t)?Math.floor(t):J.logRetentionDays}function mw(e){let t=e.contentReview;if(t==null||typeof t!="object"||Array.isArray(t))return;let n={},i=Reflect.get(t,"enabled");typeof i=="boolean"&&(n.enabled=i);let r=Reflect.get(t,"testBaseURL");return typeof r=="string"&&r.trim()&&(n.testBaseURL=r.trim()),Object.keys(n).length>0?n:void 0}function hw(e){let t=e.mcpToolSearch;if(t==null||typeof t!="object"||Array.isArray(t))return;let n={},i=Reflect.get(t,"enabled");typeof i=="boolean"&&(n.enabled=i);let r=Reflect.get(t,"systemHint");typeof r=="boolean"&&(n.systemHint=r);let o=Reflect.get(t,"thresholdPct");typeof o=="number"&&(n.thresholdPct=o);let s=Reflect.get(t,"minDeferCount");typeof s=="number"&&(n.minDeferCount=s);let a=Reflect.get(t,"topKDefault");typeof a=="number"&&(n.topKDefault=a);let l=Reflect.get(t,"topKMax");typeof l=="number"&&(n.topKMax=l);let c=Reflect.get(t,"maxSchemaTextLen");typeof c=="number"&&(n.maxSchemaTextLen=c);let u=Reflect.get(t,"modelWhitelist");return Array.isArray(u)&&(n.modelWhitelist=u.filter(f=>typeof f=="string")),Object.keys(n).length>0?n:void 0}function jp(){let e=Lp();if(gr()&&!Mp()){let t=dt();if(t.autoDetected)return t.runtimePort}return e??jt}function yw(e=jp()){let t=e+Tp;if(t<=ya)return t;let n=e+Sp;if(n<=ya)return n;throw new Error(`Cannot allocate an OpenCode sidecar port for runtime port ${String(e)}; choose a runtime port <= ${String(ya-Sp)}.`)}var gw=["agent.minimaxi.com","agent.minimaxi.com","agent.minimax.io","agent.minimax.io","agent.minimax.io","agent.minimax.cn","agent.minimaxi.com"],bw=new Set(gw.map(e=>`https://${e}`));function Sw(e,t){return/^custom_provider:minimax-legacy(?:-\d+)?$/u.test(e)&&(!t||Oa(t))}function Oa(e){try{let t=new URL(e);return t.username||t.password?!1:bw.has(t.origin.toLowerCase())}catch{return!1}}function vw(e){if(!(e!=="managed-login"&&e!=="api-key"&&e!=="oauth"))return e}function Ta(e){let t=typeof e?.baseURL=="string"?e.baseURL.trim():"",n=t.length>0&&Oa(t),i=vw(e?.authMode),r=[];return typeof e?.authMode=="string"&&!i&&r.push(`Unknown provider authMode "${e.authMode}"; falling back to compatibility resolution.`),i?(i==="managed-login"&&t.length>0&&!n&&!e?.allowManagedBaseURLOverride&&r.push("Provider authMode is managed-login but baseURL is not a known managed MiniMax host."),{authMode:i,source:"explicit",managedBaseURL:n,warnings:r}):n?(r.push("Provider authMode is inferred from a managed MiniMax baseURL; set options.authMode: managed-login to make this explicit."),{authMode:"managed-login",source:"inferred-managed-base-url",managedBaseURL:n,warnings:r}):{authMode:"api-key",source:"default-api-key",managedBaseURL:n,warnings:r}}var Je="minimax",Vt="minimax_api",La="custom_provider:";function Aw(e,t){return e==="anthropic-messages"&&(t===Je||t===Vt)}function Ma(e,t){if(t===Vt)return"minimax_api_key";if(t.startsWith(La))return"custom_provider";if(t!==Je)return"configured_provider";if(e.minimaxModelSource==="minimax_api_key")return"minimax_api_key";let n=e.provider?.[t]?.options;return Ta({authMode:n?.authMode,baseURL:n?.baseURL}).authMode==="managed-login"?"managed_token_plan":"configured_provider"}function Up(e,t,n){switch(Ma(e,t)){case"managed_token_plan":return Ia(e.provider?.[t],!0);case"minimax_api_key":return Object.keys(Kt);case"custom_provider":{let r=e.custom_provider?.[t.slice(La.length)];return!r||r.enabled===!1?[]:Ia(r)}case"configured_provider":return Ia(e.provider?.[t])}}function ww(e){let t=Ma(e.config,e.providerId),n=e.modelId.trim();return n.length>0&&Up(e.config,e.providerId,e.preset).includes(n)?{available:!0,route:t}:{available:!1,route:t,code:e.source==="config_default"?"DEFAULT_MODEL_NOT_AVAILABLE_FOR_ROUTE":"MODEL_NOT_AVAILABLE_FOR_ROUTE",message:`Model "${e.providerId}/${e.modelId}" is not available for the "${t}" route (preset ${e.preset}).`}}function Ia(e,t=!1){let n=Object.entries(e?.models??{}).filter(([,s])=>s?.enabled!==!1).map(([s])=>s),i=e?.model_order;if(!t||!Array.isArray(i)||!i.every(s=>typeof s=="string"))return n;let r=new Set(n);return[...i.filter(s=>r.delete(s)),...n.filter(s=>r.has(s))]}var _w=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function Na(e){if(typeof e=="string")return _w.exec(e.trim())?.[1]}function Kp(e){let{field:t,provider:n,value:i}=e;if(i==null)return;if(typeof i!="string")throw new Error(`Provider "${n}": ${t} must be a string or a \`\${NAME}\` environment variable reference, received ${kw(i)}.`);let r=i.trim();if(!r)return;let o=Na(r);if(!o)return r;let s=(e.env??process.env)[o]?.trim();if(!s)throw new Error(`Provider "${n}": ${t} references environment variable "${o}", which is not set.`);return s}function Ew(e){if(!(typeof e.value=="string"&&e.value.trim().length>0))return{configured:!1};let n=xw(e.value)?"env":"plaintext";try{let i=Kp(e);return{configured:!0,source:n,...i?{secret:i}:{}}}catch{return{configured:!0,source:n}}}function xw(e){return Na(e)!==void 0}function kw(e){return Array.isArray(e)?"a list":`a ${typeof e}`}import{randomBytes as Cw}from"node:crypto";import pt,{readFileSync as Ow}from"node:fs";import{dirname as Vp,join as Tw}from"node:path";var Yp=xr(eo(),1);var Ra=384,wr=new Set(["__proto__","prototype","constructor"]),Iw=["minimax_api","custom_provider"];async function Lw(e){let t=e.trim();if(!t||t.includes(".")||wr.has(t))throw new ne("Invalid provider id");return Bn(async n=>(ye(n.provider)&&delete n.provider[t],{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function Mw(e){if(!ye(e)||!ye(e.models))throw new ne("Invalid managed MiniMax provider snapshot");return _r(e),Bn(async t=>(t.provider={...ye(t.provider)?t.provider:{},[Je]:structuredClone(e)},{write:!0,value:void 0})).then(({config:t})=>({config:t}))}var ne=class extends Error{name="LocalModelProviderConfigValidationError"},Fn=class extends Error{name="LocalModelProviderConfigWriteError";constructor(){super("Local runtime failed to update config file")}};async function Nw(e){return Bn(async(t,n)=>{let i={minimax_api:ye(t.minimax_api)?t.minimax_api:void 0,custom_provider:qw(ye(t.custom_provider)?t.custom_provider:void 0),minimaxModelSource:typeof t.minimaxModelSource=="string"?t.minimaxModelSource:void 0,defaultModel:typeof t.defaultModel=="string"?t.defaultModel:void 0,defaultModelVariant:typeof t.defaultModelVariant=="string"?t.defaultModelVariant:void 0};await e(i,n);for(let r of Iw){let o=i[r];if(o===void 0){delete t[r];continue}if(!ye(o))throw new ne(`Invalid BYOK config subtree "${r}"`);_r(o),t[r]=o}return Pa(t,"minimaxModelSource",i.minimaxModelSource),t.defaultModel!==i.defaultModel&&(delete t.defaultModelThinking,delete t.defaultModelContextWindow),Pa(t,"defaultModel",i.defaultModel),Pa(t,"defaultModelVariant",i.defaultModelVariant),{write:!0,value:void 0}}).then(({config:t})=>({config:t}))}async function Pw(e){let t=e.modelKey.trim();if(!t)throw new ne("Default model must not be empty");if(e.contextLimit!==void 0&&(!Number.isSafeInteger(e.contextLimit)||e.contextLimit<=0||e.contextLimit>2147483647))throw new ne("Invalid default context");if(e.thinking?.effort!==void 0&&(typeof e.thinking.effort!="string"||!e.thinking.effort.trim()))throw new ne("Invalid default effort");return Bn(async n=>(n.defaultModel=t,e.contextLimit===void 0?delete n.defaultModelContextWindow:n.defaultModelContextWindow=e.contextLimit,e.thinking?.effort===void 0?delete n.defaultModelThinking:n.defaultModelThinking={effort:e.thinking.effort},e.variant===void 0?delete n.defaultModelVariant:n.defaultModelVariant=e.variant,{write:!0,value:void 0})).then(({config:n})=>({config:n}))}async function Rw(e,t){let n=e.modelId.trim();if(e.providerId!==Je&&e.providerId!==Vt||!n||wr.has(n))throw new ne("Invalid MiniMax model context target");if(e.providerId===Vt&&!Kt[n]?.contextWindowOptions?.includes(e.contextLimit))throw new ne("Invalid MiniMax API context limit");let i=await Bn(async(r,o)=>{if((e.providerId===Je?o.provider?.[e.providerId]?.models?.[n]?.limit?.context:Dw(o,n))!==e.expectedContextLimit)return{write:!1,value:!1};if(!await t(o))return{write:!1,value:!1};let a=e.providerId===Je?["minimaxModelContextLimits",n]:["minimax_api","modelContextLimits",n];return $w(r,a,e.contextLimit),{write:!0,value:!0}});return{config:i.config,updated:i.value}}function Dw(e,t){let n=Kt[t],i=e.minimax_api?.modelContextLimits?.[t];return i!==void 0&&n?.contextWindowOptions?.includes(i)?i:n?.limit?.context}async function Bn(e){let t=Ut(),n;try{await pt.promises.mkdir(Vp(t),{recursive:!0}),await pt.promises.writeFile(t,"",{flag:"a",mode:Ra}),await pt.promises.chmod(t,Ra),n=await Yp.default.lock(t,{stale:1e4,retries:{retries:20,factor:1,minTimeout:5,maxTimeout:25}});let i=Bw(t),r=structuredClone(i);vr();let o=await e(r,Ar());return o.write&&(_r(r),await Fw(t,Ln(Ow(t,"utf-8"),i,r)),vr()),{config:Ar(),value:o.value}}catch(i){throw i instanceof ne||i instanceof Fn?i:new Fn}finally{await n?.().catch(()=>{})}}async function Fw(e,t){let n=Tw(Vp(e),`.config-tmp-${Cw(6).toString("hex")}`),i=!1;try{let r=Ra,o=await pt.promises.open(n,"wx",r);i=!0;try{await o.writeFile(t,"utf-8"),await o.chmod(r)}finally{await o.close()}await pt.promises.rename(n,e)}catch{throw i&&await pt.promises.unlink(n).catch(()=>{}),new Fn}}function Bw(e){let t=pt.readFileSync(e,"utf-8"),n;try{n=W.load(t)}catch{throw new ne("Invalid config.yaml: unable to parse YAML")}if(n==null)return{};if(!ye(n)||Object.getPrototypeOf(n)!==Object.prototype)throw new ne("Invalid config.yaml: expected a YAML mapping");return n}function qw(e){if(e)return Object.fromEntries(Object.entries(e).filter(([,t])=>ye(t)))}function Pa(e,t,n){n===void 0?delete e[t]:e[t]=n}function $w(e,t,n){let i=t.at(-1);if(!i)throw new ne("Invalid config path");let r=e;for(let o of t.slice(0,-1)){if(!o||wr.has(o))throw new ne("Invalid config path");let s=r[o];if(ye(s))r=s;else{let a={};r[o]=a,r=a}}r[i]=n}function _r(e){for(let[t,n]of Object.entries(e)){if(!t||wr.has(t))throw new ne(`Local runtime cannot update config field segment "${t}"`);ye(n)&&_r(n)}}function ye(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Xw(e){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let i=JSON.parse(t),r=typeof i.pid=="number"?i.pid:parseInt(String(i.pid),10);if(isNaN(r)||r<=0)return null;let o=Qw(i.owner)?i.owner:"unknown",s=zw(i.startedAt);return{pid:r,owner:o,...s!==void 0?{startedAt:s}:{},...typeof i.mode=="string"?{mode:i.mode}:{},...typeof i.startupToken=="string"?{startupToken:i.startupToken}:{}}}catch{return null}let n=parseInt(t,10);return isNaN(n)||n<=0?null:{pid:n,owner:"unknown"}}function Qw(e){return e==="electron"||e==="cli"||e==="unknown"}function zw(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e!="string")return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}function Zw(e,t){let n={pid:e,owner:t,startedAt:Date.now()};return JSON.stringify(n)}function e_(){let e=process.argv.slice(2);for(let t=0;t<e.length;t++){let n=e[t],i=n==="--owner"?e[t+1]:n?.startsWith("--owner=")?n.slice(8):void 0;if(i==="electron")return"electron";if(i==="service"||i==="cli")return"cli"}return"cli"}import Xe from"node:fs";import t_ from"node:path";var Gp="local-runtime.auth.json";function we(e){return typeof e=="string"&&e.trim().length>0?e.trim():void 0}function Da(e){return e?{...we(e.accessToken)?{accessToken:we(e.accessToken)}:{},...we(e.realUserID)?{realUserID:we(e.realUserID)}:{},...we(e.userEmail)?{userEmail:we(e.userEmail)}:{},...we(e.userName)?{userName:we(e.userName)}:{},...we(e.subUserName)?{subUserName:we(e.subUserName)}:{}}:{}}function Er(e){return t_.join(e,Gp)}function n_(e){try{let t=Xe.readFileSync(Er(e),"utf-8"),n=JSON.parse(t);if(n.version!==1||!n.auth||typeof n.auth!="object")return;let i=Da(n.auth);return i.accessToken?i:void 0}catch{return}}function i_(e,t,n={}){let i=Er(e),r=Da(t);if(!r.accessToken)return Wp(e),{path:i,written:!1};Xe.mkdirSync(e,{recursive:!0,mode:448});let o={version:1,updatedAtMs:Date.now(),auth:r},s=`${i}.${process.pid}.${Date.now()}.tmp`;return Xe.writeFileSync(s,`${JSON.stringify(o,null,2)}
193
+ `,{encoding:"utf-8",mode:384}),n.retryWindowsFileSystem?(kr(()=>Xe.renameSync(s,i)),kr(()=>Xe.chmodSync(i,384))):(Xe.renameSync(s,i),Xe.chmodSync(i,384)),{path:i,written:!0}}function Wp(e){try{Xe.rmSync(Er(e),{force:!0})}catch{}}import Hp from"node:net";var Jp={"e2e-runtime":5e3,"e2e-ui":5500,"smoke-runtime":7e3},Fa=100;async function r_(e,t={}){let n=t.isPortFree??s_,i=t.getFreePort??a_,r=t.getWorktreeBasePort??o_,o=r()+Jp[e],s=o-r();if(s<Fa)throw new Error(`pickTestPort(${e}): role offset ${s} collides with app runtime (0); must be >= ${Fa}.`);return o>65535?i():await n(o)?o:i()}function o_(){let e=dt();return e.autoDetected?e.runtimePort:jt}async function s_(e){return new Promise(t=>{let n=Hp.createServer();n.once("error",()=>t(!1)),n.listen(e,"127.0.0.1",()=>{n.close(()=>t(!0))})})}async function a_(){return new Promise((e,t)=>{let n=Hp.createServer();n.listen(0,"127.0.0.1",()=>{let i=n.address();if(i&&typeof i!="string"){let{port:r}=i;n.close(()=>e(r))}else n.close(()=>t(new Error("Failed to get free port")))}),n.on("error",t)})}import Xp from"node:fs";var Yt=class extends Error{code;configPath;constructor(t,n,i,r){super(i,r),this.name="ConfigFileError",this.code=t,this.configPath=n}};function Qp(e){let t;try{t=Xp.readFileSync(e,"utf-8")}catch(i){throw new Yt("CONFIG_READ_FAILED",e,`Cannot read config ${e}.`,{cause:i})}let n;try{n=W.load(t)}catch(i){throw new Yt("CONFIG_PARSE_FAILED",e,`Config is not valid YAML: ${e}`,{cause:i})}if(n==null||typeof n!="object"||Array.isArray(n))throw new Yt("CONFIG_ROOT_INVALID",e,`Config root must be an object: ${e}`);return n}function l_(e,t){return Xp.existsSync(e)&&ka(e),Ca(Qp(e),t.dataDir)}function c_(e,t){let n=Qp(e);if(n.beta==null||typeof n.beta!="object"||Array.isArray(n.beta))return;let i=n.beta[t];return typeof i=="boolean"?i:void 0}export{eo as a,f_ as b,d_ as c,zp as d,W as e,Jy as f,to as g,no as h,dd as i,er as j,Ln as k,Rt as l,tr as m,Ov as n,lr as o,Us as p,zv as q,$d as r,Dt as s,jd as t,Ks as u,Wd as v,Hd as w,Xd as x,Qd as y,Ye as z,aA as A,lA as B,ta as C,na as D,ia as E,ep as F,ra as G,dA as H,mA as I,hA as J,yA as K,gA as L,Ge as M,sa as N,op as O,lp as P,cp as Q,up as R,fp as S,dp as T,he as U,aa as V,la as W,Ae as X,ca as Y,Nn as Z,ua as _,mp as $,da as aa,pa as ba,ma as ca,fr as da,ha as ea,yp as fa,xp as ga,Te as ha,dr as ia,mr as ja,va as ka,FA as la,Aa as ma,qA as na,kp as oa,jt as pa,Tp as qa,GA as ra,dt as sa,HA as ta,_a as ua,Ut as va,Kt as wa,Dp as xa,Ea as ya,nw as za,iw as Aa,vr as Ba,Ar as Ca,$p as Da,jp as Ea,yw as Fa,Sw as Ga,Oa as Ha,Ta as Ia,Je as Ja,Vt as Ka,La,Aw as Ma,Ma as Na,Up as Oa,ww as Pa,Na as Qa,Kp as Ra,Ew as Sa,Lw as Ta,Mw as Ua,Nw as Va,Pw as Wa,Rw as Xa,Xw as Ya,Zw as Za,e_ as _a,Gp as $a,Da as ab,Er as bb,n_ as cb,i_ as db,Wp as eb,Jp as fb,Fa as gb,r_ as hb,Yt as ib,l_ as jb,c_ as kb};