nestlens 0.8.9 → 0.8.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/api/interceptors/api-response.interceptor.js +6 -1
  2. package/dist/core/collector.service.js +6 -2
  3. package/dist/core/request-context.d.ts +34 -0
  4. package/dist/core/request-context.js +23 -0
  5. package/dist/core/request-context.middleware.d.ts +16 -0
  6. package/dist/core/request-context.middleware.js +33 -0
  7. package/dist/dashboard/public/assets/{BatchesPage-B-FM-KDo.js → BatchesPage-BuX1D-Qw.js} +1 -1
  8. package/dist/dashboard/public/assets/{CachePage-DdiQfS9v.js → CachePage-c9NdxnLF.js} +1 -1
  9. package/dist/dashboard/public/assets/{ClickableBadge-Vyx_sMAl.js → ClickableBadge-DIMjoLzU.js} +1 -1
  10. package/dist/dashboard/public/assets/{CommandsPage-zJMqAMw2.js → CommandsPage-UA71c6cn.js} +1 -1
  11. package/dist/dashboard/public/assets/{DashboardPage-8LH8ftoZ.js → DashboardPage-Cg4B1v71.js} +1 -1
  12. package/dist/dashboard/public/assets/{DumpsPage-zoJtOb34.js → DumpsPage-DPjT0K-W.js} +1 -1
  13. package/dist/dashboard/public/assets/{EntryDetailPage-DFx3gg0C.js → EntryDetailPage-_HHpZVRb.js} +1 -1
  14. package/dist/dashboard/public/assets/{EntrySearchInput-BjzlyOoC.js → EntrySearchInput-Dyav5E5-.js} +1 -1
  15. package/dist/dashboard/public/assets/{EventsPage-CWYR4iMv.js → EventsPage-C3BjM-u_.js} +1 -1
  16. package/dist/dashboard/public/assets/{ExceptionsPage-BRBxnFaw.js → ExceptionsPage--aa1xm13.js} +1 -1
  17. package/dist/dashboard/public/assets/{GatesPage-Db4jOQJV.js → GatesPage-DCpvh5Eq.js} +1 -1
  18. package/dist/dashboard/public/assets/{GraphQLPage-B3rSuWjG.js → GraphQLPage-0dO4WQQI.js} +1 -1
  19. package/dist/dashboard/public/assets/{HttpClientPage-ax2dQyNU.js → HttpClientPage-Bn1Tb9mM.js} +1 -1
  20. package/dist/dashboard/public/assets/{JobsPage-DgrC3Sj1.js → JobsPage-aSdQC9Of.js} +1 -1
  21. package/dist/dashboard/public/assets/{LogsPage-BBlP-X7a.js → LogsPage-CRlOEyuz.js} +1 -1
  22. package/dist/dashboard/public/assets/{MailPage-CoNbEq1o.js → MailPage-Bmfqpr8z.js} +1 -1
  23. package/dist/dashboard/public/assets/{ModelsPage-DWb7rn2b.js → ModelsPage-CzX1Bkcw.js} +1 -1
  24. package/dist/dashboard/public/assets/{NotificationsPage-DCLX_IJt.js → NotificationsPage-CNQ7ZU3Z.js} +1 -1
  25. package/dist/dashboard/public/assets/{PageHeader-gzCjMnIq.js → PageHeader-Dy1i1YMN.js} +1 -1
  26. package/dist/dashboard/public/assets/{QueriesPage-3UzIdKwS.js → QueriesPage-BlzALGM-.js} +1 -1
  27. package/dist/dashboard/public/assets/{RedisPage-CkCLM4ax.js → RedisPage-fHFUgVjS.js} +1 -1
  28. package/dist/dashboard/public/assets/{RequestsPage-Dj4eX2lV.js → RequestsPage-DZLasLTv.js} +1 -1
  29. package/dist/dashboard/public/assets/{SchedulePage-egoitltq.js → SchedulePage-x5dG87Qk.js} +1 -1
  30. package/dist/dashboard/public/assets/{ViewsPage-HadbKX46.js → ViewsPage-DISrSULL.js} +1 -1
  31. package/dist/dashboard/public/assets/{calendar-BsVc-vvl.js → calendar-Camxqdlp.js} +1 -1
  32. package/dist/dashboard/public/assets/{circle-check-big-D8hxmLVs.js → circle-check-big-oB7KFF_S.js} +1 -1
  33. package/dist/dashboard/public/assets/{eye-DoP8A5L_.js → eye-CNwth9uN.js} +1 -1
  34. package/dist/dashboard/public/assets/{index-NYfiXmMn.js → index-fV4VT_EH.js} +2 -2
  35. package/dist/dashboard/public/assets/{search-C8zDS2B0.js → search-G_aOCia0.js} +1 -1
  36. package/dist/dashboard/public/assets/{types-DrGQDdvv.js → types-Sj3ahDpV.js} +1 -1
  37. package/dist/dashboard/public/assets/{zap-DXGDS502.js → zap-DcjSBmCK.js} +1 -1
  38. package/dist/dashboard/public/index.html +1 -1
  39. package/dist/nestlens.module.d.ts +10 -2
  40. package/dist/nestlens.module.js +11 -0
  41. package/dist/watchers/request.watcher.js +4 -1
  42. package/package.json +1 -1
