@forsakringskassan/docs-generator 3.0.2 → 3.0.4

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.
@@ -44,12 +44,13 @@ var Gt$8=(n,t,e)=>{let s=n instanceof RegExp?ce$9(n,e):n,i=t instanceof RegExp?c
44
44
  globstar while`,t,d,e,f,m),this.matchOne(t.slice(d),e.slice(f),s))return this.debug("globstar found match!",d,a,m),true;if(m==="."||m===".."||!i.dot&&m.charAt(0)==="."){this.debug("dot detected!",t,d,e,f);break}this.debug("globstar swallow a segment, and continue"),d++;}return !!(s&&(this.debug(`
45
45
  >>> no match, partial?`,t,d,e,f),d===a))}let p;if(typeof u=="string"?(p=c===u,this.debug("string match",u,c,p)):(p=u.test(c),this.debug("pattern match",u,c,p)),!p)return false}if(o===a&&h===l)return true;if(o===a)return s;if(h===l)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return ke$b(this.pattern,this.options)}parse(t){at$a(t);let e=this.options;if(t==="**")return A$7;if(t==="")return "";let s,i=null;(s=t.match(js$8))?i=e.dot?zs$7:Is$6:(s=t.match(Rs$8))?i=(e.nocase?e.dot?Ms$7:Ds$6:e.dot?Fs$8:Os$5)(s[1]):(s=t.match(Bs$9))?i=(e.nocase?e.dot?$s$8:Us$8:e.dot?Gs$7:Hs$8)(s):(s=t.match(Ns$5))?i=e.dot?Ls$6:_s$5:(s=t.match(Ws$7))&&(i=Ps$8);let r=Q$8.fromGlob(t,this.options).toMMPattern();return i&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;let t=this.set;if(!t.length)return this.regexp=false,this.regexp;let e=this.options,s=e.noglobstar?Vs$6:e.dot?Ys$8:Xs$7,i=new Set(e.nocase?["i"]:[]),r=t.map(a=>{let l=a.map(c=>{if(c instanceof RegExp)for(let d of c.flags.split(""))i.add(d);return typeof c=="string"?ei$9(c):c===A$7?A$7:c._src});l.forEach((c,d)=>{let f=l[d+1],m=l[d-1];c!==A$7||m===A$7||(m===void 0?f!==void 0&&f!==A$7?l[d+1]="(?:\\/|"+s+"\\/)?"+f:l[d]=s:f===void 0?l[d-1]=m+"(?:\\/|\\/"+s+")?":f!==A$7&&(l[d-1]=m+"(?:\\/|\\/"+s+"\\/)"+f,l[d+1]=A$7));});let u=l.filter(c=>c!==A$7);if(this.partial&&u.length>=1){let c=[];for(let d=1;d<=u.length;d++)c.push(u.slice(0,d).join("/"));return "(?:"+c.join("|")+")"}return u.join("/")}).join("|"),[o,h]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+h+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+h+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""));}catch{this.regexp=false;}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return false;if(this.empty)return t==="";if(t==="/"&&e)return true;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let r=this.set;this.debug(this.pattern,"set",r);let o=i[i.length-1];if(!o)for(let h=i.length-2;!o&&h>=0;h--)o=i[h];for(let h=0;h<r.length;h++){let a=r[h],l=i;if(s.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,e))return s.flipNegate?true:!this.negate}return s.flipNegate?false:this.negate}static defaults(t){return O$5.defaults(t).Minimatch}};O$5.AST=Q$8;O$5.Minimatch=D$4;O$5.escape=tt$a;O$5.unescape=W$9;var si$9=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Oe$a=new Set,Vt$9=typeof process=="object"&&process?process:{},Fe$9=(n,t,e,s)=>{typeof Vt$9.emitWarning=="function"?Vt$9.emitWarning(n,t,e,s):console.error(`[${e}] ${t}: ${n}`);},At$b=globalThis.AbortController,Re$a=globalThis.AbortSignal;if(typeof At$b>"u"){Re$a=class{onabort;_onabort=[];reason;aborted=false;addEventListener(e,s){this._onabort.push(s);}},At$b=class{constructor(){t();}signal=new Re$a;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=true;for(let s of this.signal._onabort)s(e);this.signal.onabort?.(e);}}};let n=Vt$9.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{n&&(n=false,Fe$9("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t));};}var ii$9=n=>!Oe$a.has(n);var q$9=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),De$a=n=>q$9(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Tt$a:null:null,Tt$a=class Tt extends Array{constructor(n){super(n),this.fill(0);}},ri$9=class ct{heap;length;static#t=false;static create(t){let e=De$a(t);if(!e)return [];ct.#t=true;let s=new ct(t,e);return ct.#t=false,s}constructor(t,e){if(!ct.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0;}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},ft$9=class Me{#t;#s;#n;#r;#o;#S;#w;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#h;#u;#f;#a;#i;#d;#E;#b;#p;#R;#m;#C;#T;#g;#y;#x;#A;#e;#_;static unsafeExposeInternals(t){return {starts:t.#T,ttls:t.#g,autopurgeTimers:t.#y,sizes:t.#C,keyMap:t.#f,keyList:t.#a,valList:t.#i,next:t.#d,prev:t.#E,get head(){return t.#b},get tail(){return t.#p},free:t.#R,isBackgroundFetch:e=>t.#l(e),backgroundFetch:(e,s,i,r)=>t.#U(e,s,i,r),moveToTail:e=>t.#W(e),indexes:e=>t.#F(e),rindexes:e=>t.#D(e),isStale:e=>t.#v(e)}}get max(){return this.#t}get maxSize(){return this.#s}get calculatedSize(){return this.#u}get size(){return this.#h}get fetchMethod(){return this.#S}get memoMethod(){return this.#w}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#o}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:u,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:p=0,sizeCalculation:w,fetchMethod:g,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:z,ignoreFetchAbort:$,perf:J}=t;if(J!==void 0&&typeof J?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=J??si$9,e!==0&&!q$9(e))throw new TypeError("max option must be a nonnegative integer");let Z=e?De$a(e):Array;if(!Z)throw new Error("invalid max value: "+e);if(this.#t=e,this.#s=m,this.maxEntrySize=p||this.#s,this.sizeCalculation=w,this.sizeCalculation){if(!this.#s&&!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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=S,g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#S=g,this.#A=!!g,this.#f=new Map,this.#a=new Array(e).fill(void 0),this.#i=new Array(e).fill(void 0),this.#d=new Z(e),this.#E=new Z(e),this.#b=0,this.#p=0,this.#R=ri$9.create(e),this.#h=0,this.#u=0,typeof l=="function"&&(this.#n=l),typeof u=="function"&&(this.#r=u),typeof c=="function"?(this.#o=c,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#x=!!this.#n,this.#_=!!this.#r,this.#e=!!this.#o,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!$,this.maxEntrySize!==0){if(this.#s!==0&&!q$9(this.#s))throw new TypeError("maxSize must be a positive integer if specified");if(!q$9(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G();}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=q$9(i)||i===0?i:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!q$9(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M();}if(this.#t===0&&this.ttl===0&&this.#s===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#s){let $t="LRU_CACHE_UNBOUNDED";ii$9($t)&&(Oe$a.add($t),Fe$9("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",$t,Me));}}getRemainingTTL(t){return this.#f.has(t)?1/0:0}#M(){let t=new Tt$a(this.#t),e=new Tt$a(this.#t);this.#g=t,this.#T=e;let s=this.ttlAutopurge?new Array(this.#t):void 0;this.#y=s,this.#j=(o,h,a=this.#c.now())=>{if(e[o]=h!==0?a:0,t[o]=h,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),h!==0&&s){let l=setTimeout(()=>{this.#v(o)&&this.#O(this.#a[o],"expire");},h+1);l.unref&&l.unref(),s[o]=l;}},this.#k=o=>{e[o]=t[o]!==0?this.#c.now():0;},this.#N=(o,h)=>{if(t[h]){let a=t[h],l=e[h];if(!a||!l)return;o.ttl=a,o.start=l,o.now=i||r();let u=o.now-l;o.remainingTTL=a-u;}};let i=0,r=()=>{let o=this.#c.now();if(this.ttlResolution>0){i=o;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref();}return o};this.getRemainingTTL=o=>{let h=this.#f.get(o);if(h===void 0)return 0;let a=t[h],l=e[h];if(!a||!l)return 1/0;let u=(i||r())-l;return a-u},this.#v=o=>{let h=e[o],a=t[o];return !!a&&!!h&&(i||r())-h>a};}#k=()=>{};#N=()=>{};#j=()=>{};#v=()=>false;#G(){let t=new Tt$a(this.#t);this.#u=0,this.#C=t,this.#P=e=>{this.#u-=t[e],t[e]=0;},this.#I=(e,s,i,r)=>{if(this.#l(s))return 0;if(!q$9(i))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(i=r(s,e),!q$9(i))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 i},this.#L=(e,s,i)=>{if(t[e]=s,this.#s){let r=this.#s-t[e];for(;this.#u>r;)this.#B(true);}this.#u+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#u);};}#P=t=>{};#L=(t,e,s)=>{};#I=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#F({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#p;!(!this.#z(e)||((t||!this.#v(e))&&(yield e),e===this.#b));)e=this.#E[e];}*#D({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#b;!(!this.#z(e)||((t||!this.#v(e))&&(yield e),e===this.#p));)e=this.#d[e];}#z(t){return t!==void 0&&this.#f.get(this.#a[t])===t}*entries(){for(let t of this.#F())this.#i[t]!==void 0&&this.#a[t]!==void 0&&!this.#l(this.#i[t])&&(yield [this.#a[t],this.#i[t]]);}*rentries(){for(let t of this.#D())this.#i[t]!==void 0&&this.#a[t]!==void 0&&!this.#l(this.#i[t])&&(yield [this.#a[t],this.#i[t]]);}*keys(){for(let t of this.#F()){let e=this.#a[t];e!==void 0&&!this.#l(this.#i[t])&&(yield e);}}*rkeys(){for(let t of this.#D()){let e=this.#a[t];e!==void 0&&!this.#l(this.#i[t])&&(yield e);}}*values(){for(let t of this.#F())this.#i[t]!==void 0&&!this.#l(this.#i[t])&&(yield this.#i[t]);}*rvalues(){for(let t of this.#D())this.#i[t]!==void 0&&!this.#l(this.#i[t])&&(yield this.#i[t]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#F()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;if(r!==void 0&&t(r,this.#a[s],this))return this.get(this.#a[s],e)}}forEach(t,e=this){for(let s of this.#F()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&t.call(e,r,this.#a[s],this);}}rforEach(t,e=this){for(let s of this.#D()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&t.call(e,r,this.#a[s],this);}}purgeStale(){let t=false;for(let e of this.#D({allowStale:true}))this.#v(e)&&(this.#O(this.#a[e],"expire"),t=true);return t}info(t){let e=this.#f.get(t);if(e===void 0)return;let s=this.#i[e],i=this.#l(s)?s.__staleWhileFetching:s;if(i===void 0)return;let r={value:i};if(this.#g&&this.#T){let o=this.#g[e],h=this.#T[e];if(o&&h){let a=o-(this.#c.now()-h);r.ttl=a,r.start=Date.now();}}return this.#C&&(r.size=this.#C[e]),r}dump(){let t=[];for(let e of this.#F({allowStale:true})){let s=this.#a[e],i=this.#i[e],r=this.#l(i)?i.__staleWhileFetching:i;if(r===void 0||s===void 0)continue;let o={value:r};if(this.#g&&this.#T){o.ttl=this.#g[e];let h=this.#c.now()-this.#T[e];o.start=Math.floor(Date.now()-h);}this.#C&&(o.size=this.#C[e]),t.unshift([s,o]);}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=this.#c.now()-i;}this.set(e,s.value,s);}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:i=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:a}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,u=this.#I(t,e,s.size||0,h);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=true),this.#O(t,"set"),this;let c=this.#h===0?void 0:this.#f.get(t);if(c===void 0)c=this.#h===0?this.#p:this.#R.length!==0?this.#R.pop():this.#h===this.#t?this.#B(false):this.#h,this.#a[c]=t,this.#i[c]=e,this.#f.set(t,c),this.#d[this.#p]=c,this.#E[c]=this.#p,this.#p=c,this.#h++,this.#L(c,u,a),a&&(a.set="add"),l=false,this.#_&&this.#r?.(e,t,"add");else {this.#W(c);let d=this.#i[c];if(e!==d){if(this.#A&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=d;f!==void 0&&!o&&(this.#x&&this.#n?.(f,t,"set"),this.#e&&this.#m?.push([f,t,"set"]));}else o||(this.#x&&this.#n?.(d,t,"set"),this.#e&&this.#m?.push([d,t,"set"]));if(this.#P(c),this.#L(c,u,a),this.#i[c]=e,a){a.set="replace";let f=d&&this.#l(d)?d.__staleWhileFetching:d;f!==void 0&&(a.oldValue=f);}}else a&&(a.set="update");this.#_&&this.onInsert?.(e,t,e===d?"update":"replace");}if(i!==0&&!this.#g&&this.#M(),this.#g&&(l||this.#j(c,i,r),a&&this.#N(a,c)),!o&&this.#e&&this.#m){let d=this.#m,f;for(;f=d?.shift();)this.#o?.(...f);}return this}pop(){try{for(;this.#h;){let t=this.#i[this.#b];if(this.#B(!0),this.#l(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#e&&this.#m){let t=this.#m,e;for(;e=t?.shift();)this.#o?.(...e);}}}#B(t){let e=this.#b,s=this.#a[e],i=this.#i[e];return this.#A&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#x||this.#e)&&(this.#x&&this.#n?.(i,s,"evict"),this.#e&&this.#m?.push([i,s,"evict"])),this.#P(e),this.#y?.[e]&&(clearTimeout(this.#y[e]),this.#y[e]=void 0),t&&(this.#a[e]=void 0,this.#i[e]=void 0,this.#R.push(e)),this.#h===1?(this.#b=this.#p=0,this.#R.length=0):this.#b=this.#d[e],this.#f.delete(s),this.#h--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,r=this.#f.get(t);if(r!==void 0){let o=this.#i[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return false;if(this.#v(r))i&&(i.has="stale",this.#N(i,r));else return s&&this.#k(r),i&&(i.has="hit",this.#N(i,r)),true}else i&&(i.has="miss");return false}peek(t,e={}){let{allowStale:s=this.allowStale}=e,i=this.#f.get(t);if(i===void 0||!s&&this.#v(i))return;let r=this.#i[i];return this.#l(r)?r.__staleWhileFetching:r}#U(t,e,s,i){let r=e===void 0?void 0:this.#i[e];if(this.#l(r))return r;let o=new At$b,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:i},l=(p,w=false)=>{let{aborted:g}=o.signal,S=s.ignoreFetchAbort&&p!==void 0,E=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&p!==void 0);if(s.status&&(g&&!w?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,S&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),g&&!S&&!w)return c(o.signal.reason,E);let y=f,b=this.#i[e];return (b===f||S&&w&&b===void 0)&&(p===void 0?y.__staleWhileFetching!==void 0?this.#i[e]=y.__staleWhileFetching:this.#O(t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,p,a.options))),p},u=p=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=p),c(p,false)),c=(p,w)=>{let{aborted:g}=o.signal,S=g&&s.allowStaleOnFetchAbort,E=S||s.allowStaleOnFetchRejection,y=E||s.noDeleteOnFetchRejection,b=f;if(this.#i[e]===f&&(!y||!w&&b.__staleWhileFetching===void 0?this.#O(t,"fetch"):S||(this.#i[e]=b.__staleWhileFetching)),E)return s.status&&b.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),b.__staleWhileFetching;if(b.__returned===b)throw p},d=(p,w)=>{let g=this.#S?.(t,r,a);g&&g instanceof Promise&&g.then(S=>p(S===void 0?void 0:S),w),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=S=>l(S,true)));});};s.status&&(s.status.fetchDispatched=true);let f=new Promise(d).then(l,u),m=Object.assign(f,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,m,{...a.options,status:void 0}),e=this.#f.get(t)):this.#i[e]=m,m}#l(t){if(!this.#A)return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof At$b}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:p,forceRefresh:w=false,status:g,signal:S}=e;if(!this.#A)return g&&(g.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:g});let E={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:g,signal:S},y=this.#f.get(t);if(y===void 0){g&&(g.fetch="miss");let b=this.#U(t,y,E,p);return b.__returned=b}else {let b=this.#i[y];if(this.#l(b)){let Z=s&&b.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",Z&&(g.returnedStale=true)),Z?b.__staleWhileFetching:b.__returned=b}let z=this.#v(y);if(!w&&!z)return g&&(g.fetch="hit"),this.#W(y),i&&this.#k(y),g&&this.#N(g,y),b;let $=this.#U(t,y,E,p),J=$.__staleWhileFetching!==void 0&&s;return g&&(g.fetch=z?"stale":"refresh",J&&z&&(g.returnedStale=true)),J?$.__staleWhileFetching:$.__returned=$}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let s=this.#w;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:r,...o}=e,h=this.get(t,o);if(!r&&h!==void 0)return h;let a=s(t,h,{options:o,context:i});return this.set(t,a,o),a}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=e,h=this.#f.get(t);if(h!==void 0){let a=this.#i[h],l=this.#l(a);return o&&this.#N(o,h),this.#v(h)?(o&&(o.get="stale"),l?(o&&s&&a.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?a.__staleWhileFetching:void 0):(r||this.#O(t,"expire"),o&&s&&(o.returnedStale=true),s?a:void 0)):(o&&(o.get="hit"),l?a.__staleWhileFetching:(this.#W(h),i&&this.#k(h),a))}else o&&(o.get="miss");}#$(t,e){this.#E[e]=t,this.#d[t]=e;}#W(t){t!==this.#p&&(t===this.#b?this.#b=this.#d[t]:this.#$(this.#E[t],this.#d[t]),this.#$(this.#p,t),this.#p=t);}delete(t){return this.#O(t,"delete")}#O(t,e){let s=false;if(this.#h!==0){let i=this.#f.get(t);if(i!==void 0)if(this.#y?.[i]&&(clearTimeout(this.#y?.[i]),this.#y[i]=void 0),s=true,this.#h===1)this.#H(e);else {this.#P(i);let r=this.#i[i];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#x||this.#e)&&(this.#x&&this.#n?.(r,t,e),this.#e&&this.#m?.push([r,t,e])),this.#f.delete(t),this.#a[i]=void 0,this.#i[i]=void 0,i===this.#p)this.#p=this.#E[i];else if(i===this.#b)this.#b=this.#d[i];else {let o=this.#E[i];this.#d[o]=this.#d[i];let h=this.#d[i];this.#E[h]=this.#E[i];}this.#h--,this.#R.push(i);}}if(this.#e&&this.#m?.length){let i=this.#m,r;for(;r=i?.shift();)this.#o?.(...r);}return s}clear(){return this.#H("delete")}#H(t){for(let e of this.#D({allowStale:true})){let s=this.#i[e];if(this.#l(s))s.__abortController.abort(new Error("deleted"));else {let i=this.#a[e];this.#x&&this.#n?.(s,i,t),this.#e&&this.#m?.push([s,i,t]);}}if(this.#f.clear(),this.#i.fill(void 0),this.#a.fill(void 0),this.#g&&this.#T){this.#g.fill(0),this.#T.fill(0);for(let e of this.#y??[])e!==void 0&&clearTimeout(e);this.#y?.fill(void 0);}if(this.#C&&this.#C.fill(0),this.#b=0,this.#p=0,this.#R.length=0,this.#u=0,this.#h=0,this.#e&&this.#m){let e=this.#m,s;for(;s=e?.shift();)this.#o?.(...s);}}};var Ne$9=typeof process=="object"&&process?process:{stdout:null,stderr:null},oi$9=n=>!!n&&typeof n=="object"&&(n instanceof V$b||n instanceof Pe$9||hi$9(n)||ai$9(n)),hi$9=n=>!!n&&typeof n=="object"&&n instanceof EventEmitter$1&&typeof n.pipe=="function"&&n.pipe!==Pe$9.Writable.prototype.pipe,ai$9=n=>!!n&&typeof n=="object"&&n instanceof EventEmitter$1&&typeof n.write=="function"&&typeof n.end=="function",G$9=Symbol("EOF"),H$9=Symbol("maybeEmitEnd"),K$a=Symbol("emittedEnd"),kt$a=Symbol("emittingEnd"),ut$9=Symbol("emittedError"),Rt$a=Symbol("closed"),_e$a=Symbol("read"),Ot$b=Symbol("flush"),Le$a=Symbol("flushChunk"),P$8=Symbol("encoding"),et$9=Symbol("decoder"),v$7=Symbol("flowing"),dt$8=Symbol("paused"),st$7=Symbol("resume"),C$6=Symbol("buffer"),F$9=Symbol("pipes"),T$4=Symbol("bufferLength"),Yt$8=Symbol("bufferPush"),Ft$a=Symbol("bufferShift"),k$6=Symbol("objectMode"),x$6=Symbol("destroyed"),Xt$a=Symbol("error"),Jt$9=Symbol("emitData"),We$a=Symbol("emitEnd"),Zt$a=Symbol("emitEnd2"),B$7=Symbol("async"),Qt$9=Symbol("abort"),Dt$9=Symbol("aborted"),pt$8=Symbol("signal"),Y$6=Symbol("dataListeners"),M$9=Symbol("discarded"),mt$9=n=>Promise.resolve().then(n),li$9=n=>n(),ci$8=n=>n==="end"||n==="finish"||n==="prefinish",fi$9=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,ui$9=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Mt$b=class Mt{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[st$7](),this.dest.on("drain",this.ondrain);}unpipe(){this.dest.removeListener("drain",this.ondrain);}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end();}},te$b=class te extends Mt$b{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe();}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>this.dest.emit("error",i),t.on("error",this.proxyErrors);}},di$9=n=>!!n.objectMode,pi$9=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",V$b=class V extends EventEmitter$1{[v$7]=false;[dt$8]=false;[F$9]=[];[C$6]=[];[k$6];[P$8];[B$7];[et$9];[G$9]=false;[K$a]=false;[kt$a]=false;[Rt$a]=false;[ut$9]=null;[T$4]=0;[x$6]=false;[pt$8];[Dt$9]=false;[Y$6]=0;[M$9]=false;writable=true;readable=true;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");di$9(e)?(this[k$6]=true,this[P$8]=null):pi$9(e)?(this[P$8]=e.encoding,this[k$6]=false):(this[k$6]=false,this[P$8]=null),this[B$7]=!!e.async,this[et$9]=this[P$8]?new StringDecoder(this[P$8]):null,e&&e.debugExposeBuffer===true&&Object.defineProperty(this,"buffer",{get:()=>this[C$6]}),e&&e.debugExposePipes===true&&Object.defineProperty(this,"pipes",{get:()=>this[F$9]});let{signal:s}=e;s&&(this[pt$8]=s,s.aborted?this[Qt$9]():s.addEventListener("abort",()=>this[Qt$9]()));}get bufferLength(){return this[T$4]}get encoding(){return this[P$8]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[k$6]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[B$7]}set async(t){this[B$7]=this[B$7]||!!t;}[Qt$9](){this[Dt$9]=true,this.emit("abort",this[pt$8]?.reason),this.destroy(this[pt$8]?.reason);}get aborted(){return this[Dt$9]}set aborted(t){}write(t,e,s){if(this[Dt$9])return false;if(this[G$9])throw new Error("write after end");if(this[x$6])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),true;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[B$7]?mt$9:li$9;if(!this[k$6]&&!Buffer.isBuffer(t)){if(ui$9(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(fi$9(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[k$6]?(this[v$7]&&this[T$4]!==0&&this[Ot$b](true),this[v$7]?this.emit("data",t):this[Yt$8](t),this[T$4]!==0&&this.emit("readable"),s&&i(s),this[v$7]):t.length?(typeof t=="string"&&!(e===this[P$8]&&!this[et$9]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[P$8]&&(t=this[et$9].write(t)),this[v$7]&&this[T$4]!==0&&this[Ot$b](true),this[v$7]?this.emit("data",t):this[Yt$8](t),this[T$4]!==0&&this.emit("readable"),s&&i(s),this[v$7]):(this[T$4]!==0&&this.emit("readable"),s&&i(s),this[v$7])}read(t){if(this[x$6])return null;if(this[M$9]=false,this[T$4]===0||t===0||t&&t>this[T$4])return this[H$9](),null;this[k$6]&&(t=null),this[C$6].length>1&&!this[k$6]&&(this[C$6]=[this[P$8]?this[C$6].join(""):Buffer.concat(this[C$6],this[T$4])]);let e=this[_e$a](t||null,this[C$6][0]);return this[H$9](),e}[_e$a](t,e){if(this[k$6])this[Ft$a]();else {let s=e;t===s.length||t===null?this[Ft$a]():typeof s=="string"?(this[C$6][0]=s.slice(t),e=s.slice(0,t),this[T$4]-=t):(this[C$6][0]=s.subarray(t),e=s.subarray(0,t),this[T$4]-=t);}return this.emit("data",e),!this[C$6].length&&!this[G$9]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[G$9]=true,this.writable=false,(this[v$7]||!this[dt$8])&&this[H$9](),this}[st$7](){this[x$6]||(!this[Y$6]&&!this[F$9].length&&(this[M$9]=true),this[dt$8]=false,this[v$7]=true,this.emit("resume"),this[C$6].length?this[Ot$b]():this[G$9]?this[H$9]():this.emit("drain"));}resume(){return this[st$7]()}pause(){this[v$7]=false,this[dt$8]=true,this[M$9]=false;}get destroyed(){return this[x$6]}get flowing(){return this[v$7]}get paused(){return this[dt$8]}[Yt$8](t){this[k$6]?this[T$4]+=1:this[T$4]+=t.length,this[C$6].push(t);}[Ft$a](){return this[k$6]?this[T$4]-=1:this[T$4]-=this[C$6][0].length,this[C$6].shift()}[Ot$b](t=false){do;while(this[Le$a](this[Ft$a]())&&this[C$6].length);!t&&!this[C$6].length&&!this[G$9]&&this.emit("drain");}[Le$a](t){return this.emit("data",t),this[v$7]}pipe(t,e){if(this[x$6])return t;this[M$9]=false;let s=this[K$a];return e=e||{},t===Ne$9.stdout||t===Ne$9.stderr?e.end=false:e.end=e.end!==false,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[F$9].push(e.proxyErrors?new te$b(this,t,e):new Mt$b(this,t,e)),this[B$7]?mt$9(()=>this[st$7]()):this[st$7]()),t}unpipe(t){let e=this[F$9].find(s=>s.dest===t);e&&(this[F$9].length===1?(this[v$7]&&this[Y$6]===0&&(this[v$7]=false),this[F$9]=[]):this[F$9].splice(this[F$9].indexOf(e),1),e.unpipe());}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[M$9]=false,this[Y$6]++,!this[F$9].length&&!this[v$7]&&this[st$7]();else if(t==="readable"&&this[T$4]!==0)super.emit("readable");else if(ci$8(t)&&this[K$a])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[ut$9]){let i=e;this[B$7]?mt$9(()=>i.call(this,this[ut$9])):i.call(this,this[ut$9]);}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[Y$6]=this.listeners("data").length,this[Y$6]===0&&!this[M$9]&&!this[F$9].length&&(this[v$7]=false)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return (t==="data"||t===void 0)&&(this[Y$6]=0,!this[M$9]&&!this[F$9].length&&(this[v$7]=false)),e}get emittedEnd(){return this[K$a]}[H$9](){!this[kt$a]&&!this[K$a]&&!this[x$6]&&this[C$6].length===0&&this[G$9]&&(this[kt$a]=true,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Rt$a]&&this.emit("close"),this[kt$a]=false);}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==x$6&&this[x$6])return false;if(t==="data")return !this[k$6]&&!s?false:this[B$7]?(mt$9(()=>this[Jt$9](s)),true):this[Jt$9](s);if(t==="end")return this[We$a]();if(t==="close"){if(this[Rt$a]=true,!this[K$a]&&!this[x$6])return false;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(t==="error"){this[ut$9]=s,super.emit(Xt$a,s);let r=!this[pt$8]||this.listeners("error").length?super.emit("error",s):false;return this[H$9](),r}else if(t==="resume"){let r=super.emit("resume");return this[H$9](),r}else if(t==="finish"||t==="prefinish"){let r=super.emit(t);return this.removeAllListeners(t),r}let i=super.emit(t,...e);return this[H$9](),i}[Jt$9](t){for(let s of this[F$9])s.dest.write(t)===false&&this.pause();let e=this[M$9]?false:super.emit("data",t);return this[H$9](),e}[We$a](){return this[K$a]?false:(this[K$a]=true,this.readable=false,this[B$7]?(mt$9(()=>this[Zt$a]()),true):this[Zt$a]())}[Zt$a](){if(this[et$9]){let e=this[et$9].end();if(e){for(let s of this[F$9])s.dest.write(e);this[M$9]||super.emit("data",e);}}for(let e of this[F$9])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[k$6]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[k$6]||(t.dataLength+=s.length);}),await e,t}async concat(){if(this[k$6])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[P$8]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(x$6,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t());})}[Symbol.asyncIterator](){this[M$9]=false;let t=false,e=async()=>(this.pause(),t=true,{value:void 0,done:true});return {next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:false,value:i});if(this[G$9])return e();let r,o,h=c=>{this.off("data",a),this.off("end",l),this.off(x$6,u),e(),o(c);},a=c=>{this.off("error",h),this.off("end",l),this.off(x$6,u),this.pause(),r({value:c,done:!!this[G$9]});},l=()=>{this.off("error",h),this.off("data",a),this.off(x$6,u),e(),r({done:true,value:void 0});},u=()=>h(new Error("stream destroyed"));return new Promise((c,d)=>{o=d,r=c,this.once(x$6,u),this.once("error",h),this.once("end",l),this.once("data",a);})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[M$9]=false;let t=false,e=()=>(this.pause(),this.off(Xt$a,e),this.off(x$6,e),this.off("end",e),t=true,{done:true,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:false,value:i}};return this.once("end",e),this.once(Xt$a,e),this.once(x$6,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[x$6])return t?this.emit("error",t):this.emit(x$6),this;this[x$6]=true,this[M$9]=true,this[C$6].length=0,this[T$4]=0;let e=this;return typeof e.close=="function"&&!this[Rt$a]&&e.close(),t?this.emit("error",t):this.emit(x$6),this}static get isStream(){return oi$9}};var vi$9=realpathSync.native,wt$a={lstatSync:lstatSync,readdir:readdir$1,readdirSync:readdirSync,readlinkSync:readlinkSync,realpathSync:vi$9,promises:{lstat:lstat,readdir:readdir,readlink:readlink,realpath:realpath}},Ue$a=n=>!n||n===wt$a||n===fs$8?wt$a:{...wt$a,...n,promises:{...wt$a.promises,...n.promises||{}}},$e$a=/^\\\\\?\\([a-z]:)\\?$/i,Ri$6=n=>n.replace(/\//g,"\\").replace($e$a,"$1\\"),Oi$8=/[\\\/]/,L$8=0,Ge$b=1,He$a=2,U$8=4,qe$9=6,Ke$b=8,X$a=10,Ve$9=12,_$8=15,gt$9=~_$8,se$b=16,je$a=32,yt$9=64,j$8=128,Nt$b=256,Lt$9=512,Ie$a=yt$9|j$8|Lt$9,Fi$7=1023,ie$a=n=>n.isFile()?Ke$b:n.isDirectory()?U$8:n.isSymbolicLink()?X$a:n.isCharacterDevice()?He$a:n.isBlockDevice()?qe$9:n.isSocket()?Ve$9:n.isFIFO()?Ge$b:L$8,ze$a=new ft$9({max:2**12}),bt$c=n=>{let t=ze$a.get(n);if(t)return t;let e=n.normalize("NFKD");return ze$a.set(n,e),e},Be$8=new ft$9({max:2**12}),_t$9=n=>{let t=Be$8.get(n);if(t)return t;let e=bt$c(n.toLowerCase());return Be$8.set(n,e),e},Wt$9=class Wt extends ft$9{constructor(){super({max:256});}},ne$8=class ne extends ft$9{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1});}},Ye$9=Symbol("PathScurry setAsCwd"),R$9=class R{name;root;roots;parent;nocase;isCWD=false;#t;#s;get dev(){return this.#s}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#S;get gid(){return this.#S}#w;get rdev(){return this.#w}#c;get blksize(){return this.#c}#h;get ino(){return this.#h}#u;get size(){return this.#u}#f;get blocks(){return this.#f}#a;get atimeMs(){return this.#a}#i;get mtimeMs(){return this.#i}#d;get ctimeMs(){return this.#d}#E;get birthtimeMs(){return this.#E}#b;get atime(){return this.#b}#p;get mtime(){return this.#p}#R;get ctime(){return this.#R}#m;get birthtime(){return this.#m}#C;#T;#g;#y;#x;#A;#e;#_;#M;#k;get parentPath(){return (this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=L$8,s,i,r,o,h){this.name=t,this.#C=r?_t$9(t):bt$c(t),this.#e=e&Fi$7,this.nocase=r,this.roots=i,this.root=s||this,this.#_=o,this.#g=h.fullpath,this.#x=h.relative,this.#A=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=Ue$a(h.fs);}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#_}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#N(i):this.#N(i)}#N(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#_.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#_.set(this,e),this.#e&=~se$b,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?_t$9(t):bt$c(t);for(let a of s)if(a.#C===i)return a;let r=this.parent?this.sep:"",o=this.#g?this.#g+r+t:void 0,h=this.newChild(t,L$8,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#e|=j$8),s.push(h),h}relative(){if(this.isCWD)return "";if(this.#x!==void 0)return this.#x;let t=this.name,e=this.parent;if(!e)return this.#x=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return "";if(this.#A!==void 0)return this.#A;let t=this.name,e=this.parent;if(!e)return this.#A=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#g!==void 0)return this.#g;let t=this.name,e=this.parent;if(!e)return this.#g=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#g=i}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return /^[a-z]:\//i.test(i)?this.#y=`//?/${i}`:this.#y=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#y=s}isUnknown(){return (this.#e&_$8)===L$8}isType(t){return this[`is${t}`]()}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.#e&_$8)===Ke$b}isDirectory(){return (this.#e&_$8)===U$8}isCharacterDevice(){return (this.#e&_$8)===He$a}isBlockDevice(){return (this.#e&_$8)===qe$9}isFIFO(){return (this.#e&_$8)===Ge$b}isSocket(){return (this.#e&_$8)===Ve$9}isSymbolicLink(){return (this.#e&X$a)===X$a}lstatCached(){return this.#e&je$a?this:void 0}readlinkCached(){return this.#M}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#M)return true;if(!this.parent)return false;let t=this.#e&_$8;return !(t!==L$8&&t!==X$a||this.#e&Nt$b||this.#e&j$8)}calledReaddir(){return !!(this.#e&se$b)}isENOENT(){return !!(this.#e&j$8)}isNamed(t){return this.nocase?this.#C===_t$9(t):this.#C===bt$c(t)}async readlink(){let t=this.#M;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#M=s}catch(e){this.#D(e.code);return}}readlinkSync(){let t=this.#M;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#M=s}catch(e){this.#D(e.code);return}}#j(t){this.#e|=se$b;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#v();}}#v(){this.#e&j$8||(this.#e=(this.#e|j$8)&gt$9,this.#G());}#G(){let t=this.children();t.provisional=0;for(let e of t)e.#v();}#P(){this.#e|=Lt$9,this.#L();}#L(){if(this.#e&yt$9)return;let t=this.#e;(t&_$8)===U$8&&(t&=gt$9),this.#e=t|yt$9,this.#G();}#I(t=""){t==="ENOTDIR"||t==="EPERM"?this.#L():t==="ENOENT"?this.#v():this.children().provisional=0;}#F(t=""){t==="ENOTDIR"?this.parent.#L():t==="ENOENT"&&this.#v();}#D(t=""){let e=this.#e;e|=Nt$b,t==="ENOENT"&&(e|=j$8),(t==="EINVAL"||t==="UNKNOWN")&&(e&=gt$9),this.#e=e,t==="ENOTDIR"&&this.parent&&this.parent.#L();}#z(t,e){return this.#U(t,e)||this.#B(t,e)}#B(t,e){let s=ie$a(t),i=this.newChild(t.name,s,{parent:this}),r=i.#e&_$8;return r!==U$8&&r!==X$a&&r!==L$8&&(i.#e|=yt$9),e.unshift(i),e.provisional++,i}#U(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?_t$9(t.name):bt$c(t.name))===i.#C)return this.#l(t,i,s,e)}}#l(t,e,s,i){let r=e.name;return e.#e=e.#e&gt$9|ie$a(t),r!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#e&j$8)===0)try{return this.#$(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#F(t.code);}}lstatSync(){if((this.#e&j$8)===0)try{return this.#$(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#F(t.code);}}#$(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:r,blksize:o,blocks:h,ctime:a,ctimeMs:l,dev:u,gid:c,ino:d,mode:f,mtime:m,mtimeMs:p,nlink:w,rdev:g,size:S,uid:E}=t;this.#b=e,this.#a=s,this.#m=i,this.#E=r,this.#c=o,this.#f=h,this.#R=a,this.#d=l,this.#s=u,this.#S=c,this.#h=d,this.#n=f,this.#p=m,this.#i=p,this.#r=w,this.#w=g,this.#u=S,this.#o=E;let y=ie$a(t);this.#e=this.#e&gt$9|y|je$a,y!==L$8&&y!==U$8&&y!==X$a&&(this.#e|=yt$9);}#W=[];#O=false;#H(t){this.#O=false;let e=this.#W.slice();this.#W.length=0,e.forEach(s=>s(null,t));}readdirCB(t,e=false){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let r=s.slice(0,s.provisional);e?t(null,r):queueMicrotask(()=>t(null,r));return}if(this.#W.push(t),this.#O)return;this.#O=true;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:true},(r,o)=>{if(r)this.#I(r.code),s.provisional=0;else {for(let h of o)this.#z(h,s);this.#j(s);}this.#H(s.slice(0,s.provisional));});}#q;async readdir(){if(!this.canReaddir())return [];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#q)await this.#q;else {let s=()=>{};this.#q=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#z(i,t);this.#j(t);}catch(i){this.#I(i.code),t.provisional=0;}this.#q=void 0,s();}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return [];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#z(s,t);this.#j(t);}catch(s){this.#I(s.code),t.provisional=0;}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&Ie$a)return false;let t=_$8&this.#e;return t===L$8||t===U$8||t===X$a}shouldWalk(t,e){return (this.#e&U$8)===U$8&&!(this.#e&Ie$a)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((Lt$9|Nt$b|j$8)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#P();}}realpathSync(){if(this.#k)return this.#k;if(!((Lt$9|Nt$b|j$8)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#P();}}[Ye$9](t){if(t===this)return;t.isCWD=false,this.isCWD=true;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#x=s.join(this.sep),i.#A=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#x=void 0,i.#A=void 0,i=i.parent;}},Pt$b=class n extends R$9{sep="\\";splitSep=Oi$8;constructor(t,e=L$8,s,i,r,o,h){super(t,e,s,i,r,o,h);}newChild(t,e=L$8,s={}){return new n(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return win32.parse(t).root}getRoot(t){if(t=Ri$6(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new it$8(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace($e$a,"$1\\"),t===e}},jt$8=class n extends R$9{splitSep="/";sep="/";constructor(t,e=L$8,s,i,r,o,h){super(t,e,s,i,r,o,h);}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=L$8,s={}){return new n(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},It$a=class It{root;rootPath;roots;cwd;#t;#s;#n;nocase;#r;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:r=16*1024,fs:o=wt$a}={}){this.#r=Ue$a(o),(t instanceof URL||t.startsWith("file://"))&&(t=fileURLToPath(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new Wt$9,this.#s=new Wt$9,this.#n=new ne$8(r);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=a.length-1,c=e.sep,d=this.rootPath,f=false;for(let m of a){let p=u--;l=l.child(m,{relative:new Array(p).fill("..").join(c),relativePosix:new Array(p).fill("..").join("/"),fullpath:d+=(f?"":c)+m}),f=true;}this.cwd=l;}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e="";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#s.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#s.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:true}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(r=>r.name)}else return []}readdirSync(t=this.cwd,e={withFileTypes:true}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t,t=this.cwd);let{withFileTypes:s=true}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t,t=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:o}=e,h=[];(!r||r(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(c,d)=>{a.add(c),c.readdirCB((f,m)=>{if(f)return d(f);let p=m.length;if(!p)return d();let w=()=>{--p===0&&d();};for(let g of m)(!r||r(g))&&h.push(s?g:g.fullpath()),i&&g.isSymbolicLink()?g.realpath().then(S=>S?.isUnknown()?S.lstat():S).then(S=>S?.shouldWalk(a,o)?l(S,w):w()):g.shouldWalk(a,o)?l(g,w):w();},true);},u=t;return new Promise((c,d)=>{l(u,f=>{if(f)return d(f);c(h);});})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t,t=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:o}=e,h=[];(!r||r(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let u=l.readdirSync();for(let c of u){(!r||r(c))&&h.push(s?c:c.fullpath());let d=c;if(c.isSymbolicLink()){if(!(i&&(d=c.realpathSync())))continue;d.isUnknown()&&d.lstatSync();}d.shouldWalk(a,o)&&a.add(d);}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t,t=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:o}=e;(!r||r(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let u of l){(!r||r(u))&&(yield s?u:u.fullpath());let c=u;if(u.isSymbolicLink()){if(!(i&&(c=u.realpathSync())))continue;c.isUnknown()&&c.lstatSync();}c.shouldWalk(h,o)&&h.add(c);}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t,t=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:o}=e,h=new V$b({objectMode:true});(!r||r(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],u=0,c=()=>{let d=false;for(;!d;){let f=l.shift();if(!f){u===0&&h.end();return}u++,a.add(f);let m=(w,g,S=false)=>{if(w)return h.emit("error",w);if(i&&!S){let E=[];for(let y of g)y.isSymbolicLink()&&E.push(y.realpath().then(b=>b?.isUnknown()?b.lstat():b));if(E.length){Promise.all(E).then(()=>m(null,g,true));return}}for(let E of g)E&&(!r||r(E))&&(h.write(s?E:E.fullpath())||(d=true));u--;for(let E of g){let y=E.realpathCached()||E;y.shouldWalk(a,o)&&l.push(y);}d&&!h.flowing?h.once("drain",c):p||c();},p=true;f.readdirCB(m,true),p=false;}};return c(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R$9||(e=t,t=this.cwd);let{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:o}=e,h=new V$b({objectMode:true}),a=new Set;(!r||r(t))&&h.write(s?t:t.fullpath());let l=[t],u=0,c=()=>{let d=false;for(;!d;){let f=l.shift();if(!f){u===0&&h.end();return}u++,a.add(f);let m=f.readdirSync();for(let p of m)(!r||r(p))&&(h.write(s?p:p.fullpath())||(d=true));u--;for(let p of m){let w=p;if(p.isSymbolicLink()){if(!(i&&(w=p.realpathSync())))continue;w.isUnknown()&&w.lstatSync();}w.shouldWalk(a,o)&&l.push(w);}}d&&!h.flowing&&h.once("drain",c);};return c(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[Ye$9](e);}},it$8=class it extends It$a{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=true}=e;super(t,win32,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase;}parseRootPath(t){return win32.parse(t).root.toUpperCase()}newRoot(t){return new Pt$b(this.rootPath,U$8,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},rt$b=class rt extends It$a{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=false}=e;super(t,posix,"/",{...e,nocase:s}),this.nocase=s;}parseRootPath(t){return "/"}newRoot(t){return new jt$8(this.rootPath,U$8,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},St$b=class St extends rt$b{constructor(t=process.cwd(),e={}){let{nocase:s=true}=e;super(t,{...e,nocase:s});}};process.platform==="win32"?Pt$b:jt$8;var Xe$a=process.platform==="win32"?it$8:process.platform==="darwin"?St$b:rt$b;var Di$7=n=>n.length>=1,Mi$6=n=>n.length>=1,Ni$8=Symbol.for("nodejs.util.inspect.custom"),nt$a=class n{#t;#s;#n;length;#r;#o;#S;#w;#c;#h;#u=true;constructor(t,e,s,i){if(!Di$7(t))throw new TypeError("empty pattern list");if(!Mi$6(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#s=e,this.#n=s,this.#r=i,this.#n===0){if(this.isUNC()){let[r,o,h,a,...l]=this.#t,[u,c,d,f,...m]=this.#s;l[0]===""&&(l.shift(),m.shift());let p=[r,o,h,a,""].join("/"),w=[u,c,d,f,""].join("/");this.#t=[p,...l],this.#s=[w,...m],this.length=this.#t.length;}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#t,[h,...a]=this.#s;o[0]===""&&(o.shift(),a.shift());let l=r+"/",u=h+"/";this.#t=[l,...o],this.#s=[u,...a],this.length=this.#t.length;}}}[Ni$8](){return "Pattern <"+this.#s.slice(this.#n).join("/")+">"}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===A$7}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#S=this.#S||(this.#n===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join("/"):this.#s.join("/"):this.#s.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#t,this.#s,this.#n+1,this.#r),this.#o.#h=this.#h,this.#o.#c=this.#c,this.#o.#w=this.#w,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#w!==void 0?this.#w:this.#w=this.#r==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#n===0?t:""}checkFollowGlobstar(){return !(this.#n===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#u?false:(this.#u=false,true)}};var _i$8=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ot$6=class ot{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:r,platform:o=_i$8}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:true,nobrace:e,nocase:s,noext:i,noglobstar:r,optimizationLevel:2,platform:o,nocomment:true,nonegate:true};for(let h of t)this.add(h);}add(t){let e=new D$4(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],r=e.globParts[s];if(!i||!r)throw new Error("invalid pattern object");for(;i[0]==="."&&r[0]===".";)i.shift(),r.shift();let o=new nt$a(i,r,0,this.platform),h=new D$4(o.globString(),this.mmopts),a=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(h):this.relative.push(h),a&&(l?this.absoluteChildren.push(h):this.relativeChildren.push(h));}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||".",r=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(r))return true;for(let o of this.absolute)if(o.match(e)||o.match(s))return true;return false}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return true;for(let i of this.absoluteChildren)if(i.match(e))return true;return false}};var oe$9=class n{store;constructor(t=new Map){this.store=t;}copy(){return new n(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]));}},he$a=class he{store=new Map;add(t,e,s){let i=(e?2:0)|(s?1:0),r=this.store.get(t);this.store.set(t,r===void 0?i:i&r);}entries(){return [...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},ae$9=class ae{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e]);}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return [...this.store.keys()].filter(t=>t.canReaddir())}},Et$c=class n{hasWalkedCache;matches=new he$a;subwalks=new ae$9;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new oe$9;}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,r]of s){this.hasWalkedCache.storeWalked(i,r);let o=r.root(),h=r.isAbsolute()&&this.opts.absolute!==false;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let c=r.rest();if(c)r=c;else {this.matches.add(i,true,false);continue}}if(i.isENOENT())continue;let a,l,u=false;for(;typeof(a=r.pattern())=="string"&&(l=r.rest());)i=i.resolve(a),r=l,u=true;if(a=r.pattern(),l=r.rest(),u){if(this.hasWalkedCache.hasWalked(i,r))continue;this.hasWalkedCache.storeWalked(i,r);}if(typeof a=="string"){let c=a===".."||a===""||a===".";this.matches.add(i.resolve(a),h,c);continue}else if(a===A$7){(!i.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(i,r);let c=l?.pattern(),d=l?.rest();if(!l||(c===""||c===".")&&!d)this.matches.add(i,h,c===""||c===".");else if(c===".."){let f=i.parent||i;d?this.hasWalkedCache.hasWalked(f,d)||this.subwalks.add(f,d):this.matches.add(f,h,true);}}else a instanceof RegExp&&this.subwalks.add(i,r);}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let r of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===A$7?i.testGlobstar(r,o,l,h):a instanceof RegExp?i.testRegExp(r,a,l,h):i.testString(r,a,l,h);}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,false),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let r=s.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(t,r,s.rest(),i);else if(r===".."){let o=t.parent||t;this.subwalks.add(o,s);}else r instanceof RegExp&&this.testRegExp(t,r,s.rest(),i);}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,false));}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,false));}};var Li$7=(n,t)=>typeof n=="string"?new ot$6([n],t):Array.isArray(n)?new ot$6(n,t):n,zt$8=class zt{path;patterns;opts;seen=new Set;paused=false;aborted=false;#t=[];#s;#n;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==false,(s.ignore||!this.includeChildMatches)&&(this.#s=Li$7(s.ignore??[],s),!this.includeChildMatches&&typeof this.#s.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0;}));}#r(t){return this.seen.has(t)||!!this.#s?.ignored?.(t)}#o(t){return !!this.#s?.childrenIgnored?.(t)}pause(){this.paused=true;}resume(){if(this.signal?.aborted)return;this.paused=false;let t;for(;!this.paused&&(t=this.#t.shift());)t();}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t());}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s;}let r=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat();}return this.matchCheckTest(r,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#r(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s;}let r=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync();}return this.matchCheckTest(r,e)}matchFinish(t,e){if(this.#r(t))return;if(!this.includeChildMatches&&this.#s?.add){let r=`${t.relativePosix()}/**`;this.#s.add(r);}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let r=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(r+i);}else {let r=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(r?o+r+i:"."+i);}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e);}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e);}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new Et$c(this.opts),s);}walkCB2(t,e,s,i){if(this.#o(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let r=1,o=()=>{--r===0&&i();};for(let[h,a,l]of s.matches.entries())this.#r(h)||(r++,this.match(h,a,l).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;r++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,u)=>this.walkCB3(h,u,s,o),true);}o();}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let r=1,o=()=>{--r===0&&i();};for(let[h,a,l]of s.matches.entries())this.#r(h)||(r++,this.match(h,a,l).then(()=>o()));for(let[h,a]of s.subwalks.entries())r++,this.walkCB2(h,a,s.child(),o);o();}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new Et$c(this.opts),s);}walkCB2Sync(t,e,s,i){if(this.#o(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let r=1,o=()=>{--r===0&&i();};for(let[h,a,l]of s.matches.entries())this.#r(h)||this.matchSync(h,a,l);for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;r++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o);}o();}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let r=1,o=()=>{--r===0&&i();};for(let[h,a,l]of s.matches.entries())this.#r(h)||this.matchSync(h,a,l);for(let[h,a]of s.subwalks.entries())r++,this.walkCB2Sync(h,a,s.child(),o);o();}},xt$9=class xt extends zt$8{matches=new Set;constructor(t,e,s){super(t,e,s);}matchEmit(t){this.matches.add(t);}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(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}},vt$b=class vt extends zt$8{results;constructor(t,e,s){super(t,e,s),this.results=new V$b({signal:this.signal,objectMode:true}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume());}matchEmit(t){this.results.write(t),this.results.flowing||this.pause();}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end());}):this.walkCB(t,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}};var Pi$7=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",I$7=class I{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(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=fileURLToPath(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==false,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`);}if(this.pattern=t,this.platform=e.platform||Pi$7,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else {let a=e.platform==="win32"?it$8:e.platform==="darwin"?St$b:e.platform?rt$b:Xe$a;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs});}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(a=>new D$4(a,i)),[o,h]=r.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=o.map((a,l)=>{let u=h[l];if(!u)throw new Error("invalid pattern object");return new nt$a(a,u,0,this.platform)});}async walk(){return [...await new xt$9(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 xt$9(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 vt$b(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 vt$b(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()}};var le$9=(n,t={})=>{Array.isArray(n)||(n=[n]);for(let e of n)if(new D$4(e,t).hasMagic())return true;return false};function Bt$9(n,t={}){return new I$7(n,t).streamSync()}function Qe$9(n,t={}){return new I$7(n,t).stream()}function ts$6(n,t={}){return new I$7(n,t).walkSync()}async function Je$a(n,t={}){return new I$7(n,t).walk()}function Ut$a(n,t={}){return new I$7(n,t).iterateSync()}function es$7(n,t={}){return new I$7(n,t).iterate()}var ji$7=Bt$9,Ii$7=Object.assign(Qe$9,{sync:Bt$9}),zi$7=Ut$a,Bi$6=Object.assign(es$7,{sync:Ut$a}),Ui$7=Object.assign(ts$6,{stream:Bt$9,iterate:Ut$a}),Ze$a=Object.assign(Je$a,{glob:Je$a,globSync:ts$6,sync:Ui$7,globStream:Qe$9,stream:Ii$7,globStreamSync:Bt$9,streamSync:ji$7,globIterate:es$7,iterate:Bi$6,globIterateSync:Ut$a,iterateSync:zi$7,Glob:I$7,hasMagic:le$9,escape:tt$a,unescape:W$9});Ze$a.glob=Ze$a;
46
46
 
47
- const CWD = process.cwd();
48
- const importMetaUrl = import.meta.url;
49
- const cjsRequire = importMetaUrl
50
- ? createRequire(importMetaUrl)
51
- : require;
52
- const EXTENSIONS = ['.ts', '.tsx', ...Object.keys(cjsRequire.extensions)];
47
+ const cjsRequire = typeof require === 'function' ? require : createRequire(import.meta.url);
48
+ const DEFAULT_EXTENSIONS = cjsRequire.extensions
49
+ ?
50
+ Object.keys(cjsRequire.extensions)
51
+ :
52
+ ['.js', '.json', '.node'];
53
+ const EXTENSIONS = ['.ts', '.tsx', ...DEFAULT_EXTENSIONS];
53
54
 
54
55
  const tryPkg = (pkg) => {
55
56
  try {
@@ -57,39 +58,61 @@ const tryPkg = (pkg) => {
57
58
  }
58
59
  catch { }
59
60
  };
60
- const isPkgAvailable = (pkg) => !!tryPkg(pkg);
61
- const tryFile = (filename, includeDir = false, base = CWD) => {
61
+ const isPkgAvailable = (pkg) => Boolean(tryPkg(pkg));
62
+ const ANY_FILE_TYPES = new Set(['any', true]);
63
+ const isAnyFileType = (type) => ANY_FILE_TYPES.has(type);
64
+ const tryFileStats = (filename, type = 'file', base = process.cwd()) => {
65
+ if (!type) {
66
+ type = 'file';
67
+ }
62
68
  if (typeof filename === 'string') {
63
69
  const filepath = path__default.resolve(base, filename);
64
- return fs__default.existsSync(filepath) &&
65
- (includeDir || fs__default.statSync(filepath).isFile())
66
- ? filepath
67
- : '';
70
+ let stats;
71
+ try {
72
+ stats = fs__default.statSync(filepath, { throwIfNoEntry: false });
73
+ }
74
+ catch { }
75
+ return stats &&
76
+ (isAnyFileType(type) ||
77
+ (Array.isArray(type) ? type : [type]).some(type => stats[`is${type[0].toUpperCase()}${type.slice(1)}`]()))
78
+ ? { filepath, stats }
79
+ : undefined;
68
80
  }
69
81
  for (const file of filename ?? []) {
70
- const filepath = tryFile(file, includeDir, base);
71
- if (filepath) {
72
- return filepath;
82
+ const result = tryFileStats(file, type, base);
83
+ if (result) {
84
+ return result;
73
85
  }
74
86
  }
75
- return '';
76
87
  };
88
+ const tryFile = (filename, type = 'file', base) => tryFileStats(filename, type, base)?.filepath ?? '';
77
89
  const tryExtensions = (filepath, extensions = EXTENSIONS) => {
78
90
  const ext = [...extensions, ''].find(ext => tryFile(filepath + ext));
79
91
  return ext == null ? '' : filepath + ext;
80
92
  };
81
- const findUp = (searchEntry, searchFileOrIncludeDir, includeDir) => {
82
- const isSearchFile = "undefined" === 'string';
83
- const searchFile = 'package.json';
84
- let lastSearchEntry;
93
+ const findUp = (entryOrOptions, options) => {
94
+ if (typeof entryOrOptions === 'string') {
95
+ options = {
96
+ entry: entryOrOptions,
97
+ ...options,
98
+ };
99
+ }
100
+ else if (entryOrOptions) {
101
+ options = options ? { ...entryOrOptions, ...options } : entryOrOptions;
102
+ }
103
+ let { entry = process.cwd(), search = 'package.json', type, stop, } = options ?? {};
104
+ search = Array.isArray(search) ? search : [search];
85
105
  do {
86
- const searched = tryFile(searchFile, isSearchFile, searchEntry);
106
+ const searched = tryFile(search, type, entry);
87
107
  if (searched) {
88
108
  return searched;
89
109
  }
90
- lastSearchEntry = searchEntry;
91
- searchEntry = path__default.dirname(searchEntry);
92
- } while (!lastSearchEntry || lastSearchEntry !== searchEntry);
110
+ const lastEntry = entry;
111
+ entry = path__default.dirname(entry);
112
+ if (entry === lastEntry) {
113
+ break;
114
+ }
115
+ } while (!stop || entry !== stop);
93
116
  return '';
94
117
  };
95
118
 
@@ -1723,6 +1746,15 @@ getDecoder(xmlDecodeTree);
1723
1746
  function decodeHTML(str, mode = DecodingMode.Legacy) {
1724
1747
  return htmlDecoder(str, mode);
1725
1748
  }
1749
+ /**
1750
+ * Decodes an HTML string, requiring all entities to be terminated by a semicolon.
1751
+ *
1752
+ * @param str The string to decode.
1753
+ * @returns The decoded string.
1754
+ */
1755
+ function decodeHTMLStrict(str) {
1756
+ return htmlDecoder(str, DecodingMode.Strict);
1757
+ }
1726
1758
 
1727
1759
  // Utilities
1728
1760
  //
@@ -1902,6 +1934,10 @@ function isPunctChar (ch) {
1902
1934
  return P$7.test(ch) || regex.test(ch)
1903
1935
  }
1904
1936
 
1937
+ function isPunctCharCode (code) {
1938
+ return isPunctChar(fromCodePoint(code))
1939
+ }
1940
+
1905
1941
  // Markdown ASCII punctuation characters.
1906
1942
  //
1907
1943
  // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
@@ -1963,6 +1999,7 @@ function normalizeReference (str) {
1963
1999
  // (remove this when node v10 is no longer supported).
1964
2000
  //
1965
2001
  if ('ẞ'.toLowerCase() === 'Ṿ') {
2002
+ /* c8 ignore next 2 */
1966
2003
  str = str.replace(/ẞ/g, 'ß');
1967
2004
  }
1968
2005
 
@@ -2001,6 +2038,28 @@ function normalizeReference (str) {
2001
2038
  return str.toLowerCase().toUpperCase()
2002
2039
  }
2003
2040
 
2041
+ function isAsciiTrimmable (c) {
2042
+ return c === 0x20 || c === 0x09 || c === 0x0a || c === 0x0d
2043
+ }
2044
+
2045
+ // "Light" .trim() for blocks (headers, paragraphs), where unicode spaces
2046
+ // should be preserved.
2047
+ function asciiTrim (str) {
2048
+ let start = 0;
2049
+ for (; start < str.length; start++) {
2050
+ if (!isAsciiTrimmable(str.charCodeAt(start))) {
2051
+ break
2052
+ }
2053
+ }
2054
+ let end = str.length - 1;
2055
+ for (; end >= start; end--) {
2056
+ if (!isAsciiTrimmable(str.charCodeAt(end))) {
2057
+ break
2058
+ }
2059
+ }
2060
+ return str.slice(start, end + 1)
2061
+ }
2062
+
2004
2063
  // Re-export libraries commonly used in both markdown-it and its plugins,
2005
2064
  // so plugins won't have to depend on them explicitly, which reduces their
2006
2065
  // bundled size (e.g. a browser build).
@@ -2010,6 +2069,7 @@ const lib$3 = { mdurl, ucmicro };
2010
2069
  var utils$4 = /*#__PURE__*/Object.freeze({
2011
2070
  __proto__: null,
2012
2071
  arrayReplaceAt: arrayReplaceAt,
2072
+ asciiTrim: asciiTrim,
2013
2073
  assign: assign$1,
2014
2074
  escapeHtml: escapeHtml,
2015
2075
  escapeRE: escapeRE$1,
@@ -2017,6 +2077,7 @@ var utils$4 = /*#__PURE__*/Object.freeze({
2017
2077
  has: has,
2018
2078
  isMdAsciiPunct: isMdAsciiPunct,
2019
2079
  isPunctChar: isPunctChar,
2080
+ isPunctCharCode: isPunctCharCode,
2020
2081
  isSpace: isSpace,
2021
2082
  isString: isString$2,
2022
2083
  isValidEntityCode: isValidEntityCode,
@@ -3380,14 +3441,36 @@ const QUOTE_TEST_RE = /['"]/;
3380
3441
  const QUOTE_RE = /['"]/g;
3381
3442
  const APOSTROPHE = '\u2019'; /* ’ */
3382
3443
 
3383
- function replaceAt (str, index, ch) {
3384
- return str.slice(0, index) + ch + str.slice(index + 1)
3444
+ function addReplacement (replacements, tokenIdx, pos, ch) {
3445
+ if (!replacements[tokenIdx]) {
3446
+ replacements[tokenIdx] = [];
3447
+ }
3448
+
3449
+ replacements[tokenIdx].push({ pos, ch });
3450
+ }
3451
+
3452
+ function applyReplacements (str, replacements) {
3453
+ let result = '';
3454
+ let lastPos = 0;
3455
+
3456
+ replacements.sort((a, b) => a.pos - b.pos);
3457
+
3458
+ for (let i = 0; i < replacements.length; i++) {
3459
+ const replacement = replacements[i];
3460
+
3461
+ result += str.slice(lastPos, replacement.pos) + replacement.ch;
3462
+ lastPos = replacement.pos + 1;
3463
+ }
3464
+
3465
+ return result + str.slice(lastPos)
3385
3466
  }
3386
3467
 
3387
3468
  function process_inlines (tokens, state) {
3388
3469
  let j;
3389
3470
 
3390
3471
  const stack = [];
3472
+ // token index -> list of replacements in the original token content
3473
+ const replacements = {};
3391
3474
 
3392
3475
  for (let i = 0; i < tokens.length; i++) {
3393
3476
  const token = tokens[i];
@@ -3401,9 +3484,9 @@ function process_inlines (tokens, state) {
3401
3484
 
3402
3485
  if (token.type !== 'text') { continue }
3403
3486
 
3404
- let text = token.content;
3487
+ const text = token.content;
3405
3488
  let pos = 0;
3406
- let max = text.length;
3489
+ const max = text.length;
3407
3490
 
3408
3491
  /* eslint no-labels:0,block-scoped-var:0 */
3409
3492
  OUTER:
@@ -3451,8 +3534,8 @@ function process_inlines (tokens, state) {
3451
3534
  }
3452
3535
  }
3453
3536
 
3454
- const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
3455
- const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
3537
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
3538
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
3456
3539
 
3457
3540
  const isLastWhiteSpace = isWhiteSpace(lastChar);
3458
3541
  const isNextWhiteSpace = isWhiteSpace(nextChar);
@@ -3495,7 +3578,7 @@ function process_inlines (tokens, state) {
3495
3578
  if (!canOpen && !canClose) {
3496
3579
  // middle of word
3497
3580
  if (isSingle) {
3498
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
3581
+ addReplacement(replacements, i, t.index, APOSTROPHE);
3499
3582
  }
3500
3583
  continue
3501
3584
  }
@@ -3518,18 +3601,8 @@ function process_inlines (tokens, state) {
3518
3601
  closeQuote = state.md.options.quotes[1];
3519
3602
  }
3520
3603
 
3521
- // replace token.content *before* tokens[item.token].content,
3522
- // because, if they are pointing at the same token, replaceAt
3523
- // could mess up indices when quote length != 1
3524
- token.content = replaceAt(token.content, t.index, closeQuote);
3525
- tokens[item.token].content = replaceAt(
3526
- tokens[item.token].content, item.pos, openQuote);
3527
-
3528
- pos += closeQuote.length - 1;
3529
- if (item.token === i) { pos += openQuote.length - 1; }
3530
-
3531
- text = token.content;
3532
- max = text.length;
3604
+ addReplacement(replacements, i, t.index, closeQuote);
3605
+ addReplacement(replacements, item.token, item.pos, openQuote);
3533
3606
 
3534
3607
  stack.length = j;
3535
3608
  continue OUTER
@@ -3545,10 +3618,14 @@ function process_inlines (tokens, state) {
3545
3618
  level: thisLevel
3546
3619
  });
3547
3620
  } else if (canClose && isSingle) {
3548
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
3621
+ addReplacement(replacements, i, t.index, APOSTROPHE);
3549
3622
  }
3550
3623
  }
3551
3624
  }
3625
+
3626
+ Object.keys(replacements).forEach(function (tokenIdx) {
3627
+ tokens[tokenIdx].content = applyReplacements(tokens[tokenIdx].content, replacements[tokenIdx]);
3628
+ });
3552
3629
  }
3553
3630
 
3554
3631
  function smartquotes (state) {
@@ -5152,11 +5229,22 @@ function html_block (state, startLine, endLine, silent) {
5152
5229
 
5153
5230
  let nextLine = startLine + 1;
5154
5231
 
5232
+ // Block types 6 and 7 (the only ones whose end condition is a blank line)
5233
+ // have `/^$/` as their closing regexp. For all other types (1-5, e.g.
5234
+ // `<!--` comments), a blank line is regular content and must not terminate
5235
+ // the block - it ends only when its closing sequence is found.
5236
+ const endsOnBlankLine = HTML_SEQUENCES[i][1].test('');
5237
+
5155
5238
  // If we are here - we detected HTML block.
5156
5239
  // Let's roll down till block end.
5157
5240
  if (!HTML_SEQUENCES[i][1].test(lineText)) {
5158
5241
  for (; nextLine < endLine; nextLine++) {
5159
- if (state.sCount[nextLine] < state.blkIndent) { break }
5242
+ if (state.sCount[nextLine] < state.blkIndent) {
5243
+ // An outdented blank line shouldn't end a block that doesn't end on a
5244
+ // blank line (e.g. a `<!--` comment inside a list item). Such blocks
5245
+ // must continue until their closing sequence regardless of indent.
5246
+ if (endsOnBlankLine || !state.isEmpty(nextLine)) { break }
5247
+ }
5160
5248
 
5161
5249
  pos = state.bMarks[nextLine] + state.tShift[nextLine];
5162
5250
  max = state.eMarks[nextLine];
@@ -5219,7 +5307,7 @@ function heading (state, startLine, endLine, silent) {
5219
5307
  token_o.map = [startLine, state.line];
5220
5308
 
5221
5309
  const token_i = state.push('inline', '', 0);
5222
- token_i.content = state.src.slice(pos, max).trim();
5310
+ token_i.content = asciiTrim(state.src.slice(pos, max));
5223
5311
  token_i.map = [startLine, state.line];
5224
5312
  token_i.children = [];
5225
5313
 
@@ -5231,6 +5319,7 @@ function heading (state, startLine, endLine, silent) {
5231
5319
 
5232
5320
  // lheading (---, ===)
5233
5321
 
5322
+
5234
5323
  function lheading (state, startLine, endLine/*, silent */) {
5235
5324
  const terminatorRules = state.md.block.ruler.getRules('paragraph');
5236
5325
 
@@ -5288,10 +5377,11 @@ function lheading (state, startLine, endLine/*, silent */) {
5288
5377
 
5289
5378
  if (!level) {
5290
5379
  // Didn't find valid underline
5380
+ state.parentType = oldParentType;
5291
5381
  return false
5292
5382
  }
5293
5383
 
5294
- const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
5384
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
5295
5385
 
5296
5386
  state.line = nextLine + 1;
5297
5387
 
@@ -5314,6 +5404,7 @@ function lheading (state, startLine, endLine/*, silent */) {
5314
5404
 
5315
5405
  // Paragraph
5316
5406
 
5407
+
5317
5408
  function paragraph (state, startLine, endLine) {
5318
5409
  const terminatorRules = state.md.block.ruler.getRules('paragraph');
5319
5410
  const oldParentType = state.parentType;
@@ -5340,7 +5431,7 @@ function paragraph (state, startLine, endLine) {
5340
5431
  if (terminate) { break }
5341
5432
  }
5342
5433
 
5343
- const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
5434
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
5344
5435
 
5345
5436
  state.line = nextLine;
5346
5437
 
@@ -5567,8 +5658,30 @@ StateInline.prototype.scanDelims = function (start, canSplitWord) {
5567
5658
  const max = this.posMax;
5568
5659
  const marker = this.src.charCodeAt(start);
5569
5660
 
5570
- // treat beginning of the line as a whitespace
5571
- const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
5661
+ // Astral characters below are combined manually, because .codePointAt()
5662
+ // does not guarantee numeric type output. And we don't wish JIT cache issues.
5663
+ // The broken surrogate pairs are evaluated as U+FFFD to prevent possible
5664
+ // crashes.
5665
+
5666
+ let lastChar;
5667
+ if (start === 0) {
5668
+ // treat beginning of the line as a whitespace
5669
+ lastChar = 0x20;
5670
+ } else if (start === 1) {
5671
+ lastChar = this.src.charCodeAt(0);
5672
+ if ((lastChar & 0xF800) === 0xD800) { lastChar = 0xFFFD; }
5673
+ } else {
5674
+ lastChar = this.src.charCodeAt(start - 1);
5675
+ if ((lastChar & 0xFC00) === 0xDC00) {
5676
+ // low surrogate => add high one, replace broken pair with U+FFFD
5677
+ const highSurr = this.src.charCodeAt(start - 2);
5678
+ lastChar = (highSurr & 0xFC00) === 0xD800
5679
+ ? 0x10000 + ((highSurr - 0xD800) << 10) + (lastChar - 0xDC00)
5680
+ : 0xFFFD;
5681
+ } else if ((lastChar & 0xFC00) === 0xD800) {
5682
+ lastChar = 0xFFFD;
5683
+ }
5684
+ }
5572
5685
 
5573
5686
  let pos = start;
5574
5687
  while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
@@ -5576,10 +5689,19 @@ StateInline.prototype.scanDelims = function (start, canSplitWord) {
5576
5689
  const count = pos - start;
5577
5690
 
5578
5691
  // treat end of the line as a whitespace
5579
- const nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
5692
+ let nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
5693
+ if ((nextChar & 0xFC00) === 0xD800) {
5694
+ // high surrogate => add low one, replace broken pair with U+FFFD
5695
+ const lowSurr = this.src.charCodeAt(pos + 1);
5696
+ nextChar = (lowSurr & 0xFC00) === 0xDC00
5697
+ ? 0x10000 + ((nextChar - 0xD800) << 10) + (lowSurr - 0xDC00)
5698
+ : 0xFFFD;
5699
+ } else if ((nextChar & 0xFC00) === 0xDC00) {
5700
+ nextChar = 0xFFFD;
5701
+ }
5580
5702
 
5581
- const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
5582
- const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
5703
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
5704
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
5583
5705
 
5584
5706
  const isLastWhiteSpace = isWhiteSpace(lastChar);
5585
5707
  const isNextWhiteSpace = isWhiteSpace(nextChar);
@@ -6606,7 +6728,7 @@ function entity (state, silent) {
6606
6728
  } else {
6607
6729
  const match = state.src.slice(pos).match(NAMED_RE);
6608
6730
  if (match) {
6609
- const decoded = decodeHTML(match[0]);
6731
+ const decoded = decodeHTMLStrict(match[0]);
6610
6732
  if (decoded !== match[0]) {
6611
6733
  if (!silent) {
6612
6734
  const token = state.push('text_special', '', 0);
@@ -7268,11 +7390,6 @@ const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghik
7268
7390
  // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
7269
7391
  const tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
7270
7392
 
7271
- function resetScanCache (self) {
7272
- self.__index__ = -1;
7273
- self.__text_cache__ = '';
7274
- }
7275
-
7276
7393
  function createValidator (re) {
7277
7394
  return function (text, pos) {
7278
7395
  const tail = text.slice(pos);
@@ -7311,8 +7428,11 @@ function compile (self) {
7311
7428
  function untpl (tpl) { return tpl.replace('%TLDS%', re.src_tlds) }
7312
7429
 
7313
7430
  re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
7431
+ re.email_fuzzy_global = RegExp(untpl(re.tpl_email_fuzzy), 'ig');
7314
7432
  re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
7433
+ re.link_fuzzy_global = RegExp(untpl(re.tpl_link_fuzzy), 'ig');
7315
7434
  re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
7435
+ re.link_no_ip_fuzzy_global = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'ig');
7316
7436
  re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
7317
7437
 
7318
7438
  //
@@ -7406,12 +7526,6 @@ function compile (self) {
7406
7526
  '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@',
7407
7527
  'i'
7408
7528
  );
7409
-
7410
- //
7411
- // Cleanup
7412
- //
7413
-
7414
- resetScanCache(self);
7415
7529
  }
7416
7530
 
7417
7531
  /**
@@ -7419,55 +7533,45 @@ function compile (self) {
7419
7533
  *
7420
7534
  * Match result. Single element of array, returned by [[LinkifyIt#match]]
7421
7535
  **/
7422
- function Match (self, shift) {
7423
- const start = self.__index__;
7424
- const end = self.__last_index__;
7425
- const text = self.__text_cache__.slice(start, end);
7536
+ function Match (text, schema, index, lastIndex) {
7537
+ const raw = text.slice(index, lastIndex);
7426
7538
 
7427
7539
  /**
7428
7540
  * Match#schema -> String
7429
7541
  *
7430
7542
  * Prefix (protocol) for matched string.
7431
7543
  **/
7432
- this.schema = self.__schema__.toLowerCase();
7544
+ this.schema = schema.toLowerCase();
7433
7545
  /**
7434
7546
  * Match#index -> Number
7435
7547
  *
7436
7548
  * First position of matched string.
7437
7549
  **/
7438
- this.index = start + shift;
7550
+ this.index = index;
7439
7551
  /**
7440
7552
  * Match#lastIndex -> Number
7441
7553
  *
7442
7554
  * Next position after matched string.
7443
7555
  **/
7444
- this.lastIndex = end + shift;
7556
+ this.lastIndex = lastIndex;
7445
7557
  /**
7446
7558
  * Match#raw -> String
7447
7559
  *
7448
7560
  * Matched string.
7449
7561
  **/
7450
- this.raw = text;
7562
+ this.raw = raw;
7451
7563
  /**
7452
7564
  * Match#text -> String
7453
7565
  *
7454
7566
  * Notmalized text of matched string.
7455
7567
  **/
7456
- this.text = text;
7568
+ this.text = raw;
7457
7569
  /**
7458
7570
  * Match#url -> String
7459
7571
  *
7460
7572
  * Normalized url of matched string.
7461
7573
  **/
7462
- this.url = text;
7463
- }
7464
-
7465
- function createMatch (self, shift) {
7466
- const match = new Match(self, shift);
7467
-
7468
- self.__compiled__[match.schema].normalize(match, self);
7469
-
7470
- return match
7574
+ this.url = raw;
7471
7575
  }
7472
7576
 
7473
7577
  /**
@@ -7522,12 +7626,6 @@ function LinkifyIt (schemas, options) {
7522
7626
 
7523
7627
  this.__opts__ = assign({}, defaultOptions$1, options);
7524
7628
 
7525
- // Cache last tested result. Used to skip repeating steps on next `match` call.
7526
- this.__index__ = -1;
7527
- this.__last_index__ = -1; // Next scan position
7528
- this.__schema__ = '';
7529
- this.__text_cache__ = '';
7530
-
7531
7629
  this.__schemas__ = assign({}, defaultSchemas, schemas);
7532
7630
  this.__compiled__ = {};
7533
7631
 
@@ -7569,69 +7667,38 @@ LinkifyIt.prototype.set = function set (options) {
7569
7667
  * Searches linkifiable pattern and returns `true` on success or `false` on fail.
7570
7668
  **/
7571
7669
  LinkifyIt.prototype.test = function test (text) {
7572
- // Reset scan cache
7573
- this.__text_cache__ = text;
7574
- this.__index__ = -1;
7575
-
7576
7670
  if (!text.length) { return false }
7577
7671
 
7578
- let m, ml, me, len, shift, next, re, tld_pos, at_pos;
7672
+ let m, re;
7579
7673
 
7580
7674
  // try to scan for link with schema - that's the most simple rule
7581
7675
  if (this.re.schema_test.test(text)) {
7582
7676
  re = this.re.schema_search;
7583
7677
  re.lastIndex = 0;
7584
7678
  while ((m = re.exec(text)) !== null) {
7585
- len = this.testSchemaAt(text, m[2], re.lastIndex);
7586
- if (len) {
7587
- this.__schema__ = m[2];
7588
- this.__index__ = m.index + m[1].length;
7589
- this.__last_index__ = m.index + m[0].length + len;
7590
- break
7591
- }
7679
+ if (this.testSchemaAt(text, m[2], re.lastIndex)) { return true }
7592
7680
  }
7593
7681
  }
7594
7682
 
7595
7683
  if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
7596
7684
  // guess schemaless links
7597
- tld_pos = text.search(this.re.host_fuzzy_test);
7598
- if (tld_pos >= 0) {
7599
- // if tld is located after found link - no need to check fuzzy pattern
7600
- if (this.__index__ < 0 || tld_pos < this.__index__) {
7601
- if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
7602
- shift = ml.index + ml[1].length;
7603
-
7604
- if (this.__index__ < 0 || shift < this.__index__) {
7605
- this.__schema__ = '';
7606
- this.__index__ = shift;
7607
- this.__last_index__ = ml.index + ml[0].length;
7608
- }
7609
- }
7685
+ if (text.search(this.re.host_fuzzy_test) >= 0) {
7686
+ if (text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy) !== null) {
7687
+ return true
7610
7688
  }
7611
7689
  }
7612
7690
  }
7613
7691
 
7614
7692
  if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
7615
7693
  // guess schemaless emails
7616
- at_pos = text.indexOf('@');
7617
- if (at_pos >= 0) {
7694
+ if (text.indexOf('@') >= 0) {
7618
7695
  // We can't skip this check, because this cases are possible:
7619
7696
  // 192.168.1.1@gmail.com, my.in@example.com
7620
- if ((me = text.match(this.re.email_fuzzy)) !== null) {
7621
- shift = me.index + me[1].length;
7622
- next = me.index + me[0].length;
7623
-
7624
- if (this.__index__ < 0 || shift < this.__index__ ||
7625
- (shift === this.__index__ && next > this.__last_index__)) {
7626
- this.__schema__ = 'mailto:';
7627
- this.__index__ = shift;
7628
- this.__last_index__ = next;
7629
- }
7630
- }
7697
+ if (text.match(this.re.email_fuzzy) !== null) { return true }
7631
7698
  }
7632
7699
  }
7633
7700
 
7634
- return this.__index__ >= 0
7701
+ return false
7635
7702
  };
7636
7703
 
7637
7704
  /**
@@ -7680,23 +7747,88 @@ LinkifyIt.prototype.testSchemaAt = function testSchemaAt (text, schema, pos) {
7680
7747
  **/
7681
7748
  LinkifyIt.prototype.match = function match (text) {
7682
7749
  const result = [];
7683
- let shift = 0;
7750
+ const type_schemed = [];
7751
+ const type_fuzzy_link = [];
7752
+ const type_fuzzy_email = [];
7753
+ let m, len, re;
7754
+
7755
+ function choose (a, b) {
7756
+ if (!a) { return b }
7757
+ if (!b) { return a }
7758
+ if (a.index !== b.index) { return a.index < b.index ? a : b }
7759
+ return a.lastIndex >= b.lastIndex ? a : b
7760
+ }
7761
+
7762
+ if (!text.length) { return null }
7763
+
7764
+ // scan for links with schema
7765
+ if (this.re.schema_test.test(text)) {
7766
+ re = this.re.schema_search;
7767
+ re.lastIndex = 0;
7768
+ while ((m = re.exec(text)) !== null) {
7769
+ len = this.testSchemaAt(text, m[2], re.lastIndex);
7770
+ if (len) {
7771
+ type_schemed.push({
7772
+ schema: m[2],
7773
+ index: m.index + m[1].length,
7774
+ lastIndex: m.index + m[0].length + len
7775
+ });
7776
+ }
7777
+ }
7778
+ }
7779
+
7780
+ if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
7781
+ re = this.__opts__.fuzzyIP ? this.re.link_fuzzy_global : this.re.link_no_ip_fuzzy_global;
7782
+ re.lastIndex = 0;
7783
+ while ((m = re.exec(text)) !== null) {
7784
+ type_fuzzy_link.push({
7785
+ schema: '',
7786
+ index: m.index + m[1].length,
7787
+ lastIndex: m.index + m[0].length
7788
+ });
7789
+ }
7790
+ }
7684
7791
 
7685
- // Try to take previous element from cache, if .test() called before
7686
- if (this.__index__ >= 0 && this.__text_cache__ === text) {
7687
- result.push(createMatch(this, shift));
7688
- shift = this.__last_index__;
7792
+ if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
7793
+ re = this.re.email_fuzzy_global;
7794
+ re.lastIndex = 0;
7795
+ while ((m = re.exec(text)) !== null) {
7796
+ type_fuzzy_email.push({
7797
+ schema: 'mailto:',
7798
+ index: m.index + m[1].length,
7799
+ lastIndex: m.index + m[0].length
7800
+ });
7801
+ }
7689
7802
  }
7690
7803
 
7691
- // Cut head if cache was used
7692
- let tail = shift ? text.slice(shift) : text;
7804
+ const indexes = [0, 0, 0];
7805
+ let lastIndex = 0;
7806
+
7807
+ for (;;) {
7808
+ const candidates = [
7809
+ type_schemed[indexes[0]],
7810
+ type_fuzzy_email[indexes[1]],
7811
+ type_fuzzy_link[indexes[2]]
7812
+ ];
7813
+
7814
+ const candidate = choose(choose(candidates[0], candidates[1]), candidates[2]);
7815
+
7816
+ if (!candidate) { break }
7693
7817
 
7694
- // Scan string until end reached
7695
- while (this.test(tail)) {
7696
- result.push(createMatch(this, shift));
7818
+ if (candidate === candidates[0]) {
7819
+ indexes[0]++;
7820
+ } else if (candidate === candidates[1]) {
7821
+ indexes[1]++;
7822
+ } else {
7823
+ indexes[2]++;
7824
+ }
7697
7825
 
7698
- tail = tail.slice(this.__last_index__);
7699
- shift += this.__last_index__;
7826
+ if (candidate.index < lastIndex) { continue }
7827
+
7828
+ const match = new Match(text, candidate.schema, candidate.index, candidate.lastIndex);
7829
+ this.__compiled__[match.schema].normalize(match, this);
7830
+ result.push(match);
7831
+ lastIndex = candidate.lastIndex;
7700
7832
  }
7701
7833
 
7702
7834
  if (result.length) {
@@ -7713,10 +7845,6 @@ LinkifyIt.prototype.match = function match (text) {
7713
7845
  * of the string, and null otherwise.
7714
7846
  **/
7715
7847
  LinkifyIt.prototype.matchAtStart = function matchAtStart (text) {
7716
- // Reset scan cache
7717
- this.__text_cache__ = text;
7718
- this.__index__ = -1;
7719
-
7720
7848
  if (!text.length) return null
7721
7849
 
7722
7850
  const m = this.re.schema_at_start.exec(text);
@@ -7725,11 +7853,10 @@ LinkifyIt.prototype.matchAtStart = function matchAtStart (text) {
7725
7853
  const len = this.testSchemaAt(text, m[2], m[0].length);
7726
7854
  if (!len) return null
7727
7855
 
7728
- this.__schema__ = m[2];
7729
- this.__index__ = m.index + m[1].length;
7730
- this.__last_index__ = m.index + m[0].length + len;
7856
+ const match = new Match(text, m[2], m.index + m[1].length, m.index + m[0].length + len);
7731
7857
 
7732
- return createMatch(this, 0)
7858
+ this.__compiled__[match.schema].normalize(match, this);
7859
+ return match
7733
7860
  };
7734
7861
 
7735
7862
  /** chainable
@@ -8781,7 +8908,7 @@ function MarkdownIt (presetName, options) {
8781
8908
  * ```javascript
8782
8909
  * var md = require('markdown-it')()
8783
8910
  * .set({ html: true, breaks: true })
8784
- * .set({ typographer, true });
8911
+ * .set({ typographer: true });
8785
8912
  * ```
8786
8913
  *
8787
8914
  * __Note:__ To achieve the best possible performance, don't modify a
@@ -21324,7 +21451,8 @@ function deflist_plugin (md) {
21324
21451
  if (silent) {
21325
21452
  // quirk: validation mode validates a dd block only, not a whole deflist
21326
21453
  if (state.ddIndent < 0) { return false }
21327
- return skipMarker(state, startLine) >= 0
21454
+ const markerPos = skipMarker(state, startLine);
21455
+ return markerPos >= 0 && state.sCount[startLine] < state.blkIndent
21328
21456
  }
21329
21457
 
21330
21458
  let nextLine = startLine + 1;
@@ -69927,5 +70055,5 @@ var typescript = /*#__PURE__*/Object.freeze({
69927
70055
  parsers: ld
69928
70056
  });
69929
70057
 
69930
- export { HighlightJS as H, MarkdownIt as M, Ze$a as Z, closest as a, createInstance as b, cliProgress as c, createSyncFn as d, createTwoFilesPatch$1 as e, dedent$1 as f, deflist_plugin as g, distance as h, fm$2 as i, format2 as j, fse as k, inter as l, isCI as m, moduleImporter as n, runAsWorker as o, ts$6 as p, resolveConfig as r, tinylr as t, watch$1 as w };
69931
- //# sourceMappingURL=vendor-CyiP4ufo.mjs.map
70058
+ export { HighlightJS as H, MarkdownIt as M, Ze$a as Z, resolveConfig as a, createTwoFilesPatch$1 as b, createSyncFn as c, dedent$1 as d, deflist_plugin as e, format2 as f, closest as g, distance as h, fm$2 as i, isCI as j, cliProgress as k, tinylr as l, moduleImporter as m, createInstance as n, fse as o, inter as p, runAsWorker as r, ts$6 as t, watch$1 as w };
70059
+ //# sourceMappingURL=vendor-s-84ehgc.mjs.map