@kingsleyweb/bun-ui 3.0.0-rc.1 → 3.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/docs/assets/main-0rchxtv5.js +18 -0
  2. package/dist/docs/assets/{main-pgxtmtja.js.map → main-0rchxtv5.js.map} +1 -1
  3. package/dist/docs/manifest.json +5 -5
  4. package/dist/jobs/assets/AddFlowDialog-h6xkgx9b.js +6 -0
  5. package/dist/jobs/assets/{AddFlowDialog-0ec5ff4r.js.map → AddFlowDialog-h6xkgx9b.js.map} +1 -1
  6. package/dist/jobs/assets/added-cbwsxv3e.js +4 -0
  7. package/dist/jobs/assets/{added-ma7xb2dx.js.map → added-cbwsxv3e.js.map} +1 -1
  8. package/dist/jobs/assets/{channel-a5chwqet.js → channel-tgkvqm8y.js} +3 -3
  9. package/dist/jobs/assets/{channel-a5chwqet.js.map → channel-tgkvqm8y.js.map} +1 -1
  10. package/dist/jobs/assets/{channelChecks-1epbhv9a.js → channelChecks-s4yz4yhw.js} +3 -3
  11. package/dist/jobs/assets/{channelChecks-1epbhv9a.js.map → channelChecks-s4yz4yhw.js.map} +1 -1
  12. package/dist/jobs/assets/index-09z2cjft.js +4 -0
  13. package/dist/jobs/assets/{index-m7zk18cj.js.map → index-09z2cjft.js.map} +1 -1
  14. package/dist/jobs/assets/index-47pxmyxn.js +4 -0
  15. package/dist/jobs/assets/{index-c7qk888t.js.map → index-47pxmyxn.js.map} +1 -1
  16. package/dist/jobs/assets/index-4e55z986.js +4 -0
  17. package/dist/jobs/assets/{index-7kbae3pm.js.map → index-4e55z986.js.map} +1 -1
  18. package/dist/jobs/assets/index-5c933424.js +4 -0
  19. package/dist/jobs/assets/{index-xfq292gs.js.map → index-5c933424.js.map} +1 -1
  20. package/dist/jobs/assets/index-d5r5n0mm.js +4 -0
  21. package/dist/jobs/assets/{index-j3h4v03g.js.map → index-d5r5n0mm.js.map} +3 -3
  22. package/dist/jobs/assets/index-hs60b25v.js +10 -0
  23. package/dist/jobs/assets/{index-y5zw06cs.js.map → index-hs60b25v.js.map} +1 -1
  24. package/dist/jobs/assets/index-k2smrr70.js +4 -0
  25. package/dist/jobs/assets/{index-de1fgbgf.js.map → index-k2smrr70.js.map} +1 -1
  26. package/dist/jobs/assets/index-q24jw3w9.js +4 -0
  27. package/dist/jobs/assets/{index-pjtmzrcd.js.map → index-q24jw3w9.js.map} +1 -1
  28. package/dist/jobs/assets/index-rtynx6wj.js +4 -0
  29. package/dist/jobs/assets/{index-mykmd5cv.js.map → index-rtynx6wj.js.map} +1 -1
  30. package/dist/jobs/assets/{live-erz9pvnm.js → live-6k7s6358.js} +3 -3
  31. package/dist/jobs/assets/{live-erz9pvnm.js.map → live-6k7s6358.js.map} +1 -1
  32. package/dist/jobs/assets/{main-smabxbn4.js → main-0jmeh6mq.js} +4 -4
  33. package/dist/jobs/assets/{main-smabxbn4.js.map → main-0jmeh6mq.js.map} +1 -1
  34. package/dist/jobs/assets/main-3yj6bv90.js +5 -0
  35. package/dist/jobs/assets/{main-yg6scp84.js.map → main-3yj6bv90.js.map} +1 -1
  36. package/dist/jobs/assets/main-4g69fn3x.js +5 -0
  37. package/dist/jobs/assets/{main-v2f8a4g3.js.map → main-4g69fn3x.js.map} +1 -1
  38. package/dist/jobs/assets/{main-e8zsqez2.js → main-4gte3eqq.js} +4 -4
  39. package/dist/jobs/assets/{main-e8zsqez2.js.map → main-4gte3eqq.js.map} +1 -1
  40. package/dist/jobs/assets/{main-zk3n47nq.js → main-4j1fcevh.js} +3 -3
  41. package/dist/jobs/assets/{main-zk3n47nq.js.map → main-4j1fcevh.js.map} +1 -1
  42. package/dist/jobs/assets/main-5grjvsy7.js +5 -0
  43. package/dist/jobs/assets/{main-3xxhy5jh.js.map → main-5grjvsy7.js.map} +1 -1
  44. package/dist/jobs/assets/{main-gzppw8ng.js → main-5zbx60gq.js} +3 -3
  45. package/dist/jobs/assets/{main-gzppw8ng.js.map → main-5zbx60gq.js.map} +1 -1
  46. package/dist/jobs/assets/{main-zx20z2e9.js → main-9prgjhg4.js} +4 -4
  47. package/dist/jobs/assets/{main-zx20z2e9.js.map → main-9prgjhg4.js.map} +1 -1
  48. package/dist/jobs/assets/main-a250ffk7.js +17 -0
  49. package/dist/jobs/assets/{main-xf44bv26.js.map → main-a250ffk7.js.map} +4 -4
  50. package/dist/jobs/assets/{main-qahvywvw.js → main-d6ge7w08.js} +4 -4
  51. package/dist/jobs/assets/{main-qahvywvw.js.map → main-d6ge7w08.js.map} +1 -1
  52. package/dist/jobs/assets/{main-kjywj2zd.js → main-gngzht43.js} +3 -3
  53. package/dist/jobs/assets/{main-kjywj2zd.js.map → main-gngzht43.js.map} +1 -1
  54. package/dist/jobs/assets/main-hg0hrg8j.js +5 -0
  55. package/dist/jobs/assets/{main-yjykmsvp.js.map → main-hg0hrg8j.js.map} +1 -1
  56. package/dist/jobs/assets/main-hm1ng3yg.js +5 -0
  57. package/dist/jobs/assets/{main-9qd3nqs5.js.map → main-hm1ng3yg.js.map} +1 -1
  58. package/dist/jobs/assets/main-jkvd92z9.js +5 -0
  59. package/dist/jobs/assets/{main-fcq7hfk0.js.map → main-jkvd92z9.js.map} +1 -1
  60. package/dist/jobs/assets/main-jv5xqd13.js +5 -0
  61. package/dist/jobs/assets/{main-grcj8v1z.js.map → main-jv5xqd13.js.map} +7 -7
  62. package/dist/jobs/assets/main-jxre7w93.js +5 -0
  63. package/dist/jobs/assets/{main-47391fgm.js.map → main-jxre7w93.js.map} +4 -4
  64. package/dist/jobs/assets/{main-b35rfpdf.js → main-kwmqkjfx.js} +4 -4
  65. package/dist/jobs/assets/{main-b35rfpdf.js.map → main-kwmqkjfx.js.map} +1 -1
  66. package/dist/jobs/assets/main-n9cf6bxm.js +5 -0
  67. package/dist/jobs/assets/{main-vargz49c.js.map → main-n9cf6bxm.js.map} +1 -1
  68. package/dist/jobs/assets/{main-6xdkyzv1.js → main-pegp0ygb.js} +2 -2
  69. package/dist/jobs/assets/{main-2n5wnj51.js → main-qr573853.js} +3 -3
  70. package/dist/jobs/assets/{main-2n5wnj51.js.map → main-qr573853.js.map} +1 -1
  71. package/dist/jobs/assets/main-rq97rdr4.js +4 -0
  72. package/dist/jobs/assets/{main-7jzem39c.js.map → main-rq97rdr4.js.map} +1 -1
  73. package/dist/jobs/assets/main-szjdmydc.js +5 -0
  74. package/dist/jobs/assets/{main-pqke97qp.js.map → main-szjdmydc.js.map} +1 -1
  75. package/dist/jobs/assets/{main-jex4pqaa.js → main-tnbhrm9n.js} +5 -5
  76. package/dist/jobs/assets/{main-jex4pqaa.js.map → main-tnbhrm9n.js.map} +1 -1
  77. package/dist/jobs/assets/main-ts19j4n0.js +5 -0
  78. package/dist/jobs/assets/{main-eekxtm5w.js.map → main-ts19j4n0.js.map} +1 -1
  79. package/dist/jobs/assets/{main-fn8r2zyb.js → main-w93x1dzs.js} +4 -4
  80. package/dist/jobs/assets/{main-fn8r2zyb.js.map → main-w93x1dzs.js.map} +1 -1
  81. package/dist/jobs/assets/sections-0y7w4fb4.js +4 -0
  82. package/dist/jobs/assets/{sections-b570mm22.js.map → sections-0y7w4fb4.js.map} +1 -1
  83. package/dist/jobs/assets/{sse-42e8mhar.js → sse-mn0t0fh7.js} +4 -4
  84. package/dist/jobs/assets/{sse-42e8mhar.js.map → sse-mn0t0fh7.js.map} +1 -1
  85. package/dist/jobs/assets/{sseChecks-0jskzcs1.js → sseChecks-t7tcm7ra.js} +3 -3
  86. package/dist/jobs/assets/{sseChecks-0jskzcs1.js.map → sseChecks-t7tcm7ra.js.map} +1 -1
  87. package/dist/jobs/assets/validation-ysjfy072.js +4 -0
  88. package/dist/jobs/assets/{validation-199pberh.js.map → validation-ysjfy072.js.map} +1 -1
  89. package/dist/jobs/manifest.json +213 -213
  90. package/package.json +10 -6
  91. package/dist/docs/assets/main-pgxtmtja.js +0 -18
  92. package/dist/jobs/assets/AddFlowDialog-0ec5ff4r.js +0 -6
  93. package/dist/jobs/assets/added-ma7xb2dx.js +0 -4
  94. package/dist/jobs/assets/index-7kbae3pm.js +0 -4
  95. package/dist/jobs/assets/index-c7qk888t.js +0 -4
  96. package/dist/jobs/assets/index-de1fgbgf.js +0 -4
  97. package/dist/jobs/assets/index-j3h4v03g.js +0 -4
  98. package/dist/jobs/assets/index-m7zk18cj.js +0 -4
  99. package/dist/jobs/assets/index-mykmd5cv.js +0 -4
  100. package/dist/jobs/assets/index-pjtmzrcd.js +0 -4
  101. package/dist/jobs/assets/index-xfq292gs.js +0 -4
  102. package/dist/jobs/assets/index-y5zw06cs.js +0 -10
  103. package/dist/jobs/assets/main-3xxhy5jh.js +0 -5
  104. package/dist/jobs/assets/main-47391fgm.js +0 -5
  105. package/dist/jobs/assets/main-7jzem39c.js +0 -4
  106. package/dist/jobs/assets/main-9qd3nqs5.js +0 -5
  107. package/dist/jobs/assets/main-eekxtm5w.js +0 -5
  108. package/dist/jobs/assets/main-fcq7hfk0.js +0 -5
  109. package/dist/jobs/assets/main-grcj8v1z.js +0 -5
  110. package/dist/jobs/assets/main-pqke97qp.js +0 -5
  111. package/dist/jobs/assets/main-v2f8a4g3.js +0 -5
  112. package/dist/jobs/assets/main-vargz49c.js +0 -5
  113. package/dist/jobs/assets/main-xf44bv26.js +0 -17
  114. package/dist/jobs/assets/main-yg6scp84.js +0 -5
  115. package/dist/jobs/assets/main-yjykmsvp.js +0 -5
  116. package/dist/jobs/assets/sections-b570mm22.js +0 -4
  117. package/dist/jobs/assets/validation-199pberh.js +0 -4
  118. /package/dist/jobs/assets/{main-6xdkyzv1.js.map → main-pegp0ygb.js.map} +0 -0
