@localstack/appinspector-ui 1.0.162 → 1.0.164

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2421,8 +2421,8 @@ var init_event_streams = __esm({
2421
2421
  });
2422
2422
 
2423
2423
  // src/pages/spans-list-page.tsx
2424
- import { Box as Box20, Paper as Paper3 } from "@mui/material";
2425
- import { useCallback as useCallback12, useEffect as useEffect22, useRef as useRef17, useState as useState21 } from "react";
2424
+ import { Box as Box21, Paper as Paper3 } from "@mui/material";
2425
+ import { useCallback as useCallback13, useEffect as useEffect23, useRef as useRef18, useState as useState22 } from "react";
2426
2426
 
2427
2427
  // src/api/errors.ts
2428
2428
  var AppInspectorDisabledError = class extends Error {
@@ -2448,6 +2448,13 @@ var ConnectionError = class extends Error {
2448
2448
  this.cause = cause;
2449
2449
  }
2450
2450
  };
2451
+ var StaleTokenError = class extends Error {
2452
+ constructor(message, cause) {
2453
+ super(message);
2454
+ this.name = "StaleTokenError";
2455
+ this.cause = cause;
2456
+ }
2457
+ };
2451
2458
 
2452
2459
  // src/api/use-api.tsx
2453
2460
  import { createContext, useContext } from "react";
@@ -7405,10 +7412,10 @@ var createHtmlRenderState = function() {
7405
7412
  };
7406
7413
 
7407
7414
  // node_modules/.pnpm/framer-motion@6.5.1_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/framer-motion/dist/es/render/html/use-props.mjs