@@ -91,7 +91,6 @@ let NestLensApiResponseInterceptor = class NestLensApiResponseInterceptor {
91
91
  // Handle structured controller responses
92
92
  if (this.isControllerResponse(response)) {
93
93
  const { data, meta, ...rest } = response;
94
- // Build the response with any additional properties (like 'related').
95
94
  // Deliberately not a nullish check: a controller answering `data: null`
96
95
  // — "no such entry" — has provided data, and must not be answered with
97
96
  // the surrounding object instead.
@@ -100,6 +99,12 @@ let NestLensApiResponseInterceptor = class NestLensApiResponseInterceptor {
100
99
  return {
101
100
  success: true,
102
101
  data: responseData,
102
+ // Anything the controller sent alongside `data` travels with it. The
103
+ // comment here always said "any additional properties (like
104
+ // 'related')", but they were destructured out and dropped: a request's
105
+ // detail page asked for the queries it ran, the controller looked them
106
+ // up, and the envelope threw them away before the dashboard saw them.
107
+ ...(dataProvided ? rest : {}),
103
108
  error: null,
104
109
  meta: {
105
110
  timestamp: new Date().toISOString(),
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.CollectorService = void 0;
17
17
  const common_1 = require("@nestjs/common");
18
18
  const rxjs_1 = require("rxjs");
19
+ const request_context_1 = require("./request-context");
19
20
  const storage_interface_1 = require("./storage/storage.interface");
20
21
  const tag_service_1 = require("./tag.service");
21
22
  const family_hash_service_1 = require("./family-hash.service");
@@ -127,7 +128,10 @@ let CollectorService = CollectorService_1 = class CollectorService {
127
128
  const entry = {
128
129
  type,
129
130
  payload,
130
- requestId,
131
+ // A watcher that knows the request says so; the rest are attributed from
132
+ // the ambient context, which is how a query recorded by TypeORM's logger
133
+ // ends up on the detail page of the request that ran it.
134
+ requestId: requestId ?? (0, request_context_1.currentRequestId)(),
131
135
  };
132
136
  // Apply filter
133
137
  const shouldCollect = await this.applyFilter(entry);
@@ -155,7 +159,7 @@ let CollectorService = CollectorService_1 = class CollectorService {
155
159
  const entry = {
156
160
  type,
157
161
  payload,
158
- requestId,
162
+ requestId: requestId ?? (0, request_context_1.currentRequestId)(),
159
163
  };
160
164
  // Apply filter
161
165
  const shouldCollect = await this.applyFilter(entry);
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The request an entry belongs to, carried across async boundaries.
3
+ *
4
+ * A watcher that sits on the HTTP request can read the request object; the ones
5
+ * that matter most cannot. The query watcher is handed a statement by TypeORM's
6
+ * logger or Prisma's middleware, the cache watcher by a wrapped method — none of
7
+ * them are given a request, and so none of their entries carried one. Of the
8
+ * twenty-one places that record an entry, two passed a request id, which is why
9
+ * a request's detail page could show the exceptions it raised and never the
10
+ * queries it ran, while the documentation offered "request correlation ID" and
11
+ * "group related entries by request".
12
+ *
13
+ * Threading an argument through twenty-one call sites would have fixed the ones
14
+ * that exist. This carries the id in the ambient async context instead, so an
15
+ * entry recorded anywhere inside a request belongs to it — including from a
16
+ * watcher written next year.
17
+ */
18
+ export interface RequestContext {
19
+ readonly requestId: string;
20
+ }
21
+ /**
22
+ * Runs `work` with a request context in scope.
23
+ *
24
+ * Installed as middleware rather than an interceptor on purpose: middleware
25
+ * calls into the rest of the request synchronously, so everything downstream —
26
+ * guards, interceptors, the handler, and whatever they await — runs inside the
27
+ * scope. An interceptor returns an Observable that Nest subscribes to after the
28
+ * interceptor's own frame has gone, taking the context with it.
29
+ */
30
+ export declare const runInRequestContext: <T>(requestId: string, work: () => T) => T;
31
+ /** The current request's id, or `undefined` outside a request. */
32
+ export declare const currentRequestId: () => string | undefined;
33
+ /** A fresh correlation id, in the one place that decides their shape. */
34
+ export declare const newRequestId: () => string;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newRequestId = exports.currentRequestId = exports.runInRequestContext = void 0;
4
+ const node_async_hooks_1 = require("node:async_hooks");
5
+ const node_crypto_1 = require("node:crypto");
6
+ const storage = new node_async_hooks_1.AsyncLocalStorage();
7
+ /**
8
+ * Runs `work` with a request context in scope.
9
+ *
10
+ * Installed as middleware rather than an interceptor on purpose: middleware
11
+ * calls into the rest of the request synchronously, so everything downstream —
12
+ * guards, interceptors, the handler, and whatever they await — runs inside the
13
+ * scope. An interceptor returns an Observable that Nest subscribes to after the
14
+ * interceptor's own frame has gone, taking the context with it.
15
+ */
16
+ const runInRequestContext = (requestId, work) => storage.run({ requestId }, work);
17
+ exports.runInRequestContext = runInRequestContext;
18
+ /** The current request's id, or `undefined` outside a request. */
19
+ const currentRequestId = () => storage.getStore()?.requestId;
20
+ exports.currentRequestId = currentRequestId;
21
+ /** A fresh correlation id, in the one place that decides their shape. */
22
+ const newRequestId = () => (0, node_crypto_1.randomUUID)();
23
+ exports.newRequestId = newRequestId;
@@ -0,0 +1,16 @@
1
+ import { NestMiddleware } from '@nestjs/common';
2
+ import { NestLensRequest } from '../types';
3
+ /**
4
+ * Opens a request context around everything the application does for a request.
5
+ *
6
+ * Runs before guards, interceptors and the handler, so an entry recorded by any
7
+ * watcher — a query, a cache read, an outgoing HTTP call — can be attributed to
8
+ * the request that caused it without being handed one.
9
+ *
10
+ * The id is also written onto the request object, which is where the request and
11
+ * exception watchers already look for it, so both halves agree on one id per
12
+ * request.
13
+ */
14
+ export declare class RequestContextMiddleware implements NestMiddleware {
15
+ use(request: NestLensRequest, _response: unknown, next: () => void): void;
16
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.RequestContextMiddleware = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const request_context_1 = require("./request-context");
12
+ /**
13
+ * Opens a request context around everything the application does for a request.
14
+ *
15
+ * Runs before guards, interceptors and the handler, so an entry recorded by any
16
+ * watcher — a query, a cache read, an outgoing HTTP call — can be attributed to
17
+ * the request that caused it without being handed one.
18
+ *
19
+ * The id is also written onto the request object, which is where the request and
20
+ * exception watchers already look for it, so both halves agree on one id per
21
+ * request.
22
+ */
23
+ let RequestContextMiddleware = class RequestContextMiddleware {
24
+ use(request, _response, next) {
25
+ const requestId = request.nestlensRequestId ?? (0, request_context_1.newRequestId)();
26
+ request.nestlensRequestId = requestId;
27
+ (0, request_context_1.runInRequestContext)(requestId, next);
28
+ }
29
+ };
30
+ exports.RequestContextMiddleware = RequestContextMiddleware;
31
+ exports.RequestContextMiddleware = RequestContextMiddleware = __decorate([
32
+ (0, common_1.Injectable)()
33
+ ], RequestContextMiddleware);
@@ -1 +1 @@
1
- import{j as a,L as d}from"./index-NYfiXmMn.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{u as M,C as c,f as T,p as A}from"./ClickableBadge-Vyx_sMAl.js";import{u as L,P as R,N as $,L as I}from"./PageHeader-gzCjMnIq.js";import{s as H,T as s,D as S,b as W}from"./types-DrGQDdvv.js";function J(){const h=D(),{addFilter:r,clearAll:p,serverFilters:u,headerFilters:x,hasFilters:m}=M("batches"),{entries:g,loading:y,refreshing:o,newEntriesCount:f,hasMore:j,loadMore:b,loadNew:k,autoRefreshEnabled:C,live:N,setAutoRefresh:w,meta:i,isHighlighted:E}=L({type:"batch",limit:50,filters:u}),n=g.filter(e=>H(e)),v=F.useMemo(()=>[{key:"name",header:"Name",minWidth:"200px",render:e=>a.jsx(s,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.name})},{key:"operation",header:"Operation",width:"150px",render:e=>e.payload.operation?a.jsx(c,{onClick:t=>{t.stopPropagation(),r("operations",e.payload.operation)},children:e.payload.operation}):a.jsx(s,{secondary:!0,children:"-"})},{key:"progress",header:"Progress",width:"150px",render:e=>{const{processedItems:t,totalItems:l}=e.payload,B=l>0?Math.round(t/l*100):0;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(s,{children:`${t}/${l}`}),a.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",B,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>a.jsx(c,{onClick:t=>{t.stopPropagation(),r("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?a.jsx(S,{ms:e.payload.duration}):a.jsx(s,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(s,{secondary:!0,className:"text-xs",children:T(A(e.createdAt),{addSuffix:!0})})}],[r]);if(y&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const P=m?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Batches",icon:d,iconColor:"text-blue-600 dark:text-blue-400",count:n.length,totalCount:i==null?void 0:i.total,refreshing:o,autoRefreshEnabled:C,live:N,onAutoRefreshToggle:w,filters:x,onClearAllFilters:p}),a.jsxs("div",{className:`${P} space-y-4 transition-all duration-200`,children:[a.jsx($,{count:f,onClick:k,loading:o}),a.jsx(W,{columns:v,data:n,keyExtractor:e=>e.id,onRowClick:e=>h(`/batches/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(I,{hasMore:j,onClick:b,loading:o})]})]})}export{J as default};
1
+ import{j as a,L as d}from"./index-fV4VT_EH.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{u as M,C as c,f as T,p as A}from"./ClickableBadge-DIMjoLzU.js";import{u as L,P as R,N as $,L as I}from"./PageHeader-Dy1i1YMN.js";import{s as H,T as s,D as S,b as W}from"./types-Sj3ahDpV.js";function J(){const h=D(),{addFilter:r,clearAll:p,serverFilters:u,headerFilters:x,hasFilters:m}=M("batches"),{entries:g,loading:y,refreshing:o,newEntriesCount:f,hasMore:j,loadMore:b,loadNew:k,autoRefreshEnabled:C,live:N,setAutoRefresh:w,meta:i,isHighlighted:E}=L({type:"batch",limit:50,filters:u}),n=g.filter(e=>H(e)),v=F.useMemo(()=>[{key:"name",header:"Name",minWidth:"200px",render:e=>a.jsx(s,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.name})},{key:"operation",header:"Operation",width:"150px",render:e=>e.payload.operation?a.jsx(c,{onClick:t=>{t.stopPropagation(),r("operations",e.payload.operation)},children:e.payload.operation}):a.jsx(s,{secondary:!0,children:"-"})},{key:"progress",header:"Progress",width:"150px",render:e=>{const{processedItems:t,totalItems:l}=e.payload,B=l>0?Math.round(t/l*100):0;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(s,{children:`${t}/${l}`}),a.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",B,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>a.jsx(c,{onClick:t=>{t.stopPropagation(),r("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?a.jsx(S,{ms:e.payload.duration}):a.jsx(s,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(s,{secondary:!0,className:"text-xs",children:T(A(e.createdAt),{addSuffix:!0})})}],[r]);if(y&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const P=m?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Batches",icon:d,iconColor:"text-blue-600 dark:text-blue-400",count:n.length,totalCount:i==null?void 0:i.total,refreshing:o,autoRefreshEnabled:C,live:N,onAutoRefreshToggle:w,filters:x,onClearAllFilters:p}),a.jsxs("div",{className:`${P} space-y-4 transition-all duration-200`,children:[a.jsx($,{count:f,onClick:k,loading:o}),a.jsx(W,{columns:v,data:n,keyExtractor:e=>e.id,onRowClick:e=>h(`/batches/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(I,{hasMore:j,onClick:b,loading:o})]})]})}export{J as default};
@@ -1 +1 @@
1
- import{j as a,H as o}from"./index-NYfiXmMn.js";import{e as T,b as E}from"./vendor-DBTT3jXp.js";import{u as v,C as l,f as D,p as M}from"./ClickableBadge-Vyx_sMAl.js";import{u as R,P as A,N as F,L as H}from"./PageHeader-gzCjMnIq.js";import{h as P,T as i,D as B,b as I}from"./types-DrGQDdvv.js";function O(){const n=T(),{clearAll:d,serverFilters:c,headerFilters:h,hasFilters:p}=v("cache"),{entries:u,loading:x,refreshing:t,newEntriesCount:y,hasMore:m,loadMore:g,loadNew:f,autoRefreshEnabled:j,live:k,setAutoRefresh:C,meta:r,isHighlighted:w}=R({type:"cache",limit:50,filters:c}),s=u.filter(e=>P(e)),N=E.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(l,{listType:"cache",filterType:"operations",children:e.payload.operation})},{key:"key",header:"Key",minWidth:"200px",render:e=>a.jsx(i,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.key.length>50?e.payload.key.substring(0,50)+"...":e.payload.key})},{key:"result",header:"Result",width:"80px",align:"center",render:e=>e.payload.operation==="get"?a.jsx(l,{listType:"cache",filterType:"tags",filterValue:e.payload.hit?"hit":"miss",children:e.payload.hit?"HIT":"MISS"}):a.jsx(i,{secondary:!0,children:"—"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(B,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:D(M(e.createdAt),{addSuffix:!0})})}],[]);if(x&&s.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const b=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(A,{title:"Cache",icon:o,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,refreshing:t,autoRefreshEnabled:j,live:k,onAutoRefreshToggle:C,filters:h,onClearAllFilters:d}),a.jsxs("div",{className:`${b} space-y-4 transition-all duration-200`,children:[a.jsx(F,{count:y,onClick:f,loading:t}),a.jsx(I,{columns:N,data:s,keyExtractor:e=>e.id,onRowClick:e=>n(`/cache/${e.id}`),rowClassName:e=>w(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",emptyIcon:a.jsx(o,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(H,{hasMore:m,onClick:g,loading:t})]})]})}export{O as default};
1
+ import{j as a,H as o}from"./index-fV4VT_EH.js";import{e as T,b as E}from"./vendor-DBTT3jXp.js";import{u as v,C as l,f as D,p as M}from"./ClickableBadge-DIMjoLzU.js";import{u as R,P as A,N as F,L as H}from"./PageHeader-Dy1i1YMN.js";import{h as P,T as i,D as B,b as I}from"./types-Sj3ahDpV.js";function O(){const n=T(),{clearAll:d,serverFilters:c,headerFilters:h,hasFilters:p}=v("cache"),{entries:u,loading:x,refreshing:t,newEntriesCount:y,hasMore:m,loadMore:g,loadNew:f,autoRefreshEnabled:j,live:k,setAutoRefresh:C,meta:r,isHighlighted:w}=R({type:"cache",limit:50,filters:c}),s=u.filter(e=>P(e)),N=E.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(l,{listType:"cache",filterType:"operations",children:e.payload.operation})},{key:"key",header:"Key",minWidth:"200px",render:e=>a.jsx(i,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.key.length>50?e.payload.key.substring(0,50)+"...":e.payload.key})},{key:"result",header:"Result",width:"80px",align:"center",render:e=>e.payload.operation==="get"?a.jsx(l,{listType:"cache",filterType:"tags",filterValue:e.payload.hit?"hit":"miss",children:e.payload.hit?"HIT":"MISS"}):a.jsx(i,{secondary:!0,children:"—"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(B,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:D(M(e.createdAt),{addSuffix:!0})})}],[]);if(x&&s.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const b=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(A,{title:"Cache",icon:o,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,refreshing:t,autoRefreshEnabled:j,live:k,onAutoRefreshToggle:C,filters:h,onClearAllFilters:d}),a.jsxs("div",{className:`${b} space-y-4 transition-all duration-200`,children:[a.jsx(F,{count:y,onClick:f,loading:t}),a.jsx(I,{columns:N,data:s,keyExtractor:e=>e.id,onRowClick:e=>n(`/cache/${e.id}`),rowClassName:e=>w(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",emptyIcon:a.jsx(o,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(H,{hasMore:m,onClick:g,loading:t})]})]})}export{O as default};
@@ -1 +1 @@
1
- import{j as T}from"./index-NYfiXmMn.js";import{f as H,b as p,e as j,u as q}from"./vendor-DBTT3jXp.js";const Ye=6048e5,Ve=864e5,S=43200,L=1440,K=Symbol.for("constructDateFrom");function C(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&K in t?t[K](e):t instanceof Date?new t.constructor(e):new Date(e)}function k(t,e){return C(e||t,t)}let G={};function X(){return G}function I(t){const e=k(t),a=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return a.setUTCFullYear(e.getFullYear()),+t-+a}function O(t,...e){const a=C.bind(null,t||e.find(r=>typeof r=="object"));return e.map(a)}function P(t,e){const a=+k(t)-+k(e);return a<0?-1:a>0?1:a}function Y(t){return C(t,Date.now())}function V(t,e,a){const[r,n]=O(a==null?void 0:a.in,t,e),l=r.getFullYear()-n.getFullYear(),i=r.getMonth()-n.getMonth();return l*12+i}function B(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Q(t,e){return+k(t)-+k(e)}function z(t,e){const a=k(t,e==null?void 0:e.in);return a.setHours(23,59,59,999),a}function _(t,e){const a=k(t,e==null?void 0:e.in),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}function $(t,e){const a=k(t,e==null?void 0:e.in);return+z(a,e)==+_(a,e)}function J(t,e,a){const[r,n,l]=O(a==null?void 0:a.in,t,t,e),i=P(n,l),s=Math.abs(V(n,l));if(s<1)return 0;n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let b=P(n,l)===-i;$(r)&&s===1&&P(r,l)===1&&(b=!1);const f=i*(s-+b);return f===0?0:f}function Z(t,e,a){const r=Q(t,e)/1e3;return B(a==null?void 0:a.roundingMethod)(r)}const ee={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},te=(t,e,a)=>{let r;const n=ee[t];return typeof n=="string"?r=n:e===1?r=n.one:r=n.other.replace("{{count}}",e.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+r:r+" ago":r};function M(t){return(e={})=>{const a=e.width?String(e.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}const ae={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},re={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ne={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},se={date:M({formats:ae,defaultWidth:"full"}),time:M({formats:re,defaultWidth:"full"}),dateTime:M({formats:ne,defaultWidth:"full"})},ie={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oe=(t,e,a,r)=>ie[t];function v(t){return(e,a)=>{const r=a!=null&&a.context?String(a.context):"standalone";let n;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,s=a!=null&&a.width?String(a.width):i;n=t.formattingValues[s]||t.formattingValues[i]}else{const i=t.defaultWidth,s=a!=null&&a.width?String(a.width):t.defaultWidth;n=t.values[s]||t.values[i]}const l=t.argumentCallback?t.argumentCallback(e):e;return n[l]}}const le={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ue={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},de={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ce={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},me={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ge=(t,e)=>{const a=Number(t),r=a%100;if(r>20||r<10)switch(r%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},he={ordinalNumber:ge,era:v({values:le,defaultWidth:"wide"}),quarter:v({values:ue,defaultWidth:"wide",argumentCallback:t=>t-1}),month:v({values:de,defaultWidth:"wide"}),day:v({values:ce,defaultWidth:"wide"}),dayPeriod:v({values:me,defaultWidth:"wide",formattingValues:fe,defaultFormattingWidth:"wide"})};function E(t){return(e,a={})=>{const r=a.width,n=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],l=e.match(n);if(!l)return null;const i=l[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],b=Array.isArray(s)?be(s,h=>h.test(i)):ye(s,h=>h.test(i));let f;f=t.valueCallback?t.valueCallback(b):b,f=a.valueCallback?a.valueCallback(f):f;const g=e.slice(i.length);return{value:f,rest:g}}}function ye(t,e){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&e(t[a]))return a}function be(t,e){for(let a=0;a<t.length;a++)if(e(t[a]))return a}function pe(t){return(e,a={})=>{const r=e.match(t.matchPattern);if(!r)return null;const n=r[0],l=e.match(t.parsePattern);if(!l)return null;let i=t.valueCallback?t.valueCallback(l[0]):l[0];i=a.valueCallback?a.valueCallback(i):i;const s=e.slice(n.length);return{value:i,rest:s}}}const ke=/^(\d+)(th|st|nd|rd)?/i,xe=/\d+/i,Ne={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ve={any:[/^b/i,/^(a|c)/i]},Ee={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},we={any:[/1/i,/2/i,/3/i,/4/i]},Se={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Te={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Pe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Me={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},De={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ce={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Oe={ordinalNumber:pe({matchPattern:ke,parsePattern:xe,valueCallback:t=>parseInt(t,10)}),era:E({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:ve,defaultParseWidth:"any"}),quarter:E({matchPatterns:Ee,defaultMatchWidth:"wide",parsePatterns:we,defaultParseWidth:"any",valueCallback:t=>t+1}),month:E({matchPatterns:Se,defaultMatchWidth:"wide",parsePatterns:Te,defaultParseWidth:"any"}),day:E({matchPatterns:Pe,defaultMatchWidth:"wide",parsePatterns:Me,defaultParseWidth:"any"}),dayPeriod:E({matchPatterns:De,defaultMatchWidth:"any",parsePatterns:Ce,defaultParseWidth:"any"})},Re={code:"en-US",formatDistance:te,formatLong:se,formatRelative:oe,localize:he,match:Oe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ae(t,e,a){const r=X(),n=(a==null?void 0:a.locale)??r.locale??Re,l=2520,i=P(t,e);if(isNaN(i))throw new RangeError("Invalid time value");const s=Object.assign({},a,{addSuffix:a==null?void 0:a.addSuffix,comparison:i}),[b,f]=O(a==null?void 0:a.in,...i>0?[e,t]:[t,e]),g=Z(f,b),h=(I(f)-I(b))/1e3,m=Math.round((g-h)/60);let u;if(m<2)return a!=null&&a.includeSeconds?g<5?n.formatDistance("lessThanXSeconds",5,s):g<10?n.formatDistance("lessThanXSeconds",10,s):g<20?n.formatDistance("lessThanXSeconds",20,s):g<40?n.formatDistance("halfAMinute",0,s):g<60?n.formatDistance("lessThanXMinutes",1,s):n.formatDistance("xMinutes",1,s):m===0?n.formatDistance("lessThanXMinutes",1,s):n.formatDistance("xMinutes",m,s);if(m<45)return n.formatDistance("xMinutes",m,s);if(m<90)return n.formatDistance("aboutXHours",1,s);if(m<L){const o=Math.round(m/60);return n.formatDistance("aboutXHours",o,s)}else{if(m<l)return n.formatDistance("xDays",1,s);if(m<S){const o=Math.round(m/L);return n.formatDistance("xDays",o,s)}else if(m<S*2)return u=Math.round(m/S),n.formatDistance("aboutXMonths",u,s)}if(u=J(f,b),u<12){const o=Math.round(m/S);return n.formatDistance("xMonths",o,s)}else{const o=u%12,d=Math.trunc(u/12);return o<3?n.formatDistance("aboutXYears",d,s):o<9?n.formatDistance("overXYears",d,s):n.formatDistance("almostXYears",d+1,s)}}function Be(t,e){return Ae(t,Y(t),e)}function Qe(t){if(t.includes("T")&&(t.includes("Z")||t.includes("+")))return new Date(t);const e=t.replace(" ","T")+"Z";return new Date(e)}const D={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},paths:{urlKey:"paths",displayName:"Path",values:[]},controllers:{urlKey:"controllers",displayName:"Controller",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}},query:{displayName:"Query",pluralName:"Queries",route:"queries",icon:"Database",filters:{types:{urlKey:"queryTypes",displayName:"Type",values:["SELECT","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE"]},sources:{urlKey:"sources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","knex","mikro-orm","drizzle"]}}},exception:{displayName:"Exception",pluralName:"Exceptions",route:"exceptions",icon:"AlertTriangle",filters:{names:{urlKey:"names",displayName:"Name",values:[]},methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},paths:{urlKey:"paths",displayName:"Path",values:[]}}},log:{displayName:"Log",pluralName:"Logs",route:"logs",icon:"FileText",filters:{levels:{urlKey:"levels",displayName:"Level",values:["log","error","warn","debug","verbose","fatal","info"]},contexts:{urlKey:"contexts",displayName:"Context",values:[]}}},event:{displayName:"Event",pluralName:"Events",route:"events",icon:"Zap",filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",filters:{names:{urlKey:"jobNames",displayName:"Job",values:[]},statuses:{urlKey:"jobStatuses",displayName:"Status",values:["waiting","active","completed","failed","delayed","paused","stuck"]},queues:{urlKey:"queues",displayName:"Queue",values:[]}}},schedule:{displayName:"Schedule",pluralName:"Schedule",route:"schedule",icon:"Clock",filters:{names:{urlKey:"scheduleNames",displayName:"Task",values:[]},statuses:{urlKey:"scheduleStatuses",displayName:"Status",values:["started","completed","failed","skipped","running"]}}},cache:{displayName:"Cache",pluralName:"Cache",route:"cache",icon:"HardDrive",filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",filters:{statuses:{urlKey:"mailStatuses",displayName:"Status",values:["sent","failed","pending","queued","delivered","bounced","error"]}}},"http-client":{displayName:"HTTP Client",pluralName:"HTTP Client",route:"http-client",icon:"Globe",filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]}}},redis:{displayName:"Redis",pluralName:"Redis",route:"redis",icon:"Database",filters:{commands:{urlKey:"redisCommands",displayName:"Command",values:["GET","SET","DEL","HGET","HSET","HDEL","HGETALL","LPUSH","RPUSH","LPOP","RPOP","LRANGE","SADD","SREM","SMEMBERS","ZADD","ZRANGE","ZREM","EXPIRE","TTL","KEYS","SCAN","PING","INFO","INCR","DECR","MGET","MSET","PUBLISH","SUBSCRIBE"]},statuses:{urlKey:"redisStatuses",displayName:"Status",values:["success","failed","error","timeout"]}}},model:{displayName:"Model",pluralName:"Models",route:"models",icon:"Box",filters:{actions:{urlKey:"modelActions",displayName:"Action",values:["find","findOne","findMany","create","update","delete","save","remove","count","aggregate","upsert","createMany","updateMany","deleteMany"]},entities:{urlKey:"entities",displayName:"Entity",values:[]},sources:{urlKey:"modelSources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","mikro-orm","drizzle"]}}},notification:{displayName:"Notification",pluralName:"Notifications",route:"notifications",icon:"Bell",filters:{types:{urlKey:"notificationTypes",displayName:"Type",values:["email","sms","push","socket","webhook","slack","telegram","discord"]},statuses:{urlKey:"notificationStatuses",displayName:"Status",values:["sent","failed","pending","delivered","read","error","queued"]}}},view:{displayName:"View",pluralName:"Views",route:"views",icon:"Layout",filters:{formats:{urlKey:"viewFormats",displayName:"Format",values:["html","json","xml","pdf","csv","text","markdown"]},statuses:{urlKey:"viewStatuses",displayName:"Status",values:["rendered","error","failed","cached","success"]}}},command:{displayName:"Command",pluralName:"Commands",route:"commands",icon:"Terminal",filters:{statuses:{urlKey:"commandStatuses",displayName:"Status",values:["executing","completed","failed","cancelled","timeout","running"]},names:{urlKey:"commandNames",displayName:"Command",values:[]}}},gate:{displayName:"Gate",pluralName:"Gates",route:"gates",icon:"Shield",filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",filters:{operations:{urlKey:"batchOperations",displayName:"Operation",values:["insert","update","delete","upsert","sync"]},statuses:{urlKey:"batchStatuses",displayName:"Status",values:["pending","processing","completed","failed","partial","cancelled"]}}},dump:{displayName:"Dump",pluralName:"Dumps",route:"dumps",icon:"HardDrive",filters:{operations:{urlKey:"dumpOperations",displayName:"Operation",values:["export","import","backup","restore","migrate","sync"]},formats:{urlKey:"dumpFormats",displayName:"Format",values:["json","csv","xml","sql","yaml","binary","xlsx"]},statuses:{urlKey:"dumpStatuses",displayName:"Status",values:["pending","completed","failed","error","success","cancelled","running"]}}},graphql:{displayName:"GraphQL",pluralName:"GraphQL",route:"graphql",icon:"Hexagon",filters:{operationTypes:{urlKey:"operationTypes",displayName:"Type",values:["query","mutation","subscription"]},operationNames:{urlKey:"operationNames",displayName:"Operation",values:[]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}}},Le={requests:"request",queries:"query",exceptions:"exception",logs:"log",events:"event",jobs:"job",schedule:"schedule",cache:"cache",mail:"mail","http-client":"http-client",redis:"redis",models:"model",notifications:"notification",views:"view",commands:"command",gates:"gate",batches:"batch",dumps:"dump",graphql:"graphql"};function Ke(t){if(t in D)return D[t];const e=Le[t];if(e)return D[e]}const W=Ke;function ze(t){const[e,a]=H(),r=W(t),n=p.useCallback(u=>{if(u==="tags")return"tags";if(!r)return u;const o=r.filters[u];return(o==null?void 0:o.urlKey)||u},[r]),l=p.useMemo(()=>{const u={};if(!r)return u;const o=Object.values(r.filters).map(d=>d.urlKey);o.push("tags","search");for(const d of o){const c=e.get(d);c&&(u[d]=c.split(",").filter(Boolean))}return u},[e,r]),i=p.useCallback((u,o)=>{!r&&u!=="tags"&&console.warn("[useEntryFilters] No config found for entry type, using category as urlKey");const d=n(u),c=l[d]||[];if(!c.includes(o)){const y=new URLSearchParams(e);y.set(d,[...c,o].join(",")),a(y,{replace:!0})}},[r,n,l,e,a]),s=p.useCallback((u,o)=>{const c=(l[u]||[]).filter(x=>x!==o),y=new URLSearchParams(e);c.length>0?y.set(u,c.join(",")):y.delete(u),a(y,{replace:!0})},[l,e,a]),b=p.useCallback(()=>{a({},{replace:!0})},[a]),f=p.useMemo(()=>l,[l]),g=p.useMemo(()=>{if(!r)return[];const u=[];for(const[o,d]of Object.entries(l)){if(d.length===0)continue;let c=o,y=o==="tags"?"Tag":o;for(const[x,N]of Object.entries(r.filters))if(N.urlKey===o){c=x,y=N.displayName;break}u.push({category:c,urlKey:o,displayName:y,values:d})}return u},[l,r]),h=p.useMemo(()=>{const u=[];for(const o of g)for(const d of o.values)u.push({category:o.displayName,value:d.toUpperCase(),onRemove:()=>s(o.urlKey,d)});return u},[g,s]),m=g.length>0;return{addFilter:i,removeFilter:s,clearAll:b,serverFilters:f,activeFilters:g,headerFilters:h,hasFilters:m,getUrlKey:n}}function Ie(t,e){if(e==="tags")return"tags";const a=W(t);if(!a)return e;const r=a.filters[e];return(r==null?void 0:r.urlKey)||e}const F=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"],U=["bg-rose-100 text-rose-800 dark:bg-rose-900 dark:text-rose-400","bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-400","bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-400","bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-400","bg-sky-100 text-sky-800 dark:bg-sky-900 dark:text-sky-400","bg-violet-100 text-violet-800 dark:bg-violet-900 dark:text-violet-400","bg-fuchsia-100 text-fuchsia-800 dark:bg-fuchsia-900 dark:text-fuchsia-400","bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-400"];function We(t){let e=0;for(let a=0;a<t.length;a++)e=(e<<5)-e+t.charCodeAt(a),e=e&e;return Math.abs(e)%U.length}const Fe=["localhost"],Ue=(t,e)=>{if(e&&e!=="tag")return e;if(/^user:/i.test(t))return"tags";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(t))return"ips";const a=t.toUpperCase();if(F.includes(a))return"methods";const r=parseInt(t,10);return!isNaN(r)&&r>=100&&r<600?"statuses":/^[a-fA-F0-9:]+$/.test(t)&&t.includes(":")&&!t.includes(".")?"ips":t.includes("#")||t.includes("::")||/Controller\./i.test(t)?"controllers":Fe.includes(t.toLowerCase())||(t.includes(".")||t.includes(":"))&&!t.startsWith("/")&&!/^\d+$/.test(t)?"hostnames":"tags"};function He(t){const e=t.toUpperCase();if(t.startsWith("/"))return"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-400";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(t)||/^[a-fA-F0-9:]+$/.test(t)&&t.includes(":")&&!t.includes("."))return"bg-indigo-100 text-indigo-800 dark:bg-indigo-900/30 dark:text-indigo-400";if(t.includes("#")||t.includes("::")||/Controller\./i.test(t))return"bg-teal-100 text-teal-800 dark:bg-teal-900/30 dark:text-teal-400";if(e.startsWith("USER:"))return"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400";const a=t.toLowerCase(),r=/:\d+$/.test(t),n=/\.(com|org|net|io|dev|app|co|local|internal)$/i.test(t),l=/^[A-Z0-9_.]+$/.test(t)&&t.includes(".");if(a==="localhost"||r&&!t.startsWith("/")||n&&!l)return"bg-slate-100 text-slate-800 dark:bg-slate-700 dark:text-slate-300";if(e==="GET")return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";if(e==="POST")return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";if(e==="PUT")return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";if(e==="PATCH")return"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200";if(e==="DELETE")return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";if(["HEAD","OPTIONS"].includes(e))return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300";if(e==="GRAPHQL")return"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200";const i=parseInt(e,10);if(!isNaN(i)&&i>=100&&i<600)return i>=500?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400":i>=400?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":i>=300?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400";if(e==="SUCCESS"||e==="2XX"||e==="HIT")return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400";if(e==="REDIRECT"||e==="3XX")return"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400";if(e==="WARNING"||e==="WARN"||e==="4XX"||e==="CLIENT-ERROR")return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400";if(e==="ERROR"||e==="5XX"||e==="HTTP-ERROR"||e==="VALIDATION-ERROR"||e==="FAILED")return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400";if(e==="SLOW"||e==="SLOW QUERY")return"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400";if(e==="N+1"||e==="N1")return"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300";if(["SELECT","INSERT","UPDATE"].includes(e))return"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-400";if(e==="DEBUG")return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";if(e==="LOG"||e==="INFO")return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";if(e==="VERBOSE")return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300";if(e==="QUERY"||e==="MUTATION"||e==="SUBSCRIPTION"){if(e==="QUERY")return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";if(e==="MUTATION")return"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200";if(e==="SUBSCRIPTION")return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}return e==="REQUEST"?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":e==="EXCEPTION"?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":e==="LOG"||e==="EVENT"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":e==="JOB"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":e==="CACHE"?"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200":e==="MAIL"?"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200":e==="SCHEDULE"?"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300":e==="HTTP-CLIENT"?"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200":e==="RESOLVED"||e==="COMPLETED"||e==="SENT"||e==="ACTIVE"?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":e==="WAITING"||e==="DELAYED"||e==="PENDING"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":e==="MISS"?"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300":e==="GET"&&!F.includes(e)?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":e==="SET"?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":e==="DEL"||e==="DELETE"?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400":e==="CLEAR"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":e==="STARTED"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":e==="TYPEORM"?"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400":e==="PRISMA"?"bg-indigo-100 text-indigo-800 dark:bg-indigo-900/30 dark:text-indigo-400":e==="MONGOOSE"?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":e==="SEQUELIZE"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":e==="KNEX"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":e==="MIKRO-ORM"?"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400":e==="NORMAL"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":U[We(e)]}function je({children:t,listType:e,filterType:a="tag",filterValue:r,onClick:n,clickable:l=!0,className:i="",ariaLabel:s}){const b=j(),f=q(),g=c=>{if(c.preventDefault(),c.stopPropagation(),n){n(c);return}if(e&&l){const y=r||String(t),x=a&&a!=="tag"?Ie(e,a):Ue(y,a),N=f.pathname,w=N===`/${e}`||N.startsWith(`/${e}/`)?new URLSearchParams(f.search):new URLSearchParams,R=w.get(x);if(R){const A=R.split(",");A.includes(y)||w.set(x,[...A,y].join(","))}else w.set(x,y);b(`/${e}?${w.toString()}`)}},h=l&&(!!n||!!e),m=He(String(t)),u=h?"cursor-pointer hover:scale-105 transition-transform":"",o=String(t).toUpperCase(),d=s||(h?`Click to filter by ${o}`:void 0);return T.jsx("span",{onClick:h?g:void 0,role:h?"button":void 0,"aria-label":d,tabIndex:h?0:void 0,onKeyDown:h?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),g(c))}:void 0,title:o,className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap shadow ${m} ${u} ${h?"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1":""} ${i}`,children:o})}function _e({items:t,listType:e,filterType:a="tag",maxItems:r=99,clickable:n=!0}){if(!t||t.length===0)return null;const l=t.slice(0,r),i=t.length-r;return T.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[l.map(s=>T.jsx(je,{listType:e,filterType:a,clickable:n,children:s},s)),i>0&&T.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",i]})]})}export{_e as B,je as C,X as a,I as b,C as c,Ye as d,Re as e,Be as f,He as g,Ve as m,O as n,Qe as p,k as t,ze as u};
1
+ import{j as T}from"./index-fV4VT_EH.js";import{f as H,b as p,e as j,u as q}from"./vendor-DBTT3jXp.js";const Ye=6048e5,Ve=864e5,S=43200,L=1440,K=Symbol.for("constructDateFrom");function C(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&K in t?t[K](e):t instanceof Date?new t.constructor(e):new Date(e)}function k(t,e){return C(e||t,t)}let G={};function X(){return G}function I(t){const e=k(t),a=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return a.setUTCFullYear(e.getFullYear()),+t-+a}function O(t,...e){const a=C.bind(null,t||e.find(r=>typeof r=="object"));return e.map(a)}function P(t,e){const a=+k(t)-+k(e);return a<0?-1:a>0?1:a}function Y(t){return C(t,Date.now())}function V(t,e,a){const[r,n]=O(a==null?void 0:a.in,t,e),l=r.getFullYear()-n.getFullYear(),i=r.getMonth()-n.getMonth();return l*12+i}function B(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Q(t,e){return+k(t)-+k(e)}function z(t,e){const a=k(t,e==null?void 0:e.in);return a.setHours(23,59,59,999),a}function _(t,e){const a=k(t,e==null?void 0:e.in),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}function $(t,e){const a=k(t,e==null?void 0:e.in);return+z(a,e)==+_(a,e)}function J(t,e,a){const[r,n,l]=O(a==null?void 0:a.in,t,t,e),i=P(n,l),s=Math.abs(V(n,l));if(s<1)return 0;n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let b=P(n,l)===-i;$(r)&&s===1&&P(r,l)===1&&(b=!1);const f=i*(s-+b);return f===0?0:f}function Z(t,e,a){const r=Q(t,e)/1e3;return B(a==null?void 0:a.roundingMethod)(r)}const ee={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},te=(t,e,a)=>{let r;const n=ee[t];return typeof n=="string"?r=n:e===1?r=n.one:r=n.other.replace("{{count}}",e.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+r:r+" ago":r};function M(t){return(e={})=>{const a=e.width?String(e.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}const ae={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},re={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ne={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},se={date:M({formats:ae,defaultWidth:"full"}),time:M({formats:re,defaultWidth:"full"}),dateTime:M({formats:ne,defaultWidth:"full"})},ie={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oe=(t,e,a,r)=>ie[t];function v(t){return(e,a)=>{const r=a!=null&&a.context?String(a.context):"standalone";let n;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,s=a!=null&&a.width?String(a.width):i;n=t.formattingValues[s]||t.formattingValues[i]}else{const i=t.defaultWidth,s=a!=null&&a.width?String(a.width):t.defaultWidth;n=t.values[s]||t.values[i]}const l=t.argumentCallback?t.argumentCallback(e):e;return n[l]}}const le={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ue={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},de={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ce={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},me={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ge=(t,e)=>{const a=Number(t),r=a%100;if(r>20||r<10)switch(r%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},he={ordinalNumber:ge,era:v({values:le,defaultWidth:"wide"}),quarter:v({values:ue,defaultWidth:"wide",argumentCallback:t=>t-1}),month:v({values:de,defaultWidth:"wide"}),day:v({values:ce,defaultWidth:"wide"}),dayPeriod:v({values:me,defaultWidth:"wide",formattingValues:fe,defaultFormattingWidth:"wide"})};function E(t){return(e,a={})=>{const r=a.width,n=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],l=e.match(n);if(!l)return null;const i=l[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],b=Array.isArray(s)?be(s,h=>h.test(i)):ye(s,h=>h.test(i));let f;f=t.valueCallback?t.valueCallback(b):b,f=a.valueCallback?a.valueCallback(f):f;const g=e.slice(i.length);return{value:f,rest:g}}}function ye(t,e){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&e(t[a]))return a}function be(t,e){for(let a=0;a<t.length;a++)if(e(t[a]))return a}function pe(t){return(e,a={})=>{const r=e.match(t.matchPattern);if(!r)return null;const n=r[0],l=e.match(t.parsePattern);if(!l)return null;let i=t.valueCallback?t.valueCallback(l[0]):l[0];i=a.valueCallback?a.valueCallback(i):i;const s=e.slice(n.length);return{value:i,rest:s}}}const ke=/^(\d+)(th|st|nd|rd)?/i,xe=/\d+/i,Ne={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ve={any:[/^b/i,/^(a|c)/i]},Ee={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},we={any:[/1/i,/2/i,/3/i,/4/i]},Se={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Te={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Pe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Me={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},De={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ce={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Oe={ordinalNumber:pe({matchPattern:ke,parsePattern:xe,valueCallback:t=>parseInt(t,10)}),era:E({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:ve,defaultParseWidth:"any"}),quarter:E({matchPatterns:Ee,defaultMatchWidth:"wide",parsePatterns:we,defaultParseWidth:"any",valueCallback:t=>t+1}),month:E({matchPatterns:Se,defaultMatchWidth:"wide",parsePatterns:Te,defaultParseWidth:"any"}),day:E({matchPatterns:Pe,defaultMatchWidth:"wide",parsePatterns:Me,defaultParseWidth:"any"}),dayPeriod:E({matchPatterns:De,defaultMatchWidth:"any",parsePatterns:Ce,defaultParseWidth:"any"})},Re={code:"en-US",formatDistance:te,formatLong:se,formatRelative:oe,localize:he,match:Oe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ae(t,e,a){const r=X(),n=(a==null?void 0:a.locale)??r.locale??Re,l=2520,i=P(t,e);if(isNaN(i))throw new RangeError("Invalid time value");const s=Object.assign({},a,{addSuffix:a==null?void 0:a.addSuffix,comparison:i}),[b,f]=O(a==null?void 0:a.in,...i>0?[e,t]:[t,e]),g=Z(f,b),h=(I(f)-I(b))/1e3,m=Math.round((g-h)/60);let u;if(m<2)return a!=null&&a.includeSeconds?g<5?n.formatDistance("lessThanXSeconds",5,s):g<10?n.formatDistance("lessThanXSeconds",10,s):g<20?n.formatDistance("lessThanXSeconds",20,s):g<40?n.formatDistance("halfAMinute",0,s):g<60?n.formatDistance("lessThanXMinutes",1,s):n.formatDistance("xMinutes",1,s):m===0?n.formatDistance("lessThanXMinutes",1,s):n.formatDistance("xMinutes",m,s);if(m<45)return n.formatDistance("xMinutes",m,s);if(m<90)return n.formatDistance("aboutXHours",1,s);if(m<L){const o=Math.round(m/60);return n.formatDistance("aboutXHours",o,s)}else{if(m<l)return n.formatDistance("xDays",1,s);if(m<S){const o=Math.round(m/L);return n.formatDistance("xDays",o,s)}else if(m<S*2)return u=Math.round(m/S),n.formatDistance("aboutXMonths",u,s)}if(u=J(f,b),u<12){const o=Math.round(m/S);return n.formatDistance("xMonths",o,s)}else{const o=u%12,d=Math.trunc(u/12);return o<3?n.formatDistance("aboutXYears",d,s):o<9?n.formatDistance("overXYears",d,s):n.formatDistance("almostXYears",d+1,s)}}function Be(t,e){return Ae(t,Y(t),e)}function Qe(t){if(t.includes("T")&&(t.includes("Z")||t.includes("+")))return new Date(t);const e=t.replace(" ","T")+"Z";return new Date(e)}const D={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},paths:{urlKey:"paths",displayName:"Path",values:[]},controllers:{urlKey:"controllers",displayName:"Controller",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}},query:{displayName:"Query",pluralName:"Queries",route:"queries",icon:"Database",filters:{types:{urlKey:"queryTypes",displayName:"Type",values:["SELECT","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE"]},sources:{urlKey:"sources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","knex","mikro-orm","drizzle"]}}},exception:{displayName:"Exception",pluralName:"Exceptions",route:"exceptions",icon:"AlertTriangle",filters:{names:{urlKey:"names",displayName:"Name",values:[]},methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},paths:{urlKey:"paths",displayName:"Path",values:[]}}},log:{displayName:"Log",pluralName:"Logs",route:"logs",icon:"FileText",filters:{levels:{urlKey:"levels",displayName:"Level",values:["log","error","warn","debug","verbose","fatal","info"]},contexts:{urlKey:"contexts",displayName:"Context",values:[]}}},event:{displayName:"Event",pluralName:"Events",route:"events",icon:"Zap",filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",filters:{names:{urlKey:"jobNames",displayName:"Job",values:[]},statuses:{urlKey:"jobStatuses",displayName:"Status",values:["waiting","active","completed","failed","delayed","paused","stuck"]},queues:{urlKey:"queues",displayName:"Queue",values:[]}}},schedule:{displayName:"Schedule",pluralName:"Schedule",route:"schedule",icon:"Clock",filters:{names:{urlKey:"scheduleNames",displayName:"Task",values:[]},statuses:{urlKey:"scheduleStatuses",displayName:"Status",values:["started","completed","failed","skipped","running"]}}},cache:{displayName:"Cache",pluralName:"Cache",route:"cache",icon:"HardDrive",filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",filters:{statuses:{urlKey:"mailStatuses",displayName:"Status",values:["sent","failed","pending","queued","delivered","bounced","error"]}}},"http-client":{displayName:"HTTP Client",pluralName:"HTTP Client",route:"http-client",icon:"Globe",filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]}}},redis:{displayName:"Redis",pluralName:"Redis",route:"redis",icon:"Database",filters:{commands:{urlKey:"redisCommands",displayName:"Command",values:["GET","SET","DEL","HGET","HSET","HDEL","HGETALL","LPUSH","RPUSH","LPOP","RPOP","LRANGE","SADD","SREM","SMEMBERS","ZADD","ZRANGE","ZREM","EXPIRE","TTL","KEYS","SCAN","PING","INFO","INCR","DECR","MGET","MSET","PUBLISH","SUBSCRIBE"]},statuses:{urlKey:"redisStatuses",displayName:"Status",values:["success","failed","error","timeout"]}}},model:{displayName:"Model",pluralName:"Models",route:"models",icon:"Box",filters:{actions:{urlKey:"modelActions",displayName:"Action",values:["find","findOne","findMany","create","update","delete","save","remove","count","aggregate","upsert","createMany","updateMany","deleteMany"]},entities:{urlKey:"entities",displayName:"Entity",values:[]},sources:{urlKey:"modelSources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","mikro-orm","drizzle"]}}},notification:{displayName:"Notification",pluralName:"Notifications",route:"notifications",icon:"Bell",filters:{types:{urlKey:"notificationTypes",displayName:"Type",values:["email","sms","push","socket","webhook","slack","telegram","discord"]},statuses:{urlKey:"notificationStatuses",displayName:"Status",values:["sent","failed","pending","delivered","read","error","queued"]}}},view:{displayName:"View",pluralName:"Views",route:"views",icon:"Layout",filters:{formats:{urlKey:"viewFormats",displayName:"Format",values:["html","json","xml","pdf","csv","text","markdown"]},statuses:{urlKey:"viewStatuses",displayName:"Status",values:["rendered","error","failed","cached","success"]}}},command:{displayName:"Command",pluralName:"Commands",route:"commands",icon:"Terminal",filters:{statuses:{urlKey:"commandStatuses",displayName:"Status",values:["executing","completed","failed","cancelled","timeout","running"]},names:{urlKey:"commandNames",displayName:"Command",values:[]}}},gate:{displayName:"Gate",pluralName:"Gates",route:"gates",icon:"Shield",filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",filters:{operations:{urlKey:"batchOperations",displayName:"Operation",values:["insert","update","delete","upsert","sync"]},statuses:{urlKey:"batchStatuses",displayName:"Status",values:["pending","processing","completed","failed","partial","cancelled"]}}},dump:{displayName:"Dump",pluralName:"Dumps",route:"dumps",icon:"HardDrive",filters:{operations:{urlKey:"dumpOperations",displayName:"Operation",values:["export","import","backup","restore","migrate","sync"]},formats:{urlKey:"dumpFormats",displayName:"Format",values:["json","csv","xml","sql","yaml","binary","xlsx"]},statuses:{urlKey:"dumpStatuses",displayName:"Status",values:["pending","completed","failed","error","success","cancelled","running"]}}},graphql:{displayName:"GraphQL",pluralName:"GraphQL",route:"graphql",icon:"Hexagon",filters:{operationTypes:{urlKey:"operationTypes",displayName:"Type",values:["query","mutation","subscription"]},operationNames:{urlKey:"operationNames",displayName:"Operation",values:[]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}}},Le={requests:"request",queries:"query",exceptions:"exception",logs:"log",events:"event",jobs:"job",schedule:"schedule",cache:"cache",mail:"mail","http-client":"http-client",redis:"redis",models:"model",notifications:"notification",views:"view",commands:"command",gates:"gate",batches:"batch",dumps:"dump",graphql:"graphql"};function Ke(t){if(t in D)return D[t];const e=Le[t];if(e)return D[e]}const W=Ke;function ze(t){const[e,a]=H(),r=W(t),n=p.useCallback(u=>{if(u==="tags")return"tags";if(!r)return u;const o=r.filters[u];return(o==null?void 0:o.urlKey)||u},[r]),l=p.useMemo(()=>{const u={};if(!r)return u;const o=Object.values(r.filters).map(d=>d.urlKey);o.push("tags","search");for(const d of o){const c=e.get(d);c&&(u[d]=c.split(",").filter(Boolean))}return u},[e,r]),i=p.useCallback((u,o)=>{!r&&u!=="tags"&&console.warn("[useEntryFilters] No config found for entry type, using category as urlKey");const d=n(u),c=l[d]||[];if(!c.includes(o)){const y=new URLSearchParams(e);y.set(d,[...c,o].join(",")),a(y,{replace:!0})}},[r,n,l,e,a]),s=p.useCallback((u,o)=>{const c=(l[u]||[]).filter(x=>x!==o),y=new URLSearchParams(e);c.length>0?y.set(u,c.join(",")):y.delete(u),a(y,{replace:!0})},[l,e,a]),b=p.useCallback(()=>{a({},{replace:!0})},[a]),f=p.useMemo(()=>l,[l]),g=p.useMemo(()=>{if(!r)return[];const u=[];for(const[o,d]of Object.entries(l)){if(d.length===0)continue;let c=o,y=o==="tags"?"Tag":o;for(const[x,N]of Object.entries(r.filters))if(N.urlKey===o){c=x,y=N.displayName;break}u.push({category:c,urlKey:o,displayName:y,values:d})}return u},[l,r]),h=p.useMemo(()=>{const u=[];for(const o of g)for(const d of o.values)u.push({category:o.displayName,value:d.toUpperCase(),onRemove:()=>s(o.urlKey,d)});return u},[g,s]),m=g.length>0;return{addFilter:i,removeFilter:s,clearAll:b,serverFilters:f,activeFilters:g,headerFilters:h,hasFilters:m,getUrlKey:n}}function Ie(t,e){if(e==="tags")return"tags";const a=W(t);if(!a)return e;const r=a.filters[e];return(r==null?void 0:r.urlKey)||e}const F=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"],U=["bg-rose-100 text-rose-800 dark:bg-rose-900 dark:text-rose-400","bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-400","bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-400","bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-400","bg-sky-100 text-sky-800 dark:bg-sky-900 dark:text-sky-400","bg-violet-100 text-violet-800 dark:bg-violet-900 dark:text-violet-400","bg-fuchsia-100 text-fuchsia-800 dark:bg-fuchsia-900 dark:text-fuchsia-400","bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-400"];function We(t){let e=0;for(let a=0;a<t.length;a++)e=(e<<5)-e+t.charCodeAt(a),e=e&e;return Math.abs(e)%U.length}const Fe=["localhost"],Ue=(t,e)=>{if(e&&e!=="tag")return e;if(/^user:/i.test(t))return"tags";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(t))return"ips";const a=t.toUpperCase();if(F.includes(a))return"methods";const r=parseInt(t,10);return!isNaN(r)&&r>=100&&r<600?"statuses":/^[a-fA-F0-9:]+$/.test(t)&&t.includes(":")&&!t.includes(".")?"ips":t.includes("#")||t.includes("::")||/Controller\./i.test(t)?"controllers":Fe.includes(t.toLowerCase())||(t.includes(".")||t.includes(":"))&&!t.startsWith("/")&&!/^\d+$/.test(t)?"hostnames":"tags"};function He(t){const e=t.toUpperCase();if(t.startsWith("/"))return"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-400";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(t)||/^[a-fA-F0-9:]+$/.test(t)&&t.includes(":")&&!t.includes("."))return"bg-indigo-100 text-indigo-800 dark:bg-indigo-900/30 dark:text-indigo-400";if(t.includes("#")||t.includes("::")||/Controller\./i.test(t))return"bg-teal-100 text-teal-800 dark:bg-teal-900/30 dark:text-teal-400";if(e.startsWith("USER:"))return"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400";const a=t.toLowerCase(),r=/:\d+$/.test(t),n=/\.(com|org|net|io|dev|app|co|local|internal)$/i.test(t),l=/^[A-Z0-9_.]+$/.test(t)&&t.includes(".");if(a==="localhost"||r&&!t.startsWith("/")||n&&!l)return"bg-slate-100 text-slate-800 dark:bg-slate-700 dark:text-slate-300";if(e==="GET")return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";if(e==="POST")return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";if(e==="PUT")return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";if(e==="PATCH")return"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200";if(e==="DELETE")return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";if(["HEAD","OPTIONS"].includes(e))return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300";if(e==="GRAPHQL")return"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200";const i=parseInt(e,10);if(!isNaN(i)&&i>=100&&i<600)return i>=500?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400":i>=400?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":i>=300?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400";if(e==="SUCCESS"||e==="2XX"||e==="HIT")return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400";if(e==="REDIRECT"||e==="3XX")return"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400";if(e==="WARNING"||e==="WARN"||e==="4XX"||e==="CLIENT-ERROR")return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400";if(e==="ERROR"||e==="5XX"||e==="HTTP-ERROR"||e==="VALIDATION-ERROR"||e==="FAILED")return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400";if(e==="SLOW"||e==="SLOW QUERY")return"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400";if(e==="N+1"||e==="N1")return"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300";if(["SELECT","INSERT","UPDATE"].includes(e))return"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-400";if(e==="DEBUG")return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";if(e==="LOG"||e==="INFO")return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";if(e==="VERBOSE")return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300";if(e==="QUERY"||e==="MUTATION"||e==="SUBSCRIPTION"){if(e==="QUERY")return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";if(e==="MUTATION")return"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200";if(e==="SUBSCRIPTION")return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}return e==="REQUEST"?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":e==="EXCEPTION"?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":e==="LOG"||e==="EVENT"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":e==="JOB"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":e==="CACHE"?"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200":e==="MAIL"?"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200":e==="SCHEDULE"?"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300":e==="HTTP-CLIENT"?"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200":e==="RESOLVED"||e==="COMPLETED"||e==="SENT"||e==="ACTIVE"?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":e==="WAITING"||e==="DELAYED"||e==="PENDING"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":e==="MISS"?"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300":e==="GET"&&!F.includes(e)?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":e==="SET"?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":e==="DEL"||e==="DELETE"?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400":e==="CLEAR"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":e==="STARTED"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":e==="TYPEORM"?"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400":e==="PRISMA"?"bg-indigo-100 text-indigo-800 dark:bg-indigo-900/30 dark:text-indigo-400":e==="MONGOOSE"?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":e==="SEQUELIZE"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":e==="KNEX"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":e==="MIKRO-ORM"?"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400":e==="NORMAL"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":U[We(e)]}function je({children:t,listType:e,filterType:a="tag",filterValue:r,onClick:n,clickable:l=!0,className:i="",ariaLabel:s}){const b=j(),f=q(),g=c=>{if(c.preventDefault(),c.stopPropagation(),n){n(c);return}if(e&&l){const y=r||String(t),x=a&&a!=="tag"?Ie(e,a):Ue(y,a),N=f.pathname,w=N===`/${e}`||N.startsWith(`/${e}/`)?new URLSearchParams(f.search):new URLSearchParams,R=w.get(x);if(R){const A=R.split(",");A.includes(y)||w.set(x,[...A,y].join(","))}else w.set(x,y);b(`/${e}?${w.toString()}`)}},h=l&&(!!n||!!e),m=He(String(t)),u=h?"cursor-pointer hover:scale-105 transition-transform":"",o=String(t).toUpperCase(),d=s||(h?`Click to filter by ${o}`:void 0);return T.jsx("span",{onClick:h?g:void 0,role:h?"button":void 0,"aria-label":d,tabIndex:h?0:void 0,onKeyDown:h?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),g(c))}:void 0,title:o,className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap shadow ${m} ${u} ${h?"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1":""} ${i}`,children:o})}function _e({items:t,listType:e,filterType:a="tag",maxItems:r=99,clickable:n=!0}){if(!t||t.length===0)return null;const l=t.slice(0,r),i=t.length-r;return T.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[l.map(s=>T.jsx(je,{listType:e,filterType:a,clickable:n,children:s},s)),i>0&&T.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",i]})]})}export{_e as B,je as C,X as a,I as b,C as c,Ye as d,Re as e,Be as f,He as g,Ve as m,O as n,Qe as p,k as t,ze as u};
@@ -1 +1 @@
1
- import{j as a,a as l}from"./index-NYfiXmMn.js";import{e as P,b as T}from"./vendor-DBTT3jXp.js";import{u as D,C as d,f as F,p as A}from"./ClickableBadge-Vyx_sMAl.js";import{u as M,P as R,N as B,L as H}from"./PageHeader-gzCjMnIq.js";import{q as L,T as i,D as W,b as S}from"./types-DrGQDdvv.js";function G(){const m=P(),{addFilter:t,clearAll:c,serverFilters:u,headerFilters:h,hasFilters:p}=D("commands"),{entries:x,loading:g,refreshing:r,newEntriesCount:f,hasMore:y,loadMore:C,loadNew:j,autoRefreshEnabled:k,live:N,setAutoRefresh:w,meta:s,isHighlighted:b}=M({type:"command",limit:50,filters:u}),n=x.filter(e=>L(e)),E=T.useMemo(()=>[{key:"name",header:"Command",minWidth:"250px",render:e=>a.jsx(d,{onClick:o=>{o.stopPropagation(),t("names",e.payload.name)},className:"font-mono",children:e.payload.name})},{key:"handler",header:"Handler",minWidth:"200px",render:e=>e.payload.handler?a.jsx(i,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.handler}):a.jsx(i,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(d,{onClick:o=>{o.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(W,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:F(A(e.createdAt),{addSuffix:!0})})}],[t]);if(g&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const v=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Commands",icon:l,iconColor:"text-green-600 dark:text-green-400",count:n.length,totalCount:s==null?void 0:s.total,refreshing:r,autoRefreshEnabled:k,live:N,onAutoRefreshToggle:w,filters:h,onClearAllFilters:c}),a.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[a.jsx(B,{count:f,onClick:j,loading:r}),a.jsx(S,{columns:E,data:n,keyExtractor:e=>e.id,onRowClick:e=>m(`/commands/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No commands recorded yet",emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(H,{hasMore:y,onClick:C,loading:r})]})]})}export{G as default};
1
+ import{j as a,a as l}from"./index-fV4VT_EH.js";import{e as P,b as T}from"./vendor-DBTT3jXp.js";import{u as D,C as d,f as F,p as A}from"./ClickableBadge-DIMjoLzU.js";import{u as M,P as R,N as B,L as H}from"./PageHeader-Dy1i1YMN.js";import{q as L,T as i,D as W,b as S}from"./types-Sj3ahDpV.js";function G(){const m=P(),{addFilter:t,clearAll:c,serverFilters:u,headerFilters:h,hasFilters:p}=D("commands"),{entries:x,loading:g,refreshing:r,newEntriesCount:f,hasMore:y,loadMore:C,loadNew:j,autoRefreshEnabled:k,live:N,setAutoRefresh:w,meta:s,isHighlighted:b}=M({type:"command",limit:50,filters:u}),n=x.filter(e=>L(e)),E=T.useMemo(()=>[{key:"name",header:"Command",minWidth:"250px",render:e=>a.jsx(d,{onClick:o=>{o.stopPropagation(),t("names",e.payload.name)},className:"font-mono",children:e.payload.name})},{key:"handler",header:"Handler",minWidth:"200px",render:e=>e.payload.handler?a.jsx(i,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.handler}):a.jsx(i,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(d,{onClick:o=>{o.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(W,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:F(A(e.createdAt),{addSuffix:!0})})}],[t]);if(g&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const v=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Commands",icon:l,iconColor:"text-green-600 dark:text-green-400",count:n.length,totalCount:s==null?void 0:s.total,refreshing:r,autoRefreshEnabled:k,live:N,onAutoRefreshToggle:w,filters:h,onClearAllFilters:c}),a.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[a.jsx(B,{count:f,onClick:j,loading:r}),a.jsx(S,{columns:E,data:n,keyExtractor:e=>e.id,onRowClick:e=>m(`/commands/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No commands recorded yet",emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(H,{hasMore:y,onClick:C,loading:r})]})]})}export{G as default};
@@ -1,4 +1,4 @@
1
- import{c as D,u as ge,j as e,D as ae,T as A,C as R,A as M,G as xe,F as me,B as ue,P as ye,a as be,H as B,b as he,L as pe,d as ke,M as fe,e as ve,R as je,f as Ne,S as we,g as V,h as W,i as Se,k as _,l as K,r as qe,m as Y}from"./index-NYfiXmMn.js";import{e as Ce,b as c,L as Ee}from"./vendor-DBTT3jXp.js";import{g as Pe,f,p as v}from"./ClickableBadge-Vyx_sMAl.js";import{Z as Te}from"./zap-DXGDS502.js";import{C as $e}from"./calendar-BsVc-vvl.js";/**
1
+ import{c as D,u as ge,j as e,D as ae,T as A,C as R,A as M,G as xe,F as me,B as ue,P as ye,a as be,H as B,b as he,L as pe,d as ke,M as fe,e as ve,R as je,f as Ne,S as we,g as V,h as W,i as Se,k as _,l as K,r as qe,m as Y}from"./index-fV4VT_EH.js";import{e as Ce,b as c,L as Ee}from"./vendor-DBTT3jXp.js";import{g as Pe,f,p as v}from"./ClickableBadge-DIMjoLzU.js";import{Z as Te}from"./zap-DcjSBmCK.js";import{C as $e}from"./calendar-Camxqdlp.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as a,H as l}from"./index-NYfiXmMn.js";import{e as P,b as B}from"./vendor-DBTT3jXp.js";import{u as M,C as d,f as R,p as S}from"./ClickableBadge-Vyx_sMAl.js";import{u as T,P as $,N as A,L as z}from"./PageHeader-gzCjMnIq.js";import{t as H,T as o,D as L,b}from"./types-DrGQDdvv.js";function q(){const p=P(),{addFilter:r,clearAll:u,serverFilters:c,headerFilters:h,hasFilters:m}=M("dumps"),{entries:x,loading:g,refreshing:s,newEntriesCount:f,hasMore:j,loadMore:y,loadNew:C,autoRefreshEnabled:k,live:w,setAutoRefresh:N,meta:i,isHighlighted:v}=T({type:"dump",limit:50,filters:c}),n=x.filter(e=>H(e)),D=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)}MB`:`${(e/(1024*1024*1024)).toFixed(1)}GB`:"-",E=B.useMemo(()=>[{key:"operation",header:"Operation",width:"120px",render:e=>a.jsx(d,{onClick:t=>{t.stopPropagation(),r("operations",e.payload.operation)},children:e.payload.operation.toUpperCase()})},{key:"format",header:"Format",width:"100px",render:e=>a.jsx(d,{onClick:t=>{t.stopPropagation(),r("formats",e.payload.format)},className:"font-mono",children:e.payload.format})},{key:"records",header:"Records",width:"100px",align:"right",render:e=>e.payload.recordCount!==void 0?a.jsx(o,{children:e.payload.recordCount.toLocaleString()}):a.jsx(o,{secondary:!0,children:"-"})},{key:"size",header:"Size",width:"100px",align:"right",render:e=>a.jsx(o,{children:D(e.payload.fileSize)})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(d,{onClick:t=>{t.stopPropagation(),r("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(L,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(o,{secondary:!0,className:"text-xs",children:R(S(e.createdAt),{addSuffix:!0})})}],[r]);if(g&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const F=m?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx($,{title:"Dumps",icon:l,iconColor:"text-slate-600 dark:text-slate-400",count:n.length,totalCount:i==null?void 0:i.total,refreshing:s,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:N,filters:h,onClearAllFilters:u}),a.jsxs("div",{className:`${F} space-y-4 transition-all duration-200`,children:[a.jsx(A,{count:f,onClick:C,loading:s}),a.jsx(b,{columns:E,data:n,keyExtractor:e=>e.id,onRowClick:e=>p(`/dumps/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No data dumps recorded yet",emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(z,{hasMore:j,onClick:y,loading:s})]})]})}export{q as default};
1
+ import{j as a,H as l}from"./index-fV4VT_EH.js";import{e as P,b as B}from"./vendor-DBTT3jXp.js";import{u as M,C as d,f as R,p as S}from"./ClickableBadge-DIMjoLzU.js";import{u as T,P as $,N as A,L as z}from"./PageHeader-Dy1i1YMN.js";import{t as H,T as o,D as L,b}from"./types-Sj3ahDpV.js";function q(){const p=P(),{addFilter:r,clearAll:u,serverFilters:c,headerFilters:h,hasFilters:m}=M("dumps"),{entries:x,loading:g,refreshing:s,newEntriesCount:f,hasMore:j,loadMore:y,loadNew:C,autoRefreshEnabled:k,live:w,setAutoRefresh:N,meta:i,isHighlighted:v}=T({type:"dump",limit:50,filters:c}),n=x.filter(e=>H(e)),D=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)}MB`:`${(e/(1024*1024*1024)).toFixed(1)}GB`:"-",E=B.useMemo(()=>[{key:"operation",header:"Operation",width:"120px",render:e=>a.jsx(d,{onClick:t=>{t.stopPropagation(),r("operations",e.payload.operation)},children:e.payload.operation.toUpperCase()})},{key:"format",header:"Format",width:"100px",render:e=>a.jsx(d,{onClick:t=>{t.stopPropagation(),r("formats",e.payload.format)},className:"font-mono",children:e.payload.format})},{key:"records",header:"Records",width:"100px",align:"right",render:e=>e.payload.recordCount!==void 0?a.jsx(o,{children:e.payload.recordCount.toLocaleString()}):a.jsx(o,{secondary:!0,children:"-"})},{key:"size",header:"Size",width:"100px",align:"right",render:e=>a.jsx(o,{children:D(e.payload.fileSize)})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(d,{onClick:t=>{t.stopPropagation(),r("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(L,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(o,{secondary:!0,className:"text-xs",children:R(S(e.createdAt),{addSuffix:!0})})}],[r]);if(g&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const F=m?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx($,{title:"Dumps",icon:l,iconColor:"text-slate-600 dark:text-slate-400",count:n.length,totalCount:i==null?void 0:i.total,refreshing:s,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:N,filters:h,onClearAllFilters:u}),a.jsxs("div",{className:`${F} space-y-4 transition-all duration-200`,children:[a.jsx(A,{count:f,onClick:C,loading:s}),a.jsx(b,{columns:E,data:n,keyExtractor:e=>e.id,onRowClick:e=>p(`/dumps/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No data dumps recorded yet",emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(z,{hasMore:j,onClick:y,loading:s})]})]})}export{q as default};
@@ -1,4 +1,4 @@
1
- import{c as Ae,j as E,g as Xe,X as Tt,z as ge,t as Cs,C as De,D as uE,i as or,B as Xs,M as ks,v as Ra,a as as,b as Ks,F as Ls,e as $s,S as Js,L as rt,A as Aa,H as Qs,T as Na,w as Sa}from"./index-NYfiXmMn.js";import{b as U,L as Ve,g as na,e as Oa,h as Ia}from"./vendor-DBTT3jXp.js";import{t as We,a as It,c as xE,n as ia,b as qs,m as la,d as cr,e as oa,C as p,f as re,p as F,B as BE}from"./ClickableBadge-Vyx_sMAl.js";import{d as at,e as Rt,c as At,f as Rs,g as As,h as Ns,j as Ss,G as ca,N as Ca,i as ns,k as Zs,l as Os,m as zs,n as eT,o as ET,p as tT,q as sT,r as TT,s as rT,t as aT,u as Is}from"./types-DrGQDdvv.js";import{S as tE}from"./search-C8zDS2B0.js";import{Z as Cr}from"./zap-DXGDS502.js";import{C as Fe}from"./circle-check-big-D8hxmLVs.js";import{f as Ze,c as La}from"./format-PC0kH-TG.js";import{C as _a}from"./calendar-BsVc-vvl.js";import{E as RT}from"./eye-DoP8A5L_.js";/**
1
+ import{c as Ae,j as E,g as Xe,X as Tt,z as ge,t as Cs,C as De,D as uE,i as or,B as Xs,M as ks,v as Ra,a as as,b as Ks,F as Ls,e as $s,S as Js,L as rt,A as Aa,H as Qs,T as Na,w as Sa}from"./index-fV4VT_EH.js";import{b as U,L as Ve,g as na,e as Oa,h as Ia}from"./vendor-DBTT3jXp.js";import{t as We,a as It,c as xE,n as ia,b as qs,m as la,d as cr,e as oa,C as p,f as re,p as F,B as BE}from"./ClickableBadge-DIMjoLzU.js";import{d as at,e as Rt,c as At,f as Rs,g as As,h as Ns,j as Ss,G as ca,N as Ca,i as ns,k as Zs,l as Os,m as zs,n as eT,o as ET,p as tT,q as sT,r as TT,s as rT,t as aT,u as Is}from"./types-Sj3ahDpV.js";import{S as tE}from"./search-G_aOCia0.js";import{Z as Cr}from"./zap-DcjSBmCK.js";import{C as Fe}from"./circle-check-big-oB7KFF_S.js";import{f as Ze,c as La}from"./format-PC0kH-TG.js";import{C as _a}from"./calendar-Camxqdlp.js";import{E as RT}from"./eye-CNwth9uN.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as a,X as i}from"./index-NYfiXmMn.js";import{f as m,b as c}from"./vendor-DBTT3jXp.js";import{S as p}from"./search-C8zDS2B0.js";function d({placeholder:n="Search..."}){const[l,u]=m(),t=l.get("search")||"",[e,s]=c.useState(t);return c.useEffect(()=>{const o=setTimeout(()=>{u(h=>{const r=new URLSearchParams(h);return(r.get("search")||"")===e||(e?r.set("search",e):r.delete("search")),r},{replace:!0})},350);return()=>clearTimeout(o)},[e]),c.useEffect(()=>{s(t)},[t]),a.jsxs("div",{className:"relative",children:[a.jsx(p,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 pointer-events-none"}),a.jsx("input",{type:"text",value:e,onChange:o=>s(o.target.value),placeholder:n,"aria-label":n,className:"w-full pl-9 pr-9 py-2 text-sm rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),e&&a.jsx("button",{onClick:()=>s(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":"Clear search",children:a.jsx(i,{className:"h-4 w-4"})})]})}export{d as E};
1
+ import{j as a,X as i}from"./index-fV4VT_EH.js";import{f as m,b as c}from"./vendor-DBTT3jXp.js";import{S as p}from"./search-G_aOCia0.js";function d({placeholder:n="Search..."}){const[l,u]=m(),t=l.get("search")||"",[e,s]=c.useState(t);return c.useEffect(()=>{const o=setTimeout(()=>{u(h=>{const r=new URLSearchParams(h);return(r.get("search")||"")===e||(e?r.set("search",e):r.delete("search")),r},{replace:!0})},350);return()=>clearTimeout(o)},[e]),c.useEffect(()=>{s(t)},[t]),a.jsxs("div",{className:"relative",children:[a.jsx(p,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 pointer-events-none"}),a.jsx("input",{type:"text",value:e,onChange:o=>s(o.target.value),placeholder:n,"aria-label":n,className:"w-full pl-9 pr-9 py-2 text-sm rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),e&&a.jsx("button",{onClick:()=>s(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":"Clear search",children:a.jsx(i,{className:"h-4 w-4"})})]})}export{d as E};
@@ -1 +1 @@
1
- import{j as t,R as i}from"./index-NYfiXmMn.js";import{e as b,b as R}from"./vendor-DBTT3jXp.js";import{u as D,C as F,f as P,p as T}from"./ClickableBadge-Vyx_sMAl.js";import{u as A,P as M,N as L,L as B}from"./PageHeader-gzCjMnIq.js";import{f as H,T as o,D as $,b as I}from"./types-DrGQDdvv.js";function J(){const l=b(),{addFilter:n,clearAll:d,serverFilters:c,headerFilters:m,hasFilters:h}=D("events"),{entries:u,loading:g,refreshing:a,newEntriesCount:x,hasMore:p,loadMore:f,loadNew:y,autoRefreshEnabled:v,live:j,setAutoRefresh:C,meta:s,isHighlighted:E}=A({type:"event",limit:50,filters:c}),r=u.filter(e=>H(e)),N=R.useMemo(()=>[{key:"event",header:"Event",minWidth:"200px",render:e=>t.jsx(F,{onClick:w=>{w.stopPropagation(),n("names",e.payload.name)},className:"font-mono",children:e.payload.name})},{key:"listeners",header:"Listeners",width:"120px",align:"center",render:e=>t.jsxs(o,{secondary:!0,children:[e.payload.listeners.length," listener",e.payload.listeners.length!==1?"s":""]})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx($,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:P(T(e.createdAt),{addSuffix:!0})})}],[n]);if(g&&r.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const k=h?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(M,{title:"Events",icon:i,iconColor:"text-emerald-600 dark:text-emerald-400",count:r.length,totalCount:s==null?void 0:s.total,refreshing:a,autoRefreshEnabled:v,live:j,onAutoRefreshToggle:C,filters:m,onClearAllFilters:d}),t.jsxs("div",{className:`${k} space-y-4 transition-all duration-200`,children:[t.jsx(L,{count:x,onClick:y,loading:a}),t.jsx(I,{columns:N,data:r,keyExtractor:e=>e.id,onRowClick:e=>l(`/events/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No events recorded yet",emptyIcon:t.jsx(i,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(B,{hasMore:p,onClick:f,loading:a})]})]})}export{J as default};
1
+ import{j as t,R as i}from"./index-fV4VT_EH.js";import{e as b,b as R}from"./vendor-DBTT3jXp.js";import{u as D,C as F,f as P,p as T}from"./ClickableBadge-DIMjoLzU.js";import{u as A,P as M,N as L,L as B}from"./PageHeader-Dy1i1YMN.js";import{f as H,T as o,D as $,b as I}from"./types-Sj3ahDpV.js";function J(){const l=b(),{addFilter:n,clearAll:d,serverFilters:c,headerFilters:m,hasFilters:h}=D("events"),{entries:u,loading:g,refreshing:a,newEntriesCount:x,hasMore:p,loadMore:f,loadNew:y,autoRefreshEnabled:v,live:j,setAutoRefresh:C,meta:s,isHighlighted:E}=A({type:"event",limit:50,filters:c}),r=u.filter(e=>H(e)),N=R.useMemo(()=>[{key:"event",header:"Event",minWidth:"200px",render:e=>t.jsx(F,{onClick:w=>{w.stopPropagation(),n("names",e.payload.name)},className:"font-mono",children:e.payload.name})},{key:"listeners",header:"Listeners",width:"120px",align:"center",render:e=>t.jsxs(o,{secondary:!0,children:[e.payload.listeners.length," listener",e.payload.listeners.length!==1?"s":""]})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx($,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:P(T(e.createdAt),{addSuffix:!0})})}],[n]);if(g&&r.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const k=h?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(M,{title:"Events",icon:i,iconColor:"text-emerald-600 dark:text-emerald-400",count:r.length,totalCount:s==null?void 0:s.total,refreshing:a,autoRefreshEnabled:v,live:j,onAutoRefreshToggle:C,filters:m,onClearAllFilters:d}),t.jsxs("div",{className:`${k} space-y-4 transition-all duration-200`,children:[t.jsx(L,{count:x,onClick:y,loading:a}),t.jsx(I,{columns:N,data:r,keyExtractor:e=>e.id,onRowClick:e=>l(`/events/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No events recorded yet",emptyIcon:t.jsx(i,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(B,{hasMore:p,onClick:f,loading:a})]})]})}export{J as default};
@@ -1,4 +1,4 @@
1
- import{c as B,u as W,j as t,i as $,T as m,n as H,o as U}from"./index-NYfiXmMn.js";import{e as z,b as c}from"./vendor-DBTT3jXp.js";import{u as G,C as p,f as J,p as K}from"./ClickableBadge-Vyx_sMAl.js";import{u as O,P as Q,F as V,N as X,L as Y}from"./PageHeader-gzCjMnIq.js";import{E as Z}from"./EntrySearchInput-BjzlyOoC.js";import{d as _,T as r,b as ee}from"./types-DrGQDdvv.js";import{C as te}from"./circle-check-big-D8hxmLVs.js";import"./search-C8zDS2B0.js";/**
1
+ import{c as B,u as W,j as t,i as $,T as m,n as H,o as U}from"./index-fV4VT_EH.js";import{e as z,b as c}from"./vendor-DBTT3jXp.js";import{u as G,C as p,f as J,p as K}from"./ClickableBadge-DIMjoLzU.js";import{u as O,P as Q,F as V,N as X,L as Y}from"./PageHeader-Dy1i1YMN.js";import{E as Z}from"./EntrySearchInput-Dyav5E5-.js";import{d as _,T as r,b as ee}from"./types-Sj3ahDpV.js";import{C as te}from"./circle-check-big-oB7KFF_S.js";import"./search-G_aOCia0.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as t,S as d}from"./index-NYfiXmMn.js";import{e as A,b as F}from"./vendor-DBTT3jXp.js";import{u as R,C as n,f as T,p as M}from"./ClickableBadge-Vyx_sMAl.js";import{u as S,P as W,N as G,L as B}from"./PageHeader-gzCjMnIq.js";import{r as D,T as a,b as I}from"./types-DrGQDdvv.js";function O(){const c=A(),{addFilter:s,clearAll:u,serverFilters:h,headerFilters:p,hasFilters:x}=R("gates"),{entries:m,loading:g,refreshing:i,newEntriesCount:y,hasMore:j,loadMore:f,loadNew:b,autoRefreshEnabled:k,live:w,setAutoRefresh:C,meta:o,isHighlighted:N}=S({type:"gate",limit:50,filters:h}),l=m.filter(e=>D(e)),E=F.useMemo(()=>[{key:"gate",header:"Gate",minWidth:"200px",render:e=>t.jsx(n,{onClick:r=>{r.stopPropagation(),s("names",e.payload.gate)},children:e.payload.gate})},{key:"action",header:"Action",width:"150px",render:e=>e.payload.action?t.jsx(a,{truncate:!0,maxWidth:"150px",children:e.payload.action}):t.jsx(a,{secondary:!0,children:"-"})},{key:"subject",header:"Subject",minWidth:"150px",render:e=>e.payload.subject?t.jsx(a,{mono:!0,truncate:!0,maxWidth:"200px",children:typeof e.payload.subject=="string"?e.payload.subject:JSON.stringify(e.payload.subject)}):t.jsx(a,{secondary:!0,children:"-"})},{key:"result",header:"Result",width:"100px",render:e=>{const r=e.payload.allowed?"allowed":"denied";return t.jsx(n,{onClick:P=>{P.stopPropagation(),s("results",r)},children:r.toUpperCase()})}},{key:"user",header:"User",width:"150px",render:e=>e.payload.userId?t.jsx(a,{truncate:!0,maxWidth:"150px",children:e.payload.userId}):t.jsx(a,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:T(M(e.createdAt),{addSuffix:!0})})}],[s]);if(g&&l.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const v=x?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(W,{title:"Gates",icon:d,iconColor:"text-amber-600 dark:text-amber-400",count:l.length,totalCount:o==null?void 0:o.total,refreshing:i,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:C,filters:p,onClearAllFilters:u}),t.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[t.jsx(G,{count:y,onClick:b,loading:i}),t.jsx(I,{columns:E,data:l,keyExtractor:e=>e.id,onRowClick:e=>c(`/gates/${e.id}`),rowClassName:e=>N(e.id)?"highlight-new":"",emptyMessage:"No gate checks recorded yet",emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(B,{hasMore:j,onClick:f,loading:i})]})]})}export{O as default};
1
+ import{j as t,S as d}from"./index-fV4VT_EH.js";import{e as A,b as F}from"./vendor-DBTT3jXp.js";import{u as R,C as n,f as T,p as M}from"./ClickableBadge-DIMjoLzU.js";import{u as S,P as W,N as G,L as B}from"./PageHeader-Dy1i1YMN.js";import{r as D,T as a,b as I}from"./types-Sj3ahDpV.js";function O(){const c=A(),{addFilter:s,clearAll:u,serverFilters:h,headerFilters:p,hasFilters:x}=R("gates"),{entries:m,loading:g,refreshing:i,newEntriesCount:y,hasMore:j,loadMore:f,loadNew:b,autoRefreshEnabled:k,live:w,setAutoRefresh:C,meta:o,isHighlighted:N}=S({type:"gate",limit:50,filters:h}),l=m.filter(e=>D(e)),E=F.useMemo(()=>[{key:"gate",header:"Gate",minWidth:"200px",render:e=>t.jsx(n,{onClick:r=>{r.stopPropagation(),s("names",e.payload.gate)},children:e.payload.gate})},{key:"action",header:"Action",width:"150px",render:e=>e.payload.action?t.jsx(a,{truncate:!0,maxWidth:"150px",children:e.payload.action}):t.jsx(a,{secondary:!0,children:"-"})},{key:"subject",header:"Subject",minWidth:"150px",render:e=>e.payload.subject?t.jsx(a,{mono:!0,truncate:!0,maxWidth:"200px",children:typeof e.payload.subject=="string"?e.payload.subject:JSON.stringify(e.payload.subject)}):t.jsx(a,{secondary:!0,children:"-"})},{key:"result",header:"Result",width:"100px",render:e=>{const r=e.payload.allowed?"allowed":"denied";return t.jsx(n,{onClick:P=>{P.stopPropagation(),s("results",r)},children:r.toUpperCase()})}},{key:"user",header:"User",width:"150px",render:e=>e.payload.userId?t.jsx(a,{truncate:!0,maxWidth:"150px",children:e.payload.userId}):t.jsx(a,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:T(M(e.createdAt),{addSuffix:!0})})}],[s]);if(g&&l.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const v=x?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(W,{title:"Gates",icon:d,iconColor:"text-amber-600 dark:text-amber-400",count:l.length,totalCount:o==null?void 0:o.total,refreshing:i,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:C,filters:p,onClearAllFilters:u}),t.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[t.jsx(G,{count:y,onClick:b,loading:i}),t.jsx(I,{columns:E,data:l,keyExtractor:e=>e.id,onRowClick:e=>c(`/gates/${e.id}`),rowClassName:e=>N(e.id)?"highlight-new":"",emptyMessage:"No gate checks recorded yet",emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(B,{hasMore:j,onClick:f,loading:i})]})]})}export{O as default};
@@ -1,4 +1,4 @@
1
- import{c as G,j as a}from"./index-NYfiXmMn.js";import{e as M,f as Q,b as U}from"./vendor-DBTT3jXp.js";import{u as W,C as g,f as I,p as O}from"./ClickableBadge-Vyx_sMAl.js";import{E as $}from"./EntrySearchInput-BjzlyOoC.js";import{u as z,P as V,N as J,L as K}from"./PageHeader-gzCjMnIq.js";import{u as X,T as p,G as Y,N as Z,D as _,a as ee,b as ae}from"./types-DrGQDdvv.js";import"./search-C8zDS2B0.js";/**
1
+ import{c as G,j as a}from"./index-fV4VT_EH.js";import{e as M,f as Q,b as U}from"./vendor-DBTT3jXp.js";import{u as W,C as g,f as I,p as O}from"./ClickableBadge-DIMjoLzU.js";import{E as $}from"./EntrySearchInput-Dyav5E5-.js";import{u as z,P as V,N as J,L as K}from"./PageHeader-Dy1i1YMN.js";import{u as X,T as p,G as Y,N as Z,D as _,a as ee,b as ae}from"./types-Sj3ahDpV.js";import"./search-G_aOCia0.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as t,d}from"./index-NYfiXmMn.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{u as H,C as n,f as D,p as F}from"./ClickableBadge-Vyx_sMAl.js";import{u as M,P as A,N as B,L}from"./PageHeader-gzCjMnIq.js";import{l as S,T as l,D as W,b as $}from"./types-DrGQDdvv.js";function J(){const h=R(),{addFilter:s,clearAll:c,serverFilters:p,headerFilters:u,hasFilters:m}=H("http-client"),{entries:x,loading:g,refreshing:o,newEntriesCount:y,hasMore:f,loadMore:C,loadNew:j,autoRefreshEnabled:k,live:w,setAutoRefresh:N,meta:r,isHighlighted:E}=M({type:"http-client",limit:50,filters:p}),i=x.filter(e=>S(e)),b=v.useMemo(()=>[{key:"method",header:"Method",width:"90px",render:e=>t.jsx(n,{onClick:a=>{a.stopPropagation(),s("methods",e.payload.method)},className:"font-mono",children:e.payload.method})},{key:"status",header:"Status",width:"80px",render:e=>t.jsx(n,{onClick:a=>{a.stopPropagation();const T=e.payload.statusCode?String(e.payload.statusCode):"ERR";s("statuses",T)},children:e.payload.statusCode||"ERR"})},{key:"hostname",header:"Host",width:"180px",render:e=>e.payload.hostname?t.jsx(n,{onClick:a=>{a.stopPropagation(),s("hostnames",e.payload.hostname)},className:"font-mono",children:e.payload.hostname}):t.jsx(l,{secondary:!0,children:"-"})},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(l,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.path||e.payload.url})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(W,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(l,{secondary:!0,className:"text-xs",children:D(F(e.createdAt),{addSuffix:!0})})}],[s]);if(g&&i.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const P=m?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(A,{title:"HTTP Client",icon:d,iconColor:"text-cyan-600 dark:text-cyan-400",count:i.length,totalCount:r==null?void 0:r.total,refreshing:o,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:N,filters:u,onClearAllFilters:c}),t.jsxs("div",{className:`${P} space-y-4 transition-all duration-200`,children:[t.jsx(B,{count:y,onClick:j,loading:o}),t.jsx($,{columns:b,data:i,keyExtractor:e=>e.id,onRowClick:e=>h(`/http-client/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No outgoing HTTP requests recorded yet",emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(L,{hasMore:f,onClick:C,loading:o})]})]})}export{J as default};
1
+ import{j as t,d}from"./index-fV4VT_EH.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{u as H,C as n,f as D,p as F}from"./ClickableBadge-DIMjoLzU.js";import{u as M,P as A,N as B,L}from"./PageHeader-Dy1i1YMN.js";import{l as S,T as l,D as W,b as $}from"./types-Sj3ahDpV.js";function J(){const h=R(),{addFilter:s,clearAll:c,serverFilters:p,headerFilters:u,hasFilters:m}=H("http-client"),{entries:x,loading:g,refreshing:o,newEntriesCount:y,hasMore:f,loadMore:C,loadNew:j,autoRefreshEnabled:k,live:w,setAutoRefresh:N,meta:r,isHighlighted:E}=M({type:"http-client",limit:50,filters:p}),i=x.filter(e=>S(e)),b=v.useMemo(()=>[{key:"method",header:"Method",width:"90px",render:e=>t.jsx(n,{onClick:a=>{a.stopPropagation(),s("methods",e.payload.method)},className:"font-mono",children:e.payload.method})},{key:"status",header:"Status",width:"80px",render:e=>t.jsx(n,{onClick:a=>{a.stopPropagation();const T=e.payload.statusCode?String(e.payload.statusCode):"ERR";s("statuses",T)},children:e.payload.statusCode||"ERR"})},{key:"hostname",header:"Host",width:"180px",render:e=>e.payload.hostname?t.jsx(n,{onClick:a=>{a.stopPropagation(),s("hostnames",e.payload.hostname)},className:"font-mono",children:e.payload.hostname}):t.jsx(l,{secondary:!0,children:"-"})},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(l,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.path||e.payload.url})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(W,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(l,{secondary:!0,className:"text-xs",children:D(F(e.createdAt),{addSuffix:!0})})}],[s]);if(g&&i.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const P=m?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(A,{title:"HTTP Client",icon:d,iconColor:"text-cyan-600 dark:text-cyan-400",count:i.length,totalCount:r==null?void 0:r.total,refreshing:o,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:N,filters:u,onClearAllFilters:c}),t.jsxs("div",{className:`${P} space-y-4 transition-all duration-200`,children:[t.jsx(B,{count:y,onClick:j,loading:o}),t.jsx($,{columns:b,data:i,keyExtractor:e=>e.id,onRowClick:e=>h(`/http-client/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No outgoing HTTP requests recorded yet",emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(L,{hasMore:f,onClick:C,loading:o})]})]})}export{J as default};
@@ -1 +1 @@
1
- import{j as t,B as l}from"./index-NYfiXmMn.js";import{e as T,b as E}from"./vendor-DBTT3jXp.js";import{u as v,C as i,f as A,p as D}from"./ClickableBadge-Vyx_sMAl.js";import{u as B,P as F,N as M,L as P}from"./PageHeader-gzCjMnIq.js";import{g as R,T as o,D as J,b as q}from"./types-DrGQDdvv.js";function Q(){const n=T(),{clearAll:d,serverFilters:u,headerFilters:c,hasFilters:h}=v("jobs"),{entries:p,loading:m,refreshing:a,newEntriesCount:x,hasMore:y,loadMore:g,loadNew:f,autoRefreshEnabled:j,live:b,setAutoRefresh:w,meta:s,isHighlighted:k}=B({type:"job",limit:50,filters:u}),r=p.filter(e=>R(e)),C=E.useMemo(()=>[{key:"job",header:"Job",minWidth:"200px",render:e=>t.jsx(i,{listType:"jobs",filterType:"names",className:"font-mono",children:e.payload.name})},{key:"queue",header:"Queue",width:"120px",render:e=>t.jsx(i,{listType:"jobs",filterType:"queues",children:e.payload.queue})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(i,{listType:"jobs",filterType:"statuses",children:e.payload.status})},{key:"attempts",header:"Attempts",width:"80px",align:"center",render:e=>t.jsx(o,{secondary:!0,children:e.payload.attempts})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?t.jsx(J,{ms:e.payload.duration}):t.jsx(o,{secondary:!0,children:"—"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:A(D(e.createdAt),{addSuffix:!0})})}],[]);if(m&&r.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const N=h?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(F,{title:"Jobs",icon:l,iconColor:"text-yellow-600 dark:text-yellow-400",count:r.length,totalCount:s==null?void 0:s.total,refreshing:a,autoRefreshEnabled:j,live:b,onAutoRefreshToggle:w,filters:c,onClearAllFilters:d}),t.jsxs("div",{className:`${N} space-y-4 transition-all duration-200`,children:[t.jsx(M,{count:x,onClick:f,loading:a}),t.jsx(q,{columns:C,data:r,keyExtractor:e=>e.id,onRowClick:e=>n(`/jobs/${e.id}`),rowClassName:e=>k(e.id)?"highlight-new":"",emptyMessage:"No jobs recorded yet",emptyIcon:t.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(P,{hasMore:y,onClick:g,loading:a})]})]})}export{Q as default};
1
+ import{j as t,B as l}from"./index-fV4VT_EH.js";import{e as T,b as E}from"./vendor-DBTT3jXp.js";import{u as v,C as i,f as A,p as D}from"./ClickableBadge-DIMjoLzU.js";import{u as B,P as F,N as M,L as P}from"./PageHeader-Dy1i1YMN.js";import{g as R,T as o,D as J,b as q}from"./types-Sj3ahDpV.js";function Q(){const n=T(),{clearAll:d,serverFilters:u,headerFilters:c,hasFilters:h}=v("jobs"),{entries:p,loading:m,refreshing:a,newEntriesCount:x,hasMore:y,loadMore:g,loadNew:f,autoRefreshEnabled:j,live:b,setAutoRefresh:w,meta:s,isHighlighted:k}=B({type:"job",limit:50,filters:u}),r=p.filter(e=>R(e)),C=E.useMemo(()=>[{key:"job",header:"Job",minWidth:"200px",render:e=>t.jsx(i,{listType:"jobs",filterType:"names",className:"font-mono",children:e.payload.name})},{key:"queue",header:"Queue",width:"120px",render:e=>t.jsx(i,{listType:"jobs",filterType:"queues",children:e.payload.queue})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(i,{listType:"jobs",filterType:"statuses",children:e.payload.status})},{key:"attempts",header:"Attempts",width:"80px",align:"center",render:e=>t.jsx(o,{secondary:!0,children:e.payload.attempts})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?t.jsx(J,{ms:e.payload.duration}):t.jsx(o,{secondary:!0,children:"—"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:A(D(e.createdAt),{addSuffix:!0})})}],[]);if(m&&r.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const N=h?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(F,{title:"Jobs",icon:l,iconColor:"text-yellow-600 dark:text-yellow-400",count:r.length,totalCount:s==null?void 0:s.total,refreshing:a,autoRefreshEnabled:j,live:b,onAutoRefreshToggle:w,filters:c,onClearAllFilters:d}),t.jsxs("div",{className:`${N} space-y-4 transition-all duration-200`,children:[t.jsx(M,{count:x,onClick:f,loading:a}),t.jsx(q,{columns:C,data:r,keyExtractor:e=>e.id,onRowClick:e=>n(`/jobs/${e.id}`),rowClassName:e=>k(e.id)?"highlight-new":"",emptyMessage:"No jobs recorded yet",emptyIcon:t.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(P,{hasMore:y,onClick:g,loading:a})]})]})}export{Q as default};
@@ -1 +1 @@
1
- import{j as t,F as l}from"./index-NYfiXmMn.js";import{e as E,b as k}from"./vendor-DBTT3jXp.js";import{u as T,C as i,f as F,p as L}from"./ClickableBadge-Vyx_sMAl.js";import{u as M,P as A,N as P,L as R}from"./PageHeader-gzCjMnIq.js";import{E as B}from"./EntrySearchInput-BjzlyOoC.js";import{e as D,T as o,b as S}from"./types-DrGQDdvv.js";import"./search-C8zDS2B0.js";function J(){const n=E(),{clearAll:d,serverFilters:c,headerFilters:g,hasFilters:x}=T("logs"),{entries:h,loading:m,refreshing:s,newEntriesCount:p,hasMore:u,loadMore:y,loadNew:f,autoRefreshEnabled:j,live:v,setAutoRefresh:C,meta:a,isHighlighted:N}=M({type:"log",limit:50,filters:c}),r=h.filter(e=>D(e)),b=k.useMemo(()=>[{key:"level",header:"Level",width:"100px",render:e=>t.jsx(i,{listType:"logs",filterType:"levels",children:e.payload.level})},{key:"message",header:"Message",minWidth:"300px",render:e=>t.jsx(o,{truncate:!0,maxWidth:"500px",children:e.payload.message.length>100?e.payload.message.substring(0,100)+"...":e.payload.message})},{key:"context",header:"Context",width:"150px",render:e=>e.payload.context?t.jsx(i,{listType:"logs",filterType:"contexts",className:"font-mono",children:e.payload.context}):t.jsx(o,{secondary:!0,children:"—"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:F(L(e.createdAt),{addSuffix:!0})})}],[]);if(m&&r.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const w=x?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(A,{title:"Logs",icon:l,iconColor:"text-green-600 dark:text-green-400",count:r.length,totalCount:a==null?void 0:a.total,refreshing:s,autoRefreshEnabled:j,live:v,onAutoRefreshToggle:C,filters:g,onClearAllFilters:d}),t.jsxs("div",{className:`${w} space-y-4 transition-all duration-200`,children:[t.jsx(B,{placeholder:"Search by message, level, context, tag, or content..."}),t.jsx(P,{count:p,onClick:f,loading:s}),t.jsx(S,{columns:b,data:r,keyExtractor:e=>e.id,onRowClick:e=>n(`/logs/${e.id}`),rowClassName:e=>N(e.id)?"highlight-new":"",emptyMessage:"No logs recorded yet",emptyIcon:t.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(R,{hasMore:u,onClick:y,loading:s})]})]})}export{J as default};
1
+ import{j as t,F as l}from"./index-fV4VT_EH.js";import{e as E,b as k}from"./vendor-DBTT3jXp.js";import{u as T,C as i,f as F,p as L}from"./ClickableBadge-DIMjoLzU.js";import{u as M,P as A,N as P,L as R}from"./PageHeader-Dy1i1YMN.js";import{E as B}from"./EntrySearchInput-Dyav5E5-.js";import{e as D,T as o,b as S}from"./types-Sj3ahDpV.js";import"./search-G_aOCia0.js";function J(){const n=E(),{clearAll:d,serverFilters:c,headerFilters:g,hasFilters:x}=T("logs"),{entries:h,loading:m,refreshing:s,newEntriesCount:p,hasMore:u,loadMore:y,loadNew:f,autoRefreshEnabled:j,live:v,setAutoRefresh:C,meta:a,isHighlighted:N}=M({type:"log",limit:50,filters:c}),r=h.filter(e=>D(e)),b=k.useMemo(()=>[{key:"level",header:"Level",width:"100px",render:e=>t.jsx(i,{listType:"logs",filterType:"levels",children:e.payload.level})},{key:"message",header:"Message",minWidth:"300px",render:e=>t.jsx(o,{truncate:!0,maxWidth:"500px",children:e.payload.message.length>100?e.payload.message.substring(0,100)+"...":e.payload.message})},{key:"context",header:"Context",width:"150px",render:e=>e.payload.context?t.jsx(i,{listType:"logs",filterType:"contexts",className:"font-mono",children:e.payload.context}):t.jsx(o,{secondary:!0,children:"—"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:F(L(e.createdAt),{addSuffix:!0})})}],[]);if(m&&r.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const w=x?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(A,{title:"Logs",icon:l,iconColor:"text-green-600 dark:text-green-400",count:r.length,totalCount:a==null?void 0:a.total,refreshing:s,autoRefreshEnabled:j,live:v,onAutoRefreshToggle:C,filters:g,onClearAllFilters:d}),t.jsxs("div",{className:`${w} space-y-4 transition-all duration-200`,children:[t.jsx(B,{placeholder:"Search by message, level, context, tag, or content..."}),t.jsx(P,{count:p,onClick:f,loading:s}),t.jsx(S,{columns:b,data:r,keyExtractor:e=>e.id,onRowClick:e=>n(`/logs/${e.id}`),rowClassName:e=>N(e.id)?"highlight-new":"",emptyMessage:"No logs recorded yet",emptyIcon:t.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(R,{hasMore:u,onClick:y,loading:s})]})]})}export{J as default};
@@ -1 +1 @@
1
- import{j as t,M as u}from"./index-NYfiXmMn.js";import{e as A,b as D}from"./vendor-DBTT3jXp.js";import{u as F,C as P,f as R,p as L}from"./ClickableBadge-Vyx_sMAl.js";import{u as S,P as W,N as $,L as B}from"./PageHeader-gzCjMnIq.js";import{j as H,T as l,D as q,a as I,b as z}from"./types-DrGQDdvv.js";const G=["sent","failed","pending","queued","error"];function V(){const c=A(),{addFilter:o,clearAll:h,serverFilters:m,headerFilters:g,hasFilters:p}=F("mail"),{entries:x,loading:f,refreshing:s,newEntriesCount:y,hasMore:j,loadMore:b,loadNew:k,autoRefreshEnabled:C,live:w,setAutoRefresh:T,meta:r,isHighlighted:N}=S({type:"mail",limit:50,filters:m}),i=x.filter(e=>H(e)),d=e=>{const a=Array.isArray(e)?e:[e];return a.length===1?a[0]:`${a[0]} +${a.length-1}`},E=D.useMemo(()=>[{key:"status",header:"Status",width:"80px",render:e=>t.jsx(P,{listType:"mail",filterType:"statuses",children:e.payload.status})},{key:"subject",header:"Subject",minWidth:"250px",render:e=>t.jsx(l,{truncate:!0,maxWidth:"350px",children:e.payload.subject.length>60?e.payload.subject.substring(0,60)+"...":e.payload.subject})},{key:"to",header:"To",width:"200px",render:e=>t.jsx(l,{mono:!0,secondary:!0,truncate:!0,maxWidth:"180px",children:d(e.payload.to)})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(q,{ms:e.payload.duration||0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const a=(e.tags||[]).filter(n=>!G.includes(n.toLowerCase()));return t.jsx(I,{tags:a,max:3,onTagClick:(n,v)=>{v.stopPropagation(),o("tags",n)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(l,{secondary:!0,className:"text-xs",children:R(L(e.createdAt),{addSuffix:!0})})}],[o,d]);if(f&&i.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const M=p?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(W,{title:"Mail",icon:u,iconColor:"text-pink-600 dark:text-pink-400",count:i.length,totalCount:r==null?void 0:r.total,refreshing:s,autoRefreshEnabled:C,live:w,onAutoRefreshToggle:T,filters:g,onClearAllFilters:h}),t.jsxs("div",{className:`${M} space-y-4 transition-all duration-200`,children:[t.jsx($,{count:y,onClick:k,loading:s}),t.jsx(z,{columns:E,data:i,keyExtractor:e=>e.id,onRowClick:e=>c(`/mail/${e.id}`),rowClassName:e=>N(e.id)?"highlight-new":"",emptyMessage:"No emails recorded yet",emptyIcon:t.jsx(u,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(B,{hasMore:j,onClick:b,loading:s})]})]})}export{V as default};
1
+ import{j as t,M as u}from"./index-fV4VT_EH.js";import{e as A,b as D}from"./vendor-DBTT3jXp.js";import{u as F,C as P,f as R,p as L}from"./ClickableBadge-DIMjoLzU.js";import{u as S,P as W,N as $,L as B}from"./PageHeader-Dy1i1YMN.js";import{j as H,T as l,D as q,a as I,b as z}from"./types-Sj3ahDpV.js";const G=["sent","failed","pending","queued","error"];function V(){const c=A(),{addFilter:o,clearAll:h,serverFilters:m,headerFilters:g,hasFilters:p}=F("mail"),{entries:x,loading:f,refreshing:s,newEntriesCount:y,hasMore:j,loadMore:b,loadNew:k,autoRefreshEnabled:C,live:w,setAutoRefresh:T,meta:r,isHighlighted:N}=S({type:"mail",limit:50,filters:m}),i=x.filter(e=>H(e)),d=e=>{const a=Array.isArray(e)?e:[e];return a.length===1?a[0]:`${a[0]} +${a.length-1}`},E=D.useMemo(()=>[{key:"status",header:"Status",width:"80px",render:e=>t.jsx(P,{listType:"mail",filterType:"statuses",children:e.payload.status})},{key:"subject",header:"Subject",minWidth:"250px",render:e=>t.jsx(l,{truncate:!0,maxWidth:"350px",children:e.payload.subject.length>60?e.payload.subject.substring(0,60)+"...":e.payload.subject})},{key:"to",header:"To",width:"200px",render:e=>t.jsx(l,{mono:!0,secondary:!0,truncate:!0,maxWidth:"180px",children:d(e.payload.to)})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(q,{ms:e.payload.duration||0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const a=(e.tags||[]).filter(n=>!G.includes(n.toLowerCase()));return t.jsx(I,{tags:a,max:3,onTagClick:(n,v)=>{v.stopPropagation(),o("tags",n)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(l,{secondary:!0,className:"text-xs",children:R(L(e.createdAt),{addSuffix:!0})})}],[o,d]);if(f&&i.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const M=p?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(W,{title:"Mail",icon:u,iconColor:"text-pink-600 dark:text-pink-400",count:i.length,totalCount:r==null?void 0:r.total,refreshing:s,autoRefreshEnabled:C,live:w,onAutoRefreshToggle:T,filters:g,onClearAllFilters:h}),t.jsxs("div",{className:`${M} space-y-4 transition-all duration-200`,children:[t.jsx($,{count:y,onClick:k,loading:s}),t.jsx(z,{columns:E,data:i,keyExtractor:e=>e.id,onRowClick:e=>c(`/mail/${e.id}`),rowClassName:e=>N(e.id)?"highlight-new":"",emptyMessage:"No emails recorded yet",emptyIcon:t.jsx(u,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(B,{hasMore:j,onClick:b,loading:s})]})]})}export{V as default};
@@ -1 +1 @@
1
- import{j as a,b as d}from"./index-NYfiXmMn.js";import{e as M,b as P}from"./vendor-DBTT3jXp.js";import{u as A,C as l,f as D,p as F}from"./ClickableBadge-Vyx_sMAl.js";import{u as R,P as T,N as B,L}from"./PageHeader-gzCjMnIq.js";import{n as H,T as o,D as S,b as $}from"./types-DrGQDdvv.js";function J(){const c=M(),{addFilter:r,clearAll:p,serverFilters:u,headerFilters:h,hasFilters:x}=A("models"),{entries:m,loading:g,refreshing:s,newEntriesCount:y,hasMore:f,loadMore:j,loadNew:C,autoRefreshEnabled:k,live:w,setAutoRefresh:N,meta:i,isHighlighted:b}=R({type:"model",limit:50,filters:u}),n=m.filter(e=>H(e)),E=P.useMemo(()=>[{key:"action",header:"Action",width:"120px",render:e=>a.jsx(l,{onClick:t=>{t.stopPropagation(),r("actions",e.payload.action)},children:e.payload.action.toUpperCase()})},{key:"entity",header:"Entity",width:"150px",render:e=>a.jsx(l,{onClick:t=>{t.stopPropagation(),r("entities",e.payload.entity)},className:"font-mono",children:e.payload.entity})},{key:"source",header:"Source",width:"150px",render:e=>e.payload.source?a.jsx(l,{onClick:t=>{t.stopPropagation(),r("sources",e.payload.source)},className:"font-mono text-xs",children:e.payload.source}):a.jsx(o,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(S,{ms:e.payload.duration||0})},{key:"records",header:"Records",width:"80px",align:"center",render:e=>e.payload.recordCount!==void 0?a.jsx(o,{children:e.payload.recordCount}):a.jsx(o,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(o,{secondary:!0,className:"text-xs",children:D(F(e.createdAt),{addSuffix:!0})})}],[r]);if(g&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const v=x?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(T,{title:"Models",icon:d,iconColor:"text-purple-600 dark:text-purple-400",count:n.length,totalCount:i==null?void 0:i.total,refreshing:s,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:N,filters:h,onClearAllFilters:p}),a.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[a.jsx(B,{count:y,onClick:C,loading:s}),a.jsx($,{columns:E,data:n,keyExtractor:e=>e.id,onRowClick:e=>c(`/models/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No model events recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(L,{hasMore:f,onClick:j,loading:s})]})]})}export{J as default};
1
+ import{j as a,b as d}from"./index-fV4VT_EH.js";import{e as M,b as P}from"./vendor-DBTT3jXp.js";import{u as A,C as l,f as D,p as F}from"./ClickableBadge-DIMjoLzU.js";import{u as R,P as T,N as B,L}from"./PageHeader-Dy1i1YMN.js";import{n as H,T as o,D as S,b as $}from"./types-Sj3ahDpV.js";function J(){const c=M(),{addFilter:r,clearAll:p,serverFilters:u,headerFilters:h,hasFilters:x}=A("models"),{entries:m,loading:g,refreshing:s,newEntriesCount:y,hasMore:f,loadMore:j,loadNew:C,autoRefreshEnabled:k,live:w,setAutoRefresh:N,meta:i,isHighlighted:b}=R({type:"model",limit:50,filters:u}),n=m.filter(e=>H(e)),E=P.useMemo(()=>[{key:"action",header:"Action",width:"120px",render:e=>a.jsx(l,{onClick:t=>{t.stopPropagation(),r("actions",e.payload.action)},children:e.payload.action.toUpperCase()})},{key:"entity",header:"Entity",width:"150px",render:e=>a.jsx(l,{onClick:t=>{t.stopPropagation(),r("entities",e.payload.entity)},className:"font-mono",children:e.payload.entity})},{key:"source",header:"Source",width:"150px",render:e=>e.payload.source?a.jsx(l,{onClick:t=>{t.stopPropagation(),r("sources",e.payload.source)},className:"font-mono text-xs",children:e.payload.source}):a.jsx(o,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(S,{ms:e.payload.duration||0})},{key:"records",header:"Records",width:"80px",align:"center",render:e=>e.payload.recordCount!==void 0?a.jsx(o,{children:e.payload.recordCount}):a.jsx(o,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(o,{secondary:!0,className:"text-xs",children:D(F(e.createdAt),{addSuffix:!0})})}],[r]);if(g&&n.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const v=x?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(T,{title:"Models",icon:d,iconColor:"text-purple-600 dark:text-purple-400",count:n.length,totalCount:i==null?void 0:i.total,refreshing:s,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:N,filters:h,onClearAllFilters:p}),a.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[a.jsx(B,{count:y,onClick:C,loading:s}),a.jsx($,{columns:E,data:n,keyExtractor:e=>e.id,onRowClick:e=>c(`/models/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No model events recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(L,{hasMore:f,onClick:j,loading:s})]})]})}export{J as default};
@@ -1 +1 @@
1
- import{j as t,e as l}from"./index-NYfiXmMn.js";import{e as T,b as P}from"./vendor-DBTT3jXp.js";import{u as D,C as d,f as F,p as R}from"./ClickableBadge-Vyx_sMAl.js";import{u as A,P as M,N as B,L as W}from"./PageHeader-gzCjMnIq.js";import{o as L,T as a,D as H,b as S}from"./types-DrGQDdvv.js";function G(){const c=T(),{addFilter:i,clearAll:p,serverFilters:u,headerFilters:h,hasFilters:x}=D("notifications"),{entries:m,loading:g,refreshing:r,newEntriesCount:y,hasMore:f,loadMore:j,loadNew:C,autoRefreshEnabled:k,live:N,setAutoRefresh:w,meta:s,isHighlighted:b}=A({type:"notification",limit:50,filters:u}),o=m.filter(e=>L(e)),E=P.useMemo(()=>[{key:"type",header:"Type",width:"150px",render:e=>t.jsx(d,{onClick:n=>{n.stopPropagation(),i("types",e.payload.type)},children:e.payload.type})},{key:"recipient",header:"Recipient",minWidth:"200px",render:e=>t.jsx(a,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.recipient})},{key:"title",header:"Title",minWidth:"200px",render:e=>e.payload.title?t.jsx(a,{truncate:!0,maxWidth:"300px",children:e.payload.title}):t.jsx(a,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(d,{onClick:n=>{n.stopPropagation(),i("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(H,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:F(R(e.createdAt),{addSuffix:!0})})}],[i]);if(g&&o.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const v=x?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(M,{title:"Notifications",icon:l,iconColor:"text-indigo-600 dark:text-indigo-400",count:o.length,totalCount:s==null?void 0:s.total,refreshing:r,autoRefreshEnabled:k,live:N,onAutoRefreshToggle:w,filters:h,onClearAllFilters:p}),t.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[t.jsx(B,{count:y,onClick:C,loading:r}),t.jsx(S,{columns:E,data:o,keyExtractor:e=>e.id,onRowClick:e=>c(`/notifications/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No notifications recorded yet",emptyIcon:t.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(W,{hasMore:f,onClick:j,loading:r})]})]})}export{G as default};
1
+ import{j as t,e as l}from"./index-fV4VT_EH.js";import{e as T,b as P}from"./vendor-DBTT3jXp.js";import{u as D,C as d,f as F,p as R}from"./ClickableBadge-DIMjoLzU.js";import{u as A,P as M,N as B,L as W}from"./PageHeader-Dy1i1YMN.js";import{o as L,T as a,D as H,b as S}from"./types-Sj3ahDpV.js";function G(){const c=T(),{addFilter:i,clearAll:p,serverFilters:u,headerFilters:h,hasFilters:x}=D("notifications"),{entries:m,loading:g,refreshing:r,newEntriesCount:y,hasMore:f,loadMore:j,loadNew:C,autoRefreshEnabled:k,live:N,setAutoRefresh:w,meta:s,isHighlighted:b}=A({type:"notification",limit:50,filters:u}),o=m.filter(e=>L(e)),E=P.useMemo(()=>[{key:"type",header:"Type",width:"150px",render:e=>t.jsx(d,{onClick:n=>{n.stopPropagation(),i("types",e.payload.type)},children:e.payload.type})},{key:"recipient",header:"Recipient",minWidth:"200px",render:e=>t.jsx(a,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.recipient})},{key:"title",header:"Title",minWidth:"200px",render:e=>e.payload.title?t.jsx(a,{truncate:!0,maxWidth:"300px",children:e.payload.title}):t.jsx(a,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(d,{onClick:n=>{n.stopPropagation(),i("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(H,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:F(R(e.createdAt),{addSuffix:!0})})}],[i]);if(g&&o.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const v=x?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(M,{title:"Notifications",icon:l,iconColor:"text-indigo-600 dark:text-indigo-400",count:o.length,totalCount:s==null?void 0:s.total,refreshing:r,autoRefreshEnabled:k,live:N,onAutoRefreshToggle:w,filters:h,onClearAllFilters:p}),t.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[t.jsx(B,{count:y,onClick:C,loading:r}),t.jsx(S,{columns:E,data:o,keyExtractor:e=>e.id,onRowClick:e=>c(`/notifications/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No notifications recorded yet",emptyIcon:t.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(W,{hasMore:f,onClick:j,loading:r})]})]})}export{G as default};
@@ -1 +1 @@
1
- import{b as a}from"./vendor-DBTT3jXp.js";import{p as Z,m as F,z as $,q as ee,s as _,j as r,i as D,e as re,t as te,X as ae}from"./index-NYfiXmMn.js";function se(){return Z("/stream")}function ne(s,t=!0){const n=a.useRef(s),[i,g]=a.useState(!1);return a.useEffect(()=>{n.current=s},[s]),a.useEffect(()=>{if(!t||typeof EventSource>"u")return;const l=new EventSource(se(),{withCredentials:!0}),x=p=>{try{n.current(JSON.parse(p.data))}catch{}};return l.addEventListener("entry",x),l.onopen=()=>g(!0),l.onerror=()=>g(!1),()=>{l.removeEventListener("entry",x),l.close(),g(!1)}},[t]),{connected:i}}function O(s){return s==null?"":typeof s!="object"?String(s):Array.isArray(s)?"["+s.map(O).join(",")+"]":"{"+Object.keys(s).sort().map(n=>`"${n}":${O(s[n])}`).join(",")+"}"}const z="nestlens-auto-refresh";function ce(){try{const s=localStorage.getItem(z);return s===null?!0:s==="true"}catch{return!0}}function ie(s){try{localStorage.setItem(z,String(s))}catch{}}function de(s={}){const{type:t,limit:n=50,autoRefresh:i,autoRefreshInterval:g=5e3,filters:l}=s,x=O(l),[p,y]=a.useState([]),[w,R]=a.useState(!0),[A,m]=a.useState(!1),[L,j]=a.useState(null),[u,N]=a.useState(null),[S,k]=a.useState(0),[d,b]=a.useState(i??ce()),o=a.useRef(null),v=a.useRef(null),H=a.useRef(!0),B=a.useRef(x),C=a.useRef(new Map),[,G]=a.useState(0),T=1e4,M=a.useCallback(async()=>{H.current?R(!0):m(!0);try{j(null);const e=await F({type:t,limit:n,filters:l});y(e.data),N(e.meta),o.current=e.meta.newestSequence,k(0),H.current=!1,B.current=x}catch(e){const c=e instanceof Error?e:new Error("Failed to fetch entries");j(c),console.error("Failed to fetch entries:",e),$.error("Failed to load entries")}finally{R(!1),m(!1)}},[t,n,x]),K=a.useCallback(async()=>{if(!(!(u!=null&&u.oldestSequence)||!u.hasMore)){m(!0);try{const e=await F({type:t,limit:n,beforeSequence:u.oldestSequence,filters:l});y(c=>[...c,...e.data]),N(e.meta)}catch(e){console.error("Failed to load more entries:",e),$.error("Failed to load more entries")}finally{m(!1)}}},[t,n,u,x]),P=a.useCallback(async()=>{if(o.current){m(!0);try{const e=await F({type:t,limit:S||n,afterSequence:o.current,filters:l});if(e.data.length>0){const c=Date.now();e.data.forEach(f=>{C.current.set(f.id,c)}),y(f=>[...e.data,...f]),o.current=e.meta.newestSequence,k(0)}}catch(e){console.error("Failed to load new entries:",e),$.error("Failed to load new entries")}finally{m(!1)}}},[t,n,S,x]),J=a.useCallback(async()=>{m(!0);try{j(null);const e=await F({type:t,limit:n,filters:l});y(e.data),N(e.meta),o.current=e.meta.newestSequence,k(0)}catch(e){const c=e instanceof Error?e:new Error("Failed to refresh entries");j(c),console.error("Failed to refresh entries:",e),$.error("Failed to refresh entries")}finally{m(!1)}},[t,n,x]),q=a.useCallback(async()=>{if(!o.current){try{(await ee(t)).data&&k(1)}catch{}return}try{const e=await _(o.current,t);k(e.data.count)}catch{}},[t]),W=a.useCallback(e=>{b(e),ie(e)},[]),X=a.useCallback(e=>{y(c=>c.map(f=>f.id===e.id?e:f))},[]);a.useEffect(()=>{M()},[M]);const Y=a.useCallback(e=>{const c=C.current.get(e);return c?Date.now()-c<T:!1},[]),U=a.useCallback(()=>{const e=Date.now();let c=!1;C.current.forEach((f,h)=>{e-f>=T&&(C.current.delete(h),c=!0)}),c&&G(f=>f+1)},[]),I=a.useCallback(async()=>{if(o.current)try{const e=await _(o.current,t);if(e.data.count>0){const c=await F({type:t,limit:e.data.count,afterSequence:o.current,filters:l});if(c.data.length>0){const f=Date.now();c.data.forEach(h=>{C.current.set(h.id,f)}),y(h=>[...c.data,...h]),o.current=c.meta.newestSequence,N(h=>h?{...h,total:h.total+c.data.length,newestSequence:c.meta.newestSequence}:c.meta)}}}catch{}},[t,x]);a.useEffect(()=>(d?v.current=setInterval(I,g):v.current=setInterval(q,g),()=>{v.current&&(clearInterval(v.current),v.current=null)}),[d,g,I,q]),a.useEffect(()=>{const e=setInterval(U,1e3);return()=>clearInterval(e)},[U]);const E=a.useRef(null),Q=a.useCallback(e=>{t&&e.type!==t||E.current||(E.current=setTimeout(()=>{E.current=null,d?I():q()},200))},[t,d,I,q]),{connected:V}=ne(Q);return a.useEffect(()=>()=>{E.current&&(clearTimeout(E.current),E.current=null)},[]),{entries:p,loading:w,refreshing:A,error:L,meta:u,newEntriesCount:S,hasMore:(u==null?void 0:u.hasMore)??!1,loadMore:K,loadNew:P,refresh:J,setAutoRefresh:W,autoRefreshEnabled:d,updateEntry:X,isHighlighted:Y,live:V}}function ue({count:s,onClick:t,loading:n}){return s===0?null:r.jsxs("button",{onClick:t,disabled:n,className:"w-full py-3 px-4 bg-primary-50 dark:bg-primary-900/20 text-primary-600 dark:text-primary-400 font-medium rounded-lg hover:bg-primary-100 dark:hover:bg-primary-900/30 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?r.jsx(D,{className:"h-4 w-4 animate-spin"}):r.jsx(re,{className:"h-4 w-4"}),r.jsxs("span",{children:["Load ",s," new ",s===1?"entry":"entries"]})]})}function ge({hasMore:s,onClick:t,loading:n}){return s?r.jsxs("button",{onClick:t,disabled:n,className:"w-full py-3 px-4 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-medium rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?r.jsx(D,{className:"h-4 w-4 animate-spin"}):r.jsx(te,{className:"h-4 w-4"}),r.jsx("span",{children:"Load older entries"})]}):null}function xe({title:s,icon:t,iconColor:n="text-primary-600 dark:text-primary-400",count:i,totalCount:g,subtitle:l,loading:x,refreshing:p,onRefresh:y,autoRefreshEnabled:w,onAutoRefreshToggle:R,live:A,filters:m=[],onClearAllFilters:L,actions:j,filterControls:u}){const N=m.length>0,S=i??g,k=m.reduce((d,b)=>(d[b.category]||(d[b.category]=[]),d[b.category].push(b),d),{});return r.jsxs("div",{className:"fixed top-0 left-0 right-0 lg:left-64 z-30 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",children:[r.jsxs("div",{className:"h-16 px-4 lg:px-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"hidden sm:flex p-2 rounded-lg bg-gray-100 dark:bg-gray-800",children:r.jsx(t,{className:`h-5 w-5 ${n}`})}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:s}),S!==void 0&&r.jsxs("span",{role:"status","aria-live":"polite",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-300",children:[S.toLocaleString(),g!==void 0&&i!==void 0&&i!==g&&r.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ml-1",children:["/ ",g.toLocaleString()]})]}),l&&r.jsx("span",{className:"hidden md:inline text-sm text-gray-500 dark:text-gray-400",children:l})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[j,A&&r.jsxs("span",{"data-testid":"live-indicator",className:"hidden sm:flex items-center space-x-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-600 dark:bg-red-900/20 dark:text-red-400",title:"Live — entries stream in real time",children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),r.jsx("span",{children:"Live"})]}),R&&r.jsxs("button",{onClick:()=>R(!w),className:`hidden sm:flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors whitespace-nowrap ${w?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,title:w?"Auto-refresh enabled":"Auto-refresh disabled",children:[r.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${w?"bg-green-500 animate-pulse":"bg-gray-400"}`}),r.jsx("span",{children:"Auto Refresh"})]}),y&&r.jsx("button",{onClick:y,disabled:x||p,"aria-busy":p,"aria-label":p?"Refreshing...":"Refresh",className:"p-2 rounded-lg text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh",children:r.jsx(D,{className:`h-4 w-4 ${p?"animate-spin":""}`})})]})]}),u&&r.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:u}),N&&r.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:r.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mr-1",children:"Filters:"}),Object.entries(k).map(([d,b])=>r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:[d,":"]}),b.map((o,v)=>r.jsxs("button",{onClick:o.onRemove,"aria-label":`Remove ${d} filter: ${o.value}`,className:"inline-flex items-center space-x-1 px-2 py-0.5 rounded-md text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 hover:bg-primary-200 dark:hover:bg-primary-900/50 transition-colors group uppercase",children:[r.jsx("span",{children:o.value}),r.jsx(ae,{className:"h-3 w-3 opacity-60 group-hover:opacity-100"})]},`${o.category}-${o.value}-${v}`))]},d)),L&&m.length>1&&r.jsx("button",{onClick:L,className:"ml-2 text-xs text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",children:"Clear all"})]})})]})}function me({tabs:s,activeTab:t,onChange:n}){return r.jsx("div",{className:"flex items-center space-x-1",children:s.map(i=>r.jsxs("button",{onClick:()=>n(i.id),className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${t===i.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/50 dark:text-primary-300":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:[i.label,i.count!==void 0&&r.jsx("span",{className:`ml-1.5 text-xs ${t===i.id?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500"}`,children:i.count})]},i.id))})}function fe({label:s,enabled:t,onChange:n,icon:i}){return r.jsxs("button",{onClick:()=>n(!t),className:`flex items-center space-x-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${t?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[i&&r.jsx(i,{className:"h-4 w-4"}),r.jsx("span",{children:s})]})}export{me as F,ge as L,ue as N,xe as P,fe as T,de as u};
1
+ import{b as a}from"./vendor-DBTT3jXp.js";import{p as Z,m as F,z as $,q as ee,s as _,j as r,i as D,e as re,t as te,X as ae}from"./index-fV4VT_EH.js";function se(){return Z("/stream")}function ne(s,t=!0){const n=a.useRef(s),[i,g]=a.useState(!1);return a.useEffect(()=>{n.current=s},[s]),a.useEffect(()=>{if(!t||typeof EventSource>"u")return;const l=new EventSource(se(),{withCredentials:!0}),x=p=>{try{n.current(JSON.parse(p.data))}catch{}};return l.addEventListener("entry",x),l.onopen=()=>g(!0),l.onerror=()=>g(!1),()=>{l.removeEventListener("entry",x),l.close(),g(!1)}},[t]),{connected:i}}function O(s){return s==null?"":typeof s!="object"?String(s):Array.isArray(s)?"["+s.map(O).join(",")+"]":"{"+Object.keys(s).sort().map(n=>`"${n}":${O(s[n])}`).join(",")+"}"}const z="nestlens-auto-refresh";function ce(){try{const s=localStorage.getItem(z);return s===null?!0:s==="true"}catch{return!0}}function ie(s){try{localStorage.setItem(z,String(s))}catch{}}function de(s={}){const{type:t,limit:n=50,autoRefresh:i,autoRefreshInterval:g=5e3,filters:l}=s,x=O(l),[p,y]=a.useState([]),[w,R]=a.useState(!0),[A,m]=a.useState(!1),[L,j]=a.useState(null),[u,N]=a.useState(null),[S,k]=a.useState(0),[d,b]=a.useState(i??ce()),o=a.useRef(null),v=a.useRef(null),H=a.useRef(!0),B=a.useRef(x),C=a.useRef(new Map),[,G]=a.useState(0),T=1e4,M=a.useCallback(async()=>{H.current?R(!0):m(!0);try{j(null);const e=await F({type:t,limit:n,filters:l});y(e.data),N(e.meta),o.current=e.meta.newestSequence,k(0),H.current=!1,B.current=x}catch(e){const c=e instanceof Error?e:new Error("Failed to fetch entries");j(c),console.error("Failed to fetch entries:",e),$.error("Failed to load entries")}finally{R(!1),m(!1)}},[t,n,x]),K=a.useCallback(async()=>{if(!(!(u!=null&&u.oldestSequence)||!u.hasMore)){m(!0);try{const e=await F({type:t,limit:n,beforeSequence:u.oldestSequence,filters:l});y(c=>[...c,...e.data]),N(e.meta)}catch(e){console.error("Failed to load more entries:",e),$.error("Failed to load more entries")}finally{m(!1)}}},[t,n,u,x]),P=a.useCallback(async()=>{if(o.current){m(!0);try{const e=await F({type:t,limit:S||n,afterSequence:o.current,filters:l});if(e.data.length>0){const c=Date.now();e.data.forEach(f=>{C.current.set(f.id,c)}),y(f=>[...e.data,...f]),o.current=e.meta.newestSequence,k(0)}}catch(e){console.error("Failed to load new entries:",e),$.error("Failed to load new entries")}finally{m(!1)}}},[t,n,S,x]),J=a.useCallback(async()=>{m(!0);try{j(null);const e=await F({type:t,limit:n,filters:l});y(e.data),N(e.meta),o.current=e.meta.newestSequence,k(0)}catch(e){const c=e instanceof Error?e:new Error("Failed to refresh entries");j(c),console.error("Failed to refresh entries:",e),$.error("Failed to refresh entries")}finally{m(!1)}},[t,n,x]),q=a.useCallback(async()=>{if(!o.current){try{(await ee(t)).data&&k(1)}catch{}return}try{const e=await _(o.current,t);k(e.data.count)}catch{}},[t]),W=a.useCallback(e=>{b(e),ie(e)},[]),X=a.useCallback(e=>{y(c=>c.map(f=>f.id===e.id?e:f))},[]);a.useEffect(()=>{M()},[M]);const Y=a.useCallback(e=>{const c=C.current.get(e);return c?Date.now()-c<T:!1},[]),U=a.useCallback(()=>{const e=Date.now();let c=!1;C.current.forEach((f,h)=>{e-f>=T&&(C.current.delete(h),c=!0)}),c&&G(f=>f+1)},[]),I=a.useCallback(async()=>{if(o.current)try{const e=await _(o.current,t);if(e.data.count>0){const c=await F({type:t,limit:e.data.count,afterSequence:o.current,filters:l});if(c.data.length>0){const f=Date.now();c.data.forEach(h=>{C.current.set(h.id,f)}),y(h=>[...c.data,...h]),o.current=c.meta.newestSequence,N(h=>h?{...h,total:h.total+c.data.length,newestSequence:c.meta.newestSequence}:c.meta)}}}catch{}},[t,x]);a.useEffect(()=>(d?v.current=setInterval(I,g):v.current=setInterval(q,g),()=>{v.current&&(clearInterval(v.current),v.current=null)}),[d,g,I,q]),a.useEffect(()=>{const e=setInterval(U,1e3);return()=>clearInterval(e)},[U]);const E=a.useRef(null),Q=a.useCallback(e=>{t&&e.type!==t||E.current||(E.current=setTimeout(()=>{E.current=null,d?I():q()},200))},[t,d,I,q]),{connected:V}=ne(Q);return a.useEffect(()=>()=>{E.current&&(clearTimeout(E.current),E.current=null)},[]),{entries:p,loading:w,refreshing:A,error:L,meta:u,newEntriesCount:S,hasMore:(u==null?void 0:u.hasMore)??!1,loadMore:K,loadNew:P,refresh:J,setAutoRefresh:W,autoRefreshEnabled:d,updateEntry:X,isHighlighted:Y,live:V}}function ue({count:s,onClick:t,loading:n}){return s===0?null:r.jsxs("button",{onClick:t,disabled:n,className:"w-full py-3 px-4 bg-primary-50 dark:bg-primary-900/20 text-primary-600 dark:text-primary-400 font-medium rounded-lg hover:bg-primary-100 dark:hover:bg-primary-900/30 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?r.jsx(D,{className:"h-4 w-4 animate-spin"}):r.jsx(re,{className:"h-4 w-4"}),r.jsxs("span",{children:["Load ",s," new ",s===1?"entry":"entries"]})]})}function ge({hasMore:s,onClick:t,loading:n}){return s?r.jsxs("button",{onClick:t,disabled:n,className:"w-full py-3 px-4 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-medium rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?r.jsx(D,{className:"h-4 w-4 animate-spin"}):r.jsx(te,{className:"h-4 w-4"}),r.jsx("span",{children:"Load older entries"})]}):null}function xe({title:s,icon:t,iconColor:n="text-primary-600 dark:text-primary-400",count:i,totalCount:g,subtitle:l,loading:x,refreshing:p,onRefresh:y,autoRefreshEnabled:w,onAutoRefreshToggle:R,live:A,filters:m=[],onClearAllFilters:L,actions:j,filterControls:u}){const N=m.length>0,S=i??g,k=m.reduce((d,b)=>(d[b.category]||(d[b.category]=[]),d[b.category].push(b),d),{});return r.jsxs("div",{className:"fixed top-0 left-0 right-0 lg:left-64 z-30 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",children:[r.jsxs("div",{className:"h-16 px-4 lg:px-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"hidden sm:flex p-2 rounded-lg bg-gray-100 dark:bg-gray-800",children:r.jsx(t,{className:`h-5 w-5 ${n}`})}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:s}),S!==void 0&&r.jsxs("span",{role:"status","aria-live":"polite",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-300",children:[S.toLocaleString(),g!==void 0&&i!==void 0&&i!==g&&r.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ml-1",children:["/ ",g.toLocaleString()]})]}),l&&r.jsx("span",{className:"hidden md:inline text-sm text-gray-500 dark:text-gray-400",children:l})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[j,A&&r.jsxs("span",{"data-testid":"live-indicator",className:"hidden sm:flex items-center space-x-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-600 dark:bg-red-900/20 dark:text-red-400",title:"Live — entries stream in real time",children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),r.jsx("span",{children:"Live"})]}),R&&r.jsxs("button",{onClick:()=>R(!w),className:`hidden sm:flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors whitespace-nowrap ${w?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,title:w?"Auto-refresh enabled":"Auto-refresh disabled",children:[r.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${w?"bg-green-500 animate-pulse":"bg-gray-400"}`}),r.jsx("span",{children:"Auto Refresh"})]}),y&&r.jsx("button",{onClick:y,disabled:x||p,"aria-busy":p,"aria-label":p?"Refreshing...":"Refresh",className:"p-2 rounded-lg text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh",children:r.jsx(D,{className:`h-4 w-4 ${p?"animate-spin":""}`})})]})]}),u&&r.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:u}),N&&r.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:r.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mr-1",children:"Filters:"}),Object.entries(k).map(([d,b])=>r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:[d,":"]}),b.map((o,v)=>r.jsxs("button",{onClick:o.onRemove,"aria-label":`Remove ${d} filter: ${o.value}`,className:"inline-flex items-center space-x-1 px-2 py-0.5 rounded-md text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 hover:bg-primary-200 dark:hover:bg-primary-900/50 transition-colors group uppercase",children:[r.jsx("span",{children:o.value}),r.jsx(ae,{className:"h-3 w-3 opacity-60 group-hover:opacity-100"})]},`${o.category}-${o.value}-${v}`))]},d)),L&&m.length>1&&r.jsx("button",{onClick:L,className:"ml-2 text-xs text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",children:"Clear all"})]})})]})}function me({tabs:s,activeTab:t,onChange:n}){return r.jsx("div",{className:"flex items-center space-x-1",children:s.map(i=>r.jsxs("button",{onClick:()=>n(i.id),className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${t===i.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/50 dark:text-primary-300":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:[i.label,i.count!==void 0&&r.jsx("span",{className:`ml-1.5 text-xs ${t===i.id?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500"}`,children:i.count})]},i.id))})}function fe({label:s,enabled:t,onChange:n,icon:i}){return r.jsxs("button",{onClick:()=>n(!t),className:`flex items-center space-x-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${t?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[i&&r.jsx(i,{className:"h-4 w-4"}),r.jsx("span",{children:s})]})}export{me as F,ge as L,ue as N,xe as P,fe as T,de as u};
@@ -1 +1 @@
1
- import{j as a,D as n}from"./index-NYfiXmMn.js";import{e as A,b as d}from"./vendor-DBTT3jXp.js";import{u as M,C as Q,f as R,p as B}from"./ClickableBadge-Vyx_sMAl.js";import{u as O,P as W,T as H,N as I,L as Z}from"./PageHeader-gzCjMnIq.js";import{E as $}from"./EntrySearchInput-BjzlyOoC.js";import{c as z,T as u,D as G,a as J,b as K}from"./types-DrGQDdvv.js";import{Z as c}from"./zap-DXGDS502.js";import"./search-C8zDS2B0.js";function te(){const h=A(),[i,p]=d.useState(!1),{addFilter:l,clearAll:x,serverFilters:m,headerFilters:g,hasFilters:y}=M("queries"),f={...m,slow:i?!0:void 0},{entries:w,loading:j,refreshing:s,newEntriesCount:b,hasMore:C,loadMore:k,loadNew:T,autoRefreshEnabled:N,live:v,setAutoRefresh:E,meta:t,isHighlighted:S}=O({type:"query",limit:50,filters:f}),r=w.filter(e=>z(e)),q=d.useMemo(()=>[{key:"source",header:"Source",width:"120px",render:e=>a.jsx(Q,{listType:"queries",filterType:"sources",children:e.payload.source||"unknown"})},{key:"query",header:"Query",minWidth:"300px",render:e=>a.jsxs("div",{className:"flex items-start space-x-2",children:[e.payload.slow&&a.jsx(c,{className:"h-4 w-4 text-yellow-500 flex-shrink-0 mt-0.5"}),a.jsx(u,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.query.length>100?e.payload.query.substring(0,100)+"...":e.payload.query})]})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(G,{ms:e.payload.duration||0,slowThreshold:e.payload.slow?0:1e3})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const F=(e.payload.source||"unknown").toLowerCase(),L=(e.tags||[]).filter(o=>o.toLowerCase()!==F);return a.jsx(J,{tags:L,max:3,onTagClick:(o,P)=>{P.stopPropagation(),l("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(u,{secondary:!0,className:"text-xs",children:R(B(e.createdAt),{addSuffix:!0})})}],[l]);if(j&&r.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const D=y?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(W,{title:"Queries",icon:n,iconColor:"text-purple-600 dark:text-purple-400",count:r.length,totalCount:t==null?void 0:t.total,refreshing:s,autoRefreshEnabled:N,live:v,onAutoRefreshToggle:E,filters:g,onClearAllFilters:x,actions:a.jsx(H,{label:"Slow Only",enabled:i,onChange:p,icon:c})}),a.jsxs("div",{className:`${D} space-y-4 transition-all duration-200`,children:[a.jsx($,{placeholder:"Search by SQL, table, source, tag, or content..."}),a.jsx(I,{count:b,onClick:T,loading:s}),a.jsx(K,{columns:q,data:r,keyExtractor:e=>e.id,onRowClick:e=>h(`/queries/${e.id}`),rowClassName:e=>S(e.id)?"highlight-new":"",emptyMessage:"No queries recorded yet",emptyIcon:a.jsx(n,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(Z,{hasMore:C,onClick:k,loading:s})]})]})}export{te as default};
1
+ import{j as a,D as n}from"./index-fV4VT_EH.js";import{e as A,b as d}from"./vendor-DBTT3jXp.js";import{u as M,C as Q,f as R,p as B}from"./ClickableBadge-DIMjoLzU.js";import{u as O,P as W,T as H,N as I,L as Z}from"./PageHeader-Dy1i1YMN.js";import{E as $}from"./EntrySearchInput-Dyav5E5-.js";import{c as z,T as u,D as G,a as J,b as K}from"./types-Sj3ahDpV.js";import{Z as c}from"./zap-DcjSBmCK.js";import"./search-G_aOCia0.js";function te(){const h=A(),[i,p]=d.useState(!1),{addFilter:l,clearAll:x,serverFilters:m,headerFilters:g,hasFilters:y}=M("queries"),f={...m,slow:i?!0:void 0},{entries:w,loading:j,refreshing:s,newEntriesCount:b,hasMore:C,loadMore:k,loadNew:T,autoRefreshEnabled:N,live:v,setAutoRefresh:E,meta:t,isHighlighted:S}=O({type:"query",limit:50,filters:f}),r=w.filter(e=>z(e)),q=d.useMemo(()=>[{key:"source",header:"Source",width:"120px",render:e=>a.jsx(Q,{listType:"queries",filterType:"sources",children:e.payload.source||"unknown"})},{key:"query",header:"Query",minWidth:"300px",render:e=>a.jsxs("div",{className:"flex items-start space-x-2",children:[e.payload.slow&&a.jsx(c,{className:"h-4 w-4 text-yellow-500 flex-shrink-0 mt-0.5"}),a.jsx(u,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.query.length>100?e.payload.query.substring(0,100)+"...":e.payload.query})]})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(G,{ms:e.payload.duration||0,slowThreshold:e.payload.slow?0:1e3})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const F=(e.payload.source||"unknown").toLowerCase(),L=(e.tags||[]).filter(o=>o.toLowerCase()!==F);return a.jsx(J,{tags:L,max:3,onTagClick:(o,P)=>{P.stopPropagation(),l("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(u,{secondary:!0,className:"text-xs",children:R(B(e.createdAt),{addSuffix:!0})})}],[l]);if(j&&r.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const D=y?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(W,{title:"Queries",icon:n,iconColor:"text-purple-600 dark:text-purple-400",count:r.length,totalCount:t==null?void 0:t.total,refreshing:s,autoRefreshEnabled:N,live:v,onAutoRefreshToggle:E,filters:g,onClearAllFilters:x,actions:a.jsx(H,{label:"Slow Only",enabled:i,onChange:p,icon:c})}),a.jsxs("div",{className:`${D} space-y-4 transition-all duration-200`,children:[a.jsx($,{placeholder:"Search by SQL, table, source, tag, or content..."}),a.jsx(I,{count:b,onClick:T,loading:s}),a.jsx(K,{columns:q,data:r,keyExtractor:e=>e.id,onRowClick:e=>h(`/queries/${e.id}`),rowClassName:e=>S(e.id)?"highlight-new":"",emptyMessage:"No queries recorded yet",emptyIcon:a.jsx(n,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(Z,{hasMore:C,onClick:k,loading:s})]})]})}export{te as default};
@@ -1 +1 @@
1
- import{j as a,D as d}from"./index-NYfiXmMn.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{u as D,C as l,f as F,p as T}from"./ClickableBadge-Vyx_sMAl.js";import{u as A,P as M,N as B,L}from"./PageHeader-gzCjMnIq.js";import{m as H,T as n,D as S,b as W}from"./types-DrGQDdvv.js";function z(){const c=R(),{addFilter:t,clearAll:m,serverFilters:u,headerFilters:h,hasFilters:p}=D("redis"),{entries:x,loading:g,refreshing:s,newEntriesCount:y,hasMore:f,loadMore:j,loadNew:k,autoRefreshEnabled:C,live:w,setAutoRefresh:N,meta:r,isHighlighted:b}=A({type:"redis",limit:50,filters:u}),i=x.filter(e=>H(e)),P=v.useMemo(()=>[{key:"command",header:"Command",width:"120px",render:e=>a.jsx(l,{onClick:o=>{o.stopPropagation(),t("commands",e.payload.command)},className:"font-mono",children:e.payload.command})},{key:"keyPattern",header:"Key Pattern",minWidth:"200px",render:e=>e.payload.keyPattern?a.jsx(n,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.keyPattern}):a.jsx(n,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(S,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(l,{onClick:o=>{o.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(n,{secondary:!0,className:"text-xs",children:F(T(e.createdAt),{addSuffix:!0})})}],[t]);if(g&&i.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const E=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(M,{title:"Redis",icon:d,iconColor:"text-red-600 dark:text-red-400",count:i.length,totalCount:r==null?void 0:r.total,refreshing:s,autoRefreshEnabled:C,live:w,onAutoRefreshToggle:N,filters:h,onClearAllFilters:m}),a.jsxs("div",{className:`${E} space-y-4 transition-all duration-200`,children:[a.jsx(B,{count:y,onClick:k,loading:s}),a.jsx(W,{columns:P,data:i,keyExtractor:e=>e.id,onRowClick:e=>c(`/redis/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No Redis commands recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(L,{hasMore:f,onClick:j,loading:s})]})]})}export{z as default};
1
+ import{j as a,D as d}from"./index-fV4VT_EH.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{u as D,C as l,f as F,p as T}from"./ClickableBadge-DIMjoLzU.js";import{u as A,P as M,N as B,L}from"./PageHeader-Dy1i1YMN.js";import{m as H,T as n,D as S,b as W}from"./types-Sj3ahDpV.js";function z(){const c=R(),{addFilter:t,clearAll:m,serverFilters:u,headerFilters:h,hasFilters:p}=D("redis"),{entries:x,loading:g,refreshing:s,newEntriesCount:y,hasMore:f,loadMore:j,loadNew:k,autoRefreshEnabled:C,live:w,setAutoRefresh:N,meta:r,isHighlighted:b}=A({type:"redis",limit:50,filters:u}),i=x.filter(e=>H(e)),P=v.useMemo(()=>[{key:"command",header:"Command",width:"120px",render:e=>a.jsx(l,{onClick:o=>{o.stopPropagation(),t("commands",e.payload.command)},className:"font-mono",children:e.payload.command})},{key:"keyPattern",header:"Key Pattern",minWidth:"200px",render:e=>e.payload.keyPattern?a.jsx(n,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.keyPattern}):a.jsx(n,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(S,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(l,{onClick:o=>{o.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(n,{secondary:!0,className:"text-xs",children:F(T(e.createdAt),{addSuffix:!0})})}],[t]);if(g&&i.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const E=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(M,{title:"Redis",icon:d,iconColor:"text-red-600 dark:text-red-400",count:i.length,totalCount:r==null?void 0:r.total,refreshing:s,autoRefreshEnabled:C,live:w,onAutoRefreshToggle:N,filters:h,onClearAllFilters:m}),a.jsxs("div",{className:`${E} space-y-4 transition-all duration-200`,children:[a.jsx(B,{count:y,onClick:k,loading:s}),a.jsx(W,{columns:P,data:i,keyExtractor:e=>e.id,onRowClick:e=>c(`/redis/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No Redis commands recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(L,{hasMore:f,onClick:j,loading:s})]})]})}export{z as default};
@@ -1 +1 @@
1
- import{j as t,A as P,d as A}from"./index-NYfiXmMn.js";import{e as q,b as R}from"./vendor-DBTT3jXp.js";import{u as v,C as l,f as D,p as L}from"./ClickableBadge-Vyx_sMAl.js";import{u as M,P as F,N as H,L as S}from"./PageHeader-gzCjMnIq.js";import{E as G}from"./EntrySearchInput-BjzlyOoC.js";import{i as B,T as d,D as I,a as O,b as U}from"./types-DrGQDdvv.js";import"./search-C8zDS2B0.js";const W=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"],Q=s=>{var a;return(a=s.payload.path)!=null&&a.toLowerCase().includes("/graphql")?"GRAPHQL":s.payload.method.toUpperCase()};function Z(){const s=q(),{addFilter:a,clearAll:u,serverFilters:h,headerFilters:c,hasFilters:p}=v("requests"),{entries:m,loading:g,refreshing:r,newEntriesCount:x,hasMore:y,loadMore:f,loadNew:j,autoRefreshEnabled:C,live:T,setAutoRefresh:E,meta:i,isHighlighted:b}=M({type:"request",limit:50,filters:h}),o=m.filter(e=>B(e)),k=R.useMemo(()=>[{key:"method",header:"Method",width:"100px",render:e=>t.jsx(l,{listType:"requests",filterType:"methods",children:Q(e)})},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(d,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.path})},{key:"status",header:"Status",width:"80px",align:"center",render:e=>t.jsx(l,{listType:"requests",filterType:"statuses",children:e.payload.statusCode||0})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(I,{ms:e.payload.duration||0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>t.jsx(O,{tags:(e.tags||[]).filter(n=>!W.includes(n.toUpperCase())),max:3,onTagClick:(n,N)=>{N.stopPropagation(),a("tags",n)}})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(d,{secondary:!0,className:"text-xs",children:D(L(e.createdAt),{addSuffix:!0})})}],[a]);if(g&&o.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const w=p?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(F,{title:"Requests",icon:P,iconColor:"text-blue-600 dark:text-blue-400",count:o.length,totalCount:i==null?void 0:i.total,refreshing:r,autoRefreshEnabled:C,live:T,onAutoRefreshToggle:E,filters:c,onClearAllFilters:u}),t.jsxs("div",{className:`${w} space-y-4 transition-all duration-200`,children:[t.jsx(G,{placeholder:"Search by path, method, status, tag, or content..."}),t.jsx(H,{count:x,onClick:j,loading:r}),t.jsx(U,{columns:k,data:o,keyExtractor:e=>e.id,onRowClick:e=>s(`/requests/${e.id}`),emptyMessage:"No requests recorded yet",emptyIcon:t.jsx(A,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"}),rowClassName:e=>b(e.id)?"highlight-new":""}),t.jsx(S,{hasMore:y,onClick:f,loading:r})]})]})}export{Z as default};
1
+ import{j as t,A as P,d as A}from"./index-fV4VT_EH.js";import{e as q,b as R}from"./vendor-DBTT3jXp.js";import{u as v,C as l,f as D,p as L}from"./ClickableBadge-DIMjoLzU.js";import{u as M,P as F,N as H,L as S}from"./PageHeader-Dy1i1YMN.js";import{E as G}from"./EntrySearchInput-Dyav5E5-.js";import{i as B,T as d,D as I,a as O,b as U}from"./types-Sj3ahDpV.js";import"./search-G_aOCia0.js";const W=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"],Q=s=>{var a;return(a=s.payload.path)!=null&&a.toLowerCase().includes("/graphql")?"GRAPHQL":s.payload.method.toUpperCase()};function Z(){const s=q(),{addFilter:a,clearAll:u,serverFilters:h,headerFilters:c,hasFilters:p}=v("requests"),{entries:m,loading:g,refreshing:r,newEntriesCount:x,hasMore:y,loadMore:f,loadNew:j,autoRefreshEnabled:C,live:T,setAutoRefresh:E,meta:i,isHighlighted:b}=M({type:"request",limit:50,filters:h}),o=m.filter(e=>B(e)),k=R.useMemo(()=>[{key:"method",header:"Method",width:"100px",render:e=>t.jsx(l,{listType:"requests",filterType:"methods",children:Q(e)})},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(d,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.path})},{key:"status",header:"Status",width:"80px",align:"center",render:e=>t.jsx(l,{listType:"requests",filterType:"statuses",children:e.payload.statusCode||0})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(I,{ms:e.payload.duration||0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>t.jsx(O,{tags:(e.tags||[]).filter(n=>!W.includes(n.toUpperCase())),max:3,onTagClick:(n,N)=>{N.stopPropagation(),a("tags",n)}})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(d,{secondary:!0,className:"text-xs",children:D(L(e.createdAt),{addSuffix:!0})})}],[a]);if(g&&o.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const w=p?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(F,{title:"Requests",icon:P,iconColor:"text-blue-600 dark:text-blue-400",count:o.length,totalCount:i==null?void 0:i.total,refreshing:r,autoRefreshEnabled:C,live:T,onAutoRefreshToggle:E,filters:c,onClearAllFilters:u}),t.jsxs("div",{className:`${w} space-y-4 transition-all duration-200`,children:[t.jsx(G,{placeholder:"Search by path, method, status, tag, or content..."}),t.jsx(H,{count:x,onClick:j,loading:r}),t.jsx(U,{columns:k,data:o,keyExtractor:e=>e.id,onRowClick:e=>s(`/requests/${e.id}`),emptyMessage:"No requests recorded yet",emptyIcon:t.jsx(A,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"}),rowClassName:e=>b(e.id)?"highlight-new":""}),t.jsx(S,{hasMore:y,onClick:f,loading:r})]})]})}export{Z as default};
@@ -1 +1 @@
1
- import{j as a,C as c}from"./index-NYfiXmMn.js";import{e as P,b as A}from"./vendor-DBTT3jXp.js";import{f as u,c as L}from"./format-PC0kH-TG.js";import{u as R,C as h,f as H,p as B}from"./ClickableBadge-Vyx_sMAl.js";import{u as W,P as $,N as I,L as q}from"./PageHeader-gzCjMnIq.js";import{k as z,T as i,D as G,a as J,b as K}from"./types-DrGQDdvv.js";const O=["started","completed","failed"];function m(t){try{return L.toString(t)}catch{return null}}function _(){const t=P(),{addFilter:n,clearAll:p,serverFilters:x,headerFilters:g,hasFilters:f}=R("schedule"),{entries:y,loading:k,refreshing:s,newEntriesCount:j,hasMore:C,loadMore:N,loadNew:T,autoRefreshEnabled:v,live:w,setAutoRefresh:b,meta:r,isHighlighted:E}=W({type:"schedule",limit:50,filters:x}),l=y.filter(e=>z(e)),d=e=>e.payload.cron?e.payload.cron:e.payload.interval?`${e.payload.interval}ms`:"-",S=A.useMemo(()=>[{key:"task",header:"Task",minWidth:"200px",render:e=>a.jsx(h,{listType:"schedule",filterType:"names",className:"font-mono",children:e.payload.name})},{key:"schedule",header:"Schedule",minWidth:"150px",render:e=>a.jsxs("div",{children:[a.jsx(i,{mono:!0,children:d(e)}),e.payload.cron&&m(e.payload.cron)&&a.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 block mt-0.5",children:m(e.payload.cron)}),e.payload.interval&&u(e.payload.interval)&&a.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 block mt-0.5",children:u(e.payload.interval)})]})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(h,{listType:"schedule",filterType:"statuses",children:e.payload.status})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?a.jsx(G,{ms:e.payload.duration}):a.jsx(i,{secondary:!0,children:"—"})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const F=(e.tags||[]).filter(o=>!O.includes(o.toLowerCase()));return a.jsx(J,{tags:F,max:3,onTagClick:(o,M)=>{M.stopPropagation(),n("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:H(B(e.createdAt),{addSuffix:!0})})}],[n,d]);if(k&&l.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const D=f?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx($,{title:"Schedule",icon:c,iconColor:"text-gray-600 dark:text-gray-400",count:l.length,totalCount:r==null?void 0:r.total,refreshing:s,autoRefreshEnabled:v,live:w,onAutoRefreshToggle:b,filters:g,onClearAllFilters:p}),a.jsxs("div",{className:`${D} space-y-4 transition-all duration-200`,children:[a.jsx(I,{count:j,onClick:T,loading:s}),a.jsx(K,{columns:S,data:l,keyExtractor:e=>e.id,onRowClick:e=>t(`/schedule/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No scheduled tasks recorded yet",emptyIcon:a.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(q,{hasMore:C,onClick:N,loading:s})]})]})}export{_ as default};
1
+ import{j as a,C as c}from"./index-fV4VT_EH.js";import{e as P,b as A}from"./vendor-DBTT3jXp.js";import{f as u,c as L}from"./format-PC0kH-TG.js";import{u as R,C as h,f as H,p as B}from"./ClickableBadge-DIMjoLzU.js";import{u as W,P as $,N as I,L as q}from"./PageHeader-Dy1i1YMN.js";import{k as z,T as i,D as G,a as J,b as K}from"./types-Sj3ahDpV.js";const O=["started","completed","failed"];function m(t){try{return L.toString(t)}catch{return null}}function _(){const t=P(),{addFilter:n,clearAll:p,serverFilters:x,headerFilters:g,hasFilters:f}=R("schedule"),{entries:y,loading:k,refreshing:s,newEntriesCount:j,hasMore:C,loadMore:N,loadNew:T,autoRefreshEnabled:v,live:w,setAutoRefresh:b,meta:r,isHighlighted:E}=W({type:"schedule",limit:50,filters:x}),l=y.filter(e=>z(e)),d=e=>e.payload.cron?e.payload.cron:e.payload.interval?`${e.payload.interval}ms`:"-",S=A.useMemo(()=>[{key:"task",header:"Task",minWidth:"200px",render:e=>a.jsx(h,{listType:"schedule",filterType:"names",className:"font-mono",children:e.payload.name})},{key:"schedule",header:"Schedule",minWidth:"150px",render:e=>a.jsxs("div",{children:[a.jsx(i,{mono:!0,children:d(e)}),e.payload.cron&&m(e.payload.cron)&&a.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 block mt-0.5",children:m(e.payload.cron)}),e.payload.interval&&u(e.payload.interval)&&a.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 block mt-0.5",children:u(e.payload.interval)})]})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(h,{listType:"schedule",filterType:"statuses",children:e.payload.status})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?a.jsx(G,{ms:e.payload.duration}):a.jsx(i,{secondary:!0,children:"—"})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const F=(e.tags||[]).filter(o=>!O.includes(o.toLowerCase()));return a.jsx(J,{tags:F,max:3,onTagClick:(o,M)=>{M.stopPropagation(),n("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:H(B(e.createdAt),{addSuffix:!0})})}],[n,d]);if(k&&l.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const D=f?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx($,{title:"Schedule",icon:c,iconColor:"text-gray-600 dark:text-gray-400",count:l.length,totalCount:r==null?void 0:r.total,refreshing:s,autoRefreshEnabled:v,live:w,onAutoRefreshToggle:b,filters:g,onClearAllFilters:p}),a.jsxs("div",{className:`${D} space-y-4 transition-all duration-200`,children:[a.jsx(I,{count:j,onClick:T,loading:s}),a.jsx(K,{columns:S,data:l,keyExtractor:e=>e.id,onRowClick:e=>t(`/schedule/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No scheduled tasks recorded yet",emptyIcon:a.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(q,{hasMore:C,onClick:N,loading:s})]})]})}export{_ as default};
@@ -1 +1 @@
1
- import{j as a}from"./index-NYfiXmMn.js";import{e as F,b as P}from"./vendor-DBTT3jXp.js";import{u as T,C as n,f as D,p as A}from"./ClickableBadge-Vyx_sMAl.js";import{u as M,P as R,N as H,L as B}from"./PageHeader-gzCjMnIq.js";import{p as L,T as t,D as V,b as S}from"./types-DrGQDdvv.js";import{E as d}from"./eye-DoP8A5L_.js";function z(){const c=F(),{addFilter:r,clearAll:h,serverFilters:m,headerFilters:p,hasFilters:u}=T("views"),{entries:x,loading:g,refreshing:s,newEntriesCount:f,hasMore:y,loadMore:w,loadNew:j,autoRefreshEnabled:C,live:k,setAutoRefresh:N,meta:i,isHighlighted:v}=M({type:"view",limit:50,filters:m}),o=x.filter(e=>L(e)),E=P.useMemo(()=>[{key:"template",header:"Template",minWidth:"250px",render:e=>a.jsx(t,{mono:!0,truncate:!0,maxWidth:"350px",children:e.payload.template})},{key:"format",header:"Format",width:"100px",render:e=>e.payload.format?a.jsx(n,{onClick:l=>{l.stopPropagation(),r("formats",e.payload.format)},className:"font-mono",children:e.payload.format}):a.jsx(t,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(V,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(n,{onClick:l=>{l.stopPropagation(),r("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"cache",header:"Cache",width:"80px",align:"center",render:e=>e.payload.cacheHit!==void 0?a.jsx(t,{children:e.payload.cacheHit?"Yes":"No"}):a.jsx(t,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(t,{secondary:!0,className:"text-xs",children:D(A(e.createdAt),{addSuffix:!0})})}],[r]);if(g&&o.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const b=u?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Views",icon:d,iconColor:"text-teal-600 dark:text-teal-400",count:o.length,totalCount:i==null?void 0:i.total,refreshing:s,autoRefreshEnabled:C,live:k,onAutoRefreshToggle:N,filters:p,onClearAllFilters:h}),a.jsxs("div",{className:`${b} space-y-4 transition-all duration-200`,children:[a.jsx(H,{count:f,onClick:j,loading:s}),a.jsx(S,{columns:E,data:o,keyExtractor:e=>e.id,onRowClick:e=>c(`/views/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No view renders recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(B,{hasMore:y,onClick:w,loading:s})]})]})}export{z as default};
1
+ import{j as a}from"./index-fV4VT_EH.js";import{e as F,b as P}from"./vendor-DBTT3jXp.js";import{u as T,C as n,f as D,p as A}from"./ClickableBadge-DIMjoLzU.js";import{u as M,P as R,N as H,L as B}from"./PageHeader-Dy1i1YMN.js";import{p as L,T as t,D as V,b as S}from"./types-Sj3ahDpV.js";import{E as d}from"./eye-CNwth9uN.js";function z(){const c=F(),{addFilter:r,clearAll:h,serverFilters:m,headerFilters:p,hasFilters:u}=T("views"),{entries:x,loading:g,refreshing:s,newEntriesCount:f,hasMore:y,loadMore:w,loadNew:j,autoRefreshEnabled:C,live:k,setAutoRefresh:N,meta:i,isHighlighted:v}=M({type:"view",limit:50,filters:m}),o=x.filter(e=>L(e)),E=P.useMemo(()=>[{key:"template",header:"Template",minWidth:"250px",render:e=>a.jsx(t,{mono:!0,truncate:!0,maxWidth:"350px",children:e.payload.template})},{key:"format",header:"Format",width:"100px",render:e=>e.payload.format?a.jsx(n,{onClick:l=>{l.stopPropagation(),r("formats",e.payload.format)},className:"font-mono",children:e.payload.format}):a.jsx(t,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(V,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(n,{onClick:l=>{l.stopPropagation(),r("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"cache",header:"Cache",width:"80px",align:"center",render:e=>e.payload.cacheHit!==void 0?a.jsx(t,{children:e.payload.cacheHit?"Yes":"No"}):a.jsx(t,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(t,{secondary:!0,className:"text-xs",children:D(A(e.createdAt),{addSuffix:!0})})}],[r]);if(g&&o.length===0)return a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const b=u?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Views",icon:d,iconColor:"text-teal-600 dark:text-teal-400",count:o.length,totalCount:i==null?void 0:i.total,refreshing:s,autoRefreshEnabled:C,live:k,onAutoRefreshToggle:N,filters:p,onClearAllFilters:h}),a.jsxs("div",{className:`${b} space-y-4 transition-all duration-200`,children:[a.jsx(H,{count:f,onClick:j,loading:s}),a.jsx(S,{columns:E,data:o,keyExtractor:e=>e.id,onRowClick:e=>c(`/views/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No view renders recorded yet",emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(B,{hasMore:y,onClick:w,loading:s})]})]})}export{z as default};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-NYfiXmMn.js";/**
1
+ import{c as e}from"./index-fV4VT_EH.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-NYfiXmMn.js";/**
1
+ import{c}from"./index-fV4VT_EH.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-NYfiXmMn.js";/**
1
+ import{c}from"./index-fV4VT_EH.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DashboardPage-8LH8ftoZ.js","./vendor-DBTT3jXp.js","./ClickableBadge-Vyx_sMAl.js","./zap-DXGDS502.js","./calendar-BsVc-vvl.js","./RequestsPage-Dj4eX2lV.js","./PageHeader-gzCjMnIq.js","./EntrySearchInput-BjzlyOoC.js","./search-C8zDS2B0.js","./types-DrGQDdvv.js","./QueriesPage-3UzIdKwS.js","./ExceptionsPage-BRBxnFaw.js","./circle-check-big-D8hxmLVs.js","./LogsPage-BBlP-X7a.js","./EventsPage-CWYR4iMv.js","./JobsPage-DgrC3Sj1.js","./CachePage-DdiQfS9v.js","./MailPage-CoNbEq1o.js","./SchedulePage-egoitltq.js","./format-PC0kH-TG.js","./HttpClientPage-ax2dQyNU.js","./RedisPage-CkCLM4ax.js","./ModelsPage-DWb7rn2b.js","./NotificationsPage-DCLX_IJt.js","./ViewsPage-HadbKX46.js","./eye-DoP8A5L_.js","./CommandsPage-zJMqAMw2.js","./GatesPage-Db4jOQJV.js","./BatchesPage-B-FM-KDo.js","./DumpsPage-zoJtOb34.js","./GraphQLPage-B3rSuWjG.js","./EntryDetailPage-DFx3gg0C.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DashboardPage-Cg4B1v71.js","./vendor-DBTT3jXp.js","./ClickableBadge-DIMjoLzU.js","./zap-DcjSBmCK.js","./calendar-Camxqdlp.js","./RequestsPage-DZLasLTv.js","./PageHeader-Dy1i1YMN.js","./EntrySearchInput-Dyav5E5-.js","./search-G_aOCia0.js","./types-Sj3ahDpV.js","./QueriesPage-BlzALGM-.js","./ExceptionsPage--aa1xm13.js","./circle-check-big-oB7KFF_S.js","./LogsPage-CRlOEyuz.js","./EventsPage-C3BjM-u_.js","./JobsPage-aSdQC9Of.js","./CachePage-c9NdxnLF.js","./MailPage-Bmfqpr8z.js","./SchedulePage-x5dG87Qk.js","./format-PC0kH-TG.js","./HttpClientPage-Bn1Tb9mM.js","./RedisPage-fHFUgVjS.js","./ModelsPage-CzX1Bkcw.js","./NotificationsPage-CNQ7ZU3Z.js","./ViewsPage-DISrSULL.js","./eye-CNwth9uN.js","./CommandsPage-UA71c6cn.js","./GatesPage-DCpvh5Eq.js","./BatchesPage-BuX1D-Qw.js","./DumpsPage-DPjT0K-W.js","./GraphQLPage-0dO4WQQI.js","./EntryDetailPage-_HHpZVRb.js"])))=>i.map(i=>d[i]);
2
2
  var Se=Object.defineProperty;var _e=(s,a,e)=>a in s?Se(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e;var z=(s,a,e)=>_e(s,typeof a!="symbol"?a+"":a,e);import{r as Ee,a as Ne,g as Pe,b as r,u as Ce,L as D,O as Re,R as Le,c as p,N as Te,d as Ae,B as Oe}from"./vendor-DBTT3jXp.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const n of i.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&o(n)}).observe(document,{childList:!0,subtree:!0});function e(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(l){if(l.ep)return;l.ep=!0;const i=e(l);fetch(l.href,i)}})();var G={exports:{}},M={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.min.js
@@ -358,4 +358,4 @@ to {
358
358
  *
359
359
  * This source code is licensed under the ISC license.
360
360
  * See the LICENSE file in the root directory of this source tree.
361
- */const es=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ke=()=>window.__NESTLENS_BASE__??"",ts=s=>`${window.location.origin}${ke()}/__nestlens__${s}`,ve=ts("/api");async function P(s,a){const e=await fetch(`${ve}${s}`,a);if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function Ds(s){return P(`/entries/${s}`)}async function ss(){return P("/stats")}async function as(){return(await fetch(`${ve}/entries`,{method:"DELETE"})).json()}async function Ms(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search)}return P(`/entries/cursor?${a.toString()}`)}async function qs(s){const a=new URLSearchParams;return s&&a.set("type",s),P(`/entries/latest-sequence?${a.toString()}`)}async function $s(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),P(`/entries/check-new?${e.toString()}`)}async function zs(){return P("/storage/stats")}async function Is(){return P("/pruning/status")}async function Ks(){return P("/pruning/run",{method:"POST"})}async function Vs(s){return P(`/entries/${s}/resolve`,{method:"PATCH"})}async function Bs(s){return P(`/entries/${s}/unresolve`,{method:"PATCH"})}async function rs(s){return P("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function ns(){return P("/recording/resume",{method:"POST"})}async function os(){return P("/recording/status")}function is(s){const a=r.useCallback(e=>{const o=e.target,l=o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable;for(const i of s){const{key:n,ctrl:c,meta:d,shift:y,alt:u,handler:m,preventDefault:f=!0}=i;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),v=y?e.shiftKey:!e.shiftKey,h=u?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&v&&h){f&&e.preventDefault(),m(e);return}continue}if(d){if(e.metaKey&&!e.ctrlKey&&j&&v&&h){f&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&v&&h){f&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}const we=r.createContext(void 0);function ls({children:s}){const[a,e]=r.useState(null),[o,l]=r.useState(null),i=r.useRef(!0),n=r.useCallback(async()=>{try{const c=await ss();e(c.data),l(null)}catch(c){const d=c instanceof Error?c:new Error("Failed to fetch stats");l(d),console.error("Failed to fetch stats:",c),i.current&&q.error("Failed to load statistics")}finally{i.current=!1}},[]);return r.useEffect(()=>{n();const c=setInterval(n,1e4);return()=>clearInterval(c)},[n]),t.jsx(we.Provider,{value:{stats:a,error:o,refreshStats:n},children:s})}function cs(){const s=r.useContext(we);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function ce(){const[s,a]=r.useState(null),[e,o]=r.useState(!1);r.useEffect(()=>{const i=async()=>{try{const c=await os();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};i();const n=setInterval(i,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){o(!0);try{if(s.isPaused){const i=await ns();a(i.data),q.success("Recording resumed")}else{const i=await rs();a(i.data),q.success("Recording paused")}}catch{q.error("Failed to toggle recording")}finally{o(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Qt,{className:"h-5 w-5"}):t.jsx(Jt,{className:"h-5 w-5"})}):null}const de={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},ue=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Bt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:At,colorKey:"request"},{name:"Queries",href:"/queries",icon:$t,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:It,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:be,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:zt,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:Mt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:qt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Gt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:Yt,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:Dt,colorKey:"redis"},{name:"Models",href:"/models",icon:Vt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Kt,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ft,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:Ot,colorKey:"notification"},{name:"Events",href:"/events",icon:Wt,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Ut,colorKey:"view"},{name:"Gates",href:"/gates",icon:Xt,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function ds(){const s=Ce(),[a,e]=r.useState(!1),{stats:o}=cs(),[l,i]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[d,y]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),u=r.useCallback(h=>{i(k=>{const E=new Set(k);return E.has(h)?E.delete(h):E.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...E])),E})},[]),m=r.useCallback(h=>{if(!o)return 0;switch(h){case"exceptions":return o.unresolvedExceptions??o.byType.exception??0;default:return 0}},[o]),f=r.useCallback(h=>{let k=!1;h==="system"?k=window.matchMedia("(prefers-color-scheme: dark)").matches:k=h==="dark",k?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(k)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";y(h),localStorage.setItem("nestlens-theme",h),f(h)},[n,f]),v=r.useCallback(async()=>{window.confirm("Are you sure you want to clear all entries?")&&(await as(),q.success("All entries cleared"),window.location.reload())},[]);return r.useEffect(()=>{if(f(d),d==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)"),k=E=>{const b=E.matches;b?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(b)};return h.addEventListener("change",k),()=>h.removeEventListener("change",k)}},[d,f]),is([{key:"k",ctrl:!0,handler:()=>v()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar","data-testid":"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(es,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:ue.map((h,k)=>{const E=l.has(h.name);return t.jsxs("div",{className:k>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>u(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!E,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?m(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${N?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${de[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),C>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:C>99?"99+":C})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(ce,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:v,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{"data-testid":"sidebar",className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(D,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(U,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.8.9"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:ue.map((h,k)=>{const E=l.has(h.name);return t.jsxs("div",{className:k>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>u(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!E,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?m(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${N?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${de[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),C>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${N?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:C>99?"99+":C})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(ce,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:v,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Ht,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Re,{})})]})]})}function x(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const us=r.lazy(()=>w(()=>import("./DashboardPage-8LH8ftoZ.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),hs=r.lazy(()=>w(()=>import("./RequestsPage-Dj4eX2lV.js"),__vite__mapDeps([5,1,2,6,7,8,9]),import.meta.url)),ms=r.lazy(()=>w(()=>import("./QueriesPage-3UzIdKwS.js"),__vite__mapDeps([10,1,2,6,7,8,9,3]),import.meta.url)),ps=r.lazy(()=>w(()=>import("./ExceptionsPage-BRBxnFaw.js"),__vite__mapDeps([11,1,2,6,7,8,9,12]),import.meta.url)),xs=r.lazy(()=>w(()=>import("./LogsPage-BBlP-X7a.js"),__vite__mapDeps([13,1,2,6,7,8,9]),import.meta.url)),fs=r.lazy(()=>w(()=>import("./EventsPage-CWYR4iMv.js"),__vite__mapDeps([14,1,2,6,9]),import.meta.url)),ys=r.lazy(()=>w(()=>import("./JobsPage-DgrC3Sj1.js"),__vite__mapDeps([15,1,2,6,9]),import.meta.url)),gs=r.lazy(()=>w(()=>import("./CachePage-DdiQfS9v.js"),__vite__mapDeps([16,1,2,6,9]),import.meta.url)),js=r.lazy(()=>w(()=>import("./MailPage-CoNbEq1o.js"),__vite__mapDeps([17,1,2,6,9]),import.meta.url)),bs=r.lazy(()=>w(()=>import("./SchedulePage-egoitltq.js"),__vite__mapDeps([18,1,19,2,6,9]),import.meta.url)),ks=r.lazy(()=>w(()=>import("./HttpClientPage-ax2dQyNU.js"),__vite__mapDeps([20,1,2,6,9]),import.meta.url)),vs=r.lazy(()=>w(()=>import("./RedisPage-CkCLM4ax.js"),__vite__mapDeps([21,1,2,6,9]),import.meta.url)),ws=r.lazy(()=>w(()=>import("./ModelsPage-DWb7rn2b.js"),__vite__mapDeps([22,1,2,6,9]),import.meta.url)),Ss=r.lazy(()=>w(()=>import("./NotificationsPage-DCLX_IJt.js"),__vite__mapDeps([23,1,2,6,9]),import.meta.url)),_s=r.lazy(()=>w(()=>import("./ViewsPage-HadbKX46.js"),__vite__mapDeps([24,1,2,6,9,25]),import.meta.url)),Es=r.lazy(()=>w(()=>import("./CommandsPage-zJMqAMw2.js"),__vite__mapDeps([26,1,2,6,9]),import.meta.url)),Ns=r.lazy(()=>w(()=>import("./GatesPage-Db4jOQJV.js"),__vite__mapDeps([27,1,2,6,9]),import.meta.url)),Ps=r.lazy(()=>w(()=>import("./BatchesPage-B-FM-KDo.js"),__vite__mapDeps([28,1,2,6,9]),import.meta.url)),Cs=r.lazy(()=>w(()=>import("./DumpsPage-zoJtOb34.js"),__vite__mapDeps([29,1,2,6,9]),import.meta.url)),Rs=r.lazy(()=>w(()=>import("./GraphQLPage-B3rSuWjG.js"),__vite__mapDeps([30,1,2,7,8,6,9]),import.meta.url)),S=r.lazy(()=>w(()=>import("./EntryDetailPage-DFx3gg0C.js"),__vite__mapDeps([31,1,2,9,8,3,12,19,4,25]),import.meta.url));function Ls(){return t.jsx(Le,{children:t.jsxs(p,{path:"/",element:t.jsx(ds,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(us,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(hs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ms,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Te,{to:"/",replace:!0})})]})})}class Ts extends r.Component{constructor(){super(...arguments);z(this,"state",{hasError:!1});z(this,"handleReload",()=>{window.location.reload()});z(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("ErrorBoundary caught an error:",e,o),this.setState({errorInfo:o})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(be,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(Zt,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}ze.createRoot(document.getElementById("root")).render(t.jsx(Ae.StrictMode,{children:t.jsx(Ts,{children:t.jsx(Oe,{basename:ke(),children:t.jsxs(ls,{children:[t.jsx(Ls,{}),t.jsx(Nt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{At as A,Mt as B,qt as C,$t as D,zt as F,It as G,ne as H,Vt as L,Ft as M,Gt as P,Wt as R,Xt as S,be as T,es as X,Yt as a,Dt as b,g as c,Kt as d,Ot as e,Ut as f,ae as g,le as h,Zt as i,t as j,zs as k,Is as l,Ms as m,Bs as n,Vs as o,ts as p,qs as q,Ks as r,$s as s,se as t,cs as u,Qt as v,Ds as w,q as z};
361
+ */const es=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ke=()=>window.__NESTLENS_BASE__??"",ts=s=>`${window.location.origin}${ke()}/__nestlens__${s}`,ve=ts("/api");async function P(s,a){const e=await fetch(`${ve}${s}`,a);if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function Ds(s){return P(`/entries/${s}`)}async function ss(){return P("/stats")}async function as(){return(await fetch(`${ve}/entries`,{method:"DELETE"})).json()}async function Ms(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search)}return P(`/entries/cursor?${a.toString()}`)}async function qs(s){const a=new URLSearchParams;return s&&a.set("type",s),P(`/entries/latest-sequence?${a.toString()}`)}async function $s(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),P(`/entries/check-new?${e.toString()}`)}async function zs(){return P("/storage/stats")}async function Is(){return P("/pruning/status")}async function Ks(){return P("/pruning/run",{method:"POST"})}async function Vs(s){return P(`/entries/${s}/resolve`,{method:"PATCH"})}async function Bs(s){return P(`/entries/${s}/unresolve`,{method:"PATCH"})}async function rs(s){return P("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function ns(){return P("/recording/resume",{method:"POST"})}async function os(){return P("/recording/status")}function is(s){const a=r.useCallback(e=>{const o=e.target,l=o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable;for(const i of s){const{key:n,ctrl:c,meta:d,shift:y,alt:u,handler:m,preventDefault:f=!0}=i;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),v=y?e.shiftKey:!e.shiftKey,h=u?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&v&&h){f&&e.preventDefault(),m(e);return}continue}if(d){if(e.metaKey&&!e.ctrlKey&&j&&v&&h){f&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&v&&h){f&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}const we=r.createContext(void 0);function ls({children:s}){const[a,e]=r.useState(null),[o,l]=r.useState(null),i=r.useRef(!0),n=r.useCallback(async()=>{try{const c=await ss();e(c.data),l(null)}catch(c){const d=c instanceof Error?c:new Error("Failed to fetch stats");l(d),console.error("Failed to fetch stats:",c),i.current&&q.error("Failed to load statistics")}finally{i.current=!1}},[]);return r.useEffect(()=>{n();const c=setInterval(n,1e4);return()=>clearInterval(c)},[n]),t.jsx(we.Provider,{value:{stats:a,error:o,refreshStats:n},children:s})}function cs(){const s=r.useContext(we);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function ce(){const[s,a]=r.useState(null),[e,o]=r.useState(!1);r.useEffect(()=>{const i=async()=>{try{const c=await os();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};i();const n=setInterval(i,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){o(!0);try{if(s.isPaused){const i=await ns();a(i.data),q.success("Recording resumed")}else{const i=await rs();a(i.data),q.success("Recording paused")}}catch{q.error("Failed to toggle recording")}finally{o(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Qt,{className:"h-5 w-5"}):t.jsx(Jt,{className:"h-5 w-5"})}):null}const de={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},ue=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Bt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:At,colorKey:"request"},{name:"Queries",href:"/queries",icon:$t,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:It,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:be,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:zt,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:Mt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:qt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Gt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:Yt,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:Dt,colorKey:"redis"},{name:"Models",href:"/models",icon:Vt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Kt,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ft,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:Ot,colorKey:"notification"},{name:"Events",href:"/events",icon:Wt,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Ut,colorKey:"view"},{name:"Gates",href:"/gates",icon:Xt,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function ds(){const s=Ce(),[a,e]=r.useState(!1),{stats:o}=cs(),[l,i]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[d,y]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),u=r.useCallback(h=>{i(k=>{const E=new Set(k);return E.has(h)?E.delete(h):E.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...E])),E})},[]),m=r.useCallback(h=>{if(!o)return 0;switch(h){case"exceptions":return o.unresolvedExceptions??o.byType.exception??0;default:return 0}},[o]),f=r.useCallback(h=>{let k=!1;h==="system"?k=window.matchMedia("(prefers-color-scheme: dark)").matches:k=h==="dark",k?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(k)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";y(h),localStorage.setItem("nestlens-theme",h),f(h)},[n,f]),v=r.useCallback(async()=>{window.confirm("Are you sure you want to clear all entries?")&&(await as(),q.success("All entries cleared"),window.location.reload())},[]);return r.useEffect(()=>{if(f(d),d==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)"),k=E=>{const b=E.matches;b?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(b)};return h.addEventListener("change",k),()=>h.removeEventListener("change",k)}},[d,f]),is([{key:"k",ctrl:!0,handler:()=>v()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar","data-testid":"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(es,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:ue.map((h,k)=>{const E=l.has(h.name);return t.jsxs("div",{className:k>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>u(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!E,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?m(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${N?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${de[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),C>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:C>99?"99+":C})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(ce,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:v,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{"data-testid":"sidebar",className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(D,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(U,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.8.10"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:ue.map((h,k)=>{const E=l.has(h.name);return t.jsxs("div",{className:k>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>u(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!E,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?m(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${N?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${de[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),C>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${N?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:C>99?"99+":C})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(ce,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:v,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Ht,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Re,{})})]})]})}function x(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const us=r.lazy(()=>w(()=>import("./DashboardPage-Cg4B1v71.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),hs=r.lazy(()=>w(()=>import("./RequestsPage-DZLasLTv.js"),__vite__mapDeps([5,1,2,6,7,8,9]),import.meta.url)),ms=r.lazy(()=>w(()=>import("./QueriesPage-BlzALGM-.js"),__vite__mapDeps([10,1,2,6,7,8,9,3]),import.meta.url)),ps=r.lazy(()=>w(()=>import("./ExceptionsPage--aa1xm13.js"),__vite__mapDeps([11,1,2,6,7,8,9,12]),import.meta.url)),xs=r.lazy(()=>w(()=>import("./LogsPage-CRlOEyuz.js"),__vite__mapDeps([13,1,2,6,7,8,9]),import.meta.url)),fs=r.lazy(()=>w(()=>import("./EventsPage-C3BjM-u_.js"),__vite__mapDeps([14,1,2,6,9]),import.meta.url)),ys=r.lazy(()=>w(()=>import("./JobsPage-aSdQC9Of.js"),__vite__mapDeps([15,1,2,6,9]),import.meta.url)),gs=r.lazy(()=>w(()=>import("./CachePage-c9NdxnLF.js"),__vite__mapDeps([16,1,2,6,9]),import.meta.url)),js=r.lazy(()=>w(()=>import("./MailPage-Bmfqpr8z.js"),__vite__mapDeps([17,1,2,6,9]),import.meta.url)),bs=r.lazy(()=>w(()=>import("./SchedulePage-x5dG87Qk.js"),__vite__mapDeps([18,1,19,2,6,9]),import.meta.url)),ks=r.lazy(()=>w(()=>import("./HttpClientPage-Bn1Tb9mM.js"),__vite__mapDeps([20,1,2,6,9]),import.meta.url)),vs=r.lazy(()=>w(()=>import("./RedisPage-fHFUgVjS.js"),__vite__mapDeps([21,1,2,6,9]),import.meta.url)),ws=r.lazy(()=>w(()=>import("./ModelsPage-CzX1Bkcw.js"),__vite__mapDeps([22,1,2,6,9]),import.meta.url)),Ss=r.lazy(()=>w(()=>import("./NotificationsPage-CNQ7ZU3Z.js"),__vite__mapDeps([23,1,2,6,9]),import.meta.url)),_s=r.lazy(()=>w(()=>import("./ViewsPage-DISrSULL.js"),__vite__mapDeps([24,1,2,6,9,25]),import.meta.url)),Es=r.lazy(()=>w(()=>import("./CommandsPage-UA71c6cn.js"),__vite__mapDeps([26,1,2,6,9]),import.meta.url)),Ns=r.lazy(()=>w(()=>import("./GatesPage-DCpvh5Eq.js"),__vite__mapDeps([27,1,2,6,9]),import.meta.url)),Ps=r.lazy(()=>w(()=>import("./BatchesPage-BuX1D-Qw.js"),__vite__mapDeps([28,1,2,6,9]),import.meta.url)),Cs=r.lazy(()=>w(()=>import("./DumpsPage-DPjT0K-W.js"),__vite__mapDeps([29,1,2,6,9]),import.meta.url)),Rs=r.lazy(()=>w(()=>import("./GraphQLPage-0dO4WQQI.js"),__vite__mapDeps([30,1,2,7,8,6,9]),import.meta.url)),S=r.lazy(()=>w(()=>import("./EntryDetailPage-_HHpZVRb.js"),__vite__mapDeps([31,1,2,9,8,3,12,19,4,25]),import.meta.url));function Ls(){return t.jsx(Le,{children:t.jsxs(p,{path:"/",element:t.jsx(ds,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(us,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(hs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ms,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Te,{to:"/",replace:!0})})]})})}class Ts extends r.Component{constructor(){super(...arguments);z(this,"state",{hasError:!1});z(this,"handleReload",()=>{window.location.reload()});z(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("ErrorBoundary caught an error:",e,o),this.setState({errorInfo:o})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(be,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(Zt,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}ze.createRoot(document.getElementById("root")).render(t.jsx(Ae.StrictMode,{children:t.jsx(Ts,{children:t.jsx(Oe,{basename:ke(),children:t.jsxs(ls,{children:[t.jsx(Ls,{}),t.jsx(Nt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{At as A,Mt as B,qt as C,$t as D,zt as F,It as G,ne as H,Vt as L,Ft as M,Gt as P,Wt as R,Xt as S,be as T,es as X,Yt as a,Dt as b,g as c,Kt as d,Ot as e,Ut as f,ae as g,le as h,Zt as i,t as j,zs as k,Is as l,Ms as m,Bs as n,Vs as o,ts as p,qs as q,Ks as r,$s as s,se as t,cs as u,Qt as v,Ds as w,q as z};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-NYfiXmMn.js";/**
1
+ import{c}from"./index-fV4VT_EH.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as q,j as t,g as A}from"./index-NYfiXmMn.js";import{b as d}from"./vendor-DBTT3jXp.js";import{g as b}from"./ClickableBadge-Vyx_sMAl.js";/**
1
+ import{c as q,j as t,g as A}from"./index-fV4VT_EH.js";import{b as d}from"./vendor-DBTT3jXp.js";import{g as b}from"./ClickableBadge-DIMjoLzU.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-NYfiXmMn.js";/**
1
+ import{c as a}from"./index-fV4VT_EH.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="./nestlens-icon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>NestLens - Debug Dashboard</title>
8
- <script type="module" crossorigin src="./assets/index-NYfiXmMn.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-fV4VT_EH.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="./assets/vendor-DBTT3jXp.js">
10
10
  <link rel="stylesheet" crossorigin href="./assets/index-FAG28XEI.css">
11
11
  </head>
@@ -1,6 +1,14 @@
1
- import { DynamicModule, OnModuleInit } from '@nestjs/common';
1
+ import { MiddlewareConsumer, NestModule, DynamicModule, OnModuleInit } from '@nestjs/common';
2
2
  import { NestLensConfig } from './nestlens.config';
3
- export declare class NestLensModule implements OnModuleInit {
3
+ export declare class NestLensModule implements NestModule, OnModuleInit {
4
+ /**
5
+ * Opens a request context around every request.
6
+ *
7
+ * Middleware rather than an interceptor: it calls into the rest of the
8
+ * request synchronously, so a query or cache read recorded deep inside the
9
+ * handler still knows which request it belongs to. See request-context.ts.
10
+ */
11
+ configure(consumer: MiddlewareConsumer): void;
4
12
  private static readonly logger;
5
13
  static forRoot(config?: NestLensConfig): DynamicModule;
6
14
  /**
@@ -19,6 +19,7 @@ const pruning_service_1 = require("./core/pruning.service");
19
19
  const tag_service_1 = require("./core/tag.service");
20
20
  const family_hash_service_1 = require("./core/family-hash.service");
21
21
  const storage_1 = require("./core/storage");
22
+ const request_context_middleware_1 = require("./core/request-context.middleware");
22
23
  const storage_factory_1 = require("./core/storage/storage.factory");
23
24
  const api_1 = require("./api");
24
25
  const watchers_1 = require("./watchers");
@@ -114,6 +115,16 @@ NestLensScheduleModule = NestLensScheduleModule_1 = __decorate([
114
115
  (0, common_1.Module)({})
115
116
  ], NestLensScheduleModule);
116
117
  let NestLensModule = NestLensModule_1 = class NestLensModule {
118
+ /**
119
+ * Opens a request context around every request.
120
+ *
121
+ * Middleware rather than an interceptor: it calls into the rest of the
122
+ * request synchronously, so a query or cache read recorded deep inside the
123
+ * handler still knows which request it belongs to. See request-context.ts.
124
+ */
125
+ configure(consumer) {
126
+ consumer.apply(request_context_middleware_1.RequestContextMiddleware).forRoutes('*');
127
+ }
117
128
  static forRoot(config = {}) {
118
129
  const mergedConfig = this.mergeConfig(config);
119
130
  // If disabled, return empty module
@@ -20,6 +20,7 @@ const operators_1 = require("rxjs/operators");
20
20
  const uuid_1 = require("uuid");
21
21
  const collector_service_1 = require("../core/collector.service");
22
22
  const nestlens_config_1 = require("../nestlens.config");
23
+ const request_context_1 = require("../core/request-context");
23
24
  exports.REQUEST_ID_HEADER = 'x-nestlens-request-id';
24
25
  let RequestWatcher = class RequestWatcher {
25
26
  constructor(collector, nestlensConfig, httpAdapterHost, applicationConfig) {
@@ -70,7 +71,9 @@ let RequestWatcher = class RequestWatcher {
70
71
  if (this.config.ignorePaths?.some((p) => requestPath.startsWith(p))) {
71
72
  return next.handle();
72
73
  }
73
- const requestId = (0, uuid_1.v4)();
74
+ // The context middleware has already opened one for this request; falling
75
+ // back keeps the watcher usable where the middleware did not run.
76
+ const requestId = request.nestlensRequestId ?? (0, request_context_1.currentRequestId)() ?? (0, uuid_1.v4)();
74
77
  const startTime = Date.now();
75
78
  const startMemory = process.memoryUsage().heapUsed;
76
79
  // Attach request ID to request object for correlation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestlens",
3
- "version": "0.8.9",
3
+ "version": "0.8.10",
4
4
  "description": "Laravel Telescope-like debugging and monitoring tool for NestJS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",