@motiadev/plugin-bullmq 0.13.0-beta.162-717198

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/LICENSE ADDED
@@ -0,0 +1,93 @@
1
+ Elastic License 2.0
2
+
3
+ URL: https://www.elastic.co/licensing/elastic-license
4
+
5
+ ## Acceptance
6
+
7
+ By using the software, you agree to all of the terms and conditions below.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
12
+ non-sublicensable, non-transferable license to use, copy, distribute, make
13
+ available, and prepare derivative works of the software, in each case subject
14
+ to the limitations and conditions below.
15
+
16
+ ## Limitations
17
+
18
+ You may not provide the software to third parties as a hosted or managed
19
+ service, where the service provides users with access to any substantial set of
20
+ the features or functionality of the software.
21
+
22
+ You may not move, change, disable, or circumvent the license key functionality
23
+ in the software, and you may not remove or obscure any functionality in the
24
+ software that is protected by the license key.
25
+
26
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
27
+ of the licensor in the software. Any use of the licensor's trademarks is subject
28
+ to applicable law.
29
+
30
+ ## Patents
31
+
32
+ The licensor grants you a license, under any patent claims the licensor can
33
+ license, or becomes able to license, to make, have made, use, sell, offer for
34
+ sale, import and have imported the software, in each case subject to the
35
+ limitations and conditions in this license. This license does not cover any
36
+ patent claims that you cause to be infringed by modifications or additions to
37
+ the software. If you or your company make any written claim that the software
38
+ infringes or contributes to infringement of any patent, your patent license for
39
+ the software granted under these terms ends immediately. If your company makes
40
+ such a claim, your patent license ends immediately for work on behalf of your
41
+ company.
42
+
43
+ ## Notices
44
+
45
+ You must ensure that anyone who gets a copy of any part of the software from you
46
+ also gets a copy of these terms.
47
+
48
+ If you modify the software, you must include in any modified copies of the
49
+ software prominent notices stating that you have modified the software.
50
+
51
+ ## No Other Rights
52
+
53
+ These terms do not imply any licenses other than those expressly granted in
54
+ these terms.
55
+
56
+ ## Termination
57
+
58
+ If you use the software in violation of these terms, such use is not licensed,
59
+ and your licenses will automatically terminate. If the licensor provides you
60
+ with a notice of your violation, and you cease all violation of this license no
61
+ later than 30 days after you receive that notice, your licenses will be
62
+ reinstated retroactively. However, if you violate these terms after such
63
+ reinstatement, any additional violation of these terms will cause your licenses
64
+ to terminate automatically and permanently.
65
+
66
+ ## No Liability
67
+
68
+ *As far as the law allows, the software comes as is, without any warranty or
69
+ condition, and the licensor will not be liable to you for any damages arising
70
+ out of these terms or the use or nature of the software, under any kind of
71
+ legal claim.*
72
+
73
+ ## Definitions
74
+
75
+ The **licensor** is the entity offering these terms, and the **software** is the
76
+ software the licensor makes available under these terms, including any portion
77
+ of it.
78
+
79
+ **you** refers to the individual or entity agreeing to these terms.
80
+
81
+ **your company** is any legal entity, sole proprietorship, or other kind of
82
+ organization that you work for, plus all organizations that have control over,
83
+ are under the control of, or are under common control with that organization.
84
+ **control** means ownership of substantially all the assets of an entity, or the
85
+ power to direct its management and policies by vote, contract, or otherwise.
86
+ Control can be direct or indirect.
87
+
88
+ **your licenses** are all the licenses granted to you for the software under
89
+ these terms.
90
+
91
+ **use** means anything you do with the software requiring one of your licenses.
92
+
93
+ **trademark** means trademarks, service marks, and similar rights.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # @motiadev/plugin-bullmq
2
+
3
+ A Motia workbench plugin for managing BullMQ queues and Dead Letter Queues (DLQ).
4
+
5
+ ## Features
6
+
7
+ - **Queue Dashboard**: View all discovered queues with real-time statistics
8
+ - **Queue Operations**: Pause, resume, clean, and drain queues
9
+ - **Job Management**: View, retry, remove, and promote jobs
10
+ - **DLQ Management**: View failed jobs, retry from DLQ, bulk retry, and clear DLQ
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ pnpm add @motiadev/plugin-bullmq
16
+ ```
17
+
18
+ ## Configuration
19
+
20
+ The plugin reads Redis connection configuration from environment variables:
21
+
22
+ | Variable | Default | Description |
23
+ |----------|---------|-------------|
24
+ | `BULLMQ_REDIS_HOST` | `localhost` | Redis host |
25
+ | `BULLMQ_REDIS_PORT` | `6379` | Redis port |
26
+ | `BULLMQ_REDIS_PASSWORD` | - | Redis password (optional) |
27
+ | `BULLMQ_PREFIX` | `motia:events` | Queue prefix (matches Motia's default) |
28
+ | `BULLMQ_DLQ_SUFFIX` | `.dlq` | DLQ suffix pattern |
29
+
30
+ Alternatively, you can use the generic Redis variables:
31
+ - `REDIS_HOST`
32
+ - `REDIS_PORT`
33
+ - `REDIS_PASSWORD`
34
+
35
+ ## Usage
36
+
37
+ Add the plugin to your Motia configuration:
38
+
39
+ ```typescript
40
+ import bullmqPlugin from '@motiadev/plugin-bullmq/plugin'
41
+
42
+ export default {
43
+ plugins: [bullmqPlugin],
44
+ }
45
+ ```
46
+
47
+ ## API Endpoints
48
+
49
+ ### Queue Operations
50
+
51
+ | Method | Endpoint | Description |
52
+ |--------|----------|-------------|
53
+ | GET | `/__motia/bullmq/queues` | List all queues with stats |
54
+ | GET | `/__motia/bullmq/queues/:name` | Get queue details |
55
+ | POST | `/__motia/bullmq/queues/:name/pause` | Pause queue |
56
+ | POST | `/__motia/bullmq/queues/:name/resume` | Resume queue |
57
+ | POST | `/__motia/bullmq/queues/:name/clean` | Clean jobs by status |
58
+ | POST | `/__motia/bullmq/queues/:name/drain` | Drain queue |
59
+
60
+ ### Job Operations
61
+
62
+ | Method | Endpoint | Description |
63
+ |--------|----------|-------------|
64
+ | GET | `/__motia/bullmq/queues/:name/jobs` | List jobs (query: status, start, end) |
65
+ | GET | `/__motia/bullmq/queues/:queueName/jobs/:jobId` | Get job details |
66
+ | POST | `/__motia/bullmq/queues/:queueName/jobs/:jobId/retry` | Retry job |
67
+ | POST | `/__motia/bullmq/queues/:queueName/jobs/:jobId/remove` | Remove job |
68
+ | POST | `/__motia/bullmq/queues/:queueName/jobs/:jobId/promote` | Promote delayed job |
69
+
70
+ ### DLQ Operations
71
+
72
+ | Method | Endpoint | Description |
73
+ |--------|----------|-------------|
74
+ | GET | `/__motia/bullmq/dlq/:name/jobs` | List DLQ jobs |
75
+ | POST | `/__motia/bullmq/dlq/:name/retry/:jobId` | Retry job from DLQ |
76
+ | POST | `/__motia/bullmq/dlq/:name/retry-all` | Retry all jobs from DLQ |
77
+ | POST | `/__motia/bullmq/dlq/:name/clear` | Clear all DLQ jobs |
78
+
79
+ ## Development
80
+
81
+ ```bash
82
+ pnpm build
83
+ pnpm dev
84
+ ```
85
+
package/dist/api.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { MotiaPluginContext } from '@motiadev/core';
2
+ import { Redis } from 'ioredis';
3
+ export declare const api: ({ registerApi }: MotiaPluginContext, prefix: string, dlqSuffix: string, connection: Redis) => void;
4
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAEjF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAoDpC,eAAO,MAAM,GAAG,GACd,iBAAiB,kBAAkB,EACnC,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,YAAY,KAAK,KAChB,IAsXF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const DLQPanel: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
2
+ //# sourceMappingURL=dlq-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dlq-panel.d.ts","sourceRoot":"","sources":["../../src/components/dlq-panel.tsx"],"names":[],"mappings":"AAoBA,OAAO,iCAAiC,CAAA;AAoDxC,eAAO,MAAM,QAAQ,2FA6LnB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const JobDetail: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
2
+ //# sourceMappingURL=job-detail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-detail.d.ts","sourceRoot":"","sources":["../../src/components/job-detail.tsx"],"names":[],"mappings":"AAQA,OAAO,iCAAiC,CAAA;AA2CxC,eAAO,MAAM,SAAS,2FA0HpB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const JobsTable: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
2
+ //# sourceMappingURL=jobs-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs-table.d.ts","sourceRoot":"","sources":["../../src/components/jobs-table.tsx"],"names":[],"mappings":"AAsHA,eAAO,MAAM,SAAS,oFAkDpB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const QueueDetail: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
2
+ //# sourceMappingURL=queue-detail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-detail.d.ts","sourceRoot":"","sources":["../../src/components/queue-detail.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,WAAW,oFA2LtB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const QueueList: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
2
+ //# sourceMappingURL=queue-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-list.d.ts","sourceRoot":"","sources":["../../src/components/queue-list.tsx"],"names":[],"mappings":"AAyEA,eAAO,MAAM,SAAS,oFA8EpB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const QueuesPage: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
2
+ //# sourceMappingURL=queues-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queues-page.d.ts","sourceRoot":"","sources":["../../src/components/queues-page.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,oFAuBrB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { DLQJobInfo, JobInfo, JobStatus } from '../types/queue';
2
+ export declare const useJobs: () => {
3
+ jobs: JobInfo[];
4
+ isLoading: boolean;
5
+ error: string | null;
6
+ fetchJobs: (queueName: string, status: JobStatus, start?: number, end?: number) => Promise<void>;
7
+ getJob: (queueName: string, jobId: string) => Promise<JobInfo | null>;
8
+ retryJob: (queueName: string, jobId: string) => Promise<void>;
9
+ removeJob: (queueName: string, jobId: string) => Promise<void>;
10
+ promoteJob: (queueName: string, jobId: string) => Promise<void>;
11
+ getDLQJobs: (queueName: string, start?: number, end?: number) => Promise<DLQJobInfo[]>;
12
+ retryFromDLQ: (queueName: string, jobId: string) => Promise<void>;
13
+ retryAllFromDLQ: (queueName: string) => Promise<void>;
14
+ clearDLQ: (queueName: string) => Promise<void>;
15
+ };
16
+ //# sourceMappingURL=use-jobs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-jobs.d.ts","sourceRoot":"","sources":["../../src/hooks/use-jobs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEpE,eAAO,MAAM,OAAO;;;;2BAIE,MAAM,UAAU,SAAS;wBAoBA,MAAM,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;0BAexE,MAAM,SAAS,MAAM;2BAgBrB,MAAM,SAAS,MAAM;4BAmBrB,MAAM,SAAS,MAAM;4BAkBQ,MAAM,mCAAyB,OAAO,CAAC,UAAU,EAAE,CAAC;8BAejF,MAAM,SAAS,MAAM;iCAarB,MAAM;0BAaN,MAAM;CAgC3B,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { QueueInfo } from '../types/queue';
2
+ export declare const useQueues: () => {
3
+ queues: QueueInfo[];
4
+ isLoading: boolean;
5
+ error: string | null;
6
+ fetchQueues: () => Promise<void>;
7
+ refreshQueue: (name: string) => Promise<QueueInfo | null>;
8
+ pauseQueue: (name: string) => Promise<void>;
9
+ resumeQueue: (name: string) => Promise<void>;
10
+ cleanQueue: (name: string, status: string, grace?: number, limit?: number) => Promise<void>;
11
+ drainQueue: (name: string) => Promise<void>;
12
+ };
13
+ //# sourceMappingURL=use-queues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-queues.d.ts","sourceRoot":"","sources":["../../src/hooks/use-queues.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,eAAO,MAAM,SAAS;;;;;yBAoB0B,MAAM,KAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;uBAajE,MAAM;wBAYN,MAAM;uBAYN,MAAM,UAAU,MAAM;uBAgBtB,MAAM;CA4BtB,CAAA"}
package/dist/index.cjs ADDED
@@ -0,0 +1,98 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),f=require("@motiadev/ui");function Qt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:()=>e[s]})}}return n.default=e,Object.freeze(n)}const M=Qt(d);var le={exports:{}},ne={};/**
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 Ie;function Jt(){if(Ie)return ne;Ie=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(a,o,l){var r=null;if(l!==void 0&&(r=""+l),o.key!==void 0&&(r=""+o.key),"key"in o){l={};for(var c in o)c!=="key"&&(l[c]=o[c])}else l=o;return o=l.ref,{$$typeof:e,type:a,key:r,ref:o!==void 0?o:null,props:l}}return ne.Fragment=n,ne.jsx=s,ne.jsxs=s,ne}var se={};/**
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 Fe;function It(){return Fe||(Fe=1,process.env.NODE_ENV!=="production"&&function(){function e(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===B?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case v:return"Fragment";case j:return"Profiler";case R:return"StrictMode";case N:return"Suspense";case A:return"SuspenseList";case L:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case w:return"Portal";case S:return(i.displayName||"Context")+".Provider";case y:return(i._context.displayName||"Context")+".Consumer";case k:var C=i.render;return i=i.displayName,i||(i=C.displayName||C.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case E:return C=i.displayName||null,C!==null?C:e(i.type)||"Memo";case W:C=i._payload,i=i._init;try{return e(i(C))}catch{}}return null}function n(i){return""+i}function s(i){try{n(i);var C=!1}catch{C=!0}if(C){C=console;var D=C.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return D.call(C,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),n(i)}}function a(i){if(i===v)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===W)return"<...>";try{var C=e(i);return C?"<"+C+">":"<...>"}catch{return"<...>"}}function o(){var i=Q.A;return i===null?null:i.getOwner()}function l(){return Error("react-stack-top-frame")}function r(i){if(J.call(i,"key")){var C=Object.getOwnPropertyDescriptor(i,"key").get;if(C&&C.isReactWarning)return!1}return i.key!==void 0}function c(i,C){function D(){P||(P=!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)",C))}D.isReactWarning=!0,Object.defineProperty(i,"key",{get:D,configurable:!0})}function u(){var i=e(this.type);return $[i]||($[i]=!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.")),i=this.props.ref,i!==void 0?i:null}function p(i,C,D,g,T,V,pe,xe){return D=V.ref,i={$$typeof:x,type:i,key:C,props:V,_owner:T},(D!==void 0?D:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:u}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:pe}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:xe}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function h(i,C,D,g,T,V,pe,xe){var F=C.children;if(F!==void 0)if(g)if(z(F)){for(g=0;g<F.length;g++)b(F[g]);Object.freeze&&Object.freeze(F)}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(F);if(J.call(C,"key")){F=e(i);var G=Object.keys(C).filter(function(Lt){return Lt!=="key"});g=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",U[F+g]||(G=0<G.length?"{"+G.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} />`,g,F,G,F),U[F+g]=!0)}if(F=null,D!==void 0&&(s(D),F=""+D),r(C)&&(s(C.key),F=""+C.key),"key"in C){D={};for(var ge in C)ge!=="key"&&(D[ge]=C[ge])}else D=C;return F&&c(D,typeof i=="function"?i.displayName||i.name||"Unknown":i),p(i,F,V,T,o(),D,pe,xe)}function b(i){typeof i=="object"&&i!==null&&i.$$typeof===x&&i._store&&(i._store.validated=1)}var m=d,x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),S=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),B=Symbol.for("react.client.reference"),Q=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=Object.prototype.hasOwnProperty,z=Array.isArray,H=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(i){return i()}};var P,$={},_=m.react_stack_bottom_frame.bind(m,l)(),q=H(a(l)),U={};se.Fragment=v,se.jsx=function(i,C,D,g,T){var V=1e4>Q.recentlyCreatedOwnerStacks++;return h(i,C,D,!1,g,T,V?Error("react-stack-top-frame"):_,V?H(a(i)):q)},se.jsxs=function(i,C,D,g,T){var V=1e4>Q.recentlyCreatedOwnerStacks++;return h(i,C,D,!0,g,T,V?Error("react-stack-top-frame"):_,V?H(a(i)):q)}}()),se}var $e;function Ft(){return $e||($e=1,process.env.NODE_ENV==="production"?le.exports=Jt():le.exports=It()),le.exports}var t=Ft();const Ue=e=>{let n;const s=new Set,a=(p,h)=>{const b=typeof p=="function"?p(n):p;if(!Object.is(b,n)){const m=n;n=h??(typeof b!="object"||b===null)?b:Object.assign({},n,b),s.forEach(x=>x(n,m))}},o=()=>n,c={setState:a,getState:o,getInitialState:()=>u,subscribe:p=>(s.add(p),()=>s.delete(p))},u=n=e(a,o,c);return c},$t=e=>e?Ue(e):Ue,Ut=e=>e;function Wt(e,n=Ut){const s=d.useSyncExternalStore(e.subscribe,d.useCallback(()=>n(e.getState()),[e,n]),d.useCallback(()=>n(e.getInitialState()),[e,n]));return d.useDebugValue(s),s}const We=e=>{const n=$t(e),s=a=>Wt(n,a);return Object.assign(s,n),s},zt=e=>e?We(e):We,ze={queues:[],selectedQueue:null,jobs:[],selectedJob:null,selectedStatus:"waiting",isLoading:!1,error:null,searchQuery:"",jobDetailOpen:!1},O=zt(e=>({...ze,setQueues:n=>e({queues:n}),setSelectedQueue:n=>e({selectedQueue:n,jobs:[],selectedJob:null}),updateSelectedQueueStats:n=>e({selectedQueue:n}),setJobs:n=>e({jobs:n}),setSelectedJob:n=>e({selectedJob:n}),setSelectedStatus:n=>e({selectedStatus:n,jobs:[]}),setLoading:n=>e({isLoading:n}),setError:n=>e({error:n}),setSearchQuery:n=>e({searchQuery:n}),setJobDetailOpen:n=>e({jobDetailOpen:n}),reset:()=>e(ze)})),Ae=()=>{const{queues:e,setQueues:n,setLoading:s,setError:a,isLoading:o,error:l}=O(),r=d.useCallback(async()=>{s(!0),a(null);try{const m=await fetch("/__motia/bullmq/queues");if(!m.ok)throw new Error("Failed to fetch queues");const x=await m.json();n(x.queues)}catch(m){a(m instanceof Error?m.message:"Unknown error")}finally{s(!1)}},[n,s,a]),c=d.useCallback(async m=>{try{const x=await fetch(`/__motia/bullmq/queues/${encodeURIComponent(m)}`);if(!x.ok)throw new Error("Failed to fetch queue");return await x.json()}catch{return null}},[]),u=d.useCallback(async m=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(m)}/pause`,{method:"POST"}),await r()}catch(x){a(x instanceof Error?x.message:"Failed to pause queue")}},[r,a]),p=d.useCallback(async m=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(m)}/resume`,{method:"POST"}),await r()}catch(x){a(x instanceof Error?x.message:"Failed to resume queue")}},[r,a]),h=d.useCallback(async(m,x,w=0,v=1e3)=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(m)}/clean`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:x,grace:w,limit:v})}),await r()}catch(R){a(R instanceof Error?R.message:"Failed to clean queue")}},[r,a]),b=d.useCallback(async m=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(m)}/drain`,{method:"POST"}),await r()}catch(x){a(x instanceof Error?x.message:"Failed to drain queue")}},[r,a]);return d.useEffect(()=>{r();const m=setInterval(r,5e3);return()=>clearInterval(m)},[r]),{queues:e,isLoading:o,error:l,fetchQueues:r,refreshQueue:c,pauseQueue:u,resumeQueue:p,cleanQueue:h,drainQueue:b}};function I(e){const n=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&n==="[object Date]"?new e.constructor(+e):typeof e=="number"||n==="[object Number]"||typeof e=="string"||n==="[object String]"?new Date(e):new Date(NaN)}function Ht(e,n){return e instanceof Date?new e.constructor(n):new Date(n)}const ie=43200,He=1440;let qt={};function Vt(){return qt}function qe(e){const n=I(e),s=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return s.setUTCFullYear(n.getFullYear()),+e-+s}function ce(e,n){const s=I(e),a=I(n),o=s.getTime()-a.getTime();return o<0?-1:o>0?1:o}function Bt(e){return Ht(e,Date.now())}function Yt(e,n){const s=I(e),a=I(n),o=s.getFullYear()-a.getFullYear(),l=s.getMonth()-a.getMonth();return o*12+l}function Zt(e){return n=>{const a=(e?Math[e]:Math.trunc)(n);return a===0?0:a}}function Xt(e,n){return+I(e)-+I(n)}function Kt(e){const n=I(e);return n.setHours(23,59,59,999),n}function Gt(e){const n=I(e),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function en(e){const n=I(e);return+Kt(n)==+Gt(n)}function tn(e,n){const s=I(e),a=I(n),o=ce(s,a),l=Math.abs(Yt(s,a));let r;if(l<1)r=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*l);let c=ce(s,a)===-o;en(I(e))&&l===1&&ce(e,a)===1&&(c=!1),r=o*(l-Number(c))}return r===0?0:r}function nn(e,n,s){const a=Xt(e,n)/1e3;return Zt(s?.roundingMethod)(a)}const sn={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"}},an=(e,n,s)=>{let a;const o=sn[e];return typeof o=="string"?a=o:n===1?a=o.one:a=o.other.replace("{{count}}",n.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+a:a+" ago":a};function be(e){return(n={})=>{const s=n.width?String(n.width):e.defaultWidth;return e.formats[s]||e.formats[e.defaultWidth]}}const rn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},on={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ln={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cn={date:be({formats:rn,defaultWidth:"full"}),time:be({formats:on,defaultWidth:"full"}),dateTime:be({formats:ln,defaultWidth:"full"})},dn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},un=(e,n,s,a)=>dn[e];function ae(e){return(n,s)=>{const a=s?.context?String(s.context):"standalone";let o;if(a==="formatting"&&e.formattingValues){const r=e.defaultFormattingWidth||e.defaultWidth,c=s?.width?String(s.width):r;o=e.formattingValues[c]||e.formattingValues[r]}else{const r=e.defaultWidth,c=s?.width?String(s.width):e.defaultWidth;o=e.values[c]||e.values[r]}const l=e.argumentCallback?e.argumentCallback(n):n;return o[l]}}const fn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mn={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},hn={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"]},pn={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"]},xn={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"}},gn={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"}},bn=(e,n)=>{const s=Number(e),a=s%100;if(a>20||a<10)switch(a%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},jn={ordinalNumber:bn,era:ae({values:fn,defaultWidth:"wide"}),quarter:ae({values:mn,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ae({values:hn,defaultWidth:"wide"}),day:ae({values:pn,defaultWidth:"wide"}),dayPeriod:ae({values:xn,defaultWidth:"wide",formattingValues:gn,defaultFormattingWidth:"wide"})};function re(e){return(n,s={})=>{const a=s.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],l=n.match(o);if(!l)return null;const r=l[0],c=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?yn(c,b=>b.test(r)):vn(c,b=>b.test(r));let p;p=e.valueCallback?e.valueCallback(u):u,p=s.valueCallback?s.valueCallback(p):p;const h=n.slice(r.length);return{value:p,rest:h}}}function vn(e,n){for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&n(e[s]))return s}function yn(e,n){for(let s=0;s<e.length;s++)if(n(e[s]))return s}function wn(e){return(n,s={})=>{const a=n.match(e.matchPattern);if(!a)return null;const o=a[0],l=n.match(e.parsePattern);if(!l)return null;let r=e.valueCallback?e.valueCallback(l[0]):l[0];r=s.valueCallback?s.valueCallback(r):r;const c=n.slice(o.length);return{value:r,rest:c}}}const Cn=/^(\d+)(th|st|nd|rd)?/i,Nn=/\d+/i,kn={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},Sn={any:[/^b/i,/^(a|c)/i]},Tn={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Dn={any:[/1/i,/2/i,/3/i,/4/i]},En={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},An={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]},Rn={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},_n={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]},Mn={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},On={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}},Pn={ordinalNumber:wn({matchPattern:Cn,parsePattern:Nn,valueCallback:e=>parseInt(e,10)}),era:re({matchPatterns:kn,defaultMatchWidth:"wide",parsePatterns:Sn,defaultParseWidth:"any"}),quarter:re({matchPatterns:Tn,defaultMatchWidth:"wide",parsePatterns:Dn,defaultParseWidth:"any",valueCallback:e=>e+1}),month:re({matchPatterns:En,defaultMatchWidth:"wide",parsePatterns:An,defaultParseWidth:"any"}),day:re({matchPatterns:Rn,defaultMatchWidth:"wide",parsePatterns:_n,defaultParseWidth:"any"}),dayPeriod:re({matchPatterns:Mn,defaultMatchWidth:"any",parsePatterns:On,defaultParseWidth:"any"})},Ln={code:"en-US",formatDistance:an,formatLong:cn,formatRelative:un,localize:jn,match:Pn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Qn(e,n,s){const a=Vt(),o=s?.locale??a.locale??Ln,l=2520,r=ce(e,n);if(isNaN(r))throw new RangeError("Invalid time value");const c=Object.assign({},s,{addSuffix:s?.addSuffix,comparison:r});let u,p;r>0?(u=I(n),p=I(e)):(u=I(e),p=I(n));const h=nn(p,u),b=(qe(p)-qe(u))/1e3,m=Math.round((h-b)/60);let x;if(m<2)return s?.includeSeconds?h<5?o.formatDistance("lessThanXSeconds",5,c):h<10?o.formatDistance("lessThanXSeconds",10,c):h<20?o.formatDistance("lessThanXSeconds",20,c):h<40?o.formatDistance("halfAMinute",0,c):h<60?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",1,c):m===0?o.formatDistance("lessThanXMinutes",1,c):o.formatDistance("xMinutes",m,c);if(m<45)return o.formatDistance("xMinutes",m,c);if(m<90)return o.formatDistance("aboutXHours",1,c);if(m<He){const w=Math.round(m/60);return o.formatDistance("aboutXHours",w,c)}else{if(m<l)return o.formatDistance("xDays",1,c);if(m<ie){const w=Math.round(m/He);return o.formatDistance("xDays",w,c)}else if(m<ie*2)return x=Math.round(m/ie),o.formatDistance("aboutXMonths",x,c)}if(x=tn(p,u),x<12){const w=Math.round(m/ie);return o.formatDistance("xMonths",w,c)}else{const w=x%12,v=Math.trunc(x/12);return w<3?o.formatDistance("aboutXYears",v,c):w<9?o.formatDistance("overXYears",v,c):o.formatDistance("almostXYears",v+1,c)}}function de(e,n){return Qn(e,Bt(e),n)}/**
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 Jn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),In=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,s,a)=>a?a.toUpperCase():s.toLowerCase()),Ve=e=>{const n=In(e);return n.charAt(0).toUpperCase()+n.slice(1)},ht=(...e)=>e.filter((n,s,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===s).join(" ").trim(),Fn=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="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 $n={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 Un=d.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:o="",children:l,iconNode:r,...c},u)=>d.createElement("svg",{ref:u,...$n,width:n,height:n,stroke:e,strokeWidth:a?Number(s)*24/Number(n):s,className:ht("lucide",o),...!l&&!Fn(c)&&{"aria-hidden":"true"},...c},[...r.map(([p,h])=>d.createElement(p,h)),...Array.isArray(l)?l:[l]]));/**
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 Y=(e,n)=>{const s=d.forwardRef(({className:a,...o},l)=>d.createElement(Un,{ref:l,iconNode:n,className:ht(`lucide-${Jn(Ve(e))}`,`lucide-${e}`,a),...o}));return s.displayName=Ve(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 Wn=[["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"}]],K=Y("refresh-cw",Wn);/**
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 zn=[["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"}]],ee=Y("trash",zn);/**
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 Hn=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Re=Y("x",Hn);function qn(e,n,s,a){function o(l){return l instanceof s?l:new s(function(r){r(l)})}return new(s||(s=Promise))(function(l,r){function c(h){try{p(a.next(h))}catch(b){r(b)}}function u(h){try{p(a.throw(h))}catch(b){r(b)}}function p(h){h.done?l(h.value):o(h.value).then(c,u)}p((a=a.apply(e,[])).next())})}var Vn=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var n=document.activeElement,s=[],a=0;a<e.rangeCount;a++)s.push(e.getRangeAt(a));switch(n.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":n.blur();break;default:n=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||s.forEach(function(o){e.addRange(o)}),n&&n.focus()}},Bn=Vn,Be={"text/plain":"Text","text/html":"Url",default:"Text"},Yn="Copy to clipboard: #{key}, Enter";function Zn(e){var n=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,n)}function Xn(e,n){var s,a,o,l,r,c,u=!1;n||(n={}),s=n.debug||!1;try{o=Bn(),l=document.createRange(),r=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(h){if(h.stopPropagation(),n.format)if(h.preventDefault(),typeof h.clipboardData>"u"){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var b=Be[n.format]||Be.default;window.clipboardData.setData(b,e)}else h.clipboardData.clearData(),h.clipboardData.setData(n.format,e);n.onCopy&&(h.preventDefault(),n.onCopy(h.clipboardData))}),document.body.appendChild(c),l.selectNodeContents(c),r.addRange(l);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");u=!0}catch(h){s&&console.error("unable to copy using execCommand: ",h),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",e),n.onCopy&&n.onCopy(window.clipboardData),u=!0}catch(b){s&&console.error("unable to copy using clipboardData: ",b),s&&console.error("falling back to prompt"),a=Zn("message"in n?n.message:Yn),window.prompt(a,e)}}finally{r&&(typeof r.removeRange=="function"?r.removeRange(l):r.removeAllRanges()),c&&document.body.removeChild(c),o()}return u}var Kn=Xn;function Z(e){return Object.prototype.toString.call(e)==="[object Object]"}function oe(e){return Array.isArray(e)?e.length:Z(e)?Object.keys(e).length:0}function Gn(e,n){if(typeof e=="string")return e;try{return JSON.stringify(e,(s,a)=>{switch(typeof a){case"bigint":return String(a)+"n";case"number":case"boolean":case"object":case"string":return a;default:return String(a)}},n)}catch(s){return`${s.name}: ${s.message}`||"JSON.stringify failed"}}function es(e){return qn(this,void 0,void 0,function*(){try{yield navigator.clipboard.writeText(e)}catch{Kn(e)}})}function Ye(e,n,s,a,o,l){if(l&&l.collapsed!==void 0)return!!l.collapsed;if(typeof a=="boolean")return a;if(typeof a=="number"&&n>a)return!0;const r=oe(e);if(typeof a=="function"){const c=_e(a,[{node:e,depth:n,indexOrName:s,size:r}]);if(typeof c=="boolean")return c}return!!(Array.isArray(e)&&r>o||Z(e)&&r>o)}function Ze(e,n,s,a,o,l){if(l&&l.collapsed!==void 0)return!!l.collapsed;if(typeof a=="boolean")return a;if(typeof a=="number"&&n>a)return!0;const r=Math.ceil(e.length/100);if(typeof a=="function"){const c=_e(a,[{node:e,depth:n,indexOrName:s,size:r}]);if(typeof c=="boolean")return c}return!!(Array.isArray(e)&&r>o||Z(e)&&r>o)}function te(e,n,s){return typeof e=="boolean"?e:!!(typeof e=="number"&&n>e||e==="collapsed"&&s||e==="expanded"&&!s)}function _e(e,n){try{return e(...n)}catch(s){reportError(s)}}function pt(e){if(e===!0||Z(e)&&e.add===!0)return!0}function Xe(e){if(e===!0||Z(e)&&e.edit===!0)return!0}function Me(e){if(e===!0||Z(e)&&e.delete===!0)return!0}function ts(e){return typeof e=="function"}function xt(e){return!e||e.add===void 0||!!e.add}function Ke(e){return!e||e.edit===void 0||!!e.edit}function Oe(e){return!e||e.delete===void 0||!!e.delete}function ue(e){return!e||e.enableClipboard===void 0||!!e.enableClipboard}function ns(e){return!e||e.matchesURL===void 0||!!e.matchesURL}function ss(e,n){return e==="string"?n.trim().replace(/^\"([\s\S]+?)\"$/,"$1"):n}var Ge;function je(){return je=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},je.apply(this,arguments)}var Pe=function(n){return M.createElement("svg",je({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},n),Ge||(Ge=M.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"})))},et;function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},ve.apply(this,arguments)}var as=function(n){return M.createElement("svg",ve({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},n),et||(et=M.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"})))},tt,nt;function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},ye.apply(this,arguments)}var rs=function(n){return M.createElement("svg",ye({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},n),tt||(tt=M.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"})),nt||(nt=M.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 fe({node:e,nodeMeta:n}){const{customizeCopy:s,CopyComponent:a,CopiedComponent:o}=d.useContext(X),[l,r]=d.useState(!1),c=u=>{u.stopPropagation();const p=s(e,n);typeof p=="string"&&p&&es(p),r(!0),setTimeout(()=>r(!1),3e3)};return l?typeof o=="function"?t.jsx(o,{className:"json-view--copy",style:{display:"inline-block"}}):t.jsx(rs,{className:"json-view--copy",style:{display:"inline-block"}}):typeof a=="function"?t.jsx(a,{onClick:c,className:"json-view--copy"}):t.jsx(as,{onClick:c,className:"json-view--copy"})}function we({indexOrName:e,value:n,depth:s,deleteHandle:a,editHandle:o,parent:l,parentPath:r}){const{displayArrayIndex:c}=d.useContext(X),u=Array.isArray(l);return t.jsxs("div",Object.assign({className:"json-view--pair"},{children:[!u||u&&c?t.jsxs(t.Fragment,{children:[t.jsx("span",Object.assign({className:typeof e=="number"?"json-view--index":"json-view--property"},{children:e})),":"," "]}):t.jsx(t.Fragment,{}),t.jsx(bt,{node:n,depth:s+1,deleteHandle:(p,h)=>a(p,h),editHandle:(p,h,b,m)=>o(p,h,b,m),parent:l,indexOrName:e,parentPath:r})]}))}var st,at;function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},Ce.apply(this,arguments)}var Le=function(n){return M.createElement("svg",Ce({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},n),st||(st=M.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"})),at||(at=M.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"})))},rt,ot;function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},Ne.apply(this,arguments)}var gt=function(n){return M.createElement("svg",Ne({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},n),rt||(rt=M.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"})),ot||(ot=M.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"})))},lt,it;function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},ke.apply(this,arguments)}var Qe=function(n){return M.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},n),lt||(lt=M.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"})),it||(it=M.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"})))},ct,dt;function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},Se.apply(this,arguments)}var Je=function(n){return M.createElement("svg",Se({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},n),ct||(ct=M.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"})),dt||(dt=M.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 os({originNode:e,node:n,depth:s,index:a,deleteHandle:o,customOptions:l,startIndex:r,parent:c,parentPath:u}){const{enableClipboard:p,src:h,onEdit:b,onChange:m,forceUpdate:x,displaySize:w,CustomOperation:v}=d.useContext(X),R=[...u,String(a)],[j,y]=d.useState(!0),S=d.useCallback((A,E,W)=>{e[A]=E,b&&b({newValue:E,oldValue:W,depth:s,src:h,indexOrName:A,parentType:"array",parentPath:u}),m&&m({type:"edit",depth:s,src:h,indexOrName:A,parentType:"array",parentPath:u}),x()},[n,b,m,x]),k=A=>{e.splice(A,1),o&&o(A,u),x()},N=t.jsxs(t.Fragment,{children:[!j&&t.jsxs("span",Object.assign({onClick:()=>y(!0),className:"jv-size-chevron"},{children:[te(w,s,j)&&t.jsxs("span",Object.assign({className:"jv-size"},{children:[oe(n)," Items"]})),t.jsx(Pe,{className:"jv-chevron"})]})),!j&&p&&ue(l)&&t.jsx(fe,{node:n,nodeMeta:{depth:s,indexOrName:a,parent:c,parentPath:u,currentPath:R}}),typeof v=="function"?t.jsx(v,{node:n}):null]});return t.jsxs("div",{children:[t.jsx("span",{children:"["}),N,j?t.jsxs("button",Object.assign({onClick:()=>y(!1),className:"jv-button"},{children:[r," ... ",r+n.length-1]})):t.jsx("div",Object.assign({className:"jv-indent"},{children:n.map((A,E)=>t.jsx(we,{indexOrName:E+r,value:A,depth:s,parent:n,deleteHandle:k,editHandle:S,parentPath:u},String(a)+String(E)))})),t.jsx("span",{children:"]"})]})}function ls({node:e,depth:n,deleteHandle:s,indexOrName:a,customOptions:o,parent:l,parentPath:r}){const c=typeof a<"u"?[...r,String(a)]:r,u=[];for(let P=0;P<e.length;P+=100)u.push(e.slice(P,P+100));const{collapsed:p,enableClipboard:h,collapseObjectsAfterLength:b,editable:m,onDelete:x,src:w,onAdd:v,CustomOperation:R,onChange:j,forceUpdate:y,displaySize:S}=d.useContext(X),[k,N]=d.useState(Ze(e,n,a,p,b,o));d.useEffect(()=>{N(Ze(e,n,a,p,b,o))},[p,b]);const[A,E]=d.useState(!1),W=()=>{E(!1),s&&s(a,r),x&&x({value:e,depth:n,src:w,indexOrName:a,parentType:"array",parentPath:r}),j&&j({type:"delete",depth:n,src:w,indexOrName:a,parentType:"array",parentPath:r})},[L,B]=d.useState(!1),Q=()=>{const P=e;P.push(null),v&&v({indexOrName:P.length-1,depth:n,src:w,parentType:"array",parentPath:r}),j&&j({type:"add",indexOrName:P.length-1,depth:n,src:w,parentType:"array",parentPath:r}),y()},J=A||L,z=()=>{E(!1),B(!1)},H=t.jsxs(t.Fragment,{children:[!k&&!J&&t.jsxs("span",Object.assign({onClick:()=>N(!0),className:"jv-size-chevron"},{children:[te(S,n,k)&&t.jsxs("span",Object.assign({className:"jv-size"},{children:[e.length," Items"]})),t.jsx(Pe,{className:"jv-chevron"})]})),J&&t.jsx(Qe,{className:"json-view--edit",style:{display:"inline-block"},onClick:L?Q:W}),J&&t.jsx(Je,{className:"json-view--edit",style:{display:"inline-block"},onClick:z}),!k&&!J&&h&&ue(o)&&t.jsx(fe,{node:e,nodeMeta:{depth:n,indexOrName:a,parent:l,parentPath:r,currentPath:c}}),!k&&!J&&pt(m)&&xt(o)&&t.jsx(gt,{className:"json-view--edit",onClick:()=>{Q()}}),!k&&!J&&Me(m)&&Oe(o)&&s&&t.jsx(Le,{className:"json-view--edit",onClick:()=>E(!0)}),typeof R=="function"?t.jsx(R,{node:e}):null]});return t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"["}),H,k?t.jsx("button",Object.assign({onClick:()=>N(!1),className:"jv-button"},{children:"..."})):t.jsx("div",Object.assign({className:"jv-indent"},{children:u.map((P,$)=>t.jsx(os,{originNode:e,node:P,depth:n,index:$,startIndex:$*100,deleteHandle:s,customOptions:o,parentPath:r},String(a)+String($)))})),t.jsx("span",{children:"]"}),k&&te(S,n,k)&&t.jsxs("span",Object.assign({onClick:()=>N(!1),className:"jv-size"},{children:[e.length," Items"]}))]})}function is({node:e,depth:n,indexOrName:s,deleteHandle:a,customOptions:o,parent:l,parentPath:r}){const{collapsed:c,onCollapse:u,enableClipboard:p,ignoreLargeArray:h,collapseObjectsAfterLength:b,editable:m,onDelete:x,src:w,onAdd:v,onEdit:R,onChange:j,forceUpdate:y,displaySize:S,CustomOperation:k}=d.useContext(X),N=typeof s<"u"?[...r,String(s)]:r;if(!h&&Array.isArray(e)&&e.length>100)return t.jsx(ls,{node:e,depth:n,indexOrName:s,deleteHandle:a,customOptions:o,parentPath:N});const A=Z(e),[E,W]=d.useState(Ye(e,n,s,c,b,o)),L=g=>{u?.({isCollapsing:!g,node:e,depth:n,indexOrName:s}),W(g)};d.useEffect(()=>{L(Ye(e,n,s,c,b,o))},[c,b]);const B=d.useCallback((g,T,V)=>{Array.isArray(e)?e[+g]=T:e&&(e[g]=T),R&&R({newValue:T,oldValue:V,depth:n,src:w,indexOrName:g,parentType:A?"object":"array",parentPath:N}),j&&j({type:"edit",depth:n,src:w,indexOrName:g,parentType:A?"object":"array",parentPath:N}),y()},[e,R,j,y]),Q=g=>{Array.isArray(e)?e.splice(+g,1):e&&delete e[g],y()},[J,z]=d.useState(!1),H=()=>{z(!1),a&&a(s,N),x&&x({value:e,depth:n,src:w,indexOrName:s,parentType:A?"object":"array",parentPath:N}),j&&j({type:"delete",depth:n,src:w,indexOrName:s,parentType:A?"object":"array",parentPath:N})},[P,$]=d.useState(!1),_=d.useRef(null),q=()=>{var g;if(A){const T=(g=_.current)===null||g===void 0?void 0:g.value;T&&(e[T]=null,_.current&&(_.current.value=""),$(!1),v&&v({indexOrName:T,depth:n,src:w,parentType:"object",parentPath:N}),j&&j({type:"add",indexOrName:T,depth:n,src:w,parentType:"object",parentPath:N}))}else if(Array.isArray(e)){const T=e;T.push(null),v&&v({indexOrName:T.length-1,depth:n,src:w,parentType:"array",parentPath:N}),j&&j({type:"add",indexOrName:T.length-1,depth:n,src:w,parentType:"array",parentPath:N})}y()},U=g=>{g.key==="Enter"?(g.preventDefault(),q()):g.key==="Escape"&&C()},i=J||P,C=()=>{z(!1),$(!1)},D=t.jsxs(t.Fragment,{children:[!E&&!i&&t.jsxs("span",Object.assign({onClick:()=>L(!0),className:"jv-size-chevron"},{children:[te(S,n,E)&&t.jsxs("span",Object.assign({className:"jv-size"},{children:[oe(e)," Items"]})),t.jsx(Pe,{className:"jv-chevron"})]})),P&&A&&t.jsx("input",{className:"json-view--input",placeholder:"property",ref:_,onKeyDown:U}),i&&t.jsx(Qe,{className:"json-view--edit",style:{display:"inline-block"},onClick:P?q:H}),i&&t.jsx(Je,{className:"json-view--edit",style:{display:"inline-block"},onClick:C}),!E&&!i&&p&&ue(o)&&t.jsx(fe,{node:e,nodeMeta:{depth:n,indexOrName:s,parent:l,parentPath:r,currentPath:N}}),!E&&!i&&pt(m)&&xt(o)&&t.jsx(gt,{className:"json-view--edit",onClick:()=>{A?($(!0),setTimeout(()=>{var g;return(g=_.current)===null||g===void 0?void 0:g.focus()})):q()}}),!E&&!i&&Me(m)&&Oe(o)&&a&&t.jsx(Le,{className:"json-view--edit",onClick:()=>z(!0)}),typeof k=="function"?t.jsx(k,{node:e}):null]});return Array.isArray(e)?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"["}),D,E?t.jsx("button",Object.assign({onClick:()=>L(!1),className:"jv-button"},{children:"..."})):t.jsx("div",Object.assign({className:"jv-indent"},{children:e.map((g,T)=>t.jsx(we,{indexOrName:T,value:g,depth:n,parent:e,deleteHandle:Q,editHandle:B,parentPath:N},String(s)+String(T)))})),t.jsx("span",{children:"]"}),E&&te(S,n,E)&&t.jsxs("span",Object.assign({onClick:()=>L(!1),className:"jv-size"},{children:[oe(e)," Items"]}))]}):A?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"{"}),D,E?t.jsx("button",Object.assign({onClick:()=>L(!1),className:"jv-button"},{children:"..."})):t.jsx("div",Object.assign({className:"jv-indent"},{children:Object.entries(e).map(([g,T])=>t.jsx(we,{indexOrName:g,value:T,depth:n,parent:e,deleteHandle:Q,editHandle:B,parentPath:N},String(s)+String(g)))})),t.jsx("span",{children:"}"}),E&&te(S,n,E)&&t.jsxs("span",Object.assign({onClick:()=>L(!1),className:"jv-size"},{children:[oe(e)," Items"]}))]}):t.jsx("span",{children:String(e)})}const cs=d.forwardRef(({str:e,className:n,ctrlClick:s},a)=>{let{collapseStringMode:o,collapseStringsAfterLength:l,customizeCollapseStringUI:r}=d.useContext(X);const[c,u]=d.useState(!0),p=d.useRef(null);l=l>0?l:0;const h=e.replace(/\s+/g," "),b=typeof r=="function"?r(h,c):typeof r=="string"?r:"...",m=x=>{var w;if((x.ctrlKey||x.metaKey)&&s)s(x);else{const v=window.getSelection();if(v&&v.anchorOffset!==v.focusOffset&&((w=v.anchorNode)===null||w===void 0?void 0:w.parentElement)===p.current)return;u(!c)}};if(e.length<=l)return t.jsxs("span",Object.assign({ref:p,className:n,onClick:s},{children:['"',e,'"']}));if(o==="address")return e.length<=10?t.jsxs("span",Object.assign({ref:p,className:n,onClick:s},{children:['"',e,'"']})):t.jsxs("span",Object.assign({ref:p,onClick:m,className:n+" cursor-pointer"},{children:['"',c?[h.slice(0,6),b,h.slice(-4)]:e,'"']}));if(o==="directly")return t.jsxs("span",Object.assign({ref:p,onClick:m,className:n+" cursor-pointer"},{children:['"',c?[h.slice(0,l),b]:e,'"']}));if(o==="word"){let x=l,w=l+1,v=h,R=1;for(;;){if(/\W/.test(e[x])){v=e.slice(0,x);break}if(/\W/.test(e[w])){v=e.slice(0,w);break}if(R===6){v=e.slice(0,l);break}R++,x--,w++}return t.jsxs("span",Object.assign({ref:p,onClick:m,className:n+" cursor-pointer"},{children:['"',c?[v,b]:e,'"']}))}return t.jsxs("span",Object.assign({ref:p,className:n},{children:['"',e,'"']}))});var ut;function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},Te.apply(this,arguments)}var ds=function(n){return M.createElement("svg",Te({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},n),ut||(ut=M.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"})))},ft,mt;function De(){return De=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},De.apply(this,arguments)}var us=function(n){return M.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},n),ft||(ft=M.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"})),mt||(mt=M.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 bt({node:e,depth:n,deleteHandle:s,indexOrName:a,parent:o,editHandle:l,parentPath:r}){const{collapseStringsAfterLength:c,enableClipboard:u,editable:p,src:h,onDelete:b,onChange:m,customizeNode:x,matchesURL:w,urlRegExp:v,EditComponent:R,DoneComponent:j,CancelComponent:y,CustomOperation:S}=d.useContext(X);let k;if(typeof x=="function"&&(k=_e(x,[{node:e,depth:n,indexOrName:a}])),k){if(d.isValidElement(k))return k;if(ts(k)){const N=k;return t.jsx(N,{node:e,depth:n,indexOrName:a})}}if(Array.isArray(e)||Z(e))return t.jsx(is,{parent:o,node:e,depth:n,indexOrName:a,deleteHandle:s,parentPath:r,customOptions:typeof k=="object"?k:void 0});{const N=typeof e,A=typeof a<"u"?[...r,String(a)]:r,[E,W]=d.useState(!1),[L,B]=d.useState(!1),Q=d.useRef(null),J=()=>{W(!0),setTimeout(()=>{var g,T;(g=window.getSelection())===null||g===void 0||g.selectAllChildren(Q.current),(T=Q.current)===null||T===void 0||T.focus()})},z=d.useCallback(()=>{let g=Q.current.innerText;try{const T=JSON.parse(g);l&&l(a,T,e,r)}catch{const V=ss(N,g);l&&l(a,V,e,r)}W(!1)},[l,a,e,r,N]),H=()=>{W(!1),B(!1)},P=()=>{B(!1),s&&s(a,r),b&&b({value:e,depth:n,src:h,indexOrName:a,parentType:Array.isArray(o)?"array":"object",parentPath:r}),m&&m({depth:n,src:h,indexOrName:a,parentType:Array.isArray(o)?"array":"object",type:"delete",parentPath:r})},$=d.useCallback(g=>{g.key==="Enter"?(g.preventDefault(),z()):g.key==="Escape"&&H()},[z]),_=E||L,q=!_&&Xe(p)&&Ke(k)&&l?g=>{(g.ctrlKey||g.metaKey)&&J()}:void 0,U=t.jsxs(t.Fragment,{children:[_&&(typeof j=="function"?t.jsx(j,{className:"json-view--edit",style:{display:"inline-block"},onClick:L?P:z}):t.jsx(Qe,{className:"json-view--edit",style:{display:"inline-block"},onClick:L?P:z})),_&&(typeof y=="function"?t.jsx(y,{className:"json-view--edit",style:{display:"inline-block"},onClick:H}):t.jsx(Je,{className:"json-view--edit",style:{display:"inline-block"},onClick:H})),!_&&u&&ue(k)&&t.jsx(fe,{node:e,nodeMeta:{depth:n,indexOrName:a,parent:o,parentPath:r,currentPath:A}}),!_&&w&&N==="string"&&v.test(e)&&ns(k)&&t.jsx("a",Object.assign({href:e,target:"_blank",className:"json-view--link"},{children:t.jsx(us,{})})),!_&&Xe(p)&&Ke(k)&&l&&(typeof R=="function"?t.jsx(R,{className:"json-view--edit",onClick:J}):t.jsx(ds,{className:"json-view--edit",onClick:J})),!_&&Me(p)&&Oe(k)&&s&&t.jsx(Le,{className:"json-view--edit",onClick:()=>B(!0)}),typeof S=="function"?t.jsx(S,{node:e}):null]});let i="json-view--string";switch(N){case"number":case"bigint":i="json-view--number";break;case"boolean":i="json-view--boolean";break;case"object":i="json-view--null";break}typeof k?.className=="string"&&(i+=" "+k.className),L&&(i+=" json-view--deleting");let C=String(e);N==="bigint"&&(C+="n");const D=d.useMemo(()=>t.jsx("span",{contentEditable:!0,className:i,dangerouslySetInnerHTML:{__html:N==="string"?`"${C}"`:C},ref:Q,onKeyDown:$}),[C,N,$]);return N==="string"?t.jsxs(t.Fragment,{children:[E?D:e.length>c?t.jsx(cs,{str:e,ref:Q,className:i,ctrlClick:q}):t.jsxs("span",Object.assign({className:i,onClick:q},{children:['"',C,'"']})),U]}):t.jsxs(t.Fragment,{children:[E?D:t.jsx("span",Object.assign({className:i,onClick:q},{children:C})),U]})}}const jt=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,X=d.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:jt,ignoreLargeArray:!1,CopyComponent:void 0,CopiedComponent:void 0,EditComponent:void 0,CancelComponent:void 0,DoneComponent:void 0,CustomOperation:void 0});function me({src:e,collapseStringsAfterLength:n=99,collapseStringMode:s="directly",customizeCollapseStringUI:a,collapseObjectsAfterLength:o=99,collapsed:l,onCollapse:r,enableClipboard:c=!0,editable:u=!1,onEdit:p,onDelete:h,onAdd:b,onChange:m,dark:x=!1,theme:w="default",customizeNode:v,customizeCopy:R=H=>Gn(H),displaySize:j,displayArrayIndex:y=!0,style:S,className:k,matchesURL:N=!1,urlRegExp:A=jt,ignoreLargeArray:E=!1,CopyComponent:W,CopiedComponent:L,EditComponent:B,CancelComponent:Q,DoneComponent:J,CustomOperation:z}){const[H,P]=d.useState(0),$=d.useCallback(()=>P(U=>++U),[]),[_,q]=d.useState(e);return d.useEffect(()=>q(e),[e]),t.jsx(X.Provider,Object.assign({value:{src:_,collapseStringsAfterLength:n,collapseStringMode:s,customizeCollapseStringUI:a,collapseObjectsAfterLength:o,collapsed:l,onCollapse:r,enableClipboard:c,editable:u,onEdit:p,onDelete:h,onAdd:b,onChange:m,forceUpdate:$,customizeNode:v,customizeCopy:R,displaySize:j,displayArrayIndex:y,matchesURL:N,urlRegExp:A,ignoreLargeArray:E,CopyComponent:W,CopiedComponent:L,EditComponent:B,CancelComponent:Q,DoneComponent:J,CustomOperation:z}},{children:t.jsx("code",Object.assign({className:"json-view"+(x?" dark":"")+(w&&w!=="default"?" json-view_"+w:"")+(k?" "+k:""),style:S},{children:t.jsx(bt,{node:_,depth:1,editHandle:(U,i,C,D)=>{q(i),p&&p({newValue:i,oldValue:C,depth:1,src:_,indexOrName:U,parentType:null,parentPath:D}),m&&m({type:"edit",depth:1,src:_,indexOrName:U,parentType:null,parentPath:D})},deleteHandle:(U,i)=>{q(void 0),h&&h({value:_,depth:1,src:_,indexOrName:U,parentType:null,parentPath:i}),m&&m({depth:1,src:_,indexOrName:U,parentType:null,type:"delete",parentPath:i})},parentPath:[]})}))}))}const he=()=>{const{jobs:e,selectedQueue:n,selectedStatus:s,setJobs:a,setLoading:o,setError:l,isLoading:r,error:c}=O(),u=d.useCallback(async(j,y,S=0,k=100)=>{o(!0),l(null);try{const N=new URLSearchParams({status:y,start:String(S),end:String(k)}),A=await fetch(`/__motia/bullmq/queues/${encodeURIComponent(j)}/jobs?${N}`);if(!A.ok)throw new Error("Failed to fetch jobs");const E=await A.json();a(E.jobs)}catch(N){l(N instanceof Error?N.message:"Unknown error")}finally{o(!1)}},[a,o,l]),p=d.useCallback(async(j,y)=>{try{const S=await fetch(`/__motia/bullmq/queues/${encodeURIComponent(j)}/jobs/${encodeURIComponent(y)}`);return S.ok?await S.json():null}catch{return null}},[]),h=d.useCallback(async(j,y)=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(j)}/jobs/${encodeURIComponent(y)}/retry`,{method:"POST"}),n&&await u(n.name,s)}catch(S){l(S instanceof Error?S.message:"Failed to retry job")}},[n,s,u,l]),b=d.useCallback(async(j,y)=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(j)}/jobs/${encodeURIComponent(y)}/remove`,{method:"POST"}),n&&await u(n.name,s)}catch(S){l(S instanceof Error?S.message:"Failed to remove job")}},[n,s,u,l]),m=d.useCallback(async(j,y)=>{try{await fetch(`/__motia/bullmq/queues/${encodeURIComponent(j)}/jobs/${encodeURIComponent(y)}/promote`,{method:"POST"}),n&&await u(n.name,s)}catch(S){l(S instanceof Error?S.message:"Failed to promote job")}},[n,s,u,l]),x=d.useCallback(async(j,y=0,S=100)=>{try{const k=new URLSearchParams({start:String(y),end:String(S)}),N=await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(j)}/jobs?${k}`);return N.ok?(await N.json()).jobs:[]}catch{return[]}},[]),w=d.useCallback(async(j,y)=>{try{await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(j)}/retry/${encodeURIComponent(y)}`,{method:"POST"})}catch(S){l(S instanceof Error?S.message:"Failed to retry from DLQ")}},[l]),v=d.useCallback(async j=>{try{await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(j)}/retry-all`,{method:"POST"})}catch(y){l(y instanceof Error?y.message:"Failed to retry all from DLQ")}},[l]),R=d.useCallback(async j=>{try{await fetch(`/__motia/bullmq/dlq/${encodeURIComponent(j)}/clear`,{method:"POST"})}catch(y){l(y instanceof Error?y.message:"Failed to clear DLQ")}},[l]);return d.useEffect(()=>{n&&u(n.name,s)},[n,s,u]),{jobs:e,isLoading:r,error:c,fetchJobs:u,getJob:p,retryJob:h,removeJob:b,promoteJob:m,getDLQJobs:x,retryFromDLQ:w,retryAllFromDLQ:v,clearDLQ:R}},vt=d.memo(({job:e,onRetry:n})=>t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"flex gap-2",children:t.jsxs(f.Button,{variant:"outline",size:"sm",onClick:n,children:[t.jsx(K,{className:"mr-2 h-4 w-4"}),"Retry"]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Job ID"}),t.jsx("div",{className:"font-mono text-xs",children:e.id})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Original Job ID"}),t.jsx("div",{className:"font-mono text-xs",children:e.originalJobId||"-"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Attempts Made"}),t.jsx("div",{className:"font-semibold",children:e.attemptsMade})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Failed At"}),t.jsx("div",{children:de(e.failureTimestamp,{addSuffix:!0})})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-semibold text-destructive mb-2",children:"Failure Reason"}),t.jsx("div",{className:"font-mono text-sm bg-destructive/10 p-3 rounded text-destructive",children:e.failureReason})]})]}));vt.displayName="DLQJobDetailContent";const yt=d.memo(({data:e})=>t.jsx("div",{className:"bg-muted/30 p-4 rounded overflow-auto max-h-[400px]",children:t.jsx(me,{src:e,theme:"atom",collapsed:2})}));yt.displayName="DLQJobDataTab";const wt=d.memo(()=>{const e=O(y=>y.selectedQueue),{getDLQJobs:n,retryFromDLQ:s,retryAllFromDLQ:a,clearDLQ:o}=he(),{fetchQueues:l}=Ae(),[r,c]=d.useState([]),[u,p]=d.useState(!1),[h,b]=d.useState(null),m=d.useCallback(async()=>{if(e?.isDLQ){p(!0);try{const y=await n(e.name);c(y)}finally{p(!1)}}},[e,n]);d.useEffect(()=>{e?.isDLQ&&m()},[e,m]);const x=d.useCallback(async y=>{e&&(await s(e.name,y),await m(),await l())},[e,s,m,l]),w=d.useCallback(async()=>{e&&(await a(e.name),await m(),await l())},[e,a,m,l]),v=d.useCallback(async()=>{e&&(await o(e.name),await m(),await l())},[e,o,m,l]),R=d.useCallback(()=>{b(null)},[]),j=d.useCallback(()=>{h&&(x(h.id),b(null))},[h,x]);return e?.isDLQ?t.jsx(f.TooltipProvider,{children:t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"font-semibold text-lg",children:e.displayName}),t.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.length," failed job",r.length!==1?"s":""," in dead letter queue"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(f.Tooltip,{children:[t.jsx(f.TooltipTrigger,{asChild:!0,children:t.jsx(f.Button,{variant:"ghost",size:"icon",onClick:m,disabled:u,children:t.jsx(K,{className:`h-4 w-4 ${u?"animate-spin":""}`})})}),t.jsx(f.TooltipContent,{children:t.jsx("p",{children:"Refresh DLQ jobs list"})})]}),t.jsxs(f.Tooltip,{children:[t.jsx(f.TooltipTrigger,{asChild:!0,children:t.jsxs(f.Button,{variant:"outline",size:"sm",onClick:w,disabled:r.length===0,children:[t.jsx(K,{className:"mr-2 h-4 w-4"}),"Retry All"]})}),t.jsx(f.TooltipContent,{children:t.jsx("p",{children:"Re-queue all failed jobs to the original queue"})})]}),t.jsxs(f.Tooltip,{children:[t.jsx(f.TooltipTrigger,{asChild:!0,children:t.jsxs(f.Button,{variant:"outline",size:"sm",onClick:v,disabled:r.length===0,className:"text-destructive",children:[t.jsx(ee,{className:"mr-2 h-4 w-4"}),"Clear All"]})}),t.jsx(f.TooltipContent,{children:t.jsx("p",{children:"Permanently delete all jobs from DLQ"})})]})]})]}),r.length===0?t.jsx("div",{className:"flex items-center justify-center flex-1 text-muted-foreground",children:"No jobs in dead letter queue"}):t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs(f.Table,{children:[t.jsx(f.TableHeader,{className:"sticky top-0 bg-background/95 backdrop-blur-sm",children:t.jsxs(f.TableRow,{children:[t.jsx(f.TableHead,{className:"w-[180px]",children:"Job ID"}),t.jsx(f.TableHead,{className:"w-[180px]",children:"Original Job"}),t.jsx(f.TableHead,{children:"Failure Reason"}),t.jsx(f.TableHead,{className:"w-[100px]",children:"Attempts"}),t.jsx(f.TableHead,{className:"w-[150px]",children:"Failed At"}),t.jsx(f.TableHead,{className:"w-[100px]",children:"Actions"})]})}),t.jsx(f.TableBody,{children:r.map(y=>t.jsxs(f.TableRow,{className:"cursor-pointer hover:bg-muted-foreground/10",onClick:()=>b(y),children:[t.jsx(f.TableCell,{className:"font-mono text-xs",children:y.id}),t.jsx(f.TableCell,{className:"font-mono text-xs text-muted-foreground",children:y.originalJobId||"-"}),t.jsx(f.TableCell,{className:"text-destructive text-sm truncate max-w-[300px]",children:y.failureReason}),t.jsx(f.TableCell,{children:y.attemptsMade}),t.jsx(f.TableCell,{className:"text-xs text-muted-foreground",children:de(y.failureTimestamp,{addSuffix:!0})}),t.jsx(f.TableCell,{onClick:S=>S.stopPropagation(),children:t.jsxs(f.Tooltip,{children:[t.jsx(f.TooltipTrigger,{asChild:!0,children:t.jsx(f.Button,{variant:"ghost",size:"sm",onClick:()=>x(y.id),children:t.jsx(K,{className:"h-4 w-4"})})}),t.jsx(f.TooltipContent,{children:t.jsx("p",{children:"Retry this job"})})]})})]},y.id))})]})}),h&&t.jsx(f.Sidebar,{onClose:R,title:"Dead Letter Job",initialWidth:600,tabs:[{label:"Details",content:t.jsx(vt,{job:h,onRetry:j})},{label:"Event Data",content:t.jsx(yt,{data:h.originalEvent})}],actions:[{icon:t.jsx(Re,{}),onClick:R,label:"Close"}]})]})}):null});wt.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 fs=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Ct=Y("arrow-up-right",fs),Nt=d.memo(({data:e})=>t.jsx("div",{className:"bg-muted/30 p-4 rounded",children:t.jsx(me,{src:e,theme:"atom",collapsed:2})}));Nt.displayName="JobDataTab";const kt=d.memo(({opts:e})=>t.jsx("div",{className:"bg-muted/30 p-4 rounded",children:t.jsx(me,{src:e,theme:"atom",collapsed:2})}));kt.displayName="JobOptionsTab";const St=d.memo(({returnvalue:e})=>t.jsx("div",{className:"bg-muted/30 p-4 rounded",children:t.jsx(me,{src:e,theme:"atom",collapsed:2})}));St.displayName="JobResultTab";const Tt=d.memo(({failedReason:e,stacktrace:n})=>t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-semibold text-destructive mb-1",children:"Error Message"}),t.jsx("div",{className:"font-mono text-sm bg-destructive/10 p-3 rounded text-destructive",children:e})]}),n&&n.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:"Stack Trace"}),t.jsx("pre",{className:"font-mono text-xs bg-muted p-3 rounded overflow-auto max-h-[300px]",children:n.join(`
63
+ `)})]})]}));Tt.displayName="JobErrorTab";const Dt=d.memo(()=>{const e=O(j=>j.selectedJob),n=O(j=>j.selectedQueue),s=O(j=>j.jobDetailOpen),a=O(j=>j.setJobDetailOpen),o=O(j=>j.setSelectedJob),{retryJob:l,removeJob:r,promoteJob:c}=he(),u=d.useCallback(()=>{a(!1),o(null)},[a,o]),p=d.useCallback(async()=>{!n||!e||(await l(n.name,e.id),u())},[n,e,l,u]),h=d.useCallback(async()=>{!n||!e||(await r(n.name,e.id),u())},[n,e,r,u]),b=d.useCallback(async()=>{!n||!e||(await c(n.name,e.id),u())},[n,e,c,u]);if(!s||!e||!n)return null;const m=!!e.failedReason,x=e.delay&&e.delay>0,w=e.returnvalue!==void 0&&e.returnvalue!==null,v=[{label:"Data",content:t.jsx(Nt,{data:e.data})},{label:"Options",content:t.jsx(kt,{opts:e.opts})},...w?[{label:"Result",content:t.jsx(St,{returnvalue:e.returnvalue})}]:[],...m?[{label:"Error",content:t.jsx(Tt,{failedReason:e.failedReason,stacktrace:e.stacktrace})}]:[]],R=m?t.jsx("span",{className:"text-destructive",children:"Failed"}):e.finishedOn?t.jsx("span",{className:"text-green-500",children:"Completed"}):e.processedOn?t.jsx("span",{className:"text-yellow-500",children:"Processing"}):x?t.jsx("span",{className:"text-purple-500",children:"Delayed"}):t.jsx("span",{className:"text-blue-500",children:"Waiting"});return t.jsx(f.Sidebar,{onClose:u,title:e.name,initialWidth:600,tabs:v,actions:[{icon:t.jsx(Re,{}),onClick:u,label:"Close"}],children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-2",children:[m&&t.jsxs(f.Button,{variant:"outline",size:"sm",onClick:p,children:[t.jsx(K,{className:"mr-2 h-4 w-4"}),"Retry"]}),x&&t.jsxs(f.Button,{variant:"outline",size:"sm",onClick:b,children:[t.jsx(Ct,{className:"mr-2 h-4 w-4"}),"Promote"]}),t.jsxs(f.Button,{variant:"outline",size:"sm",onClick:h,className:"text-destructive",children:[t.jsx(ee,{className:"mr-2 h-4 w-4"}),"Remove"]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Job ID"}),t.jsx("div",{className:"font-mono text-xs",children:e.id})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Status"}),t.jsx("div",{className:"font-semibold",children:R})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Created"}),t.jsx("div",{children:de(e.timestamp,{addSuffix:!0})})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Attempts"}),t.jsx("div",{className:"font-semibold",children:e.attemptsMade})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Progress"}),t.jsx("div",{className:"font-semibold",children:typeof e.progress=="number"?`${e.progress}%`:"-"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:"Delay"}),t.jsx("div",{className:"font-semibold",children:e.delay?`${e.delay}ms`:"-"})]})]})]})})});Dt.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 ms=[["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"}]],Et=Y("ellipsis-vertical",ms);/**
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 hs=[["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"}]],At=Y("pause",hs);/**
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 ps=[["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"}]],xs=Y("play",ps),Rt=d.memo(({job:e,queueName:n,onSelect:s,isSelected:a})=>{const{retryJob:o,removeJob:l,promoteJob:r}=he(),c=d.useCallback(h=>{h.stopPropagation(),o(n,e.id)},[n,e.id,o]),u=d.useCallback(h=>{h.stopPropagation(),l(n,e.id)},[n,e.id,l]),p=d.useCallback(h=>{h.stopPropagation(),r(n,e.id)},[n,e.id,r]);return t.jsxs(f.TableRow,{onClick:s,className:f.cn("cursor-pointer border-0",a?"bg-muted-foreground/10 hover:bg-muted-foreground/20":"hover:bg-muted-foreground/10"),children:[t.jsx(f.TableCell,{className:"font-mono text-xs",children:e.id}),t.jsx(f.TableCell,{className:"font-medium",children:e.name}),t.jsx(f.TableCell,{className:"text-xs text-muted-foreground",children:de(e.timestamp,{addSuffix:!0})}),t.jsx(f.TableCell,{children:t.jsx("span",{className:"text-xs",children:e.attemptsMade})}),t.jsx(f.TableCell,{children:typeof e.progress=="number"?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-16 h-1.5 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.min(100,e.progress)}%`}})}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.progress,"%"]})]}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}),t.jsx(f.TableCell,{onClick:h=>h.stopPropagation(),children:t.jsxs(f.DropdownMenu,{children:[t.jsx(f.DropdownMenuTrigger,{asChild:!0,children:t.jsx(f.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",children:t.jsx(Et,{className:"h-4 w-4"})})}),t.jsxs(f.DropdownMenuContent,{align:"end",children:[e.failedReason&&t.jsxs(f.DropdownMenuItem,{onClick:c,children:[t.jsx(K,{className:"mr-2 h-4 w-4"}),"Retry"]}),e.delay&&e.delay>0&&t.jsxs(f.DropdownMenuItem,{onClick:p,children:[t.jsx(Ct,{className:"mr-2 h-4 w-4"}),"Promote"]}),t.jsxs(f.DropdownMenuItem,{onClick:u,className:"text-destructive",children:[t.jsx(ee,{className:"mr-2 h-4 w-4"}),"Remove"]})]})]})})]})});Rt.displayName="JobRow";const _t=d.memo(()=>{const e=O(r=>r.jobs),n=O(r=>r.selectedQueue),s=O(r=>r.selectedJob),a=O(r=>r.setSelectedJob),o=O(r=>r.setJobDetailOpen),l=d.useCallback(r=>{a(r),o(!0)},[a,o]);return n?e.length===0?t.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No jobs in this status"}):t.jsxs(f.Table,{children:[t.jsx(f.TableHeader,{className:"sticky top-0 bg-background/95 backdrop-blur-sm",children:t.jsxs(f.TableRow,{children:[t.jsx(f.TableHead,{className:"w-[200px]",children:"Job ID"}),t.jsx(f.TableHead,{children:"Name"}),t.jsx(f.TableHead,{className:"w-[150px]",children:"Created"}),t.jsx(f.TableHead,{className:"w-[80px]",children:"Attempts"}),t.jsx(f.TableHead,{className:"w-[140px]",children:"Progress"}),t.jsx(f.TableHead,{className:"w-[60px]",children:"Actions"})]})}),t.jsx(f.TableBody,{children:e.map(r=>t.jsx(Rt,{job:r,queueName:n.name,onSelect:()=>l(r),isSelected:s?.id===r.id},r.id))})]}):t.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"Select a queue to view jobs"})});_t.displayName="JobsTable";const gs=[{value:"waiting",label:"Waiting"},{value:"active",label:"Active"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"delayed",label:"Delayed"}],Mt=d.memo(()=>{const e=O(v=>v.selectedQueue),n=O(v=>v.selectedStatus),s=O(v=>v.setSelectedStatus),{pauseQueue:a,resumeQueue:o,cleanQueue:l,drainQueue:r,fetchQueues:c}=Ae(),{fetchJobs:u}=he(),p=d.useCallback(async()=>{e&&await a(e.name)},[e,a]),h=d.useCallback(async()=>{e&&await o(e.name)},[e,o]),b=d.useCallback(async()=>{e&&await l(e.name,"completed",0,1e3)},[e,l]),m=d.useCallback(async()=>{e&&await l(e.name,"failed",0,1e3)},[e,l]),x=d.useCallback(async()=>{e&&await r(e.name)},[e,r]),w=d.useCallback(async()=>{e&&(await c(),await u(e.name,n))},[e,n,c,u]);return e?t.jsx(f.TooltipProvider,{children:t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("h2",{className:"font-semibold text-lg",children:e.displayName}),e.isPaused&&t.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-yellow-500/20 text-yellow-600",children:"Paused"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(f.Tooltip,{children:[t.jsx(f.TooltipTrigger,{asChild:!0,children:t.jsx(f.Button,{variant:"ghost",size:"icon",onClick:w,children:t.jsx(K,{className:"h-4 w-4"})})}),t.jsx(f.TooltipContent,{children:t.jsx("p",{children:"Refresh queue stats and jobs list"})})]}),e.isPaused?t.jsxs(f.Tooltip,{children:[t.jsx(f.TooltipTrigger,{asChild:!0,children:t.jsxs(f.Button,{variant:"ghost",size:"sm",onClick:h,children:[t.jsx(xs,{className:"mr-2 h-4 w-4"}),"Resume"]})}),t.jsx(f.TooltipContent,{children:t.jsx("p",{children:"Resume processing jobs in this queue"})})]}):t.jsxs(f.Tooltip,{children:[t.jsx(f.TooltipTrigger,{asChild:!0,children:t.jsxs(f.Button,{variant:"ghost",size:"sm",onClick:p,children:[t.jsx(At,{className:"mr-2 h-4 w-4"}),"Pause"]})}),t.jsx(f.TooltipContent,{children:t.jsx("p",{children:"Stop workers from picking up new jobs"})})]}),t.jsxs(f.Tooltip,{children:[t.jsx(f.TooltipTrigger,{asChild:!0,children:t.jsxs(f.DropdownMenu,{children:[t.jsx(f.DropdownMenuTrigger,{asChild:!0,children:t.jsx(f.Button,{variant:"ghost",size:"icon",children:t.jsx(Et,{className:"h-4 w-4"})})}),t.jsxs(f.DropdownMenuContent,{align:"end",children:[t.jsxs(f.DropdownMenuItem,{onClick:b,children:[t.jsx(ee,{className:"mr-2 h-4 w-4"}),"Clean Completed"]}),t.jsxs(f.DropdownMenuItem,{onClick:m,children:[t.jsx(ee,{className:"mr-2 h-4 w-4"}),"Clean Failed"]}),t.jsx(f.DropdownMenuSeparator,{}),t.jsxs(f.DropdownMenuItem,{onClick:x,className:"text-destructive",children:[t.jsx(ee,{className:"mr-2 h-4 w-4"}),"Drain Queue"]})]})]})}),t.jsx(f.TooltipContent,{children:t.jsx("p",{children:"More actions"})})]})]})]}),t.jsx("div",{className:"p-3 border-b border-border",children:t.jsxs("div",{className:"grid grid-cols-6 gap-4 text-center",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-2xl font-bold text-blue-500",children:e.stats.waiting}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Waiting"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-2xl font-bold text-yellow-500",children:e.stats.active}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Active"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-2xl font-bold text-green-500",children:e.stats.completed}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Completed"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-2xl font-bold text-destructive",children:e.stats.failed}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Failed"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-2xl font-bold text-purple-500",children:e.stats.delayed}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Delayed"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:e.stats.paused}),t.jsx("div",{className:"text-xs text-muted-foreground",children:"Paused"})]})]})}),t.jsxs(f.Tabs,{value:n,onValueChange:v=>s(v),className:"flex-1 flex flex-col",children:[t.jsx("div",{className:"px-3 pt-2 border-b border-border",children:t.jsx(f.TabsList,{children:gs.map(v=>t.jsxs(f.TabsTrigger,{value:v.value,className:f.cn("relative",n===v.value&&"after:absolute after:bottom-0 after:left-0 after:right-0 after:h-0.5 after:bg-primary"),children:[v.label,e.stats[v.value]>0&&t.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 text-[10px] rounded-full bg-muted",children:e.stats[v.value]})]},v.value))})}),t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(_t,{})})]})]})}):t.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"Select a queue from the list to view details"})});Mt.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 bs=[["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"}]],js=Y("triangle-alert",bs);/**
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 vs=[["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"}]],ys=Y("layers",vs);/**
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 ws=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Cs=Y("search",ws);/**
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 Ns=[["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"}]],ks=Y("skull",Ns),Ee=d.memo(({queue:e,isSelected:n,onClick:s})=>{const a=e.stats.waiting+e.stats.active+e.stats.delayed+e.stats.prioritized,o=e.stats.failed>0;return t.jsxs("button",{type:"button",onClick:s,className:f.cn("w-full text-left p-3 transition-colors border-b border-border",n?"bg-muted-foreground/10":"hover:bg-muted/70"),children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.isDLQ?t.jsx(ks,{className:"w-4 h-4 text-destructive"}):t.jsx(ys,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"font-semibold text-sm truncate flex-1",children:e.displayName}),e.isPaused&&t.jsx(At,{className:"w-3 h-3 text-yellow-500"}),o&&t.jsx(js,{className:"w-3 h-3 text-destructive"})]}),t.jsxs("div",{className:"grid grid-cols-4 gap-1 text-xs",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-muted-foreground",children:"Wait"}),t.jsx("span",{className:f.cn("font-mono",e.stats.waiting>0&&"text-blue-500"),children:e.stats.waiting})]}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-muted-foreground",children:"Active"}),t.jsx("span",{className:f.cn("font-mono",e.stats.active>0&&"text-yellow-500"),children:e.stats.active})]}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-muted-foreground",children:"Done"}),t.jsx("span",{className:f.cn("font-mono",e.stats.completed>0&&"text-green-500"),children:e.stats.completed})]}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-muted-foreground",children:"Failed"}),t.jsx("span",{className:f.cn("font-mono",e.stats.failed>0&&"text-destructive"),children:e.stats.failed})]})]}),(e.stats.delayed>0||a>0)&&t.jsxs("div",{className:"flex gap-2 mt-1 text-xs text-muted-foreground",children:[e.stats.delayed>0&&t.jsxs("span",{children:[e.stats.delayed," delayed"]}),a>0&&t.jsxs("span",{className:"ml-auto",children:[a," pending"]})]})]})});Ee.displayName="QueueItem";const Ot=d.memo(()=>{const e=O(u=>u.queues),n=O(u=>u.selectedQueue),s=O(u=>u.setSelectedQueue),a=O(u=>u.searchQuery),o=O(u=>u.setSearchQuery),l=d.useMemo(()=>{if(!a)return e;const u=a.toLowerCase();return e.filter(p=>p.name.toLowerCase().includes(u)||p.displayName.toLowerCase().includes(u))},[e,a]),r=d.useMemo(()=>l.filter(u=>!u.isDLQ),[l]),c=d.useMemo(()=>l.filter(u=>u.isDLQ),[l]);return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("div",{className:"p-2 border-b border-border",children:t.jsxs("div",{className:"relative",children:[t.jsx(f.Input,{variant:"shade",value:a,onChange:u=>o(u.target.value),className:"px-9 font-medium text-sm",placeholder:"Search queues..."}),t.jsx(Cs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50"}),a&&t.jsx(Re,{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:()=>o("")})]})}),t.jsxs("div",{className:"flex-1 overflow-auto",children:[r.length>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider bg-muted/30",children:["Queues (",r.length,")"]}),r.map(u=>t.jsx(Ee,{queue:u,isSelected:n?.name===u.name,onClick:()=>s(u)},u.name))]}),c.length>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"px-3 py-2 text-xs font-semibold text-muted-foreground uppercase tracking-wider bg-destructive/10",children:["Dead Letter Queues (",c.length,")"]}),c.map(u=>t.jsx(Ee,{queue:u,isSelected:n?.name===u.name,onClick:()=>s(u)},u.name))]}),l.length===0&&t.jsx("div",{className:"p-4 text-center text-muted-foreground text-sm",children:a?"No queues match your search":"No queues found"})]})]})});Ot.displayName="QueueList";const Pt=d.memo(()=>{const e=O(a=>a.selectedQueue),n=O(a=>a.updateSelectedQueueStats),{queues:s}=Ae();return d.useEffect(()=>{if(e){const a=s.find(o=>o.name===e.name);a&&n(a)}},[s,e,n]),t.jsxs("div",{className:"grid grid-cols-[300px_1fr] h-full overflow-hidden",children:[t.jsx("div",{className:"border-r border-border overflow-hidden",children:t.jsx(Ot,{})}),t.jsx("div",{className:"overflow-hidden",children:e?.isDLQ?t.jsx(wt,{}):t.jsx(Mt,{})}),t.jsx(Dt,{})]})});Pt.displayName="QueuesPage";exports.QueuesPage=Pt;
@@ -0,0 +1,3 @@
1
+ export { QueuesPage } from './components/queues-page';
2
+ export type { BullMQPluginConfig, CleanOptions, DLQJobInfo, JobInfo, JobProgress, JobStatus, QueueInfo, QueueStats, } from './types/queue';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAErB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,OAAO,EACP,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAA"}