bunqueue-dashboard 0.0.24 → 0.0.26

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.
Files changed (74) hide show
  1. package/dist/.vite/manifest.json +77 -75
  2. package/dist/assets/AddJob-B6DB3nLS.js +3 -0
  3. package/dist/assets/Alerts-CWgn7JKK.js +1 -0
  4. package/dist/assets/AreaChart-Dl_9G6GH.js +1 -0
  5. package/dist/assets/Benchmark-C6eJlf21.js +1 -0
  6. package/dist/assets/BulkAddJobs-D5A-56qh.js +5 -0
  7. package/dist/assets/{CopilotPanel-05UREVXq.js → CopilotPanel-C4u8nJMr.js} +2 -2
  8. package/dist/assets/{CopyButton-BjMe8rqo.js → CopyButton-B2gM7BeT.js} +1 -1
  9. package/dist/assets/{Cron-BVu2xGBX.js → Cron-D8Cl1VQg.js} +1 -1
  10. package/dist/assets/CronManager-DkpnKkUk.js +1 -0
  11. package/dist/assets/Database-BmdixnFB.js +3 -0
  12. package/dist/assets/{Diagnostics-DbncxLB8.js → Diagnostics-DNCcEQZe.js} +1 -1
  13. package/dist/assets/Dlq-ChFKsJwc.js +1 -0
  14. package/dist/assets/DlqControl-C0RX-JRF.js +1 -0
  15. package/dist/assets/DlqPro-CkDrvA_m.js +1 -0
  16. package/dist/assets/Flows-tVpaOy-A.js +1 -0
  17. package/dist/assets/JobInspector-B6RmHnFF.js +2 -0
  18. package/dist/assets/Jobs-CBoU-CeR.js +1 -0
  19. package/dist/assets/JobsPro-WiZ3UHGN.js +1 -0
  20. package/dist/assets/{Logs-BXITESJ-.js → Logs-BWq4h_tj.js} +1 -1
  21. package/dist/assets/LogsPro-Bf9Ihrkj.js +1 -0
  22. package/dist/assets/{McpServer-DaYWa4Es.js → McpServer-DZD7-dyS.js} +2 -2
  23. package/dist/assets/{Metrics-BMGLcgiU.js → Metrics-Cu1CHLHF.js} +1 -1
  24. package/dist/assets/MetricsPro-Bs-Rwic_.js +1 -0
  25. package/dist/assets/{Overview-Bex4G7ch.js → Overview-BSqH2VRL.js} +1 -1
  26. package/dist/assets/{Pagination-CTSsxJT4.js → Pagination-C-6yLcP3.js} +1 -1
  27. package/dist/assets/QueueActions-Dhy0KXjr.js +1 -0
  28. package/dist/assets/QueueControl-2x3FDkR9.js +1 -0
  29. package/dist/assets/{QueueDetail-ZRFUt3mH.js → QueueDetail-Nfc8Zu5b.js} +1 -1
  30. package/dist/assets/QueueDetailPro-CnuNbKyk.js +1 -0
  31. package/dist/assets/{Queues-DkPMFOIm.js → Queues-JsB6NujG.js} +1 -1
  32. package/dist/assets/QueuesOverview-BB8UL0nT.js +1 -0
  33. package/dist/assets/{S3Backup-DDpYyr9K.js → S3Backup-CLizitSQ.js} +1 -1
  34. package/dist/assets/S3BackupPro-CoSFg6KF.js +1 -0
  35. package/dist/assets/ServerControl-DcP14j8m.js +3 -0
  36. package/dist/assets/Settings-Czzagq5p.js +1 -0
  37. package/dist/assets/{Usage-C50S2SA2.js → Usage-DGv7A2XQ.js} +1 -1
  38. package/dist/assets/{UsagePro-VGYI-JGk.js → UsagePro-Cre49W5i.js} +1 -1
  39. package/dist/assets/Webhooks-C0ByRD8k.js +1 -0
  40. package/dist/assets/{Workers-RzwwzTJK.js → Workers-BB9o9IJ6.js} +1 -1
  41. package/dist/assets/WorkersPro-DgjEEM9Y.js +1 -0
  42. package/dist/assets/index-BovL_it0.css +1 -0
  43. package/dist/assets/index-Dlr2PaZ6.js +8 -0
  44. package/dist/assets/{useThroughputSeries-PGVgpwVj.js → useThroughputSeries-lWDIzQ4F.js} +1 -1
  45. package/dist/index.html +2 -2
  46. package/package.json +1 -1
  47. package/scripts/embedded.gen.ts +102 -102
  48. package/dist/assets/AddJob-C-p_fUxU.js +0 -3
  49. package/dist/assets/Alerts-DHUQoHrO.js +0 -1
  50. package/dist/assets/AreaChart-lY-mk5E1.js +0 -1
  51. package/dist/assets/Benchmark-9UTONKIr.js +0 -1
  52. package/dist/assets/BulkAddJobs-DOlzFFNp.js +0 -5
  53. package/dist/assets/CronManager-pAbkEMqi.js +0 -1
  54. package/dist/assets/Database-Q_X_NR2I.js +0 -3
  55. package/dist/assets/Dlq-Dht-XE8I.js +0 -1
  56. package/dist/assets/DlqControl-BdW51Eje.js +0 -1
  57. package/dist/assets/DlqPro-Bc5dBrfL.js +0 -1
  58. package/dist/assets/Flows-BgUrkVp9.js +0 -1
  59. package/dist/assets/JobInspector-cr-oB9MB.js +0 -2
  60. package/dist/assets/Jobs-HgcrHTuA.js +0 -1
  61. package/dist/assets/JobsPro-CHgECoqr.js +0 -1
  62. package/dist/assets/LogsPro-D0trm52t.js +0 -1
  63. package/dist/assets/MetricsPro-4SzRtKMO.js +0 -1
  64. package/dist/assets/QueueActions--MLQejui.js +0 -1
  65. package/dist/assets/QueueControl-D62X3ifm.js +0 -1
  66. package/dist/assets/QueueDetailPro-DY_XL6iK.js +0 -1
  67. package/dist/assets/QueuesOverview-BJaVSLW9.js +0 -1
  68. package/dist/assets/S3BackupPro-DD7fYduD.js +0 -1
  69. package/dist/assets/ServerControl-BzpGcDMa.js +0 -3
  70. package/dist/assets/Settings-BhNwQcDj.js +0 -1
  71. package/dist/assets/Webhooks-WT9fT_UK.js +0 -1
  72. package/dist/assets/WorkersPro-C-Rl2JGa.js +0 -1
  73. package/dist/assets/index-C2XEM9ex.css +0 -1
  74. package/dist/assets/index-DtMgfAiz.js +0 -8
