@visulima/packem 1.18.0 → 1.18.2

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.
@@ -0,0 +1 @@
1
+ var S=Object.defineProperty;var f=(s,e)=>S(s,"name",{value:e,configurable:!0});function $(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}f($,"getDefaultExportFromCjs");var T={exports:{}},P;function q(){return P||(P=1,function(s){var e=Object.defineProperty,t=f((r,n)=>e(r,"name",{value:n,configurable:!0}),"c"),h=Object.prototype.hasOwnProperty,a="~";function u(){}f(u,"Events"),t(u,"Events"),Object.create&&(u.prototype=Object.create(null),new u().__proto__||(a=!1));function m(r,n,i){this.fn=r,this.context=n,this.once=i||!1}f(m,"EE"),t(m,"EE");function E(r,n,i,d,y){if(typeof i!="function")throw new TypeError("The listener must be a function");var p=new m(i,d||r,y),v=a?a+n:n;return r._events[v]?r._events[v].fn?r._events[v]=[r._events[v],p]:r._events[v].push(p):(r._events[v]=p,r._eventsCount++),r}f(E,"addListener"),t(E,"addListener");function b(r,n){--r._eventsCount===0?r._events=new u:delete r._events[n]}f(b,"clearEvent"),t(b,"clearEvent");function c(){this._events=new u,this._eventsCount=0}f(c,"EventEmitter"),t(c,"EventEmitter"),c.prototype.eventNames=t(function(){var r=[],n,i;if(this._eventsCount===0)return r;for(i in n=this._events)h.call(n,i)&&r.push(a?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n)):r},"eventNames"),c.prototype.listeners=t(function(r){var n=a?a+r:r,i=this._events[n];if(!i)return[];if(i.fn)return[i.fn];for(var d=0,y=i.length,p=new Array(y);d<y;d++)p[d]=i[d].fn;return p},"listeners"),c.prototype.listenerCount=t(function(r){var n=a?a+r:r,i=this._events[n];return i?i.fn?1:i.length:0},"listenerCount"),c.prototype.emit=t(function(r,n,i,d,y,p){var v=a?a+r:r;if(!this._events[v])return!1;var o=this._events[v],g=arguments.length,w,l;if(o.fn){switch(o.once&&this.removeListener(r,o.fn,void 0,!0),g){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,n),!0;case 3:return o.fn.call(o.context,n,i),!0;case 4:return o.fn.call(o.context,n,i,d),!0;case 5:return o.fn.call(o.context,n,i,d,y),!0;case 6:return o.fn.call(o.context,n,i,d,y,p),!0}for(l=1,w=new Array(g-1);l<g;l++)w[l-1]=arguments[l];o.fn.apply(o.context,w)}else{var j=o.length,x;for(l=0;l<j;l++)switch(o[l].once&&this.removeListener(r,o[l].fn,void 0,!0),g){case 1:o[l].fn.call(o[l].context);break;case 2:o[l].fn.call(o[l].context,n);break;case 3:o[l].fn.call(o[l].context,n,i);break;case 4:o[l].fn.call(o[l].context,n,i,d);break;default:if(!w)for(x=1,w=new Array(g-1);x<g;x++)w[x-1]=arguments[x];o[l].fn.apply(o[l].context,w)}}return!0},"emit"),c.prototype.on=t(function(r,n,i){return E(this,r,n,i,!1)},"on"),c.prototype.once=t(function(r,n,i){return E(this,r,n,i,!0)},"once"),c.prototype.removeListener=t(function(r,n,i,d){var y=a?a+r:r;if(!this._events[y])return this;if(!n)return b(this,y),this;var p=this._events[y];if(p.fn)p.fn===n&&(!d||p.once)&&(!i||p.context===i)&&b(this,y);else{for(var v=0,o=[],g=p.length;v<g;v++)(p[v].fn!==n||d&&!p[v].once||i&&p[v].context!==i)&&o.push(p[v]);o.length?this._events[y]=o.length===1?o[0]:o:b(this,y)}return this},"removeListener"),c.prototype.removeAllListeners=t(function(r){var n;return r?(n=a?a+r:r,this._events[n]&&b(this,n)):(this._events=new u,this._eventsCount=0),this},"removeAllListeners"),c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=a,c.EventEmitter=c,s.exports=c}(T)),T.exports}f(q,"requireEventemitter3");var A=q();const D=$(A);var F=Object.defineProperty,_=f((s,e)=>F(s,"name",{value:e,configurable:!0}),"o$1");class N extends Error{static{f(this,"TimeoutError")}static{_(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}}class M extends Error{static{f(this,"AbortError")}static{_(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}}const I=_(s=>globalThis.DOMException===void 0?new M(s):new DOMException(s),"getDOMException"),O=_(s=>{const e=s.reason===void 0?I("This operation was aborted."):s.reason;return e instanceof Error?e:I(e)},"getAbortedReason");function L(s,e){const{milliseconds:t,fallback:h,message:a,customTimers:u={setTimeout,clearTimeout}}=e;let m;const E=new Promise((b,c)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){const{signal:n}=e;n.aborted&&c(O(n));const i=_(()=>{c(O(n))},"abortHandler");n.addEventListener("abort",i,{once:!0}),s.finally(()=>{n.removeEventListener("abort",i)})}if(t===Number.POSITIVE_INFINITY){s.then(b,c);return}const r=new N;m=u.setTimeout.call(void 0,()=>{if(h){try{b(h())}catch(n){c(n)}return}typeof s.cancel=="function"&&s.cancel(),a===!1?b():a instanceof Error?c(a):(r.message=a??`Promise timed out after ${t} milliseconds`,c(r))},t),(async()=>{try{b(await s)}catch(n){c(n)}})()}).finally(()=>{E.clear()});return E.clear=()=>{u.clearTimeout.call(void 0,m),m=void 0},E}f(L,"T");_(L,"pTimeout");var k=Object.defineProperty,V=f((s,e)=>k(s,"name",{value:e,configurable:!0}),"i");function z(s,e,t){let h=0,a=s.length;for(;a>0;){const u=Math.trunc(a/2);let m=h+u;t(s[m],e)<=0?(h=++m,a-=u+1):a=u}return h}f(z,"r");V(z,"lowerBound");var Y=Object.defineProperty,R=f((s,e)=>Y(s,"name",{value:e,configurable:!0}),"n$1");class B{static{f(this,"y")}static{R(this,"PriorityQueue")}#e=[];enqueue(e,t){t={priority:0,...t};const h={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(h);return}const a=z(this.#e,h,(u,m)=>m.priority-u.priority);this.#e.splice(a,0,h)}setPriority(e,t){const h=this.#e.findIndex(u=>u.id===e);if(h===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[a]=this.#e.splice(h,1);this.enqueue(a.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}}var Q=Object.defineProperty,C=f((s,e)=>Q(s,"name",{value:e,configurable:!0}),"n");class G extends D{static{f(this,"d")}static{C(this,"PQueue")}#e;#o;#s=0;#p;#a;#v=0;#r;#u;#t;#m;#n=0;#c;#i;#d;#g=1n;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:B,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#o=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#p=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#d=e.throwOnTimeout===!0,this.#i=e.autoStart===!1}get#E(){return this.#o||this.#s<this.#p}get#w(){return this.#n<this.#c}#_(){this.#n--,this.#h(),this.emit("next")}#x(){this.#b(),this.#y(),this.#u=void 0}get#T(){const e=Date.now();if(this.#r===void 0){const t=this.#v-e;if(t<0)this.#s=this.#e?this.#n:0;else return this.#u===void 0&&(this.#u=setTimeout(()=>{this.#x()},t)),!0}return!1}#h(){if(this.#t.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#i){const e=!this.#T;if(this.#E&&this.#w){const t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#o||this.#r!==void 0||(this.#r=setInterval(()=>{this.#b()},this.#a),this.#v=Date.now()+this.#a)}#b(){this.#s===0&&this.#n===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#s=this.#e?this.#n:0,this.#l()}#l(){for(;this.#h(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#l()}async#P(e){return new Promise((t,h)=>{e.addEventListener("abort",()=>{h(e.reason)},{once:!0})})}setPriority(e,t){this.#t.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#g++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#d,...t},new Promise((h,a)=>{this.#t.enqueue(async()=>{this.#n++,this.#s++;try{t.signal?.throwIfAborted();let u=e({signal:t.signal});t.timeout&&(u=L(Promise.resolve(u),{milliseconds:t.timeout})),t.signal&&(u=Promise.race([u,this.#P(t.signal)]));const m=await u;h(m),this.emit("completed",m)}catch(u){if(u instanceof N&&!t.throwOnTimeout){h();return}a(u),this.emit("error",u)}finally{this.#_()}},t),this.emit("add"),this.#h()})}async addAll(e,t){return Promise.all(e.map(async h=>this.add(h,t)))}start(){return this.#i?(this.#i=!1,this.#l(),this):this}pause(){this.#i=!0}clear(){this.#t=new this.#m}async onEmpty(){this.#t.size!==0&&await this.#f("empty")}async onSizeLessThan(e){this.#t.size<e||await this.#f("next",()=>this.#t.size<e)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#f("idle")}async#f(e,t){return new Promise(h=>{const a=C(()=>{t&&!t()||(this.off(e,a),h())},"listener");this.on(e,a)})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#i}}export{G as d,$ as g};
@@ -0,0 +1 @@
1
+ "use strict";var $=Object.defineProperty;var f=(s,e)=>$(s,"name",{value:e,configurable:!0});function N(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}f(N,"getDefaultExportFromCjs");var T={exports:{}},P;function q(){return P||(P=1,function(s){var e=Object.defineProperty,t=f((r,n)=>e(r,"name",{value:n,configurable:!0}),"c"),h=Object.prototype.hasOwnProperty,a="~";function u(){}f(u,"Events"),t(u,"Events"),Object.create&&(u.prototype=Object.create(null),new u().__proto__||(a=!1));function m(r,n,i){this.fn=r,this.context=n,this.once=i||!1}f(m,"EE"),t(m,"EE");function E(r,n,i,d,y){if(typeof i!="function")throw new TypeError("The listener must be a function");var p=new m(i,d||r,y),v=a?a+n:n;return r._events[v]?r._events[v].fn?r._events[v]=[r._events[v],p]:r._events[v].push(p):(r._events[v]=p,r._eventsCount++),r}f(E,"addListener"),t(E,"addListener");function b(r,n){--r._eventsCount===0?r._events=new u:delete r._events[n]}f(b,"clearEvent"),t(b,"clearEvent");function c(){this._events=new u,this._eventsCount=0}f(c,"EventEmitter"),t(c,"EventEmitter"),c.prototype.eventNames=t(function(){var r=[],n,i;if(this._eventsCount===0)return r;for(i in n=this._events)h.call(n,i)&&r.push(a?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n)):r},"eventNames"),c.prototype.listeners=t(function(r){var n=a?a+r:r,i=this._events[n];if(!i)return[];if(i.fn)return[i.fn];for(var d=0,y=i.length,p=new Array(y);d<y;d++)p[d]=i[d].fn;return p},"listeners"),c.prototype.listenerCount=t(function(r){var n=a?a+r:r,i=this._events[n];return i?i.fn?1:i.length:0},"listenerCount"),c.prototype.emit=t(function(r,n,i,d,y,p){var v=a?a+r:r;if(!this._events[v])return!1;var o=this._events[v],g=arguments.length,w,l;if(o.fn){switch(o.once&&this.removeListener(r,o.fn,void 0,!0),g){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,n),!0;case 3:return o.fn.call(o.context,n,i),!0;case 4:return o.fn.call(o.context,n,i,d),!0;case 5:return o.fn.call(o.context,n,i,d,y),!0;case 6:return o.fn.call(o.context,n,i,d,y,p),!0}for(l=1,w=new Array(g-1);l<g;l++)w[l-1]=arguments[l];o.fn.apply(o.context,w)}else{var S=o.length,x;for(l=0;l<S;l++)switch(o[l].once&&this.removeListener(r,o[l].fn,void 0,!0),g){case 1:o[l].fn.call(o[l].context);break;case 2:o[l].fn.call(o[l].context,n);break;case 3:o[l].fn.call(o[l].context,n,i);break;case 4:o[l].fn.call(o[l].context,n,i,d);break;default:if(!w)for(x=1,w=new Array(g-1);x<g;x++)w[x-1]=arguments[x];o[l].fn.apply(o[l].context,w)}}return!0},"emit"),c.prototype.on=t(function(r,n,i){return E(this,r,n,i,!1)},"on"),c.prototype.once=t(function(r,n,i){return E(this,r,n,i,!0)},"once"),c.prototype.removeListener=t(function(r,n,i,d){var y=a?a+r:r;if(!this._events[y])return this;if(!n)return b(this,y),this;var p=this._events[y];if(p.fn)p.fn===n&&(!d||p.once)&&(!i||p.context===i)&&b(this,y);else{for(var v=0,o=[],g=p.length;v<g;v++)(p[v].fn!==n||d&&!p[v].once||i&&p[v].context!==i)&&o.push(p[v]);o.length?this._events[y]=o.length===1?o[0]:o:b(this,y)}return this},"removeListener"),c.prototype.removeAllListeners=t(function(r){var n;return r?(n=a?a+r:r,this._events[n]&&b(this,n)):(this._events=new u,this._eventsCount=0),this},"removeAllListeners"),c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=a,c.EventEmitter=c,s.exports=c}(T)),T.exports}f(q,"requireEventemitter3");var A=q();const D=N(A);var F=Object.defineProperty,_=f((s,e)=>F(s,"name",{value:e,configurable:!0}),"o$1");class L extends Error{static{f(this,"TimeoutError")}static{_(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}}class M extends Error{static{f(this,"AbortError")}static{_(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}}const I=_(s=>globalThis.DOMException===void 0?new M(s):new DOMException(s),"getDOMException"),O=_(s=>{const e=s.reason===void 0?I("This operation was aborted."):s.reason;return e instanceof Error?e:I(e)},"getAbortedReason");function z(s,e){const{milliseconds:t,fallback:h,message:a,customTimers:u={setTimeout,clearTimeout}}=e;let m;const E=new Promise((b,c)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){const{signal:n}=e;n.aborted&&c(O(n));const i=_(()=>{c(O(n))},"abortHandler");n.addEventListener("abort",i,{once:!0}),s.finally(()=>{n.removeEventListener("abort",i)})}if(t===Number.POSITIVE_INFINITY){s.then(b,c);return}const r=new L;m=u.setTimeout.call(void 0,()=>{if(h){try{b(h())}catch(n){c(n)}return}typeof s.cancel=="function"&&s.cancel(),a===!1?b():a instanceof Error?c(a):(r.message=a??`Promise timed out after ${t} milliseconds`,c(r))},t),(async()=>{try{b(await s)}catch(n){c(n)}})()}).finally(()=>{E.clear()});return E.clear=()=>{u.clearTimeout.call(void 0,m),m=void 0},E}f(z,"T");_(z,"pTimeout");var k=Object.defineProperty,V=f((s,e)=>k(s,"name",{value:e,configurable:!0}),"i");function j(s,e,t){let h=0,a=s.length;for(;a>0;){const u=Math.trunc(a/2);let m=h+u;t(s[m],e)<=0?(h=++m,a-=u+1):a=u}return h}f(j,"r");V(j,"lowerBound");var Y=Object.defineProperty,R=f((s,e)=>Y(s,"name",{value:e,configurable:!0}),"n$1");class B{static{f(this,"y")}static{R(this,"PriorityQueue")}#e=[];enqueue(e,t){t={priority:0,...t};const h={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(h);return}const a=j(this.#e,h,(u,m)=>m.priority-u.priority);this.#e.splice(a,0,h)}setPriority(e,t){const h=this.#e.findIndex(u=>u.id===e);if(h===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[a]=this.#e.splice(h,1);this.enqueue(a.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}}var Q=Object.defineProperty,C=f((s,e)=>Q(s,"name",{value:e,configurable:!0}),"n");class H extends D{static{f(this,"d")}static{C(this,"PQueue")}#e;#o;#s=0;#p;#a;#v=0;#r;#u;#t;#m;#n=0;#c;#i;#d;#g=1n;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:B,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#o=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#p=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#d=e.throwOnTimeout===!0,this.#i=e.autoStart===!1}get#E(){return this.#o||this.#s<this.#p}get#w(){return this.#n<this.#c}#_(){this.#n--,this.#h(),this.emit("next")}#x(){this.#b(),this.#y(),this.#u=void 0}get#T(){const e=Date.now();if(this.#r===void 0){const t=this.#v-e;if(t<0)this.#s=this.#e?this.#n:0;else return this.#u===void 0&&(this.#u=setTimeout(()=>{this.#x()},t)),!0}return!1}#h(){if(this.#t.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#i){const e=!this.#T;if(this.#E&&this.#w){const t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#o||this.#r!==void 0||(this.#r=setInterval(()=>{this.#b()},this.#a),this.#v=Date.now()+this.#a)}#b(){this.#s===0&&this.#n===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#s=this.#e?this.#n:0,this.#l()}#l(){for(;this.#h(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#l()}async#P(e){return new Promise((t,h)=>{e.addEventListener("abort",()=>{h(e.reason)},{once:!0})})}setPriority(e,t){this.#t.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#g++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#d,...t},new Promise((h,a)=>{this.#t.enqueue(async()=>{this.#n++,this.#s++;try{t.signal?.throwIfAborted();let u=e({signal:t.signal});t.timeout&&(u=z(Promise.resolve(u),{milliseconds:t.timeout})),t.signal&&(u=Promise.race([u,this.#P(t.signal)]));const m=await u;h(m),this.emit("completed",m)}catch(u){if(u instanceof L&&!t.throwOnTimeout){h();return}a(u),this.emit("error",u)}finally{this.#_()}},t),this.emit("add"),this.#h()})}async addAll(e,t){return Promise.all(e.map(async h=>this.add(h,t)))}start(){return this.#i?(this.#i=!1,this.#l(),this):this}pause(){this.#i=!0}clear(){this.#t=new this.#m}async onEmpty(){this.#t.size!==0&&await this.#f("empty")}async onSizeLessThan(e){this.#t.size<e||await this.#f("next",()=>this.#t.size<e)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#f("idle")}async#f(e,t){return new Promise(h=>{const a=C(()=>{t&&!t()||(this.off(e,a),h())},"listener");this.on(e,a)})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#i}}exports.d=H;exports.g=N;
@@ -1,4 +1,4 @@
1
- "use strict";var T=Object.defineProperty;var g=(e,t)=>T(e,"name",{value:t,configurable:!0});const w=require("node:url"),i=require("@visulima/path"),j=require("@visulima/path/utils"),x=require("../../../../../packem_shared/resolve-DSG4Zlek.cjs"),S=require("../../../../../packem_shared/url-DFE8cAA0.cjs"),D=require("@visulima/fs"),U=require("mlly"),q=require("../../../../../packem_shared/index-Tbl-mDsb.cjs");var F=Object.defineProperty,A=g((e,t)=>F(e,"name",{value:t,configurable:!0}),"s");const I=[".scss",".sass",".css"],M=["sass","style"],C=A((e,t,n)=>{const r=[],a=S.n(e);if(r.push(S.g(a),a),!S.h(e)&&!i.isAbsolute(e)&&!j.isRelative(e)){const o=S.n(`~${e}`);r.push(S.g(o),o)}const l={baseDirs:[i.dirname(t)],caller:"Sass importer",extensions:I,mainFields:M};return n(r,l)},"importerImpl"),z=A(e=>({file:e.replace(/\.css$/i,"")}),"finalize"),_=A((e,t)=>{try{return z(C(e,t,x.r))}catch{return null}},"importer");var k=Object.defineProperty,H=g((e,t)=>k(e,"name",{value:t,configurable:!0}),"e$1");const L=H(e=>{switch(e.toLowerCase()){case".scss":return"scss";case".sass":return"indented";case".css":return"css";default:return}},"resolveSyntax");var N=Object.defineProperty,W=g((e,t)=>N(e,"name",{value:t,configurable:!0}),"i$1");const J=[".scss",".sass",".css"],Z=["sass","style"],B=W((e,t)=>({canonicalize(n,r){const a=r.containingUrl?w.fileURLToPath(r.containingUrl.toString()):e;let l;const o=S.n(n),y=S.g(o);try{l=x.r([y,o],{baseDirs:[i.dirname(a)],caller:"Sass modern importer",extensions:J,mainFields:Z})}catch{return null}return new URL(U.pathToFileURL(l))},load(n){const r=i.extname(n.pathname),a=r?L(r.toLowerCase())??"scss":"scss";try{let l=D.readFileSync(n);return t&&(l="/* "+n.pathname+` */
1
+ "use strict";var T=Object.defineProperty;var g=(e,t)=>T(e,"name",{value:t,configurable:!0});const w=require("node:url"),i=require("@visulima/path"),j=require("@visulima/path/utils"),x=require("../../../../../packem_shared/resolve-DSG4Zlek.cjs"),S=require("../../../../../packem_shared/url-DFE8cAA0.cjs"),D=require("@visulima/fs"),U=require("mlly"),q=require("../../../../../packem_shared/index-CpIndRF3.cjs");var F=Object.defineProperty,A=g((e,t)=>F(e,"name",{value:t,configurable:!0}),"s");const I=[".scss",".sass",".css"],M=["sass","style"],C=A((e,t,n)=>{const r=[],a=S.n(e);if(r.push(S.g(a),a),!S.h(e)&&!i.isAbsolute(e)&&!j.isRelative(e)){const o=S.n(`~${e}`);r.push(S.g(o),o)}const l={baseDirs:[i.dirname(t)],caller:"Sass importer",extensions:I,mainFields:M};return n(r,l)},"importerImpl"),z=A(e=>({file:e.replace(/\.css$/i,"")}),"finalize"),_=A((e,t)=>{try{return z(C(e,t,x.r))}catch{return null}},"importer");var k=Object.defineProperty,H=g((e,t)=>k(e,"name",{value:t,configurable:!0}),"e$1");const L=H(e=>{switch(e.toLowerCase()){case".scss":return"scss";case".sass":return"indented";case".css":return"css";default:return}},"resolveSyntax");var N=Object.defineProperty,W=g((e,t)=>N(e,"name",{value:t,configurable:!0}),"i$1");const J=[".scss",".sass",".css"],Z=["sass","style"],B=W((e,t)=>({canonicalize(n,r){const a=r.containingUrl?w.fileURLToPath(r.containingUrl.toString()):e;let l;const o=S.n(n),y=S.g(o);try{l=x.r([y,o],{baseDirs:[i.dirname(a)],caller:"Sass modern importer",extensions:J,mainFields:Z})}catch{return null}return new URL(U.pathToFileURL(l))},load(n){const r=i.extname(n.pathname),a=r?L(r.toLowerCase())??"scss":"scss";try{let l=D.readFileSync(n);return t&&(l="/* "+n.pathname+` */
2
2
  `+l),{contents:l,sourceMapUrl:n,syntax:a}}catch{return null}}}),"importer");var V=Object.defineProperty,G=g((e,t)=>V(e,"name",{value:t,configurable:!0}),"a");let P;const K=G(async(e,t)=>{if(e.compileString!==void 0)return t==="modern"?n=>{const{data:r,...a}=n;return e.compileString(r,a)}:t==="modern-compiler"?n=>{const{data:r,...a}=n;return e.compileString(r,a)}:n=>e.renderSync(n);if(t==="modern"||t==="modern-compiler")throw new Error("Modern API is not supported for 'node-sass'");if(!P){const n=Number(process.env.UV_THREADPOOL_SIZE??4);P=new q.d({concurrency:n-1})}return async n=>await P.add(async()=>await new Promise((r,a)=>{e.render.bind(e)(n,(l,o)=>{if(l){a(l);return}r(o)})}))},"getCompileFunction");var Q=Object.defineProperty,R=g((e,t)=>Q(e,"name",{value:t,configurable:!0}),"o");const X=R(()=>{const e=["sass-embedded","sass","node-sass"];for(const t of e)try{return require.resolve(t),t}catch{}throw new Error("No supported Sass implementation found. Please install 'sass-embedded', 'sass', or 'node-sass'.")},"getDefaultSassImplementation"),Y=R(e=>{let t=e;typeof t=="string"&&(t=require(t));const{info:n=void 0}=t;if(!n)throw new Error(`Sass implementation is missing 'info' property. Implementation: ${JSON.stringify(t)}`);const r=n.split(" ");if(r.length<2)throw new Error(`Invalid Sass implementation info format. Expected at least 2 parts, got: "${n}".`);const[a]=r;if(a==="dart-sass"||a==="node-sass"||a==="sass-embedded")return t;throw new Error(`Unsupported Sass implementation: "${a}". Supported implementations are: dart-sass, node-sass, sass-embedded.`)},"getSassImplementation");var ee=Object.defineProperty,$=g((e,t)=>ee(e,"name",{value:t,configurable:!0}),"d");const te=$(async(e,t,n,r,a,l,o)=>{const{warnRuleAsWarning:y,...p}=r,s={...p,data:r.additionalData?typeof r.additionalData=="function"?await r.additionalData(a,e):`${r.additionalData}
3
3
  ${a}`:a};if(!s.logger){const m=y!==!1,v=$(d=>`Warning on line ${d.start.line}, column ${d.start.column} of ${d.url??"-"}:${d.start.line}:${d.start.column}:
4
4
  `,"formatSpan"),O=$(d=>`[debug:${d.start.line}:${d.start.column}] `,"formatDebugSpan");s.logger={debug(d,u){let f="";u.span&&(f=O(u.span)),f+=d,t.debug(f)},warn(d,u){let f="";if(u.deprecation&&(f+="Deprecation "),u.span&&(f+=v(u.span)),f+=d,u.span?.context&&(f+=`
@@ -1,4 +1,4 @@
1
- var T=Object.defineProperty;var h=(e,r)=>T(e,"name",{value:r,configurable:!0});import{fileURLToPath as v}from"node:url";import{isAbsolute as y,dirname as L,extname as A,join as b,resolve as C,normalize as x}from"@visulima/path";import{isRelative as z}from"@visulima/path/utils";import{r as D}from"../../../../../packem_shared/resolve-C7N_MxXM.mjs";import{n as O,g as U,h as _}from"../../../../../packem_shared/url-I6Jx3crl.mjs";import{readFileSync as k}from"@visulima/fs";import{pathToFileURL as R}from"mlly";import{d as H}from"../../../../../packem_shared/index-D0PXAVC1.mjs";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
1
+ var T=Object.defineProperty;var h=(e,r)=>T(e,"name",{value:r,configurable:!0});import{fileURLToPath as v}from"node:url";import{isAbsolute as y,dirname as L,extname as A,join as b,resolve as C,normalize as x}from"@visulima/path";import{isRelative as z}from"@visulima/path/utils";import{r as D}from"../../../../../packem_shared/resolve-C7N_MxXM.mjs";import{n as O,g as U,h as _}from"../../../../../packem_shared/url-I6Jx3crl.mjs";import{readFileSync as k}from"@visulima/fs";import{pathToFileURL as R}from"mlly";import{d as H}from"../../../../../packem_shared/index-CFdl4RKM.mjs";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
2
2
  const require = __cjs_mod__.createRequire(import.meta.url);
3
3
  var N=Object.defineProperty,E=h((e,r)=>N(e,"name",{value:r,configurable:!0}),"s");const W=[".scss",".sass",".css"],J=["sass","style"],q=E((e,r,n)=>{const s=[],a=O(e);if(s.push(U(a),a),!_(e)&&!y(e)&&!z(e)){const o=O(`~${e}`);s.push(U(o),o)}const i={baseDirs:[L(r)],caller:"Sass importer",extensions:W,mainFields:J};return n(s,i)},"importerImpl"),Z=E(e=>({file:e.replace(/\.css$/i,"")}),"finalize"),B=E((e,r)=>{try{return Z(q(e,r,D))}catch{return null}},"importer");var V=Object.defineProperty,G=h((e,r)=>V(e,"name",{value:r,configurable:!0}),"e$1");const I=G(e=>{switch(e.toLowerCase()){case".scss":return"scss";case".sass":return"indented";case".css":return"css";default:return}},"resolveSyntax");var K=Object.defineProperty,Q=h((e,r)=>K(e,"name",{value:r,configurable:!0}),"i$1");const X=[".scss",".sass",".css"],Y=["sass","style"],ee=Q((e,r)=>({canonicalize(n,s){const a=s.containingUrl?v(s.containingUrl.toString()):e;let i;const o=O(n),g=U(o);try{i=D([g,o],{baseDirs:[L(a)],caller:"Sass modern importer",extensions:X,mainFields:Y})}catch{return null}return new URL(R(i))},load(n){const s=A(n.pathname),a=s?I(s.toLowerCase())??"scss":"scss";try{let i=k(n);return r&&(i="/* "+n.pathname+` */
4
4
  `+i),{contents:i,sourceMapUrl:n,syntax:a}}catch{return null}}}),"importer");var re=Object.defineProperty,te=h((e,r)=>re(e,"name",{value:r,configurable:!0}),"a");let $;const se=te(async(e,r)=>{if(e.compileString!==void 0)return r==="modern"?n=>{const{data:s,...a}=n;return e.compileString(s,a)}:r==="modern-compiler"?n=>{const{data:s,...a}=n;return e.compileString(s,a)}:n=>e.renderSync(n);if(r==="modern"||r==="modern-compiler")throw new Error("Modern API is not supported for 'node-sass'");if(!$){const n=Number(process.env.UV_THREADPOOL_SIZE??4);$=new H({concurrency:n-1})}return async n=>await $.add(async()=>await new Promise((s,a)=>{e.render.bind(e)(n,(i,o)=>{if(i){a(i);return}s(o)})}))},"getCompileFunction");var ne=Object.defineProperty,M=h((e,r)=>ne(e,"name",{value:r,configurable:!0}),"o");const ae=M(()=>{const e=["sass-embedded","sass","node-sass"];for(const r of e)try{return require.resolve(r),r}catch{}throw new Error("No supported Sass implementation found. Please install 'sass-embedded', 'sass', or 'node-sass'.")},"getDefaultSassImplementation"),oe=M(e=>{let r=e;typeof r=="string"&&(r=require(r));const{info:n=void 0}=r;if(!n)throw new Error(`Sass implementation is missing 'info' property. Implementation: ${JSON.stringify(r)}`);const s=n.split(" ");if(s.length<2)throw new Error(`Invalid Sass implementation info format. Expected at least 2 parts, got: "${n}".`);const[a]=s;if(a==="dart-sass"||a==="node-sass"||a==="sass-embedded")return r;throw new Error(`Unsupported Sass implementation: "${a}". Supported implementations are: dart-sass, node-sass, sass-embedded.`)},"getSassImplementation");var ie=Object.defineProperty,P=h((e,r)=>ie(e,"name",{value:r,configurable:!0}),"d");const ce=P(async(e,r,n,s,a,i,o)=>{const{warnRuleAsWarning:g,...p}=s,t={...p,data:s.additionalData?typeof s.additionalData=="function"?await s.additionalData(a,e):`${s.additionalData}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/packem",
3
- "version": "1.18.0",
3
+ "version": "1.18.2",
4
4
  "description": "A fast and modern bundler for Node.js and TypeScript.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -341,7 +341,7 @@
341
341
  ],
342
342
  "dependencies": {
343
343
  "@antfu/install-pkg": "1.0.0",
344
- "@babel/parser": "7.26.5",
344
+ "@babel/parser": "7.26.7",
345
345
  "@clack/prompts": "0.9.1",
346
346
  "@csstools/css-parser-algorithms": "3.0.4",
347
347
  "@csstools/css-tokenizer": "3.0.3",
@@ -355,16 +355,16 @@
355
355
  "@rollup/plugin-replace": "6.0.2",
356
356
  "@rollup/plugin-wasm": "6.2.2",
357
357
  "@rollup/pluginutils": "5.1.4",
358
- "@visulima/cerebro": "1.1.33",
359
- "@visulima/colorize": "1.4.18",
360
- "@visulima/find-cache-dir": "1.0.22",
361
- "@visulima/fs": "2.3.7",
362
- "@visulima/humanizer": "1.1.0",
363
- "@visulima/package": "3.4.5",
364
- "@visulima/pail": "2.1.18",
365
- "@visulima/path": "1.3.3",
366
- "@visulima/source-map": "1.0.16",
367
- "@visulima/tsconfig": "1.1.9",
358
+ "@visulima/cerebro": "1.1.36",
359
+ "@visulima/colorize": "1.4.20",
360
+ "@visulima/find-cache-dir": "1.0.25",
361
+ "@visulima/fs": "3.0.1",
362
+ "@visulima/humanizer": "1.1.1",
363
+ "@visulima/package": "3.4.8",
364
+ "@visulima/pail": "2.1.20",
365
+ "@visulima/path": "1.3.4",
366
+ "@visulima/source-map": "1.0.17",
367
+ "@visulima/tsconfig": "1.1.12",
368
368
  "browserslist": "4.24.4",
369
369
  "defu": "6.1.4",
370
370
  "es-module-lexer": "1.6.0",
@@ -374,10 +374,10 @@
374
374
  "jiti": "2.4.2",
375
375
  "magic-string": "0.30.17",
376
376
  "mlly": "1.7.4",
377
- "oxc-parser": "0.47.1",
377
+ "oxc-parser": "0.48.0",
378
378
  "oxc-resolver": "4.0.0",
379
379
  "picomatch": "^4.0.2",
380
- "rollup": "4.31.0",
380
+ "rollup": "4.32.0",
381
381
  "rollup-plugin-dts": "6.1.1",
382
382
  "rollup-plugin-license": "3.5.3",
383
383
  "rollup-plugin-polyfill-node": "0.13.0",
@@ -1 +0,0 @@
1
- var A=Object.defineProperty;var f=(s,e)=>A(s,"name",{value:e,configurable:!0});function S(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}f(S,"getDefaultExportFromCjs");var T={exports:{}},I;function q(){return I||(I=1,function(s){var e=Object.defineProperty,t=f((r,n)=>e(r,"name",{value:n,configurable:!0}),"c"),h=Object.prototype.hasOwnProperty,a="~";function u(){}f(u,"Events"),t(u,"Events"),Object.create&&(u.prototype=Object.create(null),new u().__proto__||(a=!1));function m(r,n,i){this.fn=r,this.context=n,this.once=i||!1}f(m,"EE"),t(m,"EE");function E(r,n,i,d,y){if(typeof i!="function")throw new TypeError("The listener must be a function");var p=new m(i,d||r,y),v=a?a+n:n;return r._events[v]?r._events[v].fn?r._events[v]=[r._events[v],p]:r._events[v].push(p):(r._events[v]=p,r._eventsCount++),r}f(E,"addListener"),t(E,"addListener");function b(r,n){--r._eventsCount===0?r._events=new u:delete r._events[n]}f(b,"clearEvent"),t(b,"clearEvent");function c(){this._events=new u,this._eventsCount=0}f(c,"EventEmitter"),t(c,"EventEmitter"),c.prototype.eventNames=t(function(){var r=[],n,i;if(this._eventsCount===0)return r;for(i in n=this._events)h.call(n,i)&&r.push(a?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n)):r},"eventNames"),c.prototype.listeners=t(function(r){var n=a?a+r:r,i=this._events[n];if(!i)return[];if(i.fn)return[i.fn];for(var d=0,y=i.length,p=new Array(y);d<y;d++)p[d]=i[d].fn;return p},"listeners"),c.prototype.listenerCount=t(function(r){var n=a?a+r:r,i=this._events[n];return i?i.fn?1:i.length:0},"listenerCount"),c.prototype.emit=t(function(r,n,i,d,y,p){var v=a?a+r:r;if(!this._events[v])return!1;var o=this._events[v],g=arguments.length,w,l;if(o.fn){switch(o.once&&this.removeListener(r,o.fn,void 0,!0),g){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,n),!0;case 3:return o.fn.call(o.context,n,i),!0;case 4:return o.fn.call(o.context,n,i,d),!0;case 5:return o.fn.call(o.context,n,i,d,y),!0;case 6:return o.fn.call(o.context,n,i,d,y,p),!0}for(l=1,w=new Array(g-1);l<g;l++)w[l-1]=arguments[l];o.fn.apply(o.context,w)}else{var z=o.length,x;for(l=0;l<z;l++)switch(o[l].once&&this.removeListener(r,o[l].fn,void 0,!0),g){case 1:o[l].fn.call(o[l].context);break;case 2:o[l].fn.call(o[l].context,n);break;case 3:o[l].fn.call(o[l].context,n,i);break;case 4:o[l].fn.call(o[l].context,n,i,d);break;default:if(!w)for(x=1,w=new Array(g-1);x<g;x++)w[x-1]=arguments[x];o[l].fn.apply(o[l].context,w)}}return!0},"emit"),c.prototype.on=t(function(r,n,i){return E(this,r,n,i,!1)},"on"),c.prototype.once=t(function(r,n,i){return E(this,r,n,i,!0)},"once"),c.prototype.removeListener=t(function(r,n,i,d){var y=a?a+r:r;if(!this._events[y])return this;if(!n)return b(this,y),this;var p=this._events[y];if(p.fn)p.fn===n&&(!d||p.once)&&(!i||p.context===i)&&b(this,y);else{for(var v=0,o=[],g=p.length;v<g;v++)(p[v].fn!==n||d&&!p[v].once||i&&p[v].context!==i)&&o.push(p[v]);o.length?this._events[y]=o.length===1?o[0]:o:b(this,y)}return this},"removeListener"),c.prototype.removeAllListeners=t(function(r){var n;return r?(n=a?a+r:r,this._events[n]&&b(this,n)):(this._events=new u,this._eventsCount=0),this},"removeAllListeners"),c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=a,c.EventEmitter=c,s.exports=c}(T)),T.exports}f(q,"requireEventemitter3");var $=q();const D=S($);var F=Object.defineProperty,_=f((s,e)=>F(s,"name",{value:e,configurable:!0}),"o");class N extends Error{static{f(this,"TimeoutError")}static{_(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}}class M extends Error{static{f(this,"AbortError")}static{_(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}}const O=_(s=>globalThis.DOMException===void 0?new M(s):new DOMException(s),"getDOMException"),P=_(s=>{const e=s.reason===void 0?O("This operation was aborted."):s.reason;return e instanceof Error?e:O(e)},"getAbortedReason");function L(s,e){const{milliseconds:t,fallback:h,message:a,customTimers:u={setTimeout,clearTimeout}}=e;let m;const E=new Promise((b,c)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){const{signal:n}=e;n.aborted&&c(P(n));const i=_(()=>{c(P(n))},"abortHandler");n.addEventListener("abort",i,{once:!0}),s.finally(()=>{n.removeEventListener("abort",i)})}if(t===Number.POSITIVE_INFINITY){s.then(b,c);return}const r=new N;m=u.setTimeout.call(void 0,()=>{if(h){try{b(h())}catch(n){c(n)}return}typeof s.cancel=="function"&&s.cancel(),a===!1?b():a instanceof Error?c(a):(r.message=a??`Promise timed out after ${t} milliseconds`,c(r))},t),(async()=>{try{b(await s)}catch(n){c(n)}})()}).finally(()=>{E.clear()});return E.clear=()=>{u.clearTimeout.call(void 0,m),m=void 0},E}f(L,"T");_(L,"pTimeout");var k=Object.defineProperty,V=f((s,e)=>k(s,"name",{value:e,configurable:!0}),"i");function j(s,e,t){let h=0,a=s.length;for(;a>0;){const u=Math.trunc(a/2);let m=h+u;t(s[m],e)<=0?(h=++m,a-=u+1):a=u}return h}f(j,"r");V(j,"lowerBound");var Y=Object.defineProperty,B=f((s,e)=>Y(s,"name",{value:e,configurable:!0}),"s");class Q{static{f(this,"y")}static{B(this,"PriorityQueue")}#e=[];enqueue(e,t){t={priority:0,...t};const h={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(h);return}const a=j(this.#e,h,(u,m)=>m.priority-u.priority);this.#e.splice(a,0,h)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}}var R=Object.defineProperty,C=f((s,e)=>R(s,"name",{value:e,configurable:!0}),"n");class G extends D{static{f(this,"d")}static{C(this,"PQueue")}#e;#o;#s=0;#p;#a;#v=0;#r;#u;#t;#m;#n=0;#c;#i;#d;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Q,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#o=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#p=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#d=e.throwOnTimeout===!0,this.#i=e.autoStart===!1}get#g(){return this.#o||this.#s<this.#p}get#E(){return this.#n<this.#c}#w(){this.#n--,this.#h(),this.emit("next")}#_(){this.#b(),this.#y(),this.#u=void 0}get#x(){const e=Date.now();if(this.#r===void 0){const t=this.#v-e;if(t<0)this.#s=this.#e?this.#n:0;else return this.#u===void 0&&(this.#u=setTimeout(()=>{this.#_()},t)),!0}return!1}#h(){if(this.#t.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#i){const e=!this.#x;if(this.#g&&this.#E){const t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#o||this.#r!==void 0||(this.#r=setInterval(()=>{this.#b()},this.#a),this.#v=Date.now()+this.#a)}#b(){this.#s===0&&this.#n===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#s=this.#e?this.#n:0,this.#l()}#l(){for(;this.#h(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#l()}async#T(e){return new Promise((t,h)=>{e.addEventListener("abort",()=>{h(e.reason)},{once:!0})})}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#d,...t},new Promise((h,a)=>{this.#t.enqueue(async()=>{this.#n++,this.#s++;try{t.signal?.throwIfAborted();let u=e({signal:t.signal});t.timeout&&(u=L(Promise.resolve(u),{milliseconds:t.timeout})),t.signal&&(u=Promise.race([u,this.#T(t.signal)]));const m=await u;h(m),this.emit("completed",m)}catch(u){if(u instanceof N&&!t.throwOnTimeout){h();return}a(u),this.emit("error",u)}finally{this.#w()}},t),this.emit("add"),this.#h()})}async addAll(e,t){return Promise.all(e.map(async h=>this.add(h,t)))}start(){return this.#i?(this.#i=!1,this.#l(),this):this}pause(){this.#i=!0}clear(){this.#t=new this.#m}async onEmpty(){this.#t.size!==0&&await this.#f("empty")}async onSizeLessThan(e){this.#t.size<e||await this.#f("next",()=>this.#t.size<e)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#f("idle")}async#f(e,t){return new Promise(h=>{const a=C(()=>{t&&!t()||(this.off(e,a),h())},"listener");this.on(e,a)})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#i}}export{G as d,S as g};
@@ -1 +0,0 @@
1
- "use strict";var S=Object.defineProperty;var f=(s,e)=>S(s,"name",{value:e,configurable:!0});function N(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}f(N,"getDefaultExportFromCjs");var x={exports:{}},I;function q(){return I||(I=1,function(s){var e=Object.defineProperty,t=f((r,n)=>e(r,"name",{value:n,configurable:!0}),"c"),h=Object.prototype.hasOwnProperty,a="~";function u(){}f(u,"Events"),t(u,"Events"),Object.create&&(u.prototype=Object.create(null),new u().__proto__||(a=!1));function m(r,n,i){this.fn=r,this.context=n,this.once=i||!1}f(m,"EE"),t(m,"EE");function E(r,n,i,d,y){if(typeof i!="function")throw new TypeError("The listener must be a function");var p=new m(i,d||r,y),v=a?a+n:n;return r._events[v]?r._events[v].fn?r._events[v]=[r._events[v],p]:r._events[v].push(p):(r._events[v]=p,r._eventsCount++),r}f(E,"addListener"),t(E,"addListener");function b(r,n){--r._eventsCount===0?r._events=new u:delete r._events[n]}f(b,"clearEvent"),t(b,"clearEvent");function c(){this._events=new u,this._eventsCount=0}f(c,"EventEmitter"),t(c,"EventEmitter"),c.prototype.eventNames=t(function(){var r=[],n,i;if(this._eventsCount===0)return r;for(i in n=this._events)h.call(n,i)&&r.push(a?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n)):r},"eventNames"),c.prototype.listeners=t(function(r){var n=a?a+r:r,i=this._events[n];if(!i)return[];if(i.fn)return[i.fn];for(var d=0,y=i.length,p=new Array(y);d<y;d++)p[d]=i[d].fn;return p},"listeners"),c.prototype.listenerCount=t(function(r){var n=a?a+r:r,i=this._events[n];return i?i.fn?1:i.length:0},"listenerCount"),c.prototype.emit=t(function(r,n,i,d,y,p){var v=a?a+r:r;if(!this._events[v])return!1;var o=this._events[v],g=arguments.length,w,l;if(o.fn){switch(o.once&&this.removeListener(r,o.fn,void 0,!0),g){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,n),!0;case 3:return o.fn.call(o.context,n,i),!0;case 4:return o.fn.call(o.context,n,i,d),!0;case 5:return o.fn.call(o.context,n,i,d,y),!0;case 6:return o.fn.call(o.context,n,i,d,y,p),!0}for(l=1,w=new Array(g-1);l<g;l++)w[l-1]=arguments[l];o.fn.apply(o.context,w)}else{var A=o.length,T;for(l=0;l<A;l++)switch(o[l].once&&this.removeListener(r,o[l].fn,void 0,!0),g){case 1:o[l].fn.call(o[l].context);break;case 2:o[l].fn.call(o[l].context,n);break;case 3:o[l].fn.call(o[l].context,n,i);break;case 4:o[l].fn.call(o[l].context,n,i,d);break;default:if(!w)for(T=1,w=new Array(g-1);T<g;T++)w[T-1]=arguments[T];o[l].fn.apply(o[l].context,w)}}return!0},"emit"),c.prototype.on=t(function(r,n,i){return E(this,r,n,i,!1)},"on"),c.prototype.once=t(function(r,n,i){return E(this,r,n,i,!0)},"once"),c.prototype.removeListener=t(function(r,n,i,d){var y=a?a+r:r;if(!this._events[y])return this;if(!n)return b(this,y),this;var p=this._events[y];if(p.fn)p.fn===n&&(!d||p.once)&&(!i||p.context===i)&&b(this,y);else{for(var v=0,o=[],g=p.length;v<g;v++)(p[v].fn!==n||d&&!p[v].once||i&&p[v].context!==i)&&o.push(p[v]);o.length?this._events[y]=o.length===1?o[0]:o:b(this,y)}return this},"removeListener"),c.prototype.removeAllListeners=t(function(r){var n;return r?(n=a?a+r:r,this._events[n]&&b(this,n)):(this._events=new u,this._eventsCount=0),this},"removeAllListeners"),c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=a,c.EventEmitter=c,s.exports=c}(x)),x.exports}f(q,"requireEventemitter3");var $=q();const D=N($);var F=Object.defineProperty,_=f((s,e)=>F(s,"name",{value:e,configurable:!0}),"o");class L extends Error{static{f(this,"TimeoutError")}static{_(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}}class M extends Error{static{f(this,"AbortError")}static{_(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}}const O=_(s=>globalThis.DOMException===void 0?new M(s):new DOMException(s),"getDOMException"),P=_(s=>{const e=s.reason===void 0?O("This operation was aborted."):s.reason;return e instanceof Error?e:O(e)},"getAbortedReason");function j(s,e){const{milliseconds:t,fallback:h,message:a,customTimers:u={setTimeout,clearTimeout}}=e;let m;const E=new Promise((b,c)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){const{signal:n}=e;n.aborted&&c(P(n));const i=_(()=>{c(P(n))},"abortHandler");n.addEventListener("abort",i,{once:!0}),s.finally(()=>{n.removeEventListener("abort",i)})}if(t===Number.POSITIVE_INFINITY){s.then(b,c);return}const r=new L;m=u.setTimeout.call(void 0,()=>{if(h){try{b(h())}catch(n){c(n)}return}typeof s.cancel=="function"&&s.cancel(),a===!1?b():a instanceof Error?c(a):(r.message=a??`Promise timed out after ${t} milliseconds`,c(r))},t),(async()=>{try{b(await s)}catch(n){c(n)}})()}).finally(()=>{E.clear()});return E.clear=()=>{u.clearTimeout.call(void 0,m),m=void 0},E}f(j,"T");_(j,"pTimeout");var k=Object.defineProperty,V=f((s,e)=>k(s,"name",{value:e,configurable:!0}),"i");function z(s,e,t){let h=0,a=s.length;for(;a>0;){const u=Math.trunc(a/2);let m=h+u;t(s[m],e)<=0?(h=++m,a-=u+1):a=u}return h}f(z,"r");V(z,"lowerBound");var Y=Object.defineProperty,B=f((s,e)=>Y(s,"name",{value:e,configurable:!0}),"s");class Q{static{f(this,"y")}static{B(this,"PriorityQueue")}#e=[];enqueue(e,t){t={priority:0,...t};const h={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(h);return}const a=z(this.#e,h,(u,m)=>m.priority-u.priority);this.#e.splice(a,0,h)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}}var R=Object.defineProperty,C=f((s,e)=>R(s,"name",{value:e,configurable:!0}),"n");class H extends D{static{f(this,"d")}static{C(this,"PQueue")}#e;#o;#s=0;#p;#a;#v=0;#r;#u;#t;#m;#n=0;#c;#i;#d;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Q,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#o=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#p=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#d=e.throwOnTimeout===!0,this.#i=e.autoStart===!1}get#g(){return this.#o||this.#s<this.#p}get#E(){return this.#n<this.#c}#w(){this.#n--,this.#h(),this.emit("next")}#_(){this.#b(),this.#y(),this.#u=void 0}get#T(){const e=Date.now();if(this.#r===void 0){const t=this.#v-e;if(t<0)this.#s=this.#e?this.#n:0;else return this.#u===void 0&&(this.#u=setTimeout(()=>{this.#_()},t)),!0}return!1}#h(){if(this.#t.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#i){const e=!this.#T;if(this.#g&&this.#E){const t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#o||this.#r!==void 0||(this.#r=setInterval(()=>{this.#b()},this.#a),this.#v=Date.now()+this.#a)}#b(){this.#s===0&&this.#n===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#s=this.#e?this.#n:0,this.#l()}#l(){for(;this.#h(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#l()}async#x(e){return new Promise((t,h)=>{e.addEventListener("abort",()=>{h(e.reason)},{once:!0})})}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#d,...t},new Promise((h,a)=>{this.#t.enqueue(async()=>{this.#n++,this.#s++;try{t.signal?.throwIfAborted();let u=e({signal:t.signal});t.timeout&&(u=j(Promise.resolve(u),{milliseconds:t.timeout})),t.signal&&(u=Promise.race([u,this.#x(t.signal)]));const m=await u;h(m),this.emit("completed",m)}catch(u){if(u instanceof L&&!t.throwOnTimeout){h();return}a(u),this.emit("error",u)}finally{this.#w()}},t),this.emit("add"),this.#h()})}async addAll(e,t){return Promise.all(e.map(async h=>this.add(h,t)))}start(){return this.#i?(this.#i=!1,this.#l(),this):this}pause(){this.#i=!0}clear(){this.#t=new this.#m}async onEmpty(){this.#t.size!==0&&await this.#f("empty")}async onSizeLessThan(e){this.#t.size<e||await this.#f("next",()=>this.#t.size<e)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#f("idle")}async#f(e,t){return new Promise(h=>{const a=C(()=>{t&&!t()||(this.off(e,a),h())},"listener");this.on(e,a)})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#i}}exports.d=H;exports.g=N;