@visulima/cerebro 1.1.31 → 1.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## @visulima/cerebro [1.1.32](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.31...@visulima/cerebro@1.1.32) (2025-01-12)
2
+
3
+ ### Bug Fixes
4
+
5
+ * updated @visulima/packem, and all other dev dependencies ([7797a1c](https://github.com/visulima/visulima/commit/7797a1c3e6f1fc532895247bd88285a8a9883c40))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/boxen:** upgraded to 1.0.26
11
+ * **@visulima/colorize:** upgraded to 1.4.17
12
+ * **@visulima/find-cache-dir:** upgraded to 1.0.21
13
+ * **@visulima/pail:** upgraded to 2.1.17
14
+ * **@visulima/path:** upgraded to 1.3.2
15
+
1
16
  ## @visulima/cerebro [1.1.31](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.30...@visulima/cerebro@1.1.31) (2025-01-09)
2
17
 
3
18
 
package/dist/index.cjs CHANGED
@@ -1 +1,7 @@
1
- "use strict";const e=require("./packem_shared/default-B6w1KajL.cjs");module.exports=e.Cli;
1
+ 'use strict';
2
+
3
+ const _default = require('./packem_shared/default-F355sbNC.cjs');
4
+
5
+
6
+
7
+ module.exports = _default.Cli;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{Cli as f}from"./packem_shared/default-DNNnCan-.mjs";export{f as default};
1
+ export { Cli as default } from './packem_shared/default-E15sg8JS.mjs';
@@ -1 +1,378 @@
1
- "use strict";var yt=Object.defineProperty;var M=(t,r)=>yt(t,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("node:fs"),bt=require("@visulima/find-cache-dir"),wt=require("node:https");var jt=Object.defineProperty,At=M((t,r)=>jt(t,"name",{value:r,configurable:!0}),"o$1");const Ot=At((t,r)=>{const i=t.split(".").map(Number),l=r.split(".").map(Number);for(const[f,h]of i.entries()){if(h>l[f])return!0;if(h<l[f])return!1}return!1},"semverGt");var Mt=Object.defineProperty,zt=M((t,r)=>Mt(t,"name",{value:r,configurable:!0}),"le"),St=Object.defineProperty,L=zt((t,r)=>St(t,"name",{value:r,configurable:!0}),"Z"),_t=Object.defineProperty,Pt=L((t,r)=>_t(t,"name",{value:r,configurable:!0}),"t");const Ct=/^[A-Z]:\//i,O=Pt((t="")=>t&&t.replaceAll("\\","/").replace(Ct,r=>r.toUpperCase()),"normalizeWindowsPath");var kt=Object.defineProperty,u=L((t,r)=>kt(t,"name",{value:r,configurable:!0}),"u$1");let ae=u(()=>{var t=(()=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,f=Object.prototype.hasOwnProperty,h=u((e,n)=>{for(var o in n)r(e,o,{get:n[o],enumerable:!0})},"q"),m=u((e,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of l(n))!f.call(e,s)&&s!==o&&r(e,s,{get:u(()=>n[s],"get"),enumerable:!(a=i(n,s))||a.enumerable});return e},"H"),g=u(e=>m(r({},"__esModule",{value:!0}),e),"J"),v={};h(v,{zeptomatch:u(()=>$t,"zeptomatch")});var R=u(e=>Array.isArray(e),"A"),_=u(e=>typeof e=="function","d"),de=u(e=>e.length===0,"Q"),he=u(e=>typeof e=="number","W"),ge=u(e=>typeof e=="object"&&e!==null,"K"),me=u(e=>e instanceof RegExp,"X"),W=u(e=>typeof e=="string","b"),A=u(e=>e===void 0,"h"),xe=u(e=>{const n=new Map;return o=>{const a=n.get(o);if(a)return a;const s=e(o);return n.set(o,s),s}},"Y"),$e=u((e,n,o={})=>{const a={cache:{},input:e,index:0,indexMax:0,options:o,output:[]};if(j(n)(a)&&a.index===e.length)return a.output;throw new Error(`Failed to parse at index ${a.indexMax}`)},"rr"),c=u((e,n)=>R(e)?ve(e,n):W(e)?be(e,n):ye(e,n),"i"),ve=u((e,n)=>{const o={};for(const a of e){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const s=a.charCodeAt(0);o[s]=!0}return a=>{const s=a.index,p=a.input;for(;a.index<p.length&&p.charCodeAt(a.index)in o;)a.index+=1;const d=a.index;if(d>s){if(!A(n)&&!a.options.silent){const $=a.input.slice(s,d),y=_(n)?n($,p,String(s)):n;A(y)||a.output.push(y)}a.indexMax=Math.max(a.indexMax,a.index)}return!0}},"er"),ye=u((e,n)=>{const o=e.source,a=e.flags.replace(/y|$/,"y"),s=new RegExp(o,a);return k(p=>{s.lastIndex=p.index;const d=s.exec(p.input);if(d){if(!A(n)&&!p.options.silent){const $=_(n)?n(...d,p.input,String(p.index)):n;A($)||p.output.push($)}return p.index+=d[0].length,p.indexMax=Math.max(p.indexMax,p.index),!0}else return!1})},"nr"),be=u((e,n)=>o=>{if(o.input.startsWith(e,o.index)){if(!A(n)&&!o.options.silent){const a=_(n)?n(e,o.input,String(o.index)):n;A(a)||o.output.push(a)}return o.index+=e.length,o.indexMax=Math.max(o.indexMax,o.index),!0}else return!1},"tr"),F=u((e,n,o,a)=>{const s=j(e);return k(E(J(p=>{let d=0;for(;d<o;){const $=p.index;if(!s(p)||(d+=1,p.index===$))break}return d>=n}),a))},"C"),we=u((e,n)=>F(e,0,1,n),"ar"),P=u((e,n)=>F(e,0,1/0,n),"f"),C=u((e,n)=>{const o=e.map(j);return k(E(J(a=>{for(let s=0,p=o.length;s<p;s++)if(!o[s](a))return!1;return!0}),n))},"x"),b=u((e,n)=>{const o=e.map(j);return k(E(a=>{for(let s=0,p=o.length;s<p;s++)if(o[s](a))return!0;return!1},n))},"l"),J=u((e,n=!1)=>{const o=j(e);return a=>{const s=a.index,p=a.output.length,d=o(a);return(!d||n)&&(a.index=s,a.output.length!==p&&(a.output.length=p)),d}},"M"),E=u((e,n)=>{const o=j(e);return n?a=>{if(a.options.silent)return o(a);const s=a.output.length;if(o(a)){const p=a.output.splice(s,1/0),d=n(p);return A(d)||a.output.push(d),!0}else return!1}:o},"_"),k=(()=>{let e=0;return n=>{const o=j(n),a=e+=1;return s=>{var p;if(s.options.memoization===!1)return o(s);const d=s.index,$=(p=s.cache)[a]||(p[a]=new Map),y=$.get(d);if(y===!1)return!1;if(he(y))return s.index=y,!0;if(y)return s.index=y.index,y.output?.length&&s.output.push(...y.output),!0;{const re=s.output.length;if(o(s)){const oe=s.index,ie=s.output.length;if(ie>re){const vt=s.output.slice(re,ie);$.set(d,{index:oe,output:vt})}else $.set(d,oe);return!0}else return $.set(d,!1),!1}}}})(),T=u(e=>{let n;return o=>(n||(n=j(e())),n(o))},"E"),j=xe(e=>{if(_(e))return de(e)?T(e):e;if(W(e)||me(e))return c(e);if(R(e))return C(e);if(ge(e))return b(Object.values(e));throw new Error("Invalid rule")}),G="abcdefghijklmnopqrstuvwxyz",je=u(e=>{let n="";for(;e>0;){const o=(e-1)%26;n=G[o]+n,e=Math.floor((e-1)/26)}return n},"ir"),V=u(e=>{let n=0;for(let o=0,a=e.length;o<a;o++)n=n*26+G.indexOf(e[o])+1;return n},"z"),N=u((e,n)=>{if(n<e)return N(n,e);const o=[];for(;e<=n;)o.push(e++);return o},"S"),Ae=u((e,n,o)=>N(e,n).map(a=>String(a).padStart(o,"0")),"or"),B=u((e,n)=>N(V(e),V(n)).map(je),"O"),w=u(e=>e,"p"),H=u(e=>Oe(n=>$e(n,e,{memoization:!1}).join("")),"R"),Oe=u(e=>{const n={};return o=>n[o]??(n[o]=e(o))},"ur"),Me=c(/^\*\*\/\*$/,".*"),ze=c(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(e,n,o)=>`.*${n?"":"(?:^|/)"}${o.replaceAll(".","\\.")}`),Se=c(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(e,n,o,a)=>`.*${n?"":"(?:^|/)"}${o.replaceAll(".","\\.")}(?:${a.replaceAll(",","|").replaceAll(".","\\.")})`),Z=c(/\\./,w),_e=c(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),Pe=c(/./,w),Ce=c(/^(?:!!)*!(.*)$/,(e,n)=>`(?!^${ne(n)}$).*?`),ke=c(/^(!!)+/,""),Ee=b([Ce,ke]),Ne=c(/\/(\*\*\/)+/,"(?:/.+/|/)"),Ze=c(/^(\*\*\/)+/,"(?:^|.*/)"),Ue=c(/\/(\*\*)$/,"(?:/.*|$)"),De=c(/\*\*/,".*"),K=b([Ne,Ze,Ue,De]),Ie=c(/\*\/(?!\*\*\/)/,"[^/]*/"),Le=c(/\*/,"[^/]*"),Q=b([Ie,Le]),X=c("?","[^/]"),qe=c("[",w),Re=c("]",w),We=c(/[!^]/,"^/"),Fe=c(/[a-z]-[a-z]|[0-9]-[0-9]/i,w),Je=c(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Te=c(/[^\]]/,w),Ge=b([Z,Je,Fe,Te]),Y=C([qe,we(We),P(Ge),Re]),Ve=c("{","(?:"),Be=c("}",")"),He=c(/(\d+)\.\.(\d+)/,(e,n,o)=>Ae(+n,+o,Math.min(n.length,o.length)).join("|")),Ke=c(/([a-z]+)\.\.([a-z]+)/,(e,n,o)=>B(n,o).join("|")),Qe=c(/([A-Z]+)\.\.([A-Z]+)/,(e,n,o)=>B(n.toLowerCase(),o.toLowerCase()).join("|").toUpperCase()),Xe=b([He,Ke,Qe]),ee=C([Ve,Xe,Be]),Ye=c("{","(?:"),et=c("}",")"),tt=c(",","|"),nt=c(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),rt=c(/[^}]/,w),ot=T(()=>te),it=b([K,Q,X,Y,ee,ot,Z,nt,tt,rt]),te=C([Ye,P(it),et]),at=P(b([Me,ze,Se,Ee,K,Q,X,Y,ee,te,Z,_e,Pe])),st=at,lt=H(st),ne=lt,ut=c(/\\./,w),ct=c(/./,w),pt=c(/\*\*\*+/,"*"),ft=c(/([^/{[(!])\*\*/,(e,n)=>`${n}*`),dt=c(/(^|.)\*\*(?=[^*/)\]}])/,(e,n)=>`${n}*`),ht=P(b([ut,pt,ft,dt,ct])),gt=ht,mt=H(gt),xt=mt,U=u((e,n)=>{const o=Array.isArray(e)?e:[e];if(!o.length)return!1;const a=o.map(U.compile),s=o.every(d=>/(\/(?:\*\*)?|\[\/\])$/.test(d)),p=n.replace(/[\\\/]+/g,"/").replace(/\/$/,s?"/":"");return a.some(d=>d.test(p))},"$");U.compile=e=>new RegExp(`^${ne(xt(e))}$`,"s");var $t=U;return g(v)})();return t.default||t},"_lazyMatch"),D;const Et=u((t,r)=>(D||(D=ae(),ae=null),D(t,r)),"default");var Nt=Object.defineProperty,x=L((t,r)=>Nt(t,"name",{value:r,configurable:!0}),"r");const Zt=/^[/\\]{2}/,Ut=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,le=/^[A-Z]:$/i,se=/^\/([A-Z]:)?$/i,Dt=/.(\.[^./]+)$/,It=/^[/\\]|^[a-z]:[/\\]/i,Lt=x(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),ue=x((t,r)=>{let i="",l=0,f=-1,h=0,m=null;for(let g=0;g<=t.length;++g){if(g<t.length)m=t[g];else{if(m==="/")break;m="/"}if(m==="/"){if(!(f===g-1||h===1))if(h===2){if(i.length<2||l!==2||!i.endsWith(".")||i.at(-2)!=="."){if(i.length>2){const v=i.lastIndexOf("/");v===-1?(i="",l=0):(i=i.slice(0,v),l=i.length-1-i.lastIndexOf("/")),f=g,h=0;continue}else if(i.length>0){i="",l=0,f=g,h=0;continue}}r&&(i+=i.length>0?"/..":"..",l=2)}else i.length>0?i+=`/${t.slice(f+1,g)}`:i=t.slice(f+1,g),l=g-f-1;f=g,h=0}else m==="."&&h!==-1?++h:h=-1}return i},"normalizeString"),S=x(t=>Ut.test(t),"isAbsolute"),ce=x(function(t){if(t.length===0)return".";t=O(t);const r=Zt.exec(t),i=S(t),l=t.at(-1)==="/";return t=ue(t,!i),t.length===0?i?"/":l?"./":".":(l&&(t+="/"),le.test(t)&&(t+="/"),r?i?`//${t}`:`//./${t}`:i&&!S(t)?`/${t}`:t)},"normalize"),qt=x((...t)=>{let r="";for(const i of t)if(i)if(r.length>0){const l=r[r.length-1]==="/",f=i[0]==="/";l&&f?r+=i.slice(1):r+=l||f?i:`/${i}`}else r+=i;return ce(r)},"join"),I=x(function(...t){t=t.map(l=>O(l));let r="",i=!1;for(let l=t.length-1;l>=-1&&!i;l--){const f=l>=0?t[l]:Lt();!f||f.length===0||(r=`${f}/${r}`,i=S(f))}return r=ue(r,!i),i&&!S(r)?`/${r}`:r.length>0?r:"."},"resolve");x(function(t){return O(t)},"toNamespacedPath");const Rt=x(function(t){return Dt.exec(O(t))?.[1]??""},"extname");x(function(t,r){const i=I(t).replace(se,"$1").split("/"),l=I(r).replace(se,"$1").split("/");if(l[0][1]===":"&&i[0][1]===":"&&i[0]!==l[0])return l.join("/");const f=[...i];for(const h of f){if(l[0]!==h)break;i.shift(),l.shift()}return[...i.map(()=>".."),...l].join("/")},"relative");const pe=x(t=>{const r=O(t).replace(/\/$/,"").split("/").slice(0,-1);return r.length===1&&le.test(r[0])&&(r[0]+="/"),r.join("/")||(S(t)?"/":".")},"dirname");x(function(t){const r=[t.root,t.dir,t.base??t.name+t.ext].filter(Boolean);return O(t.root?I(...r):r.join("/"))},"format");const Wt=x((t,r)=>{const i=O(t).split("/").pop();return r&&i.endsWith(r)?i.slice(0,-r.length):i},"basename");x(function(t){const r=It.exec(t)?.[0]?.replace(/\\/g,"/")??"",i=Wt(t),l=Rt(i);return{base:i,dir:pe(t),ext:l,name:i.slice(0,i.length-l.length),root:r}},"parse");x((t,r)=>Et(r,ce(t)),"matchesGlob");var Ft=Object.defineProperty,q=M((t,r)=>Ft(t,"name",{value:r,configurable:!0}),"r");const Jt="last-update-check.json",fe=q(t=>{const r=bt.findCacheDirSync(t);if(r===void 0)throw new Error("Could not find cache directory");return qt(r,Jt)},"getConfigFile"),Tt=q(t=>{const r=fe(t);try{if(!z.existsSync(r))return;const{lastUpdateCheck:i}=JSON.parse(z.readFileSync(r,"utf8"));return i}catch{return}},"getLastUpdate"),Gt=q(t=>{const r=fe(t),i=pe(r);z.existsSync(i)||z.mkdirSync(i,{recursive:!0}),z.writeFileSync(r,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var Vt=Object.defineProperty,Bt=M((t,r)=>Vt(t,"name",{value:r,configurable:!0}),"g");const Ht=Bt(async(t,r,i)=>{const l=i.replace("__NAME__",t);return await new Promise((f,h)=>{wt.get(l,m=>{let g="";m.on("data",v=>g+=v),m.on("end",()=>{try{const v=JSON.parse(g)[r];v||h(new Error("Error getting version")),f(v)}catch{h(new Error("Could not parse version response"))}})}).on("error",m=>h(m))})},"getDistributionVersion");var Kt=Object.defineProperty,Qt=M((t,r)=>Kt(t,"name",{value:r,configurable:!0}),"i");const Xt=Qt(async({alwaysRun:t,debug:r,distTag:i="latest",pkg:l,registryUrl:f="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:h=1e3*60*60*24})=>{const m=Tt(l.name);if(t||!m||m<Date.now()-h){const g=await Ht(l.name,i,f);if(Gt(l.name),Ot(g,l.version))return g;r&&console.error(`Latest version (${g}) not newer than current version (${l.version})`)}else r&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${h}ms but only ${Date.now()-m}ms since last check.`);return null},"hasNewVersion");exports.default=Xt;
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const node_fs = require('node:fs');
6
+ const findCacheDir = require('@visulima/find-cache-dir');
7
+ const node_https = require('node:https');
8
+
9
+ var __defProp$4 = Object.defineProperty;
10
+ var __name$4 = (target, value) => __defProp$4(target, "name", { value, configurable: true });
11
+ const semverGt = /* @__PURE__ */ __name$4((version1, version2) => {
12
+ const v1Components = version1.split(".").map(Number);
13
+ const v2Components = version2.split(".").map(Number);
14
+ for (const [index, v1Component] of v1Components.entries()) {
15
+ if (v1Component > v2Components[index]) {
16
+ return true;
17
+ }
18
+ if (v1Component < v2Components[index]) {
19
+ return false;
20
+ }
21
+ }
22
+ return false;
23
+ }, "semverGt");
24
+
25
+ var __defProp$3 = Object.defineProperty;
26
+ var __name$3 = (target, value) => __defProp$3(target, "name", { value, configurable: true });
27
+ var $t = Object.defineProperty;
28
+ var Z = /* @__PURE__ */ __name$3((r, i) => $t(r, "name", { value: i, configurable: true }), "Z");
29
+ var bt = Object.defineProperty;
30
+ var vt = Z((r, i) => bt(r, "name", { value: i, configurable: true }), "t");
31
+ const yt = /^[A-Z]:\//i;
32
+ const w = vt((r = "") => r && r.replaceAll("\\", "/").replace(yt, (i) => i.toUpperCase()), "normalizeWindowsPath");
33
+ var At = Object.defineProperty;
34
+ var s = Z((r, i) => At(r, "name", { value: i, configurable: true }), "u$1");
35
+ let ie = s(() => {
36
+ var r = (() => {
37
+ var i = Object.defineProperty, a = Object.getOwnPropertyDescriptor, p = Object.getOwnPropertyNames, h = Object.prototype.hasOwnProperty, x = s((e, t) => {
38
+ for (var n in t) i(e, n, { get: t[n], enumerable: true });
39
+ }, "q"), A = s((e, t, n, o) => {
40
+ if (t && typeof t == "object" || typeof t == "function") for (let l of p(t)) !h.call(e, l) && l !== n && i(e, l, { get: s(() => t[l], "get"), enumerable: !(o = a(t, l)) || o.enumerable });
41
+ return e;
42
+ }, "H"), g = s((e) => A(i({}, "__esModule", { value: true }), e), "J"), M = {};
43
+ x(M, { zeptomatch: s(() => xt, "zeptomatch") });
44
+ var G = s((e) => Array.isArray(e), "A"), O = s((e) => typeof e == "function", "d"), pe = s((e) => e.length === 0, "Q"), fe = s((e) => typeof e == "number", "W"), he = s((e) => typeof e == "object" && e !== null, "K"), de = s((e) => e instanceof RegExp, "X"), L = s((e) => typeof e == "string", "b"), j = s((e) => e === undefined, "h"), ge = s((e) => {
45
+ const t = /* @__PURE__ */ new Map();
46
+ return (n) => {
47
+ const o = t.get(n);
48
+ if (o) return o;
49
+ const l = e(n);
50
+ return t.set(n, l), l;
51
+ };
52
+ }, "Y"), xe = s((e, t, n = {}) => {
53
+ const o = { cache: {}, input: e, index: 0, indexMax: 0, options: n, output: [] };
54
+ if (y(t)(o) && o.index === e.length) return o.output;
55
+ throw new Error(`Failed to parse at index ${o.indexMax}`);
56
+ }, "rr"), u = s((e, t) => G(e) ? me(e, t) : L(e) ? be(e, t) : $e(e, t), "i"), me = s((e, t) => {
57
+ const n = {};
58
+ for (const o of e) {
59
+ if (o.length !== 1) throw new Error(`Invalid character: "${o}"`);
60
+ const l = o.charCodeAt(0);
61
+ n[l] = true;
62
+ }
63
+ return (o) => {
64
+ const l = o.index, c = o.input;
65
+ for (; o.index < c.length && c.charCodeAt(o.index) in n; ) o.index += 1;
66
+ const f = o.index;
67
+ if (f > l) {
68
+ if (!j(t) && !o.options.silent) {
69
+ const m = o.input.slice(l, f), $ = O(t) ? t(m, c, String(l)) : t;
70
+ j($) || o.output.push($);
71
+ }
72
+ o.indexMax = Math.max(o.indexMax, o.index);
73
+ }
74
+ return true;
75
+ };
76
+ }, "er"), $e = s((e, t) => {
77
+ const n = e.source, o = e.flags.replace(/y|$/, "y"), l = new RegExp(n, o);
78
+ return S((c) => {
79
+ l.lastIndex = c.index;
80
+ const f = l.exec(c.input);
81
+ if (f) {
82
+ if (!j(t) && !c.options.silent) {
83
+ const m = O(t) ? t(...f, c.input, String(c.index)) : t;
84
+ j(m) || c.output.push(m);
85
+ }
86
+ return c.index += f[0].length, c.indexMax = Math.max(c.indexMax, c.index), true;
87
+ } else return false;
88
+ });
89
+ }, "nr"), be = s((e, t) => (n) => {
90
+ if (n.input.startsWith(e, n.index)) {
91
+ if (!j(t) && !n.options.silent) {
92
+ const o = O(t) ? t(e, n.input, String(n.index)) : t;
93
+ j(o) || n.output.push(o);
94
+ }
95
+ return n.index += e.length, n.indexMax = Math.max(n.indexMax, n.index), true;
96
+ } else return false;
97
+ }, "tr"), T = s((e, t, n, o) => {
98
+ const l = y(e);
99
+ return S(E(U((c) => {
100
+ let f = 0;
101
+ for (; f < n; ) {
102
+ const m = c.index;
103
+ if (!l(c) || (f += 1, c.index === m)) break;
104
+ }
105
+ return f >= t;
106
+ }), o));
107
+ }, "C"), ve = s((e, t) => T(e, 0, 1, t), "ar"), _ = s((e, t) => T(e, 0, 1 / 0, t), "f"), P = s((e, t) => {
108
+ const n = e.map(y);
109
+ return S(E(U((o) => {
110
+ for (let l = 0, c = n.length; l < c; l++) if (!n[l](o)) return false;
111
+ return true;
112
+ }), t));
113
+ }, "x"), b = s((e, t) => {
114
+ const n = e.map(y);
115
+ return S(E((o) => {
116
+ for (let l = 0, c = n.length; l < c; l++) if (n[l](o)) return true;
117
+ return false;
118
+ }, t));
119
+ }, "l"), U = s((e, t = false) => {
120
+ const n = y(e);
121
+ return (o) => {
122
+ const l = o.index, c = o.output.length, f = n(o);
123
+ return (!f || t) && (o.index = l, o.output.length !== c && (o.output.length = c)), f;
124
+ };
125
+ }, "M"), E = s((e, t) => {
126
+ const n = y(e);
127
+ return t ? (o) => {
128
+ if (o.options.silent) return n(o);
129
+ const l = o.output.length;
130
+ if (n(o)) {
131
+ const c = o.output.splice(l, 1 / 0), f = t(c);
132
+ return j(f) || o.output.push(f), true;
133
+ } else return false;
134
+ } : n;
135
+ }, "_"), S = /* @__PURE__ */ (() => {
136
+ let e = 0;
137
+ return (t) => {
138
+ const n = y(t), o = e += 1;
139
+ return (l) => {
140
+ var c;
141
+ if (l.options.memoization === false) return n(l);
142
+ const f = l.index, m = (c = l.cache)[o] || (c[o] = /* @__PURE__ */ new Map()), $ = m.get(f);
143
+ if ($ === false) return false;
144
+ if (fe($)) return l.index = $, true;
145
+ if ($) return l.index = $.index, $.output?.length && l.output.push(...$.output), true;
146
+ {
147
+ const ne = l.output.length;
148
+ if (n(l)) {
149
+ const re = l.index, oe = l.output.length;
150
+ if (oe > ne) {
151
+ const mt = l.output.slice(ne, oe);
152
+ m.set(f, { index: re, output: mt });
153
+ } else m.set(f, re);
154
+ return true;
155
+ } else return m.set(f, false), false;
156
+ }
157
+ };
158
+ };
159
+ })(), B = s((e) => {
160
+ let t;
161
+ return (n) => (t || (t = y(e())), t(n));
162
+ }, "E"), y = ge((e) => {
163
+ if (O(e)) return pe(e) ? B(e) : e;
164
+ if (L(e) || de(e)) return u(e);
165
+ if (G(e)) return P(e);
166
+ if (he(e)) return b(Object.values(e));
167
+ throw new Error("Invalid rule");
168
+ }), D = "abcdefghijklmnopqrstuvwxyz", ye = s((e) => {
169
+ let t = "";
170
+ for (; e > 0; ) {
171
+ const n = (e - 1) % 26;
172
+ t = D[n] + t, e = Math.floor((e - 1) / 26);
173
+ }
174
+ return t;
175
+ }, "ir"), F = s((e) => {
176
+ let t = 0;
177
+ for (let n = 0, o = e.length; n < o; n++) t = t * 26 + D.indexOf(e[n]) + 1;
178
+ return t;
179
+ }, "z"), I = s((e, t) => {
180
+ if (t < e) return I(t, e);
181
+ const n = [];
182
+ for (; e <= t; ) n.push(e++);
183
+ return n;
184
+ }, "S"), Ae = s((e, t, n) => I(e, t).map((o) => String(o).padStart(n, "0")), "or"), H = s((e, t) => I(F(e), F(t)).map(ye), "O"), v = s((e) => e, "p"), J = s((e) => je((t) => xe(t, e, { memoization: false }).join("")), "R"), je = s((e) => {
185
+ const t = {};
186
+ return (n) => t[n] ?? (t[n] = e(n));
187
+ }, "ur"), we = u(/^\*\*\/\*$/, ".*"), ze = u(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (e, t, n) => `.*${t ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), Me = u(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (e, t, n, o) => `.*${t ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${o.replaceAll(",", "|").replaceAll(".", "\\.")})`), W = u(/\\./, v), Oe = u(/[$.*+?^(){}[\]\|]/, (e) => `\\${e}`), _e = u(/./, v), Pe = u(/^(?:!!)*!(.*)$/, (e, t) => `(?!^${te(t)}$).*?`), Se = u(/^(!!)+/, ""), Ze = b([Pe, Se]), Ce = u(/\/(\*\*\/)+/, "(?:/.+/|/)"), Ee = u(/^(\*\*\/)+/, "(?:^|.*/)"), Ie = u(/\/(\*\*)$/, "(?:/.*|$)"), We = u(/\*\*/, ".*"), K = b([Ce, Ee, Ie, We]), ke = u(/\*\/(?!\*\*\/)/, "[^/]*/"), Re = u(/\*/, "[^/]*"), Q = b([ke, Re]), X = u("?", "[^/]"), Ne = u("[", v), qe = u("]", v), Ge = u(/[!^]/, "^/"), Le = u(/[a-z]-[a-z]|[0-9]-[0-9]/i, v), Te = u(/[$.*+?^(){}[\|]/, (e) => `\\${e}`), Ue = u(/[^\]]/, v), Be = b([W, Te, Le, Ue]), Y = P([Ne, ve(Ge), _(Be), qe]), De = u("{", "(?:"), Fe = u("}", ")"), He = u(/(\d+)\.\.(\d+)/, (e, t, n) => Ae(+t, +n, Math.min(t.length, n.length)).join("|")), Je = u(/([a-z]+)\.\.([a-z]+)/, (e, t, n) => H(t, n).join("|")), Ke = u(/([A-Z]+)\.\.([A-Z]+)/, (e, t, n) => H(t.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Qe = b([He, Je, Ke]), V = P([De, Qe, Fe]), Xe = u("{", "(?:"), Ye = u("}", ")"), Ve = u(",", "|"), et = u(/[$.*+?^(){[\]\|]/, (e) => `\\${e}`), tt = u(/[^}]/, v), nt = B(() => ee), rt = b([K, Q, X, Y, V, nt, W, et, Ve, tt]), ee = P([Xe, _(rt), Ye]), ot = _(b([we, ze, Me, Ze, K, Q, X, Y, V, ee, W, Oe, _e])), it = ot, at = J(it), te = at, lt = u(/\\./, v), st = u(/./, v), ut = u(/\*\*\*+/, "*"), ct = u(/([^/{[(!])\*\*/, (e, t) => `${t}*`), pt = u(/(^|.)\*\*(?=[^*/)\]}])/, (e, t) => `${t}*`), ft = _(b([lt, ut, ct, pt, st])), ht = ft, dt = J(ht), gt = dt, k = s((e, t) => {
188
+ const n = Array.isArray(e) ? e : [e];
189
+ if (!n.length) return false;
190
+ const o = n.map(k.compile), l = n.every((f) => /(\/(?:\*\*)?|\[\/\])$/.test(f)), c = t.replace(/[\\\/]+/g, "/").replace(/\/$/, l ? "/" : "");
191
+ return o.some((f) => f.test(c));
192
+ }, "$");
193
+ k.compile = (e) => new RegExp(`^${te(gt(e))}$`, "s");
194
+ var xt = k;
195
+ return g(M);
196
+ })();
197
+ return r.default || r;
198
+ }, "_lazyMatch");
199
+ let R;
200
+ const jt = s((r, i) => (R || (R = ie(), ie = null), R(r, i)), "default");
201
+ var wt = Object.defineProperty;
202
+ var d = Z((r, i) => wt(r, "name", { value: i, configurable: true }), "r");
203
+ const zt = /^[/\\]{2}/;
204
+ const Mt = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i;
205
+ const le = /^[A-Z]:$/i;
206
+ const ae = /^\/([A-Z]:)?$/i;
207
+ const Ot = /.(\.[^./]+)$/;
208
+ const _t = /^[/\\]|^[a-z]:[/\\]/i;
209
+ const Pt = d(() => typeof process.cwd == "function" ? process.cwd().replaceAll("\\", "/") : "/", "cwd");
210
+ const N = d((r, i) => {
211
+ let a = "", p = 0, h = -1, x = 0, A = null;
212
+ for (let g = 0; g <= r.length; ++g) {
213
+ if (g < r.length) A = r[g];
214
+ else {
215
+ if (A === "/") break;
216
+ A = "/";
217
+ }
218
+ if (A === "/") {
219
+ if (!(h === g - 1 || x === 1)) if (x === 2) {
220
+ if (a.length < 2 || p !== 2 || !a.endsWith(".") || a.at(-2) !== ".") {
221
+ if (a.length > 2) {
222
+ const M = a.lastIndexOf("/");
223
+ M === -1 ? (a = "", p = 0) : (a = a.slice(0, M), p = a.length - 1 - a.lastIndexOf("/")), h = g, x = 0;
224
+ continue;
225
+ } else if (a.length > 0) {
226
+ a = "", p = 0, h = g, x = 0;
227
+ continue;
228
+ }
229
+ }
230
+ i && (a += a.length > 0 ? "/.." : "..", p = 2);
231
+ } else a.length > 0 ? a += `/${r.slice(h + 1, g)}` : a = r.slice(h + 1, g), p = g - h - 1;
232
+ h = g, x = 0;
233
+ } else A === "." && x !== -1 ? ++x : x = -1;
234
+ }
235
+ return a;
236
+ }, "normalizeString");
237
+ const z = d((r) => Mt.test(r), "isAbsolute");
238
+ const q = d(function(r) {
239
+ if (r.length === 0) return ".";
240
+ r = w(r);
241
+ const i = zt.exec(r), a = z(r), p = r.at(-1) === "/";
242
+ return r = N(r, !a), r.length === 0 ? a ? "/" : p ? "./" : "." : (p && (r += "/"), le.test(r) && (r += "/"), i ? a ? `//${r}` : `//./${r}` : a && !z(r) ? `/${r}` : r);
243
+ }, "normalize");
244
+ const Ct = d((...r) => {
245
+ let i = "";
246
+ for (const a of r) if (a) if (i.length > 0) {
247
+ const p = i[i.length - 1] === "/", h = a[0] === "/";
248
+ p && h ? i += a.slice(1) : i += p || h ? a : `/${a}`;
249
+ } else i += a;
250
+ return q(i);
251
+ }, "join");
252
+ const C = d(function(...r) {
253
+ r = r.map((p) => w(p));
254
+ let i = "", a = false;
255
+ for (let p = r.length - 1; p >= -1 && !a; p--) {
256
+ const h = p >= 0 ? r[p] : Pt();
257
+ !h || h.length === 0 || (i = `${h}/${i}`, a = z(h));
258
+ }
259
+ return i = N(i, !a), a && !z(i) ? `/${i}` : i.length > 0 ? i : ".";
260
+ }, "resolve");
261
+ d(function(r) {
262
+ return w(r);
263
+ }, "toNamespacedPath");
264
+ const se = d(function(r) {
265
+ return Ot.exec(w(r))?.[1] ?? "";
266
+ }, "extname");
267
+ d(function(r, i) {
268
+ const a = C(r).replace(ae, "$1").split("/"), p = C(i).replace(ae, "$1").split("/");
269
+ if (p[0][1] === ":" && a[0][1] === ":" && a[0] !== p[0]) return p.join("/");
270
+ const h = [...a];
271
+ for (const x of h) {
272
+ if (p[0] !== x) break;
273
+ a.shift(), p.shift();
274
+ }
275
+ return [...a.map(() => ".."), ...p].join("/");
276
+ }, "relative");
277
+ const ue = d((r) => {
278
+ const i = w(r).replace(/\/$/, "").split("/").slice(0, -1);
279
+ return i.length === 1 && le.test(i[0]) && (i[0] += "/"), i.join("/") || (z(r) ? "/" : ".");
280
+ }, "dirname");
281
+ d(function(r) {
282
+ const i = [r.root, r.dir, r.base ?? r.name + r.ext].filter(Boolean);
283
+ return w(r.root ? C(...i) : i.join("/"));
284
+ }, "format");
285
+ const ce = d((r, i) => {
286
+ const a = w(r).split("/").pop();
287
+ return i && a.endsWith(i) ? a.slice(0, -i.length) : a;
288
+ }, "basename");
289
+ d(function(r) {
290
+ const i = _t.exec(r)?.[0]?.replace(/\\/g, "/") ?? "", a = ce(r), p = se(a);
291
+ return { base: a, dir: ue(r), ext: p, name: a.slice(0, a.length - p.length), root: i };
292
+ }, "parse");
293
+ d((r, i) => jt(i, q(r)), "matchesGlob");
294
+
295
+ var __defProp$2 = Object.defineProperty;
296
+ var __name$2 = (target, value) => __defProp$2(target, "name", { value, configurable: true });
297
+ const FILE_NAME = "last-update-check.json";
298
+ const getConfigFile = /* @__PURE__ */ __name$2((packageName) => {
299
+ const cacheDirectory = findCacheDir.findCacheDirSync(packageName);
300
+ if (cacheDirectory === undefined) {
301
+ throw new Error("Could not find cache directory");
302
+ }
303
+ return Ct(cacheDirectory, FILE_NAME);
304
+ }, "getConfigFile");
305
+ const getLastUpdate = /* @__PURE__ */ __name$2((packageName) => {
306
+ const configFile = getConfigFile(packageName);
307
+ try {
308
+ if (!node_fs.existsSync(configFile)) {
309
+ return undefined;
310
+ }
311
+ const { lastUpdateCheck } = JSON.parse(node_fs.readFileSync(configFile, "utf8"));
312
+ return lastUpdateCheck;
313
+ } catch {
314
+ return undefined;
315
+ }
316
+ }, "getLastUpdate");
317
+ const saveLastUpdate = /* @__PURE__ */ __name$2((packageName) => {
318
+ const configFile = getConfigFile(packageName);
319
+ const configDirectory = ue(configFile);
320
+ if (!node_fs.existsSync(configDirectory)) {
321
+ node_fs.mkdirSync(configDirectory, { recursive: true });
322
+ }
323
+ node_fs.writeFileSync(configFile, JSON.stringify({ lastUpdateCheck: Date.now() }));
324
+ }, "saveLastUpdate");
325
+
326
+ var __defProp$1 = Object.defineProperty;
327
+ var __name$1 = (target, value) => __defProp$1(target, "name", { value, configurable: true });
328
+ const getDistributionVersion = /* @__PURE__ */ __name$1(async (packageName, distributionTag, registryUrl) => {
329
+ const url = registryUrl.replace("__NAME__", packageName);
330
+ return await new Promise((resolve, reject) => {
331
+ node_https.get(url, (message) => {
332
+ let body = "";
333
+ message.on("data", (chunk) => body += chunk);
334
+ message.on("end", () => {
335
+ try {
336
+ const json = JSON.parse(body);
337
+ const version = json[distributionTag];
338
+ if (!version) {
339
+ reject(new Error("Error getting version"));
340
+ }
341
+ resolve(version);
342
+ } catch {
343
+ reject(new Error("Could not parse version response"));
344
+ }
345
+ });
346
+ }).on("error", (error) => reject(error));
347
+ });
348
+ }, "getDistributionVersion");
349
+
350
+ var __defProp = Object.defineProperty;
351
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
352
+ const hasNewVersion = /* @__PURE__ */ __name(async ({
353
+ alwaysRun,
354
+ debug,
355
+ distTag: distributionTag = "latest",
356
+ pkg,
357
+ registryUrl = "https://registry.npmjs.org/-/package/__NAME__/dist-tags",
358
+ updateCheckInterval = 1e3 * 60 * 60 * 24
359
+ }) => {
360
+ const lastUpdateCheck = getLastUpdate(pkg.name);
361
+ if (alwaysRun || !lastUpdateCheck || lastUpdateCheck < Date.now() - updateCheckInterval) {
362
+ const latestVersion = await getDistributionVersion(pkg.name, distributionTag, registryUrl);
363
+ saveLastUpdate(pkg.name);
364
+ if (semverGt(latestVersion, pkg.version)) {
365
+ return latestVersion;
366
+ }
367
+ if (debug) {
368
+ console.error(`Latest version (${latestVersion}) not newer than current version (${pkg.version})`);
369
+ }
370
+ } else if (debug) {
371
+ console.error(
372
+ `Too recent to check for a new update. simpleUpdateNotifier() interval set to ${updateCheckInterval}ms but only ${Date.now() - lastUpdateCheck}ms since last check.`
373
+ );
374
+ }
375
+ return null;
376
+ }, "hasNewVersion");
377
+
378
+ exports.default = hasNewVersion;