@@ -0,0 +1,8 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CopilotPanel-C4u8nJMr.js","assets/cn-CMFYpumL.js","assets/react-vendor-B68RYDeC.js","assets/form-C-zZyKfB.js","assets/AddJob-B6DB3nLS.js","assets/Benchmark-C6eJlf21.js","assets/connectionStore-B-hNUqwK.js","assets/AreaChart-Dl_9G6GH.js","assets/CopyButton-B2gM7BeT.js","assets/BulkAddJobs-D5A-56qh.js","assets/CronManager-DkpnKkUk.js","assets/Pagination-C-6yLcP3.js","assets/Database-BmdixnFB.js","assets/Diagnostics-DNCcEQZe.js","assets/DlqControl-C0RX-JRF.js","assets/exportFile-tdUeW5m5.js","assets/DlqPro-CkDrvA_m.js","assets/promisePool-Daxkc1OB.js","assets/Flows-tVpaOy-A.js","assets/JobInspector-B6RmHnFF.js","assets/jobActions-CuOdMglt.js","assets/JobsPro-WiZ3UHGN.js","assets/LogsPro-Bf9Ihrkj.js","assets/McpServer-DZD7-dyS.js","assets/MetricsPro-Bs-Rwic_.js","assets/useThroughputSeries-lWDIzQ4F.js","assets/QueueControl-2x3FDkR9.js","assets/QueueActions-Dhy0KXjr.js","assets/QueueDetailPro-CnuNbKyk.js","assets/QueuesOverview-BB8UL0nT.js","assets/S3BackupPro-CoSFg6KF.js","assets/ServerControl-DcP14j8m.js","assets/UsagePro-Cre49W5i.js","assets/Webhooks-C0ByRD8k.js","assets/WorkersPro-DgjEEM9Y.js","assets/Alerts-CWgn7JKK.js","assets/Cron-D8Cl1VQg.js","assets/Dlq-ChFKsJwc.js","assets/Jobs-CBoU-CeR.js","assets/Logs-BWq4h_tj.js","assets/Metrics-Cu1CHLHF.js","assets/Overview-BSqH2VRL.js","assets/QueueDetail-Nfc8Zu5b.js","assets/Queues-JsB6NujG.js","assets/S3Backup-CLizitSQ.js","assets/Settings-Czzagq5p.js","assets/Usage-DGv7A2XQ.js","assets/Workers-BB9o9IJ6.js"])))=>i.map(i=>d[i]);
2
+ import{r as e,t}from"./cn-CMFYpumL.js";import{a as n,c as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./react-vendor-B68RYDeC.js";import{a as h,i as g,n as _,o as v,r as y,t as ee}from"./connectionStore-B-hNUqwK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var b=e(i(),1),x=s(),te=()=>`${Date.now().toString(36)}${Math.floor(Math.random()*1e6).toString(36)}`;function ne(e){return{channels:e.channels.map(e=>e.type===`email`?e:{...e,target:``}),rules:e.rules}}var S=v()(h(e=>({channels:[],rules:[],addChannel:(t,n)=>e(e=>({channels:[...e.channels,{id:te(),type:t,target:n}]})),removeChannel:t=>e(e=>({channels:e.channels.filter(e=>e.id!==t)})),addRule:t=>e(e=>({rules:[...e.rules,{...t,id:te()}]})),removeRule:t=>e(e=>({rules:e.rules.filter(e=>e.id!==t)})),toggleRule:t=>e(e=>({rules:e.rules.map(e=>e.id===t?{...e,enabled:!e.enabled}:e)}))}),{name:`bq-dash-alerts`,partialize:ne})),re={error_rate:`error rate`,p99_latency:`p99 latency`,waiting:`waiting jobs`,failed:`failed jobs`,dlq:`DLQ size`},ie=1,C=v(e=>({toasts:[],push:({level:t,title:n,detail:r,ttlMs:i})=>{let a=ie++,o=i??(t===`error`?8e3:4e3);return e(e=>({toasts:[...e.toasts,{id:a,level:t,title:n,detail:r,ttlMs:o}].slice(-5)})),a},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))})),ae={success:(e,t)=>C.getState().push({level:`success`,title:e,detail:t}),error:(e,t)=>C.getState().push({level:`error`,title:e,detail:t}),info:(e,t)=>C.getState().push({level:`info`,title:e,detail:t})},w=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`BqError`}};async function oe(e,t,n,r,i=!0,a=`server`){let o=await fetch(e+t,{...r,headers:{"Content-Type":`application/json`,...n,...r?.headers}});if(!o.ok){let e=`HTTP ${o.status}`;try{let t=await o.json();t?.error&&(e=t.error)}catch{}throw o.status===401&&typeof window<`u`&&window.dispatchEvent(new CustomEvent(`auth:required`,{detail:{scope:a}})),new w(e,o.status)}if(o.status===204)return;let s=await o.text();if(!s)return;let c;try{c=JSON.parse(s)}catch{throw new w(`Invalid JSON response (HTTP ${o.status})`,o.status)}if(i&&c&&typeof c==`object`&&c.ok===!1){let e=c.error;throw new w(e??`Operation failed`,o.status)}return c}var T=(e,t,n=!0)=>oe(y(),e,_(),t,n),se=(globalThis.__BUNQUEUE_AGENT_URL__||`http://localhost:6800`).replace(/\/$/,``),E=(e,t)=>oe(se,e,ee(),t,!0,`agent`),D=e=>encodeURIComponent(e),O=(e,t)=>({method:e,body:t===void 0?void 0:JSON.stringify(t)}),ce=[`job.pushed`,`job.started`,`job.completed`,`job.failed`,`job.progress`],k={overview:()=>T(`/dashboard`),queues:(e=500,t=0)=>T(`/dashboard/queues?limit=${e}&offset=${t}`),queuesSummary:()=>T(`/queues/summary`),queueDetail:(e,t=!0)=>T(`/dashboard/queues/${D(e)}?includeJobs=${t}`),stats:()=>T(`/stats`),storage:()=>T(`/storage`),health:()=>T(`/health`,void 0,!1),ping:()=>T(`/ping`),jobsList:(e,t,n=50,r=0)=>{let i=new URLSearchParams;return t?.length&&i.set(`states`,t.join(`,`)),i.set(`limit`,String(n)),i.set(`offset`,String(r)),T(`/queues/${D(e)}/jobs/list?${i}`)},job:e=>T(`/jobs/${D(e)}`),jobByCustomId:e=>T(`/jobs/custom/${D(e)}`),jobResult:e=>T(`/jobs/${D(e)}/result`),jobLogs:e=>T(`/jobs/${D(e)}/logs`),jobChildren:e=>T(`/jobs/${D(e)}/children`),addJob:(e,t)=>T(`/queues/${D(e)}/jobs`,O(`POST`,t)),addJobsBulk:(e,t)=>T(`/queues/${D(e)}/jobs/bulk`,O(`POST`,{jobs:t})),pullBatch:(e,t)=>T(`/queues/${D(e)}/jobs/pull-batch`,O(`POST`,{count:t})),ackBatch:e=>T(`/jobs/ack-batch`,O(`POST`,{ids:e})),cancelJob:e=>T(`/jobs/${D(e)}`,{method:`DELETE`}),promoteJob:e=>T(`/jobs/${D(e)}/promote`,O(`POST`)),discardJob:e=>T(`/jobs/${D(e)}/discard`,O(`POST`)),retryJob:e=>T(`/jobs/${D(e)}/move-to-wait`,O(`POST`)),failJob:(e,t)=>T(`/jobs/${D(e)}/fail`,O(`POST`,{error:t})),updateJobData:(e,t)=>T(`/jobs/${D(e)}/data`,O(`PUT`,{data:t})),changePriority:(e,t)=>T(`/jobs/${D(e)}/priority`,O(`PUT`,{priority:t})),changeDelay:(e,t)=>T(`/jobs/${D(e)}/delay`,O(`PUT`,{delay:t})),moveToDelayed:(e,t)=>T(`/jobs/${D(e)}/move-to-delayed`,O(`POST`,{delay:t})),addJobLog:(e,t,n)=>T(`/jobs/${D(e)}/logs`,O(`POST`,{message:t,level:n})),clearJobLogs:e=>T(`/jobs/${D(e)}/logs`,{method:`DELETE`}),counts:e=>T(`/queues/${D(e)}/counts`),pause:e=>T(`/queues/${D(e)}/pause`,O(`POST`)),resume:e=>T(`/queues/${D(e)}/resume`,O(`POST`)),drain:e=>T(`/queues/${D(e)}/drain`,O(`POST`)),obliterate:e=>T(`/queues/${D(e)}/obliterate`,O(`POST`)),clean:(e,t={})=>T(`/queues/${D(e)}/clean`,O(`POST`,t)),promoteJobs:(e,t)=>T(`/queues/${D(e)}/promote-jobs`,O(`POST`,t==null?void 0:{count:t})),retryCompleted:(e,t)=>T(`/queues/${D(e)}/retry-completed`,O(`POST`,t?{id:t}:void 0)),setRateLimit:(e,t)=>T(`/queues/${D(e)}/rate-limit`,O(`PUT`,{limit:t})),clearRateLimit:e=>T(`/queues/${D(e)}/rate-limit`,{method:`DELETE`}),setConcurrency:(e,t)=>T(`/queues/${D(e)}/concurrency`,O(`PUT`,{concurrency:t})),clearConcurrency:e=>T(`/queues/${D(e)}/concurrency`,{method:`DELETE`}),getStallConfig:e=>T(`/queues/${D(e)}/stall-config`),setStallConfig:(e,t)=>T(`/queues/${D(e)}/stall-config`,O(`PUT`,{config:t})),getDlqConfig:e=>T(`/queues/${D(e)}/dlq-config`),setDlqConfig:(e,t)=>T(`/queues/${D(e)}/dlq-config`,O(`PUT`,{config:t})),dlq:(e,t=100,n=0)=>T(`/queues/${D(e)}/dlq?limit=${t}&offset=${n}`),dlqStats:e=>T(`/queues/${D(e)}/dlq/stats`),retryDlq:(e,t)=>T(`/queues/${D(e)}/dlq/retry`,O(`POST`,t?{jobId:t}:void 0)),purgeDlq:e=>T(`/queues/${D(e)}/dlq/purge`,O(`POST`)),crons:()=>T(`/crons`),createCron:e=>T(`/crons`,O(`POST`,e)),deleteCron:e=>T(`/crons/${D(e)}`,{method:`DELETE`}),webhooks:()=>T(`/webhooks`),addWebhook:e=>T(`/webhooks`,O(`POST`,e)),removeWebhook:e=>T(`/webhooks/${D(e)}`,{method:`DELETE`}),setWebhookEnabled:(e,t)=>T(`/webhooks/${D(e)}/enabled`,O(`PUT`,{enabled:t})),workers:()=>T(`/workers`),unregisterWorker:e=>T(`/workers/${D(e)}`,{method:`DELETE`}),eventsUrl:e=>y()+(e?`/events/queues/${D(e)}`:`/events`),db:{info:()=>E(`/db/info`),tables:()=>E(`/db/tables`),schema:e=>E(`/db/tables/${D(e)}/schema`),rows:(e,t=50,n=0,r,i=`asc`,a)=>E(`/db/tables/${D(e)}?limit=${t}&offset=${n}`+(r?`&orderBy=${D(r)}&dir=${i}`:``)+(a?.value?`&fcol=${D(a.column)}&fop=${a.op}&fval=${D(a.value)}`:``)),cell:(e,t,n)=>E(`/db/tables/${D(e)}/cell?rowid=${t}&column=${D(n)}`),query:e=>E(`/db/query`,O(`POST`,{sql:e}))},agentBase:se,control:{status:()=>E(`/control/status`),start:()=>E(`/control/start`,{method:`POST`}),stop:()=>E(`/control/stop`,{method:`POST`}),restart:()=>E(`/control/restart`,{method:`POST`}),logs:()=>E(`/control/logs`),getConfig:()=>E(`/control/config`),setConfig:e=>E(`/control/config`,O(`PUT`,e))}},le=15e3,ue=6e4,de=v(e=>({breaching:[],setBreaching:t=>e({breaching:t})}));async function fe(){if(typeof Notification>`u`)return`denied`;if(Notification.permission===`granted`)return`granted`;try{return await Notification.requestPermission()}catch{return`denied`}}function pe(e,t,n){switch(t){case`>=`:return e>=n;case`>`:return e>n;case`<=`:return e<=n;case`<`:return e<n;default:return!1}}var me=(e,t)=>{let n=e+t;return n>0?t/n*100:0};function he(e,t){let n=e.queue.trim();switch(e.metric){case`waiting`:return t.summary?n?t.summary.find(e=>e.name===n)?.counts.waiting??null:t.summary.reduce((e,t)=>e+t.counts.waiting,0):null;case`failed`:return t.summary?n?t.summary.find(e=>e.name===n)?.counts.failed??null:t.summary.reduce((e,t)=>e+t.counts.failed,0):null;case`dlq`:return t.queues?n?t.queues.find(e=>e.name===n)?.dlq??null:t.queues.reduce((e,t)=>e+(t.dlq??0),0):null;case`error_rate`:if(!t.summary)return null;if(n){let e=t.summary.find(e=>e.name===n);return e?me(e.counts.completed,e.counts.failed):null}return me(t.summary.reduce((e,t)=>e+t.counts.completed,0),t.summary.reduce((e,t)=>e+t.counts.failed,0));case`p99_latency`:{let e=t.overview?.latency?.percentiles;if(!e)return null;let n=Object.values(e).map(e=>e.p99).filter(e=>Number.isFinite(e));return n.length?Math.max(...n):null}default:return null}}function ge(e){let t=`${e.queue||`All queues`}: ${e.metricLabel} ${e.operator} ${e.threshold} (now ${Math.round(e.value)})`;if(ae.error(`Alert: ${e.ruleName}`,t),typeof Notification<`u`&&Notification.permission===`granted`)try{new Notification(`bunqueue alert: ${e.ruleName}`,{body:t,tag:e.ruleId})}catch{}}function _e(){let e=S(e=>e.rules),t=de(e=>e.setBreaching),n=(0,b.useRef)(new Map),r=(0,b.useRef)(new Map),i=(0,b.useRef)(new Map),a=e.filter(e=>e.enabled).map(e=>`${e.id}:${e.metric}:${e.operator}:${e.threshold}:${e.queue}`).join(`|`);(0,b.useEffect)(()=>{if(!a){t([]),n.current.clear(),r.current.clear(),i.current.clear();return}let e=!1,o=!1,s=async()=>{if(!o){o=!0;try{let[a,o,s]=await Promise.all([k.queuesSummary().catch(()=>null),k.queues().catch(()=>null),k.overview().catch(()=>null)]);if(e||!s)return;let c={summary:a,queues:o?.queues??null,overview:s},l=Date.now(),u=[],d=S.getState().rules.filter(e=>e.enabled),f=new Set(d.map(e=>e.id));for(let e of d){let t=he(e,c);if(t==null)continue;let a=pe(t,e.operator,e.threshold),o=n.current.get(e.id)??!1;if(a){let n=o?i.current.get(e.id)??l:l;i.current.set(e.id,n);let a={ruleId:e.id,ruleName:e.name,metricLabel:re[e.metric],operator:e.operator,threshold:e.threshold,value:t,queue:e.queue,at:n};u.push(a);let s=l-(r.current.get(e.id)??0)>ue;!o&&s&&(ge(a),r.current.set(e.id,l))}else i.current.delete(e.id);n.current.set(e.id,a)}for(let e of[...n.current.keys()])f.has(e)||(n.current.delete(e),r.current.delete(e),i.current.delete(e));t(u)}finally{o=!1}}};s();let c=setInterval(s,le);return()=>{e=!0,clearInterval(c)}},[a,t])}function ve(){return _e(),null}var A=p();function ye(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(`server`),[i,a]=(0,b.useState)(``),o=g(e=>e.baseUrl),s=g(e=>e.setToken),c=g(e=>e.setAgentToken),l=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=e=>{let n=e.detail?.scope;r(n===`agent`?`agent`:`server`),t(!0)};return window.addEventListener(`auth:required`,e),()=>window.removeEventListener(`auth:required`,e)},[]),(0,b.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(()=>l.current?.focus());return()=>cancelAnimationFrame(t)},[e]),e?(0,A.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/60 p-4`,children:(0,A.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let r=i.trim();r&&(n===`agent`?c(r):s(r),a(``),t(!1))},role:`dialog`,"aria-modal":`true`,"aria-label":`Authentication required`,className:`w-full max-w-sm rounded-xl border border-line-strong bg-surface p-6 shadow-2xl`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:`Authentication required`}),n===`agent`?(0,A.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`The control agent at `,(0,A.jsx)(`span`,{className:`break-all font-mono text-fg`,children:k.agentBase}),` `,`rejected the request (401). Enter its`,` `,(0,A.jsx)(`span`,{className:`font-mono text-fg`,children:`AGENT_TOKEN`}),` to continue.`]}):(0,A.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`The server at `,(0,A.jsx)(`span`,{className:`break-all font-mono text-fg`,children:o}),` rejected the request (401). Enter its bearer token to continue.`]}),(0,A.jsx)(`input`,{ref:l,type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:n===`agent`?`AGENT_TOKEN`:`Bearer token`,"aria-label":n===`agent`?`Agent token`:`Bearer token`,autoComplete:`off`,className:`mt-4 w-full rounded-lg border border-line bg-surface-2 px-3 py-2 text-sm text-fg outline-none placeholder:text-faint focus-visible:ring-2 focus-visible:ring-accent/50`}),(0,A.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-3`,children:[(0,A.jsx)(d,{to:`/settings`,onClick:()=>t(!1),className:`text-xs text-muted underline-offset-2 hover:text-fg hover:underline`,children:`Open Settings instead`}),(0,A.jsx)(`button`,{type:`submit`,disabled:!i.trim(),className:`rounded-lg bg-accent px-4 py-2 text-sm font-medium text-accent-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 disabled:opacity-50`,children:`Unlock`})]})]})}):null}function j(e){typeof document<`u`&&(document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e)}var M=v()(h((e,t)=>({theme:`dark`,toggle:()=>{let n=t().theme===`dark`?`light`:`dark`;j(n),e({theme:n})},setTheme:t=>{j(t),e({theme:t})}}),{name:`bq-dash-theme`,onRehydrateStorage:()=>e=>{e&&j(e.theme)}}));function be(){j(M.getState().theme)}function N({children:e,...t}){return(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...t,children:e})}var xe=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`path`,{d:`M3 3v18h18`}),(0,A.jsx)(`rect`,{x:`7`,y:`12`,width:`3`,height:`6`}),(0,A.jsx)(`rect`,{x:`12`,y:`8`,width:`3`,height:`10`}),(0,A.jsx)(`rect`,{x:`17`,y:`5`,width:`3`,height:`13`})]}),P=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`line`,{x1:`8`,y1:`6`,x2:`21`,y2:`6`}),(0,A.jsx)(`line`,{x1:`8`,y1:`12`,x2:`21`,y2:`12`}),(0,A.jsx)(`line`,{x1:`8`,y1:`18`,x2:`21`,y2:`18`}),(0,A.jsx)(`line`,{x1:`3`,y1:`6`,x2:`3.01`,y2:`6`}),(0,A.jsx)(`line`,{x1:`3`,y1:`12`,x2:`3.01`,y2:`12`}),(0,A.jsx)(`line`,{x1:`3`,y1:`18`,x2:`3.01`,y2:`18`})]}),Se=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`rect`,{x:`2`,y:`7`,width:`20`,height:`14`,rx:`2`}),(0,A.jsx)(`path`,{d:`M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`})]}),F=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z`}),(0,A.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,A.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),Ce=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,A.jsx)(`polyline`,{points:`12 7 12 12 15 14`})]}),we=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`path`,{d:`M3 3v18h18`}),(0,A.jsx)(`path`,{d:`m19 9-5 5-4-4-3 3`})]}),I=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`8`,rx:`2`}),(0,A.jsx)(`rect`,{x:`4`,y:`14`,width:`16`,height:`6`,rx:`2`}),(0,A.jsx)(`line`,{x1:`8`,y1:`8`,x2:`8.01`,y2:`8`}),(0,A.jsx)(`line`,{x1:`8`,y1:`17`,x2:`8.01`,y2:`17`})]}),Te=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`path`,{d:`M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9`}),(0,A.jsx)(`path`,{d:`M13.73 21a2 2 0 0 1-3.46 0`})]}),Ee=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`line`,{x1:`8`,y1:`6`,x2:`21`,y2:`6`}),(0,A.jsx)(`line`,{x1:`8`,y1:`12`,x2:`21`,y2:`12`}),(0,A.jsx)(`line`,{x1:`8`,y1:`18`,x2:`21`,y2:`18`}),(0,A.jsx)(`path`,{d:`M3 6h.01M3 12h.01M3 18h.01`})]}),De=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`path`,{d:`M12 20V10`}),(0,A.jsx)(`path`,{d:`M18 20V4`}),(0,A.jsx)(`path`,{d:`M6 20v-4`})]}),Oe=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`ellipse`,{cx:`12`,cy:`5`,rx:`8`,ry:`3`}),(0,A.jsx)(`path`,{d:`M4 5v6c0 1.66 3.58 3 8 3s8-1.34 8-3V5`}),(0,A.jsx)(`path`,{d:`M4 11v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6`})]}),ke=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,A.jsx)(`path`,{d:`M3 10h18`}),(0,A.jsx)(`path`,{d:`M9 10v10`})]}),Ae=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,A.jsx)(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z`})]}),je=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,A.jsx)(`path`,{d:`M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41`})]}),Me=e=>(0,A.jsx)(N,{...e,children:(0,A.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79Z`})}),Ne=e=>(0,A.jsx)(N,{...e,children:(0,A.jsx)(`polyline`,{points:`15 18 9 12 15 6`})}),Pe=e=>(0,A.jsx)(N,{...e,children:(0,A.jsx)(`polyline`,{points:`9 18 15 12 9 6`})}),Fe=e=>(0,A.jsx)(N,{...e,children:(0,A.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})}),Ie=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`}),(0,A.jsx)(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`})]}),Le=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,A.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]}),Re=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`polyline`,{points:`23 4 23 10 17 10`}),(0,A.jsx)(`polyline`,{points:`1 20 1 14 7 14`}),(0,A.jsx)(`path`,{d:`M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15`})]}),ze=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,A.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),Be=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8Z`}),(0,A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),L=e=>(0,A.jsx)(N,{...e,children:(0,A.jsx)(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})}),Ve=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,A.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),He=e=>(0,A.jsx)(N,{...e,children:(0,A.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),Ue=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,A.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]}),We=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,A.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),Ge=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`line`,{x1:`3`,y1:`6`,x2:`21`,y2:`6`}),(0,A.jsx)(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),(0,A.jsx)(`line`,{x1:`3`,y1:`18`,x2:`21`,y2:`18`})]}),Ke=e=>(0,A.jsxs)(N,{...e,children:[(0,A.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,A.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,A.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]}),qe=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`ApiError`}};async function R(e,t,n=!0){let r=await fetch(y()+e,{...t,headers:{"Content-Type":`application/json`,..._(),...t?.headers}});if(!r.ok){let e=`HTTP ${r.status}`;try{let t=await r.json();t?.error&&(e=t.error)}catch{}throw new qe(e,r.status)}if(r.status===204)return;let i=await r.json();if(n&&i&&typeof i==`object`&&i.ok===!1){let e=i.error;throw new qe(e??`Operation failed`,r.status)}return i}var z=e=>encodeURIComponent(e),B=(e,t)=>R(e,{method:`POST`,body:t?JSON.stringify(t):void 0}),Je=(e,t)=>R(e,{method:`PUT`,body:t?JSON.stringify(t):void 0}),V=e=>R(e,{method:`DELETE`}),H={overview:()=>R(`/dashboard`),queues:(e=200,t=0)=>R(`/dashboard/queues?limit=${e}&offset=${t}`),queueDetail:(e,t=!0)=>R(`/dashboard/queues/${z(e)}?includeJobs=${t}`),stats:()=>R(`/stats`),storage:()=>R(`/storage`,void 0,!1),health:()=>R(`/health`,void 0,!1),jobsList:(e,t={})=>{let n=new URLSearchParams;return t.states?.length&&n.set(`states`,t.states.join(`,`)),n.set(`limit`,String(t.limit??50)),n.set(`offset`,String(t.offset??0)),R(`/queues/${z(e)}/jobs/list?${n.toString()}`)},job:e=>R(`/jobs/${z(e)}`),cancelJob:e=>V(`/jobs/${z(e)}`),promoteJob:e=>B(`/jobs/${z(e)}/promote`),retryJob:e=>B(`/jobs/${z(e)}/move-to-wait`),pause:e=>B(`/queues/${z(e)}/pause`),resume:e=>B(`/queues/${z(e)}/resume`),drain:e=>B(`/queues/${z(e)}/drain`),obliterate:e=>B(`/queues/${z(e)}/obliterate`),clean:(e,t=0,n=1e3)=>B(`/queues/${z(e)}/clean`,{grace:t,limit:n}),retryCompleted:e=>B(`/queues/${z(e)}/retry-completed`),setRateLimit:(e,t)=>Je(`/queues/${z(e)}/rate-limit`,{limit:t}),clearRateLimit:e=>V(`/queues/${z(e)}/rate-limit`),setConcurrency:(e,t)=>Je(`/queues/${z(e)}/concurrency`,{concurrency:t}),clearConcurrency:e=>V(`/queues/${z(e)}/concurrency`),dlq:(e,t=50,n=0)=>R(`/queues/${z(e)}/dlq?limit=${t}&offset=${n}`),dlqStats:e=>R(`/queues/${z(e)}/dlq/stats`),retryDlq:e=>B(`/queues/${z(e)}/dlq/retry`),purgeDlq:e=>B(`/queues/${z(e)}/dlq/purge`),crons:()=>R(`/crons`),deleteCron:e=>V(`/crons/${z(e)}`),workers:()=>R(`/workers`),eventsUrl:e=>y()+(e?`/events/queues/${z(e)}`:`/events`)};function Ye(e){let t=!0;return()=>t?(t=!1,!0):!e()}function Xe(e,t=[],n={}){let r=g(e=>e.refreshMs),i=n.intervalMs??r,[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(!0),d=(0,b.useRef)(e);d.current=e;let f=(0,b.useRef)(!0),p=(0,b.useRef)(0),m=(0,b.useRef)(void 0),h=(0,b.useRef)(!0),_=(0,b.useRef)(!1),v=(0,b.useCallback)(async()=>{let e=++p.current;try{let t=await d.current();if(!f.current||e!==p.current)return;let n;try{n=JSON.stringify(t)}catch{n=String(Math.random())}n!==m.current&&(m.current=n,o(t)),_.current&&(_.current=!1,c(null))}catch(t){if(!f.current||e!==p.current)return;_.current=!0,c(t)}finally{f.current&&e===p.current&&h.current&&(h.current=!1,u(!1))}},[]);return(0,b.useEffect)(()=>{f.current=!0,m.current=void 0,h.current=!0,u(!0),_.current&&(_.current=!1,c(null));let e=null,t=!1,n=()=>typeof document<`u`&&document.hidden,r=Ye(n),a=async()=>{t||(r()&&await v(),!t&&(e=setTimeout(a,i)))};a();let o=()=>{!n()&&!t&&v()};return typeof document<`u`&&document.addEventListener(`visibilitychange`,o),()=>{t=!0,f.current=!1,e&&clearTimeout(e),typeof document<`u`&&document.removeEventListener(`visibilitychange`,o)}},[i,v,...t]),{data:a,error:s,loading:l,refreshing:l,refetch:v}}function Ze(){let e=g(e=>e.baseUrl),t=e===`/api`?`localhost:6790`:e.replace(/^https?:\/\//,``);return(0,A.jsxs)(`div`,{className:`mx-3 mb-3 flex items-center gap-2.5 rounded-lg border border-line bg-surface px-3 py-2`,children:[(0,A.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-accent to-fuchsia-600 text-[11px] font-bold text-white`,children:`bq`}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`div`,{className:`truncate text-xs font-medium text-fg`,children:`bunqueue`}),(0,A.jsx)(`div`,{className:`truncate font-mono text-[10px] text-faint`,title:e,children:t})]}),(0,A.jsx)(d,{to:`/settings`,"aria-label":`Settings`,className:`text-faint transition-colors hover:text-fg`,children:(0,A.jsx)(Ae,{className:`size-4`})})]})}var Qe=[{section:null,items:[{to:`/`,label:`Overview`,icon:xe,end:!0}]},{section:`Queues`,items:[{to:`/queues`,label:`Queues`,icon:P},{to:`/jobs`,label:`Jobs`,icon:Se},{to:`/dlq`,label:`Dead Letter Queue`,icon:F},{to:`/cron`,label:`Cron Jobs`,icon:Ce},{to:`/flows`,label:`Flows`,icon:Ue}]},{section:`Monitoring`,items:[{to:`/metrics`,label:`Metrics`,icon:we},{to:`/workers`,label:`Workers`,icon:I},{to:`/logs`,label:`Logs`,icon:Ee},{to:`/alerts`,label:`Alerts`,icon:Te}]},{section:`Control`,items:[{to:`/server`,label:`Server`,icon:I},{to:`/add-job`,label:`Add Job`,icon:Se},{to:`/jobs/bulk-add`,label:`Bulk Add`,icon:Se},{to:`/job`,label:`Job Inspector`,icon:Be},{to:`/queue-control`,label:`Queue Control`,icon:P},{to:`/dlq-control`,label:`DLQ Control`,icon:F},{to:`/webhooks`,label:`Webhooks`,icon:L},{to:`/diagnostics`,label:`Diagnostics`,icon:we},{to:`/benchmark`,label:`Benchmark`,icon:L}]},{section:`Management`,items:[{to:`/database`,label:`Database`,icon:ke},{to:`/mcp`,label:`MCP`,icon:L},{to:`/usage`,label:`Usage`,icon:De},{to:`/s3`,label:`S3 Backup`,icon:Oe},{to:`/settings`,label:`Settings`,icon:Ae}]}];function $e(){let e=g(e=>e.baseUrl),{data:n,error:r,loading:i}=Xe(async()=>({ok:(await H.health()).ok}),[],{intervalMs:15e3}),a=!r&&n!=null&&n.ok!==!1,o=e.replace(/^https?:\/\//,``)||`local`;return(0,A.jsxs)(`div`,{className:`mx-3 mb-4 flex items-center gap-2 rounded-lg border border-line bg-surface px-3 py-1.5`,children:[(0,A.jsx)(`span`,{className:t(`size-1.5 rounded-full`,i?`bg-zinc-500`:a?`bg-emerald-400`:`bg-red-400`),title:i?`connecting`:a?`connected`:`offline`}),(0,A.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted`,title:e,children:o}),(0,A.jsx)(`span`,{className:`sr-only`,children:i?`connecting`:a?`connected`:`offline`})]})}function et(){let e=M(e=>e.theme),t=M(e=>e.toggle),n=e===`dark`;return(0,A.jsxs)(`button`,{type:`button`,onClick:t,className:`mx-3 mb-3 flex items-center gap-3 rounded-lg px-3 py-2 text-sm text-muted transition-colors hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[n?(0,A.jsx)(je,{className:`size-4`}):(0,A.jsx)(Me,{className:`size-4`}),n?`Light Mode`:`Dark Mode`]})}function tt({open:e=!1,onClose:n}){return(0,A.jsxs)(A.Fragment,{children:[e&&(0,A.jsx)(`button`,{type:`button`,"aria-label":`Close navigation`,onClick:n,className:`fixed inset-0 z-40 bg-black/50 lg:hidden`}),(0,A.jsxs)(`aside`,{id:`app-nav`,className:t(`flex w-60 shrink-0 flex-col border-r border-line bg-sidebar`,`fixed inset-y-0 left-0 z-50 transition-[transform,visibility] lg:static lg:z-auto lg:translate-x-0`,e?`translate-x-0`:`-translate-x-full lg:translate-x-0 invisible lg:visible`),children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-5`,children:[(0,A.jsx)(`span`,{className:`text-lg font-bold tracking-tight text-fg`,children:`bunqueue`}),(0,A.jsx)(`span`,{className:`rounded-md bg-accent/15 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-accent`,children:`dash`}),(0,A.jsx)(`span`,{title:`Beta — under active development`,className:`rounded-md bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-warning`,children:`beta`})]}),(0,A.jsx)(`nav`,{className:`flex-1 overflow-y-auto px-3 pb-4`,children:Qe.map(e=>(0,A.jsxs)(`div`,{className:`mb-4`,children:[e.section&&(0,A.jsx)(`div`,{className:`px-2 pb-2 pt-1 text-[10px] font-semibold uppercase tracking-wider text-faint`,children:e.section}),(0,A.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:e.items.map(({to:e,label:n,icon:r,end:i})=>(0,A.jsx)(a,{to:e,end:i,className:({isActive:e})=>t(`group relative flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,e?`bg-surface-2 text-fg`:`text-muted hover:bg-surface-2/60 hover:text-fg`),children:({isActive:e})=>(0,A.jsxs)(A.Fragment,{children:[e&&(0,A.jsx)(`span`,{className:`absolute inset-y-1.5 left-0 w-0.5 rounded-full bg-accent`}),(0,A.jsx)(r,{className:`size-[18px] shrink-0`}),(0,A.jsx)(`span`,{className:`truncate`,children:n})]})},e))})]},e.section??`root`))}),(0,A.jsx)($e,{}),(0,A.jsx)(et,{}),(0,A.jsx)(Ze,{})]})]})}var nt=`https://egeominotti.github.io/bunqueue-dashboard/docs/`;function rt(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(0),o=m(),s=M(e=>e.toggle),c=(0,b.useRef)(null),l=(0,b.useRef)(null),u=(0,b.useMemo)(()=>{let e=Qe.flatMap(e=>e.items.map(t=>({id:`nav:${t.to}`,label:t.label,hint:e.section??`Home`,run:()=>o(t.to)}))),t=[{id:`act:theme`,label:`Toggle theme (dark / light)`,hint:`Action`,run:s},{id:`act:docs`,label:`Open documentation`,hint:`Action`,run:()=>window.open(nt,`_blank`,`noopener`)}];return[...e,...t]},[o,s]),d=(0,b.useMemo)(()=>{let e=n.trim().toLowerCase();return e?u.filter(t=>`${t.label} ${t.hint}`.toLowerCase().includes(e)):u},[u,n]);(0,b.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e))},n=()=>t(!0);return window.addEventListener(`keydown`,e),window.addEventListener(`command-palette:open`,n),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`command-palette:open`,n)}},[]),(0,b.useEffect)(()=>{if(!e)return;let t=document.activeElement;r(``),a(0);let n=requestAnimationFrame(()=>c.current?.focus());return()=>{cancelAnimationFrame(n),t?.focus?.()}},[e]),(0,b.useEffect)(()=>{l.current?.querySelector(`[data-idx="${i}"]`)?.scrollIntoView({block:`nearest`})},[i]);let f=(0,b.useCallback)(()=>t(!1),[]),p=(0,b.useCallback)(e=>{e&&(e.run(),t(!1))},[]);return e?(0,A.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center p-4 pt-[12vh]`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":`Close command palette`,onClick:f,className:`fixed inset-0 bg-black/50`}),(0,A.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,className:`relative z-10 w-full max-w-lg overflow-hidden rounded-xl border border-line-strong bg-surface shadow-2xl`,children:[(0,A.jsx)(`input`,{ref:c,value:n,onChange:e=>{r(e.target.value),a(0)},onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),f()):e.key===`ArrowDown`?(e.preventDefault(),a(e=>Math.min(e+1,d.length-1))):e.key===`ArrowUp`?(e.preventDefault(),a(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),p(d[i]))},placeholder:`Search pages and actions…`,"aria-label":`Search pages and actions`,className:`w-full border-b border-line bg-transparent px-4 py-3 text-sm text-fg outline-none placeholder:text-faint`}),(0,A.jsxs)(`ul`,{ref:l,className:`max-h-80 overflow-y-auto py-2`,"aria-label":`Results`,children:[d.length===0&&(0,A.jsx)(`li`,{className:`px-4 py-6 text-center text-sm text-faint`,children:`No matches`}),d.map((e,t)=>(0,A.jsx)(`li`,{children:(0,A.jsxs)(`button`,{type:`button`,"data-idx":t,onMouseEnter:()=>a(t),onClick:()=>p(e),className:`flex w-full items-center justify-between gap-3 px-4 py-2 text-left text-sm transition-colors ${t===i?`bg-accent/15 text-fg`:`text-muted`}`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:e.label}),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-faint`,children:e.hint})]})},e.id))]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-t border-line px-4 py-2 text-xs text-faint`,children:[(0,A.jsx)(`span`,{children:`↑↓ navigate · ↵ open · esc close`}),(0,A.jsx)(`span`,{className:`font-mono`,children:`⌘K`})]})]})]}):null}var it=()=>typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}`,U=new Map,W=(e,t,n)=>e.map(e=>e.id===t?n(e):e);function at(e){return{config:{provider:e.config.provider,baseURL:e.config.baseURL,model:e.config.model}}}var G=v()(h(e=>({open:!1,config:{provider:`anthropic`,baseURL:``,model:`claude-opus-4-8`,apiKey:``},messages:[],pending:[],busy:!1,setOpen:t=>e({open:t}),toggle:()=>e(e=>({open:!e.open})),setConfig:t=>e(e=>({config:{...e.config,...t}})),clear:()=>{for(let e of U.values())e(!1);U.clear(),e({messages:[],pending:[]})},cancelPending:()=>{for(let e of U.values())e(!1);U.clear(),e({pending:[]})},setBusy:t=>e({busy:t}),addUser:t=>e(e=>({messages:[...e.messages,{id:it(),role:`user`,content:t}]})),startAssistant:()=>{let t=it();return e(e=>({messages:[...e.messages,{id:t,role:`assistant`,content:``,tools:[]}]})),t},appendAssistant:(t,n)=>e(e=>({messages:W(e.messages,t,e=>({...e,content:e.content+n}))})),finishAssistant:(t,n)=>e(e=>({messages:W(e.messages,t,e=>({...e,error:!!n?.error,content:n?.error?e.content||n.error:e.content}))})),addTool:(t,n)=>e(e=>({messages:W(e.messages,t,e=>({...e,tools:[...e.tools??[],n]}))})),updateTool:(t,n,r)=>e(e=>({messages:W(e.messages,t,e=>({...e,tools:(e.tools??[]).map(e=>e.id===n?{...e,...r}:e)}))})),requestConfirm:t=>new Promise(n=>{let r=it();U.set(r,n),e(e=>({pending:[...e.pending,{...t,id:r}]}))}),resolveConfirm:(t,n)=>{let r=U.get(t);r&&(U.delete(t),r(n)),e(e=>({pending:e.pending.filter(e=>e.id!==t)}))}}),{name:`bq-dash-copilot`,partialize:e=>at(e),merge:(e,t)=>{let n=e??{};return{...t,config:{...t.config,...n.config??{},apiKey:``}}}})),ot=(0,b.lazy)(()=>u(()=>import(`./CopilotPanel-C4u8nJMr.js`).then(e=>({default:e.CopilotPanel})),__vite__mapDeps([0,1,2,3])));function st({className:e}){return(0,A.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsx)(`path`,{d:`M12 3l1.9 4.6L18.5 9.5 13.9 11.4 12 16l-1.9-4.6L5.5 9.5l4.6-1.9L12 3z`,fill:`currentColor`}),(0,A.jsx)(`path`,{d:`M19 14l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8.8-2z`,fill:`currentColor`,opacity:`0.7`})]})}function ct(){let e=G(e=>e.open),t=G(e=>e.setOpen);return(0,A.jsxs)(A.Fragment,{children:[!e&&(0,A.jsxs)(`button`,{type:`button`,onClick:()=>t(!0),className:`fixed bottom-5 right-5 z-40 flex items-center gap-2 rounded-full border border-line bg-surface px-4 py-2.5 text-sm font-medium text-fg shadow-lg transition-colors hover:border-accent/50 hover:text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,"aria-label":`Open Copilot`,children:[(0,A.jsx)(st,{className:`size-4 text-accent`}),`Copilot`,(0,A.jsx)(`span`,{className:`rounded bg-accent/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-accent`,children:`beta`})]}),e&&(0,A.jsx)(b.Suspense,{fallback:(0,A.jsx)(`div`,{className:`fixed inset-y-0 right-0 z-[60] flex w-full max-w-md items-center justify-center border-l border-line bg-surface text-sm text-muted`,children:`Loading Copilot…`}),children:(0,A.jsx)(ot,{})})]})}var lt={default:`border border-line bg-surface-2 text-fg hover:bg-surface-2/70 hover:border-line-strong`,ghost:`text-muted hover:text-fg hover:bg-surface-2`,accent:`bg-accent text-accent-fg hover:opacity-90 border border-transparent`,danger:`border border-red-500/30 text-danger hover:bg-red-500/10 hover:border-red-500/50`,warning:`border border-amber-500/30 text-warning hover:bg-amber-500/10 hover:border-amber-500/50`,success:`bg-emerald-500 text-white hover:bg-emerald-500/90 border border-transparent`},ut={sm:`h-8 px-3 text-xs gap-1.5`,md:`h-9 px-4 text-sm gap-2`};function dt({children:e,variant:n=`default`,size:r=`md`,className:i,...a}){return(0,A.jsx)(`button`,{type:`button`,className:t(`inline-flex items-center justify-center rounded-lg font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,`disabled:cursor-not-allowed disabled:opacity-50`,lt[n],ut[r],i),...a,children:e})}function ft({children:e,className:n,variant:r=`ghost`,...i}){return(0,A.jsx)(`button`,{type:`button`,className:t(`inline-flex size-8 items-center justify-center rounded-lg transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,`disabled:cursor-not-allowed disabled:opacity-50`,lt[r],n),...i,children:e})}function K({children:e,className:n,padded:r=!0}){return(0,A.jsx)(`div`,{className:t(`rounded-xl border border-line bg-surface`,r&&`p-5`,n),children:e})}function pt({title:e,action:t,icon:n}){return(0,A.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[n,e]}),t]})}function mt({className:e}){return(0,A.jsx)(`span`,{className:t(`inline-block size-4 animate-spin rounded-full border-2 border-current border-t-transparent`,e),role:`status`,"aria-label":`Loading`})}function ht({label:e=`Loading…`}){return(0,A.jsxs)(`div`,{className:`flex items-center justify-center gap-3 py-16 text-sm text-muted`,children:[(0,A.jsx)(mt,{}),e]})}function gt({icon:e,title:t,hint:n,action:r}){return(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-line py-14 text-center`,children:[e&&(0,A.jsx)(`div`,{className:`text-faint [&>svg]:size-8`,children:e}),(0,A.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t}),n&&(0,A.jsx)(`div`,{className:`max-w-sm text-xs text-faint`,children:n}),r&&(0,A.jsx)(`div`,{className:`mt-2`,children:r})]})}function _t({onRetry:e,message:t=`Not connected to the bunqueue server — showing empty data.`}){return(0,A.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-amber-500/25 bg-amber-500/[0.06] px-4 py-2.5 text-sm`,children:[(0,A.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-amber-400`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`text-amber-300/90 light:text-amber-700`,children:t}),e&&(0,A.jsx)(`button`,{type:`button`,onClick:e,className:`ml-auto shrink-0 rounded-md border border-amber-500/30 px-2.5 py-1 text-xs font-medium text-amber-200 light:text-amber-700 hover:border-amber-400/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:`Retry`})]})}function vt({error:e,onRetry:t}){return(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded-xl border border-red-500/20 bg-red-500/5 py-14 text-center`,children:[(0,A.jsx)(`div`,{className:`text-sm font-medium text-danger`,children:`Something went wrong`}),(0,A.jsx)(`div`,{className:`max-w-md text-xs text-faint`,children:e.message}),t&&(0,A.jsx)(`button`,{type:`button`,onClick:t,className:`mt-1 rounded-lg border border-line bg-surface-2 px-3 py-1.5 text-xs font-medium text-fg hover:border-line-strong`,children:`Retry`})]})}var yt=class extends b.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught an error`,e,t.componentStack)}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){let{error:e}=this.state;return e?(0,A.jsx)(`div`,{className:`flex min-h-screen items-center justify-center p-6`,children:(0,A.jsxs)(K,{className:`w-full max-w-lg`,children:[(0,A.jsx)(vt,{error:e}),(0,A.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,A.jsx)(dt,{onClick:()=>window.location.reload(),children:`Reload`})})]})}):this.props.children}},bt={success:{bar:`bg-emerald-500`,title:`text-success`},error:{bar:`bg-red-500`,title:`text-danger`},info:{bar:`bg-accent`,title:`text-accent`}};function xt({toast:e,dismiss:n}){(0,b.useEffect)(()=>{let t=window.setTimeout(()=>n(e.id),e.ttlMs);return()=>window.clearTimeout(t)},[e.id,e.ttlMs,n]);let r=bt[e.level];return(0,A.jsxs)(`div`,{className:`pointer-events-auto flex w-80 max-w-[calc(100vw-2rem)] overflow-hidden rounded-lg border border-line bg-surface shadow-lg`,children:[(0,A.jsx)(`span`,{className:t(`w-1 shrink-0`,r.bar),"aria-hidden":`true`}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3 px-3 py-2.5`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`div`,{className:t(`text-sm font-medium`,r.title),children:e.title}),e.detail&&(0,A.jsx)(`div`,{className:`mt-0.5 break-words text-xs text-muted`,children:e.detail})]}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>n(e.id),"aria-label":`Dismiss notification`,className:`-mr-1 shrink-0 rounded p-0.5 text-faint hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:(0,A.jsx)(Ve,{className:`size-4`})})]})]})}function St(){let e=C(e=>e.toasts),t=C(e=>e.dismiss);return e.length===0?null:(0,A.jsx)(`section`,{className:`pointer-events-none fixed bottom-4 right-4 z-[60] flex flex-col gap-2`,"aria-label":`Notifications`,"aria-live":`polite`,children:e.map(e=>(0,A.jsx)(xt,{toast:e,dismiss:t},e.id))})}function q(){if(typeof window>`u`)return!1;let{search:e,hash:t}=window.location;return new URLSearchParams(e).has(`demo`)||t.replace(/^#/,``)===`demo`}var Ct=q(),wt={"/":`Overview`,"/queues":`Queues`,"/jobs":`Jobs`,"/dlq":`Dead Letter Queue`,"/cron":`Cron Jobs`,"/flows":`Flows`,"/metrics":`Metrics`,"/workers":`Workers`,"/logs":`Logs`,"/server":`Server`,"/add-job":`Add Job`,"/jobs/bulk-add":`Bulk Add Jobs`,"/job":`Job Inspector`,"/queue-control":`Queue Control`,"/dlq-control":`DLQ Control`,"/webhooks":`Webhooks`,"/diagnostics":`Diagnostics`,"/alerts":`Alerts`,"/benchmark":`Benchmark`,"/database":`Database`,"/mcp":`MCP`,"/usage":`Usage`,"/s3":`S3 Backup`,"/settings":`Settings`,"/overview-classic":`Overview (classic)`,"/queues-classic":`Queues (classic)`,"/jobs-classic":`Jobs (classic)`,"/dlq-classic":`DLQ (classic)`,"/metrics-classic":`Metrics (classic)`,"/logs-classic":`Logs (classic)`,"/s3-classic":`S3 Backup (classic)`};function Tt(e){if(wt[e])return wt[e];if(e.startsWith(`/queues/`)){let t=e.slice(8);try{t=decodeURIComponent(t)}catch{}return`${t} · Queue`}return`bunqueue`}function Et({onMenu:e,navOpen:t=!1}){let{pathname:n}=o();return(0,A.jsxs)(`header`,{className:`sticky top-0 z-10 flex h-14 items-center justify-between gap-3 border-b border-line bg-bg/80 px-4 backdrop-blur sm:px-6 lg:px-8`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":`Open navigation`,"aria-expanded":t,"aria-controls":`app-nav`,onClick:e,className:`-ml-1 flex size-9 shrink-0 items-center justify-center rounded-lg text-muted hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 lg:hidden`,children:(0,A.jsx)(Ge,{className:`size-5`})}),(0,A.jsxs)(`div`,{className:`truncate text-sm text-muted`,children:[(0,A.jsx)(`span`,{className:`text-faint`,children:Tt(n)}),(0,A.jsx)(`span`,{className:`mx-2 hidden text-faint sm:inline`,children:`·`}),(0,A.jsx)(`span`,{className:`hidden text-faint sm:inline`,children:`bunqueue`})]})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[Ct&&(0,A.jsxs)(`span`,{title:`Showing canned sample data. No real bunqueue server is connected.`,className:`hidden items-center gap-1.5 rounded-full border border-accent/40 bg-accent/10 px-2.5 py-1 text-xs font-medium text-accent sm:inline-flex`,children:[(0,A.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent`}),`Live demo`]}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>window.dispatchEvent(new Event(`command-palette:open`)),title:`Command palette`,"aria-label":`Open command palette`,className:`flex size-9 shrink-0 items-center justify-center rounded-lg text-muted hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 sm:hidden`,children:(0,A.jsx)(ze,{className:`size-5`})}),(0,A.jsxs)(`button`,{type:`button`,onClick:()=>window.dispatchEvent(new Event(`command-palette:open`)),title:`Command palette (⌘K)`,"aria-label":`Open command palette`,className:`hidden items-center gap-2 rounded-lg border border-line px-2.5 py-1.5 text-xs text-muted hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 sm:flex`,children:[(0,A.jsx)(`span`,{children:`Search`}),(0,A.jsx)(`kbd`,{className:`rounded border border-line bg-surface-2 px-1 font-mono text-[10px]`,children:`⌘K`})]}),(0,A.jsx)(d,{to:`/settings`,title:`Settings`,"aria-label":`Open settings`,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-accent to-fuchsia-600 text-xs font-bold text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:`bq`})]})]})}function Dt(){let[e,n]=(0,b.useState)(!1),{pathname:r,key:i}=o();return(0,b.useEffect)(()=>n(!1),[r]),(0,b.useEffect)(()=>{let e=window.matchMedia(`(min-width: 1024px)`),t=()=>e.matches&&n(!1);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,b.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n(!1)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),(0,b.useEffect)(()=>{if(!e)return;let t=document.activeElement,n=()=>{let e=document.getElementById(`app-nav`);return e?Array.from(e.querySelectorAll(`a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])`)):[]};n()[0]?.focus();let r=e=>{if(e.key!==`Tab`)return;let t=n();if(!t.length)return;let r=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),t?.focus?.()}},[e]),(0,A.jsx)(yt,{children:(0,A.jsxs)(`div`,{className:`flex h-screen overflow-hidden bg-bg text-fg`,children:[(0,A.jsx)(`a`,{href:`#main`,className:`sr-only rounded-md bg-accent px-3 py-2 text-sm font-medium text-accent-fg shadow-lg focus:not-sr-only focus:absolute focus:left-4 focus:top-3 focus:z-50`,children:`Skip to content`}),(0,A.jsx)(tt,{open:e,onClose:()=>n(!1)}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,A.jsx)(Et,{navOpen:e,onMenu:()=>n(!0)}),(0,A.jsx)(`main`,{id:`main`,tabIndex:-1,className:t(`flex-1 px-4 pt-5 pb-24 outline-none sm:px-6 lg:px-8 lg:pt-6`,e?`overflow-hidden`:`overflow-y-auto`),children:(0,A.jsx)(b.Suspense,{fallback:(0,A.jsx)(`div`,{className:`p-2 text-sm text-muted`,children:`Loading…`}),children:(0,A.jsx)(yt,{resetKey:i,children:(0,A.jsx)(l,{})})})})]}),(0,A.jsx)(rt,{}),(0,A.jsx)(ye,{}),(0,A.jsx)(ct,{}),(0,A.jsx)(St,{}),(0,A.jsx)(ve,{})]})})}var Ot={completed:`text-success bg-emerald-500/10`,active:`text-blue-400 light:text-blue-700 bg-blue-500/10`,failed:`text-danger bg-red-500/10`,waiting:`text-zinc-400 light:text-zinc-600 bg-zinc-500/10`,prioritized:`text-violet-400 light:text-violet-700 bg-violet-500/10`,delayed:`text-warning bg-amber-500/10`,paused:`text-orange-400 light:text-orange-700 bg-orange-500/10`,"waiting-children":`text-cyan-400 light:text-cyan-700 bg-cyan-500/10`,stalled:`text-orange-400 light:text-orange-700 bg-orange-500/10`,enqueued:`text-zinc-400 light:text-zinc-600 bg-zinc-500/10`,started:`text-blue-400 light:text-blue-700 bg-blue-500/10`,finished:`text-success bg-emerald-500/10`,retry:`text-warning bg-amber-500/10`,cancelled:`text-zinc-400 light:text-zinc-600 bg-zinc-500/10`,default:`text-zinc-400 light:text-zinc-600 bg-zinc-500/10`};function kt({status:e}){return(0,A.jsxs)(`span`,{className:t(`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium capitalize`,Ot[(e||``).toLowerCase()]??Ot.default),children:[(0,A.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),e||`unknown`]})}function At({label:e,tone:n=`green`}){return(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-muted`,children:[(0,A.jsx)(`span`,{className:t(`size-1.5 rounded-full`,n===`green`?`bg-emerald-400`:n===`amber`?`bg-amber-400`:n===`red`?`bg-red-400`:`bg-zinc-400`)}),e]})}function jt({title:e,description:t,live:n,actions:r,back:i}){return(0,A.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[i,(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight text-fg`,children:e}),n&&(0,A.jsx)(At,{label:`Live`,tone:`green`})]}),t&&(0,A.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t})]})]}),r&&(0,A.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:r})]})}var Mt={default:`text-fg`,green:`text-success`,red:`text-danger`,blue:`text-blue-400 light:text-blue-700`,amber:`text-warning`,accent:`text-accent`};function J({label:e,value:n,tone:r=`default`,hint:i,compact:a}){return(0,A.jsxs)(`div`,{className:t(`rounded-xl border border-line bg-surface`,a?`px-4 py-3`:`px-5 py-4`),children:[(0,A.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-faint`,children:e}),(0,A.jsx)(`div`,{className:t(`mt-2 font-semibold tnum`,a?`text-xl`:`text-3xl`,Mt[r]),children:n}),i!=null&&(0,A.jsx)(`div`,{className:`mt-1 text-xs text-faint`,children:i})]})}var Nt=new Intl.NumberFormat(`de-DE`),Pt=new Intl.DateTimeFormat(`it-IT`,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`});function Y(e){return e==null||!Number.isFinite(e)?`0`:Nt.format(e)}function Ft(e,t=2){return e==null||!Number.isFinite(e)?`0%`:`${(e*100).toFixed(t)}%`}function It(e,t){let n=e+t;return n>0?t/n:null}function Lt(e){if(e==null||!Number.isFinite(e))return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:Pt.format(t)}function X(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Rt(e){if(e==null||!Number.isFinite(e)||e<0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<59.95)return`${t.toFixed(1)}s`;let n=Math.round(t);return`${Math.floor(n/60)}m ${n%60}s`}function zt(e,t){if(e==null||t==null)return;let n=t-e;return n>=0?n:void 0}function Bt(e){if(e==null||!Number.isFinite(e))return`—`;let t=Math.floor(e),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=[];return n&&a.push(`${n}d`),(r||n)&&a.push(`${r}h`),a.push(`${i}m`),a.join(` `)}function Z(e){return e==null||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function Vt(e){return e==null||!Number.isFinite(e)?`—`:e>=1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(+(e<10))}ms`}var Ht=/(?:\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b[@-Z\\^_])/g;function Ut(e){return e.replace(Ht,``)}function Wt(e){if(e==null||!Number.isFinite(e))return`—`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(r===0?0:1)} ${t[r]}`}function Gt(e){return!0}function Kt(e){let t=`message`,n,r=[];for(let i of e.split(`
3
+ `)){if(!i||i.startsWith(`:`))continue;let e=i.indexOf(`:`),a=e===-1?i:i.slice(0,e),o=e===-1?``:i.slice(e+1).replace(/^ /,``);a===`event`?t=o:a===`data`?r.push(o):a===`id`&&(n=o)}if(r.length===0)return null;let i=r.join(`
4
+ `),a=i;try{a=JSON.parse(i)}catch{}return{id:n,event:t,data:a}}async function qt(e,t,n){let r=await fetch(e,{headers:{Accept:`text/event-stream`,..._()},signal:n});if(!r.ok||!r.body)throw Error(`SSE connect failed: HTTP ${r.status}`);let i=r.body.getReader(),a=new TextDecoder,o=``;try{for(;;){let{done:e,value:n}=await i.read();if(e)break;o+=a.decode(n,{stream:!0});let r;for(;(r=o.indexOf(`
5
+
6
+ `))!==-1||(r=o.indexOf(`\r
7
+ \r
8
+ `))!==-1;){let e=o[r]===`\r`,n=o.slice(0,r);o=o.slice(r+(e?4:2));let i=Kt(n.replace(/\r/g,``));i&&t(i)}}}finally{i.releaseLock()}}var Q={total:0,completed:0,failed:0,waiting:0,active:0},Jt=250;function Yt(e){let t=e.includes(`:`)?e.split(`:`)[1]:e;switch(t){case`pushed`:case`added`:return`waiting`;case`pulled`:return`active`;case`progress`:return`active`;default:return t}}function Xt(e){let t=g(e=>e.baseUrl),n=g(e=>e.token),[r,i]=(0,b.useState)([]),[a,o]=(0,b.useState)(Q),[s,c]=(0,b.useState)(0),[l,u]=(0,b.useState)(!1),d=(0,b.useRef)([]),f=(0,b.useRef)([]),p=(0,b.useRef)({...Q});return(0,b.useEffect)(()=>{let t=new AbortController,n=0,r=!1;i([]),o(Q),d.current=[],f.current=[],p.current={...Q};let a=e=>new Promise(n=>{let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{t.signal.removeEventListener(`abort`,r),n()},e);t.signal.addEventListener(`abort`,r,{once:!0})}),s=e=>{if(Gt(e)&&u(!0),!e.event.startsWith(`job:`))return;let t=e.data??{},r=Yt(e.event),i={seq:++n,event:e.event,queue:t.queue,jobId:t.jobId,name:t.name,status:r,timestamp:t.timestamp??Date.now(),error:t.error,progress:t.progress};f.current.push(i);let a=p.current;a.total+=1,r===`completed`?a.completed+=1:r===`failed`?a.failed+=1:r===`waiting`?a.waiting+=1:r===`active`&&(a.active+=1),d.current.push(Date.now())};(async()=>{for(;!r;){try{await qt(H.eventsUrl(e),s,t.signal)}catch{}if(r)break;u(!1),await a(2e3)}})();let c=setInterval(()=>{if(f.current.length){let e=f.current;f.current=[],e.reverse(),i(t=>[...e,...t].slice(0,Jt))}let e=p.current;e.total&&(p.current={...Q},o(t=>({total:t.total+e.total,completed:t.completed+e.completed,failed:t.failed+e.failed,waiting:t.waiting+e.waiting,active:t.active+e.active})))},150);return()=>{r=!0,t.abort(),clearInterval(c),u(!1)}},[e,t,n]),(0,b.useEffect)(()=>{let e=setInterval(()=>{let e=Date.now();d.current=d.current.filter(t=>e-t<5e3),c(d.current.length/5)},1e3);return()=>clearInterval(e)},[]),{events:r,counters:a,throughput:s,connected:l}}var Zt={overview:{stats:{waiting:0,active:0,delayed:0,completed:0,dlq:0,totalPushed:0,totalPulled:0,totalCompleted:0,totalFailed:0,uptime:0},throughput:{pushPerSec:0,pullPerSec:0,completePerSec:0,failPerSec:0},memory:{heapUsed:0,heapTotal:0,rss:0},crons:{total:0}},queuesTotal:0,details:[],failedTotal:0},Qt=100;function $t(){let e=g(e=>e.baseUrl),n=(0,b.useRef)(null),{data:r,error:i,loading:a,refetch:o}=Xe(async()=>{let[e,t]=await Promise.all([k.overview(),k.queuesSummary()]),r=[...t].sort((e,t)=>(t.counts?.failed??0)-(e.counts?.failed??0)||(t.counts?.waiting??0)-(e.counts?.waiting??0)).slice(0,6).map(e=>({name:e.name,paused:e.paused,counts:e.counts})),i=t.reduce((e,t)=>e+(t.counts?.failed??0),0);return n.current=Date.now(),{overview:e,queuesTotal:t.length,details:r,failedTotal:i}},[]);if(a&&!r&&!i)return(0,A.jsx)(ht,{label:`Loading overview…`});let{overview:s,queuesTotal:c,details:l,failedTotal:u}=r??Zt,{stats:f,throughput:p,memory:m,crons:h}=s,_=It(f.completed,u),v=e===`/api`?`localhost:6790`:e.replace(/^https?:\/\//,``),y=f.uptime?Bt(f.uptime/1e3):`—`,ee=Wt(m.rss*1024*1024),x=!!i;return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(jt,{title:`Overview`,description:`Real-time system health at a glance.`,live:!0}),i&&(0,A.jsx)(_t,{onRetry:o}),(0,A.jsxs)(`div`,{className:t(`mb-6 flex flex-wrap items-center justify-between gap-y-2 rounded-xl border px-5 py-4`,x?`border-amber-500/25 bg-amber-500/[0.06]`:`border-emerald-500/25 bg-emerald-500/[0.06]`),children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,A.jsxs)(`span`,{className:`relative flex size-2.5`,children:[!x&&(0,A.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-60`}),(0,A.jsx)(`span`,{className:t(`relative inline-flex size-2.5 rounded-full`,x?`bg-amber-400`:`bg-emerald-400`)})]}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`div`,{className:t(`font-semibold`,x?`text-warning`:`text-success`),children:x?`Connection lost — showing last known data`:`bunqueue server connected`}),(0,A.jsxs)(`div`,{className:`truncate font-mono text-xs text-muted`,children:[v,` · uptime `,y,` · `,ee,` RAM`,x&&(0,A.jsxs)(A.Fragment,{children:[` `,`· last updated `,n.current?X(n.current):`never`]})]})]})]}),(0,A.jsx)(`span`,{className:t(`rounded-full px-3 py-1 text-xs font-medium`,x?`bg-amber-500/15 text-warning`:`bg-emerald-500/15 text-success`),children:x?`Stale`:`Online`})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,A.jsx)(J,{label:`Error Rate`,value:_==null?`—`:Ft(_),tone:_==null?`default`:_>.05?`red`:`green`,hint:`failed / processed`}),(0,A.jsx)(J,{label:`Failed`,value:Y(u),tone:u?`red`:`default`,hint:`recorded across queues`}),(0,A.jsx)(J,{label:`DLQ`,value:Y(f.dlq),tone:f.dlq?`red`:`default`,hint:`dead-lettered jobs`})]}),(0,A.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-6`,children:[(0,A.jsx)(J,{label:`Completed`,value:Y(f.completed),tone:`green`,compact:!0}),(0,A.jsx)(J,{label:`Active`,value:Y(f.active),tone:`blue`,compact:!0}),(0,A.jsx)(J,{label:`Waiting`,value:Y(f.waiting),tone:f.waiting>Qt?`amber`:`default`,compact:!0}),(0,A.jsx)(J,{label:`Push/sec`,value:p.pushPerSec.toFixed(1),tone:`accent`,hint:`${Z(f.totalPushed)} since restart`,compact:!0}),(0,A.jsx)(J,{label:`Pull/sec`,value:p.pullPerSec.toFixed(1),tone:`accent`,hint:`${Z(f.totalPulled)} since restart`,compact:!0}),(0,A.jsx)(J,{label:`Queues`,value:Y(c),hint:`${h.total} cron active`,compact:!0})]}),(0,A.jsxs)(`div`,{className:`mt-8`,children:[(0,A.jsx)(tn,{title:`Queue Health — most loaded`,to:`/queues`}),l.length===0?(0,A.jsx)(K,{children:(0,A.jsx)(`p`,{className:`py-4 text-center text-sm text-faint`,children:`No queues yet.`})}):(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:l.map(e=>(0,A.jsxs)(d,{to:`/queues/${encodeURIComponent(e.name)}`,className:`rounded-xl border border-line bg-surface p-4 transition-colors hover:border-line-strong`,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,A.jsx)(`span`,{className:`truncate font-mono text-sm font-medium text-accent`,children:e.name}),(0,A.jsx)(`span`,{className:t(`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium`,e.paused?`bg-orange-500/10 text-orange-400`:`bg-emerald-500/10 text-success`),children:e.paused?`paused`:`active`})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs text-faint`,children:[(0,A.jsx)($,{label:`W`,value:e.counts?.waiting,tone:`text-warning`}),(0,A.jsx)($,{label:`A`,value:e.counts?.active,tone:`text-blue-400`}),(0,A.jsx)($,{label:`C`,value:e.counts?.completed,tone:`text-success`}),(0,A.jsx)($,{label:`F`,value:e.counts?.failed,tone:`text-danger`})]})]},e.name))})]}),(0,A.jsx)(en,{})]})}function en(){let{events:e,connected:n}=Xt();return(0,A.jsxs)(`div`,{className:`mt-8`,children:[(0,A.jsx)(tn,{title:`Recent Activity`,to:`/logs`}),(0,A.jsxs)(K,{padded:!1,children:[!n&&e.length>0&&(0,A.jsx)(`p`,{className:`border-b border-line px-5 py-2 text-xs text-warning`,children:`Event stream disconnected — reconnecting…`}),e.length===0?(0,A.jsx)(`p`,{className:`py-8 text-center text-sm text-faint`,children:n?`Waiting for live activity…`:`Connecting to the event stream…`}):(0,A.jsx)(`ul`,{className:`divide-y divide-line`,children:e.slice(0,8).map(e=>(0,A.jsxs)(`li`,{className:`flex items-center justify-between px-5 py-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:t(`size-2 rounded-full`,nn(e.status))}),(0,A.jsxs)(`div`,{className:`text-sm`,children:[(0,A.jsx)(`span`,{className:`font-mono font-medium text-fg`,children:e.queue||`—`}),(0,A.jsx)(`span`,{className:`text-faint`,children:` · `}),(0,A.jsx)(`span`,{className:`font-mono text-xs text-faint`,children:e.jobId?e.jobId.slice(0,8):`—`}),(0,A.jsx)(`span`,{className:`text-faint`,children:` · `}),(0,A.jsx)(`span`,{className:`capitalize text-muted`,children:e.status})]})]}),(0,A.jsx)(`span`,{className:`text-xs text-faint`,children:X(e.timestamp)})]},e.seq))})]})]})}function tn({title:e,to:t}){return(0,A.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:e}),(0,A.jsxs)(d,{to:t,className:`flex items-center gap-1 text-sm text-muted hover:text-fg`,children:[`View All `,(0,A.jsx)(Ue,{className:`size-3.5`})]})]})}function $({label:e,value:n,tone:r}){return(0,A.jsxs)(`span`,{children:[e,` `,(0,A.jsx)(`span`,{className:t(`tnum font-semibold`,r),children:n==null?`—`:Y(n)})]})}function nn(e){switch(e){case`completed`:return`bg-emerald-400`;case`failed`:return`bg-red-400`;case`active`:return`bg-blue-400`;case`waiting`:return`bg-amber-400`;default:return`bg-accent`}}function rn(){return(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 py-24 text-center`,children:[(0,A.jsx)(`div`,{className:`text-5xl font-bold text-faint`,children:`404`}),(0,A.jsx)(`p`,{className:`text-sm text-muted`,children:`This page does not exist.`}),(0,A.jsx)(d,{to:`/`,className:`rounded-lg border border-line bg-surface-2 px-4 py-2 text-sm font-medium text-fg hover:border-line-strong`,children:`Back to Overview`})]})}var an=(0,b.lazy)(()=>u(()=>import(`./AddJob-B6DB3nLS.js`).then(e=>({default:e.AddJob})),__vite__mapDeps([4,1,2,3]))),on=(0,b.lazy)(()=>u(()=>import(`./Benchmark-C6eJlf21.js`).then(e=>({default:e.Benchmark})),__vite__mapDeps([5,1,2,6,3,7,8]))),sn=(0,b.lazy)(()=>u(()=>import(`./BulkAddJobs-D5A-56qh.js`).then(e=>({default:e.BulkAddJobs})),__vite__mapDeps([9,1,2,3]))),cn=(0,b.lazy)(()=>u(()=>import(`./CronManager-DkpnKkUk.js`).then(e=>({default:e.CronManager})),__vite__mapDeps([10,1,2,3,11]))),ln=(0,b.lazy)(()=>u(()=>import(`./Database-BmdixnFB.js`).then(e=>({default:e.Database})),__vite__mapDeps([12,1,2,3,11,8]))),un=(0,b.lazy)(()=>u(()=>import(`./Diagnostics-DNCcEQZe.js`).then(e=>({default:e.Diagnostics})),__vite__mapDeps([13,1,2]))),dn=(0,b.lazy)(()=>u(()=>import(`./DlqControl-C0RX-JRF.js`).then(e=>({default:e.DlqControl})),__vite__mapDeps([14,1,2,3,11,8,15]))),fn=(0,b.lazy)(()=>u(()=>import(`./DlqPro-CkDrvA_m.js`).then(e=>({default:e.DlqPro})),__vite__mapDeps([16,1,2,3,11,15,17]))),pn=(0,b.lazy)(()=>u(()=>import(`./Flows-tVpaOy-A.js`).then(e=>({default:e.Flows})),__vite__mapDeps([18,1,2]))),mn=(0,b.lazy)(()=>u(()=>import(`./JobInspector-B6RmHnFF.js`).then(e=>({default:e.JobInspector})),__vite__mapDeps([19,1,2,3,8,15,20]))),hn=(0,b.lazy)(()=>u(()=>import(`./JobsPro-WiZ3UHGN.js`).then(e=>({default:e.JobsPro})),__vite__mapDeps([21,1,2,3,11,15,20]))),gn=(0,b.lazy)(()=>u(()=>import(`./LogsPro-Bf9Ihrkj.js`).then(e=>({default:e.LogsPro})),__vite__mapDeps([22,1,2,3,11,8]))),_n=(0,b.lazy)(()=>u(()=>import(`./McpServer-DZD7-dyS.js`).then(e=>({default:e.McpServer})),__vite__mapDeps([23,2,1,8]))),vn=(0,b.lazy)(()=>u(()=>import(`./MetricsPro-Bs-Rwic_.js`).then(e=>({default:e.MetricsPro})),__vite__mapDeps([24,1,2,11,7,25]))),yn=(0,b.lazy)(()=>u(()=>import(`./QueueControl-2x3FDkR9.js`).then(e=>({default:e.QueueControl})),__vite__mapDeps([26,1,2,3,27]))),bn=(0,b.lazy)(()=>u(()=>import(`./QueueDetailPro-CnuNbKyk.js`).then(e=>({default:e.QueueDetailPro})),__vite__mapDeps([28,1,2,7,25,27,3]))),xn=(0,b.lazy)(()=>u(()=>import(`./QueuesOverview-BB8UL0nT.js`).then(e=>({default:e.QueuesOverview})),__vite__mapDeps([29,1,2,11,17]))),Sn=(0,b.lazy)(()=>u(()=>import(`./S3BackupPro-CoSFg6KF.js`).then(e=>({default:e.S3BackupPro})),__vite__mapDeps([30,1,2,6,3]))),Cn=(0,b.lazy)(()=>u(()=>import(`./ServerControl-DcP14j8m.js`).then(e=>({default:e.ServerControl})),__vite__mapDeps([31,1,2,3,8]))),wn=(0,b.lazy)(()=>u(()=>import(`./UsagePro-Cre49W5i.js`).then(e=>({default:e.UsagePro})),__vite__mapDeps([32,2,1]))),Tn=(0,b.lazy)(()=>u(()=>import(`./Webhooks-C0ByRD8k.js`).then(e=>({default:e.Webhooks})),__vite__mapDeps([33,1,2,3,11]))),En=(0,b.lazy)(()=>u(()=>import(`./WorkersPro-DgjEEM9Y.js`).then(e=>({default:e.WorkersPro})),__vite__mapDeps([34,1,2]))),Dn=(0,b.lazy)(()=>u(()=>import(`./Alerts-CWgn7JKK.js`).then(e=>({default:e.Alerts})),__vite__mapDeps([35,1,2,3]))),On=(0,b.lazy)(()=>u(()=>import(`./Cron-D8Cl1VQg.js`).then(e=>({default:e.Cron})),__vite__mapDeps([36,1,2,11]))),kn=(0,b.lazy)(()=>u(()=>import(`./Dlq-ChFKsJwc.js`).then(e=>({default:e.Dlq})),__vite__mapDeps([37,1,2,3,11]))),An=(0,b.lazy)(()=>u(()=>import(`./Jobs-CBoU-CeR.js`).then(e=>({default:e.Jobs})),__vite__mapDeps([38,1,2,3]))),jn=(0,b.lazy)(()=>u(()=>import(`./Logs-BWq4h_tj.js`).then(e=>({default:e.Logs})),__vite__mapDeps([39,1,2,3,11]))),Mn=(0,b.lazy)(()=>u(()=>import(`./Metrics-Cu1CHLHF.js`).then(e=>({default:e.Metrics})),__vite__mapDeps([40,2,1]))),Nn=(0,b.lazy)(()=>u(()=>import(`./Overview-BSqH2VRL.js`).then(e=>({default:e.Overview})),__vite__mapDeps([41,2,1]))),Pn=(0,b.lazy)(()=>u(()=>import(`./QueueDetail-Nfc8Zu5b.js`).then(e=>({default:e.QueueDetail})),__vite__mapDeps([42,1,2,3]))),Fn=(0,b.lazy)(()=>u(()=>import(`./Queues-JsB6NujG.js`).then(e=>({default:e.Queues})),__vite__mapDeps([43,1,2,11]))),In=(0,b.lazy)(()=>u(()=>import(`./S3Backup-CLizitSQ.js`).then(e=>({default:e.S3Backup})),__vite__mapDeps([44,2,1]))),Ln=(0,b.lazy)(()=>u(()=>import(`./Settings-Czzagq5p.js`).then(e=>({default:e.Settings})),__vite__mapDeps([45,1,2,6,3]))),Rn=(0,b.lazy)(()=>u(()=>import(`./Usage-DGv7A2XQ.js`).then(e=>({default:e.Usage})),__vite__mapDeps([46,2,1]))),zn=(0,b.lazy)(()=>u(()=>import(`./Workers-BB9o9IJ6.js`).then(e=>({default:e.Workers})),__vite__mapDeps([47,1,2,11])));function Bn(){return(0,A.jsx)(r,{children:(0,A.jsxs)(f,{element:(0,A.jsx)(Dt,{}),children:[(0,A.jsx)(f,{path:`/`,element:(0,A.jsx)($t,{})}),(0,A.jsx)(f,{path:`/overview-classic`,element:(0,A.jsx)(Nn,{})}),(0,A.jsx)(f,{path:`/queues`,element:(0,A.jsx)(xn,{})}),(0,A.jsx)(f,{path:`/queues-classic`,element:(0,A.jsx)(Fn,{})}),(0,A.jsx)(f,{path:`/queues/:name`,element:(0,A.jsx)(bn,{})}),(0,A.jsx)(f,{path:`/queues-classic/:name`,element:(0,A.jsx)(Pn,{})}),(0,A.jsx)(f,{path:`/jobs`,element:(0,A.jsx)(hn,{})}),(0,A.jsx)(f,{path:`/jobs-classic`,element:(0,A.jsx)(An,{})}),(0,A.jsx)(f,{path:`/dlq`,element:(0,A.jsx)(fn,{})}),(0,A.jsx)(f,{path:`/dlq-classic`,element:(0,A.jsx)(kn,{})}),(0,A.jsx)(f,{path:`/cron`,element:(0,A.jsx)(cn,{})}),(0,A.jsx)(f,{path:`/cron-classic`,element:(0,A.jsx)(On,{})}),(0,A.jsx)(f,{path:`/flows`,element:(0,A.jsx)(pn,{})}),(0,A.jsx)(f,{path:`/metrics`,element:(0,A.jsx)(vn,{})}),(0,A.jsx)(f,{path:`/metrics-classic`,element:(0,A.jsx)(Mn,{})}),(0,A.jsx)(f,{path:`/workers`,element:(0,A.jsx)(En,{})}),(0,A.jsx)(f,{path:`/workers-classic`,element:(0,A.jsx)(zn,{})}),(0,A.jsx)(f,{path:`/logs`,element:(0,A.jsx)(gn,{})}),(0,A.jsx)(f,{path:`/logs-classic`,element:(0,A.jsx)(jn,{})}),(0,A.jsx)(f,{path:`/server`,element:(0,A.jsx)(Cn,{})}),(0,A.jsx)(f,{path:`/add-job`,element:(0,A.jsx)(an,{})}),(0,A.jsx)(f,{path:`/jobs/bulk-add`,element:(0,A.jsx)(sn,{})}),(0,A.jsx)(f,{path:`/job`,element:(0,A.jsx)(mn,{})}),(0,A.jsx)(f,{path:`/queue-control`,element:(0,A.jsx)(yn,{})}),(0,A.jsx)(f,{path:`/cron-manager`,element:(0,A.jsx)(n,{to:`/cron`,replace:!0})}),(0,A.jsx)(f,{path:`/dlq-control`,element:(0,A.jsx)(dn,{})}),(0,A.jsx)(f,{path:`/webhooks`,element:(0,A.jsx)(Tn,{})}),(0,A.jsx)(f,{path:`/diagnostics`,element:(0,A.jsx)(un,{})}),(0,A.jsx)(f,{path:`/alerts`,element:(0,A.jsx)(Dn,{})}),(0,A.jsx)(f,{path:`/benchmark`,element:(0,A.jsx)(on,{})}),(0,A.jsx)(f,{path:`/database`,element:(0,A.jsx)(ln,{})}),(0,A.jsx)(f,{path:`/mcp`,element:(0,A.jsx)(_n,{})}),(0,A.jsx)(f,{path:`/usage`,element:(0,A.jsx)(wn,{})}),(0,A.jsx)(f,{path:`/usage-classic`,element:(0,A.jsx)(Rn,{})}),(0,A.jsx)(f,{path:`/s3`,element:(0,A.jsx)(Sn,{})}),(0,A.jsx)(f,{path:`/s3-classic`,element:(0,A.jsx)(In,{})}),(0,A.jsx)(f,{path:`/settings`,element:(0,A.jsx)(Ln,{})}),(0,A.jsx)(f,{path:`*`,element:(0,A.jsx)(rn,{})})]})})}be();var Vn=document.getElementById(`root`);if(!Vn)throw Error(`Root element #root not found`);function Hn(){(0,x.createRoot)(Vn).render((0,A.jsx)(b.StrictMode,{children:(0,A.jsx)(c,{basename:`/`,children:(0,A.jsx)(Bn,{})})}))}q()?u(()=>import(`./install-Bo6DRivH.js`).then(e=>e.installDemo()),[]).catch(()=>{}).finally(Hn):Hn();export{de as $,H as A,Be as B,K as C,G as D,ft as E,Ve as F,P as G,Ee as H,We as I,ze as J,Re as K,Ce as L,He as M,Ne as N,Ye as O,Pe as P,fe as Q,F as R,_t as S,dt as T,Ie as U,L as V,Fe as W,I as X,Le as Y,M as Z,At as _,Lt as a,S as at,vt as b,Y as c,Bt as d,w as et,zt as f,kt as g,jt as h,Z as i,re as it,Ue as j,Xe as k,Ft as l,J as m,It as n,k as nt,Rt as o,Ut as p,Oe as q,Wt as r,ae as rt,Vt as s,Xt as t,ce as tt,X as u,q as v,pt as w,ht as x,gt as y,Ke as z};
@@ -1 +1 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t}from"./react-vendor-B68RYDeC.js";import{D as n,tt as r}from"./index-DtMgfAiz.js";var i=e(t(),1);function a(e=60){let[t,a]=(0,i.useState)({push:[],complete:[],fail:[],depth:[]}),[o,s]=(0,i.useState)(null),c=(0,i.useRef)(!0),l=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{c.current=!0;let t=n(()=>typeof document<`u`&&document.hidden),i=async()=>{if(!l.current&&t()){l.current=!0;try{let t=await r.overview();if(!c.current)return;s(t);let n=(t.stats.waiting??0)+(t.stats.active??0)+(t.stats.delayed??0);a(r=>({push:[...r.push,t.throughput.pushPerSec].slice(-e),complete:[...r.complete,t.throughput.completePerSec].slice(-e),fail:[...r.fail,t.throughput.failPerSec].slice(-e),depth:[...r.depth,n].slice(-e)}))}catch{}finally{l.current=!1}}};i();let o=setInterval(i,1e3);return()=>{c.current=!1,clearInterval(o)}},[e]),{...t,latest:o}}function o(e){if(e.length<2)return{slope:0,label:`steady`,draining:!1};let t=e.length,n=(t-1)/2,r=e.reduce((e,t)=>e+t,0)/t,i=0,a=0;for(let o=0;o<t;o++)i+=(o-n)*(e[o]-r),a+=(o-n)**2;let o=a===0?0:i/a,s=o<-.05;return{slope:o,label:s?`draining`:o>.05?`accumulating`:`steady`,draining:s}}export{a as n,o as t};
1
+ import{r as e}from"./cn-CMFYpumL.js";import{h as t}from"./react-vendor-B68RYDeC.js";import{O as n,nt as r}from"./index-Dlr2PaZ6.js";var i=e(t(),1);function a(e=60){let[t,a]=(0,i.useState)({push:[],complete:[],fail:[],depth:[]}),[o,s]=(0,i.useState)(null),c=(0,i.useRef)(!0),l=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{c.current=!0;let t=n(()=>typeof document<`u`&&document.hidden),i=async()=>{if(!l.current&&t()){l.current=!0;try{let t=await r.overview();if(!c.current)return;s(t);let n=(t.stats.waiting??0)+(t.stats.active??0)+(t.stats.delayed??0);a(r=>({push:[...r.push,t.throughput.pushPerSec].slice(-e),complete:[...r.complete,t.throughput.completePerSec].slice(-e),fail:[...r.fail,t.throughput.failPerSec].slice(-e),depth:[...r.depth,n].slice(-e)}))}catch{}finally{l.current=!1}}};i();let o=setInterval(i,1e3);return()=>{c.current=!1,clearInterval(o)}},[e]),{...t,latest:o}}function o(e){if(e.length<2)return{slope:0,label:`steady`,draining:!1};let t=e.length,n=(t-1)/2,r=e.reduce((e,t)=>e+t,0)/t,i=0,a=0;for(let o=0;o<t;o++)i+=(o-n)*(e[o]-r),a+=(o-n)**2;let o=a===0?0:i/a,s=o<-.05;return{slope:o,label:s?`draining`:o>.05?`accumulating`:`steady`,draining:s}}export{a as n,o as t};
package/dist/index.html CHANGED
@@ -18,11 +18,11 @@
18
18
  </script>
19
19
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
20
20
  <title>bunqueue · dashboard (beta)</title>
21
- <script type="module" crossorigin src="/assets/index-DtMgfAiz.js"></script>
21
+ <script type="module" crossorigin src="/assets/index-Dlr2PaZ6.js"></script>
22
22
  <link rel="modulepreload" crossorigin href="/assets/cn-CMFYpumL.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/react-vendor-B68RYDeC.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/connectionStore-B-hNUqwK.js">
25
- <link rel="stylesheet" crossorigin href="/assets/index-C2XEM9ex.css">
25
+ <link rel="stylesheet" crossorigin href="/assets/index-BovL_it0.css">
26
26
  </head>
27
27
  <body>
28
28
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunqueue-dashboard",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "description": "Web dashboard for a bunqueue server (queues, jobs, DLQ, cron, metrics, workers, live activity). Run with `bunx bunqueue-dashboard` (requires Bun).",
6
6
  "bin": {
@@ -3,119 +3,119 @@
3
3
  import f0 from "../dist/.vite/manifest.json" with { type: 'file' };
4
4
  import f1 from "../dist/favicon.svg" with { type: 'file' };
5
5
  import f2 from "../dist/assets/form-C-zZyKfB.js" with { type: 'file' };
6
- import f3 from "../dist/assets/JobsPro-CHgECoqr.js" with { type: 'file' };
7
- import f4 from "../dist/assets/Flows-BgUrkVp9.js" with { type: 'file' };
8
- import f5 from "../dist/assets/ServerControl-BzpGcDMa.js" with { type: 'file' };
9
- import f6 from "../dist/assets/QueueControl-D62X3ifm.js" with { type: 'file' };
10
- import f7 from "../dist/assets/WorkersPro-C-Rl2JGa.js" with { type: 'file' };
11
- import f8 from "../dist/assets/Workers-RzwwzTJK.js" with { type: 'file' };
12
- import f9 from "../dist/assets/install-Bo6DRivH.js" with { type: 'file' };
13
- import f10 from "../dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2" with { type: 'file' };
14
- import f11 from "../dist/assets/QueueActions--MLQejui.js" with { type: 'file' };
15
- import f12 from "../dist/assets/QueueDetail-ZRFUt3mH.js" with { type: 'file' };
16
- import f13 from "../dist/assets/connectionStore-B-hNUqwK.js" with { type: 'file' };
17
- import f14 from "../dist/assets/Dlq-Dht-XE8I.js" with { type: 'file' };
18
- import f15 from "../dist/assets/AreaChart-lY-mk5E1.js" with { type: 'file' };
19
- import f16 from "../dist/assets/Database-Q_X_NR2I.js" with { type: 'file' };
20
- import f17 from "../dist/assets/CopyButton-BjMe8rqo.js" with { type: 'file' };
21
- import f18 from "../dist/assets/S3BackupPro-DD7fYduD.js" with { type: 'file' };
22
- import f19 from "../dist/assets/BulkAddJobs-DOlzFFNp.js" with { type: 'file' };
23
- import f20 from "../dist/assets/Logs-BXITESJ-.js" with { type: 'file' };
24
- import f21 from "../dist/assets/Overview-Bex4G7ch.js" with { type: 'file' };
25
- import f22 from "../dist/assets/UsagePro-VGYI-JGk.js" with { type: 'file' };
26
- import f23 from "../dist/assets/index-DtMgfAiz.js" with { type: 'file' };
6
+ import f3 from "../dist/assets/Alerts-CWgn7JKK.js" with { type: 'file' };
7
+ import f4 from "../dist/assets/Logs-BWq4h_tj.js" with { type: 'file' };
8
+ import f5 from "../dist/assets/AddJob-B6DB3nLS.js" with { type: 'file' };
9
+ import f6 from "../dist/assets/QueuesOverview-BB8UL0nT.js" with { type: 'file' };
10
+ import f7 from "../dist/assets/install-Bo6DRivH.js" with { type: 'file' };
11
+ import f8 from "../dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2" with { type: 'file' };
12
+ import f9 from "../dist/assets/connectionStore-B-hNUqwK.js" with { type: 'file' };
13
+ import f10 from "../dist/assets/Database-BmdixnFB.js" with { type: 'file' };
14
+ import f11 from "../dist/assets/QueueDetail-Nfc8Zu5b.js" with { type: 'file' };
15
+ import f12 from "../dist/assets/CopilotPanel-C4u8nJMr.js" with { type: 'file' };
16
+ import f13 from "../dist/assets/LogsPro-Bf9Ihrkj.js" with { type: 'file' };
17
+ import f14 from "../dist/assets/index-BovL_it0.css" with { type: 'file' };
18
+ import f15 from "../dist/assets/UsagePro-Cre49W5i.js" with { type: 'file' };
19
+ import f16 from "../dist/assets/BulkAddJobs-D5A-56qh.js" with { type: 'file' };
20
+ import f17 from "../dist/assets/Dlq-ChFKsJwc.js" with { type: 'file' };
21
+ import f18 from "../dist/assets/Cron-D8Cl1VQg.js" with { type: 'file' };
22
+ import f19 from "../dist/assets/AreaChart-Dl_9G6GH.js" with { type: 'file' };
23
+ import f20 from "../dist/assets/QueueDetailPro-CnuNbKyk.js" with { type: 'file' };
24
+ import f21 from "../dist/assets/ServerControl-DcP14j8m.js" with { type: 'file' };
25
+ import f22 from "../dist/assets/S3BackupPro-CoSFg6KF.js" with { type: 'file' };
26
+ import f23 from "../dist/assets/S3Backup-CLizitSQ.js" with { type: 'file' };
27
27
  import f24 from "../dist/assets/jobActions-CuOdMglt.js" with { type: 'file' };
28
- import f25 from "../dist/assets/index-C2XEM9ex.css" with { type: 'file' };
29
- import f26 from "../dist/assets/MetricsPro-4SzRtKMO.js" with { type: 'file' };
30
- import f27 from "../dist/assets/exportFile-tdUeW5m5.js" with { type: 'file' };
31
- import f28 from "../dist/assets/LogsPro-D0trm52t.js" with { type: 'file' };
32
- import f29 from "../dist/assets/QueueDetailPro-DY_XL6iK.js" with { type: 'file' };
33
- import f30 from "../dist/assets/CronManager-pAbkEMqi.js" with { type: 'file' };
34
- import f31 from "../dist/assets/CopilotPanel-05UREVXq.js" with { type: 'file' };
35
- import f32 from "../dist/assets/Metrics-BMGLcgiU.js" with { type: 'file' };
36
- import f33 from "../dist/assets/Diagnostics-DbncxLB8.js" with { type: 'file' };
37
- import f34 from "../dist/assets/cn-CMFYpumL.js" with { type: 'file' };
38
- import f35 from "../dist/assets/react-vendor-B68RYDeC.js" with { type: 'file' };
39
- import f36 from "../dist/assets/DlqControl-BdW51Eje.js" with { type: 'file' };
40
- import f37 from "../dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2" with { type: 'file' };
41
- import f38 from "../dist/assets/useThroughputSeries-PGVgpwVj.js" with { type: 'file' };
42
- import f39 from "../dist/assets/Cron-BVu2xGBX.js" with { type: 'file' };
43
- import f40 from "../dist/assets/promisePool-Daxkc1OB.js" with { type: 'file' };
44
- import f41 from "../dist/assets/Pagination-CTSsxJT4.js" with { type: 'file' };
45
- import f42 from "../dist/assets/Jobs-HgcrHTuA.js" with { type: 'file' };
46
- import f43 from "../dist/assets/McpServer-DaYWa4Es.js" with { type: 'file' };
47
- import f44 from "../dist/assets/Settings-BhNwQcDj.js" with { type: 'file' };
48
- import f45 from "../dist/assets/JobInspector-cr-oB9MB.js" with { type: 'file' };
49
- import f46 from "../dist/assets/DlqPro-Bc5dBrfL.js" with { type: 'file' };
50
- import f47 from "../dist/assets/Alerts-DHUQoHrO.js" with { type: 'file' };
28
+ import f25 from "../dist/assets/Usage-DGv7A2XQ.js" with { type: 'file' };
29
+ import f26 from "../dist/assets/useThroughputSeries-lWDIzQ4F.js" with { type: 'file' };
30
+ import f27 from "../dist/assets/JobInspector-B6RmHnFF.js" with { type: 'file' };
31
+ import f28 from "../dist/assets/exportFile-tdUeW5m5.js" with { type: 'file' };
32
+ import f29 from "../dist/assets/CronManager-DkpnKkUk.js" with { type: 'file' };
33
+ import f30 from "../dist/assets/Flows-tVpaOy-A.js" with { type: 'file' };
34
+ import f31 from "../dist/assets/cn-CMFYpumL.js" with { type: 'file' };
35
+ import f32 from "../dist/assets/react-vendor-B68RYDeC.js" with { type: 'file' };
36
+ import f33 from "../dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2" with { type: 'file' };
37
+ import f34 from "../dist/assets/DlqPro-CkDrvA_m.js" with { type: 'file' };
38
+ import f35 from "../dist/assets/Queues-JsB6NujG.js" with { type: 'file' };
39
+ import f36 from "../dist/assets/Settings-Czzagq5p.js" with { type: 'file' };
40
+ import f37 from "../dist/assets/promisePool-Daxkc1OB.js" with { type: 'file' };
41
+ import f38 from "../dist/assets/Workers-BB9o9IJ6.js" with { type: 'file' };
42
+ import f39 from "../dist/assets/JobsPro-WiZ3UHGN.js" with { type: 'file' };
43
+ import f40 from "../dist/assets/DlqControl-C0RX-JRF.js" with { type: 'file' };
44
+ import f41 from "../dist/assets/Overview-BSqH2VRL.js" with { type: 'file' };
45
+ import f42 from "../dist/assets/Jobs-CBoU-CeR.js" with { type: 'file' };
46
+ import f43 from "../dist/assets/MetricsPro-Bs-Rwic_.js" with { type: 'file' };
47
+ import f44 from "../dist/assets/QueueControl-2x3FDkR9.js" with { type: 'file' };
48
+ import f45 from "../dist/assets/CopyButton-B2gM7BeT.js" with { type: 'file' };
49
+ import f46 from "../dist/assets/Diagnostics-DNCcEQZe.js" with { type: 'file' };
50
+ import f47 from "../dist/assets/McpServer-DZD7-dyS.js" with { type: 'file' };
51
51
  import f48 from "../dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2" with { type: 'file' };
52
- import f49 from "../dist/assets/Benchmark-9UTONKIr.js" with { type: 'file' };
53
- import f50 from "../dist/assets/Queues-DkPMFOIm.js" with { type: 'file' };
54
- import f51 from "../dist/assets/S3Backup-DDpYyr9K.js" with { type: 'file' };
55
- import f52 from "../dist/assets/Webhooks-WT9fT_UK.js" with { type: 'file' };
52
+ import f49 from "../dist/assets/Webhooks-C0ByRD8k.js" with { type: 'file' };
53
+ import f50 from "../dist/assets/Benchmark-C6eJlf21.js" with { type: 'file' };
54
+ import f51 from "../dist/assets/Pagination-C-6yLcP3.js" with { type: 'file' };
55
+ import f52 from "../dist/assets/QueueActions-Dhy0KXjr.js" with { type: 'file' };
56
56
  import f53 from "../dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2" with { type: 'file' };
57
- import f54 from "../dist/assets/AddJob-C-p_fUxU.js" with { type: 'file' };
58
- import f55 from "../dist/assets/QueuesOverview-BJaVSLW9.js" with { type: 'file' };
59
- import f56 from "../dist/assets/Usage-C50S2SA2.js" with { type: 'file' };
57
+ import f54 from "../dist/assets/Metrics-Cu1CHLHF.js" with { type: 'file' };
58
+ import f55 from "../dist/assets/index-Dlr2PaZ6.js" with { type: 'file' };
59
+ import f56 from "../dist/assets/WorkersPro-DgjEEM9Y.js" with { type: 'file' };
60
60
  import f57 from "../dist/index.html" with { type: 'file' };
61
61
 
62
62
  export const ASSETS: Record<string, string> = {
63
63
  "/.vite/manifest.json": f0,
64
64
  "/favicon.svg": f1,
65
65
  "/assets/form-C-zZyKfB.js": f2,
66
- "/assets/JobsPro-CHgECoqr.js": f3,
67
- "/assets/Flows-BgUrkVp9.js": f4,
68
- "/assets/ServerControl-BzpGcDMa.js": f5,
69
- "/assets/QueueControl-D62X3ifm.js": f6,
70
- "/assets/WorkersPro-C-Rl2JGa.js": f7,
71
- "/assets/Workers-RzwwzTJK.js": f8,
72
- "/assets/install-Bo6DRivH.js": f9,
73
- "/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": f10,
74
- "/assets/QueueActions--MLQejui.js": f11,
75
- "/assets/QueueDetail-ZRFUt3mH.js": f12,
76
- "/assets/connectionStore-B-hNUqwK.js": f13,
77
- "/assets/Dlq-Dht-XE8I.js": f14,
78
- "/assets/AreaChart-lY-mk5E1.js": f15,
79
- "/assets/Database-Q_X_NR2I.js": f16,
80
- "/assets/CopyButton-BjMe8rqo.js": f17,
81
- "/assets/S3BackupPro-DD7fYduD.js": f18,
82
- "/assets/BulkAddJobs-DOlzFFNp.js": f19,
83
- "/assets/Logs-BXITESJ-.js": f20,
84
- "/assets/Overview-Bex4G7ch.js": f21,
85
- "/assets/UsagePro-VGYI-JGk.js": f22,
86
- "/assets/index-DtMgfAiz.js": f23,
66
+ "/assets/Alerts-CWgn7JKK.js": f3,
67
+ "/assets/Logs-BWq4h_tj.js": f4,
68
+ "/assets/AddJob-B6DB3nLS.js": f5,
69
+ "/assets/QueuesOverview-BB8UL0nT.js": f6,
70
+ "/assets/install-Bo6DRivH.js": f7,
71
+ "/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": f8,
72
+ "/assets/connectionStore-B-hNUqwK.js": f9,
73
+ "/assets/Database-BmdixnFB.js": f10,
74
+ "/assets/QueueDetail-Nfc8Zu5b.js": f11,
75
+ "/assets/CopilotPanel-C4u8nJMr.js": f12,
76
+ "/assets/LogsPro-Bf9Ihrkj.js": f13,
77
+ "/assets/index-BovL_it0.css": f14,
78
+ "/assets/UsagePro-Cre49W5i.js": f15,
79
+ "/assets/BulkAddJobs-D5A-56qh.js": f16,
80
+ "/assets/Dlq-ChFKsJwc.js": f17,
81
+ "/assets/Cron-D8Cl1VQg.js": f18,
82
+ "/assets/AreaChart-Dl_9G6GH.js": f19,
83
+ "/assets/QueueDetailPro-CnuNbKyk.js": f20,
84
+ "/assets/ServerControl-DcP14j8m.js": f21,
85
+ "/assets/S3BackupPro-CoSFg6KF.js": f22,
86
+ "/assets/S3Backup-CLizitSQ.js": f23,
87
87
  "/assets/jobActions-CuOdMglt.js": f24,
88
- "/assets/index-C2XEM9ex.css": f25,
89
- "/assets/MetricsPro-4SzRtKMO.js": f26,
90
- "/assets/exportFile-tdUeW5m5.js": f27,
91
- "/assets/LogsPro-D0trm52t.js": f28,
92
- "/assets/QueueDetailPro-DY_XL6iK.js": f29,
93
- "/assets/CronManager-pAbkEMqi.js": f30,
94
- "/assets/CopilotPanel-05UREVXq.js": f31,
95
- "/assets/Metrics-BMGLcgiU.js": f32,
96
- "/assets/Diagnostics-DbncxLB8.js": f33,
97
- "/assets/cn-CMFYpumL.js": f34,
98
- "/assets/react-vendor-B68RYDeC.js": f35,
99
- "/assets/DlqControl-BdW51Eje.js": f36,
100
- "/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2": f37,
101
- "/assets/useThroughputSeries-PGVgpwVj.js": f38,
102
- "/assets/Cron-BVu2xGBX.js": f39,
103
- "/assets/promisePool-Daxkc1OB.js": f40,
104
- "/assets/Pagination-CTSsxJT4.js": f41,
105
- "/assets/Jobs-HgcrHTuA.js": f42,
106
- "/assets/McpServer-DaYWa4Es.js": f43,
107
- "/assets/Settings-BhNwQcDj.js": f44,
108
- "/assets/JobInspector-cr-oB9MB.js": f45,
109
- "/assets/DlqPro-Bc5dBrfL.js": f46,
110
- "/assets/Alerts-DHUQoHrO.js": f47,
88
+ "/assets/Usage-DGv7A2XQ.js": f25,
89
+ "/assets/useThroughputSeries-lWDIzQ4F.js": f26,
90
+ "/assets/JobInspector-B6RmHnFF.js": f27,
91
+ "/assets/exportFile-tdUeW5m5.js": f28,
92
+ "/assets/CronManager-DkpnKkUk.js": f29,
93
+ "/assets/Flows-tVpaOy-A.js": f30,
94
+ "/assets/cn-CMFYpumL.js": f31,
95
+ "/assets/react-vendor-B68RYDeC.js": f32,
96
+ "/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2": f33,
97
+ "/assets/DlqPro-CkDrvA_m.js": f34,
98
+ "/assets/Queues-JsB6NujG.js": f35,
99
+ "/assets/Settings-Czzagq5p.js": f36,
100
+ "/assets/promisePool-Daxkc1OB.js": f37,
101
+ "/assets/Workers-BB9o9IJ6.js": f38,
102
+ "/assets/JobsPro-WiZ3UHGN.js": f39,
103
+ "/assets/DlqControl-C0RX-JRF.js": f40,
104
+ "/assets/Overview-BSqH2VRL.js": f41,
105
+ "/assets/Jobs-CBoU-CeR.js": f42,
106
+ "/assets/MetricsPro-Bs-Rwic_.js": f43,
107
+ "/assets/QueueControl-2x3FDkR9.js": f44,
108
+ "/assets/CopyButton-B2gM7BeT.js": f45,
109
+ "/assets/Diagnostics-DNCcEQZe.js": f46,
110
+ "/assets/McpServer-DZD7-dyS.js": f47,
111
111
  "/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": f48,
112
- "/assets/Benchmark-9UTONKIr.js": f49,
113
- "/assets/Queues-DkPMFOIm.js": f50,
114
- "/assets/S3Backup-DDpYyr9K.js": f51,
115
- "/assets/Webhooks-WT9fT_UK.js": f52,
112
+ "/assets/Webhooks-C0ByRD8k.js": f49,
113
+ "/assets/Benchmark-C6eJlf21.js": f50,
114
+ "/assets/Pagination-C-6yLcP3.js": f51,
115
+ "/assets/QueueActions-Dhy0KXjr.js": f52,
116
116
  "/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2": f53,
117
- "/assets/AddJob-C-p_fUxU.js": f54,
118
- "/assets/QueuesOverview-BJaVSLW9.js": f55,
119
- "/assets/Usage-C50S2SA2.js": f56,
117
+ "/assets/Metrics-Cu1CHLHF.js": f54,
118
+ "/assets/index-Dlr2PaZ6.js": f55,
119
+ "/assets/WorkersPro-DgjEEM9Y.js": f56,
120
120
  "/index.html": f57,
121
121
  };
@@ -1,3 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,l as n,r,t as i}from"./react-vendor-B68RYDeC.js";import{C as a,O as o,S as s,h as c,nt as l,tt as u,w as d}from"./index-DtMgfAiz.js";import{n as f,o as p,t as m}from"./form-C-zZyKfB.js";var h=e(t(),1),g=i(),_=e=>e==null?``:String(e);function v(){let{data:e}=o(()=>u.queues(),[],{intervalMs:3e4}),t=n().state?.clone,i=t?.options??{},[p,v]=(0,h.useState)(t?.queue??``),[b,x]=(0,h.useState)(t?.dataText??`{
2
- "hello": "world"
3
- }`),[S,C]=(0,h.useState)(`1`),[w,T]=(0,h.useState)(_(i.priority)),[E,D]=(0,h.useState)(``),[O,k]=(0,h.useState)(``),[A,j]=(0,h.useState)(_(i.maxAttempts)),[M,N]=(0,h.useState)(_(i.backoff)),[P,F]=(0,h.useState)(_(i.timeout)),[I,L]=(0,h.useState)(``),[R,z]=(0,h.useState)(i.removeOnComplete??!1),[B,V]=(0,h.useState)(i.removeOnFail??!1),[H,U]=(0,h.useState)(!1),[W,G]=(0,h.useState)(!1),[K,q]=(0,h.useState)(!1),[J,Y]=(0,h.useState)(null),[X,Z]=(0,h.useState)(null),Q=e=>{let t=Number(e);return e.trim()!==``&&Number.isFinite(t)?t:void 0},$=async()=>{if(Y(null),Z(null),!p.trim()){Y({ok:!1,msg:`Choose a queue`});return}let e;try{e=JSON.parse(b)}catch(e){Z(`Invalid JSON: ${e.message}`);return}let t=Q(E);if(O.trim()){let e=new Date(O).getTime();if(!Number.isFinite(e)){Y({ok:!1,msg:`Run at is not a valid date/time`});return}t=Math.max(0,e-Date.now())}let n={data:e,priority:Q(w),delay:t,maxAttempts:Q(A),backoff:Q(M),timeout:Q(P),jobId:I.trim()||void 0,removeOnComplete:R||void 0,removeOnFail:B||void 0,durable:H||void 0,lifo:W||void 0},r=Q(S)??1;if(!Number.isInteger(r)||r<1){Y({ok:!1,msg:`Count must be an integer of at least 1`});return}if(r>1e4){Y({ok:!1,msg:`Count must be 10000 or fewer`});return}q(!0);try{if(r===1){let e=await u.addJob(p,n);Y({ok:!0,msg:`Created job ${e.id}`}),l.success(`Job created`,`${p} · ${e.id}`)}else{let e=await u.addJobsBulk(p,Array.from({length:r},()=>n)),t=new Set(e.ids).size;Y({ok:!0,msg:`Created ${t} job${t===1?``:`s`}`}),l.success(`Created ${t} job${t===1?``:`s`}`,`in ${p}`)}}catch(e){Y({ok:!1,msg:e.message}),l.error(`Add job failed`,e.message)}finally{q(!1)}};return(0,g.jsxs)(`div`,{children:[(0,g.jsx)(c,{title:`Add Job`,description:`Enqueue a job with full options.`,actions:(0,g.jsx)(r,{to:`/jobs/bulk-add`,className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:`Bulk import`})}),t&&(0,g.jsx)(`div`,{className:`mb-4 flex items-center gap-2 rounded-lg border border-accent/30 bg-accent/[0.06] px-4 py-2 text-sm text-accent`,children:`Pre-filled from an existing job. Review the data and options, then enqueue a fresh job.`}),(0,g.jsxs)(`form`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,onSubmit:e=>{e.preventDefault(),$()},children:[(0,g.jsxs)(s,{children:[(0,g.jsx)(a,{title:`Job`}),(0,g.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,g.jsxs)(m,{label:`Queue`,children:[(0,g.jsx)(f,{list:`queue-options`,value:p,onChange:e=>v(e.target.value),placeholder:`queue name (existing or new)`}),(0,g.jsx)(`datalist`,{id:`queue-options`,children:(e?.queues??[]).map(e=>(0,g.jsx)(`option`,{value:e.name},e.name))})]}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(m,{label:`Data (JSON)`,children:(0,g.jsx)(`textarea`,{value:b,onChange:e=>x(e.target.value),spellCheck:!1,rows:7,className:`w-full rounded-lg border border-line bg-surface-2 p-3 font-mono text-sm text-fg focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})}),X&&(0,g.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:X})]})]})]}),(0,g.jsxs)(s,{children:[(0,g.jsx)(a,{title:`Options`}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,g.jsx)(m,{label:`Priority`,children:(0,g.jsx)(f,{type:`number`,value:w,onChange:e=>T(e.target.value),placeholder:`0`})}),(0,g.jsx)(m,{label:`Delay (ms)`,children:(0,g.jsx)(f,{type:`number`,min:0,value:E,onChange:e=>D(e.target.value),placeholder:`0`,disabled:O.trim()!==``})}),(0,g.jsx)(m,{label:`Run at`,hint:O.trim()?`Overrides Delay — derived from this time.`:void 0,children:(0,g.jsx)(f,{type:`datetime-local`,value:O,onChange:e=>k(e.target.value)})}),(0,g.jsx)(m,{label:`Max attempts`,children:(0,g.jsx)(f,{type:`number`,min:1,value:A,onChange:e=>j(e.target.value),placeholder:`3`})}),(0,g.jsx)(m,{label:`Backoff (ms)`,children:(0,g.jsx)(f,{type:`number`,min:0,value:M,onChange:e=>N(e.target.value),placeholder:`1000`})}),(0,g.jsx)(m,{label:`Timeout (ms)`,children:(0,g.jsx)(f,{type:`number`,min:0,value:P,onChange:e=>F(e.target.value),placeholder:`—`})}),(0,g.jsx)(m,{label:`Custom job ID`,children:(0,g.jsx)(f,{value:I,onChange:e=>L(e.target.value),placeholder:`idempotency key`})})]}),(0,g.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-6`,children:[(0,g.jsx)(y,{label:`removeOnComplete`,checked:R,onChange:z}),(0,g.jsx)(y,{label:`removeOnFail`,checked:B,onChange:V}),(0,g.jsx)(y,{label:`durable`,checked:H,onChange:U}),(0,g.jsx)(y,{label:`lifo`,checked:W,onChange:G})]})]}),(0,g.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 lg:col-span-2`,children:[(0,g.jsx)(`div`,{className:`w-28`,children:(0,g.jsx)(m,{label:`Count`,children:(0,g.jsx)(f,{type:`number`,min:1,value:S,onChange:e=>C(e.target.value)})})}),(0,g.jsx)(d,{type:`submit`,variant:`accent`,disabled:K,children:K?`Adding…`:`Add job`}),J&&(0,g.jsx)(`span`,{className:J.ok?`text-sm text-success`:`text-sm text-danger`,children:J.msg})]})]})]})}function y({label:e,checked:t,onChange:n}){return(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(p,{checked:t,onChange:n,label:e}),(0,g.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e})]})}export{v as AddJob};
@@ -1 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{J as r,Q as i,S as a,T as o,Z as s,h as c,it as l,j as u,rt as d,u as f,w as p,y as m}from"./index-DtMgfAiz.js";import{a as h,n as g,o as _,t as v}from"./form-C-zZyKfB.js";var y=e(t(),1),b=n(),x=[`email`,`webhook`,`slack`],S=Object.keys(d),C=[`>=`,`>`,`<=`,`<`];function w(){return typeof Notification>`u`?`unsupported`:Notification.permission}function T(){let{channels:e,rules:t,addChannel:n,removeChannel:h,addRule:g,removeRule:v,toggleRule:x}=l(),S=i(e=>e.breaching),[C,T]=(0,y.useState)(!1),[O,k]=(0,y.useState)(w);return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(c,{title:`Alerts`,description:`Threshold rules evaluated live in your browser.`,live:!0,actions:(0,b.jsxs)(b.Fragment,{children:[O===`granted`?(0,b.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm text-success`,children:[(0,b.jsx)(u,{className:`size-4`}),` Desktop alerts on`]}):O===`unsupported`?(0,b.jsx)(`span`,{className:`text-sm text-faint`,children:`Notifications unsupported`}):(0,b.jsx)(p,{size:`sm`,onClick:async()=>{k(await s())},children:`Enable desktop notifications`}),(0,b.jsx)(p,{variant:`accent`,size:`sm`,onClick:()=>T(e=>!e),children:`+ Create Alert Rule`})]})}),(0,b.jsx)(`div`,{className:`mb-6 rounded-lg border border-amber-500/20 bg-amber-500/5 px-4 py-3 text-sm text-amber-400/90`,children:`Rules are evaluated in this browser while a tab is open (even backgrounded), raising an in-app toast and — if enabled — a desktop notification. bunqueue OSS has no alerting backend, so email/webhook/slack delivery still needs your own monitoring or hosted bunqueue Cloud.`}),(0,b.jsxs)(`section`,{className:`mb-8`,children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Triggered Alerts`}),S.length===0?(0,b.jsx)(m,{icon:(0,b.jsx)(u,{}),title:`No triggered alerts`,hint:t.some(e=>e.enabled)?`All enabled rules are within their thresholds.`:`No enabled rules yet. Create one below.`}):(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-danger/30 bg-red-500/5`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Rule`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Condition`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,b.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Current`}),(0,b.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Since`})]})}),(0,b.jsx)(`tbody`,{children:S.map(e=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,b.jsx)(`td`,{className:`px-5 py-3 font-medium text-danger`,children:e.ruleName}),(0,b.jsxs)(`td`,{className:`px-5 py-3 text-muted`,children:[e.metricLabel,` `,e.operator,` `,(0,b.jsx)(`span`,{className:`font-semibold text-fg`,children:e.threshold})]}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-muted`,children:e.queue||`All queues`}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right tnum font-semibold text-danger`,children:Math.round(e.value*100)/100}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:f(e.at)})]},e.ruleId))})]})})]}),(0,b.jsxs)(`section`,{className:`mb-8`,children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Notification Channels`}),(0,b.jsxs)(a,{children:[e.length===0?(0,b.jsx)(`p`,{className:`mb-4 text-sm text-faint`,children:`No channels yet. Add one below.`}):(0,b.jsx)(`ul`,{className:`mb-4 divide-y divide-line`,children:e.map(e=>(0,b.jsxs)(`li`,{className:`flex items-center justify-between py-2.5`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`text-sm font-medium capitalize text-fg`,children:e.type}),(0,b.jsx)(`div`,{className:`font-mono text-xs text-faint`,children:e.target})]}),(0,b.jsx)(o,{"aria-label":`Remove channel`,onClick:()=>h(e.id),children:(0,b.jsx)(r,{className:`size-3.5`})})]},e.id))}),(0,b.jsx)(E,{onAdd:n})]})]}),(0,b.jsxs)(`section`,{children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Alert Rules`}),C&&(0,b.jsx)(a,{className:`mb-4`,children:(0,b.jsx)(D,{onAdd:e=>{g(e),T(!1)}})}),t.length===0?(0,b.jsx)(m,{title:`No alert rules`,hint:`Create a rule to be notified when a threshold is crossed.`}):(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Rule`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Condition`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Channel`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,b.jsx)(`th`,{className:`w-12 px-5 py-3`})]})}),(0,b.jsx)(`tbody`,{children:t.map(e=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,b.jsx)(`td`,{className:`px-5 py-3 font-medium text-fg`,children:e.name}),(0,b.jsxs)(`td`,{className:`px-5 py-3 text-muted`,children:[d[e.metric],` `,e.operator,` `,(0,b.jsx)(`span`,{className:`font-semibold text-accent`,children:e.threshold})]}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-muted`,children:e.queue||`All queues`}),(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsx)(`span`,{className:`rounded-md bg-surface-2 px-2 py-0.5 text-xs capitalize text-muted`,children:e.channel})}),(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsx)(_,{checked:e.enabled,onChange:()=>x(e.id),label:`Enabled`})}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right`,children:(0,b.jsx)(o,{"aria-label":`Delete rule`,onClick:()=>v(e.id),children:(0,b.jsx)(r,{className:`size-3.5`})})})]},e.id))})]})})]})]})}function E({onAdd:e}){let[t,n]=(0,y.useState)(`email`),[r,i]=(0,y.useState)(``);return(0,b.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,b.jsx)(`div`,{className:`w-36`,children:(0,b.jsx)(v,{label:`Type`,children:(0,b.jsx)(h,{value:t,onChange:e=>n(e.target.value),children:x.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})})}),(0,b.jsx)(`div`,{className:`min-w-56 flex-1`,children:(0,b.jsx)(v,{label:t===`email`?`Email address`:`URL`,children:(0,b.jsx)(g,{value:r,onChange:e=>i(e.target.value),placeholder:t===`email`?`ops@example.com`:`https://hooks…`})})}),(0,b.jsx)(p,{variant:`accent`,disabled:!r,onClick:()=>{e(t,r),i(``)},children:`Add channel`})]})}function D({onAdd:e}){let[t,n]=(0,y.useState)(``),[r,i]=(0,y.useState)(`error_rate`),[a,o]=(0,y.useState)(`>=`),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(``),[f,m]=(0,y.useState)(`email`);return(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-6`,children:[(0,b.jsx)(v,{label:`Name`,children:(0,b.jsx)(g,{value:t,onChange:e=>n(e.target.value),placeholder:`High error rate`})}),(0,b.jsx)(v,{label:`Metric`,children:(0,b.jsx)(h,{value:r,onChange:e=>i(e.target.value),children:S.map(e=>(0,b.jsx)(`option`,{value:e,children:d[e]},e))})}),(0,b.jsx)(v,{label:`Operator`,children:(0,b.jsx)(h,{value:a,onChange:e=>o(e.target.value),children:C.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),(0,b.jsx)(v,{label:`Threshold`,children:(0,b.jsx)(g,{type:`number`,value:s,onChange:e=>c(e.target.value),placeholder:`55`})}),(0,b.jsx)(v,{label:`Queue (optional)`,children:(0,b.jsx)(g,{value:l,onChange:e=>u(e.target.value),placeholder:`All queues`})}),(0,b.jsx)(v,{label:`Channel`,children:(0,b.jsx)(h,{value:f,onChange:e=>m(e.target.value),children:x.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),(0,b.jsx)(`div`,{className:`col-span-full`,children:(0,b.jsx)(p,{variant:`accent`,disabled:!t||!s,onClick:()=>e({name:t,metric:r,operator:a,threshold:Number(s),queue:l,channel:f,enabled:!0}),children:`Save rule`})})]})}export{T as Alerts};
@@ -1 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";var r=e(t(),1),i=n();function a({series:e,height:t=180,xLabels:n,ariaLabel:a=`throughput chart`}){let o=(0,r.useId)().replace(/:/g,``),s=t,c=e=>Number.isFinite(e)?e:0,l=Math.max(1,...e.map(e=>e.points.length)),u=Math.max(1,...e.flatMap(e=>e.points.map(c))),d=e=>l<=1?0:e/(l-1)*600,f=e=>s-10-c(e)/u*(s-20),p=[0,.25,.5,.75,1].map(e=>10+e*(s-20));return(0,i.jsxs)(`div`,{className:`w-full`,children:[(0,i.jsxs)(`svg`,{viewBox:`0 0 600 ${s}`,preserveAspectRatio:`none`,className:`w-full`,style:{height:t},role:`img`,"aria-label":a,children:[(0,i.jsx)(`defs`,{children:e.map((e,t)=>(0,i.jsxs)(`linearGradient`,{id:`${o}-g${t}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:e.color,stopOpacity:`0.28`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:e.color,stopOpacity:`0`})]},e.label))}),p.map(e=>(0,i.jsx)(`line`,{x1:`0`,y1:e,x2:600,y2:e,stroke:`var(--line)`,strokeWidth:`1`},e)),e.map((e,t)=>{if(e.points.length===0)return null;let n=e.points.length===1?`M0,${f(e.points[0])} L600,${f(e.points[0])}`:e.points.map((e,t)=>`${t===0?`M`:`L`}${d(t)},${f(e)}`).join(` `),r=e.points.length===1?`${n} L600,${s} L0,${s} Z`:`${n} L${d(e.points.length-1)},${s} L${d(0)},${s} Z`;return(0,i.jsxs)(`g`,{children:[e.area&&(0,i.jsx)(`path`,{d:r,fill:`url(#${o}-g${t})`}),(0,i.jsx)(`path`,{d:n,fill:`none`,stroke:e.color,strokeWidth:`2`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})]},e.label)})]}),n&&(0,i.jsx)(`div`,{className:`mt-1 flex justify-between px-1 font-mono text-[10px] text-faint`,children:n.map(e=>(0,i.jsx)(`span`,{children:e},e))})]})}export{a as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{C as i,H as a,O as o,S as s,U as c,c as l,h as u,m as d,r as f,s as p,tt as m,w as h}from"./index-DtMgfAiz.js";import{i as g,n as _,o as v,t as y}from"./form-C-zZyKfB.js";import{t as b}from"./AreaChart-lY-mk5E1.js";import{t as x}from"./CopyButton-BjMe8rqo.js";var S=e(n(),1),C={total:1e6,batch:5e3,producers:64,payload:65536,workers:64,workerBatch:1e3,processMs:6e4,durationS:600},w={queue:`benchmark`,mode:`count`,total:5e3,durationS:30,batch:100,producers:4,payload:128,workers:4,workerBatch:100,processMs:5,durable:!1,removeOnComplete:!0},T={Smoke:{mode:`count`,total:200,batch:50,producers:2,workers:1,workerBatch:50,processMs:0},Standard:{mode:`count`,total:5e3,batch:100,producers:4,workers:4,workerBatch:100,processMs:5},Stress:{mode:`count`,total:5e4,batch:500,producers:16,workers:16,workerBatch:200,processMs:0},Soak:{mode:`duration`,durationS:30,batch:100,producers:4,workers:8,workerBatch:100,processMs:10}},E=(e,t,n)=>Number.isFinite(e)?Math.max(t,Math.min(n,Math.floor(e))):t,D=(e,t)=>e.length?e[Math.min(e.length-1,Math.floor(t/100*e.length))]:0,O=(e,t,n,r,i)=>Array.from({length:t},(t,a)=>({data:{i:e+a,blob:n},durable:r,removeOnComplete:i})),k=e=>new Promise(t=>setTimeout(t,e)),A=async(e,t)=>{let n=performance.now()+e;for(;t()&&performance.now()<n;)await k(Math.min(100,Math.max(0,n-performance.now())))},j=e=>e instanceof Error?e.message:String(e),M=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:`${Math.round(e)}`,N=r();function P({history:e,onClear:t}){if(!e.length)return null;let n=JSON.stringify(e,null,2);return(0,N.jsxs)(s,{padded:!1,className:`mt-6 overflow-hidden`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-5 py-3`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Run history`}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(x,{value:n}),(0,N.jsx)(h,{size:`sm`,variant:`ghost`,onClick:()=>{let e=new Blob([n],{type:`application/json`}),t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`benchmark-history-${Date.now()}.json`,r.click(),URL.revokeObjectURL(t)},children:`Export JSON`}),(0,N.jsx)(h,{size:`sm`,variant:`ghost`,onClick:t,children:`Clear`})]})]}),(0,N.jsx)(`div`,{className:`overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,N.jsx)(`th`,{className:`px-5 py-2 font-medium`,children:`Mode`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Prod`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Wkr`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Pushed`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Push/s`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done/s`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`p95`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Dur`})]})}),(0,N.jsx)(`tbody`,{children:e.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,N.jsx)(`td`,{className:`px-5 py-2 capitalize text-muted`,children:e.mode}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.producers}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.workers}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-fg`,children:l(e.pushed)}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:l(e.completed)}),(0,N.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-accent`,children:[M(e.pushPerSec),`/s`]}),(0,N.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:[M(e.donePerSec),`/s`]}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:p(e.p95)}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:p(e.durationMs)})]},e.id))})]})})]})}var F={pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,elapsedMs:0,pushPerSec:0,donePerSec:0,activeWorkers:0,pushSeries:[],doneSeries:[],etaMs:null,error:null},I=()=>({pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,assigned:0,startedAt:0,pushLat:[],activeWorkers:0,error:null,lastAt:0,lastPushed:0,lastDone:0,pushSeries:[],doneSeries:[]}),L=0;function R(){let[e,t]=(0,S.useState)(`idle`),[n,r]=(0,S.useState)(F),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(!1),d=(0,S.useRef)(!1),f=(0,S.useRef)(!1),p=(0,S.useRef)(null),h=(0,S.useRef)(`idle`);h.current=e;let g=(0,S.useRef)(I());return(0,S.useEffect)(()=>()=>{u.current=!0},[]),(0,S.useEffect)(()=>{if(e!==`running`&&e!==`draining`)return;let t=setInterval(()=>{let e=g.current,t=performance.now(),n=t-e.startedAt,i=(t-e.lastAt)/1e3,a=i>0?Math.max(0,(e.pushed-e.lastPushed)/i):0,o=i>0?Math.max(0,(e.completed-e.lastDone)/i):0;e.lastAt=t,e.lastPushed=e.pushed,e.lastDone=e.completed,e.pushSeries=[...e.pushSeries,a].slice(-60),e.doneSeries=[...e.doneSeries,o].slice(-60);let s=null,c=p.current;if(c&&c.mode===`count`){let t=E(c.total,1,C.total);if(h.current===`draining`){let r=e.doneSeries.slice(-10),i=r.length?r.reduce((e,t)=>e+t,0)/r.length:0;i<=0&&n>0&&(i=e.completed/(n/1e3)),i>0&&(s=Math.max(0,t-e.completed)/i*1e3)}else a>0&&(s=Math.max(0,t-e.pushed)/a*1e3)}else c&&c.mode===`duration`&&(s=Math.max(0,E(c.durationS,1,C.durationS)*1e3-n));r({pushed:e.pushed,completed:e.completed,pushFailed:e.pushFailed,ackFailed:e.ackFailed,bytes:e.bytes,elapsedMs:n,pushPerSec:a,donePerSec:o,activeWorkers:e.activeWorkers,pushSeries:e.pushSeries,doneSeries:e.doneSeries,etaMs:s,error:e.error})},200);return()=>clearInterval(t)},[e]),{phase:e,live:n,summary:i,history:o,runCfg:c,run:async e=>{if(!d.current){d.current=!0;try{a(null);let n=e.queue.trim();if(!n){r({...F,error:`Queue name is required.`}),t(`error`);return}try{await m.overview()}catch(e){r({...F,error:`Server unreachable — start it on the Server page first. (${j(e)})`}),t(`error`);return}let i=E(e.total,1,C.total),o=E(e.durationS,1,C.durationS)*1e3,c=E(e.batch,1,C.batch),d=E(e.producers,e.mode===`duration`?0:1,C.producers),_=E(e.payload,0,C.payload),v=E(e.workers,0,C.workers),y=E(e.workerBatch,1,C.workerBatch),b=E(e.processMs,0,C.processMs);u.current=!1,f.current=!1,p.current=e,l(e),g.current=I(),g.current.startedAt=performance.now(),g.current.lastAt=performance.now(),r({...F}),t(`running`);let x=`x`.repeat(_),S=performance.now()+o,w=async()=>{for(;!u.current;){let t;if(e.mode===`count`){if(g.current.assigned>=i)break;t=Math.min(c,i-g.current.assigned)}else{if(performance.now()>=S)break;t=c}let r=g.current.assigned;g.current.assigned+=t;let a=O(r,t,x,e.durable,e.removeOnComplete),o=performance.now();try{await m.addJobsBulk(n,a),g.current.pushed+=t,g.current.bytes+=t*_}catch(e){g.current.pushFailed+=t,g.current.error??=j(e)}g.current.pushLat.push(performance.now()-o)}},T=async()=>{for(;!u.current&&!(e.mode===`duration`&&performance.now()>=S||e.mode===`count`&&g.current.completed>=i);){g.current.activeWorkers++;let t=[];try{try{t=(await m.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=j(e)}if(t.length>0){b>0&&await A(b,()=>!u.current);try{await m.ackBatch(t.map(e=>e.id)),g.current.completed+=t.length}catch(e){g.current.ackFailed+=t.length,g.current.error??=j(e)}}}finally{g.current.activeWorkers--}if(t.length===0){if(e.mode===`count`&&f.current)break;await k(50)}}},M=Array.from({length:d},w),N=Array.from({length:v},T),P=Promise.all(M).then(()=>{f.current=!0,!u.current&&e.mode===`count`&&v>0&&h.current===`running`&&t(`draining`)});await Promise.all([P,...N]);let R=g.current,z=performance.now()-R.startedAt,B=z/1e3||1,V=[...R.pushLat].sort((e,t)=>e-t),H={pushed:R.pushed,completed:R.completed,pushFailed:R.pushFailed,ackFailed:R.ackFailed,bytes:R.bytes,durationMs:z,pushPerSec:R.pushed/B,donePerSec:R.completed/B,mbPerSec:R.bytes/B,avg:V.length?V.reduce((e,t)=>e+t,0)/V.length:0,p50:D(V,50),p95:D(V,95),p99:D(V,99),max:V.length?V[V.length-1]:0,error:R.error};a(H),r(e=>({...e,pushed:R.pushed,completed:R.completed,elapsedMs:z,pushPerSec:0,donePerSec:0,activeWorkers:0,etaMs:0})),s(t=>[{...H,id:++L,at:Date.now(),mode:e.mode,producers:d,workers:v},...t].slice(0,12)),t(u.current?`stopped`:`done`)}finally{d.current=!1}}},stop:()=>{u.current=!0,(h.current===`running`||h.current===`draining`)&&t(`stopping`)},reset:()=>{u.current=!0,a(null),r(F),t(`idle`)},clearHistory:()=>s([])}}var z=[`count`,`duration`],B=[`total`,`durationS`,`batch`,`producers`,`payload`,`workers`,`workerBatch`,`processMs`],V=e=>({...e,total:String(e.total),durationS:String(e.durationS),batch:String(e.batch),producers:String(e.producers),payload:String(e.payload),workers:String(e.workers),workerBatch:String(e.workerBatch),processMs:String(e.processMs)}),H=e=>({...e,total:Number(e.total),durationS:Number(e.durationS),batch:Number(e.batch),producers:Number(e.producers),payload:Number(e.payload),workers:Number(e.workers),workerBatch:Number(e.workerBatch),processMs:Number(e.processMs)});function U(){let[e,n]=(0,S.useState)(()=>V(w)),r=R(),{phase:x,live:D,summary:O,history:k}=r,A=x===`running`||x===`draining`||x===`stopping`,j=(e,t)=>n(n=>({...n,[e]:t})),F=e=>t=>j(e,t.target.value),I=e=>n(t=>{let n={...t};for(let[t,r]of Object.entries(e))n[t]=B.includes(t)?String(r):r;return n}),[L,U]=(0,S.useState)(w.queue);(0,S.useEffect)(()=>{let t=setTimeout(()=>U(e.queue.trim()||w.queue),400);return()=>clearTimeout(t)},[e.queue]);let{data:ee,error:te}=o(()=>m.counts(L),[L],{intervalMs:1e3}),K=ee?.counts??null,[q,J]=(0,S.useState)(!1),[Y,X]=(0,S.useState)(null),ne=async()=>{let t=e.queue.trim();if(!(q||!t||!window.confirm(`Remove benchmark jobs from "${t}"?`))){J(!0),X(null);try{let e=null;for(let n of[`waiting`,`completed`,`failed`,`delayed`])try{await m.clean(t,{state:n,limit:C.total})}catch(t){e=t.message}let n=await m.counts(t).catch(t=>(e=t.message,null));X(n==null?{error:e??`server unreachable — could not verify`}:{remaining:n.counts?.active??0})}finally{J(!1)}}},Z=r.runCfg??H(e),Q=E(Z.total,1,C.total),$=E(Z.workers,0,C.workers),re=Z.mode===`count`&&(A||O)?Math.min(100,D.pushed/Q*100):0,ie=Z.mode===`count`&&(A||O)?Math.min(100,D.completed/Q*100):0,ae=Z.mode===`duration`?Math.min(100,D.elapsedMs/(E(Z.durationS,1,C.durationS)*1e3)*100):0,oe=x===`running`?Z.mode===`duration`?`Running…`:`Producing…`:x===`draining`?`Draining…`:x===`stopping`?`Stopping…`:x===`error`?`Error`:O?`Result`:`Ready`,se=(x===`running`||x===`draining`)&&D.etaMs!=null?D.etaMs>0?`ETA ${p(D.etaMs)}`:`finishing…`:x===`stopped`?`stopped early`:x===`done`?`complete`:``;return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(u,{title:`Benchmark`,description:`Drive real load against the server — producers bulk-enqueue jobs while simulated workers pull, process and ack them. Throughput is measured client-side; the queue genuinely fills and drains.`,actions:x===`stopping`?(0,N.jsxs)(h,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,N.jsx)(a,{className:`size-3.5`}),` Stopping…`]}):A?(0,N.jsxs)(h,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,N.jsx)(a,{className:`size-3.5`}),` Stop`]}):(0,N.jsxs)(h,{variant:`success`,size:`sm`,onClick:()=>r.run(H(e)),children:[(0,N.jsx)(c,{className:`size-3.5`}),` Run benchmark`]})}),D.error&&(0,N.jsx)(`div`,{className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-danger`,children:D.error}),(0,N.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-faint`,children:`Presets`}),Object.keys(T).map(e=>(0,N.jsx)(`button`,{type:`button`,disabled:A,onClick:()=>I(T[e]),className:`rounded-md border border-line bg-surface-2 px-2.5 py-1 text-xs text-muted transition-colors hover:border-line-strong hover:text-fg disabled:opacity-40`,children:e},e))]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(s,{className:`lg:col-span-1`,children:[(0,N.jsx)(i,{title:`Configuration`}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,N.jsx)(y,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,N.jsx)(_,{value:e.queue,disabled:A,onChange:e=>j(`queue`,e.target.value)})}),(0,N.jsx)(y,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,N.jsx)(g,{options:z,value:e.mode,onChange:e=>j(`mode`,e),disabled:A})}),e.mode===`count`?(0,N.jsx)(y,{label:`Total jobs`,hint:`max ${l(C.total)}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.total,value:e.total,disabled:A,onChange:F(`total`)})}):(0,N.jsx)(y,{label:`Duration (s)`,hint:`max ${C.durationS}s`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.durationS,value:e.durationS,disabled:A,onChange:F(`durationS`)})}),(0,N.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Producers`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,N.jsx)(y,{label:`Producers`,hint:`parallel, max ${C.producers}`,children:(0,N.jsx)(_,{type:`number`,min:e.mode===`duration`?0:1,max:C.producers,value:e.producers,disabled:A,onChange:F(`producers`)})}),(0,N.jsx)(y,{label:`Push batch`,hint:`jobs/req, max ${C.batch}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.batch,value:e.batch,disabled:A,onChange:F(`batch`)})}),(0,N.jsx)(y,{label:`Payload`,hint:`bytes/job, max ${l(C.payload)}`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.payload,value:e.payload,disabled:A,onChange:F(`payload`)})})]}),(0,N.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Workers (simulated)`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,N.jsx)(y,{label:`Workers`,hint:`0 = produce only, max ${C.workers}`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.workers,value:e.workers,disabled:A,onChange:F(`workers`)})}),(0,N.jsx)(y,{label:`Pull batch`,hint:`jobs/pull, max ${C.workerBatch}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.workerBatch,value:e.workerBatch,disabled:A,onChange:F(`workerBatch`)})}),(0,N.jsx)(y,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.processMs,value:e.processMs,disabled:A,onChange:F(`processMs`)})})]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,N.jsx)(v,{checked:e.durable,onChange:e=>j(`durable`,e),disabled:A}),(0,N.jsx)(`span`,{className:`text-sm text-muted`,children:`Durable (fsync each job)`})]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,N.jsx)(v,{checked:e.removeOnComplete,onChange:e=>j(`removeOnComplete`,e),disabled:A}),(0,N.jsx)(`span`,{className:`text-sm text-muted`,children:`Remove on complete`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 pt-1`,children:[(0,N.jsx)(h,{variant:`ghost`,size:`sm`,disabled:A||q,onClick:ne,children:q?`Cleaning…`:`Clean queue`}),Y&&(`error`in Y?(0,N.jsxs)(`span`,{className:`text-xs text-danger`,children:[`Clean unverified — `,Y.error]}):(0,N.jsx)(`span`,{className:t(`text-xs`,Y.remaining>0?`text-warning`:`text-success`),children:Y.remaining>0?`Cleaned — ${l(Y.remaining)} active job(s) remain (requeued after the stall timeout)`:`Cleaned — 0 jobs remain`}))]})]})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 lg:col-span-2`,children:[(0,N.jsxs)(s,{children:[(0,N.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:oe}),(0,N.jsx)(`span`,{className:`text-xs text-faint`,children:se})]}),(0,N.jsx)(W,{label:Z.mode===`duration`?`Elapsed`:`Produced`,pct:Z.mode===`duration`?ae:re,tone:`accent`}),$>0&&Z.mode===`count`&&(0,N.jsx)(W,{label:`Completed`,pct:ie,tone:`emerald`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,N.jsx)(d,{label:`Pushed`,value:l(D.pushed),tone:`accent`,compact:!0}),(0,N.jsx)(d,{label:`Completed`,value:l(D.completed),tone:`green`,compact:!0}),(0,N.jsx)(d,{label:`Push/sec`,value:M(D.pushPerSec),compact:!0}),(0,N.jsx)(d,{label:`Done/sec`,value:M(D.donePerSec),tone:`green`,compact:!0}),(0,N.jsx)(d,{label:`Elapsed`,value:p(D.elapsedMs),compact:!0}),(0,N.jsx)(d,{label:`Active workers`,value:`${D.activeWorkers}/${$}`,tone:`blue`,compact:!0}),(0,N.jsx)(d,{label:`Data`,value:f(O?.bytes??D.bytes),compact:!0}),(0,N.jsx)(d,{label:`Errors`,value:l((O?.pushFailed??D.pushFailed)+(O?.ackFailed??D.ackFailed)),tone:D.pushFailed+D.ackFailed?`red`:`default`,compact:!0})]})]}),(0,N.jsxs)(s,{children:[(0,N.jsx)(i,{title:`Throughput`}),(0,N.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Enqueue (client → server) vs completion (workers) per second`}),(0,N.jsx)(b,{series:[{label:`Push/sec`,color:`#38bdf8`,points:D.pushSeries,area:!0},{label:`Done/sec`,color:`#34d399`,points:D.doneSeries,area:!0}]}),(0,N.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 font-mono text-[11px] text-faint`,children:[(0,N.jsx)(G,{color:`#38bdf8`,label:`Push/sec`,value:D.pushPerSec}),(0,N.jsx)(G,{color:`#34d399`,label:`Done/sec`,value:D.donePerSec})]})]})]})]}),O&&(0,N.jsxs)(s,{className:`mt-6`,children:[(0,N.jsx)(i,{title:`Summary`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-4 xl:grid-cols-8`,children:[(0,N.jsx)(d,{label:`Pushed`,value:l(O.pushed),tone:`accent`,compact:!0}),(0,N.jsx)(d,{label:`Completed`,value:l(O.completed),tone:`green`,compact:!0}),(0,N.jsx)(d,{label:`Duration`,value:p(O.durationMs),compact:!0}),(0,N.jsx)(d,{label:`Avg push/s`,value:M(O.pushPerSec),tone:`accent`,compact:!0}),(0,N.jsx)(d,{label:`Avg done/s`,value:M(O.donePerSec),tone:`green`,compact:!0}),(0,N.jsx)(d,{label:`Data rate`,value:`${f(O.mbPerSec)}/s`,compact:!0}),(0,N.jsx)(d,{label:`Push p95`,value:p(O.p95),compact:!0}),(0,N.jsx)(d,{label:`Push p99`,value:p(O.p99),compact:!0})]}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,p(O.avg),` · p50 `,p(O.p50),` · p95`,` `,p(O.p95),` · p99 `,p(O.p99),` · max `,p(O.max),`.`,O.error?` First error: ${O.error}`:``]})]}),(0,N.jsxs)(s,{className:`mt-6`,children:[(0,N.jsx)(i,{title:`Server queue: ${L}`,action:te?(0,N.jsx)(`span`,{className:`text-xs font-medium text-warning`,children:`stale — server unreachable`}):void 0}),(0,N.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Live counts from the server (poll 1s).`}),K?(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-5`,children:[(0,N.jsx)(d,{label:`Waiting`,value:l(K.waiting??0),tone:`amber`,compact:!0}),(0,N.jsx)(d,{label:`Active`,value:l(K.active??0),tone:`blue`,compact:!0}),(0,N.jsx)(d,{label:`Completed`,value:l(K.completed??0),tone:`green`,compact:!0}),(0,N.jsx)(d,{label:`Failed`,value:l(K.failed??0),tone:K.failed?`red`:`default`,compact:!0}),(0,N.jsx)(d,{label:`Delayed`,value:l(K.delayed??0),compact:!0})]}):(0,N.jsx)(`p`,{className:`text-sm text-faint`,children:`No counts yet — waiting for the server to answer for this queue.`})]}),(0,N.jsx)(P,{history:k,onClear:r.clearHistory})]})}function W({label:e,pct:n,tone:r}){return(0,N.jsxs)(`div`,{className:`mb-2`,children:[(0,N.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] text-faint`,children:[(0,N.jsx)(`span`,{children:e}),(0,N.jsxs)(`span`,{className:`tnum`,children:[n.toFixed(0),`%`]})]}),(0,N.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,N.jsx)(`div`,{className:t(`h-full rounded-full transition-all`,r===`accent`?`bg-accent`:`bg-emerald-500`),style:{width:`${n}%`}})})]})}function G({color:e,label:t,value:n}){return(0,N.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,N.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:e}}),t,` `,(0,N.jsxs)(`span`,{className:`text-fg`,children:[M(n),`/s`]})]})}export{U as Benchmark};
@@ -1,5 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{C as r,O as i,S as a,h as o,nt as s,tt as c,w as l}from"./index-DtMgfAiz.js";import{i as u,n as d,t as f}from"./form-C-zZyKfB.js";var p=e(t(),1),m=n(),h=1e4,g=`[
2
- { "data": { "to": "a@example.com", "template": "welcome" }, "priority": 1 },
3
- { "data": { "to": "b@example.com", "template": "welcome" } }
4
- ]`,_=e=>{let t=Number(e);return e.trim()!==``&&Number.isFinite(t)?t:void 0},v=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,y=e=>typeof e==`boolean`?e:void 0,b=e=>typeof e==`string`&&e!==``?e:void 0;function x(e,t,n){if(n===`spec`&&e&&typeof e==`object`&&!Array.isArray(e)&&`data`in e){let n=e;return{data:n.data,priority:v(n.priority)??t.priority,delay:v(n.delay),maxAttempts:v(n.maxAttempts)??t.maxAttempts,backoff:v(n.backoff)??t.backoff,timeout:v(n.timeout)??t.timeout,jobId:b(n.jobId),removeOnComplete:y(n.removeOnComplete),removeOnFail:y(n.removeOnFail),durable:y(n.durable),lifo:y(n.lifo),ttl:v(n.ttl),uniqueKey:b(n.uniqueKey)}}return{data:e,...t}}var S=new Set([`data`,`priority`,`delay`,`maxAttempts`,`backoff`,`timeout`,`jobId`,`removeOnComplete`,`removeOnFail`,`durable`,`lifo`,`ttl`,`uniqueKey`]);function C(e){return e.some(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`data`in e&&Object.keys(e).some(e=>!S.has(e)))}function w(e){let t=e.trim();if(!t)return{items:[],error:null};try{let e=JSON.parse(t);return Array.isArray(e)?{items:e,error:null}:{items:[e],error:null}}catch{}let n=[],r=t.split(`
5
- `);for(let e=0;e<r.length;e++){let t=r[e].trim();if(t)try{n.push(JSON.parse(t))}catch(t){return{items:[],error:`Line ${e+1}: ${t.message}`}}}return{items:n,error:null}}function T(){let{data:e}=i(()=>c.queues(),[],{intervalMs:3e4}),[t,n]=(0,p.useState)(``),[v,y]=(0,p.useState)(``),[b,S]=(0,p.useState)(`spec`),[T,E]=(0,p.useState)(``),[D,O]=(0,p.useState)(``),[k,A]=(0,p.useState)(``),[j,M]=(0,p.useState)(``),[N,P]=(0,p.useState)(!1),[F,I]=(0,p.useState)(null),{items:L,error:R}=(0,p.useMemo)(()=>w(v),[v]),z=b===`spec`&&!R&&C(L);return(0,m.jsxs)(`div`,{children:[(0,m.jsx)(o,{title:`Bulk Add Jobs`,description:`Import many distinct jobs at once from a JSON array, NDJSON, or a file.`}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,m.jsxs)(a,{className:`lg:col-span-2`,children:[(0,m.jsx)(r,{title:`Jobs`,action:(0,m.jsxs)(`label`,{className:`cursor-pointer rounded-lg border border-line px-3 py-1.5 text-xs text-muted hover:bg-surface-2 hover:text-fg`,children:[`Upload file`,(0,m.jsx)(`input`,{type:`file`,accept:`.json,.ndjson,.txt,application/json`,onChange:e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>y(String(n.result??``)),n.onerror=()=>I({ok:!1,msg:`Could not read file`}),n.readAsText(t),e.target.value=``},className:`hidden`})]})}),(0,m.jsx)(`textarea`,{value:v,onChange:e=>y(e.target.value),spellCheck:!1,rows:16,placeholder:g,"aria-label":`Jobs JSON`,className:`w-full rounded-lg border border-line bg-surface-2 p-3 font-mono text-xs text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`}),(0,m.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,m.jsx)(`span`,{className:`text-xs font-medium text-faint`,children:`Interpret each item as`}),(0,m.jsx)(u,{options:[`spec`,`raw`],value:b,onChange:S}),(0,m.jsx)(`span`,{className:`text-xs text-faint`,children:b===`spec`?`job spec: an object with a "data" key sets options from its sibling fields.`:`raw data: the whole item becomes the job payload, untouched.`})]}),(0,m.jsx)(`p`,{className:`mt-2 text-xs text-faint`,children:`Accepts a JSON array, a single object, or newline-delimited JSON.`}),(0,m.jsx)(`div`,{className:`mt-2 text-sm`,children:R?(0,m.jsx)(`span`,{className:`text-danger`,children:R}):L.length>0?(0,m.jsxs)(`span`,{className:`text-success`,children:[L.length,` job(s) parsed ✓`]}):(0,m.jsx)(`span`,{className:`text-faint`,children:`Nothing parsed yet.`})}),z&&(0,m.jsx)(`p`,{className:`mt-2 text-xs text-warning`,children:`Some items carry keys beyond the known job options — in “spec” mode those keys are dropped. Switch to “raw” to keep every field as the job's data.`})]}),(0,m.jsxs)(a,{children:[(0,m.jsx)(r,{title:`Target & defaults`}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,m.jsxs)(f,{label:`Queue`,children:[(0,m.jsx)(d,{list:`bulk-queue-options`,value:t,onChange:e=>n(e.target.value),placeholder:`queue name (existing or new)`}),(0,m.jsx)(`datalist`,{id:`bulk-queue-options`,children:(e?.queues??[]).map(e=>(0,m.jsx)(`option`,{value:e.name},e.name))})]}),(0,m.jsx)(`p`,{className:`-mt-2 text-xs text-faint`,children:`Defaults below fill any field an item omits.`}),(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,m.jsx)(f,{label:`Priority`,children:(0,m.jsx)(d,{type:`number`,value:T,onChange:e=>E(e.target.value),placeholder:`0`})}),(0,m.jsx)(f,{label:`Max attempts`,children:(0,m.jsx)(d,{type:`number`,value:D,onChange:e=>O(e.target.value),placeholder:`3`})}),(0,m.jsx)(f,{label:`Backoff (ms)`,children:(0,m.jsx)(d,{type:`number`,value:k,onChange:e=>A(e.target.value),placeholder:`1000`})}),(0,m.jsx)(f,{label:`Timeout (ms)`,children:(0,m.jsx)(d,{type:`number`,value:j,onChange:e=>M(e.target.value),placeholder:`—`})})]}),(0,m.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,m.jsx)(l,{variant:`accent`,disabled:N||L.length===0||R!=null,onClick:async()=>{if(I(null),!t.trim()){I({ok:!1,msg:`Choose a queue`});return}if(R){I({ok:!1,msg:R});return}if(L.length===0){I({ok:!1,msg:`Nothing to enqueue — paste a JSON array or NDJSON.`});return}if(L.length>h){I({ok:!1,msg:`Too many jobs (${L.length}). Limit is ${h}.`});return}let e={priority:_(T),maxAttempts:_(D),backoff:_(k),timeout:_(j)},n=L.map(t=>x(t,e,b));P(!0);try{let e=await c.addJobsBulk(t,n),r=new Set(e.ids).size,i=`Created ${r} job${r===1?``:`s`} in ${t}`;I({ok:!0,msg:i}),s.success(i)}catch(e){let t=e.message;I({ok:!1,msg:t}),s.error(`Bulk import failed`,t)}finally{P(!1)}},children:N?`Importing…`:`Import ${L.length||``}`})}),F&&(0,m.jsx)(`span`,{className:F.ok?`text-sm text-success`:`text-sm text-danger`,children:F.msg})]})]})]})]})}export{T as BulkAddJobs};
@@ -1 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{C as r,I as i,J as a,O as o,S as s,T as c,a as l,b as u,c as d,h as f,nt as p,tt as m,w as h,x as g,y as _}from"./index-DtMgfAiz.js";import{i as v,n as y,o as b,t as x}from"./form-C-zZyKfB.js";import{t as S}from"./Pagination-CTSsxJT4.js";var C=e(t(),1),w=[`jan`,`feb`,`mar`,`apr`,`may`,`jun`,`jul`,`aug`,`sep`,`oct`,`nov`,`dec`],T=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];function E(e,t,n,r){let i=e===`*`||/^\*\/\d+$/.test(e),a=new Set;for(let i of e.split(`,`)){let e=i.trim().toLowerCase();if(e===``)return null;let o=e.match(/^(.+)\/(\d+)$/),s=o?Number(o[2]):1,c=o?o[1]:e;if(s<1)return null;let l,u;if(c===`*`)l=t,u=n;else if(c.includes(`-`)){let[e,t]=c.split(`-`),n=D(e,r),i=D(t,r);if(n==null||i==null)return null;l=n,u=i}else{let e=D(c,r);if(e==null)return null;l=e,u=o?n:e}if(l<t||u>n||l>u)return null;for(let e=l;e<=u;e+=s)a.add(e)}return a.size?{values:a,star:i}:null}function D(e,t){let n=e.trim().toLowerCase();if(n===``)return null;if(t){let e=t.indexOf(n.slice(0,3));if(e!==-1)return e}return/^\d+$/.test(n)?Number(n):null}function O(e,t,n){let r=e.trim().split(/\s+/);if(r.length!==5)return{valid:!1,error:`Expected 5 fields (min hour day month weekday), got ${r.length}.`,runs:[]};let i=E(r[0],0,59),a=E(r[1],0,23),o=E(r[2],1,31),s=E(r[3],1,12,w),c=E(r[4],0,7,T);if(!i||!a||!o||!s||!c)return{valid:!1,error:`Invalid field syntax.`,runs:[]};let l=new Set;for(let e of c.values)l.add(e===7?0:e);let u={values:l,star:c.star},d=e=>{let t=o.values.has(e.getDate()),n=u.values.has(e.getDay());return o.star||u.star?t&&n:t||n},f=[],p=new Date(n);p.setSeconds(0,0),p.setMinutes(p.getMinutes()+1);for(let e=0;e<22e5&&f.length<t;e++){if(!s.values.has(p.getMonth()+1)){p.setMonth(p.getMonth()+1,1),p.setHours(0,0,0,0);continue}if(!d(p)){p.setDate(p.getDate()+1),p.setHours(0,0,0,0);continue}if(!a.values.has(p.getHours())){p.setHours(p.getHours()+1,0,0,0);continue}if(!i.values.has(p.getMinutes())){p.setMinutes(p.getMinutes()+1,0,0);continue}f.push(p.getTime()),p.setMinutes(p.getMinutes()+1,0,0)}return{valid:!0,runs:f}}var k=n();function A(){let{data:e,error:t,loading:n,refetch:h}=o(()=>m.crons(),[]),v=e?.crons??[],[y,b]=(0,C.useState)(0),x=Math.max(1,Math.ceil(v.length/15)),w=Math.min(y,x-1),[T,E]=(0,C.useState)(null),D=async e=>{if(window.confirm(`Delete cron "${e}"?`)){E(null);try{await m.deleteCron(e),p.success(`Cron deleted`,e),h()}catch(e){E(e.message),p.error(`Delete cron failed`,e.message)}}};return(0,k.jsxs)(`div`,{children:[t&&(0,k.jsx)(g,{onRetry:h}),(0,k.jsx)(f,{title:`Cron Manager`,description:`Schedule and manage repeatable jobs.`,live:!0}),T&&(0,k.jsx)(`div`,{className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-danger`,children:T}),(0,k.jsxs)(s,{className:`mb-6`,children:[(0,k.jsx)(r,{title:`Create schedule`}),(0,k.jsx)(j,{onCreate:async e=>{await m.createCron(e),p.success(`Cron created`,e.name),h()}})]}),n&&!e&&!t?(0,k.jsx)(u,{label:`Loading crons…`}):v.length===0?(0,k.jsx)(_,{icon:(0,k.jsx)(i,{}),title:`No scheduled jobs`,hint:`Create one above.`}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,k.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,k.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Name`}),(0,k.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,k.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Schedule`}),(0,k.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Next Run`}),(0,k.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Runs`}),(0,k.jsx)(`th`,{className:`w-12 px-5 py-3`})]})}),(0,k.jsx)(`tbody`,{children:v.slice(w*15,w*15+15).map(e=>(0,k.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,k.jsx)(`td`,{className:`px-5 py-3 font-medium text-fg`,children:e.name}),(0,k.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.queue}),(0,k.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.schedule??(e.repeatEvery?`every ${e.repeatEvery}ms`:`—`)}),(0,k.jsx)(`td`,{className:`px-5 py-3 text-faint`,children:l(e.nextRun)}),(0,k.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:d(e.executions)}),(0,k.jsx)(`td`,{className:`px-5 py-3 text-right`,children:(0,k.jsx)(c,{"aria-label":`Delete cron`,onClick:()=>D(e.name),children:(0,k.jsx)(a,{className:`size-3.5`})})})]},e.name))})]})}),(0,k.jsx)(S,{page:w,pageSize:15,total:v.length,onPageChange:b,label:`crons`})]})]})}function j({onCreate:e}){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(``),[a,o]=(0,C.useState)(`cron`),[s,c]=(0,C.useState)(``),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(`{}`),[m,g]=(0,C.useState)(!1),[_,S]=(0,C.useState)(``),[w,T]=(0,C.useState)(``),[E,D]=(0,C.useState)(!1),[A,j]=(0,C.useState)(!1),[M,N]=(0,C.useState)(null),[P,F]=(0,C.useState)(!1),[I,L]=(0,C.useState)(!1),R=(0,C.useMemo)(()=>a!==`cron`||!s.trim()?null:O(s.trim(),3,Date.now()),[a,s]),z=async()=>{if(P)return;if(N(null),L(!1),!t.trim()||!r.trim()){N(`Name and queue are required`);return}let i={};try{i=f.trim()?JSON.parse(f):{}}catch{N(`Data is not valid JSON`);return}let o={name:t,queue:r,data:i};if(a===`cron`){if(!s.trim()){N(`Cron expression required`);return}if(R&&!R.valid){N(R.error??`Invalid cron expression`);return}o.schedule=s.trim()}else{let e=Number(u);if(!Number.isInteger(e)||e<=0){N(`Interval must be a whole number of milliseconds greater than 0`);return}o.repeatEvery=e}_.trim()&&(o.timezone=_.trim());let l=Number(w);w.trim()!==``&&Number.isFinite(l)&&(o.priority=l),E&&(o.preventOverlap=!0),A&&(o.skipIfNoWorker=!0),F(!0);try{await e(o),n(``),c(``),d(``),L(!0),setTimeout(()=>L(!1),3e3)}catch(e){N(e.message)}finally{F(!1)}};return(0,k.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),z()},children:[(0,k.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,k.jsx)(x,{label:`Name`,children:(0,k.jsx)(y,{value:t,onChange:e=>n(e.target.value),placeholder:`daily-report`})}),(0,k.jsx)(x,{label:`Queue`,children:(0,k.jsx)(y,{value:r,onChange:e=>i(e.target.value),placeholder:`reports`})})]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,k.jsx)(v,{options:[`cron`,`every`],value:a,onChange:o}),a===`cron`?(0,k.jsx)(`div`,{className:`min-w-56 flex-1`,children:(0,k.jsx)(x,{label:`Cron expression`,children:(0,k.jsx)(y,{value:s,onChange:e=>c(e.target.value),placeholder:`0 9 * * *`})})}):(0,k.jsx)(`div`,{className:`w-40`,children:(0,k.jsx)(x,{label:`Every (ms)`,children:(0,k.jsx)(y,{type:`number`,value:u,onChange:e=>d(e.target.value),placeholder:`30000`})})})]}),a===`cron`&&s.trim()&&R&&(0,k.jsx)(`div`,{className:`rounded-lg border border-line bg-surface-2 px-3 py-2 text-xs`,children:R.valid?R.runs.length?(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,k.jsxs)(`span`,{className:`text-faint`,children:[`Next runs`,_.trim()?` (local)`:``,`:`]}),R.runs.map(e=>(0,k.jsx)(`span`,{className:`font-mono text-muted`,children:l(e)},e)),_.trim()&&(0,k.jsxs)(`span`,{className:`text-faint`,children:[`— server evaluates in `,_.trim()]})]}):(0,k.jsx)(`span`,{className:`text-warning`,children:`Valid, but no runs in the next few years.`}):(0,k.jsx)(`span`,{className:`text-danger`,children:R.error})}),(0,k.jsx)(x,{label:`Data (JSON)`,children:(0,k.jsx)(y,{value:f,onChange:e=>p(e.target.value),className:`font-mono`})}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>g(e=>!e),className:`text-xs font-medium text-muted hover:text-fg`,children:m?`− Hide advanced`:`+ Advanced options`}),m&&(0,k.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3`,children:[(0,k.jsx)(x,{label:`Timezone (IANA)`,hint:`e.g. Europe/Rome. Default: server timezone.`,children:(0,k.jsx)(y,{value:_,onChange:e=>S(e.target.value),placeholder:`Europe/Rome`})}),(0,k.jsx)(x,{label:`Priority`,children:(0,k.jsx)(y,{type:`number`,value:w,onChange:e=>T(e.target.value),placeholder:`0`})}),(0,k.jsxs)(`div`,{className:`col-span-2 flex flex-wrap gap-6`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(b,{checked:E,onChange:D,label:`prevent overlap`}),(0,k.jsx)(`span`,{className:`text-sm text-muted`,children:`prevent overlap`})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(b,{checked:A,onChange:j,label:`skip if no worker`}),(0,k.jsx)(`span`,{className:`text-sm text-muted`,children:`skip if no worker`})]})]})]})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(h,{type:`submit`,variant:`accent`,size:`sm`,disabled:P,children:P?`Creating…`:`Create`}),M&&(0,k.jsx)(`span`,{className:`text-xs text-danger`,children:M}),I&&(0,k.jsx)(`span`,{className:`text-xs text-success`,children:`Cron created ✓`})]})]})}export{A as CronManager};