@beehexa/hexasync-template-ide-mcp 2610.12.2 → 2610.12.3

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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Dq=Object.create;var Ig=Object.defineProperty;var Uq=Object.getOwnPropertyDescriptor;var Mq=Object.getOwnPropertyNames;var Fq=Object.getPrototypeOf,qq=Object.prototype.hasOwnProperty;var VR=(e,n,t)=>()=>{if(t)throw t[0];try{return e&&(n=e(e=0)),n}catch(s){throw t=[s],s}};var re=(e,n)=>()=>{try{return n||e((n={exports:{}}).exports,n),n.exports}catch(t){throw n=0,t}},xr=(e,n)=>{for(var t in n)Ig(e,t,{get:n[t],enumerable:!0})},jq=(e,n,t,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Mq(n))!qq.call(e,a)&&a!==t&&Ig(e,a,{get:()=>n[a],enumerable:!(s=Uq(n,a))||s.enumerable});return e};var st=(e,n,t)=>(t=e!=null?Dq(Fq(e)):{},jq(n||!e||!e.__esModule?Ig(t,"default",{value:e,enumerable:!0}):t,e));var I,b=VR(()=>{I={"darwin-arm64":"c1be0ce65d4c314453be18de2c1ce186173c439cd457a8123156986764844d06","darwin-x64":"d8303ce3bd266bb9e2753997081a669281184967891cd363160b0d0c9386f670","linux-arm64-gnu":"b78c34a8642d1daf559cfe0ef0cebd91498f110785ab6e511855c8cb44956ef8","linux-arm64-musl":"ef31914e76efa3eb798278a6af92028f465d5098bb968c6b303ca45b36005d6e","linux-x64-gnu":"b5c8ca78e045b2f0c67663889a21103027dd37cc351059d91804a6b2f53420b6","linux-x64-musl":"32e2f162245b4487ec3a1084d1452d56a9141c0c61110303f0ed4b6bc20e6d51","win32-arm64":"dccd6aefdfd4a595e991a3ea1382c870488a88a60ca720bcd6b056c024604798","win32-x64":"c99f23669b2b9b3e1904fcd743ca7601b84f7eb209f3779ed1c73cc4a788ffe7"}});var $R,N,T=VR(()=>{"use strict";$R=require("node:url"),N=(0,$R.pathToFileURL)(__filename).href});var Ke=re(jn=>{"use strict";b();T();var Qg=Symbol.for("yaml.alias"),p_=Symbol.for("yaml.document"),vp=Symbol.for("yaml.map"),u_=Symbol.for("yaml.pair"),Kg=Symbol.for("yaml.scalar"),kp=Symbol.for("yaml.seq"),ws=Symbol.for("yaml.node.type"),bj=e=>!!e&&typeof e=="object"&&e[ws]===Qg,Tj=e=>!!e&&typeof e=="object"&&e[ws]===p_,Rj=e=>!!e&&typeof e=="object"&&e[ws]===vp,_j=e=>!!e&&typeof e=="object"&&e[ws]===u_,h_=e=>!!e&&typeof e=="object"&&e[ws]===Kg,Aj=e=>!!e&&typeof e=="object"&&e[ws]===kp;function m_(e){if(e&&typeof e=="object")switch(e[ws]){case vp:case kp:return!0}return!1}function wj(e){if(e&&typeof e=="object")switch(e[ws]){case Qg:case vp:case Kg:case kp:return!0}return!1}var Oj=e=>(h_(e)||m_(e))&&!!e.anchor;jn.ALIAS=Qg;jn.DOC=p_;jn.MAP=vp;jn.NODE_TYPE=ws;jn.PAIR=u_;jn.SCALAR=Kg;jn.SEQ=kp;jn.hasAnchor=Oj;jn.isAlias=bj;jn.isCollection=m_;jn.isDocument=Tj;jn.isMap=Rj;jn.isNode=wj;jn.isPair=_j;jn.isScalar=h_;jn.isSeq=Aj});var Ac=re(zg=>{"use strict";b();T();var Nn=Ke(),ut=Symbol("break visit"),f_=Symbol("skip children"),hs=Symbol("remove node");function Ip(e,n){let t=y_(n);Nn.isDocument(e)?_r(null,e.contents,t,Object.freeze([e]))===hs&&(e.contents=null):_r(null,e,t,Object.freeze([]))}Ip.BREAK=ut;Ip.SKIP=f_;Ip.REMOVE=hs;function _r(e,n,t,s){let a=g_(e,n,t,s);if(Nn.isNode(a)||Nn.isPair(a))return E_(e,s,a),_r(e,a,t,s);if(typeof a!="symbol"){if(Nn.isCollection(n)){s=Object.freeze(s.concat(n));for(let o=0;o<n.items.length;++o){let r=_r(o,n.items[o],t,s);if(typeof r=="number")o=r-1;else{if(r===ut)return ut;r===hs&&(n.items.splice(o,1),o-=1)}}}else if(Nn.isPair(n)){s=Object.freeze(s.concat(n));let o=_r("key",n.key,t,s);if(o===ut)return ut;o===hs&&(n.key=null);let r=_r("value",n.value,t,s);if(r===ut)return ut;r===hs&&(n.value=null)}}return a}async function Np(e,n){let t=y_(n);Nn.isDocument(e)?await Ar(null,e.contents,t,Object.freeze([e]))===hs&&(e.contents=null):await Ar(null,e,t,Object.freeze([]))}Np.BREAK=ut;Np.SKIP=f_;Np.REMOVE=hs;async function Ar(e,n,t,s){let a=await g_(e,n,t,s);if(Nn.isNode(a)||Nn.isPair(a))return E_(e,s,a),Ar(e,a,t,s);if(typeof a!="symbol"){if(Nn.isCollection(n)){s=Object.freeze(s.concat(n));for(let o=0;o<n.items.length;++o){let r=await Ar(o,n.items[o],t,s);if(typeof r=="number")o=r-1;else{if(r===ut)return ut;r===hs&&(n.items.splice(o,1),o-=1)}}}else if(Nn.isPair(n)){s=Object.freeze(s.concat(n));let o=await Ar("key",n.key,t,s);if(o===ut)return ut;o===hs&&(n.key=null);let r=await Ar("value",n.value,t,s);if(r===ut)return ut;r===hs&&(n.value=null)}}return a}function y_(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 g_(e,n,t,s){if(typeof t=="function")return t(e,n,s);if(Nn.isMap(n))return t.Map?.(e,n,s);if(Nn.isSeq(n))return t.Seq?.(e,n,s);if(Nn.isPair(n))return t.Pair?.(e,n,s);if(Nn.isScalar(n))return t.Scalar?.(e,n,s);if(Nn.isAlias(n))return t.Alias?.(e,n,s)}function E_(e,n,t){let s=n[n.length-1];if(Nn.isCollection(s))s.items[e]=t;else if(Nn.isPair(s))e==="key"?s.key=t:s.value=t;else if(Nn.isDocument(s))s.contents=t;else{let a=Nn.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${a} parent`)}}zg.visit=Ip;zg.visitAsync=Np});var Bg=re(x_=>{"use strict";b();T();var S_=Ke(),vj=Ac(),kj={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ij=e=>e.replace(/[!,[\]{}]/g,n=>kj[n]),wc=class e{constructor(n,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,n),this.tags=Object.assign({},e.defaultTags,t)}clone(){let n=new e(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){let n=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 n}add(n,t){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let s=n.trim().split(/[ \t]+/),a=s.shift();switch(a){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[o,r]=s;return this.tags[o]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[o]=s;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let r=/^\d+\.\d+$/.test(o);return t(6,`Unsupported YAML version ${o}`,r),!1}}default:return t(0,`Unknown directive ${a}`,!0),!1}}tagName(n,t){if(n==="!")return"!";if(n[0]!=="!")return t(`Not a valid tag: ${n}`),null;if(n[1]==="<"){let r=n.slice(2,-1);return r==="!"||r==="!!"?(t(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&t("Verbatim tags must end with a >"),r)}let[,s,a]=n.match(/^(.*!)([^!]*)$/s);a||t(`The ${n} tag has no suffix`);let o=this.tags[s];if(o)try{return o+decodeURIComponent(a)}catch(r){return t(String(r)),null}return s==="!"?n:(t(`Could not resolve tag: ${n}`),null)}tagString(n){for(let[t,s]of Object.entries(this.tags))if(n.startsWith(s))return t+Ij(n.substring(s.length));return n[0]==="!"?n:`!<${n}>`}toString(n){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),a;if(n&&s.length>0&&S_.isNode(n.contents)){let o={};vj.visit(n.contents,(r,i)=>{S_.isNode(i)&&i.tag&&(o[i.tag]=!0)}),a=Object.keys(o)}else a=[];for(let[o,r]of s)o==="!!"&&r==="tag:yaml.org,2002:"||(!n||a.some(i=>i.startsWith(r)))&&t.push(`%TAG ${o} ${r}`);return t.join(`
2
+ "use strict";var Dq=Object.create;var Ig=Object.defineProperty;var Uq=Object.getOwnPropertyDescriptor;var Mq=Object.getOwnPropertyNames;var Fq=Object.getPrototypeOf,qq=Object.prototype.hasOwnProperty;var VR=(e,n,t)=>()=>{if(t)throw t[0];try{return e&&(n=e(e=0)),n}catch(s){throw t=[s],s}};var re=(e,n)=>()=>{try{return n||e((n={exports:{}}).exports,n),n.exports}catch(t){throw n=0,t}},xr=(e,n)=>{for(var t in n)Ig(e,t,{get:n[t],enumerable:!0})},jq=(e,n,t,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Mq(n))!qq.call(e,a)&&a!==t&&Ig(e,a,{get:()=>n[a],enumerable:!(s=Uq(n,a))||s.enumerable});return e};var st=(e,n,t)=>(t=e!=null?Dq(Fq(e)):{},jq(n||!e||!e.__esModule?Ig(t,"default",{value:e,enumerable:!0}):t,e));var I,b=VR(()=>{I={"darwin-arm64":"c1be0ce65d4c314453be18de2c1ce186173c439cd457a8123156986764844d06","darwin-x64":"d8303ce3bd266bb9e2753997081a669281184967891cd363160b0d0c9386f670","linux-arm64-gnu":"b78c34a8642d1daf559cfe0ef0cebd91498f110785ab6e511855c8cb44956ef8","linux-arm64-musl":"ef31914e76efa3eb798278a6af92028f465d5098bb968c6b303ca45b36005d6e","linux-x64-gnu":"b5c8ca78e045b2f0c67663889a21103027dd37cc351059d91804a6b2f53420b6","linux-x64-musl":"32e2f162245b4487ec3a1084d1452d56a9141c0c61110303f0ed4b6bc20e6d51","win32-arm64":"572ed3d1a7b002a7f80a6fda0987a102a586c7291bc3e87cedf9d96ee128db14","win32-x64":"bb3f328bcf8171f6cdeb32353181fc502d1d5001ebbac43d1dd7314061f8a75c"}});var $R,N,T=VR(()=>{"use strict";$R=require("node:url"),N=(0,$R.pathToFileURL)(__filename).href});var Ke=re(jn=>{"use strict";b();T();var Qg=Symbol.for("yaml.alias"),p_=Symbol.for("yaml.document"),vp=Symbol.for("yaml.map"),u_=Symbol.for("yaml.pair"),Kg=Symbol.for("yaml.scalar"),kp=Symbol.for("yaml.seq"),ws=Symbol.for("yaml.node.type"),bj=e=>!!e&&typeof e=="object"&&e[ws]===Qg,Tj=e=>!!e&&typeof e=="object"&&e[ws]===p_,Rj=e=>!!e&&typeof e=="object"&&e[ws]===vp,_j=e=>!!e&&typeof e=="object"&&e[ws]===u_,h_=e=>!!e&&typeof e=="object"&&e[ws]===Kg,Aj=e=>!!e&&typeof e=="object"&&e[ws]===kp;function m_(e){if(e&&typeof e=="object")switch(e[ws]){case vp:case kp:return!0}return!1}function wj(e){if(e&&typeof e=="object")switch(e[ws]){case Qg:case vp:case Kg:case kp:return!0}return!1}var Oj=e=>(h_(e)||m_(e))&&!!e.anchor;jn.ALIAS=Qg;jn.DOC=p_;jn.MAP=vp;jn.NODE_TYPE=ws;jn.PAIR=u_;jn.SCALAR=Kg;jn.SEQ=kp;jn.hasAnchor=Oj;jn.isAlias=bj;jn.isCollection=m_;jn.isDocument=Tj;jn.isMap=Rj;jn.isNode=wj;jn.isPair=_j;jn.isScalar=h_;jn.isSeq=Aj});var Ac=re(zg=>{"use strict";b();T();var Nn=Ke(),ut=Symbol("break visit"),f_=Symbol("skip children"),hs=Symbol("remove node");function Ip(e,n){let t=y_(n);Nn.isDocument(e)?_r(null,e.contents,t,Object.freeze([e]))===hs&&(e.contents=null):_r(null,e,t,Object.freeze([]))}Ip.BREAK=ut;Ip.SKIP=f_;Ip.REMOVE=hs;function _r(e,n,t,s){let a=g_(e,n,t,s);if(Nn.isNode(a)||Nn.isPair(a))return E_(e,s,a),_r(e,a,t,s);if(typeof a!="symbol"){if(Nn.isCollection(n)){s=Object.freeze(s.concat(n));for(let o=0;o<n.items.length;++o){let r=_r(o,n.items[o],t,s);if(typeof r=="number")o=r-1;else{if(r===ut)return ut;r===hs&&(n.items.splice(o,1),o-=1)}}}else if(Nn.isPair(n)){s=Object.freeze(s.concat(n));let o=_r("key",n.key,t,s);if(o===ut)return ut;o===hs&&(n.key=null);let r=_r("value",n.value,t,s);if(r===ut)return ut;r===hs&&(n.value=null)}}return a}async function Np(e,n){let t=y_(n);Nn.isDocument(e)?await Ar(null,e.contents,t,Object.freeze([e]))===hs&&(e.contents=null):await Ar(null,e,t,Object.freeze([]))}Np.BREAK=ut;Np.SKIP=f_;Np.REMOVE=hs;async function Ar(e,n,t,s){let a=await g_(e,n,t,s);if(Nn.isNode(a)||Nn.isPair(a))return E_(e,s,a),Ar(e,a,t,s);if(typeof a!="symbol"){if(Nn.isCollection(n)){s=Object.freeze(s.concat(n));for(let o=0;o<n.items.length;++o){let r=await Ar(o,n.items[o],t,s);if(typeof r=="number")o=r-1;else{if(r===ut)return ut;r===hs&&(n.items.splice(o,1),o-=1)}}}else if(Nn.isPair(n)){s=Object.freeze(s.concat(n));let o=await Ar("key",n.key,t,s);if(o===ut)return ut;o===hs&&(n.key=null);let r=await Ar("value",n.value,t,s);if(r===ut)return ut;r===hs&&(n.value=null)}}return a}function y_(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 g_(e,n,t,s){if(typeof t=="function")return t(e,n,s);if(Nn.isMap(n))return t.Map?.(e,n,s);if(Nn.isSeq(n))return t.Seq?.(e,n,s);if(Nn.isPair(n))return t.Pair?.(e,n,s);if(Nn.isScalar(n))return t.Scalar?.(e,n,s);if(Nn.isAlias(n))return t.Alias?.(e,n,s)}function E_(e,n,t){let s=n[n.length-1];if(Nn.isCollection(s))s.items[e]=t;else if(Nn.isPair(s))e==="key"?s.key=t:s.value=t;else if(Nn.isDocument(s))s.contents=t;else{let a=Nn.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${a} parent`)}}zg.visit=Ip;zg.visitAsync=Np});var Bg=re(x_=>{"use strict";b();T();var S_=Ke(),vj=Ac(),kj={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ij=e=>e.replace(/[!,[\]{}]/g,n=>kj[n]),wc=class e{constructor(n,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,n),this.tags=Object.assign({},e.defaultTags,t)}clone(){let n=new e(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){let n=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 n}add(n,t){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let s=n.trim().split(/[ \t]+/),a=s.shift();switch(a){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[o,r]=s;return this.tags[o]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[o]=s;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let r=/^\d+\.\d+$/.test(o);return t(6,`Unsupported YAML version ${o}`,r),!1}}default:return t(0,`Unknown directive ${a}`,!0),!1}}tagName(n,t){if(n==="!")return"!";if(n[0]!=="!")return t(`Not a valid tag: ${n}`),null;if(n[1]==="<"){let r=n.slice(2,-1);return r==="!"||r==="!!"?(t(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&t("Verbatim tags must end with a >"),r)}let[,s,a]=n.match(/^(.*!)([^!]*)$/s);a||t(`The ${n} tag has no suffix`);let o=this.tags[s];if(o)try{return o+decodeURIComponent(a)}catch(r){return t(String(r)),null}return s==="!"?n:(t(`Could not resolve tag: ${n}`),null)}tagString(n){for(let[t,s]of Object.entries(this.tags))if(n.startsWith(s))return t+Ij(n.substring(s.length));return n[0]==="!"?n:`!<${n}>`}toString(n){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),a;if(n&&s.length>0&&S_.isNode(n.contents)){let o={};vj.visit(n.contents,(r,i)=>{S_.isNode(i)&&i.tag&&(o[i.tag]=!0)}),a=Object.keys(o)}else a=[];for(let[o,r]of s)o==="!!"&&r==="tag:yaml.org,2002:"||(!n||a.some(i=>i.startsWith(r)))&&t.push(`%TAG ${o} ${r}`);return t.join(`
3
3
  `)}};wc.defaultYaml={explicit:!1,version:"1.2"};wc.defaultTags={"!!":"tag:yaml.org,2002:"};x_.Directives=wc});var Lp=re(Oc=>{"use strict";b();T();var b_=Ke(),Nj=Ac();function Lj(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(t)}return!0}function T_(e){let n=new Set;return Nj.visit(e,{Value(t,s){s.anchor&&n.add(s.anchor)}}),n}function R_(e,n){for(let t=1;;++t){let s=`${e}${t}`;if(!n.has(s))return s}}function Pj(e,n){let t=[],s=new Map,a=null;return{onAnchor:o=>{t.push(o),a??(a=T_(e));let r=R_(n,a);return a.add(r),r},setAnchors:()=>{for(let o of t){let r=s.get(o);if(typeof r=="object"&&r.anchor&&(b_.isScalar(r.node)||b_.isCollection(r.node)))r.node.anchor=r.anchor;else{let i=new Error("Failed to resolve repeated object (this should not happen)");throw i.source=o,i}}},sourceObjects:s}}Oc.anchorIsValid=Lj;Oc.anchorNames=T_;Oc.createNodeAnchors=Pj;Oc.findNewAnchor=R_});var Hg=re(__=>{"use strict";b();T();function vc(e,n,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let a=0,o=s.length;a<o;++a){let r=s[a],i=vc(e,s,String(a),r);i===void 0?delete s[a]:i!==r&&(s[a]=i)}else if(s instanceof Map)for(let a of Array.from(s.keys())){let o=s.get(a),r=vc(e,s,a,o);r===void 0?s.delete(a):r!==o&&s.set(a,r)}else if(s instanceof Set)for(let a of Array.from(s)){let o=vc(e,s,a,a);o===void 0?s.delete(a):o!==a&&(s.delete(a),s.add(o))}else for(let[a,o]of Object.entries(s)){let r=vc(e,s,a,o);r===void 0?delete s[a]:r!==o&&(s[a]=r)}return e.call(n,t,s)}__.applyReviver=vc});var da=re(w_=>{"use strict";b();T();var Cj=Ke();function A_(e,n,t){if(Array.isArray(e))return e.map((s,a)=>A_(s,String(a),t));if(e&&typeof e.toJSON=="function"){if(!t||!Cj.hasAnchor(e))return e.toJSON(n,t);let s={aliasCount:0,count:1,res:void 0};t.anchors.set(e,s),t.onCreate=o=>{s.res=o,delete t.onCreate};let a=e.toJSON(n,t);return t.onCreate&&t.onCreate(a),a}return typeof e=="bigint"&&!t?.keep?Number(e):e}w_.toJS=A_});var Pp=re(v_=>{"use strict";b();T();var Dj=Hg(),O_=Ke(),Uj=da(),Wg=class{constructor(n){Object.defineProperty(this,O_.NODE_TYPE,{value:n})}clone(){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:t,maxAliasCount:s,onAnchor:a,reviver:o}={}){if(!O_.isDocument(n))throw new TypeError("A document argument is required");let r={anchors:new Map,doc:n,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},i=Uj.toJS(this,"",r);if(typeof a=="function")for(let{count:c,res:d}of r.anchors.values())a(d,c);return typeof o=="function"?Dj.applyReviver(o,{"":i},"",i):i}};v_.NodeBase=Wg});var kc=re(k_=>{"use strict";b();T();var Mj=Lp(),Fj=Ac(),wr=Ke(),qj=Pp(),jj=da(),Gg=class extends qj.NodeBase{constructor(n){super(wr.ALIAS),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],Fj.visit(n,{Node:(o,r)=>{(wr.isAlias(r)||wr.hasAnchor(r))&&s.push(r)}}),t&&(t.aliasResolveCache=s));let a;for(let o of s){if(o===this)break;o.anchor===this.source&&(a=o)}return a}toJSON(n,t){if(!t)return{source:this.source};let{anchors:s,doc:a,maxAliasCount:o}=t,r=this.resolve(a,t);if(!r){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let i=s.get(r);if(i||(jj.toJS(r,null,t),i=s.get(r)),i?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(i.count+=1,i.aliasCount===0&&(i.aliasCount=Cp(a,r,s)),i.count*i.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return i.res}toString(n,t,s){let a=`*${this.source}`;if(n){if(Mj.anchorIsValid(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(n.implicitKey)return`${a} `}return a}};function Cp(e,n,t){if(wr.isAlias(n)){let s=n.resolve(e),a=t&&s&&t.get(s);return a?a.count*a.aliasCount:0}else if(wr.isCollection(n)){let s=0;for(let a of n.items){let o=Cp(e,a,t);o>s&&(s=o)}return s}else if(wr.isPair(n)){let s=Cp(e,n.key,t),a=Cp(e,n.value,t);return Math.max(s,a)}return 1}k_.Alias=Gg});var On=re(Jg=>{"use strict";b();T();var Yj=Ke(),Vj=Pp(),$j=da(),Qj=e=>!e||typeof e!="function"&&typeof e!="object",la=class extends Vj.NodeBase{constructor(n){super(Yj.SCALAR),this.value=n}toJSON(n,t){return t?.keep?this.value:$j.toJS(this.value,n,t)}toString(){return String(this.value)}};la.BLOCK_FOLDED="BLOCK_FOLDED";la.BLOCK_LITERAL="BLOCK_LITERAL";la.PLAIN="PLAIN";la.QUOTE_DOUBLE="QUOTE_DOUBLE";la.QUOTE_SINGLE="QUOTE_SINGLE";Jg.Scalar=la;Jg.isScalarValue=Qj});var Ic=re(N_=>{"use strict";b();T();var Kj=kc(),uo=Ke(),I_=On(),zj="tag:yaml.org,2002:";function Bj(e,n,t){if(n){let s=t.filter(o=>o.tag===n),a=s.find(o=>!o.format)??s[0];if(!a)throw new Error(`Tag ${n} not found`);return a}return t.find(s=>s.identify?.(e)&&!s.format)}function Hj(e,n,t){if(uo.isDocument(e)&&(e=e.contents),uo.isNode(e))return e;if(uo.isPair(e)){let p=t.schema[uo.MAP].createNode?.(t.schema,null,t);return p.items.push(e),p}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:a,onTagObj:o,schema:r,sourceObjects:i}=t,c;if(s&&e&&typeof e=="object"){if(c=i.get(e),c)return c.anchor??(c.anchor=a(e)),new Kj.Alias(c.anchor);c={anchor:null,node:null},i.set(e,c)}n?.startsWith("!!")&&(n=zj+n.slice(2));let d=Bj(e,n,r.tags);if(!d){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let p=new I_.Scalar(e);return c&&(c.node=p),p}d=e instanceof Map?r[uo.MAP]:Symbol.iterator in Object(e)?r[uo.SEQ]:r[uo.MAP]}o&&(o(d),delete t.onTagObj);let l=d?.createNode?d.createNode(t.schema,e,t):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(t.schema,e,t):new I_.Scalar(e);return n?l.tag=n:d.default||(l.tag=d.tag),c&&(c.node=l),l}N_.createNode=Hj});var Up=re(Dp=>{"use strict";b();T();var Wj=Ic(),ms=Ke(),Gj=Pp();function Xg(e,n,t){let s=t;for(let a=n.length-1;a>=0;--a){let o=n[a];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let r=[];r[o]=s,s=r}else s=new Map([[o,s]])}return Wj.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var L_=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,Zg=class extends Gj.NodeBase{constructor(n,t){super(n),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(n){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(t.schema=n),t.items=t.items.map(s=>ms.isNode(s)||ms.isPair(s)?s.clone(n):s),this.range&&(t.range=this.range.slice()),t}addIn(n,t){if(L_(n))this.add(t);else{let[s,...a]=n,o=this.get(s,!0);if(ms.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(s,Xg(this.schema,a,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}}deleteIn(n){let[t,...s]=n;if(s.length===0)return this.delete(t);let a=this.get(t,!0);if(ms.isCollection(a))return a.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(n,t){let[s,...a]=n,o=this.get(s,!0);return a.length===0?!t&&ms.isScalar(o)?o.value:o:ms.isCollection(o)?o.getIn(a,t):void 0}hasAllNullValues(n){return this.items.every(t=>{if(!ms.isPair(t))return!1;let s=t.value;return s==null||n&&ms.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(n){let[t,...s]=n;if(s.length===0)return this.has(t);let a=this.get(t,!0);return ms.isCollection(a)?a.hasIn(s):!1}setIn(n,t){let[s,...a]=n;if(a.length===0)this.set(s,t);else{let o=this.get(s,!0);if(ms.isCollection(o))o.setIn(a,t);else if(o===void 0&&this.schema)this.set(s,Xg(this.schema,a,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}}};Dp.Collection=Zg;Dp.collectionFromPath=Xg;Dp.isEmptyPath=L_});var Nc=re(Mp=>{"use strict";b();T();var Jj=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function eE(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}var Xj=(e,n,t)=>e.endsWith(`
4
4
  `)?eE(t,n):t.includes(`
5
5
  `)?`
@@ -143,7 +143,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
143
143
  ${q}`)}let g=y.canonical+"::"+p$(y.projectReplacements);if(o.has(g))continue;o.add(g),d.push({project:y.project,generation:y.generation,weight:y.weight,componentPath:y.componentPath});let E=l$(y.mainYml);E.length>0&&(p=!0);let S=E.filter(q=>q.type==="local"&&q.path),R=S.filter(q=>vt(q.path)==="variables.yaml").map((q,V)=>({e:q,i:V})).sort((q,V)=>{let J=typeof q.e.index=="number"?q.e.index:q.i,Se=typeof V.e.index=="number"?V.e.index:V.i;return J-Se||q.i-V.i}).map(q=>q.e);for(let q of R){let V=oa(y.componentPath,q.path),J=await t.readFileIfExists(V);if(J===null)continue;r.add(await t.canonical(V));let Se=k1(J);c.push({project:y.project,generation:y.generation,variables:Se,rank:0,sources:I1(Se,V)})}let w=k1(y.mainYml),_=wn(y.componentPath,"variables.yaml"),x=await t.readFileIfExists(_);x&&r.add(await t.canonical(_));let A=x?k1(x):{},k=wn(y.componentPath,"main.yaml");c.push({project:y.project,generation:y.generation,variables:{...w,...A},rank:1,sources:{...I1(w,k),...I1(A,_)}});for(let q of S)i.push({path:wn(y.componentPath,q.path),replacements:[...y.projectReplacements,...q.replacements||[]],project:y.project,generation:y.generation,weight:y.weight,index:typeof q.index=="number"?q.index:0,override:!!q.override,discoveryOrder:l++});let M=new Set(await Promise.all(S.map(q=>t.canonical(wn(y.componentPath,q.path))))),C=y.generation===0?await t.canonical(wn(y.componentPath,"main.yaml")):null;for(let q of await t.globYaml(y.componentPath)){let V=await t.canonical(q);M.has(V)||C&&V===C||i.push({path:q,replacements:[...y.projectReplacements],project:y.project,generation:y.generation,weight:y.weight,index:0,override:!1,discoveryOrder:l++})}let F=E.filter(q=>q.type==="project"&&q.path).map((q,V)=>({ext:q,i:V})).sort((q,V)=>{let J=typeof q.ext.index=="number"?q.ext.index:q.i,Se=typeof V.ext.index=="number"?V.ext.index:V.i;return J-Se||q.i-V.i}).map(q=>q.ext);for(let q of F){let V=q.weight;if(V!==void 0&&(typeof V!="number"||!Number.isFinite(V)))throw new Error(`invalid weight "${q.weight}" on type: project "${q.path}" in project ${y.project} (weight must be a finite number)`);let J=oa(y.componentPath,q.path),{mainYml:Se,componentPath:Fe}=await t.searchMain(J);a.push({project:v1(Fe),canonical:await t.canonical(Fe),componentPath:Fe,mainYml:Se,generation:y.generation+1,weight:V===void 0?NaN:V,ancestors:[...y.ancestors,y.canonical],projectReplacements:[...y.projectReplacements,...q.replacements||[]]})}}let u=nO(i),h=i.some(y=>y.generation>=1),m=[];for(let y of u){if(vt(y.path)!=="variables.yaml")continue;let g=await t.canonical(y.path);r.has(g)||m.includes(y.path)||m.push(y.path)}let f=await u$(e,u.map(y=>y.path),r,t);return{worklist:u,variableSets:c,hasInheritance:h,hasExternals:p,projects:d,unadmittedVariableFiles:m,libraryVariableSets:f}}async function u$(e,n,t,s){let a=e.endsWith("/")?e:`${e}/`,o=[],r=new Set;for(let i of n){if(i.startsWith(a))continue;let c=Pn(i);for(let d=0;d<8&&!(c===""||a.startsWith(`${c}/`)||r.has(c));d+=1){r.add(c);let l=`${c}/variables.yaml`,p=await s.canonical(l);if(!t.has(p)){let h=await s.readFileIfExists(l);if(h!==null){let m=h$(h);Object.keys(m).length>0&&o.push({library:c,sourceFile:l,variables:m})}}let u=Pn(c);if(u===c)break;c=u}}return o}function h$(e){let n;try{n=(0,Iu.parse)(e)}catch{return{}}if(!n||typeof n!="object")return{};let t=n.variables,s=t&&typeof t=="object"?t:n,a={};for(let[o,r]of Object.entries(s))o!=="variables"&&(a[o]=r);return a}function nO(e){let n=e.filter(s=>s.generation>=1).sort((s,a)=>{if(s.generation!==a.generation)return a.generation-s.generation;let o=Number.isFinite(s.weight)?s.weight:0,r=Number.isFinite(a.weight)?a.weight:0;if(o!==r)return o-r;if(s.project===a.project){if(s.override!==a.override)return s.override?1:-1;if(s.index!==a.index)return a.index-s.index}return s.discoveryOrder-a.discoveryOrder}),t=e.filter(s=>s.generation===0).sort((s,a)=>s.override!==a.override?s.override?1:-1:s.index!==a.index?a.index-s.index:s.discoveryOrder-a.discoveryOrder);return[...n,...t].map(m$)}function m$(e){let{discoveryOrder:n,override:t,...s}=e;return s}function f$(e){return[...e].map((n,t)=>({v:n,i:t})).sort((n,t)=>n.v.generation!==t.v.generation?t.v.generation-n.v.generation:n.i-t.i)}function Lu(e){let n=f$(e),t={};for(let{v:s}of n)Object.assign(t,s.variables);return t}function I1(e,n){let t={};for(let s of Object.keys(e))t[s]=n;return t}b();T();b();T();b();T();var Pu={pullers:[{key:"beforePullSteps",label:"Before pull",phase:"sequence"},{key:"pullSteps",label:"Pull",phase:"sequence"},{key:"afterPullSteps",label:"After pull",phase:"sequence"},{key:"steps",label:"Steps",phase:"sequence",runtimeFlow:"steps"},{key:"onErrorSteps",label:"On error",phase:"error",runtimeFlow:"onError"},{key:"finalSteps",label:"Final",phase:"final",runtimeFlow:"final"}],pushers:[{key:"beforePushSteps",label:"Before push",phase:"sequence"},{key:"pushSteps",label:"Push",phase:"sequence"},{key:"afterPushSteps",label:"After push",phase:"sequence"},{key:"finalSteps",label:"Final",phase:"final"}]};b();T();b();T();b();T();b();T();b();T();var yoe=i_({adapterId:"worker",adapterVersion:"1",identityFields:["key"],displayTypeFields:["type","displayType"],dialect:"worker/v1",capabilities:{semanticEdit:!0,presentationEdit:!0}});var T$=st(kt(),1);var joe={pullers:Pu.pullers.map(e=>e.key),pushers:Pu.pushers.map(e=>e.key)};function N1(){let e={sourceFile:"",project:"",generation:0,weight:NaN},n=[],t=[],s=new Map,a=[];return{setSource(o){e=o},emit(o){n.push({...o,...e})},events(){return n},note(o){t.includes(o)||t.push(o)},notes(){return t},snapshot(o,r,i){let c=JSON.stringify([o,r]);s.has(c)||s.set(c,i)},snapshots(){return s},recordOverwrite(o){a.push(o)},overwrites(){return a}}}b();T();var Eo=st(kt(),1);function L1(e){return{canonical:async n=>n,readFileIfExists:async n=>await e.read(n)??null,globYaml:async n=>[...await e.glob(n,"**/*.yaml")],searchMain:n=>_1(n,e)}}async function sO(e,n,t){return Nu(e,n,t)}var aO=ku,oO=A1;function rO(e,n,t){let s=(0,Eo.parse)(e,{keepSourceTokens:!0}),a=e.replace(/(indexGroups:)[^\S\n]*\n(?:[^\S\n]*\n)*([^\S\n]*dbType:)/g,`$1 []
144
144
  $2`),o=(0,Eo.parse)(a,{keepSourceTokens:!0});delete o.externals,t||(delete o.variables,o=vu((0,Eo.stringify)(o,{keepSourceTokens:!0,lineWidth:0}),n));let r=nd(o);return{tokenForm:s,output:r,outputText:(0,Eo.stringify)(r,{keepSourceTokens:!0,lineWidth:0})}}function P1(e,n,t,s){let a=(0,Eo.parse)(n,{keepSourceTokens:!0}),o=t.find(i=>i.generation===0)?.project??"",r=new Set(e.events().filter(i=>i.depth===0).map(i=>JSON.stringify([i.parentKey,i.idOrKey])));e.setSource({sourceFile:wn(s,"main.yaml"),project:o,generation:0,weight:NaN});for(let[i,c]of Object.entries(a??{}))if(!(mt.has(i)||!Array.isArray(c)))for(let d of c){if(!d||typeof d!="object")continue;let l="id"in d?d.id:"key"in d?d.key:void 0;if(l==null)continue;let p=String(l),u=JSON.stringify([i,p]);r.has(u)||(r.add(u),e.emit({idOrKey:p,parentKey:i,operation:"added",depth:0}))}}async function C1(e){let{componentPath:n,mainYml:t,io:s,reader:a}=e,o=e.raw??!1,r=[],{worklist:i,variableSets:c,hasInheritance:d,hasExternals:l,projects:p,unadmittedVariableFiles:u,libraryVariableSets:h}=await sO(n,t,s),m=new Map;for(let x of i)for(let A of x.replacements||[])!A||A.toKey==null||A.fromKey==null||(m.has(A.toKey)||m.set(A.toKey,new Set),m.get(A.toKey).add(A.fromKey));for(let[x,A]of m)A.size>1&&r.push(`Warning: replacement toKey "${x}" is produced from multiple distinct fromKeys (${[...A].join(", ")}); components may merge unexpectedly.`);let f=await aO(i,a,n,t),y=N1(),g=[],E=oO(t,i,y,n,f,r,{onMissingInclude:x=>{g.some(A=>A.path===x.path)||g.push(x)}}),S=Lu(c),{tokenForm:R,output:w,outputText:_}=rO(E,S,o);return{output:w,outputText:_,tokenForm:R,variables:S,worklist:i,projects:p,variableSets:c,tracer:y,sources:f,componentPath:n,rootMainYml:t,projectTitle:vt(Pn(n)),hasExternals:l,hasInheritance:d,warnings:r,unadmittedVariableFiles:u,libraryVariableSets:h,missingIncludes:g,contractVersion:4}}b();T();b();T();b();T();var v$=/^Error at file (.+?): /,k$=/^Could not read partial: (.+)$/,I$=/^(inheritance cycle detected|There is no main\.yaml file in the project|Looks like there are more than one mail\.yaml file|Could not read main\.yaml at |!md include not found)/;function N$(e){let n=e?.linePos;if(!Array.isArray(n)||n.length===0)return;let t=a=>{let o=n[a];if(!(!o||typeof o.line!="number"||typeof o.col!="number"))return{line:o.line-1,column:o.col-1}},s=t(0);if(s)return{start:s,end:t(1)??s}}function Cu(e,n=0){if(!(!e||n>8))return N$(e)??Cu(e.cause,n+1)}function Du(e,n){let t;try{t=e instanceof Error?e.message:String(e)}catch{t="An error that cannot be converted to text was thrown."}let s=v$.exec(t);if(s)return{code:"parse-failed",message:t,sourceFile:s[1],range:Cu(e),cause:e};let a=k$.exec(t);return a?{code:"resolve-failed",message:t,sourceFile:a[1],cause:e}:I$.test(t)?{code:"resolve-failed",message:t,sourceFile:n,range:Cu(e),cause:e}:{code:"compose-failed",message:t,sourceFile:n,range:Cu(e),cause:e}}b();T();b();T();b();T();var Uu=st(kt(),1);b();T();var od=st(kt(),1);b();T();var D1=st(kt(),1);b();T();b();T();var Fr=require("node:fs"),EO=require("node:crypto"),Ku=require("node:util"),fs=require("node:url"),Mr=require("node:path");b();T();b();T();var He=(e,n,t)=>Object.freeze({status:"failed",code:e,message:n,...t===void 0?{}:{rootId:t}}),rd=(e,n)=>e.scheme===n.scheme&&e.authority===n.authority&&e.components.length<=n.components.length&&e.components.every((t,s)=>t===n.components[s]),U1=class{constructor(n,t,s){this.source=n;this.port=s;this.roots=Object.freeze(t.map((a,o)=>Object.freeze({...a,components:Object.freeze([...a.components]),id:`root-${o+1}`}))),Object.freeze(this)}source;port;roots;async openAuthorized(n,t={}){if(t.signal?.aborted)return He("OPEN_CANCELLED","Workspace read was cancelled.");let s=await this.port.openAuthorized(this.roots,n,t);return t.signal?.aborted?He("OPEN_CANCELLED","Workspace read was cancelled."):s}describe(){return{source:this.source,roots:this.roots.map(({id:n,scheme:t})=>({id:n,scheme:t}))}}};async function M1(e,n,t){let s=e.negotiated!==void 0?"negotiated":e.launch!==void 0?"launch":e.environment!==void 0?"environment":"cwd",a=e[s];if(!a?.length)return He("ROOT_UNAVAILABLE","The selected Root authority is empty or unavailable. Supply valid workspace Roots.");let o=async c=>{let d=[];for(let l of c){if(t?.aborted)return He("OPEN_CANCELLED","Root resolution was cancelled.");let p=await n.canonicalize(l,t);if(t?.aborted)return He("OPEN_CANCELLED","Root resolution was cancelled.");if("status"in p)return p;if(!p.uri||!p.scheme||!p.physicalIdentity||p.components.some(u=>!u||u==="."||u===".."))return He("ROOT_UNAVAILABLE","The selected Root authority has an invalid canonical identity.");d.some(u=>u.physicalIdentity===p.physicalIdentity&&u.scheme===p.scheme&&u.authority===p.authority)||d.push(p)}return d.sort((l,p)=>l.uri<p.uri?-1:l.uri>p.uri?1:0)},r=await o(a);if(!Array.isArray(r))return r;if(e.negotiated!==void 0&&e.launch!==void 0){if(!e.launch.length)return He("ROOT_UNAVAILABLE","The supplied Launch Root authority is empty.");let c=await o(e.launch);if(!Array.isArray(c))return c;if(!r.some(d=>c.some(l=>rd(d,l)||rd(l,d))))return He("ROOT_CONFLICT","Negotiated Roots and Launch Root authority are disjoint.")}let i=r;if(e.explicit!==void 0){if(e.explicit.length===0)return He("ROOT_UNAVAILABLE","The explicit Root selection is empty.");let c=await o(e.explicit);if(!Array.isArray(c))return c;if(c.some(d=>!r.some(l=>rd(l,d))))return He("ROOT_CONFLICT","The explicit Root selection is outside the selected Root authority.");i=c}return t?.aborted?He("OPEN_CANCELLED","Root resolution was cancelled."):{status:"ready",rootSet:new U1(s,i,n)}}function Sa(e,n="authored"){let t=e.replace(/\\(?:u([a-fA-F0-9]{4})|x([a-fA-F0-9]{2})|U([a-fA-F0-9]{8}))/g,(s,a,o,r)=>{let i=Number.parseInt(a??o??r,16);return i<=1114111?String.fromCodePoint(i):"\uFFFD"}).replace(/\\\//g,"/");return/\b(?:[\w-]*(?:password|passwd|secret|token|api[_-]?key|authorization|authentication|credential|connectionString|private[_-]?key|environment)[\w-]*|env)["']?(?:\s*[:=]|[ \t]*(?:#[^\r\n]*)?\r?\n(?:[ \t]*(?:#[^\r\n]*)?\r?\n)*[ \t]*:)/i.test(t)||/(?:^|\n)[ \t]*(?:export[ \t]+)?[A-Z_][A-Z0-9_]*[ \t]*=/.test(t)||/\b(?:name|key|header|headerName)["']?\s*:\s*["']?(?:authorization|proxy-authorization|authentication)\b/i.test(t)||/-----BEGIN [^-]*PRIVATE KEY-----|\$\{|\$\(|\$[A-Za-z_]|\{\{|\{\s*\$secret[/.]|secret:\/\/|[a-z][a-z0-9+.-]*:\/\/[^\s/@]+@/i.test(t)||n==="authored"&&/`[^`]*`/.test(t)?"[REDACTED]":e}b();T();async function U$(e,n){let t=e.timeoutMs??1e4,s=e.maxProjects??50;if(!Number.isSafeInteger(t)||t<1||t>2147483647||!Number.isSafeInteger(s)||s<1||s>1e3)return{status:"incomplete",complete:!1,code:"DISCOVERY_INCOMPLETE",candidates:Object.freeze([]),message:"Discovery bounds are invalid."};let a=new AbortController,o=setTimeout(()=>a.abort(),t),r=e.signal?AbortSignal.any([e.signal,a.signal]):a.signal,i=(d=Object.freeze([]))=>({status:"incomplete",complete:!1,code:e.signal?.aborted?"DISCOVERY_CANCELLED":"DISCOVERY_TIMEOUT",candidates:d,message:"Project discovery did not complete."}),c;try{if(r.aborted)return i();let d=new Promise(p=>{c=()=>p(i()),r.addEventListener("abort",c,{once:!0})}),l=await Promise.race([n(r,t,s),d]);return r.aborted?i("candidates"in l?l.candidates:void 0):l}finally{clearTimeout(o),c&&r.removeEventListener("abort",c)}}async function M$(e,n,t,s,a,o){let r={signal:t,timeoutMs:s,maxProjects:a},i=o&&n.inspect?await n.inspect(e,o,r):await n.discover(e,r);if(t.aborted)return{status:"incomplete",complete:!1,code:"DISCOVERY_CANCELLED",candidates:Object.freeze([]),message:"Project discovery did not complete."};let c=new Map(i.candidates.map(l=>[l.id,l])),d=Object.freeze([...c.values()].sort((l,p)=>l.id<p.id?-1:l.id>p.id?1:0).slice(0,a).map(l=>Object.freeze({...l})));return i.status!=="complete"?{...i,candidates:d}:c.size>a?{status:"incomplete",complete:!1,code:"DISCOVERY_INCOMPLETE",candidates:d,message:"Project discovery exceeded its result limit."}:{status:"complete",complete:!0,candidates:d}}async function Mu(e,n,t={}){return U$(t,async(s,a,o)=>{let r;if(t.project!==void 0){let p=await n.canonicalize(t.project,s);if(s.aborted)return{status:"incomplete",complete:!1,code:t.signal?.aborted?"DISCOVERY_CANCELLED":"DISCOVERY_TIMEOUT",candidates:Object.freeze([]),message:"Project discovery did not complete."};if("status"in p)return p;if(!e.roots.some(u=>rd(u,p)))return He("ROOT_CONFLICT","The selected Project is outside the effective Roots.");r=p}let i=await M$(e,n,s,a,o,r);if(i.status!=="complete")return i;let c=t.expectedProject,d=!c&&r?i.candidates.filter(p=>p.componentUri===r.uri):[],l=c?i.candidates.filter(p=>p.componentUri===c.componentUri&&p.detectorType===c.detectorType&&p.descriptorUri===c.descriptorUri&&(!r||p.componentUri===r.uri)):r?d.length?d:i.candidates.filter(p=>p.uri===r.uri):i.candidates;return l.length===1?{status:"selected",project:l[0]}:{status:"failed",code:l.length?"PROJECT_AMBIGUOUS":"PROJECT_NOT_FOUND",message:l.length?"Select one canonical Project URI using the project argument or HexaSync IDE: Select Template Project.":"No supported Project matches the current selection inside the effective Roots.",candidates:Object.freeze(l.slice(0,50))}})}b();T();var F1=class{#e;#n;#a;#s;#r;#m=new Map;#u=0;#l=0;#i=new AbortController;#c=!1;constructor(n){this.#e=n}get context(){return Object.freeze({generation:this.#u,roots:this.#e,...this.#n?{project:this.#n}:{},...this.#r?{knowledge:this.#r}:{},signal:this.#i.signal})}setRoots(n){if(this.#c)throw new Error("The server session is closed.");this.#i.abort(),this.#i=new AbortController,this.#n=void 0,this.#a=void 0,this.#s=void 0,this.#r=void 0,this.#m.clear(),this.#e=n,this.#u++}setKnowledge(n,t){return this.#c||t!==this.#u?!1:(this.#r=n,!0)}cache(n,t,s){return this.#c||s!==this.#u?!1:(this.#m.set(n,t),!0)}cached(n){return this.#m.get(n)}async selectProject(n,t={}){let s=++this.#l;return this.run(async a=>{if(a.roots.status!=="ready")return a.roots;let o=t.project??this.#a,r=await Mu(a.roots.rootSet,n,{...t,project:o,expectedProject:t.expectedProject??(t.project===void 0?this.#s:void 0),signal:t.signal?AbortSignal.any([t.signal,a.signal]):a.signal});return s!==this.#l?{status:"failed",code:"SESSION_INVALIDATED",message:"Project selection changed during the operation. Retry with the current selection."}:(a.generation===this.#u&&!this.#c&&r.status!=="incomplete"&&!(r.status==="failed"&&r.code==="OPEN_CANCELLED")&&(this.#n=r.status==="selected"?r.project:void 0,r.status==="selected"?(this.#a=r.project.componentUri,this.#s=r.project):t.project!==void 0&&(this.#a=t.project,this.#s=t.expectedProject)),r)})}async run(n){let t=this.context;if(this.#c)return{status:"failed",code:"SESSION_INVALIDATED",message:"The server session is closed."};let s=await n(t);return t.generation!==this.#u||this.#c?{status:"failed",code:"SESSION_INVALIDATED",message:"Workspace context changed during the operation. Retry with current Roots."}:s}dispose(){this.#i.abort(),this.#c=!0,this.#n=void 0,this.#a=void 0,this.#s=void 0,this.#r=void 0,this.#m.clear(),this.#u++}};function lO(e){return new F1(e)}b();T();var pO=require("node:module"),uO=require("node:crypto"),q1=require("node:fs"),xa=require("node:path"),hO=require("node:url"),mO=Object.freeze(["linux-x64-gnu","linux-arm64-gnu","linux-x64-musl","linux-arm64-musl","darwin-x64","darwin-arm64","win32-x64","win32-arm64"]);function F$(e){return e&&typeof e=="object"&&"glibcVersionRuntime"in e&&typeof e.glibcVersionRuntime=="string"&&e.glibcVersionRuntime!==""?"gnu":"musl"}var Fu;function fO(){if(Fu)return Fu;if(process.platform!=="linux")return Fu={platform:process.platform,arch:process.arch};let e=process.report,n=e.excludeNetwork;e.excludeNetwork=!0;try{let t=e.getReport(),s=t&&typeof t=="object"&&"header"in t?t.header:void 0;return Fu={platform:process.platform,arch:process.arch,libc:F$(s)}}finally{e.excludeNetwork=n}}function yO(e){if(e.platform==="linux"&&e.libc===void 0)return;let n=e.platform==="linux"?`${e.platform}-${e.arch}-${e.libc}`:`${e.platform}-${e.arch}`;return mO.find(t=>t===n)}var vs=class extends Error{name="RootNativeUnavailableError"};function q$(e,n,t){let s=t&&typeof t=="object"&&Object.hasOwn(t,n)?t[n]:void 0;if(typeof s!="string"||!/^[a-f0-9]{64}$/.test(s))throw new vs(`This package ships no trusted atomic Root adapter for ${n}. Reinstall the Host package; no unsafe filesystem fallback is used.`);let a=(0,xa.join)(e,"prebuilds",n,"root-authority.node"),o;try{o=(0,q1.readFileSync)(a)}catch{throw new vs(`The atomic Root adapter for ${n} is missing. Reinstall the Host package; no unsafe filesystem fallback is used.`)}if((0,uO.createHash)("sha256").update(o).digest("hex")!==s)throw new vs(`Atomic Root native integrity mismatch for ${n}. Reinstall the trusted Host package.`);return a}function j$(e){if(typeof I<"u")return I;try{return JSON.parse((0,q1.readFileSync)((0,xa.join)(e,"prebuilds","integrity.json"),"utf8"))}catch{return}}var qu;function Ur(){if(qu)return qu;let e=fO(),n=yO(e);if(n===void 0){let i=e.libc===void 0?"":` (${e.libc==="gnu"?"glibc":"musl"})`;throw new vs(`No atomic Root adapter exists for ${e.platform}/${e.arch}${i}. Supported Hosts: Linux (x64, arm64; glibc or musl), macOS (x64, arm64) and Windows (x64, arm64). No unsafe filesystem fallback is used.`)}let t=typeof __filename=="string"?__filename:(0,hO.fileURLToPath)(N),s=(0,xa.dirname)(t),a=(0,xa.basename)(s)==="src"?(0,xa.join)(s,"../dist"):s,o=q$(a,n,j$(a)),r=(0,pO.createRequire)(t)(o);if(typeof r?.request!="function")throw new vs(`The atomic Root adapter for ${n} did not initialise in this Host process.`);return qu=r,qu}var ju=(0,Ku.promisify)(Fr.close),Y$=(0,Ku.promisify)(Fr.fstat),V$=(0,Ku.promisify)(Fr.read),$$=4*1024*1024,Q$=64*1024*1024,j1=e=>He("ROOT_UNSUPPORTED",e instanceof vs?e.message:"Atomic Root-relative operations require the shipped native adapter for this Host. Reinstall a supported Host package; no unsafe filesystem fallback is used."),ba=()=>He("OPEN_CANCELLED","Workspace operation was cancelled."),Y1=e=>/^(?:\.env(?:\..*)?|credentials?(?:\..*)?|id_(?:rsa|dsa|ecdsa|ed25519)(?:\..*)?)$|\.(?:pem|key|p12|pfx)$/i.test(e),Vu=e=>e&&typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:void 0,gO=e=>Vu(e)===void 0||["EPERM","EINVAL","ENOSYS"].includes(Vu(e)),K$=e=>["EXDEV","ELOOP","ESTALE","EAGAIN"].includes(Vu(e)??"");function $u(){try{Ur();return}catch(e){return j1(e)}}function zu(e){if(process.platform!=="win32")return{authority:"",components:e.split("/").filter(Boolean)};let n=/^[\\/]{2}([^\\/]+)[\\/]+(.*)$/s.exec(e),t=(n?n[2]:e).split(/[\\/]/).filter(Boolean);return!n&&/^[a-z]:$/i.test(t[0]??"")&&(t[0]=t[0].toUpperCase()),{authority:n?n[1].toLowerCase():"",components:t}}function Qu(e){try{if(!e.startsWith("file:")||e.includes("\0")||e.includes("\\")||decodeURIComponent(e).split("/").some(s=>s==="."||s===".."))return;let t=new URL(e);return t.protocol!=="file:"||t.username||t.password||t.search||t.hash?void 0:(0,fs.fileURLToPath)(t)}catch{return}}function z$(e,n){return{uri:(0,fs.pathToFileURL)(e).href,scheme:"file",...zu(e),physicalIdentity:n}}function id(e){let n=Qu(e.uri);if(n===void 0||e.scheme!=="file")return;let{authority:t,components:s}=zu(n);return t===e.authority&&s.length===e.components.length&&s.every((a,o)=>a===e.components[o])?n:void 0}function SO(e,n){let{authority:t,components:s}=zu(n);if(!(id(e)===void 0||t!==e.authority||e.components.length>s.length||!e.components.every((a,o)=>a===s[o])))return s.slice(e.components.length).join("/")||"."}async function Yu(e,n){let t=id(e);if(t===void 0)throw Object.assign(new Error("Invalid Root identity."),{code:"ESTALE"});return Ur().request("open",t,e.physicalIdentity,n)}function cd(){return{async canonicalize(e,n){if(n?.aborted)return ba();let t=$u();if(t)return t;let s=Qu(e);if(s===void 0)return He("ROOT_UNAVAILABLE","Supply an absolute local file URI without traversal.");try{let a=await Ur().request("identity",s,"",".");return n?.aborted?ba():z$(s,a)}catch(a){return n?.aborted?ba():gO(a)?j1(a):He("ROOT_UNAVAILABLE","Root is unavailable or contains a symbolic link.")}},async openAuthorized(e,n,t){if(t.signal?.aborted)return ba();let s=$u();if(s)return s;let a=Qu(n);if(a===void 0||zu(a).components.some(Y1))return He("ROOT_CONFLICT","Workspace URI is outside the permitted content boundary.");let r=e.map(u=>({root:u,relative:SO(u,a)})).filter(u=>u.relative!==void 0).sort((u,h)=>h.root.components.length-u.root.components.length)[0];if(!r)return He("ROOT_CONFLICT","Workspace URI is outside the selected Roots.");let{root:i,relative:c}=r,d=t.maxBytes??$$;if(!Number.isSafeInteger(d)||d<0||d>Q$)return He("OPEN_TOO_LARGE","Workspace byte limit must be an integer between 0 and 64 MiB.",i.id);if(t.expectedSha256!==void 0&&(typeof t.expectedSha256!="string"||!/^[a-f0-9]{64}$/.test(t.expectedSha256)))return He("OPEN_UNAVAILABLE","Workspace file checksum is invalid.",i.id);let l=t.expectedSha256===void 0?void 0:(0,EO.createHash)("sha256"),p;try{if(p=await Yu(i,c),t.signal?.aborted)return ba();if((await Y$(p)).size>d)return He("OPEN_TOO_LARGE","Workspace file exceeds the read byte limit.",i.id);let h=Buffer.allocUnsafe(Math.min(64*1024,d+1)),m=new TextDecoder("utf-8",{fatal:!0}),f=[],y=0;for(;;){if(t.signal?.aborted)return ba();let S=await V$(p,h,0,Math.min(h.length,d+1-y),null);if(t.signal?.aborted)return ba();if(!S.bytesRead)break;if(y+=S.bytesRead,y>d)return He("OPEN_TOO_LARGE","Workspace file exceeds the read byte limit.",i.id);let R=h.subarray(0,S.bytesRead);l?.update(R),f.push(m.decode(R,{stream:!0}))}if(l&&l.digest("hex")!==t.expectedSha256)return He("OPEN_UNAVAILABLE","Workspace file checksum did not match.",i.id);f.push(m.decode());let g=f.join("");if(t.projection==="host-parse")return{status:"opened",uri:(0,fs.pathToFileURL)(a).href,text:g,rootId:i.id};let E=Sa(g,/\.(?:md|markdown)$/i.test(a)?"markdown":"authored");return E==="[REDACTED]"?He("CONTENT_REDACTED","Workspace content contains sensitive or executable values.",i.id):{status:"opened",uri:(0,fs.pathToFileURL)(a).href,text:E,rootId:i.id}}catch(u){return t.signal?.aborted?ba():gO(u)&&p===void 0?j1(u):He(K$(u)?"ROOT_CONFLICT":"OPEN_UNAVAILABLE","Workspace file could not be read through the atomic Root boundary.",i.id)}finally{p!==void 0&&await ju(p)}}}}function Bu(){return{canonicalize:cd().canonicalize,async discover(e,n){let t=[],s=(h,m)=>({status:"incomplete",complete:!1,code:h,candidates:[],message:m}),a=h=>({status:"incomplete",complete:!1,code:"DISCOVERY_INCOMPLETE",candidates:t.sort((m,f)=>m.uri.localeCompare(f.uri)||m.id.localeCompare(f.id)),message:h});if(n.signal?.aborted)return s("DISCOVERY_CANCELLED","Project discovery was cancelled.");let o=$u();if(o)return s("DISCOVERY_INCOMPLETE",o.message);let r=Date.now()+(n.timeoutMs??5e3),i=n.maxProjects??1e3;if(!Number.isFinite(r)||!Number.isSafeInteger(i)||i<1)return s("DISCOVERY_INCOMPLETE","Invalid project discovery bounds.");let c=[],d=[],l=0,p=0,u;try{e:for(let f of e.roots){let y=id(f);if(y===void 0)return s("DISCOVERY_INCOMPLETE","Root identity is unavailable.");let g=["."];for(;g.length;){if(n.signal?.aborted)return s("DISCOVERY_CANCELLED","Project discovery was cancelled.");if(Date.now()>=r)return s("DISCOVERY_TIMEOUT","Project discovery exceeded its deadline.");if(++l>1e4){u="Project traversal exceeded its directory bound.";break e}let E=g.pop(),S=await Ur().request("list",y,f.physicalIdentity,E);for(let R of S){if(++p>1e5){u="Project discovery exceeded its entry bound.";break e}if(Rr.includes(R.name)||Y1(R.name))continue;let w=E==="."?R.name:`${E}/${R.name}`;if(R.type==="directory"){if(g.length+l>=1e4){u="Project traversal exceeded its directory bound.";break e}g.push(w)}else R.type==="file"&&(ca.some(_=>_c(_)===R.name)&&c.push({root:f,relative:w,name:R.name}),ca.some(_=>_.scopeMarkerGlob===`**/${R.name}`)&&d.push({rootId:f.id,relative:w,name:R.name}))}}}for(let f of d){if(n.signal?.aborted)return s("DISCOVERY_CANCELLED","Project discovery was cancelled.");if(Date.now()>=r)return s("DISCOVERY_TIMEOUT","Project discovery exceeded its deadline.");let y=e.roots.find(g=>g.id===f.rootId);await ju(await Yu(y,f.relative))}let h=new Set,m=[...ca].sort((f,y)=>y.precedence-f.precedence);for(let f of m)for(let y of c){if(n.signal?.aborted)return s("DISCOVERY_CANCELLED","Project discovery was cancelled.");if(Date.now()>=r)return s("DISCOVERY_TIMEOUT","Project discovery exceeded its deadline.");if(_c(f)!==y.name)continue;let g=id(y.root),E=(0,fs.pathToFileURL)((0,Mr.join)(g,y.relative)).href,S=f.scopeMarkerGlob===void 0?[]:d.filter(_=>_.rootId===y.root.id&&`**/${_.name}`===f.scopeMarkerGlob);if(S.length&&!S.some(_=>_.relative.lastIndexOf("/")<0||y.relative.startsWith(_.relative.slice(0,_.relative.lastIndexOf("/")+1)))||!f.accepts(E,""))continue;let R=f.componentPathFor(E),w=f.rootFor(R);if(!h.has(R)&&(await ju(await Yu(y.root,y.relative)),h.add(R),t.push({id:R,uri:w,componentUri:R,descriptorUri:E,name:(0,Mr.basename)((0,fs.fileURLToPath)(w)),detectorType:f.kind,rootId:y.root.id}),t.length>i))return a("Project discovery exceeded its candidate bound.")}return n.signal?.aborted?s("DISCOVERY_CANCELLED","Project discovery was cancelled."):Date.now()>=r?s("DISCOVERY_TIMEOUT","Project discovery exceeded its deadline."):u!==void 0?a(u):{status:"complete",complete:!0,candidates:t.sort((f,y)=>f.uri.localeCompare(y.uri)||f.id.localeCompare(y.id))}}catch{return s(n.signal?.aborted?"DISCOVERY_CANCELLED":"DISCOVERY_INCOMPLETE","Project discovery could not complete through the atomic Root boundary.")}},async inspect(e,n,t){let s=(m,f)=>({status:"incomplete",complete:!1,code:m,candidates:[],message:f});if(t.signal?.aborted)return s("DISCOVERY_CANCELLED","Project selection was cancelled.");let a=$u();if(a)return s("DISCOVERY_INCOMPLETE",a.message);let o=Date.now()+(t.timeoutMs??5e3);if(!Number.isFinite(o))return s("DISCOVERY_INCOMPLETE","Invalid project discovery bounds.");let r=Qu(n.uri),i=r===void 0?void 0:e.roots.map(m=>({root:m,relative:SO(m,r)})).filter(m=>m.relative!==void 0).sort((m,f)=>f.root.components.length-m.root.components.length)[0],c={status:"complete",complete:!0,candidates:[]};if(i===void 0)return c;let{root:d,relative:l}=i;if(l!=="."&&l.split("/").some(m=>Rr.includes(m)||Y1(m)))return c;let p=id(d),u=(m,f)=>m==="."?f:`${m}/${f}`,h=async m=>{try{return await Ur().request("list",p,d.physicalIdentity,m)}catch(f){if(["ENOENT","ENOTDIR"].includes(Vu(f)??""))return[];throw f}};try{let m=await h(l),f=[{directory:l,entries:m}];for(let E of["partials","partial"])m.some(S=>S.name===E&&S.type==="directory")&&f.push({directory:u(l,E),entries:await h(u(l,E))});let y=[],g=new Set;for(let E of[...ca].sort((S,R)=>R.precedence-S.precedence))for(let S of f){if(t.signal?.aborted)return s("DISCOVERY_CANCELLED","Project selection was cancelled.");if(Date.now()>=o)return s("DISCOVERY_TIMEOUT","Project selection exceeded its deadline.");let R=_c(E);if(R===void 0||!S.entries.some(k=>k.name===R&&k.type==="file"))continue;let w=u(S.directory,R),_=(0,fs.pathToFileURL)((0,Mr.join)(p,w)).href;if(!E.accepts(_,""))continue;let x=E.componentPathFor(_);if(g.has(x))continue;await ju(await Yu(d,w)),g.add(x);let A=E.rootFor(x);y.push({id:x,uri:A,componentUri:x,descriptorUri:_,name:(0,Mr.basename)((0,fs.fileURLToPath)(A)),detectorType:E.kind,rootId:d.id})}return t.signal?.aborted?s("DISCOVERY_CANCELLED","Project selection was cancelled."):{status:"complete",complete:!0,candidates:y.sort((E,S)=>E.uri.localeCompare(S.uri)||E.id.localeCompare(S.id))}}catch{return s(t.signal?.aborted?"DISCOVERY_CANCELLED":"DISCOVERY_INCOMPLETE","Project selection could not be verified through the atomic Root boundary.")}}}}var xd=require("node:fs/promises"),uh=require("node:url");b();T();var ev=require("node:url"),Vr=require("node:path"),ov=require("node:url"),Es=require("fs"),XQ=st(require("node:fs"),1),Aa=require("node:fs/promises"),dh=require("node:events"),Z1=st(require("node:stream"),1),rv=require("node:string_decoder"),VO=(e,n,t)=>{let s=e instanceof RegExp?xO(e,t):e,a=n instanceof RegExp?xO(n,t):n,o=s!==null&&a!=null&&B$(s,a,t);return o&&{start:o[0],end:o[1],pre:t.slice(0,o[0]),body:t.slice(o[0]+s.length,o[1]),post:t.slice(o[1]+a.length)}},xO=(e,n)=>{let t=n.match(e);return t?t[0]:null},B$=(e,n,t)=>{let s,a,o,r,i,c=t.indexOf(e),d=t.indexOf(n,c+1),l=c;if(c>=0&&d>0){if(e===n)return[c,d];for(s=[],o=t.length;l>=0&&!i;){if(l===c)s.push(l),c=t.indexOf(e,l+1);else if(s.length===1){let p=s.pop();p!==void 0&&(i=[p,d])}else a=s.pop(),a!==void 0&&a<o&&(o=a,r=d),d=t.indexOf(n,l+1);l=c<d&&c>=0?c:d}s.length&&r!==void 0&&(i=[o,r])}return i},$O="\0SLASH"+Math.random()+"\0",QO="\0OPEN"+Math.random()+"\0",J1="\0CLOSE"+Math.random()+"\0",KO="\0COMMA"+Math.random()+"\0",zO="\0PERIOD"+Math.random()+"\0",H$=new RegExp($O,"g"),W$=new RegExp(QO,"g"),G$=new RegExp(J1,"g"),J$=new RegExp(KO,"g"),X$=new RegExp(zO,"g"),Z$=/\\\\/g,eQ=/\\{/g,nQ=/\\}/g,tQ=/\\,/g,sQ=/\\./g,aQ=1e5;function V1(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function oQ(e){return e.replace(Z$,$O).replace(eQ,QO).replace(nQ,J1).replace(tQ,KO).replace(sQ,zO)}function rQ(e){return e.replace(H$,"\\").replace(W$,"{").replace(G$,"}").replace(J$,",").replace(X$,".")}function BO(e){if(!e)return[""];let n=[],t=VO("{","}",e);if(!t)return e.split(",");let{pre:s,body:a,post:o}=t,r=s.split(",");r[r.length-1]+="{"+a+"}";let i=BO(o);return o.length&&(r[r.length-1]+=i.shift(),r.push.apply(r,i)),n.push.apply(n,r),n}function iQ(e,n={}){if(!e)return[];let{max:t=aQ}=n;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),fd(oQ(e),t,!0).map(rQ)}function cQ(e){return"{"+e+"}"}function dQ(e){return/^-?0\d/.test(e)}function lQ(e,n){return e<=n}function pQ(e,n){return e>=n}function fd(e,n,t){let s=[],a=VO("{","}",e);if(!a)return[e];let o=a.pre,r=a.post.length?fd(a.post,n,!1):[""];if(/\$$/.test(a.pre))for(let i=0;i<r.length&&i<n;i++){let c=o+"{"+a.body+"}"+r[i];s.push(c)}else{let i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),d=i||c,l=a.body.indexOf(",")>=0;if(!d&&!l)return a.post.match(/,(?!,).*\}/)?(e=a.pre+"{"+a.body+J1+a.post,fd(e,n,!0)):[e];let p;if(d)p=a.body.split(/\.\./);else if(p=BO(a.body),p.length===1&&p[0]!==void 0&&(p=fd(p[0],n,!1).map(cQ),p.length===1))return r.map(h=>a.pre+p[0]+h);let u;if(d&&p[0]!==void 0&&p[1]!==void 0){let h=V1(p[0]),m=V1(p[1]),f=Math.max(p[0].length,p[1].length),y=p.length===3&&p[2]!==void 0?Math.abs(V1(p[2])):1,g=lQ;m<h&&(y*=-1,g=pQ);let E=p.some(dQ);u=[];for(let S=h;g(S,m);S+=y){let R;if(c)R=String.fromCharCode(S),R==="\\"&&(R="");else if(R=String(S),E){let w=f-R.length;if(w>0){let _=new Array(w+1).join("0");S<0?R="-"+_+R.slice(1):R=_+R}}u.push(R)}}else{u=[];for(let h=0;h<p.length;h++)u.push.apply(u,fd(p[h],n,!1))}for(let h=0;h<u.length;h++)for(let m=0;m<r.length&&s.length<n;m++){let f=o+u[h]+r[m];(!t||d||f)&&s.push(f)}}return s}var ah=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},uQ={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},dd=e=>e.replace(/[[\]\\-]/g,"\\$&"),hQ=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),bO=e=>e.join(""),mQ=(e,n)=>{let t=n;if(e.charAt(t)!=="[")throw new Error("not in a brace expression");let s=[],a=[],o=t+1,r=!1,i=!1,c=!1,d=!1,l=t,p="";e:for(;o<e.length;){let m=e.charAt(o);if((m==="!"||m==="^")&&o===t+1){d=!0,o++;continue}if(m==="]"&&r&&!c){l=o+1;break}if(r=!0,m==="\\"&&!c){c=!0,o++;continue}if(m==="["&&!c){for(let[f,[y,g,E]]of Object.entries(uQ))if(e.startsWith(f,o)){if(p)return["$.",!1,e.length-t,!0];o+=f.length,E?a.push(y):s.push(y),i=i||g;continue e}}if(c=!1,p){m>p?s.push(dd(p)+"-"+dd(m)):m===p&&s.push(dd(m)),p="",o++;continue}if(e.startsWith("-]",o+1)){s.push(dd(m+"-")),o+=2;continue}if(e.startsWith("-",o+1)){p=m,o+=2;continue}s.push(dd(m)),o++}if(l<o)return["",!1,0,!1];if(!s.length&&!a.length)return["$.",!1,e.length-t,!0];if(a.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!d){let m=s[0].length===2?s[0].slice(-1):s[0];return[hQ(m),!1,l-t,!1]}let u="["+(d?"^":"")+bO(s)+"]",h="["+(d?"":"^")+bO(a)+"]";return[s.length&&a.length?"("+u+"|"+h+")":s.length?u:h,i,l-t,!0]},Yr=(e,{windowsPathsNoEscape:n=!1,magicalBraces:t=!0}={})=>t?n?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):n?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),fQ=new Set(["!","?","+","*","@"]),TO=e=>fQ.has(e),yQ="(?!(?:^|/)\\.\\.?(?:$|/))",Hu="(?!\\.)",gQ=new Set(["[","."]),EQ=new Set(["..","."]),SQ=new Set("().*{}+?[]^$\\!"),xQ=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),X1="[^/]",RO=X1+"*?",_O=X1+"+?",HO=class Nt{type;#e;#n;#a=!1;#s=[];#r;#m;#u;#l=!1;#i;#c;#h=!1;constructor(n,t,s={}){this.type=n,n&&(this.#n=!0),this.#r=t,this.#e=this.#r?this.#r.#e:this,this.#i=this.#e===this?s:this.#e.#i,this.#u=this.#e===this?[]:this.#e.#u,n==="!"&&!this.#e.#l&&this.#u.push(this),this.#m=this.#r?this.#r.#s.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let n of this.#s)if(typeof n!="string"&&(n.type||n.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#s.map(n=>String(n)).join("|")+")":this.#c=this.#s.map(n=>String(n)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#l)return this;this.toString(),this.#l=!0;let n;for(;n=this.#u.pop();){if(n.type!=="!")continue;let t=n,s=t.#r;for(;s;){for(let a=t.#m+1;!s.type&&a<s.#s.length;a++)for(let o of n.#s){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(s.#s[a])}t=s,s=t.#r}}return this}push(...n){for(let t of n)if(t!==""){if(typeof t!="string"&&!(t instanceof Nt&&t.#r===this))throw new Error("invalid part: "+t);this.#s.push(t)}}toJSON(){let n=this.type===null?this.#s.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#s.map(t=>t.toJSON())];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#l&&this.#r?.type==="!")&&n.push({}),n}isStart(){if(this.#e===this)return!0;if(!this.#r?.isStart())return!1;if(this.#m===0)return!0;let n=this.#r;for(let t=0;t<this.#m;t++){let s=n.#s[t];if(!(s instanceof Nt&&s.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#r?.type==="!")return!0;if(!this.#r?.isEnd())return!1;if(!this.type)return this.#r?.isEnd();let n=this.#r?this.#r.#s.length:0;return this.#m===n-1}copyIn(n){typeof n=="string"?this.push(n):this.push(n.clone(this))}clone(n){let t=new Nt(this.type,n);for(let s of this.#s)t.copyIn(s);return t}static#o(n,t,s,a){let o=!1,r=!1,i=-1,c=!1;if(t.type===null){let h=s,m="";for(;h<n.length;){let f=n.charAt(h++);if(o||f==="\\"){o=!o,m+=f;continue}if(r){h===i+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(h===i+2&&c)&&(r=!1),m+=f;continue}else if(f==="["){r=!0,i=h,c=!1,m+=f;continue}if(!a.noext&&TO(f)&&n.charAt(h)==="("){t.push(m),m="";let y=new Nt(f,t);h=Nt.#o(n,y,h,a),t.push(y);continue}m+=f}return t.push(m),h}let d=s+1,l=new Nt(null,t),p=[],u="";for(;d<n.length;){let h=n.charAt(d++);if(o||h==="\\"){o=!o,u+=h;continue}if(r){d===i+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(d===i+2&&c)&&(r=!1),u+=h;continue}else if(h==="["){r=!0,i=d,c=!1,u+=h;continue}if(TO(h)&&n.charAt(d)==="("){l.push(u),u="";let m=new Nt(h,l);l.push(m),d=Nt.#o(n,m,d,a);continue}if(h==="|"){l.push(u),u="",p.push(l),l=new Nt(null,t);continue}if(h===")")return u===""&&t.#s.length===0&&(t.#h=!0),l.push(u),u="",t.push(...p,l),d;u+=h}return t.type=null,t.#n=void 0,t.#s=[n.substring(s-1)],d}static fromGlob(n,t={}){let s=new Nt(null,void 0,t);return Nt.#o(n,s,0,t),s}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let n=this.toString(),[t,s,a,o]=this.toRegExpSource();if(!(a||this.#n||this.#i.nocase&&!this.#i.nocaseMagicOnly&&n.toUpperCase()!==n.toLowerCase()))return s;let r=(this.#i.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${t}$`,r),{_src:t,_glob:n})}get options(){return this.#i}toRegExpSource(n){let t=n??!!this.#i.dot;if(this.#e===this&&this.#d(),!this.type){let c=this.isStart()&&this.isEnd()&&!this.#s.some(u=>typeof u!="string"),d=this.#s.map(u=>{let[h,m,f,y]=typeof u=="string"?Nt.#b(u,this.#n,c):u.toRegExpSource(n);return this.#n=this.#n||f,this.#a=this.#a||y,h}).join(""),l="";if(this.isStart()&&typeof this.#s[0]=="string"&&!(this.#s.length===1&&EQ.has(this.#s[0]))){let u=gQ,h=t&&u.has(d.charAt(0))||d.startsWith("\\.")&&u.has(d.charAt(2))||d.startsWith("\\.\\.")&&u.has(d.charAt(4)),m=!t&&!n&&u.has(d.charAt(0));l=h?yQ:m?Hu:""}let p="";return this.isEnd()&&this.#e.#l&&this.#r?.type==="!"&&(p="(?:$|\\/)"),[l+d+p,Yr(d),this.#n=!!this.#n,this.#a]}let s=this.type==="*"||this.type==="+",a=this.type==="!"?"(?:(?!(?:":"(?:",o=this.#f(t);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let c=this.toString();return this.#s=[c],this.type=null,this.#n=void 0,[c,Yr(this.toString()),!1,!1]}let r=!s||n||t||!Hu?"":this.#f(!0);r===o&&(r=""),r&&(o=`(?:${o})(?:${r})*?`);let i="";if(this.type==="!"&&this.#h)i=(this.isStart()&&!t?Hu:"")+_O;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!n?Hu:"")+RO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&r?")":this.type==="*"&&r?")?":`)${this.type}`;i=a+o+c}return[i,Yr(o),this.#n=!!this.#n,this.#a]}#f(n){return this.#s.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[s,a,o,r]=t.toRegExpSource(n);return this.#a=this.#a||r,s}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#b(n,t,s=!1){let a=!1,o="",r=!1,i=!1;for(let c=0;c<n.length;c++){let d=n.charAt(c);if(a){a=!1,o+=(SQ.has(d)?"\\":"")+d;continue}if(d==="*"){if(i)continue;i=!0,o+=s&&/^[*]+$/.test(n)?_O:RO,t=!0;continue}else i=!1;if(d==="\\"){c===n.length-1?o+="\\\\":a=!0;continue}if(d==="["){let[l,p,u,h]=mQ(n,c);if(u){o+=l,r=r||p,c+=u-1,t=t||h;continue}}if(d==="?"){o+=X1,t=!0;continue}o+=xQ(d)}return[o,Yr(n),!!t,r]}},WO=(e,{windowsPathsNoEscape:n=!1,magicalBraces:t=!1}={})=>t?n?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):n?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),rt=(e,n,t={})=>(ah(n),!t.nocomment&&n.charAt(0)==="#"?!1:new _a(n,t).match(e)),bQ=/^\*+([^+@!?\*\[\(]*)$/,TQ=e=>n=>!n.startsWith(".")&&n.endsWith(e),RQ=e=>n=>n.endsWith(e),_Q=e=>(e=e.toLowerCase(),n=>!n.startsWith(".")&&n.toLowerCase().endsWith(e)),AQ=e=>(e=e.toLowerCase(),n=>n.toLowerCase().endsWith(e)),wQ=/^\*+\.\*+$/,OQ=e=>!e.startsWith(".")&&e.includes("."),vQ=e=>e!=="."&&e!==".."&&e.includes("."),kQ=/^\.\*+$/,IQ=e=>e!=="."&&e!==".."&&e.startsWith("."),NQ=/^\*+$/,LQ=e=>e.length!==0&&!e.startsWith("."),PQ=e=>e.length!==0&&e!=="."&&e!=="..",CQ=/^\?+([^+@!?\*\[\(]*)?$/,DQ=([e,n=""])=>{let t=GO([e]);return n?(n=n.toLowerCase(),s=>t(s)&&s.toLowerCase().endsWith(n)):t},UQ=([e,n=""])=>{let t=JO([e]);return n?(n=n.toLowerCase(),s=>t(s)&&s.toLowerCase().endsWith(n)):t},MQ=([e,n=""])=>{let t=JO([e]);return n?s=>t(s)&&s.endsWith(n):t},FQ=([e,n=""])=>{let t=GO([e]);return n?s=>t(s)&&s.endsWith(n):t},GO=([e])=>{let n=e.length;return t=>t.length===n&&!t.startsWith(".")},JO=([e])=>{let n=e.length;return t=>t.length===n&&t!=="."&&t!==".."},XO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",AO={win32:{sep:"\\"},posix:{sep:"/"}},qQ=XO==="win32"?AO.win32.sep:AO.posix.sep;rt.sep=qQ;var ot=Symbol("globstar **");rt.GLOBSTAR=ot;var jQ="[^/]",YQ=jQ+"*?",VQ="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",$Q="(?:(?!(?:\\/|^)\\.).)*?",QQ=(e,n={})=>t=>rt(t,e,n);rt.filter=QQ;var jt=(e,n={})=>Object.assign({},e,n),KQ=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return rt;let n=rt;return Object.assign((t,s,a={})=>n(t,s,jt(e,a)),{Minimatch:class extends n.Minimatch{constructor(t,s={}){super(t,jt(e,s))}static defaults(t){return n.defaults(jt(e,t)).Minimatch}},AST:class extends n.AST{constructor(t,s,a={}){super(t,s,jt(e,a))}static fromGlob(t,s={}){return n.AST.fromGlob(t,jt(e,s))}},unescape:(t,s={})=>n.unescape(t,jt(e,s)),escape:(t,s={})=>n.escape(t,jt(e,s)),filter:(t,s={})=>n.filter(t,jt(e,s)),defaults:t=>n.defaults(jt(e,t)),makeRe:(t,s={})=>n.makeRe(t,jt(e,s)),braceExpand:(t,s={})=>n.braceExpand(t,jt(e,s)),match:(t,s,a={})=>n.match(t,s,jt(e,a)),sep:n.sep,GLOBSTAR:ot})};rt.defaults=KQ;var ZO=(e,n={})=>(ah(e),n.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:iQ(e,{max:n.braceExpandMax}));rt.braceExpand=ZO;var zQ=(e,n={})=>new _a(e,n).makeRe();rt.makeRe=zQ;var BQ=(e,n,t={})=>{let s=new _a(n,t);return e=e.filter(a=>s.match(a)),s.options.nonull&&!e.length&&e.push(n),e};rt.match=BQ;var wO=/[?*]|[+@!]\(.*?\)|\[|\]/,HQ=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_a=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){ah(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||XO,this.isWindows=this.platform==="win32";let t="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[t]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);let t=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(t),this.debug(this.pattern,this.globParts);let s=this.globParts.map((a,o,r)=>{if(this.isWindows&&this.windowsNoMagicRoot){let i=a[0]===""&&a[1]===""&&(a[2]==="?"||!wO.test(a[2]))&&!wO.test(a[3]),c=/^[a-z]:/i.test(a[0]);if(i)return[...a.slice(0,4),...a.slice(4).map(d=>this.parse(d))];if(c)return[a[0],...a.slice(1).map(d=>this.parse(d))]}return a.map(i=>this.parse(i))});if(this.debug(this.pattern,s),this.set=s.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){let o=this.set[a];o[0]===""&&o[1]===""&&this.globParts[a][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let s=0;s<e[t].length;s++)e[t][s]==="**"&&(e[t][s]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let t=-1;for(;(t=n.indexOf("**",t+1))!==-1;){let s=t;for(;n[s+1]==="**";)s++;s!==t&&n.splice(t,s-t)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((t,s)=>{let a=t[t.length-1];return s==="**"&&a==="**"?t:s===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(t.pop(),t):(t.push(s),t)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let a=e[s];s===1&&a===""&&e[0]===""||(a==="."||a==="")&&(n=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let t=0;for(;(t=e.indexOf("..",t+1))!==-1;){let s=e[t-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,e.splice(t-1,2),t-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let t of e){let s=-1;for(;(s=t.indexOf("**",s+1))!==-1;){let o=s;for(;t[o+1]==="**";)o++;o>s&&t.splice(s+1,o-s);let r=t[s+1],i=t[s+2],c=t[s+3];if(r!==".."||!i||i==="."||i===".."||!c||c==="."||c==="..")continue;n=!0,t.splice(s,1);let d=t.slice(0);d[s]="**",e.push(d),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){let r=t[o];o===1&&r===""&&t[0]===""||(r==="."||r==="")&&(n=!0,t.splice(o,1),o--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let a=0;for(;(a=t.indexOf("..",a+1))!==-1;){let o=t[a-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let r=a===1&&t[a+1]==="**"?["."]:[];t.splice(a-1,2,...r),t.length===0&&t.push(""),a-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let t=n+1;t<e.length;t++){let s=this.partsMatch(e[n],e[t],!this.preserveMultipleSlashes);if(s){e[n]=[],e[t]=s;break}}return e.filter(n=>n.length)}partsMatch(e,n,t=!1){let s=0,a=0,o=[],r="";for(;s<e.length&&a<n.length;)if(e[s]===n[a])o.push(r==="b"?n[a]:e[s]),s++,a++;else if(t&&e[s]==="**"&&n[a]===e[s+1])o.push(e[s]),s++;else if(t&&n[a]==="**"&&e[s]===n[a+1])o.push(n[a]),a++;else if(e[s]==="*"&&n[a]&&(this.options.dot||!n[a].startsWith("."))&&n[a]!=="**"){if(r==="b")return!1;r="a",o.push(e[s]),s++,a++}else if(n[a]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(r==="a")return!1;r="b",o.push(n[a]),s++,a++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,t=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)n=!n,t++;t&&(this.pattern=e.slice(t)),this.negate=n}matchOne(e,n,t=!1){let s=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),f=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),y=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=!y&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),E=f?3:m?0:void 0,S=g?3:y?0:void 0;if(typeof E=="number"&&typeof S=="number"){let[R,w]=[e[E],n[S]];R.toLowerCase()===w.toLowerCase()&&(n[S]=R,S>E?n=n.slice(S):E>S&&(e=e.slice(E)))}}let{optimizationLevel:a=1}=this.options;a>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,r=0,i=e.length,c=n.length;o<i&&r<c;o++,r++){this.debug("matchOne loop");var d=n[r],l=e[o];if(this.debug(n,d,l),d===!1)return!1;if(d===ot){this.debug("GLOBSTAR",[n,d,l]);var p=o,u=r+1;if(u===c){for(this.debug("** at the end");o<i;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<i;){var h=e[p];if(this.debug(`
145
145
  globstar while`,e,p,n,u,h),this.matchOne(e.slice(p),n.slice(u),t))return this.debug("globstar found match!",p,i,h),!0;if(h==="."||h===".."||!s.dot&&h.charAt(0)==="."){this.debug("dot detected!",e,p,n,u);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(t&&(this.debug(`
146
- >>> no match, partial?`,e,p,n,u),p===i))}let m;if(typeof d=="string"?(m=l===d,this.debug("string match",d,l,m)):(m=d.test(l),this.debug("pattern match",d,l,m)),!m)return!1}if(o===i&&r===c)return!0;if(o===i)return t;if(r===c)return o===i-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return ZO(this.pattern,this.options)}parse(e){ah(e);let n=this.options;if(e==="**")return ot;if(e==="")return"";let t,s=null;(t=e.match(NQ))?s=n.dot?PQ:LQ:(t=e.match(bQ))?s=(n.nocase?n.dot?AQ:_Q:n.dot?RQ:TQ)(t[1]):(t=e.match(CQ))?s=(n.nocase?n.dot?UQ:DQ:n.dot?MQ:FQ)(t):(t=e.match(wQ))?s=n.dot?vQ:OQ:(t=e.match(kQ))&&(s=IQ);let a=HO.fromGlob(e,this.options).toMMPattern();return s&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:s}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,t=n.noglobstar?YQ:n.dot?VQ:$Q,s=new Set(n.nocase?["i"]:[]),a=e.map(i=>{let c=i.map(l=>{if(l instanceof RegExp)for(let p of l.flags.split(""))s.add(p);return typeof l=="string"?HQ(l):l===ot?ot:l._src});c.forEach((l,p)=>{let u=c[p+1],h=c[p-1];l!==ot||h===ot||(h===void 0?u!==void 0&&u!==ot?c[p+1]="(?:\\/|"+t+"\\/)?"+u:c[p]=t:u===void 0?c[p-1]=h+"(?:\\/|\\/"+t+")?":u!==ot&&(c[p-1]=h+"(?:\\/|\\/"+t+"\\/)"+u,c[p+1]=ot))});let d=c.filter(l=>l!==ot);if(this.partial&&d.length>=1){let l=[];for(let p=1;p<=d.length;p++)l.push(d.slice(0,p).join("/"));return"(?:"+l.join("|")+")"}return d.join("/")}).join("|"),[o,r]=e.length>1?["(?:",")"]:["",""];a="^"+o+a+r+"$",this.partial&&(a="^(?:\\/|"+o+a.slice(1,-1)+r+")$"),this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let t=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let a=this.set;this.debug(this.pattern,"set",a);let o=s[s.length-1];if(!o)for(let r=s.length-2;!o&&r>=0;r--)o=s[r];for(let r=0;r<a.length;r++){let i=a[r],c=s;if(t.matchBase&&i.length===1&&(c=[o]),this.matchOne(c,i,n))return t.flipNegate?!0:!this.negate}return t.flipNegate?!1:this.negate}static defaults(e){return rt.defaults(e).Minimatch}};rt.AST=HO;rt.Minimatch=_a;rt.escape=WO;rt.unescape=Yr;var WQ=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,nv=new Set,G1=typeof process=="object"&&process?process:{},tv=(e,n,t,s)=>{typeof G1.emitWarning=="function"?G1.emitWarning(e,n,t,s):console.error(`[${t}] ${n}: ${e}`)},oh=globalThis.AbortController,OO=globalThis.AbortSignal;if(typeof oh>"u"){OO=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,s){this._onabort.push(s)}},oh=class{constructor(){n()}signal=new OO;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(let s of this.signal._onabort)s(t);this.signal.onabort?.(t)}}};let e=G1.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",n=()=>{e&&(e=!1,tv("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",n))}}var GQ=e=>!nv.has(e),Ra=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),sv=e=>Ra(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?th:null:null,th=class extends Array{constructor(e){super(e),this.fill(0)}},JQ=class yd{heap;length;static#e=!1;static create(n){let t=sv(n);if(!t)return[];yd.#e=!0;let s=new yd(n,t);return yd.#e=!1,s}constructor(n,t){if(!yd.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(n),this.length=0}push(n){this.heap[this.length++]=n}pop(){return this.heap[--this.length]}},ch=class av{#e;#n;#a;#s;#r;#m;#u;#l;get perf(){return this.#l}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#c;#h;#d;#o;#f;#b;#x;#y;#v;#g;#_;#A;#E;#S;#T;#w;#t;#C;static unsafeExposeInternals(n){return{starts:n.#A,ttls:n.#E,autopurgeTimers:n.#S,sizes:n.#_,keyMap:n.#h,keyList:n.#d,valList:n.#o,next:n.#f,prev:n.#b,get head(){return n.#x},get tail(){return n.#y},free:n.#v,isBackgroundFetch:t=>n.#p(t),backgroundFetch:(t,s,a,o)=>n.#V(t,s,a,o),moveToTail:t=>n.#U(t),indexes:t=>n.#I(t),rindexes:t=>n.#N(t),isStale:t=>n.#R(t)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#c}get size(){return this.#i}get fetchMethod(){return this.#m}get memoMethod(){return this.#u}get dispose(){return this.#a}get onInsert(){return this.#s}get disposeAfter(){return this.#r}constructor(n){let{max:t=0,ttl:s,ttlResolution:a=1,ttlAutopurge:o,updateAgeOnGet:r,updateAgeOnHas:i,allowStale:c,dispose:d,onInsert:l,disposeAfter:p,noDisposeOnSet:u,noUpdateTTL:h,maxSize:m=0,maxEntrySize:f=0,sizeCalculation:y,fetchMethod:g,memoMethod:E,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:_,ignoreFetchAbort:x,perf:A}=n;if(A!==void 0&&typeof A?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#l=A??WQ,t!==0&&!Ra(t))throw new TypeError("max option must be a nonnegative integer");let k=t?sv(t):Array;if(!k)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=m,this.maxEntrySize=f||this.#n,this.sizeCalculation=y,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#u=E,g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#m=g,this.#w=!!g,this.#h=new Map,this.#d=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#f=new k(t),this.#b=new k(t),this.#x=0,this.#y=0,this.#v=JQ.create(t),this.#i=0,this.#c=0,typeof d=="function"&&(this.#a=d),typeof l=="function"&&(this.#s=l),typeof p=="function"?(this.#r=p,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#T=!!this.#a,this.#C=!!this.#s,this.#t=!!this.#r,this.noDisposeOnSet=!!u,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#n!==0&&!Ra(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Ra(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#Q()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!i,this.ttlResolution=Ra(a)||a===0?a:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!Ra(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#L()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let M="LRU_CACHE_UNBOUNDED";GQ(M)&&(nv.add(M),tv("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,av))}}getRemainingTTL(n){return this.#h.has(n)?1/0:0}#L(){let n=new th(this.#e),t=new th(this.#e);this.#E=n,this.#A=t;let s=this.ttlAutopurge?new Array(this.#e):void 0;this.#S=s,this.#F=(r,i,c=this.#l.now())=>{if(t[r]=i!==0?c:0,n[r]=i,s?.[r]&&(clearTimeout(s[r]),s[r]=void 0),i!==0&&s){let d=setTimeout(()=>{this.#R(r)&&this.#k(this.#d[r],"expire")},i+1);d.unref&&d.unref(),s[r]=d}},this.#O=r=>{t[r]=n[r]!==0?this.#l.now():0},this.#P=(r,i)=>{if(n[i]){let c=n[i],d=t[i];if(!c||!d)return;r.ttl=c,r.start=d,r.now=a||o();let l=r.now-d;r.remainingTTL=c-l}};let a=0,o=()=>{let r=this.#l.now();if(this.ttlResolution>0){a=r;let i=setTimeout(()=>a=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.#h.get(r);if(i===void 0)return 0;let c=n[i],d=t[i];if(!c||!d)return 1/0;let l=(a||o())-d;return c-l},this.#R=r=>{let i=t[r],c=n[r];return!!c&&!!i&&(a||o())-i>c}}#O=()=>{};#P=()=>{};#F=()=>{};#R=()=>!1;#Q(){let n=new th(this.#e);this.#c=0,this.#_=n,this.#M=t=>{this.#c-=n[t],n[t]=0},this.#q=(t,s,a,o)=>{if(this.#p(s))return 0;if(!Ra(a))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(a=o(s,t),!Ra(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a},this.#D=(t,s,a)=>{if(n[t]=s,this.#n){let o=this.#n-n[t];for(;this.#c>o;)this.#Y(!0)}this.#c+=n[t],a&&(a.entrySize=s,a.totalCalculatedSize=this.#c)}}#M=n=>{};#D=(n,t,s)=>{};#q=(n,t,s,a)=>{if(s||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#I({allowStale:n=this.allowStale}={}){if(this.#i)for(let t=this.#y;!(!this.#j(t)||((n||!this.#R(t))&&(yield t),t===this.#x));)t=this.#b[t]}*#N({allowStale:n=this.allowStale}={}){if(this.#i)for(let t=this.#x;!(!this.#j(t)||((n||!this.#R(t))&&(yield t),t===this.#y));)t=this.#f[t]}#j(n){return n!==void 0&&this.#h.get(this.#d[n])===n}*entries(){for(let n of this.#I())this.#o[n]!==void 0&&this.#d[n]!==void 0&&!this.#p(this.#o[n])&&(yield[this.#d[n],this.#o[n]])}*rentries(){for(let n of this.#N())this.#o[n]!==void 0&&this.#d[n]!==void 0&&!this.#p(this.#o[n])&&(yield[this.#d[n],this.#o[n]])}*keys(){for(let n of this.#I()){let t=this.#d[n];t!==void 0&&!this.#p(this.#o[n])&&(yield t)}}*rkeys(){for(let n of this.#N()){let t=this.#d[n];t!==void 0&&!this.#p(this.#o[n])&&(yield t)}}*values(){for(let n of this.#I())this.#o[n]!==void 0&&!this.#p(this.#o[n])&&(yield this.#o[n])}*rvalues(){for(let n of this.#N())this.#o[n]!==void 0&&!this.#p(this.#o[n])&&(yield this.#o[n])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(n,t={}){for(let s of this.#I()){let a=this.#o[s],o=this.#p(a)?a.__staleWhileFetching:a;if(o!==void 0&&n(o,this.#d[s],this))return this.get(this.#d[s],t)}}forEach(n,t=this){for(let s of this.#I()){let a=this.#o[s],o=this.#p(a)?a.__staleWhileFetching:a;o!==void 0&&n.call(t,o,this.#d[s],this)}}rforEach(n,t=this){for(let s of this.#N()){let a=this.#o[s],o=this.#p(a)?a.__staleWhileFetching:a;o!==void 0&&n.call(t,o,this.#d[s],this)}}purgeStale(){let n=!1;for(let t of this.#N({allowStale:!0}))this.#R(t)&&(this.#k(this.#d[t],"expire"),n=!0);return n}info(n){let t=this.#h.get(n);if(t===void 0)return;let s=this.#o[t],a=this.#p(s)?s.__staleWhileFetching:s;if(a===void 0)return;let o={value:a};if(this.#E&&this.#A){let r=this.#E[t],i=this.#A[t];if(r&&i){let c=r-(this.#l.now()-i);o.ttl=c,o.start=Date.now()}}return this.#_&&(o.size=this.#_[t]),o}dump(){let n=[];for(let t of this.#I({allowStale:!0})){let s=this.#d[t],a=this.#o[t],o=this.#p(a)?a.__staleWhileFetching:a;if(o===void 0||s===void 0)continue;let r={value:o};if(this.#E&&this.#A){r.ttl=this.#E[t];let i=this.#l.now()-this.#A[t];r.start=Math.floor(Date.now()-i)}this.#_&&(r.size=this.#_[t]),n.unshift([s,r])}return n}load(n){this.clear();for(let[t,s]of n){if(s.start){let a=Date.now()-s.start;s.start=this.#l.now()-a}this.set(t,s.value,s)}}set(n,t,s={}){if(t===void 0)return this.delete(n),this;let{ttl:a=this.ttl,start:o,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:i=this.sizeCalculation,status:c}=s,{noUpdateTTL:d=this.noUpdateTTL}=s,l=this.#q(n,t,s.size||0,i);if(this.maxEntrySize&&l>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#k(n,"set"),this;let p=this.#i===0?void 0:this.#h.get(n);if(p===void 0)p=this.#i===0?this.#y:this.#v.length!==0?this.#v.pop():this.#i===this.#e?this.#Y(!1):this.#i,this.#d[p]=n,this.#o[p]=t,this.#h.set(n,p),this.#f[this.#y]=p,this.#b[p]=this.#y,this.#y=p,this.#i++,this.#D(p,l,c),c&&(c.set="add"),d=!1,this.#C&&this.#s?.(t,n,"add");else{this.#U(p);let u=this.#o[p];if(t!==u){if(this.#w&&this.#p(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=u;h!==void 0&&!r&&(this.#T&&this.#a?.(h,n,"set"),this.#t&&this.#g?.push([h,n,"set"]))}else r||(this.#T&&this.#a?.(u,n,"set"),this.#t&&this.#g?.push([u,n,"set"]));if(this.#M(p),this.#D(p,l,c),this.#o[p]=t,c){c.set="replace";let h=u&&this.#p(u)?u.__staleWhileFetching:u;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update");this.#C&&this.onInsert?.(t,n,t===u?"update":"replace")}if(a!==0&&!this.#E&&this.#L(),this.#E&&(d||this.#F(p,a,o),c&&this.#P(c,p)),!r&&this.#t&&this.#g){let u=this.#g,h;for(;h=u?.shift();)this.#r?.(...h)}return this}pop(){try{for(;this.#i;){let n=this.#o[this.#x];if(this.#Y(!0),this.#p(n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(this.#t&&this.#g){let n=this.#g,t;for(;t=n?.shift();)this.#r?.(...t)}}}#Y(n){let t=this.#x,s=this.#d[t],a=this.#o[t];return this.#w&&this.#p(a)?a.__abortController.abort(new Error("evicted")):(this.#T||this.#t)&&(this.#T&&this.#a?.(a,s,"evict"),this.#t&&this.#g?.push([a,s,"evict"])),this.#M(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),n&&(this.#d[t]=void 0,this.#o[t]=void 0,this.#v.push(t)),this.#i===1?(this.#x=this.#y=0,this.#v.length=0):this.#x=this.#f[t],this.#h.delete(s),this.#i--,t}has(n,t={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:a}=t,o=this.#h.get(n);if(o!==void 0){let r=this.#o[o];if(this.#p(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#R(o))a&&(a.has="stale",this.#P(a,o));else return s&&this.#O(o),a&&(a.has="hit",this.#P(a,o)),!0}else a&&(a.has="miss");return!1}peek(n,t={}){let{allowStale:s=this.allowStale}=t,a=this.#h.get(n);if(a===void 0||!s&&this.#R(a))return;let o=this.#o[a];return this.#p(o)?o.__staleWhileFetching:o}#V(n,t,s,a){let o=t===void 0?void 0:this.#o[t];if(this.#p(o))return o;let r=new oh,{signal:i}=s;i?.addEventListener("abort",()=>r.abort(i.reason),{signal:r.signal});let c={signal:r.signal,options:s,context:a},d=(f,y=!1)=>{let{aborted:g}=r.signal,E=s.ignoreFetchAbort&&f!==void 0,S=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&f!==void 0);if(s.status&&(g&&!y?(s.status.fetchAborted=!0,s.status.fetchError=r.signal.reason,E&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),g&&!E&&!y)return p(r.signal.reason,S);let R=h,w=this.#o[t];return(w===h||E&&y&&w===void 0)&&(f===void 0?R.__staleWhileFetching!==void 0?this.#o[t]=R.__staleWhileFetching:this.#k(n,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(n,f,c.options))),f},l=f=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=f),p(f,!1)),p=(f,y)=>{let{aborted:g}=r.signal,E=g&&s.allowStaleOnFetchAbort,S=E||s.allowStaleOnFetchRejection,R=S||s.noDeleteOnFetchRejection,w=h;if(this.#o[t]===h&&(!R||!y&&w.__staleWhileFetching===void 0?this.#k(n,"fetch"):E||(this.#o[t]=w.__staleWhileFetching)),S)return s.status&&w.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw f},u=(f,y)=>{let g=this.#m?.(n,o,c);g&&g instanceof Promise&&g.then(E=>f(E===void 0?void 0:E),y),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(f(void 0),s.allowStaleOnFetchAbort&&(f=E=>d(E,!0)))})};s.status&&(s.status.fetchDispatched=!0);let h=new Promise(u).then(d,l),m=Object.assign(h,{__abortController:r,__staleWhileFetching:o,__returned:void 0});return t===void 0?(this.set(n,m,{...c.options,status:void 0}),t=this.#h.get(n)):this.#o[t]=m,m}#p(n){if(!this.#w)return!1;let t=n;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof oh}async fetch(n,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:c=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:f,forceRefresh:y=!1,status:g,signal:E}=t;if(!this.#w)return g&&(g.fetch="get"),this.get(n,{allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:o,status:g});let S={allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:o,ttl:r,noDisposeOnSet:i,size:c,sizeCalculation:d,noUpdateTTL:l,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:m,ignoreFetchAbort:h,status:g,signal:E},R=this.#h.get(n);if(R===void 0){g&&(g.fetch="miss");let w=this.#V(n,R,S,f);return w.__returned=w}else{let w=this.#o[R];if(this.#p(w)){let k=s&&w.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",k&&(g.returnedStale=!0)),k?w.__staleWhileFetching:w.__returned=w}let _=this.#R(R);if(!y&&!_)return g&&(g.fetch="hit"),this.#U(R),a&&this.#O(R),g&&this.#P(g,R),w;let x=this.#V(n,R,S,f),A=x.__staleWhileFetching!==void 0&&s;return g&&(g.fetch=_?"stale":"refresh",A&&_&&(g.returnedStale=!0)),A?x.__staleWhileFetching:x.__returned=x}}async forceFetch(n,t={}){let s=await this.fetch(n,t);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(n,t={}){let s=this.#u;if(!s)throw new Error("no memoMethod provided to constructor");let{context:a,forceRefresh:o,...r}=t,i=this.get(n,r);if(!o&&i!==void 0)return i;let c=s(n,i,{options:r,context:a});return this.set(n,c,r),c}get(n,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:r}=t,i=this.#h.get(n);if(i!==void 0){let c=this.#o[i],d=this.#p(c);return r&&this.#P(r,i),this.#R(i)?(r&&(r.get="stale"),d?(r&&s&&c.__staleWhileFetching!==void 0&&(r.returnedStale=!0),s?c.__staleWhileFetching:void 0):(o||this.#k(n,"expire"),r&&s&&(r.returnedStale=!0),s?c:void 0)):(r&&(r.get="hit"),d?c.__staleWhileFetching:(this.#U(i),a&&this.#O(i),c))}else r&&(r.get="miss")}#$(n,t){this.#b[t]=n,this.#f[n]=t}#U(n){n!==this.#y&&(n===this.#x?this.#x=this.#f[n]:this.#$(this.#b[n],this.#f[n]),this.#$(this.#y,n),this.#y=n)}delete(n){return this.#k(n,"delete")}#k(n,t){let s=!1;if(this.#i!==0){let a=this.#h.get(n);if(a!==void 0)if(this.#S?.[a]&&(clearTimeout(this.#S?.[a]),this.#S[a]=void 0),s=!0,this.#i===1)this.#K(t);else{this.#M(a);let o=this.#o[a];if(this.#p(o)?o.__abortController.abort(new Error("deleted")):(this.#T||this.#t)&&(this.#T&&this.#a?.(o,n,t),this.#t&&this.#g?.push([o,n,t])),this.#h.delete(n),this.#d[a]=void 0,this.#o[a]=void 0,a===this.#y)this.#y=this.#b[a];else if(a===this.#x)this.#x=this.#f[a];else{let r=this.#b[a];this.#f[r]=this.#f[a];let i=this.#f[a];this.#b[i]=this.#b[a]}this.#i--,this.#v.push(a)}}if(this.#t&&this.#g?.length){let a=this.#g,o;for(;o=a?.shift();)this.#r?.(...o)}return s}clear(){return this.#K("delete")}#K(n){for(let t of this.#N({allowStale:!0})){let s=this.#o[t];if(this.#p(s))s.__abortController.abort(new Error("deleted"));else{let a=this.#d[t];this.#T&&this.#a?.(s,a,n),this.#t&&this.#g?.push([s,a,n])}}if(this.#h.clear(),this.#o.fill(void 0),this.#d.fill(void 0),this.#E&&this.#A){this.#E.fill(0),this.#A.fill(0);for(let t of this.#S??[])t!==void 0&&clearTimeout(t);this.#S?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#x=0,this.#y=0,this.#v.length=0,this.#c=0,this.#i=0,this.#t&&this.#g){let t=this.#g,s;for(;s=t?.shift();)this.#r?.(...s)}}},vO=typeof process=="object"&&process?process:{stdout:null,stderr:null},ZQ=e=>!!e&&typeof e=="object"&&(e instanceof rh||e instanceof Z1.default||eK(e)||nK(e)),eK=e=>!!e&&typeof e=="object"&&e instanceof dh.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==Z1.default.Writable.prototype.pipe,nK=e=>!!e&&typeof e=="object"&&e instanceof dh.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function",ks=Symbol("EOF"),Is=Symbol("maybeEmitEnd"),Ta=Symbol("emittedEnd"),Wu=Symbol("emittingEnd"),ld=Symbol("emittedError"),Gu=Symbol("closed"),kO=Symbol("read"),Ju=Symbol("flush"),IO=Symbol("flushChunk"),Zt=Symbol("encoding"),qr=Symbol("decoder"),Cn=Symbol("flowing"),pd=Symbol("paused"),jr=Symbol("resume"),Dn=Symbol("buffer"),at=Symbol("pipes"),Un=Symbol("bufferLength"),$1=Symbol("bufferPush"),Xu=Symbol("bufferShift"),Gn=Symbol("objectMode"),_n=Symbol("destroyed"),Q1=Symbol("error"),K1=Symbol("emitData"),NO=Symbol("emitEnd"),z1=Symbol("emitEnd2"),ys=Symbol("async"),B1=Symbol("abort"),Zu=Symbol("aborted"),ud=Symbol("signal"),So=Symbol("dataListeners"),It=Symbol("discarded"),hd=e=>Promise.resolve().then(e),tK=e=>e(),sK=e=>e==="end"||e==="finish"||e==="prefinish",aK=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,oK=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),iv=class{src;dest;opts;ondrain;constructor(e,n,t){this.src=e,this.dest=n,this.opts=t,this.ondrain=()=>e[jr](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},rK=class extends iv{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,t){super(e,n,t),this.proxyErrors=s=>this.dest.emit("error",s),e.on("error",this.proxyErrors)}},iK=e=>!!e.objectMode,cK=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",rh=class extends dh.EventEmitter{[Cn]=!1;[pd]=!1;[at]=[];[Dn]=[];[Gn];[Zt];[ys];[qr];[ks]=!1;[Ta]=!1;[Wu]=!1;[Gu]=!1;[ld]=null;[Un]=0;[_n]=!1;[ud];[Zu]=!1;[So]=0;[It]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");iK(n)?(this[Gn]=!0,this[Zt]=null):cK(n)?(this[Zt]=n.encoding,this[Gn]=!1):(this[Gn]=!1,this[Zt]=null),this[ys]=!!n.async,this[qr]=this[Zt]?new rv.StringDecoder(this[Zt]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Dn]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[at]});let{signal:t}=n;t&&(this[ud]=t,t.aborted?this[B1]():t.addEventListener("abort",()=>this[B1]()))}get bufferLength(){return this[Un]}get encoding(){return this[Zt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Gn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ys]}set async(e){this[ys]=this[ys]||!!e}[B1](){this[Zu]=!0,this.emit("abort",this[ud]?.reason),this.destroy(this[ud]?.reason)}get aborted(){return this[Zu]}set aborted(e){}write(e,n,t){if(this[Zu])return!1;if(this[ks])throw new Error("write after end");if(this[_n])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(t=n,n="utf8"),n||(n="utf8");let s=this[ys]?hd:tK;if(!this[Gn]&&!Buffer.isBuffer(e)){if(oK(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(aK(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Gn]?(this[Cn]&&this[Un]!==0&&this[Ju](!0),this[Cn]?this.emit("data",e):this[$1](e),this[Un]!==0&&this.emit("readable"),t&&s(t),this[Cn]):e.length?(typeof e=="string"&&!(n===this[Zt]&&!this[qr]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Zt]&&(e=this[qr].write(e)),this[Cn]&&this[Un]!==0&&this[Ju](!0),this[Cn]?this.emit("data",e):this[$1](e),this[Un]!==0&&this.emit("readable"),t&&s(t),this[Cn]):(this[Un]!==0&&this.emit("readable"),t&&s(t),this[Cn])}read(e){if(this[_n])return null;if(this[It]=!1,this[Un]===0||e===0||e&&e>this[Un])return this[Is](),null;this[Gn]&&(e=null),this[Dn].length>1&&!this[Gn]&&(this[Dn]=[this[Zt]?this[Dn].join(""):Buffer.concat(this[Dn],this[Un])]);let n=this[kO](e||null,this[Dn][0]);return this[Is](),n}[kO](e,n){if(this[Gn])this[Xu]();else{let t=n;e===t.length||e===null?this[Xu]():typeof t=="string"?(this[Dn][0]=t.slice(e),n=t.slice(0,e),this[Un]-=e):(this[Dn][0]=t.subarray(e),n=t.subarray(0,e),this[Un]-=e)}return this.emit("data",n),!this[Dn].length&&!this[ks]&&this.emit("drain"),n}end(e,n,t){return typeof e=="function"&&(t=e,e=void 0),typeof n=="function"&&(t=n,n="utf8"),e!==void 0&&this.write(e,n),t&&this.once("end",t),this[ks]=!0,this.writable=!1,(this[Cn]||!this[pd])&&this[Is](),this}[jr](){this[_n]||(!this[So]&&!this[at].length&&(this[It]=!0),this[pd]=!1,this[Cn]=!0,this.emit("resume"),this[Dn].length?this[Ju]():this[ks]?this[Is]():this.emit("drain"))}resume(){return this[jr]()}pause(){this[Cn]=!1,this[pd]=!0,this[It]=!1}get destroyed(){return this[_n]}get flowing(){return this[Cn]}get paused(){return this[pd]}[$1](e){this[Gn]?this[Un]+=1:this[Un]+=e.length,this[Dn].push(e)}[Xu](){return this[Gn]?this[Un]-=1:this[Un]-=this[Dn][0].length,this[Dn].shift()}[Ju](e=!1){do;while(this[IO](this[Xu]())&&this[Dn].length);!e&&!this[Dn].length&&!this[ks]&&this.emit("drain")}[IO](e){return this.emit("data",e),this[Cn]}pipe(e,n){if(this[_n])return e;this[It]=!1;let t=this[Ta];return n=n||{},e===vO.stdout||e===vO.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,t?n.end&&e.end():(this[at].push(n.proxyErrors?new rK(this,e,n):new iv(this,e,n)),this[ys]?hd(()=>this[jr]()):this[jr]()),e}unpipe(e){let n=this[at].find(t=>t.dest===e);n&&(this[at].length===1?(this[Cn]&&this[So]===0&&(this[Cn]=!1),this[at]=[]):this[at].splice(this[at].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let t=super.on(e,n);if(e==="data")this[It]=!1,this[So]++,!this[at].length&&!this[Cn]&&this[jr]();else if(e==="readable"&&this[Un]!==0)super.emit("readable");else if(sK(e)&&this[Ta])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ld]){let s=n;this[ys]?hd(()=>s.call(this,this[ld])):s.call(this,this[ld])}return t}removeListener(e,n){return this.off(e,n)}off(e,n){let t=super.off(e,n);return e==="data"&&(this[So]=this.listeners("data").length,this[So]===0&&!this[It]&&!this[at].length&&(this[Cn]=!1)),t}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[So]=0,!this[It]&&!this[at].length&&(this[Cn]=!1)),n}get emittedEnd(){return this[Ta]}[Is](){!this[Wu]&&!this[Ta]&&!this[_n]&&this[Dn].length===0&&this[ks]&&(this[Wu]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Gu]&&this.emit("close"),this[Wu]=!1)}emit(e,...n){let t=n[0];if(e!=="error"&&e!=="close"&&e!==_n&&this[_n])return!1;if(e==="data")return!this[Gn]&&!t?!1:this[ys]?(hd(()=>this[K1](t)),!0):this[K1](t);if(e==="end")return this[NO]();if(e==="close"){if(this[Gu]=!0,!this[Ta]&&!this[_n])return!1;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(e==="error"){this[ld]=t,super.emit(Q1,t);let a=!this[ud]||this.listeners("error").length?super.emit("error",t):!1;return this[Is](),a}else if(e==="resume"){let a=super.emit("resume");return this[Is](),a}else if(e==="finish"||e==="prefinish"){let a=super.emit(e);return this.removeAllListeners(e),a}let s=super.emit(e,...n);return this[Is](),s}[K1](e){for(let t of this[at])t.dest.write(e)===!1&&this.pause();let n=this[It]?!1:super.emit("data",e);return this[Is](),n}[NO](){return this[Ta]?!1:(this[Ta]=!0,this.readable=!1,this[ys]?(hd(()=>this[z1]()),!0):this[z1]())}[z1](){if(this[qr]){let n=this[qr].end();if(n){for(let t of this[at])t.dest.write(n);this[It]||super.emit("data",n)}}for(let n of this[at])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Gn]||(e.dataLength=0);let n=this.promise();return this.on("data",t=>{e.push(t),this[Gn]||(e.dataLength+=t.length)}),await n,e}async concat(){if(this[Gn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Zt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(_n,()=>n(new Error("stream destroyed"))),this.on("error",t=>n(t)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[It]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ks])return n();let s,a,o=d=>{this.off("data",r),this.off("end",i),this.off(_n,c),n(),a(d)},r=d=>{this.off("error",o),this.off("end",i),this.off(_n,c),this.pause(),s({value:d,done:!!this[ks]})},i=()=>{this.off("error",o),this.off("data",r),this.off(_n,c),n(),s({done:!0,value:void 0})},c=()=>o(new Error("stream destroyed"));return new Promise((d,l)=>{a=l,s=d,this.once(_n,c),this.once("error",o),this.once("end",i),this.once("data",r)})},throw:n,return:n,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[It]=!1;let e=!1,n=()=>(this.pause(),this.off(Q1,n),this.off(_n,n),this.off("end",n),e=!0,{done:!0,value:void 0}),t=()=>{if(e)return n();let s=this.read();return s===null?n():{done:!1,value:s}};return this.once("end",n),this.once(Q1,n),this.once(_n,n),{next:t,throw:n,return:n,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[_n])return e?this.emit("error",e):this.emit(_n),this;this[_n]=!0,this[It]=!0,this[Dn].length=0,this[Un]=0;let n=this;return typeof n.close=="function"&&!this[Gu]&&n.close(),e?this.emit("error",e):this.emit(_n),this}static get isStream(){return ZQ}},dK=Es.realpathSync.native,gd={lstatSync:Es.lstatSync,readdir:Es.readdir,readdirSync:Es.readdirSync,readlinkSync:Es.readlinkSync,realpathSync:dK,promises:{lstat:Aa.lstat,readdir:Aa.readdir,readlink:Aa.readlink,realpath:Aa.realpath}},cv=e=>!e||e===gd||e===XQ?gd:{...gd,...e,promises:{...gd.promises,...e.promises||{}}},dv=/^\\\\\?\\([a-z]:)\\?$/i,lK=e=>e.replace(/\//g,"\\").replace(dv,"$1\\"),pK=/[\\\/]/,Vt=0,lv=1,pv=2,gs=4,uv=6,hv=8,xo=10,mv=12,Yt=15,md=~Yt,H1=16,LO=32,Ed=64,es=128,eh=256,sh=512,PO=Ed|es|sh,uK=1023,W1=e=>e.isFile()?hv:e.isDirectory()?gs:e.isSymbolicLink()?xo:e.isCharacterDevice()?pv:e.isBlockDevice()?uv:e.isSocket()?mv:e.isFIFO()?lv:Vt,CO=new ch({max:2**12}),Sd=e=>{let n=CO.get(e);if(n)return n;let t=e.normalize("NFKD");return CO.set(e,t),t},DO=new ch({max:2**12}),nh=e=>{let n=DO.get(e);if(n)return n;let t=Sd(e.toLowerCase());return DO.set(e,t),t},UO=class extends ch{constructor(){super({max:256})}},hK=class extends ch{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}},fv=Symbol("PathScurry setAsCwd"),ft=class{name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#a;get mode(){return this.#a}#s;get nlink(){return this.#s}#r;get uid(){return this.#r}#m;get gid(){return this.#m}#u;get rdev(){return this.#u}#l;get blksize(){return this.#l}#i;get ino(){return this.#i}#c;get size(){return this.#c}#h;get blocks(){return this.#h}#d;get atimeMs(){return this.#d}#o;get mtimeMs(){return this.#o}#f;get ctimeMs(){return this.#f}#b;get birthtimeMs(){return this.#b}#x;get atime(){return this.#x}#y;get mtime(){return this.#y}#v;get ctime(){return this.#v}#g;get birthtime(){return this.#g}#_;#A;#E;#S;#T;#w;#t;#C;#L;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=Vt,t,s,a,o,r){this.name=e,this.#_=a?nh(e):Sd(e),this.#t=n&uK,this.nocase=a,this.roots=s,this.root=t||this,this.#C=o,this.#E=r.fullpath,this.#T=r.relative,this.#w=r.relativePosix,this.parent=r.parent,this.parent?this.#e=this.parent.#e:this.#e=cv(r.fs)}depth(){return this.#A!==void 0?this.#A:this.parent?this.#A=this.parent.depth()+1:this.#A=0}childrenCache(){return this.#C}resolve(e){if(!e)return this;let n=this.getRootString(e),t=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#P(t):this.#P(t)}#P(e){let n=this;for(let t of e)n=n.child(t);return n}children(){let e=this.#C.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#C.set(this,n),this.#t&=~H1,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let t=this.children(),s=this.nocase?nh(e):Sd(e);for(let i of t)if(i.#_===s)return i;let a=this.parent?this.sep:"",o=this.#E?this.#E+a+e:void 0,r=this.newChild(e,Vt,{...n,parent:this,fullpath:o});return this.canReaddir()||(r.#t|=es),t.push(r),r}relative(){if(this.isCWD)return"";if(this.#T!==void 0)return this.#T;let e=this.name,n=this.parent;if(!n)return this.#T=this.name;let t=n.relative();return t+(!t||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,n=this.parent;if(!n)return this.#w=this.fullpathPosix();let t=n.relativePosix();return t+(!t||!n.parent?"":"/")+e}fullpath(){if(this.#E!==void 0)return this.#E;let e=this.name,n=this.parent;if(!n)return this.#E=this.name;let t=n.fullpath()+(n.parent?this.sep:"")+e;return this.#E=t}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep==="/")return this.#S=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#S=`//?/${s}`:this.#S=s}let e=this.parent,n=e.fullpathPosix(),t=n+(!n||!e.parent?"":"/")+this.name;return this.#S=t}isUnknown(){return(this.#t&Yt)===Vt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#t&Yt)===hv}isDirectory(){return(this.#t&Yt)===gs}isCharacterDevice(){return(this.#t&Yt)===pv}isBlockDevice(){return(this.#t&Yt)===uv}isFIFO(){return(this.#t&Yt)===lv}isSocket(){return(this.#t&Yt)===mv}isSymbolicLink(){return(this.#t&xo)===xo}lstatCached(){return this.#t&LO?this:void 0}readlinkCached(){return this.#L}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#L)return!0;if(!this.parent)return!1;let e=this.#t&Yt;return!(e!==Vt&&e!==xo||this.#t&eh||this.#t&es)}calledReaddir(){return!!(this.#t&H1)}isENOENT(){return!!(this.#t&es)}isNamed(e){return this.nocase?this.#_===nh(e):this.#_===Sd(e)}async readlink(){let e=this.#L;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(n);if(t)return this.#L=t}catch(n){this.#N(n.code);return}}readlinkSync(){let e=this.#L;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(n);if(t)return this.#L=t}catch(n){this.#N(n.code);return}}#F(e){this.#t|=H1;for(let n=e.provisional;n<e.length;n++){let t=e[n];t&&t.#R()}}#R(){this.#t&es||(this.#t=(this.#t|es)&md,this.#Q())}#Q(){let e=this.children();e.provisional=0;for(let n of e)n.#R()}#M(){this.#t|=sh,this.#D()}#D(){if(this.#t&Ed)return;let e=this.#t;(e&Yt)===gs&&(e&=md),this.#t=e|Ed,this.#Q()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#D():e==="ENOENT"?this.#R():this.children().provisional=0}#I(e=""){e==="ENOTDIR"?this.parent.#D():e==="ENOENT"&&this.#R()}#N(e=""){let n=this.#t;n|=eh,e==="ENOENT"&&(n|=es),(e==="EINVAL"||e==="UNKNOWN")&&(n&=md),this.#t=n,e==="ENOTDIR"&&this.parent&&this.parent.#D()}#j(e,n){return this.#V(e,n)||this.#Y(e,n)}#Y(e,n){let t=W1(e),s=this.newChild(e.name,t,{parent:this}),a=s.#t&Yt;return a!==gs&&a!==xo&&a!==Vt&&(s.#t|=Ed),n.unshift(s),n.provisional++,s}#V(e,n){for(let t=n.provisional;t<n.length;t++){let s=n[t];if((this.nocase?nh(e.name):Sd(e.name))===s.#_)return this.#p(e,s,t,n)}}#p(e,n,t,s){let a=n.name;return n.#t=n.#t&md|W1(e),a!==e.name&&(n.name=e.name),t!==s.provisional&&(t===s.length-1?s.pop():s.splice(t,1),s.unshift(n)),s.provisional++,n}async lstat(){if((this.#t&es)===0)try{return this.#$(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#I(e.code)}}lstatSync(){if((this.#t&es)===0)try{return this.#$(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#I(e.code)}}#$(e){let{atime:n,atimeMs:t,birthtime:s,birthtimeMs:a,blksize:o,blocks:r,ctime:i,ctimeMs:c,dev:d,gid:l,ino:p,mode:u,mtime:h,mtimeMs:m,nlink:f,rdev:y,size:g,uid:E}=e;this.#x=n,this.#d=t,this.#g=s,this.#b=a,this.#l=o,this.#h=r,this.#v=i,this.#f=c,this.#n=d,this.#m=l,this.#i=p,this.#a=u,this.#y=h,this.#o=m,this.#s=f,this.#u=y,this.#c=g,this.#r=E;let S=W1(e);this.#t=this.#t&md|S|LO,S!==Vt&&S!==gs&&S!==xo&&(this.#t|=Ed)}#U=[];#k=!1;#K(e){this.#k=!1;let n=this.#U.slice();this.#U.length=0,n.forEach(t=>t(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let t=this.children();if(this.calledReaddir()){let a=t.slice(0,t.provisional);n?e(null,a):queueMicrotask(()=>e(null,a));return}if(this.#U.push(e),this.#k)return;this.#k=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(a,o)=>{if(a)this.#q(a.code),t.provisional=0;else{for(let r of o)this.#j(r,t);this.#F(t)}this.#K(t.slice(0,t.provisional))})}#z;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#z)await this.#z;else{let t=()=>{};this.#z=new Promise(s=>t=s);try{for(let s of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#j(s,e);this.#F(e)}catch(s){this.#q(s.code),e.provisional=0}this.#z=void 0,t()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let t of this.#e.readdirSync(n,{withFileTypes:!0}))this.#j(t,e);this.#F(e)}catch(t){this.#q(t.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&PO)return!1;let e=Yt&this.#t;return e===Vt||e===gs||e===xo}shouldWalk(e,n){return(this.#t&gs)===gs&&!(this.#t&PO)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#O)return this.#O;if(!((sh|eh|es)&this.#t))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#M()}}realpathSync(){if(this.#O)return this.#O;if(!((sh|eh|es)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#M()}}[fv](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),t=[],s=this;for(;s&&s.parent;)n.add(s),s.#T=t.join(this.sep),s.#w=t.join("/"),s=s.parent,t.push("..");for(s=e;s&&s.parent&&!n.has(s);)s.#T=void 0,s.#w=void 0,s=s.parent}},yv=class gv extends ft{sep="\\";splitSep=pK;constructor(n,t=Vt,s,a,o,r,i){super(n,t,s,a,o,r,i)}newChild(n,t=Vt,s={}){return new gv(n,t,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(n){return Vr.win32.parse(n).root}getRoot(n){if(n=lK(n.toUpperCase()),n===this.root.name)return this.root;for(let[t,s]of Object.entries(this.roots))if(this.sameRoot(n,t))return this.roots[n]=s;return this.roots[n]=new eS(n,this).root}sameRoot(n,t=this.root.name){return n=n.toUpperCase().replace(/\//g,"\\").replace(dv,"$1\\"),n===t}},Ev=class Sv extends ft{splitSep="/";sep="/";constructor(n,t=Vt,s,a,o,r,i){super(n,t,s,a,o,r,i)}getRootString(n){return n.startsWith("/")?"/":""}getRoot(n){return this.root}newChild(n,t=Vt,s={}){return new Sv(n,t,this.root,this.roots,this.nocase,this.childrenCache(),s)}},xv=class{root;rootPath;roots;cwd;#e;#n;#a;nocase;#s;constructor(e=process.cwd(),n,t,{nocase:s,childrenCacheSize:a=16*1024,fs:o=gd}={}){this.#s=cv(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,ov.fileURLToPath)(e));let r=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(r),this.#e=new UO,this.#n=new UO,this.#a=new hK(a);let i=r.substring(this.rootPath.length).split(t);if(i.length===1&&!i[0]&&i.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let c=this.root,d=i.length-1,l=n.sep,p=this.rootPath,u=!1;for(let h of i){let m=d--;c=c.child(h,{relative:new Array(m).fill("..").join(l),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(u?"":l)+h}),u=!0}this.cwd=c}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#a}resolve(...e){let n="";for(let a=e.length-1;a>=0;a--){let o=e[a];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let t=this.#e.get(n);if(t!==void 0)return t;let s=this.cwd.resolve(n).fullpath();return this.#e.set(n,s),s}resolvePosix(...e){let n="";for(let a=e.length-1;a>=0;a--){let o=e[a];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let t=this.#n.get(n);if(t!==void 0)return t;let s=this.cwd.resolve(n).fullpathPosix();return this.#n.set(n,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t}=n;if(e.canReaddir()){let s=await e.readdir();return t?s:s.map(a=>a.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0}=n;return e.canReaddir()?t?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e.withFileTypes,e=this.cwd);let t=await e.readlink();return n?t:t?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e.withFileTypes,e=this.cwd);let t=e.readlinkSync();return n?t:t?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e.withFileTypes,e=this.cwd);let t=await e.realpath();return n?t:t?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e.withFileTypes,e=this.cwd);let t=e.realpathSync();return n?t:t?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n,r=[];(!a||a(e))&&r.push(t?e:e.fullpath());let i=new Set,c=(l,p)=>{i.add(l),l.readdirCB((u,h)=>{if(u)return p(u);let m=h.length;if(!m)return p();let f=()=>{--m===0&&p()};for(let y of h)(!a||a(y))&&r.push(t?y:y.fullpath()),s&&y.isSymbolicLink()?y.realpath().then(g=>g?.isUnknown()?g.lstat():g).then(g=>g?.shouldWalk(i,o)?c(g,f):f()):y.shouldWalk(i,o)?c(y,f):f()},!0)},d=e;return new Promise((l,p)=>{c(d,u=>{if(u)return p(u);l(r)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n,r=[];(!a||a(e))&&r.push(t?e:e.fullpath());let i=new Set([e]);for(let c of i){let d=c.readdirSync();for(let l of d){(!a||a(l))&&r.push(t?l:l.fullpath());let p=l;if(l.isSymbolicLink()){if(!(s&&(p=l.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(i,o)&&i.add(p)}}return r}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n;(!a||a(e))&&(yield t?e:e.fullpath());let r=new Set([e]);for(let i of r){let c=i.readdirSync();for(let d of c){(!a||a(d))&&(yield t?d:d.fullpath());let l=d;if(d.isSymbolicLink()){if(!(s&&(l=d.realpathSync())))continue;l.isUnknown()&&l.lstatSync()}l.shouldWalk(r,o)&&r.add(l)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n,r=new rh({objectMode:!0});(!a||a(e))&&r.write(t?e:e.fullpath());let i=new Set,c=[e],d=0,l=()=>{let p=!1;for(;!p;){let u=c.shift();if(!u){d===0&&r.end();return}d++,i.add(u);let h=(f,y,g=!1)=>{if(f)return r.emit("error",f);if(s&&!g){let E=[];for(let S of y)S.isSymbolicLink()&&E.push(S.realpath().then(R=>R?.isUnknown()?R.lstat():R));if(E.length){Promise.all(E).then(()=>h(null,y,!0));return}}for(let E of y)E&&(!a||a(E))&&(r.write(t?E:E.fullpath())||(p=!0));d--;for(let E of y){let S=E.realpathCached()||E;S.shouldWalk(i,o)&&c.push(S)}p&&!r.flowing?r.once("drain",l):m||l()},m=!0;u.readdirCB(h,!0),m=!1}};return l(),r}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n,r=new rh({objectMode:!0}),i=new Set;(!a||a(e))&&r.write(t?e:e.fullpath());let c=[e],d=0,l=()=>{let p=!1;for(;!p;){let u=c.shift();if(!u){d===0&&r.end();return}d++,i.add(u);let h=u.readdirSync();for(let m of h)(!a||a(m))&&(r.write(t?m:m.fullpath())||(p=!0));d--;for(let m of h){let f=m;if(m.isSymbolicLink()){if(!(s&&(f=m.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(i,o)&&c.push(f)}}p&&!r.flowing&&r.once("drain",l)};return l(),r}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[fv](n)}},eS=class extends xv{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:t=!0}=n;super(e,Vr.win32,"\\",{...n,nocase:t}),this.nocase=t;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Vr.win32.parse(e).root.toUpperCase()}newRoot(e){return new yv(this.rootPath,gs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},nS=class extends xv{sep="/";constructor(e=process.cwd(),n={}){let{nocase:t=!1}=n;super(e,Vr.posix,"/",{...n,nocase:t}),this.nocase=t}parseRootPath(e){return"/"}newRoot(e){return new Ev(this.rootPath,gs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},bv=class extends nS{constructor(e=process.cwd(),n={}){let{nocase:t=!0}=n;super(e,{...n,nocase:t})}},Nce=process.platform==="win32"?yv:Ev,mK=process.platform==="win32"?eS:process.platform==="darwin"?bv:nS,fK=e=>e.length>=1,yK=e=>e.length>=1,gK=Symbol.for("nodejs.util.inspect.custom"),Tv=class Rv{#e;#n;#a;length;#s;#r;#m;#u;#l;#i;#c=!0;constructor(n,t,s,a){if(!fK(n))throw new TypeError("empty pattern list");if(!yK(t))throw new TypeError("empty glob list");if(t.length!==n.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=n.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#e=n,this.#n=t,this.#a=s,this.#s=a,this.#a===0){if(this.isUNC()){let[o,r,i,c,...d]=this.#e,[l,p,u,h,...m]=this.#n;d[0]===""&&(d.shift(),m.shift());let f=[o,r,i,c,""].join("/"),y=[l,p,u,h,""].join("/");this.#e=[f,...d],this.#n=[y,...m],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[o,...r]=this.#e,[i,...c]=this.#n;r[0]===""&&(r.shift(),c.shift());let d=o+"/",l=i+"/";this.#e=[d,...r],this.#n=[l,...c],this.length=this.#e.length}}}[gK](){return"Pattern <"+this.#n.slice(this.#a).join("/")+">"}pattern(){return this.#e[this.#a]}isString(){return typeof this.#e[this.#a]=="string"}isGlobstar(){return this.#e[this.#a]===ot}isRegExp(){return this.#e[this.#a]instanceof RegExp}globString(){return this.#m=this.#m||(this.#a===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#a).join("/"))}hasMore(){return this.length>this.#a+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new Rv(this.#e,this.#n,this.#a+1,this.#s),this.#r.#i=this.#i,this.#r.#l=this.#l,this.#r.#u=this.#u,this.#r):this.#r=null}isUNC(){let n=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#s==="win32"&&this.#a===0&&n[0]===""&&n[1]===""&&typeof n[2]=="string"&&!!n[2]&&typeof n[3]=="string"&&!!n[3]}isDrive(){let n=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#s==="win32"&&this.#a===0&&this.length>1&&typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0])}isAbsolute(){let n=this.#e;return this.#i!==void 0?this.#i:this.#i=n[0]===""&&n.length>1||this.isDrive()||this.isUNC()}root(){let n=this.#e[0];return typeof n=="string"&&this.isAbsolute()&&this.#a===0?n:""}checkFollowGlobstar(){return!(this.#a===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#a===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}},EK=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",MO=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:t,noext:s,noglobstar:a,platform:o=EK}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:t,noext:s,noglobstar:a,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let r of e)this.add(r)}add(e){let n=new _a(e,this.mmopts);for(let t=0;t<n.set.length;t++){let s=n.set[t],a=n.globParts[t];if(!s||!a)throw new Error("invalid pattern object");for(;s[0]==="."&&a[0]===".";)s.shift(),a.shift();let o=new Tv(s,a,0,this.platform),r=new _a(o.globString(),this.mmopts),i=a[a.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(r):this.relative.push(r),i&&(c?this.absoluteChildren.push(r):this.relativeChildren.push(r))}}ignored(e){let n=e.fullpath(),t=`${n}/`,s=e.relative()||".",a=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(a))return!0;for(let o of this.absolute)if(o.match(n)||o.match(t))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",t=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(t))return!0;for(let s of this.absoluteChildren)if(s.match(n))return!0;return!1}},SK=class _v{store;constructor(n=new Map){this.store=n}copy(){return new _v(new Map(this.store))}hasWalked(n,t){return this.store.get(n.fullpath())?.has(t.globString())}storeWalked(n,t){let s=n.fullpath(),a=this.store.get(s);a?a.add(t.globString()):this.store.set(s,new Set([t.globString()]))}},xK=class{store=new Map;add(e,n,t){let s=(n?2:0)|(t?1:0),a=this.store.get(e);this.store.set(e,a===void 0?s:s&a)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}},bK=class{store=new Map;add(e,n){if(!e.canReaddir())return;let t=this.store.get(e);t?t.find(s=>s.globString()===n.globString())||t.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},FO=class Av{hasWalkedCache;matches=new xK;subwalks=new bK;patterns;follow;dot;opts;constructor(n,t){this.opts=n,this.follow=!!n.follow,this.dot=!!n.dot,this.hasWalkedCache=t?t.copy():new SK}processPatterns(n,t){this.patterns=t;let s=t.map(a=>[n,a]);for(let[a,o]of s){this.hasWalkedCache.storeWalked(a,o);let r=o.root(),i=o.isAbsolute()&&this.opts.absolute!==!1;if(r){a=a.resolve(r==="/"&&this.opts.root!==void 0?this.opts.root:r);let p=o.rest();if(p)o=p;else{this.matches.add(a,!0,!1);continue}}if(a.isENOENT())continue;let c,d,l=!1;for(;typeof(c=o.pattern())=="string"&&(d=o.rest());)a=a.resolve(c),o=d,l=!0;if(c=o.pattern(),d=o.rest(),l){if(this.hasWalkedCache.hasWalked(a,o))continue;this.hasWalkedCache.storeWalked(a,o)}if(typeof c=="string"){let p=c===".."||c===""||c===".";this.matches.add(a.resolve(c),i,p);continue}else if(c===ot){(!a.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(a,o);let p=d?.pattern(),u=d?.rest();if(!d||(p===""||p===".")&&!u)this.matches.add(a,i,p===""||p===".");else if(p===".."){let h=a.parent||a;u?this.hasWalkedCache.hasWalked(h,u)||this.subwalks.add(h,u):this.matches.add(h,i,!0)}}else c instanceof RegExp&&this.subwalks.add(a,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Av(this.opts,this.hasWalkedCache)}filterEntries(n,t){let s=this.subwalks.get(n),a=this.child();for(let o of t)for(let r of s){let i=r.isAbsolute(),c=r.pattern(),d=r.rest();c===ot?a.testGlobstar(o,r,d,i):c instanceof RegExp?a.testRegExp(o,c,d,i):a.testString(o,c,d,i)}return a}testGlobstar(n,t,s,a){if((this.dot||!n.name.startsWith("."))&&(t.hasMore()||this.matches.add(n,a,!1),n.canReaddir()&&(this.follow||!n.isSymbolicLink()?this.subwalks.add(n,t):n.isSymbolicLink()&&(s&&t.checkFollowGlobstar()?this.subwalks.add(n,s):t.markFollowGlobstar()&&this.subwalks.add(n,t)))),s){let o=s.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(n,o,s.rest(),a);else if(o===".."){let r=n.parent||n;this.subwalks.add(r,s)}else o instanceof RegExp&&this.testRegExp(n,o,s.rest(),a)}}testRegExp(n,t,s,a){t.test(n.name)&&(s?this.subwalks.add(n,s):this.matches.add(n,a,!1))}testString(n,t,s,a){n.isNamed(t)&&(s?this.subwalks.add(n,s):this.matches.add(n,a,!1))}},TK=(e,n)=>typeof e=="string"?new MO([e],n):Array.isArray(e)?new MO(e,n):e,wv=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#a;signal;maxDepth;includeChildMatches;constructor(e,n,t){if(this.patterns=e,this.path=n,this.opts=t,this.#a=!t.posix&&t.platform==="win32"?"\\":"/",this.includeChildMatches=t.includeChildMatches!==!1,(t.ignore||!this.includeChildMatches)&&(this.#n=TK(t.ignore??[],t),!this.includeChildMatches&&typeof this.#n.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=t.maxDepth||1/0,t.signal&&(this.signal=t.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#s(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#r(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,n){if(n&&this.opts.nodir)return;let t;if(this.opts.realpath){if(t=e.realpathCached()||await e.realpath(),!t)return;e=t}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#s(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let t;if(this.opts.realpath){if(t=e.realpathCached()||e.realpathSync(),!t)return;e=t}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#s(e))return;if(!this.includeChildMatches&&this.#n?.add){let a=`${e.relativePosix()}/**`;this.#n.add(a)}let t=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#a:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(t){let a=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(a+s)}else{let a=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!a.startsWith(".."+this.#a)?"."+this.#a:"";this.matchEmit(a?o+a+s:"."+s)}}async match(e,n,t){let s=await this.matchCheck(e,t);s&&this.matchFinish(s,n)}matchSync(e,n,t){let s=this.matchCheckSync(e,t);s&&this.matchFinish(s,n)}walkCB(e,n,t){this.signal?.aborted&&t(),this.walkCB2(e,n,new FO(this.opts),t)}walkCB2(e,n,t,s){if(this.#r(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,n,t,s));return}t.processPatterns(e,n);let a=1,o=()=>{--a===0&&s()};for(let[r,i,c]of t.matches.entries())this.#s(r)||(a++,this.match(r,i,c).then(()=>o()));for(let r of t.subwalkTargets()){if(this.maxDepth!==1/0&&r.depth()>=this.maxDepth)continue;a++;let i=r.readdirCached();r.calledReaddir()?this.walkCB3(r,i,t,o):r.readdirCB((c,d)=>this.walkCB3(r,d,t,o),!0)}o()}walkCB3(e,n,t,s){t=t.filterEntries(e,n);let a=1,o=()=>{--a===0&&s()};for(let[r,i,c]of t.matches.entries())this.#s(r)||(a++,this.match(r,i,c).then(()=>o()));for(let[r,i]of t.subwalks.entries())a++,this.walkCB2(r,i,t.child(),o);o()}walkCBSync(e,n,t){this.signal?.aborted&&t(),this.walkCB2Sync(e,n,new FO(this.opts),t)}walkCB2Sync(e,n,t,s){if(this.#r(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,t,s));return}t.processPatterns(e,n);let a=1,o=()=>{--a===0&&s()};for(let[r,i,c]of t.matches.entries())this.#s(r)||this.matchSync(r,i,c);for(let r of t.subwalkTargets()){if(this.maxDepth!==1/0&&r.depth()>=this.maxDepth)continue;a++;let i=r.readdirSync();this.walkCB3Sync(r,i,t,o)}o()}walkCB3Sync(e,n,t,s){t=t.filterEntries(e,n);let a=1,o=()=>{--a===0&&s()};for(let[r,i,c]of t.matches.entries())this.#s(r)||this.matchSync(r,i,c);for(let[r,i]of t.subwalks.entries())a++,this.walkCB2Sync(r,i,t.child(),o);o()}},qO=class extends wv{matches=new Set;constructor(e,n,t){super(e,n,t)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},jO=class extends wv{results;constructor(e,n,t){super(e,n,t),this.results=new rh({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},RK=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",bo=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,ev.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(i=>i.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(i=>i.includes("/")?i:`./**/${i}`)}if(this.pattern=e,this.platform=n.platform||RK,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let i=n.platform==="win32"?eS:n.platform==="darwin"?bv:n.platform?nS:mK;this.scurry=new i(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let t=this.platform==="darwin"||this.platform==="win32",s={braceExpandMax:1e4,...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:t,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},a=this.pattern.map(i=>new _a(i,s)),[o,r]=a.reduce((i,c)=>(i[0].push(...c.set),i[1].push(...c.globParts),i),[[],[]]);this.patterns=o.map((i,c)=>{let d=r[c];if(!d)throw new Error("invalid pattern object");return new Tv(i,d,0,this.platform)})}async walk(){return[...await new qO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new qO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new jO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new jO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},_K=(e,n={})=>{Array.isArray(e)||(e=[e]);for(let t of e)if(new _a(t,n).hasMagic())return!0;return!1};function lh(e,n={}){return new bo(e,n).streamSync()}function Ov(e,n={}){return new bo(e,n).stream()}function vv(e,n={}){return new bo(e,n).walkSync()}async function YO(e,n={}){return new bo(e,n).walk()}function ph(e,n={}){return new bo(e,n).iterateSync()}function kv(e,n={}){return new bo(e,n).iterate()}var AK=lh,wK=Object.assign(Ov,{sync:lh}),OK=ph,vK=Object.assign(kv,{sync:ph}),kK=Object.assign(vv,{stream:lh,iterate:ph}),ih=Object.assign(YO,{glob:YO,globSync:vv,sync:kK,globStream:Ov,stream:wK,globStreamSync:lh,streamSync:AK,globIterate:kv,iterate:vK,globIterateSync:ph,iterateSync:OK,Glob:bo,hasMagic:_K,escape:WO,unescape:Yr});ih.glob=ih;function IK(e){return Ot((0,uh.pathToFileURL)(e).href)}function tS(e){return e.startsWith("file://")?(0,uh.fileURLToPath)(e):e}function Iv(e={}){let n=e.ignoredPathSegments;return{async read(t){try{return await(0,xd.readFile)(tS(t),{encoding:"utf8",signal:e.signal})}catch(s){let a=s.code;if(a==="ENOENT"||a==="EISDIR")return;throw s}},async exists(t){try{return await(0,xd.stat)(tS(t)),!0}catch{return!1}},async glob(t,s){return(await ih(s,{cwd:tS(t),withFileTypes:!0,dot:e.includeHidden===!0,follow:!1,nodir:!0,nocase:e.caseInsensitive===!0,ignore:{childrenIgnored:o=>o.isSymbolicLink()||n?.includes(o.name)===!0},signal:e.signal})).filter(o=>!o.isSymbolicLink()).map(o=>IK(o.fullpath())).sort()}}}b();T();b();T();var bd="asset bundle 99";var Td=[{uri:"hexasync://index",name:"index",title:"HexaSync Profile Template \u2014 knowledge base",description:"Use this knowledge base to choose a component, understand its actual authoring contract and adapt its supported examples.",mimeType:"text/markdown",text:`# HexaSync Profile Template \u2014 knowledge base
146
+ >>> no match, partial?`,e,p,n,u),p===i))}let m;if(typeof d=="string"?(m=l===d,this.debug("string match",d,l,m)):(m=d.test(l),this.debug("pattern match",d,l,m)),!m)return!1}if(o===i&&r===c)return!0;if(o===i)return t;if(r===c)return o===i-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return ZO(this.pattern,this.options)}parse(e){ah(e);let n=this.options;if(e==="**")return ot;if(e==="")return"";let t,s=null;(t=e.match(NQ))?s=n.dot?PQ:LQ:(t=e.match(bQ))?s=(n.nocase?n.dot?AQ:_Q:n.dot?RQ:TQ)(t[1]):(t=e.match(CQ))?s=(n.nocase?n.dot?UQ:DQ:n.dot?MQ:FQ)(t):(t=e.match(wQ))?s=n.dot?vQ:OQ:(t=e.match(kQ))&&(s=IQ);let a=HO.fromGlob(e,this.options).toMMPattern();return s&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:s}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,t=n.noglobstar?YQ:n.dot?VQ:$Q,s=new Set(n.nocase?["i"]:[]),a=e.map(i=>{let c=i.map(l=>{if(l instanceof RegExp)for(let p of l.flags.split(""))s.add(p);return typeof l=="string"?HQ(l):l===ot?ot:l._src});c.forEach((l,p)=>{let u=c[p+1],h=c[p-1];l!==ot||h===ot||(h===void 0?u!==void 0&&u!==ot?c[p+1]="(?:\\/|"+t+"\\/)?"+u:c[p]=t:u===void 0?c[p-1]=h+"(?:\\/|\\/"+t+")?":u!==ot&&(c[p-1]=h+"(?:\\/|\\/"+t+"\\/)"+u,c[p+1]=ot))});let d=c.filter(l=>l!==ot);if(this.partial&&d.length>=1){let l=[];for(let p=1;p<=d.length;p++)l.push(d.slice(0,p).join("/"));return"(?:"+l.join("|")+")"}return d.join("/")}).join("|"),[o,r]=e.length>1?["(?:",")"]:["",""];a="^"+o+a+r+"$",this.partial&&(a="^(?:\\/|"+o+a.slice(1,-1)+r+")$"),this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let t=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let a=this.set;this.debug(this.pattern,"set",a);let o=s[s.length-1];if(!o)for(let r=s.length-2;!o&&r>=0;r--)o=s[r];for(let r=0;r<a.length;r++){let i=a[r],c=s;if(t.matchBase&&i.length===1&&(c=[o]),this.matchOne(c,i,n))return t.flipNegate?!0:!this.negate}return t.flipNegate?!1:this.negate}static defaults(e){return rt.defaults(e).Minimatch}};rt.AST=HO;rt.Minimatch=_a;rt.escape=WO;rt.unescape=Yr;var WQ=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,nv=new Set,G1=typeof process=="object"&&process?process:{},tv=(e,n,t,s)=>{typeof G1.emitWarning=="function"?G1.emitWarning(e,n,t,s):console.error(`[${t}] ${n}: ${e}`)},oh=globalThis.AbortController,OO=globalThis.AbortSignal;if(typeof oh>"u"){OO=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,s){this._onabort.push(s)}},oh=class{constructor(){n()}signal=new OO;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(let s of this.signal._onabort)s(t);this.signal.onabort?.(t)}}};let e=G1.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",n=()=>{e&&(e=!1,tv("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",n))}}var GQ=e=>!nv.has(e),Ra=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),sv=e=>Ra(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?th:null:null,th=class extends Array{constructor(e){super(e),this.fill(0)}},JQ=class yd{heap;length;static#e=!1;static create(n){let t=sv(n);if(!t)return[];yd.#e=!0;let s=new yd(n,t);return yd.#e=!1,s}constructor(n,t){if(!yd.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(n),this.length=0}push(n){this.heap[this.length++]=n}pop(){return this.heap[--this.length]}},ch=class av{#e;#n;#a;#s;#r;#m;#u;#l;get perf(){return this.#l}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#c;#h;#d;#o;#f;#b;#x;#y;#v;#g;#_;#A;#E;#S;#T;#w;#t;#C;static unsafeExposeInternals(n){return{starts:n.#A,ttls:n.#E,autopurgeTimers:n.#S,sizes:n.#_,keyMap:n.#h,keyList:n.#d,valList:n.#o,next:n.#f,prev:n.#b,get head(){return n.#x},get tail(){return n.#y},free:n.#v,isBackgroundFetch:t=>n.#p(t),backgroundFetch:(t,s,a,o)=>n.#V(t,s,a,o),moveToTail:t=>n.#U(t),indexes:t=>n.#I(t),rindexes:t=>n.#N(t),isStale:t=>n.#R(t)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#c}get size(){return this.#i}get fetchMethod(){return this.#m}get memoMethod(){return this.#u}get dispose(){return this.#a}get onInsert(){return this.#s}get disposeAfter(){return this.#r}constructor(n){let{max:t=0,ttl:s,ttlResolution:a=1,ttlAutopurge:o,updateAgeOnGet:r,updateAgeOnHas:i,allowStale:c,dispose:d,onInsert:l,disposeAfter:p,noDisposeOnSet:u,noUpdateTTL:h,maxSize:m=0,maxEntrySize:f=0,sizeCalculation:y,fetchMethod:g,memoMethod:E,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:_,ignoreFetchAbort:x,perf:A}=n;if(A!==void 0&&typeof A?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#l=A??WQ,t!==0&&!Ra(t))throw new TypeError("max option must be a nonnegative integer");let k=t?sv(t):Array;if(!k)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=m,this.maxEntrySize=f||this.#n,this.sizeCalculation=y,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#u=E,g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#m=g,this.#w=!!g,this.#h=new Map,this.#d=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#f=new k(t),this.#b=new k(t),this.#x=0,this.#y=0,this.#v=JQ.create(t),this.#i=0,this.#c=0,typeof d=="function"&&(this.#a=d),typeof l=="function"&&(this.#s=l),typeof p=="function"?(this.#r=p,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#T=!!this.#a,this.#C=!!this.#s,this.#t=!!this.#r,this.noDisposeOnSet=!!u,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#n!==0&&!Ra(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Ra(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#Q()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!i,this.ttlResolution=Ra(a)||a===0?a:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!Ra(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#L()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let M="LRU_CACHE_UNBOUNDED";GQ(M)&&(nv.add(M),tv("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,av))}}getRemainingTTL(n){return this.#h.has(n)?1/0:0}#L(){let n=new th(this.#e),t=new th(this.#e);this.#E=n,this.#A=t;let s=this.ttlAutopurge?new Array(this.#e):void 0;this.#S=s,this.#F=(r,i,c=this.#l.now())=>{if(t[r]=i!==0?c:0,n[r]=i,s?.[r]&&(clearTimeout(s[r]),s[r]=void 0),i!==0&&s){let d=setTimeout(()=>{this.#R(r)&&this.#k(this.#d[r],"expire")},i+1);d.unref&&d.unref(),s[r]=d}},this.#O=r=>{t[r]=n[r]!==0?this.#l.now():0},this.#P=(r,i)=>{if(n[i]){let c=n[i],d=t[i];if(!c||!d)return;r.ttl=c,r.start=d,r.now=a||o();let l=r.now-d;r.remainingTTL=c-l}};let a=0,o=()=>{let r=this.#l.now();if(this.ttlResolution>0){a=r;let i=setTimeout(()=>a=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.#h.get(r);if(i===void 0)return 0;let c=n[i],d=t[i];if(!c||!d)return 1/0;let l=(a||o())-d;return c-l},this.#R=r=>{let i=t[r],c=n[r];return!!c&&!!i&&(a||o())-i>c}}#O=()=>{};#P=()=>{};#F=()=>{};#R=()=>!1;#Q(){let n=new th(this.#e);this.#c=0,this.#_=n,this.#M=t=>{this.#c-=n[t],n[t]=0},this.#q=(t,s,a,o)=>{if(this.#p(s))return 0;if(!Ra(a))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(a=o(s,t),!Ra(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a},this.#D=(t,s,a)=>{if(n[t]=s,this.#n){let o=this.#n-n[t];for(;this.#c>o;)this.#Y(!0)}this.#c+=n[t],a&&(a.entrySize=s,a.totalCalculatedSize=this.#c)}}#M=n=>{};#D=(n,t,s)=>{};#q=(n,t,s,a)=>{if(s||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#I({allowStale:n=this.allowStale}={}){if(this.#i)for(let t=this.#y;!(!this.#j(t)||((n||!this.#R(t))&&(yield t),t===this.#x));)t=this.#b[t]}*#N({allowStale:n=this.allowStale}={}){if(this.#i)for(let t=this.#x;!(!this.#j(t)||((n||!this.#R(t))&&(yield t),t===this.#y));)t=this.#f[t]}#j(n){return n!==void 0&&this.#h.get(this.#d[n])===n}*entries(){for(let n of this.#I())this.#o[n]!==void 0&&this.#d[n]!==void 0&&!this.#p(this.#o[n])&&(yield[this.#d[n],this.#o[n]])}*rentries(){for(let n of this.#N())this.#o[n]!==void 0&&this.#d[n]!==void 0&&!this.#p(this.#o[n])&&(yield[this.#d[n],this.#o[n]])}*keys(){for(let n of this.#I()){let t=this.#d[n];t!==void 0&&!this.#p(this.#o[n])&&(yield t)}}*rkeys(){for(let n of this.#N()){let t=this.#d[n];t!==void 0&&!this.#p(this.#o[n])&&(yield t)}}*values(){for(let n of this.#I())this.#o[n]!==void 0&&!this.#p(this.#o[n])&&(yield this.#o[n])}*rvalues(){for(let n of this.#N())this.#o[n]!==void 0&&!this.#p(this.#o[n])&&(yield this.#o[n])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(n,t={}){for(let s of this.#I()){let a=this.#o[s],o=this.#p(a)?a.__staleWhileFetching:a;if(o!==void 0&&n(o,this.#d[s],this))return this.get(this.#d[s],t)}}forEach(n,t=this){for(let s of this.#I()){let a=this.#o[s],o=this.#p(a)?a.__staleWhileFetching:a;o!==void 0&&n.call(t,o,this.#d[s],this)}}rforEach(n,t=this){for(let s of this.#N()){let a=this.#o[s],o=this.#p(a)?a.__staleWhileFetching:a;o!==void 0&&n.call(t,o,this.#d[s],this)}}purgeStale(){let n=!1;for(let t of this.#N({allowStale:!0}))this.#R(t)&&(this.#k(this.#d[t],"expire"),n=!0);return n}info(n){let t=this.#h.get(n);if(t===void 0)return;let s=this.#o[t],a=this.#p(s)?s.__staleWhileFetching:s;if(a===void 0)return;let o={value:a};if(this.#E&&this.#A){let r=this.#E[t],i=this.#A[t];if(r&&i){let c=r-(this.#l.now()-i);o.ttl=c,o.start=Date.now()}}return this.#_&&(o.size=this.#_[t]),o}dump(){let n=[];for(let t of this.#I({allowStale:!0})){let s=this.#d[t],a=this.#o[t],o=this.#p(a)?a.__staleWhileFetching:a;if(o===void 0||s===void 0)continue;let r={value:o};if(this.#E&&this.#A){r.ttl=this.#E[t];let i=this.#l.now()-this.#A[t];r.start=Math.floor(Date.now()-i)}this.#_&&(r.size=this.#_[t]),n.unshift([s,r])}return n}load(n){this.clear();for(let[t,s]of n){if(s.start){let a=Date.now()-s.start;s.start=this.#l.now()-a}this.set(t,s.value,s)}}set(n,t,s={}){if(t===void 0)return this.delete(n),this;let{ttl:a=this.ttl,start:o,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:i=this.sizeCalculation,status:c}=s,{noUpdateTTL:d=this.noUpdateTTL}=s,l=this.#q(n,t,s.size||0,i);if(this.maxEntrySize&&l>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#k(n,"set"),this;let p=this.#i===0?void 0:this.#h.get(n);if(p===void 0)p=this.#i===0?this.#y:this.#v.length!==0?this.#v.pop():this.#i===this.#e?this.#Y(!1):this.#i,this.#d[p]=n,this.#o[p]=t,this.#h.set(n,p),this.#f[this.#y]=p,this.#b[p]=this.#y,this.#y=p,this.#i++,this.#D(p,l,c),c&&(c.set="add"),d=!1,this.#C&&this.#s?.(t,n,"add");else{this.#U(p);let u=this.#o[p];if(t!==u){if(this.#w&&this.#p(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=u;h!==void 0&&!r&&(this.#T&&this.#a?.(h,n,"set"),this.#t&&this.#g?.push([h,n,"set"]))}else r||(this.#T&&this.#a?.(u,n,"set"),this.#t&&this.#g?.push([u,n,"set"]));if(this.#M(p),this.#D(p,l,c),this.#o[p]=t,c){c.set="replace";let h=u&&this.#p(u)?u.__staleWhileFetching:u;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update");this.#C&&this.onInsert?.(t,n,t===u?"update":"replace")}if(a!==0&&!this.#E&&this.#L(),this.#E&&(d||this.#F(p,a,o),c&&this.#P(c,p)),!r&&this.#t&&this.#g){let u=this.#g,h;for(;h=u?.shift();)this.#r?.(...h)}return this}pop(){try{for(;this.#i;){let n=this.#o[this.#x];if(this.#Y(!0),this.#p(n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(this.#t&&this.#g){let n=this.#g,t;for(;t=n?.shift();)this.#r?.(...t)}}}#Y(n){let t=this.#x,s=this.#d[t],a=this.#o[t];return this.#w&&this.#p(a)?a.__abortController.abort(new Error("evicted")):(this.#T||this.#t)&&(this.#T&&this.#a?.(a,s,"evict"),this.#t&&this.#g?.push([a,s,"evict"])),this.#M(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),n&&(this.#d[t]=void 0,this.#o[t]=void 0,this.#v.push(t)),this.#i===1?(this.#x=this.#y=0,this.#v.length=0):this.#x=this.#f[t],this.#h.delete(s),this.#i--,t}has(n,t={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:a}=t,o=this.#h.get(n);if(o!==void 0){let r=this.#o[o];if(this.#p(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#R(o))a&&(a.has="stale",this.#P(a,o));else return s&&this.#O(o),a&&(a.has="hit",this.#P(a,o)),!0}else a&&(a.has="miss");return!1}peek(n,t={}){let{allowStale:s=this.allowStale}=t,a=this.#h.get(n);if(a===void 0||!s&&this.#R(a))return;let o=this.#o[a];return this.#p(o)?o.__staleWhileFetching:o}#V(n,t,s,a){let o=t===void 0?void 0:this.#o[t];if(this.#p(o))return o;let r=new oh,{signal:i}=s;i?.addEventListener("abort",()=>r.abort(i.reason),{signal:r.signal});let c={signal:r.signal,options:s,context:a},d=(f,y=!1)=>{let{aborted:g}=r.signal,E=s.ignoreFetchAbort&&f!==void 0,S=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&f!==void 0);if(s.status&&(g&&!y?(s.status.fetchAborted=!0,s.status.fetchError=r.signal.reason,E&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),g&&!E&&!y)return p(r.signal.reason,S);let R=h,w=this.#o[t];return(w===h||E&&y&&w===void 0)&&(f===void 0?R.__staleWhileFetching!==void 0?this.#o[t]=R.__staleWhileFetching:this.#k(n,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(n,f,c.options))),f},l=f=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=f),p(f,!1)),p=(f,y)=>{let{aborted:g}=r.signal,E=g&&s.allowStaleOnFetchAbort,S=E||s.allowStaleOnFetchRejection,R=S||s.noDeleteOnFetchRejection,w=h;if(this.#o[t]===h&&(!R||!y&&w.__staleWhileFetching===void 0?this.#k(n,"fetch"):E||(this.#o[t]=w.__staleWhileFetching)),S)return s.status&&w.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw f},u=(f,y)=>{let g=this.#m?.(n,o,c);g&&g instanceof Promise&&g.then(E=>f(E===void 0?void 0:E),y),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(f(void 0),s.allowStaleOnFetchAbort&&(f=E=>d(E,!0)))})};s.status&&(s.status.fetchDispatched=!0);let h=new Promise(u).then(d,l),m=Object.assign(h,{__abortController:r,__staleWhileFetching:o,__returned:void 0});return t===void 0?(this.set(n,m,{...c.options,status:void 0}),t=this.#h.get(n)):this.#o[t]=m,m}#p(n){if(!this.#w)return!1;let t=n;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof oh}async fetch(n,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:c=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:f,forceRefresh:y=!1,status:g,signal:E}=t;if(!this.#w)return g&&(g.fetch="get"),this.get(n,{allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:o,status:g});let S={allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:o,ttl:r,noDisposeOnSet:i,size:c,sizeCalculation:d,noUpdateTTL:l,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:m,ignoreFetchAbort:h,status:g,signal:E},R=this.#h.get(n);if(R===void 0){g&&(g.fetch="miss");let w=this.#V(n,R,S,f);return w.__returned=w}else{let w=this.#o[R];if(this.#p(w)){let k=s&&w.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",k&&(g.returnedStale=!0)),k?w.__staleWhileFetching:w.__returned=w}let _=this.#R(R);if(!y&&!_)return g&&(g.fetch="hit"),this.#U(R),a&&this.#O(R),g&&this.#P(g,R),w;let x=this.#V(n,R,S,f),A=x.__staleWhileFetching!==void 0&&s;return g&&(g.fetch=_?"stale":"refresh",A&&_&&(g.returnedStale=!0)),A?x.__staleWhileFetching:x.__returned=x}}async forceFetch(n,t={}){let s=await this.fetch(n,t);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(n,t={}){let s=this.#u;if(!s)throw new Error("no memoMethod provided to constructor");let{context:a,forceRefresh:o,...r}=t,i=this.get(n,r);if(!o&&i!==void 0)return i;let c=s(n,i,{options:r,context:a});return this.set(n,c,r),c}get(n,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:r}=t,i=this.#h.get(n);if(i!==void 0){let c=this.#o[i],d=this.#p(c);return r&&this.#P(r,i),this.#R(i)?(r&&(r.get="stale"),d?(r&&s&&c.__staleWhileFetching!==void 0&&(r.returnedStale=!0),s?c.__staleWhileFetching:void 0):(o||this.#k(n,"expire"),r&&s&&(r.returnedStale=!0),s?c:void 0)):(r&&(r.get="hit"),d?c.__staleWhileFetching:(this.#U(i),a&&this.#O(i),c))}else r&&(r.get="miss")}#$(n,t){this.#b[t]=n,this.#f[n]=t}#U(n){n!==this.#y&&(n===this.#x?this.#x=this.#f[n]:this.#$(this.#b[n],this.#f[n]),this.#$(this.#y,n),this.#y=n)}delete(n){return this.#k(n,"delete")}#k(n,t){let s=!1;if(this.#i!==0){let a=this.#h.get(n);if(a!==void 0)if(this.#S?.[a]&&(clearTimeout(this.#S?.[a]),this.#S[a]=void 0),s=!0,this.#i===1)this.#K(t);else{this.#M(a);let o=this.#o[a];if(this.#p(o)?o.__abortController.abort(new Error("deleted")):(this.#T||this.#t)&&(this.#T&&this.#a?.(o,n,t),this.#t&&this.#g?.push([o,n,t])),this.#h.delete(n),this.#d[a]=void 0,this.#o[a]=void 0,a===this.#y)this.#y=this.#b[a];else if(a===this.#x)this.#x=this.#f[a];else{let r=this.#b[a];this.#f[r]=this.#f[a];let i=this.#f[a];this.#b[i]=this.#b[a]}this.#i--,this.#v.push(a)}}if(this.#t&&this.#g?.length){let a=this.#g,o;for(;o=a?.shift();)this.#r?.(...o)}return s}clear(){return this.#K("delete")}#K(n){for(let t of this.#N({allowStale:!0})){let s=this.#o[t];if(this.#p(s))s.__abortController.abort(new Error("deleted"));else{let a=this.#d[t];this.#T&&this.#a?.(s,a,n),this.#t&&this.#g?.push([s,a,n])}}if(this.#h.clear(),this.#o.fill(void 0),this.#d.fill(void 0),this.#E&&this.#A){this.#E.fill(0),this.#A.fill(0);for(let t of this.#S??[])t!==void 0&&clearTimeout(t);this.#S?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#x=0,this.#y=0,this.#v.length=0,this.#c=0,this.#i=0,this.#t&&this.#g){let t=this.#g,s;for(;s=t?.shift();)this.#r?.(...s)}}},vO=typeof process=="object"&&process?process:{stdout:null,stderr:null},ZQ=e=>!!e&&typeof e=="object"&&(e instanceof rh||e instanceof Z1.default||eK(e)||nK(e)),eK=e=>!!e&&typeof e=="object"&&e instanceof dh.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==Z1.default.Writable.prototype.pipe,nK=e=>!!e&&typeof e=="object"&&e instanceof dh.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function",ks=Symbol("EOF"),Is=Symbol("maybeEmitEnd"),Ta=Symbol("emittedEnd"),Wu=Symbol("emittingEnd"),ld=Symbol("emittedError"),Gu=Symbol("closed"),kO=Symbol("read"),Ju=Symbol("flush"),IO=Symbol("flushChunk"),Zt=Symbol("encoding"),qr=Symbol("decoder"),Cn=Symbol("flowing"),pd=Symbol("paused"),jr=Symbol("resume"),Dn=Symbol("buffer"),at=Symbol("pipes"),Un=Symbol("bufferLength"),$1=Symbol("bufferPush"),Xu=Symbol("bufferShift"),Gn=Symbol("objectMode"),_n=Symbol("destroyed"),Q1=Symbol("error"),K1=Symbol("emitData"),NO=Symbol("emitEnd"),z1=Symbol("emitEnd2"),ys=Symbol("async"),B1=Symbol("abort"),Zu=Symbol("aborted"),ud=Symbol("signal"),So=Symbol("dataListeners"),It=Symbol("discarded"),hd=e=>Promise.resolve().then(e),tK=e=>e(),sK=e=>e==="end"||e==="finish"||e==="prefinish",aK=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,oK=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),iv=class{src;dest;opts;ondrain;constructor(e,n,t){this.src=e,this.dest=n,this.opts=t,this.ondrain=()=>e[jr](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},rK=class extends iv{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,t){super(e,n,t),this.proxyErrors=s=>this.dest.emit("error",s),e.on("error",this.proxyErrors)}},iK=e=>!!e.objectMode,cK=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",rh=class extends dh.EventEmitter{[Cn]=!1;[pd]=!1;[at]=[];[Dn]=[];[Gn];[Zt];[ys];[qr];[ks]=!1;[Ta]=!1;[Wu]=!1;[Gu]=!1;[ld]=null;[Un]=0;[_n]=!1;[ud];[Zu]=!1;[So]=0;[It]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");iK(n)?(this[Gn]=!0,this[Zt]=null):cK(n)?(this[Zt]=n.encoding,this[Gn]=!1):(this[Gn]=!1,this[Zt]=null),this[ys]=!!n.async,this[qr]=this[Zt]?new rv.StringDecoder(this[Zt]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Dn]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[at]});let{signal:t}=n;t&&(this[ud]=t,t.aborted?this[B1]():t.addEventListener("abort",()=>this[B1]()))}get bufferLength(){return this[Un]}get encoding(){return this[Zt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Gn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ys]}set async(e){this[ys]=this[ys]||!!e}[B1](){this[Zu]=!0,this.emit("abort",this[ud]?.reason),this.destroy(this[ud]?.reason)}get aborted(){return this[Zu]}set aborted(e){}write(e,n,t){if(this[Zu])return!1;if(this[ks])throw new Error("write after end");if(this[_n])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(t=n,n="utf8"),n||(n="utf8");let s=this[ys]?hd:tK;if(!this[Gn]&&!Buffer.isBuffer(e)){if(oK(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(aK(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Gn]?(this[Cn]&&this[Un]!==0&&this[Ju](!0),this[Cn]?this.emit("data",e):this[$1](e),this[Un]!==0&&this.emit("readable"),t&&s(t),this[Cn]):e.length?(typeof e=="string"&&!(n===this[Zt]&&!this[qr]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Zt]&&(e=this[qr].write(e)),this[Cn]&&this[Un]!==0&&this[Ju](!0),this[Cn]?this.emit("data",e):this[$1](e),this[Un]!==0&&this.emit("readable"),t&&s(t),this[Cn]):(this[Un]!==0&&this.emit("readable"),t&&s(t),this[Cn])}read(e){if(this[_n])return null;if(this[It]=!1,this[Un]===0||e===0||e&&e>this[Un])return this[Is](),null;this[Gn]&&(e=null),this[Dn].length>1&&!this[Gn]&&(this[Dn]=[this[Zt]?this[Dn].join(""):Buffer.concat(this[Dn],this[Un])]);let n=this[kO](e||null,this[Dn][0]);return this[Is](),n}[kO](e,n){if(this[Gn])this[Xu]();else{let t=n;e===t.length||e===null?this[Xu]():typeof t=="string"?(this[Dn][0]=t.slice(e),n=t.slice(0,e),this[Un]-=e):(this[Dn][0]=t.subarray(e),n=t.subarray(0,e),this[Un]-=e)}return this.emit("data",n),!this[Dn].length&&!this[ks]&&this.emit("drain"),n}end(e,n,t){return typeof e=="function"&&(t=e,e=void 0),typeof n=="function"&&(t=n,n="utf8"),e!==void 0&&this.write(e,n),t&&this.once("end",t),this[ks]=!0,this.writable=!1,(this[Cn]||!this[pd])&&this[Is](),this}[jr](){this[_n]||(!this[So]&&!this[at].length&&(this[It]=!0),this[pd]=!1,this[Cn]=!0,this.emit("resume"),this[Dn].length?this[Ju]():this[ks]?this[Is]():this.emit("drain"))}resume(){return this[jr]()}pause(){this[Cn]=!1,this[pd]=!0,this[It]=!1}get destroyed(){return this[_n]}get flowing(){return this[Cn]}get paused(){return this[pd]}[$1](e){this[Gn]?this[Un]+=1:this[Un]+=e.length,this[Dn].push(e)}[Xu](){return this[Gn]?this[Un]-=1:this[Un]-=this[Dn][0].length,this[Dn].shift()}[Ju](e=!1){do;while(this[IO](this[Xu]())&&this[Dn].length);!e&&!this[Dn].length&&!this[ks]&&this.emit("drain")}[IO](e){return this.emit("data",e),this[Cn]}pipe(e,n){if(this[_n])return e;this[It]=!1;let t=this[Ta];return n=n||{},e===vO.stdout||e===vO.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,t?n.end&&e.end():(this[at].push(n.proxyErrors?new rK(this,e,n):new iv(this,e,n)),this[ys]?hd(()=>this[jr]()):this[jr]()),e}unpipe(e){let n=this[at].find(t=>t.dest===e);n&&(this[at].length===1?(this[Cn]&&this[So]===0&&(this[Cn]=!1),this[at]=[]):this[at].splice(this[at].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let t=super.on(e,n);if(e==="data")this[It]=!1,this[So]++,!this[at].length&&!this[Cn]&&this[jr]();else if(e==="readable"&&this[Un]!==0)super.emit("readable");else if(sK(e)&&this[Ta])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ld]){let s=n;this[ys]?hd(()=>s.call(this,this[ld])):s.call(this,this[ld])}return t}removeListener(e,n){return this.off(e,n)}off(e,n){let t=super.off(e,n);return e==="data"&&(this[So]=this.listeners("data").length,this[So]===0&&!this[It]&&!this[at].length&&(this[Cn]=!1)),t}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[So]=0,!this[It]&&!this[at].length&&(this[Cn]=!1)),n}get emittedEnd(){return this[Ta]}[Is](){!this[Wu]&&!this[Ta]&&!this[_n]&&this[Dn].length===0&&this[ks]&&(this[Wu]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Gu]&&this.emit("close"),this[Wu]=!1)}emit(e,...n){let t=n[0];if(e!=="error"&&e!=="close"&&e!==_n&&this[_n])return!1;if(e==="data")return!this[Gn]&&!t?!1:this[ys]?(hd(()=>this[K1](t)),!0):this[K1](t);if(e==="end")return this[NO]();if(e==="close"){if(this[Gu]=!0,!this[Ta]&&!this[_n])return!1;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(e==="error"){this[ld]=t,super.emit(Q1,t);let a=!this[ud]||this.listeners("error").length?super.emit("error",t):!1;return this[Is](),a}else if(e==="resume"){let a=super.emit("resume");return this[Is](),a}else if(e==="finish"||e==="prefinish"){let a=super.emit(e);return this.removeAllListeners(e),a}let s=super.emit(e,...n);return this[Is](),s}[K1](e){for(let t of this[at])t.dest.write(e)===!1&&this.pause();let n=this[It]?!1:super.emit("data",e);return this[Is](),n}[NO](){return this[Ta]?!1:(this[Ta]=!0,this.readable=!1,this[ys]?(hd(()=>this[z1]()),!0):this[z1]())}[z1](){if(this[qr]){let n=this[qr].end();if(n){for(let t of this[at])t.dest.write(n);this[It]||super.emit("data",n)}}for(let n of this[at])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Gn]||(e.dataLength=0);let n=this.promise();return this.on("data",t=>{e.push(t),this[Gn]||(e.dataLength+=t.length)}),await n,e}async concat(){if(this[Gn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Zt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(_n,()=>n(new Error("stream destroyed"))),this.on("error",t=>n(t)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[It]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ks])return n();let s,a,o=d=>{this.off("data",r),this.off("end",i),this.off(_n,c),n(),a(d)},r=d=>{this.off("error",o),this.off("end",i),this.off(_n,c),this.pause(),s({value:d,done:!!this[ks]})},i=()=>{this.off("error",o),this.off("data",r),this.off(_n,c),n(),s({done:!0,value:void 0})},c=()=>o(new Error("stream destroyed"));return new Promise((d,l)=>{a=l,s=d,this.once(_n,c),this.once("error",o),this.once("end",i),this.once("data",r)})},throw:n,return:n,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[It]=!1;let e=!1,n=()=>(this.pause(),this.off(Q1,n),this.off(_n,n),this.off("end",n),e=!0,{done:!0,value:void 0}),t=()=>{if(e)return n();let s=this.read();return s===null?n():{done:!1,value:s}};return this.once("end",n),this.once(Q1,n),this.once(_n,n),{next:t,throw:n,return:n,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[_n])return e?this.emit("error",e):this.emit(_n),this;this[_n]=!0,this[It]=!0,this[Dn].length=0,this[Un]=0;let n=this;return typeof n.close=="function"&&!this[Gu]&&n.close(),e?this.emit("error",e):this.emit(_n),this}static get isStream(){return ZQ}},dK=Es.realpathSync.native,gd={lstatSync:Es.lstatSync,readdir:Es.readdir,readdirSync:Es.readdirSync,readlinkSync:Es.readlinkSync,realpathSync:dK,promises:{lstat:Aa.lstat,readdir:Aa.readdir,readlink:Aa.readlink,realpath:Aa.realpath}},cv=e=>!e||e===gd||e===XQ?gd:{...gd,...e,promises:{...gd.promises,...e.promises||{}}},dv=/^\\\\\?\\([a-z]:)\\?$/i,lK=e=>e.replace(/\//g,"\\").replace(dv,"$1\\"),pK=/[\\\/]/,Vt=0,lv=1,pv=2,gs=4,uv=6,hv=8,xo=10,mv=12,Yt=15,md=~Yt,H1=16,LO=32,Ed=64,es=128,eh=256,sh=512,PO=Ed|es|sh,uK=1023,W1=e=>e.isFile()?hv:e.isDirectory()?gs:e.isSymbolicLink()?xo:e.isCharacterDevice()?pv:e.isBlockDevice()?uv:e.isSocket()?mv:e.isFIFO()?lv:Vt,CO=new ch({max:2**12}),Sd=e=>{let n=CO.get(e);if(n)return n;let t=e.normalize("NFKD");return CO.set(e,t),t},DO=new ch({max:2**12}),nh=e=>{let n=DO.get(e);if(n)return n;let t=Sd(e.toLowerCase());return DO.set(e,t),t},UO=class extends ch{constructor(){super({max:256})}},hK=class extends ch{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}},fv=Symbol("PathScurry setAsCwd"),ft=class{name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#a;get mode(){return this.#a}#s;get nlink(){return this.#s}#r;get uid(){return this.#r}#m;get gid(){return this.#m}#u;get rdev(){return this.#u}#l;get blksize(){return this.#l}#i;get ino(){return this.#i}#c;get size(){return this.#c}#h;get blocks(){return this.#h}#d;get atimeMs(){return this.#d}#o;get mtimeMs(){return this.#o}#f;get ctimeMs(){return this.#f}#b;get birthtimeMs(){return this.#b}#x;get atime(){return this.#x}#y;get mtime(){return this.#y}#v;get ctime(){return this.#v}#g;get birthtime(){return this.#g}#_;#A;#E;#S;#T;#w;#t;#C;#L;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=Vt,t,s,a,o,r){this.name=e,this.#_=a?nh(e):Sd(e),this.#t=n&uK,this.nocase=a,this.roots=s,this.root=t||this,this.#C=o,this.#E=r.fullpath,this.#T=r.relative,this.#w=r.relativePosix,this.parent=r.parent,this.parent?this.#e=this.parent.#e:this.#e=cv(r.fs)}depth(){return this.#A!==void 0?this.#A:this.parent?this.#A=this.parent.depth()+1:this.#A=0}childrenCache(){return this.#C}resolve(e){if(!e)return this;let n=this.getRootString(e),t=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#P(t):this.#P(t)}#P(e){let n=this;for(let t of e)n=n.child(t);return n}children(){let e=this.#C.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#C.set(this,n),this.#t&=~H1,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let t=this.children(),s=this.nocase?nh(e):Sd(e);for(let i of t)if(i.#_===s)return i;let a=this.parent?this.sep:"",o=this.#E?this.#E+a+e:void 0,r=this.newChild(e,Vt,{...n,parent:this,fullpath:o});return this.canReaddir()||(r.#t|=es),t.push(r),r}relative(){if(this.isCWD)return"";if(this.#T!==void 0)return this.#T;let e=this.name,n=this.parent;if(!n)return this.#T=this.name;let t=n.relative();return t+(!t||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,n=this.parent;if(!n)return this.#w=this.fullpathPosix();let t=n.relativePosix();return t+(!t||!n.parent?"":"/")+e}fullpath(){if(this.#E!==void 0)return this.#E;let e=this.name,n=this.parent;if(!n)return this.#E=this.name;let t=n.fullpath()+(n.parent?this.sep:"")+e;return this.#E=t}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep==="/")return this.#S=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#S=`//?/${s}`:this.#S=s}let e=this.parent,n=e.fullpathPosix(),t=n+(!n||!e.parent?"":"/")+this.name;return this.#S=t}isUnknown(){return(this.#t&Yt)===Vt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#t&Yt)===hv}isDirectory(){return(this.#t&Yt)===gs}isCharacterDevice(){return(this.#t&Yt)===pv}isBlockDevice(){return(this.#t&Yt)===uv}isFIFO(){return(this.#t&Yt)===lv}isSocket(){return(this.#t&Yt)===mv}isSymbolicLink(){return(this.#t&xo)===xo}lstatCached(){return this.#t&LO?this:void 0}readlinkCached(){return this.#L}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#L)return!0;if(!this.parent)return!1;let e=this.#t&Yt;return!(e!==Vt&&e!==xo||this.#t&eh||this.#t&es)}calledReaddir(){return!!(this.#t&H1)}isENOENT(){return!!(this.#t&es)}isNamed(e){return this.nocase?this.#_===nh(e):this.#_===Sd(e)}async readlink(){let e=this.#L;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(n);if(t)return this.#L=t}catch(n){this.#N(n.code);return}}readlinkSync(){let e=this.#L;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(n);if(t)return this.#L=t}catch(n){this.#N(n.code);return}}#F(e){this.#t|=H1;for(let n=e.provisional;n<e.length;n++){let t=e[n];t&&t.#R()}}#R(){this.#t&es||(this.#t=(this.#t|es)&md,this.#Q())}#Q(){let e=this.children();e.provisional=0;for(let n of e)n.#R()}#M(){this.#t|=sh,this.#D()}#D(){if(this.#t&Ed)return;let e=this.#t;(e&Yt)===gs&&(e&=md),this.#t=e|Ed,this.#Q()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#D():e==="ENOENT"?this.#R():this.children().provisional=0}#I(e=""){e==="ENOTDIR"?this.parent.#D():e==="ENOENT"&&this.#R()}#N(e=""){let n=this.#t;n|=eh,e==="ENOENT"&&(n|=es),(e==="EINVAL"||e==="UNKNOWN")&&(n&=md),this.#t=n,e==="ENOTDIR"&&this.parent&&this.parent.#D()}#j(e,n){return this.#V(e,n)||this.#Y(e,n)}#Y(e,n){let t=W1(e),s=this.newChild(e.name,t,{parent:this}),a=s.#t&Yt;return a!==gs&&a!==xo&&a!==Vt&&(s.#t|=Ed),n.unshift(s),n.provisional++,s}#V(e,n){for(let t=n.provisional;t<n.length;t++){let s=n[t];if((this.nocase?nh(e.name):Sd(e.name))===s.#_)return this.#p(e,s,t,n)}}#p(e,n,t,s){let a=n.name;return n.#t=n.#t&md|W1(e),a!==e.name&&(n.name=e.name),t!==s.provisional&&(t===s.length-1?s.pop():s.splice(t,1),s.unshift(n)),s.provisional++,n}async lstat(){if((this.#t&es)===0)try{return this.#$(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#I(e.code)}}lstatSync(){if((this.#t&es)===0)try{return this.#$(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#I(e.code)}}#$(e){let{atime:n,atimeMs:t,birthtime:s,birthtimeMs:a,blksize:o,blocks:r,ctime:i,ctimeMs:c,dev:d,gid:l,ino:p,mode:u,mtime:h,mtimeMs:m,nlink:f,rdev:y,size:g,uid:E}=e;this.#x=n,this.#d=t,this.#g=s,this.#b=a,this.#l=o,this.#h=r,this.#v=i,this.#f=c,this.#n=d,this.#m=l,this.#i=p,this.#a=u,this.#y=h,this.#o=m,this.#s=f,this.#u=y,this.#c=g,this.#r=E;let S=W1(e);this.#t=this.#t&md|S|LO,S!==Vt&&S!==gs&&S!==xo&&(this.#t|=Ed)}#U=[];#k=!1;#K(e){this.#k=!1;let n=this.#U.slice();this.#U.length=0,n.forEach(t=>t(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let t=this.children();if(this.calledReaddir()){let a=t.slice(0,t.provisional);n?e(null,a):queueMicrotask(()=>e(null,a));return}if(this.#U.push(e),this.#k)return;this.#k=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(a,o)=>{if(a)this.#q(a.code),t.provisional=0;else{for(let r of o)this.#j(r,t);this.#F(t)}this.#K(t.slice(0,t.provisional))})}#z;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#z)await this.#z;else{let t=()=>{};this.#z=new Promise(s=>t=s);try{for(let s of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#j(s,e);this.#F(e)}catch(s){this.#q(s.code),e.provisional=0}this.#z=void 0,t()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let t of this.#e.readdirSync(n,{withFileTypes:!0}))this.#j(t,e);this.#F(e)}catch(t){this.#q(t.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&PO)return!1;let e=Yt&this.#t;return e===Vt||e===gs||e===xo}shouldWalk(e,n){return(this.#t&gs)===gs&&!(this.#t&PO)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#O)return this.#O;if(!((sh|eh|es)&this.#t))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#M()}}realpathSync(){if(this.#O)return this.#O;if(!((sh|eh|es)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#M()}}[fv](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),t=[],s=this;for(;s&&s.parent;)n.add(s),s.#T=t.join(this.sep),s.#w=t.join("/"),s=s.parent,t.push("..");for(s=e;s&&s.parent&&!n.has(s);)s.#T=void 0,s.#w=void 0,s=s.parent}},yv=class gv extends ft{sep="\\";splitSep=pK;constructor(n,t=Vt,s,a,o,r,i){super(n,t,s,a,o,r,i)}newChild(n,t=Vt,s={}){return new gv(n,t,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(n){return Vr.win32.parse(n).root}getRoot(n){if(n=lK(n.toUpperCase()),n===this.root.name)return this.root;for(let[t,s]of Object.entries(this.roots))if(this.sameRoot(n,t))return this.roots[n]=s;return this.roots[n]=new eS(n,this).root}sameRoot(n,t=this.root.name){return n=n.toUpperCase().replace(/\//g,"\\").replace(dv,"$1\\"),n===t}},Ev=class Sv extends ft{splitSep="/";sep="/";constructor(n,t=Vt,s,a,o,r,i){super(n,t,s,a,o,r,i)}getRootString(n){return n.startsWith("/")?"/":""}getRoot(n){return this.root}newChild(n,t=Vt,s={}){return new Sv(n,t,this.root,this.roots,this.nocase,this.childrenCache(),s)}},xv=class{root;rootPath;roots;cwd;#e;#n;#a;nocase;#s;constructor(e=process.cwd(),n,t,{nocase:s,childrenCacheSize:a=16*1024,fs:o=gd}={}){this.#s=cv(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,ov.fileURLToPath)(e));let r=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(r),this.#e=new UO,this.#n=new UO,this.#a=new hK(a);let i=r.substring(this.rootPath.length).split(t);if(i.length===1&&!i[0]&&i.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let c=this.root,d=i.length-1,l=n.sep,p=this.rootPath,u=!1;for(let h of i){let m=d--;c=c.child(h,{relative:new Array(m).fill("..").join(l),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(u?"":l)+h}),u=!0}this.cwd=c}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#a}resolve(...e){let n="";for(let a=e.length-1;a>=0;a--){let o=e[a];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let t=this.#e.get(n);if(t!==void 0)return t;let s=this.cwd.resolve(n).fullpath();return this.#e.set(n,s),s}resolvePosix(...e){let n="";for(let a=e.length-1;a>=0;a--){let o=e[a];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let t=this.#n.get(n);if(t!==void 0)return t;let s=this.cwd.resolve(n).fullpathPosix();return this.#n.set(n,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t}=n;if(e.canReaddir()){let s=await e.readdir();return t?s:s.map(a=>a.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0}=n;return e.canReaddir()?t?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e.withFileTypes,e=this.cwd);let t=await e.readlink();return n?t:t?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e.withFileTypes,e=this.cwd);let t=e.readlinkSync();return n?t:t?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e.withFileTypes,e=this.cwd);let t=await e.realpath();return n?t:t?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e.withFileTypes,e=this.cwd);let t=e.realpathSync();return n?t:t?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n,r=[];(!a||a(e))&&r.push(t?e:e.fullpath());let i=new Set,c=(l,p)=>{i.add(l),l.readdirCB((u,h)=>{if(u)return p(u);let m=h.length;if(!m)return p();let f=()=>{--m===0&&p()};for(let y of h)(!a||a(y))&&r.push(t?y:y.fullpath()),s&&y.isSymbolicLink()?y.realpath().then(g=>g?.isUnknown()?g.lstat():g).then(g=>g?.shouldWalk(i,o)?c(g,f):f()):y.shouldWalk(i,o)?c(y,f):f()},!0)},d=e;return new Promise((l,p)=>{c(d,u=>{if(u)return p(u);l(r)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n,r=[];(!a||a(e))&&r.push(t?e:e.fullpath());let i=new Set([e]);for(let c of i){let d=c.readdirSync();for(let l of d){(!a||a(l))&&r.push(t?l:l.fullpath());let p=l;if(l.isSymbolicLink()){if(!(s&&(p=l.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(i,o)&&i.add(p)}}return r}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n;(!a||a(e))&&(yield t?e:e.fullpath());let r=new Set([e]);for(let i of r){let c=i.readdirSync();for(let d of c){(!a||a(d))&&(yield t?d:d.fullpath());let l=d;if(d.isSymbolicLink()){if(!(s&&(l=d.realpathSync())))continue;l.isUnknown()&&l.lstatSync()}l.shouldWalk(r,o)&&r.add(l)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n,r=new rh({objectMode:!0});(!a||a(e))&&r.write(t?e:e.fullpath());let i=new Set,c=[e],d=0,l=()=>{let p=!1;for(;!p;){let u=c.shift();if(!u){d===0&&r.end();return}d++,i.add(u);let h=(f,y,g=!1)=>{if(f)return r.emit("error",f);if(s&&!g){let E=[];for(let S of y)S.isSymbolicLink()&&E.push(S.realpath().then(R=>R?.isUnknown()?R.lstat():R));if(E.length){Promise.all(E).then(()=>h(null,y,!0));return}}for(let E of y)E&&(!a||a(E))&&(r.write(t?E:E.fullpath())||(p=!0));d--;for(let E of y){let S=E.realpathCached()||E;S.shouldWalk(i,o)&&c.push(S)}p&&!r.flowing?r.once("drain",l):m||l()},m=!0;u.readdirCB(h,!0),m=!1}};return l(),r}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ft||(n=e,e=this.cwd);let{withFileTypes:t=!0,follow:s=!1,filter:a,walkFilter:o}=n,r=new rh({objectMode:!0}),i=new Set;(!a||a(e))&&r.write(t?e:e.fullpath());let c=[e],d=0,l=()=>{let p=!1;for(;!p;){let u=c.shift();if(!u){d===0&&r.end();return}d++,i.add(u);let h=u.readdirSync();for(let m of h)(!a||a(m))&&(r.write(t?m:m.fullpath())||(p=!0));d--;for(let m of h){let f=m;if(m.isSymbolicLink()){if(!(s&&(f=m.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(i,o)&&c.push(f)}}p&&!r.flowing&&r.once("drain",l)};return l(),r}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[fv](n)}},eS=class extends xv{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:t=!0}=n;super(e,Vr.win32,"\\",{...n,nocase:t}),this.nocase=t;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Vr.win32.parse(e).root.toUpperCase()}newRoot(e){return new yv(this.rootPath,gs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},nS=class extends xv{sep="/";constructor(e=process.cwd(),n={}){let{nocase:t=!1}=n;super(e,Vr.posix,"/",{...n,nocase:t}),this.nocase=t}parseRootPath(e){return"/"}newRoot(e){return new Ev(this.rootPath,gs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},bv=class extends nS{constructor(e=process.cwd(),n={}){let{nocase:t=!0}=n;super(e,{...n,nocase:t})}},Nce=process.platform==="win32"?yv:Ev,mK=process.platform==="win32"?eS:process.platform==="darwin"?bv:nS,fK=e=>e.length>=1,yK=e=>e.length>=1,gK=Symbol.for("nodejs.util.inspect.custom"),Tv=class Rv{#e;#n;#a;length;#s;#r;#m;#u;#l;#i;#c=!0;constructor(n,t,s,a){if(!fK(n))throw new TypeError("empty pattern list");if(!yK(t))throw new TypeError("empty glob list");if(t.length!==n.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=n.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#e=n,this.#n=t,this.#a=s,this.#s=a,this.#a===0){if(this.isUNC()){let[o,r,i,c,...d]=this.#e,[l,p,u,h,...m]=this.#n;d[0]===""&&(d.shift(),m.shift());let f=[o,r,i,c,""].join("/"),y=[l,p,u,h,""].join("/");this.#e=[f,...d],this.#n=[y,...m],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[o,...r]=this.#e,[i,...c]=this.#n;r[0]===""&&(r.shift(),c.shift());let d=o+"/",l=i+"/";this.#e=[d,...r],this.#n=[l,...c],this.length=this.#e.length}}}[gK](){return"Pattern <"+this.#n.slice(this.#a).join("/")+">"}pattern(){return this.#e[this.#a]}isString(){return typeof this.#e[this.#a]=="string"}isGlobstar(){return this.#e[this.#a]===ot}isRegExp(){return this.#e[this.#a]instanceof RegExp}globString(){return this.#m=this.#m||(this.#a===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#a).join("/"))}hasMore(){return this.length>this.#a+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new Rv(this.#e,this.#n,this.#a+1,this.#s),this.#r.#i=this.#i,this.#r.#l=this.#l,this.#r.#u=this.#u,this.#r):this.#r=null}isUNC(){let n=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#s==="win32"&&this.#a===0&&n[0]===""&&n[1]===""&&typeof n[2]=="string"&&!!n[2]&&typeof n[3]=="string"&&!!n[3]}isDrive(){let n=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#s==="win32"&&this.#a===0&&this.length>1&&typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0])}isAbsolute(){let n=this.#e;return this.#i!==void 0?this.#i:this.#i=n[0]===""&&n.length>1||this.isDrive()||this.isUNC()}root(){let n=this.#e[0];return typeof n=="string"&&this.isAbsolute()&&this.#a===0?n:""}checkFollowGlobstar(){return!(this.#a===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#a===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}},EK=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",MO=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:t,noext:s,noglobstar:a,platform:o=EK}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:t,noext:s,noglobstar:a,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let r of e)this.add(r)}add(e){let n=new _a(e,this.mmopts);for(let t=0;t<n.set.length;t++){let s=n.set[t],a=n.globParts[t];if(!s||!a)throw new Error("invalid pattern object");for(;s[0]==="."&&a[0]===".";)s.shift(),a.shift();let o=new Tv(s,a,0,this.platform),r=new _a(o.globString(),this.mmopts),i=a[a.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(r):this.relative.push(r),i&&(c?this.absoluteChildren.push(r):this.relativeChildren.push(r))}}ignored(e){let n=e.fullpath(),t=`${n}/`,s=e.relative()||".",a=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(a))return!0;for(let o of this.absolute)if(o.match(n)||o.match(t))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",t=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(t))return!0;for(let s of this.absoluteChildren)if(s.match(n))return!0;return!1}},SK=class _v{store;constructor(n=new Map){this.store=n}copy(){return new _v(new Map(this.store))}hasWalked(n,t){return this.store.get(n.fullpath())?.has(t.globString())}storeWalked(n,t){let s=n.fullpath(),a=this.store.get(s);a?a.add(t.globString()):this.store.set(s,new Set([t.globString()]))}},xK=class{store=new Map;add(e,n,t){let s=(n?2:0)|(t?1:0),a=this.store.get(e);this.store.set(e,a===void 0?s:s&a)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}},bK=class{store=new Map;add(e,n){if(!e.canReaddir())return;let t=this.store.get(e);t?t.find(s=>s.globString()===n.globString())||t.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},FO=class Av{hasWalkedCache;matches=new xK;subwalks=new bK;patterns;follow;dot;opts;constructor(n,t){this.opts=n,this.follow=!!n.follow,this.dot=!!n.dot,this.hasWalkedCache=t?t.copy():new SK}processPatterns(n,t){this.patterns=t;let s=t.map(a=>[n,a]);for(let[a,o]of s){this.hasWalkedCache.storeWalked(a,o);let r=o.root(),i=o.isAbsolute()&&this.opts.absolute!==!1;if(r){a=a.resolve(r==="/"&&this.opts.root!==void 0?this.opts.root:r);let p=o.rest();if(p)o=p;else{this.matches.add(a,!0,!1);continue}}if(a.isENOENT())continue;let c,d,l=!1;for(;typeof(c=o.pattern())=="string"&&(d=o.rest());)a=a.resolve(c),o=d,l=!0;if(c=o.pattern(),d=o.rest(),l){if(this.hasWalkedCache.hasWalked(a,o))continue;this.hasWalkedCache.storeWalked(a,o)}if(typeof c=="string"){let p=c===".."||c===""||c===".";this.matches.add(a.resolve(c),i,p);continue}else if(c===ot){(!a.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(a,o);let p=d?.pattern(),u=d?.rest();if(!d||(p===""||p===".")&&!u)this.matches.add(a,i,p===""||p===".");else if(p===".."){let h=a.parent||a;u?this.hasWalkedCache.hasWalked(h,u)||this.subwalks.add(h,u):this.matches.add(h,i,!0)}}else c instanceof RegExp&&this.subwalks.add(a,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Av(this.opts,this.hasWalkedCache)}filterEntries(n,t){let s=this.subwalks.get(n),a=this.child();for(let o of t)for(let r of s){let i=r.isAbsolute(),c=r.pattern(),d=r.rest();c===ot?a.testGlobstar(o,r,d,i):c instanceof RegExp?a.testRegExp(o,c,d,i):a.testString(o,c,d,i)}return a}testGlobstar(n,t,s,a){if((this.dot||!n.name.startsWith("."))&&(t.hasMore()||this.matches.add(n,a,!1),n.canReaddir()&&(this.follow||!n.isSymbolicLink()?this.subwalks.add(n,t):n.isSymbolicLink()&&(s&&t.checkFollowGlobstar()?this.subwalks.add(n,s):t.markFollowGlobstar()&&this.subwalks.add(n,t)))),s){let o=s.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(n,o,s.rest(),a);else if(o===".."){let r=n.parent||n;this.subwalks.add(r,s)}else o instanceof RegExp&&this.testRegExp(n,o,s.rest(),a)}}testRegExp(n,t,s,a){t.test(n.name)&&(s?this.subwalks.add(n,s):this.matches.add(n,a,!1))}testString(n,t,s,a){n.isNamed(t)&&(s?this.subwalks.add(n,s):this.matches.add(n,a,!1))}},TK=(e,n)=>typeof e=="string"?new MO([e],n):Array.isArray(e)?new MO(e,n):e,wv=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#a;signal;maxDepth;includeChildMatches;constructor(e,n,t){if(this.patterns=e,this.path=n,this.opts=t,this.#a=!t.posix&&t.platform==="win32"?"\\":"/",this.includeChildMatches=t.includeChildMatches!==!1,(t.ignore||!this.includeChildMatches)&&(this.#n=TK(t.ignore??[],t),!this.includeChildMatches&&typeof this.#n.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=t.maxDepth||1/0,t.signal&&(this.signal=t.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#s(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#r(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,n){if(n&&this.opts.nodir)return;let t;if(this.opts.realpath){if(t=e.realpathCached()||await e.realpath(),!t)return;e=t}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#s(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let t;if(this.opts.realpath){if(t=e.realpathCached()||e.realpathSync(),!t)return;e=t}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#s(e))return;if(!this.includeChildMatches&&this.#n?.add){let a=`${e.relativePosix()}/**`;this.#n.add(a)}let t=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#a:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(t){let a=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(a+s)}else{let a=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!a.startsWith(".."+this.#a)?"."+this.#a:"";this.matchEmit(a?o+a+s:"."+s)}}async match(e,n,t){let s=await this.matchCheck(e,t);s&&this.matchFinish(s,n)}matchSync(e,n,t){let s=this.matchCheckSync(e,t);s&&this.matchFinish(s,n)}walkCB(e,n,t){this.signal?.aborted&&t(),this.walkCB2(e,n,new FO(this.opts),t)}walkCB2(e,n,t,s){if(this.#r(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,n,t,s));return}t.processPatterns(e,n);let a=1,o=()=>{--a===0&&s()};for(let[r,i,c]of t.matches.entries())this.#s(r)||(a++,this.match(r,i,c).then(()=>o()));for(let r of t.subwalkTargets()){if(this.maxDepth!==1/0&&r.depth()>=this.maxDepth)continue;a++;let i=r.readdirCached();r.calledReaddir()?this.walkCB3(r,i,t,o):r.readdirCB((c,d)=>this.walkCB3(r,d,t,o),!0)}o()}walkCB3(e,n,t,s){t=t.filterEntries(e,n);let a=1,o=()=>{--a===0&&s()};for(let[r,i,c]of t.matches.entries())this.#s(r)||(a++,this.match(r,i,c).then(()=>o()));for(let[r,i]of t.subwalks.entries())a++,this.walkCB2(r,i,t.child(),o);o()}walkCBSync(e,n,t){this.signal?.aborted&&t(),this.walkCB2Sync(e,n,new FO(this.opts),t)}walkCB2Sync(e,n,t,s){if(this.#r(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,t,s));return}t.processPatterns(e,n);let a=1,o=()=>{--a===0&&s()};for(let[r,i,c]of t.matches.entries())this.#s(r)||this.matchSync(r,i,c);for(let r of t.subwalkTargets()){if(this.maxDepth!==1/0&&r.depth()>=this.maxDepth)continue;a++;let i=r.readdirSync();this.walkCB3Sync(r,i,t,o)}o()}walkCB3Sync(e,n,t,s){t=t.filterEntries(e,n);let a=1,o=()=>{--a===0&&s()};for(let[r,i,c]of t.matches.entries())this.#s(r)||this.matchSync(r,i,c);for(let[r,i]of t.subwalks.entries())a++,this.walkCB2Sync(r,i,t.child(),o);o()}},qO=class extends wv{matches=new Set;constructor(e,n,t){super(e,n,t)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},jO=class extends wv{results;constructor(e,n,t){super(e,n,t),this.results=new rh({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},RK=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",bo=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,ev.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(i=>i.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(i=>i.includes("/")?i:`./**/${i}`)}if(this.pattern=e,this.platform=n.platform||RK,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let i=n.platform==="win32"?eS:n.platform==="darwin"?bv:n.platform?nS:mK;this.scurry=new i(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let t=this.platform==="darwin"||this.platform==="win32",s={braceExpandMax:1e4,...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:t,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},a=this.pattern.map(i=>new _a(i,s)),[o,r]=a.reduce((i,c)=>(i[0].push(...c.set),i[1].push(...c.globParts),i),[[],[]]);this.patterns=o.map((i,c)=>{let d=r[c];if(!d)throw new Error("invalid pattern object");return new Tv(i,d,0,this.platform)})}async walk(){return[...await new qO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new qO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new jO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new jO(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},_K=(e,n={})=>{Array.isArray(e)||(e=[e]);for(let t of e)if(new _a(t,n).hasMagic())return!0;return!1};function lh(e,n={}){return new bo(e,n).streamSync()}function Ov(e,n={}){return new bo(e,n).stream()}function vv(e,n={}){return new bo(e,n).walkSync()}async function YO(e,n={}){return new bo(e,n).walk()}function ph(e,n={}){return new bo(e,n).iterateSync()}function kv(e,n={}){return new bo(e,n).iterate()}var AK=lh,wK=Object.assign(Ov,{sync:lh}),OK=ph,vK=Object.assign(kv,{sync:ph}),kK=Object.assign(vv,{stream:lh,iterate:ph}),ih=Object.assign(YO,{glob:YO,globSync:vv,sync:kK,globStream:Ov,stream:wK,globStreamSync:lh,streamSync:AK,globIterate:kv,iterate:vK,globIterateSync:ph,iterateSync:OK,Glob:bo,hasMagic:_K,escape:WO,unescape:Yr});ih.glob=ih;function IK(e){return Ot((0,uh.pathToFileURL)(e).href)}function tS(e){return e.startsWith("file://")?(0,uh.fileURLToPath)(e):e}function Iv(e={}){let n=e.ignoredPathSegments;return{async read(t){try{return await(0,xd.readFile)(tS(t),{encoding:"utf8",signal:e.signal})}catch(s){let a=s.code;if(a==="ENOENT"||a==="EISDIR")return;throw s}},async exists(t){try{return await(0,xd.stat)(tS(t)),!0}catch{return!1}},async glob(t,s){return(await ih(s,{cwd:tS(t),withFileTypes:!0,dot:e.includeHidden===!0,follow:!1,nodir:!0,nocase:e.caseInsensitive===!0,ignore:{childrenIgnored:o=>o.isSymbolicLink()||n?.includes(o.name)===!0},signal:e.signal})).filter(o=>!o.isSymbolicLink()).map(o=>IK(o.fullpath())).sort()}}}b();T();b();T();var bd="asset bundle 100";var Td=[{uri:"hexasync://index",name:"index",title:"HexaSync Profile Template \u2014 knowledge base",description:"Use this knowledge base to choose a component, understand its actual authoring contract and adapt its supported examples.",mimeType:"text/markdown",text:`# HexaSync Profile Template \u2014 knowledge base
147
147
 
148
148
  > Addressable through MCP as **\`hexasync://index\`**.
149
149
 
@@ -1274,7 +1274,7 @@ A reused language or component has one canonical explanation. Follow the interna
1274
1274
  }
1275
1275
  `,assetPath:"assets/dependencies/dependency.json"},{uri:"hexasync://assets/docs/examples.json",name:"assets/docs/examples.json",title:"docs/examples.json",description:"Bundled data: docs/examples.json.",mimeType:"application/json",text:`{
1276
1276
  "$split": "This JSON is served in parts. Each {\\"$resource\\": uri} object stands for the JSON value read from that resource; each {\\"$parts\\": [...]} object stands for the array formed by concatenating the arrays read from its parts, in order.",
1277
- "bundle": 99,
1277
+ "bundle": 100,
1278
1278
  "connectorFacetNote": "These component snippets do not infer provider connector identity. Use their canonical component documents for connection assumptions.",
1279
1279
  "entries": {
1280
1280
  "$resource": "hexasync://assets/docs/examples.json/entries"
@@ -41859,7 +41859,7 @@ A reused language or component has one canonical explanation. Follow the interna
41859
41859
  }
41860
41860
  }
41861
41861
  }
41862
- `,assetPath:"assets/webhooks/WebhookTarget.json"},{uri:"hexasync://docs/AI-INDEX",name:"docs/AI-INDEX",title:"HexaSync Profile Template Knowledge Base",description:"Asset bundle 99 \xB7 extension 2610.12.2.",mimeType:"text/markdown",text:"<!-- GENERATED KNOWLEDGE INDEX \u2014 DO NOT EDIT. Run `yarn ai:index`. -->\n# HexaSync Profile Template Knowledge Base\n\n**Asset bundle 99 \xB7 extension 2610.12.2.**\n\n## Authoring boundaries\n\n- Worker Workflow steps and frontend creation/setup steps are different domains. Shared names do not make their payloads or execution interchangeable.\n- Use actual existing component and provider identities. Resolution and unresolved outcomes belong to each component contract.\n- Context roots depend on the workflow host and execution stage. A legal authoring root is not a promise that it exists at entry.\n- Examples explain inputs, prerequisites and expected effects.\n- This index is a retrieval map. Read the linked component page for defaults, precedence, variants and failure behavior.\n\n## Component pages\n\n| question | reference |\n| --- | --- |\n| root collections, identities and includes | [Profile root](hexasync://docs/PROFILE-ROOT) |\n| frontend creation/setup/authorization steps and connector definitions | [Frontend steps](hexasync://docs/PROFILE-ROOT/profile-root-fields-1/frontend-steps-creationsteps-setupsteps-authorizationsteps), [Connector definition](hexasync://docs/PROFILE-ROOT/profile-root-fields-1/connector-definition-document) |\n| Workflow selection, envelope, argument placement and flags | [Step envelope](hexasync://docs/steps/STEP-ENVELOPE) |\n| host/stage context, Scriban, JSONata and expression call sites | [Expressions and context](hexasync://docs/expressions/CONTEXT-AND-IO) |\n| next targets, branches, termination and loop guards | [Routing](hexasync://docs/routing/NEXT) |\n| response parsers and site-specific result handling | [Response filters](hexasync://docs/responseFilters/RESPONSE-FILTERS) |\n| Builder DSL versus API Filter DSL | [QueryDSL](hexasync://docs/query-dsl/QUERY-DSL) |\n| connection binding, options, auth and HTTP request builders | [Connections](hexasync://docs/connections/CONNECTIONS), [API](hexasync://docs/steps/API) |\n| self connector identity (`**SelfConnectorProviderId**`, `IS_SELF_CONNECTOR`) and why `CONN-1` names it | [The self connector](hexasync://docs/connections/CONNECTIONS/the-self-connector#its-identity-and-why-conn-1-names-it) |\n| pulling, pushing, ingress and startup hosts | [Pullers](hexasync://docs/pullers/PULLERS), [Pushers](hexasync://docs/pushers/PUSHERS), [Webhooks](hexasync://docs/webhooks/WEBHOOKS), [Startup](hexasync://docs/startupTasks/STARTUP-TASKS) |\n| creating/binding gateway webhooks, captured delivery payloads as samples, replay limits, hosted Gateway MCP sign-in | [Gateway MCP webhook workflow](hexasync://docs/webhooks/WEBHOOKS/gateway-mcp-webhook-workflow) |\n| How do I decide incremental vs full pull for an entity, validate its watermark, resume and terminate safely, classify API failures, and reconcile deletions? | [Puller completeness contract](hexasync://docs/pullers/PULLERS/puller-completeness-contract), [Entity classification](hexasync://docs/pullers/PULLERS/entity-classification) |\n| endpoint filter/anchor/page-size facts, watermark boundary inclusivity, timezone and overlap, natural-key ordering and ties, request budget and 429 handling | [Earn endpoint request facts](hexasync://docs/pullers/PULLERS/puller-completeness-contract#earn-endpoint-request-facts), [Watermark boundary validation](hexasync://docs/pullers/PULLERS/puller-completeness-contract#watermark-boundary-validation), [Natural-key ordering and ties](hexasync://docs/pullers/PULLERS/puller-completeness-contract#natural-key-ordering-and-ties), [Request budget and throttling](hexasync://docs/pullers/PULLERS/puller-completeness-contract#request-budget-and-throttling) |\n| deletion reconciliation through a periodic full run, one schedule per job type, a second cadence through a trigger task, retries and job history | [Deletion reconciliation through a periodic full run](hexasync://docs/pullers/PULLERS/puller-completeness-contract#deletion-reconciliation-through-a-periodic-full-run), [One schedule per job type](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata#one-schedule-per-job-type), [Periodic processing through a trigger task](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata#periodic-processing-through-a-trigger-task), [Choosing pull and enqueue cadence](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata#choosing-pull-and-enqueue-cadence) |\n| mapping API/event members to snake_case columns before saving, explicit destination bodies | [Explicit field mapping](hexasync://docs/steps/SAVE_TASK_DATA#explicit-field-mapping), [Explicit mapping for push](hexasync://docs/transformations/TRANSFORMATIONS/explicit-mapping-for-push) |\n| classifying HTTP status, thrown calls and invalid envelopes into one error code without one step per error class | [Classify once, raise once](hexasync://docs/steps/Error#classify-once-raise-once) |\n| several vendor accounts, credential scope per connection, shared provider quota | [One connection, one credential scope](hexasync://docs/connections/CONNECTIONS/one-connection-one-credential-scope) |\n| webhook signature, raw body, acknowledgement, multi-event deliveries, partial payloads, registration health | [Provider webhook authoring standards](hexasync://docs/webhooks/WEBHOOKS/gateway-mcp-webhook-workflow#provider-webhook-authoring-standards), [Worked sample](hexasync://docs/webhooks/WEBHOOKS/gateway-mcp-webhook-workflow#worked-sample-a-signed-credential-scope-delivery) |\n| immediate startup pull, scheduler setup and first-reconcile defaults | [Typed scheduler](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata), [Legacy scheduler initialization](hexasync://docs/startupTasks/STARTUP-TASKS/legacy-target-tasks#legacy-scheduler-initialization), [Dashboard versus execution](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata#dashboard-presentation-versus-execution) |\n| task binding, dependency gates and physical storage | [Objects](hexasync://docs/objects/object), [Associations](hexasync://docs/objectAssociations/OBJECT-ASSOCIATIONS), [Dependencies](hexasync://docs/dependencies/DEPENDENCIES), [Tasks](hexasync://docs/tasks/TASKS-AND-TABLES), [Tables](hexasync://docs/tables/TABLES) |\n| transformation order, item context, abort/no-op and executor outcomes | [Transformation chain](hexasync://docs/transformations/TRANSFORMATIONS/transformation-chain-contract) |\n| stored SQL validity versus per-item diagnostics | [Validations](hexasync://docs/validations/VALIDATIONS) |\n| metric readers, handlers, scoring and reports | [Metrics](hexasync://docs/metrics/METRICS_REFERENCE), [Reports](hexasync://docs/reports/REPORTS) |\n| one worker executor and its alternatives | [Worker step index](hexasync://docs/steps/INDEX) |\n\n## Collections: root declaration shapes\n\n- `connectors` \u2014 array of connections/connection\n- `contributors` \u2014 array of contributor\n- `dependencies` \u2014 array of dependencies/dependency\n- `externals` \u2014 array of externals\n- `metricGroups` \u2014 array of metrics/metricGroup\n- `objectAssociations` \u2014 map of objectAssociations/objectAssociation\n- `objects` \u2014 array of objects/object\n- `pullers` \u2014 array of pullers/puller\n- `pushers` \u2014 array of pushers/pusher\n- `reports` \u2014 array of reports/report\n- `startupTasks` \u2014 array of startupTasks/startupTask\n- `tables` \u2014 array of tables/table\n- `transformations` \u2014 map of arrays of transformations/transformation\n- `validations` \u2014 map of arrays of validations/validation\n- `webhooks` \u2014 array of webhooks/Webhook\n\n## Worker executable authoring choices (42)\n`API`, `BASE64_TO_MIME_TYPE`, `CACHE`, `CHECK_FORMAT`, `DIRECT_INDEX`, `DOWNLOAD_CSV`, `ENQUEUER`, `EXCEL_READER`, `EXCEPTION`, `Error`, `FORWARD`, `GET_KEY_VALUE`, `IF`, `IGNORE_ITEM`, `INVALIDATE_CACHE`, `JSONata`, `LOOKUP_STEP`, `METRIC_QUERY`, `PUBLISH_EVENT`, `PULLER`, `PUSHER`, `QUERY_MANY`, `QUERY_METRICS`, `QUERY_SINGLE`, `REMOVE_DATA`, `RESET_ITEM`, `RESOLVE_RAW_DATA`, `SAVE_TASK_DATA`, `SEED_DATA`, `SET_KEY_VALUE`, `SLEEP`, `SQL`, `SQL_PROXY`, `SWITCH`, `Scriban`, `TRACK_FOR_REMOVAL`, `UPDATE_ITEM_STATUS`, `UPDATE_ITEM_SYNC_PROCESS`, `UPDATE_TASK_DATA_STATUS`, `VALUES`, `VERIFY_CACHED`, `WEBHOOK_FORWARD`\n\nRegistered but throwing (9): `Begin`, `Composite`, `End`, `GraphQL`, `Liquid`, `OData`, `QueryDSL`, `Restful`, `cURL`. Read their rejected forms and actual alternatives through the worker step index.\n\n## Frontend declaration vocabulary (19)\n`API`, `BROWSER`, `FORM`, `GATEWAY_API`, `GET_LOCAL_STORAGE`, `HEALTH_CHECK_WORKER`, `IF`, `INTEGRATION_APP_MANAGEMENT`, `JSONATA`, `LIQUID`, `MULTIPLE_CHOICE_FORM`, `READ_QUERIES`, `REDIRECT`, `SELECT_GOOGLE_DRIVE`, `SET_LOCAL_STORAGE`, `SHOW_INFO`, `SINGLE_CHOICE_FORM`, `SWITCH`, `WAIT`\n\n## Transformation authoring vocabulary (12)\n`BulkClone`, `BulkRename`, `Clone`, `Jsonata`, `Nested_SQL`, `None`, `QUERY_MANY`, `QUERY_SINGLE`, `RESOLVE_RAW_DATA`, `Rename`, `SQL`, `Scriban`\n`None` is [disabled](hexasync://docs/transformations/TRANSFORMATIONS/none--disabled-versus-absent-discriminator). `RenameDependency` is [declared but unimplemented](hexasync://docs/transformations/TRANSFORMATIONS/renamedependency--declared-but-unimplemented) and is not an accepted authoring discriminator.\n\n## Supported validation vocabulary (23)\n`BETWEEN`, `CONTAIN`, `END_WITH`, `EQUAL`, `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `IN`, `IS_EMPTY`, `IS_NULL`, `LENGTH`, `LESS_THAN`, `LESS_THAN_OR_EQUAL`, `MAX_LENGTH`, `MIN_LENGTH`, `NOT_CONTAIN`, `NOT_EMPTY`, `NOT_END_WITH`, `NOT_EQUAL`, `NOT_IN`, `NOT_NULL`, `NOT_START_WITH`, `REGEX`, `START_WITH`\nDeclaration-only members and datetime deployment prerequisites are explained on the validations page.\n\n## Builder DSL operators (35)\n`!=`, `<`, `<=`, `<>`, `=`, `>`, `>=`, `AND`, `BETWEEN`, `CONTAINS`, `ENDS_WITH`, `HAS_ALL_BITS`, `HAS_BITS`, `IN`, `ISNIL`, `ISNULL`, `IS_NIL`, `IS_NOT_NULL`, `IS_NULL`, `NIL`, `NNIL`, `NNULL`, `NOT_CONTAINS`, `NOT_ENDS_WITH`, `NOT_HAS_ALL_BITS`, `NOT_HAS_BITS`, `NOT_IN`, `NOT_NULL`, `NOT_REGEX`, `NOT_STARTS_WITH`, `NULL`, `OR`, `REGEX`, `STARTS_WITH`, `^LAST_[+-]?[0-9]+_[A-Za-z]+$`\n\n## Builder DSL operand kinds (5)\n`ARG`, `FIELD`, `PARAM`, `QUERY`, `VALUE`\nAPI Filter DSL has its own predicate vocabulary, request envelope and bit-mask semantics; do not substitute Builder syntax.\n\n## Editor/CLI diagnostic rule IDs (64)\n`API-1`, `API-2`, `ARG-1`, `ARG-2`, `ARG-3`, `ARG-4`, `ARG-5`, `ARG-6`, `ARG-7`, `COL-1`, `CONN-0`, `CONN-1`, `CONN-2`, `CONN-3`, `CONN-4`, `CONN-5`, `CTX-1`, `CTX-2`, `CTX-3`, `DEP-1`, `DRIFT-1`, `DUP-1`, `DUP-3`, `DUP-4`, `DUP-5`, `FLOW-3`, `FLOW-4`, `FLOW-5`, `FLOW-6`, `FLOW-7`, `FLOW-8`, `MDI-1`, `OVW-1`, `PLK-1`, `PLK-2`, `QDSL-1`, `REF-1`, `REF-13`, `REF-15`, `REF-16`, `REF-2`, `REF-3`, `REF-5`, `REF-6`, `REF-7`, `REF-9`, `REF-K1`, `REF-K2`, `RET-1`, `STEP-1`, `STEP-2`, `STEP-3`, `TBL-1`, `TBL-2`, `TBL-3`, `TBL-4`, `TBL-5`, `TBL-6`, `TBL-7`, `UNIMP-1`, `VAR-1`, `VAR-2`, `VAR-3`, `VAR-4`\nUse `hexasync_explain_rule` for diagnostic meaning and consequences.\n\n## Catalog systems with connector codes (16)\n- KiotViet \u2014 `kiotviet`\n- Lazada \u2014 `lazada`\n- Lightspeed X Series \u2014 `lightspeed-x-series`\n- Misa AMIS RPA \u2014 `misa-amis-frontend`\n- Misa AMIS \u2014 `misa-amis`\n- Sapo Omni V3 \u2014 `sapo-omni-v3`\n- Shopee \u2014 `shopee`\n- Shopify Custom App \u2014 `shopify-custom-app`\n- Shopify \u2014 `shopify-public-app`\n- Shopline Private App \u2014 `shopline-private-app`\n- Shopline \u2014 `shopline`\n- TikTok Shop (Gateway V3) \u2014 `tiktokshop`\n- TikTok Shop \u2014 `tiktokshop`\n- WooCommerce \u2014 `woocommerce`\n- Xero \u2014 `v2/xero`\n- Zalo \u2014 `zalo`\n\n## Catalog systems without a supported connector code (8)\n- Anchanto OMS (SelluSeller)\n- Brightpearl\n- Lightspeed X Series (Gateway V2)\n- MeInvoice\n- Packhai OMS\n- Wix\n- Zendesk\n- Zoho Desk\nCatalog presence does not create an executable connector or an authentication scheme.\n\n## Actual MCP retrieval\n\n- `resources/list` and `resources/read` expose the component pages and shipped schema data without a private source checkout.\n- `hexasync_explain_type` reads [step inputs](hexasync://assets/steps/inputs.json) and [step results](hexasync://assets/steps/outputs.json); read the component page for conditional output branches.\n- `hexasync_explain_position` describes the static authoring position; use the context page for host/stage availability.\n- `hexasync_search_examples` reads [1275 authored YAML examples](hexasync://assets/docs/examples.json), including their surrounding explanation and component page. Fragments are not necessarily complete profiles or successful-input examples. Connector identity is not guessed.\n- `hexasync_list_connectors` reads the [connector catalog](hexasync://assets/connectors/catalog.json); use existing workspace identities rather than inventing IDs.\n- This server never calls the gateway. Webhook resources, captured deliveries and replay are tools of the separately signed-in hosted Gateway MCP; read the [Gateway MCP webhook workflow](hexasync://docs/webhooks/WEBHOOKS/gateway-mcp-webhook-workflow) before asking the user.\n- [Root schema](hexasync://assets/main.json) reaches component item contracts. The [full knowledge index](hexasync://index) is the navigation entry.\n"},{uri:"hexasync://docs/connections/CONNECTIONS",name:"docs/connections/CONNECTIONS",title:"Connections and connectors",description:"Syntax. A profile declares connections as a list under connectors: (the legacy spelling connections: is still read):",mimeType:"text/markdown",text:`# Connections and connectors
41862
+ `,assetPath:"assets/webhooks/WebhookTarget.json"},{uri:"hexasync://docs/AI-INDEX",name:"docs/AI-INDEX",title:"HexaSync Profile Template Knowledge Base",description:"Asset bundle 100 \xB7 extension 2610.12.3.",mimeType:"text/markdown",text:"<!-- GENERATED KNOWLEDGE INDEX \u2014 DO NOT EDIT. Run `yarn ai:index`. -->\n# HexaSync Profile Template Knowledge Base\n\n**Asset bundle 100 \xB7 extension 2610.12.3.**\n\n## Authoring boundaries\n\n- Worker Workflow steps and frontend creation/setup steps are different domains. Shared names do not make their payloads or execution interchangeable.\n- Use actual existing component and provider identities. Resolution and unresolved outcomes belong to each component contract.\n- Context roots depend on the workflow host and execution stage. A legal authoring root is not a promise that it exists at entry.\n- Examples explain inputs, prerequisites and expected effects.\n- This index is a retrieval map. Read the linked component page for defaults, precedence, variants and failure behavior.\n\n## Component pages\n\n| question | reference |\n| --- | --- |\n| root collections, identities and includes | [Profile root](hexasync://docs/PROFILE-ROOT) |\n| frontend creation/setup/authorization steps and connector definitions | [Frontend steps](hexasync://docs/PROFILE-ROOT/profile-root-fields-1/frontend-steps-creationsteps-setupsteps-authorizationsteps), [Connector definition](hexasync://docs/PROFILE-ROOT/profile-root-fields-1/connector-definition-document) |\n| Workflow selection, envelope, argument placement and flags | [Step envelope](hexasync://docs/steps/STEP-ENVELOPE) |\n| host/stage context, Scriban, JSONata and expression call sites | [Expressions and context](hexasync://docs/expressions/CONTEXT-AND-IO) |\n| next targets, branches, termination and loop guards | [Routing](hexasync://docs/routing/NEXT) |\n| response parsers and site-specific result handling | [Response filters](hexasync://docs/responseFilters/RESPONSE-FILTERS) |\n| Builder DSL versus API Filter DSL | [QueryDSL](hexasync://docs/query-dsl/QUERY-DSL) |\n| connection binding, options, auth and HTTP request builders | [Connections](hexasync://docs/connections/CONNECTIONS), [API](hexasync://docs/steps/API) |\n| self connector identity (`**SelfConnectorProviderId**`, `IS_SELF_CONNECTOR`) and why `CONN-1` names it | [The self connector](hexasync://docs/connections/CONNECTIONS/the-self-connector#its-identity-and-why-conn-1-names-it) |\n| pulling, pushing, ingress and startup hosts | [Pullers](hexasync://docs/pullers/PULLERS), [Pushers](hexasync://docs/pushers/PUSHERS), [Webhooks](hexasync://docs/webhooks/WEBHOOKS), [Startup](hexasync://docs/startupTasks/STARTUP-TASKS) |\n| creating/binding gateway webhooks, captured delivery payloads as samples, replay limits, hosted Gateway MCP sign-in | [Gateway MCP webhook workflow](hexasync://docs/webhooks/WEBHOOKS/gateway-mcp-webhook-workflow) |\n| How do I decide incremental vs full pull for an entity, validate its watermark, resume and terminate safely, classify API failures, and reconcile deletions? | [Puller completeness contract](hexasync://docs/pullers/PULLERS/puller-completeness-contract), [Entity classification](hexasync://docs/pullers/PULLERS/entity-classification) |\n| endpoint filter/anchor/page-size facts, watermark boundary inclusivity, timezone and overlap, natural-key ordering and ties, request budget and 429 handling | [Earn endpoint request facts](hexasync://docs/pullers/PULLERS/puller-completeness-contract#earn-endpoint-request-facts), [Watermark boundary validation](hexasync://docs/pullers/PULLERS/puller-completeness-contract#watermark-boundary-validation), [Natural-key ordering and ties](hexasync://docs/pullers/PULLERS/puller-completeness-contract#natural-key-ordering-and-ties), [Request budget and throttling](hexasync://docs/pullers/PULLERS/puller-completeness-contract#request-budget-and-throttling) |\n| deletion reconciliation through a periodic full run, one schedule per job type, a second cadence through a trigger task, retries and job history | [Deletion reconciliation through a periodic full run](hexasync://docs/pullers/PULLERS/puller-completeness-contract#deletion-reconciliation-through-a-periodic-full-run), [One schedule per job type](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata#one-schedule-per-job-type), [Periodic processing through a trigger task](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata#periodic-processing-through-a-trigger-task), [Choosing pull and enqueue cadence](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata#choosing-pull-and-enqueue-cadence) |\n| mapping API/event members to snake_case columns before saving, explicit destination bodies | [Explicit field mapping](hexasync://docs/steps/SAVE_TASK_DATA#explicit-field-mapping), [Explicit mapping for push](hexasync://docs/transformations/TRANSFORMATIONS/explicit-mapping-for-push) |\n| classifying HTTP status, thrown calls and invalid envelopes into one error code without one step per error class | [Classify once, raise once](hexasync://docs/steps/Error#classify-once-raise-once) |\n| several vendor accounts, credential scope per connection, shared provider quota | [One connection, one credential scope](hexasync://docs/connections/CONNECTIONS/one-connection-one-credential-scope) |\n| webhook signature, raw body, acknowledgement, multi-event deliveries, partial payloads, registration health | [Provider webhook authoring standards](hexasync://docs/webhooks/WEBHOOKS/gateway-mcp-webhook-workflow#provider-webhook-authoring-standards), [Worked sample](hexasync://docs/webhooks/WEBHOOKS/gateway-mcp-webhook-workflow#worked-sample-a-signed-credential-scope-delivery) |\n| immediate startup pull, scheduler setup and first-reconcile defaults | [Typed scheduler](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata), [Legacy scheduler initialization](hexasync://docs/startupTasks/STARTUP-TASKS/legacy-target-tasks#legacy-scheduler-initialization), [Dashboard versus execution](hexasync://docs/startupTasks/STARTUP-TASKS/scheduler-metadata#dashboard-presentation-versus-execution) |\n| task binding, dependency gates and physical storage | [Objects](hexasync://docs/objects/object), [Associations](hexasync://docs/objectAssociations/OBJECT-ASSOCIATIONS), [Dependencies](hexasync://docs/dependencies/DEPENDENCIES), [Tasks](hexasync://docs/tasks/TASKS-AND-TABLES), [Tables](hexasync://docs/tables/TABLES) |\n| transformation order, item context, abort/no-op and executor outcomes | [Transformation chain](hexasync://docs/transformations/TRANSFORMATIONS/transformation-chain-contract) |\n| stored SQL validity versus per-item diagnostics | [Validations](hexasync://docs/validations/VALIDATIONS) |\n| metric readers, handlers, scoring and reports | [Metrics](hexasync://docs/metrics/METRICS_REFERENCE), [Reports](hexasync://docs/reports/REPORTS) |\n| one worker executor and its alternatives | [Worker step index](hexasync://docs/steps/INDEX) |\n\n## Collections: root declaration shapes\n\n- `connectors` \u2014 array of connections/connection\n- `contributors` \u2014 array of contributor\n- `dependencies` \u2014 array of dependencies/dependency\n- `externals` \u2014 array of externals\n- `metricGroups` \u2014 array of metrics/metricGroup\n- `objectAssociations` \u2014 map of objectAssociations/objectAssociation\n- `objects` \u2014 array of objects/object\n- `pullers` \u2014 array of pullers/puller\n- `pushers` \u2014 array of pushers/pusher\n- `reports` \u2014 array of reports/report\n- `startupTasks` \u2014 array of startupTasks/startupTask\n- `tables` \u2014 array of tables/table\n- `transformations` \u2014 map of arrays of transformations/transformation\n- `validations` \u2014 map of arrays of validations/validation\n- `webhooks` \u2014 array of webhooks/Webhook\n\n## Worker executable authoring choices (42)\n`API`, `BASE64_TO_MIME_TYPE`, `CACHE`, `CHECK_FORMAT`, `DIRECT_INDEX`, `DOWNLOAD_CSV`, `ENQUEUER`, `EXCEL_READER`, `EXCEPTION`, `Error`, `FORWARD`, `GET_KEY_VALUE`, `IF`, `IGNORE_ITEM`, `INVALIDATE_CACHE`, `JSONata`, `LOOKUP_STEP`, `METRIC_QUERY`, `PUBLISH_EVENT`, `PULLER`, `PUSHER`, `QUERY_MANY`, `QUERY_METRICS`, `QUERY_SINGLE`, `REMOVE_DATA`, `RESET_ITEM`, `RESOLVE_RAW_DATA`, `SAVE_TASK_DATA`, `SEED_DATA`, `SET_KEY_VALUE`, `SLEEP`, `SQL`, `SQL_PROXY`, `SWITCH`, `Scriban`, `TRACK_FOR_REMOVAL`, `UPDATE_ITEM_STATUS`, `UPDATE_ITEM_SYNC_PROCESS`, `UPDATE_TASK_DATA_STATUS`, `VALUES`, `VERIFY_CACHED`, `WEBHOOK_FORWARD`\n\nRegistered but throwing (9): `Begin`, `Composite`, `End`, `GraphQL`, `Liquid`, `OData`, `QueryDSL`, `Restful`, `cURL`. Read their rejected forms and actual alternatives through the worker step index.\n\n## Frontend declaration vocabulary (19)\n`API`, `BROWSER`, `FORM`, `GATEWAY_API`, `GET_LOCAL_STORAGE`, `HEALTH_CHECK_WORKER`, `IF`, `INTEGRATION_APP_MANAGEMENT`, `JSONATA`, `LIQUID`, `MULTIPLE_CHOICE_FORM`, `READ_QUERIES`, `REDIRECT`, `SELECT_GOOGLE_DRIVE`, `SET_LOCAL_STORAGE`, `SHOW_INFO`, `SINGLE_CHOICE_FORM`, `SWITCH`, `WAIT`\n\n## Transformation authoring vocabulary (12)\n`BulkClone`, `BulkRename`, `Clone`, `Jsonata`, `Nested_SQL`, `None`, `QUERY_MANY`, `QUERY_SINGLE`, `RESOLVE_RAW_DATA`, `Rename`, `SQL`, `Scriban`\n`None` is [disabled](hexasync://docs/transformations/TRANSFORMATIONS/none--disabled-versus-absent-discriminator). `RenameDependency` is [declared but unimplemented](hexasync://docs/transformations/TRANSFORMATIONS/renamedependency--declared-but-unimplemented) and is not an accepted authoring discriminator.\n\n## Supported validation vocabulary (23)\n`BETWEEN`, `CONTAIN`, `END_WITH`, `EQUAL`, `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `IN`, `IS_EMPTY`, `IS_NULL`, `LENGTH`, `LESS_THAN`, `LESS_THAN_OR_EQUAL`, `MAX_LENGTH`, `MIN_LENGTH`, `NOT_CONTAIN`, `NOT_EMPTY`, `NOT_END_WITH`, `NOT_EQUAL`, `NOT_IN`, `NOT_NULL`, `NOT_START_WITH`, `REGEX`, `START_WITH`\nDeclaration-only members and datetime deployment prerequisites are explained on the validations page.\n\n## Builder DSL operators (35)\n`!=`, `<`, `<=`, `<>`, `=`, `>`, `>=`, `AND`, `BETWEEN`, `CONTAINS`, `ENDS_WITH`, `HAS_ALL_BITS`, `HAS_BITS`, `IN`, `ISNIL`, `ISNULL`, `IS_NIL`, `IS_NOT_NULL`, `IS_NULL`, `NIL`, `NNIL`, `NNULL`, `NOT_CONTAINS`, `NOT_ENDS_WITH`, `NOT_HAS_ALL_BITS`, `NOT_HAS_BITS`, `NOT_IN`, `NOT_NULL`, `NOT_REGEX`, `NOT_STARTS_WITH`, `NULL`, `OR`, `REGEX`, `STARTS_WITH`, `^LAST_[+-]?[0-9]+_[A-Za-z]+$`\n\n## Builder DSL operand kinds (5)\n`ARG`, `FIELD`, `PARAM`, `QUERY`, `VALUE`\nAPI Filter DSL has its own predicate vocabulary, request envelope and bit-mask semantics; do not substitute Builder syntax.\n\n## Editor/CLI diagnostic rule IDs (64)\n`API-1`, `API-2`, `ARG-1`, `ARG-2`, `ARG-3`, `ARG-4`, `ARG-5`, `ARG-6`, `ARG-7`, `COL-1`, `CONN-0`, `CONN-1`, `CONN-2`, `CONN-3`, `CONN-4`, `CONN-5`, `CTX-1`, `CTX-2`, `CTX-3`, `DEP-1`, `DRIFT-1`, `DUP-1`, `DUP-3`, `DUP-4`, `DUP-5`, `FLOW-3`, `FLOW-4`, `FLOW-5`, `FLOW-6`, `FLOW-7`, `FLOW-8`, `MDI-1`, `OVW-1`, `PLK-1`, `PLK-2`, `QDSL-1`, `REF-1`, `REF-13`, `REF-15`, `REF-16`, `REF-2`, `REF-3`, `REF-5`, `REF-6`, `REF-7`, `REF-9`, `REF-K1`, `REF-K2`, `RET-1`, `STEP-1`, `STEP-2`, `STEP-3`, `TBL-1`, `TBL-2`, `TBL-3`, `TBL-4`, `TBL-5`, `TBL-6`, `TBL-7`, `UNIMP-1`, `VAR-1`, `VAR-2`, `VAR-3`, `VAR-4`\nUse `hexasync_explain_rule` for diagnostic meaning and consequences.\n\n## Catalog systems with connector codes (16)\n- KiotViet \u2014 `kiotviet`\n- Lazada \u2014 `lazada`\n- Lightspeed X Series \u2014 `lightspeed-x-series`\n- Misa AMIS RPA \u2014 `misa-amis-frontend`\n- Misa AMIS \u2014 `misa-amis`\n- Sapo Omni V3 \u2014 `sapo-omni-v3`\n- Shopee \u2014 `shopee`\n- Shopify Custom App \u2014 `shopify-custom-app`\n- Shopify \u2014 `shopify-public-app`\n- Shopline Private App \u2014 `shopline-private-app`\n- Shopline \u2014 `shopline`\n- TikTok Shop (Gateway V3) \u2014 `tiktokshop`\n- TikTok Shop \u2014 `tiktokshop`\n- WooCommerce \u2014 `woocommerce`\n- Xero \u2014 `v2/xero`\n- Zalo \u2014 `zalo`\n\n## Catalog systems without a supported connector code (8)\n- Anchanto OMS (SelluSeller)\n- Brightpearl\n- Lightspeed X Series (Gateway V2)\n- MeInvoice\n- Packhai OMS\n- Wix\n- Zendesk\n- Zoho Desk\nCatalog presence does not create an executable connector or an authentication scheme.\n\n## Actual MCP retrieval\n\n- `resources/list` and `resources/read` expose the component pages and shipped schema data without a private source checkout.\n- `hexasync_explain_type` reads [step inputs](hexasync://assets/steps/inputs.json) and [step results](hexasync://assets/steps/outputs.json); read the component page for conditional output branches.\n- `hexasync_explain_position` describes the static authoring position; use the context page for host/stage availability.\n- `hexasync_search_examples` reads [1275 authored YAML examples](hexasync://assets/docs/examples.json), including their surrounding explanation and component page. Fragments are not necessarily complete profiles or successful-input examples. Connector identity is not guessed.\n- `hexasync_list_connectors` reads the [connector catalog](hexasync://assets/connectors/catalog.json); use existing workspace identities rather than inventing IDs.\n- This server never calls the gateway. Webhook resources, captured deliveries and replay are tools of the separately signed-in hosted Gateway MCP; read the [Gateway MCP webhook workflow](hexasync://docs/webhooks/WEBHOOKS/gateway-mcp-webhook-workflow) before asking the user.\n- [Root schema](hexasync://assets/main.json) reaches component item contracts. The [full knowledge index](hexasync://index) is the navigation entry.\n"},{uri:"hexasync://docs/connections/CONNECTIONS",name:"docs/connections/CONNECTIONS",title:"Connections and connectors",description:"Syntax. A profile declares connections as a list under connectors: (the legacy spelling connections: is still read):",mimeType:"text/markdown",text:`# Connections and connectors
41863
41863
 
41864
41864
  > Addressable through the MCP as **\`hexasync://docs/connections/CONNECTIONS\`**.
41865
41865