nextcloud/dist/index-CcAO2Q3V.chunk.mjs
nextcloud-command 4431f30f7b chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-04-29 18:05:56 +00:00

3 lines
21 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/index-BLs032-f.chunk.mjs'),window.OC.filePath('', '', 'dist/preload-helper-D9xEqq8S.chunk.mjs'),window.OC.filePath('', '', 'dist/ArrowRight-DeVedBFR.chunk.mjs'),window.OC.filePath('', '', 'dist/Web-ZWEISDeD.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-8aobdbPK.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Bp9-GhMo.chunk.mjs'),window.OC.filePath('', '', 'dist/public-CvthP4YJ.chunk.mjs'),window.OC.filePath('', '', 'dist/common-Web-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/common-ArrowRight-D7L4ZBkR.chunk.css'),window.OC.filePath('', '', 'dist/colors-BfjxNgsx-C7JIEuLn.chunk.mjs'),window.OC.filePath('', '', 'dist/NcModal-kyWZ3UFC-BQ5lZJzZ.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcModal-kyWZ3UFC-DgqchLjq.chunk.css'),window.OC.filePath('', '', 'dist/common-index-Bwe91UZ7.chunk.css'),window.OC.filePath('', '', 'dist/index-Bxhfw7i5.chunk.mjs'),window.OC.filePath('', '', 'dist/NcSelect-B1uITk_3-BjHBNd15.chunk.mjs'),window.OC.filePath('', '', 'dist/TrashCanOutline-BnR7C5ZT.chunk.mjs'),window.OC.filePath('', '', 'dist/common-TrashCanOutline-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/common-NcSelect-B1uITk_3-B9mkBKAR.chunk.css'),window.OC.filePath('', '', 'dist/common-index--xyrXnuf.chunk.css')])))=>i.map(i=>d[i]);
import{b as q,z as R,o as v,f as I,g,t as N,F as w,m as T,C as j,D as V,r as k,i as Y,R as L,M as Z,h as O,c as x,k as H,w as W,a as P,_ as S}from"./preload-helper-D9xEqq8S.chunk.mjs";import{r as z,x as G,_ as B,b as F,c as C,y as J}from"./Web-ZWEISDeD.chunk.mjs";import{a as K}from"./PencilOutline-BSJtgsl4.chunk.mjs";import{N as Q}from"./NcPasswordField-BOLzDHBJ-5bPIfHUM.chunk.mjs";import{_ as X}from"./NcTextField.vue_vue_type_script_setup_true_lang-B-4HNjYH-BqVb30HQ.chunk.mjs";import{t as tt}from"./index-Bp9-GhMo.chunk.mjs";import{N as et}from"./NcSelect-B1uITk_3-BjHBNd15.chunk.mjs";z(G);const it=["for"],st=["id","type","value","min","max"],at=q({inheritAttrs:!1,__name:"NcDateTimePickerNative",props:j({class:{default:void 0},id:{default:()=>C()},inputClass:{default:""},type:{default:"date"},label:{default:()=>F("Please choose a date")},min:{default:null},max:{default:null},hideLabel:{type:Boolean}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=R(r,"modelValue"),t=r,o=V(()=>e.value?u(e.value):""),d=V(()=>t.max?u(t.max):void 0),n=V(()=>t.min?u(t.min):void 0);function m(i){const s=i.getFullYear().toString().padStart(4,"0"),c=(i.getMonth()+1).toString().padStart(2,"0"),h=i.getDate().toString().padStart(2,"0"),p=i.getHours().toString().padStart(2,"0"),f=i.getMinutes().toString().padStart(2,"0");return{yyyy:s,MM:c,dd:h,hh:p,mm:f}}function u(i){const{yyyy:s,MM:c,dd:h,hh:p,mm:f}=m(i);if(t.type==="datetime-local")return`${s}-${c}-${h}T${p}:${f}`;if(t.type==="date")return`${s}-${c}-${h}`;if(t.type==="month")return`${s}-${c}`;if(t.type==="time")return`${p}:${f}`;if(t.type==="week"){const l=new Date(Number.parseInt(s),0,1),b=Math.floor((i.getTime()-l.getTime())/(1440*60*1e3)),_=Math.ceil(b/7);return`${s}-W${_}`}return""}function a(i){const s=i.target;if(!s||isNaN(s.valueAsNumber))e.value=null;else if(t.type==="time"){const c=s.value,{yyyy:h,MM:p,dd:f}=m(e.value||new Date);e.value=new Date(`${h}-${p}-${f}T${c}`)}else if(t.type==="month"){const c=(new Date(s.value).getMonth()+1).toString().padStart(2,"0"),{yyyy:h,dd:p,hh:f,mm:l}=m(e.value||new Date);e.value=new Date(`${h}-${c}-${p}T${f}:${l}`)}else{const c=new Date(s.valueAsNumber).getTimezoneOffset()*1e3*60,h=s.valueAsNumber+c;e.value=new Date(h)}}return(i,s)=>(v(),I("div",{class:w(["native-datetime-picker",i.$props.class])},[g("label",{class:w(["native-datetime-picker__label",{"hidden-visually":i.hideLabel}]),for:i.id},N(i.label),11,it),g("input",T({id:i.id,class:["native-datetime-picker__input",i.inputClass],type:i.type,value:o.value,min:n.value,max:d.value},i.$attrs,{onInput:a}),null,16,st)],2))}}),nt=B(at,[["__scopeId","data-v-b97e1f7a"]]);z(J);const rt={name:"NcActionInput",components:{NcDateTimePickerNative:nt,NcPasswordField:Q,NcTextField:X,NcColorPicker:P(()=>S(()=>import("./index-BLs032-f.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),NcDateTimePicker:P(()=>S(()=>import("./index-Bxhfw7i5.chunk.mjs"),__vite__mapDeps([13,2,1,3,4,5,6,7,8,10,11,14,15,16,17,18]),import.meta.url)),NcSelect:P(()=>S(()=>Promise.resolve().then(()=>Tt),void 0,import.meta.url))},mixins:[K],inheritAttrs:!1,props:{id:{type:String,default:()=>"action-"+C(),validator:r=>r.trim()!==""},inputId:{type:String,default:()=>"action-input-"+C(),validator:r=>r.trim()!==""},icon:{type:String,default:""},type:{type:String,default:"text",validator(r){return["date","datetime-local","month","multiselect","number","password","search","tel","text","time","url","week","color","email"].includes(r)}},idNativeDateTimePicker:{type:String,default:"date-time-picker_id"},isNativePicker:{type:Boolean,default:!1},label:{type:String,default:null},labelOutside:{type:Boolean,default:!0},modelValue:{type:[String,Date,Number,Array],default:""},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:""},showTrailingButton:{type:Boolean,default:!0},trailingButtonLabel:{type:String,default:F("Submit")},class:{type:[String,Array,Object],default:""}},emits:["submit","update:modelValue"],computed:{isIconUrl(){try{return new URL(this.icon)}catch{return!1}},isMultiselectType(){return this.type==="multiselect"},nativeDatePickerType(){switch(this.type){case"date":case"month":case"time":case"week":case"datetime-local":return this.type}return!1},datePickerType(){if(!this.isNativePicker)switch(this.type){case"date":case"month":case"time":return this.type;case"datetime-local":return"datetime"}return!1},isFocusable(){return!this.disabled}},methods:{onLeave(){this.$refs.datetimepicker&&this.$refs.datetimepicker.$refs.datepicker&&this.$refs.datetimepicker.$refs.datepicker.closePopup()},onSubmit(r){if(r.preventDefault(),r.stopPropagation(),!this.disabled)this.$emit("submit",r);else return!1},onUpdateModelValue(r){this.$emit("update:modelValue",r)}}},ot={class:"action-input__icon-wrapper"},lt=["disabled"],ut={class:"action-input__container"},ct=["for"],ht={class:"action-input__input-container"},dt={key:4,class:"action-input__container"},pt=["for"],mt={class:"action-input__input-container"};function ft(r,e,t,o,d,n){const m=k("NcDateTimePicker"),u=k("NcDateTimePickerNative"),a=k("NcSelect"),i=k("NcPasswordField"),s=k("NcColorPicker"),c=k("NcTextField");return v(),I("li",{class:w(["action",[{"action--disabled":t.disabled},r.$props.class]])},[g("span",{class:w(["action-input",{"action-input-picker--disabled":t.disabled,"action-input--visible-label":t.labelOutside&&t.label}]),onMouseleave:e[3]||(e[3]=(...h)=>n.onLeave&&n.onLeave(...h))},[g("span",ot,[Y(r.$slots,"icon",{},()=>[g("span",{"aria-hidden":"true",class:w(["action-input__icon",[n.isIconUrl?"action-input__icon--url":t.icon]]),style:L({backgroundImage:n.isIconUrl?`url(${t.icon})`:null})},null,6)],!0)]),g("form",{ref:"form",class:"action-input__form",disabled:t.disabled,onSubmit:e[2]||(e[2]=Z((...h)=>n.onSubmit&&n.onSubmit(...h),["prevent"]))},[g("div",ut,[t.label&&t.labelOutside&&!t.isNativePicker?(v(),I("label",{key:0,class:w(["action-input__text-label",{"action-input__text-label--hidden":!t.labelOutside}]),for:t.inputId},N(t.label),11,ct)):O("",!0),g("div",ht,[n.datePickerType?(v(),x(m,T({key:0,ref:"datetimepicker",modelValue:t.modelValue,style:{"z-index":"99999999999"},placeholder:r.text,disabled:t.disabled,type:n.datePickerType,inputClass:["mx-input",{focusable:n.isFocusable}],class:"action-input__datetimepicker",appendToBody:""},r.$attrs,{"onUpdate:modelValue":n.onUpdateModelValue}),null,16,["modelValue","placeholder","disabled","type","inputClass","onUpdate:modelValue"])):t.isNativePicker?(v(),x(u,T({key:1,id:t.idNativeDateTimePicker,modelValue:t.modelValue,label:t.label,type:n.nativeDatePickerType,inputClass:{focusable:n.isFocusable},class:"action-input__datetimepicker"},r.$attrs,{"onUpdate:modelValue":n.onUpdateModelValue}),null,16,["id","modelValue","label","type","inputClass","onUpdate:modelValue"])):n.isMultiselectType?(v(),x(a,T({key:2,modelValue:t.modelValue,placeholder:r.text,disabled:t.disabled,appendToBody:!1,inputClass:{focusable:n.isFocusable},class:"action-input__multi"},r.$attrs,{"onUpdate:modelValue":n.onUpdateModelValue}),null,16,["modelValue","placeholder","disabled","inputClass","onUpdate:modelValue"])):t.type==="password"?(v(),x(i,T({key:3,id:t.inputId,modelValue:t.modelValue,label:t.label,labelOutside:!t.label||t.labelOutside,placeholder:r.text,disabled:t.disabled,inputClass:{focusable:n.isFocusable},showTrailingButton:t.showTrailingButton&&!t.disabled},r.$attrs,{"onUpdate:modelValue":n.onUpdateModelValue}),null,16,["id","modelValue","label","labelOutside","placeholder","disabled","inputClass","showTrailingButton","onUpdate:modelValue"])):t.type==="color"?(v(),I("div",dt,[t.label&&t.type==="color"?(v(),I("label",{key:0,class:w(["action-input__text-label",{"action-input__text-label--hidden":!t.labelOutside}]),for:t.inputId},N(t.label),11,pt)):O("",!0),g("div",mt,[H(s,T({id:"inputId",modelValue:t.modelValue,class:"colorpicker__trigger"},r.$attrs,{"onUpdate:modelValue":n.onUpdateModelValue,onSubmit:e[0]||(e[0]=h=>r.$refs.form.requestSubmit())}),{default:W(()=>[g("button",{class:w(["colorpicker__preview",{focusable:n.isFocusable}]),style:L({"background-color":t.modelValue})},null,6)]),_:1},16,["modelValue","onUpdate:modelValue"])])])):(v(),x(c,T({key:5,id:t.inputId,modelValue:t.modelValue,label:t.label,labelOutside:!t.label||t.labelOutside,placeholder:r.text,disabled:t.disabled,inputClass:{focusable:n.isFocusable},type:t.type,trailingButtonIcon:"arrowRight",trailingButtonLabel:t.trailingButtonLabel,showTrailingButton:t.showTrailingButton&&!t.disabled},r.$attrs,{onTrailingButtonClick:e[1]||(e[1]=h=>r.$refs.form.requestSubmit()),"onUpdate:modelValue":n.onUpdateModelValue}),null,16,["id","modelValue","label","labelOutside","placeholder","disabled","inputClass","type","trailingButtonLabel","showTrailingButton","onUpdate:modelValue"]))])])],40,lt)],34)],2)}const Nt=B(rt,[["render",ft],["__scopeId","data-v-3a83acfa"]]);var D={exports:{}},M;function yt(){return M||(M=1,(function(r){var e=Object.prototype.hasOwnProperty,t="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(t=!1));function d(a,i,s){this.fn=a,this.context=i,this.once=s||!1}function n(a,i,s,c,h){if(typeof s!="function")throw new TypeError("The listener must be a function");var p=new d(s,c||a,h),f=t?t+i:i;return a._events[f]?a._events[f].fn?a._events[f]=[a._events[f],p]:a._events[f].push(p):(a._events[f]=p,a._eventsCount++),a}function m(a,i){--a._eventsCount===0?a._events=new o:delete a._events[i]}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var a=[],i,s;if(this._eventsCount===0)return a;for(s in i=this._events)e.call(i,s)&&a.push(t?s.slice(1):s);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(i)):a},u.prototype.listeners=function(a){var i=t?t+a:a,s=this._events[i];if(!s)return[];if(s.fn)return[s.fn];for(var c=0,h=s.length,p=new Array(h);c<h;c++)p[c]=s[c].fn;return p},u.prototype.listenerCount=function(a){var i=t?t+a:a,s=this._events[i];return s?s.fn?1:s.length:0},u.prototype.emit=function(a,i,s,c,h,p){var f=t?t+a:a;if(!this._events[f])return!1;var l=this._events[f],b=arguments.length,_,y;if(l.fn){switch(l.once&&this.removeListener(a,l.fn,void 0,!0),b){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,i),!0;case 3:return l.fn.call(l.context,i,s),!0;case 4:return l.fn.call(l.context,i,s,c),!0;case 5:return l.fn.call(l.context,i,s,c,h),!0;case 6:return l.fn.call(l.context,i,s,c,h,p),!0}for(y=1,_=new Array(b-1);y<b;y++)_[y-1]=arguments[y];l.fn.apply(l.context,_)}else{var A=l.length,$;for(y=0;y<A;y++)switch(l[y].once&&this.removeListener(a,l[y].fn,void 0,!0),b){case 1:l[y].fn.call(l[y].context);break;case 2:l[y].fn.call(l[y].context,i);break;case 3:l[y].fn.call(l[y].context,i,s);break;case 4:l[y].fn.call(l[y].context,i,s,c);break;default:if(!_)for($=1,_=new Array(b-1);$<b;$++)_[$-1]=arguments[$];l[y].fn.apply(l[y].context,_)}}return!0},u.prototype.on=function(a,i,s){return n(this,a,i,s,!1)},u.prototype.once=function(a,i,s){return n(this,a,i,s,!0)},u.prototype.removeListener=function(a,i,s,c){var h=t?t+a:a;if(!this._events[h])return this;if(!i)return m(this,h),this;var p=this._events[h];if(p.fn)p.fn===i&&(!c||p.once)&&(!s||p.context===s)&&m(this,h);else{for(var f=0,l=[],b=p.length;f<b;f++)(p[f].fn!==i||c&&!p[f].once||s&&p[f].context!==s)&&l.push(p[f]);l.length?this._events[h]=l.length===1?l[0]:l:m(this,h)}return this},u.prototype.removeAllListeners=function(a){var i;return a?(i=t?t+a:a,this._events[i]&&m(this,i)):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=t,u.EventEmitter=u,r.exports=u})(D)),D.exports}var bt=yt();const vt=tt(bt);class E extends Error{name="TimeoutError";constructor(e,t){super(e,t),Error.captureStackTrace?.(this,E)}}const U=r=>r.reason??new DOMException("This operation was aborted.","AbortError");function gt(r,e){const{milliseconds:t,fallback:o,message:d,customTimers:n={setTimeout,clearTimeout},signal:m}=e;let u,a;const i=new Promise((s,c)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(m?.aborted){c(U(m));return}if(m&&(a=()=>{c(U(m))},m.addEventListener("abort",a,{once:!0})),r.then(s,c),t===Number.POSITIVE_INFINITY)return;const h=new E;u=n.setTimeout.call(void 0,()=>{if(o){try{s(o())}catch(p){c(p)}return}typeof r.cancel=="function"&&r.cancel(),d===!1?s():d instanceof Error?c(d):(h.message=d??`Promise timed out after ${t} milliseconds`,c(h))},t)}).finally(()=>{i.clear(),a&&m&&m.removeEventListener("abort",a)});return i.clear=()=>{n.clearTimeout.call(void 0,u),u=void 0},i}function _t(r,e,t){let o=0,d=r.length;for(;d>0;){const n=Math.trunc(d/2);let m=o+n;t(r[m],e)<=0?(o=++m,d-=n+1):d=n}return o}class wt{#i=[];enqueue(e,t){const{priority:o=0,id:d}=t??{},n={priority:o,id:d,run:e};if(this.size===0||this.#i[this.size-1].priority>=o){this.#i.push(n);return}const m=_t(this.#i,n,(u,a)=>a.priority-u.priority);this.#i.splice(m,0,n)}setPriority(e,t){const o=this.#i.findIndex(n=>n.id===e);if(o===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[d]=this.#i.splice(o,1);this.enqueue(d.run,{priority:t,id:e})}dequeue(){return this.#i.shift()?.run}filter(e){return this.#i.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#i.length}}class Ct extends vt{#i;#r;#o=0;#p;#f=!1;#v=!1;#l;#I=0;#g=0;#u;#c;#n;#a=[];#s=0;#t;#V;#e=0;#y;#h;#E=1n;#b=new Map;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:wt,strict:!1,...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})`);if(e.strict&&e.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(e.strict&&e.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#i=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#r=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#p=e.intervalCap,this.#l=e.interval,this.#n=e.strict,this.#t=new e.queueClass,this.#V=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#h=e.autoStart===!1,this.#F()}#_(e){for(;this.#s<this.#a.length;){const t=this.#a[this.#s];if(t!==void 0&&e-t>=this.#l)this.#s++;else break}(this.#s>100&&this.#s>this.#a.length/2||this.#s===this.#a.length)&&(this.#a=this.#a.slice(this.#s),this.#s=0)}#L(e){this.#n?this.#a.push(e):this.#o++}#O(){this.#n?this.#a.length>this.#s&&this.#a.pop():this.#o>0&&this.#o--}#w(){return this.#a.length-this.#s}get#D(){return this.#r?!0:this.#n?this.#w()<this.#p:this.#o<this.#p}get#M(){return this.#e<this.#y}#U(){this.#e--,this.#e===0&&this.emit("pendingZero"),this.#$(),this.emit("next")}#z(){this.#c=void 0,this.#N(),this.#S()}#B(e){if(this.#n){if(this.#_(e),this.#w()>=this.#p){const t=this.#a[this.#s],o=this.#l-(e-t);return this.#T(o),!0}return!1}if(this.#u===void 0){const t=this.#I-e;if(t<0){if(this.#g>0){const o=e-this.#g;if(o<this.#l)return this.#T(this.#l-o),!0}this.#o=this.#i?this.#e:0}else return this.#T(t),!0}return!1}#T(e){this.#c===void 0&&(this.#c=setTimeout(()=>{this.#z()},e))}#k(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}#P(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#$(){if(this.#t.size===0){if(this.#k(),this.emit("empty"),this.#e===0){if(this.#P(),this.#n&&this.#s>0){const t=Date.now();this.#_(t)}this.emit("idle")}return!1}let e=!1;if(!this.#h){const t=Date.now(),o=!this.#B(t);if(this.#D&&this.#M){const d=this.#t.dequeue();this.#r||(this.#L(t),this.#m()),this.emit("active"),d(),o&&this.#S(),e=!0}}return e}#S(){this.#r||this.#u!==void 0||this.#n||(this.#u=setInterval(()=>{this.#N()},this.#l),this.#I=Date.now()+this.#l)}#N(){this.#n||(this.#o===0&&this.#e===0&&this.#u&&this.#k(),this.#o=this.#i?this.#e:0),this.#x(),this.#m()}#x(){for(;this.#$(););}get concurrency(){return this.#y}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.#y=e,this.#x()}setPriority(e,t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#t.setPriority(e,t)}async add(e,t={}){return t={timeout:this.timeout,...t,id:t.id??(this.#E++).toString()},new Promise((o,d)=>{const n=Symbol(`task-${t.id}`);this.#t.enqueue(async()=>{this.#e++,this.#b.set(n,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});let m;try{try{t.signal?.throwIfAborted()}catch(i){throw this.#A(),this.#b.delete(n),i}this.#g=Date.now();let u=e({signal:t.signal});if(t.timeout&&(u=gt(Promise.resolve(u),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#e} running, ${this.#t.size} waiting)`})),t.signal){const{signal:i}=t;u=Promise.race([u,new Promise((s,c)=>{m=()=>{c(i.reason)},i.addEventListener("abort",m,{once:!0})})])}const a=await u;o(a),this.emit("completed",a)}catch(u){d(u),this.emit("error",u)}finally{m&&t.signal?.removeEventListener("abort",m),this.#b.delete(n),queueMicrotask(()=>{this.#U()})}},t),this.emit("add"),this.#$()})}async addAll(e,t){return Promise.all(e.map(async o=>this.add(o,t)))}start(){return this.#h?(this.#h=!1,this.#x(),this):this}pause(){this.#h=!0}clear(){this.#t=new this.#V,this.#k(),this.#C(),this.emit("empty"),this.#e===0&&(this.#P(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#t.size!==0&&await this.#d("empty")}async onSizeLessThan(e){this.#t.size<e||await this.#d("next",()=>this.#t.size<e)}async onIdle(){this.#e===0&&this.#t.size===0||await this.#d("idle")}async onPendingZero(){this.#e!==0&&await this.#d("pendingZero")}async onRateLimit(){this.isRateLimited||await this.#d("rateLimit")}async onRateLimitCleared(){this.isRateLimited&&await this.#d("rateLimitCleared")}onError(){return new Promise((e,t)=>{const o=d=>{this.off("error",o),t(d)};this.on("error",o)})}async#d(e,t){return new Promise(o=>{const d=()=>{t&&!t()||(this.off(e,d),o())};this.on(e,d)})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#e}get isPaused(){return this.#h}#F(){this.#r||(this.on("add",()=>{this.#t.size>0&&this.#m()}),this.on("next",()=>{this.#m()}))}#m(){this.#r||this.#v||(this.#v=!0,queueMicrotask(()=>{this.#v=!1,this.#C()}))}#A(){this.#r||(this.#O(),this.#m())}#C(){const e=this.#f;if(this.#r||this.#t.size===0){e&&(this.#f=!1,this.emit("rateLimitCleared"));return}let t;if(this.#n){const d=Date.now();this.#_(d),t=this.#w()}else t=this.#o;const o=t>=this.#p;o!==e&&(this.#f=o,this.emit(o?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#f}get isSaturated(){return this.#e===this.#y&&this.#t.size>0||this.isRateLimited&&this.#t.size>0}get runningTasks(){return[...this.#b.values()].map(e=>({...e}))}}const Tt=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"}));export{nt as N,Ct as P,Nt as a};
//# sourceMappingURL=index-CcAO2Q3V.chunk.mjs.map