bullpane 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +35 -0
- package/LICENSE-ee +46 -0
- package/README.md +60 -0
- package/bin/bullpane.mjs +99 -0
- package/dist/lua/getGroups.lua +65 -0
- package/dist/lua/getJob.lua +61 -0
- package/dist/lua/getJobs.lua +156 -0
- package/dist/lua/getSchedulers.lua +76 -0
- package/dist/lua/getTreeNode.lua +105 -0
- package/dist/lua/queueSetup.lua +47 -0
- package/dist/lua/queueStats.lua +140 -0
- package/dist/lua/sampleParents.lua +65 -0
- package/dist/lua/searchJobs.lua +146 -0
- package/dist/lua/windowMetrics.lua +167 -0
- package/dist/server.mjs +8703 -0
- package/migrations/mysql/0001_init.sql +102 -0
- package/migrations/mysql/0002_alert_scopes.sql +9 -0
- package/migrations/mysql/0003_hidden_queues.sql +21 -0
- package/migrations/mysql/0004_audit_log.sql +57 -0
- package/migrations/mysql/0005_sso.sql +48 -0
- package/migrations/mysql/0006_connection_position.sql +29 -0
- package/migrations/mysql/0007_user_disabled.sql +12 -0
- package/migrations/mysql/0008_alert_wide_scopes.sql +18 -0
- package/migrations/mysql/0009_mcp.sql +62 -0
- package/migrations/sqlite/0001_init.sql +158 -0
- package/migrations/sqlite/0002_mcp.sql +38 -0
- package/package.json +56 -0
- package/web/assets/FlowsPage-CxMz_9Et.js +6 -0
- package/web/assets/JobTreePage-BT79W1zX.js +6 -0
- package/web/assets/McpConsentPage-B2YnL6fN.js +1 -0
- package/web/assets/flowLayout-BnuhLJ6X.css +1 -0
- package/web/assets/flowLayout-DoC2dCG0.js +23 -0
- package/web/assets/index-C2gL_lbF.css +1 -0
- package/web/assets/index-DuAopWKm.js +543 -0
- package/web/index.html +18 -0
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FlowsPage-CxMz_9Et.js","assets/flowLayout-DoC2dCG0.js","assets/flowLayout-BnuhLJ6X.css","assets/JobTreePage-BT79W1zX.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Kj=Object.defineProperty;var sg=e=>{throw TypeError(e)};var Wj=(e,n,r)=>n in e?Kj(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var Sh=(e,n,r)=>Wj(e,typeof n!="symbol"?n+"":n,r),Ch=(e,n,r)=>n.has(e)||sg("Cannot "+r);var _=(e,n,r)=>(Ch(e,n,"read from private field"),r?r.call(e):n.get(e)),pe=(e,n,r)=>n.has(e)?sg("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,r),te=(e,n,r,i)=>(Ch(e,n,"write to private field"),i?i.call(e,r):n.set(e,r),r),Ce=(e,n,r)=>(Ch(e,n,"access private method"),r);var Bc=(e,n,r,i)=>({set _(o){te(e,n,o,r)},get _(){return _(e,n,i)}});function Zj(e,n){for(var r=0;r<n.length;r++){const i=n[r];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(i,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function r(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(o){if(o.ep)return;o.ep=!0;const c=r(o);fetch(o.href,c)}})();function Gj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _h={exports:{}},Hl={},Ph={exports:{}},De={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var rg;function Jj(){if(rg)return De;rg=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.iterator;function j(A){return A===null||typeof A!="object"?null:(A=v&&A[v]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,b={};function k(A,H,Ie){this.props=A,this.context=H,this.refs=b,this.updater=Ie||C}k.prototype.isReactComponent={},k.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,H,"setState")},k.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function S(){}S.prototype=k.prototype;function O(A,H,Ie){this.props=A,this.context=H,this.refs=b,this.updater=Ie||C}var q=O.prototype=new S;q.constructor=O,y(q,k.prototype),q.isPureReactComponent=!0;var E=Array.isArray,T=Object.prototype.hasOwnProperty,M={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function z(A,H,Ie){var Ae,Ne={},Le=null,st=null;if(H!=null)for(Ae in H.ref!==void 0&&(st=H.ref),H.key!==void 0&&(Le=""+H.key),H)T.call(H,Ae)&&!$.hasOwnProperty(Ae)&&(Ne[Ae]=H[Ae]);var Je=arguments.length-2;if(Je===1)Ne.children=Ie;else if(1<Je){for(var at=Array(Je),Qt=0;Qt<Je;Qt++)at[Qt]=arguments[Qt+2];Ne.children=at}if(A&&A.defaultProps)for(Ae in Je=A.defaultProps,Je)Ne[Ae]===void 0&&(Ne[Ae]=Je[Ae]);return{$$typeof:e,type:A,key:Le,ref:st,props:Ne,_owner:M.current}}function B(A,H){return{$$typeof:e,type:A.type,key:H,ref:A.ref,props:A.props,_owner:A._owner}}function U(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function J(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(Ie){return H[Ie]})}var we=/\/+/g;function Te(A,H){return typeof A=="object"&&A!==null&&A.key!=null?J(""+A.key):H.toString(36)}function Ze(A,H,Ie,Ae,Ne){var Le=typeof A;(Le==="undefined"||Le==="boolean")&&(A=null);var st=!1;if(A===null)st=!0;else switch(Le){case"string":case"number":st=!0;break;case"object":switch(A.$$typeof){case e:case n:st=!0}}if(st)return st=A,Ne=Ne(st),A=Ae===""?"."+Te(st,0):Ae,E(Ne)?(Ie="",A!=null&&(Ie=A.replace(we,"$&/")+"/"),Ze(Ne,H,Ie,"",function(Qt){return Qt})):Ne!=null&&(U(Ne)&&(Ne=B(Ne,Ie+(!Ne.key||st&&st.key===Ne.key?"":(""+Ne.key).replace(we,"$&/")+"/")+A)),H.push(Ne)),1;if(st=0,Ae=Ae===""?".":Ae+":",E(A))for(var Je=0;Je<A.length;Je++){Le=A[Je];var at=Ae+Te(Le,Je);st+=Ze(Le,H,Ie,at,Ne)}else if(at=j(A),typeof at=="function")for(A=at.call(A),Je=0;!(Le=A.next()).done;)Le=Le.value,at=Ae+Te(Le,Je++),st+=Ze(Le,H,Ie,at,Ne);else if(Le==="object")throw H=String(A),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return st}function Ge(A,H,Ie){if(A==null)return A;var Ae=[],Ne=0;return Ze(A,Ae,"","",function(Le){return H.call(Ie,Le,Ne++)}),Ae}function rt(A){if(A._status===-1){var H=A._result;H=H(),H.then(function(Ie){(A._status===0||A._status===-1)&&(A._status=1,A._result=Ie)},function(Ie){(A._status===0||A._status===-1)&&(A._status=2,A._result=Ie)}),A._status===-1&&(A._status=0,A._result=H)}if(A._status===1)return A._result.default;throw A._result}var Qe={current:null},K={transition:null},ue={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:K,ReactCurrentOwner:M};function se(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:Ge,forEach:function(A,H,Ie){Ge(A,function(){H.apply(this,arguments)},Ie)},count:function(A){var H=0;return Ge(A,function(){H++}),H},toArray:function(A){return Ge(A,function(H){return H})||[]},only:function(A){if(!U(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},De.Component=k,De.Fragment=r,De.Profiler=o,De.PureComponent=O,De.StrictMode=i,De.Suspense=m,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ue,De.act=se,De.cloneElement=function(A,H,Ie){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var Ae=y({},A.props),Ne=A.key,Le=A.ref,st=A._owner;if(H!=null){if(H.ref!==void 0&&(Le=H.ref,st=M.current),H.key!==void 0&&(Ne=""+H.key),A.type&&A.type.defaultProps)var Je=A.type.defaultProps;for(at in H)T.call(H,at)&&!$.hasOwnProperty(at)&&(Ae[at]=H[at]===void 0&&Je!==void 0?Je[at]:H[at])}var at=arguments.length-2;if(at===1)Ae.children=Ie;else if(1<at){Je=Array(at);for(var Qt=0;Qt<at;Qt++)Je[Qt]=arguments[Qt+2];Ae.children=Je}return{$$typeof:e,type:A.type,key:Ne,ref:Le,props:Ae,_owner:st}},De.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:c,_context:A},A.Consumer=A},De.createElement=z,De.createFactory=function(A){var H=z.bind(null,A);return H.type=A,H},De.createRef=function(){return{current:null}},De.forwardRef=function(A){return{$$typeof:h,render:A}},De.isValidElement=U,De.lazy=function(A){return{$$typeof:p,_payload:{_status:-1,_result:A},_init:rt}},De.memo=function(A,H){return{$$typeof:g,type:A,compare:H===void 0?null:H}},De.startTransition=function(A){var H=K.transition;K.transition={};try{A()}finally{K.transition=H}},De.unstable_act=se,De.useCallback=function(A,H){return Qe.current.useCallback(A,H)},De.useContext=function(A){return Qe.current.useContext(A)},De.useDebugValue=function(){},De.useDeferredValue=function(A){return Qe.current.useDeferredValue(A)},De.useEffect=function(A,H){return Qe.current.useEffect(A,H)},De.useId=function(){return Qe.current.useId()},De.useImperativeHandle=function(A,H,Ie){return Qe.current.useImperativeHandle(A,H,Ie)},De.useInsertionEffect=function(A,H){return Qe.current.useInsertionEffect(A,H)},De.useLayoutEffect=function(A,H){return Qe.current.useLayoutEffect(A,H)},De.useMemo=function(A,H){return Qe.current.useMemo(A,H)},De.useReducer=function(A,H,Ie){return Qe.current.useReducer(A,H,Ie)},De.useRef=function(A){return Qe.current.useRef(A)},De.useState=function(A){return Qe.current.useState(A)},De.useSyncExternalStore=function(A,H,Ie){return Qe.current.useSyncExternalStore(A,H,Ie)},De.useTransition=function(){return Qe.current.useTransition()},De.version="18.3.1",De}var ag;function Tf(){return ag||(ag=1,Ph.exports=Jj()),Ph.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var ig;function Xj(){if(ig)return Hl;ig=1;var e=Tf(),n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(h,m,g){var p,v={},j=null,C=null;g!==void 0&&(j=""+g),m.key!==void 0&&(j=""+m.key),m.ref!==void 0&&(C=m.ref);for(p in m)i.call(m,p)&&!c.hasOwnProperty(p)&&(v[p]=m[p]);if(h&&h.defaultProps)for(p in m=h.defaultProps,m)v[p]===void 0&&(v[p]=m[p]);return{$$typeof:n,type:h,key:j,ref:C,props:v,_owner:o.current}}return Hl.Fragment=r,Hl.jsx=d,Hl.jsxs=d,Hl}var lg;function Yj(){return lg||(lg=1,_h.exports=Xj()),_h.exports}var t=Yj(),N=Tf();const eb=Gj(N),tb=Zj({__proto__:null,default:eb},[N]);var Vc={},Eh={exports:{}},wn={},Rh={exports:{}},Mh={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var og;function nb(){return og||(og=1,(function(e){function n(K,ue){var se=K.length;K.push(ue);e:for(;0<se;){var A=se-1>>>1,H=K[A];if(0<o(H,ue))K[A]=ue,K[se]=H,se=A;else break e}}function r(K){return K.length===0?null:K[0]}function i(K){if(K.length===0)return null;var ue=K[0],se=K.pop();if(se!==ue){K[0]=se;e:for(var A=0,H=K.length,Ie=H>>>1;A<Ie;){var Ae=2*(A+1)-1,Ne=K[Ae],Le=Ae+1,st=K[Le];if(0>o(Ne,se))Le<H&&0>o(st,Ne)?(K[A]=st,K[Le]=se,A=Le):(K[A]=Ne,K[Ae]=se,A=Ae);else if(Le<H&&0>o(st,se))K[A]=st,K[Le]=se,A=Le;else break e}}return ue}function o(K,ue){var se=K.sortIndex-ue.sortIndex;return se!==0?se:K.id-ue.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var m=[],g=[],p=1,v=null,j=3,C=!1,y=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function q(K){for(var ue=r(g);ue!==null;){if(ue.callback===null)i(g);else if(ue.startTime<=K)i(g),ue.sortIndex=ue.expirationTime,n(m,ue);else break;ue=r(g)}}function E(K){if(b=!1,q(K),!y)if(r(m)!==null)y=!0,rt(T);else{var ue=r(g);ue!==null&&Qe(E,ue.startTime-K)}}function T(K,ue){y=!1,b&&(b=!1,S(z),z=-1),C=!0;var se=j;try{for(q(ue),v=r(m);v!==null&&(!(v.expirationTime>ue)||K&&!J());){var A=v.callback;if(typeof A=="function"){v.callback=null,j=v.priorityLevel;var H=A(v.expirationTime<=ue);ue=e.unstable_now(),typeof H=="function"?v.callback=H:v===r(m)&&i(m),q(ue)}else i(m);v=r(m)}if(v!==null)var Ie=!0;else{var Ae=r(g);Ae!==null&&Qe(E,Ae.startTime-ue),Ie=!1}return Ie}finally{v=null,j=se,C=!1}}var M=!1,$=null,z=-1,B=5,U=-1;function J(){return!(e.unstable_now()-U<B)}function we(){if($!==null){var K=e.unstable_now();U=K;var ue=!0;try{ue=$(!0,K)}finally{ue?Te():(M=!1,$=null)}}else M=!1}var Te;if(typeof O=="function")Te=function(){O(we)};else if(typeof MessageChannel<"u"){var Ze=new MessageChannel,Ge=Ze.port2;Ze.port1.onmessage=we,Te=function(){Ge.postMessage(null)}}else Te=function(){k(we,0)};function rt(K){$=K,M||(M=!0,Te())}function Qe(K,ue){z=k(function(){K(e.unstable_now())},ue)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_continueExecution=function(){y||C||(y=!0,rt(T))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_getFirstCallbackNode=function(){return r(m)},e.unstable_next=function(K){switch(j){case 1:case 2:case 3:var ue=3;break;default:ue=j}var se=j;j=ue;try{return K()}finally{j=se}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,ue){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var se=j;j=K;try{return ue()}finally{j=se}},e.unstable_scheduleCallback=function(K,ue,se){var A=e.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?A+se:A):se=A,K){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=se+H,K={id:p++,callback:ue,priorityLevel:K,startTime:se,expirationTime:H,sortIndex:-1},se>A?(K.sortIndex=se,n(g,K),r(m)===null&&K===r(g)&&(b?(S(z),z=-1):b=!0,Qe(E,se-A))):(K.sortIndex=H,n(m,K),y||C||(y=!0,rt(T))),K},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(K){var ue=j;return function(){var se=j;j=ue;try{return K.apply(this,arguments)}finally{j=se}}}})(Mh)),Mh}var cg;function sb(){return cg||(cg=1,Rh.exports=nb()),Rh.exports}/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var ug;function rb(){if(ug)return wn;ug=1;var e=Tf(),n=sb();function r(s){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+s,l=1;l<arguments.length;l++)a+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,o={};function c(s,a){d(s,a),d(s+"Capture",a)}function d(s,a){for(o[s]=a,s=0;s<a.length;s++)i.add(a[s])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},v={};function j(s){return m.call(v,s)?!0:m.call(p,s)?!1:g.test(s)?v[s]=!0:(p[s]=!0,!1)}function C(s,a,l,u){if(l!==null&&l.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return u?!1:l!==null?!l.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function y(s,a,l,u){if(a===null||typeof a>"u"||C(s,a,l,u))return!0;if(u)return!1;if(l!==null)switch(l.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function b(s,a,l,u,f,x,w){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=u,this.attributeNamespace=f,this.mustUseProperty=l,this.propertyName=s,this.type=a,this.sanitizeURL=x,this.removeEmptyString=w}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){k[s]=new b(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];k[a]=new b(a,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){k[s]=new b(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){k[s]=new b(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){k[s]=new b(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){k[s]=new b(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){k[s]=new b(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){k[s]=new b(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){k[s]=new b(s,5,!1,s.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function O(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var a=s.replace(S,O);k[a]=new b(a,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(S,O);k[a]=new b(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(S,O);k[a]=new b(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){k[s]=new b(s,1,!1,s.toLowerCase(),null,!1,!1)}),k.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){k[s]=new b(s,1,!1,s.toLowerCase(),null,!0,!0)});function q(s,a,l,u){var f=k.hasOwnProperty(a)?k[a]:null;(f!==null?f.type!==0:u||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(y(a,l,f,u)&&(l=null),u||f===null?j(a)&&(l===null?s.removeAttribute(a):s.setAttribute(a,""+l)):f.mustUseProperty?s[f.propertyName]=l===null?f.type===3?!1:"":l:(a=f.attributeName,u=f.attributeNamespace,l===null?s.removeAttribute(a):(f=f.type,l=f===3||f===4&&l===!0?"":""+l,u?s.setAttributeNS(u,a,l):s.setAttribute(a,l))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),M=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),J=Symbol.for("react.context"),we=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),Ze=Symbol.for("react.suspense_list"),Ge=Symbol.for("react.memo"),rt=Symbol.for("react.lazy"),Qe=Symbol.for("react.offscreen"),K=Symbol.iterator;function ue(s){return s===null||typeof s!="object"?null:(s=K&&s[K]||s["@@iterator"],typeof s=="function"?s:null)}var se=Object.assign,A;function H(s){if(A===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);A=a&&a[1]||""}return`
|
|
35
|
+
`+A+s}var Ie=!1;function Ae(s,a){if(!s||Ie)return"";Ie=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(Q){var u=Q}Reflect.construct(s,[],a)}else{try{a.call()}catch(Q){u=Q}s.call(a.prototype)}else{try{throw Error()}catch(Q){u=Q}s()}}catch(Q){if(Q&&u&&typeof Q.stack=="string"){for(var f=Q.stack.split(`
|
|
36
|
+
`),x=u.stack.split(`
|
|
37
|
+
`),w=f.length-1,P=x.length-1;1<=w&&0<=P&&f[w]!==x[P];)P--;for(;1<=w&&0<=P;w--,P--)if(f[w]!==x[P]){if(w!==1||P!==1)do if(w--,P--,0>P||f[w]!==x[P]){var R=`
|
|
38
|
+
`+f[w].replace(" at new "," at ");return s.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",s.displayName)),R}while(1<=w&&0<=P);break}}}finally{Ie=!1,Error.prepareStackTrace=l}return(s=s?s.displayName||s.name:"")?H(s):""}function Ne(s){switch(s.tag){case 5:return H(s.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return s=Ae(s.type,!1),s;case 11:return s=Ae(s.type.render,!1),s;case 1:return s=Ae(s.type,!0),s;default:return""}}function Le(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case $:return"Fragment";case M:return"Portal";case B:return"Profiler";case z:return"StrictMode";case Te:return"Suspense";case Ze:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case J:return(s.displayName||"Context")+".Consumer";case U:return(s._context.displayName||"Context")+".Provider";case we:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case Ge:return a=s.displayName||null,a!==null?a:Le(s.type)||"Memo";case rt:a=s._payload,s=s._init;try{return Le(s(a))}catch{}}return null}function st(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Le(a);case 8:return a===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function Je(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function at(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Qt(s){var a=at(s)?"checked":"value",l=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),u=""+s[a];if(!s.hasOwnProperty(a)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,x=l.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return f.call(this)},set:function(w){u=""+w,x.call(this,w)}}),Object.defineProperty(s,a,{enumerable:l.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function er(s){s._valueTracker||(s._valueTracker=Qt(s))}function $a(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var l=a.getValue(),u="";return s&&(u=at(s)?s.checked?"true":"false":s.value),s=u,s!==l?(a.setValue(s),!0):!1}function Jn(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function zt(s,a){var l=a.checked;return se({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??s._wrapperState.initialChecked})}function Io(s,a){var l=a.defaultValue==null?"":a.defaultValue,u=a.checked!=null?a.checked:a.defaultChecked;l=Je(a.value!=null?a.value:l),s._wrapperState={initialChecked:u,initialValue:l,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function za(s,a){a=a.checked,a!=null&&q(s,"checked",a,!1)}function Cn(s,a){za(s,a);var l=Je(a.value),u=a.type;if(l!=null)u==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+l):s.value!==""+l&&(s.value=""+l);else if(u==="submit"||u==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?Aa(s,a.type,l):a.hasOwnProperty("defaultValue")&&Aa(s,a.type,Je(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function qo(s,a,l){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var u=a.type;if(!(u!=="submit"&&u!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,l||a===s.value||(s.value=a),s.defaultValue=a}l=s.name,l!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,l!==""&&(s.name=l)}function Aa(s,a,l){(a!=="number"||Jn(s.ownerDocument)!==s)&&(l==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+l&&(s.defaultValue=""+l))}var tr=Array.isArray;function xn(s,a,l,u){if(s=s.options,a){a={};for(var f=0;f<l.length;f++)a["$"+l[f]]=!0;for(l=0;l<s.length;l++)f=a.hasOwnProperty("$"+s[l].value),s[l].selected!==f&&(s[l].selected=f),f&&u&&(s[l].defaultSelected=!0)}else{for(l=""+Je(l),a=null,f=0;f<s.length;f++){if(s[f].value===l){s[f].selected=!0,u&&(s[f].defaultSelected=!0);return}a!==null||s[f].disabled||(a=s[f])}a!==null&&(a.selected=!0)}}function Vr(s,a){if(a.dangerouslySetInnerHTML!=null)throw Error(r(91));return se({},a,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function La(s,a){var l=a.value;if(l==null){if(l=a.children,a=a.defaultValue,l!=null){if(a!=null)throw Error(r(92));if(tr(l)){if(1<l.length)throw Error(r(93));l=l[0]}a=l}a==null&&(a=""),l=a}s._wrapperState={initialValue:Je(l)}}function an(s,a){var l=Je(a.value),u=Je(a.defaultValue);l!=null&&(l=""+l,l!==s.value&&(s.value=l),a.defaultValue==null&&s.defaultValue!==l&&(s.defaultValue=l)),u!=null&&(s.defaultValue=""+u)}function Oo(s){var a=s.textContent;a===s._wrapperState.initialValue&&a!==""&&a!==null&&(s.value=a)}function Fa(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Da(s,a){return s==null||s==="http://www.w3.org/1999/xhtml"?Fa(a):s==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var Hr,al=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,l,u,f){MSApp.execUnsafeLocalFunction(function(){return s(a,l,u,f)})}:s})(function(s,a){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=a;else{for(Hr=Hr||document.createElement("div"),Hr.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Hr.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function nr(s,a){if(a){var l=s.firstChild;if(l&&l===s.lastChild&&l.nodeType===3){l.nodeValue=a;return}}s.textContent=a}var Xn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Bu=["Webkit","ms","Moz","O"];Object.keys(Xn).forEach(function(s){Bu.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Xn[a]=Xn[s]})});function Kr(s,a,l){return a==null||typeof a=="boolean"||a===""?"":l||typeof a!="number"||a===0||Xn.hasOwnProperty(s)&&Xn[s]?(""+a).trim():a+"px"}function il(s,a){s=s.style;for(var l in a)if(a.hasOwnProperty(l)){var u=l.indexOf("--")===0,f=Kr(l,a[l],u);l==="float"&&(l="cssFloat"),u?s.setProperty(l,f):s[l]=f}}var $o=se({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ua(s,a){if(a){if($o[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(r(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(r(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(r(61))}if(a.style!=null&&typeof a.style!="object")throw Error(r(62))}}function Qa(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ba=null;function Va(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ha=null,Rs=null,Ms=null;function ll(s){if(s=Ml(s)){if(typeof Ha!="function")throw Error(r(280));var a=s.stateNode;a&&(a=ac(a),Ha(s.stateNode,s.type,a))}}function ol(s){Rs?Ms?Ms.push(s):Ms=[s]:Rs=s}function cl(){if(Rs){var s=Rs,a=Ms;if(Ms=Rs=null,ll(s),a)for(s=0;s<a.length;s++)ll(a[s])}}function ul(s,a){return s(a)}function dl(){}var Ka=!1;function hl(s,a,l){if(Ka)return s(a,l);Ka=!0;try{return ul(s,a,l)}finally{Ka=!1,(Rs!==null||Ms!==null)&&(dl(),cl())}}function sr(s,a){var l=s.stateNode;if(l===null)return null;var u=ac(l);if(u===null)return null;l=u[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(s=s.type,u=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!u;break e;default:s=!1}if(s)return null;if(l&&typeof l!="function")throw Error(r(231,a,typeof l));return l}var Wa=!1;if(h)try{var rr={};Object.defineProperty(rr,"passive",{get:function(){Wa=!0}}),window.addEventListener("test",rr,rr),window.removeEventListener("test",rr,rr)}catch{Wa=!1}function zo(s,a,l,u,f,x,w,P,R){var Q=Array.prototype.slice.call(arguments,3);try{a.apply(l,Q)}catch(G){this.onError(G)}}var ar=!1,Wr=null,Zr=!1,Za=null,Ao={onError:function(s){ar=!0,Wr=s}};function le(s,a,l,u,f,x,w,P,R){ar=!1,Wr=null,zo.apply(Ao,arguments)}function it(s,a,l,u,f,x,w,P,R){if(le.apply(this,arguments),ar){if(ar){var Q=Wr;ar=!1,Wr=null}else throw Error(r(198));Zr||(Zr=!0,Za=Q)}}function Ue(s){var a=s,l=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,(a.flags&4098)!==0&&(l=a.return),s=a.return;while(s)}return a.tag===3?l:null}function Bt(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function Ga(s){if(Ue(s)!==s)throw Error(r(188))}function s1(s){var a=s.alternate;if(!a){if(a=Ue(s),a===null)throw Error(r(188));return a!==s?null:s}for(var l=s,u=a;;){var f=l.return;if(f===null)break;var x=f.alternate;if(x===null){if(u=f.return,u!==null){l=u;continue}break}if(f.child===x.child){for(x=f.child;x;){if(x===l)return Ga(f),s;if(x===u)return Ga(f),a;x=x.sibling}throw Error(r(188))}if(l.return!==u.return)l=f,u=x;else{for(var w=!1,P=f.child;P;){if(P===l){w=!0,l=f,u=x;break}if(P===u){w=!0,u=f,l=x;break}P=P.sibling}if(!w){for(P=x.child;P;){if(P===l){w=!0,l=x,u=f;break}if(P===u){w=!0,u=x,l=f;break}P=P.sibling}if(!w)throw Error(r(189))}}if(l.alternate!==u)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?s:a}function Pm(s){return s=s1(s),s!==null?Em(s):null}function Em(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var a=Em(s);if(a!==null)return a;s=s.sibling}return null}var Rm=n.unstable_scheduleCallback,Mm=n.unstable_cancelCallback,r1=n.unstable_shouldYield,a1=n.unstable_requestPaint,Pt=n.unstable_now,i1=n.unstable_getCurrentPriorityLevel,Vu=n.unstable_ImmediatePriority,Tm=n.unstable_UserBlockingPriority,Lo=n.unstable_NormalPriority,l1=n.unstable_LowPriority,Im=n.unstable_IdlePriority,Fo=null,fs=null;function o1(s){if(fs&&typeof fs.onCommitFiberRoot=="function")try{fs.onCommitFiberRoot(Fo,s,void 0,(s.current.flags&128)===128)}catch{}}var Yn=Math.clz32?Math.clz32:d1,c1=Math.log,u1=Math.LN2;function d1(s){return s>>>=0,s===0?32:31-(c1(s)/u1|0)|0}var Do=64,Uo=4194304;function fl(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Qo(s,a){var l=s.pendingLanes;if(l===0)return 0;var u=0,f=s.suspendedLanes,x=s.pingedLanes,w=l&268435455;if(w!==0){var P=w&~f;P!==0?u=fl(P):(x&=w,x!==0&&(u=fl(x)))}else w=l&~f,w!==0?u=fl(w):x!==0&&(u=fl(x));if(u===0)return 0;if(a!==0&&a!==u&&(a&f)===0&&(f=u&-u,x=a&-a,f>=x||f===16&&(x&4194240)!==0))return a;if((u&4)!==0&&(u|=l&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=u;0<a;)l=31-Yn(a),f=1<<l,u|=s[l],a&=~f;return u}function h1(s,a){switch(s){case 1:case 2:case 4:return a+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function f1(s,a){for(var l=s.suspendedLanes,u=s.pingedLanes,f=s.expirationTimes,x=s.pendingLanes;0<x;){var w=31-Yn(x),P=1<<w,R=f[w];R===-1?((P&l)===0||(P&u)!==0)&&(f[w]=h1(P,a)):R<=a&&(s.expiredLanes|=P),x&=~P}}function Hu(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function qm(){var s=Do;return Do<<=1,(Do&4194240)===0&&(Do=64),s}function Ku(s){for(var a=[],l=0;31>l;l++)a.push(s);return a}function ml(s,a,l){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Yn(a),s[a]=l}function m1(s,a){var l=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var u=s.eventTimes;for(s=s.expirationTimes;0<l;){var f=31-Yn(l),x=1<<f;a[f]=0,u[f]=-1,s[f]=-1,l&=~x}}function Wu(s,a){var l=s.entangledLanes|=a;for(s=s.entanglements;l;){var u=31-Yn(l),f=1<<u;f&a|s[u]&a&&(s[u]|=a),l&=~f}}var lt=0;function Om(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var $m,Zu,zm,Am,Lm,Gu=!1,Bo=[],ir=null,lr=null,or=null,pl=new Map,xl=new Map,cr=[],p1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fm(s,a){switch(s){case"focusin":case"focusout":ir=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":pl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":xl.delete(a.pointerId)}}function gl(s,a,l,u,f,x){return s===null||s.nativeEvent!==x?(s={blockedOn:a,domEventName:l,eventSystemFlags:u,nativeEvent:x,targetContainers:[f]},a!==null&&(a=Ml(a),a!==null&&Zu(a)),s):(s.eventSystemFlags|=u,a=s.targetContainers,f!==null&&a.indexOf(f)===-1&&a.push(f),s)}function x1(s,a,l,u,f){switch(a){case"focusin":return ir=gl(ir,s,a,l,u,f),!0;case"dragenter":return lr=gl(lr,s,a,l,u,f),!0;case"mouseover":return or=gl(or,s,a,l,u,f),!0;case"pointerover":var x=f.pointerId;return pl.set(x,gl(pl.get(x)||null,s,a,l,u,f)),!0;case"gotpointercapture":return x=f.pointerId,xl.set(x,gl(xl.get(x)||null,s,a,l,u,f)),!0}return!1}function Dm(s){var a=Gr(s.target);if(a!==null){var l=Ue(a);if(l!==null){if(a=l.tag,a===13){if(a=Bt(l),a!==null){s.blockedOn=a,Lm(s.priority,function(){zm(l)});return}}else if(a===3&&l.stateNode.current.memoizedState.isDehydrated){s.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Vo(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var l=Xu(s.domEventName,s.eventSystemFlags,a[0],s.nativeEvent);if(l===null){l=s.nativeEvent;var u=new l.constructor(l.type,l);Ba=u,l.target.dispatchEvent(u),Ba=null}else return a=Ml(l),a!==null&&Zu(a),s.blockedOn=l,!1;a.shift()}return!0}function Um(s,a,l){Vo(s)&&l.delete(a)}function g1(){Gu=!1,ir!==null&&Vo(ir)&&(ir=null),lr!==null&&Vo(lr)&&(lr=null),or!==null&&Vo(or)&&(or=null),pl.forEach(Um),xl.forEach(Um)}function vl(s,a){s.blockedOn===a&&(s.blockedOn=null,Gu||(Gu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,g1)))}function yl(s){function a(f){return vl(f,s)}if(0<Bo.length){vl(Bo[0],s);for(var l=1;l<Bo.length;l++){var u=Bo[l];u.blockedOn===s&&(u.blockedOn=null)}}for(ir!==null&&vl(ir,s),lr!==null&&vl(lr,s),or!==null&&vl(or,s),pl.forEach(a),xl.forEach(a),l=0;l<cr.length;l++)u=cr[l],u.blockedOn===s&&(u.blockedOn=null);for(;0<cr.length&&(l=cr[0],l.blockedOn===null);)Dm(l),l.blockedOn===null&&cr.shift()}var Ja=E.ReactCurrentBatchConfig,Ho=!0;function v1(s,a,l,u){var f=lt,x=Ja.transition;Ja.transition=null;try{lt=1,Ju(s,a,l,u)}finally{lt=f,Ja.transition=x}}function y1(s,a,l,u){var f=lt,x=Ja.transition;Ja.transition=null;try{lt=4,Ju(s,a,l,u)}finally{lt=f,Ja.transition=x}}function Ju(s,a,l,u){if(Ho){var f=Xu(s,a,l,u);if(f===null)pd(s,a,u,Ko,l),Fm(s,u);else if(x1(f,s,a,l,u))u.stopPropagation();else if(Fm(s,u),a&4&&-1<p1.indexOf(s)){for(;f!==null;){var x=Ml(f);if(x!==null&&$m(x),x=Xu(s,a,l,u),x===null&&pd(s,a,u,Ko,l),x===f)break;f=x}f!==null&&u.stopPropagation()}else pd(s,a,u,null,l)}}var Ko=null;function Xu(s,a,l,u){if(Ko=null,s=Va(u),s=Gr(s),s!==null)if(a=Ue(s),a===null)s=null;else if(l=a.tag,l===13){if(s=Bt(a),s!==null)return s;s=null}else if(l===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null);return Ko=s,null}function Qm(s){switch(s){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(i1()){case Vu:return 1;case Tm:return 4;case Lo:case l1:return 16;case Im:return 536870912;default:return 16}default:return 16}}var ur=null,Yu=null,Wo=null;function Bm(){if(Wo)return Wo;var s,a=Yu,l=a.length,u,f="value"in ur?ur.value:ur.textContent,x=f.length;for(s=0;s<l&&a[s]===f[s];s++);var w=l-s;for(u=1;u<=w&&a[l-u]===f[x-u];u++);return Wo=f.slice(s,1<u?1-u:void 0)}function Zo(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function Go(){return!0}function Vm(){return!1}function _n(s){function a(l,u,f,x,w){this._reactName=l,this._targetInst=f,this.type=u,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var P in s)s.hasOwnProperty(P)&&(l=s[P],this[P]=l?l(x):x[P]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Go:Vm,this.isPropagationStopped=Vm,this}return se(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Go)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Go)},persist:function(){},isPersistent:Go}),a}var Xa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ed=_n(Xa),jl=se({},Xa,{view:0,detail:0}),j1=_n(jl),td,nd,bl,Jo=se({},jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rd,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==bl&&(bl&&s.type==="mousemove"?(td=s.screenX-bl.screenX,nd=s.screenY-bl.screenY):nd=td=0,bl=s),td)},movementY:function(s){return"movementY"in s?s.movementY:nd}}),Hm=_n(Jo),b1=se({},Jo,{dataTransfer:0}),w1=_n(b1),N1=se({},jl,{relatedTarget:0}),sd=_n(N1),k1=se({},Xa,{animationName:0,elapsedTime:0,pseudoElement:0}),S1=_n(k1),C1=se({},Xa,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),_1=_n(C1),P1=se({},Xa,{data:0}),Km=_n(P1),E1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},R1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},M1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function T1(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=M1[s])?!!a[s]:!1}function rd(){return T1}var I1=se({},jl,{key:function(s){if(s.key){var a=E1[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=Zo(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?R1[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rd,charCode:function(s){return s.type==="keypress"?Zo(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Zo(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),q1=_n(I1),O1=se({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wm=_n(O1),$1=se({},jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rd}),z1=_n($1),A1=se({},Xa,{propertyName:0,elapsedTime:0,pseudoElement:0}),L1=_n(A1),F1=se({},Jo,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),D1=_n(F1),U1=[9,13,27,32],ad=h&&"CompositionEvent"in window,wl=null;h&&"documentMode"in document&&(wl=document.documentMode);var Q1=h&&"TextEvent"in window&&!wl,Zm=h&&(!ad||wl&&8<wl&&11>=wl),Gm=" ",Jm=!1;function Xm(s,a){switch(s){case"keyup":return U1.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ym(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Ya=!1;function B1(s,a){switch(s){case"compositionend":return Ym(a);case"keypress":return a.which!==32?null:(Jm=!0,Gm);case"textInput":return s=a.data,s===Gm&&Jm?null:s;default:return null}}function V1(s,a){if(Ya)return s==="compositionend"||!ad&&Xm(s,a)?(s=Bm(),Wo=Yu=ur=null,Ya=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Zm&&a.locale!=="ko"?null:a.data;default:return null}}var H1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ep(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!H1[s.type]:a==="textarea"}function tp(s,a,l,u){ol(u),a=nc(a,"onChange"),0<a.length&&(l=new ed("onChange","change",null,l,u),s.push({event:l,listeners:a}))}var Nl=null,kl=null;function K1(s){yp(s,0)}function Xo(s){var a=ri(s);if($a(a))return s}function W1(s,a){if(s==="change")return a}var np=!1;if(h){var id;if(h){var ld="oninput"in document;if(!ld){var sp=document.createElement("div");sp.setAttribute("oninput","return;"),ld=typeof sp.oninput=="function"}id=ld}else id=!1;np=id&&(!document.documentMode||9<document.documentMode)}function rp(){Nl&&(Nl.detachEvent("onpropertychange",ap),kl=Nl=null)}function ap(s){if(s.propertyName==="value"&&Xo(kl)){var a=[];tp(a,kl,s,Va(s)),hl(K1,a)}}function Z1(s,a,l){s==="focusin"?(rp(),Nl=a,kl=l,Nl.attachEvent("onpropertychange",ap)):s==="focusout"&&rp()}function G1(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Xo(kl)}function J1(s,a){if(s==="click")return Xo(a)}function X1(s,a){if(s==="input"||s==="change")return Xo(a)}function Y1(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var es=typeof Object.is=="function"?Object.is:Y1;function Sl(s,a){if(es(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var l=Object.keys(s),u=Object.keys(a);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var f=l[u];if(!m.call(a,f)||!es(s[f],a[f]))return!1}return!0}function ip(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function lp(s,a){var l=ip(s);s=0;for(var u;l;){if(l.nodeType===3){if(u=s+l.textContent.length,s<=a&&u>=a)return{node:l,offset:a-s};s=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=ip(l)}}function op(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?op(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function cp(){for(var s=window,a=Jn();a instanceof s.HTMLIFrameElement;){try{var l=typeof a.contentWindow.location.href=="string"}catch{l=!1}if(l)s=a.contentWindow;else break;a=Jn(s.document)}return a}function od(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function ej(s){var a=cp(),l=s.focusedElem,u=s.selectionRange;if(a!==l&&l&&l.ownerDocument&&op(l.ownerDocument.documentElement,l)){if(u!==null&&od(l)){if(a=u.start,s=u.end,s===void 0&&(s=a),"selectionStart"in l)l.selectionStart=a,l.selectionEnd=Math.min(s,l.value.length);else if(s=(a=l.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var f=l.textContent.length,x=Math.min(u.start,f);u=u.end===void 0?x:Math.min(u.end,f),!s.extend&&x>u&&(f=u,u=x,x=f),f=lp(l,x);var w=lp(l,u);f&&w&&(s.rangeCount!==1||s.anchorNode!==f.node||s.anchorOffset!==f.offset||s.focusNode!==w.node||s.focusOffset!==w.offset)&&(a=a.createRange(),a.setStart(f.node,f.offset),s.removeAllRanges(),x>u?(s.addRange(a),s.extend(w.node,w.offset)):(a.setEnd(w.node,w.offset),s.addRange(a)))}}for(a=[],s=l;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<a.length;l++)s=a[l],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var tj=h&&"documentMode"in document&&11>=document.documentMode,ei=null,cd=null,Cl=null,ud=!1;function up(s,a,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ud||ei==null||ei!==Jn(u)||(u=ei,"selectionStart"in u&&od(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Cl&&Sl(Cl,u)||(Cl=u,u=nc(cd,"onSelect"),0<u.length&&(a=new ed("onSelect","select",null,a,l),s.push({event:a,listeners:u}),a.target=ei)))}function Yo(s,a){var l={};return l[s.toLowerCase()]=a.toLowerCase(),l["Webkit"+s]="webkit"+a,l["Moz"+s]="moz"+a,l}var ti={animationend:Yo("Animation","AnimationEnd"),animationiteration:Yo("Animation","AnimationIteration"),animationstart:Yo("Animation","AnimationStart"),transitionend:Yo("Transition","TransitionEnd")},dd={},dp={};h&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),"TransitionEvent"in window||delete ti.transitionend.transition);function ec(s){if(dd[s])return dd[s];if(!ti[s])return s;var a=ti[s],l;for(l in a)if(a.hasOwnProperty(l)&&l in dp)return dd[s]=a[l];return s}var hp=ec("animationend"),fp=ec("animationiteration"),mp=ec("animationstart"),pp=ec("transitionend"),xp=new Map,gp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function dr(s,a){xp.set(s,a),c(a,[s])}for(var hd=0;hd<gp.length;hd++){var fd=gp[hd],nj=fd.toLowerCase(),sj=fd[0].toUpperCase()+fd.slice(1);dr(nj,"on"+sj)}dr(hp,"onAnimationEnd"),dr(fp,"onAnimationIteration"),dr(mp,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(pp,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _l="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),rj=new Set("cancel close invalid load scroll toggle".split(" ").concat(_l));function vp(s,a,l){var u=s.type||"unknown-event";s.currentTarget=l,it(u,a,void 0,s),s.currentTarget=null}function yp(s,a){a=(a&4)!==0;for(var l=0;l<s.length;l++){var u=s[l],f=u.event;u=u.listeners;e:{var x=void 0;if(a)for(var w=u.length-1;0<=w;w--){var P=u[w],R=P.instance,Q=P.currentTarget;if(P=P.listener,R!==x&&f.isPropagationStopped())break e;vp(f,P,Q),x=R}else for(w=0;w<u.length;w++){if(P=u[w],R=P.instance,Q=P.currentTarget,P=P.listener,R!==x&&f.isPropagationStopped())break e;vp(f,P,Q),x=R}}}if(Zr)throw s=Za,Zr=!1,Za=null,s}function ht(s,a){var l=a[bd];l===void 0&&(l=a[bd]=new Set);var u=s+"__bubble";l.has(u)||(jp(a,s,2,!1),l.add(u))}function md(s,a,l){var u=0;a&&(u|=4),jp(l,s,u,a)}var tc="_reactListening"+Math.random().toString(36).slice(2);function Pl(s){if(!s[tc]){s[tc]=!0,i.forEach(function(l){l!=="selectionchange"&&(rj.has(l)||md(l,!1,s),md(l,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[tc]||(a[tc]=!0,md("selectionchange",!1,a))}}function jp(s,a,l,u){switch(Qm(a)){case 1:var f=v1;break;case 4:f=y1;break;default:f=Ju}l=f.bind(null,a,l,s),f=void 0,!Wa||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(f=!0),u?f!==void 0?s.addEventListener(a,l,{capture:!0,passive:f}):s.addEventListener(a,l,!0):f!==void 0?s.addEventListener(a,l,{passive:f}):s.addEventListener(a,l,!1)}function pd(s,a,l,u,f){var x=u;if((a&1)===0&&(a&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var P=u.stateNode.containerInfo;if(P===f||P.nodeType===8&&P.parentNode===f)break;if(w===4)for(w=u.return;w!==null;){var R=w.tag;if((R===3||R===4)&&(R=w.stateNode.containerInfo,R===f||R.nodeType===8&&R.parentNode===f))return;w=w.return}for(;P!==null;){if(w=Gr(P),w===null)return;if(R=w.tag,R===5||R===6){u=x=w;continue e}P=P.parentNode}}u=u.return}hl(function(){var Q=x,G=Va(l),X=[];e:{var Z=xp.get(s);if(Z!==void 0){var de=ed,ve=s;switch(s){case"keypress":if(Zo(l)===0)break e;case"keydown":case"keyup":de=q1;break;case"focusin":ve="focus",de=sd;break;case"focusout":ve="blur",de=sd;break;case"beforeblur":case"afterblur":de=sd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Hm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=w1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=z1;break;case hp:case fp:case mp:de=S1;break;case pp:de=L1;break;case"scroll":de=j1;break;case"wheel":de=D1;break;case"copy":case"cut":case"paste":de=_1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Wm}var je=(a&4)!==0,Et=!je&&s==="scroll",L=je?Z!==null?Z+"Capture":null:Z;je=[];for(var I=Q,D;I!==null;){D=I;var ne=D.stateNode;if(D.tag===5&&ne!==null&&(D=ne,L!==null&&(ne=sr(I,L),ne!=null&&je.push(El(I,ne,D)))),Et)break;I=I.return}0<je.length&&(Z=new de(Z,ve,null,l,G),X.push({event:Z,listeners:je}))}}if((a&7)===0){e:{if(Z=s==="mouseover"||s==="pointerover",de=s==="mouseout"||s==="pointerout",Z&&l!==Ba&&(ve=l.relatedTarget||l.fromElement)&&(Gr(ve)||ve[Ts]))break e;if((de||Z)&&(Z=G.window===G?G:(Z=G.ownerDocument)?Z.defaultView||Z.parentWindow:window,de?(ve=l.relatedTarget||l.toElement,de=Q,ve=ve?Gr(ve):null,ve!==null&&(Et=Ue(ve),ve!==Et||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(de=null,ve=Q),de!==ve)){if(je=Hm,ne="onMouseLeave",L="onMouseEnter",I="mouse",(s==="pointerout"||s==="pointerover")&&(je=Wm,ne="onPointerLeave",L="onPointerEnter",I="pointer"),Et=de==null?Z:ri(de),D=ve==null?Z:ri(ve),Z=new je(ne,I+"leave",de,l,G),Z.target=Et,Z.relatedTarget=D,ne=null,Gr(G)===Q&&(je=new je(L,I+"enter",ve,l,G),je.target=D,je.relatedTarget=Et,ne=je),Et=ne,de&&ve)t:{for(je=de,L=ve,I=0,D=je;D;D=ni(D))I++;for(D=0,ne=L;ne;ne=ni(ne))D++;for(;0<I-D;)je=ni(je),I--;for(;0<D-I;)L=ni(L),D--;for(;I--;){if(je===L||L!==null&&je===L.alternate)break t;je=ni(je),L=ni(L)}je=null}else je=null;de!==null&&bp(X,Z,de,je,!1),ve!==null&&Et!==null&&bp(X,Et,ve,je,!0)}}e:{if(Z=Q?ri(Q):window,de=Z.nodeName&&Z.nodeName.toLowerCase(),de==="select"||de==="input"&&Z.type==="file")var ke=W1;else if(ep(Z))if(np)ke=X1;else{ke=G1;var Pe=Z1}else(de=Z.nodeName)&&de.toLowerCase()==="input"&&(Z.type==="checkbox"||Z.type==="radio")&&(ke=J1);if(ke&&(ke=ke(s,Q))){tp(X,ke,l,G);break e}Pe&&Pe(s,Z,Q),s==="focusout"&&(Pe=Z._wrapperState)&&Pe.controlled&&Z.type==="number"&&Aa(Z,"number",Z.value)}switch(Pe=Q?ri(Q):window,s){case"focusin":(ep(Pe)||Pe.contentEditable==="true")&&(ei=Pe,cd=Q,Cl=null);break;case"focusout":Cl=cd=ei=null;break;case"mousedown":ud=!0;break;case"contextmenu":case"mouseup":case"dragend":ud=!1,up(X,l,G);break;case"selectionchange":if(tj)break;case"keydown":case"keyup":up(X,l,G)}var Ee;if(ad)e:{switch(s){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Ya?Xm(s,l)&&(qe="onCompositionEnd"):s==="keydown"&&l.keyCode===229&&(qe="onCompositionStart");qe&&(Zm&&l.locale!=="ko"&&(Ya||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Ya&&(Ee=Bm()):(ur=G,Yu="value"in ur?ur.value:ur.textContent,Ya=!0)),Pe=nc(Q,qe),0<Pe.length&&(qe=new Km(qe,s,null,l,G),X.push({event:qe,listeners:Pe}),Ee?qe.data=Ee:(Ee=Ym(l),Ee!==null&&(qe.data=Ee)))),(Ee=Q1?B1(s,l):V1(s,l))&&(Q=nc(Q,"onBeforeInput"),0<Q.length&&(G=new Km("onBeforeInput","beforeinput",null,l,G),X.push({event:G,listeners:Q}),G.data=Ee))}yp(X,a)})}function El(s,a,l){return{instance:s,listener:a,currentTarget:l}}function nc(s,a){for(var l=a+"Capture",u=[];s!==null;){var f=s,x=f.stateNode;f.tag===5&&x!==null&&(f=x,x=sr(s,l),x!=null&&u.unshift(El(s,x,f)),x=sr(s,a),x!=null&&u.push(El(s,x,f))),s=s.return}return u}function ni(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function bp(s,a,l,u,f){for(var x=a._reactName,w=[];l!==null&&l!==u;){var P=l,R=P.alternate,Q=P.stateNode;if(R!==null&&R===u)break;P.tag===5&&Q!==null&&(P=Q,f?(R=sr(l,x),R!=null&&w.unshift(El(l,R,P))):f||(R=sr(l,x),R!=null&&w.push(El(l,R,P)))),l=l.return}w.length!==0&&s.push({event:a,listeners:w})}var aj=/\r\n?/g,ij=/\u0000|\uFFFD/g;function wp(s){return(typeof s=="string"?s:""+s).replace(aj,`
|
|
39
|
+
`).replace(ij,"")}function sc(s,a,l){if(a=wp(a),wp(s)!==a&&l)throw Error(r(425))}function rc(){}var xd=null,gd=null;function vd(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var yd=typeof setTimeout=="function"?setTimeout:void 0,lj=typeof clearTimeout=="function"?clearTimeout:void 0,Np=typeof Promise=="function"?Promise:void 0,oj=typeof queueMicrotask=="function"?queueMicrotask:typeof Np<"u"?function(s){return Np.resolve(null).then(s).catch(cj)}:yd;function cj(s){setTimeout(function(){throw s})}function jd(s,a){var l=a,u=0;do{var f=l.nextSibling;if(s.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"){if(u===0){s.removeChild(f),yl(a);return}u--}else l!=="$"&&l!=="$?"&&l!=="$!"||u++;l=f}while(l);yl(a)}function hr(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return s}function kp(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var l=s.data;if(l==="$"||l==="$!"||l==="$?"){if(a===0)return s;a--}else l==="/$"&&a++}s=s.previousSibling}return null}var si=Math.random().toString(36).slice(2),ms="__reactFiber$"+si,Rl="__reactProps$"+si,Ts="__reactContainer$"+si,bd="__reactEvents$"+si,uj="__reactListeners$"+si,dj="__reactHandles$"+si;function Gr(s){var a=s[ms];if(a)return a;for(var l=s.parentNode;l;){if(a=l[Ts]||l[ms]){if(l=a.alternate,a.child!==null||l!==null&&l.child!==null)for(s=kp(s);s!==null;){if(l=s[ms])return l;s=kp(s)}return a}s=l,l=s.parentNode}return null}function Ml(s){return s=s[ms]||s[Ts],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function ri(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(r(33))}function ac(s){return s[Rl]||null}var wd=[],ai=-1;function fr(s){return{current:s}}function ft(s){0>ai||(s.current=wd[ai],wd[ai]=null,ai--)}function dt(s,a){ai++,wd[ai]=s.current,s.current=a}var mr={},Wt=fr(mr),gn=fr(!1),Jr=mr;function ii(s,a){var l=s.type.contextTypes;if(!l)return mr;var u=s.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===a)return u.__reactInternalMemoizedMaskedChildContext;var f={},x;for(x in l)f[x]=a[x];return u&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=f),f}function vn(s){return s=s.childContextTypes,s!=null}function ic(){ft(gn),ft(Wt)}function Sp(s,a,l){if(Wt.current!==mr)throw Error(r(168));dt(Wt,a),dt(gn,l)}function Cp(s,a,l){var u=s.stateNode;if(a=a.childContextTypes,typeof u.getChildContext!="function")return l;u=u.getChildContext();for(var f in u)if(!(f in a))throw Error(r(108,st(s)||"Unknown",f));return se({},l,u)}function lc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||mr,Jr=Wt.current,dt(Wt,s),dt(gn,gn.current),!0}function _p(s,a,l){var u=s.stateNode;if(!u)throw Error(r(169));l?(s=Cp(s,a,Jr),u.__reactInternalMemoizedMergedChildContext=s,ft(gn),ft(Wt),dt(Wt,s)):ft(gn),dt(gn,l)}var Is=null,oc=!1,Nd=!1;function Pp(s){Is===null?Is=[s]:Is.push(s)}function hj(s){oc=!0,Pp(s)}function pr(){if(!Nd&&Is!==null){Nd=!0;var s=0,a=lt;try{var l=Is;for(lt=1;s<l.length;s++){var u=l[s];do u=u(!0);while(u!==null)}Is=null,oc=!1}catch(f){throw Is!==null&&(Is=Is.slice(s+1)),Rm(Vu,pr),f}finally{lt=a,Nd=!1}}return null}var li=[],oi=0,cc=null,uc=0,An=[],Ln=0,Xr=null,qs=1,Os="";function Yr(s,a){li[oi++]=uc,li[oi++]=cc,cc=s,uc=a}function Ep(s,a,l){An[Ln++]=qs,An[Ln++]=Os,An[Ln++]=Xr,Xr=s;var u=qs;s=Os;var f=32-Yn(u)-1;u&=~(1<<f),l+=1;var x=32-Yn(a)+f;if(30<x){var w=f-f%5;x=(u&(1<<w)-1).toString(32),u>>=w,f-=w,qs=1<<32-Yn(a)+f|l<<f|u,Os=x+s}else qs=1<<x|l<<f|u,Os=s}function kd(s){s.return!==null&&(Yr(s,1),Ep(s,1,0))}function Sd(s){for(;s===cc;)cc=li[--oi],li[oi]=null,uc=li[--oi],li[oi]=null;for(;s===Xr;)Xr=An[--Ln],An[Ln]=null,Os=An[--Ln],An[Ln]=null,qs=An[--Ln],An[Ln]=null}var Pn=null,En=null,pt=!1,ts=null;function Rp(s,a){var l=Qn(5,null,null,0);l.elementType="DELETED",l.stateNode=a,l.return=s,a=s.deletions,a===null?(s.deletions=[l],s.flags|=16):a.push(l)}function Mp(s,a){switch(s.tag){case 5:var l=s.type;return a=a.nodeType!==1||l.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(s.stateNode=a,Pn=s,En=hr(a.firstChild),!0):!1;case 6:return a=s.pendingProps===""||a.nodeType!==3?null:a,a!==null?(s.stateNode=a,Pn=s,En=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(l=Xr!==null?{id:qs,overflow:Os}:null,s.memoizedState={dehydrated:a,treeContext:l,retryLane:1073741824},l=Qn(18,null,null,0),l.stateNode=a,l.return=s,s.child=l,Pn=s,En=null,!0):!1;default:return!1}}function Cd(s){return(s.mode&1)!==0&&(s.flags&128)===0}function _d(s){if(pt){var a=En;if(a){var l=a;if(!Mp(s,a)){if(Cd(s))throw Error(r(418));a=hr(l.nextSibling);var u=Pn;a&&Mp(s,a)?Rp(u,l):(s.flags=s.flags&-4097|2,pt=!1,Pn=s)}}else{if(Cd(s))throw Error(r(418));s.flags=s.flags&-4097|2,pt=!1,Pn=s}}}function Tp(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Pn=s}function dc(s){if(s!==Pn)return!1;if(!pt)return Tp(s),pt=!0,!1;var a;if((a=s.tag!==3)&&!(a=s.tag!==5)&&(a=s.type,a=a!=="head"&&a!=="body"&&!vd(s.type,s.memoizedProps)),a&&(a=En)){if(Cd(s))throw Ip(),Error(r(418));for(;a;)Rp(s,a),a=hr(a.nextSibling)}if(Tp(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,a=0;s;){if(s.nodeType===8){var l=s.data;if(l==="/$"){if(a===0){En=hr(s.nextSibling);break e}a--}else l!=="$"&&l!=="$!"&&l!=="$?"||a++}s=s.nextSibling}En=null}}else En=Pn?hr(s.stateNode.nextSibling):null;return!0}function Ip(){for(var s=En;s;)s=hr(s.nextSibling)}function ci(){En=Pn=null,pt=!1}function Pd(s){ts===null?ts=[s]:ts.push(s)}var fj=E.ReactCurrentBatchConfig;function Tl(s,a,l){if(s=l.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(r(309));var u=l.stateNode}if(!u)throw Error(r(147,s));var f=u,x=""+s;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===x?a.ref:(a=function(w){var P=f.refs;w===null?delete P[x]:P[x]=w},a._stringRef=x,a)}if(typeof s!="string")throw Error(r(284));if(!l._owner)throw Error(r(290,s))}return s}function hc(s,a){throw s=Object.prototype.toString.call(a),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s))}function qp(s){var a=s._init;return a(s._payload)}function Op(s){function a(L,I){if(s){var D=L.deletions;D===null?(L.deletions=[I],L.flags|=16):D.push(I)}}function l(L,I){if(!s)return null;for(;I!==null;)a(L,I),I=I.sibling;return null}function u(L,I){for(L=new Map;I!==null;)I.key!==null?L.set(I.key,I):L.set(I.index,I),I=I.sibling;return L}function f(L,I){return L=Nr(L,I),L.index=0,L.sibling=null,L}function x(L,I,D){return L.index=D,s?(D=L.alternate,D!==null?(D=D.index,D<I?(L.flags|=2,I):D):(L.flags|=2,I)):(L.flags|=1048576,I)}function w(L){return s&&L.alternate===null&&(L.flags|=2),L}function P(L,I,D,ne){return I===null||I.tag!==6?(I=yh(D,L.mode,ne),I.return=L,I):(I=f(I,D),I.return=L,I)}function R(L,I,D,ne){var ke=D.type;return ke===$?G(L,I,D.props.children,ne,D.key):I!==null&&(I.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===rt&&qp(ke)===I.type)?(ne=f(I,D.props),ne.ref=Tl(L,I,D),ne.return=L,ne):(ne=$c(D.type,D.key,D.props,null,L.mode,ne),ne.ref=Tl(L,I,D),ne.return=L,ne)}function Q(L,I,D,ne){return I===null||I.tag!==4||I.stateNode.containerInfo!==D.containerInfo||I.stateNode.implementation!==D.implementation?(I=jh(D,L.mode,ne),I.return=L,I):(I=f(I,D.children||[]),I.return=L,I)}function G(L,I,D,ne,ke){return I===null||I.tag!==7?(I=la(D,L.mode,ne,ke),I.return=L,I):(I=f(I,D),I.return=L,I)}function X(L,I,D){if(typeof I=="string"&&I!==""||typeof I=="number")return I=yh(""+I,L.mode,D),I.return=L,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case T:return D=$c(I.type,I.key,I.props,null,L.mode,D),D.ref=Tl(L,null,I),D.return=L,D;case M:return I=jh(I,L.mode,D),I.return=L,I;case rt:var ne=I._init;return X(L,ne(I._payload),D)}if(tr(I)||ue(I))return I=la(I,L.mode,D,null),I.return=L,I;hc(L,I)}return null}function Z(L,I,D,ne){var ke=I!==null?I.key:null;if(typeof D=="string"&&D!==""||typeof D=="number")return ke!==null?null:P(L,I,""+D,ne);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case T:return D.key===ke?R(L,I,D,ne):null;case M:return D.key===ke?Q(L,I,D,ne):null;case rt:return ke=D._init,Z(L,I,ke(D._payload),ne)}if(tr(D)||ue(D))return ke!==null?null:G(L,I,D,ne,null);hc(L,D)}return null}function de(L,I,D,ne,ke){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return L=L.get(D)||null,P(I,L,""+ne,ke);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:return L=L.get(ne.key===null?D:ne.key)||null,R(I,L,ne,ke);case M:return L=L.get(ne.key===null?D:ne.key)||null,Q(I,L,ne,ke);case rt:var Pe=ne._init;return de(L,I,D,Pe(ne._payload),ke)}if(tr(ne)||ue(ne))return L=L.get(D)||null,G(I,L,ne,ke,null);hc(I,ne)}return null}function ve(L,I,D,ne){for(var ke=null,Pe=null,Ee=I,qe=I=0,Ft=null;Ee!==null&&qe<D.length;qe++){Ee.index>qe?(Ft=Ee,Ee=null):Ft=Ee.sibling;var et=Z(L,Ee,D[qe],ne);if(et===null){Ee===null&&(Ee=Ft);break}s&&Ee&&et.alternate===null&&a(L,Ee),I=x(et,I,qe),Pe===null?ke=et:Pe.sibling=et,Pe=et,Ee=Ft}if(qe===D.length)return l(L,Ee),pt&&Yr(L,qe),ke;if(Ee===null){for(;qe<D.length;qe++)Ee=X(L,D[qe],ne),Ee!==null&&(I=x(Ee,I,qe),Pe===null?ke=Ee:Pe.sibling=Ee,Pe=Ee);return pt&&Yr(L,qe),ke}for(Ee=u(L,Ee);qe<D.length;qe++)Ft=de(Ee,L,qe,D[qe],ne),Ft!==null&&(s&&Ft.alternate!==null&&Ee.delete(Ft.key===null?qe:Ft.key),I=x(Ft,I,qe),Pe===null?ke=Ft:Pe.sibling=Ft,Pe=Ft);return s&&Ee.forEach(function(kr){return a(L,kr)}),pt&&Yr(L,qe),ke}function je(L,I,D,ne){var ke=ue(D);if(typeof ke!="function")throw Error(r(150));if(D=ke.call(D),D==null)throw Error(r(151));for(var Pe=ke=null,Ee=I,qe=I=0,Ft=null,et=D.next();Ee!==null&&!et.done;qe++,et=D.next()){Ee.index>qe?(Ft=Ee,Ee=null):Ft=Ee.sibling;var kr=Z(L,Ee,et.value,ne);if(kr===null){Ee===null&&(Ee=Ft);break}s&&Ee&&kr.alternate===null&&a(L,Ee),I=x(kr,I,qe),Pe===null?ke=kr:Pe.sibling=kr,Pe=kr,Ee=Ft}if(et.done)return l(L,Ee),pt&&Yr(L,qe),ke;if(Ee===null){for(;!et.done;qe++,et=D.next())et=X(L,et.value,ne),et!==null&&(I=x(et,I,qe),Pe===null?ke=et:Pe.sibling=et,Pe=et);return pt&&Yr(L,qe),ke}for(Ee=u(L,Ee);!et.done;qe++,et=D.next())et=de(Ee,L,qe,et.value,ne),et!==null&&(s&&et.alternate!==null&&Ee.delete(et.key===null?qe:et.key),I=x(et,I,qe),Pe===null?ke=et:Pe.sibling=et,Pe=et);return s&&Ee.forEach(function(Hj){return a(L,Hj)}),pt&&Yr(L,qe),ke}function Et(L,I,D,ne){if(typeof D=="object"&&D!==null&&D.type===$&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case T:e:{for(var ke=D.key,Pe=I;Pe!==null;){if(Pe.key===ke){if(ke=D.type,ke===$){if(Pe.tag===7){l(L,Pe.sibling),I=f(Pe,D.props.children),I.return=L,L=I;break e}}else if(Pe.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===rt&&qp(ke)===Pe.type){l(L,Pe.sibling),I=f(Pe,D.props),I.ref=Tl(L,Pe,D),I.return=L,L=I;break e}l(L,Pe);break}else a(L,Pe);Pe=Pe.sibling}D.type===$?(I=la(D.props.children,L.mode,ne,D.key),I.return=L,L=I):(ne=$c(D.type,D.key,D.props,null,L.mode,ne),ne.ref=Tl(L,I,D),ne.return=L,L=ne)}return w(L);case M:e:{for(Pe=D.key;I!==null;){if(I.key===Pe)if(I.tag===4&&I.stateNode.containerInfo===D.containerInfo&&I.stateNode.implementation===D.implementation){l(L,I.sibling),I=f(I,D.children||[]),I.return=L,L=I;break e}else{l(L,I);break}else a(L,I);I=I.sibling}I=jh(D,L.mode,ne),I.return=L,L=I}return w(L);case rt:return Pe=D._init,Et(L,I,Pe(D._payload),ne)}if(tr(D))return ve(L,I,D,ne);if(ue(D))return je(L,I,D,ne);hc(L,D)}return typeof D=="string"&&D!==""||typeof D=="number"?(D=""+D,I!==null&&I.tag===6?(l(L,I.sibling),I=f(I,D),I.return=L,L=I):(l(L,I),I=yh(D,L.mode,ne),I.return=L,L=I),w(L)):l(L,I)}return Et}var ui=Op(!0),$p=Op(!1),fc=fr(null),mc=null,di=null,Ed=null;function Rd(){Ed=di=mc=null}function Md(s){var a=fc.current;ft(fc),s._currentValue=a}function Td(s,a,l){for(;s!==null;){var u=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,u!==null&&(u.childLanes|=a)):u!==null&&(u.childLanes&a)!==a&&(u.childLanes|=a),s===l)break;s=s.return}}function hi(s,a){mc=s,Ed=di=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&a)!==0&&(yn=!0),s.firstContext=null)}function Fn(s){var a=s._currentValue;if(Ed!==s)if(s={context:s,memoizedValue:a,next:null},di===null){if(mc===null)throw Error(r(308));di=s,mc.dependencies={lanes:0,firstContext:s}}else di=di.next=s;return a}var ea=null;function Id(s){ea===null?ea=[s]:ea.push(s)}function zp(s,a,l,u){var f=a.interleaved;return f===null?(l.next=l,Id(a)):(l.next=f.next,f.next=l),a.interleaved=l,$s(s,u)}function $s(s,a){s.lanes|=a;var l=s.alternate;for(l!==null&&(l.lanes|=a),l=s,s=s.return;s!==null;)s.childLanes|=a,l=s.alternate,l!==null&&(l.childLanes|=a),l=s,s=s.return;return l.tag===3?l.stateNode:null}var xr=!1;function qd(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ap(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function zs(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function gr(s,a,l){var u=s.updateQueue;if(u===null)return null;if(u=u.shared,(Xe&2)!==0){var f=u.pending;return f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a,$s(s,l)}return f=u.interleaved,f===null?(a.next=a,Id(u)):(a.next=f.next,f.next=a),u.interleaved=a,$s(s,l)}function pc(s,a,l){if(a=a.updateQueue,a!==null&&(a=a.shared,(l&4194240)!==0)){var u=a.lanes;u&=s.pendingLanes,l|=u,a.lanes=l,Wu(s,l)}}function Lp(s,a){var l=s.updateQueue,u=s.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var f=null,x=null;if(l=l.firstBaseUpdate,l!==null){do{var w={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};x===null?f=x=w:x=x.next=w,l=l.next}while(l!==null);x===null?f=x=a:x=x.next=a}else f=x=a;l={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:x,shared:u.shared,effects:u.effects},s.updateQueue=l;return}s=l.lastBaseUpdate,s===null?l.firstBaseUpdate=a:s.next=a,l.lastBaseUpdate=a}function xc(s,a,l,u){var f=s.updateQueue;xr=!1;var x=f.firstBaseUpdate,w=f.lastBaseUpdate,P=f.shared.pending;if(P!==null){f.shared.pending=null;var R=P,Q=R.next;R.next=null,w===null?x=Q:w.next=Q,w=R;var G=s.alternate;G!==null&&(G=G.updateQueue,P=G.lastBaseUpdate,P!==w&&(P===null?G.firstBaseUpdate=Q:P.next=Q,G.lastBaseUpdate=R))}if(x!==null){var X=f.baseState;w=0,G=Q=R=null,P=x;do{var Z=P.lane,de=P.eventTime;if((u&Z)===Z){G!==null&&(G=G.next={eventTime:de,lane:0,tag:P.tag,payload:P.payload,callback:P.callback,next:null});e:{var ve=s,je=P;switch(Z=a,de=l,je.tag){case 1:if(ve=je.payload,typeof ve=="function"){X=ve.call(de,X,Z);break e}X=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=je.payload,Z=typeof ve=="function"?ve.call(de,X,Z):ve,Z==null)break e;X=se({},X,Z);break e;case 2:xr=!0}}P.callback!==null&&P.lane!==0&&(s.flags|=64,Z=f.effects,Z===null?f.effects=[P]:Z.push(P))}else de={eventTime:de,lane:Z,tag:P.tag,payload:P.payload,callback:P.callback,next:null},G===null?(Q=G=de,R=X):G=G.next=de,w|=Z;if(P=P.next,P===null){if(P=f.shared.pending,P===null)break;Z=P,P=Z.next,Z.next=null,f.lastBaseUpdate=Z,f.shared.pending=null}}while(!0);if(G===null&&(R=X),f.baseState=R,f.firstBaseUpdate=Q,f.lastBaseUpdate=G,a=f.shared.interleaved,a!==null){f=a;do w|=f.lane,f=f.next;while(f!==a)}else x===null&&(f.shared.lanes=0);sa|=w,s.lanes=w,s.memoizedState=X}}function Fp(s,a,l){if(s=a.effects,a.effects=null,s!==null)for(a=0;a<s.length;a++){var u=s[a],f=u.callback;if(f!==null){if(u.callback=null,u=l,typeof f!="function")throw Error(r(191,f));f.call(u)}}}var Il={},ps=fr(Il),ql=fr(Il),Ol=fr(Il);function ta(s){if(s===Il)throw Error(r(174));return s}function Od(s,a){switch(dt(Ol,a),dt(ql,s),dt(ps,Il),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:Da(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=Da(a,s)}ft(ps),dt(ps,a)}function fi(){ft(ps),ft(ql),ft(Ol)}function Dp(s){ta(Ol.current);var a=ta(ps.current),l=Da(a,s.type);a!==l&&(dt(ql,s),dt(ps,l))}function $d(s){ql.current===s&&(ft(ps),ft(ql))}var bt=fr(0);function gc(s){for(var a=s;a!==null;){if(a.tag===13){var l=a.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var zd=[];function Ad(){for(var s=0;s<zd.length;s++)zd[s]._workInProgressVersionPrimary=null;zd.length=0}var vc=E.ReactCurrentDispatcher,Ld=E.ReactCurrentBatchConfig,na=0,wt=null,It=null,At=null,yc=!1,$l=!1,zl=0,mj=0;function Zt(){throw Error(r(321))}function Fd(s,a){if(a===null)return!1;for(var l=0;l<a.length&&l<s.length;l++)if(!es(s[l],a[l]))return!1;return!0}function Dd(s,a,l,u,f,x){if(na=x,wt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,vc.current=s===null||s.memoizedState===null?vj:yj,s=l(u,f),$l){x=0;do{if($l=!1,zl=0,25<=x)throw Error(r(301));x+=1,At=It=null,a.updateQueue=null,vc.current=jj,s=l(u,f)}while($l)}if(vc.current=wc,a=It!==null&&It.next!==null,na=0,At=It=wt=null,yc=!1,a)throw Error(r(300));return s}function Ud(){var s=zl!==0;return zl=0,s}function xs(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?wt.memoizedState=At=s:At=At.next=s,At}function Dn(){if(It===null){var s=wt.alternate;s=s!==null?s.memoizedState:null}else s=It.next;var a=At===null?wt.memoizedState:At.next;if(a!==null)At=a,It=s;else{if(s===null)throw Error(r(310));It=s,s={memoizedState:It.memoizedState,baseState:It.baseState,baseQueue:It.baseQueue,queue:It.queue,next:null},At===null?wt.memoizedState=At=s:At=At.next=s}return At}function Al(s,a){return typeof a=="function"?a(s):a}function Qd(s){var a=Dn(),l=a.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=s;var u=It,f=u.baseQueue,x=l.pending;if(x!==null){if(f!==null){var w=f.next;f.next=x.next,x.next=w}u.baseQueue=f=x,l.pending=null}if(f!==null){x=f.next,u=u.baseState;var P=w=null,R=null,Q=x;do{var G=Q.lane;if((na&G)===G)R!==null&&(R=R.next={lane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),u=Q.hasEagerState?Q.eagerState:s(u,Q.action);else{var X={lane:G,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null};R===null?(P=R=X,w=u):R=R.next=X,wt.lanes|=G,sa|=G}Q=Q.next}while(Q!==null&&Q!==x);R===null?w=u:R.next=P,es(u,a.memoizedState)||(yn=!0),a.memoizedState=u,a.baseState=w,a.baseQueue=R,l.lastRenderedState=u}if(s=l.interleaved,s!==null){f=s;do x=f.lane,wt.lanes|=x,sa|=x,f=f.next;while(f!==s)}else f===null&&(l.lanes=0);return[a.memoizedState,l.dispatch]}function Bd(s){var a=Dn(),l=a.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=s;var u=l.dispatch,f=l.pending,x=a.memoizedState;if(f!==null){l.pending=null;var w=f=f.next;do x=s(x,w.action),w=w.next;while(w!==f);es(x,a.memoizedState)||(yn=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),l.lastRenderedState=x}return[x,u]}function Up(){}function Qp(s,a){var l=wt,u=Dn(),f=a(),x=!es(u.memoizedState,f);if(x&&(u.memoizedState=f,yn=!0),u=u.queue,Vd(Hp.bind(null,l,u,s),[s]),u.getSnapshot!==a||x||At!==null&&At.memoizedState.tag&1){if(l.flags|=2048,Ll(9,Vp.bind(null,l,u,f,a),void 0,null),Lt===null)throw Error(r(349));(na&30)!==0||Bp(l,a,f)}return f}function Bp(s,a,l){s.flags|=16384,s={getSnapshot:a,value:l},a=wt.updateQueue,a===null?(a={lastEffect:null,stores:null},wt.updateQueue=a,a.stores=[s]):(l=a.stores,l===null?a.stores=[s]:l.push(s))}function Vp(s,a,l,u){a.value=l,a.getSnapshot=u,Kp(a)&&Wp(s)}function Hp(s,a,l){return l(function(){Kp(a)&&Wp(s)})}function Kp(s){var a=s.getSnapshot;s=s.value;try{var l=a();return!es(s,l)}catch{return!0}}function Wp(s){var a=$s(s,1);a!==null&&as(a,s,1,-1)}function Zp(s){var a=xs();return typeof s=="function"&&(s=s()),a.memoizedState=a.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Al,lastRenderedState:s},a.queue=s,s=s.dispatch=gj.bind(null,wt,s),[a.memoizedState,s]}function Ll(s,a,l,u){return s={tag:s,create:a,destroy:l,deps:u,next:null},a=wt.updateQueue,a===null?(a={lastEffect:null,stores:null},wt.updateQueue=a,a.lastEffect=s.next=s):(l=a.lastEffect,l===null?a.lastEffect=s.next=s:(u=l.next,l.next=s,s.next=u,a.lastEffect=s)),s}function Gp(){return Dn().memoizedState}function jc(s,a,l,u){var f=xs();wt.flags|=s,f.memoizedState=Ll(1|a,l,void 0,u===void 0?null:u)}function bc(s,a,l,u){var f=Dn();u=u===void 0?null:u;var x=void 0;if(It!==null){var w=It.memoizedState;if(x=w.destroy,u!==null&&Fd(u,w.deps)){f.memoizedState=Ll(a,l,x,u);return}}wt.flags|=s,f.memoizedState=Ll(1|a,l,x,u)}function Jp(s,a){return jc(8390656,8,s,a)}function Vd(s,a){return bc(2048,8,s,a)}function Xp(s,a){return bc(4,2,s,a)}function Yp(s,a){return bc(4,4,s,a)}function ex(s,a){if(typeof a=="function")return s=s(),a(s),function(){a(null)};if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function tx(s,a,l){return l=l!=null?l.concat([s]):null,bc(4,4,ex.bind(null,a,s),l)}function Hd(){}function nx(s,a){var l=Dn();a=a===void 0?null:a;var u=l.memoizedState;return u!==null&&a!==null&&Fd(a,u[1])?u[0]:(l.memoizedState=[s,a],s)}function sx(s,a){var l=Dn();a=a===void 0?null:a;var u=l.memoizedState;return u!==null&&a!==null&&Fd(a,u[1])?u[0]:(s=s(),l.memoizedState=[s,a],s)}function rx(s,a,l){return(na&21)===0?(s.baseState&&(s.baseState=!1,yn=!0),s.memoizedState=l):(es(l,a)||(l=qm(),wt.lanes|=l,sa|=l,s.baseState=!0),a)}function pj(s,a){var l=lt;lt=l!==0&&4>l?l:4,s(!0);var u=Ld.transition;Ld.transition={};try{s(!1),a()}finally{lt=l,Ld.transition=u}}function ax(){return Dn().memoizedState}function xj(s,a,l){var u=br(s);if(l={lane:u,action:l,hasEagerState:!1,eagerState:null,next:null},ix(s))lx(a,l);else if(l=zp(s,a,l,u),l!==null){var f=on();as(l,s,u,f),ox(l,a,u)}}function gj(s,a,l){var u=br(s),f={lane:u,action:l,hasEagerState:!1,eagerState:null,next:null};if(ix(s))lx(a,f);else{var x=s.alternate;if(s.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var w=a.lastRenderedState,P=x(w,l);if(f.hasEagerState=!0,f.eagerState=P,es(P,w)){var R=a.interleaved;R===null?(f.next=f,Id(a)):(f.next=R.next,R.next=f),a.interleaved=f;return}}catch{}finally{}l=zp(s,a,f,u),l!==null&&(f=on(),as(l,s,u,f),ox(l,a,u))}}function ix(s){var a=s.alternate;return s===wt||a!==null&&a===wt}function lx(s,a){$l=yc=!0;var l=s.pending;l===null?a.next=a:(a.next=l.next,l.next=a),s.pending=a}function ox(s,a,l){if((l&4194240)!==0){var u=a.lanes;u&=s.pendingLanes,l|=u,a.lanes=l,Wu(s,l)}}var wc={readContext:Fn,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useInsertionEffect:Zt,useLayoutEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useMutableSource:Zt,useSyncExternalStore:Zt,useId:Zt,unstable_isNewReconciler:!1},vj={readContext:Fn,useCallback:function(s,a){return xs().memoizedState=[s,a===void 0?null:a],s},useContext:Fn,useEffect:Jp,useImperativeHandle:function(s,a,l){return l=l!=null?l.concat([s]):null,jc(4194308,4,ex.bind(null,a,s),l)},useLayoutEffect:function(s,a){return jc(4194308,4,s,a)},useInsertionEffect:function(s,a){return jc(4,2,s,a)},useMemo:function(s,a){var l=xs();return a=a===void 0?null:a,s=s(),l.memoizedState=[s,a],s},useReducer:function(s,a,l){var u=xs();return a=l!==void 0?l(a):a,u.memoizedState=u.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},u.queue=s,s=s.dispatch=xj.bind(null,wt,s),[u.memoizedState,s]},useRef:function(s){var a=xs();return s={current:s},a.memoizedState=s},useState:Zp,useDebugValue:Hd,useDeferredValue:function(s){return xs().memoizedState=s},useTransition:function(){var s=Zp(!1),a=s[0];return s=pj.bind(null,s[1]),xs().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,l){var u=wt,f=xs();if(pt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=a(),Lt===null)throw Error(r(349));(na&30)!==0||Bp(u,a,l)}f.memoizedState=l;var x={value:l,getSnapshot:a};return f.queue=x,Jp(Hp.bind(null,u,x,s),[s]),u.flags|=2048,Ll(9,Vp.bind(null,u,x,l,a),void 0,null),l},useId:function(){var s=xs(),a=Lt.identifierPrefix;if(pt){var l=Os,u=qs;l=(u&~(1<<32-Yn(u)-1)).toString(32)+l,a=":"+a+"R"+l,l=zl++,0<l&&(a+="H"+l.toString(32)),a+=":"}else l=mj++,a=":"+a+"r"+l.toString(32)+":";return s.memoizedState=a},unstable_isNewReconciler:!1},yj={readContext:Fn,useCallback:nx,useContext:Fn,useEffect:Vd,useImperativeHandle:tx,useInsertionEffect:Xp,useLayoutEffect:Yp,useMemo:sx,useReducer:Qd,useRef:Gp,useState:function(){return Qd(Al)},useDebugValue:Hd,useDeferredValue:function(s){var a=Dn();return rx(a,It.memoizedState,s)},useTransition:function(){var s=Qd(Al)[0],a=Dn().memoizedState;return[s,a]},useMutableSource:Up,useSyncExternalStore:Qp,useId:ax,unstable_isNewReconciler:!1},jj={readContext:Fn,useCallback:nx,useContext:Fn,useEffect:Vd,useImperativeHandle:tx,useInsertionEffect:Xp,useLayoutEffect:Yp,useMemo:sx,useReducer:Bd,useRef:Gp,useState:function(){return Bd(Al)},useDebugValue:Hd,useDeferredValue:function(s){var a=Dn();return It===null?a.memoizedState=s:rx(a,It.memoizedState,s)},useTransition:function(){var s=Bd(Al)[0],a=Dn().memoizedState;return[s,a]},useMutableSource:Up,useSyncExternalStore:Qp,useId:ax,unstable_isNewReconciler:!1};function ns(s,a){if(s&&s.defaultProps){a=se({},a),s=s.defaultProps;for(var l in s)a[l]===void 0&&(a[l]=s[l]);return a}return a}function Kd(s,a,l,u){a=s.memoizedState,l=l(u,a),l=l==null?a:se({},a,l),s.memoizedState=l,s.lanes===0&&(s.updateQueue.baseState=l)}var Nc={isMounted:function(s){return(s=s._reactInternals)?Ue(s)===s:!1},enqueueSetState:function(s,a,l){s=s._reactInternals;var u=on(),f=br(s),x=zs(u,f);x.payload=a,l!=null&&(x.callback=l),a=gr(s,x,f),a!==null&&(as(a,s,f,u),pc(a,s,f))},enqueueReplaceState:function(s,a,l){s=s._reactInternals;var u=on(),f=br(s),x=zs(u,f);x.tag=1,x.payload=a,l!=null&&(x.callback=l),a=gr(s,x,f),a!==null&&(as(a,s,f,u),pc(a,s,f))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var l=on(),u=br(s),f=zs(l,u);f.tag=2,a!=null&&(f.callback=a),a=gr(s,f,u),a!==null&&(as(a,s,u,l),pc(a,s,u))}};function cx(s,a,l,u,f,x,w){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(u,x,w):a.prototype&&a.prototype.isPureReactComponent?!Sl(l,u)||!Sl(f,x):!0}function ux(s,a,l){var u=!1,f=mr,x=a.contextType;return typeof x=="object"&&x!==null?x=Fn(x):(f=vn(a)?Jr:Wt.current,u=a.contextTypes,x=(u=u!=null)?ii(s,f):mr),a=new a(l,x),s.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Nc,s.stateNode=a,a._reactInternals=s,u&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=f,s.__reactInternalMemoizedMaskedChildContext=x),a}function dx(s,a,l,u){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(l,u),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(l,u),a.state!==s&&Nc.enqueueReplaceState(a,a.state,null)}function Wd(s,a,l,u){var f=s.stateNode;f.props=l,f.state=s.memoizedState,f.refs={},qd(s);var x=a.contextType;typeof x=="object"&&x!==null?f.context=Fn(x):(x=vn(a)?Jr:Wt.current,f.context=ii(s,x)),f.state=s.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Kd(s,a,x,l),f.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(a=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),a!==f.state&&Nc.enqueueReplaceState(f,f.state,null),xc(s,l,f,u),f.state=s.memoizedState),typeof f.componentDidMount=="function"&&(s.flags|=4194308)}function mi(s,a){try{var l="",u=a;do l+=Ne(u),u=u.return;while(u);var f=l}catch(x){f=`
|
|
40
|
+
Error generating stack: `+x.message+`
|
|
41
|
+
`+x.stack}return{value:s,source:a,stack:f,digest:null}}function Zd(s,a,l){return{value:s,source:null,stack:l??null,digest:a??null}}function Gd(s,a){try{console.error(a.value)}catch(l){setTimeout(function(){throw l})}}var bj=typeof WeakMap=="function"?WeakMap:Map;function hx(s,a,l){l=zs(-1,l),l.tag=3,l.payload={element:null};var u=a.value;return l.callback=function(){Rc||(Rc=!0,dh=u),Gd(s,a)},l}function fx(s,a,l){l=zs(-1,l),l.tag=3;var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=a.value;l.payload=function(){return u(f)},l.callback=function(){Gd(s,a)}}var x=s.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(l.callback=function(){Gd(s,a),typeof u!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var w=a.stack;this.componentDidCatch(a.value,{componentStack:w!==null?w:""})}),l}function mx(s,a,l){var u=s.pingCache;if(u===null){u=s.pingCache=new bj;var f=new Set;u.set(a,f)}else f=u.get(a),f===void 0&&(f=new Set,u.set(a,f));f.has(l)||(f.add(l),s=Oj.bind(null,s,a,l),a.then(s,s))}function px(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function xx(s,a,l,u,f){return(s.mode&1)===0?(s===a?s.flags|=65536:(s.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(a=zs(-1,1),a.tag=2,gr(l,a,1))),l.lanes|=1),s):(s.flags|=65536,s.lanes=f,s)}var wj=E.ReactCurrentOwner,yn=!1;function ln(s,a,l,u){a.child=s===null?$p(a,null,l,u):ui(a,s.child,l,u)}function gx(s,a,l,u,f){l=l.render;var x=a.ref;return hi(a,f),u=Dd(s,a,l,u,x,f),l=Ud(),s!==null&&!yn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~f,As(s,a,f)):(pt&&l&&kd(a),a.flags|=1,ln(s,a,u,f),a.child)}function vx(s,a,l,u,f){if(s===null){var x=l.type;return typeof x=="function"&&!vh(x)&&x.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(a.tag=15,a.type=x,yx(s,a,x,u,f)):(s=$c(l.type,null,u,a,a.mode,f),s.ref=a.ref,s.return=a,a.child=s)}if(x=s.child,(s.lanes&f)===0){var w=x.memoizedProps;if(l=l.compare,l=l!==null?l:Sl,l(w,u)&&s.ref===a.ref)return As(s,a,f)}return a.flags|=1,s=Nr(x,u),s.ref=a.ref,s.return=a,a.child=s}function yx(s,a,l,u,f){if(s!==null){var x=s.memoizedProps;if(Sl(x,u)&&s.ref===a.ref)if(yn=!1,a.pendingProps=u=x,(s.lanes&f)!==0)(s.flags&131072)!==0&&(yn=!0);else return a.lanes=s.lanes,As(s,a,f)}return Jd(s,a,l,u,f)}function jx(s,a,l){var u=a.pendingProps,f=u.children,x=s!==null?s.memoizedState:null;if(u.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},dt(xi,Rn),Rn|=l;else{if((l&1073741824)===0)return s=x!==null?x.baseLanes|l:l,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,dt(xi,Rn),Rn|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=x!==null?x.baseLanes:l,dt(xi,Rn),Rn|=u}else x!==null?(u=x.baseLanes|l,a.memoizedState=null):u=l,dt(xi,Rn),Rn|=u;return ln(s,a,f,l),a.child}function bx(s,a){var l=a.ref;(s===null&&l!==null||s!==null&&s.ref!==l)&&(a.flags|=512,a.flags|=2097152)}function Jd(s,a,l,u,f){var x=vn(l)?Jr:Wt.current;return x=ii(a,x),hi(a,f),l=Dd(s,a,l,u,x,f),u=Ud(),s!==null&&!yn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~f,As(s,a,f)):(pt&&u&&kd(a),a.flags|=1,ln(s,a,l,f),a.child)}function wx(s,a,l,u,f){if(vn(l)){var x=!0;lc(a)}else x=!1;if(hi(a,f),a.stateNode===null)Sc(s,a),ux(a,l,u),Wd(a,l,u,f),u=!0;else if(s===null){var w=a.stateNode,P=a.memoizedProps;w.props=P;var R=w.context,Q=l.contextType;typeof Q=="object"&&Q!==null?Q=Fn(Q):(Q=vn(l)?Jr:Wt.current,Q=ii(a,Q));var G=l.getDerivedStateFromProps,X=typeof G=="function"||typeof w.getSnapshotBeforeUpdate=="function";X||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P!==u||R!==Q)&&dx(a,w,u,Q),xr=!1;var Z=a.memoizedState;w.state=Z,xc(a,u,w,f),R=a.memoizedState,P!==u||Z!==R||gn.current||xr?(typeof G=="function"&&(Kd(a,l,G,u),R=a.memoizedState),(P=xr||cx(a,l,P,u,Z,R,Q))?(X||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(a.flags|=4194308)):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=R),w.props=u,w.state=R,w.context=Q,u=P):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{w=a.stateNode,Ap(s,a),P=a.memoizedProps,Q=a.type===a.elementType?P:ns(a.type,P),w.props=Q,X=a.pendingProps,Z=w.context,R=l.contextType,typeof R=="object"&&R!==null?R=Fn(R):(R=vn(l)?Jr:Wt.current,R=ii(a,R));var de=l.getDerivedStateFromProps;(G=typeof de=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P!==X||Z!==R)&&dx(a,w,u,R),xr=!1,Z=a.memoizedState,w.state=Z,xc(a,u,w,f);var ve=a.memoizedState;P!==X||Z!==ve||gn.current||xr?(typeof de=="function"&&(Kd(a,l,de,u),ve=a.memoizedState),(Q=xr||cx(a,l,Q,u,Z,ve,R)||!1)?(G||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(u,ve,R),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(u,ve,R)),typeof w.componentDidUpdate=="function"&&(a.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof w.componentDidUpdate!="function"||P===s.memoizedProps&&Z===s.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||P===s.memoizedProps&&Z===s.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=ve),w.props=u,w.state=ve,w.context=R,u=Q):(typeof w.componentDidUpdate!="function"||P===s.memoizedProps&&Z===s.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||P===s.memoizedProps&&Z===s.memoizedState||(a.flags|=1024),u=!1)}return Xd(s,a,l,u,x,f)}function Xd(s,a,l,u,f,x){bx(s,a);var w=(a.flags&128)!==0;if(!u&&!w)return f&&_p(a,l,!1),As(s,a,x);u=a.stateNode,wj.current=a;var P=w&&typeof l.getDerivedStateFromError!="function"?null:u.render();return a.flags|=1,s!==null&&w?(a.child=ui(a,s.child,null,x),a.child=ui(a,null,P,x)):ln(s,a,P,x),a.memoizedState=u.state,f&&_p(a,l,!0),a.child}function Nx(s){var a=s.stateNode;a.pendingContext?Sp(s,a.pendingContext,a.pendingContext!==a.context):a.context&&Sp(s,a.context,!1),Od(s,a.containerInfo)}function kx(s,a,l,u,f){return ci(),Pd(f),a.flags|=256,ln(s,a,l,u),a.child}var Yd={dehydrated:null,treeContext:null,retryLane:0};function eh(s){return{baseLanes:s,cachePool:null,transitions:null}}function Sx(s,a,l){var u=a.pendingProps,f=bt.current,x=!1,w=(a.flags&128)!==0,P;if((P=w)||(P=s!==null&&s.memoizedState===null?!1:(f&2)!==0),P?(x=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(f|=1),dt(bt,f&1),s===null)return _d(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((a.mode&1)===0?a.lanes=1:s.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(w=u.children,s=u.fallback,x?(u=a.mode,x=a.child,w={mode:"hidden",children:w},(u&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=w):x=zc(w,u,0,null),s=la(s,u,l,null),x.return=a,s.return=a,x.sibling=s,a.child=x,a.child.memoizedState=eh(l),a.memoizedState=Yd,s):th(a,w));if(f=s.memoizedState,f!==null&&(P=f.dehydrated,P!==null))return Nj(s,a,w,u,P,f,l);if(x){x=u.fallback,w=a.mode,f=s.child,P=f.sibling;var R={mode:"hidden",children:u.children};return(w&1)===0&&a.child!==f?(u=a.child,u.childLanes=0,u.pendingProps=R,a.deletions=null):(u=Nr(f,R),u.subtreeFlags=f.subtreeFlags&14680064),P!==null?x=Nr(P,x):(x=la(x,w,l,null),x.flags|=2),x.return=a,u.return=a,u.sibling=x,a.child=u,u=x,x=a.child,w=s.child.memoizedState,w=w===null?eh(l):{baseLanes:w.baseLanes|l,cachePool:null,transitions:w.transitions},x.memoizedState=w,x.childLanes=s.childLanes&~l,a.memoizedState=Yd,u}return x=s.child,s=x.sibling,u=Nr(x,{mode:"visible",children:u.children}),(a.mode&1)===0&&(u.lanes=l),u.return=a,u.sibling=null,s!==null&&(l=a.deletions,l===null?(a.deletions=[s],a.flags|=16):l.push(s)),a.child=u,a.memoizedState=null,u}function th(s,a){return a=zc({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function kc(s,a,l,u){return u!==null&&Pd(u),ui(a,s.child,null,l),s=th(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function Nj(s,a,l,u,f,x,w){if(l)return a.flags&256?(a.flags&=-257,u=Zd(Error(r(422))),kc(s,a,w,u)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(x=u.fallback,f=a.mode,u=zc({mode:"visible",children:u.children},f,0,null),x=la(x,f,w,null),x.flags|=2,u.return=a,x.return=a,u.sibling=x,a.child=u,(a.mode&1)!==0&&ui(a,s.child,null,w),a.child.memoizedState=eh(w),a.memoizedState=Yd,x);if((a.mode&1)===0)return kc(s,a,w,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var P=u.dgst;return u=P,x=Error(r(419)),u=Zd(x,u,void 0),kc(s,a,w,u)}if(P=(w&s.childLanes)!==0,yn||P){if(u=Lt,u!==null){switch(w&-w){case 4:f=2;break;case 16:f=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(u.suspendedLanes|w))!==0?0:f,f!==0&&f!==x.retryLane&&(x.retryLane=f,$s(s,f),as(u,s,f,-1))}return gh(),u=Zd(Error(r(421))),kc(s,a,w,u)}return f.data==="$?"?(a.flags|=128,a.child=s.child,a=$j.bind(null,s),f._reactRetry=a,null):(s=x.treeContext,En=hr(f.nextSibling),Pn=a,pt=!0,ts=null,s!==null&&(An[Ln++]=qs,An[Ln++]=Os,An[Ln++]=Xr,qs=s.id,Os=s.overflow,Xr=a),a=th(a,u.children),a.flags|=4096,a)}function Cx(s,a,l){s.lanes|=a;var u=s.alternate;u!==null&&(u.lanes|=a),Td(s.return,a,l)}function nh(s,a,l,u,f){var x=s.memoizedState;x===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:f}:(x.isBackwards=a,x.rendering=null,x.renderingStartTime=0,x.last=u,x.tail=l,x.tailMode=f)}function _x(s,a,l){var u=a.pendingProps,f=u.revealOrder,x=u.tail;if(ln(s,a,u.children,l),u=bt.current,(u&2)!==0)u=u&1|2,a.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Cx(s,l,a);else if(s.tag===19)Cx(s,l,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}u&=1}if(dt(bt,u),(a.mode&1)===0)a.memoizedState=null;else switch(f){case"forwards":for(l=a.child,f=null;l!==null;)s=l.alternate,s!==null&&gc(s)===null&&(f=l),l=l.sibling;l=f,l===null?(f=a.child,a.child=null):(f=l.sibling,l.sibling=null),nh(a,!1,f,l,x);break;case"backwards":for(l=null,f=a.child,a.child=null;f!==null;){if(s=f.alternate,s!==null&&gc(s)===null){a.child=f;break}s=f.sibling,f.sibling=l,l=f,f=s}nh(a,!0,l,null,x);break;case"together":nh(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Sc(s,a){(a.mode&1)===0&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function As(s,a,l){if(s!==null&&(a.dependencies=s.dependencies),sa|=a.lanes,(l&a.childLanes)===0)return null;if(s!==null&&a.child!==s.child)throw Error(r(153));if(a.child!==null){for(s=a.child,l=Nr(s,s.pendingProps),a.child=l,l.return=a;s.sibling!==null;)s=s.sibling,l=l.sibling=Nr(s,s.pendingProps),l.return=a;l.sibling=null}return a.child}function kj(s,a,l){switch(a.tag){case 3:Nx(a),ci();break;case 5:Dp(a);break;case 1:vn(a.type)&&lc(a);break;case 4:Od(a,a.stateNode.containerInfo);break;case 10:var u=a.type._context,f=a.memoizedProps.value;dt(fc,u._currentValue),u._currentValue=f;break;case 13:if(u=a.memoizedState,u!==null)return u.dehydrated!==null?(dt(bt,bt.current&1),a.flags|=128,null):(l&a.child.childLanes)!==0?Sx(s,a,l):(dt(bt,bt.current&1),s=As(s,a,l),s!==null?s.sibling:null);dt(bt,bt.current&1);break;case 19:if(u=(l&a.childLanes)!==0,(s.flags&128)!==0){if(u)return _x(s,a,l);a.flags|=128}if(f=a.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),dt(bt,bt.current),u)break;return null;case 22:case 23:return a.lanes=0,jx(s,a,l)}return As(s,a,l)}var Px,sh,Ex,Rx;Px=function(s,a){for(var l=a.child;l!==null;){if(l.tag===5||l.tag===6)s.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},sh=function(){},Ex=function(s,a,l,u){var f=s.memoizedProps;if(f!==u){s=a.stateNode,ta(ps.current);var x=null;switch(l){case"input":f=zt(s,f),u=zt(s,u),x=[];break;case"select":f=se({},f,{value:void 0}),u=se({},u,{value:void 0}),x=[];break;case"textarea":f=Vr(s,f),u=Vr(s,u),x=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(s.onclick=rc)}Ua(l,u);var w;l=null;for(Q in f)if(!u.hasOwnProperty(Q)&&f.hasOwnProperty(Q)&&f[Q]!=null)if(Q==="style"){var P=f[Q];for(w in P)P.hasOwnProperty(w)&&(l||(l={}),l[w]="")}else Q!=="dangerouslySetInnerHTML"&&Q!=="children"&&Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(o.hasOwnProperty(Q)?x||(x=[]):(x=x||[]).push(Q,null));for(Q in u){var R=u[Q];if(P=f!=null?f[Q]:void 0,u.hasOwnProperty(Q)&&R!==P&&(R!=null||P!=null))if(Q==="style")if(P){for(w in P)!P.hasOwnProperty(w)||R&&R.hasOwnProperty(w)||(l||(l={}),l[w]="");for(w in R)R.hasOwnProperty(w)&&P[w]!==R[w]&&(l||(l={}),l[w]=R[w])}else l||(x||(x=[]),x.push(Q,l)),l=R;else Q==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,P=P?P.__html:void 0,R!=null&&P!==R&&(x=x||[]).push(Q,R)):Q==="children"?typeof R!="string"&&typeof R!="number"||(x=x||[]).push(Q,""+R):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&(o.hasOwnProperty(Q)?(R!=null&&Q==="onScroll"&&ht("scroll",s),x||P===R||(x=[])):(x=x||[]).push(Q,R))}l&&(x=x||[]).push("style",l);var Q=x;(a.updateQueue=Q)&&(a.flags|=4)}},Rx=function(s,a,l,u){l!==u&&(a.flags|=4)};function Fl(s,a){if(!pt)switch(s.tailMode){case"hidden":a=s.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?s.tail=null:l.sibling=null;break;case"collapsed":l=s.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:u.sibling=null}}function Gt(s){var a=s.alternate!==null&&s.alternate.child===s.child,l=0,u=0;if(a)for(var f=s.child;f!==null;)l|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=s,f=f.sibling;else for(f=s.child;f!==null;)l|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=s,f=f.sibling;return s.subtreeFlags|=u,s.childLanes=l,a}function Sj(s,a,l){var u=a.pendingProps;switch(Sd(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(a),null;case 1:return vn(a.type)&&ic(),Gt(a),null;case 3:return u=a.stateNode,fi(),ft(gn),ft(Wt),Ad(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(dc(a)?a.flags|=4:s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,ts!==null&&(mh(ts),ts=null))),sh(s,a),Gt(a),null;case 5:$d(a);var f=ta(Ol.current);if(l=a.type,s!==null&&a.stateNode!=null)Ex(s,a,l,u,f),s.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Gt(a),null}if(s=ta(ps.current),dc(a)){u=a.stateNode,l=a.type;var x=a.memoizedProps;switch(u[ms]=a,u[Rl]=x,s=(a.mode&1)!==0,l){case"dialog":ht("cancel",u),ht("close",u);break;case"iframe":case"object":case"embed":ht("load",u);break;case"video":case"audio":for(f=0;f<_l.length;f++)ht(_l[f],u);break;case"source":ht("error",u);break;case"img":case"image":case"link":ht("error",u),ht("load",u);break;case"details":ht("toggle",u);break;case"input":Io(u,x),ht("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!x.multiple},ht("invalid",u);break;case"textarea":La(u,x),ht("invalid",u)}Ua(l,x),f=null;for(var w in x)if(x.hasOwnProperty(w)){var P=x[w];w==="children"?typeof P=="string"?u.textContent!==P&&(x.suppressHydrationWarning!==!0&&sc(u.textContent,P,s),f=["children",P]):typeof P=="number"&&u.textContent!==""+P&&(x.suppressHydrationWarning!==!0&&sc(u.textContent,P,s),f=["children",""+P]):o.hasOwnProperty(w)&&P!=null&&w==="onScroll"&&ht("scroll",u)}switch(l){case"input":er(u),qo(u,x,!0);break;case"textarea":er(u),Oo(u);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(u.onclick=rc)}u=f,a.updateQueue=u,u!==null&&(a.flags|=4)}else{w=f.nodeType===9?f:f.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Fa(l)),s==="http://www.w3.org/1999/xhtml"?l==="script"?(s=w.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof u.is=="string"?s=w.createElement(l,{is:u.is}):(s=w.createElement(l),l==="select"&&(w=s,u.multiple?w.multiple=!0:u.size&&(w.size=u.size))):s=w.createElementNS(s,l),s[ms]=a,s[Rl]=u,Px(s,a,!1,!1),a.stateNode=s;e:{switch(w=Qa(l,u),l){case"dialog":ht("cancel",s),ht("close",s),f=u;break;case"iframe":case"object":case"embed":ht("load",s),f=u;break;case"video":case"audio":for(f=0;f<_l.length;f++)ht(_l[f],s);f=u;break;case"source":ht("error",s),f=u;break;case"img":case"image":case"link":ht("error",s),ht("load",s),f=u;break;case"details":ht("toggle",s),f=u;break;case"input":Io(s,u),f=zt(s,u),ht("invalid",s);break;case"option":f=u;break;case"select":s._wrapperState={wasMultiple:!!u.multiple},f=se({},u,{value:void 0}),ht("invalid",s);break;case"textarea":La(s,u),f=Vr(s,u),ht("invalid",s);break;default:f=u}Ua(l,f),P=f;for(x in P)if(P.hasOwnProperty(x)){var R=P[x];x==="style"?il(s,R):x==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&al(s,R)):x==="children"?typeof R=="string"?(l!=="textarea"||R!=="")&&nr(s,R):typeof R=="number"&&nr(s,""+R):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(o.hasOwnProperty(x)?R!=null&&x==="onScroll"&&ht("scroll",s):R!=null&&q(s,x,R,w))}switch(l){case"input":er(s),qo(s,u,!1);break;case"textarea":er(s),Oo(s);break;case"option":u.value!=null&&s.setAttribute("value",""+Je(u.value));break;case"select":s.multiple=!!u.multiple,x=u.value,x!=null?xn(s,!!u.multiple,x,!1):u.defaultValue!=null&&xn(s,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(s.onclick=rc)}switch(l){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Gt(a),null;case 6:if(s&&a.stateNode!=null)Rx(s,a,s.memoizedProps,u);else{if(typeof u!="string"&&a.stateNode===null)throw Error(r(166));if(l=ta(Ol.current),ta(ps.current),dc(a)){if(u=a.stateNode,l=a.memoizedProps,u[ms]=a,(x=u.nodeValue!==l)&&(s=Pn,s!==null))switch(s.tag){case 3:sc(u.nodeValue,l,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&sc(u.nodeValue,l,(s.mode&1)!==0)}x&&(a.flags|=4)}else u=(l.nodeType===9?l:l.ownerDocument).createTextNode(u),u[ms]=a,a.stateNode=u}return Gt(a),null;case 13:if(ft(bt),u=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(pt&&En!==null&&(a.mode&1)!==0&&(a.flags&128)===0)Ip(),ci(),a.flags|=98560,x=!1;else if(x=dc(a),u!==null&&u.dehydrated!==null){if(s===null){if(!x)throw Error(r(318));if(x=a.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[ms]=a}else ci(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Gt(a),x=!1}else ts!==null&&(mh(ts),ts=null),x=!0;if(!x)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=l,a):(u=u!==null,u!==(s!==null&&s.memoizedState!==null)&&u&&(a.child.flags|=8192,(a.mode&1)!==0&&(s===null||(bt.current&1)!==0?qt===0&&(qt=3):gh())),a.updateQueue!==null&&(a.flags|=4),Gt(a),null);case 4:return fi(),sh(s,a),s===null&&Pl(a.stateNode.containerInfo),Gt(a),null;case 10:return Md(a.type._context),Gt(a),null;case 17:return vn(a.type)&&ic(),Gt(a),null;case 19:if(ft(bt),x=a.memoizedState,x===null)return Gt(a),null;if(u=(a.flags&128)!==0,w=x.rendering,w===null)if(u)Fl(x,!1);else{if(qt!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(w=gc(s),w!==null){for(a.flags|=128,Fl(x,!1),u=w.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),a.subtreeFlags=0,u=l,l=a.child;l!==null;)x=l,s=u,x.flags&=14680066,w=x.alternate,w===null?(x.childLanes=0,x.lanes=s,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=w.childLanes,x.lanes=w.lanes,x.child=w.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=w.memoizedProps,x.memoizedState=w.memoizedState,x.updateQueue=w.updateQueue,x.type=w.type,s=w.dependencies,x.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),l=l.sibling;return dt(bt,bt.current&1|2),a.child}s=s.sibling}x.tail!==null&&Pt()>gi&&(a.flags|=128,u=!0,Fl(x,!1),a.lanes=4194304)}else{if(!u)if(s=gc(w),s!==null){if(a.flags|=128,u=!0,l=s.updateQueue,l!==null&&(a.updateQueue=l,a.flags|=4),Fl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!pt)return Gt(a),null}else 2*Pt()-x.renderingStartTime>gi&&l!==1073741824&&(a.flags|=128,u=!0,Fl(x,!1),a.lanes=4194304);x.isBackwards?(w.sibling=a.child,a.child=w):(l=x.last,l!==null?l.sibling=w:a.child=w,x.last=w)}return x.tail!==null?(a=x.tail,x.rendering=a,x.tail=a.sibling,x.renderingStartTime=Pt(),a.sibling=null,l=bt.current,dt(bt,u?l&1|2:l&1),a):(Gt(a),null);case 22:case 23:return xh(),u=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==u&&(a.flags|=8192),u&&(a.mode&1)!==0?(Rn&1073741824)!==0&&(Gt(a),a.subtreeFlags&6&&(a.flags|=8192)):Gt(a),null;case 24:return null;case 25:return null}throw Error(r(156,a.tag))}function Cj(s,a){switch(Sd(a),a.tag){case 1:return vn(a.type)&&ic(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return fi(),ft(gn),ft(Wt),Ad(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 5:return $d(a),null;case 13:if(ft(bt),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(r(340));ci()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return ft(bt),null;case 4:return fi(),null;case 10:return Md(a.type._context),null;case 22:case 23:return xh(),null;case 24:return null;default:return null}}var Cc=!1,Jt=!1,_j=typeof WeakSet=="function"?WeakSet:Set,xe=null;function pi(s,a){var l=s.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(u){St(s,a,u)}else l.current=null}function rh(s,a,l){try{l()}catch(u){St(s,a,u)}}var Mx=!1;function Pj(s,a){if(xd=Ho,s=cp(),od(s)){if("selectionStart"in s)var l={start:s.selectionStart,end:s.selectionEnd};else e:{l=(l=s.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var f=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{l.nodeType,x.nodeType}catch{l=null;break e}var w=0,P=-1,R=-1,Q=0,G=0,X=s,Z=null;t:for(;;){for(var de;X!==l||f!==0&&X.nodeType!==3||(P=w+f),X!==x||u!==0&&X.nodeType!==3||(R=w+u),X.nodeType===3&&(w+=X.nodeValue.length),(de=X.firstChild)!==null;)Z=X,X=de;for(;;){if(X===s)break t;if(Z===l&&++Q===f&&(P=w),Z===x&&++G===u&&(R=w),(de=X.nextSibling)!==null)break;X=Z,Z=X.parentNode}X=de}l=P===-1||R===-1?null:{start:P,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(gd={focusedElem:s,selectionRange:l},Ho=!1,xe=a;xe!==null;)if(a=xe,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,xe=s;else for(;xe!==null;){a=xe;try{var ve=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var je=ve.memoizedProps,Et=ve.memoizedState,L=a.stateNode,I=L.getSnapshotBeforeUpdate(a.elementType===a.type?je:ns(a.type,je),Et);L.__reactInternalSnapshotBeforeUpdate=I}break;case 3:var D=a.stateNode.containerInfo;D.nodeType===1?D.textContent="":D.nodeType===9&&D.documentElement&&D.removeChild(D.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ne){St(a,a.return,ne)}if(s=a.sibling,s!==null){s.return=a.return,xe=s;break}xe=a.return}return ve=Mx,Mx=!1,ve}function Dl(s,a,l){var u=a.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&s)===s){var x=f.destroy;f.destroy=void 0,x!==void 0&&rh(a,l,x)}f=f.next}while(f!==u)}}function _c(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var l=a=a.next;do{if((l.tag&s)===s){var u=l.create;l.destroy=u()}l=l.next}while(l!==a)}}function ah(s){var a=s.ref;if(a!==null){var l=s.stateNode;switch(s.tag){case 5:s=l;break;default:s=l}typeof a=="function"?a(s):a.current=s}}function Tx(s){var a=s.alternate;a!==null&&(s.alternate=null,Tx(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[ms],delete a[Rl],delete a[bd],delete a[uj],delete a[dj])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Ix(s){return s.tag===5||s.tag===3||s.tag===4}function qx(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Ix(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function ih(s,a,l){var u=s.tag;if(u===5||u===6)s=s.stateNode,a?l.nodeType===8?l.parentNode.insertBefore(s,a):l.insertBefore(s,a):(l.nodeType===8?(a=l.parentNode,a.insertBefore(s,l)):(a=l,a.appendChild(s)),l=l._reactRootContainer,l!=null||a.onclick!==null||(a.onclick=rc));else if(u!==4&&(s=s.child,s!==null))for(ih(s,a,l),s=s.sibling;s!==null;)ih(s,a,l),s=s.sibling}function lh(s,a,l){var u=s.tag;if(u===5||u===6)s=s.stateNode,a?l.insertBefore(s,a):l.appendChild(s);else if(u!==4&&(s=s.child,s!==null))for(lh(s,a,l),s=s.sibling;s!==null;)lh(s,a,l),s=s.sibling}var Vt=null,ss=!1;function vr(s,a,l){for(l=l.child;l!==null;)Ox(s,a,l),l=l.sibling}function Ox(s,a,l){if(fs&&typeof fs.onCommitFiberUnmount=="function")try{fs.onCommitFiberUnmount(Fo,l)}catch{}switch(l.tag){case 5:Jt||pi(l,a);case 6:var u=Vt,f=ss;Vt=null,vr(s,a,l),Vt=u,ss=f,Vt!==null&&(ss?(s=Vt,l=l.stateNode,s.nodeType===8?s.parentNode.removeChild(l):s.removeChild(l)):Vt.removeChild(l.stateNode));break;case 18:Vt!==null&&(ss?(s=Vt,l=l.stateNode,s.nodeType===8?jd(s.parentNode,l):s.nodeType===1&&jd(s,l),yl(s)):jd(Vt,l.stateNode));break;case 4:u=Vt,f=ss,Vt=l.stateNode.containerInfo,ss=!0,vr(s,a,l),Vt=u,ss=f;break;case 0:case 11:case 14:case 15:if(!Jt&&(u=l.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var x=f,w=x.destroy;x=x.tag,w!==void 0&&((x&2)!==0||(x&4)!==0)&&rh(l,a,w),f=f.next}while(f!==u)}vr(s,a,l);break;case 1:if(!Jt&&(pi(l,a),u=l.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=l.memoizedProps,u.state=l.memoizedState,u.componentWillUnmount()}catch(P){St(l,a,P)}vr(s,a,l);break;case 21:vr(s,a,l);break;case 22:l.mode&1?(Jt=(u=Jt)||l.memoizedState!==null,vr(s,a,l),Jt=u):vr(s,a,l);break;default:vr(s,a,l)}}function $x(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var l=s.stateNode;l===null&&(l=s.stateNode=new _j),a.forEach(function(u){var f=zj.bind(null,s,u);l.has(u)||(l.add(u),u.then(f,f))})}}function rs(s,a){var l=a.deletions;if(l!==null)for(var u=0;u<l.length;u++){var f=l[u];try{var x=s,w=a,P=w;e:for(;P!==null;){switch(P.tag){case 5:Vt=P.stateNode,ss=!1;break e;case 3:Vt=P.stateNode.containerInfo,ss=!0;break e;case 4:Vt=P.stateNode.containerInfo,ss=!0;break e}P=P.return}if(Vt===null)throw Error(r(160));Ox(x,w,f),Vt=null,ss=!1;var R=f.alternate;R!==null&&(R.return=null),f.return=null}catch(Q){St(f,a,Q)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)zx(a,s),a=a.sibling}function zx(s,a){var l=s.alternate,u=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(rs(a,s),gs(s),u&4){try{Dl(3,s,s.return),_c(3,s)}catch(je){St(s,s.return,je)}try{Dl(5,s,s.return)}catch(je){St(s,s.return,je)}}break;case 1:rs(a,s),gs(s),u&512&&l!==null&&pi(l,l.return);break;case 5:if(rs(a,s),gs(s),u&512&&l!==null&&pi(l,l.return),s.flags&32){var f=s.stateNode;try{nr(f,"")}catch(je){St(s,s.return,je)}}if(u&4&&(f=s.stateNode,f!=null)){var x=s.memoizedProps,w=l!==null?l.memoizedProps:x,P=s.type,R=s.updateQueue;if(s.updateQueue=null,R!==null)try{P==="input"&&x.type==="radio"&&x.name!=null&&za(f,x),Qa(P,w);var Q=Qa(P,x);for(w=0;w<R.length;w+=2){var G=R[w],X=R[w+1];G==="style"?il(f,X):G==="dangerouslySetInnerHTML"?al(f,X):G==="children"?nr(f,X):q(f,G,X,Q)}switch(P){case"input":Cn(f,x);break;case"textarea":an(f,x);break;case"select":var Z=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!x.multiple;var de=x.value;de!=null?xn(f,!!x.multiple,de,!1):Z!==!!x.multiple&&(x.defaultValue!=null?xn(f,!!x.multiple,x.defaultValue,!0):xn(f,!!x.multiple,x.multiple?[]:"",!1))}f[Rl]=x}catch(je){St(s,s.return,je)}}break;case 6:if(rs(a,s),gs(s),u&4){if(s.stateNode===null)throw Error(r(162));f=s.stateNode,x=s.memoizedProps;try{f.nodeValue=x}catch(je){St(s,s.return,je)}}break;case 3:if(rs(a,s),gs(s),u&4&&l!==null&&l.memoizedState.isDehydrated)try{yl(a.containerInfo)}catch(je){St(s,s.return,je)}break;case 4:rs(a,s),gs(s);break;case 13:rs(a,s),gs(s),f=s.child,f.flags&8192&&(x=f.memoizedState!==null,f.stateNode.isHidden=x,!x||f.alternate!==null&&f.alternate.memoizedState!==null||(uh=Pt())),u&4&&$x(s);break;case 22:if(G=l!==null&&l.memoizedState!==null,s.mode&1?(Jt=(Q=Jt)||G,rs(a,s),Jt=Q):rs(a,s),gs(s),u&8192){if(Q=s.memoizedState!==null,(s.stateNode.isHidden=Q)&&!G&&(s.mode&1)!==0)for(xe=s,G=s.child;G!==null;){for(X=xe=G;xe!==null;){switch(Z=xe,de=Z.child,Z.tag){case 0:case 11:case 14:case 15:Dl(4,Z,Z.return);break;case 1:pi(Z,Z.return);var ve=Z.stateNode;if(typeof ve.componentWillUnmount=="function"){u=Z,l=Z.return;try{a=u,ve.props=a.memoizedProps,ve.state=a.memoizedState,ve.componentWillUnmount()}catch(je){St(u,l,je)}}break;case 5:pi(Z,Z.return);break;case 22:if(Z.memoizedState!==null){Fx(X);continue}}de!==null?(de.return=Z,xe=de):Fx(X)}G=G.sibling}e:for(G=null,X=s;;){if(X.tag===5){if(G===null){G=X;try{f=X.stateNode,Q?(x=f.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(P=X.stateNode,R=X.memoizedProps.style,w=R!=null&&R.hasOwnProperty("display")?R.display:null,P.style.display=Kr("display",w))}catch(je){St(s,s.return,je)}}}else if(X.tag===6){if(G===null)try{X.stateNode.nodeValue=Q?"":X.memoizedProps}catch(je){St(s,s.return,je)}}else if((X.tag!==22&&X.tag!==23||X.memoizedState===null||X===s)&&X.child!==null){X.child.return=X,X=X.child;continue}if(X===s)break e;for(;X.sibling===null;){if(X.return===null||X.return===s)break e;G===X&&(G=null),X=X.return}G===X&&(G=null),X.sibling.return=X.return,X=X.sibling}}break;case 19:rs(a,s),gs(s),u&4&&$x(s);break;case 21:break;default:rs(a,s),gs(s)}}function gs(s){var a=s.flags;if(a&2){try{e:{for(var l=s.return;l!==null;){if(Ix(l)){var u=l;break e}l=l.return}throw Error(r(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(nr(f,""),u.flags&=-33);var x=qx(s);lh(s,x,f);break;case 3:case 4:var w=u.stateNode.containerInfo,P=qx(s);ih(s,P,w);break;default:throw Error(r(161))}}catch(R){St(s,s.return,R)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function Ej(s,a,l){xe=s,Ax(s)}function Ax(s,a,l){for(var u=(s.mode&1)!==0;xe!==null;){var f=xe,x=f.child;if(f.tag===22&&u){var w=f.memoizedState!==null||Cc;if(!w){var P=f.alternate,R=P!==null&&P.memoizedState!==null||Jt;P=Cc;var Q=Jt;if(Cc=w,(Jt=R)&&!Q)for(xe=f;xe!==null;)w=xe,R=w.child,w.tag===22&&w.memoizedState!==null?Dx(f):R!==null?(R.return=w,xe=R):Dx(f);for(;x!==null;)xe=x,Ax(x),x=x.sibling;xe=f,Cc=P,Jt=Q}Lx(s)}else(f.subtreeFlags&8772)!==0&&x!==null?(x.return=f,xe=x):Lx(s)}}function Lx(s){for(;xe!==null;){var a=xe;if((a.flags&8772)!==0){var l=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Jt||_c(5,a);break;case 1:var u=a.stateNode;if(a.flags&4&&!Jt)if(l===null)u.componentDidMount();else{var f=a.elementType===a.type?l.memoizedProps:ns(a.type,l.memoizedProps);u.componentDidUpdate(f,l.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var x=a.updateQueue;x!==null&&Fp(a,x,u);break;case 3:var w=a.updateQueue;if(w!==null){if(l=null,a.child!==null)switch(a.child.tag){case 5:l=a.child.stateNode;break;case 1:l=a.child.stateNode}Fp(a,w,l)}break;case 5:var P=a.stateNode;if(l===null&&a.flags&4){l=P;var R=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&l.focus();break;case"img":R.src&&(l.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var Q=a.alternate;if(Q!==null){var G=Q.memoizedState;if(G!==null){var X=G.dehydrated;X!==null&&yl(X)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Jt||a.flags&512&&ah(a)}catch(Z){St(a,a.return,Z)}}if(a===s){xe=null;break}if(l=a.sibling,l!==null){l.return=a.return,xe=l;break}xe=a.return}}function Fx(s){for(;xe!==null;){var a=xe;if(a===s){xe=null;break}var l=a.sibling;if(l!==null){l.return=a.return,xe=l;break}xe=a.return}}function Dx(s){for(;xe!==null;){var a=xe;try{switch(a.tag){case 0:case 11:case 15:var l=a.return;try{_c(4,a)}catch(R){St(a,l,R)}break;case 1:var u=a.stateNode;if(typeof u.componentDidMount=="function"){var f=a.return;try{u.componentDidMount()}catch(R){St(a,f,R)}}var x=a.return;try{ah(a)}catch(R){St(a,x,R)}break;case 5:var w=a.return;try{ah(a)}catch(R){St(a,w,R)}}}catch(R){St(a,a.return,R)}if(a===s){xe=null;break}var P=a.sibling;if(P!==null){P.return=a.return,xe=P;break}xe=a.return}}var Rj=Math.ceil,Pc=E.ReactCurrentDispatcher,oh=E.ReactCurrentOwner,Un=E.ReactCurrentBatchConfig,Xe=0,Lt=null,Rt=null,Ht=0,Rn=0,xi=fr(0),qt=0,Ul=null,sa=0,Ec=0,ch=0,Ql=null,jn=null,uh=0,gi=1/0,Ls=null,Rc=!1,dh=null,yr=null,Mc=!1,jr=null,Tc=0,Bl=0,hh=null,Ic=-1,qc=0;function on(){return(Xe&6)!==0?Pt():Ic!==-1?Ic:Ic=Pt()}function br(s){return(s.mode&1)===0?1:(Xe&2)!==0&&Ht!==0?Ht&-Ht:fj.transition!==null?(qc===0&&(qc=qm()),qc):(s=lt,s!==0||(s=window.event,s=s===void 0?16:Qm(s.type)),s)}function as(s,a,l,u){if(50<Bl)throw Bl=0,hh=null,Error(r(185));ml(s,l,u),((Xe&2)===0||s!==Lt)&&(s===Lt&&((Xe&2)===0&&(Ec|=l),qt===4&&wr(s,Ht)),bn(s,u),l===1&&Xe===0&&(a.mode&1)===0&&(gi=Pt()+500,oc&&pr()))}function bn(s,a){var l=s.callbackNode;f1(s,a);var u=Qo(s,s===Lt?Ht:0);if(u===0)l!==null&&Mm(l),s.callbackNode=null,s.callbackPriority=0;else if(a=u&-u,s.callbackPriority!==a){if(l!=null&&Mm(l),a===1)s.tag===0?hj(Qx.bind(null,s)):Pp(Qx.bind(null,s)),oj(function(){(Xe&6)===0&&pr()}),l=null;else{switch(Om(u)){case 1:l=Vu;break;case 4:l=Tm;break;case 16:l=Lo;break;case 536870912:l=Im;break;default:l=Lo}l=Jx(l,Ux.bind(null,s))}s.callbackPriority=a,s.callbackNode=l}}function Ux(s,a){if(Ic=-1,qc=0,(Xe&6)!==0)throw Error(r(327));var l=s.callbackNode;if(vi()&&s.callbackNode!==l)return null;var u=Qo(s,s===Lt?Ht:0);if(u===0)return null;if((u&30)!==0||(u&s.expiredLanes)!==0||a)a=Oc(s,u);else{a=u;var f=Xe;Xe|=2;var x=Vx();(Lt!==s||Ht!==a)&&(Ls=null,gi=Pt()+500,aa(s,a));do try{Ij();break}catch(P){Bx(s,P)}while(!0);Rd(),Pc.current=x,Xe=f,Rt!==null?a=0:(Lt=null,Ht=0,a=qt)}if(a!==0){if(a===2&&(f=Hu(s),f!==0&&(u=f,a=fh(s,f))),a===1)throw l=Ul,aa(s,0),wr(s,u),bn(s,Pt()),l;if(a===6)wr(s,u);else{if(f=s.current.alternate,(u&30)===0&&!Mj(f)&&(a=Oc(s,u),a===2&&(x=Hu(s),x!==0&&(u=x,a=fh(s,x))),a===1))throw l=Ul,aa(s,0),wr(s,u),bn(s,Pt()),l;switch(s.finishedWork=f,s.finishedLanes=u,a){case 0:case 1:throw Error(r(345));case 2:ia(s,jn,Ls);break;case 3:if(wr(s,u),(u&130023424)===u&&(a=uh+500-Pt(),10<a)){if(Qo(s,0)!==0)break;if(f=s.suspendedLanes,(f&u)!==u){on(),s.pingedLanes|=s.suspendedLanes&f;break}s.timeoutHandle=yd(ia.bind(null,s,jn,Ls),a);break}ia(s,jn,Ls);break;case 4:if(wr(s,u),(u&4194240)===u)break;for(a=s.eventTimes,f=-1;0<u;){var w=31-Yn(u);x=1<<w,w=a[w],w>f&&(f=w),u&=~x}if(u=f,u=Pt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Rj(u/1960))-u,10<u){s.timeoutHandle=yd(ia.bind(null,s,jn,Ls),u);break}ia(s,jn,Ls);break;case 5:ia(s,jn,Ls);break;default:throw Error(r(329))}}}return bn(s,Pt()),s.callbackNode===l?Ux.bind(null,s):null}function fh(s,a){var l=Ql;return s.current.memoizedState.isDehydrated&&(aa(s,a).flags|=256),s=Oc(s,a),s!==2&&(a=jn,jn=l,a!==null&&mh(a)),s}function mh(s){jn===null?jn=s:jn.push.apply(jn,s)}function Mj(s){for(var a=s;;){if(a.flags&16384){var l=a.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var u=0;u<l.length;u++){var f=l[u],x=f.getSnapshot;f=f.value;try{if(!es(x(),f))return!1}catch{return!1}}}if(l=a.child,a.subtreeFlags&16384&&l!==null)l.return=a,a=l;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function wr(s,a){for(a&=~ch,a&=~Ec,s.suspendedLanes|=a,s.pingedLanes&=~a,s=s.expirationTimes;0<a;){var l=31-Yn(a),u=1<<l;s[l]=-1,a&=~u}}function Qx(s){if((Xe&6)!==0)throw Error(r(327));vi();var a=Qo(s,0);if((a&1)===0)return bn(s,Pt()),null;var l=Oc(s,a);if(s.tag!==0&&l===2){var u=Hu(s);u!==0&&(a=u,l=fh(s,u))}if(l===1)throw l=Ul,aa(s,0),wr(s,a),bn(s,Pt()),l;if(l===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=a,ia(s,jn,Ls),bn(s,Pt()),null}function ph(s,a){var l=Xe;Xe|=1;try{return s(a)}finally{Xe=l,Xe===0&&(gi=Pt()+500,oc&&pr())}}function ra(s){jr!==null&&jr.tag===0&&(Xe&6)===0&&vi();var a=Xe;Xe|=1;var l=Un.transition,u=lt;try{if(Un.transition=null,lt=1,s)return s()}finally{lt=u,Un.transition=l,Xe=a,(Xe&6)===0&&pr()}}function xh(){Rn=xi.current,ft(xi)}function aa(s,a){s.finishedWork=null,s.finishedLanes=0;var l=s.timeoutHandle;if(l!==-1&&(s.timeoutHandle=-1,lj(l)),Rt!==null)for(l=Rt.return;l!==null;){var u=l;switch(Sd(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&ic();break;case 3:fi(),ft(gn),ft(Wt),Ad();break;case 5:$d(u);break;case 4:fi();break;case 13:ft(bt);break;case 19:ft(bt);break;case 10:Md(u.type._context);break;case 22:case 23:xh()}l=l.return}if(Lt=s,Rt=s=Nr(s.current,null),Ht=Rn=a,qt=0,Ul=null,ch=Ec=sa=0,jn=Ql=null,ea!==null){for(a=0;a<ea.length;a++)if(l=ea[a],u=l.interleaved,u!==null){l.interleaved=null;var f=u.next,x=l.pending;if(x!==null){var w=x.next;x.next=f,u.next=w}l.pending=u}ea=null}return s}function Bx(s,a){do{var l=Rt;try{if(Rd(),vc.current=wc,yc){for(var u=wt.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}yc=!1}if(na=0,At=It=wt=null,$l=!1,zl=0,oh.current=null,l===null||l.return===null){qt=1,Ul=a,Rt=null;break}e:{var x=s,w=l.return,P=l,R=a;if(a=Ht,P.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var Q=R,G=P,X=G.tag;if((G.mode&1)===0&&(X===0||X===11||X===15)){var Z=G.alternate;Z?(G.updateQueue=Z.updateQueue,G.memoizedState=Z.memoizedState,G.lanes=Z.lanes):(G.updateQueue=null,G.memoizedState=null)}var de=px(w);if(de!==null){de.flags&=-257,xx(de,w,P,x,a),de.mode&1&&mx(x,Q,a),a=de,R=Q;var ve=a.updateQueue;if(ve===null){var je=new Set;je.add(R),a.updateQueue=je}else ve.add(R);break e}else{if((a&1)===0){mx(x,Q,a),gh();break e}R=Error(r(426))}}else if(pt&&P.mode&1){var Et=px(w);if(Et!==null){(Et.flags&65536)===0&&(Et.flags|=256),xx(Et,w,P,x,a),Pd(mi(R,P));break e}}x=R=mi(R,P),qt!==4&&(qt=2),Ql===null?Ql=[x]:Ql.push(x),x=w;do{switch(x.tag){case 3:x.flags|=65536,a&=-a,x.lanes|=a;var L=hx(x,R,a);Lp(x,L);break e;case 1:P=R;var I=x.type,D=x.stateNode;if((x.flags&128)===0&&(typeof I.getDerivedStateFromError=="function"||D!==null&&typeof D.componentDidCatch=="function"&&(yr===null||!yr.has(D)))){x.flags|=65536,a&=-a,x.lanes|=a;var ne=fx(x,P,a);Lp(x,ne);break e}}x=x.return}while(x!==null)}Kx(l)}catch(ke){a=ke,Rt===l&&l!==null&&(Rt=l=l.return);continue}break}while(!0)}function Vx(){var s=Pc.current;return Pc.current=wc,s===null?wc:s}function gh(){(qt===0||qt===3||qt===2)&&(qt=4),Lt===null||(sa&268435455)===0&&(Ec&268435455)===0||wr(Lt,Ht)}function Oc(s,a){var l=Xe;Xe|=2;var u=Vx();(Lt!==s||Ht!==a)&&(Ls=null,aa(s,a));do try{Tj();break}catch(f){Bx(s,f)}while(!0);if(Rd(),Xe=l,Pc.current=u,Rt!==null)throw Error(r(261));return Lt=null,Ht=0,qt}function Tj(){for(;Rt!==null;)Hx(Rt)}function Ij(){for(;Rt!==null&&!r1();)Hx(Rt)}function Hx(s){var a=Gx(s.alternate,s,Rn);s.memoizedProps=s.pendingProps,a===null?Kx(s):Rt=a,oh.current=null}function Kx(s){var a=s;do{var l=a.alternate;if(s=a.return,(a.flags&32768)===0){if(l=Sj(l,a,Rn),l!==null){Rt=l;return}}else{if(l=Cj(l,a),l!==null){l.flags&=32767,Rt=l;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{qt=6,Rt=null;return}}if(a=a.sibling,a!==null){Rt=a;return}Rt=a=s}while(a!==null);qt===0&&(qt=5)}function ia(s,a,l){var u=lt,f=Un.transition;try{Un.transition=null,lt=1,qj(s,a,l,u)}finally{Un.transition=f,lt=u}return null}function qj(s,a,l,u){do vi();while(jr!==null);if((Xe&6)!==0)throw Error(r(327));l=s.finishedWork;var f=s.finishedLanes;if(l===null)return null;if(s.finishedWork=null,s.finishedLanes=0,l===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var x=l.lanes|l.childLanes;if(m1(s,x),s===Lt&&(Rt=Lt=null,Ht=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Mc||(Mc=!0,Jx(Lo,function(){return vi(),null})),x=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||x){x=Un.transition,Un.transition=null;var w=lt;lt=1;var P=Xe;Xe|=4,oh.current=null,Pj(s,l),zx(l,s),ej(gd),Ho=!!xd,gd=xd=null,s.current=l,Ej(l),a1(),Xe=P,lt=w,Un.transition=x}else s.current=l;if(Mc&&(Mc=!1,jr=s,Tc=f),x=s.pendingLanes,x===0&&(yr=null),o1(l.stateNode),bn(s,Pt()),a!==null)for(u=s.onRecoverableError,l=0;l<a.length;l++)f=a[l],u(f.value,{componentStack:f.stack,digest:f.digest});if(Rc)throw Rc=!1,s=dh,dh=null,s;return(Tc&1)!==0&&s.tag!==0&&vi(),x=s.pendingLanes,(x&1)!==0?s===hh?Bl++:(Bl=0,hh=s):Bl=0,pr(),null}function vi(){if(jr!==null){var s=Om(Tc),a=Un.transition,l=lt;try{if(Un.transition=null,lt=16>s?16:s,jr===null)var u=!1;else{if(s=jr,jr=null,Tc=0,(Xe&6)!==0)throw Error(r(331));var f=Xe;for(Xe|=4,xe=s.current;xe!==null;){var x=xe,w=x.child;if((xe.flags&16)!==0){var P=x.deletions;if(P!==null){for(var R=0;R<P.length;R++){var Q=P[R];for(xe=Q;xe!==null;){var G=xe;switch(G.tag){case 0:case 11:case 15:Dl(8,G,x)}var X=G.child;if(X!==null)X.return=G,xe=X;else for(;xe!==null;){G=xe;var Z=G.sibling,de=G.return;if(Tx(G),G===Q){xe=null;break}if(Z!==null){Z.return=de,xe=Z;break}xe=de}}}var ve=x.alternate;if(ve!==null){var je=ve.child;if(je!==null){ve.child=null;do{var Et=je.sibling;je.sibling=null,je=Et}while(je!==null)}}xe=x}}if((x.subtreeFlags&2064)!==0&&w!==null)w.return=x,xe=w;else e:for(;xe!==null;){if(x=xe,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:Dl(9,x,x.return)}var L=x.sibling;if(L!==null){L.return=x.return,xe=L;break e}xe=x.return}}var I=s.current;for(xe=I;xe!==null;){w=xe;var D=w.child;if((w.subtreeFlags&2064)!==0&&D!==null)D.return=w,xe=D;else e:for(w=I;xe!==null;){if(P=xe,(P.flags&2048)!==0)try{switch(P.tag){case 0:case 11:case 15:_c(9,P)}}catch(ke){St(P,P.return,ke)}if(P===w){xe=null;break e}var ne=P.sibling;if(ne!==null){ne.return=P.return,xe=ne;break e}xe=P.return}}if(Xe=f,pr(),fs&&typeof fs.onPostCommitFiberRoot=="function")try{fs.onPostCommitFiberRoot(Fo,s)}catch{}u=!0}return u}finally{lt=l,Un.transition=a}}return!1}function Wx(s,a,l){a=mi(l,a),a=hx(s,a,1),s=gr(s,a,1),a=on(),s!==null&&(ml(s,1,a),bn(s,a))}function St(s,a,l){if(s.tag===3)Wx(s,s,l);else for(;a!==null;){if(a.tag===3){Wx(a,s,l);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(yr===null||!yr.has(u))){s=mi(l,s),s=fx(a,s,1),a=gr(a,s,1),s=on(),a!==null&&(ml(a,1,s),bn(a,s));break}}a=a.return}}function Oj(s,a,l){var u=s.pingCache;u!==null&&u.delete(a),a=on(),s.pingedLanes|=s.suspendedLanes&l,Lt===s&&(Ht&l)===l&&(qt===4||qt===3&&(Ht&130023424)===Ht&&500>Pt()-uh?aa(s,0):ch|=l),bn(s,a)}function Zx(s,a){a===0&&((s.mode&1)===0?a=1:(a=Uo,Uo<<=1,(Uo&130023424)===0&&(Uo=4194304)));var l=on();s=$s(s,a),s!==null&&(ml(s,a,l),bn(s,l))}function $j(s){var a=s.memoizedState,l=0;a!==null&&(l=a.retryLane),Zx(s,l)}function zj(s,a){var l=0;switch(s.tag){case 13:var u=s.stateNode,f=s.memoizedState;f!==null&&(l=f.retryLane);break;case 19:u=s.stateNode;break;default:throw Error(r(314))}u!==null&&u.delete(a),Zx(s,l)}var Gx;Gx=function(s,a,l){if(s!==null)if(s.memoizedProps!==a.pendingProps||gn.current)yn=!0;else{if((s.lanes&l)===0&&(a.flags&128)===0)return yn=!1,kj(s,a,l);yn=(s.flags&131072)!==0}else yn=!1,pt&&(a.flags&1048576)!==0&&Ep(a,uc,a.index);switch(a.lanes=0,a.tag){case 2:var u=a.type;Sc(s,a),s=a.pendingProps;var f=ii(a,Wt.current);hi(a,l),f=Dd(null,a,u,s,f,l);var x=Ud();return a.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,vn(u)?(x=!0,lc(a)):x=!1,a.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,qd(a),f.updater=Nc,a.stateNode=f,f._reactInternals=a,Wd(a,u,s,l),a=Xd(null,a,u,!0,x,l)):(a.tag=0,pt&&x&&kd(a),ln(null,a,f,l),a=a.child),a;case 16:u=a.elementType;e:{switch(Sc(s,a),s=a.pendingProps,f=u._init,u=f(u._payload),a.type=u,f=a.tag=Lj(u),s=ns(u,s),f){case 0:a=Jd(null,a,u,s,l);break e;case 1:a=wx(null,a,u,s,l);break e;case 11:a=gx(null,a,u,s,l);break e;case 14:a=vx(null,a,u,ns(u.type,s),l);break e}throw Error(r(306,u,""))}return a;case 0:return u=a.type,f=a.pendingProps,f=a.elementType===u?f:ns(u,f),Jd(s,a,u,f,l);case 1:return u=a.type,f=a.pendingProps,f=a.elementType===u?f:ns(u,f),wx(s,a,u,f,l);case 3:e:{if(Nx(a),s===null)throw Error(r(387));u=a.pendingProps,x=a.memoizedState,f=x.element,Ap(s,a),xc(a,u,null,l);var w=a.memoizedState;if(u=w.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){f=mi(Error(r(423)),a),a=kx(s,a,u,l,f);break e}else if(u!==f){f=mi(Error(r(424)),a),a=kx(s,a,u,l,f);break e}else for(En=hr(a.stateNode.containerInfo.firstChild),Pn=a,pt=!0,ts=null,l=$p(a,null,u,l),a.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ci(),u===f){a=As(s,a,l);break e}ln(s,a,u,l)}a=a.child}return a;case 5:return Dp(a),s===null&&_d(a),u=a.type,f=a.pendingProps,x=s!==null?s.memoizedProps:null,w=f.children,vd(u,f)?w=null:x!==null&&vd(u,x)&&(a.flags|=32),bx(s,a),ln(s,a,w,l),a.child;case 6:return s===null&&_d(a),null;case 13:return Sx(s,a,l);case 4:return Od(a,a.stateNode.containerInfo),u=a.pendingProps,s===null?a.child=ui(a,null,u,l):ln(s,a,u,l),a.child;case 11:return u=a.type,f=a.pendingProps,f=a.elementType===u?f:ns(u,f),gx(s,a,u,f,l);case 7:return ln(s,a,a.pendingProps,l),a.child;case 8:return ln(s,a,a.pendingProps.children,l),a.child;case 12:return ln(s,a,a.pendingProps.children,l),a.child;case 10:e:{if(u=a.type._context,f=a.pendingProps,x=a.memoizedProps,w=f.value,dt(fc,u._currentValue),u._currentValue=w,x!==null)if(es(x.value,w)){if(x.children===f.children&&!gn.current){a=As(s,a,l);break e}}else for(x=a.child,x!==null&&(x.return=a);x!==null;){var P=x.dependencies;if(P!==null){w=x.child;for(var R=P.firstContext;R!==null;){if(R.context===u){if(x.tag===1){R=zs(-1,l&-l),R.tag=2;var Q=x.updateQueue;if(Q!==null){Q=Q.shared;var G=Q.pending;G===null?R.next=R:(R.next=G.next,G.next=R),Q.pending=R}}x.lanes|=l,R=x.alternate,R!==null&&(R.lanes|=l),Td(x.return,l,a),P.lanes|=l;break}R=R.next}}else if(x.tag===10)w=x.type===a.type?null:x.child;else if(x.tag===18){if(w=x.return,w===null)throw Error(r(341));w.lanes|=l,P=w.alternate,P!==null&&(P.lanes|=l),Td(w,l,a),w=x.sibling}else w=x.child;if(w!==null)w.return=x;else for(w=x;w!==null;){if(w===a){w=null;break}if(x=w.sibling,x!==null){x.return=w.return,w=x;break}w=w.return}x=w}ln(s,a,f.children,l),a=a.child}return a;case 9:return f=a.type,u=a.pendingProps.children,hi(a,l),f=Fn(f),u=u(f),a.flags|=1,ln(s,a,u,l),a.child;case 14:return u=a.type,f=ns(u,a.pendingProps),f=ns(u.type,f),vx(s,a,u,f,l);case 15:return yx(s,a,a.type,a.pendingProps,l);case 17:return u=a.type,f=a.pendingProps,f=a.elementType===u?f:ns(u,f),Sc(s,a),a.tag=1,vn(u)?(s=!0,lc(a)):s=!1,hi(a,l),ux(a,u,f),Wd(a,u,f,l),Xd(null,a,u,!0,s,l);case 19:return _x(s,a,l);case 22:return jx(s,a,l)}throw Error(r(156,a.tag))};function Jx(s,a){return Rm(s,a)}function Aj(s,a,l,u){this.tag=s,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(s,a,l,u){return new Aj(s,a,l,u)}function vh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Lj(s){if(typeof s=="function")return vh(s)?1:0;if(s!=null){if(s=s.$$typeof,s===we)return 11;if(s===Ge)return 14}return 2}function Nr(s,a){var l=s.alternate;return l===null?(l=Qn(s.tag,a,s.key,s.mode),l.elementType=s.elementType,l.type=s.type,l.stateNode=s.stateNode,l.alternate=s,s.alternate=l):(l.pendingProps=a,l.type=s.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=s.flags&14680064,l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,a=s.dependencies,l.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},l.sibling=s.sibling,l.index=s.index,l.ref=s.ref,l}function $c(s,a,l,u,f,x){var w=2;if(u=s,typeof s=="function")vh(s)&&(w=1);else if(typeof s=="string")w=5;else e:switch(s){case $:return la(l.children,f,x,a);case z:w=8,f|=8;break;case B:return s=Qn(12,l,a,f|2),s.elementType=B,s.lanes=x,s;case Te:return s=Qn(13,l,a,f),s.elementType=Te,s.lanes=x,s;case Ze:return s=Qn(19,l,a,f),s.elementType=Ze,s.lanes=x,s;case Qe:return zc(l,f,x,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case U:w=10;break e;case J:w=9;break e;case we:w=11;break e;case Ge:w=14;break e;case rt:w=16,u=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return a=Qn(w,l,a,f),a.elementType=s,a.type=u,a.lanes=x,a}function la(s,a,l,u){return s=Qn(7,s,u,a),s.lanes=l,s}function zc(s,a,l,u){return s=Qn(22,s,u,a),s.elementType=Qe,s.lanes=l,s.stateNode={isHidden:!1},s}function yh(s,a,l){return s=Qn(6,s,null,a),s.lanes=l,s}function jh(s,a,l){return a=Qn(4,s.children!==null?s.children:[],s.key,a),a.lanes=l,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function Fj(s,a,l,u,f){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ku(0),this.expirationTimes=Ku(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ku(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function bh(s,a,l,u,f,x,w,P,R){return s=new Fj(s,a,l,P,R),a===1?(a=1,x===!0&&(a|=8)):a=0,x=Qn(3,null,null,a),s.current=x,x.stateNode=s,x.memoizedState={element:u,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},qd(x),s}function Dj(s,a,l){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:u==null?null:""+u,children:s,containerInfo:a,implementation:l}}function Xx(s){if(!s)return mr;s=s._reactInternals;e:{if(Ue(s)!==s||s.tag!==1)throw Error(r(170));var a=s;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(vn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(r(171))}if(s.tag===1){var l=s.type;if(vn(l))return Cp(s,l,a)}return a}function Yx(s,a,l,u,f,x,w,P,R){return s=bh(l,u,!0,s,f,x,w,P,R),s.context=Xx(null),l=s.current,u=on(),f=br(l),x=zs(u,f),x.callback=a??null,gr(l,x,f),s.current.lanes=f,ml(s,f,u),bn(s,u),s}function Ac(s,a,l,u){var f=a.current,x=on(),w=br(f);return l=Xx(l),a.context===null?a.context=l:a.pendingContext=l,a=zs(x,w),a.payload={element:s},u=u===void 0?null:u,u!==null&&(a.callback=u),s=gr(f,a,w),s!==null&&(as(s,f,w,x),pc(s,f,w)),w}function Lc(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function eg(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var l=s.retryLane;s.retryLane=l!==0&&l<a?l:a}}function wh(s,a){eg(s,a),(s=s.alternate)&&eg(s,a)}function Uj(){return null}var tg=typeof reportError=="function"?reportError:function(s){console.error(s)};function Nh(s){this._internalRoot=s}Fc.prototype.render=Nh.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(r(409));Ac(s,a,null,null)},Fc.prototype.unmount=Nh.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;ra(function(){Ac(null,s,null,null)}),a[Ts]=null}};function Fc(s){this._internalRoot=s}Fc.prototype.unstable_scheduleHydration=function(s){if(s){var a=Am();s={blockedOn:null,target:s,priority:a};for(var l=0;l<cr.length&&a!==0&&a<cr[l].priority;l++);cr.splice(l,0,s),l===0&&Dm(s)}};function kh(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Dc(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function ng(){}function Qj(s,a,l,u,f){if(f){if(typeof u=="function"){var x=u;u=function(){var Q=Lc(w);x.call(Q)}}var w=Yx(a,u,s,0,null,!1,!1,"",ng);return s._reactRootContainer=w,s[Ts]=w.current,Pl(s.nodeType===8?s.parentNode:s),ra(),w}for(;f=s.lastChild;)s.removeChild(f);if(typeof u=="function"){var P=u;u=function(){var Q=Lc(R);P.call(Q)}}var R=bh(s,0,!1,null,null,!1,!1,"",ng);return s._reactRootContainer=R,s[Ts]=R.current,Pl(s.nodeType===8?s.parentNode:s),ra(function(){Ac(a,R,l,u)}),R}function Uc(s,a,l,u,f){var x=l._reactRootContainer;if(x){var w=x;if(typeof f=="function"){var P=f;f=function(){var R=Lc(w);P.call(R)}}Ac(a,w,s,f)}else w=Qj(l,a,s,f,u);return Lc(w)}$m=function(s){switch(s.tag){case 3:var a=s.stateNode;if(a.current.memoizedState.isDehydrated){var l=fl(a.pendingLanes);l!==0&&(Wu(a,l|1),bn(a,Pt()),(Xe&6)===0&&(gi=Pt()+500,pr()))}break;case 13:ra(function(){var u=$s(s,1);if(u!==null){var f=on();as(u,s,1,f)}}),wh(s,1)}},Zu=function(s){if(s.tag===13){var a=$s(s,134217728);if(a!==null){var l=on();as(a,s,134217728,l)}wh(s,134217728)}},zm=function(s){if(s.tag===13){var a=br(s),l=$s(s,a);if(l!==null){var u=on();as(l,s,a,u)}wh(s,a)}},Am=function(){return lt},Lm=function(s,a){var l=lt;try{return lt=s,a()}finally{lt=l}},Ha=function(s,a,l){switch(a){case"input":if(Cn(s,l),a=l.name,l.type==="radio"&&a!=null){for(l=s;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<l.length;a++){var u=l[a];if(u!==s&&u.form===s.form){var f=ac(u);if(!f)throw Error(r(90));$a(u),Cn(u,f)}}}break;case"textarea":an(s,l);break;case"select":a=l.value,a!=null&&xn(s,!!l.multiple,a,!1)}},ul=ph,dl=ra;var Bj={usingClientEntryPoint:!1,Events:[Ml,ri,ac,ol,cl,ph]},Vl={findFiberByHostInstance:Gr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Vj={bundleType:Vl.bundleType,version:Vl.version,rendererPackageName:Vl.rendererPackageName,rendererConfig:Vl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=Pm(s),s===null?null:s.stateNode},findFiberByHostInstance:Vl.findFiberByHostInstance||Uj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qc.isDisabled&&Qc.supportsFiber)try{Fo=Qc.inject(Vj),fs=Qc}catch{}}return wn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Bj,wn.createPortal=function(s,a){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!kh(a))throw Error(r(200));return Dj(s,a,null,l)},wn.createRoot=function(s,a){if(!kh(s))throw Error(r(299));var l=!1,u="",f=tg;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onRecoverableError!==void 0&&(f=a.onRecoverableError)),a=bh(s,1,!1,null,null,l,!1,u,f),s[Ts]=a.current,Pl(s.nodeType===8?s.parentNode:s),new Nh(a)},wn.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=Pm(a),s=s===null?null:s.stateNode,s},wn.flushSync=function(s){return ra(s)},wn.hydrate=function(s,a,l){if(!Dc(a))throw Error(r(200));return Uc(null,s,a,!0,l)},wn.hydrateRoot=function(s,a,l){if(!kh(s))throw Error(r(405));var u=l!=null&&l.hydratedSources||null,f=!1,x="",w=tg;if(l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(x=l.identifierPrefix),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),a=Yx(a,null,s,1,l??null,f,!1,x,w),s[Ts]=a.current,Pl(s),u)for(s=0;s<u.length;s++)l=u[s],f=l._getVersion,f=f(l._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[l,f]:a.mutableSourceEagerHydrationData.push(l,f);return new Fc(a)},wn.render=function(s,a,l){if(!Dc(a))throw Error(r(200));return Uc(null,s,a,!1,l)},wn.unmountComponentAtNode=function(s){if(!Dc(s))throw Error(r(40));return s._reactRootContainer?(ra(function(){Uc(null,null,s,!1,function(){s._reactRootContainer=null,s[Ts]=null})}),!0):!1},wn.unstable_batchedUpdates=ph,wn.unstable_renderSubtreeIntoContainer=function(s,a,l,u){if(!Dc(l))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return Uc(s,a,l,!1,u)},wn.version="18.3.1-next-f1338f8080-20240426",wn}var dg;function Fv(){if(dg)return Eh.exports;dg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Eh.exports=rb(),Eh.exports}var hg;function ab(){if(hg)return Vc;hg=1;var e=Fv();return Vc.createRoot=e.createRoot,Vc.hydrateRoot=e.hydrateRoot,Vc}var ib=ab();const lb="modulepreload",ob=function(e){return"/"+e},fg={},Cu=function(n,r,i){let o=Promise.resolve();if(r&&r.length>0){let d=function(g){return Promise.all(g.map(p=>Promise.resolve(p).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),m=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));o=d(r.map(g=>{if(g=ob(g),g in fg)return;fg[g]=!0;const p=g.endsWith(".css"),v=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${v}`))return;const j=document.createElement("link");if(j.rel=p?"stylesheet":lb,p||(j.as="script"),j.crossOrigin="",j.href=g,m&&j.setAttribute("nonce",m),document.head.appendChild(j),p)return new Promise((C,y)=>{j.addEventListener("load",C),j.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return o.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};Fv();/**
|
|
42
|
+
* @remix-run/router v1.23.4
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Remix Software Inc.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
48
|
+
*
|
|
49
|
+
* @license MIT
|
|
50
|
+
*/function no(){return no=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},no.apply(null,arguments)}var zr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(zr||(zr={}));const mg="popstate";function cb(e){e===void 0&&(e={});function n(i,o){let{pathname:c,search:d,hash:h}=i.location;return Uh("",{pathname:c,search:d,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(i,o){return typeof o=="string"?o:nu(o)}return db(n,r,null,e)}function gt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Dv(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function ub(){return Math.random().toString(36).substr(2,8)}function pg(e,n){return{usr:e.state,key:e.key,idx:n}}function Uh(e,n,r,i){return r===void 0&&(r=null),no({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof n=="string"?Zi(n):n,{state:r,key:n&&n.key||i||ub()})}function nu(e){let{pathname:n="/",search:r="",hash:i=""}=e;return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function Zi(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substr(r),e=e.substr(0,r));let i=e.indexOf("?");i>=0&&(n.search=e.substr(i),e=e.substr(0,i)),e&&(n.pathname=e)}return n}function db(e,n,r,i){i===void 0&&(i={});let{window:o=document.defaultView,v5Compat:c=!1}=i,d=o.history,h=zr.Pop,m=null,g=p();g==null&&(g=0,d.replaceState(no({},d.state,{idx:g}),""));function p(){return(d.state||{idx:null}).idx}function v(){h=zr.Pop;let k=p(),S=k==null?null:k-g;g=k,m&&m({action:h,location:b.location,delta:S})}function j(k,S){h=zr.Push;let O=Uh(b.location,k,S);g=p()+1;let q=pg(O,g),E=b.createHref(O);try{d.pushState(q,"",E)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;o.location.assign(E)}c&&m&&m({action:h,location:b.location,delta:1})}function C(k,S){h=zr.Replace;let O=Uh(b.location,k,S);g=p();let q=pg(O,g),E=b.createHref(O);d.replaceState(q,"",E),c&&m&&m({action:h,location:b.location,delta:0})}function y(k){let S=o.location.origin!=="null"?o.location.origin:o.location.href,O=typeof k=="string"?k:nu(k);return O=O.replace(/ $/,"%20"),gt(S,"No window.location.(origin|href) available to create URL for href: "+O),new URL(O,S)}let b={get action(){return h},get location(){return e(o,d)},listen(k){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(mg,v),m=k,()=>{o.removeEventListener(mg,v),m=null}},createHref(k){return n(o,k)},createURL:y,encodeLocation(k){let S=y(k);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:j,replace:C,go(k){return d.go(k)}};return b}var xg;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xg||(xg={}));function hb(e,n,r){return r===void 0&&(r="/"),fb(e,n,r)}function fb(e,n,r,i){let o=typeof n=="string"?Zi(n):n,c=Ai(o.pathname||"/",r);if(c==null)return null;let d=Uv(e);mb(d);let h=null,m=Bv(c);for(let g=0;h==null&&g<d.length;++g)h=Nb(d[g],m);return h}function Uv(e,n,r,i){n===void 0&&(n=[]),r===void 0&&(r=[]),i===void 0&&(i="");let o=(c,d,h)=>{let m={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};m.relativePath.startsWith("/")&&(gt(m.relativePath.startsWith(i),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(i.length));let g=Ar([i,m.relativePath]),p=r.concat(m);c.children&&c.children.length>0&&(gt(c.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Uv(c.children,n,p,g)),!(c.path==null&&!c.index)&&n.push({path:g,score:bb(g,c.index),routesMeta:p})};return e.forEach((c,d)=>{var h;if(c.path===""||!((h=c.path)!=null&&h.includes("?")))o(c,d);else for(let m of Qv(c.path))o(c,d,m)}),n}function Qv(e){let n=e.split("/");if(n.length===0)return[];let[r,...i]=n,o=r.endsWith("?"),c=r.replace(/\?$/,"");if(i.length===0)return o?[c,""]:[c];let d=Qv(i.join("/")),h=[];return h.push(...d.map(m=>m===""?c:[c,m].join("/"))),o&&h.push(...d),h.map(m=>e.startsWith("/")&&m===""?"/":m)}function mb(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:wb(n.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}const pb=/^:[\w-]+$/,xb=3,gb=2,vb=1,yb=10,jb=-2,gg=e=>e==="*";function bb(e,n){let r=e.split("/"),i=r.length;return r.some(gg)&&(i+=jb),n&&(i+=gb),r.filter(o=>!gg(o)).reduce((o,c)=>o+(pb.test(c)?xb:c===""?vb:yb),i)}function wb(e,n){return e.length===n.length&&e.slice(0,-1).every((i,o)=>i===n[o])?e[e.length-1]-n[n.length-1]:0}function Nb(e,n,r){let{routesMeta:i}=e,o={},c="/",d=[];for(let h=0;h<i.length;++h){let m=i[h],g=h===i.length-1,p=c==="/"?n:n.slice(c.length)||"/",v=su({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},p),j=m.route;if(!v)return null;Object.assign(o,v.params),d.push({params:o,pathname:Ar([c,v.pathname]),pathnameBase:_b(Ar([c,v.pathnameBase])),route:j}),v.pathnameBase!=="/"&&(c=Ar([c,v.pathnameBase]))}return d}function su(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,i]=kb(e.path,e.caseSensitive,e.end),o=n.match(r);if(!o)return null;let c=o[0],d=c.replace(/(.)\/+$/,"$1"),h=o.slice(1);return{params:i.reduce((g,p,v)=>{let{paramName:j,isOptional:C}=p;if(j==="*"){let b=h[v]||"";d=c.slice(0,c.length-b.length).replace(/(.)\/+$/,"$1")}const y=h[v];return C&&!y?g[j]=void 0:g[j]=(y||"").replace(/%2F/g,"/"),g},{}),pathname:c,pathnameBase:d,pattern:e}}function kb(e,n,r){n===void 0&&(n=!1),r===void 0&&(r=!0),Dv(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let i=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,h,m)=>(i.push({paramName:h,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(i.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),i]}function Bv(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Dv(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+n+").")),e}}function Ai(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}function Sb(e,n){n===void 0&&(n="/");let{pathname:r,search:i="",hash:o=""}=typeof e=="string"?Zi(e):e,c;return r?(r=Vv(r),r.startsWith("/")?c=vg(r.substring(1),"/"):c=vg(r,n)):c=n,{pathname:c,search:Pb(i),hash:Eb(o)}}function vg(e,n){let r=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Th(e,n,r,i){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+n+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Cb(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function If(e,n){let r=Cb(e);return n?r.map((i,o)=>o===r.length-1?i.pathname:i.pathnameBase):r.map(i=>i.pathnameBase)}function qf(e,n,r,i){i===void 0&&(i=!1);let o;typeof e=="string"?o=Zi(e):(o=no({},e),gt(!o.pathname||!o.pathname.includes("?"),Th("?","pathname","search",o)),gt(!o.pathname||!o.pathname.includes("#"),Th("#","pathname","hash",o)),gt(!o.search||!o.search.includes("#"),Th("#","search","hash",o)));let c=e===""||o.pathname==="",d=c?"/":o.pathname,h;if(d==null)h=r;else{let v=n.length-1;if(!i&&d.startsWith("..")){let j=d.split("/");for(;j[0]==="..";)j.shift(),v-=1;o.pathname=j.join("/")}h=v>=0?n[v]:"/"}let m=Sb(o,h),g=d&&d!=="/"&&d.endsWith("/"),p=(c||d===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(g||p)&&(m.pathname+="/"),m}const Vv=e=>e.replace(/\/\/+/g,"/"),Ar=e=>Vv(e.join("/")),_b=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Pb=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Eb=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Rb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Hv=["post","put","patch","delete"];new Set(Hv);const Mb=["get",...Hv];new Set(Mb);/**
|
|
51
|
+
* React Router v6.30.6
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Remix Software Inc.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
+
*
|
|
58
|
+
* @license MIT
|
|
59
|
+
*/function so(){return so=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},so.apply(null,arguments)}const _u=N.createContext(null),Kv=N.createContext(null),Ys=N.createContext(null),Pu=N.createContext(null),Ps=N.createContext({outlet:null,matches:[],isDataRoute:!1}),Wv=N.createContext(null);function Tb(e,n){let{relative:r}=n===void 0?{}:n;Ia()||gt(!1);let{basename:i,navigator:o}=N.useContext(Ys),{hash:c,pathname:d,search:h}=Eu(e,{relative:r}),m=d;return i!=="/"&&(m=d==="/"?i:Ar([i,d])),o.createHref({pathname:m,search:h,hash:c})}function Ia(){return N.useContext(Pu)!=null}function $n(){return Ia()||gt(!1),N.useContext(Pu).location}function yg(e){Ia()||gt(!1);let{pathname:n}=$n();return N.useMemo(()=>su(e,Bv(n)),[n,e])}function Zv(e){N.useContext(Ys).static||N.useLayoutEffect(e)}function sn(){let{isDataRoute:e}=N.useContext(Ps);return e?Kb():Ib()}function Ib(){Ia()||gt(!1);let e=N.useContext(_u),{basename:n,future:r,navigator:i}=N.useContext(Ys),{matches:o}=N.useContext(Ps),{pathname:c}=$n(),d=JSON.stringify(If(o,r.v7_relativeSplatPath)),h=N.useRef(!1);return Zv(()=>{h.current=!0}),N.useCallback(function(g,p){if(p===void 0&&(p={}),!h.current)return;if(typeof g=="number"){i.go(g);return}let v=qf(g,JSON.parse(d),c,p.relative==="path");e==null&&n!=="/"&&(v.pathname=v.pathname==="/"?n:Ar([n,v.pathname])),(p.replace?i.replace:i.push)(v,p.state,p)},[n,i,d,c,e])}const qb=N.createContext(null);function Ob(e){let n=N.useContext(Ps).outlet;return n&&N.createElement(qb.Provider,{value:e},n)}function zn(){let{matches:e}=N.useContext(Ps),n=e[e.length-1];return n?n.params:{}}function Eu(e,n){let{relative:r}=n===void 0?{}:n,{future:i}=N.useContext(Ys),{matches:o}=N.useContext(Ps),{pathname:c}=$n(),d=JSON.stringify(If(o,i.v7_relativeSplatPath));return N.useMemo(()=>qf(e,JSON.parse(d),c,r==="path"),[e,d,c,r])}function $b(e,n){return zb(e,n)}function zb(e,n,r,i){Ia()||gt(!1);let{navigator:o}=N.useContext(Ys),{matches:c}=N.useContext(Ps),d=c[c.length-1],h=d?d.params:{};d&&d.pathname;let m=d?d.pathnameBase:"/";d&&d.route;let g=$n(),p;if(n){var v;let k=typeof n=="string"?Zi(n):n;m==="/"||(v=k.pathname)!=null&&v.startsWith(m)||gt(!1),p=k}else p=g;let j=p.pathname||"/",C=j;if(m!=="/"){let k=m.replace(/^\//,"").split("/");C="/"+j.replace(/^\//,"").split("/").slice(k.length).join("/")}let y=hb(e,{pathname:C}),b=Ub(y&&y.map(k=>Object.assign({},k,{params:Object.assign({},h,k.params),pathname:Ar([m,o.encodeLocation?o.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?m:Ar([m,o.encodeLocation?o.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),c,r,i);return n&&b?N.createElement(Pu.Provider,{value:{location:so({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:zr.Pop}},b):b}function Ab(){let e=Hb(),n=Rb(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},n),r?N.createElement("pre",{style:o},r):null,null)}const Lb=N.createElement(Ab,null);class Fb extends N.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){console.error("React Router caught the following error during render",n,r)}render(){return this.state.error!==void 0?N.createElement(Ps.Provider,{value:this.props.routeContext},N.createElement(Wv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Db(e){let{routeContext:n,match:r,children:i}=e,o=N.useContext(_u);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),N.createElement(Ps.Provider,{value:n},i)}function Ub(e,n,r,i){var o;if(n===void 0&&(n=[]),r===void 0&&(r=null),i===void 0&&(i=null),e==null){var c;if(!r)return null;if(r.errors)e=r.matches;else if((c=i)!=null&&c.v7_partialHydration&&n.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let d=e,h=(o=r)==null?void 0:o.errors;if(h!=null){let p=d.findIndex(v=>v.route.id&&(h==null?void 0:h[v.route.id])!==void 0);p>=0||gt(!1),d=d.slice(0,Math.min(d.length,p+1))}let m=!1,g=-1;if(r&&i&&i.v7_partialHydration)for(let p=0;p<d.length;p++){let v=d[p];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(g=p),v.route.id){let{loaderData:j,errors:C}=r,y=v.route.loader&&j[v.route.id]===void 0&&(!C||C[v.route.id]===void 0);if(v.route.lazy||y){m=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}return d.reduceRight((p,v,j)=>{let C,y=!1,b=null,k=null;r&&(C=h&&v.route.id?h[v.route.id]:void 0,b=v.route.errorElement||Lb,m&&(g<0&&j===0?(Wb("route-fallback"),y=!0,k=null):g===j&&(y=!0,k=v.route.hydrateFallbackElement||null)));let S=n.concat(d.slice(0,j+1)),O=()=>{let q;return C?q=b:y?q=k:v.route.Component?q=N.createElement(v.route.Component,null):v.route.element?q=v.route.element:q=p,N.createElement(Db,{match:v,routeContext:{outlet:p,matches:S,isDataRoute:r!=null},children:q})};return r&&(v.route.ErrorBoundary||v.route.errorElement||j===0)?N.createElement(Fb,{location:r.location,revalidation:r.revalidation,component:b,error:C,children:O(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):O()},null)}var Gv=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Gv||{}),Jv=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Jv||{});function Qb(e){let n=N.useContext(_u);return n||gt(!1),n}function Bb(e){let n=N.useContext(Kv);return n||gt(!1),n}function Vb(e){let n=N.useContext(Ps);return n||gt(!1),n}function Xv(e){let n=Vb(),r=n.matches[n.matches.length-1];return r.route.id||gt(!1),r.route.id}function Hb(){var e;let n=N.useContext(Wv),r=Bb(),i=Xv();return n!==void 0?n:(e=r.errors)==null?void 0:e[i]}function Kb(){let{router:e}=Qb(Gv.UseNavigateStable),n=Xv(Jv.UseNavigateStable),r=N.useRef(!1);return Zv(()=>{r.current=!0}),N.useCallback(function(o,c){c===void 0&&(c={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,so({fromRouteId:n},c)))},[e,n])}const jg={};function Wb(e,n,r){jg[e]||(jg[e]=!0)}function Zb(e,n){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Fr(e){let{to:n,replace:r,state:i,relative:o}=e;Ia()||gt(!1);let{future:c,static:d}=N.useContext(Ys),{matches:h}=N.useContext(Ps),{pathname:m}=$n(),g=sn(),p=qf(n,If(h,c.v7_relativeSplatPath),m,o==="path"),v=JSON.stringify(p);return N.useEffect(()=>g(JSON.parse(v),{replace:r,state:i,relative:o}),[g,v,o,r,i]),null}function Yv(e){return Ob(e.context)}function ct(e){gt(!1)}function Gb(e){let{basename:n="/",children:r=null,location:i,navigationType:o=zr.Pop,navigator:c,static:d=!1,future:h}=e;Ia()&>(!1);let m=n.replace(/^\/*/,"/"),g=N.useMemo(()=>({basename:m,navigator:c,static:d,future:so({v7_relativeSplatPath:!1},h)}),[m,h,c,d]);typeof i=="string"&&(i=Zi(i));let{pathname:p="/",search:v="",hash:j="",state:C=null,key:y="default"}=i,b=N.useMemo(()=>{let k=Ai(p,m);return k==null?null:{location:{pathname:k,search:v,hash:j,state:C,key:y},navigationType:o}},[m,p,v,j,C,y,o]);return b==null?null:N.createElement(Ys.Provider,{value:g},N.createElement(Pu.Provider,{children:r,value:b}))}function Jb(e){let{children:n,location:r}=e;return $b(Qh(n),r)}new Promise(()=>{});function Qh(e,n){n===void 0&&(n=[]);let r=[];return N.Children.forEach(e,(i,o)=>{if(!N.isValidElement(i))return;let c=[...n,o];if(i.type===N.Fragment){r.push.apply(r,Qh(i.props.children,c));return}i.type!==ct&>(!1),!i.props.index||!i.props.children||gt(!1);let d={id:i.props.id||c.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(d.children=Qh(i.props.children,c)),r.push(d)}),r}/**
|
|
60
|
+
* React Router DOM v6.30.6
|
|
61
|
+
*
|
|
62
|
+
* Copyright (c) Remix Software Inc.
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the MIT license found in the
|
|
65
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
66
|
+
*
|
|
67
|
+
* @license MIT
|
|
68
|
+
*/function ru(){return ru=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},ru.apply(null,arguments)}function ey(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Xb(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yb(e,n){return e.button===0&&(!n||n==="_self")&&!Xb(e)}function Bh(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,r)=>{let i=e[r];return n.concat(Array.isArray(i)?i.map(o=>[r,o]):[[r,i]])},[]))}function ew(e,n){let r=Bh(e);return n&&n.forEach((i,o)=>{r.has(o)||n.getAll(o).forEach(c=>{r.append(o,c)})}),r}const tw=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],nw=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],sw="6";try{window.__reactRouterVersion=sw}catch{}const rw=N.createContext({isTransitioning:!1}),aw="startTransition",bg=tb[aw];function iw(e){let{basename:n,children:r,future:i,window:o}=e,c=N.useRef();c.current==null&&(c.current=cb({window:o,v5Compat:!0}));let d=c.current,[h,m]=N.useState({action:d.action,location:d.location}),{v7_startTransition:g}=i||{},p=N.useCallback(v=>{g&&bg?bg(()=>m(v)):m(v)},[m,g]);return N.useLayoutEffect(()=>d.listen(p),[d,p]),N.useEffect(()=>Zb(i),[i]),N.createElement(Gb,{basename:n,children:r,location:h.location,navigationType:h.action,navigator:d,future:i})}const lw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ow=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Re=N.forwardRef(function(n,r){let{onClick:i,relative:o,reloadDocument:c,replace:d,state:h,target:m,to:g,preventScrollReset:p,viewTransition:v}=n,j=ey(n,tw),{basename:C}=N.useContext(Ys),y,b=!1;if(typeof g=="string"&&ow.test(g)&&(y=g,lw))try{let q=new URL(window.location.href),E=g.startsWith("//")?new URL(q.protocol+g):new URL(g),T=Ai(E.pathname,C);E.origin===q.origin&&T!=null?g=T+E.search+E.hash:b=!0}catch{}let k=Tb(g,{relative:o}),S=uw(g,{replace:d,state:h,target:m,preventScrollReset:p,relative:o,viewTransition:v});function O(q){i&&i(q),q.defaultPrevented||S(q)}return N.createElement("a",ru({},j,{href:y||k,onClick:b||c?i:O,ref:r,target:m}))}),No=N.forwardRef(function(n,r){let{"aria-current":i="page",caseSensitive:o=!1,className:c="",end:d=!1,style:h,to:m,viewTransition:g,children:p}=n,v=ey(n,nw),j=Eu(m,{relative:v.relative}),C=$n(),y=N.useContext(Kv),{navigator:b,basename:k}=N.useContext(Ys),S=y!=null&&dw(j)&&g===!0,O=b.encodeLocation?b.encodeLocation(j).pathname:j.pathname,q=C.pathname,E=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;o||(q=q.toLowerCase(),E=E?E.toLowerCase():null,O=O.toLowerCase()),E&&k&&(E=Ai(E,k)||E);const T=O!=="/"&&O.endsWith("/")?O.length-1:O.length;let M=q===O||!d&&q.startsWith(O)&&q.charAt(T)==="/",$=E!=null&&(E===O||!d&&E.startsWith(O)&&E.charAt(O.length)==="/"),z={isActive:M,isPending:$,isTransitioning:S},B=M?i:void 0,U;typeof c=="function"?U=c(z):U=[c,M?"active":null,$?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let J=typeof h=="function"?h(z):h;return N.createElement(Re,ru({},v,{"aria-current":B,className:U,ref:r,style:J,to:m,viewTransition:g}),typeof p=="function"?p(z):p)});var Vh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Vh||(Vh={}));var wg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(wg||(wg={}));function cw(e){let n=N.useContext(_u);return n||gt(!1),n}function uw(e,n){let{target:r,replace:i,state:o,preventScrollReset:c,relative:d,viewTransition:h}=n===void 0?{}:n,m=sn(),g=$n(),p=Eu(e,{relative:d});return N.useCallback(v=>{if(Yb(v,r)){v.preventDefault();let j=i!==void 0?i:nu(g)===nu(p);m(e,{replace:j,state:o,preventScrollReset:c,relative:d,viewTransition:h})}},[g,m,p,i,o,r,e,c,d,h])}function ko(e){let n=N.useRef(Bh(e)),r=N.useRef(!1),i=$n(),o=N.useMemo(()=>ew(i.search,r.current?null:n.current),[i.search]),c=sn(),d=N.useCallback((h,m)=>{const g=Bh(typeof h=="function"?h(o):h);r.current=!0,c("?"+g,m)},[c,o]);return[o,d]}function dw(e,n){n===void 0&&(n={});let r=N.useContext(rw);r==null&>(!1);let{basename:i}=cw(Vh.useViewTransitionState),o=Eu(e,{relative:n.relative});if(!r.isTransitioning)return!1;let c=Ai(r.currentLocation.pathname,i)||r.currentLocation.pathname,d=Ai(r.nextLocation.pathname,i)||r.nextLocation.pathname;return su(o.pathname,d)!=null||su(o.pathname,c)!=null}const ty=N.createContext(void 0),We=e=>{const n=N.useContext(ty);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},hw=({client:e,children:n})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),t.jsx(ty.Provider,{value:e,children:n})),fw={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Er,Mf,Pv,mw=(Pv=class{constructor(){pe(this,Er,fw);pe(this,Mf,!1)}setTimeoutProvider(e){te(this,Er,e)}setTimeout(e,n){return _(this,Er).setTimeout(e,n)}clearTimeout(e){_(this,Er).clearTimeout(e)}setInterval(e,n){return _(this,Er).setInterval(e,n)}clearInterval(e){_(this,Er).clearInterval(e)}},Er=new WeakMap,Mf=new WeakMap,Pv);const da=new mw;function pw(e){setTimeout(e,0)}const xw=typeof window>"u"||"Deno"in globalThis;function en(){}function gw(e,n){return typeof e=="function"?e(n):e}function ny(e){return typeof e=="number"&&e>=0&&e!==1/0}function sy(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Ct(e,n){return typeof e=="function"?e(n):e}function Ng(e,n){const{type:r="all",exact:i,fetchStatus:o,predicate:c,queryKey:d,stale:h}=e;if(d){if(i){if(n.queryHash!==Of(d,n.options))return!1}else if(!Li(n.queryKey,d))return!1}if(r!=="all"){const m=n.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof h=="boolean"&&n.isStale()!==h||o&&o!==n.state.fetchStatus||c&&!c(n))}function kg(e,n){const{exact:r,status:i,predicate:o,mutationKey:c}=e;if(c){if(!n.options.mutationKey)return!1;if(r){if(Ca(n.options.mutationKey)!==Ca(c))return!1}else if(!Li(n.options.mutationKey,c))return!1}return!(i&&n.state.status!==i||o&&!o(n))}function Of(e,n){return((n==null?void 0:n.queryKeyHashFn)||Ca)(e)}function Ca(e){return JSON.stringify(e,(n,r)=>Hh(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function Li(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let i=0;i<n.length;i++)if(!Li(e[i],n[i]))return!1;return!0}const r=Object.keys(n);for(const i of r)if(!Li(e[i],n[i]))return!1;return!0}return!1}const vw=Object.prototype.hasOwnProperty;function $f(e,n,r=0){if(e===n)return e;if(r>500)return n;const i=Sg(e)&&Sg(n);if(!i&&!(Hh(e)&&Hh(n)))return n;const o=(i?e:Object.keys(e)).length,c=i?n:Object.keys(n),d=c.length,h=i?new Array(d):{};let m=0;for(let g=0;g<d;g++){const p=i?g:c[g],v=e[p],j=n[p];if(v===j){h[p]=v,(i?g<o:vw.call(e,p))&&m++;continue}if(v===null||j===null||typeof v!="object"||typeof j!="object"){h[p]=j;continue}const C=$f(v,j,r+1);h[p]=C,C===v&&m++}return o===d&&m===o?e:h}function eo(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}function Sg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hh(e){if(!Cg(e))return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(!Cg(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Cg(e){return Object.prototype.toString.call(e)==="[object Object]"}function yw(e){return new Promise(n=>{da.setTimeout(n,e)})}function Kh(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?$f(e,n):n}function kn(e){return e}function jw(e,n,r=0){const i=[...e,n];return r&&i.length>r?i.slice(1):i}function bw(e,n,r=0){const i=[n,...e];return r&&i.length>r?i.slice(0,-1):i}const zf=Symbol();function ry(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===zf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Af(e,n){return typeof e=="function"?e(...n):!!e}function ww(e,n,r){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=n()),i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}let Nw=()=>xw;const Lf=()=>Nw();var qa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fa,Rr,Ni,Ev,kw=(Ev=class extends qa{constructor(){super();pe(this,fa);pe(this,Rr);pe(this,Ni);te(this,Ni,n=>{if(typeof window<"u"&&window.addEventListener){const r=()=>n();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){_(this,Rr)||this.setEventListener(_(this,Ni))}onUnsubscribe(){var n;this.hasListeners()||((n=_(this,Rr))==null||n.call(this),te(this,Rr,void 0))}setEventListener(n){var r;te(this,Ni,n),(r=_(this,Rr))==null||r.call(this),te(this,Rr,n(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(n){_(this,fa)!==n&&(te(this,fa,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(r=>{r(n)})}isFocused(){var n;return typeof _(this,fa)=="boolean"?_(this,fa):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},fa=new WeakMap,Rr=new WeakMap,Ni=new WeakMap,Ev);const Ff=new kw,Sw=pw;function Cw(){let e=[],n=0,r=h=>{h()},i=h=>{h()},o=Sw;const c=h=>{n?e.push(h):o(()=>{r(h)})},d=()=>{const h=e;e=[],h.length&&o(()=>{i(()=>{h.forEach(m=>{r(m)})})})};return{batch:h=>{let m;n++;try{m=h()}finally{n--,n||d()}return m},batchCalls:h=>(...m)=>{c(()=>{h(...m)})},schedule:c,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{i=h},setScheduler:h=>{o=h}}}const _t=Cw();var ki,Mr,Si,Rv,_w=(Rv=class extends qa{constructor(){super();pe(this,ki,!0);pe(this,Mr);pe(this,Si);te(this,Si,n=>{if(typeof window<"u"&&window.addEventListener){const r=()=>n(!0),i=()=>n(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}}})}onSubscribe(){_(this,Mr)||this.setEventListener(_(this,Si))}onUnsubscribe(){var n;this.hasListeners()||((n=_(this,Mr))==null||n.call(this),te(this,Mr,void 0))}setEventListener(n){var r;te(this,Si,n),(r=_(this,Mr))==null||r.call(this),te(this,Mr,n(this.setOnline.bind(this)))}setOnline(n){_(this,ki)!==n&&(te(this,ki,n),this.listeners.forEach(r=>{r(n)}))}isOnline(){return _(this,ki)}},ki=new WeakMap,Mr=new WeakMap,Si=new WeakMap,Rv);const au=new _w;function Pw(e){return Math.min(1e3*2**e,3e4)}function ay(e){return(e??"online")==="online"?au.isOnline():!0}var Wh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function iy(e){let n=!1,r=0,i,o="pending",c,d;const h=new Promise((O,q)=>{c=O,d=q});h.catch(en);const m=()=>o!=="pending",g=O=>{var q;if(!m()){const E=new Wh(O);b(E),(q=e.onCancel)==null||q.call(e,E)}},p=()=>{n=!0},v=()=>{n=!1},j=()=>Ff.isFocused()&&(e.networkMode==="always"||au.isOnline())&&e.canRun(),C=()=>ay(e.networkMode)&&e.canRun(),y=O=>{m()||(i==null||i(),o="resolved",c(O))},b=O=>{m()||(i==null||i(),o="rejected",d(O))},k=()=>new Promise(O=>{var q;i=E=>{(m()||j())&&O(E)},(q=e.onPause)==null||q.call(e)}).then(()=>{var O;i=void 0,m()||(O=e.onContinue)==null||O.call(e)}),S=()=>{if(m())return;let O;const q=r===0?e.initialPromise:void 0;try{O=q??e.fn()}catch(E){O=Promise.reject(E)}Promise.resolve(O).then(y).catch(E=>{var B;if(m())return;const T=e.retry??(Lf()?0:3),M=e.retryDelay??Pw,$=typeof M=="function"?M(r,E):M,z=T===!0||typeof T=="number"&&r<T||typeof T=="function"&&T(r,E);if(n||!z){b(E);return}r++,(B=e.onFail)==null||B.call(e,r,E),yw($).then(()=>j()?void 0:k()).then(()=>{n?b(E):S()})})};return{promise:h,status:()=>o,cancel:g,continue:()=>(i==null||i(),h),cancelRetry:p,continueRetry:v,canStart:C,start:()=>(C()?S():k().then(S),h)}}var ma,Mv,ly=(Mv=class{constructor(){pe(this,ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ny(this.gcTime)&&te(this,ma,da.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lf()?1/0:3e5))}clearGcTimeout(){_(this,ma)!==void 0&&(da.clearTimeout(_(this,ma)),te(this,ma,void 0))}},ma=new WeakMap,Mv);function Ew(e){return{onFetch:(n,r)=>{var p,v,j,C,y;const i=n.options,o=(j=(v=(p=n.fetchOptions)==null?void 0:p.meta)==null?void 0:v.fetchMore)==null?void 0:j.direction,c=((C=n.state.data)==null?void 0:C.pages)||[],d=((y=n.state.data)==null?void 0:y.pageParams)||[];let h={pages:[],pageParams:[]},m=0;const g=async()=>{let b=!1;const k=q=>{ww(q,()=>n.signal,()=>b=!0)},S=ry(n.options,n.fetchOptions),O=async(q,E,T)=>{if(b)return Promise.reject(n.signal.reason);if(E==null&&q.pages.length)return Promise.resolve(q);const $=(()=>{const J={client:n.client,queryKey:n.queryKey,pageParam:E,direction:T?"backward":"forward",meta:n.options.meta};return k(J),J})(),z=await S($),{maxPages:B}=n.options,U=T?bw:jw;return{pages:U(q.pages,z,B),pageParams:U(q.pageParams,E,B)}};if(o&&c.length){const q=o==="backward",E=q?oy:Zh,T={pages:c,pageParams:d};h=await O(T,E(i,T),q)}else{const q=e??c.length;do{const E=m===0?d[0]??i.initialPageParam:Zh(i,h);if(m>0&&E==null)break;h=await O(h,E),m++}while(m<q)}return h};n.options.persister?n.fetchFn=()=>{var b,k;return(k=(b=n.options).persister)==null?void 0:k.call(b,g,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r)}:n.fetchFn=g}}}function Zh(e,{pages:n,pageParams:r}){const i=n.length-1;return n.length>0?e.getNextPageParam(n[i],n,r[i],r):void 0}function oy(e,{pages:n,pageParams:r}){var i;return n.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,n[0],n,r[0],r):void 0}function Rw(e,n){return n?Zh(e,n)!=null:!1}function Mw(e,n){return!n||!e.getPreviousPageParam?!1:oy(e,n)!=null}var Ci,pa,_i,Vn,xa,Ot,mo,ga,is,Us,Tv,Tw=(Tv=class extends ly{constructor(n){super();pe(this,is);pe(this,Ci);pe(this,pa);pe(this,_i);pe(this,Vn);pe(this,xa);pe(this,Ot);pe(this,mo);pe(this,ga);te(this,ga,!1),te(this,mo,n.defaultOptions),this.setOptions(n.options),this.observers=[],te(this,xa,n.client),te(this,Vn,_(this,xa).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,te(this,pa,Pg(this.options)),this.state=n.state??_(this,pa),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return _(this,Ci)}get promise(){var n;return(n=_(this,Ot))==null?void 0:n.promise}setOptions(n){if(this.options={..._(this,mo),...n},n!=null&&n._type&&te(this,Ci,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Pg(this.options);r.data!==void 0&&(this.setState(_g(r.data,r.dataUpdatedAt)),te(this,pa,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Vn).remove(this)}setData(n,r){const i=Kh(this.state.data,n,this.options);return Ce(this,is,Us).call(this,{data:i,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),i}setState(n){Ce(this,is,Us).call(this,{type:"setState",state:n})}cancel(n){var i,o;const r=(i=_(this,Ot))==null?void 0:i.promise;return(o=_(this,Ot))==null||o.cancel(n),r?r.then(en).catch(en):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return _(this,pa)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>Ct(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Ct(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!sy(this.state.dataUpdatedAt,n)}onFocus(){var n,r;(n=this.observers.find(i=>i.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(r=_(this,Ot))==null||r.continue()}onOnline(){var n,r;(n=this.observers.find(i=>i.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(r=_(this,Ot))==null||r.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),_(this,Vn).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const r=this.observers.indexOf(n);r!==-1&&(this.observers.splice(r,1),this.observers.length||(_(this,Ot)&&(_(this,ga)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?_(this,Ot).cancel({revert:!0}):_(this,Ot).cancelRetry()),this.scheduleGc()),_(this,Vn).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ce(this,is,Us).call(this,{type:"invalidate"})}async fetch(n,r){var g,p,v,j,C,y,b,k,S,O,q,E;if(this.state.fetchStatus!=="idle"&&((g=_(this,Ot))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(_(this,Ot))return _(this,Ot).continueRetry(),_(this,Ot).promise}if(n&&this.setOptions(n),!this.options.queryFn){const T=this.observers.find(M=>M.options.queryFn);T&&this.setOptions(T.options)}const i=new AbortController,o=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(te(this,ga,!0),i.signal)})},c=()=>{const T=ry(this.options,r),$=(()=>{const z={client:_(this,xa),queryKey:this.queryKey,meta:this.meta};return o(z),z})();return te(this,ga,!1),this.options.persister?this.options.persister(T,$,this):T($)},h=(()=>{const T={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:_(this,xa),state:this.state,fetchFn:c};return o(T),T})();(p=_(this,Ci)==="infinite"?Ew(this.options.pages):this.options.behavior)==null||p.onFetch(h,this),te(this,_i,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=h.fetchOptions)==null?void 0:v.meta))&&Ce(this,is,Us).call(this,{type:"fetch",meta:(j=h.fetchOptions)==null?void 0:j.meta});const m=te(this,Ot,iy({initialPromise:r==null?void 0:r.initialPromise,fn:h.fetchFn,onCancel:T=>{T instanceof Wh&&T.revert&&this.setState({..._(this,_i),fetchStatus:"idle"}),i.abort()},onFail:(T,M)=>{Ce(this,is,Us).call(this,{type:"failed",failureCount:T,error:M})},onPause:()=>{Ce(this,is,Us).call(this,{type:"pause"})},onContinue:()=>{Ce(this,is,Us).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const T=await m.start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(C=_(this,Vn).config).onSuccess)==null||y.call(C,T,this),(k=(b=_(this,Vn).config).onSettled)==null||k.call(b,T,this.state.error,this),T}catch(T){if(T instanceof Wh){if(T.silent)return _(this,Ot).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Ce(this,is,Us).call(this,{type:"error",error:T}),(O=(S=_(this,Vn).config).onError)==null||O.call(S,T,this),(E=(q=_(this,Vn).config).onSettled)==null||E.call(q,this.state.data,T,this),T}finally{_(this,Ot)===m&&te(this,Ot,void 0),this.scheduleGc()}}},Ci=new WeakMap,pa=new WeakMap,_i=new WeakMap,Vn=new WeakMap,xa=new WeakMap,Ot=new WeakMap,mo=new WeakMap,ga=new WeakMap,is=new WeakSet,Us=function(n){const r=i=>{switch(n.type){case"failed":return{...i,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...cy(i.data,this.options),fetchMeta:n.meta??null};case"success":const o={...i,..._g(n.data,n.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return te(this,_i,n.manual?o:void 0),o;case"error":const c=n.error;return{...i,error:c,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...n.state}}};this.state=r(this.state),_t.batch(()=>{this.observers.slice().forEach(i=>{i.onQueryUpdate()}),_(this,Vn).notify({query:this,type:"updated",action:n})})},Tv);function cy(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ay(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _g(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Pg(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var cn,Ke,po,un,va,Pi,Bs,xo,Ei,Ri,ya,ja,Tr,Mi,tt,Jl,Gh,Jh,Xh,Yh,ef,tf,nf,sf,Iv,Ru=(Iv=class extends qa{constructor(n,r){super();pe(this,tt);pe(this,cn);pe(this,Ke);pe(this,po);pe(this,un);pe(this,va);pe(this,Pi);pe(this,Bs);pe(this,xo);pe(this,Ei);pe(this,Ri);pe(this,ya);pe(this,ja);pe(this,Tr);pe(this,Mi,new Set);this.options=r,te(this,cn,n),te(this,Bs,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,Ke).addObserver(this),Eg(_(this,Ke),this.options)?Ce(this,tt,Jl).call(this):this.updateResult(),Ce(this,tt,ef).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rf(_(this,Ke),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rf(_(this,Ke),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ce(this,tt,tf).call(this),Ce(this,tt,nf).call(this),_(this,Ke).removeObserver(this)}setOptions(n){const r=this.options,i=_(this,Ke);if(this.options=_(this,cn).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ct(this.options.enabled,_(this,Ke))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ce(this,tt,sf).call(this),_(this,Ke).setOptions(this.options),r._defaulted&&!eo(this.options,r)&&_(this,cn).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,Ke),observer:this});const o=this.hasListeners();o&&Rg(_(this,Ke),i,this.options,r)&&Ce(this,tt,Jl).call(this),this.updateResult(),o&&(_(this,Ke)!==i||Ct(this.options.enabled,_(this,Ke))!==Ct(r.enabled,_(this,Ke))||Ct(this.options.staleTime,_(this,Ke))!==Ct(r.staleTime,_(this,Ke)))&&Ce(this,tt,Jh).call(this);const c=Ce(this,tt,Xh).call(this);o&&(_(this,Ke)!==i||Ct(this.options.enabled,_(this,Ke))!==Ct(r.enabled,_(this,Ke))||c!==_(this,Tr))&&Ce(this,tt,Yh).call(this,c)}getOptimisticResult(n){const r=_(this,cn).getQueryCache().build(_(this,cn),n),i=this.createResult(r,n);return eo(this.getCurrentResult(),i)||(te(this,un,i),te(this,Pi,this.options),te(this,va,_(this,Ke).state)),i}getCurrentResult(){return _(this,un)}trackResult(n,r){return new Proxy(n,{get:(i,o)=>(this.trackProp(o),r==null||r(o),Reflect.get(i,o))})}trackProp(n){_(this,Mi).add(n)}getCurrentQuery(){return _(this,Ke)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const r=_(this,cn).defaultQueryOptions(n),i=_(this,cn).getQueryCache().build(_(this,cn),r);let o=()=>{},c;const d=new Promise(h=>{c=h,o=_(this,cn).getQueryCache().subscribe(m=>{m.type==="updated"&&m.query.queryHash===i.queryHash&&i.state.data!==void 0&&(o(),h(this.createResult(i,r)))})});return Promise.race([i.fetch().then(()=>{const h=this.createResult(i,r);return c==null||c(h),h}).finally(()=>{o()}),d])}fetch(n){return Ce(this,tt,Jl).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,un)))}createResult(n,r){var M;const i=_(this,Ke),o=this.options,c=_(this,un),d=_(this,va),h=_(this,Pi),m=n!==i?n.state:_(this,po),{state:g}=n;let p={...g},v=!1,j;if(r._optimisticResults){const $=this.hasListeners(),z=!$&&Eg(n,r),B=$&&Rg(n,i,r,o);(z||B)&&(p={...p,...cy(g.data,n.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:C,errorUpdatedAt:y,status:b}=p;j=p.data;let k=!1;if(r.placeholderData!==void 0&&j===void 0&&b==="pending"){let $;c!=null&&c.isPlaceholderData&&r.placeholderData===(h==null?void 0:h.placeholderData)?($=c.data,k=!0):$=typeof r.placeholderData=="function"?r.placeholderData((M=_(this,Ri))==null?void 0:M.state.data,_(this,Ri)):r.placeholderData,$!==void 0&&(b="success",j=Kh(c==null?void 0:c.data,$,r),v=!0)}if(r.select&&j!==void 0&&!k)if(c&&j===(d==null?void 0:d.data)&&r.select===_(this,xo))j=_(this,Ei);else try{te(this,xo,r.select),j=r.select(j),j=Kh(c==null?void 0:c.data,j,r),te(this,Ei,j),te(this,Bs,null)}catch($){te(this,Bs,$)}else j===void 0&&te(this,Bs,null);_(this,Bs)&&(C=_(this,Bs),j=_(this,Ei),y=Date.now(),b="error",v=!1);const S=p.fetchStatus==="fetching",O=b==="pending",q=b==="error",E=O&&S,T=j!==void 0;return{status:b,fetchStatus:p.fetchStatus,isPending:O,isSuccess:b==="success",isError:q,isInitialLoading:E,isLoading:E,data:j,dataUpdatedAt:p.dataUpdatedAt,error:C,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:p.dataUpdateCount>m.dataUpdateCount||p.errorUpdateCount>m.errorUpdateCount,isFetching:S,isRefetching:S&&!O,isLoadingError:q&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:q&&T,isStale:Df(n,r),refetch:this.refetch,isEnabled:Ct(r.enabled,n)!==!1}}updateResult(){const n=_(this,un),r=this.createResult(_(this,Ke),this.options);if(te(this,va,_(this,Ke).state),te(this,Pi,this.options),_(this,va).data!==void 0&&te(this,Ri,_(this,Ke)),eo(r,n))return;te(this,un,r);const o=(()=>{if(!n)return!0;const{notifyOnChangeProps:c}=this.options,d=typeof c=="function"?c():c;if(d==="all"||!d&&!_(this,Mi).size)return!0;const h=new Set(d??_(this,Mi));return this.options.throwOnError&&h.add("error"),Object.keys(_(this,un)).some(m=>{const g=m;return _(this,un)[g]!==n[g]&&h.has(g)})})();_t.batch(()=>{o&&this.listeners.forEach(c=>{c(_(this,un))}),_(this,cn).getQueryCache().notify({query:_(this,Ke),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ce(this,tt,ef).call(this)}},cn=new WeakMap,Ke=new WeakMap,po=new WeakMap,un=new WeakMap,va=new WeakMap,Pi=new WeakMap,Bs=new WeakMap,xo=new WeakMap,Ei=new WeakMap,Ri=new WeakMap,ya=new WeakMap,ja=new WeakMap,Tr=new WeakMap,Mi=new WeakMap,tt=new WeakSet,Jl=function(n){Ce(this,tt,sf).call(this);let r=_(this,Ke).fetch(this.options,n);return n!=null&&n.throwOnError||(r=r.catch(en)),r},Gh=function(n){return!Lf()&&Ct(this.options.enabled,_(this,Ke))!==!1&&ny(n)},Jh=function(){Ce(this,tt,tf).call(this);const n=Ct(this.options.staleTime,_(this,Ke));if(_(this,un).isStale||!Ce(this,tt,Gh).call(this,n))return;const r=sy(_(this,un).dataUpdatedAt,n)+1;te(this,ya,da.setTimeout(()=>{_(this,un).isStale||this.updateResult()},r))},Xh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,Ke)):this.options.refetchInterval)??!1},Yh=function(n){Ce(this,tt,nf).call(this),te(this,Tr,n),!(_(this,Tr)===0||!Ce(this,tt,Gh).call(this,_(this,Tr)))&&te(this,ja,da.setInterval(()=>{(this.options.refetchIntervalInBackground||Ff.isFocused())&&Ce(this,tt,Jl).call(this)},_(this,Tr)))},ef=function(){Ce(this,tt,Jh).call(this),Ce(this,tt,Yh).call(this,Ce(this,tt,Xh).call(this))},tf=function(){_(this,ya)!==void 0&&(da.clearTimeout(_(this,ya)),te(this,ya,void 0))},nf=function(){_(this,ja)!==void 0&&(da.clearInterval(_(this,ja)),te(this,ja,void 0))},sf=function(){const n=_(this,cn).getQueryCache().build(_(this,cn),this.options);if(n===_(this,Ke))return;const r=_(this,Ke);te(this,Ke,n),te(this,po,n.state),this.hasListeners()&&(r==null||r.removeObserver(this),n.addObserver(this))},Iv);function Iw(e,n){return Ct(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ct(n.retryOnMount,e)===!1)}function Eg(e,n){return Iw(e,n)||e.state.data!==void 0&&rf(e,n,n.refetchOnMount)}function rf(e,n,r){if(Ct(n.enabled,e)!==!1&&Ct(n.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&Df(e,n)}return!1}function Rg(e,n,r,i){return(e!==n||Ct(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Df(e,r)}function Df(e,n){return Ct(n.enabled,e)!==!1&&e.isStaleByTime(Ct(n.staleTime,e))}var qw=class extends Ru{constructor(e,n){super(e,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,n){var C,y;const{state:r}=e,i=super.createResult(e,n),{isFetching:o,isRefetching:c,isError:d,isRefetchError:h}=i,m=(y=(C=r.fetchMeta)==null?void 0:C.fetchMore)==null?void 0:y.direction,g=d&&m==="forward",p=o&&m==="forward",v=d&&m==="backward",j=o&&m==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Rw(n,r.data),hasPreviousPage:Mw(n,r.data),isFetchNextPageError:g,isFetchingNextPage:p,isFetchPreviousPageError:v,isFetchingPreviousPage:j,isRefetchError:h&&!g&&!v,isRefetching:c&&!p&&!j}}},go,ys,Xt,ba,js,_r,qv,Ow=(qv=class extends ly{constructor(n){super();pe(this,js);pe(this,go);pe(this,ys);pe(this,Xt);pe(this,ba);te(this,go,n.client),this.mutationId=n.mutationId,te(this,Xt,n.mutationCache),te(this,ys,[]),this.state=n.state||uy(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){_(this,ys).includes(n)||(_(this,ys).push(n),this.clearGcTimeout(),_(this,Xt).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){te(this,ys,_(this,ys).filter(r=>r!==n)),this.scheduleGc(),_(this,Xt).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){_(this,ys).length||(this.state.status==="pending"?this.scheduleGc():_(this,Xt).remove(this))}continue(){var n;return((n=_(this,ba))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var h,m,g,p,v,j,C,y,b,k,S,O,q,E,T,M,$,z;const r=()=>{Ce(this,js,_r).call(this,{type:"continue"})},i={client:_(this,go),meta:this.options.meta,mutationKey:this.options.mutationKey},o=te(this,ba,iy({fn:()=>this.options.mutationFn?this.options.mutationFn(n,i):Promise.reject(new Error("No mutationFn found")),onFail:(B,U)=>{Ce(this,js,_r).call(this,{type:"failed",failureCount:B,error:U})},onPause:()=>{Ce(this,js,_r).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Xt).canRun(this)})),c=this.state.status==="pending",d=!o.canStart();try{if(c)r();else{Ce(this,js,_r).call(this,{type:"pending",variables:n,isPaused:d}),_(this,Xt).config.onMutate&&await _(this,Xt).config.onMutate(n,this,i);const U=await((m=(h=this.options).onMutate)==null?void 0:m.call(h,n,i));U!==this.state.context&&Ce(this,js,_r).call(this,{type:"pending",context:U,variables:n,isPaused:d})}const B=await o.start();return await((p=(g=_(this,Xt).config).onSuccess)==null?void 0:p.call(g,B,n,this.state.context,this,i)),await((j=(v=this.options).onSuccess)==null?void 0:j.call(v,B,n,this.state.context,i)),await((y=(C=_(this,Xt).config).onSettled)==null?void 0:y.call(C,B,null,this.state.variables,this.state.context,this,i)),await((k=(b=this.options).onSettled)==null?void 0:k.call(b,B,null,n,this.state.context,i)),Ce(this,js,_r).call(this,{type:"success",data:B}),B}catch(B){try{await((O=(S=_(this,Xt).config).onError)==null?void 0:O.call(S,B,n,this.state.context,this,i))}catch(U){Promise.reject(U)}try{await((E=(q=this.options).onError)==null?void 0:E.call(q,B,n,this.state.context,i))}catch(U){Promise.reject(U)}try{await((M=(T=_(this,Xt).config).onSettled)==null?void 0:M.call(T,void 0,B,this.state.variables,this.state.context,this,i))}catch(U){Promise.reject(U)}try{await((z=($=this.options).onSettled)==null?void 0:z.call($,void 0,B,n,this.state.context,i))}catch(U){Promise.reject(U)}throw Ce(this,js,_r).call(this,{type:"error",error:B}),B}finally{_(this,ba)===o&&te(this,ba,void 0),_(this,Xt).runNext(this)}}},go=new WeakMap,ys=new WeakMap,Xt=new WeakMap,ba=new WeakMap,js=new WeakSet,_r=function(n){const r=i=>{switch(n.type){case"failed":return{...i,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...i,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:n.error,failureCount:i.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=r(this.state),_t.batch(()=>{_(this,ys).forEach(i=>{i.onMutationUpdate(n)}),_(this,Xt).notify({mutation:this,type:"updated",action:n})})},qv);function uy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vs,ls,vo,Ov,$w=(Ov=class extends qa{constructor(n={}){super();pe(this,Vs);pe(this,ls);pe(this,vo);this.config=n,te(this,Vs,new Set),te(this,ls,new Map),te(this,vo,0)}build(n,r,i){const o=new Ow({client:n,mutationCache:this,mutationId:++Bc(this,vo)._,options:n.defaultMutationOptions(r),state:i});return this.add(o),o}add(n){_(this,Vs).add(n);const r=Hc(n);if(typeof r=="string"){const i=_(this,ls).get(r);i?i.push(n):_(this,ls).set(r,[n])}this.notify({type:"added",mutation:n})}remove(n){if(_(this,Vs).delete(n)){const r=Hc(n);if(typeof r=="string"){const i=_(this,ls).get(r);if(i)if(i.length>1){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}else i[0]===n&&_(this,ls).delete(r)}}this.notify({type:"removed",mutation:n})}canRun(n){var i;const r=Hc(n);if(typeof r=="string"){const o=(i=_(this,ls).get(r))==null?void 0:i.find(c=>c.state.status==="pending");return!o||o===n}else return!0}runNext(n){var i,o;const r=Hc(n);return typeof r=="string"?((o=(i=_(this,ls).get(r))==null?void 0:i.find(c=>c!==n&&c.state.isPaused))==null?void 0:o.continue())??Promise.resolve():Promise.resolve()}clear(){_t.batch(()=>{_(this,Vs).forEach(n=>{this.notify({type:"removed",mutation:n})}),_(this,Vs).clear(),_(this,ls).clear()})}getAll(){return Array.from(_(this,Vs))}find(n){const r={exact:!0,...n};return this.getAll().find(i=>kg(r,i))}findAll(n={}){return this.getAll().filter(r=>kg(n,r))}notify(n){_t.batch(()=>{this.listeners.forEach(r=>{r(n)})})}resumePausedMutations(){const n=this.getAll().filter(r=>r.state.isPaused);return _t.batch(()=>Promise.all(n.map(r=>r.continue().catch(en))))}},Vs=new WeakMap,ls=new WeakMap,vo=new WeakMap,Ov);function Hc(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Hs,Ir,Yt,Ks,ks,Xl,af,$v,zw=($v=class extends qa{constructor(r,i){super();pe(this,ks);pe(this,Hs);pe(this,Ir);pe(this,Yt);pe(this,Ks);te(this,Hs,r),this.setOptions(i),this.bindMethods(),Ce(this,ks,Xl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var o;const i=this.options;this.options=_(this,Hs).defaultMutationOptions(r),eo(this.options,i)||_(this,Hs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Yt),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&Ca(i.mutationKey)!==Ca(this.options.mutationKey)?this.reset():((o=_(this,Yt))==null?void 0:o.state.status)==="pending"&&_(this,Yt).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&_(this,Yt)&&(_(this,Yt).addObserver(this),Ce(this,ks,Xl).call(this))}onUnsubscribe(){var r;this.hasListeners()||(r=_(this,Yt))==null||r.removeObserver(this)}onMutationUpdate(r){Ce(this,ks,Xl).call(this),Ce(this,ks,af).call(this,r)}getCurrentResult(){return _(this,Ir)}reset(){var r;(r=_(this,Yt))==null||r.removeObserver(this),te(this,Yt,void 0),Ce(this,ks,Xl).call(this),Ce(this,ks,af).call(this)}mutate(r,i){var o;return te(this,Ks,i),(o=_(this,Yt))==null||o.removeObserver(this),te(this,Yt,_(this,Hs).getMutationCache().build(_(this,Hs),this.options)),_(this,Yt).addObserver(this),_(this,Yt).execute(r)}},Hs=new WeakMap,Ir=new WeakMap,Yt=new WeakMap,Ks=new WeakMap,ks=new WeakSet,Xl=function(){var i;const r=((i=_(this,Yt))==null?void 0:i.state)??uy();te(this,Ir,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},af=function(r){_t.batch(()=>{var i,o,c,d,h,m,g,p;if(_(this,Ks)&&this.hasListeners()){const v=_(this,Ir).variables,j=_(this,Ir).context,C={client:_(this,Hs),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(o=(i=_(this,Ks)).onSuccess)==null||o.call(i,r.data,v,j,C)}catch(y){Promise.reject(y)}try{(d=(c=_(this,Ks)).onSettled)==null||d.call(c,r.data,null,v,j,C)}catch(y){Promise.reject(y)}}else if((r==null?void 0:r.type)==="error"){try{(m=(h=_(this,Ks)).onError)==null||m.call(h,r.error,v,j,C)}catch(y){Promise.reject(y)}try{(p=(g=_(this,Ks)).onSettled)==null||p.call(g,void 0,r.error,v,j,C)}catch(y){Promise.reject(y)}}}this.listeners.forEach(v=>{v(_(this,Ir))})})},$v);function Mg(e,n){const r=new Set(n);return e.filter(i=>!r.has(i))}var Ti,dn,Ii,wa,Tn,Na,yo,jo,bo,wo,$t,lf,of,dy,cf,uf,df,zv,Aw=(zv=class extends qa{constructor(n,r,i){super();pe(this,$t);pe(this,Ti);pe(this,dn);pe(this,Ii);pe(this,wa);pe(this,Tn);pe(this,Na);pe(this,yo);pe(this,jo);pe(this,bo);pe(this,wo,[]);te(this,Ti,n),te(this,wa,i),te(this,Ii,[]),te(this,Tn,[]),te(this,dn,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&_(this,Tn).forEach(n=>{n.subscribe(r=>{Ce(this,$t,uf).call(this,n,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,_(this,Tn).forEach(n=>{n.destroy()})}setQueries(n,r){te(this,Ii,n),te(this,wa,r),_t.batch(()=>{const i=_(this,Tn),o=Ce(this,$t,cf).call(this,_(this,Ii));o.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const c=o.map(v=>v.observer),d=c.map(v=>v.getCurrentResult()),h=i.length!==c.length,m=c.some((v,j)=>v!==i[j]),g=h||m,p=g?!0:d.some((v,j)=>{const C=_(this,dn)[j];return!C||!eo(v,C)});!g&&!p||(g&&(te(this,wo,o),te(this,Tn,c)),te(this,dn,d),this.hasListeners()&&(g&&(Mg(i,c).forEach(v=>{v.destroy()}),Mg(c,i).forEach(v=>{v.subscribe(j=>{Ce(this,$t,uf).call(this,v,j)})})),Ce(this,$t,df).call(this)))})}getCurrentResult(){return _(this,dn)}getQueries(){return _(this,Tn).map(n=>n.getCurrentQuery())}getObservers(){return _(this,Tn)}getOptimisticResult(n,r){const i=Ce(this,$t,cf).call(this,n),o=i.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),c=i.map(d=>d.defaultedQueryOptions.queryHash);return[o,d=>Ce(this,$t,of).call(this,d??o,r,c),()=>Ce(this,$t,lf).call(this,o,i)]}},Ti=new WeakMap,dn=new WeakMap,Ii=new WeakMap,wa=new WeakMap,Tn=new WeakMap,Na=new WeakMap,yo=new WeakMap,jo=new WeakMap,bo=new WeakMap,wo=new WeakMap,$t=new WeakSet,lf=function(n,r){const i=new Set;return r.map((o,c)=>{const d=n[c];return o.defaultedQueryOptions.notifyOnChangeProps?d:o.observer.trackResult(d,h=>{i.has(h)||(i.add(h),r.forEach(m=>{m.observer.trackProp(h)}))})})},of=function(n,r,i){if(r){const o=_(this,bo),c=i!==void 0&&o!==void 0&&(o.length!==i.length||i.some((d,h)=>d!==o[h]));return(_(this,dn)!==_(this,jo)||c||r!==_(this,yo))&&(te(this,yo,r),te(this,jo,_(this,dn)),i!==void 0&&te(this,bo,i),te(this,Na,$f(_(this,Na),r(n)))),_(this,Na)}return n},dy=function(){var n;return!((n=_(this,wa))!=null&&n.combine)||_(this,Tn).some((r,i)=>{var o;return r.options.suspense&&((o=_(this,dn)[i])==null?void 0:o.data)===void 0})},cf=function(n){const r=new Map;_(this,Tn).forEach(o=>{const c=o.options.queryHash;if(!c)return;const d=r.get(c);d?d.push(o):r.set(c,[o])});const i=[];return n.forEach(o=>{var h;const c=_(this,Ti).defaultQueryOptions(o),d=((h=r.get(c.queryHash))==null?void 0:h.shift())??new Ru(_(this,Ti),c);i.push({defaultedQueryOptions:c,observer:d})}),i},uf=function(n,r){const i=_(this,Tn).indexOf(n);i!==-1&&(te(this,dn,_(this,dn).slice()),_(this,dn)[i]=r,Ce(this,$t,df).call(this))},df=function(){var n;if(this.hasListeners()){const r=Ce(this,$t,dy).call(this),i=_(this,Na),o=r?i:Ce(this,$t,of).call(this,Ce(this,$t,lf).call(this,_(this,dn),_(this,wo)),(n=_(this,wa))==null?void 0:n.combine);(r||i!==o)&&_t.batch(()=>{this.listeners.forEach(c=>{c(_(this,dn))})})}},zv),bs,Av,Lw=(Av=class extends qa{constructor(n={}){super();pe(this,bs);this.config=n,te(this,bs,new Map)}build(n,r,i){const o=r.queryKey,c=r.queryHash??Of(o,r);let d=this.get(c);return d||(d=new Tw({client:n,queryKey:o,queryHash:c,options:n.defaultQueryOptions(r),state:i,defaultOptions:n.getQueryDefaults(o)}),this.add(d)),d}add(n){_(this,bs).has(n.queryHash)||(_(this,bs).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const r=_(this,bs).get(n.queryHash);r&&(n.destroy(),r===n&&_(this,bs).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){_t.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return _(this,bs).get(n)}getAll(){return[..._(this,bs).values()]}find(n){const r={exact:!0,...n};return this.getAll().find(i=>Ng(r,i))}findAll(n={}){const r=this.getAll();return Object.keys(n).length>0?r.filter(i=>Ng(n,i)):r}notify(n){_t.batch(()=>{this.listeners.forEach(r=>{r(n)})})}onFocus(){_t.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){_t.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},bs=new WeakMap,Av),kt,qr,Or,qi,Oi,$r,$i,zi,Lv,Fw=(Lv=class{constructor(e={}){pe(this,kt);pe(this,qr);pe(this,Or);pe(this,qi);pe(this,Oi);pe(this,$r);pe(this,$i);pe(this,zi);te(this,kt,e.queryCache||new Lw),te(this,qr,e.mutationCache||new $w),te(this,Or,e.defaultOptions||{}),te(this,qi,new Map),te(this,Oi,new Map),te(this,$r,0)}mount(){Bc(this,$r)._++,_(this,$r)===1&&(te(this,$i,Ff.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,kt).onFocus())})),te(this,zi,au.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,kt).onOnline())})))}unmount(){var e,n;Bc(this,$r)._--,_(this,$r)===0&&((e=_(this,$i))==null||e.call(this),te(this,$i,void 0),(n=_(this,zi))==null||n.call(this),te(this,zi,void 0))}isFetching(e){return _(this,kt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,qr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const n=this.defaultQueryOptions({queryKey:e});return(r=_(this,kt).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=_(this,kt).build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ct(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return _(this,kt).findAll(e).map(({queryKey:n,state:r})=>[n,r.data])}setQueryData(e,n,r){var d;const i=this.defaultQueryOptions({queryKey:e}),o=(d=_(this,kt).get(i.queryHash))==null?void 0:d.state.data,c=gw(n,o);if(c!==void 0)return _(this,kt).build(this,i).setData(c,{...r,manual:!0})}setQueriesData(e,n,r){return _t.batch(()=>_(this,kt).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e){var r;const n=this.defaultQueryOptions({queryKey:e});return(r=_(this,kt).get(n.queryHash))==null?void 0:r.state}removeQueries(e){const n=_(this,kt);_t.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=_(this,kt);return _t.batch(()=>{const i=r.findAll(e),o=new Set(i);return i.forEach(c=>{c.reset()}),this.refetchQueries({type:"active",predicate:c=>o.has(c)},n)})}cancelQueries(e,n={}){const r={revert:!0,...n},i=_t.batch(()=>_(this,kt).findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(en).catch(en)}invalidateQueries(e,n={}){return _t.batch(()=>(_(this,kt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=_t.batch(()=>_(this,kt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,r);return r.throwOnError||(c=c.catch(en)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(i).then(en)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=_(this,kt).build(this,n),i=r.isStaleByTime(Ct(n.staleTime,r))?await r.fetch(n):r.state.data,o=n.select;return o?o(i):i}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=_(this,kt).build(this,n);return r.isStaleByTime(Ct(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(en).catch(en)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(en).catch(en)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return au.isOnline()?_(this,qr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,kt)}getMutationCache(){return _(this,qr)}getDefaultOptions(){return _(this,Or)}setDefaultOptions(e){te(this,Or,e)}setQueryDefaults(e,n){_(this,qi).set(Ca(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[..._(this,qi).values()],r={};return n.forEach(i=>{Li(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,n){_(this,Oi).set(Ca(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[..._(this,Oi).values()],r={};return n.forEach(i=>{Li(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={..._(this,Or).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Of(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===zf&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Or).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,kt).clear(),_(this,qr).clear()}},kt=new WeakMap,qr=new WeakMap,Or=new WeakMap,qi=new WeakMap,Oi=new WeakMap,$r=new WeakMap,$i=new WeakMap,zi=new WeakMap,Lv);const hy=N.createContext(!1),fy=()=>N.useContext(hy);hy.Provider;function Dw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Uw=N.createContext(Dw()),my=()=>N.useContext(Uw),py=(e,n,r)=>{const i=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Af(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||i)&&(n.isReset()||(e.retryOnMount=!1))},xy=e=>{N.useEffect(()=>{e.clearReset()},[e])},gy=({result:e,errorResetBoundary:n,throwOnError:r,query:i,suspense:o})=>e.isError&&!n.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||Af(r,[e.error,i])),vy=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>r(i(...o)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},hf=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,yy=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function jy({queries:e,...n},r){const i=We(),o=fy(),c=my(),d=n.subscribed!==!1,h=N.useMemo(()=>e.map(b=>{const k=i.defaultQueryOptions(b);return k._optimisticResults=o?"isRestoring":d?"optimistic":void 0,k}),[e,i,o,d]);h.forEach(b=>{vy(b);const k=i.getQueryCache().get(b.queryHash);py(b,c,k)}),xy(c);const[m]=N.useState(()=>new Aw(i,h,n)),[g,p,v]=m.getOptimisticResult(h,n.combine),j=!o&&d;N.useSyncExternalStore(N.useCallback(b=>j?m.subscribe(_t.batchCalls(b)):en,[m,j]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),N.useEffect(()=>{m.setQueries(h,n)},[h,n,m]);const C=g.some((b,k)=>hf(h[k],b))?g.flatMap((b,k)=>{const S=h[k];if(S&&hf(S,b)){const O=new Ru(i,S);return yy(S,O,c)}return[]}):[];if(C.length>0)throw Promise.all(C);const y=g.find((b,k)=>{const S=h[k];return S&&gy({result:b,errorResetBoundary:c,throwOnError:S.throwOnError,query:i.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(y)throw y.error;return p(v())}function by(e,n,r){const i=fy(),o=my(),c=We(),d=c.defaultQueryOptions(e),h=c.getQueryCache().get(d.queryHash),m=e.subscribed!==!1;d._optimisticResults=i?"isRestoring":m?"optimistic":void 0,vy(d),py(d,o,h),xy(o);const[g]=N.useState(()=>new n(c,d)),p=g.getOptimisticResult(d),v=!i&&m;if(N.useSyncExternalStore(N.useCallback(j=>{const C=v?g.subscribe(_t.batchCalls(j)):en;return g.updateResult(),C},[g,v]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),N.useEffect(()=>{g.setOptions(d)},[d,g]),hf(d,p))throw yy(d,g,o);if(gy({result:p,errorResetBoundary:o,throwOnError:d.throwOnError,query:h,suspense:d.suspense}))throw p.error;return d.notifyOnChangeProps?p:g.trackResult(p)}function nt(e,n){return by(e,Ru)}function He(e,n){const r=We(),[i]=N.useState(()=>new zw(r,e));N.useEffect(()=>{i.setOptions(e)},[i,e]);const o=N.useSyncExternalStore(N.useCallback(d=>i.subscribe(_t.batchCalls(d)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=N.useCallback((...d)=>{i.mutate(d[0],d[1]).catch(en)},[i]);if(o.error&&Af(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}function wy(e,n){return by(e,qw)}/**
|
|
69
|
+
* @license lucide-react v0.469.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const Qw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ny=(...e)=>e.filter((n,r,i)=>!!n&&n.trim()!==""&&i.indexOf(n)===r).join(" ").trim();/**
|
|
74
|
+
* @license lucide-react v0.469.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/var Bw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
79
|
+
* @license lucide-react v0.469.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const Vw=N.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:c,iconNode:d,...h},m)=>N.createElement("svg",{ref:m,...Bw,width:n,height:n,stroke:e,strokeWidth:i?Number(r)*24/Number(n):r,className:Ny("lucide",o),...h},[...d.map(([g,p])=>N.createElement(g,p)),...Array.isArray(c)?c:[c]]));/**
|
|
84
|
+
* @license lucide-react v0.469.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const re=(e,n)=>{const r=N.forwardRef(({className:i,...o},c)=>N.createElement(Vw,{ref:c,iconNode:n,className:Ny(`lucide-${Qw(e)}`,i),...o}));return r.displayName=`${e}`,r};/**
|
|
89
|
+
* @license lucide-react v0.469.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const So=re("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
94
|
+
* @license lucide-react v0.469.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const Hw=re("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/**
|
|
99
|
+
* @license lucide-react v0.469.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const Kw=re("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
104
|
+
* @license lucide-react v0.469.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const Ww=re("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
109
|
+
* @license lucide-react v0.469.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const Zw=re("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
114
|
+
* @license lucide-react v0.469.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const Uf=re("ArrowUpToLine",[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]]);/**
|
|
119
|
+
* @license lucide-react v0.469.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const Gw=re("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
124
|
+
* @license lucide-react v0.469.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const Jw=re("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
129
|
+
* @license lucide-react v0.469.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const Xw=re("BellOff",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);/**
|
|
134
|
+
* @license lucide-react v0.469.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const Qf=re("BellRing",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]);/**
|
|
139
|
+
* @license lucide-react v0.469.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const Gi=re("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
144
|
+
* @license lucide-react v0.469.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const ky=re("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
149
|
+
* @license lucide-react v0.469.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const Yw=re("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
154
|
+
* @license lucide-react v0.469.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const Sy=re("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
|
|
159
|
+
* @license lucide-react v0.469.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const Co=re("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
|
|
164
|
+
* @license lucide-react v0.469.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const Bf=re("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
169
|
+
* @license lucide-react v0.469.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const Qr=re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
174
|
+
* @license lucide-react v0.469.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const cs=re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
179
|
+
* @license lucide-react v0.469.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const iu=re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
184
|
+
* @license lucide-react v0.469.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const Wn=re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
189
|
+
* @license lucide-react v0.469.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const eN=re("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
|
|
194
|
+
* @license lucide-react v0.469.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const tN=re("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
|
|
199
|
+
* @license lucide-react v0.469.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const Vf=re("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
204
|
+
* @license lucide-react v0.469.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const Cy=re("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
209
|
+
* @license lucide-react v0.469.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const _y=re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
214
|
+
* @license lucide-react v0.469.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const nN=re("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
219
|
+
* @license lucide-react v0.469.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const Py=re("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
224
|
+
* @license lucide-react v0.469.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const sN=re("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
229
|
+
* @license lucide-react v0.469.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const rN=re("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
234
|
+
* @license lucide-react v0.469.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const Ji=re("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
239
|
+
* @license lucide-react v0.469.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const aN=re("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
244
|
+
* @license lucide-react v0.469.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const iN=re("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
|
|
249
|
+
* @license lucide-react v0.469.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const Lr=re("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
254
|
+
* @license lucide-react v0.469.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const _o=re("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
259
|
+
* @license lucide-react v0.469.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const Ey=re("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
264
|
+
* @license lucide-react v0.469.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const lN=re("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
|
|
269
|
+
* @license lucide-react v0.469.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const oN=re("FolderLock",[["rect",{width:"8",height:"5",x:"14",y:"17",rx:"1",key:"19aais"}],["path",{d:"M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5",key:"1w6v7t"}],["path",{d:"M20 17v-2a2 2 0 1 0-4 0v2",key:"pwaxnr"}]]);/**
|
|
274
|
+
* @license lucide-react v0.469.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const Ry=re("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
279
|
+
* @license lucide-react v0.469.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const Tg=re("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
284
|
+
* @license lucide-react v0.469.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const Zs=re("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
289
|
+
* @license lucide-react v0.469.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const lu=re("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
294
|
+
* @license lucide-react v0.469.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const cN=re("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
299
|
+
* @license lucide-react v0.469.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const uN=re("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
304
|
+
* @license lucide-react v0.469.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const dN=re("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
309
|
+
* @license lucide-react v0.469.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const hN=re("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
|
|
314
|
+
* @license lucide-react v0.469.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const Xi=re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
319
|
+
* @license lucide-react v0.469.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const Yi=re("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
324
|
+
* @license lucide-react v0.469.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const fN=re("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
329
|
+
* @license lucide-react v0.469.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const Mu=re("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
334
|
+
* @license lucide-react v0.469.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const mN=re("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
339
|
+
* @license lucide-react v0.469.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const My=re("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
344
|
+
* @license lucide-react v0.469.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const ro=re("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
349
|
+
* @license lucide-react v0.469.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const pN=re("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
354
|
+
* @license lucide-react v0.469.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const xN=re("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
359
|
+
* @license lucide-react v0.469.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const gN=re("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
364
|
+
* @license lucide-react v0.469.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const Ty=re("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);/**
|
|
369
|
+
* @license lucide-react v0.469.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const vN=re("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
|
|
374
|
+
* @license lucide-react v0.469.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const el=re("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
379
|
+
* @license lucide-react v0.469.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const Po=re("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
384
|
+
* @license lucide-react v0.469.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const Hf=re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
389
|
+
* @license lucide-react v0.469.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const Iy=re("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
394
|
+
* @license lucide-react v0.469.0 - ISC
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the ISC license.
|
|
397
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/const Kn=re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
399
|
+
* @license lucide-react v0.469.0 - ISC
|
|
400
|
+
*
|
|
401
|
+
* This source code is licensed under the ISC license.
|
|
402
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
+
*/const Kf=re("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
404
|
+
* @license lucide-react v0.469.0 - ISC
|
|
405
|
+
*
|
|
406
|
+
* This source code is licensed under the ISC license.
|
|
407
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
+
*/const qy=re("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
|
|
409
|
+
* @license lucide-react v0.469.0 - ISC
|
|
410
|
+
*
|
|
411
|
+
* This source code is licensed under the ISC license.
|
|
412
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
+
*/const Tu=re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
414
|
+
* @license lucide-react v0.469.0 - ISC
|
|
415
|
+
*
|
|
416
|
+
* This source code is licensed under the ISC license.
|
|
417
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
+
*/const Eo=re("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
419
|
+
* @license lucide-react v0.469.0 - ISC
|
|
420
|
+
*
|
|
421
|
+
* This source code is licensed under the ISC license.
|
|
422
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
+
*/const Hn=re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
424
|
+
* @license lucide-react v0.469.0 - ISC
|
|
425
|
+
*
|
|
426
|
+
* This source code is licensed under the ISC license.
|
|
427
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
+
*/const yN=re("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
429
|
+
* @license lucide-react v0.469.0 - ISC
|
|
430
|
+
*
|
|
431
|
+
* This source code is licensed under the ISC license.
|
|
432
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
+
*/const jN=re("ServerCrash",[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2",key:"4b9dqc"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2",key:"22nnkd"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m13 6-4 6h6l-4 6",key:"14hqih"}]]);/**
|
|
434
|
+
* @license lucide-react v0.469.0 - ISC
|
|
435
|
+
*
|
|
436
|
+
* This source code is licensed under the ISC license.
|
|
437
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
+
*/const Oy=re("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
439
|
+
* @license lucide-react v0.469.0 - ISC
|
|
440
|
+
*
|
|
441
|
+
* This source code is licensed under the ISC license.
|
|
442
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
+
*/const $y=re("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
444
|
+
* @license lucide-react v0.469.0 - ISC
|
|
445
|
+
*
|
|
446
|
+
* This source code is licensed under the ISC license.
|
|
447
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
+
*/const Wf=re("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
449
|
+
* @license lucide-react v0.469.0 - ISC
|
|
450
|
+
*
|
|
451
|
+
* This source code is licensed under the ISC license.
|
|
452
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
+
*/const Iu=re("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
454
|
+
* @license lucide-react v0.469.0 - ISC
|
|
455
|
+
*
|
|
456
|
+
* This source code is licensed under the ISC license.
|
|
457
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
458
|
+
*/const bN=re("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
459
|
+
* @license lucide-react v0.469.0 - ISC
|
|
460
|
+
*
|
|
461
|
+
* This source code is licensed under the ISC license.
|
|
462
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
+
*/const wN=re("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
464
|
+
* @license lucide-react v0.469.0 - ISC
|
|
465
|
+
*
|
|
466
|
+
* This source code is licensed under the ISC license.
|
|
467
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
+
*/const zy=re("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
469
|
+
* @license lucide-react v0.469.0 - ISC
|
|
470
|
+
*
|
|
471
|
+
* This source code is licensed under the ISC license.
|
|
472
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
473
|
+
*/const us=re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
474
|
+
* @license lucide-react v0.469.0 - ISC
|
|
475
|
+
*
|
|
476
|
+
* This source code is licensed under the ISC license.
|
|
477
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
478
|
+
*/const Zn=re("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
479
|
+
* @license lucide-react v0.469.0 - ISC
|
|
480
|
+
*
|
|
481
|
+
* This source code is licensed under the ISC license.
|
|
482
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
+
*/const Zf=re("Unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
|
|
484
|
+
* @license lucide-react v0.469.0 - ISC
|
|
485
|
+
*
|
|
486
|
+
* This source code is licensed under the ISC license.
|
|
487
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
488
|
+
*/const NN=re("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
|
|
489
|
+
* @license lucide-react v0.469.0 - ISC
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the ISC license.
|
|
492
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/const kN=re("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
494
|
+
* @license lucide-react v0.469.0 - ISC
|
|
495
|
+
*
|
|
496
|
+
* This source code is licensed under the ISC license.
|
|
497
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
498
|
+
*/const SN=re("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
|
|
499
|
+
* @license lucide-react v0.469.0 - ISC
|
|
500
|
+
*
|
|
501
|
+
* This source code is licensed under the ISC license.
|
|
502
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
+
*/const Gf=re("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
504
|
+
* @license lucide-react v0.469.0 - ISC
|
|
505
|
+
*
|
|
506
|
+
* This source code is licensed under the ISC license.
|
|
507
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
508
|
+
*/const ff=re("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
509
|
+
* @license lucide-react v0.469.0 - ISC
|
|
510
|
+
*
|
|
511
|
+
* This source code is licensed under the ISC license.
|
|
512
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
513
|
+
*/const CN=re("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
|
|
514
|
+
* @license lucide-react v0.469.0 - ISC
|
|
515
|
+
*
|
|
516
|
+
* This source code is licensed under the ISC license.
|
|
517
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
518
|
+
*/const mn=re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
519
|
+
* @license lucide-react v0.469.0 - ISC
|
|
520
|
+
*
|
|
521
|
+
* This source code is licensed under the ISC license.
|
|
522
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
523
|
+
*/const _N=re("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Ay(e){var n,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(r=Ay(e[n]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function PN(){for(var e,n,r=0,i="",o=arguments.length;r<o;r++)(e=arguments[r])&&(n=Ay(e))&&(i&&(i+=" "),i+=n);return i}function F(...e){return PN(e)}function Dt({className:e,size:n=16,label:r}){return t.jsxs("span",{role:"status","aria-label":r??"Loading",className:F("inline-flex items-center gap-2 text-fg-subtle",e),children:[t.jsx(My,{className:"animate-spin",style:{width:n,height:n},"aria-hidden":!0}),r&&t.jsx("span",{className:"text-xs",children:r})]})}function tl({label:e="Loading…"}){return t.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:t.jsx(Dt,{size:18,label:e})})}function ou({className:e}){return t.jsx("span",{className:F("skeleton inline-block h-3 w-16 align-middle",e),"aria-hidden":!0})}class mf extends Error{constructor(r,i){super(i.message||i.error||`Request failed (${r})`);Sh(this,"status");Sh(this,"body");this.name="ApiRequestError",this.status=r,this.body=i}get code(){return this.body.error}}function Gs(e){return e instanceof mf}function ye(e,n="Something went wrong"){return Gs(e)?e.status===0?"Could not reach the server":e.body.message||e.body.error||n:e instanceof Error&&e.message||n}const vs={};function EN(e){Object.assign(vs,e)}const Ig="/api";function Ly(e,n){const r=e.startsWith("/")?`${Ig}${e}`:`${Ig}/${e}`;if(!n)return r;const i=new URLSearchParams;for(const[c,d]of Object.entries(n))d==null||d===""||i.set(c,String(d));const o=i.toString();return o?`${r}?${o}`:r}function RN(e){return typeof e=="object"&&e!==null&&typeof e.error=="string"}async function Kl(e,n,r,i={}){const o={accept:"application/json"};r!==void 0&&(o["content-type"]="application/json");let c;try{c=await fetch(Ly(n,i.query),{method:e,credentials:"same-origin",headers:o,body:r!==void 0?JSON.stringify(r):void 0,signal:i.signal})}catch(v){throw v instanceof DOMException&&v.name==="AbortError"?v:new mf(0,{error:"network",message:"Could not reach the server"})}const d=await c.text();let h=null;if(d)try{h=JSON.parse(d)}catch{h=d}if(c.ok)return h;const m=RN(h)?h:{error:`http_${c.status}`,message:typeof h=="string"&&h.slice(0,200)||c.statusText||`Request failed (${c.status})`},g=new mf(c.status,m);throw i.silent===!0||Array.isArray(i.silent)&&i.silent.includes(c.status)||MN(g),g}function MN(e){var n,r,i;switch(e.status){case 401:(n=vs.onUnauthenticated)==null||n.call(vs);break;case 402:(r=vs.onProRequired)==null||r.call(vs,e.body.feature);break;case 423:(i=vs.onDemoLocked)==null||i.call(vs,e.body.message);break}}const ae={get:(e,n)=>Kl("GET",e,void 0,n),post:(e,n,r)=>Kl("POST",e,n??{},r),patch:(e,n,r)=>Kl("PATCH",e,n??{},r),put:(e,n,r)=>Kl("PUT",e,n??{},r),del:(e,n)=>Kl("DELETE",e,void 0,n)},Be=e=>encodeURIComponent(e);var Ye;(function(e){e.assertEqual=o=>{};function n(o){}e.assertIs=n;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{const c={};for(const d of o)c[d]=d;return c},e.getValidEnumValues=o=>{const c=e.objectKeys(o).filter(h=>typeof o[o[h]]!="number"),d={};for(const h of c)d[h]=o[h];return e.objectValues(d)},e.objectValues=o=>e.objectKeys(o).map(function(c){return o[c]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const c=[];for(const d in o)Object.prototype.hasOwnProperty.call(o,d)&&c.push(d);return c},e.find=(o,c)=>{for(const d of o)if(c(d))return d},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function i(o,c=" | "){return o.map(d=>typeof d=="string"?`'${d}'`:d).join(c)}e.joinValues=i,e.jsonStringifyReplacer=(o,c)=>typeof c=="bigint"?c.toString():c})(Ye||(Ye={}));var qg;(function(e){e.mergeShapes=(n,r)=>({...n,...r})})(qg||(qg={}));const ge=Ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pr=e=>{switch(typeof e){case"undefined":return ge.undefined;case"string":return ge.string;case"number":return Number.isNaN(e)?ge.nan:ge.number;case"boolean":return ge.boolean;case"function":return ge.function;case"bigint":return ge.bigint;case"symbol":return ge.symbol;case"object":return Array.isArray(e)?ge.array:e===null?ge.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ge.promise:typeof Map<"u"&&e instanceof Map?ge.map:typeof Set<"u"&&e instanceof Set?ge.set:typeof Date<"u"&&e instanceof Date?ge.date:ge.object;default:return ge.unknown}},ee=Ye.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Js extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=n}format(n){const r=n||function(c){return c.message},i={_errors:[]},o=c=>{for(const d of c.issues)if(d.code==="invalid_union")d.unionErrors.map(o);else if(d.code==="invalid_return_type")o(d.returnTypeError);else if(d.code==="invalid_arguments")o(d.argumentsError);else if(d.path.length===0)i._errors.push(r(d));else{let h=i,m=0;for(;m<d.path.length;){const g=d.path[m];m===d.path.length-1?(h[g]=h[g]||{_errors:[]},h[g]._errors.push(r(d))):h[g]=h[g]||{_errors:[]},h=h[g],m++}}};return o(this),i}static assert(n){if(!(n instanceof Js))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ye.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=r=>r.message){const r={},i=[];for(const o of this.issues)if(o.path.length>0){const c=o.path[0];r[c]=r[c]||[],r[c].push(n(o))}else i.push(n(o));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}}Js.create=e=>new Js(e);const pf=(e,n)=>{let r;switch(e.code){case ee.invalid_type:e.received===ge.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ye.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ye.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ye.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${Ye.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ye.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=n.defaultError,Ye.assertNever(e)}return{message:r}};let TN=pf;function IN(){return TN}const qN=e=>{const{data:n,path:r,errorMaps:i,issueData:o}=e,c=[...r,...o.path||[]],d={...o,path:c};if(o.message!==void 0)return{...o,path:c,message:o.message};let h="";const m=i.filter(g=>!!g).slice().reverse();for(const g of m)h=g(d,{data:n,defaultError:h}).message;return{...o,path:c,message:h}};function ce(e,n){const r=IN(),i=qN({issueData:n,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===pf?void 0:pf].filter(o=>!!o)});e.common.issues.push(i)}class pn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,r){const i=[];for(const o of r){if(o.status==="aborted")return Oe;o.status==="dirty"&&n.dirty(),i.push(o.value)}return{status:n.value,value:i}}static async mergeObjectAsync(n,r){const i=[];for(const o of r){const c=await o.key,d=await o.value;i.push({key:c,value:d})}return pn.mergeObjectSync(n,i)}static mergeObjectSync(n,r){const i={};for(const o of r){const{key:c,value:d}=o;if(c.status==="aborted"||d.status==="aborted")return Oe;c.status==="dirty"&&n.dirty(),d.status==="dirty"&&n.dirty(),c.value!=="__proto__"&&(typeof d.value<"u"||o.alwaysSet)&&(i[c.value]=d.value)}return{status:n.value,value:i}}}const Oe=Object.freeze({status:"aborted"}),Yl=e=>({status:"dirty",value:e}),Gn=e=>({status:"valid",value:e}),Og=e=>e.status==="aborted",$g=e=>e.status==="dirty",Fi=e=>e.status==="valid",cu=e=>typeof Promise<"u"&&e instanceof Promise;var Se;(function(e){e.errToObj=n=>typeof n=="string"?{message:n}:n||{},e.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})(Se||(Se={}));class Cs{constructor(n,r,i,o){this._cachedPath=[],this.parent=n,this.data=r,this._path=i,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const zg=(e,n)=>{if(Fi(n))return{success:!0,data:n.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Js(e.common.issues);return this._error=r,this._error}}};function Fe(e){if(!e)return{};const{errorMap:n,invalid_type_error:r,required_error:i,description:o}=e;if(n&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:o}:{errorMap:(d,h)=>{const{message:m}=e;return d.code==="invalid_enum_value"?{message:m??h.defaultError}:typeof h.data>"u"?{message:m??i??h.defaultError}:d.code!=="invalid_type"?{message:h.defaultError}:{message:m??r??h.defaultError}},description:o}}class Ve{get description(){return this._def.description}_getType(n){return Pr(n.data)}_getOrReturnCtx(n,r){return r||{common:n.parent.common,data:n.data,parsedType:Pr(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new pn,ctx:{common:n.parent.common,data:n.data,parsedType:Pr(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const r=this._parse(n);if(cu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(n){const r=this._parse(n);return Promise.resolve(r)}parse(n,r){const i=this.safeParse(n,r);if(i.success)return i.data;throw i.error}safeParse(n,r){const i={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Pr(n)},o=this._parseSync({data:n,path:i.path,parent:i});return zg(i,o)}"~validate"(n){var i,o;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Pr(n)};if(!this["~standard"].async)try{const c=this._parseSync({data:n,path:[],parent:r});return Fi(c)?{value:c.value}:{issues:r.common.issues}}catch(c){(o=(i=c==null?void 0:c.message)==null?void 0:i.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:r}).then(c=>Fi(c)?{value:c.value}:{issues:r.common.issues})}async parseAsync(n,r){const i=await this.safeParseAsync(n,r);if(i.success)return i.data;throw i.error}async safeParseAsync(n,r){const i={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Pr(n)},o=this._parse({data:n,path:i.path,parent:i}),c=await(cu(o)?o:Promise.resolve(o));return zg(i,c)}refine(n,r){const i=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,c)=>{const d=n(o),h=()=>c.addIssue({code:ee.custom,...i(o)});return typeof Promise<"u"&&d instanceof Promise?d.then(m=>m?!0:(h(),!1)):d?!0:(h(),!1)})}refinement(n,r){return this._refinement((i,o)=>n(i)?!0:(o.addIssue(typeof r=="function"?r(i,o):r),!1))}_refinement(n){return new Ma({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ws.create(this,this._def)}nullable(){return Ta.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ss.create(this)}promise(){return pu.create(this,this._def)}or(n){return du.create([this,n],this._def)}and(n){return hu.create(this,n,this._def)}transform(n){return new Ma({...Fe(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const r=typeof n=="function"?n:()=>n;return new xu({...Fe(this._def),innerType:this,defaultValue:r,typeName:$e.ZodDefault})}brand(){return new Qy({typeName:$e.ZodBranded,type:this,...Fe(this._def)})}catch(n){const r=typeof n=="function"?n:()=>n;return new gu({...Fe(this._def),innerType:this,catchValue:r,typeName:$e.ZodCatch})}describe(n){const r=this.constructor;return new r({...this._def,description:n})}pipe(n){return Xf.create(this,n)}readonly(){return vu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ON=/^c[^\s-]{8,}$/i,$N=/^[0-9a-z]+$/,zN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,AN=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,LN=/^[a-z0-9_-]{21}$/i,FN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,UN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,QN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ih;const BN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,HN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,KN=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,WN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fy="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",GN=new RegExp(`^${Fy}$`);function Dy(e){let n="[0-5]\\d";e.precision?n=`${n}\\.\\d{${e.precision}}`:e.precision==null&&(n=`${n}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${r}`}function JN(e){return new RegExp(`^${Dy(e)}$`)}function XN(e){let n=`${Fy}T${Dy(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${r.join("|")})`,new RegExp(`^${n}$`)}function YN(e,n){return!!((n==="v4"||!n)&&BN.test(e)||(n==="v6"||!n)&&HN.test(e))}function ek(e,n){if(!FN.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(i));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||n&&o.alg!==n)}catch{return!1}}function tk(e,n){return!!((n==="v4"||!n)&&VN.test(e)||(n==="v6"||!n)&&KN.test(e))}class ws extends Ve{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==ge.string){const c=this._getOrReturnCtx(n);return ce(c,{code:ee.invalid_type,expected:ge.string,received:c.parsedType}),Oe}const i=new pn;let o;for(const c of this._def.checks)if(c.kind==="min")n.data.length<c.value&&(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),i.dirty());else if(c.kind==="max")n.data.length>c.value&&(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),i.dirty());else if(c.kind==="length"){const d=n.data.length>c.value,h=n.data.length<c.value;(d||h)&&(o=this._getOrReturnCtx(n,o),d?ce(o,{code:ee.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):h&&ce(o,{code:ee.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),i.dirty())}else if(c.kind==="email")UN.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"email",code:ee.invalid_string,message:c.message}),i.dirty());else if(c.kind==="emoji")Ih||(Ih=new RegExp(QN,"u")),Ih.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"emoji",code:ee.invalid_string,message:c.message}),i.dirty());else if(c.kind==="uuid")AN.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"uuid",code:ee.invalid_string,message:c.message}),i.dirty());else if(c.kind==="nanoid")LN.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"nanoid",code:ee.invalid_string,message:c.message}),i.dirty());else if(c.kind==="cuid")ON.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"cuid",code:ee.invalid_string,message:c.message}),i.dirty());else if(c.kind==="cuid2")$N.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"cuid2",code:ee.invalid_string,message:c.message}),i.dirty());else if(c.kind==="ulid")zN.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"ulid",code:ee.invalid_string,message:c.message}),i.dirty());else if(c.kind==="url")try{new URL(n.data)}catch{o=this._getOrReturnCtx(n,o),ce(o,{validation:"url",code:ee.invalid_string,message:c.message}),i.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"regex",code:ee.invalid_string,message:c.message}),i.dirty())):c.kind==="trim"?n.data=n.data.trim():c.kind==="includes"?n.data.includes(c.value,c.position)||(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),i.dirty()):c.kind==="toLowerCase"?n.data=n.data.toLowerCase():c.kind==="toUpperCase"?n.data=n.data.toUpperCase():c.kind==="startsWith"?n.data.startsWith(c.value)||(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.invalid_string,validation:{startsWith:c.value},message:c.message}),i.dirty()):c.kind==="endsWith"?n.data.endsWith(c.value)||(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.invalid_string,validation:{endsWith:c.value},message:c.message}),i.dirty()):c.kind==="datetime"?XN(c).test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.invalid_string,validation:"datetime",message:c.message}),i.dirty()):c.kind==="date"?GN.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.invalid_string,validation:"date",message:c.message}),i.dirty()):c.kind==="time"?JN(c).test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.invalid_string,validation:"time",message:c.message}),i.dirty()):c.kind==="duration"?DN.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"duration",code:ee.invalid_string,message:c.message}),i.dirty()):c.kind==="ip"?YN(n.data,c.version)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"ip",code:ee.invalid_string,message:c.message}),i.dirty()):c.kind==="jwt"?ek(n.data,c.alg)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"jwt",code:ee.invalid_string,message:c.message}),i.dirty()):c.kind==="cidr"?tk(n.data,c.version)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"cidr",code:ee.invalid_string,message:c.message}),i.dirty()):c.kind==="base64"?WN.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"base64",code:ee.invalid_string,message:c.message}),i.dirty()):c.kind==="base64url"?ZN.test(n.data)||(o=this._getOrReturnCtx(n,o),ce(o,{validation:"base64url",code:ee.invalid_string,message:c.message}),i.dirty()):Ye.assertNever(c);return{status:i.value,value:n.data}}_regex(n,r,i){return this.refinement(o=>n.test(o),{validation:r,code:ee.invalid_string,...Se.errToObj(i)})}_addCheck(n){return new ws({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...Se.errToObj(n)})}url(n){return this._addCheck({kind:"url",...Se.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...Se.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...Se.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...Se.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...Se.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...Se.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...Se.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...Se.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...Se.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...Se.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...Se.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...Se.errToObj(n)})}datetime(n){return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(n==null?void 0:n.offset)??!1,local:(n==null?void 0:n.local)??!1,...Se.errToObj(n==null?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,...Se.errToObj(n==null?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...Se.errToObj(n)})}regex(n,r){return this._addCheck({kind:"regex",regex:n,...Se.errToObj(r)})}includes(n,r){return this._addCheck({kind:"includes",value:n,position:r==null?void 0:r.position,...Se.errToObj(r==null?void 0:r.message)})}startsWith(n,r){return this._addCheck({kind:"startsWith",value:n,...Se.errToObj(r)})}endsWith(n,r){return this._addCheck({kind:"endsWith",value:n,...Se.errToObj(r)})}min(n,r){return this._addCheck({kind:"min",value:n,...Se.errToObj(r)})}max(n,r){return this._addCheck({kind:"max",value:n,...Se.errToObj(r)})}length(n,r){return this._addCheck({kind:"length",value:n,...Se.errToObj(r)})}nonempty(n){return this.min(1,Se.errToObj(n))}trim(){return new ws({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ws({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ws({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxLength(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}}ws.create=e=>new ws({checks:[],typeName:$e.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Fe(e)});function nk(e,n){const r=(e.toString().split(".")[1]||"").length,i=(n.toString().split(".")[1]||"").length,o=r>i?r:i,c=Number.parseInt(e.toFixed(o).replace(".","")),d=Number.parseInt(n.toFixed(o).replace(".",""));return c%d/10**o}class _a extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==ge.number){const c=this._getOrReturnCtx(n);return ce(c,{code:ee.invalid_type,expected:ge.number,received:c.parsedType}),Oe}let i;const o=new pn;for(const c of this._def.checks)c.kind==="int"?Ye.isInteger(n.data)||(i=this._getOrReturnCtx(n,i),ce(i,{code:ee.invalid_type,expected:"integer",received:"float",message:c.message}),o.dirty()):c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(i=this._getOrReturnCtx(n,i),ce(i,{code:ee.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(i=this._getOrReturnCtx(n,i),ce(i,{code:ee.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),o.dirty()):c.kind==="multipleOf"?nk(n.data,c.value)!==0&&(i=this._getOrReturnCtx(n,i),ce(i,{code:ee.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):c.kind==="finite"?Number.isFinite(n.data)||(i=this._getOrReturnCtx(n,i),ce(i,{code:ee.not_finite,message:c.message}),o.dirty()):Ye.assertNever(c);return{status:o.value,value:n.data}}gte(n,r){return this.setLimit("min",n,!0,Se.toString(r))}gt(n,r){return this.setLimit("min",n,!1,Se.toString(r))}lte(n,r){return this.setLimit("max",n,!0,Se.toString(r))}lt(n,r){return this.setLimit("max",n,!1,Se.toString(r))}setLimit(n,r,i,o){return new _a({...this._def,checks:[...this._def.checks,{kind:n,value:r,inclusive:i,message:Se.toString(o)}]})}_addCheck(n){return new _a({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:Se.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Se.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Se.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Se.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Se.toString(n)})}multipleOf(n,r){return this._addCheck({kind:"multipleOf",value:n,message:Se.toString(r)})}finite(n){return this._addCheck({kind:"finite",message:Se.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Se.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Se.toString(n)})}get minValue(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxValue(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&Ye.isInteger(n.value))}get isFinite(){let n=null,r=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(n===null||i.value<n)&&(n=i.value)}return Number.isFinite(r)&&Number.isFinite(n)}}_a.create=e=>new _a({checks:[],typeName:$e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Fe(e)});class Pa extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==ge.bigint)return this._getInvalidInput(n);let i;const o=new pn;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(i=this._getOrReturnCtx(n,i),ce(i,{code:ee.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(i=this._getOrReturnCtx(n,i),ce(i,{code:ee.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),o.dirty()):c.kind==="multipleOf"?n.data%c.value!==BigInt(0)&&(i=this._getOrReturnCtx(n,i),ce(i,{code:ee.not_multiple_of,multipleOf:c.value,message:c.message}),o.dirty()):Ye.assertNever(c);return{status:o.value,value:n.data}}_getInvalidInput(n){const r=this._getOrReturnCtx(n);return ce(r,{code:ee.invalid_type,expected:ge.bigint,received:r.parsedType}),Oe}gte(n,r){return this.setLimit("min",n,!0,Se.toString(r))}gt(n,r){return this.setLimit("min",n,!1,Se.toString(r))}lte(n,r){return this.setLimit("max",n,!0,Se.toString(r))}lt(n,r){return this.setLimit("max",n,!1,Se.toString(r))}setLimit(n,r,i,o){return new Pa({...this._def,checks:[...this._def.checks,{kind:n,value:r,inclusive:i,message:Se.toString(o)}]})}_addCheck(n){return new Pa({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Se.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Se.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Se.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Se.toString(n)})}multipleOf(n,r){return this._addCheck({kind:"multipleOf",value:n,message:Se.toString(r)})}get minValue(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n}get maxValue(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n}}Pa.create=e=>new Pa({checks:[],typeName:$e.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Fe(e)});class uu extends Ve{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==ge.boolean){const i=this._getOrReturnCtx(n);return ce(i,{code:ee.invalid_type,expected:ge.boolean,received:i.parsedType}),Oe}return Gn(n.data)}}uu.create=e=>new uu({typeName:$e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Fe(e)});class Di extends Ve{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==ge.date){const c=this._getOrReturnCtx(n);return ce(c,{code:ee.invalid_type,expected:ge.date,received:c.parsedType}),Oe}if(Number.isNaN(n.data.getTime())){const c=this._getOrReturnCtx(n);return ce(c,{code:ee.invalid_date}),Oe}const i=new pn;let o;for(const c of this._def.checks)c.kind==="min"?n.data.getTime()<c.value&&(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),i.dirty()):c.kind==="max"?n.data.getTime()>c.value&&(o=this._getOrReturnCtx(n,o),ce(o,{code:ee.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),i.dirty()):Ye.assertNever(c);return{status:i.value,value:new Date(n.data.getTime())}}_addCheck(n){return new Di({...this._def,checks:[...this._def.checks,n]})}min(n,r){return this._addCheck({kind:"min",value:n.getTime(),message:Se.toString(r)})}max(n,r){return this._addCheck({kind:"max",value:n.getTime(),message:Se.toString(r)})}get minDate(){let n=null;for(const r of this._def.checks)r.kind==="min"&&(n===null||r.value>n)&&(n=r.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const r of this._def.checks)r.kind==="max"&&(n===null||r.value<n)&&(n=r.value);return n!=null?new Date(n):null}}Di.create=e=>new Di({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$e.ZodDate,...Fe(e)});class Ag extends Ve{_parse(n){if(this._getType(n)!==ge.symbol){const i=this._getOrReturnCtx(n);return ce(i,{code:ee.invalid_type,expected:ge.symbol,received:i.parsedType}),Oe}return Gn(n.data)}}Ag.create=e=>new Ag({typeName:$e.ZodSymbol,...Fe(e)});class xf extends Ve{_parse(n){if(this._getType(n)!==ge.undefined){const i=this._getOrReturnCtx(n);return ce(i,{code:ee.invalid_type,expected:ge.undefined,received:i.parsedType}),Oe}return Gn(n.data)}}xf.create=e=>new xf({typeName:$e.ZodUndefined,...Fe(e)});class gf extends Ve{_parse(n){if(this._getType(n)!==ge.null){const i=this._getOrReturnCtx(n);return ce(i,{code:ee.invalid_type,expected:ge.null,received:i.parsedType}),Oe}return Gn(n.data)}}gf.create=e=>new gf({typeName:$e.ZodNull,...Fe(e)});class Lg extends Ve{constructor(){super(...arguments),this._any=!0}_parse(n){return Gn(n.data)}}Lg.create=e=>new Lg({typeName:$e.ZodAny,...Fe(e)});class vf extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(n){return Gn(n.data)}}vf.create=e=>new vf({typeName:$e.ZodUnknown,...Fe(e)});class Dr extends Ve{_parse(n){const r=this._getOrReturnCtx(n);return ce(r,{code:ee.invalid_type,expected:ge.never,received:r.parsedType}),Oe}}Dr.create=e=>new Dr({typeName:$e.ZodNever,...Fe(e)});class Fg extends Ve{_parse(n){if(this._getType(n)!==ge.undefined){const i=this._getOrReturnCtx(n);return ce(i,{code:ee.invalid_type,expected:ge.void,received:i.parsedType}),Oe}return Gn(n.data)}}Fg.create=e=>new Fg({typeName:$e.ZodVoid,...Fe(e)});class Ss extends Ve{_parse(n){const{ctx:r,status:i}=this._processInputParams(n),o=this._def;if(r.parsedType!==ge.array)return ce(r,{code:ee.invalid_type,expected:ge.array,received:r.parsedType}),Oe;if(o.exactLength!==null){const d=r.data.length>o.exactLength.value,h=r.data.length<o.exactLength.value;(d||h)&&(ce(r,{code:d?ee.too_big:ee.too_small,minimum:h?o.exactLength.value:void 0,maximum:d?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),i.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ce(r,{code:ee.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),i.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(ce(r,{code:ee.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((d,h)=>o.type._parseAsync(new Cs(r,d,r.path,h)))).then(d=>pn.mergeArray(i,d));const c=[...r.data].map((d,h)=>o.type._parseSync(new Cs(r,d,r.path,h)));return pn.mergeArray(i,c)}get element(){return this._def.type}min(n,r){return new Ss({...this._def,minLength:{value:n,message:Se.toString(r)}})}max(n,r){return new Ss({...this._def,maxLength:{value:n,message:Se.toString(r)}})}length(n,r){return new Ss({...this._def,exactLength:{value:n,message:Se.toString(r)}})}nonempty(n){return this.min(1,n)}}Ss.create=(e,n)=>new Ss({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...Fe(n)});function wi(e){if(e instanceof Mt){const n={};for(const r in e.shape){const i=e.shape[r];n[r]=Ws.create(wi(i))}return new Mt({...e._def,shape:()=>n})}else return e instanceof Ss?new Ss({...e._def,type:wi(e.element)}):e instanceof Ws?Ws.create(wi(e.unwrap())):e instanceof Ta?Ta.create(wi(e.unwrap())):e instanceof Ea?Ea.create(e.items.map(n=>wi(n))):e}class Mt extends Ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),r=Ye.objectKeys(n);return this._cached={shape:n,keys:r},this._cached}_parse(n){if(this._getType(n)!==ge.object){const g=this._getOrReturnCtx(n);return ce(g,{code:ee.invalid_type,expected:ge.object,received:g.parsedType}),Oe}const{status:i,ctx:o}=this._processInputParams(n),{shape:c,keys:d}=this._getCached(),h=[];if(!(this._def.catchall instanceof Dr&&this._def.unknownKeys==="strip"))for(const g in o.data)d.includes(g)||h.push(g);const m=[];for(const g of d){const p=c[g],v=o.data[g];m.push({key:{status:"valid",value:g},value:p._parse(new Cs(o,v,o.path,g)),alwaysSet:g in o.data})}if(this._def.catchall instanceof Dr){const g=this._def.unknownKeys;if(g==="passthrough")for(const p of h)m.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(g==="strict")h.length>0&&(ce(o,{code:ee.unrecognized_keys,keys:h}),i.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const p of h){const v=o.data[p];m.push({key:{status:"valid",value:p},value:g._parse(new Cs(o,v,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const g=[];for(const p of m){const v=await p.key,j=await p.value;g.push({key:v,value:j,alwaysSet:p.alwaysSet})}return g}).then(g=>pn.mergeObjectSync(i,g)):pn.mergeObjectSync(i,m)}get shape(){return this._def.shape()}strict(n){return Se.errToObj,new Mt({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(r,i)=>{var c,d;const o=((d=(c=this._def).errorMap)==null?void 0:d.call(c,r,i).message)??i.defaultError;return r.code==="unrecognized_keys"?{message:Se.errToObj(n).message??o}:{message:o}}}:{}})}strip(){return new Mt({...this._def,unknownKeys:"strip"})}passthrough(){return new Mt({...this._def,unknownKeys:"passthrough"})}extend(n){return new Mt({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Mt({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:$e.ZodObject})}setKey(n,r){return this.augment({[n]:r})}catchall(n){return new Mt({...this._def,catchall:n})}pick(n){const r={};for(const i of Ye.objectKeys(n))n[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new Mt({...this._def,shape:()=>r})}omit(n){const r={};for(const i of Ye.objectKeys(this.shape))n[i]||(r[i]=this.shape[i]);return new Mt({...this._def,shape:()=>r})}deepPartial(){return wi(this)}partial(n){const r={};for(const i of Ye.objectKeys(this.shape)){const o=this.shape[i];n&&!n[i]?r[i]=o:r[i]=o.optional()}return new Mt({...this._def,shape:()=>r})}required(n){const r={};for(const i of Ye.objectKeys(this.shape))if(n&&!n[i])r[i]=this.shape[i];else{let c=this.shape[i];for(;c instanceof Ws;)c=c._def.innerType;r[i]=c}return new Mt({...this._def,shape:()=>r})}keyof(){return Uy(Ye.objectKeys(this.shape))}}Mt.create=(e,n)=>new Mt({shape:()=>e,unknownKeys:"strip",catchall:Dr.create(),typeName:$e.ZodObject,...Fe(n)});Mt.strictCreate=(e,n)=>new Mt({shape:()=>e,unknownKeys:"strict",catchall:Dr.create(),typeName:$e.ZodObject,...Fe(n)});Mt.lazycreate=(e,n)=>new Mt({shape:e,unknownKeys:"strip",catchall:Dr.create(),typeName:$e.ZodObject,...Fe(n)});class du extends Ve{_parse(n){const{ctx:r}=this._processInputParams(n),i=this._def.options;function o(c){for(const h of c)if(h.result.status==="valid")return h.result;for(const h of c)if(h.result.status==="dirty")return r.common.issues.push(...h.ctx.common.issues),h.result;const d=c.map(h=>new Js(h.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:d}),Oe}if(r.common.async)return Promise.all(i.map(async c=>{const d={...r,common:{...r.common,issues:[]},parent:null};return{result:await c._parseAsync({data:r.data,path:r.path,parent:d}),ctx:d}})).then(o);{let c;const d=[];for(const m of i){const g={...r,common:{...r.common,issues:[]},parent:null},p=m._parseSync({data:r.data,path:r.path,parent:g});if(p.status==="valid")return p;p.status==="dirty"&&!c&&(c={result:p,ctx:g}),g.common.issues.length&&d.push(g.common.issues)}if(c)return r.common.issues.push(...c.ctx.common.issues),c.result;const h=d.map(m=>new Js(m));return ce(r,{code:ee.invalid_union,unionErrors:h}),Oe}}get options(){return this._def.options}}du.create=(e,n)=>new du({options:e,typeName:$e.ZodUnion,...Fe(n)});const Qs=e=>e instanceof jf?Qs(e.schema):e instanceof Ma?Qs(e.innerType()):e instanceof mu?[e.value]:e instanceof Ra?e.options:e instanceof bf?Ye.objectValues(e.enum):e instanceof xu?Qs(e._def.innerType):e instanceof xf?[void 0]:e instanceof gf?[null]:e instanceof Ws?[void 0,...Qs(e.unwrap())]:e instanceof Ta?[null,...Qs(e.unwrap())]:e instanceof Qy||e instanceof vu?Qs(e.unwrap()):e instanceof gu?Qs(e._def.innerType):[];class Jf extends Ve{_parse(n){const{ctx:r}=this._processInputParams(n);if(r.parsedType!==ge.object)return ce(r,{code:ee.invalid_type,expected:ge.object,received:r.parsedType}),Oe;const i=this.discriminator,o=r.data[i],c=this.optionsMap.get(o);return c?r.common.async?c._parseAsync({data:r.data,path:r.path,parent:r}):c._parseSync({data:r.data,path:r.path,parent:r}):(ce(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,r,i){const o=new Map;for(const c of r){const d=Qs(c.shape[n]);if(!d.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const h of d){if(o.has(h))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(h)}`);o.set(h,c)}}return new Jf({typeName:$e.ZodDiscriminatedUnion,discriminator:n,options:r,optionsMap:o,...Fe(i)})}}function yf(e,n){const r=Pr(e),i=Pr(n);if(e===n)return{valid:!0,data:e};if(r===ge.object&&i===ge.object){const o=Ye.objectKeys(n),c=Ye.objectKeys(e).filter(h=>o.indexOf(h)!==-1),d={...e,...n};for(const h of c){const m=yf(e[h],n[h]);if(!m.valid)return{valid:!1};d[h]=m.data}return{valid:!0,data:d}}else if(r===ge.array&&i===ge.array){if(e.length!==n.length)return{valid:!1};const o=[];for(let c=0;c<e.length;c++){const d=e[c],h=n[c],m=yf(d,h);if(!m.valid)return{valid:!1};o.push(m.data)}return{valid:!0,data:o}}else return r===ge.date&&i===ge.date&&+e==+n?{valid:!0,data:e}:{valid:!1}}class hu extends Ve{_parse(n){const{status:r,ctx:i}=this._processInputParams(n),o=(c,d)=>{if(Og(c)||Og(d))return Oe;const h=yf(c.value,d.value);return h.valid?(($g(c)||$g(d))&&r.dirty(),{status:r.value,value:h.data}):(ce(i,{code:ee.invalid_intersection_types}),Oe)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([c,d])=>o(c,d)):o(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}hu.create=(e,n,r)=>new hu({left:e,right:n,typeName:$e.ZodIntersection,...Fe(r)});class Ea extends Ve{_parse(n){const{status:r,ctx:i}=this._processInputParams(n);if(i.parsedType!==ge.array)return ce(i,{code:ee.invalid_type,expected:ge.array,received:i.parsedType}),Oe;if(i.data.length<this._def.items.length)return ce(i,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&i.data.length>this._def.items.length&&(ce(i,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const c=[...i.data].map((d,h)=>{const m=this._def.items[h]||this._def.rest;return m?m._parse(new Cs(i,d,i.path,h)):null}).filter(d=>!!d);return i.common.async?Promise.all(c).then(d=>pn.mergeArray(r,d)):pn.mergeArray(r,c)}get items(){return this._def.items}rest(n){return new Ea({...this._def,rest:n})}}Ea.create=(e,n)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ea({items:e,typeName:$e.ZodTuple,rest:null,...Fe(n)})};class fu extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:r,ctx:i}=this._processInputParams(n);if(i.parsedType!==ge.object)return ce(i,{code:ee.invalid_type,expected:ge.object,received:i.parsedType}),Oe;const o=[],c=this._def.keyType,d=this._def.valueType;for(const h in i.data)o.push({key:c._parse(new Cs(i,h,i.path,h)),value:d._parse(new Cs(i,i.data[h],i.path,h)),alwaysSet:h in i.data});return i.common.async?pn.mergeObjectAsync(r,o):pn.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(n,r,i){return r instanceof Ve?new fu({keyType:n,valueType:r,typeName:$e.ZodRecord,...Fe(i)}):new fu({keyType:ws.create(),valueType:n,typeName:$e.ZodRecord,...Fe(r)})}}class Dg extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:r,ctx:i}=this._processInputParams(n);if(i.parsedType!==ge.map)return ce(i,{code:ee.invalid_type,expected:ge.map,received:i.parsedType}),Oe;const o=this._def.keyType,c=this._def.valueType,d=[...i.data.entries()].map(([h,m],g)=>({key:o._parse(new Cs(i,h,i.path,[g,"key"])),value:c._parse(new Cs(i,m,i.path,[g,"value"]))}));if(i.common.async){const h=new Map;return Promise.resolve().then(async()=>{for(const m of d){const g=await m.key,p=await m.value;if(g.status==="aborted"||p.status==="aborted")return Oe;(g.status==="dirty"||p.status==="dirty")&&r.dirty(),h.set(g.value,p.value)}return{status:r.value,value:h}})}else{const h=new Map;for(const m of d){const g=m.key,p=m.value;if(g.status==="aborted"||p.status==="aborted")return Oe;(g.status==="dirty"||p.status==="dirty")&&r.dirty(),h.set(g.value,p.value)}return{status:r.value,value:h}}}}Dg.create=(e,n,r)=>new Dg({valueType:n,keyType:e,typeName:$e.ZodMap,...Fe(r)});class ao extends Ve{_parse(n){const{status:r,ctx:i}=this._processInputParams(n);if(i.parsedType!==ge.set)return ce(i,{code:ee.invalid_type,expected:ge.set,received:i.parsedType}),Oe;const o=this._def;o.minSize!==null&&i.data.size<o.minSize.value&&(ce(i,{code:ee.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&i.data.size>o.maxSize.value&&(ce(i,{code:ee.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());const c=this._def.valueType;function d(m){const g=new Set;for(const p of m){if(p.status==="aborted")return Oe;p.status==="dirty"&&r.dirty(),g.add(p.value)}return{status:r.value,value:g}}const h=[...i.data.values()].map((m,g)=>c._parse(new Cs(i,m,i.path,g)));return i.common.async?Promise.all(h).then(m=>d(m)):d(h)}min(n,r){return new ao({...this._def,minSize:{value:n,message:Se.toString(r)}})}max(n,r){return new ao({...this._def,maxSize:{value:n,message:Se.toString(r)}})}size(n,r){return this.min(n,r).max(n,r)}nonempty(n){return this.min(1,n)}}ao.create=(e,n)=>new ao({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Fe(n)});class jf extends Ve{get schema(){return this._def.getter()}_parse(n){const{ctx:r}=this._processInputParams(n);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}jf.create=(e,n)=>new jf({getter:e,typeName:$e.ZodLazy,...Fe(n)});class mu extends Ve{_parse(n){if(n.data!==this._def.value){const r=this._getOrReturnCtx(n);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:n.data}}get value(){return this._def.value}}mu.create=(e,n)=>new mu({value:e,typeName:$e.ZodLiteral,...Fe(n)});function Uy(e,n){return new Ra({values:e,typeName:$e.ZodEnum,...Fe(n)})}class Ra extends Ve{_parse(n){if(typeof n.data!="string"){const r=this._getOrReturnCtx(n),i=this._def.values;return ce(r,{expected:Ye.joinValues(i),received:r.parsedType,code:ee.invalid_type}),Oe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(n.data)){const r=this._getOrReturnCtx(n),i=this._def.values;return ce(r,{received:r.data,code:ee.invalid_enum_value,options:i}),Oe}return Gn(n.data)}get options(){return this._def.values}get enum(){const n={};for(const r of this._def.values)n[r]=r;return n}get Values(){const n={};for(const r of this._def.values)n[r]=r;return n}get Enum(){const n={};for(const r of this._def.values)n[r]=r;return n}extract(n,r=this._def){return Ra.create(n,{...this._def,...r})}exclude(n,r=this._def){return Ra.create(this.options.filter(i=>!n.includes(i)),{...this._def,...r})}}Ra.create=Uy;class bf extends Ve{_parse(n){const r=Ye.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(n);if(i.parsedType!==ge.string&&i.parsedType!==ge.number){const o=Ye.objectValues(r);return ce(i,{expected:Ye.joinValues(o),received:i.parsedType,code:ee.invalid_type}),Oe}if(this._cache||(this._cache=new Set(Ye.getValidEnumValues(this._def.values))),!this._cache.has(n.data)){const o=Ye.objectValues(r);return ce(i,{received:i.data,code:ee.invalid_enum_value,options:o}),Oe}return Gn(n.data)}get enum(){return this._def.values}}bf.create=(e,n)=>new bf({values:e,typeName:$e.ZodNativeEnum,...Fe(n)});class pu extends Ve{unwrap(){return this._def.type}_parse(n){const{ctx:r}=this._processInputParams(n);if(r.parsedType!==ge.promise&&r.common.async===!1)return ce(r,{code:ee.invalid_type,expected:ge.promise,received:r.parsedType}),Oe;const i=r.parsedType===ge.promise?r.data:Promise.resolve(r.data);return Gn(i.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}}pu.create=(e,n)=>new pu({type:e,typeName:$e.ZodPromise,...Fe(n)});class Ma extends Ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:r,ctx:i}=this._processInputParams(n),o=this._def.effect||null,c={addIssue:d=>{ce(i,d),d.fatal?r.abort():r.dirty()},get path(){return i.path}};if(c.addIssue=c.addIssue.bind(c),o.type==="preprocess"){const d=o.transform(i.data,c);if(i.common.async)return Promise.resolve(d).then(async h=>{if(r.value==="aborted")return Oe;const m=await this._def.schema._parseAsync({data:h,path:i.path,parent:i});return m.status==="aborted"?Oe:m.status==="dirty"||r.value==="dirty"?Yl(m.value):m});{if(r.value==="aborted")return Oe;const h=this._def.schema._parseSync({data:d,path:i.path,parent:i});return h.status==="aborted"?Oe:h.status==="dirty"||r.value==="dirty"?Yl(h.value):h}}if(o.type==="refinement"){const d=h=>{const m=o.refinement(h,c);if(i.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(i.common.async===!1){const h=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return h.status==="aborted"?Oe:(h.status==="dirty"&&r.dirty(),d(h.value),{status:r.value,value:h.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(h=>h.status==="aborted"?Oe:(h.status==="dirty"&&r.dirty(),d(h.value).then(()=>({status:r.value,value:h.value}))))}if(o.type==="transform")if(i.common.async===!1){const d=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Fi(d))return Oe;const h=o.transform(d.value,c);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:h}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(d=>Fi(d)?Promise.resolve(o.transform(d.value,c)).then(h=>({status:r.value,value:h})):Oe);Ye.assertNever(o)}}Ma.create=(e,n,r)=>new Ma({schema:e,typeName:$e.ZodEffects,effect:n,...Fe(r)});Ma.createWithPreprocess=(e,n,r)=>new Ma({schema:n,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...Fe(r)});class Ws extends Ve{_parse(n){return this._getType(n)===ge.undefined?Gn(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ws.create=(e,n)=>new Ws({innerType:e,typeName:$e.ZodOptional,...Fe(n)});class Ta extends Ve{_parse(n){return this._getType(n)===ge.null?Gn(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ta.create=(e,n)=>new Ta({innerType:e,typeName:$e.ZodNullable,...Fe(n)});class xu extends Ve{_parse(n){const{ctx:r}=this._processInputParams(n);let i=r.data;return r.parsedType===ge.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}xu.create=(e,n)=>new xu({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...Fe(n)});class gu extends Ve{_parse(n){const{ctx:r}=this._processInputParams(n),i={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return cu(o)?o.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Js(i.common.issues)},input:i.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Js(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}gu.create=(e,n)=>new gu({innerType:e,typeName:$e.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...Fe(n)});class Ug extends Ve{_parse(n){if(this._getType(n)!==ge.nan){const i=this._getOrReturnCtx(n);return ce(i,{code:ee.invalid_type,expected:ge.nan,received:i.parsedType}),Oe}return{status:"valid",value:n.data}}}Ug.create=e=>new Ug({typeName:$e.ZodNaN,...Fe(e)});class Qy extends Ve{_parse(n){const{ctx:r}=this._processInputParams(n),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}}class Xf extends Ve{_parse(n){const{status:r,ctx:i}=this._processInputParams(n);if(i.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Oe:c.status==="dirty"?(r.dirty(),Yl(c.value)):this._def.out._parseAsync({data:c.value,path:i.path,parent:i})})();{const o=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?Oe:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:i.path,parent:i})}}static create(n,r){return new Xf({in:n,out:r,typeName:$e.ZodPipeline})}}class vu extends Ve{_parse(n){const r=this._def.innerType._parse(n),i=o=>(Fi(o)&&(o.value=Object.freeze(o.value)),o);return cu(r)?r.then(o=>i(o)):i(r)}unwrap(){return this._def.innerType}}vu.create=(e,n)=>new vu({innerType:e,typeName:$e.ZodReadonly,...Fe(n)});var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const he=ws.create,hn=_a.create;Pa.create;const _s=uu.create;Di.create;const Qg=vf.create;Dr.create;const nl=Ss.create,ze=Mt.create,By=du.create,qu=Jf.create;hu.create;Ea.create;const Vy=fu.create,Nn=mu.create,Es=Ra.create;pu.create;Ws.create;Ta.create;const Xs={string:(e=>ws.create({...e,coerce:!0})),number:(e=>_a.create({...e,coerce:!0})),boolean:(e=>uu.create({...e,coerce:!0})),bigint:(e=>Pa.create({...e,coerce:!0})),date:(e=>Di.create({...e,coerce:!0}))},Yf=["alerts","users","folders","flows","audit","sso","mcp"],Hy={monthlyUsd:39,yearlyUsd:390},Ky=he().trim().min(8).max(512);ze({key:Ky,instance:ze({label:he().trim().min(1).max(120),version:he().max(40).optional()})});ze({key:Ky,activationId:he().trim().min(1).max(120)});const yu=["admin","operator","viewer"],sk="anonymous";function rk(e){return(e==null?void 0:e.id)===sk}const Wy=Es(yu),ak=ze({email:he().email(),name:he().min(1).max(80),password:he().min(8).max(200)}),ik=ze({email:he().email(),password:he().min(1)}),lk=ze({email:he().email(),name:he().min(1).max(80),role:Wy,password:he().min(8).max(200).optional()});ze({name:he().min(1).max(80).optional(),role:Wy.optional(),password:he().min(8).max(200).optional(),disabled:_s().optional()});const Zy=ze({issuer:he().url(),clientId:he().min(1).max(255),clientSecret:he().min(1).max(500).optional(),scopes:nl(he().min(1).max(60)).max(20).optional(),emailClaim:he().min(1).max(60).optional()}),Gy=ze({entryPoint:he().url(),issuer:he().min(1).max(255),idpCert:he().min(1).max(1e4),emailAttribute:he().min(1).max(200).optional()}),ok=qu("kind",[ze({kind:Nn("oidc"),name:he().min(1).max(60),enabled:_s().optional(),config:Zy.extend({clientSecret:he().min(1).max(500)})}),ze({kind:Nn("saml"),name:he().min(1).max(60),enabled:_s().optional(),config:Gy})]);ze({name:he().min(1).max(60).optional(),enabled:_s().optional(),config:By([Zy.partial(),Gy.partial()]).optional()});const Jy=he().trim().toLowerCase().transform(e=>e.replace(/^@/,"")).pipe(he().regex(/^(?=.{3,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/,"Enter a domain like example.com"));ze({requireSso:_s().optional(),autoProvision:_s().optional(),autoProvisionDomains:nl(Jy).max(50).optional()});const Xy=ze({name:he().min(1).max(80),url:he().min(1).refine(e=>/^rediss?:\/\//.test(e),"Must start with redis:// or rediss://"),prefix:he().min(1).max(64).default("bull"),cluster:_s().default(!1),queueFilter:he().max(200).nullable().optional()});Xy.partial();ze({ids:nl(he().min(1)).min(1)});ze({url:he().min(1),prefix:he().optional(),cluster:_s().optional()});const io=["waiting","active","completed","failed","delayed","prioritized","paused","waiting-children"],Yy=Es(io),ck=["waiting","limited","maxed","paused"];ze({page:Xs.number().int().min(1).default(1),pageSize:Xs.number().int().min(1).max(200).default(25)});ze({q:he().max(200).optional(),withinMs:Xs.number().int().min(0).optional(),limit:Xs.number().int().min(1).max(1e3).default(500)});const uk=ze({name:he().min(1).max(200).default("__default__"),data:Qg().default({}),opts:Vy(Qg()).default({})}),e0=ze({state:Es(["completed","failed","delayed","wait","active","paused","prioritized"]),grace:hn().int().min(0).default(0),limit:hn().int().min(1).max(1e5).default(1e3)});ze({reason:he().trim().max(500).optional()});const ju=500,dk=["run_copy","skip_next"];ze({scheduler:Es(dk).default("run_copy")});ze({jobIds:nl(he().min(1).max(200)).min(1,"jobIds must not be empty").max(ju,`at most ${ju} job ids per call`)});ze({state:Yy.default("waiting"),groupId:he().min(1).max(200).optional(),page:Xs.number().int().min(1).default(1),pageSize:Xs.number().int().min(1).max(200).default(25),order:Es(["asc","desc"]).default("desc")});ze({state:Yy.default("failed"),q:he().min(1).max(500),cursor:he().optional(),limit:Xs.number().int().min(1).max(200).default(50)});ze({queueName:he().min(1).max(255)});const t0=ze({name:he().min(1).max(80),color:he().max(20).nullable().optional(),parentId:he().nullable().optional()}),hk=t0.partial().extend({position:hn().int().min(0).optional()});ze({queues:nl(ze({connectionId:he(),queueName:he()}))});const fk=ze({waitingAbove:hn().int().min(0).max(1e7).default(0),failedAbove:hn().int().min(0).max(1e7).default(0)}),bu={waitingAbove:0,failedAbove:0},mk=100,pk=["waiting_above","failed_above","failed_rate_above","duration_above"],xk=["failed_above","failed_rate_above"];function gk(e){return xk.includes(e)}const vk=qu("kind",[ze({kind:Nn("waiting_above"),threshold:hn().int().min(1)}),ze({kind:Nn("failed_above"),threshold:hn().int().min(1),windowMinutes:hn().int().min(1).max(1440).default(5)}),ze({kind:Nn("failed_rate_above"),percent:hn().min(.1).max(100),windowMinutes:hn().int().min(1).max(1440).default(5),minSample:hn().int().min(1).default(20)}),ze({kind:Nn("duration_above"),seconds:hn().min(.001).max(86400),percentile:By([Nn(50),Nn(95)]).default(95),windowMinutes:hn().int().min(1).max(1440).default(15),minSample:hn().int().min(1).max(mk).default(5)})]),yk=qu("type",[ze({type:Nn("queue"),connectionId:he().min(1),queueName:he().min(1)}),ze({type:Nn("folder"),folderId:he().min(1)}),ze({type:Nn("connection"),connectionId:he().min(1)}),ze({type:Nn("global")})]),jk=qu("type",[ze({type:Nn("slack"),webhookUrl:he().url()}),ze({type:Nn("webhook"),url:he().url(),headers:Vy(he()).optional()})]),n0=ze({name:he().min(1).max(120),enabled:_s().default(!0),scope:yk,condition:vk,channels:nl(jk).default([]),cooldownMinutes:hn().int().min(1).max(1440).default(30)});n0.partial();const em=["job.add","job.retry","job.remove","job.promote","job.discard","job.bulk_retry","job.bulk_remove","job.bulk_promote","queue.pause","queue.resume","queue.clean","queue.retry_all","queue.drain","queue.obliterate","scheduler.remove","queue.hide","queue.unhide","connection.create","connection.update","connection.delete","user.create","user.update","user.delete","user.disable","user.enable","alert.create","alert.update","alert.delete","license.set","license.remove","sso.provider_create","sso.provider_update","sso.provider_delete","attention.thresholds_update","auth.login","auth.login_failed","auth.logout","auth.sso_login","auth.sso_denied","auth.sso_provisioned","mcp.settings_update","mcp.authorize","mcp.revoke"],tm={"job.add":"added a job","job.retry":"retried a job","job.remove":"removed a job","job.promote":"promoted a job","job.discard":"discarded a job","job.bulk_retry":"retried jobs in bulk","job.bulk_remove":"removed jobs in bulk","job.bulk_promote":"promoted jobs in bulk","queue.pause":"paused the queue","queue.resume":"resumed the queue","queue.clean":"cleaned the queue","queue.retry_all":"retried every job in a state","queue.drain":"drained the queue","queue.obliterate":"obliterated the queue","scheduler.remove":"removed a job scheduler","queue.hide":"hid the queue","queue.unhide":"unhid the queue","connection.create":"added a connection","connection.update":"edited a connection","connection.delete":"deleted a connection","user.create":"invited a user","user.update":"edited a user","user.delete":"deleted a user","user.disable":"disabled a user","user.enable":"re-enabled a user","alert.create":"created an alert","alert.update":"edited an alert","alert.delete":"deleted an alert","license.set":"applied a license key","license.remove":"removed the license key","sso.provider_create":"added an SSO provider","sso.provider_update":"edited an SSO provider","sso.provider_delete":"deleted an SSO provider","attention.thresholds_update":"changed the attention thresholds","auth.login":"signed in","auth.login_failed":"failed to sign in","auth.logout":"signed out","auth.sso_login":"signed in with SSO","auth.sso_denied":"was refused by SSO (no account)","auth.sso_provisioned":"joined through SSO (auto-provisioned)","mcp.settings_update":"changed the MCP access level","mcp.authorize":"connected an MCP client","mcp.revoke":"disconnected an MCP client"},bk=["queue.obliterate","queue.drain","queue.clean","job.remove","job.bulk_remove","connection.delete","user.create","user.update","user.delete","license.set","license.remove","auth.login_failed","sso.provider_create","sso.provider_update","sso.provider_delete","auth.sso_provisioned","mcp.settings_update","mcp.authorize"],wk=Es(em);ze({limit:Xs.number().int().min(1).max(200).default(50),cursor:he().max(200).optional(),actorId:he().max(36).optional(),action:wk.optional(),connectionId:he().max(36).optional(),queueName:he().max(255).optional(),jobId:he().max(255).optional(),result:Es(["ok","error"]).optional(),from:he().datetime({offset:!0}).optional(),to:he().datetime({offset:!0}).optional()});ze({connectionId:he(),from:he().min(1),to:he().min(1),label:he().max(120).nullable().optional()});ze({maxNodes:Xs.number().int().min(1).max(500).default(200),fromRoot:Es(["true","false"]).default("true").transform(e=>e==="true")});const Bg={admin:3,operator:2,viewer:1};function Vg(e,n){return Bg[e]>=Bg[n]}const Nk=["off","read","write"];ze({maxAccess:Es(Nk)});ze({request:he().min(1).max(4096),approve:_s(),access:Es(["read","write"]).default("read")});let Ui={open:!1,feature:"alerts"};const wf=new Set;function s0(e){Ui=e,wf.forEach(n=>n())}function lo(e){s0({open:!0,feature:e??Ui.feature})}function qh(){Ui.open&&s0({...Ui,open:!1})}function kk(){return N.useSyncExternalStore(e=>(wf.add(e),()=>wf.delete(e)),()=>Ui,()=>Ui)}let ka=[],Sk=0;const Nf=new Set;function r0(){Nf.forEach(e=>e())}function Ck(e){return Nf.add(e),()=>Nf.delete(e)}function yi(e,n,r={}){const i=ka.find(c=>c.message===n&&c.kind===e);if(i)return i.id;const o=++Sk;return ka=[...ka,{id:o,kind:e,message:n,description:r.description,durationMs:r.durationMs??(r.action?8e3:e==="error"?6e3:3500),action:r.action}],r0(),o}function Oh(e){ka=ka.filter(n=>n.id!==e),r0()}const Y=Object.assign((e,n)=>yi((n==null?void 0:n.kind)??"info",e,n),{info:(e,n)=>yi("info",e,{description:n}),success:(e,n)=>yi("success",e,{description:n}),error:(e,n)=>yi("error",e,{description:n}),warning:(e,n)=>yi("warning",e,{description:n}),undoable:(e,n,r)=>yi("success",e,{description:r,action:n})}),_k={info:Xi,success:Vf,error:Cy,warning:Zn},Pk={info:"text-info",success:"text-success",error:"text-danger",warning:"text-warning"};function Ek({item:e}){N.useEffect(()=>{const r=setTimeout(()=>Oh(e.id),e.durationMs);return()=>clearTimeout(r)},[e.id,e.durationMs]);const n=_k[e.kind];return t.jsxs("div",{role:e.kind==="error"?"alert":"status",className:"toast-in pointer-events-auto flex w-80 items-start gap-2.5 rounded-lg border border-border bg-surface px-3 py-2.5 text-[13px] shadow-[var(--shadow)]",children:[t.jsx(n,{className:F("mt-px size-4 shrink-0",Pk[e.kind]),"aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-fg",children:e.message}),e.description&&t.jsx("p",{className:"mt-0.5 text-xs break-words text-fg-muted",children:e.description}),e.action&&t.jsx("button",{type:"button",className:"mt-1.5 rounded text-xs font-medium text-accent hover:underline",onClick:()=>{var r;(r=e.action)==null||r.onClick(),Oh(e.id)},children:e.action.label})]}),t.jsx("button",{type:"button","aria-label":"Dismiss",onClick:()=>Oh(e.id),className:"-mr-1 rounded p-0.5 text-fg-subtle hover:text-fg",children:t.jsx(mn,{className:"size-3.5"})})]})}function Rk(){const e=N.useSyncExternalStore(Ck,()=>ka,()=>ka);return e.length===0?null:t.jsx("div",{className:"pointer-events-none fixed right-4 bottom-4 z-[100] flex flex-col items-end gap-2","aria-live":"polite",children:e.map(n=>t.jsx(Ek,{item:n},n.id))})}const a0=N.createContext(null);function Mk({children:e}){const[n,r]=N.useState(null),[i,o]=N.useState(null),[c,d]=N.useState(!1),[h,m]=N.useState(!0),[g,p]=N.useState(!0),v=sn(),j=$n(),C=We(),y=N.useRef(j);y.current=j;const b=N.useRef(h);b.current=h;const k=N.useCallback(async()=>{const[$,z]=await Promise.allSettled([ae.get("/setup/status",{silent:!0}),ae.get("/edition",{silent:!0})]);$.status==="fulfilled"&&(d(!!$.value.needsSetup),m($.value.authRequired!==!1)),z.status==="fulfilled"&&o(z.value)},[]),S=N.useCallback(async()=>{try{const $=await ae.get("/auth/me",{silent:!0});r($.user),o($.edition),d(!1),m($.edition.features.users)}catch($){r(null),Gs($)&&$.status===401?await k():Gs($)&&$.status===0&&Y.error("Could not reach the server")}finally{p(!1)}},[k]),O=N.useRef(S);O.current=S,N.useEffect(()=>{S()},[S]),N.useEffect(()=>{EN({onUnauthenticated:()=>{if(!b.current){O.current();return}r(null),C.clear();const $=y.current.pathname;!$.startsWith("/login")&&!$.startsWith("/setup")&&v("/login",{replace:!0,state:{from:y.current}})},onProRequired:$=>lo($),onDemoLocked:()=>Y.warning("This action is locked in the demo")})},[v,C]);const q=N.useCallback(async $=>{const z=await ae.post("/auth/login",$,{silent:[401]});return r(z.user),o(z.edition),d(!1),C.clear(),z},[C]),E=N.useCallback(async $=>{const z=await ae.post("/setup",$);return r(z.user),o(z.edition),d(!1),z},[]),T=N.useCallback(async()=>{try{await ae.post("/auth/logout",{},{silent:!0})}finally{r(null),C.clear(),v("/login",{replace:!0})}},[v,C]),M=N.useMemo(()=>({user:n,edition:i,loading:g,needsSetup:c,authRequired:h,isAnonymous:rk(n),refresh:S,login:q,setup:E,logout:T,setEdition:o,can:$=>n?Vg(n.role,$):!1,isAdmin:(n==null?void 0:n.role)==="admin",isOperator:n?Vg(n.role,"operator"):!1}),[n,i,g,c,h,S,q,E,T]);return t.jsx(a0.Provider,{value:M,children:e})}function yt(){const e=N.useContext(a0);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function nn({icon:e,title:n,description:r,action:i,className:o,compact:c}){return t.jsxs("div",{className:F("flex flex-col items-center justify-center text-center",c?"gap-2 px-4 py-8":"gap-3 px-6 py-16",o),children:[e&&t.jsx("div",{className:"flex size-10 items-center justify-center rounded-lg border border-border bg-surface-2 text-fg-subtle [&_svg]:size-5",children:e}),t.jsxs("div",{className:"max-w-sm",children:[t.jsx("h3",{className:"text-sm font-semibold text-fg",children:n}),r&&t.jsx("p",{className:"mt-1 text-xs leading-relaxed text-fg-muted",children:r})]}),i&&t.jsx("div",{className:"mt-1 flex items-center gap-2",children:i})]})}function Tk(){const{user:e,loading:n,needsSetup:r}=yt(),i=$n();return n?t.jsx(l0,{}):e?t.jsx(Yv,{}):r?t.jsx(Fr,{to:"/setup",replace:!0}):t.jsx(Fr,{to:"/login",replace:!0,state:{from:i}})}function Hg({children:e}){const{user:n,loading:r,authRequired:i}=yt();return r?t.jsx(l0,{}):n||!i?t.jsx(Fr,{to:"/",replace:!0}):t.jsx(t.Fragment,{children:e})}function i0({role:e,children:n}){const{can:r}=yt();return r(e)?t.jsx(t.Fragment,{children:n}):t.jsx(nn,{icon:t.jsx(Wf,{}),title:`${e==="admin"?"Admins":"Operators"} only`,description:"Your role does not allow this page. Ask an admin to change your role if you need access."})}function l0(){return t.jsx("div",{className:"flex h-full min-h-screen w-full items-center justify-center bg-bg",children:t.jsx(tl,{})})}const Ik={primary:"bg-accent text-accent-fg hover:bg-accent-hover border border-transparent",secondary:"bg-surface-2 text-fg border border-border hover:bg-surface-3 hover:border-border-strong",outline:"bg-transparent text-fg border border-border-strong hover:bg-surface-2",ghost:"bg-transparent text-fg-muted border border-transparent hover:text-fg hover:bg-surface-2",danger:"bg-danger/90 text-white border border-transparent hover:bg-danger",link:"bg-transparent text-accent border border-transparent hover:underline px-0 h-auto"},qk={xs:"h-6 px-2 text-[11px] gap-1 [&_svg]:size-3",sm:"h-7 px-2.5 text-xs gap-1.5 [&_svg]:size-3.5",md:"h-8 px-3 text-[13px] gap-1.5 [&_svg]:size-4",icon:"h-8 w-8 [&_svg]:size-4","icon-sm":"h-7 w-7 [&_svg]:size-3.5","icon-xs":"h-6 w-6 [&_svg]:size-3"},V=N.forwardRef(function({variant:n="secondary",size:r="md",loading:i,leftIcon:o,rightIcon:c,className:d,children:h,disabled:m,type:g="button",...p},v){return t.jsxs("button",{ref:v,type:g,disabled:m||i,className:F("inline-flex shrink-0 select-none items-center justify-center rounded-md font-medium whitespace-nowrap transition-colors outline-none","focus-visible:ring-2 focus-visible:ring-accent/60 disabled:pointer-events-none disabled:opacity-50",Ik[n],qk[r],d),...p,children:[i?t.jsx(My,{className:"animate-spin","aria-hidden":!0}):o,h,!i&&c]})}),Ok={sm:"26rem",md:"32rem",lg:"44rem",xl:"60rem"};function Sn({open:e,onClose:n,title:r,description:i,children:o,footer:c,size:d="md",hideClose:h,className:m,bodyClassName:g}){const p=N.useRef(null),v=N.useId(),j=N.useId();N.useEffect(()=>{const y=p.current;y&&(e&&!y.open?y.showModal():!e&&y.open&&y.close())},[e]);const C=y=>{y.target===p.current&&n()};return t.jsx("dialog",{ref:p,className:F("dialog",m),style:{"--dialog-w":Ok[d]},"aria-labelledby":r?v:void 0,"aria-describedby":i?j:void 0,onClose:()=>{e&&n()},onCancel:y=>{y.preventDefault(),n()},onClick:C,children:e&&t.jsxs("div",{className:"flex max-h-[90vh] flex-col",onClick:y=>y.stopPropagation(),children:[(r||!h)&&t.jsxs("header",{className:"flex items-start gap-3 border-b border-border px-5 py-3.5",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[r&&t.jsx("h2",{id:v,className:"text-sm font-semibold text-fg",children:r}),i&&t.jsx("p",{id:j,className:"mt-0.5 text-xs text-fg-muted",children:i})]}),!h&&t.jsx(V,{variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:n,className:"-mr-1.5 -mt-0.5",children:t.jsx(mn,{})})]}),t.jsx("div",{className:F("min-h-0 flex-1 overflow-y-auto px-5 py-4",g),children:o}),c&&t.jsx("footer",{className:"flex items-center justify-end gap-2 border-t border-border bg-surface-2/50 px-5 py-3",children:c})]})})}const oo={alerts:{title:"Alerts",tagline:"Know before your users do. Slack or webhook, evaluated server-side every few seconds.",bullets:["Waiting above N, failures in a window, failure-rate %, connection down","Scope to one queue, a whole connection, or everything","Cooldown per alert and an events feed with delivery status"]},users:{title:"Users & roles",tagline:"Give the whole team a login without giving everyone the obliterate button.",bullets:["Admin, operator and viewer roles enforced on every endpoint","Invite by email with a temporary password","Last-login audit and safe deletion guards"]},folders:{title:"Folders",tagline:"Organise hundreds of queues across connections the way your teams think about them.",bullets:["Nested folders with colours, shown in the sidebar","Assign queues from any connection with a picker","The default stays one folder per connection, so nothing breaks"]},audit:{title:"Audit log",tagline:"Who paused the payments queue, when, from which IP — persisted, filterable, exportable.",bullets:["Every mutating action recorded: jobs, queues, connections, users, license, logins","Failed attempts included, so a refused obliterate is a finding and not silence","CSV export for compliance, one-year retention, and never the job payload"]},flows:{title:"Flows",tagline:"See how queues feed each other, detected from BullMQ flow parents plus your own edges.",bullets:["Edges detected from job parent references with evidence counts","Manual edges for producer → consumer relationships Redis cannot see","Auto-layout graph with live counts and paused state per queue"]},sso:{title:"SSO",tagline:"Your identity provider decides who is who. Configured in this UI, not in a YAML file.",bullets:["OIDC (Google Workspace, Entra ID, Okta, Keycloak, Authentik) and SAML 2.0","Accounts stay pre-provisioned: the IdP proves identity, you still assign the role","Require SSO for the team while admins keep a password way in"]},mcp:{title:"MCP",tagline:"Ask your AI why the payments queue is failing, and let it retry the jobs — as you, with your role.",bullets:["Claude or any MCP client with OAuth; sign in with your Bullpane login or SSO","Read or read & write: the admin sets the ceiling, a viewer can never write","Every action lands in the audit log; drain and obliterate stay in the dashboard"]}},$k={tier:"free",demo:!1,features:Object.fromEntries(Yf.map(e=>[e,!1])),license:null,pricing:Hy,checkoutUrl:""};function jt(){const{edition:e}=yt(),n=e??$k,r=N.useCallback(o=>{var c;return!!((c=n.features)!=null&&c[o])},[n]),i=N.useCallback((o,c)=>r(o)?(c==null||c(),!0):(lo(o),!1),[r]);return N.useMemo(()=>({edition:n,tier:n.tier,isPro:n.tier==="pro",demo:!!n.demo,pricing:n.pricing??Hy,checkoutUrl:n.checkoutUrl??"",has:r,gate:i}),[n,r,i])}function zk(){const{open:e,feature:n}=kk(),{pricing:r,checkoutUrl:i,demo:o}=jt(),c=oo[n];return t.jsxs(Sn,{open:e,onClose:qh,size:"md",title:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(wN,{className:"size-4 text-pro","aria-hidden":!0}),c.title," is a Pro feature"]}),description:c.tagline,footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:qh,children:"Not now"}),t.jsxs(Re,{to:"/settings/license",onClick:qh,className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-border-strong px-2.5 text-xs font-medium text-fg hover:bg-surface-2",children:[t.jsx(Yi,{className:"size-3.5","aria-hidden":!0}),"I have a key"]}),t.jsxs("a",{href:i||"#",target:"_blank",rel:"noreferrer noopener","aria-disabled":!i,className:"inline-flex h-7 items-center gap-1.5 rounded-md bg-accent px-3 text-xs font-medium text-accent-fg hover:bg-accent-hover aria-disabled:pointer-events-none aria-disabled:opacity-50",children:["Unlock Pro · $",r.monthlyUsd,"/mo or $",r.yearlyUsd,"/yr",t.jsx(Lr,{className:"size-3.5","aria-hidden":!0})]})]}),children:[t.jsx("ul",{className:"space-y-2",children:c.bullets.map(d=>t.jsxs("li",{className:"flex items-start gap-2 text-[13px] text-fg",children:[t.jsx(Qr,{className:"mt-0.5 size-4 shrink-0 text-success","aria-hidden":!0}),t.jsx("span",{children:d})]},d))}),t.jsxs("div",{className:"mt-4 rounded-md border border-border bg-surface-2/60 p-3 text-xs text-fg-muted",children:[t.jsxs("p",{children:["One subscription unlocks every Pro feature — ",Yf.map(d=>oo[d].title).join(", ")," — for this installation. $",r.monthlyUsd,"/month or $",r.yearlyUsd,"/year, unlimited users. Your data stays on your servers; only the key is verified with bullpane.com."]}),o&&t.jsx("p",{className:"mt-2 text-warning",children:"You are in demo mode: Pro is already unlocked here."})]})]})}function Ak(e){if(!e)return!1;const n=e.tagName;return n==="INPUT"||n==="TEXTAREA"||n==="SELECT"?!0:e.isContentEditable}function o0(e,n,r={}){const{mod:i=!1,allowInInputs:o=!1,enabled:c=!0}=r;N.useEffect(()=>{if(!c)return;const d=h=>{if(h.key.toLowerCase()!==e.toLowerCase())return;const m=h.metaKey||h.ctrlKey;i===m&&(!i&&h.altKey||!o&&Ak(document.activeElement)||!i&&document.querySelector("dialog[open]")||n(h))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,n,i,o,c])}const Lk=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),c0=Lk?"⌘":"Ctrl",Nt=encodeURIComponent,oe={home:"/",login:"/login",setup:"/setup",connection:e=>`/c/${Nt(e)}`,queue:(e,n,r)=>`/c/${Nt(e)}/q/${Nt(n)}${r?`?state=${r}`:""}`,queueSearch:(e,n,r)=>`/c/${Nt(e)}/q/${Nt(n)}?search=1${r?`&state=${r}`:""}`,job:(e,n,r)=>`/c/${Nt(e)}/q/${Nt(n)}/j/${Nt(r)}`,jobTree:(e,n,r)=>`/c/${Nt(e)}/q/${Nt(n)}/j/${Nt(r)}/tree`,groups:(e,n)=>`/c/${Nt(e)}/q/${Nt(n)}/groups`,group:(e,n,r)=>`/c/${Nt(e)}/q/${Nt(n)}/groups/${Nt(r)}`,queueMetrics:(e,n)=>`/c/${Nt(e)}/q/${Nt(n)}/metrics`,queueSchedulers:(e,n)=>`/c/${Nt(e)}/q/${Nt(n)}/schedulers`,schedulers:e=>e?`/schedulers/${Nt(e)}`:"/schedulers",health:"/health",folders:"/folders",folder:e=>`/folders/${Nt(e)}`,alerts:"/alerts",users:"/users",audit:e=>{if(!e)return"/audit";const n=new URLSearchParams;for(const[i,o]of Object.entries(e))o&&n.set(i,o);const r=n.toString();return r?`/audit?${r}`:"/audit"},flows:e=>e?`/flows/${Nt(e)}`:"/flows",settings:(e="connections")=>`/settings/${e}`};function Kg(e,n){const r=e.indexOf(":");return r>=0?e.slice(r+1):e}function co(e){return((e==null?void 0:e.failed)??0)>0?"failed":((e==null?void 0:e.waiting)??0)>0?"waiting":((e==null?void 0:e.prioritized)??0)>0?"prioritized":"completed"}const u0=new Intl.NumberFormat("en-US"),d0=new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1});function W(e){return e==null||Number.isNaN(e)?"–":u0.format(e)}function mt(e){return e==null||Number.isNaN(e)?"–":Math.abs(e)<1e4?u0.format(e):d0.format(e)}function On(e,n=1){return e==null||Number.isNaN(e)?"–":`${e.toFixed(n)}%`}function Ns(e){if(e==null||Number.isNaN(e))return"–";if(e<1024)return`${e} B`;const n=["KB","MB","GB","TB","PB"];let r=e/1024,i=0;for(;r>=1024&&i<n.length-1;)r/=1024,i++;return`${r.toFixed(r>=100?0:r>=10?1:2)} ${n[i]}`}function qn(e){if(e==null||!Number.isFinite(e))return"–";if(e<0&&(e=0),e<1e3)return`${Math.round(e)}ms`;const n=e/1e3;if(n<60)return`${n.toFixed(n<10?2:1)}s`;const r=Math.floor(n/60),i=Math.round(n%60);if(r<60)return`${r}m ${i}s`;const o=Math.floor(r/60),c=r%60;return o<24?`${o}h ${c}m`:`${Math.floor(o/24)}d ${o%24}h`}function nm(e){return e==null?"–":qn(e*1e3)}function Ro(e){if(e==null||e==="")return null;if(e instanceof Date)return e.getTime();if(typeof e=="number")return Number.isFinite(e)&&e>0?e:null;const n=Number(e);if(!Number.isNaN(n)&&n>0)return n;const r=Date.parse(e);return Number.isNaN(r)?null:r}function Ur(e,n=Date.now()){const r=Ro(e);if(r==null)return"–";const i=n-r,o=i<0,c=Math.abs(i),d=Math.round(c/1e3);let h;if(d<5)return"just now";if(d<60)h=`${d}s`;else if(d<3600)h=`${Math.floor(d/60)}m`;else if(d<86400)h=`${Math.floor(d/3600)}h`;else if(d<86400*30)h=`${Math.floor(d/86400)}d`;else return wu(r);return o?`in ${h}`:`${h} ago`}function to(e){return e<10?`0${e}`:String(e)}function wu(e){const n=Ro(e);if(n==null)return"–";const r=new Date(n);return`${r.getFullYear()}-${to(r.getMonth()+1)}-${to(r.getDate())}`}function fn(e){const n=Ro(e);if(n==null)return"–";const r=new Date(n);return`${wu(r)} ${to(r.getHours())}:${to(r.getMinutes())}:${to(r.getSeconds())}`}function kf(e){const n=Ro(e);if(n==null)return"–";const r=new Date(n);return`${fn(r)}.${String(r.getMilliseconds()).padStart(3,"0")}`}function Nu(e,n=2){try{return typeof e=="string"?e:JSON.stringify(e,null,n)??String(e)}catch{return String(e)}}function Fk(e){try{const n=JSON.parse(e);return JSON.stringify(n,null,2)}catch{return null}}function h0(e){return e==null||!Number.isFinite(e)?"–":e>=10?`${e.toFixed(1)} cores`:`${e.toFixed(2)} ${e===1?"core":"cores"}`}function Qi(e){if(e==null||!Number.isFinite(e))return"–";const n=e*100;return n>=10?`${Math.round(n)}%`:n>=1?`${n.toFixed(0)}%`:`${n.toFixed(n>=.1?1:2)}%`}function Bi(e,n="/s"){return e==null||!Number.isFinite(e)?"–":e>=1e4?`${d0.format(e)}${n}`:e>=100?`${Math.round(e)}${n}`:`${e.toFixed(e<10?2:1)}${n}`}function sm(e){return e==null||!Number.isFinite(e)?"–":e>=1e3?`${(e/1e3).toFixed(2)} s`:e>=10?`${Math.round(e)} ms`:`${e.toFixed(1)} ms`}function Dk(e){return e==null||!Number.isFinite(e)?"–":`${e.toFixed(2)}×`}const Sf="bullpane.";function Ou(e,n,r=Uk){try{const i=localStorage.getItem(Sf+e);if(i==null)return n;const o=r(i);return o===void 0?n:o}catch{return n}}function uo(e,n){try{n==null?localStorage.removeItem(Sf+e):localStorage.setItem(Sf+e,typeof n=="string"?n:JSON.stringify(n))}catch{}}function Uk(e){try{return JSON.parse(e)}catch{return e}}function $u(e,n){const[r,i]=N.useState(()=>Ou(e,n,Qk)),o=N.useCallback(d=>{i(d),uo(e,d?"1":"0")},[e]),c=N.useCallback(()=>{i(d=>(uo(e,d?"0":"1"),!d))},[e]);return[r,c,o]}function Qk(e){if(e==="1"||e==="true"||e==='"true"')return!0;if(e==="0"||e==="false"||e==='"false"')return!1}const Ut=e=>()=>typeof document<"u"&&document.hidden?!1:e,Tt={queues:5e3,queue:3e3,job:5e3,connections:1e4,health:3e3,setup:1e4},ie={health:["health"],edition:["edition"],setupStatus:["setup-status"],me:["me"],connections:["connections"],connectionsHealth:["health","connections"],connectionHealth:e=>["health","connections",e],connection:e=>["connections",e],overview:e=>["connections",e,"overview"],queues:e=>["connections",e,"queues"],queue:(e,n)=>["connections",e,"queue",n],queueSetup:(e,n)=>["connections",e,"queue",n,"setup"],jobs:(e,n,r)=>["connections",e,"queue",n,"jobs",r],jobSearch:(e,n,r)=>["connections",e,"queue",n,"search",r],job:(e,n,r)=>["connections",e,"queue",n,"job",r],jobLogs:(e,n,r,i)=>["connections",e,"queue",n,"job",r,"logs",i],groups:(e,n,r)=>["connections",e,"queue",n,"groups",r],schedulers:(e,n,r)=>["connections",e,"queue",n,"schedulers",r],allSchedulers:(e,n)=>["connections",e,"schedulers",n],jobTree:(e,n,r,i)=>["connections",e,"queue",n,"job",r,"tree",i],groupJobs:(e,n,r,i)=>["connections",e,"queue",n,"groups",r,"jobs",i],flows:(e,n)=>["flows",e,n],hiddenQueues:e=>["connections",e,"hidden-queues"],folders:["folders"],alerts:["alerts"],attention:["attention"],alertEvents:e=>["alerts","events",e],users:["users"],ssoProviders:["sso","providers"],ssoSettings:["sso","settings"],mcpSettings:["mcp","settings"],mcpGrants:e=>["mcp","grants",e],mcpConsent:e=>["mcp","consent",e],attentionThresholds:["settings","attention"],ssoLoginOptions:["sso","login-options"],audit:e=>["audit",e],auditActors:["audit","actors"]},rn=(e,n)=>`/connections/${Be(e)}/queues/${Be(n)}`;function Bk(){return nt({queryKey:ie.health,queryFn:()=>ae.get("/health"),staleTime:6e4})}function ds(){return nt({queryKey:ie.connections,queryFn:()=>ae.get("/connections"),refetchInterval:Ut(Tt.connections)})}function Vk(e){return nt({queryKey:ie.overview(e??""),queryFn:()=>ae.get(`/connections/${Be(e)}/overview`),enabled:!!e,refetchInterval:Ut(Tt.queues),placeholderData:kn})}function Hk(){const e=ds(),n=e.data??[],r=jy({queries:n.map(o=>({queryKey:ie.overview(o.id),queryFn:()=>ae.get(`/connections/${Be(o.id)}/overview`),refetchInterval:Ut(Tt.queues),placeholderData:kn}))}),i=n.map((o,c)=>({connection:o,result:r[c]}));return{connections:e,entries:i,isLoading:e.isLoading}}function Kk(e,n={}){return nt({queryKey:ie.queues(e??""),queryFn:()=>ae.get(`/connections/${Be(e)}/queues`),enabled:!!e&&(n.enabled??!0),refetchInterval:Ut(Tt.queues),placeholderData:kn})}function sl(){const e=ds(),n=e.data??[],r=jy({queries:n.map(o=>({queryKey:ie.queues(o.id),queryFn:()=>ae.get(`/connections/${Be(o.id)}/queues`),refetchInterval:Ut(Tt.queues),placeholderData:kn}))}),i=n.map((o,c)=>{var d,h,m;return{connection:o,queues:((d=r[c])==null?void 0:d.data)??[],isLoading:!!((h=r[c])!=null&&h.isLoading),error:(m=r[c])==null?void 0:m.error}});return{connections:n,byConnection:i,isLoading:e.isLoading,error:e.error}}function Wk(e){const n=We();return He({mutationFn:()=>ae.get(`/connections/${Be(e)}/queues`,{query:{refresh:1}}),onSuccess:r=>{e&&n.setQueryData(ie.queues(e),r),n.invalidateQueries({queryKey:ie.connection(e)})}})}function f0(e,n){return nt({queryKey:ie.queue(e??"",n??""),queryFn:()=>ae.get(rn(e,n)),enabled:!!e&&!!n,refetchInterval:Ut(Tt.queue),placeholderData:kn})}function rm(e,n,r={}){return nt({queryKey:ie.queueSetup(e??"",n??""),queryFn:()=>ae.get(`${rn(e,n)}/setup`),enabled:!!e&&!!n&&(r.enabled??!0),refetchInterval:Ut(Tt.setup),placeholderData:kn})}function m0(e,n,r,i={}){return nt({queryKey:ie.jobs(e??"",n??"",r),queryFn:()=>ae.get(`${rn(e,n)}/jobs`,{query:{...r}}),enabled:!!e&&!!n&&(i.enabled??!0),refetchInterval:Ut(Tt.queue),placeholderData:kn})}function Zk(e,n,r,i={}){return wy({queryKey:ie.jobSearch(e??"",n??"",r),queryFn:({pageParam:o})=>ae.get(`${rn(e,n)}/jobs/search`,{query:{state:r.state,q:r.q,limit:r.limit,cursor:o}}),initialPageParam:void 0,getNextPageParam:o=>o.nextCursor??void 0,enabled:!!e&&!!n&&r.q.trim().length>0&&(i.enabled??!0),staleTime:3e4})}function Gk(e,n,r){return nt({queryKey:ie.job(e??"",n??"",r??""),queryFn:()=>ae.get(`${rn(e,n)}/jobs/${Be(r)}`),enabled:!!e&&!!n&&!!r,refetchInterval:i=>{if(typeof document<"u"&&document.hidden)return!1;const o=i.state.data;return o&&o.finishedOn?!1:Tt.job}})}function Jk(e,n,r,i={},o=!0){return nt({queryKey:ie.jobLogs(e??"",n??"",r??"",i),queryFn:()=>ae.get(`${rn(e,n)}/jobs/${Be(r)}/logs`,{query:{start:i.start,end:i.end}}),enabled:o&&!!e&&!!n&&!!r,refetchInterval:Ut(Tt.job)})}function am(e,n){const r=We();return He({mutationFn:({jobId:i,action:o,scheduler:c})=>{const d=`${rn(e,n)}/jobs/${Be(i)}`;return o==="remove"?ae.del(d):ae.post(`${d}/${o}`,o==="promote"&&c?{scheduler:c}:void 0)},onSuccess:()=>{r.invalidateQueries({queryKey:ie.queue(e,n)}),r.invalidateQueries({queryKey:ie.queues(e)}),r.invalidateQueries({queryKey:ie.overview(e)})}})}function Xk(e,n){const r=We();return He({mutationFn:({action:i,jobIds:o})=>ae.post(`${rn(e,n)}/jobs/bulk/${i}`,{jobIds:o}),onSuccess:()=>{r.invalidateQueries({queryKey:ie.queue(e,n)}),r.invalidateQueries({queryKey:ie.queues(e)}),r.invalidateQueries({queryKey:ie.overview(e)})}})}function Yk(e,n){const r=We();return He({mutationFn:i=>ae.post(`${rn(e,n)}/jobs`,i),onSuccess:()=>{r.invalidateQueries({queryKey:ie.queue(e,n)}),r.invalidateQueries({queryKey:ie.queues(e)})}})}function p0(e,n){const r=We();return He({mutationFn:i=>{const o=`${rn(e,n)}/${i.action}`;return"body"in i?ae.post(o,i.body):ae.post(o)},onSuccess:()=>{r.invalidateQueries({queryKey:ie.queue(e,n)}),r.invalidateQueries({queryKey:ie.queues(e)}),r.invalidateQueries({queryKey:ie.overview(e)})}})}function e2(e){const n=We();return He({mutationFn:({queue:r,action:i,reason:o})=>ae.post(`${rn(e,r)}/${i}`,i==="pause"?{...o?{reason:o}:{}}:void 0),onSuccess:()=>{n.invalidateQueries({queryKey:ie.connection(e)})}})}function x0(e,n,r){return nt({queryKey:ie.groups(e??"",n??"",r),queryFn:()=>ae.get(`${rn(e,n)}/groups`,{query:{...r}}),enabled:!!e&&!!n,refetchInterval:Ut(Tt.queues),placeholderData:kn})}function t2(e,n,r,i){return nt({queryKey:ie.groupJobs(e??"",n??"",r??"",i),queryFn:()=>ae.get(`${rn(e,n)}/groups/${Be(r)}/jobs`,{query:{...i}}),enabled:!!e&&!!n&&!!r,refetchInterval:Ut(Tt.queue),placeholderData:kn})}function n2(e,n,r,i={}){return nt({queryKey:ie.schedulers(e??"",n??"",r),queryFn:()=>ae.get(`${rn(e,n)}/schedulers`,{query:{...r}}),enabled:!!e&&!!n&&i.enabled!==!1,refetchInterval:Ut(Tt.queues),placeholderData:kn})}function s2(e,n={}){return nt({queryKey:ie.allSchedulers(e??"",n),queryFn:()=>ae.get(`/connections/${Be(e)}/schedulers`,{query:{...n}}),enabled:!!e,refetchInterval:Ut(Tt.queues),placeholderData:kn})}function r2(e,n){const r=We();return He({mutationFn:i=>ae.del(`${rn(e,n)}/schedulers/${Be(i)}`),onSuccess:()=>{r.invalidateQueries({queryKey:["connections",e,"queue",n,"schedulers"]}),r.invalidateQueries({queryKey:ie.queue(e,n)}),r.invalidateQueries({queryKey:ie.queues(e)})}})}function T3(e,n,r,i=200){return nt({queryKey:ie.jobTree(e??"",n??"",r??"",i),queryFn:()=>ae.get(`${rn(e,n)}/jobs/${Be(r)}/tree`,{query:{maxNodes:i}}),enabled:!!e&&!!n&&!!r,refetchInterval:o=>{if(typeof document<"u"&&document.hidden)return!1;const c=o.state.data;return c&&c.nodes.every(d=>d.finishedOn!==null||d.missing)?!1:Tt.job},placeholderData:kn})}function a2(){const e=We();return He({mutationFn:n=>ae.post("/connections",n),onSuccess:()=>e.invalidateQueries({queryKey:ie.connections})})}function i2(){const e=We();return He({mutationFn:({id:n,input:r})=>ae.patch(`/connections/${Be(n)}`,r),onSuccess:()=>e.invalidateQueries({queryKey:ie.connections})})}function l2(){const e=We();return He({mutationFn:n=>ae.del(`/connections/${Be(n)}`),onSuccess:()=>e.invalidateQueries({queryKey:ie.connections})})}function o2(){return He({mutationFn:e=>ae.post("/connections/test",e)})}function c2(e={}){const n=e.enabled??!0;return nt({queryKey:ie.connectionsHealth,queryFn:()=>ae.get("/health/connections"),enabled:n,refetchInterval:n?Ut(Tt.health):!1,placeholderData:kn})}function g0(e,n={}){return nt({queryKey:ie.hiddenQueues(e??""),queryFn:()=>ae.get(`/connections/${Be(e)}/hidden-queues`),enabled:!!e&&(n.enabled??!0),staleTime:3e4})}function u2(e){const n=We();return He({mutationFn:({queue:r,hidden:i})=>i?ae.post(`/connections/${Be(e)}/hidden-queues`,{queueName:r}):ae.del(`/connections/${Be(e)}/hidden-queues/${Be(r)}`),onSuccess:r=>{n.setQueryData(ie.hiddenQueues(e),r),n.invalidateQueries({queryKey:ie.queues(e)}),n.invalidateQueries({queryKey:ie.overview(e)}),n.invalidateQueries({queryKey:ie.connections})}})}function v0(){return nt({queryKey:ie.attentionThresholds,queryFn:()=>ae.get("/settings/attention"),staleTime:5*6e4})}function d2(){const e=We();return He({mutationFn:n=>ae.put("/settings/attention",n),onSuccess:n=>e.setQueryData(ie.attentionThresholds,n)})}function Br(e=!0){return nt({queryKey:ie.folders,queryFn:()=>ae.get("/folders",{silent:[402]}),enabled:e,staleTime:3e4})}function h2(){const e=We();return He({mutationFn:n=>ae.post("/folders",n),onSuccess:()=>e.invalidateQueries({queryKey:ie.folders})})}function y0(){const e=We();return He({mutationFn:({id:n,input:r})=>ae.patch(`/folders/${Be(n)}`,r),onSuccess:()=>e.invalidateQueries({queryKey:ie.folders})})}function f2(){const e=We();return He({mutationFn:n=>ae.del(`/folders/${Be(n)}`),onSuccess:()=>e.invalidateQueries({queryKey:ie.folders})})}function j0(){const e=We();return He({mutationFn:({id:n,input:r})=>ae.put(`/folders/${Be(n)}/queues`,r),onSuccess:()=>e.invalidateQueries({queryKey:ie.folders})})}function im(e=!0){return nt({queryKey:ie.alerts,queryFn:()=>ae.get("/alerts",{silent:[402]}),enabled:e,refetchInterval:Ut(Tt.connections)})}function m2(e=!0){return nt({queryKey:ie.attention,queryFn:()=>ae.get("/attention",{silent:[402]}),enabled:e,refetchInterval:Ut(Tt.queues)})}function lm(e){setTimeout(()=>void e.invalidateQueries({queryKey:ie.attention}),1500)}function p2(e={},n=!0){return nt({queryKey:ie.alertEvents(e),queryFn:()=>ae.get("/alerts/events",{query:{...e},silent:[402]}),enabled:n,refetchInterval:Ut(Tt.connections)})}function x2(){const e=We();return He({mutationFn:n=>ae.post("/alerts",n),onSuccess:()=>{e.invalidateQueries({queryKey:ie.alerts}),lm(e)}})}function b0(){const e=We();return He({mutationFn:({id:n,input:r})=>ae.patch(`/alerts/${Be(n)}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:ie.alerts}),lm(e)}})}function g2(){const e=We();return He({mutationFn:n=>ae.del(`/alerts/${Be(n)}`),onSuccess:()=>{e.invalidateQueries({queryKey:ie.alerts}),lm(e)}})}function v2(){const e=We();return He({mutationFn:n=>ae.post(`/alerts/${Be(n)}/test`),onSuccess:()=>e.invalidateQueries({queryKey:["alerts","events"]})})}function y2(e=!0){return nt({queryKey:ie.users,queryFn:()=>ae.get("/users",{silent:[402]}),enabled:e})}function j2(){const e=We();return He({mutationFn:n=>ae.post("/users",n),onSuccess:()=>e.invalidateQueries({queryKey:ie.users})})}function b2(){const e=We();return He({mutationFn:({id:n,input:r})=>ae.patch(`/users/${Be(n)}`,r),onSuccess:()=>e.invalidateQueries({queryKey:ie.users})})}function w2(e={},n=50,r=!0){return wy({queryKey:ie.audit({...e,limit:n}),queryFn:({pageParam:i})=>ae.get("/audit",{query:{...e,limit:n,cursor:i??void 0},silent:[402,403]}),initialPageParam:void 0,getNextPageParam:i=>i.nextCursor??void 0,enabled:r})}function N2(e=!0){return nt({queryKey:ie.auditActors,queryFn:()=>ae.get("/audit/actors",{silent:[402,403]}),enabled:e,staleTime:6e4})}function k2(e={}){return Ly("/audit/export",{...e})}function S2(e,n,r,i=!0){const o={connectionId:e,queueName:n,jobId:r};return nt({queryKey:ie.audit({...o,limit:20}),queryFn:()=>ae.get("/audit",{query:{...o,limit:20},silent:[402,403]}),enabled:i&&!!e&&!!n&&!!r,staleTime:15e3})}function I3(e,n=200,r=!0){return nt({queryKey:ie.flows(e??"",n),queryFn:()=>ae.get(`/connections/${Be(e)}/flows`,{query:{sample:n},silent:[402]}),enabled:r&&!!e,refetchInterval:Ut(Tt.connections),placeholderData:kn})}function q3(){const e=We();return He({mutationFn:n=>ae.post("/flow-edges",n),onSuccess:()=>e.invalidateQueries({queryKey:["flows"]})})}function O3(){const e=We();return He({mutationFn:n=>ae.del(`/flow-edges/${Be(n)}`),onSuccess:()=>e.invalidateQueries({queryKey:["flows"]})})}function C2(){return He({mutationFn:e=>ae.put("/license",{key:e})})}function _2(){return He({mutationFn:()=>ae.post("/license/refresh")})}function P2(){return He({mutationFn:()=>ae.del("/license")})}function E2(){return nt({queryKey:ie.ssoLoginOptions,queryFn:()=>ae.get("/auth/sso/options",{silent:!0}),staleTime:6e4,retry:!1})}function R2(e=!0){return nt({queryKey:ie.ssoProviders,queryFn:()=>ae.get("/sso/providers",{silent:[402]}),enabled:e})}function w0(e=!0){return nt({queryKey:ie.ssoSettings,queryFn:()=>ae.get("/sso/settings",{silent:[402]}),enabled:e})}function M2(){const e=We();return He({mutationFn:n=>ae.post("/sso/providers",n),onSuccess:()=>{e.invalidateQueries({queryKey:ie.ssoProviders}),e.invalidateQueries({queryKey:ie.ssoLoginOptions})}})}function T2(){const e=We();return He({mutationFn:({id:n,input:r})=>ae.patch(`/sso/providers/${Be(n)}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:ie.ssoProviders}),e.invalidateQueries({queryKey:ie.ssoLoginOptions})}})}function I2(){const e=We();return He({mutationFn:n=>ae.del(`/sso/providers/${Be(n)}`),onSuccess:()=>{e.invalidateQueries({queryKey:ie.ssoProviders}),e.invalidateQueries({queryKey:ie.ssoLoginOptions}),e.invalidateQueries({queryKey:ie.ssoSettings})}})}function q2(){return He({mutationFn:e=>ae.post(`/sso/providers/${Be(e)}/test`)})}function N0(){const e=We();return He({mutationFn:n=>ae.put("/sso/settings",n),onSuccess:()=>{e.invalidateQueries({queryKey:ie.ssoSettings}),e.invalidateQueries({queryKey:ie.ssoLoginOptions})}})}function O2(e=!0){return nt({queryKey:ie.mcpSettings,queryFn:()=>ae.get("/mcp/settings",{silent:[402]}),enabled:e})}function $2(){const e=We();return He({mutationFn:n=>ae.put("/mcp/settings",n),onSuccess:()=>void e.invalidateQueries({queryKey:ie.mcpSettings})})}function z2(e,n=!0){return nt({queryKey:ie.mcpGrants(e),queryFn:()=>ae.get(`/mcp/grants${e?"?all=1":""}`,{silent:[402]}),enabled:n})}function A2(){const e=We();return He({mutationFn:n=>ae.del(`/mcp/grants/${Be(n)}`),onSuccess:()=>void e.invalidateQueries({queryKey:["mcp","grants"]})})}function $3(e){return nt({queryKey:ie.mcpConsent(e??""),queryFn:()=>ae.get(`/mcp/consent?request=${encodeURIComponent(e??"")}`),enabled:!!e,refetchOnWindowFocus:!1,staleTime:1/0})}function z3(){return He({mutationFn:e=>ae.post("/mcp/consent",e)})}const L2={neutral:"bg-surface-3 text-fg-muted",outline:"border border-border-strong text-fg-muted",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",info:"bg-info/15 text-info",accent:"bg-accent/15 text-accent",violet:"bg-violet/15 text-violet",teal:"bg-teal/15 text-teal",pro:"bg-pro/15 text-pro",custom:""};function be({variant:e="neutral",dot:n,size:r="sm",mono:i,className:o,children:c,...d}){return t.jsxs("span",{className:F("inline-flex shrink-0 items-center gap-1 rounded font-medium whitespace-nowrap",r==="xs"?"h-4 px-1 text-[10px] leading-none":"h-5 px-1.5 text-[11px] leading-none",i&&"font-mono",L2[e],o),...d,children:[n&&t.jsx("span",{className:"status-dot size-1.5 bg-current","aria-hidden":!0}),c]})}function om({className:e}){const{isPro:n,demo:r}=jt();return r?t.jsx(be,{variant:"warning",size:"xs",className:F("tracking-wider",e),title:"Demo mode: Pro unlocked, settings locked",children:"DEMO"}):n?t.jsx(be,{variant:"pro",size:"xs",className:F("tracking-wider",e),children:"PRO"}):t.jsx(be,{variant:"outline",size:"xs",className:F("tracking-wider",e),children:"FREE"})}function Wg({className:e}){return t.jsx(ro,{className:F("size-3 shrink-0 text-pro",e),"aria-label":"Pro feature"})}function Vi({children:e,className:n}){return t.jsx("kbd",{className:F("inline-flex h-5 min-w-5 items-center justify-center rounded border border-border-strong bg-surface-2 px-1 font-mono text-[10px] leading-none text-fg-muted shadow-[inset_0_-1px_0_var(--border-strong)]",n),children:e})}function _e({content:e,children:n,side:r="top",className:i,block:o}){if(e==null||e==="")return t.jsx(t.Fragment,{children:n});const c={top:"bottom-full left-1/2 mb-1.5 -translate-x-1/2",bottom:"top-full left-1/2 mt-1.5 -translate-x-1/2",left:"right-full top-1/2 mr-1.5 -translate-y-1/2",right:"left-full top-1/2 ml-1.5 -translate-y-1/2"}[r];return t.jsxs("span",{className:F("has-tooltip relative",o?"block":"inline-flex",i),children:[n,t.jsx("span",{role:"tooltip",className:F("tooltip",c),children:e})]})}function F2(e){return e?e.ok?"ok":"down":"unknown"}function zu({status:e,className:n,pulse:r,withLabel:i}){const o=F2(e),c=o==="ok"?"bg-success text-success":o==="down"?"bg-danger text-danger":"bg-fg-subtle text-fg-subtle",d=o==="ok"?`Connected · ${(e==null?void 0:e.latencyMs)??"?"} ms · Redis ${(e==null?void 0:e.redisVersion)??"?"}`:o==="down"?`Down: ${(e==null?void 0:e.error)??"unreachable"}`:"Status unknown",h=e!=null&&e.checkedAt?` · checked ${Ur(e.checkedAt)}`:"";return t.jsx(_e,{content:d+h,children:t.jsxs("span",{className:F("inline-flex items-center gap-1.5",n),children:[t.jsx("span",{className:F("status-dot",c,r&&o==="down"&&"pulse"),"aria-label":d,role:"img"}),i&&t.jsx("span",{className:F("text-xs",o==="down"?"text-danger":"text-fg-muted"),children:o==="ok"?"Connected":o==="down"?"Down":"Unknown"})]})})}function cm({className:e}){return t.jsx("span",{className:F("inline-flex size-6 items-center justify-center rounded-md bg-[#0b0d10] ring-1 ring-border-strong",e),"aria-hidden":!0,children:t.jsxs("svg",{viewBox:"0 0 32 32",className:"size-5",children:[t.jsx("rect",{x:"7",y:"8",width:"18",height:"4",rx:"2",fill:"#5b8def"}),t.jsx("rect",{x:"7",y:"14",width:"13",height:"4",rx:"2",fill:"#5b8def",opacity:".75"}),t.jsx("rect",{x:"7",y:"20",width:"8",height:"4",rx:"2",fill:"#5b8def",opacity:".5"}),t.jsx("circle",{cx:"24",cy:"22",r:"3",fill:"#f85149"})]})})}function Zg({onOpenSwitcher:e,onNavigate:n,className:r}){const{isAdmin:i}=yt(),{has:o}=jt(),{byConnection:c,isLoading:d}=sl(),h=o("folders"),m=Br(h),g=[{to:oe.alerts,label:"Alerts",icon:Gi,feature:"alerts"},{to:oe.flows(),label:"Flows",icon:CN,feature:"flows"},{to:oe.users,label:"Users",icon:Gf,feature:"users",adminOnly:!0},{to:oe.audit(),label:"Audit log",icon:Eo,feature:"audit",adminOnly:!0}];return t.jsxs("aside",{className:F("flex h-full w-64 shrink-0 flex-col border-r border-border bg-surface",r),"aria-label":"Sidebar",children:[t.jsxs("div",{className:"flex h-12 items-center gap-2 border-b border-border px-3",children:[t.jsx(cm,{}),t.jsx("span",{className:"truncate text-[13px] font-semibold tracking-tight",children:"Bullpane"}),t.jsx(om,{className:"ml-auto"})]}),t.jsx("div",{className:"px-2 pt-2",children:t.jsxs("button",{type:"button",onClick:e,className:"flex h-8 w-full items-center gap-2 rounded-md border border-border bg-bg px-2.5 text-xs text-fg-subtle hover:border-border-strong hover:text-fg-muted",children:[t.jsx(Hn,{className:"size-3.5","aria-hidden":!0}),t.jsx("span",{className:"flex-1 text-left",children:"Jump to queue…"}),t.jsx(Vi,{children:c0}),t.jsx(Vi,{children:"K"})]})}),t.jsxs("nav",{className:"px-2 pt-2","aria-label":"Primary",children:[t.jsx(Wl,{to:oe.home,end:!0,icon:mN,label:"Overview",onNavigate:n}),t.jsx(Wl,{to:oe.schedulers(),icon:Co,label:"Schedulers",onNavigate:n})]}),t.jsxs("div",{className:"mt-2 min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-2 pb-2",children:[t.jsx(D2,{children:"Queues"}),h&&m.data&&m.data.length>0&&t.jsx(B2,{folders:m.data,byConnection:c,onNavigate:n}),c.map(({connection:p,queues:v,error:j})=>t.jsx(Q2,{connection:p,queues:v,error:j,onNavigate:n,defaultOpen:c.length<=U2},p.id)),!d&&c.length===0&&t.jsxs("p",{className:"px-2 py-3 text-xs text-fg-subtle",children:["No connections yet."," ",i?t.jsx(No,{to:oe.settings("connections"),className:"text-accent hover:underline",onClick:n,children:"Add one"}):"Ask an admin to add one."]}),d&&t.jsxs("div",{className:"space-y-2 px-2 py-2",children:[t.jsx("span",{className:"skeleton block h-3 w-3/4"}),t.jsx("span",{className:"skeleton block h-3 w-1/2"}),t.jsx("span",{className:"skeleton block h-3 w-2/3"})]}),h?t.jsx(Wl,{to:oe.folders,icon:Zs,label:"Manage folders",className:"mt-1 text-xs",onNavigate:n}):t.jsxs("button",{type:"button",onClick:()=>lo("folders"),className:"nav-item mt-1 w-full text-left",title:"Custom folders are a Pro feature",children:[t.jsx(oN,{className:"size-3.5 shrink-0 text-fg-subtle","aria-hidden":!0}),t.jsx("span",{className:"flex-1 truncate text-xs",children:"Custom folders"}),t.jsx(Wg,{})]})]}),t.jsxs("nav",{className:"border-t border-border px-2 py-2","aria-label":"Secondary",children:[g.filter(p=>!p.adminOnly||i).map(p=>o(p.feature)?t.jsx(Wl,{to:p.to,icon:p.icon,label:p.label,onNavigate:n},p.to):t.jsxs("button",{type:"button",onClick:()=>lo(p.feature),className:"nav-item w-full text-left",children:[t.jsx(p.icon,{className:"size-3.5 shrink-0","aria-hidden":!0}),t.jsx("span",{className:"flex-1 truncate",children:p.label}),t.jsx(Wg,{})]},p.to)),t.jsx(Wl,{to:oe.settings(),icon:$y,label:"Settings",onNavigate:n})]})]})}function D2({children:e}){return t.jsx("div",{className:"px-2 pt-2 pb-1 text-[10px] font-semibold tracking-wider text-fg-subtle uppercase",children:e})}function Wl({to:e,icon:n,label:r,end:i,className:o,onNavigate:c}){return t.jsxs(No,{to:e,end:i,className:({isActive:d})=>F("nav-item",d&&"active",o),onClick:c,children:[t.jsx(n,{className:"size-3.5 shrink-0","aria-hidden":!0}),t.jsx("span",{className:"flex-1 truncate",children:r})]})}function k0(e,n=!0){const[r,i,o]=$u(`sidebar.${e}`,n);return[r,i,o]}const U2=3;function Q2({connection:e,queues:n,error:r,onNavigate:i,defaultOpen:o}){const c=zn(),d=c.connectionId===e.id,[h,m,g]=k0(`conn.${e.id}`,o),p=N.useMemo(()=>[...n].sort((C,y)=>C.name.localeCompare(y.name)),[n]),v=n.reduce((C,y)=>C+y.counts.failed,0),j=n.reduce((C,y)=>C+y.counts.waiting+y.counts.prioritized,0);return N.useEffect(()=>{d&&!h&&g(!0)},[d,e.id]),t.jsxs("div",{className:"mt-0.5",children:[t.jsxs("div",{className:F("group flex h-7 items-center gap-1 rounded-md pr-1 pl-1 hover:bg-surface-2",d&&!c.queue&&"bg-surface-3"),children:[t.jsx("button",{type:"button",onClick:m,"aria-expanded":h,"aria-label":h?"Collapse":"Expand",className:"rounded p-0.5 text-fg-subtle hover:text-fg",children:h?t.jsx(cs,{className:"size-3.5"}):t.jsx(Wn,{className:"size-3.5"})}),t.jsxs(No,{to:oe.connection(e.id),onClick:i,className:"flex min-w-0 flex-1 items-center gap-1.5 text-[13px] font-medium text-fg",children:[t.jsx(Ji,{className:"size-3.5 shrink-0 text-fg-subtle","aria-hidden":!0}),t.jsx("span",{className:"truncate",children:e.name})]}),!h&&t.jsx(_e,{content:`${n.length} ${n.length===1?"queue":"queues"} · ${mt(j)} waiting · ${mt(v)} failed`,children:t.jsxs("span",{className:"flex shrink-0 cursor-help items-center gap-1",children:[t.jsx("span",{className:"num text-[10px] text-fg-subtle",children:n.length}),v>0&&t.jsx("span",{className:"num text-[10px] text-danger",children:mt(v)})]})}),t.jsx(zu,{status:e.status,pulse:!0})]}),h&&t.jsxs("ul",{className:"ml-3 border-l border-border pl-1",children:[!!r&&t.jsx("li",{className:"px-2 py-1 text-xs text-danger",children:"Could not load queues"}),!r&&p.length===0&&t.jsx("li",{className:"px-2 py-1 text-xs text-fg-subtle",children:"No queues discovered"}),p.map(C=>t.jsx(S0,{connectionId:e.id,queue:C,onNavigate:i},C.name))]})]})}function S0({connectionId:e,queue:n,onNavigate:r,hint:i}){const o=zn(),c=o.connectionId===e&&o.queue===n.name;return t.jsx("li",{children:t.jsxs(No,{to:oe.queue(e,n.name,co(n.counts)),onClick:r,className:F("nav-item h-6.5 pr-1.5 pl-2 text-xs",c&&"active"),title:i?`${i} / ${n.name}`:n.name,children:[t.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[n.name,i&&t.jsxs("span",{className:"ml-1 text-fg-subtle",children:["· ",i]})]}),n.isPaused&&t.jsx("span",{className:"rounded bg-surface-3 px-1 text-[9px] text-fg-subtle uppercase",children:"paused"}),t.jsx("span",{className:"num text-[10px] text-fg-subtle",title:"waiting",children:mt(n.counts.waiting+n.counts.prioritized)}),n.counts.failed>0&&t.jsx(_e,{content:`${mt(n.counts.failed)} failed · click to open them`,children:t.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-danger",children:[t.jsx("span",{className:"status-dot size-1.5 bg-danger"}),t.jsx("span",{className:"num",children:mt(n.counts.failed)})]})})]})})}function B2({folders:e,byConnection:n,onNavigate:r}){const i=e.filter(d=>!d.parentId).sort((d,h)=>d.position-h.position||d.name.localeCompare(h.name)),o=d=>e.filter(h=>h.parentId===d).sort((h,m)=>h.position-m.position||h.name.localeCompare(m.name)),c=(d,h)=>{const m=n.find(p=>p.connection.id===d),g=m==null?void 0:m.queues.find(p=>p.name===h);return m&&g?{connection:m.connection,queue:g}:null};return t.jsx("div",{className:"mb-2",children:i.map(d=>t.jsx(C0,{folder:d,children:o(d.id),lookup:c,onNavigate:r,depth:0},d.id))})}function C0({folder:e,children:n,lookup:r,onNavigate:i,depth:o}){const[c,d]=k0(`folder.${e.id}`),m=zn().folderId===e.id,g=e.queues.map(p=>({ref:p,hit:r(p.connectionId,p.queueName)}));return t.jsxs("div",{className:"mt-0.5",style:{marginLeft:o*12},children:[t.jsxs("div",{className:F("group flex h-7 items-center gap-1 rounded-md pr-1 pl-1 hover:bg-surface-2",m&&"bg-surface-3"),children:[t.jsx("button",{type:"button",onClick:d,"aria-expanded":c,"aria-label":c?"Collapse":"Expand",className:"rounded p-0.5 text-fg-subtle hover:text-fg",children:c?t.jsx(cs,{className:"size-3.5"}):t.jsx(Wn,{className:"size-3.5"})}),t.jsxs(No,{to:oe.folder(e.id),onClick:i,className:({isActive:p})=>F("flex min-w-0 flex-1 items-center gap-1.5 text-[13px] font-medium",p?"text-fg":"text-fg hover:underline"),title:`Open ${e.name}`,children:[t.jsx(Zs,{className:"size-3.5 shrink-0",style:{color:e.color??"var(--fg-subtle)"},"aria-hidden":!0}),t.jsx("span",{className:"truncate",children:e.name})]}),t.jsx("span",{className:"num text-[10px] text-fg-subtle",children:e.queues.length})]}),c&&t.jsxs(t.Fragment,{children:[n.map(p=>t.jsx(C0,{folder:p,children:[],lookup:r,onNavigate:i,depth:o+1},p.id)),t.jsxs("ul",{className:"ml-3 border-l border-border pl-1",children:[g.length===0&&n.length===0&&t.jsx("li",{className:"px-2 py-1 text-xs text-fg-subtle",children:"Empty folder"}),g.map(({ref:p,hit:v})=>v?t.jsx(S0,{connectionId:v.connection.id,queue:v.queue,hint:v.connection.name,onNavigate:i},`${p.connectionId}/${p.queueName}`):t.jsx("li",{className:"nav-item h-6.5 pl-2 text-xs text-fg-subtle line-through",title:"Queue not found on its connection",children:p.queueName},`${p.connectionId}/${p.queueName}`))]})]})]})}const V2=.9,H2=.7;function um(e){if(!(e==null||!Number.isFinite(e))){if(e>=V2)return"danger";if(e>=H2)return"warn"}}function K2(e){return um(e)??"ok"}function Mo(e){if(e==null||!Number.isFinite(e))return"No CPU rate yet — needs two INFO samples. Also resets when Redis restarts. This is not zero.";const n=`${h0(e)} — used_cpu_sys + used_cpu_user per second, as a share of one core.`;return e>1?`${n} Above 100%: Redis is using more than one core, which its background threads (persistence, lazy free) can legitimately do — the command loop itself is still single threaded.`:`${n} Redis runs its command loop on a single thread, so 100% is the practical ceiling.`}const _0="health.paused";let Cf=Ou(_0,!1,e=>e==="true"||e==='"true"'||e==="1");const _f=new Set;function W2(e){return _f.add(e),()=>_f.delete(e)}function Gg(){return Cf}function Z2(e){Cf!==e&&(Cf=e,uo(_0,e),_f.forEach(n=>n()))}function G2(){const e=N.useSyncExternalStore(W2,Gg,Gg),n=N.useCallback(r=>Z2(r),[]);return[e,n]}function Au(){const[e,n]=G2(),r=c2({enabled:!e}),i=r.data??[];let o=null;for(const c of i){const d=c.info?Date.parse(c.info.sampledAt):NaN;Number.isFinite(d)&&(o===null||d>o)&&(o=d)}return{health:i,paused:e,setPaused:n,isLoading:r.isLoading&&!e,error:r.error,lastSampleAt:o,refetch:()=>void r.refetch()}}function dm(e){let n=null,r=null,i=null,o=0,c=0,d=0;for(const h of e){h.ok||o++,h.commandsPerSec!=null&&(n=(n??0)+h.commandsPerSec),h.memoryUsedPct!=null&&(r=Math.max(r??0,h.memoryUsedPct)),h.cpuCores!=null&&(i=Math.max(i??0,h.cpuCores));for(const m of h.warnings)m.level==="critical"?c++:d++}return{total:e.length,down:o,commandsPerSec:n,memoryPct:r,cpuCores:i,critical:c,warn:d}}function J2({className:e}){const{health:n,paused:r}=Au();if(n.length===0)return null;const i=dm(n),o=i.down>0||i.critical>0,c=!o&&i.warn>0,d=r?"Health monitoring is paused. Open the monitor to resume.":[`${i.total} connection${i.total===1?"":"s"}`,i.down>0?`${i.down} unreachable`:null,i.commandsPerSec==null?"commands/sec: measuring…":`${Bi(i.commandsPerSec)} across all connections`,i.memoryPct==null?"no maxmemory set":`peak memory use ${On(i.memoryPct)} of maxmemory`,i.cpuCores==null?null:`busiest CPU ${Qi(i.cpuCores)} of one core — ${Mo(i.cpuCores)}`,i.critical>0?`${i.critical} critical warning${i.critical===1?"":"s"}`:null,i.warn>0?`${i.warn} warning${i.warn===1?"":"s"}`:null].filter(Boolean).join(" · ");return t.jsx(_e,{content:d,side:"bottom",children:t.jsxs(Re,{to:oe.health,"aria-label":"Redis health monitor",className:F("hidden items-center gap-1.5 rounded-md border border-border bg-bg px-2 py-1 text-xs text-fg-muted transition-colors hover:border-border-strong hover:text-fg md:flex",o&&"border-danger/50 text-danger",c&&"border-warning/50 text-warning",r&&"opacity-60",e),children:[t.jsx(So,{className:F("size-3.5 shrink-0",r&&"opacity-50"),"aria-hidden":!0}),t.jsxs("span",{className:"num whitespace-nowrap",children:[i.total," conn",t.jsx("span",{className:"mx-1 text-fg-subtle",children:"·"}),r?"paused":i.commandsPerSec==null?"—":`${Bi(i.commandsPerSec,"")} cmd/s`,i.cpuCores!=null&&!r&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1 text-fg-subtle",children:"·"}),Qi(i.cpuCores)," cpu"]}),i.memoryPct!=null&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1 text-fg-subtle",children:"·"}),On(i.memoryPct,0)," mem"]})]})]})})}const X2={sso:"SSO",mcp:"MCP"};function Y2(){var c;const e=zn(),{pathname:n}=$n(),i=(c=ds().data)==null?void 0:c.find(d=>d.id===e.connectionId),o=[{label:"Overview",to:oe.home}];return n.startsWith("/settings")?(o.push({label:"Settings",to:oe.settings()}),e.tab&&o.push({label:X2[e.tab]??e.tab[0].toUpperCase()+e.tab.slice(1)}),o):n.startsWith("/health")?[...o,{label:"Redis health"}]:n.startsWith("/alerts")?[...o,{label:"Alerts"}]:n.startsWith("/users")?[...o,{label:"Users"}]:n.startsWith("/audit")?[...o,{label:"Audit log"}]:n.startsWith("/folders")?[...o,{label:"Folders"}]:n.startsWith("/flows")?(o.push({label:"Flows",to:oe.flows()}),i&&o.push({label:i.name}),o):(e.connectionId&&(o.push({label:(i==null?void 0:i.name)??e.connectionId,to:oe.connection(e.connectionId)}),e.queue&&(o.push({label:e.queue,to:oe.queue(e.connectionId,e.queue)}),n.includes("/groups")&&(o.push({label:"Groups",to:e.groupId?oe.groups(e.connectionId,e.queue):void 0}),e.groupId&&o.push({label:e.groupId,mono:!0})),e.jobId&&o.push({label:e.jobId,mono:!0}))),o)}function eS({onOpenSwitcher:e,onToggleSidebar:n}){var d,h;const r=Y2(),i=zn(),c=(d=ds().data)==null?void 0:d.find(m=>m.id===i.connectionId);return t.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-border bg-surface px-3",children:[t.jsx(V,{variant:"ghost",size:"icon-sm",className:"lg:hidden","aria-label":"Toggle sidebar",onClick:n,children:t.jsx(xN,{})}),t.jsx("nav",{"aria-label":"Breadcrumb",className:"min-w-0 flex-1",children:t.jsx("ol",{className:"flex min-w-0 items-center gap-1 text-[13px]",children:r.map((m,g)=>{const p=g===r.length-1;return t.jsxs("li",{className:F("flex min-w-0 items-center gap-1",p&&"min-w-0 flex-1"),children:[g>0&&t.jsx(Wn,{className:"size-3.5 shrink-0 text-fg-subtle","aria-hidden":!0}),m.to&&!p?t.jsx(Re,{to:m.to,className:"truncate text-fg-muted hover:text-fg",children:m.label}):t.jsx("span",{"aria-current":p?"page":void 0,className:F("truncate",p?"font-medium text-fg":"text-fg-muted",m.mono&&"font-mono text-xs"),children:m.label})]},g)})})}),c&&t.jsxs("div",{className:"hidden items-center gap-1.5 rounded-md border border-border bg-bg px-2 py-1 text-xs text-fg-muted sm:flex",children:[t.jsx(zu,{status:c.status,pulse:!0}),t.jsx("span",{className:"truncate",children:c.name}),((h=c.status)==null?void 0:h.latencyMs)!=null&&t.jsxs("span",{className:"num text-fg-subtle",children:[c.status.latencyMs," ms"]})]}),t.jsx(J2,{}),t.jsx(V,{variant:"ghost",size:"icon-sm","aria-label":"Search queues",onClick:e,className:"sm:hidden",children:t.jsx(Hn,{})}),t.jsxs("button",{type:"button",onClick:e,className:"hidden h-7 items-center gap-1.5 rounded-md border border-border px-2 text-xs text-fg-subtle hover:border-border-strong hover:text-fg-muted sm:inline-flex",children:[t.jsx(Hn,{className:"size-3.5","aria-hidden":!0}),t.jsx(Vi,{children:c0}),t.jsx(Vi,{children:"K"})]}),t.jsx(nS,{})]})}function tS(){return t.jsxs("button",{type:"button",onClick:()=>lo("users"),className:"flex h-7 items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-2 text-xs text-warning hover:bg-warning/20",title:"Anyone who can reach this URL can retry, promote and delete jobs. Pro adds login, roles and the audit log.",children:[t.jsx(Wf,{className:"size-3.5","aria-hidden":!0}),t.jsx("span",{className:"hidden md:inline",children:"No login"})]})}function nS(){const{user:e,logout:n,isAdmin:r,authRequired:i}=yt(),{demo:o,has:c}=jt(),[d,h]=N.useState(!1),m=N.useRef(null);if(N.useEffect(()=>{if(!d)return;const p=j=>{var C;(C=m.current)!=null&&C.contains(j.target)||h(!1)},v=j=>j.key==="Escape"&&h(!1);return document.addEventListener("mousedown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",v)}},[d]),!i)return t.jsx(tS,{});if(!e)return null;const g=e.name.split(/\s+/).map(p=>p[0]).slice(0,2).join("").toUpperCase();return t.jsxs("div",{ref:m,className:"relative",children:[t.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":d,onClick:()=>h(p=>!p),className:"flex h-7 items-center gap-2 rounded-md px-1.5 hover:bg-surface-2",children:[t.jsx("span",{className:"flex size-6 items-center justify-center rounded-full bg-accent/20 text-[10px] font-semibold text-accent",children:g||"?"}),t.jsx("span",{className:"hidden max-w-32 truncate text-xs text-fg md:inline",children:e.name}),t.jsx(be,{variant:e.role==="admin"?"pro":e.role==="operator"?"info":"neutral",size:"xs",className:"hidden md:inline-flex",children:e.role})]}),d&&t.jsxs("div",{role:"menu",className:"absolute right-0 z-40 mt-1 w-60 rounded-lg border border-border bg-surface p-1 shadow-[var(--shadow)]",children:[t.jsxs("div",{className:"px-2.5 py-2",children:[t.jsx("p",{className:"truncate text-[13px] font-medium text-fg",children:e.name}),t.jsx("p",{className:"truncate text-xs text-fg-muted",children:e.email}),t.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-fg-subtle",children:[t.jsx(bN,{className:"size-3","aria-hidden":!0})," ",e.role,o&&t.jsx("span",{className:"ml-1 text-warning",children:"· demo"})]})]}),t.jsx("div",{className:"my-1 border-t border-border"}),r&&c("audit")&&t.jsxs(Re,{role:"menuitem",to:oe.audit(),onClick:()=>h(!1),className:"nav-item",children:[t.jsx(Eo,{className:"size-3.5","aria-hidden":!0})," Audit log"]}),t.jsxs(Re,{role:"menuitem",to:oe.settings("license"),onClick:()=>h(!1),className:"nav-item",children:[t.jsx(Yi,{className:"size-3.5","aria-hidden":!0})," License"]}),t.jsxs("button",{role:"menuitem",type:"button",onClick:()=>void n(),className:"nav-item w-full text-left",children:[t.jsx(pN,{className:"size-3.5","aria-hidden":!0})," Log out"]})]})]})}function sS({open:e,onClose:n}){const{byConnection:r}=sl(),i=sn(),[o,c]=N.useState(""),[d,h]=N.useState(0),m=N.useRef(null),g=N.useRef(null),p=N.useRef(null),v=N.useMemo(()=>r.flatMap(({connection:y,queues:b})=>b.map(k=>({key:`${y.id}/${k.name}`,connectionId:y.id,connectionName:y.name,queue:k.name,waiting:k.counts.waiting+k.counts.prioritized,failed:k.counts.failed,paused:k.isPaused,landing:co(k.counts)}))),[r]),j=N.useMemo(()=>{const y=o.trim().toLowerCase();return v.map(k=>({it:k,score:rS(y,k)})).filter(k=>k.score>0).sort((k,S)=>S.score-k.score||k.it.queue.localeCompare(S.it.queue)).slice(0,50).map(k=>k.it)},[v,o]);N.useEffect(()=>{const y=g.current;y&&(e&&!y.open?(y.showModal(),c(""),h(0),setTimeout(()=>{var b;return(b=m.current)==null?void 0:b.focus()},0)):!e&&y.open&&y.close())},[e]),N.useEffect(()=>{h(0)},[o]),N.useEffect(()=>{var b;const y=(b=p.current)==null?void 0:b.children[d];y==null||y.scrollIntoView({block:"nearest"})},[d]);const C=y=>{y&&(n(),i(oe.queue(y.connectionId,y.queue,y.landing)))};return t.jsx("dialog",{ref:g,className:"dialog !mt-[12vh]",style:{"--dialog-w":"36rem"},"aria-label":"Jump to queue",onClose:n,onCancel:y=>{y.preventDefault(),n()},onClick:y=>y.target===g.current&&n(),children:e&&t.jsxs("div",{onClick:y=>y.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[t.jsx(Hn,{className:"size-4 text-fg-subtle","aria-hidden":!0}),t.jsx("input",{ref:m,value:o,onChange:y=>c(y.target.value),placeholder:"Type a queue name…","aria-label":"Queue name","aria-activedescendant":j[d]?`qs-${j[d].key}`:void 0,role:"combobox","aria-expanded":!0,"aria-controls":"qs-list",className:"h-11 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-subtle",onKeyDown:y=>{y.key==="ArrowDown"?(y.preventDefault(),h(b=>Math.min(j.length-1,b+1))):y.key==="ArrowUp"?(y.preventDefault(),h(b=>Math.max(0,b-1))):y.key==="Enter"&&(y.preventDefault(),C(j[d]))}}),t.jsx(Vi,{children:"esc"})]}),t.jsxs("ul",{id:"qs-list",ref:p,role:"listbox",className:"max-h-[50vh] overflow-y-auto p-1",children:[j.length===0&&t.jsx("li",{className:"px-3 py-8 text-center text-xs text-fg-subtle",children:v.length===0?"No queues loaded yet":"No queue matches"}),j.map((y,b)=>t.jsxs("li",{id:`qs-${y.key}`,role:"option","aria-selected":b===d,onMouseEnter:()=>h(b),onClick:()=>C(y),className:F("flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5 text-[13px]",b===d?"bg-surface-3 text-fg":"text-fg-muted"),children:[t.jsx(Ji,{className:"size-3.5 shrink-0 text-fg-subtle","aria-hidden":!0}),t.jsx("span",{className:"truncate font-medium text-fg",children:t.jsx(aS,{text:y.queue,needle:o})}),t.jsx("span",{className:"truncate text-xs text-fg-subtle",children:y.connectionName}),y.paused&&t.jsx("span",{className:"rounded bg-surface-3 px-1 text-[9px] uppercase",children:"paused"}),t.jsxs("span",{className:"num ml-auto text-xs text-fg-subtle",children:[mt(y.waiting)," waiting"]}),y.failed>0&&t.jsxs("span",{className:"num text-xs text-danger",children:[mt(y.failed)," failed"]}),b===d&&t.jsx(sN,{className:"size-3.5 text-fg-subtle","aria-hidden":!0})]},y.key))]})]})})}function rS(e,n){if(!e)return 1;const r=n.queue.toLowerCase();if(r===e)return 100;if(r.startsWith(e))return 80;if(r.includes(e))return 60;if(n.connectionName.toLowerCase().includes(e))return 20;let i=0;for(let o=0;o<r.length&&i<e.length;o++)r[o]===e[i]&&i++;return i===e.length?10:0}function aS({text:e,needle:n}){const r=n.trim().toLowerCase();if(!r)return t.jsx(t.Fragment,{children:e});const i=e.toLowerCase().indexOf(r);return i<0?t.jsx(t.Fragment,{children:e}):t.jsxs(t.Fragment,{children:[e.slice(0,i),t.jsx("mark",{className:"rounded-sm bg-accent/25 text-fg",children:e.slice(i,i+r.length)}),e.slice(i+r.length)]})}const ho=new Map;let Kc=null,Jg=Number.POSITIVE_INFINITY,P0=Date.now();function iS(){document.hidden||(P0=Date.now(),ho.forEach((e,n)=>n()))}function Xg(){const e=ho.size?Math.min(...ho.values()):Number.POSITIVE_INFINITY;e!==Jg&&(Kc&&clearInterval(Kc),Kc=null,Jg=e,Number.isFinite(e)&&(Kc=setInterval(iS,e)))}function To(e=15e3){const[,n]=N.useState(0);return N.useEffect(()=>{const r=()=>n(i=>i+1);return ho.set(r,e),Xg(),()=>{ho.delete(r),Xg()}},[e]),P0}function Kt({value:e,className:n,withAbsolute:r,emptyText:i="–"}){const o=To(),c=Ro(e);if(c==null)return t.jsx("span",{className:F("text-fg-subtle",n),children:i});const d=fn(c);return t.jsxs("time",{dateTime:new Date(c).toISOString(),title:d,className:F("num whitespace-nowrap",n),children:[Ur(c,o),r&&t.jsx("span",{className:"ml-1.5 text-fg-subtle",children:d})]})}const lS="only leaves the list · jobs untouched · reversible",E0="Hide this queue from the lists. Nothing is deleted: the jobs, the workers and the alerts stay exactly as they are, and you can bring it back at any time. (Not to be confused with Obliterate, which deletes the queue and all its jobs for good.)",R0="Removed from the lists only. No job was deleted.";function hm(e){var o;const n=u2(e),r=(c,d={})=>n.mutate({queue:c,hidden:!1},{onSuccess:()=>{d.silent||Y.success(`${c} is visible again`)},onError:h=>Y.error(ye(h))});return{hide:c=>n.mutate({queue:c,hidden:!0},{onSuccess:()=>Y.undoable(`${c} hidden`,{label:"Undo",onClick:()=>r(c,{silent:!0})},R0),onError:d=>Y.error(ye(d))}),unhide:r,isPending:n.isPending,pendingQueue:n.isPending?((o=n.variables)==null?void 0:o.queue)??null:null}}function oS(){const e=We(),n=async(o,c,d)=>{const h=d?await ae.post(`/connections/${Be(o)}/hidden-queues`,{queueName:c}):await ae.del(`/connections/${Be(o)}/hidden-queues/${Be(c)}`);e.setQueryData(ie.hiddenQueues(o),h),e.invalidateQueries({queryKey:ie.queues(o)}),e.invalidateQueries({queryKey:ie.overview(o)})},r=(o,c,d={})=>n(o,c,!1).then(()=>{d.silent||Y.success(`${c} is visible again`)},h=>Y.error(ye(h)));return{hide:(o,c)=>n(o,c,!0).then(()=>Y.undoable(`${c} hidden`,{label:"Undo",onClick:()=>void r(o,c,{silent:!0})},R0),d=>Y.error(ye(d))),unhide:r}}function cS({connectionId:e,queueName:n}){var d;const{isOperator:r}=yt(),i=g0(e),o=hm(e),c=(d=i.data)==null?void 0:d.find(h=>h.queueName===n);return c?t.jsxs("div",{role:"status",className:"mx-auto flex w-full max-w-none flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-warning/40 bg-warning/10 px-5 py-2 text-xs text-fg",children:[t.jsx(_o,{className:"size-3.5 shrink-0 text-warning","aria-hidden":!0}),t.jsxs("span",{children:[t.jsx("span",{className:"font-medium",children:"This queue is hidden."})," It does not appear in the sidebar, the cards or the tables. Nothing was deleted — the jobs, the workers and the alerts are untouched."]}),t.jsxs("span",{className:"text-fg-subtle",children:["hidden ",t.jsx(Kt,{value:c.hiddenAt,className:"text-xs"}),c.hiddenByName&&` by ${c.hiddenByName}`]}),r&&t.jsx(V,{size:"xs",variant:"secondary",className:"ml-auto",leftIcon:t.jsx(Ey,{}),loading:o.pendingQueue===n,onClick:()=>o.unhide(n),children:"Show again"})]}):null}function uS(){const[e,n]=N.useState(!1),[r,i]=N.useState(!1),o=$n(),c=yg("/c/:connectionId/q/:queue/*"),d=yg("/c/:connectionId/q/:queue"),h=c??d,m=N.useCallback(()=>n(!0),[]);return o0("k",g=>{g.preventDefault(),n(p=>!p)},{mod:!0,allowInInputs:!0}),N.useEffect(()=>{i(!1)},[o.pathname]),t.jsxs("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[t.jsx(Zg,{onOpenSwitcher:m,className:"hidden lg:flex"}),r&&t.jsxs("div",{className:"fixed inset-0 z-40 flex lg:hidden",children:[t.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>i(!1),"aria-hidden":!0}),t.jsx(Zg,{onOpenSwitcher:m,onNavigate:()=>i(!1),className:"relative z-10 shadow-[var(--shadow)]"})]}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx(eS,{onOpenSwitcher:m,onToggleSidebar:()=>i(g=>!g)}),t.jsxs("main",{className:F("min-h-0 flex-1 overflow-y-auto"),children:[(h==null?void 0:h.params.connectionId)&&h.params.queue&&t.jsx(cS,{connectionId:h.params.connectionId,queueName:h.params.queue}),t.jsx(Yv,{})]})]}),t.jsx(sS,{open:e,onClose:()=>n(!1)})]})}function vt({children:e,className:n,wide:r}){return t.jsx("div",{className:F("mx-auto w-full px-5 py-5",r?"max-w-none":"max-w-[1400px]",n),children:e})}function hs({title:e,description:n,actions:r,className:i}){return t.jsxs("div",{className:F("mb-4 flex flex-wrap items-start justify-between gap-3",i),children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-fg",children:e}),n&&t.jsx("p",{className:"mt-0.5 text-xs text-fg-muted",children:n})]}),r&&t.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r})]})}function Lu({label:e,hint:n,error:r,htmlFor:i,className:o,children:c,inline:d}){return t.jsxs("div",{className:F(d?"flex items-center gap-3":"flex flex-col gap-1",o),children:[e&&t.jsx("label",{htmlFor:i,className:"text-xs font-medium text-fg-muted",children:e}),c,r?t.jsx("p",{className:"text-xs text-danger",role:"alert",children:r}):n?t.jsx("p",{className:"text-xs text-fg-subtle",children:n}):null]})}const Me=N.forwardRef(function({label:n,hint:r,error:i,mono:o,className:c,wrapperClassName:d,id:h,leftIcon:m,...g},p){const v=N.useId(),j=h??v,C=t.jsxs("div",{className:F("relative",m&&"[&_svg]:pointer-events-none"),children:[m&&t.jsx("span",{className:"pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-fg-subtle [&_svg]:size-3.5",children:m}),t.jsx("input",{ref:p,id:j,"aria-invalid":i?!0:void 0,className:F("control",o&&"font-mono",m&&"pl-8",c),...g})]});return!n&&!r&&!i?C:t.jsx(Lu,{label:n,hint:r,error:i,htmlFor:j,className:d,children:C})}),Hi=N.forwardRef(function({label:n,hint:r,error:i,mono:o,className:c,wrapperClassName:d,id:h,...m},g){const p=N.useId(),v=h??p,j=t.jsx("textarea",{ref:g,id:v,"aria-invalid":i?!0:void 0,className:F("control",o&&"font-mono text-xs",c),...m});return!n&&!r&&!i?j:t.jsx(Lu,{label:n,hint:r,error:i,htmlFor:v,className:d,children:j})}),ut=N.forwardRef(function({label:n,hint:r,error:i,className:o,wrapperClassName:c,id:d,options:h,children:m,...g},p){const v=N.useId(),j=d??v,C=t.jsx("select",{ref:p,id:j,"aria-invalid":i?!0:void 0,className:F("control",o),...g,children:h?h.map(y=>t.jsx("option",{value:y.value,disabled:y.disabled,children:y.label},y.value)):m});return!n&&!r&&!i?C:t.jsx(Lu,{label:n,hint:r,error:i,htmlFor:j,className:c,children:C})}),fm=N.forwardRef(function({label:n,description:r,className:i,id:o,...c},d){const h=N.useId(),m=o??h;return t.jsxs("label",{htmlFor:m,className:F("flex cursor-pointer items-start gap-2 text-[13px] select-none",i),children:[t.jsx("input",{ref:d,id:m,type:"checkbox",className:"mt-0.5 size-3.5 shrink-0 cursor-pointer accent-[var(--accent)]",...c}),(n||r)&&t.jsxs("span",{className:"flex flex-col",children:[n&&t.jsx("span",{className:"text-fg",children:n}),r&&t.jsx("span",{className:"text-xs text-fg-subtle",children:r})]})]})});function Ki({checked:e,onChange:n,disabled:r,label:i,className:o,size:c="md"}){const d=c==="sm"?"h-4 w-7":"h-5 w-9",h=c==="sm"?"size-3":"size-4",m=c==="sm"?"translate-x-3":"translate-x-4";return t.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,disabled:r,onClick:()=>n(!e),className:F("relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-colors outline-none focus-visible:ring-2 focus-visible:ring-accent/60 disabled:opacity-50",d,e?"bg-accent":"bg-surface-3",o),children:t.jsx("span",{className:F("inline-block rounded-full bg-white shadow transition-transform",h,e?m:"translate-x-0.5")})})}function M0({title:e,description:n,children:r,footer:i}){return t.jsx("div",{className:"flex min-h-screen items-center justify-center bg-bg px-4 py-10",children:t.jsxs("div",{className:"w-full max-w-sm",children:[t.jsxs("div",{className:"mb-6 flex items-center justify-center gap-2",children:[t.jsx(cm,{className:"size-8"}),t.jsx("span",{className:"text-base font-semibold tracking-tight",children:"Bullpane"}),t.jsx(om,{})]}),t.jsxs("div",{className:"card p-6 shadow-[var(--shadow)]",children:[t.jsx("h1",{className:"text-base font-semibold text-fg",children:e}),n&&t.jsx("p",{className:"mt-1 text-xs text-fg-muted",children:n}),t.jsx("div",{className:"mt-5",children:r})]}),i&&t.jsx("div",{className:"mt-4 text-center text-xs text-fg-subtle",children:i})]})})}function dS(){var we;const{login:e,needsSetup:n}=yt(),{demo:r}=jt(),i=sn(),o=$n(),[c,d]=ko(),[h,m]=N.useState(""),[g,p]=N.useState(""),[v,j]=N.useState(null),[C,y]=N.useState({}),[b,k]=N.useState(!1),S=c.get("sso_error");N.useEffect(()=>{if(!S)return;j(S);const Te=new URLSearchParams(c);Te.delete("sso_error"),d(Te,{replace:!0})},[S,c,d]);const{data:O}=E2(),q=(O==null?void 0:O.providers)??[],E=q.length>0,T=(O==null?void 0:O.requireSso)??!1,[M,$]=N.useState(!1),z=!T||M;if(n)return t.jsx(Fr,{to:"/setup",replace:!0});const B=(we=o.state)==null?void 0:we.from,U=B!=null&&B.pathname?`${B.pathname}${B.search??""}`:void 0,J=async Te=>{Te.preventDefault(),j(null);const Ze=ik.safeParse({email:h.trim(),password:g});if(!Ze.success){const Ge={};for(const rt of Ze.error.issues)Ge[rt.path[0]]=rt.message;y(Ge);return}y({}),k(!0);try{await e(Ze.data),i(U??"/",{replace:!0})}catch(Ge){Gs(Ge)&&Ge.status===401?j(ye(Ge,"Invalid email or password")):j(ye(Ge))}finally{k(!1)}};return t.jsxs(M0,{title:"Sign in",description:r?"Demo playground: Pro features are unlocked, settings are read-only.":T?"This installation signs in through your identity provider.":"Use the account created during setup.",footer:t.jsxs(t.Fragment,{children:["Self-hosted dashboard for BullMQ ·"," ",t.jsx(Re,{to:"/setup",className:"hover:text-fg",children:"first run?"})]}),children:[v&&t.jsx("p",{role:"alert",className:"mb-3 rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger",children:v}),E&&t.jsx("div",{className:"space-y-2",children:q.map(Te=>t.jsxs(V,{variant:"secondary",className:"w-full",leftIcon:t.jsx(Iu,{className:"size-4"}),onClick:()=>{const Ze=`/api/auth/sso/${encodeURIComponent(Te.id)}/start`;window.location.href=U?`${Ze}?next=${encodeURIComponent(U)}`:Ze},children:["Sign in with ",Te.name]},Te.id))}),E&&z&&t.jsxs("div",{className:"my-4 flex items-center gap-3",children:[t.jsx("span",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-[11px] uppercase tracking-wide text-fg-subtle",children:"or"}),t.jsx("span",{className:"h-px flex-1 bg-border"})]}),z?t.jsxs("form",{onSubmit:J,className:"space-y-3",noValidate:!0,children:[t.jsx(Me,{label:"Email",type:"email",autoComplete:"username",autoFocus:!E,value:h,onChange:Te=>m(Te.target.value),error:C.email,required:!0}),t.jsx(Me,{label:"Password",type:"password",autoComplete:"current-password",value:g,onChange:Te=>p(Te.target.value),error:C.password,required:!0}),T&&t.jsx("p",{className:"text-[11px] text-fg-subtle",children:(O==null?void 0:O.passwordEscapeHatch)==="all"?"Password sign-in is allowed for everyone on this installation (BULLPANE_ALLOW_PASSWORD_LOGIN).":"Password sign-in works for admin accounts only, so a misconfigured provider cannot lock you out."}),t.jsx(V,{type:"submit",variant:"primary",className:"w-full",loading:b,children:"Sign in"})]}):t.jsx("div",{className:"mt-4 text-center",children:t.jsx(V,{variant:"link",size:"sm",leftIcon:t.jsx(Yi,{className:"size-3.5"}),onClick:()=>$(!0),children:"Sign in with a password instead"})})]})}function hS(){const{setup:e,needsSetup:n,loading:r}=yt(),i=sn(),[o,c]=N.useState({name:"",email:"",password:"",confirm:""}),[d,h]=N.useState({}),[m,g]=N.useState(null),[p,v]=N.useState(!1);if(!r&&!n)return t.jsx(Fr,{to:"/login",replace:!0});const j=y=>b=>c(k=>({...k,[y]:b.target.value})),C=async y=>{y.preventDefault(),g(null);const b=ak.safeParse({name:o.name.trim(),email:o.email.trim(),password:o.password}),k={};if(!b.success)for(const S of b.error.issues)k[String(S.path[0])]=S.message;if(o.password!==o.confirm&&(k.confirm="Passwords do not match"),h(k),!(Object.keys(k).length>0||!b.success)){v(!0);try{await e(b.data),i("/",{replace:!0})}catch(S){Gs(S)&&S.status===409?g("Setup was already completed. Sign in instead."):g(ye(S))}finally{v(!1)}}};return t.jsx(M0,{title:"Create the admin account",description:"This is the first run. The account you create here is the administrator of this installation.",children:t.jsxs("form",{onSubmit:C,className:"space-y-3",noValidate:!0,children:[t.jsx(Me,{label:"Name",autoFocus:!0,autoComplete:"name",value:o.name,onChange:j("name"),error:d.name,required:!0}),t.jsx(Me,{label:"Email",type:"email",autoComplete:"username",value:o.email,onChange:j("email"),error:d.email,required:!0}),t.jsx(Me,{label:"Password",type:"password",autoComplete:"new-password",value:o.password,onChange:j("password"),error:d.password,hint:"At least 8 characters",required:!0}),t.jsx(Me,{label:"Confirm password",type:"password",autoComplete:"new-password",value:o.confirm,onChange:j("confirm"),error:d.confirm,required:!0}),m&&t.jsx("p",{role:"alert",className:"rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger",children:m}),t.jsx(V,{type:"submit",variant:"primary",className:"w-full",loading:p,children:"Create account"})]})})}const Sa=e=>`${e.connection.id}/${e.queue.name}`;function Pf(e,n){const r=[];if(n&&n.length>0){const o=new Map(e.map(p=>[Sa(p),p])),c=new Set,d=n.filter(p=>!p.parentId).sort(Yg),h=p=>n.filter(v=>v.parentId===p).sort(Yg),m=(p,v)=>{const j=[];for(const C of p.queues){const y=`${C.connectionId}/${C.queueName}`,b=o.get(y);b&&(j.push(b),c.add(y))}j.length>0&&r.push({id:`folder:${p.id}`,title:v,color:p.color,kind:"folder",items:$h(j)})};for(const p of d){m(p,p.name);for(const v of h(p.id))m(v,`${p.name} / ${v.name}`)}const g=e.filter(p=>!c.has(Sa(p)));return g.length>0&&r.push({id:"leftover",title:"Queues without folder",kind:"leftover",items:$h(g)}),r}const i=new Map;for(const o of e){let c=i.get(o.connection.id);c||(c={id:`conn:${o.connection.id}`,title:o.connection.name,kind:"connection",items:[]},i.set(o.connection.id,c)),c.items.push(o)}for(const o of i.values())o.items=$h(o.items);return[...i.values()]}function Yg(e,n){return e.position-n.position||e.name.localeCompare(n.name)}function $h(e){return[...e].sort((n,r)=>r.queue.counts.failed-n.queue.counts.failed||r.queue.counts.waiting-n.queue.counts.waiting||n.queue.name.localeCompare(r.queue.name))}function mm(e){return e.reduce((n,{queue:r})=>(n.queues+=1,r.isPaused&&(n.paused+=1),n.waiting+=r.counts.waiting+r.counts.prioritized,n.active+=r.counts.active,n.failed+=r.counts.failed,n.delayed+=r.counts.delayed,n.completed+=r.counts.completed,n),{queues:0,paused:0,waiting:0,active:0,failed:0,delayed:0,completed:0})}function pm(e,n){const r=n.trim().toLowerCase();return r?e.queue.name.toLowerCase().includes(r)||e.connection.name.toLowerCase().includes(r):!0}const fS={failing:"failing now",paused:"paused",backlog:"backlog, no worker",waiting:"backlog over threshold",failed:"failed jobs"},mS=1;function pS(e,n=bu){var g,p;const r=e.queue,i=r.counts,o=[],c=((g=r.rates)==null?void 0:g.failed)??0,d=(((p=r.rates)==null?void 0:p.completed)??0)+c;c>0&&o.push("failing"),r.isPaused&&o.push("paused");const h=i.waiting+i.prioritized,m=h>=mS&&i.active===0&&d===0&&!r.isPaused;return m&&o.push("backlog"),!m&&n.waitingAbove>0&&h>n.waitingAbove&&o.push("waiting"),n.failedAbove>0?i.failed>n.failedAbove&&o.push("failed"):o.length===0&&i.failed>0&&o.push("failed"),o}function ji(e){return e>0?Math.min(Math.log10(e+1)*1e3,9999):0}const xS={failed_rate_above:1e6,failed_above:1e6,duration_above:7e5,waiting_above:7e5};function gS(e,n,r=[]){var h;const i=e.queue,o=i.counts;let c=0,d=0;for(const m of r){const g=m.threshold>0?m.value/m.threshold:m.value;d=Math.max(d,xS[m.kind]+ji(g*100))}return c+=d,n.includes("failing")&&(c+=1e6+ji(((h=i.rates)==null?void 0:h.failed)??0)),n.includes("paused")&&(c+=5e5+ji(o.waiting+o.active)),n.includes("backlog")&&(c+=1e5+ji(o.waiting+o.prioritized)),n.includes("waiting")&&(c+=5e4+ji(o.waiting+o.prioritized)),n.includes("failed")&&(c+=ji(o.failed)),c}const vS=["paused","backlog"];function ev(e,n){return`${e}\0${n}`}function yS(e,n=bu,r=8,i){const o=[],c=[],d=new Map;for(const h of i??[]){const m=ev(h.connectionId,h.queueName),g=d.get(m);g?g.push(h):d.set(m,[h])}for(const h of e){const m=pS(h,n),g=i?m.filter(v=>vS.includes(v)):m,p=d.get(ev(h.connection.id,h.queue.name))??[];g.length>0||p.length>0?o.push({entry:h,reasons:g,findings:p,score:gS(h,g,p)}):c.push(h)}return o.sort((h,m)=>m.score-h.score||h.entry.queue.name.localeCompare(m.entry.queue.name)),{attention:jS(o,r),hidden:Math.max(0,o.length-r),rest:c}}function jS(e,n){if(e.length<=n)return e;const r=new Map;for(const c of e){const d=c.entry.connection.id,h=r.get(d);h?h.push(c):r.set(d,[c])}const i=[...r.values()],o=[];for(let c=0;o.length<n;c++){let d=!1;for(const h of i)if(!(c>=h.length)&&(o.push(h[c]),d=!0,o.length===n))break;if(!d)break}return o}function xm(e,n,r){const[i,o]=ko(),c=N.useMemo(()=>{const g=tv(i.get("sort"),i.get("dir"),r);if(g)return g;const p=Ou(`table.${e}.sort`,null);return p&&typeof p=="object"&&tv(p.key,p.dir,r)?p:n},[i,e,n,r]),d=i.get("filter")??"",h=N.useCallback(g=>{uo(`table.${e}.sort`,g),o(p=>{const v=new URLSearchParams(p);return v.set("sort",g.key),v.set("dir",g.dir),v},{replace:!0})},[o,e]),m=N.useCallback(g=>{o(p=>{const v=new URLSearchParams(p);return g.trim()?v.set("filter",g):v.delete("filter"),v},{replace:!0})},[o]);return{sort:c,setSort:h,filter:d,setFilter:m}}function tv(e,n,r){return!e||r&&!r.includes(e)?null:{key:e,dir:n==="asc"?"asc":"desc"}}function Fs(e,n,r=!1){const i=`var(--state-${e})`;return{label:n,fg:i,bg:`color-mix(in srgb, ${i} 14%, transparent)`,border:`color-mix(in srgb, ${i} 38%, transparent)`,dotClass:bS[e],textClass:wS[e],muted:r}}const bS={completed:"bg-state-completed",active:"bg-state-active",waiting:"bg-state-waiting",delayed:"bg-state-delayed",failed:"bg-state-failed",prioritized:"bg-state-prioritized",paused:"bg-state-paused","waiting-children":"bg-state-waiting-children",unknown:"bg-state-unknown"},wS={completed:"text-state-completed",active:"text-state-active",waiting:"text-state-waiting",delayed:"text-state-delayed",failed:"text-state-failed",prioritized:"text-state-prioritized",paused:"text-state-paused","waiting-children":"text-state-waiting-children",unknown:"text-state-unknown"},ot={completed:Fs("completed","completed"),active:Fs("active","active"),waiting:Fs("waiting","waiting"),delayed:Fs("delayed","delayed"),failed:Fs("failed","failed"),prioritized:Fs("prioritized","prioritized",!0),paused:Fs("paused","paused",!0),"waiting-children":Fs("waiting-children","waiting-children",!0),unknown:Fs("unknown","unknown",!0)};function Fu(e){return e&&ot[e]||ot.unknown}function NS(e){const n=Fu(e);return{"--chip-fg":n.fg,"--chip-bg":n.bg,"--chip-border":n.border}}const kS=["completed","active","waiting","delayed","failed"],SS=["prioritized","paused","waiting-children"];function Wi({values:e,width:n=96,height:r=22,className:i,stroke:o="currentColor",fill:c=!0,title:d,zeroBased:h=!0,dimmed:m}){const g=N.useId(),p=(e??[]).map(z=>typeof z=="number"&&Number.isFinite(z)?z:null),v=p.filter(z=>z!==null);if(v.length<2)return t.jsx("span",{className:F("inline-block text-fg-subtle/40",i),style:{width:n,height:r},"aria-hidden":!0,children:t.jsx("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,children:t.jsx("line",{x1:0,y1:r-1,x2:n,y2:r-1,stroke:"currentColor",strokeDasharray:"2 3"})})});const j=Math.max(...v),C=h?Math.min(0,...v):Math.min(...v),y=j===C?j+1:j,b=j===C?C-(h?0:1):C,k=1.5,S=p.length>1?(n-k*2)/(p.length-1):0,O=z=>r-k-(z-b)/(y-b||1)*(r-k*2),q=[];let E=null;p.forEach((z,B)=>{if(z===null){E=null;return}const U=[k+B*S,O(z)];E?E.pts.push(U):(E={pts:[U]},q.push(E))});const T=z=>z.map(([B,U],J)=>`${J===0?"M":"L"}${B.toFixed(1)},${U.toFixed(1)}`).join(" "),M=q[q.length-1],$=M==null?void 0:M.pts[M.pts.length-1];return t.jsxs("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,className:F("inline-block overflow-visible align-middle",m&&"opacity-40",i),role:"img","aria-label":d??`Sparkline, ${v.length} points`,children:[d&&t.jsx("title",{children:d}),c&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:`g-${g}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:o,stopOpacity:.35}),t.jsx("stop",{offset:"100%",stopColor:o,stopOpacity:0})]})}),q.map((z,B)=>{if(z.pts.length<2){const[Te,Ze]=z.pts[0];return t.jsx("circle",{cx:Te,cy:Ze,r:1.4,fill:o},B)}const U=T(z.pts),J=z.pts[0][0],we=z.pts[z.pts.length-1][0];return t.jsxs("g",{children:[c&&t.jsx("path",{d:`${U} L${we.toFixed(1)},${r} L${J.toFixed(1)},${r} Z`,fill:`url(#g-${g})`}),t.jsx("path",{d:U,fill:"none",stroke:o,strokeWidth:1.4,strokeLinejoin:"round",strokeLinecap:"round"})]},B)}),$&&t.jsx("circle",{cx:$[0],cy:$[1],r:1.8,fill:o})]})}const CS=Object.fromEntries(["waiting","active","completed","failed","delayed","prioritized","paused","waiting-children","unknown"].map(e=>{const n=Fu(e);return[e,{label:n.label,dot:n.dotClass,color:n.fg,text:n.textClass}]}));function T0({state:e,size:n,className:r}){const i=Fu(e);return t.jsx(be,{variant:"custom",size:n,dot:!0,className:F("border",r),style:{color:i.fg,background:i.bg,borderColor:i.border},children:i.label})}function nv({state:e,count:n,hideZero:r,short:i,className:o,title:c,to:d}){if(r&&!n)return null;const h=Fu(e),m=i&&e==="waiting-children"?"children":h.label,g=t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"opacity-80",children:m}),t.jsx("span",{className:"num font-semibold",children:mt(n)})]}),p=h.muted?void 0:NS(e),v=c??`${mt(n)} ${h.label}`;return d?t.jsx(Re,{to:d,className:F("state-chip relative z-10 hover:brightness-125 hover:underline",h.muted&&"muted",o),style:p,title:`${v} — open the ${h.label} tab`,children:g}):t.jsx("span",{className:F("state-chip",h.muted&&"muted",o),style:p,title:v,children:g})}const gm="This queue deletes completed jobs (removeOnComplete), so the sorted sets keep far fewer successes than failures and this ratio is probably too low. To measure it for real, create the Worker with metrics: { maxDataPoints: MetricsTime.ONE_WEEK }.",_S="From BullMQ's own metrics counters, which are recorded when each job finishes — unaffected by removeOnComplete.",PS="Counted from the completed/failed sorted sets over the trailing window.";function vm(e){return(e==null?void 0:e.retentionSkewed)===!0}function ym(e){return e?e.retentionSkewed?gm:e.source==="metrics"?_S:PS:""}function I0({rates:e,className:n}){return vm(e)?t.jsx(_e,{content:gm,className:n,children:t.jsx(Zn,{className:"size-3 shrink-0 text-warning","aria-label":"Success rate is unreliable: this queue prunes completed jobs"})}):null}function Du({entry:e,showConnection:n,onHide:r,hidePending:i}){const{connection:o,queue:c}=e,d=c.counts,h=oe.queue(o.id,c.name,co(d));return t.jsxs("article",{className:F("queue-card",c.isPaused&&"opacity-90",d.failed>0&&"border-state-failed/40"),"data-testid":"queue-card",children:[t.jsxs("header",{className:"flex min-w-0 items-start gap-1.5",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx(Re,{to:h,className:"block truncate font-mono text-[13px] font-semibold text-fg after:absolute after:inset-0 after:content-[''] hover:underline",title:c.name,children:c.name}),n&&t.jsx("div",{className:"truncate text-[11px] text-fg-subtle",title:o.name,children:o.name})]}),t.jsxs("div",{className:"relative z-10 flex shrink-0 items-center gap-1",children:[c.isPro&&t.jsx(be,{variant:"pro",size:"xs",className:"tracking-wider",title:`BullMQ Pro · ${W(c.groupsCount)} groups`,children:"PRO"}),c.isPaused&&t.jsx(be,{variant:"warning",size:"xs",className:"tracking-wider",children:"PAUSED"}),t.jsx(Re,{to:oe.queueSearch(o.id,c.name),className:"rounded p-0.5 text-fg-subtle hover:bg-surface-2 hover:text-fg",title:"Search jobs in this queue","aria-label":`Search jobs in ${c.name}`,children:t.jsx(Hn,{className:"size-3.5"})}),r&&t.jsx("button",{type:"button",disabled:i,onClick:()=>r(e),className:"rounded p-0.5 text-fg-subtle hover:bg-surface-2 hover:text-fg disabled:opacity-50",title:E0,"aria-label":`Hide ${c.name} from the lists`,children:t.jsx(_o,{className:"size-3.5"})})]})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[kS.map(m=>t.jsx(nv,{state:m,count:d[m],to:oe.queue(o.id,c.name,m)},m)),SS.map(m=>t.jsx(nv,{state:m,count:d[m],hideZero:!0,short:!0,to:oe.queue(o.id,c.name,m)},m))]}),t.jsxs("footer",{className:"mt-auto flex items-center gap-2 border-t border-border pt-2",children:[t.jsx(jm,{rates:c.rates,className:"min-w-0 flex-1"}),c.metrics&&c.metrics.completed.length>1&&t.jsx("span",{className:"shrink-0",style:{color:ot.completed.fg},children:t.jsx(Wi,{values:c.metrics.completed,width:56,height:14,title:"Completed per minute"})})]})]})}function q0(e){return e?e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`:"1h"}function jm({rates:e,className:n,compact:r}){const i=(e==null?void 0:e.successPct)??null,o=((e==null?void 0:e.completed)??0)+((e==null?void 0:e.failed)??0),c=q0(e==null?void 0:e.windowMinutes),d=vm(e),h=e?`${W(e.completed)} completed · ${W(e.failed)} failed in the last ${c}`:"no rate data",m=e?`${h}
|
|
524
|
+
|
|
525
|
+
${ym(e)}`:h;return t.jsxs("div",{className:F("flex flex-col gap-1",n),title:m,children:[t.jsx("div",{className:F("flex h-1.5 w-full overflow-hidden rounded-full bg-surface-3",d&&"opacity-50"),role:"img","aria-label":i==null?`No finished jobs in the last ${c}`:`${On(i)} success in the last ${c}${d?", unreliable: this queue prunes completed jobs":""}`,children:i!=null&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"h-full",style:{width:`${i}%`,background:ot.completed.fg}}),t.jsx("span",{className:"h-full flex-1",style:{background:ot.failed.fg,opacity:i>=100?0:1}})]})}),!r&&t.jsx("span",{className:"num flex min-w-0 items-center gap-1 text-[11px] text-fg-muted",children:i==null?t.jsxs("span",{className:"truncate text-fg-subtle",children:["no finished jobs · ",c]}):t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:F("truncate",d&&"opacity-60"),children:[t.jsxs("span",{className:F("font-medium",i<90?"text-state-failed":"text-fg"),children:[On(i)," ok"]}),t.jsxs("span",{className:"text-fg-subtle",children:[" · ",c]}),o>0&&t.jsxs("span",{className:"text-fg-subtle",children:[" · ",W(o)," finished"]})]}),t.jsx(I0,{rates:e})]})})]})}function O0({sections:e,showConnection:n,hideSingleHeader:r,className:i,onHide:o,hidePendingKey:c}){const d=e.length===1&&r;return t.jsx("div",{className:F("space-y-4",i),children:e.map(h=>t.jsxs("section",{"aria-label":h.title,children:[!d&&t.jsxs("h3",{className:"mb-1.5 flex items-center gap-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle uppercase",children:[h.kind==="folder"?t.jsx(Zs,{className:"size-3.5",style:{color:h.color??"var(--fg-subtle)"},"aria-hidden":!0}):h.kind==="connection"?t.jsx(Oy,{className:"size-3.5","aria-hidden":!0}):t.jsx(Ry,{className:"size-3.5","aria-hidden":!0}),t.jsx("span",{className:"truncate normal-case tracking-normal text-fg-muted",children:h.title}),t.jsx("span",{className:"num font-normal",children:h.items.length})]}),t.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(230px, 1fr))"},children:h.items.map(m=>t.jsx(Du,{entry:m,showConnection:n,onHide:o,hidePending:c===Sa(m)},`${m.connection.id}/${m.queue.name}`))})]},h.id))})}function bm({count:e=6}){return t.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(230px, 1fr))"},children:Array.from({length:e},(n,r)=>t.jsx("div",{className:"card h-[118px] animate-pulse"},r))})}function ES({sections:e,showConnection:n,defaultOpen:r,storagePrefix:i="overview.group",className:o}){return e.length===0?null:t.jsx("div",{className:F("space-y-1.5",o),children:e.map(c=>t.jsx(RS,{section:c,showConnection:n,defaultOpen:r,storagePrefix:i},c.id))})}function RS({section:e,showConnection:n,defaultOpen:r,storagePrefix:i}){const[o,c]=$u(`${i}.${e.id}`,r),d=mm(e.items),h=e.kind==="folder"?Zs:e.kind==="connection"?Oy:Ry;return t.jsxs("section",{className:"card overflow-hidden","aria-label":e.title,children:[t.jsxs("button",{type:"button",onClick:c,"aria-expanded":o,className:F("flex w-full flex-wrap items-center gap-x-4 gap-y-1 px-3 py-2 text-left transition-colors hover:bg-surface-2",o&&"border-b border-border"),children:[o?t.jsx(cs,{className:"size-3.5 shrink-0 text-fg-subtle","aria-hidden":!0}):t.jsx(Wn,{className:"size-3.5 shrink-0 text-fg-subtle","aria-hidden":!0}),t.jsx(h,{className:"size-3.5 shrink-0",style:{color:e.color??"var(--fg-subtle)"},"aria-hidden":!0}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium text-fg",title:e.title,children:e.title}),t.jsxs("span",{className:"num shrink-0 text-xs text-fg-subtle",children:[d.queues," ",d.queues===1?"queue":"queues",d.paused>0&&t.jsxs("span",{className:"text-state-paused",children:[" · ",d.paused," paused"]})]}),t.jsxs("span",{className:"flex shrink-0 flex-wrap items-center gap-x-3 gap-y-0.5",children:[t.jsx(zh,{state:"waiting",value:d.waiting}),t.jsx(zh,{state:"active",value:d.active}),t.jsx(zh,{state:"failed",value:d.failed,dimZero:!0})]})]}),o&&t.jsx("div",{className:"grid gap-2 p-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(230px, 1fr))"},children:e.items.map(m=>t.jsx(Du,{entry:m,showConnection:n},`${m.connection.id}/${m.queue.name}`))})]})}function zh({state:e,value:n,dimZero:r}){const i=ot[e],o=r&&n===0;return t.jsxs("span",{className:"flex items-baseline gap-1",title:`${n} ${i.label}`,children:[t.jsx("span",{className:F("status-dot size-1.5 self-center",i.dotClass,o&&"opacity-40"),"aria-hidden":!0}),t.jsx("span",{className:F("num text-xs font-medium",o?"text-fg-subtle":i.textClass),children:mt(n)}),t.jsx("span",{className:"text-[10px] text-fg-subtle",children:i.label})]})}function MS({items:e,hidden:n,showConnection:r,filtered:i,rules:o,className:c}){const d=o&&o.unmeasured>0&&t.jsx(_e,{content:"Their Workers keep no BullMQ metrics, so failure rules cannot judge them. Turn on metrics: { maxDataPoints } in the Worker options.",children:t.jsxs(Re,{to:oe.alerts,className:"inline-flex items-center gap-1 text-[11px] text-fg-subtle hover:text-fg",children:[t.jsx(Xi,{className:"size-3","aria-hidden":!0}),W(o.unmeasured)," ",o.unmeasured===1?"queue":"queues"," not measurable"]})});return e.length===0?t.jsxs("section",{"aria-label":"Needs attention",className:F("card flex flex-wrap items-center gap-2 px-4 py-2.5",c),children:[t.jsx(Vf,{className:"size-4 shrink-0 text-state-completed","aria-hidden":!0}),t.jsxs("p",{className:"text-xs text-fg-muted",children:[i?"Nothing matching the filter needs attention":"No queue needs attention",t.jsx("span",{className:"text-fg-subtle",children:o?o.rules>0?" — no rule broken, nothing paused or stuck. ":" — nothing paused or stuck, and no rule is set. ":" — nothing failing, paused or over the thresholds."}),o&&t.jsx(Re,{to:oe.alerts,className:"text-accent hover:underline",children:o.rules>0?`${o.rules} ${o.rules===1?"rule":"rules"} watching`:"Add a rule"})]}),d&&t.jsx("span",{className:"ml-auto",children:d})]}):t.jsxs("section",{"aria-label":"Needs attention",className:c,children:[t.jsxs("h2",{className:"mb-1.5 flex items-center gap-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle uppercase",children:[t.jsx(Zn,{className:"size-3.5 text-warning","aria-hidden":!0}),t.jsx("span",{className:"normal-case tracking-normal text-fg-muted",children:"Needs attention"}),t.jsx("span",{className:"num font-normal",children:W(e.length+n)}),n>0&&t.jsxs("span",{className:"font-normal normal-case tracking-normal text-fg-subtle",children:["· showing the ",e.length," worst, the rest are in the table below"]}),d&&t.jsx("span",{className:"ml-auto font-normal normal-case tracking-normal",children:d})]}),t.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(230px, 1fr))"},children:e.map(({entry:h,reasons:m,findings:g})=>t.jsxs("div",{className:"relative flex flex-col gap-1",children:[t.jsx(Du,{entry:h,showConnection:r}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.map(p=>t.jsx(qS,{finding:p},p.alertId)),m.map(p=>t.jsx(OS,{reason:p},p))]})]},`${h.connection.id}/${h.queue.name}`))})]})}const Xc={failing:"border-state-failed/40 bg-state-failed/10 text-state-failed",paused:"border-state-paused/40 bg-state-paused/10 text-state-paused",backlog:"border-warning/40 bg-warning/10 text-warning",waiting:"border-warning/40 bg-warning/10 text-warning",failed:"border-state-failed/30 bg-state-failed/5 text-state-failed"},TS={failed_rate_above:Xc.failing,failed_above:Xc.failing,duration_above:"border-state-delayed/40 bg-state-delayed/10 text-state-delayed",waiting_above:Xc.waiting};function Ah(e,n){return e.unit==="%"?`${n}%`:e.unit==="s"?n>=10?`${Math.round(n)}s`:n>=1?`${n.toFixed(1)}s`:`${Math.round(n*1e3)}ms`:W(n)}function IS(e){const n=e.windowMinutes?` · ${e.windowMinutes>=60&&e.windowMinutes%60===0?`${e.windowMinutes/60}h`:`${e.windowMinutes}m`}`:"",r=` > ${Ah(e,e.threshold)}`;switch(e.kind){case"failed_rate_above":return`${Ah(e,e.value)} failed${n}${r}`;case"failed_above":return`${W(e.value)} failed${n}${r}`;case"duration_above":return`p${e.percentile??95} ${Ah(e,e.value)}${n}${r}`;case"waiting_above":return`${W(e.value)} waiting${r}`}}function qS({finding:e}){return t.jsx(_e,{content:`Rule "${e.alertName}"${e.notifies?"":" · dashboard only, notifies nobody"}`,children:t.jsxs(Re,{to:oe.alerts,className:F("inline-flex items-center gap-1 rounded border px-1.5 py-px text-[10px] font-medium hover:brightness-110",TS[e.kind]),children:[!e.notifies&&t.jsx(Xw,{className:"size-2.5 opacity-70","aria-hidden":!0}),t.jsx("span",{className:"num",children:IS(e)})]})})}function OS({reason:e}){return t.jsx("span",{className:F("rounded border px-1.5 py-px text-[10px] font-medium",Xc[e]),children:fS[e]})}function $0({totals:e,title:n="All queues",className:r,children:i,hiddenCount:o=0,onRevealHidden:c}){return t.jsxs("div",{className:F("card flex flex-wrap items-center gap-x-5 gap-y-2 px-4 py-2.5",r),children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("h2",{className:"text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:n}),t.jsxs("span",{className:"num text-xs text-fg-muted",children:[W(e.queues)," ",e.queues===1?"queue":"queues",e.paused>0&&t.jsxs("span",{className:"text-state-paused",children:[" · ",W(e.paused)," paused"]})]}),o>0&&(c?t.jsxs("button",{type:"button",onClick:c,className:"num text-xs text-fg-subtle underline decoration-dotted underline-offset-2 hover:text-fg-muted",title:"These queues are hidden and are NOT included in the totals. Click to see them.",children:[W(o)," hidden"]}):t.jsxs("span",{className:"num text-xs text-fg-subtle",title:"These queues are hidden and are NOT included in the totals.",children:[W(o)," hidden"]}))]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[t.jsx(Zl,{state:"waiting",value:e.waiting}),t.jsx(Zl,{state:"active",value:e.active}),t.jsx(Zl,{state:"delayed",value:e.delayed}),t.jsx(Zl,{state:"failed",value:e.failed,dimZero:!0}),t.jsx(Zl,{state:"completed",value:e.completed})]}),i&&t.jsx("div",{className:"ml-auto flex items-center gap-2",children:i})]})}function Zl({state:e,value:n,dimZero:r}){const i=ot[e],o=r&&n===0;return t.jsxs("span",{className:"flex items-baseline gap-1.5",title:`${W(n)} ${i.label}`,children:[t.jsx("span",{className:F("status-dot size-2 self-center",i.dotClass,o&&"opacity-40"),"aria-hidden":!0}),t.jsx("span",{className:F("num text-sm font-semibold",o?"text-fg-muted":i.textClass),children:mt(n)}),t.jsx("span",{className:"text-xs text-fg-subtle",children:i.label})]})}function wm({value:e,onChange:n,className:r,placeholder:i="Filter queues…","aria-label":o="Filter queues by name or connection"}){return t.jsxs("div",{className:F("relative w-64",r),children:[t.jsx(Me,{leftIcon:t.jsx(Hn,{}),placeholder:i,value:e,onChange:c=>n(c.target.value),onKeyDown:c=>c.key==="Escape"&&n(""),className:"!h-7 pr-7 text-xs","aria-label":o}),e&&t.jsx("button",{type:"button",className:"absolute top-1/2 right-1.5 -translate-y-1/2 rounded p-0.5 text-fg-subtle hover:text-fg","aria-label":"Clear filter",onClick:()=>n(""),children:t.jsx(mn,{className:"size-3.5"})})]})}function os({dense:e,className:n,wrapperClassName:r,maxHeight:i,children:o,...c}){return t.jsx("div",{className:F("table-wrap",i!=null&&"overflow-y-auto",r),style:i!=null?{maxHeight:i}:void 0,children:t.jsx("table",{className:F("data-table",e&&"dense",n),...c,children:o})})}function fe({align:e="left",className:n,...r}){return t.jsx("th",{scope:"col",className:F(e==="right"&&"!text-right",e==="center"&&"!text-center",n),...r})}function me({align:e="left",num:n,mono:r,muted:i,className:o,...c}){return t.jsx("td",{className:F(e==="right"&&"text-right",e==="center"&&"text-center",n&&"num",r&&"font-mono text-xs",i&&"text-fg-muted",o),...c})}function rl({onActivate:e,selected:n,className:r,onClick:i,onKeyDown:o,...c}){const d=!!e;return t.jsx("tr",{tabIndex:d?0:void 0,"aria-selected":n||void 0,className:F(d&&"row-click",n&&"bg-accent/10",r),onClick:h=>{i==null||i(h),!(!d||h.defaultPrevented||h.target.closest("button, a, input, select, textarea, [data-no-row-click]"))&&(e==null||e())},onKeyDown:h=>{o==null||o(h),!(!d||h.defaultPrevented)&&h.target===h.currentTarget&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),e==null||e())},...c})}function xt({colSpan:e,children:n,className:r}){return t.jsx("tr",{children:t.jsx("td",{colSpan:e,className:F("!py-10 text-center text-fg-subtle",r),children:n})})}function $S(e,n){const r=e==null||e==="",i=n==null||n==="";if(r&&i)return 0;if(r)return 1;if(i)return-1;if(typeof e=="number"&&typeof n=="number")return e-n;if(typeof e=="boolean"&&typeof n=="boolean")return Number(e)-Number(n);const o=String(e),c=String(n),d=Number(o),h=Number(c);return o.trim()!==""&&c.trim()!==""&&!Number.isNaN(d)&&!Number.isNaN(h)?d-h:o.localeCompare(c,void 0,{numeric:!0,sensitivity:"base"})}function zS(e,n,r){const i=n.find(d=>d.key===r.key&&d.sortValue);if(!i)return e;const o=i.sortValue,c=r.dir==="asc"?1:-1;return e.map((d,h)=>({row:d,i:h,v:o(d)})).sort((d,h)=>{const m=$S(d.v,h.v);return m!==0&&(d.v==null||h.v==null||d.v===""||h.v==="")?m:m!==0?m*c:d.i-h.i}).map(d=>d.row)}function AS({columns:e,rows:n,rowKey:r,sort:i,onSort:o,onRowActivate:c,rowClassName:d,message:h,messageClassName:m,presorted:g,className:p,...v}){const j=N.useMemo(()=>g?n:zS(n,e,i),[n,e,i,g]),C=y=>{y.sortValue&&(i.key===y.key?o({key:y.key,dir:i.dir==="asc"?"desc":"asc"}):o({key:y.key,dir:y.defaultDir??(y.num||y.align==="right"?"desc":"asc")}))};return t.jsxs(os,{className:p,...v,children:[t.jsx("thead",{children:t.jsx("tr",{children:e.map(y=>{const b=i.key===y.key&&!!y.sortValue,k=b?i.dir==="asc"?"ascending":"descending":y.sortValue?"none":void 0;return t.jsx(fe,{align:y.align,className:F(y.thClassName,b&&"!text-fg"),"aria-sort":k,children:y.sortValue?t.jsxs("button",{type:"button",className:F("sort-header",y.align==="right"&&"flex-row-reverse"),onClick:()=>C(y),title:`Sort by ${typeof y.header=="string"?y.header:y.key}`,children:[t.jsx("span",{children:y.header}),b?i.dir==="asc"?t.jsx(Gw,{className:"size-3","aria-hidden":!0}):t.jsx(Kw,{className:"size-3","aria-hidden":!0}):t.jsx(Ww,{className:"size-3 opacity-40","aria-hidden":!0})]}):y.header},y.key)})})}),t.jsxs("tbody",{children:[h!=null&&j.length===0&&t.jsx(xt,{colSpan:e.length,className:m,children:h}),j.map(y=>t.jsx(rl,{onActivate:c?()=>c(y):void 0,className:d==null?void 0:d(y),children:e.map(b=>t.jsx(me,{align:b.align,num:b.num,mono:b.mono,muted:typeof b.muted=="function"?b.muted(y):b.muted,className:b.className,"data-no-row-click":b.noRowClick?!0:void 0,children:b.render(y)},b.key))},r(y)))]})]})}const Nm=["queue","connection","waiting","active","completed","failed","delayed","prioritized","waiting-children","success","paused","groups","trend","actions"],km={key:"failed",dir:"desc"};function Sm({rows:e,showConnection:n,sort:r,onSort:i,message:o,messageClassName:c,onToggle:d,pendingKey:h,onHide:m,hidePendingKey:g}){const p=sn(),v=N.useMemo(()=>{var C,y;const j=[{key:"queue",header:"Queue",sortValue:b=>b.queue.name,render:b=>t.jsx(Re,{to:oe.queue(b.connection.id,b.queue.name,co(b.queue.counts)),className:"font-mono text-xs font-medium hover:underline",title:`${b.queue.prefix}:${b.queue.name}`,children:b.queue.name}),className:"max-w-72 truncate"}];return n&&j.push({key:"connection",header:"Connection",sortValue:b=>b.connection.name,render:b=>b.connection.name,muted:!0,className:"max-w-48 truncate"}),j.push(oa("waiting","Waiting",b=>b.queue.counts.waiting),oa("active","Active",b=>b.queue.counts.active),oa("completed","Completed",b=>b.queue.counts.completed,!0),oa("failed","Failed",b=>b.queue.counts.failed),oa("delayed","Delayed",b=>b.queue.counts.delayed,!0),oa("prioritized","Prioritized",b=>b.queue.counts.prioritized,!0),oa("waiting-children","Waiting-children",b=>b.queue.counts["waiting-children"],!0),{key:"success",header:`Success % (${q0((y=(C=e[0])==null?void 0:C.queue.rates)==null?void 0:y.windowMinutes)})`,align:"right",num:!0,sortValue:b=>{var k;return((k=b.queue.rates)==null?void 0:k.successPct)??null},render:b=>{const k=b.queue.rates,S=(k==null?void 0:k.successPct)??null,O=vm(k);return t.jsxs("span",{className:"inline-flex items-center justify-end gap-1.5",title:ym(k),children:[t.jsx(jm,{rates:k,compact:!0,className:"w-14"}),t.jsx("span",{className:F("num w-14 text-right",O&&"opacity-50",S==null?"text-fg-subtle":S<90?"font-semibold text-state-failed":"text-fg"),children:S==null?"–":On(S)}),t.jsx(I0,{rates:k,className:"w-3"})]})}},{key:"paused",header:"Paused",sortValue:b=>b.queue.isPaused,render:b=>b.queue.isPaused?t.jsx(be,{variant:"warning",size:"xs",className:"tracking-wider",children:"PAUSED"}):t.jsx("span",{className:"text-fg-subtle",children:"–"})},{key:"groups",header:"Groups",align:"right",num:!0,sortValue:b=>b.queue.isPro?b.queue.groupsCount:null,render:b=>b.queue.isPro?t.jsxs(Re,{to:oe.groups(b.connection.id,b.queue.name),className:"inline-flex items-center gap-1.5 hover:underline",title:"BullMQ Pro groups",children:[t.jsx(be,{variant:"pro",size:"xs",className:"tracking-wider",children:"PRO"}),W(b.queue.groupsCount)]}):t.jsx("span",{className:"text-fg-subtle",children:"–"})},{key:"trend",header:"Trend",sortValue:b=>{var S;const k=(S=b.queue.metrics)==null?void 0:S.completed;return k&&k.length?k.reduce((O,q)=>O+q,0):null},render:b=>{var k;return t.jsx("span",{style:{color:ot.completed.fg},children:t.jsx(Wi,{values:(k=b.queue.metrics)==null?void 0:k.completed,width:80,height:18,title:"Completed per minute"})})}},{key:"actions",header:t.jsx("span",{className:"sr-only",children:"Actions"}),align:"right",noRowClick:!0,render:b=>t.jsxs("span",{className:"inline-flex items-center justify-end gap-0.5",children:[t.jsx(V,{size:"icon-xs",variant:"ghost",title:"Search jobs","aria-label":`Search jobs in ${b.queue.name}`,onClick:()=>p(oe.queueSearch(b.connection.id,b.queue.name)),children:t.jsx(Hn,{})}),d&&t.jsx(V,{size:"icon-xs",variant:"ghost",loading:h===Sa(b),title:b.queue.isPaused?"Resume queue":"Pause queue","aria-label":b.queue.isPaused?"Resume queue":"Pause queue",onClick:()=>d(b),children:b.queue.isPaused?t.jsx(Hf,{}):t.jsx(el,{})}),m&&t.jsx(V,{size:"icon-xs",variant:"ghost",loading:g===Sa(b),title:E0,"aria-label":`Hide ${b.queue.name} from the lists`,onClick:()=>m(b),children:t.jsx(_o,{})})]})}),j},[n,d,h,m,g,p,e]);return t.jsx(AS,{columns:v,rows:e,rowKey:Sa,sort:r,onSort:i,onRowActivate:j=>p(oe.queue(j.connection.id,j.queue.name,co(j.queue.counts))),message:o,messageClassName:c,className:"min-w-[1100px]"})}function oa(e,n,r,i=!1){var d;const o=(d=ot[e])==null?void 0:d.textClass,c=e;return{key:e,header:n,align:"right",num:!0,sortValue:r,noRowClick:!0,render:h=>{const m=r(h),g=F(m>0?o:"text-fg-subtle",e==="failed"&&m>0&&"font-semibold");return m===0?t.jsx("span",{className:g,children:W(m)}):t.jsx(Re,{to:oe.queue(h.connection.id,h.queue.name,c),className:F(g,"hover:underline"),title:`Open the ${n.toLowerCase()} jobs of ${h.queue.name}`,children:W(m)})},muted:i?h=>r(h)===0:void 0}}const LS=4;function FS({className:e}){const{health:n,paused:r,isLoading:i,error:o}=Au(),[c,d]=$u("overview.health.expanded",!1),h=n.flatMap(p=>p.warnings.filter(v=>v.level==="critical").map(v=>({health:p,warning:v}))),m=n.filter(p=>!p.ok);if(!i&&n.length===0&&o==null)return null;const g=n.length>LS;return t.jsxs("section",{"aria-label":"Redis health",className:F("space-y-2",e),children:[h.length>0&&t.jsx(US,{items:h}),t.jsxs("div",{className:"card px-2 py-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(So,{className:F("size-3.5 shrink-0 text-fg-subtle",r&&"opacity-50"),"aria-hidden":!0}),i&&n.length===0?t.jsx("span",{className:"min-w-0 flex-1 text-[11px] text-fg-subtle",children:"Reading Redis health…"}):o!=null&&n.length===0?t.jsxs("span",{className:"min-w-0 flex-1 truncate text-[11px] text-danger",children:["Could not load health: ",ye(o)]}):g?t.jsx(DS,{health:n,paused:r,expanded:c,onToggle:d}):t.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:n.map(p=>t.jsx(sv,{health:p,paused:r},p.connectionId))}),r&&t.jsx(_e,{content:"Monitoring is paused — the dashboard is sending no INFO commands. These are the last numbers received.",children:t.jsxs("span",{className:"flex shrink-0 cursor-help items-center gap-1 text-[11px] text-warning",children:[t.jsx(el,{className:"size-3","aria-hidden":!0}),"paused"]})}),m.length>0&&!r&&!g&&t.jsxs("span",{className:"shrink-0 text-[11px] font-medium text-danger",children:[m.length," unreachable"]}),t.jsx(Re,{to:oe.health,className:"shrink-0 rounded-md border border-border px-1.5 py-0.5 text-[11px] text-fg-muted transition-colors hover:border-border-strong hover:text-fg",children:"Monitor"})]}),g&&c&&t.jsx("div",{className:"mt-2 flex flex-col gap-1 border-t border-border pt-2",children:n.map(p=>t.jsx(sv,{health:p,paused:r,className:"min-w-0"},p.connectionId))})]})]})}function DS({health:e,paused:n,expanded:r,onToggle:i}){const o=dm(e),c=e.filter(h=>!h.ok||h.warnings.some(m=>m.level==="critical")),d=o.total-c.length;return t.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("button",{type:"button",onClick:i,"aria-expanded":r,className:"flex shrink-0 items-center gap-1 rounded text-xs font-medium text-fg hover:text-accent",children:[r?t.jsx(cs,{className:"size-3.5 text-fg-subtle","aria-hidden":!0}):t.jsx(Wn,{className:"size-3.5 text-fg-subtle","aria-hidden":!0}),t.jsxs("span",{className:"num",children:[o.total," connections"]})]}),t.jsxs("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-fg-muted",children:[d>0&&t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"status-dot bg-success text-success","aria-hidden":!0}),t.jsxs("span",{className:"num",children:[d," ok"]})]}),c.length>0?t.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5",children:[t.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 font-medium text-danger",children:[t.jsx("span",{className:"status-dot pulse bg-danger text-danger","aria-hidden":!0}),t.jsxs("span",{className:"num",children:[c.length," with problems"]})]}),c.slice(0,3).map(h=>t.jsx(_e,{content:h.ok?h.warnings.map(m=>m.message).join(" · "):`Unreachable: ${h.error??"unknown error"}`,children:t.jsx(Re,{to:oe.health,className:"max-w-52 shrink-0 cursor-help truncate rounded border border-danger/40 bg-danger/10 px-1.5 py-px text-[11px] font-medium text-danger",children:h.connectionName})},h.connectionId)),c.length>3&&t.jsxs(Re,{to:oe.health,className:"shrink-0 text-[11px] text-danger underline underline-offset-2",children:["+",c.length-3," more"]})]}):o.warn>0&&t.jsxs("span",{className:"flex items-center gap-1.5 text-warning",children:[t.jsx("span",{className:"status-dot bg-warning text-warning","aria-hidden":!0}),t.jsxs("span",{className:"num",children:[o.warn," warning",o.warn===1?"":"s"]})]}),!n&&t.jsxs(t.Fragment,{children:[t.jsx(ha,{label:"cmd/s",value:o.commandsPerSec==null?"–":Bi(o.commandsPerSec,""),tip:o.commandsPerSec==null?"No rate yet — needs two INFO samples. This is not zero.":"Summed across every connection"}),t.jsx(ha,{label:"cpu",value:Qi(o.cpuCores),tip:`Busiest single Redis — ${Mo(o.cpuCores)}`,tone:um(o.cpuCores)}),o.memoryPct!=null&&t.jsx(ha,{label:"mem",value:On(o.memoryPct,0),tip:"Highest memory use against maxmemory across connections",tone:o.memoryPct>=90?"danger":o.memoryPct>=75?"warn":void 0})]})]}),t.jsx("button",{type:"button",onClick:i,className:"shrink-0 text-[11px] text-fg-subtle underline underline-offset-2 hover:text-fg",children:r?"hide all":"show all"})]})}function sv({health:e,paused:n,className:r}){const i=e.info,o=!e.ok,c=QS(e.warnings),d=o?`Unreachable: ${e.error??"unknown error"}`:e.warnings.length>0?e.warnings.map(h=>h.message).join(" · "):"Responding to INFO";return t.jsxs("div",{className:F("flex min-w-0 items-center gap-2",n&&"opacity-70",r),children:[t.jsx(_e,{content:d,children:t.jsx("span",{className:F("status-dot shrink-0 cursor-help",o?"bg-danger pulse text-danger":c==="critical"?"bg-danger text-danger":c==="warn"?"bg-warning text-warning":"bg-success text-success"),role:"img","aria-label":o?"unreachable":c?`${c} warning`:"ok"})}),t.jsx(Re,{to:oe.health,className:"min-w-0 flex-1 truncate text-xs font-medium text-fg hover:underline",title:e.connectionName,children:e.connectionName}),o?t.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-danger",children:e.error??"Redis is unreachable"}):t.jsxs("span",{className:"flex shrink-0 items-center gap-x-3 text-[11px] text-fg-muted",children:[t.jsx(ha,{label:"mem",value:i?`${i.usedMemoryHuman||Ns(i.usedMemoryBytes)}${e.memoryUsedPct!=null?` · ${On(e.memoryUsedPct)}`:""}`:"–",tip:e.memoryUsedPct!=null&&(i!=null&&i.maxMemoryBytes)?`${On(e.memoryUsedPct)} of ${Ns(i.maxMemoryBytes)} maxmemory`:"used_memory — no maxmemory set on this Redis",tone:e.memoryUsedPct==null?void 0:e.memoryUsedPct>=90?"danger":e.memoryUsedPct>=75?"warn":void 0}),t.jsx(ha,{label:"cpu",value:Qi(e.cpuCores),tip:Mo(e.cpuCores),tone:um(e.cpuCores)}),t.jsx(ha,{label:"cmd/s",value:e.commandsPerSec==null?"–":Bi(e.commandsPerSec,""),tip:e.commandsPerSec==null?"No rate yet — needs two INFO samples. This is not zero.":"Derived from total_commands_processed between samples"}),t.jsx(ha,{label:"lat",value:i?sm(i.latencyMs):"–",tip:"Round trip of the INFO command itself"})]})]})}function ha({label:e,value:n,tip:r,tone:i}){return t.jsx(_e,{content:r,children:t.jsxs("span",{className:"cursor-help items-baseline gap-1 whitespace-nowrap",children:[t.jsx("span",{className:F("num font-medium",i==="danger"?"text-danger":i==="warn"?"text-warning":"text-fg"),children:n}),t.jsx("span",{className:"ml-1 text-fg-subtle",children:e})]})})}function US({items:e}){return t.jsxs("div",{role:"status",className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger/10 px-2.5 py-1.5 text-xs text-danger",children:[t.jsx(Ty,{className:"mt-px size-3.5 shrink-0","aria-hidden":!0}),t.jsx("div",{className:"min-w-0 flex-1 space-y-0.5 leading-snug",children:e.map(({health:n,warning:r},i)=>t.jsxs("p",{className:"truncate",children:[t.jsx("span",{className:"font-semibold",children:n.connectionName}),t.jsx("span",{className:"mx-1.5 opacity-50",children:"·"}),r.message]},`${n.connectionId}-${r.code}-${i}`))}),t.jsx(Re,{to:oe.health,className:"shrink-0 underline underline-offset-2 hover:no-underline",children:"Monitor"})]})}function QS(e){let n=null;for(const r of e){if(r.level==="critical")return"critical";n="warn"}return n}const BS=2;function VS(){var rt,Qe;const{isAdmin:e,isOperator:n}=yt(),{has:r}=jt(),{connections:i,entries:o,isLoading:c}=Hk(),d=v0(),h=r("alerts"),m=m2(h),g=r("folders"),p=Br(g),v=sn(),{sort:j,setSort:C,filter:y,setFilter:b}=xm("overview",km,Nm),k=N.useMemo(()=>o.flatMap(K=>{var ue;return(((ue=K.result.data)==null?void 0:ue.queues)??[]).map(se=>({connection:K.connection,queue:se}))}),[o]),S=N.useMemo(()=>k.filter(K=>pm(K,y)),[k,y]),O=N.useMemo(()=>mm(k),[k]),q=c||o.some(K=>K.result.isLoading),E=N.useMemo(()=>o.reduce((K,ue)=>{var se;return K+(((se=ue.result.data)==null?void 0:se.hiddenCount)??0)},0),[o]),T=N.useMemo(()=>o.filter(K=>{var ue;return((ue=K.result.data)==null?void 0:ue.discovery)&&!K.result.data.discovery.complete}).map(K=>{var ue,se;return{name:K.connection.name,keys:((se=(ue=K.result.data)==null?void 0:ue.discovery)==null?void 0:se.totalKeys)??null}}),[o]),M=N.useMemo(()=>{const K=o.filter(ue=>{var se;return(((se=ue.result.data)==null?void 0:se.hiddenCount)??0)>0});return K.length===1?K[0].connection.id:null},[o]),$=oS(),z=n?K=>void $.hide(K.connection.id,K.queue.name):void 0,B=((rt=i.data)==null?void 0:rt.length)??0,U=B>BS,J=h?((Qe=m.data)==null?void 0:Qe.findings)??[]:void 0,we=N.useMemo(()=>yS(S,d.data,8,J),[S,d.data,J]),Te=N.useMemo(()=>{if(!h||!m.data)return;const K=new Set(S.map(se=>`${se.connection.id}\0${se.queue.name}`)),ue=m.data.unmeasured.filter(se=>K.has(`${se.connectionId}\0${se.queueName}`)).length;return{rules:m.data.rules,unmeasured:ue}},[h,m.data,S]),Ze=N.useMemo(()=>Pf(we.rest,g?p.data:void 0),[we.rest,g,p.data]),Ge=N.useMemo(()=>Pf(S,g?p.data:void 0),[S,g,p.data]);return!c&&B===0?t.jsx(vt,{children:t.jsx(nn,{icon:t.jsx(Ji,{}),title:"No Redis connections yet",description:e?"Point the dashboard at a Redis that runs BullMQ. Queues are discovered automatically from the key prefix.":"An administrator needs to add a Redis connection before queues show up here.",action:e&&t.jsx(V,{variant:"primary",leftIcon:t.jsx(Kn,{}),onClick:()=>v(`${oe.settings("connections")}?new=1`),children:"Add connection"})})}):t.jsxs(vt,{wide:!0,children:[t.jsx(hs,{title:"Overview",description:"Every connection and queue at a glance. Refreshes every 5 seconds."}),t.jsx(FS,{className:"mb-3"}),T.length>0&&t.jsxs("p",{className:"mb-3 rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-fg-muted",role:"status",children:["Still discovering queues on ",T.map(K=>`${K.name}${K.keys?` (${W(K.keys)} keys)`:""}`).join(", "),": the keyspace is large and the SCAN runs in bounded passes. Queues with a connected worker are listed already; the others appear as the scan completes."]}),t.jsxs("section",{className:"space-y-3","aria-label":"All queues",children:[t.jsxs($0,{totals:O,hiddenCount:E,onRevealHidden:M?()=>v(`${oe.connection(M)}#hidden-queues`):void 0,children:[t.jsx(wm,{value:y,onChange:b,"aria-label":"Filter queues by name or connection"}),t.jsxs("span",{className:"num whitespace-nowrap text-xs text-fg-subtle",children:[S.length," of ",k.length]})]}),q&&k.length===0?t.jsx(bm,{}):S.length===0?t.jsx("p",{className:"py-6 text-center text-xs text-fg-subtle",children:y?"No queue matches the filter":"No queues discovered yet"}):t.jsxs(t.Fragment,{children:[t.jsx(MS,{items:we.attention,hidden:we.hidden,showConnection:U,filtered:!!y,rules:Te}),U?t.jsx(ES,{sections:Ze,showConnection:!0,defaultOpen:!1}):t.jsx(O0,{sections:Ge,showConnection:!0,onHide:z})]}),t.jsx("div",{className:"card overflow-hidden",children:t.jsx(Sm,{rows:S,showConnection:!0,sort:j,onSort:C,onHide:z,message:q&&k.length===0?"Loading queues…":y?"No queue matches the filter":"No queues discovered yet"})})]})]})}function HS({connectionId:e,hidden:n,canUnhide:r,onUnhide:i,pendingQueue:o,className:c,forceOpen:d}){const[h,m]=$u(`hiddenQueues.${e}`,!1),g=h||!!d;return n.length===0?null:t.jsxs("section",{className:F("card overflow-hidden",c),"aria-label":"Hidden queues",id:"hidden-queues",children:[t.jsxs("button",{type:"button",onClick:m,"aria-expanded":g,className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-surface-2",children:[g?t.jsx(cs,{className:"size-3.5 text-fg-subtle","aria-hidden":!0}):t.jsx(Wn,{className:"size-3.5 text-fg-subtle","aria-hidden":!0}),t.jsx(_o,{className:"size-3.5 text-fg-subtle","aria-hidden":!0}),t.jsxs("h2",{className:"text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:["Hidden queues ",t.jsxs("span",{className:"num",children:["(",n.length,")"]})]}),t.jsx("span",{className:"ml-auto text-[11px] text-fg-subtle",children:"Not counted in the totals above · jobs untouched"})]}),g&&t.jsx("ul",{className:"divide-y divide-border border-t border-border",children:n.map(p=>t.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-4 py-2",children:[t.jsx(Re,{to:oe.queue(e,p.queueName),className:"font-mono text-xs font-medium hover:underline",children:p.queueName}),t.jsxs("span",{className:"text-[11px] text-fg-subtle",children:["hidden ",t.jsx(Kt,{value:p.hiddenAt,className:"text-[11px]"}),p.hiddenByName&&` by ${p.hiddenByName}`]}),r&&t.jsx(V,{size:"xs",variant:"ghost",className:"ml-auto",leftIcon:t.jsx(Ey,{}),loading:o===p.queueName,onClick:()=>i(p.queueName),title:"Put this queue back in the lists",children:"Show again"})]},p.queueName))})]})}function z0({queue:e,onClose:n,onConfirm:r,loading:i}){const[o,c]=N.useState(""),d=()=>{const h=o.trim();r(h||void 0)};return t.jsx(Sn,{open:e!==null,onClose:n,size:"sm",title:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(el,{className:"size-4 text-warning","aria-hidden":!0}),"Pause ",e]}),description:"Workers stop taking new jobs from this queue; jobs already running finish. Jobs keep arriving and wait until you resume.",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:n,disabled:i,children:"Cancel"}),t.jsx(V,{variant:"primary",size:"sm",loading:i,onClick:d,children:"Pause queue"})]}),children:t.jsx(Hi,{autoFocus:!0,label:"Reason (optional)",hint:"Recorded in the audit log next to who paused it and when.",placeholder:"e.g. payment provider degraded, holding refunds until they recover",rows:3,maxLength:500,value:o,onChange:h=>c(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&!i&&d()}})})}function KS(){var ue,se,A,H,Ie,Ae;const{connectionId:e=""}=zn(),{isOperator:n,isAdmin:r}=yt(),{has:i}=jt(),o=ds(),c=(ue=o.data)==null?void 0:ue.find(Ne=>Ne.id===e),d=Vk(e),h=Wk(e),m=e2(e),g=g0(e),p=hm(e),v=N.useRef(null),[j,C]=N.useState(!1),[y,b]=N.useState(null),k=i("folders"),S=Br(k),O=sn(),{sort:q,setSort:E,filter:T,setFilter:M}=xm(`connection.${e}`,km,Nm),$=N.useMemo(()=>{var Ne;return c?(((Ne=d.data)==null?void 0:Ne.queues)??[]).map(Le=>({connection:c,queue:Le})):[]},[c,d.data]),z=N.useMemo(()=>$.filter(Ne=>pm(Ne,T)),[$,T]),B=N.useMemo(()=>Pf(z,k?S.data:void 0),[z,k,S.data]),U=N.useMemo(()=>mm($),[$]);if(o.isSuccess&&!c)return t.jsx(vt,{children:t.jsx(nn,{icon:t.jsx(Ji,{}),title:"Connection not found",description:"It may have been removed.",action:t.jsx(Re,{to:"/",className:"text-accent hover:underline",children:"Back to overview"})})});const J=(se=d.data)==null?void 0:se.info,we=((A=d.data)==null?void 0:A.status)??(c==null?void 0:c.status),Te=n?Ne=>{if(!Ne.queue.isPaused){b(Ne);return}m.mutate({queue:Ne.queue.name,action:"resume"},{onSuccess:()=>Y.success(`${Ne.queue.name} resumed`),onError:Le=>Y.error(ye(Le))})}:void 0,Ze=Ne=>{if(!y)return;const Le=y.queue.name;m.mutate({queue:Le,action:"pause",...Ne?{reason:Ne}:{}},{onSuccess:()=>{b(null),Y.success(`${Le} paused`)},onError:st=>Y.error(ye(st))})},Ge=m.isPending&&m.variables?`${e}/${m.variables.queue}`:null,rt=n?Ne=>p.hide(Ne.queue.name):void 0,Qe=p.pendingQueue?`${e}/${p.pendingQueue}`:null,K=()=>{C(!0),requestAnimationFrame(()=>{var Ne;return(Ne=v.current)==null?void 0:Ne.scrollIntoView({behavior:"smooth",block:"center"})})};return t.jsxs(vt,{wide:!0,children:[t.jsx(hs,{title:t.jsxs("span",{className:"flex items-center gap-2",children:[(c==null?void 0:c.name)??e,t.jsx(zu,{status:we,pulse:!0,withLabel:!0})]}),description:c&&t.jsxs("span",{className:"font-mono",children:[c.url," · prefix ",t.jsx("span",{className:"text-fg",children:c.prefix}),c.cluster&&" · cluster",c.queueFilter&&` · filter ${c.queueFilter}`]}),actions:t.jsxs(t.Fragment,{children:[t.jsx(V,{size:"sm",variant:"secondary",leftIcon:t.jsx(Kf,{}),loading:h.isPending,onClick:()=>h.mutate(void 0,{onSuccess:()=>Y.success("Queue list refreshed"),onError:Ne=>Y.error(ye(Ne))}),title:"Force queue rediscovery (bypasses the 30 s cache)",children:"Rediscover"}),r&&t.jsx(V,{size:"sm",variant:"ghost",leftIcon:t.jsx($y,{}),onClick:()=>O(`${oe.settings("connections")}?edit=${encodeURIComponent(e)}`),children:"Edit"})]})}),we&&!we.ok&&t.jsxs("div",{className:"mb-4 rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger",role:"alert",children:["Redis unreachable: ",we.error??"unknown error"]}),t.jsxs("div",{className:"card mb-4 grid grid-cols-2 gap-px overflow-hidden bg-border sm:grid-cols-4 lg:grid-cols-8",children:[t.jsx(Sr,{label:"Redis",value:J==null?void 0:J.redisVersion}),t.jsx(Sr,{label:"Mode",value:J==null?void 0:J.mode}),t.jsx(Sr,{label:"Uptime",value:J?nm(J.uptimeSeconds):void 0}),t.jsx(Sr,{label:"Clients",value:J?W(J.connectedClients):void 0}),t.jsx(Sr,{label:"Memory",value:J?`${Ns(J.usedMemoryBytes)}${J.maxMemoryBytes?` / ${Ns(J.maxMemoryBytes)}`:""}`:void 0}),t.jsx(Sr,{label:"Keys",value:J?J.totalKeys!=null?W(J.totalKeys):"–":void 0}),t.jsx(Sr,{label:"Ops / s",value:J?J.opsPerSec!=null?W(J.opsPerSec):"–":void 0}),t.jsx(Sr,{label:"Latency",value:we?we.latencyMs!=null?`${we.latencyMs} ms`:"–":void 0})]}),t.jsxs("section",{className:"space-y-3","aria-label":"Queues",children:[t.jsxs($0,{totals:U,title:"Queues",hiddenCount:((H=d.data)==null?void 0:H.hiddenCount)??((Ie=g.data)==null?void 0:Ie.length)??0,onRevealHidden:K,children:[t.jsx(wm,{value:T,onChange:M,"aria-label":"Filter queues"}),t.jsxs("span",{className:"num whitespace-nowrap text-xs text-fg-subtle",children:[z.length," of ",$.length]})]}),d.isLoading?t.jsx(bm,{}):z.length>0?t.jsx(O0,{sections:B,hideSingleHeader:!0,onHide:rt,hidePendingKey:Qe}):null,t.jsx("div",{className:"card overflow-hidden",children:t.jsx(Sm,{rows:z,sort:q,onSort:E,onToggle:Te,pendingKey:Ge,onHide:rt,hidePendingKey:Qe,message:d.isLoading?t.jsx(Dt,{label:"Loading queues…"}):d.isError&&!d.data?ye(d.error):T?"No queue matches the filter":"No queues discovered. Check the prefix and queue filter, then rediscover.",messageClassName:d.isError&&!d.data?"text-danger":void 0})}),t.jsx("div",{ref:v,children:t.jsx(HS,{connectionId:e,hidden:g.data??[],canUnhide:n,onUnhide:Ne=>p.unhide(Ne),pendingQueue:p.pendingQueue,forceOpen:j})})]}),t.jsx(z0,{queue:(y==null?void 0:y.queue.name)??null,onClose:()=>b(null),onConfirm:Ze,loading:m.isPending&&((Ae=m.variables)==null?void 0:Ae.action)==="pause"})]})}function Sr({label:e,value:n}){return t.jsxs("div",{className:"bg-surface px-3 py-2",children:[t.jsx("div",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:e}),t.jsx("div",{className:"num truncate text-[13px] font-medium text-fg",children:n===void 0?t.jsx("span",{className:"skeleton inline-block h-3 w-12"}):n})]})}function A0({reason:e="Not available yet"}){return t.jsx(_e,{content:e,children:t.jsx("span",{className:"cursor-help text-fg-subtle","aria-label":e,children:"—"})})}function bi({label:e,value:n,unknownReason:r,isUnknown:i,hint:o,secondary:c,spark:d,sparkColor:h="var(--accent)",sparkTitle:m,meterPct:g,meterLabel:p,meterTone:v="ok",dimmed:j,big:C,className:y}){const b=t.jsx("span",{className:"text-[10px] font-medium tracking-wide text-fg-subtle uppercase",children:e});return t.jsxs("div",{className:F("min-w-0 rounded-md border border-border bg-bg/60 px-2.5 py-2",j&&"opacity-50",y),children:[t.jsx("div",{className:"flex items-center gap-1",children:o?t.jsx(_e,{content:o,children:t.jsx("span",{className:"cursor-help border-b border-dotted border-border-strong",children:b})}):b}),t.jsx("div",{className:F("num mt-0.5 truncate font-semibold text-fg",C?"text-xl":"text-[15px]"),children:i?t.jsx(A0,{reason:r??"Not available yet"}):n}),c&&t.jsx("div",{className:"mt-0.5 truncate text-[11px] text-fg-muted",children:c}),g!==void 0&&t.jsx(WS,{pct:g,label:p,tone:v}),d&&t.jsx(Wi,{values:d,width:C?260:112,height:C?44:22,className:"mt-1.5 w-full",stroke:h,title:m??e,dimmed:j})]})}function WS({pct:e,label:n,tone:r="ok"}){const i=r==="danger"?"bg-danger":r==="warn"?"bg-warning":"bg-accent";return t.jsxs("div",{className:"mt-1",children:[t.jsx("div",{className:"h-1 w-full overflow-hidden rounded-full bg-surface-3",children:e!=null&&t.jsx("div",{className:F("h-full rounded-full transition-[width] duration-500",i),style:{width:`${Math.max(0,Math.min(100,e))}%`}})}),n&&t.jsx("div",{className:"mt-0.5 truncate text-[10px] text-fg-subtle",children:n})]})}function ZS({warning:e}){const n=e.level==="critical",r=n?Ty:Zn;return t.jsxs("div",{role:"status",className:F("flex items-start gap-2 rounded-md border px-2.5 py-1.5 text-xs",n?"border-danger/40 bg-danger/10 text-danger":"border-warning/40 bg-warning/10 text-warning"),children:[t.jsx(r,{className:"mt-px size-3.5 shrink-0","aria-hidden":!0}),t.jsx("span",{className:"min-w-0 flex-1 leading-snug",children:e.message}),t.jsx("span",{className:"shrink-0 font-mono text-[10px] opacity-60",children:e.code})]})}function Bn({label:e,value:n,tone:r,hint:i}){const o=t.jsxs("div",{className:"flex items-baseline justify-between gap-3 border-b border-border/60 py-1 last:border-b-0",children:[t.jsx("dt",{className:"shrink-0 text-[11px] text-fg-subtle",children:e}),t.jsx("dd",{className:F("num min-w-0 truncate text-right text-[12px]",r==="danger"?"text-danger":r==="warn"?"text-warning":r==="muted"?"text-fg-muted":"text-fg"),children:n})]});return i?t.jsx(_e,{content:i,block:!0,children:o}):o}const rv="No rate yet — needs two INFO samples. Also resets when Redis restarts. This is not zero.";function GS(e,n){if(!e.info)return null;const r=Date.parse(e.info.sampledAt);return Number.isFinite(r)?Math.max(0,Math.round((n-r)/1e3)):null}function Gl(e,n){return e.map(r=>{const i=r[n];return typeof i=="number"&&Number.isFinite(i)?i:null})}function JS({health:e,big:n,paused:r}){const[i,o]=N.useState(!1),c=To(1e3),d=e.info,h=!e.ok,m=GS(e,c),g=e.history??[],p=h;return t.jsxs("section",{"aria-label":`Redis health for ${e.connectionName}`,className:F("card flex min-w-0 flex-col gap-3 p-3",h&&"border-danger/50 bg-danger/[0.04]",r&&"opacity-70"),children:[t.jsxs("header",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[t.jsx(_e,{content:h?`Unreachable: ${e.error??"unknown error"}`:"Responding to INFO",children:t.jsx("span",{className:F("status-dot",h?"bg-danger pulse text-danger":"bg-success text-success"),role:"img","aria-label":h?"unreachable":"ok"})}),t.jsx("h3",{className:"min-w-0 truncate text-sm font-semibold text-fg",children:e.connectionName}),d&&t.jsxs(t.Fragment,{children:[t.jsx(be,{variant:"outline",size:"xs",mono:!0,children:d.redisVersion}),t.jsx(be,{variant:"neutral",size:"xs",children:d.mode}),t.jsx(_e,{content:"Redis process uptime",children:t.jsxs("span",{className:"num cursor-help text-[11px] text-fg-subtle",children:["up ",nm(d.uptimeSeconds)]})})]}),t.jsx("span",{className:"ml-auto shrink-0 text-[11px] text-fg-subtle",children:r?t.jsx("span",{className:"text-warning",children:"paused"}):m==null?t.jsx(A0,{reason:"No successful sample yet"}):t.jsx(_e,{content:d?`Sampled at ${new Date(d.sampledAt).toLocaleTimeString()}`:"",children:t.jsxs("span",{className:"num cursor-help",children:["sampled ",m,"s ago"]})})})]}),h&&t.jsx("p",{className:"rounded-md border border-danger/40 bg-danger/10 px-2.5 py-1.5 font-mono text-[11px] break-words text-danger",children:e.error??"Redis is unreachable"}),e.warnings.length>0&&t.jsx("div",{className:"flex flex-col gap-1.5",children:e.warnings.filter(v=>!(h&&v.code==="unreachable")).map((v,j)=>t.jsx(ZS,{warning:v},`${v.code}-${j}`))}),t.jsxs("div",{className:F("grid gap-2",n?"sm:grid-cols-2 lg:grid-cols-3":"grid-cols-2 sm:grid-cols-3"),children:[t.jsx(bi,{label:"Memory",big:n,dimmed:p,isUnknown:!d,unknownReason:"No sample",value:d?d.usedMemoryHuman||Ns(d.usedMemoryBytes):null,hint:t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(uN,{className:"size-3","aria-hidden":!0})," used_memory"]}),meterPct:e.memoryUsedPct,meterLabel:e.memoryUsedPct!=null&&(d!=null&&d.maxMemoryBytes)?`${On(e.memoryUsedPct)} of ${Ns(d.maxMemoryBytes)}`:"no maxmemory set",meterTone:e.memoryUsedPct==null?"ok":e.memoryUsedPct>=90?"danger":e.memoryUsedPct>=75?"warn":"ok",spark:Gl(g,"memoryBytes"),sparkColor:"var(--violet)",sparkTitle:"Used memory"}),t.jsx(bi,{label:"CPU",big:n,dimmed:p,isUnknown:e.cpuCores==null,unknownReason:rv,value:Qi(e.cpuCores),secondary:e.cpuCores==null?"measuring…":t.jsx(_e,{content:Mo(e.cpuCores),children:t.jsx("span",{className:"num cursor-help border-b border-dotted border-border-strong",children:h0(e.cpuCores)})}),hint:t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(rN,{className:"size-3","aria-hidden":!0})," used_cpu_sys + used_cpu_user, per second, as a share of one core. 100% = one saturated core."]}),meterPct:e.cpuCores==null?null:e.cpuCores*100,meterLabel:e.cpuCores==null?"measuring…":e.cpuCores>1?"over 1 core":"of 1 core",meterTone:e.cpuCores==null?"ok":K2(e.cpuCores),spark:Gl(g,"cpuCores"),sparkColor:"var(--teal)",sparkTitle:"CPU (share of one core)"}),t.jsx(bi,{label:"Commands/sec",big:n,dimmed:p,isUnknown:e.commandsPerSec==null,unknownReason:rv,value:Bi(e.commandsPerSec),secondary:e.commandsPerSec==null?"measuring…":void 0,hint:t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(_N,{className:"size-3","aria-hidden":!0})," derived from total_commands_processed between samples"]}),spark:Gl(g,"commandsPerSec"),sparkColor:"var(--accent)",sparkTitle:"Commands per second"}),t.jsx(bi,{label:"Latency",big:n,dimmed:p,isUnknown:!d,unknownReason:"No sample",value:d?sm(d.latencyMs):null,hint:t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(lu,{className:"size-3","aria-hidden":!0})," round trip of the INFO command itself"]}),spark:Gl(g,"latencyMs"),sparkColor:"var(--warning)",sparkTitle:"INFO latency"}),t.jsx(bi,{label:"Clients",big:n,dimmed:p,isUnknown:!d,unknownReason:"No sample",value:d?W(d.connectedClients):null,hint:t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Gf,{className:"size-3","aria-hidden":!0})," connected_clients"]}),secondary:(d==null?void 0:d.blockedClients)!=null?t.jsx(_e,{content:"Blocked clients are normal for BullMQ: workers sit in BRPOPLPUSH waiting for the next job. A number close to your worker count is healthy, not a stall.",children:t.jsxs("span",{className:"cursor-help border-b border-dotted border-border-strong",children:[W(d.blockedClients)," blocked"]})}):void 0,spark:Gl(g,"connectedClients"),sparkColor:"var(--info)",sparkTitle:"Connected clients"}),t.jsx(bi,{label:"Keys",big:n,dimmed:p,isUnknown:!d||d.totalKeys==null,unknownReason:"Redis did not report a keyspace (empty db, or cluster)",value:d?mt(d.totalKeys):null,hint:t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(fN,{className:"size-3","aria-hidden":!0})," total keys across the keyspace"]})})]}),t.jsxs("details",{open:i,onToggle:v=>o(v.currentTarget.open),className:"rounded-md border border-border bg-bg/40",children:[t.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 px-2.5 py-1.5 text-[11px] text-fg-muted select-none hover:text-fg",children:[t.jsx(Wn,{className:F("size-3.5 transition-transform",i&&"rotate-90"),"aria-hidden":!0}),"Details"]}),t.jsxs("dl",{className:"grid gap-x-6 px-2.5 pb-2 sm:grid-cols-2 lg:grid-cols-3",children:[t.jsx(Bn,{label:"RSS",value:d?Ns(d.usedMemoryRssBytes):"—",hint:"used_memory_rss — what the OS actually holds for the Redis process"}),t.jsx(Bn,{label:"Peak memory",value:d?Ns(d.usedMemoryPeakBytes):"—",hint:"used_memory_peak"}),t.jsx(Bn,{label:"Fragmentation",value:d?Dk(d.memFragmentationRatio):"—",tone:(d==null?void 0:d.memFragmentationRatio)!=null&&d.memFragmentationRatio>1.5?"warn":void 0,hint:"mem_fragmentation_ratio — above 1.5 the allocator is wasting memory"}),t.jsx(Bn,{label:"Maxmemory policy",value:(d==null?void 0:d.maxMemoryPolicy)??"—",tone:d!=null&&d.maxMemoryPolicy&&d.maxMemoryPolicy!=="noeviction"?"warn":void 0,hint:"Anything other than noeviction can silently delete queue keys under memory pressure"}),t.jsx(Bn,{label:"Hit rate",value:(d==null?void 0:d.keyspaceHitRatePct)!=null?On(d.keyspaceHitRatePct):"—",hint:"keyspace_hits / (hits + misses), cumulative since start"}),t.jsx(Bn,{label:"Evicted keys",value:d?W(d.evictedKeys):"—",tone:(d==null?void 0:d.evictedKeys)!=null&&d.evictedKeys>0?"danger":"muted",hint:"Non-zero on a queue Redis means jobs were deleted to free memory"}),t.jsx(Bn,{label:"Expired keys",value:d?W(d.expiredKeys):"—",tone:"muted",hint:"expired_keys, cumulative"}),t.jsx(Bn,{label:"Rejected connections",value:d?W(d.rejectedConnections):"—",tone:(d==null?void 0:d.rejectedConnections)!=null&&d.rejectedConnections>0?"warn":"muted",hint:"Non-zero means maxclients was hit at some point since start"}),t.jsx(Bn,{label:"Replicas",value:(d==null?void 0:d.connectedReplicas)!=null?W(d.connectedReplicas):"—",hint:"connected_slaves"}),t.jsx(Bn,{label:"Persistence",value:(d==null?void 0:d.persistenceOk)==null?"—":d.persistenceOk?"ok":"failing",tone:(d==null?void 0:d.persistenceOk)===!1?"danger":void 0,hint:"rdb_last_bgsave_status / aof_last_write_status"}),t.jsx(Bn,{label:"Commands processed",value:d?mt(d.totalCommandsProcessed):"—",hint:"total_commands_processed, cumulative since start"}),t.jsx(Bn,{label:"History points",value:W(g.length),tone:"muted",hint:"Kept in the server's memory, not persisted"})]})]})]})}const XS="redis-health";function YS({big:e,className:n,headless:r}){const{health:i,paused:o,setPaused:c,isLoading:d,error:h}=Au(),m=dm(i);return t.jsxs("section",{id:XS,"aria-label":"Redis health",className:F("scroll-mt-16",n),children:[!r&&t.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[t.jsxs("h2",{className:"flex items-center gap-1.5 text-sm font-semibold text-fg",children:[t.jsx(So,{className:"size-4 text-fg-subtle","aria-hidden":!0}),"Redis health"]}),m.critical>0&&t.jsxs(be,{variant:"danger",size:"xs",children:[m.critical," critical"]}),m.warn>0&&t.jsxs(be,{variant:"warning",size:"xs",children:[m.warn," warning",m.warn===1?"":"s"]}),m.critical===0&&m.warn===0&&i.length>0&&!o&&t.jsx(be,{variant:"success",size:"xs",dot:!0,children:"all clear"}),t.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[!e&&t.jsxs(Re,{to:oe.health,className:"inline-flex items-center gap-1 text-[11px] text-accent hover:underline",children:["Open monitor",t.jsx(Lr,{className:"size-3","aria-hidden":!0})]}),t.jsx(av,{paused:o,onChange:c})]})]}),r&&t.jsx("div",{className:"mb-2 flex items-center justify-end",children:t.jsx(av,{paused:o,onChange:c})}),o&&t.jsxs("p",{className:"mb-2 flex items-center gap-2 rounded-md border border-warning/40 bg-warning/10 px-2.5 py-1.5 text-xs text-warning",children:[t.jsx(el,{className:"size-3.5 shrink-0","aria-hidden":!0}),"Monitoring paused. The dashboard is sending no INFO commands to Redis. Numbers below are the last frame received."]}),h!=null&&!o&&t.jsxs("p",{className:"mb-2 rounded-md border border-danger/40 bg-danger/10 px-2.5 py-1.5 text-xs text-danger",children:["Could not load health: ",ye(h)]}),d&&i.length===0?t.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fit, minmax(360px, 1fr))"},children:[0,1].map(g=>t.jsx("div",{className:"card h-64 animate-pulse"},g))}):i.length===0?t.jsx("div",{className:"card",children:t.jsx(nn,{compact:!0,icon:t.jsx(jN,{}),title:"Nothing to monitor",description:"Health shows up once a Redis connection is configured."})}):t.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:`repeat(auto-fit, minmax(${e?480:360}px, 1fr))`},children:i.map(g=>t.jsx(JS,{health:g,big:e,paused:o},g.connectionId))}),t.jsx(eC,{})]})}function av({paused:e,onChange:n}){return t.jsx(_e,{content:e?"Resume polling. One INFO per connection every 3s.":"Stop the dashboard's own Redis traffic immediately.",children:t.jsx(V,{size:"xs",variant:e?"primary":"ghost",leftIcon:e?t.jsx(Hf,{}):t.jsx(el,{}),"aria-pressed":e,onClick:()=>n(!e),children:e?"Resume monitoring":"Pause monitoring"})})}function eC(){return t.jsxs("p",{className:"mt-2 text-[11px] leading-relaxed text-fg-subtle",children:["One INFO command per connection every 3s. INFO is O(1). The server shares and rate-limits the sample, so extra browser tabs add no extra load. See"," ",t.jsx("code",{className:"font-mono text-fg-muted",children:"docs/PRODUCTION-TRIAL.md"})," before pointing this at a production Redis."]})}function tC(){const{health:e,paused:n,lastSampleAt:r}=Au();return t.jsxs(vt,{wide:!0,children:[t.jsx(hs,{title:"Redis health monitor",description:n?"Paused — the dashboard is sending nothing to Redis.":"One INFO per connection every 3 seconds, sampled on the server and shared across tabs.",actions:r!=null&&!n?t.jsxs("span",{className:"num text-[11px] text-fg-subtle",children:["last sample ",fn(r)]}):void 0}),t.jsx(YS,{big:!0,headless:!0}),t.jsxs("section",{className:"mt-6 space-y-3","aria-label":"Sample history",children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:"History"}),e.length===0?t.jsx("p",{className:"text-xs text-fg-subtle",children:"No connections to show."}):e.map(i=>t.jsx(nC,{health:i},i.connectionId))]})]})}const Lh=40;function nC({health:e}){const[n,r]=N.useState(!1),i=N.useMemo(()=>[...e.history??[]].reverse(),[e.history]),o=n?i:i.slice(0,Lh);return t.jsxs("div",{className:"card overflow-hidden",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2",children:[t.jsx("span",{className:F("status-dot",e.ok?"bg-success text-success":"bg-danger text-danger"),role:"img","aria-label":e.ok?"ok":"unreachable"}),t.jsx("h3",{className:"truncate text-[13px] font-medium text-fg",children:e.connectionName}),t.jsxs(be,{variant:"neutral",size:"xs",children:[W(i.length)," samples"]}),i.length>Lh&&t.jsx("button",{type:"button",className:"ml-auto text-[11px] text-accent hover:underline",onClick:()=>r(c=>!c),children:n?`Show latest ${Lh}`:`Show all ${i.length}`})]}),t.jsxs(os,{dense:!0,maxHeight:n?420:void 0,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{children:"Time"}),t.jsx(fe,{align:"right",children:"Latency"}),t.jsx(fe,{align:"right",children:"Memory"}),t.jsx(fe,{align:"right",children:"Commands/s"}),t.jsx(fe,{align:"right",children:"CPU"}),t.jsx(fe,{align:"right",children:"Clients"})]})}),t.jsx("tbody",{children:o.length===0?t.jsxs(xt,{colSpan:6,children:["No samples yet",e.ok?"":" — Redis is unreachable"]}):o.map(c=>t.jsxs("tr",{children:[t.jsx(me,{num:!0,mono:!0,children:fn(c.t)}),t.jsx(me,{align:"right",num:!0,children:sm(c.latencyMs)}),t.jsx(me,{align:"right",num:!0,children:Ns(c.memoryBytes)}),t.jsx(me,{align:"right",num:!0,muted:c.commandsPerSec==null,children:c.commandsPerSec==null?t.jsx(iv,{}):Bi(c.commandsPerSec,"")}),t.jsx(me,{align:"right",num:!0,muted:c.cpuCores==null,children:c.cpuCores==null?t.jsx(iv,{}):t.jsx(_e,{content:Mo(c.cpuCores),children:t.jsx("span",{className:"cursor-help",children:Qi(c.cpuCores)})})}),t.jsx(me,{align:"right",num:!0,children:W(c.connectedClients)})]},c.t))})]})]})}function iv(){return t.jsx(_e,{content:"No rate for this sample — it was the first one, or Redis had just restarted. Not zero.",children:t.jsx("span",{className:"cursor-help text-fg-subtle",children:"—"})})}function L0(e,n){const r=new Set(e);return r.has(n)?r.delete(n):r.add(n),r}function sC(e,n,r,i){const o=r?n.indexOf(r):-1,c=n.indexOf(i);if(o<0||c<0)return L0(e,i);const[d,h]=o<=c?[o,c]:[c,o],m=!e.has(i),g=new Set(e);for(const p of n.slice(d,h+1))m?g.add(p):g.delete(p);return g}function rC(e,n){const r=n.length>0&&n.every(o=>e.has(o)),i=new Set(e);for(const o of n)r?i.delete(o):i.add(o);return i}function aC(e,n){return n.reduce((r,i)=>e.has(i)?r+1:r,0)}function iC(e){const[n,r]=N.useState(()=>new Set),i=N.useRef(null),o=N.useCallback(C=>n.has(C),[n]),c=N.useCallback(C=>{i.current=C,r(y=>L0(y,C))},[]),d=N.useCallback(C=>{const y=i.current;i.current=C,r(b=>sC(b,e,y,C))},[e]),h=N.useMemo(()=>aC(n,e),[e,n]),m=e.length>0&&h===e.length,g=N.useCallback(()=>{r(C=>rC(C,e)),i.current=null},[e]),p=N.useCallback(()=>{r(new Set),i.current=null},[]),v=N.useCallback(C=>{r(y=>{const b=new Set(y);for(const k of C)b.delete(k);return b})},[]),j=N.useMemo(()=>[...n],[n]);return{selectedIds:j,visibleSelectedCount:h,offPageCount:j.length-h,allVisibleSelected:m,has:o,toggle:c,toggleRange:d,toggleAllVisible:g,clear:p,deselect:v}}function F0(e){if(e==="mixed")return["retry","promote","remove"];const n=[];return(e==="failed"||e==="completed")&&n.push("retry"),e==="delayed"&&n.push("promote"),n.push("remove"),n}const lC={retry:"Retry",promote:"Promote",remove:"Remove"};function lv({selection:e,state:n,queue:r,actions:i,onRun:o,pending:c,searching:d,className:h}){const m=e.selectedIds.length;if(m===0)return null;const g=i??F0(n);return t.jsxs("div",{role:"toolbar","aria-label":"Bulk actions",className:F("flex flex-wrap items-center gap-2 border-b border-border bg-accent/10 px-3 py-2 text-xs",h),children:[t.jsxs("span",{className:"font-medium text-fg",children:[t.jsx("span",{className:"num",children:W(m)})," selected"]}),e.offPageCount>0&&t.jsxs("span",{className:"text-fg-muted",title:"Selection is kept by job id, so it survives the 3 s refresh and paging. These jobs are still selected and the action will include them.",children:["(",t.jsx("span",{className:"num",children:W(e.offPageCount)})," not on this page)"]}),d&&t.jsx("span",{className:"text-fg-subtle",children:"· from the loaded search results, not the whole state"}),t.jsx("span",{className:"flex-1"}),g.map(p=>t.jsx(V,{size:"sm",variant:p==="remove"?"danger":p==="retry"?"primary":"secondary",leftIcon:p==="retry"?t.jsx(Tu,{}):p==="promote"?t.jsx(Uf,{}):t.jsx(us,{}),loading:c===p,disabled:!!c,onClick:()=>o(p),children:lC[p]},p)),t.jsx(V,{size:"sm",variant:"ghost",leftIcon:t.jsx(mn,{}),onClick:e.clear,disabled:!!c,children:"Clear"})]})}function ov({result:e,onDismiss:n}){const[r,i]=N.useState(!1),o=e.action==="retry"?"retried":e.action==="promote"?"promoted":"removed",c=e.failed.length;return t.jsxs("div",{className:F("border-b border-border px-3 py-2 text-xs",c>0?"bg-warning/10":"bg-state-completed/10"),role:"status",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:"text-fg",children:[t.jsx("span",{className:"num font-semibold",children:W(e.ok.length)})," ",o,c>0&&t.jsxs(t.Fragment,{children:[" · ",t.jsx("span",{className:"num font-semibold text-warning",children:W(c)})," failed"]})]}),c>0&&t.jsxs("button",{type:"button",className:"inline-flex items-center gap-0.5 text-fg-muted hover:text-fg",onClick:()=>i(d=>!d),"aria-expanded":r,children:[r?t.jsx(cs,{className:"size-3"}):t.jsx(Wn,{className:"size-3"}),r?"hide reasons":"why?"]}),t.jsx("span",{className:"flex-1"}),t.jsx("button",{type:"button",className:"rounded p-0.5 text-fg-subtle hover:text-fg","aria-label":"Dismiss",onClick:n,children:t.jsx(mn,{className:"size-3.5"})})]}),r&&c>0&&t.jsx("ul",{className:"mt-1.5 max-h-40 space-y-0.5 overflow-auto font-mono text-[11px] text-fg-muted",children:e.failed.map(d=>t.jsxs("li",{children:[t.jsx("span",{className:"text-fg",children:d.jobId})," — ",d.reason]},d.jobId))})]})}function Cm({items:e,value:n,onChange:r,className:i,size:o="md",variant:c="underline",...d}){const h=N.useRef(null),m=g=>{var y;if(!["ArrowLeft","ArrowRight","Home","End"].includes(g.key))return;g.preventDefault();const p=e.filter(b=>!b.disabled),v=p.findIndex(b=>b.value===n);let j=v;g.key==="ArrowRight"&&(j=(v+1)%p.length),g.key==="ArrowLeft"&&(j=(v-1+p.length)%p.length),g.key==="Home"&&(j=0),g.key==="End"&&(j=p.length-1);const C=p[j];if(C){r(C.value,C);const b=(y=h.current)==null?void 0:y.querySelector(`[data-value="${C.value}"]`);b==null||b.focus()}};return t.jsx("div",{ref:h,role:"tablist","aria-label":d["aria-label"],onKeyDown:m,className:F("flex min-w-0 items-end gap-0.5 overflow-x-auto",c==="underline"&&"border-b border-border",c==="pills"&&"rounded-md bg-surface-2 p-0.5",i),children:e.map(g=>{const p=g.value===n;return t.jsxs("button",{role:"tab",type:"button","data-value":g.value,"aria-selected":p,tabIndex:p?0:-1,disabled:g.disabled,onClick:()=>r(g.value,g),className:F("relative inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap font-medium transition-colors outline-none focus-visible:ring-2 focus-visible:ring-accent/60 disabled:opacity-40",o==="sm"?"h-7 px-2 text-xs":"h-8 px-2.5 text-[13px]",c==="underline"&&F("-mb-px rounded-t border-b-2",p?"border-accent text-fg":"border-transparent text-fg-muted hover:border-border-strong hover:text-fg"),c==="pills"&&F("rounded",p?"bg-surface text-fg shadow-sm":"text-fg-muted hover:text-fg")),children:[g.tone&&t.jsx("span",{className:F("status-dot",g.tone),"aria-hidden":!0}),g.icon,g.label,g.count!=null&&t.jsx("span",{className:F("num rounded px-1 py-px text-[11px] leading-none",p?"bg-surface-3 text-fg":"bg-surface-2 text-fg-subtle"),children:mt(g.count)}),g.locked&&t.jsx(ro,{className:"size-3 text-pro","aria-label":"Pro feature"})]},g.value)})})}function Ef({connectionId:e,queue:n,jobs:r,loading:i,error:o,emptyText:c="No jobs in this state",canOperate:d,onAction:h,pendingId:m,showState:g=!0,showGroup:p,onGroupClick:v,highlight:j,compact:C,selection:y}){const b=sn(),k=8+(g?1:0)+(p?1:0)+(y?1:0),S=(r==null?void 0:r.length)??0,O=S>0&&r.every(q=>q.state==="delayed");return t.jsxs(os,{dense:C,className:"min-w-[960px]",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[y&&t.jsx(fe,{className:"w-8",children:t.jsx("input",{type:"checkbox",className:"size-3.5 cursor-pointer align-middle accent-[var(--accent)]","aria-label":y.allVisibleSelected?"Clear selection on this page":"Select every job on this page",title:y.allVisibleSelected?"Clear this page":"Select this page",checked:y.allVisibleSelected,ref:q=>{q&&(q.indeterminate=!y.allVisibleSelected&&y.visibleSelectedCount>0)},disabled:S===0,onChange:y.toggleAllVisible})}),t.jsx(fe,{className:"w-28",children:"ID"}),t.jsx(fe,{children:t.jsx("span",{className:"cursor-help border-b border-dotted border-border-strong",title:'The job name — the first argument of queue.add("name", data). It is the job type / handler, not the queue name.',children:"Name"})}),g&&t.jsx(fe,{children:"State"}),p&&t.jsx(fe,{children:"Group"}),t.jsx(fe,{className:"w-24",children:"Attempts"}),t.jsx(fe,{className:"w-28",children:"Created"}),t.jsx(fe,{className:"w-28",children:O?"Runs at":"Finished"}),t.jsx(fe,{className:"w-24",align:"right",children:"Duration"}),t.jsx(fe,{children:"Data"}),t.jsx(fe,{className:"w-28",align:"right",children:t.jsx("span",{className:"sr-only",children:"Actions"})})]})}),t.jsxs("tbody",{children:[!!o&&!r&&t.jsx(xt,{colSpan:k,className:"text-danger",children:"Could not load jobs"}),i&&!r&&t.jsx(xt,{colSpan:k,children:t.jsx(Dt,{label:"Loading jobs…"})}),r&&r.length===0&&t.jsx(xt,{colSpan:k,children:c}),r==null?void 0:r.map(q=>t.jsx(oC,{job:q,connectionId:e,queue:n,canOperate:d,onAction:h,pending:m===q.id,showState:g,showGroup:!!p,onGroupClick:v,highlight:j,selection:y,onOpen:()=>b(oe.job(e,n,q.id))},q.id))]})]})}function oC({job:e,connectionId:n,queue:r,canOperate:i,onAction:o,pending:c,showState:d,showGroup:h,onGroupClick:m,highlight:g,selection:p,onOpen:v}){const j=e.processedOn&&e.finishedOn?e.finishedOn-e.processedOn:null,C=e.processedOn?e.processedOn-e.timestamp:null,y=e.state==="failed"||e.state==="completed",b=e.state==="delayed",k=(p==null?void 0:p.has(e.id))??!1;return t.jsxs(rl,{onActivate:v,selected:k,className:F(c&&"opacity-50"),children:[p&&t.jsx(me,{"data-no-row-click":!0,children:t.jsx("input",{type:"checkbox",className:"size-3.5 cursor-pointer align-middle accent-[var(--accent)]","aria-label":`Select job ${e.id}`,checked:k,onChange:()=>{},onClick:S=>{S.stopPropagation(),S.shiftKey?p.toggleRange(e.id):p.toggle(e.id)}})}),t.jsx(me,{mono:!0,children:t.jsx(Re,{to:oe.job(n,r,e.id),className:"text-accent hover:underline",title:e.id,children:e.id.length>14?`${e.id.slice(0,12)}…`:e.id})}),t.jsx(me,{children:t.jsx("span",{className:"block max-w-56 truncate font-medium",title:e.name,children:t.jsx(ua,{text:e.name,needle:g})})}),d&&t.jsx(me,{children:t.jsx(T0,{state:e.state,size:"xs"})}),h&&t.jsx(me,{mono:!0,muted:!0,"data-no-row-click":!0,children:e.groupId?m?t.jsx("button",{type:"button",className:"max-w-40 truncate rounded px-1 text-left text-pro hover:bg-pro/10 hover:underline",title:`Show only group ${e.groupId}`,onClick:()=>m(e.groupId),children:e.groupId}):t.jsx(Re,{to:oe.group(n,r,e.groupId),className:"text-pro hover:underline",title:"Open group",children:e.groupId}):"–"}),t.jsxs(me,{num:!0,children:[t.jsxs("span",{className:F(e.attemptsMade>1&&"text-warning"),children:[e.attemptsMade,e.attempts!=null&&t.jsxs("span",{className:"text-fg-subtle",children:[" / ",e.attempts]})]}),e.stalledCounter>0&&t.jsxs(be,{variant:"warning",size:"xs",className:"ml-1.5 gap-0.5",title:`Stalled ${e.stalledCounter} time${e.stalledCounter===1?"":"s"}: the worker lost the lock (it died or blocked) and BullMQ recovered the job. Not a state — the job went back to waiting.`,children:[t.jsx(Zf,{className:"size-2.5","aria-hidden":!0}),e.stalledCounter]}),e.priority>0&&t.jsxs(be,{variant:"violet",size:"xs",className:"ml-1.5",title:"priority",children:["p",e.priority]})]}),t.jsx(me,{muted:!0,children:t.jsx(Kt,{value:e.timestamp})}),t.jsx(me,{muted:!0,children:e.state==="delayed"&&e.delayedUntil?t.jsx(_e,{content:t.jsxs(t.Fragment,{children:["runs at ",fn(e.delayedUntil)]}),side:"left",children:t.jsx("span",{className:"text-state-delayed",children:t.jsx(Kt,{value:e.delayedUntil})})}):t.jsx(Kt,{value:e.finishedOn,emptyText:e.processedOn?"running…":"–"})}),t.jsx(me,{num:!0,align:"right",muted:!0,children:t.jsx(_e,{content:t.jsxs(t.Fragment,{children:[C!=null&&t.jsxs(t.Fragment,{children:["wait ",qn(C)," · "]}),e.processedOn&&t.jsxs(t.Fragment,{children:["started ",fn(e.processedOn)]})]}),side:"left",children:t.jsx("span",{children:j!=null?qn(j):e.processedOn?qn(Date.now()-e.processedOn):"–"})})}),t.jsx(me,{className:"max-w-md",children:t.jsx(cC,{job:e,highlight:g})}),t.jsx(me,{align:"right","data-no-row-click":!0,children:t.jsxs("div",{className:"flex items-center justify-end gap-0.5",children:[i&&o&&y&&t.jsx(V,{size:"icon-xs",variant:"ghost",title:"Retry","aria-label":"Retry job",onClick:()=>o(e.id,"retry",e),children:t.jsx(Tu,{})}),i&&o&&b&&t.jsx(V,{size:"icon-xs",variant:"ghost",title:"Promote","aria-label":"Promote job",onClick:()=>o(e.id,"promote",e),children:t.jsx(Uf,{})}),i&&o&&t.jsx(V,{size:"icon-xs",variant:"ghost",title:"Remove","aria-label":"Remove job",className:"hover:text-danger",onClick:()=>o(e.id,"remove",e),children:t.jsx(us,{})}),t.jsx(V,{size:"icon-xs",variant:"ghost",title:"Open","aria-label":"Open job",onClick:v,children:t.jsx(Lr,{})})]})})]})}function ua({text:e,needle:n}){const r=n==null?void 0:n.trim();if(!r||!e)return e;const i=e.toLowerCase(),o=r.toLowerCase(),c=[];let d=0,h=i.indexOf(o,d),m=0;for(;h>=0&&m++<200;)h>d&&c.push(e.slice(d,h)),c.push(t.jsx("mark",{children:e.slice(h,h+r.length)},h)),d=h+r.length,h=i.indexOf(o,d);return d<e.length&&c.push(e.slice(d)),t.jsx(t.Fragment,{children:c})}function cC({job:e,highlight:n}){const[r,i]=N.useState(!1),o=e.dataPreview??"";if(!o&&e.dataTruncated&&e.dataBytes)return t.jsxs("span",{className:"font-mono text-xs text-fg-subtle",title:"Payloads this large are not previewed in lists so a page never moves megabytes through Redis. Open the job to see it.",children:["payload ",Ns(e.dataBytes)," · open the job",e.failedReason&&t.jsx("span",{className:"block truncate font-sans text-danger",title:e.failedReason,children:t.jsx(ua,{text:e.failedReason,needle:n})})]});if(e.failedReason&&!r)return t.jsxs("div",{className:"flex flex-col gap-0.5","data-no-row-click":!0,children:[t.jsx("button",{type:"button",className:"truncate text-left font-mono text-xs text-fg-muted hover:text-fg",onClick:()=>i(!0),title:"Expand",children:o?t.jsx(ua,{text:o,needle:n}):t.jsx("span",{className:"text-fg-subtle",children:"{}"})}),t.jsx("span",{className:"truncate text-xs text-danger",title:e.failedReason,children:t.jsx(ua,{text:e.failedReason,needle:n})})]});if(!r)return t.jsx("button",{type:"button","data-no-row-click":!0,className:"block w-full truncate text-left font-mono text-xs text-fg-muted hover:text-fg",onClick:()=>i(!0),title:"Expand",children:o?t.jsx(ua,{text:o,needle:n}):t.jsx("span",{className:"text-fg-subtle",children:"{}"})});const c=e.dataTruncated?null:Fk(o);return t.jsxs("div",{"data-no-row-click":!0,className:"py-1",children:[t.jsxs("pre",{className:"max-h-64 overflow-auto rounded border border-border bg-bg p-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-all text-fg",children:[t.jsx(ua,{text:c??o,needle:n}),e.dataTruncated&&t.jsx("span",{className:"text-fg-subtle",children:" … (truncated, open the job for the full payload)"})]}),e.failedReason&&t.jsx("p",{className:"mt-1 text-xs break-words text-danger",children:t.jsx(ua,{text:e.failedReason,needle:n})}),t.jsx("button",{type:"button",className:"mt-1 text-[11px] text-fg-subtle hover:text-fg",onClick:()=>i(!1),children:"collapse"})]})}const uC=[25,50,100,200];function Uu({page:e,pageSize:n,total:r,onPage:i,onPageSize:o,count:c,className:d}){const h=Math.max(1,Math.ceil(r/n)),m=r===0?0:(e-1)*n+1,g=c!=null?m+Math.max(0,c-1):Math.min(r,e*n);return t.jsxs("div",{className:`flex flex-wrap items-center justify-between gap-3 text-xs text-fg-muted ${d??""}`,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"num",children:r===0?"0 items":`${W(m)}–${W(g)} of ${W(r)}`}),o&&t.jsxs("label",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"sr-only",children:"Page size"}),t.jsx(ut,{"aria-label":"Page size",className:"!h-7 !w-auto !py-0 text-xs",value:String(n),onChange:p=>o(Number(p.target.value)),options:uC.map(p=>({value:String(p),label:`${p} / page`}))})]})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(V,{size:"icon-sm",variant:"ghost","aria-label":"First page",disabled:e<=1,onClick:()=>i(1),children:t.jsx(eN,{})}),t.jsx(V,{size:"icon-sm",variant:"ghost","aria-label":"Previous page",disabled:e<=1,onClick:()=>i(e-1),children:t.jsx(iu,{})}),t.jsxs("span",{className:"num min-w-16 text-center",children:[e," / ",h]}),t.jsx(V,{size:"icon-sm",variant:"ghost","aria-label":"Next page",disabled:e>=h,onClick:()=>i(e+1),children:t.jsx(Wn,{})}),t.jsx(V,{size:"icon-sm",variant:"ghost","aria-label":"Last page",disabled:e>=h,onClick:()=>i(h),children:t.jsx(tN,{})})]})]})}function tn({open:e,onClose:n,onConfirm:r,title:i,description:o,confirmText:c="Confirm",danger:d,typeToConfirm:h,loading:m,children:g}){const[p,v]=N.useState(""),j=!h||p===h;return t.jsxs(Sn,{open:e,onClose:n,size:"sm",title:t.jsxs("span",{className:"flex items-center gap-2",children:[d&&t.jsx(Zn,{className:"size-4 text-danger","aria-hidden":!0}),i]}),description:o,footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:n,disabled:m,children:"Cancel"}),t.jsx(V,{variant:d?"danger":"primary",size:"sm",disabled:!j,loading:m,onClick:async()=>{await r(),v("")},children:c})]}),children:[g,h&&t.jsx(Me,{autoFocus:!0,mono:!0,label:t.jsxs(t.Fragment,{children:["Type ",t.jsx("span",{className:"font-mono text-fg",children:h})," to confirm"]}),value:p,onChange:C=>v(C.target.value),onKeyDown:C=>{C.key==="Enter"&&j&&!m&&r()},autoComplete:"off",spellCheck:!1})]})}async function dC(e){try{return await navigator.clipboard.writeText(e),!0}catch{try{const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select();const r=document.execCommand("copy");return document.body.removeChild(n),r}catch{return!1}}}function fo({value:e,label:n="Copy",copiedLabel:r="Copied",showLabel:i,icon:o,variant:c="ghost",size:d,...h}){const[m,g]=N.useState(!1);return N.useEffect(()=>{if(!m)return;const p=setTimeout(()=>g(!1),1500);return()=>clearTimeout(p)},[m]),t.jsxs(V,{variant:c,size:d??(i?"sm":"icon-sm"),"aria-label":m?r:n,title:m?r:n,onClick:async()=>{await dC(typeof e=="function"?e():e)&&g(!0)},...h,children:[m?t.jsx(Qr,{className:"text-success"}):o??t.jsx(Py,{}),i&&(m?r:n)]})}function _m({code:e,language:n,className:r,maxHeight:i=480,copy:o=!0,wrap:c,header:d,tone:h="default"}){return t.jsxs("div",{className:F("card relative overflow-hidden",h==="danger"&&"border-danger/40",r),children:[(d||n||o)&&t.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border bg-surface-2/60 pr-1 pl-3",children:[t.jsx("span",{className:"text-[11px] tracking-wide text-fg-subtle uppercase",children:d??n}),o&&t.jsx(fo,{value:e,size:"icon-xs"})]}),t.jsx("pre",{className:F("overflow-auto p-3 font-mono text-xs leading-relaxed text-fg",c?"break-words whitespace-pre-wrap":"whitespace-pre",h==="danger"&&"text-danger"),style:{maxHeight:i},children:t.jsx("code",{children:e})})]})}const D0="new Worker(name, fn, { metrics: { maxDataPoints: MetricsTime.ONE_WEEK } })";function U0(e){return e.isLoading?"loading":e.isError||!e.data?"unknown":e.data.metricsEnabled?"on":"off"}function hC({connectionId:e,queueName:n}){const r=rm(e||void 0,n||void 0,{enabled:!!e&&!!n}),i=U0(r);return i==="loading"||i==="on"?null:t.jsx(Q0,{title:i==="off"?`Queue "${n}" does not collect BullMQ metrics — this alert will stay inert`:`Could not read the setup of "${n}", so it is unknown whether it collects metrics`})}function fC({folder:e}){const[n,r]=N.useState({}),i=(e==null?void 0:e.queues)??[],o=p=>`${p.connectionId}/${p.queueName}`;N.useEffect(()=>r({}),[e==null?void 0:e.id]);const c=N.useCallback((p,v)=>{r(j=>j[p]===v?j:{...j,[p]:v})},[]);if(!e||i.length===0)return null;const d=i.filter(p=>n[o(p)]==="off").map(p=>p.queueName),h=i.filter(p=>n[o(p)]==="unknown").map(p=>p.queueName),m=i.map(p=>t.jsx(mC,{id:o(p),queue:p,onState:c},o(p)));if(d.length===0&&h.length===0)return t.jsx(t.Fragment,{children:m});const g=[d.length>0?`${d.length} of ${i.length} queue(s) collect no metrics: ${d.join(", ")}`:null,h.length>0?`could not read: ${h.join(", ")}`:null].filter(Boolean);return t.jsxs(t.Fragment,{children:[m,t.jsx(Q0,{title:`Folder "${e.name}" — ${g.join(" · ")}`})]})}function mC({id:e,queue:n,onState:r}){const i=rm(n.connectionId,n.queueName),o=U0(i);return N.useEffect(()=>r(e,o),[e,o,r]),null}function Q0({title:e}){return t.jsxs("div",{className:"space-y-2 rounded-md border border-warning/40 bg-warning/10 p-3",role:"status",children:[t.jsxs("p",{className:"flex items-start gap-2 text-xs text-fg",children:[t.jsx(Zn,{className:"mt-px size-4 shrink-0 text-warning"}),t.jsx("span",{children:e})]}),t.jsxs("p",{className:"text-xs text-fg-muted",children:["Failure alerts are measured only from BullMQ's own metrics counters — the completed/failed sorted sets lie as soon as"," ",t.jsx("code",{className:"font-mono",children:"removeOnComplete"})," prunes them. Turn metrics on in the worker and the alert starts measuring by itself:"]}),t.jsx(_m,{code:D0,language:"ts",wrap:!0,maxHeight:80})]})}function pC({measurement:e}){var r;if(!e)return t.jsx(_e,{content:"Not evaluated yet — the server evaluates alerts every few seconds.",children:t.jsx(be,{variant:"neutral",children:"pending"})});if(e.state==="no_metrics")return t.jsx(_e,{content:`This queue collects no BullMQ metrics, so the alert cannot measure and will not fire. Enable it with ${D0}`,children:t.jsxs(be,{variant:"warning",dot:!0,children:[t.jsx(Zn,{className:"size-3"})," can't measure"]})});if(e.state==="warming_up")return t.jsx(_e,{content:"Redis could not be read on the last evaluation, so the rule kept its previous state. It measures again on the next tick.",children:t.jsxs(be,{variant:"info",dot:!0,children:[t.jsx(_y,{className:"size-3"})," waiting for data"]})});const n=((r=e.queuesWithoutMetrics)==null?void 0:r.length)??0;return n>0?t.jsx(_e,{content:`Measuring, but ${n} queue(s) it covers collect no metrics and are invisible to this rule: ${(e.queuesWithoutMetrics??[]).slice(0,10).join(", ")}${n>10?` and ${n-10} more`:""}`,children:t.jsx(be,{variant:"warning",dot:!0,children:"partial"})}):t.jsx(_e,{content:e.source==="metrics"?"Measured from BullMQ metrics counters.":"Measured from live queue counts.",children:t.jsx(be,{variant:"success",dot:!0,children:"ok"})})}const xC={waiting_above:"Waiting jobs above threshold (incl. prioritized, excl. paused)",failed_above:"Failures above threshold in a window (needs worker metrics)",failed_rate_above:"Failure rate above percent (needs worker metrics)",duration_above:"Processing time above (p50 / p95 of completed jobs)"};function gC(e,n){return{name:"",enabled:!0,scopeType:(n==null?void 0:n.type)??"queue",connectionId:(n==null?void 0:n.type)==="queue"||(n==null?void 0:n.type)==="connection"?n.connectionId:e,queueName:(n==null?void 0:n.type)==="queue"?n.queueName:"",folderId:(n==null?void 0:n.type)==="folder"?n.folderId:"",kind:"failed_above",threshold:"10",windowMinutes:"5",percent:"5",minSample:"20",seconds:"30",percentile:"95",cooldownMinutes:"30",channels:[]}}function vC(e){const n=e.condition;return{name:e.name,enabled:e.enabled,scopeType:e.scope.type,connectionId:e.scope.type==="queue"||e.scope.type==="connection"?e.scope.connectionId:"",queueName:e.scope.type==="queue"?e.scope.queueName:"",folderId:e.scope.type==="folder"?e.scope.folderId:"",kind:n.kind,threshold:"threshold"in n?String(n.threshold):"10",windowMinutes:"windowMinutes"in n?String(n.windowMinutes):"5",percent:"percent"in n?String(n.percent):"5",minSample:"minSample"in n?String(n.minSample):"20",seconds:n.kind==="duration_above"?String(n.seconds):"30",percentile:n.kind==="duration_above"?String(n.percentile):"95",cooldownMinutes:String(e.cooldownMinutes),channels:e.channels.map(r=>r.type==="slack"?{type:"slack",url:r.webhookUrl,headersText:""}:{type:"webhook",url:r.url,headersText:Object.entries(r.headers??{}).map(([i,o])=>`${i}: ${o}`).join(`
|
|
526
|
+
`)})}}function yC(e){const n={};for(const r of e.split(`
|
|
527
|
+
`)){const i=r.trim();if(!i)continue;const o=i.indexOf(":");if(o<=0)throw new Error(`Header line "${i}" must look like "Name: value"`);n[i.slice(0,o).trim()]=i.slice(o+1).trim()}return Object.keys(n).length?n:void 0}function jC(e){const n=c=>c.trim()===""?NaN:Number(c);let r;switch(e.kind){case"waiting_above":r={kind:"waiting_above",threshold:n(e.threshold)};break;case"failed_above":r={kind:"failed_above",threshold:n(e.threshold),windowMinutes:n(e.windowMinutes)};break;case"duration_above":r={kind:"duration_above",seconds:n(e.seconds),percentile:e.percentile==="50"?50:95,windowMinutes:n(e.windowMinutes),minSample:n(e.minSample)};break;default:r={kind:"failed_rate_above",percent:n(e.percent),windowMinutes:n(e.windowMinutes),minSample:n(e.minSample)};break}const i=e.scopeType==="folder"?{type:"folder",folderId:e.folderId}:e.scopeType==="global"?{type:"global"}:e.scopeType==="connection"?{type:"connection",connectionId:e.connectionId}:{type:"queue",connectionId:e.connectionId,queueName:e.queueName},o=e.channels.map(c=>c.type==="slack"?{type:"slack",webhookUrl:c.url.trim()}:{type:"webhook",url:c.url.trim(),headers:yC(c.headersText)});return{name:e.name.trim(),enabled:e.enabled,scope:i,condition:r,channels:o,cooldownMinutes:n(e.cooldownMinutes)}}function Qu({open:e,onClose:n,alert:r,initialScope:i}){var O,q,E,T;const o=ds(),c=x2(),d=b0(),h=((q=(O=o.data)==null?void 0:O[0])==null?void 0:q.id)??"",[m,g]=N.useState(()=>r?vC(r):gC(h,i)),[p,v]=N.useState({}),j=Kk(m.connectionId||void 0,{enabled:m.scopeType==="queue"}),C=Br(),y=(M,$)=>g(z=>({...z,[M]:$})),b=(M,$)=>g(z=>({...z,channels:z.channels.map((B,U)=>U===M?{...B,...$}:B)})),k=c.isPending||d.isPending,S=()=>{let M;try{M=jC(m)}catch(B){v({channels:B.message});return}const $=n0.safeParse(M);if(!$.success){const B={};for(const U of $.error.issues){const J=U.path[0]==="condition"||U.path[0]==="scope"?String(U.path[1]??U.path[0]):U.path[0]==="channels"?"channels":String(U.path[0]);B[J]=U.path[0]==="channels"?`Channel ${Number(U.path[1])+1}: ${U.message}`:U.message}v(B);return}v({});const z=()=>{Y.success(r?"Alert updated":"Alert created"),n()};r?d.mutate({id:r.id,input:$.data},{onSuccess:z,onError:B=>Y.error(ye(B))}):c.mutate($.data,{onSuccess:z,onError:B=>Y.error(ye(B))})};return t.jsx(Sn,{open:e,onClose:n,size:"lg",title:r?"Edit rule":"New rule",description:"Evaluated on the server every few seconds. Every queue that breaks it shows up in Needs attention; add channels to be notified too.",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),t.jsx(V,{variant:"primary",size:"sm",onClick:S,loading:k,children:r?"Save changes":"Create rule"})]}),children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto]",children:[t.jsx(Me,{label:"Name",value:m.name,onChange:M=>y("name",M.target.value),error:p.name,autoFocus:!0,placeholder:"payments: failures spiking"}),t.jsx(Lu,{label:"Enabled",className:"justify-end",children:t.jsx(fm,{checked:m.enabled,onChange:M=>y("enabled",M.target.checked),label:m.enabled?"On":"Off",className:"h-8 items-center"})})]}),t.jsxs("fieldset",{className:"grid gap-3 rounded-md border border-border p-3 sm:grid-cols-3",children:[t.jsx("legend",{className:"px-1 text-[11px] font-semibold tracking-wider text-fg-subtle uppercase",children:"Scope"}),t.jsx(ut,{label:"Watch",value:m.scopeType,onChange:M=>y("scopeType",M.target.value),options:[{value:"global",label:"Every queue"},{value:"connection",label:"Every queue on a connection"},{value:"folder",label:"Every queue in a folder"},{value:"queue",label:"One queue"}]}),m.scopeType==="global"?t.jsx("p",{className:"self-end pb-2 text-xs text-fg-muted sm:col-span-2",children:"Every discovered queue on every connection, except hidden ones."}):m.scopeType==="connection"?t.jsx(ut,{label:"Connection",value:m.connectionId,onChange:M=>y("connectionId",M.target.value),error:p.connectionId,wrapperClassName:"sm:col-span-2",options:(o.data??[]).map(M=>({value:M.id,label:M.name}))}):m.scopeType==="queue"?t.jsxs(t.Fragment,{children:[t.jsx(ut,{label:"Connection",value:m.connectionId,onChange:M=>g($=>({...$,connectionId:M.target.value,queueName:""})),error:p.connectionId,options:(o.data??[]).map(M=>({value:M.id,label:M.name}))}),t.jsx(ut,{label:"Queue",value:m.queueName,onChange:M=>y("queueName",M.target.value),error:p.queueName,options:[{value:"",label:j.isLoading?"Loading…":"Pick a queue",disabled:!0},...(j.data??[]).map(M=>({value:M.name,label:M.name}))]})]}):t.jsx(ut,{label:"Folder",value:m.folderId,onChange:M=>y("folderId",M.target.value),error:p.folderId,wrapperClassName:"sm:col-span-2",options:[{value:"",label:C.isLoading?"Loading…":(E=C.data)!=null&&E.length?"Pick a folder":"No folders yet",disabled:!0},...(C.data??[]).map(M=>{var $,z;return{value:M.id,label:M.parentId?`${((z=($=C.data)==null?void 0:$.find(B=>B.id===M.parentId))==null?void 0:z.name)??"?"} / ${M.name}`:M.name}})]}),t.jsx("p",{className:"text-[11px] text-fg-subtle sm:col-span-3",children:m.scopeType==="queue"?"A rule on one queue replaces wider rules of the same kind for that queue.":"Wide rules flag each queue that breaks them and notify once, naming the worst. The most specific rule of each kind wins: a queue or folder rule overrides this one for its queues."})]}),t.jsxs("fieldset",{className:"grid gap-3 rounded-md border border-border p-3",children:[t.jsx("legend",{className:"px-1 text-[11px] font-semibold tracking-wider text-fg-subtle uppercase",children:"Condition"}),t.jsx(ut,{label:"Kind",value:m.kind,onChange:M=>y("kind",M.target.value),options:pk.map(M=>({value:M,label:xC[M]}))}),t.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[(m.kind==="waiting_above"||m.kind==="failed_above")&&t.jsx(Me,{label:m.kind==="waiting_above"?"Waiting jobs above":"Failures above",type:"number",min:1,value:m.threshold,onChange:M=>y("threshold",M.target.value),error:p.threshold}),m.kind==="failed_rate_above"&&t.jsx(Me,{label:"Failure rate above (%)",type:"number",min:.1,max:100,step:.1,value:m.percent,onChange:M=>y("percent",M.target.value),error:p.percent}),m.kind==="duration_above"&&t.jsxs(t.Fragment,{children:[t.jsx(Me,{label:"Slower than (seconds)",type:"number",min:.001,step:.1,value:m.seconds,onChange:M=>y("seconds",M.target.value),error:p.seconds}),t.jsx(ut,{label:"Percentile",value:m.percentile,onChange:M=>y("percentile",M.target.value),options:[{value:"95",label:"p95 (the slow tail)"},{value:"50",label:"p50 (the typical job)"}]})]}),m.kind!=="waiting_above"&&t.jsx(Me,{label:"Window (minutes)",type:"number",min:1,max:1440,value:m.windowMinutes,onChange:M=>y("windowMinutes",M.target.value),error:p.windowMinutes}),(m.kind==="failed_rate_above"||m.kind==="duration_above")&&t.jsx(Me,{label:m.kind==="duration_above"?"Min sample (completed jobs)":"Min sample (finished jobs)",type:"number",min:1,max:m.kind==="duration_above"?100:void 0,value:m.minSample,onChange:M=>y("minSample",M.target.value),error:p.minSample,hint:"Ignore windows with fewer jobs."})]}),m.kind==="duration_above"&&t.jsxs("p",{className:"text-xs text-fg-muted",children:["Time from a job starting its final attempt to completing, over the newest 100 completed jobs in the window. BullMQ metrics count jobs but do not time them, so this reads completed jobs still in Redis: with"," ",t.jsx("code",{className:"font-mono",children:"removeOnComplete: true"})," there is nothing to read and the rule never fires;"," ",t.jsx("code",{className:"font-mono",children:"{ count: N }"})," keeps exactly the recent jobs it needs."]}),gk(m.kind)&&t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"text-xs text-fg-muted",children:["Measured from BullMQ's own per-minute metrics, so the number is right even when"," ",t.jsx("code",{className:"font-mono",children:"removeOnComplete"})," prunes the queue, and exact from the first evaluation — a restart does not reset the window."]}),m.scopeType==="queue"?m.connectionId&&m.queueName&&t.jsx(hC,{connectionId:m.connectionId,queueName:m.queueName}):m.scopeType==="folder"?m.folderId&&t.jsx(fC,{folder:(T=C.data)==null?void 0:T.find(M=>M.id===m.folderId)}):null]})]}),t.jsxs("fieldset",{className:"space-y-3 rounded-md border border-border p-3",children:[t.jsx("legend",{className:"px-1 text-[11px] font-semibold tracking-wider text-fg-subtle uppercase",children:"Notify"}),m.channels.length===0&&t.jsxs("p",{className:"text-xs text-fg-muted",children:["Dashboard only: breaking queues show up in ",t.jsx("span",{className:"text-fg",children:"Needs attention"})," and the rule keeps its fired/resolved history, but nobody is notified. Add a channel to be told."]}),m.channels.map((M,$)=>t.jsxs("div",{className:"grid gap-2 rounded-md bg-surface-2/50 p-2 sm:grid-cols-[130px_1fr_auto]",children:[t.jsx(ut,{"aria-label":"Channel type",value:M.type,onChange:z=>b($,{type:z.target.value}),options:[{value:"slack",label:"Slack webhook"},{value:"webhook",label:"Webhook (POST)"}]}),t.jsx(Me,{"aria-label":"URL",mono:!0,placeholder:M.type==="slack"?"https://hooks.slack.com/services/…":"https://example.com/hooks/bullmq",value:M.url,onChange:z=>b($,{url:z.target.value})}),t.jsx(V,{size:"icon",variant:"ghost","aria-label":"Remove channel",className:"hover:text-danger",onClick:()=>g(z=>({...z,channels:z.channels.filter((B,U)=>U!==$)})),children:t.jsx(us,{})}),M.type==="webhook"&&t.jsx(Hi,{"aria-label":"Headers",mono:!0,rows:2,placeholder:`Authorization: Bearer …
|
|
528
|
+
X-Source: bullpane`,value:M.headersText,onChange:z=>b($,{headersText:z.target.value}),wrapperClassName:"sm:col-span-3",hint:"One header per line, Name: value"})]},$)),p.channels&&t.jsx("p",{className:"text-xs text-danger",role:"alert",children:p.channels}),t.jsx(V,{size:"sm",variant:"ghost",leftIcon:t.jsx(Kn,{}),onClick:()=>g(M=>({...M,channels:[...M.channels,{type:"webhook",url:"",headersText:""}]})),children:"Add channel"})]}),m.channels.length>0&&t.jsx(Me,{label:"Cooldown (minutes)",type:"number",min:1,max:1440,value:m.cooldownMinutes,onChange:M=>y("cooldownMinutes",M.target.value),error:p.cooldownMinutes,hint:"Minimum time between notifications while the rule keeps firing.",wrapperClassName:"max-w-xs"})]})})}const bC=[15,30,60,0],wC={15:"15 min",30:"30 min",60:"1 hour",0:"All"};function NC(e){if(!e)return!1;const n=ku(e.completed)+ku(e.failed);return(e.completed.length>0||e.failed.length>0)&&n>0}function kC(e,n){const r=(e==null?void 0:e.completed)??[],i=(e==null?void 0:e.failed)??[],o=Math.max(r.length,i.length),d=Math.min(n===0?o:n,o),h=m=>SC(m,o).slice(o-d);return{completed:h(r),failed:h(i),minutes:d,available:o,truncated:n!==0&&n>o}}function SC(e,n){return e.length>=n?e:[...Array.from({length:n-e.length},()=>0),...e]}function CC(e){if(e.minutes===0)return{perMinute:null,perHour:null,completed:0,failed:0,successPct:null};const n=ku(e.completed),r=ku(e.failed),i=n+r,o=n/e.minutes;return{perMinute:o,perHour:o*60,completed:n,failed:r,successPct:i>0?n/i*100:null}}function _C(e){return e.completed.map((n,r)=>{const i=e.failed[r]??0,o=n+i;return o>0?n/o*100:null})}function cv(e){const n=e.filter(o=>!!o&&o.length>0);if(n.length===0)return[];const r=Math.max(...n.map(o=>o.length)),i=new Array(r).fill(0);for(const o of n){const c=r-o.length;for(let d=0;d<o.length;d++)i[c+d]+=o[d]}return i}function ku(e){return(e??[]).reduce((n,r)=>n+r,0)}function PC(e){const n=e??[],r=[],i=[];for(const o of n){if(o.processedOn!=null&&o.timestamp!=null){const c=o.processedOn-o.timestamp;Number.isFinite(c)&&c>=0&&r.push(c)}if(o.finishedOn!=null&&o.processedOn!=null){const c=o.finishedOn-o.processedOn;Number.isFinite(c)&&c>=0&&i.push(c)}}return{wait:uv(r),process:uv(i),sampled:n.length}}function uv(e){if(e.length===0)return null;const n=[...e].sort((r,i)=>r-i);return{min:n[0],median:dv(n,50),p95:dv(n,95),max:n[n.length-1],count:n.length}}function dv(e,n){if(e.length===0)return 0;const r=Math.ceil(n/100*e.length);return e[Math.min(e.length-1,Math.max(0,r-1))]}const Mn={top:10,right:8,bottom:20,left:40},hv=4;function fv({series:e,height:n=180,className:r,formatValue:i=mt,formatX:o=TC,maxY:c,ariaLabel:d,emptyText:h="No data"}){const m=N.useId(),g=N.useRef(null),[p,v]=N.useState(null),[j,C]=N.useState(720),y=Math.max(...e.map(U=>U.values.length),0),{max:b,plotW:k,plotH:S,scaleX:O,scaleY:q}=N.useMemo(()=>{const U=e.flatMap(Qe=>Qe.values.filter(K=>K!=null&&Number.isFinite(K))),J=U.length?Math.max(...U):0,we=c??IC(J),Te=Math.max(1,j-Mn.left-Mn.right),Ze=Math.max(1,n-Mn.top-Mn.bottom);return{max:we,plotW:Te,plotH:Ze,scaleX:Qe=>Mn.left+(y>1?Qe/(y-1)*Te:Te/2),scaleY:Qe=>Mn.top+Ze-(we>0?Qe/we*Ze:0)}},[e,j,n,c,y]),E=y>0&&e.some(U=>U.values.some(J=>J!=null)),T=U=>{var Ge;const J=(Ge=g.current)==null?void 0:Ge.getBoundingClientRect();if(!J||y===0)return;const Te=((U.clientX-J.left)/J.width*j-Mn.left)/k,Ze=Math.round(Te*(y-1));v(Ze>=0&&Ze<y?Ze:null)},[M,$]=N.useState(null),z=N.useCallback(U=>{g.current=U,$(U)},[]);N.useEffect(()=>{if(!M||typeof ResizeObserver>"u")return;const U=new ResizeObserver(([J])=>{const we=Math.round(J.contentRect.width);we>0&&C(we)});return U.observe(M),()=>U.disconnect()},[M]);const B=Array.from({length:hv+1},(U,J)=>b/hv*J);return t.jsxs("div",{ref:z,className:F("relative w-full select-none",r),onPointerMove:T,onPointerLeave:()=>v(null),children:[t.jsxs("svg",{width:"100%",height:n,viewBox:`0 0 ${j} ${n}`,preserveAspectRatio:"none",role:"img","aria-label":d??e.map(U=>U.label).join(" and "),className:"overflow-visible",children:[t.jsx("defs",{children:e.map(U=>t.jsxs("linearGradient",{id:`area-${m}-${U.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"0%",stopColor:U.color,stopOpacity:.28}),t.jsx("stop",{offset:"100%",stopColor:U.color,stopOpacity:.02})]},U.key))}),B.map((U,J)=>{const we=q(U);return t.jsxs("g",{children:[t.jsx("line",{x1:Mn.left,x2:j-Mn.right,y1:we,y2:we,stroke:"var(--border)",strokeWidth:1,shapeRendering:"crispEdges"}),t.jsx("text",{x:Mn.left-6,y:we+3,textAnchor:"end",className:"fill-[var(--fg-subtle)] text-[9px]",style:{fontVariantNumeric:"tabular-nums"},children:i(U)})]},J)}),E?t.jsxs(t.Fragment,{children:[e.map(U=>t.jsx(EC,{series:U,gradientId:`area-${m}-${U.key}`,scaleX:O,scaleY:q,baseline:Mn.top+S},U.key)),p!=null&&t.jsxs("g",{pointerEvents:"none",children:[t.jsx("line",{x1:O(p),x2:O(p),y1:Mn.top,y2:Mn.top+S,stroke:"var(--fg-subtle)",strokeWidth:1,strokeDasharray:"3 3"}),e.map(U=>{const J=U.values[p];return J==null||!Number.isFinite(J)?null:t.jsx("circle",{cx:O(p),cy:q(J),r:3,fill:U.color,stroke:"var(--surface)",strokeWidth:1.5},U.key)})]})]}):t.jsx("text",{x:j/2,y:n/2,textAnchor:"middle",className:"fill-[var(--fg-subtle)] text-[11px]",children:h}),E&&y>1&&t.jsx("g",{children:[0,Math.floor((y-1)/2),y-1].map((U,J)=>t.jsx("text",{x:O(U),y:n-6,textAnchor:J===0?"start":J===2?"end":"middle",className:"fill-[var(--fg-subtle)] text-[9px]",children:o(U,y)},U))})]}),p!=null&&E&&t.jsx(RC,{xPct:O(p)/j*100,title:o(p,y),rows:e.map(U=>({label:U.label,color:U.color,value:U.values[p]})).filter(U=>U.value!=null&&Number.isFinite(U.value)),formatValue:i})]})}function EC({series:e,gradientId:n,scaleX:r,scaleY:i,baseline:o}){const c=[];let d=null;return e.values.forEach((h,m)=>{if(h==null||!Number.isFinite(h)){d=null;return}const g=[r(m),i(h)];d?d.push(g):(d=[g],c.push(d))}),t.jsx("g",{children:c.map((h,m)=>{const g=h.map(([p,v],j)=>`${j===0?"M":"L"}${p.toFixed(1)},${v.toFixed(1)}`).join(" ");return t.jsxs("g",{children:[e.area&&h.length>1&&t.jsx("path",{d:`${g} L${h[h.length-1][0].toFixed(1)},${o} L${h[0][0].toFixed(1)},${o} Z`,fill:`url(#${n})`}),h.length>1?t.jsx("path",{d:g,fill:"none",stroke:e.color,strokeWidth:1.6,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:e.dashed?"4 3":void 0,vectorEffect:"non-scaling-stroke"}):t.jsx("circle",{cx:h[0][0],cy:h[0][1],r:1.8,fill:e.color})]},m)})})}function RC({xPct:e,title:n,rows:r,formatValue:i}){if(r.length===0)return null;const o=e>55;return t.jsxs("div",{className:"pointer-events-none absolute top-1 z-10 min-w-32 rounded-md border border-border bg-surface px-2 py-1.5 text-[11px] shadow-[var(--shadow)]",style:{left:`${e}%`,transform:o?"translateX(calc(-100% - 8px))":"translateX(8px)"},role:"status",children:[t.jsx("div",{className:"mb-1 text-fg-subtle",children:n}),r.map(c=>t.jsxs("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:c.color},"aria-hidden":!0}),t.jsx("span",{className:"text-fg-muted",children:c.label}),t.jsx("span",{className:"num ml-auto font-medium text-fg",children:i(c.value)})]},c.label))]})}function MC({series:e,className:n}){return t.jsx("div",{className:F("flex flex-wrap items-center gap-3 text-[11px] text-fg-muted",n),children:e.map(r=>t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"h-0.5 w-3 rounded-full",style:{background:r.color},"aria-hidden":!0}),r.label]},r.key))})}function TC(e,n){const r=n-1-e;return r===0?"now":`${W(r)} min ago`}function IC(e){if(!Number.isFinite(e)||e<=0)return 4;const n=10**Math.floor(Math.log10(e));for(const r of[1,2,2.5,5,10]){const i=r*n;if(i>=e)return i}return 10*n}const qC=50;function OC({connectionId:e,queue:n,summary:r,onOpenState:i}){const[o,c]=N.useState(60),d=r==null?void 0:r.metrics,h=NC(d),m=N.useMemo(()=>kC(d,o),[d,o]),g=N.useMemo(()=>CC(m),[m]),p=N.useMemo(()=>_C(m),[m]);return t.jsxs("div",{className:"space-y-3",children:[t.jsx(zC,{counts:r==null?void 0:r.counts,onOpenState:i}),h?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("h2",{className:"text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:"Throughput & history"}),t.jsx(AC,{value:o,onChange:c,available:m.available})]}),m.truncated&&t.jsxs("p",{className:"text-[11px] text-fg-subtle",role:"status",children:["This queue only stores ",W(m.available)," minute",m.available===1?"":"s"," of metrics — showing everything it has. BullMQ keeps one point per minute up to the worker's ",t.jsx("code",{className:"font-mono text-fg-muted",children:"maxDataPoints"}),"."]}),t.jsx(LC,{rates:r==null?void 0:r.rates,tp:g,minutes:m.minutes}),t.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[t.jsx(pv,{icon:t.jsx(Bf,{}),title:"Processed",hint:`Completed and failed per minute over the last ${W(m.minutes)} min, straight from BullMQ's own metrics collection.`,legend:$C,children:t.jsx(fv,{height:190,ariaLabel:"Completed and failed jobs per minute",series:[{key:"completed",label:"Completed",color:ot.completed.fg,values:m.completed,area:!0},{key:"failed",label:"Failed",color:ot.failed.fg,values:m.failed,area:!0}],formatValue:v=>mt(Math.round(v))})}),t.jsx(pv,{icon:t.jsx(So,{}),title:"Success rate",hint:"completed / (completed + failed) per minute. A minute where nothing finished is a gap, not 0 %.",children:t.jsx(fv,{height:190,maxY:100,ariaLabel:"Success rate per minute",series:[{key:"success",label:"Success",color:ot.completed.fg,values:p,area:!0}],formatValue:v=>`${Math.round(v)}%`})})]})]}):t.jsx(FC,{}),t.jsx(DC,{connectionId:e,queue:n,completedCount:(r==null?void 0:r.counts.completed)??0})]})}const $C=[{key:"completed",label:"Completed",color:ot.completed.fg},{key:"failed",label:"Failed",color:ot.failed.fg}];function zC({counts:e,onOpenState:n}){return t.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4 xl:grid-cols-8",children:io.map(r=>{const i=ot[r],o=e==null?void 0:e[r];return t.jsxs("button",{type:"button",onClick:()=>n(r),className:"card group flex flex-col items-start gap-0.5 px-3 py-2.5 text-left transition-colors hover:border-border-strong hover:bg-surface-2",title:`Show ${i.label} jobs`,children:[t.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-medium tracking-wider text-fg-subtle uppercase",children:[t.jsx("span",{className:F("status-dot size-1.5",i.dotClass),"aria-hidden":!0}),i.label]}),t.jsx("span",{className:F("num text-2xl leading-tight font-semibold",o==null?"text-fg-subtle":o>0?i.textClass:"text-fg-muted"),children:o==null?"—":mt(o)})]},r)})})}function AC({value:e,onChange:n,available:r}){return t.jsx("div",{className:"flex items-center gap-0.5 rounded-md bg-surface-2 p-0.5",role:"group","aria-label":"Metrics range",children:bC.map(i=>{const o=i!==0&&i>r;return t.jsx("button",{type:"button","aria-pressed":e===i,onClick:()=>n(i),title:o?`Only ${W(r)} min of data available`:void 0,className:F("h-6 rounded px-2 text-[11px] font-medium transition-colors",e===i?"bg-surface text-fg shadow-sm":"text-fg-muted hover:text-fg",o&&e!==i&&"opacity-50"),children:wC[i]},i)})})}function LC({rates:e,tp:n,minutes:r}){return t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[t.jsx(mv,{icon:t.jsx(lu,{}),label:"Throughput",value:n.perHour==null?"—":`${mt(Math.round(n.perHour))}`,unit:"jobs / hour",hint:`Mean over the last ${W(r)} min, projected to an hour. Not a count of the past hour.`}),t.jsx(mv,{icon:t.jsx(lu,{}),label:"Rate",value:n.perMinute==null?"—":n.perMinute.toFixed(n.perMinute<10?1:0),unit:"jobs / min",hint:`Mean completed per minute over the last ${W(r)} min.`}),t.jsxs("div",{className:"card px-3 py-2.5",children:[t.jsx("div",{className:"mb-1.5 text-[10px] font-medium tracking-wider text-fg-subtle uppercase",children:"Finished · window"}),t.jsxs("div",{className:"num flex items-baseline gap-3 text-sm",children:[t.jsxs("span",{style:{color:ot.completed.fg},children:[mt(n.completed)," ok"]}),t.jsxs("span",{style:{color:ot.failed.fg},children:[mt(n.failed)," failed"]}),t.jsx("span",{className:"ml-auto text-fg-muted",children:n.successPct==null?"—":On(n.successPct)})]})]}),t.jsxs("div",{className:"card px-3 py-2.5",children:[t.jsxs("div",{className:"mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider text-fg-subtle uppercase",children:["Success · trailing window",t.jsx(_e,{content:ym(e),className:"ml-auto normal-case",children:t.jsx("span",{className:"text-[10px] text-fg-subtle",children:(e==null?void 0:e.source)==="metrics"?"metrics":"zsets"})})]}),t.jsx(jm,{rates:e})]})]})}function mv({icon:e,label:n,value:r,unit:i,hint:o}){return t.jsxs("div",{className:"card px-3 py-2.5",children:[t.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5 text-[10px] font-medium tracking-wider text-fg-subtle uppercase",children:[t.jsx("span",{className:"[&_svg]:size-3","aria-hidden":!0,children:e}),n,t.jsx(_e,{content:o,className:"ml-auto",children:t.jsx(Xi,{className:"size-3 text-fg-subtle","aria-label":o})})]}),t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{className:"num text-2xl leading-tight font-semibold text-fg",children:r}),t.jsx("span",{className:"text-[11px] text-fg-subtle",children:i})]})]})}function pv({icon:e,title:n,hint:r,legend:i,children:o}){return t.jsxs("section",{className:"card p-3",children:[t.jsxs("header",{className:"mb-2 flex flex-wrap items-center gap-2",children:[t.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-semibold text-fg [&_svg]:size-3.5 [&_svg]:text-fg-subtle",children:[e,n]}),i&&t.jsx(MC,{series:i,className:"ml-auto"})]}),o,t.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-fg-subtle",children:r})]})}function FC(){return t.jsxs("div",{className:"card",children:[t.jsx(nn,{icon:t.jsx(Bf,{}),title:"This queue is not collecting metrics",description:t.jsxs(t.Fragment,{children:["BullMQ only records per-minute completed/failed counts when the ",t.jsx("strong",{className:"text-fg",children:"Worker"})," is created with the"," ",t.jsx("code",{className:"font-mono text-fg",children:"metrics"})," option. Nothing in Redis can be back-filled, so there is no history to show — turn it on and points start accumulating one per minute."]})}),t.jsx("div",{className:"px-6 pb-6",children:t.jsx(_m,{className:"mx-auto max-w-2xl",language:"ts",code:"new Worker(name, fn, { metrics: { maxDataPoints: MetricsTime.ONE_WEEK } })"})})]})}function DC({connectionId:e,queue:n,completedCount:r}){var h;const i=m0(e,n,{state:"completed",page:1,pageSize:qC,order:"desc"},{enabled:r>0}),o=N.useMemo(()=>{var m;return PC((m=i.data)==null?void 0:m.jobs)},[(h=i.data)==null?void 0:h.jobs]),c=o.sampled,d=`Measured from the ${W(c)} most recent completed job${c===1?"":"s"} on this queue. A sample, not a server-wide statistic — BullMQ stores no aggregate timings in Redis.`;return t.jsxs("section",{className:"space-y-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("h2",{className:"flex items-center gap-1.5 text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:[t.jsx(zy,{className:"size-3.5","aria-hidden":!0}),"Timings"]}),t.jsx(_e,{content:d,children:t.jsxs("span",{className:"inline-flex items-center gap-1 rounded border border-border bg-surface-2 px-1.5 py-0.5 text-[10px] text-fg-muted",children:[t.jsx(Xi,{className:"size-3","aria-hidden":!0}),"sample of ",W(c)]})})]}),r===0?t.jsx("div",{className:"card",children:t.jsx(nn,{compact:!0,title:"No completed jobs yet",description:"Wait times and process times are derived from finished jobs."})}):t.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[t.jsx(xv,{title:"Response time",subtitle:"time in queue · processedOn − timestamp",stats:o.wait,loading:i.isLoading,color:ot.waiting.fg,note:d}),t.jsx(xv,{title:"Process time",subtitle:"time in workers · finishedOn − processedOn",stats:o.process,loading:i.isLoading,color:ot.active.fg,note:d})]})]})}function xv({title:e,subtitle:n,stats:r,loading:i,color:o,note:c}){const d=[{label:"min",value:(r==null?void 0:r.min)??null},{label:"median",value:(r==null?void 0:r.median)??null},{label:"p95",value:(r==null?void 0:r.p95)??null},{label:"max",value:(r==null?void 0:r.max)??null}];return t.jsxs("div",{className:"card p-3",title:c,children:[t.jsxs("header",{className:"mb-2 flex items-baseline gap-2",children:[t.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-semibold text-fg",children:[t.jsx("span",{className:"size-2 rounded-full",style:{background:o},"aria-hidden":!0}),e]}),t.jsx("span",{className:"truncate font-mono text-[10px] text-fg-subtle",children:n})]}),t.jsx("div",{className:"grid grid-cols-4 gap-px overflow-hidden rounded-md bg-border",children:d.map(h=>t.jsxs("div",{className:"bg-surface px-2 py-2",children:[t.jsx("div",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:h.label}),t.jsx("div",{className:"num truncate text-[15px] font-semibold text-fg",children:i?t.jsx("span",{className:"skeleton inline-block h-3.5 w-12"}):h.value==null?"—":qn(h.value)})]},h.label))})]})}function gv(e,n){const r=e.trim();if(!r)return{value:{}};try{return{value:JSON.parse(r)}}catch(i){return{error:`${n}: ${i.message}`}}}function UC({open:e,onClose:n,connectionId:r,queue:i}){const o=Yk(r,i),[c,d]=N.useState(""),[h,m]=N.useState(`{
|
|
529
|
+
|
|
530
|
+
}`),[g,p]=N.useState("{}"),[v,j]=N.useState({}),C=()=>{var O;const y=gv(h,"Data"),b=gv(g,"Options"),k={};if(y.error&&(k.data=y.error),b.error&&(k.opts=b.error),!b.error&&(typeof b.value!="object"||b.value===null||Array.isArray(b.value))&&(k.opts="Options must be a JSON object"),j(k),Object.keys(k).length)return;const S=uk.safeParse({name:c.trim()||void 0,data:y.value,opts:b.value});if(!S.success){j({name:(O=S.error.issues[0])==null?void 0:O.message});return}o.mutate(S.data,{onSuccess:q=>{Y.success(`Job ${q.id} added to ${i}`),n()},onError:q=>Y.error(ye(q))})};return t.jsx(Sn,{open:e,onClose:n,title:`Add job to ${i}`,description:"The job is added with the official BullMQ client; opts follow JobsOptions (delay, priority, attempts, backoff, …).",size:"lg",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),t.jsx(V,{variant:"primary",size:"sm",onClick:C,loading:o.isPending,children:"Add job"})]}),children:t.jsxs("div",{className:"space-y-3",children:[t.jsx(Me,{label:"Name",placeholder:"__default__",value:c,onChange:y=>d(y.target.value),error:v.name,mono:!0,autoFocus:!0}),t.jsx(Hi,{label:"Data (JSON)",mono:!0,rows:8,value:h,onChange:y=>m(y.target.value),error:v.data,spellCheck:!1}),t.jsx(Hi,{label:"Options (JSON)",mono:!0,rows:4,value:g,onChange:y=>p(y.target.value),error:v.opts,hint:'e.g. {"delay": 5000, "attempts": 3, "backoff": {"type": "exponential", "delay": 1000}}',spellCheck:!1})]})})}const QC=e0.shape.state.options,BC=[{label:"Any age",value:0},{label:"Older than 1 hour",value:36e5},{label:"Older than 1 day",value:864e5},{label:"Older than 7 days",value:7*864e5}];function VC({open:e,onClose:n,connectionId:r,queue:i,defaultState:o}){const c=p0(r,i),[d,h]=N.useState(o??"completed"),[m,g]=N.useState(0),[p,v]=N.useState("1000"),[j,C]=N.useState(null),y=()=>{var k;const b=e0.safeParse({state:d,grace:m,limit:Number(p)});if(!b.success){C(((k=b.error.issues[0])==null?void 0:k.message)??"Invalid input");return}C(null),c.mutate({action:"clean",body:b.data},{onSuccess:S=>{Y.success(`Cleaned ${W(S.removed??0)} ${d} jobs from ${i}`),n()},onError:S=>Y.error(ye(S))})};return t.jsx(Sn,{open:e,onClose:n,title:`Clean ${i}`,description:"Removes jobs in a state, oldest first, up to the limit. Uses BullMQ's queue.clean().",size:"sm",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),t.jsx(V,{variant:"danger",size:"sm",onClick:y,loading:c.isPending,children:"Clean jobs"})]}),children:t.jsxs("div",{className:"space-y-3",children:[t.jsx(ut,{label:"State",value:d,onChange:b=>h(b.target.value),options:QC.map(b=>({value:b,label:b}))}),t.jsx(ut,{label:"Grace period",value:String(m),onChange:b=>g(Number(b.target.value)),options:BC.map(b=>({value:String(b.value),label:b.label})),hint:"Only jobs older than this are removed."}),t.jsx(Me,{label:"Limit",type:"number",min:1,max:1e5,value:p,onChange:b=>v(b.target.value),error:j??void 0,hint:"Maximum number of jobs to remove in this run (1–100,000)."})]})})}const vv="queueSetup.open";function HC({connectionId:e,queue:n,className:r}){const[i,o]=N.useState(()=>Ou(vv,!0)),c=rm(e,n),d=c.data,h=()=>{o(m=>(uo(vv,!m),!m))};return t.jsxs("section",{className:F("card overflow-hidden",r),"aria-label":"Queue setup",children:[t.jsxs("button",{type:"button",onClick:h,"aria-expanded":i,className:"flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-surface-2/60",children:[i?t.jsx(cs,{className:"size-3.5 text-fg-subtle","aria-hidden":!0}):t.jsx(Wn,{className:"size-3.5 text-fg-subtle","aria-hidden":!0}),t.jsx("span",{className:"text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:"Setup"}),!i&&d&&t.jsx(KC,{data:d}),(d==null?void 0:d.rateLimitedNow)&&t.jsx(B0,{ttlMs:d.rateLimitedNow.ttlMs,since:c.dataUpdatedAt}),t.jsx("span",{className:"ml-auto text-[11px] text-fg-subtle",children:"from Redis · refreshes every 10 s"})]}),i&&t.jsxs("div",{className:"border-t border-border px-3 py-2.5",children:[c.isLoading&&!d&&t.jsx("div",{className:"grid gap-x-6 gap-y-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",children:Array.from({length:10},(m,g)=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(ou,{className:"h-2.5 w-20"}),t.jsx(ou,{className:"h-3 w-28"})]},g))}),c.isError&&!d&&t.jsx("p",{className:"text-xs text-fg-muted",children:Gs(c.error)&&c.error.status===404?"Setup details are not available on this server version.":`Setup unavailable: ${ye(c.error)}`}),d&&t.jsx(WC,{data:d,since:c.dataUpdatedAt})]})]})}function KC({data:e}){const n=V0(e.library);return t.jsxs("span",{className:"flex min-w-0 items-center gap-2 truncate text-xs text-fg-muted",children:[t.jsx("span",{className:"font-mono",children:n?`${n.name} ${n.version}`:"library unknown"}),t.jsx("span",{className:"text-fg-subtle",children:"·"}),t.jsx("span",{children:e.workers?`${W(e.workers.count)} ${e.workers.count===1?"worker":"workers"}`:"workers unknown"}),t.jsx("span",{className:"text-fg-subtle",children:"·"}),t.jsxs("span",{children:["concurrency ",e.globalConcurrency??"not set"]})]})}function WC({data:e,since:n}){const r=V0(e.library),i=e.groups;return t.jsxs(t.Fragment,{children:[t.jsxs("dl",{className:"grid gap-x-6 gap-y-2.5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",children:[t.jsx(Ds,{icon:t.jsx(vN,{}),label:"Library",children:r?t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsxs("span",{className:"font-mono",children:[r.name," ",r.version]}),e.isPro&&t.jsx(be,{variant:"pro",size:"xs",className:"tracking-wider",children:"PRO"})]}):t.jsx(Cr,{children:"unknown"})}),t.jsx(Ds,{icon:t.jsx(Gf,{}),label:"Workers connected",children:e.workers?t.jsx(_e,{content:e.workers.names.length?ZC(e.workers.names):"no worker names reported",side:"bottom",children:t.jsx("span",{className:"num cursor-help underline decoration-dotted underline-offset-2",children:W(e.workers.count)})}):t.jsx(Cr,{title:"CLIENT LIST is unavailable on this Redis (ACL or managed service)",children:"unknown"})}),t.jsx(Ds,{icon:t.jsx(lu,{}),label:"Global concurrency",children:e.globalConcurrency!=null?t.jsx("span",{className:"num",children:W(e.globalConcurrency)}):t.jsx(Cr,{children:"not set"})}),t.jsx(Ds,{icon:t.jsx(zy,{}),label:"Global rate limit",children:e.globalRateLimit?t.jsxs("span",{className:"num",children:[W(e.globalRateLimit.max)," / ",H0(e.globalRateLimit.durationMs)]}):t.jsx(Cr,{children:"not set"})}),t.jsx(Ds,{icon:t.jsx(hN,{}),label:"Rate limited now",children:e.rateLimitedNow?t.jsx(B0,{ttlMs:e.rateLimitedNow.ttlMs,since:n}):t.jsx("span",{className:"text-fg-muted",children:"no"})}),t.jsx(Ds,{icon:t.jsx(Mu,{}),label:"Groups",className:"xl:col-span-2",children:i?t.jsxs("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5",children:[t.jsxs("span",{className:"num",children:[W(i.count)," ",i.count===1?"group":"groups"]}),t.jsxs("span",{className:"num text-fg-muted",children:[W(i.byStatus.waiting)," waiting · ",W(i.byStatus.limited)," limited · ",W(i.byStatus.maxed)," maxed · ",W(i.byStatus.paused)," paused"]}),t.jsx(_e,{content:"Groups with their own concurrency or rate limit (queue.setGroupConcurrency / setGroupRateLimit). The others use the worker's group option.",side:"bottom",children:t.jsxs("span",{className:"num cursor-help text-fg-muted underline decoration-dotted underline-offset-2",children:[W(i.configured)," with per-group overrides"]})}),t.jsxs("span",{className:"num text-fg-muted",children:[W(i.active)," with active jobs"]})]}):t.jsx(Cr,{title:"No BullMQ Pro group keys found for this queue",children:"none observed"})}),t.jsx(Ds,{icon:t.jsx(Yw,{}),label:"Batch",children:t.jsx(_e,{content:"Batching is a Worker option (worker.opts.batch); BullMQ does not persist it in Redis, so it cannot be read from here.",side:"bottom",children:t.jsx(Cr,{className:"cursor-help underline decoration-dotted underline-offset-2",children:"not observable from Redis"})})}),t.jsx(Ds,{icon:t.jsx(So,{}),label:"Metrics",children:e.metricsEnabled?t.jsx("span",{className:"text-state-completed",children:"enabled"}):t.jsx(Cr,{children:"disabled"})}),t.jsx(Ds,{icon:t.jsx(dN,{}),label:"Max events",children:e.maxLenEvents!=null?t.jsx("span",{className:"num",children:W(e.maxLenEvents)}):t.jsx(Cr,{children:"not set"})})]}),t.jsxs("details",{className:"mt-2.5 border-t border-border pt-2 text-xs",children:[t.jsxs("summary",{className:"inline-flex cursor-pointer items-center gap-1.5 text-fg-muted select-none hover:text-fg",children:[t.jsx(Sy,{className:"size-3.5","aria-hidden":!0})," Raw meta",t.jsxs("span",{className:"num text-fg-subtle",children:["(",Object.keys(e.rawMeta??{}).length," fields)"]})]}),Object.keys(e.rawMeta??{}).length===0?t.jsx("p",{className:"mt-1.5 text-fg-subtle",children:"The meta hash has no extra fields."}):t.jsx("table",{className:"mt-1.5 w-auto text-[11px]",children:t.jsx("tbody",{children:Object.entries(e.rawMeta).sort(([o],[c])=>o.localeCompare(c)).map(([o,c])=>t.jsxs("tr",{className:"border-t border-border/60",children:[t.jsx("th",{scope:"row",className:"py-0.5 pr-4 text-left font-mono font-normal text-fg-muted",children:o}),t.jsx("td",{className:"py-0.5 font-mono break-all text-fg",children:c===""?t.jsx("span",{className:"text-fg-subtle",children:"(empty)"}):c})]},o))})})]})]})}function Ds({icon:e,label:n,children:r,className:i}){return t.jsxs("div",{className:F("flex min-w-0 items-start gap-2",i),children:[t.jsx("span",{className:"mt-0.5 shrink-0 text-fg-subtle [&_svg]:size-3.5","aria-hidden":!0,children:e}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:n}),t.jsx("dd",{className:"text-[13px] text-fg",children:r})]})]})}function Cr({children:e,title:n,className:r}){return t.jsx("span",{className:F("text-fg-subtle",r),title:n,children:e})}function B0({ttlMs:e,since:n}){const r=To(1e3),i=Math.max(0,e-Math.max(0,r-n));return t.jsxs(be,{variant:"custom",size:"xs",dot:!0,className:"border tracking-wide",style:{color:"var(--state-waiting)",background:"color-mix(in srgb, var(--state-waiting) 14%, transparent)",borderColor:"color-mix(in srgb, var(--state-waiting) 38%, transparent)"},children:["throttled · lifts in ",H0(i)]})}function V0(e){if(!e)return null;const n=e.indexOf(":");return n<0?{name:e,version:""}:{name:e.slice(0,n),version:e.slice(n+1)}}function H0(e){return!Number.isFinite(e)||e<0?"–":e>=36e5&&e%36e5===0?`${e/36e5}h`:e>=6e4&&e%6e4===0?`${e/6e4}m`:e>=1e3?`${Math.round(e/100)/10}s`.replace(/\.0s$/,"s"):`${Math.round(e)}ms`}function ZC(e){const n=e.slice(0,12);return n.join(", ")+(e.length>n.length?` +${e.length-n.length} more`:"")}function GC({connectionId:e,queue:n}){var b,k;const{isOperator:r}=yt(),[i,o]=N.useState(1),[c,d]=N.useState(25),[h,m]=N.useState(null),g=n2(e,n,{page:i,pageSize:c}),p=r2(e,n),v=((b=g.data)==null?void 0:b.schedulers)??[],j=((k=g.data)==null?void 0:k.total)??0,C=r?6:5,y=S=>p.mutate(S.key,{onSuccess:()=>{Y.success(`Scheduler ${S.key} removed`),m(null)},onError:O=>Y.error(ye(O))});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"card overflow-hidden",children:[t.jsxs(os,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{children:"Key"}),t.jsx(fe,{children:"Job name"}),t.jsx(fe,{children:"Repeats"}),t.jsx(fe,{children:"Timezone"}),t.jsx(fe,{align:"right",children:"Next run"}),r&&t.jsx(fe,{align:"right",children:"Actions"})]})}),t.jsxs("tbody",{children:[g.isLoading&&t.jsx(xt,{colSpan:C,children:t.jsx(Dt,{label:"Loading schedulers…"})}),g.isError&&!g.data&&t.jsx(xt,{colSpan:C,className:"text-danger",children:ye(g.error)}),g.data&&v.length===0&&t.jsx(xt,{colSpan:C,children:t.jsx(YC,{queue:n})}),v.map(S=>t.jsxs(rl,{children:[t.jsxs(me,{mono:!0,children:[t.jsx("span",{className:"text-fg",title:S.key,children:S.key}),S.template&&t.jsx("span",{className:"ml-1.5 text-[11px] text-fg-subtle",title:XC(S),children:"template"})]}),t.jsx(me,{mono:!0,muted:!0,children:S.name}),t.jsx(me,{children:t.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[t.jsx(be,{variant:"outline",size:"xs",className:"font-mono",children:K0(S)}),S.limit!=null&&t.jsxs("span",{className:"text-[11px] text-fg-subtle",title:"Maximum number of jobs this scheduler will ever produce",children:[W(S.iterationCount??0),"/",W(S.limit)," runs"]}),S.limit==null&&S.iterationCount!=null&&t.jsxs("span",{className:"text-[11px] text-fg-subtle",title:"Jobs produced so far",children:[W(S.iterationCount)," runs"]}),S.endDate!=null&&t.jsxs("span",{className:"text-[11px] text-fg-subtle",title:`Stops after ${fn(S.endDate)}`,children:["until ",Ur(S.endDate)]})]})}),t.jsx(me,{muted:!0,children:S.tz??t.jsx("span",{className:"text-fg-subtle",children:"–"})}),t.jsx(me,{align:"right",num:!0,children:S.next==null?t.jsx("span",{className:"text-fg-subtle",children:"–"}):t.jsx("span",{className:F(S.next<=Date.now()&&"text-warning"),title:fn(S.next),children:Ur(S.next)})}),r&&t.jsx(me,{align:"right",children:t.jsx(V,{size:"sm",variant:"ghost",className:"text-fg-subtle hover:text-danger",leftIcon:t.jsx(us,{}),"aria-label":`Remove scheduler ${S.key}`,title:"Remove this scheduler",loading:p.isPending&&p.variables===S.key,onClick:()=>m(S),children:"Remove"})})]},S.key))]})]}),j>0&&t.jsx("div",{className:F("border-t border-border px-3 py-2",g.isFetching&&"opacity-80"),children:t.jsx(Uu,{page:i,pageSize:c,total:j,count:v.length,onPage:o,onPageSize:S=>(d(S),o(1))})})]}),t.jsx(tn,{open:!!h,onClose:()=>m(null),title:"Remove job scheduler",description:h?`Stops "${h.key}" from producing new jobs and removes the job it already had scheduled. Jobs it produced in the past are not touched. Recreate it with queue.upsertJobScheduler().`:"",confirmText:"Remove",danger:!0,loading:p.isPending,onConfirm:()=>h&&y(h)})]})}function K0(e){return e.every!=null?`every ${JC(e.every)}`:e.pattern?e.pattern:"unknown"}function JC(e){if(e<1e3)return`${e}ms`;const n=[[864e5,"d"],[36e5,"h"],[6e4,"m"],[1e3,"s"]];for(const[r,i]of n)if(e>=r){const o=e/r;return`${Number.isInteger(o)?o:o.toFixed(1)}${i}`}return`${e}ms`}function XC(e){var r,i,o;const n=[`name: ${((r=e.template)==null?void 0:r.name)??e.name}`];return(i=e.template)!=null&&i.data&&n.push(`data: ${e.template.data}`),(o=e.template)!=null&&o.opts&&n.push(`opts: ${e.template.opts}`),n.join(`
|
|
531
|
+
`)}function YC({queue:e}){return t.jsxs("div",{className:"mx-auto flex max-w-xl flex-col items-center gap-2 py-6 text-center",children:[t.jsx(Co,{className:"size-6 text-fg-subtle","aria-hidden":!0}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"No job schedulers on this queue"}),t.jsx("p",{className:"text-xs text-fg-muted",children:"A job scheduler (BullMQ calls it a repeatable job) stamps out the same job on a cron pattern or a fixed interval. It lives outside the job states, so it never shows up under Waiting or Delayed — only the single job it has queued next does."}),t.jsx("pre",{className:"mt-1 w-full overflow-x-auto rounded-md border border-border bg-surface-2 p-2.5 text-left font-mono text-[11px] leading-relaxed text-fg-muted",children:`const queue = new Queue("${e}");
|
|
532
|
+
|
|
533
|
+
await queue.upsertJobScheduler(
|
|
534
|
+
"nightly-report", // scheduler id
|
|
535
|
+
{ pattern: "0 3 * * *", tz: "America/Sao_Paulo" },
|
|
536
|
+
{ name: "report", data: { kind: "daily" } },
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
// or a fixed interval
|
|
540
|
+
await queue.upsertJobScheduler("heartbeat", { every: 30_000 });`}),t.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] text-fg-subtle",children:[t.jsx(qy,{className:"size-3","aria-hidden":!0}),"upsertJobScheduler is idempotent: calling it again updates the schedule instead of adding a second one."]})]})}function Oa({feature:e}){const n=oo[e],{pricing:r,checkoutUrl:i}=jt();return t.jsxs("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-8 px-6 py-10 lg:flex-row lg:items-center lg:gap-12",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"mb-3 inline-flex items-center gap-1.5 rounded-full border border-pro/40 bg-pro/10 px-2.5 py-1 text-[11px] font-medium tracking-wider text-pro uppercase",children:[t.jsx(ro,{className:"size-3","aria-hidden":!0}),"Pro feature"]}),t.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-fg",children:n.title}),t.jsx("p",{className:"mt-2 max-w-md text-sm leading-relaxed text-fg-muted",children:n.tagline}),t.jsx("ul",{className:"mt-5 space-y-2.5",children:n.bullets.map(o=>t.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] text-fg",children:[t.jsx(Qr,{className:"mt-0.5 size-4 shrink-0 text-success","aria-hidden":!0}),t.jsx("span",{children:o})]},o))}),t.jsxs("div",{className:"mt-7 flex flex-wrap items-center gap-3",children:[t.jsxs("a",{href:i||"#",target:"_blank",rel:"noreferrer noopener","aria-disabled":!i,className:"inline-flex h-9 items-center gap-2 rounded-md bg-accent px-4 text-[13px] font-medium text-accent-fg hover:bg-accent-hover aria-disabled:pointer-events-none aria-disabled:opacity-50",children:["Unlock Pro · $",r.monthlyUsd,"/mo or $",r.yearlyUsd,"/yr",t.jsx(Lr,{className:"size-4","aria-hidden":!0})]}),t.jsxs(Re,{to:"/settings/license",className:"inline-flex h-9 items-center gap-2 rounded-md border border-border-strong px-3 text-[13px] font-medium text-fg hover:bg-surface-2",children:[t.jsx(Yi,{className:"size-4","aria-hidden":!0}),"I have a key"]})]}),t.jsxs("p",{className:"mt-3 text-xs text-fg-subtle",children:["One key unlocks login with Users & roles, Alerts, Folders, Flows, the Audit log, SSO and MCP for one installation. $",r.monthlyUsd,"/month or $",r.yearlyUsd,"/year, unlimited users, cancel any time."]})]}),t.jsx("div",{className:"flex-1",children:t.jsx(e_,{feature:e})})]})}function e_({feature:e}){return t.jsxs("div",{"aria-hidden":!0,className:"relative overflow-hidden rounded-xl border border-border bg-surface p-3 shadow-[var(--shadow)]",children:[t.jsxs("div",{className:"mb-3 flex items-center gap-1.5",children:[t.jsx("span",{className:"size-2 rounded-full bg-fg-subtle/40"}),t.jsx("span",{className:"size-2 rounded-full bg-fg-subtle/40"}),t.jsx("span",{className:"size-2 rounded-full bg-fg-subtle/40"}),t.jsx("span",{className:"ml-3 h-2 w-24 rounded bg-surface-3"})]}),e==="alerts"&&t.jsx(t_,{}),e==="users"&&t.jsx(n_,{}),e==="folders"&&t.jsx(s_,{}),e==="flows"&&t.jsx(r_,{}),t.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-surface to-transparent"})]})}function Yc({className:e,children:n}){return t.jsx("div",{className:F("flex items-center gap-2 rounded-md border border-border bg-bg/60 px-2.5 py-2",e),children:n})}function In({w:e,className:n}){return t.jsx("span",{className:F("h-2 rounded bg-surface-3",n),style:{width:e}})}function t_(){return t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Yc,{children:[t.jsx("span",{className:"status-dot pulse bg-danger"}),t.jsx(In,{w:"38%",className:"bg-fg-muted/50"}),t.jsx("span",{className:"ml-auto rounded bg-danger/15 px-1.5 py-0.5 text-[9px] font-medium text-danger",children:"FIRING"})]}),t.jsxs(Yc,{children:[t.jsx("span",{className:"status-dot bg-success"}),t.jsx(In,{w:"52%"}),t.jsx("span",{className:"ml-auto rounded bg-success/15 px-1.5 py-0.5 text-[9px] font-medium text-success",children:"OK"})]}),t.jsxs(Yc,{children:[t.jsx("span",{className:"status-dot bg-success"}),t.jsx(In,{w:"30%"}),t.jsx("span",{className:"ml-auto rounded bg-success/15 px-1.5 py-0.5 text-[9px] font-medium text-success",children:"OK"})]}),t.jsxs("div",{className:"mt-3 rounded-md border border-border bg-surface-2 p-2.5",children:[t.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[t.jsx("span",{className:"size-4 rounded bg-[#4A154B]"}),t.jsx(In,{w:"30%",className:"bg-fg-muted/50"}),t.jsx(In,{w:"12%",className:"ml-auto"})]}),t.jsx(In,{w:"80%",className:"mb-1.5"}),t.jsx(In,{w:"60%"})]})]})}function n_(){const e=[["admin","bg-pro/15 text-pro"],["operator","bg-info/15 text-info"],["operator","bg-info/15 text-info"],["viewer","bg-surface-3 text-fg-muted"]];return t.jsx("div",{className:"space-y-2",children:e.map(([n,r],i)=>t.jsxs(Yc,{children:[t.jsx("span",{className:"size-5 rounded-full bg-surface-3"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(In,{w:`${70+i*12}px`,className:"bg-fg-muted/50"}),t.jsx(In,{w:`${100+i*8}px`,className:"h-1.5"})]}),t.jsx("span",{className:F("ml-auto rounded px-1.5 py-0.5 text-[9px] font-medium",r),children:n})]},i))})}function s_(){return t.jsxs("div",{className:"space-y-1.5 text-[11px]",children:[[["Payments","bg-success",0,3],["Checkout","bg-success",1,2],["Refunds","bg-success",1,1],["Notifications","bg-info",0,4],["Data pipeline","bg-violet",0,2]].map(([e,n,r,i],o)=>t.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1",style:{paddingLeft:8+r*16},children:[t.jsx("span",{className:F("size-3 rounded-sm",n)}),t.jsx("span",{className:"text-fg-muted",children:e}),t.jsx("span",{className:"ml-auto rounded bg-surface-3 px-1 text-[9px] text-fg-subtle",children:i})]},o)),t.jsxs("div",{className:"ml-6 space-y-1 border-l border-border pl-3",children:[t.jsx(In,{w:"60%"}),t.jsx(In,{w:"45%"}),t.jsx(In,{w:"70%"})]})]})}function r_(){const e=(n,r,i,o="bg-surface-2")=>t.jsxs("div",{className:F("absolute flex h-9 w-28 flex-col justify-center rounded-md border border-border px-2",o),style:{left:n,top:r},children:[t.jsx("span",{className:"text-[10px] font-medium text-fg",children:i}),t.jsx(In,{w:"50%",className:"mt-1 h-1.5"})]});return t.jsxs("div",{className:"relative h-52",children:[t.jsxs("svg",{className:"absolute inset-0 h-full w-full",fill:"none",stroke:"var(--fg-subtle)",strokeWidth:1.5,children:[t.jsx("path",{d:"M120 38 C 160 38, 160 98, 200 98"}),t.jsx("path",{d:"M120 158 C 160 158, 160 98, 200 98",strokeDasharray:"4 3",stroke:"var(--accent)"}),t.jsx("path",{d:"M312 98 C 350 98, 350 60, 380 60"}),t.jsx("path",{d:"M312 98 C 350 98, 350 136, 380 136"})]}),e(8,20,"ingest"),e(8,140,"backfill"),e(200,80,"process","bg-accent/10"),e(380,42,"notify"),e(380,118,"archive"),t.jsx("span",{className:"absolute top-[60px] left-[150px] rounded bg-surface px-1 text-[9px] text-fg-subtle",children:"×214"})]})}function a_(){const{has:e}=jt();return e("alerts")?t.jsx(l_,{}):t.jsx(Oa,{feature:"alerts"})}function W0(e){switch(e.kind){case"waiting_above":return`wait+prioritized > ${W(e.threshold)}`;case"failed_above":return`failed > ${W(e.threshold)} in ${e.windowMinutes}m`;case"failed_rate_above":return`failure rate > ${e.percent}% in ${e.windowMinutes}m (min ${e.minSample})`;case"duration_above":return`p${e.percentile} processing > ${e.seconds}s in ${e.windowMinutes}m (min ${e.minSample})`}}const i_={fired:"danger",resolved:"success",delivery_failed:"warning",no_metrics:"info"};function l_(){var O,q;const{isOperator:e}=yt(),n=im(),r=ds(),i=Br(),o=b0(),c=g2(),d=v2(),[h,m]=N.useState(null),[g,p]=N.useState(null),[v,j]=N.useState(""),C=p2({limit:100,alertId:v||void 0}),y=E=>{var T,M;return E?((M=(T=r.data)==null?void 0:T.find($=>$.id===E))==null?void 0:M.name)??E:"–"},b=E=>{var T,M;return((M=(T=i.data)==null?void 0:T.find($=>$.id===E))==null?void 0:M.name)??E},k=[...n.data??[]].sort((E,T)=>Number(T.firing)-Number(E.firing)||E.name.localeCompare(T.name)),S=k.filter(E=>E.firing).length;return t.jsxs(vt,{children:[t.jsx(hs,{title:t.jsxs("span",{className:"flex items-center gap-2",children:["Alerts",S>0&&t.jsxs(be,{variant:"danger",dot:!0,children:[S," firing"]})]}),description:"Server-side rules: backlog from live counts, failures from BullMQ metrics counters. Delivered to Slack or any webhook.",actions:e&&t.jsx(V,{variant:"primary",size:"sm",leftIcon:t.jsx(Kn,{}),onClick:()=>m({alert:null}),children:"New alert"})}),t.jsx("div",{className:"card overflow-hidden",children:t.jsxs(os,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{className:"w-16",children:"State"}),t.jsx(fe,{children:"Name"}),t.jsx(fe,{children:"Scope"}),t.jsx(fe,{children:"Condition"}),t.jsx(fe,{children:"Channels"}),t.jsx(fe,{children:"Last fired"}),t.jsx(fe,{align:"right",children:t.jsx("span",{className:"sr-only",children:"Actions"})})]})}),t.jsxs("tbody",{children:[n.isLoading&&t.jsx(xt,{colSpan:7,children:t.jsx(Dt,{label:"Loading alerts…"})}),n.isError&&t.jsx(xt,{colSpan:7,className:"text-danger",children:ye(n.error)}),n.data&&k.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:7,children:t.jsx(nn,{compact:!0,icon:t.jsx(Gi,{}),title:"No alerts yet",description:"Start with 'failures above threshold' on your most important queue and a Slack webhook.",action:e&&t.jsx(V,{size:"sm",variant:"primary",leftIcon:t.jsx(Kn,{}),onClick:()=>m({alert:null}),children:"New alert"})})})}),k.map(E=>{var T;return t.jsxs(rl,{className:F(!E.enabled&&"opacity-60"),children:[t.jsx(me,{children:E.firing?t.jsxs(be,{variant:"danger",dot:!0,children:[t.jsx(Qf,{className:"size-3"})," firing"]}):E.enabled?t.jsx(pC,{measurement:E.measurement}):t.jsx(be,{variant:"neutral",children:"off"})}),t.jsx(me,{className:"font-medium",children:E.name}),t.jsx(me,{muted:!0,children:E.scope.type==="queue"?t.jsxs(t.Fragment,{children:[y(E.scope.connectionId),t.jsx("span",{className:"text-fg-subtle",children:" / "}),t.jsx("span",{className:"font-mono text-xs",children:E.scope.queueName})]}):E.scope.type==="folder"?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(be,{variant:"outline",size:"xs",children:"folder"}),b(E.scope.folderId)]}):E.scope.type==="connection"?t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(be,{variant:"outline",size:"xs",children:"connection"}),y(E.scope.connectionId)]}):t.jsx(be,{variant:"outline",size:"xs",children:"every queue"})}),t.jsx(me,{mono:!0,children:W0(E.condition)}),t.jsx(me,{muted:!0,children:E.channels.length===0?t.jsx("span",{className:"text-[11px] text-fg-subtle",children:"dashboard only"}):t.jsxs(t.Fragment,{children:[E.channels.map((M,$)=>t.jsx(be,{variant:"outline",size:"xs",className:"mr-1",children:M.type},$)),t.jsxs("span",{className:"text-[11px] text-fg-subtle",children:["· cooldown ",E.cooldownMinutes,"m"]})]})}),t.jsx(me,{muted:!0,children:t.jsx(Kt,{value:E.lastFiredAt,emptyText:"never"})}),t.jsx(me,{align:"right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e&&t.jsx(Ki,{size:"sm",checked:E.enabled,label:E.enabled?"Disable alert":"Enable alert",disabled:o.isPending&&((T=o.variables)==null?void 0:T.id)===E.id,onChange:M=>o.mutate({id:E.id,input:{enabled:M}},{onError:$=>Y.error(ye($))})}),e&&t.jsx(V,{size:"icon-xs",variant:"ghost",title:"Send test notification","aria-label":"Send test notification",loading:d.isPending&&d.variables===E.id,onClick:()=>d.mutate(E.id,{onSuccess:M=>{var z,B;const $=((z=M.results)==null?void 0:z.filter(U=>!U.ok))??[];M.ok&&$.length===0?Y.success("Test notification sent",`${((B=M.results)==null?void 0:B.length)??0} channel(s) delivered`):Y.error("Some channels failed",$.map(U=>`${U.channel}: ${U.error??"error"}`).join("; "))},onError:M=>Y.error(ye(M))}),children:t.jsx(yN,{})}),e&&t.jsx(V,{size:"icon-xs",variant:"ghost",title:"Edit","aria-label":"Edit alert",onClick:()=>m({alert:E}),children:t.jsx(Po,{})}),e&&t.jsx(V,{size:"icon-xs",variant:"ghost",title:"Delete","aria-label":"Delete alert",className:"hover:text-danger",onClick:()=>p(E),children:t.jsx(us,{})})]})})]},E.id)})]})]})}),t.jsxs("section",{className:"mt-6",children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[t.jsx("h2",{className:"text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:"Events"}),t.jsx(ut,{"aria-label":"Filter events by alert",className:"!h-7 !w-auto text-xs",value:v,onChange:E=>j(E.target.value),options:[{value:"",label:"All alerts"},...k.map(E=>({value:E.id,label:E.name}))]})]}),t.jsx("div",{className:"card overflow-hidden",children:t.jsxs(os,{dense:!0,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{className:"w-28",children:"When"}),t.jsx(fe,{className:"w-28",children:"Status"}),t.jsx(fe,{children:"Alert"}),t.jsx(fe,{children:"Queue"}),t.jsx(fe,{children:"Message"}),t.jsx(fe,{align:"right",children:"Value"})]})}),t.jsxs("tbody",{children:[C.isLoading&&t.jsx(xt,{colSpan:6,children:t.jsx(Dt,{})}),C.data&&C.data.length===0&&t.jsx(xt,{colSpan:6,children:"No events yet"}),(O=C.data)==null?void 0:O.map(E=>t.jsxs("tr",{children:[t.jsx(me,{muted:!0,children:t.jsx(Kt,{value:E.createdAt})}),t.jsx(me,{children:t.jsx(be,{variant:i_[E.status],size:"xs",dot:!0,children:E.status.replace("_"," ")})}),t.jsx(me,{className:"font-medium",children:E.alertName}),t.jsxs(me,{muted:!0,children:[y(E.connectionId),E.queueName&&t.jsxs("span",{className:"text-fg-subtle",children:[" / ",E.queueName]})]}),t.jsx(me,{className:"max-w-lg truncate",title:E.message,children:E.message}),t.jsx(me,{num:!0,align:"right",muted:!0,children:E.value!=null?W(E.value):"–"})]},E.id))]})]})})]}),h&&t.jsx(Qu,{open:!0,onClose:()=>m(null),alert:h.alert},((q=h.alert)==null?void 0:q.id)??"new"),t.jsx(tn,{open:!!g,onClose:()=>p(null),title:`Delete "${g==null?void 0:g.name}"`,description:"The alert and its history of events are removed.",confirmText:"Delete",danger:!0,loading:c.isPending,onConfirm:()=>g&&c.mutate(g.id,{onSuccess:()=>(p(null),Y.success("Alert deleted")),onError:E=>Y.error(ye(E))})})]})}function o_(e,n){const{has:r}=jt(),i=r("alerts"),o=im(i),c=Br(i&&r("folders")),d=N.useMemo(()=>{const h=o.data??[];if(h.length===0)return[];const m=c.data??[],g=new Map;for(const y of m)y.queues.some(b=>b.connectionId===e&&b.queueName===n)&&g.set(y.id,y.name);const p=[];for(const y of h)if(y.scope.type==="queue")y.scope.connectionId===e&&y.scope.queueName===n&&p.push({alert:y,via:{kind:"queue"}});else if(y.scope.type==="folder"){const b=g.get(y.scope.folderId);b!==void 0&&p.push({alert:y,via:{kind:"folder",folderId:y.scope.folderId,folderName:b}})}else y.scope.type==="connection"?y.scope.connectionId===e&&p.push({alert:y,via:{kind:"connection"}}):p.push({alert:y,via:{kind:"global"}});const v=y=>({global:0,connection:1,folder:2,queue:3})[y.via.kind],j=new Map;for(const y of p)y.alert.enabled&&j.set(y.alert.condition.kind,Math.max(j.get(y.alert.condition.kind)??-1,v(y)));const C=p.filter(y=>!y.alert.enabled||v(y)===j.get(y.alert.condition.kind));return p.length=0,p.push(...C),p.sort((y,b)=>Number(b.alert.firing)-Number(y.alert.firing)||Number(b.alert.enabled)-Number(y.alert.enabled)||y.alert.name.localeCompare(b.alert.name))},[o.data,c.data,e,n]);return{matches:d,firing:d.filter(h=>h.alert.firing).length,enabled:i}}function c_({matches:e,firing:n}){if(e.length===0)return null;const r=`${e.length} alert${e.length===1?"":"s"}`;return t.jsx(_e,{content:n>0?`${n} of ${e.length} firing right now`:"Watching this queue",children:t.jsxs(Re,{to:oe.alerts,className:F("inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[11px] font-medium transition-colors",n>0?"border-danger/40 bg-danger/10 text-danger hover:bg-danger/20":"border-border text-fg-muted hover:bg-surface-hover hover:text-fg"),children:[n>0?t.jsx(Qf,{className:"size-3"}):t.jsx(Gi,{className:"size-3"}),n>0?`${n} firing`:r]})})}function u_({connectionId:e,queueName:n,matches:r,onCreate:i}){const{isOperator:o}=yt(),[c,d]=N.useState(null);return r.length===0?null:t.jsxs("section",{className:"rounded-md border border-border bg-surface","aria-label":"Alerts watching this queue",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[t.jsx(Gi,{className:"size-3.5 text-fg-muted"}),t.jsx("h2",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-muted",children:"Alerts on this queue"}),t.jsx("span",{className:"text-[11px] text-fg-subtle",children:r.length}),t.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[t.jsx(Re,{to:oe.alerts,className:"text-[11px] text-accent hover:underline",children:"Manage all"}),o&&t.jsx(V,{size:"xs",variant:"ghost",leftIcon:t.jsx(Kn,{}),onClick:i,children:"Add"})]})]}),t.jsx("ul",{className:"divide-y divide-border",children:r.map(({alert:h,via:m})=>t.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-[12px]",children:[t.jsx("span",{className:"shrink-0",children:h.firing?t.jsxs(be,{variant:"danger",className:"gap-1",children:[t.jsx(Qf,{className:"size-3"})," firing"]}):h.enabled?t.jsx(be,{variant:"success",children:"ok"}):t.jsx(be,{variant:"neutral",children:"off"})}),t.jsx("span",{className:F("font-medium",!h.enabled&&"text-fg-muted"),children:h.name}),t.jsx("span",{className:"font-mono text-[11px] text-fg-muted",children:W0(h.condition)}),(m.kind==="connection"||m.kind==="global")&&t.jsx("span",{className:"rounded border border-border px-1 text-[10px] text-fg-muted",children:m.kind==="global"?"every queue":"whole connection"}),m.kind==="folder"&&t.jsx(_e,{content:"This alert watches every queue in the folder",children:t.jsxs(Re,{to:oe.folder(m.folderId),className:"rounded border border-border px-1 text-[10px] text-fg-muted hover:text-fg",children:["via folder ",m.folderName]})}),t.jsxs("span",{className:"ml-auto flex items-center gap-3 text-[11px] text-fg-subtle",children:[t.jsx("span",{children:h.lastFiredAt?t.jsxs(t.Fragment,{children:["last fired ",t.jsx(Kt,{value:h.lastFiredAt})]}):"never fired"}),o&&t.jsx("button",{type:"button",className:"text-fg-muted hover:text-fg",onClick:()=>d(h),title:"Edit alert","aria-label":`Edit ${h.name}`,children:t.jsx(Po,{className:"size-3.5"})})]})]},h.id))}),c&&t.jsx(Qu,{open:!0,onClose:()=>d(null),alert:c}),t.jsx("span",{className:"sr-only",children:`Alerts watching ${n} on connection ${e}`})]})}function d_({connectionId:e,queue:n,value:r,onChange:i,disabled:o,className:c}){var q;const d=x0(e,n,{page:1,pageSize:200}),[h,m]=N.useState(!1),[g,p]=N.useState(""),[v,j]=N.useState(0),C=N.useRef(null),y=N.useRef(null),b=N.useId(),k=((q=d.data)==null?void 0:q.groups)??[],S=N.useMemo(()=>{const E=g.trim().toLowerCase(),T=k.filter(z=>!E||z.id.toLowerCase().includes(E)).slice(0,100),M=E&&k.some(z=>z.id.toLowerCase()===E),$=[];return E||$.push({id:"",label:"All groups"}),$.push(...T.map(z=>({id:z.id,label:z.id,waiting:z.waiting}))),E&&!M&&$.push({id:g.trim(),label:`Use "${g.trim()}"`,custom:!0}),$},[k,g]);N.useEffect(()=>j(0),[g,h]),N.useEffect(()=>{if(!h)return;const E=T=>{var M;(M=y.current)!=null&&M.contains(T.target)||m(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[h]);const O=E=>{i(E),m(!1),p("")};return t.jsxs("div",{ref:y,className:F("relative",c),children:[t.jsxs("div",{className:F("control flex !h-7 !w-auto min-w-44 items-center gap-1.5 !px-2 text-xs",o&&"cursor-not-allowed opacity-50",r&&"border-pro/60"),children:[t.jsx(Mu,{className:"size-3.5 shrink-0 text-pro","aria-hidden":!0}),h?t.jsx("input",{ref:C,autoFocus:!0,role:"combobox","aria-expanded":h,"aria-controls":b,"aria-autocomplete":"list","aria-label":"Filter by group",className:"min-w-0 flex-1 bg-transparent font-mono outline-none placeholder:font-sans placeholder:text-fg-subtle",placeholder:"Type a group id…",value:g,onChange:E=>p(E.target.value),onKeyDown:E=>{E.key==="ArrowDown"?(E.preventDefault(),j(T=>Math.min(S.length-1,T+1))):E.key==="ArrowUp"?(E.preventDefault(),j(T=>Math.max(0,T-1))):E.key==="Enter"?(E.preventDefault(),S[v]&&O(S[v].id)):E.key==="Escape"&&(E.preventDefault(),m(!1),p(""))}}):t.jsx("button",{type:"button",disabled:o,className:"flex min-w-0 flex-1 items-center gap-1 text-left",onClick:()=>m(!0),"aria-haspopup":"listbox","aria-expanded":h,title:r?`Showing group ${r}`:"Filter jobs by group",children:r?t.jsx("span",{className:"truncate font-mono text-fg",children:r}):t.jsxs("span",{className:"truncate text-fg-muted",children:["All groups",d.data?t.jsxs("span",{className:"num text-fg-subtle",children:[" · ",mt(d.data.total)]}):null]})}),r&&!o?t.jsx("button",{type:"button",className:"rounded p-0.5 text-fg-subtle hover:text-fg","aria-label":"Clear group filter",onClick:()=>O(""),children:t.jsx(mn,{className:"size-3"})}):t.jsx(cs,{className:"size-3.5 shrink-0 text-fg-subtle","aria-hidden":!0})]}),h&&t.jsxs("ul",{id:b,role:"listbox",className:"absolute left-0 z-40 mt-1 max-h-64 w-72 overflow-auto rounded-md border border-border bg-surface p-1 text-xs shadow-[var(--shadow)]",children:[d.isLoading&&t.jsx("li",{className:"px-2 py-1.5 text-fg-subtle",children:"Loading groups…"}),!d.isLoading&&S.length===0&&t.jsx("li",{className:"px-2 py-1.5 text-fg-subtle",children:"No groups"}),S.map((E,T)=>{const M=E.id===r;return t.jsxs("li",{role:"option","aria-selected":M,className:F("flex cursor-pointer items-center gap-2 rounded px-2 py-1",T===v?"bg-surface-3 text-fg":"text-fg-muted hover:bg-surface-2 hover:text-fg"),onMouseEnter:()=>j(T),onMouseDown:$=>$.preventDefault(),onClick:()=>O(E.id),children:[t.jsx("span",{className:F("min-w-0 flex-1 truncate",E.id&&!E.custom&&"font-mono"),children:E.label}),E.waiting!=null&&t.jsxs("span",{className:"num text-[10px] text-fg-subtle",children:[mt(E.waiting)," waiting"]}),M&&t.jsx(Qr,{className:"size-3.5 text-accent","aria-hidden":!0})]},E.custom?`custom:${E.id}`:E.id||"__all__")}),d.data&&d.data.total>k.length&&t.jsxs("li",{className:"border-t border-border px-2 py-1 text-[10px] text-fg-subtle",children:["Showing the first ",k.length," of ",mt(d.data.total)," groups — type an id to filter or use it directly."]})]})]})}const h_={retry:"retried",promote:"promoted",remove:"removed",discard:"discarded"};function Z0(e,n,r){return n==="promote"&&(r==null?void 0:r.mode)==="ran_copy"?`Job ${e} belongs to scheduler "${r.schedulerId}": ran a copy (${r.jobId}) now, the next scheduled run is unchanged`:n==="promote"&&(r==null?void 0:r.mode)==="skipped_next"?`Job ${e} promoted: scheduler "${r.schedulerId}" skips the run it was scheduled for`:`Job ${e} ${h_[n]}`}const f_=[{mode:"run_copy",title:"Run a copy now",detail:e=>`A one-off copy runs now. The scheduled run at ${e} still happens.`},{mode:"skip_next",title:"Promote and skip the next run",detail:e=>`The run scheduled for ${e} runs now instead. Nothing runs at ${e}; the scheduler continues with the run after it.`}];function G0({job:e,onClose:n,onPick:r,pending:i}){const o=e!=null&&e.delayedUntil?fn(e.delayedUntil):"its scheduled time";return t.jsx(Sn,{open:e!==null,onClose:n,size:"md",title:"Promote a scheduled job",description:e?t.jsxs(t.Fragment,{children:["Job ",t.jsx("span",{className:"font-mono",children:e.id})," is the next run of scheduler"," ",t.jsx("span",{className:"font-mono",children:e.repeatJobKey}),"."]}):void 0,footer:t.jsx(V,{variant:"ghost",size:"sm",onClick:n,disabled:!!i,children:"Cancel"}),children:t.jsx("div",{className:"flex flex-col gap-2",children:f_.map(c=>t.jsxs("button",{type:"button",disabled:!!i,onClick:()=>r(c.mode),className:"rounded-md border border-border bg-surface-2 px-3 py-2.5 text-left transition-colors hover:border-border-strong hover:bg-surface-3 disabled:opacity-60",children:[t.jsxs("span",{className:"block text-sm font-medium text-fg",children:[c.title,i===c.mode&&"…"]}),t.jsx("span",{className:"mt-0.5 block text-xs text-fg-muted",children:c.detail(o)})]},c.mode))})})}function m_(e){return!!e&&io.includes(e)}function Fh({view:e="jobs"}={}){var il,$o,Ua,Qa,Ba,Va,Ha,Rs,Ms,ll,ol,cl,ul,dl,Ka,hl,sr,Wa,rr,zo,ar,Wr,Zr,Za,Ao;const{connectionId:n="",queue:r=""}=zn(),[i,o]=ko(),c=sn(),{isOperator:d,isAdmin:h}=yt(),m=m_(i.get("state"))?i.get("state"):"waiting",g=Math.max(1,Number(i.get("page")??1)||1),p=[25,50,100,200].includes(Number(i.get("pageSize")))?Number(i.get("pageSize")):25,v=i.get("order")==="asc"?"asc":"desc",j=i.get("q")??"",C=i.get("group")??"",[y,b]=N.useState(j),k=N.useCallback(le=>{o(it=>{const Ue=new URLSearchParams(it);for(const[Bt,Ga]of Object.entries(le))Ga==null||Ga===""?Ue.delete(Bt):Ue.set(Bt,Ga);return Ue},{replace:!0})},[o]),S=f0(n,r),O=o_(n,r),q=hm(n),E=!!S.data&&(S.data.isPro||S.data.groupsCount>0),T=j.trim().length>0,M=!T&&!!C,$=e==="metrics",z=e==="schedulers",B=$||z,U=m0(n,r,{state:m,page:g,pageSize:p,order:v,groupId:M?C:void 0},{enabled:!T&&!B}),J=Zk(n,r,{state:m,q:j.trim(),limit:50},{enabled:T&&!B}),we=am(n,r),Te=p0(n,r),Ze=Xk(n,r),Ge=((il=J.data)==null?void 0:il.pages)??[],rt=Ge.flatMap(le=>le.jobs),Qe=Ge.reduce((le,it)=>le+(it.scanned??0),0),K=Ge.reduce((le,it)=>le+(it.skippedLargePayloads??0),0),ue=Ge.length?Ge[Ge.length-1].total:((Ua=($o=S.data)==null?void 0:$o.counts)==null?void 0:Ua[m])??0,se=T?rt:((Qa=U.data)==null?void 0:Qa.jobs)??[],A=N.useMemo(()=>se.map(le=>le.id),[se]),H=iC(A),[Ie,Ae]=N.useState(null),[Ne,Le]=N.useState(null),[st,Je]=N.useState(null),[at,Qt]=N.useState(null),[er,$a]=N.useState(null),[Jn,zt]=N.useState(null),[Io,za]=N.useState(!1),Cn=i.get("confirm");N.useEffect(()=>{if(Cn!=="drain"&&Cn!=="clean"&&Cn!=="obliterate")return;(Cn==="clean"?d:h)?zt(Cn):Y.error(`${Cn==="clean"?"Cleaning":Cn==="drain"?"Draining":"Obliterating"} a queue needs the ${Cn==="clean"?"operator":"admin"} role`),o(it=>{const Ue=new URLSearchParams(it);return Ue.delete("confirm"),Ue},{replace:!0})},[Cn,h,d,o]);const{has:qo,gate:Aa}=jt(),[tr,xn]=N.useState(!1),Vr=N.useRef(null),La=N.useCallback(()=>{var le,it;(le=Vr.current)==null||le.focus(),(it=Vr.current)==null||it.select()},[]);o0("/",le=>{le.preventDefault(),La()}),N.useEffect(()=>{if(i.get("search")!=="1")return;const le=window.setTimeout(La,0);return k({search:null}),()=>window.clearTimeout(le)},[i,k,La]),N.useEffect(()=>b(j),[j]);const an=(Ba=S.data)==null?void 0:Ba.counts,Oo=N.useMemo(()=>{var it,Ue;const le=[{value:"metrics",label:"Metrics",icon:t.jsx(Bf,{className:"size-3.5"})},{value:"schedulers",label:"Schedulers",count:((it=S.data)==null?void 0:it.schedulersCount)??null,icon:t.jsx(Co,{className:"size-3.5"})},...io.map(Bt=>({value:Bt,label:ot[Bt].label,count:(an==null?void 0:an[Bt])??null,tone:ot[Bt].dotClass}))];return(Ue=S.data)!=null&&Ue.isPro&&le.push({value:"groups",label:"Groups",count:S.data.groupsCount,icon:t.jsx(Mu,{className:"size-3.5 text-pro"})}),le},[an,(Va=S.data)==null?void 0:Va.isPro,(Ha=S.data)==null?void 0:Ha.groupsCount,(Rs=S.data)==null?void 0:Rs.schedulersCount]),Fa=(le,it,Ue)=>{we.mutate({jobId:le,action:it,scheduler:Ue},{onSuccess:Bt=>{Y.success(Z0(le,it,Bt)),$a(null)},onError:Bt=>Y.error(ye(Bt))})},Da=(le,it,Ue)=>{if(it==="remove"){Qt(le);return}if(it==="promote"&&(Ue!=null&&Ue.repeatJobKey)){$a({id:Ue.id,repeatJobKey:Ue.repeatJobKey,delayedUntil:Ue.delayedUntil});return}Fa(le,it)},Hr=N.useMemo(()=>F0(T?"mixed":m),[T,m]),al=le=>{const it=H.selectedIds;if(it.length!==0){if(it.length>ju){Y.error(`Select at most ${W(ju)} jobs per action (${W(it.length)} selected).`);return}Le(le),Ze.mutate({action:le,jobIds:it},{onSuccess:Ue=>{Ae(Ue),H.deselect(Ue.ok);const Bt=le==="retry"?"retried":le==="promote"?"promoted":"removed";Ue.failed.length===0?Y.success(`${W(Ue.ok.length)} ${Bt}`):Y.error(`${W(Ue.ok.length)} ${Bt} · ${W(Ue.failed.length)} failed`)},onError:Ue=>Y.error(ye(Ue)),onSettled:()=>{Le(null),Je(null)}})}},nr=le=>{le==="remove"?Je("remove"):al(le)},Xn=(le,it)=>Te.mutate(le,{onSuccess:()=>{Y.success(it),zt(null),le.action==="obliterate"&&c(oe.connection(n))},onError:Ue=>Y.error(ye(Ue))}),Bu=()=>k({q:y.trim()||null,page:null}),Kr=()=>{b(""),k({q:null,page:null})};return t.jsxs(vt,{wide:!0,children:[t.jsxs("div",{className:"mb-3 flex flex-wrap items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"truncate font-mono text-lg font-semibold tracking-tight",children:r}),((Ms=S.data)==null?void 0:Ms.isPaused)&&t.jsx(be,{variant:"warning",dot:!0,className:"tracking-wider",children:"PAUSED"}),((ll=S.data)==null?void 0:ll.isPro)&&t.jsx(be,{variant:"pro",title:"BullMQ Pro groups detected",className:"tracking-wider",children:"PRO"}),S.isError&&t.jsx(be,{variant:"danger",children:"unreachable"})]}),t.jsxs("p",{className:"mt-0.5 flex items-center gap-3 text-xs text-fg-muted",children:[t.jsxs("span",{className:"font-mono",children:[((ol=S.data)==null?void 0:ol.prefix)??"bull",":",r]}),((cl=S.data)==null?void 0:cl.metrics)&&S.data.metrics.completed.length>1&&t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{style:{color:ot.completed.fg},children:t.jsx(Wi,{values:S.data.metrics.completed,width:72,height:16,title:"Completed per minute"})}),t.jsx("span",{style:{color:ot.failed.fg},children:t.jsx(Wi,{values:S.data.metrics.failed,width:72,height:16,title:"Failed per minute"})})]}),t.jsx(c_,{matches:O.matches,firing:O.firing})]})]}),d&&t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(V,{size:"sm",variant:"primary",leftIcon:t.jsx(Kn,{}),onClick:()=>zt("add"),children:"Add job"}),t.jsx(V,{size:"sm",leftIcon:t.jsx(Gi,{}),onClick:()=>Aa("alerts",()=>za(!0)),title:"Alert on this queue",children:"Create alert"}),t.jsx(V,{size:"sm",leftIcon:(ul=S.data)!=null&&ul.isPaused?t.jsx(Hf,{}):t.jsx(el,{}),loading:Te.isPending&&(((dl=Te.variables)==null?void 0:dl.action)==="pause"||((Ka=Te.variables)==null?void 0:Ka.action)==="resume"),onClick:()=>{var le;return(le=S.data)!=null&&le.isPaused?Xn({action:"resume"},"Queue resumed"):zt("pause")},children:(hl=S.data)!=null&&hl.isPaused?"Resume":"Pause"}),t.jsx(V,{size:"sm",leftIcon:t.jsx(Tu,{}),onClick:()=>zt("retryAll"),disabled:!an||an.failed===0,children:"Retry all failed"}),t.jsxs("div",{className:"relative",children:[t.jsx(V,{size:"sm",variant:"secondary",rightIcon:t.jsx(cs,{}),"aria-haspopup":"menu","aria-expanded":tr,onClick:()=>xn(le=>!le),children:"More"}),tr&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-30",onClick:()=>xn(!1),"aria-hidden":!0}),t.jsxs("div",{role:"menu",className:"absolute right-0 z-40 mt-1 w-56 rounded-lg border border-border bg-surface p-1 shadow-[var(--shadow)]",children:[t.jsx(Wc,{icon:t.jsx(iN,{}),label:"Clean…",hint:"remove by state and age",onClick:()=>(xn(!1),zt("clean"))}),h&&t.jsxs(Re,{role:"menuitem",to:oe.audit({connectionId:n,queueName:r}),onClick:()=>xn(!1),className:"nav-item w-full text-left",children:[t.jsx(Eo,{className:"size-3.5 shrink-0","aria-hidden":!0}),t.jsxs("span",{className:"flex-1",children:["Audit this queue",t.jsx("span",{className:"block text-[10px] text-fg-subtle",children:"who paused, cleaned or drained it"})]})]}),d&&t.jsx(Wc,{icon:t.jsx(_o,{}),label:"Hide from the lists",hint:lS,onClick:()=>(xn(!1),q.hide(r))}),h&&t.jsx(Wc,{icon:t.jsx(us,{}),label:"Drain",hint:"remove all waiting jobs",onClick:()=>(xn(!1),zt("drain"))}),h&&t.jsx(Wc,{icon:t.jsx(lN,{}),label:"Obliterate…",hint:"deletes the queue and every job · permanent",danger:!0,onClick:()=>(xn(!1),zt("obliterate"))})]})]})]})]})]}),t.jsx(HC,{connectionId:n,queue:r,className:"mb-3"}),t.jsx("div",{className:"mb-3",children:t.jsx(u_,{connectionId:n,queueName:r,matches:O.matches,onCreate:()=>Aa("alerts",()=>za(!0))})}),!B&&t.jsxs("form",{className:"mb-3 flex flex-wrap items-center gap-2",role:"search",onSubmit:le=>{le.preventDefault(),Bu()},children:[t.jsxs("div",{className:"relative min-w-72 flex-1",children:[t.jsx(Me,{ref:Vr,leftIcon:t.jsx(Hn,{}),placeholder:`Search job data, name, id or error in ${m}…`,"aria-label":"Search jobs",value:y,onChange:le=>b(le.target.value),onKeyDown:le=>{le.key==="Escape"&&(le.preventDefault(),Kr(),le.target.blur())},className:"!h-9 pr-16 text-[13px]"}),t.jsx("span",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-1",children:y||T?t.jsx("button",{type:"button",className:"rounded p-0.5 text-fg-subtle hover:text-fg","aria-label":"Clear search",onClick:Kr,children:t.jsx(mn,{className:"size-3.5"})}):t.jsx("span",{className:"hidden items-center gap-1 sm:flex",children:t.jsx(Vi,{children:"/"})})})]}),t.jsx(ut,{"aria-label":"State to search",className:"!h-9 !w-auto",value:m,onChange:le=>k({state:le.target.value,page:null,group:null}),options:io.map(le=>({value:le,label:`in ${ot[le].label}`}))}),t.jsx(V,{type:"submit",size:"md",variant:T?"secondary":"primary",leftIcon:t.jsx(Hn,{}),disabled:!y.trim()&&!T,children:"Search"}),t.jsx("span",{className:"hidden text-[11px] text-fg-subtle lg:inline",children:"Enter to search · Esc to clear · substring match, server-side"})]}),t.jsxs("div",{className:"mb-3 flex flex-wrap items-end gap-3 border-b border-border",children:[t.jsx("div",{className:F("min-w-0 flex-1 transition-opacity",!B&&(M||T)&&"opacity-50"),title:M&&!B?"Clear the group filter to browse by state":void 0,children:t.jsx(Cm,{"aria-label":"Job state",items:Oo,value:$?"metrics":z?"schedulers":m,onChange:le=>{le==="groups"?c(oe.groups(n,r)):le==="metrics"?c(oe.queueMetrics(n,r)):le==="schedulers"?c(`/c/${encodeURIComponent(n)}/q/${encodeURIComponent(r)}/schedulers`):B?c(oe.queue(n,r,le)):k({state:le,page:null,group:null})},className:"!border-b-0",size:"sm"})}),E&&!T&&!B&&t.jsxs("div",{className:"flex items-center gap-2 pb-1.5",children:[M&&t.jsxs("span",{className:"text-[11px] text-fg-muted",children:["showing group ",t.jsx("span",{className:"font-mono text-fg",children:C}),"'s waiting jobs"]}),t.jsx(d_,{connectionId:n,queue:r,value:C,onChange:le=>k({group:le||null,page:null})})]}),!T&&!B&&t.jsx(V,{size:"sm",variant:"ghost",className:"mb-1",leftIcon:t.jsx(Hw,{}),onClick:()=>k({order:v==="desc"?"asc":"desc"}),title:"Toggle order",children:v==="desc"?"Newest first":"Oldest first"})]}),z?t.jsx(GC,{connectionId:n,queue:r}):$?t.jsx(OC,{connectionId:n,queue:r,summary:S.data,onOpenState:le=>c(oe.queue(n,r,le))}):t.jsx("div",{className:"card overflow-hidden",children:T?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border bg-surface-2/50 px-3 py-2 text-xs",role:"status",children:[t.jsxs("span",{className:"flex items-center gap-2 text-fg-muted",children:[t.jsx(Hn,{className:"size-3.5 text-fg-subtle","aria-hidden":!0}),J.isFetching&&!J.isFetchingNextPage?t.jsx(Dt,{label:`Scanning ${m} jobs for "${j}"…`}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"num font-semibold text-fg",children:W(rt.length)})," ",rt.length===1?"match":"matches"," · scanned ",t.jsx("span",{className:"num text-fg",children:W(Math.min(Qe,ue))})," of"," ",t.jsx("span",{className:"num text-fg",children:W(ue)})," jobs in ",t.jsx("span",{className:ot[m].textClass,children:m}),!J.hasNextPage&&J.data&&t.jsx("span",{className:"text-fg-subtle",children:" · whole state scanned"}),K>0&&t.jsxs("span",{className:"text-fg-subtle",title:"Payloads above the search size cap are not read into Lua; those jobs still match on id, name and error.",children:[" ","· ",W(K)," ",K===1?"payload":"payloads"," too large to search inside"]})]})]}),t.jsxs("span",{className:"flex items-center gap-2",children:[J.hasNextPage&&t.jsx(V,{size:"sm",onClick:()=>J.fetchNextPage(),loading:J.isFetchingNextPage,children:"Scan more"}),t.jsx(V,{size:"sm",variant:"ghost",leftIcon:t.jsx(mn,{}),onClick:Kr,children:"Clear"})]})]}),Ie&&t.jsx(ov,{result:Ie,onDismiss:()=>Ae(null)}),d&&t.jsx(lv,{selection:H,state:"mixed",queue:r,actions:Hr,onRun:nr,pending:Ne,searching:!0}),t.jsx(Ef,{connectionId:n,queue:r,jobs:J.data?rt:void 0,loading:J.isLoading,error:J.error,emptyText:J.hasNextPage?"No matches yet — scan more to keep looking":`No ${m} job contains "${j}"`,canOperate:d,onAction:Da,pendingId:we.isPending?(sr=we.variables)==null?void 0:sr.jobId:null,showState:!1,showGroup:E,onGroupClick:le=>{Kr(),k({group:le,page:null})},highlight:j,selection:d?H:void 0}),t.jsxs("div",{className:"flex items-center justify-between border-t border-border px-3 py-2 text-xs text-fg-subtle",children:[t.jsx("span",{children:"Each scan reads a bounded slice of the state to keep Redis happy."}),J.hasNextPage&&t.jsx(V,{size:"sm",onClick:()=>J.fetchNextPage(),loading:J.isFetchingNextPage,children:"Scan more"})]})]}):t.jsxs(t.Fragment,{children:[m==="active"&&(((Wa=S.data)==null?void 0:Wa.stalledCount)??0)>0&&t.jsxs("div",{className:"flex items-start gap-2 border-b border-border bg-warning/10 px-3 py-2 text-xs",role:"status",children:[t.jsx(Zf,{className:"mt-0.5 size-3.5 shrink-0 text-warning","aria-hidden":!0}),t.jsxs("span",{children:[t.jsx("span",{className:"num font-semibold text-fg",children:W(((rr=S.data)==null?void 0:rr.stalledCount)??0)})," of these are stalled (worker lost the lock).",t.jsx("span",{className:"text-fg-muted",children:" BullMQ still reports them as active; the next stalled check moves them back to waiting and bumps their stall counter."})]})]}),Ie&&t.jsx(ov,{result:Ie,onDismiss:()=>Ae(null)}),d&&t.jsx(lv,{selection:H,state:m,queue:r,actions:Hr,onRun:nr,pending:Ne}),t.jsx(Ef,{connectionId:n,queue:r,jobs:(zo=U.data)==null?void 0:zo.jobs,loading:U.isLoading,error:U.error,emptyText:M?`No waiting jobs in group ${C}`:"No jobs in this state",canOperate:d,onAction:Da,pendingId:we.isPending?(ar=we.variables)==null?void 0:ar.jobId:null,showState:!1,showGroup:E,onGroupClick:le=>k({group:le,page:null}),selection:d?H:void 0}),t.jsx("div",{className:F("border-t border-border px-3 py-2",U.isFetching&&"opacity-80"),children:t.jsx(Uu,{page:g,pageSize:p,total:((Wr=U.data)==null?void 0:Wr.total)??(M?0:(an==null?void 0:an[m])??0),count:(Zr=U.data)==null?void 0:Zr.jobs.length,onPage:le=>k({page:String(le)}),onPageSize:le=>k({pageSize:String(le),page:null})})})]})}),d&&t.jsx(UC,{open:Jn==="add",onClose:()=>zt(null),connectionId:n,queue:r}),d&&qo("alerts")&&Io&&t.jsx(Qu,{open:!0,onClose:()=>za(!1),alert:null,initialScope:{type:"queue",connectionId:n,queueName:r}}),d&&t.jsx(VC,{open:Jn==="clean",onClose:()=>zt(null),connectionId:n,queue:r,defaultState:m==="waiting"?"wait":m==="waiting-children"?"completed":m}),t.jsx(tn,{open:st==="remove",onClose:()=>Je(null),title:"Remove selected jobs",description:`Remove ${W(H.selectedIds.length)} ${H.selectedIds.length===1?"job":"jobs"} from ${r}? This cannot be undone.`,confirmText:`Remove ${W(H.selectedIds.length)}`,danger:!0,loading:Ne==="remove",onConfirm:()=>al("remove")}),t.jsx(tn,{open:at!==null,onClose:()=>Qt(null),title:"Remove job",description:`Remove job ${at??""} from ${r}? This cannot be undone.`,confirmText:"Remove",danger:!0,loading:we.isPending,onConfirm:()=>{at&&Fa(at,"remove"),Qt(null)}}),t.jsx(G0,{job:er,onClose:()=>$a(null),onPick:le=>er&&Fa(er.id,"promote",le),pending:we.isPending&&((Za=we.variables)==null?void 0:Za.action)==="promote"?we.variables.scheduler??null:null}),t.jsx(z0,{queue:Jn==="pause"?r:null,onClose:()=>zt(null),loading:Te.isPending&&((Ao=Te.variables)==null?void 0:Ao.action)==="pause",onConfirm:le=>Xn({action:"pause",body:le?{reason:le}:{}},"Queue paused")}),t.jsx(tn,{open:Jn==="retryAll",onClose:()=>zt(null),title:"Retry all failed jobs",description:`Moves ${W((an==null?void 0:an.failed)??0)} failed jobs in ${r} back to waiting.`,confirmText:"Retry all",loading:Te.isPending,onConfirm:()=>Xn({action:"retry-all",body:{state:"failed"}},"Retrying all failed jobs")}),t.jsx(tn,{open:Jn==="drain",onClose:()=>zt(null),title:"Drain queue",description:`Removes every waiting and prioritized job in ${r}. Active, completed and failed jobs are kept.`,confirmText:"Drain",danger:!0,loading:Te.isPending,onConfirm:()=>Xn({action:"drain",body:{includeDelayed:!1}},"Queue drained")}),t.jsx(tn,{open:Jn==="obliterate",onClose:()=>zt(null),title:"Obliterate queue",description:"Deletes every key of this queue from Redis, including completed and failed history. This cannot be undone.",confirmText:"Obliterate",danger:!0,typeToConfirm:r,loading:Te.isPending,onConfirm:()=>Xn({action:"obliterate"},`${r} obliterated`)})]})}function Wc({icon:e,label:n,hint:r,danger:i,onClick:o}){return t.jsxs("button",{role:"menuitem",type:"button",onClick:o,className:F("nav-item h-auto w-full py-1.5 text-left [&_svg]:size-3.5",i&&"text-danger hover:text-danger"),children:[e,t.jsxs("span",{className:"flex flex-col",children:[t.jsx("span",{className:F(!i&&"text-fg"),children:n}),r&&t.jsx("span",{className:"text-[11px] text-fg-subtle",children:r})]})]})}function J0({value:e,defaultExpandDepth:n=2,className:r,name:i}){return t.jsx("div",{className:F("font-mono text-xs leading-[1.6] text-fg",r),children:t.jsx(Y0,{name:i,value:e,depth:0,expandDepth:n,last:!0})})}function X0(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";const n=typeof e;return n==="object"?"object":n==="string"?"string":n==="number"||n==="bigint"?"number":n==="boolean"?"boolean":"other"}const Zc=200;function p_({value:e}){const[n,r]=N.useState(!1);switch(X0(e)){case"string":{const o=e,d=!n&&o.length>Zc?`${o.slice(0,Zc)}…`:o;return t.jsxs("span",{className:"text-success break-all",children:['"',d,'"',o.length>Zc&&t.jsx("button",{type:"button",className:"ml-1 rounded bg-surface-3 px-1 text-[10px] text-fg-muted hover:text-fg",onClick:()=>r(h=>!h),children:n?"less":`+${o.length-Zc} chars`})]})}case"number":return t.jsx("span",{className:"text-info",children:String(e)});case"boolean":return t.jsx("span",{className:"text-violet",children:String(e)});case"null":return t.jsx("span",{className:"text-fg-subtle",children:"null"});case"undefined":return t.jsx("span",{className:"text-fg-subtle",children:"undefined"});default:return t.jsx("span",{className:"text-fg-muted",children:String(e)})}}function Y0({name:e,value:n,depth:r,expandDepth:i,last:o}){const c=X0(n),d=c==="object"||c==="array",[h,m]=N.useState(r<i),g=e!==void 0?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-fg",children:x_(e)?e:JSON.stringify(e)}),t.jsx("span",{className:"text-fg-subtle",children:": "})]}):null;if(!d)return t.jsxs("div",{className:"flex",style:{paddingLeft:r?16:0},children:[t.jsx("span",{className:"w-4 shrink-0"}),t.jsxs("span",{className:"min-w-0",children:[g,t.jsx(p_,{value:n}),!o&&t.jsx("span",{className:"text-fg-subtle",children:","})]})]});const p=c==="array"?n.map((y,b)=>[String(b),y]):Object.entries(n),[v,j]=c==="array"?["[","]"]:["{","}"],C=c==="array"?`${p.length} item${p.length===1?"":"s"}`:`${p.length} key${p.length===1?"":"s"}`;return p.length===0?t.jsxs("div",{className:"flex",style:{paddingLeft:r?16:0},children:[t.jsx("span",{className:"w-4 shrink-0"}),t.jsxs("span",{children:[g,t.jsxs("span",{className:"text-fg-muted",children:[v,j]}),!o&&t.jsx("span",{className:"text-fg-subtle",children:","})]})]}):t.jsxs("div",{style:{paddingLeft:r?16:0},children:[t.jsxs("div",{className:"flex",children:[t.jsx("button",{type:"button","aria-expanded":h,"aria-label":h?"Collapse":"Expand",onClick:()=>m(y=>!y),className:"flex w-4 shrink-0 items-start justify-center pt-[3px] text-fg-subtle hover:text-fg",children:h?t.jsx(cs,{className:"size-3"}):t.jsx(Wn,{className:"size-3"})}),t.jsxs("span",{className:"min-w-0 cursor-default",onClick:()=>!h&&m(!0),children:[g,t.jsx("span",{className:"text-fg-muted",children:v}),!h&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1 rounded bg-surface-3 px-1 text-[10px] text-fg-subtle",children:C}),t.jsx("span",{className:"text-fg-muted",children:j}),!o&&t.jsx("span",{className:"text-fg-subtle",children:","})]})]})]}),h&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"border-l border-border/70",style:{marginLeft:7},children:p.map(([y,b],k)=>t.jsx(Y0,{name:c==="array"?void 0:y,value:b,depth:r+1,expandDepth:i,last:k===p.length-1},y))}),t.jsxs("div",{className:"flex",children:[t.jsx("span",{className:"w-4 shrink-0"}),t.jsxs("span",{className:"text-fg-muted",children:[j,!o&&t.jsx("span",{className:"text-fg-subtle",children:","})]})]})]})]})}function x_(e){return/^[A-Za-z_$][\w$]*$/.test(e)}function g_(){var E,T,M,$,z;const{connectionId:e="",queue:n="",jobId:r=""}=zn(),i=sn(),{has:o}=jt(),{isOperator:c,isAdmin:d}=yt(),h=Gk(e,n,r),m=am(e,n),[g,p]=N.useState("data"),[v,j]=N.useState(null),[C,y]=N.useState(!1),b=(B,U)=>m.mutate({jobId:r,action:B,scheduler:U},{onSuccess:J=>{Y.success(Z0(r,B,J)),j(null),y(!1),B==="remove"&&i(oe.queue(e,n))},onError:J=>Y.error(ye(J))});if(h.isLoading)return t.jsx(vt,{children:t.jsx(tl,{label:"Loading job…"})});if(h.isError||!h.data){const B=Gs(h.error)&&h.error.status===404;return t.jsx(vt,{children:t.jsx(nn,{title:B?"Job not found":"Could not load job",description:B?"It may have been removed or cleaned since you opened it.":ye(h.error),action:t.jsxs(V,{variant:"secondary",leftIcon:t.jsx(iu,{}),onClick:()=>i(oe.queue(e,n)),children:["Back to ",n]})})})}const k=h.data,S=k.state==="failed"||k.state==="completed",O=k.state==="delayed",q=!!k.failedReason||(((E=k.stacktrace)==null?void 0:E.length)??0)>0;return t.jsxs(vt,{children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs(Re,{to:oe.queue(e,n,k.state!=="unknown"?k.state:void 0),className:"mb-1 inline-flex items-center gap-1 text-xs text-fg-muted hover:text-fg",children:[t.jsx(iu,{className:"size-3.5"})," ",n]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight",children:k.name}),t.jsx(T0,{state:k.state}),k.groupId&&t.jsx(Re,{to:oe.group(e,n,k.groupId),children:t.jsxs(be,{variant:"pro",mono:!0,title:"BullMQ Pro group",children:["group ",k.groupId]})}),k.priority>0&&t.jsxs(be,{variant:"violet",children:["priority ",k.priority]})]}),t.jsxs("p",{className:"mt-1 flex items-center gap-1 font-mono text-xs text-fg-muted",children:[t.jsx("span",{className:"select-all",children:k.id}),t.jsx(fo,{value:k.id,label:"Copy id",size:"icon-xs"}),t.jsx(fo,{value:()=>Nu(k),label:"Copy JSON",copiedLabel:"Copied JSON",showLabel:!0,size:"xs",icon:t.jsx(Sy,{}),className:"ml-1 font-sans"})]})]}),c&&t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S&&t.jsx(V,{size:"sm",leftIcon:t.jsx(Tu,{}),onClick:()=>b("retry"),loading:m.isPending&&((T=m.variables)==null?void 0:T.action)==="retry",children:"Retry"}),O&&t.jsx(V,{size:"sm",leftIcon:t.jsx(Uf,{}),onClick:()=>k.repeatJobKey?y(!0):b("promote"),loading:m.isPending&&((M=m.variables)==null?void 0:M.action)==="promote",children:"Promote"}),t.jsx(V,{size:"sm",variant:"ghost",leftIcon:t.jsx(Jw,{}),onClick:()=>j("discard"),title:"Mark as not retryable",children:"Discard"}),t.jsx(V,{size:"sm",variant:"ghost",className:"hover:text-danger",leftIcon:t.jsx(us,{}),onClick:()=>j("remove"),children:"Remove"})]})]}),t.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-3",children:[t.jsx("div",{className:"card p-4 lg:col-span-2",children:t.jsx(j_,{job:k})}),t.jsxs("dl",{className:"card grid grid-cols-2 gap-x-4 gap-y-3 p-4 text-xs",children:[t.jsx(ca,{label:"Attempts",children:t.jsxs("span",{className:F(k.attemptsMade>1&&"text-warning"),children:[k.attemptsMade,k.attempts!=null&&t.jsxs("span",{className:"text-fg-subtle",children:[" / ",k.attempts]})]})}),k.state==="delayed"?t.jsx(ca,{label:"Runs at",children:t.jsx(v_,{at:k.delayedUntil})}):t.jsx(ca,{label:"Delay",children:k.delay?qn(k.delay):"–"}),t.jsx(ca,{label:"Priority",children:k.priority||"–"}),t.jsx(ca,{label:"Progress",children:t.jsx(y_,{value:k.progress})}),t.jsx(ca,{label:"Parent",children:k.parent?t.jsxs(Re,{to:oe.job(e,Kg(k.parent.queueKey),k.parent.id),className:"inline-flex items-center gap-1 font-mono text-accent hover:underline",children:[t.jsx(cN,{className:"size-3"}),k.parent.queue||Kg(k.parent.queueKey),"/",k.parent.id]}):"–"}),t.jsx(ca,{label:"Children",children:k.dependencies?t.jsxs("span",{children:[t.jsx("span",{className:"text-success",children:W(k.dependencies.processed)})," done ·"," ",t.jsx("span",{className:F(k.dependencies.unprocessed>0&&"text-teal"),children:W(k.dependencies.unprocessed)})," pending"]}):"–"})]}),(k.parent||k.dependencies)&&t.jsx("div",{className:"mt-3 border-t border-border pt-3",children:t.jsxs(Re,{to:oe.jobTree(e,n,k.id),className:"inline-flex items-center gap-1.5 text-[13px] text-accent hover:underline",children:[t.jsx(gN,{className:"size-3.5","aria-hidden":!0}),"View flow tree"]})})]}),t.jsx(Cm,{"aria-label":"Job details",size:"sm",className:"mb-3",value:g,onChange:p,items:[{value:"data",label:"Data"},{value:"opts",label:"Options",count:Object.keys(k.opts??{}).length},{value:"returnvalue",label:"Return value"},{value:"error",label:"Error",tone:q?"bg-danger":void 0},{value:"logs",label:"Logs",count:k.logsCount??(($=k.logs)==null?void 0:$.length)??0},...d&&o("audit")?[{value:"audit",label:"Audit"}]:[]]}),g==="data"&&t.jsx(Dh,{value:k.data,empty:"No data"}),g==="opts"&&t.jsx(Dh,{value:k.opts,empty:"No options"}),g==="returnvalue"&&t.jsx(Dh,{value:k.returnvalue,empty:"No return value (job has not completed)"}),g==="error"&&t.jsx(b_,{job:k}),g==="logs"&&t.jsx(w_,{connectionId:e,queue:n,jobId:r,initial:k.logs,total:k.logsCount}),g==="audit"&&t.jsx(N_,{connectionId:e,queue:n,jobId:r}),t.jsx(G0,{job:C&&k.repeatJobKey?{id:k.id,repeatJobKey:k.repeatJobKey,delayedUntil:k.delayedUntil}:null,onClose:()=>y(!1),onPick:B=>b("promote",B),pending:m.isPending&&((z=m.variables)==null?void 0:z.action)==="promote"?m.variables.scheduler??null:null}),t.jsx(tn,{open:v==="remove",onClose:()=>j(null),title:"Remove job",description:`Job ${r} will be deleted from ${n}. Active jobs cannot be removed while locked.`,confirmText:"Remove",danger:!0,loading:m.isPending,onConfirm:()=>b("remove")}),t.jsx(tn,{open:v==="discard",onClose:()=>j(null),title:"Discard job",description:"Marks the job as not retryable: attemptsMade is set to the max so backoff retries stop. The job itself is kept.",confirmText:"Discard",loading:m.isPending,onConfirm:()=>b("discard")})]})}function ca({label:e,children:n}){return t.jsxs("div",{className:"min-w-0",children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:e}),t.jsx("dd",{className:"num truncate text-[13px] text-fg",children:n})]})}function v_({at:e}){return e?t.jsxs("span",{className:"flex flex-col leading-tight",children:[t.jsx(Kt,{value:e}),t.jsx("span",{className:"font-mono text-[10px] text-fg-subtle",children:kf(e)})]}):t.jsx(t.Fragment,{children:"–"})}function y_({value:e}){if(e==null)return t.jsx(t.Fragment,{children:"–"});if(typeof e=="number"){const n=Math.max(0,Math.min(100,e));return t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"h-1.5 w-16 overflow-hidden rounded bg-surface-3",children:t.jsx("span",{className:"block h-full bg-accent",style:{width:`${n}%`}})}),t.jsxs("span",{children:[n,"%"]})]})}return t.jsx("span",{className:"font-mono text-[11px]",title:Nu(e),children:Nu(e,0).slice(0,40)})}function j_({job:e}){var g;const n=To(1e3),r=e.timestamp,i=e.processedOn,o=e.finishedOn,c=i?i-r:e.state==="waiting"||e.state==="delayed"||e.state==="prioritized"?n-r:null,d=i?o??(e.state==="active"?n:null):null,h=i&&d?d-i:null,m=[{label:"Created",ts:r,tone:"bg-info"},{label:"Processed",ts:i,tone:"bg-accent"},{label:o&&e.state==="failed"?"Failed":"Finished",ts:o,tone:e.state==="failed"?"bg-danger":"bg-success"}];return t.jsxs("div",{children:[t.jsx("h2",{className:"mb-3 text-[10px] font-semibold tracking-wider text-fg-subtle uppercase",children:"Timeline"}),t.jsxs("ol",{className:"relative flex items-start justify-between gap-2",children:[t.jsx("span",{className:"absolute top-[7px] right-4 left-4 -z-0 h-px bg-border","aria-hidden":!0}),m.map((p,v)=>t.jsxs("li",{className:F("relative z-[1] flex flex-1 flex-col",v===1?"items-center text-center":v===2?"items-end text-right":"items-start"),children:[t.jsx("span",{className:F("status-dot size-3.5 ring-4 ring-surface",p.ts?p.tone:"bg-surface-3",!p.ts&&e.state==="active"&&v===2&&"pulse bg-accent/50")}),t.jsx("span",{className:"mt-1.5 text-xs font-medium text-fg",children:p.label}),t.jsx("span",{className:"text-[11px] text-fg-muted",children:p.ts?t.jsx(Kt,{value:p.ts}):e.state==="active"&&v===2?"running…":e.state==="delayed"&&v===1&&e.delayedUntil?t.jsxs(t.Fragment,{children:["runs ",t.jsx(Kt,{value:e.delayedUntil})]}):"–"}),p.ts&&t.jsx("span",{className:"font-mono text-[10px] text-fg-subtle",children:kf(p.ts)}),!p.ts&&e.state==="delayed"&&v===1&&e.delayedUntil&&t.jsx("span",{className:"font-mono text-[10px] text-fg-subtle",children:kf(e.delayedUntil)})]},p.label))]}),t.jsxs("div",{className:"mt-4 flex flex-wrap gap-4 border-t border-border pt-3 text-xs",children:[t.jsxs("span",{children:[t.jsx("span",{className:"text-fg-subtle",children:"Wait "}),t.jsx("span",{className:"num text-fg",children:c!=null?qn(c):"–"})]}),t.jsxs("span",{children:[t.jsx("span",{className:"text-fg-subtle",children:"Run "}),t.jsx("span",{className:F("num text-fg",e.state==="active"&&"text-accent"),children:h!=null?qn(h):"–"})]}),t.jsxs("span",{children:[t.jsx("span",{className:"text-fg-subtle",children:"Total "}),t.jsx("span",{className:"num text-fg",children:o?qn(o-r):"–"})]}),t.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-fg-subtle",children:[t.jsx("span",{className:F("status-dot",((g=CS[e.state])==null?void 0:g.dot)??"bg-fg-subtle")})," ",e.state]})]})]})}function Dh({value:e,empty:n}){const[r,i]=N.useState(!1),o=N.useMemo(()=>Nu(e),[e]),c=e==null||typeof e=="object"&&Object.keys(e).length===0;return t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border bg-surface-2/60 pr-1 pl-3",children:[t.jsxs("div",{className:"flex items-center gap-1 text-[11px]",children:[t.jsx("button",{type:"button",className:F("rounded px-1.5 py-0.5",r?"text-fg-subtle hover:text-fg":"bg-surface-3 text-fg"),onClick:()=>i(!1),children:"Tree"}),t.jsx("button",{type:"button",className:F("rounded px-1.5 py-0.5",r?"bg-surface-3 text-fg":"text-fg-subtle hover:text-fg"),onClick:()=>i(!0),children:"Raw"})]}),t.jsx(fo,{value:o,size:"icon-xs"})]}),t.jsx("div",{className:"max-h-[60vh] overflow-auto p-3",children:c?t.jsx("p",{className:"text-xs text-fg-subtle",children:n}):r?t.jsx("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre-wrap break-all",children:o}):t.jsx(J0,{value:e,defaultExpandDepth:3})})]})}function b_({job:e}){var n;return!e.failedReason&&(!e.stacktrace||e.stacktrace.length===0)?t.jsx("div",{className:"card p-6 text-center text-xs text-fg-subtle",children:"No error recorded for this job"}):t.jsxs("div",{className:"space-y-3",children:[e.failedReason&&t.jsx("div",{className:"rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-[13px] break-words text-danger",children:e.failedReason}),(n=e.stacktrace)==null?void 0:n.map((r,i)=>t.jsx(_m,{code:r,header:`Stacktrace · attempt ${i+1} of ${e.stacktrace.length}`,wrap:!0,maxHeight:360},i))]})}function w_({connectionId:e,queue:n,jobId:r,initial:i,total:o}){var p,v;const[c,d]=N.useState(!1),h=Jk(e,n,r,c?{}:{start:0,end:199},!0),m=((p=h.data)==null?void 0:p.logs)??i??[],g=((v=h.data)==null?void 0:v.count)??o??m.length;return m.length===0?t.jsx("div",{className:"card p-6 text-center text-xs text-fg-subtle",children:"No logs. Use job.log() in your processor to emit lines here."}):t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border bg-surface-2/60 pr-1 pl-3 text-[11px] text-fg-subtle",children:[t.jsxs("span",{children:[W(m.length)," of ",W(g)," lines"]}),t.jsxs("div",{className:"flex items-center gap-1",children:[!c&&m.length<g&&t.jsx(V,{size:"xs",variant:"ghost",onClick:()=>d(!0),children:"Load all"}),t.jsx(fo,{value:m.join(`
|
|
541
|
+
`),size:"icon-xs"})]})]}),t.jsx("ol",{className:"max-h-[60vh] overflow-auto p-2 font-mono text-xs leading-relaxed",children:m.map((j,C)=>t.jsxs("li",{className:"flex gap-3 hover:bg-surface-2/50",children:[t.jsx("span",{className:"num w-10 shrink-0 select-none text-right text-fg-subtle",children:C+1}),t.jsx("span",{className:"whitespace-pre-wrap break-all",children:j})]},C))})]})}function N_({connectionId:e,queue:n,jobId:r}){var c;const i=S2(e,n,r),o=((c=i.data)==null?void 0:c.entries)??[];return i.isLoading?t.jsx("div",{className:"card p-6 text-center text-xs text-fg-subtle",children:"Loading history…"}):i.isError?t.jsx("div",{className:"card p-6 text-center text-xs text-fg-subtle",children:"Could not read the audit log."}):o.length===0?t.jsx("div",{className:"card p-6 text-center text-xs text-fg-subtle",children:"Nobody has acted on this job through the dashboard. Worker activity is not audited — only what people do here."}):t.jsxs("div",{className:"card divide-y divide-border",children:[o.map(d=>t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 text-xs",children:[t.jsx(Kt,{value:d.createdAt,className:"w-24 shrink-0 text-fg-muted"}),t.jsx("span",{className:"font-medium text-fg",children:d.actorName??d.actorEmail??"anonymous"}),t.jsx("span",{className:"text-fg-muted",children:tm[d.action]}),d.result==="error"&&t.jsx(be,{variant:"danger",size:"xs",title:d.errorMessage??void 0,children:"refused"}),d.ip&&t.jsx("span",{className:"num ml-auto text-[11px] text-fg-subtle",children:d.ip})]},d.id)),t.jsx("div",{className:"px-4 py-2",children:t.jsxs(Re,{to:oe.audit({connectionId:e,queueName:n}),className:"inline-flex items-center gap-1.5 text-xs text-accent hover:underline",children:[t.jsx(Eo,{className:"size-3.5","aria-hidden":!0})," Full audit log for this queue"]})})]})}const e1={waiting:"info",limited:"violet",maxed:"danger",paused:"warning"},t1={waiting:"In rotation: the next worker fetch may take a job from this group.",limited:"Hit its rate limit. Pro parks the group until the window resets.",maxed:"Every concurrency slot of the group is busy. Frees up when one of its jobs finishes.",paused:"Paused with queue.pauseGroup(). Jobs keep arriving, none are processed."},yv="No per-group override in Redis. The worker's own group option applies (a worker option, not stored in Redis).";function k_(){var v,j,C;const{connectionId:e="",queue:n=""}=zn(),r=sn(),[i,o]=N.useState(1),[c,d]=N.useState(50),h=f0(e,n),m=x0(e,n,{page:i,pageSize:c}),g=To(1e3),p=6;return t.jsxs(vt,{wide:!0,children:[t.jsx(hs,{title:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Re,{to:oe.queue(e,n),className:"text-fg-muted hover:text-fg",children:n}),t.jsx("span",{className:"text-fg-subtle",children:"/"}),"Groups",t.jsx(be,{variant:"pro",children:"BullMQ Pro"})]}),description:`Groups partition a queue for fairness, with their own concurrency and rate limit. ${h.data?`${W(h.data.groupsCount)} groups with jobs.`:""}`}),m.data&&t.jsx(S_,{byStatus:m.data.byStatus,total:m.data.total}),t.jsxs("div",{className:"card overflow-hidden",children:[t.jsxs(os,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{children:"Group"}),t.jsx(fe,{children:"Status"}),t.jsx(fe,{align:"right",children:"Waiting"}),t.jsx(fe,{align:"right",children:"Active / concurrency"}),t.jsx(fe,{align:"right",children:"Rate limit"}),t.jsx(fe,{align:"right",children:"Next"})]})}),t.jsxs("tbody",{children:[m.isLoading&&t.jsx(xt,{colSpan:p,children:t.jsx(Dt,{label:"Loading groups…"})}),m.isError&&!m.data&&t.jsx(xt,{colSpan:p,className:"text-danger",children:ye(m.error)}),m.data&&m.data.groups.length===0&&t.jsx(xt,{colSpan:p,children:"No groups with jobs right now. Add jobs with opts.group.id to see them here."}),(v=m.data)==null?void 0:v.groups.map(y=>t.jsx(C_,{g:y,now:g,onOpen:()=>r(oe.group(e,n,y.id)),href:oe.group(e,n,y.id)},y.id))]})]}),t.jsx("div",{className:"border-t border-border px-3 py-2",children:t.jsx(Uu,{page:i,pageSize:c,total:((j=m.data)==null?void 0:j.total)??0,count:(C=m.data)==null?void 0:C.groups.length,onPage:o,onPageSize:y=>(d(y),o(1))})})]})]})}function S_({byStatus:e,total:n}){return t.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[ck.map(r=>t.jsx(_e,{content:t1[r],side:"bottom",children:t.jsxs("span",{className:F("inline-flex cursor-help items-center gap-1.5 rounded-md border border-border px-2 py-1",e[r]===0&&"opacity-60"),children:[t.jsx(be,{variant:e1[r],dot:!0,size:"xs",children:r}),t.jsx("span",{className:"num font-medium",children:W(e[r])})]})},r)),t.jsxs("span",{className:"text-fg-subtle",children:[W(n)," ",n===1?"group":"groups"," with jobs"]})]})}function C_({g:e,now:n,onOpen:r,href:i}){const o=e.concurrency!==null,c=o?Math.min(100,Math.round(e.active/Math.max(1,e.concurrency??1)*100)):0;return t.jsxs(rl,{onActivate:r,children:[t.jsx(me,{mono:!0,children:t.jsx(Re,{to:i,className:"text-accent hover:underline",children:e.id})}),t.jsx(me,{className:"whitespace-nowrap",children:t.jsx(be,{variant:e1[e.status],dot:!0,size:"xs",title:t1[e.status],children:e.status})}),t.jsxs(me,{num:!0,align:"right",children:[W(e.waiting),e.prioritized>0&&t.jsx(_e,{content:"Jobs added with opts.priority. Pro serves the group's plain list first, then these.",side:"bottom",children:t.jsxs("span",{className:"ml-1.5 cursor-help text-[10px] text-fg-subtle",children:["+",W(e.prioritized)," prioritized"]})})]}),t.jsx(me,{num:!0,align:"right",children:t.jsxs("span",{className:"inline-flex items-center justify-end gap-2",children:[o&&t.jsx("span",{className:"h-1.5 w-14 overflow-hidden rounded-full bg-surface-2","aria-hidden":!0,children:t.jsx("span",{className:F("block h-full rounded-full",c>=100?"bg-danger":"bg-accent"),style:{width:`${c}%`}})}),t.jsxs("span",{children:[W(e.active),t.jsx("span",{className:"text-fg-subtle",children:" / "}),o?t.jsx(_e,{content:"Per-group override set with queue.setGroupConcurrency().",side:"bottom",children:t.jsx("span",{className:"cursor-help",children:W(e.concurrency)})}):t.jsx(_e,{content:yv,side:"bottom",children:t.jsx("span",{className:"cursor-help text-fg-subtle",children:"worker default"})})]})]})}),t.jsx(me,{num:!0,align:"right",children:e.rateLimit?t.jsx(_e,{content:"Per-group override set with queue.setGroupRateLimit(): max jobs per window.",side:"bottom",children:t.jsxs("span",{className:"cursor-help",children:[W(e.rateLimit.max),t.jsx("span",{className:"text-fg-subtle",children:" / "}),qn(e.rateLimit.durationMs)]})}):t.jsx(_e,{content:yv,side:"bottom",children:t.jsx("span",{className:"cursor-help text-fg-subtle",children:"worker default"})})}),t.jsx(me,{num:!0,align:"right",muted:!0,children:t.jsx(__,{g:e,now:n})})]})}function __({g:e,now:n}){if(e.status==="limited"&&e.limitedUntil!==null){const r=e.limitedUntil-n;return t.jsx("span",{title:new Date(e.limitedUntil).toLocaleTimeString(),children:r>0?`resumes in ${qn(r)}`:"resuming…"})}return e.status==="maxed"&&e.since!==null?t.jsxs("span",{title:new Date(e.since).toLocaleTimeString(),children:["at cap for ",qn(n-e.since)]}):e.status==="paused"&&e.since!==null?t.jsxs("span",{title:new Date(e.since).toLocaleTimeString(),children:["paused for ",qn(n-e.since)]}):e.status==="waiting"?t.jsx("span",{children:"in rotation"}):t.jsx("span",{children:"–"})}function P_(){var y,b,k,S;const{connectionId:e="",queue:n="",groupId:r=""}=zn(),{isOperator:i}=yt(),[o,c]=N.useState(1),[d,h]=N.useState(25),m=t2(e,n,r,{page:o,pageSize:d}),g=am(e,n),[p,v]=N.useState(null),j=(O,q)=>g.mutate({jobId:O,action:q},{onSuccess:()=>Y.success(`Job ${O} ${q==="remove"?"removed":q}`),onError:E=>Y.error(ye(E))}),C=(O,q)=>q==="remove"?v(O):j(O,q);return t.jsxs(vt,{wide:!0,children:[t.jsx(hs,{title:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsxs(Re,{to:oe.groups(e,n),className:"inline-flex items-center gap-1 text-fg-muted hover:text-fg",children:[t.jsx(iu,{className:"size-4"})," Groups"]}),t.jsx("span",{className:"text-fg-subtle",children:"/"}),t.jsx(Mu,{className:"size-4 text-pro","aria-hidden":!0}),t.jsx("span",{className:"font-mono",children:r})]}),description:`Jobs waiting in group ${r} of ${n}, in the order Pro will serve them: the group's list first, then its prioritized jobs.`}),t.jsxs("div",{className:"card overflow-hidden",children:[t.jsx(Ef,{connectionId:e,queue:n,jobs:(y=m.data)==null?void 0:y.jobs,loading:m.isLoading,error:m.error,canOperate:i,onAction:C,pendingId:g.isPending?(b=g.variables)==null?void 0:b.jobId:null,emptyText:"No jobs waiting in this group"}),t.jsx("div",{className:"border-t border-border px-3 py-2",children:t.jsx(Uu,{page:o,pageSize:d,total:((k=m.data)==null?void 0:k.total)??0,count:(S=m.data)==null?void 0:S.jobs.length,onPage:c,onPageSize:O=>(h(O),c(1))})})]}),t.jsx(tn,{open:p!==null,onClose:()=>v(null),title:"Remove job",description:`Remove job ${p??""} from ${n}? This cannot be undone.`,confirmText:"Remove",danger:!0,loading:g.isPending,onConfirm:()=>{p&&j(p,"remove"),v(null)}})]})}function n1({open:e,onClose:n,initial:r,onSave:i,saving:o,title:c="Assign queues",description:d="Pick queues from any connection. A queue can live in several folders."}){const{byConnection:h,isLoading:m}=sl(),[g,p]=N.useState(""),[v,j]=N.useState(new Set),C=k=>`${k.connectionId} ${k.queueName}`;N.useEffect(()=>{e&&j(new Set(r.map(C)))},[e,r]);const y=k=>j(S=>{const O=new Set(S),q=C(k);return O.has(q)?O.delete(q):O.add(q),O}),b=g.trim().toLowerCase();return t.jsxs(Sn,{open:e,onClose:n,size:"md",title:c,description:d,footer:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"mr-auto text-xs text-fg-muted",children:[v.size," selected"]}),t.jsx(V,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),t.jsx(V,{variant:"primary",size:"sm",loading:o,onClick:()=>i([...v].map(k=>{const[S,O]=k.split(" ");return{connectionId:S,queueName:O}})),children:"Save"})]}),children:[t.jsx(Me,{leftIcon:t.jsx(Hn,{}),placeholder:"Filter queues…",value:g,onChange:k=>p(k.target.value),autoFocus:!0,"aria-label":"Filter queues"}),t.jsxs("div",{className:"mt-3 max-h-[50vh] space-y-3 overflow-y-auto",children:[m&&t.jsx(tl,{}),h.map(({connection:k,queues:S})=>{const O=S.filter(q=>!b||q.name.toLowerCase().includes(b)).sort((q,E)=>q.name.localeCompare(E.name));return O.length===0?null:t.jsxs("div",{children:[t.jsxs("div",{className:"mb-1 flex items-center justify-between text-[11px] font-semibold tracking-wider text-fg-subtle uppercase",children:[k.name,t.jsx("button",{type:"button",className:"font-normal tracking-normal normal-case hover:text-fg",onClick:()=>j(q=>{const E=new Set(q),T=O.every(M=>E.has(C({connectionId:k.id,queueName:M.name})));return O.forEach(M=>T?E.delete(C({connectionId:k.id,queueName:M.name})):E.add(C({connectionId:k.id,queueName:M.name}))),E}),children:"toggle all"})]}),t.jsx("div",{className:"grid gap-1 sm:grid-cols-2",children:O.map(q=>{const E={connectionId:k.id,queueName:q.name};return t.jsx(fm,{label:q.name,checked:v.has(C(E)),onChange:()=>y(E),className:"rounded px-1.5 py-1 hover:bg-surface-2"},q.name)})})]},k.id)})]})]})}const Su=["#5b8def","#3fb950","#d29922","#f85149","#a371f7","#39c5bb","#f778ba","#9aa3ad"];function E_(){const{has:e}=jt();return e("folders")?t.jsx(R_,{}):t.jsx(Oa,{feature:"folders"})}function R_(){const{isOperator:e}=yt(),n=Br(),[r,i]=N.useState(null),[o,c]=N.useState(null),d=n.data??[],h=N.useMemo(()=>d.filter(p=>!p.parentId).sort((p,v)=>p.position-v.position||p.name.localeCompare(v.name)),[d]),m=p=>d.filter(v=>v.parentId===p).sort((v,j)=>v.position-j.position||v.name.localeCompare(j.name)),g=d.find(p=>p.id===r)??null;return N.useEffect(()=>{!r&&h[0]&&i(h[0].id)},[h,r]),n.isLoading?t.jsx(vt,{children:t.jsx(tl,{})}):t.jsxs(vt,{children:[t.jsx(hs,{title:"Folders",description:"Group queues from any connection into folders. Nested one level. The sidebar mirrors this tree.",actions:e&&t.jsx(V,{variant:"primary",size:"sm",leftIcon:t.jsx(Tg,{}),onClick:()=>c({parentId:null}),children:"New folder"})}),d.length===0?t.jsx(nn,{icon:t.jsx(Zs,{}),title:"No folders yet",description:"Without folders the sidebar shows one implicit folder per connection. Create a folder to organise queues by team, product or environment.",action:e&&t.jsx(V,{variant:"primary",leftIcon:t.jsx(Tg,{}),onClick:()=>c({parentId:null}),children:"Create the first folder"})}):t.jsxs("div",{className:"grid gap-4 lg:grid-cols-[280px_1fr]",children:[t.jsx("div",{className:"card p-1.5",children:h.map(p=>t.jsxs("div",{children:[t.jsx(jv,{folder:p,selected:r===p.id,onSelect:()=>i(p.id),onAddChild:e?()=>c({parentId:p.id}):void 0}),m(p.id).map(v=>t.jsx(jv,{folder:v,depth:1,selected:r===v.id,onSelect:()=>i(v.id)},v.id))]},p.id))}),t.jsx("div",{children:g?t.jsx(M_,{folder:g,allFolders:d,canEdit:e,onDeleted:()=>i(null)},g.id):t.jsx(nn,{compact:!0,title:"Select a folder"})})]}),t.jsx(T_,{open:!!o,parentId:(o==null?void 0:o.parentId)??null,roots:h,onClose:()=>c(null),onCreated:p=>i(p.id)})]})}function jv({folder:e,depth:n=0,selected:r,onSelect:i,onAddChild:o}){return t.jsxs("div",{className:F("group flex h-8 items-center gap-2 rounded-md pr-1 text-[13px]",r?"bg-surface-3 text-fg":"text-fg-muted hover:bg-surface-2 hover:text-fg"),style:{paddingLeft:8+n*16},children:[t.jsxs("button",{type:"button",onClick:i,className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-current":r||void 0,children:[t.jsx(Zs,{className:"size-4 shrink-0",style:{color:e.color??"var(--fg-subtle)"},"aria-hidden":!0}),t.jsx("span",{className:"truncate",children:e.name}),t.jsx("span",{className:"num ml-auto text-[10px] text-fg-subtle",children:e.queues.length})]}),o&&t.jsx(V,{size:"icon-xs",variant:"ghost",className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100",title:"Add subfolder","aria-label":"Add subfolder",onClick:o,children:t.jsx(Kn,{})})]})}function M_({folder:e,allFolders:n,canEdit:r,onDeleted:i}){var E;const o=y0(),c=f2(),d=j0(),{byConnection:h}=sl(),[m,g]=N.useState(!1),[p,v]=N.useState(e.name),[j,C]=N.useState(!1),[y,b]=N.useState(!1),k=n.filter(T=>T.parentId===e.id),S=()=>{const T=p.trim();if(!T||T===e.name){g(!1),v(e.name);return}o.mutate({id:e.id,input:{name:T}},{onSuccess:()=>g(!1),onError:M=>Y.error(ye(M))})},O=T=>d.mutate({id:e.id,input:{queues:e.queues.filter(M=>!(M.connectionId===T.connectionId&&M.queueName===T.queueName))}},{onError:M=>Y.error(ye(M))}),q=T=>{var M;return((M=h.find($=>$.connection.id===T))==null?void 0:M.connection.name)??T};return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"card p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[t.jsx(Zs,{className:"mt-1 size-6",style:{color:e.color??"var(--fg-subtle)"},"aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[m?t.jsxs("form",{className:"flex items-center gap-2",onSubmit:T=>{T.preventDefault(),S()},children:[t.jsx(Me,{autoFocus:!0,value:p,onChange:T=>v(T.target.value),className:"!h-8 max-w-xs","aria-label":"Folder name",onKeyDown:T=>T.key==="Escape"&&(g(!1),v(e.name))}),t.jsx(V,{size:"icon-sm",type:"submit",variant:"primary","aria-label":"Save",loading:o.isPending,children:t.jsx(Qr,{})}),t.jsx(V,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:()=>(g(!1),v(e.name)),children:t.jsx(mn,{})})]}):t.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[e.name,r&&t.jsx(V,{size:"icon-xs",variant:"ghost","aria-label":"Rename",onClick:()=>g(!0),children:t.jsx(Po,{})})]}),t.jsxs("p",{className:"text-xs text-fg-muted",children:[e.parentId?`Subfolder of ${((E=n.find(T=>T.id===e.parentId))==null?void 0:E.name)??"?"}`:"Top-level folder"," · ",e.queues.length," queues",k.length>0&&` · ${k.length} subfolders`]})]}),t.jsxs(Re,{to:oe.folder(e.id),className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs font-medium text-fg hover:bg-surface-2",title:"Open this folder's dashboard",children:["Open folder",t.jsx(Zw,{className:"size-3.5","aria-hidden":!0})]}),r&&t.jsx(V,{size:"sm",variant:"ghost",className:"hover:text-danger",leftIcon:t.jsx(us,{}),onClick:()=>b(!0),children:"Delete"})]}),r&&t.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"mb-1 block text-[10px] tracking-wide text-fg-subtle uppercase",children:"Colour"}),t.jsxs("div",{className:"flex gap-1.5",role:"radiogroup","aria-label":"Folder colour",children:[Su.map(T=>t.jsx("button",{type:"button",role:"radio","aria-checked":e.color===T,"aria-label":T,className:F("size-5 rounded-full ring-offset-2 ring-offset-surface transition-shadow",e.color===T&&"ring-2 ring-fg"),style:{background:T},onClick:()=>o.mutate({id:e.id,input:{color:T}},{onError:M=>Y.error(ye(M))})},T)),t.jsx("button",{type:"button",role:"radio","aria-checked":!e.color,"aria-label":"No colour",className:F("size-5 rounded-full border border-dashed border-border-strong ring-offset-2 ring-offset-surface",!e.color&&"ring-2 ring-fg"),onClick:()=>o.mutate({id:e.id,input:{color:null}},{onError:T=>Y.error(ye(T))})})]})]}),!k.length&&t.jsx(ut,{label:"Parent",className:"!h-8 w-56",value:e.parentId??"",onChange:T=>o.mutate({id:e.id,input:{parentId:T.target.value||null}},{onError:M=>Y.error(ye(M))}),options:[{value:"",label:"None (top level)"},...n.filter(T=>!T.parentId&&T.id!==e.id).map(T=>({value:T.id,label:T.name}))]})]})]}),t.jsxs("div",{className:"card",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-2.5",children:[t.jsx("h3",{className:"text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:"Queues"}),r&&t.jsx(V,{size:"sm",leftIcon:t.jsx(Kn,{}),onClick:()=>C(!0),children:"Assign queues"})]}),e.queues.length===0?t.jsx("p",{className:"px-4 py-8 text-center text-xs text-fg-subtle",children:"No queues assigned yet."}):t.jsx("ul",{className:"divide-y divide-border",children:e.queues.map(T=>t.jsxs("li",{className:"flex items-center gap-3 px-4 py-2 text-[13px]",children:[t.jsx(Re,{to:oe.queue(T.connectionId,T.queueName),className:"font-medium hover:underline",children:T.queueName}),t.jsx(be,{variant:"outline",size:"xs",children:q(T.connectionId)}),r&&t.jsx(V,{size:"icon-xs",variant:"ghost",className:"ml-auto hover:text-danger","aria-label":"Remove from folder",onClick:()=>O(T),children:t.jsx(mn,{})})]},`${T.connectionId}/${T.queueName}`))})]}),t.jsx(n1,{open:j,onClose:()=>C(!1),initial:e.queues,onSave:T=>d.mutate({id:e.id,input:{queues:T}},{onSuccess:()=>(C(!1),Y.success("Folder updated")),onError:M=>Y.error(ye(M))}),saving:d.isPending}),t.jsx(tn,{open:y,onClose:()=>b(!1),title:`Delete "${e.name}"`,description:k.length>0?"Subfolders move up to the top level. Queues themselves are untouched.":"Queues themselves are untouched.",confirmText:"Delete folder",danger:!0,loading:c.isPending,onConfirm:()=>c.mutate(e.id,{onSuccess:()=>(b(!1),i(),Y.success("Folder deleted")),onError:T=>Y.error(ye(T))})})]})}function T_({open:e,parentId:n,roots:r,onClose:i,onCreated:o}){const c=h2(),[d,h]=N.useState(""),[m,g]=N.useState(Su[0]),[p,v]=N.useState(n??""),[j,C]=N.useState(null);N.useEffect(()=>v(n??""),[n,e]);const y=()=>{var k;const b=t0.safeParse({name:d.trim(),color:m,parentId:p||null});if(!b.success){C(((k=b.error.issues[0])==null?void 0:k.message)??"Invalid");return}c.mutate(b.data,{onSuccess:S=>{Y.success(`Folder "${S.name}" created`),o(S),i()},onError:S=>Y.error(ye(S))})};return t.jsx(Sn,{open:e,onClose:i,size:"sm",title:"New folder",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:i,children:"Cancel"}),t.jsx(V,{variant:"primary",size:"sm",onClick:y,loading:c.isPending,children:"Create"})]}),children:t.jsxs("form",{className:"space-y-3",onSubmit:b=>{b.preventDefault(),y()},children:[t.jsx(Me,{label:"Name",autoFocus:!0,value:d,onChange:b=>h(b.target.value),error:j}),t.jsxs("div",{children:[t.jsx("span",{className:"mb-1 block text-xs font-medium text-fg-muted",children:"Colour"}),t.jsx("div",{className:"flex gap-1.5",role:"radiogroup","aria-label":"Folder colour",children:Su.map(b=>t.jsx("button",{type:"button",role:"radio","aria-checked":m===b,"aria-label":b,className:F("size-5 rounded-full ring-offset-2 ring-offset-surface",m===b&&"ring-2 ring-fg"),style:{background:b},onClick:()=>g(b)},b))})]}),t.jsx(ut,{label:"Parent folder",value:p,onChange:b=>v(b.target.value),options:[{value:"",label:"None (top level)"},...r.map(b=>({value:b.id,label:b.name}))],hint:"Folders nest one level deep."})]})})}const I_=["waiting","active","completed","failed","delayed"];function q_(e){var m,g,p,v;const n={waiting:0,active:0,completed:0,failed:0,delayed:0,prioritized:0,paused:0,"waiting-children":0};let r=0,i=0,o=0,c=null;const d=[];for(const{queue:j}of e){for(const C of Object.keys(n))n[C]+=j.counts[C]??0;r+=((m=j.rates)==null?void 0:m.completed)??0,i+=((g=j.rates)==null?void 0:g.failed)??0,(p=j.rates)!=null&&p.windowMinutes&&(c=j.rates.windowMinutes),j.metrics&&j.metrics.completed.length>0&&(o+=1),(v=j.rates)!=null&&v.retentionSkewed&&d.push(j.name)}const h=r+i;return{counts:n,completed:r,failed:i,successPct:h>0?r/h*100:null,completedSeries:cv(e.map(j=>{var C;return(C=j.queue.metrics)==null?void 0:C.completed})),failedSeries:cv(e.map(j=>{var C;return(C=j.queue.metrics)==null?void 0:C.failed})),withMetrics:o,windowMinutes:c,skewedQueues:d}}function O_({entries:e,className:n}){const r=N.useMemo(()=>q_(e),[e]),i=r.windowMinutes?r.windowMinutes%60===0?`${r.windowMinutes/60}h`:`${r.windowMinutes}m`:"1h",o=r.completedSeries.length>1,c=r.skewedQueues.length>0,d=c?`${r.skewedQueues.length===1?`Queue "${r.skewedQueues[0]}"`:`${r.skewedQueues.length} queues (${r.skewedQueues.slice(0,3).join(", ")}${r.skewedQueues.length>3?", …":""})`} feed this total. ${gm}`:"";return t.jsxs("div",{className:F("grid gap-2 sm:grid-cols-3 xl:grid-cols-7",n),children:[I_.map(h=>{const m=ot[h],g=r.counts[h];return t.jsxs("div",{className:"card px-3 py-2.5",children:[t.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium tracking-wider text-fg-subtle uppercase",children:[t.jsx("span",{className:F("status-dot size-1.5",m.dotClass),"aria-hidden":!0}),m.label]}),t.jsx("div",{className:F("num text-2xl leading-tight font-semibold",g>0?m.textClass:"text-fg-muted"),children:mt(g)})]},h)}),t.jsxs("div",{className:"card px-3 py-2.5",children:[t.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-medium tracking-wider text-fg-subtle uppercase",children:["Success · ",i,c&&t.jsx(_e,{content:d,className:"ml-auto",children:t.jsx(Zn,{className:"size-3 text-warning","aria-label":"This total is unreliable: some queues prune completed jobs"})})]}),t.jsx(_e,{content:`${W(r.completed)} completed · ${W(r.failed)} failed across ${e.length} ${e.length===1?"queue":"queues"}${c?`
|
|
542
|
+
|
|
543
|
+
${d}`:""}`,children:t.jsx("div",{className:F("num text-2xl leading-tight font-semibold",c&&"opacity-50",r.successPct==null?"text-fg-subtle":r.successPct<90?"text-state-failed":"text-state-completed"),children:r.successPct==null?"—":On(r.successPct)})}),t.jsx("div",{className:F("mt-1 flex h-1.5 w-full overflow-hidden rounded-full bg-surface-3",c&&"opacity-50"),role:"img","aria-label":r.successPct==null?"No finished jobs":`${On(r.successPct)} success${c?", unreliable: some queues prune completed jobs":""}`,children:r.successPct!=null&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"h-full",style:{width:`${r.successPct}%`,background:ot.completed.fg}}),t.jsx("span",{className:"h-full flex-1",style:{background:ot.failed.fg,opacity:r.successPct>=100?0:1}})]})})]}),t.jsxs("div",{className:"card flex flex-col px-3 py-2.5",children:[t.jsx("div",{className:"text-[10px] font-medium tracking-wider text-fg-subtle uppercase",children:"Completed / min"}),o?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mt-1 block",style:{color:ot.completed.fg},children:t.jsx(Wi,{values:r.completedSeries,width:140,height:30,title:"Combined completed per minute",className:"w-full"})}),t.jsxs("span",{className:"mt-auto text-[10px] text-fg-subtle",children:[W(r.withMetrics)," of ",W(e.length)," queues report metrics"]})]}):t.jsx("span",{className:"mt-2 text-[11px] leading-relaxed text-fg-subtle",children:"No queue in this folder collects metrics."})]})]})}function $_(e){let n="";for(const r of e)r==="*"?n+=".*":r==="?"?n+=".":n+=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${n}$`,"i")}function z_(e,n){const r=e.trim();if(!r)return!1;try{return $_(r).test(n)}catch{return!1}}const Gc="__any__";function A_({open:e,onClose:n,existing:r,onImport:i,saving:o}){const{byConnection:c}=sl(),[d,h]=N.useState(""),[m,g]=N.useState(Gc),p=N.useMemo(()=>new Set(r.map(y=>`${y.connectionId} ${y.queueName}`)),[r]),v=N.useMemo(()=>{const y=d.trim();if(!y)return[];const b=[];for(const{connection:k,queues:S}of c)if(!(m!==Gc&&k.id!==m))for(const O of S){if(!z_(y,O.name))continue;const q={connectionId:k.id,queueName:O.name};b.push({ref:q,connectionName:k.name,already:p.has(`${k.id} ${O.name}`)})}return b.sort((k,S)=>k.ref.queueName.localeCompare(S.ref.queueName))},[d,m,c,p]),j=v.filter(y=>!y.already),C=()=>{i([...r,...j.map(y=>y.ref)])};return t.jsx(Sn,{open:e,onClose:n,size:"md",title:"Import matching queues",description:"Add every queue whose name matches a pattern, in one go.",footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mr-auto text-xs text-fg-muted",children:d.trim()===""?"Type a pattern to preview":`${W(j.length)} to add · ${W(v.length-j.length)} already in folder`}),t.jsx(V,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),t.jsxs(V,{variant:"primary",size:"sm",leftIcon:t.jsx(ff,{}),loading:o,disabled:j.length===0,onClick:C,children:["Import ",j.length>0?W(j.length):""]})]}),children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid gap-3 sm:grid-cols-[1fr_200px]",children:[t.jsx(Me,{label:"Pattern",mono:!0,autoFocus:!0,placeholder:"channels*",value:d,onChange:y=>h(y.target.value),hint:"* matches any run of characters, ? matches exactly one. Case-insensitive."}),t.jsx(ut,{label:"Connection",value:m,onChange:y=>g(y.target.value),options:[{value:Gc,label:"Any connection"},...c.map(y=>({value:y.connection.id,label:y.connection.name}))]})]}),t.jsxs("div",{className:"flex flex-wrap gap-1.5 text-[11px] text-fg-subtle",children:[t.jsx("span",{children:"Examples:"}),["channels*","*-retry","email-?"].map(y=>t.jsx("button",{type:"button",onClick:()=>h(y),className:"rounded border border-border bg-surface-2 px-1.5 py-0.5 font-mono text-fg-muted hover:text-fg",children:y},y))]}),t.jsxs("div",{className:"rounded-md border border-border",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-surface-2/50 px-3 py-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle uppercase",children:["Preview",t.jsxs("span",{className:"num font-normal tracking-normal normal-case",children:[W(v.length)," matching"]})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto",children:d.trim()===""?t.jsx("p",{className:"px-3 py-6 text-center text-xs text-fg-subtle",children:"Nothing to preview yet."}):v.length===0?t.jsxs("p",{className:"px-3 py-6 text-center text-xs text-fg-subtle",children:["No queue matches ",t.jsx("span",{className:"font-mono text-fg-muted",children:d.trim()}),m!==Gc&&" on this connection","."]}):t.jsx("ul",{className:"divide-y divide-border",children:v.map(y=>t.jsxs("li",{className:"flex items-center gap-2 px-3 py-1.5 text-xs",children:[t.jsx("span",{className:"truncate font-mono text-fg",children:y.ref.queueName}),t.jsx(be,{variant:"outline",size:"xs",children:y.connectionName}),y.already&&t.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-fg-subtle",children:"already in folder"})]},`${y.ref.connectionId}/${y.ref.queueName}`))})})]}),t.jsxs("p",{className:"flex items-start gap-2 rounded-md border border-border bg-surface-2/50 px-3 py-2 text-[11px] leading-relaxed text-fg-muted",children:[t.jsx(Xi,{className:"mt-0.5 size-3.5 shrink-0 text-fg-subtle","aria-hidden":!0}),t.jsxs("span",{children:["Imports the queues matching this pattern ",t.jsx("strong",{className:"text-fg",children:"now"}),". New queues that appear later are"," ",t.jsx("strong",{className:"text-fg",children:"not"})," added automatically — run the import again when they show up."]})]})]})})}function L_({open:e,onClose:n,folder:r,allFolders:i}){const o=y0(),[c,d]=N.useState(r.name),[h,m]=N.useState(r.color),[g,p]=N.useState(r.parentId??""),[v,j]=N.useState(null),C=i.some(k=>k.parentId===r.id),y=i.filter(k=>!k.parentId&&k.id!==r.id),b=()=>{var S;const k=hk.safeParse({name:c.trim(),color:h,parentId:g||null});if(!k.success){j(((S=k.error.issues[0])==null?void 0:S.message)??"Invalid");return}o.mutate({id:r.id,input:k.data},{onSuccess:()=>{Y.success("Folder updated"),n()},onError:O=>Y.error(ye(O))})};return t.jsx(Sn,{open:e,onClose:n,size:"sm",title:"Edit folder",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),t.jsx(V,{variant:"primary",size:"sm",onClick:b,loading:o.isPending,children:"Save changes"})]}),children:t.jsxs("form",{className:"space-y-3",onSubmit:k=>{k.preventDefault(),b()},children:[t.jsx(Me,{label:"Name",autoFocus:!0,value:c,onChange:k=>d(k.target.value),error:v}),t.jsxs("div",{children:[t.jsx("span",{className:"mb-1 block text-xs font-medium text-fg-muted",children:"Colour"}),t.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Folder colour",children:[Su.map(k=>t.jsx("button",{type:"button",role:"radio","aria-checked":h===k,"aria-label":k,className:F("size-5 rounded-full ring-offset-2 ring-offset-surface transition-shadow",h===k&&"ring-2 ring-fg"),style:{background:k},onClick:()=>m(k)},k)),t.jsx("button",{type:"button",role:"radio","aria-checked":!h,"aria-label":"No colour",className:F("size-5 rounded-full border border-dashed border-border-strong ring-offset-2 ring-offset-surface",!h&&"ring-2 ring-fg"),onClick:()=>m(null)})]})]}),t.jsx(ut,{label:"Parent folder",value:g,disabled:C,onChange:k=>p(k.target.value),options:[{value:"",label:"None (top level)"},...y.map(k=>({value:k.id,label:k.name}))],hint:C?"This folder has subfolders, so it must stay top-level.":"Folders nest one level deep."})]})})}function F_(){const{has:e}=jt();return e("folders")?t.jsx(D_,{}):t.jsx(Oa,{feature:"folders"})}function D_(){const{folderId:e=""}=zn(),{isOperator:n}=yt(),{has:r,gate:i}=jt(),o=Br(),{byConnection:c,isLoading:d}=sl(),h=j0(),[m,g]=N.useState(null),{sort:p,setSort:v,filter:j,setFilter:C}=xm(`folder.${e}`,km,Nm),y=o.data??[],b=y.find($=>$.id===e)??null,{entries:k,missing:S}=N.useMemo(()=>{const $=[],z=[];for(const B of(b==null?void 0:b.queues)??[]){const U=c.find(we=>we.connection.id===B.connectionId),J=U==null?void 0:U.queues.find(we=>we.name===B.queueName);U&&J?$.push({connection:U.connection,queue:J}):z.push(B)}return{entries:$,missing:z}},[b,c]),O=N.useMemo(()=>k.filter($=>pm($,j)),[k,j]),q=($,z,B=!0)=>{b&&h.mutate({id:b.id,input:{queues:$}},{onSuccess:()=>{Y.success(z),B&&g(null)},onError:U=>Y.error(ye(U))})},E=$=>q(((b==null?void 0:b.queues)??[]).filter(z=>!(z.connectionId===$.connectionId&&z.queueName===$.queueName)),`${$.queueName} removed from ${(b==null?void 0:b.name)??"folder"}`,!1);if(o.isLoading)return t.jsx(vt,{wide:!0,children:t.jsx(tl,{})});if(!b)return t.jsx(vt,{wide:!0,children:t.jsx(nn,{icon:t.jsx(Zs,{}),title:"Folder not found",description:"It may have been deleted.",action:t.jsx(Re,{to:oe.folders,className:"text-accent hover:underline",children:"Back to folders"})})});const T=b.parentId?y.find($=>$.id===b.parentId):null,M=b.queues.length===0;return t.jsxs(vt,{wide:!0,children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx("span",{className:"size-3 shrink-0 rounded-full ring-2 ring-inset ring-white/10",style:{background:b.color??"var(--fg-subtle)"},"aria-hidden":!0}),t.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight",children:b.name})]}),t.jsxs("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-fg-muted",children:[T&&t.jsxs(t.Fragment,{children:[t.jsx(Re,{to:`/folders/${encodeURIComponent(T.id)}`,className:"hover:underline",children:T.name}),t.jsx("span",{className:"text-fg-subtle",children:"/"})]}),t.jsxs("span",{className:"num",children:[W(b.queues.length)," ",b.queues.length===1?"queue":"queues"]}),S.length>0&&t.jsxs("span",{className:"text-state-waiting",title:S.map($=>$.queueName).join(", "),children:["· ",W(S.length)," not found"]}),t.jsx("span",{className:"text-fg-subtle",children:"·"}),t.jsx(Re,{to:oe.folders,className:"hover:underline",children:"Manage folders"})]})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n&&t.jsx(V,{size:"sm",variant:"secondary",leftIcon:t.jsx(Po,{}),onClick:()=>g("edit"),children:"Edit"}),n&&t.jsx(V,{size:"sm",variant:"secondary",leftIcon:t.jsx(ff,{}),onClick:()=>g("import"),title:"Import queues matching a pattern",children:"Import matching"}),n&&t.jsx(V,{size:"sm",variant:"primary",leftIcon:t.jsx(Kn,{}),onClick:()=>g("add"),children:"Add queue"}),t.jsx(V,{size:"sm",leftIcon:t.jsx(Gi,{}),onClick:()=>i("alerts",()=>g("alert")),title:"Alert on every queue in this folder",children:"Create alert"})]})]}),t.jsx(O_,{entries:k,className:"mb-4"}),M?t.jsx("div",{className:"card",children:t.jsx(nn,{icon:t.jsx(Zs,{}),title:"This folder is empty",description:"Add queues by hand, or import every queue whose name matches a pattern like channels* or *-retry.",action:n&&t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"primary",leftIcon:t.jsx(Kn,{}),onClick:()=>g("add"),children:"Add queue"}),t.jsx(V,{leftIcon:t.jsx(ff,{}),onClick:()=>g("import"),children:"Import matching queues"})]})})}):t.jsxs("section",{className:"space-y-3","aria-label":"Queues in this folder",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("h2",{className:"text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:"Queues"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(wm,{value:j,onChange:C,"aria-label":"Filter queues in this folder"}),t.jsxs("span",{className:"num whitespace-nowrap text-xs text-fg-subtle",children:[O.length," of ",k.length]})]})]}),d&&k.length===0?t.jsx(bm,{}):O.length>0?t.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(230px, 1fr))"},children:O.map($=>t.jsx(U_,{entry:$,onRemove:n?()=>E({connectionId:$.connection.id,queueName:$.queue.name}):void 0,removing:h.isPending},Sa($)))}):null,t.jsx("div",{className:"card overflow-hidden",children:t.jsx(Sm,{rows:O,showConnection:!0,sort:p,onSort:v,message:d&&k.length===0?"Loading queues…":j?"No queue matches the filter":"None of this folder's queues could be resolved on their connections."})}),S.length>0&&t.jsxs("div",{className:"card px-4 py-3",children:[t.jsx("h3",{className:"mb-1.5 text-[11px] font-semibold tracking-wider text-fg-subtle uppercase",children:"Not found on their connection"}),t.jsx("ul",{className:"flex flex-wrap gap-2",children:S.map($=>{var z;return t.jsxs("li",{className:"flex items-center gap-1.5 rounded border border-border bg-surface-2 px-2 py-1 text-xs",children:[t.jsx("span",{className:"font-mono text-fg-muted line-through",children:$.queueName}),t.jsx(be,{variant:"outline",size:"xs",children:((z=c.find(B=>B.connection.id===$.connectionId))==null?void 0:z.connection.name)??$.connectionId}),n&&t.jsx(V,{size:"icon-xs",variant:"ghost",className:"hover:text-danger","aria-label":`Remove ${$.queueName}`,onClick:()=>E($),children:t.jsx(mn,{})})]},`${$.connectionId}/${$.queueName}`)})}),t.jsx("p",{className:"mt-2 text-[11px] text-fg-subtle",children:"These queues are referenced by the folder but were not discovered on their connection — renamed, obliterated, or the connection is down."})]})]}),n&&m==="edit"&&t.jsx(L_,{open:!0,onClose:()=>g(null),folder:b,allFolders:y}),n&&t.jsx(n1,{open:m==="add",onClose:()=>g(null),initial:b.queues,saving:h.isPending,onSave:$=>q($,"Folder updated"),title:`Add queues to ${b.name}`}),n&&t.jsx(A_,{open:m==="import",onClose:()=>g(null),existing:b.queues,saving:h.isPending,onImport:$=>q($,`Imported into ${b.name}`)}),m==="alert"&&r("alerts")&&t.jsx(Qu,{open:!0,onClose:()=>g(null),alert:null,initialScope:{type:"folder",folderId:b.id}})]})}function U_({entry:e,onRemove:n,removing:r}){return t.jsxs("div",{className:"group/card relative",children:[t.jsx(Du,{entry:e,showConnection:!0}),n&&t.jsx(V,{size:"icon-xs",variant:"ghost",disabled:r,onClick:n,"aria-label":`Remove ${e.queue.name} from this folder`,title:"Remove from folder",className:"absolute top-2 right-8 z-10 bg-surface/90 opacity-0 backdrop-blur-sm transition-opacity group-hover/card:opacity-100 focus-visible:opacity-100 hover:text-danger",children:t.jsx(mn,{})})]})}const Rf={admin:"Everything, including connections, users, license, drain and obliterate.",operator:"Manage jobs and queues, alerts, folders and flow edges. No settings.",viewer:"Read-only access to queues, jobs, alerts and flows."};function Q_(){const{has:e}=jt();return e("users")?t.jsx(i0,{role:"admin",children:t.jsx(B_,{})}):t.jsx(Oa,{feature:"users"})}function B_(){const{user:e}=yt(),n=y2(),r=b2(),[i,o]=N.useState(!1),[c,d]=N.useState(null),h=[...n.data??[]].sort((p,v)=>+!!p.disabledAt-+!!v.disabledAt||p.name.localeCompare(v.name)),m=h.filter(p=>p.role==="admin"&&!p.disabledAt).length,g=(p,v)=>r.mutate({id:p.id,input:{disabled:v}},{onSuccess:()=>{d(null),Y.success(v?`${p.name} disabled`:`${p.name} re-enabled`,v?"Their sessions are revoked; the account keeps its history.":"They can sign in again.")},onError:j=>Y.error(ye(j))});return t.jsxs(vt,{children:[t.jsx(hs,{title:"Users",description:"Roles are enforced on every API call, not only in the UI.",actions:t.jsx(V,{variant:"primary",size:"sm",leftIcon:t.jsx(kN,{}),onClick:()=>o(!0),children:"Invite user"})}),t.jsx("div",{className:"card overflow-hidden",children:t.jsxs(os,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{children:"Name"}),t.jsx(fe,{children:"Email"}),t.jsx(fe,{className:"w-40",children:"Role"}),t.jsx(fe,{children:"Created"}),t.jsx(fe,{children:"Last login"}),t.jsx(fe,{align:"right",children:t.jsx("span",{className:"sr-only",children:"Actions"})})]})}),t.jsxs("tbody",{children:[n.isLoading&&t.jsx(xt,{colSpan:6,children:t.jsx(Dt,{label:"Loading users…"})}),n.isError&&t.jsx(xt,{colSpan:6,className:"text-danger",children:ye(n.error)}),h.map(p=>{var k;const v=p.id===(e==null?void 0:e.id),j=!!p.disabledAt,C=p.role==="admin"&&!j&&m<=1,y=v?"You cannot disable your own account":C?"Cannot disable the last admin":null,b=r.isPending&&((k=r.variables)==null?void 0:k.id)===p.id;return t.jsxs("tr",{className:F(j&&"text-fg-muted"),children:[t.jsxs(me,{className:"font-medium",children:[t.jsx("span",{className:F(j&&"line-through decoration-fg-subtle"),children:p.name}),v&&t.jsx(be,{variant:"outline",size:"xs",className:"ml-1.5",children:"you"}),j&&t.jsx(_e,{content:t.jsxs(t.Fragment,{children:["Disabled ",t.jsx(Kt,{value:p.disabledAt,withAbsolute:!0}),". Cannot sign in; sessions revoked."]}),side:"bottom",children:t.jsx(be,{variant:"neutral",size:"xs",className:"ml-1.5",children:"disabled"})})]}),t.jsx(me,{muted:!0,children:p.email}),t.jsx(me,{children:t.jsx(_e,{content:v?"Ask another admin to change your role":C?"Promote someone else to admin first":Rf[p.role],block:!0,children:t.jsx(ut,{"aria-label":`Role of ${p.name}`,className:"!h-7 text-xs",value:p.role,disabled:v||C||j||b,onChange:S=>r.mutate({id:p.id,input:{role:S.target.value}},{onSuccess:()=>Y.success(`${p.name} is now ${S.target.value}`),onError:O=>Y.error(ye(O))}),options:yu.map(S=>({value:S,label:S}))})})}),t.jsx(me,{muted:!0,children:t.jsx(Kt,{value:p.createdAt})}),t.jsx(me,{muted:!0,children:t.jsx(Kt,{value:p.lastLoginAt,emptyText:"never"})}),t.jsx(me,{align:"right",children:j?t.jsx(_e,{content:"Re-enable: they can sign in again with the same account",side:"left",children:t.jsx(V,{size:"xs",variant:"ghost",leftIcon:t.jsx(NN,{}),"aria-label":`Re-enable ${p.name}`,loading:b,onClick:()=>g(p,!1),children:"Enable"})}):t.jsx(_e,{content:y??"Disable: revokes access, keeps the account and its history",side:"left",children:t.jsx(V,{size:"icon-xs",variant:"ghost",className:"hover:text-danger","aria-label":`Disable ${p.name}`,disabled:!!y||b,onClick:()=>d(p),children:t.jsx(SN,{})})})})]},p.id)})]})]})}),t.jsx("div",{className:"mt-4 grid gap-2 text-xs text-fg-muted sm:grid-cols-3",children:yu.map(p=>t.jsxs("div",{className:"card p-3",children:[t.jsx(be,{variant:p==="admin"?"pro":p==="operator"?"info":"neutral",className:"mb-1.5",children:p}),t.jsx("p",{children:Rf[p]})]},p))}),t.jsx(V_,{open:i,onClose:()=>o(!1)}),t.jsx(tn,{open:!!c,onClose:()=>d(null),title:`Disable ${c==null?void 0:c.name}`,description:`${c==null?void 0:c.email} loses access immediately: active sessions are revoked and password or SSO sign-in is refused. The account and its audit history stay, and you can re-enable it any time.`,confirmText:"Disable user",danger:!0,loading:r.isPending,onConfirm:()=>c&&g(c,!0)})]})}function bv(){const e="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",n=new Uint8Array(16);return crypto.getRandomValues(n),Array.from(n,r=>e[r%e.length]).join("")}function V_({open:e,onClose:n}){const r=j2(),{has:i}=jt(),o=i("sso"),[c,d]=N.useState({name:"",email:"",role:"viewer",password:bv()}),[h,m]=N.useState(!1),[g,p]=N.useState({}),v=C=>y=>d(b=>({...b,[C]:y.target.value})),j=()=>{const C={name:c.name.trim(),email:c.email.trim(),role:c.role,...h?{}:{password:c.password}},y=lk.safeParse(C);if(!y.success){const b={};for(const k of y.error.issues)b[String(k.path[0])]=k.message;p(b);return}r.mutate(y.data,{onSuccess:b=>{Y.success(`${b.name} invited`,h?"They can now sign in with SSO using that email.":"Share the temporary password with them over a secure channel."),n()},onError:b=>Y.error(ye(b))})};return t.jsx(Sn,{open:e,onClose:n,size:"sm",title:"Invite user",description:h?"The account is created without a password; they sign in through your identity provider.":"There is no email delivery: copy the temporary password and share it yourself.",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),t.jsx(V,{variant:"primary",size:"sm",onClick:j,loading:r.isPending,children:"Create user"})]}),children:t.jsxs("form",{className:"space-y-3",onSubmit:C=>{C.preventDefault(),j()},children:[t.jsx(Me,{label:"Name",autoFocus:!0,value:c.name,onChange:v("name"),error:g.name}),t.jsx(Me,{label:"Email",type:"email",value:c.email,onChange:v("email"),error:g.email}),t.jsx(ut,{label:"Role",value:c.role,onChange:v("role"),options:yu.map(C=>({value:C,label:C})),hint:Rf[c.role]}),o&&t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx(Ki,{checked:h,onChange:m,label:"SSO only (no password)"}),t.jsx("button",{type:"button",className:"text-xs font-medium text-fg",onClick:()=>m(!h),children:"SSO only (no password)"})]}),h?t.jsx("p",{className:"rounded-md border border-border bg-surface-2 px-3 py-2 text-xs text-fg-muted",children:"This account will have no password and can only sign in through an identity provider. Make sure the email matches the one your IdP sends."}):t.jsxs("div",{className:"flex items-end gap-2",children:[t.jsx(Me,{label:"Temporary password",mono:!0,value:c.password,onChange:v("password"),error:g.password,wrapperClassName:"flex-1",autoComplete:"off",spellCheck:!1}),t.jsx(V,{size:"icon",variant:"ghost","aria-label":"Generate password",title:"Generate",onClick:()=>d(C=>({...C,password:bv()})),children:t.jsx(Kf,{})})]})]})})}const H_=50,K_=new Set(bk);function W_(){const{has:e}=jt();return e("audit")?t.jsx(i0,{role:"admin",children:t.jsx(G_,{})}):t.jsx(Oa,{feature:"audit"})}function Z_(){const[e,n]=ko();return[N.useMemo(()=>{const c=e.get("action"),d=e.get("result");return{actorId:e.get("actorId")||void 0,action:c&&em.includes(c)?c:void 0,connectionId:e.get("connectionId")||void 0,queueName:e.get("queueName")||void 0,jobId:e.get("jobId")||void 0,result:d==="ok"||d==="error"?d:void 0,from:e.get("from")||void 0,to:e.get("to")||void 0}},[e]),c=>{n(d=>{const h=new URLSearchParams(d);for(const[m,g]of Object.entries(c))g?h.set(m,g):h.delete(m);return h},{replace:!0})},()=>n(new URLSearchParams,{replace:!0})]}const wv=(e,n)=>e?new Date(`${e}T${n?"23:59:59.999":"00:00:00.000"}Z`).toISOString():void 0,Nv=e=>e?e.slice(0,10):"";function G_(){var v;const[e,n,r]=Z_(),i=ds(),o=N2(),c=w2(e,H_),[d,h]=N.useState(null),m=((v=c.data)==null?void 0:v.pages.flatMap(j=>j.entries))??[],g=Object.values(e).filter(Boolean).length,p=j=>{var C,y;return((y=(C=i.data)==null?void 0:C.find(b=>b.id===j))==null?void 0:y.name)??null};return t.jsxs(vt,{wide:!0,children:[t.jsx(hs,{title:"Audit log",description:"Every mutating action, who did it and whether it worked. Append-only: nothing here can be edited or deleted from the UI.",actions:t.jsxs(t.Fragment,{children:[g>0&&t.jsx(V,{size:"sm",variant:"ghost",leftIcon:t.jsx(mn,{}),onClick:r,children:"Clear filters"}),t.jsxs("a",{href:k2(e),className:"inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-border bg-surface-2 px-2.5 text-xs font-medium text-fg hover:border-border-strong hover:bg-surface-3 [&_svg]:size-3.5",children:[t.jsx(aN,{"aria-hidden":!0}),"Export CSV"]})]})}),t.jsxs("div",{className:"card mb-3 flex flex-wrap items-end gap-2 p-3",children:[t.jsx(ut,{label:"Who",className:"!h-7 w-44 text-xs",value:e.actorId??"",onChange:j=>n({actorId:j.target.value}),options:[{value:"",label:"Anyone"},...(o.data??[]).filter(j=>j.id).map(j=>({value:j.id,label:j.name??j.email??j.id}))]}),t.jsx(ut,{label:"Action",className:"!h-7 w-52 text-xs",value:e.action??"",onChange:j=>n({action:j.target.value}),options:[{value:"",label:"Any action"},...em.map(j=>({value:j,label:`${tm[j]} (${j})`}))]}),t.jsx(ut,{label:"Connection",className:"!h-7 w-40 text-xs",value:e.connectionId??"",onChange:j=>n({connectionId:j.target.value}),options:[{value:"",label:"Any connection"},...(i.data??[]).map(j=>({value:j.id,label:j.name}))]}),t.jsx(Me,{label:"Queue",className:"!h-7 w-40 text-xs",placeholder:"exact name",value:e.queueName??"",onChange:j=>n({queueName:j.target.value})}),t.jsx(ut,{label:"Result",className:"!h-7 w-32 text-xs",value:e.result??"",onChange:j=>n({result:j.target.value}),options:[{value:"",label:"Any result"},{value:"ok",label:"ok"},{value:"error",label:"refused / failed"}]}),t.jsx(Me,{label:"From",type:"date",className:"!h-7 w-36 text-xs",value:Nv(e.from),onChange:j=>n({from:wv(j.target.value,!1)})}),t.jsx(Me,{label:"To",type:"date",className:"!h-7 w-36 text-xs",value:Nv(e.to),onChange:j=>n({to:wv(j.target.value,!0)})}),e.jobId&&t.jsxs(be,{variant:"outline",mono:!0,className:"mb-1",children:["job ",e.jobId,t.jsx("button",{type:"button","aria-label":"Clear job filter",onClick:()=>n({jobId:void 0}),children:t.jsx(mn,{className:"size-3"})})]})]}),t.jsx("div",{className:"card overflow-hidden",children:t.jsxs(os,{dense:!0,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{className:"w-8"}),t.jsx(fe,{className:"w-32",children:"When"}),t.jsx(fe,{className:"w-56",children:"Who"}),t.jsx(fe,{className:"w-56",children:"Action"}),t.jsx(fe,{children:"Target"}),t.jsx(fe,{className:"w-28",children:"Result"}),t.jsx(fe,{className:"w-32",children:"IP"})]})}),t.jsxs("tbody",{children:[c.isLoading&&t.jsx(xt,{colSpan:7,children:t.jsx(Dt,{label:"Loading the audit log…"})}),c.isError&&t.jsx(xt,{colSpan:7,className:"text-danger",children:ye(c.error)}),!c.isLoading&&!c.isError&&m.length===0&&t.jsx(xt,{colSpan:7,children:t.jsx(nn,{compact:!0,icon:t.jsx(Eo,{}),title:g>0?"Nothing matches these filters":"Nothing recorded yet",description:g>0?"Widen the date range or clear a filter.":"The log fills as people act: pausing a queue, retrying a job, inviting a user. Reads are never recorded."})}),m.map(j=>t.jsx(J_,{entry:j,open:d===j.id,onToggle:()=>h(d===j.id?null:j.id),connectionStillExists:!!p(j.connectionId)},j.id))]})]})}),t.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3 text-xs text-fg-muted",children:[t.jsxs("span",{className:"num",children:[m.length," ",m.length===1?"entry":"entries"," loaded"]}),c.hasNextPage&&t.jsx(V,{size:"sm",variant:"secondary",loading:c.isFetchingNextPage,onClick:()=>void c.fetchNextPage(),children:"Load 50 more"})]}),t.jsxs("p",{className:"mt-4 text-xs text-fg-subtle",children:["Retention is ",t.jsx("code",{className:"font-mono",children:"BULLPANE_AUDIT_RETENTION_DAYS"})," (default 365). Rows leave only by age — there is no delete endpoint, on purpose. The job payload is never recorded: ",t.jsx("code",{className:"font-mono",children:"detail"})," ","holds the parameters of an action and, where it helps, the payload size in bytes."]})]})}function J_({entry:e,open:n,onToggle:r,connectionStillExists:i}){var h;const o=K_.has(e.action),c=e.result==="error",d=!!e.detail||!!e.userAgent||!!e.errorMessage;return t.jsxs(t.Fragment,{children:[t.jsxs("tr",{className:F(c&&"bg-danger/5"),children:[t.jsx(me,{children:d?t.jsx("button",{type:"button","aria-label":n?"Hide detail":"Show detail","aria-expanded":n,onClick:r,className:"rounded p-0.5 text-fg-subtle hover:text-fg",children:n?t.jsx(cs,{className:"size-3.5"}):t.jsx(Wn,{className:"size-3.5"})}):null}),t.jsx(me,{muted:!0,children:t.jsx(Kt,{value:e.createdAt})}),t.jsx(me,{children:e.actorName||e.actorEmail?t.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[t.jsx("span",{className:"truncate font-medium",children:e.actorName??"—"}),e.actorRole&&t.jsx(be,{size:"xs",variant:e.actorRole==="admin"?"pro":e.actorRole==="operator"?"info":"neutral",children:e.actorRole}),e.actorEmail&&t.jsx("span",{className:"truncate text-[11px] text-fg-subtle",children:e.actorEmail})]}):t.jsx(_e,{content:"No session — an anonymous request, e.g. a failed login on an unknown email",children:t.jsx("span",{className:"cursor-help text-fg-subtle",children:"anonymous"})})}),t.jsxs(me,{children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&t.jsx(Wf,{className:"size-3.5 shrink-0 text-warning","aria-label":"High-risk action"}),t.jsx("span",{className:F(o&&"font-medium"),children:tm[e.action]}),t.jsx(_e,{content:e.action,children:t.jsx("code",{className:"cursor-help font-mono text-[10px] text-fg-subtle",children:e.action})})]}),typeof((h=e.detail)==null?void 0:h.reason)=="string"&&e.detail.reason&&t.jsxs("p",{className:"mt-0.5 max-w-md truncate text-[11px] text-fg-muted italic",title:e.detail.reason,children:["“",e.detail.reason,"”"]})]}),t.jsx(me,{children:t.jsx(X_,{entry:e,connectionStillExists:i})}),t.jsx(me,{children:c?t.jsx(_e,{content:e.errorMessage??"The action was refused or failed",children:t.jsx(be,{variant:"danger",size:"xs",className:"cursor-help",children:"refused"})}):t.jsx(be,{variant:"success",size:"xs",children:"ok"})}),t.jsx(me,{muted:!0,mono:!0,children:e.ip??"–"})]}),n&&t.jsx("tr",{children:t.jsx("td",{colSpan:7,className:"bg-surface-2 !px-4 !py-3",children:t.jsxs("dl",{className:"grid gap-3 text-xs sm:grid-cols-[10rem_1fr]",children:[t.jsx("dt",{className:"text-fg-subtle",children:"Exact time"}),t.jsx("dd",{className:"num",children:fn(e.createdAt)}),e.errorMessage&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{className:"text-fg-subtle",children:"Why it failed"}),t.jsx("dd",{className:"text-danger",children:e.errorMessage})]}),e.userAgent&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{className:"text-fg-subtle",children:"User agent"}),t.jsx("dd",{className:"font-mono text-[11px] break-all text-fg-muted",children:e.userAgent})]}),t.jsxs("dt",{className:"text-fg-subtle",children:["Detail",t.jsx("span",{className:"mt-0.5 block text-[10px] text-fg-subtle",children:"parameters only — never the job payload"})]}),t.jsx("dd",{children:e.detail?t.jsx(J0,{value:e.detail,defaultExpandDepth:3}):t.jsx("span",{className:"text-fg-subtle",children:"no parameters recorded"})})]})})})]})}function X_({entry:e,connectionStillExists:n}){if(!e.connectionId&&!e.queueName)return t.jsx("span",{className:"text-fg-subtle",children:"–"});const r=e.connectionName??e.connectionId;return t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-xs",children:[r&&t.jsx(t.Fragment,{children:n&&e.connectionId?t.jsx(Re,{to:oe.connection(e.connectionId),className:"text-accent hover:underline",children:r}):t.jsx(_e,{content:"This connection no longer exists — the name is the one it had at the time",children:t.jsx("span",{className:"cursor-help text-fg-muted line-through",children:r})})}),e.queueName&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-fg-subtle",children:"/"}),n&&e.connectionId?t.jsx(Re,{to:oe.queue(e.connectionId,e.queueName),className:"font-mono text-accent hover:underline",children:e.queueName}):t.jsx("span",{className:"font-mono text-fg-muted line-through",children:e.queueName})]}),e.jobId&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-fg-subtle",children:"/"}),n&&e.connectionId&&e.queueName?t.jsxs(Re,{to:oe.job(e.connectionId,e.queueName,e.jobId),className:"font-mono text-accent hover:underline",title:"The job may have been removed since",children:["#",e.jobId]}):t.jsxs("span",{className:"font-mono text-fg-muted",children:["#",e.jobId]})]})]})}function Y_(){const{has:e}=jt();return e("alerts")?t.jsx(e3,{}):t.jsx(t3,{})}function e3(){const r=(im().data??[]).filter(o=>o.enabled),i=o=>r.filter(c=>c.scope.type===o).length;return t.jsxs("div",{className:"max-w-xl space-y-4",children:[t.jsxs("p",{className:"text-xs text-fg-muted",children:[t.jsx("strong",{className:"font-medium text-fg",children:"Needs attention"})," is driven by your alert rules. Every queue that breaks an enabled rule gets a card at the top of the Overview, with the value, the window and the threshold. Paused queues and queues with a backlog but no worker are always flagged."]}),t.jsxs("ul",{className:"space-y-1 text-xs text-fg-muted",children:[t.jsxs("li",{children:["Scope each rule to ",t.jsx("span",{className:"text-fg",children:"every queue"}),", a ",t.jsx("span",{className:"text-fg",children:"connection"}),", a"," ",t.jsx("span",{className:"text-fg",children:"folder"})," or ",t.jsx("span",{className:"text-fg",children:"one queue"}),". The most specific rule of each kind wins, so a queue rule overrides the global one for that queue."]}),t.jsx("li",{children:"Failure count and failure rate come from BullMQ metrics over the window, so removeOnComplete cannot skew them."}),t.jsx("li",{children:"Processing time is the p50 or p95 of the jobs completed in the window."}),t.jsx("li",{children:"A rule without channels is dashboard only; add Slack or a webhook to be notified as well."})]}),t.jsx("p",{className:"text-xs text-fg-subtle",children:r.length===0?"No enabled rule yet.":`${r.length} enabled: ${i("global")} on every queue, ${i("connection")} per connection, ${i("folder")} per folder, ${i("queue")} per queue.`}),t.jsx(Re,{to:oe.alerts,className:"inline-flex text-xs text-accent hover:underline",children:"Manage rules →"})]})}function t3(){const{isAdmin:e}=yt(),n=v0(),r=d2(),[i,o]=N.useState(""),[c,d]=N.useState(""),h=n.data;if(N.useEffect(()=>{h&&(o(String(h.waitingAbove)),d(String(h.failedAbove)))},[h]),n.isLoading)return t.jsx(Dt,{});const m=fk.safeParse({waitingAbove:Number(i===""?0:i),failedAbove:Number(c===""?0:c)}),g=!!h&&m.success&&(m.data.waitingAbove!==h.waitingAbove||m.data.failedAbove!==h.failedAbove),p=()=>{m.success&&r.mutate(m.data,{onSuccess:()=>Y.success("Attention thresholds saved"),onError:v=>Y.error(ye(v))})};return t.jsxs("div",{className:"max-w-xl space-y-5",children:[t.jsxs("p",{className:"text-xs text-fg-muted",children:["When a queue shows up in ",t.jsx("strong",{className:"font-medium text-fg",children:"Needs attention"})," at the top of the Overview. Failing, paused and stuck-with-no-worker queues are always flagged — these two add the cases only you can define.",t.jsx("span",{className:"text-fg-subtle",children:" Set 0 to turn a rule off."})]}),t.jsxs("p",{className:"rounded-md border border-border bg-surface-2/50 px-3 py-2 text-xs text-fg-muted",children:[t.jsx("span",{className:"font-medium text-fg",children:"Pro:"})," rules per queue, folder, connection or everywhere, on failure rate and processing time over a window, measured from BullMQ metrics — the same rules can notify Slack or a webhook."," ",t.jsx(Re,{to:oe.alerts,className:"text-accent hover:underline",children:"See Alerts"})]}),t.jsx(Me,{label:"Waiting above",hint:"Flag a queue whose waiting backlog passes this, even when a worker is draining it. Leave at 0 if your queues run deep on purpose.",inputMode:"numeric",value:i,disabled:!e,onChange:v=>o(v.target.value.replace(/[^0-9]/g,""))}),t.jsx(Me,{label:"Failed above",hint:"Flag a queue whose failed list passes this. At 0 any failed job at all is flagged, which is the previous behaviour.",inputMode:"numeric",value:c,disabled:!e,onChange:v=>d(v.target.value.replace(/[^0-9]/g,""))}),e?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(V,{variant:"primary",disabled:!g||r.isPending,onClick:p,children:r.isPending?"Saving…":"Save"}),g&&t.jsx(V,{variant:"ghost",onClick:()=>{o(String((h==null?void 0:h.waitingAbove)??bu.waitingAbove)),d(String((h==null?void 0:h.failedAbove)??bu.failedAbove))},children:"Cancel"})]}):t.jsx("p",{className:"text-xs text-fg-subtle",children:"Only an administrator can change these."})]})}const eu={host:"localhost",port:"6379",username:"",password:"",db:"0",tls:!1};function n3(e){try{const n=new URL(e);if(n.protocol!=="redis:"&&n.protocol!=="rediss:")return{...eu};const r=Sv(n.password);return{host:n.hostname||eu.host,port:n.port||(n.protocol==="rediss:"?"6380":"6379"),username:Sv(n.username),password:r==="****"?"":r,db:n.pathname.replace(/^\//,"")||"0",tls:n.protocol==="rediss:"}}catch{return{...eu}}}function kv(e){const n=e.username||e.password?`${encodeURIComponent(e.username)}:${encodeURIComponent(e.password)}@`:"",r=e.host.includes(":")&&!e.host.startsWith("[")?`[${e.host}]`:e.host,i=e.db.trim()&&e.db.trim()!=="0"?`/${e.db.trim()}`:"";return`${e.tls?"rediss":"redis"}://${n}${r.trim()}:${e.port.trim()||"6379"}${i}`}function s3(e,n){return e.host!==n.host||e.port!==n.port||e.username!==n.username||e.db!==n.db||e.tls!==n.tls}function Sv(e){try{return decodeURIComponent(e)}catch{return e}}function r3(){var v;const{isAdmin:e}=yt(),{demo:n}=jt(),r=ds(),i=l2(),[o,c]=ko(),[d,h]=N.useState(null),[m,g]=N.useState(null);N.useEffect(()=>{if(e){if(o.get("new"))h({connection:null}),c({},{replace:!0});else if(o.get("edit")&&r.data){const j=r.data.find(C=>C.id===o.get("edit"));j&&h({connection:j}),c({},{replace:!0})}}},[o,c,r.data,e]);const p=r.data??[];return t.jsxs("div",{children:[t.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[t.jsxs("p",{className:"text-xs text-fg-muted",children:["Each connection points at one Redis (or cluster) with a BullMQ key prefix. Queues are discovered with ",t.jsx("span",{className:"font-mono",children:"SCAN"}),", never ",t.jsx("span",{className:"font-mono",children:"KEYS"}),"."]}),e&&t.jsx(V,{variant:"primary",size:"sm",leftIcon:t.jsx(Kn,{}),onClick:()=>h({connection:null}),disabled:n,title:n?"Locked in the demo":void 0,children:"Add connection"})]}),n&&t.jsx("p",{className:"mb-3 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning",children:"Demo mode: connections are read-only."}),t.jsx("div",{className:"card overflow-hidden",children:t.jsxs(os,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{children:"Name"}),t.jsx(fe,{children:"URL"}),t.jsx(fe,{children:"Prefix"}),t.jsx(fe,{children:"Filter"}),t.jsx(fe,{children:"Status"}),t.jsx(fe,{children:"Added"}),t.jsx(fe,{align:"right",children:t.jsx("span",{className:"sr-only",children:"Actions"})})]})}),t.jsxs("tbody",{children:[r.isLoading&&t.jsx(xt,{colSpan:7,children:t.jsx(Dt,{})}),r.data&&p.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:7,children:t.jsx(nn,{compact:!0,icon:t.jsx(Ji,{}),title:"No connections",description:e?"Add your first Redis connection.":"Ask an admin to add one."})})}),p.map(j=>{var C;return t.jsxs("tr",{children:[t.jsxs(me,{className:"font-medium",children:[t.jsx(Re,{to:oe.connection(j.id),className:"hover:underline",children:j.name}),j.cluster&&t.jsx(be,{variant:"outline",size:"xs",className:"ml-1.5",children:"cluster"})]}),t.jsx(me,{mono:!0,muted:!0,className:"max-w-xs truncate",title:j.url,children:j.url}),t.jsx(me,{mono:!0,children:j.prefix}),t.jsx(me,{mono:!0,muted:!0,children:j.queueFilter??"–"}),t.jsxs(me,{children:[t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zu,{status:j.status,withLabel:!0,pulse:!0}),((C=j.status)==null?void 0:C.ok)&&j.status.redisVersion&&t.jsxs("span",{className:"text-[11px] text-fg-subtle",children:["v",j.status.redisVersion]})]}),j.status&&!j.status.ok&&j.status.error&&t.jsx("p",{className:"mt-0.5 max-w-xs truncate text-[11px] text-danger",title:j.status.error,children:j.status.error})]}),t.jsx(me,{muted:!0,children:t.jsx(Kt,{value:j.createdAt})}),t.jsx(me,{align:"right",children:e&&t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(V,{size:"icon-xs",variant:"ghost","aria-label":"Edit connection",title:"Edit",onClick:()=>h({connection:j}),disabled:n,children:t.jsx(Po,{})}),t.jsx(V,{size:"icon-xs",variant:"ghost","aria-label":"Delete connection",title:"Delete",className:"hover:text-danger",onClick:()=>g(j),disabled:n,children:t.jsx(us,{})})]})})]},j.id)})]})]})}),d&&t.jsx(a3,{open:!0,onClose:()=>h(null),connection:d.connection},((v=d.connection)==null?void 0:v.id)??"new"),t.jsx(tn,{open:!!m,onClose:()=>g(null),title:`Remove "${m==null?void 0:m.name}"`,description:"Only the dashboard entry is removed. Nothing in Redis is touched. Folders and alerts pointing at this connection stop working.",confirmText:"Remove connection",danger:!0,typeToConfirm:m==null?void 0:m.name,loading:i.isPending,onConfirm:()=>m&&i.mutate(m.id,{onSuccess:()=>(g(null),Y.success("Connection removed")),onError:j=>Y.error(ye(j))})})]})}function a3({open:e,onClose:n,connection:r}){const i=a2(),o=i2(),c=o2(),[d,h]=N.useState({name:(r==null?void 0:r.name)??"",url:r?"":"redis://localhost:6379",prefix:(r==null?void 0:r.prefix)??"bull",cluster:(r==null?void 0:r.cluster)??!1,queueFilter:(r==null?void 0:r.queueFilter)??""}),[m,g]=N.useState({}),[p,v]=N.useState(null),[j,C]=N.useState("fields"),y=r?n3(r.url):eu,[b,k]=N.useState(y),S=(z,B)=>{h(U=>({...U,[z]:B})),v(null)},O=(z,B)=>{k(U=>({...U,[z]:B})),v(null)},q=()=>j==="url"?d.url.trim():r&&!b.password&&!s3(b,y)?"":kv(b),E=()=>{const z=q(),B={name:d.name.trim(),url:z,prefix:d.prefix.trim()||"bull",cluster:d.cluster,queueFilter:d.queueFilter.trim()||null};r&&!B.url&&(B.url=r.url);const U=Xy.safeParse(B);if(!U.success){const J={};for(const we of U.error.issues)J[String(we.path[0])]=we.message;return g(J),null}return g({}),U.data},T=()=>{const z=E();if(!z)return;const B=U=>{Y.success(`Connection "${U.name}" saved`),n()};if(r){const U={name:z.name,prefix:z.prefix,cluster:z.cluster,queueFilter:z.queueFilter};q()&&(U.url=z.url),o.mutate({id:r.id,input:U},{onSuccess:B,onError:J=>Y.error(ye(J))})}else i.mutate(z,{onSuccess:B,onError:U=>Y.error(ye(U))})},M=()=>{const z=q();if(!z){g({url:r?j==="url"?"Enter the URL (with password) to test it":"Enter the password to test the stored connection":"URL is required"});return}c.mutate({url:z,prefix:d.prefix.trim()||void 0,cluster:d.cluster},{onSuccess:v,onError:B=>v({ok:!1,error:ye(B)})})},$=i.isPending||o.isPending;return t.jsx(Sn,{open:e,onClose:n,size:"md",title:r?`Edit ${r.name}`:"Add connection",description:"Credentials are stored server-side and never sent back to the browser.",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),t.jsx(V,{variant:"secondary",size:"sm",leftIcon:t.jsx(Iy,{}),onClick:M,loading:c.isPending,children:"Test connection"}),t.jsx(V,{variant:"primary",size:"sm",onClick:T,loading:$,children:r?"Save":"Add connection"})]}),children:t.jsxs("form",{className:"space-y-3",onSubmit:z=>{z.preventDefault(),T()},children:[t.jsx(Me,{label:"Name",autoFocus:!0,value:d.name,onChange:z=>S("name",z.target.value),error:m.name,placeholder:"production"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-medium text-fg-muted",children:"Redis"}),t.jsx("div",{className:"inline-flex rounded-md border border-border p-0.5 text-xs",role:"tablist","aria-label":"How to enter the Redis address",children:["fields","url"].map(z=>t.jsx("button",{type:"button",role:"tab","aria-selected":j===z,className:`rounded px-2 py-0.5 ${j===z?"bg-surface-3 text-fg":"text-fg-muted hover:text-fg"}`,onClick:()=>(C(z),v(null)),children:z==="fields"?"Host & password":"Connection URL"},z))})]}),j==="url"?t.jsx(Me,{label:"Redis URL",mono:!0,value:d.url,onChange:z=>S("url",z.target.value),error:m.url,placeholder:r?`${r.url} (leave empty to keep)`:"redis://:password@host:6379/0",hint:"redis:// or rediss:// (TLS). Include the password; it is redacted everywhere in the UI.",autoComplete:"off",spellCheck:!1}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"grid gap-3 sm:grid-cols-[1fr_120px]",children:[t.jsx(Me,{label:"Host",mono:!0,value:b.host,onChange:z=>O("host",z.target.value),placeholder:"cache.internal",autoComplete:"off",spellCheck:!1}),t.jsx(Me,{label:"Port",mono:!0,inputMode:"numeric",value:b.port,onChange:z=>O("port",z.target.value)})]}),t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[t.jsx(Me,{label:"Username (optional)",mono:!0,value:b.username,onChange:z=>O("username",z.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1}),t.jsx(Me,{label:"Password",type:"password",mono:!0,value:b.password,onChange:z=>O("password",z.target.value),placeholder:r?"leave empty to keep the stored one":"optional",hint:r?"Stored server-side and never shown again. Changing the host or TLS needs it typed again.":"Stored server-side, redacted everywhere in the UI.",autoComplete:"new-password"})]}),t.jsxs("div",{className:"grid items-end gap-3 sm:grid-cols-[120px_1fr]",children:[t.jsx(Me,{label:"Database",mono:!0,inputMode:"numeric",value:b.db,onChange:z=>O("db",z.target.value)}),t.jsxs("div",{className:"flex items-start gap-2.5 pb-1",children:[t.jsx(Ki,{checked:b.tls,onChange:z=>O("tls",z),label:"TLS",className:"mt-0.5"}),t.jsxs("button",{type:"button",className:"text-left text-xs",onClick:()=>O("tls",!b.tls),children:[t.jsx("span",{className:"font-medium text-fg",children:"TLS"}),t.jsx("span",{className:"text-fg-muted",children:" (rediss://) — required by ElastiCache with in-transit encryption, Redis Cloud, Upstash and most managed Redis."})]})]})]}),m.url&&t.jsx("p",{className:"text-xs text-danger",children:m.url}),t.jsx("p",{className:"font-mono text-[11px] text-fg-subtle",children:q()?kv({...b,password:b.password?"****":""}):`${(r==null?void 0:r.url)??""} (unchanged)`})]}),t.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[t.jsx(Me,{label:"Key prefix",mono:!0,value:d.prefix,onChange:z=>S("prefix",z.target.value),error:m.prefix,hint:"BullMQ default is bull"}),t.jsx(Me,{label:"Queue filter (optional)",mono:!0,value:d.queueFilter,onChange:z=>S("queueFilter",z.target.value),error:m.queueFilter,placeholder:"payments-*",hint:"Glob over queue names; limits discovery."})]}),t.jsx(fm,{label:"Redis Cluster",description:"Use cluster-aware client. Each queue lives in one hash slot, so all reads stay single-node.",checked:d.cluster,onChange:z=>S("cluster",z.target.checked)}),p&&t.jsxs("div",{className:`flex items-start gap-2 rounded-md border px-3 py-2 text-xs ${p.ok?"border-success/40 bg-success/10 text-success":"border-danger/40 bg-danger/10 text-danger"}`,role:"status",children:[p.ok?t.jsx(Vf,{className:"mt-px size-4 shrink-0"}):t.jsx(Cy,{className:"mt-px size-4 shrink-0"}),t.jsx("div",{children:p.ok?t.jsxs(t.Fragment,{children:["Connected",p.latencyMs!=null&&` in ${p.latencyMs} ms`,p.redisVersion&&` · Redis ${p.redisVersion}`,p.queuesFound!=null&&` · ${p.queuesFound} queues found`]}):t.jsxs(t.Fragment,{children:["Failed: ",p.error??"unknown error"]})})]})]})})}const Cv={active:{label:"active",variant:"success"},grace:{label:"grace period",variant:"warning"},expired:{label:"expired",variant:"danger"},invalid:{label:"invalid",variant:"danger"}};function i3(e){if(e.source==="offline")return e.status==="expired"?"This offline key has expired. Ask for a renewed key or activate a subscription key.":e.status==="invalid"?"This key does not verify against this build. Paste it again or ask for a new one.":null;switch(e.status){case"grace":return`bullpane.com could not be reached (${e.lastCheckError??"unknown error"}). Pro keeps working until ${fn(e.leaseExpiresAt)}; the server retries once a day, or check now.`;case"expired":return e.lastCheckError?`${e.lastCheckError} Renew the subscription on bullpane.com, then check again.`:"The lease ran out without reaching bullpane.com. Restore the connection and check now.";case"invalid":return e.lastCheckError??"The store rejected this key.";default:return null}}function l3(){const{isAdmin:e,setEdition:n}=yt(),{edition:r,isPro:i,demo:o,pricing:c,checkoutUrl:d,has:h}=jt(),m=C2(),g=P2(),p=_2(),[v,j]=N.useState(""),[C,y]=N.useState(null),[b,k]=N.useState(!1),S=()=>{const M=v.trim();if(!M){y("Paste the license key");return}y(null),m.mutate(M,{onSuccess:$=>{n($),j(""),Y.success("Pro unlocked",$.license?`Licensed to ${$.license.licensee}`:void 0)},onError:$=>{Gs($)&&($.body.error==="invalid_license"||$.body.error==="license_already_activated"||$.body.error==="license_server_unavailable")?y($.body.message||"This key is not valid"):y(ye($))}})},O=()=>p.mutate(void 0,{onSuccess:M=>{var z,B,U,J;n(M);const $=(z=M.license)==null?void 0:z.status;$==="active"?Y.success("License verified",`Lease renewed until ${fn((B=M.license)==null?void 0:B.leaseExpiresAt)}`):$==="grace"?Y.error("Could not reach bullpane.com",((U=M.license)==null?void 0:U.lastCheckError)??void 0):Y.error("License not valid",((J=M.license)==null?void 0:J.lastCheckError)??void 0)},onError:M=>Y.error(ye(M))}),q=r.license,E=q?i3(q):null,T=(q==null?void 0:q.source)==="online";return t.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_360px]",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"card p-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-lg bg-surface-2",children:i?t.jsx(Iu,{className:"size-5 text-pro"}):t.jsx(ro,{className:"size-5 text-fg-subtle"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-sm font-semibold",children:o?"Demo mode":i?"Pro edition":"Free edition"}),t.jsx(om,{})]}),t.jsx("p",{className:"text-xs text-fg-muted",children:o?"Every Pro feature is unlocked for the playground. Settings that could break the demo are read-only.":i?"All features unlocked for this installation.":"Everything bull-board does, plus search. Team features need a Pro key."})]}),T&&e&&!o&&t.jsx(V,{variant:"outline",size:"sm",leftIcon:t.jsx(Kf,{}),onClick:O,loading:p.isPending,children:"Check now"})]}),q&&t.jsxs("dl",{className:"mt-4 grid grid-cols-2 gap-3 border-t border-border pt-4 text-xs sm:grid-cols-4",children:[t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"Licensee"}),t.jsx("dd",{className:"truncate text-fg",children:q.licensee})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"Email"}),t.jsx("dd",{className:"truncate text-fg",children:q.email})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:T?"Plan":"Issued"}),t.jsx("dd",{className:"text-fg",children:T?"Subscription":wu(q.issuedAt)})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:T?"Paid until":"Expires"}),t.jsxs("dd",{className:"text-fg",children:[q.expiresAt?wu(q.expiresAt):T?"Renews automatically":"Never"," ",t.jsx(be,{variant:Cv[q.status].variant,size:"xs",className:"ml-1",children:Cv[q.status].label})]})]}),T&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"Last verified"}),t.jsx("dd",{className:"text-fg",title:q.lastCheckedAt?fn(q.lastCheckedAt):void 0,children:q.lastCheckedAt?Ur(q.lastCheckedAt):"never"})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"Works offline until"}),t.jsx("dd",{className:"text-fg",children:fn(q.leaseExpiresAt)})]}),t.jsxs("div",{className:"col-span-2",children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"Activation"}),t.jsx("dd",{className:"truncate font-mono text-fg",children:q.activationId})]})]})]}),E&&t.jsx("p",{className:`mt-3 rounded-md border px-3 py-2 text-xs ${(q==null?void 0:q.status)==="grace"?"border-warning/40 bg-warning/10 text-warning":"border-danger/40 bg-danger/10 text-danger"}`,children:E}),o&&t.jsx("p",{className:"mt-3 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning",children:"Demo mode notice: license changes are blocked here. Run your own instance to activate a key."})]}),t.jsxs("div",{className:"card p-4",children:[t.jsx("h3",{className:"mb-3 text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:"Features"}),t.jsx("ul",{className:"grid gap-2 sm:grid-cols-2",children:Yf.map(M=>t.jsxs("li",{className:"flex items-start gap-2 rounded-md border border-border p-2.5 text-xs",children:[h(M)?t.jsx(Qr,{className:"mt-px size-4 shrink-0 text-success"}):t.jsx(ro,{className:"mt-px size-4 shrink-0 text-fg-subtle"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-fg",children:oo[M].title}),t.jsx("p",{className:"text-fg-muted",children:oo[M].tagline})]})]},M))})]})]}),t.jsxs("div",{className:"space-y-4",children:[e?t.jsxs("div",{className:"card p-4",children:[t.jsxs("h3",{className:"mb-1 flex items-center gap-2 text-sm font-semibold",children:[t.jsx(Yi,{className:"size-4"})," ",i&&!o?"Replace license key":"Activate a license key"]}),t.jsx("p",{className:"mb-3 text-xs text-fg-muted",children:"Paste the key from your bullpane.com receipt. One key runs one installation: it is activated once against bullpane.com, re-checked daily, and keeps working for 7 days without internet. Nothing about your queues or jobs is sent."}),t.jsx(Hi,{mono:!0,rows:3,value:v,onChange:M=>j(M.target.value),placeholder:"BULLPANE-XXXX-XXXX-XXXX",error:C,spellCheck:!1,disabled:o,"aria-label":"License key"}),t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[t.jsx(V,{variant:"primary",size:"sm",onClick:S,loading:m.isPending,disabled:o,children:"Activate"}),q&&!o&&t.jsx(V,{variant:"ghost",size:"sm",className:"hover:text-danger",leftIcon:t.jsx(us,{}),onClick:()=>k(!0),children:"Remove license"})]})]}):t.jsx("div",{className:"card p-4 text-xs text-fg-muted",children:"Only admins can change the license."}),!i&&t.jsxs("div",{className:"card border-pro/30 p-4",children:[t.jsxs("p",{className:"text-sm font-semibold",children:["Unlock Pro · $",c.monthlyUsd,"/month or $",c.yearlyUsd,"/year"]}),t.jsx("p",{className:"mt-1 text-xs text-fg-muted",children:"One installation, unlimited connections, queues and users. Cancel any time; your data stays."}),t.jsxs("a",{href:d||"#",target:"_blank",rel:"noreferrer noopener","aria-disabled":!d,className:"mt-3 inline-flex h-8 items-center gap-2 rounded-md bg-accent px-3 text-xs font-medium text-accent-fg hover:bg-accent-hover aria-disabled:pointer-events-none aria-disabled:opacity-50",children:["Get a key ",t.jsx(Lr,{className:"size-3.5"})]})]})]}),t.jsx(tn,{open:b,onClose:()=>k(!1),title:"Remove license",description:T?"The installation goes back to the free edition, which has NO LOGIN: anyone who can reach this URL will be able to retry, promote and delete jobs. The key is released so it can be activated on another server. Alerts, folders, flow edges and your user accounts are kept in the database but become inaccessible until a key is activated again.":"The installation goes back to the free edition, which has NO LOGIN: anyone who can reach this URL will be able to retry, promote and delete jobs. Alerts, folders, flow edges and your user accounts are kept in the database but become inaccessible until a key is activated again.",confirmText:"Remove license",danger:!0,loading:g.isPending,onConfirm:()=>g.mutate(void 0,{onSuccess:M=>{n(M),k(!1),Y.success("License removed")},onError:M=>Y.error(ye(M))})})]})}function o3(){const e=Bk(),{edition:n,checkoutUrl:r}=jt();return t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[t.jsxs("div",{className:"card p-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(cm,{className:"size-9"}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-sm font-semibold",children:"Bullpane"}),t.jsx("p",{className:"text-xs text-fg-muted",children:"Self-hosted dashboard for BullMQ and BullMQ Pro."})]})]}),t.jsxs("dl",{className:"mt-4 grid grid-cols-2 gap-3 border-t border-border pt-4 text-xs",children:[t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"Server version"}),t.jsx("dd",{className:"font-mono text-fg",children:e.data?e.data.version:e.isError?"unknown":t.jsx(ou,{})})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"Server uptime"}),t.jsx("dd",{className:"text-fg",children:e.data?nm(e.data.uptime):e.isError?"unknown":t.jsx(ou,{})})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"Edition"}),t.jsxs("dd",{className:"text-fg",children:[n.tier,n.demo&&" (demo)"]})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"text-[10px] tracking-wide text-fg-subtle uppercase",children:"UI build"}),t.jsx("dd",{className:"font-mono text-fg",children:"production"})]})]})]}),t.jsxs("div",{className:"card p-4",children:[t.jsx("h3",{className:"mb-2 text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:"Links"}),t.jsxs("ul",{className:"space-y-1.5 text-[13px]",children:[t.jsx("li",{children:t.jsxs("a",{href:"https://docs.bullmq.io",target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1.5 text-accent hover:underline",children:["BullMQ documentation ",t.jsx(Lr,{className:"size-3.5"})]})}),r&&t.jsx("li",{children:t.jsxs("a",{href:r,target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1.5 text-accent hover:underline",children:["Buy a Pro license (from $",n.pricing.monthlyUsd,"/mo) ",t.jsx(Lr,{className:"size-3.5"})]})}),t.jsx("li",{children:t.jsxs("a",{href:"/api/health",target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center gap-1.5 text-accent hover:underline",children:["API health ",t.jsx(Lr,{className:"size-3.5"})]})})]}),t.jsx("h3",{className:"mt-5 mb-2 text-xs font-semibold tracking-wider text-fg-subtle uppercase",children:"How it reads Redis"}),t.jsxs("ul",{className:"list-disc space-y-1 pl-4 text-xs text-fg-muted",children:[t.jsxs("li",{children:["Discovery via ",t.jsx("span",{className:"font-mono",children:"SCAN"}),", never ",t.jsx("span",{className:"font-mono",children:"KEYS"}),"; cached 30 s."]}),t.jsx("li",{children:"Counts, pages and details are single Lua round trips per queue."}),t.jsx("li",{children:"Payloads are truncated inside Redis for list views."}),t.jsx("li",{children:"Writes go through the official bullmq library."})]})]})]})}const c3={oidc:"OIDC",saml:"SAML 2.0"};function u3(){const{has:e}=jt();return e("sso")?t.jsx(d3,{}):t.jsx(Oa,{feature:"sso"})}function tu({label:e,value:n}){const[r,i]=N.useState(!1);return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-24 shrink-0 text-[11px] uppercase tracking-wide text-fg-subtle",children:e}),t.jsx("code",{className:"min-w-0 flex-1 truncate rounded bg-surface-2 px-2 py-1 text-[11px] text-fg-muted",children:n}),t.jsx(V,{size:"icon-xs",variant:"ghost","aria-label":`Copy ${e}`,onClick:()=>{var o;(o=navigator.clipboard)==null||o.writeText(n).then(()=>{i(!0),setTimeout(()=>i(!1),1500)},()=>Y.error("Could not copy to the clipboard"))},children:r?t.jsx(Qr,{className:"size-3 text-success"}):t.jsx(Py,{className:"size-3"})})]})}function d3(){var k;const e=R2(),n=w0(),r=N0(),i=T2(),o=I2(),c=q2(),[d,h]=N.useState(!1),[m,g]=N.useState(null),[p,v]=N.useState({}),j=e.data??[],C=j.filter(S=>S.enabled).length,y=((k=n.data)==null?void 0:k.requireSso)??!1,b=async S=>{try{const O=await c.mutateAsync(S.id);v(q=>({...q,[S.id]:O}))}catch(O){v(q=>({...q,[S.id]:{ok:!1,message:ye(O)}}))}};return t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Single sign-on"}),t.jsxs("p",{className:"mt-1 max-w-2xl text-xs text-fg-muted",children:["Let your team sign in with your identity provider. By default accounts are not created automatically: add the person under ",t.jsx("span",{className:"text-fg",children:"Users & roles"})," first, then they can sign in with SSO using that same email. Or turn on ",t.jsx("span",{className:"text-fg",children:"auto-provisioning"})," below for your company's email domains."]})]}),t.jsx(V,{variant:"primary",leftIcon:t.jsx(Kn,{className:"size-4"}),onClick:()=>h(!0),children:"Add provider"})]}),e.isLoading?t.jsx("div",{className:"flex justify-center py-8",children:t.jsx(Dt,{})}):j.length===0?t.jsxs("div",{className:"card p-6 text-center",children:[t.jsx(Iu,{className:"mx-auto size-6 text-fg-subtle"}),t.jsx("p",{className:"mt-2 text-sm text-fg",children:"No identity provider yet"}),t.jsx("p",{className:"mx-auto mt-1 max-w-md text-xs text-fg-muted",children:"Add an OIDC provider (Google Workspace, Microsoft Entra ID, Okta, Keycloak, Authentik) or a SAML 2.0 provider."})]}):t.jsx("div",{className:"space-y-3",children:j.map(S=>{const O=p[S.id];return t.jsxs("div",{className:"card p-4",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"truncate text-sm font-medium text-fg",children:S.name}),t.jsx(be,{variant:"neutral",children:c3[S.kind]}),!S.enabled&&t.jsx(be,{variant:"warning",children:"disabled"}),S.kind==="oidc"&&!S.hasSecret&&t.jsx(be,{variant:"danger",children:"no client secret"})]}),t.jsx("p",{className:"mt-1 truncate text-xs text-fg-muted",children:S.kind==="oidc"?String(S.config.issuer??""):String(S.config.entryPoint??"")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t.jsx(Ki,{checked:S.enabled,label:"Enabled",onChange:q=>{i.mutate({id:S.id,input:{enabled:q}},{onError:E=>Y.error(ye(E))})}}),t.jsx(V,{size:"sm",variant:"secondary",leftIcon:t.jsx(Iy,{className:"size-3.5"}),loading:c.isPending&&c.variables===S.id,onClick:()=>void b(S),children:"Test"}),t.jsx(V,{size:"icon-sm",variant:"ghost","aria-label":"Delete provider",onClick:()=>g(S),children:t.jsx(us,{className:"size-3.5"})})]})]}),t.jsx("div",{className:"mt-3 space-y-1.5 border-t border-border pt-3",children:S.kind==="oidc"?t.jsx(tu,{label:"Redirect URI",value:S.callbackUrl}):t.jsxs(t.Fragment,{children:[t.jsx(tu,{label:"ACS URL",value:S.callbackUrl}),S.entityId&&t.jsx(tu,{label:"Entity ID",value:S.entityId})]})}),O&&t.jsxs("div",{className:`mt-3 rounded-md border px-3 py-2 text-xs ${O.ok?"border-success/40 bg-success/10 text-success":"border-danger/40 bg-danger/10 text-danger"}`,children:[t.jsxs("p",{className:"flex items-center gap-1.5 font-medium",children:[O.ok?t.jsx(Qr,{className:"size-3.5"}):t.jsx(mn,{className:"size-3.5"}),O.message]}),O.details&&t.jsx("dl",{className:"mt-2 space-y-0.5 text-fg-muted",children:Object.entries(O.details).map(([q,E])=>t.jsxs("div",{className:"flex gap-2",children:[t.jsx("dt",{className:"w-44 shrink-0 font-mono text-[10px] uppercase",children:q}),t.jsx("dd",{className:"min-w-0 truncate font-mono text-[10px]",children:E})]},q))})]})]},S.id)})}),t.jsxs("div",{className:"card p-4",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-fg",children:"Require SSO"}),t.jsxs("p",{className:"mt-1 max-w-2xl text-xs text-fg-muted",children:["Hide the password form and send everyone through your identity provider."," ",t.jsx("span",{className:"text-fg",children:"Admin accounts keep password sign-in"})," so a misconfigured provider cannot lock you out of your own installation. Set ",t.jsx("code",{className:"text-[11px]",children:"BULLPANE_ALLOW_PASSWORD_LOGIN=true"})," to allow it for everyone."]})]}),t.jsx(Ki,{checked:y,disabled:n.isLoading||r.isPending,onChange:S=>{r.mutate({requireSso:S},{onSuccess:()=>Y.success(S?"SSO is now required":"Password sign-in is available again"),onError:O=>Y.error(ye(O))})}})]}),y&&C===0&&t.jsxs("p",{className:"mt-3 flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning",children:[t.jsx(Zn,{className:"size-3.5 shrink-0"}),"SSO is required but no provider is enabled. Only admins can sign in right now."]})]}),t.jsx(h3,{}),d&&t.jsx(f3,{onClose:()=>h(!1)}),t.jsx(tn,{open:m!==null,title:"Delete this provider?",confirmText:"Delete",danger:!0,description:m?`Anyone who signs in through "${m.name}" will have to use another method. The Bullpane accounts themselves are not touched.`:"",loading:o.isPending,onClose:()=>g(null),onConfirm:()=>{m&&o.mutate(m.id,{onSuccess:()=>{Y.success(`Deleted ${m.name}`),g(null)},onError:S=>{Y.error(ye(S)),g(null)}})}})]})}function h3(){var p,v;const e=w0(),n=N0(),r=((p=e.data)==null?void 0:p.autoProvisionDomains)??[],i=((v=e.data)==null?void 0:v.autoProvision)??!1,[o,c]=N.useState(null),[d,h]=N.useState(null),m=o??r.join(", "),g=()=>{h(null);const j=m.split(/[\s,]+/).map(y=>y.trim()).filter(y=>y!==""),C=[];for(const y of j){const b=Jy.safeParse(y);if(!b.success){h(`"${y}" is not a domain. Use something like example.com.`);return}C.push(b.data)}n.mutate({autoProvisionDomains:C},{onSuccess:()=>{c(null),Y.success("Domains saved")},onError:y=>h(ye(y))})};return t.jsxs("div",{className:"card p-4",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-fg",children:"Let anyone from your domains sign in"}),t.jsxs("p",{className:"mt-1 max-w-2xl text-xs text-fg-muted",children:["When someone your identity provider authenticates has no Bullpane account yet and their email ends in one of the domains below, create one for them as a ",t.jsx("span",{className:"text-fg",children:"viewer"})," instead of refusing. They can look at every queue but change nothing; promote them under Users & roles if they need more. Disabled accounts stay disabled."]})]}),t.jsx(Ki,{checked:i,label:"Auto-provision SSO accounts",disabled:e.isLoading||n.isPending,onChange:j=>{if(j&&r.length===0){h("Save at least one domain first.");return}n.mutate({autoProvision:j},{onSuccess:()=>Y.success(j?"New SSO users from your domains now get a viewer account":"SSO accounts must be invited again"),onError:C=>Y.error(ye(C))})}})]}),t.jsxs("div",{className:"mt-3 flex items-start gap-2",children:[t.jsx(Me,{label:"Allowed email domains",hint:"Comma separated. Exact match: example.com does not include sub.example.com.",placeholder:"example.com",mono:!0,wrapperClassName:"flex-1",value:m,onChange:j=>c(j.target.value),error:d??void 0}),t.jsx(V,{className:"mt-5",variant:"secondary",disabled:o===null,loading:n.isPending,onClick:g,children:"Save"})]})]})}function f3({onClose:e}){const n=M2(),[r,i]=N.useState("oidc"),[o,c]=N.useState(""),[d,h]=N.useState(""),[m,g]=N.useState(""),[p,v]=N.useState(""),[j,C]=N.useState(""),[y,b]=N.useState(""),[k,S]=N.useState(""),[O,q]=N.useState(""),[E,T]=N.useState(""),[M,$]=N.useState(null),z=()=>{var J;$(null);const B=r==="oidc"?{kind:"oidc",name:o.trim(),config:{issuer:d.trim(),clientId:m.trim(),clientSecret:p,...j.trim()?{emailClaim:j.trim()}:{}}}:{kind:"saml",name:o.trim(),config:{entryPoint:y.trim(),issuer:k.trim(),idpCert:O.trim(),...E.trim()?{emailAttribute:E.trim()}:{}}},U=ok.safeParse(B);if(!U.success){$(((J=U.error.issues[0])==null?void 0:J.message)??"Check the fields above");return}n.mutate(U.data,{onSuccess:we=>{Y.success(`Added ${we.name}. Enter the redirect URI at your IdP, then use Test.`),e()},onError:we=>$(ye(we))})};return t.jsx(Sn,{open:!0,onClose:e,title:"Add an identity provider",description:"Unless auto-provisioning is on, invite people under Users & roles first.",size:"md",footer:t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",onClick:e,children:"Cancel"}),t.jsx(V,{variant:"primary",loading:n.isPending,onClick:z,children:"Add provider"})]}),children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs(ut,{label:"Protocol",value:r,onChange:B=>i(B.target.value),children:[t.jsx("option",{value:"oidc",children:"OIDC / OpenID Connect"}),t.jsx("option",{value:"saml",children:"SAML 2.0"})]}),t.jsx(Me,{label:"Display name",placeholder:r==="oidc"?"Google Workspace":"Corporate SSO",hint:"Shown on the sign-in button.",value:o,onChange:B=>c(B.target.value),required:!0}),r==="oidc"?t.jsxs(t.Fragment,{children:[t.jsx(Me,{label:"Issuer URL",placeholder:"https://accounts.google.com",hint:"Endpoints are discovered from /.well-known/openid-configuration, so this is the only URL you need.",value:d,onChange:B=>h(B.target.value),required:!0}),t.jsx(Me,{label:"Client ID",value:m,onChange:B=>g(B.target.value),required:!0}),t.jsx(Me,{label:"Client secret",type:"password",hint:"Stored encrypted and never shown again.",value:p,onChange:B=>v(B.target.value),required:!0}),t.jsx(Me,{label:"Email claim (optional)",placeholder:"email",hint:"Override only if your provider puts the email somewhere else, e.g. upn.",value:j,onChange:B=>C(B.target.value)})]}):t.jsxs(t.Fragment,{children:[t.jsx(Me,{label:"Sign-in URL (SSO endpoint)",placeholder:"https://idp.example.com/sso/saml",value:y,onChange:B=>b(B.target.value),required:!0}),t.jsx(Me,{label:"IdP entity ID",placeholder:"https://idp.example.com/metadata",value:k,onChange:B=>S(B.target.value),required:!0}),t.jsx(Hi,{label:"IdP signing certificate",rows:5,placeholder:"-----BEGIN CERTIFICATE-----",hint:"PEM or base64. Assertions must be signed; there is no way to disable that.",value:O,onChange:B=>q(B.target.value),required:!0}),t.jsx(Me,{label:"Email attribute (optional)",placeholder:"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",value:E,onChange:B=>T(B.target.value)})]}),M&&t.jsx("p",{role:"alert",className:"rounded-md border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger",children:M})]})})}const _v=[{value:"off",label:"Off",hint:"No MCP client can connect or call anything."},{value:"read",label:"Read only",hint:"Clients can list queues, read jobs, logs and schedulers. Nothing changes."},{value:"write",label:"Read & write",hint:"Operators and admins may also let a client retry, promote, remove and add jobs and pause queues. Viewers still only read."}];function m3(){const{has:e}=jt();return e("mcp")?t.jsx(p3,{}):t.jsx(Oa,{feature:"mcp"})}function p3(){var C;const{isAdmin:e}=yt(),n=O2(),r=$2(),[i,o]=N.useState(!1),c=z2(e&&i),d=A2(),[h,m]=N.useState(null);if(n.isLoading||!n.data)return t.jsx("div",{className:"flex justify-center py-8",children:t.jsx(Dt,{})});const{maxAccess:g,endpoint:p,reachableFromCloud:v}=n.data,j=c.data??[];return t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:"MCP"}),t.jsx("p",{className:"mt-1 max-w-2xl text-xs text-fg-muted",children:"Connect your AI to this Bullpane: Claude, or any MCP client that supports OAuth. Each person signs in with their own Bullpane login (or SSO) and picks read or read & write. A client acts as that person, with their role: what they cannot do in the dashboard, the client cannot do either. Every change is in the audit log, and draining, cleaning or obliterating a queue always comes back here for a human to confirm."})]}),t.jsxs("div",{className:"card space-y-3 p-4",children:[t.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-fg-subtle",children:"Access for MCP clients"}),t.jsx(ut,{label:"Most a client can do on this install",value:g,disabled:!e||r.isPending,onChange:y=>r.mutate({maxAccess:y.target.value},{onSuccess:()=>Y.success("MCP access updated. It applies to connected clients on their next call."),onError:b=>Y.error(ye(b))}),options:_v.map(y=>({value:y.value,label:y.label})),hint:e?(C=_v.find(y=>y.value===g))==null?void 0:C.hint:"Only an admin can change this.",wrapperClassName:"max-w-md"})]}),t.jsxs("div",{className:"card space-y-3 p-4",children:[t.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-fg-subtle",children:"Connect a client"}),t.jsx(tu,{label:"Server URL",value:p}),!v&&t.jsxs("div",{className:"flex gap-2 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-fg",children:[t.jsx(Zn,{className:"mt-0.5 size-3.5 shrink-0 text-warning"}),t.jsxs("span",{children:["Cloud-hosted clients such as claude.ai and Claude Desktop connect from their provider's servers, so they need this URL to be public HTTPS. It looks private (check ",t.jsx("span",{className:"font-mono",children:"PUBLIC_URL"}),"). Clients that run on your machine, such as Claude Code, work on a private network."]})]}),t.jsxs("dl",{className:"space-y-2 text-xs text-fg-muted",children:[t.jsxs("div",{children:[t.jsx("dt",{className:"font-medium text-fg",children:"claude.ai and Claude Desktop"}),t.jsx("dd",{children:"Settings → Connectors → Add custom connector, paste the server URL, then Connect and sign in."})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"font-medium text-fg",children:"Claude Code"}),t.jsxs("dd",{children:[t.jsxs("code",{className:"rounded bg-surface-2 px-1.5 py-0.5 font-mono text-[11px]",children:["claude mcp add --transport http bullpane ",p]}),", then run ",t.jsx("code",{className:"font-mono",children:"/mcp"})," to sign in."]})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"font-medium text-fg",children:"Any other MCP client"}),t.jsx("dd",{children:"Add the server URL as a remote (HTTP) MCP server. The client registers itself and opens this Bullpane to sign in."})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-fg-subtle",children:i?"All connected clients":"Your connected clients"}),e&&t.jsx(V,{size:"sm",variant:"ghost",onClick:()=>o(y=>!y),children:i?"Show only mine":"Show everyone's"})]}),c.isLoading?t.jsx("div",{className:"flex justify-center py-6",children:t.jsx(Dt,{})}):j.length===0?t.jsxs("div",{className:"card p-6 text-center",children:[t.jsx(ky,{className:"mx-auto size-6 text-fg-subtle"}),t.jsx("p",{className:"mt-2 text-sm text-fg",children:"No client connected"}),t.jsx("p",{className:"mx-auto mt-1 max-w-md text-xs text-fg-muted",children:"Add the server URL to Claude and sign in; the connection shows up here."})]}):t.jsx("div",{className:"card divide-y divide-border",children:j.map(y=>t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"truncate text-sm font-medium text-fg",children:y.clientName}),t.jsx(be,{variant:y.access==="write"?"warning":"neutral",children:y.access==="write"?"read & write":"read"})]}),t.jsxs("p",{className:"mt-0.5 truncate text-xs text-fg-muted",children:[i&&t.jsxs(t.Fragment,{children:[y.userEmail," · "]}),y.redirectHost," · connected ",Ur(y.createdAt)," · ",y.lastUsedAt?`last used ${Ur(y.lastUsedAt)}`:"not used yet"]})]}),t.jsx(V,{size:"sm",variant:"ghost",leftIcon:t.jsx(Zf,{className:"size-3.5"}),onClick:()=>m(y),children:"Disconnect"})]},y.id))})]}),t.jsx(tn,{open:h!==null,onClose:()=>m(null),title:"Disconnect client",description:h?`${h.clientName} (${h.userEmail}) loses access on its next call. Connecting again needs a new sign-in.`:void 0,confirmText:"Disconnect",danger:!0,loading:d.isPending,onConfirm:()=>h&&d.mutate(h.id,{onSuccess:()=>{Y.success(`${h.clientName} disconnected`),m(null)},onError:y=>Y.error(ye(y))})})]})}const x3=["connections","attention","sso","mcp","license","about"];function g3(){const{tab:e}=zn(),n=sn();if(!e||!x3.includes(e))return t.jsx(Fr,{to:"/settings/connections",replace:!0});const r=e;return t.jsxs(vt,{children:[t.jsx(hs,{title:"Settings"}),t.jsx(Cm,{"aria-label":"Settings sections",className:"mb-5",value:r,onChange:i=>n(`/settings/${i}`),items:[{value:"connections",label:"Connections",icon:t.jsx(Ji,{className:"size-3.5"})},{value:"attention",label:"Attention",icon:t.jsx(Zn,{className:"size-3.5"})},{value:"sso",label:"SSO",icon:t.jsx(Iu,{className:"size-3.5"})},{value:"mcp",label:"MCP",icon:t.jsx(ky,{className:"size-3.5"})},{value:"license",label:"License",icon:t.jsx(Yi,{className:"size-3.5"})},{value:"about",label:"About",icon:t.jsx(Xi,{className:"size-3.5"})}]}),r==="connections"&&t.jsx(r3,{}),r==="attention"&&t.jsx(Y_,{}),r==="sso"&&t.jsx(u3,{}),r==="mcp"&&t.jsx(m3,{}),r==="license"&&t.jsx(l3,{}),r==="about"&&t.jsx(o3,{})]})}const v3=[{label:"Any time",ms:0},{label:"Next hour",ms:36e5},{label:"Next 24 hours",ms:864e5},{label:"Next 7 days",ms:6048e5}];function y3(){var r;const e=ds();if(e.isLoading)return t.jsx(vt,{children:t.jsx(Dt,{label:"Loading…"})});const n=(r=e.data)==null?void 0:r[0];return n?t.jsx(Fr,{to:oe.schedulers(n.id),replace:!0}):t.jsx(vt,{children:t.jsx(nn,{icon:t.jsx(Co,{}),title:"No connections",description:"Add a Redis connection first; schedulers are listed per connection."})})}function j3(){var p;const{connectionId:e}=zn(),n=ds(),r=sn(),[i,o]=N.useState(""),[c,d]=N.useState(0),h=s2(e,{...i.trim()?{q:i.trim()}:{},...c>0?{withinMs:c}:{}}),m=((p=h.data)==null?void 0:p.schedulers)??[],g=h.data;return t.jsxs(vt,{children:[t.jsx(hs,{title:"Schedulers",description:g?`${W(g.total)} across ${W(g.queuesWithSchedulers)} of ${W(g.queuesScanned)} queues`:void 0,actions:n.data&&n.data.length>1?t.jsx(ut,{"aria-label":"Connection",value:e??"",onChange:v=>r(oe.schedulers(v.target.value)),children:n.data.map(v=>t.jsx("option",{value:v.id,children:v.name},v.id))}):void 0}),t.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[t.jsx(Me,{value:i,onChange:v=>o(v.target.value),placeholder:"Filter by scheduler id, job name or queue…","aria-label":"Filter schedulers",leftIcon:t.jsx(Hn,{className:"size-3.5"}),className:"w-full sm:w-80"}),t.jsx(ut,{"aria-label":"Next run within",value:String(c),onChange:v=>d(Number(v.target.value)),children:v3.map(v=>t.jsx("option",{value:v.ms,children:v.label},v.ms))}),h.isFetching&&t.jsx(Dt,{className:"size-3.5"})]}),g&&g.failed.length>0&&t.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-fg-muted",children:[t.jsx(Zn,{className:"mt-0.5 size-3.5 shrink-0 text-warning","aria-hidden":!0}),t.jsxs("span",{children:["Could not read schedulers from ",g.failed.length," queue",g.failed.length===1?"":"s",":"," ",t.jsx("span",{className:"font-mono",children:g.failed.map(v=>v.queueName).join(", ")}),". The rest of the list is complete."]})]}),t.jsx("div",{className:"card overflow-hidden",children:t.jsxs(os,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx(fe,{children:"Queue"}),t.jsx(fe,{children:"Scheduler"}),t.jsx(fe,{children:"Job name"}),t.jsx(fe,{children:"Repeats"}),t.jsx(fe,{align:"right",children:"Next run"})]})}),t.jsxs("tbody",{children:[h.isLoading&&t.jsx(xt,{colSpan:5,children:t.jsx(Dt,{label:"Reading schedulers…"})}),h.isError&&!g&&t.jsx(xt,{colSpan:5,className:"text-danger",children:ye(h.error)}),g&&m.length===0&&t.jsx(xt,{colSpan:5,children:t.jsx(w3,{filtered:!!i.trim()||c>0,total:g.total})}),m.map(v=>t.jsx(b3,{s:v,connectionId:e},`${v.queueName}:${v.key}`))]})]})}),g&&m.length>0&&m.length<g.total&&t.jsxs("p",{className:"mt-2 text-[11px] text-fg-subtle",children:["Showing ",W(m.length)," of ",W(g.total),". Narrow the filter to see the rest."]})]})}function b3({s:e,connectionId:n}){const r=e.next!=null&&e.next<=Date.now();return t.jsxs(rl,{children:[t.jsx(me,{children:t.jsx(Re,{to:oe.queueSchedulers(n,e.queueName),className:"text-accent hover:underline",children:e.queueName})}),t.jsx(me,{mono:!0,children:t.jsx("span",{className:"text-fg",title:e.key,children:e.key})}),t.jsx(me,{mono:!0,muted:!0,children:e.name}),t.jsx(me,{children:t.jsxs("span",{className:"flex flex-wrap items-center gap-1.5",children:[t.jsx(be,{variant:"outline",size:"xs",className:"font-mono",children:K0(e)}),e.tz&&t.jsx("span",{className:"text-[11px] text-fg-subtle",children:e.tz}),e.iterationCount===0&&t.jsx("span",{className:"text-[11px] text-warning",title:"This scheduler has never produced a job",children:"never ran"})]})}),t.jsx(me,{align:"right",num:!0,children:e.next==null?t.jsx("span",{className:"text-fg-subtle",title:"No next run: the scheduler ended or hit its limit",children:"–"}):t.jsxs("span",{className:F("inline-flex items-center gap-1",r&&"text-warning"),title:fn(e.next),children:[r&&t.jsx(_y,{className:"size-3","aria-hidden":!0}),Ur(e.next)]})})]})}function w3({filtered:e,total:n}){return e&&n>0?t.jsxs("div",{className:"py-6 text-center text-sm text-fg-muted",children:["No scheduler matches this filter. This connection has ",W(n)," in total."]}):t.jsxs("div",{className:"mx-auto flex max-w-xl flex-col items-center gap-2 py-6 text-center",children:[t.jsx(Co,{className:"size-6 text-fg-subtle","aria-hidden":!0}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"No job schedulers on this connection"}),t.jsx("p",{className:"text-xs text-fg-muted",children:"A job scheduler (BullMQ calls it a repeatable job) stamps out the same job on a cron pattern or a fixed interval. It lives outside the job states, so it never shows up under Waiting or Delayed — only the single job it has queued next does."}),t.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] text-fg-subtle",children:[t.jsx(qy,{className:"size-3","aria-hidden":!0}),"Create one with ",t.jsx("span",{className:"font-mono",children:"queue.upsertJobScheduler()"}),"."]})]})}function N3(){return t.jsx(vt,{children:t.jsx(nn,{icon:t.jsx(nN,{}),title:"Page not found",description:"The link may be stale, or the queue or connection was removed.",action:t.jsx(Re,{to:"/",className:"text-accent hover:underline",children:"Back to overview"})})})}const k3=N.lazy(()=>Cu(()=>import("./FlowsPage-CxMz_9Et.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.FlowsPage}))),S3=N.lazy(()=>Cu(()=>import("./FlowsPage-CxMz_9Et.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.FlowsIndexPage}))),C3=N.lazy(()=>Cu(()=>import("./McpConsentPage-B2YnL6fN.js"),[]).then(e=>({default:e.McpConsentPage}))),_3=N.lazy(()=>Cu(()=>import("./JobTreePage-BT79W1zX.js"),__vite__mapDeps([3,1,2])).then(e=>({default:e.JobTreePage})));function Jc({children:e}){return t.jsx(N.Suspense,{fallback:t.jsx(tl,{}),children:e})}const P3=new Fw({defaultOptions:{queries:{retry:(e,n)=>Gs(n)&&n.status>0&&n.status<500?!1:e<2,retryDelay:e=>Math.min(1e3*2**e,8e3),staleTime:1e3,refetchOnWindowFocus:!0,refetchIntervalInBackground:!1},mutations:{retry:!1}}});function E3(){return t.jsx(hw,{client:P3,children:t.jsx(iw,{children:t.jsxs(Mk,{children:[t.jsxs(Jb,{children:[t.jsx(ct,{path:"/login",element:t.jsx(Hg,{children:t.jsx(dS,{})})}),t.jsx(ct,{path:"/setup",element:t.jsx(Hg,{children:t.jsx(hS,{})})}),t.jsx(ct,{path:"/oauth/consent",element:t.jsx(Jc,{children:t.jsx(C3,{})})}),t.jsx(ct,{element:t.jsx(Tk,{}),children:t.jsxs(ct,{element:t.jsx(uS,{}),children:[t.jsx(ct,{index:!0,element:t.jsx(VS,{})}),t.jsx(ct,{path:"c/:connectionId",element:t.jsx(KS,{})}),t.jsx(ct,{path:"c/:connectionId/q/:queue",element:t.jsx(Fh,{})}),t.jsx(ct,{path:"c/:connectionId/q/:queue/metrics",element:t.jsx(Fh,{view:"metrics"})}),t.jsx(ct,{path:"c/:connectionId/q/:queue/schedulers",element:t.jsx(Fh,{view:"schedulers"})}),t.jsx(ct,{path:"c/:connectionId/q/:queue/groups",element:t.jsx(k_,{})}),t.jsx(ct,{path:"c/:connectionId/q/:queue/groups/:groupId",element:t.jsx(P_,{})}),t.jsx(ct,{path:"c/:connectionId/q/:queue/j/:jobId",element:t.jsx(g_,{})}),t.jsx(ct,{path:"c/:connectionId/q/:queue/j/:jobId/tree",element:t.jsx(Jc,{children:t.jsx(_3,{})})}),t.jsx(ct,{path:"health",element:t.jsx(tC,{})}),t.jsx(ct,{path:"schedulers",element:t.jsx(y3,{})}),t.jsx(ct,{path:"schedulers/:connectionId",element:t.jsx(j3,{})}),t.jsx(ct,{path:"folders",element:t.jsx(E_,{})}),t.jsx(ct,{path:"folders/:folderId",element:t.jsx(F_,{})}),t.jsx(ct,{path:"alerts",element:t.jsx(a_,{})}),t.jsx(ct,{path:"users",element:t.jsx(Q_,{})}),t.jsx(ct,{path:"audit",element:t.jsx(W_,{})}),t.jsxs(t.Fragment,{children:[t.jsx(ct,{path:"flows",element:t.jsx(Jc,{children:t.jsx(S3,{})})}),t.jsx(ct,{path:"flows/:connectionId",element:t.jsx(Jc,{children:t.jsx(k3,{})})})]}),t.jsx(ct,{path:"settings",element:t.jsx(Fr,{to:"/settings/connections",replace:!0})}),t.jsx(ct,{path:"settings/:tab",element:t.jsx(g3,{})}),t.jsx(ct,{path:"*",element:t.jsx(N3,{})})]})})]}),t.jsx(zk,{}),t.jsx(Rk,{})]})})})}ib.createRoot(document.getElementById("root")).render(t.jsx(N.StrictMode,{children:t.jsx(E3,{})}));export{M0 as A,V as B,Zn as C,Sn as D,nn as E,$3 as F,z3 as G,ky as H,Xi as I,T3 as J,hs as K,Oa as L,cN as M,Fr as N,Fu as O,vt as P,My as Q,Kf as R,Dt as S,us as T,NS as U,Ur as V,CN as W,Tf as X,Gj as Y,eb as Z,ds as a,zn as b,re as c,sn as d,yt as e,N as f,I3 as g,q3 as h,O3 as i,t as j,ut as k,W as l,Kn as m,ye as n,be as o,Re as p,Lr as q,oe as r,ot as s,Y as t,jt as u,F as v,Me as w,mt as x,ko as y,$n as z};
|