@@ -1,6 +0,0 @@
1
- import{D,c,g,T,r,wt,ht,E,n,e,t,s,yt,m,y,i,_,a,b,oe,d,we,u,M,S,P}from"./main-xf44bv26.js";import{rn}from"./main-gzppw8ng.js";import{We,lo,uo,on,Er,Ft,an,Ot,Nr,sn,ln,un}from"./main-pqke97qp.js";import"./main-jex4pqaa.js";import{O}from"./main-zk3n47nq.js";import{A}from"./main-9qd3nqs5.js";var ve=0;function Le(){return ve+=1,`flow-node-${ve}`}function ue(o){return{key:Le(),form:o,queue:"",ignoreFailure:!1,children:[]}}function ke(o,p){return o===""?p:`${o}.${p}`}function z(o,p){let f=[],l=(h,w,F,v,k)=>{f.push({node:h,path:w,queue:F,level:v,parent:k}),h.children.forEach((N,q)=>l(N,ke(w,`children.${q}`),N.queue===""?F:N.queue,v+1,h.key))};return l(o,"",p,1,null),f}function je(o){return o.children.reduce((p,f)=>p+je(f),1)}function Ae(o,p){return[...new Set(z(o,p).map((f)=>f.queue))]}function ce(o,p){if(o.key===p)return o;for(let f of o.children){let l=ce(f,p);if(l)return l}return}function pe(o,p,f){if(o.key===p)return f(o);let l=!1,h=o.children.map((w)=>{let F=pe(w,p,f);return l||=F!==w,F});return l?{...o,children:h}:o}function Ee(o,p,f){return pe(o,p,(l)=>({...l,...f}))}function Pe(o,p,f){return pe(o,p,(l)=>({...l,children:[...l.children,f]}))}function fe(o,p){if(!o.children.some((f)=>f.key===p)){let f=!1,l=o.children.map((h)=>{let w=fe(h,p);return f||=w!==h,w});return f?{...o,children:l}:o}return{...o,children:o.children.filter((f)=>f.key!==p)}}function me(o,p,f){if(je(o)>=f.maxNodes)return`The flow holds ${f.maxNodes} jobs, the most the API accepts.`;let l=z(o,"").find((h)=>h.node.key===p);if(l&&l.level>=f.maxDepth)return`This job is at level ${l.level}; a flow nests at most ${f.maxDepth} levels.`;return null}function ge(o){if(o==="")return;if(o.length>ht)return`At most ${ht} characters.`;return new RegExp(wt).test(o)?void 0:"Letters, digits, “_”, “.” and “-” only, and not “.” or “..”."}function J(o,p,f,l){let h=o[p]??={};h[f]??=l}function be(o,p,f){let l={},h=z(o,p),w=new Map,F=!1,v=!1;h.forEach((k,N)=>{let{node:q,queue:I,level:U,parent:K}=k;for(let[B,G]of Object.entries(Ft(q.form)))J(l,q.key,B,G);if(K!==null){let B=ge(q.queue);if(B)J(l,q.key,"queue",B)}else if(q.ignoreFailure)J(l,q.key,"opts.ignoreFailure","The top job has no parent to carry on without it.");if(!F&&N>=f.maxNodes)F=!0,J(l,q.key,"node",`A flow may hold at most ${f.maxNodes} jobs.`);if(!v&&U>f.maxDepth)v=!0,J(l,q.key,"node",`A flow may nest at most ${f.maxDepth} levels.`);if(q.form.jobId!==""&&Er(q.form.jobId)===void 0){let B=`${I}:${q.form.jobId}`;w.set(B,[...w.get(B)??[],k])}});for(let[k,N]of w)if(N.length>1)for(let{node:q}of N)J(l,q.key,"opts.jobId",`Another job of this flow has the same queue and id (${k}).`);return l}function qe(o){return Object.values(o).some((p)=>Object.keys(p).length>0)}function De(o,p){let f=(l,h)=>{let w=an(l.form),F=h!==null,v={...w.opts,...F&&l.ignoreFailure?{ignoreFailure:!0}:{}},k=!F?p:l.queue===""?h:l.queue;return{name:w.name,data:w.data,...Object.keys(v).length>0?{opts:v}:{},...F&&k!==h?{queue:k}:{},...l.children.length>0?{children:l.children.map((N)=>f(N,k))}:{}}};return f(o,null)}var Je=new Set(["name","data","queue","opts.jobId","opts.priority","opts.delay","opts.runAt","opts.attempts","opts.backoff","opts.timeout","opts.ignoreFailure"]);function xe(o,p){let f=new Map(o.map((N)=>[N.path,N.node.key])),l=p===""?[]:p.split("."),h="",w=0;while(l[w]==="children"&&/^\d+$/.test(l[w+1]??""))h=ke(h,`children.${l[w+1]}`),w+=2;let F=f.get(h);if(F===void 0)return;let v=l.slice(w).join("."),k=v===""?"node":Je.has(v)?v:v.startsWith("data.")?"data":"node";return{key:F,field:k}}function Me(o,p){let f=o.context.queue;return typeof f==="string"&&f!==""?f:p}function _e(o,p){if(o.code==="QUEUE_NOT_FOUND")return`The API does not manage a queue named “${p}”.`;return o.status===401?`Sign in to add jobs to “${p}”.`:`You may not add jobs to “${p}”.`}function Ce(o,p,f){let l={},h=z(p,f),w=!1;if(o.code==="VALIDATION"&&o.issues.length>0){for(let F of o.issues){let v=F.target==="body"?xe(h,F.path):void 0;if(v)J(l,v.key,v.field,F.message);else w=!0}return{errors:l,unplaced:w}}if(o.code==="NAME_NOT_ADDABLE"){let F=o.context.path,v=typeof F==="string"?xe(h,F):void 0;if(!v)return{errors:l,unplaced:!0};return J(l,v.key,v.field,Ot(o,"add")??o.detail??o.title),{errors:l,unplaced:!1}}if(o.code==="FORBIDDEN"||o.code==="UNAUTHORIZED"||o.code==="QUEUE_NOT_FOUND"){let F=Me(o,f),v=_e(o,F),k=h.filter((N)=>N.queue===F);for(let{node:N}of k)J(l,N.key,"queue",v);return{errors:l,unplaced:k.length===0}}return{errors:l,unplaced:!0}}function Ne(o,p,f){let l=o.find((w)=>w.node.key===p);if(l===void 0)return;let{node:h}=l;switch(f){case"node":return l.path;case"queue":return l.queue;case"opts.ignoreFailure":return h.ignoreFailure;case"name":return h.form.name;case"data":return h.form.data.text;case"opts.jobId":return h.form.jobId;case"opts.priority":return h.form.priority;case"opts.delay":return`${h.form.timing}:${h.form.delay}`;case"opts.runAt":return`${h.form.timing}:${h.form.runAt}`;case"opts.attempts":return h.form.attempts;case"opts.backoff":return h.form.backoff;case"opts.timeout":return h.form.timeout}}function Re(o,p,f,l,h){return Ne(z(o,f),l,h)===Ne(z(p,f),l,h)}var he="\x00other",ze=250,Ue=["opts.jobId","opts.priority","opts.delay","opts.runAt","opts.attempts","opts.backoff","opts.timeout"];function He(o){return o.length===0?"Top job":`Child ${o.map((p)=>p+1).join(".")}`}function Eo(o){return o.open?e(Ke,{...o}):null}function Ke({queue:o,onClose:p}){let f=s(),l=m(),h=y("queues.list"),w=c(),F=l.limits.maxJobDataBytes,v=l.addableNames,k=v!==null&&v.length===0,N={maxNodes:l.limits.maxFlowNodes,maxDepth:l.limits.maxFlowDepth},q=()=>on({addableNames:v,maxBytes:F}),[I,U]=r(()=>ue(q())),[K,B]=r(!1),[G,Q]=r(null),V=we(),C=O({mutationFn:(x)=>lo(f,o,De(x,o)),invalidate:(x,R)=>uo(Ae(R,o)),toastErrors:!1}),H=z(I,o),W=H.length,X=[...new Set(H.map((x)=>x.queue))].filter((x)=>x!==o&&ge(x)===void 0).sort().join(`
2
- `),[Y,Z]=r("");D(()=>{let x=setTimeout(Z,ze,X);return()=>clearTimeout(x)},[X]);let ee=Y===""?[]:Y.split(`
3
- `),re=rn({queries:ee.map((x)=>({queryKey:_.permissions({queue:x}),queryFn:({signal:R})=>f.getPermissions({queue:x},R),retry:!1}))}),j=new Set(ee.filter((x,R)=>{let L=re[R]?.data;return L!==void 0&&!yt(L,"jobs.add")})),ne=i({queryKey:_.queues(""),queryFn:({signal:x})=>f.listQueues("",x),enabled:h}),Oe=h&&!ne.isError?ne.data?.items.map((x)=>x.name)??[]:null,$e=K?be(I,o,N):{},se=E(C.error)?C.error:null,te=C.variables,ae=g(()=>se&&te?Ce(se,te,o):null,[se,te,o]),Fe=C.error&&(ae===null||ae.unplaced)?Nr(C.error,"add"):null,Qe=new Set(H.map((x)=>x.node.key)),ye=Object.keys(V.problems).some((x)=>Qe.has(x)),Se={topQueue:o,addableNames:v,maxBytes:F,listedQueues:Oe,refusedQueues:j,errorOf:(x,R)=>(R==="opts.runAt"?V.problems[x]:void 0)??$e[x]?.[R]??(te&&Re(I,te,o,x,R)?ae?.errors[x]?.[R]:void 0),blockedReason:(x)=>me(I,x,N),patch:(x,R)=>U((L)=>Ee(L,x,R)),addChild:(x)=>{if(me(I,x,N)!==null)return;let R=ue(q());U((L)=>Pe(L,x,R)),Q({key:R.key,target:"first"})},remove:(x,R)=>{let L=ce(I,x);if(L)for(let de of z(L,""))V.report(de.node.key,void 0);U((de)=>fe(de,x)),Q({key:R,target:"add"})},reportRunAt:V.report,focus:G,focused:()=>Q(null)},Be=(x)=>{if(x.preventDefault(),B(!0),k||ye||qe(be(I,o,N)))return;C.mutate(I)},le=()=>{if(!C.isPending)p()},ie=C.isSuccess?C.data:void 0;return e(oe,{open:!0,onClose:le,title:t(n,{children:["Add a flow to ",e("code",{children:o})]}),description:"A flow is a job and the jobs it waits on: they are added first, and it runs once they have all completed.",size:"lg",closeOnEscape:!C.isPending,closeOnBackdrop:!C.isPending,footer:ie?e(a,{variant:"primary",onClick:le,children:"Done"}):t(n,{children:[e(a,{onClick:le,disabled:C.isPending,children:"Cancel"}),e(a,{variant:"primary",type:"submit",form:w,disabled:C.isPending||k||ye,"aria-busy":C.isPending||void 0,children:C.isPending?"Adding…":"Add flow"})]}),children:ie?e(Ye,{queue:o,result:ie}):k?e(d,{title:"No flow can be added here",description:"This API accepts no job names: adding jobs is switched off (the jobs.add action is not enabled, or the API is read-only), or no name is allowed. Ask whoever runs it to list the names in addableNames."}):t("form",{id:w,className:"job-form flow-form",onSubmit:Be,noValidate:!0,children:[t("p",{className:"flow-count","data-testid":"flow-count","aria-live":"polite",children:[W," of ",N.maxNodes," jobs",W>=N.maxNodes?": the most one flow may hold.":`, nested at most ${N.maxDepth} levels.`]}),e("ol",{className:"flow-tree","aria-label":"Flow",children:e(Ie,{node:I,indices:[],level:1,parent:null,parentQueue:null,editor:Se})}),Fe!==null&&e(A,{error:Fe})]})})}function Ie({node:o,indices:p,level:f,parent:l,parentQueue:h,editor:w}){let{key:F}=o,v=He(p),k=l===null,N=k?w.topQueue:o.queue===""?h:o.queue,q=T(null),I=T(null),U=c(),K=c(),[B,G]=r(!1),Q=(j)=>w.errorOf(F,j),V=Ue.some((j)=>Q(j)),C=B||V,H=w.blockedReason(F),W=w.refusedQueues.has(N),X=Q("node")??(k?Q("opts.ignoreFailure"):void 0),Y=Q("queue")??(W?`You may not add jobs to “${N}”: the API will refuse this flow.`:void 0),{focus:Z,focused:ee}=w;D(()=>{if(Z?.key!==F)return;(Z.target==="add"&&I.current&&!I.current.disabled?I.current:q.current?.querySelector("input, select, textarea"))?.focus(),ee()},[Z,F,ee]);let re=(j)=>w.patch(F,{form:{...o.form,...j}});return t("li",{className:"flow-item",children:[t("fieldset",{ref:q,className:"flow-node","data-refused":W||void 0,"data-testid":"flow-node",children:[e("legend",{children:v}),X&&e("p",{className:"field-error job-form-error",role:"alert",children:X}),e(sn,{value:o.form.name,onChange:(j)=>re({name:j}),error:Q("name"),addableNames:w.addableNames}),e(ln,{value:o.form.data.text,onChange:(j)=>re({data:j}),error:Q("data"),maxBytes:w.maxBytes,rows:4}),k?t("div",{className:"flow-node-queue",children:[t("p",{className:"field-label",children:["Queue: ",e("code",{children:N})]}),Y&&e("p",{className:"field-error",children:Y})]}):e(Ve,{value:o.queue,onChange:(j)=>w.patch(F,{queue:j}),parentQueue:h,listed:w.listedQueues,error:Y}),!k&&t("div",{children:[e(P,{checked:o.ignoreFailure,onChange:(j)=>w.patch(F,{ignoreFailure:j}),label:"Parent carries on if this fails",hint:"Its failure is recorded for the parent to read, instead of failing it."}),Q("opts.ignoreFailure")&&e("p",{className:"field-error",children:Q("opts.ignoreFailure")})]}),t("div",{className:"flow-node-actions",children:[t(a,{size:"sm",variant:"ghost","aria-expanded":C,"aria-controls":C?K:void 0,onClick:()=>G(!C),children:["Options",t("span",{className:"visually-hidden",children:[" of ",v]})]}),t(a,{ref:I,size:"sm",onClick:()=>w.addChild(F),disabled:H!==null,"aria-describedby":H!==null?U:void 0,children:["Add child",t("span",{className:"visually-hidden",children:[" to ",v]})]}),l!==null&&t(a,{size:"sm",variant:"danger",onClick:()=>w.remove(F,l),children:["Remove",t("span",{className:"visually-hidden",children:[" ",v]})]}),H!==null&&e("p",{id:U,className:"field-hint flow-node-blocked",children:H})]}),C&&e("div",{id:K,children:e(un,{form:o.form,patch:re,fieldError:(j)=>Q(j),onRunAtProblem:(j)=>w.reportRunAt(F,j)})})]}),o.children.length>0&&e("ol",{className:"flow-tree flow-children","aria-label":`Jobs ${v} waits on`,children:o.children.map((j,ne)=>e(Ie,{node:j,indices:[...p,ne],level:f+1,parent:F,parentQueue:N,editor:w},j.key))})]})}function Ve({value:o,onChange:p,parentQueue:f,listed:l,error:h}){let[w,F]=r(()=>o!==""&&l!==null&&!l.includes(o));if(l===null)return e(u,{label:"Queue",hint:`Leave empty for its parent's, ${f}.`,error:h,children:e(M,{value:o,onChange:p,autoComplete:"off",spellCheck:!1})});let v=w||o!==""&&!l.includes(o);return t(n,{children:[e(u,{label:"Queue",error:v?void 0:h,children:e(S,{options:[{value:"",label:`Its parent's (${f})`},...l.map((k)=>({value:k})),{value:he,label:"Another queue…"}],value:v?he:o,onChange:(k)=>{if(k===he)F(!0),p("");else F(!1),p(k)}})}),v&&e(u,{label:"Another queue",hint:"A queue need not exist yet. Leave empty for its parent's.",error:h,children:e(M,{value:o,onChange:p,autoComplete:"off",spellCheck:!1})})]})}function Te(o){return[o,...o.children.flatMap(Te)]}function Ye({queue:o,result:p}){let f=T(null);D(()=>f.current?.focus(),[]);let l=p.job,h=Te(p).filter((w)=>w.added);return e("div",{ref:f,className:"flow-result",tabIndex:-1,role:"status","data-testid":"flow-result",children:p.added?t(n,{children:[t("p",{children:["Added ",h.length," ",h.length===1?"job":"jobs",". The top job,"," ",t(b,{to:We(l.queue||o,l.id),children:[l.name," (",l.id,")"]}),", runs once the jobs it waits on have completed."]}),e("ul",{className:"flow-result-list",children:h.map(({job:w})=>t("li",{children:[e(b,{to:We(w.queue,w.id),children:w.name})," ",t("span",{className:"muted",children:["in ",e("code",{children:w.queue}),", id ",e("code",{children:w.id})]})]},`${w.queue}:${w.id}`))})]}):t("p",{children:["The top job already existed, so nothing was added:"," ",t(b,{to:We(l.queue||o,l.id),children:["view ",l.name," (",l.id,")"]}),"."]})})}export{Eo as AddFlowDialog};
4
-
5
- //# debugId=06353D6AB441FF3964756E2164756E21
6
- //# sourceMappingURL=AddFlowDialog-0ec5ff4r.js.map
@@ -1,4 +0,0 @@
1
- import{Z,n,e,t,s,z,i,j,f,o,Y,bt}from"./main-xf44bv26.js";var l=20000;function y(r,m=Date.now()){return bt(r,m)}function c(r){return["addedByState",r.kind==="preset"?{seconds:r.seconds}:{from:r.from,to:r.to}]}function u(r,m,p){let{from:a,to:d}=y(m);return r.request("GET","/overview/added",{query:{from:a,to:d},signal:p})}function b({range:r}){let m=s(),p=j(l),a=i({queryKey:c(r),queryFn:({signal:d})=>u(m,r,d),refetchInterval:p,placeholderData:z});return t(n,{children:[t("p",{className:"range-group-title",children:["Added in range, where they are now"," ",e("span",{className:"muted",children:"(still stored)"})]}),a.data?t("dl",{className:"range-cells",children:[Z.map((d)=>t("div",{className:`range-cell state-${d}`,children:[e("dt",{children:Y[d]}),e("dd",{children:o(a.data.counts[d])})]},d)),t("div",{className:"range-cell range-cell-total",children:[e("dt",{children:"Total"}),e("dd",{children:o(a.data.total)})]})]}):a.isError?t("p",{className:"range-note",children:["Could not load: ",a.error.message]}):e(f,{label:"Loading jobs added in the range"}),e("p",{className:"range-note",children:"Counted by when jobs were added, not finished, so it will not match Finished in range; queues that remove finished jobs show few completed."})]})}export{b as AddedByStateGroup};
2
-
3
- //# debugId=061EE75A431A544E64756E2164756E21
4
- //# sourceMappingURL=added-ma7xb2dx.js.map
@@ -1,4 +0,0 @@
1
- import{D,T,N,n,e,t,p,s,m,y,i,G,sa,b,d,f,x,o,l,I}from"./main-xf44bv26.js";import{Ie,v}from"./main-smabxbn4.js";import{ke,Po,ko,Ue,pt,Ze,Wn,zn,Qt,Yn,Cr,Mo,Fo,Vo,Lr}from"./main-47391fgm.js";import{Dt,bn}from"./main-fn8r2zyb.js";import{ft}from"./main-zx20z2e9.js";import"./main-6xdkyzv1.js";function q({refetchInterval:r}){let c=s(),u=sa().get("group"),a=i({queryKey:ke.groups(c),queryFn:({signal:w})=>ko(c,w),refetchInterval:r}),g=T(null),S=T(null),h=a.data!==void 0;return D(()=>{if(!h||u===null||S.current===u)return;let w=g.current;if(w===null)return;if(S.current=u,typeof w.scrollIntoView==="function")w.scrollIntoView({block:"center"})},[h,u]),t("section",{className:"summon-groups","data-testid":"summon-groups","aria-labelledby":"summon-groups-heading",children:[e("h2",{id:"summon-groups-heading",className:"summon-groups-title",children:"Summon groups"}),a.isPending?e(f,{label:"Loading the summon groups",showLabel:!0}):a.isError?e(x,{error:a.error,title:"Could not load the summon groups",onRetry:()=>void a.refetch()}):a.data.groups.length===0?e("p",{className:"muted","data-testid":"summon-groups-empty",children:"No summon groups in this namespace."}):t(I,{label:"Summon groups",children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Group"}),e("th",{scope:"col",children:"Unit"}),e("th",{scope:"col",children:"Budget left"}),e("th",{scope:"col",children:"Shared circuit"}),e("th",{scope:"col",title:Fo,children:Mo})]})}),e("tbody",{children:a.data.groups.map((w)=>e(R,{group:w,current:w.name===u,rowRef:w.name===u?g:void 0},w.name))})]})]})}function R({group:r,current:c,rowRef:u}){let a=Wn(r),g=zn(r,void 0),S=Qt(r);return t("tr",{ref:u,id:`summon-group-${r.name}`,"data-testid":`summon-group-row-${r.name}`,"aria-current":c?"true":void 0,className:N(c&&"is-current"),children:[e("th",{scope:"row",children:r.name}),e("td",{children:S?e(p,{tone:"neutral",title:Yn,testId:`summon-groups-unit-${r.name}`,children:Cr(r)}):e("span",{"data-testid":`summon-groups-unit-${r.name}`,children:Cr(r)})}),e("td",{children:e(Ze,{budget:r.budget,testId:`summon-groups-budget-${r.name}`})}),e("td",{children:g.length===0?e("span",{className:"muted",title:"The group shares no circuit, or none has counted a failure",children:"—"}):e("ul",{className:"summon-group-list",children:g.map((h)=>e("li",{children:e(Lr,{circuit:h,compact:!0,testId:`summon-groups-circuit-${r.name}-${h.kind??"this-summoner"}`})},h.kind??""))})}),t("td",{children:[a.length===0?e("span",{className:"muted",children:"None today"}):e("ul",{className:"summon-group-list",children:a.map((h)=>t("li",{"data-testid":`summon-groups-share-${r.name}-${h.queue}`,children:[e(b,{to:Ue(h.queue),title:`The Summon tab of ${h.queue}`,children:h.queue})," ",e("span",{className:"summon-group-count",children:o(h.day)})]},h.queue))}),S&&a.length>0&&e("span",{className:"muted summon-group-note","data-testid":`summon-groups-note-${r.name}`,children:Vo})]})]})}var k=G;function L(){let r=s(),c=y("queues.list"),u=m().features.summonStoredStatus===!0,a=i({queryKey:ke.list(r),queryFn:({signal:g})=>Po(r,g),refetchInterval:k,enabled:c});return t("div",{className:"screen","data-testid":"summoning-screen",children:[e("h1",{className:"screen-title",children:"Summoning"}),!c?e(d,{title:"Nothing to show",description:"You may not list queues on this API."}):a.isPending?e(f,{label:"Loading the summon controllers",showLabel:!0}):a.isError?e(x,{error:a.error,title:"Could not load the summon controllers",onRetry:()=>void a.refetch()}):a.data.controllers.length===0?e(d,{title:"No summon controllers here",description:u?"No queue summons here: none has a controller in the API's own process, or summon state in the store that you may read.":"Summon controllers run in the API's own process, from its BunJobs context's summon option or jobs.summonController(). None runs in this one, so there is nothing to list. A controller running in another process is not listed."}):t(I,{label:"Summon controllers",children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Queue"}),e("th",{scope:"col",children:"Summoner"}),e("th",{scope:"col",children:"Readiness"}),e("th",{scope:"col",children:"Last outcome"}),e("th",{scope:"col",children:"Budget left"})]})}),e("tbody",{children:a.data.controllers.map((g)=>e(E,{item:g},`${g.namespace}/${g.queue}`))})]}),c&&u&&e(q,{refetchInterval:k})]})}function P({queue:r,group:c,queues:u}){return t("span",{className:"muted summoning-unit","data-testid":`summoning-unit-${r}`,children:["Shared unit of ",l(c),":"," ",u.map((a,g)=>t("span",{children:[g>0&&", ",e(b,{to:Ue(a),title:`The Summon tab of ${a}`,children:l(a)})]},a))]})}function E({item:r}){let c=Ie(),u=r.readiness===void 0?void 0:ft(r.readiness),a=r.last===void 0?void 0:Dt(r.last.outcome);return t("tr",{"data-testid":`summoning-row-${r.queue}`,children:[t("th",{scope:"row",children:[e(b,{to:Ue(r.queue),title:`The Summon tab of ${r.queue}`,children:r.queue}),r.group!==void 0&&e(P,{queue:r.queue,group:r.group,queues:r.queues??[r.queue]})]}),e("td",{children:r.kind===""?e("span",{className:"muted",title:"Not recorded yet: its controller runs in another process","data-testid":"summoning-kind-unknown",children:"—"}):e("code",{children:l(r.kind)})}),t("td",{children:[u===void 0?e("span",{className:"muted",title:"Its controller runs in another process",children:"Elsewhere"}):e(p,{tone:u.tone,title:u.hint,testId:"summoning-readiness",children:u.label}),r.inert&&t(n,{children:[" ",e(p,{tone:"neutral",title:bn(r.inertReason),testId:"summoning-inert",children:"Inert"})]}),r.circuitOpenUntil!==void 0&&t(n,{children:[" ",e(p,{tone:"warning",title:`Circuit open until ${pt(r.circuitOpenUntil,c)}: after repeated failures nothing is summoned until then, apart from one trial attempt.`,testId:"summoning-circuit",children:"Circuit open"})]})]}),e("td",{"data-testid":"summoning-last",children:r.last===void 0||a===void 0?e("span",{className:"muted",children:"None yet"}):t(n,{children:[e(p,{tone:a.tone,title:a.hint,children:a.label})," ",e(v,{value:r.last.at}),r.last.detail!==void 0&&t("span",{className:"muted",children:[" — ",l(r.last.detail)]})]})}),e("td",{children:r.budget===void 0?e("span",{className:"muted","data-testid":`summoning-budget-${r.queue}`,children:"—"}):e(Ze,{budget:r.budget,testId:`summoning-budget-${r.queue}`})})]})}export{L as SummoningScreen};
2
-
3
- //# debugId=18FEDCB2AD6431A464756E2164756E21
4
- //# sourceMappingURL=index-7kbae3pm.js.map
@@ -1,4 +0,0 @@
1
- import{w,D,T,r,n,e,t,p,s,m,y,i,_,a,b,dr,rt,d,wn,Ve,R,o,h,u,M,S,P,I}from"./main-xf44bv26.js";import{Mn,Or,vr,co,Rr,mo,Ar,vt,Vt,po,fo}from"./main-e8zsqez2.js";import{he,mt,cn}from"./main-kjywj2zd.js";import{W}from"./main-yg6scp84.js";import{Jo,zo}from"./main-fn8r2zyb.js";import{ie}from"./main-qahvywvw.js";import"./main-3xxhy5jh.js";var oe={all:"Everything (all)",queues:"Every queue (queues)",queue:"One queue",job:"One job",runners:"Every runner (runners)",runner:"One runner",workers:"Every worker (workers)",queueWorkers:"One queue's workers"},U=new Set(["all","queues","runners","workers"]);function le(l){return{scope:l.scope,queue:l.scope==="queue"||l.scope==="job"||l.scope==="queueWorkers"?l.queue:"",runner:l.scope==="runner"?l.runner:"",id:l.scope==="job"?l.id:""}}function X(l){switch(l.scope){case"all":case"queues":case"runners":case"workers":return{scope:l.scope};case"queueWorkers":return l.queue?{scope:"queueWorkers",queue:l.queue}:null;case"queue":return l.queue?{scope:"queue",queue:l.queue}:null;case"runner":return l.runner?{scope:"runner",runner:l.runner}:null;case"job":return l.queue&&l.id?{scope:"job",queue:l.queue,id:l.id}:null}}function V({label:l,value:c,names:g,onChange:q}){return e(u,{label:l,children:g&&g.length>0?e(S,{options:[{value:"",label:"Choose…"},...g.map((C)=>({value:C}))],value:g.includes(c)?c:"",onChange:q}):e(M,{value:c,onChange:q,maxLength:200,autoComplete:"off",spellCheck:!1})})}function pe({choice:l,onApply:c}){let g=s(),q=m(),C=y("queues.list"),N=y("runners.list"),[k,A]=r(()=>le(l)),L=k.scope==="queue"||k.scope==="job"||k.scope==="queueWorkers",x=i({queryKey:_.queues(""),queryFn:({signal:v})=>g.listQueues("",v),enabled:L&&C}),F=i({queryKey:he.list(),queryFn:({signal:v})=>cn(g,v),enabled:k.scope==="runner"&&N}),B=X(k);return t("form",{className:"events-picker",onSubmit:(v)=>{if(v.preventDefault(),B)c(B)},"aria-label":"Channel",children:[e(u,{label:"Channel",children:e(S,{options:Rr(q.mode).map((v)=>({value:v,label:oe[v]})),value:k.scope,onChange:(v)=>{let j={...k,scope:v};A(j);let z=U.has(v)?X(j):null;if(z)c(z)}})}),L&&e(V,{label:"Queue",value:k.queue,names:x.data?.items.map((v)=>v.name),onChange:(v)=>A({...k,queue:v})}),k.scope==="job"&&e(u,{label:"Job id",children:e(M,{value:k.id,onChange:(v)=>A({...k,id:v}),autoComplete:"off",spellCheck:!1})}),k.scope==="runner"&&e(V,{label:"Runner",value:k.runner,names:F.data?.items.map((v)=>v.id),onChange:(v)=>A({...k,runner:v})}),!U.has(k.scope)&&e(a,{type:"submit",variant:"primary",disabled:B===null,children:"Watch"})]})}function ue({allowed:l,selected:c,onChange:g}){let q=(C,N)=>g(l.filter((k)=>k===C?N:c.includes(k)));return t("details",{className:"events-types",children:[t("summary",{"data-testid":"events-types-summary",children:["Types: ",c.length===0?"all":c.join(", ")]}),t("fieldset",{children:[e("legend",{className:"visually-hidden",children:"Event types"}),e("div",{className:"events-type-grid",children:l.map((C)=>e(P,{label:C,checked:c.includes(C),onChange:(N)=>q(C,N)},C))}),e(a,{size:"sm",variant:"ghost",onClick:()=>g([]),disabled:c.length===0,children:"All types"})]})]})}function ce({ignored:l,channel:c,showingAll:g}){if(l.length===0)return null;return t("p",{className:"events-types-ignored",role:"note","data-testid":"events-types-ignored",children:["Ignored in the link's types:"," ",l.map((q,C)=>t("span",{children:[C>0?"; ":"",e("code",{children:q.name})," ",q.reason==="unknown"?"(not an event type)":`(${c} does not carry it)`]},q.name)),g?". Showing every type.":"."]})}function Y(l){let c=new Date(l),g=(q,C=2)=>String(q).padStart(C,"0");return`${g(c.getHours())}:${g(c.getMinutes())}:${g(c.getSeconds())}.${g(c.getMilliseconds(),3)}`}function de(l){switch(l.type){case"failed":case"dead":case"timeout":case"killed":return"danger";case"retrying":case"stalled":case"skipped":return"warning";case"completed":case"succeeded":return"success";default:return"neutral"}}function me({event:l}){if(l.id===void 0)return e("span",{className:"muted",children:"—"});if(l.kind==="queue")return e(b,{to:wn(l.target,l.id),children:l.id});return e("code",{children:l.id})}var ve={queue:"info",runner:"accent",worker:"neutral"};function ge({row:l,event:c}){let g=new Date(c.at).toISOString();return t("tr",{"data-testid":"event-row","data-type":c.type,children:[e("td",{className:"events-time",children:e("time",{dateTime:g,title:g,children:Y(c.at)})}),t("td",{className:"events-kind",children:[e(p,{tone:ve[c.kind],children:c.kind})," ",e(p,{tone:de(c),children:c.type})]}),e("td",{className:"events-target",children:e(b,{to:c.kind==="runner"?mt(c.target):Ve(c.target),children:c.target})}),e("td",{className:"events-id",children:e(me,{event:c})}),t("td",{className:"events-payload",children:[c.kind==="queue"&&c.type==="summon"&&zo(c.payload)&&e("p",{className:"events-summary","data-testid":"event-summon-summary",children:Jo(c.payload)}),e(ie,{value:c.payload,label:`Payload of ${c.type} #${l.key}`,expandDepth:0,copyable:!1})]})]})}function fe({row:l,gap:c}){return t("tr",{"data-testid":"event-row","data-type":"gap",className:"events-gap",children:[e("td",{className:"events-time",children:Y(l.receivedAt)}),t("td",{colSpan:4,children:[t("strong",{children:["gap: ",c.reason]})," ",t("span",{className:"muted",children:[c.toSeq>0?`events ${c.fromSeq}–${c.toSeq} `:"events ","may be missing",c.channels?` on ${c.channels.join(", ")}`:""]})]})]})}function ye({status:l,channel:c}){if(l.publishing===!1)return e(d,{title:"Producers are not publishing events",description:"This API reports publishing: false. The queues and runners it manages emit no events, so nothing will arrive here; the screens refresh by polling instead."});if(l.events==="local")return e(d,{title:"Only this API process's own events",description:"This API reports events: local. It sees only the events of work done in its own process; jobs and runs handled by other processes will not appear here."});if(l.state==="off"||l.state==="refused")return e(d,{title:"Live updates are off",description:l.detail??"There is no socket to the API."});return e(d,{title:"Waiting for events",description:t(n,{children:["Nothing has arrived on ",e("code",{children:c})," yet."]})})}function we({rejected:l}){if(l.length===0)return null;return e("div",{className:"events-rejected",role:"alert","data-testid":"events-rejected",children:l.map((c)=>t("p",{children:["The server refused ",e("code",{children:c.channel}),":"," ",e("strong",{children:c.code}),c.detail?` (${c.detail})`:""]},`${c.channel}:${c.code}`))})}function Ge(){let l=m(),c=dr(),[g,q]=W(),C=vt(g.get("channel"),l.mode)??mo(l.mode),N=Ar(C),k=Vt(C),A=g.get("types"),L=po(A,k),{types:x}=L;D(()=>{if(A!==null&&L.normalized!==A)q({types:L.normalized})},[A,L.normalized,q]);let[F,B]=r([]),[O,v]=r(!1),[j,z]=r({rows:[],dropped:0}),G=T(0),J=T(O);J.current=O;let H=T(x);H.current=x;let Q=T([]),K=w((f)=>{if(J.current)z((E)=>E.rows.length>=Or?{rows:E.rows,dropped:E.dropped+1}:{rows:[...E.rows,f],dropped:E.dropped});else B((E)=>vr(E,[f]))},[]),Z=w((f)=>{if(!fo(f,H.current))return;let E=co(Q.current,f);if(Q.current=E.seen,E.duplicate)return;K({key:G.current++,kind:"event",receivedAt:Date.now(),event:f})},[K]),ee=w((f)=>K({key:G.current++,kind:"gap",receivedAt:Date.now(),gap:f}),[K]),{rejected:ne}=rt({channels:[N],events:x.length===0?void 0:x,onEvent:Z,onGap:ee}),te=()=>{J.current=!0,v(!0)},se=()=>{J.current=!1,B((f)=>vr(f,j.rows)),z({rows:[],dropped:0}),v(!1)},re=()=>{B([]),z({rows:[],dropped:0})};return t("div",{className:"screen events-screen","data-testid":"events-screen",children:[e("h1",{className:"screen-title",children:"Events"}),t(R,{title:"Subscription",className:"events-controls",children:[e(pe,{choice:C,onApply:(f)=>{let E=Vt(f);q({channel:Ar(f),types:x.filter((ae)=>E.includes(ae)).join(",")||null})}},N),e(ue,{allowed:k,selected:x,onChange:(f)=>q({types:f.join(",")||null})}),e(ce,{ignored:L.ignored,channel:N,showingAll:x.length===0}),t("p",{className:"muted events-channel",children:["Watching ",e("code",{"data-testid":"events-channel",children:N})]}),e(we,{rejected:ne})]}),e(R,{title:"Log",actions:t("div",{className:"events-actions",children:[t("span",{className:"muted","data-testid":"events-count",children:[h(F.length,"row")," (the latest ",o(Mn)," ","are kept)"]}),O&&t("span",{className:"events-held","data-testid":"events-held",children:[o(j.rows.length)," held",j.dropped>0?`, ${o(j.dropped)} dropped`:""]}),e(a,{size:"sm",onClick:O?se:te,children:O?"Resume":"Pause"}),e(a,{size:"sm",onClick:re,disabled:F.length===0&&j.rows.length===0,children:"Clear"})]}),children:F.length===0?e(ye,{status:c,channel:N}):t(I,{label:"Events, newest first",className:"events-table",children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Time"}),e("th",{scope:"col",children:"Event"}),e("th",{scope:"col",children:"Target"}),e("th",{scope:"col",children:"Id"}),e("th",{scope:"col",children:"Payload"})]})}),e("tbody",{children:F.map((f)=>f.kind==="event"?e(ge,{row:f,event:f.event},f.key):e(fe,{row:f,gap:f.gap},f.key))})]})})]})}export{Ge as EventsScreen};
2
-
3
- //# debugId=A8ABD232A99371F464756E2164756E21
4
- //# sourceMappingURL=index-c7qk888t.js.map
@@ -1,4 +0,0 @@
1
- import{Pn,Fa}from"./main-7jzem39c.js";import"./main-pqke97qp.js";import"./main-2n5wnj51.js";import"./main-jex4pqaa.js";import"./main-b35rfpdf.js";import"./main-v2f8a4g3.js";import"./main-zk3n47nq.js";import"./main-smabxbn4.js";import"./main-qahvywvw.js";import"./main-fcq7hfk0.js";import"./main-9qd3nqs5.js";import"./main-3xxhy5jh.js";import"./main-6xdkyzv1.js";import{Zr}from"./main-xf44bv26.js";export{Zr as AddFlowDialog,Pn as AddJobDialog,Fa as JobScreen};
2
-
3
- //# debugId=03FDD8F16716577564756E2164756E21
4
- //# sourceMappingURL=index-de1fgbgf.js.map
@@ -1,4 +0,0 @@
1
- import{Me,c,T,r,Z,K,E,n,e,t,p,s,gt,yt,m,y,se,z,i,_,a,de,b,De,d,f,ee,ce,ua,da,ca,ma,pa,fa,ha,ga,Na,Oa,va,Ra,Aa,Ta,Da,R,x,o,Y,h,l,te,u,M,V,S,P,I,ne,ue,Ia,wa,Zt,xa,Ca,pr,fr,hr,Qr,kt,Yr,ka,Zr}from"./main-xf44bv26.js";import{v}from"./main-smabxbn4.js";import{ze,Rt,mn,bo,Eo,pn,At}from"./main-eekxtm5w.js";import{Pn}from"./main-7jzem39c.js";import{rn}from"./main-gzppw8ng.js";import"./main-pqke97qp.js";import"./main-2n5wnj51.js";import"./main-jex4pqaa.js";import{Oe}from"./main-b35rfpdf.js";import{xo,L,Co}from"./main-yjykmsvp.js";import{k}from"./main-v2f8a4g3.js";import{O}from"./main-zk3n47nq.js";import{W,me,Pe}from"./main-yg6scp84.js";import{ke,$n,Lo,Uo,Ue,yn,Ze,Bo}from"./main-47391fgm.js";import{Dt,bn,Pr,qo,kr,jo,Ho,Go,Qo,Ko,$o,Wo,Yo,Zo,Xo}from"./main-fn8r2zyb.js";import{Kt,En,Nn}from"./main-vargz49c.js";import{ie}from"./main-qahvywvw.js";import{re,ta}from"./main-fcq7hfk0.js";import{A}from"./main-9qd3nqs5.js";import{ye}from"./main-3xxhy5jh.js";import{ft}from"./main-zx20z2e9.js";import{F}from"./main-6xdkyzv1.js";function Ae({queue:g}){let w=s(),C=ue("demand"),N=i({queryKey:Zt.queue(g),queryFn:({signal:D})=>xa(w,g,D),refetchInterval:C,placeholderData:z});if(N.isPending)return e(f,{label:"Loading demand",showLabel:!0});if(N.isError)return e(A,{error:N.error,title:"Could not load demand",onRetry:()=>void N.refetch()});return e(ct,{reading:N.data,urls:Ca(w.base,g,window.location.origin)})}function ct({reading:g,urls:w}){let C=Qr.some(({figure:N})=>pr(g,N).approximate);return t("div",{className:"demand-panel","data-testid":"queue-demand",children:[g.paused&&e("p",{className:"notice",role:"note","data-testid":"demand-paused",children:"The queue is paused, so it demands nothing: demand and outstanding read 0 whatever is waiting, and a scaler polling them scales to zero."}),g.capped&&e("p",{className:"notice",role:"note","data-testid":"demand-capped",children:"At least these many: a count reached the backend's cap, so every figure is a lower bound (≥)."}),C&&e("p",{className:"notice",role:"note","data-testid":"demand-approximate",children:"Approximate (≈): this backend cannot count demand directly, so due now is only 1 or 0, stalled counts every active job while no worker is live, and the next due time is known only while nothing is due. Right as a trigger, not as a count."}),e(F,{items:[...Qr.map(({figure:N,label:D,hint:q})=>({key:N,label:D,value:e("span",{className:"num",title:hr(g,N),"data-testid":`demand-${N}`,children:fr(g,N)}),hint:q})),{key:"workers",label:"Workers",value:e("span",{className:"num","data-testid":"demand-workers",children:o(g.workers)}),hint:"Live workers on the queue, from their heartbeats, paused ones included. 0 on a backend that keeps no worker records."},{key:"nextDueAt",label:"Next due",value:e("span",{"data-testid":"demand-next-due",children:g.nextDueAt===null?"None scheduled":e(v,{value:g.nextDueAt,hint:g.exact?void 0:"Approximate: known only while nothing is due."})}),hint:"The earliest delayed job or retry still in the future."},{key:"at",label:"Read",value:e(v,{value:g.at})}]}),t("div",{className:"demand-urls",children:[e("p",{className:"muted",children:"A scaler reads the same figures from these URLs (JSON, and the Prometheus text format), with the credentials this API asks for."}),e(Te,{label:"JSON",url:w.json,testId:"demand-url-json"}),e(Te,{label:"Prometheus",url:w.prometheus,testId:"demand-url-prometheus"})]})]})}function Te({label:g,url:w,testId:C}){return t("div",{className:"demand-url",children:[e("span",{className:"demand-url-label",children:g}),e("code",{"data-testid":C,children:w}),e(ye,{text:w,ariaLabel:`Copy the ${g} demand URL`})]})}function Le(){let g=m(),w=y("queues.read"),C=re(),N=g.features.jobDefaults&&w;return{shown:N,canEdit:N&&C("queues.defaults"),canApply:N&&g.features.jobDefaultsApply&&C("queues.applyDefaults")}}function Ee(g){return{rateMax:g?.rate?.max,rateDuration:g?.rate?String(g.rate.duration):"",concurrency:g?.concurrency}}function $e(g){return{queue:Ee(g??void 0),names:Object.entries(g?.names??{}).map(([w,C],N)=>({key:N,name:w,...Ee(C)}))}}function qe(g){let w={},C=Co(g.rateDuration);if(g.rateMax!==void 0||C!==void 0)w.rate={max:g.rateMax??0,duration:C??0};if(g.concurrency!==void 0)w.concurrency=g.concurrency;return w}function Ie(g){let w=qe(g.queue),C={};for(let N of g.names){let D=N.name.trim();if(D)C[D]=qe(N)}if(Object.keys(C).length>0)w.names=C;return w}function Qe({queue:g,limits:w,editable:C}){if(!C)return e(pt,{limits:w});return e(ht,{queue:g,limits:w},JSON.stringify(w))}function pt({limits:g}){if(!g||Object.keys(g).length===0)return e("p",{className:"muted",children:"No limits are set on this queue."});let w=(C)=>[C.rate&&`${C.rate.max} per ${L(C.rate.duration)}`,C.concurrency!==void 0&&`${C.concurrency} at once`].filter(Boolean).join(", ")||"none";return t("dl",{className:"limits-summary",children:[e("dt",{children:"Queue"}),e("dd",{children:w(g)}),Object.entries(g.names??{}).map(([C,N])=>t("div",{children:[e("dt",{children:C}),e("dd",{children:w(N)})]},C))]})}function Be({row:g,onChange:w,prefix:C,errors:N,label:D,scope:q}){let j=(H)=>N[`${C}${H}`],Q=q.kind==="queue"?"jobs on this queue":q.name?`jobs named “${q.name}”`:"jobs with this name";return t("div",{className:"field-row limits-row",children:[e(u,{label:`${D}: rate max`,hint:`The most ${Q} that may START in one rate window, across every worker. Set it with the window beside it; leave both empty for no rate limit.`,error:j("rate.max")??j("rate"),children:e(V,{value:g.rateMax,onChange:(H)=>w({...g,rateMax:H}),min:1})}),e(u,{label:`${D}: rate window`,hint:"The length of the rate window: milliseconds (60000), or a duration such as “1 minute” or “30 seconds”. Starts are counted over this window.",error:j("rate.duration"),children:e(M,{value:g.rateDuration,onChange:(H)=>w({...g,rateDuration:H}),maxLength:100})}),e(u,{label:`${D}: concurrency`,hint:`The most ${Q} that may RUN at once, counted across every worker — on top of each worker's own concurrency, which still applies. A worker that dies holds its share until its lock expires. Empty means no limit.`,error:j("concurrency"),children:e(V,{value:g.concurrency,onChange:(H)=>w({...g,concurrency:H}),min:1})})]})}function ht({queue:g,limits:w}){let C=s(),[N,D]=r(()=>$e(w)),[q,j]=r(!1),Q=O({mutationFn:(B)=>Na(C,g,B),successMessage:(B,ae)=>ae===null?`Removed the limits of ${g}`:`Saved the limits of ${g}`,invalidate:ce(g),toastErrors:!1}),H=(B)=>{B?.preventDefault(),Q.mutate(Ie(N))},G=E(Q.error)&&Q.error.code==="LIMITS_CONTENDED",oe=Q.error&&(Object.keys(Q.fieldErrors).length===0||Q.unplacedIssues.length>0)?Q.error:null,X=N.names.reduce((B,ae)=>Math.max(B,ae.key+1),0);return t(n,{children:[t("form",{className:"limits-editor","aria-label":"Queue limits",onSubmit:H,children:[e(Be,{row:N.queue,onChange:(B)=>D({...N,queue:B}),prefix:"",errors:Q.fieldErrors,label:"Queue",scope:{kind:"queue"}}),t("fieldset",{className:"limits-names",children:[e("legend",{children:"Per-name limits"}),N.names.length===0&&e("p",{className:"muted",children:"None."}),N.names.map((B,ae)=>t("div",{className:"limits-name",children:[e(u,{label:`Name ${ae+1}`,hint:"The job name these limits apply to, exactly as jobs are added with it (e.g. “send-email”). They apply on top of the queue's own. A name at its limit is skipped, not waited behind, so other names keep running.",children:e(M,{value:B.name,onChange:(U)=>D({...N,names:N.names.map((le)=>le.key===B.key?{...le,name:U}:le)}),maxLength:200})}),e(Be,{row:B,onChange:(U)=>D({...N,names:N.names.map((le)=>le.key===B.key?{...le,...U}:le)}),prefix:`names.${B.name.trim()}.`,errors:Q.fieldErrors,label:B.name.trim()||`Name ${ae+1}`,scope:{kind:"name",name:B.name.trim()}}),t(a,{size:"sm",variant:"ghost",onClick:()=>D({...N,names:N.names.filter((U)=>U.key!==B.key)}),children:["Remove ",B.name.trim()||`name ${ae+1}`]})]},B.key)),e(a,{size:"sm",onClick:()=>D({...N,names:[...N.names,{key:X,name:"",rateMax:void 0,rateDuration:"",concurrency:void 0}]}),children:"Add a name"})]}),oe!==null&&e(A,{error:oe,title:G?"The limits changed while saving. Retry to save again.":"Could not save the limits",onRetry:G?()=>H():void 0}),t("div",{className:"form-actions",children:[e(a,{type:"submit",variant:"primary",disabled:Q.isPending,"aria-busy":Q.isPending||void 0,children:Q.isPending?"Saving…":"Save limits"}),w!==null&&e(a,{variant:"danger",onClick:()=>j(!0),disabled:Q.isPending,children:"Remove all limits…"})]})]}),e(k,{open:q,onClose:()=>j(!1),title:`Remove every limit on ${g}?`,description:"Workers stop rate-limiting and capping this queue once they refresh their limits.",variant:"danger",confirmLabel:"Remove limits",onConfirm:()=>Q.mutateAsync(null)})]})}var bt=20;function vt(g,w){if(!E(g)||g.code!=="REPEATABLE_NOT_FOUND")return g;return new K({kind:g.kind,status:g.status,code:g.code,title:g.title,detail:`The repeat series “${w}” no longer exists: somebody removed it, or it ended. Refresh to see the series there are now.`,type:g.type,issues:g.issues,context:g.context,instance:g.instance,cause:g})}function We({queue:g,canRemove:w,canDisable:C=!1,canEnable:N=!1}){let D=s(),[q,j]=r(null),Q=ue("repeatables"),H=i({queryKey:ee.repeatables(g),queryFn:({signal:U})=>Ra(D,g,U),refetchInterval:Q}),G=O({mutationFn:(U)=>Aa(D,g,U),successMessage:(U,le)=>`Removed the repeat series ${le}`,invalidate:ce(g),toastErrors:!1}),oe=O({mutationFn:async({key:U,to:le})=>{try{return le==="disable"?await Ta(D,g,U):await Da(D,g,U)}catch(pe){throw vt(pe,U)}},successMessage:(U,{key:le,to:pe})=>pe==="disable"?`Disabled the repeat series ${le}: it schedules nothing until enabled`:`Enabled the repeat series ${le}: its next occurrence is scheduled from now`,errorTitle:"Could not change the repeat series",invalidate:ce(g)}),X=H.data?.items??[],B=kt(X,bt);if(H.isPending)return e(f,{label:"Loading repeatables",showLabel:!0});if(H.isError)return e(A,{error:H.error,title:"Could not load repeatables",onRetry:()=>void H.refetch()});let ae=w||X.some((U)=>U.disabled?N:C);if(X.length===0)return e(d,{title:"No repeatables",description:"No repeat series is scheduled on this queue."});return t(n,{children:[t(I,{label:`Repeatables of ${g}`,children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Key"}),e("th",{scope:"col",children:"Name"}),e("th",{scope:"col",children:"Schedule"}),e("th",{scope:"col",children:"Next run"}),e("th",{scope:"col",className:"num",children:"Runs"}),e("th",{scope:"col",children:"Data"}),ae&&e("th",{scope:"col",children:e("span",{className:"visually-hidden",children:"Actions"})})]})}),e("tbody",{children:B.rows.map((U)=>t("tr",{"data-testid":`repeatable-row-${U.key}`,children:[t("th",{scope:"row",children:[e("code",{children:U.key}),U.disabled&&t(n,{children:[" ",e(p,{tone:"warning",title:"Schedules nothing until it is enabled",children:"Disabled"})]})]}),e("td",{children:U.name}),e("td",{children:bo(U)}),e("td",{"data-testid":`repeatable-next-${U.key}`,children:U.disabled?"paused (disabled)":e(v,{value:U.nextRunAt})}),t("td",{className:"num",children:[o(U.count),U.limit!==void 0&&` / ${o(U.limit)}`]}),e("td",{className:"repeatable-data",children:U.data===void 0?"—":e(ie,{value:U.data,label:`Data of ${U.key}`,expandDepth:0})}),ae&&e("td",{children:t("div",{className:"repeatable-actions",children:[C&&!U.disabled&&e(Fe,{series:U,to:"disable",pending:oe.isPending&&oe.variables?.key===U.key,onClick:()=>oe.mutate({key:U.key,to:"disable"})}),N&&U.disabled&&e(Fe,{series:U,to:"enable",pending:oe.isPending&&oe.variables?.key===U.key,onClick:()=>oe.mutate({key:U.key,to:"enable"})}),w&&e(a,{size:"sm",variant:"danger","aria-label":`Remove repeatable ${U.key}`,onClick:()=>j(U),children:"Remove…"})]})})]},U.key))})]}),B.paged&&e(ne,{label:"Repeatable pages",offset:B.offset,limit:B.limit,total:B.total,itemCount:B.rows.length,onChange:B.onChange}),e(k,{open:q!==null,onClose:()=>j(null),title:`Remove the repeat series ${q?.key??""}?`,description:"No further occurrences are scheduled. Jobs it already produced stay.",variant:"danger",confirmLabel:"Remove",onConfirm:()=>q?G.mutateAsync(q.key):void 0})]})}function Fe({series:g,to:w,pending:C,onClick:N}){let D=w==="disable"?"Disable":"Enable";return e(a,{size:"sm","aria-label":`${D} repeatable ${g.key}`,disabled:C,"aria-busy":C||void 0,onClick:N,children:C?`${w==="disable"?"Disabling":"Enabling"}…`:D})}var Ke="Its policy is known only where its controller runs.",wt="(provider default)",xt="While the summoner is not ready, the configured values; once it is, they may be lowered to a wake pool's size.",He="The policy does not set this: the default applies.",Ge="Set for this queue by the unit's overrides.";function Je(g,w){if(!g)return"none";if(!w.local)return"elsewhere";return w.policy===void 0?"none":"shown"}function fe(g,w,C="",N=!1){return{joiner:C,text:g,keys:w,muted:N}}var je={onAdd:"On add",events:"Events",poll:"Poll"},Pt={onAdd:"triggers.onAdd",events:"triggers.events",poll:"triggers.poll"},_e={"any-worker":"any live worker","summoned-only":"summoned workers only"};function Ve(g,w){return typeof w==="string"&&Object.hasOwn(g,w)}function St(g){let w=Object.entries(g).filter(([N])=>N!=="kind").map(([N,D])=>`${N}: ${l(D)}`),C=l(g.kind);return w.length===0?C:`${C} (${w.join(", ")})`}function Ct(g){let w=[];return g.forEach((C,N)=>{let D=w.length===0?"":" · ";if(!Ve(je,C.kind)){w.push(fe(St(C),[],D,C.on===!1));return}let q=je[C.kind],j=Pt[C.kind];if(C.on!==!0){w.push(fe(`${q} off`,[j],D,!0));return}if(C.kind==="poll"){w.push(fe(typeof C.every==="number"?`${q} every ${L(C.every)}`:q,[j],D));return}w.push(fe(q,[j],D));let Q=C.debounce,H=g.slice(N+1).some((G)=>G.on===!0&&(G.kind==="onAdd"||G.kind==="events")&&G.debounce===Q);if(typeof Q==="number"&&!H)w.push(fe(`(coalesced ${L(Q)})`,["triggers.debounce"]," "))}),w}function Ye(g){return g===null?"one regardless of depth":`${h(g,"job")} per worker`}function Nt(g){if(g.signal==="none")return"no stop signal (in-invocation)";let w=typeof g.graceMaxMs==="number"?` (up to ${L(g.graceMaxMs)})`:"";return`${l(g.signal)}, ${L(g.graceMs)} grace${w}`}function Tt(g,w){let C=(D)=>D.length>0&&D.every((q)=>!w.has(q)),N=g.pieces.length>0&&g.pieces.every((D)=>C(D.keys));return{id:g.id,label:g.label,...g.hint===void 0?{}:{hint:g.hint},tag:N,parts:g.pieces.map((D)=>({...D,muted:D.muted===!0,tag:!N&&C(D.keys)}))}}function Xe(g,w){let C=new Set(Array.isArray(g.explicit)?g.explicit:[]),N=g.circuit.group;return[{id:"triggers",label:"Triggers",pieces:Ct(g.triggers),hint:"What makes the controller check for work to summon for."},{id:"workers",label:"Workers",pieces:[fe(`at most ${o(g.maxWorkers)}`,["maxWorkers"]),fe(Ye(g.jobsPerWorker),["jobsPerWorker"]," · "),fe(`at most ${o(g.maxPending)} starting`,["maxPending"]," · ")],hint:xt},{id:"cooldown",label:"Cooldown",pieces:[fe(L(g.cooldown),["cooldown"])],hint:"The least time between two attempts."},{id:"backoff",label:"Backoff",pieces:[fe(L(g.backoff.initial),["backoff.initial"]),fe(`doubling to ${L(g.backoff.max)}`,["backoff.max"],", ")],hint:"The wait after a failed or lost attempt, doubling with each one in a row."},{id:"circuit",label:"Circuit",pieces:[fe(`opens after ${h(g.circuit.failures,"failure")}`,["circuit.failures"]),fe(`for ${L(g.circuit.resetAfter)}`,["circuit.resetAfter"],", ")],hint:"Failed or lost attempts in a row that stop summoning, and for how long before one trial attempt."},N!==void 0&&{id:"group-circuit",label:"Group circuit",pieces:[fe(`opens after ${h(N.failures,"failure")} across the group`,["group.circuit.failures"]),fe(`for ${L(N.resetAfter)}`,["group.circuit.resetAfter"],", ")],hint:"The summon group's shared circuit: failures of this summoner's kind on any of its queues."},{id:"boot-budget",label:"Boot budget",pieces:[typeof g.bootBudget==="number"?fe(L(g.bootBudget),["bootBudget"]):fe(wt,[])],hint:"How long an attempt counts as a worker on its way before it is lost."},{id:"lifetime",label:"Longest life",pieces:[fe(L(g.maxLifetime),["maxLifetime"]),...typeof w?.maxLifetimeMs==="number"?[fe(`platform cap ${L(w.maxLifetimeMs)}`,[]," · ")]:[]],hint:"The longest a summoned worker may live."},w!==void 0&&{id:"shutdown",label:"Shutdown",pieces:[fe(Nt(w.shutdown),[])],hint:"What the platform sends to stop a unit, and how long it waits: declared by the provider, not set by the policy."},w?.style==="scale"&&{id:"scale-down",label:"Scale down",pieces:[fe(`to zero after ${L(g.scaleDown.after)} idle`,["scaleDown.after"])]},{id:"summon-timeout",label:"Summon timeout",pieces:[fe(L(g.summonTimeout),["summonTimeout"])],hint:"How long one call to the summoner may take."},{id:"served-by",label:"Served by",pieces:[fe(Ve(_e,g.servedBy)?_e[g.servedBy]:l(g.servedBy),["servedBy"])],hint:"Which live workers count as serving the queue."},{id:"env",label:"Env",pieces:[{...fe("none",["env"]),names:g.env.map((q)=>l(q))}],hint:"The names the policy adds to every summoned worker's environment. Their values are never sent."},{id:"from-summoned",label:"From summoned workers",pieces:[fe(g.fromSummoned?"yes":"no",["fromSummoned"])],hint:"Whether this controller may run in a summoned process or a runner child."},{id:"failure-hook",label:"Failure hook",pieces:[fe(g.onSummonFailed?"set":"not set",["onSummonFailed"])],hint:"Whether an onSummonFailed hook is called on failed attempts."}].filter((q)=>q!==!1).map((q)=>Tt(q,C))}function et(g){if(g.perQueue===void 0)return;return Object.entries(g.perQueue).map(([w,C])=>{let N=Array.isArray(C.explicit)?C.explicit:[];return{queue:l(w),jobsPerWorker:Ye(C.jobsPerWorker),maxWorkers:o(C.maxWorkers),jobsPerWorkerOverride:N.includes("jobsPerWorker"),maxWorkersOverride:N.includes("maxWorkers")}})}function tt(g){return g!==void 0&&Array.isArray(g.explicit)&&!g.explicit.includes("budget")}function nt({queue:g}){let w=s(),C=re(),N=ue("summon"),[D,q]=r(null),[j,Q]=r(!0),[H,G]=r(!1),oe=se("summonResetBudget")===!0,X=se("summonPolicy")===!0,B=i({queryKey:ke.status(w,g),queryFn:({signal:ge})=>$n(w,g,ge),refetchInterval:N,placeholderData:z}),ae=te(),U=Lt(B.data?.queues),le=(ge)=>{if(B.data?.queues!==void 0&&E(ge)&&ge.status===403)ae.error(Zo,{description:ge.detail??ge.title})},pe=[...ke.changed(w,g),Zt.queue(g),ee.workers(g)],he=O({mutationFn:(ge)=>Lo(w,g,ge),successMessage:(ge)=>Yo(ge),invalidate:pe,toastErrors:!1,onError:le}),be=O({mutationFn:(ge)=>Uo(w,g,ge?{budget:!0}:{}),successMessage:(ge,dt)=>dt?`Reset the summon state of ${g}: failures, backoff, circuit and budget usage cleared`:`Reset the summon state of ${g}: failures, backoff and circuit cleared`,invalidate:pe,toastErrors:!1,onError:le});if(B.isPending)return e(f,{label:"Loading summon status",showLabel:!0});if(B.isError)return e(A,{error:B.error,title:"Could not load the summon status",onRetry:()=>void B.refetch()});if(B.data===null)return e(d,{title:"No summoner here",description:"No summon controller for this queue runs in this API's process."});let J=B.data,xe=Je(X,J),we=Xo(J,U??C("queues.summon"));return t("div",{className:"summon-panel","data-testid":"queue-summon",children:[J.inert&&e("p",{className:"notice",role:"note","data-testid":"summon-inert",children:bn(J.inertReason)}),!J.local&&e("p",{className:"notice",role:"note","data-testid":"summon-stored",children:"This queue's controller runs in another process: its state is read from the store, and it can be summoned or reset only from there."}),J.overlaps!==void 0&&J.overlaps.length>0&&e("p",{className:"notice",role:"note","data-testid":"summon-overlaps",children:J.queues===void 0?`Workers summoned for another summon group (${J.overlaps.map(l).join(", ")}) were seen on this queue at the last check: two units may be serving the same queue.`:`Workers summoned for another summon group (${J.overlaps.map(l).join(", ")}) were seen on this unit's queues at the last check: two units may be serving the same queues.`}),e(Et,{status:J,queue:g,policy:xe==="shown"?J.policy:void 0}),J.group!==void 0&&e(Bo,{group:J.group,queue:g,kind:J.summoner?.provider.kind}),J.summoner&&e($t,{summoner:J.summoner}),xe==="shown"&&J.policy!==void 0&&e(It,{policy:J.policy,capabilities:J.summoner?.capabilities,queue:g}),xe==="elsewhere"&&e("p",{className:"muted","data-testid":"summon-policy-elsewhere",children:Ke}),Pr(J)&&J.pending.length>0&&e(Ft,{queue:g,queues:J.queues,pending:J.pending}),we&&t("div",{className:"summon-actions",role:"group","aria-label":"Summon actions",children:[e(a,{variant:"primary",onClick:()=>q("summon"),disabled:he.isPending,children:"Summon now…"}),e(a,{onClick:()=>{G(!1),q("reset")},disabled:be.isPending,children:"Reset…"})]}),e(k,{open:D==="summon",onClose:()=>q(null),title:`Summon a worker for ${g} now?`,description:"Runs one check of the queue's summon controller now. The circuit, the budget, the attempts already on their way and the guard against two controllers summoning at once all still apply.",confirmLabel:"Summon now",onConfirm:()=>he.mutateAsync(j),children:e(P,{checked:j,onChange:Q,label:"Skip the cooldown",hint:"Summon even if the last attempt was recent. Nothing else is skipped."})}),e(k,{open:D==="reset",onClose:()=>q(null),title:`Reset the summon state of ${g}?`,description:"Clears the consecutive failures, the backoff and an open circuit, so the next check may summon. Attempts already on their way are kept.",variant:"danger",confirmLabel:"Reset",onConfirm:()=>be.mutateAsync(oe&&H),children:oe&&e(P,{checked:H,onChange:G,label:"Also clear budget usage",hint:"Sets the attempts counted this UTC hour and today back to 0, so the budget allows its full limits again. Every controller on the queue shares the counts."})})]})}function Lt(g){let w=s(),{readOnly:C}=m(),N=rn({queries:(g??[]).map((D)=>({queryKey:_.permissions({queue:D}),queryFn:({signal:q})=>w.getPermissions({queue:D},q)}))});if(g===void 0)return;return!C&&N.length>0&&N.every((D)=>D.data!==void 0&&yt(D.data,"queues.summon"))}function Et({status:g,queue:w,policy:C}){let N=g.last===void 0?void 0:Dt(g.last.outcome),D=g.last===void 0?[]:kr(g.last),q=g.last===void 0?void 0:jo(g.last),j=Pr(g);return e(F,{items:[g.queues!==void 0&&{key:"unit",label:"Shared unit",value:e(qt,{queue:w,queues:g.queues}),hint:"One summoned process serves these queues, and this status is the unit's. Only the queues you may read are listed."},{key:"last",label:"Last outcome",value:g.last===void 0||N===void 0?e("span",{"data-testid":"summon-last",children:"None yet"}):t("span",{"data-testid":"summon-last",children:[e(p,{tone:N.tone,title:N.hint,children:N.label})," ",e(v,{value:g.last.at}),q!==void 0&&t("span",{className:"muted",children:[" — ",q]}),D.length>0&&e("span",{className:"summon-last-missing","data-testid":"summon-last-missing",children:Ho(D)})]}),hint:g.last!==void 0&&D.length>0?Go:void 0},j&&{key:"pending",label:"On their way",value:e("span",{"data-testid":"summon-pending-count",children:o(g.pending.length)}),hint:"Summon attempts still counting as workers on their way."},j&&{key:"failures",label:"Consecutive failures",value:e("span",{"data-testid":"summon-failures",children:o(g.failures)}),hint:"Failed, unavailable or lost attempts in a row, towards the circuit. A throttled call is not counted, and an auth or misconfiguration error counts enough to open it at once. A registration or a reset clears them."},j&&g.backoffUntil!==void 0&&{key:"backoff",label:"Backing off until",value:e("span",{"data-testid":"summon-backoff",children:e(v,{value:g.backoffUntil})})},j&&g.circuitOpenUntil!==void 0&&{key:"circuit",label:"Circuit open until",value:e("span",{"data-testid":"summon-circuit",children:e(v,{value:g.circuitOpenUntil})}),hint:"After repeated failures nothing is summoned until then, apart from one trial attempt."},j&&g.budget!==void 0&&{key:"budget",label:"Budget",value:t(n,{children:[e(Ze,{budget:g.budget,testId:"summon-budget",group:g.group!==void 0&&g.group.budget.off!==!0}),tt(C)&&t(n,{children:[" ",e(Re,{})]})]}),hint:yn(g.budget)}]})}function qt({queue:g,queues:w}){return t("span",{"data-testid":"summon-unit",children:["One process for ",h(w.length,"queue"),":"," ",w.map((C,N)=>{let D=C===g;return t("span",{children:[N>0&&", ",e(b,{to:Ue(C),title:`The Summon tab of ${C}`,children:l(C)}),D&&e("span",{className:"muted",children:" (this queue)"})]},C)})]})}function $t({summoner:g}){let{provider:w,capabilities:C,facts:N}=g,D=Object.entries(N),q=ft(g.readiness),j=Mt(g.providerId),Q=re(),H=l(w.displayName??w.kind);return t("div",{className:"summon-summoner","data-testid":"summon-summoner",children:[e("h3",{className:"summon-heading",children:"Summoner"}),e(F,{items:[{key:"provider",label:"Provider",value:t("span",{"data-testid":"summon-provider",children:[l(w.displayName??w.kind)," ",t("span",{className:"muted",children:[l(w.name)," ",l(w.version)]})]})},{key:"readiness",label:"Readiness",value:e(p,{tone:q.tone,title:q.hint,testId:"summon-readiness",children:q.label}),hint:q.hint},...C===void 0?[]:[{key:"style",label:"Style",value:qo(C.style)},{key:"boot",label:"Provider default boot budget",value:L(C.bootBudgetMs),hint:"How long an attempt counts as a worker on its way before it is lost, unless the policy sets its own."},{key:"lifetime",label:"Longest life",value:C.maxLifetimeMs===null?"No platform limit known":L(C.maxLifetimeMs)}],...D.map(([G,oe])=>({key:`fact-${G}`,label:l(G),value:e("code",{children:l(oe)})}))]}),g.providerId!==void 0&&j&&Q("providers.validate")&&e(Nn,{providerId:g.providerId,label:H})]})}function It({policy:g,capabilities:w,queue:C}){let N=Xe(g,w),D=et(g),q=N.flatMap((j)=>[{key:j.id,label:j.label,value:e(Bt,{row:j}),hint:j.hint},...j.id==="workers"&&D!==void 0?[{key:"per-queue",label:"Per queue",value:e(Qt,{queue:C,rows:D}),hint:"Each of the unit's queues' own capacity: what its demand alone may ask for."}]:[]]);return t("div",{className:"summon-policy","data-testid":"summon-policy",children:[e("h3",{className:"summon-heading",children:"Policy"}),e(F,{items:q})]})}function Bt({row:g}){return t("span",{"data-testid":`summon-policy-${g.id}`,children:[g.parts.map((w,C)=>t("span",{children:[w.joiner,e(Ot,{part:w}),w.tag&&t(n,{children:[" ",e(Re,{})]})]},C)),g.tag&&t(n,{children:[" ",e(Re,{})]})]})}function Ot({part:g}){if(g.names!==void 0&&g.names.length>0)return e("span",{className:"summon-policy-names",children:g.names.map((w)=>e("code",{children:w},w))});return e("span",{className:g.muted?"muted":void 0,children:g.text})}function Re(){return e("span",{className:"summon-policy-tag muted",title:He,"data-testid":"summon-policy-default",children:"default"})}function Qt({queue:g,rows:w}){return e("div",{"data-testid":"summon-policy-per-queue",children:t(I,{label:`Per-queue capacity of the unit serving ${g}`,children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Queue"}),e("th",{scope:"col",children:"Jobs per worker"}),e("th",{scope:"col",className:"num",children:"Max workers"})]})}),e("tbody",{children:w.map((C)=>t("tr",{"data-testid":`summon-policy-per-queue-${C.queue}`,children:[e("th",{scope:"row",children:C.queue}),t("td",{children:[C.jobsPerWorker,C.jobsPerWorkerOverride&&e(ot,{})]}),t("td",{className:"num",children:[C.maxWorkers,C.maxWorkersOverride&&e(ot,{})]})]},C.queue))})]})})}function ot(){return t(n,{children:[" ",e(p,{tone:"accent",title:Ge,testId:"summon-policy-override",children:"override"})]})}function Mt(g){let w=s(),C=m(),N=y("providers.read"),D=g!==void 0&&C.features.providers&&N,q=i({queryKey:Kt.list,queryFn:({signal:j})=>En(w,j),enabled:D,staleTime:30000});return D&&q.data?.providers.some((j)=>j.id===g&&j.preflight)===!0}function Ft({queue:g,queues:w,pending:C}){let N=C.some((q)=>q.handles!==void 0),D=Wo(C);return t(I,{label:`Summon attempts on their way for ${g}`,children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Attempt"}),e("th",{scope:"col",children:"Started"}),e("th",{scope:"col",children:"Lost unless a worker registers"}),e("th",{scope:"col",className:"num",children:"Workers"}),e("th",{scope:"col",children:"Summoner"}),D&&e("th",{scope:"col",children:Qo}),N&&e("th",{scope:"col",children:"Handles"})]})}),e("tbody",{children:C.map((q)=>t("tr",{"data-testid":`summon-pending-${q.id}`,children:[e("th",{scope:"row",children:e("code",{children:l(q.id)})}),e("td",{children:e(v,{value:q.at})}),e("td",{children:e(v,{value:q.until})}),e("td",{className:"num",children:o(q.count)}),e("td",{children:l(q.kind)}),D&&e("td",{children:e(Wt,{attempt:q.id,badges:$o(q.coverage,w,g)})}),N&&e("td",{children:q.handles?.map((j)=>e("code",{className:"worker-target-file",children:l(j)},j))})]},q.id))})]})}function Wt({attempt:g,badges:w}){if(w===void 0||w.length===0)return e("span",{className:"muted",children:Ko});return e("ul",{className:"summon-coverage",children:w.map((C)=>t("li",{children:[e(p,{tone:C.tone,title:C.title,testId:`summon-coverage-${g}-${C.queue}`,children:C.label}),C.current&&e("span",{className:"muted",children:" (this queue)"})]},C.queue))})}var Ce=[15,60,360,1440],at=60,Ne={15:"Last 15 minutes",60:"Last hour",360:"Last 6 hours",1440:"Last 24 hours"},ve=120,rt=2,jt=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"});function Se(g){return jt.format(new Date(g))}function it(g){let w=Number(g);return Ce.find((C)=>C===w)??60}function st({queue:g}){let w=s(),[C,N]=W(),D=it(C.get("window")),q=c(),j=ue("throughput"),Q=i({queryKey:ee.throughput(g,D),queryFn:({signal:H})=>va(w,g,D,H),refetchInterval:j,placeholderData:z});return t("div",{className:"throughput-panel",children:[t("div",{className:"throughput-controls",children:[e("label",{htmlFor:q,children:"Window"}),e(S,{id:q,options:Ce.map((H)=>({value:String(H),label:Ne[H]})),value:String(D),onChange:(H)=>N({window:H===String(at)?null:H})})]}),Q.isPending?e(f,{label:"Loading throughput",showLabel:!0}):Q.isError?e(A,{error:Q.error,title:"Could not load throughput",onRetry:()=>void Q.refetch()}):e(_t,{data:Q.data,label:`${g}: jobs per minute, ${Ne[D].toLowerCase()}`})]})}function _t({data:g,label:w}){let{buckets:C}=g,N=Math.max(1,...C.map((Q)=>Q.completed+Q.failed)),D=Math.max(1,C.length)*10,q=(Q)=>Q/N*ve,j=`${w}: ${o(g.completed)} completed, ${o(g.failed)} failed, peak ${o(N)} per minute.`;return t("figure",{className:"throughput-chart",children:[t("div",{className:"throughput-legend","aria-hidden":"true",children:[t("span",{children:[e("span",{className:"swatch swatch-completed"})," Completed"," ",o(g.completed)]}),t("span",{children:[e("span",{className:"swatch swatch-failed"})," Failed"," ",o(g.failed)]}),t("span",{className:"muted",children:["Peak ",o(N),"/min"]})]}),t("svg",{role:"img","aria-label":j,viewBox:`0 0 ${D} ${ve}`,preserveAspectRatio:"none",className:"throughput-svg",children:[e("line",{x1:0,x2:D,y1:ve,y2:ve,className:"throughput-baseline"}),C.map((Q,H)=>{let G=H*10+1,oe=q(Q.completed),X=q(Q.failed),B=oe>0&&X>0?rt:0;return t("g",{children:[e("title",{children:`${Se(Q.at)}: ${Q.completed} completed, ${Q.failed} failed`}),e("rect",{x:G-1,y:0,width:10,height:ve,className:"throughput-hit"}),oe>0&&e("rect",{x:G,y:ve-oe,width:8,height:oe,rx:1,className:"bar-completed"}),X>0&&e("rect",{x:G,y:ve-oe-B-X,width:8,height:X,rx:1,className:"bar-failed"})]},Q.at)})]}),C.length>0&&t("figcaption",{className:"throughput-axis","aria-hidden":"true",children:[e("span",{children:Se(C[0].at)}),e("span",{children:Se(C.at(-1).at)})]}),t("table",{className:"visually-hidden",children:[e("caption",{children:w}),e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Minute"}),e("th",{scope:"col",children:"Completed"}),e("th",{scope:"col",children:"Failed"})]})}),e("tbody",{children:C.map((Q)=>t("tr",{children:[e("th",{scope:"row",children:Se(Q.at)}),e("td",{children:Q.completed}),e("td",{children:Q.failed})]},Q.at))})]})]})}function lt(g){let w=g.filter((N)=>N.sweeps!==void 0);if(w.length===0)return null;if(w.some((N)=>N.sweeps===!0))return null;let C=w.length<g.length;return{message:C?`No live worker on this queue reports that it runs housekeeping, and some are too old to say — so there may be nobody doing it. ${"Jobs still run — delayed jobs are promoted and stalled ones recovered — but expired results, repeat series and stale queue state are not swept."}`:`No live worker on this queue runs housekeeping. ${"Jobs still run — delayed jobs are promoted and stalled ones recovered — but expired results, repeat series and stale queue state are not swept."}`,uncertain:C}}var Ut=25;function ut({queue:g}){let w=s(),C=ue("workers");pn(g,y("queues.read"));let N=Oe(),D=i({queryKey:ee.workers(g),queryFn:({signal:H})=>Oa(w,g,H),refetchInterval:C});if(D.isPending)return e(f,{label:"Loading workers",showLabel:!0});if(D.isError)return e(A,{error:D.error,title:"Could not load workers",onRetry:()=>void D.refetch()});let q=D.data.items;if(q.length===0)return e(d,{title:"No live workers",description:"No worker has reported for this queue recently."});let j=q.some((H)=>H.host!==void 0||H.pid!==void 0),Q=lt(q);return t(n,{children:[Q&&e("p",{className:"workers-sweep-note",role:"note","data-testid":"sweep-warning","data-uncertain":Q.uncertain?"true":"false",children:Q.message}),e(At,{workers:q,label:`Workers of ${g}`,showQueue:!1,showHost:j,linkKeys:N,pageSize:Ut})]})}var Ht=["completed","failed","dead","waiting","delayed","waiting-children"],Gt=["failed","dead","completed"],zt=[{value:"minutes",label:"minutes"},{value:"hours",label:"hours"},{value:"days",label:"days"}];function mt({queue:g,paused:w}){let C=s(),N=re(),[D,q]=r(null),j=()=>q(null),Q=ce(g),H=O({mutationFn:()=>ma(C,g),successMessage:`Paused ${g}`,errorTitle:`Could not pause ${g}`,invalidate:Q}),G=O({mutationFn:()=>pa(C,g),successMessage:`Resumed ${g}`,errorTitle:`Could not resume ${g}`,invalidate:Q}),oe=w===!1&&N("queues.pause"),X=w===!0&&N("queues.resume"),B=N("queues.drain"),ae=N("queues.clean"),U=N("jobs.retryAll");if(!oe&&!X&&!B&&!ae&&!U)return null;return t("div",{className:"queue-actions",role:"group","aria-label":"Queue actions",children:[oe&&e(a,{onClick:()=>H.mutate(),disabled:H.isPending,"aria-busy":H.isPending||void 0,children:"Pause"}),X&&e(a,{variant:"primary",onClick:()=>G.mutate(),disabled:G.isPending,"aria-busy":G.isPending||void 0,children:"Resume"}),U&&e(a,{onClick:()=>q("retryAll"),children:"Retry all…"}),ae&&e(a,{variant:"danger",onClick:()=>q("clean"),children:"Clean…"}),B&&e(a,{variant:"danger",onClick:()=>q("drain"),children:"Drain…"}),D==="drain"&&e(Jt,{queue:g,onClose:j}),D==="clean"&&e(Vt,{queue:g,onClose:j}),D==="retryAll"&&e(Yt,{queue:g,onClose:j})]})}function Jt({queue:g,onClose:w}){let C=s(),[N,D]=r(!1),q=O({mutationFn:(j)=>fa(C,g,j),successMessage:(j)=>`Drained ${h(j.count,"job")} from ${g}`,invalidate:ce(g),toastErrors:!1});return e(k,{open:!0,onClose:w,title:`Drain ${g}?`,description:"Removes every waiting job (and, if chosen, every delayed one). Running jobs are not touched. This cannot be undone.",variant:"danger",confirmLabel:"Drain",pendingLabel:"Draining…",confirmText:g,onConfirm:()=>q.mutateAsync(N),children:e(P,{checked:N,onChange:D,label:"Also remove delayed jobs"})})}function Vt({queue:g,onClose:w}){let C=s(),{limits:N}=m(),D=te(),[q,j]=r("completed"),[Q,H]=r(1),[G,oe]=r("days"),[X,B]=r(N.defaultClean),ae=O({mutationFn:(he)=>ha(C,g,he),onSuccess:(he)=>{D.success(`Cleaned ${h(he.count,"job")} from ${g}`,{description:he.ids.length>0?`Removed: ${mn(he.ids)}`:void 0})},invalidate:ce(g),toastErrors:!1}),U=xo(Q,G),le=X!==void 0&&Number.isInteger(X)&&X>=1&&X<=N.maxClean,pe=(he)=>ae.fieldErrors[he];return t(k,{open:!0,onClose:w,title:`Clean ${g}?`,description:"Removes jobs in one state that are older than the age you give, up to the limit. This cannot be undone.",variant:"danger",confirmLabel:"Clean",pendingLabel:"Cleaning…",confirmText:g,confirmDisabled:U===void 0||!le,onConfirm:()=>ae.mutateAsync({state:q,olderThan:U??0,limit:X}),children:[e(u,{label:"State",error:pe("state"),children:e(S,{options:Ht.map((he)=>({value:he,label:Y[he]})),value:q,onChange:j})}),t("div",{className:"field-row",children:[e(u,{label:"Older than",error:pe("olderThan"),required:!0,children:e(V,{value:Q,onChange:H,min:0,step:"any"})}),e(u,{label:"Unit",children:e(S,{options:zt,value:G,onChange:oe})})]}),e(u,{label:"Limit",hint:`At most ${o(N.maxClean)}.`,error:pe("limit")??(le?void 0:`Between 1 and ${o(N.maxClean)}.`),children:e(V,{value:X,onChange:B,min:1,max:N.maxClean})})]})}function Yt({queue:g,onClose:w}){let C=s(),{limits:N}=m(),D=te(),[q,j]=r("failed"),[Q,H]=r(""),[G,oe]=r(""),[X,B]=r(N.maxRetryAll),[ae,U]=r(!0),le=O({mutationFn:(J)=>ga(C,g,J),onSuccess:(J)=>{D.success(`Retried ${h(J.count,"job")} in ${g}`,{description:J.ids.length===0?void 0:`${mn(J.ids)}${J.truncated?` (ids of the first ${N.maxRetryAllIds} only)`:""}`})},invalidate:ce(g),toastErrors:!1}),pe=X!==void 0&&Number.isInteger(X)&&X>=1&&X<=N.maxRetryAll,he=E(le.error)&&le.error.code==="OPERATION_IN_PROGRESS",be=(J)=>le.fieldErrors[J];return t(k,{open:!0,onClose:w,title:`Retry every ${Y[q].toLowerCase()} job in ${g}?`,description:"Moves matching jobs back to waiting. It runs to completion before answering, which can take a while on a large queue.",confirmLabel:"Retry all",pendingLabel:"Retrying… this can take a while",confirmText:g,confirmDisabled:!pe,onConfirm:()=>le.mutateAsync({state:q,name:Q.trim()||void 0,reason:G.trim()||void 0,limit:X,resetAttempts:ae}),children:[e(u,{label:"State",error:be("state"),children:e(S,{options:Gt.map((J)=>({value:J,label:Y[J]})),value:q,onChange:j})}),e(u,{label:"Job name",hint:"Optional: only jobs with exactly this name.",error:be("name"),children:e(M,{value:Q,onChange:H,maxLength:200})}),e(u,{label:"Failure reason contains",hint:"Optional: a plain substring of “ErrorName: message”.",error:be("reason"),children:e(M,{value:G,onChange:oe,maxLength:500})}),e(u,{label:"Limit",hint:`At most ${o(N.maxRetryAll)}.`,error:be("limit")??(pe?void 0:`Between 1 and ${o(N.maxRetryAll)}.`),children:e(V,{value:X,onChange:B,min:1,max:N.maxRetryAll})}),e(P,{checked:ae,onChange:U,label:"Reset attempts"}),he&&e("p",{className:"notice",role:"note","data-testid":"retry-all-in-progress",children:"A retry-all is already running on this queue. Only one runs per queue at a time; wait for it to finish, then try again."})]})}function Xt(){let{queue:g=""}=de(),w=s(),C=m(),N=y("queues.read"),D=y("jobs.list"),q=y("jobs.add"),j=y("repeatables.list"),Q=gt(),H=ue("detail"),G=ue("counts");Ia(g,{enabled:N&&Q,jobs:D,repeatables:j});let[oe,X]=r(!1),B=T(null),[ae,U]=r(!1),le=T(null),pe=i({queryKey:ee.detail(g),queryFn:({signal:we})=>da(w,g,we),refetchInterval:H,enabled:N}),he=i({queryKey:ee.counts(g),queryFn:({signal:we})=>ca(w,g,we),refetchInterval:G,enabled:N});if(N&&pe.isError&&!pe.data)return e("div",{className:"screen",children:e(x,{headingLevel:1,error:pe.error,title:`Could not load the queue ${g}`,onRetry:()=>void pe.refetch()})});let be=ta(C,q),J=be&&C.features.addFlow,xe=he.data?Z.reduce((we,ge)=>we+he.data[ge],0):pe.data?.total;return t("div",{className:"screen queue-screen","data-testid":"queue-screen",children:[t("nav",{"aria-label":"Breadcrumb",className:"breadcrumb",children:[e(b,{to:"/queues",children:"Queues"}),e("span",{"aria-hidden":"true",children:" / "})]}),t("header",{className:"queue-header",children:[t("div",{className:"queue-heading",children:[e("h1",{className:"screen-title",children:g}),pe.data?.paused&&e(p,{tone:"warning",children:"Paused"}),xe!==void 0&&t("span",{className:"queue-total","data-testid":"queue-total",children:[o(xe)," jobs"]}),he.dataUpdatedAt>0&&t("span",{className:"muted queue-updated",children:["Updated ",e(v,{value:he.dataUpdatedAt})]})]}),t("div",{className:"queue-toolbar",children:[be&&e(a,{ref:B,variant:"primary",onClick:()=>X(!0),children:"Add job"}),J&&e(a,{ref:le,onClick:()=>U(!0),children:"Add flow"}),e(mt,{queue:g,paused:pe.data?.paused})]})]}),be&&e(Pn,{queue:g,open:oe,onClose:()=>{X(!1),B.current?.focus()}}),J&&ae&&e(Zr,{queue:g,open:!0,onClose:()=>{U(!1),le.current?.focus()}}),D?e(R,{title:"Jobs",children:e(Eo,{queue:g,counts:he.data})}):e(d,{title:"Jobs hidden",description:"You may not list this queue's jobs."}),e(eo,{queue:g,limits:pe.data?pe.data.limits:void 0,detailLoading:N&&pe.isPending})]})}function eo({queue:g,limits:w,detailLoading:C}){let N=m(),D=re(),q=y("workers.list"),j=y("queues.read"),Q=y("metrics.read"),H=y("repeatables.list"),G=Le(),oe=s(),X=i({queryKey:ke.status(oe,g),queryFn:({signal:pe})=>$n(oe,g,pe),enabled:j,retry:!1}),B=[];if(N.features.limits&&(w!==void 0||C))B.push({value:"limits",label:"Limits",render:()=>w===void 0?e(f,{label:"Loading limits",showLabel:!0}):e(Qe,{queue:g,limits:w,editable:D("queues.limits")})});if(G.shown)B.push({value:"job-defaults",label:"Job defaults",render:()=>e(ka,{queue:g,canEdit:G.canEdit,canApply:G.canApply})});if(N.features.workers&&q)B.push({value:"workers",label:"Workers",render:()=>e(ut,{queue:g})});if(N.features.demand&&j)B.push({value:"demand",label:"Demand",render:()=>e(Ae,{queue:g})});if(j&&(X.isError||(X.data??null)!==null))B.push({value:"summon",label:"Summon",render:()=>e(nt,{queue:g})});if(N.features.throughput&&Q)B.push({value:"throughput",label:"Throughput",render:()=>e(st,{queue:g})});if(H)B.push({value:"repeatables",label:"Repeatables",render:()=>e(We,{queue:g,canRemove:D("repeatables.remove"),canDisable:D("repeatables.disable"),canEnable:D("repeatables.enable")})});let ae=B[0]?.value??"limits",U=ze("panel",B,ae);if(B.length===0)return null;let le=B.find((pe)=>pe.value===U)??B[0];return e(R,{title:"Details",className:"queue-panels",children:e(Rt,{tabs:B.map(({value:pe,label:he})=>({value:pe,label:he})),param:"panel",defaultValue:ae,label:"Queue details",children:le.render()})})}function to(){let g=s(),{limits:w}=m(),C=y("queues.list"),[N,D]=W(),q=c(),j=N.get("search")??"",Q=Me(j),H=Pe(me(N,"limit",Math.min(w.defaultPageSize,w.maxQueues)),w.maxQueues),G=me(N,"offset",0),oe={search:Q,offset:G,limit:H},X=ue("list");wa(C);let B=i({queryKey:ee.page(oe),queryFn:({signal:ae})=>ua(g,oe,ae),refetchInterval:X,placeholderData:z,enabled:C});if(!C)return t("div",{className:"screen",children:[e("h1",{className:"screen-title",children:"Queues"}),e(d,{title:"Nothing to show",description:"You may not list queues on this API."})]});return t("div",{className:"screen","data-testid":"queues-list",children:[e("h1",{className:"screen-title",children:"Queues"}),e(R,{title:"Queues",actions:t("div",{className:"search",children:[e("label",{htmlFor:q,className:"visually-hidden",children:"Search queues by name"}),e("input",{id:q,type:"search",className:"input",placeholder:"Search queues",...De,value:j,maxLength:200,onChange:(ae)=>D({search:ae.target.value,offset:null})})]}),children:B.isPending?e(f,{label:"Loading queues",showLabel:!0}):B.isError?e(x,{error:B.error,title:"Could not load queues",onRetry:()=>void B.refetch()}):B.data.items.length===0&&G===0?Q?e(d,{title:"No queues match",description:`No queue name contains “${Q}”.`}):e(d,{title:"No queues yet",description:"Queues appear here once a job is added to one."}):t(n,{children:[e(Yr,{items:B.data.items,sparklines:!1}),e(ne,{label:"Queue pages",offset:G,limit:H,total:B.data.page.total,itemCount:B.data.items.length,hasMore:B.data.page.hasMore,maxPageSize:w.maxQueues,onChange:(ae)=>D({offset:ae.offset>0?String(ae.offset):null,limit:String(ae.limit)})})]})})]})}export{Xt as QueueScreen,to as QueuesListScreen};
2
-
3
- //# debugId=0C6098001FCA115064756E2164756E21
4
- //# sourceMappingURL=index-j3h4v03g.js.map
@@ -1,4 +0,0 @@
1
- import{D,c,T,r,_t,An,Re,It,E,C,n,e,t,p,s,m,J,i,_,a,oe,f,fe,Ke,ce,o,Y,h,u,V,S,P,I,ue}from"./main-xf44bv26.js";import{v}from"./main-smabxbn4.js";import{L}from"./main-yjykmsvp.js";import{O}from"./main-zk3n47nq.js";import{A}from"./main-9qd3nqs5.js";import{F}from"./main-6xdkyzv1.js";var He=1000;function Te(l){return Math.max(1,Math.min(He,l))}function pe(l){return[..._.queue(l),"job-defaults"]}function ve(l,d=""){return`/queues/${C(l)}/job-defaults${d}`}function Ve(l){return Ke(l,"queue")&&typeof l.seq==="number"&&Array.isArray(l.overridden)&&typeof l.effective==="object"&&l.effective!==null&&typeof l.code==="object"&&l.code!==null&&typeof l.pending==="object"&&l.pending!==null}async function me(l,d,b){let g=ve(d),w=await l.request("GET",g,{signal:b});return fe(w,Ve,"job defaults",g)}function Be(l,d,b){return l.request("PUT",ve(d),{body:b})}function Oe(l,d,b){return l.request("DELETE",ve(d),{query:{expectedSeq:b}})}function Ce(l,d,b){return l.request("POST",ve(d,"/apply"),{body:b})}function Ee(){return{examined:0,rewritten:0,unchanged:0,skippedExplicit:0,skippedUnmarked:0,moved:0,exhausted:0,batches:0}}function ze(l,d){return{examined:l.examined+d.examined,rewritten:l.rewritten+d.rewritten,unchanged:l.unchanged+d.unchanged,skippedExplicit:l.skippedExplicit+d.skippedExplicit,skippedUnmarked:l.skippedUnmarked+d.skippedUnmarked,moved:l.moved+d.moved,exhausted:l.exhausted+d.exhausted,batches:l.batches+1}}async function Ne(l){let d=l.cursor,b=l.totals??Ee(),g=!0;for(;;){if(!g&&d!==void 0&&l.shouldStop())return{status:"cancelled",totals:b,cursor:d};g=!1;let w;try{w=await l.request(d)}catch(K){return{status:"failed",totals:b,cursor:d,error:K}}if(b=ze(b,w),l.onBatch?.(b,w),w.done||w.next===null)return{status:"done",totals:b};if(w.next===d)return{status:"failed",totals:b,cursor:d,error:Error("The API answered the same cursor it was sent, so the walk would never end.")};d=w.next}}var be={attempts:"number",backoff:"backoff",timeout:"number",priority:"number",removeOnComplete:"retention",removeOnFail:"retention",keepLogs:"number",keepStacktraces:"number"},W={attempts:{label:"Attempts",hint:"How many times a job runs before it is dead, the first run included."},backoff:{label:"Backoff",hint:"How long a failed job waits before its next attempt."},timeout:{label:"Timeout (ms)",hint:"How long one attempt may run before it fails; 0 means no timeout."},priority:{label:"Priority",hint:"Lower runs first."},removeOnComplete:{label:"Completed jobs",hint:"How long a completed job is kept."},removeOnFail:{label:"Dead jobs",hint:"How long a job that ran out of attempts is kept."},keepLogs:{label:"Log lines kept",hint:"The newest log lines each job keeps."},keepStacktraces:{label:"Stack traces kept",hint:"The failure stack traces each job keeps."}};function Ae(l){return Re[l]}var De="code";function We(l){return An.includes(l)}function Qe(l){if(typeof l==="number")return{type:"fixed",delay:l,max:void 0,jitter:void 0};return{type:We(l.type)?l.type:"fixed",delay:l.delay,max:l.max,jitter:typeof l.jitter==="number"?l.jitter:void 0}}function Xe(l){if(l===!0)return{mode:"remove",count:void 0,ttl:void 0};if(l===!1)return{mode:"keep",count:void 0,ttl:void 0};if(typeof l==="number")return{mode:"limit",count:l,ttl:void 0};return{mode:"limit",count:l.count,ttl:l.ttl}}function Pe(l,d){let b=be[l];if(b==="backoff")return Qe(d);if(b==="retention")return Xe(d);return d}function ge(l,d,b){if(l===void 0)return`Enter ${b}.`;if(!Number.isInteger(l)||l<d.min||l>d.max)return`${Ge(b)} must be a whole number from ${o(d.min)} to ${o(d.max)}.`;return}function Ge(l){return l.charAt(0).toUpperCase()+l.slice(1)}function Ze(l){let d=ge(l.delay,Re.backoffDelay,"a delay");if(d)return{error:d};let b=l.delay;if(l.max!==void 0){let w=ge(l.max,Re.backoffMax,"the longest delay");if(w)return{error:w};if(l.max<b)return{error:"The longest delay must be at least the delay."}}let g=Re.backoffJitter;if(l.jitter!==void 0&&!(l.jitter>=g.min&&l.jitter<=g.max))return{error:`Jitter must be from ${g.min} to ${g.max}.`};return{value:{type:l.type,delay:b,...l.max===void 0?{}:{max:l.max},...l.jitter===void 0?{}:{jitter:l.jitter}}}}function et(l){if(l.mode==="keep")return{value:!1};if(l.mode==="remove")return{value:!0};if(l.count===void 0&&l.ttl===void 0)return{error:"Enter a count, an age, or both."};if(l.count!==void 0){let d=ge(l.count,Re.retentionCount,"the count");if(d)return{error:d}}if(l.ttl!==void 0){let d=ge(l.ttl,Re.retentionTtl,"the age");if(d)return{error:d}}return{value:{...l.count===void 0?{}:{count:l.count},...l.ttl===void 0?{}:{ttl:l.ttl}}}}function tt(l,d){let b=be[l];if(b==="backoff")return Ze(d);if(b==="retention")return et(d);let g=ge(d,Ae(l),"a value");return g?{error:g}:{value:d}}function Se(l,d){let b=d;if(be[l]==="backoff"&&typeof d==="number")b={type:"fixed",delay:d};else if(be[l]==="retention"&&typeof d==="number")b={count:d};if(typeof b==="object"&&b!==null){let g=b;return JSON.stringify(Object.fromEntries(Object.keys(g).filter((w)=>g[w]!==void 0).sort().map((w)=>[w,g[w]])))}return JSON.stringify(b)}function _e(l,d){let b={},g=b,w=[],K={};for(let x of _t){if(!(x in d))continue;let R=d[x];if(R===De){if(l.overridden.includes(x))g[x]=null,w.push(x);continue}let U=tt(x,R);if("error"in U){K[x]=U.error;continue}if(Se(x,U.value)!==Se(x,l.effective[x]))g[x]=U.value,w.push(x)}return b.expectedSeq=l.seq,{body:b,changed:w,errors:K}}function ot(l){if(l===!0)return"removed at once";if(l===!1)return"kept forever";if(typeof l==="number")return`the newest ${o(l)} kept`;let d=[l.count!==void 0&&`the newest ${o(l.count)}`,l.ttl!==void 0&&`for ${L(l.ttl)}`].filter(Boolean);return d.length>0?`kept: ${d.join(", ")}`:"kept forever"}function nt(l){if(typeof l==="number")return l===0?"none":`fixed, ${L(l)}`;return[`${l.type??"fixed"}, ${L(l.delay??0)}`,l.max!==void 0&&`at most ${L(l.max)}`,l.jitter===!0&&"jitter",typeof l.jitter==="number"&&l.jitter>0&&`${Math.round(l.jitter*100)}% jitter`].filter(Boolean).join(", ")}function re(l,d){if(d===void 0||d===null)return"—";switch(l){case"backoff":return nt(d);case"removeOnComplete":case"removeOnFail":return ot(d);case"timeout":return d===0?"none":L(d);case"keepLogs":return d===0?"every line":o(d);default:return o(d)}}var ke="“Code” is what this API's own service is configured with. A producer in another service may be configured differently; a stored value replaces them all alike.",$e="Resetting changes jobs added from now on. It cannot restore jobs already rewritten by Apply to pending jobs: they keep the values written to them.",Le="This rewrites the jobs in place and cannot be undone: their previous values are not kept, so a later reset does not restore them.",Fe="Jobs added before this version of bun-jobs did not record which options their add() passed explicitly. Left unticked, they are skipped and counted. Ticked, every option of theirs is treated as a default, so a value their add() did pass may be replaced.",Ue="Attempts is being lowered. A job that has already made at least the new number of attempts is not dropped: it gets ONE final attempt, and dies if that fails.";function rt(l){return l.overridden.includes("attempts")&&l.effective.attempts<l.code.attempts}function Ie({queue:l,defaults:d,onClose:b}){let g=s(),w=m(),K=J(),[x,R]=r(d),[U,B]=r(It),[N,Q]=r(!1),[y,z]=r({kind:"confirm"}),[te,xe]=r(!1),[G,ae]=r(null),M=T(!1);D(()=>()=>{M.current=!0},[]);let he=y.kind==="running",ie=It.filter((j)=>U.includes(j)),ne=ie.reduce((j,H)=>j+x.pending[H],0),X=y.kind==="confirm"?y.preview:void 0,we=rt(x)||X!==void 0&&X.outcome.totals.exhausted>0,k=async(j,H)=>{M.current=!1;let ye=H?.totals??Ee();z({kind:"running",dryRun:j,totals:ye,stopping:!1});let ee=await Ne({cursor:H?.cursor,totals:ye,request:(le)=>{let de={seq:x.seq,states:[...ie],limit:Te(w.limits.maxApplyDefaults),dryRun:j,includeUnmarked:N};if(le!==void 0)de.cursor=le;return Ce(g,l,de)},onBatch:(le)=>z((de)=>de.kind==="running"?{...de,totals:le}:de),shouldStop:()=>M.current});if(!j&&ee.totals.batches>0)for(let le of ce(l))K.invalidateQueries({queryKey:le});if(ee.status==="failed"&&E(ee.error)&&ee.error.code==="DEFAULTS_CHANGED"){z({kind:"conflict",dryRun:j,totals:ee.totals});return}let Je={kind:"finished",dryRun:j,outcome:ee};z(j&&ee.status==="done"?{kind:"confirm",preview:Je}:Je)},q=async()=>{xe(!0),ae(null);try{let j=await me(g,l);K.setQueryData(pe(l),j),R(j),z({kind:"confirm"})}catch(j){ae(j)}finally{xe(!1)}},Z=(j,H)=>B((ye)=>H?[...ye,j]:ye.filter((ee)=>ee!==j)),se=x.overridden.length===0,je=`Apply to ${o(ne)} pending ${ne===1?"job":"jobs"}`;return t(oe,{open:!0,onClose:b,closeOnEscape:!he,closeOnBackdrop:!he,showCloseButton:!he,size:"lg",role:"alertdialog",title:`Apply the job defaults of ${l} to pending jobs?`,description:Le,footer:y.kind==="confirm"?t(n,{children:[e(a,{onClick:b,children:"Cancel"}),e(a,{onClick:()=>void k(!0),disabled:ie.length===0||se,children:X?"Preview again":"Preview (dry run)"}),e(a,{variant:"danger",onClick:()=>void k(!1),disabled:ie.length===0||se,children:je})]}):y.kind==="running"?e(a,{onClick:()=>{M.current=!0,z({...y,stopping:!0})},disabled:y.stopping,children:y.stopping?"Stopping after this batch…":"Cancel"}):t(n,{children:[y.kind==="finished"&&y.outcome.status!=="done"&&e(a,{onClick:()=>{let{outcome:j}=y;if(j.status!=="done")k(y.dryRun,{cursor:j.cursor,totals:j.totals})},children:"Continue from where it stopped"}),e(a,{variant:"primary",onClick:b,children:"Close"})]}),children:[y.kind==="confirm"&&t(n,{children:[t("p",{children:["Writes, into each pending job whose own ",e("code",{children:"add()"})," did not pass it:"]}),e("ul",{className:"job-defaults-apply-keys","aria-label":"Values written",children:x.overridden.map((j)=>t("li",{children:[W[j].label,":"," ",re(j,x.effective[j])]},j))}),se&&e("p",{role:"alert",children:"Nothing is overridden, so there is nothing to apply."}),t("fieldset",{className:"job-defaults-apply-states",children:[e("legend",{children:"States"}),It.map((j)=>e(P,{label:`${Y[j]} (${o(x.pending[j])})`,checked:U.includes(j),onChange:(H)=>Z(j,H)},j)),ie.length===0&&e("p",{className:"field-error",children:"Tick at least one state."})]}),e(P,{label:"Include jobs added before this version",hint:Fe,checked:N,onChange:Q}),t("p",{className:"muted",children:[h(ne,"pending job")," is an upper bound: jobs that passed these options explicitly, or were added before this version, are counted in it and left alone. Run a preview for the exact figure. Active, completed and dead jobs are never touched."]}),x.overridden.includes("priority")&&e("p",{className:"muted",children:"Changing priority re-sorts the backlog: until the walk ends, some jobs are re-sorted and others not yet."}),we&&t("p",{className:"job-defaults-warning","data-testid":"exhausted-warning",children:[Ue,X!==void 0&&X.outcome.totals.exhausted>0&&t(n,{children:[" ","The preview found"," ",h(X.outcome.totals.exhausted,"such job"),"."]})]}),X&&t("section",{"aria-label":"Preview",className:"job-defaults-preview",children:[e("h3",{children:"Preview: nothing was written"}),e(Me,{totals:X.outcome.totals,dryRun:!0})]})]}),y.kind==="running"&&t("div",{role:"status","aria-live":"polite","data-testid":"apply-progress",children:[t("p",{children:[y.dryRun?"Previewing":"Applying","… examined"," ",o(y.totals.examined)," of about"," ",o(ne),";"," ",y.dryRun?"would rewrite":"rewritten"," ",o(y.totals.rewritten)," so far (",h(y.totals.batches,"batch","batches"),")."]}),e("progress",{max:Math.max(ne,y.totals.examined,1),value:y.totals.examined,"aria-label":"Jobs examined"})]}),y.kind==="finished"&&e(at,{dryRun:y.dryRun,outcome:y.outcome}),y.kind==="conflict"&&t("div",{role:"alert",children:[t("p",{children:["The job defaults changed since you confirmed them — someone saved or reset them. Nothing more was"," ",y.dryRun?"previewed":"applied",".",!y.dryRun&&y.totals.rewritten>0&&` ${h(y.totals.rewritten,"job")} had already been rewritten with the values you confirmed.`," ","Re-read them, check them, and apply again."]}),G!==null&&e(A,{error:G}),e(a,{onClick:()=>void q(),disabled:te,"aria-busy":te||void 0,children:te?"Re-reading…":"Re-read the defaults"})]})]})}function at({dryRun:l,outcome:d}){let b=l?"Previewed":"Applied";return t("div",{"data-testid":"apply-result",children:[d.status==="done"&&t("p",{role:"status",children:[b," to every pending job in the chosen states."]}),d.status==="cancelled"&&t("p",{role:"status",children:["Stopped after ",h(d.totals.batches,"batch","batches"),". The jobs not reached yet keep their values; apply again to continue."]}),d.status==="failed"&&e(A,{error:d.error,title:`Stopped: a batch failed after ${h(d.totals.batches,"batch","batches")}`}),e(Me,{totals:d.totals,dryRun:l})]})}function Me({totals:l,dryRun:d}){return t(n,{children:[e(F,{className:"job-defaults-result",items:[{label:"Examined",value:o(l.examined)},{label:d?"Would be rewritten":"Rewritten",value:o(l.rewritten)},{label:"Unchanged",value:o(l.unchanged)},{label:"Skipped as explicit",value:o(l.skippedExplicit),hint:"their own add() passed every value that would change"},{label:"Skipped, added before this version",value:o(l.skippedUnmarked)},{label:"Moved",value:o(l.moved),hint:"left the chosen states before their write; at least this many"},{label:"Exhausted",value:o(l.exhausted),hint:"part of rewritten: already at the new attempts, so one final attempt each"}]}),l.exhausted>0&&t("p",{className:"job-defaults-warning",children:[h(l.exhausted,"job")," ",d?"would get":"got"," one final attempt: each has already made at least the new number of attempts, and dies if that attempt fails."]})]})}var it=new Set(["CONTROL_CONTENDED","DEFAULTS_CHANGED"]);function Ye(l){return`Producers pick this up within about ${L(l.propagationMs)}.`}function qe({queue:l,defaults:d,onClose:b}){let g=s(),w=J(),[K,x]=r(d),[R,U]=r({}),[B,N]=r(null),[Q,y]=r(!1),z=c(),te=_e(K,R),xe=Object.keys(te.errors).length>0,G=O({mutationFn:()=>Be(g,l,te.body),invalidate:ce(l),successMessage:(k)=>`Saved the job defaults of ${l}. ${Ye(k)}`,toastErrors:!1,onSuccess:b,onError:N}),ae=O({mutationFn:()=>Oe(g,l,K.seq),invalidate:ce(l),successMessage:(k)=>`Reset the job defaults of ${l} to the code values. ${Ye(k)}`,toastErrors:!1,onSuccess:b,onError:N}),M=G.isPending||ae.isPending||Q,he=E(B)&&it.has(B.code),ie=async()=>{y(!0);try{let k=await me(g,l);w.setQueryData(pe(l),k),x(k),U({}),N(null)}catch(k){N(k)}finally{y(!1)}},ne=(k,q)=>U((Z)=>({...Z,[k]:q})),X=(k)=>U((q)=>{let Z={...q};return delete Z[k],Z}),we=(k)=>{let q=R[k];return q!==void 0&&q!==De?q:Pe(k,K.effective[k])};return t(oe,{open:!0,onClose:b,closeOnEscape:!M,closeOnBackdrop:!M,size:"lg",title:`Job defaults of ${l}`,description:t(n,{children:["What a job added to ",e("code",{children:l})," gets for an option its"," ",e("code",{children:"add()"})," does not pass. A stored value here beats the code’s defaults, ",e("code",{children:"define()"})," defaults included; only an option passed explicitly on ",e("code",{children:"add()"})," wins. Saving changes jobs added from now on; jobs already waiting keep their values unless you apply the defaults to them."]}),footer:t(n,{children:[e(a,{onClick:b,disabled:M,children:"Cancel"}),e(a,{variant:"primary",onClick:()=>{N(null),G.mutate()},disabled:M||xe||te.changed.length===0,"aria-busy":G.isPending||void 0,children:G.isPending?"Saving…":"Save defaults"})]}),children:[B!==null&&(he?t("div",{className:"job-defaults-conflict",role:"alert",children:[e("p",{children:"The job defaults changed since you opened them — someone else saved or reset them. Nothing was saved. Re-read them, then make your change again."}),e(a,{size:"sm",onClick:()=>void ie(),disabled:Q,"aria-busy":Q||void 0,children:Q?"Re-reading…":"Re-read the defaults"})]}):e(A,{error:B,title:"Could not save the job defaults"})),e("p",{className:"job-defaults-note muted",children:ke}),e("div",{className:"job-defaults-form",children:_t.map((k)=>{let q=K.overridden.includes(k),Z=R[k]===De,se=re(k,K.code[k]),je=G.fieldErrors[k]??Object.entries(G.fieldErrors).find(([H])=>H.startsWith(`${k}.`))?.[1],j=te.errors[k]??je;return t("fieldset",{className:"job-defaults-row","data-testid":`job-default-${k}`,children:[t("legend",{children:[W[k].label," ",q&&e(p,{tone:"accent",children:"Overridden"})]}),t("p",{className:"job-defaults-values muted",children:["Now: ",re(k,K.effective[k])," · Code:"," ",se]}),Z?t("p",{className:"job-defaults-uses-code",children:["Will use the code value (",se,") once saved."," ",e(a,{size:"sm",variant:"ghost",onClick:()=>X(k),disabled:M,children:"Keep the stored value"})]}):e(st,{keyName:k,value:we(k),onChange:(H)=>ne(k,H),error:j}),q&&!Z&&e(a,{size:"sm",onClick:()=>ne(k,De),disabled:M,children:"Use code value"})]},k)})}),K.overridden.length>0&&t("div",{className:"job-defaults-reset",children:[e(a,{variant:"danger",onClick:()=>{N(null),ae.mutate()},disabled:M,"aria-busy":ae.isPending||void 0,"aria-describedby":z,children:ae.isPending?"Resetting…":"Reset to code values"}),e("p",{id:z,className:"job-defaults-reset-note",children:$e})]})]})}function st({keyName:l,value:d,onChange:b,error:g}){let w=be[l];if(w==="backoff")return e(lt,{value:d,onChange:b,error:g});if(w==="retention")return e(ut,{label:W[l].label,hint:W[l].hint,value:d,onChange:b,error:g});let K=Ae(l);return e(u,{label:W[l].label,hint:`${W[l].hint} ${K.min}–${K.max}.`,error:g,children:e(V,{value:d,min:K.min,max:K.max,onChange:b})})}function lt({value:l,onChange:d,error:b}){let g=Re.backoffDelay,w=Re.backoffMax,K=Re.backoffJitter;return t("div",{className:"field-row job-defaults-backoff",children:[e(u,{label:"Backoff strategy",hint:"Fixed waits the delay every time; exponential doubles it after each attempt. Other strategies can be set only in code.",children:e(S,{options:An.map((x)=>({value:x})),value:l.type,onChange:(x)=>d({...l,type:x})})}),e(u,{label:"Backoff delay (ms)",hint:`${g.min}–${g.max}.`,error:b,children:e(V,{value:l.delay,min:g.min,max:g.max,onChange:(x)=>d({...l,delay:x})})}),e(u,{label:"Backoff longest delay (ms)",hint:`Optional, at least the delay; empty means uncapped. Up to ${w.max}.`,children:e(V,{value:l.max,min:w.min,max:w.max,onChange:(x)=>d({...l,max:x})})}),e(u,{label:"Backoff jitter",hint:`Optional fraction of each delay randomised, ${K.min}–${K.max}.`,children:e(V,{value:l.jitter,min:K.min,max:K.max,step:"any",onChange:(x)=>d({...l,jitter:x})})})]})}var dt=[{value:"keep",label:"Keep forever"},{value:"limit",label:"Keep the newest, or for a while"},{value:"remove",label:"Remove at once"}];function ut({label:l,hint:d,value:b,onChange:g,error:w}){let K=Re.retentionCount,x=Re.retentionTtl;return t("div",{className:"field-row job-defaults-retention",children:[e(u,{label:l,hint:b.mode==="remove"?`${d} Removing at once discards every result (or failure) as the job settles.`:d,error:b.mode==="limit"?void 0:w,children:e(S,{options:dt,value:b.mode,onChange:(R)=>g({...b,mode:R})})}),b.mode==="limit"&&t(n,{children:[e(u,{label:`${l}: most kept`,hint:`Optional, ${K.min}–${K.max}.`,error:w,children:e(V,{value:b.count,min:K.min,max:K.max,onChange:(R)=>g({...b,count:R})})}),e(u,{label:`${l}: kept for (ms)`,hint:`Optional, up to ${x.max} (a year).`,children:e(V,{value:b.ttl,min:x.min,max:x.max,onChange:(R)=>g({...b,ttl:R})})})]})]})}function ft({queue:l,canEdit:d,canApply:b}){let g=s(),w=ue("counts"),[K,x]=r(null),R=i({queryKey:pe(l),queryFn:({signal:y})=>me(g,l,y),refetchInterval:K===null?w:!1}),U=()=>x(null);if(R.data===void 0)return R.isError?e(A,{error:R.error,title:"Could not load the job defaults",onRetry:()=>void R.refetch()}):e(f,{label:"Loading the job defaults",showLabel:!0});let B=R.data,{total:N}=B.pending,Q=B.overridden.length===0;return t("div",{className:"job-defaults","data-testid":"job-defaults-panel",children:[t("p",{children:["What a job added to this queue gets for an option its ",e("code",{children:"add()"})," ","does not pass. A stored override beats the code’s defaults and"," ",e("code",{children:"define()"})," defaults; only an option passed explicitly on"," ",e("code",{children:"add()"})," wins. A change reaches producers within about"," ",L(B.propagationMs),"."]}),t(I,{label:"Job defaults",children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Option"}),e("th",{scope:"col",children:"A job gets"}),e("th",{scope:"col",children:"Code"}),e("th",{scope:"col",children:"Override"})]})}),e("tbody",{children:_t.map((y)=>{let z=B.overridden.includes(y);return t("tr",{"data-testid":`job-default-row-${y}`,children:[e("th",{scope:"row",title:W[y].hint,children:W[y].label}),e("td",{children:re(y,B.effective[y])}),e("td",{children:re(y,B.code[y])}),e("td",{children:z?e(p,{tone:"accent",children:"Overridden"}):e("span",{className:"muted",children:"code value"})})]},y)})})]}),t("p",{className:"muted job-defaults-note",children:[ke,B.updatedAt!==void 0&&t(n,{children:[" ","Last changed ",e(v,{value:B.updatedAt}),"."]})]}),e("h3",{className:"job-defaults-heading",children:"Pending jobs"}),e(F,{className:"job-defaults-pending",items:[...It.map((y)=>({key:y,label:Y[y],value:o(B.pending[y])})),{key:"total",label:"Total",value:o(N)}]}),e("p",{className:"muted",children:"Pending jobs keep the values they were added with: saving changes only jobs added afterwards. Applying the defaults to them is a separate action."}),t("div",{className:"form-actions",children:[d&&e(a,{onClick:()=>x("settings"),children:"Settings…"}),b&&!Q&&N>0&&t(a,{variant:"danger",onClick:()=>x("apply"),children:["Apply to ",o(N)," pending"," ",N===1?"job":"jobs","…"]})]}),b&&(Q||N===0)&&e("p",{className:"muted","data-testid":"apply-unavailable",children:Q?"Nothing is overridden, so there is nothing to apply to pending jobs.":"No jobs are pending in the states the defaults can be applied to."}),K==="settings"&&e(qe,{queue:l,defaults:B,onClose:U}),K==="apply"&&e(Ie,{queue:l,defaults:B,onClose:U})]})}export{ft as JobDefaultsPanel};
2
-
3
- //# debugId=8AF8D5D01E21347864756E2164756E21
4
- //# sourceMappingURL=index-m7zk18cj.js.map
@@ -1,4 +0,0 @@
1
- import{r,n,e,t,p,s,y,i,G,a,j,d,f,R,x,l}from"./main-xf44bv26.js";import{Kt,En,ea,Nn}from"./main-vargz49c.js";import{ie}from"./main-qahvywvw.js";import{re}from"./main-fcq7hfk0.js";import{A}from"./main-9qd3nqs5.js";import"./main-3xxhy5jh.js";import{ft}from"./main-zx20z2e9.js";import{F}from"./main-6xdkyzv1.js";var P=G*2;function b(){let o=s(),u=y("providers.read"),h=re()("providers.validate"),v=j(P),m=i({queryKey:Kt.list,queryFn:({signal:g})=>En(o,g),refetchInterval:v,enabled:u});return t("div",{className:"screen","data-testid":"providers-screen",children:[e("h1",{className:"screen-title",children:"Providers"}),!u?e(d,{title:"Nothing to show",description:"You may not read providers on this API."}):m.isPending?e(f,{label:"Loading providers",showLabel:!0}):m.isError?e(x,{error:m.error,title:"Could not load providers",onRetry:()=>void m.refetch()}):m.data.providers.length===0?e(d,{title:"No providers configured",description:"Compute providers appear here once the API's process configures one, e.g. for a queue's summoning."}):t(n,{children:[t("p",{className:"muted","data-testid":"providers-api",children:["Provider API ",l(m.data.api.core),", summon facet"," ",l(m.data.api.summon),". Ids are stable for this process's life only."]}),e("div",{className:"providers-list",children:m.data.providers.map((g)=>e(C,{provider:g,canValidate:h},g.id))})]})]})}function C({provider:o,canValidate:u}){let c=ft(o.readiness),h=l(o.provider.displayName??o.provider.kind),v=Object.entries(o.facts);return e(R,{title:h,children:t("div",{"data-testid":`provider-${o.id}`,children:[e(F,{items:[{key:"readiness",label:"Readiness",value:e(p,{tone:c.tone,title:c.hint,testId:"provider-readiness",children:c.label}),hint:c.hint},{key:"id",label:"Id",value:e("code",{children:l(o.id)})},{key:"package",label:"Package",value:t("span",{children:[e("code",{children:l(o.provider.name)})," ",l(o.provider.version)]})},...v.map(([m,g])=>({key:`fact-${m}`,label:l(m),value:e("code",{children:l(g)})}))]}),u&&o.preflight&&e(Nn,{providerId:o.id,label:h}),o.configSchema&&e(I,{providerId:o.id})]})})}function I({providerId:o}){let u=s(),[c,h]=r(!1),v=i({queryKey:Kt.schema(o),queryFn:({signal:m})=>ea(u,o,m),enabled:c,staleTime:Number.POSITIVE_INFINITY});return t("div",{className:"provider-schema",children:[e(a,{size:"sm",variant:"ghost","aria-expanded":c,onClick:()=>h((m)=>!m),children:c?"Hide config schema":"Config schema"}),c&&(v.isPending?e(f,{label:"Loading the config schema"}):v.isError?e(A,{error:v.error,title:"Could not load the config schema"}):e("div",{"data-testid":"provider-schema",children:e(ie,{value:v.data.schema,label:`Config schema of ${o}`,expandDepth:4})}))]})}export{b as ProvidersScreen};
2
-
3
- //# debugId=98490787E4019E3564756E2164756E21
4
- //# sourceMappingURL=index-mykmd5cv.js.map
@@ -1,4 +0,0 @@
1
- import{vn,w,Me,c,g,r,St,Dn,qr,Zn,$t,Jr,jr,K,E,C,N,n,e,t,p,s,gt,m,y,se,J,z,i,a,de,b,oe,De,le,rt,be,j,d,f,R,x,o,h,l,te,we,u,M,V,S,P,xe,I,ne,Kr}from"./main-xf44bv26.js";import{Ie,v}from"./main-smabxbn4.js";import{dt,dn}from"./main-2n5wnj51.js";import{Le,ct}from"./main-jex4pqaa.js";import{he,Ne,mt,cn,ho,go,yo}from"./main-kjywj2zd.js";import{L}from"./main-yjykmsvp.js";import{k}from"./main-v2f8a4g3.js";import{Ir,O}from"./main-zk3n47nq.js";import{W,me,Pe}from"./main-yg6scp84.js";import{ie}from"./main-qahvywvw.js";import{re}from"./main-fcq7hfk0.js";import{A}from"./main-9qd3nqs5.js";import{ye}from"./main-3xxhy5jh.js";import{F}from"./main-6xdkyzv1.js";function Te(T,D){return`/runners/${C(T)}${D}`}function wn(T,D,_={}){let B=_.force!==void 0||_.args!==void 0;return T.request("POST",Te(D,"/trigger"),{body:B?_:void 0})}function Sn(T,D){return T.request("POST",Te(D,"/pause"))}function Nn(T,D,_=!1){return T.request("POST",Te(D,"/resume"),{body:_?{triggerNow:!0}:void 0})}function Ln(T,D,_){return T.request("PUT",Te(D,"/schedule"),{body:{schedule:_}})}function Tn(T,D,_={}){return T.request("POST",Te(D,"/kill"),{body:Object.keys(_).length>0?_:void 0})}function En(T,D,_){return T.request("PUT",Te(D,"/config"),{body:_})}function An(T,D){return T.request("DELETE",Te(D,"/config"))}function kn(T,D){return T.request("POST",Te(D,"/stats/reset"))}function On(T,D){return T.request("DELETE",Te(D,"/history"))}var Pn={"child-process":"child-process — a child process per run","worker-thread":"worker-thread — a Worker thread per run","in-process":"in-process — in the runner's own process"},In=[{value:"parallel",label:"parallel — runs may overlap"},{value:"single",label:"single — one run at a time, cluster-wide"}],Ee=qr.maxConcurrency,er=["runMode","maxConcurrency"],Mn={executionMode:"Execution mode",runMode:"Run mode",maxConcurrency:"Max concurrency"};function nr(T){return er.some((D)=>T.overridden.includes(D))}function sn(T){return{executionModeOverridden:T.overridden.includes("executionMode"),executionMode:T.effective.executionMode,concurrencyOverridden:nr(T),runMode:T.effective.runMode,maxConcurrency:T.effective.maxConcurrency??void 0}}function tr(T,D){let _=D.code??D.effective;return{executionMode:T.executionModeOverridden?T.executionMode:_.executionMode,runMode:T.concurrencyOverridden?T.runMode:_.runMode,maxConcurrency:T.concurrencyOverridden?T.maxConcurrency??null:_.maxConcurrency}}function Oe(T,D){if(T.code===void 0)return null;if(D==="maxConcurrency")return on(T.code.maxConcurrency);return T.code[D]}function on(T){return T===null||T===void 0?"unlimited":o(T)}function _n(T){if(!T.concurrencyOverridden||T.runMode!=="parallel")return{};let D=T.maxConcurrency;if(D===void 0)return{};if(!Number.isInteger(D))return{maxConcurrency:"A whole number of runs, or empty for unlimited."};if(D<Ee.min||D>Ee.max)return{maxConcurrency:`Between ${Ee.min} and ${o(Ee.max)}, or empty for unlimited.`};return{}}function an(T,D){let _=sn(D),B={};if(T.executionModeOverridden!==_.executionModeOverridden||T.executionModeOverridden&&T.executionMode!==_.executionMode)B.executionMode=T.executionModeOverridden?T.executionMode:null;let U=T.runMode==="parallel"&&T.maxConcurrency!==_.maxConcurrency;if(T.concurrencyOverridden!==_.concurrencyOverridden||T.concurrencyOverridden&&(T.runMode!==_.runMode||U))B.concurrency=!T.concurrencyOverridden?null:T.runMode==="single"?{runMode:"single"}:{runMode:"parallel",maxConcurrency:T.maxConcurrency??null};return B}function Fn(T,D){return Object.keys(an(T,D)).length>0}function Bn(T,D){let _=tr(T,D),B=D.effective,U=[];if(_.executionMode!==B.executionMode)U.push({id:"execution-mode",message:`A run already in flight keeps the mode it started with, so ${_.executionMode} applies from the next run.`});if(B.runMode==="parallel"&&_.runMode==="single")U.push({id:"to-single",message:"Switching from parallel to single is not immediate across processes: a parallel run holds no lock, so overlap can persist for as long as the longest run in flight, plus however long an owner takes to adopt the change. Pause the runner first if exclusivity matters."});let H=B.maxConcurrency??1/0,Q=_.maxConcurrency??1/0;if(_.runMode==="parallel"&&Q<H)U.push({id:"lower-concurrency",message:`Lowering the cap from ${on(B.maxConcurrency)} to ${on(_.maxConcurrency)} only gates new runs: runs already in flight keep going.`});return U}function He(T){let D=T.appliedSeq??0;return T.seq>0&&D<T.seq?{applied:D,seq:T.seq}:null}function $n(T){let D=T.allowed;return D===void 0?[]:Dn.filter((_)=>!D.includes(_))}function Un(T){let D=T.allowed;return D===void 0?[...Dn]:Dn.filter((_)=>D.includes(_))}function Hn(T){if(T.overridden.length===0)return"None: as the runner's code asks";return T.overridden.map((D)=>Mn[D]??D).join(", ")}function qn(T){let D=T.error?.keys;return D===void 0||D.length===0?null:D}function rr(T,D){if(T.error===void 0)return!1;let _=qn(T);if(_!==null)return _.includes(D);return T.code!==void 0&&T.effective[D]===T.code[D]}function un(T){let D=qn(T);if(D===null)return null;let _=D.map((B)=>Mn[B]??B);return _.length===1?_[0]:`${_.slice(0,-1).join(", ")} and ${_.at(-1)}`}function qe(T,D){if(T===void 0||!T.overridden.includes(D))return;let _=Oe(T,D);if(rr(T,D))return _===null?"Override refused by the owner; it runs what its code asks for":`Override refused by the owner; it runs what its code asks for, ${_}`;return _===null?"Overridden here":`Overridden here; its code asks for ${_}`}function Kn(T){if(T.error!==void 0){let _=un(T);return _===null?`The owner refused these settings: ${T.error.message}`:`The owner refused ${_}: ${T.error.message}`}let D=He(T);return D===null?null:`Version ${D.seq} has not been adopted yet (the owner is on ${D.applied}); it takes effect at its next sync`}var zn={paused:"The runner is paused. Tick “Run even while paused” to run it anyway, or resume it.",busy:"A run is already in progress, and this runner does not queue triggers.","lock-held":"Another process holds the runner's lock (a run is in progress there), and this runner does not queue triggers.","max-concurrency":"The runner is at its concurrency limit, and it does not queue triggers.","queue-full":"The runner's trigger queue is full (maxQueuedRuns). Try again once some queued runs have started.",stopped:"The runner has stopped, so nothing runs."},or={kill:"Only the process executing a run can kill it",resetStats:"Only the process that registered the runner can reset its stats"};function ln(T,D){switch(T.code){case"RUNNER_NOT_LOCAL":return`${or[D]??"This action needs the runner registered in the API's process"}, and this runner is registered only in another process. Use the management API of the process that runs it.`;case"RUN_NOT_FOUND":return"That run is no longer active in this process: it finished, or was killed already. Refresh to see the runs in flight now.";case"RUNNER_STOPPED":return"The runner has stopped (its process is shutting down, or it was stopped), so it cannot be triggered.";case"ARGS_NOT_ALLOWED":return"This API does not accept run arguments (it was created without runnerTriggerArgs). Trigger without arguments.";case"RUNNER_NOT_CONFIGURABLE":return"This runner cannot be configured from the API yet: no process running it has started since remote configuration shipped, so a setting would be stored and never adopted. Restart the runner on the current version, or change its settings where the runner is defined.";case"CONFIG_NOT_ALLOWED":return"The runner's own code does not permit that setting — usually an execution mode outside its `allowedOverrides.executionModes`. Choose one of the modes offered, or widen the list where the runner is defined.";case"RUNNER_NOT_FOUND":return D==="clearHistory"?"The runner no longer exists in this namespace (it was unregistered, or its state was removed), so it has no history left to clear.":"The runner no longer exists in this namespace: it was unregistered, or its state was removed.";default:return null}}function Ce(T,D){if(!E(T))return T;let _=ln(T,D);if(_===null)return T;return new K({kind:T.kind,status:T.status,code:T.code,title:T.title,detail:_,type:T.type,issues:T.issues,context:T.context,instance:T.instance,cause:T})}function Gn(T,D){let _=D.length>0?`, kept ${o(D.length)} in progress`:"";return`Cleared ${h(T,"run")}${_}`}function Vn({runner:T,config:D,onClose:_}){let B=s(),U=c(),[H,Q]=r(()=>sn(D)),Y=(Re)=>Q((jt)=>({...jt,...Re})),q=O({mutationFn:(Re)=>En(B,T.id,Re),successMessage:(Re)=>He(Re)===null?`Saved the settings of ${T.id}`:`Saved the settings of ${T.id}; its owner adopts them at its next sync`,invalidate:Ne(T.id),toastErrors:!1,onSuccess:()=>_()}),ee=O({mutationFn:()=>An(B,T.id),successMessage:`Reset ${T.id} to its code defaults`,invalidate:Ne(T.id),toastErrors:!1,onSuccess:()=>_()}),X=q.isPending||ee.isPending,ge=_n(H),ae=Bn(H,D),ue=an(H,D),G=Fn(H,D),ce=He(D),fe=Un(D),ve=$n(D),pe=Oe(D,"executionMode"),Se=Oe(D,"runMode"),ke=Oe(D,"maxConcurrency"),$e=q.error??ee.error,Ue=(fe.includes(H.executionMode)?fe:[H.executionMode,...fe]).map((Re)=>({value:Re,label:Pn[Re]})),rn=(Re)=>{if(Re.preventDefault(),Object.keys(ge).length>0||!G)return;q.mutate(ue)},Z=()=>{if(!X)_()};return e(oe,{open:!0,onClose:Z,title:t(n,{children:["Settings of ",e("code",{children:T.id})]}),description:"Where runs execute and whether they may overlap, for every process running this runner. A setting left to the runner's code follows the code.",size:"md",closeOnEscape:!X,closeOnBackdrop:!X,footer:t(n,{children:[D.overridden.length>0&&e(a,{variant:"danger",onClick:()=>ee.mutate(),disabled:X,"aria-busy":ee.isPending||void 0,children:ee.isPending?"Resetting…":"Reset to code defaults"}),e(a,{onClick:Z,disabled:X,children:"Cancel"}),e(a,{variant:"primary",type:"submit",form:U,disabled:X||!G,"aria-busy":q.isPending||void 0,children:q.isPending?"Saving…":"Save settings"})]}),children:t("form",{id:U,className:"runner-form",onSubmit:rn,noValidate:!0,children:[ce!==null&&t("p",{className:"runner-note runner-note-pending",role:"status","data-testid":"config-pending",children:["The stored settings (version ",ce.seq,") have not been adopted yet: the owner is on version ",ce.applied,". They take effect at its next sync."]}),D.error!==void 0&&t("p",{className:"runner-note runner-note-refused",role:"note","data-testid":"config-refused",children:["The owner refused ",un(D)??"the stored settings"," ",e(v,{value:D.error.at}),": ",D.error.message]}),e(u,{label:"Execution mode",hint:pe===null?"Where each run executes. It applies from the next run.":`Where each run executes. This runner's code asks for ${pe}.`,error:q.fieldErrors.executionMode,children:e(S,{options:Ue,value:H.executionMode,onChange:(Re)=>Y({executionMode:Re,executionModeOverridden:!0}),disabled:X})}),e(Wn,{testId:"execution-mode",overridden:H.executionModeOverridden,label:"Execution mode",canReset:D.code!==void 0,disabled:X,onReset:()=>Y({executionModeOverridden:!1,executionMode:D.code?.executionMode??H.executionMode})}),ve.length>0&&t("p",{className:"runner-note",role:"note","data-testid":"config-modes-limited",children:[ve.join(", ")," ",ve.length===1?"is":"are"," ","not offered: this runner's code permits only ",fe.join(", ")," (its"," ",e("code",{children:"allowedOverrides.executionModes"}),"). The API refuses any other with 409 ",e("code",{children:"CONFIG_NOT_ALLOWED"}),"."]}),e(u,{label:"Run mode",hint:Se===null?"Whether runs may overlap.":`Whether runs may overlap. This runner's code asks for ${Se}.`,error:q.fieldErrors["concurrency.runMode"],children:e(S,{options:In,value:H.runMode,onChange:(Re)=>Y({runMode:Re,concurrencyOverridden:!0}),disabled:X})}),e(u,{label:"Max concurrency",hint:H.runMode==="single"?"Only applies in parallel: single already allows one run at a time.":`Most concurrent runs, ${Ee.min} to ${Ee.max} from here. Empty means unlimited.${ke===null?"":` This runner's code asks for ${ke}.`}`,error:ge.maxConcurrency??q.fieldErrors["concurrency.maxConcurrency"],children:e(V,{value:H.maxConcurrency,onChange:(Re)=>Y({maxConcurrency:Re,concurrencyOverridden:!0}),min:Ee.min,max:Ee.max,placeholder:"Unlimited",disabled:X||H.runMode==="single"})}),e(Wn,{testId:"concurrency",overridden:H.concurrencyOverridden,label:"Run mode and max concurrency",canReset:D.code!==void 0,disabled:X,onReset:()=>Y({concurrencyOverridden:!1,runMode:D.code?.runMode??H.runMode,maxConcurrency:D.code?.maxConcurrency??H.maxConcurrency})}),ae.map((Re)=>e("p",{className:"runner-note runner-note-pending",role:"note","data-testid":`config-warning-${Re.id}`,children:Re.message},Re.id)),$e!==null&&e(A,{error:Ce($e,"configure")})]})})}function Wn({testId:T,overridden:D,label:_,canReset:B,disabled:U,onReset:H}){return t("p",{className:"config-source","data-testid":`config-source-${T}`,children:[e("span",{children:D?`${_}: overridden here.`:`${_}: as the runner's code asks.`}),D&&B&&e(a,{size:"sm",onClick:H,disabled:U,children:"Use the code default"})]})}function sr(T){return T.isLocal&&(T.local?.activeRuns.length??0)>0}function Ke(T,D){let _=D("runners.kill"),B=D("runners.resetStats");return{trigger:D("runners.trigger"),pause:!T.isPaused&&D("runners.pause"),resume:T.isPaused&&D("runners.resume"),reschedule:D("runners.reschedule"),configure:T.config!==void 0&&D("runners.configure"),kill:_&&sr(T),resetStats:B&&T.isLocal,clearHistory:D("runners.clearHistory"),nonLocalOnly:!T.isLocal&&(_||B)}}function Qn(T){if(T.isLocal)return!1;return(T.config?.effective.runMode??T.runMode)!=="single"}var ze=200;function Yn({runner:T,onClose:D}){let _=s(),[B,U]=r(!1),H=O({mutationFn:(Q)=>Nn(_,T.id,Q),successMessage:(Q,Y)=>`Resumed ${T.id}${Y?" and asked for a run":""}${T.isLocal?"":"; its owner picks it up at its next sync"}`,invalidate:Ne(T.id),toastErrors:!1});return e(k,{open:!0,onClose:D,title:`Resume ${T.id}?`,description:"Scheduled and manual runs start again, everywhere the runner is registered.",confirmLabel:"Resume",pendingLabel:"Resuming…",onConfirm:async()=>{try{await H.mutateAsync(B)}catch(Q){throw Ce(Q,"resume")}},children:e(P,{checked:B,onChange:U,label:"Also trigger a run now"})})}function Xn({runner:T,onClose:D}){let _=s(),B=te(),U=T.local?.activeRuns??[],[H,Q]=r(""),[Y,q]=r(!1),[ee,X]=r(""),[ge,ae]=r(!1),ue=O({mutationFn:(fe)=>Tn(_,T.id,fe),onSuccess:(fe,ve)=>{let pe=fe.runIds.length;if(pe===0){B.info(`No run was active on ${T.id}`);return}B.success(ve.wait?`Killed ${h(pe,"run")} on ${T.id}`:`Kill requested for ${h(pe,"run")} on ${T.id}`,{description:fe.runIds.join(", ")})},invalidate:Ne(T.id),toastErrors:!1}),G=ee.trim(),ce=ue.isPending&&ue.variables?.wait===!0;return t(k,{open:!0,onClose:D,title:`Kill runs of ${T.id}?`,description:"Stops the chosen run (or every active run) in this process: it is asked to close, then killed once its timeouts pass. The runs are recorded as killed.",variant:"danger",confirmLabel:"Kill",pendingLabel:ge?"Waiting for the runs to settle…":"Killing…",confirmText:T.id,confirmDisabled:G.length>ze,onConfirm:async()=>{try{await ue.mutateAsync({...H?{runId:H}:{},...Y?{force:!0}:{},...G?{reason:G}:{},...ge?{wait:!0}:{}})}catch(fe){throw Ce(fe,"kill")}},children:[e(u,{label:"Run",children:e(S,{options:[{value:"",label:`Every active run (${U.length})`},...U.map((fe)=>({value:fe.runId,label:`${fe.runId} (${fe.source}, attempt ${fe.attempt})`}))],value:H,onChange:Q,disabled:ue.isPending})}),e(P,{checked:Y,onChange:q,label:"Force",hint:"Skip straight to the end of the kill escalation instead of asking the run to close first.",disabled:ue.isPending}),e(u,{label:"Reason",hint:`Optional, recorded on the run. At most ${ze} characters.`,error:ue.fieldErrors.reason??(G.length>ze?`At most ${ze} characters.`:void 0),children:e(M,{value:ee,onChange:X,disabled:ue.isPending})}),e(P,{checked:ge,onChange:ae,label:"Wait until the runs have settled",hint:"Answer only once they have stopped. This can take the runner's closeTimeout plus killTimeout.",disabled:ue.isPending}),ce&&e("p",{className:"runner-note runner-note-pending",role:"status","data-testid":"kill-waiting",children:"Waiting for the runs to settle. This can take the runner's closeTimeout plus killTimeout."})]})}function Jn({runner:T,onClose:D}){let _=s(),B=O({mutationFn:()=>kn(_,T.id),successMessage:`Reset the stats of ${T.id}`,invalidate:Ne(T.id),toastErrors:!1});return e(k,{open:!0,onClose:D,title:`Reset the stats of ${T.id}?`,description:"Sets every lifetime counter (success, failed, timeout, killed, skipped, queued, total) back to zero, for every process. History is kept. This cannot be undone.",variant:"danger",confirmLabel:"Reset stats",pendingLabel:"Resetting…",onConfirm:async()=>{try{await B.mutateAsync()}catch(U){throw Ce(U,"resetStats")}}})}function jn({runner:T,onClose:D}){let _=s(),B=te(),U=O({mutationFn:()=>On(_,T.id),onSuccess:(H)=>{B.success(Gn(H.removed,H.kept),H.kept.length>0?{description:`Kept: ${H.kept.join(", ")}`}:void 0)},invalidate:Ne(T.id),toastErrors:!1});return t(k,{open:!0,onClose:D,title:`Clear the run history of ${T.id}?`,description:"Removes every finished run and its log, for every process. Runs still in progress are kept, record and log whole. The lifetime counters and the charts are untouched: Reset stats… is separate. This cannot be undone.",variant:"danger",confirmLabel:"Clear history",pendingLabel:"Clearing…",onConfirm:async()=>{try{await U.mutateAsync()}catch(H){throw Ce(H,"clearHistory")}},children:[e("p",{className:"runner-note muted",children:"A run whose record still says running but whose process has gone (no lock names it, and it started over a day ago) counts as finished, and is removed."}),Qn(T)&&e("p",{className:"runner-note muted","data-testid":"clear-history-parallel-note",children:"This runner is registered in another process and its runs may overlap, so the API cannot ask the process running them: a parallel run still going after a day is taken for crashed and removed too."})]})}var Ge={seconds:1000,minutes:60000,hours:3600000},We=200,Ve=100;function ir(T="none"){return{mode:T,cron:"",tz:"",everyAmount:void 0,everyUnit:"minutes",anchor:void 0,at:void 0}}function ar(T){for(let D of["hours","minutes","seconds"])if(T%Ge[D]===0)return{amount:T/Ge[D],unit:D};return{amount:T/Ge.seconds,unit:"seconds"}}function et(T){let D=ir();if(T===null)return D;if("cron"in T)return{...D,mode:"cron",cron:T.cron,tz:T.tz??""};if("every"in T){let{amount:_,unit:B}=ar(T.every);return{...D,mode:"every",everyAmount:_,everyUnit:B,anchor:T.anchor}}return{...D,mode:"at",at:T.at}}function nt(T,D){if(T===void 0||!Number.isFinite(T)||T<=0)return;let _=Math.round(T*Ge[D]);return _>=1?_:void 0}function Qe(){let T=Intl;if(typeof T.supportedValuesOf!=="function")return null;try{return T.supportedValuesOf("timeZone")}catch{return null}}function ur(T,D=Qe()){let _=T.trim();if(_===""||/^[+-]\d/.test(_))return!1;let B=_.toLowerCase();if(D?.some((U)=>U.toLowerCase()===B))return!0;try{return Intl.DateTimeFormat("en",{timeZone:_}).resolvedOptions().timeZone!==""}catch{return!1}}function lr(T){let D=T.trim();if(D==="")return"Enter a cron expression.";if(D.length>We)return`At most ${We} characters.`;let _=D.split(/\s+/);if(_.length===1&&D.startsWith("@"))return null;if(_.length!==5&&_.length!==6)return`${_.length} field${_.length===1?"":"s"}: expected 5, 6 with seconds first, or a nickname such as @daily.`;return null}function pn(T,D=Qe()){let _={};switch(T.mode){case"cron":{let B=lr(T.cron);if(B)_.cron=B;let U=T.tz.trim();if(U.length>Ve)_.tz=`At most ${Ve} characters.`;else if(U!==""&&!ur(U,D))_.tz=`“${U}” is not a known time zone. Use an IANA name such as Europe/London or UTC.`;break}case"every":if(nt(T.everyAmount,T.everyUnit)===void 0)_.every="Enter an interval greater than zero.";break;case"at":if(T.at===void 0)_.at="Pick a date and time.";break;case"none":break}return _}function tt(T){switch(T.mode){case"cron":{let D=T.tz.trim();return{cron:T.cron.trim(),...D?{tz:D}:{}}}case"every":return{every:nt(T.everyAmount,T.everyUnit)??0,...T.anchor===void 0?{}:{anchor:T.anchor}};case"at":return{at:T.at??0};case"none":return null}}function dr(T){switch(T){case"cron":return"cron";case"every":return"every";case"at":return"at";case"none":return null}}function ot(T){return E(T)&&T.code==="INVALID_SCHEDULE"?Ir(T.issues):{}}function st(T,D){let _={},B;for(let[U,H]of Object.entries(T)){let Y=/^schedule\.(cron|tz|every|anchor|at)\b/.exec(U)?.[1]??dr(D);if(Y)_[Y]??=H;else B??=H}return{fields:_,other:B}}var cr=[{value:"cron",label:"Cron"},{value:"every",label:"Every"},{value:"at",label:"Once"},{value:"none",label:"None"}],pr=[{value:"seconds",label:"seconds"},{value:"minutes",label:"minutes"},{value:"hours",label:"hours"}];function it({runner:T,onClose:D}){let _=s(),B=te(),U=c(),H=c(),Q=g(()=>Qe(),[]),Y=Ie(),[q,ee]=r(()=>et(T.schedule)),[X,ge]=r(!1),ae=we(),ue=(Z)=>ee((Re)=>({...Re,...Z})),G=O({mutationFn:(Z)=>Ln(_,T.id,Z),onSuccess:(Z)=>{B.success(Z.schedule===null?`${T.id} is unscheduled`:`Rescheduled ${T.id}`,{description:Z.nextRunAt===null?"No run is scheduled; it runs only when triggered.":t("span",{"data-testid":"schedule-next-run",children:["Next run ",e(v,{value:Z.nextRunAt})]})}),D()},invalidate:Ne(T.id),toastErrors:!1}),ce=X?pn(q,Q):{},fe=st({...G.fieldErrors,...ot(G.error)},q.mode),ve=(Z)=>(Z==="anchor"||Z==="at"?ae.problems[Z]:void 0)??ce[Z]??fe.fields[Z],pe=Object.keys(fe.fields).length>0,Se=G.unplacedIssues.length>0,ke=G.error&&(!pe||Se)?(Se?void 0:fe.other)??Ce(G.error,"reschedule"):null,$e=(Z)=>{if(Z.preventDefault(),ge(!0),ae.blocked||Object.keys(pn(q,Q)).length>0)return;G.mutate(tt(q))},Ue=()=>{if(!G.isPending)D()},rn=q.at!==void 0&&q.at<=Y;return e(oe,{open:!0,onClose:Ue,title:t(n,{children:["Reschedule ",e("code",{children:T.id})]}),description:"Replaces the stored schedule for every process running this runner.",size:"md",closeOnEscape:!G.isPending,closeOnBackdrop:!G.isPending,footer:t(n,{children:[e(a,{onClick:Ue,disabled:G.isPending,children:"Cancel"}),e(a,{variant:"primary",type:"submit",form:U,disabled:G.isPending||ae.blocked,"aria-busy":G.isPending||void 0,children:G.isPending?"Saving…":"Save schedule"})]}),children:t("form",{id:U,className:"runner-form",onSubmit:$e,noValidate:!0,children:[t("fieldset",{className:"schedule-modes",children:[e("legend",{children:"Schedule"}),cr.map((Z)=>t("label",{className:"schedule-mode",children:[e("input",{type:"radio",name:`${U}-mode`,value:Z.value,checked:q.mode===Z.value,onChange:()=>ue({mode:Z.value})}),Z.label]},Z.value))]}),q.mode==="cron"&&t(n,{children:[e(u,{label:"Cron expression",required:!0,hint:"5 fields (minute hour day month weekday), 6 with seconds first, or a nickname such as @daily.",error:ve("cron"),children:e(M,{value:q.cron,onChange:(Z)=>ue({cron:Z}),maxLength:We,autoComplete:"off",spellCheck:!1,placeholder:"0 9 * * MON-FRI"})}),e(u,{label:"Time zone",hint:"Optional IANA name, e.g. Europe/London. Empty: the owner's local time (the zone of the process that runs it).",error:ve("tz"),children:e(M,{value:q.tz,onChange:(Z)=>ue({tz:Z}),maxLength:Ve,autoComplete:"off",spellCheck:!1,list:Q?H:void 0})}),Q&&e("datalist",{id:H,children:Q.map((Z)=>e("option",{value:Z},Z))})]}),q.mode==="every"&&t(n,{children:[t("div",{className:"runner-form-row",children:[e(u,{label:"Interval",required:!0,error:ve("every"),children:e(V,{value:q.everyAmount,onChange:(Z)=>ue({everyAmount:Z}),min:0,step:"any"})}),e(u,{label:"Unit",children:e(S,{options:pr,value:q.everyUnit,onChange:(Z)=>ue({everyUnit:Z})})})]}),e(u,{label:"Anchor",hint:"Optional: runs stay on this time's grid. Without one, each interval counts from when the schedule is applied.",error:ve("anchor"),children:e(xe,{value:q.anchor,onChange:(Z)=>ue({anchor:Z}),onProblem:(Z)=>ae.report("anchor",Z),withSeconds:!0})})]}),q.mode==="at"&&e(u,{label:"Run at",required:!0,hint:rn?"This time has passed: the runner will not fire.":"One run at this time, then none.",error:ve("at"),children:e(xe,{value:q.at,onChange:(Z)=>ue({at:Z}),onProblem:(Z)=>ae.report("at",Z),withSeconds:!0})}),q.mode==="none"&&e("p",{className:"runner-note",role:"note",children:"No schedule: the runner runs only when triggered."}),ke!==null&&e(A,{error:ke})]})})}function at(T,D,_){switch(_.outcome){case"started":T.success(`Run started on ${D.id}`,{description:t("span",{className:"run-id",children:[t("span",{children:["Run ",e("code",{children:_.runId})]}),e(ye,{text:_.runId,ariaLabel:"Copy run id"})]})});return;case"queued":T.success(`Run queued on ${D.id}`,{description:`Position ${_.position} in the trigger queue.${D.isLocal?" It starts when the runner is free.":" The process that owns the runner starts it at its next sync."}`});return;case"skipped":T.info(`Run skipped on ${D.id}`,{description:zn[_.reason]??_.reason})}}function ut({runner:T,onClose:D}){let _=s(),B=m(),U=te(),H=B.limits.maxJobDataBytes,[Q,Y]=r(!1),[q,ee]=r(()=>Le("",{maxBytes:H,allowEmpty:!0})),X=O({mutationFn:(G)=>wn(_,T.id,G),onSuccess:(G)=>at(U,T,G),invalidate:Ne(T.id),toastErrors:!1}),ge=B.runnerTriggerArgs,ae=ge&&(!q.valid||q.overLimit),ue=async()=>{let G={...Q?{force:!0}:{},...ge&&q.value!==void 0?{args:q.value}:{}};try{await X.mutateAsync(G)}catch(ce){throw Ce(ce,"trigger")}};return t(k,{open:!0,onClose:D,title:`Trigger ${T.id}?`,description:"Asks for a run now. It starts at once, waits in the trigger queue, or is skipped, depending on the runner's state and options.",confirmLabel:"Trigger",pendingLabel:"Triggering…",confirmDisabled:ae,onConfirm:ue,children:[e(P,{checked:Q,onChange:Y,label:"Run even while paused",hint:"Force skips only the pause check. A busy runner, a lock held elsewhere, the concurrency cap and a full trigger queue still apply."}),ge&&e(u,{label:"Arguments",hint:"Optional JSON handed to this run; leave empty for the runner's own args.",children:e(ct,{value:q.text,onChange:ee,maxBytes:H,allowEmpty:!0,rows:6})}),!T.isLocal&&e("p",{className:"runner-note",role:"note","data-testid":"trigger-non-local-note",children:"This runner is registered in another process, so the run is queued for it: its owner starts it at its next sync."})]})}function lt({runner:T}){let D=s(),_=te(),B=re(),[U,H]=r(null),Q=()=>H(null),Y=Ke(T,B),q=O({mutationFn:()=>Sn(D,T.id),successMessage:T.isLocal?`Paused ${T.id}`:`Paused ${T.id}; its owner stops at its next sync`,invalidate:Ne(T.id),toastErrors:!1,onError:(X)=>{_.error(`Could not pause ${T.id}`,{description:E(X)?ln(X,"pause")??X.detail??X.title:X.message})}});if(!(Y.trigger||Y.pause||Y.resume||Y.reschedule||Y.configure||Y.kill||Y.resetStats)&&!Y.nonLocalOnly)return null;return t("div",{className:"runner-actions",role:"group","aria-label":"Runner actions",children:[Y.trigger&&e(a,{variant:"primary",onClick:()=>H("trigger"),children:"Trigger…"}),Y.pause&&e(a,{onClick:()=>q.mutate(),disabled:q.isPending,"aria-busy":q.isPending||void 0,children:"Pause"}),Y.resume&&e(a,{onClick:()=>H("resume"),children:"Resume…"}),Y.reschedule&&e(a,{onClick:()=>H("schedule"),children:"Reschedule…"}),Y.configure&&e(a,{onClick:()=>H("config"),children:"Settings…"}),Y.resetStats&&e(a,{variant:"danger",onClick:()=>H("reset"),children:"Reset stats…"}),Y.kill&&e(a,{variant:"danger",onClick:()=>H("kill"),children:"Kill…"}),Y.nonLocalOnly&&e("p",{className:"runner-actions-hint","data-testid":"runner-non-local-hint",children:"Registered in another process: kill and reset stats are only available from the API of the process that runs it, and other changes reach it at its next sync."}),U==="trigger"&&e(ut,{runner:T,onClose:Q}),U==="resume"&&e(Yn,{runner:T,onClose:Q}),U==="schedule"&&e(it,{runner:T,onClose:Q}),U==="config"&&T.config!==void 0&&e(Vn,{runner:T,config:T.config,onClose:Q}),U==="kill"&&e(Xn,{runner:T,onClose:Q}),U==="reset"&&e(Jn,{runner:T,onClose:Q})]})}var Ye=2000,mr=100,mn=2000;function pt(T){return Math.max(1,Math.min(100,T))}var fn={run:(T,D)=>[...he.runner(T),"run",D],logs:(T,D,_)=>[...fn.run(T,D),"logs",{stream:_??null}]};function fr(T,D){return`/runners/${C(T)}/runs/${C(D)}/logs`}function ft(T,D,_,B={},U){return T.request("GET",fr(D,_),{query:{since:B.since,offset:B.offset,limit:B.limit,order:B.order,stream:B.stream},signal:U})}function ht(T,D){let _=new Set(T?.lines.map((ee)=>ee.seq)??[]),B=D.items.filter((ee)=>!_.has(ee.seq)),U=[...T?.lines??[],...B].sort((ee,X)=>ee.seq-X.seq),H=Math.max(0,U.length-mn),Q=D.items.at(-1)?.seq??0,Y=D.page.hasMore,q=Y?Q:Math.max(D.lastSeq,Q,T?.cursor??0);return{lines:H>0?U.slice(H):U,cursor:Math.max(T?.cursor??0,q),dropped:D.dropped,capped:D.capped,live:D.live,lastSeq:D.lastSeq,hasMore:Y,trimmed:(T?.trimmed??0)+H}}function yt(T,D=Ye){if(!T)return!1;if(T.hasMore)return mr;return T.live?D:!1}function Rt(T,D,_){if(T.kind!=="runner"||T.type!=="logs"||T.target!==D||T.payload.runId!==_)return;return T.payload.lastSeq}function vt(T,D){return T===void 0||T.cursor<D}function Xe(T){return T.logLines===void 0||T.logLines>0||T.status==="running"}function gn(T){return E(T)&&T.code==="LOGS_NOT_RETAINED"}function hn(T){return E(T)&&T.code==="RUN_NOT_FOUND"}var Ze={list:1e4,busy:5000,idle:15000,history:15000};function gr(T){if(!T)return!1;return T.isRunning===!0||(T.local?.activeRuns.length??0)>0}function hr(){return Ze.list}function yr(){return Ze.history}function bt(){let T=j(Ze.busy),D=j(Ze.idle);return w((_)=>gr(_)?T:D,[T,D])}function xt(){return j(hr())}function Ct(){return j(yr())}var wt=St.filter((T)=>T!=="logs");function Nt(T){be([le.runners],[he.all],{events:wt,enabled:T})}function Lt(T,D){be([le.runner(T)],[he.runner(T)],{events:wt,enabled:D})}function Tt(T,D,_,B){rt({channels:[le.runner(T)],events:["logs"],enabled:_,onEvent:(U)=>{let H=Rt(U,T,D);if(H!==void 0)B.onHint(H)},onGap:()=>B.onGap()})}var Je={idle:{label:"Idle",tone:"neutral",hint:"Registered but not started in its process: nothing is scheduled there."},running:{label:"Running",tone:"success",hint:"Started: its schedule is armed and triggers are accepted."},paused:{label:"Paused",tone:"warning",hint:"Paused everywhere: scheduled and manual runs do not start."},stopped:{label:"Stopped",tone:"danger",hint:"Stopped in its process: it takes no more triggers."}},Rr={label:"Run in flight",tone:"info",hint:"A run is executing somewhere right now (the runner's lock or active runs say so)."},vr={label:"Active",tone:"neutral",hint:"Not paused. Its owner's own status shows only on the owner's API."},Et={running:{label:"Running",tone:"info"},success:{label:"Success",tone:"success"},failed:{label:"Failed",tone:"danger"},timeout:{label:"Timed out",tone:"warning"},killed:{label:"Killed",tone:"danger"}},je={schedule:"Schedule",manual:"Manual",queued:"Queued trigger",resume:"Resume"};function Dt(T){return`${new Date(T).toISOString().slice(0,19).replace("T"," ")} UTC`}function At(T){if(T===null)return"None: runs only when triggered";if("cron"in T)return`Cron ${T.cron} in ${T.tz??"the owner's local time"}`;if("every"in T){let D=T.anchor===void 0?"from when it started":`aligned to ${Dt(T.anchor)}`;return`Every ${L(T.every)}, ${D}`}return`Once, at ${Dt(T.at)}`}function kt(T){return T===void 0?"unlimited":o(T)}function Ot(T){if(T.queueRuns===void 0)return T.maxQueuedRuns===void 0?null:`up to ${o(T.maxQueuedRuns)}`;if(!T.queueRuns)return"No";return T.maxQueuedRuns===void 0?"Yes":`Yes, up to ${o(T.maxQueuedRuns)}`}function Pt(T){let D=[T.local?Je[T.local.status]:T.isPaused?Je.paused:vr];if(T.isRunning||(T.local?.activeRuns.length??0)>0)D.push(Rr);return D}var br=[10,25,50,100,200];function yn(T){return Math.max(1,Math.min(50,T))}function It(T){let D=Math.max(1,T);return[...new Set([...br.filter((_)=>_<=D),yn(D),D])].sort((_,B)=>_-B)}function _e(T){return E(T)&&T.code==="RUNNER_NOT_FOUND"}function Fe(T){return E(T)&&T.isAuth}function en(T){let D=T.durationMs??(T.finishedAt===void 0?void 0:T.finishedAt-T.startedAt);return D===void 0?null:L(Math.max(0,D))}var Mt="This runner is registered by another process; changes are adopted at its owner's next sync.";function _t(T){return[...T.filter((D)=>D.isLocal),...T.filter((D)=>!D.isLocal)]}function Ft(T,D){let _=D.trim().toLowerCase();if(!_)return[...T];return T.filter((B)=>B.id.toLowerCase().includes(_)||(B.name?.toLowerCase().includes(_)??!1))}function Bt(T){return[...T].sort((D,_)=>_.startedAt-D.startedAt)}function Ut({runner:T,maxHistory:D,enabled:_,openRunId:B}){let U=s(),[H,Q]=W(),Y=yn(D),q=Pe(me(H,"history",Y),D),ee=me(H,"offset",0),X={offset:ee,limit:q,order:"desc"},ge=Ct(),ae=i({queryKey:he.history(T,X),queryFn:({signal:ce})=>go(U,T,X,ce),refetchInterval:ge,enabled:_,placeholderData:z}),ue=ae.data?Bt(ae.data.items):[],G=ae.data?.page.total??0;return{query:ae,rows:ue,offset:ee,limit:q,total:G,paged:G>q,turning:ae.isFetching&&ae.isPlaceholderData,openRunOffPage:B!==null&&ue.length>0&&!ue.some((ce)=>ce.runId===B),onChange:(ce)=>{let fe=ce.limit===q?ce.offset:0;Q({offset:fe>0?String(fe):null,history:ce.limit===Y?null:String(ce.limit)})}}}var Ht="A run's console output is captured whichever way it runs: console.log, info and debug as stdout, warn and error as stderr, beside its ctx.log() lines. Output written by native code, by a program the run launched with its own output, or, in a worker or in-process run, straight to process.stdout or process.stderr is not captured here.",qt=`Values that look like secrets are replaced with ${jr} before a line is stored, by default, so some lines may not read exactly as the run printed them.`;function Kt(T,D){if(T===!1||T<=D)return`Following this run: re-read every ${D/1000} s. Live updates are not reaching this view, so this is a poll. While the run is going, its history row shows no line count yet: the lines here are the count.`;return`Following this run: each time its log grows the live socket says so (at most every ${Jr/1000} s), and the new lines are read at once. A re-read every ${T/1000} s is the fallback, in case a notice goes missing. While the run is going, its history row shows no line count yet: the lines here are the count.`}var Rn="logStream",Ae="logs",xr={stdout:"stdout",stderr:"stderr",log:"logger"};function bn(T){return xr[T]??T}function zt(){return[{value:"",label:"Every stream"},...Zn.map((T)=>({value:T,label:bn(T)}))]}function Gt(T){return T!==null&&T!==void 0&&Zn.includes(T)}function Wt(T){let D=$t.indexOf(T);if(D<0)return"neutral";if(D>=$t.indexOf("error"))return"danger";if(D>=$t.indexOf("warn"))return"warning";return D>=$t.indexOf("info")?"info":"neutral"}function nn(T,D=2){return String(T).padStart(D,"0")}function Vt(T){let D=new Date(T);if(Number.isNaN(D.getTime()))return"--:--:--.---";return`${nn(D.getHours())}:${nn(D.getMinutes())}:${nn(D.getSeconds())}.${nn(D.getMilliseconds(),3)}`}function xn(T){let D=new Date(T);return Number.isNaN(D.getTime())?void 0:D.toISOString()}function tn(){let T=se("runnerLogs"),D=y("runners.logs");return T&&D}var Cr="Capture cut this line at its 8 KiB limit, so it is shorter than what the run printed.";function Qt({runner:T,runId:D,enabled:_=!0}){let B=s(),{limits:U}=m(),H=J(),[Q,Y]=W(),q=c(),ee=Q.get(Rn),X=Gt(ee)?ee:void 0,ge=pt(U.maxLogPage),ae=fn.logs(T,D,X),ue=j(Ye),G=i({queryKey:ae,enabled:_,queryFn:async({signal:pe})=>{let Se=H.getQueryData(ae),ke=await ft(B,T,D,{since:Se?.cursor===0?void 0:Se?.cursor,limit:ge,order:"asc",stream:X},pe);return ht(Se,ke)},refetchInterval:(pe)=>gn(pe.state.error)||hn(pe.state.error)?!1:yt(pe.state.data,ue)}),ce=G.data,fe=()=>void H.refetchQueries({queryKey:ae,exact:!0,type:"active"});Tt(T,D,_&&ce?.live!==!1,{onHint:(pe)=>{if(vt(H.getQueryData(ae),pe))fe()},onGap:fe});let ve=t("span",{className:"run-log-filter",children:[e("label",{htmlFor:q,children:"Stream"}),e(S,{id:q,options:zt(),value:X??"",onChange:(pe)=>Y({[Rn]:pe||null})})]});return t("section",{className:"run-logs","aria-label":`Log of run ${D}`,"data-testid":`run-logs-${D}`,children:[e("div",{className:"run-log-header",children:ve}),gn(G.error)?e(d,{title:"Run logs are not retained",description:G.error.detail??"This API keeps no run logs at all, so there is none for this run to read. That is not the same as a run that logged nothing."}):hn(G.error)?e(d,{title:"No log for this run",description:"This runner has no record of the run: either it never ran here, or it has aged out of the runs this runner keeps, and its log went with it."}):!ce?G.isError?e(A,{error:G.error,title:"Could not load the run log",onRetry:()=>void G.refetch()}):e(f,{label:"Loading the run log",showLabel:!0}):t(n,{children:[G.isError&&e(A,{error:G.error,title:"Could not refresh the run log",onRetry:()=>void G.refetch()}),e(Sr,{tail:ce,poll:ue}),ce.lines.length===0?e("p",{className:"muted","data-testid":"run-logs-empty",children:wr(ce,X!==void 0)}):e(dn,{label:`Log lines of run ${D}`,items:ce.lines.map((pe)=>({id:pe.seq,number:pe.seq,text:pe.message,className:N("run-log-line",`run-log-line-${pe.stream}`),prefix:t(n,{children:[e("time",{className:"run-log-time",dateTime:xn(pe.at),title:xn(pe.at),children:Vt(pe.at)}),e("span",{className:"run-log-stream",children:bn(pe.stream)}),pe.level!==void 0&&e(p,{className:"run-log-level",tone:Wt(pe.level),children:pe.level})]}),suffix:pe.truncated?e(p,{className:"run-log-cut",tone:"warning",title:Cr,children:"cut at 8 KiB"}):void 0}))}),e("p",{className:"muted run-log-gap",children:Ht}),e("p",{className:"muted run-log-redaction",children:qt})]})]})}function wr(T,D){if(D)return T.live?"Nothing on this stream yet.":"This run logged nothing on this stream.";return T.live?"Nothing logged yet.":"This run logged nothing. A 200 with no lines means the log is kept and empty, not that it is missing."}function Sr({tail:T,poll:D}){let _=[];if(T.dropped>0)_.push(`${h(T.dropped,"earlier line")} dropped: this run's log keeps its most recent lines only (1,000 lines and 1 MiB per run by default). The count is the run's own, whatever this filter shows.`);if(T.capped)_.push("A cap is trimming this log now: its oldest lines go as new ones arrive.");if(T.trimmed>0)_.push(`${h(T.trimmed,"earlier line")} left this view, which keeps the last ${o(mn)}. Reopen the log to read from the start of what is kept.`);if(T.live)_.push(Kt(D,Ye));if(_.length===0)return null;return e("div",{className:"run-log-notes","data-testid":"run-log-notes",children:_.map((B)=>e("p",{className:"muted",children:B},B))})}function Yt({run:T}){let D=tn(),[_,B]=W(),U=_.get(Ae)===T.runId;if(!D)return null;if(!Xe(T))return e("p",{className:"muted run-log-section","data-testid":`run-no-logs-${T.runId}`,children:"This run logged nothing."});return t("div",{className:"run-log-section",children:[e(a,{size:"sm","aria-expanded":U,onClick:()=>B({[Ae]:U?null:T.runId}),children:U?"Hide log":"Show log"}),U&&e(Qt,{runner:T.runnerId,runId:T.runId})]})}function Cn({status:T}){let{label:D,tone:_}=Et[T];return e(p,{tone:_,children:D})}function Be({run:T}){let D=T.host===void 0&&T.pid===void 0?null:[T.host,T.pid===void 0?void 0:`pid ${T.pid}`].filter(Boolean).join(", ");return t("div",{className:"run-record","data-testid":`run-${T.runId}`,children:[e(F,{className:"run-summary",items:[{label:"Run id",value:t("span",{className:"run-id-line",children:[e("code",{children:T.runId}),e(ye,{text:T.runId,ariaLabel:`Copy run id ${T.runId}`})]})},{label:"Status",value:e(Cn,{status:T.status})},{label:"Attempt",value:o(T.attempt)},{label:"Source",value:je[T.source]},{label:"Execution",value:T.mode},D!==null&&{label:"Where",value:D},{label:"Started",value:e(v,{value:T.startedAt})},{label:"Finished",value:T.finishedAt===void 0?null:e(v,{value:T.finishedAt})},{label:"Duration",value:en(T)},T.exitCode!==void 0&&{label:"Exit code",value:T.exitCode===null?null:String(T.exitCode)},T.signal!==void 0&&{label:"Signal",value:T.signal},T.detached!==void 0&&{label:"Detached",value:T.detached?"Yes: it outlived its owner":"No"}]}),T.error&&e(dt,{error:T.error,label:`Error of run ${T.runId}`}),T.result!==void 0&&e(ie,{value:T.result,label:`Result of run ${T.runId}`,expandDepth:1})]})}function Nr({run:T,showLogs:D}){let[_,B]=W(),[U,H]=r(!1),Q=c(),Y=D&&_.get(Ae)===T.runId,q=U||Y,ee=()=>{if(q){if(H(!1),Y)B({[Ae]:null});return}H(!0)},X=T.logsDropped??0;return t(vn,{children:[t("tr",{"data-testid":`history-row-${T.runId}`,children:[e("td",{children:e("button",{type:"button",className:"run-toggle","aria-expanded":q,"aria-controls":q?Q:void 0,"aria-label":`${q?"Hide":"Show"} run ${T.runId}`,onClick:ee,children:e("span",{"aria-hidden":"true",children:q?"▾":"▸"})})}),e("td",{children:e(v,{value:T.startedAt})}),e("td",{children:e(Cn,{status:T.status})}),e("td",{children:je[T.source]}),e("td",{className:"numeric",children:o(T.attempt)}),e("td",{className:"numeric",children:en(T)??"—"}),e("td",{children:e("code",{className:"run-id",children:T.runId})}),D&&t("td",{className:"run-logs-cell",children:[Xe(T)&&e(a,{size:"sm",variant:"ghost","aria-expanded":Y,onClick:()=>B({[Ae]:Y?null:T.runId}),children:Y?"Hide log":"Log"}),X>0&&t(p,{tone:"warning",title:`${h(X,"line")} of this run's log went to the log's cap, oldest first.`,children:[h(X,"line")," dropped"]})]})]}),q&&e("tr",{id:Q,className:"run-details-row",children:t("td",{colSpan:D?8:7,children:[e(Be,{run:T}),e(Yt,{run:T})]})})]})}function Xt({runner:T,enabled:D=!0,info:_}){let B=re(),U=_!==void 0&&Ke(_,B).clearHistory,[H,Q]=r(!1),{limits:Y}=m(),[q,ee]=W(),X=c(),ge=tn(),ae=It(Y.maxHistory),ue=ge?q.get(Ae):null,G=Ut({runner:T,maxHistory:Y.maxHistory,enabled:D,openRunId:ue}),ce=G.query,fe=ce.data!==void 0&&G.total===0;return t(R,{title:"History",actions:t("div",{className:"history-actions",children:[U&&e(a,{size:"sm",variant:"danger",disabled:fe,title:fe?"No runs to clear.":void 0,onClick:()=>Q(!0),children:"Clear history…"}),t("div",{className:"history-limit",children:[e("label",{htmlFor:X,children:"Runs shown"}),e(S,{id:X,options:ae.map((ve)=>({value:String(ve)})),value:String(G.limit),onChange:(ve)=>G.onChange({offset:G.offset,limit:Number(ve)})})]})]}),children:[H&&_&&e(jn,{runner:_,onClose:()=>Q(!1)}),ce.isPending?e(f,{label:"Loading the history",showLabel:!0}):ce.isError?e(A,{error:ce.error,title:"Could not load the history",onRetry:()=>void ce.refetch()}):fe?e(d,{title:"No runs yet",description:"Runs show here, newest first, once this runner has run."}):G.rows.length===0?e(d,{title:"No runs on this page",description:"This page starts past the end of the history. Go back for the runs it holds."}):t(I,{label:"Run history",className:"history-table",children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:e("span",{className:"visually-hidden",children:"Details"})}),e("th",{scope:"col",children:"Started"}),e("th",{scope:"col",children:"Status"}),e("th",{scope:"col",children:"Source"}),e("th",{scope:"col",className:"numeric",children:"Attempt"}),e("th",{scope:"col",className:"numeric",children:"Duration"}),e("th",{scope:"col",children:"Run id"}),ge&&e("th",{scope:"col",children:"Log"})]})}),e("tbody",{children:G.rows.map((ve)=>e(Nr,{run:ve,showLogs:ge},ve.runId))})]}),G.openRunOffPage&&t("p",{className:"muted history-open-log-note","data-testid":"history-open-log-note",children:[`The log this link opens belongs to run ${ue}, which is not on this page — it is further back in the history, or gone. `,e(a,{size:"sm",variant:"ghost",onClick:()=>ee({[Ae]:null}),children:"Close log"})]}),G.paged&&e(ne,{label:"History pages",offset:G.offset,limit:G.limit,total:G.total,itemCount:G.rows.length,pageSizes:ae,maxPageSize:Y.maxHistory,disabled:G.turning,onChange:G.onChange})]})}var Lr=[{key:"success",label:"Success",state:"completed"},{key:"failed",label:"Failed",state:"failed"},{key:"timeout",label:"Timed out",state:"delayed"},{key:"killed",label:"Killed",state:"dead"},{key:"skipped",label:"Skipped"},{key:"queued",label:"Queued",state:"waiting"},{key:"total",label:"Total"}];function Zt({detail:T}){return e("div",{className:"screen","data-testid":"runner-hidden",children:e(d,{headingLevel:1,title:"Runner hidden",description:T??"You may not read this runner.",action:e(b,{to:"/runners",children:"Back to runners"})})})}function Tr({id:T}){return e("div",{className:"screen","data-testid":"runner-not-found",children:e(d,{headingLevel:1,title:"Runner not found",description:t(n,{children:["There is no runner ",e("code",{children:T})," in this namespace. It may have been unregistered, or its process has not started yet."]}),action:e(b,{to:"/runners",children:"Back to runners"})})})}function Dr({runner:T}){return e(F,{className:"runner-summary",items:[{label:"Namespace",value:e("code",{children:T.namespace})},{label:"Registered here",value:T.isLocal?"Yes (local)":"No (another process)",key:"isLocal"},T.file!==void 0&&{label:"File",value:e("code",{children:T.file})},{label:"Schedule",value:e("span",{"data-testid":"runner-schedule",children:At(T.schedule)})},{label:"Next run",value:T.nextRunAt===null?"Not scheduled":e(v,{value:T.nextRunAt}),hint:T.local&&T.local.nextRunAt!==null&&T.local.nextRunAt!==T.nextRunAt?t(n,{children:["This process's ticker:"," ",e(v,{value:T.local.nextRunAt})]}):void 0},{label:"Execution mode",value:T.executionMode,hint:qe(T.config,"executionMode")},{label:"Run mode",value:T.runMode,hint:qe(T.config,"runMode")},{label:"Queues triggers",value:Ot(T)},{label:"Max concurrency",value:e("span",{"data-testid":"runner-concurrency",children:kt(T.maxConcurrency)}),hint:qe(T.config,"maxConcurrency")},T.config!==void 0&&{label:"Settings override",key:"configOverride",value:e("span",{"data-testid":"runner-config-override",children:Hn(T.config)}),hint:Kn(T.config)},{label:"Queued triggers",value:o(T.queuedTriggers)},{label:"Running on",value:T.runningOn?t(n,{children:[e("code",{children:T.runningOn.runId}),T.runningOn.host!==void 0&&` on ${T.runningOn.host}`,T.runningOn.pid!==void 0&&` (pid ${T.runningOn.pid})`,", since ",e(v,{value:T.runningOn.since})]}):null},{label:"Updated",value:e(v,{value:T.updatedAt})},{label:"Last error",value:T.lastError?t("span",{className:"runner-last-error",children:[e("strong",{children:T.lastError.name}),":"," ",T.lastError.message]}):null}]})}function Er({stats:T}){return e("dl",{className:"stat-grid","aria-label":"Runs by outcome","data-testid":"runner-stats",children:Lr.map(({key:D,label:_,state:B})=>t("div",{className:B?`stat stat-state state-${B}`:"stat",children:[e("dt",{className:"stat-label",children:_}),e("dd",{className:"stat-value",children:o(T[D])})]},D))})}function Ar({runner:T,stats:D,historyEnabled:_}){let B=T.local?.activeRuns??[];return t(n,{children:[t("header",{className:"runner-header",children:[t("div",{className:"runner-heading",children:[e("h1",{className:"screen-title runner-title",children:l(T.name)}),t("span",{className:"runner-badges","data-testid":"runner-status",children:[Pt(T).map((U)=>e(p,{tone:U.tone,title:U.hint,children:U.label},U.label)),!T.isLocal&&e(p,{tone:"neutral",children:"Other process"})]}),T.name!==T.id&&e("code",{className:"runner-id muted","data-testid":"runner-id",children:T.id})]}),e(lt,{runner:T})]}),!T.isLocal&&e("p",{className:"notice",role:"note","data-testid":"non-local-note",children:Mt}),e(R,{title:"Summary",children:e(Dr,{runner:T})}),e(R,{title:"Stats",children:e(Er,{stats:D})}),T.local&&e(R,{title:"Active runs",children:B.length===0?e("p",{className:"muted","data-testid":"no-active-runs",children:"Nothing is running in this process."}):e("ul",{className:"run-list","aria-label":"Active runs",children:B.map((U)=>e("li",{children:e(Be,{run:U})},U.runId))})}),e(R,{title:"Last run",children:T.lastRun?e(Be,{run:T.lastRun}):e("p",{className:"muted",children:"This runner has not run yet."})}),e(Xt,{runner:T.id,enabled:_,info:T})]})}function kr(){let{runner:T=""}=de(),D=s(),_=y("runners.read"),B=gt(),U=_&&B,H=bt(),Q=i({queryKey:he.detail(T),queryFn:({signal:q})=>ho(D,T,q),enabled:U,refetchInterval:(q)=>_e(q.state.error)||Fe(q.state.error)?!1:H(q.state.data)}),Y=i({queryKey:he.stats(T),queryFn:({signal:q})=>yo(D,T,q),enabled:U&&Q.isSuccess,refetchInterval:(q)=>_e(q.state.error)||Fe(q.state.error)?!1:H(Q.data)});if(Lt(T,U&&!Fe(Q.error)&&!_e(Q.error)),B&&!_)return e(Zt,{});if(Fe(Q.error))return e(Zt,{detail:Q.error.detail});if(_e(Q.error))return e(Tr,{id:T});return t("div",{className:"screen runner-screen","data-testid":"runner-screen",children:[e("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:t("ol",{children:[e("li",{children:e(b,{to:"/runners",children:"Runners"})}),e("li",{"aria-current":"page",children:T})]})}),Q.data?t(n,{children:[Q.isError&&e(A,{error:Q.error,title:"Could not refresh this runner",onRetry:()=>void Q.refetch()}),e(Ar,{runner:Q.data,stats:Y.data??Q.data.stats,historyEnabled:U})]}):Q.isError?e(x,{headingLevel:1,error:Q.error,title:"Could not load the runner",onRetry:()=>void Q.refetch()}):e(f,{label:"Loading the runner",showLabel:!0})]})}var Jt=25;function Or({item:T}){let D=T.status?Je[T.status]:null;return t("tr",{"data-testid":`runner-row-${T.id}`,children:[t("td",{children:[e(b,{to:mt(T.id),className:"runner-link",children:T.isLocal&&T.name&&T.name!==T.id?T.name:T.id}),T.isLocal&&T.name&&T.name!==T.id&&e("code",{className:"runner-id muted",children:T.id})]}),e("td",{className:"runners-where",children:T.isLocal?e(p,{tone:"accent",children:"Local"}):e(p,{tone:"neutral",title:"Registered by another process: its name shows on its own screen.",children:"Other process"})}),t("td",{className:"runners-status",children:[D?e(p,{tone:D.tone,title:D.hint,children:D.label}):T.isPaused?e(p,{tone:"warning",title:"Paused through the shared state: its owner skips scheduled runs.",children:"Paused"}):e(p,{tone:"neutral",title:"Not paused. Its lifecycle status shows only in its own process.",children:"Active"})," ",T.isRunning&&e(p,{tone:"accent",title:"A run holds this runner's lock right now, in whichever process.",children:"Run in flight"})]})]})}function Pr(){let T=s(),D=y("runners.list"),[_,B]=W(),U=c(),H=_.get("search")??"",Q=Me(H),Y=xt();Nt(D);let q=i({queryKey:he.list(),queryFn:({signal:G})=>cn(T,G),refetchInterval:Y,enabled:D});if(!D)return t("div",{className:"screen",children:[e("h1",{className:"screen-title",children:"Runners"}),e(d,{title:"Nothing to show",description:"You may not list runners on this API."})]});let ee=q.data?_t(q.data.items):[],X=Ft(ee,Q),ge=ee.filter((G)=>G.isLocal).length,ae=Kr(X.length,{offset:me(_,"offset",0),limit:me(_,"limit",Jt)}),ue=X.slice(ae.offset,ae.offset+ae.limit);return t("div",{className:"screen","data-testid":"runners-list",children:[e("h1",{className:"screen-title",children:"Runners"}),e(R,{title:"Runners",actions:t("div",{className:"search",children:[e("label",{htmlFor:U,className:"visually-hidden",children:"Filter runners by id or name"}),e("input",{id:U,type:"search",className:"input",placeholder:"Filter runners",...De,value:H,maxLength:200,onChange:(G)=>B({search:G.target.value,offset:null})})]}),children:q.isPending?e(f,{label:"Loading runners",showLabel:!0}):q.isError?e(x,{error:q.error,title:"Could not load runners",onRetry:()=>void q.refetch()}):ee.length===0?e(d,{title:"No runners yet",description:"Runners appear here once a process registers one in this namespace."}):X.length===0?e(d,{title:"No runners match",description:`No runner id or name contains “${Q.trim()}”.`}):t(n,{children:[t(I,{label:"Runners",children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Runner"}),e("th",{scope:"col",className:"runners-where",children:"Where"}),e("th",{scope:"col",className:"runners-status",children:"Status"})]})}),e("tbody",{children:ue.map((G)=>e(Or,{item:G},G.id))})]}),ae.paged&&e(ne,{label:"Runner pages",offset:ae.offset,limit:ae.limit,total:X.length,itemCount:ue.length,onChange:(G)=>B({offset:G.offset>0?String(G.offset):null,limit:G.limit===Jt?null:String(G.limit)})}),t("p",{className:"muted runners-count","data-testid":"runners-count",children:[h(ge,"local runner"),","," ",h(ee.length-ge,"runner")," in other processes",X.length<ee.length&&` (${X.length} shown)`]})]})})]})}export{kr as RunnerScreen,Pr as RunnersListScreen};
2
-
3
- //# debugId=6CF9674632806CF764756E2164756E21
4
- //# sourceMappingURL=index-pjtmzrcd.js.map
@@ -1,4 +0,0 @@
1
- import{Me,c,r,Z,Tn,Qe,n,e,t,p,s,m,y,Fe,se,z,i,G,a,de,b,De,j,d,f,la,ee,Ve,xn,R,x,o,Y,Lt,h,l,u,S,I,ne,_a,gr,$r,qe,La,$e,Et,at,Ut,st,Nt,Se,it}from"./main-xf44bv26.js";import{v}from"./main-smabxbn4.js";import{ze,Rt,Ae,Tr,Dr,No,pn,Fn,Bt,qt,Vn,Bn,Oo,fn,vo,qn,Jn,Sr,jn,Ro,Ao,At}from"./main-eekxtm5w.js";import{_e,Ye,hn,To,Hn,Do,So,gn,Oe}from"./main-b35rfpdf.js";import{k}from"./main-v2f8a4g3.js";import{O}from"./main-zk3n47nq.js";import{W,me,Tt,Pe}from"./main-yg6scp84.js";import"./main-fcq7hfk0.js";import"./main-9qd3nqs5.js";import"./main-3xxhy5jh.js";import{F}from"./main-6xdkyzv1.js";function ce({queue:g,workerKey:w}){let N=s(),A=it("workers"),[q,_]=Nt("range"),{analytics:K,key:E,request:P}=st(q),D=j(G),C=i({queryKey:qe.worker(g,w,E),queryFn:({signal:T})=>La(N,g,w,P(),T),enabled:A,refetchInterval:D});if(!A)return null;return e(R,{title:"Throughput and busyness",className:"analytics-section",actions:e(Ut,{range:q,onChange:_,label:"Range for this worker's numbers",maxSpan:K?.maxSpanMs}),children:e("div",{className:"worker-analytics","data-testid":"worker-analytics",children:C.isPending?e(f,{label:"Loading this worker's numbers",showLabel:!0}):C.isError?e(Et,{error:C.error,title:"Could not load this worker's numbers",onRetry:()=>void C.refetch(),testId:"worker-range-not-retained"}):t(n,{children:[t("section",{"aria-label":"Throughput",children:[e("h3",{className:"worker-analytics-title",children:"Throughput"}),e(at,{range:C.data.jobs.range,always:!0,testId:"worker-jobs-range-caption"}),t("div",{className:"analytics-headline",children:[t("dl",{className:"stat-grid","aria-label":"Throughput totals",children:[t("div",{className:"stat",children:[e("dt",{className:"stat-label",children:"Completed"}),e("dd",{className:"stat-value",children:o(C.data.jobs.totals.completed)})]}),t("div",{className:"stat",children:[e("dt",{className:"stat-label",children:"Failed"}),e("dd",{className:"stat-value",children:o(C.data.jobs.totals.failed)}),e("dd",{className:"stat-hint",children:"Attempts that failed."})]})]}),e("div",{className:"analytics-charts",children:e(Se,{values:C.data.jobs.buckets.map((T)=>T.completed),secondary:C.data.jobs.buckets.map((T)=>T.failed),label:`${w}: ${o(C.data.jobs.totals.completed)} completed, ${o(C.data.jobs.totals.failed)} failed, ${$e(C.data.jobs.range)}`,width:240})})]})]}),C.data.busyness?t("section",{"aria-label":"Busyness",children:[e("h3",{className:"worker-analytics-title",children:"Busyness"}),e(at,{range:C.data.busyness.range,always:!0,testId:"worker-busyness-range-caption"}),C.data.busyness.totals.samples===0?e("p",{className:"muted","data-testid":"worker-busyness-no-samples",children:"No heartbeat landed in this range, so nothing was sampled — the worker was not reporting, which is not the same as idle."}):t("div",{className:"analytics-headline",children:[t("dl",{className:"stat-grid","aria-label":"Busyness totals",children:[t("div",{className:"stat",children:[e("dt",{className:"stat-label",children:"Mean in flight"}),t("dd",{className:"stat-value",children:[C.data.busyness.totals.activeMean.toFixed(1)," /"," ",o(C.data.busyness.totals.concurrency)]}),e("dd",{className:"stat-hint",children:"Against the concurrency of the last sample."})]}),t("div",{className:"stat",children:[e("dt",{className:"stat-label",children:"Most in flight"}),e("dd",{className:"stat-value",children:o(C.data.busyness.totals.activeMax)})]}),t("div",{className:"stat",children:[e("dt",{className:"stat-label",children:"Samples"}),e("dd",{className:"stat-value",children:o(C.data.busyness.totals.samples)}),e("dd",{className:"stat-hint",children:"Heartbeats in the range."})]})]}),e("div",{className:"analytics-charts",children:e(Se,{values:C.data.busyness.buckets.map((T)=>T.activeMean),secondary:C.data.busyness.buckets.map((T)=>T.concurrency),label:`${w}: mean jobs in flight against its concurrency, ${$e(C.data.busyness.range)}`,width:240})})]})]}):e("p",{className:"muted","data-testid":"worker-busyness-absent",children:"This backend records no busyness for workers."})]})})})}var Ie=new Set(["concurrency","maxStalledCount"]);function ue(g,w){return Ie.has(g)?o(w):`${o(w)} ms`}function Le(g,w){return Qe.every((N)=>g.config?.effective[N]===w.config?.effective[N])}function be({queue:g,workerKey:w,instances:N,stored:A}){let q=qt(),[_,K]=r(!1),E=N.find((L)=>L.config!==void 0);if(N.length===0)return e(R,{title:"Configuration",children:e(Ke,{queue:g,workerKey:w,stored:A,canReset:q("workers.configure")})});let P=E?.config,D=N.some((L)=>L.control?.pending===!0),C=E!==void 0&&Bt(E,q).configure,T=E!==void 0&&N.some((L)=>L.config!==void 0&&!Le(L,E));return t(R,{title:"Configuration",actions:t(n,{children:[D&&e(p,{tone:"accent",title:"A change was recorded and an instance has not taken it up yet. It applies within seconds.",children:"Change pending"}),C&&e(a,{size:"sm",onClick:()=>K(!0),children:"Edit settings…"})]}),children:[e("div",{"data-testid":"worker-config",children:P===void 0?e("p",{className:"muted",children:"No instance of this key reports its settings (it predates remote configuration, or the backend keeps no config), so there is nothing to show."}):t(n,{children:[e("p",{className:"muted worker-config-summary","data-testid":"worker-config-summary",children:P.overridden.length===0?"No override is stored: every value is what the code asks for.":t(n,{children:["An override (version ",P.seq,P.updatedAt!==void 0&&t(n,{children:[", written ",e(v,{value:P.updatedAt})]}),") replaces ",P.overridden.length," of the"," ",Qe.length," settings, for every instance of this key."]})}),T&&t("p",{className:"notice",role:"note","data-testid":"worker-config-differs",children:["Not every instance runs with these values (they are"," ",e("code",{children:E.id}),"’s): a change is still being taken up, or the instances’ code differs. Each instance’s Settings… shows its own."]}),t(I,{label:`Settings of ${w}`,children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Setting"}),e("th",{scope:"col",className:"num",children:"Running with"}),e("th",{scope:"col",className:"num",children:"Code asks for"}),e("th",{scope:"col",children:"Source"})]})}),e("tbody",{children:Qe.map((L)=>{let Q=P.overridden.includes(L),B=P.derived?.includes(L)===!0;return t("tr",{"data-testid":`worker-setting-${L}`,children:[e("th",{scope:"row",title:Vn[L],children:e("code",{children:L})}),e("td",{className:"num",children:ue(L,P.effective[L])}),t("td",{className:"num",children:[ue(L,P.code[L]),B&&t("span",{className:"muted",title:"Derived rather than given: a third of lockDuration.",children:[" ","(derived)"]})]}),e("td",{children:Q?e(p,{tone:"accent",title:"Replaced by the override stored for this key.",children:"Overridden"}):e("span",{className:"muted",children:"Code"})})]},L)})})]})]})}),_&&E!==void 0&&e(Bn,{worker:E,onClose:()=>K(!1)})]})}function Ke({queue:g,workerKey:w,stored:N,canReset:A}){let q=s(),[_,K]=r(!1),E=O({mutationFn:()=>gn(q,g,w),invalidate:Ye(g),successMessage:`Reset ${w} to the values in its code`,toastErrors:!1}),P=N?Qe.flatMap((C)=>{let T=N.values[C];return T===void 0?[]:[{setting:C,value:T}]}):[],D=A&&N!==null;return t("div",{"data-testid":"worker-config-offline",children:[e("p",{className:"muted",children:"No instance of this key is live, so its configuration cannot be shown until one reports: the values a worker runs with and the ones its code asks for come from the running worker."}),N===null?e("p",{"data-testid":"worker-config-none-stored",children:"No override is stored for this key."}):N!==void 0?t(n,{children:[t("p",{"data-testid":"worker-config-stored",children:["An override is stored for this key (version ",N.seq,", written"," ",e(v,{value:N.updatedAt}),"). The next instance to start takes it up."]}),P.length>0&&e(F,{items:P.map(({setting:C,value:T})=>({key:C,label:e("code",{children:C}),value:ue(C,T)}))})]}):null,D&&e(a,{size:"sm",variant:"danger",onClick:()=>K(!0),children:"Reset to code values…"}),e(k,{open:_,onClose:()=>K(!1),title:`Reset ${w}?`,description:"Drops the override stored for this key, so every instance started from now on runs with what its code asks for.",confirmLabel:"Reset",pendingLabel:"Resetting…",variant:"danger",onConfirm:()=>E.mutateAsync()})]})}var M={state:"jobState",name:"jobName",search:"jobSearch",order:"jobOrder",offset:"jobOffset",limit:"jobLimit",finished:"finished"},H={kind:"preset",seconds:86400},Je=new Set(["completed","dead"]);function pe(g){return g===Ae||Je.has(g)}function ye(g){if(g.kind==="preset")return g.seconds===H.seconds?null:`${g.seconds}s`;return`${g.from}-${g.to}`}function fe(g){if(g===null||g==="")return H;let w=/^(\d+)-(\d+)$/.exec(g);if(w){let N=Number(w[1]),A=Number(w[2]);return Number.isSafeInteger(N)&&Number.isSafeInteger(A)&&A>N?{kind:"custom",from:N,to:A}:H}if(/^\d+s$/.test(g)){let N=gr(g);return N.kind==="preset"&&g===`${N.seconds}s`?N:H}return H}function Be(g){return g.kind==="preset"?{kind:"last",ms:g.seconds*1000}:{kind:"between",from:g.from,to:g.to}}function xe(g,w,N,A){let q=fe(g.get(M.finished));return{state:w===Ae?null:w,offset:me(g,M.offset,0),limit:Pe(me(g,M.limit,A.defaultPageSize),A.maxPageSize),order:g.get(M.order)==="asc"?"asc":"desc",names:Tt(g.get(M.name)??""),search:g.get(M.search)??"",total:!1,attribution:{workerKeys:[N],workerIds:[],finished:pe(w)?Be(q):null}}}var He="Jobs whose last attempt this key ran",Ge=[M.offset],Ne=[{value:Ae,label:"All"},...Z.map((g)=>({value:g,label:Y[g],title:Lt[g]}))];function he({queue:g,workerKey:w}){let N=se("jobAttribution"),A=y("jobs.list");return e(R,{title:He,children:e("div",{"data-testid":"worker-jobs",children:!N?e("div",{"data-testid":"worker-jobs-unrecorded",children:e(d,{title:"Not recorded by this backend",description:"This backend does not record which worker ran a job, so a worker's jobs cannot be listed."})}):!A?e("div",{"data-testid":"worker-jobs-hidden",children:e(d,{title:"Jobs hidden",description:"You may not list this queue's jobs."})}):!la(w)?e("div",{"data-testid":"worker-jobs-unfilterable",children:e(d,{title:"Cannot be filtered to this key",description:"The API splits every filter value at commas, and this key contains one, so the job list cannot be filtered to it."})}):e(Ue,{queue:g,workerKey:w})})})}function Ue({queue:g,workerKey:w}){let N=s(),A=m(),q=Fe()("queues.list"),[_,K]=W(),E=ze(M.state,Ne,Ae),P=xe(_,E,w,A.limits),D=fe(_.get(M.finished)),C=pe(E),T=i({queryKey:ee.jobs(g,P),queryFn:({signal:B})=>xn(N,g,P,B,{attribution:A.features.jobAttribution,createdOrder:A.features.addedByState}),refetchInterval:_a("jobs"),placeholderData:z}),L=(B)=>K({[M.finished]:ye(B),[M.offset]:null}),Q=JSON.stringify([P.state,P.order,P.names,P.search,C?_.get(M.finished):null]);return t("section",{className:"jobs-section","aria-label":"Jobs this key ran",children:[e("p",{className:"muted","data-testid":"worker-jobs-last-attempt",children:"Only a job's last attempt is recorded: a job that failed on another worker and then ran here is listed on this page alone."}),e(Rt,{tabs:Ne,param:M.state,defaultValue:Ae,resetParams:Ge,label:"Job states"}),C?t("div",{"data-testid":"worker-jobs-range",children:[e(Ut,{range:D,onChange:L,label:"Range these jobs finished in",maxSpan:null}),e("p",{className:"muted",children:E===Ae?`Finished in: ${$r(D)}. Only a completed or dead job has a finish time, so a range lists those alone; choose Active for the jobs this key is running now.`:`Finished in: ${$r(D)}.`})]}):t("p",{className:"muted","data-testid":"worker-jobs-no-range",children:[P.state===null?"These":Y[P.state]," jobs have not finished, so no date range applies to them: this lists every one whose last attempt this key ran, whenever that was."]}),e(Tr,{filters:P,searchIndexed:A.features.search,onApply:(B)=>K({[M.name]:B.name,[M.search]:B.search,[M.offset]:null}),onOrder:(B)=>K({[M.order]:B==="asc"?"asc":null,[M.offset]:null})},`${_.get(M.name)??""}|${P.search}`),T.isPending?e(f,{label:"Loading this key's jobs",showLabel:!0}):T.isError?e(x,{error:T.error,title:"Could not load this key's jobs",onRetry:()=>void T.refetch()}):t(n,{children:[e(Dr,{queue:g,items:T.data.items,label:`Jobs whose last attempt ${w} ran`,linkJobs:q,processedBy:!1,empty:e("div",{"data-testid":"worker-jobs-empty",children:e(d,{title:"No jobs",description:"No job whose last attempt this key ran matches the state, range and filters. Which worker ran a job is kept only as long as the job itself: jobs removed on completion are not listed."})})},Q),e(ne,{label:"Pages of this key's jobs",offset:P.offset,limit:P.limit,itemCount:T.data.items.length,hasMore:T.data.page.hasMore,maxPageSize:A.limits.maxPageSize,disabled:T.isFetching&&T.isPlaceholderData,onChange:(B)=>K({[M.offset]:B.offset>0?String(B.offset):null,[M.limit]:String(B.limit)})})]})]})}function Ce({workerKey:g,instances:w}){let N=[];for(let C of w)if(C.summon!==void 0)N.push({id:C.id,summon:C.summon});if(N.length===0)return null;let A=w.length-N.length,q=N.some(({summon:C})=>C.kind!==void 0),_=N.some(({summon:C})=>C.group!==void 0),K=N.some(({summon:C})=>C.resolvedMode!==void 0),E=N.some(({summon:C})=>C.mode!==void 0),P=N.some(({summon:C})=>C.deadlineAt!==void 0),D=N.some(({summon:C})=>C.handle!==void 0);return e(R,{title:"Summoned",children:t("div",{"data-testid":"worker-summon",children:[e("p",{className:"muted worker-target-note",children:Oo}),t(I,{label:`Summoned instances of ${g}`,children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Instance"}),e("th",{scope:"col",children:"Summon"}),q&&e("th",{scope:"col",children:"Summoner"}),_&&e("th",{scope:"col",children:"Unit of"}),K&&e("th",{scope:"col",children:"Runs as"}),E&&e("th",{scope:"col",children:"Requested mode"}),P&&e("th",{scope:"col",children:"Requested deadline"}),D&&e("th",{scope:"col",children:"Handle"})]})}),e("tbody",{children:N.map(({id:C,summon:T})=>t("tr",{"data-testid":`worker-summon-row-${C}`,children:[e("th",{scope:"row",children:e("code",{children:C})}),e("td",{children:e("code",{children:l(T.id)})}),q&&e("td",{children:T.kind!==void 0&&l(T.kind)}),_&&e("td",{title:T.group===void 0?void 0:qn(T.group),children:T.group===void 0?"—":l(T.group)}),K&&e("td",{title:T.resolvedMode===void 0?void 0:"The mode it actually runs in: its own option, else the requested mode, else exit when idle.",children:T.resolvedMode!==void 0&&fn(T.resolvedMode)}),E&&e("td",{title:T.mode===void 0?void 0:vo(T.mode),children:T.mode!==void 0&&fn(T.mode)}),P&&e("td",{children:T.deadlineAt!==void 0&&e(v,{value:T.deadlineAt,hint:"As requested by the summoner."})}),D&&e("td",{children:T.handle!==void 0&&e("code",{className:"worker-target-file",children:l(T.handle)})})]},C))})]}),A>0&&t("p",{className:"muted","data-testid":"worker-summon-others",children:[h(A,"other instance")," of this key"," ",A===1?"reports":"report"," no summon."]})]})})}var Ze=5,Xe="This worker predates target reporting, so it does not say where its attempts run.";function ge({testId:g}){return e("span",{className:"muted",title:"Not reported: this worker predates target reporting.","data-testid":g,children:"—"})}function et({target:g}){if(g===void 0)return e(F,{items:[{label:"Runs in",value:e(ge,{testId:"worker-target-kind"}),hint:e("span",{"data-testid":"worker-target-predates",children:Xe})}]});return e(F,{items:[{label:"Runs in",value:e("span",{"data-testid":"worker-target-kind",children:Jn(g.kind)}),hint:jn(g.kind)},{label:"Processor",value:e("span",{"data-testid":"worker-target-processor",children:Sr(g.processor)})},g.name!==void 0&&{label:"Name",value:e("code",{"data-testid":"worker-target-name",children:l(g.name)})},g.file!==void 0&&{label:"File",value:e("code",{className:"worker-target-file","data-testid":"worker-target-file",children:l(g.file)})}]})}function tt({ids:g}){let w=g.slice(0,Ze),N=g.length-w.length;return t(n,{children:[h(g.length,"instance"),":"," ",w.map((A,q)=>t("span",{children:[q>0&&", ",e("code",{children:A})]},A)),N>0&&` and ${h(N,"more","more")}`]})}function rt({workerKey:g,groups:w}){let N=w.some((q)=>q.target?.name!==void 0),A=w.some((q)=>q.target?.file!==void 0);return t(n,{children:[e("p",{className:"notice",role:"note","data-testid":"worker-target-differs",children:"Not every instance of this key runs the same way: a redeploy is still rolling out, or the instances were built from different code. Each row is one way, with the instances that report it."}),t(I,{label:`Targets of ${g}`,children:[e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:"Runs in"}),e("th",{scope:"col",children:"Processor"}),N&&e("th",{scope:"col",children:"Name"}),A&&e("th",{scope:"col",children:"File"}),e("th",{scope:"col",children:"Instances"})]})}),e("tbody",{children:w.map(({target:q,ids:_})=>t("tr",{"data-testid":"worker-target-group",children:[e("th",{scope:"row",title:q===void 0?void 0:jn(q.kind),children:q===void 0?e(ge,{}):Jn(q.kind)}),e("td",{children:q===void 0?e(ge,{}):Sr(q.processor)}),N&&e("td",{children:q?.name!==void 0&&e("code",{children:l(q.name)})}),A&&e("td",{children:q?.file!==void 0&&e("code",{className:"worker-target-file",children:l(q.file)})}),e("td",{children:e(tt,{ids:_})})]},_[0]))})]})]})}function We({workerKey:g,instances:w}){let N=Ao(w);return e(R,{title:"Target",children:e("div",{"data-testid":"worker-target",children:N.length===0?e("p",{className:"muted",children:"Where this key's attempts run is known once an instance reports."}):t(n,{children:[e("p",{className:"muted worker-target-note",children:Ro}),N.length===1?e(et,{target:N[0].target}):e(rt,{workerKey:g,groups:N})]})})})}var ot=10;function nt(g){return g!==void 0&&Object.values(g.values).some((w)=>w!==void 0)?g:null}function dt(){let{queue:g="",key:w=""}=de(),N=s(),A=y("workers.list"),q=Fe()("queues.list"),_=Fn();pn(g,y("queues.read")&&A);let K=i({queryKey:_e.ofKey(g,w),queryFn:({signal:L})=>hn(N,{queue:[g],key:[w],includeOffline:!0},L),refetchInterval:_,enabled:A});if(!A)return t("div",{className:"screen",children:[e("h1",{className:"screen-title",children:w}),e(d,{title:"Instances hidden",description:"You may not list workers on this queue, so its instances and configuration are not shown."}),e(ce,{queue:g,workerKey:w}),e(he,{queue:g,workerKey:w})]});let E=K.data?.items??[],P=K.data?.offline,D=P===void 0?void 0:nt(P.find((L)=>L.queue===g&&L.key===w)),C=E.find((L)=>L.service!==void 0)?.service,T=E.some((L)=>L.host!==void 0||L.pid!==void 0);return t("div",{className:"screen","data-testid":"worker-screen",children:[t("div",{className:"worker-header",children:[t("h1",{className:"screen-title",children:[e("span",{className:"visually-hidden",children:"Worker "}),w]}),e(F,{className:"worker-header-facts",items:[{label:"Queue",value:q?e(b,{to:Ve(g),children:g}):g},{label:"Service",value:E.length===0?null:C??e("span",{className:"muted",children:"None named"}),hint:E.length===0?"Known once an instance reports.":void 0}]})]}),K.isPending?e(f,{label:"Loading this worker",showLabel:!0}):K.isError?e(x,{error:K.error,title:"Could not load this worker",onRetry:()=>void K.refetch()}):t(n,{children:[e(R,{title:"Instances",actions:e("span",{className:"muted",children:h(E.length,"live instance")}),children:e("div",{"data-testid":"worker-instances",children:E.length===0?e(d,{title:"No live instance",description:"No worker carrying this key is reporting now. One appears here when a process starts it; a stopped worker that lapsed is not listed."}):e(At,{workers:E,label:`Instances of ${w}`,showQueue:!1,showHost:T,showMemory:!0,pageSize:ot})})}),e(We,{workerKey:w,instances:E}),e(Ce,{workerKey:w,instances:E}),e(be,{queue:g,workerKey:w,instances:E,stored:D})]}),e(ce,{queue:g,workerKey:w}),e(he,{queue:g,workerKey:w})]})}var ke=["queue","service","host","state"];function lt(g){return Tn.includes(g)}function Te(g){let w=g.get("state")?.trim()??"";return{queue:g.get("queue")?.trim()??"",service:g.get("service")?.trim()??"",host:g.get("host")?.trim()??"",state:lt(w)?w:""}}function Re(g){return ke.some((w)=>g[w]!=="")}function Ee(g,w){let N={};if(g.queue)N.queue=[g.queue];if(g.service)N.service=[g.service];if(g.host&&w)N.host=[g.host];if(g.state)N.state=[g.state];return N}var ct=25;function mt(g){if(g.host===null&&g.pid===null)return"Hosts hidden by the API";return`${g.host??"unknown host"} · pid ${g.pid??"?"}`}function ut({server:g,linkQueues:w,linkKeys:N}){let A=mt(g);return t("section",{className:"worker-server","data-testid":`worker-server-${g.key}`,children:[t("h3",{className:"worker-server-title",children:[A," ",e("span",{className:"muted",children:h(g.workers.length,"worker")})]}),e(At,{workers:g.workers,label:`Workers on ${A}`,linkQueues:w,linkKeys:N,showMemory:!0,pageSize:ct})]})}function pt({group:g,linkQueues:w,linkKeys:N}){return e(R,{title:g.service??"No service named",actions:e("span",{className:"muted",children:h(g.count,"worker")}),children:t("div",{"data-testid":`worker-service-${g.service??"none"}`,children:[g.service===null&&t("p",{className:"muted worker-service-note",children:["These processes set no ",e("code",{children:"service"})," on their BunJobs context, so they are grouped by host and pid alone."]}),g.servers.map((A)=>e(ut,{server:A,linkQueues:w,linkKeys:N},A.key))]})})}var ft={running:"Running",paused:"Paused",stopping:"Stopping",stopped:"Stopped",restarting:"Restarting"};function re({label:g,any:w,value:N,choices:A,onChange:q,labelOf:_}){let K=N!==""&&!A.includes(N)?[N,...A]:A;return e(u,{label:g,children:e(S,{options:[{value:"",label:w},...K.map((E)=>({value:E,label:_?_(E):E}))],value:N,onChange:q})})}function ht(){let g=s(),w=y("workers.list"),N=y("queues.list"),A=Oe(),[q,_]=W(),K=c(),E=q.get("search")??"",P=Me(E),D=Te(q),C=Fn();No(w);let T=i({queryKey:_e.list(),queryFn:({signal:J})=>hn(g,{},J),refetchInterval:C,enabled:w}),L=T.isSuccess?To(T.data.items)??!1:T.isError,Q=T.isSuccess||T.isError,B=Ee(D,L),V=i({queryKey:_e.list(B),queryFn:({signal:J})=>hn(g,B,J),refetchInterval:C,enabled:w&&(D.host===""||Q)});if(!w)return t("div",{className:"screen",children:[e("h1",{className:"screen-title",children:"Workers"}),e(d,{title:"Nothing to show",description:"You may not list workers on this API."})]});let U=T.data?.items??[],ve=Re(D),X=V.data?.items??[],oe=X.filter((J)=>So(J,P)),ae=Do(oe),je=ae.reduce((J,le)=>J+le.servers.length,0),ie=T.data?U.length:X.length,te=(J)=>(le)=>_({[J]:le}),we=()=>_(Object.fromEntries(ke.map((J)=>[J,null])));return t("div",{className:"screen","data-testid":"workers-list",children:[e("h1",{className:"screen-title",children:"Workers"}),t("div",{className:"worker-filters",role:"search","aria-label":"Filter workers","data-testid":"worker-filters",children:[t("div",{className:"search",children:[e("label",{htmlFor:K,className:"visually-hidden",children:"Filter workers by id, queue or host"}),e("input",{id:K,type:"search",className:"input",placeholder:"Filter workers",...De,value:E,maxLength:200,onChange:(J)=>_({search:J.target.value})})]}),e(re,{label:"Queue",any:"Any queue",value:D.queue,choices:Hn(U,"queue"),onChange:te("queue")}),e(re,{label:"Service",any:"Any service",value:D.service,choices:Hn(U,"service"),onChange:te("service")}),L&&e(re,{label:"Host",any:"Any host",value:D.host,choices:Hn(U,"host"),onChange:te("host")}),e(re,{label:"State",any:"Any state",value:D.state,choices:Tn,onChange:te("state"),labelOf:(J)=>ft[J]}),ve&&e(a,{size:"sm",onClick:we,children:"Clear filters"})]}),D.host!==""&&Q&&!L&&t("p",{className:"notice",role:"note","data-testid":"workers-host-ignored",children:["This API hides worker hosts, so the host filter in this link (",e("code",{children:D.host}),") is ignored."]}),V.isPending?e(f,{label:"Loading workers",showLabel:!0}):V.isError?e(x,{error:V.error,title:"Could not load workers",onRetry:()=>void V.refetch()}):X.length===0&&(!ve||ie===0)?e(d,{title:"No live workers",description:"Workers appear here once a process runs one and it reports."}):X.length===0?e(d,{title:"No workers match these filters",description:"No live worker has every value chosen above.",action:e(a,{size:"sm",onClick:we,children:"Clear filters"})}):ae.length===0?e(d,{title:"No workers match",description:`No worker id, queue or host contains “${P.trim()}”.`}):t(n,{children:[t("p",{className:"muted","data-testid":"workers-count",children:[h(oe.length,"worker")," on ",h(je,"server"),oe.length<ie&&` (of ${ie})`]}),ae.map((J)=>e(pt,{group:J,linkQueues:N,linkKeys:A},J.service??""))]})]})}export{dt as WorkerScreen,ht as WorkersListScreen};
2
-
3
- //# debugId=75DB8E84E0A41F2264756E2164756E21
4
- //# sourceMappingURL=index-xfq292gs.js.map