7408
- function copyRawValuesOnly(target, source, props) {
7409
- for (var key in source) {
7410
- if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
7411
- target[key] = source[key];
7415
+ function copyRawValuesOnly(target, source2, props) {
7416
+ for (var key in source2) {
7417
+ if (!isMotionValue(source2[key]) && !isForcedMotionValue(key, props)) {
7418
+ target[key] = source2[key];
7412
7419
  }
7413
7420
  }
7414
7421
  }
@@ -10194,22 +10201,22 @@ function isNear(value, target, maxDistance) {
10194
10201
  }
10195
10202
  return distance(value, target) < maxDistance;
10196
10203
  }
10197
- function calcAxisDelta(delta, source, target, origin) {
10204
+ function calcAxisDelta(delta, source2, target, origin) {
10198
10205
  if (origin === void 0) {
10199
10206
  origin = 0.5;
10200
10207
  }
10201
10208
  delta.origin = origin;
10202
- delta.originPoint = mix(source.min, source.max, delta.origin);
10203
- delta.scale = calcLength(target) / calcLength(source);
10209
+ delta.originPoint = mix(source2.min, source2.max, delta.origin);
10210
+ delta.scale = calcLength(target) / calcLength(source2);
10204
10211
  if (isNear(delta.scale, 1, 1e-4) || isNaN(delta.scale))
10205
10212
  delta.scale = 1;
10206
10213
  delta.translate = mix(target.min, target.max, delta.origin) - delta.originPoint;
10207
10214
  if (isNear(delta.translate) || isNaN(delta.translate))
10208
10215
  delta.translate = 0;
10209
10216
  }
10210
- function calcBoxDelta(delta, source, target, origin) {
10211
- calcAxisDelta(delta.x, source.x, target.x, origin === null || origin === void 0 ? void 0 : origin.originX);
10212
- calcAxisDelta(delta.y, source.y, target.y, origin === null || origin === void 0 ? void 0 : origin.originY);
10217
+ function calcBoxDelta(delta, source2, target, origin) {
10218
+ calcAxisDelta(delta.x, source2.x, target.x, origin === null || origin === void 0 ? void 0 : origin.originX);
10219
+ calcAxisDelta(delta.y, source2.y, target.y, origin === null || origin === void 0 ? void 0 : origin.originY);
10213
10220
  }
10214
10221
  function calcRelativeAxis(target, relative, parent) {
10215
10222
  target.min = parent.min + relative.min;
@@ -10266,14 +10273,14 @@ function calcViewportConstraints(layoutBox, constraintsBox) {
10266
10273
  y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y)
10267
10274
  };
10268
10275
  }
10269
- function calcOrigin2(source, target) {
10276
+ function calcOrigin2(source2, target) {
10270
10277
  var origin = 0.5;
10271
- var sourceLength = calcLength(source);
10278
+ var sourceLength = calcLength(source2);
10272
10279
  var targetLength = calcLength(target);
10273
10280
  if (targetLength > sourceLength) {
10274
- origin = progress(target.min, target.max - sourceLength, source.min);
10281
+ origin = progress(target.min, target.max - sourceLength, source2.min);
10275
10282
  } else if (sourceLength > targetLength) {
10276
- origin = progress(source.min, source.max - targetLength, target.min);
10283
+ origin = progress(source2.min, source2.max - targetLength, target.min);
10277
10284
  }
10278
10285
  return clamp2(0, 1, origin);
10279
10286
  }
@@ -13087,22 +13094,6 @@ var ResponsiveTimestampCell = memo3(({ date }) => {
13087
13094
  return /* @__PURE__ */ jsx3("span", { style: { display: "inline-block", width: "100%" }, children: formattedTime });
13088
13095
  });
13089
13096
 
13090
- // src/types/error-levels.ts
13091
- var ErrorLevel = {
13092
- ERROR: 3,
13093
- // General error
13094
- IAM_PERMISSION: 5,
13095
- // IAM permission issues
13096
- OK: 2,
13097
- // OK
13098
- // Standard OTEL status codes
13099
- UNSET: 1,
13100
- // Unset
13101
- // Extended custom levels
13102
- WARNING: 4
13103
- // Warning
13104
- };
13105
-
13106
13097
  // src/utils/service-display-name.ts
13107
13098
  var SERVICE_DISPLAY_NAME = {
13108
13099
  "account": "Account",
@@ -15215,6 +15206,22 @@ ServiceCell.displayName = "ServiceCell";
15215
15206
  import { Cancel, Error as Error2, GppBad } from "@mui/icons-material";
15216
15207
  import { Box as Box2, Divider, Tooltip as Tooltip2, Typography as Typography2 } from "@mui/material";
15217
15208
 
15209
+ // src/types/error-levels.ts
15210
+ var ErrorLevel = {
15211
+ ERROR: 3,
15212
+ // General error
15213
+ IAM_PERMISSION: 5,
15214
+ // IAM permission issues
15215
+ OK: 2,
15216
+ // OK
15217
+ // Standard OTEL status codes
15218
+ UNSET: 1,
15219
+ // Unset
15220
+ // Extended custom levels
15221
+ WARNING: 4
15222
+ // Warning
15223
+ };
15224
+
15218
15225
  // src/utils/iam-utils.ts
15219
15226
  function determinePermissionStatus(payload) {
15220
15227
  if (payload.explicit_deny_count && payload.explicit_deny_count > 0) {
@@ -15301,25 +15308,7 @@ function parseIAMEvent(payloadString) {
15301
15308
  }
15302
15309
  }
15303
15310
 
15304
- // src/components/cells/status-cell.tsx
15305
- import { Fragment as Fragment2, jsx as jsx124, jsxs as jsxs119 } from "react/jsx-runtime";
15306
- var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
15307
- switch (errorLevel) {
15308
- case ErrorLevel.ERROR: {
15309
- return /* @__PURE__ */ jsx124(Cancel, { sx: { color: "red" } });
15310
- }
15311
- case ErrorLevel.IAM_PERMISSION: {
15312
- const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
15313
- return /* @__PURE__ */ jsx124(GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
15314
- }
15315
- case ErrorLevel.WARNING: {
15316
- return /* @__PURE__ */ jsx124(Error2, { sx: { color: "orange" } });
15317
- }
15318
- default: {
15319
- return /* @__PURE__ */ jsx124(Fragment2, {});
15320
- }
15321
- }
15322
- };
15311
+ // src/utils/error-level.ts
15323
15312
  var calculateHighestErrorLevel = (span) => {
15324
15313
  if (span.operation_status) {
15325
15314
  switch (span.operation_status) {
@@ -15351,6 +15340,26 @@ var calculateHighestErrorLevel = (span) => {
15351
15340
  if (hasWarning) return ErrorLevel.WARNING;
15352
15341
  return span.status_code || ErrorLevel.UNSET;
15353
15342
  };
15343
+
15344
+ // src/components/cells/status-cell.tsx
15345
+ import { Fragment as Fragment2, jsx as jsx124, jsxs as jsxs119 } from "react/jsx-runtime";
15346
+ var StatusIcon = ({ errorLevel, operationStatus, spanStatusCode }) => {
15347
+ switch (errorLevel) {
15348
+ case ErrorLevel.ERROR: {
15349
+ return /* @__PURE__ */ jsx124(Cancel, { sx: { color: "red" } });
15350
+ }
15351
+ case ErrorLevel.IAM_PERMISSION: {
15352
+ const isDenial = operationStatus ? operationStatus === "iam_explicit_deny" || operationStatus === "iam_implicit_deny" : spanStatusCode === 2;
15353
+ return /* @__PURE__ */ jsx124(GppBad, { sx: { color: isDenial ? "red" : "warning.main" } });
15354
+ }
15355
+ case ErrorLevel.WARNING: {
15356
+ return /* @__PURE__ */ jsx124(Error2, { sx: { color: "orange" } });
15357
+ }
15358
+ default: {
15359
+ return /* @__PURE__ */ jsx124(Fragment2, {});
15360
+ }
15361
+ }
15362
+ };
15354
15363
  var SPAN_STATUS_LABELS = {
15355
15364
  0: "Unset",
15356
15365
  1: "OK",
@@ -15520,47 +15529,26 @@ import {
15520
15529
  Typography as Typography4
15521
15530
  } from "@mui/material";
15522
15531
  import { useState as useState5 } from "react";
15523
- import { Fragment as Fragment4, jsx as jsx126, jsxs as jsxs121 } from "react/jsx-runtime";
15532
+
15533
+ // src/utils/spans-filters.ts
15524
15534
  var EMPTY_FILTERS = {
15525
15535
  consumerService: [],
15526
15536
  producerService: [],
15527
15537
  status: []
15528
15538
  };
15529
15539
  var EXTERNAL_PRODUCER_VALUE = "__external__";
15530
- function applyFilters(spans, filters) {
15531
- if (isFiltersEmpty(filters)) return spans;
15532
- return spans.filter((span) => {
15533
- if (filters.consumerService.length > 0 && !filters.consumerService.includes(span.service_name)) {
15534
- return false;
15535
- }
15536
- if (filters.producerService.length > 0) {
15537
- const includesExternal = filters.producerService.includes(EXTERNAL_PRODUCER_VALUE);
15538
- const namedServices = filters.producerService.filter((value) => value !== EXTERNAL_PRODUCER_VALUE);
15539
- const matchesExternal = includesExternal && !span.parent_service_name;
15540
- const matchesNamed = namedServices.length > 0 && !!span.parent_service_name && namedServices.includes(span.parent_service_name);
15541
- if (!matchesExternal && !matchesNamed) return false;
15542
- }
15543
- if (filters.status.length > 0) {
15544
- if (!span.operation_status) return false;
15545
- if (!filters.status.includes(collapseStatusValue(span.operation_status))) return false;
15546
- }
15547
- return true;
15548
- });
15549
- }
15550
15540
  function isFiltersEmpty(filters) {
15551
15541
  return filters.consumerService.length === 0 && filters.producerService.length === 0 && filters.status.length === 0;
15552
15542
  }
15543
+
15544
+ // src/components/spans-list/spans-filter-bar.tsx
15545
+ import { Fragment as Fragment4, jsx as jsx126, jsxs as jsxs121 } from "react/jsx-runtime";
15553
15546
  var STATUS_LABELS = {
15554
15547
  error: "Error",
15555
15548
  iam_deny: "IAM Deny",
15556
15549
  iam_warn: "IAM Warning",
15557
15550
  ok: "Success"
15558
15551
  };
15559
- var collapseStatusValue = (status) => {
15560
- if (status === "iam_explicit_deny" || status === "iam_implicit_deny") return "iam_deny";
15561
- if (status === "iam_explicit_warn" || status === "iam_implicit_warn") return "iam_warn";
15562
- return status;
15563
- };
15564
15552
  var statusOptionIcon = (value) => {
15565
15553
  switch (value) {
15566
15554
  case "error": {
@@ -15860,21 +15848,29 @@ var SpansDataGridRow = memo8(
15860
15848
  );
15861
15849
  var SpansDataGrid = ({
15862
15850
  clearingSpans,
15851
+ consumerValues,
15863
15852
  errorCount: _errorCount,
15864
15853
  fetchingBackward,
15865
15854
  fetchingForward,
15855
+ filteredErrorCount,
15856
+ filteredSpans,
15857
+ filteredWarningCount,
15858
+ filters,
15859
+ hasExternalProducer,
15866
15860
  hasMoreBackward,
15867
15861
  hasMoreForward,
15868
15862
  licenseLimit,
15869
15863
  onClearSpans,
15864
+ onFiltersChange,
15870
15865
  onOrderChange,
15871
15866
  onSearchChange,
15872
15867
  onSpanClick,
15873
15868
  order: order2,
15869
+ producerValues,
15874
15870
  search,
15875
15871
  searching,
15876
15872
  searchSupported,
15877
- spans,
15873
+ statusValues,
15878
15874
  systemLimit,
15879
15875
  totalCount,
15880
15876
  warningCount: _warningCount
@@ -15889,7 +15885,6 @@ var SpansDataGrid = ({
15889
15885
  clearTimeout(handle);
15890
15886
  };
15891
15887
  }, [searchDraft, onSearchChange]);
15892
- const [filters, setFilters] = useState6(EMPTY_FILTERS);
15893
15888
  const filtersActive = !isFiltersEmpty(filters);
15894
15889
  const activeFilterNames = [
15895
15890
  filters.producerService.length > 0 && "Producer",
@@ -15904,17 +15899,15 @@ var SpansDataGrid = ({
15904
15899
  const handleClearAll = useCallback2(() => {
15905
15900
  setSearchDraft("");
15906
15901
  onSearchChange("");
15907
- setFilters(EMPTY_FILTERS);
15908
- }, [onSearchChange]);
15902
+ onFiltersChange(EMPTY_FILTERS);
15903
+ }, [onSearchChange, onFiltersChange]);
15909
15904
  const handleClearSpans = useCallback2(() => {
15910
15905
  setSearchDraft("");
15911
- setFilters(EMPTY_FILTERS);
15906
+ onFiltersChange(EMPTY_FILTERS);
15912
15907
  onClearSpans();
15913
- }, [onClearSpans]);
15908
+ }, [onClearSpans, onFiltersChange]);
15914
15909
  const producerOptions = useMemo4(() => {
15915
- const services = new Set(
15916
- spans?.map((span) => span.parent_service_name).filter(Boolean) ?? []
15917
- );
15910
+ const services = new Set(producerValues);
15918
15911
  for (const value of filters.producerService) {
15919
15912
  if (value !== EXTERNAL_PRODUCER_VALUE) services.add(value);
15920
15913
  }
@@ -15923,48 +15916,29 @@ var SpansDataGrid = ({
15923
15916
  serviceCode: service,
15924
15917
  value: service
15925
15918
  }));
15926
- const hasExternalProducer = spans?.some((span) => !span.parent_service_name);
15927
15919
  if (hasExternalProducer || filters.producerService.includes(EXTERNAL_PRODUCER_VALUE)) {
15928
15920
  options.push({ label: "External producer", value: EXTERNAL_PRODUCER_VALUE });
15929
15921
  }
15930
15922
  return options;
15931
- }, [spans, filters.producerService]);
15923
+ }, [producerValues, hasExternalProducer, filters.producerService]);
15932
15924
  const consumerOptions = useMemo4(() => {
15933
- const services = new Set(spans?.map((span) => span.service_name) ?? []);
15925
+ const services = new Set(consumerValues);
15934
15926
  for (const value of filters.consumerService) services.add(value);
15935
15927
  return [...services].toSorted().map((service) => ({
15936
15928
  label: getServiceDisplayName(service),
15937
15929
  serviceCode: service,
15938
15930
  value: service
15939
15931
  }));
15940
- }, [spans, filters.consumerService]);
15932
+ }, [consumerValues, filters.consumerService]);
15941
15933
  const statusOptions = useMemo4(() => {
15942
- const statuses = new Set(
15943
- spans?.map((span) => span.operation_status).filter(Boolean).map((s) => collapseStatusValue(s))
15944
- );
15934
+ const statuses = new Set(statusValues);
15945
15935
  for (const value of filters.status) statuses.add(value);
15946
15936
  return [...statuses].toSorted().map((status) => ({
15947
15937
  icon: statusOptionIcon(status),
15948
15938
  label: STATUS_LABELS[status] ?? status,
15949
15939
  value: status
15950
15940
  }));
15951
- }, [spans, filters.status]);
15952
- const filteredSpans = useMemo4(() => {
15953
- if (!spans) return;
15954
- if (!filtersActive) return spans;
15955
- return applyFilters(spans, filters);
15956
- }, [spans, filters, filtersActive]);
15957
- const filteredErrorCount = useMemo4(
15958
- () => filteredSpans?.filter((span) => {
15959
- const level = calculateHighestErrorLevel(span);
15960
- return level === ErrorLevel.ERROR || level === ErrorLevel.IAM_PERMISSION;
15961
- }).length,
15962
- [filteredSpans]
15963
- );
15964
- const filteredWarningCount = useMemo4(
15965
- () => filteredSpans?.filter((span) => calculateHighestErrorLevel(span) === ErrorLevel.WARNING).length,
15966
- [filteredSpans]
15967
- );
15941
+ }, [statusValues, filters.status]);
15968
15942
  const columns = useMemo4(() => [
15969
15943
  columnHelper.accessor("startTime", {
15970
15944
  cell: (props) => /* @__PURE__ */ jsx127(ResponsiveTimestampCell, { date: props.getValue() }),
@@ -16101,7 +16075,7 @@ var SpansDataGrid = ({
16101
16075
  const element = containerRef.current;
16102
16076
  if (!element || !isAtLiveEdgeRef.current) return;
16103
16077
  element.scrollTop = element.scrollHeight;
16104
- }, [order2, spans?.length, lastSpanId]);
16078
+ }, [order2, filteredSpans?.length, lastSpanId]);
16105
16079
  return /* @__PURE__ */ jsxs122(Fragment5, { children: [
16106
16080
  /* @__PURE__ */ jsx127(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsxs122(Box5, { sx: { display: "flex", flexDirection: "column", gap: "0.5rem", pt: 1, px: 1 }, children: [
16107
16081
  /* @__PURE__ */ jsxs122(Box5, { sx: { alignItems: "center", display: "flex", flexWrap: "wrap", gap: "0.5rem" }, children: [
@@ -16119,7 +16093,7 @@ var SpansDataGrid = ({
16119
16093
  {
16120
16094
  consumerOptions,
16121
16095
  filters,
16122
- onFiltersChange: setFilters,
16096
+ onFiltersChange,
16123
16097
  producerOptions,
16124
16098
  statusOptions
16125
16099
  }
@@ -16238,7 +16212,7 @@ var SpansDataGrid = ({
16238
16212
  )) }, headerGroup.id);
16239
16213
  }) }),
16240
16214
  /* @__PURE__ */ jsxs122(TableBody, { children: [
16241
- (spans === void 0 || clearingSpans || searching) && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx127(CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
16215
+ (filteredSpans === void 0 || clearingSpans || searching) && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx127(CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
16242
16216
  !clearingSpans && !searching && filteredSpans?.length === 0 && (searchActive || filtersActive ? /* @__PURE__ */ jsx127(
16243
16217
  NoMatchRow,
16244
16218
  {
@@ -16345,21 +16319,29 @@ var SpansList = (props) => {
16345
16319
  SpansDataGrid,
16346
16320
  {
16347
16321
  clearingSpans: props.clearingSpans,
16322
+ consumerValues: props.consumerValues,
16348
16323
  errorCount: props.errorCount,
16349
16324
  fetchingBackward: props.fetchingBackward,
16350
16325
  fetchingForward: props.fetchingForward,
16326
+ filteredErrorCount: props.filteredErrorCount,
16327
+ filteredSpans: props.filteredSpans,
16328
+ filteredWarningCount: props.filteredWarningCount,
16329
+ filters: props.filters,
16330
+ hasExternalProducer: props.hasExternalProducer,
16351
16331
  hasMoreBackward: props.hasMoreBackward,
16352
16332
  hasMoreForward: props.hasMoreForward,
16353
16333
  licenseLimit: props.licenseLimit,
16354
16334
  onClearSpans: props.onClearSpans,
16335
+ onFiltersChange: props.onFiltersChange,
16355
16336
  onOrderChange: props.onOrderChange,
16356
16337
  onSearchChange: props.onSearchChange,
16357
16338
  onSpanClick: props.onSpanClick,
16358
16339
  order: props.order,
16340
+ producerValues: props.producerValues,
16359
16341
  search: props.search,
16360
16342
  searching: props.searching,
16361
16343
  searchSupported: props.searchSupported,
16362
- spans: props.spans,
16344
+ statusValues: props.statusValues,
16363
16345
  systemLimit: props.systemLimit,
16364
16346
  totalCount: props.totalCount,
16365
16347
  warningCount: props.warningCount
@@ -16579,6 +16561,46 @@ var StatusMessage = ({
16579
16561
  return /* @__PURE__ */ jsx129(Fragment6, {});
16580
16562
  };
16581
16563
 
16564
+ // src/components/worker-error-message/worker-error-message.tsx
16565
+ import { ErrorOutline as ErrorOutline2 } from "@mui/icons-material";
16566
+ import { Alert as Alert4, AlertTitle as AlertTitle2, Box as Box8, Button as Button6, Typography as Typography7 } from "@mui/material";
16567
+ import { jsx as jsx130, jsxs as jsxs125 } from "react/jsx-runtime";
16568
+ var WorkerErrorMessage = ({ error, onRetry }) => /* @__PURE__ */ jsx130(
16569
+ Box8,
16570
+ {
16571
+ sx: {
16572
+ alignItems: "center",
16573
+ display: "flex",
16574
+ flexDirection: "column",
16575
+ gap: 2,
16576
+ justifyContent: "center",
16577
+ p: 4
16578
+ },
16579
+ children: /* @__PURE__ */ jsxs125(
16580
+ Alert4,
16581
+ {
16582
+ icon: /* @__PURE__ */ jsx130(ErrorOutline2, { fontSize: "large" }),
16583
+ severity: "error",
16584
+ sx: { maxWidth: 600, width: "100%" },
16585
+ children: [
16586
+ /* @__PURE__ */ jsx130(AlertTitle2, { sx: { fontWeight: "bold" }, children: "Unable to Start Span Filtering" }),
16587
+ /* @__PURE__ */ jsx130(Typography7, { sx: { mb: 2 }, variant: "body2", children: "App Inspector couldn't start the background worker that filters and sorts operations. This is usually caused by a Content-Security-Policy blocking Web Workers in this environment." }),
16588
+ /* @__PURE__ */ jsx130(Typography7, { sx: { fontFamily: "monospace", mb: 2 }, variant: "caption", children: error.message }),
16589
+ onRetry && /* @__PURE__ */ jsx130(Box8, { sx: { display: "flex", justifyContent: "flex-start" }, children: /* @__PURE__ */ jsx130(
16590
+ Button6,
16591
+ {
16592
+ "aria-label": "Retry starting the spans filter worker",
16593
+ onClick: onRetry,
16594
+ variant: "outlined",
16595
+ children: "Retry"
16596
+ }
16597
+ ) })
16598
+ ]
16599
+ }
16600
+ )
16601
+ }
16602
+ );
16603
+
16582
16604
  // src/hooks/status-provider.tsx
16583
16605
  import { createContext as createContext8, useContext as useContext14 } from "react";
16584
16606
 
@@ -16665,11 +16687,11 @@ function useConnectionStateMachine() {
16665
16687
  }
16666
16688
 
16667
16689
  // src/hooks/status-provider.tsx
16668
- import { jsx as jsx130 } from "react/jsx-runtime";
16690
+ import { jsx as jsx131 } from "react/jsx-runtime";
16669
16691
  var AppInspectorStatusContext = createContext8(void 0);
16670
16692
  var StatusProvider = ({ children }) => {
16671
16693
  const value = useConnectionStateMachine();
16672
- return /* @__PURE__ */ jsx130(AppInspectorStatusContext.Provider, { value, children });
16694
+ return /* @__PURE__ */ jsx131(AppInspectorStatusContext.Provider, { value, children });
16673
16695
  };
16674
16696
  var useAppInspectorStatus = () => {
16675
16697
  const value = useContext14(AppInspectorStatusContext);
@@ -16725,7 +16747,7 @@ function useLocalStorage(key, initialValue) {
16725
16747
  }
16726
16748
 
16727
16749
  // src/hooks/use-spans.ts
16728
- import { useCallback as useCallback7, useEffect as useEffect16, useRef as useRef10, useState as useState11 } from "react";
16750
+ import { useCallback as useCallback8, useEffect as useEffect17, useMemo as useMemo6, useRef as useRef11, useState as useState12 } from "react";
16729
16751
 
16730
16752
  // src/utils/pagination-buffer.ts
16731
16753
  var insertSorted = (array, item, compareFunction, hint = "back") => {
@@ -16840,6 +16862,7 @@ var createPaginationBuffer = (options) => {
16840
16862
  nextForwardToken = newPage.nextForwardToken;
16841
16863
  hasMoreBackward ??= newPage.hasMoreBackward;
16842
16864
  nextBackwardToken ??= newPage.nextBackwardToken;
16865
+ options.onPageFetched?.("forward", newPage.items);
16843
16866
  reportDataChange();
16844
16867
  } catch (error) {
16845
16868
  if (controller.signal.aborted) {
@@ -16877,6 +16900,7 @@ var createPaginationBuffer = (options) => {
16877
16900
  nextBackwardToken = newPage.nextBackwardToken;
16878
16901
  hasMoreForward ??= newPage.hasMoreForward;
16879
16902
  nextForwardToken ??= newPage.nextForwardToken;
16903
+ options.onPageFetched?.("backward", newPage.items);
16880
16904
  reportDataChange();
16881
16905
  } catch (error) {
16882
16906
  if (controller.signal.aborted) {
@@ -16941,8 +16965,92 @@ var createPaginationBuffer = (options) => {
16941
16965
  };
16942
16966
  };
16943
16967
 
16968
+ // src/workers/spans-reducer.ts
16969
+ var toSpanFilterProjection = (span) => ({
16970
+ errors: span.errors?.map((error) => ({ level: error.level })),
16971
+ events: span.events.map((event) => ({
16972
+ attributes: typeof event.attributes?.payload === "string" ? { payload: event.attributes.payload } : void 0,
16973
+ event_type: event.event_type
16974
+ })),
16975
+ operation_status: span.operation_status,
16976
+ parent_service_name: span.parent_service_name,
16977
+ service_name: span.service_name,
16978
+ span_id: span.span_id,
16979
+ start_time_unix_nano: span.start_time_unix_nano,
16980
+ status_code: span.status_code
16981
+ });
16982
+
16983
+ // src/hooks/use-spans-compute.ts
16984
+ import { useCallback as useCallback5, useEffect as useEffect14, useRef as useRef8, useState as useState10 } from "react";
16985
+
16986
+ // inline-worker:/home/runner/work/localstack-appinspector-ui/localstack-appinspector-ui/src/workers/spans-worker.worker.ts
16987
+ var source = '(() => {\n // src/types/error-levels.ts\n var ErrorLevel = {\n ERROR: 3,\n // General error\n IAM_PERMISSION: 5,\n // IAM permission issues\n OK: 2,\n // OK\n // Standard OTEL status codes\n UNSET: 1,\n // Unset\n // Extended custom levels\n WARNING: 4\n // Warning\n };\n\n // src/utils/iam-utils.ts\n function determinePermissionStatus(payload) {\n if (payload.explicit_deny_count && payload.explicit_deny_count > 0) {\n return "explicitly_denied";\n }\n if (payload.is_allowed && payload.explicit_allow_count && payload.explicit_allow_count > 0) {\n return "explicitly_allowed";\n }\n if (payload.is_allowed) {\n return "implicitly_allowed";\n }\n return "implicitly_denied";\n }\n function parseIAMEvent(payloadString) {\n try {\n const payload = JSON.parse(payloadString);\n const permission = determinePermissionStatus(payload);\n const actions = [];\n const resources = [];\n if (payload.explicit_allows) {\n for (const allow of payload.explicit_allows) {\n if (!actions.includes(allow.action)) actions.push(allow.action);\n if (!resources.includes(allow.resource)) resources.push(allow.resource);\n }\n }\n if (payload.explicit_denies) {\n for (const deny of payload.explicit_denies) {\n if (!actions.includes(deny.action)) actions.push(deny.action);\n if (!resources.includes(deny.resource)) resources.push(deny.resource);\n }\n }\n if (payload.implicit_denies) {\n for (const deny of payload.implicit_denies) {\n if (!actions.includes(deny.action)) actions.push(deny.action);\n if (!resources.includes(deny.resource)) resources.push(deny.resource);\n }\n }\n return {\n details: {\n actions,\n explicitAllows: payload.explicit_allow_count,\n explicitDenies: payload.explicit_deny_count,\n implicitDenies: payload.implicit_deny_count,\n resources\n },\n operation: payload.operation,\n permission,\n principal: payload.principal_arn,\n service: payload.service\n };\n } catch (error) {\n console.error("Error parsing IAM event payload:", error);\n return void 0;\n }\n }\n\n // src/utils/error-level.ts\n var calculateHighestErrorLevel = (span) => {\n if (span.operation_status) {\n switch (span.operation_status) {\n case "error": {\n return ErrorLevel.ERROR;\n }\n case "iam_explicit_deny":\n case "iam_explicit_warn":\n case "iam_implicit_deny":\n case "iam_implicit_warn": {\n return ErrorLevel.IAM_PERMISSION;\n }\n default: {\n return ErrorLevel.OK;\n }\n }\n }\n const hasIamDenial = span.events.some((event) => {\n if (!event.event_type?.toLowerCase().includes("iam")) return false;\n if (typeof event.attributes?.payload !== "string") return false;\n const parsed = parseIAMEvent(event.attributes.payload);\n return parsed?.permission === "explicitly_denied" || parsed?.permission === "implicitly_denied";\n });\n if (hasIamDenial) return ErrorLevel.IAM_PERMISSION;\n if (span.status_code === 2) return ErrorLevel.ERROR;\n const hasErrorInErrors = span.errors?.some((error) => error.level === "error");\n if (hasErrorInErrors) return ErrorLevel.ERROR;\n const hasWarning = span.errors?.some((error) => error.level === "warning");\n if (hasWarning) return ErrorLevel.WARNING;\n return span.status_code || ErrorLevel.UNSET;\n };\n\n // src/utils/spans-filters.ts\n var EMPTY_FILTERS = {\n consumerService: [],\n producerService: [],\n status: []\n };\n var EXTERNAL_PRODUCER_VALUE = "__external__";\n function isFiltersEmpty(filters) {\n return filters.consumerService.length === 0 && filters.producerService.length === 0 && filters.status.length === 0;\n }\n var collapseStatusValue = (status) => {\n if (status === "iam_explicit_deny" || status === "iam_implicit_deny") return "iam_deny";\n if (status === "iam_explicit_warn" || status === "iam_implicit_warn") return "iam_warn";\n return status;\n };\n function applyFilters(spans, filters) {\n if (isFiltersEmpty(filters)) return spans;\n return spans.filter((span) => {\n if (filters.consumerService.length > 0 && !filters.consumerService.includes(span.service_name)) {\n return false;\n }\n if (filters.producerService.length > 0) {\n const includesExternal = filters.producerService.includes(EXTERNAL_PRODUCER_VALUE);\n const namedServices = filters.producerService.filter((value) => value !== EXTERNAL_PRODUCER_VALUE);\n const matchesExternal = includesExternal && !span.parent_service_name;\n const matchesNamed = namedServices.length > 0 && !!span.parent_service_name && namedServices.includes(span.parent_service_name);\n if (!matchesExternal && !matchesNamed) return false;\n }\n if (filters.status.length > 0) {\n if (!span.operation_status) return false;\n if (!filters.status.includes(collapseStatusValue(span.operation_status))) return false;\n }\n return true;\n });\n }\n\n // src/workers/spans-reducer.ts\n var compareByStartTime = (a, b) => a.start_time_unix_nano < b.start_time_unix_nano ? -1 : 1;\n var insertSorted = (array, item, compareFunction, hint) => {\n let left;\n let right;\n if (hint === "back") {\n left = array.length;\n right = array.length;\n let step = 1;\n while (left > 0 && compareFunction(array[left - 1], item) > 0) {\n right = left;\n left = Math.max(0, left - step);\n step *= 2;\n }\n } else {\n left = 0;\n right = 0;\n let step = 1;\n while (right < array.length && compareFunction(array[right], item) <= 0) {\n left = right + 1;\n right = Math.min(array.length, right + step);\n step *= 2;\n }\n }\n while (left < right) {\n const mid = left + right >>> 1;\n if (compareFunction(array[mid], item) <= 0) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n array.splice(left, 0, item);\n };\n var createSpansReducer = () => {\n let corpus = [];\n let filters = EMPTY_FILTERS;\n const computeResult = () => {\n const filtered = applyFilters(corpus, filters);\n let errorCount = 0;\n let warningCount = 0;\n const orderedFilteredIds = [];\n for (const entry of filtered) {\n orderedFilteredIds.push(entry.span_id);\n if (entry.errorLevel === ErrorLevel.ERROR || entry.errorLevel === ErrorLevel.IAM_PERMISSION) {\n errorCount++;\n } else if (entry.errorLevel === ErrorLevel.WARNING) {\n warningCount++;\n }\n }\n const producers = /* @__PURE__ */ new Set();\n const consumers = /* @__PURE__ */ new Set();\n const statuses = /* @__PURE__ */ new Set();\n let hasExternalProducer = false;\n for (const entry of corpus) {\n if (entry.parent_service_name) producers.add(entry.parent_service_name);\n else hasExternalProducer = true;\n consumers.add(entry.service_name);\n if (entry.operation_status) statuses.add(collapseStatusValue(entry.operation_status));\n }\n return {\n consumerValues: [...consumers].toSorted(),\n errorCount,\n hasExternalProducer,\n orderedFilteredIds,\n producerValues: [...producers].toSorted(),\n statusValues: [...statuses].toSorted(),\n warningCount\n };\n };\n return {\n addPage: (direction, projections) => {\n const hint = direction === "forward" ? "back" : "front";\n const sorted = projections.toSorted(compareByStartTime);\n for (const projection of sorted) {\n insertSorted(corpus, { ...projection, errorLevel: calculateHighestErrorLevel(projection) }, compareByStartTime, hint);\n }\n return computeResult();\n },\n clear: () => {\n corpus = [];\n filters = EMPTY_FILTERS;\n return computeResult();\n },\n setFilters: (next) => {\n filters = next;\n return computeResult();\n }\n };\n };\n\n // src/workers/spans-worker.worker.ts\n var context = globalThis;\n var reducer = createSpansReducer();\n context.addEventListener("message", (event) => {\n const request = event.data;\n const result = request.op === "addPage" ? reducer.addPage(request.direction, request.projections) : request.op === "setFilters" ? reducer.setFilters(request.filters) : reducer.clear();\n context.postMessage({ result, seq: request.seq });\n });\n})();\n';
16988
+ function createInlineWorker() {
16989
+ const url = URL.createObjectURL(new Blob([source], { type: "text/javascript" }));
16990
+ try {
16991
+ return new Worker(url);
16992
+ } finally {
16993
+ URL.revokeObjectURL(url);
16994
+ }
16995
+ }
16996
+
16997
+ // src/hooks/use-spans-compute.ts
16998
+ var EMPTY_RESULT = {
16999
+ consumerValues: [],
17000
+ errorCount: 0,
17001
+ hasExternalProducer: false,
17002
+ orderedFilteredIds: [],
17003
+ producerValues: [],
17004
+ statusValues: [],
17005
+ warningCount: 0
17006
+ };
17007
+ var useSpansCompute = () => {
17008
+ const [result, setResult] = useState10(EMPTY_RESULT);
17009
+ const [workerError, setWorkerError] = useState10();
17010
+ const [retryCount, setRetryCount] = useState10(0);
17011
+ const workerRef = useRef8();
17012
+ const seqRef = useRef8(0);
17013
+ const lastAppliedRef = useRef8(0);
17014
+ useEffect14(() => {
17015
+ try {
17016
+ const worker = createInlineWorker();
17017
+ worker.addEventListener("message", (event) => {
17018
+ const { result: nextResult, seq } = event.data;
17019
+ if (seq < lastAppliedRef.current) return;
17020
+ lastAppliedRef.current = seq;
17021
+ setResult(nextResult);
17022
+ });
17023
+ worker.addEventListener("error", (event) => {
17024
+ setWorkerError(new Error(event.message || "Spans filter worker crashed."));
17025
+ });
17026
+ workerRef.current = worker;
17027
+ return () => {
17028
+ worker.terminate();
17029
+ workerRef.current = void 0;
17030
+ };
17031
+ } catch (error) {
17032
+ setWorkerError(error instanceof Error ? error : new Error("Failed to start the spans filter worker."));
17033
+ return;
17034
+ }
17035
+ }, [retryCount]);
17036
+ const retryWorker = useCallback5(() => {
17037
+ setWorkerError(void 0);
17038
+ setRetryCount((count2) => count2 + 1);
17039
+ }, []);
17040
+ const addPage = useCallback5((direction, projections) => {
17041
+ workerRef.current?.postMessage({ direction, op: "addPage", projections, seq: ++seqRef.current });
17042
+ }, []);
17043
+ const setFilters = useCallback5((filters) => {
17044
+ workerRef.current?.postMessage({ filters, op: "setFilters", seq: ++seqRef.current });
17045
+ }, []);
17046
+ const clear = useCallback5(() => {
17047
+ workerRef.current?.postMessage({ op: "clear", seq: ++seqRef.current });
17048
+ }, []);
17049
+ return { addPage, clear, result, retryWorker, setFilters, workerError };
17050
+ };
17051
+
16944
17052
  // src/hooks/use-spans-ws.tsx
16945
- import { useCallback as useCallback6, useEffect as useEffect15, useRef as useRef9, useState as useState10 } from "react";
17053
+ import { useCallback as useCallback7, useEffect as useEffect16, useRef as useRef10, useState as useState11 } from "react";
16946
17054
 
16947
17055
  // src/config.ts
16948
17056
  var APPINSPECTOR_API_PREFIX = "/_localstack/appinspector";
@@ -16972,7 +17080,7 @@ var LOCALSTACK_INFO_PATH = "/_localstack/info";
16972
17080
 
16973
17081
  // src/context.tsx
16974
17082
  import { createContext as createContext9, useContext as useContext15 } from "react";
16975
- import { useCallback as useCallback5, useMemo as useMemo5 } from "react";
17083
+ import { useCallback as useCallback6, useMemo as useMemo5 } from "react";
16976
17084
 
16977
17085
  // src/api/client.ts
16978
17086
  var import_semver2 = __toESM(require_semver2(), 1);
@@ -16981,7 +17089,8 @@ var import_semver2 = __toESM(require_semver2(), 1);
16981
17089
  var ERROR_MESSAGES = {
16982
17090
  APP_INSPECTOR_DISABLED: "App Inspector is currently disabled.",
16983
17091
  APP_INSPECTOR_NOT_FOUND: "App Inspector API not found. Please ensure App Inspector is licensed and enabled.",
16984
- CONNECTION_FAILED: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible."
17092
+ CONNECTION_FAILED: "Failed to connect to LocalStack. Please ensure LocalStack is running and accessible.",
17093
+ STALE_PAGINATION_TOKEN: "Pagination token is from a previous session."
16985
17094
  };
16986
17095
 
16987
17096
  // src/utils/logger.ts
@@ -17044,6 +17153,16 @@ function unixNanoToMilliseconds(unixNanoString) {
17044
17153
  // src/api/client.ts
17045
17154
  var apiLogger = createScopedLogger("API");
17046
17155
  var analyticsLogger = createScopedLogger("ANALYTICS");
17156
+ var isStalePaginationTokenMessage = (body) => {
17157
+ let candidate = body;
17158
+ try {
17159
+ const parsed = JSON.parse(body);
17160
+ const messageField = [parsed.message, parsed.error, parsed.detail].find((value) => typeof value === "string");
17161
+ candidate = typeof messageField === "string" ? messageField : body;
17162
+ } catch {
17163
+ }
17164
+ return candidate.toLowerCase().includes("previous session");
17165
+ };
17047
17166
  var makeRequest = async (options) => {
17048
17167
  const url = getAppInspectorApiUrl(options.localstackEndpoint, options.endpoint);
17049
17168
  try {
@@ -17067,6 +17186,15 @@ var makeRequest = async (options) => {
17067
17186
  new Error(`503 from ${url}: ${response.statusText}`)
17068
17187
  );
17069
17188
  }
17189
+ if (response.status === 400) {
17190
+ const body = await response.text().catch(() => "");
17191
+ if (isStalePaginationTokenMessage(body)) {
17192
+ throw new StaleTokenError(
17193
+ ERROR_MESSAGES.STALE_PAGINATION_TOKEN,
17194
+ new Error(`400 from ${url}: ${response.statusText}`)
17195
+ );
17196
+ }
17197
+ }
17070
17198
  throw new Error(`API request failed: ${response.status.toString()} ${response.statusText}`);
17071
17199
  }
17072
17200
  options.captureHeaders?.(response.headers);
@@ -17221,7 +17349,7 @@ var createApiClient = ({ localstackEndpoint }) => {
17221
17349
  };
17222
17350
 
17223
17351
  // src/hooks/use-appinspector-open-analytics.ts
17224
- import { useEffect as useEffect14, useRef as useRef8 } from "react";
17352
+ import { useEffect as useEffect15, useRef as useRef9 } from "react";
17225
17353
 
17226
17354
  // node_modules/.pnpm/ua-parser-js@2.0.9/node_modules/ua-parser-js/src/main/ua-parser.mjs
17227
17355
  var LIBVERSION = "2.0.9";
@@ -19103,8 +19231,8 @@ var useAppInspectorOpenAnalytics = () => {
19103
19231
  const api = useAppInspectorApi();
19104
19232
  const { deploymentContainer } = useAppInspector();
19105
19233
  const { status, statusError } = useAppInspectorStatus();
19106
- const firedRef = useRef8(false);
19107
- useEffect14(() => {
19234
+ const firedRef = useRef9(false);
19235
+ useEffect15(() => {
19108
19236
  if (firedRef.current) {
19109
19237
  return;
19110
19238
  }
@@ -19124,7 +19252,7 @@ var useAppInspectorOpenAnalytics = () => {
19124
19252
  };
19125
19253
 
19126
19254
  // src/context.tsx
19127
- import { Fragment as Fragment7, jsx as jsx131 } from "react/jsx-runtime";
19255
+ import { Fragment as Fragment7, jsx as jsx132 } from "react/jsx-runtime";
19128
19256
  var AppInspectorContext = createContext9(void 0);
19129
19257
  var useAppInspector = () => {
19130
19258
  const context = useContext15(AppInspectorContext);
@@ -19135,14 +19263,14 @@ var useAppInspector = () => {
19135
19263
  };
19136
19264
  var AppInspectorAnalyticsBoundary = ({ children }) => {
19137
19265
  useAppInspectorOpenAnalytics();
19138
- return /* @__PURE__ */ jsx131(Fragment7, { children });
19266
+ return /* @__PURE__ */ jsx132(Fragment7, { children });
19139
19267
  };
19140
19268
  var AppInspectorContextProvider = (props) => {
19141
19269
  const api = useMemo5(
19142
19270
  () => createApiClient({ localstackEndpoint: props.localstackEndpoint }),
19143
19271
  [props.localstackEndpoint]
19144
19272
  );
19145
- const resolveLink = useCallback5(
19273
+ const resolveLink = useCallback6(
19146
19274
  (options) => {
19147
19275
  if (options.to === "settings") {
19148
19276
  return `${props.routePrefix}/settings`;
@@ -19168,31 +19296,61 @@ var AppInspectorContextProvider = (props) => {
19168
19296
  }),
19169
19297
  [deploymentContainer, props.headerHeight, props.linkComponent, props.localstackEndpoint, resolveLink]
19170
19298
  );
19171
- return /* @__PURE__ */ jsx131(ApiProvider, { api, children: /* @__PURE__ */ jsx131(StatusProvider, { children: /* @__PURE__ */ jsx131(AppInspectorContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx131(AppInspectorAnalyticsBoundary, { children: props.children }) }) }) });
19299
+ return /* @__PURE__ */ jsx132(ApiProvider, { api, children: /* @__PURE__ */ jsx132(StatusProvider, { children: /* @__PURE__ */ jsx132(AppInspectorContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx132(AppInspectorAnalyticsBoundary, { children: props.children }) }) }) });
19172
19300
  };
19173
19301
 
19174
19302
  // src/hooks/use-spans-ws.tsx
19303
+ var wsLogger = createScopedLogger("WS");
19304
+ var isLegacySpanFields = (value) => {
19305
+ return typeof value.span_id === "string" && typeof value.trace_id === "string" && typeof value.timestamp === "string";
19306
+ };
19307
+ var parseSpansWebSocketMessage = (raw) => {
19308
+ const parsed = JSON.parse(raw);
19309
+ if (typeof parsed !== "object" || parsed === null) {
19310
+ return void 0;
19311
+ }
19312
+ const record = parsed;
19313
+ if (record.type === void 0) {
19314
+ return isLegacySpanFields(record) ? { data: record, type: "span" } : void 0;
19315
+ }
19316
+ if (record.type === "epoch" || record.type === "reset") {
19317
+ return typeof record.epoch === "string" ? { epoch: record.epoch, type: record.type } : void 0;
19318
+ }
19319
+ if (record.type === "span") {
19320
+ const data = record.data;
19321
+ if (typeof data !== "object" || data === null || !isLegacySpanFields(data)) {
19322
+ return void 0;
19323
+ }
19324
+ return {
19325
+ data,
19326
+ epoch: typeof record.epoch === "string" ? record.epoch : void 0,
19327
+ type: "span"
19328
+ };
19329
+ }
19330
+ return void 0;
19331
+ };
19175
19332
  function useSpansWebSocket(options) {
19176
19333
  const { enabled, onClose, onMessage, onOpen } = options;
19177
- const onMessageRef = useRef9(onMessage);
19178
- const onOpenRef = useRef9(onOpen);
19179
- const onCloseRef = useRef9(onClose);
19180
- useEffect15(() => {
19334
+ const onMessageRef = useRef10(onMessage);
19335
+ const onOpenRef = useRef10(onOpen);
19336
+ const onCloseRef = useRef10(onClose);
19337
+ useEffect16(() => {
19181
19338
  onMessageRef.current = onMessage;
19182
19339
  }, [onMessage]);
19183
- useEffect15(() => {
19340
+ useEffect16(() => {
19184
19341
  onOpenRef.current = onOpen;
19185
19342
  }, [onOpen]);
19186
- useEffect15(() => {
19343
+ useEffect16(() => {
19187
19344
  onCloseRef.current = onClose;
19188
19345
  }, [onClose]);
19189
- const [connected, setConnected] = useState10(false);
19190
- const wsRef = useRef9(void 0);
19346
+ const [connected, setConnected] = useState11(false);
19347
+ const wsRef = useRef10(void 0);
19191
19348
  const { localstackEndpoint } = useAppInspector();
19192
- const connect = useCallback6(() => {
19349
+ const connect = useCallback7(() => {
19193
19350
  if (wsRef.current !== void 0) return;
19194
19351
  const url = new URL(getAppInspectorApiUrl(localstackEndpoint, API_ENDPOINTS.WEBSOCKET_SPANS));
19195
19352
  url.protocol = globalThis.location.protocol === "https:" ? "wss" : "ws";
19353
+ url.searchParams.set("epoch", "1");
19196
19354
  const ws = new WebSocket(url);
19197
19355
  wsRef.current = ws;
19198
19356
  ws.addEventListener("open", () => {
@@ -19200,9 +19358,20 @@ function useSpansWebSocket(options) {
19200
19358
  setConnected(true);
19201
19359
  onOpenRef.current();
19202
19360
  });
19203
- ws.addEventListener("message", () => {
19361
+ ws.addEventListener("message", (event) => {
19204
19362
  if (wsRef.current !== ws) return;
19205
- onMessageRef.current();
19363
+ let message;
19364
+ try {
19365
+ message = parseSpansWebSocketMessage(event.data);
19366
+ } catch (error) {
19367
+ wsLogger.warn("Failed to parse WS message:", { error });
19368
+ return;
19369
+ }
19370
+ if (message === void 0) {
19371
+ wsLogger.warn("Received unrecognized WS message shape:", { data: String(event.data) });
19372
+ return;
19373
+ }
19374
+ onMessageRef.current(message);
19206
19375
  });
19207
19376
  ws.addEventListener("close", () => {
19208
19377
  if (wsRef.current !== ws) return;
@@ -19218,7 +19387,7 @@ function useSpansWebSocket(options) {
19218
19387
  }
19219
19388
  });
19220
19389
  }, [localstackEndpoint]);
19221
- useEffect15(() => {
19390
+ useEffect16(() => {
19222
19391
  if (!enabled) {
19223
19392
  if (wsRef.current !== void 0) {
19224
19393
  wsRef.current.close();
@@ -19246,30 +19415,69 @@ function useSpansWebSocket(options) {
19246
19415
  var PAGE_SIZE = 100;
19247
19416
  var useSpans = () => {
19248
19417
  const api = useAppInspectorApi();
19249
- const { onWsClose, onWsOpen, wsEnabled } = useAppInspectorStatus();
19250
- const [spans, setSpans] = useState11();
19251
- const [fetchError, setFetchError] = useState11();
19252
- const [fetchingForward, setFetchingForward] = useState11(false);
19253
- const [fetchingBackward, setFetchingBackward] = useState11(false);
19254
- const [search, setSearch] = useState11("");
19255
- const searchRef = useRef10("");
19256
- const [searching, setSearching] = useState11(false);
19257
- const searchSeqRef = useRef10(0);
19258
- const paginationBufferRef = useRef10();
19259
- const [totalCount, setTotalCount] = useState11();
19260
- const [licenseLimit, setLicenseLimit] = useState11();
19261
- const [systemLimit, setSystemLimit] = useState11();
19262
- const [errorCount, setErrorCount] = useState11();
19263
- const [warningCount, setWarningCount] = useState11();
19264
- const [hasMoreBackward, setHasMoreBackward] = useState11();
19265
- const [hasMoreForward, setHasMoreForward] = useState11();
19266
- const fetchForward = useCallback7(() => {
19418
+ const { onWsClose, onWsOpen, status, wsEnabled } = useAppInspectorStatus();
19419
+ const { addPage, clear: clearCompute, result: computeResult, retryWorker, setFilters: setComputeFilters, workerError } = useSpansCompute();
19420
+ const spanMapRef = useRef11(/* @__PURE__ */ new Map());
19421
+ const [filters, setFiltersState] = useState12(EMPTY_FILTERS);
19422
+ const setFilters = useCallback8((next) => {
19423
+ setFiltersState(next);
19424
+ setComputeFilters(next);
19425
+ }, [setComputeFilters]);
19426
+ const [fetchError, setFetchError] = useState12();
19427
+ const [fetchingForward, setFetchingForward] = useState12(false);
19428
+ const [fetchingBackward, setFetchingBackward] = useState12(false);
19429
+ const [search, setSearch] = useState12("");
19430
+ const searchRef = useRef11("");
19431
+ const [searching, setSearching] = useState12(false);
19432
+ const searchSeqRef = useRef11(0);
19433
+ const paginationBufferRef = useRef11();
19434
+ const [totalCount, setTotalCount] = useState12();
19435
+ const [licenseLimit, setLicenseLimit] = useState12();
19436
+ const [systemLimit, setSystemLimit] = useState12();
19437
+ const [errorCount, setErrorCount] = useState12();
19438
+ const [warningCount, setWarningCount] = useState12();
19439
+ const [hasMoreBackward, setHasMoreBackward] = useState12();
19440
+ const [hasMoreForward, setHasMoreForward] = useState12();
19441
+ const [spansLoaded, setSpansLoaded] = useState12(false);
19442
+ const fetchForward = useCallback8(() => {
19267
19443
  void paginationBufferRef.current?.fetchForward();
19268
19444
  }, []);
19269
- const fetchBackward = useCallback7(() => {
19445
+ const fetchBackward = useCallback8(() => {
19270
19446
  void paginationBufferRef.current?.fetchBackward();
19271
19447
  }, []);
19272
- const applySearch = useCallback7((term) => {
19448
+ const resetCorpus = useCallback8(() => {
19449
+ spanMapRef.current.clear();
19450
+ clearCompute();
19451
+ }, [clearCompute]);
19452
+ const [epoch, setEpoch] = useState12();
19453
+ const onEpochSeen = useCallback8((observedEpoch) => {
19454
+ if (observedEpoch === null || observedEpoch === void 0) {
19455
+ return;
19456
+ }
19457
+ setEpoch(observedEpoch);
19458
+ }, []);
19459
+ const clearCache = useCallback8(() => {
19460
+ paginationBufferRef.current?.clear();
19461
+ resetCorpus();
19462
+ setTotalCount(void 0);
19463
+ setErrorCount(void 0);
19464
+ setWarningCount(void 0);
19465
+ void paginationBufferRef.current?.fetchForward();
19466
+ }, [resetCorpus]);
19467
+ const hasFetchedWithoutEpochRef = useRef11(false);
19468
+ const previousEpochRef = useRef11();
19469
+ useEffect17(() => {
19470
+ if (epoch === void 0) {
19471
+ return;
19472
+ }
19473
+ const isEpochChange = previousEpochRef.current !== void 0 && previousEpochRef.current !== epoch;
19474
+ const isFirstEpochAfterUnknownBackend = previousEpochRef.current === void 0 && hasFetchedWithoutEpochRef.current;
19475
+ if (isEpochChange || isFirstEpochAfterUnknownBackend) {
19476
+ clearCache();
19477
+ }
19478
+ previousEpochRef.current = epoch;
19479
+ }, [epoch, clearCache]);
19480
+ const applySearch = useCallback8((term) => {
19273
19481
  const normalized = term.trim();
19274
19482
  if (normalized === searchRef.current) {
19275
19483
  return;
@@ -19279,58 +19487,76 @@ var useSpans = () => {
19279
19487
  const seq = ++searchSeqRef.current;
19280
19488
  setSearching(true);
19281
19489
  paginationBufferRef.current?.clear();
19490
+ resetCorpus();
19282
19491
  void paginationBufferRef.current?.fetchForward().finally(() => {
19283
19492
  if (searchSeqRef.current === seq) {
19284
19493
  setSearching(false);
19285
19494
  }
19286
19495
  });
19287
- }, []);
19288
- useEffect16(() => {
19496
+ }, [resetCorpus]);
19497
+ useEffect17(() => {
19289
19498
  const buffer = createPaginationBuffer({
19290
19499
  async fetchPage(token, signal) {
19291
- const response = await api.getSpans({
19292
- limit: PAGE_SIZE,
19293
- pagination_token: token,
19294
- search: searchRef.current || void 0
19295
- }, { signal });
19296
- setTotalCount(response.pagination.total_count);
19297
- setLicenseLimit(response.limits.span_count_limit_license);
19298
- setSystemLimit(response.limits.span_count_limit_system);
19299
- setErrorCount(response.error_count);
19300
- setWarningCount(response.warning_count);
19301
- return {
19302
- hasMoreBackward: response.pagination.has_prev,
19303
- hasMoreForward: response.pagination.has_next,
19304
- items: response.spans,
19305
- nextBackwardToken: response.pagination.prev_cursor ?? void 0,
19306
- nextForwardToken: response.pagination.next_cursor ?? void 0
19500
+ const requestPage = async (paginationToken) => {
19501
+ const response = await api.getSpans({
19502
+ limit: PAGE_SIZE,
19503
+ pagination_token: paginationToken,
19504
+ search: searchRef.current || void 0
19505
+ }, { signal });
19506
+ if (!response.pagination.epoch) {
19507
+ hasFetchedWithoutEpochRef.current = true;
19508
+ }
19509
+ onEpochSeen(response.pagination.epoch);
19510
+ setTotalCount(response.pagination.total_count);
19511
+ setLicenseLimit(response.limits.span_count_limit_license);
19512
+ setSystemLimit(response.limits.span_count_limit_system);
19513
+ setErrorCount(response.error_count);
19514
+ setWarningCount(response.warning_count);
19515
+ return {
19516
+ hasMoreBackward: response.pagination.has_prev,
19517
+ hasMoreForward: response.pagination.has_next,
19518
+ items: response.spans,
19519
+ nextBackwardToken: response.pagination.prev_cursor ?? void 0,
19520
+ nextForwardToken: response.pagination.next_cursor ?? void 0
19521
+ };
19307
19522
  };
19523
+ try {
19524
+ return await requestPage(token);
19525
+ } catch (error) {
19526
+ if (error instanceof StaleTokenError && token !== void 0) {
19527
+ return await requestPage();
19528
+ }
19529
+ throw error;
19530
+ }
19308
19531
  },
19309
- onDataChange: ({ hasMoreBackward: hasMoreBackward2, hasMoreForward: hasMoreForward2, items }) => {
19532
+ onDataChange: ({ hasMoreBackward: hasMoreBackward2, hasMoreForward: hasMoreForward2 }) => {
19310
19533
  setFetchError(void 0);
19311
- setSpans(items);
19312
19534
  setHasMoreBackward(hasMoreBackward2);
19313
19535
  setHasMoreForward(hasMoreForward2);
19536
+ setSpansLoaded(true);
19314
19537
  },
19315
19538
  onError: (error) => {
19316
19539
  setFetchError(error);
19317
19540
  },
19318
- onStatusChange(status) {
19319
- setFetchingBackward(status.fetchingBackward);
19320
- setFetchingForward(status.fetchingForward);
19541
+ // Each fetched page streams into the corpus: full spans into the Map (for render
19542
+ // lookup) and lean projections into the compute backend (for merge/filter/count).
19543
+ // Ordering is owned by the compute backend, so no main-thread sortComparator is needed.
19544
+ onPageFetched: (direction, items) => {
19545
+ for (const span of items) {
19546
+ spanMapRef.current.set(span.span_id, span);
19547
+ }
19548
+ addPage(direction, items.map((span) => toSpanFilterProjection(span)));
19321
19549
  },
19322
- // The spans endpoint is sorted by span ingestion time, which might differ from
19323
- // the span timestamp. In order to accomodate for this, we will sort the spans
19324
- // in the frontend with the following sort comparator.
19325
- sortComparator(a3, b3) {
19326
- return a3.start_time_unix_nano < b3.start_time_unix_nano ? -1 : 1;
19550
+ onStatusChange(status2) {
19551
+ setFetchingBackward(status2.fetchingBackward);
19552
+ setFetchingForward(status2.fetchingForward);
19327
19553
  }
19328
19554
  });
19329
19555
  paginationBufferRef.current = buffer;
19330
19556
  void buffer.fetchForward();
19331
- }, [api]);
19332
- const [clearingSpans, setClearingSpans] = useState11(false);
19333
- const clearSpans = useCallback7(async () => {
19557
+ }, [api, addPage, onEpochSeen, resetCorpus]);
19558
+ const [clearingSpans, setClearingSpans] = useState12(false);
19559
+ const clearSpans = useCallback8(async () => {
19334
19560
  if (clearingSpans) {
19335
19561
  return;
19336
19562
  }
@@ -19342,6 +19568,7 @@ var useSpans = () => {
19342
19568
  setSearch("");
19343
19569
  setSearching(false);
19344
19570
  paginationBufferRef.current?.clear();
19571
+ resetCorpus();
19345
19572
  await paginationBufferRef.current?.fetchForward();
19346
19573
  } catch (error) {
19347
19574
  console.error("Failed to delete spans:", error);
@@ -19349,21 +19576,30 @@ var useSpans = () => {
19349
19576
  } finally {
19350
19577
  setClearingSpans(false);
19351
19578
  }
19352
- }, [clearingSpans, api]);
19353
- useEffect16(() => {
19579
+ }, [clearingSpans, api, resetCorpus]);
19580
+ useEffect17(() => {
19354
19581
  if (hasMoreForward === true && !fetchingForward) {
19355
19582
  void paginationBufferRef.current?.fetchForward();
19356
19583
  }
19357
19584
  }, [hasMoreForward, fetchingForward]);
19358
- useEffect16(() => {
19585
+ useEffect17(() => {
19359
19586
  if (hasMoreBackward === true && !fetchingBackward && !fetchingForward) {
19360
19587
  void paginationBufferRef.current?.fetchBackward();
19361
19588
  }
19362
19589
  }, [hasMoreBackward, fetchingBackward, fetchingForward]);
19590
+ const [previousStatusEpoch, setPreviousStatusEpoch] = useState12();
19591
+ if (status !== void 0 && status.epoch !== previousStatusEpoch) {
19592
+ setPreviousStatusEpoch(status.epoch);
19593
+ onEpochSeen(status.epoch);
19594
+ }
19363
19595
  useSpansWebSocket({
19364
19596
  enabled: wsEnabled,
19365
19597
  onClose: onWsClose,
19366
- onMessage: () => {
19598
+ onMessage: (message) => {
19599
+ onEpochSeen(message.epoch);
19600
+ if (message.type !== "span") {
19601
+ return;
19602
+ }
19367
19603
  if (clearingSpans) {
19368
19604
  return;
19369
19605
  }
@@ -19376,43 +19612,58 @@ var useSpans = () => {
19376
19612
  fetchForward();
19377
19613
  }
19378
19614
  });
19379
- const clearFetchError = useCallback7(() => {
19615
+ const clearFetchError = useCallback8(() => {
19380
19616
  setFetchError(void 0);
19381
19617
  }, []);
19618
+ const filteredSpans = useMemo6(() => {
19619
+ if (!spansLoaded) return;
19620
+ const spanMap = spanMapRef.current;
19621
+ return computeResult.orderedFilteredIds.map((id2) => spanMap.get(id2)).filter((span) => span !== void 0);
19622
+ }, [computeResult, spansLoaded]);
19382
19623
  return {
19383
19624
  clearFetchError,
19384
19625
  clearingSpans,
19385
19626
  clearSpans,
19627
+ consumerValues: computeResult.consumerValues,
19386
19628
  errorCount,
19387
19629
  fetchBackward,
19388
19630
  fetchError,
19389
19631
  fetchForward,
19390
19632
  fetchingBackward,
19391
19633
  fetchingForward,
19634
+ filteredErrorCount: computeResult.errorCount,
19635
+ filteredSpans,
19636
+ filteredWarningCount: computeResult.warningCount,
19637
+ filters,
19638
+ hasExternalProducer: computeResult.hasExternalProducer,
19392
19639
  hasMoreBackward,
19393
19640
  hasMoreForward,
19394
19641
  licenseLimit,
19642
+ producerValues: computeResult.producerValues,
19643
+ retryWorker,
19395
19644
  search,
19396
19645
  searching,
19646
+ setFilters,
19397
19647
  setSearch: applySearch,
19398
- spans,
19648
+ statusValues: computeResult.statusValues,
19399
19649
  systemLimit,
19400
19650
  totalCount,
19401
- warningCount
19651
+ warningCount,
19652
+ workerError
19402
19653
  };
19403
19654
  };
19404
19655
 
19405
19656
  // src/pages/trace-graph-page.tsx
19406
19657
  import { ArrowBack } from "@mui/icons-material";
19407
- import { Box as Box19, Button as Button7, Drawer, Paper as Paper2 } from "@mui/material";
19658
+ import { Box as Box20, Button as Button8, Drawer, Paper as Paper2 } from "@mui/material";
19408
19659
  import { styled } from "@mui/material/styles";
19409
19660
  import { ReactFlowProvider } from "@xyflow/react";
19410
- import { useCallback as useCallback11, useEffect as useEffect21, useRef as useRef16, useState as useState20 } from "react";
19661
+ import { useCallback as useCallback12, useEffect as useEffect22, useRef as useRef17, useState as useState21 } from "react";
19411
19662
 
19412
19663
  // src/components/event-details/event-details.tsx
19413
19664
  import { Close as Close3 } from "@mui/icons-material";
19414
- import { Alert as Alert4, Box as Box16, Chip as Chip3, Divider as Divider4, FormControlLabel, IconButton as IconButton5, Stack as Stack4, Switch, Typography as Typography12 } from "@mui/material";
19415
- import { useMemo as useMemo10, useState as useState17 } from "react";
19665
+ import { Alert as Alert5, Box as Box17, Chip as Chip3, Divider as Divider4, FormControlLabel, IconButton as IconButton5, Stack as Stack4, Switch, Typography as Typography13 } from "@mui/material";
19666
+ import { useMemo as useMemo11, useState as useState18 } from "react";
19416
19667
 
19417
19668
  // src/utils/event-utils.ts
19418
19669
  var iamEventParser = (eventName, attributes) => {
@@ -19525,11 +19776,11 @@ var getEventGroupsByType = (events) => {
19525
19776
  // src/components/event-details/copy-button.tsx
19526
19777
  import { Check, ContentCopy } from "@mui/icons-material";
19527
19778
  import { IconButton as IconButton3, Tooltip as Tooltip5 } from "@mui/material";
19528
- import { useCallback as useCallback8, useState as useState12 } from "react";
19529
- import { jsx as jsx132 } from "react/jsx-runtime";
19779
+ import { useCallback as useCallback9, useState as useState13 } from "react";
19780
+ import { jsx as jsx133 } from "react/jsx-runtime";
19530
19781
  var CopyButton = ({ value }) => {
19531
- const [copied, setCopied] = useState12(false);
19532
- const handleCopy = useCallback8(() => {
19782
+ const [copied, setCopied] = useState13(false);
19783
+ const handleCopy = useCallback9(() => {
19533
19784
  const text2 = typeof value === "string" ? value : JSON.stringify(value, void 0, 2);
19534
19785
  void navigator.clipboard.writeText(text2).then(() => {
19535
19786
  setCopied(true);
@@ -19538,83 +19789,83 @@ var CopyButton = ({ value }) => {
19538
19789
  }, 1500);
19539
19790
  });
19540
19791
  }, [value]);
19541
- return /* @__PURE__ */ jsx132(Tooltip5, { title: copied ? "Copied!" : "Copy", children: /* @__PURE__ */ jsx132(
19792
+ return /* @__PURE__ */ jsx133(Tooltip5, { title: copied ? "Copied!" : "Copy", children: /* @__PURE__ */ jsx133(
19542
19793
  IconButton3,
19543
19794
  {
19544
19795
  className: "copy-btn",
19545
19796
  onClick: handleCopy,
19546
19797
  size: "small",
19547
19798
  sx: { ml: 0.5, opacity: copied ? 1 : 0, p: 0.25, transition: "opacity 0.15s" },
19548
- children: copied ? /* @__PURE__ */ jsx132(Check, { sx: { fontSize: 14 } }) : /* @__PURE__ */ jsx132(ContentCopy, { sx: { fontSize: 14 } })
19799
+ children: copied ? /* @__PURE__ */ jsx133(Check, { sx: { fontSize: 14 } }) : /* @__PURE__ */ jsx133(ContentCopy, { sx: { fontSize: 14 } })
19549
19800
  }
19550
19801
  ) });
19551
19802
  };
19552
19803
 
19553
19804
  // src/components/event-details/event-detail.tsx
19554
19805
  import { KeyboardArrowDown, KeyboardArrowRight } from "@mui/icons-material";
19555
- import { Box as Box13, IconButton as IconButton4, Typography as Typography9 } from "@mui/material";
19556
- import { useEffect as useEffect18, useMemo as useMemo8, useRef as useRef12, useState as useState14 } from "react";
19806
+ import { Box as Box14, IconButton as IconButton4, Typography as Typography10 } from "@mui/material";
19807
+ import { useEffect as useEffect19, useMemo as useMemo9, useRef as useRef13, useState as useState15 } from "react";
19557
19808
 
19558
19809
  // src/components/status-icon.tsx
19559
19810
  import { Cancel as Cancel3, CheckCircle, Error as Error3, Info, RemoveCircle } from "@mui/icons-material";
19560
- import { Box as Box8 } from "@mui/material";
19561
- import { jsx as jsx133 } from "react/jsx-runtime";
19811
+ import { Box as Box9 } from "@mui/material";
19812
+ import { jsx as jsx134 } from "react/jsx-runtime";
19562
19813
  var StatusIcon2 = ({ errorLevel }) => {
19563
19814
  switch (errorLevel) {
19564
19815
  case EventLevel.LevelError: {
19565
- return /* @__PURE__ */ jsx133(Cancel3, { sx: { color: "red" } });
19816
+ return /* @__PURE__ */ jsx134(Cancel3, { sx: { color: "red" } });
19566
19817
  }
19567
19818
  case EventLevel.LevelInfo: {
19568
- return /* @__PURE__ */ jsx133(Info, { sx: { color: "gray" } });
19819
+ return /* @__PURE__ */ jsx134(Info, { sx: { color: "gray" } });
19569
19820
  }
19570
19821
  case EventLevel.LevelPermission: {
19571
- return /* @__PURE__ */ jsx133(RemoveCircle, { sx: { color: "blue" } });
19822
+ return /* @__PURE__ */ jsx134(RemoveCircle, { sx: { color: "blue" } });
19572
19823
  }
19573
19824
  case EventLevel.LevelWarning: {
19574
- return /* @__PURE__ */ jsx133(Error3, { sx: { color: "orange" } });
19825
+ return /* @__PURE__ */ jsx134(Error3, { sx: { color: "orange" } });
19575
19826
  }
19576
19827
  default: {
19577
- return /* @__PURE__ */ jsx133(CheckCircle, { sx: { color: "lightgray" } });
19828
+ return /* @__PURE__ */ jsx134(CheckCircle, { sx: { color: "lightgray" } });
19578
19829
  }
19579
19830
  }
19580
19831
  };
19581
19832
 
19582
19833
  // src/components/event-details/iam-event-detail.tsx
19583
19834
  import { CheckCircle as CheckCircle2, Error as ErrorIcon, Warning } from "@mui/icons-material";
19584
- import { Box as Box9, Chip, Typography as Typography7 } from "@mui/material";
19585
- import { jsx as jsx134, jsxs as jsxs125 } from "react/jsx-runtime";
19586
- var DetailRow = ({ content, label }) => /* @__PURE__ */ jsxs125(Box9, { sx: { display: "grid", gap: 1, gridTemplateColumns: "72px 1fr", mb: 0.5 }, children: [
19587
- /* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", sx: { fontWeight: 600 }, variant: "caption", children: label }),
19588
- /* @__PURE__ */ jsx134(Box9, { children: typeof content === "string" ? /* @__PURE__ */ jsx134(Typography7, { sx: { color: "text.primary", wordBreak: "break-word" }, variant: "caption", children: content }) : content })
19835
+ import { Box as Box10, Chip, Typography as Typography8 } from "@mui/material";
19836
+ import { jsx as jsx135, jsxs as jsxs126 } from "react/jsx-runtime";
19837
+ var DetailRow = ({ content, label }) => /* @__PURE__ */ jsxs126(Box10, { sx: { display: "grid", gap: 1, gridTemplateColumns: "72px 1fr", mb: 0.5 }, children: [
19838
+ /* @__PURE__ */ jsx135(Typography8, { color: "text.secondary", sx: { fontWeight: 600 }, variant: "caption", children: label }),
19839
+ /* @__PURE__ */ jsx135(Box10, { children: typeof content === "string" ? /* @__PURE__ */ jsx135(Typography8, { sx: { color: "text.primary", wordBreak: "break-word" }, variant: "caption", children: content }) : content })
19589
19840
  ] });
19590
19841
  var PermissionIcon = ({ status }) => {
19591
19842
  switch (status) {
19592
19843
  case "explicitly_allowed":
19593
19844
  case "implicitly_allowed": {
19594
- return /* @__PURE__ */ jsx134(CheckCircle2, { sx: { color: "success.main", fontSize: "1rem" } });
19845
+ return /* @__PURE__ */ jsx135(CheckCircle2, { sx: { color: "success.main", fontSize: "1rem" } });
19595
19846
  }
19596
19847
  case "explicitly_denied": {
19597
- return /* @__PURE__ */ jsx134(ErrorIcon, { sx: { color: "error.main", fontSize: "1rem" } });
19848
+ return /* @__PURE__ */ jsx135(ErrorIcon, { sx: { color: "error.main", fontSize: "1rem" } });
19598
19849
  }
19599
19850
  case "implicitly_denied": {
19600
- return /* @__PURE__ */ jsx134(Warning, { sx: { color: "warning.main", fontSize: "1rem" } });
19851
+ return /* @__PURE__ */ jsx135(Warning, { sx: { color: "warning.main", fontSize: "1rem" } });
19601
19852
  }
19602
19853
  }
19603
19854
  };
19604
19855
  var IAMEventDetail = ({ event }) => {
19605
19856
  const payloadString = event.attributes?.payload;
19606
19857
  if (!payloadString) {
19607
- return /* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", variant: "caption", children: "No IAM policy evaluation data available" });
19858
+ return /* @__PURE__ */ jsx135(Typography8, { color: "text.secondary", variant: "caption", children: "No IAM policy evaluation data available" });
19608
19859
  }
19609
19860
  const parsedIAM = parseIAMEvent(payloadString);
19610
19861
  if (!parsedIAM) {
19611
- return /* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", variant: "caption", children: "Failed to parse IAM event data" });
19862
+ return /* @__PURE__ */ jsx135(Typography8, { color: "text.secondary", variant: "caption", children: "Failed to parse IAM event data" });
19612
19863
  }
19613
- return /* @__PURE__ */ jsxs125(Box9, { children: [
19614
- /* @__PURE__ */ jsx134(Box9, { sx: { mb: 1.5 }, children: /* @__PURE__ */ jsx134(
19864
+ return /* @__PURE__ */ jsxs126(Box10, { children: [
19865
+ /* @__PURE__ */ jsx135(Box10, { sx: { mb: 1.5 }, children: /* @__PURE__ */ jsx135(
19615
19866
  Chip,
19616
19867
  {
19617
- icon: /* @__PURE__ */ jsx134(PermissionIcon, { status: parsedIAM.permission }),
19868
+ icon: /* @__PURE__ */ jsx135(PermissionIcon, { status: parsedIAM.permission }),
19618
19869
  label: formatPermissionStatus(parsedIAM.permission),
19619
19870
  size: "small",
19620
19871
  sx: {
@@ -19624,36 +19875,36 @@ var IAMEventDetail = ({ event }) => {
19624
19875
  variant: "outlined"
19625
19876
  }
19626
19877
  ) }),
19627
- /* @__PURE__ */ jsx134(DetailRow, { content: `${parsedIAM.service}:${parsedIAM.operation}`, label: "Operation" }),
19628
- /* @__PURE__ */ jsx134(DetailRow, { content: parsedIAM.principal, label: "Principal" }),
19629
- parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ jsx134(
19878
+ /* @__PURE__ */ jsx135(DetailRow, { content: `${parsedIAM.service}:${parsedIAM.operation}`, label: "Operation" }),
19879
+ /* @__PURE__ */ jsx135(DetailRow, { content: parsedIAM.principal, label: "Principal" }),
19880
+ parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ jsx135(
19630
19881
  DetailRow,
19631
19882
  {
19632
- content: /* @__PURE__ */ jsx134(Box9, { children: parsedIAM.details.actions.map((action) => /* @__PURE__ */ jsx134(Typography7, { sx: { color: "text.primary", display: "block" }, variant: "caption", children: action }, action)) }),
19883
+ content: /* @__PURE__ */ jsx135(Box10, { children: parsedIAM.details.actions.map((action) => /* @__PURE__ */ jsx135(Typography8, { sx: { color: "text.primary", display: "block" }, variant: "caption", children: action }, action)) }),
19633
19884
  label: "Actions"
19634
19885
  }
19635
19886
  ),
19636
- parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ jsx134(
19887
+ parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ jsx135(
19637
19888
  DetailRow,
19638
19889
  {
19639
- content: /* @__PURE__ */ jsx134(Box9, { children: parsedIAM.details.resources.map((resource) => /* @__PURE__ */ jsx134(Typography7, { sx: { color: "text.primary", display: "block", wordBreak: "break-all" }, variant: "caption", children: resource }, resource)) }),
19890
+ content: /* @__PURE__ */ jsx135(Box10, { children: parsedIAM.details.resources.map((resource) => /* @__PURE__ */ jsx135(Typography8, { sx: { color: "text.primary", display: "block", wordBreak: "break-all" }, variant: "caption", children: resource }, resource)) }),
19640
19891
  label: "Resources"
19641
19892
  }
19642
19893
  ),
19643
- (parsedIAM.details.explicitAllows !== void 0 || parsedIAM.details.explicitDenies !== void 0 || parsedIAM.details.implicitDenies !== void 0) && /* @__PURE__ */ jsxs125(Box9, { sx: { mt: 1.5 }, children: [
19644
- /* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", sx: { display: "block", fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Policy Evaluation" }),
19645
- /* @__PURE__ */ jsxs125(Box9, { sx: { display: "grid", gap: 1, gridTemplateColumns: "repeat(3, 1fr)" }, children: [
19646
- parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ jsxs125(Box9, { sx: { textAlign: "center" }, children: [
19647
- /* @__PURE__ */ jsx134(Typography7, { color: "success.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.explicitAllows }),
19648
- /* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", variant: "caption", children: "Explicit Allows" })
19894
+ (parsedIAM.details.explicitAllows !== void 0 || parsedIAM.details.explicitDenies !== void 0 || parsedIAM.details.implicitDenies !== void 0) && /* @__PURE__ */ jsxs126(Box10, { sx: { mt: 1.5 }, children: [
19895
+ /* @__PURE__ */ jsx135(Typography8, { color: "text.secondary", sx: { display: "block", fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Policy Evaluation" }),
19896
+ /* @__PURE__ */ jsxs126(Box10, { sx: { display: "grid", gap: 1, gridTemplateColumns: "repeat(3, 1fr)" }, children: [
19897
+ parsedIAM.details.explicitAllows !== void 0 && /* @__PURE__ */ jsxs126(Box10, { sx: { textAlign: "center" }, children: [
19898
+ /* @__PURE__ */ jsx135(Typography8, { color: "success.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.explicitAllows }),
19899
+ /* @__PURE__ */ jsx135(Typography8, { color: "text.secondary", variant: "caption", children: "Explicit Allows" })
19649
19900
  ] }),
19650
- parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ jsxs125(Box9, { sx: { textAlign: "center" }, children: [
19651
- /* @__PURE__ */ jsx134(Typography7, { color: "error.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.explicitDenies }),
19652
- /* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", variant: "caption", children: "Explicit Denies" })
19901
+ parsedIAM.details.explicitDenies !== void 0 && /* @__PURE__ */ jsxs126(Box10, { sx: { textAlign: "center" }, children: [
19902
+ /* @__PURE__ */ jsx135(Typography8, { color: "error.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.explicitDenies }),
19903
+ /* @__PURE__ */ jsx135(Typography8, { color: "text.secondary", variant: "caption", children: "Explicit Denies" })
19653
19904
  ] }),
19654
- parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ jsxs125(Box9, { sx: { textAlign: "center" }, children: [
19655
- /* @__PURE__ */ jsx134(Typography7, { color: "warning.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.implicitDenies }),
19656
- /* @__PURE__ */ jsx134(Typography7, { color: "text.secondary", variant: "caption", children: "Implicit Denies" })
19905
+ parsedIAM.details.implicitDenies !== void 0 && /* @__PURE__ */ jsxs126(Box10, { sx: { textAlign: "center" }, children: [
19906
+ /* @__PURE__ */ jsx135(Typography8, { color: "warning.main", sx: { display: "block", fontWeight: "bold" }, variant: "subtitle2", children: parsedIAM.details.implicitDenies }),
19907
+ /* @__PURE__ */ jsx135(Typography8, { color: "text.secondary", variant: "caption", children: "Implicit Denies" })
19657
19908
  ] })
19658
19909
  ] })
19659
19910
  ] })
@@ -19661,16 +19912,16 @@ var IAMEventDetail = ({ event }) => {
19661
19912
  };
19662
19913
 
19663
19914
  // src/components/event-details/iam-permission-detail.tsx
19664
- import { Box as Box10, Chip as Chip2, Stack as Stack2, Typography as Typography8 } from "@mui/material";
19665
- import { useMemo as useMemo6 } from "react";
19666
- import { jsx as jsx135, jsxs as jsxs126 } from "react/jsx-runtime";
19915
+ import { Box as Box11, Chip as Chip2, Stack as Stack2, Typography as Typography9 } from "@mui/material";
19916
+ import { useMemo as useMemo7 } from "react";
19917
+ import { jsx as jsx136, jsxs as jsxs127 } from "react/jsx-runtime";
19667
19918
  var getChipColor = (isAllowed, spanStatusCode) => {
19668
19919
  if (isAllowed) return "success.main";
19669
19920
  if (spanStatusCode === 2) return "error.main";
19670
19921
  return "warning.main";
19671
19922
  };
19672
19923
  var IAMPermissionItem = ({ event, spanStatusCode }) => {
19673
- const parsedData = useMemo6(() => {
19924
+ const parsedData = useMemo7(() => {
19674
19925
  const payloadString = event.attributes?.payload;
19675
19926
  if (!payloadString) return;
19676
19927
  const parsedIAM2 = parseIAMEvent(payloadString);
@@ -19683,43 +19934,43 @@ var IAMPermissionItem = ({ event, spanStatusCode }) => {
19683
19934
  const { parsedIAM } = parsedData;
19684
19935
  const isAllowed = parsedIAM.permission === "explicitly_allowed" || parsedIAM.permission === "implicitly_allowed";
19685
19936
  const chipColors = { backgroundColor: getChipColor(isAllowed, spanStatusCode), color: "white" };
19686
- return /* @__PURE__ */ jsxs126(Box10, { sx: { mb: 0.5 }, children: [
19687
- /* @__PURE__ */ jsx135(Box10, { sx: { alignItems: "center", display: "flex", gap: 1, mb: 0.5 }, children: /* @__PURE__ */ jsx135(Chip2, { label: formatPermissionStatus(parsedIAM.permission), size: "small", sx: { ...chipColors, fontWeight: 500 } }) }),
19688
- /* @__PURE__ */ jsxs126(Stack2, { spacing: 1, children: [
19689
- /* @__PURE__ */ jsxs126(Box10, { "data-testid": EVENT_DETAILS_IAM_PRINCIPAL_TEST_ID, children: [
19690
- /* @__PURE__ */ jsx135(Typography8, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Principal" }),
19691
- /* @__PURE__ */ jsxs126(Stack2, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
19692
- /* @__PURE__ */ jsx135(Typography8, { sx: { wordBreak: "break-all" }, variant: "body2", children: parsedIAM.principal }),
19693
- /* @__PURE__ */ jsx135(CopyButton, { value: parsedIAM.principal })
19937
+ return /* @__PURE__ */ jsxs127(Box11, { sx: { mb: 0.5 }, children: [
19938
+ /* @__PURE__ */ jsx136(Box11, { sx: { alignItems: "center", display: "flex", gap: 1, mb: 0.5 }, children: /* @__PURE__ */ jsx136(Chip2, { label: formatPermissionStatus(parsedIAM.permission), size: "small", sx: { ...chipColors, fontWeight: 500 } }) }),
19939
+ /* @__PURE__ */ jsxs127(Stack2, { spacing: 1, children: [
19940
+ /* @__PURE__ */ jsxs127(Box11, { "data-testid": EVENT_DETAILS_IAM_PRINCIPAL_TEST_ID, children: [
19941
+ /* @__PURE__ */ jsx136(Typography9, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Principal" }),
19942
+ /* @__PURE__ */ jsxs127(Stack2, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
19943
+ /* @__PURE__ */ jsx136(Typography9, { sx: { wordBreak: "break-all" }, variant: "body2", children: parsedIAM.principal }),
19944
+ /* @__PURE__ */ jsx136(CopyButton, { value: parsedIAM.principal })
19694
19945
  ] })
19695
19946
  ] }),
19696
- parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ jsxs126(Box10, { "data-testid": EVENT_DETAILS_IAM_ACTIONS_TEST_ID, children: [
19697
- /* @__PURE__ */ jsx135(Typography8, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Actions" }),
19698
- parsedIAM.details.actions.map((action) => /* @__PURE__ */ jsxs126(Stack2, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
19699
- /* @__PURE__ */ jsx135(Typography8, { sx: { display: "block" }, variant: "body2", children: action }),
19700
- /* @__PURE__ */ jsx135(CopyButton, { value: action })
19947
+ parsedIAM.details.actions && parsedIAM.details.actions.length > 0 && /* @__PURE__ */ jsxs127(Box11, { "data-testid": EVENT_DETAILS_IAM_ACTIONS_TEST_ID, children: [
19948
+ /* @__PURE__ */ jsx136(Typography9, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Actions" }),
19949
+ parsedIAM.details.actions.map((action) => /* @__PURE__ */ jsxs127(Stack2, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
19950
+ /* @__PURE__ */ jsx136(Typography9, { sx: { display: "block" }, variant: "body2", children: action }),
19951
+ /* @__PURE__ */ jsx136(CopyButton, { value: action })
19701
19952
  ] }, action))
19702
19953
  ] }),
19703
- parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ jsxs126(Box10, { "data-testid": EVENT_DETAILS_IAM_RESOURCES_TEST_ID, children: [
19704
- /* @__PURE__ */ jsx135(Typography8, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Resources" }),
19705
- parsedIAM.details.resources.map((resource) => /* @__PURE__ */ jsxs126(Stack2, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
19706
- /* @__PURE__ */ jsx135(Typography8, { sx: { display: "block", wordBreak: "break-all" }, variant: "body2", children: resource }),
19707
- /* @__PURE__ */ jsx135(CopyButton, { value: resource })
19954
+ parsedIAM.details.resources && parsedIAM.details.resources.length > 0 && /* @__PURE__ */ jsxs127(Box11, { "data-testid": EVENT_DETAILS_IAM_RESOURCES_TEST_ID, children: [
19955
+ /* @__PURE__ */ jsx136(Typography9, { sx: { display: "block", fontWeight: 600 }, variant: "caption", children: "Resources" }),
19956
+ parsedIAM.details.resources.map((resource) => /* @__PURE__ */ jsxs127(Stack2, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
19957
+ /* @__PURE__ */ jsx136(Typography9, { sx: { display: "block", wordBreak: "break-all" }, variant: "body2", children: resource }),
19958
+ /* @__PURE__ */ jsx136(CopyButton, { value: resource })
19708
19959
  ] }, resource))
19709
19960
  ] })
19710
19961
  ] })
19711
19962
  ] });
19712
19963
  };
19713
- var IAMPermissionDetail = ({ events, spanStatusCode }) => /* @__PURE__ */ jsx135(Box10, { children: events.map((event) => /* @__PURE__ */ jsx135(IAMPermissionItem, { event, spanStatusCode }, `${event.span_id}-${event.event_id}`)) });
19964
+ var IAMPermissionDetail = ({ events, spanStatusCode }) => /* @__PURE__ */ jsx136(Box11, { children: events.map((event) => /* @__PURE__ */ jsx136(IAMPermissionItem, { event, spanStatusCode }, `${event.span_id}-${event.event_id}`)) });
19714
19965
 
19715
19966
  // src/components/event-details/payload-viewer.tsx
19716
- import { Box as Box12, useTheme as useTheme3 } from "@mui/material";
19967
+ import { Box as Box13, useTheme as useTheme3 } from "@mui/material";
19717
19968
 
19718
19969
  // node_modules/.pnpm/@textea+json-viewer@3.5.0_@emotion+react@11.14.0_@types+react@17.0.91_react@17.0.2__@em_040507e953752247cb848fd3f764690c/node_modules/@textea/json-viewer/dist/index.mjs
19719
19970
  var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
19720
- import { jsx as jsx136, jsxs as jsxs127, Fragment as Fragment8 } from "react/jsx-runtime";
19721
- import { Box as Box11, InputBase, NoSsr, SvgIcon, createTheme, ThemeProvider, Paper } from "@mui/material";
19722
- import { createContext as createContext10, useContext as useContext16, useState as useState13, useRef as useRef11, useCallback as useCallback9, useMemo as useMemo7, useEffect as useEffect17, memo as memo9 } from "react";
19971
+ import { jsx as jsx137, jsxs as jsxs128, Fragment as Fragment8 } from "react/jsx-runtime";
19972
+ import { Box as Box12, InputBase, NoSsr, SvgIcon, createTheme, ThemeProvider, Paper } from "@mui/material";
19973
+ import { createContext as createContext10, useContext as useContext16, useState as useState14, useRef as useRef12, useCallback as useCallback10, useMemo as useMemo8, useEffect as useEffect18, memo as memo9 } from "react";
19723
19974
  import { create, useStore, createStore } from "zustand";
19724
19975
  function r(e2) {
19725
19976
  var t, f2, n = "";
@@ -19963,9 +20214,9 @@ async function copyString(value) {
19963
20214
  }
19964
20215
  function useClipboard() {
19965
20216
  let { timeout = 2e3 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
19966
- const [copied, setCopied] = useState13(false);
19967
- const copyTimeout = useRef11(null);
19968
- const handleCopyResult = useCallback9((value) => {
20217
+ const [copied, setCopied] = useState14(false);
20218
+ const copyTimeout = useRef12(null);
20219
+ const handleCopyResult = useCallback10((value) => {
19969
20220
  const current = copyTimeout.current;
19970
20221
  if (current) {
19971
20222
  window.clearTimeout(current);
@@ -19976,7 +20227,7 @@ function useClipboard() {
19976
20227
  timeout
19977
20228
  ]);
19978
20229
  const onCopy = useJsonViewerStore((store) => store.onCopy);
19979
- const copy = useCallback9(async (path, value) => {
20230
+ const copy = useCallback10(async (path, value) => {
19980
20231
  if (typeof onCopy === "function") {
19981
20232
  try {
19982
20233
  await onCopy(path, value, copyString);
@@ -19997,7 +20248,7 @@ function useClipboard() {
19997
20248
  handleCopyResult,
19998
20249
  onCopy
19999
20250
  ]);
20000
- const reset = useCallback9(() => {
20251
+ const reset = useCallback10(() => {
20001
20252
  setCopied(false);
20002
20253
  if (copyTimeout.current) {
20003
20254
  clearTimeout(copyTimeout.current);
@@ -20011,7 +20262,7 @@ function useClipboard() {
20011
20262
  }
20012
20263
  function useIsCycleReference(path, value) {
20013
20264
  const rootValue = useJsonViewerStore((store) => store.value);
20014
- return useMemo7(() => isCycleReference(rootValue, path, value), [
20265
+ return useMemo8(() => isCycleReference(rootValue, path, value), [
20015
20266
  path,
20016
20267
  value,
20017
20268
  rootValue
@@ -20024,7 +20275,7 @@ function useInspect(path, value, nestedIndex) {
20024
20275
  const setInspectCache = useJsonViewerStore((store) => store.setInspectCache);
20025
20276
  const defaultInspectDepth = useJsonViewerStore((store) => store.defaultInspectDepth);
20026
20277
  const defaultInspectControl = useJsonViewerStore((store) => store.defaultInspectControl);
20027
- useEffect17(() => {
20278
+ useEffect18(() => {
20028
20279
  const inspect2 = getInspectCache(path, nestedIndex);
20029
20280
  if (inspect2 !== void 0) {
20030
20281
  return;
@@ -20046,7 +20297,7 @@ function useInspect(path, value, nestedIndex) {
20046
20297
  value,
20047
20298
  setInspectCache
20048
20299
  ]);
20049
- const [inspect, set] = useState13(() => {
20300
+ const [inspect, set] = useState14(() => {
20050
20301
  const shouldInspect = getInspectCache(path, nestedIndex);
20051
20302
  if (shouldInspect !== void 0) {
20052
20303
  return shouldInspect;
@@ -20056,7 +20307,7 @@ function useInspect(path, value, nestedIndex) {
20056
20307
  }
20057
20308
  return isTrap ? false : typeof defaultInspectControl === "function" ? defaultInspectControl(path, value) : depth < defaultInspectDepth;
20058
20309
  });
20059
- const setInspect = useCallback9((apply) => {
20310
+ const setInspect = useCallback10((apply) => {
20060
20311
  set((oldState) => {
20061
20312
  const newState = typeof apply === "boolean" ? apply : apply(oldState);
20062
20313
  setInspectCache(path, newState, nestedIndex);
@@ -20072,7 +20323,7 @@ function useInspect(path, value, nestedIndex) {
20072
20323
  setInspect
20073
20324
  ];
20074
20325
  }
20075
- var DataBox = (props) => /* @__PURE__ */ jsx136(Box11, {
20326
+ var DataBox = (props) => /* @__PURE__ */ jsx137(Box12, {
20076
20327
  component: "div",
20077
20328
  ...props,
20078
20329
  sx: {
@@ -20083,7 +20334,7 @@ var DataBox = (props) => /* @__PURE__ */ jsx136(Box11, {
20083
20334
  var DataTypeLabel = (param) => {
20084
20335
  let { dataType, enable = true } = param;
20085
20336
  if (!enable) return null;
20086
- return /* @__PURE__ */ jsx136(DataBox, {
20337
+ return /* @__PURE__ */ jsx137(DataBox, {
20087
20338
  className: "data-type-label",
20088
20339
  sx: {
20089
20340
  mx: 0.5,
@@ -20101,18 +20352,18 @@ function defineEasyType(param) {
20101
20352
  const storeDisplayDataTypes = useJsonViewerStore((store) => store.displayDataTypes);
20102
20353
  const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
20103
20354
  const onSelect = useJsonViewerStore((store) => store.onSelect);
20104
- return /* @__PURE__ */ jsxs127(DataBox, {
20355
+ return /* @__PURE__ */ jsxs128(DataBox, {
20105
20356
  onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(props.path, props.value),
20106
20357
  sx: {
20107
20358
  color: color2
20108
20359
  },
20109
20360
  children: [
20110
- displayTypeLabel && storeDisplayDataTypes && /* @__PURE__ */ jsx136(DataTypeLabel, {
20361
+ displayTypeLabel && storeDisplayDataTypes && /* @__PURE__ */ jsx137(DataTypeLabel, {
20111
20362
  dataType: type
20112
20363
  }),
20113
- /* @__PURE__ */ jsx136(DataBox, {
20364
+ /* @__PURE__ */ jsx137(DataBox, {
20114
20365
  className: "".concat(type, "-value"),
20115
- children: /* @__PURE__ */ jsx136(Render, {
20366
+ children: /* @__PURE__ */ jsx137(Render, {
20116
20367
  path: props.path,
20117
20368
  inspect: props.inspect,
20118
20369
  setInspect: props.setInspect,
@@ -20133,7 +20384,7 @@ function defineEasyType(param) {
20133
20384
  const EasyTypeEditor = (param2) => {
20134
20385
  let { value, setValue, abortEditing, commitEditing } = param2;
20135
20386
  const color2 = useJsonViewerStore((store) => store.colorspace[colorKey]);
20136
- const handleKeyDown = useCallback9((event) => {
20387
+ const handleKeyDown = useCallback10((event) => {
20137
20388
  if (event.key === "Enter") {
20138
20389
  event.preventDefault();
20139
20390
  commitEditing(value);
@@ -20147,12 +20398,12 @@ function defineEasyType(param) {
20147
20398
  commitEditing,
20148
20399
  value
20149
20400
  ]);
20150
- const handleChange = useCallback9((event) => {
20401
+ const handleChange = useCallback10((event) => {
20151
20402
  setValue(event.target.value);
20152
20403
  }, [
20153
20404
  setValue
20154
20405
  ]);
20155
- return /* @__PURE__ */ jsx136(InputBase, {
20406
+ return /* @__PURE__ */ jsx137(InputBase, {
20156
20407
  autoFocus: true,
20157
20408
  value,
20158
20409
  onChange: handleChange,
@@ -20192,7 +20443,7 @@ var booleanType = defineEasyType({
20192
20443
  },
20193
20444
  Renderer: (param) => {
20194
20445
  let { value } = param;
20195
- return /* @__PURE__ */ jsx136(Fragment8, {
20446
+ return /* @__PURE__ */ jsx137(Fragment8, {
20196
20447
  children: value ? "true" : "false"
20197
20448
  });
20198
20449
  }
@@ -20211,7 +20462,7 @@ var dateType = defineEasyType({
20211
20462
  colorKey: "base0D",
20212
20463
  Renderer: (param) => {
20213
20464
  let { value } = param;
20214
- return /* @__PURE__ */ jsx136(Fragment8, {
20465
+ return /* @__PURE__ */ jsx137(Fragment8, {
20215
20466
  children: value.toLocaleTimeString("en-us", displayOptions)
20216
20467
  });
20217
20468
  }
@@ -20240,12 +20491,12 @@ var functionName = (func) => {
20240
20491
  var lb = "{";
20241
20492
  var rb = "}";
20242
20493
  var PreFunctionType = (props) => {
20243
- return /* @__PURE__ */ jsxs127(NoSsr, {
20494
+ return /* @__PURE__ */ jsxs128(NoSsr, {
20244
20495
  children: [
20245
- /* @__PURE__ */ jsx136(DataTypeLabel, {
20496
+ /* @__PURE__ */ jsx137(DataTypeLabel, {
20246
20497
  dataType: "function"
20247
20498
  }),
20248
- /* @__PURE__ */ jsxs127(Box11, {
20499
+ /* @__PURE__ */ jsxs128(Box12, {
20249
20500
  component: "span",
20250
20501
  className: "data-function-start",
20251
20502
  sx: {
@@ -20261,8 +20512,8 @@ var PreFunctionType = (props) => {
20261
20512
  });
20262
20513
  };
20263
20514
  var PostFunctionType = () => {
20264
- return /* @__PURE__ */ jsx136(NoSsr, {
20265
- children: /* @__PURE__ */ jsx136(Box11, {
20515
+ return /* @__PURE__ */ jsx137(NoSsr, {
20516
+ children: /* @__PURE__ */ jsx137(Box12, {
20266
20517
  component: "span",
20267
20518
  className: "data-function-end",
20268
20519
  children: rb
@@ -20271,15 +20522,15 @@ var PostFunctionType = () => {
20271
20522
  };
20272
20523
  var FunctionType = (props) => {
20273
20524
  const functionColor = useJsonViewerStore((store) => store.colorspace.base05);
20274
- return /* @__PURE__ */ jsx136(NoSsr, {
20275
- children: /* @__PURE__ */ jsx136(Box11, {
20525
+ return /* @__PURE__ */ jsx137(NoSsr, {
20526
+ children: /* @__PURE__ */ jsx137(Box12, {
20276
20527
  className: "data-function",
20277
20528
  sx: {
20278
20529
  display: props.inspect ? "block" : "inline-block",
20279
20530
  pl: props.inspect ? 2 : 0,
20280
20531
  color: functionColor
20281
20532
  },
20282
- children: props.inspect ? functionBody(props.value) : /* @__PURE__ */ jsx136(Box11, {
20533
+ children: props.inspect ? functionBody(props.value) : /* @__PURE__ */ jsx137(Box12, {
20283
20534
  component: "span",
20284
20535
  className: "data-function-body",
20285
20536
  onClick: () => props.setInspect(true),
@@ -20307,7 +20558,7 @@ var nullType = defineEasyType({
20307
20558
  displayTypeLabel: false,
20308
20559
  Renderer: () => {
20309
20560
  const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
20310
- return /* @__PURE__ */ jsx136(Box11, {
20561
+ return /* @__PURE__ */ jsx137(Box12, {
20311
20562
  sx: {
20312
20563
  fontSize: "0.8rem",
20313
20564
  backgroundColor,
@@ -20330,7 +20581,7 @@ var nanType = defineEasyType({
20330
20581
  deserialize: (value) => parseFloat(value),
20331
20582
  Renderer: () => {
20332
20583
  const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
20333
- return /* @__PURE__ */ jsx136(Box11, {
20584
+ return /* @__PURE__ */ jsx137(Box12, {
20334
20585
  sx: {
20335
20586
  backgroundColor,
20336
20587
  fontSize: "0.8rem",
@@ -20350,7 +20601,7 @@ var floatType = defineEasyType({
20350
20601
  deserialize: (value) => parseFloat(value),
20351
20602
  Renderer: (param) => {
20352
20603
  let { value } = param;
20353
- return /* @__PURE__ */ jsx136(Fragment8, {
20604
+ return /* @__PURE__ */ jsx137(Fragment8, {
20354
20605
  children: value
20355
20606
  });
20356
20607
  }
@@ -20364,7 +20615,7 @@ var intType = defineEasyType({
20364
20615
  deserialize: (value) => parseFloat(value),
20365
20616
  Renderer: (param) => {
20366
20617
  let { value } = param;
20367
- return /* @__PURE__ */ jsx136(Fragment8, {
20618
+ return /* @__PURE__ */ jsx137(Fragment8, {
20368
20619
  children: value
20369
20620
  });
20370
20621
  }
@@ -20377,16 +20628,16 @@ var bigIntType = defineEasyType({
20377
20628
  deserialize: (value) => BigInt(value.replace(/\D/g, "")),
20378
20629
  Renderer: (param) => {
20379
20630
  let { value } = param;
20380
- return /* @__PURE__ */ jsx136(Fragment8, {
20631
+ return /* @__PURE__ */ jsx137(Fragment8, {
20381
20632
  children: "".concat(value, "n")
20382
20633
  });
20383
20634
  }
20384
20635
  });
20385
20636
  var BaseIcon = (param) => {
20386
20637
  let { d: d2, ...props } = param;
20387
- return /* @__PURE__ */ jsx136(SvgIcon, {
20638
+ return /* @__PURE__ */ jsx137(SvgIcon, {
20388
20639
  ...props,
20389
- children: /* @__PURE__ */ jsx136("path", {
20640
+ children: /* @__PURE__ */ jsx137("path", {
20390
20641
  d: d2
20391
20642
  })
20392
20643
  });
@@ -20401,55 +20652,55 @@ var Edit = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.3
20401
20652
  var ExpandMore = "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z";
20402
20653
  var Delete = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5l-1-1h-5l-1 1H5v2h14V4z";
20403
20654
  var AddBoxIcon = (props) => {
20404
- return /* @__PURE__ */ jsx136(BaseIcon, {
20655
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20405
20656
  d: AddBox,
20406
20657
  ...props
20407
20658
  });
20408
20659
  };
20409
20660
  var CheckIcon = (props) => {
20410
- return /* @__PURE__ */ jsx136(BaseIcon, {
20661
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20411
20662
  d: Check2,
20412
20663
  ...props
20413
20664
  });
20414
20665
  };
20415
20666
  var ChevronRightIcon = (props) => {
20416
- return /* @__PURE__ */ jsx136(BaseIcon, {
20667
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20417
20668
  d: ChevronRight,
20418
20669
  ...props
20419
20670
  });
20420
20671
  };
20421
20672
  var CircularArrowsIcon = (props) => {
20422
- return /* @__PURE__ */ jsx136(BaseIcon, {
20673
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20423
20674
  d: CircularArrows,
20424
20675
  ...props
20425
20676
  });
20426
20677
  };
20427
20678
  var CloseIcon = (props) => {
20428
- return /* @__PURE__ */ jsx136(BaseIcon, {
20679
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20429
20680
  d: Close2,
20430
20681
  ...props
20431
20682
  });
20432
20683
  };
20433
20684
  var ContentCopyIcon = (props) => {
20434
- return /* @__PURE__ */ jsx136(BaseIcon, {
20685
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20435
20686
  d: ContentCopy2,
20436
20687
  ...props
20437
20688
  });
20438
20689
  };
20439
20690
  var EditIcon = (props) => {
20440
- return /* @__PURE__ */ jsx136(BaseIcon, {
20691
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20441
20692
  d: Edit,
20442
20693
  ...props
20443
20694
  });
20444
20695
  };
20445
20696
  var ExpandMoreIcon = (props) => {
20446
- return /* @__PURE__ */ jsx136(BaseIcon, {
20697
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20447
20698
  d: ExpandMore,
20448
20699
  ...props
20449
20700
  });
20450
20701
  };
20451
20702
  var DeleteIcon = (props) => {
20452
- return /* @__PURE__ */ jsx136(BaseIcon, {
20703
+ return /* @__PURE__ */ jsx137(BaseIcon, {
20453
20704
  d: Delete,
20454
20705
  ...props
20455
20706
  });
@@ -20472,23 +20723,23 @@ function inspectMetadata(value) {
20472
20723
  var PreObjectType = (props) => {
20473
20724
  const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
20474
20725
  const textColor = useTextColor();
20475
- const isArrayLike = useMemo7(() => Array.isArray(props.value) || props.value instanceof Set, [
20726
+ const isArrayLike = useMemo8(() => Array.isArray(props.value) || props.value instanceof Set, [
20476
20727
  props.value
20477
20728
  ]);
20478
- const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
20729
+ const isEmptyValue = useMemo8(() => getValueSize(props.value) === 0, [
20479
20730
  props.value
20480
20731
  ]);
20481
- const sizeOfValue = useMemo7(() => inspectMetadata(props.value), [
20732
+ const sizeOfValue = useMemo8(() => inspectMetadata(props.value), [
20482
20733
  props.value
20483
20734
  ]);
20484
20735
  const displaySize = useJsonViewerStore((store) => store.displaySize);
20485
- const shouldDisplaySize = useMemo7(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
20736
+ const shouldDisplaySize = useMemo8(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
20486
20737
  displaySize,
20487
20738
  props.path,
20488
20739
  props.value
20489
20740
  ]);
20490
20741
  const isTrap = useIsCycleReference(props.path, props.value);
20491
- return /* @__PURE__ */ jsxs127(Box11, {
20742
+ return /* @__PURE__ */ jsxs128(Box12, {
20492
20743
  component: "span",
20493
20744
  className: "data-object-start",
20494
20745
  sx: {
@@ -20496,7 +20747,7 @@ var PreObjectType = (props) => {
20496
20747
  },
20497
20748
  children: [
20498
20749
  isArrayLike ? arrayLb : objectLb,
20499
- shouldDisplaySize && props.inspect && !isEmptyValue && /* @__PURE__ */ jsx136(Box11, {
20750
+ shouldDisplaySize && props.inspect && !isEmptyValue && /* @__PURE__ */ jsx137(Box12, {
20500
20751
  component: "span",
20501
20752
  sx: {
20502
20753
  pl: 0.5,
@@ -20506,16 +20757,16 @@ var PreObjectType = (props) => {
20506
20757
  },
20507
20758
  children: sizeOfValue
20508
20759
  }),
20509
- isTrap && !props.inspect && /* @__PURE__ */ jsxs127(Fragment8, {
20760
+ isTrap && !props.inspect && /* @__PURE__ */ jsxs128(Fragment8, {
20510
20761
  children: [
20511
- /* @__PURE__ */ jsx136(CircularArrowsIcon, {
20762
+ /* @__PURE__ */ jsx137(CircularArrowsIcon, {
20512
20763
  sx: {
20513
20764
  fontSize: 12,
20514
20765
  color: textColor,
20515
20766
  mx: 0.5
20516
20767
  }
20517
20768
  }),
20518
- /* @__PURE__ */ jsx136(DataBox, {
20769
+ /* @__PURE__ */ jsx137(DataBox, {
20519
20770
  sx: {
20520
20771
  cursor: "pointer",
20521
20772
  userSelect: "none"
@@ -20530,22 +20781,22 @@ var PreObjectType = (props) => {
20530
20781
  var PostObjectType = (props) => {
20531
20782
  const metadataColor = useJsonViewerStore((store) => store.colorspace.base04);
20532
20783
  const textColor = useTextColor();
20533
- const isArrayLike = useMemo7(() => Array.isArray(props.value) || props.value instanceof Set, [
20784
+ const isArrayLike = useMemo8(() => Array.isArray(props.value) || props.value instanceof Set, [
20534
20785
  props.value
20535
20786
  ]);
20536
- const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
20787
+ const isEmptyValue = useMemo8(() => getValueSize(props.value) === 0, [
20537
20788
  props.value
20538
20789
  ]);
20539
- const sizeOfValue = useMemo7(() => inspectMetadata(props.value), [
20790
+ const sizeOfValue = useMemo8(() => inspectMetadata(props.value), [
20540
20791
  props.value
20541
20792
  ]);
20542
20793
  const displaySize = useJsonViewerStore((store) => store.displaySize);
20543
- const shouldDisplaySize = useMemo7(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
20794
+ const shouldDisplaySize = useMemo8(() => typeof displaySize === "function" ? displaySize(props.path, props.value) : displaySize, [
20544
20795
  displaySize,
20545
20796
  props.path,
20546
20797
  props.value
20547
20798
  ]);
20548
- return /* @__PURE__ */ jsxs127(Box11, {
20799
+ return /* @__PURE__ */ jsxs128(Box12, {
20549
20800
  component: "span",
20550
20801
  className: "data-object-end",
20551
20802
  sx: {
@@ -20556,7 +20807,7 @@ var PostObjectType = (props) => {
20556
20807
  },
20557
20808
  children: [
20558
20809
  isArrayLike ? arrayRb : objectRb,
20559
- shouldDisplaySize && (isEmptyValue || !props.inspect) ? /* @__PURE__ */ jsx136(Box11, {
20810
+ shouldDisplaySize && (isEmptyValue || !props.inspect) ? /* @__PURE__ */ jsx137(Box12, {
20560
20811
  component: "span",
20561
20812
  sx: {
20562
20813
  pl: 0.5,
@@ -20577,9 +20828,9 @@ var ObjectType = (props) => {
20577
20828
  const borderColor = useJsonViewerStore((store) => store.colorspace.base02);
20578
20829
  const groupArraysAfterLength = useJsonViewerStore((store) => store.groupArraysAfterLength);
20579
20830
  const isTrap = useIsCycleReference(props.path, props.value);
20580
- const [displayLength, setDisplayLength] = useState13(useJsonViewerStore((store) => store.maxDisplayLength));
20831
+ const [displayLength, setDisplayLength] = useState14(useJsonViewerStore((store) => store.maxDisplayLength));
20581
20832
  const objectSortKeys = useJsonViewerStore((store) => store.objectSortKeys);
20582
- const elements = useMemo7(() => {
20833
+ const elements = useMemo8(() => {
20583
20834
  if (!props.inspect) {
20584
20835
  return null;
20585
20836
  }
@@ -20596,7 +20847,7 @@ var ObjectType = (props) => {
20596
20847
  ...props.path,
20597
20848
  key
20598
20849
  ];
20599
- elements3.push(/* @__PURE__ */ jsx136(DataKeyPair, {
20850
+ elements3.push(/* @__PURE__ */ jsx137(DataKeyPair, {
20600
20851
  path,
20601
20852
  value: value2,
20602
20853
  prevValue: props.prevValue instanceof Map ? props.prevValue.get(k2) : void 0,
@@ -20612,7 +20863,7 @@ var ObjectType = (props) => {
20612
20863
  while (true) {
20613
20864
  const nextResult = iterator2.next();
20614
20865
  var _nextResult_done;
20615
- elements3.push(/* @__PURE__ */ jsx136(DataKeyPair, {
20866
+ elements3.push(/* @__PURE__ */ jsx137(DataKeyPair, {
20616
20867
  path: [
20617
20868
  ...props.path,
20618
20869
  "iterator:".concat(count2)
@@ -20640,7 +20891,7 @@ var ObjectType = (props) => {
20640
20891
  ...props.path,
20641
20892
  index
20642
20893
  ];
20643
- return /* @__PURE__ */ jsx136(DataKeyPair, {
20894
+ return /* @__PURE__ */ jsx137(DataKeyPair, {
20644
20895
  path,
20645
20896
  value: value2,
20646
20897
  prevValue: Array.isArray(props.prevValue) ? props.prevValue[index] : void 0,
@@ -20649,7 +20900,7 @@ var ObjectType = (props) => {
20649
20900
  });
20650
20901
  if (value.length > displayLength) {
20651
20902
  const rest = value.length - displayLength;
20652
- elements4.push(/* @__PURE__ */ jsxs127(DataBox, {
20903
+ elements4.push(/* @__PURE__ */ jsxs128(DataBox, {
20653
20904
  sx: {
20654
20905
  cursor: "pointer",
20655
20906
  lineHeight: 1.5,
@@ -20672,7 +20923,7 @@ var ObjectType = (props) => {
20672
20923
  const prevElements = Array.isArray(props.prevValue) ? segmentArray(props.prevValue, groupArraysAfterLength) : void 0;
20673
20924
  const elementsLastIndex = elements3.length - 1;
20674
20925
  return elements3.map((list, index) => {
20675
- return /* @__PURE__ */ jsx136(DataKeyPair, {
20926
+ return /* @__PURE__ */ jsx137(DataKeyPair, {
20676
20927
  path: props.path,
20677
20928
  value: list,
20678
20929
  nestedIndex: index,
@@ -20699,7 +20950,7 @@ var ObjectType = (props) => {
20699
20950
  ...props.path,
20700
20951
  key
20701
20952
  ];
20702
- return /* @__PURE__ */ jsx136(DataKeyPair, {
20953
+ return /* @__PURE__ */ jsx137(DataKeyPair, {
20703
20954
  path,
20704
20955
  value: value2,
20705
20956
  prevValue: (_props_prevValue = props.prevValue) === null || _props_prevValue === void 0 ? void 0 : _props_prevValue[key],
@@ -20708,7 +20959,7 @@ var ObjectType = (props) => {
20708
20959
  });
20709
20960
  if (entries.length > displayLength) {
20710
20961
  const rest = entries.length - displayLength;
20711
- elements2.push(/* @__PURE__ */ jsxs127(DataBox, {
20962
+ elements2.push(/* @__PURE__ */ jsxs128(DataBox, {
20712
20963
  sx: {
20713
20964
  cursor: "pointer",
20714
20965
  lineHeight: 1.5,
@@ -20740,13 +20991,13 @@ var ObjectType = (props) => {
20740
20991
  const marginLeft = props.inspect ? 0.6 : 0;
20741
20992
  const width = useJsonViewerStore((store) => store.indentWidth);
20742
20993
  const indentWidth = props.inspect ? width - marginLeft : width;
20743
- const isEmptyValue = useMemo7(() => getValueSize(props.value) === 0, [
20994
+ const isEmptyValue = useMemo8(() => getValueSize(props.value) === 0, [
20744
20995
  props.value
20745
20996
  ]);
20746
20997
  if (isEmptyValue) {
20747
20998
  return null;
20748
20999
  }
20749
- return /* @__PURE__ */ jsx136(Box11, {
21000
+ return /* @__PURE__ */ jsx137(Box12, {
20750
21001
  className: "data-object",
20751
21002
  sx: {
20752
21003
  display: props.inspect ? "block" : "inline-block",
@@ -20755,7 +21006,7 @@ var ObjectType = (props) => {
20755
21006
  color: keyColor,
20756
21007
  borderLeft: props.inspect ? "1px solid ".concat(borderColor) : "none"
20757
21008
  },
20758
- children: props.inspect ? elements : !isTrap && /* @__PURE__ */ jsx136(Box11, {
21009
+ children: props.inspect ? elements : !isTrap && /* @__PURE__ */ jsx137(Box12, {
20759
21010
  component: "span",
20760
21011
  className: "data-object-body",
20761
21012
  onClick: () => props.setInspect(true),
@@ -20783,11 +21034,11 @@ var stringType = defineEasyType({
20783
21034
  serialize: (value) => value,
20784
21035
  deserialize: (value) => value,
20785
21036
  Renderer: (props) => {
20786
- const [showRest, setShowRest] = useState13(false);
21037
+ const [showRest, setShowRest] = useState14(false);
20787
21038
  const collapseStringsAfterLength = useJsonViewerStore((store) => store.collapseStringsAfterLength);
20788
21039
  const value = showRest ? props.value : props.value.slice(0, collapseStringsAfterLength);
20789
21040
  const hasRest = props.value.length > collapseStringsAfterLength;
20790
- return /* @__PURE__ */ jsxs127(Box11, {
21041
+ return /* @__PURE__ */ jsxs128(Box12, {
20791
21042
  component: "span",
20792
21043
  sx: {
20793
21044
  overflowWrap: "anywhere",
@@ -20805,7 +21056,7 @@ var stringType = defineEasyType({
20805
21056
  children: [
20806
21057
  '"',
20807
21058
  value,
20808
- hasRest && !showRest && /* @__PURE__ */ jsx136(Box11, {
21059
+ hasRest && !showRest && /* @__PURE__ */ jsx137(Box12, {
20809
21060
  component: "span",
20810
21061
  sx: {
20811
21062
  padding: 0.5
@@ -20824,7 +21075,7 @@ var undefinedType = defineEasyType({
20824
21075
  displayTypeLabel: false,
20825
21076
  Renderer: () => {
20826
21077
  const backgroundColor = useJsonViewerStore((store) => store.colorspace.base02);
20827
- return /* @__PURE__ */ jsx136(Box11, {
21078
+ return /* @__PURE__ */ jsx137(Box12, {
20828
21079
  sx: {
20829
21080
  fontSize: "0.7rem",
20830
21081
  backgroundColor,
@@ -20899,13 +21150,13 @@ function matchTypeComponents(value, path, registry) {
20899
21150
  }
20900
21151
  function useTypeComponents(value, path) {
20901
21152
  const registry = useTypeRegistryStore((store) => store.registry);
20902
- return useMemo7(() => matchTypeComponents(value, path, registry), [
21153
+ return useMemo8(() => matchTypeComponents(value, path, registry), [
20903
21154
  value,
20904
21155
  path,
20905
21156
  registry
20906
21157
  ]);
20907
21158
  }
20908
- var IconBox = (props) => /* @__PURE__ */ jsx136(Box11, {
21159
+ var IconBox = (props) => /* @__PURE__ */ jsx137(Box12, {
20909
21160
  component: "span",
20910
21161
  ...props,
20911
21162
  sx: {
@@ -20920,7 +21171,7 @@ var DataKeyPair = (props) => {
20920
21171
  var _props_editable;
20921
21172
  const propsEditable = (_props_editable = props.editable) !== null && _props_editable !== void 0 ? _props_editable : void 0;
20922
21173
  const storeEditable = useJsonViewerStore((store) => store.editable);
20923
- const editable = useMemo7(() => {
21174
+ const editable = useMemo8(() => {
20924
21175
  if (storeEditable === false) {
20925
21176
  return false;
20926
21177
  }
@@ -20937,11 +21188,11 @@ var DataKeyPair = (props) => {
20937
21188
  storeEditable,
20938
21189
  value
20939
21190
  ]);
20940
- const [tempValue, setTempValue] = useState13("");
21191
+ const [tempValue, setTempValue] = useState14("");
20941
21192
  const depth = path.length;
20942
21193
  const key = path[depth - 1];
20943
21194
  const hoverPath = useJsonViewerStore((store) => store.hoverPath);
20944
- const isHover = useMemo7(() => {
21195
+ const isHover = useMemo8(() => {
20945
21196
  return hoverPath && path.every((value2, index) => value2 === hoverPath.path[index] && nestedIndex === hoverPath.nestedIndex);
20946
21197
  }, [
20947
21198
  hoverPath,
@@ -20951,7 +21202,7 @@ var DataKeyPair = (props) => {
20951
21202
  const setHover = useJsonViewerStore((store) => store.setHover);
20952
21203
  const root2 = useJsonViewerStore((store) => store.value);
20953
21204
  const [inspect, setInspect] = useInspect(path, value, nestedIndex);
20954
- const [editing, setEditing] = useState13(false);
21205
+ const [editing, setEditing] = useState14(false);
20955
21206
  const onChange = useJsonViewerStore((store) => store.onChange);
20956
21207
  const keyColor = useTextColor();
20957
21208
  const numberKeyColor = useJsonViewerStore((store) => store.colorspace.base0C);
@@ -20963,7 +21214,7 @@ var DataKeyPair = (props) => {
20963
21214
  const isNumberKey = Number.isInteger(Number(key));
20964
21215
  const storeEnableAdd = useJsonViewerStore((store) => store.enableAdd);
20965
21216
  const onAdd = useJsonViewerStore((store) => store.onAdd);
20966
- const enableAdd = useMemo7(() => {
21217
+ const enableAdd = useMemo8(() => {
20967
21218
  if (!onAdd || nestedIndex !== void 0) return false;
20968
21219
  if (storeEnableAdd === false) {
20969
21220
  return false;
@@ -20988,7 +21239,7 @@ var DataKeyPair = (props) => {
20988
21239
  ]);
20989
21240
  const storeEnableDelete = useJsonViewerStore((store) => store.enableDelete);
20990
21241
  const onDelete = useJsonViewerStore((store) => store.onDelete);
20991
- const enableDelete = useMemo7(() => {
21242
+ const enableDelete = useMemo8(() => {
20992
21243
  if (!onDelete || nestedIndex !== void 0) return false;
20993
21244
  if (isRoot) {
20994
21245
  return false;
@@ -21015,7 +21266,7 @@ var DataKeyPair = (props) => {
21015
21266
  const enableClipboard = useJsonViewerStore((store) => store.enableClipboard);
21016
21267
  const { copy, copied } = useClipboard();
21017
21268
  const highlightUpdates = useJsonViewerStore((store) => store.highlightUpdates);
21018
- const isHighlight = useMemo7(() => {
21269
+ const isHighlight = useMemo8(() => {
21019
21270
  if (!highlightUpdates || prevValue === void 0) return false;
21020
21271
  if (typeof value !== typeof prevValue) {
21021
21272
  return true;
@@ -21039,8 +21290,8 @@ var DataKeyPair = (props) => {
21039
21290
  prevValue,
21040
21291
  value
21041
21292
  ]);
21042
- const highlightContainer = useRef11();
21043
- useEffect17(() => {
21293
+ const highlightContainer = useRef12();
21294
+ useEffect18(() => {
21044
21295
  if (highlightContainer.current && isHighlight && "animate" in highlightContainer.current) {
21045
21296
  highlightContainer.current.animate([
21046
21297
  {
@@ -21060,7 +21311,7 @@ var DataKeyPair = (props) => {
21060
21311
  prevValue,
21061
21312
  value
21062
21313
  ]);
21063
- const startEditing = useCallback9((event) => {
21314
+ const startEditing = useCallback10((event) => {
21064
21315
  event.preventDefault();
21065
21316
  if (serialize) setTempValue(serialize(value));
21066
21317
  setEditing(true);
@@ -21068,14 +21319,14 @@ var DataKeyPair = (props) => {
21068
21319
  serialize,
21069
21320
  value
21070
21321
  ]);
21071
- const abortEditing = useCallback9(() => {
21322
+ const abortEditing = useCallback10(() => {
21072
21323
  setEditing(false);
21073
21324
  setTempValue("");
21074
21325
  }, [
21075
21326
  setEditing,
21076
21327
  setTempValue
21077
21328
  ]);
21078
- const commitEditing = useCallback9((newValue) => {
21329
+ const commitEditing = useCallback10((newValue) => {
21079
21330
  setEditing(false);
21080
21331
  if (!deserialize) return;
21081
21332
  try {
@@ -21089,20 +21340,20 @@ var DataKeyPair = (props) => {
21089
21340
  path,
21090
21341
  value
21091
21342
  ]);
21092
- const actionIcons = useMemo7(() => {
21343
+ const actionIcons = useMemo8(() => {
21093
21344
  if (editing) {
21094
- return /* @__PURE__ */ jsxs127(Fragment8, {
21345
+ return /* @__PURE__ */ jsxs128(Fragment8, {
21095
21346
  children: [
21096
- /* @__PURE__ */ jsx136(IconBox, {
21097
- children: /* @__PURE__ */ jsx136(CloseIcon, {
21347
+ /* @__PURE__ */ jsx137(IconBox, {
21348
+ children: /* @__PURE__ */ jsx137(CloseIcon, {
21098
21349
  sx: {
21099
21350
  fontSize: ".8rem"
21100
21351
  },
21101
21352
  onClick: abortEditing
21102
21353
  })
21103
21354
  }),
21104
- /* @__PURE__ */ jsx136(IconBox, {
21105
- children: /* @__PURE__ */ jsx136(CheckIcon, {
21355
+ /* @__PURE__ */ jsx137(IconBox, {
21356
+ children: /* @__PURE__ */ jsx137(CheckIcon, {
21106
21357
  sx: {
21107
21358
  fontSize: ".8rem"
21108
21359
  },
@@ -21112,9 +21363,9 @@ var DataKeyPair = (props) => {
21112
21363
  ]
21113
21364
  });
21114
21365
  }
21115
- return /* @__PURE__ */ jsxs127(Fragment8, {
21366
+ return /* @__PURE__ */ jsxs128(Fragment8, {
21116
21367
  children: [
21117
- enableClipboard && /* @__PURE__ */ jsx136(IconBox, {
21368
+ enableClipboard && /* @__PURE__ */ jsx137(IconBox, {
21118
21369
  onClick: (event) => {
21119
21370
  event.preventDefault();
21120
21371
  try {
@@ -21123,41 +21374,41 @@ var DataKeyPair = (props) => {
21123
21374
  console.error(e2);
21124
21375
  }
21125
21376
  },
21126
- children: copied ? /* @__PURE__ */ jsx136(CheckIcon, {
21377
+ children: copied ? /* @__PURE__ */ jsx137(CheckIcon, {
21127
21378
  sx: {
21128
21379
  fontSize: ".8rem"
21129
21380
  }
21130
- }) : /* @__PURE__ */ jsx136(ContentCopyIcon, {
21381
+ }) : /* @__PURE__ */ jsx137(ContentCopyIcon, {
21131
21382
  sx: {
21132
21383
  fontSize: ".8rem"
21133
21384
  }
21134
21385
  })
21135
21386
  }),
21136
- Editor && editable && serialize && deserialize && /* @__PURE__ */ jsx136(IconBox, {
21387
+ Editor && editable && serialize && deserialize && /* @__PURE__ */ jsx137(IconBox, {
21137
21388
  onClick: startEditing,
21138
- children: /* @__PURE__ */ jsx136(EditIcon, {
21389
+ children: /* @__PURE__ */ jsx137(EditIcon, {
21139
21390
  sx: {
21140
21391
  fontSize: ".8rem"
21141
21392
  }
21142
21393
  })
21143
21394
  }),
21144
- enableAdd && /* @__PURE__ */ jsx136(IconBox, {
21395
+ enableAdd && /* @__PURE__ */ jsx137(IconBox, {
21145
21396
  onClick: (event) => {
21146
21397
  event.preventDefault();
21147
21398
  onAdd === null || onAdd === void 0 ? void 0 : onAdd(path);
21148
21399
  },
21149
- children: /* @__PURE__ */ jsx136(AddBoxIcon, {
21400
+ children: /* @__PURE__ */ jsx137(AddBoxIcon, {
21150
21401
  sx: {
21151
21402
  fontSize: ".8rem"
21152
21403
  }
21153
21404
  })
21154
21405
  }),
21155
- enableDelete && /* @__PURE__ */ jsx136(IconBox, {
21406
+ enableDelete && /* @__PURE__ */ jsx137(IconBox, {
21156
21407
  onClick: (event) => {
21157
21408
  event.preventDefault();
21158
21409
  onDelete === null || onDelete === void 0 ? void 0 : onDelete(path, value);
21159
21410
  },
21160
- children: /* @__PURE__ */ jsx136(DeleteIcon, {
21411
+ children: /* @__PURE__ */ jsx137(DeleteIcon, {
21161
21412
  sx: {
21162
21413
  fontSize: ".9rem"
21163
21414
  }
@@ -21185,12 +21436,12 @@ var DataKeyPair = (props) => {
21185
21436
  abortEditing,
21186
21437
  commitEditing
21187
21438
  ]);
21188
- const isEmptyValue = useMemo7(() => getValueSize(value) === 0, [
21439
+ const isEmptyValue = useMemo8(() => getValueSize(value) === 0, [
21189
21440
  value
21190
21441
  ]);
21191
21442
  const expandable = !isEmptyValue && !!(PreComponent && PostComponent);
21192
21443
  const KeyRenderer = useJsonViewerStore((store) => store.keyRenderer);
21193
- const downstreamProps = useMemo7(() => ({
21444
+ const downstreamProps = useMemo8(() => ({
21194
21445
  path,
21195
21446
  inspect,
21196
21447
  setInspect,
@@ -21205,19 +21456,19 @@ var DataKeyPair = (props) => {
21205
21456
  prevValue,
21206
21457
  nestedIndex
21207
21458
  ]);
21208
- return /* @__PURE__ */ jsxs127(Box11, {
21459
+ return /* @__PURE__ */ jsxs128(Box12, {
21209
21460
  className: "data-key-pair",
21210
21461
  "data-testid": "data-key-pair" + path.join("."),
21211
21462
  sx: {
21212
21463
  userSelect: "text"
21213
21464
  },
21214
- onMouseEnter: useCallback9(() => setHover(path, nestedIndex), [
21465
+ onMouseEnter: useCallback10(() => setHover(path, nestedIndex), [
21215
21466
  setHover,
21216
21467
  path,
21217
21468
  nestedIndex
21218
21469
  ]),
21219
21470
  children: [
21220
- /* @__PURE__ */ jsxs127(DataBox, {
21471
+ /* @__PURE__ */ jsxs128(DataBox, {
21221
21472
  component: "span",
21222
21473
  className: "data-key",
21223
21474
  sx: {
@@ -21226,7 +21477,7 @@ var DataKeyPair = (props) => {
21226
21477
  letterSpacing: 0.5,
21227
21478
  opacity: 0.8
21228
21479
  },
21229
- onClick: useCallback9((event) => {
21480
+ onClick: useCallback10((event) => {
21230
21481
  if (event.isDefaultPrevented()) {
21231
21482
  return;
21232
21483
  }
@@ -21238,7 +21489,7 @@ var DataKeyPair = (props) => {
21238
21489
  setInspect
21239
21490
  ]),
21240
21491
  children: [
21241
- expandable ? inspect ? /* @__PURE__ */ jsx136(ExpandMoreIcon, {
21492
+ expandable ? inspect ? /* @__PURE__ */ jsx137(ExpandMoreIcon, {
21242
21493
  className: "data-key-toggle-expanded",
21243
21494
  sx: {
21244
21495
  fontSize: ".8rem",
@@ -21246,7 +21497,7 @@ var DataKeyPair = (props) => {
21246
21497
  cursor: "pointer"
21247
21498
  }
21248
21499
  }
21249
- }) : /* @__PURE__ */ jsx136(ChevronRightIcon, {
21500
+ }) : /* @__PURE__ */ jsx137(ChevronRightIcon, {
21250
21501
  className: "data-key-toggle-collapsed",
21251
21502
  sx: {
21252
21503
  fontSize: ".8rem",
@@ -21255,44 +21506,44 @@ var DataKeyPair = (props) => {
21255
21506
  }
21256
21507
  }
21257
21508
  }) : null,
21258
- /* @__PURE__ */ jsx136(Box11, {
21509
+ /* @__PURE__ */ jsx137(Box12, {
21259
21510
  ref: highlightContainer,
21260
21511
  className: "data-key-key",
21261
21512
  component: "span",
21262
- children: isRoot && depth === 0 ? rootName !== false ? quotesOnKeys ? /* @__PURE__ */ jsxs127(Fragment8, {
21513
+ children: isRoot && depth === 0 ? rootName !== false ? quotesOnKeys ? /* @__PURE__ */ jsxs128(Fragment8, {
21263
21514
  children: [
21264
21515
  '"',
21265
21516
  rootName,
21266
21517
  '"'
21267
21518
  ]
21268
- }) : /* @__PURE__ */ jsx136(Fragment8, {
21519
+ }) : /* @__PURE__ */ jsx137(Fragment8, {
21269
21520
  children: rootName
21270
- }) : null : KeyRenderer.when(downstreamProps) ? /* @__PURE__ */ jsx136(KeyRenderer, {
21521
+ }) : null : KeyRenderer.when(downstreamProps) ? /* @__PURE__ */ jsx137(KeyRenderer, {
21271
21522
  ...downstreamProps
21272
- }) : nestedIndex === void 0 && (isNumberKey ? /* @__PURE__ */ jsx136(Box11, {
21523
+ }) : nestedIndex === void 0 && (isNumberKey ? /* @__PURE__ */ jsx137(Box12, {
21273
21524
  component: "span",
21274
21525
  style: {
21275
21526
  color: numberKeyColor,
21276
21527
  userSelect: isNumberKey ? "none" : "auto"
21277
21528
  },
21278
21529
  children: key
21279
- }) : quotesOnKeys ? /* @__PURE__ */ jsxs127(Fragment8, {
21530
+ }) : quotesOnKeys ? /* @__PURE__ */ jsxs128(Fragment8, {
21280
21531
  children: [
21281
21532
  '"',
21282
21533
  key,
21283
21534
  '"'
21284
21535
  ]
21285
- }) : /* @__PURE__ */ jsx136(Fragment8, {
21536
+ }) : /* @__PURE__ */ jsx137(Fragment8, {
21286
21537
  children: key
21287
21538
  }))
21288
21539
  }),
21289
- isRoot ? rootName !== false && /* @__PURE__ */ jsx136(DataBox, {
21540
+ isRoot ? rootName !== false && /* @__PURE__ */ jsx137(DataBox, {
21290
21541
  className: "data-key-colon",
21291
21542
  sx: {
21292
21543
  mr: 0.5
21293
21544
  },
21294
21545
  children: ":"
21295
- }) : nestedIndex === void 0 && /* @__PURE__ */ jsx136(DataBox, {
21546
+ }) : nestedIndex === void 0 && /* @__PURE__ */ jsx137(DataBox, {
21296
21547
  className: "data-key-colon",
21297
21548
  sx: {
21298
21549
  mr: 0.5,
@@ -21303,29 +21554,29 @@ var DataKeyPair = (props) => {
21303
21554
  },
21304
21555
  children: ":"
21305
21556
  }),
21306
- PreComponent && /* @__PURE__ */ jsx136(PreComponent, {
21557
+ PreComponent && /* @__PURE__ */ jsx137(PreComponent, {
21307
21558
  ...downstreamProps
21308
21559
  }),
21309
21560
  isHover && expandable && inspect && actionIcons
21310
21561
  ]
21311
21562
  }),
21312
- editing && editable ? Editor && /* @__PURE__ */ jsx136(Editor, {
21563
+ editing && editable ? Editor && /* @__PURE__ */ jsx137(Editor, {
21313
21564
  path,
21314
21565
  value: tempValue,
21315
21566
  setValue: setTempValue,
21316
21567
  abortEditing,
21317
21568
  commitEditing
21318
- }) : Component ? /* @__PURE__ */ jsx136(Component, {
21569
+ }) : Component ? /* @__PURE__ */ jsx137(Component, {
21319
21570
  ...downstreamProps
21320
- }) : /* @__PURE__ */ jsx136(Box11, {
21571
+ }) : /* @__PURE__ */ jsx137(Box12, {
21321
21572
  component: "span",
21322
21573
  className: "data-value-fallback",
21323
21574
  children: "fallback: ".concat(value)
21324
21575
  }),
21325
- PostComponent && /* @__PURE__ */ jsx136(PostComponent, {
21576
+ PostComponent && /* @__PURE__ */ jsx137(PostComponent, {
21326
21577
  ...downstreamProps
21327
21578
  }),
21328
- !last && displayComma && /* @__PURE__ */ jsx136(DataBox, {
21579
+ !last && displayComma && /* @__PURE__ */ jsx137(DataBox, {
21329
21580
  children: ","
21330
21581
  }),
21331
21582
  isHover && expandable && !inspect && actionIcons,
@@ -21336,8 +21587,8 @@ var DataKeyPair = (props) => {
21336
21587
  };
21337
21588
  var query = "(prefers-color-scheme: dark)";
21338
21589
  function useThemeDetector() {
21339
- const [isDark, setIsDark] = useState13(false);
21340
- useEffect17(() => {
21590
+ const [isDark, setIsDark] = useState14(false);
21591
+ useEffect18(() => {
21341
21592
  const listener = (e2) => setIsDark(e2.matches);
21342
21593
  setIsDark(window.matchMedia(query).matches);
21343
21594
  const queryMedia = window.matchMedia(query);
@@ -21348,7 +21599,7 @@ function useThemeDetector() {
21348
21599
  }
21349
21600
  function useSetIfNotUndefinedEffect(key, value) {
21350
21601
  const { setState } = useContext16(JsonViewerStoreContext);
21351
- useEffect17(() => {
21602
+ useEffect18(() => {
21352
21603
  if (value !== void 0) {
21353
21604
  setState({
21354
21605
  [key]: value
@@ -21362,7 +21613,7 @@ function useSetIfNotUndefinedEffect(key, value) {
21362
21613
  }
21363
21614
  var JsonViewerInner = (props) => {
21364
21615
  const { setState } = useContext16(JsonViewerStoreContext);
21365
- useEffect17(() => {
21616
+ useEffect18(() => {
21366
21617
  setState((state) => ({
21367
21618
  prevValue: state.value,
21368
21619
  value: props.value
@@ -21390,7 +21641,7 @@ var JsonViewerInner = (props) => {
21390
21641
  useSetIfNotUndefinedEffect("displaySize", props.displaySize);
21391
21642
  useSetIfNotUndefinedEffect("displayComma", props.displayComma);
21392
21643
  useSetIfNotUndefinedEffect("highlightUpdates", props.highlightUpdates);
21393
- useEffect17(() => {
21644
+ useEffect18(() => {
21394
21645
  if (props.theme === "light") {
21395
21646
  setState({
21396
21647
  colorspace: lightColorspace
@@ -21408,13 +21659,13 @@ var JsonViewerInner = (props) => {
21408
21659
  setState,
21409
21660
  props.theme
21410
21661
  ]);
21411
- const themeCls = useMemo7(() => {
21662
+ const themeCls = useMemo8(() => {
21412
21663
  if (typeof props.theme === "object") return "json-viewer-theme-custom";
21413
21664
  return props.theme === "dark" ? "json-viewer-theme-dark" : "json-viewer-theme-light";
21414
21665
  }, [
21415
21666
  props.theme
21416
21667
  ]);
21417
- const onceRef = useRef11(true);
21668
+ const onceRef = useRef12(true);
21418
21669
  const registerTypes = useTypeRegistryStore((store) => store.registerTypes);
21419
21670
  if (onceRef.current) {
21420
21671
  const allTypes = props.valueTypes ? [
@@ -21426,7 +21677,7 @@ var JsonViewerInner = (props) => {
21426
21677
  registerTypes(allTypes);
21427
21678
  onceRef.current = false;
21428
21679
  }
21429
- useEffect17(() => {
21680
+ useEffect18(() => {
21430
21681
  const allTypes = props.valueTypes ? [
21431
21682
  ...predefinedTypes,
21432
21683
  ...props.valueTypes
@@ -21440,12 +21691,12 @@ var JsonViewerInner = (props) => {
21440
21691
  ]);
21441
21692
  const value = useJsonViewerStore((store) => store.value);
21442
21693
  const prevValue = useJsonViewerStore((store) => store.prevValue);
21443
- const emptyPath = useMemo7(() => [], []);
21694
+ const emptyPath = useMemo8(() => [], []);
21444
21695
  const setHover = useJsonViewerStore((store) => store.setHover);
21445
- const onMouseLeave = useCallback9(() => setHover(null), [
21696
+ const onMouseLeave = useCallback10(() => setHover(null), [
21446
21697
  setHover
21447
21698
  ]);
21448
- return /* @__PURE__ */ jsx136(Paper, {
21699
+ return /* @__PURE__ */ jsx137(Paper, {
21449
21700
  elevation: 0,
21450
21701
  className: clsx(themeCls, props.className),
21451
21702
  style: props.style,
@@ -21456,7 +21707,7 @@ var JsonViewerInner = (props) => {
21456
21707
  ...props.sx
21457
21708
  },
21458
21709
  onMouseLeave,
21459
- children: /* @__PURE__ */ jsx136(DataKeyPair, {
21710
+ children: /* @__PURE__ */ jsx137(DataKeyPair, {
21460
21711
  value,
21461
21712
  prevValue,
21462
21713
  path: emptyPath,
@@ -21471,14 +21722,14 @@ var JsonViewer = function JsonViewer2(props) {
21471
21722
  }
21472
21723
  }
21473
21724
  const isAutoDarkTheme = useThemeDetector();
21474
- const themeType = useMemo7(() => {
21725
+ const themeType = useMemo8(() => {
21475
21726
  var _props_theme;
21476
21727
  return props.theme === "auto" ? isAutoDarkTheme ? "dark" : "light" : (_props_theme = props.theme) !== null && _props_theme !== void 0 ? _props_theme : "light";
21477
21728
  }, [
21478
21729
  isAutoDarkTheme,
21479
21730
  props.theme
21480
21731
  ]);
21481
- const theme = useMemo7(() => {
21732
+ const theme = useMemo8(() => {
21482
21733
  const backgroundColor = typeof themeType === "object" ? themeType.base00 : themeType === "dark" ? darkColorspace.base00 : lightColorspace.base00;
21483
21734
  const foregroundColor = typeof themeType === "object" ? themeType.base07 : themeType === "dark" ? darkColorspace.base07 : lightColorspace.base07;
21484
21735
  return createTheme({
@@ -21506,15 +21757,15 @@ var JsonViewer = function JsonViewer2(props) {
21506
21757
  ...props,
21507
21758
  theme: themeType
21508
21759
  };
21509
- const jsonViewerStore = useMemo7(() => createJsonViewerStore(props), []);
21510
- const typeRegistryStore = useMemo7(() => createTypeRegistryStore(), []);
21511
- return /* @__PURE__ */ jsx136(ThemeProvider, {
21760
+ const jsonViewerStore = useMemo8(() => createJsonViewerStore(props), []);
21761
+ const typeRegistryStore = useMemo8(() => createTypeRegistryStore(), []);
21762
+ return /* @__PURE__ */ jsx137(ThemeProvider, {
21512
21763
  theme,
21513
- children: /* @__PURE__ */ jsx136(TypeRegistryStoreContext.Provider, {
21764
+ children: /* @__PURE__ */ jsx137(TypeRegistryStoreContext.Provider, {
21514
21765
  value: typeRegistryStore,
21515
- children: /* @__PURE__ */ jsx136(JsonViewerStoreContext.Provider, {
21766
+ children: /* @__PURE__ */ jsx137(JsonViewerStoreContext.Provider, {
21516
21767
  value: jsonViewerStore,
21517
- children: /* @__PURE__ */ jsx136(JsonViewerInner, {
21768
+ children: /* @__PURE__ */ jsx137(JsonViewerInner, {
21518
21769
  ...mixedProps
21519
21770
  })
21520
21771
  })
@@ -21524,7 +21775,7 @@ var JsonViewer = function JsonViewer2(props) {
21524
21775
 
21525
21776
  // src/components/event-details/payload-viewer.tsx
21526
21777
  import { memo as memo10 } from "react";
21527
- import { jsx as jsx137 } from "react/jsx-runtime";
21778
+ import { jsx as jsx138 } from "react/jsx-runtime";
21528
21779
  function tryParseJson(value) {
21529
21780
  if (typeof value !== "string") {
21530
21781
  return value;
@@ -21537,7 +21788,7 @@ function tryParseJson(value) {
21537
21788
  }
21538
21789
  var PayloadViewer = memo10(({ sx, testId, value }) => {
21539
21790
  const theme = useTheme3();
21540
- return /* @__PURE__ */ jsx137(Box12, { "data-testid": testId, sx: { backgroundColor: "background.default", borderRadius: 1, fontSize: 12, overflow: "auto", p: 1, ...sx }, children: /* @__PURE__ */ jsx137(
21791
+ return /* @__PURE__ */ jsx138(Box13, { "data-testid": testId, sx: { backgroundColor: "background.default", borderRadius: 1, fontSize: 12, overflow: "auto", p: 1, ...sx }, children: /* @__PURE__ */ jsx138(
21541
21792
  JsonViewer,
21542
21793
  {
21543
21794
  displayDataTypes: false,
@@ -21551,21 +21802,21 @@ var PayloadViewer = memo10(({ sx, testId, value }) => {
21551
21802
  });
21552
21803
 
21553
21804
  // src/components/event-details/event-detail.tsx
21554
- import { Fragment as Fragment9, jsx as jsx138, jsxs as jsxs128 } from "react/jsx-runtime";
21555
- var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs128(Box13, { sx: { display: "grid", gap: 1, gridTemplateColumns: "72px 1fr", mb: 0.5 }, children: [
21556
- /* @__PURE__ */ jsx138(Typography9, { color: "text.secondary", sx: { fontWeight: 600 }, variant: "caption", children: label }),
21557
- /* @__PURE__ */ jsx138(Box13, { children: typeof content === "string" ? /* @__PURE__ */ jsx138(Typography9, { sx: { color: "text.primary", whiteSpace: "pre-wrap" }, variant: "caption", children: content }) : content })
21805
+ import { Fragment as Fragment9, jsx as jsx139, jsxs as jsxs129 } from "react/jsx-runtime";
21806
+ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs129(Box14, { sx: { display: "grid", gap: 1, gridTemplateColumns: "72px 1fr", mb: 0.5 }, children: [
21807
+ /* @__PURE__ */ jsx139(Typography10, { color: "text.secondary", sx: { fontWeight: 600 }, variant: "caption", children: label }),
21808
+ /* @__PURE__ */ jsx139(Box14, { children: typeof content === "string" ? /* @__PURE__ */ jsx139(Typography10, { sx: { color: "text.primary", whiteSpace: "pre-wrap" }, variant: "caption", children: content }) : content })
21558
21809
  ] });
21559
21810
  var EventMessage = ({ event }) => {
21560
- const [isOpen, setIsOpen] = useState14(false);
21561
- const [isOverflowing, setIsOverflowing] = useState14(false);
21562
- const textReference = useRef12(null);
21563
- const parsedMessage = useMemo8(() => parseEventMessage(event), [event]);
21564
- const isIAMPolicyEvent = useMemo8(
21811
+ const [isOpen, setIsOpen] = useState15(false);
21812
+ const [isOverflowing, setIsOverflowing] = useState15(false);
21813
+ const textReference = useRef13(null);
21814
+ const parsedMessage = useMemo9(() => parseEventMessage(event), [event]);
21815
+ const isIAMPolicyEvent = useMemo9(
21565
21816
  () => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
21566
21817
  [event]
21567
21818
  );
21568
- useEffect18(() => {
21819
+ useEffect19(() => {
21569
21820
  const checkOverflow = () => {
21570
21821
  const element = textReference.current;
21571
21822
  if (element) {
@@ -21578,17 +21829,17 @@ var EventMessage = ({ event }) => {
21578
21829
  window.removeEventListener("resize", checkOverflow);
21579
21830
  };
21580
21831
  }, [parsedMessage.headline]);
21581
- const hasAdditionalContent = useMemo8(
21832
+ const hasAdditionalContent = useMemo9(
21582
21833
  () => parsedMessage.message || parsedMessage.details || isIAMPolicyEvent,
21583
21834
  [parsedMessage.message, parsedMessage.details, isIAMPolicyEvent]
21584
21835
  );
21585
- const shouldShowToggle = useMemo8(
21836
+ const shouldShowToggle = useMemo9(
21586
21837
  () => isOverflowing || hasAdditionalContent,
21587
21838
  [isOverflowing, hasAdditionalContent]
21588
21839
  );
21589
- return /* @__PURE__ */ jsxs128(Box13, { sx: { display: "flex", flexDirection: "column" }, children: [
21590
- /* @__PURE__ */ jsxs128(Box13, { sx: { alignItems: "center", display: "flex" }, children: [
21591
- Boolean(shouldShowToggle) && /* @__PURE__ */ jsx138(
21840
+ return /* @__PURE__ */ jsxs129(Box14, { sx: { display: "flex", flexDirection: "column" }, children: [
21841
+ /* @__PURE__ */ jsxs129(Box14, { sx: { alignItems: "center", display: "flex" }, children: [
21842
+ Boolean(shouldShowToggle) && /* @__PURE__ */ jsx139(
21592
21843
  IconButton4,
21593
21844
  {
21594
21845
  onClick: () => {
@@ -21596,11 +21847,11 @@ var EventMessage = ({ event }) => {
21596
21847
  },
21597
21848
  size: "small",
21598
21849
  sx: { mr: 1, p: 0 },
21599
- children: isOpen ? /* @__PURE__ */ jsx138(KeyboardArrowDown, { sx: { fontSize: 16 } }) : /* @__PURE__ */ jsx138(KeyboardArrowRight, { sx: { fontSize: 16 } })
21850
+ children: isOpen ? /* @__PURE__ */ jsx139(KeyboardArrowDown, { sx: { fontSize: 16 } }) : /* @__PURE__ */ jsx139(KeyboardArrowRight, { sx: { fontSize: 16 } })
21600
21851
  }
21601
21852
  ),
21602
- /* @__PURE__ */ jsx138(
21603
- Typography9,
21853
+ /* @__PURE__ */ jsx139(
21854
+ Typography10,
21604
21855
  {
21605
21856
  ref: textReference,
21606
21857
  sx: {
@@ -21617,12 +21868,12 @@ var EventMessage = ({ event }) => {
21617
21868
  }
21618
21869
  )
21619
21870
  ] }),
21620
- isOpen && /* @__PURE__ */ jsx138(Box13, { sx: { borderColor: "divider", borderLeft: "2px solid", ml: 1, mt: 0.5, pl: 1.5, py: 0.5 }, children: isIAMPolicyEvent ? /* @__PURE__ */ jsx138(IAMEventDetail, { event }) : /* @__PURE__ */ jsxs128(Fragment9, { children: [
21621
- Boolean(parsedMessage.message) && /* @__PURE__ */ jsx138(DetailRow2, { content: parsedMessage.message, label: "Message" }),
21622
- Boolean(parsedMessage.details) && /* @__PURE__ */ jsx138(
21871
+ isOpen && /* @__PURE__ */ jsx139(Box14, { sx: { borderColor: "divider", borderLeft: "2px solid", ml: 1, mt: 0.5, pl: 1.5, py: 0.5 }, children: isIAMPolicyEvent ? /* @__PURE__ */ jsx139(IAMEventDetail, { event }) : /* @__PURE__ */ jsxs129(Fragment9, { children: [
21872
+ Boolean(parsedMessage.message) && /* @__PURE__ */ jsx139(DetailRow2, { content: parsedMessage.message, label: "Message" }),
21873
+ Boolean(parsedMessage.details) && /* @__PURE__ */ jsx139(
21623
21874
  DetailRow2,
21624
21875
  {
21625
- content: /* @__PURE__ */ jsx138(PayloadViewer, { sx: { px: 0 }, value: tryParseJson(parsedMessage.details) }),
21876
+ content: /* @__PURE__ */ jsx139(PayloadViewer, { sx: { px: 0 }, value: tryParseJson(parsedMessage.details) }),
21626
21877
  label: "Details"
21627
21878
  }
21628
21879
  )
@@ -21655,15 +21906,15 @@ var EventDetail = ({
21655
21906
  type
21656
21907
  }) => {
21657
21908
  if (type === "permission") {
21658
- return /* @__PURE__ */ jsx138(IAMPermissionDetail, { events, spanStatusCode });
21909
+ return /* @__PURE__ */ jsx139(IAMPermissionDetail, { events, spanStatusCode });
21659
21910
  }
21660
21911
  const eventLevel = getEventLevelFromGroup(type);
21661
- return /* @__PURE__ */ jsxs128(Box13, { children: [
21662
- /* @__PURE__ */ jsxs128(Box13, { sx: { alignItems: "center", display: "flex", mb: 0.5 }, children: [
21663
- /* @__PURE__ */ jsx138(StatusIcon2, { errorLevel: eventLevel }),
21664
- /* @__PURE__ */ jsx138(Typography9, { color: "text.secondary", sx: { fontWeight: 600, ml: 0.5 }, variant: "caption", children: displayText })
21912
+ return /* @__PURE__ */ jsxs129(Box14, { children: [
21913
+ /* @__PURE__ */ jsxs129(Box14, { sx: { alignItems: "center", display: "flex", mb: 0.5 }, children: [
21914
+ /* @__PURE__ */ jsx139(StatusIcon2, { errorLevel: eventLevel }),
21915
+ /* @__PURE__ */ jsx139(Typography10, { color: "text.secondary", sx: { fontWeight: 600, ml: 0.5 }, variant: "caption", children: displayText })
21665
21916
  ] }),
21666
- /* @__PURE__ */ jsx138(Box13, { children: events.map((event) => /* @__PURE__ */ jsx138(Box13, { sx: { maxWidth: "100%", mb: 0.5 }, children: /* @__PURE__ */ jsx138(EventMessage, { event }) }, `${event.span_id}-${event.event_id}`)) })
21917
+ /* @__PURE__ */ jsx139(Box14, { children: events.map((event) => /* @__PURE__ */ jsx139(Box14, { sx: { maxWidth: "100%", mb: 0.5 }, children: /* @__PURE__ */ jsx139(EventMessage, { event }) }, `${event.span_id}-${event.event_id}`)) })
21667
21918
  ] });
21668
21919
  };
21669
21920
 
@@ -22105,18 +22356,18 @@ function toBase64(_input) {
22105
22356
  // node_modules/.pnpm/@smithy+util-stream@4.5.25/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js
22106
22357
  init_dist_es();
22107
22358
  var Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
22108
- static fromString(source, encoding = "utf-8") {
22109
- if (typeof source === "string") {
22359
+ static fromString(source2, encoding = "utf-8") {
22360
+ if (typeof source2 === "string") {
22110
22361
  if (encoding === "base64") {
22111
- return _Uint8ArrayBlobAdapter.mutate(fromBase64(source));
22362
+ return _Uint8ArrayBlobAdapter.mutate(fromBase64(source2));
22112
22363
  }
22113
- return _Uint8ArrayBlobAdapter.mutate(fromUtf8(source));
22364
+ return _Uint8ArrayBlobAdapter.mutate(fromUtf8(source2));
22114
22365
  }
22115
- throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
22366
+ throw new Error(`Unsupported conversion from ${typeof source2} to Uint8ArrayBlobAdapter.`);
22116
22367
  }
22117
- static mutate(source) {
22118
- Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype);
22119
- return source;
22368
+ static mutate(source2) {
22369
+ Object.setPrototypeOf(source2, _Uint8ArrayBlobAdapter.prototype);
22370
+ return source2;
22120
22371
  }
22121
22372
  transformToString(encoding = "utf-8") {
22122
22373
  if (encoding === "base64") {
@@ -28341,7 +28592,7 @@ var SmithyMessageEncoderStream = class {
28341
28592
  };
28342
28593
 
28343
28594
  // node_modules/.pnpm/@smithy+eventstream-serde-universal@4.2.14/node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js
28344
- function getChunkedStream(source) {
28595
+ function getChunkedStream(source2) {
28345
28596
  let currentMessageTotalLength = 0;
28346
28597
  let currentMessagePendingLength = 0;
28347
28598
  let currentMessage = null;
@@ -28357,7 +28608,7 @@ function getChunkedStream(source) {
28357
28608
  currentMessageView.setUint32(0, size, false);
28358
28609
  };
28359
28610
  const iterator = async function* () {
28360
- const sourceIterator = source[Symbol.asyncIterator]();
28611
+ const sourceIterator = source2[Symbol.asyncIterator]();
28361
28612
  while (true) {
28362
28613
  const { value, done } = await sourceIterator.next();
28363
28614
  if (done) {
@@ -31620,9 +31871,9 @@ var QueryStatus = {
31620
31871
  };
31621
31872
 
31622
31873
  // src/components/event-details/lambda-invoke-logs-section.tsx
31623
- import { Box as Box14, CircularProgress as CircularProgress3, Stack as Stack3, Typography as Typography10 } from "@mui/material";
31624
- import { useEffect as useEffect19, useMemo as useMemo9, useRef as useRef13, useState as useState15 } from "react";
31625
- import { jsx as jsx139, jsxs as jsxs129 } from "react/jsx-runtime";
31874
+ import { Box as Box15, CircularProgress as CircularProgress3, Stack as Stack3, Typography as Typography11 } from "@mui/material";
31875
+ import { useEffect as useEffect20, useMemo as useMemo10, useRef as useRef14, useState as useState16 } from "react";
31876
+ import { jsx as jsx140, jsxs as jsxs130 } from "react/jsx-runtime";
31626
31877
  var POLL_INTERVAL_MS2 = 1e3;
31627
31878
  async function pollQueryResults(client, queryId) {
31628
31879
  return client.send(new GetQueryResultsCommand({ queryId }));
@@ -31639,7 +31890,7 @@ async function startLambdaLogsQuery(client, functionName2, requestId, startTimeS
31639
31890
  }
31640
31891
  function useCloudWatchLogsClient(region) {
31641
31892
  const { localstackEndpoint } = useAppInspector();
31642
- const client = useMemo9(() => new CloudWatchLogsClient({
31893
+ const client = useMemo10(() => new CloudWatchLogsClient({
31643
31894
  credentials: {
31644
31895
  accessKeyId: "test",
31645
31896
  secretAccessKey: "test"
@@ -31650,12 +31901,12 @@ function useCloudWatchLogsClient(region) {
31650
31901
  return client;
31651
31902
  }
31652
31903
  function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano) {
31653
- const [loading, setLoading] = useState15(true);
31654
- const [logs, setLogs] = useState15([]);
31655
- const [error, setError] = useState15();
31656
- const pollTimerRef = useRef13(null);
31904
+ const [loading, setLoading] = useState16(true);
31905
+ const [logs, setLogs] = useState16([]);
31906
+ const [error, setError] = useState16();
31907
+ const pollTimerRef = useRef14(null);
31657
31908
  const cloudWatchLogs = useCloudWatchLogsClient(region);
31658
- useEffect19(() => {
31909
+ useEffect20(() => {
31659
31910
  let cancelled = false;
31660
31911
  const startTimeSec = Math.floor(Number(BigInt(startTimeNano) / BigInt(1e9)));
31661
31912
  const endTimeSec = Math.ceil(Number(BigInt(endTimeNano) / BigInt(1e9)));
@@ -31712,30 +31963,30 @@ function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, en
31712
31963
  var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, region, requestId, startTimeNano }) => {
31713
31964
  const { error, loading, logs } = useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano);
31714
31965
  if (loading) {
31715
- return /* @__PURE__ */ jsxs129(Stack3, { alignItems: "center", direction: "row", spacing: 1, children: [
31716
- /* @__PURE__ */ jsx139(CircularProgress3, { size: 14 }),
31717
- /* @__PURE__ */ jsx139(Typography10, { color: "text.secondary", variant: "body2", children: "Loading logs\u2026" })
31966
+ return /* @__PURE__ */ jsxs130(Stack3, { alignItems: "center", direction: "row", spacing: 1, children: [
31967
+ /* @__PURE__ */ jsx140(CircularProgress3, { size: 14 }),
31968
+ /* @__PURE__ */ jsx140(Typography11, { color: "text.secondary", variant: "body2", children: "Loading logs\u2026" })
31718
31969
  ] });
31719
31970
  }
31720
31971
  if (error !== void 0) {
31721
- return /* @__PURE__ */ jsx139(Typography10, { color: "error", variant: "body2", children: error.message });
31972
+ return /* @__PURE__ */ jsx140(Typography11, { color: "error", variant: "body2", children: error.message });
31722
31973
  }
31723
31974
  if (logs.length === 0) {
31724
- return /* @__PURE__ */ jsx139(Typography10, { color: "text.secondary", variant: "body2", children: "No logs found for this invocation." });
31975
+ return /* @__PURE__ */ jsx140(Typography11, { color: "text.secondary", variant: "body2", children: "No logs found for this invocation." });
31725
31976
  }
31726
- return /* @__PURE__ */ jsx139(Box14, { sx: { backgroundColor: (theme) => theme.palette.background.default, borderRadius: 1, p: 1 }, children: /* @__PURE__ */ jsx139("pre", { style: { margin: 0, overflow: "auto" }, children: logs.map((log) => /* @__PURE__ */ jsx139(Typography10, { variant: "body2", children: `[${log.timestamp}] ${log.message}` }, log.ptr)) }) });
31977
+ return /* @__PURE__ */ jsx140(Box15, { sx: { backgroundColor: (theme) => theme.palette.background.default, borderRadius: 1, p: 1 }, children: /* @__PURE__ */ jsx140("pre", { style: { margin: 0, overflow: "auto" }, children: logs.map((log) => /* @__PURE__ */ jsx140(Typography11, { variant: "body2", children: `[${log.timestamp}] ${log.message}` }, log.ptr)) }) });
31727
31978
  };
31728
31979
 
31729
31980
  // src/components/event-details/toggle-section.tsx
31730
31981
  import { KeyboardArrowDown as KeyboardArrowDown2, KeyboardArrowRight as KeyboardArrowRight2 } from "@mui/icons-material";
31731
- import { Box as Box15, Typography as Typography11 } from "@mui/material";
31732
- import { useState as useState16 } from "react";
31733
- import { jsx as jsx140, jsxs as jsxs130 } from "react/jsx-runtime";
31982
+ import { Box as Box16, Typography as Typography12 } from "@mui/material";
31983
+ import { useState as useState17 } from "react";
31984
+ import { jsx as jsx141, jsxs as jsxs131 } from "react/jsx-runtime";
31734
31985
  var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
31735
- const [isOpen, setIsOpen] = useState16(initialOpen);
31736
- return /* @__PURE__ */ jsxs130(Box15, { sx: { mt: 4 }, children: [
31737
- /* @__PURE__ */ jsxs130(
31738
- Box15,
31986
+ const [isOpen, setIsOpen] = useState17(initialOpen);
31987
+ return /* @__PURE__ */ jsxs131(Box16, { sx: { mt: 4 }, children: [
31988
+ /* @__PURE__ */ jsxs131(
31989
+ Box16,
31739
31990
  {
31740
31991
  onClick: () => {
31741
31992
  setIsOpen(!isOpen);
@@ -31748,8 +31999,8 @@ var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
31748
31999
  mb: 1
31749
32000
  },
31750
32001
  children: [
31751
- /* @__PURE__ */ jsxs130(
31752
- Box15,
32002
+ /* @__PURE__ */ jsxs131(
32003
+ Box16,
31753
32004
  {
31754
32005
  role: "button",
31755
32006
  sx: {
@@ -31758,23 +32009,23 @@ var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
31758
32009
  gap: 1
31759
32010
  },
31760
32011
  children: [
31761
- /* @__PURE__ */ jsx140(Typography11, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
31762
- isOpen ? /* @__PURE__ */ jsx140(KeyboardArrowDown2, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ jsx140(KeyboardArrowRight2, { sx: { color: "text.secondary", height: 20, width: 20 } })
32012
+ /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "subtitle2", children: headline }),
32013
+ isOpen ? /* @__PURE__ */ jsx141(KeyboardArrowDown2, { sx: { color: "text.secondary", height: 20, width: 20 } }) : /* @__PURE__ */ jsx141(KeyboardArrowRight2, { sx: { color: "text.secondary", height: 20, width: 20 } })
31763
32014
  ]
31764
32015
  }
31765
32016
  ),
31766
- action !== false && /* @__PURE__ */ jsx140(Box15, { onClick: (event) => {
32017
+ action !== false && /* @__PURE__ */ jsx141(Box16, { onClick: (event) => {
31767
32018
  event.stopPropagation();
31768
32019
  }, children: action })
31769
32020
  ]
31770
32021
  }
31771
32022
  ),
31772
- isOpen && /* @__PURE__ */ jsx140(Box15, { children })
32023
+ isOpen && /* @__PURE__ */ jsx141(Box16, { children })
31773
32024
  ] });
31774
32025
  };
31775
32026
 
31776
32027
  // src/components/event-details/event-details.tsx
31777
- import { Fragment as Fragment10, jsx as jsx141, jsxs as jsxs131 } from "react/jsx-runtime";
32028
+ import { Fragment as Fragment10, jsx as jsx142, jsxs as jsxs132 } from "react/jsx-runtime";
31778
32029
  var checkIsLambdaInvoke = (span) => {
31779
32030
  if (span.service_name !== "lambda") {
31780
32031
  return false;
@@ -31789,13 +32040,13 @@ var checkIsSqsSendMessage = (span) => {
31789
32040
  return span.operation_name.startsWith("SendMessage");
31790
32041
  };
31791
32042
  var EventDetails = ({ onClose, selectedEvent }) => {
31792
- const eventGroups = useMemo10(
32043
+ const eventGroups = useMemo11(
31793
32044
  () => getEventGroupsByType(selectedEvent?.events ?? []),
31794
32045
  [selectedEvent?.events]
31795
32046
  );
31796
- const [parseNestedJson, setParseNestedJson] = useState17(true);
32047
+ const [parseNestedJson, setParseNestedJson] = useState18(true);
31797
32048
  if (!selectedEvent) {
31798
- return /* @__PURE__ */ jsx141(Box16, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ jsx141(Typography12, { color: "text.secondary", variant: "body2", children: "Select an operation to view graph" }) });
32049
+ return /* @__PURE__ */ jsx142(Box17, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ jsx142(Typography13, { color: "text.secondary", variant: "body2", children: "Select an operation to view graph" }) });
31799
32050
  }
31800
32051
  const isLambdaInvoke = checkIsLambdaInvoke(selectedEvent);
31801
32052
  const isSqsSendMessage = checkIsSqsSendMessage(selectedEvent);
@@ -31821,9 +32072,9 @@ var EventDetails = ({ onClose, selectedEvent }) => {
31821
32072
  const exceptionPayload = tryParseJson(selectedEvent.attributes?.["localstack.aws.service.exception"]);
31822
32073
  const hasPayloads = requestPayload !== void 0 || responsePayload !== void 0 || exceptionPayload !== void 0 || isResponseSuppressed;
31823
32074
  const duration = selectedEvent.end_time_unix_nano ? ((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString() : void 0;
31824
- return /* @__PURE__ */ jsxs131(Box16, { "data-testid": EVENT_DETAILS_TEST_ID, sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
31825
- /* @__PURE__ */ jsxs131(
31826
- Box16,
32075
+ return /* @__PURE__ */ jsxs132(Box17, { "data-testid": EVENT_DETAILS_TEST_ID, sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
32076
+ /* @__PURE__ */ jsxs132(
32077
+ Box17,
31827
32078
  {
31828
32079
  sx: {
31829
32080
  alignItems: "center",
@@ -31835,90 +32086,90 @@ var EventDetails = ({ onClose, selectedEvent }) => {
31835
32086
  py: 1
31836
32087
  },
31837
32088
  children: [
31838
- /* @__PURE__ */ jsx141(Box16, { children: /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "h6", children: "Operation Details" }) }),
31839
- onClose && /* @__PURE__ */ jsx141(IconButton5, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ jsx141(Close3, {}) })
32089
+ /* @__PURE__ */ jsx142(Box17, { children: /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "h6", children: "Operation Details" }) }),
32090
+ onClose && /* @__PURE__ */ jsx142(IconButton5, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ jsx142(Close3, {}) })
31840
32091
  ]
31841
32092
  }
31842
32093
  ),
31843
- /* @__PURE__ */ jsx141(Box16, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ jsxs131(Stack4, { spacing: 2, children: [
31844
- /* @__PURE__ */ jsx141(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ jsxs131(Stack4, { "data-testid": EVENT_DETAILS_SECTION_BASIC_INFORMATION_TEST_ID, spacing: 1, children: [
31845
- /* @__PURE__ */ jsxs131(Box16, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
31846
- /* @__PURE__ */ jsxs131(Box16, { children: [
31847
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
31848
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31849
- /* @__PURE__ */ jsx141(Typography12, { "data-testid": EVENT_DETAILS_SERVICE_NAME_TEST_ID, variant: "body2", children: getServiceDisplayName(selectedEvent.service_name) }),
31850
- /* @__PURE__ */ jsx141(CopyButton, { value: getServiceDisplayName(selectedEvent.service_name) })
32094
+ /* @__PURE__ */ jsx142(Box17, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ jsxs132(Stack4, { spacing: 2, children: [
32095
+ /* @__PURE__ */ jsx142(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ jsxs132(Stack4, { "data-testid": EVENT_DETAILS_SECTION_BASIC_INFORMATION_TEST_ID, spacing: 1, children: [
32096
+ /* @__PURE__ */ jsxs132(Box17, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
32097
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32098
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
32099
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32100
+ /* @__PURE__ */ jsx142(Typography13, { "data-testid": EVENT_DETAILS_SERVICE_NAME_TEST_ID, variant: "body2", children: getServiceDisplayName(selectedEvent.service_name) }),
32101
+ /* @__PURE__ */ jsx142(CopyButton, { value: getServiceDisplayName(selectedEvent.service_name) })
31851
32102
  ] })
31852
32103
  ] }),
31853
- /* @__PURE__ */ jsxs131(Box16, { children: [
31854
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Action" }),
31855
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31856
- /* @__PURE__ */ jsx141(Typography12, { "data-testid": EVENT_DETAILS_OPERATION_NAME_TEST_ID, variant: "body2", children: selectedEvent.operation_name }),
31857
- /* @__PURE__ */ jsx141(CopyButton, { value: selectedEvent.operation_name })
32104
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32105
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Action" }),
32106
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32107
+ /* @__PURE__ */ jsx142(Typography13, { "data-testid": EVENT_DETAILS_OPERATION_NAME_TEST_ID, variant: "body2", children: selectedEvent.operation_name }),
32108
+ /* @__PURE__ */ jsx142(CopyButton, { value: selectedEvent.operation_name })
31858
32109
  ] })
31859
32110
  ] })
31860
32111
  ] }),
31861
- /* @__PURE__ */ jsxs131(Box16, { sx: cfnResourceType ? { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" } : void 0, children: [
31862
- /* @__PURE__ */ jsxs131(Box16, { children: [
31863
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
31864
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", "data-testid": EVENT_DETAILS_RESOURCE_NAME_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31865
- /* @__PURE__ */ jsx141(Typography12, { variant: "body2", children: selectedEvent.resource_name }),
31866
- /* @__PURE__ */ jsx141(CopyButton, { value: selectedEvent.resource_name })
32112
+ /* @__PURE__ */ jsxs132(Box17, { sx: cfnResourceType ? { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" } : void 0, children: [
32113
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32114
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
32115
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", "data-testid": EVENT_DETAILS_RESOURCE_NAME_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32116
+ /* @__PURE__ */ jsx142(Typography13, { variant: "body2", children: selectedEvent.resource_name }),
32117
+ /* @__PURE__ */ jsx142(CopyButton, { value: selectedEvent.resource_name })
31867
32118
  ] })
31868
32119
  ] }),
31869
- Boolean(cfnResourceType) && /* @__PURE__ */ jsxs131(Box16, { children: [
31870
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource Type" }),
31871
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31872
- /* @__PURE__ */ jsx141(Typography12, { "data-testid": EVENT_DETAILS_CFN_RESOURCE_TYPE_TEST_ID, variant: "body2", children: cfnResourceType }),
31873
- /* @__PURE__ */ jsx141(CopyButton, { value: cfnResourceType })
32120
+ Boolean(cfnResourceType) && /* @__PURE__ */ jsxs132(Box17, { children: [
32121
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource Type" }),
32122
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32123
+ /* @__PURE__ */ jsx142(Typography13, { "data-testid": EVENT_DETAILS_CFN_RESOURCE_TYPE_TEST_ID, variant: "body2", children: cfnResourceType }),
32124
+ /* @__PURE__ */ jsx142(CopyButton, { value: cfnResourceType })
31874
32125
  ] })
31875
32126
  ] })
31876
32127
  ] }),
31877
- Boolean(resourceArn) && /* @__PURE__ */ jsxs131(Box16, { children: [
31878
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource ARN" }),
31879
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", "data-testid": EVENT_DETAILS_RESOURCE_ARN_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31880
- /* @__PURE__ */ jsx141(Typography12, { variant: "body2", children: resourceArn }),
31881
- /* @__PURE__ */ jsx141(CopyButton, { value: resourceArn })
32128
+ Boolean(resourceArn) && /* @__PURE__ */ jsxs132(Box17, { children: [
32129
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource ARN" }),
32130
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", "data-testid": EVENT_DETAILS_RESOURCE_ARN_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32131
+ /* @__PURE__ */ jsx142(Typography13, { variant: "body2", children: resourceArn }),
32132
+ /* @__PURE__ */ jsx142(CopyButton, { value: resourceArn })
31882
32133
  ] })
31883
32134
  ] }),
31884
- /* @__PURE__ */ jsxs131(Box16, { sx: { display: "grid", gap: 1, gridTemplateColumns: "1.3fr 1fr" }, children: [
31885
- /* @__PURE__ */ jsxs131(Box16, { children: [
31886
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Account" }),
31887
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31888
- /* @__PURE__ */ jsx141(Typography12, { "data-testid": EVENT_DETAILS_ACCOUNT_TEST_ID, variant: "body2", children: selectedEvent.account_id }),
31889
- /* @__PURE__ */ jsx141(CopyButton, { value: selectedEvent.account_id })
32135
+ /* @__PURE__ */ jsxs132(Box17, { sx: { display: "grid", gap: 1, gridTemplateColumns: "1.3fr 1fr" }, children: [
32136
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32137
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Account" }),
32138
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32139
+ /* @__PURE__ */ jsx142(Typography13, { "data-testid": EVENT_DETAILS_ACCOUNT_TEST_ID, variant: "body2", children: selectedEvent.account_id }),
32140
+ /* @__PURE__ */ jsx142(CopyButton, { value: selectedEvent.account_id })
31890
32141
  ] })
31891
32142
  ] }),
31892
- /* @__PURE__ */ jsxs131(Box16, { children: [
31893
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
31894
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31895
- /* @__PURE__ */ jsx141(Typography12, { "data-testid": EVENT_DETAILS_REGION_TEST_ID, variant: "body2", children: selectedEvent.region }),
31896
- /* @__PURE__ */ jsx141(CopyButton, { value: selectedEvent.region })
32143
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32144
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
32145
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32146
+ /* @__PURE__ */ jsx142(Typography13, { "data-testid": EVENT_DETAILS_REGION_TEST_ID, variant: "body2", children: selectedEvent.region }),
32147
+ /* @__PURE__ */ jsx142(CopyButton, { value: selectedEvent.region })
31897
32148
  ] })
31898
32149
  ] })
31899
32150
  ] }),
31900
- /* @__PURE__ */ jsxs131(Box16, { sx: { display: "grid", gap: 1, gridTemplateColumns: duration === void 0 ? "1fr" : "1.3fr 1fr" }, children: [
31901
- /* @__PURE__ */ jsxs131(Box16, { children: [
31902
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
31903
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", "data-testid": EVENT_DETAILS_START_TIME_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31904
- /* @__PURE__ */ jsx141(Typography12, { variant: "body2", children: /* @__PURE__ */ jsx141(ResponsiveTimestampCell, { date: unixNanoToDate(selectedEvent.start_time_unix_nano) }) }),
31905
- /* @__PURE__ */ jsx141(CopyButton, { value: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
32151
+ /* @__PURE__ */ jsxs132(Box17, { sx: { display: "grid", gap: 1, gridTemplateColumns: duration === void 0 ? "1fr" : "1.3fr 1fr" }, children: [
32152
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32153
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
32154
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", "data-testid": EVENT_DETAILS_START_TIME_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32155
+ /* @__PURE__ */ jsx142(Typography13, { variant: "body2", children: /* @__PURE__ */ jsx142(ResponsiveTimestampCell, { date: unixNanoToDate(selectedEvent.start_time_unix_nano) }) }),
32156
+ /* @__PURE__ */ jsx142(CopyButton, { value: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
31906
32157
  ] })
31907
32158
  ] }),
31908
- duration !== void 0 && /* @__PURE__ */ jsxs131(Box16, { children: [
31909
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
31910
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", "data-testid": EVENT_DETAILS_DURATION_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31911
- /* @__PURE__ */ jsxs131(Typography12, { variant: "body2", children: [
32159
+ duration !== void 0 && /* @__PURE__ */ jsxs132(Box17, { children: [
32160
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
32161
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", "data-testid": EVENT_DETAILS_DURATION_TEST_ID, direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32162
+ /* @__PURE__ */ jsxs132(Typography13, { variant: "body2", children: [
31912
32163
  duration,
31913
32164
  "ms"
31914
32165
  ] }),
31915
- /* @__PURE__ */ jsx141(CopyButton, { value: `${duration}ms` })
32166
+ /* @__PURE__ */ jsx142(CopyButton, { value: `${duration}ms` })
31916
32167
  ] })
31917
32168
  ] })
31918
32169
  ] }),
31919
- /* @__PURE__ */ jsxs131(Box16, { children: [
31920
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Status" }),
31921
- /* @__PURE__ */ jsx141(Stack4, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 1, sx: { mb: eventGroups.errors || eventGroups.warnings ? 1 : 0 }, children: /* @__PURE__ */ jsx141(
32170
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32171
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Status" }),
32172
+ /* @__PURE__ */ jsx142(Stack4, { alignItems: "center", direction: "row", flexWrap: "wrap", gap: 1, sx: { mb: eventGroups.errors || eventGroups.warnings ? 1 : 0 }, children: /* @__PURE__ */ jsx142(
31922
32173
  Chip3,
31923
32174
  {
31924
32175
  color: selectedEvent.status_code === 2 ? "error" : selectedEvent.status_code === 1 ? "success" : "default",
@@ -31929,50 +32180,50 @@ var EventDetails = ({ onClose, selectedEvent }) => {
31929
32180
  ) })
31930
32181
  ] })
31931
32182
  ] }) }),
31932
- /* @__PURE__ */ jsx141(Divider4, {}),
31933
- /* @__PURE__ */ jsxs131(ToggleSection, { headline: "Permissions", children: [
31934
- selectedEvent.iam_errors_suppressed && /* @__PURE__ */ jsx141(Alert4, { "data-testid": EVENT_DETAILS_IAM_ERRORS_SUPPRESSED_TEST_ID, severity: "warning", sx: { mb: 1 }, children: "IAM errors are suppressed \u2014 upgrade your license to view" }),
31935
- !selectedEvent.iam_errors_suppressed && !eventGroups.permissions && !eventGroups.errors && !eventGroups.warnings && /* @__PURE__ */ jsx141(Typography12, { color: "text.secondary", variant: "body2", children: "There is no permission information available." }),
31936
- eventGroups.permissions && /* @__PURE__ */ jsx141(EventDetail, { displayText: "Permissions", events: eventGroups.permissions, spanStatusCode: selectedEvent.status_code, type: "permission" }),
31937
- eventGroups.errors && /* @__PURE__ */ jsx141(EventDetail, { displayText: "Error", events: eventGroups.errors, type: "error" }),
31938
- eventGroups.warnings && /* @__PURE__ */ jsx141(EventDetail, { displayText: "Warning", events: eventGroups.warnings, type: "warning" })
32183
+ /* @__PURE__ */ jsx142(Divider4, {}),
32184
+ /* @__PURE__ */ jsxs132(ToggleSection, { headline: "Permissions", children: [
32185
+ selectedEvent.iam_errors_suppressed && /* @__PURE__ */ jsx142(Alert5, { "data-testid": EVENT_DETAILS_IAM_ERRORS_SUPPRESSED_TEST_ID, severity: "warning", sx: { mb: 1 }, children: "IAM errors are suppressed \u2014 upgrade your license to view" }),
32186
+ !selectedEvent.iam_errors_suppressed && !eventGroups.permissions && !eventGroups.errors && !eventGroups.warnings && /* @__PURE__ */ jsx142(Typography13, { color: "text.secondary", variant: "body2", children: "There is no permission information available." }),
32187
+ eventGroups.permissions && /* @__PURE__ */ jsx142(EventDetail, { displayText: "Permissions", events: eventGroups.permissions, spanStatusCode: selectedEvent.status_code, type: "permission" }),
32188
+ eventGroups.errors && /* @__PURE__ */ jsx142(EventDetail, { displayText: "Error", events: eventGroups.errors, type: "error" }),
32189
+ eventGroups.warnings && /* @__PURE__ */ jsx142(EventDetail, { displayText: "Warning", events: eventGroups.warnings, type: "warning" })
31939
32190
  ] }),
31940
- hasPayloads && /* @__PURE__ */ jsxs131(Fragment10, { children: [
31941
- /* @__PURE__ */ jsx141(Divider4, {}),
31942
- /* @__PURE__ */ jsx141(
32191
+ hasPayloads && /* @__PURE__ */ jsxs132(Fragment10, { children: [
32192
+ /* @__PURE__ */ jsx142(Divider4, {}),
32193
+ /* @__PURE__ */ jsx142(
31943
32194
  ToggleSection,
31944
32195
  {
31945
- action: /* @__PURE__ */ jsx141(
32196
+ action: /* @__PURE__ */ jsx142(
31946
32197
  FormControlLabel,
31947
32198
  {
31948
- control: /* @__PURE__ */ jsx141(Switch, { checked: !parseNestedJson, onChange: (event) => {
32199
+ control: /* @__PURE__ */ jsx142(Switch, { checked: !parseNestedJson, onChange: (event) => {
31949
32200
  setParseNestedJson(!event.target.checked);
31950
32201
  }, size: "small" }),
31951
- label: /* @__PURE__ */ jsx141(Typography12, { variant: "caption", children: "View raw data" }),
32202
+ label: /* @__PURE__ */ jsx142(Typography13, { variant: "caption", children: "View raw data" }),
31952
32203
  sx: { mr: 0 }
31953
32204
  }
31954
32205
  ),
31955
32206
  headline: "Payloads",
31956
- children: /* @__PURE__ */ jsxs131(Stack4, { spacing: 2, children: [
31957
- requestPayload !== void 0 && /* @__PURE__ */ jsxs131(Box16, { children: [
31958
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Request" }),
31959
- /* @__PURE__ */ jsx141(PayloadViewer, { testId: EVENT_DETAILS_REQUEST_PAYLOAD, value: requestPayload })
32207
+ children: /* @__PURE__ */ jsxs132(Stack4, { spacing: 2, children: [
32208
+ requestPayload !== void 0 && /* @__PURE__ */ jsxs132(Box17, { children: [
32209
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Request" }),
32210
+ /* @__PURE__ */ jsx142(PayloadViewer, { testId: EVENT_DETAILS_REQUEST_PAYLOAD, value: requestPayload })
31960
32211
  ] }),
31961
- (responsePayload !== void 0 || isResponseSuppressed) && /* @__PURE__ */ jsxs131(Box16, { children: [
31962
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Response" }),
31963
- isResponseSuppressed ? /* @__PURE__ */ jsx141(Box16, { sx: { py: 1 }, children: /* @__PURE__ */ jsx141(Alert4, { severity: "warning", sx: { mb: 1 }, children: "Response payload is available \u2014 upgrade your license to view" }) }) : /* @__PURE__ */ jsx141(PayloadViewer, { testId: EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID, value: responsePayload })
32212
+ (responsePayload !== void 0 || isResponseSuppressed) && /* @__PURE__ */ jsxs132(Box17, { children: [
32213
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Response" }),
32214
+ isResponseSuppressed ? /* @__PURE__ */ jsx142(Box17, { sx: { py: 1 }, children: /* @__PURE__ */ jsx142(Alert5, { severity: "warning", sx: { mb: 1 }, children: "Response payload is available \u2014 upgrade your license to view" }) }) : /* @__PURE__ */ jsx142(PayloadViewer, { testId: EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID, value: responsePayload })
31964
32215
  ] }),
31965
- exceptionPayload !== void 0 && /* @__PURE__ */ jsxs131(Box16, { children: [
31966
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Exception" }),
31967
- /* @__PURE__ */ jsx141(PayloadViewer, { testId: EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID, value: exceptionPayload })
32216
+ exceptionPayload !== void 0 && /* @__PURE__ */ jsxs132(Box17, { children: [
32217
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Exception" }),
32218
+ /* @__PURE__ */ jsx142(PayloadViewer, { testId: EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID, value: exceptionPayload })
31968
32219
  ] })
31969
32220
  ] })
31970
32221
  }
31971
32222
  )
31972
32223
  ] }),
31973
- isLambdaInvoke && requestId !== void 0 && /* @__PURE__ */ jsxs131(Fragment10, { children: [
31974
- /* @__PURE__ */ jsx141(Divider4, {}),
31975
- /* @__PURE__ */ jsx141(ToggleSection, { headline: "Lambda Logs", children: /* @__PURE__ */ jsx141(
32224
+ isLambdaInvoke && requestId !== void 0 && /* @__PURE__ */ jsxs132(Fragment10, { children: [
32225
+ /* @__PURE__ */ jsx142(Divider4, {}),
32226
+ /* @__PURE__ */ jsx142(ToggleSection, { headline: "Lambda Logs", children: /* @__PURE__ */ jsx142(
31976
32227
  LambdaInvokeLogsSection,
31977
32228
  {
31978
32229
  endTimeNano: selectedEvent.end_time_unix_nano ?? selectedEvent.start_time_unix_nano,
@@ -31983,30 +32234,30 @@ var EventDetails = ({ onClose, selectedEvent }) => {
31983
32234
  }
31984
32235
  ) })
31985
32236
  ] }),
31986
- /* @__PURE__ */ jsx141(Divider4, {}),
31987
- /* @__PURE__ */ jsx141(ToggleSection, { headline: "Advanced Information", initialOpen: false, children: /* @__PURE__ */ jsxs131(Stack4, { spacing: 1, children: [
31988
- /* @__PURE__ */ jsxs131(Box16, { children: [
31989
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
31990
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31991
- /* @__PURE__ */ jsx141(Typography12, { "data-testid": EVENT_DETAILS_SPAN_ID_TEST_ID, variant: "body2", children: selectedEvent.span_id }),
31992
- /* @__PURE__ */ jsx141(CopyButton, { value: selectedEvent.span_id })
32237
+ /* @__PURE__ */ jsx142(Divider4, {}),
32238
+ /* @__PURE__ */ jsx142(ToggleSection, { headline: "Advanced Information", initialOpen: false, children: /* @__PURE__ */ jsxs132(Stack4, { spacing: 1, children: [
32239
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32240
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
32241
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32242
+ /* @__PURE__ */ jsx142(Typography13, { "data-testid": EVENT_DETAILS_SPAN_ID_TEST_ID, variant: "body2", children: selectedEvent.span_id }),
32243
+ /* @__PURE__ */ jsx142(CopyButton, { value: selectedEvent.span_id })
31993
32244
  ] })
31994
32245
  ] }),
31995
- /* @__PURE__ */ jsxs131(Box16, { children: [
31996
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
31997
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31998
- /* @__PURE__ */ jsx141(Typography12, { "data-testid": EVENT_DETAILS_TRACE_ID_TEST_ID, variant: "body2", children: selectedEvent.trace_id }),
31999
- /* @__PURE__ */ jsx141(CopyButton, { value: selectedEvent.trace_id })
32246
+ /* @__PURE__ */ jsxs132(Box17, { children: [
32247
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
32248
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32249
+ /* @__PURE__ */ jsx142(Typography13, { "data-testid": EVENT_DETAILS_TRACE_ID_TEST_ID, variant: "body2", children: selectedEvent.trace_id }),
32250
+ /* @__PURE__ */ jsx142(CopyButton, { value: selectedEvent.trace_id })
32000
32251
  ] })
32001
32252
  ] }),
32002
- requestId !== void 0 && /* @__PURE__ */ jsxs131(Box16, { children: [
32003
- /* @__PURE__ */ jsx141(Typography12, { sx: { fontWeight: 600 }, variant: "caption", children: "Request ID" }),
32004
- /* @__PURE__ */ jsxs131(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32005
- /* @__PURE__ */ jsx141(Typography12, { "data-testid": EVENT_DETAILS_REQUEST_ID_TEST_ID, variant: "body2", children: requestId }),
32006
- /* @__PURE__ */ jsx141(CopyButton, { value: requestId })
32253
+ requestId !== void 0 && /* @__PURE__ */ jsxs132(Box17, { children: [
32254
+ /* @__PURE__ */ jsx142(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Request ID" }),
32255
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
32256
+ /* @__PURE__ */ jsx142(Typography13, { "data-testid": EVENT_DETAILS_REQUEST_ID_TEST_ID, variant: "body2", children: requestId }),
32257
+ /* @__PURE__ */ jsx142(CopyButton, { value: requestId })
32007
32258
  ] })
32008
32259
  ] }),
32009
- eventGroups.info && /* @__PURE__ */ jsx141(EventDetail, { displayText: "Info", events: eventGroups.info, type: "info" })
32260
+ eventGroups.info && /* @__PURE__ */ jsx142(EventDetail, { displayText: "Info", events: eventGroups.info, type: "info" })
32010
32261
  ] }) })
32011
32262
  ] }) })
32012
32263
  ] });
@@ -32014,18 +32265,18 @@ var EventDetails = ({ onClose, selectedEvent }) => {
32014
32265
 
32015
32266
  // src/components/trace-graph/trace-graph.tsx
32016
32267
  import "@xyflow/react/dist/base.css";
32017
- import { Alert as Alert5, Button as Button6, useTheme as useTheme6 } from "@mui/material";
32268
+ import { Alert as Alert6, Button as Button7, useTheme as useTheme6 } from "@mui/material";
32018
32269
  import { Background, MarkerType, MiniMap, Position as Position2, ReactFlow, useEdgesState, useNodesState, useStore as useStore4 } from "@xyflow/react";
32019
- import { useCallback as useCallback10, useEffect as useEffect20, useRef as useRef15, useState as useState19 } from "react";
32270
+ import { useCallback as useCallback11, useEffect as useEffect21, useRef as useRef16, useState as useState20 } from "react";
32020
32271
 
32021
32272
  // src/components/trace-graph/service-node.tsx
32022
32273
  import { Cancel as Cancel4, GppBad as GppBad3 } from "@mui/icons-material";
32023
- import { Box as Box17, Divider as Divider5, Stack as Stack5, Tooltip as Tooltip6, Typography as Typography13, useTheme as useTheme4 } from "@mui/material";
32274
+ import { Box as Box18, Divider as Divider5, Stack as Stack5, Tooltip as Tooltip6, Typography as Typography14, useTheme as useTheme4 } from "@mui/material";
32024
32275
  import { Handle, Position } from "@xyflow/react";
32025
32276
  import "@xyflow/react/dist/style.css";
32026
32277
  import "react";
32027
- import { memo as memo11, useMemo as useMemo11, useRef as useRef14, useState as useState18 } from "react";
32028
- import { Fragment as Fragment11, jsx as jsx142, jsxs as jsxs132 } from "react/jsx-runtime";
32278
+ import { memo as memo11, useMemo as useMemo12, useRef as useRef15, useState as useState19 } from "react";
32279
+ import { Fragment as Fragment11, jsx as jsx143, jsxs as jsxs133 } from "react/jsx-runtime";
32029
32280
  var handleStyle = {
32030
32281
  backgroundColor: "white",
32031
32282
  borderColor: "lightgray",
@@ -32033,20 +32284,20 @@ var handleStyle = {
32033
32284
  };
32034
32285
  var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning }) => {
32035
32286
  const theme = useTheme4();
32036
- return /* @__PURE__ */ jsxs132(Fragment11, { children: [
32037
- /* @__PURE__ */ jsx142(Handle, { position: Position.Left, style: handleStyle, type: "target" }),
32038
- /* @__PURE__ */ jsx142(Handle, { position: Position.Right, style: handleStyle, type: "source" }),
32039
- /* @__PURE__ */ jsxs132(
32287
+ return /* @__PURE__ */ jsxs133(Fragment11, { children: [
32288
+ /* @__PURE__ */ jsx143(Handle, { position: Position.Left, style: handleStyle, type: "target" }),
32289
+ /* @__PURE__ */ jsx143(Handle, { position: Position.Right, style: handleStyle, type: "source" }),
32290
+ /* @__PURE__ */ jsxs133(
32040
32291
  Stack5,
32041
32292
  {
32042
32293
  alignItems: "center",
32043
32294
  direction: "row",
32044
32295
  sx: { gap: "8px", pb: "2px", pt: "6px", px: "8px" },
32045
32296
  children: [
32046
- /* @__PURE__ */ jsx142(Box17, { sx: { borderRadius: "4px", flexShrink: 0, lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx142(AwsServiceIcon, { hideTooltip: true, service: event.service_name, size: "medium" }) }),
32047
- /* @__PURE__ */ jsxs132(Stack5, { sx: expanded ? void 0 : { minWidth: 0 }, children: [
32048
- /* @__PURE__ */ jsx142(
32049
- Typography13,
32297
+ /* @__PURE__ */ jsx143(Box18, { sx: { borderRadius: "4px", flexShrink: 0, lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx143(AwsServiceIcon, { hideTooltip: true, service: event.service_name, size: "medium" }) }),
32298
+ /* @__PURE__ */ jsxs133(Stack5, { sx: expanded ? void 0 : { minWidth: 0 }, children: [
32299
+ /* @__PURE__ */ jsx143(
32300
+ Typography14,
32050
32301
  {
32051
32302
  noWrap: !expanded,
32052
32303
  sx: { fontWeight: 700, lineHeight: 1.25, ...expanded && { whiteSpace: "nowrap" } },
@@ -32054,8 +32305,8 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
32054
32305
  children: getServiceDisplayName(event.service_name)
32055
32306
  }
32056
32307
  ),
32057
- event.resource_name != "" && /* @__PURE__ */ jsx142(
32058
- Typography13,
32308
+ event.resource_name != "" && /* @__PURE__ */ jsx143(
32309
+ Typography14,
32059
32310
  {
32060
32311
  color: "text.secondary",
32061
32312
  noWrap: !expanded,
@@ -32068,16 +32319,16 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
32068
32319
  ]
32069
32320
  }
32070
32321
  ),
32071
- /* @__PURE__ */ jsx142(Divider5, { sx: { ml: "38px", mr: "8px", my: "5px" } }),
32072
- /* @__PURE__ */ jsxs132(
32322
+ /* @__PURE__ */ jsx143(Divider5, { sx: { ml: "38px", mr: "8px", my: "5px" } }),
32323
+ /* @__PURE__ */ jsxs133(
32073
32324
  Stack5,
32074
32325
  {
32075
32326
  alignItems: "center",
32076
32327
  direction: "row",
32077
32328
  sx: expanded ? { pb: "5px", pr: "8px", pt: "1px" } : { minWidth: 0, pb: "5px", pr: "8px", pt: "1px" },
32078
32329
  children: [
32079
- /* @__PURE__ */ jsxs132(
32080
- Box17,
32330
+ /* @__PURE__ */ jsxs133(
32331
+ Box18,
32081
32332
  {
32082
32333
  sx: {
32083
32334
  alignItems: "center",
@@ -32087,13 +32338,13 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
32087
32338
  width: "38px"
32088
32339
  },
32089
32340
  children: [
32090
- (isError || isWarning) && hasPermissionEvents && /* @__PURE__ */ jsx142(Tooltip6, { arrow: true, title: "Permission denied", children: /* @__PURE__ */ jsx142(GppBad3, { sx: { color: isError ? theme.palette.error.main : theme.palette.warning.main, fontSize: "16px" } }) }),
32091
- isError && !hasPermissionEvents && /* @__PURE__ */ jsx142(Tooltip6, { arrow: true, title: "Error", children: /* @__PURE__ */ jsx142(Cancel4, { sx: { color: theme.palette.error.main, fontSize: "16px" } }) })
32341
+ (isError || isWarning) && hasPermissionEvents && /* @__PURE__ */ jsx143(Tooltip6, { arrow: true, title: "Permission denied", children: /* @__PURE__ */ jsx143(GppBad3, { sx: { color: isError ? theme.palette.error.main : theme.palette.warning.main, fontSize: "16px" } }) }),
32342
+ isError && !hasPermissionEvents && /* @__PURE__ */ jsx143(Tooltip6, { arrow: true, title: "Error", children: /* @__PURE__ */ jsx143(Cancel4, { sx: { color: theme.palette.error.main, fontSize: "16px" } }) })
32092
32343
  ]
32093
32344
  }
32094
32345
  ),
32095
- /* @__PURE__ */ jsx142(
32096
- Typography13,
32346
+ /* @__PURE__ */ jsx143(
32347
+ Typography14,
32097
32348
  {
32098
32349
  "data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID,
32099
32350
  noWrap: !expanded,
@@ -32109,10 +32360,10 @@ var NodeContent = ({ event, expanded, hasPermissionEvents, isError, isWarning })
32109
32360
  };
32110
32361
  var ServiceNode = memo11(({ data, selected }) => {
32111
32362
  const theme = useTheme4();
32112
- const [isHovered, setIsHovered] = useState18(false);
32113
- const nodeRef = useRef14(null);
32363
+ const [isHovered, setIsHovered] = useState19(false);
32364
+ const nodeRef = useRef15(null);
32114
32365
  const { operation_status } = data.event;
32115
- const hasPermissionEventsLegacy = useMemo11(
32366
+ const hasPermissionEventsLegacy = useMemo12(
32116
32367
  () => data.event.events.some(
32117
32368
  (event) => event.event_type === "iam.policy_evaluation" && event.name === "iam.policy.denied"
32118
32369
  ),
@@ -32143,8 +32394,8 @@ var ServiceNode = memo11(({ data, selected }) => {
32143
32394
  const xyNode = nodeRef.current?.closest(".react-flow__node");
32144
32395
  if (xyNode) xyNode.style.zIndex = "";
32145
32396
  };
32146
- return /* @__PURE__ */ jsxs132(
32147
- Box17,
32397
+ return /* @__PURE__ */ jsxs133(
32398
+ Box18,
32148
32399
  {
32149
32400
  "data-testid": SERVICE_NODE_TEST_ID,
32150
32401
  onMouseEnter: handleMouseEnter,
@@ -32154,8 +32405,8 @@ var ServiceNode = memo11(({ data, selected }) => {
32154
32405
  sx: { display: "inline-block", position: "relative" },
32155
32406
  tabIndex: 0,
32156
32407
  children: [
32157
- /* @__PURE__ */ jsx142(
32158
- Box17,
32408
+ /* @__PURE__ */ jsx143(
32409
+ Box18,
32159
32410
  {
32160
32411
  sx: {
32161
32412
  ...sharedBoxSx,
@@ -32163,11 +32414,11 @@ var ServiceNode = memo11(({ data, selected }) => {
32163
32414
  maxWidth: 220,
32164
32415
  overflow: "hidden"
32165
32416
  },
32166
- children: /* @__PURE__ */ jsx142(NodeContent, { ...contentProps, expanded: false })
32417
+ children: /* @__PURE__ */ jsx143(NodeContent, { ...contentProps, expanded: false })
32167
32418
  }
32168
32419
  ),
32169
- /* @__PURE__ */ jsx142(
32170
- Box17,
32420
+ /* @__PURE__ */ jsx143(
32421
+ Box18,
32171
32422
  {
32172
32423
  onMouseLeave: handleMouseLeave,
32173
32424
  sx: {
@@ -32181,7 +32432,7 @@ var ServiceNode = memo11(({ data, selected }) => {
32181
32432
  width: "max-content",
32182
32433
  zIndex: 10
32183
32434
  },
32184
- children: /* @__PURE__ */ jsx142(NodeContent, { ...contentProps, expanded: true })
32435
+ children: /* @__PURE__ */ jsx143(NodeContent, { ...contentProps, expanded: true })
32185
32436
  }
32186
32437
  )
32187
32438
  ]
@@ -32276,11 +32527,11 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
32276
32527
 
32277
32528
  // src/components/trace-graph/xyflow/controls.tsx
32278
32529
  import { Add, FitScreen, Remove } from "@mui/icons-material";
32279
- import { Box as Box18, IconButton as IconButton6 } from "@mui/material";
32530
+ import { Box as Box19, IconButton as IconButton6 } from "@mui/material";
32280
32531
  import { useReactFlow, useStore as useStore2 } from "@xyflow/react";
32281
32532
  import { memo as memo12 } from "react";
32282
32533
  import { shallow } from "zustand/shallow";
32283
- import { jsx as jsx143, jsxs as jsxs133 } from "react/jsx-runtime";
32534
+ import { jsx as jsx144, jsxs as jsxs134 } from "react/jsx-runtime";
32284
32535
  var selector = (s) => ({
32285
32536
  isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,
32286
32537
  maxZoomReached: s.transform[2] >= s.maxZoom,
@@ -32298,8 +32549,8 @@ var Controls = memo12(() => {
32298
32549
  const onFitViewHandler = () => {
32299
32550
  void fitView();
32300
32551
  };
32301
- return /* @__PURE__ */ jsxs133(
32302
- Box18,
32552
+ return /* @__PURE__ */ jsxs134(
32553
+ Box19,
32303
32554
  {
32304
32555
  sx: {
32305
32556
  bottom: 0,
@@ -32312,33 +32563,33 @@ var Controls = memo12(() => {
32312
32563
  zIndex: 5
32313
32564
  },
32314
32565
  children: [
32315
- /* @__PURE__ */ jsx143(
32566
+ /* @__PURE__ */ jsx144(
32316
32567
  IconButton6,
32317
32568
  {
32318
32569
  className: "react-flow__controls-zoomin",
32319
32570
  disabled: maxZoomReached,
32320
32571
  onClick: onZoomInHandler,
32321
32572
  size: "small",
32322
- children: /* @__PURE__ */ jsx143(Add, {})
32573
+ children: /* @__PURE__ */ jsx144(Add, {})
32323
32574
  }
32324
32575
  ),
32325
- /* @__PURE__ */ jsx143(
32576
+ /* @__PURE__ */ jsx144(
32326
32577
  IconButton6,
32327
32578
  {
32328
32579
  className: "react-flow__controls-zoomout",
32329
32580
  disabled: minZoomReached,
32330
32581
  onClick: onZoomOutHandler,
32331
32582
  size: "small",
32332
- children: /* @__PURE__ */ jsx143(Remove, {})
32583
+ children: /* @__PURE__ */ jsx144(Remove, {})
32333
32584
  }
32334
32585
  ),
32335
- /* @__PURE__ */ jsx143(
32586
+ /* @__PURE__ */ jsx144(
32336
32587
  IconButton6,
32337
32588
  {
32338
32589
  className: "react-flow__controls-fitview",
32339
32590
  onClick: onFitViewHandler,
32340
32591
  size: "small",
32341
- children: /* @__PURE__ */ jsx143(FitScreen, {})
32592
+ children: /* @__PURE__ */ jsx144(FitScreen, {})
32342
32593
  }
32343
32594
  )
32344
32595
  ]
@@ -32350,7 +32601,7 @@ var Controls = memo12(() => {
32350
32601
  import { useTheme as useTheme5 } from "@mui/material";
32351
32602
  import { useStore as useStore3 } from "@xyflow/react";
32352
32603
  import { memo as memo13 } from "react";
32353
- import { jsx as jsx144, jsxs as jsxs134 } from "react/jsx-runtime";
32604
+ import { jsx as jsx145, jsxs as jsxs135 } from "react/jsx-runtime";
32354
32605
  var ICON_FRACTION = 0.35;
32355
32606
  var PADDING_FRACTION = 0.18;
32356
32607
  var ICON_NATIVE_SIZE = 80;
@@ -32379,10 +32630,10 @@ var MinimapServiceNode = memo13(({
32379
32630
  const dotY = y + height - padding - dotRadius;
32380
32631
  const outlineColor = selected ? isError ? errorColor : "#1a73e8" : "#cccccc";
32381
32632
  const outlineWidth = selected ? 2 : 1;
32382
- return /* @__PURE__ */ jsxs134("g", { onClick: onClick ? (event2) => {
32633
+ return /* @__PURE__ */ jsxs135("g", { onClick: onClick ? (event2) => {
32383
32634
  onClick(event2, id2);
32384
32635
  } : void 0, children: [
32385
- /* @__PURE__ */ jsx144(
32636
+ /* @__PURE__ */ jsx145(
32386
32637
  "rect",
32387
32638
  {
32388
32639
  fill: theme.palette.background.paper,
@@ -32396,7 +32647,7 @@ var MinimapServiceNode = memo13(({
32396
32647
  y
32397
32648
  }
32398
32649
  ),
32399
- isError && /* @__PURE__ */ jsx144(
32650
+ isError && /* @__PURE__ */ jsx145(
32400
32651
  "rect",
32401
32652
  {
32402
32653
  fill: errorColor,
@@ -32408,8 +32659,8 @@ var MinimapServiceNode = memo13(({
32408
32659
  y: y + 3
32409
32660
  }
32410
32661
  ),
32411
- Icon && /* @__PURE__ */ jsx144("g", { transform: `translate(${String(x + padding)}, ${String(y + padding)}) scale(${String(scale2)})`, children: /* @__PURE__ */ jsx144(Icon, { height: ICON_NATIVE_SIZE, width: ICON_NATIVE_SIZE }) }),
32412
- isError && Icon && /* @__PURE__ */ jsx144(
32662
+ Icon && /* @__PURE__ */ jsx145("g", { transform: `translate(${String(x + padding)}, ${String(y + padding)}) scale(${String(scale2)})`, children: /* @__PURE__ */ jsx145(Icon, { height: ICON_NATIVE_SIZE, width: ICON_NATIVE_SIZE }) }),
32663
+ isError && Icon && /* @__PURE__ */ jsx145(
32413
32664
  "circle",
32414
32665
  {
32415
32666
  cx: dotX,
@@ -32422,7 +32673,7 @@ var MinimapServiceNode = memo13(({
32422
32673
  });
32423
32674
 
32424
32675
  // src/components/trace-graph/trace-graph.tsx
32425
- import { Fragment as Fragment12, jsx as jsx145, jsxs as jsxs135 } from "react/jsx-runtime";
32676
+ import { Fragment as Fragment12, jsx as jsx146, jsxs as jsxs136 } from "react/jsx-runtime";
32426
32677
  var nodeTypes = {
32427
32678
  service: ServiceNode
32428
32679
  };
@@ -32430,7 +32681,7 @@ var ExtentUpdater = ({ onUpdate, viewportRef }) => {
32430
32681
  const zoom = useStore4((s) => s.transform[2]);
32431
32682
  const width = useStore4((s) => s.width);
32432
32683
  const height = useStore4((s) => s.height);
32433
- useEffect20(() => {
32684
+ useEffect21(() => {
32434
32685
  viewportRef.current = { height, width, zoom };
32435
32686
  onUpdate();
32436
32687
  }, [zoom, width, height, onUpdate, viewportRef]);
@@ -32444,10 +32695,10 @@ var TraceGraph = ({
32444
32695
  }) => {
32445
32696
  const [nodes2, setNodes, onNodesChange] = useNodesState([]);
32446
32697
  const [edges, setEdges] = useEdgesState([]);
32447
- const [translateExtent, setTranslateExtent] = useState19();
32448
- const nodeBoundsRef = useRef15(null);
32449
- const viewportRef = useRef15({ height: 0, width: 0, zoom: 1 });
32450
- const updateExtent = useCallback10(() => {
32698
+ const [translateExtent, setTranslateExtent] = useState20();
32699
+ const nodeBoundsRef = useRef16(null);
32700
+ const viewportRef = useRef16({ height: 0, width: 0, zoom: 1 });
32701
+ const updateExtent = useCallback11(() => {
32451
32702
  const bounds = nodeBoundsRef.current;
32452
32703
  const { height, width, zoom } = viewportRef.current;
32453
32704
  if (!bounds || width === 0 || height === 0) return;
@@ -32460,7 +32711,7 @@ var TraceGraph = ({
32460
32711
  [bounds.maxX + hMargin, bounds.maxY + vMargin]
32461
32712
  ]);
32462
32713
  }, []);
32463
- useEffect20(() => {
32714
+ useEffect21(() => {
32464
32715
  const allNodes = [];
32465
32716
  const allEdges = [];
32466
32717
  for (const span of spans.data ?? []) {
@@ -32533,11 +32784,11 @@ var TraceGraph = ({
32533
32784
  }
32534
32785
  }, [spans.data, initialFocusEventId, setNodes, setEdges, updateExtent]);
32535
32786
  const theme = useTheme6();
32536
- return /* @__PURE__ */ jsxs135(Fragment12, { children: [
32537
- spans.error && /* @__PURE__ */ jsxs135(
32538
- Alert5,
32787
+ return /* @__PURE__ */ jsxs136(Fragment12, { children: [
32788
+ spans.error && /* @__PURE__ */ jsxs136(
32789
+ Alert6,
32539
32790
  {
32540
- action: /* @__PURE__ */ jsx145(Button6, { onClick: () => {
32791
+ action: /* @__PURE__ */ jsx146(Button7, { onClick: () => {
32541
32792
  onRefresh();
32542
32793
  }, children: "Retry" }),
32543
32794
  severity: "error",
@@ -32549,7 +32800,7 @@ var TraceGraph = ({
32549
32800
  ]
32550
32801
  }
32551
32802
  ),
32552
- /* @__PURE__ */ jsxs135(
32803
+ /* @__PURE__ */ jsxs136(
32553
32804
  ReactFlow,
32554
32805
  {
32555
32806
  colorMode: theme.palette.mode,
@@ -32569,9 +32820,9 @@ var TraceGraph = ({
32569
32820
  selectNodesOnDrag: false,
32570
32821
  translateExtent,
32571
32822
  children: [
32572
- /* @__PURE__ */ jsx145(ExtentUpdater, { onUpdate: updateExtent, viewportRef }),
32573
- /* @__PURE__ */ jsx145(Controls, {}),
32574
- /* @__PURE__ */ jsx145(
32823
+ /* @__PURE__ */ jsx146(ExtentUpdater, { onUpdate: updateExtent, viewportRef }),
32824
+ /* @__PURE__ */ jsx146(Controls, {}),
32825
+ /* @__PURE__ */ jsx146(
32575
32826
  MiniMap,
32576
32827
  {
32577
32828
  nodeComponent: MinimapServiceNode,
@@ -32579,7 +32830,7 @@ var TraceGraph = ({
32579
32830
  zoomable: true
32580
32831
  }
32581
32832
  ),
32582
- /* @__PURE__ */ jsx145(
32833
+ /* @__PURE__ */ jsx146(
32583
32834
  Background,
32584
32835
  {
32585
32836
  bgColor: theme.palette.background.default,
@@ -32593,7 +32844,7 @@ var TraceGraph = ({
32593
32844
  };
32594
32845
 
32595
32846
  // src/pages/trace-graph-page.tsx
32596
- import { jsx as jsx146, jsxs as jsxs136 } from "react/jsx-runtime";
32847
+ import { jsx as jsx147, jsxs as jsxs137 } from "react/jsx-runtime";
32597
32848
  var DRAWER_WIDTH = "35%";
32598
32849
  var Main = styled("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
32599
32850
  flexGrow: 1,
@@ -32637,7 +32888,7 @@ var TraceGraphView = ({
32637
32888
  spans,
32638
32889
  traceId
32639
32890
  }) => {
32640
- return /* @__PURE__ */ jsxs136(
32891
+ return /* @__PURE__ */ jsxs137(
32641
32892
  Paper2,
32642
32893
  {
32643
32894
  "data-testid": TRACE_GRAPH_PAGE_TEST_ID,
@@ -32650,11 +32901,11 @@ var TraceGraphView = ({
32650
32901
  width: "100%"
32651
32902
  },
32652
32903
  children: [
32653
- /* @__PURE__ */ jsx146(Main, { open, children: /* @__PURE__ */ jsxs136(Box19, { sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
32654
- /* @__PURE__ */ jsx146(Box19, { sx: { display: "flex", px: 1, py: 1 }, children: /* @__PURE__ */ jsx146(Button7, { onClick: () => {
32904
+ /* @__PURE__ */ jsx147(Main, { open, children: /* @__PURE__ */ jsxs137(Box20, { sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
32905
+ /* @__PURE__ */ jsx147(Box20, { sx: { display: "flex", px: 1, py: 1 }, children: /* @__PURE__ */ jsx147(Button8, { onClick: () => {
32655
32906
  navigateToSpansList();
32656
- }, startIcon: /* @__PURE__ */ jsx146(ArrowBack, {}), children: "Go back" }) }),
32657
- /* @__PURE__ */ jsx146(Box19, { sx: { flexGrow: 1, overflow: "auto" }, children: traceId !== void 0 && /* @__PURE__ */ jsx146(ReactFlowProvider, { children: /* @__PURE__ */ jsx146(
32907
+ }, startIcon: /* @__PURE__ */ jsx147(ArrowBack, {}), children: "Go back" }) }),
32908
+ /* @__PURE__ */ jsx147(Box20, { sx: { flexGrow: 1, overflow: "auto" }, children: traceId !== void 0 && /* @__PURE__ */ jsx147(ReactFlowProvider, { children: /* @__PURE__ */ jsx147(
32658
32909
  TraceGraph,
32659
32910
  {
32660
32911
  initialFocusEventId: spanId,
@@ -32670,7 +32921,7 @@ var TraceGraphView = ({
32670
32921
  }
32671
32922
  ) }) })
32672
32923
  ] }) }),
32673
- /* @__PURE__ */ jsx146(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx146(EventDetails, { onClose: handleClose, selectedEvent }) })
32924
+ /* @__PURE__ */ jsx147(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx147(EventDetails, { onClose: handleClose, selectedEvent }) })
32674
32925
  ]
32675
32926
  }
32676
32927
  );
@@ -32718,10 +32969,10 @@ async function fetchConnectedTracesWaterfall(api, traceIds, allSpans = /* @__PUR
32718
32969
  }
32719
32970
  var TraceGraphPage = ({ onClose, spanId, traceId }) => {
32720
32971
  const api = useAppInspectorApi();
32721
- const [spans, setSpans] = useState20();
32722
- const [loading, setLoading] = useState20(false);
32723
- const [fetchError, setFetchError] = useState20();
32724
- const fetchSpans = useCallback11(async () => {
32972
+ const [spans, setSpans] = useState21();
32973
+ const [loading, setLoading] = useState21(false);
32974
+ const [fetchError, setFetchError] = useState21();
32975
+ const fetchSpans = useCallback12(async () => {
32725
32976
  setLoading(true);
32726
32977
  try {
32727
32978
  const spans2 = await fetchConnectedTraces(api, traceId);
@@ -32734,27 +32985,27 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
32734
32985
  setLoading(false);
32735
32986
  }
32736
32987
  }, [api, traceId]);
32737
- useEffect21(() => {
32988
+ useEffect22(() => {
32738
32989
  void fetchSpans();
32739
32990
  }, [fetchSpans]);
32740
- const [open, setOpen] = useState20(true);
32741
- const [selectedEvent, setSelectedEvent] = useState20(() => spans?.find((span) => span.span_id === spanId));
32742
- const spansReference = useRef16();
32743
- useEffect21(() => {
32991
+ const [open, setOpen] = useState21(true);
32992
+ const [selectedEvent, setSelectedEvent] = useState21(() => spans?.find((span) => span.span_id === spanId));
32993
+ const spansReference = useRef17();
32994
+ useEffect22(() => {
32744
32995
  if (!spansReference.current && spans) {
32745
32996
  setSelectedEvent(spans.find((span) => span.span_id === spanId));
32746
32997
  spansReference.current = spans;
32747
32998
  }
32748
32999
  }, [spans, setSelectedEvent, spanId]);
32749
- const handleEventSelect = useCallback11((spanId2) => {
33000
+ const handleEventSelect = useCallback12((spanId2) => {
32750
33001
  const span = spans?.find((s) => s.span_id === spanId2);
32751
33002
  setSelectedEvent(span);
32752
33003
  setOpen(true);
32753
33004
  }, [spans]);
32754
- const navigateToSpansList = useCallback11(() => {
33005
+ const navigateToSpansList = useCallback12(() => {
32755
33006
  onClose?.();
32756
33007
  }, [onClose]);
32757
- return /* @__PURE__ */ jsx146(
33008
+ return /* @__PURE__ */ jsx147(
32758
33009
  TraceGraphView,
32759
33010
  {
32760
33011
  fetchError,
@@ -32775,57 +33026,67 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
32775
33026
  };
32776
33027
 
32777
33028
  // src/pages/spans-list-page.tsx
32778
- import { jsx as jsx147, jsxs as jsxs137 } from "react/jsx-runtime";
33029
+ import { jsx as jsx148, jsxs as jsxs138 } from "react/jsx-runtime";
32779
33030
  var SpansListPage = () => {
32780
33031
  const api = useAppInspectorApi();
32781
33032
  const {
32782
33033
  clearFetchError,
32783
33034
  clearingSpans,
32784
33035
  clearSpans,
33036
+ consumerValues,
32785
33037
  errorCount,
32786
33038
  fetchError,
32787
33039
  fetchForward,
32788
33040
  fetchingBackward,
32789
33041
  fetchingForward,
33042
+ filteredErrorCount,
33043
+ filteredSpans,
33044
+ filteredWarningCount,
33045
+ filters,
33046
+ hasExternalProducer,
32790
33047
  hasMoreBackward,
32791
33048
  hasMoreForward,
32792
33049
  licenseLimit,
33050
+ producerValues,
33051
+ retryWorker,
32793
33052
  search,
32794
33053
  searching,
33054
+ setFilters,
32795
33055
  setSearch,
32796
- spans,
33056
+ statusValues,
32797
33057
  systemLimit,
32798
33058
  totalCount,
32799
- warningCount
33059
+ warningCount,
33060
+ workerError
32800
33061
  } = useSpans();
32801
33062
  const { checkStatus, phase, status, statusError } = useAppInspectorStatus();
32802
- const clearSpansSync = useCallback12(() => {
33063
+ const clearSpansSync = useCallback13(() => {
32803
33064
  void clearSpans();
32804
33065
  }, [clearSpans]);
32805
33066
  const localstackVersion = status?.localstackVersion ?? (statusError instanceof AppInspectorNotFoundError ? statusError.localstackVersion : void 0);
32806
33067
  const versionCompatibility = checkEmulatorVersion(localstackVersion);
32807
33068
  const searchSupported = emulatorSupportsSearch(localstackVersion);
32808
- const [bannerDismissed, setBannerDismissed] = useState21(false);
33069
+ const [bannerDismissed, setBannerDismissed] = useState22(false);
32809
33070
  const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
32810
- const [selectedTraceId, setSelectedTraceId] = useState21();
32811
- const [selectedSpanId, setSelectedSpanId] = useState21();
32812
- const navigateToSpan = useCallback12((span) => {
33071
+ const [selectedTraceId, setSelectedTraceId] = useState22();
33072
+ const [selectedSpanId, setSelectedSpanId] = useState22();
33073
+ const navigateToSpan = useCallback13((span) => {
32813
33074
  setSelectedTraceId(span.trace_id);
32814
33075
  setSelectedSpanId(span.span_id);
32815
33076
  }, []);
32816
- const handleRetry = useCallback12(() => {
33077
+ const handleRetry = useCallback13(() => {
32817
33078
  checkStatus();
32818
33079
  fetchForward();
32819
33080
  }, [checkStatus, fetchForward]);
32820
- const handleEnable = useCallback12(async () => {
33081
+ const handleEnable = useCallback13(async () => {
32821
33082
  await api.setStatus({ status: "ENABLED" });
32822
33083
  clearFetchError();
32823
33084
  checkStatus();
32824
33085
  }, [api, checkStatus, clearFetchError]);
32825
- const isDelayedRefetchRef = useRef17(false);
32826
- const delayedRefetchTimerRef = useRef17();
32827
- const prevFetchingForwardRef = useRef17(false);
32828
- useEffect22(() => {
33086
+ const isDelayedRefetchRef = useRef18(false);
33087
+ const delayedRefetchTimerRef = useRef18();
33088
+ const prevFetchingForwardRef = useRef18(false);
33089
+ useEffect23(() => {
32829
33090
  const wasFetching = prevFetchingForwardRef.current;
32830
33091
  prevFetchingForwardRef.current = fetchingForward;
32831
33092
  if (wasFetching && !fetchingForward) {
@@ -32846,10 +33107,10 @@ var SpansListPage = () => {
32846
33107
  switch (phase) {
32847
33108
  case "CHECKING_STATUS":
32848
33109
  case "CONNECTING_WS": {
32849
- return /* @__PURE__ */ jsx147(StatusMessage, { phase });
33110
+ return /* @__PURE__ */ jsx148(StatusMessage, { phase });
32850
33111
  }
32851
33112
  case "DISABLED": {
32852
- return /* @__PURE__ */ jsx147(
33113
+ return /* @__PURE__ */ jsx148(
32853
33114
  StatusMessage,
32854
33115
  {
32855
33116
  onEnable: handleEnable,
@@ -32858,7 +33119,7 @@ var SpansListPage = () => {
32858
33119
  );
32859
33120
  }
32860
33121
  case "INCOMPATIBLE": {
32861
- return /* @__PURE__ */ jsx147(
33122
+ return /* @__PURE__ */ jsx148(
32862
33123
  StatusMessage,
32863
33124
  {
32864
33125
  localstackVersion,
@@ -32868,10 +33129,13 @@ var SpansListPage = () => {
32868
33129
  );
32869
33130
  }
32870
33131
  case "LIVE": {
33132
+ if (workerError) {
33133
+ return /* @__PURE__ */ jsx148(WorkerErrorMessage, { error: workerError, onRetry: retryWorker });
33134
+ }
32871
33135
  break;
32872
33136
  }
32873
33137
  case "UNREACHABLE": {
32874
- return /* @__PURE__ */ jsx147(
33138
+ return /* @__PURE__ */ jsx148(
32875
33139
  StatusMessage,
32876
33140
  {
32877
33141
  onRetry: handleRetry,
@@ -32880,9 +33144,9 @@ var SpansListPage = () => {
32880
33144
  );
32881
33145
  }
32882
33146
  }
32883
- return /* @__PURE__ */ jsxs137(Paper3, { square: true, sx: { display: "flex", flexDirection: "column", flexGrow: 1 }, children: [
32884
- /* @__PURE__ */ jsxs137(
32885
- Box20,
33147
+ return /* @__PURE__ */ jsxs138(Paper3, { square: true, sx: { display: "flex", flexDirection: "column", flexGrow: 1 }, children: [
33148
+ /* @__PURE__ */ jsxs138(
33149
+ Box21,
32886
33150
  {
32887
33151
  "data-testid": SPANS_LIST_PAGE_TEST_ID,
32888
33152
  sx: {
@@ -32897,7 +33161,7 @@ var SpansListPage = () => {
32897
33161
  width: "100%"
32898
33162
  },
32899
33163
  children: [
32900
- /* @__PURE__ */ jsx147(
33164
+ /* @__PURE__ */ jsx148(
32901
33165
  EmulatorVersionBanner,
32902
33166
  {
32903
33167
  compatibility: bannerDismissed && versionCompatibility === "warning" ? "ok" : versionCompatibility,
@@ -32907,27 +33171,35 @@ var SpansListPage = () => {
32907
33171
  } : void 0
32908
33172
  }
32909
33173
  ),
32910
- /* @__PURE__ */ jsx147(
33174
+ /* @__PURE__ */ jsx148(
32911
33175
  SpansList,
32912
33176
  {
32913
33177
  clearingSpans,
33178
+ consumerValues,
32914
33179
  errorCount,
32915
33180
  fetchError,
32916
33181
  fetchingBackward,
32917
33182
  fetchingForward,
33183
+ filteredErrorCount,
33184
+ filteredSpans,
33185
+ filteredWarningCount,
33186
+ filters,
33187
+ hasExternalProducer,
32918
33188
  hasMoreBackward,
32919
33189
  hasMoreForward,
32920
33190
  licenseLimit,
32921
33191
  onClearSpans: clearSpansSync,
32922
33192
  onFetchForward: fetchForward,
33193
+ onFiltersChange: setFilters,
32923
33194
  onOrderChange: setOrder,
32924
33195
  onSearchChange: setSearch,
32925
33196
  onSpanClick: navigateToSpan,
32926
33197
  order: order2,
33198
+ producerValues,
32927
33199
  search,
32928
33200
  searching,
32929
33201
  searchSupported,
32930
- spans,
33202
+ statusValues,
32931
33203
  systemLimit,
32932
33204
  totalCount,
32933
33205
  warningCount
@@ -32936,7 +33208,7 @@ var SpansListPage = () => {
32936
33208
  ]
32937
33209
  }
32938
33210
  ),
32939
- selectedTraceId !== void 0 && /* @__PURE__ */ jsx147(TraceGraphPage, { onClose: () => {
33211
+ selectedTraceId !== void 0 && /* @__PURE__ */ jsx148(TraceGraphPage, { onClose: () => {
32940
33212
  setSelectedTraceId(void 0);
32941
33213
  }, spanId: selectedSpanId, traceId: selectedTraceId })
32942
33214
  ] });