diff --git a/.env.example b/.env.example index d4e56f3..f60e413 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ # Nonempty GETBIBLE_* application settings override values saved by the menu. # Empty optional values leave the saved setting/default in control. GETBIBLE_IMAGE_REPOSITORY=ghcr.io/getbible/api -GETBIBLE_IMAGE_TAG=3.2.14 +GETBIBLE_IMAGE_TAG=3.2.15 GETBIBLE_DATA_ROOT=/srv/getbible-data GETBIBLE_HOSTNAME=getbible TZ=UTC diff --git a/Dockerfile b/Dockerfile index 56e1792..4715c64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 FROM ubuntu:24.04 -ARG GETBIBLE_VERSION=3.2.14 +ARG GETBIBLE_VERSION=3.2.15 ARG GETBIBLE_REVISION=unknown ARG GETBIBLE_IMAGE_PYTHONS= LABEL org.opencontainers.image.title="getBible API" \ diff --git a/VERSION b/VERSION index 23c635a..5365c9e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.14 +3.2.15 diff --git a/compose.yaml b/compose.yaml index c72f259..6cf9a87 100644 --- a/compose.yaml +++ b/compose.yaml @@ -4,7 +4,7 @@ services: getbible: # Production deployment only pulls the prebuilt image. No checkout # or Dockerfile is required on the server. See docs/DOCKER.md for login. - image: ${GETBIBLE_IMAGE_REPOSITORY:-ghcr.io/getbible/api}:${GETBIBLE_IMAGE_TAG:-3.2.14} + image: ${GETBIBLE_IMAGE_REPOSITORY:-ghcr.io/getbible/api}:${GETBIBLE_IMAGE_TAG:-3.2.15} restart: unless-stopped hostname: ${GETBIBLE_HOSTNAME:-getbible} user: "0:0" diff --git a/src/apps/dashboard/static/assets/index-DazdW1j4.js b/src/apps/dashboard/static/assets/index-DazdW1j4.js deleted file mode 100644 index b9d586f..0000000 --- a/src/apps/dashboard/static/assets/index-DazdW1j4.js +++ /dev/null @@ -1,10 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function ee(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var x=ee.prototype=new b;x.constructor=ee,_(x,y.prototype),x.isPureReactComponent=!0;var te=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return T(e.type,t,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,te(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(te(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ne());else{var t=n(l);t!==null&&ie(ee,t.startTime-e)}}}var x=!1,te=-1,S=5,C=-1;function w(){return g?!0:!(e.unstable_now()-Ct&&w());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ne():x=!1}}}var ne;if(typeof y==`function`)ne=function(){y(T)};else if(typeof MessageChannel<`u`){var E=new MessageChannel,re=E.port2;E.port1.onmessage=T,ne=function(){re.postMessage(null)}}else ne=function(){_(T,0)};function ie(t,n){te=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,ie(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ne()))),r},e.unstable_shouldYield=w,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1Se||(e.current=xe[Se],xe[Se]=null,Se--)}function P(e,t){Se++,xe[Se]=e.current,e.current=t}var we=Ce(null),Te=Ce(null),Ee=Ce(null),De=Ce(null);function Oe(e,t){switch(P(Ee,t),P(Te,e),P(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}N(we),P(we,e)}function ke(){N(we),N(Te),N(Ee)}function Ae(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,P(De,e)),t=we.current;var n=dp(t,e.type);t!==n&&(P(Te,e),P(we,n))}function je(e){Te.current===e&&(N(we),N(Te)),De.current===e&&(N(De),sh._currentValue=be)}var Me,Ne;function Pe(e){if(Me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||``,Ne=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Pe(n):``}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe(`Lazy`);case 13:return e.child!==t&&t!==null?Pe(`Suspense Fallback`):Pe(`Suspense`);case 19:return Pe(`SuspenseList`);case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return Pe(`Activity`);case 30:return Pe(`ViewTransition`);default:return``}}function Re(e){try{var t=``,n=null;do t+=Le(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var ze=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,He=t.unstable_shouldYield,Ue=t.unstable_requestPaint,We=t.unstable_now,Ge=t.unstable_getCurrentPriorityLevel,Ke=t.unstable_ImmediatePriority,qe=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,Ye=t.unstable_LowPriority,Xe=t.unstable_IdlePriority,Ze=t.log,Qe=t.unstable_setDisableYieldValue,$e=null,et=null;function tt(e){if(typeof Ze==`function`&&Qe(e),et&&typeof et.setStrictMode==`function`)try{et.setStrictMode($e,e)}catch{}}var nt=Math.clz32?Math.clz32:at,rt=Math.log,it=Math.LN2;function at(e){return e>>>=0,e===0?32:31-(rt(e)/it|0)|0}var ot=256,st=262144,ct=4194304;function lt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ut(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=lt(n))):i=lt(o):i=lt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=lt(n))):i=lt(o)):i=lt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function dt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function gt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _t(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0=gr),yr=` `,br=!1;function xr(e,t){switch(e){case`keyup`:return mr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Cr=!1;function wr(e,t){switch(e){case`compositionend`:return Sr(t);case`keypress`:return t.which===32?(br=!0,yr):null;case`textInput`:return e=t.data,e===yr&&br?null:e;default:return null}}function Tr(e,t){if(Cr)return e===`compositionend`||!hr&&xr(e,t)?(e=Ln(),In=Fn=Pn=null,Cr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Jr(n)}}function Xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=qr(e.document)}return t}function Qr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var $r=jn&&`documentMode`in document&&11>=document.documentMode,ei=null,ti=null,ni=null,ri=!1;function ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ri||ei==null||ei!==qr(r)||(r=ei,`selectionStart`in r&&Qr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ni&&Kr(ni,r)||(ni=r,r=Jf(ti,`onSelect`),0>=o,i-=o,ea=1<<32-nt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),L&&na(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),L&&na(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return L&&na(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),L&&na(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ie&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ie){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),fo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===k&&io(l)===r.type){n(e,r.sibling),c=a(r,o.props),fo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ie?(c=Vi(o.props.children,e.mode,c,o.key),fo(c,o),c.return=e,e=c):(c=Bi(o.type,o.key,o.props,null,e.mode,c),fo(c,o),c.return=e,e=c)}return s(e);case re:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Wi(o,e.mode,c),c.return=e,e=c}return s(e);case k:return o=io(o),_(e,r,o,c)}if(ye(o))return h(e,r,o,c);if(_e(o)){if(l=_e(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,uo(o),c);if(o.$$typeof===D)return _(e,r,ka(e,o),c);po(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{lo=0;var i=_(e,t,n,r);return co=null,i}catch(t){if(t===Qa||t===eo)throw t;var a=Ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ho=mo(!0),go=mo(!1),_o=!1;function vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function bo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ni(e),Mi(e,null,n),t}return ki(e,r,t,n),Ni(e)}function So(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}function Co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var wo=!1;function To(){if(wo){var e=Ua;if(e!==null)throw e}}function Eo(e,t,n,r){wo=!1;var i=e.updateQueue;_o=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===Ha&&(wo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:_o=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),sd|=o,e.lanes=o,e.memoizedState=d}}function Do(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Oo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=j.T,s={};s.types=o===null?null:o.types,j.T=s,pc(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?fc(e,t,Ka(c,r),jd(e)):fc(e,t,r,jd(e))}catch(n){fc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function nc(){}function rc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ic(e).queue;tc(e,a,t,be,n===null?nc:function(){return ac(e),n(r)})}function ic(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:be},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ac(e){var t=ic(e);t.next===null&&(t=e.alternate.memoizedState),fc(e,t.next.queue,{},jd())}function oc(){return Oa(sh)}function sc(){return ls().memoizedState}function cc(){return ls().memoizedState}function lc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=bo(n);var r=xo(t,e,n);r!==null&&(Pd(r,t,n),So(r,t,n)),t={cache:Fa()},e.payload=t;return}t=t.return}}function uc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mc(e)?hc(t,n):(n=Ai(e,t,n,r),n!==null&&(Pd(n,e,r),gc(n,t,r)))}function dc(e,t,n){fc(e,t,n,jd())}function fc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mc(e))hc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Gr(s,o))return ki(e,t,i,0),G===null&&Oi(),!1}catch{}if(n=Ai(e,t,i,r),n!==null)return Pd(n,e,r),gc(n,t,r),!0}return!1}function pc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mc(e)){if(t)throw Error(i(479))}else t=Ai(e,n,r,2),t!==null&&Pd(t,e,2)}function mc(e){var t=e.alternate;return e===R||t!==null&&t===R}function hc(e,t){Jo=qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}var _c={readContext:Oa,use:fs,useCallback:B,useContext:B,useEffect:B,useImperativeHandle:B,useLayoutEffect:B,useInsertionEffect:B,useMemo:B,useReducer:B,useRef:B,useState:B,useDebugValue:B,useDeferredValue:B,useTransition:B,useSyncExternalStore:B,useId:B,useHostTransitionStatus:B,useFormState:B,useActionState:B,useOptimistic:B,useMemoCache:B,useCacheRefresh:B,useEffectEvent:B},vc={readContext:Oa,use:fs,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Oa,useEffect:Hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Bs(4194308,4,Js.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Yo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Yo){tt(!0);try{n(t)}finally{tt(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=uc.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=ws(e);var t=e.queue,n=dc.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xs,useDeferredValue:function(e,t){return $s(cs(),e,t)},useTransition:function(){var e=ws(!1);return e=tc.bind(null,R,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,a=cs();if(L){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),G===null)throw Error(i(349));q&127||ys(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Hs(xs.bind(null,r,o,e),[e]),r.flags|=2048,Rs(9,{destroy:void 0},bs.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=G.identifierPrefix;if(L){var n=ta,r=ea;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Xo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Et]=t,o[Dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&gl(t)}}return V(t),t.subtreeFlags&=-33554433,_l(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&gl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ee.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=sa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||da(t,!0)}else e=lp(e).createTextNode(r),e[Et]=t,t.stateNode=e}return V(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ma(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Et]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),e=!1}else n=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Bo(t),t):(Bo(t),null);if(t.flags&128)throw Error(i(558))}return V(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Et]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),a=!1}else a=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Bo(t),t):(Bo(t),null)}return Bo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),yl(t,t.updateQueue),V(t),null);case 4:return ke(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,V(t),null;case 10:return Sa(t.type),V(t),null;case 19:if(Uo(t),r=t.memoizedState,r===null)return V(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)bl(r,!1);else{if(Y!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wo(e),o!==null){for(t.flags|=128,bl(r,!1),e=o.updateQueue,t.updateQueue=e,yl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zi(n,e),n=n.sibling;return Ho(t,Vo.current&1|2),L&&na(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&We()>_d&&(t.flags|=128,a=!0,bl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Wo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,yl(t,e),bl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!L)return V(t),null}else 2*We()-r.renderingStartTime>_d&&n!==536870912&&(t.flags|=128,a=!0,bl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,o=Vo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||L?Ho(t,o):(n=o,P(Po,t),P(Vo,n),Fo===null&&(Fo=t)),L&&na(t,r.treeForkCount),e}return V(t),null;case 22:case 23:return Bo(t),No(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(V(t),t.subtreeFlags&6&&(t.flags|=8192)):V(t),n=t.updateQueue,n!==null&&yl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&N(Ja),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sa(Pa),V(t),null;case 25:return null;case 30:return t.flags|=33554432,V(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(aa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(Pa),ke(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 31:if(t.memoizedState!==null){if(Bo(t),t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Uo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ke(),null;case 10:return Sa(t.type),null;case 22:case 23:return Bo(t),No(),e!==null&&N(Ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(Pa),null;case 25:return null;default:return null}}function Cl(e,t){switch(aa(t),t.tag){case 3:Sa(Pa),ke();break;case 26:case 27:case 5:je(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Bo(t);break;case 13:Bo(t);break;case 19:Uo(t);break;case 10:Sa(t.type);break;case 22:case 23:Bo(t),No(),e!==null&&N(Ja);break;case 24:Sa(Pa)}}function wl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Tl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Oo(t,n)}catch(t){Z(e,e.return,t)}}}function Dl(e,t,n){n.props=Tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Ol(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=xi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Al(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),np(r,t,n),r[Et]=e,Bt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=Yr(s,h),v=Yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,j.T=null,n=wd,wd=null;var o=bd,s=Sd;if(X=0,xd=bd=null,Sd=0,W&6)throw Error(i(331));var c=W;if(W|=4,Zu(o.current),Uu(o,o.current,s,n),W=c,Df(0,!1),et&&typeof et.onPostCommitFiberRoot==`function`)try{et.onPostCommitFiberRoot($e,o)}catch{}return!0}finally{M.p=a,j.T=r,uf(e,t)}}function pf(e,t,n){t=Ki(n,t),t=jc(e.stateNode,t,2),e=xo(e,t,2),e!==null&&(gt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yd===null||!yd.has(r))){e=Ki(n,e),n=Mc(2),r=xo(t,n,2),r!==null&&(Nc(n,r,t,e),gt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ad=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,G===e&&(q&n)===n&&(Y===4||Y===3&&(q&62914560)===q&&300>We()-hd?W&2?ld|=n:Vd(e,0):ld|=n,dd===q&&(dd=0)),Ef(e)}function gf(e,t){t===0&&(t=mt()),e=ji(e,t),e!==null&&(gt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Be(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-nt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=q,a=ut(r,r===G?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||dt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=We(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}X!==0&&X!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Bt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Pt]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Bt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=zt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Bt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=zt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Bt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=zt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Bt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=Ee.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=zt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=zt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=zt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+sn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Pt]){r.loading=1;return}}else t=e.createElement(`link`),t[Pt]=!0,t.onload=t.onerror=Vt.bind(null,t),np(t,`link`,n),Bt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+sn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,Bt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Bt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Bt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Bt(a),a):(r=n,(a=vm.get(o))&&(r=T({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Bt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Bt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g(),y=``,b=class extends Error{constructor(e,t){super(t.detail||t.message||t.title||`Request failed (${e})`),this.status=e,this.problem=t}};function ee(e){y=e||``}async function x(e,{method:t=`GET`,body:n,signal:r}={}){let i=await fetch(`/api/${e}`,{method:t,credentials:`same-origin`,cache:`no-store`,signal:r,headers:{Accept:`application/json`,...n===void 0?{}:{"Content-Type":`application/json`},...t===`GET`?{}:{"X-CSRF-Token":y}},body:n===void 0?void 0:JSON.stringify(n)}),a=await i.json().catch(()=>({detail:`The server returned an unreadable response.`}));if(!i.ok)throw new b(i.status,a);return a.csrf_token&&ee(a.csrf_token),a}var te=(e,t={})=>x(e,{method:`POST`,body:t});function S(e){return new URLSearchParams(Object.entries(e).filter(([,e])=>e!==``&&e!=null)).toString()}var C=(e,t=0)=>e==null?`—`:Number(e).toLocaleString(void 0,{maximumFractionDigits:t});function w(e){if(e==null)return`—`;if(e===0)return`0 B`;let t=Math.min(Math.floor(Math.log(Math.max(1,e))/Math.log(1024)),4);return`${C(e/1024**t,+!!t)} ${[`B`,`KiB`,`MiB`,`GiB`,`TiB`][t]}`}var T=e=>e?new Date(typeof e==`number`?e*1e3:e).toLocaleString():`—`,ne=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),E=o(((e,t)=>{t.exports=ne()}))();function re({option:e,height:t=260,label:n,onZoom:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(null),o=(0,_.useRef)(r),s=(0,_.useRef)(e);return o.current=r,s.current=e,(0,_.useEffect)(()=>{let t,n,r;function c(){if(!window.echarts){t=setTimeout(c,50);return}a.current=window.echarts.init(i.current,null,{renderer:`canvas`}),a.current.on(`datazoom`,e=>{if(!o.current)return;let t=e.batch?.[0]||e,r=s.current.series?.[0]?.data?.map(e=>e[0])||[];if(r.length<2)return;let i=Math.min(...r),a=Math.max(...r),c=Number(t.startValue??i+(a-i)*(t.start??0)/100),l=Number(t.endValue??i+(a-i)*(t.end??100)/100);clearTimeout(n),n=setTimeout(()=>o.current?.({start:Math.floor(c/1e3),end:Math.ceil(l/1e3)}),400)}),r=new ResizeObserver(()=>a.current?.resize()),r.observe(i.current),a.current.setOption(e)}return c(),()=>{clearTimeout(t),clearTimeout(n),r?.disconnect(),a.current?.dispose(),a.current=null}},[]),(0,_.useEffect)(()=>{a.current?.setOption(e,{notMerge:!0,lazyUpdate:!0})},[e]),(0,E.jsx)(`div`,{ref:i,className:`chart`,role:`img`,"aria-label":n,style:{height:t}})}var ie={animationDuration:250,color:[`#38bdf8`,`#34d399`,`#fbbf24`,`#fb7185`,`#a78bfa`],textStyle:{fontFamily:`system-ui, sans-serif`,color:`#8396ad`}};function ae(e,t,{zoom:n=!1}={}){return{...ie,tooltip:{trigger:`axis`,confine:!0},legend:{bottom:0,textStyle:{color:`#8396ad`},icon:`circle`,itemWidth:8},grid:{left:54,right:18,top:24,bottom:n?86:52},xAxis:{type:`time`,axisLine:{show:!1},splitLine:{show:!1}},yAxis:{type:`value`,splitLine:{lineStyle:{color:`#8396ad22`}},axisLabel:{formatter:`{value}`}},...n?{dataZoom:[{type:`inside`},{type:`slider`,bottom:28,height:18}]}:{},series:t.map(([t,n],r)=>({name:n,type:`line`,showSymbol:!1,smooth:.15,lineStyle:{width:2},areaStyle:r===0?{opacity:.09}:void 0,data:e.map(e=>[Number(e.stamp??e.timestamp??e.bucket??e.time)*1e3,e[t]??null])}))}}function oe(e){return{...ie,tooltip:{trigger:`item`,confine:!0},legend:{bottom:0,textStyle:{color:`#8396ad`},icon:`circle`,itemWidth:8},series:[{type:`pie`,radius:[`55%`,`76%`],center:[`50%`,`44%`],label:{show:!1},emphasis:{label:{show:!0,fontSize:16,fontWeight:`bold`,formatter:`{b} -{d}%`}},data:e.map(e=>({name:e.name??e.key??e.value??`Unknown`,value:e.calls??e.count??e.requests??0}))}]}}function se({error:e,dismiss:t}){return e?(0,E.jsxs)(`div`,{className:`alert alert-danger d-flex align-items-start gap-3`,role:`alert`,children:[(0,E.jsx)(`span`,{className:`flex-grow-1`,children:e.message||String(e)}),t&&(0,E.jsx)(`button`,{className:`btn-close`,"aria-label":`Dismiss error`,onClick:t})]}):null}function D({children:e=`No records in this time range.`}){return(0,E.jsx)(`div`,{className:`empty-state`,children:e})}function ce({children:e=`Loading…`}){return(0,E.jsxs)(`div`,{className:`empty-state`,children:[(0,E.jsx)(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),e]})}function O({title:e,detail:t,children:n,className:r=``,actions:i}){return(0,E.jsxs)(`section`,{className:`panel ${r}`,children:[(0,E.jsxs)(`div`,{className:`panel-title`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`h2`,{children:e}),t&&(0,E.jsx)(`small`,{children:t})]}),i]}),n]})}function le({children:e,tone:t=`muted`}){return(0,E.jsx)(`span`,{className:`status-badge ${t}`,children:e})}function ue({value:e,max:t,label:n}){return(0,E.jsx)(`div`,{className:`progress`,role:`progressbar`,"aria-label":n,"aria-valuenow":e||0,"aria-valuemin":`0`,"aria-valuemax":t||100,children:(0,E.jsx)(`div`,{className:`progress-bar`,style:{width:`${Math.min(100,(e||0)*100/(t||100))}%`}})})}function k({columns:e,rows:t,onSelect:n,rowKey:r}){return t.length?(0,E.jsx)(`div`,{className:`table-responsive`,children:(0,E.jsxs)(`table`,{className:`table align-middle table-hover mb-0`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsx)(`tr`,{children:e.map(e=>(0,E.jsx)(`th`,{scope:`col`,children:e.label},e.key))})}),(0,E.jsx)(`tbody`,{children:t.map((t,i)=>(0,E.jsx)(`tr`,{children:e.map((e,r)=>(0,E.jsx)(`td`,{children:r===0&&n?(0,E.jsx)(`button`,{className:`table-link`,onClick:()=>n(t),children:e.render?e.render(t):t[e.key]}):e.render?e.render(t):t[e.key]??`—`},e.key))},r?.(t)??i))})]})}):(0,E.jsx)(D,{})}function de(e,t=!1){return![`blocked`,`updating`].includes(e.status)&&(e.eligible||t)}function fe(e,t,{force:n=!1,retry:r=!1}={}){let i=new Set(t);return(e?.targets||[]).filter(e=>i.has(e.id)&&de(e,n)&&(!r||[`failed`,`interrupted`].includes(e.outcome))).map(e=>e.id)}function pe(e){return(e?.targets||[]).filter(e=>de(e)).map(e=>e.id)}function me(e,t,n={}){if(!e||!/^[a-f0-9]{64}$/.test(e.plan_id))throw Error(`Refresh the upgrade plan before applying.`);return{targets:fe(e,t,n),plan_id:e.plan_id,force:n.force===!0,retry:n.retry===!0}}function he(e,t=!1){let n=e?.recommendation?.value;return t||e?.recommendation?.status!==`suggested`||!Number.isFinite(n)||n<0||!e?.configuration?.editable||e.configuration.owner!==`saved`||![`TELEMETRY_SPOOL_MAX_GIB`,`TELEMETRY_MAX_GIB`].includes(e.setting)?null:{key:e.setting,value:String(n)}}function ge({execute:e,refresh:t,paused:n=!1}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(0),[l,u]=(0,_.useState)(!0),[d,f]=(0,_.useState)([]),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=!1,t=new AbortController;return u(!0),o(null),x(`upgrades`,{signal:t.signal}).then(t=>{e||(i(t),f(pe(t)),m(!1),g(!1))}).catch(t=>{!e&&t.name!==`AbortError`&&o(t)}).finally(()=>{e||u(!1)}),()=>{e=!0,t.abort()}},[t,s]);let v=fe(r,d,{force:p,retry:h}),y=r&&!l&&!a&&!n,b=e=>f(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);return(0,E.jsxs)(`div`,{className:`upgrade-plan`,children:[(0,E.jsx)(`p`,{children:`Only selected targets will be upgraded. Static targets update their software and configuration—not Bible files. Skipped changes remain pending.`}),(0,E.jsx)(se,{error:a}),(0,E.jsxs)(`div`,{className:`d-flex gap-2 flex-wrap mb-3`,children:[(0,E.jsx)(`button`,{type:`button`,className:`btn btn-outline-secondary`,disabled:l,onClick:()=>c(e=>e+1),children:`Refresh upgrade plan`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-outline-secondary`,disabled:!y,onClick:()=>{f(pe(r)),g(!1)},children:`Select changed targets`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-outline-secondary`,disabled:!y,onClick:()=>f([]),children:`Clear selection`}),(0,E.jsxs)(`label`,{className:`form-check`,children:[(0,E.jsx)(`input`,{type:`checkbox`,className:`form-check-input`,checked:p,disabled:!y,onChange:e=>m(e.target.checked)}),`Allow forced redeployment of unchanged targets`]}),(0,E.jsxs)(`label`,{className:`form-check`,children:[(0,E.jsx)(`input`,{type:`checkbox`,className:`form-check-input`,checked:h,disabled:!y,onChange:e=>{g(e.target.checked),e.target.checked&&f((r?.targets||[]).filter(e=>[`failed`,`interrupted`].includes(e.outcome)).map(e=>e.id))}}),`Retry failed or interrupted targets only`]})]}),l?(0,E.jsx)(ce,{children:`Inspecting installed releases and target readiness…`}):r?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`alert alert-info`,role:`status`,children:[`Release `,r.version,`: `,r.pending,` target(s) pending. `,v.length,` selected. Serving health is separate from upgrade completion.`]}),(0,E.jsx)(k,{rowKey:e=>e.id,rows:r.targets||[],columns:[{key:`selected`,label:`Upgrade`,render:e=>(0,E.jsx)(`input`,{type:`checkbox`,"aria-label":`Upgrade ${e.id}`,checked:v.includes(e.id),disabled:!y||!de(e,p)||h&&![`failed`,`interrupted`].includes(e.outcome),onChange:()=>b(e.id)})},{key:`id`,label:`Target`,render:e=>(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`strong`,{children:e.id}),(0,E.jsx)(`small`,{className:`d-block`,children:e.reason}),e.last_error&&(0,E.jsx)(`small`,{className:`d-block text-warning`,children:e.last_error})]})},{key:`status`,label:`Upgrade state`,render:e=>(0,E.jsx)(le,{tone:e.status===`current`?`success`:e.status===`blocked`?`warning`:`info`,children:e.status})},{key:`serving`,label:`Serving`,render:e=>(0,E.jsx)(le,{tone:e.serving===`ready`?`success`:`warning`,children:e.serving})},{key:`outcome`,label:`Last result`,render:e=>(0,E.jsxs)(E.Fragment,{children:[e.outcome,(0,E.jsx)(`small`,{className:`d-block`,children:T(e.last_attempt)})]})},{key:`fingerprints`,label:`Implementation`,render:e=>(0,E.jsxs)(`details`,{children:[(0,E.jsx)(`summary`,{children:`Fingerprints`}),(0,E.jsxs)(`small`,{className:`d-block text-break`,children:[`Desired: `,e.desired_fingerprint||`Unavailable`]}),(0,E.jsxs)(`small`,{className:`d-block text-break`,children:[`Applied: `,e.applied_fingerprint||`Not recorded`]})]})}]}),(0,E.jsx)(`p`,{className:`text-secondary mt-3`,children:r.note})]}):(0,E.jsx)(D,{children:`The upgrade plan is unavailable. Refresh to retry.`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:!y||!v.length,onClick:()=>{try{e(`system.update`,me(r,d,{force:p,retry:h}),{title:`Upgrade ${v.length} selected target(s)`,description:`The manager rechecks this plan before changing anything. Unselected generations remain running; capacity checks may reject an unsafe overlap. Whole-container replacement is a separate restart.`})}catch(e){o(e)}},children:`Review selected upgrades`}),!v.length&&!l&&(0,E.jsx)(`small`,{className:`d-block mt-2`,children:`Nothing selected. No upgrade will run.`})]})}var _e=[{id:`domains`,title:`Domains`,detail:`Status, endpoints, pages, access and runtime settings`},{id:`deploy`,title:`Deploy a new domain`,detail:`Prepare a static, runtime or MCP domain`},{id:`go-live`,title:`Go live`,detail:`Activate a staged domain`},{id:`self-update`,title:`Update manager`,detail:`Update the native manager checkout`},{id:`update`,title:`Upgrade targets`,detail:`Review changes, select targets and retry incomplete upgrades`},{id:`analytics`,title:`Traffic analytics`,detail:`Run a traffic report`},{id:`dashboard`,title:`Private dashboard`,detail:`Domain, password, sessions and blocked addresses`},{id:`logs`,title:`Logs`,detail:`Domain diagnostics, archives and rotation`},{id:`settings`,title:`Settings`,detail:`Environment, notifications, Cloudflare token and icons`},{id:`system`,title:`System`,detail:`Host checks, dependencies and resource allocation`}],A=e=>e.id||e.operation||e.name;function ve(e){let t=e?.fields||e?.parameters||[];return Array.isArray(t)?t:Object.entries(t).map(([e,t])=>({name:e,...t}))}function ye(e){let t=A(e);if(t.startsWith(`domain.deploy_`))return[[`deploy`,`New domain`]];if(t===`domain.go_live`)return[[`go-live`,`Activation`],[`domains`,`Publication`]];if(t===`system.self_update`)return[[`self-update`,`Manager checkout`]];if(t===`system.update`)return[[`update`,`Review eligible targets`]];if(t===`analytics`)return[[`analytics`,`Traffic report`]];if(t.startsWith(`dashboard.`))return[[`dashboard`,[`dashboard.sessions`,`dashboard.revoke`].includes(t)?`Sessions`:t===`dashboard.blocks`?`Blocked addresses`:`Dashboard settings`]];if(t.startsWith(`logs.`))return t===`logs.rotate`?[[`logs`,`Rotation`]]:t===`logs.reset`?[[`logs`,`History`]]:[[`logs`,`Domain logs`],[`domains`,`Logs`]];if(t.startsWith(`settings.`))return[[`settings`,`Environment and defaults`]];if(t.startsWith(`telegram.`))return[[`settings`,`Telegram notifications`]];if(t===`cloudflare.token`)return[[`settings`,`Cloudflare API token`]];if([`system.icons`,`system.favicon`,`system.logo`].includes(t))return[[`settings`,`Icons`]];if(t===`pages.upload_icon`)return[[`settings`,`Icons`],[`domains`,`Pages and OpenAPI`]];if([`cloudflare.verify`,`cloudflare.refresh_ips`].includes(t))return[[`system`,`Cloudflare origin tools`]];if(t.startsWith(`resources.`))return[[`system`,`Resource allocation`]];if(t===`runtime.versions`)return[[`system`,`Python versions`]];if(ve(e).some(e=>e.name===`domain`)){let e=`Other domain operations`;return[`domain.status`,`domain.verify`].includes(t)?e=`Status and health`:t===`domain.stage`?e=`Publication`:[`domain.apply`,`domain.update`].includes(t)?e=`Apply configuration`:t===`domain.remove`?e=`Remove domain`:t.startsWith(`endpoint.`)?e=`Endpoints and repositories`:t===`access.mode`?e=`Access mode`:t===`access.limits`?e=`Anonymous caller limits`:t.startsWith(`token.`)?e=`Bearer tokens`:t.startsWith(`certificate.`)?e=`Certificate`:t.startsWith(`cloudflare.`)?e=`Cloudflare`:t.startsWith(`pages.`)?e=`Pages and OpenAPI`:t.startsWith(`mcp.`)?e=`MCP service`:t===`runtime.set`?e=`Runtime settings`:t===`runtime.cache`?e=`Translation memory`:t.startsWith(`runtime.`)&&(e=`Runtime services`),[[`domains`,e]]}return[[`system`,t.startsWith(`system.`)?`Host maintenance`:e.category||`Other operations`]]}function j(e){let t=new Map((e?.domains||[]).map(e=>[e.domain,{...e,endpoints:[]}]));for(let n of e?.endpoints||[])t.has(n.domain)||t.set(n.domain,{...n,endpoints:[]}),t.get(n.domain).endpoints.push(n);return[...t.values()].sort((e,t)=>e.domain.localeCompare(t.domain))}function M(e,t){if(!t)return!0;let n=A(e),r=t.type===`runtime`,i=t.type===`static`;return Array.isArray(e.domain_types)&&!e.domain_types.includes(t.type)?!1:n.startsWith(`mcp.`)?t.type===`mcp`:n.startsWith(`runtime.`)||[`endpoint.add_runtime`,`endpoint.default`].includes(n)?r:[`endpoint.add_static`,`endpoint.change_source`,`endpoint.sync`,`endpoint.deploy_key`,`endpoint.repo_access`,`endpoint.filetypes`].includes(n)?i:[`endpoint.remove`,`pages.docs`,`pages.openapi`,`pages.write`].includes(n)?i||r:n===`domain.go_live`?!t.live:n!==`domain.stage`||t.live}function be(e,t,n){let r=new Map;for(let i of e){if(!M(i,n))continue;let e=ye(i).find(([e])=>e===t);e&&(r.has(e[1])||r.set(e[1],[]),r.get(e[1]).push(i))}return[...r].map(([e,t])=>({title:e,operations:t}))}function xe(e){return ve(e).some(e=>e.name===`domain`&&e.required)&&!A(e).startsWith(`domain.deploy_`)&&A(e)!==`dashboard.enable`}function Se(e){return ve(e).some(e=>e.name===`endpoint`)&&!A(e).startsWith(`domain.deploy_`)&&!A(e).startsWith(`endpoint.add_`)}function Ce(e){let t=A(e);return t.startsWith(`pages.`)?`Domain page`:t===`logs.view`?`Domain logs`:`All endpoints`}function N(e,t={},n){let r=e&&A(e);if(!e?.runtime_kinds||![`domain.deploy_runtime`,`endpoint.add_runtime`].includes(r))return null;let i=r===`endpoint.add_runtime`?n?.kind:t.kind,a=e.runtime_kinds[i],o=r===`endpoint.add_runtime`?new Set((n?.endpoints||[]).map(e=>e.label)):new Set,s=o.has(`root`),c=s?[]:(a?.versions||[]).filter(e=>!o.has(e)),l=c.includes(a?.default_version)?a.default_version:c[0]||``,u=r===`endpoint.add_runtime`?`endpoint`:`version`,d=t[u]||l;return{kind:i,kinds:Object.keys(e.runtime_kinds),versions:c,defaultVersion:l,versionField:u,version:d,rootEndpoint:s,repositories:(e.repositories||[]).filter(e=>e.version===d)}}function P(e,t,n){let r=N(e,t,n);return ve(e).map(e=>r?e.name===`kind`?{...e,choices:r.kinds}:e.name===r.versionField?{...e,label:`API version`,choices:r.versions,disabled:!r.kind||!r.versions.length,description:r.kind?r.rootEndpoint?`This domain serves a root endpoint, which cannot coexist with version folders.`:r.versions.length?e.description:`This domain already serves every available version.`:`Choose a runtime kind to see its API versions.`}:e.name===`repository`?{...e,type:`runtime_repository`,label:`Local Bible source`,repositories:r.repositories,disabled:!r.kind||!r.versions.length}:e:e)}function we(e,t,n,r,i){let a={...t,[n]:r},o=N(e,a,i);return o&&t[n]!==r&&[`kind`,`version`,`endpoint`,`domain`].includes(n)&&(delete a.repository,delete a._repositoryMode,(n===`kind`||n===`domain`)&&(a[o.versionField]=o.defaultVersion)),a}function Te(e,{domain:t,endpoint:n}={}){let r=ve(e),i=Object.fromEntries(r.filter(e=>e.default!==void 0).map(e=>[e.name,e.default]));t&&r.some(e=>e.name===`domain`)&&(i.domain=t.domain),n!==void 0&&r.some(e=>e.name===`endpoint`)&&(i.endpoint=n?.label||``);let a=t?.settings||{},o=n?.endpoint_settings||{},s=A(e),c=s===`access.mode`?{mode:a.ACCESS_MODE}:s===`access.limits`?{rate:a.RATE_PER_SECOND,burst:a.RATE_BURST,hour:a.QUOTA_HOUR,day:a.QUOTA_DAY,connections:a.CONN_LIMIT}:s===`endpoint.change_source`?{repository:o.REPO_URL,ref:o.REPO_REF,source_path:o.REPO_PATH}:s===`cloudflare.mode`?{value:a.CLOUDFLARE_MODE}:s===`cloudflare.cache`?{value:a.CLOUDFLARE_CACHE}:{},l={...i,...Object.fromEntries(Object.entries(c).filter(([,e])=>e!==void 0))},u=N(e,l,t);return u&&(l[u.versionField]=u.defaultVersion),l}function Ee(e,t){return Object.fromEntries(ve(e).filter(e=>t[e.name]!==void 0&&(t[e.name]!==``||e.allow_empty)).map(e=>[e.name,t[e.name]]))}var De=(e,t)=>Array.isArray(e)?e:e?.[t]||[],Oe=new Set([`queued`,`waiting`,`running`]);function ke({items:e,onSelect:t}){return(0,E.jsx)(`div`,{className:`manage-grid`,children:e.map(e=>(0,E.jsxs)(`button`,{type:`button`,className:`manage-card`,onClick:()=>t(e),children:[(0,E.jsx)(`strong`,{children:e.title}),e.detail&&(0,E.jsx)(`small`,{children:e.detail}),e.badge&&(0,E.jsx)(le,{tone:e.tone,children:e.badge})]},e.id||e.title))})}function Ae({field:e,values:t,setValues:n,onError:r,domains:i,currentSettings:a,spec:o,selectedDomain:s}){let c=t=>n(n=>({...we(o,n,e.name,t,s),...e.name===`key`&&a?{value:a[t]??``}:{}})),l={className:`form-control`,"aria-label":e.label||e.name,required:e.required&&!e.allow_empty,disabled:e.disabled},u;if(e.type===`runtime_repository`){let r=t._repositoryMode===`manual`;return(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`label`,{children:[e.label,(0,E.jsxs)(`select`,{...l,className:`form-select`,value:r?`__manual__`:t.repository||``,onChange:e=>{let t=e.target.value;n(e=>({...e,repository:t===`__manual__`?``:t,_repositoryMode:t===`__manual__`?`manual`:`published`}))},children:[(0,E.jsx)(`option`,{value:``,children:`Automatic local source`}),e.repositories.map(e=>(0,E.jsx)(`option`,{value:e.value,children:e.label},e.value)),(0,E.jsx)(`option`,{value:`__manual__`,children:`Enter a local path…`})]})]}),r&&(0,E.jsxs)(`label`,{children:[`Custom local path`,(0,E.jsx)(`input`,{className:`form-control`,"aria-label":`Custom local path`,type:`text`,required:!0,autoComplete:`off`,value:t.repository||``,onChange:e=>c(e.target.value)})]}),e.description&&(0,E.jsx)(`small`,{children:e.description})]})}return u=e.type===`file`?(0,E.jsx)(`input`,{...l,type:`file`,accept:`.png,.jpg,.jpeg,.webp,.ico,.svg`,onChange:t=>{let i=t.target.files?.[0];if(!i)return;if(i.size>1048576){r(Error(`Choose an image smaller than 1 MiB.`)),t.target.value=``;return}let a=new FileReader;a.onload=()=>n(t=>({...t,filename:i.name,[e.name]:String(a.result).split(`,`)[1]})),a.onerror=()=>r(Error(`The selected file could not be read.`)),a.readAsDataURL(i)}}):e.type===`multiline`?(0,E.jsx)(`textarea`,{...l,rows:12,spellCheck:`false`,value:t[e.name]||``,onChange:e=>c(e.target.value)}):e.type===`boolean`?(0,E.jsxs)(`select`,{"aria-label":e.label||e.name,className:`form-select`,value:String(t[e.name]??!1),onChange:e=>c(e.target.value===`true`),children:[(0,E.jsx)(`option`,{value:`false`,children:`No`}),(0,E.jsx)(`option`,{value:`true`,children:`Yes`})]}):e.name===`domain`&&!e.required?(0,E.jsxs)(`select`,{"aria-label":e.label||e.name,className:`form-select`,value:t.domain||``,onChange:e=>c(e.target.value),children:[(0,E.jsx)(`option`,{value:``,children:e.scopeLabel||`All domains`}),i.map(e=>(0,E.jsx)(`option`,{value:e.domain,children:e.domain},e.domain))]}):e.choices||e.enum?(0,E.jsxs)(`select`,{...l,className:`form-select`,value:t[e.name]??``,onChange:e=>c(e.target.value),children:[(0,E.jsx)(`option`,{value:``,children:`Select…`}),(e.choices||e.enum).map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]}):(0,E.jsx)(`input`,{...l,type:e.secret?`password`:e.type===`integer`?`number`:`text`,autoComplete:e.secret?`new-password`:`off`,value:t[e.name]??``,onChange:t=>c(e.type===`integer`&&t.target.value!==``?Number(t.target.value):t.target.value)}),(0,E.jsxs)(`label`,{className:e.type===`multiline`?`full-width`:void 0,children:[e.label||e.name,u,e.description&&(0,E.jsx)(`small`,{children:e.description})]})}function je({execute:e,onError:t,onDetail:n,refresh:r,initialSection:i=``}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)({section:i,domain:``,group:``,operation:``,endpoint:void 0}),[v,y]=(0,_.useState)({});(0,_.useEffect)(()=>{let e=!1;return u(null),Promise.allSettled([x(`operations`),x(`endpoints`)]).then(n=>{if(e)return;n[0].status===`fulfilled`&&o(n[0].value),n[1].status===`fulfilled`&&c(n[1].value);let r=n.find(e=>e.status===`rejected`);r&&(u(r.reason),t(r.reason))}),()=>{e=!0}},[r]),(0,_.useEffect)(()=>{let e=!1,n;async function r(){try{let[t,n]=await Promise.all([x(`jobs`),x(`management/state`)]);e||(f(t),m(n))}catch(n){e||t(n)}e||(n=setTimeout(r,2e3))}return r(),()=>{e=!0,clearTimeout(n)}},[r]);let b=De(a,`operations`),ee=(0,_.useMemo)(()=>j(s),[s]),te=ee.find(e=>e.domain===h.domain),S=te?.endpoints.find(e=>e.label===h.endpoint),C=b.find(e=>A(e)===h.operation),w=P(C,v,te),ne=N(C,v,te),re=!(!ne||ne.kind&&ne.versions.length),ie=_e.find(e=>e.id===h.section),ae=be(b,h.section,te),oe=ae.find(e=>e.title===h.group),ue=[`domains`,`go-live`].includes(h.section),de=!!(h.section&&!h.domain&&(ue||C&&xe(C))),fe=!!(C&&!de&&Se(C)&&h.endpoint===void 0),pe=p?.accepting_jobs===!1,me=!!(h.domain&&s&&!te),he=!!(h.endpoint&&s&&!S),ve=w.filter(e=>!(e.name===`domain`&&h.domain)&&!(e.name===`endpoint`&&Se(C))&&!(e.name===`filename`&&w.some(e=>e.type===`file`)));function ye(e){g(e);let t=b.find(t=>A(t)===e.operation),n=ee.find(t=>t.domain===e.domain),r=e.endpoint===void 0?void 0:n?.endpoints.find(t=>t.label===e.endpoint)||null;y(t?Te(t,{domain:n,endpoint:r}):{})}function we(e){let t=be(b,e.id),n=t.length===1?t[0]:void 0;ye({section:e.id,domain:``,group:n?.title||``,operation:n?.operations.length===1?A(n.operations[0]):``,endpoint:void 0})}function je(e){ye({...h,domain:e.id,endpoint:void 0})}function Me(e){ye({...h,operation:e.id,endpoint:void 0})}function Ne(t){t.preventDefault(),!(!C||pe||me||he||re)&&e(A(C),Ee(C,v),{title:C.title,description:C.description})}let Pe=[{label:`Manage`,action:()=>ye({section:``,domain:``,group:``,operation:``,endpoint:void 0})}];ie&&Pe.push({label:ie.title,action:()=>we(ie)}),h.domain&&ue&&Pe.push({label:h.domain,action:()=>ye({...h,group:``,operation:``,endpoint:void 0})}),h.group&&Pe.push({label:h.group,action:()=>ye({...h,operation:``,endpoint:void 0})}),C&&Pe.push({label:C.title,action:()=>ye({...h,domain:ue?h.domain:``,endpoint:void 0})}),h.domain&&!ue&&Pe.push({label:h.domain,action:()=>ye({...h,endpoint:void 0})}),C&&h.endpoint!==void 0&&Pe.push({label:h.endpoint||Ce(C)});let Fe;if(!a)Fe=l?(0,E.jsx)(D,{children:`Management actions could not be loaded. Use Refresh all to retry.`}):(0,E.jsx)(ce,{});else if(!b.length)Fe=(0,E.jsx)(D,{children:`No management operations were returned by the broker.`});else if(!ie)Fe=(0,E.jsx)(ke,{items:_e.filter(e=>be(b,e.id).length),onSelect:we});else if(me||he)Fe=(0,E.jsxs)(D,{children:[`This `,me?`domain`:`endpoint`,` is no longer registered. Select another from the menu above.`]});else if(de){let e=ee.filter(e=>h.section===`go-live`?!e.live:!C||M(C,e));Fe=s?e.length?(0,E.jsx)(ke,{items:e.map(e=>({id:e.domain,title:e.domain,detail:`${e.type===`mcp`?`MCP at /`:`${e.kind||e.type} · ${e.endpoints.length} endpoints`} · ${e.settings?.ACCESS_MODE||`access not reported`}`,badge:e.live?`Live`:`Staged`,tone:e.live?`success`:`info`})),onSelect:je}):(0,E.jsx)(D,{children:h.section===`go-live`?`No staged domains are waiting to go live.`:`No matching domains are registered. Choose Deploy a new domain from Manage to begin.`}):l?(0,E.jsx)(D,{children:`The domain inventory could not be loaded. Use Refresh all to retry.`}):(0,E.jsx)(ce,{children:`Loading registered domains…`})}else if(!h.group)Fe=(0,E.jsx)(ke,{items:ae.map(e=>({id:e.title,title:e.title,detail:e.operations.map(e=>e.title).join(` · `)})),onSelect:e=>{let t=ae.find(t=>t.title===e.id);ye({...h,group:e.id,operation:t.operations.length===1?A(t.operations[0]):``,endpoint:void 0})}});else if(!C)Fe=(0,E.jsx)(ke,{items:(oe?.operations||[]).map(e=>({id:A(e),title:e.title,detail:e.description,badge:e.mutates===!1?`View`:void 0})),onSelect:Me});else if(fe){let e=w.find(e=>e.name===`endpoint`),t=(te?.endpoints||[]).map(e=>({id:e.label,title:e.label===`root`?`Domain root`:`/${e.label}/`,detail:e.repository||`${e.kind} endpoint`}));e.required||t.unshift({id:``,title:Ce(C),detail:`Use the domain scope for this operation`}),Fe=t.length?(0,E.jsx)(ke,{items:t,onSelect:e=>ye({...h,endpoint:e.id})}):(0,E.jsx)(D,{children:`No endpoints are registered for this domain. Add an endpoint from Endpoints and repositories.`})}else Fe=A(C)===`system.update`?(0,E.jsx)(ge,{execute:e,refresh:r,paused:pe}):(0,E.jsxs)(`form`,{className:`management-form`,onSubmit:Ne,children:[C.description&&(0,E.jsx)(`p`,{className:`text-secondary`,children:C.description}),(h.domain||h.endpoint!==void 0)&&(0,E.jsxs)(`div`,{className:`management-context`,children:[(0,E.jsx)(`strong`,{children:h.domain}),h.endpoint!==void 0&&(0,E.jsxs)(`span`,{children:[` · `,h.endpoint?h.endpoint===`root`?`Domain root`:`/${h.endpoint}/`:Ce(C)]})]}),(0,E.jsx)(`div`,{className:`filter-grid`,children:ve.map(e=>(0,E.jsx)(Ae,{field:e.name===`domain`&&A(C)===`pages.upload_icon`?{...e,scopeLabel:`System icons`}:e,values:v,setValues:y,domains:ee,spec:C,selectedDomain:te,currentSettings:A(C)===`runtime.set`?S?.endpoint_settings:void 0,onError:t},`${h.operation}-${h.domain}-${h.endpoint}-${e.name}`))}),!!S&&A(C)===`runtime.set`&&(0,E.jsxs)(`details`,{className:`current-settings`,children:[(0,E.jsx)(`summary`,{children:`Current endpoint settings`}),(0,E.jsx)(k,{rows:Object.entries(S.endpoint_settings||{}).map(([e,t])=>({key:e,value:t})),columns:[{key:`key`,label:`Setting`},{key:`value`,label:`Current value`}]})]}),(0,E.jsx)(`button`,{className:`btn btn-primary`,disabled:pe||re,children:`Review operation`})]});let Ie=De(d,`jobs`),Le=Ie.filter(e=>Oe.has(e.status));return(0,E.jsxs)(E.Fragment,{children:[p?.refresh?.pending&&(0,E.jsxs)(`div`,{className:`alert ${p.refresh.state===`failed`?`alert-warning`:`alert-info`}`,role:`status`,children:[(0,E.jsx)(`strong`,{children:p.refresh.state===`failed`?`Management service update needs attention`:`Management services are updating`}),(0,E.jsx)(`div`,{children:p.refresh.state===`failed`?p.refresh.last_error||`The service refresh could not be scheduled. Management remains available; retry the update or inspect the service from the CLI.`:`Accepted jobs will finish before management restarts. Existing results and issued credentials remain available.`})]}),(0,E.jsxs)(O,{title:C?.title||h.group||(de?`Choose a domain`:ie?.title)||`Server management`,detail:`Follow the CLI menu flow. Started jobs continue when this page closes.`,children:[(0,E.jsx)(`nav`,{"aria-label":`Management navigation`,className:`management-breadcrumb`,children:Pe.map((e,t)=>(0,E.jsxs)(_.Fragment,{children:[t>0&&(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),e.action&&te.status===`waiting`)?`An operation is waiting for the current CLI or management operation to finish; it will continue automatically.`:`Select an operation below for live progress.`]}),(0,E.jsx)(O,{title:`Operation history`,detail:`Select a job to view live progress and output`,children:d?(0,E.jsx)(k,{rows:Ie,onSelect:async e=>{try{n(`Operation details`,await x(`jobs/${encodeURIComponent(e.id)}`))}catch(e){t(e)}},columns:[{key:`id`,label:`Job`},{key:`operation`,label:`Operation`,render:e=>b.find(t=>A(t)===e.operation)?.title||e.operation},{key:`status`,label:`State`,render:e=>(0,E.jsx)(le,{tone:[`failed`,`interrupted`].includes(e.status)?`warning`:e.status===`succeeded`?`success`:`info`,children:e.status})},{key:`created`,label:`Submitted`,render:e=>T(e.created_at??e.created)},{key:`started`,label:`Started`,render:e=>T(e.started_at??e.started)},{key:`finished`,label:`Finished`,render:e=>T(e.finished_at??e.finished)}]}):(0,E.jsx)(ce,{})})]})}var Me=e=>String(e||`unknown`).replaceAll(`_`,` `),Ne=e=>e==null?`Unknown`:`${e<0?`−`:``}${w(Math.abs(e))}/s`;function Pe({refresh:e,execute:t}){let[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=!1,t,n=new AbortController;async function i(){try{let t=await x(`capacity`,{signal:n.signal});e||(r(t),a(null))}catch(t){!e&&t.name!==`AbortError`&&a(t)}e||(t=setTimeout(i,3e4))}return i(),()=>{e=!0,clearTimeout(t),n.abort()}},[e]);let o=!!(i||n?.stale||n?.state!==`observed`),s=n?.collection||{};return(0,E.jsxs)(O,{title:`Capacity and sizing advice`,detail:`Measured limits and repeated saturation; suggestions require operator review and never change settings automatically.`,children:[(0,E.jsx)(se,{error:i}),n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`alert ${o?`alert-warning`:`alert-info`}`,role:`status`,children:[(0,E.jsx)(`strong`,{children:Me(n.state)}),` · Last sample: `,T(n.sampled_at),(0,E.jsx)(`div`,{children:n.note})]}),(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Collection`}),(0,E.jsx)(`strong`,{children:o?`Unknown — observations are not current`:Me(s.state)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Unread backlog`}),(0,E.jsxs)(`strong`,{children:[w(s.unread_bytes),` · `,C(s.unread_files),` files`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Transport / retained archives`}),(0,E.jsxs)(`strong`,{children:[w(s.budgeted_spool_bytes),` / `,w(s.retained_archive_bytes)]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Committed closed transport`}),(0,E.jsxs)(`strong`,{children:[w(s.consumed_rotated_bytes),` · already ingested`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Reclamation`}),(0,E.jsxs)(`div`,{className:`text-end`,children:[(0,E.jsx)(`strong`,{children:o?`Unknown — observations are not current`:Me(s.reclamation?.state)}),(0,E.jsx)(`small`,{className:`d-block`,children:s.reclamation?.reason})]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Producer / collector throughput`}),(0,E.jsxs)(`strong`,{children:[Ne(s.producer_bytes_per_second),` / `,Ne(s.collector_bytes_per_second)]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Backlog growth / continuous backlog`}),(0,E.jsxs)(`strong`,{children:[Ne(s.backlog_growth_bytes_per_second),` / `,C(s.backlog_observed_seconds),` seconds`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Rate window / peak window`}),(0,E.jsxs)(`strong`,{children:[C(s.rate_window_seconds),` seconds / `,C(n.window_seconds/3600),` hours`]})]})]}),(0,E.jsx)(k,{rowKey:e=>e.id,rows:n.limits||[],columns:[{key:`label`,label:`Limit`,render:e=>(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`strong`,{children:e.label}),(0,E.jsxs)(`small`,{className:`d-block`,children:[e.setting||`Host capacity`,` · `,e.unit]})]})},{key:`used`,label:`Usage / effective limit`,render:e=>e.available?`${C(e.used,2)} / ${C(e.effective_limit,2)} ${e.unit}`:`Unavailable`},{key:`high_water`,label:`Observed peak`,render:e=>e.available?`${C(e.high_water,2)} ${e.unit}`:`Unknown`},{key:`episodes`,label:`Saturation`,render:e=>e.available?(0,E.jsxs)(E.Fragment,{children:[C(e.episodes),` episodes`,(0,E.jsxs)(`small`,{className:`d-block`,children:[C(e.saturated_samples),` / `,C(e.samples),` samples; `,C(e.saturated_seconds),` / `,C(e.observed_seconds),` observed seconds`]}),(0,E.jsxs)(`small`,{className:`d-block`,children:[`At or above `,C(e.saturation_threshold*100),`% of limit`]})]}):`Unknown`},{key:`configuration`,label:`Configured value / owner`,render:e=>(0,E.jsxs)(E.Fragment,{children:[e.configuration?.value??`Not observable`,(0,E.jsxs)(`small`,{className:`d-block`,children:[Me(e.configuration?.owner),e.configuration?.editable?` · editable`:` · change at source`]}),(0,E.jsx)(`small`,{className:`d-block`,children:e.configuration?.note})]})},{key:`recommendation`,label:`Recommendation`,render:e=>{let n=he(e,o);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(le,{tone:e.recommendation?.status===`adequate`?`success`:`info`,children:Me(e.recommendation?.status)}),e.recommendation?.value!=null&&!o&&(0,E.jsxs)(`strong`,{className:`d-block`,children:[C(e.recommendation.value,2),` `,e.unit]}),(0,E.jsx)(`small`,{className:`d-block`,children:e.recommendation?.reason}),e.recommendation?.assumptions&&(0,E.jsx)(`small`,{className:`d-block`,children:e.recommendation.assumptions}),n&&(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-primary mt-2`,type:`button`,onClick:()=>t(`settings.set`,n,{title:`Review ${n.key} = ${n.value}`,description:`This is an observed-demand recommendation, not an automatic correction or a guarantee. Confirm free capacity and collection health before applying.`}),children:`Review suggested setting`})]})}}]}),!!n.incidents?.length&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`h3`,{className:`h6 mt-3`,children:`Open capacity incidents`}),(0,E.jsx)(k,{rows:n.incidents,rowKey:e=>e.id,columns:[{key:`id`,label:`Condition`},{key:`since`,label:`Since`,render:e=>T(e.since)},{key:`last_sent`,label:`Last notification`,render:e=>T(e.last_sent)},{key:`last_event`,label:`Last transition`,render:e=>Me(e.last_event)}]})]}),!!Object.keys(n.problems||{}).length&&(0,E.jsxs)(`details`,{className:`mt-3`,children:[(0,E.jsx)(`summary`,{children:`Collection and reclamation diagnostics`}),(0,E.jsx)(`pre`,{className:`record-detail`,children:JSON.stringify(n.problems,null,2)})]})]}):!i&&(0,E.jsx)(ce,{children:`Reading capacity observations…`})]})}function Fe(e,t,n,r=Date.now()/1e3){let i=e.cache||{},a=i.query_translations?.[t],o=i.search_corpora?.translations?.[t],s=i.translation_cache?.translations?.[t],c=a?.expired_chapters>0||[o,s].some(e=>e&&(e.stale||e.checked_at!=null&&i.ttl_seconds!=null&&e.checked_at+i.ttl_seconds<=r)),l=e.translation_status?.[t],u=!!(a||o||s),d=!c&&(l?.ready??(n===`search`?!!(o?.verses>0&&o.indexes?.some(e=>e.case_sensitive===!1&&e.fold_diacritics===!0)):a?.complete===!0));return{code:t,pid:e.pid,resident:u,ready:!!d,stale:c,reason:l?.reason||``,retention_limited:l?.retention_limited===!0,query_chapters:a?.chapters,query_bytes:a?.estimated_bytes,search_verses:o?.verses,search_bytes:o?.estimated_bytes,snapshot_bytes:s?.estimated_bytes,snapshot_present:!!s,ttl:i.ttl_seconds,rss_bytes:e.rss_bytes,private_bytes:e.private_bytes,details:{query:a,search:o,snapshot:s,readiness:l,activity:e.activity},worker:e}}function Ie(e,t=Date.now()/1e3){let n=e.workers||[],r=new Set;for(let e of n)for(let t of[...Object.keys(e.cache?.query_translations||{}),...Object.keys(e.cache?.search_corpora?.translations||{}),...Object.keys(e.cache?.translation_cache?.translations||{})])r.add(t);return[...r].sort().map(n=>Le(e,n,t))}function Le(e,t,n=Date.now()/1e3){let r=(e.workers||[]).map(r=>Fe(r,t,e.kind,n)),i=e.expected_workers??r.length,a=e.complete===!0&&r.length>0&&r.length===i,o=r.filter(e=>e.resident),s=r.filter(e=>e.ready).length,c=o.some(e=>e.stale),l=a&&s===i;return{code:t,workers:r,resident:o,expected:i,completeReport:a,readyCount:s,ready:l,stale:c,status:l?`Warm`:c?`Recheck on use`:o.length?`Partly resident`:a?`Not in memory`:`Not reported`,configured:(e.configured_warm_translations||[]).includes(t),reasons:[...new Set(r.filter(e=>e.resident&&!e.ready).map(e=>e.reason).filter(Boolean))]}}function Re(e,t){let n=e.map(e=>e[t]).filter(e=>Number.isFinite(e));return n.length?{min:Math.min(...n),max:Math.max(...n)}:null}function ze(e,t,n=C){let r=Re(e,t);return r?r.min===r.max?n(r.min):`${n(r.min)}–${n(r.max)}`:`—`}function Be(e,t,n){let r=Re(e,t);return`${ze(e,t)} ${n}${r?.min===1&&r?.max===1?``:`s`}`}function Ve({row:e}){return(0,E.jsx)(le,{tone:e.ready?`success`:e.resident.length?`warning`:`muted`,children:e.status})}function He({row:e,onBack:t,onDetail:n}){return(0,E.jsxs)(`div`,{className:`worker-layer`,children:[(0,E.jsxs)(`div`,{className:`worker-heading`,children:[(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:t,children:`Back to translations`}),(0,E.jsxs)(`strong`,{children:[e.code.toUpperCase(),` · workers`]}),(0,E.jsx)(Ve,{row:e})]}),(0,E.jsxs)(`p`,{className:`panel-note`,children:[C(e.resident.length),` of `,C(e.expected),` workers currently retain this translation. Counts and estimates below describe each worker separately. A worker can retain query chapters alongside a complete search corpus.`]}),(0,E.jsx)(k,{rows:e.workers,rowKey:e=>e.pid,onSelect:t=>n(`${e.code.toUpperCase()} · worker ${t.pid}`,t.details),columns:[{key:`pid`,label:`Worker PID`},{key:`resident`,label:`Cache state`,render:e=>(0,E.jsxs)(`div`,{children:[(0,E.jsx)(le,{tone:e.ready?`success`:e.resident?`warning`:`muted`,children:e.ready?`Warm`:e.stale?`Recheck on use`:e.resident?`Partly resident`:`Not in memory`}),e.reason&&(0,E.jsx)(`small`,{className:`cell-note`,children:e.reason})]})},{key:`query_chapters`,label:`Query chapters`,render:e=>(0,E.jsxs)(`div`,{children:[C(e.query_chapters),(0,E.jsxs)(`small`,{className:`cell-note`,children:[w(e.query_bytes),` estimated`]})]})},{key:`search_verses`,label:`Search corpus / index`,render:e=>(0,E.jsxs)(`div`,{children:[e.search_verses==null?`—`:`${C(e.search_verses)} verses`,(0,E.jsxs)(`small`,{className:`cell-note`,children:[w(e.search_bytes),` estimated`]})]})},{key:`snapshot_bytes`,label:`Translation snapshot`,render:e=>e.snapshot_present?`${w(e.snapshot_bytes)} estimated`:`—`},{key:`ttl`,label:`Memory TTL`,render:e=>e.ttl==null?`—`:`${C(e.ttl/86400,1)} days`},{key:`rss_bytes`,label:`Worker RSS`,render:e=>w(e.rss_bytes)},{key:`private_bytes`,label:`Worker private memory`,render:e=>w(e.private_bytes)}]}),(0,E.jsx)(`p`,{className:`panel-note`,children:`RSS includes shared pages and the whole worker. Private memory also covers the whole worker. Neither is a per-translation measurement; cache estimates may overlap.`})]})}function Ue({onError:e,execute:t,onDetail:n,refresh:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(`kjv`),[u,d]=(0,_.useState)({});(0,_.useEffect)(()=>{let t=!1,n;async function r(){try{let e=await x(`translations`);t||a(e)}catch(n){t||e(n)}t||(n=setTimeout(r,5e3))}return r(),()=>{t=!0,clearTimeout(n)}},[r]);let f=i?.endpoints||[],p=f.find(e=>`${e.domain}/${e.label}`===o),m=p?.available_translations||[],h=c.trim().toLowerCase(),g=p?Le(p,h):null,v=/^[a-z0-9][a-z0-9_-]{0,29}$/.test(h);function y(e,n,r){t(`runtime.cache`,{domain:e.domain,endpoint:e.label,action:r,translation:n})}return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(O,{title:`Translation memory`,detail:`See what is in memory, then select a translation to inspect its workers. Current residency is refreshed every five seconds.`,children:[(0,E.jsxs)(`div`,{className:`filter-grid`,children:[(0,E.jsxs)(`label`,{children:[`Runtime endpoint`,(0,E.jsxs)(`select`,{"aria-label":`Runtime endpoint`,className:`form-select`,value:o,onChange:e=>s(e.target.value),children:[(0,E.jsx)(`option`,{value:``,children:`Select endpoint`}),f.map(e=>(0,E.jsxs)(`option`,{value:`${e.domain}/${e.label}`,children:[e.domain,` / `,e.label,` · `,e.kind]},`${e.domain}/${e.label}`))]})]}),(0,E.jsxs)(`label`,{children:[`Translation`,(0,E.jsx)(`input`,{list:`available-translations`,className:`form-control`,value:c,onChange:e=>l(e.target.value),placeholder:`kjv`}),(0,E.jsx)(`datalist`,{id:`available-translations`,children:m.map(e=>(0,E.jsx)(`option`,{value:e.translation,children:Le(p,e.translation).status},e.translation))})]}),(0,E.jsx)(`div`,{className:`d-flex gap-2 align-items-end`,children:(0,E.jsx)(`button`,{className:`btn btn-primary`,disabled:!p||!v||g?.ready,onClick:()=>y(p,h,`warm`),children:g?.ready?`Already warm`:`Warm translation`})})]}),g&&v&&(0,E.jsxs)(`div`,{className:`warm-selection`,"aria-live":`polite`,children:[(0,E.jsx)(Ve,{row:g}),(0,E.jsxs)(`span`,{children:[h.toUpperCase(),` · `,C(g.resident.length),` / `,C(g.expected),` workers retain data · `,C(g.readyCount),` ready`,g.configured?` · configured for startup warming`:``]}),g.reasons.map(e=>(0,E.jsx)(`small`,{children:e},e)),!g.completeReport&&(0,E.jsx)(`small`,{children:`Some workers have not reported; their memory state is unknown.`})]})]}),i?f.length?f.map(e=>{let t=`${e.domain}/${e.label}`,r=Ie(e),i=u[t]?Le(e,u[t]):null;return(0,E.jsxs)(O,{title:`${e.domain} / ${e.label}`,detail:`${e.kind} · ${r.length} translation${r.length===1?``:`s`} currently resident · ${e.workers?.length||0} worker${e.workers?.length===1?``:`s`} reported`,actions:(0,E.jsx)(le,{tone:e.complete?`success`:`warning`,children:e.complete?`All workers reported`:`Partial report`}),children:[i?(0,E.jsx)(He,{endpoint:e,row:i,onDetail:n,onBack:()=>d({...u,[t]:``})}):(0,E.jsxs)(E.Fragment,{children:[r.length?(0,E.jsx)(k,{rows:r,rowKey:e=>e.code,onSelect:e=>d({...u,[t]:e.code}),columns:[{key:`code`,label:`Translation`,render:e=>(0,E.jsxs)(`span`,{children:[e.code.toUpperCase(),(0,E.jsx)(`small`,{className:`cell-note`,children:e.configured?`Startup warming configured`:`Currently in memory`})]})},{key:`status`,label:`Readiness`,render:e=>(0,E.jsxs)(`div`,{children:[(0,E.jsx)(Ve,{row:e}),e.reasons.map(e=>(0,E.jsx)(`small`,{className:`cell-note`,children:e},e))]})},{key:`workers`,label:`Worker coverage`,render:e=>(0,E.jsxs)(`div`,{children:[C(e.resident.length),` / `,C(e.expected),` resident`,(0,E.jsxs)(`small`,{className:`cell-note`,children:[C(e.readyCount),` / `,C(e.expected),` ready`]})]})},{key:`query_chapters`,label:`Query data per worker`,render:e=>{let t=e.resident.filter(e=>e.query_chapters!=null);return t.length?(0,E.jsxs)(`div`,{children:[Be(t,`query_chapters`,`chapter`),(0,E.jsxs)(`small`,{className:`cell-note`,children:[ze(t,`query_bytes`,w),` estimated · `,t.length,` worker`,t.length===1?``:`s`]})]}):`—`}},{key:`search_verses`,label:`Search data per worker`,render:e=>{let t=e.resident.filter(e=>e.search_verses!=null);return t.length?(0,E.jsxs)(`div`,{children:[ze(t,`search_verses`),` verses`,(0,E.jsxs)(`small`,{className:`cell-note`,children:[ze(t,`search_bytes`,w),` corpus / index estimate · `,t.length,` worker`,t.length===1?``:`s`]})]}):`—`}},{key:`snapshot_bytes`,label:`Snapshot per worker`,render:e=>{let t=e.resident.filter(e=>e.snapshot_present);return t.length?(0,E.jsxs)(`div`,{children:[ze(t,`snapshot_bytes`,w),` estimated`,(0,E.jsxs)(`small`,{className:`cell-note`,children:[t.length,` worker`,t.length===1?``:`s`]})]}):`—`}},{key:`actions`,label:`All workers`,render:t=>(0,E.jsxs)(`div`,{className:`btn-group`,children:[!t.ready&&(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-primary`,onClick:()=>y(e,t.code,`warm`),children:`Warm`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-primary`,onClick:()=>y(e,t.code,`reload`),children:`Reload`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-danger`,onClick:()=>y(e,t.code,`drop`),children:`Drop`})]})}]}):(0,E.jsx)(D,{children:e.complete?`No translations are currently retained in worker memory.`:`No resident translations have been reported yet.`}),(0,E.jsx)(`p`,{className:`panel-note`,children:`Ranges show differences between workers, not a combined memory total. Select a translation for individual worker contents and measured memory.`})]}),(0,E.jsxs)(`details`,{className:`worker-details`,children:[(0,E.jsxs)(`summary`,{children:[C(e.available_translations?.length||0),` translations available on disk`]}),(0,E.jsx)(k,{rows:e.available_translations||[],onSelect:e=>n(`${e.translation.toUpperCase()} on disk`,e),columns:[{key:`translation`,label:`Translation`,render:e=>e.translation.toUpperCase()},{key:`memory`,label:`Current memory`,render:t=>(0,E.jsx)(Ve,{row:Le(e,t.translation)})},{key:`allocated_bytes`,label:`Allocated disk`,render:e=>w(e.allocated_bytes)},{key:`logical_bytes`,label:`File contents`,render:e=>w(e.logical_bytes)},{key:`files`,label:`Files`,render:e=>C(e.files)},{key:`warm`,label:`All workers`,render:t=>{let n=Le(e,t.translation);return(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-primary`,disabled:n.ready,onClick:()=>y(e,t.translation,`warm`),children:n.ready?`Already warm`:`Warm translation`})}}]})]}),!!e.configured_warm_translations?.length&&(0,E.jsxs)(`p`,{className:`panel-note`,children:[`Configured startup warm-ups: `,e.configured_warm_translations.map(e=>e.toUpperCase()).join(`, `),`. Configuration describes startup intent; the table shows current memory.`]}),e.inventory_error&&(0,E.jsx)(`div`,{className:`alert alert-warning m-3`,children:e.inventory_error}),!!e.errors?.length&&(0,E.jsx)(`div`,{className:`alert alert-warning m-3`,children:e.errors.map((e,t)=>(0,E.jsx)(`div`,{children:typeof e==`string`?e:e.error||`Worker did not report.`},t))})]},t)}):(0,E.jsx)(D,{children:`No runtime endpoints are configured.`}):(0,E.jsx)(ce,{})]})}function We(e,t,n,r={},i=Math.floor(Date.now()/1e3)){let a=n?i:t.end,o=n?a-900:t.start,s=n?5:Math.max(1,Math.ceil((a-o)/400)),c=S({...r,start:o,end:a,bucket_seconds:s});return e===`Overview`?{overview:`overview?${c}&dimensions=auth,endpoint,status,translation,search,reference,book,ip,referrer,user_agent`,history:`history?${c}`}:e===`Resources`?{metrics:`metrics?${S({start:o,end:a,bucket_seconds:s})}`}:e===`MCP traffic`?{mcp:`mcp?${c}`}:e===`Audience`?{audience:`audience?${c}`}:{}}var Ge=()=>({data:null,error:null,loading:!0,preparing:!1,progress:null});function Ke({paths:e,live:t=!1,interval:n=2e3,onChange:r,onError:i=()=>{},onUpdate:a=()=>{},load:o=x,schedule:s=setTimeout,cancel:c=clearTimeout}){let l=new AbortController,u=new Map,d=!1;async function f(c,p=Ge()){if(d)return;let m={...p,loading:!0};r(c,m);let h,g=t?n:null;try{let t=await o(e()[c],{signal:l.signal});if(d)return;t.state===`preparing`?(h={...m,error:null,preparing:!0,progress:t.progress||null},g=Math.max(500,Math.min(3e4,Number(t.retry_after)*1e3||2e3))):(h={data:t,error:null,loading:!1,preparing:!1,progress:null},a())}catch(e){if(d||e.name===`AbortError`)return;h={...m,error:e,loading:!1,preparing:!1,progress:null},e.status===401&&(g=null,i(e))}d||(r(c,h),g!==null&&u.set(c,s(()=>f(c,h),g)))}for(let t of Object.keys(e()))f(t);return()=>{d=!0,l.abort();for(let e of u.values())c(e);u.clear()}}function qe({page:e,range:t,live:n,filters:r,refresh:i,enabled:a=!0,interval:o=2e3,onError:s,onUpdate:c}){let l=JSON.stringify([e,t.start,t.end,n,r,i,a,o]),[u,d]=(0,_.useState)({key:null,values:{}});(0,_.useEffect)(()=>{if(d({key:l,values:{}}),a)return Ke({paths:()=>We(e,t,n,r),live:n,interval:o,onError:s,onUpdate:c,onChange:(e,t)=>d(n=>({key:l,values:{...n.key===l?n.values:{},[e]:t}}))})},[l]);let f=u.key===l?u.values:{};return Object.fromEntries(Object.keys(We(e,t,n,r)).map(e=>[e,f[e]||Ge()]))}function Je({report:e,label:t,children:n}){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(se,{error:e.error&&Error(`${t}: ${e.error.message}`)}),e.preparing&&(0,E.jsxs)(`div`,{className:`alert alert-info py-2`,role:`status`,children:[`Preparing `,t.toLowerCase(),` for this time range…`]}),e.data?n:e.loading&&!e.preparing?(0,E.jsxs)(ce,{children:[`Loading `,t.toLowerCase(),`…`]}):null]})}function Ye({dimension:e,title:t,label:n,filters:r,range:i,live:a,refresh:o,onFilter:s,onError:c}){let[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),{audience:p}=qe({page:`Audience`,range:i,live:a,refresh:o,onError:c,interval:5e3,filters:{...r,dimension:e,top:1e3,[`${e}_contains`]:d}}),m=p.data?.[e===`referrer`?`referrers`:`user_agents`]||[];return(0,E.jsxs)(O,{title:t,detail:`Origin requests, including errors. Select a row to explore its traffic.`,children:[(0,E.jsxs)(`form`,{className:`filter-grid`,onSubmit:e=>{e.preventDefault(),f(l)},children:[(0,E.jsxs)(`label`,{children:[`Find `,n.toLowerCase(),(0,E.jsx)(`input`,{className:`form-control`,value:l,onChange:e=>u(e.target.value),placeholder:`Part of a ${n.toLowerCase()}`})]}),(0,E.jsxs)(`div`,{className:`d-flex gap-2 align-items-end`,children:[(0,E.jsx)(`button`,{className:`btn btn-sm btn-primary`,children:`Search`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-outline-secondary`,onClick:()=>{u(``),f(``)},children:`Clear`})]})]}),(0,E.jsx)(Je,{report:p,label:t,children:(0,E.jsx)(k,{rows:m,rowKey:e=>e.value,onSelect:t=>s(e,t.value,t.filters),columns:[{key:`value`,label:n,render:e=>(0,E.jsx)(`span`,{className:`consumer-value`,title:e.value,children:e.value})},{key:`calls`,label:`Requests`,render:e=>C(e.calls)},{key:`errors`,label:`Errors`,render:e=>C(e.errors)},{key:`bytes`,label:`Transfer`,render:e=>w(e.bytes)}]})}),(0,E.jsx)(`div`,{className:`table-footer`,children:(0,E.jsxs)(`small`,{children:[m?.length===1e3?`Top 1,000 matching values. Search to narrow the results.`:`${C(m?.length||0)} matching values`,` · requests without a recorded `,n.toLowerCase(),` are omitted.`]})})]})}function Xe(e){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`p`,{className:`text-secondary`,children:`Referrers and user agents are recorded request fields. User agents may identify software, robots or browsers; these reported values do not establish a person's identity. Select a value to inspect matching requests in this time range.`}),(0,E.jsx)(Ye,{...e,dimension:`referrer`,title:`Referrers`,label:`Referrer`}),(0,E.jsx)(Ye,{...e,dimension:`user_agent`,title:`User agents and robots`,label:`User agent`})]})}function Ze(e,t,n={}){return{...n,...t.filters||{[e]:t.value}}}var Qe=e=>[`queued`,`waiting`,`running`].includes(e),$e=[[`mcp_method`,`MCP method`],[`mcp_tool`,`MCP tool`],[`mcp_client_name`,`Declared MCP client`],[`mcp_client_version`,`MCP client version`],[`upstream_service`,`Upstream service`],[`upstream_api_version`,`Upstream API version`],[`upstream_operation`,`Upstream operation`]],et=[`success`,`tool_error`,`protocol_error`,`transport_error`,`unknown`],tt=new Set([`tool_error`,`protocol_error`,`transport_error`]);function nt(e={}){return{...e,endpoint_kind:`mcp`,origin_only:`true`}}function rt(e={}){let t=nt(e);for(let e of[`version`,`translation`,`reference`,`search`,`book`,`usage`,`operation`])delete t[e];return e.endpoint_kind!==`mcp`&&delete t.endpoint,t}function it(e){return Number(e.status)>=400||e.mcp_error===!0||tt.has(e.mcp_outcome)}function at(e,t,n){if(t===`endpoint_kind`&&n===`mcp`)return rt(e);let r={...e,[t]:n};if((t===`successful`&&n!==`true`||t===`endpoint_kind`)&&delete r.usage,t===`endpoint_kind`&&n!==`mcp`){for(let[e]of $e)delete r[e];delete r.mcp_outcome,e.endpoint_kind===`mcp`&&delete r.endpoint}return t===`mcp_outcome`&&tt.has(n)&&(delete r.successful,delete r.usage),t===`successful`&&n===`true`&&tt.has(r.mcp_outcome)&&delete r.mcp_outcome,t===`status`&&/^\d{3}$/.test(String(n))&&!(Number(n)>=200&&Number(n)<300)&&Number(n)!==304&&(delete r.usage,delete r.successful),r}var ot=[[`endpoint`,`MCP domains`,`Origin requests to the protocol endpoint at /`,`Domain`],[`mcp_method`,`Protocol methods`,`Initialization, discovery, tool calls and notifications`,`Method`],[`mcp_tool`,`MCP tools`,`Recorded tool names, without tool arguments`,`Tool`],[`mcp_outcome`,`Protocol outcomes`,`Tool and protocol errors can have HTTP status 200`,`Outcome`],[`mcp_client_name`,`Declared clients`,`Client names supplied during initialization`,`Client`],[`mcp_client_version`,`Declared client versions`,`Client versions supplied during initialization`,`Client version`],[`upstream_service`,`Upstream API services`,`Service selected by a recorded API operation`,`Service`],[`upstream_api_version`,`Upstream API versions`,`API versions are tool inputs; the MCP host has no version paths`,`API version`],[`upstream_operation`,`Upstream API operations`,`Operation identifiers selected by recorded tool calls`,`Operation`],[`status`,`HTTP responses`,`Includes rejected and malformed origin requests`,`HTTP status`]];function st({filters:e,range:t,live:n,refresh:r,onFilter:i,onError:a,onZoom:o}){let s=(0,_.useMemo)(()=>nt(e),[e]),{mcp:c}=qe({page:`MCP traffic`,range:t,live:n,filters:s,refresh:r,onError:a}),l=c.data;function u(e,t,n){i(e,t,Ze(e,{value:t,filters:n},s))}if(!l)return(0,E.jsx)(Je,{report:c,label:`MCP traffic`});let d=[[`MCP requests`,C(l.mcp_requests??l.calls),`${C(l.unique_ips)} unique IPs`],[`Tool calls`,C(l.mcp_tool_calls),`Recorded tools/call requests`],[`Errors`,C(l.mcp_errors??l.errors),`${C(l.http_errors)} HTTP errors; includes protocol failures`],[`Average duration`,`${C(l.duration_ms,1)} ms`,`Observed origin request duration`],[`P95 duration`,l.latency_ms?.p95==null?`—`:`${C(l.latency_ms.p95,1)} ms`,`Histogram estimate`]],f=ae(l.series||[],[[`duration_ms`,`Average duration (ms)`]]);return f.xAxis.axisLabel={hideOverlap:!0},(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Je,{report:c,label:`MCP traffic`}),(0,E.jsx)(`p`,{className:`text-secondary`,children:`MCP origin requests are counted once, including requests rejected before protocol handling. Protocol methods and outcomes appear when captured; user agents remain available independently of declared client metadata.`}),(0,E.jsx)(`div`,{className:`metric-grid`,children:d.map(([e,t,n])=>(0,E.jsxs)(`div`,{className:`metric panel`,children:[(0,E.jsx)(`span`,{children:e}),(0,E.jsx)(`strong`,{children:t}),(0,E.jsx)(`small`,{children:n})]},e))}),(0,E.jsxs)(`div`,{className:`overview-grid`,children:[(0,E.jsx)(O,{className:`flow-panel`,title:`MCP requests and errors`,detail:`HTTP failures and captured MCP failures`,actions:(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:()=>u(`endpoint_kind`,`mcp`,s),children:`Explore requests`}),children:(0,E.jsx)(re,{label:`MCP requests and errors over time`,height:300,onZoom:o,option:ae(l.series||[],[[`calls`,`Requests`],[`errors`,`Errors`]],{zoom:!0})})}),(0,E.jsx)(O,{title:`Request duration`,detail:`Includes the lifetime of streamed HTTP requests`,children:(0,E.jsx)(re,{label:`Average MCP origin request duration in milliseconds`,height:300,option:f})})]}),(0,E.jsx)(`div`,{className:`resource-grid`,children:ot.map(([e,t,n,r])=>(0,E.jsx)(O,{title:t,detail:n,children:(0,E.jsx)(k,{rows:l.breakdowns?.[e]||[],onSelect:t=>u(e,t.value,t.filters),columns:[{key:`value`,label:r,render:e=>(0,E.jsx)(`span`,{className:`consumer-value`,title:String(e.value),children:e.value||(0,E.jsx)(le,{children:`Unrecorded`})})},{key:`calls`,label:`Requests`,render:e=>C(e.calls)},{key:`errors`,label:`Errors`,render:e=>C(e.errors)},{key:`duration_ms`,label:`Avg. ms`,render:e=>C(e.duration_ms,1)}]})},e))}),(0,E.jsx)(Xe,{filters:s,range:t,live:n,refresh:r,onFilter:u,onError:a})]})}var ct=[`Overview`,`Traffic`,`MCP traffic`,`Audience`,`Translations`,`Resources`,`Events`,`Manage`,`Sessions`],lt={Live:900,"24 hours":86400,"7 days":604800,"30 days":2592e3,"6 months":15552e3},ut=(e,t)=>Array.isArray(e)?e:e?.[t]??e?.items??[];function dt({title:e,value:t,onClose:n,children:r}){let i=(0,_.useRef)(null),a=(0,_.useId)();return(0,_.useEffect)(()=>{let e=new window.bootstrap.Modal(i.current),t=()=>n();return i.current.addEventListener(`hidden.bs.modal`,t),e.show(),()=>{i.current?.removeEventListener(`hidden.bs.modal`,t),e.hide(),e.dispose()}},[]),(0,E.jsx)(`div`,{ref:i,className:`modal`,tabIndex:`-1`,"aria-labelledby":a,children:(0,E.jsx)(`div`,{className:`modal-dialog modal-xl modal-dialog-scrollable`,children:(0,E.jsxs)(`div`,{className:`modal-content`,children:[(0,E.jsxs)(`div`,{className:`modal-header`,children:[(0,E.jsx)(`h2`,{className:`modal-title fs-5`,id:a,children:e}),(0,E.jsx)(`button`,{className:`btn-close`,"data-bs-dismiss":`modal`,"aria-label":`Close details`})]}),(0,E.jsx)(`div`,{className:`modal-body`,children:r||(0,E.jsx)(`pre`,{className:`record-detail`,children:JSON.stringify(t,null,2)})})]})})})}function ft({onLogin:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(60),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!a)return;let e=setInterval(()=>c(Math.max(0,Math.ceil((a.deadline-Date.now())/1e3))),250);return()=>clearInterval(e)},[a]);async function h(s){s.preventDefault(),u(null),f(!0);try{if(a)await te(`auth/token`,{challenge_id:a.challenge_id,token:r}),i(``),e(await x(`auth/status`));else{let e=await te(`auth/password`,{password:t});n(``),o({...e,deadline:Date.now()+e.expires_in*1e3})}}catch(e){u(e),(e.status===403||e.status===423)&&m(!0)}finally{f(!1)}}return(0,E.jsxs)(`main`,{className:`login-page`,children:[(0,E.jsxs)(`div`,{className:`login-brand`,children:[(0,E.jsx)(`img`,{src:`/favicon.png`,alt:``}),(0,E.jsx)(`span`,{children:`getBible`}),(0,E.jsx)(`small`,{children:`OPERATIONS`})]}),(0,E.jsxs)(`section`,{className:`login-box panel`,children:[(0,E.jsx)(`span`,{className:`eyebrow`,children:`PRIVATE CONSOLE`}),(0,E.jsx)(`h1`,{children:a?`Check Telegram`:`Sign in to your server`}),(0,E.jsx)(`p`,{children:a?`Enter the one-use code sent to your configured Telegram group.`:`Your password and a Telegram code protect access to this console.`}),(0,E.jsx)(se,{error:l}),(0,E.jsxs)(`form`,{onSubmit:h,children:[(0,E.jsx)(`label`,{className:`form-label`,htmlFor:`credential`,children:a?`Telegram code`:`Password`}),(0,E.jsx)(`input`,{autoFocus:!0,className:`form-control form-control-lg`,id:`credential`,type:a?`text`:`password`,autoComplete:a?`one-time-code`:`current-password`,spellCheck:`false`,autoCapitalize:`none`,value:a?r:t,disabled:d||p,onChange:e=>a?i(e.target.value):n(e.target.value),required:!0}),a&&(0,E.jsx)(`div`,{className:`mt-3 ${s<15?`text-danger`:`text-secondary`}`,"aria-live":`polite`,children:s?`${s}s remaining`:`Code expired. Unblock your IP through the CLI to try again.`}),(0,E.jsx)(`button`,{className:`btn btn-primary w-100 mt-4`,disabled:d||p||a&&!s,children:d?`Please wait…`:a?`Verify and open dashboard`:`Continue with Telegram`})]}),(0,E.jsx)(`p`,{className:`login-note`,children:a?`An incorrect or expired code blocks this IP until it is unblocked through the CLI.`:`Three incorrect passwords block this IP. Successful sessions last up to 30 days.`})]}),(0,E.jsx)(`small`,{className:`text-secondary`,children:`Traffic recording continues while this console is asleep.`})]})}function pt({rows:e=[],label:t,onSelect:n}){let r=Math.max(1,...e.map(e=>e.calls));return e.length?(0,E.jsx)(`div`,{className:`rankings`,children:e.slice(0,8).map((e,i)=>(0,E.jsxs)(`button`,{className:`ranking`,onClick:()=>n?.(e.value,e),children:[(0,E.jsx)(`span`,{className:`rank-index`,children:String(i+1).padStart(2,`0`)}),(0,E.jsxs)(`span`,{className:`rank-name`,title:String(e.label||e.value),children:[e.label||e.value||`Unspecified`,(0,E.jsx)(ue,{value:e.calls,max:r,label:`${t}: ${e.value}`})]}),(0,E.jsx)(`strong`,{children:C(e.calls)})]},`${e.value}-${i}`))}):(0,E.jsx)(D,{})}function mt({overview:e,timeline:t,onFilter:n,onDetail:r,onZoom:i}){let a=e.data||{},o=t.data||{},s=a.breakdowns||{},c=a.latest_metrics||{},l=[[`Origin requests`,C(a.calls),`${C(a.unique_ips)} unique IPs`],[`Request rate`,C(a.requests_per_second,1),`requests / second`],[`P95 latency`,a.latency_ms?.p95==null?`—`:`${C(a.latency_ms.p95,1)} ms`,`histogram estimate`],[`Cache hit rate`,a.cache_hit_ratio==null?`—`:`${C(a.cache_hit_ratio*100,1)}%`,`${C(a.cache_hits)} origin cache hits`],[`Errors`,C(a.errors),`${C(a.rate_limited)} rate limited`]];return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Je,{report:e,label:`Request totals`,children:(0,E.jsx)(`div`,{className:`metric-grid`,children:l.map(([e,t,n])=>(0,E.jsxs)(`div`,{className:`metric panel`,children:[(0,E.jsx)(`span`,{children:e}),(0,E.jsx)(`strong`,{children:t}),(0,E.jsx)(`small`,{children:n})]},e))})}),(0,E.jsxs)(`div`,{className:`overview-grid`,children:[(0,E.jsx)(O,{className:`flow-panel`,title:`Request flow`,detail:`Origin traffic over the selected period`,actions:(0,E.jsxs)(le,{tone:`info`,children:[w(a.bytes),` transferred`]}),children:(0,E.jsx)(Je,{report:t,label:`Request flow`,children:(0,E.jsx)(re,{label:`Origin requests and errors by time`,height:310,onZoom:i,option:ae(o.series||[],[[`calls`,`Requests`],[`errors`,`Errors`]],{zoom:!0})})})}),e.data&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O,{title:`Access breakdown`,detail:`Credential state at the origin`,children:(0,E.jsx)(re,{label:`Anonymous, authenticated and rejected request breakdown`,option:oe(s.auth||[]),height:310})}),(0,E.jsx)(O,{className:`endpoints-panel`,title:`API endpoints`,detail:`Select an endpoint to inspect its traffic`,children:(0,E.jsx)(k,{rows:s.endpoint||s.domain||[],onSelect:e=>n(`endpoint`,e.value,e.filters),columns:[{key:`value`,label:`Endpoint`},{key:`calls`,label:`Requests`,render:e=>C(e.calls)},{key:`errors`,label:`Errors`,render:e=>C(e.errors)},{key:`bytes`,label:`Transfer`,render:e=>w(e.bytes)}]})}),(0,E.jsx)(O,{title:`Response codes`,detail:`Failures and rate limits`,children:(0,E.jsx)(pt,{rows:s.status||[],label:`Response status`,onSelect:(e,t)=>n(`status`,e,Ze(`status`,t))})}),(0,E.jsx)(O,{title:`Popular translations`,detail:`Successful origin requests`,children:(0,E.jsx)(pt,{rows:s.translation||[],label:`Translation`,onSelect:(e,t)=>n(`translation`,e,Ze(`translation`,t))})}),(0,E.jsx)(O,{title:`Frequent searches`,detail:`Successful origin requests`,children:(0,E.jsx)(pt,{rows:s.search||[],label:`Search`,onSelect:(e,t)=>n(`search`,e,Ze(`search`,t))})}),(0,E.jsx)(O,{title:`Scripture references`,detail:`Successful origin requests`,children:(0,E.jsx)(pt,{rows:s.reference||[],label:`Reference`,onSelect:(e,t)=>n(`reference`,e,Ze(`reference`,t))})}),(0,E.jsx)(O,{title:`Books of the Bible`,detail:`Successful origin requests`,children:(0,E.jsx)(pt,{rows:s.book||[],label:`Book`,onSelect:(e,t)=>n(`book`,e,Ze(`book`,t))})}),(0,E.jsx)(O,{title:`Active IP addresses`,detail:`Inspect high-volume origin consumers`,children:(0,E.jsx)(pt,{rows:s.ip||[],label:`Client IP`,onSelect:(e,t)=>n(`ip`,e,Ze(`ip`,t))})}),(0,E.jsx)(O,{title:`Referrers`,detail:`Origin requests, including errors`,children:(0,E.jsx)(pt,{rows:s.referrer||[],label:`Referrer`,onSelect:(e,t)=>n(`referrer`,e,t.filters)})}),(0,E.jsx)(O,{title:`User agents`,detail:`Origin requests, including errors`,children:(0,E.jsx)(pt,{rows:s.user_agent||[],label:`User agent`,onSelect:(e,t)=>n(`user_agent`,e,t.filters)})}),(0,E.jsx)(O,{title:`Collector health`,detail:`Continuous capture, independent of this dashboard`,children:(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Available history`}),(0,E.jsx)(`strong`,{children:T(a.retention?.first_request)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Last sample`}),(0,E.jsx)(`strong`,{children:T(c.stamp)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Observed scope`}),(0,E.jsx)(`strong`,{children:`Origin only`})]}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary btn-sm`,onClick:()=>r(`Retention and capture health`,a.retention||{}),children:`Retention details`})]})})]})]})]})}function ht({filters:e,setFilters:t,range:n,live:r,onError:i,onDetail:a}){let[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(n),[m,h]=(0,_.useState)(e);(0,_.useEffect)(()=>{h(e),l(``),d([])},[e]),(0,_.useEffect)(()=>{let t=new AbortController,a=!1,o;async function l(){let u=r&&!c?Math.floor(Date.now()/1e3):c?f.end:n.end,d=r&&!c?u-900:c?f.start:n.start;try{let i=await x(`requests?${S({start:d,end:u,...e,cursor:c,limit:100})}`,{signal:t.signal});a||(s(i),c||p({start:r?u-900:n.start,end:u}))}catch(e){!a&&e.name!==`AbortError`&&i(e)}!a&&r&&!c&&(o=setTimeout(l,2e3))}return l(),()=>{a=!0,clearTimeout(o),t.abort()}},[e,n.start,n.end,c,r]);function g(e){e.preventDefault(),t(m)}let v=m.endpoint_kind===`mcp`,y=ut(o,`requests`),b=e.endpoint_kind===`mcp`||y.some(e=>e.endpoint_kind===`mcp`),ee=[[`endpoint`,v?`MCP domain`:`Endpoint`],[`ip`,`Client IP`],...v?$e:[[`version`,`Version`],[`translation`,`Translation`],[`reference`,`Reference`],[`search`,`Search query`],[`book`,`Book number`]],[`status`,`HTTP status`],[`referrer`,`Exact referrer`],[`user_agent`,`Exact user agent`],[`referrer_contains`,`Referrer contains`],[`user_agent_contains`,`User agent contains`],[`path_contains`,`Request path contains`],[`q`,`Search recorded request data`]];return(0,E.jsxs)(O,{title:`Request explorer`,detail:`Inspect recorded request details; credentials are excluded`,children:[(0,E.jsxs)(`form`,{className:`filter-grid`,onSubmit:g,children:[ee.map(([e,t])=>(0,E.jsxs)(`label`,{children:[t,(0,E.jsx)(`input`,{className:`form-control form-control-sm`,value:m[e]||``,onChange:t=>h(at(m,e,t.target.value))})]},e)),(0,E.jsxs)(`label`,{children:[`Endpoint kind`,(0,E.jsxs)(`select`,{"aria-label":`Endpoint kind`,className:`form-select form-select-sm`,value:m.endpoint_kind||``,onChange:e=>h(at(m,`endpoint_kind`,e.target.value)),children:[(0,E.jsx)(`option`,{value:``,children:`All kinds`}),(0,E.jsx)(`option`,{value:`static`,children:`Static API`}),(0,E.jsx)(`option`,{value:`query`,children:`Query`}),(0,E.jsx)(`option`,{value:`search`,children:`Search`}),(0,E.jsx)(`option`,{value:`mcp`,children:`MCP`})]})]}),v&&(0,E.jsxs)(`label`,{children:[`MCP outcome`,(0,E.jsxs)(`select`,{"aria-label":`MCP outcome`,className:`form-select form-select-sm`,value:m.mcp_outcome||``,onChange:e=>h(at(m,`mcp_outcome`,e.target.value)),children:[(0,E.jsx)(`option`,{value:``,children:`All outcomes`}),et.map(e=>(0,E.jsx)(`option`,{value:e,children:e.replaceAll(`_`,` `)},e))]})]}),(0,E.jsxs)(`label`,{children:[`Responses`,(0,E.jsxs)(`select`,{"aria-label":`Responses`,className:`form-select form-select-sm`,value:m.successful||``,onChange:e=>h(at(m,`successful`,e.target.value)),children:[(0,E.jsx)(`option`,{value:``,children:`All responses`}),(0,E.jsx)(`option`,{value:`true`,children:`Successful responses`})]})]}),(0,E.jsxs)(`label`,{children:[`Authentication`,(0,E.jsxs)(`select`,{"aria-label":`Authentication`,className:`form-select form-select-sm`,value:m.auth||``,onChange:e=>h({...m,auth:e.target.value}),children:[(0,E.jsx)(`option`,{value:``,children:`All traffic`}),(0,E.jsx)(`option`,{value:`anonymous`,children:`Anonymous`}),(0,E.jsx)(`option`,{value:`valid`,children:`Authenticated`}),(0,E.jsx)(`option`,{value:`rejected`,children:`Rejected credential`})]})]}),(0,E.jsxs)(`div`,{className:`d-flex gap-2 align-items-end`,children:[(0,E.jsx)(`button`,{className:`btn btn-primary btn-sm`,children:`Apply filters`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-outline-secondary btn-sm`,onClick:()=>{h({}),t({})},children:`Clear`})]})]}),o?(0,E.jsx)(k,{rows:y,onSelect:e=>a(`Request details`,e),columns:[{key:`timestamp`,label:`Time`,render:e=>T(e.stamp)},{key:`endpoint`,label:`Endpoint`},{key:`method`,label:`Method`},{key:`path`,label:`Request`,render:e=>(0,E.jsx)(`span`,{className:`truncate`,title:e.path,children:e.path})},{key:`status`,label:`Status`,render:e=>(0,E.jsx)(le,{tone:it(e)?`warning`:`success`,children:e.status})},{key:`duration_ms`,label:`Latency`,render:e=>`${C(e.duration_ms,1)} ms`},...b?[{key:`mcp_method`,label:`MCP operation`,render:e=>e.mcp_method?(0,E.jsxs)(`span`,{className:`consumer-value`,children:[e.mcp_method,e.mcp_tool&&(0,E.jsx)(`small`,{className:`d-block`,children:e.mcp_tool}),e.upstream_operation&&(0,E.jsx)(`small`,{className:`d-block`,children:[e.upstream_service,e.upstream_api_version,e.upstream_operation].filter(Boolean).join(` · `)})]}):`—`},{key:`mcp_outcome`,label:`MCP outcome`,render:e=>e.endpoint_kind===`mcp`?(0,E.jsx)(le,{tone:it(e)?`warning`:e.mcp_outcome===`success`?`success`:`muted`,children:(e.mcp_outcome||`unknown`).replaceAll(`_`,` `)}):`—`},{key:`mcp_client_name`,label:`Declared MCP client`,render:e=>e.mcp_client_name?(0,E.jsxs)(`span`,{className:`consumer-value`,children:[e.mcp_client_name,e.mcp_client_version&&(0,E.jsx)(`small`,{className:`d-block`,children:e.mcp_client_version})]}):`—`}]:[],{key:`remote_addr`,label:`Client IP`},{key:`referrer`,label:`Referrer`,render:n=>n.referrer?(0,E.jsx)(`button`,{className:`table-link truncate`,title:n.referrer,onClick:()=>t({...e,referrer:n.referrer}),children:n.referrer}):`—`},{key:`user_agent`,label:`User agent`,render:n=>n.user_agent?(0,E.jsx)(`button`,{className:`table-link truncate`,title:n.user_agent,onClick:()=>t({...e,user_agent:n.user_agent}),children:n.user_agent}):`—`},{key:`auth`,label:`Auth`}]}):(0,E.jsx)(ce,{}),(0,E.jsxs)(`div`,{className:`table-footer`,children:[(0,E.jsx)(`small`,{children:`Latest captures first · up to 100 requests per page`}),(0,E.jsxs)(`div`,{className:`btn-group`,children:[(0,E.jsx)(`button`,{className:`btn btn-outline-secondary btn-sm`,disabled:!u.length,onClick:()=>{l(u.at(-1)),d(u.slice(0,-1))},children:`Previous`}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary btn-sm`,disabled:!o?.next_cursor,onClick:()=>{d([...u,c]),l(o.next_cursor)},children:`Next`})]})]})]})}function gt({range:e,live:t,onError:n,onDetail:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let r=!1,i,s=new AbortController;async function c(){let l=t&&!o?Math.floor(Date.now()/1e3):o?u.end:e.end;try{let n=await x(`events?${S({start:t?l-900:e.start,end:l,cursor:o,limit:100})}`,{signal:s.signal});r||(a(n),o||d({start:t?l-900:e.start,end:l}))}catch(e){!r&&e.name!==`AbortError`&&n(e)}!r&&t&&!o&&(i=setTimeout(c,2e3))}return c(),()=>{r=!0,clearTimeout(i),s.abort()}},[e.start,e.end,t,o]),(0,E.jsxs)(O,{title:`Operational events`,detail:`Service messages, alerts, synchronization and management audit records`,children:[i?(0,E.jsx)(k,{rows:ut(i,`items`),onSelect:e=>r(`Event details`,e),columns:[{key:`stamp`,label:`Time`,render:e=>T(e.stamp)},{key:`endpoint`,label:`Endpoint`},{key:`event`,label:`Event`,render:e=>e.event||e.payload?.event||e.source},{key:`level`,label:`Level`,render:e=>e.level||e.payload?.level||`info`},{key:`message`,label:`Message`,render:e=>(0,E.jsx)(`span`,{className:`truncate`,children:e.message||e.payload?.message||e.payload?.MESSAGE||``})}]}):(0,E.jsx)(ce,{}),(0,E.jsxs)(`div`,{className:`table-footer`,children:[(0,E.jsx)(`small`,{children:`Latest captures first`}),(0,E.jsxs)(`div`,{className:`btn-group`,children:[(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,disabled:!c.length,onClick:()=>{s(c.at(-1)),l(c.slice(0,-1))},children:`Previous`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,disabled:!i?.next_cursor,onClick:()=>{l([...c,o]),s(i.next_cursor)},children:`Next`})]})]})]})}function _t({report:e,refresh:t,onError:n,onDetail:r,execute:i}){let a=e.data||{},[o,s]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=new AbortController,r=!1;return x(`storage?refresh=${t>0}`,{signal:e.signal}).then(e=>{r||s(e)}).catch(e=>{!r&&e.name!==`AbortError`&&n(e)}),()=>{r=!0,e.abort()}},[t]);let c=a.metrics?.at(-1)||{};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Pe,{refresh:t,execute:i}),(0,E.jsx)(Je,{report:e,label:`Resource metrics`}),(0,E.jsxs)(`div`,{className:`resource-grid`,children:[e.data&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(O,{title:`CPU`,detail:c.scope===`host`?`Host CPU utilization`:`Usage within the container’s effective CPU allowance`,children:[(0,E.jsx)(re,{label:`CPU usage over time`,option:ae((a.metrics||[]).map(e=>({...e,cpu_percent:e.cpu?.used_fraction==null?null:e.cpu.used_fraction*100})),[[`cpu_percent`,`CPU usage %`]])}),(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Current utilization`}),(0,E.jsxs)(`strong`,{children:[C(c.cpu?.used_fraction==null?null:c.cpu.used_fraction*100,1),`%`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Throttled time`}),(0,E.jsxs)(`strong`,{children:[C(c.cpu?.counters?.throttled_usec),` μs`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Temperature`}),(0,E.jsx)(`strong`,{children:c.temperatures?.length?`${C(Math.max(...c.temperatures.map(e=>e.celsius)),1)} °C`:`Sensor unavailable`})]})]})]}),(0,E.jsxs)(O,{title:`Memory`,detail:c.scope===`host`?`Host memory usage, including other services`:`Measured container usage includes more than translation caches`,children:[(0,E.jsx)(re,{label:`Memory usage over time`,option:ae((a.metrics||[]).map(e=>({...e,memory_gib:e.memory?.current_bytes==null?null:e.memory.current_bytes/1073741824})),[[`memory_gib`,`Memory GiB`]])}),(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Current / limit`}),(0,E.jsxs)(`strong`,{children:[w(c.memory?.current_bytes),` / `,w(c.memory?.limit_bytes)]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`OOM events`}),(0,E.jsx)(`strong`,{children:C(c.memory?.events?.oom_kill)})]})]})]})]}),(0,E.jsx)(O,{className:`wide`,title:`Persistent storage`,detail:`Mounted data on the host; application budgets do not impose a filesystem quota`,actions:(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:()=>r(`Storage accounting`,o),children:`Inspect accounting`}),children:o?(0,E.jsx)(k,{rows:ut(o,`components`),onSelect:e=>r(`Storage details`,e),columns:[{key:`name`,label:`Data`,render:e=>e.name||e.category||e.path},{key:`bytes`,label:`Allocated`,render:e=>w(e.bytes??e.allocated_bytes)},{key:`limit_bytes`,label:`Budget`,render:e=>e.limit_bytes?w(e.limit_bytes):`—`},{key:`path`,label:`Location`}]}):(0,E.jsx)(ce,{})}),(0,E.jsx)(O,{className:`wide`,title:`Pressure and collection details`,children:(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsx)(`button`,{className:`btn btn-outline-secondary`,onClick:()=>r(`Latest resource sample`,c),children:`Inspect latest resource sample`}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary`,onClick:()=>r(`Retention`,a.retention),children:`Inspect available history and pruning`})]})})]})]})}function vt({initial:e,onError:t,onComplete:n}){let[r,i]=(0,_.useState)(e),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(!1),f=e.job_id||e.id;(0,_.useEffect)(()=>{let e=!1,r,a=1e3;async function o(){try{let t=await x(`jobs/${encodeURIComponent(f)}`);e||(i(t),u(!1),a=1e3,!Qe(t.status)&&!d.current&&(d.current=!0,n?.()),Qe(t.status)&&(r=setTimeout(o,1e3)))}catch(n){e||(!n.status||n.status>=500?(u(!0),r=setTimeout(o,a),a=Math.min(a*2,1e4)):t(n))}}return o(),()=>{e=!0,clearTimeout(r)}},[f]);async function p(){try{let e=await te(`jobs/${encodeURIComponent(f)}/reveal`);o(e.one_time_output||`The one-time output is no longer available.`)}catch(e){t(e)}}return(0,E.jsxs)(E.Fragment,{children:[l&&(0,E.jsx)(`div`,{className:`alert alert-info`,role:`status`,children:`Reconnecting to operation progress… The accepted job continues on the server.`}),(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Operation`}),(0,E.jsx)(`strong`,{children:r.operation||`Starting…`})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Status`}),(0,E.jsx)(le,{tone:r.status===`failed`?`warning`:`info`,children:r.status})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Started`}),(0,E.jsx)(`strong`,{children:r.started?T(r.started):`Waiting to start`})]})]}),(0,E.jsx)(`pre`,{className:`record-detail`,children:r.output||`Waiting for operation output…`}),r.secret_available&&!a&&(0,E.jsx)(`button`,{className:`btn btn-warning`,onClick:p,children:`Reveal issued credential once`}),a&&(0,E.jsxs)(`div`,{className:`alert alert-warning`,children:[(0,E.jsx)(`p`,{children:`Copy this credential now. It is shown only once and is not saved in the job history.`}),(0,E.jsx)(`pre`,{className:`record-detail`,children:a}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary`,onClick:async()=>{try{await navigator.clipboard.writeText(a),c(!0)}catch(e){t(e)}},children:s?`Copied`:`Copy credential`})]})]})}function yt({onError:e,refresh:t,onRefresh:n}){let[r,i]=(0,_.useState)(null);(0,_.useEffect)(()=>{x(`sessions`).then(i).catch(e)},[t]);async function a(t){try{await te(`sessions/${encodeURIComponent(t)}/revoke`),n()}catch(t){e(t)}}return(0,E.jsx)(O,{title:`Browser sessions`,detail:`Sleep preserves sessions. Revoking one requires that browser to authenticate again.`,children:r?(0,E.jsx)(k,{rows:ut(r,`sessions`),columns:[{key:`ip`,label:`Client IP`},{key:`user_agent`,label:`Browser`,render:e=>(0,E.jsx)(`span`,{className:`truncate`,title:e.user_agent,children:e.user_agent})},{key:`created_at`,label:`Signed in`,render:e=>T(e.created_at)},{key:`expires_at`,label:`Expires`,render:e=>T(e.expires_at)},{key:`action`,label:`Access`,render:e=>(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-danger`,onClick:()=>a(e.id),children:`Revoke session`})}]}):(0,E.jsx)(ce,{})})}function bt(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(`Overview`),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(0),[u,d]=(0,_.useState)(()=>localStorage.getItem(`getbible-theme`)||`system`),[f,p]=(0,_.useState)(`24 hours`),[m,h]=(0,_.useState)({start:``,end:``}),[g,v]=(0,_.useState)({}),[y,b]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,ne]=(0,_.useState)(!1),re=(0,_.useRef)(!1),[ie,ae]=(0,_.useState)(null),[oe,D]=(0,_.useState)(0),[ue,k]=(0,_.useState)(null),[de,fe]=(0,_.useState)(`initializing`),[pe,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(()=>Math.floor(Date.now()/1e3)),_e=(0,_.useRef)(crypto.randomUUID()),A=(0,_.useCallback)(e=>{e.status===401?(ee(``),t({authenticated:!1})):r(e)},[]),ve=(0,_.useMemo)(()=>f===`Custom`&&m.start&&m.end?{start:Math.floor(new Date(m.start).getTime()/1e3),end:Math.floor(new Date(m.end).getTime()/1e3)}:{start:he-(lt[f]||86400),end:he},[f,he,m]);(0,_.useEffect)(()=>{x(`auth/status`).then(t).catch(A)},[]),(0,_.useEffect)(()=>{e?.authenticated||(b(null),C(null),fe(`initializing`),k(null))},[e?.authenticated]),(0,_.useEffect)(()=>{let e=matchMedia(`(prefers-color-scheme: dark)`),t=()=>{document.documentElement.dataset.bsTheme=u===`system`?e.matches?`dark`:`light`:u};return t(),localStorage.setItem(`getbible-theme`,u),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[u]),(0,_.useEffect)(()=>{if(!e?.authenticated)return;let t=!1,n;async function r(){try{let e=await te(`dashboard/heartbeat`,{viewer_id:_e.current});t||fe(e.state===`awake`?`ready`:e.state)}catch(e){t||A(e)}t||(n=setTimeout(r,15e3))}r();let i=()=>{document.visibilityState===`visible`&&(clearTimeout(n),r())};return document.addEventListener(`visibilitychange`,i),()=>{t=!0,clearTimeout(n),document.removeEventListener(`visibilitychange`,i)}},[e?.authenticated]),(0,_.useEffect)(()=>{if(!e?.authenticated||de===`ready`)return;let t=!1,n;async function i(){try{let e=await x(`dashboard/state`);if(t)return;if(e.state===`awake`){fe(`ready`),r(e=>e?.historyUnavailable?null:e);return}e.state===`unavailable`&&fe(`unavailable`),e.error&&r(Object.assign(Error(e.error),{historyUnavailable:e.state===`unavailable`}))}catch(e){t||A(e)}t||(n=setTimeout(i,1e3))}return i(),()=>{t=!0,clearTimeout(n)}},[e?.authenticated,de]);let ye=(0,_.useCallback)(()=>k(new Date),[]),j=qe({page:[`Overview`,`Resources`].includes(i)?i:``,range:ve,live:f===`Live`,filters:i===`Overview`?g:void 0,refresh:oe,enabled:e?.authenticated&&de===`ready`&&(f!==`Custom`||!!(m.start&&m.end)),onError:A,onUpdate:ye}),M=j.overview?.data;function be({start:e,end:t}){if(!(t>e))return;let n=e=>{let t=new Date(e*1e3);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,19)};h({start:n(e),end:n(t)}),p(`Custom`)}function xe(e,t){b({title:e,value:t})}function Se(e,t,n){v({...g,...n||{[e]:t}}),a(`Traffic`)}function Ce(){ge(Math.floor(Date.now()/1e3)),D(e=>e+1)}async function N(){if(!re.current){re.current=!0,ne(!0),ae(null);try{let e=await te(`actions`,{operation:S.operation,arguments:S.arguments,confirm:!0});C(null),xe(`Operation details`,{...e,job_id:e.job_id||e.id}),Ce()}catch(e){ae(e),A(e)}finally{re.current=!1,ne(!1)}}}return e?e.authenticated?(0,E.jsxs)(`div`,{className:`console`,children:[(0,E.jsxs)(`aside`,{className:`sidebar ${pe?`expanded`:``}`,children:[(0,E.jsxs)(`a`,{className:`brand`,href:`#overview`,onClick:e=>{e.preventDefault(),a(`Overview`)},children:[(0,E.jsx)(`img`,{src:`/favicon.png`,alt:``}),(0,E.jsxs)(`span`,{children:[`getBible`,(0,E.jsx)(`small`,{children:`OPERATIONS`})]})]}),(0,E.jsx)(`div`,{className:`workspace-label`,children:`SERVER CONSOLE`}),(0,E.jsx)(`nav`,{"aria-label":`Main navigation`,children:ct.map((e,t)=>(0,E.jsxs)(`button`,{className:i===e?`active`:``,"aria-current":i===e?`page`:void 0,"aria-label":e,onClick:()=>{a(e),e===`MCP traffic`&&v(rt(g)),e===`Manage`&&(s(``),l(e=>e+1)),me(!1)},children:[(0,E.jsx)(`span`,{className:`nav-number`,children:String(t+1).padStart(2,`0`)}),e]},e))}),(0,E.jsxs)(`div`,{className:`sidebar-bottom`,children:[(0,E.jsx)(`span`,{className:`eyebrow`,children:`CONSOLE STATE`}),(0,E.jsx)(`strong`,{children:de===`ready`?`Connected`:de===`unavailable`?`History unavailable`:`Initializing`}),(0,E.jsx)(`small`,{children:`Traffic is recorded continuously.`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:async()=>{try{await te(`auth/logout`),t({authenticated:!1}),ee(``)}catch(e){A(e)}},children:`Sign out`})]})]}),(0,E.jsxs)(`div`,{className:`main-area`,children:[(0,E.jsxs)(`header`,{className:`topbar`,children:[(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary mobile-menu`,onClick:()=>me(!pe),"aria-label":`Toggle navigation`,children:`Menu`}),(0,E.jsxs)(`span`,{className:`breadcrumb-text`,children:[`getBible `,(0,E.jsx)(`span`,{children:`/`}),` `,i]}),(0,E.jsxs)(`div`,{className:`topbar-controls`,children:[(0,E.jsx)(`small`,{className:`last-updated`,children:ue?`Updated ${ue.toLocaleTimeString()}`:`Initializing…`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:Ce,title:`Refresh all dashboard data and locally cached metadata`,children:`Refresh all`}),(0,E.jsx)(`label`,{className:`visually-hidden`,htmlFor:`theme`,children:`Color theme`}),(0,E.jsxs)(`select`,{id:`theme`,className:`form-select form-select-sm theme-select`,value:u,onChange:e=>d(e.target.value),children:[(0,E.jsx)(`option`,{value:`system`,children:`System theme`}),(0,E.jsx)(`option`,{value:`dark`,children:`Dark`}),(0,E.jsx)(`option`,{value:`light`,children:`Light`})]})]})]}),(0,E.jsxs)(`main`,{className:`content`,children:[(0,E.jsxs)(`div`,{className:`page-heading`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{className:`eyebrow`,children:i===`Overview`?`YOUR API AT A GLANCE`:`GETBIBLE OPERATIONS`}),(0,E.jsx)(`h1`,{children:i===`Overview`?`Traffic & performance`:i})]}),(0,E.jsxs)(`div`,{className:`range-picker`,children:[(0,E.jsx)(`label`,{className:`visually-hidden`,htmlFor:`period`,children:`Time range`}),(0,E.jsx)(`select`,{className:`form-select`,id:`period`,value:f,onChange:e=>{p(e.target.value),ge(Math.floor(Date.now()/1e3))},children:[...Object.keys(lt),`Custom`].map(e=>(0,E.jsx)(`option`,{children:e},e))}),f===`Live`&&(0,E.jsx)(le,{tone:`success`,children:`LIVE`})]})]}),f===`Custom`&&(0,E.jsxs)(`div`,{className:`custom-range`,children:[(0,E.jsxs)(`label`,{children:[`From`,(0,E.jsx)(`input`,{className:`form-control`,type:`datetime-local`,step:`1`,value:m.start,onChange:e=>h({...m,start:e.target.value})})]}),(0,E.jsxs)(`label`,{children:[`Until`,(0,E.jsx)(`input`,{className:`form-control`,type:`datetime-local`,step:`1`,value:m.end,onChange:e=>h({...m,end:e.target.value})})]}),(0,E.jsx)(`small`,{children:`Times use your browser's local time zone.`})]}),(0,E.jsx)(se,{error:n,dismiss:()=>r(null)}),M?.retention?.first_request>ve.start&&(0,E.jsxs)(`div`,{className:`alert alert-info py-2`,children:[`Available request history starts `,T(M.retention.first_request),`. Earlier time in this selection has no retained detail.`]}),Object.entries(g).filter(([,e])=>e).length>0&&(0,E.jsxs)(`div`,{className:`filter-chips`,children:[Object.entries(g).filter(([,e])=>e).map(([e,t])=>(0,E.jsxs)(`button`,{className:`btn btn-sm btn-outline-info`,onClick:()=>{let t={...g};delete t[e],v(t)},children:[e,`: `,String(t),` `,(0,E.jsx)(`span`,{"aria-label":`Remove filter`,children:`×`})]},e)),(0,E.jsx)(`button`,{className:`btn btn-sm btn-link`,onClick:()=>v({}),children:`Clear all`})]}),de!==`ready`&&![`Manage`,`Translations`,`Resources`,`Sessions`].includes(i)?de===`unavailable`?(0,E.jsx)(O,{title:`Traffic history needs attention`,detail:`Server management remains available while traffic history is unavailable.`,children:(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsx)(`p`,{children:`Review the reported history error. To start fresh after an incompatible history format, open Logs, then History, and review the reset operation.`}),(0,E.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>{s(`logs`),a(`Manage`)},children:`Manage traffic history`})]})}):(0,E.jsx)(ce,{children:`Initializing dashboard…`}):i===`Overview`?(0,E.jsx)(mt,{overview:j.overview,timeline:j.history,onFilter:Se,onDetail:xe,onZoom:be}):i===`Traffic`?(0,E.jsx)(ht,{live:f===`Live`,filters:g,setFilters:v,range:ve,onError:A,onDetail:xe},JSON.stringify([ve,g,f,oe])):i===`MCP traffic`?(0,E.jsx)(st,{range:ve,live:f===`Live`,filters:g,refresh:oe,onFilter:Se,onError:A,onZoom:be}):i===`Audience`?(0,E.jsx)(Xe,{range:ve,live:f===`Live`,filters:g,refresh:oe,onFilter:Se,onError:A}):i===`Translations`?(0,E.jsx)(Ue,{onError:A,execute:(e,t,n)=>(ae(null),C({operation:e,arguments:t,review:n})),onDetail:xe,refresh:oe}):i===`Resources`?(0,E.jsx)(_t,{report:j.metrics,refresh:oe,onError:A,onDetail:xe,execute:(e,t,n)=>(ae(null),C({operation:e,arguments:t,review:n}))}):i===`Events`?(0,E.jsx)(gt,{range:ve,live:f===`Live`,onError:A,onDetail:xe},JSON.stringify([ve,f,oe])):i===`Manage`?(0,E.jsx)(je,{initialSection:o,execute:(e,t,n)=>(ae(null),C({operation:e,arguments:t,review:n})),onError:A,onDetail:xe,refresh:oe},`${o||`manage`}:${c}`):(0,E.jsx)(yt,{onError:A,refresh:oe,onRefresh:Ce}),(0,E.jsx)(`footer`,{children:`Origin observations · CDN cache hits served before this server are outside this view.`})]})]}),y&&(0,E.jsx)(dt,{title:y.title,value:y.value,onClose:()=>b(null),children:y.title===`Operation details`?(0,E.jsx)(vt,{initial:y.value,onError:A,onComplete:Ce}):void 0}),S&&(0,E.jsxs)(dt,{title:`Review operation`,onClose:()=>C(null),children:[(0,E.jsx)(se,{error:ie}),(0,E.jsx)(`p`,{children:S.review?.title||`The following operation will run on this server.`}),S.review?.description&&(0,E.jsx)(`p`,{className:`text-secondary`,children:S.review.description}),(0,E.jsx)(`pre`,{className:`record-detail`,children:JSON.stringify({operation:S.operation,arguments:Object.fromEntries(Object.entries(S.arguments).map(([e,t])=>[e,/password|token|secret|credential/i.test(e)?`[hidden]`:e===`content`?`[content supplied]`:t]))},null,2)}),(0,E.jsxs)(`div`,{className:`d-flex gap-2`,children:[(0,E.jsx)(`button`,{className:`btn btn-primary`,disabled:w,onClick:N,children:w?`Submitting…`:`Run operation`}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary`,"data-bs-dismiss":`modal`,children:`Cancel`})]})]})]}):(0,E.jsx)(ft,{onLogin:t}):(0,E.jsxs)(`main`,{className:`login-page`,children:[(0,E.jsx)(ce,{children:`Connecting to your server…`}),(0,E.jsx)(se,{error:n})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(bt,{})); \ No newline at end of file diff --git a/src/apps/dashboard/static/assets/index-DcRylcQ5.js b/src/apps/dashboard/static/assets/index-DcRylcQ5.js new file mode 100644 index 0000000..eb35458 --- /dev/null +++ b/src/apps/dashboard/static/assets/index-DcRylcQ5.js @@ -0,0 +1,10 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function ee(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var x=ee.prototype=new b;x.constructor=ee,_(x,y.prototype),x.isPureReactComponent=!0;var te=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return T(e.type,t,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,te(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(te(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ne());else{var t=n(l);t!==null&&ie(ee,t.startTime-e)}}}var x=!1,te=-1,S=5,C=-1;function w(){return g?!0:!(e.unstable_now()-Ct&&w());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ne():x=!1}}}var ne;if(typeof y==`function`)ne=function(){y(T)};else if(typeof MessageChannel<`u`){var E=new MessageChannel,re=E.port2;E.port1.onmessage=T,ne=function(){re.postMessage(null)}}else ne=function(){_(T,0)};function ie(t,n){te=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(te),te=-1):h=!0,ie(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ne()))),r},e.unstable_shouldYield=w,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1Se||(e.current=xe[Se],xe[Se]=null,Se--)}function P(e,t){Se++,xe[Se]=e.current,e.current=t}var we=Ce(null),Te=Ce(null),Ee=Ce(null),De=Ce(null);function Oe(e,t){switch(P(Ee,t),P(Te,e),P(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}N(we),P(we,e)}function ke(){N(we),N(Te),N(Ee)}function Ae(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,P(De,e)),t=we.current;var n=dp(t,e.type);t!==n&&(P(Te,e),P(we,n))}function je(e){Te.current===e&&(N(we),N(Te)),De.current===e&&(N(De),sh._currentValue=be)}var Me,Ne;function Pe(e){if(Me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||``,Ne=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Pe(n):``}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe(`Lazy`);case 13:return e.child!==t&&t!==null?Pe(`Suspense Fallback`):Pe(`Suspense`);case 19:return Pe(`SuspenseList`);case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return Pe(`Activity`);case 30:return Pe(`ViewTransition`);default:return``}}function Re(e){try{var t=``,n=null;do t+=Le(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var ze=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,He=t.unstable_shouldYield,Ue=t.unstable_requestPaint,We=t.unstable_now,Ge=t.unstable_getCurrentPriorityLevel,Ke=t.unstable_ImmediatePriority,qe=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,Ye=t.unstable_LowPriority,Xe=t.unstable_IdlePriority,Ze=t.log,Qe=t.unstable_setDisableYieldValue,$e=null,et=null;function tt(e){if(typeof Ze==`function`&&Qe(e),et&&typeof et.setStrictMode==`function`)try{et.setStrictMode($e,e)}catch{}}var nt=Math.clz32?Math.clz32:at,rt=Math.log,it=Math.LN2;function at(e){return e>>>=0,e===0?32:31-(rt(e)/it|0)|0}var ot=256,st=262144,ct=4194304;function lt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ut(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=lt(n))):i=lt(o):i=lt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=lt(n))):i=lt(o)):i=lt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function dt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function gt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _t(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0=gr),yr=` `,br=!1;function xr(e,t){switch(e){case`keyup`:return mr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Cr=!1;function wr(e,t){switch(e){case`compositionend`:return Sr(t);case`keypress`:return t.which===32?(br=!0,yr):null;case`textInput`:return e=t.data,e===yr&&br?null:e;default:return null}}function Tr(e,t){if(Cr)return e===`compositionend`||!hr&&xr(e,t)?(e=Ln(),In=Fn=Pn=null,Cr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Jr(n)}}function Xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=qr(e.document)}return t}function Qr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var $r=jn&&`documentMode`in document&&11>=document.documentMode,ei=null,ti=null,ni=null,ri=!1;function ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ri||ei==null||ei!==qr(r)||(r=ei,`selectionStart`in r&&Qr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ni&&Kr(ni,r)||(ni=r,r=Jf(ti,`onSelect`),0>=o,i-=o,ea=1<<32-nt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),L&&na(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),L&&na(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return L&&na(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),L&&na(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ie&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ie){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),fo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===k&&io(l)===r.type){n(e,r.sibling),c=a(r,o.props),fo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ie?(c=Vi(o.props.children,e.mode,c,o.key),fo(c,o),c.return=e,e=c):(c=Bi(o.type,o.key,o.props,null,e.mode,c),fo(c,o),c.return=e,e=c)}return s(e);case re:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Wi(o,e.mode,c),c.return=e,e=c}return s(e);case k:return o=io(o),_(e,r,o,c)}if(ye(o))return h(e,r,o,c);if(_e(o)){if(l=_e(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,uo(o),c);if(o.$$typeof===D)return _(e,r,ka(e,o),c);po(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{lo=0;var i=_(e,t,n,r);return co=null,i}catch(t){if(t===Qa||t===eo)throw t;var a=Ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ho=mo(!0),go=mo(!1),_o=!1;function vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function bo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ni(e),Mi(e,null,n),t}return ki(e,r,t,n),Ni(e)}function So(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}function Co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var wo=!1;function To(){if(wo){var e=Ua;if(e!==null)throw e}}function Eo(e,t,n,r){wo=!1;var i=e.updateQueue;_o=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===Ha&&(wo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:_o=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),sd|=o,e.lanes=o,e.memoizedState=d}}function Do(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Oo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=j.T,s={};s.types=o===null?null:o.types,j.T=s,pc(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?fc(e,t,Ka(c,r),jd(e)):fc(e,t,r,jd(e))}catch(n){fc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function nc(){}function rc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ic(e).queue;tc(e,a,t,be,n===null?nc:function(){return ac(e),n(r)})}function ic(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:be},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ac(e){var t=ic(e);t.next===null&&(t=e.alternate.memoizedState),fc(e,t.next.queue,{},jd())}function oc(){return Oa(sh)}function sc(){return ls().memoizedState}function cc(){return ls().memoizedState}function lc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=bo(n);var r=xo(t,e,n);r!==null&&(Pd(r,t,n),So(r,t,n)),t={cache:Fa()},e.payload=t;return}t=t.return}}function uc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mc(e)?hc(t,n):(n=Ai(e,t,n,r),n!==null&&(Pd(n,e,r),gc(n,t,r)))}function dc(e,t,n){fc(e,t,n,jd())}function fc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mc(e))hc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Gr(s,o))return ki(e,t,i,0),G===null&&Oi(),!1}catch{}if(n=Ai(e,t,i,r),n!==null)return Pd(n,e,r),gc(n,t,r),!0}return!1}function pc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mc(e)){if(t)throw Error(i(479))}else t=Ai(e,n,r,2),t!==null&&Pd(t,e,2)}function mc(e){var t=e.alternate;return e===R||t!==null&&t===R}function hc(e,t){Jo=qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}var _c={readContext:Oa,use:fs,useCallback:B,useContext:B,useEffect:B,useImperativeHandle:B,useLayoutEffect:B,useInsertionEffect:B,useMemo:B,useReducer:B,useRef:B,useState:B,useDebugValue:B,useDeferredValue:B,useTransition:B,useSyncExternalStore:B,useId:B,useHostTransitionStatus:B,useFormState:B,useActionState:B,useOptimistic:B,useMemoCache:B,useCacheRefresh:B,useEffectEvent:B},vc={readContext:Oa,use:fs,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Oa,useEffect:Hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Bs(4194308,4,Js.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Yo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Yo){tt(!0);try{n(t)}finally{tt(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=uc.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=ws(e);var t=e.queue,n=dc.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xs,useDeferredValue:function(e,t){return $s(cs(),e,t)},useTransition:function(){var e=ws(!1);return e=tc.bind(null,R,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,a=cs();if(L){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),G===null)throw Error(i(349));q&127||ys(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Hs(xs.bind(null,r,o,e),[e]),r.flags|=2048,Rs(9,{destroy:void 0},bs.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=G.identifierPrefix;if(L){var n=ta,r=ea;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Xo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Et]=t,o[Dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&gl(t)}}return V(t),t.subtreeFlags&=-33554433,_l(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&gl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ee.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=sa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||da(t,!0)}else e=lp(e).createTextNode(r),e[Et]=t,t.stateNode=e}return V(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ma(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Et]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),e=!1}else n=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Bo(t),t):(Bo(t),null);if(t.flags&128)throw Error(i(558))}return V(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Et]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;V(t),a=!1}else a=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Bo(t),t):(Bo(t),null)}return Bo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),yl(t,t.updateQueue),V(t),null);case 4:return ke(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,V(t),null;case 10:return Sa(t.type),V(t),null;case 19:if(Uo(t),r=t.memoizedState,r===null)return V(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)bl(r,!1);else{if(Y!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wo(e),o!==null){for(t.flags|=128,bl(r,!1),e=o.updateQueue,t.updateQueue=e,yl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zi(n,e),n=n.sibling;return Ho(t,Vo.current&1|2),L&&na(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&We()>_d&&(t.flags|=128,a=!0,bl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Wo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,yl(t,e),bl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!L)return V(t),null}else 2*We()-r.renderingStartTime>_d&&n!==536870912&&(t.flags|=128,a=!0,bl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,o=Vo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||L?Ho(t,o):(n=o,P(Po,t),P(Vo,n),Fo===null&&(Fo=t)),L&&na(t,r.treeForkCount),e}return V(t),null;case 22:case 23:return Bo(t),No(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(V(t),t.subtreeFlags&6&&(t.flags|=8192)):V(t),n=t.updateQueue,n!==null&&yl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&N(Ja),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sa(Pa),V(t),null;case 25:return null;case 30:return t.flags|=33554432,V(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(aa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(Pa),ke(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 31:if(t.memoizedState!==null){if(Bo(t),t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Uo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ke(),null;case 10:return Sa(t.type),null;case 22:case 23:return Bo(t),No(),e!==null&&N(Ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(Pa),null;case 25:return null;default:return null}}function Cl(e,t){switch(aa(t),t.tag){case 3:Sa(Pa),ke();break;case 26:case 27:case 5:je(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Bo(t);break;case 13:Bo(t);break;case 19:Uo(t);break;case 10:Sa(t.type);break;case 22:case 23:Bo(t),No(),e!==null&&N(Ja);break;case 24:Sa(Pa)}}function wl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Tl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Oo(t,n)}catch(t){Z(e,e.return,t)}}}function Dl(e,t,n){n.props=Tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Ol(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=xi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Al(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),np(r,t,n),r[Et]=e,Bt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=Yr(s,h),v=Yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,j.T=null,n=wd,wd=null;var o=bd,s=Sd;if(X=0,xd=bd=null,Sd=0,W&6)throw Error(i(331));var c=W;if(W|=4,Zu(o.current),Uu(o,o.current,s,n),W=c,Df(0,!1),et&&typeof et.onPostCommitFiberRoot==`function`)try{et.onPostCommitFiberRoot($e,o)}catch{}return!0}finally{M.p=a,j.T=r,uf(e,t)}}function pf(e,t,n){t=Ki(n,t),t=jc(e.stateNode,t,2),e=xo(e,t,2),e!==null&&(gt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yd===null||!yd.has(r))){e=Ki(n,e),n=Mc(2),r=xo(t,n,2),r!==null&&(Nc(n,r,t,e),gt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ad=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,G===e&&(q&n)===n&&(Y===4||Y===3&&(q&62914560)===q&&300>We()-hd?W&2?ld|=n:Vd(e,0):ld|=n,dd===q&&(dd=0)),Ef(e)}function gf(e,t){t===0&&(t=mt()),e=ji(e,t),e!==null&&(gt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Be(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-nt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=q,a=ut(r,r===G?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||dt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=We(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}X!==0&&X!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Bt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Pt]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Bt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=zt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Bt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=zt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Bt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=zt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Bt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=Ee.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=zt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=zt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=zt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+sn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Pt]){r.loading=1;return}}else t=e.createElement(`link`),t[Pt]=!0,t.onload=t.onerror=Vt.bind(null,t),np(t,`link`,n),Bt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+sn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,Bt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Bt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Bt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Bt(a),a):(r=n,(a=vm.get(o))&&(r=T({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Bt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Bt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g(),y=``,b=class extends Error{constructor(e,t){super(t.detail||t.message||t.title||`Request failed (${e})`),this.status=e,this.problem=t}};function ee(e){y=e||``}async function x(e,{method:t=`GET`,body:n,signal:r}={}){let i=await fetch(`/api/${e}`,{method:t,credentials:`same-origin`,cache:`no-store`,signal:r,headers:{Accept:`application/json`,...n===void 0?{}:{"Content-Type":`application/json`},...t===`GET`?{}:{"X-CSRF-Token":y}},body:n===void 0?void 0:JSON.stringify(n)}),a=await i.json().catch(()=>({detail:`The server returned an unreadable response.`}));if(!i.ok)throw new b(i.status,a);return a.csrf_token&&ee(a.csrf_token),a}var te=(e,t={})=>x(e,{method:`POST`,body:t});function S(e){return new URLSearchParams(Object.entries(e).filter(([,e])=>e!==``&&e!=null)).toString()}var C=(e,t=0)=>e==null?`—`:Number(e).toLocaleString(void 0,{maximumFractionDigits:t});function w(e){if(e==null)return`—`;if(e===0)return`0 B`;let t=Math.min(Math.floor(Math.log(Math.max(1,e))/Math.log(1024)),4);return`${C(e/1024**t,+!!t)} ${[`B`,`KiB`,`MiB`,`GiB`,`TiB`][t]}`}var T=e=>e?new Date(typeof e==`number`?e*1e3:e).toLocaleString():`—`,ne=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),E=o(((e,t)=>{t.exports=ne()}))();function re({option:e,height:t=260,label:n,onZoom:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(null),o=(0,_.useRef)(r),s=(0,_.useRef)(e);return o.current=r,s.current=e,(0,_.useEffect)(()=>{let t,n,r;function c(){window.echarts?(a.current=window.echarts.init(i.current,null,{renderer:`canvas`}),a.current.on(`datazoom`,e=>{if(!o.current)return;let t=e.batch?.[0]||e,r=s.current.series?.[0]?.data?.map(e=>e[0])||[];if(r.length<2)return;let i=Math.min(...r),a=Math.max(...r),c=Number(t.startValue??i+(a-i)*(t.start??0)/100),l=Number(t.endValue??i+(a-i)*(t.end??100)/100);clearTimeout(n),n=setTimeout(()=>o.current?.({start:Math.floor(c/1e3),end:Math.ceil(l/1e3)}),400)}),r=new ResizeObserver(()=>a.current?.resize()),r.observe(i.current),a.current.setOption(e)):t=setTimeout(c,50)}return c(),()=>{clearTimeout(t),clearTimeout(n),r?.disconnect(),a.current?.dispose(),a.current=null}},[]),(0,_.useEffect)(()=>{a.current?.setOption(e,{notMerge:!0,lazyUpdate:!0})},[e]),(0,E.jsx)(`div`,{ref:i,className:`chart`,role:`img`,"aria-label":n,style:{height:t}})}var ie={animationDuration:250,color:[`#38bdf8`,`#34d399`,`#fbbf24`,`#fb7185`,`#a78bfa`],textStyle:{fontFamily:`system-ui, sans-serif`,color:`#8396ad`}};function ae(e,t,{zoom:n=!1}={}){return{...ie,tooltip:{trigger:`axis`,confine:!0},legend:{bottom:0,textStyle:{color:`#8396ad`},icon:`circle`,itemWidth:8},grid:{left:54,right:18,top:24,bottom:n?86:52},xAxis:{type:`time`,axisLine:{show:!1},splitLine:{show:!1}},yAxis:{type:`value`,splitLine:{lineStyle:{color:`#8396ad22`}},axisLabel:{formatter:`{value}`}},...n?{dataZoom:[{type:`inside`},{type:`slider`,bottom:28,height:18}]}:{},series:t.map(([t,n],r)=>({name:n,type:`line`,showSymbol:!1,smooth:.15,lineStyle:{width:2},areaStyle:r===0?{opacity:.09}:void 0,data:e.map(e=>[Number(e.stamp??e.timestamp??e.bucket??e.time)*1e3,e[t]??null])}))}}function oe(e){return{...ie,tooltip:{trigger:`item`,confine:!0},legend:{bottom:0,textStyle:{color:`#8396ad`},icon:`circle`,itemWidth:8},series:[{type:`pie`,radius:[`55%`,`76%`],center:[`50%`,`44%`],label:{show:!1},emphasis:{label:{show:!0,fontSize:16,fontWeight:`bold`,formatter:`{b} +{d}%`}},data:e.map(e=>({name:e.name??e.key??e.value??`Unknown`,value:e.calls??e.count??e.requests??0}))}]}}function se({error:e,dismiss:t}){return e?(0,E.jsxs)(`div`,{className:`alert alert-danger d-flex align-items-start gap-3`,role:`alert`,children:[(0,E.jsx)(`span`,{className:`flex-grow-1`,children:e.message||String(e)}),t&&(0,E.jsx)(`button`,{className:`btn-close`,"aria-label":`Dismiss error`,onClick:t})]}):null}function D({children:e=`No records in this time range.`}){return(0,E.jsx)(`div`,{className:`empty-state`,children:e})}function ce({children:e=`Loading…`}){return(0,E.jsxs)(`div`,{className:`empty-state`,children:[(0,E.jsx)(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),e]})}function O({title:e,detail:t,children:n,className:r=``,actions:i}){return(0,E.jsxs)(`section`,{className:`panel ${r}`,children:[(0,E.jsxs)(`div`,{className:`panel-title`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`h2`,{children:e}),t&&(0,E.jsx)(`small`,{children:t})]}),i]}),n]})}function le({children:e,tone:t=`muted`}){return(0,E.jsx)(`span`,{className:`status-badge ${t}`,children:e})}function ue({value:e,max:t,label:n}){return(0,E.jsx)(`div`,{className:`progress`,role:`progressbar`,"aria-label":n,"aria-valuenow":e||0,"aria-valuemin":`0`,"aria-valuemax":t||100,children:(0,E.jsx)(`div`,{className:`progress-bar`,style:{width:`${Math.min(100,(e||0)*100/(t||100))}%`}})})}function k({columns:e,rows:t,onSelect:n,rowKey:r}){return t.length?(0,E.jsx)(`div`,{className:`table-responsive`,children:(0,E.jsxs)(`table`,{className:`table align-middle table-hover mb-0`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsx)(`tr`,{children:e.map(e=>(0,E.jsx)(`th`,{scope:`col`,children:e.label},e.key))})}),(0,E.jsx)(`tbody`,{children:t.map((t,i)=>(0,E.jsx)(`tr`,{children:e.map((e,r)=>(0,E.jsx)(`td`,{children:r===0&&n?(0,E.jsx)(`button`,{className:`table-link`,onClick:()=>n(t),children:e.render?e.render(t):t[e.key]}):e.render?e.render(t):t[e.key]??`—`},e.key))},r?.(t)??i))})]})}):(0,E.jsx)(D,{})}function de(e,t=!1){return![`blocked`,`updating`].includes(e.status)&&(e.eligible||t)}function fe(e,t,{force:n=!1,retry:r=!1}={}){let i=new Set(t);return(e?.targets||[]).filter(e=>i.has(e.id)&&de(e,n)&&(!r||[`failed`,`interrupted`].includes(e.outcome))).map(e=>e.id)}function pe(e){return(e?.targets||[]).filter(e=>de(e)).map(e=>e.id)}function me(e,t,n={}){if(!e||!/^[a-f0-9]{64}$/.test(e.plan_id))throw Error(`Refresh the upgrade plan before applying.`);return{targets:fe(e,t,n),plan_id:e.plan_id,force:n.force===!0,retry:n.retry===!0}}function he(e,t=!1){let n=e?.recommendation?.value;return t||e?.recommendation?.status!==`suggested`||!Number.isFinite(n)||n<0||!e?.configuration?.editable||e.configuration.owner!==`saved`||![`TELEMETRY_SPOOL_MAX_GIB`,`TELEMETRY_MAX_GIB`].includes(e.setting)?null:{key:e.setting,value:String(n)}}function ge({execute:e,refresh:t,paused:n=!1}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(0),[l,u]=(0,_.useState)(!0),[d,f]=(0,_.useState)([]),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=!1,t=new AbortController;return u(!0),o(null),x(`upgrades`,{signal:t.signal}).then(t=>{e||(i(t),f(pe(t)),m(!1),g(!1))}).catch(t=>{!e&&t.name!==`AbortError`&&o(t)}).finally(()=>{e||u(!1)}),()=>{e=!0,t.abort()}},[t,s]);let v=fe(r,d,{force:p,retry:h}),y=r&&!l&&!a&&!n,b=e=>f(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);return(0,E.jsxs)(`div`,{className:`upgrade-plan`,children:[(0,E.jsx)(`p`,{children:`Only selected targets will be upgraded. Static targets update their software and configuration—not Bible files. Skipped changes remain pending.`}),(0,E.jsx)(se,{error:a}),(0,E.jsxs)(`div`,{className:`d-flex gap-2 flex-wrap mb-3`,children:[(0,E.jsx)(`button`,{type:`button`,className:`btn btn-outline-secondary`,disabled:l,onClick:()=>c(e=>e+1),children:`Refresh upgrade plan`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-outline-secondary`,disabled:!y,onClick:()=>{f(pe(r)),g(!1)},children:`Select changed targets`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-outline-secondary`,disabled:!y,onClick:()=>f([]),children:`Clear selection`}),(0,E.jsxs)(`label`,{className:`form-check`,children:[(0,E.jsx)(`input`,{type:`checkbox`,className:`form-check-input`,checked:p,disabled:!y,onChange:e=>m(e.target.checked)}),`Allow forced redeployment of unchanged targets`]}),(0,E.jsxs)(`label`,{className:`form-check`,children:[(0,E.jsx)(`input`,{type:`checkbox`,className:`form-check-input`,checked:h,disabled:!y,onChange:e=>{g(e.target.checked),e.target.checked&&f((r?.targets||[]).filter(e=>[`failed`,`interrupted`].includes(e.outcome)).map(e=>e.id))}}),`Retry failed or interrupted targets only`]})]}),l?(0,E.jsx)(ce,{children:`Inspecting installed releases and target readiness…`}):r?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`alert alert-info`,role:`status`,children:[`Release `,r.version,`: `,r.pending,` target(s) pending. `,v.length,` selected. Serving health is separate from upgrade completion.`]}),(0,E.jsx)(k,{rowKey:e=>e.id,rows:r.targets||[],columns:[{key:`selected`,label:`Upgrade`,render:e=>(0,E.jsx)(`input`,{type:`checkbox`,"aria-label":`Upgrade ${e.id}`,checked:v.includes(e.id),disabled:!y||!de(e,p)||h&&![`failed`,`interrupted`].includes(e.outcome),onChange:()=>b(e.id)})},{key:`id`,label:`Target`,render:e=>(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`strong`,{children:e.id}),(0,E.jsx)(`small`,{className:`d-block`,children:e.reason}),e.last_error&&(0,E.jsx)(`small`,{className:`d-block text-warning`,children:e.last_error})]})},{key:`status`,label:`Upgrade state`,render:e=>(0,E.jsx)(le,{tone:e.status===`current`?`success`:e.status===`blocked`?`warning`:`info`,children:e.status})},{key:`serving`,label:`Serving`,render:e=>(0,E.jsx)(le,{tone:e.serving===`ready`?`success`:`warning`,children:e.serving})},{key:`outcome`,label:`Last result`,render:e=>(0,E.jsxs)(E.Fragment,{children:[e.outcome,(0,E.jsx)(`small`,{className:`d-block`,children:T(e.last_attempt)})]})},{key:`fingerprints`,label:`Implementation`,render:e=>(0,E.jsxs)(`details`,{children:[(0,E.jsx)(`summary`,{children:`Fingerprints`}),(0,E.jsxs)(`small`,{className:`d-block text-break`,children:[`Desired: `,e.desired_fingerprint||`Unavailable`]}),(0,E.jsxs)(`small`,{className:`d-block text-break`,children:[`Applied: `,e.applied_fingerprint||`Not recorded`]})]})}]}),(0,E.jsx)(`p`,{className:`text-secondary mt-3`,children:r.note})]}):(0,E.jsx)(D,{children:`The upgrade plan is unavailable. Refresh to retry.`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:!y||!v.length,onClick:()=>{try{e(`system.update`,me(r,d,{force:p,retry:h}),{title:`Upgrade ${v.length} selected target(s)`,description:`The manager rechecks this plan before changing anything. Unselected generations remain running; capacity checks may reject an unsafe overlap. Whole-container replacement is a separate restart.`})}catch(e){o(e)}},children:`Review selected upgrades`}),!v.length&&!l&&(0,E.jsx)(`small`,{className:`d-block mt-2`,children:`Nothing selected. No upgrade will run.`})]})}var _e=[{id:`domains`,title:`Domains`,detail:`Status, endpoints, pages, access and runtime settings`},{id:`deploy`,title:`Deploy a new domain`,detail:`Prepare a static, runtime or MCP domain`},{id:`go-live`,title:`Go live`,detail:`Activate a staged domain`},{id:`self-update`,title:`Update manager`,detail:`Update the native manager checkout`},{id:`update`,title:`Upgrade targets`,detail:`Review changes, select targets and retry incomplete upgrades`},{id:`analytics`,title:`Traffic analytics`,detail:`Run a traffic report`},{id:`dashboard`,title:`Private dashboard`,detail:`Domain, password, sessions and blocked addresses`},{id:`logs`,title:`Logs`,detail:`Domain diagnostics, archives and rotation`},{id:`settings`,title:`Settings`,detail:`Environment, notifications, Cloudflare token and icons`},{id:`system`,title:`System`,detail:`Host checks, dependencies and resource allocation`}],A=e=>e.id||e.operation||e.name;function ve(e){let t=e?.fields||e?.parameters||[];return Array.isArray(t)?t:Object.entries(t).map(([e,t])=>({name:e,...t}))}function ye(e){let t=A(e);if(t.startsWith(`domain.deploy_`))return[[`deploy`,`New domain`]];if(t===`domain.go_live`)return[[`go-live`,`Activation`],[`domains`,`Publication`]];if(t===`system.self_update`)return[[`self-update`,`Manager checkout`]];if(t===`system.update`)return[[`update`,`Review eligible targets`]];if(t===`analytics`)return[[`analytics`,`Traffic report`]];if(t.startsWith(`dashboard.`))return[[`dashboard`,[`dashboard.sessions`,`dashboard.revoke`].includes(t)?`Sessions`:t===`dashboard.blocks`?`Blocked addresses`:`Dashboard settings`]];if(t.startsWith(`logs.`))return t===`logs.rotate`?[[`logs`,`Rotation`]]:t===`logs.reset`?[[`logs`,`History`]]:[[`logs`,`Domain logs`],[`domains`,`Logs`]];if(t.startsWith(`settings.`))return[[`settings`,`Environment and defaults`]];if(t.startsWith(`telegram.`))return[[`settings`,`Telegram notifications`]];if(t===`cloudflare.token`)return[[`settings`,`Cloudflare API token`]];if([`system.icons`,`system.favicon`,`system.logo`].includes(t))return[[`settings`,`Icons`]];if(t===`pages.upload_icon`)return[[`settings`,`Icons`],[`domains`,`Pages and OpenAPI`]];if([`cloudflare.verify`,`cloudflare.refresh_ips`].includes(t))return[[`system`,`Cloudflare origin tools`]];if(t.startsWith(`resources.`))return[[`system`,`Resource allocation`]];if(t===`runtime.versions`)return[[`system`,`Python versions`]];if(ve(e).some(e=>e.name===`domain`)){let e=`Other domain operations`;return[`domain.status`,`domain.verify`].includes(t)?e=`Status and health`:t===`domain.stage`?e=`Publication`:[`domain.apply`,`domain.update`].includes(t)?e=`Apply configuration`:t===`domain.remove`?e=`Remove domain`:t.startsWith(`endpoint.`)?e=`Endpoints and repositories`:t===`access.mode`?e=`Access mode`:t===`access.limits`?e=`Anonymous caller limits`:t.startsWith(`token.`)?e=`Bearer tokens`:t.startsWith(`certificate.`)?e=`Certificate`:t.startsWith(`cloudflare.`)?e=`Cloudflare`:t.startsWith(`pages.`)?e=`Pages and OpenAPI`:t.startsWith(`mcp.`)?e=`MCP service`:t===`runtime.set`?e=`Runtime settings`:t===`runtime.cache`?e=`Translation memory`:t.startsWith(`runtime.`)&&(e=`Runtime services`),[[`domains`,e]]}return[[`system`,t.startsWith(`system.`)?`Host maintenance`:e.category||`Other operations`]]}function j(e){let t=new Map((e?.domains||[]).map(e=>[e.domain,{...e,endpoints:[]}]));for(let n of e?.endpoints||[])t.has(n.domain)||t.set(n.domain,{...n,endpoints:[]}),t.get(n.domain).endpoints.push(n);return[...t.values()].sort((e,t)=>e.domain.localeCompare(t.domain))}function M(e,t){if(!t)return!0;let n=A(e),r=t.type===`runtime`,i=t.type===`static`;return Array.isArray(e.domain_types)&&!e.domain_types.includes(t.type)?!1:n.startsWith(`mcp.`)?t.type===`mcp`:n.startsWith(`runtime.`)||[`endpoint.add_runtime`,`endpoint.default`].includes(n)?r:[`endpoint.add_static`,`endpoint.change_source`,`endpoint.sync`,`endpoint.deploy_key`,`endpoint.repo_access`,`endpoint.filetypes`].includes(n)?i:[`endpoint.remove`,`pages.docs`,`pages.openapi`,`pages.write`].includes(n)?i||r:n===`domain.go_live`?!t.live:n!==`domain.stage`||t.live}function be(e,t,n){let r=new Map;for(let i of e){if(!M(i,n))continue;let e=ye(i).find(([e])=>e===t);e&&(r.has(e[1])||r.set(e[1],[]),r.get(e[1]).push(i))}return[...r].map(([e,t])=>({title:e,operations:t}))}function xe(e){return ve(e).some(e=>e.name===`domain`&&e.required)&&!A(e).startsWith(`domain.deploy_`)&&A(e)!==`dashboard.enable`}function Se(e){return ve(e).some(e=>e.name===`endpoint`)&&!A(e).startsWith(`domain.deploy_`)&&!A(e).startsWith(`endpoint.add_`)}function Ce(e){let t=A(e);return t.startsWith(`pages.`)?`Domain page`:t===`logs.view`?`Domain logs`:`All endpoints`}function N(e,t={},n){let r=e&&A(e);if(!e?.runtime_kinds||![`domain.deploy_runtime`,`endpoint.add_runtime`].includes(r))return null;let i=r===`endpoint.add_runtime`?n?.kind:t.kind,a=e.runtime_kinds[i],o=r===`endpoint.add_runtime`?new Set((n?.endpoints||[]).map(e=>e.label)):new Set,s=o.has(`root`),c=s?[]:(a?.versions||[]).filter(e=>!o.has(e)),l=c.includes(a?.default_version)?a.default_version:c[0]||``,u=r===`endpoint.add_runtime`?`endpoint`:`version`,d=t[u]||l;return{kind:i,kinds:Object.keys(e.runtime_kinds),versions:c,defaultVersion:l,versionField:u,version:d,rootEndpoint:s,repositories:(e.repositories||[]).filter(e=>e.version===d)}}function P(e,t,n){let r=N(e,t,n);return ve(e).map(e=>r?e.name===`kind`?{...e,choices:r.kinds}:e.name===r.versionField?{...e,label:`API version`,choices:r.versions,disabled:!r.kind||!r.versions.length,description:r.kind?r.rootEndpoint?`This domain serves a root endpoint, which cannot coexist with version folders.`:r.versions.length?e.description:`This domain already serves every available version.`:`Choose a runtime kind to see its API versions.`}:e.name===`repository`?{...e,type:`runtime_repository`,label:`Local Bible source`,repositories:r.repositories,disabled:!r.kind||!r.versions.length}:e:e)}function we(e,t,n,r,i){let a={...t,[n]:r},o=N(e,a,i);return o&&t[n]!==r&&[`kind`,`version`,`endpoint`,`domain`].includes(n)&&(delete a.repository,delete a._repositoryMode,(n===`kind`||n===`domain`)&&(a[o.versionField]=o.defaultVersion)),a}function Te(e,{domain:t,endpoint:n}={}){let r=ve(e),i=Object.fromEntries(r.filter(e=>e.default!==void 0).map(e=>[e.name,e.default]));t&&r.some(e=>e.name===`domain`)&&(i.domain=t.domain),n!==void 0&&r.some(e=>e.name===`endpoint`)&&(i.endpoint=n?.label||``);let a=t?.settings||{},o=n?.endpoint_settings||{},s=A(e),c=s===`access.mode`?{mode:a.ACCESS_MODE}:s===`access.limits`?{rate:a.RATE_PER_SECOND,burst:a.RATE_BURST,hour:a.QUOTA_HOUR,day:a.QUOTA_DAY,connections:a.CONN_LIMIT}:s===`endpoint.change_source`?{repository:o.REPO_URL,ref:o.REPO_REF,source_path:o.REPO_PATH}:s===`cloudflare.mode`?{value:a.CLOUDFLARE_MODE}:s===`cloudflare.cache`?{value:a.CLOUDFLARE_CACHE}:{},l={...i,...Object.fromEntries(Object.entries(c).filter(([,e])=>e!==void 0))},u=N(e,l,t);return u&&(l[u.versionField]=u.defaultVersion),l}function Ee(e,t){return Object.fromEntries(ve(e).filter(e=>t[e.name]!==void 0&&(t[e.name]!==``||e.allow_empty)).map(e=>[e.name,t[e.name]]))}var De=(e,t)=>Array.isArray(e)?e:e?.[t]||[],Oe=new Set([`queued`,`waiting`,`running`]);function ke({items:e,onSelect:t}){return(0,E.jsx)(`div`,{className:`manage-grid`,children:e.map(e=>(0,E.jsxs)(`button`,{type:`button`,className:`manage-card`,onClick:()=>t(e),children:[(0,E.jsx)(`strong`,{children:e.title}),e.detail&&(0,E.jsx)(`small`,{children:e.detail}),e.badge&&(0,E.jsx)(le,{tone:e.tone,children:e.badge})]},e.id||e.title))})}function Ae({field:e,values:t,setValues:n,onError:r,domains:i,currentSettings:a,spec:o,selectedDomain:s}){let c=t=>n(n=>({...we(o,n,e.name,t,s),...e.name===`key`&&a?{value:a[t]??``}:{}})),l={className:`form-control`,"aria-label":e.label||e.name,required:e.required&&!e.allow_empty,disabled:e.disabled},u;if(e.type===`runtime_repository`){let r=t._repositoryMode===`manual`;return(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`label`,{children:[e.label,(0,E.jsxs)(`select`,{...l,className:`form-select`,value:r?`__manual__`:t.repository||``,onChange:e=>{let t=e.target.value;n(e=>({...e,repository:t===`__manual__`?``:t,_repositoryMode:t===`__manual__`?`manual`:`published`}))},children:[(0,E.jsx)(`option`,{value:``,children:`Automatic local source`}),e.repositories.map(e=>(0,E.jsx)(`option`,{value:e.value,children:e.label},e.value)),(0,E.jsx)(`option`,{value:`__manual__`,children:`Enter a local path…`})]})]}),r&&(0,E.jsxs)(`label`,{children:[`Custom local path`,(0,E.jsx)(`input`,{className:`form-control`,"aria-label":`Custom local path`,type:`text`,required:!0,autoComplete:`off`,value:t.repository||``,onChange:e=>c(e.target.value)})]}),e.description&&(0,E.jsx)(`small`,{children:e.description})]})}return u=e.type===`file`?(0,E.jsx)(`input`,{...l,type:`file`,accept:`.png,.jpg,.jpeg,.webp,.ico,.svg`,onChange:t=>{let i=t.target.files?.[0];if(!i)return;if(i.size>1048576){r(Error(`Choose an image smaller than 1 MiB.`)),t.target.value=``;return}let a=new FileReader;a.onload=()=>n(t=>({...t,filename:i.name,[e.name]:String(a.result).split(`,`)[1]})),a.onerror=()=>r(Error(`The selected file could not be read.`)),a.readAsDataURL(i)}}):e.type===`multiline`?(0,E.jsx)(`textarea`,{...l,rows:12,spellCheck:`false`,value:t[e.name]||``,onChange:e=>c(e.target.value)}):e.type===`boolean`?(0,E.jsxs)(`select`,{"aria-label":e.label||e.name,className:`form-select`,value:String(t[e.name]??!1),onChange:e=>c(e.target.value===`true`),children:[(0,E.jsx)(`option`,{value:`false`,children:`No`}),(0,E.jsx)(`option`,{value:`true`,children:`Yes`})]}):e.name===`domain`&&!e.required?(0,E.jsxs)(`select`,{"aria-label":e.label||e.name,className:`form-select`,value:t.domain||``,onChange:e=>c(e.target.value),children:[(0,E.jsx)(`option`,{value:``,children:e.scopeLabel||`All domains`}),i.map(e=>(0,E.jsx)(`option`,{value:e.domain,children:e.domain},e.domain))]}):e.choices||e.enum?(0,E.jsxs)(`select`,{...l,className:`form-select`,value:t[e.name]??``,onChange:e=>c(e.target.value),children:[(0,E.jsx)(`option`,{value:``,children:`Select…`}),(e.choices||e.enum).map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]}):(0,E.jsx)(`input`,{...l,type:e.secret?`password`:e.type===`integer`?`number`:`text`,autoComplete:e.secret?`new-password`:`off`,value:t[e.name]??``,onChange:t=>c(e.type===`integer`&&t.target.value!==``?Number(t.target.value):t.target.value)}),(0,E.jsxs)(`label`,{className:e.type===`multiline`?`full-width`:void 0,children:[e.label||e.name,u,e.description&&(0,E.jsx)(`small`,{children:e.description})]})}function je({execute:e,onError:t,onDetail:n,refresh:r,initialSection:i=``}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)({section:i,domain:``,group:``,operation:``,endpoint:void 0}),[v,y]=(0,_.useState)({});(0,_.useEffect)(()=>{let e=!1;return u(null),Promise.allSettled([x(`operations`),x(`endpoints`)]).then(n=>{if(e)return;n[0].status===`fulfilled`&&o(n[0].value),n[1].status===`fulfilled`&&c(n[1].value);let r=n.find(e=>e.status===`rejected`);r&&(u(r.reason),t(r.reason))}),()=>{e=!0}},[r]),(0,_.useEffect)(()=>{let e=!1,n;async function r(){try{let[t,n]=await Promise.all([x(`jobs`),x(`management/state`)]);e||(f(t),m(n))}catch(n){e||t(n)}e||(n=setTimeout(r,2e3))}return r(),()=>{e=!0,clearTimeout(n)}},[r]);let b=De(a,`operations`),ee=(0,_.useMemo)(()=>j(s),[s]),te=ee.find(e=>e.domain===h.domain),S=te?.endpoints.find(e=>e.label===h.endpoint),C=b.find(e=>A(e)===h.operation),w=P(C,v,te),ne=N(C,v,te),re=!(!ne||ne.kind&&ne.versions.length),ie=_e.find(e=>e.id===h.section),ae=be(b,h.section,te),oe=ae.find(e=>e.title===h.group),ue=[`domains`,`go-live`].includes(h.section),de=!!(h.section&&!h.domain&&(ue||C&&xe(C))),fe=!!(C&&!de&&Se(C)&&h.endpoint===void 0),pe=p?.accepting_jobs===!1,me=!!(h.domain&&s&&!te),he=!!(h.endpoint&&s&&!S),ve=w.filter(e=>!(e.name===`domain`&&h.domain)&&!(e.name===`endpoint`&&Se(C))&&!(e.name===`filename`&&w.some(e=>e.type===`file`)));function ye(e){g(e);let t=b.find(t=>A(t)===e.operation),n=ee.find(t=>t.domain===e.domain),r=e.endpoint===void 0?void 0:n?.endpoints.find(t=>t.label===e.endpoint)||null;y(t?Te(t,{domain:n,endpoint:r}):{})}function we(e){let t=be(b,e.id),n=t.length===1?t[0]:void 0;ye({section:e.id,domain:``,group:n?.title||``,operation:n?.operations.length===1?A(n.operations[0]):``,endpoint:void 0})}function je(e){ye({...h,domain:e.id,endpoint:void 0})}function Me(e){ye({...h,operation:e.id,endpoint:void 0})}function Ne(t){t.preventDefault(),!(!C||pe||me||he||re)&&e(A(C),Ee(C,v),{title:C.title,description:C.description})}let Pe=[{label:`Manage`,action:()=>ye({section:``,domain:``,group:``,operation:``,endpoint:void 0})}];ie&&Pe.push({label:ie.title,action:()=>we(ie)}),h.domain&&ue&&Pe.push({label:h.domain,action:()=>ye({...h,group:``,operation:``,endpoint:void 0})}),h.group&&Pe.push({label:h.group,action:()=>ye({...h,operation:``,endpoint:void 0})}),C&&Pe.push({label:C.title,action:()=>ye({...h,domain:ue?h.domain:``,endpoint:void 0})}),h.domain&&!ue&&Pe.push({label:h.domain,action:()=>ye({...h,endpoint:void 0})}),C&&h.endpoint!==void 0&&Pe.push({label:h.endpoint||Ce(C)});let Fe;if(!a)Fe=l?(0,E.jsx)(D,{children:`Management actions could not be loaded. Use Refresh all to retry.`}):(0,E.jsx)(ce,{});else if(!b.length)Fe=(0,E.jsx)(D,{children:`No management operations were returned by the broker.`});else if(!ie)Fe=(0,E.jsx)(ke,{items:_e.filter(e=>be(b,e.id).length),onSelect:we});else if(me||he)Fe=(0,E.jsxs)(D,{children:[`This `,me?`domain`:`endpoint`,` is no longer registered. Select another from the menu above.`]});else if(de){let e=ee.filter(e=>h.section===`go-live`?!e.live:!C||M(C,e));Fe=s?e.length?(0,E.jsx)(ke,{items:e.map(e=>({id:e.domain,title:e.domain,detail:`${e.type===`mcp`?`MCP at /`:`${e.kind||e.type} · ${e.endpoints.length} endpoints`} · ${e.settings?.ACCESS_MODE||`access not reported`}`,badge:e.live?`Live`:`Staged`,tone:e.live?`success`:`info`})),onSelect:je}):(0,E.jsx)(D,{children:h.section===`go-live`?`No staged domains are waiting to go live.`:`No matching domains are registered. Choose Deploy a new domain from Manage to begin.`}):l?(0,E.jsx)(D,{children:`The domain inventory could not be loaded. Use Refresh all to retry.`}):(0,E.jsx)(ce,{children:`Loading registered domains…`})}else if(!h.group)Fe=(0,E.jsx)(ke,{items:ae.map(e=>({id:e.title,title:e.title,detail:e.operations.map(e=>e.title).join(` · `)})),onSelect:e=>{let t=ae.find(t=>t.title===e.id);ye({...h,group:e.id,operation:t.operations.length===1?A(t.operations[0]):``,endpoint:void 0})}});else if(!C)Fe=(0,E.jsx)(ke,{items:(oe?.operations||[]).map(e=>({id:A(e),title:e.title,detail:e.description,badge:e.mutates===!1?`View`:void 0})),onSelect:Me});else if(fe){let e=w.find(e=>e.name===`endpoint`),t=(te?.endpoints||[]).map(e=>({id:e.label,title:e.label===`root`?`Domain root`:`/${e.label}/`,detail:e.repository||`${e.kind} endpoint`}));e.required||t.unshift({id:``,title:Ce(C),detail:`Use the domain scope for this operation`}),Fe=t.length?(0,E.jsx)(ke,{items:t,onSelect:e=>ye({...h,endpoint:e.id})}):(0,E.jsx)(D,{children:`No endpoints are registered for this domain. Add an endpoint from Endpoints and repositories.`})}else Fe=A(C)===`system.update`?(0,E.jsx)(ge,{execute:e,refresh:r,paused:pe}):(0,E.jsxs)(`form`,{className:`management-form`,onSubmit:Ne,children:[C.description&&(0,E.jsx)(`p`,{className:`text-secondary`,children:C.description}),(h.domain||h.endpoint!==void 0)&&(0,E.jsxs)(`div`,{className:`management-context`,children:[(0,E.jsx)(`strong`,{children:h.domain}),h.endpoint!==void 0&&(0,E.jsxs)(`span`,{children:[` · `,h.endpoint?h.endpoint===`root`?`Domain root`:`/${h.endpoint}/`:Ce(C)]})]}),(0,E.jsx)(`div`,{className:`filter-grid`,children:ve.map(e=>(0,E.jsx)(Ae,{field:e.name===`domain`&&A(C)===`pages.upload_icon`?{...e,scopeLabel:`System icons`}:e,values:v,setValues:y,domains:ee,spec:C,selectedDomain:te,currentSettings:A(C)===`runtime.set`?S?.endpoint_settings:void 0,onError:t},`${h.operation}-${h.domain}-${h.endpoint}-${e.name}`))}),!!S&&A(C)===`runtime.set`&&(0,E.jsxs)(`details`,{className:`current-settings`,children:[(0,E.jsx)(`summary`,{children:`Current endpoint settings`}),(0,E.jsx)(k,{rows:Object.entries(S.endpoint_settings||{}).map(([e,t])=>({key:e,value:t})),columns:[{key:`key`,label:`Setting`},{key:`value`,label:`Current value`}]})]}),(0,E.jsx)(`button`,{className:`btn btn-primary`,disabled:pe||re,children:`Review operation`})]});let Ie=De(d,`jobs`),Le=Ie.filter(e=>Oe.has(e.status));return(0,E.jsxs)(E.Fragment,{children:[p?.refresh?.pending&&(0,E.jsxs)(`div`,{className:`alert ${p.refresh.state===`failed`?`alert-warning`:`alert-info`}`,role:`status`,children:[(0,E.jsx)(`strong`,{children:p.refresh.state===`failed`?`Management service update needs attention`:`Management services are updating`}),(0,E.jsx)(`div`,{children:p.refresh.state===`failed`?p.refresh.last_error||`The service refresh could not be scheduled. Management remains available; retry the update or inspect the service from the CLI.`:`Accepted jobs will finish before management restarts. Existing results and issued credentials remain available.`})]}),(0,E.jsxs)(O,{title:C?.title||h.group||(de?`Choose a domain`:ie?.title)||`Server management`,detail:`Follow the CLI menu flow. Started jobs continue when this page closes.`,children:[(0,E.jsx)(`nav`,{"aria-label":`Management navigation`,className:`management-breadcrumb`,children:Pe.map((e,t)=>(0,E.jsxs)(_.Fragment,{children:[t>0&&(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),e.action&&te.status===`waiting`)?`An operation is waiting for the current CLI or management operation to finish; it will continue automatically.`:`Select an operation below for live progress.`]}),(0,E.jsx)(O,{title:`Operation history`,detail:`Select a job to view live progress and output`,children:d?(0,E.jsx)(k,{rows:Ie,onSelect:async e=>{try{n(`Operation details`,await x(`jobs/${encodeURIComponent(e.id)}`))}catch(e){t(e)}},columns:[{key:`id`,label:`Job`},{key:`operation`,label:`Operation`,render:e=>b.find(t=>A(t)===e.operation)?.title||e.operation},{key:`status`,label:`State`,render:e=>(0,E.jsx)(le,{tone:[`failed`,`interrupted`].includes(e.status)?`warning`:e.status===`succeeded`?`success`:`info`,children:e.status})},{key:`created`,label:`Submitted`,render:e=>T(e.created_at??e.created)},{key:`started`,label:`Started`,render:e=>T(e.started_at??e.started)},{key:`finished`,label:`Finished`,render:e=>T(e.finished_at??e.finished)}]}):(0,E.jsx)(ce,{})})]})}var Me=e=>String(e||`unknown`).replaceAll(`_`,` `),Ne=e=>e==null?`Unknown`:`${e<0?`−`:``}${w(Math.abs(e))}/s`;function Pe({refresh:e,execute:t}){let[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=!1,t,n=new AbortController;async function i(){try{let t=await x(`capacity`,{signal:n.signal});e||(r(t),a(null))}catch(t){!e&&t.name!==`AbortError`&&a(t)}e||(t=setTimeout(i,3e4))}return i(),()=>{e=!0,clearTimeout(t),n.abort()}},[e]);let o=!!(i||n?.stale||n?.state!==`observed`),s=n?.collection||{};return(0,E.jsxs)(O,{title:`Capacity and sizing advice`,detail:`Measured limits and repeated saturation; suggestions require operator review and never change settings automatically.`,children:[(0,E.jsx)(se,{error:i}),n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:`alert ${o?`alert-warning`:`alert-info`}`,role:`status`,children:[(0,E.jsx)(`strong`,{children:Me(n.state)}),` · Last sample: `,T(n.sampled_at),(0,E.jsx)(`div`,{children:n.note})]}),(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Collection`}),(0,E.jsx)(`strong`,{children:o?`Unknown — observations are not current`:Me(s.state)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Unread backlog`}),(0,E.jsxs)(`strong`,{children:[w(s.unread_bytes),` · `,C(s.unread_files),` files`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Transport / retained archives`}),(0,E.jsxs)(`strong`,{children:[w(s.budgeted_spool_bytes),` / `,w(s.retained_archive_bytes)]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Committed closed transport`}),(0,E.jsxs)(`strong`,{children:[w(s.consumed_rotated_bytes),` · already ingested`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Reclamation`}),(0,E.jsxs)(`div`,{className:`text-end`,children:[(0,E.jsx)(`strong`,{children:o?`Unknown — observations are not current`:Me(s.reclamation?.state)}),(0,E.jsx)(`small`,{className:`d-block`,children:s.reclamation?.reason})]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Producer / collector throughput`}),(0,E.jsxs)(`strong`,{children:[Ne(s.producer_bytes_per_second),` / `,Ne(s.collector_bytes_per_second)]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Backlog growth / continuous backlog`}),(0,E.jsxs)(`strong`,{children:[Ne(s.backlog_growth_bytes_per_second),` / `,C(s.backlog_observed_seconds),` seconds`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Rate window / peak window`}),(0,E.jsxs)(`strong`,{children:[C(s.rate_window_seconds),` seconds / `,C(n.window_seconds/3600),` hours`]})]})]}),(0,E.jsx)(k,{rowKey:e=>e.id,rows:n.limits||[],columns:[{key:`label`,label:`Limit`,render:e=>(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`strong`,{children:e.label}),(0,E.jsxs)(`small`,{className:`d-block`,children:[e.setting||`Host capacity`,` · `,e.unit]})]})},{key:`used`,label:`Usage / effective limit`,render:e=>e.available?`${C(e.used,2)} / ${C(e.effective_limit,2)} ${e.unit}`:`Unavailable`},{key:`high_water`,label:`Observed peak`,render:e=>e.available?`${C(e.high_water,2)} ${e.unit}`:`Unknown`},{key:`episodes`,label:`Saturation`,render:e=>e.available?(0,E.jsxs)(E.Fragment,{children:[C(e.episodes),` episodes`,(0,E.jsxs)(`small`,{className:`d-block`,children:[C(e.saturated_samples),` / `,C(e.samples),` samples; `,C(e.saturated_seconds),` / `,C(e.observed_seconds),` observed seconds`]}),(0,E.jsxs)(`small`,{className:`d-block`,children:[`At or above `,C(e.saturation_threshold*100),`% of limit`]})]}):`Unknown`},{key:`configuration`,label:`Configured value / owner`,render:e=>(0,E.jsxs)(E.Fragment,{children:[e.configuration?.value??`Not observable`,(0,E.jsxs)(`small`,{className:`d-block`,children:[Me(e.configuration?.owner),e.configuration?.editable?` · editable`:` · change at source`]}),(0,E.jsx)(`small`,{className:`d-block`,children:e.configuration?.note})]})},{key:`recommendation`,label:`Recommendation`,render:e=>{let n=he(e,o);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(le,{tone:e.recommendation?.status===`adequate`?`success`:`info`,children:Me(e.recommendation?.status)}),e.recommendation?.value!=null&&!o&&(0,E.jsxs)(`strong`,{className:`d-block`,children:[C(e.recommendation.value,2),` `,e.unit]}),(0,E.jsx)(`small`,{className:`d-block`,children:e.recommendation?.reason}),e.recommendation?.assumptions&&(0,E.jsx)(`small`,{className:`d-block`,children:e.recommendation.assumptions}),n&&(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-primary mt-2`,type:`button`,onClick:()=>t(`settings.set`,n,{title:`Review ${n.key} = ${n.value}`,description:`This is an observed-demand recommendation, not an automatic correction or a guarantee. Confirm free capacity and collection health before applying.`}),children:`Review suggested setting`})]})}}]}),!!n.incidents?.length&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`h3`,{className:`h6 mt-3`,children:`Open capacity incidents`}),(0,E.jsx)(k,{rows:n.incidents,rowKey:e=>e.id,columns:[{key:`id`,label:`Condition`},{key:`since`,label:`Since`,render:e=>T(e.since)},{key:`last_sent`,label:`Last notification`,render:e=>T(e.last_sent)},{key:`last_event`,label:`Last transition`,render:e=>Me(e.last_event)}]})]}),!!Object.keys(n.problems||{}).length&&(0,E.jsxs)(`details`,{className:`mt-3`,children:[(0,E.jsx)(`summary`,{children:`Collection and reclamation diagnostics`}),(0,E.jsx)(`pre`,{className:`record-detail`,children:JSON.stringify(n.problems,null,2)})]})]}):!i&&(0,E.jsx)(ce,{children:`Reading capacity observations…`})]})}function Fe(e,t,n,r=Date.now()/1e3){let i=e.cache||{},a=i.query_translations?.[t],o=i.search_corpora?.translations?.[t],s=i.translation_cache?.translations?.[t],c=a?.expired_chapters>0||[o,s].some(e=>e&&(e.stale||e.checked_at!=null&&i.ttl_seconds!=null&&e.checked_at+i.ttl_seconds<=r)),l=e.translation_status?.[t],u=!!(a||o||s),d=!c&&(l?.ready??(n===`search`?!!(o?.verses>0&&o.indexes?.some(e=>e.case_sensitive===!1&&e.fold_diacritics===!0)):a?.complete===!0));return{code:t,pid:e.pid,resident:u,ready:!!d,stale:c,reason:l?.reason||``,retention_limited:l?.retention_limited===!0,query_chapters:a?.chapters,query_bytes:a?.estimated_bytes,search_verses:o?.verses,search_bytes:o?.estimated_bytes,snapshot_bytes:s?.estimated_bytes,snapshot_present:!!s,ttl:i.ttl_seconds,rss_bytes:e.rss_bytes,private_bytes:e.private_bytes,details:{query:a,search:o,snapshot:s,readiness:l,activity:e.activity},worker:e}}function Ie(e,t=Date.now()/1e3){let n=e.workers||[],r=new Set;for(let e of n)for(let t of[...Object.keys(e.cache?.query_translations||{}),...Object.keys(e.cache?.search_corpora?.translations||{}),...Object.keys(e.cache?.translation_cache?.translations||{})])r.add(t);return[...r].sort().map(n=>Le(e,n,t))}function Le(e,t,n=Date.now()/1e3){let r=(e.workers||[]).map(r=>Fe(r,t,e.kind,n)),i=e.expected_workers??r.length,a=e.complete===!0&&r.length>0&&r.length===i,o=r.filter(e=>e.resident),s=r.filter(e=>e.ready).length,c=o.some(e=>e.stale),l=a&&s===i;return{code:t,workers:r,resident:o,expected:i,completeReport:a,readyCount:s,ready:l,stale:c,status:l?`Warm`:c?`Recheck on use`:o.length?`Partly resident`:a?`Not in memory`:`Not reported`,configured:(e.configured_warm_translations||[]).includes(t),reasons:[...new Set(r.filter(e=>e.resident&&!e.ready).map(e=>e.reason).filter(Boolean))]}}function Re(e,t){let n=e.map(e=>e[t]).filter(e=>Number.isFinite(e));return n.length?{min:Math.min(...n),max:Math.max(...n)}:null}function ze(e,t,n=C){let r=Re(e,t);return r?r.min===r.max?n(r.min):`${n(r.min)}–${n(r.max)}`:`—`}function Be(e,t,n){let r=Re(e,t);return`${ze(e,t)} ${n}${r?.min===1&&r?.max===1?``:`s`}`}function Ve({row:e}){return(0,E.jsx)(le,{tone:e.ready?`success`:e.resident.length?`warning`:`muted`,children:e.status})}function He({row:e,onBack:t,onDetail:n}){return(0,E.jsxs)(`div`,{className:`worker-layer`,children:[(0,E.jsxs)(`div`,{className:`worker-heading`,children:[(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:t,children:`Back to translations`}),(0,E.jsxs)(`strong`,{children:[e.code.toUpperCase(),` · workers`]}),(0,E.jsx)(Ve,{row:e})]}),(0,E.jsxs)(`p`,{className:`panel-note`,children:[C(e.resident.length),` of `,C(e.expected),` workers currently retain this translation. Counts and estimates below describe each worker separately. A worker can retain query chapters alongside a complete search corpus.`]}),(0,E.jsx)(k,{rows:e.workers,rowKey:e=>e.pid,onSelect:t=>n(`${e.code.toUpperCase()} · worker ${t.pid}`,t.details),columns:[{key:`pid`,label:`Worker PID`},{key:`resident`,label:`Cache state`,render:e=>(0,E.jsxs)(`div`,{children:[(0,E.jsx)(le,{tone:e.ready?`success`:e.resident?`warning`:`muted`,children:e.ready?`Warm`:e.stale?`Recheck on use`:e.resident?`Partly resident`:`Not in memory`}),e.reason&&(0,E.jsx)(`small`,{className:`cell-note`,children:e.reason})]})},{key:`query_chapters`,label:`Query chapters`,render:e=>(0,E.jsxs)(`div`,{children:[C(e.query_chapters),(0,E.jsxs)(`small`,{className:`cell-note`,children:[w(e.query_bytes),` estimated`]})]})},{key:`search_verses`,label:`Search corpus / index`,render:e=>(0,E.jsxs)(`div`,{children:[e.search_verses==null?`—`:`${C(e.search_verses)} verses`,(0,E.jsxs)(`small`,{className:`cell-note`,children:[w(e.search_bytes),` estimated`]})]})},{key:`snapshot_bytes`,label:`Translation snapshot`,render:e=>e.snapshot_present?`${w(e.snapshot_bytes)} estimated`:`—`},{key:`ttl`,label:`Memory TTL`,render:e=>e.ttl==null?`—`:`${C(e.ttl/86400,1)} days`},{key:`rss_bytes`,label:`Worker RSS`,render:e=>w(e.rss_bytes)},{key:`private_bytes`,label:`Worker private memory`,render:e=>w(e.private_bytes)}]}),(0,E.jsx)(`p`,{className:`panel-note`,children:`RSS includes shared pages and the whole worker. Private memory also covers the whole worker. Neither is a per-translation measurement; cache estimates may overlap.`})]})}function Ue({onError:e,execute:t,onDetail:n,refresh:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(`kjv`),[u,d]=(0,_.useState)({});(0,_.useEffect)(()=>{let t=!1,n;async function r(){try{let e=await x(`translations`);t||a(e)}catch(n){t||e(n)}t||(n=setTimeout(r,5e3))}return r(),()=>{t=!0,clearTimeout(n)}},[r]);let f=i?.endpoints||[],p=f.find(e=>`${e.domain}/${e.label}`===o),m=p?.available_translations||[],h=c.trim().toLowerCase(),g=p?Le(p,h):null,v=/^[a-z0-9][a-z0-9_-]{0,29}$/.test(h);function y(e,n,r){t(`runtime.cache`,{domain:e.domain,endpoint:e.label,action:r,translation:n})}return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(O,{title:`Translation memory`,detail:`See what is in memory, then select a translation to inspect its workers. Current residency is refreshed every five seconds.`,children:[(0,E.jsxs)(`div`,{className:`filter-grid`,children:[(0,E.jsxs)(`label`,{children:[`Runtime endpoint`,(0,E.jsxs)(`select`,{"aria-label":`Runtime endpoint`,className:`form-select`,value:o,onChange:e=>s(e.target.value),children:[(0,E.jsx)(`option`,{value:``,children:`Select endpoint`}),f.map(e=>(0,E.jsxs)(`option`,{value:`${e.domain}/${e.label}`,children:[e.domain,` / `,e.label,` · `,e.kind]},`${e.domain}/${e.label}`))]})]}),(0,E.jsxs)(`label`,{children:[`Translation`,(0,E.jsx)(`input`,{list:`available-translations`,className:`form-control`,value:c,onChange:e=>l(e.target.value),placeholder:`kjv`}),(0,E.jsx)(`datalist`,{id:`available-translations`,children:m.map(e=>(0,E.jsx)(`option`,{value:e.translation,children:Le(p,e.translation).status},e.translation))})]}),(0,E.jsx)(`div`,{className:`d-flex gap-2 align-items-end`,children:(0,E.jsx)(`button`,{className:`btn btn-primary`,disabled:!p||!v||g?.ready,onClick:()=>y(p,h,`warm`),children:g?.ready?`Already warm`:`Warm translation`})})]}),g&&v&&(0,E.jsxs)(`div`,{className:`warm-selection`,"aria-live":`polite`,children:[(0,E.jsx)(Ve,{row:g}),(0,E.jsxs)(`span`,{children:[h.toUpperCase(),` · `,C(g.resident.length),` / `,C(g.expected),` workers retain data · `,C(g.readyCount),` ready`,g.configured?` · configured for startup warming`:``]}),g.reasons.map(e=>(0,E.jsx)(`small`,{children:e},e)),!g.completeReport&&(0,E.jsx)(`small`,{children:`Some workers have not reported; their memory state is unknown.`})]})]}),i?f.length?f.map(e=>{let t=`${e.domain}/${e.label}`,r=Ie(e),i=u[t]?Le(e,u[t]):null;return(0,E.jsxs)(O,{title:`${e.domain} / ${e.label}`,detail:`${e.kind} · ${r.length} translation${r.length===1?``:`s`} currently resident · ${e.workers?.length||0} worker${e.workers?.length===1?``:`s`} reported`,actions:(0,E.jsx)(le,{tone:e.complete?`success`:`warning`,children:e.complete?`All workers reported`:`Partial report`}),children:[i?(0,E.jsx)(He,{endpoint:e,row:i,onDetail:n,onBack:()=>d({...u,[t]:``})}):(0,E.jsxs)(E.Fragment,{children:[r.length?(0,E.jsx)(k,{rows:r,rowKey:e=>e.code,onSelect:e=>d({...u,[t]:e.code}),columns:[{key:`code`,label:`Translation`,render:e=>(0,E.jsxs)(`span`,{children:[e.code.toUpperCase(),(0,E.jsx)(`small`,{className:`cell-note`,children:e.configured?`Startup warming configured`:`Currently in memory`})]})},{key:`status`,label:`Readiness`,render:e=>(0,E.jsxs)(`div`,{children:[(0,E.jsx)(Ve,{row:e}),e.reasons.map(e=>(0,E.jsx)(`small`,{className:`cell-note`,children:e},e))]})},{key:`workers`,label:`Worker coverage`,render:e=>(0,E.jsxs)(`div`,{children:[C(e.resident.length),` / `,C(e.expected),` resident`,(0,E.jsxs)(`small`,{className:`cell-note`,children:[C(e.readyCount),` / `,C(e.expected),` ready`]})]})},{key:`query_chapters`,label:`Query data per worker`,render:e=>{let t=e.resident.filter(e=>e.query_chapters!=null);return t.length?(0,E.jsxs)(`div`,{children:[Be(t,`query_chapters`,`chapter`),(0,E.jsxs)(`small`,{className:`cell-note`,children:[ze(t,`query_bytes`,w),` estimated · `,t.length,` worker`,t.length===1?``:`s`]})]}):`—`}},{key:`search_verses`,label:`Search data per worker`,render:e=>{let t=e.resident.filter(e=>e.search_verses!=null);return t.length?(0,E.jsxs)(`div`,{children:[ze(t,`search_verses`),` verses`,(0,E.jsxs)(`small`,{className:`cell-note`,children:[ze(t,`search_bytes`,w),` corpus / index estimate · `,t.length,` worker`,t.length===1?``:`s`]})]}):`—`}},{key:`snapshot_bytes`,label:`Snapshot per worker`,render:e=>{let t=e.resident.filter(e=>e.snapshot_present);return t.length?(0,E.jsxs)(`div`,{children:[ze(t,`snapshot_bytes`,w),` estimated`,(0,E.jsxs)(`small`,{className:`cell-note`,children:[t.length,` worker`,t.length===1?``:`s`]})]}):`—`}},{key:`actions`,label:`All workers`,render:t=>(0,E.jsxs)(`div`,{className:`btn-group`,children:[!t.ready&&(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-primary`,onClick:()=>y(e,t.code,`warm`),children:`Warm`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-primary`,onClick:()=>y(e,t.code,`reload`),children:`Reload`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-danger`,onClick:()=>y(e,t.code,`drop`),children:`Drop`})]})}]}):(0,E.jsx)(D,{children:e.complete?`No translations are currently retained in worker memory.`:`No resident translations have been reported yet.`}),(0,E.jsx)(`p`,{className:`panel-note`,children:`Ranges show differences between workers, not a combined memory total. Select a translation for individual worker contents and measured memory.`})]}),(0,E.jsxs)(`details`,{className:`worker-details`,children:[(0,E.jsxs)(`summary`,{children:[C(e.available_translations?.length||0),` translations available on disk`]}),(0,E.jsx)(k,{rows:e.available_translations||[],onSelect:e=>n(`${e.translation.toUpperCase()} on disk`,e),columns:[{key:`translation`,label:`Translation`,render:e=>e.translation.toUpperCase()},{key:`memory`,label:`Current memory`,render:t=>(0,E.jsx)(Ve,{row:Le(e,t.translation)})},{key:`allocated_bytes`,label:`Allocated disk`,render:e=>w(e.allocated_bytes)},{key:`logical_bytes`,label:`File contents`,render:e=>w(e.logical_bytes)},{key:`files`,label:`Files`,render:e=>C(e.files)},{key:`warm`,label:`All workers`,render:t=>{let n=Le(e,t.translation);return(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-primary`,disabled:n.ready,onClick:()=>y(e,t.translation,`warm`),children:n.ready?`Already warm`:`Warm translation`})}}]})]}),!!e.configured_warm_translations?.length&&(0,E.jsxs)(`p`,{className:`panel-note`,children:[`Configured startup warm-ups: `,e.configured_warm_translations.map(e=>e.toUpperCase()).join(`, `),`. Configuration describes startup intent; the table shows current memory.`]}),e.inventory_error&&(0,E.jsx)(`div`,{className:`alert alert-warning m-3`,children:e.inventory_error}),!!e.errors?.length&&(0,E.jsx)(`div`,{className:`alert alert-warning m-3`,children:e.errors.map((e,t)=>(0,E.jsx)(`div`,{children:typeof e==`string`?e:e.error||`Worker did not report.`},t))})]},t)}):(0,E.jsx)(D,{children:`No runtime endpoints are configured.`}):(0,E.jsx)(ce,{})]})}function We(e,t,n,r={},i=Math.floor(Date.now()/1e3)){let a=n?i:t.end,o=n?a-900:t.start,s=n?5:Math.max(1,Math.ceil((a-o)/400)),c=S({...r,start:o,end:a,bucket_seconds:s});return e===`Overview`?{overview:`overview?${c}&dimensions=auth,endpoint,status,translation,search,reference,book,ip,referrer,user_agent`,history:`history?${c}`}:e===`Resources`?{metrics:`metrics?${S({start:o,end:a,bucket_seconds:s})}`}:e===`MCP traffic`?{mcp:`mcp?${c}`}:e===`Audience`?{audience:`audience?${c}`}:{}}var Ge=()=>({data:null,error:null,loading:!0,preparing:!1,progress:null});function Ke({paths:e,live:t=!1,interval:n=2e3,onChange:r,onError:i=()=>{},onUpdate:a=()=>{},load:o=x,schedule:s=setTimeout,cancel:c=clearTimeout}){let l=new AbortController,u=new Map,d=!1;async function f(c,p=Ge()){if(d)return;let m={...p,loading:!0};r(c,m);let h,g=t?n:null;try{let t=await o(e()[c],{signal:l.signal});if(d)return;t.state===`preparing`?(h={...m,error:null,preparing:!0,progress:t.progress||null},g=Math.max(500,Math.min(3e4,Number(t.retry_after)*1e3||2e3))):(h={data:t,error:null,loading:!1,preparing:!1,progress:null},a())}catch(e){if(d||e.name===`AbortError`)return;h={...m,error:e,loading:!1,preparing:!1,progress:null},e.status===401&&(g=null,i(e))}d||(r(c,h),g!==null&&u.set(c,s(()=>f(c,h),g)))}for(let t of Object.keys(e()))f(t);return()=>{d=!0,l.abort();for(let e of u.values())c(e);u.clear()}}function qe({page:e,range:t,live:n,filters:r,refresh:i,enabled:a=!0,interval:o=2e3,onError:s,onUpdate:c}){let l=JSON.stringify([e,t.start,t.end,n,r,i,a,o]),[u,d]=(0,_.useState)({key:null,values:{}});(0,_.useEffect)(()=>{if(d({key:l,values:{}}),a)return Ke({paths:()=>We(e,t,n,r),live:n,interval:o,onError:s,onUpdate:c,onChange:(e,t)=>d(n=>({key:l,values:{...n.key===l?n.values:{},[e]:t}}))})},[l]);let f=u.key===l?u.values:{};return Object.fromEntries(Object.keys(We(e,t,n,r)).map(e=>[e,f[e]||Ge()]))}function Je({report:e,label:t,children:n}){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(se,{error:e.error&&Error(`${t}: ${e.error.message}`)}),e.preparing&&(0,E.jsxs)(`div`,{className:`alert alert-info py-2`,role:`status`,children:[`Preparing `,t.toLowerCase(),` for this time range…`]}),e.data?n:e.loading&&!e.preparing?(0,E.jsxs)(ce,{children:[`Loading `,t.toLowerCase(),`…`]}):null]})}function Ye({dimension:e,title:t,label:n,filters:r,range:i,live:a,refresh:o,onFilter:s,onError:c}){let[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),{audience:p}=qe({page:`Audience`,range:i,live:a,refresh:o,onError:c,interval:5e3,filters:{...r,dimension:e,top:1e3,[`${e}_contains`]:d}}),m=p.data?.[e===`referrer`?`referrers`:`user_agents`]||[];return(0,E.jsxs)(O,{title:t,detail:`Origin requests, including errors. Select a row to explore its traffic.`,children:[(0,E.jsxs)(`form`,{className:`filter-grid`,onSubmit:e=>{e.preventDefault(),f(l)},children:[(0,E.jsxs)(`label`,{children:[`Find `,n.toLowerCase(),(0,E.jsx)(`input`,{className:`form-control`,value:l,onChange:e=>u(e.target.value),placeholder:`Part of a ${n.toLowerCase()}`})]}),(0,E.jsxs)(`div`,{className:`d-flex gap-2 align-items-end`,children:[(0,E.jsx)(`button`,{className:`btn btn-sm btn-primary`,children:`Search`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-outline-secondary`,onClick:()=>{u(``),f(``)},children:`Clear`})]})]}),(0,E.jsx)(Je,{report:p,label:t,children:(0,E.jsx)(k,{rows:m,rowKey:e=>e.value,onSelect:t=>s(e,t.value,t.filters),columns:[{key:`value`,label:n,render:e=>(0,E.jsx)(`span`,{className:`consumer-value`,title:e.value,children:e.value})},{key:`calls`,label:`Requests`,render:e=>C(e.calls)},{key:`errors`,label:`Errors`,render:e=>C(e.errors)},{key:`bytes`,label:`Transfer`,render:e=>w(e.bytes)}]})}),(0,E.jsx)(`div`,{className:`table-footer`,children:(0,E.jsxs)(`small`,{children:[m?.length===1e3?`Top 1,000 matching values. Search to narrow the results.`:`${C(m?.length||0)} matching values`,` · requests without a recorded `,n.toLowerCase(),` are omitted.`]})})]})}function Xe(e){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`p`,{className:`text-secondary`,children:`Referrers and user agents are recorded request fields. User agents may identify software, robots or browsers; these reported values do not establish a person's identity. Select a value to inspect matching requests in this time range.`}),(0,E.jsx)(Ye,{...e,dimension:`referrer`,title:`Referrers`,label:`Referrer`}),(0,E.jsx)(Ye,{...e,dimension:`user_agent`,title:`User agents and robots`,label:`User agent`})]})}function Ze(e,t,n={}){return{...n,...t.filters||{[e]:t.value}}}var Qe=e=>[`queued`,`waiting`,`running`].includes(e),$e=[[`mcp_method`,`MCP method`],[`mcp_tool`,`MCP tool`],[`mcp_client_name`,`Declared MCP client`],[`mcp_client_version`,`MCP client version`],[`upstream_service`,`Upstream service`],[`upstream_api_version`,`Upstream API version`],[`upstream_operation`,`Upstream operation`]],et=[`success`,`tool_error`,`protocol_error`,`transport_error`,`unknown`],tt=new Set([`tool_error`,`protocol_error`,`transport_error`]);function nt(e={}){return{...e,endpoint_kind:`mcp`,origin_only:`true`}}function rt(e={}){let t=nt(e);for(let e of[`version`,`translation`,`reference`,`search`,`book`,`usage`,`operation`])delete t[e];return e.endpoint_kind!==`mcp`&&delete t.endpoint,t}function it(e){return Number(e.status)>=400||e.mcp_error===!0||tt.has(e.mcp_outcome)}function at(e,t,n){if(t===`endpoint_kind`&&n===`mcp`)return rt(e);let r={...e,[t]:n};if((t===`successful`&&n!==`true`||t===`endpoint_kind`)&&delete r.usage,t===`endpoint_kind`&&n!==`mcp`){for(let[e]of $e)delete r[e];delete r.mcp_outcome,e.endpoint_kind===`mcp`&&delete r.endpoint}return t===`mcp_outcome`&&tt.has(n)&&(delete r.successful,delete r.usage),t===`successful`&&n===`true`&&tt.has(r.mcp_outcome)&&delete r.mcp_outcome,t===`status`&&/^\d{3}$/.test(String(n))&&!(Number(n)>=200&&Number(n)<300)&&Number(n)!==304&&(delete r.usage,delete r.successful),r}var ot=[[`endpoint`,`MCP domains`,`Origin requests to the protocol endpoint at /`,`Domain`],[`mcp_method`,`Protocol methods`,`Initialization, discovery, tool calls and notifications`,`Method`],[`mcp_tool`,`MCP tools`,`Recorded tool names, without tool arguments`,`Tool`],[`mcp_outcome`,`Protocol outcomes`,`Tool and protocol errors can have HTTP status 200`,`Outcome`],[`mcp_client_name`,`Declared clients`,`Client names supplied during initialization`,`Client`],[`mcp_client_version`,`Declared client versions`,`Client versions supplied during initialization`,`Client version`],[`upstream_service`,`Upstream API services`,`Service selected by a recorded API operation`,`Service`],[`upstream_api_version`,`Upstream API versions`,`API versions are tool inputs; the MCP host has no version paths`,`API version`],[`upstream_operation`,`Upstream API operations`,`Operation identifiers selected by recorded tool calls`,`Operation`],[`status`,`HTTP responses`,`Includes rejected and malformed origin requests`,`HTTP status`]];function st({filters:e,range:t,live:n,refresh:r,onFilter:i,onError:a,onZoom:o}){let s=(0,_.useMemo)(()=>nt(e),[e]),{mcp:c}=qe({page:`MCP traffic`,range:t,live:n,filters:s,refresh:r,onError:a}),l=c.data;function u(e,t,n){i(e,t,Ze(e,{value:t,filters:n},s))}if(!l)return(0,E.jsx)(Je,{report:c,label:`MCP traffic`});let d=[[`MCP requests`,C(l.mcp_requests??l.calls),`${C(l.unique_ips)} unique IPs`],[`Tool calls`,C(l.mcp_tool_calls),`Recorded tools/call requests`],[`Errors`,C(l.mcp_errors??l.errors),`${C(l.http_errors)} HTTP errors; includes protocol failures`],[`Average duration`,`${C(l.duration_ms,1)} ms`,`Observed origin request duration`],[`P95 duration`,l.latency_ms?.p95==null?`—`:`${C(l.latency_ms.p95,1)} ms`,`Histogram estimate`]],f=ae(l.series||[],[[`duration_ms`,`Average duration (ms)`]]);return f.xAxis.axisLabel={hideOverlap:!0},(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Je,{report:c,label:`MCP traffic`}),(0,E.jsx)(`p`,{className:`text-secondary`,children:`MCP origin requests are counted once, including requests rejected before protocol handling. Protocol methods and outcomes appear when captured; user agents remain available independently of declared client metadata.`}),(0,E.jsx)(`div`,{className:`metric-grid`,children:d.map(([e,t,n])=>(0,E.jsxs)(`div`,{className:`metric panel`,children:[(0,E.jsx)(`span`,{children:e}),(0,E.jsx)(`strong`,{children:t}),(0,E.jsx)(`small`,{children:n})]},e))}),(0,E.jsxs)(`div`,{className:`overview-grid`,children:[(0,E.jsx)(O,{className:`flow-panel`,title:`MCP requests and errors`,detail:`HTTP failures and captured MCP failures`,actions:(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:()=>u(`endpoint_kind`,`mcp`,s),children:`Explore requests`}),children:(0,E.jsx)(re,{label:`MCP requests and errors over time`,height:300,onZoom:o,option:ae(l.series||[],[[`calls`,`Requests`],[`errors`,`Errors`]],{zoom:!0})})}),(0,E.jsx)(O,{title:`Request duration`,detail:`Includes the lifetime of streamed HTTP requests`,children:(0,E.jsx)(re,{label:`Average MCP origin request duration in milliseconds`,height:300,option:f})})]}),(0,E.jsx)(`div`,{className:`resource-grid`,children:ot.map(([e,t,n,r])=>(0,E.jsx)(O,{title:t,detail:n,children:(0,E.jsx)(k,{rows:l.breakdowns?.[e]||[],onSelect:t=>u(e,t.value,t.filters),columns:[{key:`value`,label:r,render:e=>(0,E.jsx)(`span`,{className:`consumer-value`,title:String(e.value),children:e.value||(0,E.jsx)(le,{children:`Unrecorded`})})},{key:`calls`,label:`Requests`,render:e=>C(e.calls)},{key:`errors`,label:`Errors`,render:e=>C(e.errors)},{key:`duration_ms`,label:`Avg. ms`,render:e=>C(e.duration_ms,1)}]})},e))}),(0,E.jsx)(Xe,{filters:s,range:t,live:n,refresh:r,onFilter:u,onError:a})]})}var ct=[`Overview`,`Traffic`,`MCP traffic`,`Audience`,`Translations`,`Resources`,`Events`,`Manage`,`Sessions`],lt={Live:900,"24 hours":86400,"7 days":604800,"30 days":2592e3,"6 months":15552e3},ut=(e,t)=>Array.isArray(e)?e:e?.[t]??e?.items??[];function dt({title:e,value:t,onClose:n,children:r}){let i=(0,_.useRef)(null),a=(0,_.useId)();return(0,_.useEffect)(()=>{let e=new window.bootstrap.Modal(i.current),t=()=>n();return i.current.addEventListener(`hidden.bs.modal`,t),e.show(),()=>{i.current?.removeEventListener(`hidden.bs.modal`,t),e.hide(),e.dispose()}},[]),(0,E.jsx)(`div`,{ref:i,className:`modal`,tabIndex:`-1`,"aria-labelledby":a,children:(0,E.jsx)(`div`,{className:`modal-dialog modal-xl modal-dialog-scrollable`,children:(0,E.jsxs)(`div`,{className:`modal-content`,children:[(0,E.jsxs)(`div`,{className:`modal-header`,children:[(0,E.jsx)(`h2`,{className:`modal-title fs-5`,id:a,children:e}),(0,E.jsx)(`button`,{className:`btn-close`,"data-bs-dismiss":`modal`,"aria-label":`Close details`})]}),(0,E.jsx)(`div`,{className:`modal-body`,children:r||(0,E.jsx)(`pre`,{className:`record-detail`,children:JSON.stringify(t,null,2)})})]})})})}function ft({onLogin:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(60),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!a)return;let e=setInterval(()=>c(Math.max(0,Math.ceil((a.deadline-Date.now())/1e3))),250);return()=>clearInterval(e)},[a]);async function h(s){s.preventDefault(),u(null),f(!0);try{if(a)await te(`auth/token`,{challenge_id:a.challenge_id,token:r}),i(``),e(await x(`auth/status`));else{let e=await te(`auth/password`,{password:t});n(``),o({...e,deadline:Date.now()+e.expires_in*1e3})}}catch(e){u(e),(e.status===403||e.status===423)&&m(!0)}finally{f(!1)}}return(0,E.jsxs)(`main`,{className:`login-page`,children:[(0,E.jsxs)(`div`,{className:`login-brand`,children:[(0,E.jsx)(`img`,{src:`/favicon.png`,alt:``}),(0,E.jsx)(`span`,{children:`getBible`}),(0,E.jsx)(`small`,{children:`OPERATIONS`})]}),(0,E.jsxs)(`section`,{className:`login-box panel`,children:[(0,E.jsx)(`span`,{className:`eyebrow`,children:`PRIVATE CONSOLE`}),(0,E.jsx)(`h1`,{children:a?`Check Telegram`:`Sign in to your server`}),(0,E.jsx)(`p`,{children:a?`Enter the one-use code sent to your configured Telegram group.`:`Your password and a Telegram code protect access to this console.`}),(0,E.jsx)(se,{error:l}),(0,E.jsxs)(`form`,{onSubmit:h,children:[(0,E.jsx)(`label`,{className:`form-label`,htmlFor:`credential`,children:a?`Telegram code`:`Password`}),(0,E.jsx)(`input`,{autoFocus:!0,className:`form-control form-control-lg`,id:`credential`,type:a?`text`:`password`,autoComplete:a?`one-time-code`:`current-password`,spellCheck:`false`,autoCapitalize:`none`,value:a?r:t,disabled:d||p,onChange:e=>a?i(e.target.value):n(e.target.value),required:!0}),a&&(0,E.jsx)(`div`,{className:`mt-3 ${s<15?`text-danger`:`text-secondary`}`,"aria-live":`polite`,children:s?`${s}s remaining`:`Code expired. Unblock your IP through the CLI to try again.`}),(0,E.jsx)(`button`,{className:`btn btn-primary w-100 mt-4`,disabled:d||p||a&&!s,children:d?`Please wait…`:a?`Verify and open dashboard`:`Continue with Telegram`})]}),(0,E.jsx)(`p`,{className:`login-note`,children:a?`An incorrect or expired code blocks this IP until it is unblocked through the CLI.`:`Three incorrect passwords block this IP. Successful sessions last up to 30 days.`})]}),(0,E.jsx)(`small`,{className:`text-secondary`,children:`Traffic recording continues while this console is asleep.`})]})}function pt({rows:e=[],label:t,onSelect:n}){let r=Math.max(1,...e.map(e=>e.calls));return e.length?(0,E.jsx)(`div`,{className:`rankings`,children:e.slice(0,8).map((e,i)=>(0,E.jsxs)(`button`,{className:`ranking`,onClick:()=>n?.(e.value,e),children:[(0,E.jsx)(`span`,{className:`rank-index`,children:String(i+1).padStart(2,`0`)}),(0,E.jsxs)(`span`,{className:`rank-name`,title:String(e.label||e.value),children:[e.label||e.value||`Unspecified`,(0,E.jsx)(ue,{value:e.calls,max:r,label:`${t}: ${e.value}`})]}),(0,E.jsx)(`strong`,{children:C(e.calls)})]},`${e.value}-${i}`))}):(0,E.jsx)(D,{})}function mt({overview:e,timeline:t,onFilter:n,onDetail:r,onZoom:i}){let a=e.data||{},o=t.data||{},s=a.breakdowns||{},c=a.latest_metrics||{},l=[[`Origin requests`,C(a.calls),`${C(a.unique_ips)} unique IPs`],[`Request rate`,C(a.requests_per_second,1),`requests / second`],[`P95 latency`,a.latency_ms?.p95==null?`—`:`${C(a.latency_ms.p95,1)} ms`,`histogram estimate`],[`Cache hit rate`,a.cache_hit_ratio==null?`—`:`${C(a.cache_hit_ratio*100,1)}%`,`${C(a.cache_hits)} origin cache hits`],[`Errors`,C(a.errors),`${C(a.rate_limited)} rate limited`]];return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Je,{report:e,label:`Request totals`,children:(0,E.jsx)(`div`,{className:`metric-grid`,children:l.map(([e,t,n])=>(0,E.jsxs)(`div`,{className:`metric panel`,children:[(0,E.jsx)(`span`,{children:e}),(0,E.jsx)(`strong`,{children:t}),(0,E.jsx)(`small`,{children:n})]},e))})}),(0,E.jsxs)(`div`,{className:`overview-grid`,children:[(0,E.jsx)(O,{className:`flow-panel`,title:`Request flow`,detail:`Origin traffic over the selected period`,actions:(0,E.jsxs)(le,{tone:`info`,children:[w(a.bytes),` transferred`]}),children:(0,E.jsx)(Je,{report:t,label:`Request flow`,children:(0,E.jsx)(re,{label:`Origin requests and errors by time`,height:310,onZoom:i,option:ae(o.series||[],[[`calls`,`Requests`],[`errors`,`Errors`]],{zoom:!0})})})}),e.data&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O,{title:`Access breakdown`,detail:`Credential state at the origin`,children:(0,E.jsx)(re,{label:`Anonymous, authenticated and rejected request breakdown`,option:oe(s.auth||[]),height:310})}),(0,E.jsx)(O,{className:`endpoints-panel`,title:`API endpoints`,detail:`Select an endpoint to inspect its traffic`,children:(0,E.jsx)(k,{rows:s.endpoint||s.domain||[],onSelect:e=>n(`endpoint`,e.value,e.filters),columns:[{key:`value`,label:`Endpoint`},{key:`calls`,label:`Requests`,render:e=>C(e.calls)},{key:`errors`,label:`Errors`,render:e=>C(e.errors)},{key:`bytes`,label:`Transfer`,render:e=>w(e.bytes)}]})}),(0,E.jsx)(O,{title:`Response codes`,detail:`Failures and rate limits`,children:(0,E.jsx)(pt,{rows:s.status||[],label:`Response status`,onSelect:(e,t)=>n(`status`,e,Ze(`status`,t))})}),(0,E.jsx)(O,{title:`Popular translations`,detail:`Successful origin requests`,children:(0,E.jsx)(pt,{rows:s.translation||[],label:`Translation`,onSelect:(e,t)=>n(`translation`,e,Ze(`translation`,t))})}),(0,E.jsx)(O,{title:`Frequent searches`,detail:`Successful origin requests`,children:(0,E.jsx)(pt,{rows:s.search||[],label:`Search`,onSelect:(e,t)=>n(`search`,e,Ze(`search`,t))})}),(0,E.jsx)(O,{title:`Scripture references`,detail:`Successful origin requests`,children:(0,E.jsx)(pt,{rows:s.reference||[],label:`Reference`,onSelect:(e,t)=>n(`reference`,e,Ze(`reference`,t))})}),(0,E.jsx)(O,{title:`Books of the Bible`,detail:`Successful origin requests`,children:(0,E.jsx)(pt,{rows:s.book||[],label:`Book`,onSelect:(e,t)=>n(`book`,e,Ze(`book`,t))})}),(0,E.jsx)(O,{title:`Active IP addresses`,detail:`Inspect high-volume origin consumers`,children:(0,E.jsx)(pt,{rows:s.ip||[],label:`Client IP`,onSelect:(e,t)=>n(`ip`,e,Ze(`ip`,t))})}),(0,E.jsx)(O,{title:`Referrers`,detail:`Origin requests, including errors`,children:(0,E.jsx)(pt,{rows:s.referrer||[],label:`Referrer`,onSelect:(e,t)=>n(`referrer`,e,t.filters)})}),(0,E.jsx)(O,{title:`User agents`,detail:`Origin requests, including errors`,children:(0,E.jsx)(pt,{rows:s.user_agent||[],label:`User agent`,onSelect:(e,t)=>n(`user_agent`,e,t.filters)})}),(0,E.jsx)(O,{title:`Collector health`,detail:`Continuous capture, independent of this dashboard`,children:(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Available history`}),(0,E.jsx)(`strong`,{children:T(a.retention?.first_request)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Last sample`}),(0,E.jsx)(`strong`,{children:T(c.stamp)})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Observed scope`}),(0,E.jsx)(`strong`,{children:`Origin only`})]}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary btn-sm`,onClick:()=>r(`Retention and capture health`,a.retention||{}),children:`Retention details`})]})})]})]})]})}function ht({filters:e,setFilters:t,range:n,live:r,onError:i,onDetail:a}){let[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(n),[m,h]=(0,_.useState)(e);(0,_.useEffect)(()=>{h(e),l(``),d([])},[e]),(0,_.useEffect)(()=>{let t=new AbortController,a=!1,o;async function l(){let u=r&&!c?Math.floor(Date.now()/1e3):c?f.end:n.end,d=r&&!c?u-900:c?f.start:n.start;try{let i=await x(`requests?${S({start:d,end:u,...e,cursor:c,limit:100})}`,{signal:t.signal});a||(s(i),c||p({start:r?u-900:n.start,end:u}))}catch(e){!a&&e.name!==`AbortError`&&i(e)}!a&&r&&!c&&(o=setTimeout(l,2e3))}return l(),()=>{a=!0,clearTimeout(o),t.abort()}},[e,n.start,n.end,c,r]);function g(e){e.preventDefault(),t(m)}let v=m.endpoint_kind===`mcp`,y=ut(o,`requests`),b=e.endpoint_kind===`mcp`||y.some(e=>e.endpoint_kind===`mcp`),ee=[[`endpoint`,v?`MCP domain`:`Endpoint`],[`ip`,`Client IP`],...v?$e:[[`version`,`Version`],[`translation`,`Translation`],[`reference`,`Reference`],[`search`,`Search query`],[`book`,`Book number`]],[`status`,`HTTP status`],[`referrer`,`Exact referrer`],[`user_agent`,`Exact user agent`],[`referrer_contains`,`Referrer contains`],[`user_agent_contains`,`User agent contains`],[`path_contains`,`Request path contains`],[`q`,`Search recorded request data`]];return(0,E.jsxs)(O,{title:`Request explorer`,detail:`Inspect recorded request details; credentials are excluded`,children:[(0,E.jsxs)(`form`,{className:`filter-grid`,onSubmit:g,children:[ee.map(([e,t])=>(0,E.jsxs)(`label`,{children:[t,(0,E.jsx)(`input`,{className:`form-control form-control-sm`,value:m[e]||``,onChange:t=>h(at(m,e,t.target.value))})]},e)),(0,E.jsxs)(`label`,{children:[`Endpoint kind`,(0,E.jsxs)(`select`,{"aria-label":`Endpoint kind`,className:`form-select form-select-sm`,value:m.endpoint_kind||``,onChange:e=>h(at(m,`endpoint_kind`,e.target.value)),children:[(0,E.jsx)(`option`,{value:``,children:`All kinds`}),(0,E.jsx)(`option`,{value:`static`,children:`Static API`}),(0,E.jsx)(`option`,{value:`query`,children:`Query`}),(0,E.jsx)(`option`,{value:`search`,children:`Search`}),(0,E.jsx)(`option`,{value:`mcp`,children:`MCP`})]})]}),v&&(0,E.jsxs)(`label`,{children:[`MCP outcome`,(0,E.jsxs)(`select`,{"aria-label":`MCP outcome`,className:`form-select form-select-sm`,value:m.mcp_outcome||``,onChange:e=>h(at(m,`mcp_outcome`,e.target.value)),children:[(0,E.jsx)(`option`,{value:``,children:`All outcomes`}),et.map(e=>(0,E.jsx)(`option`,{value:e,children:e.replaceAll(`_`,` `)},e))]})]}),(0,E.jsxs)(`label`,{children:[`Responses`,(0,E.jsxs)(`select`,{"aria-label":`Responses`,className:`form-select form-select-sm`,value:m.successful||``,onChange:e=>h(at(m,`successful`,e.target.value)),children:[(0,E.jsx)(`option`,{value:``,children:`All responses`}),(0,E.jsx)(`option`,{value:`true`,children:`Successful responses`})]})]}),(0,E.jsxs)(`label`,{children:[`Authentication`,(0,E.jsxs)(`select`,{"aria-label":`Authentication`,className:`form-select form-select-sm`,value:m.auth||``,onChange:e=>h({...m,auth:e.target.value}),children:[(0,E.jsx)(`option`,{value:``,children:`All traffic`}),(0,E.jsx)(`option`,{value:`anonymous`,children:`Anonymous`}),(0,E.jsx)(`option`,{value:`valid`,children:`Authenticated`}),(0,E.jsx)(`option`,{value:`rejected`,children:`Rejected credential`})]})]}),(0,E.jsxs)(`div`,{className:`d-flex gap-2 align-items-end`,children:[(0,E.jsx)(`button`,{className:`btn btn-primary btn-sm`,children:`Apply filters`}),(0,E.jsx)(`button`,{type:`button`,className:`btn btn-outline-secondary btn-sm`,onClick:()=>{h({}),t({})},children:`Clear`})]})]}),o?(0,E.jsx)(k,{rows:y,onSelect:e=>a(`Request details`,e),columns:[{key:`timestamp`,label:`Time`,render:e=>T(e.stamp)},{key:`endpoint`,label:`Endpoint`},{key:`method`,label:`Method`},{key:`path`,label:`Request`,render:e=>(0,E.jsx)(`span`,{className:`truncate`,title:e.path,children:e.path})},{key:`status`,label:`Status`,render:e=>(0,E.jsx)(le,{tone:it(e)?`warning`:`success`,children:e.status})},{key:`duration_ms`,label:`Latency`,render:e=>`${C(e.duration_ms,1)} ms`},...b?[{key:`mcp_method`,label:`MCP operation`,render:e=>e.mcp_method?(0,E.jsxs)(`span`,{className:`consumer-value`,children:[e.mcp_method,e.mcp_tool&&(0,E.jsx)(`small`,{className:`d-block`,children:e.mcp_tool}),e.upstream_operation&&(0,E.jsx)(`small`,{className:`d-block`,children:[e.upstream_service,e.upstream_api_version,e.upstream_operation].filter(Boolean).join(` · `)})]}):`—`},{key:`mcp_outcome`,label:`MCP outcome`,render:e=>e.endpoint_kind===`mcp`?(0,E.jsx)(le,{tone:it(e)?`warning`:e.mcp_outcome===`success`?`success`:`muted`,children:(e.mcp_outcome||`unknown`).replaceAll(`_`,` `)}):`—`},{key:`mcp_client_name`,label:`Declared MCP client`,render:e=>e.mcp_client_name?(0,E.jsxs)(`span`,{className:`consumer-value`,children:[e.mcp_client_name,e.mcp_client_version&&(0,E.jsx)(`small`,{className:`d-block`,children:e.mcp_client_version})]}):`—`}]:[],{key:`remote_addr`,label:`Client IP`},{key:`referrer`,label:`Referrer`,render:n=>n.referrer?(0,E.jsx)(`button`,{className:`table-link truncate`,title:n.referrer,onClick:()=>t({...e,referrer:n.referrer}),children:n.referrer}):`—`},{key:`user_agent`,label:`User agent`,render:n=>n.user_agent?(0,E.jsx)(`button`,{className:`table-link truncate`,title:n.user_agent,onClick:()=>t({...e,user_agent:n.user_agent}),children:n.user_agent}):`—`},{key:`auth`,label:`Auth`}]}):(0,E.jsx)(ce,{}),(0,E.jsxs)(`div`,{className:`table-footer`,children:[(0,E.jsx)(`small`,{children:`Latest captures first · up to 100 requests per page`}),(0,E.jsxs)(`div`,{className:`btn-group`,children:[(0,E.jsx)(`button`,{className:`btn btn-outline-secondary btn-sm`,disabled:!u.length,onClick:()=>{l(u.at(-1)),d(u.slice(0,-1))},children:`Previous`}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary btn-sm`,disabled:!o?.next_cursor,onClick:()=>{d([...u,c]),l(o.next_cursor)},children:`Next`})]})]})]})}function gt({range:e,live:t,onError:n,onDetail:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let r=!1,i,s=new AbortController;async function c(){let l=t&&!o?Math.floor(Date.now()/1e3):o?u.end:e.end;try{let n=await x(`events?${S({start:t?l-900:e.start,end:l,cursor:o,limit:100})}`,{signal:s.signal});r||(a(n),o||d({start:t?l-900:e.start,end:l}))}catch(e){!r&&e.name!==`AbortError`&&n(e)}!r&&t&&!o&&(i=setTimeout(c,2e3))}return c(),()=>{r=!0,clearTimeout(i),s.abort()}},[e.start,e.end,t,o]),(0,E.jsxs)(O,{title:`Operational events`,detail:`Service messages, alerts, synchronization and management audit records`,children:[i?(0,E.jsx)(k,{rows:ut(i,`items`),onSelect:e=>r(`Event details`,e),columns:[{key:`stamp`,label:`Time`,render:e=>T(e.stamp)},{key:`endpoint`,label:`Endpoint`},{key:`event`,label:`Event`,render:e=>e.event||e.payload?.event||e.source},{key:`level`,label:`Level`,render:e=>e.level||e.payload?.level||`info`},{key:`message`,label:`Message`,render:e=>(0,E.jsx)(`span`,{className:`truncate`,children:e.message||e.payload?.message||e.payload?.MESSAGE||``})}]}):(0,E.jsx)(ce,{}),(0,E.jsxs)(`div`,{className:`table-footer`,children:[(0,E.jsx)(`small`,{children:`Latest captures first`}),(0,E.jsxs)(`div`,{className:`btn-group`,children:[(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,disabled:!c.length,onClick:()=>{s(c.at(-1)),l(c.slice(0,-1))},children:`Previous`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,disabled:!i?.next_cursor,onClick:()=>{l([...c,o]),s(i.next_cursor)},children:`Next`})]})]})]})}function _t({report:e,refresh:t,onError:n,onDetail:r,execute:i}){let a=e.data||{},[o,s]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=new AbortController,r=!1;return x(`storage?refresh=${t>0}`,{signal:e.signal}).then(e=>{r||s(e)}).catch(e=>{!r&&e.name!==`AbortError`&&n(e)}),()=>{r=!0,e.abort()}},[t]);let c=a.metrics?.at(-1)||{};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Pe,{refresh:t,execute:i}),(0,E.jsx)(Je,{report:e,label:`Resource metrics`}),(0,E.jsxs)(`div`,{className:`resource-grid`,children:[e.data&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(O,{title:`CPU`,detail:c.scope===`host`?`Host CPU utilization`:`Usage within the container’s effective CPU allowance`,children:[(0,E.jsx)(re,{label:`CPU usage over time`,option:ae((a.metrics||[]).map(e=>({...e,cpu_percent:e.cpu?.used_fraction==null?null:e.cpu.used_fraction*100})),[[`cpu_percent`,`CPU usage %`]])}),(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Current utilization`}),(0,E.jsxs)(`strong`,{children:[C(c.cpu?.used_fraction==null?null:c.cpu.used_fraction*100,1),`%`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Throttled time`}),(0,E.jsxs)(`strong`,{children:[C(c.cpu?.counters?.throttled_usec),` μs`]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Temperature`}),(0,E.jsx)(`strong`,{children:c.temperatures?.length?`${C(Math.max(...c.temperatures.map(e=>e.celsius)),1)} °C`:`Sensor unavailable`})]})]})]}),(0,E.jsxs)(O,{title:`Memory`,detail:c.scope===`host`?`Host memory usage, including other services`:`Measured container usage includes more than translation caches`,children:[(0,E.jsx)(re,{label:`Memory usage over time`,option:ae((a.metrics||[]).map(e=>({...e,memory_gib:e.memory?.current_bytes==null?null:e.memory.current_bytes/1073741824})),[[`memory_gib`,`Memory GiB`]])}),(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Current / limit`}),(0,E.jsxs)(`strong`,{children:[w(c.memory?.current_bytes),` / `,w(c.memory?.limit_bytes)]})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`OOM events`}),(0,E.jsx)(`strong`,{children:C(c.memory?.events?.oom_kill)})]})]})]})]}),(0,E.jsx)(O,{className:`wide`,title:`Persistent storage`,detail:`Mounted data on the host; application budgets do not impose a filesystem quota`,actions:(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:()=>r(`Storage accounting`,o),children:`Inspect accounting`}),children:o?(0,E.jsx)(k,{rows:ut(o,`components`),onSelect:e=>r(`Storage details`,e),columns:[{key:`name`,label:`Data`,render:e=>e.name||e.category||e.path},{key:`bytes`,label:`Allocated`,render:e=>w(e.bytes??e.allocated_bytes)},{key:`limit_bytes`,label:`Budget`,render:e=>e.limit_bytes?w(e.limit_bytes):`—`},{key:`path`,label:`Location`}]}):(0,E.jsx)(ce,{})}),(0,E.jsx)(O,{className:`wide`,title:`Pressure and collection details`,children:(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsx)(`button`,{className:`btn btn-outline-secondary`,onClick:()=>r(`Latest resource sample`,c),children:`Inspect latest resource sample`}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary`,onClick:()=>r(`Retention`,a.retention),children:`Inspect available history and pruning`})]})})]})]})}function vt({initial:e,onError:t,onComplete:n}){let[r,i]=(0,_.useState)(e),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(!1),f=e.job_id||e.id;(0,_.useEffect)(()=>{let e=!1,r,a=1e3;async function o(){try{let t=await x(`jobs/${encodeURIComponent(f)}`);e||(i(t),u(!1),a=1e3,!Qe(t.status)&&!d.current&&(d.current=!0,n?.()),Qe(t.status)&&(r=setTimeout(o,1e3)))}catch(n){e||(!n.status||n.status>=500?(u(!0),r=setTimeout(o,a),a=Math.min(a*2,1e4)):t(n))}}return o(),()=>{e=!0,clearTimeout(r)}},[f]);async function p(){try{let e=await te(`jobs/${encodeURIComponent(f)}/reveal`);o(e.one_time_output||`The one-time output is no longer available.`)}catch(e){t(e)}}return(0,E.jsxs)(E.Fragment,{children:[l&&(0,E.jsx)(`div`,{className:`alert alert-info`,role:`status`,children:`Reconnecting to operation progress… The accepted job continues on the server.`}),(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Operation`}),(0,E.jsx)(`strong`,{children:r.operation||`Starting…`})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Status`}),(0,E.jsx)(le,{tone:r.status===`failed`?`warning`:`info`,children:r.status})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:`Started`}),(0,E.jsx)(`strong`,{children:r.started?T(r.started):`Waiting to start`})]})]}),(0,E.jsx)(`pre`,{className:`record-detail`,children:r.output||`Waiting for operation output…`}),r.secret_available&&!a&&(0,E.jsx)(`button`,{className:`btn btn-warning`,onClick:p,children:`Reveal issued credential once`}),a&&(0,E.jsxs)(`div`,{className:`alert alert-warning`,children:[(0,E.jsx)(`p`,{children:`Copy this credential now. It is shown only once and is not saved in the job history.`}),(0,E.jsx)(`pre`,{className:`record-detail`,children:a}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary`,onClick:async()=>{try{await navigator.clipboard.writeText(a),c(!0)}catch(e){t(e)}},children:s?`Copied`:`Copy credential`})]})]})}function yt({onError:e,refresh:t,onRefresh:n}){let[r,i]=(0,_.useState)(null);(0,_.useEffect)(()=>{x(`sessions`).then(i).catch(e)},[t]);async function a(t){try{await te(`sessions/${encodeURIComponent(t)}/revoke`),n()}catch(t){e(t)}}return(0,E.jsx)(O,{title:`Browser sessions`,detail:`Sleep preserves sessions. Revoking one requires that browser to authenticate again.`,children:r?(0,E.jsx)(k,{rows:ut(r,`sessions`),columns:[{key:`ip`,label:`Client IP`},{key:`user_agent`,label:`Browser`,render:e=>(0,E.jsx)(`span`,{className:`truncate`,title:e.user_agent,children:e.user_agent})},{key:`created_at`,label:`Signed in`,render:e=>T(e.created_at)},{key:`expires_at`,label:`Expires`,render:e=>T(e.expires_at)},{key:`action`,label:`Access`,render:e=>(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-danger`,onClick:()=>a(e.id),children:`Revoke session`})}]}):(0,E.jsx)(ce,{})})}function bt(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(`Overview`),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(0),[u,d]=(0,_.useState)(()=>localStorage.getItem(`getbible-theme`)||`system`),[f,p]=(0,_.useState)(`24 hours`),[m,h]=(0,_.useState)({start:``,end:``}),[g,v]=(0,_.useState)({}),[y,b]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,ne]=(0,_.useState)(!1),re=(0,_.useRef)(!1),[ie,ae]=(0,_.useState)(null),[oe,D]=(0,_.useState)(0),[ue,k]=(0,_.useState)(null),[de,fe]=(0,_.useState)(`initializing`),[pe,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(()=>Math.floor(Date.now()/1e3)),_e=(0,_.useRef)(crypto.randomUUID()),A=(0,_.useCallback)(e=>{e.status===401?(ee(``),t({authenticated:!1})):r(e)},[]),ve=(0,_.useMemo)(()=>f===`Custom`&&m.start&&m.end?{start:Math.floor(new Date(m.start).getTime()/1e3),end:Math.floor(new Date(m.end).getTime()/1e3)}:{start:he-(lt[f]||86400),end:he},[f,he,m]);(0,_.useEffect)(()=>{x(`auth/status`).then(t).catch(A)},[]),(0,_.useEffect)(()=>{e?.authenticated||(b(null),C(null),fe(`initializing`),k(null))},[e?.authenticated]),(0,_.useEffect)(()=>{let e=matchMedia(`(prefers-color-scheme: dark)`),t=()=>{document.documentElement.dataset.bsTheme=u===`system`?e.matches?`dark`:`light`:u};return t(),localStorage.setItem(`getbible-theme`,u),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[u]),(0,_.useEffect)(()=>{if(!e?.authenticated)return;let t=!1,n;async function r(){try{let e=await te(`dashboard/heartbeat`,{viewer_id:_e.current});t||fe(e.state===`awake`?`ready`:e.state)}catch(e){t||A(e)}t||(n=setTimeout(r,15e3))}r();let i=()=>{document.visibilityState===`visible`&&(clearTimeout(n),r())};return document.addEventListener(`visibilitychange`,i),()=>{t=!0,clearTimeout(n),document.removeEventListener(`visibilitychange`,i)}},[e?.authenticated]),(0,_.useEffect)(()=>{if(!e?.authenticated||de===`ready`)return;let t=!1,n;async function i(){try{let e=await x(`dashboard/state`);if(t)return;if(e.state===`awake`){fe(`ready`),r(e=>e?.historyUnavailable?null:e);return}e.state===`unavailable`&&fe(`unavailable`),e.error&&r(Object.assign(Error(e.error),{historyUnavailable:e.state===`unavailable`}))}catch(e){t||A(e)}t||(n=setTimeout(i,1e3))}return i(),()=>{t=!0,clearTimeout(n)}},[e?.authenticated,de]);let ye=(0,_.useCallback)(()=>k(new Date),[]),j=qe({page:[`Overview`,`Resources`].includes(i)?i:``,range:ve,live:f===`Live`,filters:i===`Overview`?g:void 0,refresh:oe,enabled:e?.authenticated&&de===`ready`&&(f!==`Custom`||!!(m.start&&m.end)),onError:A,onUpdate:ye}),M=j.overview?.data;function be({start:e,end:t}){if(!(t>e))return;let n=e=>{let t=new Date(e*1e3);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,19)};h({start:n(e),end:n(t)}),p(`Custom`)}function xe(e,t){b({title:e,value:t})}function Se(e,t,n){v({...g,...n||{[e]:t}}),a(`Traffic`)}function Ce(){ge(Math.floor(Date.now()/1e3)),D(e=>e+1)}async function N(){if(!re.current){re.current=!0,ne(!0),ae(null);try{let e=await te(`actions`,{operation:S.operation,arguments:S.arguments,confirm:!0});C(null),xe(`Operation details`,{...e,job_id:e.job_id||e.id}),Ce()}catch(e){ae(e),A(e)}finally{re.current=!1,ne(!1)}}}return e?e.authenticated?(0,E.jsxs)(`div`,{className:`console`,children:[(0,E.jsxs)(`aside`,{className:`sidebar ${pe?`expanded`:``}`,children:[(0,E.jsxs)(`a`,{className:`brand`,href:`#overview`,onClick:e=>{e.preventDefault(),a(`Overview`)},children:[(0,E.jsx)(`img`,{src:`/favicon.png`,alt:``}),(0,E.jsxs)(`span`,{children:[`getBible`,(0,E.jsx)(`small`,{children:`OPERATIONS`})]})]}),(0,E.jsx)(`div`,{className:`workspace-label`,children:`SERVER CONSOLE`}),(0,E.jsx)(`nav`,{"aria-label":`Main navigation`,children:ct.map((e,t)=>(0,E.jsxs)(`button`,{className:i===e?`active`:``,"aria-current":i===e?`page`:void 0,"aria-label":e,onClick:()=>{a(e),e===`MCP traffic`&&v(rt(g)),e===`Manage`&&(s(``),l(e=>e+1)),me(!1)},children:[(0,E.jsx)(`span`,{className:`nav-number`,children:String(t+1).padStart(2,`0`)}),e]},e))}),(0,E.jsxs)(`div`,{className:`sidebar-bottom`,children:[(0,E.jsx)(`span`,{className:`eyebrow`,children:`CONSOLE STATE`}),(0,E.jsx)(`strong`,{children:de===`ready`?`Connected`:de===`unavailable`?`History unavailable`:`Initializing`}),(0,E.jsx)(`small`,{children:`Traffic is recorded continuously.`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:async()=>{try{await te(`auth/logout`),t({authenticated:!1}),ee(``)}catch(e){A(e)}},children:`Sign out`})]})]}),(0,E.jsxs)(`div`,{className:`main-area`,children:[(0,E.jsxs)(`header`,{className:`topbar`,children:[(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary mobile-menu`,onClick:()=>me(!pe),"aria-label":`Toggle navigation`,children:`Menu`}),(0,E.jsxs)(`span`,{className:`breadcrumb-text`,children:[`getBible `,(0,E.jsx)(`span`,{children:`/`}),` `,i]}),(0,E.jsxs)(`div`,{className:`topbar-controls`,children:[(0,E.jsx)(`small`,{className:`last-updated`,children:ue?`Updated ${ue.toLocaleTimeString()}`:`Initializing…`}),(0,E.jsx)(`button`,{className:`btn btn-sm btn-outline-secondary`,onClick:Ce,title:`Refresh all dashboard data and locally cached metadata`,children:`Refresh all`}),(0,E.jsx)(`label`,{className:`visually-hidden`,htmlFor:`theme`,children:`Color theme`}),(0,E.jsxs)(`select`,{id:`theme`,className:`form-select form-select-sm theme-select`,value:u,onChange:e=>d(e.target.value),children:[(0,E.jsx)(`option`,{value:`system`,children:`System theme`}),(0,E.jsx)(`option`,{value:`dark`,children:`Dark`}),(0,E.jsx)(`option`,{value:`light`,children:`Light`})]})]})]}),(0,E.jsxs)(`main`,{className:`content`,children:[(0,E.jsxs)(`div`,{className:`page-heading`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{className:`eyebrow`,children:i===`Overview`?`YOUR API AT A GLANCE`:`GETBIBLE OPERATIONS`}),(0,E.jsx)(`h1`,{children:i===`Overview`?`Traffic & performance`:i})]}),(0,E.jsxs)(`div`,{className:`range-picker`,children:[(0,E.jsx)(`label`,{className:`visually-hidden`,htmlFor:`period`,children:`Time range`}),(0,E.jsx)(`select`,{className:`form-select`,id:`period`,value:f,onChange:e=>{p(e.target.value),ge(Math.floor(Date.now()/1e3))},children:[...Object.keys(lt),`Custom`].map(e=>(0,E.jsx)(`option`,{children:e},e))}),f===`Live`&&(0,E.jsx)(le,{tone:`success`,children:`LIVE`})]})]}),f===`Custom`&&(0,E.jsxs)(`div`,{className:`custom-range`,children:[(0,E.jsxs)(`label`,{children:[`From`,(0,E.jsx)(`input`,{className:`form-control`,type:`datetime-local`,step:`1`,value:m.start,onChange:e=>h({...m,start:e.target.value})})]}),(0,E.jsxs)(`label`,{children:[`Until`,(0,E.jsx)(`input`,{className:`form-control`,type:`datetime-local`,step:`1`,value:m.end,onChange:e=>h({...m,end:e.target.value})})]}),(0,E.jsx)(`small`,{children:`Times use your browser's local time zone.`})]}),(0,E.jsx)(se,{error:n,dismiss:()=>r(null)}),M?.retention?.first_request>ve.start&&(0,E.jsxs)(`div`,{className:`alert alert-info py-2`,children:[`Available request history starts `,T(M.retention.first_request),`. Earlier time in this selection has no retained detail.`]}),Object.entries(g).filter(([,e])=>e).length>0&&(0,E.jsxs)(`div`,{className:`filter-chips`,children:[Object.entries(g).filter(([,e])=>e).map(([e,t])=>(0,E.jsxs)(`button`,{className:`btn btn-sm btn-outline-info`,onClick:()=>{let t={...g};delete t[e],v(t)},children:[e,`: `,String(t),` `,(0,E.jsx)(`span`,{"aria-label":`Remove filter`,children:`×`})]},e)),(0,E.jsx)(`button`,{className:`btn btn-sm btn-link`,onClick:()=>v({}),children:`Clear all`})]}),de!==`ready`&&![`Manage`,`Translations`,`Resources`,`Sessions`].includes(i)?de===`unavailable`?(0,E.jsx)(O,{title:`Traffic history needs attention`,detail:`Server management remains available while traffic history is unavailable.`,children:(0,E.jsxs)(`div`,{className:`fact-list`,children:[(0,E.jsx)(`p`,{children:`Review the reported history error. To start fresh after an incompatible history format, open Logs, then History, and review the reset operation.`}),(0,E.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>{s(`logs`),a(`Manage`)},children:`Manage traffic history`})]})}):(0,E.jsx)(ce,{children:`Initializing dashboard…`}):i===`Overview`?(0,E.jsx)(mt,{overview:j.overview,timeline:j.history,onFilter:Se,onDetail:xe,onZoom:be}):i===`Traffic`?(0,E.jsx)(ht,{live:f===`Live`,filters:g,setFilters:v,range:ve,onError:A,onDetail:xe},JSON.stringify([ve,g,f,oe])):i===`MCP traffic`?(0,E.jsx)(st,{range:ve,live:f===`Live`,filters:g,refresh:oe,onFilter:Se,onError:A,onZoom:be}):i===`Audience`?(0,E.jsx)(Xe,{range:ve,live:f===`Live`,filters:g,refresh:oe,onFilter:Se,onError:A}):i===`Translations`?(0,E.jsx)(Ue,{onError:A,execute:(e,t,n)=>(ae(null),C({operation:e,arguments:t,review:n})),onDetail:xe,refresh:oe}):i===`Resources`?(0,E.jsx)(_t,{report:j.metrics,refresh:oe,onError:A,onDetail:xe,execute:(e,t,n)=>(ae(null),C({operation:e,arguments:t,review:n}))}):i===`Events`?(0,E.jsx)(gt,{range:ve,live:f===`Live`,onError:A,onDetail:xe},JSON.stringify([ve,f,oe])):i===`Manage`?(0,E.jsx)(je,{initialSection:o,execute:(e,t,n)=>(ae(null),C({operation:e,arguments:t,review:n})),onError:A,onDetail:xe,refresh:oe},`${o||`manage`}:${c}`):(0,E.jsx)(yt,{onError:A,refresh:oe,onRefresh:Ce}),(0,E.jsx)(`footer`,{children:`Origin observations · CDN cache hits served before this server are outside this view.`})]})]}),y&&(0,E.jsx)(dt,{title:y.title,value:y.value,onClose:()=>b(null),children:y.title===`Operation details`?(0,E.jsx)(vt,{initial:y.value,onError:A,onComplete:Ce}):void 0}),S&&(0,E.jsxs)(dt,{title:`Review operation`,onClose:()=>C(null),children:[(0,E.jsx)(se,{error:ie}),(0,E.jsx)(`p`,{children:S.review?.title||`The following operation will run on this server.`}),S.review?.description&&(0,E.jsx)(`p`,{className:`text-secondary`,children:S.review.description}),(0,E.jsx)(`pre`,{className:`record-detail`,children:JSON.stringify({operation:S.operation,arguments:Object.fromEntries(Object.entries(S.arguments).map(([e,t])=>[e,/password|token|secret|credential/i.test(e)?`[hidden]`:e===`content`?`[content supplied]`:t]))},null,2)}),(0,E.jsxs)(`div`,{className:`d-flex gap-2`,children:[(0,E.jsx)(`button`,{className:`btn btn-primary`,disabled:w,onClick:N,children:w?`Submitting…`:`Run operation`}),(0,E.jsx)(`button`,{className:`btn btn-outline-secondary`,"data-bs-dismiss":`modal`,children:`Cancel`})]})]})]}):(0,E.jsx)(ft,{onLogin:t}):(0,E.jsxs)(`main`,{className:`login-page`,children:[(0,E.jsx)(ce,{children:`Connecting to your server…`}),(0,E.jsx)(se,{error:n})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(bt,{})); \ No newline at end of file diff --git a/src/apps/dashboard/static/index.html b/src/apps/dashboard/static/index.html index b5cf1b7..4e386a3 100644 --- a/src/apps/dashboard/static/index.html +++ b/src/apps/dashboard/static/index.html @@ -10,7 +10,7 @@ - + diff --git a/src/apps/dashboard/ui/package-lock.json b/src/apps/dashboard/ui/package-lock.json index a7fecc6..abbc149 100644 --- a/src/apps/dashboard/ui/package-lock.json +++ b/src/apps/dashboard/ui/package-lock.json @@ -15,16 +15,16 @@ "@vitejs/plugin-react": "6.1.2", "bootstrap": "5.3.8", "echarts": "6.1.0", - "vite": "8.3.4" + "vite": "8.3.5" }, "engines": { "node": ">=22.12" } }, "node_modules/@oxc-project/types": { - "version": "0.152.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.152.0.tgz", - "integrity": "sha512-oM/5rLBm2tPkg0iBgkH/FOeR3PCDpY19GTgAZjMFM8h9WI9VW7cLgzp6nwtarYKmovavIQZ+Fe/RKX/8C8O/Rw==", + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz", + "integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==", "dev": true, "license": "MIT", "funding": { @@ -44,9 +44,9 @@ } }, "node_modules/@rolldown/binding-android-arm-eabi": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.12.tgz", - "integrity": "sha512-dB/a1214qKfHMXCpgqR4OZT+jS4kTyEXbQGJPqzobt5EwH5rX080pxE37alt3RzvR1bf1Yz/yGqRfrYAxuPw0A==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz", + "integrity": "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==", "cpu": [ "arm" ], @@ -61,9 +61,9 @@ } }, "node_modules/@rolldown/binding-android-arm64": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.12.tgz", - "integrity": "sha512-7KHFgQ5VJxIHcLlrwrc3Xbds7oTNQT7Pgi9gQCJKrd2VGab/UksIOYp6VD8MzCstGxOKMgNamPwUCfxPdP1OHg==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz", + "integrity": "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==", "cpu": [ "arm64" ], @@ -78,9 +78,9 @@ } }, "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.12.tgz", - "integrity": "sha512-3YIhqHD96nA5SaYNRBR16HnGv4oavZvXfD/ayHM+oYZ0WD/8lBAtf6zQua4kEyAvpqrluKXl0lnOBoiNby7x9w==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz", + "integrity": "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==", "cpu": [ "arm64" ], @@ -95,9 +95,9 @@ } }, "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.12.tgz", - "integrity": "sha512-UuuJ35MFw4gmFOrE9pEqIV+K3syIKveph+Qc1/ljHZVdoDW4pz/JHR/eMVom+TZGl/5OOvGJOWaOCVt3ZfqhxA==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz", + "integrity": "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==", "cpu": [ "x64" ], @@ -112,9 +112,9 @@ } }, "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.12.tgz", - "integrity": "sha512-uMvssit0a4W+/7D8CbHUvG719mH3R2jwXAlh/XcPvuHTE0g++LymF88DCGNX0HM2rBOn0xrzgXktIB6fLSJBTQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz", + "integrity": "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==", "cpu": [ "x64" ], @@ -129,9 +129,9 @@ } }, "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.12.tgz", - "integrity": "sha512-XcFu0R0xWnwzSf4IQgFH1rJIckPN1pLy2R+4r9IDB7Yfu/ys9cVqfa4pBrMHj7a3gl8mIR4nRNPg0e5IvEVs6g==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz", + "integrity": "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==", "cpu": [ "arm" ], @@ -146,9 +146,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.12.tgz", - "integrity": "sha512-260UrKgn8tz39ak+SMDOirKzr7V04M9dWPw5llW00SwBivCZoWcRBKV1d8cXnRkUmSZA3BdiUmBHWk7734Ulpw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz", + "integrity": "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==", "cpu": [ "arm64" ], @@ -166,9 +166,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.12.tgz", - "integrity": "sha512-5YK1I9SqDkbPgc1IA8BgDl34suqUS2q0KWnBrirm0E51YjOs6eo6dV6jbQfNE/argHRSvd0QUGgtpIoYx+WWpw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz", + "integrity": "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==", "cpu": [ "arm64" ], @@ -186,9 +186,9 @@ } }, "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.12.tgz", - "integrity": "sha512-Rkcrmp7eFRg74yL5fXEU91JEWbdEPLevWwGtXpmhbjlD1StScbWTmO94Bhly+Mo+ketKYkdmM1vNUKeWSlx8cQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz", + "integrity": "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==", "cpu": [ "ppc64" ], @@ -206,9 +206,9 @@ } }, "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.12.tgz", - "integrity": "sha512-qvK4DuAsQc2BSjlx+Xr+IzOIvvxbGZqxFwdWfG6F518Erj0GGISyQbJ6pIappnOxlNPzNHvo/L0BwB30GZ+zVw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz", + "integrity": "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==", "cpu": [ "s390x" ], @@ -226,9 +226,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.12.tgz", - "integrity": "sha512-Q9uLBO53Xd4QIq1WOycVQyPP1O4HhraEV2qqb3uTrnVw6QZih9duY4vNXOivL1xoUS1/z+W8eF4NMfl2a8Sdjw==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz", + "integrity": "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==", "cpu": [ "x64" ], @@ -246,9 +246,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.12.tgz", - "integrity": "sha512-3IBxWFMjbOZskDPKv8Lf9BCnahlKuHthWkYnyIxOH/QcJrFcS4EmcenthApkwr/5+nEqZlLzeYbxeMaX7A5u4g==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz", + "integrity": "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==", "cpu": [ "x64" ], @@ -266,9 +266,9 @@ } }, "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.12.tgz", - "integrity": "sha512-xtX61xg4LKPkPWilZU1ynKClz5Gj4bf74LML4r3eVLWumKnGjoEr1OSHQhMdbBDoYTi+yjrujvpZe2pUnqCrrA==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz", + "integrity": "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==", "cpu": [ "arm64" ], @@ -283,9 +283,9 @@ } }, "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.12.tgz", - "integrity": "sha512-At7fPB6PCaIjzgIhEZFxuT+BBFqiQibJDT4d3PhiR3f4E7bbMZF4aKblbFfEM3sETRDd1YiQx/+U/g/B/ou5Ew==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz", + "integrity": "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==", "cpu": [ "arm64" ], @@ -300,9 +300,9 @@ } }, "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.12.tgz", - "integrity": "sha512-WIw2haVKwjuYdXkHaoC0mF8Le71TuCBxjrdKqLbJGctbBABj+ClfmNvtbOnzpq3RokNo5+V1qhtSzJyXorsklQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz", + "integrity": "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==", "cpu": [ "x64" ], @@ -797,13 +797,13 @@ } }, "node_modules/rolldown": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.12.tgz", - "integrity": "sha512-8wafseiaG80xmXSfqidUNqZcylTlhmPZZt+za2m+js2sFZ8dTNlhIOV2WcbIPx2hgwPBJpEUGFAMZ9bgBBLTSQ==", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.15.tgz", + "integrity": "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==", "dev": true, "license": "MIT", "dependencies": { - "@oxc-project/types": "=0.152.0", + "@oxc-project/types": "=0.155.0", "@rolldown/pluginutils": "^1.0.0" }, "bin": { @@ -813,21 +813,21 @@ "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rolldown/binding-android-arm-eabi": "1.2.12", - "@rolldown/binding-android-arm64": "1.2.12", - "@rolldown/binding-darwin-arm64": "1.2.12", - "@rolldown/binding-darwin-x64": "1.2.12", - "@rolldown/binding-freebsd-x64": "1.2.12", - "@rolldown/binding-linux-arm-gnueabihf": "1.2.12", - "@rolldown/binding-linux-arm64-gnu": "1.2.12", - "@rolldown/binding-linux-arm64-musl": "1.2.12", - "@rolldown/binding-linux-ppc64-gnu": "1.2.12", - "@rolldown/binding-linux-s390x-gnu": "1.2.12", - "@rolldown/binding-linux-x64-gnu": "1.2.12", - "@rolldown/binding-linux-x64-musl": "1.2.12", - "@rolldown/binding-openharmony-arm64": "1.2.12", - "@rolldown/binding-win32-arm64-msvc": "1.2.12", - "@rolldown/binding-win32-x64-msvc": "1.2.12" + "@rolldown/binding-android-arm-eabi": "1.2.15", + "@rolldown/binding-android-arm64": "1.2.15", + "@rolldown/binding-darwin-arm64": "1.2.15", + "@rolldown/binding-darwin-x64": "1.2.15", + "@rolldown/binding-freebsd-x64": "1.2.15", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.15", + "@rolldown/binding-linux-arm64-gnu": "1.2.15", + "@rolldown/binding-linux-arm64-musl": "1.2.15", + "@rolldown/binding-linux-ppc64-gnu": "1.2.15", + "@rolldown/binding-linux-s390x-gnu": "1.2.15", + "@rolldown/binding-linux-x64-gnu": "1.2.15", + "@rolldown/binding-linux-x64-musl": "1.2.15", + "@rolldown/binding-openharmony-arm64": "1.2.15", + "@rolldown/binding-win32-arm64-msvc": "1.2.15", + "@rolldown/binding-win32-x64-msvc": "1.2.15" } }, "node_modules/scheduler": { @@ -864,16 +864,16 @@ } }, "node_modules/vite": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz", - "integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==", + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.5.tgz", + "integrity": "sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==", "dev": true, "license": "MIT", "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.7", - "postcss": "^8.5.29", - "rolldown": "~1.2.12", + "postcss": "^8.5.30", + "rolldown": "~1.2.14", "tinyglobby": "^0.2.17" }, "bin": { @@ -890,7 +890,7 @@ }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.7.1", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", diff --git a/src/apps/dashboard/ui/package.json b/src/apps/dashboard/ui/package.json index f37b27e..f74337d 100644 --- a/src/apps/dashboard/ui/package.json +++ b/src/apps/dashboard/ui/package.json @@ -20,7 +20,7 @@ "@vitejs/plugin-react": "6.1.2", "bootstrap": "5.3.8", "echarts": "6.1.0", - "vite": "8.3.4" + "vite": "8.3.5" }, "engines": { "node": ">=22.12"