adonisjs-server-stats 1.12.0 → 1.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -1
- package/dist/core/api-client.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/react/{CacheSection-DZFOiOYH.js → CacheSection-CX2duJuc.js} +1 -1
- package/dist/react/{CacheTab-D8js5o69.js → CacheTab-CgT4t0oZ.js} +1 -1
- package/dist/react/{ConfigSection-DoJmvNkF.js → ConfigSection-Dt0FyeaW.js} +1 -1
- package/dist/react/{ConfigTab-CDvljuBF.js → ConfigTab-KtiTtsrj.js} +1 -1
- package/dist/react/{CustomPaneTab-Db9eIQ-9.js → CustomPaneTab-15QoEplP.js} +1 -1
- package/dist/react/{EmailsTab-BITuGTQm.js → EmailsTab-CUjubln_.js} +2 -2
- package/dist/react/{EventsSection-7mDZv70I.js → EventsSection-GGPoYSNv.js} +1 -1
- package/dist/react/{EventsTab-DF13BChE.js → EventsTab-Wdwr0_ny.js} +1 -1
- package/dist/react/{JobsSection-B_VJFWy6.js → JobsSection-BqqIh_DR.js} +1 -1
- package/dist/react/{JobsTab-DK8Fl9nz.js → JobsTab-CBrU-ryL.js} +1 -1
- package/dist/react/{LogEntryRow-Bdie9SFe.js → LogEntryRow-BOrRkhRU.js} +1 -1
- package/dist/react/{LogsSection-CrWqxWRr.js → LogsSection-Cm_lphM6.js} +2 -2
- package/dist/react/{LogsTab-DYSpL637.js → LogsTab-jKwv9G7Q.js} +2 -2
- package/dist/react/{OverviewSection-CuaccMZt.js → OverviewSection-XF7bakyM.js} +1 -1
- package/dist/react/QueriesSection-DsQBKrNK.js +123 -0
- package/dist/react/QueriesTab-CxCC1GVq.js +87 -0
- package/dist/react/{RequestsSection-mENyeNsk.js → RequestsSection-D8cMbZU0.js} +2 -2
- package/dist/react/{RoutesSection-DjovlaNS.js → RoutesSection-D0y5JQP4.js} +1 -1
- package/dist/react/{RoutesTab-CbQECiUc.js → RoutesTab-Y_alJVMV.js} +1 -1
- package/dist/react/{SplitPaneWrapper-DyRyH5Re.js → SplitPaneWrapper-CZl1ouIT.js} +1 -1
- package/dist/react/{TimelineTab-BKTFbsPe.js → TimelineTab-HyqZpfbp.js} +2 -2
- package/dist/react/{index-CAUHa8QX.js → index-CsprmgzI.js} +2 -2
- package/dist/react/index.js +1 -1
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client/stats-bar.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +3 -3
- package/dist/src/edge/client-vue/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client-vue/stats-bar.js +1 -1
- package/dist/src/provider/auth_middleware_detector.d.ts +12 -6
- package/dist/src/provider/auth_middleware_detector.js +53 -6
- package/dist/src/provider/boot_helpers.d.ts +1 -0
- package/dist/src/provider/boot_helpers.js +7 -1
- package/dist/src/provider/server_stats_provider.js +2 -1
- package/dist/src/routes/no_session_middleware.d.ts +14 -0
- package/dist/src/routes/no_session_middleware.js +16 -0
- package/dist/src/routes/register_routes.js +5 -1
- package/dist/vue/{CacheSection-Bx41lpfK.js → CacheSection-DRqV3YX2.js} +1 -1
- package/dist/vue/{ConfigSection-fkfUdCmx.js → ConfigSection-C6pQCHAL.js} +1 -1
- package/dist/vue/{EmailsSection-CbcDKF9Q.js → EmailsSection-BTNw3ZU2.js} +1 -1
- package/dist/vue/{EmailsTab-CNyEODVB.js → EmailsTab-CwIF1fik.js} +1 -1
- package/dist/vue/{EventsSection-CWbTYOBi.js → EventsSection-BpgkWIwM.js} +1 -1
- package/dist/vue/{JobsSection-CGGO6rtS.js → JobsSection-DrghFEKL.js} +1 -1
- package/dist/vue/{LogsSection-BPB-C-XA.js → LogsSection-BDxx9Bfi.js} +1 -1
- package/dist/vue/{OverviewSection-BTcnPeoM.js → OverviewSection-BAgZTPjY.js} +1 -1
- package/dist/vue/{QueriesSection-2SE3igQJ.js → QueriesSection-CUpwhp7u.js} +127 -115
- package/dist/vue/{RequestsSection-DXcG5Zok.js → RequestsSection-D8P2xpF2.js} +1 -1
- package/dist/vue/{RoutesSection-BkNGWdoP.js → RoutesSection-0qB81hTT.js} +1 -1
- package/dist/vue/{index-CptF6Qbp.js → index-30jLw-_w.js} +2 -2
- package/dist/vue/index.js +1 -1
- package/package.json +1 -1
- package/dist/react/QueriesSection-CvGGh5Ij.js +0 -117
- package/dist/react/QueriesTab-C7CCwhVc.js +0 -87
- package/dist/react/{EmailsSection-D7oxvAjA.js → EmailsSection-YcJYR5eA.js} +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";var fe,L,tt,te,st,nt,rt,at,Me,De,Fe,me={},ve=[],Es=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,le=Array.isArray;function G(e,s){for(var n in s)e[n]=s[n];return e}function qe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ge(e,s,n){var r,l,a,i={};for(a in s)a=="key"?r=s[a]:a=="ref"?l=s[a]:i[a]=s[a];if(arguments.length>2&&(i.children=arguments.length>3?fe.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)i[a]===void 0&&(i[a]=e.defaultProps[a]);return _e(e,i,r,l,null)}function _e(e,s,n,r,l){var a={type:e,props:s,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++tt,__i:-1,__u:0};return l==null&&L.vnode!=null&&L.vnode(a),a}function D(e){return e.children}function Y(e,s){this.props=e,this.context=s}function re(e,s){if(s==null)return e.__?re(e.__,e.__i+1):null;for(var n;s<e.__k.length;s++)if((n=e.__k[s])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?re(e):null}function Ts(e){if(e.__P&&e.__d){var s=e.__v,n=s.__e,r=[],l=[],a=G({},s);a.__v=s.__v+1,L.vnode&&L.vnode(a),je(e.__P,a,s,e.__n,e.__P.namespaceURI,32&s.__u?[n]:null,r,n??re(s),!!(32&s.__u),l),a.__v=s.__v,a.__.__k[a.__i]=a,ut(r,a,l),s.__e=s.__=null,a.__e!=n&&it(a)}}function it(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(s){if(s!=null&&s.__e!=null)return e.__e=e.__c.base=s.__e}),it(e)}function lt(e){(!e.__d&&(e.__d=!0)&&te.push(e)&&!ye.__r++||st!=L.debounceRendering)&&((st=L.debounceRendering)||nt)(ye)}function ye(){for(var e,s=1;te.length;)te.length>s&&te.sort(rt),e=te.shift(),s=te.length,Ts(e);ye.__r=0}function ot(e,s,n,r,l,a,i,o,d,h,u){var c,v,p,f,g,b,w,y=r&&r.__k||ve,m=s.length;for(d=Ls(n,s,y,d,m),c=0;c<m;c++)(p=n.__k[c])!=null&&(v=p.__i!=-1&&y[p.__i]||me,p.__i=c,b=je(e,p,v,l,a,i,o,d,h,u),f=p.__e,p.ref&&v.ref!=p.ref&&(v.ref&&Oe(v.ref,null,p),u.push(p.ref,p.__c||f,p)),g==null&&f!=null&&(g=f),(w=!!(4&p.__u))||v.__k===p.__k?d=ct(p,d,e,w):typeof p.type=="function"&&b!==void 0?d=b:f&&(d=f.nextSibling),p.__u&=-7);return n.__e=g,d}function Ls(e,s,n,r,l){var a,i,o,d,h,u=n.length,c=u,v=0;for(e.__k=new Array(l),a=0;a<l;a++)(i=s[a])!=null&&typeof i!="boolean"&&typeof i!="function"?(typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?i=e.__k[a]=_e(null,i,null,null,null):le(i)?i=e.__k[a]=_e(D,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?i=e.__k[a]=_e(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):e.__k[a]=i,d=a+v,i.__=e,i.__b=e.__b+1,o=null,(h=i.__i=As(i,n,d,c))!=-1&&(c--,(o=n[h])&&(o.__u|=2)),o==null||o.__v==null?(h==-1&&(l>u?v--:l<u&&v++),typeof i.type!="function"&&(i.__u|=4)):h!=d&&(h==d-1?v--:h==d+1?v++:(h>d?v--:v++,i.__u|=4))):e.__k[a]=null;if(c)for(a=0;a<u;a++)(o=n[a])!=null&&(2&o.__u)==0&&(o.__e==r&&(r=re(o)),ft(o,o));return r}function ct(e,s,n,r){var l,a;if(typeof e.type=="function"){for(l=e.__k,a=0;l&&a<l.length;a++)l[a]&&(l[a].__=e,s=ct(l[a],s,n,r));return s}e.__e!=s&&(r&&(s&&e.type&&!s.parentNode&&(s=re(e)),n.insertBefore(e.__e,s||null)),s=e.__e);do s=s&&s.nextSibling;while(s!=null&&s.nodeType==8);return s}function be(e,s){return s=s||[],e==null||typeof e=="boolean"||(le(e)?e.some(function(n){be(n,s)}):s.push(e)),s}function As(e,s,n,r){var l,a,i,o=e.key,d=e.type,h=s[n],u=h!=null&&(2&h.__u)==0;if(h===null&&o==null||u&&o==h.key&&d==h.type)return n;if(r>(u?1:0)){for(l=n-1,a=n+1;l>=0||a<s.length;)if((h=s[i=l>=0?l--:a++])!=null&&(2&h.__u)==0&&o==h.key&&d==h.type)return i}return-1}function dt(e,s,n){s[0]=="-"?e.setProperty(s,n??""):e[s]=n==null?"":typeof n!="number"||Es.test(s)?n:n+"px"}function we(e,s,n,r,l){var a,i;e:if(s=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(s in r)n&&s in n||dt(e.style,s,"");if(n)for(s in n)r&&n[s]==r[s]||dt(e.style,s,n[s])}else if(s[0]=="o"&&s[1]=="n")a=s!=(s=s.replace(at,"$1")),i=s.toLowerCase(),s=i in e||s=="onFocusOut"||s=="onFocusIn"?i.slice(2):s.slice(2),e.l||(e.l={}),e.l[s+a]=n,n?r?n.u=r.u:(n.u=Me,e.addEventListener(s,a?Fe:De,a)):e.removeEventListener(s,a?Fe:De,a);else{if(l=="http://www.w3.org/2000/svg")s=s.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(s!="width"&&s!="height"&&s!="href"&&s!="list"&&s!="form"&&s!="tabIndex"&&s!="download"&&s!="rowSpan"&&s!="colSpan"&&s!="role"&&s!="popover"&&s in e)try{e[s]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&s[4]!="-"?e.removeAttribute(s):e.setAttribute(s,s=="popover"&&n==1?"":n))}}function ht(e){return function(s){if(this.l){var n=this.l[s.type+e];if(s.t==null)s.t=Me++;else if(s.t<n.u)return;return n(L.event?L.event(s):s)}}}function je(e,s,n,r,l,a,i,o,d,h){var u,c,v,p,f,g,b,w,y,m,x,_,A,P,S,$=s.type;if(s.constructor!==void 0)return null;128&n.__u&&(d=!!(32&n.__u),a=[o=s.__e=n.__e]),(u=L.__b)&&u(s);e:if(typeof $=="function")try{if(w=s.props,y="prototype"in $&&$.prototype.render,m=(u=$.contextType)&&r[u.__c],x=u?m?m.props.value:u.__:r,n.__c?b=(c=s.__c=n.__c).__=c.__E:(y?s.__c=c=new $(w,x):(s.__c=c=new Y(w,x),c.constructor=$,c.render=Rs),m&&m.sub(c),c.state||(c.state={}),c.__n=r,v=c.__d=!0,c.__h=[],c._sb=[]),y&&c.__s==null&&(c.__s=c.state),y&&$.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=G({},c.__s)),G(c.__s,$.getDerivedStateFromProps(w,c.__s))),p=c.props,f=c.state,c.__v=s,v)y&&$.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),y&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(y&&$.getDerivedStateFromProps==null&&w!==p&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(w,x),s.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(w,c.__s,x)===!1){s.__v!=n.__v&&(c.props=w,c.state=c.__s,c.__d=!1),s.__e=n.__e,s.__k=n.__k,s.__k.some(function(R){R&&(R.__=s)}),ve.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&i.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(w,c.__s,x),y&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(p,f,g)})}if(c.context=x,c.props=w,c.__P=e,c.__e=!1,_=L.__r,A=0,y)c.state=c.__s,c.__d=!1,_&&_(s),u=c.render(c.props,c.state,c.context),ve.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,_&&_(s),u=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++A<25);c.state=c.__s,c.getChildContext!=null&&(r=G(G({},r),c.getChildContext())),y&&!v&&c.getSnapshotBeforeUpdate!=null&&(g=c.getSnapshotBeforeUpdate(p,f)),P=u!=null&&u.type===D&&u.key==null?pt(u.props.children):u,o=ot(e,le(P)?P:[P],s,n,r,l,a,i,o,d,h),c.base=s.__e,s.__u&=-161,c.__h.length&&i.push(c),b&&(c.__E=c.__=null)}catch(R){if(s.__v=null,d||a!=null)if(R.then){for(s.__u|=d?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;a[a.indexOf(o)]=null,s.__e=o}else{for(S=a.length;S--;)qe(a[S]);Ie(s)}else s.__e=n.__e,s.__k=n.__k,R.then||Ie(s);L.__e(R,s,n)}else a==null&&s.__v==n.__v?(s.__k=n.__k,s.__e=n.__e):o=s.__e=Ps(n.__e,s,n,r,l,a,i,d,h);return(u=L.diffed)&&u(s),128&s.__u?void 0:o}function Ie(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ie))}function ut(e,s,n){for(var r=0;r<n.length;r++)Oe(n[r],n[++r],n[++r]);L.__c&&L.__c(s,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(a){a.call(l)})}catch(a){L.__e(a,l.__v)}})}function pt(e){return typeof e!="object"||e==null||e.__b>0?e:le(e)?e.map(pt):G({},e)}function Ps(e,s,n,r,l,a,i,o,d){var h,u,c,v,p,f,g,b=n.props||me,w=s.props,y=s.type;if(y=="svg"?l="http://www.w3.org/2000/svg":y=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),a!=null){for(h=0;h<a.length;h++)if((p=a[h])&&"setAttribute"in p==!!y&&(y?p.localName==y:p.nodeType==3)){e=p,a[h]=null;break}}if(e==null){if(y==null)return document.createTextNode(w);e=document.createElementNS(l,y,w.is&&w),o&&(L.__m&&L.__m(s,a),o=!1),a=null}if(y==null)b===w||o&&e.data==w||(e.data=w);else{if(a=a&&fe.call(e.childNodes),!o&&a!=null)for(b={},h=0;h<e.attributes.length;h++)b[(p=e.attributes[h]).name]=p.value;for(h in b)p=b[h],h=="dangerouslySetInnerHTML"?c=p:h=="children"||h in w||h=="value"&&"defaultValue"in w||h=="checked"&&"defaultChecked"in w||we(e,h,null,p,l);for(h in w)p=w[h],h=="children"?v=p:h=="dangerouslySetInnerHTML"?u=p:h=="value"?f=p:h=="checked"?g=p:o&&typeof p!="function"||b[h]===p||we(e,h,p,b[h],l);if(u)o||c&&(u.__html==c.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),s.__k=[];else if(c&&(e.innerHTML=""),ot(s.type=="template"?e.content:e,le(v)?v:[v],s,n,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":l,a,i,a?a[0]:n.__k&&re(n,0),o,d),a!=null)for(h=a.length;h--;)qe(a[h]);o||(h="value",y=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[h]||y=="progress"&&!f||y=="option"&&f!=b[h])&&we(e,h,f,b[h],l),h="checked",g!=null&&g!=e[h]&&we(e,h,g,b[h],l))}return e}function Oe(e,s,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&s==null||(e.__u=e(s))}else e.current=s}catch(l){L.__e(l,n)}}function ft(e,s,n){var r,l;if(L.unmount&&L.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Oe(r,null,s)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){L.__e(a,s)}r.base=r.__P=null}if(r=e.__k)for(l=0;l<r.length;l++)r[l]&&ft(r[l],s,n||typeof e.type!="function");n||qe(e.__e),e.__c=e.__=e.__e=void 0}function Rs(e,s,n){return this.constructor(e,n)}function Ms(e,s,n){var r,l,a,i;s==document&&(s=document.documentElement),L.__&&L.__(e,s),l=(r=!1)?null:s.__k,a=[],i=[],je(s,e=s.__k=ge(D,null,[e]),l||me,me,s.namespaceURI,l?null:s.firstChild?fe.call(s.childNodes):null,a,l?l.__e:s.firstChild,r,i),ut(a,e,i)}fe=ve.slice,L={__e:function(e,s,n,r){for(var l,a,i;s=s.__;)if((l=s.__c)&&!l.__)try{if((a=l.constructor)&&a.getDerivedStateFromError!=null&&(l.setState(a.getDerivedStateFromError(e)),i=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,r||{}),i=l.__d),i)return l.__E=l}catch(o){e=o}throw e}},tt=0,Y.prototype.setState=function(e,s){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=G({},this.state),typeof e=="function"&&(e=e(G({},n),this.props)),e&&G(n,e),e!=null&&this.__v&&(s&&this._sb.push(s),lt(this))},Y.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),lt(this))},Y.prototype.render=D,te=[],nt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rt=function(e,s){return e.__v.__b-s.__v.__b},ye.__r=0,at=/(PointerCapture)$|Capture$/i,Me=0,De=ht(!1),Fe=ht(!0);var Ds=0;function t(e,s,n,r,l,a){s||(s={});var i,o,d=s;if("ref"in d)for(o in d={},s)o=="ref"?i=s[o]:d[o]=s[o];var h={type:e,props:d,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ds,__i:-1,__u:0,__source:l,__self:a};if(typeof e=="function"&&(i=e.defaultProps))for(o in i)d[o]===void 0&&(d[o]=i[o]);return L.vnode&&L.vnode(h),h}var oe,j,Be,mt,ce=0,vt=[],O=L,gt=O.__b,_t=O.__r,yt=O.diffed,bt=O.__c,wt=O.unmount,xt=O.__;function Ue(e,s){O.__h&&O.__h(j,e,ce||s),ce=0;var n=j.__H||(j.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function k(e){return ce=1,Fs(St,e)}function Fs(e,s,n){var r=Ue(oe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(s):St(void 0,s),function(o){var d=r.__N?r.__N[0]:r.__[0],h=r.t(d,o);d!==h&&(r.__N=[h,r.__[1]],r.__c.setState({}))}],r.__c=j,!j.__f)){var l=function(o,d,h){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(v){return v.__c});if(u.every(function(v){return!v.__N}))return!a||a.call(this,o,d,h);var c=r.__c.props!==o;return u.some(function(v){if(v.__N){var p=v.__[0];v.__=v.__N,v.__N=void 0,p!==v.__[0]&&(c=!0)}}),a&&a.call(this,o,d,h)||c};j.__f=!0;var a=j.shouldComponentUpdate,i=j.componentWillUpdate;j.componentWillUpdate=function(o,d,h){if(this.__e){var u=a;a=void 0,l(o,d,h),a=u}i&&i.call(this,o,d,h)},j.shouldComponentUpdate=l}return r.__N||r.__}function H(e,s){var n=Ue(oe++,3);!O.__s&&kt(n.__H,s)&&(n.__=e,n.u=s,j.__H.__h.push(n))}function B(e){return ce=5,U(function(){return{current:e}},[])}function U(e,s){var n=Ue(oe++,7);return kt(n.__H,s)&&(n.__=e(),n.__H=s,n.__h=e),n.__}function T(e,s){return ce=8,U(function(){return e},s)}function qs(){for(var e;e=vt.shift();){var s=e.__H;if(e.__P&&s)try{s.__h.some(xe),s.__h.some(He),s.__h=[]}catch(n){s.__h=[],O.__e(n,e.__v)}}}O.__b=function(e){j=null,gt&>(e)},O.__=function(e,s){e&&s.__k&&s.__k.__m&&(e.__m=s.__k.__m),xt&&xt(e,s)},O.__r=function(e){_t&&_t(e),oe=0;var s=(j=e.__c).__H;s&&(Be===j?(s.__h=[],j.__h=[],s.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(s.__h.some(xe),s.__h.some(He),s.__h=[],oe=0)),Be=j},O.diffed=function(e){yt&&yt(e);var s=e.__c;s&&s.__H&&(s.__H.__h.length&&(vt.push(s)!==1&&mt===O.requestAnimationFrame||((mt=O.requestAnimationFrame)||js)(qs)),s.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Be=j=null},O.__c=function(e,s){s.some(function(n){try{n.__h.some(xe),n.__h=n.__h.filter(function(r){return!r.__||He(r)})}catch(r){s.some(function(l){l.__h&&(l.__h=[])}),s=[],O.__e(r,n.__v)}}),bt&&bt(e,s)},O.unmount=function(e){wt&&wt(e);var s,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{xe(r)}catch(l){s=l}}),n.__H=void 0,s&&O.__e(s,n.__v))};var Nt=typeof requestAnimationFrame=="function";function js(e){var s,n=function(){clearTimeout(r),Nt&&cancelAnimationFrame(s),setTimeout(e)},r=setTimeout(n,35);Nt&&(s=requestAnimationFrame(n))}function xe(e){var s=j,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),j=s}function He(e){var s=j;e.__c=e.__(),j=s}function kt(e,s){return!e||e.length!==s.length||s.some(function(n,r){return n!==e[r]})}function St(e,s){return typeof s=="function"?s(e):s}function Is(e,s){for(var n in s)e[n]=s[n];return e}function $t(e,s){for(var n in e)if(n!=="__source"&&!(n in s))return!0;for(var r in s)if(r!=="__source"&&e[r]!==s[r])return!0;return!1}function Ct(e,s){this.props=e,this.context=s}(Ct.prototype=new Y).isPureReactComponent=!0,Ct.prototype.shouldComponentUpdate=function(e,s){return $t(this.props,e)||$t(this.state,s)};var Et=L.__b;L.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Et&&Et(e)};var Os=L.__e;L.__e=function(e,s,n,r){if(e.then){for(var l,a=s;a=a.__;)if((l=a.__c)&&l.__c)return s.__e==null&&(s.__e=n.__e,s.__k=n.__k),l.__c(e,s)}Os(e,s,n,r)};var Tt=L.unmount;function Lt(e,s,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Is({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=s),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Lt(r,s,n)})),e}function At(e,s,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return At(r,s,n)}),e.__c&&e.__c.__P===s&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ne(){this.__u=0,this.o=null,this.__b=null}function Pt(e){if(!e.__)return null;var s=e.__.__c;return s&&s.__a&&s.__a(e)}function W(e){var s,n,r,l=null;function a(i){if(s||(s=e()).then(function(o){o&&(l=o.default||o),r=!0},function(o){n=o,r=!0}),n)throw n;if(!r)throw s;return l?ge(l,i):null}return a.displayName="Lazy",a.__f=!0,a}function ke(){this.i=null,this.l=null}L.unmount=function(e){var s=e.__c;s&&(s.__z=!0),s&&s.__R&&s.__R(),s&&32&e.__u&&(e.type=null),Tt&&Tt(e)},(Ne.prototype=new Y).__c=function(e,s){var n=s.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var l=Pt(r.__v),a=!1,i=function(){a||r.__z||(a=!0,n.__R=null,l?l(d):d())};n.__R=i;var o=n.__P;n.__P=null;var d=function(){if(!--r.__u){if(r.state.__a){var h=r.state.__a;r.__v.__k[0]=At(h,h.__c.__P,h.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.__P=o,u.forceUpdate()}};r.__u++||32&s.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},Ne.prototype.componentWillUnmount=function(){this.o=[]},Ne.prototype.render=function(e,s){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Lt(this.__b,n,r.__O=r.__P)}this.__b=null}var l=s.__a&&ge(D,null,e.fallback);return l&&(l.__u&=-33),[ge(D,null,s.__a?null:e.children),l]};var Rt=function(e,s,n){if(++n[1]===n[0]&&e.l.delete(s),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(ke.prototype=new Y).__a=function(e){var s=this,n=Pt(s.__v),r=s.l.get(e);return r[0]++,function(l){var a=function(){s.props.revealOrder?(r.push(l),Rt(s,e,r)):l()};n?n(a):a()}},ke.prototype.render=function(e){this.i=null,this.l=new Map;var s=be(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&s.reverse();for(var n=s.length;n--;)this.l.set(s[n],this.i=[1,0,this.i]);return e.children},ke.prototype.componentDidUpdate=ke.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(s,n){Rt(e,n,s)})};var Bs=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Us=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Hs=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,zs=/[A-Z0-9]/g,Vs=typeof document<"u",Ws=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Y.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Y.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s})}})});var Mt=L.event;function Ks(){}function Qs(){return this.cancelBubble}function Js(){return this.defaultPrevented}L.event=function(e){return Mt&&(e=Mt(e)),e.persist=Ks,e.isPropagationStopped=Qs,e.isDefaultPrevented=Js,e.nativeEvent=e};var Gs={enumerable:!1,configurable:!0,get:function(){return this.class}},Dt=L.vnode;L.vnode=function(e){typeof e.type=="string"&&(function(s){var n=s.props,r=s.type,l={},a=r.indexOf("-")===-1;for(var i in n){var o=n[i];if(!(i==="value"&&"defaultValue"in n&&o==null||Vs&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var d=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&o===!0?o="":d==="translate"&&o==="no"?o=!1:d[0]==="o"&&d[1]==="n"?d==="ondoubleclick"?i="ondblclick":d!=="onchange"||r!=="input"&&r!=="textarea"||Ws(n.type)?d==="onfocus"?i="onfocusin":d==="onblur"?i="onfocusout":Hs.test(i)&&(i=d):d=i="oninput":a&&Us.test(i)?i=i.replace(zs,"-$&").toLowerCase():o===null&&(o=void 0),d==="oninput"&&l[i=d]&&(i="oninputCapture"),l[i]=o}}r=="select"&&l.multiple&&Array.isArray(l.value)&&(l.value=be(n.children).forEach(function(h){h.props.selected=l.value.indexOf(h.props.value)!=-1})),r=="select"&&l.defaultValue!=null&&(l.value=be(n.children).forEach(function(h){h.props.selected=l.multiple?l.defaultValue.indexOf(h.props.value)!=-1:l.defaultValue==h.props.value})),n.class&&!n.className?(l.class=n.class,Object.defineProperty(l,"className",Gs)):n.className&&(l.class=l.className=n.className),s.props=l})(e),e.$$typeof=Bs,Dt&&Dt(e)};var Ft=L.__r;L.__r=function(e){Ft&&Ft(e),e.__c};var qt=L.diffed;L.diffed=function(e){qt&&qt(e);var s=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in s&&s.value!==n.value&&(n.value=s.value==null?"":s.value)};var jt={Fragment:D};const F={queries:{viewBox:"0 0 24 24",elements:['<ellipse cx="12" cy="5" rx="9" ry="3"/>','<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>','<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>']},events:{viewBox:"0 0 24 24",elements:['<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>']},emails:{viewBox:"0 0 24 24",elements:['<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>','<polyline points="22,6 12,13 2,6"/>']},routes:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<line x1="2" y1="12" x2="22" y2="12"/>','<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>']},logs:{viewBox:"0 0 24 24",elements:['<line x1="8" y1="6" x2="21" y2="6"/>','<line x1="8" y1="12" x2="21" y2="12"/>','<line x1="8" y1="18" x2="21" y2="18"/>','<line x1="3" y1="6" x2="3.01" y2="6"/>','<line x1="3" y1="12" x2="3.01" y2="12"/>','<line x1="3" y1="18" x2="3.01" y2="18"/>']},timeline:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},cache:{viewBox:"0 0 24 24",elements:['<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>','<rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>','<line x1="6" y1="6" x2="6.01" y2="6"/>','<line x1="6" y1="18" x2="6.01" y2="18"/>']},jobs:{viewBox:"0 0 24 24",elements:['<rect x="2" y="7" width="20" height="14" rx="2" ry="2"/>','<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>']},config:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="3"/>','<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>']},internals:{viewBox:"0 0 24 24",elements:['<rect x="4" y="4" width="16" height="16" rx="2"/>','<rect x="9" y="9" width="6" height="6"/>','<line x1="9" y1="1" x2="9" y2="4"/>','<line x1="15" y1="1" x2="15" y2="4"/>','<line x1="9" y1="20" x2="9" y2="23"/>','<line x1="15" y1="20" x2="15" y2="23"/>','<line x1="20" y1="9" x2="23" y2="9"/>','<line x1="20" y1="14" x2="23" y2="14"/>','<line x1="1" y1="9" x2="4" y2="9"/>','<line x1="1" y1="14" x2="4" y2="14"/>']},overview:{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="7" height="7"/>','<rect x="14" y="3" width="7" height="7"/>','<rect x="14" y="14" width="7" height="7"/>','<rect x="3" y="14" width="7" height="7"/>']},requests:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},"dashboard-timeline":{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<polyline points="12 6 12 12 16 14"/>']},"custom-pane":{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="18" height="18" rx="2"/>','<path d="M9 3v18"/>']},wrench:{viewBox:"0 0 24 24",elements:['<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>']},"external-link":{viewBox:"0 0 24 24",elements:['<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>','<polyline points="15 3 21 3 21 9"/>','<line x1="10" y1="14" x2="21" y2="3"/>']},sun:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="5"/>','<line x1="12" y1="1" x2="12" y2="3"/>','<line x1="12" y1="21" x2="12" y2="23"/>','<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>','<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>','<line x1="1" y1="12" x2="3" y2="12"/>','<line x1="21" y1="12" x2="23" y2="12"/>','<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>','<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>']},moon:{viewBox:"0 0 24 24",elements:['<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>']},search:{viewBox:"0 0 24 24",elements:['<circle cx="11" cy="11" r="8"/>','<line x1="21" y1="21" x2="16.65" y2="16.65"/>']},eye:{viewBox:"0 0 24 24",elements:['<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>','<circle cx="12" cy="12" r="3"/>']},"eye-off":{viewBox:"0 0 24 24",elements:['<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>','<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>','<line x1="1" y1="1" x2="23" y2="23"/>','<path d="M14.12 14.12a3 3 0 1 1-4.24-4.24"/>']},"chevron-right":{viewBox:"0 0 24 24",elements:['<path d="M9 18l6-6-6-6"/>']},"chevron-left":{viewBox:"0 0 24 24",elements:['<path d="M15 18l-6-6 6-6"/>']},"open-external":{viewBox:"0 0 16 16",elements:['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']}};function Ys(e,s){const n=e||(typeof window<"u"?window.location.origin:"");if(!s)return{baseUrl:n};const r={headers:{Authorization:`Bearer ${s}`}};return{baseUrl:n,beforeSubscribe(l){return r},beforeUnsubscribe(l){return r}}}async function Zs(){if(typeof window<"u"&&window.Transmit&&typeof window.Transmit=="function")return window.Transmit;try{const e=await import("@adonisjs/transmit-client");return e.Transmit??e.default??null}catch{return null}}function Xs(e){let s=null,n=null,r=!1;return{subscribe:async()=>{try{const i=await Zs();if(!i)throw new Error("Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)");if(r)return;s=new i(Ys(e.baseUrl,e.authToken)),n=s.subscription(e.channelName),n.onMessage(o=>{r||e.onMessage(o)}),await n.create()}catch(i){e.onError?.(i)}},unsubscribe:async()=>{r=!0;try{await n?.delete(),n=null,s=null}catch{}}}}function en(e){let s=!1;const n=Xs({baseUrl:e.baseUrl,channelName:e.channelName,authToken:e.authToken,onMessage:e.onMessage,onError:r=>{s=!0,e.onError?.(r),e.onDisconnect?.()}});return n.subscribe().then(()=>{s||e.onConnect?.()}).catch(r=>{e.onError?.(r),e.onDisconnect?.()}),{unsubscribe:()=>{n.unsubscribe().catch(()=>{})}}}class ze extends Error{status;constructor(s=403){super(`Unauthorized (HTTP ${s})`),this.name="UnauthorizedError",this.status=s}}class tn extends Error{status;body;constructor(s,n){super(`API error (HTTP ${s})`),this.name="ApiError",this.status=s,this.body=n}}class Ve{baseUrl;authToken;constructor(s){this.baseUrl=s.baseUrl.replace(/\/+$/,""),this.authToken=s.authToken}async fetch(s,n){const l={...{Accept:"application/json",...this.authToken?{Authorization:`Bearer ${this.authToken}`}:{}},...n?.headers},a=await globalThis.fetch(`${this.baseUrl}${s}`,{...n,headers:l,credentials:this.authToken?"omit":"include"});if(n?.signal?.aborted)throw new DOMException("The operation was aborted.","AbortError");if(a.status===401||a.status===403)throw new ze(a.status);if(!a.ok){const i=await a.text().catch(()=>"");throw new tn(a.status,i)}return a.json()}async get(s,n){const r=n?`${s}?${n}`:s;return this.fetch(r)}async post(s,n){const r={method:"POST",...n!==void 0?{body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}:{}};return this.fetch(s,r)}async delete(s){return this.fetch(s,{method:"DELETE"})}}const sn=5e3,It=1e4,Ot=100,nn=500,rn={overview:"/overview",requests:"/requests",queries:"/queries",events:"/events",routes:"/routes",logs:"/logs",emails:"/emails",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config"};function an(e){return rn[e]||`/${e}`}class ln{constructor(s,n){this.client=s,this.basePath=n}async fetchSection(s,n,r){const l=an(s),a=n?`${this.basePath}${l}?${n}`:`${this.basePath}${l}`;return this.client.fetch(a,r)}async fetchChart(s){return this.client.fetch(`${this.basePath}/overview/chart?range=${s}`)}async fetchGroupedQueries(){return this.client.fetch(`${this.basePath}/queries/grouped`)}async explainQuery(s){return this.client.fetch(`${this.basePath}/queries/${s}/explain`)}async retryJob(s){return this.client.fetch(`${this.basePath}/jobs/${s}/retry`,{method:"POST"})}async fetchCacheKey(s){return this.client.fetch(`${this.basePath}/cache/${encodeURIComponent(s)}`)}async deleteCacheKey(s){return this.client.fetch(`${this.basePath}/cache/${encodeURIComponent(s)}`,{method:"DELETE"})}async fetchEmailPreview(s){return this.client.fetch(`${this.basePath}/emails/${s}/preview`)}}function on(e){if(!e||typeof e!="object")return!1;const s=e;return s.data!==void 0&&s.meta!==void 0}function cn(e,s){return s.aborted?!0:e instanceof DOMException&&e.name==="AbortError"}const dn=[{key:"page",param:"page",isNumeric:!0},{key:"perPage",param:"perPage",isNumeric:!0},{key:"search",param:"search"},{key:"sort",param:"sort"},{key:"sortDir",param:"direction"},{key:"timeRange",param:"range"}];function hn(e){const s=new URLSearchParams,n=e;for(const{key:r,param:l,isNumeric:a}of dn){const i=n[r];(a?i!=null:i)&&s.set(l,String(i))}if(e.filters)for(const[r,l]of Object.entries(e.filters))l&&s.set(r,l);return s.toString()}function un(e,s,n=2){if(s<=1)return[1];const r=[],l=Math.max(2,e-n),a=Math.min(s-1,e+n);r.push(1),l>2&&r.push("...");for(let i=l;i<=a;i++)r.push(i);return a<s-1&&r.push("..."),s>1&&r.push(s),r}class pn{client;api;callbacks;endpoint;perPage;section;page=1;search;sort;sortDir;filters;timeRange;timer=null;fetchId=0;explicitFetchPending=!1;hasFetched=!1;stopped=!1;abortController=null;constructor(s){this.client=new Ve({baseUrl:s.baseUrl,authToken:s.authToken}),this.api=new ln(this.client,s.endpoint),this.endpoint=s.endpoint,this.section=s.section,this.perPage=s.perPage,this.callbacks=s.callbacks}start(){this.stopped=!1,this.fetch(!1),this.startRefreshTimer()}stop(){this.stopped=!0,this.stopRefreshTimer(),this.abortController?.abort(),this.abortController=null}async fetch(s=!0){if(this.shouldSkipFetch(s))return;const{controller:n,myFetchId:r}=this.prepareFetch(s);try{const l=await this.executeFetch(n);if(this.isStaleResponse(r))return;this.applyFetchResult(l)}catch(l){if(this.shouldIgnoreError(l,n.signal,r))return;this.handleFetchError(l,s)}finally{s||(this.explicitFetchPending=!1)}}setSection(s){this.section!==s&&(this.section=s,this.page=1,this.search=void 0,this.sort=void 0,this.sortDir=void 0,this.filters=void 0,this.hasFetched=!1,this.callbacks.onData(null),this.callbacks.onPagination(null),this.callbacks.onLoading(!0),this.callbacks.onError(null),this.fetch(!1),this.startRefreshTimer())}setPage(s){this.page=s,this.fetch(!1)}setSearch(s){this.search=s||void 0,this.page=1,this.fetch(!1)}setFilter(s,n){this.filters||(this.filters={}),this.filters[s]=String(n),this.page=1,this.fetch(!1)}setSort(s,n){this.sort===s&&!n?this.sortDir=this.sortDir==="asc"?"desc":"asc":(this.sort=s,this.sortDir=n||"desc"),this.fetch(!1)}setTimeRange(s){this.timeRange=s,this.fetch(!1)}async mutate(s,n="post",r){const l=`${this.endpoint}/${s}`;try{const a=n==="post"?await this.client.post(l,r):await this.client.delete(l);return await this.fetch(!0),a}catch(a){throw a instanceof Error?a:new Error(String(a))}}configure(s){s.page!==void 0&&(this.page=s.page),s.perPage!==void 0&&(this.perPage=s.perPage),this.search=s.search,this.sort=s.sort,this.sortDir=s.sortDir,this.filters=s.filters,this.timeRange=s.timeRange}hasData(){return this.hasFetched}handleRefreshSignal(){this.hasFetched&&this.fetch(!0)}getApi(){return this.api}getClient(){return this.client}shouldSkipFetch(s){return s&&this.explicitFetchPending?!0:!this.section}prepareFetch(s){this.abortController?.abort();const n=new AbortController;this.abortController=n;const r=++this.fetchId;return s||(this.callbacks.onLoading(!0),this.explicitFetchPending=!0),{controller:n,myFetchId:r}}async executeFetch(s){const n=this.buildCurrentQueryString();return this.api.fetchSection(this.section,n||void 0,{signal:s.signal})}isStaleResponse(s){return s!==this.fetchId||this.stopped}shouldIgnoreError(s,n,r){return cn(s,n)?!0:this.isStaleResponse(r)}buildCurrentQueryString(){const s=this.sort?this.sort.replace(/[A-Z]/g,r=>"_"+r.toLowerCase()):void 0,n=this.filters;return hn({page:this.page,perPage:this.perPage,search:this.search,sort:s,sortDir:this.sort?this.sortDir:void 0,filters:n&&Object.keys(n).length>0?n:void 0,timeRange:this.section.startsWith("overview")?this.timeRange:void 0})}applyFetchResult(s){on(s)?(this.callbacks.onData(s.data),this.callbacks.onPagination(s.meta)):(this.callbacks.onData(s),this.callbacks.onPagination(null)),this.callbacks.onError(null),this.callbacks.onLoading(!1),this.hasFetched=!0}handleFetchError(s,n){if(s instanceof ze){this.callbacks.onError(s),this.callbacks.onLoading(!1),this.stopRefreshTimer(),this.callbacks.onUnauthorized();return}n||(this.callbacks.onError(s instanceof Error?s:new Error(String(s))),this.callbacks.onLoading(!1))}startRefreshTimer(){this.stopRefreshTimer();const s=this.section==="overview"?sn:It;this.timer=setInterval(()=>this.fetch(!0),s)}stopRefreshTimer(){this.timer&&(clearInterval(this.timer),this.timer=null)}}function fn(e,s){return new pn({baseUrl:s.baseUrl,endpoint:s.dashboardEndpoint,authToken:s.authToken,section:e,perPage:s.perPage,callbacks:{onData:n=>s.setData(n),onPagination:n=>s.setMeta(n),onLoading:n=>s.setIsLoading(n),onError:n=>s.setError(n),onUnauthorized:()=>{}}})}function mn(e,s){e.ctrl.configure(s);const n=e.prevSection!==e.section;return n||!e.hasFetched?(n?e.ctrl.setSection(e.section):e.ctrl.start(),!0):(e.ctrl.start(),e.hasFetched)}function vn(){const[e,s]=k(null),[n,r]=k(null),[l,a]=k(!0),[i,o]=k(null);return{data:e,setData:s,meta:n,setMeta:r,isLoading:l,setIsLoading:a,error:i,setError:o}}function gn(e){const s=T(()=>{e.current?.fetch(!0)},[]),n=T(async(l,a="post",i)=>e.current.mutate(l,a,i),[]),r=T(()=>e.current.getApi(),[]);return{refresh:s,mutate:n,getApi:r}}function _n(e,s,n,r){e.current||(e.current=fn(s,{...n,setData:l=>r.setData(l),setMeta:r.setMeta,setIsLoading:r.setIsLoading,setError:r.setError}))}function yn(e){return{baseUrl:e.baseUrl??"",dashboardEndpoint:e.dashboardEndpoint??"/__stats/api",authToken:e.authToken,page:e.page??1,perPage:e.perPage??50,search:e.search,sort:e.sort,sortDir:e.sortDir,filters:e.filters,timeRange:e.timeRange,refreshKey:e.refreshKey}}function V(e,s={}){const n=yn(s),r=vn(),l=B(null),a=B(e),i=B(!1);_n(l,e,n,r),H(()=>{const d=a.current;return a.current=e,i.current=mn({ctrl:l.current,section:e,prevSection:d,hasFetched:i.current},n),()=>{l.current.stop()}},[e,n.page,n.perPage,n.search,n.sort,n.sortDir,n.filters,n.timeRange,n.refreshKey]);const o=gn(l);return{data:r.data,meta:r.meta,isLoading:r.isLoading,error:r.error,...o}}const bn=["tracing","process","system","http","db","redis","queues","cache","app","log","emails","dashboard"],Bt="/admin/api/debug",Ut={tracing:!1,process:!1,system:!1,http:!1,db:!1,redis:!1,queues:!1,cache:!1,app:!1,log:!1,emails:!1,dashboard:!1,customPanes:[]};function wn(e){const s={customPanes:e.customPanes??[]},n=e.features;for(const r of bn)s[r]=n?.[r]??!1;return s}async function xn(e,s=Bt){const n=`${s.replace(/\/+$/,"")}/config`;return e.fetch(n)}async function Nn(e){const{baseUrl:s="",debugEndpoint:n=Bt,authToken:r}=e,l=new Ve({baseUrl:s,authToken:r});try{const a=await xn(l,n);return wn(a)}catch{return Ut}}function kn(e={}){const{baseUrl:s="",debugEndpoint:n="/admin/api/debug",authToken:r}=e,[l,a]=k(Ut),[i,o]=k(!0),[d,h]=k(null),u=B(!1);return H(()=>{if(u.current)return;u.current=!0;let c=!1;return(async()=>{try{const p=await Nn({baseUrl:s,debugEndpoint:n,authToken:r});c||(a(p),o(!1))}catch(p){c||(h(p instanceof Error?p:new Error(String(p))),o(!1))}})(),()=>{c=!0}},[s,n,r]),{features:l,isLoading:i,error:d}}const Se="ss-dash-theme",We="ss-theme-change";function $e(){if(typeof window>"u")return"light";const e=localStorage.getItem(Se);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Sn(e){typeof window>"u"||(localStorage.setItem(Se,e),window.dispatchEvent(new CustomEvent(We,{detail:e})))}function $n(){const s=$e()==="dark"?"light":"dark";return Sn(s),s}function Ht(e){if(typeof window>"u")return()=>{};const s=a=>{const i=a.detail;(i==="dark"||i==="light")&&e(i)},n=a=>{if(a.key===Se){const i=a.newValue;e(i==="dark"||i==="light"?i:$e())}},r=window.matchMedia("(prefers-color-scheme: dark)"),l=a=>{localStorage.getItem(Se)||e(a.matches?"dark":"light")};return window.addEventListener(We,s),window.addEventListener("storage",n),r.addEventListener("change",l),()=>{window.removeEventListener(We,s),window.removeEventListener("storage",n),r.removeEventListener("change",l)}}function Cn(){const[e,s]=k(()=>$e());H(()=>Ht(l=>{s(l)}),[]);const n=T(()=>{const r=$n();return s(r),r},[]);return{theme:e,toggleTheme:n}}function En({theme:e,onToggle:s,className:n="",classPrefix:r="ss-dash"}){const l=e==="dark";return t("button",{type:"button",className:`${r==="ss-dbg"?"ss-dbg-theme-toggle":"ss-dash-theme-btn"} ${n}`,onClick:s,title:l?"Switch to light theme":"Switch to dark theme","aria-label":l?"Switch to light theme":"Switch to dark theme",children:l?t("svg",{width:"16",height:"16",viewBox:F.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:F.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F.moon.elements.join("")}})})}const Tn=["overview","requests","queries","events","routes","logs","emails","cache","jobs","config","internals"],Ln=W(()=>Promise.resolve().then(()=>mr)),An=W(()=>Promise.resolve().then(()=>Dr)),Pn=W(()=>Promise.resolve().then(()=>Jr)),Rn=W(()=>Promise.resolve().then(()=>Gr)),Mn=W(()=>Promise.resolve().then(()=>Yr)),Dn=W(()=>Promise.resolve().then(()=>Zr)),Fn=W(()=>Promise.resolve().then(()=>ea)),qn=W(()=>Promise.resolve().then(()=>sa)),jn=W(()=>Promise.resolve().then(()=>oa)),In=W(()=>Promise.resolve().then(()=>va)),On=W(()=>Promise.resolve().then(()=>La));function Bn(e){const{baseUrl:s="",dashboardEndpoint:n="/__stats/api",debugEndpoint:r,authToken:l,backUrl:a="/",channelName:i="server-stats/dashboard"}=e,{features:o}=kn({baseUrl:s,debugEndpoint:r,authToken:l}),{theme:d,toggleTheme:h}=Cn(),[u,c]=k("overview"),[v,p]=k(()=>typeof window>"u"?!1:localStorage.getItem("ss-dash-sidebar")==="collapsed"),[f,g]=k(!1),[b,w]=k(0),y=B(0);H(()=>{if(!i)return;const E=en({baseUrl:s,channelName:i,authToken:l,onMessage:()=>{y.current+=1,w(y.current)},onConnect:()=>g(!0),onDisconnect:()=>g(!1),onError:()=>g(!1)});return()=>E.unsubscribe()},[s,i,l]);const m=o.customPanes||[],x=T(E=>{const M=E.replace("#","").split("?")[0];return M&&[...Tn,...m.map(z=>z.id)].includes(M)?M:"overview"},[m]);H(()=>{if(typeof window>"u")return;const E=x(window.location.hash);(E!=="overview"||window.location.hash)&&c(E)},[x]),H(()=>{const E=()=>{const M=x(window.location.hash);M!==u&&c(M)};return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[u,x]),H(()=>{typeof window>"u"||(window.location.hash=u)},[u]);const _=T(()=>{p(E=>{const M=!E;return localStorage.setItem("ss-dash-sidebar",M?"collapsed":"expanded"),M})},[]),A=U(()=>[{id:"overview",label:"Overview",visible:!0},{id:"requests",label:"Requests",visible:!0},{id:"queries",label:"Queries",visible:!0},{id:"events",label:"Events",visible:!0},{id:"routes",label:"Routes",visible:!0},{id:"logs",label:"Logs",visible:!0},{id:"emails",label:"Emails",visible:!0},{id:"cache",label:"Cache",visible:o.cache},{id:"jobs",label:"Jobs",visible:o.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[o]),P=U(()=>A.filter(E=>E.visible),[A]),S=U(()=>({baseUrl:s,dashboardEndpoint:n,authToken:l,refreshKey:b}),[s,n,l,b]),{data:$}=V("overview",S),R=U(()=>{if(!$)return{};const E={};if($.totalRequests>0&&(E.requests={count:$.totalRequests}),$.queryStats?.total>0&&(E.queries={count:$.queryStats.total}),$.logLevelBreakdown){const M=$.logLevelBreakdown,J=M.error+M.warn+M.info+M.debug;J>0&&(E.logs={count:J})}return E},[$]),q=T(()=>{const E={overview:t(Ln,{options:S}),requests:t(An,{options:S}),queries:t(Pn,{options:S}),events:t(Rn,{options:S}),routes:t(Mn,{options:S}),logs:t(Dn,{options:S}),emails:t(Fn,{options:S}),cache:t(qn,{options:S}),jobs:t(jn,{options:S}),config:t(In,{options:S}),internals:t(On,{options:S,debugEndpoint:r})};return t("div",{className:"ss-dash-pane ss-dash-active",id:`ss-dash-pane-${u}`,children:t("div",{className:"ss-dash-pane-inner",children:t(Ne,{fallback:t("div",{className:"ss-dash-empty",children:"Loading..."}),children:E[u]||t("div",{className:"ss-dash-empty",children:"Unknown section"})})})})},[u,S]);return t("div",{className:"ss-dash","data-theme":d,id:"ss-dash",children:[t("div",{className:"ss-dash-header",children:[t("div",{className:"ss-dash-header-left",children:[t("span",{className:"ss-dash-logo",children:"Server Stats"}),t("span",{className:"ss-dash-logo-sub",children:"Dashboard"})]}),t("div",{className:"ss-dash-header-center",children:[t("span",{className:`ss-dash-live-dot ${f?"ss-dash-connected":""}`,id:"ss-dash-live-dot"}),t("span",{className:`ss-dash-live-label ${f?"ss-dash-connected":""}`,id:"ss-dash-live-label",children:f?"Live":"Polling"})]}),t("div",{className:"ss-dash-header-right",children:[t(En,{theme:d,onToggle:h}),a&&t("a",{href:a,className:"ss-dash-back-link",title:"Back to app",children:"← App"})]})]}),t("div",{className:"ss-dash-body",children:[t("div",{className:`ss-dash-sidebar ${v?"ss-dash-collapsed":""}`,id:"ss-dash-sidebar",children:[t("nav",{className:"ss-dash-nav",children:[P.map(E=>{const M=R[E.id];return t("button",{type:"button",className:`ss-dash-nav-item ${u===E.id?"ss-dash-active":""}`,"data-ss-section":E.id,onClick:()=>{E.id!==u&&c(E.id)},title:v?E.label:void 0,children:[t("span",{className:"ss-dash-nav-icon",children:t("svg",{width:"20",height:"20",viewBox:(F[E.id]||F.config).viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:(F[E.id]||F.config).elements.join("")}})}),t("span",{className:"ss-dash-nav-label",children:E.label}),M&&M.count>0&&t("span",{className:`ss-dash-nav-badge${M.variant?" "+M.variant:""}`,children:M.count})]},E.id)}),m.length>0&&t("div",{className:"ss-dash-nav-sep"}),m.map(E=>t("button",{type:"button",className:`ss-dash-nav-item ${u===E.id?"ss-dash-active":""}`,onClick:()=>c(E.id),title:v?E.label:void 0,children:[t("span",{className:"ss-dash-nav-icon",children:t("svg",{width:"20",height:"20",viewBox:F["custom-pane"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F["custom-pane"].elements.join("")}})}),t("span",{className:"ss-dash-nav-label",children:E.label})]},E.id))]}),t("button",{type:"button",className:"ss-dash-sidebar-toggle",id:"ss-dash-sidebar-toggle",onClick:_,title:v?"Expand sidebar":"Collapse sidebar",children:v?t("svg",{width:"16",height:"16",viewBox:F["chevron-right"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"1.5",dangerouslySetInnerHTML:{__html:F["chevron-right"].elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:F["chevron-left"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"1.5",dangerouslySetInnerHTML:{__html:F["chevron-left"].elements.join("")}})})]}),t("div",{className:"ss-dash-main",children:q()})]})]})}function Un(e){const s=document.getElementById(e);return s?JSON.parse(s.textContent||"{}"):{}}function Hn(){function e(s){document.documentElement.setAttribute("data-theme",s)}e($e()),Ht(e)}const ae=Un("ss-dash-config");Hn();const zt=document.getElementById("ss-dash");zt&&Ms(t(Bn,{baseUrl:ae.baseUrl,dashboardEndpoint:ae.dashboardEndpoint,debugEndpoint:ae.debugEndpoint,authToken:ae.authToken,backUrl:ae.backUrl,channelName:ae.channelName}),zt);function I(e,...s){for(const n of s){const r=e[n];if(r!=null)return r}}function Ce(e){return I(e,"createdAt","created_at","timestamp")}function zn(e){return I(e,"timestamp","createdAt","processedAt","created_at")}function Vn(e){return I(e,"statusCode","status_code")}function Wn(e){return I(e,"total_duration","totalDuration","duration")??0}function Kn(e){return I(e,"span_count","spanCount")??0}function Qn(e){return I(e,"warning_count","warningCount")??0}function Vt(e){return I(e,"from_addr","from")??""}function Wt(e){return I(e,"to_addr","to")??""}function Jn(e){return I(e,"cc","cc_addr")??""}function Gn(e){return I(e,"attachment_count","attachmentCount")??0}function Kt(e){return I(e,"event_name","eventName","event")??""}function Qt(e){return I(e,"method","sql_method")??""}function Ee(e){return I(e,"sqlNormalized","normalizedSql","sql_normalized","sql")??""}function se(e,s,n){const r=e[s];return r!=null&&r!==0?Number(r):Number(e[n])||0}function Yn(e){return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"'}function Zn(e,s,n){if(e.length===0)return"[]";const r=e.slice(0,3).map(i=>n(i,30)),l=e.length>3?", ..."+e.length+" items":"",a="["+r.join(", ")+l+"]";return a.length>s?"["+e.length+" items]":a}function Xn(e,s,n){const r=Object.keys(e);if(r.length===0)return"{}";const l=[];for(let d=0;d<Math.min(r.length,4);d++)l.push(r[d]+": "+n(e[r[d]],30));const a=r.length>4?", ...+"+(r.length-4):"",i="{ "+l.join(", ")+a+" }";return i.length<=s?i:"{ "+(r.slice(0,6).join(", ")+(r.length>6?", ...":""))+" }"}function er(e){if(!e&&e!==0)return"-";const s=Math.floor(e),n=Math.floor(s/86400),r=Math.floor(s%86400/3600),l=Math.floor(s%3600/60);return n>0?`${n}d ${r}h`:r>0?`${r}h ${l}m`:l>0?`${l}m ${s%60}s`:`${s}s`}function X(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function Jt(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function tr(e){if(!e)return"-";const s=typeof e=="string"?new Date(Jt(e)):new Date(e);return Number.isNaN(s.getTime())?"-":s.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(s.getMilliseconds()).padStart(3,"0")}function Ke(e){if(!e)return"-";const s=typeof e=="string"?new Date(Jt(e)).getTime():e,n=Math.floor((Date.now()-s)/1e3);return n<0?"just now":n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function sr(e){return e>nn?"very-slow":e>Ot?"slow":"normal"}function de(e,s="ss-dash"){const n=sr(e);return n==="very-slow"?`${s}-very-slow`:n==="slow"?`${s}-slow`:""}function Qe(e,s=100){return e===null?"null":e===void 0?"-":typeof e=="string"?Yn(e):typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?Zn(e,s,Qe):typeof e=="object"?Xn(e,s,Qe):String(e)}function nr(e){return e<0?"no expiry":e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`}function rr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}const ar={color:"#34d399",fillOpacityTop:.25,fillOpacityBottom:.02,strokeWidth:1.5,width:120,height:32,padding:2};function ir(e){return{...ar,...e}}let lr=0;function or(){return`ss-grad-${lr++}`}function cr(e){if(e.length===0)return null;let s=e[0],n=e[0],r=e[0];for(let l=1;l<e.length;l++){const a=e[l];a<s&&(s=a),a>n&&(n=a),r+=a}return{min:s,max:n,avg:r/e.length}}function dr(e,s){if(e.length<2)return null;const n=ir(s),r=cr(e),l=r.max-r.min||1,a=n.width-n.padding*2,i=n.height-n.padding*2,o=n.padding,d=e.length,h=Array.from({length:d});for(let g=0;g<d;g++){const b=o+g/(d-1)*a,w=o+i-(e[g]-r.min)/l*i;h[g]=`${b.toFixed(1)},${w.toFixed(1)}`}const u=h.join(" "),c=(o+a).toFixed(1),v=(o+i).toFixed(1),p=o.toFixed(1),f=`M${h[0]} `+h.slice(1).map(g=>`L${g}`).join(" ")+` L${c},${v} L${p},${v} Z`;return{points:u,areaPath:f,gradientId:or(),options:n,stats:r}}function Te({data:e,color:s="#34d399",width:n=120,height:r=32,className:l=""}){const a=U(()=>dr(e,{width:n,height:r}),[e,n,r]),i=U(()=>"ss-grad-"+Math.random().toString(36).slice(2,8),[]),o={"--ss-accent":s};if(!a)return t("div",{className:`ss-dash-sparkline ${l}`,style:o,children:t("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{display:"block"},children:t("text",{x:n/2,y:r/2+3,textAnchor:"middle",fill:"#737373",fontSize:"9",children:["collecting","…"]})})});const d=s||"var(--ss-accent)";return t("div",{className:`ss-dash-sparkline ${l}`,style:o,children:t("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{display:"block"},children:[t("defs",{children:t("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:d,stopOpacity:"0.25"}),t("stop",{offset:"100%",stopColor:d,stopOpacity:"0.02"})]})}),t("path",{d:a.areaPath,fill:`url(#${i})`}),t("path",{className:"ss-dash-sparkline-line",d:"M"+a.points.replace(/ /g," L"),fill:"none",stroke:d,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})})}function ne({ts:e,className:s,style:n}){return e?t("span",{className:s,style:n,title:tr(e),children:Ke(e)}):t("span",{className:s,style:n,children:"-"})}const hr=[{value:"5m",label:"5m"},{value:"15m",label:"15m"},{value:"30m",label:"30m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"}];function ur({value:e,onChange:s,className:n=""}){return t("div",{className:`ss-dash-btn-group ${n}`,children:hr.map(r=>t("button",{type:"button",className:`ss-dash-btn ${e===r.value?"ss-dash-active":""}`,onClick:()=>s(r.value),children:r.label},r.value))})}function pr(e,s){if(e<=0)return[0];const n=e/s,r=Math.pow(10,Math.floor(Math.log10(n))),l=n/r;let a;l<=1?a=r:l<=2?a=2*r:l<=5?a=5*r:a=10*r;const i=[];for(let o=a;o<=e+a*.5;o+=a)i.push(Math.round(o));return i.length===0&&i.push(Math.ceil(e)),i}function Gt(e){try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"})}catch{return""}}function Yt(e){if(e.length===0)return"";if(e.length===1)return`M${e[0].x},${e[0].y}`;let s=`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;for(let n=0;n<e.length-1;n++){const r=e[n],l=e[n+1],a=(r.x+l.x)/2;s+=` C${a.toFixed(1)},${r.y.toFixed(1)} ${a.toFixed(1)},${l.y.toFixed(1)} ${l.x.toFixed(1)},${l.y.toFixed(1)}`}return s}function fr({chartPoints:e}){const s={top:12,right:12,bottom:28,left:38},n=220,r=B(null),[l,a]=k(0);H(()=>{const N=r.current;if(!N)return;a(N.clientWidth);const C=new ResizeObserver(Q=>{for(const pe of Q)a(pe.contentRect.width)});return C.observe(N),()=>C.disconnect()},[]);const i=l||600,o=i-s.left-s.right,d=n-s.top-s.bottom,h=s.top+d,u=e.map(N=>se(N,"requestCount","request_count")||N.total||0),c=e.map(N=>se(N,"errorCount","error_count")),v=Math.max(...u,1),p=Math.ceil(v*1.1),f=c.some(N=>N>0),g=pr(p,4),b=g.length>0?g[g.length-1]:p,w=N=>s.left+N/Math.max(e.length-1,1)*o,y=N=>s.top+d-N/(b||1)*d,m=e.map((N,C)=>({x:w(C),y:y(u[C])})),x=e.map((N,C)=>({x:w(C),y:y(c[C])})),_=Yt(m),A=f?Yt(x):"",P=m.length>1?`${_} L${m[m.length-1].x.toFixed(1)},${h} L${m[0].x.toFixed(1)},${h} Z`:"",S=f&&x.length>1?`${A} L${x[x.length-1].x.toFixed(1)},${h} L${x[0].x.toFixed(1)},${h} Z`:"",$=Math.min(10,e.length),R=Math.max(1,Math.ceil(e.length/$)),[q,E]=k({visible:!1,x:0,idx:-1}),M=T(N=>{const C=m[N].x;E({visible:!0,x:C,idx:N})},[m]),J=T(()=>{E({visible:!1,x:0,idx:-1})},[]),z=120,Xe=q.visible?Math.max(z/2,Math.min(q.x,i-z/2)):0;return t("div",{ref:r,style:{position:"relative"},children:[t("svg",{viewBox:`0 0 ${i} ${n}`,className:"ss-dash-chart-svg",children:[t("defs",{children:[t("linearGradient",{id:"ss-cg-total",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--ss-accent)",stopOpacity:.3}),t("stop",{offset:"100%",stopColor:"var(--ss-accent)",stopOpacity:.02})]}),t("linearGradient",{id:"ss-cg-error",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--ss-red-fg)",stopOpacity:.35}),t("stop",{offset:"100%",stopColor:"var(--ss-red-fg)",stopOpacity:.02})]})]}),g.map(N=>{const C=y(N);return t("g",{children:[t("line",{x1:s.left,y1:C,x2:i-s.right,y2:C,stroke:"var(--ss-border-faint)",strokeWidth:.5,strokeDasharray:"3,3"}),t("text",{x:s.left-6,y:C,textAnchor:"end",fill:"var(--ss-dim)",fontSize:9,dominantBaseline:"middle",children:N})]},`ytick-${N}`)}),P&&t("path",{d:P,fill:"url(#ss-cg-total)"}),_&&t("path",{d:_,fill:"none",stroke:"var(--ss-accent)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),S&&t("path",{d:S,fill:"url(#ss-cg-error)"}),A&&t("path",{d:A,fill:"none",stroke:"var(--ss-red-fg)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:"4,2"}),e.map((N,C)=>{const Q=u[C],pe=c[C],et=m[C].x,Aa=m[C].y,Ss=o/(e.length||1),$s=q.visible&&q.idx===C,Cs=q.visible&&q.idx!==C;return t("g",{children:[t("rect",{x:et-Ss/2,y:s.top,width:Ss,height:d,fill:"transparent",className:"ss-dash-chart-hover-zone","data-idx":C,onMouseEnter:()=>M(C),onMouseLeave:J}),Q>0&&t("circle",{cx:et,cy:Aa,r:$s?4:2.5,fill:"var(--ss-accent)",stroke:"var(--ss-surface)",strokeWidth:1,className:"ss-dash-chart-dot","data-idx":C,opacity:Cs?.3:1}),pe>0&&t("circle",{cx:et,cy:x[C].y,r:$s?3.5:2,fill:"var(--ss-red-fg)",stroke:"var(--ss-surface)",strokeWidth:1,className:"ss-dash-chart-dot ss-dash-chart-dot-err","data-idx":C,opacity:Cs?.3:1})]},C)}),e.map((N,C)=>{if(C%R!==0&&C!==e.length-1)return null;const Q=Gt(N.bucket);return Q?t("text",{x:w(C),y:n-6,textAnchor:"middle",fill:"var(--ss-dim)",fontSize:9,children:Q},`xlabel-${C}`):null})]}),q.visible&&q.idx>=0&&t("div",{className:"ss-dash-chart-tooltip",style:{left:Xe,top:s.top-4,transform:"translate(-50%, -100%)"},children:[t("div",{children:Gt(e[q.idx].bucket)}),t("div",{children:["Requests: ",u[q.idx]]}),c[q.idx]>0&&t("div",{style:{color:"var(--ss-red-fg)"},children:["Errors: ",c[q.idx]]})]})]})}function Zt({options:e={}}){const[s,n]=k("1h"),{data:r,isLoading:l}=V("overview",e),{data:a}=V("overview/chart",{...e,timeRange:s});if(l&&!r)return t("div",{className:"ss-dash-empty",children:"Loading overview..."});const i=r||{avgResponseTime:0,p95ResponseTime:0,requestsPerMinute:0,errorRate:0,totalRequests:0,slowestEndpoints:[],queryStats:{total:0,avgDuration:0,perRequest:0},recentErrors:[],topEvents:[],emailActivity:{sent:0,queued:0,failed:0},logLevelBreakdown:{error:0,warn:0,info:0,debug:0},cacheStats:null,jobQueueStatus:null,statusDistribution:{"2xx":0,"3xx":0,"4xx":0,"5xx":0},slowestQueries:[]},o=i,d=se(o,"avgResponseTime","avg_response_time"),h=se(o,"p95ResponseTime","p95_response_time"),u=se(o,"requestsPerMinute","requests_per_minute"),c=se(o,"errorRate","error_rate"),p=se(o,"totalRequests","total_requests")>0,f=a?.buckets||[],g=i.sparklines?.avgResponseTime??f.map(m=>m.avgDuration??0),b=i.sparklines?.p95ResponseTime??f.map(m=>m.p95Duration??0),w=i.sparklines?.requestsPerMinute??f.map(m=>m.requestCount??0),y=i.sparklines?.errorRate??f.map(m=>m.errorCount??0);return t("div",{className:"ss-dash-overview",children:[t("div",{className:"ss-dash-cards",children:[t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Avg Response Time"}),t("div",{className:`ss-dash-card-value ${p?d>500?"ss-dash-red":d>200?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?X(d):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Te,{data:g,color:"#34d399",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"P95 Response Time"}),t("div",{className:`ss-dash-card-value ${p?h>500?"ss-dash-red":h>200?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?X(h):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Te,{data:b,color:"#60a5fa",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Requests / min"}),t("div",{className:`ss-dash-card-value ${p?"ss-dash-accent":"ss-dash-dim"}`,children:p?u.toFixed(1):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Te,{data:w,color:"#34d399",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Error Rate"}),t("div",{className:`ss-dash-card-value ${p?c>5?"ss-dash-red":c>1?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?`${c.toFixed(1)}%`:"-"}),t("div",{className:"ss-dash-sparkline",children:t(Te,{data:y,color:"#f87171",width:160,height:40})})]})]}),t("div",{className:"ss-dash-chart-container",children:[t("div",{className:"ss-dash-chart-header",children:[t("span",{className:"ss-dash-chart-title",children:"Request Volume"}),t(ur,{value:s,onChange:n})]}),t("div",{className:"ss-dash-chart",id:"ss-dash-chart-area",children:f.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"120px"},children:"No data for this range"}):t(fr,{chartPoints:f})}),t("div",{className:"ss-dash-chart-legend",id:"ss-dash-chart-legend",children:[t("span",{className:"ss-dash-chart-legend-item",children:[t("span",{className:"ss-dash-legend-dot",style:{background:"var(--ss-accent)"}}),"Requests"]}),f.some(m=>(m.errorCount??0)>0)&&t("span",{className:"ss-dash-chart-legend-item",children:[t("span",{className:"ss-dash-legend-dot",style:{background:"var(--ss-red-fg)"}}),"Errors"]})]})]}),t("div",{className:"ss-dash-secondary-cards",children:[t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#requests",className:"ss-dash-widget-link",children:"Slowest Endpoints"})}),i.slowestEndpoints.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No data yet"}):t("ul",{className:"ss-dash-secondary-list",children:i.slowestEndpoints.slice(0,5).map((m,x)=>{const _=m.url||m.pattern||"-";return t("li",{children:t("a",{href:`#requests?url=${encodeURIComponent(_)}`,className:"ss-dash-widget-row-link",children:[t("span",{title:_,children:_}),t("span",{className:`ss-dash-secondary-list-value ss-dash-duration ${de(m.avgDuration)}`,children:X(m.avgDuration)})]})},x)})})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#queries",className:"ss-dash-widget-link",children:"Query Stats"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:[t("span",{children:"Total Queries"}),t("span",{className:"ss-dash-secondary-list-value",children:i.queryStats.total})]}),t("li",{children:[t("span",{children:"Avg Duration"}),t("span",{className:"ss-dash-secondary-list-value",children:X(i.queryStats.avgDuration)})]}),t("li",{children:[t("span",{children:"Queries / Request"}),t("span",{className:"ss-dash-secondary-list-value",children:i.queryStats.perRequest.toFixed(1)})]})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#logs?level=error",className:"ss-dash-widget-link",children:"Recent Errors"})}),i.recentErrors.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No recent errors"}):t("ul",{className:"ss-dash-secondary-list",children:i.recentErrors.map((m,x)=>t("li",{children:t("a",{href:`#logs?id=${m.id??""}`,className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},title:m.message,children:m.message}),m.timestamp&&t(ne,{ts:m.timestamp,className:"ss-dash-secondary-list-value",style:{color:"var(--ss-dim)"}})]})},x))})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#events",className:"ss-dash-widget-link",children:"Top Events"})}),i.topEvents.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No events yet"}):t("ul",{className:"ss-dash-secondary-list",children:i.topEvents.slice(0,5).map((m,x)=>{const _=Kt(m);return t("li",{children:t("a",{href:`#events?event_name=${encodeURIComponent(_)}`,className:"ss-dash-widget-row-link",children:[t("span",{children:_}),t("span",{className:"ss-dash-secondary-list-value",children:m.count})]})},x)})})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#emails",className:"ss-dash-widget-link",children:"Email Activity"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#emails?status=sent",className:"ss-dash-widget-row-link",children:[t("span",{children:"Sent"}),t("span",{className:"ss-dash-secondary-list-value",children:i.emailActivity.sent})]})}),t("li",{children:t("a",{href:"#emails?status=queued",className:"ss-dash-widget-row-link",children:[t("span",{children:"Queued"}),t("span",{className:"ss-dash-secondary-list-value",children:i.emailActivity.queued})]})}),t("li",{children:t("a",{href:"#emails?status=failed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Failed"}),t("span",{className:"ss-dash-secondary-list-value",style:i.emailActivity.failed>0?{color:"var(--ss-red-fg)"}:void 0,children:i.emailActivity.failed})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#logs",className:"ss-dash-widget-link",children:"Log Levels"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#logs?level=error",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},children:"Error"}),t("span",{className:"ss-dash-secondary-list-value",children:i.logLevelBreakdown.error})]})}),t("li",{children:t("a",{href:"#logs?level=warn",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-amber-fg)"},children:"Warn"}),t("span",{className:"ss-dash-secondary-list-value",children:i.logLevelBreakdown.warn})]})}),t("li",{children:t("a",{href:"#logs?level=info",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-green-fg)"},children:"Info"}),t("span",{className:"ss-dash-secondary-list-value",children:i.logLevelBreakdown.info})]})}),t("li",{children:t("a",{href:"#logs?level=debug",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-dim)"},children:"Debug"}),t("span",{className:"ss-dash-secondary-list-value",children:i.logLevelBreakdown.debug})]})})]})]}),i.cacheStats&&i.cacheStats.available&&t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#cache",className:"ss-dash-widget-link",children:"Cache"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Keys"}),t("span",{className:"ss-dash-secondary-list-value",children:i.cacheStats.totalKeys})]})}),t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Hit Rate"}),t("span",{className:"ss-dash-secondary-list-value",children:[i.cacheStats.hitRate.toFixed(1),"%"]})]})}),t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Memory"}),t("span",{className:"ss-dash-secondary-list-value",children:i.cacheStats.memoryUsedHuman})]})})]})]}),i.jobQueueStatus&&i.jobQueueStatus.available&&t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#jobs",className:"ss-dash-widget-link",children:"Job Queue"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#jobs?status=active",className:"ss-dash-widget-row-link",children:[t("span",{children:"Active"}),t("span",{className:"ss-dash-secondary-list-value",children:i.jobQueueStatus.active})]})}),t("li",{children:t("a",{href:"#jobs?status=waiting",className:"ss-dash-widget-row-link",children:[t("span",{children:"Waiting"}),t("span",{className:"ss-dash-secondary-list-value",children:i.jobQueueStatus.waiting})]})}),t("li",{children:t("a",{href:"#jobs?status=failed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Failed"}),t("span",{className:"ss-dash-secondary-list-value",style:i.jobQueueStatus.failed>0?{color:"var(--ss-red-fg)"}:void 0,children:i.jobQueueStatus.failed})]})}),t("li",{children:t("a",{href:"#jobs?status=completed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Completed"}),t("span",{className:"ss-dash-secondary-list-value",children:i.jobQueueStatus.completed})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#requests",className:"ss-dash-widget-link",children:"Response Status"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#requests?status=2xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-green-fg)"},children:"2xx"}),t("span",{className:"ss-dash-secondary-list-value",children:i.statusDistribution["2xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=3xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-blue-fg)"},children:"3xx"}),t("span",{className:"ss-dash-secondary-list-value",children:i.statusDistribution["3xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=4xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-amber-fg)"},children:"4xx"}),t("span",{className:"ss-dash-secondary-list-value",children:i.statusDistribution["4xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=5xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},children:"5xx"}),t("span",{className:"ss-dash-secondary-list-value",children:i.statusDistribution["5xx"]})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#queries",className:"ss-dash-widget-link",children:"Slowest Queries"})}),i.slowestQueries.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No query data yet"}):t("ul",{className:"ss-dash-secondary-list",children:i.slowestQueries.slice(0,5).map((m,x)=>{const _=Ee(m)||"-";return t("li",{children:t("a",{href:`#queries?pattern=${encodeURIComponent(_)}`,className:"ss-dash-widget-row-link",children:[t("span",{title:_,children:_}),t("span",{className:`ss-dash-secondary-list-value ss-dash-duration ${de(m.avgDuration)}`,children:X(m.avgDuration)})]})},x)})})]})]})]})}const mr=Object.freeze(Object.defineProperty({__proto__:null,OverviewSection:Zt,default:Zt},Symbol.toStringTag,{value:"Module"}));function vr(e){if(!e)return[];if(typeof e=="string")try{return JSON.parse(e)}catch{return[]}return Array.isArray(e)?e:[]}function gr(e){if(!e)return[];if(typeof e=="string")try{return JSON.parse(e)}catch{return[]}return Array.isArray(e)?e:[]}function Je(e,s,n,r=0){return e[s]??e[n]??r}function _r(e){return{method:e.method||"",url:e.url||"",statusCode:Je(e,"status_code","statusCode"),totalDuration:Je(e,"total_duration","totalDuration")||e.duration||0,spanCount:Je(e,"span_count","spanCount"),spans:vr(e.spans),warnings:gr(e.warnings),logs:e.logs||[],httpRequestId:e.httpRequestId||e.http_request_id||void 0}}function Xt(e="",s){const n=B(null);return T(()=>(n.current||(n.current=new Ve({baseUrl:e,authToken:s})),n.current),[e,s])}function yr({color:e="muted",children:s,className:n="",classPrefix:r="ss-dash"}){return t("span",{className:`${r}-badge ${r}-badge-${e} ${n}`,children:s})}function Ge({method:e,className:s="",classPrefix:n="ss-dash"}){return t("span",{className:`${n}-method ${n}-method-${e.toLowerCase()} ${s}`,children:e})}function es({code:e,className:s="",classPrefix:n="ss-dash"}){let r=`${n}-status-2xx`;return e>=500?r=`${n}-status-5xx`:e>=400?r=`${n}-status-4xx`:e>=300&&(r=`${n}-status-3xx`),t("span",{className:`${n}-status ${r} ${s}`,children:e})}function br(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return null}return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}function ts(e){const s={};for(const[n,r]of Object.entries(e))Cr.has(n)||(s[n]=r);return Object.keys(s).length>0?s:null}const wr=["all","error","warn","info","debug"];function xr(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Nr(e){return e.msg||e.message||JSON.stringify(e)}function kr(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Sr(e){const s=e.data||{};return e.requestId||e.request_id||e["x-request-id"]||s.requestId||s.request_id||s["x-request-id"]||""}function $r(e,s="ss-dbg-log-level"){switch(e){case"error":case"fatal":return`${s}-error`;case"warn":return`${s}-warn`;case"info":return`${s}-info`;case"debug":return`${s}-debug`;case"trace":return`${s}-trace`;default:return`${s}-info`}}const Cr=new Set(["level","time","pid","hostname","msg","message","v","name","levelName","level_name","timestamp","createdAt","created_at","requestId","request_id","x-request-id","id","data"]);function Er(e){if(e.data){const s=br(e.data);if(s){const n=ts(s);if(n)return n}}return ts(e)}function Le({data:e,maxPreviewLength:s=100,className:n="",classPrefix:r="ss-dash",defaultExpanded:l=!1}){const[a,i]=k(l),o=U(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),d=U(()=>typeof o=="object"&&o!==null?Qe(o,s):String(o??"-"),[o,s]),h=U(()=>typeof o=="object"&&o!==null?JSON.stringify(o,null,2):String(o),[o]),u=T(()=>{i(v=>!v)},[]),c=T(async()=>{try{await navigator.clipboard.writeText(h)}catch{}},[h]);return!e&&e!==0&&e!==!1?t("span",{className:`ss-dim ${r}-c-dim`,children:"-"}):t("div",{className:`${r}-data-cell ${n}`,children:[!a&&t("span",{className:`${r}-data-preview`,onClick:u,role:"button",tabIndex:0,onKeyDown:v=>v.key==="Enter"&&u(),children:d}),a&&t("div",{className:`${r}-data-full`,onClick:u,children:[t("button",{className:`${r}-copy-btn`,onClick:v=>{v.stopPropagation(),c()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:h})]})]})}function ss({log:e,index:s,expanded:n,onToggleExpand:r,onReqIdClick:l}){const a=xr(e),i=Nr(e),o=kr(e),d=Sr(e),h=Er(e);return t(jt.Fragment,{children:[t("div",{className:`ss-log-entry${h?" ss-log-entry-expandable":""}`,onClick:()=>h&&r(s),children:[t("span",{className:`ss-log-level ${$r(a,"ss-log-level")}`,children:a.toUpperCase()}),t(ne,{ts:o,className:"ss-log-time"}),d?t("span",{className:"ss-log-reqid",title:d,onClick:l?u=>{u.stopPropagation(),l(d)}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,onKeyDown:l?u=>{u.key==="Enter"&&(u.stopPropagation(),l(d))}:void 0,children:d.slice(0,8)}):t("span",{className:"ss-log-reqid-empty",children:"--"}),h?t("span",{className:`ss-log-expand-icon${n?" ss-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-log-msg",children:i})]}),n&&h&&t("div",{className:"ss-log-detail",children:t(Le,{data:h,classPrefix:"ss-dbg",defaultExpanded:!0})})]})}function Tr({logs:e,onReqIdClick:s}){const[n,r]=k(null);return e.length===0?null:t("div",{children:[t("div",{className:"ss-related-logs-title",children:["Related Logs",t("span",{className:"ss-related-logs-count",children:["(",e.length,")"]})]}),t("div",{style:{overflow:"auto"},children:e.map((l,a)=>t(ss,{log:l,index:a,expanded:n===a,onToggleExpand:i=>r(n===i?null:i),onReqIdClick:s},l.id||a))})]})}function Lr(e){const{container:s,handle:n,topPane:r,bottomPane:l,storageKey:a,minHeight:i=60}=e;if(a){const d=localStorage.getItem(a);if(d){const h=parseFloat(d);h>0&&h<1&&(r.style.flex=`${h}`,l.style.flex=`${1-h}`)}}function o(d){d.preventDefault(),n.setPointerCapture(d.pointerId);const u=s.getBoundingClientRect().height,c=d.clientY,v=r.getBoundingClientRect().height;function p(g){const b=g.clientY-c;let w=v+b;const y=u-i-n.offsetHeight;w=Math.max(i,Math.min(w,y));const m=w/(u-n.offsetHeight);r.style.flex=`${m}`,l.style.flex=`${1-m}`}function f(){if(n.removeEventListener("pointermove",p),n.removeEventListener("pointerup",f),a){const g=s.getBoundingClientRect().height-n.offsetHeight;if(g>0){const b=r.getBoundingClientRect().height/g;localStorage.setItem(a,String(b))}}}n.addEventListener("pointermove",p),n.addEventListener("pointerup",f)}return n.addEventListener("pointerdown",o),()=>{n.removeEventListener("pointerdown",o)}}function Ar({children:e,storageKey:s}){const n=B(null),r=B(null),l=B(null),a=B(null);return H(()=>{if(n.current&&r.current&&l.current&&a.current)return Lr({container:n.current,handle:r.current,topPane:l.current,bottomPane:a.current,storageKey:s})},[s]),t("div",{ref:n,className:"ss-split-container",children:[t("div",{ref:l,className:"ss-split-top",children:e[0]}),t("div",{ref:r,className:"ss-split-handle"}),t("div",{ref:a,className:"ss-split-bottom",children:e[1]})]})}const Pr="ss-col-resize",ns="ss-resizing";function rs(e){const s=Array.from(e.querySelectorAll("thead th"));if(s.length===0)return()=>{};const n=[];let r=!1;function l(){if(!r){r=!0;for(const a of s)a.style.width=a.offsetWidth+"px";e.style.tableLayout="fixed"}}for(const a of s){let i=function(d){d.preventDefault(),d.stopPropagation(),l();const h=d.clientX,u=a.offsetWidth;o.classList.add(ns),o.setPointerCapture(d.pointerId);function c(p){const f=p.clientX-h,g=Math.max(30,u+f);a.style.width=g+"px"}function v(){o.classList.remove(ns),o.removeEventListener("pointermove",c),o.removeEventListener("pointerup",v)}o.addEventListener("pointermove",c),o.addEventListener("pointerup",v)};if(!a.textContent?.trim())continue;const o=document.createElement("div");o.className=Pr,a.appendChild(o),o.addEventListener("pointerdown",i),n.push(()=>{o.removeEventListener("pointerdown",i),o.remove()})}return()=>{for(const a of n)a()}}function Rr(e=[]){const s=B(null),n=B(null);return H(()=>(s.current&&(n.current?.(),n.current=rs(s.current)),()=>{n.current?.(),n.current=null}),e),T(l=>{n.current?.(),n.current=null,s.current=l,l&&(n.current=rs(l))},[])}function ee({columns:e,data:s,keyField:n="id",sort:r,sortDir:l,onSort:a,onRowClick:i,rowClassName:o,emptyMessage:d="No data",className:h="",renderAfterRow:u}){const c=T(p=>{a&&a(p)},[a]),v=Rr([s,e]);return s.length===0?t("div",{className:"ss-dash-empty",children:d}):t("table",{ref:v,className:`ss-dash-table ${h}`,children:[t("colgroup",{children:e.map(p=>t("col",{style:p.width?{width:p.width}:void 0},p.key))}),t("thead",{children:t("tr",{children:e.map(p=>t("th",{onClick:p.sortable?()=>c(p.key):void 0,className:p.sortable?"ss-dash-sortable":"",children:[p.label,r===p.key&&t("span",{className:"ss-dash-sort-arrow",children:l==="asc"?" ▲":" ▼"})]},p.key))})}),t("tbody",{children:s.map((p,f)=>{const g=o?typeof o=="function"?o(p):o:"",b=i?"ss-dash-clickable":"";return t(jt.Fragment,{children:[t("tr",{onClick:i?()=>i(p):void 0,className:`${b} ${g}`.trim(),children:e.map(w=>t("td",{children:w.render?w.render(p[w.key],p):p[w.key]??"-"},w.key))}),u?u(p,f):null]},p[n]??f)})})]})}function Z({search:e,onSearchChange:s,placeholder:n="Search...",summary:r,children:l,className:a=""}){const i=T(()=>{s("")},[s]);return t("div",{className:`ss-dbg-filter-bar ${a}`,children:[r!=null&&t("span",{className:"ss-dbg-summary",children:r}),t("div",{className:"ss-dbg-search-wrapper",children:[t("svg",{className:"ss-dbg-search-icon",width:"14",height:"14",viewBox:F.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F.search.elements.join("")}}),t("input",{type:"text",className:"ss-dbg-search",placeholder:n,value:e,onChange:o=>s(o.target.value)}),e&&t("button",{type:"button",className:"ss-dbg-search-clear",onClick:i,children:"×"})]}),l&&t("div",{className:"ss-dbg-filter-controls",children:l})]})}function ie({page:e,lastPage:s,total:n,onPageChange:r,className:l=""}){const a=U(()=>un(e,s),[e,s]),i=T(()=>{e>1&&r(e-1)},[e,r]),o=T(()=>{e<s&&r(e+1)},[e,s,r]);return s<=1?null:t("div",{className:`ss-dash-pagination ${l}`,children:[t("span",{className:"ss-dash-page-info",children:["Page ",e," of ",s," (",n," total)"]}),t("div",{className:"ss-dash-pagination-controls",children:[t("button",{type:"button",className:"ss-dash-page-btn",onClick:i,disabled:e<=1,children:"« Prev"}),a.map((d,h)=>d==="..."?t("span",{className:"ss-dash-page-ellipsis",children:"..."},`ellipsis-${h}`):t("button",{type:"button",className:`ss-dash-page-btn ${d===e?"ss-dash-active":""}`,onClick:()=>r(d),children:d},d)),t("button",{type:"button",className:"ss-dash-page-btn",onClick:o,disabled:e>=s,children:"Next »"})]})]})}const as={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"var(--ss-dim)"},Mr={request:"Request",middleware:"Middleware",db:"DB",mail:"Mail",event:"Event",view:"View",custom:"Custom"};function is({spans:e,totalDuration:s,className:n="",warnings:r}){const l=e||[],a=U(()=>[...l].sort((o,d)=>o.startOffset-d.startOffset),[l]),i=U(()=>{const o={};for(const d of a)o[d.id]=d.parentId?(o[d.parentId]||0)+1:0;return o},[a]);return l.length===0?t("div",{className:"ss-dash-empty",children:"No spans recorded"}):t("div",{className:`ss-dash-tl-waterfall ${n}`,children:[t("div",{className:"ss-dash-tl-legend",children:Object.entries(Mr).map(([o,d])=>t("div",{className:"ss-dash-tl-legend-item",children:[t("span",{className:"ss-dash-tl-legend-dot",style:{background:as[o]||as.custom}}),t("span",{children:d})]},o))}),a.map(o=>{const d=s>0?o.startOffset/s*100:0,h=s>0?Math.max(o.duration/s*100,.5):1,u=i[o.id]||0,c=o.label.length>50?o.label.slice(0,50)+"...":o.label,v=o.category==="db"?"DB":o.category,p=o.category==="db"?"purple":o.category==="mail"?"green":o.category==="event"?"amber":o.category==="view"?"blue":"muted",f=o.metadata?Object.entries(o.metadata).filter(([,b])=>b!=null).map(([b,w])=>`${b}=${w}`).join(", "):"",g=f?`${o.label} (${o.duration.toFixed(2)}ms)
|
|
2
|
-
${f}`:`${o.label} (${o.duration.toFixed(2)}ms)`;return t("div",{className:"ss-dash-tl-row",children:[t("div",{className:"ss-dash-tl-label",title:g,style:{paddingLeft:8+u*16+"px"},children:[t("span",{className:`ss-dash-badge ss-dash-badge-${p}`,style:{fontSize:"9px",marginRight:"4px"},children:v}),c]}),t("div",{className:"ss-dash-tl-track",children:t("div",{className:`ss-dash-tl-bar ss-dash-tl-bar-${o.category||"custom"}`,style:{left:`${d}%`,width:`${h}%`},title:g})}),t("span",{className:"ss-dash-tl-dur",children:[o.duration.toFixed(2),"ms"]})]},o.id)}),r&&r.length>0&&t("div",{className:"ss-dash-tl-warnings",children:[t("div",{className:"ss-dash-tl-warnings-title",children:["Warnings (",r.length,")"]}),r.map((o,d)=>t("div",{className:"ss-dash-tl-warning",children:o},d))]})]})}function ls({options:e={}}){const[s,n]=k(1),[r,l]=k(""),[a,i]=k("createdAt"),[o,d]=k("desc"),[h,u]=k(null),[c,v]=k(!1);H(()=>n(1),[r]);const{data:p,meta:f,isLoading:g,error:b}=V("requests",{...e,page:s,search:r,sort:a,sortDir:o}),w=Xt(e.baseUrl||"",e.authToken),y=T(_=>{const A=_.id;v(!0);const P=e.dashboardEndpoint||"/__stats/api";w().fetch(`${P}/requests/${A}`).then(S=>{const $=S,R=$.trace;if(R){const q={...$,...R,logs:$.logs};u(q)}else u(S);v(!1)}).catch(()=>{v(!1)})},[w,e.dashboardEndpoint]),m=T(_=>{a===_?d(A=>A==="asc"?"desc":"asc"):(i(_),d("desc"))},[a]),x=p||[];if(h){const _=_r(h),A=_.logs.length>0;return t("div",{children:[t("div",{className:"ss-dash-tl-detail-header",children:[t("button",{type:"button",className:"ss-dash-btn",onClick:()=>u(null),children:"← Back to Requests"}),t(Ge,{method:_.method}),t("span",{style:{color:"var(--ss-text)"},children:_.url}),t(es,{code:_.statusCode}),t("span",{className:"ss-dash-tl-meta",children:[_.totalDuration.toFixed(1),"ms · ",_.spanCount," spans"]})]}),A?t(Ar,{storageKey:"ss-requests-split",children:[t(is,{spans:_.spans,totalDuration:_.totalDuration,warnings:_.warnings}),t(Tr,{logs:_.logs})]}):t(is,{spans:_.spans,totalDuration:_.totalDuration,warnings:_.warnings})]})}return c?t("div",{children:[t("div",{className:"ss-dash-tl-detail-header",children:t("button",{type:"button",className:"ss-dash-btn",onClick:()=>v(!1),children:"← Back to Requests"})}),t("div",{className:"ss-dash-empty",children:"Loading request detail..."})]}):t("div",{children:[t(Z,{search:r,onSearchChange:l,placeholder:"Filter requests...",summary:`${f?.total??0} requests`}),b&&t("div",{className:"ss-dash-empty",children:"Failed to load requests"}),g&&!p?t("div",{className:"ss-dash-empty",children:"Loading requests..."}):t(D,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"id",label:"#",width:"40px",render:_=>t("span",{style:{color:"var(--ss-dim)"},children:_})},{key:"method",label:"Method",width:"70px",sortable:!0,render:_=>t(Ge,{method:_})},{key:"url",label:"URL",sortable:!0,render:_=>t("span",{style:{color:"var(--ss-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:_,children:_})},{key:"statusCode",label:"Status",width:"60px",sortable:!0,render:(_,A)=>{const P=Vn(A);return t(es,{code:P})}},{key:"duration",label:"Duration",width:"80px",sortable:!0,render:(_,A)=>{const P=Wn(A);return t("span",{className:`ss-dash-duration ${de(P)}`,children:[P.toFixed(1),"ms"]})}},{key:"spanCount",label:"Spans",width:"50px",render:(_,A)=>{const P=Kn(A);return t("span",{style:{color:"var(--ss-muted)",textAlign:"center"},children:P})}},{key:"warningCount",label:"⚠",width:"40px",render:(_,A)=>{const P=Qn(A);return P>0?t("span",{style:{color:"var(--ss-amber-fg)",textAlign:"center",display:"block"},children:P}):t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:"-"})}},{key:"createdAt",label:"Time",width:"80px",sortable:!0,render:(_,A)=>{const P=Ce(A)??"";return t(ne,{ts:P,className:"ss-dash-event-time"})}}],data:x,sort:a,sortDir:o,onSort:m,onRowClick:y,emptyMessage:"No requests recorded yet"})}),f&&t(ie,{page:f.page,lastPage:f.lastPage,total:f.total,onPageChange:n})]})]})}const Dr=Object.freeze(Object.defineProperty({__proto__:null,RequestsSection:ls,default:ls},Symbol.toStringTag,{value:"Module"}));function Fr(e,s){let n=0,r=0;for(const d of e){const h=I(d,"duration")??0;r+=h,h>Ot&&n++}const l=os(e);let a=0;for(const d of l.values())d>1&&(a+=d);const i=e.length>0?r/e.length:0,o=s?.total??e.length;return{slowCount:n,dupCount:a,avgDuration:i,totalCount:o}}function os(e){const s=new Map;for(const n of e){const l=Ee(n);s.set(l,(s.get(l)||0)+1)}return s}class qr{state;constructor(s="list"){this.state={viewMode:s,sort:{key:s==="list"?"createdAt":"count",dir:"desc"},expandedIds:new Set,explainData:new Map,search:""}}setViewMode(s){return this.state.viewMode=s,this.state.sort={key:s==="list"?"createdAt":"count",dir:"desc"},this.state.expandedIds=new Set,this.state.explainData=new Map,this.state}toggleSort(s){return this.state.sort.key===s?this.state.sort={key:s,dir:this.state.sort.dir==="asc"?"desc":"asc"}:this.state.sort={key:s,dir:"desc"},this.state}toggleExpand(s){return this.state.expandedIds.has(s)?this.state.expandedIds.delete(s):this.state.expandedIds.add(s),this.state}isExpanded(s){return this.state.expandedIds.has(s)}setSearch(s){return this.state.search=s,this.state}startExplain(s){this.state.explainData.set(s,{loading:!0})}completeExplain(s,n){this.state.explainData.set(s,{loading:!1,result:n})}failExplain(s,n){this.state.explainData.set(s,{loading:!1,error:n})}clearExplain(){this.state.explainData=new Map}getExplainState(s){return this.state.explainData.get(s)}}function jr(e){const s=[];if(e["Startup Cost"]!==null&&e["Startup Cost"]!==void 0&&s.push(`cost=${e["Startup Cost"]}..${e["Total Cost"]}`),e["Plan Rows"]!==null&&e["Plan Rows"]!==void 0&&s.push(`rows=${e["Plan Rows"]}`),e["Plan Width"]!==null&&e["Plan Width"]!==void 0&&s.push(`width=${e["Plan Width"]}`),e.Filter&&s.push(`filter: ${e.Filter}`),e["Index Cond"]&&s.push(`cond: ${e["Index Cond"]}`),e["Hash Cond"]&&s.push(`hash: ${e["Hash Cond"]}`),e["Join Type"]&&s.push(`join: ${e["Join Type"]}`),e["Sort Key"]){const n=Array.isArray(e["Sort Key"])?e["Sort Key"].join(", "):e["Sort Key"];s.push(`sort: ${n}`)}return s}function cs(e,s=0){if(!e)return[];const r=[{depth:s,nodeType:e["Node Type"]||"Unknown",relationName:e["Relation Name"]||"",alias:e.Alias&&e.Alias!==e["Relation Name"]?e.Alias:"",indexName:e["Index Name"]||"",metrics:jr(e),isRoot:s===0}],l=e.Plans||[];for(const a of l)r.push(...cs(a,s+1));return r}function Ir(e){return!e||typeof e!="object"?!1:"Plan"in e}function Or(e){if(!e||e.length===0)return[];const s=e[0];return!s||typeof s!="object"?[]:Object.keys(s)}function Br(e){return e==null?"-":String(e)}function Ur(e){const s=e?.showExplain??!0,n=[{key:"id",label:"#",width:"40px",type:"index"},{key:"sql",label:"SQL",type:"sql"},{key:"duration",label:"Duration",width:"70px",sortable:!0,type:"duration"},{key:"method",label:"Method",width:"60px",type:"method"},{key:"model",label:"Model",width:"90px",type:"model"},{key:"connection",label:"Connection",width:"80px",type:"connection"},{key:"createdAt",label:"Time",width:"90px",sortable:!0,type:"time"}];return s&&n.push({key:"id",label:"",width:"70px",type:"explain"}),n}function Hr(){return[{key:"sqlNormalized",label:"Pattern",type:"sql"},{key:"count",label:"Count",width:"60px",sortable:!0},{key:"avgDuration",label:"Avg",width:"70px",sortable:!0,type:"duration"},{key:"minDuration",label:"Min",width:"70px",type:"duration"},{key:"maxDuration",label:"Max",width:"70px",type:"duration"},{key:"totalDuration",label:"Total",width:"70px",sortable:!0,type:"duration"},{key:"percentOfTotal",label:"% Time",width:"60px"}]}function zr({node:e,depth:s=0}){if(!e)return null;const n=U(()=>cs(e,s),[e,s]);return t(D,{children:n.map((r,l)=>t("div",{className:"ss-dash-explain-node",style:{marginLeft:`${r.depth*20}px`},children:[t("div",{className:"ss-dash-explain-node-header",children:[t("span",{className:"ss-dash-explain-node-type",children:r.nodeType}),r.relationName&&t(D,{children:[" on ",t("strong",{children:r.relationName})]}),r.alias&&` (${r.alias})`,r.indexName&&t(D,{children:[" using ",t("em",{children:r.indexName})]})]}),r.metrics.length>0&&t("div",{className:"ss-dash-explain-metrics",children:r.metrics.join(" · ")})]},l))})}function Vr({plan:e}){if(!e||!Array.isArray(e)||e.length===0)return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"});const s=e[0];if(Ir(s))return t("div",{className:"ss-dash-explain-result",children:t(zr,{node:s.Plan,depth:0})});if(typeof s=="object"&&s!==null){const n=Or(e);return t("div",{className:"ss-dash-explain-result",children:t("table",{children:[t("thead",{children:t("tr",{children:n.map(r=>t("th",{children:r},r))})}),t("tbody",{children:e.map((r,l)=>{const a=r;return t("tr",{children:n.map(i=>t("td",{children:Br(a[i])},i))},l)})})]})})}return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"})}const ds=t("span",{className:"ss-empty-hint",children:["Queries require ",t("code",{children:"debug: true"})," on your Lucid connections in"," ",t("code",{children:"config/database.ts"})]});function Wr({mode:e,controllerState:s,queries:n,meta:r,isLoading:l,onSearchChange:a,onSort:i,onToggleExpand:o,onViewModeChange:d,onPageChange:h,onExplain:u,onCloseExplain:c,summary:v,filterBarChildren:p}){const{viewMode:f,sort:g,expandedIds:b,explainData:w,search:y}=s,m=!!u,x=e==="dashboard"&&!!r,_=e==="dashboard"&&!!d,A=U(()=>os(n),[n]);if(_&&f==="grouped")return P();return S();function P(){const R=Hr().map(q=>Kr(q,b,o));return t("div",{children:[t(Z,{search:y,onSearchChange:a,placeholder:"Filter queries...",summary:v,children:p}),l&&n.length===0?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:R,data:n,keyField:"sqlNormalized",sort:g.key,sortDir:g.dir,onSort:i,emptyMessage:t(D,{children:["No queries recorded",ds]})})})]})}function S(){const $=Ur({showExplain:m}),R=$.map(M=>Qr(M,b,A,w,o,u)),q=$.length,E=m?M=>{const J=M.id,z=w.get(J);return!z||z.loading?null:t("tr",{className:"ss-dash-explain-row",children:t("td",{colSpan:q,className:"ss-dash-explain",children:t("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[t("div",{style:{flex:1},children:z.error?t("div",{className:"ss-dash-explain-result ss-dash-explain-error",children:[t("strong",{children:"Error:"})," ",z.error,z.result?.message&&t(D,{children:[t("br",{}),z.result.message]})]}):z.result?t(Vr,{plan:z.result.plan||z.result.rows||[]}):null}),t("button",{type:"button",className:"ss-dash-explain-btn",onClick:()=>c?.(),style:{marginLeft:"8px",flexShrink:0},children:"Close"})]})})})}:void 0;return t("div",{children:[t(Z,{search:y,onSearchChange:a,placeholder:"Filter queries...",summary:v,children:p}),l&&n.length===0?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):t(D,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:R,data:n,sort:g.key,sortDir:g.dir,onSort:i,emptyMessage:t(D,{children:["No queries captured",ds]}),renderAfterRow:E})}),x&&r&&t(ie,{page:r.page,lastPage:r.lastPage,total:r.total,onPageChange:h})]})]})}}function Kr(e,s,n){const r={key:e.key,label:e.label,width:e.width,sortable:e.sortable};switch(e.type){case"sql":r.render=(l,a)=>{const i=l||"",o=(a.count||0)>=3;return t(D,{children:[t("span",{className:`ss-dash-sql ${s.has(i)?"ss-dash-expanded":""}`,title:"Click to expand",onClick:d=>{d.stopPropagation(),n(i)},role:"button",tabIndex:0,onKeyDown:d=>d.key==="Enter"&&n(i),children:i}),o&&t(D,{children:[" ",t("span",{className:"ss-dash-dup",children:"DUP"})]})]})};break;case"duration":r.render=l=>{const a=l||0,i=e.key==="avgDuration"||e.key==="maxDuration";return t("span",{className:`ss-dash-duration ${i?de(a):""}`,children:e.key==="totalDuration"?a.toFixed(1)+"ms":a.toFixed(2)+"ms"})};break;default:e.key==="count"?r.render=l=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:l||0}):e.key==="percentOfTotal"&&(r.render=l=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:(l||0).toFixed(1)+"%"}));break}return r}function Qr(e,s,n,r,l,a){const i={key:e.key,label:e.label,width:e.width,sortable:e.sortable};switch(e.type){case"index":i.render=o=>t("span",{style:{color:"var(--ss-dim)"},children:o});break;case"sql":i.render=(o,d)=>{const h=d.sql||d.sql_text||"",u=d.id;return t("div",{children:[t("span",{className:`ss-dash-sql ${s.has(u)?"ss-dash-expanded":""}`,title:"Click to expand",onClick:c=>{c.stopPropagation(),l(u)},role:"button",tabIndex:0,onKeyDown:c=>c.key==="Enter"&&l(u),children:h}),(n.get(Ee(d))??0)>1&&t("span",{className:"ss-dash-dup",children:["×",n.get(Ee(d))]})]})};break;case"duration":i.render=o=>{const d=o||0;return t("span",{className:`ss-dash-duration ${de(d)}`,children:d.toFixed(2)+"ms"})};break;case"method":i.render=(o,d)=>{const h=Qt(d);return t("span",{className:`ss-dash-method ss-dash-method-${h.toLowerCase()}`,children:h})};break;case"model":i.render=o=>t("span",{style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:o,children:o||"-"});break;case"connection":i.render=o=>t("span",{style:{color:"var(--ss-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o||"-"});break;case"time":i.render=(o,d)=>{const h=o||(Ce(d)??"");return t(ne,{ts:h,className:"ss-dash-event-time"})};break;case"explain":i.render=(o,d)=>{if(Qt(d)!=="select")return null;const u=d.id,c=r.get(u),v=c&&!c.loading&&c.result&&!c.error,p=c?.loading;return t("button",{type:"button",className:`ss-dash-explain-btn${v?" ss-dash-explain-btn-active":""}`,onClick:f=>{f.stopPropagation(),a?.(u)},disabled:!!p,children:p?"...":"EXPLAIN"})};break}return i}function hs({options:e={}}){const[s,n]=k(1),r=B(new qr("list")),[l,a]=k(r.current.state),i=T(()=>{a({...r.current.state})},[]),{viewMode:o,sort:d,search:h}=l,u=T(S=>{S!==r.current.state.viewMode&&(r.current.setViewMode(S),n(1),i())},[i]),c=T(S=>{r.current.setSearch(S),i()},[i]);H(()=>n(1),[h]);const v=o==="grouped"?"queries/grouped":"queries",{data:p,meta:f,isLoading:g,getApi:b}=V(v,{...e,page:s,search:h,sort:d.key,sortDir:d.dir}),w=T(S=>{r.current.toggleSort(S),i()},[i]),y=T(S=>{r.current.toggleExpand(S),i()},[i]),m=T(async S=>{const $=r.current.getExplainState(S);if($&&!$.loading){r.current.clearExplain(),i();return}r.current.startExplain(S),i();try{const R=await b().explainQuery(S);R&&R.error?r.current.completeExplain(S,{rows:[],error:R.error,message:R.message}):r.current.completeExplain(S,{plan:R?.plan||void 0,rows:R?.rows||void 0})}catch(R){console.warn("[ss] Query explain failed:",R),r.current.failExplain(S,R instanceof Error?R.message:String(R))}i()},[b,i]),x=T(()=>{r.current.clearExplain(),i()},[i]),_=o==="grouped"?p?.groups||[]:p||[],A=U(()=>o!=="grouped"?_:_.map(S=>{const $={...S};return $.sqlNormalized??=I(S,"sql_normalized","pattern")??void 0,$.count??=I(S,"total_count"),$.avgDuration??=I(S,"avg_duration"),$.maxDuration??=I(S,"max_duration"),$.minDuration??=I(S,"min_duration"),$.totalDuration??=I(S,"total_duration"),$.percentOfTotal??=I(S,"pct_time"),$}),[_,o]),P=U(()=>{if(o==="grouped")return`${A.length} query patterns`;const S=Fr(A,f??void 0),$=[`${S.totalCount} queries`];return S.slowCount>0&&$.push(`${S.slowCount} slow`),S.dupCount>0&&$.push(`${S.dupCount} dup`),$.push(`avg ${(S.avgDuration||0).toFixed(1)}ms`),$.join(", ")},[o,A,f]);return t(Wr,{mode:"dashboard",controllerState:l,queries:A,meta:f,isLoading:g&&!p,onSearchChange:c,onSort:w,onToggleExpand:y,onViewModeChange:u,onPageChange:n,onExplain:m,onCloseExplain:x,summary:P,filterBarChildren:t("div",{className:"ss-dash-btn-group",children:[t("button",{type:"button",className:`ss-dash-btn ${o==="list"?"ss-dash-active":""}`,onClick:()=>u("list"),children:"List"}),t("button",{type:"button",className:`ss-dash-btn ${o==="grouped"?"ss-dash-active":""}`,onClick:()=>u("grouped"),children:"Grouped"})]})})}const Jr=Object.freeze(Object.defineProperty({__proto__:null,QueriesSection:hs,default:hs},Symbol.toStringTag,{value:"Module"}));function us({options:e={}}){const[s,n]=k(1),[r,l]=k(""),{data:a,meta:i,isLoading:o}=V("events",{...e,page:s,search:r}),d=a||[];return H(()=>n(1),[r]),t("div",{children:[t(Z,{search:r,onSearchChange:l,placeholder:"Filter events...",summary:`${i?.total??0} events`}),o&&!a?t("div",{className:"ss-dash-empty",children:"Loading events..."}):t(D,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"id",label:"#",width:"40px",render:h=>t("span",{style:{color:"var(--ss-dim)"},children:h})},{key:"eventName",label:"Event",render:(h,u)=>{const c=Kt(u);return t("span",{className:"ss-dash-event-name",title:c,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:c})}},{key:"data",label:"Data",render:h=>t(Le,{data:h,maxPreviewLength:80,className:"ss-dash-event-data"})},{key:"createdAt",label:"Time",width:"80px",render:(h,u)=>{const c=Ce(u);return t(ne,{ts:c,className:"ss-dash-event-time"})}}],data:d,emptyMessage:"No events recorded yet"})}),i&&t(ie,{page:i.page,lastPage:i.lastPage,total:i.total,onPageChange:n})]})]})}const Gr=Object.freeze(Object.defineProperty({__proto__:null,EventsSection:us,default:us},Symbol.toStringTag,{value:"Module"}));function ps({options:e={}}){const[s,n]=k(""),{data:r,isLoading:l,error:a}=V("routes",{...e,search:s}),i=r,o=Array.isArray(i)?i:i&&Array.isArray(i.routes)?i.routes:i&&Array.isArray(i.data)?i.data:[],d={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return t("div",{children:[t(Z,{search:s,onSearchChange:n,placeholder:"Filter routes...",summary:`${o.length} routes`}),a?t("div",{className:"ss-dash-empty",children:"Failed to load routes"}):l&&!r?t("div",{className:"ss-dash-empty",children:"Loading routes..."}):t(D,{children:t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"method",label:"Method",width:"70px",render:h=>t(Ge,{method:h})},{key:"pattern",label:"Pattern",render:h=>t("span",{style:{color:"var(--ss-text)",...d},title:h,children:h})},{key:"name",label:"Name",width:"120px",render:h=>t("span",{style:{color:"var(--ss-muted)",...d},title:h||"-",children:h||"-"})},{key:"handler",label:"Handler",render:h=>t("span",{style:{color:"var(--ss-sql-color)",...d},title:h,children:h})},{key:"middleware",label:"Middleware",render:h=>{const u=h?.length?h.join(", "):"-";return t("span",{style:{color:"var(--ss-dim)",fontSize:"10px",...d},title:u,children:u})}}],data:o,keyField:"pattern",emptyMessage:"No routes available"})})})]})}const Yr=Object.freeze(Object.defineProperty({__proto__:null,RoutesSection:ps,default:ps},Symbol.toStringTag,{value:"Module"}));function fs({options:e={}}){const[s,n]=k(1),[r,l]=k(""),[a,i]=k("all"),[o,d]=k(""),[h,u]=k(""),[c,v]=k([]),[p,f]=k("level"),[g,b]=k("equals"),[w,y]=k(""),[m,x]=k(null),_={};a!=="all"&&(_.level=a),o&&(_.request_id=o),c.forEach((N,C)=>{_[`filter_field_${C}`]=N.field,_[`filter_op_${C}`]=N.operator,_[`filter_value_${C}`]=N.value});const{data:A,meta:P,isLoading:S}=V("logs",{...e,page:s,search:r,filters:_}),$=A||[],R=T(N=>{d(N),u(N),n(1)},[]),q=T(()=>{const N=h.trim();d(N),n(1)},[h]),E=T(()=>{d(""),u(""),n(1)},[]),M=T(()=>{i("all"),n(1)},[]),J=T(()=>{const N=w.trim();N&&(v(C=>[...C,{field:p,operator:g,value:N}]),y(""))},[p,g,w]),z=T(N=>{v(C=>C.filter((Q,pe)=>pe!==N))},[]),Xe=a!=="all"||o!==""||c.length>0;return t("div",{children:[t(Z,{search:r,onSearchChange:l,placeholder:"Search logs...",summary:`${P?.total??0} logs`,children:t("div",{className:"ss-dash-log-filters",children:[wr.map(N=>t("button",{type:"button",className:`ss-dash-log-filter ${a===N?"ss-dash-active":""}`,onClick:()=>{i(N),n(1)},children:N},N)),t("input",{type:"text",className:"ss-dash-filter-input ss-dash-reqid-input",placeholder:"Filter by request ID...",value:h,onChange:N=>u(N.target.value),onKeyDown:N=>N.key==="Enter"&&q()}),(h||o)&&t("button",{type:"button",className:"ss-dash-btn ss-dash-reqid-clear",onClick:()=>{E()},children:"Clear"})]})}),t("div",{className:"ss-dash-structured-search",children:[t("select",{className:"ss-dash-filter-select",value:p,onChange:N=>f(N.target.value),children:[t("option",{value:"level",children:"level"}),t("option",{value:"message",children:"message"}),t("option",{value:"request_id",children:"request_id"}),t("option",{value:"userId",children:"userId"}),t("option",{value:"email",children:"email"}),t("option",{value:"path",children:"path"})]}),t("select",{className:"ss-dash-filter-select",value:g,onChange:N=>b(N.target.value),children:[t("option",{value:"equals",children:"equals"}),t("option",{value:"contains",children:"contains"}),t("option",{value:"starts_with",children:"starts with"})]}),t("input",{className:"ss-dash-filter-input",placeholder:"Value...",value:w,onChange:N=>y(N.target.value),onKeyDown:N=>N.key==="Enter"&&J()}),t("button",{type:"button",className:"ss-dash-btn",onClick:J,children:"Add"})]}),Xe&&t("div",{className:"ss-dash-filter-chips",children:[a!=="all"&&t("span",{className:"ss-dash-filter-chip",children:["level: ",a,t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:M,children:"×"})]}),o&&t("span",{className:"ss-dash-filter-chip",children:["requestId: ",o.slice(0,8),"...",t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:E,children:"×"})]}),c.map((N,C)=>t("span",{className:"ss-dash-filter-chip",children:[N.field," ",N.operator,' "',N.value,'"',t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:()=>z(C),children:"×"})]},C))]}),S&&!A?t("div",{className:"ss-dash-empty",children:"Loading logs..."}):$.length===0?t("div",{className:"ss-dash-empty",children:["No log entries",o?` matching request ${o}`:a!=="all"?` for ${a}`:""]}):t("div",{className:"ss-dash-log-entries",children:$.map((N,C)=>t(ss,{log:N,index:C,expanded:m===C,onToggleExpand:Q=>x(m===Q?null:Q),onReqIdClick:R},N.id||C))}),P&&t(ie,{page:P.page,lastPage:P.lastPage,total:P.total,onPageChange:n})]})}const Zr=Object.freeze(Object.defineProperty({__proto__:null,LogsSection:fs,default:fs},Symbol.toStringTag,{value:"Module"}));function Xr({email:e,previewHtml:s,isLoading:n=!1,onClose:r,className:l}){return t("div",{className:l||"ss-email-preview",children:[t("div",{className:"ss-email-preview-header",children:[t("div",{className:"ss-email-preview-meta",children:e&&t(D,{children:[e.subject!=null&&t("div",{children:[t("strong",{children:"Subject:"})," ",e.subject]}),e.from!=null&&t("div",{children:[t("strong",{children:"From:"})," ",e.from]}),e.to!=null&&t("div",{children:[t("strong",{children:"To:"})," ",e.to]}),e.cc&&t("div",{children:[t("strong",{children:"CC:"})," ",e.cc]}),e.status&&t("div",{children:[t("strong",{children:"Status:"})," ",t("span",{className:`ss-email-status ss-email-status-${e.status}`,children:e.status})]}),e.mailer&&t("div",{children:[t("strong",{children:"Mailer:"})," ",e.mailer]})]})}),t("button",{className:"ss-dbg-btn-clear",onClick:r,type:"button",children:"×"})]}),n?t("div",{className:"ss-empty",children:"Loading preview..."}):s?t("iframe",{className:"ss-email-iframe",srcDoc:s,title:"Email preview",sandbox:""}):t("div",{style:{padding:"12px",whiteSpace:"pre-wrap"},children:e?.text||"No content"})]})}function ms({options:e={}}){const[s,n]=k(1),[r,l]=k(""),[a,i]=k(null),[o,d]=k(null),{data:h,meta:u,isLoading:c}=V("emails",{...e,page:s,search:r}),v=h||[];H(()=>n(1),[r]);const p=T(async f=>{if(f.html){i(f.id),d(f.html);return}try{const{baseUrl:g="",dashboardEndpoint:b="/__stats/api",authToken:w}=e,y=`${g}${b}/emails/${f.id}/preview`,m={Accept:"text/html"};w&&(m.Authorization=`Bearer ${w}`);const _=await(await fetch(y,{headers:m,credentials:"same-origin"})).text();i(f.id),d(_)}catch{}},[e]);if(a&&o){const f=v.find(b=>b.id===a),g=f?{subject:f.subject,from:Vt(f),to:Wt(f),cc:Jn(f)||null,status:f.status,mailer:f.mailer}:null;return t(Xr,{email:g,previewHtml:o,onClose:()=>{i(null),d(null)},className:"ss-dash-email-preview"})}return t("div",{children:[t(Z,{search:r,onSearchChange:l,placeholder:"Filter emails...",summary:`${u?.total??0} emails`}),c&&!h?t("div",{className:"ss-dash-empty",children:"Loading emails..."}):t(D,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"id",label:"#",width:"40px",render:f=>t("span",{style:{color:"var(--ss-dim)"},children:f})},{key:"from",label:"From",width:"150px",render:(f,g)=>{const b=Vt(g);return t("span",{title:b,style:{color:"var(--ss-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:b})}},{key:"to",label:"To",width:"150px",render:(f,g)=>{const b=Wt(g);return t("span",{title:b,style:{color:"var(--ss-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:b})}},{key:"subject",label:"Subject",render:f=>{const g=f||"";return t("span",{title:g,style:{color:"var(--ss-sql-color)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:g})}},{key:"status",label:"Status",width:"80px",render:f=>{const g=f||"";return t("span",{className:`ss-dash-badge ss-dash-email-status-${g}`,children:g})}},{key:"attachmentCount",label:"ATT",width:"40px",render:(f,g)=>{const b=Gn(g);return b>0?t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:b}):t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:"-"})}},{key:"mailer",label:"Mailer",width:"70px",render:f=>{const g=f||"";return t("span",{title:g,style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:g})}},{key:"createdAt",label:"Time",width:"80px",render:(f,g)=>{const b=Ce(g);return t(ne,{ts:b,className:"ss-dash-event-time",style:{whiteSpace:"nowrap"}})}}],data:v,onRowClick:p,rowClassName:"ss-dash-email-row",emptyMessage:"No emails captured yet"})}),u&&t(ie,{page:u.page,lastPage:u.lastPage,total:u.total,onPageChange:n})]})]})}const ea=Object.freeze(Object.defineProperty({__proto__:null,EmailsSection:ms,default:ms},Symbol.toStringTag,{value:"Module"}));function ta({hitRate:e,hits:s,misses:n,keys:r}){return t("div",{className:"ss-cache-stats",children:[t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-cache-stat-value",children:[e.toFixed(1),"%"]})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-cache-stat-value",children:s})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-cache-stat-value",children:n})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-cache-stat-value",children:r})]})]})}function vs({options:e={}}){const[s,n]=k(""),[r,l]=k(null),[a,i]=k(null),[o,d]=k(!1),[h,u]=k(null),{data:c,isLoading:v,mutate:p,getApi:f}=V("cache",{...e,search:s}),g=c,b=T(async y=>{if(confirm(`Delete cache key "${y}"?`))try{await p(`cache/${encodeURIComponent(y)}`,"delete"),r===y&&(l(null),i(null),u(null))}catch{}},[p,r]),w=T(async y=>{if(r===y){l(null),i(null),u(null);return}l(y),i(null),u(null),d(!0);try{const x=await f().fetchCacheKey(y);i(x.value!==void 0?x.value:x.data!==void 0?x.data:x),u(null)}catch{i(null),u("Failed to fetch key value")}finally{d(!1)}},[r,f]);return t("div",{children:[g?.available&&g?.stats&&t(ta,{hitRate:g.stats.hitRate??0,hits:g.stats.hits??0,misses:g.stats.misses??0,keys:g.stats.totalKeys||g.stats.keyCount||g.keys?.length||0}),t(Z,{search:s,onSearchChange:n,placeholder:"Filter cache keys...",summary:`${(g?.keys||g?.data||[]).length} keys`}),v&&!c?t("div",{className:"ss-dash-empty",children:"Loading cache..."}):!g||!g.available?t("div",{className:"ss-dash-empty",children:"Cache inspector not available"}):t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"key",label:"Key",render:y=>t("span",{title:y,style:{color:"var(--ss-sql-color)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:y})},{key:"type",label:"Type",width:"70px",render:y=>t("span",{style:{color:"var(--ss-muted)"},children:y})},{key:"size",label:"Size",width:"60px",render:y=>y!=null&&y>0?rr(y):"-"},{key:"ttl",label:"TTL",width:"70px",render:y=>y>0?nr(y):"-"},{key:"_actions",label:"",width:"60px",render:(y,m)=>t("button",{type:"button",className:"ss-dash-retry-btn",onClick:x=>{x.stopPropagation(),b(m.key)},children:"Delete"})}],data:g.keys||g.data||[],keyField:"key",onRowClick:y=>w(y.key),emptyMessage:"No cache keys found"})}),r&&t("div",{className:"ss-dash-cache-detail",children:[t("h4",{children:["Key: ",r]}),o?t("div",{className:"ss-dash-empty",children:"Loading value..."}):h?t("div",{className:"ss-dash-empty",style:{color:"var(--ss-red-fg)"},children:h}):t(Le,{data:a})]})]})}const sa=Object.freeze(Object.defineProperty({__proto__:null,CacheSection:vs,default:vs},Symbol.toStringTag,{value:"Module"})),na=["all","active","waiting","delayed","completed","failed"];function ra(e){switch(e){case"active":return"blue";case"waiting":return"amber";case"delayed":return"purple";case"completed":return"green";case"failed":return"red";default:return"muted"}}function aa(e){if(!e)return[];if(Array.isArray(e))return e;const s=e;return s.jobs||s.data||[]}function ia(e){if(!e||Array.isArray(e))return null;const s=e;return s.stats||s.overview||null}function la({stats:e,classPrefix:s="ss"}){if(!e)return null;const n=s;return t("div",{className:`${n}-job-stats`,children:[t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Active:"}),t("span",{className:`${n}-job-stat-value`,children:e.active??0})]}),t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Waiting:"}),t("span",{className:`${n}-job-stat-value`,children:e.waiting??0})]}),t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Delayed:"}),t("span",{className:`${n}-job-stat-value`,children:e.delayed??0})]}),t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Completed:"}),t("span",{className:`${n}-job-stat-value`,children:e.completed??0})]}),t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Failed:"}),t("span",{className:`${n}-job-stat-value ${n}-c-red`,children:e.failed??0})]})]})}function gs({options:e={}}){const[s,n]=k(1),[r,l]=k(""),[a,i]=k("all"),[o,d]=k({}),h={};a!=="all"&&(h.status=a);const{data:u,meta:c,isLoading:v,error:p,refresh:f,mutate:g}=V("jobs",{...e,page:s,search:r,filters:h}),b=aa(u),w=ia(u),y=T(async m=>{d(x=>({...x,[m]:"pending"}));try{await g(`jobs/${m}/retry`),d(x=>({...x,[m]:"success"})),setTimeout(()=>{d(x=>{const _={...x};return delete _[m],_}),f()},1e3)}catch{d(x=>{const _={...x};return delete _[m],_})}},[g,f]);return t("div",{children:[t(la,{stats:w,classPrefix:"ss-dash"}),t(Z,{search:r,onSearchChange:l,placeholder:"Filter jobs...",summary:`${c?.total??b.length} jobs`,children:t("div",{className:"ss-dash-btn-group",children:na.map(m=>t("button",{type:"button",className:`ss-dash-btn ${a===m?"ss-dash-active":""}`,onClick:()=>{i(m),n(1)},children:m.charAt(0).toUpperCase()+m.slice(1)},m))})}),v&&!u?t("div",{className:"ss-dash-empty",children:"Loading jobs..."}):p?t("div",{className:"ss-dash-empty",children:"Jobs/Queue not available"}):t(D,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"id",label:"ID",width:"40px",render:m=>t("span",{style:{color:"var(--ss-dim)"},children:m})},{key:"name",label:"Name",render:m=>t("span",{style:{color:"var(--ss-text)"},title:m,children:m})},{key:"status",label:"Status",width:"90px",render:m=>t(yr,{color:ra(m),children:m})},{key:"payload",label:"Payload",render:(m,x)=>t(Le,{data:m||x?.data,maxPreviewLength:60})},{key:"attempts",label:"Tries",width:"50px",render:(m,x)=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:m||x.attemptsMade||0})},{key:"duration",label:"Duration",width:"75px",render:m=>t("span",{className:"ss-dash-duration",children:m!==null?X(m):"-"})},{key:"timestamp",label:"Time",width:"70px",render:(m,x)=>{const _=m||zn(x);return t(ne,{ts:_,className:"ss-dash-event-time",style:{whiteSpace:"nowrap"}})}},{key:"_actions",label:"",width:"50px",render:(m,x)=>{const _=x.id,A=o[_];return x.status!=="failed"?null:t("button",{type:"button",className:"ss-dash-retry-btn",disabled:A==="pending"||A==="success",onClick:P=>{P.stopPropagation(),y(_)},children:A==="pending"?"...":A==="success"?"OK":"Retry"})}}],data:b,emptyMessage:"No jobs found"})}),c&&t(ie,{page:c.page,lastPage:c.lastPage,total:c.total,onPageChange:n})]})]})}const oa=Object.freeze(Object.defineProperty({__proto__:null,JobsSection:gs,default:gs},Symbol.toStringTag,{value:"Module"}));function K(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function Ae(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!K(e)}function Ye(e,s=""){if(!Ae(e))return[{path:s,value:e}];const n=[];for(const r of Object.keys(e)){const l=s?`${s}.${r}`:r,a=e[r];Ae(a)?n.push(...Ye(a,l)):n.push({path:l,value:a})}return n}function Ze(e){return e==null?{text:"null",color:"var(--ss-dim)"}:typeof e=="boolean"?{text:String(e),color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"}:typeof e=="number"?{text:String(e),color:"var(--ss-amber-fg)"}:Array.isArray(e)?{text:`[${e.map(n=>n==null?"null":typeof n=="object"?JSON.stringify(n):String(n)).join(", ")}]`,color:"var(--ss-purple-fg)"}:typeof e=="object"?{text:JSON.stringify(e),color:"var(--ss-dim)"}:{text:String(e)}}function _s(e){if(e==null||typeof e!="object"||Array.isArray(e)||K(e))return 1;let s=0;for(const n of Object.keys(e))s+=_s(e[n]);return s}function ca(e){if(!Ae(e))return[];const s=[];for(const n of Object.keys(e))Ae(e[n])&&s.push(n);return s}function Pe(e,s,n){s&&navigator.clipboard.writeText(e).then(()=>{const r=s.textContent;s.textContent="✓",s.classList.add(`${n}-copy-row-ok`),setTimeout(()=>{s.textContent=r,s.classList.remove(`${n}-copy-row-ok`)},1200)}).catch(()=>{})}function Re({redacted:e,p:s}){const[n,r]=k(!1);return t("span",{className:`${s}-config-redacted`,style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[t("span",{children:n?e.value:e.display}),t("button",{type:"button",className:`${s}-btn`,title:n?"Hide":"Reveal",style:{padding:"0 4px",fontSize:"0.85em",lineHeight:1,minWidth:"auto"},onClick:l=>{l.stopPropagation(),r(a=>!a)},children:n?t("svg",{width:"14",height:"14",viewBox:F["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:F.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F.eye.elements.join("")}})})]})}function da({env:e,search:s,p:n}){const r=B(new Map),l=s.toLowerCase(),a=Object.entries(e).filter(([i,o])=>{if(!l)return!0;const d=K(o)?o.display:o==null?"":String(o);return i.toLowerCase().includes(l)||d.toLowerCase().includes(l)});return t("div",{className:`${n}-config-table-wrap`,children:t("table",{className:`${n}-table ${n}-config-env-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Variable"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[a.map(([i,o])=>{const d=K(o),h=d?o.display:o==null?"null":String(o),u=`${i}=${h}`;return t("tr",{children:[t("td",{className:`${n}-env-key`,children:t("span",{className:`${n}-config-key`,children:i})}),t("td",{className:`${n}-env-val`,children:d?t(Re,{redacted:o,p:n}):t("span",{className:`${n}-config-val`,children:h})}),t("td",{children:!d&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:c=>{r.current.set(i,c)},onClick:c=>{c.stopPropagation(),Pe(u,r.current.get(i)??null,n)},children:"⎘"})})]},i)}),a.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function ha({source:e,search:s,p:n}){const r=B(new Map),l=s.toLowerCase(),a=Ye(e,""),i=a.filter(o=>{const d=K(o.value)?o.value.display:o.value===null||o.value===void 0?"":String(o.value);return o.path.toLowerCase().includes(l)||d.toLowerCase().includes(l)});return t("div",{className:`${n}-config-table-wrap`,children:[t("table",{className:`${n}-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Path"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[i.map(o=>{const d=K(o.value),h=d?null:Ze(o.value),u=d?o.value.display:h.text,c=`${o.path}: ${u}`;return t("tr",{children:[t("td",{children:t("span",{className:`${n}-config-key`,style:{whiteSpace:"nowrap"},children:o.path})}),t("td",{children:d?t(Re,{redacted:o.value,p:n}):t("span",{className:`${n}-config-val`,style:{wordBreak:"break-all",color:h.color},children:h.text})}),t("td",{children:!d&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:v=>{r.current.set(o.path,v)},onClick:v=>{v.stopPropagation(),Pe(c,r.current.get(o.path)??null,n)},children:"⎘"})})]},o.path)}),i.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching entries"})})]})]}),t("div",{style:{padding:"4px 16px",fontSize:"10px",color:"var(--ss-muted)"},children:[i.length," of ",a.length," entries"]})]})}function ua({obj:e,prefix:s,p:n}){const r=B(new Map),l=Ye(e,s);return t("table",{className:`${n}-table ${n}-config-inner-table`,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"35%"},children:"Key"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:l.map(a=>{const i=a.path.indexOf(s+".")===0?a.path.slice(s.length+1):a.path,o=K(a.value),d=o?null:Ze(a.value),h=o?a.value.display:d.text,u=`${a.path}: ${h}`;return t("tr",{children:[t("td",{title:i,children:t("span",{className:`${n}-config-key`,children:i})}),t("td",{title:h,children:o?t(Re,{redacted:a.value,p:n}):t("span",{className:`${n}-config-val`,style:{color:d.color},children:d.text})}),t("td",{children:!o&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:c=>{r.current.set(a.path,c)},onClick:c=>{c.stopPropagation(),Pe(u,r.current.get(a.path)??null,n)},children:"⎘"})})]},a.path)})})]})}function pa({value:e,p:s}){if(e==null)return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(K(e))return t(Re,{redacted:e,p:s});if(typeof e=="boolean")return t("span",{className:`${s}-config-val`,style:{color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"},children:String(e)});if(typeof e=="number")return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-amber-fg)"},children:String(e)});if(Array.isArray(e)){const n=e.map(r=>r==null?"null":typeof r=="object"?JSON.stringify(r):String(r));return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-purple-fg)"},children:["[",n.join(", "),"]"]})}return typeof e=="object"?t("span",{className:`${s}-config-val`,style:{color:"var(--ss-dim)"},children:JSON.stringify(e)}):t("span",{className:`${s}-config-val`,children:String(e)})}function fa({obj:e,expandedPaths:s,onToggle:n,p:r}){if(e==null||typeof e!="object"||Array.isArray(e)||K(e))return null;const l=Object.keys(e),a=B(new Map);return t("div",{className:`${r}-config-sections`,children:l.map(i=>{const o=e[i],d=o!==null&&typeof o=="object"&&!Array.isArray(o)&&!K(o),h=s.has(i),u=K(o);return t("div",{className:`${r}-config-section`,children:[t("div",{className:`${r}-config-section-header${d?"":` ${r}-config-leaf`}`,onClick:d?()=>n(i):void 0,style:{cursor:d?"pointer":"default"},children:[d?t("span",{className:`${r}-config-toggle`,children:h?"▼":"▶"}):t("span",{className:`${r}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${r}-config-key`,children:i}),d?t("span",{className:`${r}-config-count`,children:[_s(o)," entries"]}):t(D,{children:[t("span",{className:`${r}-config-val`,style:{marginLeft:"8px"},children:t(pa,{value:o,p:r})}),!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:c=>{a.current.set(i,c)},onClick:c=>{c.stopPropagation();const v=Ze(o);Pe(`${i}: ${v.text}`,a.current.get(i)??null,r)},children:"⎘"})]})]}),d&&h&&t("div",{className:`${r}-config-section-body`,children:t(ua,{obj:o,prefix:i,p:r})})]},i)})})}function ma({data:e,isLoading:s,classPrefix:n}){const r=n,[l,a]=k(""),[i,o]=k(""),[d,h]=k("app"),[u,c]=k(new Set),[v,p]=k("Copy JSON");H(()=>{const m=setTimeout(()=>o(l),200);return()=>clearTimeout(m)},[l]);const f=e,g=T(m=>{c(x=>{const _=new Set(x);return _.has(m)?_.delete(m):_.add(m),_})},[]),b=T(()=>{if(!f)return;const m=d==="app"?f.app:f.env;if(!m)return;const x=ca(m);c(new Set(x))},[f,d]),w=T(()=>{c(new Set)},[]),y=T(async()=>{if(f)try{const m=d==="app"?f.app:f.env;await navigator.clipboard.writeText(JSON.stringify(m,null,2)),p("Copied!"),setTimeout(()=>p("Copy JSON"),1500)}catch{}},[f,d]);return t("div",{children:[t("div",{className:`${r}-config-toolbar`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px"},children:[t("button",{type:"button",className:`${r}-config-tab${d==="app"?` ${r}-active`:""}`,onClick:()=>h("app"),children:"App Config"}),t("button",{type:"button",className:`${r}-config-tab${d==="env"?` ${r}-active`:""}`,onClick:()=>h("env"),children:"Env"}),t("div",{style:{position:"relative",flex:1},children:[t("input",{type:"text",className:`${r}-search`,placeholder:"Search keys and values...",value:l,onChange:m=>a(m.target.value),style:{width:"100%"}}),l&&t("button",{type:"button",onClick:()=>a(""),style:{position:"absolute",right:"6px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"14px",color:"var(--ss-dim)",padding:"0 2px",lineHeight:1},children:"×"})]}),d==="app"&&!i&&t(D,{children:[t("button",{type:"button",className:`${r}-btn`,onClick:b,children:"Expand All"}),t("button",{type:"button",className:`${r}-btn`,onClick:w,children:"Collapse All"})]}),t("button",{type:"button",className:`${r}-btn`,onClick:y,children:v})]}),s&&!e?t("div",{className:`${r}-empty`,children:"Loading config..."}):f?d==="env"?t(da,{env:f.env??{},search:i,p:r}):i?t(ha,{source:f.app??{},search:i,p:r}):t("div",{className:`${r}-config-table-wrap`,children:t(fa,{obj:f.app,expandedPaths:u,onToggle:g,p:r})}):t("div",{className:`${r}-empty`,children:"Config not available"})]})}function ys({options:e={}}){const{data:s,isLoading:n}=V("config",e);return t(ma,{data:s,isLoading:n,classPrefix:"ss-dash"})}const va=Object.freeze(Object.defineProperty({__proto__:null,ConfigSection:ys,default:ys},Symbol.toStringTag,{value:"Module"}));function ga(e={}){const{baseUrl:s="",debugEndpoint:n="/admin/api/debug",authToken:r,refreshInterval:l=3e3}=e,[a,i]=k(null),[o,d]=k(!0),[h,u]=k(null),c=B(null),v=Xt(s,r),p=T(async()=>{try{const g=await v().get(`${n}/diagnostics`);i(g),u(null),d(!1)}catch(f){if(f instanceof ze){u(f),d(!1),c.current&&(clearInterval(c.current),c.current=null);return}u(f instanceof Error?f:new Error(String(f))),d(!1)}},[n,v]);return H(()=>(d(!0),u(null),p(),c.current=setInterval(p,l),()=>{c.current&&(clearInterval(c.current),c.current=null)}),[p,l]),{data:a,isLoading:o,error:h}}const _a=["password","secret","token","key","credential","auth"];function bs(e){const s=e.toLowerCase();return _a.some(n=>s.includes(n))}function ws(e){if(e==null)return"-";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.join(", ")||"-";try{return JSON.stringify(e)}catch{return String(e)}}const ya={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function ba(e){return ya[e]||e}const wa={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function xa(e){return wa[e]||e}const Na=["healthy","active","connected","available","ready"],ka=["errored","unavailable"];function Sa(e){return Na.includes(e)?"ok":ka.includes(e)?"err":""}function he({status:e,prefix:s}){const n=Sa(e);let r=`${s}-dot`;return n==="ok"?r+=` ${s}-dot-ok`:n==="err"&&(r+=` ${s}-dot-err`),t("span",{className:r})}const xs=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:F.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F.eye.elements.join("")}}),Ns=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:F["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F["eye-off"].elements.join("")}});function $a({value:e}){const[s,n]=k(!1);return t("span",{children:[s?e:"••••••••"," ",t("button",{type:"button",onClick:()=>n(r=>!r),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:s?t(Ns,{}):t(xs,{})})]})}function Ca({current:e,max:s,prefix:n}){const r=s>0?Math.min(100,Math.round(e/s*100)):0,l=r>=100;return t("div",{className:`${n}-bar`,children:[t("div",{className:`${n}-bar-track`,children:t("div",{className:`${n}-bar-fill${l?` ${n}-bar-fill-warn`:""}`,style:{width:`${r}%`}})}),t("span",{className:`${n}-bar-pct${l?` ${n}-bar-pct-warn`:""}`,children:[r,"%"]})]})}function Ea({config:e,prefix:s}){const n=Object.entries(e);return n.length===0?t("span",{className:`${s}-c-dim`,children:"-"}):t("span",{className:`${s}-c-muted`,children:n.map(([r,l],a)=>t("span",{children:[a>0&&", ",t("span",{className:`${s}-c-dim`,children:r}),"=",bs(r)&&typeof l=="string"?t($a,{value:l}):t("span",{children:ws(l)})]},r))})}function ue({label:e,value:s,prefix:n}){return t("div",{className:`${n}-info-card`,children:[t("span",{className:`${n}-info-card-label`,children:e}),t("span",{className:`${n}-info-card-value`,children:s})]})}function Ta({data:e,tableClassName:s,classPrefix:n}){const r=n||"ss-dash",[l,a]=k(new Set),i=T(u=>{a(c=>{const v=new Set(c);return v.has(u)?v.delete(u):v.add(u),v})},[]),o=T((u,c)=>{if(c==null)return t("span",{className:`${r}-c-dim`,children:"null"});if(typeof c=="boolean")return t("span",{className:c?`${r}-c-green`:`${r}-c-red`,children:String(c)});if(Array.isArray(c))return t("span",{children:c.join(", ")||"-"});const v=ws(c);if(bs(u)){const p=l.has(u);return t("span",{children:[p?v:"••••••••"," ",t("button",{type:"button",onClick:()=>i(u),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:p?t(Ns,{}):t(xs,{})})]})}return t("span",{children:v})},[l,i,r]),h=e.collectors?.some(u=>u.name==="db_pool"||u.name==="app")&&Array.isArray(e.lucidDebugConnections)&&e.lucidDebugConnections.length===0;return t("div",{children:[h&&t("div",{style:{background:"var(--ss-amber-bg)",color:"var(--ss-amber-fg)",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",marginBottom:"12px",lineHeight:1.5},children:[t("strong",{children:"Query capture disabled"})," — no Lucid connections have"," ",t("code",{style:{fontSize:"11px"},children:"debug: true"}),". Add it to your database connection in ",t("code",{style:{fontSize:"11px"},children:"config/database.ts"})," to see queries in the Queries panel."]}),t("h3",{className:`${r}-internals-title`,children:"Package Info"}),t("div",{className:`${r}-info-cards`,children:[t(ue,{label:"Version",value:e.package.version||"-",prefix:r}),t(ue,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:r}),t(ue,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:r}),t(ue,{label:"Uptime",value:er(e.package.uptime),prefix:r}),t(ue,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:r})]}),e.collectors.length>0&&t(D,{children:[t("h3",{className:`${r}-internals-title`,children:"Collectors"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Collector"}),t("th",{children:"Status"}),t("th",{children:"Last Error"}),t("th",{children:"Config"})]})}),t("tbody",{children:e.collectors.map(u=>t("tr",{children:[t("td",{children:[t("code",{children:u.name}),u.label&&u.label!==u.name&&t("span",{className:`${r}-c-dim`,children:[" ",u.label]})]}),t("td",{children:[t(he,{status:u.status,prefix:r}),u.status]}),t("td",{className:u.lastError?`${r}-c-red`:`${r}-c-dim`,children:u.lastError?t(D,{children:[u.lastError,u.lastErrorAt&&t("span",{className:`${r}-c-dim`,style:{fontSize:"10px"},children:Ke(u.lastErrorAt)})]}):"-"}),t("td",{children:t(Ea,{config:u.config,prefix:r})})]},u.name))})]})]}),t("h3",{className:`${r}-internals-title`,children:"Buffers"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Buffer"}),t("th",{children:"Usage"}),t("th",{children:"Fill %"})]})}),t("tbody",{children:Object.entries(e.buffers).map(([u,c])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:u}),t("td",{children:[c.current.toLocaleString()," / ",c.max.toLocaleString()]}),t("td",{children:t(Ca,{current:c.current,max:c.max,prefix:r})})]},u))})]}),t("h3",{className:`${r}-internals-title`,children:"Timers"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Timer"}),t("th",{children:"Status"}),t("th",{children:"Interval"})]})}),t("tbody",{children:Object.entries(e.timers).map(([u,c])=>t("tr",{children:[t("td",{children:ba(u)}),t("td",{children:[t(he,{status:c.active?"active":"inactive",prefix:r}),t("span",{className:c.active?`${r}-c-green`:`${r}-c-dim`,children:c.active?"active":"inactive"})]}),t("td",{children:c.active?c.intervalMs?X(c.intervalMs):c.debounceMs?`${X(c.debounceMs)} (debounce)`:"-":t("span",{className:`${r}-c-dim`,children:"—"})})]},u))})]}),t("h3",{className:`${r}-internals-title`,children:"Integrations"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Integration"}),t("th",{children:"Status"}),t("th",{children:"Details"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Transmit (SSE)"}),t("td",{children:[t(he,{status:e.transmit.available?"connected":"inactive",prefix:r}),e.transmit.available?"connected":"unavailable"]}),t("td",{style:{fontSize:"11px"},children:e.transmit.channels.length>0?`Channels: ${e.transmit.channels.join(", ")}`:"-"})]}),Object.entries(e.integrations).map(([u,c])=>{const v=c.active??c.available??!1,p=c.active?"active":c.available?"available":"unavailable";let f=c.mode?`Mode: ${c.mode}`:"-";return u==="edgePlugin"&&c.active?f="@serverStats() tag registered":u==="cacheInspector"&&c.available?f="Redis dependency detected":u==="queueInspector"&&c.available&&(f="Queue dependency detected"),t("tr",{children:[t("td",{children:xa(u)}),t("td",{children:[t(he,{status:v?"active":"inactive",prefix:r}),p]}),t("td",{className:`${r}-c-dim`,style:{fontSize:"11px"},children:f})]},u)})]})]}),e.storage&&t(D,{children:[t("h3",{className:`${r}-internals-title`,children:"Storage (SQLite)"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Metric"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Status"}),t("td",{children:[t(he,{status:e.storage.ready?"ready":"inactive",prefix:r}),e.storage.ready?"ready":"not ready"]})]}),t("tr",{children:[t("td",{children:"DB Path"}),t("td",{children:t("code",{children:e.storage.dbPath})})]}),t("tr",{children:[t("td",{children:"File Size"}),t("td",{children:[e.storage.fileSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"WAL Size"}),t("td",{children:[e.storage.walSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"Retention"}),t("td",{children:[e.storage.retentionDays," days"]})]}),t("tr",{children:[t("td",{children:"Last Cleanup"}),t("td",{children:e.storage.lastCleanupAt?Ke(e.storage.lastCleanupAt):"-"})]})]})]}),e.storage.tables.length>0&&t("table",{className:s,style:{marginTop:8},children:[t("thead",{children:t("tr",{children:[t("th",{children:"Table"}),t("th",{children:"Rows"})]})}),t("tbody",{children:e.storage.tables.map(u=>t("tr",{children:[t("td",{children:t("code",{children:u.name})}),t("td",{children:u.rowCount.toLocaleString()})]},u.name))})]})]}),t("h3",{className:`${r}-internals-title`,children:"Resolved Config"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"intervalMs"}),t("td",{children:e.config.intervalMs})]}),t("tr",{children:[t("td",{children:"transport"}),t("td",{children:e.config.transport})]}),t("tr",{children:[t("td",{children:"channelName"}),t("td",{children:e.config.channelName})]}),t("tr",{children:[t("td",{children:"endpoint"}),t("td",{children:e.config.endpoint===!1?"false":e.config.endpoint})]}),t("tr",{children:[t("td",{children:"skipInTest"}),t("td",{children:o("skipInTest",e.config.skipInTest)})]}),t("tr",{children:[t("td",{children:"onStats callback"}),t("td",{children:e.config.hasOnStatsCallback?"defined":"not defined"})]}),t("tr",{children:[t("td",{children:"shouldShow callback"}),t("td",{children:e.config.hasShouldShowCallback?"defined":"not defined"})]})]})]}),t("h4",{className:`${r}-internals-title`,children:"DevToolbar"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:Object.entries(e.devToolbar).map(([u,c])=>t("tr",{children:[t("td",{children:u==="customPaneCount"?"customPanes":u}),t("td",{children:u==="customPaneCount"?`${c} registered`:o(u,c)})]},u))})]})]})}function ks({options:e={},debugEndpoint:s="/admin/api/debug"}){const{data:n,isLoading:r,error:l}=ga({baseUrl:e.baseUrl,debugEndpoint:s,authToken:e.authToken,refreshInterval:It});return r&&!n?t("div",{className:"ss-dash-empty",children:"Loading diagnostics..."}):l?t("div",{className:"ss-dash-empty",children:["Error: ",l.message]}):n?t(Ta,{data:n,tableClassName:"ss-dash-table",classPrefix:"ss-dash"}):t("div",{className:"ss-dash-empty",children:"Diagnostics not available"})}const La=Object.freeze(Object.defineProperty({__proto__:null,InternalsSection:ks,default:ks},Symbol.toStringTag,{value:"Module"}))})();
|
|
1
|
+
(function(){"use strict";var fe,L,tt,te,st,nt,rt,at,Re,De,Fe,me={},ve=[],Es=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,le=Array.isArray;function G(e,s){for(var n in s)e[n]=s[n];return e}function qe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ge(e,s,n){var r,l,a,i={};for(a in s)a=="key"?r=s[a]:a=="ref"?l=s[a]:i[a]=s[a];if(arguments.length>2&&(i.children=arguments.length>3?fe.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)i[a]===void 0&&(i[a]=e.defaultProps[a]);return _e(e,i,r,l,null)}function _e(e,s,n,r,l){var a={type:e,props:s,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l??++tt,__i:-1,__u:0};return l==null&&L.vnode!=null&&L.vnode(a),a}function F(e){return e.children}function Y(e,s){this.props=e,this.context=s}function re(e,s){if(s==null)return e.__?re(e.__,e.__i+1):null;for(var n;s<e.__k.length;s++)if((n=e.__k[s])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?re(e):null}function Ts(e){if(e.__P&&e.__d){var s=e.__v,n=s.__e,r=[],l=[],a=G({},s);a.__v=s.__v+1,L.vnode&&L.vnode(a),je(e.__P,a,s,e.__n,e.__P.namespaceURI,32&s.__u?[n]:null,r,n??re(s),!!(32&s.__u),l),a.__v=s.__v,a.__.__k[a.__i]=a,ut(r,a,l),s.__e=s.__=null,a.__e!=n&&it(a)}}function it(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(s){if(s!=null&&s.__e!=null)return e.__e=e.__c.base=s.__e}),it(e)}function lt(e){(!e.__d&&(e.__d=!0)&&te.push(e)&&!ye.__r++||st!=L.debounceRendering)&&((st=L.debounceRendering)||nt)(ye)}function ye(){for(var e,s=1;te.length;)te.length>s&&te.sort(rt),e=te.shift(),s=te.length,Ts(e);ye.__r=0}function ot(e,s,n,r,l,a,i,o,d,h,u){var c,v,p,f,g,b,w,y=r&&r.__k||ve,m=s.length;for(d=Ls(n,s,y,d,m),c=0;c<m;c++)(p=n.__k[c])!=null&&(v=p.__i!=-1&&y[p.__i]||me,p.__i=c,b=je(e,p,v,l,a,i,o,d,h,u),f=p.__e,p.ref&&v.ref!=p.ref&&(v.ref&&Oe(v.ref,null,p),u.push(p.ref,p.__c||f,p)),g==null&&f!=null&&(g=f),(w=!!(4&p.__u))||v.__k===p.__k?d=ct(p,d,e,w):typeof p.type=="function"&&b!==void 0?d=b:f&&(d=f.nextSibling),p.__u&=-7);return n.__e=g,d}function Ls(e,s,n,r,l){var a,i,o,d,h,u=n.length,c=u,v=0;for(e.__k=new Array(l),a=0;a<l;a++)(i=s[a])!=null&&typeof i!="boolean"&&typeof i!="function"?(typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?i=e.__k[a]=_e(null,i,null,null,null):le(i)?i=e.__k[a]=_e(F,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?i=e.__k[a]=_e(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):e.__k[a]=i,d=a+v,i.__=e,i.__b=e.__b+1,o=null,(h=i.__i=As(i,n,d,c))!=-1&&(c--,(o=n[h])&&(o.__u|=2)),o==null||o.__v==null?(h==-1&&(l>u?v--:l<u&&v++),typeof i.type!="function"&&(i.__u|=4)):h!=d&&(h==d-1?v--:h==d+1?v++:(h>d?v--:v++,i.__u|=4))):e.__k[a]=null;if(c)for(a=0;a<u;a++)(o=n[a])!=null&&(2&o.__u)==0&&(o.__e==r&&(r=re(o)),ft(o,o));return r}function ct(e,s,n,r){var l,a;if(typeof e.type=="function"){for(l=e.__k,a=0;l&&a<l.length;a++)l[a]&&(l[a].__=e,s=ct(l[a],s,n,r));return s}e.__e!=s&&(r&&(s&&e.type&&!s.parentNode&&(s=re(e)),n.insertBefore(e.__e,s||null)),s=e.__e);do s=s&&s.nextSibling;while(s!=null&&s.nodeType==8);return s}function be(e,s){return s=s||[],e==null||typeof e=="boolean"||(le(e)?e.some(function(n){be(n,s)}):s.push(e)),s}function As(e,s,n,r){var l,a,i,o=e.key,d=e.type,h=s[n],u=h!=null&&(2&h.__u)==0;if(h===null&&o==null||u&&o==h.key&&d==h.type)return n;if(r>(u?1:0)){for(l=n-1,a=n+1;l>=0||a<s.length;)if((h=s[i=l>=0?l--:a++])!=null&&(2&h.__u)==0&&o==h.key&&d==h.type)return i}return-1}function dt(e,s,n){s[0]=="-"?e.setProperty(s,n??""):e[s]=n==null?"":typeof n!="number"||Es.test(s)?n:n+"px"}function we(e,s,n,r,l){var a,i;e:if(s=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(s in r)n&&s in n||dt(e.style,s,"");if(n)for(s in n)r&&n[s]==r[s]||dt(e.style,s,n[s])}else if(s[0]=="o"&&s[1]=="n")a=s!=(s=s.replace(at,"$1")),i=s.toLowerCase(),s=i in e||s=="onFocusOut"||s=="onFocusIn"?i.slice(2):s.slice(2),e.l||(e.l={}),e.l[s+a]=n,n?r?n.u=r.u:(n.u=Re,e.addEventListener(s,a?Fe:De,a)):e.removeEventListener(s,a?Fe:De,a);else{if(l=="http://www.w3.org/2000/svg")s=s.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(s!="width"&&s!="height"&&s!="href"&&s!="list"&&s!="form"&&s!="tabIndex"&&s!="download"&&s!="rowSpan"&&s!="colSpan"&&s!="role"&&s!="popover"&&s in e)try{e[s]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&s[4]!="-"?e.removeAttribute(s):e.setAttribute(s,s=="popover"&&n==1?"":n))}}function ht(e){return function(s){if(this.l){var n=this.l[s.type+e];if(s.t==null)s.t=Re++;else if(s.t<n.u)return;return n(L.event?L.event(s):s)}}}function je(e,s,n,r,l,a,i,o,d,h){var u,c,v,p,f,g,b,w,y,m,x,_,A,M,S,$=s.type;if(s.constructor!==void 0)return null;128&n.__u&&(d=!!(32&n.__u),a=[o=s.__e=n.__e]),(u=L.__b)&&u(s);e:if(typeof $=="function")try{if(w=s.props,y="prototype"in $&&$.prototype.render,m=(u=$.contextType)&&r[u.__c],x=u?m?m.props.value:u.__:r,n.__c?b=(c=s.__c=n.__c).__=c.__E:(y?s.__c=c=new $(w,x):(s.__c=c=new Y(w,x),c.constructor=$,c.render=Ms),m&&m.sub(c),c.state||(c.state={}),c.__n=r,v=c.__d=!0,c.__h=[],c._sb=[]),y&&c.__s==null&&(c.__s=c.state),y&&$.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=G({},c.__s)),G(c.__s,$.getDerivedStateFromProps(w,c.__s))),p=c.props,f=c.state,c.__v=s,v)y&&$.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),y&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(y&&$.getDerivedStateFromProps==null&&w!==p&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(w,x),s.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(w,c.__s,x)===!1){s.__v!=n.__v&&(c.props=w,c.state=c.__s,c.__d=!1),s.__e=n.__e,s.__k=n.__k,s.__k.some(function(R){R&&(R.__=s)}),ve.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&i.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(w,c.__s,x),y&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(p,f,g)})}if(c.context=x,c.props=w,c.__P=e,c.__e=!1,_=L.__r,A=0,y)c.state=c.__s,c.__d=!1,_&&_(s),u=c.render(c.props,c.state,c.context),ve.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,_&&_(s),u=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++A<25);c.state=c.__s,c.getChildContext!=null&&(r=G(G({},r),c.getChildContext())),y&&!v&&c.getSnapshotBeforeUpdate!=null&&(g=c.getSnapshotBeforeUpdate(p,f)),M=u!=null&&u.type===F&&u.key==null?pt(u.props.children):u,o=ot(e,le(M)?M:[M],s,n,r,l,a,i,o,d,h),c.base=s.__e,s.__u&=-161,c.__h.length&&i.push(c),b&&(c.__E=c.__=null)}catch(R){if(s.__v=null,d||a!=null)if(R.then){for(s.__u|=d?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;a[a.indexOf(o)]=null,s.__e=o}else{for(S=a.length;S--;)qe(a[S]);Ie(s)}else s.__e=n.__e,s.__k=n.__k,R.then||Ie(s);L.__e(R,s,n)}else a==null&&s.__v==n.__v?(s.__k=n.__k,s.__e=n.__e):o=s.__e=Ps(n.__e,s,n,r,l,a,i,d,h);return(u=L.diffed)&&u(s),128&s.__u?void 0:o}function Ie(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ie))}function ut(e,s,n){for(var r=0;r<n.length;r++)Oe(n[r],n[++r],n[++r]);L.__c&&L.__c(s,e),e.some(function(l){try{e=l.__h,l.__h=[],e.some(function(a){a.call(l)})}catch(a){L.__e(a,l.__v)}})}function pt(e){return typeof e!="object"||e==null||e.__b>0?e:le(e)?e.map(pt):G({},e)}function Ps(e,s,n,r,l,a,i,o,d){var h,u,c,v,p,f,g,b=n.props||me,w=s.props,y=s.type;if(y=="svg"?l="http://www.w3.org/2000/svg":y=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),a!=null){for(h=0;h<a.length;h++)if((p=a[h])&&"setAttribute"in p==!!y&&(y?p.localName==y:p.nodeType==3)){e=p,a[h]=null;break}}if(e==null){if(y==null)return document.createTextNode(w);e=document.createElementNS(l,y,w.is&&w),o&&(L.__m&&L.__m(s,a),o=!1),a=null}if(y==null)b===w||o&&e.data==w||(e.data=w);else{if(a=a&&fe.call(e.childNodes),!o&&a!=null)for(b={},h=0;h<e.attributes.length;h++)b[(p=e.attributes[h]).name]=p.value;for(h in b)p=b[h],h=="dangerouslySetInnerHTML"?c=p:h=="children"||h in w||h=="value"&&"defaultValue"in w||h=="checked"&&"defaultChecked"in w||we(e,h,null,p,l);for(h in w)p=w[h],h=="children"?v=p:h=="dangerouslySetInnerHTML"?u=p:h=="value"?f=p:h=="checked"?g=p:o&&typeof p!="function"||b[h]===p||we(e,h,p,b[h],l);if(u)o||c&&(u.__html==c.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),s.__k=[];else if(c&&(e.innerHTML=""),ot(s.type=="template"?e.content:e,le(v)?v:[v],s,n,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":l,a,i,a?a[0]:n.__k&&re(n,0),o,d),a!=null)for(h=a.length;h--;)qe(a[h]);o||(h="value",y=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[h]||y=="progress"&&!f||y=="option"&&f!=b[h])&&we(e,h,f,b[h],l),h="checked",g!=null&&g!=e[h]&&we(e,h,g,b[h],l))}return e}function Oe(e,s,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&s==null||(e.__u=e(s))}else e.current=s}catch(l){L.__e(l,n)}}function ft(e,s,n){var r,l;if(L.unmount&&L.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Oe(r,null,s)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){L.__e(a,s)}r.base=r.__P=null}if(r=e.__k)for(l=0;l<r.length;l++)r[l]&&ft(r[l],s,n||typeof e.type!="function");n||qe(e.__e),e.__c=e.__=e.__e=void 0}function Ms(e,s,n){return this.constructor(e,n)}function Rs(e,s,n){var r,l,a,i;s==document&&(s=document.documentElement),L.__&&L.__(e,s),l=(r=!1)?null:s.__k,a=[],i=[],je(s,e=s.__k=ge(F,null,[e]),l||me,me,s.namespaceURI,l?null:s.firstChild?fe.call(s.childNodes):null,a,l?l.__e:s.firstChild,r,i),ut(a,e,i)}fe=ve.slice,L={__e:function(e,s,n,r){for(var l,a,i;s=s.__;)if((l=s.__c)&&!l.__)try{if((a=l.constructor)&&a.getDerivedStateFromError!=null&&(l.setState(a.getDerivedStateFromError(e)),i=l.__d),l.componentDidCatch!=null&&(l.componentDidCatch(e,r||{}),i=l.__d),i)return l.__E=l}catch(o){e=o}throw e}},tt=0,Y.prototype.setState=function(e,s){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=G({},this.state),typeof e=="function"&&(e=e(G({},n),this.props)),e&&G(n,e),e!=null&&this.__v&&(s&&this._sb.push(s),lt(this))},Y.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),lt(this))},Y.prototype.render=F,te=[],nt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rt=function(e,s){return e.__v.__b-s.__v.__b},ye.__r=0,at=/(PointerCapture)$|Capture$/i,Re=0,De=ht(!1),Fe=ht(!0);var Ds=0;function t(e,s,n,r,l,a){s||(s={});var i,o,d=s;if("ref"in d)for(o in d={},s)o=="ref"?i=s[o]:d[o]=s[o];var h={type:e,props:d,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ds,__i:-1,__u:0,__source:l,__self:a};if(typeof e=="function"&&(i=e.defaultProps))for(o in i)d[o]===void 0&&(d[o]=i[o]);return L.vnode&&L.vnode(h),h}var oe,j,Be,mt,ce=0,vt=[],O=L,gt=O.__b,_t=O.__r,yt=O.diffed,bt=O.__c,wt=O.unmount,xt=O.__;function Ue(e,s){O.__h&&O.__h(j,e,ce||s),ce=0;var n=j.__H||(j.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function k(e){return ce=1,Fs(St,e)}function Fs(e,s,n){var r=Ue(oe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(s):St(void 0,s),function(o){var d=r.__N?r.__N[0]:r.__[0],h=r.t(d,o);d!==h&&(r.__N=[h,r.__[1]],r.__c.setState({}))}],r.__c=j,!j.__f)){var l=function(o,d,h){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(v){return v.__c});if(u.every(function(v){return!v.__N}))return!a||a.call(this,o,d,h);var c=r.__c.props!==o;return u.some(function(v){if(v.__N){var p=v.__[0];v.__=v.__N,v.__N=void 0,p!==v.__[0]&&(c=!0)}}),a&&a.call(this,o,d,h)||c};j.__f=!0;var a=j.shouldComponentUpdate,i=j.componentWillUpdate;j.componentWillUpdate=function(o,d,h){if(this.__e){var u=a;a=void 0,l(o,d,h),a=u}i&&i.call(this,o,d,h)},j.shouldComponentUpdate=l}return r.__N||r.__}function H(e,s){var n=Ue(oe++,3);!O.__s&&kt(n.__H,s)&&(n.__=e,n.u=s,j.__H.__h.push(n))}function B(e){return ce=5,U(function(){return{current:e}},[])}function U(e,s){var n=Ue(oe++,7);return kt(n.__H,s)&&(n.__=e(),n.__H=s,n.__h=e),n.__}function T(e,s){return ce=8,U(function(){return e},s)}function qs(){for(var e;e=vt.shift();){var s=e.__H;if(e.__P&&s)try{s.__h.some(xe),s.__h.some(He),s.__h=[]}catch(n){s.__h=[],O.__e(n,e.__v)}}}O.__b=function(e){j=null,gt&>(e)},O.__=function(e,s){e&&s.__k&&s.__k.__m&&(e.__m=s.__k.__m),xt&&xt(e,s)},O.__r=function(e){_t&&_t(e),oe=0;var s=(j=e.__c).__H;s&&(Be===j?(s.__h=[],j.__h=[],s.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(s.__h.some(xe),s.__h.some(He),s.__h=[],oe=0)),Be=j},O.diffed=function(e){yt&&yt(e);var s=e.__c;s&&s.__H&&(s.__H.__h.length&&(vt.push(s)!==1&&mt===O.requestAnimationFrame||((mt=O.requestAnimationFrame)||js)(qs)),s.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Be=j=null},O.__c=function(e,s){s.some(function(n){try{n.__h.some(xe),n.__h=n.__h.filter(function(r){return!r.__||He(r)})}catch(r){s.some(function(l){l.__h&&(l.__h=[])}),s=[],O.__e(r,n.__v)}}),bt&&bt(e,s)},O.unmount=function(e){wt&&wt(e);var s,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{xe(r)}catch(l){s=l}}),n.__H=void 0,s&&O.__e(s,n.__v))};var Nt=typeof requestAnimationFrame=="function";function js(e){var s,n=function(){clearTimeout(r),Nt&&cancelAnimationFrame(s),setTimeout(e)},r=setTimeout(n,35);Nt&&(s=requestAnimationFrame(n))}function xe(e){var s=j,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),j=s}function He(e){var s=j;e.__c=e.__(),j=s}function kt(e,s){return!e||e.length!==s.length||s.some(function(n,r){return n!==e[r]})}function St(e,s){return typeof s=="function"?s(e):s}function Is(e,s){for(var n in s)e[n]=s[n];return e}function $t(e,s){for(var n in e)if(n!=="__source"&&!(n in s))return!0;for(var r in s)if(r!=="__source"&&e[r]!==s[r])return!0;return!1}function Ct(e,s){this.props=e,this.context=s}(Ct.prototype=new Y).isPureReactComponent=!0,Ct.prototype.shouldComponentUpdate=function(e,s){return $t(this.props,e)||$t(this.state,s)};var Et=L.__b;L.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Et&&Et(e)};var Os=L.__e;L.__e=function(e,s,n,r){if(e.then){for(var l,a=s;a=a.__;)if((l=a.__c)&&l.__c)return s.__e==null&&(s.__e=n.__e,s.__k=n.__k),l.__c(e,s)}Os(e,s,n,r)};var Tt=L.unmount;function Lt(e,s,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Is({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=s),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Lt(r,s,n)})),e}function At(e,s,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return At(r,s,n)}),e.__c&&e.__c.__P===s&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ne(){this.__u=0,this.o=null,this.__b=null}function Pt(e){if(!e.__)return null;var s=e.__.__c;return s&&s.__a&&s.__a(e)}function W(e){var s,n,r,l=null;function a(i){if(s||(s=e()).then(function(o){o&&(l=o.default||o),r=!0},function(o){n=o,r=!0}),n)throw n;if(!r)throw s;return l?ge(l,i):null}return a.displayName="Lazy",a.__f=!0,a}function ke(){this.i=null,this.l=null}L.unmount=function(e){var s=e.__c;s&&(s.__z=!0),s&&s.__R&&s.__R(),s&&32&e.__u&&(e.type=null),Tt&&Tt(e)},(Ne.prototype=new Y).__c=function(e,s){var n=s.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var l=Pt(r.__v),a=!1,i=function(){a||r.__z||(a=!0,n.__R=null,l?l(d):d())};n.__R=i;var o=n.__P;n.__P=null;var d=function(){if(!--r.__u){if(r.state.__a){var h=r.state.__a;r.__v.__k[0]=At(h,h.__c.__P,h.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.__P=o,u.forceUpdate()}};r.__u++||32&s.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},Ne.prototype.componentWillUnmount=function(){this.o=[]},Ne.prototype.render=function(e,s){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Lt(this.__b,n,r.__O=r.__P)}this.__b=null}var l=s.__a&&ge(F,null,e.fallback);return l&&(l.__u&=-33),[ge(F,null,s.__a?null:e.children),l]};var Mt=function(e,s,n){if(++n[1]===n[0]&&e.l.delete(s),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(ke.prototype=new Y).__a=function(e){var s=this,n=Pt(s.__v),r=s.l.get(e);return r[0]++,function(l){var a=function(){s.props.revealOrder?(r.push(l),Mt(s,e,r)):l()};n?n(a):a()}},ke.prototype.render=function(e){this.i=null,this.l=new Map;var s=be(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&s.reverse();for(var n=s.length;n--;)this.l.set(s[n],this.i=[1,0,this.i]);return e.children},ke.prototype.componentDidUpdate=ke.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(s,n){Mt(e,n,s)})};var Bs=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Us=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Hs=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,zs=/[A-Z0-9]/g,Vs=typeof document<"u",Ws=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};Y.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Y.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s})}})});var Rt=L.event;function Ks(){}function Qs(){return this.cancelBubble}function Js(){return this.defaultPrevented}L.event=function(e){return Rt&&(e=Rt(e)),e.persist=Ks,e.isPropagationStopped=Qs,e.isDefaultPrevented=Js,e.nativeEvent=e};var Gs={enumerable:!1,configurable:!0,get:function(){return this.class}},Dt=L.vnode;L.vnode=function(e){typeof e.type=="string"&&(function(s){var n=s.props,r=s.type,l={},a=r.indexOf("-")===-1;for(var i in n){var o=n[i];if(!(i==="value"&&"defaultValue"in n&&o==null||Vs&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var d=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&o===!0?o="":d==="translate"&&o==="no"?o=!1:d[0]==="o"&&d[1]==="n"?d==="ondoubleclick"?i="ondblclick":d!=="onchange"||r!=="input"&&r!=="textarea"||Ws(n.type)?d==="onfocus"?i="onfocusin":d==="onblur"?i="onfocusout":Hs.test(i)&&(i=d):d=i="oninput":a&&Us.test(i)?i=i.replace(zs,"-$&").toLowerCase():o===null&&(o=void 0),d==="oninput"&&l[i=d]&&(i="oninputCapture"),l[i]=o}}r=="select"&&l.multiple&&Array.isArray(l.value)&&(l.value=be(n.children).forEach(function(h){h.props.selected=l.value.indexOf(h.props.value)!=-1})),r=="select"&&l.defaultValue!=null&&(l.value=be(n.children).forEach(function(h){h.props.selected=l.multiple?l.defaultValue.indexOf(h.props.value)!=-1:l.defaultValue==h.props.value})),n.class&&!n.className?(l.class=n.class,Object.defineProperty(l,"className",Gs)):n.className&&(l.class=l.className=n.className),s.props=l})(e),e.$$typeof=Bs,Dt&&Dt(e)};var Ft=L.__r;L.__r=function(e){Ft&&Ft(e),e.__c};var qt=L.diffed;L.diffed=function(e){qt&&qt(e);var s=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in s&&s.value!==n.value&&(n.value=s.value==null?"":s.value)};var jt={Fragment:F};const q={queries:{viewBox:"0 0 24 24",elements:['<ellipse cx="12" cy="5" rx="9" ry="3"/>','<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>','<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>']},events:{viewBox:"0 0 24 24",elements:['<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>']},emails:{viewBox:"0 0 24 24",elements:['<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>','<polyline points="22,6 12,13 2,6"/>']},routes:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<line x1="2" y1="12" x2="22" y2="12"/>','<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>']},logs:{viewBox:"0 0 24 24",elements:['<line x1="8" y1="6" x2="21" y2="6"/>','<line x1="8" y1="12" x2="21" y2="12"/>','<line x1="8" y1="18" x2="21" y2="18"/>','<line x1="3" y1="6" x2="3.01" y2="6"/>','<line x1="3" y1="12" x2="3.01" y2="12"/>','<line x1="3" y1="18" x2="3.01" y2="18"/>']},timeline:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},cache:{viewBox:"0 0 24 24",elements:['<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>','<rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>','<line x1="6" y1="6" x2="6.01" y2="6"/>','<line x1="6" y1="18" x2="6.01" y2="18"/>']},jobs:{viewBox:"0 0 24 24",elements:['<rect x="2" y="7" width="20" height="14" rx="2" ry="2"/>','<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>']},config:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="3"/>','<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>']},internals:{viewBox:"0 0 24 24",elements:['<rect x="4" y="4" width="16" height="16" rx="2"/>','<rect x="9" y="9" width="6" height="6"/>','<line x1="9" y1="1" x2="9" y2="4"/>','<line x1="15" y1="1" x2="15" y2="4"/>','<line x1="9" y1="20" x2="9" y2="23"/>','<line x1="15" y1="20" x2="15" y2="23"/>','<line x1="20" y1="9" x2="23" y2="9"/>','<line x1="20" y1="14" x2="23" y2="14"/>','<line x1="1" y1="9" x2="4" y2="9"/>','<line x1="1" y1="14" x2="4" y2="14"/>']},overview:{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="7" height="7"/>','<rect x="14" y="3" width="7" height="7"/>','<rect x="14" y="14" width="7" height="7"/>','<rect x="3" y="14" width="7" height="7"/>']},requests:{viewBox:"0 0 24 24",elements:['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']},"dashboard-timeline":{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="10"/>','<polyline points="12 6 12 12 16 14"/>']},"custom-pane":{viewBox:"0 0 24 24",elements:['<rect x="3" y="3" width="18" height="18" rx="2"/>','<path d="M9 3v18"/>']},wrench:{viewBox:"0 0 24 24",elements:['<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>']},"external-link":{viewBox:"0 0 24 24",elements:['<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>','<polyline points="15 3 21 3 21 9"/>','<line x1="10" y1="14" x2="21" y2="3"/>']},sun:{viewBox:"0 0 24 24",elements:['<circle cx="12" cy="12" r="5"/>','<line x1="12" y1="1" x2="12" y2="3"/>','<line x1="12" y1="21" x2="12" y2="23"/>','<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>','<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>','<line x1="1" y1="12" x2="3" y2="12"/>','<line x1="21" y1="12" x2="23" y2="12"/>','<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>','<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>']},moon:{viewBox:"0 0 24 24",elements:['<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>']},search:{viewBox:"0 0 24 24",elements:['<circle cx="11" cy="11" r="8"/>','<line x1="21" y1="21" x2="16.65" y2="16.65"/>']},eye:{viewBox:"0 0 24 24",elements:['<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>','<circle cx="12" cy="12" r="3"/>']},"eye-off":{viewBox:"0 0 24 24",elements:['<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>','<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>','<line x1="1" y1="1" x2="23" y2="23"/>','<path d="M14.12 14.12a3 3 0 1 1-4.24-4.24"/>']},"chevron-right":{viewBox:"0 0 24 24",elements:['<path d="M9 18l6-6-6-6"/>']},"chevron-left":{viewBox:"0 0 24 24",elements:['<path d="M15 18l-6-6 6-6"/>']},"open-external":{viewBox:"0 0 16 16",elements:['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']}};function Ys(e,s){const n=e||(typeof window<"u"?window.location.origin:"");if(!s)return{baseUrl:n};const r={headers:{Authorization:`Bearer ${s}`}};return{baseUrl:n,beforeSubscribe(l){return r},beforeUnsubscribe(l){return r}}}async function Zs(){if(typeof window<"u"&&window.Transmit&&typeof window.Transmit=="function")return window.Transmit;try{const e=await import("@adonisjs/transmit-client");return e.Transmit??e.default??null}catch{return null}}function Xs(e){let s=null,n=null,r=!1;return{subscribe:async()=>{try{const i=await Zs();if(!i)throw new Error("Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)");if(r)return;s=new i(Ys(e.baseUrl,e.authToken)),n=s.subscription(e.channelName),n.onMessage(o=>{r||e.onMessage(o)}),await n.create()}catch(i){e.onError?.(i)}},unsubscribe:async()=>{r=!0;try{await n?.delete(),n=null,s=null}catch{}}}}function en(e){let s=!1;const n=Xs({baseUrl:e.baseUrl,channelName:e.channelName,authToken:e.authToken,onMessage:e.onMessage,onError:r=>{s=!0,e.onError?.(r),e.onDisconnect?.()}});return n.subscribe().then(()=>{s||e.onConnect?.()}).catch(r=>{e.onError?.(r),e.onDisconnect?.()}),{unsubscribe:()=>{n.unsubscribe().catch(()=>{})}}}class ze extends Error{status;constructor(s=403){super(`Unauthorized (HTTP ${s})`),this.name="UnauthorizedError",this.status=s}}class tn extends Error{status;body;constructor(s,n){super(`API error (HTTP ${s})`),this.name="ApiError",this.status=s,this.body=n}}class Ve{baseUrl;authToken;constructor(s){this.baseUrl=s.baseUrl.replace(/\/+$/,""),this.authToken=s.authToken}async fetch(s,n){const l={...{Accept:"application/json",...this.authToken?{Authorization:`Bearer ${this.authToken}`}:{}},...n?.headers},a=await globalThis.fetch(`${this.baseUrl}${s}`,{...n,headers:l,credentials:this.authToken?"omit":"same-origin"});if(n?.signal?.aborted)throw new DOMException("The operation was aborted.","AbortError");if(a.status===401||a.status===403)throw new ze(a.status);if(!a.ok){const i=await a.text().catch(()=>"");throw new tn(a.status,i)}return a.json()}async get(s,n){const r=n?`${s}?${n}`:s;return this.fetch(r)}async post(s,n){const r={method:"POST",...n!==void 0?{body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}:{}};return this.fetch(s,r)}async delete(s){return this.fetch(s,{method:"DELETE"})}}const sn=5e3,It=1e4,Ot=100,nn=500,rn={overview:"/overview",requests:"/requests",queries:"/queries",events:"/events",routes:"/routes",logs:"/logs",emails:"/emails",timeline:"/traces",cache:"/cache",jobs:"/jobs",config:"/config"};function an(e){return rn[e]||`/${e}`}class ln{constructor(s,n){this.client=s,this.basePath=n}async fetchSection(s,n,r){const l=an(s),a=n?`${this.basePath}${l}?${n}`:`${this.basePath}${l}`;return this.client.fetch(a,r)}async fetchChart(s){return this.client.fetch(`${this.basePath}/overview/chart?range=${s}`)}async fetchGroupedQueries(){return this.client.fetch(`${this.basePath}/queries/grouped`)}async explainQuery(s){return this.client.fetch(`${this.basePath}/queries/${s}/explain`)}async retryJob(s){return this.client.fetch(`${this.basePath}/jobs/${s}/retry`,{method:"POST"})}async fetchCacheKey(s){return this.client.fetch(`${this.basePath}/cache/${encodeURIComponent(s)}`)}async deleteCacheKey(s){return this.client.fetch(`${this.basePath}/cache/${encodeURIComponent(s)}`,{method:"DELETE"})}async fetchEmailPreview(s){return this.client.fetch(`${this.basePath}/emails/${s}/preview`)}}function on(e){if(!e||typeof e!="object")return!1;const s=e;return s.data!==void 0&&s.meta!==void 0}function cn(e,s){return s.aborted?!0:e instanceof DOMException&&e.name==="AbortError"}const dn=[{key:"page",param:"page",isNumeric:!0},{key:"perPage",param:"perPage",isNumeric:!0},{key:"search",param:"search"},{key:"sort",param:"sort"},{key:"sortDir",param:"direction"},{key:"timeRange",param:"range"}];function hn(e){const s=new URLSearchParams,n=e;for(const{key:r,param:l,isNumeric:a}of dn){const i=n[r];(a?i!=null:i)&&s.set(l,String(i))}if(e.filters)for(const[r,l]of Object.entries(e.filters))l&&s.set(r,l);return s.toString()}function un(e,s,n=2){if(s<=1)return[1];const r=[],l=Math.max(2,e-n),a=Math.min(s-1,e+n);r.push(1),l>2&&r.push("...");for(let i=l;i<=a;i++)r.push(i);return a<s-1&&r.push("..."),s>1&&r.push(s),r}class pn{client;api;callbacks;endpoint;perPage;section;page=1;search;sort;sortDir;filters;timeRange;timer=null;fetchId=0;explicitFetchPending=!1;hasFetched=!1;stopped=!1;abortController=null;constructor(s){this.client=new Ve({baseUrl:s.baseUrl,authToken:s.authToken}),this.api=new ln(this.client,s.endpoint),this.endpoint=s.endpoint,this.section=s.section,this.perPage=s.perPage,this.callbacks=s.callbacks}start(){this.stopped=!1,this.fetch(!1),this.startRefreshTimer()}stop(){this.stopped=!0,this.stopRefreshTimer(),this.abortController?.abort(),this.abortController=null}async fetch(s=!0){if(this.shouldSkipFetch(s))return;const{controller:n,myFetchId:r}=this.prepareFetch(s);try{const l=await this.executeFetch(n);if(this.isStaleResponse(r))return;this.applyFetchResult(l)}catch(l){if(this.shouldIgnoreError(l,n.signal,r))return;this.handleFetchError(l,s)}finally{s||(this.explicitFetchPending=!1)}}setSection(s){this.section!==s&&(this.section=s,this.page=1,this.search=void 0,this.sort=void 0,this.sortDir=void 0,this.filters=void 0,this.hasFetched=!1,this.callbacks.onData(null),this.callbacks.onPagination(null),this.callbacks.onLoading(!0),this.callbacks.onError(null),this.fetch(!1),this.startRefreshTimer())}setPage(s){this.page=s,this.fetch(!1)}setSearch(s){this.search=s||void 0,this.page=1,this.fetch(!1)}setFilter(s,n){this.filters||(this.filters={}),this.filters[s]=String(n),this.page=1,this.fetch(!1)}setSort(s,n){this.sort===s&&!n?this.sortDir=this.sortDir==="asc"?"desc":"asc":(this.sort=s,this.sortDir=n||"desc"),this.fetch(!1)}setTimeRange(s){this.timeRange=s,this.fetch(!1)}async mutate(s,n="post",r){const l=`${this.endpoint}/${s}`;try{const a=n==="post"?await this.client.post(l,r):await this.client.delete(l);return await this.fetch(!0),a}catch(a){throw a instanceof Error?a:new Error(String(a))}}configure(s){s.page!==void 0&&(this.page=s.page),s.perPage!==void 0&&(this.perPage=s.perPage),this.search=s.search,this.sort=s.sort,this.sortDir=s.sortDir,this.filters=s.filters,this.timeRange=s.timeRange}hasData(){return this.hasFetched}handleRefreshSignal(){this.hasFetched&&this.fetch(!0)}getApi(){return this.api}getClient(){return this.client}shouldSkipFetch(s){return s&&this.explicitFetchPending?!0:!this.section}prepareFetch(s){this.abortController?.abort();const n=new AbortController;this.abortController=n;const r=++this.fetchId;return s||(this.callbacks.onLoading(!0),this.explicitFetchPending=!0),{controller:n,myFetchId:r}}async executeFetch(s){const n=this.buildCurrentQueryString();return this.api.fetchSection(this.section,n||void 0,{signal:s.signal})}isStaleResponse(s){return s!==this.fetchId||this.stopped}shouldIgnoreError(s,n,r){return cn(s,n)?!0:this.isStaleResponse(r)}buildCurrentQueryString(){const s=this.sort?this.sort.replace(/[A-Z]/g,r=>"_"+r.toLowerCase()):void 0,n=this.filters;return hn({page:this.page,perPage:this.perPage,search:this.search,sort:s,sortDir:this.sort?this.sortDir:void 0,filters:n&&Object.keys(n).length>0?n:void 0,timeRange:this.section.startsWith("overview")?this.timeRange:void 0})}applyFetchResult(s){on(s)?(this.callbacks.onData(s.data),this.callbacks.onPagination(s.meta)):(this.callbacks.onData(s),this.callbacks.onPagination(null)),this.callbacks.onError(null),this.callbacks.onLoading(!1),this.hasFetched=!0}handleFetchError(s,n){if(s instanceof ze){this.callbacks.onError(s),this.callbacks.onLoading(!1),this.stopRefreshTimer(),this.callbacks.onUnauthorized();return}n||(this.callbacks.onError(s instanceof Error?s:new Error(String(s))),this.callbacks.onLoading(!1))}startRefreshTimer(){this.stopRefreshTimer();const s=this.section==="overview"?sn:It;this.timer=setInterval(()=>this.fetch(!0),s)}stopRefreshTimer(){this.timer&&(clearInterval(this.timer),this.timer=null)}}function fn(e,s){return new pn({baseUrl:s.baseUrl,endpoint:s.dashboardEndpoint,authToken:s.authToken,section:e,perPage:s.perPage,callbacks:{onData:n=>s.setData(n),onPagination:n=>s.setMeta(n),onLoading:n=>s.setIsLoading(n),onError:n=>s.setError(n),onUnauthorized:()=>{}}})}function mn(e,s){e.ctrl.configure(s);const n=e.prevSection!==e.section;return n||!e.hasFetched?(n?e.ctrl.setSection(e.section):e.ctrl.start(),!0):(e.ctrl.start(),e.hasFetched)}function vn(){const[e,s]=k(null),[n,r]=k(null),[l,a]=k(!0),[i,o]=k(null);return{data:e,setData:s,meta:n,setMeta:r,isLoading:l,setIsLoading:a,error:i,setError:o}}function gn(e){const s=T(()=>{e.current?.fetch(!0)},[]),n=T(async(l,a="post",i)=>e.current.mutate(l,a,i),[]),r=T(()=>e.current.getApi(),[]);return{refresh:s,mutate:n,getApi:r}}function _n(e,s,n,r){e.current||(e.current=fn(s,{...n,setData:l=>r.setData(l),setMeta:r.setMeta,setIsLoading:r.setIsLoading,setError:r.setError}))}function yn(e){return{baseUrl:e.baseUrl??"",dashboardEndpoint:e.dashboardEndpoint??"/__stats/api",authToken:e.authToken,page:e.page??1,perPage:e.perPage??50,search:e.search,sort:e.sort,sortDir:e.sortDir,filters:e.filters,timeRange:e.timeRange,refreshKey:e.refreshKey}}function V(e,s={}){const n=yn(s),r=vn(),l=B(null),a=B(e),i=B(!1);_n(l,e,n,r),H(()=>{const d=a.current;return a.current=e,i.current=mn({ctrl:l.current,section:e,prevSection:d,hasFetched:i.current},n),()=>{l.current.stop()}},[e,n.page,n.perPage,n.search,n.sort,n.sortDir,n.filters,n.timeRange,n.refreshKey]);const o=gn(l);return{data:r.data,meta:r.meta,isLoading:r.isLoading,error:r.error,...o}}const bn=["tracing","process","system","http","db","redis","queues","cache","app","log","emails","dashboard"],Bt="/admin/api/debug",Ut={tracing:!1,process:!1,system:!1,http:!1,db:!1,redis:!1,queues:!1,cache:!1,app:!1,log:!1,emails:!1,dashboard:!1,customPanes:[]};function wn(e){const s={customPanes:e.customPanes??[]},n=e.features;for(const r of bn)s[r]=n?.[r]??!1;return s}async function xn(e,s=Bt){const n=`${s.replace(/\/+$/,"")}/config`;return e.fetch(n)}async function Nn(e){const{baseUrl:s="",debugEndpoint:n=Bt,authToken:r}=e,l=new Ve({baseUrl:s,authToken:r});try{const a=await xn(l,n);return wn(a)}catch{return Ut}}function kn(e={}){const{baseUrl:s="",debugEndpoint:n="/admin/api/debug",authToken:r}=e,[l,a]=k(Ut),[i,o]=k(!0),[d,h]=k(null),u=B(!1);return H(()=>{if(u.current)return;u.current=!0;let c=!1;return(async()=>{try{const p=await Nn({baseUrl:s,debugEndpoint:n,authToken:r});c||(a(p),o(!1))}catch(p){c||(h(p instanceof Error?p:new Error(String(p))),o(!1))}})(),()=>{c=!0}},[s,n,r]),{features:l,isLoading:i,error:d}}const Se="ss-dash-theme",We="ss-theme-change";function $e(){if(typeof window>"u")return"light";const e=localStorage.getItem(Se);return e==="dark"||e==="light"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Sn(e){typeof window>"u"||(localStorage.setItem(Se,e),window.dispatchEvent(new CustomEvent(We,{detail:e})))}function $n(){const s=$e()==="dark"?"light":"dark";return Sn(s),s}function Ht(e){if(typeof window>"u")return()=>{};const s=a=>{const i=a.detail;(i==="dark"||i==="light")&&e(i)},n=a=>{if(a.key===Se){const i=a.newValue;e(i==="dark"||i==="light"?i:$e())}},r=window.matchMedia("(prefers-color-scheme: dark)"),l=a=>{localStorage.getItem(Se)||e(a.matches?"dark":"light")};return window.addEventListener(We,s),window.addEventListener("storage",n),r.addEventListener("change",l),()=>{window.removeEventListener(We,s),window.removeEventListener("storage",n),r.removeEventListener("change",l)}}function Cn(){const[e,s]=k(()=>$e());H(()=>Ht(l=>{s(l)}),[]);const n=T(()=>{const r=$n();return s(r),r},[]);return{theme:e,toggleTheme:n}}function En({theme:e,onToggle:s,className:n="",classPrefix:r="ss-dash"}){const l=e==="dark";return t("button",{type:"button",className:`${r==="ss-dbg"?"ss-dbg-theme-toggle":"ss-dash-theme-btn"} ${n}`,onClick:s,title:l?"Switch to light theme":"Switch to dark theme","aria-label":l?"Switch to light theme":"Switch to dark theme",children:l?t("svg",{width:"16",height:"16",viewBox:q.sun.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:q.sun.elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:q.moon.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:q.moon.elements.join("")}})})}const Tn=["overview","requests","queries","events","routes","logs","emails","cache","jobs","config","internals"],Ln=W(()=>Promise.resolve().then(()=>mr)),An=W(()=>Promise.resolve().then(()=>Dr)),Pn=W(()=>Promise.resolve().then(()=>Jr)),Mn=W(()=>Promise.resolve().then(()=>Gr)),Rn=W(()=>Promise.resolve().then(()=>Yr)),Dn=W(()=>Promise.resolve().then(()=>Zr)),Fn=W(()=>Promise.resolve().then(()=>ea)),qn=W(()=>Promise.resolve().then(()=>sa)),jn=W(()=>Promise.resolve().then(()=>oa)),In=W(()=>Promise.resolve().then(()=>va)),On=W(()=>Promise.resolve().then(()=>La));function Bn(e){const{baseUrl:s="",dashboardEndpoint:n="/__stats/api",debugEndpoint:r,authToken:l,backUrl:a="/",channelName:i="server-stats/dashboard"}=e,{features:o}=kn({baseUrl:s,debugEndpoint:r,authToken:l}),{theme:d,toggleTheme:h}=Cn(),[u,c]=k("overview"),[v,p]=k(()=>typeof window>"u"?!1:localStorage.getItem("ss-dash-sidebar")==="collapsed"),[f,g]=k(!1),[b,w]=k(0),y=B(0);H(()=>{if(!i)return;const E=en({baseUrl:s,channelName:i,authToken:l,onMessage:()=>{y.current+=1,w(y.current)},onConnect:()=>g(!0),onDisconnect:()=>g(!1),onError:()=>g(!1)});return()=>E.unsubscribe()},[s,i,l]);const m=o.customPanes||[],x=T(E=>{const P=E.replace("#","").split("?")[0];return P&&[...Tn,...m.map(z=>z.id)].includes(P)?P:"overview"},[m]);H(()=>{if(typeof window>"u")return;const E=x(window.location.hash);(E!=="overview"||window.location.hash)&&c(E)},[x]),H(()=>{const E=()=>{const P=x(window.location.hash);P!==u&&c(P)};return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[u,x]),H(()=>{typeof window>"u"||(window.location.hash=u)},[u]);const _=T(()=>{p(E=>{const P=!E;return localStorage.setItem("ss-dash-sidebar",P?"collapsed":"expanded"),P})},[]),A=U(()=>[{id:"overview",label:"Overview",visible:!0},{id:"requests",label:"Requests",visible:!0},{id:"queries",label:"Queries",visible:!0},{id:"events",label:"Events",visible:!0},{id:"routes",label:"Routes",visible:!0},{id:"logs",label:"Logs",visible:!0},{id:"emails",label:"Emails",visible:!0},{id:"cache",label:"Cache",visible:o.cache},{id:"jobs",label:"Jobs",visible:o.queues},{id:"config",label:"Config",visible:!0},{id:"internals",label:"Internals",visible:!0}],[o]),M=U(()=>A.filter(E=>E.visible),[A]),S=U(()=>({baseUrl:s,dashboardEndpoint:n,authToken:l,refreshKey:b}),[s,n,l,b]),{data:$}=V("overview",S),R=U(()=>{if(!$)return{};const E={};if($.totalRequests>0&&(E.requests={count:$.totalRequests}),$.queryStats?.total>0&&(E.queries={count:$.queryStats.total}),$.logLevelBreakdown){const P=$.logLevelBreakdown,J=P.error+P.warn+P.info+P.debug;J>0&&(E.logs={count:J})}return E},[$]),D=T(()=>{const E={overview:t(Ln,{options:S}),requests:t(An,{options:S}),queries:t(Pn,{options:S}),events:t(Mn,{options:S}),routes:t(Rn,{options:S}),logs:t(Dn,{options:S}),emails:t(Fn,{options:S}),cache:t(qn,{options:S}),jobs:t(jn,{options:S}),config:t(In,{options:S}),internals:t(On,{options:S,debugEndpoint:r})};return t("div",{className:"ss-dash-pane ss-dash-active",id:`ss-dash-pane-${u}`,children:t("div",{className:"ss-dash-pane-inner",children:t(Ne,{fallback:t("div",{className:"ss-dash-empty",children:"Loading..."}),children:E[u]||t("div",{className:"ss-dash-empty",children:"Unknown section"})})})})},[u,S]);return t("div",{className:"ss-dash","data-theme":d,id:"ss-dash",children:[t("div",{className:"ss-dash-header",children:[t("div",{className:"ss-dash-header-left",children:[t("span",{className:"ss-dash-logo",children:"Server Stats"}),t("span",{className:"ss-dash-logo-sub",children:"Dashboard"})]}),t("div",{className:"ss-dash-header-center",children:[t("span",{className:`ss-dash-live-dot ${f?"ss-dash-connected":""}`,id:"ss-dash-live-dot"}),t("span",{className:`ss-dash-live-label ${f?"ss-dash-connected":""}`,id:"ss-dash-live-label",children:f?"Live":"Polling"})]}),t("div",{className:"ss-dash-header-right",children:[t(En,{theme:d,onToggle:h}),a&&t("a",{href:a,className:"ss-dash-back-link",title:"Back to app",children:"← App"})]})]}),t("div",{className:"ss-dash-body",children:[t("div",{className:`ss-dash-sidebar ${v?"ss-dash-collapsed":""}`,id:"ss-dash-sidebar",children:[t("nav",{className:"ss-dash-nav",children:[M.map(E=>{const P=R[E.id];return t("button",{type:"button",className:`ss-dash-nav-item ${u===E.id?"ss-dash-active":""}`,"data-ss-section":E.id,onClick:()=>{E.id!==u&&c(E.id)},title:v?E.label:void 0,children:[t("span",{className:"ss-dash-nav-icon",children:t("svg",{width:"20",height:"20",viewBox:(q[E.id]||q.config).viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:(q[E.id]||q.config).elements.join("")}})}),t("span",{className:"ss-dash-nav-label",children:E.label}),P&&P.count>0&&t("span",{className:`ss-dash-nav-badge${P.variant?" "+P.variant:""}`,children:P.count})]},E.id)}),m.length>0&&t("div",{className:"ss-dash-nav-sep"}),m.map(E=>t("button",{type:"button",className:`ss-dash-nav-item ${u===E.id?"ss-dash-active":""}`,onClick:()=>c(E.id),title:v?E.label:void 0,children:[t("span",{className:"ss-dash-nav-icon",children:t("svg",{width:"20",height:"20",viewBox:q["custom-pane"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:q["custom-pane"].elements.join("")}})}),t("span",{className:"ss-dash-nav-label",children:E.label})]},E.id))]}),t("button",{type:"button",className:"ss-dash-sidebar-toggle",id:"ss-dash-sidebar-toggle",onClick:_,title:v?"Expand sidebar":"Collapse sidebar",children:v?t("svg",{width:"16",height:"16",viewBox:q["chevron-right"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"1.5",dangerouslySetInnerHTML:{__html:q["chevron-right"].elements.join("")}}):t("svg",{width:"16",height:"16",viewBox:q["chevron-left"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"1.5",dangerouslySetInnerHTML:{__html:q["chevron-left"].elements.join("")}})})]}),t("div",{className:"ss-dash-main",children:D()})]})]})}function Un(e){const s=document.getElementById(e);return s?JSON.parse(s.textContent||"{}"):{}}function Hn(){function e(s){document.documentElement.setAttribute("data-theme",s)}e($e()),Ht(e)}const ae=Un("ss-dash-config");Hn();const zt=document.getElementById("ss-dash");zt&&Rs(t(Bn,{baseUrl:ae.baseUrl,dashboardEndpoint:ae.dashboardEndpoint,debugEndpoint:ae.debugEndpoint,authToken:ae.authToken,backUrl:ae.backUrl,channelName:ae.channelName}),zt);function I(e,...s){for(const n of s){const r=e[n];if(r!=null)return r}}function Ce(e){return I(e,"createdAt","created_at","timestamp")}function zn(e){return I(e,"timestamp","createdAt","processedAt","created_at")}function Vn(e){return I(e,"statusCode","status_code")}function Wn(e){return I(e,"total_duration","totalDuration","duration")??0}function Kn(e){return I(e,"span_count","spanCount")??0}function Qn(e){return I(e,"warning_count","warningCount")??0}function Vt(e){return I(e,"from_addr","from")??""}function Wt(e){return I(e,"to_addr","to")??""}function Jn(e){return I(e,"cc","cc_addr")??""}function Gn(e){return I(e,"attachment_count","attachmentCount")??0}function Kt(e){return I(e,"event_name","eventName","event")??""}function Qt(e){return I(e,"method","sql_method")??""}function Ee(e){return I(e,"sqlNormalized","normalizedSql","sql_normalized","sql")??""}function se(e,s,n){const r=e[s];return r!=null&&r!==0?Number(r):Number(e[n])||0}function Yn(e){return'"'+(e.length>40?e.slice(0,40)+"...":e)+'"'}function Zn(e,s,n){if(e.length===0)return"[]";const r=e.slice(0,3).map(i=>n(i,30)),l=e.length>3?", ..."+e.length+" items":"",a="["+r.join(", ")+l+"]";return a.length>s?"["+e.length+" items]":a}function Xn(e,s,n){const r=Object.keys(e);if(r.length===0)return"{}";const l=[];for(let d=0;d<Math.min(r.length,4);d++)l.push(r[d]+": "+n(e[r[d]],30));const a=r.length>4?", ...+"+(r.length-4):"",i="{ "+l.join(", ")+a+" }";return i.length<=s?i:"{ "+(r.slice(0,6).join(", ")+(r.length>6?", ...":""))+" }"}function er(e){if(!e&&e!==0)return"-";const s=Math.floor(e),n=Math.floor(s/86400),r=Math.floor(s%86400/3600),l=Math.floor(s%3600/60);return n>0?`${n}d ${r}h`:r>0?`${r}h ${l}m`:l>0?`${l}m ${s%60}s`:`${s}s`}function X(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:e>=1?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`}function Jt(e){return/([+-]\d{2}:?\d{2}|Z)\s*$/.test(e)?e:e+"Z"}function tr(e){if(!e)return"-";const s=typeof e=="string"?new Date(Jt(e)):new Date(e);return Number.isNaN(s.getTime())?"-":s.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(s.getMilliseconds()).padStart(3,"0")}function Ke(e){if(!e)return"-";const s=typeof e=="string"?new Date(Jt(e)).getTime():e,n=Math.floor((Date.now()-s)/1e3);return n<0?"just now":n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function sr(e){return e>nn?"very-slow":e>Ot?"slow":"normal"}function de(e,s="ss-dash"){const n=sr(e);return n==="very-slow"?`${s}-very-slow`:n==="slow"?`${s}-slow`:""}function Qe(e,s=100){return e===null?"null":e===void 0?"-":typeof e=="string"?Yn(e):typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?Zn(e,s,Qe):typeof e=="object"?Xn(e,s,Qe):String(e)}function nr(e){return e<0?"no expiry":e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`}function rr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}const ar={color:"#34d399",fillOpacityTop:.25,fillOpacityBottom:.02,strokeWidth:1.5,width:120,height:32,padding:2};function ir(e){return{...ar,...e}}let lr=0;function or(){return`ss-grad-${lr++}`}function cr(e){if(e.length===0)return null;let s=e[0],n=e[0],r=e[0];for(let l=1;l<e.length;l++){const a=e[l];a<s&&(s=a),a>n&&(n=a),r+=a}return{min:s,max:n,avg:r/e.length}}function dr(e,s){if(e.length<2)return null;const n=ir(s),r=cr(e),l=r.max-r.min||1,a=n.width-n.padding*2,i=n.height-n.padding*2,o=n.padding,d=e.length,h=Array.from({length:d});for(let g=0;g<d;g++){const b=o+g/(d-1)*a,w=o+i-(e[g]-r.min)/l*i;h[g]=`${b.toFixed(1)},${w.toFixed(1)}`}const u=h.join(" "),c=(o+a).toFixed(1),v=(o+i).toFixed(1),p=o.toFixed(1),f=`M${h[0]} `+h.slice(1).map(g=>`L${g}`).join(" ")+` L${c},${v} L${p},${v} Z`;return{points:u,areaPath:f,gradientId:or(),options:n,stats:r}}function Te({data:e,color:s="#34d399",width:n=120,height:r=32,className:l=""}){const a=U(()=>dr(e,{width:n,height:r}),[e,n,r]),i=U(()=>"ss-grad-"+Math.random().toString(36).slice(2,8),[]),o={"--ss-accent":s};if(!a)return t("div",{className:`ss-dash-sparkline ${l}`,style:o,children:t("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{display:"block"},children:t("text",{x:n/2,y:r/2+3,textAnchor:"middle",fill:"#737373",fontSize:"9",children:["collecting","…"]})})});const d=s||"var(--ss-accent)";return t("div",{className:`ss-dash-sparkline ${l}`,style:o,children:t("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{display:"block"},children:[t("defs",{children:t("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:d,stopOpacity:"0.25"}),t("stop",{offset:"100%",stopColor:d,stopOpacity:"0.02"})]})}),t("path",{d:a.areaPath,fill:`url(#${i})`}),t("path",{className:"ss-dash-sparkline-line",d:"M"+a.points.replace(/ /g," L"),fill:"none",stroke:d,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})})}function ne({ts:e,className:s,style:n}){return e?t("span",{className:s,style:n,title:tr(e),children:Ke(e)}):t("span",{className:s,style:n,children:"-"})}const hr=[{value:"5m",label:"5m"},{value:"15m",label:"15m"},{value:"30m",label:"30m"},{value:"1h",label:"1h"},{value:"6h",label:"6h"},{value:"24h",label:"24h"},{value:"7d",label:"7d"}];function ur({value:e,onChange:s,className:n=""}){return t("div",{className:`ss-dash-btn-group ${n}`,children:hr.map(r=>t("button",{type:"button",className:`ss-dash-btn ${e===r.value?"ss-dash-active":""}`,onClick:()=>s(r.value),children:r.label},r.value))})}function pr(e,s){if(e<=0)return[0];const n=e/s,r=Math.pow(10,Math.floor(Math.log10(n))),l=n/r;let a;l<=1?a=r:l<=2?a=2*r:l<=5?a=5*r:a=10*r;const i=[];for(let o=a;o<=e+a*.5;o+=a)i.push(Math.round(o));return i.length===0&&i.push(Math.ceil(e)),i}function Gt(e){try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"})}catch{return""}}function Yt(e){if(e.length===0)return"";if(e.length===1)return`M${e[0].x},${e[0].y}`;let s=`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;for(let n=0;n<e.length-1;n++){const r=e[n],l=e[n+1],a=(r.x+l.x)/2;s+=` C${a.toFixed(1)},${r.y.toFixed(1)} ${a.toFixed(1)},${l.y.toFixed(1)} ${l.x.toFixed(1)},${l.y.toFixed(1)}`}return s}function fr({chartPoints:e}){const s={top:12,right:12,bottom:28,left:38},n=220,r=B(null),[l,a]=k(0);H(()=>{const N=r.current;if(!N)return;a(N.clientWidth);const C=new ResizeObserver(Q=>{for(const pe of Q)a(pe.contentRect.width)});return C.observe(N),()=>C.disconnect()},[]);const i=l||600,o=i-s.left-s.right,d=n-s.top-s.bottom,h=s.top+d,u=e.map(N=>se(N,"requestCount","request_count")||N.total||0),c=e.map(N=>se(N,"errorCount","error_count")),v=Math.max(...u,1),p=Math.ceil(v*1.1),f=c.some(N=>N>0),g=pr(p,4),b=g.length>0?g[g.length-1]:p,w=N=>s.left+N/Math.max(e.length-1,1)*o,y=N=>s.top+d-N/(b||1)*d,m=e.map((N,C)=>({x:w(C),y:y(u[C])})),x=e.map((N,C)=>({x:w(C),y:y(c[C])})),_=Yt(m),A=f?Yt(x):"",M=m.length>1?`${_} L${m[m.length-1].x.toFixed(1)},${h} L${m[0].x.toFixed(1)},${h} Z`:"",S=f&&x.length>1?`${A} L${x[x.length-1].x.toFixed(1)},${h} L${x[0].x.toFixed(1)},${h} Z`:"",$=Math.min(10,e.length),R=Math.max(1,Math.ceil(e.length/$)),[D,E]=k({visible:!1,x:0,idx:-1}),P=T(N=>{const C=m[N].x;E({visible:!0,x:C,idx:N})},[m]),J=T(()=>{E({visible:!1,x:0,idx:-1})},[]),z=120,Xe=D.visible?Math.max(z/2,Math.min(D.x,i-z/2)):0;return t("div",{ref:r,style:{position:"relative"},children:[t("svg",{viewBox:`0 0 ${i} ${n}`,className:"ss-dash-chart-svg",children:[t("defs",{children:[t("linearGradient",{id:"ss-cg-total",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--ss-accent)",stopOpacity:.3}),t("stop",{offset:"100%",stopColor:"var(--ss-accent)",stopOpacity:.02})]}),t("linearGradient",{id:"ss-cg-error",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0%",stopColor:"var(--ss-red-fg)",stopOpacity:.35}),t("stop",{offset:"100%",stopColor:"var(--ss-red-fg)",stopOpacity:.02})]})]}),g.map(N=>{const C=y(N);return t("g",{children:[t("line",{x1:s.left,y1:C,x2:i-s.right,y2:C,stroke:"var(--ss-border-faint)",strokeWidth:.5,strokeDasharray:"3,3"}),t("text",{x:s.left-6,y:C,textAnchor:"end",fill:"var(--ss-dim)",fontSize:9,dominantBaseline:"middle",children:N})]},`ytick-${N}`)}),M&&t("path",{d:M,fill:"url(#ss-cg-total)"}),_&&t("path",{d:_,fill:"none",stroke:"var(--ss-accent)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),S&&t("path",{d:S,fill:"url(#ss-cg-error)"}),A&&t("path",{d:A,fill:"none",stroke:"var(--ss-red-fg)",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:"4,2"}),e.map((N,C)=>{const Q=u[C],pe=c[C],et=m[C].x,Aa=m[C].y,Ss=o/(e.length||1),$s=D.visible&&D.idx===C,Cs=D.visible&&D.idx!==C;return t("g",{children:[t("rect",{x:et-Ss/2,y:s.top,width:Ss,height:d,fill:"transparent",className:"ss-dash-chart-hover-zone","data-idx":C,onMouseEnter:()=>P(C),onMouseLeave:J}),Q>0&&t("circle",{cx:et,cy:Aa,r:$s?4:2.5,fill:"var(--ss-accent)",stroke:"var(--ss-surface)",strokeWidth:1,className:"ss-dash-chart-dot","data-idx":C,opacity:Cs?.3:1}),pe>0&&t("circle",{cx:et,cy:x[C].y,r:$s?3.5:2,fill:"var(--ss-red-fg)",stroke:"var(--ss-surface)",strokeWidth:1,className:"ss-dash-chart-dot ss-dash-chart-dot-err","data-idx":C,opacity:Cs?.3:1})]},C)}),e.map((N,C)=>{if(C%R!==0&&C!==e.length-1)return null;const Q=Gt(N.bucket);return Q?t("text",{x:w(C),y:n-6,textAnchor:"middle",fill:"var(--ss-dim)",fontSize:9,children:Q},`xlabel-${C}`):null})]}),D.visible&&D.idx>=0&&t("div",{className:"ss-dash-chart-tooltip",style:{left:Xe,top:s.top-4,transform:"translate(-50%, -100%)"},children:[t("div",{children:Gt(e[D.idx].bucket)}),t("div",{children:["Requests: ",u[D.idx]]}),c[D.idx]>0&&t("div",{style:{color:"var(--ss-red-fg)"},children:["Errors: ",c[D.idx]]})]})]})}function Zt({options:e={}}){const[s,n]=k("1h"),{data:r,isLoading:l}=V("overview",e),{data:a}=V("overview/chart",{...e,timeRange:s});if(l&&!r)return t("div",{className:"ss-dash-empty",children:"Loading overview..."});const i=r||{avgResponseTime:0,p95ResponseTime:0,requestsPerMinute:0,errorRate:0,totalRequests:0,slowestEndpoints:[],queryStats:{total:0,avgDuration:0,perRequest:0},recentErrors:[],topEvents:[],emailActivity:{sent:0,queued:0,failed:0},logLevelBreakdown:{error:0,warn:0,info:0,debug:0},cacheStats:null,jobQueueStatus:null,statusDistribution:{"2xx":0,"3xx":0,"4xx":0,"5xx":0},slowestQueries:[]},o=i,d=se(o,"avgResponseTime","avg_response_time"),h=se(o,"p95ResponseTime","p95_response_time"),u=se(o,"requestsPerMinute","requests_per_minute"),c=se(o,"errorRate","error_rate"),p=se(o,"totalRequests","total_requests")>0,f=a?.buckets||[],g=i.sparklines?.avgResponseTime??f.map(m=>m.avgDuration??0),b=i.sparklines?.p95ResponseTime??f.map(m=>m.p95Duration??0),w=i.sparklines?.requestsPerMinute??f.map(m=>m.requestCount??0),y=i.sparklines?.errorRate??f.map(m=>m.errorCount??0);return t("div",{className:"ss-dash-overview",children:[t("div",{className:"ss-dash-cards",children:[t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Avg Response Time"}),t("div",{className:`ss-dash-card-value ${p?d>500?"ss-dash-red":d>200?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?X(d):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Te,{data:g,color:"#34d399",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"P95 Response Time"}),t("div",{className:`ss-dash-card-value ${p?h>500?"ss-dash-red":h>200?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?X(h):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Te,{data:b,color:"#60a5fa",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Requests / min"}),t("div",{className:`ss-dash-card-value ${p?"ss-dash-accent":"ss-dash-dim"}`,children:p?u.toFixed(1):"-"}),t("div",{className:"ss-dash-sparkline",children:t(Te,{data:w,color:"#34d399",width:160,height:40})})]}),t("div",{className:"ss-dash-card",children:[t("div",{className:"ss-dash-card-title",children:"Error Rate"}),t("div",{className:`ss-dash-card-value ${p?c>5?"ss-dash-red":c>1?"ss-dash-amber":"ss-dash-accent":"ss-dash-dim"}`,children:p?`${c.toFixed(1)}%`:"-"}),t("div",{className:"ss-dash-sparkline",children:t(Te,{data:y,color:"#f87171",width:160,height:40})})]})]}),t("div",{className:"ss-dash-chart-container",children:[t("div",{className:"ss-dash-chart-header",children:[t("span",{className:"ss-dash-chart-title",children:"Request Volume"}),t(ur,{value:s,onChange:n})]}),t("div",{className:"ss-dash-chart",id:"ss-dash-chart-area",children:f.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"120px"},children:"No data for this range"}):t(fr,{chartPoints:f})}),t("div",{className:"ss-dash-chart-legend",id:"ss-dash-chart-legend",children:[t("span",{className:"ss-dash-chart-legend-item",children:[t("span",{className:"ss-dash-legend-dot",style:{background:"var(--ss-accent)"}}),"Requests"]}),f.some(m=>(m.errorCount??0)>0)&&t("span",{className:"ss-dash-chart-legend-item",children:[t("span",{className:"ss-dash-legend-dot",style:{background:"var(--ss-red-fg)"}}),"Errors"]})]})]}),t("div",{className:"ss-dash-secondary-cards",children:[t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#requests",className:"ss-dash-widget-link",children:"Slowest Endpoints"})}),i.slowestEndpoints.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No data yet"}):t("ul",{className:"ss-dash-secondary-list",children:i.slowestEndpoints.slice(0,5).map((m,x)=>{const _=m.url||m.pattern||"-";return t("li",{children:t("a",{href:`#requests?url=${encodeURIComponent(_)}`,className:"ss-dash-widget-row-link",children:[t("span",{title:_,children:_}),t("span",{className:`ss-dash-secondary-list-value ss-dash-duration ${de(m.avgDuration)}`,children:X(m.avgDuration)})]})},x)})})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#queries",className:"ss-dash-widget-link",children:"Query Stats"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:[t("span",{children:"Total Queries"}),t("span",{className:"ss-dash-secondary-list-value",children:i.queryStats.total})]}),t("li",{children:[t("span",{children:"Avg Duration"}),t("span",{className:"ss-dash-secondary-list-value",children:X(i.queryStats.avgDuration)})]}),t("li",{children:[t("span",{children:"Queries / Request"}),t("span",{className:"ss-dash-secondary-list-value",children:i.queryStats.perRequest.toFixed(1)})]})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#logs?level=error",className:"ss-dash-widget-link",children:"Recent Errors"})}),i.recentErrors.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No recent errors"}):t("ul",{className:"ss-dash-secondary-list",children:i.recentErrors.map((m,x)=>t("li",{children:t("a",{href:`#logs?id=${m.id??""}`,className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},title:m.message,children:m.message}),m.timestamp&&t(ne,{ts:m.timestamp,className:"ss-dash-secondary-list-value",style:{color:"var(--ss-dim)"}})]})},x))})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#events",className:"ss-dash-widget-link",children:"Top Events"})}),i.topEvents.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No events yet"}):t("ul",{className:"ss-dash-secondary-list",children:i.topEvents.slice(0,5).map((m,x)=>{const _=Kt(m);return t("li",{children:t("a",{href:`#events?event_name=${encodeURIComponent(_)}`,className:"ss-dash-widget-row-link",children:[t("span",{children:_}),t("span",{className:"ss-dash-secondary-list-value",children:m.count})]})},x)})})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#emails",className:"ss-dash-widget-link",children:"Email Activity"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#emails?status=sent",className:"ss-dash-widget-row-link",children:[t("span",{children:"Sent"}),t("span",{className:"ss-dash-secondary-list-value",children:i.emailActivity.sent})]})}),t("li",{children:t("a",{href:"#emails?status=queued",className:"ss-dash-widget-row-link",children:[t("span",{children:"Queued"}),t("span",{className:"ss-dash-secondary-list-value",children:i.emailActivity.queued})]})}),t("li",{children:t("a",{href:"#emails?status=failed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Failed"}),t("span",{className:"ss-dash-secondary-list-value",style:i.emailActivity.failed>0?{color:"var(--ss-red-fg)"}:void 0,children:i.emailActivity.failed})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#logs",className:"ss-dash-widget-link",children:"Log Levels"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#logs?level=error",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},children:"Error"}),t("span",{className:"ss-dash-secondary-list-value",children:i.logLevelBreakdown.error})]})}),t("li",{children:t("a",{href:"#logs?level=warn",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-amber-fg)"},children:"Warn"}),t("span",{className:"ss-dash-secondary-list-value",children:i.logLevelBreakdown.warn})]})}),t("li",{children:t("a",{href:"#logs?level=info",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-green-fg)"},children:"Info"}),t("span",{className:"ss-dash-secondary-list-value",children:i.logLevelBreakdown.info})]})}),t("li",{children:t("a",{href:"#logs?level=debug",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-dim)"},children:"Debug"}),t("span",{className:"ss-dash-secondary-list-value",children:i.logLevelBreakdown.debug})]})})]})]}),i.cacheStats&&i.cacheStats.available&&t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#cache",className:"ss-dash-widget-link",children:"Cache"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Keys"}),t("span",{className:"ss-dash-secondary-list-value",children:i.cacheStats.totalKeys})]})}),t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Hit Rate"}),t("span",{className:"ss-dash-secondary-list-value",children:[i.cacheStats.hitRate.toFixed(1),"%"]})]})}),t("li",{children:t("a",{href:"#cache",className:"ss-dash-widget-row-link",children:[t("span",{children:"Memory"}),t("span",{className:"ss-dash-secondary-list-value",children:i.cacheStats.memoryUsedHuman})]})})]})]}),i.jobQueueStatus&&i.jobQueueStatus.available&&t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#jobs",className:"ss-dash-widget-link",children:"Job Queue"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#jobs?status=active",className:"ss-dash-widget-row-link",children:[t("span",{children:"Active"}),t("span",{className:"ss-dash-secondary-list-value",children:i.jobQueueStatus.active})]})}),t("li",{children:t("a",{href:"#jobs?status=waiting",className:"ss-dash-widget-row-link",children:[t("span",{children:"Waiting"}),t("span",{className:"ss-dash-secondary-list-value",children:i.jobQueueStatus.waiting})]})}),t("li",{children:t("a",{href:"#jobs?status=failed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Failed"}),t("span",{className:"ss-dash-secondary-list-value",style:i.jobQueueStatus.failed>0?{color:"var(--ss-red-fg)"}:void 0,children:i.jobQueueStatus.failed})]})}),t("li",{children:t("a",{href:"#jobs?status=completed",className:"ss-dash-widget-row-link",children:[t("span",{children:"Completed"}),t("span",{className:"ss-dash-secondary-list-value",children:i.jobQueueStatus.completed})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#requests",className:"ss-dash-widget-link",children:"Response Status"})}),t("ul",{className:"ss-dash-secondary-list",children:[t("li",{children:t("a",{href:"#requests?status=2xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-green-fg)"},children:"2xx"}),t("span",{className:"ss-dash-secondary-list-value",children:i.statusDistribution["2xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=3xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-blue-fg)"},children:"3xx"}),t("span",{className:"ss-dash-secondary-list-value",children:i.statusDistribution["3xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=4xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-amber-fg)"},children:"4xx"}),t("span",{className:"ss-dash-secondary-list-value",children:i.statusDistribution["4xx"]})]})}),t("li",{children:t("a",{href:"#requests?status=5xx",className:"ss-dash-widget-row-link",children:[t("span",{style:{color:"var(--ss-red-fg)"},children:"5xx"}),t("span",{className:"ss-dash-secondary-list-value",children:i.statusDistribution["5xx"]})]})})]})]}),t("div",{className:"ss-dash-secondary-card",children:[t("div",{className:"ss-dash-secondary-card-title",children:t("a",{href:"#queries",className:"ss-dash-widget-link",children:"Slowest Queries"})}),i.slowestQueries.length===0?t("div",{className:"ss-dash-empty",style:{minHeight:"60px"},children:"No query data yet"}):t("ul",{className:"ss-dash-secondary-list",children:i.slowestQueries.slice(0,5).map((m,x)=>{const _=Ee(m)||"-";return t("li",{children:t("a",{href:`#queries?pattern=${encodeURIComponent(_)}`,className:"ss-dash-widget-row-link",children:[t("span",{title:_,children:_}),t("span",{className:`ss-dash-secondary-list-value ss-dash-duration ${de(m.avgDuration)}`,children:X(m.avgDuration)})]})},x)})})]})]})]})}const mr=Object.freeze(Object.defineProperty({__proto__:null,OverviewSection:Zt,default:Zt},Symbol.toStringTag,{value:"Module"}));function vr(e){if(!e)return[];if(typeof e=="string")try{return JSON.parse(e)}catch{return[]}return Array.isArray(e)?e:[]}function gr(e){if(!e)return[];if(typeof e=="string")try{return JSON.parse(e)}catch{return[]}return Array.isArray(e)?e:[]}function Je(e,s,n,r=0){return e[s]??e[n]??r}function _r(e){return{method:e.method||"",url:e.url||"",statusCode:Je(e,"status_code","statusCode"),totalDuration:Je(e,"total_duration","totalDuration")||e.duration||0,spanCount:Je(e,"span_count","spanCount"),spans:vr(e.spans),warnings:gr(e.warnings),logs:e.logs||[],httpRequestId:e.httpRequestId||e.http_request_id||void 0}}function Xt(e="",s){const n=B(null);return T(()=>(n.current||(n.current=new Ve({baseUrl:e,authToken:s})),n.current),[e,s])}function yr({color:e="muted",children:s,className:n="",classPrefix:r="ss-dash"}){return t("span",{className:`${r}-badge ${r}-badge-${e} ${n}`,children:s})}function Ge({method:e,className:s="",classPrefix:n="ss-dash"}){return t("span",{className:`${n}-method ${n}-method-${e.toLowerCase()} ${s}`,children:e})}function es({code:e,className:s="",classPrefix:n="ss-dash"}){let r=`${n}-status-2xx`;return e>=500?r=`${n}-status-5xx`:e>=400?r=`${n}-status-4xx`:e>=300&&(r=`${n}-status-3xx`),t("span",{className:`${n}-status ${r} ${s}`,children:e})}function br(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return null}return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}function ts(e){const s={};for(const[n,r]of Object.entries(e))Cr.has(n)||(s[n]=r);return Object.keys(s).length>0?s:null}const wr=["all","error","warn","info","debug"];function xr(e){return(e.levelName||e.level_name||(typeof e.level=="string"?e.level:"")||"info").toLowerCase()}function Nr(e){return e.msg||e.message||JSON.stringify(e)}function kr(e){return e.createdAt||e.created_at||e.time||e.timestamp||0}function Sr(e){const s=e.data||{};return e.requestId||e.request_id||e["x-request-id"]||s.requestId||s.request_id||s["x-request-id"]||""}function $r(e,s="ss-dbg-log-level"){switch(e){case"error":case"fatal":return`${s}-error`;case"warn":return`${s}-warn`;case"info":return`${s}-info`;case"debug":return`${s}-debug`;case"trace":return`${s}-trace`;default:return`${s}-info`}}const Cr=new Set(["level","time","pid","hostname","msg","message","v","name","levelName","level_name","timestamp","createdAt","created_at","requestId","request_id","x-request-id","id","data"]);function Er(e){if(e.data){const s=br(e.data);if(s){const n=ts(s);if(n)return n}}return ts(e)}function Le({data:e,maxPreviewLength:s=100,className:n="",classPrefix:r="ss-dash",defaultExpanded:l=!1}){const[a,i]=k(l),o=U(()=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},[e]),d=U(()=>typeof o=="object"&&o!==null?Qe(o,s):String(o??"-"),[o,s]),h=U(()=>typeof o=="object"&&o!==null?JSON.stringify(o,null,2):String(o),[o]),u=T(()=>{i(v=>!v)},[]),c=T(async()=>{try{await navigator.clipboard.writeText(h)}catch{}},[h]);return!e&&e!==0&&e!==!1?t("span",{className:`ss-dim ${r}-c-dim`,children:"-"}):t("div",{className:`${r}-data-cell ${n}`,children:[!a&&t("span",{className:`${r}-data-preview`,onClick:u,role:"button",tabIndex:0,onKeyDown:v=>v.key==="Enter"&&u(),children:d}),a&&t("div",{className:`${r}-data-full`,onClick:u,children:[t("button",{className:`${r}-copy-btn`,onClick:v=>{v.stopPropagation(),c()},title:"Copy to clipboard",type:"button",children:"Copy"}),t("pre",{children:h})]})]})}function ss({log:e,index:s,expanded:n,onToggleExpand:r,onReqIdClick:l}){const a=xr(e),i=Nr(e),o=kr(e),d=Sr(e),h=Er(e);return t(jt.Fragment,{children:[t("div",{className:`ss-log-entry${h?" ss-log-entry-expandable":""}`,onClick:()=>h&&r(s),children:[t("span",{className:`ss-log-level ${$r(a,"ss-log-level")}`,children:a.toUpperCase()}),t(ne,{ts:o,className:"ss-log-time"}),d?t("span",{className:"ss-log-reqid",title:d,onClick:l?u=>{u.stopPropagation(),l(d)}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,onKeyDown:l?u=>{u.key==="Enter"&&(u.stopPropagation(),l(d))}:void 0,children:d.slice(0,8)}):t("span",{className:"ss-log-reqid-empty",children:"--"}),h?t("span",{className:`ss-log-expand-icon${n?" ss-log-expand-icon-open":""}`,children:"▶"}):t("span",{style:{width:14}}),t("span",{className:"ss-log-msg",children:i})]}),n&&h&&t("div",{className:"ss-log-detail",children:t(Le,{data:h,classPrefix:"ss-dbg",defaultExpanded:!0})})]})}function Tr({logs:e,onReqIdClick:s}){const[n,r]=k(null);return e.length===0?null:t("div",{children:[t("div",{className:"ss-related-logs-title",children:["Related Logs",t("span",{className:"ss-related-logs-count",children:["(",e.length,")"]})]}),t("div",{style:{overflow:"auto"},children:e.map((l,a)=>t(ss,{log:l,index:a,expanded:n===a,onToggleExpand:i=>r(n===i?null:i),onReqIdClick:s},l.id||a))})]})}function Lr(e){const{container:s,handle:n,topPane:r,bottomPane:l,storageKey:a,minHeight:i=60}=e;if(a){const d=localStorage.getItem(a);if(d){const h=parseFloat(d);h>0&&h<1&&(r.style.flex=`${h}`,l.style.flex=`${1-h}`)}}function o(d){d.preventDefault(),n.setPointerCapture(d.pointerId);const u=s.getBoundingClientRect().height,c=d.clientY,v=r.getBoundingClientRect().height;function p(g){const b=g.clientY-c;let w=v+b;const y=u-i-n.offsetHeight;w=Math.max(i,Math.min(w,y));const m=w/(u-n.offsetHeight);r.style.flex=`${m}`,l.style.flex=`${1-m}`}function f(){if(n.removeEventListener("pointermove",p),n.removeEventListener("pointerup",f),a){const g=s.getBoundingClientRect().height-n.offsetHeight;if(g>0){const b=r.getBoundingClientRect().height/g;localStorage.setItem(a,String(b))}}}n.addEventListener("pointermove",p),n.addEventListener("pointerup",f)}return n.addEventListener("pointerdown",o),()=>{n.removeEventListener("pointerdown",o)}}function Ar({children:e,storageKey:s}){const n=B(null),r=B(null),l=B(null),a=B(null);return H(()=>{if(n.current&&r.current&&l.current&&a.current)return Lr({container:n.current,handle:r.current,topPane:l.current,bottomPane:a.current,storageKey:s})},[s]),t("div",{ref:n,className:"ss-split-container",children:[t("div",{ref:l,className:"ss-split-top",children:e[0]}),t("div",{ref:r,className:"ss-split-handle"}),t("div",{ref:a,className:"ss-split-bottom",children:e[1]})]})}const Pr="ss-col-resize",ns="ss-resizing";function rs(e){const s=Array.from(e.querySelectorAll("thead th"));if(s.length===0)return()=>{};const n=[];let r=!1;function l(){if(!r){r=!0;for(const a of s)a.style.width=a.offsetWidth+"px";e.style.tableLayout="fixed"}}for(const a of s){let i=function(d){d.preventDefault(),d.stopPropagation(),l();const h=d.clientX,u=a.offsetWidth;o.classList.add(ns),o.setPointerCapture(d.pointerId);function c(p){const f=p.clientX-h,g=Math.max(30,u+f);a.style.width=g+"px"}function v(){o.classList.remove(ns),o.removeEventListener("pointermove",c),o.removeEventListener("pointerup",v)}o.addEventListener("pointermove",c),o.addEventListener("pointerup",v)};if(!a.textContent?.trim())continue;const o=document.createElement("div");o.className=Pr,a.appendChild(o),o.addEventListener("pointerdown",i),n.push(()=>{o.removeEventListener("pointerdown",i),o.remove()})}return()=>{for(const a of n)a()}}function Mr(e=[]){const s=B(null),n=B(null);return H(()=>(s.current&&(n.current?.(),n.current=rs(s.current)),()=>{n.current?.(),n.current=null}),e),T(l=>{n.current?.(),n.current=null,s.current=l,l&&(n.current=rs(l))},[])}function ee({columns:e,data:s,keyField:n="id",sort:r,sortDir:l,onSort:a,onRowClick:i,rowClassName:o,emptyMessage:d="No data",className:h="",renderAfterRow:u}){const c=T(p=>{a&&a(p)},[a]),v=Mr([s,e]);return s.length===0?t("div",{className:"ss-dash-empty",children:d}):t("table",{ref:v,className:`ss-dash-table ${h}`,children:[t("colgroup",{children:e.map(p=>t("col",{style:p.width?{width:p.width}:void 0},p.key))}),t("thead",{children:t("tr",{children:e.map(p=>t("th",{onClick:p.sortable?()=>c(p.key):void 0,className:p.sortable?"ss-dash-sortable":"",children:[p.label,r===p.key&&t("span",{className:"ss-dash-sort-arrow",children:l==="asc"?" ▲":" ▼"})]},p.key))})}),t("tbody",{children:s.map((p,f)=>{const g=o?typeof o=="function"?o(p):o:"",b=i?"ss-dash-clickable":"";return t(jt.Fragment,{children:[t("tr",{onClick:i?()=>i(p):void 0,className:`${b} ${g}`.trim(),children:e.map(w=>t("td",{children:w.render?w.render(p[w.key],p):p[w.key]??"-"},w.key))}),u?u(p,f):null]},p[n]??f)})})]})}function Z({search:e,onSearchChange:s,placeholder:n="Search...",summary:r,children:l,className:a=""}){const i=T(()=>{s("")},[s]);return t("div",{className:`ss-dbg-filter-bar ${a}`,children:[r!=null&&t("span",{className:"ss-dbg-summary",children:r}),t("div",{className:"ss-dbg-search-wrapper",children:[t("svg",{className:"ss-dbg-search-icon",width:"14",height:"14",viewBox:q.search.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:q.search.elements.join("")}}),t("input",{type:"text",className:"ss-dbg-search",placeholder:n,value:e,onChange:o=>s(o.target.value)}),e&&t("button",{type:"button",className:"ss-dbg-search-clear",onClick:i,children:"×"})]}),l&&t("div",{className:"ss-dbg-filter-controls",children:l})]})}function ie({page:e,lastPage:s,total:n,onPageChange:r,className:l=""}){const a=U(()=>un(e,s),[e,s]),i=T(()=>{e>1&&r(e-1)},[e,r]),o=T(()=>{e<s&&r(e+1)},[e,s,r]);return s<=1?null:t("div",{className:`ss-dash-pagination ${l}`,children:[t("span",{className:"ss-dash-page-info",children:["Page ",e," of ",s," (",n," total)"]}),t("div",{className:"ss-dash-pagination-controls",children:[t("button",{type:"button",className:"ss-dash-page-btn",onClick:i,disabled:e<=1,children:"« Prev"}),a.map((d,h)=>d==="..."?t("span",{className:"ss-dash-page-ellipsis",children:"..."},`ellipsis-${h}`):t("button",{type:"button",className:`ss-dash-page-btn ${d===e?"ss-dash-active":""}`,onClick:()=>r(d),children:d},d)),t("button",{type:"button",className:"ss-dash-page-btn",onClick:o,disabled:e>=s,children:"Next »"})]})]})}const as={request:"#1e3a5f",middleware:"rgba(30, 58, 95, 0.7)",db:"#6d28d9",view:"#0e7490",mail:"#059669",event:"#b45309",custom:"var(--ss-dim)"},Rr={request:"Request",middleware:"Middleware",db:"DB",mail:"Mail",event:"Event",view:"View",custom:"Custom"};function is({spans:e,totalDuration:s,className:n="",warnings:r}){const l=e||[],a=U(()=>[...l].sort((o,d)=>o.startOffset-d.startOffset),[l]),i=U(()=>{const o={};for(const d of a)o[d.id]=d.parentId?(o[d.parentId]||0)+1:0;return o},[a]);return l.length===0?t("div",{className:"ss-dash-empty",children:"No spans recorded"}):t("div",{className:`ss-dash-tl-waterfall ${n}`,children:[t("div",{className:"ss-dash-tl-legend",children:Object.entries(Rr).map(([o,d])=>t("div",{className:"ss-dash-tl-legend-item",children:[t("span",{className:"ss-dash-tl-legend-dot",style:{background:as[o]||as.custom}}),t("span",{children:d})]},o))}),a.map(o=>{const d=s>0?o.startOffset/s*100:0,h=s>0?Math.max(o.duration/s*100,.5):1,u=i[o.id]||0,c=o.label.length>50?o.label.slice(0,50)+"...":o.label,v=o.category==="db"?"DB":o.category,p=o.category==="db"?"purple":o.category==="mail"?"green":o.category==="event"?"amber":o.category==="view"?"blue":"muted",f=o.metadata?Object.entries(o.metadata).filter(([,b])=>b!=null).map(([b,w])=>`${b}=${w}`).join(", "):"",g=f?`${o.label} (${o.duration.toFixed(2)}ms)
|
|
2
|
+
${f}`:`${o.label} (${o.duration.toFixed(2)}ms)`;return t("div",{className:"ss-dash-tl-row",children:[t("div",{className:"ss-dash-tl-label",title:g,style:{paddingLeft:8+u*16+"px"},children:[t("span",{className:`ss-dash-badge ss-dash-badge-${p}`,style:{fontSize:"9px",marginRight:"4px"},children:v}),c]}),t("div",{className:"ss-dash-tl-track",children:t("div",{className:`ss-dash-tl-bar ss-dash-tl-bar-${o.category||"custom"}`,style:{left:`${d}%`,width:`${h}%`},title:g})}),t("span",{className:"ss-dash-tl-dur",children:[o.duration.toFixed(2),"ms"]})]},o.id)}),r&&r.length>0&&t("div",{className:"ss-dash-tl-warnings",children:[t("div",{className:"ss-dash-tl-warnings-title",children:["Warnings (",r.length,")"]}),r.map((o,d)=>t("div",{className:"ss-dash-tl-warning",children:o},d))]})]})}function ls({options:e={}}){const[s,n]=k(1),[r,l]=k(""),[a,i]=k("createdAt"),[o,d]=k("desc"),[h,u]=k(null),[c,v]=k(!1);H(()=>n(1),[r]);const{data:p,meta:f,isLoading:g,error:b}=V("requests",{...e,page:s,search:r,sort:a,sortDir:o}),w=Xt(e.baseUrl||"",e.authToken),y=T(_=>{const A=_.id;v(!0);const M=e.dashboardEndpoint||"/__stats/api";w().fetch(`${M}/requests/${A}`).then(S=>{const $=S,R=$.trace;if(R){const D={...$,...R,logs:$.logs};u(D)}else u(S);v(!1)}).catch(()=>{v(!1)})},[w,e.dashboardEndpoint]),m=T(_=>{a===_?d(A=>A==="asc"?"desc":"asc"):(i(_),d("desc"))},[a]),x=p||[];if(h){const _=_r(h),A=_.logs.length>0;return t("div",{children:[t("div",{className:"ss-dash-tl-detail-header",children:[t("button",{type:"button",className:"ss-dash-btn",onClick:()=>u(null),children:"← Back to Requests"}),t(Ge,{method:_.method}),t("span",{style:{color:"var(--ss-text)"},children:_.url}),t(es,{code:_.statusCode}),t("span",{className:"ss-dash-tl-meta",children:[_.totalDuration.toFixed(1),"ms · ",_.spanCount," spans"]})]}),A?t(Ar,{storageKey:"ss-requests-split",children:[t(is,{spans:_.spans,totalDuration:_.totalDuration,warnings:_.warnings}),t(Tr,{logs:_.logs})]}):t(is,{spans:_.spans,totalDuration:_.totalDuration,warnings:_.warnings})]})}return c?t("div",{children:[t("div",{className:"ss-dash-tl-detail-header",children:t("button",{type:"button",className:"ss-dash-btn",onClick:()=>v(!1),children:"← Back to Requests"})}),t("div",{className:"ss-dash-empty",children:"Loading request detail..."})]}):t("div",{children:[t(Z,{search:r,onSearchChange:l,placeholder:"Filter requests...",summary:`${f?.total??0} requests`}),b&&t("div",{className:"ss-dash-empty",children:"Failed to load requests"}),g&&!p?t("div",{className:"ss-dash-empty",children:"Loading requests..."}):t(F,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"id",label:"#",width:"40px",render:_=>t("span",{style:{color:"var(--ss-dim)"},children:_})},{key:"method",label:"Method",width:"70px",sortable:!0,render:_=>t(Ge,{method:_})},{key:"url",label:"URL",sortable:!0,render:_=>t("span",{style:{color:"var(--ss-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:_,children:_})},{key:"statusCode",label:"Status",width:"60px",sortable:!0,render:(_,A)=>{const M=Vn(A);return t(es,{code:M})}},{key:"duration",label:"Duration",width:"80px",sortable:!0,render:(_,A)=>{const M=Wn(A);return t("span",{className:`ss-dash-duration ${de(M)}`,children:[M.toFixed(1),"ms"]})}},{key:"spanCount",label:"Spans",width:"50px",render:(_,A)=>{const M=Kn(A);return t("span",{style:{color:"var(--ss-muted)",textAlign:"center"},children:M})}},{key:"warningCount",label:"⚠",width:"40px",render:(_,A)=>{const M=Qn(A);return M>0?t("span",{style:{color:"var(--ss-amber-fg)",textAlign:"center",display:"block"},children:M}):t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:"-"})}},{key:"createdAt",label:"Time",width:"80px",sortable:!0,render:(_,A)=>{const M=Ce(A)??"";return t(ne,{ts:M,className:"ss-dash-event-time"})}}],data:x,sort:a,sortDir:o,onSort:m,onRowClick:y,emptyMessage:"No requests recorded yet"})}),f&&t(ie,{page:f.page,lastPage:f.lastPage,total:f.total,onPageChange:n})]})]})}const Dr=Object.freeze(Object.defineProperty({__proto__:null,RequestsSection:ls,default:ls},Symbol.toStringTag,{value:"Module"}));function Fr(e,s){let n=0,r=0;for(const d of e){const h=I(d,"duration")??0;r+=h,h>Ot&&n++}const l=os(e);let a=0;for(const d of l.values())d>1&&(a+=d);const i=e.length>0?r/e.length:0,o=s?.total??e.length;return{slowCount:n,dupCount:a,avgDuration:i,totalCount:o}}function os(e){const s=new Map;for(const n of e){const l=Ee(n);s.set(l,(s.get(l)||0)+1)}return s}class qr{state;constructor(s="list"){this.state={viewMode:s,sort:{key:s==="list"?"createdAt":"count",dir:"desc"},expandedIds:new Set,explainData:new Map,search:""}}setViewMode(s){return this.state.viewMode=s,this.state.sort={key:s==="list"?"createdAt":"count",dir:"desc"},this.state.expandedIds=new Set,this.state.explainData=new Map,this.state}toggleSort(s){return this.state.sort.key===s?this.state.sort={key:s,dir:this.state.sort.dir==="asc"?"desc":"asc"}:this.state.sort={key:s,dir:"desc"},this.state}toggleExpand(s){return this.state.expandedIds.has(s)?this.state.expandedIds.delete(s):this.state.expandedIds.add(s),this.state}isExpanded(s){return this.state.expandedIds.has(s)}setSearch(s){return this.state.search=s,this.state}startExplain(s){this.state.explainData.set(s,{loading:!0})}completeExplain(s,n){this.state.explainData.set(s,{loading:!1,result:n})}failExplain(s,n){this.state.explainData.set(s,{loading:!1,error:n})}clearExplain(){this.state.explainData=new Map}getExplainState(s){return this.state.explainData.get(s)}}function jr(e){const s=[];if(e["Startup Cost"]!==null&&e["Startup Cost"]!==void 0&&s.push(`cost=${e["Startup Cost"]}..${e["Total Cost"]}`),e["Plan Rows"]!==null&&e["Plan Rows"]!==void 0&&s.push(`rows=${e["Plan Rows"]}`),e["Plan Width"]!==null&&e["Plan Width"]!==void 0&&s.push(`width=${e["Plan Width"]}`),e.Filter&&s.push(`filter: ${e.Filter}`),e["Index Cond"]&&s.push(`cond: ${e["Index Cond"]}`),e["Hash Cond"]&&s.push(`hash: ${e["Hash Cond"]}`),e["Join Type"]&&s.push(`join: ${e["Join Type"]}`),e["Sort Key"]){const n=Array.isArray(e["Sort Key"])?e["Sort Key"].join(", "):e["Sort Key"];s.push(`sort: ${n}`)}return s}function cs(e,s=0){if(!e)return[];const r=[{depth:s,nodeType:e["Node Type"]||"Unknown",relationName:e["Relation Name"]||"",alias:e.Alias&&e.Alias!==e["Relation Name"]?e.Alias:"",indexName:e["Index Name"]||"",metrics:jr(e),isRoot:s===0}],l=e.Plans||[];for(const a of l)r.push(...cs(a,s+1));return r}function Ir(e){return!e||typeof e!="object"?!1:"Plan"in e}function Or(e){if(!e||e.length===0)return[];const s=e[0];return!s||typeof s!="object"?[]:Object.keys(s)}function Br(e){return e==null?"-":String(e)}function Ur(e){const s=e?.showExplain??!0,n=[{key:"id",label:"#",width:"40px",type:"index"},{key:"sql",label:"SQL",type:"sql"},{key:"duration",label:"Duration",width:"70px",sortable:!0,type:"duration"},{key:"method",label:"Method",width:"60px",type:"method"},{key:"model",label:"Model",width:"90px",type:"model"},{key:"connection",label:"Connection",width:"80px",type:"connection"},{key:"createdAt",label:"Time",width:"90px",sortable:!0,type:"time"}];return s&&n.push({key:"id",label:"",width:"70px",type:"explain"}),n}function Hr(){return[{key:"sqlNormalized",label:"Pattern",type:"sql"},{key:"count",label:"Count",width:"60px",sortable:!0},{key:"avgDuration",label:"Avg",width:"70px",sortable:!0,type:"duration"},{key:"minDuration",label:"Min",width:"70px",type:"duration"},{key:"maxDuration",label:"Max",width:"70px",type:"duration"},{key:"totalDuration",label:"Total",width:"70px",sortable:!0,type:"duration"},{key:"percentOfTotal",label:"% Time",width:"60px"}]}function zr({node:e,depth:s=0}){if(!e)return null;const n=U(()=>cs(e,s),[e,s]);return t(F,{children:n.map((r,l)=>t("div",{className:"ss-dash-explain-node",style:{marginLeft:`${r.depth*20}px`},children:[t("div",{className:"ss-dash-explain-node-header",children:[t("span",{className:"ss-dash-explain-node-type",children:r.nodeType}),r.relationName&&t(F,{children:[" on ",t("strong",{children:r.relationName})]}),r.alias&&` (${r.alias})`,r.indexName&&t(F,{children:[" using ",t("em",{children:r.indexName})]})]}),r.metrics.length>0&&t("div",{className:"ss-dash-explain-metrics",children:r.metrics.join(" · ")})]},l))})}function Vr({plan:e}){if(!e||!Array.isArray(e)||e.length===0)return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"});const s=e[0];if(Ir(s))return t("div",{className:"ss-dash-explain-result",children:t(zr,{node:s.Plan,depth:0})});if(typeof s=="object"&&s!==null){const n=Or(e);return t("div",{className:"ss-dash-explain-result",children:t("table",{children:[t("thead",{children:t("tr",{children:n.map(r=>t("th",{children:r},r))})}),t("tbody",{children:e.map((r,l)=>{const a=r;return t("tr",{children:n.map(i=>t("td",{children:Br(a[i])},i))},l)})})]})})}return t("div",{className:"ss-dash-explain-result",children:"No plan data returned"})}const ds=t("span",{className:"ss-empty-hint",children:["Queries require ",t("code",{children:"debug: true"})," on your Lucid connections in"," ",t("code",{children:"config/database.ts"})]});function Wr({mode:e,controllerState:s,queries:n,meta:r,isLoading:l,onSearchChange:a,onSort:i,onToggleExpand:o,onViewModeChange:d,onPageChange:h,onExplain:u,onCloseExplain:c,summary:v,filterBarChildren:p}){const{viewMode:f,sort:g,expandedIds:b,explainData:w,search:y}=s,m=!!u,x=e==="dashboard"&&!!r,_=e==="dashboard"&&!!d,A=U(()=>os(n),[n]);if(_&&f==="grouped")return M();return S();function M(){const R=Hr().map(D=>Kr(D,b,o));return t("div",{children:[t(Z,{search:y,onSearchChange:a,placeholder:"Filter queries...",summary:v,children:p}),l&&n.length===0?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:R,data:n,keyField:"sqlNormalized",sort:g.key,sortDir:g.dir,onSort:i,emptyMessage:t(F,{children:["No queries recorded",ds]})})})]})}function S(){const $=Ur({showExplain:m}),R=$.map(P=>Qr(P,b,A,w,o,u)),D=$.length,E=m?P=>{const J=P.id,z=w.get(J);return!z||z.loading?null:t("tr",{className:"ss-dash-explain-row",children:t("td",{colSpan:D,className:"ss-dash-explain",children:t("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[t("div",{style:{flex:1},children:z.error?t("div",{className:"ss-dash-explain-result ss-dash-explain-error",children:[t("strong",{children:"Error:"})," ",z.error,z.result?.message&&t(F,{children:[t("br",{}),z.result.message]})]}):z.result?t(Vr,{plan:z.result.plan||z.result.rows||[]}):null}),t("button",{type:"button",className:"ss-dash-explain-btn",onClick:()=>c?.(),style:{marginLeft:"8px",flexShrink:0},children:"Close"})]})})})}:void 0;return t("div",{children:[t(Z,{search:y,onSearchChange:a,placeholder:"Filter queries...",summary:v,children:p}),l&&n.length===0?t("div",{className:"ss-dash-empty",children:"Loading queries..."}):t(F,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:R,data:n,sort:g.key,sortDir:g.dir,onSort:i,emptyMessage:t(F,{children:["No queries captured",ds]}),renderAfterRow:E})}),x&&r&&t(ie,{page:r.page,lastPage:r.lastPage,total:r.total,onPageChange:h})]})]})}}function Kr(e,s,n){const r={key:e.key,label:e.label,width:e.width,sortable:e.sortable};switch(e.type){case"sql":r.render=(l,a)=>{const i=l||"",o=(a.count||0)>=3;return t(F,{children:[t("span",{className:`ss-dash-sql ${s.has(i)?"ss-dash-expanded":""}`,title:"Click to expand",onClick:d=>{d.stopPropagation(),n(i)},role:"button",tabIndex:0,onKeyDown:d=>d.key==="Enter"&&n(i),children:i}),o&&t(F,{children:[" ",t("span",{className:"ss-dash-dup",children:"DUP"})]})]})};break;case"duration":r.render=l=>{const a=l||0,i=e.key==="avgDuration"||e.key==="maxDuration";return t("span",{className:`ss-dash-duration ${i?de(a):""}`,children:e.key==="totalDuration"?a.toFixed(1)+"ms":a.toFixed(2)+"ms"})};break;default:e.key==="count"?r.render=l=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:l||0}):e.key==="percentOfTotal"&&(r.render=l=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:(l||0).toFixed(1)+"%"}));break}return r}function Qr(e,s,n,r,l,a){const i={key:e.key,label:e.label,width:e.width,sortable:e.sortable};switch(e.type){case"index":i.render=o=>t("span",{style:{color:"var(--ss-dim)"},children:o});break;case"sql":i.render=(o,d)=>{const h=d.sql||d.sql_text||"",u=d.id;return t("div",{children:[t("span",{className:`ss-dash-sql ${s.has(u)?"ss-dash-expanded":""}`,title:"Click to expand",onClick:c=>{c.stopPropagation(),l(u)},role:"button",tabIndex:0,onKeyDown:c=>c.key==="Enter"&&l(u),children:h}),(n.get(Ee(d))??0)>1&&t("span",{className:"ss-dash-dup",children:["×",n.get(Ee(d))]})]})};break;case"duration":i.render=o=>{const d=o||0;return t("span",{className:`ss-dash-duration ${de(d)}`,children:d.toFixed(2)+"ms"})};break;case"method":i.render=(o,d)=>{const h=Qt(d);return t("span",{className:`ss-dash-method ss-dash-method-${h.toLowerCase()}`,children:h})};break;case"model":i.render=o=>t("span",{style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:o,children:o||"-"});break;case"connection":i.render=o=>t("span",{style:{color:"var(--ss-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o||"-"});break;case"time":i.render=(o,d)=>{const h=o||(Ce(d)??"");return t(ne,{ts:h,className:"ss-dash-event-time"})};break;case"explain":i.render=(o,d)=>{if(Qt(d)!=="select")return null;const u=d.id,c=r.get(u),v=c&&!c.loading&&c.result&&!c.error,p=c?.loading;return t("button",{type:"button",className:`ss-dash-explain-btn${v?" ss-dash-explain-btn-active":""}`,onClick:f=>{f.stopPropagation(),a?.(u)},disabled:!!p,children:p?"...":"EXPLAIN"})};break}return i}function hs({options:e={}}){const[s,n]=k(1),r=B(new qr("list")),[l,a]=k(r.current.state),i=T(()=>{a({...r.current.state})},[]),{viewMode:o,sort:d,search:h}=l,u=T(S=>{S!==r.current.state.viewMode&&(r.current.setViewMode(S),n(1),i())},[i]),c=T(S=>{r.current.setSearch(S),i()},[i]);H(()=>n(1),[h]);const v=o==="grouped"?"queries/grouped":"queries",{data:p,meta:f,isLoading:g,getApi:b}=V(v,{...e,page:s,search:h,sort:d.key,sortDir:d.dir}),w=T(S=>{r.current.toggleSort(S),i()},[i]),y=T(S=>{r.current.toggleExpand(S),i()},[i]),m=T(async S=>{const $=r.current.getExplainState(S);if($&&!$.loading){r.current.clearExplain(),i();return}r.current.startExplain(S),i();try{const R=await b().explainQuery(S);if(R&&R.error){const D=R.message?`${R.error}: ${R.message}`:R.error;r.current.failExplain(S,D)}else r.current.completeExplain(S,{plan:R?.plan||void 0,rows:R?.rows||void 0})}catch(R){console.warn("[ss] Query explain failed:",R);let D=R instanceof Error?R.message:String(R);const E=R?.body;if(E)try{const P=JSON.parse(E);P.message?D=P.error?`${P.error}: ${P.message}`:P.message:P.error&&(D=P.error)}catch{}r.current.failExplain(S,D)}i()},[b,i]),x=T(()=>{r.current.clearExplain(),i()},[i]),_=o==="grouped"?p?.groups||[]:p||[],A=U(()=>o!=="grouped"?_:_.map(S=>{const $={...S};return $.sqlNormalized??=I(S,"sql_normalized","pattern")??void 0,$.count??=I(S,"total_count"),$.avgDuration??=I(S,"avg_duration"),$.maxDuration??=I(S,"max_duration"),$.minDuration??=I(S,"min_duration"),$.totalDuration??=I(S,"total_duration"),$.percentOfTotal??=I(S,"pct_time"),$}),[_,o]),M=U(()=>{if(o==="grouped")return`${A.length} query patterns`;const S=Fr(A,f??void 0),$=[`${S.totalCount} queries`];return S.slowCount>0&&$.push(`${S.slowCount} slow`),S.dupCount>0&&$.push(`${S.dupCount} dup`),$.push(`avg ${(S.avgDuration||0).toFixed(1)}ms`),$.join(", ")},[o,A,f]);return t(Wr,{mode:"dashboard",controllerState:l,queries:A,meta:f,isLoading:g&&!p,onSearchChange:c,onSort:w,onToggleExpand:y,onViewModeChange:u,onPageChange:n,onExplain:m,onCloseExplain:x,summary:M,filterBarChildren:t("div",{className:"ss-dash-btn-group",children:[t("button",{type:"button",className:`ss-dash-btn ${o==="list"?"ss-dash-active":""}`,onClick:()=>u("list"),children:"List"}),t("button",{type:"button",className:`ss-dash-btn ${o==="grouped"?"ss-dash-active":""}`,onClick:()=>u("grouped"),children:"Grouped"})]})})}const Jr=Object.freeze(Object.defineProperty({__proto__:null,QueriesSection:hs,default:hs},Symbol.toStringTag,{value:"Module"}));function us({options:e={}}){const[s,n]=k(1),[r,l]=k(""),{data:a,meta:i,isLoading:o}=V("events",{...e,page:s,search:r}),d=a||[];return H(()=>n(1),[r]),t("div",{children:[t(Z,{search:r,onSearchChange:l,placeholder:"Filter events...",summary:`${i?.total??0} events`}),o&&!a?t("div",{className:"ss-dash-empty",children:"Loading events..."}):t(F,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"id",label:"#",width:"40px",render:h=>t("span",{style:{color:"var(--ss-dim)"},children:h})},{key:"eventName",label:"Event",render:(h,u)=>{const c=Kt(u);return t("span",{className:"ss-dash-event-name",title:c,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:c})}},{key:"data",label:"Data",render:h=>t(Le,{data:h,maxPreviewLength:80,className:"ss-dash-event-data"})},{key:"createdAt",label:"Time",width:"80px",render:(h,u)=>{const c=Ce(u);return t(ne,{ts:c,className:"ss-dash-event-time"})}}],data:d,emptyMessage:"No events recorded yet"})}),i&&t(ie,{page:i.page,lastPage:i.lastPage,total:i.total,onPageChange:n})]})]})}const Gr=Object.freeze(Object.defineProperty({__proto__:null,EventsSection:us,default:us},Symbol.toStringTag,{value:"Module"}));function ps({options:e={}}){const[s,n]=k(""),{data:r,isLoading:l,error:a}=V("routes",{...e,search:s}),i=r,o=Array.isArray(i)?i:i&&Array.isArray(i.routes)?i.routes:i&&Array.isArray(i.data)?i.data:[],d={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return t("div",{children:[t(Z,{search:s,onSearchChange:n,placeholder:"Filter routes...",summary:`${o.length} routes`}),a?t("div",{className:"ss-dash-empty",children:"Failed to load routes"}):l&&!r?t("div",{className:"ss-dash-empty",children:"Loading routes..."}):t(F,{children:t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"method",label:"Method",width:"70px",render:h=>t(Ge,{method:h})},{key:"pattern",label:"Pattern",render:h=>t("span",{style:{color:"var(--ss-text)",...d},title:h,children:h})},{key:"name",label:"Name",width:"120px",render:h=>t("span",{style:{color:"var(--ss-muted)",...d},title:h||"-",children:h||"-"})},{key:"handler",label:"Handler",render:h=>t("span",{style:{color:"var(--ss-sql-color)",...d},title:h,children:h})},{key:"middleware",label:"Middleware",render:h=>{const u=h?.length?h.join(", "):"-";return t("span",{style:{color:"var(--ss-dim)",fontSize:"10px",...d},title:u,children:u})}}],data:o,keyField:"pattern",emptyMessage:"No routes available"})})})]})}const Yr=Object.freeze(Object.defineProperty({__proto__:null,RoutesSection:ps,default:ps},Symbol.toStringTag,{value:"Module"}));function fs({options:e={}}){const[s,n]=k(1),[r,l]=k(""),[a,i]=k("all"),[o,d]=k(""),[h,u]=k(""),[c,v]=k([]),[p,f]=k("level"),[g,b]=k("equals"),[w,y]=k(""),[m,x]=k(null),_={};a!=="all"&&(_.level=a),o&&(_.request_id=o),c.forEach((N,C)=>{_[`filter_field_${C}`]=N.field,_[`filter_op_${C}`]=N.operator,_[`filter_value_${C}`]=N.value});const{data:A,meta:M,isLoading:S}=V("logs",{...e,page:s,search:r,filters:_}),$=A||[],R=T(N=>{d(N),u(N),n(1)},[]),D=T(()=>{const N=h.trim();d(N),n(1)},[h]),E=T(()=>{d(""),u(""),n(1)},[]),P=T(()=>{i("all"),n(1)},[]),J=T(()=>{const N=w.trim();N&&(v(C=>[...C,{field:p,operator:g,value:N}]),y(""))},[p,g,w]),z=T(N=>{v(C=>C.filter((Q,pe)=>pe!==N))},[]),Xe=a!=="all"||o!==""||c.length>0;return t("div",{children:[t(Z,{search:r,onSearchChange:l,placeholder:"Search logs...",summary:`${M?.total??0} logs`,children:t("div",{className:"ss-dash-log-filters",children:[wr.map(N=>t("button",{type:"button",className:`ss-dash-log-filter ${a===N?"ss-dash-active":""}`,onClick:()=>{i(N),n(1)},children:N},N)),t("input",{type:"text",className:"ss-dash-filter-input ss-dash-reqid-input",placeholder:"Filter by request ID...",value:h,onChange:N=>u(N.target.value),onKeyDown:N=>N.key==="Enter"&&D()}),(h||o)&&t("button",{type:"button",className:"ss-dash-btn ss-dash-reqid-clear",onClick:()=>{E()},children:"Clear"})]})}),t("div",{className:"ss-dash-structured-search",children:[t("select",{className:"ss-dash-filter-select",value:p,onChange:N=>f(N.target.value),children:[t("option",{value:"level",children:"level"}),t("option",{value:"message",children:"message"}),t("option",{value:"request_id",children:"request_id"}),t("option",{value:"userId",children:"userId"}),t("option",{value:"email",children:"email"}),t("option",{value:"path",children:"path"})]}),t("select",{className:"ss-dash-filter-select",value:g,onChange:N=>b(N.target.value),children:[t("option",{value:"equals",children:"equals"}),t("option",{value:"contains",children:"contains"}),t("option",{value:"starts_with",children:"starts with"})]}),t("input",{className:"ss-dash-filter-input",placeholder:"Value...",value:w,onChange:N=>y(N.target.value),onKeyDown:N=>N.key==="Enter"&&J()}),t("button",{type:"button",className:"ss-dash-btn",onClick:J,children:"Add"})]}),Xe&&t("div",{className:"ss-dash-filter-chips",children:[a!=="all"&&t("span",{className:"ss-dash-filter-chip",children:["level: ",a,t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:P,children:"×"})]}),o&&t("span",{className:"ss-dash-filter-chip",children:["requestId: ",o.slice(0,8),"...",t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:E,children:"×"})]}),c.map((N,C)=>t("span",{className:"ss-dash-filter-chip",children:[N.field," ",N.operator,' "',N.value,'"',t("button",{type:"button",className:"ss-dash-filter-chip-remove",onClick:()=>z(C),children:"×"})]},C))]}),S&&!A?t("div",{className:"ss-dash-empty",children:"Loading logs..."}):$.length===0?t("div",{className:"ss-dash-empty",children:["No log entries",o?` matching request ${o}`:a!=="all"?` for ${a}`:""]}):t("div",{className:"ss-dash-log-entries",children:$.map((N,C)=>t(ss,{log:N,index:C,expanded:m===C,onToggleExpand:Q=>x(m===Q?null:Q),onReqIdClick:R},N.id||C))}),M&&t(ie,{page:M.page,lastPage:M.lastPage,total:M.total,onPageChange:n})]})}const Zr=Object.freeze(Object.defineProperty({__proto__:null,LogsSection:fs,default:fs},Symbol.toStringTag,{value:"Module"}));function Xr({email:e,previewHtml:s,isLoading:n=!1,onClose:r,className:l}){return t("div",{className:l||"ss-email-preview",children:[t("div",{className:"ss-email-preview-header",children:[t("div",{className:"ss-email-preview-meta",children:e&&t(F,{children:[e.subject!=null&&t("div",{children:[t("strong",{children:"Subject:"})," ",e.subject]}),e.from!=null&&t("div",{children:[t("strong",{children:"From:"})," ",e.from]}),e.to!=null&&t("div",{children:[t("strong",{children:"To:"})," ",e.to]}),e.cc&&t("div",{children:[t("strong",{children:"CC:"})," ",e.cc]}),e.status&&t("div",{children:[t("strong",{children:"Status:"})," ",t("span",{className:`ss-email-status ss-email-status-${e.status}`,children:e.status})]}),e.mailer&&t("div",{children:[t("strong",{children:"Mailer:"})," ",e.mailer]})]})}),t("button",{className:"ss-dbg-btn-clear",onClick:r,type:"button",children:"×"})]}),n?t("div",{className:"ss-empty",children:"Loading preview..."}):s?t("iframe",{className:"ss-email-iframe",srcDoc:s,title:"Email preview",sandbox:""}):t("div",{style:{padding:"12px",whiteSpace:"pre-wrap"},children:e?.text||"No content"})]})}function ms({options:e={}}){const[s,n]=k(1),[r,l]=k(""),[a,i]=k(null),[o,d]=k(null),{data:h,meta:u,isLoading:c}=V("emails",{...e,page:s,search:r}),v=h||[];H(()=>n(1),[r]);const p=T(async f=>{if(f.html){i(f.id),d(f.html);return}try{const{baseUrl:g="",dashboardEndpoint:b="/__stats/api",authToken:w}=e,y=`${g}${b}/emails/${f.id}/preview`,m={Accept:"text/html"};w&&(m.Authorization=`Bearer ${w}`);const _=await(await fetch(y,{headers:m,credentials:"same-origin"})).text();i(f.id),d(_)}catch{}},[e]);if(a&&o){const f=v.find(b=>b.id===a),g=f?{subject:f.subject,from:Vt(f),to:Wt(f),cc:Jn(f)||null,status:f.status,mailer:f.mailer}:null;return t(Xr,{email:g,previewHtml:o,onClose:()=>{i(null),d(null)},className:"ss-dash-email-preview"})}return t("div",{children:[t(Z,{search:r,onSearchChange:l,placeholder:"Filter emails...",summary:`${u?.total??0} emails`}),c&&!h?t("div",{className:"ss-dash-empty",children:"Loading emails..."}):t(F,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"id",label:"#",width:"40px",render:f=>t("span",{style:{color:"var(--ss-dim)"},children:f})},{key:"from",label:"From",width:"150px",render:(f,g)=>{const b=Vt(g);return t("span",{title:b,style:{color:"var(--ss-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:b})}},{key:"to",label:"To",width:"150px",render:(f,g)=>{const b=Wt(g);return t("span",{title:b,style:{color:"var(--ss-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:b})}},{key:"subject",label:"Subject",render:f=>{const g=f||"";return t("span",{title:g,style:{color:"var(--ss-sql-color)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:g})}},{key:"status",label:"Status",width:"80px",render:f=>{const g=f||"";return t("span",{className:`ss-dash-badge ss-dash-email-status-${g}`,children:g})}},{key:"attachmentCount",label:"ATT",width:"40px",render:(f,g)=>{const b=Gn(g);return b>0?t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:b}):t("span",{style:{color:"var(--ss-dim)",textAlign:"center",display:"block"},children:"-"})}},{key:"mailer",label:"Mailer",width:"70px",render:f=>{const g=f||"";return t("span",{title:g,style:{color:"var(--ss-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:g})}},{key:"createdAt",label:"Time",width:"80px",render:(f,g)=>{const b=Ce(g);return t(ne,{ts:b,className:"ss-dash-event-time",style:{whiteSpace:"nowrap"}})}}],data:v,onRowClick:p,rowClassName:"ss-dash-email-row",emptyMessage:"No emails captured yet"})}),u&&t(ie,{page:u.page,lastPage:u.lastPage,total:u.total,onPageChange:n})]})]})}const ea=Object.freeze(Object.defineProperty({__proto__:null,EmailsSection:ms,default:ms},Symbol.toStringTag,{value:"Module"}));function ta({hitRate:e,hits:s,misses:n,keys:r}){return t("div",{className:"ss-cache-stats",children:[t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hit Rate:"}),t("span",{className:"ss-cache-stat-value",children:[e.toFixed(1),"%"]})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Hits:"}),t("span",{className:"ss-cache-stat-value",children:s})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Misses:"}),t("span",{className:"ss-cache-stat-value",children:n})]}),t("div",{className:"ss-cache-stat",children:[t("span",{className:"ss-cache-stat-label",children:"Keys:"}),t("span",{className:"ss-cache-stat-value",children:r})]})]})}function vs({options:e={}}){const[s,n]=k(""),[r,l]=k(null),[a,i]=k(null),[o,d]=k(!1),[h,u]=k(null),{data:c,isLoading:v,mutate:p,getApi:f}=V("cache",{...e,search:s}),g=c,b=T(async y=>{if(confirm(`Delete cache key "${y}"?`))try{await p(`cache/${encodeURIComponent(y)}`,"delete"),r===y&&(l(null),i(null),u(null))}catch{}},[p,r]),w=T(async y=>{if(r===y){l(null),i(null),u(null);return}l(y),i(null),u(null),d(!0);try{const x=await f().fetchCacheKey(y);i(x.value!==void 0?x.value:x.data!==void 0?x.data:x),u(null)}catch{i(null),u("Failed to fetch key value")}finally{d(!1)}},[r,f]);return t("div",{children:[g?.available&&g?.stats&&t(ta,{hitRate:g.stats.hitRate??0,hits:g.stats.hits??0,misses:g.stats.misses??0,keys:g.stats.totalKeys||g.stats.keyCount||g.keys?.length||0}),t(Z,{search:s,onSearchChange:n,placeholder:"Filter cache keys...",summary:`${(g?.keys||g?.data||[]).length} keys`}),v&&!c?t("div",{className:"ss-dash-empty",children:"Loading cache..."}):!g||!g.available?t("div",{className:"ss-dash-empty",children:"Cache inspector not available"}):t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"key",label:"Key",render:y=>t("span",{title:y,style:{color:"var(--ss-sql-color)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:y})},{key:"type",label:"Type",width:"70px",render:y=>t("span",{style:{color:"var(--ss-muted)"},children:y})},{key:"size",label:"Size",width:"60px",render:y=>y!=null&&y>0?rr(y):"-"},{key:"ttl",label:"TTL",width:"70px",render:y=>y>0?nr(y):"-"},{key:"_actions",label:"",width:"60px",render:(y,m)=>t("button",{type:"button",className:"ss-dash-retry-btn",onClick:x=>{x.stopPropagation(),b(m.key)},children:"Delete"})}],data:g.keys||g.data||[],keyField:"key",onRowClick:y=>w(y.key),emptyMessage:"No cache keys found"})}),r&&t("div",{className:"ss-dash-cache-detail",children:[t("h4",{children:["Key: ",r]}),o?t("div",{className:"ss-dash-empty",children:"Loading value..."}):h?t("div",{className:"ss-dash-empty",style:{color:"var(--ss-red-fg)"},children:h}):t(Le,{data:a})]})]})}const sa=Object.freeze(Object.defineProperty({__proto__:null,CacheSection:vs,default:vs},Symbol.toStringTag,{value:"Module"})),na=["all","active","waiting","delayed","completed","failed"];function ra(e){switch(e){case"active":return"blue";case"waiting":return"amber";case"delayed":return"purple";case"completed":return"green";case"failed":return"red";default:return"muted"}}function aa(e){if(!e)return[];if(Array.isArray(e))return e;const s=e;return s.jobs||s.data||[]}function ia(e){if(!e||Array.isArray(e))return null;const s=e;return s.stats||s.overview||null}function la({stats:e,classPrefix:s="ss"}){if(!e)return null;const n=s;return t("div",{className:`${n}-job-stats`,children:[t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Active:"}),t("span",{className:`${n}-job-stat-value`,children:e.active??0})]}),t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Waiting:"}),t("span",{className:`${n}-job-stat-value`,children:e.waiting??0})]}),t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Delayed:"}),t("span",{className:`${n}-job-stat-value`,children:e.delayed??0})]}),t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Completed:"}),t("span",{className:`${n}-job-stat-value`,children:e.completed??0})]}),t("div",{className:`${n}-job-stat`,children:[t("span",{className:`${n}-job-stat-label`,children:"Failed:"}),t("span",{className:`${n}-job-stat-value ${n}-c-red`,children:e.failed??0})]})]})}function gs({options:e={}}){const[s,n]=k(1),[r,l]=k(""),[a,i]=k("all"),[o,d]=k({}),h={};a!=="all"&&(h.status=a);const{data:u,meta:c,isLoading:v,error:p,refresh:f,mutate:g}=V("jobs",{...e,page:s,search:r,filters:h}),b=aa(u),w=ia(u),y=T(async m=>{d(x=>({...x,[m]:"pending"}));try{await g(`jobs/${m}/retry`),d(x=>({...x,[m]:"success"})),setTimeout(()=>{d(x=>{const _={...x};return delete _[m],_}),f()},1e3)}catch{d(x=>{const _={...x};return delete _[m],_})}},[g,f]);return t("div",{children:[t(la,{stats:w,classPrefix:"ss-dash"}),t(Z,{search:r,onSearchChange:l,placeholder:"Filter jobs...",summary:`${c?.total??b.length} jobs`,children:t("div",{className:"ss-dash-btn-group",children:na.map(m=>t("button",{type:"button",className:`ss-dash-btn ${a===m?"ss-dash-active":""}`,onClick:()=>{i(m),n(1)},children:m.charAt(0).toUpperCase()+m.slice(1)},m))})}),v&&!u?t("div",{className:"ss-dash-empty",children:"Loading jobs..."}):p?t("div",{className:"ss-dash-empty",children:"Jobs/Queue not available"}):t(F,{children:[t("div",{className:"ss-dash-table-wrap",children:t(ee,{columns:[{key:"id",label:"ID",width:"40px",render:m=>t("span",{style:{color:"var(--ss-dim)"},children:m})},{key:"name",label:"Name",render:m=>t("span",{style:{color:"var(--ss-text)"},title:m,children:m})},{key:"status",label:"Status",width:"90px",render:m=>t(yr,{color:ra(m),children:m})},{key:"payload",label:"Payload",render:(m,x)=>t(Le,{data:m||x?.data,maxPreviewLength:60})},{key:"attempts",label:"Tries",width:"50px",render:(m,x)=>t("span",{style:{color:"var(--ss-muted)",textAlign:"center",display:"block"},children:m||x.attemptsMade||0})},{key:"duration",label:"Duration",width:"75px",render:m=>t("span",{className:"ss-dash-duration",children:m!==null?X(m):"-"})},{key:"timestamp",label:"Time",width:"70px",render:(m,x)=>{const _=m||zn(x);return t(ne,{ts:_,className:"ss-dash-event-time",style:{whiteSpace:"nowrap"}})}},{key:"_actions",label:"",width:"50px",render:(m,x)=>{const _=x.id,A=o[_];return x.status!=="failed"?null:t("button",{type:"button",className:"ss-dash-retry-btn",disabled:A==="pending"||A==="success",onClick:M=>{M.stopPropagation(),y(_)},children:A==="pending"?"...":A==="success"?"OK":"Retry"})}}],data:b,emptyMessage:"No jobs found"})}),c&&t(ie,{page:c.page,lastPage:c.lastPage,total:c.total,onPageChange:n})]})]})}const oa=Object.freeze(Object.defineProperty({__proto__:null,JobsSection:gs,default:gs},Symbol.toStringTag,{value:"Module"}));function K(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.__redacted===!0}function Ae(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!K(e)}function Ye(e,s=""){if(!Ae(e))return[{path:s,value:e}];const n=[];for(const r of Object.keys(e)){const l=s?`${s}.${r}`:r,a=e[r];Ae(a)?n.push(...Ye(a,l)):n.push({path:l,value:a})}return n}function Ze(e){return e==null?{text:"null",color:"var(--ss-dim)"}:typeof e=="boolean"?{text:String(e),color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"}:typeof e=="number"?{text:String(e),color:"var(--ss-amber-fg)"}:Array.isArray(e)?{text:`[${e.map(n=>n==null?"null":typeof n=="object"?JSON.stringify(n):String(n)).join(", ")}]`,color:"var(--ss-purple-fg)"}:typeof e=="object"?{text:JSON.stringify(e),color:"var(--ss-dim)"}:{text:String(e)}}function _s(e){if(e==null||typeof e!="object"||Array.isArray(e)||K(e))return 1;let s=0;for(const n of Object.keys(e))s+=_s(e[n]);return s}function ca(e){if(!Ae(e))return[];const s=[];for(const n of Object.keys(e))Ae(e[n])&&s.push(n);return s}function Pe(e,s,n){s&&navigator.clipboard.writeText(e).then(()=>{const r=s.textContent;s.textContent="✓",s.classList.add(`${n}-copy-row-ok`),setTimeout(()=>{s.textContent=r,s.classList.remove(`${n}-copy-row-ok`)},1200)}).catch(()=>{})}function Me({redacted:e,p:s}){const[n,r]=k(!1);return t("span",{className:`${s}-config-redacted`,style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[t("span",{children:n?e.value:e.display}),t("button",{type:"button",className:`${s}-btn`,title:n?"Hide":"Reveal",style:{padding:"0 4px",fontSize:"0.85em",lineHeight:1,minWidth:"auto"},onClick:l=>{l.stopPropagation(),r(a=>!a)},children:n?t("svg",{width:"14",height:"14",viewBox:q["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:q["eye-off"].elements.join("")}}):t("svg",{width:"14",height:"14",viewBox:q.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:q.eye.elements.join("")}})})]})}function da({env:e,search:s,p:n}){const r=B(new Map),l=s.toLowerCase(),a=Object.entries(e).filter(([i,o])=>{if(!l)return!0;const d=K(o)?o.display:o==null?"":String(o);return i.toLowerCase().includes(l)||d.toLowerCase().includes(l)});return t("div",{className:`${n}-config-table-wrap`,children:t("table",{className:`${n}-table ${n}-config-env-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Variable"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[a.map(([i,o])=>{const d=K(o),h=d?o.display:o==null?"null":String(o),u=`${i}=${h}`;return t("tr",{children:[t("td",{className:`${n}-env-key`,children:t("span",{className:`${n}-config-key`,children:i})}),t("td",{className:`${n}-env-val`,children:d?t(Me,{redacted:o,p:n}):t("span",{className:`${n}-config-val`,children:h})}),t("td",{children:!d&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:c=>{r.current.set(i,c)},onClick:c=>{c.stopPropagation(),Pe(u,r.current.get(i)??null,n)},children:"⎘"})})]},i)}),a.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching variables"})})]})]})})}function ha({source:e,search:s,p:n}){const r=B(new Map),l=s.toLowerCase(),a=Ye(e,""),i=a.filter(o=>{const d=K(o.value)?o.value.display:o.value===null||o.value===void 0?"":String(o.value);return o.path.toLowerCase().includes(l)||d.toLowerCase().includes(l)});return t("div",{className:`${n}-config-table-wrap`,children:[t("table",{className:`${n}-table`,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Path"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:[i.map(o=>{const d=K(o.value),h=d?null:Ze(o.value),u=d?o.value.display:h.text,c=`${o.path}: ${u}`;return t("tr",{children:[t("td",{children:t("span",{className:`${n}-config-key`,style:{whiteSpace:"nowrap"},children:o.path})}),t("td",{children:d?t(Me,{redacted:o.value,p:n}):t("span",{className:`${n}-config-val`,style:{wordBreak:"break-all",color:h.color},children:h.text})}),t("td",{children:!d&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:v=>{r.current.set(o.path,v)},onClick:v=>{v.stopPropagation(),Pe(c,r.current.get(o.path)??null,n)},children:"⎘"})})]},o.path)}),i.length===0&&t("tr",{children:t("td",{colSpan:3,style:{textAlign:"center",color:"var(--ss-dim)"},children:"No matching entries"})})]})]}),t("div",{style:{padding:"4px 16px",fontSize:"10px",color:"var(--ss-muted)"},children:[i.length," of ",a.length," entries"]})]})}function ua({obj:e,prefix:s,p:n}){const r=B(new Map),l=Ye(e,s);return t("table",{className:`${n}-table ${n}-config-inner-table`,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"35%"},children:"Key"}),t("th",{children:"Value"}),t("th",{style:{width:36}})]})}),t("tbody",{children:l.map(a=>{const i=a.path.indexOf(s+".")===0?a.path.slice(s.length+1):a.path,o=K(a.value),d=o?null:Ze(a.value),h=o?a.value.display:d.text,u=`${a.path}: ${h}`;return t("tr",{children:[t("td",{title:i,children:t("span",{className:`${n}-config-key`,children:i})}),t("td",{title:h,children:o?t(Me,{redacted:a.value,p:n}):t("span",{className:`${n}-config-val`,style:{color:d.color},children:d.text})}),t("td",{children:!o&&t("button",{type:"button",className:`${n}-copy-row-btn`,title:"Copy",ref:c=>{r.current.set(a.path,c)},onClick:c=>{c.stopPropagation(),Pe(u,r.current.get(a.path)??null,n)},children:"⎘"})})]},a.path)})})]})}function pa({value:e,p:s}){if(e==null)return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-dim)"},children:"null"});if(K(e))return t(Me,{redacted:e,p:s});if(typeof e=="boolean")return t("span",{className:`${s}-config-val`,style:{color:e?"var(--ss-green-fg)":"var(--ss-red-fg)"},children:String(e)});if(typeof e=="number")return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-amber-fg)"},children:String(e)});if(Array.isArray(e)){const n=e.map(r=>r==null?"null":typeof r=="object"?JSON.stringify(r):String(r));return t("span",{className:`${s}-config-val`,style:{color:"var(--ss-purple-fg)"},children:["[",n.join(", "),"]"]})}return typeof e=="object"?t("span",{className:`${s}-config-val`,style:{color:"var(--ss-dim)"},children:JSON.stringify(e)}):t("span",{className:`${s}-config-val`,children:String(e)})}function fa({obj:e,expandedPaths:s,onToggle:n,p:r}){if(e==null||typeof e!="object"||Array.isArray(e)||K(e))return null;const l=Object.keys(e),a=B(new Map);return t("div",{className:`${r}-config-sections`,children:l.map(i=>{const o=e[i],d=o!==null&&typeof o=="object"&&!Array.isArray(o)&&!K(o),h=s.has(i),u=K(o);return t("div",{className:`${r}-config-section`,children:[t("div",{className:`${r}-config-section-header${d?"":` ${r}-config-leaf`}`,onClick:d?()=>n(i):void 0,style:{cursor:d?"pointer":"default"},children:[d?t("span",{className:`${r}-config-toggle`,children:h?"▼":"▶"}):t("span",{className:`${r}-config-toggle`,style:{visibility:"hidden"},children:"•"}),t("span",{className:`${r}-config-key`,children:i}),d?t("span",{className:`${r}-config-count`,children:[_s(o)," entries"]}):t(F,{children:[t("span",{className:`${r}-config-val`,style:{marginLeft:"8px"},children:t(pa,{value:o,p:r})}),!u&&t("button",{type:"button",className:`${r}-copy-row-btn`,style:{marginLeft:"4px"},title:"Copy",ref:c=>{a.current.set(i,c)},onClick:c=>{c.stopPropagation();const v=Ze(o);Pe(`${i}: ${v.text}`,a.current.get(i)??null,r)},children:"⎘"})]})]}),d&&h&&t("div",{className:`${r}-config-section-body`,children:t(ua,{obj:o,prefix:i,p:r})})]},i)})})}function ma({data:e,isLoading:s,classPrefix:n}){const r=n,[l,a]=k(""),[i,o]=k(""),[d,h]=k("app"),[u,c]=k(new Set),[v,p]=k("Copy JSON");H(()=>{const m=setTimeout(()=>o(l),200);return()=>clearTimeout(m)},[l]);const f=e,g=T(m=>{c(x=>{const _=new Set(x);return _.has(m)?_.delete(m):_.add(m),_})},[]),b=T(()=>{if(!f)return;const m=d==="app"?f.app:f.env;if(!m)return;const x=ca(m);c(new Set(x))},[f,d]),w=T(()=>{c(new Set)},[]),y=T(async()=>{if(f)try{const m=d==="app"?f.app:f.env;await navigator.clipboard.writeText(JSON.stringify(m,null,2)),p("Copied!"),setTimeout(()=>p("Copy JSON"),1500)}catch{}},[f,d]);return t("div",{children:[t("div",{className:`${r}-config-toolbar`,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px"},children:[t("button",{type:"button",className:`${r}-config-tab${d==="app"?` ${r}-active`:""}`,onClick:()=>h("app"),children:"App Config"}),t("button",{type:"button",className:`${r}-config-tab${d==="env"?` ${r}-active`:""}`,onClick:()=>h("env"),children:"Env"}),t("div",{style:{position:"relative",flex:1},children:[t("input",{type:"text",className:`${r}-search`,placeholder:"Search keys and values...",value:l,onChange:m=>a(m.target.value),style:{width:"100%"}}),l&&t("button",{type:"button",onClick:()=>a(""),style:{position:"absolute",right:"6px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"14px",color:"var(--ss-dim)",padding:"0 2px",lineHeight:1},children:"×"})]}),d==="app"&&!i&&t(F,{children:[t("button",{type:"button",className:`${r}-btn`,onClick:b,children:"Expand All"}),t("button",{type:"button",className:`${r}-btn`,onClick:w,children:"Collapse All"})]}),t("button",{type:"button",className:`${r}-btn`,onClick:y,children:v})]}),s&&!e?t("div",{className:`${r}-empty`,children:"Loading config..."}):f?d==="env"?t(da,{env:f.env??{},search:i,p:r}):i?t(ha,{source:f.app??{},search:i,p:r}):t("div",{className:`${r}-config-table-wrap`,children:t(fa,{obj:f.app,expandedPaths:u,onToggle:g,p:r})}):t("div",{className:`${r}-empty`,children:"Config not available"})]})}function ys({options:e={}}){const{data:s,isLoading:n}=V("config",e);return t(ma,{data:s,isLoading:n,classPrefix:"ss-dash"})}const va=Object.freeze(Object.defineProperty({__proto__:null,ConfigSection:ys,default:ys},Symbol.toStringTag,{value:"Module"}));function ga(e={}){const{baseUrl:s="",debugEndpoint:n="/admin/api/debug",authToken:r,refreshInterval:l=3e3}=e,[a,i]=k(null),[o,d]=k(!0),[h,u]=k(null),c=B(null),v=Xt(s,r),p=T(async()=>{try{const g=await v().get(`${n}/diagnostics`);i(g),u(null),d(!1)}catch(f){if(f instanceof ze){u(f),d(!1),c.current&&(clearInterval(c.current),c.current=null);return}u(f instanceof Error?f:new Error(String(f))),d(!1)}},[n,v]);return H(()=>(d(!0),u(null),p(),c.current=setInterval(p,l),()=>{c.current&&(clearInterval(c.current),c.current=null)}),[p,l]),{data:a,isLoading:o,error:h}}const _a=["password","secret","token","key","credential","auth"];function bs(e){const s=e.toLowerCase();return _a.some(n=>s.includes(n))}function ws(e){if(e==null)return"-";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.join(", ")||"-";try{return JSON.stringify(e)}catch{return String(e)}}const ya={collectionInterval:"Stats Collection",dashboardBroadcast:"Dashboard Broadcast",debugBroadcast:"Debug Broadcast",persistFlush:"Persist Flush",retentionCleanup:"Retention Cleanup"};function ba(e){return ya[e]||e}const wa={prometheus:"Prometheus",pinoHook:"Pino Log Hook",edgePlugin:"Edge Plugin",cacheInspector:"Cache Inspector",queueInspector:"Queue Inspector"};function xa(e){return wa[e]||e}const Na=["healthy","active","connected","available","ready"],ka=["errored","unavailable"];function Sa(e){return Na.includes(e)?"ok":ka.includes(e)?"err":""}function he({status:e,prefix:s}){const n=Sa(e);let r=`${s}-dot`;return n==="ok"?r+=` ${s}-dot-ok`:n==="err"&&(r+=` ${s}-dot-err`),t("span",{className:r})}const xs=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:q.eye.viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:q.eye.elements.join("")}}),Ns=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:q["eye-off"].viewBox,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:q["eye-off"].elements.join("")}});function $a({value:e}){const[s,n]=k(!1);return t("span",{children:[s?e:"••••••••"," ",t("button",{type:"button",onClick:()=>n(r=>!r),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:s?t(Ns,{}):t(xs,{})})]})}function Ca({current:e,max:s,prefix:n}){const r=s>0?Math.min(100,Math.round(e/s*100)):0,l=r>=100;return t("div",{className:`${n}-bar`,children:[t("div",{className:`${n}-bar-track`,children:t("div",{className:`${n}-bar-fill${l?` ${n}-bar-fill-warn`:""}`,style:{width:`${r}%`}})}),t("span",{className:`${n}-bar-pct${l?` ${n}-bar-pct-warn`:""}`,children:[r,"%"]})]})}function Ea({config:e,prefix:s}){const n=Object.entries(e);return n.length===0?t("span",{className:`${s}-c-dim`,children:"-"}):t("span",{className:`${s}-c-muted`,children:n.map(([r,l],a)=>t("span",{children:[a>0&&", ",t("span",{className:`${s}-c-dim`,children:r}),"=",bs(r)&&typeof l=="string"?t($a,{value:l}):t("span",{children:ws(l)})]},r))})}function ue({label:e,value:s,prefix:n}){return t("div",{className:`${n}-info-card`,children:[t("span",{className:`${n}-info-card-label`,children:e}),t("span",{className:`${n}-info-card-value`,children:s})]})}function Ta({data:e,tableClassName:s,classPrefix:n}){const r=n||"ss-dash",[l,a]=k(new Set),i=T(u=>{a(c=>{const v=new Set(c);return v.has(u)?v.delete(u):v.add(u),v})},[]),o=T((u,c)=>{if(c==null)return t("span",{className:`${r}-c-dim`,children:"null"});if(typeof c=="boolean")return t("span",{className:c?`${r}-c-green`:`${r}-c-red`,children:String(c)});if(Array.isArray(c))return t("span",{children:c.join(", ")||"-"});const v=ws(c);if(bs(u)){const p=l.has(u);return t("span",{children:[p?v:"••••••••"," ",t("button",{type:"button",onClick:()=>i(u),style:{background:"none",border:"1px solid var(--ss-border)",borderRadius:3,padding:"0 4px",fontSize:"10px",color:"var(--ss-dim)",cursor:"pointer",verticalAlign:"middle"},children:p?t(Ns,{}):t(xs,{})})]})}return t("span",{children:v})},[l,i,r]),h=e.collectors?.some(u=>u.name==="db_pool"||u.name==="app")&&Array.isArray(e.lucidDebugConnections)&&e.lucidDebugConnections.length===0;return t("div",{children:[h&&t("div",{style:{background:"var(--ss-amber-bg)",color:"var(--ss-amber-fg)",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",marginBottom:"12px",lineHeight:1.5},children:[t("strong",{children:"Query capture disabled"})," — no Lucid connections have"," ",t("code",{style:{fontSize:"11px"},children:"debug: true"}),". Add it to your database connection in ",t("code",{style:{fontSize:"11px"},children:"config/database.ts"})," to see queries in the Queries panel."]}),t("h3",{className:`${r}-internals-title`,children:"Package Info"}),t("div",{className:`${r}-info-cards`,children:[t(ue,{label:"Version",value:e.package.version||"-",prefix:r}),t(ue,{label:"Node.js",value:e.package.nodeVersion||"-",prefix:r}),t(ue,{label:"AdonisJS",value:e.package.adonisVersion||"-",prefix:r}),t(ue,{label:"Uptime",value:er(e.package.uptime),prefix:r}),t(ue,{label:"Renderer",value:e.devToolbar?.renderer||"preact",prefix:r})]}),e.collectors.length>0&&t(F,{children:[t("h3",{className:`${r}-internals-title`,children:"Collectors"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Collector"}),t("th",{children:"Status"}),t("th",{children:"Last Error"}),t("th",{children:"Config"})]})}),t("tbody",{children:e.collectors.map(u=>t("tr",{children:[t("td",{children:[t("code",{children:u.name}),u.label&&u.label!==u.name&&t("span",{className:`${r}-c-dim`,children:[" ",u.label]})]}),t("td",{children:[t(he,{status:u.status,prefix:r}),u.status]}),t("td",{className:u.lastError?`${r}-c-red`:`${r}-c-dim`,children:u.lastError?t(F,{children:[u.lastError,u.lastErrorAt&&t("span",{className:`${r}-c-dim`,style:{fontSize:"10px"},children:Ke(u.lastErrorAt)})]}):"-"}),t("td",{children:t(Ea,{config:u.config,prefix:r})})]},u.name))})]})]}),t("h3",{className:`${r}-internals-title`,children:"Buffers"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Buffer"}),t("th",{children:"Usage"}),t("th",{children:"Fill %"})]})}),t("tbody",{children:Object.entries(e.buffers).map(([u,c])=>t("tr",{children:[t("td",{style:{textTransform:"capitalize"},children:u}),t("td",{children:[c.current.toLocaleString()," / ",c.max.toLocaleString()]}),t("td",{children:t(Ca,{current:c.current,max:c.max,prefix:r})})]},u))})]}),t("h3",{className:`${r}-internals-title`,children:"Timers"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Timer"}),t("th",{children:"Status"}),t("th",{children:"Interval"})]})}),t("tbody",{children:Object.entries(e.timers).map(([u,c])=>t("tr",{children:[t("td",{children:ba(u)}),t("td",{children:[t(he,{status:c.active?"active":"inactive",prefix:r}),t("span",{className:c.active?`${r}-c-green`:`${r}-c-dim`,children:c.active?"active":"inactive"})]}),t("td",{children:c.active?c.intervalMs?X(c.intervalMs):c.debounceMs?`${X(c.debounceMs)} (debounce)`:"-":t("span",{className:`${r}-c-dim`,children:"—"})})]},u))})]}),t("h3",{className:`${r}-internals-title`,children:"Integrations"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{children:"Integration"}),t("th",{children:"Status"}),t("th",{children:"Details"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Transmit (SSE)"}),t("td",{children:[t(he,{status:e.transmit.available?"connected":"inactive",prefix:r}),e.transmit.available?"connected":"unavailable"]}),t("td",{style:{fontSize:"11px"},children:e.transmit.channels.length>0?`Channels: ${e.transmit.channels.join(", ")}`:"-"})]}),Object.entries(e.integrations).map(([u,c])=>{const v=c.active??c.available??!1,p=c.active?"active":c.available?"available":"unavailable";let f=c.mode?`Mode: ${c.mode}`:"-";return u==="edgePlugin"&&c.active?f="@serverStats() tag registered":u==="cacheInspector"&&c.available?f="Redis dependency detected":u==="queueInspector"&&c.available&&(f="Queue dependency detected"),t("tr",{children:[t("td",{children:xa(u)}),t("td",{children:[t(he,{status:v?"active":"inactive",prefix:r}),p]}),t("td",{className:`${r}-c-dim`,style:{fontSize:"11px"},children:f})]},u)})]})]}),e.storage&&t(F,{children:[t("h3",{className:`${r}-internals-title`,children:"Storage (SQLite)"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Metric"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"Status"}),t("td",{children:[t(he,{status:e.storage.ready?"ready":"inactive",prefix:r}),e.storage.ready?"ready":"not ready"]})]}),t("tr",{children:[t("td",{children:"DB Path"}),t("td",{children:t("code",{children:e.storage.dbPath})})]}),t("tr",{children:[t("td",{children:"File Size"}),t("td",{children:[e.storage.fileSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"WAL Size"}),t("td",{children:[e.storage.walSizeMb.toFixed(1)," MB"]})]}),t("tr",{children:[t("td",{children:"Retention"}),t("td",{children:[e.storage.retentionDays," days"]})]}),t("tr",{children:[t("td",{children:"Last Cleanup"}),t("td",{children:e.storage.lastCleanupAt?Ke(e.storage.lastCleanupAt):"-"})]})]})]}),e.storage.tables.length>0&&t("table",{className:s,style:{marginTop:8},children:[t("thead",{children:t("tr",{children:[t("th",{children:"Table"}),t("th",{children:"Rows"})]})}),t("tbody",{children:e.storage.tables.map(u=>t("tr",{children:[t("td",{children:t("code",{children:u.name})}),t("td",{children:u.rowCount.toLocaleString()})]},u.name))})]})]}),t("h3",{className:`${r}-internals-title`,children:"Resolved Config"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:[t("tr",{children:[t("td",{children:"intervalMs"}),t("td",{children:e.config.intervalMs})]}),t("tr",{children:[t("td",{children:"transport"}),t("td",{children:e.config.transport})]}),t("tr",{children:[t("td",{children:"channelName"}),t("td",{children:e.config.channelName})]}),t("tr",{children:[t("td",{children:"endpoint"}),t("td",{children:e.config.endpoint===!1?"false":e.config.endpoint})]}),t("tr",{children:[t("td",{children:"skipInTest"}),t("td",{children:o("skipInTest",e.config.skipInTest)})]}),t("tr",{children:[t("td",{children:"onStats callback"}),t("td",{children:e.config.hasOnStatsCallback?"defined":"not defined"})]}),t("tr",{children:[t("td",{children:"shouldShow callback"}),t("td",{children:e.config.hasShouldShowCallback?"defined":"not defined"})]})]})]}),t("h4",{className:`${r}-internals-title`,children:"DevToolbar"}),t("table",{className:s,children:[t("thead",{children:t("tr",{children:[t("th",{style:{width:"200px"},children:"Setting"}),t("th",{children:"Value"})]})}),t("tbody",{children:Object.entries(e.devToolbar).map(([u,c])=>t("tr",{children:[t("td",{children:u==="customPaneCount"?"customPanes":u}),t("td",{children:u==="customPaneCount"?`${c} registered`:o(u,c)})]},u))})]})]})}function ks({options:e={},debugEndpoint:s="/admin/api/debug"}){const{data:n,isLoading:r,error:l}=ga({baseUrl:e.baseUrl,debugEndpoint:s,authToken:e.authToken,refreshInterval:It});return r&&!n?t("div",{className:"ss-dash-empty",children:"Loading diagnostics..."}):l?t("div",{className:"ss-dash-empty",children:["Error: ",l.message]}):n?t(Ta,{data:n,tableClassName:"ss-dash-table",classPrefix:"ss-dash"}):t("div",{className:"ss-dash-empty",children:"Diagnostics not available"})}const La=Object.freeze(Object.defineProperty({__proto__:null,InternalsSection:ks,default:ks},Symbol.toStringTag,{value:"Module"}))})();
|