@motiadev/plugin-bullmq 0.14.0-beta.165-285707 → 0.14.0-beta.165-602289
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/dist/index.css +1159 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +62 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4533
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +6 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +630 -384
- package/dist/plugin.js.map +1 -0
- package/package.json +17 -24
- package/dist/api.d.ts +0 -4
- package/dist/api.d.ts.map +0 -1
- package/dist/components/dlq-panel.d.ts +0 -2
- package/dist/components/dlq-panel.d.ts.map +0 -1
- package/dist/components/job-detail.d.ts +0 -2
- package/dist/components/job-detail.d.ts.map +0 -1
- package/dist/components/jobs-table.d.ts +0 -2
- package/dist/components/jobs-table.d.ts.map +0 -1
- package/dist/components/queue-detail.d.ts +0 -2
- package/dist/components/queue-detail.d.ts.map +0 -1
- package/dist/components/queue-list.d.ts +0 -2
- package/dist/components/queue-list.d.ts.map +0 -1
- package/dist/components/queues-page.d.ts +0 -2
- package/dist/components/queues-page.d.ts.map +0 -1
- package/dist/hooks/use-jobs-mutations.d.ts +0 -23
- package/dist/hooks/use-jobs-mutations.d.ts.map +0 -1
- package/dist/hooks/use-jobs-query.d.ts +0 -5
- package/dist/hooks/use-jobs-query.d.ts.map +0 -1
- package/dist/hooks/use-queues.d.ts +0 -11
- package/dist/hooks/use-queues.d.ts.map +0 -1
- package/dist/index.cjs +0 -98
- package/dist/plugin-bullmq.css +0 -1
- package/dist/plugin.cjs +0 -1
- package/dist/providers/query-provider.d.ts +0 -7
- package/dist/providers/query-provider.d.ts.map +0 -1
- package/dist/stores/use-bullmq-store.d.ts +0 -22
- package/dist/stores/use-bullmq-store.d.ts.map +0 -1
- package/dist/streams/queues-stream.d.ts +0 -33
- package/dist/streams/queues-stream.d.ts.map +0 -1
- package/dist/types/queue.d.ts +0 -54
- package/dist/types/queue.d.ts.map +0 -1
package/dist/index.cjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),Ps=require("@motiadev/stream-client-react"),m=require("@motiadev/ui");function As(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const N=As(y);var be={exports:{}},he={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var lt;function _s(){if(lt)return he;lt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var i in a)i!=="key"&&(o[i]=a[i])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return he.Fragment=t,he.jsx=s,he.jsxs=s,he}var fe={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ct;function Fs(){return ct||(ct=1,process.env.NODE_ENV!=="production"&&function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===q?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case v:return"Fragment";case j:return"Profiler";case O:return"StrictMode";case S:return"Suspense";case k:return"SuspenseList";case F:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case p:return"Portal";case A:return(u.displayName||"Context")+".Provider";case M:return(u._context.displayName||"Context")+".Consumer";case C:var w=u.render;return u=u.displayName,u||(u=w.displayName||w.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case E:return w=u.displayName||null,w!==null?w:e(u.type)||"Memo";case P:w=u._payload,u=u._init;try{return e(u(w))}catch{}}return null}function t(u){return""+u}function s(u){try{t(u);var w=!1}catch{w=!0}if(w){w=console;var R=w.error,x=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return R.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",x),t(u)}}function r(u){if(u===v)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===P)return"<...>";try{var w=e(u);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function a(){var u=Q.A;return u===null?null:u.getOwner()}function o(){return Error("react-stack-top-frame")}function l(u){if(U.call(u,"key")){var w=Object.getOwnPropertyDescriptor(u,"key").get;if(w&&w.isReactWarning)return!1}return u.key!==void 0}function i(u,w){function R(){I||(I=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",w))}R.isReactWarning=!0,Object.defineProperty(u,"key",{get:R,configurable:!0})}function c(){var u=e(this.type);return H[u]||(H[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function h(u,w,R,x,T,Y,Re,ke){return R=Y.ref,u={$$typeof:g,type:u,key:w,props:Y,_owner:T},(R!==void 0?R:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:c}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Re}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ke}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function d(u,w,R,x,T,Y,Re,ke){var $=w.children;if($!==void 0)if(x)if(K($)){for(x=0;x<$.length;x++)b($[x]);Object.freeze&&Object.freeze($)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else b($);if(U.call(w,"key")){$=e(u);var oe=Object.keys(w).filter(function(Ms){return Ms!=="key"});x=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",z[$+x]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
-
let props = %s;
|
|
19
|
-
<%s {...props} />
|
|
20
|
-
React keys must be passed directly to JSX without using spread:
|
|
21
|
-
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,x,$,oe,$),z[$+x]=!0)}if($=null,R!==void 0&&(s(R),$=""+R),l(w)&&(s(w.key),$=""+w.key),"key"in w){R={};for(var De in w)De!=="key"&&(R[De]=w[De])}else R=w;return $&&i(R,typeof u=="function"?u.displayName||u.name||"Unknown":u),h(u,$,Y,T,a(),R,Re,ke)}function b(u){typeof u=="object"&&u!==null&&u.$$typeof===g&&u._store&&(u._store.validated=1)}var f=y,g=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),A=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),q=Symbol.for("react.client.reference"),Q=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,K=Array.isArray,V=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(u){return u()}};var I,H={},_=f.react_stack_bottom_frame.bind(f,o)(),B=V(r(o)),z={};fe.Fragment=v,fe.jsx=function(u,w,R,x,T){var Y=1e4>Q.recentlyCreatedOwnerStacks++;return d(u,w,R,!1,x,T,Y?Error("react-stack-top-frame"):_,Y?V(r(u)):B)},fe.jsxs=function(u,w,R,x,T){var Y=1e4>Q.recentlyCreatedOwnerStacks++;return d(u,w,R,!0,x,T,Y?Error("react-stack-top-frame"):_,Y?V(r(u)):B)}}()),fe}var ut;function Qs(){return ut||(ut=1,process.env.NODE_ENV==="production"?be.exports=_s():be.exports=Fs()),be.exports}var n=Qs();const dt=e=>{let t;const s=new Set,r=(h,d)=>{const b=typeof h=="function"?h(t):h;if(!Object.is(b,t)){const f=t;t=d??(typeof b!="object"||b===null)?b:Object.assign({},t,b),s.forEach(g=>g(t,f))}},a=()=>t,i={setState:r,getState:a,getInitialState:()=>c,subscribe:h=>(s.add(h),()=>s.delete(h))},c=t=e(r,a,i);return i},Is=e=>e?dt(e):dt,qs=e=>e;function Ls(e,t=qs){const s=y.useSyncExternalStore(e.subscribe,y.useCallback(()=>t(e.getState()),[e,t]),y.useCallback(()=>t(e.getInitialState()),[e,t]));return y.useDebugValue(s),s}const ht=e=>{const t=Is(e),s=r=>Ls(t,r);return Object.assign(s,t),s},Us=e=>e?ht(e):ht,ft={queues:[],selectedQueue:null,selectedJob:null,selectedStatus:"waiting",error:null,searchQuery:"",jobDetailOpen:!1},D=Us(e=>({...ft,setQueues:t=>e({queues:t}),setSelectedQueue:t=>e({selectedQueue:t,selectedJob:null}),updateSelectedQueueStats:t=>e({selectedQueue:t}),setSelectedJob:t=>e({selectedJob:t}),setSelectedStatus:t=>e({selectedStatus:t}),setError:t=>e({error:t}),setSearchQuery:t=>e({searchQuery:t}),setJobDetailOpen:t=>e({jobDetailOpen:t}),reset:()=>e(ft)})),Js="__motia.bullmq-queues",Vt=()=>{const{queues:e,setQueues:t,setError:s,error:r,selectedQueue:a,setSelectedQueue:o}=D(),{data:l}=Ps.useStreamGroup({streamName:Js,groupId:"default"});y.useEffect(()=>{if(l.length>0&&(t(l),a)){const f=l.find(g=>g.name===a.name);if(f){const g=JSON.stringify(a.stats),p=JSON.stringify(f.stats),v=a.isPaused!==f.isPaused;(g!==p||v)&&o(f)}}},[l,t,a,o]);const i=y.useCallback(async f=>{try{const g=await fetch(`/__motia/bullmq/queues/${encodeURIComponent(f)}`);if(!g.ok)throw new Error("Failed to fetch queue");return await g.json()}catch{return null}},[]),c=y.useCallback(async f=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(f)}/pause`,{method:"POST"})}catch(g){s(g instanceof Error?g.message:"Failed to pause queue")}},[s]),h=y.useCallback(async f=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(f)}/resume`,{method:"POST"})}catch(g){s(g instanceof Error?g.message:"Failed to resume queue")}},[s]),d=y.useCallback(async(f,g,p=0,v=1e3)=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(f)}/clean`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:g,grace:p,limit:v})})}catch(O){s(O instanceof Error?O.message:"Failed to clean queue")}},[s]),b=y.useCallback(async f=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(f)}/drain`,{method:"POST"})}catch(g){s(g instanceof Error?g.message:"Failed to drain queue")}},[s]);return{queues:e,error:r,refreshQueue:i,pauseQueue:c,resumeQueue:h,cleanQueue:d,drainQueue:b}};var ue=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Hs=class{#e=$s;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#t&&e!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},ne=new Hs;function zs(e){setTimeout(e,0)}var ae=typeof window>"u"||"Deno"in globalThis;function W(){}function Ws(e,t){return typeof e=="function"?e(t):e}function Pe(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ee(e,t){return typeof e=="function"?e(t):e}function Z(e,t){return typeof e=="function"?e(t):e}function mt(e,t){const{type:s="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:i}=e;if(l){if(r){if(t.queryHash!==Ze(l,t.options))return!1}else if(!ge(t.queryKey,l))return!1}if(s!=="all"){const c=t.isActive();if(s==="active"&&!c||s==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||a&&a!==t.state.fetchStatus||o&&!o(t))}function pt(e,t){const{exact:s,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(s){if(ie(t.options.mutationKey)!==ie(o))return!1}else if(!ge(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Ze(e,t){return(t?.queryKeyHashFn||ie)(e)}function ie(e){return JSON.stringify(e,(t,s)=>_e(s)?Object.keys(s).sort().reduce((r,a)=>(r[a]=s[a],r),{}):s)}function ge(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>ge(e[s],t[s])):!1}var Ks=Object.prototype.hasOwnProperty;function Ae(e,t){if(e===t)return e;const s=yt(e)&&yt(t);if(!s&&!(_e(e)&&_e(t)))return t;const a=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),l=o.length,i=s?new Array(l):{};let c=0;for(let h=0;h<l;h++){const d=s?h:o[h],b=e[d],f=t[d];if(b===f){i[d]=b,(s?h<a:Ks.call(e,d))&&c++;continue}if(b===null||f===null||typeof b!="object"||typeof f!="object"){i[d]=f;continue}const g=Ae(b,f);i[d]=g,g===b&&c++}return a===l&&c===a?e:i}function we(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function yt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _e(e){if(!gt(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!gt(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function gt(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vs(e){return new Promise(t=>{ne.setTimeout(t,e)})}function Fe(e,t,s){if(typeof s.structuralSharing=="function")return s.structuralSharing(e,t);if(s.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Ae(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${r}`),r}return Ae(e,t)}return t}function Bs(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function Ys(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var Ce=Symbol();function Yt(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Ce&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ce?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zt(e,t){return typeof e=="function"?e(...t):!!e}var Zs=class extends ue{#e;#t;#s;constructor(){super(),this.#s=e=>{if(!ae&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Xe=new Zs;function Qe(){let e,t;const s=new Promise((a,o)=>{e=a,t=o});s.status="pending",s.catch(()=>{});function r(a){Object.assign(s,a),delete s.resolve,delete s.reject}return s.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},s.reject=a=>{r({status:"rejected",reason:a}),t(a)},s}var Xs=zs;function Gs(){let e=[],t=0,s=i=>{i()},r=i=>{i()},a=Xs;const o=i=>{t?e.push(i):a(()=>{s(i)})},l=()=>{const i=e;e=[],i.length&&a(()=>{r(()=>{i.forEach(c=>{s(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||l()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{s=i},setBatchNotifyFunction:i=>{r=i},setScheduler:i=>{a=i}}}var L=Gs(),en=class extends ue{#e=!0;#t;#s;constructor(){super(),this.#s=e=>{if(!ae&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#e}},Se=new en;function tn(e){return Math.min(1e3*2**e,3e4)}function Xt(e){return(e??"online")==="online"?Se.isOnline():!0}var Ie=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Gt(e){let t=!1,s=0,r;const a=Qe(),o=()=>a.status!=="pending",l=v=>{if(!o()){const O=new Ie(v);f(O),e.onCancel?.(O)}},i=()=>{t=!0},c=()=>{t=!1},h=()=>Xe.isFocused()&&(e.networkMode==="always"||Se.isOnline())&&e.canRun(),d=()=>Xt(e.networkMode)&&e.canRun(),b=v=>{o()||(r?.(),a.resolve(v))},f=v=>{o()||(r?.(),a.reject(v))},g=()=>new Promise(v=>{r=O=>{(o()||h())&&v(O)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),p=()=>{if(o())return;let v;const O=s===0?e.initialPromise:void 0;try{v=O??e.fn()}catch(j){v=Promise.reject(j)}Promise.resolve(v).then(b).catch(j=>{if(o())return;const M=e.retry??(ae?0:3),A=e.retryDelay??tn,C=typeof A=="function"?A(s,j):A,S=M===!0||typeof M=="number"&&s<M||typeof M=="function"&&M(s,j);if(t||!S){f(j);return}s++,e.onFail?.(s,j),Vs(C).then(()=>h()?void 0:g()).then(()=>{t?f(j):p()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r?.(),a),cancelRetry:i,continueRetry:c,canStart:d,start:()=>(d()?p():g().then(p),a)}}var es=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pe(this.gcTime)&&(this.#e=ne.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ae?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(ne.clearTimeout(this.#e),this.#e=void 0)}},sn=class extends es{#e;#t;#s;#r;#n;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#s=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=vt(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=vt(this.options);t.data!==void 0&&(this.setState(bt(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,t){const s=Fe(this.state.data,e,this.options);return this.#a({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(W).catch(W):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Z(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ce||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ee(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Bt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const i=this.observers.find(c=>c.options.queryFn);i&&this.setOptions(i.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const s=new AbortController,r=i=>{Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},a=()=>{const i=Yt(this.options,t),h=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#o=!1,this.options.persister?this.options.persister(i,h,this):i(h)},l=(()=>{const i={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:a};return r(i),i})();this.options.behavior?.onFetch(l,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#a({type:"fetch",meta:l.fetchOptions?.meta}),this.#n=Gt({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:i=>{i instanceof Ie&&i.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(i,c)=>{this.#a({type:"failed",failureCount:i,error:c})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const i=await this.#n.start();if(i===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(i),this.#s.config.onSuccess?.(i,this),this.#s.config.onSettled?.(i,this.state.error,this),i}catch(i){if(i instanceof Ie){if(i.silent)return this.#n.promise;if(i.revert){if(this.state.data===void 0)throw i;return this.state.data}}throw this.#a({type:"error",error:i}),this.#s.config.onError?.(i,this),this.#s.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#a(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...ts(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...bt(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const a=e.error;return{...s,error:a,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),L.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function ts(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xt(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bt(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vt(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var nn=class extends ue{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#o=Qe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#s=void 0;#r=void 0;#n;#i;#o;#a;#p;#h;#f;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),xt(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#j(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Z(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!we(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&jt(this.#t,s,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==s||Z(this.options.enabled,this.#t)!==Z(t.enabled,this.#t)||ee(this.options.staleTime,this.#t)!==ee(t.staleTime,this.#t))&&this.#y();const a=this.#g();r&&(this.#t!==s||Z(this.options.enabled,this.#t)!==Z(t.enabled,this.#t)||a!==this.#l)&&this.#b(a)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(t,e);return an(this,s)&&(this.#r=s,this.#i=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(W)),t}#y(){this.#x();const e=ee(this.options.staleTime,this.#t);if(ae||this.#r.isStale||!Pe(e))return;const s=Bt(this.#r.dataUpdatedAt,e)+1;this.#c=ne.setTimeout(()=>{this.#r.isStale||this.updateResult()},s)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#b(e){this.#j(),this.#l=e,!(ae||Z(this.options.enabled,this.#t)===!1||!Pe(this.#l)||this.#l===0)&&(this.#u=ne.setInterval(()=>{(this.options.refetchIntervalInBackground||Xe.isFocused())&&this.#d()},this.#l))}#v(){this.#y(),this.#b(this.#g())}#x(){this.#c&&(ne.clearTimeout(this.#c),this.#c=void 0)}#j(){this.#u&&(ne.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#t,r=this.options,a=this.#r,o=this.#n,l=this.#i,c=e!==s?e.state:this.#s,{state:h}=e;let d={...h},b=!1,f;if(t._optimisticResults){const P=this.hasListeners(),F=!P&&xt(e,t),q=P&&jt(e,s,t,r);(F||q)&&(d={...d,...ts(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:v}=d;f=d.data;let O=!1;if(t.placeholderData!==void 0&&f===void 0&&v==="pending"){let P;a?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(P=a.data,O=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,P!==void 0&&(v="success",f=Fe(a?.data,P,t),b=!0)}if(t.select&&f!==void 0&&!O)if(a&&f===o?.data&&t.select===this.#p)f=this.#h;else try{this.#p=t.select,f=t.select(f),f=Fe(a?.data,f,t),this.#h=f,this.#a=null}catch(P){this.#a=P}this.#a&&(g=this.#a,f=this.#h,p=Date.now(),v="error");const j=d.fetchStatus==="fetching",M=v==="pending",A=v==="error",C=M&&j,S=f!==void 0,E={status:v,fetchStatus:d.fetchStatus,isPending:M,isSuccess:v==="success",isError:A,isInitialLoading:C,isLoading:C,data:f,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:j,isRefetching:j&&!M,isLoadingError:A&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:A&&S,isStale:Ge(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Z(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=Q=>{E.status==="error"?Q.reject(E.error):E.data!==void 0&&Q.resolve(E.data)},F=()=>{const Q=this.#o=E.promise=Qe();P(Q)},q=this.#o;switch(q.status){case"pending":e.queryHash===s.queryHash&&P(q);break;case"fulfilled":(E.status==="error"||E.data!==q.value)&&F();break;case"rejected":(E.status!=="error"||E.error!==q.reason)&&F();break}}return E}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#i=this.options,this.#n.data!==void 0&&(this.#f=this.#t),we(t,e))return;this.#r=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,a=typeof r=="function"?r():r;if(a==="all"||!a&&!this.#m.size)return!0;const o=new Set(a??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(l=>{const i=l;return this.#r[i]!==e[i]&&o.has(i)})};this.#C({listeners:s()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#s=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#C(e){L.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function rn(e,t){return Z(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function xt(e,t){return rn(e,t)||e.state.data!==void 0&&qe(e,t,t.refetchOnMount)}function qe(e,t,s){if(Z(t.enabled,e)!==!1&&ee(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&Ge(e,t)}return!1}function jt(e,t,s,r){return(e!==t||Z(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Ge(e,s)}function Ge(e,t){return Z(t.enabled,e)!==!1&&e.isStaleByTime(ee(t.staleTime,e))}function an(e,t){return!we(e.getCurrentResult(),t)}function wt(e){return{onFetch:(t,s)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let i={pages:[],pageParams:[]},c=0;const h=async()=>{let d=!1;const b=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(t.signal.aborted?d=!0:t.signal.addEventListener("abort",()=>{d=!0}),t.signal)})},f=Yt(t.options,t.fetchOptions),g=async(p,v,O)=>{if(d)return Promise.reject();if(v==null&&p.pages.length)return Promise.resolve(p);const M=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:v,direction:O?"backward":"forward",meta:t.options.meta};return b(k),k})(),A=await f(M),{maxPages:C}=t.options,S=O?Ys:Bs;return{pages:S(p.pages,A,C),pageParams:S(p.pageParams,v,C)}};if(a&&o.length){const p=a==="backward",v=p?on:Ct,O={pages:o,pageParams:l},j=v(r,O);i=await g(O,j,p)}else{const p=e??o.length;do{const v=c===0?l[0]??r.initialPageParam:Ct(r,i);if(c>0&&v==null)break;i=await g(i,v),c++}while(c<p)}return i};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=h}}}function Ct(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function on(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var ln=class extends es{#e;#t;#s;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#s=e.mutationCache,this.#t=[],this.state=e.state||ss(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Gt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(o,l)=>{this.#n({type:"failed",failureCount:o,error:l})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const r=this.state.status==="pending",a=!this.#r.canStart();try{if(r)t();else{this.#n({type:"pending",variables:e,isPaused:a}),await this.#s.config.onMutate?.(e,this,s);const l=await this.options.onMutate?.(e,s);l!==this.state.context&&this.#n({type:"pending",context:l,variables:e,isPaused:a})}const o=await this.#r.start();return await this.#s.config.onSuccess?.(o,e,this.state.context,this,s),await this.options.onSuccess?.(o,e,this.state.context,s),await this.#s.config.onSettled?.(o,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(o,null,e,this.state.context,s),this.#n({type:"success",data:o}),o}catch(o){try{throw await this.#s.config.onError?.(o,e,this.state.context,this,s),await this.options.onError?.(o,e,this.state.context,s),await this.#s.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,o,e,this.state.context,s),o}finally{this.#n({type:"error",error:o})}}finally{this.#s.runNext(this)}}#n(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),L.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function ss(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cn=class extends ue{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(e,t,s){const r=new ln({client:e,mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#e.add(e);const t=ve(e);if(typeof t=="string"){const s=this.#t.get(t);s?s.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ve(e);if(typeof t=="string"){const s=this.#t.get(t);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ve(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=ve(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){L.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>pt(t,s))}findAll(e={}){return this.getAll().filter(t=>pt(e,t))}notify(e){L.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return L.batch(()=>Promise.all(e.map(t=>t.continue().catch(W))))}};function ve(e){return e.options.scope?.id}var un=class extends ue{#e;#t=void 0;#s;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),we(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),t?.mutationKey&&this.options.mutationKey&&ie(t.mutationKey)!==ie(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#i(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#i()}mutate(e,t){return this.#r=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#n(){const e=this.#s?.state??ss();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#i(e){L.batch(()=>{if(this.#r&&this.hasListeners()){const t=this.#t.variables,s=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#r.onSuccess?.(e.data,t,s,r),this.#r.onSettled?.(e.data,null,t,s,r)):e?.type==="error"&&(this.#r.onError?.(e.error,t,s,r),this.#r.onSettled?.(void 0,e.error,t,s,r))}this.listeners.forEach(t=>{t(this.#t)})})}},dn=class extends ue{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,s){const r=t.queryKey,a=t.queryHash??Ze(r,t);let o=this.get(a);return o||(o=new sn({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){L.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>mt(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>mt(e,s)):t}notify(e){L.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){L.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){L.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},hn=class{#e;#t;#s;#r;#n;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new dn,this.#t=e.mutationCache||new cn,this.#s=e.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Xe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Se.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#e.build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(ee(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,l=Ws(t,o);if(l!==void 0)return this.#e.build(this,r).setData(l,{...s,manual:!0})}setQueriesData(e,t,s){return L.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;L.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#e;return L.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=L.batch(()=>this.#e.findAll(e).map(a=>a.cancel(s)));return Promise.all(r).then(W).catch(W)}invalidateQueries(e,t={}){return L.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=L.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,s);return s.throwOnError||(o=o.catch(W)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(W)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t);return s.isStaleByTime(ee(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(W).catch(W)}fetchInfiniteQuery(e){return e.behavior=wt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(W).catch(W)}ensureInfiniteQueryData(e){return e.behavior=wt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Se.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(e){this.#s=e}setQueryDefaults(e,t){this.#r.set(ie(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],s={};return t.forEach(r=>{ge(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){this.#n.set(ie(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],s={};return t.forEach(r=>{ge(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#s.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ze(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ce&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#s.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},ns=N.createContext(void 0),G=e=>{const t=N.useContext(ns);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fn=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),n.jsx(ns.Provider,{value:e,children:t})),rs=N.createContext(!1),mn=()=>N.useContext(rs);rs.Provider;function pn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var yn=N.createContext(pn()),gn=()=>N.useContext(yn),bn=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},vn=e=>{N.useEffect(()=>{e.clearReset()},[e])},xn=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Zt(s,[e.error,r])),jn=e=>{if(e.suspense){const s=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>s(r(...a)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},wn=(e,t)=>e.isLoading&&e.isFetching&&!t,Cn=(e,t)=>e?.suspense&&t.isPending,St=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Sn(e,t,s){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=mn(),a=gn(),o=G(),l=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(l),process.env.NODE_ENV!=="production"&&(l.queryFn||console.error(`[${l.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),l._optimisticResults=r?"isRestoring":"optimistic",jn(l),bn(l,a),vn(a);const i=!o.getQueryCache().get(l.queryHash),[c]=N.useState(()=>new t(o,l)),h=c.getOptimisticResult(l),d=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(b=>{const f=d?c.subscribe(L.batchCalls(b)):W;return c.updateResult(),f},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setOptions(l)},[l,c]),Cn(l,h))throw St(l,c,a);if(xn({result:h,errorResetBoundary:a,throwOnError:l.throwOnError,query:o.getQueryCache().get(l.queryHash),suspense:l.suspense}))throw h.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(l,h),l.experimental_prefetchInRender&&!ae&&wn(h,r)&&(i?St(l,c,a):o.getQueryCache().get(l.queryHash)?.promise)?.catch(W).finally(()=>{c.updateResult()}),l.notifyOnChangeProps?h:c.trackResult(h)}function as(e,t){return Sn(e,nn)}function de(e,t){const s=G(),[r]=N.useState(()=>new un(s,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const a=N.useSyncExternalStore(N.useCallback(l=>r.subscribe(L.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=N.useCallback((l,i)=>{r.mutate(l,i).catch(W)},[r]);if(a.error&&Zt(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}const Nn=new hn({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1}}}),En=({children:e})=>n.jsx(fn,{client:Nn,children:e});function J(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function On(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const xe=43200,Nt=1440;let Tn={};function Rn(){return Tn}function Et(e){const t=J(e),s=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return s.setUTCFullYear(t.getFullYear()),+e-+s}function je(e,t){const s=J(e),r=J(t),a=s.getTime()-r.getTime();return a<0?-1:a>0?1:a}function kn(e){return On(e,Date.now())}function Dn(e,t){const s=J(e),r=J(t),a=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return a*12+o}function Mn(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Pn(e,t){return+J(e)-+J(t)}function An(e){const t=J(e);return t.setHours(23,59,59,999),t}function _n(e){const t=J(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}function Fn(e){const t=J(e);return+An(t)==+_n(t)}function Qn(e,t){const s=J(e),r=J(t),a=je(s,r),o=Math.abs(Dn(s,r));let l;if(o<1)l=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let i=je(s,r)===-a;Fn(J(e))&&o===1&&je(e,r)===1&&(i=!1),l=a*(o-Number(i))}return l===0?0:l}function In(e,t,s){const r=Pn(e,t)/1e3;return Mn(s?.roundingMethod)(r)}const qn={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ln=(e,t,s)=>{let r;const a=qn[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function Me(e){return(t={})=>{const s=t.width?String(t.width):e.defaultWidth;return e.formats[s]||e.formats[e.defaultWidth]}}const Un={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jn={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$n={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hn={date:Me({formats:Un,defaultWidth:"full"}),time:Me({formats:Jn,defaultWidth:"full"}),dateTime:Me({formats:$n,defaultWidth:"full"})},zn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wn=(e,t,s,r)=>zn[e];function me(e){return(t,s)=>{const r=s?.context?String(s.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,i=s?.width?String(s.width):l;a=e.formattingValues[i]||e.formattingValues[l]}else{const l=e.defaultWidth,i=s?.width?String(s.width):e.defaultWidth;a=e.values[i]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}const Kn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vn={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Yn={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Zn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Xn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Gn=(e,t)=>{const s=Number(e),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},er={ordinalNumber:Gn,era:me({values:Kn,defaultWidth:"wide"}),quarter:me({values:Vn,defaultWidth:"wide",argumentCallback:e=>e-1}),month:me({values:Bn,defaultWidth:"wide"}),day:me({values:Yn,defaultWidth:"wide"}),dayPeriod:me({values:Zn,defaultWidth:"wide",formattingValues:Xn,defaultFormattingWidth:"wide"})};function pe(e){return(t,s={})=>{const r=s.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const l=o[0],i=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?sr(i,b=>b.test(l)):tr(i,b=>b.test(l));let h;h=e.valueCallback?e.valueCallback(c):c,h=s.valueCallback?s.valueCallback(h):h;const d=t.slice(l.length);return{value:h,rest:d}}}function tr(e,t){for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t(e[s]))return s}function sr(e,t){for(let s=0;s<e.length;s++)if(t(e[s]))return s}function nr(e){return(t,s={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=s.valueCallback?s.valueCallback(l):l;const i=t.slice(a.length);return{value:l,rest:i}}}const rr=/^(\d+)(th|st|nd|rd)?/i,ar=/\d+/i,ir={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},or={any:[/^b/i,/^(a|c)/i]},lr={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cr={any:[/1/i,/2/i,/3/i,/4/i]},ur={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dr={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hr={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},fr={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},mr={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},pr={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yr={ordinalNumber:nr({matchPattern:rr,parsePattern:ar,valueCallback:e=>parseInt(e,10)}),era:pe({matchPatterns:ir,defaultMatchWidth:"wide",parsePatterns:or,defaultParseWidth:"any"}),quarter:pe({matchPatterns:lr,defaultMatchWidth:"wide",parsePatterns:cr,defaultParseWidth:"any",valueCallback:e=>e+1}),month:pe({matchPatterns:ur,defaultMatchWidth:"wide",parsePatterns:dr,defaultParseWidth:"any"}),day:pe({matchPatterns:hr,defaultMatchWidth:"wide",parsePatterns:fr,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:mr,defaultMatchWidth:"any",parsePatterns:pr,defaultParseWidth:"any"})},gr={code:"en-US",formatDistance:Ln,formatLong:Hn,formatRelative:Wn,localize:er,match:yr,options:{weekStartsOn:0,firstWeekContainsDate:1}};function br(e,t,s){const r=Rn(),a=s?.locale??r.locale??gr,o=2520,l=je(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const i=Object.assign({},s,{addSuffix:s?.addSuffix,comparison:l});let c,h;l>0?(c=J(t),h=J(e)):(c=J(e),h=J(t));const d=In(h,c),b=(Et(h)-Et(c))/1e3,f=Math.round((d-b)/60);let g;if(f<2)return s?.includeSeconds?d<5?a.formatDistance("lessThanXSeconds",5,i):d<10?a.formatDistance("lessThanXSeconds",10,i):d<20?a.formatDistance("lessThanXSeconds",20,i):d<40?a.formatDistance("halfAMinute",0,i):d<60?a.formatDistance("lessThanXMinutes",1,i):a.formatDistance("xMinutes",1,i):f===0?a.formatDistance("lessThanXMinutes",1,i):a.formatDistance("xMinutes",f,i);if(f<45)return a.formatDistance("xMinutes",f,i);if(f<90)return a.formatDistance("aboutXHours",1,i);if(f<Nt){const p=Math.round(f/60);return a.formatDistance("aboutXHours",p,i)}else{if(f<o)return a.formatDistance("xDays",1,i);if(f<xe){const p=Math.round(f/Nt);return a.formatDistance("xDays",p,i)}else if(f<xe*2)return g=Math.round(f/xe),a.formatDistance("aboutXMonths",g,i)}if(g=Qn(h,c),g<12){const p=Math.round(f/xe);return a.formatDistance("xMonths",p,i)}else{const p=g%12,v=Math.trunc(g/12);return p<3?a.formatDistance("aboutXYears",v,i):p<9?a.formatDistance("overXYears",v,i):a.formatDistance("almostXYears",v+1,i)}}function Ne(e,t){return br(e,kn(e),t)}/**
|
|
23
|
-
* @license lucide-react v0.545.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const vr=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,r)=>r?r.toUpperCase():s.toLowerCase()),Ot=e=>{const t=xr(e);return t.charAt(0).toUpperCase()+t.slice(1)},is=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim(),jr=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
28
|
-
* @license lucide-react v0.545.0 - ISC
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the ISC license.
|
|
31
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var wr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
33
|
-
* @license lucide-react v0.545.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const Cr=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...i},c)=>y.createElement("svg",{ref:c,...wr,width:t,height:t,stroke:e,strokeWidth:r?Number(s)*24/Number(t):s,className:is("lucide",a),...!o&&!jr(i)&&{"aria-hidden":"true"},...i},[...l.map(([h,d])=>y.createElement(h,d)),...Array.isArray(o)?o:[o]]));/**
|
|
38
|
-
* @license lucide-react v0.545.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const X=(e,t)=>{const s=y.forwardRef(({className:r,...a},o)=>y.createElement(Cr,{ref:o,iconNode:t,className:is(`lucide-${vr(Ot(e))}`,`lucide-${e}`,r),...a}));return s.displayName=Ot(e),s};/**
|
|
43
|
-
* @license lucide-react v0.545.0 - ISC
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the ISC license.
|
|
46
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const Sr=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],re=X("refresh-cw",Sr);/**
|
|
48
|
-
* @license lucide-react v0.545.0 - ISC
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the ISC license.
|
|
51
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const Nr=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],le=X("trash",Nr);/**
|
|
53
|
-
* @license lucide-react v0.545.0 - ISC
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the ISC license.
|
|
56
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const Er=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],et=X("x",Er);function Or(e,t,s,r){function a(o){return o instanceof s?o:new s(function(l){l(o)})}return new(s||(s=Promise))(function(o,l){function i(d){try{h(r.next(d))}catch(b){l(b)}}function c(d){try{h(r.throw(d))}catch(b){l(b)}}function h(d){d.done?o(d.value):a(d.value).then(i,c)}h((r=r.apply(e,[])).next())})}var Tr=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,s=[],r=0;r<e.rangeCount;r++)s.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||s.forEach(function(a){e.addRange(a)}),t&&t.focus()}},Rr=Tr,Tt={"text/plain":"Text","text/html":"Url",default:"Text"},kr="Copy to clipboard: #{key}, Enter";function Dr(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function Mr(e,t){var s,r,a,o,l,i,c=!1;t||(t={}),s=t.debug||!1;try{a=Rr(),o=document.createRange(),l=document.getSelection(),i=document.createElement("span"),i.textContent=e,i.ariaHidden="true",i.style.all="unset",i.style.position="fixed",i.style.top=0,i.style.clip="rect(0, 0, 0, 0)",i.style.whiteSpace="pre",i.style.webkitUserSelect="text",i.style.MozUserSelect="text",i.style.msUserSelect="text",i.style.userSelect="text",i.addEventListener("copy",function(d){if(d.stopPropagation(),t.format)if(d.preventDefault(),typeof d.clipboardData>"u"){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var b=Tt[t.format]||Tt.default;window.clipboardData.setData(b,e)}else d.clipboardData.clearData(),d.clipboardData.setData(t.format,e);t.onCopy&&(d.preventDefault(),t.onCopy(d.clipboardData))}),document.body.appendChild(i),o.selectNodeContents(i),l.addRange(o);var h=document.execCommand("copy");if(!h)throw new Error("copy command was unsuccessful");c=!0}catch(d){s&&console.error("unable to copy using execCommand: ",d),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(b){s&&console.error("unable to copy using clipboardData: ",b),s&&console.error("falling back to prompt"),r=Dr("message"in t?t.message:kr),window.prompt(r,e)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(o):l.removeAllRanges()),i&&document.body.removeChild(i),a()}return c}var Pr=Mr;function te(e){return Object.prototype.toString.call(e)==="[object Object]"}function ye(e){return Array.isArray(e)?e.length:te(e)?Object.keys(e).length:0}function Ar(e,t){if(typeof e=="string")return e;try{return JSON.stringify(e,(s,r)=>{switch(typeof r){case"bigint":return String(r)+"n";case"number":case"boolean":case"object":case"string":return r;default:return String(r)}},t)}catch(s){return`${s.name}: ${s.message}`||"JSON.stringify failed"}}function _r(e){return Or(this,void 0,void 0,function*(){try{yield navigator.clipboard.writeText(e)}catch{Pr(e)}})}function Rt(e,t,s,r,a,o){if(o&&o.collapsed!==void 0)return!!o.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&t>r)return!0;const l=ye(e);if(typeof r=="function"){const i=tt(r,[{node:e,depth:t,indexOrName:s,size:l}]);if(typeof i=="boolean")return i}return!!(Array.isArray(e)&&l>a||te(e)&&l>a)}function kt(e,t,s,r,a,o){if(o&&o.collapsed!==void 0)return!!o.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&t>r)return!0;const l=Math.ceil(e.length/100);if(typeof r=="function"){const i=tt(r,[{node:e,depth:t,indexOrName:s,size:l}]);if(typeof i=="boolean")return i}return!!(Array.isArray(e)&&l>a||te(e)&&l>a)}function ce(e,t,s){return typeof e=="boolean"?e:!!(typeof e=="number"&&t>e||e==="collapsed"&&s||e==="expanded"&&!s)}function tt(e,t){try{return e(...t)}catch(s){reportError(s)}}function os(e){if(e===!0||te(e)&&e.add===!0)return!0}function Dt(e){if(e===!0||te(e)&&e.edit===!0)return!0}function st(e){if(e===!0||te(e)&&e.delete===!0)return!0}function Fr(e){return typeof e=="function"}function ls(e){return!e||e.add===void 0||!!e.add}function Mt(e){return!e||e.edit===void 0||!!e.edit}function nt(e){return!e||e.delete===void 0||!!e.delete}function Ee(e){return!e||e.enableClipboard===void 0||!!e.enableClipboard}function Qr(e){return!e||e.matchesURL===void 0||!!e.matchesURL}function Ir(e,t){return e==="string"?t.trim().replace(/^\"([\s\S]+?)\"$/,"$1"):t}var Pt;function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Le.apply(this,arguments)}var rt=function(t){return N.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},t),Pt||(Pt=N.createElement("path",{fill:"currentColor",d:"M12.473 5.806a.666.666 0 0 0-.946 0L8.473 8.86a.667.667 0 0 1-.946 0L4.473 5.806a.667.667 0 1 0-.946.94l3.06 3.06a2 2 0 0 0 2.826 0l3.06-3.06a.667.667 0 0 0 0-.94Z"})))},At;function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Ue.apply(this,arguments)}var qr=function(t){return N.createElement("svg",Ue({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),At||(At=N.createElement("path",{fill:"currentColor",d:"M17.542 2.5h-4.75a3.963 3.963 0 0 0-3.959 3.958v4.75a3.963 3.963 0 0 0 3.959 3.959h4.75a3.963 3.963 0 0 0 3.958-3.959v-4.75A3.963 3.963 0 0 0 17.542 2.5Zm2.375 8.708a2.378 2.378 0 0 1-2.375 2.375h-4.75a2.378 2.378 0 0 1-2.375-2.375v-4.75a2.378 2.378 0 0 1 2.375-2.375h4.75a2.378 2.378 0 0 1 2.375 2.375v4.75Zm-4.75 6.334a3.963 3.963 0 0 1-3.959 3.958h-4.75A3.963 3.963 0 0 1 2.5 17.542v-4.75a3.963 3.963 0 0 1 3.958-3.959.791.791 0 1 1 0 1.584 2.378 2.378 0 0 0-2.375 2.375v4.75a2.378 2.378 0 0 0 2.375 2.375h4.75a2.378 2.378 0 0 0 2.375-2.375.792.792 0 1 1 1.584 0Z"})))},_t,Ft;function Je(){return Je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Je.apply(this,arguments)}var Lr=function(t){return N.createElement("svg",Je({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),_t||(_t=N.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.755 3.755 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.755 3.755 0 0 0 17.25 3Zm2.25 14.25a2.25 2.25 0 0 1-2.25 2.25H6.75a2.25 2.25 0 0 1-2.25-2.25V6.75A2.25 2.25 0 0 1 6.75 4.5h10.5a2.25 2.25 0 0 1 2.25 2.25v10.5Z"})),Ft||(Ft=N.createElement("path",{fill:"#14C786",d:"M10.312 14.45 7.83 11.906a.625.625 0 0 0-.896 0 .659.659 0 0 0 0 .918l2.481 2.546a1.264 1.264 0 0 0 .896.381 1.237 1.237 0 0 0 .895-.38l5.858-6.011a.658.658 0 0 0 0-.919.625.625 0 0 0-.896 0l-5.857 6.01Z"})))};function Oe({node:e,nodeMeta:t}){const{customizeCopy:s,CopyComponent:r,CopiedComponent:a}=y.useContext(se),[o,l]=y.useState(!1),i=c=>{c.stopPropagation();const h=s(e,t);typeof h=="string"&&h&&_r(h),l(!0),setTimeout(()=>l(!1),3e3)};return o?typeof a=="function"?n.jsx(a,{className:"json-view--copy",style:{display:"inline-block"}}):n.jsx(Lr,{className:"json-view--copy",style:{display:"inline-block"}}):typeof r=="function"?n.jsx(r,{onClick:i,className:"json-view--copy"}):n.jsx(qr,{onClick:i,className:"json-view--copy"})}function $e({indexOrName:e,value:t,depth:s,deleteHandle:r,editHandle:a,parent:o,parentPath:l}){const{displayArrayIndex:i}=y.useContext(se),c=Array.isArray(o);return n.jsxs("div",Object.assign({className:"json-view--pair"},{children:[!c||c&&i?n.jsxs(n.Fragment,{children:[n.jsx("span",Object.assign({className:typeof e=="number"?"json-view--index":"json-view--property"},{children:e})),":"," "]}):n.jsx(n.Fragment,{}),n.jsx(us,{node:t,depth:s+1,deleteHandle:(h,d)=>r(h,d),editHandle:(h,d,b,f)=>a(h,d,b,f),parent:o,indexOrName:e,parentPath:l})]}))}var Qt,It;function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},He.apply(this,arguments)}var at=function(t){return N.createElement("svg",He({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Qt||(Qt=N.createElement("path",{fill:"currentColor",d:"M18.75 6h-2.325a3.757 3.757 0 0 0-3.675-3h-1.5a3.757 3.757 0 0 0-3.675 3H5.25a.75.75 0 0 0 0 1.5H6v9.75A3.754 3.754 0 0 0 9.75 21h4.5A3.754 3.754 0 0 0 18 17.25V7.5h.75a.75.75 0 1 0 0-1.5Zm-7.5-1.5h1.5A2.255 2.255 0 0 1 14.872 6H9.128a2.255 2.255 0 0 1 2.122-1.5Zm5.25 12.75a2.25 2.25 0 0 1-2.25 2.25h-4.5a2.25 2.25 0 0 1-2.25-2.25V7.5h9v9.75Z"})),It||(It=N.createElement("path",{fill:"#DA0000",d:"M10.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM13.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z"})))},qt,Lt;function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ze.apply(this,arguments)}var cs=function(t){return N.createElement("svg",ze({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),qt||(qt=N.createElement("path",{fill:"currentColor",d:"M21 6.75v10.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3h10.5A3.754 3.754 0 0 1 21 6.75Zm-1.5 0c0-1.24-1.01-2.25-2.25-2.25H6.75C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25V6.75Z"})),Lt||(Lt=N.createElement("path",{fill:"#14C786",d:"M15 12.75a.75.75 0 1 0 0-1.5h-2.25V9a.75.75 0 1 0-1.5 0v2.25H9a.75.75 0 1 0 0 1.5h2.25V15a.75.75 0 1 0 1.5 0v-2.25H15Z"})))},Ut,Jt;function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},We.apply(this,arguments)}var it=function(t){return N.createElement("svg",We({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Ut||(Ut=N.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})),Jt||(Jt=N.createElement("path",{fill:"#14C786",d:"m10.85 13.96-1.986-2.036a.5.5 0 0 0-.716 0 .527.527 0 0 0 0 .735l1.985 2.036a1.01 1.01 0 0 0 .717.305.99.99 0 0 0 .716-.305l4.686-4.808a.526.526 0 0 0 0-.735.5.5 0 0 0-.716 0l-4.687 4.809Z"})))},$t,Ht;function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Ke.apply(this,arguments)}var ot=function(t){return N.createElement("svg",Ke({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),$t||($t=N.createElement("path",{fill:"#DA0000",d:"M15 9a.75.75 0 0 0-1.06 0L12 10.94 10.06 9A.75.75 0 0 0 9 10.06L10.94 12 9 13.94A.75.75 0 0 0 10.06 15L12 13.06 13.94 15A.75.75 0 0 0 15 13.94L13.06 12 15 10.06A.75.75 0 0 0 15 9Z"})),Ht||(Ht=N.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})))};function Ur({originNode:e,node:t,depth:s,index:r,deleteHandle:a,customOptions:o,startIndex:l,parent:i,parentPath:c}){const{enableClipboard:h,src:d,onEdit:b,onChange:f,forceUpdate:g,displaySize:p,CustomOperation:v}=y.useContext(se),O=[...c,String(r)],[j,M]=y.useState(!0),A=y.useCallback((k,E,P)=>{e[k]=E,b&&b({newValue:E,oldValue:P,depth:s,src:d,indexOrName:k,parentType:"array",parentPath:c}),f&&f({type:"edit",depth:s,src:d,indexOrName:k,parentType:"array",parentPath:c}),g()},[t,b,f,g]),C=k=>{e.splice(k,1),a&&a(k,c),g()},S=n.jsxs(n.Fragment,{children:[!j&&n.jsxs("span",Object.assign({onClick:()=>M(!0),className:"jv-size-chevron"},{children:[ce(p,s,j)&&n.jsxs("span",Object.assign({className:"jv-size"},{children:[ye(t)," Items"]})),n.jsx(rt,{className:"jv-chevron"})]})),!j&&h&&Ee(o)&&n.jsx(Oe,{node:t,nodeMeta:{depth:s,indexOrName:r,parent:i,parentPath:c,currentPath:O}}),typeof v=="function"?n.jsx(v,{node:t}):null]});return n.jsxs("div",{children:[n.jsx("span",{children:"["}),S,j?n.jsxs("button",Object.assign({onClick:()=>M(!1),className:"jv-button"},{children:[l," ... ",l+t.length-1]})):n.jsx("div",Object.assign({className:"jv-indent"},{children:t.map((k,E)=>n.jsx($e,{indexOrName:E+l,value:k,depth:s,parent:t,deleteHandle:C,editHandle:A,parentPath:c},String(r)+String(E)))})),n.jsx("span",{children:"]"})]})}function Jr({node:e,depth:t,deleteHandle:s,indexOrName:r,customOptions:a,parent:o,parentPath:l}){const i=typeof r<"u"?[...l,String(r)]:l,c=[];for(let I=0;I<e.length;I+=100)c.push(e.slice(I,I+100));const{collapsed:h,enableClipboard:d,collapseObjectsAfterLength:b,editable:f,onDelete:g,src:p,onAdd:v,CustomOperation:O,onChange:j,forceUpdate:M,displaySize:A}=y.useContext(se),[C,S]=y.useState(kt(e,t,r,h,b,a));y.useEffect(()=>{S(kt(e,t,r,h,b,a))},[h,b]);const[k,E]=y.useState(!1),P=()=>{E(!1),s&&s(r,l),g&&g({value:e,depth:t,src:p,indexOrName:r,parentType:"array",parentPath:l}),j&&j({type:"delete",depth:t,src:p,indexOrName:r,parentType:"array",parentPath:l})},[F,q]=y.useState(!1),Q=()=>{const I=e;I.push(null),v&&v({indexOrName:I.length-1,depth:t,src:p,parentType:"array",parentPath:l}),j&&j({type:"add",indexOrName:I.length-1,depth:t,src:p,parentType:"array",parentPath:l}),M()},U=k||F,K=()=>{E(!1),q(!1)},V=n.jsxs(n.Fragment,{children:[!C&&!U&&n.jsxs("span",Object.assign({onClick:()=>S(!0),className:"jv-size-chevron"},{children:[ce(A,t,C)&&n.jsxs("span",Object.assign({className:"jv-size"},{children:[e.length," Items"]})),n.jsx(rt,{className:"jv-chevron"})]})),U&&n.jsx(it,{className:"json-view--edit",style:{display:"inline-block"},onClick:F?Q:P}),U&&n.jsx(ot,{className:"json-view--edit",style:{display:"inline-block"},onClick:K}),!C&&!U&&d&&Ee(a)&&n.jsx(Oe,{node:e,nodeMeta:{depth:t,indexOrName:r,parent:o,parentPath:l,currentPath:i}}),!C&&!U&&os(f)&&ls(a)&&n.jsx(cs,{className:"json-view--edit",onClick:()=>{Q()}}),!C&&!U&&st(f)&&nt(a)&&s&&n.jsx(at,{className:"json-view--edit",onClick:()=>E(!0)}),typeof O=="function"?n.jsx(O,{node:e}):null]});return n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"["}),V,C?n.jsx("button",Object.assign({onClick:()=>S(!1),className:"jv-button"},{children:"..."})):n.jsx("div",Object.assign({className:"jv-indent"},{children:c.map((I,H)=>n.jsx(Ur,{originNode:e,node:I,depth:t,index:H,startIndex:H*100,deleteHandle:s,customOptions:a,parentPath:l},String(r)+String(H)))})),n.jsx("span",{children:"]"}),C&&ce(A,t,C)&&n.jsxs("span",Object.assign({onClick:()=>S(!1),className:"jv-size"},{children:[e.length," Items"]}))]})}function $r({node:e,depth:t,indexOrName:s,deleteHandle:r,customOptions:a,parent:o,parentPath:l}){const{collapsed:i,onCollapse:c,enableClipboard:h,ignoreLargeArray:d,collapseObjectsAfterLength:b,editable:f,onDelete:g,src:p,onAdd:v,onEdit:O,onChange:j,forceUpdate:M,displaySize:A,CustomOperation:C}=y.useContext(se),S=typeof s<"u"?[...l,String(s)]:l;if(!d&&Array.isArray(e)&&e.length>100)return n.jsx(Jr,{node:e,depth:t,indexOrName:s,deleteHandle:r,customOptions:a,parentPath:S});const k=te(e),[E,P]=y.useState(Rt(e,t,s,i,b,a)),F=x=>{c?.({isCollapsing:!x,node:e,depth:t,indexOrName:s}),P(x)};y.useEffect(()=>{F(Rt(e,t,s,i,b,a))},[i,b]);const q=y.useCallback((x,T,Y)=>{Array.isArray(e)?e[+x]=T:e&&(e[x]=T),O&&O({newValue:T,oldValue:Y,depth:t,src:p,indexOrName:x,parentType:k?"object":"array",parentPath:S}),j&&j({type:"edit",depth:t,src:p,indexOrName:x,parentType:k?"object":"array",parentPath:S}),M()},[e,O,j,M]),Q=x=>{Array.isArray(e)?e.splice(+x,1):e&&delete e[x],M()},[U,K]=y.useState(!1),V=()=>{K(!1),r&&r(s,S),g&&g({value:e,depth:t,src:p,indexOrName:s,parentType:k?"object":"array",parentPath:S}),j&&j({type:"delete",depth:t,src:p,indexOrName:s,parentType:k?"object":"array",parentPath:S})},[I,H]=y.useState(!1),_=y.useRef(null),B=()=>{var x;if(k){const T=(x=_.current)===null||x===void 0?void 0:x.value;T&&(e[T]=null,_.current&&(_.current.value=""),H(!1),v&&v({indexOrName:T,depth:t,src:p,parentType:"object",parentPath:S}),j&&j({type:"add",indexOrName:T,depth:t,src:p,parentType:"object",parentPath:S}))}else if(Array.isArray(e)){const T=e;T.push(null),v&&v({indexOrName:T.length-1,depth:t,src:p,parentType:"array",parentPath:S}),j&&j({type:"add",indexOrName:T.length-1,depth:t,src:p,parentType:"array",parentPath:S})}M()},z=x=>{x.key==="Enter"?(x.preventDefault(),B()):x.key==="Escape"&&w()},u=U||I,w=()=>{K(!1),H(!1)},R=n.jsxs(n.Fragment,{children:[!E&&!u&&n.jsxs("span",Object.assign({onClick:()=>F(!0),className:"jv-size-chevron"},{children:[ce(A,t,E)&&n.jsxs("span",Object.assign({className:"jv-size"},{children:[ye(e)," Items"]})),n.jsx(rt,{className:"jv-chevron"})]})),I&&k&&n.jsx("input",{className:"json-view--input",placeholder:"property",ref:_,onKeyDown:z}),u&&n.jsx(it,{className:"json-view--edit",style:{display:"inline-block"},onClick:I?B:V}),u&&n.jsx(ot,{className:"json-view--edit",style:{display:"inline-block"},onClick:w}),!E&&!u&&h&&Ee(a)&&n.jsx(Oe,{node:e,nodeMeta:{depth:t,indexOrName:s,parent:o,parentPath:l,currentPath:S}}),!E&&!u&&os(f)&&ls(a)&&n.jsx(cs,{className:"json-view--edit",onClick:()=>{k?(H(!0),setTimeout(()=>{var x;return(x=_.current)===null||x===void 0?void 0:x.focus()})):B()}}),!E&&!u&&st(f)&&nt(a)&&r&&n.jsx(at,{className:"json-view--edit",onClick:()=>K(!0)}),typeof C=="function"?n.jsx(C,{node:e}):null]});return Array.isArray(e)?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"["}),R,E?n.jsx("button",Object.assign({onClick:()=>F(!1),className:"jv-button"},{children:"..."})):n.jsx("div",Object.assign({className:"jv-indent"},{children:e.map((x,T)=>n.jsx($e,{indexOrName:T,value:x,depth:t,parent:e,deleteHandle:Q,editHandle:q,parentPath:S},String(s)+String(T)))})),n.jsx("span",{children:"]"}),E&&ce(A,t,E)&&n.jsxs("span",Object.assign({onClick:()=>F(!1),className:"jv-size"},{children:[ye(e)," Items"]}))]}):k?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"{"}),R,E?n.jsx("button",Object.assign({onClick:()=>F(!1),className:"jv-button"},{children:"..."})):n.jsx("div",Object.assign({className:"jv-indent"},{children:Object.entries(e).map(([x,T])=>n.jsx($e,{indexOrName:x,value:T,depth:t,parent:e,deleteHandle:Q,editHandle:q,parentPath:S},String(s)+String(x)))})),n.jsx("span",{children:"}"}),E&&ce(A,t,E)&&n.jsxs("span",Object.assign({onClick:()=>F(!1),className:"jv-size"},{children:[ye(e)," Items"]}))]}):n.jsx("span",{children:String(e)})}const Hr=y.forwardRef(({str:e,className:t,ctrlClick:s},r)=>{let{collapseStringMode:a,collapseStringsAfterLength:o,customizeCollapseStringUI:l}=y.useContext(se);const[i,c]=y.useState(!0),h=y.useRef(null);o=o>0?o:0;const d=e.replace(/\s+/g," "),b=typeof l=="function"?l(d,i):typeof l=="string"?l:"...",f=g=>{var p;if((g.ctrlKey||g.metaKey)&&s)s(g);else{const v=window.getSelection();if(v&&v.anchorOffset!==v.focusOffset&&((p=v.anchorNode)===null||p===void 0?void 0:p.parentElement)===h.current)return;c(!i)}};if(e.length<=o)return n.jsxs("span",Object.assign({ref:h,className:t,onClick:s},{children:['"',e,'"']}));if(a==="address")return e.length<=10?n.jsxs("span",Object.assign({ref:h,className:t,onClick:s},{children:['"',e,'"']})):n.jsxs("span",Object.assign({ref:h,onClick:f,className:t+" cursor-pointer"},{children:['"',i?[d.slice(0,6),b,d.slice(-4)]:e,'"']}));if(a==="directly")return n.jsxs("span",Object.assign({ref:h,onClick:f,className:t+" cursor-pointer"},{children:['"',i?[d.slice(0,o),b]:e,'"']}));if(a==="word"){let g=o,p=o+1,v=d,O=1;for(;;){if(/\W/.test(e[g])){v=e.slice(0,g);break}if(/\W/.test(e[p])){v=e.slice(0,p);break}if(O===6){v=e.slice(0,o);break}O++,g--,p++}return n.jsxs("span",Object.assign({ref:h,onClick:f,className:t+" cursor-pointer"},{children:['"',i?[v,b]:e,'"']}))}return n.jsxs("span",Object.assign({ref:h,className:t},{children:['"',e,'"']}))});var zt;function Ve(){return Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Ve.apply(this,arguments)}var zr=function(t){return N.createElement("svg",Ve({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),zt||(zt=N.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.754 3.754 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.754 3.754 0 0 0 17.25 3Zm2.25 14.25c0 1.24-1.01 2.25-2.25 2.25H6.75c-1.24 0-2.25-1.01-2.25-2.25V6.75c0-1.24 1.01-2.25 2.25-2.25h10.5c1.24 0 2.25 1.01 2.25 2.25v10.5Zm-6.09-9.466-5.031 5.03a2.981 2.981 0 0 0-.879 2.121v1.19c0 .415.336.75.75.75h1.19c.8 0 1.554-.312 2.12-.879l5.03-5.03a2.252 2.252 0 0 0 0-3.182c-.85-.85-2.331-.85-3.18 0Zm-2.91 7.151c-.28.28-.666.44-1.06.44H9v-.44c0-.4.156-.777.44-1.06l3.187-3.188 1.06 1.061-3.187 3.188Zm5.03-5.03-.782.783-1.06-1.061.782-.782a.766.766 0 0 1 1.06 0 .75.75 0 0 1 0 1.06Z"})))},Wt,Kt;function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Be.apply(this,arguments)}var Wr=function(t){return N.createElement("svg",Be({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Wt||(Wt=N.createElement("path",{fill:"currentColor",d:"M6.75 3h5.5v1.5h-5.5C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25v-5.5H21v5.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3Z"})),Kt||(Kt=N.createElement("path",{fill:"currentColor",d:"M20.013 3h-3.946a.987.987 0 0 0 0 1.973h1.564l-6.342 6.342a1.004 1.004 0 0 0 0 1.396 1.004 1.004 0 0 0 1.396 0l6.342-6.342v1.564a.987.987 0 0 0 1.973 0V3.987A.987.987 0 0 0 20.013 3Z"})))};function us({node:e,depth:t,deleteHandle:s,indexOrName:r,parent:a,editHandle:o,parentPath:l}){const{collapseStringsAfterLength:i,enableClipboard:c,editable:h,src:d,onDelete:b,onChange:f,customizeNode:g,matchesURL:p,urlRegExp:v,EditComponent:O,DoneComponent:j,CancelComponent:M,CustomOperation:A}=y.useContext(se);let C;if(typeof g=="function"&&(C=tt(g,[{node:e,depth:t,indexOrName:r}])),C){if(y.isValidElement(C))return C;if(Fr(C)){const S=C;return n.jsx(S,{node:e,depth:t,indexOrName:r})}}if(Array.isArray(e)||te(e))return n.jsx($r,{parent:a,node:e,depth:t,indexOrName:r,deleteHandle:s,parentPath:l,customOptions:typeof C=="object"?C:void 0});{const S=typeof e,k=typeof r<"u"?[...l,String(r)]:l,[E,P]=y.useState(!1),[F,q]=y.useState(!1),Q=y.useRef(null),U=()=>{P(!0),setTimeout(()=>{var x,T;(x=window.getSelection())===null||x===void 0||x.selectAllChildren(Q.current),(T=Q.current)===null||T===void 0||T.focus()})},K=y.useCallback(()=>{let x=Q.current.innerText;try{const T=JSON.parse(x);o&&o(r,T,e,l)}catch{const Y=Ir(S,x);o&&o(r,Y,e,l)}P(!1)},[o,r,e,l,S]),V=()=>{P(!1),q(!1)},I=()=>{q(!1),s&&s(r,l),b&&b({value:e,depth:t,src:d,indexOrName:r,parentType:Array.isArray(a)?"array":"object",parentPath:l}),f&&f({depth:t,src:d,indexOrName:r,parentType:Array.isArray(a)?"array":"object",type:"delete",parentPath:l})},H=y.useCallback(x=>{x.key==="Enter"?(x.preventDefault(),K()):x.key==="Escape"&&V()},[K]),_=E||F,B=!_&&Dt(h)&&Mt(C)&&o?x=>{(x.ctrlKey||x.metaKey)&&U()}:void 0,z=n.jsxs(n.Fragment,{children:[_&&(typeof j=="function"?n.jsx(j,{className:"json-view--edit",style:{display:"inline-block"},onClick:F?I:K}):n.jsx(it,{className:"json-view--edit",style:{display:"inline-block"},onClick:F?I:K})),_&&(typeof M=="function"?n.jsx(M,{className:"json-view--edit",style:{display:"inline-block"},onClick:V}):n.jsx(ot,{className:"json-view--edit",style:{display:"inline-block"},onClick:V})),!_&&c&&Ee(C)&&n.jsx(Oe,{node:e,nodeMeta:{depth:t,indexOrName:r,parent:a,parentPath:l,currentPath:k}}),!_&&p&&S==="string"&&v.test(e)&&Qr(C)&&n.jsx("a",Object.assign({href:e,target:"_blank",className:"json-view--link"},{children:n.jsx(Wr,{})})),!_&&Dt(h)&&Mt(C)&&o&&(typeof O=="function"?n.jsx(O,{className:"json-view--edit",onClick:U}):n.jsx(zr,{className:"json-view--edit",onClick:U})),!_&&st(h)&&nt(C)&&s&&n.jsx(at,{className:"json-view--edit",onClick:()=>q(!0)}),typeof A=="function"?n.jsx(A,{node:e}):null]});let u="json-view--string";switch(S){case"number":case"bigint":u="json-view--number";break;case"boolean":u="json-view--boolean";break;case"object":u="json-view--null";break}typeof C?.className=="string"&&(u+=" "+C.className),F&&(u+=" json-view--deleting");let w=String(e);S==="bigint"&&(w+="n");const R=y.useMemo(()=>n.jsx("span",{contentEditable:!0,className:u,dangerouslySetInnerHTML:{__html:S==="string"?`"${w}"`:w},ref:Q,onKeyDown:H}),[w,S,H]);return S==="string"?n.jsxs(n.Fragment,{children:[E?R:e.length>i?n.jsx(Hr,{str:e,ref:Q,className:u,ctrlClick:B}):n.jsxs("span",Object.assign({className:u,onClick:B},{children:['"',w,'"']})),z]}):n.jsxs(n.Fragment,{children:[E?R:n.jsx("span",Object.assign({className:u,onClick:B},{children:w})),z]})}}const ds=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,se=y.createContext({src:void 0,collapseStringsAfterLength:99,collapseStringMode:"directly",customizeCollapseStringUI:void 0,collapseObjectsAfterLength:20,collapsed:!1,onCollapse:void 0,enableClipboard:!0,editable:!1,onEdit:void 0,onDelete:void 0,onAdd:void 0,onChange:void 0,forceUpdate:()=>{},customizeNode:void 0,customizeCopy:()=>{},displaySize:void 0,displayArrayIndex:!0,matchesURL:!1,urlRegExp:ds,ignoreLargeArray:!1,CopyComponent:void 0,CopiedComponent:void 0,EditComponent:void 0,CancelComponent:void 0,DoneComponent:void 0,CustomOperation:void 0});function Te({src:e,collapseStringsAfterLength:t=99,collapseStringMode:s="directly",customizeCollapseStringUI:r,collapseObjectsAfterLength:a=99,collapsed:o,onCollapse:l,enableClipboard:i=!0,editable:c=!1,onEdit:h,onDelete:d,onAdd:b,onChange:f,dark:g=!1,theme:p="default",customizeNode:v,customizeCopy:O=V=>Ar(V),displaySize:j,displayArrayIndex:M=!0,style:A,className:C,matchesURL:S=!1,urlRegExp:k=ds,ignoreLargeArray:E=!1,CopyComponent:P,CopiedComponent:F,EditComponent:q,CancelComponent:Q,DoneComponent:U,CustomOperation:K}){const[V,I]=y.useState(0),H=y.useCallback(()=>I(z=>++z),[]),[_,B]=y.useState(e);return y.useEffect(()=>B(e),[e]),n.jsx(se.Provider,Object.assign({value:{src:_,collapseStringsAfterLength:t,collapseStringMode:s,customizeCollapseStringUI:r,collapseObjectsAfterLength:a,collapsed:o,onCollapse:l,enableClipboard:i,editable:c,onEdit:h,onDelete:d,onAdd:b,onChange:f,forceUpdate:H,customizeNode:v,customizeCopy:O,displaySize:j,displayArrayIndex:M,matchesURL:S,urlRegExp:k,ignoreLargeArray:E,CopyComponent:P,CopiedComponent:F,EditComponent:q,CancelComponent:Q,DoneComponent:U,CustomOperation:K}},{children:n.jsx("code",Object.assign({className:"json-view"+(g?" dark":"")+(p&&p!=="default"?" json-view_"+p:"")+(C?" "+C:""),style:A},{children:n.jsx(us,{node:_,depth:1,editHandle:(z,u,w,R)=>{B(u),h&&h({newValue:u,oldValue:w,depth:1,src:_,indexOrName:z,parentType:null,parentPath:R}),f&&f({type:"edit",depth:1,src:_,indexOrName:z,parentType:null,parentPath:R})},deleteHandle:(z,u)=>{B(void 0),d&&d({value:_,depth:1,src:_,indexOrName:z,parentType:null,parentPath:u}),f&&f({depth:1,src:_,indexOrName:z,parentType:null,type:"delete",parentPath:u})},parentPath:[]})}))}))}const Kr=async({queueName:e,jobId:t})=>{if(!(await fetch(`/__motia/bullmq/queues/${encodeURIComponent(e)}/jobs/${encodeURIComponent(t)}/retry`,{method:"POST"})).ok)throw new Error("Failed to retry job")},Vr=async({queueName:e,jobId:t})=>{if(!(await fetch(`/__motia/bullmq/queues/${encodeURIComponent(e)}/jobs/${encodeURIComponent(t)}/remove`,{method:"POST"})).ok)throw new Error("Failed to remove job")},Br=async({queueName:e,jobId:t})=>{if(!(await fetch(`/__motia/bullmq/queues/${encodeURIComponent(e)}/jobs/${encodeURIComponent(t)}/promote`,{method:"POST"})).ok)throw new Error("Failed to promote job")},Yr=async({queueName:e,jobId:t})=>{if(!(await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(e)}/retry/${encodeURIComponent(t)}`,{method:"POST"})).ok)throw new Error("Failed to retry from DLQ")},Zr=async({queueName:e})=>{if(!(await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(e)}/retry-all`,{method:"POST"})).ok)throw new Error("Failed to retry all from DLQ")},Xr=async({queueName:e})=>{if(!(await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(e)}/clear`,{method:"POST"})).ok)throw new Error("Failed to clear DLQ")},hs=()=>{const e=G(),t=D(s=>s.setError);return de({mutationFn:Kr,onSuccess:(s,{queueName:r})=>{e.invalidateQueries({queryKey:["jobs",r]})},onError:s=>{t(s instanceof Error?s.message:"Failed to retry job")}})},fs=()=>{const e=G(),t=D(s=>s.setError);return de({mutationFn:Vr,onSuccess:(s,{queueName:r})=>{e.invalidateQueries({queryKey:["jobs",r]})},onError:s=>{t(s instanceof Error?s.message:"Failed to remove job")}})},ms=()=>{const e=G(),t=D(s=>s.setError);return de({mutationFn:Br,onSuccess:(s,{queueName:r})=>{e.invalidateQueries({queryKey:["jobs",r]})},onError:s=>{t(s instanceof Error?s.message:"Failed to promote job")}})},Gr=()=>{const e=G(),t=D(s=>s.setError);return de({mutationFn:Yr,onSuccess:(s,{queueName:r})=>{e.invalidateQueries({queryKey:["dlq-jobs",r]})},onError:s=>{t(s instanceof Error?s.message:"Failed to retry from DLQ")}})},ea=()=>{const e=G(),t=D(s=>s.setError);return de({mutationFn:Zr,onSuccess:(s,{queueName:r})=>{e.invalidateQueries({queryKey:["dlq-jobs",r]})},onError:s=>{t(s instanceof Error?s.message:"Failed to retry all from DLQ")}})},ta=()=>{const e=G(),t=D(s=>s.setError);return de({mutationFn:Xr,onSuccess:(s,{queueName:r})=>{e.invalidateQueries({queryKey:["dlq-jobs",r]})},onError:s=>{t(s instanceof Error?s.message:"Failed to clear DLQ")}})},sa=async(e,t,s=0,r=100)=>{const a=new URLSearchParams({status:t,start:String(s),end:String(r)}),o=await fetch(`/__motia/bullmq/queues/${encodeURIComponent(e)}/jobs?${a}`);if(!o.ok)throw new Error("Failed to fetch jobs");return(await o.json()).jobs},na=async(e,t=0,s=100)=>{const r=new URLSearchParams({start:String(t),end:String(s)}),a=await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(e)}/jobs?${r}`);return a.ok?(await a.json()).jobs:[]},ra=()=>{const e=D(a=>a.selectedQueue),t=D(a=>a.selectedStatus),s=e?.name,r=e?JSON.stringify(e.stats):null;return as({queryKey:["jobs",s,t,r],queryFn:()=>sa(s,t),enabled:!!s,staleTime:5e3})},aa=e=>as({queryKey:["dlq-jobs",e],queryFn:()=>na(e),enabled:!!e}),ps=y.memo(({job:e,onRetry:t})=>n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex gap-2",children:n.jsxs(m.Button,{variant:"outline",size:"sm",onClick:t,children:[n.jsx(re,{className:"mr-2 h-4 w-4"}),"Retry"]})}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Job ID"}),n.jsx("div",{className:"font-mono text-xs",children:e.id})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Original Job ID"}),n.jsx("div",{className:"font-mono text-xs",children:e.originalJobId||"-"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Attempts Made"}),n.jsx("div",{className:"font-semibold",children:e.attemptsMade})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Failed At"}),n.jsx("div",{children:Ne(e.failureTimestamp,{addSuffix:!0})})]})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-destructive mb-2",children:"Failure Reason"}),n.jsx("div",{className:"font-mono text-sm bg-destructive/10 p-3 rounded text-destructive",children:e.failureReason})]})]}));ps.displayName="DLQJobDetailContent";const ys=y.memo(({data:e})=>n.jsx("div",{className:"bg-muted/30 p-4 rounded overflow-auto max-h-[400px]",children:n.jsx(Te,{src:e,theme:"atom",collapsed:2})}));ys.displayName="DLQJobDataTab";const gs=y.memo(()=>{const e=D(p=>p.selectedQueue),{data:t=[],isLoading:s,refetch:r}=aa(e?.isDLQ?e.name:void 0),a=Gr(),o=ea(),l=ta(),[i,c]=y.useState(null),h=y.useCallback(p=>{e&&a.mutate({queueName:e.name,jobId:p})},[e,a]),d=y.useCallback(()=>{e&&o.mutate({queueName:e.name})},[e,o]),b=y.useCallback(()=>{e&&l.mutate({queueName:e.name})},[e,l]),f=y.useCallback(()=>{c(null)},[]),g=y.useCallback(()=>{i&&(h(i.id),c(null))},[i,h]);return e?.isDLQ?n.jsx(m.TooltipProvider,{children:n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"font-semibold text-lg",children:e.displayName}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," failed job",t.length!==1?"s":""," in dead letter queue"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs(m.Tooltip,{children:[n.jsx(m.TooltipTrigger,{asChild:!0,children:n.jsx(m.Button,{variant:"ghost",size:"icon",onClick:()=>r(),disabled:s,children:n.jsx(re,{className:`h-4 w-4 ${s?"animate-spin":""}`})})}),n.jsx(m.TooltipContent,{children:n.jsx("p",{children:"Refresh DLQ jobs list"})})]}),n.jsxs(m.Tooltip,{children:[n.jsx(m.TooltipTrigger,{asChild:!0,children:n.jsxs(m.Button,{variant:"outline",size:"sm",onClick:d,disabled:t.length===0,children:[n.jsx(re,{className:"mr-2 h-4 w-4"}),"Retry All"]})}),n.jsx(m.TooltipContent,{children:n.jsx("p",{children:"Re-queue all failed jobs to the original queue"})})]}),n.jsxs(m.Tooltip,{children:[n.jsx(m.TooltipTrigger,{asChild:!0,children:n.jsxs(m.Button,{variant:"outline",size:"sm",onClick:b,disabled:t.length===0,className:"text-destructive",children:[n.jsx(le,{className:"mr-2 h-4 w-4"}),"Clear All"]})}),n.jsx(m.TooltipContent,{children:n.jsx("p",{children:"Permanently delete all jobs from DLQ"})})]})]})]}),t.length===0?n.jsx("div",{className:"flex items-center justify-center flex-1 text-muted-foreground",children:"No jobs in dead letter queue"}):n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsxs(m.Table,{children:[n.jsx(m.TableHeader,{className:"sticky top-0 bg-background/95 backdrop-blur-sm",children:n.jsxs(m.TableRow,{children:[n.jsx(m.TableHead,{className:"w-[180px]",children:"Job ID"}),n.jsx(m.TableHead,{className:"w-[180px]",children:"Original Job"}),n.jsx(m.TableHead,{children:"Failure Reason"}),n.jsx(m.TableHead,{className:"w-[100px]",children:"Attempts"}),n.jsx(m.TableHead,{className:"w-[150px]",children:"Failed At"}),n.jsx(m.TableHead,{className:"w-[100px]",children:"Actions"})]})}),n.jsx(m.TableBody,{children:t.map(p=>n.jsxs(m.TableRow,{className:"cursor-pointer hover:bg-muted-foreground/10",onClick:()=>c(p),children:[n.jsx(m.TableCell,{className:"font-mono text-xs",children:p.id}),n.jsx(m.TableCell,{className:"font-mono text-xs text-muted-foreground",children:p.originalJobId||"-"}),n.jsx(m.TableCell,{className:"text-destructive text-sm truncate max-w-[300px]",children:p.failureReason}),n.jsx(m.TableCell,{children:p.attemptsMade}),n.jsx(m.TableCell,{className:"text-xs text-muted-foreground",children:Ne(p.failureTimestamp,{addSuffix:!0})}),n.jsx(m.TableCell,{onClick:v=>v.stopPropagation(),children:n.jsxs(m.Tooltip,{children:[n.jsx(m.TooltipTrigger,{asChild:!0,children:n.jsx(m.Button,{variant:"ghost",size:"sm",onClick:()=>h(p.id),children:n.jsx(re,{className:"h-4 w-4"})})}),n.jsx(m.TooltipContent,{children:n.jsx("p",{children:"Retry this job"})})]})})]},p.id))})]})}),i&&n.jsx(m.Sidebar,{onClose:f,title:"Dead Letter Job",initialWidth:600,tabs:[{label:"Details",content:n.jsx(ps,{job:i,onRetry:g})},{label:"Event Data",content:n.jsx(ys,{data:i.originalEvent})}],actions:[{icon:n.jsx(et,{}),onClick:f,label:"Close"}]})]})}):null});gs.displayName="DLQPanel";/**
|
|
58
|
-
* @license lucide-react v0.545.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const ia=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],bs=X("arrow-up-right",ia),vs=y.memo(({data:e})=>n.jsx("div",{className:"bg-muted/30 p-4 rounded",children:n.jsx(Te,{src:e,theme:"atom",collapsed:2})}));vs.displayName="JobDataTab";const xs=y.memo(({opts:e})=>n.jsx("div",{className:"bg-muted/30 p-4 rounded",children:n.jsx(Te,{src:e,theme:"atom",collapsed:2})}));xs.displayName="JobOptionsTab";const js=y.memo(({returnvalue:e})=>n.jsx("div",{className:"bg-muted/30 p-4 rounded",children:n.jsx(Te,{src:e,theme:"atom",collapsed:2})}));js.displayName="JobResultTab";const ws=y.memo(({failedReason:e,stacktrace:t})=>n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-destructive mb-1",children:"Error Message"}),n.jsx("div",{className:"font-mono text-sm bg-destructive/10 p-3 rounded text-destructive",children:e})]}),t&&t.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:"Stack Trace"}),n.jsx("pre",{className:"font-mono text-xs bg-muted p-3 rounded overflow-auto max-h-[300px]",children:t.join(`
|
|
63
|
-
`)})]})]}));ws.displayName="JobErrorTab";const Cs=y.memo(()=>{const e=D(j=>j.selectedJob),t=D(j=>j.selectedQueue),s=D(j=>j.jobDetailOpen),r=D(j=>j.setJobDetailOpen),a=D(j=>j.setSelectedJob),o=hs(),l=fs(),i=ms(),c=y.useCallback(()=>{r(!1),a(null)},[r,a]),h=y.useCallback(()=>{!t||!e||(o.mutate({queueName:t.name,jobId:e.id}),c())},[t,e,o,c]),d=y.useCallback(()=>{!t||!e||(l.mutate({queueName:t.name,jobId:e.id}),c())},[t,e,l,c]),b=y.useCallback(()=>{!t||!e||(i.mutate({queueName:t.name,jobId:e.id}),c())},[t,e,i,c]);if(!s||!e||!t)return null;const f=!!e.failedReason,g=e.delay&&e.delay>0,p=e.returnvalue!==void 0&&e.returnvalue!==null,v=[{label:"Data",content:n.jsx(vs,{data:e.data})},{label:"Options",content:n.jsx(xs,{opts:e.opts})},...p?[{label:"Result",content:n.jsx(js,{returnvalue:e.returnvalue})}]:[],...f?[{label:"Error",content:n.jsx(ws,{failedReason:e.failedReason,stacktrace:e.stacktrace})}]:[]],O=f?n.jsx("span",{className:"text-destructive",children:"Failed"}):e.finishedOn?n.jsx("span",{className:"text-green-500",children:"Completed"}):e.processedOn?n.jsx("span",{className:"text-yellow-500",children:"Processing"}):g?n.jsx("span",{className:"text-purple-500",children:"Delayed"}):n.jsx("span",{className:"text-blue-500",children:"Waiting"});return n.jsx(m.Sidebar,{onClose:c,title:e.name,initialWidth:600,tabs:v,actions:[{icon:n.jsx(et,{}),onClick:c,label:"Close"}],children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[f&&n.jsxs(m.Button,{variant:"outline",size:"sm",onClick:h,children:[n.jsx(re,{className:"mr-2 h-4 w-4"}),"Retry"]}),g&&n.jsxs(m.Button,{variant:"outline",size:"sm",onClick:b,children:[n.jsx(bs,{className:"mr-2 h-4 w-4"}),"Promote"]}),n.jsxs(m.Button,{variant:"outline",size:"sm",onClick:d,className:"text-destructive",children:[n.jsx(le,{className:"mr-2 h-4 w-4"}),"Remove"]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Job ID"}),n.jsx("div",{className:"font-mono text-xs",children:e.id})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Status"}),n.jsx("div",{className:"font-semibold",children:O})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Created"}),n.jsx("div",{children:Ne(e.timestamp,{addSuffix:!0})})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Attempts"}),n.jsx("div",{className:"font-semibold",children:e.attemptsMade})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Progress"}),n.jsx("div",{className:"font-semibold",children:typeof e.progress=="number"?`${e.progress}%`:"-"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground",children:"Delay"}),n.jsx("div",{className:"font-semibold",children:e.delay?`${e.delay}ms`:"-"})]})]})]})})});Cs.displayName="JobDetail";/**
|
|
64
|
-
* @license lucide-react v0.545.0 - ISC
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the ISC license.
|
|
67
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/const oa=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Ss=X("ellipsis-vertical",oa);/**
|
|
69
|
-
* @license lucide-react v0.545.0 - ISC
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the ISC license.
|
|
72
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const la=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Ns=X("pause",la);/**
|
|
74
|
-
* @license lucide-react v0.545.0 - ISC
|
|
75
|
-
*
|
|
76
|
-
* This source code is licensed under the ISC license.
|
|
77
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/const ca=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ua=X("play",ca),Es=y.memo(({job:e,queueName:t,onSelect:s,isSelected:r})=>{const a=hs(),o=fs(),l=ms(),i=y.useCallback(d=>{d.stopPropagation(),a.mutate({queueName:t,jobId:e.id})},[t,e.id,a]),c=y.useCallback(d=>{d.stopPropagation(),o.mutate({queueName:t,jobId:e.id})},[t,e.id,o]),h=y.useCallback(d=>{d.stopPropagation(),l.mutate({queueName:t,jobId:e.id})},[t,e.id,l]);return n.jsxs(m.TableRow,{onClick:s,className:m.cn("cursor-pointer border-0",r?"bg-muted-foreground/10 hover:bg-muted-foreground/20":"hover:bg-muted-foreground/10"),children:[n.jsx(m.TableCell,{className:"font-mono text-xs",children:e.id}),n.jsx(m.TableCell,{className:"font-medium",children:e.name}),n.jsx(m.TableCell,{className:"text-xs text-muted-foreground",children:Ne(e.timestamp,{addSuffix:!0})}),n.jsx(m.TableCell,{children:n.jsx("span",{className:"text-xs",children:e.attemptsMade})}),n.jsx(m.TableCell,{children:typeof e.progress=="number"?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-16 h-1.5 bg-muted rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.min(100,e.progress)}%`}})}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.progress,"%"]})]}):n.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}),n.jsx(m.TableCell,{onClick:d=>d.stopPropagation(),children:n.jsxs(m.DropdownMenu,{children:[n.jsx(m.DropdownMenuTrigger,{asChild:!0,children:n.jsx(m.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:n.jsx(Ss,{className:"h-4 w-4"})})}),n.jsxs(m.DropdownMenuContent,{align:"end",children:[e.failedReason&&n.jsxs(m.DropdownMenuItem,{onClick:i,children:[n.jsx(re,{className:"mr-2 h-4 w-4"}),"Retry"]}),e.delay&&e.delay>0&&n.jsxs(m.DropdownMenuItem,{onClick:h,children:[n.jsx(bs,{className:"mr-2 h-4 w-4"}),"Promote"]}),n.jsxs(m.DropdownMenuItem,{onClick:c,className:"text-destructive",children:[n.jsx(le,{className:"mr-2 h-4 w-4"}),"Remove"]})]})]})})]})});Es.displayName="JobRow";const Os=y.memo(()=>{const{data:e=[],isLoading:t}=ra(),s=D(i=>i.selectedQueue),r=D(i=>i.selectedJob),a=D(i=>i.setSelectedJob),o=D(i=>i.setJobDetailOpen),l=y.useCallback(i=>{a(i),o(!0)},[a,o]);return s?t?n.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"Loading jobs..."}):e.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No jobs in this status"}):n.jsxs(m.Table,{children:[n.jsx(m.TableHeader,{className:"sticky top-0 bg-background/95 backdrop-blur-sm",children:n.jsxs(m.TableRow,{children:[n.jsx(m.TableHead,{className:"w-[200px]",children:"Job ID"}),n.jsx(m.TableHead,{children:"Name"}),n.jsx(m.TableHead,{className:"w-[150px]",children:"Created"}),n.jsx(m.TableHead,{className:"w-[80px]",children:"Attempts"}),n.jsx(m.TableHead,{className:"w-[140px]",children:"Progress"}),n.jsx(m.TableHead,{className:"w-[60px]",children:"Actions"})]})}),n.jsx(m.TableBody,{children:e.map(i=>n.jsx(Es,{job:i,queueName:s.name,onSelect:()=>l(i),isSelected:r?.id===i.id},i.id))})]}):n.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"Select a queue to view jobs"})});Os.displayName="JobsTable";const da=[{value:"waiting",label:"Waiting"},{value:"active",label:"Active"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"delayed",label:"Delayed"}],Ts=y.memo(()=>{const e=G(),t=D(p=>p.selectedQueue),s=D(p=>p.selectedStatus),r=D(p=>p.setSelectedStatus),{pauseQueue:a,resumeQueue:o,cleanQueue:l,drainQueue:i}=Vt(),c=y.useCallback(async()=>{t&&await a(t.name)},[t,a]),h=y.useCallback(async()=>{t&&await o(t.name)},[t,o]),d=y.useCallback(async()=>{t&&await l(t.name,"completed",0,1e3)},[t,l]),b=y.useCallback(async()=>{t&&await l(t.name,"failed",0,1e3)},[t,l]),f=y.useCallback(async()=>{t&&await i(t.name)},[t,i]),g=y.useCallback(()=>{t&&e.invalidateQueries({queryKey:["jobs",t.name]})},[t,e]);return t?n.jsx(m.TooltipProvider,{children:n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("h2",{className:"font-semibold text-lg",children:t.displayName}),t.isPaused&&n.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-yellow-500/20 text-yellow-600",children:"Paused"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs(m.Tooltip,{children:[n.jsx(m.TooltipTrigger,{asChild:!0,children:n.jsx(m.Button,{variant:"ghost",size:"icon",onClick:g,children:n.jsx(re,{className:"h-4 w-4"})})}),n.jsx(m.TooltipContent,{children:n.jsx("p",{children:"Refresh queue stats and jobs list"})})]}),t.isPaused?n.jsxs(m.Tooltip,{children:[n.jsx(m.TooltipTrigger,{asChild:!0,children:n.jsxs(m.Button,{variant:"ghost",size:"sm",onClick:h,children:[n.jsx(ua,{className:"mr-2 h-4 w-4"}),"Resume"]})}),n.jsx(m.TooltipContent,{children:n.jsx("p",{children:"Resume processing jobs in this queue"})})]}):n.jsxs(m.Tooltip,{children:[n.jsx(m.TooltipTrigger,{asChild:!0,children:n.jsxs(m.Button,{variant:"ghost",size:"sm",onClick:c,children:[n.jsx(Ns,{className:"mr-2 h-4 w-4"}),"Pause"]})}),n.jsx(m.TooltipContent,{children:n.jsx("p",{children:"Stop workers from picking up new jobs"})})]}),n.jsxs(m.Tooltip,{children:[n.jsx(m.TooltipTrigger,{asChild:!0,children:n.jsxs(m.DropdownMenu,{children:[n.jsx(m.DropdownMenuTrigger,{asChild:!0,children:n.jsx(m.Button,{variant:"ghost",size:"icon",children:n.jsx(Ss,{className:"h-4 w-4"})})}),n.jsxs(m.DropdownMenuContent,{align:"end",children:[n.jsxs(m.DropdownMenuItem,{onClick:d,children:[n.jsx(le,{className:"mr-2 h-4 w-4"}),"Clean Completed"]}),n.jsxs(m.DropdownMenuItem,{onClick:b,children:[n.jsx(le,{className:"mr-2 h-4 w-4"}),"Clean Failed"]}),n.jsx(m.DropdownMenuSeparator,{}),n.jsxs(m.DropdownMenuItem,{onClick:f,className:"text-destructive",children:[n.jsx(le,{className:"mr-2 h-4 w-4"}),"Drain Queue"]})]})]})}),n.jsx(m.TooltipContent,{children:n.jsx("p",{children:"More actions"})})]})]})]}),n.jsx("div",{className:"p-3 border-b border-border",children:n.jsxs("div",{className:"grid grid-cols-6 gap-4 text-center",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-bold text-blue-500",children:t.stats.waiting}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"Waiting"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-bold text-yellow-500",children:t.stats.active}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"Active"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-bold text-green-500",children:t.stats.completed}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"Completed"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-bold text-destructive",children:t.stats.failed}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"Failed"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-bold text-purple-500",children:t.stats.delayed}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"Delayed"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:t.stats.paused}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"Paused"})]})]})}),n.jsxs(m.Tabs,{value:s,onValueChange:p=>r(p),className:"flex-1 flex flex-col",children:[n.jsx("div",{className:"px-3 pt-2 border-b border-border",children:n.jsx(m.TabsList,{children:da.map(p=>n.jsxs(m.TabsTrigger,{value:p.value,className:m.cn("relative",s===p.value&&"after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary"),children:[p.label,t.stats[p.value]>0&&n.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 text-[10px] rounded-full bg-muted",children:t.stats[p.value]})]},p.value))})}),n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsx(Os,{})})]})]})}):n.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"Select a queue from the list to view details"})});Ts.displayName="QueueDetail";/**
|
|
79
|
-
* @license lucide-react v0.545.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the ISC license.
|
|
82
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const ha=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],fa=X("triangle-alert",ha);/**
|
|
84
|
-
* @license lucide-react v0.545.0 - ISC
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the ISC license.
|
|
87
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const ma=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],pa=X("layers",ma);/**
|
|
89
|
-
* @license lucide-react v0.545.0 - ISC
|
|
90
|
-
*
|
|
91
|
-
* This source code is licensed under the ISC license.
|
|
92
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const ya=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ga=X("search",ya);/**
|
|
94
|
-
* @license lucide-react v0.545.0 - ISC
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the ISC license.
|
|
97
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const ba=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],va=X("skull",ba),Ye=y.memo(({queue:e,isSelected:t,onClick:s})=>{const r=e.stats.waiting+e.stats.active+e.stats.delayed+e.stats.prioritized,a=e.stats.failed>0;return n.jsxs("button",{type:"button",onClick:s,className:m.cn("w-full text-left p-3 transition-colors border-b border-border",t?"bg-muted-foreground/10":"hover:bg-muted/70"),children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.isDLQ?n.jsx(va,{className:"w-4 h-4 text-destructive"}):n.jsx(pa,{className:"w-4 h-4 text-muted-foreground"}),n.jsx("span",{className:"font-semibold text-sm truncate flex-1",children:e.displayName}),e.isPaused&&n.jsx(Ns,{className:"w-3 h-3 text-yellow-500"}),a&&n.jsx(fa,{className:"w-3 h-3 text-destructive"})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-1 text-xs",children:[n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-muted-foreground",children:"Wait"}),n.jsx("span",{className:m.cn("font-mono",e.stats.waiting>0&&"text-blue-500"),children:e.stats.waiting})]}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-muted-foreground",children:"Active"}),n.jsx("span",{className:m.cn("font-mono",e.stats.active>0&&"text-yellow-500"),children:e.stats.active})]}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-muted-foreground",children:"Done"}),n.jsx("span",{className:m.cn("font-mono",e.stats.completed>0&&"text-green-500"),children:e.stats.completed})]}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-muted-foreground",children:"Failed"}),n.jsx("span",{className:m.cn("font-mono",e.stats.failed>0&&"text-destructive"),children:e.stats.failed})]})]}),(e.stats.delayed>0||r>0)&&n.jsxs("div",{className:"flex gap-2 mt-1 text-xs text-muted-foreground",children:[e.stats.delayed>0&&n.jsxs("span",{children:[e.stats.delayed," delayed"]}),r>0&&n.jsxs("span",{className:"ml-auto",children:[r," pending"]})]})]})});Ye.displayName="QueueItem";const Rs=y.memo(()=>{const e=D(c=>c.queues),t=D(c=>c.selectedQueue),s=D(c=>c.setSelectedQueue),r=D(c=>c.searchQuery),a=D(c=>c.setSearchQuery),o=y.useMemo(()=>{if(!r)return e;const c=r.toLowerCase();return e.filter(h=>h.name.toLowerCase().includes(c)||h.displayName.toLowerCase().includes(c))},[e,r]),l=y.useMemo(()=>o.filter(c=>!c.isDLQ),[o]),i=y.useMemo(()=>o.filter(c=>c.isDLQ),[o]);return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx("div",{className:"p-2 border-b border-border",children:n.jsxs("div",{className:"relative",children:[n.jsx(m.Input,{variant:"shade",value:r,onChange:c=>a(c.target.value),className:"px-9 font-medium text-sm",placeholder:"Search queues..."}),n.jsx(ga,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50"}),r&&n.jsx(et,{className:"cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>a("")})]})}),n.jsxs("div",{className:"flex-1 overflow-auto",children:[l.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider bg-muted/30",children:["Queues (",l.length,")"]}),l.map(c=>n.jsx(Ye,{queue:c,isSelected:t?.name===c.name,onClick:()=>s(c)},c.name))]}),i.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider bg-destructive/10",children:["Dead Letter Queues (",i.length,")"]}),i.map(c=>n.jsx(Ye,{queue:c,isSelected:t?.name===c.name,onClick:()=>s(c)},c.name))]}),o.length===0&&n.jsx("div",{className:"p-4 text-center text-muted-foreground text-sm",children:r?"No queues match your search":"No queues found"})]})]})});Rs.displayName="QueueList";const ks=y.memo(()=>{const e=D(r=>r.selectedQueue),t=D(r=>r.updateSelectedQueueStats),{queues:s}=Vt();return y.useEffect(()=>{if(e){const r=s.find(a=>a.name===e.name);r&&t(r)}},[s,e,t]),n.jsxs("div",{className:"grid grid-cols-[300px_1fr] h-full overflow-hidden",children:[n.jsx("div",{className:"border-r border-border overflow-hidden",children:n.jsx(Rs,{})}),n.jsx("div",{className:"overflow-hidden",children:e?.isDLQ?n.jsx(gs,{}):n.jsx(Ts,{})}),n.jsx(Cs,{})]})});ks.displayName="QueuesPageContent";const Ds=y.memo(()=>n.jsx(En,{children:n.jsx(ks,{})}));Ds.displayName="QueuesPage";exports.QueuesPage=Ds;
|
package/dist/plugin-bullmq.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-green-500:oklch(72.3% .219 149.579);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-500:oklch(62.7% .265 303.9);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wider:.05em;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-weight-500:var(--font-weight-500);--font-weight-600:var(--font-weight-600);--font-weight-700:var(--font-weight-700)}}@layer base{*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground)}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.right-3{right:calc(var(--spacing)*3)}.left-3{left:calc(var(--spacing)*3)}.mt-1{margin-top:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.ml-1\.5{margin-left:calc(var(--spacing)*1.5)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-8{height:calc(var(--spacing)*8)}.h-full{height:100%}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-8{width:calc(var(--spacing)*8)}.w-16{width:calc(var(--spacing)*16)}.w-\[60px\]{width:60px}.w-\[80px\]{width:80px}.w-\[100px\]{width:100px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-full{width:100%}.max-w-\[300px\]{max-width:300px}.flex-1{flex:1}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-\[300px_1fr\]{grid-template-columns:300px 1fr}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-border{border-color:var(--border)}.bg-background\/95{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/95{background-color:color-mix(in oklab,var(--background)95%,transparent)}}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\/10{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/10{background-color:color-mix(in oklab,var(--muted-foreground)10%,transparent)}}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted)30%,transparent)}}.bg-primary{background-color:var(--primary)}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-9{padding-inline:calc(var(--spacing)*9)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-2{padding-block:calc(var(--spacing)*2)}.pt-2{padding-top:calc(var(--spacing)*2)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-blue-500{color:var(--color-blue-500)}.text-destructive{color:var(--destructive)}.text-green-500{color:var(--color-green-500)}.text-muted-foreground,.text-muted-foreground\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,var(--muted-foreground)50%,transparent)}}.text-purple-500{color:var(--color-purple-500)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.uppercase{text-transform:uppercase}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.paused{animation-play-state:paused}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:right-0:after{content:var(--tw-content);right:calc(var(--spacing)*0)}.after\:bottom-0:after{content:var(--tw-content);bottom:calc(var(--spacing)*0)}.after\:left-0:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.after\:h-0\.5:after{content:var(--tw-content);height:calc(var(--spacing)*.5)}.after\:bg-primary:after{content:var(--tw-content);background-color:var(--primary)}@media (hover:hover){.hover\:bg-muted-foreground\/10:hover{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted-foreground\/10:hover{background-color:color-mix(in oklab,var(--muted-foreground)10%,transparent)}}.hover\:bg-muted-foreground\/20:hover{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted-foreground\/20:hover{background-color:color-mix(in oklab,var(--muted-foreground)20%,transparent)}}.hover\:bg-muted\/70:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/70:hover{background-color:color-mix(in oklab,var(--muted)70%,transparent)}}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}}}:root{--default-font-family:"DM Sans",ui-sans-serif,sans-serif;--font-dm-mono:"DM Mono",ui-monospace,monospace;color-scheme:light dark;font-size:16px;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"),serif;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-optical-sizing:auto;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--accent-1000:#2862fe;--accent-970:#2862fef7;--accent-950:#2862fef2;--accent-900:#2862fee5;--accent-800:#2862fecc;--accent-700:#2862feb2;--accent-600:#2862fe99;--accent-500:#2862fe80;--accent-400:#2862fe66;--accent-300:#2862fe4d;--accent-200:#2862fe33;--accent-100:#2862fe1a;--accent-50:#2862fe0d;--accent-30:#2862fe08;--dark-1000:#0a0a0a;--dark-970:#0a0a0af7;--dark-950:#0a0a0af2;--dark-900:#0a0a0ae5;--dark-800:#0a0a0acc;--dark-700:#0a0a0ab2;--dark-600:#0a0a0a99;--dark-500:#0a0a0a80;--dark-400:#0a0a0a66;--dark-300:#0a0a0a4d;--dark-200:#0a0a0a33;--dark-100:#0a0a0a1a;--dark-50:#0a0a0a0d;--dark-30:#0a0a0a08;--light-1000:#fff;--light-970:#fffffff7;--light-950:#fffffff2;--light-900:#ffffffe5;--light-800:#fffc;--light-700:#ffffffb2;--light-600:#fff9;--light-500:#ffffff80;--light-400:#fff6;--light-300:#ffffff4d;--light-200:#fff3;--light-100:#ffffff1a;--light-50:#ffffff0d;--light-30:#ffffff08;--error:#d61355;--canvas-background:#ebebeb;--background:var(--light-1000);--foreground:var(--dark-1000);--surface-content:var(--dark-30);--surface-component:var(--dark-50);--surface-light-100:var(--dark-100);--surface-light-200:var(--dark-200);--border:var(--dark-100);--border-accent:var(--accent-1000);--states-hover:var(--dark-30);--states-selected:var(--dark-100);--states-active:var(--accent-1000);--text-header:var(--dark-1000);--text-body:var(--dark-600);--text-placeholder:var(--dark-400);--text-accent:var(--accent-1000);--text-error:var(--error);--icon-active:var(--dark-1000);--icon-light:var(--dark-600);--icon-component:var(--dark-400);--icon-accent:var(--accent-1000);--primary:var(--accent-1000);--primary-foreground:var(--light-1000);--secondary:var(--surface-component);--secondary-foreground:var(--text-body);--muted:var(--surface-light-100);--muted-foreground:var(--text-body);--accent:var(--accent-1000);--accent-foreground:var(--light-1000);--destructive:var(--error);--destructive-foreground:var(--light-1000);--card:var(--surface-content);--card-foreground:var(--foreground);--popover:var(--surface-content);--popover-foreground:var(--foreground);--input:var(--states-hover);--ring:var(--border-accent);--chart-1:var(--accent-1000);--chart-2:var(--accent-800);--chart-3:var(--accent-600);--chart-4:var(--accent-400);--chart-5:var(--accent-200);--header:var(--background);--header-foreground:var(--text-header);--header-primary:var(--primary);--header-primary-foreground:var(--primary-foreground);--header-accent:var(--surface-component);--header-accent-foreground:var(--text-body);--header-border:var(--border);--header-ring:var(--ring);--sidebar:var(--background);--sidebar-foreground:var(--text-header);--sidebar-primary:var(--primary);--sidebar-primary-foreground:var(--primary-foreground);--sidebar-accent:var(--surface-component);--sidebar-accent-foreground:var(--text-body);--sidebar-border:var(--border);--sidebar-ring:var(--ring);width:100%}.dark{--canvas-background:#030303;--background:var(--dark-1000);--foreground:var(--light-1000);--surface-content:var(--light-30);--surface-component:var(--light-50);--surface-light-100:var(--light-100);--surface-light-200:var(--light-200);--border:var(--light-100);--states-hover:var(--light-30);--states-selected:var(--light-100);--text-header:var(--light-1000);--text-body:var(--light-600);--text-placeholder:var(--light-400);--icon-active:var(--light-1000);--icon-light:var(--light-600);--icon-component:var(--light-400);--secondary-foreground:var(--light-600);--muted-foreground:var(--light-600);--card:var(--surface-content);--card-foreground:var(--foreground);--popover:var(--surface-content);--popover-foreground:var(--foreground);--input:var(--states-hover);--ring:var(--border-accent);--chart-1:var(--accent-1000);--chart-2:var(--accent-800);--chart-3:var(--accent-600);--chart-4:var(--accent-400);--chart-5:var(--accent-200);--header:var(--background);--header-foreground:var(--text-header);--header-primary:var(--primary);--header-primary-foreground:var(--primary-foreground);--header-accent:var(--surface-component);--header-accent-foreground:var(--text-body);--header-border:var(--border);--header-ring:var(--ring);--sidebar:var(--background);--sidebar-foreground:var(--text-header);--sidebar-primary:var(--primary);--sidebar-primary-foreground:var(--primary-foreground);--sidebar-accent:var(--surface-component);--sidebar-accent-foreground:var(--text-body);--sidebar-border:var(--border);--sidebar-ring:var(--ring)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}.json-view{display:block;color:#4d4d4d;text-align:left;--json-property: #009033;--json-index: #676dff;--json-number: #676dff;--json-string: #b2762e;--json-boolean: #dc155e;--json-null: #dc155e}.json-view .json-view--property{color:var(--json-property)}.json-view .json-view--index{color:var(--json-index)}.json-view .json-view--number{color:var(--json-number)}.json-view .json-view--string{color:var(--json-string)}.json-view .json-view--boolean{color:var(--json-boolean)}.json-view .json-view--null{color:var(--json-null)}.json-view .jv-indent{padding-left:1em}.json-view .jv-chevron{display:inline-block;vertical-align:-20%;cursor:pointer;opacity:.4;width:1em;height:1em}:is(.json-view .jv-chevron:hover,.json-view .jv-size:hover+.jv-chevron){opacity:.8}.json-view .jv-size{cursor:pointer;opacity:.4;font-size:.875em;font-style:italic;margin-left:.5em;vertical-align:-5%;line-height:1}.json-view :is(.json-view--copy,.json-view--edit),.json-view .json-view--link svg{display:none;width:1em;height:1em;margin-left:.25em;cursor:pointer}.json-view .json-view--input{width:120px;margin-left:.25em;border-radius:4px;border:1px solid currentColor;padding:0 4px;font-size:87.5%;line-height:1.25;background:transparent}.json-view .json-view--deleting{outline:1px solid #da0000;background-color:#da000011;text-decoration-line:line-through}:is(.json-view:hover,.json-view--pair:hover)>:is(.json-view--copy,.json-view--edit),:is(.json-view:hover,.json-view--pair:hover)>.json-view--link svg{display:inline-block}.json-view .jv-button{background:transparent;outline:none;border:none;cursor:pointer;color:inherit}.json-view .cursor-pointer{cursor:pointer}.json-view svg{vertical-align:-10%}.jv-size-chevron~svg{vertical-align:-16%}.json-view_a11y{color:#545454;--json-property: #aa5d00;--json-index: #007299;--json-number: #007299;--json-string: #008000;--json-boolean: #d91e18;--json-null: #d91e18}.json-view_github{color:#005cc5;--json-property: #005cc5;--json-index: #005cc5;--json-number: #005cc5;--json-string: #032f62;--json-boolean: #005cc5;--json-null: #005cc5}.json-view_vscode{color:#005cc5;--json-property: #0451a5;--json-index: #0000ff;--json-number: #0000ff;--json-string: #a31515;--json-boolean: #0000ff;--json-null: #0000ff}.json-view_atom{color:#383a42;--json-property: #e45649;--json-index: #986801;--json-number: #986801;--json-string: #50a14f;--json-boolean: #0184bc;--json-null: #0184bc}.json-view_winter-is-coming{color:#0431fa;--json-property: #3a9685;--json-index: #ae408b;--json-number: #ae408b;--json-string: #8123a9;--json-boolean: #0184bc;--json-null: #0184bc}
|
package/dist/plugin.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const I=require("ioredis"),_=require("@motiadev/core"),P=require("bullmq"),g=new Map,f=new Map,d=(u,s,a)=>{const o=g.get(u);if(o)return o;const t=new P.Queue(u,{connection:s,prefix:a});return g.set(u,t),t},w=async(u,s)=>{const a=`${s}:*:id`,o=await u.keys(a),t=new Set;for(const e of o){const i=e.slice(s.length+1).slice(0,-3);t.add(i)}return t},b=async(u,s,a,o)=>{const t=d(u,s,a),[e,n]=await Promise.all([t.isPaused(),t.getJobCounts()]);return{name:u,displayName:u,isPaused:e,isDLQ:u.endsWith(o),stats:{waiting:n.waiting||0,active:n.active||0,completed:n.completed||0,failed:n.failed||0,delayed:n.delayed||0,paused:n.paused||0,prioritized:n.prioritized||0}}},v=500;class Q extends _.StreamAdapter{constructor(s,a,o){super("__motia.bullmq-queues"),this.knownQueues=new Set,this.lastStatsCache=new Map,this.debounceTimers=new Map,this.connection=s,this.prefix=a,this.dlqSuffix=o}setUpdateCallback(s){this.onQueueUpdate=s}async get(s,a){try{const o=await b(a,this.connection,this.prefix,this.dlqSuffix);return{...o,id:o.name}}catch{return null}}async set(s,a,o){return o}async delete(s,a){return this.knownQueues.delete(a),this.lastStatsCache.delete(a),{id:a}}async getGroup(s){const a=await w(this.connection,this.prefix),o=[];for(const t of a){this.knownQueues.add(t);const e=await b(t,this.connection,this.prefix,this.dlqSuffix),n={...e,id:e.name};o.push(n),this.lastStatsCache.set(t,JSON.stringify({stats:e.stats,isPaused:e.isPaused}))}return o}async refreshQueue(s){const a=await b(s,this.connection,this.prefix,this.dlqSuffix),o={...a,id:a.name};this.knownQueues.add(s);const t=JSON.stringify({stats:a.stats,isPaused:a.isPaused});return this.lastStatsCache.get(s)!==t&&(this.lastStatsCache.set(s,t),this.onQueueUpdate?.(o)),o}debouncedRefresh(s){const a=this.debounceTimers.get(s);a&&clearTimeout(a);const o=setTimeout(()=>{this.debounceTimers.delete(s),this.refreshQueue(s)},v);this.debounceTimers.set(s,o)}setupQueueEvents(s){if(f.has(s))return;const a=new P.QueueEvents(s,{connection:this.connection,prefix:this.prefix}),o=()=>{this.debouncedRefresh(s)};a.on("waiting",o),a.on("active",o),a.on("completed",o),a.on("failed",o),a.on("delayed",o),a.on("removed",o)}async setupAllQueueEvents(){const s=await w(this.connection,this.prefix);for(const a of s)this.setupQueueEvents(a)}async closeAllQueueEvents(){for(const s of this.debounceTimers.values())clearTimeout(s);this.debounceTimers.clear();for(const[,s]of f)await s.close();f.clear()}getKnownQueues(){return this.knownQueues}}const E=async(u,s,a)=>{const o=await w(u,s),t=[];for(const e of o){const n=await b(e,u,s,a);t.push(n)}return t},S=({registerApi:u},s,a,o)=>{u({method:"GET",path:"/__motia/bullmq/queues"},async()=>{try{return{status:200,body:{queues:await E(o,s,a)}}}catch(t){return{status:500,body:{error:t instanceof Error?t.message:"Unknown error"}}}}),u({method:"GET",path:"/__motia/bullmq/queues/:name"},async t=>{try{const e=t.pathParams.name,n=d(e,o,s),[i,r]=await Promise.all([n.isPaused(),n.getJobCounts()]);return{status:200,body:{name:e,displayName:e,isPaused:i,isDLQ:e.endsWith(a),stats:{waiting:r.waiting||0,active:r.active||0,completed:r.completed||0,failed:r.failed||0,delayed:r.delayed||0,paused:r.paused||0,prioritized:r.prioritized||0}}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/queues/:name/pause"},async t=>{try{const e=t.pathParams.name;return await d(e,o,s).pause(),{status:200,body:{message:"Queue paused"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/queues/:name/resume"},async t=>{try{const e=t.pathParams.name;return await d(e,o,s).resume(),{status:200,body:{message:"Queue resumed"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/queues/:name/clean"},async t=>{try{const e=t.pathParams.name,n=t.body,i={grace:n.grace??0,limit:n.limit??1e3,status:n.status??"completed"},m=await d(e,o,s).clean(i.grace,i.limit,i.status);return{status:200,body:{deleted:m.length,ids:m}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/queues/:name/drain"},async t=>{try{const e=t.pathParams.name;return await d(e,o,s).drain(),{status:200,body:{message:"Queue drained"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"GET",path:"/__motia/bullmq/queues/:name/jobs"},async t=>{try{const e=t.pathParams.name,n=t.queryParams.status||"waiting",i=parseInt(t.queryParams.start,10)||0,r=parseInt(t.queryParams.end,10)||100;return{status:200,body:{jobs:(await d(e,o,s).getJobs([n],i,r)).map(c=>({id:c.id||"",name:c.name,data:c.data,opts:c.opts,progress:typeof c.progress=="object"?JSON.stringify(c.progress):c.progress,timestamp:c.timestamp,attemptsMade:c.attemptsMade,processedOn:c.processedOn,finishedOn:c.finishedOn,returnvalue:c.returnvalue,failedReason:c.failedReason,stacktrace:c.stacktrace}))}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"GET",path:"/__motia/bullmq/queues/:queueName/jobs/:jobId"},async t=>{try{const e=t.pathParams.queueName,n=t.pathParams.jobId,r=await d(e,o,s).getJob(n);return r?{status:200,body:{id:r.id||"",name:r.name,data:r.data,opts:r.opts,progress:typeof r.progress=="object"?JSON.stringify(r.progress):r.progress,timestamp:r.timestamp,attemptsMade:r.attemptsMade,processedOn:r.processedOn,finishedOn:r.finishedOn,returnvalue:r.returnvalue,failedReason:r.failedReason,stacktrace:r.stacktrace}}:{status:404,body:{error:"Job not found"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/queues/:queueName/jobs/:jobId/retry"},async t=>{try{const e=t.pathParams.queueName,n=t.pathParams.jobId,r=await d(e,o,s).getJob(n);return r?(await r.retry(),{status:200,body:{message:"Job retried"}}):{status:404,body:{error:"Job not found"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/queues/:queueName/jobs/:jobId/remove"},async t=>{try{const e=t.pathParams.queueName,n=t.pathParams.jobId,r=await d(e,o,s).getJob(n);return r?(await r.remove(),{status:200,body:{message:"Job removed"}}):{status:404,body:{error:"Job not found"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/queues/:queueName/jobs/:jobId/promote"},async t=>{try{const e=t.pathParams.queueName,n=t.pathParams.jobId,r=await d(e,o,s).getJob(n);return r?(await r.promote(),{status:200,body:{message:"Job promoted"}}):{status:404,body:{error:"Job not found"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"GET",path:"/__motia/bullmq/dlq/:name/jobs"},async t=>{try{const e=t.pathParams.name,n=parseInt(t.queryParams.start,10)||0,i=parseInt(t.queryParams.end,10)||100,r=e.endsWith(a)?e:`${e}${a}`;return{status:200,body:{jobs:(await d(r,o,s).getJobs(["waiting","completed"],n,i)).map(c=>({id:c.id||"",name:c.name,data:c.data,timestamp:c.timestamp,originalEvent:c.data?.originalEvent,failureReason:c.data?.failureReason||c.failedReason,failureTimestamp:c.data?.failureTimestamp||c.finishedOn,attemptsMade:c.data?.attemptsMade||c.attemptsMade}))}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/dlq/:name/retry/:jobId"},async t=>{try{const e=t.pathParams.name,n=t.pathParams.jobId,i=e.endsWith(a)?e:`${e}${a}`,m=await d(i,o,s).getJob(n);if(!m)return{status:404,body:{error:"Job not found in DLQ"}};const l=m.data?.originalEvent;if(l){const p=i.replace(a,""),c=d(p,o,s),h={topic:l.topic,data:l.data,traceId:l.traceId};l.flows&&(h.flows=l.flows),l.messageGroupId&&(h.messageGroupId=l.messageGroupId),await c.add(l.topic||m.name,h)}return await m.remove(),{status:200,body:{message:"Job retried from DLQ"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/dlq/:name/retry-all"},async t=>{try{const e=t.pathParams.name,n=e.endsWith(a)?e:`${e}${a}`,r=await d(n,o,s).getJobs(["waiting","completed"]),m=n.replace(a,""),l=d(m,o,s);let p=0;for(const c of r){const h=c.data?.originalEvent;if(h){const y={topic:h.topic,data:h.data,traceId:h.traceId};h.flows&&(y.flows=h.flows),h.messageGroupId&&(y.messageGroupId=h.messageGroupId),await l.add(h.topic||c.name,y)}await c.remove(),p++}return{status:200,body:{message:`Retried ${p} jobs from DLQ`,count:p}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}}),u({method:"POST",path:"/__motia/bullmq/dlq/:name/clear"},async t=>{try{const e=t.pathParams.name,n=e.endsWith(a)?e:`${e}${a}`;return await d(n,o,s).obliterate({force:!0}),{status:200,body:{message:"DLQ cleared"}}}catch(e){return{status:500,body:{error:e instanceof Error?e.message:"Unknown error"}}}})},q="__motia.bullmq-queues",O=u=>u!==null&&typeof u=="object"&&"connection"in u&&"prefix"in u&&"dlqSuffix"in u;function k(u){let s,a,o,t=!1;if(O(u.eventAdapter))s=u.eventAdapter.connection,a=u.eventAdapter.prefix,o=u.eventAdapter.dlqSuffix;else{const i=process.env.BULLMQ_REDIS_HOST||process.env.REDIS_HOST||"localhost",r=parseInt(process.env.BULLMQ_REDIS_PORT||process.env.REDIS_PORT||"6379",10),m=process.env.BULLMQ_REDIS_PASSWORD||process.env.REDIS_PASSWORD||void 0;a=process.env.BULLMQ_PREFIX||"motia:events",o=process.env.BULLMQ_DLQ_SUFFIX||".dlq",s=new I({host:i,port:r,password:m,maxRetriesPerRequest:null}),t=!0}const e=new Q(s,a,o),n=u.lockedData.createStream({filePath:`${q}.ts`,hidden:!0,config:{name:q,baseConfig:{storageType:"custom",factory:()=>e},schema:null}})();return e.setUpdateCallback(i=>{n.set("default",i.id,i)}),e.setupAllQueueEvents().then(()=>{e.getGroup("default").then(i=>{for(const r of i)n.set("default",r.id,r)})}),S(u,a,o,s),{workbench:[{packageName:"@motiadev/plugin-bullmq",cssImports:["@motiadev/plugin-bullmq/dist/plugin-bullmq.css"],label:"Queues",position:"top",componentName:"QueuesPage",labelIcon:"layers"}],onShutdown:async()=>{await e.closeAllQueueEvents(),t&&await s.quit()}}}module.exports=k;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
type QueryProviderProps = {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
};
|
|
5
|
-
export declare const QueryProvider: ({ children }: QueryProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=query-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-provider.d.ts","sourceRoot":"","sources":["../../src/providers/query-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYtC,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,cAAc,kBAAkB,4CAE7D,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { JobInfo, JobStatus, QueueInfo } from '../types/queue';
|
|
2
|
-
type BullMQState = {
|
|
3
|
-
queues: QueueInfo[];
|
|
4
|
-
selectedQueue: QueueInfo | null;
|
|
5
|
-
selectedJob: JobInfo | null;
|
|
6
|
-
selectedStatus: JobStatus;
|
|
7
|
-
error: string | null;
|
|
8
|
-
searchQuery: string;
|
|
9
|
-
jobDetailOpen: boolean;
|
|
10
|
-
setQueues: (queues: QueueInfo[]) => void;
|
|
11
|
-
setSelectedQueue: (queue: QueueInfo | null) => void;
|
|
12
|
-
updateSelectedQueueStats: (queue: QueueInfo) => void;
|
|
13
|
-
setSelectedJob: (job: JobInfo | null) => void;
|
|
14
|
-
setSelectedStatus: (status: JobStatus) => void;
|
|
15
|
-
setError: (error: string | null) => void;
|
|
16
|
-
setSearchQuery: (query: string) => void;
|
|
17
|
-
setJobDetailOpen: (open: boolean) => void;
|
|
18
|
-
reset: () => void;
|
|
19
|
-
};
|
|
20
|
-
export declare const useBullMQStore: import('zustand').UseBoundStore<import('zustand').StoreApi<BullMQState>>;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=use-bullmq-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-bullmq-store.d.ts","sourceRoot":"","sources":["../../src/stores/use-bullmq-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEnE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,SAAS,EAAE,CAAA;IACnB,aAAa,EAAE,SAAS,GAAG,IAAI,CAAA;IAC/B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAA;IAC3B,cAAc,EAAE,SAAS,CAAA;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IAEtB,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAA;IACxC,gBAAgB,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAA;IACnD,wBAAwB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;IACpD,cAAc,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC7C,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAA;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACxC,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACzC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAYD,eAAO,MAAM,cAAc,0EAYxB,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { StreamAdapter } from '@motiadev/core';
|
|
2
|
-
import { Queue } from 'bullmq';
|
|
3
|
-
import { Redis } from 'ioredis';
|
|
4
|
-
import { QueueInfo } from '../types/queue';
|
|
5
|
-
export declare const getOrCreateQueue: (name: string, connection: Redis, prefix: string) => Queue;
|
|
6
|
-
export declare const discoverQueueNames: (connection: Redis, prefix: string) => Promise<Set<string>>;
|
|
7
|
-
export declare const getQueueInfo: (name: string, connection: Redis, prefix: string, dlqSuffix: string) => Promise<QueueInfo>;
|
|
8
|
-
type StreamQueueInfo = QueueInfo & {
|
|
9
|
-
id: string;
|
|
10
|
-
};
|
|
11
|
-
export declare class QueuesStream extends StreamAdapter<StreamQueueInfo> {
|
|
12
|
-
private connection;
|
|
13
|
-
private prefix;
|
|
14
|
-
private dlqSuffix;
|
|
15
|
-
private knownQueues;
|
|
16
|
-
private onQueueUpdate?;
|
|
17
|
-
private lastStatsCache;
|
|
18
|
-
private debounceTimers;
|
|
19
|
-
constructor(connection: Redis, prefix: string, dlqSuffix: string);
|
|
20
|
-
setUpdateCallback(callback: (queueInfo: StreamQueueInfo) => void): void;
|
|
21
|
-
get(_groupId: string, id: string): Promise<StreamQueueInfo | null>;
|
|
22
|
-
set(_groupId: string, _id: string, data: StreamQueueInfo): Promise<StreamQueueInfo>;
|
|
23
|
-
delete(_groupId: string, id: string): Promise<StreamQueueInfo | null>;
|
|
24
|
-
getGroup(_groupId: string): Promise<StreamQueueInfo[]>;
|
|
25
|
-
refreshQueue(name: string): Promise<StreamQueueInfo>;
|
|
26
|
-
private debouncedRefresh;
|
|
27
|
-
setupQueueEvents(queueName: string): void;
|
|
28
|
-
setupAllQueueEvents(): Promise<void>;
|
|
29
|
-
closeAllQueueEvents(): Promise<void>;
|
|
30
|
-
getKnownQueues(): Set<string>;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=queues-stream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queues-stream.d.ts","sourceRoot":"","sources":["../../src/streams/queues-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAe,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAK/C,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,YAAY,KAAK,EAAE,QAAQ,MAAM,KAAG,KAQlF,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAU,YAAY,KAAK,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAY/F,CAAA;AAED,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,YAAY,KAAK,EACjB,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,OAAO,CAAC,SAAS,CAmBnB,CAAA;AAED,KAAK,eAAe,GAAG,SAAS,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAIjD,qBAAa,YAAa,SAAQ,aAAa,CAAC,eAAe,CAAC;IAC9D,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,aAAa,CAAC,CAAsC;IAC5D,OAAO,CAAC,cAAc,CAAiC;IACvD,OAAO,CAAC,cAAc,CAAyC;gBAEnD,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAOhE,iBAAiB,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI;IAIjE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IASlE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAInF,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAMrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAetD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAgB1D,OAAO,CAAC,gBAAgB;IAcxB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAsBnC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAOpC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAY1C,cAAc,IAAI,GAAG,CAAC,MAAM,CAAC;CAG9B"}
|
package/dist/types/queue.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Redis, RedisOptions } from 'ioredis';
|
|
2
|
-
export type BullMQPluginConfig = {
|
|
3
|
-
connection: Redis | RedisOptions;
|
|
4
|
-
prefix?: string;
|
|
5
|
-
dlqSuffix?: string;
|
|
6
|
-
refreshInterval?: number;
|
|
7
|
-
};
|
|
8
|
-
export type JobStatus = 'waiting' | 'active' | 'completed' | 'failed' | 'delayed' | 'paused' | 'prioritized';
|
|
9
|
-
export type QueueStats = {
|
|
10
|
-
waiting: number;
|
|
11
|
-
active: number;
|
|
12
|
-
completed: number;
|
|
13
|
-
failed: number;
|
|
14
|
-
delayed: number;
|
|
15
|
-
paused: number;
|
|
16
|
-
prioritized: number;
|
|
17
|
-
};
|
|
18
|
-
export type QueueInfo = {
|
|
19
|
-
name: string;
|
|
20
|
-
displayName: string;
|
|
21
|
-
isPaused: boolean;
|
|
22
|
-
isDLQ: boolean;
|
|
23
|
-
stats: QueueStats;
|
|
24
|
-
};
|
|
25
|
-
export type JobProgress = number | string | object | boolean | null;
|
|
26
|
-
export type JobInfo = {
|
|
27
|
-
id: string;
|
|
28
|
-
name: string;
|
|
29
|
-
data: unknown;
|
|
30
|
-
opts: Record<string, unknown>;
|
|
31
|
-
progress: JobProgress;
|
|
32
|
-
attemptsMade: number;
|
|
33
|
-
failedReason?: string;
|
|
34
|
-
stacktrace?: string[];
|
|
35
|
-
returnvalue?: unknown;
|
|
36
|
-
timestamp: number;
|
|
37
|
-
finishedOn?: number;
|
|
38
|
-
processedOn?: number;
|
|
39
|
-
delay?: number;
|
|
40
|
-
};
|
|
41
|
-
export type DLQJobInfo = {
|
|
42
|
-
id: string;
|
|
43
|
-
originalEvent: unknown;
|
|
44
|
-
failureReason: string;
|
|
45
|
-
failureTimestamp: number;
|
|
46
|
-
attemptsMade: number;
|
|
47
|
-
originalJobId?: string;
|
|
48
|
-
};
|
|
49
|
-
export type CleanOptions = {
|
|
50
|
-
grace: number;
|
|
51
|
-
limit: number;
|
|
52
|
-
status: JobStatus;
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=queue.d.ts.map
|